1

I want to indent the page number on the foot, so it looks like in the image:

Text

As you can see, the position of \thepage is not aligned with the margin of the outer margin.

\documentclass[10pt,final]{memoir}
\setstocksize{20.5cm}{14cm}
\settrimmedsize{20.5cm}{14cm}{*}

\usepackage[layoutsize={14cm,20.5cm},textheight=16.5cm,textwidth=10cm,inner=1.5cm,outer=2.5cm,top=1.5cm,bottom=2.5cm,footskip=1.7cm,marginparwidth=1.5cm,ignorehead,showcrop=false,showframe=false]{geometry}
%,paperwidth=15.3cm,paperheight=21.3cm,layouthoffset=1.3cm,layoutvoffset=0.8cm
\usepackage{layout,lipsum,microtype}

\makepagestyle{headings}
\makeevenfoot{headings}{\indent\thepage}{\centering\slshape\leftmark}{}
\makeoddfoot{headings}{}{\centering\slshape\rightmark}{\thepage}
\makepsmarks{headings}{%
    \createmark{chapter}{left}{shownumber}{\@chapapp\ }{. \ }
    \createmark{section}{right}{shownumber}{}{. \ }
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
}

\pagestyle{headings}

\begin{document}
\chapter{Test}
\lipsum[1-15]
\end{document}

This the MWE example that I´ve created. My intention is to indent the page numbers in both recto and verso pages.

I´d be very thankful if someone can give me a hand on this. Thank you,

EDIT

How can I align the numbers with the paragraph indent? As you can see, the number 1 is slighty outdented and I want it to be perfectily aligned with the par indent. Thank you again, ![]

1

1 Answer 1

1

Since you want the left edge of the page numbers on even number pages to line up with the \parindent it's best to change the overall width of the footer to be exactly the \textwidth-2\parindent. We do this with the \makerunningwidth macro of memoir.

\documentclass[10pt,final]{memoir}
\usepackage{calc}
\setstocksize{20.5cm}{14cm}
\settrimmedsize{20.5cm}{14cm}{*}
\usepackage[layoutsize={14cm,20.5cm},textheight=16.5cm,textwidth=10cm,inner=1.5cm,outer=2.5cm,top=1.5cm,bottom=2.5cm,footskip=1.7cm,marginparwidth=1.5cm,ignorehead,showcrop=false,showframe=false]{geometry}
%,paperwidth=15.3cm,paperheight=21.3cm,layouthoffset=1.3cm,layoutvoffset=0.8cm
\usepackage{layout,lipsum,microtype}
\newlength{\myfootwidth}
\setlength{\myfootwidth}{\textwidth-2\parindent}


\makepagestyle{headings}
\makerunningwidth{headings}[\myfootwidth]{\textwidth}
\makeevenfoot{headings}{\thepage}{\centering\slshape\leftmark}{}
\makeoddfoot{headings}{}{\centering\slshape\rightmark}{\thepage}
\makepsmarks{headings}{%
    \createmark{chapter}{left}{shownumber}{\@chapapp\ }{. \ }
    \createmark{section}{right}{shownumber}{}{. \ }
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
}
\setcounter{page}{300}
\pagestyle{headings}
\begin{document}
\the\parindent
\chapter{Test}
\lipsum[1-15]
\end{document}

partial output

4
  • Hello Allan. Thank you very much. You´ve helped me so much. However, I have one more question. How can I align the numbers in the same position as the paragraph indent? Once the page number gets on three digits, it is not aligned. I´ve posted a screenshot on my main post. Again, thank you very much. I am still learning Latex :) Sep 28, 2023 at 18:51
  • @RafaelBenítezMozos Do you want the numbers to be left aligned (so that a smaller page number still aligns with the parindent?)
    – Alan Munn
    Sep 28, 2023 at 19:24
  • I've changed the solution to something more robust for what you want.
    – Alan Munn
    Sep 28, 2023 at 19:40
  • Thank you. It works perfectly :) Sep 29, 2023 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .