使用该titletoc
包时,如何消除章节、部分、ecc 的页面与页面右边距之间的空间?
梅威瑟:
\documentclass{book}
\usepackage{titletoc}
\usepackage[showframe]{geometry}
% ----------
\titlecontents{chapter}[0pc]%
{\addvspace{2.7ex}\large}%
{\contentslabel[\thecontentslabel]{0pc}\hspace{1pc}}
{}%
{\nolinebreak\enspace\textbullet\enspace\hfill\thecontentspage}
% ----------
\begin{document}
\tableofcontents
\chapter{A chapter}
\chapter{Another chapter}
\end{document}
答案1
\contentsmargin
设置目录中的右边距:
\documentclass{book}
\usepackage{titletoc}
\usepackage[showframe]{geometry}
\usepackage{lipsum}
% ----------
\contentsmargin{0pt}
\titlecontents{chapter}[0pc]%
{\addvspace{2.7ex}\large}%
{\contentslabel[\thecontentslabel]{0pc}\hspace{1pc}}
{}%
{\nolinebreak\enspace\textbullet\enspace\hfill\thecontentspage}
% ----------
\begin{document}
\tableofcontents
\chapter{A chapter}
\chapter{Another chapter}
\end{document}