I have written a Mathematica function (DispLaTeX
) that uses ImportString
from LaTeX
format, and then some postprocessing (converting the Cell
s, BoxData
, and TextData
, etc.) It does not use an external library, so it does not produce as nice an output as MaTeX, nor does it implement all of $\LaTeX$, but it is lightweight and does not require installation.
Style[DispLaTeX["$$f\\!(x)=\\sum_n\\left(x^n/n\\right)$$"], FontSize->16, FontFamily->"Latin Modern Math"]
produces

applying InputForm
gives
Style[DisplayForm[RowBox[{StyleBox[RowBox[{}]], StyleBox[FormBox[RowBox[{StyleBox["f","I"], "\[NegativeThinSpace]", RowBox[{"(", StyleBox["x","I"],")"}], "\[LongEqual]", UnderscriptBox["\[Sum]", StyleBox["n","I"], LimitsPositioning->False], RowBox[{"(", RowBox[{SuperscriptBox[StyleBox["x","I"],StyleBox["n","I"]], "/", StyleBox["n","I"]}],")"}]}], TraditionalForm]]}]], FontSize -> 16, FontFamily -> "Latin Modern Math"]
$FontFamilies
to get a list of all font families available. Is"Latin Modern Math"
indeed in the list? Perhaps it has a different name. See also MaTeX package. $\endgroup$$FontFamilies
and check it, please. $\endgroup$