1

I have a document where all the figures are put on separate pages (sometimes more than one figure to a page, which is fine). This is achieved using the \begin{figure}[p] option in the figure environment. This does exactly what I want and puts any figures always on their own pages.

However, I need these pages to be numbered independently from the main body of text, with a counter for the total number of figure pages. For example, I need the document to progress: page 1, page 2, Figure page 1/3, page 3, Figure page 2/3, Figure page 3/3, page 4, page 5.

I don't mind if the main text page numbers continue counting through the figure pages, but I'd prefer it if they didn't as per my example above.

Thanks.

Heather
  • 836
  • related http://tex.stackexchange.com/questions/33007/suppress-page-number-for-a-single-page-that-only-contains-one-large-table – touhami Jan 28 '16 at 12:08

1 Answers1

2

This isn't quite what you wanted, but you might warm up to it. It moves all the floats to the end of the document.

\documentclass{article}
\usepackage[nofiglist,nomarkers]{endfloat}
\usepackage{lastpage}
\usepackage{mwe}

\makeatletter
\def\ps@float{\ps@plain
  \def\@oddfoot{\hfil Float \thepage{ of }\pageref{LastPage}\hfil}%
  \let\@evenfoot=\@oddfoot}
\makeatother

\AtBeginDelayedFloats{\pagestyle{float}\setcounter{page}{1}}

\begin{document}

\begin{figure}[p]
\centering
\includegraphics{example-image}
\caption{test}
\end{figure}

\lipsum[1-8]

\end{document}

The only thing I know of that will delay until the float is outputted is \protected@write.

I added two new counters and redefine \thepage as \thetextpage or \thefloatpage as needed, so the \tableofcontents, \listoffigures and \pageref should work.

\documentclass{article}
\usepackage{xcolor}
\usepackage{everypage}
\usepackage{mwe}

\newcounter{textpage}
\newcounter{floatpage}
\renewcommand{\thefloatpage}{{\color{red}\arabic{floatpage}}}

\makeatletter
\newcommand{\floatpage}{\protected@write\@auxout{\let\arabic\relax}% expand at shipout
  {\string\newfloatpage{\arabic{page}}}}

\newcommand{\newfloatpage}[1]% #1 = \arabic{page}
  {\@ifundefined{floatpage#1}{\expandafter\gdef\csname floatpage#1\endcsname{\relax}}{}}

\newcommand{\mypagestyle}{\@ifundefined{floatpage\arabic{page}}%
  {\stepcounter{textpage}\global\let\thepage=\thetextpage}%
  {\stepcounter{floatpage}\global\let\thepage=\thefloatpage}}
\makeatother

\AddEverypageHook{\mypagestyle}

\begin{document}

\listoffigures
\bigskip

\begin{figure}[p]
\floatpage% place in every figure[p]
\centering
\includegraphics[height=.9\textheight,width=.9\textwidth]{example-image}
\caption{test}
\end{figure}

\lipsum[1-8]

\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120