1

This is practically a follow-up to this question.

The solution there works great for an article, but does not work with chapters, i.e. with report or book classes. As you can see here on the first page of a chapter there is just a number in the middle without a vrule:

enter image description here

Here's the MWE:

\documentclass[twoside]{report}
\usepackage[margin=1in]{geometry}
\usepackage{xcolor}
\usepackage{fancyhdr}
  \fancyhf{}
  \fancyfoot[RO]{\vfootline\hskip\linepagesep\thepage}
  \fancyfoot[LE]{\thepage\hskip\linepagesep\vfootline}
  \renewcommand\headrulewidth{0pt}
  \newskip\linepagesep \linepagesep 5pt\relax
  \def\vfootline{%
    \begingroup\color{blue}\rule[-990pt]{1pt}{1000pt}\endgroup}
\usepackage{lipsum}

\pagestyle{fancy}

\begin{document}
\chapter{Test 1}
\lipsum
\section{Section 1}
\lipsum
\chapter{Test 2}
\lipsum
\section{Section 2}
\lipsum
\end{document}

As always: thanks so much for any advice in advance :-)

  • What is the question? I see the vertical footline -- if this is not wanted, remove the \vfootline related code – user31729 Apr 26 '16 at 15:16
  • Sorry, I thought it was clear from the picture, but on the first page of a chapter there is just a number in the middle without a vrule. – Sickboy Apr 26 '16 at 15:29
2

The chapter pages use page style plain. So you have to redefine this style too. Use:

  \fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfoot[RO]{\vfootline\hskip\linepagesep\thepage}
    \fancyfoot[LE]{\thepage\hskip\linepagesep\vfootline}
    \renewcommand\headrulewidth{0pt}
  }

enter image description here

Code:

\documentclass[twoside]{report}
\usepackage[margin=1in]{geometry}
\usepackage{xcolor}
\usepackage{fancyhdr}
  \fancyhf{}
  \fancyfoot[RO]{\vfootline\hskip\linepagesep\thepage}
  \fancyfoot[LE]{\thepage\hskip\linepagesep\vfootline}
  \renewcommand\headrulewidth{0pt}
  \fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfoot[RO]{\vfootline\hskip\linepagesep\thepage}
    \fancyfoot[LE]{\thepage\hskip\linepagesep\vfootline}
    \renewcommand\headrulewidth{0pt}
  }
  \newskip\linepagesep \linepagesep 5pt\relax
  \def\vfootline{%
    \begingroup\color{blue}\rule[-990pt]{1pt}{1000pt}\endgroup}
\usepackage{lipsum}

\pagestyle{fancy}

\begin{document}
\chapter{Test 1}
\lipsum
\section{Section 1}
\lipsum[1-3]
\chapter{Test 2}
\lipsum
\section{Section 2}
\lipsum
\end{document}
  • Of course, they do! Now I feel dumb, but thanks so much! :-) – Sickboy Apr 26 '16 at 15:44

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