Page Layout ⇒ Page numbering in margin next to text block
Page numbering in margin next to text block
I'ld like to have the page numbering in the margins, so that the numbers appear left or right of the text block. This is for a book design using the memoir class and xelatex.
I would appreciate some help!
Bram
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Page numbering in margin next to text block
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Page numbering in margin next to text block
I would like to have page numbers at approximate the position that I have sketched in these pictures: Ideally, the page numbering should be included in my page style:localghost wrote:Give a clear problem description in form of a minimal example.
Best regards and welcome to the board
Thorsten
Code: Select all
\documentclass{memoir}
\makepagestyle{mystyle}
\makeevenfoot {mystyle}{\pagefootfont\leftmark}{} {}
\makeoddfoot {mystyle}{}{}{\pagefootfont\rightmark}
\createmark {chapter} {both} {nonumber}{ }{. \ }
\pagestyle{mystyle}
\begin{document}
\chapter{Chapter to test layout}
Lorem ipsum dolor sit amet, consectetur
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Page numbering in margin next to text block
\pagefootfont
is detected as an undefined control sequence. Please check your examples for functionality before you present them.Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Page numbering in margin next to text block
Sorry, this should be better. Thanks for your patience!localghost wrote:Your example is not compilable as is. The command\pagefootfont
is detected as an undefined control sequence. Please check your examples for functionality before you present them.
Code: Select all
\documentclass{memoir}
\makepagestyle{mystyle}
\makeevenfoot {mystyle}{\leftmark}{} {}
\makeoddfoot {mystyle}{}{}{\rightmark}
\createmark {chapter} {both} {nonumber}{ }{. \ }
\pagestyle{mystyle}
\begin{document}
\chapter{Chapter to test layout}
Lorem ipsum dolor sit amet, consectetur
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Page numbering in margin next to text block
welcome to the board!
Here is an example with

Code: Select all
\usepackage{calc}
\usepackage[absolute]{textpos}
\makepagestyle{mystyle}
\makeevenfoot{mystyle}{%
\begin{textblock*}{1em}(2em,.5\paperheight)
\Huge\thepage
\end{textblock*}
\thepage
}{}{}
\makeoddfoot{mystyle}{%
\begin{textblock*}{1em}(\paperwidth-3em,.5\paperheight)
\Huge\thepage
\end{textblock*}
\thepage
}{}{}
\pagestyle{mystyle}