[Tex/LaTex] How to change page number location on ALL pages (including chapter pages) WITHOUT fancyhdr

header-footerlyxmemoirpage-numbering

Question revised: What must I do to change the page number position on EVERY page (especially for chapters) WITHOUT using fancyhdr?

Background and details: I've searched now for many, many hours everyday for almost a week to find the answer to that question, and the closest I've gotten has gotten my thesis so that it prints all page numbers where I want (bottom-right of each page) except for the chapters and a few other pages (like the first page of the table of contents, first page of the list of tables, and the first page of the list of figures).

I cannot use fancyhdr as I'm using the "book (Memoir)" style for the document, which will not allow the use of fancyhdr (at least I've not been able to get it to work). I DID use a different format at first and got the page numbers in the right locations using fancyhdr, but found other (bigger) limitations that I was able to overcome by switching to memoir.

Searching has got me as far as putting the following code into the LaTeX Preamble:

\makeevenfoot{headings}{}{}{\thepage}
\makeoddfoot{headings}{}{}{\thepage}
\makeevenhead{headings}{}{}{}
\makeoddhead{headings}{}{}{}

That puts the page number at the bottom-right of each page (as I need it to be) EXCEPT for the chapters (also the first pages of the TOC, LOT, LOF). For the chapters it places the page number at the bottom-center. So all I need now is to know how to make the page numbers in the chapters to be at the bottom-right as well. (It would be nice if I could also make the page numbers in the first page of the TOC, LOT, and LOF at the bottom-right as well, but the chapters are most important.)

[NOTE 1: All headers and other footers should be clear of anything. I can't use solutions that place the page number in the right location, but also put other things in headers/footers (like chapter or something).]

[NOTE 2: I am happy with any solution. However, if possible, I would like to know how to do this in the LaTeX Preamble, and also individually on a page with code.]

Other details that may be relevant:

  • I'm using LyX version 2.0.6.
  • Document class: book (Memoir).
  • Modules selected: Custom Header/Footerlines.
  • Page Layout -> Headings style: Default.
  • Not two-sided.
  • Margins: 4cm above, 3cm below, 4cm left, and 3cm right.
  • LaTeX Preamble: (shown in code above—no other code in the preamble at this time).

Thank you for your time if you decide to help me with this! I know your time is important, which is why I searched a good while before finally asking the question.

Question again: What must I do to change the page number position on ALL/EVERY page (especially for chapters) WITHOUT using fancyhdr?

EDIT: Just in case there are others wondering the same thing, but need the page numbers in a different location than on the bottom-right (as I need), it would be nice for answers to explain that as well (and/or give examples for the other locations).

As for the page numbers for the normal pages (not including chapters and such), to change the position of the page number just move "\thepage" to the left, middle, or right of the "{}{}{}" at the end of "{headings}" in the code I posted above.

For example (on a one-sided document), if you want it at the bottom-left instead of the bottom-right, then do as follows:

\makeevenfoot{headings}{\thepage}{}{}
\makeoddfoot{headings}{\thepage}{}{}
\makeevenhead{headings}{}{}{}
\makeoddhead{headings}{}{}{}

Best Answer

The memoir class uses the page style chapter for chapter starting pages. By default this is the same as plain, but there are facilities for modifying it.

\documentclass{memoir}

\usepackage{kantlipsum} % just for the example

\makeevenfoot{headings}{}{}{\thepage}
\makeoddfoot{headings}{}{}{\thepage}
\makeevenhead{headings}{}{}{}
\makeoddhead{headings}{}{}{}

\copypagestyle{chapter}{plain} % make chapter a page style of its own
\makeevenfoot{chapter}{}{}{\thepage}
\makeoddfoot{chapter}{}{}{\thepage}
\makeevenhead{chapter}{}{}{}
\makeoddhead{chapter}{}{}{}

\begin{document}

\mainmatter

\chapter{A title}

\section{Something}

\kant

\end{document}

enter image description here

You could just say

\copypagestyle{chapter}{headings}

and avoid setting \makeeven... for chapter, but I don't recommend it, because you may later want to change the headings page style and it's better headings and chapter remain distinct.