Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. In particular, it's unclear what an a4paper "environment" is -- it might be a class option of your (unkown) document class. –  lockstep Sep 25 '12 at 12:36
add comment

1 Answer 1

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

share|improve this answer
add comment

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.