如何在空白頁上新增章節標題和頁碼?

如何在空白頁上新增章節標題和頁碼?

我正在編寫一份報告,其中章節末尾有一個空白頁。空白頁在頁面頂部包含當前章節標題和頁碼,如下所示:

空白頁

我怎樣才能實現這個?

答案1

如果章節的最後一頁在右邊(奇數)頁結束,則這是bookwith (預設)的預設值: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明確的twosideopenright頁面樣式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

此 tex 程式碼顯示一個空白頁面,其中包含章節標題和頁碼:

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

\begin{document}

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

\chapter{Second chapter}
Some text

\end{document}

你嘗試了什麼但不起作用?

相關內容