I am trying to get my headings set up to meet my university's thesis formatting requirement. I'm using the titlesec package because it has the ability to suppress the spacing before the second heading when two headings appear in a row. That's a requisite given the school's guidelines. Things are mostly working out, but I'm running into two problems:
- The spacing before and after the first line of a
display
chapter heading is a bit larger than what I think I'm telling it to be. - The spacing after the chapter heading is different for single and multiline chapter titles. (I don't need the text to start in the same place on every page, I just need the space between the bottom of the chapter title and the first line of text to be consistent.)
I've tried digging through the guts of titlesec.sty
to try and figure out exactly what's going on, but that is a very steep uphill battle. It's quite the convoluted pile of code (with a lot of capability, of course).
So, I was wondering if anyone could lend some insight into what is triggering the extra space around the label and what is causing the inconsistent spacing following the title.
Recommendations on how to trace the processing and see exactly where the spaces are coming from would also be appreciated. I know that TeX has some debugging functions available, but I've never worked with them and the references I have describing them are a bit scary given my lack of TeXpertise. If there are some approachable tools I could be using, I'd love to be able to apply them in some other places, too. In particular, places where I have to switch back and forth between single and double spacing. That often results in me needing to insert some \vspace
hacks to fix things up since I don't really know what's going on under the hood very well.
Here is a minimum working example that illustrates the problems I'm running into with the headings:
\documentclass[openany,oneside]{book}
\setlength{\headsep}{12pt}
\setlength{\headheight}{12pt}
\setlength{\topmargin}{-24pt}
\setlength{\textheight}{9in}
\setlength{\footskip}{24pt}
% Command to create a rule of the specified width and height, but pretending both are zero so it
% doesn't actually shift anything around. Optionally shift it vertically by a specified amount.
% \zeroSizeRule[verticalShift]{width}{height}
\newcommand{\zeroSizeRule}[3][0pt]%
{%
\raisebox{#1}[0pt][0pt]{\makebox[0pt][l]{\rule{#2}{#3}}}%
}
\newcommand{\testFirstLineSpace}{\settoheight{\tempheight}{CHAPTER}\zeroSizeRule[\tempheight]{0.125in}{2in}\zeroSizeRule[-12pt]{0.25in}{12pt}}
\newcommand{\testHeadingToTextSpace}{\zeroSizeRule[-1in]{0.375in}{1in}}
\usepackage[explicit]{titlesec}
\newlength{\tempheight}
\titleformat{name=\chapter}%
[display]% shape type
{\normalfont\rmfamily\bfseries\LARGE\centering}% format for title text
{\testFirstLineSpace CHAPTER \thechapter}% format for label
{12pt}% spacing between label and title text
{\parbox[t]{4.5in}{#1}}% before code
\titlespacing{name=\chapter}%
{0pt}% left margin increase - let the parbox take care of it
{1in}% vertical space before title
{1in}% vertical space after title
\newcommand{\filler}{\MakeUppercase{A quick brown dog with memory problems jumped over the lazy fox over and over and over and over and over and over again.}}
\begin{document}
\mainmatter
\chapter{TEST THAT IS LONG ENOUGH TO WRAP ONTO A SECOND LINE\testHeadingToTextSpace}
\filler
\chapter{SHORTER TEST\testHeadingToTextSpace}
\filler
\end{document}
uuthesis
package here that deals with the 'inverted pyramid' for titles you were asking earlier, and presumably all of the strange vertical spacing rules. If there's something that doesn't quite work you could always submit a patch to that, rather than starting from scratch. (Writing a thesis is already enough work without the distraction of creating the TeX format).