TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may be a trite question, but I haven't found an answer and my tentative at it doesn't work. I am trying to set a document in which I use both serif and sans numerals in math mode. I am running the files on top of XeLaTeX and using the package mathspec. I have the following lines in my preamble (actually, in a class file):

\RequirePackage{mathspec}  % This line if in a class or style file
%\usepackage{mathspec}  This one if not in a class or a style file
\setsansfont{Legacy Sans ITC Std Book}
\setmathsf[Numbers=Lining,Scale=MatchLowercase]{Legacy Sans ITC Std Book}

Everything works except for the fact that digits in the command \mathsf are typeset in the serif typeface. I know this is related to having Digits in \setmathsfont, which selects the serif face, but I cannot remove it without getting the default typeface (cmr) for the numerals in "plain" math mode. If I don't use \setmathsfont, I get the default (cmr) for both letters and digits in math mode.

I have found the same issue described by somebody else on the Internet, but it seems he didn't get any answer. What would be a right way to solve this?

share|improve this question
to clarify, can we assume that in a serif environment, you want the digits to be the usual serifed ones, and the sans digits are to appear only in an otherwise sans serif environment? – barbara beeton Sep 26 '12 at 12:30
@barbara beeton: Thanks for your attention. You are right on your remark. To be even more accurate: I'll be using a serif shape for math-mode numerals in both inline and display mode, and sans shape for the numerals (and for the alphabetic characters, too) depicting the function of input and output pins in graphics corresponding to functional blocks for digital systems. Nevertheless, an answer going beyond this particular scope would be welcome. Of course, my particular typefaces are beyond the point. – Marcos Sep 26 '12 at 15:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.