I'm working on a document which is fairly math-heavy, but also contains numbers outside of math mode. I want these numbers to be displayed as old-style/text figures. I also want a Palatino-type font (either mathpazo
or tgpagella
). Using tgpagella
with textcomp
gives me text figures, but then math mode is displayed in the regular Computer Modern font. Using mathpazo
with the [osf]
option gives me text figures everywhere---even in titles, headings, and math mode, where they don't belong. I can't seem to figure out how to mix text and lining figures with Palatino-like math fonts.
1 Answer
This is a XeLaTeX solution:
\documentclass{article}
% Load mathpazo as a math font
\usepackage{mathpazo}
% Load Pagella as a text font by specifying no-math to fontspec
\usepackage[no-math]{fontspec}
\setmainfont[Numbers=OldStyle]{TeX Gyre Pagella}
\begin{document}
Some numbers outside math mode: 1 2 3 4 5
Some numbers in math mode: $1 2 3 4 5$
\end{document}
It works the same for headers (use math-mode if you don't want old-style figures).
Edit: OSF are fine in headers and titles unless you write them in full capital letters (by contrast to roman, bold, italic and small-caps). Automatically putting lining figures there would require quite a bit more work (such as redefining the section headers) and I don't quite think it is worth it – especially since the result would not be typographically correct.
[osf]
option ofmathpazo
, you get text figures in math mode? I agree with the fact that you get text figures in titles, but not in math mode.\usepackage[osf]{mathpazo}
you certainly get text figures in titles and headers, and certainly not in math mode. If you want lining figures in titles and headers, you should tell more about the document class you're using.