1

I am writing my thesis in LyX, using book koma-script document class. However, I need to make some changes in order my thesis fits to my university requirements.

One of them is that the page numbering must be in the center. In order to do so, I used \cfoot{\thepage}. However, at the beginning of each chapter the numbering goes on the right, but the next pages are centered.

Here is a snapshot:enter image description here

As you can see, the number is on the right, but I want to be in the center. This happens at every chapter, but also at the TOC/LOF/etc. So, my question is how can I center the page numbering of the first page at each chapter in LyX?

Thanks in advance

PS: In LyX I also use the following options for my document class: listof=totoc,english,listtotoc, chapterprefix, tablecaptionabove, bibtotoc, parskip=full, headings=small, numbers=noenddot,intoc. I don't know if there is a conflict between them and center numbering of every page

  • exactly. I use fancyhdr. I am afraid that a MWE will not work, since my thesis is written in LyX. However, I can upload an image. – Yorgos Aug 25 '15 at 11:38
  • BTW I don't think LyX is really important here, so the tag may be superfluous. On the other hand, I would definitely add a tag {fancyhdr}. – campa Aug 25 '15 at 12:07
1

From the fancyhdr manual (p. 7)

Some LaTeX commands, like \chapter, use the \thispagestyle command to automatically switch to the plain page style, thus ignoring the page style currently in effect. To customize even such pages you must redefine the plain pagestyle.

You could therefore write (adapted from the same manual, one page later)

\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage}}

Loosely related advice: when using classes from the KOMA bundle it may perhaps be better to use the package scrpage2. (The same issue applies there: it is described in the KOMA documentation. I can't give you an exact reference here for I have an older version.)

1

With scrbook it would be possible to change the page style for chapter pages to fancy using

\renewcommand\chapterpagestyle{fancy}

But it is recommended to use scrlayer-scrpage together with a KOMA-Script class:

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\cfoot*{\pagemark}

The argument of the starred version of \cfoot is used for both the page style scrheadings and the page style plain.

MWE:

\documentclass{scrbook}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\cfoot*{\pagemark}

\usepackage{lipsum}% for dummy text
\begin{document}
\chapter{Chapter One}
\lipsum
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.