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.

The following code gives me some space above the chapter title, that I'd like to avoid:

\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}[frame]
  {}
  {\thechapter}
  {0pt}
  {}
\titlespacing*{\chapter}{0cm}{0pt}{0pt}[0pt]


\begin{document}
\chapter{Chapter Title}

Fancy text.

\end{document}

See this image:

enter image description here

The ellipse (added afterwards) is above the chapter title, but within the text area.

When I do the same with section instead of chapter, everything is fine:

\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}
\titleformat{\section}[hang]
  {}
  {\thesection}
  {0pt}
  {}
\titlespacing*{\section}{0cm}{0pt}{0pt}[0pt]

\begin{document}
\section{Section Title}

Fancy text.

\end{document}

section with titlesec

What makes \chapter so special in this respect? Is there a way to avoid the space above the chapter title with the package titlesec?

share|improve this question
    
I remember having seen a similar question before and I think that egreg answered it; let me see if I can find it. –  Gonzalo Medina Sep 4 '12 at 20:08
2  
@GonzaloMedina We just have to look through all of egreg's answers :-)) –  topskip Sep 4 '12 at 20:10
    
tex.stackexchange.com/a/63393/4427 –  egreg Sep 4 '12 at 20:13
    
The given (linked question) solution does not work for me. –  topskip Sep 5 '12 at 8:33

1 Answer 1

up vote 2 down vote accepted

When I go back the amount of \topskip, everything is fine:

\documentclass{book}
\usepackage[showframe]{geometry}
\usepackage{titlesec}

% \topskip 50pt

\titleformat{\chapter}[frame]{}{\thechapter}{0pt}{}
\titlespacing*{\chapter}{0cm}{-\topskip}{0pt}[0pt]

\begin{document}
\chapter{Chapter Title}

Fancy text.

\end{document}

The {-50pt}{40pt} in the linked answer ( http://tex.stackexchange.com/a/63393 ) are not the correct values for the question above.

enter image description here

share|improve this answer
    
Your question uses style frame, while the answer has hang. –  egreg Sep 5 '12 at 10:39
    
@egreg fixed, thanks. Results are the same. –  topskip Sep 5 '12 at 10:45

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.