5

Copying the plain TeX format, my formatting file contains the lines

\font\tenrm="[lmroman10-regular.otf]:mapping=tex-text"
\textfont0=\tenrm
\def\rm{\fam0 \tenrm}

to load a unicode font. However, as mentioned in Can I typeset greek letters in text mode using Latin Modern Fonts?, the Latin Modern fonts don't include the Greek capital letters, so $\Pi$ doesn't display the capital letter Pi. How can I fix this in (Xe-)TeX?

  • Not sure what's what, but there is a $\Pi$ in my version of Latin Modern Math -font (Version 1.958, downloaded from GUST). – morbusg Mar 2 '14 at 19:41
2

If you want that the Greek letters respect the current family you have to completely redefine the math fonts, probably using Latin Modern Math.

A better way to define them as “fixed” symbols is as follows:

\font\tenrm="[lmroman10-regular.otf]:mapping=tex-text"
\textfont0=\tenrm

\font\greekcapstenrm=cmr10
\font\greekcapssevenrm=cmr7
\font\greekcapsfiverm=cmr5

\newfam\greekcapsfam
\textfont\greekcapsfam=\greekcapstenrm
\scriptfont\greekcapsfam=\greekcapssevenrm
\scriptscriptfont\greekcapsfam=\greekcapsfiverm

\begingroup
\def\getlastdigitsaux#1"#2#3#4#5{#4#5}
\def\getlastdigits#1{\expandafter\getlastdigitsaux\meaning#1}
\def\redefine#1{%
  \begingroup\edef\x{\endgroup
    \global\Umathchardef#1=
    0 % math kind
    \greekcapsfam % family
    "\getlastdigits#1 % slot
  }\x
}

\redefine\Gamma
\redefine\Delta
\redefine\Theta
\redefine\Lambda
\redefine\Xi
\redefine\Pi
\redefine\Sigma
\redefine\Upsilon
\redefine\Phi
\redefine\Psi
\redefine\Omega
\endgroup

$\Gamma\Delta\Theta\Lambda\Xi\Pi\Sigma\Upsilon\Phi\Psi\Omega$

\bye

enter image description here

1

With OTF's, one way is to define them with

\Umathcharnumdef\Alpha="0391
\Umathcharnumdef\Beta="0392
% ...
\Umathcharnumdef\Omega="03A9
0

This fix is not robust to italic, slanted or bold capital Greek letters but should be easily adapted. It loads the missing letters from the original Computer Modern fonts.

\font\greekcapstenrm=cmr10
\font\greekcapssevenrm=cmr7
\font\greekcapsfiverm=cmr5

\newfam\greekcapsfam
\textfont\greekcapsfam=\greekcapstenrm
\scriptfont\greekcapsfam=\greekcapssevenrm
\scriptscriptfont\greekcapsfam=\greekcapsfiverm

\let\tmpGamma=\Gamma \def\Gamma{{\fam\greekcapsfam\tmpGamma}}
\let\tmpDelta=\Delta \def\Delta{{\fam\greekcapsfam\tmpDelta}}
\let\tmpTheta=\Theta \def\Theta{{\fam\greekcapsfam\tmpTheta}}
\let\tmpLambda=\Lambda \def\Lambda{{\fam\greekcapsfam\tmpLambda}}
\let\tmpXi=\Xi \def\Xi{{\fam\greekcapsfam\tmpXi}}
\let\tmpPi=\Pi \def\Pi{{\fam\greekcapsfam\tmpPi}}
\let\tmpSigma=\Sigma \def\Sigma{{\fam\greekcapsfam\tmpSigma}}
\let\tmpUpsilon=\Upsilon \def\Upsilon{{\fam\greekcapsfam\tmpUpsilon}}
\let\tmpPhi=\Phi \def\Phi{{\fam\greekcapsfam\tmpPhi}}
\let\tmpPsi=\Psi \def\Psi{{\fam\greekcapsfam\tmpPsi}}
\let\tmpOmega=\Omega \def\Omega{{\fam\greekcapsfam\tmpOmega}}

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.