Page numbering off by 1

Jerry Seibert jerry at seibercom.net
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.

<code>

\documentclass[10pt,letterpaper,notitlepage]{report}%
\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{fontspec}
\usepackage{luatextra}
\defaultfontfeatures{Ligatures=TeX}
\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[en-US]{datetime2}%
\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{luacolor}
\usepackage{pgf}
\usepackage{pgfmorepages}
\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%

\pgfpagesdeclarelayout{boxed}
{
	\edef\pgfpageoptionborder{0pt}
}
{
	\pgfpagesphysicalpageoptions
	{%
		logical pages=1,%
	}
	\pgfpageslogicalpageoptions{1}
	{
		border code=\pgfsetlinewidth{2pt}\pgfstroke,%
		border shrink=\pgfpageoptionborder,%
		resized width=.95\pgfphysicalwidth,%
		resized height=.95\pgfphysicalheight,%
		center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
	}%
}

\pgfpagesuselayout{boxed}

\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%
\pagenumbering{arabic}%
\fancyfoot[r]{{\footnotesize \textbf{Page \thepage\ of~\pageref*{LastPage}}}}%%

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

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"?

-- 
Thanks!

Jerry


More information about the texhax mailing list.