Page numbering off by 1

Jerry Seibert jerry at
Thu Jul 22 00:20:14 CEST 2021

I am trying to place a frame around several pages in a document I am creating. The frame works fine, "varioref" gets the page number wrong.


\usepackage[verbose=silent]{microtype} %Subliminal refinements towards typographical perfection%
\usepackage[letterpaper, left=0.50in, right=0.50in, top=0.50in, bottom=1.00in]{geometry} %add ``showframe'' to see the margins%
\usepackage{fontenc} % Allows the user to select font encodings%
\usepackage[dvipsnames,svgnames,x11names,table,hyperref,fixpdftex]{xcolor} % Driver independent access to several kinds of colors, tints, etcetera%
\usepackage[full]{textcomp} % Font families with sub-encoding%
\usepackage[inline]{enumitem} % Control layout of itemize, enumerate, description - use enumerate* for inline lists}%
\usepackage[parfill]{parskip} % Adjust paragraph spacing%
\usepackage{anyfontsize} % Lets the user select any font size i.e. \fontsize {}{}\selectfont%
\usepackage{calc} % Simple arithmatic in latex commands%
\usepackage{fancyhdr} % Custom page headers and footers%
\usepackage{graphicx} % Enhanced support for graphics % Driver independent color extentions for latex and pdflatex%
\usepackage{lastpage} % If the hyperref package is used, the references are hyperlinked to their aims. If these hyperlinks shall be suppressed, \pageref*{...} instead of \pageref{...}can be used.%
\usepackage[nospace]{varioref} % This package defines the commands \vref, \vpageref, \vrefrange, and \vpagerefrange for LATEX2".%
\usepackage[hidelinks]{hyperref} % Must be loaded last. It extends the functionality of all the LATEX cross-referencing commands (including the table of contents, bibliographies etc) to produce \special commands which a driver can turn into hypertext links%

		logical pages=1,%
		border code=\pgfsetlinewidth{2pt}\pgfstroke,%
		border shrink=\pgfpageoptionborder,%
		resized width=.95\pgfphysicalwidth,%
		resized height=.95\pgfphysicalheight,%


\pagestyle{fancy} % set page style to fancy%
\fancyfoot{} % clear the footers%
\fancyhead{} % clear the headers%
\renewcommand{\headrulewidth}{0pt} % Eliminate the head rule line%
\renewcommand{\footrulewidth}{2.0pt} % Create a separator line between the document and the footer 2.0pt wide%
\fancyfoot[r]{{\footnotesize \textbf{Page \thepage\ of~\pageref*{LastPage}}}}%%

	Start of document\vref{page 3}.
	this is page 2. \label{page 2}
	this is page three \label{page 3}

This produces: Start of document on page 4.

If I comment out "\pgfpagesuselayout{boxed}", the correct page number is shown. The last page number is correctly printed on each page either way.

I cannot find a way to correct this. It is just an incompatability between "varioref" and "pgf" and "pgfmorepages"?



More information about the texhax mailing list.