emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Giuseppe Lipari <giulipari@gmail.com>
To: emacs-orgmode@gnu.org
Subject: exporting tables + equations to latex
Date: Thu, 9 Oct 2014 17:21:04 +0200	[thread overview]
Message-ID: <CABHo5SBkFWm6sFGD29d+q2bTU09Ct2w8E_U81W7zYwC8UQweJA@mail.gmail.com> (raw)

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

Hi everybody.

I like very much the orgtbl-mode for inserting tables in latex. It saves me
a lot of typing, and they are also quite beatiful to read in text, contrary
to plain latex tables.

The big problem I have is that I do not know how to put equations in cells.
In particular, I have this snippet of code in my latex file:

\begin{comment}
#+ORGTBL: SEND fp orgtbl-to-latex :splice t :skip 0
| Task     |  C |   T |   D | Prio | S_1 | $S_2$ | $S_3$ | $S_4$ | $B$ |
|----------+----+-----+-----+------+-----+-------+-------+-------+-----|
| $\tau_1$ |  2 |   8 |   6 |   10 |   1 |     0 |     0 |     0 |     |
| $\tau_2$ |  4 |  20 |  20 |    8 |   0 |     1 |     1 |     0 |     |
| $\tau_3$ | 10 |  50 |  40 |    6 |   0 |     0 |     3 |     1 |     |
| $\tau_4$ | 10 | 100 | 100 |    4 |   2 |     3 |     1 |     0 |     |
\end{comment}


which is exported as


\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}\hline
% BEGIN RECEIVE ORGTBL fp
Task & C & T & D & Prio & \(S\_{}1\) & \(S\_{}2\) & \(S\_{}3\) & \(S\_{}4\)
& \(B\) \\
\hline
\(\tau\_{}1\) & 2 & 8 & 6 & 10 & 1 & 0 & 0 & 0 &  \\
\(\tau\_{}2\) & 4 & 20 & 20 & 8 & 0 & 1 & 1 & 0 &  \\
\(\tau\_{}3\) & 10 & 50 & 40 & 6 & 0 & 0 & 3 & 1 &  \\
\(\tau\_{}4\) & 10 & 100 & 100 & 4 & 2 & 3 & 1 & 0 &  \\
% END RECEIVE ORGTBL fp
\hline
\end{tabular}



which is NOT what I want: the underlines are translated as underlines, and
not as subscript command.


I also tried the following:

\begin{comment}
#+ORGTBL: SEND fp orgtbl-to-latex :splice t :skip 0 :fmt (6 "$%s$" 7 "$%s$"
8 "$%s$" 9 "$%s$")
| Task     |  C |   T |   D | Prio | S_1 | S_2 | S_3 | S_4 | B |
|----------+----+-----+-----+------+-----+-------+-------+-------+-----|
| $\tau_1$ |  2 |   8 |   6 |   10 |   1 |     0 |     0 |     0 |     |
| $\tau_2$ |  4 |  20 |  20 |    8 |   0 |     1 |     1 |     0 |     |
| $\tau_3$ | 10 |  50 |  40 |    6 |   0 |     0 |     3 |     1 |     |
| $\tau_4$ | 10 | 100 | 100 |    4 |   2 |     3 |     1 |     0 |     |
\end{comment}

and the solution is even worse:

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}\hline
% BEGIN RECEIVE ORGTBL fp
Task & C & T & D & $S$\backslash$\(_\)1$ & $S$\backslash$\(_\)2$ &
$S$\backslash$\(_\)3$ & $S$\backslash$\(_\)4$ & B \\
...
...
% END RECEIVE ORGTBL fp
\hline
\end{tabular}

Where is the \backslash coming from? I have no idea.
So, where is the problem? How can I put a simple mathematical symbol in a
org-mode table?


Thanks in advance


-- 
Giuseppe Lipari
LIFL
Université de Lille 1
blogs: http://scacciamennule.blogspot.com  (Italian)
<http://scacciamennule.blogspot.com>
          http://okpanico,wordpress.com          (Italian)
          http://algoland.wordpress.com           (English)

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

             reply	other threads:[~2014-10-09 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 15:21 Giuseppe Lipari [this message]
2014-10-09 15:33 ` exporting tables + equations to latex Nicolas Goaziou
2014-10-09 15:38 ` Jorge A. Alfaro-Murillo
2014-10-11  7:14   ` Giuseppe Lipari
2014-10-11 15:12     ` Nicolas Goaziou

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=CABHo5SBkFWm6sFGD29d+q2bTU09Ct2w8E_U81W7zYwC8UQweJA@mail.gmail.com \
    --to=giulipari@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).