Does anyone have a good way to produce LaTeX mathematics matrices from org-mode tables?

I found this thread but it doesn't seem to have a ready-made solution.

This gets me close.

#+LATEX: \begin{equation}
#+LATEX: \begin{matrix}
| a | b |
| c | d |
#+LATEX: \end{matrix}
#+LATEX: \end{equation}

which exports to:

a & b\\
c & d\\

And I only have to take out the tabular and center directives.

  • 1
    Could you be more precise as to what you want? If you write a table in an org file and use the export to latex feature, you obtain a latex table. If you are looking for something integrated in latex documents, radio tables might be what you're looking for. orgmode.org/manual/… – T. Verron Jun 19 '16 at 14:34
  • 2
    Take a look at (info "(org) LaTeX specific attributes"). The following will change your environment: #+attr_latex: :mode math :environment matrix. – mutbuerger Jun 20 '16 at 14:46

Take a look at (info "(org) LaTeX specific attributes"). The following table attributes

#+attr_latex: :mode math :environment matrix
| a | b |
| c | d |

will export a LaTeX matrix in math mode:

 a & b \\
 c & d \\
  • For the sake of completeness: If you wish to give your matrix a name, the way to go is inserting the corresponding string (e.g. "M =") as an argument to :math-prefix in the option list of the table. Figuring this out took me a while, so I hope this saves everyone else some time. – Aaron Meinel Nov 6 '19 at 13:45

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.