Whenever my class handouts require a second side, I add the indicator Page 2$\rightarrow$ at the bottom (flush right) to spotlight the fact that there is additional content on the flip-side. Presently, I accomplish this with a simple \vfill and \hfill. But the indicator then occupies page space. How can I most easily (preferably using native LaTeX) push this indicator into the footer (flush right) of the document?
Asked
Active
Viewed 1,337 times
2
d-cmst
- 23,095
steven_nevets
- 1,549
3 Answers
1
I would prefer a standard solution with Page 1 of 2, like this:
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lastpage}
\fancyfoot[C]{Page \thepage\@ of \pageref{LastPage}}
\pagestyle{fancy}
\usepackage{lipsum}
\begin{document}
\lipsum[1-20]
\end{document}
Don't forget to compile multiple times.
yo'
- 51,322
0
Based on my answer at What are the ways to position things absolutely on the page?
\documentclass{article}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
\AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
\raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{\textcolor{red}{#3}}}}}
% VERIFIED THAT SETTING \hoffset AND \voffset DO NOT BREAK SOLUTION.
%\hoffset=0.4in
%\voffset=0.2in
\begin{document}
\atxy{\dimexpr\hoffset+\PageLeftMargin+\oddsidemargin+\textwidth}{10in}{%
\makebox[0pt][r]{\LARGE Page 2$\rightarrow$}}
\lipsum[1-7]
\end{document}

Steven B. Segletes
- 237,551
0
Here are two attempts. I think you need to use the twoside option, which may affect your margin settings. The first def has the desired feature only on page 1. The second version is simpler, but will have the feature for all odd pages, and doesn't check if the final page has an even number, so it's really only 'guaranteed' for a two page doc.
\documentclass[twoside]{article}
\makeatletter%
\def\myfoot{%
\let\@oddhead\@empty%
\def\@oddfoot{\ifnum\value{page}=1\reset@font\hfill\thepage\hfill%
\makebox[0pt][l]{Page \the\numexpr(\value{page}+1)$\to$}%
\else {\reset@font\hfil\thepage\hfil}\fi}%
\let\@evenhead\@empty%
\def\@evenfoot{\reset@font\hfil\thepage\hfil}}%
\makeatother
\begin{document}
Hello.
\myfoot
\end{document}
Second def.
\makeatletter%
\def\myfoot{%
\let\@oddhead\@empty%
\def\@oddfoot{ \reset@font\hfill\thepage\hfill%
\makebox[0pt][l]{Page \the\numexpr(\value{page}+1)$\to$}%
\let\@evenhead\@empty%
\def\@evenfoot{\reset@font\hfil\thepage\hfil}}}%
\makeatother
corporal
- 741
fancyhdrforbidden? – d-cmst Sep 17 '14 at 18:51\usepackage{lastpage}\usepackage{fancyhdr}\fancyfoot[C]{\thepage/\pageref{lastpage}}? This way it displays1/2so that everyone knows there's another page, and you don't need to add some manual tweaks with an ugly output ;) – yo' Sep 17 '14 at 23:37lastpagenow. Also, it does not spew warnings telling me to usepagesltsinstead! – cfr Sep 17 '14 at 23:53fancyhdrsolution as an answer, I'd be happy to select it officially as my accepted answer. Thanks again. – steven_nevets Sep 18 '14 at 21:08