Reputation: 1
Is any possibility to define a header with a vertical line separating the chapter name from the page number, as shown here (page 2):
I would like to use the package fancyhdr
but all I could find were solutions with a horizontal line. Also I just need to display the chapter name on every page and not the section name.
Upvotes: 0
Views: 1578
Reputation: 15065
Here an option using fancyhdr
:
\documentclass[twoside]{book}
\usepackage{blindtext}
\usepackage{fancyhdr}
\newcommand{\vrulesep}{\smash{%
\rule[\dimexpr-\headsep-.3\baselineskip]{1pt}{\dimexpr\headsep+\baselineskip}}}
\fancyhf{}% Clear header/footer
\fancyhead[LE]{% Left header on Even page
\makebox[0pt][r]{{\bfseries\thepage\space
\vrulesep
\space}}%
\leftmark
}
\fancyhead[RO]{% Right header on Odd page
\makebox[0pt][l]{{\bfseries\space
\vrulesep
\space\thepage}}}
\renewcommand{\headrulewidth}{0pt}%
\pagestyle{fancy}% Set page style to fancy
\begin{document}
\blinddocument
\end{document}
Upvotes: 2