新浪博客

LaTeX技巧465:如何修改数学公式中的数字字体?

2010-12-22 16:50阅读:
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

我用的是Garamod字体来排版文章。数学符号却不是Garamod字体,这是我喜欢这个字体。不过,我想在0... 9用这个字体。我如何实现这一目标?
需要说明的是:我不希望我所有的Garamod数字,只有数学数字用Garamod字体。
【解决方案】
\documentclass{article}
\DeclareSymbolFont{numbers}{T1}{phv}{m}{n}
\SetSymbolFont{numbers}{bold}{T1}{phv}{bx}{n}
\DeclareMathSymbol{0}\mathalpha{numbers}{'3
0}
\DeclareMathSymbol{1}\mathalpha{numbers}{'31}
\DeclareMathSymbol{2}\mathalpha{numbers}{'32}
\DeclareMathSymbol{3}\mathalpha{numbers}{'33}
\DeclareMathSymbol{4}\mathalpha{numbers}{'34}
\DeclareMathSymbol{5}\mathalpha{numbers}{'35}
\DeclareMathSymbol{6}\mathalpha{numbers}{'36}
\DeclareMathSymbol{7}\mathalpha{numbers}{'37}
\DeclareMathSymbol{8}\mathalpha{numbers}{'38}
\DeclareMathSymbol{9}\mathalpha{numbers}{'39}
\begin{document}
abc
$a=123$
\mathversion{bold}
$a=345$
\end{document}
具体的字体设置,多多参看NFSS标准。
演示效果图:
OM8Z]T4_F1C}X$F8TD@J]YA

我的更多文章

下载客户端阅读体验更佳

APP专享