0

I would like to set my page numbers to the bottom right to the right of \textwidth. I have a couple figures that have long footnotes and the page numbers are currently on top of this. While not ideal, I would just like to move the page numbers more to the right to not overlap with the text.

Based on How to set page number at right footer and How can I make the fancyhdr footer to be longer than \textwidth?, I have tried this:

\pagestyle{fancy}
\fancyhf{}
\fancyfoot[R]{\thepage}
\fancypagestyle{plain}{%
    \renewcommand{\headrulewidth}{0pt}%
    \fancyhf{}%
    \fancyfoot[R]{\thepage}%
}
\cfoot{\hspace*{-.1\textwidth}\parbox{1.4\textwidth}{}}
\renewcommand{\headrulewidth}{0pt}%

However it doesn't seem to work. How can I change it to get what I want?

1
  • Which document class you use? How you set your page layout? Using geometry package? Page number and footnote are not in the same space for typing. They won't overlap each other unless you have negative footskip value
    – Tom
    Commented Apr 20, 2022 at 23:17

1 Answer 1

2

The closest thing to the solutions you posted would be something like this:

\documentclass[12pt]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}% for dummy text

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\cfoot{\hspace*{-.1\textwidth}\parbox{1.2\textwidth}{\hfill\thepage}}

\begin{document}

\lipsum[1-14] % dummy text

\end{document}

page number in margin

Though I think you're supposed to do it using \fancyfootoffset:

\documentclass[12pt]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset[R]{2.5em}
\rfoot{\thepage}

\begin{document}

\lipsum[1-14] 


\end{document}

Either way you'll probably have to fiddle with the lengths to get what you want.

1
  • Yes, \fancyfootoffset is the proper way. Commented Apr 21, 2022 at 5:47

You must log in to answer this question.

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