Page LayoutHeader in the Appendix

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
pjs56
Posts: 2
Joined: Wed Mar 23, 2011 9:56 pm

Header in the Appendix

Post by pjs56 »

I have what is I sm sure a surmountable problem (for those better at LaTeX than myself!). I am completing my thesis in LaTeX (document class = book). In the body of the document the header that appears on each page (other than the first page of the chapter, obviously) is in the form as follows:

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

pjs56
Posts: 2
Joined: Wed Mar 23, 2011 9:56 pm

Re: Header in the Appendix

Post by pjs56 »

Just to let anyone interested know that I have solved this problem. It's not an entirely elegant solution, but it does work.

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
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Header in the Appendix

Post by localghost »

pjs56 wrote:Just to let anyone interested know that I have solved this problem. […]
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).

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
Post Reply