I am numbering my index pages with roman numerals, but I'm writing the document using restructuredText that is parsed into LaTeX.

I have a preamble that contains all the necessary setup, but after the table of contents, it resets the page numbering back to 1, so \listoftables and \listoffigures show up at page (i) and (ii) respectively instead of (iii) and (iv) like they should. Since my table of contents could change, I don't want to use fixed page numbering.

There is a question that suggests rewriting \tableofcontents to storing the page number, but I have tried that and it didn't work. Since I am new here, I cannot comment on that one.

I would be willing to accept that I cannot fix this as long as I could disable page numbering for the TOC.

The following are the used classes and packages from the generated output:

% Generated by Sphinx.
\documentclass[letterpaper,10pt, openany, oneside, english]{sphinxmanual}
% Include packages

Since I have no control over when the table of contents will be called on, I also redefined the table of contents like this:

% Redefine table of contents to include the tables and figures
  • 4
    \pagenumbering{..} resets the page counter to 1, so don't use it if you don't want it reset. Instead just change the numbering representation using something like \renewcommand{\thepage}{\roman{page}}.
    – Werner
    Commented Feb 28, 2014 at 22:59
  • @Werner: I tried your suggestion, but no matter what I do, the page counter is reset after the table of contents so that the \listoftables starts on (i) again. Does one of the packages above redefine the \tableofcontents in such a way to force a \pagenumbering{arabic} after the TOC?
    – Jeremy
    Commented Mar 3, 2014 at 16:18

1 Answer 1


First of all, \pagenumbering resets the page counter to 1, so don't use it if you don't want it reset. Instead just change the numbering representation using something like


Now, I notice you're using the sphinxmanual document class. Looking at the code, we see a redefinition of \tableofcontents that includes a \pagenumbering:

% This wraps the \tableofcontents macro with all the magic to get the spacing
% right and have the right number of pages if the 'openright' option has been
% used.  This eliminates a fair amount of crud in the individual document files.
    \parskip = 0mm%
        \typeout{Adding blank page after the table of contents.}%
  \pagenumbering{arabic}% <--------------- This resets the page to 1

You can remove this reset of the page number by adding the following to your preamble before you redefine \tableofcontents:

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}

Note that the page style may also be adjusted by sphinxmanual's definition of \tableofcontents. But for now this should get where you want.

  • Thanks! That was it! The patching of the \tableofcontents solved it. I already had \makeatletter in my preamble so I didn't need to add that.
    – Jeremy
    Commented Mar 3, 2014 at 21:43
  • @DaFlame: Sure thing. By the way, the \makeatletter...\makeatother pair was actually not necessary in my patch, but it would matter in your case.
    – Werner
    Commented Mar 3, 2014 at 21:44
  • Hmmm... Now I seem to have another problem. The table of contents is not listing the List of Tables and List of Figures at the correct page number. It lists them as (ii) and (iii) instead of (iii) and (iv) like they should be.
    – Jeremy
    Commented Mar 3, 2014 at 21:47
  • @DaFlame: Note that your document class is called with the openany option, implying that \cleardoublepage is just the same as \clearpage. If you wish to always start a chapter on an odd page, then you should use the openright class option. See How to start new chapters on the right hand side.
    – Werner
    Commented Mar 3, 2014 at 21:51
  • I'm not interested in formal book style really. This is more like a report that will be viewed digitally. If printed, it would be presented in a stapled single page form not via book binding. I'm only interested in correcting the page numbering right now. I suppose I can forgo adding the Tables and Figures to the TOC, but I like having them there.
    – Jeremy
    Commented Mar 4, 2014 at 17:01

You must log in to answer this question.

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