With \hrulefill
, you get a horizontal line that spans all available space. So \hrulefill\thepage\hrulefill
gives you "line page-number line" spanning the whole width of the text area. This you can set as the footer with \fancyfoot[C]
. You want to tweak the appearance a bit:
- The lines should not directly connect to the page number, so you want to add same horizontal space to the left and right of the number like
\quad
.
- By default, the line is drawn on the baseline of the page number, but in your example it is vertically centered around the number. So you need to lower the page number with something like
\raisebox{-3pt}
.
The same is possible for the header and titles, with the same "tweaking" required. Some more things to consider:
- You can use
\markboth{\@title}{\@title}
(maybe add some text formatting macros) to use the title that you set in \title
also for the headers. Be sure to call it after \title
but before \maketitle
.
- You need to redefine
\chaptermark
, \sectionmark
, etc. to ensure that you don't overwrite the leftmark with the booktitle, and only insert the chapter titles (and, if applicable, of sections, etc.) to the rightmark.
As a starting point for developing your header & footer style, a minimal example below.
\documentclass{book}
\usepackage{lipsum}
\title{My Book}
\author{Me}
\makeatletter
\markboth{\textsc{\@title}}{\textsc{\@title}}
\makeatother
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\hrulefill\quad\raisebox{-3pt}{\thepage}\quad\hrulefill}
\fancyhead[CO]{\hrulefill\quad\raisebox{-3pt}{\leftmark}\quad\hrulefill}
\fancyhead[CE]{\hrulefill\quad\raisebox{-3pt}{\rightmark}\quad\hrulefill}
\renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}
\renewcommand{\chaptermark}[1]{\markright{\textsc{#1}}}
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{}
\begin{document}
\maketitle
\chapter{My Chapter}
\lipsum
\end{document}