Page LayoutHeaders missing on chapter title pages

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
hughes
Posts: 3
Joined: Tue Sep 22, 2009 12:42 am

Headers missing on chapter title pages

Post by hughes »

I'm working on my dissertation and I am required to show headers on my chapter title pages (it looks ugly, I know, but I have no choice), but my current code suppresses the headers on the first page of a new chapter.

MWE (compiled w/ pdflatex)
Note that I use this file in conjunction with a bunch of other files that contain the content in the dissertation. The relevant \include statements were removed for brevity and ease of compilation of the MWE. I did not, however, remove any of the packages I am using, even though they aren't directly necessary for the MWE, because part of me suspects that there could be a conflict between packages.

Code: Select all

\documentclass[12pt,letterpaper,oneside]{book}

\usepackage{listings}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{pdflscape}
\usepackage{captcont}
\usepackage{setspace}
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage[page,titletoc]{appendix}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[mathscr]{eucal}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{array}
\usepackage[Sonny]{fncychap}
\usepackage[top=1in, bottom=1in, left=1.5in, right=1in, includefoot]{geometry}
\usepackage[pdftex,bookmarks=true]{hyperref}
\hypersetup{ linkbordercolor={1 1 1},citebordercolor={1 1 1} } 

\pagestyle{fancy}

\begin{document}

\onehalfspacing
\lstset{language=C}
\fancyhead{}
\rhead{\footnotesize{\emph{Texas Tech University, Bryan Hughes, December 2009}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\frontmatter

\chapter{Frontmatter test}
This is some information on the first page where no header \emph{is not} present

\pagebreak
This is some information on the second page where the header \emph{is} present

\mainmatter

\chapter{Mainmatter Test}
This is some information on the first page where no header \emph{is not} present

\pagebreak
This is some information on the second page where the header \emph{is} present

\end{document}
Any thoughts?

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Headers missing on chapter title pages

Post by meho_r »

Since you're using fancyhdr package, take a look at section 7 of fancyhdr documentation about redefining plain style (p. 7). Here's an example code:

Code: Select all

\fancypagestyle{plain}{%
\fancyhead{}
\rhead{\footnotesize{\emph{Texas Tech University, Bryan Hughes, December 2009}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}%
}
hughes
Posts: 3
Joined: Tue Sep 22, 2009 12:42 am

Re: Headers missing on chapter title pages

Post by hughes »

Thanks, that did it. I never realized \chapter (in my case) call \thispagestyle to set the style back to plain. Learn something new every day.
Post Reply