
Tenho capítulos e apêndices. Eu não estou usando \part
. Meu cabeçalho é definido como
\fancyhead[RO,LE]{\textsf{\footnotesize \thechapter--\thepage}}
Depois de passar dos capítulos para os apêndices (depois \appendix
), os títulos dos apêndices estão ok, mas o cabeçalho diz "Capítulo A: blá" em vez de "Apêndice A: blá".
Responder1
Aqui está uma solução.
o comando \@chapapp
expande para o capítulo primeiro e para o apêndice após o uso, \appendix
podemos usá-lo aqui
\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}