# Are mathfont and mathspec intended for same purpose?

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

• 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 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 at 8:34

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:

,

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 ⪯ 𝑎.

• 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 at 8:37