0

My ToC has all page numbers appear just next to the entry heading. This works fine when the page numbers are small; however, with four small roman numerals the page number meets the entry heading. It seems to me the page numbers are flush right, and "moving leftwards". I would like them to move rightwards from the place where the first digit is placed, i.e. flush left. Further, the flush-right-nature of the page numbers make the space between entry heading and page number vary, which I do not like.

The problem arises due to all the preliminary pages of my thesis. Please see MWE which shows the problem. Is there a way to fix this?

Sincerely, Anders

\documentclass[twoside,openright]{memoir}


% page number next to TOC entries

\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterafterpnum}{\cftparfillskip}

\renewcommand{\cftfigureleader}{}
\renewcommand{\cftfigureafterpnum}{\cftparfillskip}

\renewcommand{\cfttableleader}{}
\renewcommand{\cfttableafterpnum}{\cftparfillskip}


\begin{document}
\frontmatter

    \chapter*{Abstract} \addcontentsline{toc}{chapter}{Abstract}
        This study...

    \chapter*{Samandrag} \addcontentsline{toc}{chapter}{Samandrag}
        Dette forsøket...

    \chapter*{Preface} \addcontentsline{toc}{chapter}{Preface}
        Information about the nature of the study.

    \chapter*{Acknowledgements} \addcontentsline{toc}{chapter}{Acknowledgements}
        I wish to thank...

    \cleardoublepage

    \tableofcontents
        \cleardoublepage

    \listoffigures
        \cleardoublepage

    \listoftables
        \cleardoublepage


\mainmatter
    \chapter{Introduction}



\end{document}
  • There is no reason to use \chapter* + \addcontentsline within frontmatter, there \chapter is formatted the same way. – daleif Sep 25 '14 at 12:32
  • Yes, I know, but I did it to work around a "bug" from my thesis code. Without the starred chapter, the ToC entries of "Abstract" and "Samandrag" would be centered on the page, while none of the other chapters would be. – Yoda Sep 25 '14 at 14:32
  • Well it does not on the MWE – daleif Sep 25 '14 at 14:33
  • 1
    I guess the MWE could be even more minimal, then. I have a messy self-made package with all the formatting. Probably something in there causes the bug. – Yoda Sep 25 '14 at 14:36
1

You could use

\renewcommand*{\cftchapterformatpnum}[1]{%
  \cftchapterformatpnumhook{#1}%
  %\hb@xt@\@pnumwidth{\hfil\cftchapterpagefont #1}
  {\quad\cftchapterpagefont #1}
}

Also see my comment on \chapter*

  • This does exactly what I wanted. Much appreciated! – Yoda Sep 25 '14 at 14:34

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.