2

How do I get all pages numbered in Roman numerals before the beginning of the first chapter (with the exception of the title page)? The PDF program should be able to recognize which pages are numbered in Roman and which are in Arabic.

\documentclass{scrreprt}

\title{abc}
\subtitle{def}
\author{ghi}
\date{mno}

\begin{document}

\maketitle\thispagestyle{empty}

\tableofcontents

\chapter{pqr}\setcounter{page}{1}

\end{document}

2 Answers 2

2

Set it as \roman (more common than \Roman) and then change it again to \arabic using \pagenumber{arabic}. Issuing the appropriate \clearpages will help with the correct numbering.

\documentclass{scrreprt}

\title{abc}
\subtitle{def}
\author{ghi}
\date{mno}

\begin{document}

\renewcommand{\thepage}{\roman{page}}

\maketitle

\clearpage

\tableofcontents

\cleardoublepage
\pagenumbering{arabic}% Reset page numbering and style
\chapter{pqr}

\end{document}

The title is set without a page number by default, but still counts as a page.

10
  • 1
    @Schubladenzieher: In general, some document classes forces a recto (right-hand) page for major document divisions (like \part and/or \chapter). \cleardoublepage will ensure that you're on that recto/right-hand page before setting the sectional unit. If the class doesn't have this restriction, \cleardoublepage defaults to \clearpage.
    – Werner
    Jul 12, 2021 at 23:00
  • 1
    Why not \pagenumbering{roman}?
    – egreg
    Jul 13, 2021 at 16:40
  • 1
    @Schubladenzieher: True, you can use \pagenumerbering{roman} instead of \renewcommand{\thepage}{\roman{page}} in the preamble. It has the same effect (since resetting the page number here is superfluous, but harmless).
    – Werner
    Jul 13, 2021 at 17:55
  • 1
    @Schubladenzieher: \pagenumbering{roman} has more contextual value, but it doesn't just change the numbering style; it also resets the page number. If you know what it's doing, using \pagenumbering{roman} for the context. If you're just changing the display mid-document and don't need the page numbers reset, use \renewcommand{\thepage}{\roman{page}}.
    – Werner
    Jul 13, 2021 at 18:45
  • 1
    @Schubladenzieher: Yes. \pagenumbering{<style>} does \setcounter{page}{1}\renewcommand{\thepage}{\<style>{page}} (at a lower level; see ltxpageno.dtx) and that's it. It doesn't have anything to do with \clearpage or \cleardoublepage.
    – Werner
    Jul 13, 2021 at 19:03
2

Replace scrreprt with scrbook that provides page numbering in the desired fashion.

The only difference between the two classes is that scrreprt uses oneside by default.

\documentclass[oneside]{scrbook}

\title{abc}
\subtitle{def}
\author{ghi}
\date{mno}

\begin{document}

\frontmatter

\maketitle

\tableofcontents

\mainmatter

\chapter{pqr}

\end{document}

No \cleardoublepage necessary.

4
  • Why are there blank pages between title and table of contents and between table of contents and first chapter when I leave out \oneside? Wouldn't that be the right way to write a scrbook? Jul 13, 2021 at 17:06
  • 1
    @Schubladenzieher The default for scrbook is twoside, so chapters start on odd numbered pages.
    – egreg
    Jul 13, 2021 at 17:13
  • I am still a little confused about the difference between \cleardoublepage and \clearpage in scrreprt. If scrreprt has oneside as default, does that mean \clearpage would be enough? Or should I always use \cleardoublepage with such document classes? Jul 13, 2021 at 17:20
  • 1
    @Schubladenzieher Under oneside, \clearpage and \cleardoublepage are equivalent.
    – egreg
    Jul 13, 2021 at 17:35

You must log in to answer this question.

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