emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export latex in a table
@ 2013-09-21  9:01 zwz
  2013-09-21 10:39 ` Rasmus
  0 siblings, 1 reply; 5+ messages in thread
From: zwz @ 2013-09-21  9:01 UTC (permalink / raw)
  To: emacs-orgmode

Hi, I want to export a table to pdf as follows:

* test
| \textcolor{red}{range} | \textcolor{blue}{0\sim2^{8}-1} |

I checked the generated tex.
The first column is OK. While in the second column, the result is something
like:
\textcolor{blue}\{...\}

I don't know what is the right way doing this, but it worked for org-mode <
8.0. 

May somebody help me out?

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

* Re: export latex in a table
  2013-09-21  9:01 export latex in a table zwz
@ 2013-09-21 10:39 ` Rasmus
  2013-09-21 11:25   ` zwz
  0 siblings, 1 reply; 5+ messages in thread
From: Rasmus @ 2013-09-21 10:39 UTC (permalink / raw)
  To: emacs-orgmode

zwz <zhangweize@gmail.com> writes:

I'm assuming you're only interested in LaTeX output here.

> Hi, I want to export a table to pdf as follows:
>
> * test
> | \textcolor{red}{range} | \textcolor{blue}{0\sim2^{8}-1} |

How about this? 

#+MACRO: color  \textcolor{$1}{$2}
| {{{color(red, range)}}} | {{{color(blue, 0\sim2^8-1)}}} |

Unless you're doing something that's not systematic, or which has a
very particular logic it's probably not the right way.

If all entries in a column/row need to be colored you should specify
that rather than doing it manually.  You could use tabu, but be warned
that the interface will change at some point, or you could use
colortbl.  See here:

    http://texblog.org/2011/04/19/highlight-table-rowscolumns-with-color/

–Rasmus

-- 
This space is left intentionally blank

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

* Re: export latex in a table
  2013-09-21 10:39 ` Rasmus
@ 2013-09-21 11:25   ` zwz
  2013-09-21 11:49     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: zwz @ 2013-09-21 11:25 UTC (permalink / raw)
  To: emacs-orgmode

Rasmus <rasmus <at> gmx.us> writes:

> 
> zwz <zhangweize <at> gmail.com> writes:
> 
> I'm assuming you're only interested in LaTeX output here.
> 
> > Hi, I want to export a table to pdf as follows:
> >
> > * test
> > | \textcolor{red}{range} | \textcolor{blue}{0\sim2^{8}-1} |
> 
> How about this? 
> 
> #+MACRO: color  \textcolor{$1}{$2}
> | {{{color(red, range)}}} | {{{color(blue, 0\sim2^8-1)}}} |
> 
> Unless you're doing something that's not systematic, or which has a
> very particular logic it's probably not the right way.
> 
> If all entries in a column/row need to be colored you should specify
> that rather than doing it manually.  You could use tabu, but be warned
> that the interface will change at some point, or you could use
> colortbl.  See here:
> 
>     http://texblog.org/2011/04/19/highlight-table-rowscolumns-with-color/
> 
> –Rasmus
> 

The macro-way does not work.
The generated tex still contains the extra \ before {.
My org version is 8.0.7.

Thanks for your tips.
But I just want to color some column/row.
And I really enjoy the convenience of org table.

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

* Re: export latex in a table
  2013-09-21 11:25   ` zwz
@ 2013-09-21 11:49     ` Nicolas Goaziou
  2013-09-21 12:30       ` zwz
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2013-09-21 11:49 UTC (permalink / raw)
  To: zwz; +Cc: emacs-orgmode

Hello,

zwz <zhangweize@gmail.com> writes:

> Rasmus <rasmus <at> gmx.us> writes:
>> 
>> How about this? 
>> 
>> #+MACRO: color  \textcolor{$1}{$2}
>> | {{{color(red, range)}}} | {{{color(blue, 0\sim2^8-1)}}} |
>> 
>> Unless you're doing something that's not systematic, or which has a
>> very particular logic it's probably not the right way.
>
> The macro-way does not work.

The macro-way does work here.

> The generated tex still contains the extra \ before {.
> My org version is 8.0.7.
>
> Thanks for your tips.
> But I just want to color some column/row.
> And I really enjoy the convenience of org table.

You can also use an export snippet:

  | @@latex:\textcolor{blue}{0\sim2^{8}-1}@@ |


Regards,

-- 
Nicolas Goaziou

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

* Re: export latex in a table
  2013-09-21 11:49     ` Nicolas Goaziou
@ 2013-09-21 12:30       ` zwz
  0 siblings, 0 replies; 5+ messages in thread
From: zwz @ 2013-09-21 12:30 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:

> 
> Hello,
> 
> You can also use an export snippet:
> 
>   |  <at>  <at> latex:\textcolor{blue}{0\sim2^{8}-1} <at>  <at>  |
> 
> Regards,
> 
Yes, it works.
Thanks.

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

end of thread, other threads:[~2013-09-21 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-21  9:01 export latex in a table zwz
2013-09-21 10:39 ` Rasmus
2013-09-21 11:25   ` zwz
2013-09-21 11:49     ` Nicolas Goaziou
2013-09-21 12:30       ` zwz

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