1

I am typing \mathsf{\eta X \eta^\top} to represent 3 matrices multiplying together. I choose to use sans-serif fonts as matrices, but the greek letter \eta cannot be displayed as sans-serif fonts.

I do not know if any font can have sans-serif italic greek in math mode. STIX Two does not work.

\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\usepackage{unicode-math}
\unimathsetup{mathrm=sym,mathbf=sym,mathsf=sym,math-style=ISO,bold-style=ISO,sans-style=italic}
\setmathfont{STIX Two Math}

\setmathfont[range=sfit/{greek,Greek}]{STIX Two Math} this does not work:

I am trying to set up alphabet"sfit/greek" but
(unicode-math)  there are no configuration settings for it. (See
(unicode-math)  source file "unicode-math-alphabets.dtx" to
(unicode-math)  debug.)
David Carlisle
  • 757,742

2 Answers2

5

Unicode only specifies bold sans serif Greek not regular (for no sensible reason, it's just the way it is) which makes it hard to access sans Greek in any reasonable way. here I take Sans serif from Fira Math, note this is a "classic font change" so the result have standard Unicode slots and will lose the sans serif nature if cut and pasted elsewhere, unlike the bold sans which are using the Unicode Sans Serif math slots.

enter image description here

\documentclass{article}

\usepackage{unicode-math} \setmainfont{TeX Gyre Termes} \usepackage{unicode-math} % First things first\unimathsetup{mathrm=sym,mathbf=sym,mathsf=sym,math-style=ISO,bold-style=ISO,sans-style=italic} \setmathfont{STIX Two Math} \setmathfontface{\hmmsf}[Scale = MatchLowercase]{Fira Math} \begin{document}

1 $abc \alpha\beta\gamma$ % OK

2 $\symsf{abc \alpha\beta\gamma}$ % sigh

3 $\symsfit{abc \alpha\beta\gamma}$% sigh

4 $\symbfsf{abc \alpha\beta\gamma}$% OK

5 $\symbfsfit{abc \alpha\beta\gamma}$% OK

8 $\hmmsf{\mita\mitb\mitc \mitalpha\mitbeta\mitgamma}$ %OK

9 $\hmmsf{abc \mupalpha\mupbeta\mupgamma}$ % OK

\end{document}

David Carlisle
  • 757,742
  • I think "no sensible reason" boils down to the fact that the Unicode Technical Committee wanted to save space, and not assign another block. So they punted. Not a good decision. – barbara beeton Aug 17 '23 at 14:53
0

For those who seek Greek matching with Computer Modern fonts, the fontsetup package provides them with the New Computer Modern fonts. newcm sans greek

\documentclass{article}

\usepackage{fontsetup}

\begin{document} [\msansalpha\msansbeta\msansGamma\msansDelta\msanseta] [\mitsansalpha\mitsansbeta\mitsansGamma\mitsansDelta\mitsanseta] \end{document}

  • 1
    I am not quite sure if the italic alpha is supposed to look like this. – Apoorv Potnis Aug 17 '23 at 13:39
  • I just found out that the XITS math font file contains sans serif italic greek letters, compatible with times, although I don't know how to access them. – Apoorv Potnis Aug 17 '23 at 13:50
  • They are present in the stixtwo math font as well, in the private area – Apoorv Potnis Aug 17 '23 at 14:44
  • Then there is also this https://tex.stackexchange.com/a/230220/128462 – Apoorv Potnis Aug 17 '23 at 15:26
  • See if you mean 13.2.18 Bold sans serif Greek here, not regular sans serif. Or you can see Page 49 of this – Firestar-Reimu Aug 17 '23 at 16:09
  • 1
    @ApoorvPotnis I'll probaby make a second answer for accessing the PUA stix2 characters later – David Carlisle Aug 17 '23 at 16:10
  • 1
    @Firestar-Reimu No, I mean regular sans serif. One can see the glyphs in fontforge. The ones in stix2 are in PUA, the ones in xits are not. I don't really understand what's going on in the xits ones. In fontforge, I see a sans serif italic alpha with the info 4022 (0xfb6) U+1D6FC "u1D6FC.ss" MATHEMATICAL ITALIC SMALL ALPHA. When I type access it using \symbol{"1D6FC}, I get the normal, serif italic small alpha. – Apoorv Potnis Aug 17 '23 at 16:43
  • Hmm, it seems that the xits ones are stylistic sets. One should be able to use them using StylisticSet= when loading the font. – Apoorv Potnis Aug 17 '23 at 18:06