排除总页数

排除总页数

前两页包含一些标题页图像,它们不应计入首页计数,也不应计入总页数。是否可以通过.aux文件进行更新?

filenamenew_pgcount.xml输出应该是

所需输出:

<fpage>101</fpage> <lpage>103</lpage> <tpage>3</tpage>

电流输出:

<fpage>3</fpage> <lpage>103</lpage> <tpage>5</tpage>

请找到以下 MWE 文件:

\documentclass[demo]{article}
\usepackage{lipsum}
\usepackage{zref-totpages}
\usepackage{graphicx}

\newcounter{xmyFP}
\newcounter{xmyLP}
\newcommand\valxmyFP{\setcounter{xmyFP}{\thepage}}
\newcommand\valxmyLP{\setcounter{xmyLP}{\thepage}}

\newcommand\outputmetainfo{%
\newwrite\file
\immediate\openout\file=filenamenew_pgcount.xml\relax
\immediate\write\file{
<ArticleMetaData>
<PageCount Type="PageExtent">
<fpage>\arabic{xmyFP}</fpage>
<lpage>\arabic{xmyLP}</lpage>
<tpage>\ztotpages</tpage>
</PageCount>
</ArticleMetaData>
}
\closeout\file
}

\AtBeginDocument{%
\includegraphics[width=\textwidth,height=\textheight]{test-1.eps}
\clearpage
\includegraphics[width=\textwidth,height=\textheight]{test-2.eps}
\clearpage
\valxmyFP
}

\AtEndDocument{\valxmyLP\outputmetainfo}

\newenvironment{body}{}{}

\begin{document}
\setcounter{page}{101}

\begin{body}
\lipsum[1-12]
\end{body}
\end{document}

相关内容