I have an org-mode
table that needs to have some math text in each cell. Wrapping every cell with $
both looks ugly and takes much more space than it deserves. Is there any way to somehow put the whole table in math (LaTeX) environment so that all text inside the table would be interpreted as formulas?
1 Answer
Try using :mode math
and :mode inline-math
LaTeX attributes together with :environment array
:
#+ATTR_LaTeX: :mode math :environment array
| Column 1 | Column 2 |
|----------+----------|
| \sin(x) | \tan(x) |
#+ATTR_LaTeX: :mode inline-math :environment array
| Column 1 | Column 2 |
|----------+----------|
| \sin(x) | \tan(x) |
See section LaTeX specific attributes of the Org mode manual for more.
-
Ah, if this worked, this would be just what I need! Unfortunately, this generates
\[\begin{tabular}& ... & ... \\ ... \end{tabular}\]
, which will not compile :( Would you perhaps happen to know how does\begin{tabular}
get generated? If I could replace it with, say\begin{array}
, I think that would solve my problem.– wvxvwCommented Nov 30, 2014 at 18:46 -
1Actually, I found it: orgmode.org/manual/LaTeX-specific-attributes.html I also had to add
#+ATTR_LaTeX: :environment array
. Thanks for the hint!– wvxvwCommented Nov 30, 2014 at 18:56 -
@wvxvw: Sorry I didn't get back to you sooner (I was busy running a marathon :) ). I updated the answer; now it should be useable as it stands. Commented Dec 1, 2014 at 17:51
<
and>
options in the table format from thearray
package (see ctan.org/pkg/array).