0

In another answer (for a completely different question) I have been advised to use the \sym...-commands to change the font in math mode instead of the traditional \math...-font commands, if I use LuaLaTeX and unicode-math.

Question 1: Why? I tried to read the fontspec documentation but did not get the point. Especially, I wonder when should I use the one or the other alternative? I believe there are probably valid use cases for the traditional \math...-font commands. Otherwise, those commands could have been redefined to be equivalent to the new \sym...-commands.

I use Libertinus for my project and redefine some fonts, because I do not like the default selection which are made by the Libertinus package. However, I made some strange observations.

The MWE with nothing else than the pure Libertinus package:

\documentclass[a4paper]{article}

\usepackage{libertinus}

\begin{document}
\begin{tabular}{lcc}\hline
                  &  \verb#\math...#      &  \verb#\sym...#      \\\hline
\verb#...frak#    &  $\mathfrak{F}$       &  $\symfrak{F}$       \\
\verb#...cal#     &  $\mathcal{C}$        &  $\symcal{C}$        \\
\verb#...tt#      &  $\mathtt{Teletype}$  &  $\symtt{Teletype}$  \\\hline
\end{tabular}
\end{document}

Libertinus only

Question 2: Both fraktur commands (\mathfrak, \symfrak) do not seem to change the font at all. Why? What is wrong?

Question 3: The fraktur and calligraphic fonts do no seem to differ between the \math...-variant and the \sym...-variant. This is somehow expected. But the oldstyle \mathtt does not seem to select a teletype font. Maybe it is mono-spaced (it is hard to tell), but it still has serifs. Why? Also it obviously differs from the \symtt-font, which I would call a real teletype font. Why do \mathtt and \symtt differ?

I tried to select a different fraktur, calligraphic and teletype font. See this MWE:

\documentclass[a4paper]{article}

\usepackage{libertinus}
\setmonofont{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase]
\setmathtt{Inconsolatazi4-Regular.otf}[Scale=MatchLowercase]
\usepackage[cal=pxtx,frak=pxtx]{mathalfa}

\begin{document}
\begin{tabular}{lcc}\hline
                  &  \verb#\math...#      &  \verb#\sym...#      \\\hline
\verb#...frak#    &  $\mathfrak{F}$       &  $\symfrak{F}$       \\
\verb#...cal#     &  $\mathcal{C}$        &  $\symcal{C}$        \\
\verb#...tt#      &  $\mathtt{Teletype}$  &  $\symtt{Teletype}$  \\\hline
\end{tabular}
\end{document}

Changed fonts

The fonts are as I want them, but only if I use the old-fashioned \math...-commands. Also, the fraktur font is a real fraktur font. But obviously, the \setmathtt-command from the fontspec package and the mathaplpha package only affect the traditional commands for font selection in math mode.

Question 4: If I am supposed to use the new \sym...-commands (for whatever reason), how to I change the font of the \sym...-commands according to my needs?

  • 3
    \sym... do not change the font, they shift the unicode range to select the different styles from the same font Unicode math fonts have styles such as fraktur and bold italic up in the U+1Dxxx range. – David Carlisle Feb 15 '20 at 19:54
  • 3
    don't ask too many questions in one question. Split them. – Ulrike Fischer Feb 15 '20 at 20:14
  • @DavidCarlisle If I understand correctly, the problem that the fraktur font (of Libertinus) does not differ from the normal font is simply a problem of the Libertinus font, because it apparently contains the visually identical glyphs in the U+1Dxxx range. The font selection commands (\setmonofont etc.) cannot change the visual appearance of the \sym...-commands, because they still use the same font but glyphs from a different range. This is by intended design. If I wish to use a different font for fraktur, I must resort to the \math...-commands. This is not ideal, but the only option. – nagmat84 Feb 15 '20 at 21:09
5

To answer question 1: All (or at least most) \mathXX are internally the same a, they only look different as they are from different fonts. The sym-variants are different symbols with different unicode code points. You can see the difference if you try to copy and paste from a pdf.

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$\mathrm{a}\mathtt{a}\mathsf{a}\mathbf{a}$

$\symrm{a}\symtt{a}\symsf{a}\symbf{a}$
\end{document}

This copies and pastes like this:

aaaa
a𝚊𝖺𝐚

The difference matters a lot for accessibility.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.