13
$\begingroup$

Is there a Mathematica-to-$\LaTeX$ converter, so that I can place Mathematica code, including things like A // MatrixForm, just as they are in the console straight into a $\LaTeX$ document?

$\endgroup$
20
$\begingroup$

TeXForm is indeed your friend. It even gives you nicely formatted code:

Table[RandomInteger[10], {3}, {4}] // TeXForm

gives

(* 
\left(
\begin{array}{cccc}
     9 & 5 & 10 & 9 \\
     6 & 10 & 3 & 9 \\
     9 & 5 & 9 & 7 \\
    \end{array}
\right)
*)
$\endgroup$
  • $\begingroup$ $\overset{\infty}{\smile}$ Ohhooooo... Thank you! $\endgroup$ – Trancot May 30 '13 at 0:08
  • $\begingroup$ It doesn't work for me for {{-3, -6, -9}, {0, -3, -6}, {3, 0, -3}, {6, 3, 0}, {9, 6, 3}, {13, 10, 7}} // TeXForm $\endgroup$ – ThePassenger May 3 '17 at 14:16
  • $\begingroup$ For me, in Mathematica 10.0, that produces the expected LaTeX output. $\endgroup$ – SEngstrom Jun 5 '17 at 18:45
  • $\begingroup$ @SEngstrom how to install this in Ubuntu? $\endgroup$ – alhelal Nov 5 '17 at 17:10
3
$\begingroup$

This works great for transferring expressions in Traditional Form.

Select an expression, Right-Click, Copy As, LaTeX. Paste it where you want.

You can even highlight part of a traditional form output and grab the LaTex. This also works for MathML in Mathematica 8.

$\endgroup$

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.