# Move the page number to the very bottom of the page

I need to move the page number to the very bottom of the page, so it scrapes the bottom edge of the actual sheet (US letter). How do we do that?

-
Beware of what you wish for: you may have to print it one day, on a printer which can't print on the last 5mm of the paper... –  Brent.Longborough Nov 10 '11 at 20:48

## 3 Answers

\usepackage[includefoot,bottom=0pt]{geometry}

-

You can do more than move the page number. From comp.text.tex:

\documentclass[a4paper]{article}
\makeatletter
\usepackage{xkeyval}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{picture,graphicx}
\usepackage{atbegshi}
\usepackage{lipsum}

\pagestyle{fancyplain}

\def\tempa{fmt=\fbox,x=.05,y=-.5,color=blue,scale=2.5,angle=90,%
cfoot=,rfoot=,lfoot=,chead=,rhead=,lhead=}
\def\tempd{}
\def\tempc#1=#2\@nil{%
\edef\tempd{%
\unexpanded\expandafter{\tempd}%
\ifx\tempd\@empty\else,\fi#1%
}%
\define@cmdkey[KV]{pagenr}[pgn@]{#1}[#2]{}%
}

\@for\tempb:=\tempa\do{\expandafter\tempc\tempb\@nil}
\begingroup
\edef\x{\endgroup
\noexpand\setkeys[KV]{pagenr}{\unexpanded\expandafter{\tempd}}%
}
\x
\newcommand*\FancyPageNos[1][]{%
\ifx\\#1\\\else\setkeys[KV]{pagenr}{#1}\fi
\cfoot{\pgn@cfoot}\rfoot{\pgn@rfoot}%
\lfoot{\pgn@lfoot}\chead{\pgn@chead}%
\rhead{\pgn@rhead}\lhead{\pgn@lhead}%
\AtBeginShipout{\AtBeginShipoutUpperLeft{%
\textcolor{\pgn@color}{%
\put(\pgn@x\paperwidth,\pgn@y\paperheight)%
{\scalebox{\pgn@scale}{\rotatebox{\pgn@angle}%
{\makebox[0pt][c]{\pgn@fmt{Page \thepage}}}}%
}%
}}}}

\fancyhf{}
\fancyhfoffset[R,L]{\dimexpr\marginparsep+\marginparwidth}
\def\headrule{{\color{blue}%
\hrule height1pt depth.5pt width\headwidth\relax
\vspace{2pt}\hrule height1pt depth.5pt width\headwidth
\vspace{-2pt}}%
}

\def\footrule{{\color{red}%
\hrule height1pt depth.5pt width\headwidth\relax
\vspace{2pt}\hrule height1pt depth.5pt width\headwidth
\vspace{2pt}}%
}

\newcommand*\sstring[1]{{\tt\color{magenta}\detokenize{#1}}}

\begin{document}

\FancyPageNos[fmt=\fbox,x=.05,y=-0.5,color=blue!45!red!75,
scale=5,angle=90,chead=\textcolor{cyan}{From \texttt{xwatermark} package},
cfoot=Specimen fancy page numbers]

\lipsum[1]

\newpage

\FancyPageNos[fmt=\texttt,x=.5,y=-0.15,color=purple,scale=2.5,
angle=0,chead=Sample use of \sstring\FancyPageNos]

\lipsum[2]

\end{document}


The rubbishing of the syntax is not my fault. I simply copied my solution and pasted here. I hope you can arrange the code correctly.

-
Oops, the syntax is correct after all! –  Ahmed Musa Feb 4 '11 at 19:51
Maybe you could add some explanations what this does, for those of us who don't want to/can't read all that code. –  Caramdir Feb 4 '11 at 20:20
If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "101010" on it). –  Caramdir Feb 4 '11 at 20:21
The macro \FancyPageNos provides a key-value interface for formatting and positioning the page number. The keys/options available are typified by the examples provided with the post. ‘fmt’ is the desired format, cfoot, rfoot, lfoot, chead, rhead, lhead have the same meaning as explained in the fancyhdr package documentation. Running the example provided gives further hints. –  Ahmed Musa Feb 4 '11 at 21:03
Thanks, Pluto, this is interesting! –  Alexy Feb 5 '11 at 2:07

Just write:

\setlength{\footskip}{2cm}

-
Welcome to TeX.sx! Answers here should include some details and explanations. Actually answers so short are automatically flagged for moderator review. –  Martin Scharrer Jan 13 '12 at 19:07
This may be an approximate measure. However, since the location of the page number may depend on other components (text block height, for example), this would not solve the original question in general. –  Werner Jan 15 '12 at 17:37