从网上的资料很容易了解到,输入千分号的LaTeX语言是\textperthousand
。
但我在Slager中直接在文字中用这条语言会有警告。改为{textperthousand}
后警告消失了。
另外,在数学公式中,也不能直接用这个命令,会报错,说这个命令在数学公式环境中是无效的。
所以,在数学公式中,可以这样用
\text{\textperthousand}
\text{ }
是amsmath包中的工具,用于在数学公式中写文字。所以,在导言区应该加上\usepackage{amsmath}
。
网上还有人提出,可以自己创造一个更强大的命令,
\usepackage{textcomp}
\usepackage{amsmath}
\DeclareRobustCommand{\perthousand}{%
\ifmmode
\text{\textperthousand}%
\else
\textperthousand
\fi}