Как добавить название главы и номер страницы на пустую страницу?

Как добавить название главы и номер страницы на пустую страницу?

Я работаю над отчетом, в котором в конце главы есть пустая страница. Пустая страница содержит название текущей главы и номер страницы в верхней части страницы, как здесь:

пустая страница

Как это можно реализовать?

решение1

Это значение по умолчанию для book( twosideпо умолчанию), если последняя страница главы заканчивается на правой (нечетной) странице:

\documentclass{book}

\usepackage{blindtext}% used for demonstration only

\begin{document}
\chapter{This is the first chapter}
\blindtext% used for demonstration only

\chapter{This is the second chapter}
\blindtext% used for demonstration only

\blinddocument% used for demonstration only
% Here we will not have a blank page, because the chapter ends on left (even) side
\blinddocument% used for demonstration only
\end{document}

или для reportс явным twosideи openrightстилем страницы headings:

\documentclass[twoside,openright]{report}% options needed for the blank left pages before a new chapter on a right page

\usepackage{blindtext}% used for demonstration only
\pagestyle{headings}

\begin{document}% used for demonstration only
\chapter{This is the first chapter}
\blindtext% used for demonstration only

\chapter{This is the second chapter}
\blindtext% used for demonstration only

\blinddocument% used for demonstration only
\end{document}

Для односторонних документов это не имеет смысла.

Или использовать другой демонстрационный файл с классом bookи главой под названием »chap_name« с пятью разделами, за которыми следует пустая страница и еще одна глава:

\documentclass{book}
\usepackage{lipsum}% used for demonstration only

\begin{document}
\chapter{chap\_name}
\lipsum[1]% used for demonstration only

\section{First Section}
\lipsum[2]% used for demonstration only

\section{Second Section}
\lipsum[3]% used for demonstration only

\section{Third Section}
\lipsum[4]% used for demonstration only

\section{Fourth Section}
\lipsum[5-10]% used for demonstration only

\section{Fifth Section}
Next page will be blank but with running head.

\chapter{This is the second chapter}
\lipsum[6]% used for demonstration only

\end{document}

или то же самое с классом report:

\documentclass[twoside,openright]{report}% options are need for the empty page before the second chapter
\usepackage{lipsum}% used for demonstration only

\pagestyle{headings}% needed to have automatic running heads (default of report would be page style plain that shows only page numbers)

\begin{document}
\chapter{chap\_name}
\lipsum[1]% used for demonstration only

\section{First Section}
\lipsum[2]% used for demonstration only

\section{Second Section}
\lipsum[3]% used for demonstration only

\section{Third Section}
\lipsum[4]% used for demonstration only

\section{Fourth Section}
\lipsum[5-10]% used for demonstration only

\section{Fifth Section}
Next page will be blank but with running head.

\chapter{This is the second chapter}
\lipsum[6]% used for demonstration only

\end{document}

оба результата (показаны только страницы 2–5):

введите описание изображения здесьвведите описание изображения здесь

решение2

Этот текстовый код отображает пустую страницу с заголовком главы и номером страницы:

\documentclass[12pt,a4paper]{report}
\pagestyle{headings}

\begin{document}

\chapter{Chapter title}
Some text
\newpage\phantom{}

\chapter{Second chapter}
Some text

\end{document}

Что из того, что вы пробовали, не сработало?

Связанный контент