Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert Mathematica syntax to latex? [closed]

wolfram alpha accepts latex, but it does not export to latex,

it exports plaintext,rendered images and mathematica sytax.

Is there any javascript library that converts the output to latex?

Mathematica syntax:

Cell[BoxData[FormBox[TagBox[RowBox[List[FractionBox["1", "2"], " ", RowBox[List["(", RowBox[List[RowBox[List["4", " ", SuperscriptBox["x", "2"]]], "+", "x", "+", "2"]], ")"]]]], Identity, Rule[TagBoxNote, List[Rule["Hyperlink", "1/2 (2+x+4 x^2)"]]]], TraditionalForm]], "Output", Rule[PageWidth, 500], Rule[Magnification, 1], Rule[CellMargins, List[List[0, 0], List[0, 0]]], Rule[ShowCellBracket, False], Rule[FontFamily, "Bitstream Charter"], Rule[FontSize, 14], Rule[NumberSeparator, "\[ThinSpace]"]]

Latex syntax

2x^2+\frac{x}{2} +1
like image 291
Porizm Avatar asked Feb 10 '13 20:02

Porizm


People also ask

How do I export from Mathematica to LaTeX?

To bring a whole Mathematica Notebook into LaTeX format, you can do this via the File > Export menu. However, there are some restrictions that one should keep in mind to avoid surprises: Use a simple style sheet.

How do you change the format in Mathematica?

Navigate to the menu item Format ► Option Inspector. The Option Inspector window appears. Select Global Preferences from the first drop-down menu. Search for “CommonDefaultFormatTypes,” or navigate to it directly via Cell Options ► New Cell Default ► CommonDefaultFormatTypes.

How do you use MaTeX?

The MaTeX function can be used either with a string containing math-mode LaTeX code, or with an arbitrary Mathematica expression. It will automatically apply TeXForm to non-string expressions. When writing TeX code in Mathematica strings, remember to always escape backslashes. Thus \sum must be written as "\\sum" .


1 Answers

I know that you can do it within Mathematica itself using TeXForm

So you would do something like ToExpression["\\frac{a}{b}", TeXForm]

like image 143
Stuart Avatar answered Oct 14 '22 23:10

Stuart