![如何在回忆录的页眉中添加部分标题](https://linux22.com/image/320864/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%9B%9E%E5%BF%86%E5%BD%95%E7%9A%84%E9%A1%B5%E7%9C%89%E4%B8%AD%E6%B7%BB%E5%8A%A0%E9%83%A8%E5%88%86%E6%A0%87%E9%A2%98.png)
我想将未编号的部分标题添加到回忆录的标题中,但 \thepart 命令只生成部分编号而不生成标题。我该如何重新定义 \thepart 命令以获得所需的结果?
\documentclass[11pt]{memoir}
\nouppercaseheads
\makepagestyle{mystyle}
\makeevenhead{mystyle}{}{\textit{Book Title}}{}
\makeoddhead{mystyle}{}{\textit{\thepart}}{}
\makeevenfoot{mystyle}{}{\thepage}{}
\makeoddfoot{mystyle}{}{\thepage}{}
\begin{document}
\pagestyle{mystyle}
\part{Part Title}
\include{Chapter1}
\include{chapter2}
\end{document}
答案1
也许是这样的?
\documentclass[11pt]{memoir}
\usepackage{lipsum}
\nouppercaseheads
\makepagestyle{mystyle}
\makeevenhead{mystyle}{}{\textit{Book Title}}{}
\makeoddhead{mystyle}{}{\rightmark}{}
\makeevenfoot{mystyle}{}{\thepage}{}
\makeoddfoot{mystyle}{}{\thepage}{}
\clearmark{chapter}
\clearmark{section}
\createmark{part}{both}{shownumber}{\partname\space}{.\space}
\begin{document}
\pagestyle{mystyle}
\tableofcontents
\part{Part Title}
\chapter{Chapter1}
\lipsum[1-30]
\chapter{chapter2}
\lipsum[1-30]
\end{document}
诀窍memoir
在于您需要使用清除旧标记\clearmark
,然后为\part
级别划分创建一个“标记”。