# How to get page number to the right of \textwidth

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}{%
\fancyhf{}%
\fancyfoot[R]{\thepage}%
}
\cfoot{\hspace*{-.1\textwidth}\parbox{1.4\textwidth}{}}


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

• 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
Apr 20, 2022 at 23:17

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{}
\cfoot{\hspace*{-.1\textwidth}\parbox{1.2\textwidth}{\hfill\thepage}}

\begin{document}

\lipsum[1-14] % dummy text

\end{document}



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

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

\pagestyle{fancy}
\fancyhf{}
\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.

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