Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a portfolio/report with pdflatex and while trying to get a header and footer I have got a situation where there's now a significant gap between the header and the chapter title, whereas there's no gap on any of the other pages.

The code I'm using to style the headers, footers and titles is:

% Header/Footer 
\fancypagestyle{plain}{
  \fancyhf{}
  \fancyhead[L]{Name \texttt{<email@address>}}
  \fancyhead[R]{\leftmark}
  \fancyfoot[L]{Subject Name}
  \fancyfoot[R]{\thepage}
  \setlength{\headheight}{15.2pt}
  \setlength{\headsep}{6pt}
  \renewcommand{\headrulewidth}{0.4pt}
  \renewcommand{\footrulewidth}{0.4pt}
}

% Chapter Title formatting

\titleformat{\chapter}[display]
  {\normalfont\Huge \scshape}{\titlerule}{-28pt}{\thechapter\ \ \Huge}[\vspace{-2pt}\titlerule]
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\Huge \scshape}{\titlerule}{-28pt}{\Huge}[\vspace{-2pt}\titlerule]
\titlespacing*{\chapter}{0pt}{50pt}{*2}
\begin{document}

% Article top matter ...
\maketitle

\pagestyle{plain}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Reduce the spacing using the second mandatory argument of \titlespacing (currently you are declaring a spacing of 50pt); a complete example setting the second argument to 0pt (notice that reducing this space too much might not be desirable since the rule from the header and the one from the chapter heading might get too close):

\documentclass{report}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{lipsum}

% Header/Footer 
\fancypagestyle{plain}{
  \fancyhf{}
  \fancyhead[L]{Name \texttt{<email@address>}}
  \fancyhead[R]{\leftmark}
  \fancyfoot[L]{Subject Name}
  \fancyfoot[R]{\thepage}
  \setlength{\headheight}{15.2pt}
  \setlength{\headsep}{6pt}
  \renewcommand{\headrulewidth}{0.4pt}
  \renewcommand{\footrulewidth}{0.4pt}
}

% Chapter Title formatting

\titleformat{\chapter}[display]
  {\normalfont\Huge \scshape}{\titlerule}{-28pt}{\thechapter\ \ \Huge}[\vspace{-2pt}\titlerule]
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\Huge \scshape}{\titlerule}{-28pt}{\Huge}[\vspace{-2pt}\titlerule]
\titlespacing*{\chapter}{0pt}{0pt}{*2}

\pagestyle{plain}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}

\begin{document}

\chapter{Test Chapter}
\lipsum[1-30]

\end{document}

enter image description here

share|improve this answer
    
Thanks. I completely forgot that I had even set the titlespacing anywhere previously. Bonus points for an including an image, I was unsure people would understand my problem when I didn't have a image to demonstrate. –  Adam M-W Nov 21 '12 at 0:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.