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.
\documentclass{book}
\usepackage[margin=0pt,papersize={50pt,70pt}]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}{\Huge\bfseries}{}{0em}{}
\titleformat{\section}{\Huge\bfseries}{}{0em}{}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}
\titlespacing*{\section}{0pt}{0pt}{0pt}
\begin{document}
\chapter{abc}
\newpage\section{abc}
\end{document}

This question is concerned with Writing several lines before chapter title

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

There should be a reason why

\titlespacing*{\chapter}{0pt}{-19pt}{0pt}

works as you'd like. It must be in the internals of titlesec.

The amount of backspacing must be -17.5pt if \huge is requested, -16.6pt with \LARGE. With \Huge the baselineskip is 30pt, with \huge it's 25pt and with \LARGE it's 22pt.

The sizes are actually obtained as

-(\topskip+\baselineskip-\ht\strutbox)

where the \strut is computed in the font size. For example, with \Huge the height of a strut is 21pt, so the computation is

-(10pt + 30pt - 21pt) = -19pt

share|improve this answer
    
thanks your explanation. But, why the section label doesn't need backspacing adjustment? –  dearmath May 19 '11 at 17:16
    
@dearmath: It's the chapter heading that skips down and backspacing of the right amount places it in line with the section label in the following place. –  egreg May 19 '11 at 17:18
    
Thanks! –  dearmath May 20 '11 at 3:00
add comment

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.