6

I use the mathpazo package with the osf option to get the Palatino font with old style figures. However, i want lining figures on the title page and in the table of contents. I have already found a way to use lining figures on the title page by using this command:

\fontfamily{pplx}\selectfont

I have tried to use this on my TOC page as well, but with little success:

{
    \fontfamily{pplx}\selectfont
    \thispagestyle{empty}
    \tableofcontents
}

This will fix the section numbering, however not the page numbers to the right. How can i achieve that? Here's a minimal failing example:

\documentclass{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\usepackage[sc,osf]{mathpazo}
\usepackage[onehalfspacing]{setspace}

\usepackage{blindtext}


\begin{document}

\begin{titlepage}
    \fontfamily{pplx}\selectfont
    \begin{center}
        Lining figures on the title page: 1234567890
    \end{center}
\end{titlepage}

\pagebreak
{
    \fontfamily{pplx}\selectfont
    \thispagestyle{empty}
    \tableofcontents
}

\pagebreak
\setcounter{page}{1}
\blinddocument

\end{document}

And this is how the TOC looks like:

enter image description here

5

Surprisingly the Koma styles do not provide a simple way to hook in to this for all entries in the table of the contents. There are styles for the sectionentrypagenumber for the page numbers of sections (and corresponding ones for chapters and parts), but not for lower level entries. Digging through the code one finds that at the bottom is the standard LaTeX command \@dottedtocline which puts the page number (its 5th argument) in a box constructed as

\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}

In particular, the font called is \normalfont. So to change the style in the way you request, we need to set \familydefault, e.g. via

\renewcommand{\familydefault}{pplx}

Doing this locally in the group for the table of contents, we can replace your \selectfont with \normalfont:

Sample output

\documentclass{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\usepackage[sc,osf]{mathpazo}
\usepackage[onehalfspacing]{setspace}

\usepackage{blindtext}


\begin{document}

\begin{titlepage}
    \fontfamily{pplx}\selectfont
    \begin{center}
        Lining figures on the title page: 1234567890
    \end{center}
\end{titlepage}

\pagebreak
{
  \renewcommand{\familydefault}{pplx}\normalfont
  \thispagestyle{empty}
  \tableofcontents
}

\pagebreak
\setcounter{page}{1}
\blinddocument

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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