設定目錄頁碼字型選項

設定目錄頁碼字型選項

我有一個乳膠文檔,看起來像這樣

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

產生的 TOC 如下所示:

總有機碳

頁碼的對齊方式看起來很糟:

頁碼

正如您所看到的,我已將文件預設為舊式數字,但這在目錄中看起來不太好。我更喜歡使用表格襯裡(或可能是舊式表格)數字作為目錄頁碼。

如何設定目錄以使用表格襯裡數字?

一個皺紋......我相信可能有一種方法可以做到這一點,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
}

將產生:

目錄

相關內容