From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leslie Watter Subject: Re: latex newcommand in org Date: Fri, 20 May 2016 18:00:07 -0300 Message-ID: References: <4623b22355d94329a72b69bd254e036d@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87k2iomuvb.fsf@ucl.ac.uk> <87a8jkpl02.fsf@mbork.pl> Reply-To: leslie@watter.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ec80c56446e05334c61bd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3t81-0003fN-Rq for emacs-orgmode@gnu.org; Fri, 20 May 2016 18:42:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3rX2-0000j3-7w for emacs-orgmode@gnu.org; Fri, 20 May 2016 17:00:29 -0400 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]:33437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3rX2-0000iy-1m for emacs-orgmode@gnu.org; Fri, 20 May 2016 17:00:28 -0400 Received: by mail-io0-x244.google.com with SMTP id x35so22819449ioi.0 for ; Fri, 20 May 2016 14:00:27 -0700 (PDT) In-Reply-To: <87a8jkpl02.fsf@mbork.pl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Marcin Borkowski Cc: "emacs-orgmode@gnu.org" , "Doyley, Marvin M." --001a113ec80c56446e05334c61bd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use also macros in combination with latex \newcommand: Following there's a sample with html: #+MACRO: color @@html:$2@@ # macro sample: {{{color(red, aceita=C3=A7=C3=A3o)}}} Note: untested with latex newcommand....1 Cheers, LEslie On Fri, May 20, 2016 at 4:50 PM, Marcin Borkowski wrote: > > On 2016-05-20, at 20:45, Eric S Fraga wrote: > > > On Friday, 20 May 2016 at 18:10, Doyley, Marvin M. wrote: > >> Hi there, > >> > >> In my group, we typically response to reviewers comments (in latex) by > first defining the following command in the header > >> > >> \newcommand{\response}[1]{\textcolor{red}{#1}} > >> then marking up the text as follows > >> > >> \response{red text} > >> > >> I try to do the same in org, i.e., putting > >> #+latex_header:\newcommand{\response}[1]{\textcolor{red}{#1}} > >> then \response{BLAH BLAH} in the text. The only snag is that on export > I get \response\{BLAH BLAH\} > > > > Easiest solution is @@latex:\response{blah blah}@@ but that will lose > you > > all the org formatting. Longer solution is to use environments, such a= s > > > > #+begin_response > > blah blah blah > > #+end_response > > > > and define a "response" LaTeX environment, along these lines: > > > > #+latex_header: > \makeatletter\newenvironment{response}{\textcolor{red}}{}\makeatother > > > > (untested) > > Notice also that commands and environments in LaTeX are not > interchangeable; there are things only commands can do and things only > environments can do. (Well, not really - technically, I guess, > environments are strictly more powerful than commands, though I'm not > 100% sure - but some things are quite difficult to do with environments > and trivial with commands.) > > See also > > http://tex.stackexchange.com/questions/102141/what-are-the-consideration-= when-choosing-either-newcommand-or-newenvironment > > Best, > > -- > Marcin Borkowski > http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski > Faculty of Mathematics and Computer Science > Adam Mickiewicz University > > --=20 Leslie H. Watter --001a113ec80c56446e05334c61bd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You can use also macros in combination with latex \newcomm= and:

Following there's a sample with html:
<= br>
#+MACRO: color @@html:<span style=3D"color: $1&q= uot;>$2</span>@@
# macro sample: {{{color(red, aceita=C3= =A7=C3=A3o)}}}=C2=A0


Note: un= tested with latex newcommand....1


C= heers,

LEslie


<= /div>

On Fri= , May 20, 2016 at 4:50 PM, Marcin Borkowski <mbork@mbork.pl> = wrote:

On 2016-05-20, at 20:45, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> On Friday, 20 May 2016 at 18:10, Doyley, Marvin M. wrote:
>> Hi there,
>>
>> In my group, we typically response to reviewers comments (in latex= ) by first defining the=C2=A0 following command in the header
>>
>> \newcommand{\response}[1]{\textcolor{red}{#1}}
>> then marking up the text as follows
>>
>> \response{red text}
>>
>> I try to do the same in org,=C2=A0 i.e., putting
>>=C2=A0 #+latex_header:\newcommand{\response}[1]{\textcolor{red}{#1}= }
>> then \response{BLAH BLAH} in the text. The only snag is that on ex= port I get \response\{BLAH BLAH\}
>
> Easiest solution is @@latex:\response{blah blah}@@ but that will lose = you
> all the org formatting.=C2=A0 Longer solution is to use environments, = such as
>
> #+begin_response
> blah blah blah
> #+end_response
>
> and define a "response" LaTeX environment, along these lines= :
>
> #+latex_header: \makeatletter\newenvironment{response}{\textcolor{red}= }{}\makeatother
>
> (untested)

Notice also that commands and environments in LaTeX are not
interchangeable; there are things only commands can do and things only
environments can do.=C2=A0 (Well, not really - technically, I guess,
environments are strictly more powerful than commands, though I'm not 100% sure - but some things are quite difficult to do with environments
and trivial with commands.)

See also
http://tex.stackexchange.com/questions/102141/what-ar= e-the-consideration-when-choosing-either-newcommand-or-newenvironment
Best,

--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




--
Leslie H. Watter
--001a113ec80c56446e05334c61bd--