6

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:

\begin{equation}
\begin{matrix}
\begin{center}
\begin{tabular}{ll}
a & b\\
c & d\\
\end{tabular}
\end{center}
\end{matrix}
\end{equation}
\end{document}

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
7

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:

\[
\begin{matrix}
 a & b \\
 c & d \\
\end{matrix}
\]

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.