Title and author in header without fancyhdr

I'm trying to have the author names and title appear on alternating pages, respectively, in the center of the header. In addition I would like to have even numbered pages on the left in the header and odd numbered pages on the right in the header - Starting from page 2. I would like to avoid using the package fancyhdr as I do no want any line separating the header from the body.

You have several possibilities:

1) Using titleps

\documentclass[twoside]{article}
\usepackage{titleps}
\usepackage{lipsum}

\newpagestyle{mystyle}{
}
\pagestyle{mystyle}

\author{First Author \and Second Author}
\title{The title}

\makeatletter
\newcommand\Author{First Author---Second Author}
\let\Title\@title
\makeatother

\begin{document}

\maketitle
\lipsum[1-20]

\end{document}


2) Using fancyhdr (with \renewcommand\headrulewidth{0pt} there will be no rule in the header):

\documentclass[twoside]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}

\fancyhf{}
\pagestyle{fancy}

\author{First Author \and Second Author}
\title{The title}

\makeatletter
\newcommand\Author{First Author---Second Author}
\let\Title\@title
\makeatother

\begin{document}

\maketitle
\lipsum[1-20]

\end{document}


3) Without packages:

\documentclass[twoside]{article}
\usepackage{lipsum}

\author{First Author \and Second Author}
\title{The title}

\makeatletter
\newcommand\Author{First Author---Second Author}
\let\Title\@title
\def\ps@mystyle{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\let\@mkboth\markboth}
\makeatother
\pagestyle{mystyle}

\begin{document}

\maketitle
\lipsum[1-20]

\end{document}


In comments, it has been requested a solution without using the twoside class option:

\documentclass{article}
\usepackage{lipsum}

\author{First Author \and Second Author}
\title{The title}

\makeatletter
\newcommand\Author{First Author---Second Author}
\let\Title\@title
\def\ps@mystyle{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\ifodd\value{page}\relax
\hfill\Title\hfill\makebox[0pt][l]{\thepage}%
\else
\makebox[0pt][l]{\thepage}\hfill\Author\hfill%
\fi%
}%
\let\@mkboth\markboth}
\makeatother
\pagestyle{mystyle}

\begin{document}

\maketitle
\lipsum[1-20]

\end{document}

• Thank you, is there any way of doing the above without having [twoside] after document class? – nonameswereavailable Aug 25 '13 at 3:06
• @nonameswereavailable twoside allows to alternate the information on even and odd pages. I updated my answer providing a possible solution without this option (the last example code in my answer). Just out of curiosity, why don't you want to use this option? – Gonzalo Medina Aug 25 '13 at 3:36
• The [twoside] shift the body slightly to the left or right, depending on whether you're on an even or odd page. I need the body of my text to be uniform, while having the alternating headers. I thought it would be easier modifying the header as opposed to introducing new constraints for the body. I very much appreciate your help. – nonameswereavailable Aug 25 '13 at 3:51
• @nonameswereavailable you can keep the twoside option and use the centering option for geometry, as in \documentclass[twoside]{article}\usepackage[centering]{geometry}. – Gonzalo Medina Aug 25 '13 at 4:18