3

How can I show my chapter's titles, using book class, to be like this:

enter image description here

I've been using titlesec and anyfontsize package for its spacing and sizing with the following code:

\titleformat{\chapter}[block]
    {\normalfont\fontsize{25}{17}\selectfont\bfseries}{\thechapter}{.5cm}{\fontsize{21}{17}\selectfont}
    \titlespacing*{\chapter}{2cm}{1.4cm}{4cm}

But haven't got any idea on how to make that bar separation.


Addition from Manuel Kuehner (added a MWE)

\documentclass{book}
\usepackage{titlesec}

\titleformat{\chapter}[block] {\normalfont\fontsize{25}{17}\selectfont\bfseries}{\thechapter}{.5cm}{\fontsize{21}{17}\selectfont} \titlespacing*{\chapter}{2cm}{1.4cm}{4cm}

\begin{document}

\chapter{Test Chapter}

\end{document}

Feripinho
  • 129

1 Answers1

5

If you want full control on the style of the separation bar you can insert it as a tikz picture. In the following MWE I have used the dotted and draw=gray options only to show a possibility (you can omit them, if you prefer). You can set the distance between the chapter number and the chapter title changing the value of the \numtitlesep length. The separation bar will be placed in the middle. The height and the position of the bar are set empirically (they too can be automated based on the font used, but I don't think it's worth it for such a case).

MWE

\documentclass{book}
\usepackage{titlesec}
\usepackage{tikz}

\newlength{\numtitlesep} \setlength{\numtitlesep}{1cm}

\def\chapvrule{% \tikz[overlay]{% \draw[ draw=gray, dotted, line width=1.5pt, xshift=\dimexpr(0.5\numtitlesep)] (0,-7pt) -- (0,24pt);}}

\titleformat{\chapter}[block] {\normalfont\fontsize{25}{40}\selectfont\bfseries} {\thechapter\chapvrule} {\numtitlesep} {\fontsize{21}{17}\selectfont}

\titlespacing*{\chapter}{2cm}{1.4cm}{4cm}

\begin{document}

\chapter{Lorem ipsum}

\end{document}

which gives:

enter image description here

Ivan
  • 4,368