
我在一页中有一个错误的章节标记。我插入了一个未编号的章节(\chapter*{History}
并且我在当前位置获得“图表列表”作为章节。
我该如何改变它?
代码:
\documentclass{memoir}
\usepackage{lipsum}
\usepackage{fancyhdr}
\makepagestyle{fancy}
\makeatletter
\makepsmarks{fancy}{%
\createmark{chapter}{left}{shownumber}{\@chapapp\ }{\ \ }
}
\makeatother
\makeoddhead{fancy}{}{}{{\fontsize{9.13}{10}\selectfont%
\leftmark}%
\hspace{0.6cm}{\textbf{\thepage}}}
\makeevenhead{fancy}
{\textbf{\thepage}\hspace{0.6cm}{\fontsize{9.13}{10}\selectfont{%
My book title}}}{}{}
\begin{document}
\pagestyle{fancy}
\listoffigures
\cleardoublepage
\chapter*{History}
\lipsum[3-12]
\end{document}
输出的最后一页:
目前,我在学习乳胶中的不同标记(markboth,markright,rightmark等)时遇到了一些困难,因此我在这里提出了我的问题。
我确信这个问题在网站上已经有了答案。只是我对这个主题还不熟悉,不知道要用什么关键词进行搜索。
答案1
- 您不应该加载
fancyhdr
包,因为您正在使用memoir
页眉/页脚的机制。 \chapter*{History}
放完之后\markboth{History}{}
就得到正确的 header 了。
\documentclass{memoir}
\usepackage{lipsum}
\makepagestyle{fancy}
\makeatletter
\makepsmarks{fancy}{%
\createmark{chapter}{left}{shownumber}{\@chapapp\ }{\ \ }
}
\makeatother
\makeoddhead{fancy}{}{}{{\fontsize{9.13}{10}\selectfont%
\leftmark}%
\hspace{0.6cm}{\textbf{\thepage}}}
\makeevenhead{fancy}
{\textbf{\thepage}\hspace{0.6cm}{\fontsize{9.13}{10}\selectfont{%
My book title}}}{}{}
\begin{document}
\pagestyle{fancy}
\listoffigures
\cleardoublepage
\chapter*{History}
\markboth{History}{} %<<<<<<<<<<<<<<<<<<<<<
\lipsum[3-12]
\end{document}