[OS X TeX] Re: MacOSX-TeX Digest, Vol 66, Issue 9

Ulrich Groh ugroh at me.com
Thu Apr 11 19:11:56 CEST 2013


> 
> 
>> The problem: 
>> 
>> \documentclass{scrartcl} 
>> %% 
>> % 
>> \usepackage{fontspec}      % support opentype text fonts 
>> \usepackage{unicode-math}  % support opentype math fonts 
>> \unimathsetup{partial=upright} 
>> %% 
>> \setmathfont{LucidaBrightMathOT.otf} 
>> \setmathfont[range=\mathfrak]{Latin Modern Math} 
>> \setmathfont[range=\mathcal]{Latin Modern Math} 
>> % 
>> % 
>> \renewcommand{\setminus}{\smallsetminus} % nothing happens 
>> \renewcommand{\imath}{\, \mathrm{i} \, } 
>> %% 
>> % 
>> \begin{document} 
>> % 
>> \renewcommand{\setminus}{\smallsetminus} % ok 
>> \renewcommand{\imath}{\, \mathrm{i} \, } 
>> % 
>> \[ 
>>    A \setminus B  \, , \quad   x + \imath y = z \, . 
>> \] 
>> % 
>> \end{document} 
>> 
>> If I compile the TeX-file with LuaLaTeX there is the  (small)setminus-symbol an slso i (=mathrm-i) 
>> 
>> But if I compile before the  \begin{document} nothing happens, i.e. no \setminus-symbol and no \imath-symbol. Why?
>> 
>> Ulrich
>> 
> 
> The new LucidaBrightMathOT does not have a setminus---this is an omission that should be corrected in time. To explain what's happening with your example, one should note:
> 
> 1. according to the fontspec manual, math loading commands are carried out as part of \AtBeginDocument---ie, effectively after nearly all other commands in the preamble;
> 2. you can force your definitions into the preamble by enclosing them in an \AtBeginDocument{} that follows the \setmathfont commands.
> 
> You can change your example to one that works using:
> 
> \documentclass{scrartcl} 
> %% 
> % 
> \usepackage{fontspec}      % support opentype text fonts 
> \usepackage{unicode-math}  % support opentype math fonts 
> \unimathsetup{partial=upright} 
> %% 
> \setmathfont{LucidaBrightMathOT.otf} 
> \setmathfont[range=\mathfrak]{Latin Modern Math} 
> \setmathfont[range=\mathcal]{Latin Modern Math} 
> % 
> % 
> \AtBeginDocument{\let\setminus\smallsetminus%
> \renewcommand{\imath}{\, \mathrm{i} \, }} %these will be performed after prior \setmathfont commands
> 
> \begin{document} 
> % 
> \[ 
>    A \setminus B  \, , \quad   x + \imath y = z \, . 
> \] 
> % 
> \end{document} 
> 
> Michael
> 
> ------------------------------

Michael, thank you. It is working and I will read the fontspec-manual.

Ulrich














More information about the macostex-archives mailing list