emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leslie Watter <leslie@watter.net>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	"Doyley, Marvin M." <mdoyley@ur.rochester.edu>
Subject: Re: latex newcommand in org
Date: Fri, 20 May 2016 18:00:07 -0300	[thread overview]
Message-ID: <CAKoz4gmwU8Gv--JVq5_2LHBO0vYe9TsZB1Wif+GbyESqg8mf_A@mail.gmail.com> (raw)
In-Reply-To: <87a8jkpl02.fsf@mbork.pl>

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

You can use also macros in combination with latex \newcommand:

Following there's a sample with html:

#+MACRO: color @@html:<span style="color: $1">$2</span>@@
# macro sample: {{{color(red, aceitação)}}}


Note: untested with latex newcommand....1


Cheers,

LEslie



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  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
>
>


-- 
Leslie H. Watter

[-- Attachment #2: Type: text/html, Size: 3348 bytes --]

  parent reply	other threads:[~2016-05-20 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4623b22355d94329a72b69bd254e036d@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-05-20 18:45 ` latex newcommand in org Eric S Fraga
2016-05-20 19:50   ` Marcin Borkowski
2016-05-20 20:37     ` Doyley, Marvin M.
2016-05-20 21:00     ` Leslie Watter [this message]
2016-05-20 23:45       ` Doyley, Marvin M.
     [not found]       ` <600dd6834d16428ba8a66f9bdd1b0f14@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-05-21 11:00         ` Eric S Fraga
2016-05-21 16:24           ` Marcin Borkowski
2016-05-20 18:10 Doyley, Marvin M.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKoz4gmwU8Gv--JVq5_2LHBO0vYe9TsZB1Wif+GbyESqg8mf_A@mail.gmail.com \
    --to=leslie@watter.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=mbork@mbork.pl \
    --cc=mdoyley@ur.rochester.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).