I'm writing a document that uses OSF with KPFonts. However, they look a bit awkward within tables. Is there a way of switching to lining figures locally with KPFonts?
2 Answers
Using math mode for numeric columns should work; however, if you really want that all tabular environments use lining figures, you can do a trick:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[oldstyle]{kpfonts}
\usepackage{array}
\usepackage{etoolbox}
\begin{document}
Numbers: 1234; numbers in math: $1234$
A tabular, first column text, second column math
\begin{tabular}{l>{$}l<{$}}
123 & 123 \\
456 & 456
\end{tabular}
\preto\tabular{\fontfamily{jkp}\selectfont}
A tabular, first column text, second column math
\begin{tabular}{l>{$}l<{$}}
123 & 123 \\
456 & 456
\end{tabular}
\end{document}
As you see, in the second table both columns are equal. If you prefer not having to choose math mode (which might be a nuisance), add the line
\preto\tabular{\fontfamily{jkp}\selectfont}
to your preamble. Remember to \usepackage{etoolbox}
.
Not quite sure why this works (i.e. why it doesn't mess my smallcaps etc. up):
\fontfamily{jkp}\selectfont