1

I try to add short title running on the even pages and author running on the odd page in a document, using this code:

\documentclass[11pt]{article}
\usepackage{lipsum}

\title{\bf THE TITLE}

\author{FIRST AUTHOR\footnote{{\tt [email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}
\begin{document}

\maketitle

\pagestyle{myheadings}
\markboth{The short title}{F. Author S. Author T. Author}

\lipsum
\lipsum

\end{document}

The output is: enter image description here enter image description here enter image description here

As can be observed, the author is inserted on the top of the even pages (as on the odd pages) and not the short title as I want.

I really don't know how to fix it, by keeping the same layout of the document (margins, width, length etc.) as for the article class.

Any help would be appreciated.

3
  • The left head set with \markboth is used in two-sided documents. You can try the option twoside but the geometry of even pages will be reversed.
    – jlab
    Commented Apr 15 at 18:30
  • I think this answer can help you.
    – jlab
    Commented Apr 15 at 18:32
  • @jlab Thank you, I saw that answer, but I couldn't deal with the solution there. Using twoside I encountered the same problem with the geometry changing and that's why I gave up.
    – Cris
    Commented Apr 16 at 12:29

2 Answers 2

1

Set your headings using fancyhdr, and you can include ifoddpage to see whether you're on an odd or an even page (called runningheads below).

\documentclass{article}
\usepackage{lipsum}

\title{\bfseries THE TITLE}

\author{FIRST AUTHOR\footnote{\texttt{[email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}

\usepackage{fancyhdr,ifoddpage}
\fancypagestyle{runningheads}{%
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  %\renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
  \fancyhead[L]{% Left header
    \checkoddpage% Update \ifoddpage
    \ifoddpage
      F.~Author, S.~Author, T.~Author% Odd pages
    \else
      The short title% Even pages
    \fi
  }%
  \fancyhead[R]{\thepage}% Right header
}

\pagestyle{runningheads}

\begin{document}

\maketitle

\lipsum
\lipsum

\end{document}
4
  • Thank you, it works well.
    – Cris
    Commented Apr 16 at 12:21
  • It is almost never necessary to check for even/odd pages with fancyhdr, as you can use the E and O flags. Commented Apr 16 at 20:01
  • @PietervanOostrum: Yes; I may have recalled (incorrectly) that there was a warning issued when not in twoside mode.
    – Werner
    Commented Apr 17 at 17:35
  • Actually you probably were correct. However, nowadays fancyhdr has a [twoside] option that solves this. Commented Apr 17 at 21:40
2

Here is a simplified version of Werner's solution, using fancyhdr E and O options instead of \ifoddpage. Also it doesn't define a new pagestyle as this isn't necessary in this example.

\documentclass{article}
\usepackage{lipsum}

\title{\bfseries THE TITLE}

\author{FIRST AUTHOR\footnote{\texttt{[email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}

\usepackage[twoside]{fancyhdr}
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  %\renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
  \fancyhead[LO]{F.~Author, S.~Author, T.~Author} % Left header
  \fancyhead[LE]{The short title} % Left header
  \fancyhead[R]{\thepage}% Right header

\pagestyle{fancy}

\begin{document}

\maketitle

\lipsum
\lipsum

\end{document}
1
  • Thank you very much!
    – Cris
    Commented Apr 18 at 5:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .