[Tex/LaTex] How to set a header showing the current section

appendicesheader-footer

A few of the appendices in my document contain code covering a lot of pages, but those pages have nothing else than code (and page numbers). How can I put a header showing what's the current appendix, starting from the second page of each appendix? The image below shows the undesired results.

alt text

Best Answer

Use

\pagestyle{headings}

to print the current section name in the header.

If you need more precision than that, you can use, eg fancyhdr and craft your own heading layout. See http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/fancyhdr.pdf for details.