I am writing a document which needs a multicols environment stretching over multiple pages. Moreover I am intending to use \thepage in the body of the environment. To be specific I need to know whether the page ist odd or even.
After getting some weird results I realized, that the multicols package does not seem to step the page counter, unless a manual \newpage is issued.
MWE:
\begin{filecontents*}{\jobname.xmpdata}
\Title{title}
\Author{author}
\end{filecontents*}
\documentclass[a4paper,11pt,twoside,parskip=half]{scrartcl}
\usepackage[x-1a]{pdfx}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\blindtext\\
\textbf{PAGE: \thepage}\\
\columnbreak
\blindtext\\
\textbf{PAGE: \thepage}\\
\blindtext
\blindtext
\blindtext\\
\textbf{PAGE: \thepage}\\
\blindtext
\newpage
\blindtext\\
\textbf{PAGE: \thepage}\\
\end{multicols}
\end{document}
Thanks in advance for any help
\thepagewithin the body of the document to refer to the current page. use\label{x}then access the page number via\pageref{x}– David Carlisle Feb 26 '18 at 23:12\thepagewill have the value it has at the start of the paragraph on all the pages because as in your example here, all macros are expanded before paragraphs are broken into lines and lines are broken in to pages. – David Carlisle Feb 26 '18 at 23:15\pagerefto? – user176881 Feb 26 '18 at 23:36\pagerefworks easily enough, and as you note above after a forced page break it's easy as you can access the page counter directly. – David Carlisle Feb 26 '18 at 23:46\\anyway? – cfr Feb 27 '18 at 03:22