
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{array}
\usepackage{tabularx}
\usepackage{caption}
\captionsetup[table]{skip=10pt}
\renewcommand{\arraystretch}{1.4}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{adjustbox}
\usepackage{rsc}
\usepackage{graphicx}
\usepackage{setspace}
\linespread{1.25}
\UseRawInputEncoding
\usepackage{geometry}
\geometry{
a4paper,
left=40mm,
right=20mm,
top=40mm,
bottom=50mm
}
%header settings
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{
\markboth
{\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter.
\fi
#1}
{}}
\makeatother
\usepackage{etoolbox}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape Keiran Corbett}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{15pt}
\setlength{\footskip}{50pt} %page number spacing
\begin{document}
\tableofcontents
\chapter{Example chapter title}
\newpage
text
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\end{document}
因此,使用這個命令,它看起來像我想要的那樣,但我有一個目錄,其標題是第 0 章。
所以我有兩個問題 1.如何讓 CONTENTS 不大寫 2.如何去掉章節(只適用於書目和內容部分)
參考書目也有同樣的問題
範例乳膠檔案的第 4 頁上有一個範例,說明了它的外觀
答案1
我建議稍微更改一下,\chaptermark
以便\leftmark
包含整個標題(“第 1 章。範例章節標題”),而不僅僅是章節標題(“範例章節標題”)。這使您的內容\fancyhead[L]
更加簡單,並且不易受到錯誤章節編號的影響。
對於目錄和參考書目中的漂亮標題,我發現沒有比直接修補指令更好的方法了。請參閱範例ToC 和 fancyhdr 的標頭。
memoir
或者 KOMA 類別將為此提供更方便的介面。
\documentclass[12pt,a4paper]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
% copy of the original from report.cls with the \MakeUppercase dropped
\renewcommand{\chaptermark}[1]{%
\markboth
{\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. %
\fi
#1}
{}}
\makeatother
\usepackage{etoolbox}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\tableofcontents}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\patchcmd{\thebibliography}
{\MakeUppercase}
{}
{}{}
\fancyhead[L]{\itshape\leftmark}
\fancyhead[R]{\itshape NAME}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{15pt}
\begin{document}
\tableofcontents
\chapter{Example chapter title}
lorem
\newpage
ipsum
\newpage
dolor
\newpage
sit
\newpage
amet.
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\chapter{Example chapter title}
\nocite{*}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}
該rsc
套件載入natbib
並因此稍微改變了參考書目標題的排版。在這種情況下,您需要修補命令\bibsection
而不是\thebibliography
.
添加
\patchcmd{\bibsection}
{\MakeUppercase}
{}
{}{}
\patchcmd{\bibsection}
{\MakeUppercase}
{}
{}{}
到你的序言。