TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use the "dictionary" style of page header, using \rightmark--\leftmark as suggested in fancyhdr package.

However, in twocolumn mode, \rightmark containts the first mark in the latter column, which is wrong: it should contain the first mark in the former column.

I know that using multicol package instead of [twocolumn] option or \twocolumn command would help, but I would like to avoid multicol.

Here is a MWE:

\documentclass[twocolumn]{article}

\usepackage{fancyhdr}
\fancyhf{}{}
\fancyhead[R]{\thepage}
\fancyhead[L]{\rightmark{} -- \leftmark}
\pagestyle{fancy}

\def\mysection#1{\section*{#1}\markboth{#1}{#1}}

% to provide dummy text and lots of sections
\usepackage{lipsum}
\newcounter{xs}
\def\xsect{%
  \stepcounter{xs}%
  \mysection{Section \Alph{xs}}
  \lipsum[\value{xs}]
}

\begin{document}

\xsect\xsect\xsect\xsect\xsect
\xsect\xsect\xsect\xsect\xsect

\end{document}
share|improve this question
up vote 6 down vote accepted
\usepackage{fixltx2e}

12345678

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.