我希望能够使用\oldstylenums{}
命令作为显示数字的默认方式,但仅限于数学模式之外。可以这样做吗?我知道有些字体带有此数字系统,但是有没有办法将旧样式设为显示数字的默认方式,比如默认字体?
非常感谢!
編輯:MNW
\documentclass[a4paper,12pt]{extarticle}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[a4paper,margin=1.5in]{geometry}
\begin{document}
This is a document in the default font, made on 12/3/2014. The numbers in this document need to be in the Old English style (where the number's height differs from each other).
$$\text{This is a math block. These numbers should display as modern English style:}12/3/2014}$$
\end{document}
答案1
这使用了拉丁现代 (Latin Modern),它是计算机现代 (Computer Modern) 的修订版本。
\documentclass[a4paper,12pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{cfr-lm}
\begin{document}
This is a document in the default font, made on 12/3/2014. The numbers in this document need to be in the oldstyle figures, which means that some numerals drop below the baseline.
\[\text{This is a math block. Lining numbers:}12/3/2014\]
{\lstyle To temporarily switch to lining figures, you can use \verb|\lstyle| which will produce 0123456789.
\tstyle To temporarily switch to tabular figures, you can use \verb|\tstyle| which will produce 0123456789 if lining figures are active or \ostyle 0123456789 if oldstyle are being used.}
{\plstyle\verb|\plstyle| explicitly requests proportional, lining figures such as 0123456789}. {\tlstyle\verb|\tlstyle| explicitly requests tabular, lining figures such as 0123456789.} {\postyle\verb|\postyle| explicitly requests proportional, oldstyle figures such as 0123456789} and {\tostyle\verb|\tostyle| explicitly requests tabular, oldstyle figures such as 0123456789.}
Alternatively, commands such as \verb|\textpl{}| will typeset their argument using the relevant style:
\begin{quote}
\textpo{0123456789} \verb|\textpo{0123456789}|
\textto{0123456789} \verb|\textto{0123456789}|
\textpl{0123456789} \verb|\textpl{0123456789}|
\texttl{0123456789} \verb|\texttl{0123456789}|
\end{quote}
\end{document}
请注意,正如 Mico 指出的那样,这与古英语这是当代英语的历史祖先,早在数字以任何样式排版之前就已使用!通常,这些数字被称为老式(OSF)或者有时只是文本或者绞刑而外观更现代的则被描述为衬垫。
老式数字通常(但不一定)也成比例的例如,数字“1”的宽度小于数字“8”。相比之下,表格图形的宽度相等。Latin Modern 实际上提供了旧式表格和内衬比例图形,以及旧式比例和内衬表格。这一点值得牢记,因为它会影响cfr-lm
在样式之间切换的字体命令的选项和效果。
例如:
\usepackage[rm={lining,proportional},sf={lining,proportional},tt={lining,proportional,variable}]{cfr-lm}
将默认使用衬线、比例数字 - 而不是衬线表格。