6

I'm using titlesec to set my page style in a book class. If I include an appendix, the header corresponding to the first chapter is "Appendix 1" instead of "Chapter 1".

\documentclass{book}

\usepackage[pagestyles]{titlesec}  
\newpagestyle{main}[\scshape]{%
  \sethead
  [\thepage][][\chaptertitlename\space\thechapter. \chaptertitle]
  {\ifthesection{\thesection\space\,\sectiontitle}
  {\chaptertitlename\space\thechapter. \chaptertitle}}{}{\thepage}
}
\pagestyle{main}
\usepackage{lipsum}

\begin{document}

\chapter{Foo}
\lipsum

\appendix
\chapter{Bar}
\lipsum

\end{document}
5

Just add \cleardoublepage before \appendix; probably a bad interaction between titlesec and the class.

\documentclass{book}

\usepackage[pagestyles]{titlesec}  
\newpagestyle{main}[\scshape]{%
  \sethead
  [\thepage][][\chaptertitlename\space\thechapter. \chaptertitle]
  {\ifthesection{\thesection\space\,\sectiontitle}
  {\chaptertitlename\space\thechapter. \chaptertitle}}{}{\thepage}
}
\pagestyle{main}
\usepackage{lipsum}

\begin{document}

\chapter{Foo}
\lipsum

\cleardoublepage
\appendix

\chapter{Bar}
\lipsum

\end{document}
3

titlesec/titleps doesn't set \chaptertitlename as a "marked" command. Perhaps it should. For the time being, just write:

\newtitlemark{\chaptertitlename}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.