4

When I attempt to use any kind of "long" arrow in the Lucida Bright font, it ends up coming out broken. For a MWE Consider the following:

\documentclass[10 pt]{article}

\usepackage{amsmath,amssymb}

\usepackage{fontspec}      
\usepackage{unicode-math}  

\setmainfont{Lucida Bright OT}
\setsansfont{Lucida Sans OT}
\setmonofont{Lucida Sans Typewriter OT}

\setmathfont{Lucida Bright Math OT}

\begin{document}

Here is an example of an arrow which looks weird:

\begin{gather}
\widehat{\mathcal{O}_v}\otimes_{\mathcal{O}_v} k\xrightarrow{\approx}\widehat{k}
\end{gather}

here is another example:

\begin{gather}
\varprojlim k[T]/(T^n)
\end{gather}

\end{document}

2 Answers 2

4

The \xrightarrow and \varprojlim commands use a minus sign for extending the arrow; in the Lucida Math font this has not the same height as the arrow; you can use a different symbol, though, namely "HORIZONTAL LINE EXTENSION U+23AF", that's available in unicode-math under the name \harrowextender; just redefine \relbar to use it:

\documentclass[10pt]{article}

\usepackage{amsmath}

\usepackage{fontspec}      
\usepackage{unicode-math}  

\setmainfont{Lucida Bright OT}
\setsansfont{Lucida Sans OT}
\setmonofont{Lucida Sans Typewriter OT}

\setmathfont{Lucida Bright Math OT}

\renewcommand{\relbar}{\mathrel{\harrowextender}}

\begin{document}


Here is an example of an arrow which looks weird:
\[
\widehat{\mathcal{O}_v}\otimes_{\mathcal{O}_v} k\xrightarrow{\approx}\widehat{k}
\]
here is another example:
\[
\varprojlim k[T]/(T^n)
\]

\end{document}

enter image description here

By the way, I don't think amssymb does any good with unicode-math.

7
  • This did not work for me using XeLaTeX and TeX Gyre Pagella as maths font. The extended part of the arrow is invisible. Dec 28, 2014 at 2:24
  • @JoséFigueroa-O'Farrill Unfortunately, none of the TeX Gyre math fonts has the glyph; just don't redefine \relbar and you should be OK
    – egreg
    Dec 28, 2014 at 10:24
  • The reason I found this question/answer is that actually it's not OK. I get an ugly dashed arrow when I use \xrightarrow. Dec 28, 2014 at 14:32
  • @JoséFigueroa-O'Farrill I'm afraid it's a bug in TeX Gyre Pagella, then: they should provide U+23AF
    – egreg
    Dec 28, 2014 at 14:36
  • How can I go about checking whether a given font has that glyph? Dec 28, 2014 at 15:20
3

try this setting:

\usepackage{unicode-math}  
\setmainfont{Lucida Bright OT}
\setsansfont{Lucida Sans OT}
\setmonofont{Lucida Sans Typewriter OT}
\setmathfont{Lucida Bright Math OT}
\setmathfont[range={"2190,"2192,"2212}]{TeXGyrePagellaMath-Regular}

or alternatively to using Pagella

\makeatletter
\ams@def\relbar{\raisebox{-0.35pt}{$-$}}
\makeatother

(after loading amsmath). Here is my complete test example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}  
\setmainfont{Lucida Bright OT}
\setsansfont{Lucida Sans OT}
\setmonofont{Lucida Sans Typewriter OT}
\setmathfont{Lucida Bright Math OT}
\setmathfont[range={"2190,"2192,"2212}]{XITS Math}
%\makeatletter
%\ams@def\relbar{\raisebox{-0.35pt}{$-$}}
%\makeatother

\begin{document}        
\begin{gather}
\widehat{\mathcal{O}_v}\otimes_{\mathcal{O}_v} k\xrightarrow{\approx}\widehat{k}
\end{gather}

\begin{gather}
\varprojlim k[T]/(T^n)
\end{gather}

\end{document}
7
  • Thank you very much! I am getting an error when I try to implement this code though. It says that the font "TeXGyrePagellaMath-Regular" cannot be found, and that I should reference the "fontspec" documentation (I am using fontspec). Also, when I try your second fix it says that "\relbar" is not defined. Mar 23, 2013 at 8:27
  • Which TeX-system do you have? And did you updated it? You can also use XITS Math instead. See my edited answer for a complete document
    – user2478
    Mar 23, 2013 at 8:31
  • Herbert, I apologize if I am misunderstanding you. I am using Tex Shop for Mac. I don't know what XITS Math is, as well. Mar 23, 2013 at 8:33
  • XITS is a font and should be installed by default. With MacTeX you can also update your system. However, if you use xelatex (I used lualatex) you have to use as name xits-math.otf instead of the symbolic name XITS Math
    – user2478
    Mar 23, 2013 at 8:38
  • Herbert, I apologize for being so dense, but I'm not exactly sure how to implement your suggestions. Is XITS Math some kind of package I need to include? Do I need to download it? Thanks! Mar 23, 2013 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .