
Ich habe Kapitel und Anhänge. Ich verwende nicht \part
. Meine Überschrift ist definiert als
\fancyhead[RO,LE]{\textsf{\footnotesize \thechapter--\thepage}}
Nachdem ich von den Kapiteln zu den Anhängen gewechselt bin (nach \appendix
), sind die Anhangsüberschriften in Ordnung, aber die Kopfzeile lautet „Kapitel A: bla“ statt „Anhang A: bla“.
Antwort1
Hier ist eine Lösung.
der Befehl \@chapapp
expandiert zuerst zum Kapitel und dann zum Anhang, \appendix
wir können ihn hier verwenden
\renewcommand{\chaptermark}[1]{\markboth{\@chapapp{} \thechapter:\ #1}{}}
\documentclass{book}
\usepackage{blindtext}
\usepackage{fancyhdr}
\renewcommand{\chaptermark}[1]{%
\markboth{\@chapapp{} \thechapter:\ #1}{}}
\fancyhead{}
\makeatletter
\fancyhead[RO,LE]{\textsf{\footnotesize \thechapter--\thepage}}
\fancyhead[LO,RE]{\textsf{\footnotesize \leftmark}}
\makeatother
\pagestyle{fancy}
\begin{document}
\blinddocument
\appendix
\blinddocument
\end{document}