设置目录页码字体选项

设置目录页码字体选项

我有一个类似这样的乳胶文档

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

生成的目录如下所示:

目录

页码的对齐看起来很糟糕:

页码

如您所见,我已将文档默认为旧式数字,但这在目录中看起来不太好。我更喜欢使用表格衬线(或许是表格旧式)数字作为目录页码。

如何设置目录以使用表格式数字?

一个问题...我相信可能有办法做到这一点,fontspec但我的microtype选择似乎不起作用XeLaTeXLuaLaTeX

答案1

sourcesanspro软件包没有提供更改为表格内衬图形的命令,但您可以轻松创建一个:

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

然后

{\tabularnums
 \tableofcontents
}

将产生:

目录

相关内容