Page LayoutPage numbering in margin next to text block

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Bram
Posts: 20
Joined: Sat Jul 14, 2012 12:54 pm

Page numbering in margin next to text block

Post by Bram »

Hi,

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post by localghost »

Give a clear problem description in form of a minimal example.


Best regards and welcome to the board
Thorsten
Bram
Posts: 20
Joined: Sat Jul 14, 2012 12:54 pm

Page numbering in margin next to text block

Post by Bram »

localghost wrote:Give a clear problem description in form of a minimal example.


Best regards and welcome to the board
Thorsten
I would like to have page numbers at approximate the position that I have sketched in these pictures:
evenpages.jpg
evenpages.jpg (349.94 KiB) Viewed 4473 times
oddpages.jpg
oddpages.jpg (352.04 KiB) Viewed 4473 times
Ideally, the page numbering should be included in my page style:

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}
Hope you can help!
Last edited by Stefan Kottwitz on Sat Jul 14, 2012 8:23 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Page numbering in margin next to text block

Post by localghost »

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.
Bram
Posts: 20
Joined: Sat Jul 14, 2012 12:54 pm

Page numbering in margin next to text block

Post by Bram »

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.
Sorry, this should be better. Thanks for your patience!

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}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Page numbering in margin next to text block

Post by Stefan Kottwitz »

Hi Bram,

welcome to the board!

Here is an example with textpos:

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}
Stefan
LaTeX.org admin
Bram
Posts: 20
Joined: Sat Jul 14, 2012 12:54 pm

Re: Page numbering in margin next to text block

Post by Bram »

Thanks a lot! That solves my problem, and has shown me the way to a very useful package.
Post Reply