4

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

1
  • By chapter name do you mean the word ‘chapter’ or the chapter title? The picture is aligned on the right. So?…
    – Bernard
    Jul 17, 2014 at 10:17

1 Answer 1

12

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.

6
  • 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, 2014 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, 2014 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, 2014 at 11:54
  • I have edited my answer for your second question.
    – SLx64
    Jul 17, 2014 at 11:57
  • Bernard, another question. How can I apply a separate font family to the title. I want just "Enjoy ..." part to be in normal latin font not ss.
    – LatexQuest
    Jul 17, 2014 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.