Monday, April 2, 2012

LATEX: Automated Pagecounter between two labels

To have an automated and updated counter of your pages between two labels you can use the following commands/packages:

Place in main document:

\usepackage{refcount}
\newcommand{\pagedifference}[2]{%
 \COMMENT{ \number\numexpr\getpagerefnumber{#2}-\getpagerefnumber{#1}\relax}}

To print a page difference:
\pagedifference{chap:start}{chap:end}