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
    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 Nov 29 '14 at 20:04
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.

  • 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 Nov 30 '14 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 Nov 30 '14 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. – Constantine Dec 1 '14 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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