emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX export -- Table with align option
@ 2012-06-04 20:18 Sebastien Vauban
  2012-06-05 11:24 ` Eric Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Vauban @ 2012-06-04 20:18 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

I want to customize a bit the layout of a table, using the =align= parameter as
explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.

That works well for the first two common usages (see ECM) but not with
@-expressions (see, for example, on
https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions)

* Table with normal spacing

#+ATTR_LaTeX: align=rrl
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|---------+------+------|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets correctly translated to:

#+begin_src latex
\begin{tabular}{rrl}
 Janvier  &  1300  &  \EUR  \\
 Février  &  1280  &  \EUR  \\
\hline
 Total    &  4080  &  \EUR  \\
\end{tabular}
#+end_src

* Table with no spacing

#+ATTR_LaTeX: align=r@{:}r@{}l
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|---------+------+------|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets correctly translated to:

#+begin_src latex
\begin{tabular}{r@{:}r@{}l}
 Janvier  &  1300  &  \EUR  \\
 Février  &  1280  &  \EUR  \\
\hline
 Total    &  4080  &  \EUR  \\
\end{tabular}
#+end_src

* Table with more spacing

#+ATTR_LaTeX: align=r@{ : }r@{ }l
| Janvier | 1300 | \EUR |
| Février | 1280 | \EUR |
|---------+------+------|
| Total   | 2580 | \EUR |
#+TBLFM: @3$2=vsum(@1..@2)

gets INCORRECTLY translated to:

#+begin_src latex
\begin{tabular}{r@{}
 Janvier  &  1300  &  \EUR  \\
 Février  &  1280  &  \EUR  \\
\hline
 Total    &  4080  &  \EUR  \\
\end{tabular}
#+end_src

which can't be compiled...

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: LaTeX export -- Table with align option
  2012-06-04 20:18 LaTeX export -- Table with align option Sebastien Vauban
@ 2012-06-05 11:24 ` Eric Fraga
  2012-06-05 12:17   ` Sebastien Vauban
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Fraga @ 2012-06-05 11:24 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

> Hello,
>
> I want to customize a bit the layout of a table, using the =align= parameter as
> explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.
>
> That works well for the first two common usages (see ECM) but not with
> @-expressions (see, for example, on

Actually, it's not the @ expressions as such that cause the problems,
it's the spaces you are trying to introduce within them, causing the org
parser to terminate the alignment term too soon.  Two solutions below.

[...]

> #+ATTR_LaTeX: align=r@{ : }r@{ }l

[...]

> gets INCORRECTLY translated to:
>
> #+begin_src latex
> \begin{tabular}{r@{}

[...]


I know this isn't pretty but you could use

  #+ATTR_LaTeX: align=r@{\hspace{1em}:\hspace{1em}}r@{\hspace{1em}}l

changing the 1em to whatever amount of space you actually want; probably
1ex is more likely...

The following also works but although it looks simpler here (in an
email), I don't like how Org hides the ~s in the first column
specification as it (incorrectly) interprets them as a verbatim style.

  #+ATTR_LaTeX: align=r@{~:~}r@{~}l

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.11-14-g4b0121

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

* Re: LaTeX export -- Table with align option
  2012-06-05 11:24 ` Eric Fraga
@ 2012-06-05 12:17   ` Sebastien Vauban
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastien Vauban @ 2012-06-05 12:17 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

Eric Fraga wrote:
> Sebastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> I want to customize a bit the layout of a table, using the =align= parameter as
>> explained on http://orgmode.org/manual/Tables-in-LaTeX-export.html.
>>
>> That works well for the first two common usages (see ECM) but not with
>> @-expressions (see, for example, on
>
> Actually, it's not the @ expressions as such that cause the problems,
> it's the spaces you are trying to introduce within them, causing the org
> parser to terminate the alignment term too soon.  Two solutions below.
>
>> #+ATTR_LaTeX: align=r@{ : }r@{ }l
>> gets INCORRECTLY translated to:
>>
>> #+begin_src latex
>> \begin{tabular}{r@{}
>
> I know this isn't pretty but you could use
>
>   #+ATTR_LaTeX: align=r@{\hspace{1em}:\hspace{1em}}r@{\hspace{1em}}l
>
> changing the 1em to whatever amount of space you actually want; probably
> 1ex is more likely...
>
> The following also works but although it looks simpler here (in an
> email), I don't like how Org hides the ~s in the first column
> specification as it (incorrectly) interprets them as a verbatim style.
>
>   #+ATTR_LaTeX: align=r@{~:~}r@{~}l

I had tried backslashing the space, but that did not help. Your examples do
help working around the problem.

Thanks!

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2012-06-05 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-04 20:18 LaTeX export -- Table with align option Sebastien Vauban
2012-06-05 11:24 ` Eric Fraga
2012-06-05 12:17   ` Sebastien Vauban

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