從標題中刪除章節號--回憶錄類

從標題中刪除章節號--回憶錄類

我在memoir課堂上使用 A6 進行工作。對於這種格式,我想從預設頁面標題樣式中刪除“章節”一詞memoir以及章節號,以便標題中僅包含章節標題。刪除“chapter”一詞可以透過在後面添加以下內容來實現\begin{Document}

\renewcommand{\chaptername}{}

但章節號仍保留在頁首。我添加了這個命令:

\renewcommand\printchapternonum{}

但沒有效果。

從標題中刪除章節號碼的快速簡單的方法是什麼?我查看了fancyhdr包包,發現有衝突memoir;同樣,我嘗試更改為scrbook但出現錯誤(已定義基線跳過)。

一定有一種簡單的方法來做到這一點。

[之後]

謝謝大家的有用回答。

答案1

memoir執行此操作的正確方法

\addtopsmarks{headings}{}{
  \createmark{chapter}{left}{nonumber}{}{}
}
\pagestyle{headings} % activate changes

沒有必要試圖弄清楚內部結構是如何運作的或諸如此類的事情。

您可能想閱讀http://tug.org/pracjourn/2008-2/madsen/

答案2

您可以重新定義\chaptermark

\documentclass{memoir}
\usepackage{lipsum}% just to generate text for the example

\makeatletter
\renewcommand\chaptermark[1]{%
  \markboth{\MakeUppercase{#1}}{}
}
\makeatother

\begin{document}

\chapter{Test chapter}
\lipsum[1-10]

\end{document}

第二頁標題的圖片:

在此輸入影像描述

大寫文字不太令人愉悅,因此也許您可以使用小寫字母代替:

\documentclass{memoir}
\usepackage{lipsum}% just to generate text for the example

\makeatletter
\renewcommand\chaptermark[1]{%
  \markboth{\textsc{#1}}{}
}
\makeatother

\begin{document}

\chapter{Test chapter}
\lipsum[1-10]

\end{document}

答案3

對於twoside樣式,\chaptermark指令定義為

> \chaptermark=macro:
#1->\@setclcnt {chapter}{@memmarkcntra}\advance \c@@memmarkcntra \m@ne \markboth 
{\memUChead {\ifnum \c@secnumdepth > \c@@memmarkcntra \if@mainmatter \@nameuse 
{chaptermarksn}{\@chapapp \ \@nameuse {thechapter}. \ }\fi \fi #1}}{}.

在 中找到定義並不容易memoir.cls,因為它在處理類別程式碼的過程中被修改了,所以我使用了\show\chaptermark.

\chaptermarksn透過查看僅使用其參數的定義,解決方案就很容易:

\renewcommand{\chaptermarksn}[1]{}

因為章節標籤和編號作為參數傳遞給它。

例子

\documentclass{memoir}

\renewcommand\chaptermarksn[1]{}

\begin{document}

\tableofcontents*
\chapter{Test Chapter}
\section{Test Section}
\lipsum[1-20]
\end{document}

在此輸入影像描述

相關內容