Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I use mathspec's \setmathsfont and hyperref, and try to typeset a URL, most of the URL uses monospace, as it should. Good.

However, digits use the maths font. Anyone know how to fix this?



\setmathsfont(Digits){Minion Pro}
\setmonofont{Source Code Pro}

\nolinkurl{abc123def} % same problem with \url{..}


enter image description here

share|improve this question
@Qrrbrbirlbel: Thanks for the edit. I didn't have enough reputation to embed the image myself, of course. – Andy Morris Feb 24 '13 at 21:28

1 Answer 1

up vote 4 down vote accepted

The problem is due to the fact that mathspec makes the digits of type mathord not mathalpha. Then the work done by hyperref to set up to use the ttfamily does not conclude successfully for the digits, as it proceeds in math mode.


\setmathsfont(Digits){Minion Pro}


% \setmonofont{Source Code Pro}

\nolinkurl{abc123def} % same problem with \url{..}

digits in mono

share|improve this answer
Works perfectly! Thankyou so much. – Andy Morris Feb 25 '13 at 1:14
You're welcome! I looked for an option to mathspec package to do this, but there does not seem to be one, so I just copied-pasted from mathspec.sty and replaced \mathord by \mathalpha. The point is that hyperref does its things in math mode (after having set-up the font to be the mono font). – jfbu Feb 25 '13 at 8:46

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.