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?
Asked
Active
Viewed 7,730 times
3
1 Answers
4
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:

Gonzalo Medina
- 505,128
-
But how can I set the page numbering on the left if the authors names are displayed in the header and on the right if the title of the paper is displayed ?!. – Hussein Eid May 04 '23 at 15:13
a4paper"environment" is -- it might be a class option of your (unkown) document class. – lockstep Sep 25 '12 at 12:36