3

I am trying to create a document that has just a footer on odd pages and just a header on even pages. On the odd pages, there should be a head rule width of 0pt and a foot rule width of 0.4pt. On the even pages, there should be a foot rule width of 0pt and a head rule width of 0.4pt. I know how to set up everything but the rule width alternations. How can I do the alternations for the headrulewidths and footrulewidths?

Here is what I have so far:

\documentclass[11pt,twoside,twocolumn]{article}  
\usepackage{fancyhdr}
\fancypagestyle{normalpage}{
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead[LO]{} 
\fancyhead[RO]{}
\fancyfoot[LO]{{\footnotesize  \textbf{Title}} \textbullet ~ \footnotesize Vol. 1, Number 1, 2016 \textbullet ~Text}
\fancyfoot[CO]{}
\fancyfoot[RO]{ \thepage}
\fancyhead[LE]{{\footnotesize  \textbf{Title}} \textbullet ~ \footnotesize Vol. 1, Number 1, 2016 \textbullet ~Text}
\fancyhead[RE]{ \thepage}
\fancyfoot[LE]{}
\fancyfoot[CE]{}
\fancyfoot[RE]{}
}

\pagestyle{normalpage}
\begin{document}

Text
\cleardoublepage
Text

\end{document}
  • If you want to use fancyhdr then you need \pagestyle{fancy}. The header/footer width is the same as textwidth. If you want to exceed the margins you will need to use things like \rlap, \llap and \hbox to ??. – John Kormylo Feb 1 '16 at 3:42
  • @JohnKormylo That's not true. You don't have to use \pagestyle{fancy} even though that is the most common way to do it because the package defines the style. – cfr Feb 1 '16 at 21:25
3

Something like this?

fancy switching

\documentclass[11pt,twoside,twocolumn]{article}
\usepackage{fancyhdr}
\let\origheadrule\headrule
\let\origfootrule\footrule
\fancypagestyle{normalpage}{%
  \fancyhf{}%
  \renewcommand{\headrulewidth}{0.4pt}%
  \renewcommand{\footrulewidth}{0.4pt}%
  \fancyhf[rof,reh]{\thepage}%
  \fancyhf[lof,leh]{{\footnotesize  \textbf{Title}} \textbullet ~ \footnotesize Vol. 1, Number 1, 2016 \textbullet ~Text}%
  \def\headrule{%
      \ifodd\value{page}\relax\else\origheadrule\fi}%
  \def\footrule{%
    \ifodd\value{page}\origfootrule\else\fi}%

}
\pagestyle{normalpage}
\begin{document}

Text
\cleardoublepage
Text

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.