7

I am writing a book document and I encountered a strange behaviour: whenever a page is left empty (for instance because it represents the end of a chapter) the page number is placed on the top-left corner instead of the usual bottom-center. My latex code is the following:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

\begin{document}

\chapter*{Introduction}
Hey this is some test text.

\chapter{Another chapter}
With some random text.

\end{document}

I'm on Linux and I'm compiling it "manually" by running pdflatex <filename>.tex, and the output is the following. Screenshot

As you can see the second page number is placed in the wrong position. Any idea about how to fix it?

6
  • 1
    that's the normal position, although you could change it, the page is just the last normal page of the previous chapter (which happens to be empty) so it is set with the normal page style. Commented Jan 30, 2016 at 11:11
  • 2
    Welcome to TeX.SE. The behavior you object to is actually standard for all pages except the first page of every chapter. On the first page of a chapter, the page numbering style is "plain", and the page number is placed centered on the bottom of a page. On all other pages -- including all-blank pages at the ends of chapters -- the page numbering style is "headings", and the page numbers are shown in the header row. To modify this setting, you'd have to change the macro \cleardoublepage. Are you interested in doing that?
    – Mico
    Commented Jan 30, 2016 at 11:13
  • @DavidCarlisle thank you for your answer. I tried writing more thank 1 page and, as you said, all pages except the first one of each chapter have numbers placed in top-right/left depending on the "evenness" of the page. I'm pretty new to LaTeX and I didn't know this standard behaviour. Thank you for clarifying that! Commented Jan 30, 2016 at 11:18
  • 2
    If you like to have on all pages the page numbers as it appear on the page with chapter title, than after \begin{document} add \pagestyle{plain}.
    – Zarko
    Commented Jan 30, 2016 at 11:24
  • 2
    @Zarko - Since you've figured out what the OP wants to achieve, you should should post your comment as an answer.
    – Mico
    Commented Jan 30, 2016 at 11:31

1 Answer 1

5

The appearing of page numbers are determined by \pagestyle{...} and \thispagestyle{...}. If you not define otherwise, the document class book use in page with chapters title \thispagestyle{plain} (as part of chapter style definition) and on others page (regardless if they are empty or not) default book page style (where the page numbers are on outside page headers).

So, the cure for your problem is add \pagestyle{plain} after \begin{document}:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

\usepackage{lipsum}

    \begin{document}
\pagestyle{plain}% <--- added

\chapter*{Introduction}
\lipsum
\lipsum[1]
Hey this is some test text.

\chapter{Another chapter}
With some random text.
    \end{document}

You must log in to answer this question.

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