[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] latex newcommand in org
From: |
Marcin Borkowski |
Subject: |
Re: [O] latex newcommand in org |
Date: |
Fri, 20 May 2016 21:50:05 +0200 |
User-agent: |
mu4e 0.9.16; emacs 25.1.50.1 |
On 2016-05-20, at 20:45, Eric S Fraga <address@hidden> 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 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. (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
- [O] latex newcommand in org, Doyley, Marvin M., 2016/05/20
- Re: [O] latex newcommand in org, Eric S Fraga, 2016/05/20
- Re: [O] latex newcommand in org,
Marcin Borkowski <=
- Re: [O] latex newcommand in org, Doyley, Marvin M., 2016/05/20
- Re: [O] latex newcommand in org, Leslie Watter, 2016/05/20
- Re: [O] latex newcommand in org, Doyley, Marvin M., 2016/05/20
- Message not available
- Re: [O] latex newcommand in org, Eric S Fraga, 2016/05/21
- Re: [O] latex newcommand in org, Marcin Borkowski, 2016/05/21