\pagestyle{scrheadings}
我在標題中使用當前章節名稱。有一章不應出現在目錄中,這就是我使用\chapter*{MyChapter}
.問題是標題中顯示的不是MyChapter的chaptername,而是上一章的名稱。如何僅更改一頁的頁首中的章節名稱?
謝謝
答案1
與一個KOMA-Script 類你可以設定班級選項
headings=optiontoheadandtoc
然後你可以使用
\addchap[tocentry={}]{Chapter without tocentry}
取得標題中具有相同條目但目錄中沒有條目的未編號章節。
例子:
\documentclass[
headings=optiontoheadandtoc
]{scrreprt}
\usepackage[automark]{scrlayer-scrpage}
\usepackage{lipsum}% only for dummy text
\begin{document}
\tableofcontents
\chapter{First Chapter}
\lipsum
\addchap[tocentry={}]{Chapter without tocentry}
\lipsum
\chapter[Entry in header und ToC]{Another chapter}
\lipsum
\end{document}