# Setting TOC page number font options

I have a latex document that looks something like this

\documentclass{report}

\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\usepackage[default,osf]{sourcesanspro}

\begin{document}

\tableofcontents

\chapter{Introduction} This chapter's content... \clearpage
\section{Structure} This section's content... \clearpage
\subsection{Top Matter} This subsection's content... \clearpage
\section{More Structure} This section's content... \clearpage
\subsection{More Top Matter} This subsection's content... \clearpage

\chapter{Chapter} This chapter's content... \clearpage
\section{Structure} This section's content... \clearpage
\subsection{Top Matter} This subsection's content... \clearpage
\section{More Structure} This section's content... \clearpage
\subsection{More Top Matter} This subsection's content... \clearpage

\chapter{Chapter} This chapter's content... \clearpage
\section{Structure} This section's content... \clearpage
\subsection{Top Matter} This subsection's content... \clearpage
\section{More Structure} This section's content... \clearpage
\subsection{More Top Matter} This subsection's content... \clearpage

\chapter{Chapter} This chapter's content... \clearpage
\section{Structure} This section's content... \clearpage
\subsection{Top Matter} This subsection's content... \clearpage
\section{More Structure} This section's content... \clearpage
\subsection{More Top Matter} This subsection's content... \clearpage

\end{document}


Resulting in a TOC that looks like this:

The alignment of the page numbers looks pretty bad:

As you can see I've defaulted the document to oldstyle figures but that doesn't look good in the TOC. I'd prefer to using tabular lining (or perhaps tabular oldstyle) figures for the TOC page numbers.

How can I set the TOC to use tabular lining figures?

One wrinkle ... I believe there might be a way to do this with fontspec but my microtype options don't seem to work with XeLaTeX or LuaLaTeX

• It looks OK to me with the page numbers matching the entry titles (bold chapter name and bold page number). The tocloft package may be of assistance; perhaps I'll look at that at some time. Feb 23, 2019 at 19:37
• The issue is the alignment of the numbers. Currently the numerals are proportional old style. I’m trying to figure out how to change them to lining tabular just for the TOC. Feb 25, 2019 at 9:27

The sourcesanspro package doesn't provide a command to change to tabular lining figures, but you can easily create one:

\newcommand\tabularnums{%
\def\sourcesanspro@figurealign{T}%
\def\sourcesanspro@figurestyle{LF}%
\def\familydefault{SourceSansPro-TLF}%
\fontfamily{SourceSansPro-TLF}%
\selectfont
}


Then

{\tabularnums
\tableofcontents
}


will yield:

• How can this be extended to do lining numbers for the TOC instead of old style? Feb 26, 2019 at 19:33
• @agf1997 sorry, wasn't reading closely enough... Feb 26, 2019 at 22:13
• no worries. I actually figured it out myself and then decided I prefer the old style anyway. I’m not sure if that’s improper usage of old style but it just looks better IMHO. Thanks for adding to the answer though as others might find it helpful Feb 26, 2019 at 22:18