# How do I change the \mathtt font with mathspec?

I have a document where the main font is Gotham Narrow Book but the numbers are set in Gotham Narrow Light, and this is set with commands provided by the mathspec package. I'd like to typeset a table where the digits come from a monospace font so that they'll line up better. But my invocation of \setmathtt has no effect.

Here is my sample document:

\documentclass{article}
\usepackage{mathspec}
\setmainfont[BoldFont=Gotham Narrow Medium]{Gotham Narrow Book}
\setmathrm{Gotham Book}
\setmathfont(Latin){Gotham Narrow Book}
\setmathfont(Digits){Gotham Narrow Light}
%:FIXME seems to have no effect
\setmathtt{Courier}
\begin{document}
\begin{tabular}{cc}
Normal         & TT \\
$123456789$ & $\mathtt{123456789}$ \\
$111111111$ & $\mathtt{111111111}$
\end{tabular}
\end{document}


Does \setmathfont(Digits){Gotham Narrow Light} preclude \setmathtt{Courier}?

-

There seems to be a bug in mathspec; if I ask for

\showthe\mathcode1


I get 1841, i.e., "0731. It seems that 7 is the math group for Gotham Narrow Light, so the mathcode should be "7731. Indeed, if I say

\mathcode\0=\numexpr\mathcode0+"7000\relax
\mathcode\1=\numexpr\mathcode1+"7000\relax
\mathcode\2=\numexpr\mathcode2+"7000\relax
\mathcode\3=\numexpr\mathcode3+"7000\relax
\mathcode\4=\numexpr\mathcode4+"7000\relax
\mathcode\5=\numexpr\mathcode5+"7000\relax
\mathcode\6=\numexpr\mathcode6+"7000\relax
\mathcode\7=\numexpr\mathcode7+"7000\relax
\mathcode\8=\numexpr\mathcode8+"7000\relax
\mathcode\9=\numexpr\mathcode9+"7000\relax


I get the desired behavior.

-
 Thanks, it works fine now! – Matthew Leingang Jun 14 '11 at 23:56 Good work tracking this down. You saved my afternoon. +1 – ptomato Oct 26 '12 at 12:17

It works with \setmathtt{Courier New} and something like \mathtt{f(x)} because the digits are set with Gotham.

-
But that's the problem Matthew is describing. It seems like when you specify a math font for digits, using \setmathsfont that gets used no matter how you specify the mathtt font. – Alan Munn Jun 10 '11 at 19:41
I know, what's the problem ... – Herbert Jun 10 '11 at 19:44
Matthew wants his mathtt digits to be in the mathtt` font. That's the problem. – Alan Munn Jun 10 '11 at 19:47
@Alan: I wrote that I know the problem ... – Herbert Jun 11 '11 at 6:35
Sorry, a little German/English linguistic mix-up there. Your comma after 'know' and the verb second in 'what's the problem' made me think that 'what's the problem' was a question. (But now I definitely don't understand your posted answer.) – Alan Munn Jun 11 '11 at 12:16