3

In the LaTeX book class, I would like to have my page numbers start at one on the title page, and continue in arabic numbers all the way through to the end of the index.

I find that the \mainmatter command, in addition to starting section numbering, also resets the page numbers.

After reading this question I tried running this in my preamble:

\renewcommand\mainmatter{%
    \cleardoublepage
  \@mainmattertrue}

But I ended up with:

! You can't use `\spacefactor' in vertical mode.
\@->\spacefactor 
                 \@m 
l.45 \mainmatter

!  ==> Fatal error occurred, no output PDF file produced!

How can I achieve my aim of continuous numbering?

Bill Cheatham
  • 2,323
  • 1
  • 20
  • 18
  • Do you have a \frontmatter instruction after \begin{document}? If so, just omit the \frontmatter instruction. – Mico Apr 04 '16 at 19:28
  • 4
    any command containing an @ sign is "internal" and has to be treated specially. just wrap this definition in \makeatletter ... \makeatother and that will get rid of the error message. whether it will give the result you're looking for is untested. – barbara beeton Apr 04 '16 at 19:29
  • Brilliant, yes @barbarabeeton that fixed it (although not in the renewcommand macro for some reason - I just included \makeatletter\@mainmattertrue\makeatother \cleardoublepage where I used to have \mainmatter). – Bill Cheatham Apr 04 '16 at 19:41
  • @BillCheatham -- since \mainmatter is usually used just before the first chapter, if you leave it there unchanged, you will get duplicate page numbers. the change you made (omitting \pagenumbering{arabic}) gets rid of that problem. – barbara beeton Apr 04 '16 at 20:05
  • an easy way is to add \renewcommand*\pagenumbering[1]{} – touhami Apr 04 '16 at 22:56

0 Answers0