8

What package of these two is better for changing math-mode fonts (to .ttf fonts)?

2
  • 1
    I agree that in its current which one is better form the question is primarily opinion-based, but a question about differences or pros and cons of the packages might not only be interesting, but also useful for a wider audience. Given that the question has already received a useful answer and given that it is very new and that there have been no comments on how to improve the question thus far (or why people voted to close) I voted to keep the question open.
    – moewe
    Apr 24, 2019 at 8:32
  • I suggest you reword your question to make it more neutral and objectively answerable instead of asking which one is 'better'.
    – moewe
    Apr 24, 2019 at 8:34

1 Answer 1

12

mathfont and mathspec have similar purpose, but mathfont works not only with xelatex but also with lualatex. Both packages allow to change the font of various math symbols and math alphabets.

Both packages have in my view the same deficiency: they care only about the look of the math and not about the mathematical meaning of the symbols.

The difference can be seen in this example:

\documentclass{article}
\usepackage{mathfont}
\setfont{Arial}
\begin{document}
$\mathrm{a} \preceq a$
\end{document} 

The result looks as expected:

enter image description here,

but if you copy and paste then you get: a ? a. Both a are identical, and the symbol is gone.

If you compile with unicode-math:

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\mathrm{a} \preceq a$
\end{document}

then copy & paste will give a ⪯ 𝑎.

1
  • 4
    It is probably clear from the context, but it might be helpful for future readers to state explicitly that mathspec is for XeLaTeX and that mathfont works on LuaLaTeX and XeLaTeX. unicode-math also works for XeLaTeX and LuaLaTeX.
    – moewe
    Apr 24, 2019 at 8:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .