I'm using XeTeX and the fontspec and unicode-math packages. In order to use a different math font for Greek letters, I do something like this, using the range option of \setmathfont:


Now, how could I change the font for only one Greek letter (say \phi) ?


Based on @egreg's answer (which is deleted now), I tried the following code. The $\phi$ does not appear in the output. If I replace this line by the commented line, then $\phi$ appears in the output but it is not in regular font.

% !TeX program = XeLaTeX
% !Mode:: "TeX:UTF-8"
\setmonofont[Path=/usr/share/fonts/truetype/freefont/,Scale = 1.05]{FreeMonoBold.ttf} 
[        Scale = 1.1,
     Extension = .otf,
   UprightFont = *-regular,
      BoldFont = *-bold,
    ItalicFont = *-italic,
BoldItalicFont = *-bolditalic,

% \setmathfont[range=\mathit/{varphi,phi},Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/]{texgyretermes-regular.otf}


$\phi = \psi+1$. 


Second update

Since I use only three greek letters in my document, phi, mu and lambda, the following code works :

  • TeX Gyre Termes is not a math font, so it has no \mitphi and \mitvarphi. – egreg Jul 7 '15 at 9:53
  • @egreg And why that does not work with the commented line instead ? – Stéphane Laurent Jul 7 '15 at 9:58
  • @egreg I also tried range=\mathit/{"03D5} – Stéphane Laurent Jul 7 '15 at 10:11
  • It's not at all clear what your aim is. – egreg Jul 7 '15 at 10:27
  • @egreg : I want the converse of your output : only $\phi$ in regular font, not the other Greek letters. I have just posted a working solution, but it requires to list all the other Greek letters. – Stéphane Laurent Jul 7 '15 at 10:31

Your Answer

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

Browse other questions tagged or ask your own question.