我正在使用memoir
带有fancyhdr
标题包的类。由于重叠问题,我想减小标题的大小。这是我的 tex 代码
\documentclass[oneside]{memoir}
\setlength\midchapskip{10pt}
\makechapterstyle{VZ23}{
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\chapnumfont{\Huge\bfseries\centering}
\renewcommand\chaptitlefont{\Huge\scshape\centering}
\renewcommand\afterchapternum{%
\par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip}
\renewcommand\printchapternonum{%
\vphantom{\chapnumfont \thechapter}
\par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip}
}\chapterstyle{VZ23}
\usepackage{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,LO]{\itshape \nouppercase \rightmark}
\fancyhead[RO,RE]{\itshape \nouppercase Chapter \arabic{chapter}}
\usepackage{lipsum}
\begin{document}
\begin{abstract}
\lipsum[1-3]
\end{abstract}
\newpage
\tableofcontents
\chapter{First Chapter}
\section{Extremely long first section that overlaps}
\newpage
\section{Extremely long second section that overlaps}
\appendix
\chapter{First Appendix}
\section{Lipsum}
\newpage
\section{Lipsum}
\end{document}
这很有效,但我还有两个问题:
- 在我的文档开头(第一章和目录之前),出现了一个烦人的“第 0 章”标题
- 我想在进入以下章节时写“附录”而不是“章节”
\appendix
答案1
当您运行代码时,您会收到以下错误消息;
! LaTeX Error: Command \footruleskip already defined.
Or name \end... illegal, see p.192 of the manual.
这是因为您使用fancyhdr
包来生成标题,而不是使用类提供的内置命令。要消除错误并摆脱问题中提到的问题,请使用memoir
本节提供并描述的机制7.3 制作页眉和页脚手册memoir
。
您声明了oneside
类选项,但此选项与您定义标题的方式不兼容;这是对原始代码的修改,您可以根据需要进行修改:
\documentclass[twoside]{memoir}
\setlength\midchapskip{10pt}
\makechapterstyle{VZ23}{
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\chapnumfont{\Huge\bfseries\centering}
\renewcommand\chaptitlefont{\Huge\scshape\centering}
\renewcommand\afterchapternum{%
\par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip}
\renewcommand\printchapternonum{%
\vphantom{\chapnumfont \thechapter}
\par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip}
}
\chapterstyle{VZ23}
\usepackage{geometry}
\nouppercaseheads
\makepagestyle{mystyle}
\makeevenhead{mystyle}{\itshape\rightmark}{}{}
\makeoddhead{mystyle}{}{}{\itshape\leftmark}
\pagestyle{mystyle}
\usepackage{lipsum}
\begin{document}
\chapter{First Chapter}
\section{Extremely long first section that overlaps}
\lipsum[1-20]
\end{document}