13

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
  • 1
    If you only care about exporting to LaTeX, you might be interested in the < and > options in the table format from the array package (see ctan.org/pkg/array).
    – mbork
    Commented Nov 29, 2014 at 20:04

1 Answer 1

10

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.

3
  • 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.
    – wvxvw
    Commented Nov 30, 2014 at 18:46
  • 1
    Actually, I found it: orgmode.org/manual/LaTeX-specific-attributes.html I also had to add #+ATTR_LaTeX: :environment array. Thanks for the hint!
    – wvxvw
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.