一个众所周知的命令是\boldmath
(相当于\mathversion{bold}
),它使所有数学符号变为粗体。是否有类似的斜体数学命令,其工作原理与 类似\mathit
,它使所有数学符号(包括数字) 斜体在当前块结构中。它应该像下面的 M-non-WE 一样工作。
对我来说,使用\mathit
不是解决方案,因为如上所述,我想要一些适合的东西,全部当前区块中的数学。根据本指南,没有\mathversion{italic}
。
\documentclass{memoir}%it must work with memoir, so no solutions with \it allowed.
\newcommand\italicmath{
%Do magic for me.
}
\begin{document}
Normal math, with upright numbers: $x = 123$.
{\italicmath Italic math, with italic numbers: $x = 123$.}
{\boldmath\italicmath Italic bold math, with italic bold numbers: $x = 123$.}
\end{document}
答案1
\documentclass{memoir}%it must work with memoir, so no solutions with \it allowed.
\newcommand\italicmath{\mathversion{italic}}
\newcommand\bitalicmath{\mathversion{bitalic}}
\DeclareMathVersion{italic}
\SetSymbolFont{operators}{italic}{OT1}{cmr} {m}{it}
\SetSymbolFont{letters} {italic}{OML}{cmm} {m}{it}
\SetSymbolFont{symbols} {italic}{OMS}{cmsy}{m}{n}
\SetMathAlphabet\mathsf{italic}{OT1}{cmss}{m}{sl}
\SetMathAlphabet\mathit{italic}{OT1}{cmr}{m}{it}
\DeclareMathVersion{bitalic}
\SetSymbolFont{operators}{bitalic}{OT1}{cmr} {bx}{it}
\SetSymbolFont{letters} {bitalic}{OML}{cmm} {b}{it}
\SetSymbolFont{symbols} {bitalic}{OMS}{cmsy}{b}{n}
\SetMathAlphabet\mathsf{bitalic}{OT1}{cmss}{bx}{sl}
\SetMathAlphabet\mathit{bitalic}{OT1}{cmr}{bx}{it}
\begin{document}
Normal math, with upright numbers: $x = 123$.
{\italicmath Italic math, with italic numbers: $x = 123$.}
{\bitalicmath Italic bold math, with italic bold numbers: $x = 123$.}
\end{document}