Converting Mathematica to $\LaTeX$

18

8

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?

Trancot

Posted 2013-05-29T22:12:23.513

Reputation: 281

3

Check out TexForm in the documentation.

– Markus Roellig – 2013-05-29T22:37:28.913

1Also there is File > Save As > TeX – Daniel Lichtblau – 2013-05-29T22:56:32.063

Answers

24

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)
*)

SEngstrom

Posted 2013-05-29T22:12:23.513

Reputation: 1 631

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 – Revolucion for Monica – 2017-05-03T14:16:02.083

For me, in Mathematica 10.0, that produces the expected LaTeX output. – SEngstrom – 2017-06-05T18:45:02.297

@SEngstrom how to install this in Ubuntu? – alhelal – 2017-11-05T17:10:14.623

$\overset{\infty}{\smile}$ Ohhooooo... Thank you! – Trancot – 2013-05-30T00:08:10.997

5

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.

cyclochaotic

Posted 2013-05-29T22:12:23.513

Reputation: 193