emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: New markup for revising manuscripts
@ 2017-03-11 13:41 John Kitchin
  0 siblings, 0 replies; 19+ messages in thread
From: John Kitchin @ 2017-03-11 13:41 UTC (permalink / raw)
  To: Eric S Fraga, emacs-orgmode@gnu org

I like this a lot!

On March 11, 2017, at 8:39 AM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

On Friday, 10 Mar 2017 at 20:33, Doyley, Marvin M. wrote:
> Hi there,
>
> When revising manuscripts, I usually highlight the changes (response
> to reviewer) in red. I use typically do this as follows:
> (1) #+latex_header: \newcommand{\response}[1]{\textcolor{red}{#1}}
> (2) \response{changes)
>
> Is there a more elegant way to do this ?

I don't know about elegant but my approach is to subvert the +...+
emphasis markers.  These usually indicate strike-through, something I
never use.  Instead, I have +some text+ be highlighted and exported to
LaTeX and HTML as such.

To achieve this, I customise a number org variables.  It took me some
time to find how I actually did this as it's been part of my org setup
for years, so much so that I almost thought it was default behaviour!
In any case, the following is an elided extract from my customised
variables:

#+begin_src emacs-lisp
  (custom-set-variables
   '(org-emphasis-alist
     (quote
      (("*" bold)
       ("/" italic)
       ("_" underline)
       ("=" org-verbatim verbatim)
       ("~" org-code verbatim)
       ("+" highlight))))
   '(org-html-text-markup-alist
     (quote
      ((bold . "<b>%s</b>")
       (code . "<code>%s</code>")
       (italic . "<i>%s</i>")
       (strike-through . "<span style=\"background-color: #ffff80;\">%s</span>")
       (underline . "<span class=\"underline\">%s</span>")
       (verbatim . "<code>%s</code>"))))
   '(org-latex-text-markup-alist
     (quote
      ((bold . "\\textbf{%s}")
       (code . protectedtexttt)
       (italic . "\\emph{%s}")
       (strike-through . "\\hl{%s}")
       (underline . "\\uline{%s}")
       (verbatim . protectedtexttt)))))
#+end_src 

There are basically copies of the defaults with the strike-through
element changed.

Now I can write +highlighted text+ which appears as you wish in both
HTML and LaTeX exports as well as on the screen (customise the highlight
face to get what you want on screen).  For LaTeX, you also have to

  (add-to-list 'org-latex-packages-alist '("" "soul"))

which provides the \hl{} LaTeX command.

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: New markup for revising manuscripts
@ 2017-03-13 17:25 Doyley, Marvin M.
  0 siblings, 0 replies; 19+ messages in thread
From: Doyley, Marvin M. @ 2017-03-13 17:25 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode@gnu.org, John Kitchin


[-- Attachment #1.1: Type: text/plain, Size: 2165 bytes --]

Hi Eric,

I really appreciate this. I will try it out too.

Cheers,
M
On Friday, 10 Mar 2017 at 20:33, Doyley, Marvin M. wrote:
> Hi there,
>
> When revising manuscripts, I usually highlight the changes (response
> to reviewer) in red. I use typically do this as follows:
> (1) #+latex_header: \newcommand{\response}[1]{\textcolor{red}{#1}}
> (2) \response{changes)
>
> Is there a more elegant way to do this ?

I don't know about elegant but my approach is to subvert the +...+
emphasis markers.  These usually indicate strike-through, something I
never use.  Instead, I have +some text+ be highlighted and exported to
LaTeX and HTML as such.

To achieve this, I customise a number org variables.  It took me some
time to find how I actually did this as it's been part of my org setup
for years, so much so that I almost thought it was default behaviour!
In any case, the following is an elided extract from my customised
variables:

#+begin_src emacs-lisp
  (custom-set-variables
   '(org-emphasis-alist
     (quote
      (("*" bold)
       ("/" italic)
       ("_" underline)
       ("=" org-verbatim verbatim)
       ("~" org-code verbatim)
       ("+" highlight))))
   '(org-html-text-markup-alist
     (quote
      ((bold . "<b>%s</b>")
       (code . "<code>%s</code>")
       (italic . "<i>%s</i>")
       (strike-through . "<span style=\"background-color: #ffff80;\">%s</span>")
       (underline . "<span class=\"underline\">%s</span>")
       (verbatim . "<code>%s</code>"))))
   '(org-latex-text-markup-alist
     (quote
      ((bold . "\\textbf{%s}")
       (code . protectedtexttt)
       (italic . "\\emph{%s}")
       (strike-through . "\\hl{%s}")
       (underline . "\\uline{%s}")
       (verbatim . protectedtexttt)))))
#+end_src

There are basically copies of the defaults with the strike-through
element changed.

Now I can write +highlighted text+ which appears as you wish in both
HTML and LaTeX exports as well as on the screen (customise the highlight
face to get what you want on screen).  For LaTeX, you also have to

  (add-to-list 'org-latex-packages-alist '("" "soul"))


[-- Attachment #1.2: Type: text/html, Size: 2868 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 496 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <46e4a91c14b34c5682a51f7b9cd5f7bd@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>]
[parent not found: <63b8c6bce92349fe95acb0c37536e965@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>]
* New markup for revising manuscripts
@ 2017-03-10 20:33 Doyley, Marvin M.
  2017-03-10 20:56 ` Eric Abrahamsen
  2017-03-10 20:56 ` Kaushal Modi
  0 siblings, 2 replies; 19+ messages in thread
From: Doyley, Marvin M. @ 2017-03-10 20:33 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

Hi there,

When revising manuscripts, I usually highlight the changes (response to reviewer) in red. I use typically do this as follows:
(1) #+latex_header: \newcommand{\response}[1]{\textcolor{red}{#1}}
(2) \response{changes)

Is there a more elegant way to do this ?  It would be nice if I could change the color of the select text in both org and the exported latex file to red. Seeing the highlighted text in org would be a huge plus.

Thanks
M

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 496 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-03-14  7:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-11 13:41 New markup for revising manuscripts John Kitchin
  -- strict thread matches above, loose matches on Subject: below --
2017-03-13 17:25 Doyley, Marvin M.
     [not found] <46e4a91c14b34c5682a51f7b9cd5f7bd@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-11 16:30 ` Eric S Fraga
     [not found] <63b8c6bce92349fe95acb0c37536e965@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-11 10:59 ` Eric S Fraga
2017-03-10 20:33 Doyley, Marvin M.
2017-03-10 20:56 ` Eric Abrahamsen
2017-03-10 20:56 ` Kaushal Modi
2017-03-10 21:47   ` John Kitchin
2017-03-11 11:35     ` Doyley, Marvin M.
2017-03-11 12:49     ` Doyley, Marvin M.
2017-03-11 12:55       ` John Kitchin
2017-03-11 14:08         ` Doyley, Marvin M.
2017-03-11 18:22           ` John Kitchin
2017-03-11 23:26             ` Doyley, Marvin M.
2017-03-12 18:16               ` John Kitchin
     [not found]             ` <25102de79a684cbea8543fdd8cc40188@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-12 14:12               ` Eric S Fraga
     [not found]           ` <037b006014244b1d874f76eea80b0f3a@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-12 13:54             ` Eric S Fraga
2017-03-13 22:56     ` Doyley, Marvin M.
     [not found]     ` <6ac43f7bdf5a4070807af1dfee9be4ea@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-14  7:25       ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).