For a private project of mine (more or less "The Story of my Life") I am preparing lots of inputfiles like '1986.tex' with (for me) interesting items of my life, so as vacations, special dates and meeting with important people.
All those small files will be input into a main file. Here different indices (for people, places and events of the different years) are produced, and then the resulting PDF file will come out of this process. Many things work well, but when a page (say for the aforementioned year 1986) gets too full, it will of course be split into two pages (or more).
Now here is my problem: As I (ab)use the page number counter for the year (printing its value into the page head and into all the indices), the numbers will get wrong on the second page for e. g. 1986.
Does anybody see a solution? Here is my (I hope) MWE, where I replaced the inputfile with a short example of a possible event:
\documentclass[paper=a4]{scrreprt}
\usepackage[babelshorthands]{polyglossia}
\setmainlanguage[spelling=new]{german}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{enumitem}
\usepackage{scrlayer-scrpage}
\cfoot*{}\ifoot*{}\ofoot*{}
\RedeclareSectionCommand[font=\Huge]{section}
\usepackage[split]{splitidx}
\makeindex
\newindex[Ortsverzeichnis]{ort}
\newindex[Namensverzeichnis]{name}
\begingroup % hold following extension local to this group
\makeatletter % allow @ at macro names
\extendtheindex% some changes of theindex environment
{\let\twocolumn\@firstoptofone % deactivate \twocolumn
\let\onecolumn\@firstoptofone % deactivate \twocolumn
\let\clearpage\relax % deactivate \clearpage
}% changes before beginning
{}% no change after beginning
{}% no change before ending
{}% no change after ending
\makeatother % deactivate \makeatletter
\printindex % print index
\endgroup % end group with extended theindex environ
% Spezielle Makros für den Lebenslauf
\newenvironment{HKjahr}[1]{%
\newcommand{\HKereignis}[2]{\setcounter{page}{#1}\item[##1] ##2}
\newcommand{\HKname}[1]{\textsc{\bfseries ##1}\sindex[name]{##1}}
\newcommand{\HKort}[1]{\textbf{##1}\sindex[ort]{##1}}
%
\markright{\dotfill\ \rlap{#1}}
\section*{#1}
\begin{description}[style=multiline,leftmargin=8em,font=\large\emph]}
{\end{description}}
\begin{document}
\printindex* % print indices
\listoffigures
\thispagestyle{empty}
\newpage
\begin{HKjahr}{1986}
\HKereignis{7. September}{\HKname{Helmut} wird in \HKort{Köln} geboren.}
\end{HKjahr}
\end{document}
%---eof
\renewcommand{\thepage}{1986}
, but that would confuse the TOC, any\pageref
and possibly hyperref.