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'd like to design a chapter heading similar to the one in the picture below. I like to put a line between the number and the chapter name and also align the the chapter name to the left. I'm using the document class book. Any ideas how to do it?

enter image description here

share|improve this question
    
By chapter name do you mean the word ‘chapter’ or the chapter title? The picture is aligned on the right. So?… –  Bernard Jul 17 at 10:17

1 Answer 1

up vote 8 down vote accepted

You can build your own chapterstyle with the titlesec package:

\documentclass{report}
\usepackage[explicit]{titlesec}
\usepackage{lipsum}
\usepackage{type1cm}
\usepackage{xcolor}


\titleformat{\chapter}[display]
  {\normalfont\Large\rmfamily}
  {\sffamily\flushright\fontsize{60}{0}\textbf{\textcolor{black!20}{{\Huge\chaptername}~\thechapter\vskip0pt\rule{\textwidth}{2pt}}}}{0pt}
  {\flushleft\fontsize{30}{0}{#1}\vskip60pt}
\titlespacing*{\chapter}
  {0pt}{-40pt}{0pt}

\begin{document}
\chapter{Enjoy the whitespace}

 \lipsum[1]
\end{document}

The type1cm package is required for the font size.

share|improve this answer
    
type1cm is required if you use computermodern. If you use another font that exists in type1 or opentype format, you don't need it. –  Bernard Jul 17 at 10:54
    
Thanks a lot Bernard! Good one! Two questions: 1) Where in the codes I can play around with the spacing before after the line? 2) How can I add "CHAPTER" before one? With a smaller size ... –  LatexQuest Jul 17 at 11:49
    
To change the spacing before the line you can simply change the value of \vskip0pt\rule... to any other value. If you want to change the space after you have to change the ...}}}{0pt} at the end of the line –  SLx64 Jul 17 at 11:54
    
I have edited my answer for your second question. –  SLx64 Jul 17 at 11:57
    
Thanks a lot! It's perfect! –  LatexQuest Jul 17 at 12:14

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.