[texhax] Question about math fonts in LaTeX

jfbu jfbu at free.fr
Thu Jan 20 17:52:08 CET 2011


Very clever!
I don't see offhand obvious side-effect, but I can point out that on

$\mathbf{0s12{s3xyz098}76\alpha01234xyz}$

(I added curly brackets inside)

is does not quite do the job...

cheers,
JF

Le 20 janv. 11, à 17:31, Vafa Khalighi a écrit :

> I came up with a solution that I think will work however I am not  
> aware of its side-effects. If you know any of its side-effects, then  
> please let me know.
>
> \documentclass{minimal}
> \makeatletter
> \let\orig at mathbf\mathbf
> \DeclareMathAlphabet {\new at mathbf}{OT1}{cmtt}{m}{n}
> \renewcommand{\mathbf}[1]{\expandafter\@math at bf #1@}
> \newcommand{\@math at bf}[1]{%
>  \ifx @#1% then terminate
>  \else
>   
> \ifx0#1\new at mathbf{0}\else\ifx1#1\new at mathbf{1}\else\ifx2#1\new at mathbf{ 
> 2}\else\ifx3#1\new at mathbf{3}\else\ifx4#1\new at mathbf{4}\else\ifx5#1\new@ 
> mathbf{5}\else\ifx6#1\new at mathbf{6}\else\ifx7#1\new at mathbf{7}\else\ifx8 
> #1\new at mathbf{8}\else\ifx9#1\new at mathbf{9}\else\orig at mathbf{#1}\fi\fi\f 
> i\fi\fi\fi\fi\fi\fi\fi
>  \expandafter\@math at bf
>  \fi
> }
> \makeatother
> \begin{document}
> $\mathbf{0s12s3xyz09876\alpha01234xyz}$
> \end{document}
>




More information about the texhax mailing list