![如何隐藏选定章节的页眉中的章节编号?](https://linux22.com/image/342971/%E5%A6%82%E4%BD%95%E9%9A%90%E8%97%8F%E9%80%89%E5%AE%9A%E7%AB%A0%E8%8A%82%E7%9A%84%E9%A1%B5%E7%9C%89%E4%B8%AD%E7%9A%84%E7%AB%A0%E8%8A%82%E7%BC%96%E5%8F%B7%EF%BC%9F.png)
我的书使用普通的章节编号,并且通常也应该在页眉中显示章节编号(请参阅我的 mwe 中的普通章节示例)。但是,对于我书中的某些章节(例如参考文献),我想隐藏页眉中的章节编号(因为我也隐藏了目录中的章节编号)。如何实现?
MWE 解释:
\documentclass[graybox,envcountchap,sectrefs]{svmono}
\usepackage{lipsum}
\usepackage{graphicx}
\graphicspath{{Figures/}}
\begin{document}
\tableofcontents
\chapter{Chapter}
\section{Section}
\lipsum[1-3]
This is what normal chapters, sections as well as the respective numbering
in headers and toc are supposed to look like.
%%% The problems start here
\addcontentsline{toc}{chapter}{References without numbering}
\chapter*{References without numbering}
\chaptermark{References without numbering}
\addcontentsline{toc}{section}{Literaturetype X}
\section*{Literaturetype X}
\sectionmark{Literaturetype X}
\lipsum[1-3]
Because neither the references chapter nor the references sections, which are
used to distuingish different types of literature, are supposed to be numbered
in the toc or page header, therefore chapter* is used. Since in this case the
page header of chapter 1 would still be shown, chaptermark and sectionmark
are used to adapt the page headers content to the references chapter and
section. However, the chapter numbering in the page headers does still show
although it is not supposed to. How can I modify chaptermark and section mark
to not show the respective numberings in the page header?
\end{document}
我的 MWE 与所使用的类(svmono.cls)实现可以在这里查看和修改:https://www.overleaf.com/6700293jqghhf。按“项目”也可以访问 svmono.cls 文件。
答案1
该类svmono
有用于此目的的命令:\extrachapter
为页眉添加标记(不带数字),并将\Extrachapter
其添加到。 \Extrachapter 将换行符更改为目录的单词空格,但它会为页眉添加大量空格,并且它不接受可选参数。但是,您可以使用或命令.toc
指定此可选参数。\chaptermark
\sectionmark
不幸的是,小节的编号仍然与最后一章的编号相同。所以我\setcounter{secnumdepth}{0}
在 \Extrachapter 之前添加了:
\documentclass[graybox,envcountchap,sectrefs]{svmono}
\usepackage{lipsum}
\usepackage{graphicx}
\graphicspath{{Figures/}}
\begin{document}
\tableofcontents
\chapter{Chapter}
\section{Section}
\lipsum[1-3]
This is what normal chapters, sections as well as the respective numbering
in headers and toc are supposed to look like.
%%% The problems start here
\setcounter{secnumdepth}{0}
\Extrachap{This is a long title therefore\\has a linebreak}%
\chaptermark{This is a long title therefore has a linebreak}
\section{Literaturetype X}
\lipsum[1-10]
Because neither the references chapter nor the references sections, which are
used to distuingish different types of literature, are supposed to be numbered
in the toc or page header, therefore chapter* is used. Since in this case the
page header of chapter 1 would still be shown, chaptermark and sectionmark
are used to adapt the page headers content to the references chapter and
section. However, the chapter numbering in the page headers does still show
although it is not supposed to. How can I modify chaptermark and section mark
to not show the respective numberings in the page header?
\end{document}