Saturday, 1 June 2013

Issue with titlesec page styles and appendix in book class

Issue with titlesec page styles and appendix in book class

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}

No comments:

Post a Comment