[texhax] Question about math fonts in LaTeX

jfbu jfbu at free.fr
Thu Jan 20 22:30:24 CET 2011


Sorry for posting twice, but I do not see my posts on the mailing list,
and did not receive them (although I checked that my profile does
say to include me in the list of the recipients of my own messages)

motivated by Philipp's code, I can propose a further method
(of course OT1 can be T1, etc..)

\documentclass{minimal}
\DeclareSymbolFont{fontfordigits}{OT1}{cmtt}{m}{n}

\newcommand\hackit{%
\edef\tmp{0\the\symfontfordigits}%
\mathcode`\0=\expandafter"\tmp30\relax%
\mathcode`\1=\expandafter"\tmp31\relax%
\mathcode`\2=\expandafter"\tmp32\relax%
\mathcode`\3=\expandafter"\tmp33\relax%
\mathcode`\4=\expandafter"\tmp34\relax%
\mathcode`\5=\expandafter"\tmp35\relax%
\mathcode`\6=\expandafter"\tmp36\relax%
\mathcode`\7=\expandafter"\tmp37\relax%
\mathcode`\8=\expandafter"\tmp38\relax%
\mathcode`\9=\expandafter"\tmp39\relax}

\let\oldmathbf\mathbf
\renewcommand\mathbf[1]{{\oldmathbf{\hackit\relax#1}}}

\begin{document}

\[\mathbf{0s12{s3xyz098}76\alpha01234xyz}\quad 
0s12{s3xyz098}76\alpha01234xyz\]

\end{document}

Regards,

Jean-Francois Burnol





More information about the texhax mailing list