[XeTeX] mathspec and numerals in math environment

Alejandro Pérez Carballo apca at mit.edu
Mon Sep 13 20:22:39 CEST 2010


Hi,

I'm having trouble getting mathspec to have the numerals inside
\mathsf be in the font specified by \setmathsf while at the same time
having the numerals in plain math mode be in the font specified by
\setmathsfont.


Here's a minimal
example of what I'm doing:

\documentclass{article}
\usepackage{mathspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{xspace}
\usepackage{xunicode}


\setmainfont[Mapping=tex-text]{Minion Pro}
\setromanfont[Mapping=tex-text,Numbers=OldStyle,Ligatures={Common}]{Minion Pro}
\setsansfont[Mapping=tex-text,Scale=0.9]{Myriad Pro}
\setmathsfont(Digits,Latin,Greek){Minion Pro}
\setmathrm{Minion Pro}
\setmathsf[Mapping=tex-text,Scale=0.9]{Myriad Pro}

\begin{document}
       Hello world. \textsf{This is in sans font}. $\mathsf{This \ is \
inside \ a}$ \verb=\mathsf= $\mathsf{command.}$ Numerals should work
fine either way: 123. Inside \verb=\textsf=, numerals are OK:
\textsf{123}. But inside \verb=\mathsf=, they are not: $\mathsf{123}$.
Oh, and letters and numerals in math environment take the expected
form: $abc123$.
\end{document}

I'm attaching a screenshot of the pdf with the output.

The culprit seems to be this:

\setmathsfont(Digits,Latin,Greek){Minion Pro}

So I tried doing this instead:

\documentclass{article}
\usepackage{mathspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{xspace}
\usepackage{xunicode}


\setmainfont[Mapping=tex-text]{Minion Pro}
\setromanfont[Mapping=tex-text,Numbers=OldStyle,Ligatures={Common}]{Minion Pro}
\setsansfont[Mapping=tex-text,Scale=0.9]{Myriad Pro}
\setmathsfont(Latin,Greek){Minion Pro}
\setmathrm{Minion Pro}
\setmathsf[Mapping=tex-text,Scale=0.9]{Myriad Pro}

\begin{document}
       Hello world. \textsf{This is in sans font}. $\mathsf{This \ is \
inside \ a}$ \verb=\mathsf= $\mathsf{command.}$ Numerals should work
fine either way: 123. Inside \verb=\textsf=, numerals are OK:
\textsf{123}. And inside \verb=\mathsf=, they are too: $\mathsf{123}$.
But while letters in math environment take the expected form: $abc$,
numerals do not: $123$.
\end{document}

The other screenshot should show the pdf of the output.

Any thoughts?

Best regards,

Alejandro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2010-08-24 at 12.37.18 PM.png
Type: image/png
Size: 124421 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20100913/63e702de/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2010-08-24 at 12.42.42 PM.png
Type: image/png
Size: 121174 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20100913/63e702de/attachment-0003.png>


More information about the XeTeX mailing list