5

I use a custom page numbering for appendices:

    \renewcommand{\thepage}{A~--~\arabic{page}}

The problem is there is a overfull \hbox in the Table of Figures for the custom page numbering:

The page numbering for appendix ceate an overfull hbox

The problem does not appear in the Table of Contents, so I am really wondering why it happens and what can I do to prevent it ?

Thank you for your help.

1
  • How did you remove the chapters' starting page numbers from the toc, please? May 26, 2016 at 11:55

1 Answer 1

4

You have to increase the width of the box used to typeset page numbers in the toc, lot and lof etc since A - 1 is not fitting in (it protrudes in to the right margin in your figure). The following diagram is useful.

enter image description here

Here \@pnumwidth is the width of the box where page numbers are typeset. Note that \@tocrmarg should be greater than \@pnumwidth for otherwise, the dots will hit the page number in toc.

You can change \@tocrmarg and \@pnumwidth by adding these in your preamble.

\makeatletter
  \renewcommand{\@pnumwidth}{3em}
  \renewcommand{\@tocrmarg}{4em}
\makeatother

As an alternative, you can use tocloft package and add these in your preamble

\cftsetpnumwidth{3em}
\cftsetrmarg{4em}  %% make sure that this is larger than above

MWE

\documentclass{book}

%% without packages
\makeatletter
  \renewcommand{\@pnumwidth}{3em}
  \renewcommand{\@tocrmarg}{4em}
\makeatother
%% with tocloft
%\usepackage{tocloft}
%\cftsetpnumwidth{3em}
%\cftsetrmarg{4em}
\begin{document}
\tableofcontents
\listoffigures
\setcounter{page}{1000}
\chapter{Some}
\section{some}
\begin{figure}
  \caption{some figure}
\end{figure}
\end{document}
4
  • Thank you so much, it is working perfectly! Very complete answer by the way, thanks again !
    – jujux789
    Aug 16, 2014 at 19:51
  • @Harish Your solution works great, but it 'messes up' the list of tables and list of figures. Could you please tell me, how to use the settings only for the table content? Thank you very much! May 26, 2016 at 11:46
  • @BBerry What do you mean by table content? Is it list of tables?
    – user11232
    May 28, 2016 at 13:49
  • @Harish Sorry for the confusion, I meant the \tableofcontents May 29, 2016 at 8:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .