2

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
  • Use math mode for the numbers.
    – egreg
    Sep 30, 2013 at 20:38
  • @egreg The problem is that it gives my CM figures, rather than lining KPFont figures.
    – NVaughan
    Oct 1, 2013 at 0:28

2 Answers 2

2

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}

enter image description here

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}.

2
  • Thanks. What's the use of having etoolbox here?
    – NVaughan
    Oct 1, 2013 at 17:08
  • Oh, OK, I just didn't know about the \preto command!
    – NVaughan
    Oct 1, 2013 at 17:12
0

Not quite sure why this works (i.e. why it doesn't mess my smallcaps etc. up):

\fontfamily{jkp}\selectfont

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .