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 have a problem that I can't seem to solve. Basically, I want my chapter headings to be at the same position relative to top of the page as the rest of the text. I've looked at numerous resources online, but the problem is still not solved... :(

I tried using the titlesec package, but no results:

\usepackage{titlesec}
\titleformat{\chapter}[hang]
{\normalfont\Large\bfseries}{\thechapter}{1em}{\Large}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titlespacing*{\chapter} {0pt}{\baselineskip}{0pt}
\titlespacing*{\section} {0pt}{\baselineskip}{0pt}

Here is what I get in the output:

Chapter Heading:

chapter heading

Other text (sections):

section heding

Also, the headings of TOC LoF and LoT are a little off from normal Chapter heading spacing...

Please help!

share|improve this question
    
please identify the document class you are using. –  barbara beeton May 3 '11 at 20:36
    
@barbara beeton Sorry, I should've mentioned it initially. I am using the report doc class. –  ravil May 3 '11 at 23:23

2 Answers 2

up vote 7 down vote accepted

It is unfortunately not possible without redefining some internals of titlesec. It uses the command

\vspace*{<before vspace>}

before the chapter command. This is an absolute distance even after a page break. Before sections headers it uses

\addvspace{<before vspace>}

There are a lot of rules regarding \addvspace, such as adding only the maximum of two sequencial \addvspace's, no spacing after a page break, etc.

To get what you are asking for you can try the following redefinition

\usepackage{titlesec}
\makeatletter
\def\ttl@mkchap@i#1#2#3#4#5#6#7{%
    \ttl@assign\@tempskipa#3\relax\beforetitleunit
    \vspace{\@tempskipa}%<<<<<< REMOVE THE * AFTER \vspace
    \global\@afterindenttrue
    \ifcase#5 \global\@afterindentfalse\fi
    \ttl@assign\@tempskipb#4\relax\aftertitleunit
    \ttl@topmode{\@tempskipb}{%
        \ttl@select{#6}{#1}{#2}{#7}}%
    \ttl@finmarks  % Outside the box!
    \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}
\makeatother
share|improve this answer
    
This is excellent, that you very much for your help! I still have a lot to lean in LaTeX :) –  ravil May 4 '11 at 16:35

in most document classes, the chapter heading starts with \vspace*{<sink amount>}. in the report class, this is the first part of the definitions \@makechapterhead (for numbered chapters) and \@makeschapterhead (for unnumbered chapters).

since the titlesec package apparently doesn't have a straightforward way to omit this space, it seems easier to redefine the two relevant commands from report.cls. just copy the two definitions into your preamble, comment out the unwanted \vspace lines, wrap the whole block between \makeatletter ... \makeatother and go on your way. put in a comment to say why you did what you did; you'll be glad for this later.

share|improve this answer
    
Thank you very much for your help, it worked! :) –  ravil May 4 '11 at 16:36

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.