[XeTeX] fontspec 1.5 (& Lucida Math)
Bruno Voisin
bvoisin at mac.com
Fri Dec 3 02:13:59 CET 2004
Herb Schulz wrote:
> Actually, the lucbmath package gives me terrible trouble in even a simple
> document. My problem with \Gamma is with no math package! Try this:
>
> %&program=xelatex
> %&encoding=UTF-8 Unicode
> % Basic XeLaTeX Document
> \documentclass{article}
>
> \usepackage{fontspec}
> \setromanfont{Hoefler Text}
>
> \begin{document}
>
> Here is an Upper Case Gamma: \(\Gamma\)!
>
> \end{document}
>
> I get no \Gamma displayed.
In short: it's all my fault!
That's because in standard LaTeX, with the default OT1 encoding, as defined by /usr/local/teTeX/share/texmf.tetex/tex/latex/base/fontmath.ltx, \Gamma is taken from the "operators" font which is the text font CMR (the same is also true, actually, of plain TeX):
\DeclareSymbolFont{operators} {OT1}{cmr} {m}{n}
\DeclareMathSymbol{\Gamma}{\mathalpha}{operators}{"00}
But fontspec.sty redefines this font as Hoefler Text which has no Gamma symbol:
\AtBeginDocument
{
\SetSymbolFont{operators}{normal}\zf at enc\rmdefault\mddefault\updefault
I hadn't noticed this because with Lucida fonts, in lucidabr.sty, \Gamma is taken from other fonts which are not redefined to Hoefler Text, namely "mathupright" (= hlcm = LBMA = Math-Arrows) for the expert set or "largesymbols" (= hlcv = LBME = Math-Extension) for the non-expert set:
\iflucida at expert
\DeclareSymbolFont{mathupright}{OML}{hlcm}{m}{n}
\fi
[...]
\iflucida at expert
\DeclareMathSymbol{\Gamma}{\mathord}{mathupright}{0}
[...]
\else
\DeclareMathSymbol{\Gamma}{\mathord}{largesymbols}{'320}
And because Will had used my code as the basis for some of his, he hadn't noticed either.
This is the result of the idiosyncrasies of TeX, of its 7-bit inheritance, such that the capital Greek letters are taken from the main text font. The only fix I could think of is to add a new math symbol font for just containing these symbols:
\DeclareSymbolFont{xoperators} {OT1}{cmr} {m}{n}
\DeclareMathSymbol{\Gamma}{\mathalpha}{xoperators}{"00}
etc., but that wouldn't work outside standard LaTeX, for example with Lucida fonts (the capital Greek letters would be taken from Computer Modern instead of Lucida).
In any case:
%&program=xelatex
%&encoding=UTF-8 Unicode
% Basic XeLaTeX Document
\documentclass{article}
\usepackage{fontspec}
\setromanfont{Hoefler Text}
\begin{document}
Here is an Upper Case Gamma: $\Gamma$!
\end{document}
doesn't work, but
%&program=xelatex
%&encoding=UTF-8 Unicode
% Basic XeLaTeX Document
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lucidabr}
\usepackage{fontspec}
\setromanfont{Hoefler Text}
\begin{document}
Here is an Upper Case Gamma: $\Gamma$!
\end{document}
does.
Bruno
More information about the XeTeX
mailing list