如何将这本书的标题改为小写?

如何将这本书的标题改为小写?

在以下标准中,\documentclass{book}所有标题均为大写。

我如何修改下面的代码来制作小写标题?

偶数页显示章节编号和名称,奇数页显示节编号和名称。章节的第一页没有页眉,只有页脚中的页码。其他页面的页眉上显示页码:奇数页在右侧,偶数页在左侧,如图所示。

它是用

\documentclass{book}
\usepackage{lipsum}

\begin{document}

\title{Standard \LaTeX{} Book}
\author{The Author}
\date{The Date}
\maketitle
\tableofcontents

\chapter{Test Chapter One}
\section{Test Section One}
\lipsum[1-6]
\section{Test Section Two}
\lipsum[1-6]
\section{Test Section Three}
\lipsum[1-6]

\chapter{Test Chapter Two}
\section{Test Section One}
\lipsum[1-6]
\section{Test Section Two}
\lipsum[1-6]

\end{document}

备注:问题页眉 - 大写和小写 与这个不够相似,无法帮助我自己找到可能的解决方案。

答案1

我认为这是该类中最糟糕的设计错误book。不是因为默认大写(我认为这很糟糕),而是因为无法轻松更改它。而且这\MakeUppercase是宏中的硬编码。

fancyhdr您可以通过加载包并添加来更改行为

\usepackage{fancyhdr}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[LO]{\itshape\nouppercase{\rightmark}}
\fancyhead[RE]{\itshape\nouppercase{\leftmark}}
\renewcommand{\headrulewidth}{0pt}

到您的序言中。您还可以使用\usepackage{emptypage}生成的空白页来删除页眉和页脚\cleardoublepage

标题下面的规则是默认生成的,因此如果您需要它,请注释掉该\renewcommand{\headrulewidth}{0pt}行。

或者使用提供更改默认值的类,例如memoirscrbook

答案2

regexpatch\MakeUppercase包可以帮助您从\tableofcontents\chaptermark宏中删除宏\sectionmark

\usepackage{regexpatch}% http://ctan.org/pkg/regexpatch
\makeatletter
% \*patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd{\chaptermark}{\MakeUppercase}{}{}{}%
\xpatchcmd{\sectionmark}{\MakeUppercase}{}{}{}%
\xpatchcmd*{\tableofcontents}{\MakeUppercase}{}{}{}%
\makeatother

\chaptermark\sectionmark添加\MakeUppercase到提供的所有标题中,前两个\xpatchcmd命令会将其删除。\tableofcontents在中设置自己的标题\MakeUppercase,因此不受处理\chaptermark- 原因是它实际上是一个\chapter*需要特别注意。\xpatchcmd*在上执行搜索并全部替换\MakeUppercase

相关内容