0

When using the titletoc package, how does one get rid of the space between the page of the chapter, section, ecc and the right margin of the page?

MWE:

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

enter image description here

1

\contentsmargin sets the rightmargin in the table of contents:

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

enter image description here

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.