我不认为这在实践中有用,但辅助文件中的数字递增
\documentclass{article}
\makeatletter
\AtBeginDocument{%
\ifx\thisnumber\undefined\gdef\thisnumber{1}\fi
\immediate\write\@auxout{\gdef\noexpand\thisnumber{\the\numexpr\thisnumber+1}}%
}
\makeatother
\begin{document}
Version: \thisnumber
\end{document}