我希望我的书名(或任何其他文本)出现在偶数页上,章节出现在奇数页上。默认设置似乎是章节出现在偶数页,章节出现在奇数页上(请参阅随附的 MWE)。
以下代码似乎适用于该标题:
%\renewcommand{\chaptermark}[1]{%
% \markboth{\MakeTextUppercase{\ \ \ \ Essays in xx}}{}%
%}
但我不知道如何让章节(而不是章节)出现在奇数页上。
\documentclass[DIV12, a4paper, 12pt, listof=totocnumbered, bibliography=totoc]{book}
\usepackage{a4wide}
\usepackage{emptypage}
\usepackage{changepage}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[onehalfspacing]{setspace}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz, epstopdf,pgfplots}
\usepackage{longtable, booktabs, tabularx}
\usepackage{fancyvrb, moreverb, relsize}
\usepackage{eurosym, calc, chngcntr}
\usepackage{amsmath, amssymb, amsfonts, amsthm, bm}
\usepackage[labelfont={bf}, skip=5pt]{caption}
\usepackage{mdwlist}
\usepackage{xfrac}
\usepackage{lscape}
\usepackage{setspace,geometry}
\usepackage{xcolor}
\usepackage{lmodern}
\usepackage{upgreek}
\usepackage{afterpage}
\usepackage{wrapfig}
\usepackage{multirow, makecell}
\usepackage{fancyhdr}
\usepackage[toc]{glossaries}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{eurosym}
\usepackage{amsfonts}
\usepackage{booktabs}
%\usepackage{abstract}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[hyphens]{url}
\usepackage{acronym}
\usepackage[english]{babel}
\usepackage[round]{natbib}
\usepackage{pgfplots}
\usepackage{threeparttable}
\usepackage{siunitx}
\usepackage[export]{adjustbox}
\usepackage{etoolbox}
\usepackage[hyperfootnotes=false]{hyperref}
\usepackage{cleveref}
\usepackage{footnotebackref}
\usepackage{appendix}
\usepackage{mathtools}
\usepackage{bbm}
\usepackage{enumitem}
\sisetup{round-mode=places,round-precision=3,table-align-text-post=false}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage[bottom]{footmisc}
\addtolength{\footskip}{-0.5cm} %Seitenzahl um 0.5cm höher setzen
\geometry{a4paper, top=30mm, left=30mm, right=30mm, bottom=30mm,headsep=10mm, footskip=12mm}
\newcolumntype{L}{D{.}{.}{2,2}}
\newcommand{\crefrangeconjunction}{--}
\newcommand*{\SuperScriptSameStyle}[1]{%
\ensuremath{%
\mathchoice
{{}^{\displaystyle #1}}%
{{}^{\textstyle #1}}%
{{}^{\scriptstyle #1}}%
{{}^{\scriptscriptstyle #1}}%
}%
}
%\renewcommand{\chaptermark}[1]{%
% \markboth{\MakeTextUppercase{\ \ \ \ Essays in xx}}{}%
%}
\begin{document}
\begin{titlepage}
\begin{center}
{\Large \textbf{Essays in xx}}\\ \vspace{2 cm}
\large{Mr x}\\ \vspace{1.5 cm}
{\normalsize \textsc{Dissertation}} \\
{\normalsize \textsc{for obtaining the degree of}} \\
{\normalsize \textsc{Doctor of Business and Economics}} \\
{\normalsize \textsc{Doctor Rerum Politicarum (Dr. Rer. Pol.)}} \\ \vspace{2 cm}
{\normalsize \textsc{xx}}\\ \vspace{1 cm}
{\normalsize \textsc{xx}}\\ \vspace{1 cm}
{\normalsize \textsc{May 2020}}\\ \vspace{1 cm}
\vspace*{\fill}
{\normalsize \textsc{Referee: Professor Dr.\ xx}}\\
{\normalsize \textsc{Co-Referee: Professor Dr.\ xx}}\\
\end{center}
\end{titlepage}
% Chapter 1: Introduction
\chapter{Introduction}
\section{Section}
\clearpage
Some text here
\clearpage
Some more text
\end{document}
答案1
问题中的 MWE 已加载,fancyhdr
但问题已标记为scrlayer-scrpage
。请注意,不能同时使用这两个包。
建议使用scrlayer-scrpage
(不加载包fancyhdr
):
\documentclass[a4paper,12pt]{book}
\usepackage{blindtext}% only for dummy text
\usepackage[automark]{scrlayer-scrpage}
\rehead{\MakeUppercase{Title of the book}}
\lohead{\leftmark}
\begin{document}
\blinddocument
\blinddocument
\end{document}
建议使用fancyhdr
(不加载包scrlayer-scrpage
):
\documentclass[a4paper,12pt]{book}
\usepackage{blindtext}% only for dummy text
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE]{\slshape\MakeUppercase{Title of the book}}
\fancyhead[LO]{\slshape\leftmark}
\fancyhead[LE,RO]{\thepage}
\renewcommand*{\headrulewidth}{0pt}% remove head rule
\begin{document}
\blinddocument
\blinddocument
\end{document}
要删除页眉中章节号后的句号,您可以重新定义\chaptermark
(在\pagestyle{fancy}
!):
\makeatletter
\def\chaptermark#1{\markboth {\MakeUppercase{\ifnum
\c@secnumdepth>\m@ne \@chapapp\ \thechapter\ \ \fi #1}}{}}
\makeatother
或修补\chaptermark
(之后\pagestyle{fancy}
!):
\usepackage{xpatch}
\xpatchcmd\chaptermark{. }{\ }{}{\PatchFailed}
补充说明:你必须清理你的序言。