I want to make a dictionary which is based on an old print version from the 18th century.
The style is to have a two column layout and on top of each page
- on the left side the page number plus the guide word from the first entry of this page
- on the right side the page number increased by one plus the guide word from the last entry of this page
So the page number increases by 2 for each page.
I found something in the web for the package fancyhdr, but I'm using KOMA script and do not want to change my complete code.
Here is a small working excample:
\documentclass[%
12pt,
parskip=false,
]{scrbook}
\usepackage{scrlayer-scrpage}
\usepackage[german]{babel} % Old rules
\usepackage{fontspec}
\usepackage[babel=true]{microtype}
\setmainfont[Numbers={Proportional,OldStyle},Ligatures={Common,Rare,Historic}]{Libertinus Serif}
\setsansfont[Numbers={Proportional,OldStyle}]{GilliusADF}
\fontspec{inconsolata}
\usepackage{ragged2e}
\usepackage{multicol}
\usepackage{lipsum}
% Double page numbering based on: https://tex.stackexchange.com/questions/18156/figures-on-left-pages-text-on-right-ones-with-class-book-numbering-only-on-rig
\renewcommand\thepage{\number\numexpr ((2*\the\value{page})-1)\relax} % Die Seitennummer wird immer um 2 erhöht
\newcommand{\theEvenPage}{\number\numexpr (\thepage+1)\relax} % Die gerade Seitenzahl rechts
\lehead{\pagemark}
\rehead{\theEvenPage}
\lefoot{}
\lohead{\pagemark}
\rohead{\theEvenPage}
\rofoot{}
% Dictionary entry. Based on: https://de.overleaf.com/latex/examples/dictionary-template/pdztbwjxrpmz
\newcommand{\entry}[3]{%
\lehead{\pagemark\ {#2}}%
\lohead{\pagemark\ {#2}}%
\rehead{\theEvenPage\ {#2}}%
\rohead{\theEvenPage\ {#2}}%
\textbf{#1}\ {#3}}
\begin{document}
\lipsum[1-2]
\clearpage
\begin{multicols}{2}
\entry{Panama}{PAN}{\lipsum[1]}
\entry{Paternoster}{PAT}{\lipsum[2]}
\entry{Performance}{PER}{\lipsum[3]}
\entry{Peter}{PET}{\lipsum[4]}
\entry{Petersberg}{PET}{\lipsum[5]}
\entry{Pfanne}{PFA}{\lipsum[6]}
\entry{Pfirsich}{PFI}{\lipsum[7]}
\entry{Pflaume}{PFL}{\lipsum[8]}
\entry{Pisa}{PIS}{\lipsum[9]}
\entry{Planung}{PLA}{\lipsum[1]}
\entry{Po}{PO}{\lipsum[2]}
\entry{Polen}{POL}{\lipsum[3]}
\entry{Portugal}{POR}{\lipsum[4]}
\entry{Primel}{PRI}{\lipsum[5]}
\entry{Punkt}{PUN}{\lipsum[6]}
\end{multicols}
\end{document}
The guide-words are showing the first entry from the next page and not the once I need.
Does anybody has an idea how this can be resolved?