[OS X TeX] \setminus in Lucida

Michael Sharpe msharpe at ucsd.edu
Tue Apr 9 21:56:14 CEST 2013


On Apr 7, 2013, at 1:27 PM, Ulrich Groh <ugroh at me.com> wrote:

> 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


More information about the macostex-archives mailing list