3

I'm trying to achieve a rather simple thing: a double-sided document with the back of the cover blank + a blank page before each new chapter. I've got this:

\documentclass[a4paper, 10pt]{book}

\usepackage{fancyhdr} \pagestyle{fancy} \fancyhead[LE,RO]{\leftmark } \fancyhead[LO,RE]{} \fancyfoot[LE,RO]{\textbf{\thepage}} \fancyfoot[C]{} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt} \renewcommand{\chaptermark}[1]{% \markboth{\MakeUppercase{\thechapter.\ #1}}{}} %\renewcommand{\chaptermark}[1]{% %\markboth{\MakeUppercase{#1}}{}} \fancypagestyle{plain}{%
\fancyhf{} \fancyfoot[LE,RO]{\textbf{\thepage}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}}

\fancypagestyle{blank}{% \renewcommand{\headrulewidth}{0pt} \fancyhead[LE,RO]{} \fancyhead[LO,RE]{}}
\makeatletter \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else \hbox{} \thispagestyle{blank} \newpage \if@twocolumn\hbox{}\newpage\fi\fi\fi} \makeatother

\begin{document}

\begin{titlepage}

\begin{center} \huge Test \end{center}

\end{titlepage}

\thispagestyle{empty} \frontmatter \tableofcontents \mainmatter \thispagestyle{fancy}

\chapter{Test}

\end{document}

I need

\fancypagestyle{blank}{%
    \renewcommand{\headrulewidth}{0pt}
    \fancyhead[LE,RO]{}
    \fancyhead[LO,RE]{}}
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
   \hbox{}
   \thispagestyle{blank}
   \newpage
   \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

to create the blank page before the chapter. But if I use this, the back of my cover is numbered (2). In other words, thispagestyle{empty} is not applied.

jfk
  • 101
  • 6

2 Answers2

4

With the emptypage package, you could achieve your goal. If empty, even pages before a new chapter are really blank. And the back of your cover is also completely blank. No need of your blank fancypagestyle, neither the code between \makeatletter and \makeatother.

I hope I have correctly understand your question (As in this code, chapter 2 ends on page 6, chapter 3 directly begins on page 7, and not on page 9 nor page 8. But as usual, chapter 1 ends on page 3, and chapter 2 begins on page 5, not on an even page).

\documentclass[a4paper, 10pt]{book}

\usepackage{fancyhdr} \pagestyle{fancy} \fancyhead[LE,RO]{\leftmark } \fancyhead[LO,RE]{} \fancyfoot[LE,RO]{\textbf{\thepage}} \fancyfoot[C]{} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt} \renewcommand{\chaptermark}[1]{% \markboth{\MakeUppercase{\thechapter.\ #1}}{}}

\fancypagestyle{plain}{%
\fancyhf{} \fancyfoot[LE,RO]{\textbf{\thepage}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}}

\usepackage{emptypage}

\usepackage{lipsum}

\begin{document}

\begin{titlepage}

\begin{center} \huge Test \end{center}

\end{titlepage}

\thispagestyle{empty} \frontmatter \tableofcontents \mainmatter \thispagestyle{fancy}

\chapter{Test}

\lipsum[1-12]

\chapter{Test2}

\lipsum[10-18]

\chapter{Test3}

\lipsum[20-26]

\end{document}

quark67
  • 4,166
2

IMHO, what you want is almost the default of KOMA-Script class scrbook:

\documentclass[headings=standardclasses,headsepline]{scrbook}
\let\MakeMarkcase\MakeUppercase
\usepackage{lipsum}

\begin{document}

\begin{titlepage}% I would replace the center environment by \centering command

\begin{center} \huge Test \end{center}

\end{titlepage}

\frontmatter% AFAIK this should be before \begin{titlepage} because the title pages of a book usually are counted (but do not show a number). \tableofcontents \mainmatter

\chapter{Test}

\lipsum[1-12]

\chapter{Test2}

\lipsum[10-18]

\chapter{Test3}

\lipsum[20-26]

\end{document}

five pages of output with KOMA-Script

To make the page number bold, you can additionally use

\setkomafont{pagenumber}{\bfseries}

and to not print the running head slanted and additional

\setkomafont{pageheadfoot}{}

would be needed.

To use the chapter title for the running head of both, odd and even pages, you can additionally use scrlayer-scrpage:

\documentclass[headings=standardclasses,headsepline]{scrbook}
\setkomafont{pagenumber}{\bfseries}
\setkomafont{pageheadfoot}{}
\usepackage[markcase=upper]{scrlayer-scrpage}
\automark[chapter]{chapter}

\usepackage{lipsum}

\begin{document}

\begin{titlepage}

\begin{center}% I would replace the center environment by \centering command \huge Test \end{center}

\end{titlepage}

\frontmatter \tableofcontents \mainmatter

\chapter{Test}

\lipsum[1-12]

\chapter{Test2}

\lipsum[10-18]

\chapter{Test3}

\lipsum[20-26]

\end{document}

cabohah
  • 11,455
  • Thank you to you both. Your solutions are indeed working. Discovering KOMA-Script, I think it's gonna get me a neater preamble. I'll dig into the documentation to adapt my titlesec settings. – jfk Mar 01 '23 at 19:55