[Tex/LaTex] Vertical line in footer and header

fancyhdrheader-footer

I want to make my footer and header look like this beautiful apple manual.

I think, I should use the fancyhdr package. But, I need an example to see how I should use it in this case (for vertical lines). I have found a lot about horizontal line, but not vertical ones.

Best Answer

\documentclass[twoside]{article}
\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}
\lipsum
\lipsum
\lipsum
\end{document}

output_crop

For the head its very similar. Here, I used the picture environment to ensure the right positioning:

\documentclass[twoside]{report}
\usepackage[margin=1in]{geometry}
\usepackage{xcolor}
\usepackage{fancyhdr}
  \fancyhf{}
  \fancyhead[RO]{\begin{picture}(0,0)\put(0,0){\vheadline\hskip\linepagesep\thechapter}\end{picture}}
  \fancyhead[LE]{\begin{picture}(0,0)\put(0,0){\thechapter\hskip\linepagesep\vheadline}\end{picture}}
  \renewcommand\headrulewidth{0pt}
  \newskip\linepagesep \linepagesep 5pt\relax
  \def\vheadline{%
    \begingroup\color{blue}\rule[-5pt]{1pt}{1000pt}\endgroup}
\usepackage{lipsum}

\pagestyle{fancy}

\begin{document}
\chapter{A chapter}
\lipsum
\lipsum
\lipsum
\end{document}