[Tex/LaTex] Page header alternatively author name and short title

header-footer

I'm using the a4paper environment for a scientific article and I want to make headers that display alternatively author names and short title each page, while getting rid of all page numberings. We did get rid of page numbers by using \pagestyle{empty} but we can't do the header thing. How should we make a header that displays name and title alternatively each page?

Best Answer

You can use the fancyhdr package; if the twoside class option is allowed, you can say something like this (I placed the information centered in the header, but you can place it flushed to one of the margins):

\documentclass[twoside]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate text for the example

\newcommand\shorttitle{The Short Title}
\newcommand\authors{Author A, Author B and AuthorC}

\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyhead[CE]{\small\scshape\shorttitle}
\fancyhead[CO]{\small\scshape\authors}
\pagestyle{fancy}

\begin{document}

\lipsum[1-20]

\end{document}

If twoside is not allowed, you can say something like this:

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate text for the example

\newcommand\shorttitle{The Short Title}
\newcommand\authors{Author A, Author B and AuthorC}

\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyhead[C]{%
\ifodd\value{page}
  \small\scshape\authors
\else
  \small\scshape\shorttitle
\fi
}
\pagestyle{fancy}

\begin{document}

\lipsum[1-20]

\end{document}

An image of the header of two consecutive pages:

enter image description here