emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using color in latex export
@ 2014-09-12 19:13 Chaitanya Krishna
  2014-09-12 19:29 ` Nick Dokos
  2014-09-12 19:53 ` Thomas S. Dye
  0 siblings, 2 replies; 4+ messages in thread
From: Chaitanya Krishna @ 2014-09-12 19:13 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello all,

I would like to have some text in color when I export my org document to
latex.

I tried this:
...
#+latex_header: \usepackage{color}
\textcolor{red}{Text I want in red}
...

But, this is producing
...
\usepackage{color}
\textcolor{red}\{Text I want in red\} in the exported latex document.
...

How can I properly export the org file to latex and still have colored
text. How can I escape braces '{'?

Best regards,
Chai

-- 
42

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

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

* Re: Using color in latex export
  2014-09-12 19:13 Using color in latex export Chaitanya Krishna
@ 2014-09-12 19:29 ` Nick Dokos
  2014-09-12 19:53 ` Thomas S. Dye
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2014-09-12 19:29 UTC (permalink / raw)
  To: emacs-orgmode

Chaitanya Krishna <icymist@gmail.com> writes:

> Hello all,
>
> I would like to have some text in color when I export my org document to latex.
>
> I tried this:
> ...
> #+latex_header: \usepackage{color}
> \textcolor{red}{Text I want in red}
> ...
>
> But, this is producing
> ...
> \usepackage{color}
> \textcolor{red}\{Text I want in red\} in the exported latex document.
> ...
>
> How can I properly export the org file to latex and still have colored text. How can I escape braces '{'?
>

Try this:

--8<---------------cut here---------------start------------->8---
Here is some @@latex:\textcolor{red}{red text}@@
--8<---------------cut here---------------end--------------->8---

Nick

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

* Re: Using color in latex export
  2014-09-12 19:13 Using color in latex export Chaitanya Krishna
  2014-09-12 19:29 ` Nick Dokos
@ 2014-09-12 19:53 ` Thomas S. Dye
  2014-09-13 10:05   ` Chaitanya Krishna
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2014-09-12 19:53 UTC (permalink / raw)
  To: Chaitanya Krishna; +Cc: emacs-orgmode

Aloha Chai,

Chaitanya Krishna <icymist@gmail.com> writes:

> Hello all,
>
> I would like to have some text in color when I export my org document to
> latex.
>
> I tried this:
> ...
> #+latex_header: \usepackage{color}
> \textcolor{red}{Text I want in red}

One way is with a macro, e.g.,

#+MACRO: red \textcolor{red}{$1}

This is {{{red(Text I want in red)}}}.

Which exports to

This is \textcolor{red}{Text I want in red}.


Or, more generally,
#+MACRO: color \textcolor{$1}{$2}

This is {{{color(green,Text I want in green)}}}.

Which exports to
This is \textcolor{green}{Text I want in green}.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Using color in latex export
  2014-09-12 19:53 ` Thomas S. Dye
@ 2014-09-13 10:05   ` Chaitanya Krishna
  0 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Krishna @ 2014-09-13 10:05 UTC (permalink / raw)
  To: emacs-orgmode

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

Thank you (Nick and Tom). Both the solutions above worked.

Regards,
Chai

On Fri, Sep 12, 2014 at 9:53 PM, Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha Chai,
>
> Chaitanya Krishna <icymist@gmail.com> writes:
>
> > Hello all,
> >
> > I would like to have some text in color when I export my org document to
> > latex.
> >
> > I tried this:
> > ...
> > #+latex_header: \usepackage{color}
> > \textcolor{red}{Text I want in red}
>
> One way is with a macro, e.g.,
>
> #+MACRO: red \textcolor{red}{$1}
>
> This is {{{red(Text I want in red)}}}.
>
> Which exports to
>
> This is \textcolor{red}{Text I want in red}.
>
>
> Or, more generally,
> #+MACRO: color \textcolor{$1}{$2}
>
> This is {{{color(green,Text I want in green)}}}.
>
> Which exports to
> This is \textcolor{green}{Text I want in green}.
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>



-- 
42

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

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

end of thread, other threads:[~2014-09-13 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 19:13 Using color in latex export Chaitanya Krishna
2014-09-12 19:29 ` Nick Dokos
2014-09-12 19:53 ` Thomas S. Dye
2014-09-13 10:05   ` Chaitanya Krishna

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