A very similar issue has been asked quite a while ago. Although, my goal is not to put the page numbers in the header, but in the side margin. I am using the twoside and a5paper options in LaTeX Memoir.

Is there a similar approach to that one mentioned as an answer to the linked issue? I found a solution using TikZ here, but is there a way of achieving this directly by using Memoir?


I have modified the answer that you refer to.

% pagenumberprob.tex SE 561745   --- a modification of the answer to SE 446031


%% Make headers what I want (don't say Chapter 1 chap 1 etc)

%% new page style

%% line to show where page actually ends

% use a zero sized picture to place the page number

%% attempt at header where page number exists in the margin - alternating left and right


\chapter{Chap 1}

\section{sec 1}

\section{sec 2}


You may want to adjust the location of the page numbers and their font.

  • That worked perfectly! So I assume there is not really a good way to do it without using a picture to move the number around? Then this idea is actually quite similar to the TikZ solution linked above, right? – TiMauzi Sep 7 '20 at 20:26
  • @TiMauzi A zero sized picture is a good way to put things where you want them to be. – Peter Wilson Sep 8 '20 at 17:40

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.