I want to use (for example) Tex Gyre Heros Math for \mathcal, but (for example) Tex Gyre Pagella Math in general for mathematics. (Why did I want to do that, because Pagella's \mathcal seems quite illegible to me.) I guess the keyword uppercasescript (resp. lowercasescript) for definefontfallback is related for my purpose, but definefontfallback obviously does not fit the situation.

For concreteness, consider that I use

\definefontfeature [default] [default] [onum=yes]
\definefontfamily [MainFace] [rm] [TeX Gyre Pagella]
\definefontfamily [MainFace] [ss] [TeX Gyre Heros]
\definefontfamily [MainFace] [tt] [TeX Gyre Cursor] [features=none]
\definefontfamily [MainFace] [mm] [Tex Gyre Pagella Math]
\setupbodyfont [MainFace, 12pt]

But if replace the above line by (merely according to my guess)

\definefontfamily [MainFace] [mm] [Tex Gyre Pagella Math]
\definefontfamily [MainFace] [mm] [Tex Gyre Heros Math] [range=uppercasescript]

That doesn't work; Tex Heros is used throughout


When you use the \definefontfamily command to set the font for your document you can use \definefallbackfamily to set replacements for certain characters.

One problem in your original question is that you try to load TeX Gyre Heros Math which doesn’t exist and as a result nothing will be replaced.

\definefontfamily     [MainFace] [rm] [TeX Gyre Pagella]
\definefallbackfamily [MainFace] [mm] [TeX Gyre DejaVu Math] [force=yes,range=lowercasescript]
\definefontfamily     [MainFace] [mm] [TeX Gyre Pagella Math]

\setupbodyfont [MainFace, 12pt]

\m{abc \mathscript abc}
  • Btw, how do I find what font has been installed within the standard TeX Live, at least a list of TeX Gyre fonts, and math fonts? Like you saw, I Googled the name Heros, but did not know there is no Heros Math. Mar 21 '19 at 8:11
  • 2
    @Aminopterin you can use mtxrun --script fonts --list --all to list all fonts on your system. You can even filter the results using --pattern=, e.g. mtxrun --script fonts --list --pattern='*Gyre* '--all will give you all TeX Gyre fonts on your system.
    – DG'
    Mar 21 '19 at 10:13

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.