Page Layout ⇒ Header in the Appendix
Header in the Appendix
Section Number Section Title
So if I am in the second section of the first chapter, and that chapter-section's title is "Why Study Economics?" this appears as:
1.2 Why Study Economics?
So far, so good. However, in the two appendices I want the header to be different. I simply want it to say the appendix name. I only have two appendices, so actually all I need is: "Appendix A" and "Appendix B" to appear on the pages which correspond to them. The appendix name is effecively the title of that \chapter, so I guess what I want is for the header to show only the chapter title only in the appendices of the document.
Does anyone know how to do this - ie. effectively vary what is shown as the header in different parts of the document? In case it's useful, the coding for the header style used in the document is:
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter. #1 }}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[RO]{\bfseries\rightmark}
\fancyhead[LE]{\bfseries\leftmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}
\fancypagestyle{plain}{
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
}
Any help much appreciated!
Peter
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Header in the Appendix
Briefly, I used the following command:
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO]{\textbf{Appendix A}}
\fancyfoot[C]{\thepage}
inserted at the beginning of the file containing Appendix A (after \appendix \chapter{Appendix Name}) to re-set the header style and 'manually' put the word "Appendix A" at the top right of the page. I did the same thing for Appendix B. Since I only have two appendices, it seemed like the easiest way to get it done.
Cheers
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Header in the Appendix
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).pjs56 wrote:Just to let anyone interested know that I have solved this problem. […]
The titlesec package offers also the possibility to declare page styles and might allow a simpler solution.
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10