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 using the book style in LaTeX. I want my chapter headings to look like this:

      1
 Great Chapter

It should be in the sans-serif and bold font, centered, and I want to be able to customize the spacing before and after the heading, and also customize the spacing between the “1” and the “Great Chapter.” How can I do this in LaTeX?

share|improve this question
    
Which document class do you use? Please provide a minimal example. –  Marco Daniel Mar 14 '12 at 18:55

1 Answer 1

up vote 9 down vote accepted

The titlesec package can facilitate all of this.

enter image description here

From the titlesec package

 \titlespacing{command}{left spacing}{before spacing}{after spacing}[right]

How to read {12pt plus 4pt minus 2pt}

  • 12pt is what we would like the spacing to be
  • plus 4pt means that TeX can stretch it by at most 4pt
  • minus 2pt means that TeX can shrink it by at most 2pt

This is one example of the concept of, 'glue', in TeX; it may seem strange to use the word 'glue' for a stretchable space, but to quote Knuth (The TeXbook)

But whenever the author has suggested changing TeX's terminology, numerous people have said that they like the word "glue" in spite of its inappropriateness; so the original name has stuck.

\documentclass{book}
\usepackage{lipsum}
\usepackage[explicit]{titlesec}

% custom chapter
\titleformat{\chapter}[display]
{\filcenter\LARGE\bfseries\sffamily}
{\thechapter\\[2cm]% spacing between number and Great chapter
#1}
{1pc}
{\Huge}
% From the titlesec package
% \titlespacing{command}{left spacing}{before spacing}{after spacing}[right]
% spacing: how to read {12pt plus 4pt minus 2pt}
%           12pt is what we would like the spacing to be
%           plus 4pt means that TeX can stretch it by at most 4pt
%           minus 2pt means that TeX can shrink it by at most 2pt
%       This is one example of the concept of, 'glue', in TeX
\titlespacing{\chapter}{0pt}{*4}{-0.1cm}
\begin{document}

\chapter{Great chapter}
\lipsum
\end{document}
share|improve this answer
    
Thanks. However, can you please tell me how I replace the pre-defined sizes (\Large, \LARGE, \huge, \HUGE) with a command where I can specify the font size exactly? –  Enchilada Mar 15 '12 at 21:53
    
Or rather, how would I get the size that is, say, halfway between \huge and \Huge? –  Enchilada Mar 15 '12 at 22:18
    
@Enchilada I think that's a separate question :) What do you mean by 'specify the font size exactly'? –  cmhughes Mar 15 '12 at 23:54
    
Yeah, you’re right. I’ve put it in a separate question: tex.stackexchange.com/questions/48208/… –  Enchilada Mar 16 '12 at 1:25

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.