1

I have a document with two texts shown side-by-side using paracol. I want to have a simple header style where the odd pages show the title of the first section on that page and the even pages show the title of the last section on that page.

I can do this easily enough with \leftmark and \rightmark using fancyhdr, but this doesn't work if the document uses paracol. With paracol I seem to always get the last mark from each page in the header.

\documentclass{book}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[CO]{\rightmark}
\fancyhead[CE]{\leftmark}

% Headers are correct if we don't use paracol
% \newcommand{\mychunk}[1]{
%     \markboth{#1}{#1}
%     {\Huge #1}\\
%     \lipsum[75]\\
% }

% Headers are wrong if we do use paracol
\newcommand{\mychunk}[1]{
    \markboth{#1}{#1}
    {\Huge #1}\\
    \begin{paracol}{2}
        \lipsum[66]
        \switchcolumn
        \lipsum[75]
    \end{paracol}
}

\begin{document}

\mychunk{1}
\mychunk{2}
\mychunk{3}
\mychunk{4}
\mychunk{5}
\mychunk{6}
\mychunk{7}
\mychunk{8}
\mychunk{9}
\mychunk{10}
\mychunk{11}
\mychunk{12}
\mychunk{13}
\mychunk{14}
\mychunk{15}
\mychunk{16}

\end{document}

I've also tried titleps, but have the same problem. When using parcolumns the problem doesn't reproduce, but for other reasons I'd like to use paracol. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.