This is all covered in the built-in documentation. Search for MaTeX in Mathematica's documentation centre, or type in the following address: MaTeX/guide/MaTeX
. But I will give some examples here anyway:
How to set a given font is really a LaTeX question. You will find many fonts samples with instructions on how to use them at The LaTeX Font Catalogue. Usually, you need to add a package to the preamble. For example, to use Utopia Regular with Fourier math,
MaTeX["\\text{If $x=2$ then $x^2=4$.}",
"Preamble" -> {"\\usepackage{fourier}"}, Magnification -> 4]
This is covered under the examples for the "Preamble"
option in the MaTeX
doc page, as well as in the Typesetting with MaTeX tutorial.
To use XeTeX, you need to configure MaTeX to use the appropriate executable. This is covered in the ConfigureMaTeX
documentation page. I will copy the example from that page here:
ConfigureMaTeX["pdfLaTeX" -> "/Library/TeX/texbin/xelatex"]
MaTeX["\\text{Beautiful typesetting}",
"Preamble" -> {"\\usepackage{fontspec}", "\\setmainfont{Zapfino}"},
FontSize -> 24
]
Of course, the path to the xelatex
executable will be specific to your system.
Remember that ConfigureMaTeX
will change the configuration permanently. Restarting Mathematica will not reset it. If you need to change back to plain LaTeX, you must do it manually.
With XeLaTeX you can use any installed system font. This is generally useful for text mode only. To use a system font in math mode, you need a font with special math support, such as Cambria Math. Here's an example:
MaTeX["\\text{Foo $x^2$ bar}",
"Preamble" -> {"\\usepackage{fontspec,unicode-math}",
"\\setmainfont{Cambria}", "\\setmathfont{Cambria Math}"},
Magnification -> 4
]
I am not experienced with Unicode math fonts. If you have more questions about them, I suggest asking on TeX.SE.
?MaTeX
, there will be a small blue>>
sign after the usage message. Clicking it opens the help. Don't search on wolfram.com online. That's Wolfram's documentation. Click Help -> Documentation Center, and search there. You do have the latest version of the package, 1.7.0, right? $\endgroup$