Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using kpfonts in my document with old style numbers. However, in some sections (e.g. figures and tables), I want to revert to the normal style numbers. There is a command for doing that - \classicstylenums - but the text has to be given as an argument, like so: \classicstylenums{text text text text} Instead of having to repeat the command for each text segment, I want to declare it once, like so: \myclassicstylenums text text text ... And by doing it within a group, the text reverts back to old style numbers.

Anyone has any idea on how to achieve this?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can revert to lined numbers by defining

\newcommand\linednumbers{%
  \renewcommand{\rmdefault}{jkp}%
  \renewcommand{\sfdefault}{jkpss}%
  \normalfont}

This is a declaration that will respect grouping; so, for example, you can put it inside a table environment.

You can also use it as an environment by itself:

\begin{linednumbers}
Material with lined numbers
\end{linednumbers}

but it's best to use it for complete paragraphs.

If one is devious enough to use the fulloldstylenums option, then something more is needed:

\newcommand\linednumbers{%
  \renewcommand{\rmdefault}{jkp}%
  \renewcommand{\sfdefault}{jkpss}%
  \normalfont\mathversion{lined}}
\DeclareMathVersion{lined}
\SetSymbolFont{operators}{lined}{OT1}{jkp}{m}{n}
share|improve this answer
    
I've noticed that this doesn't work for math mode. Could you augment your answer to include that as well? –  gablin Jan 30 '12 at 13:41
    
@gablin See edited message; I wouldn't use fulloldstylenums except for reproducing very old books (but I don't think that the Kp fonts are suitable for this). –  egreg Jan 30 '12 at 14:14
    
Ah damn, didn't realize that kpfonts had two separate options for old style numbers. That solved my problem! Thanks! –  gablin Jan 31 '12 at 8:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.