15

I'm trying to customize the book class chapter headings. Something similar to memoir Hansen chapter style might be cool.

But I'm quite stuck right now since I can't make the chapter title overlap the chapter number. enter image description here Here is the code I use. Any help would be very much appreciated.

\newcommand{\chapnumfont}{%
    \raggedleft%
    \usefont{T1}{jkp}{b}{n}%
    \fontsize{100}{130}\selectfont%
    \color{DarkCyan}\raggedleft}

\newcommand{\chaptitlefont}{%
    \raggedleft%
    \usefont{T1}{qhv}{b}{n}%
    \fontsize{22}{1pt}\selectfont%
    \color{Black}}

\newcommand\thickhrule{\leavevmode \leaders \hrule height 2pt \hfill \kern \z@}

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
    \vspace*{10\p@}%
    {\parindent \z@ \reset@font%
        \parbox{.2\textwidth}{\chapnumfont \thechapter }
        {\raggedleft\chaptitlefont #1\par\nobreak}%
        \par\nobreak
            \vspace*{20\p@}%
            \thickhrule
            \vskip 40\p@
            \vskip 100\p@
    }}
\makeatother

To extend the question, now that I realize the chapter number may not be visible enough, how would you do make the same thing but avoid the title overlapping the number?

Basically the same as below but the number on the other side.

enter image description here

This picture as been produced with the following code.

\titleformat{\chapter}
    {\thispagestyle{empty}\vspace{50pt}\normalfont\huge\bfseries}
    {\filleft{\parbox{.2\textwidth}{\chapnumfont\color{chapnumcolor}\thechapter}}}
    {0pt}
    {\Huge{\parbox{.8\textwidth}{\chaptitlefont #1}}}[\vspace{2ex}{\titlerule[2pt]}]
15

If I understand you right, this approach with »titlesec« accomplishes the style you want. Should also work with the book class.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\usepackage[svgnames]{xcolor}
\usepackage{blindtext}  % drop in actual document

\colorlet{chapnumcolor}{DarkCyan}
\newcommand*{\chapnumfont}{%
  \usefont{T1}{jkp}{b}{n}%
  \fontsize{100}{120}%
  \selectfont%
}
\newcommand*{\chaptitlefont}{%
  \usefont{T1}{qhv}{b}{n}%
  \fontsize{22}{26}%
  \selectfont%
}

\titleformat{name=\chapter}
{\normalfont\huge\bfseries}
{\filleft\parbox{0.35\textwidth}{\filleft\chapnumfont\color{chapnumcolor}\thechapter}\qquad}
{0pt}
{\filleft\llap{\parbox{\textwidth}{\filleft\chaptitlefont #1}}}
[\vspace{1pc}{\titlerule[2pt]}]

\begin{document}
  \tableofcontents

  \chapter{The quick brown fox jumps over the lazy dog}
    \blindtext  % drop in actual document
\end{document}

This is of course customizable and perhaps improvable here and there.


enter image description here


Update

With regard to the comment this is an approach which swaps chapter number and title. Note that the width for the heading has been chosen with respect to two-digit chapter numbers.

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\usepackage[svgnames]{xcolor}
\usepackage{blindtext}  % drop in actual document

\colorlet{chapnumcolor}{DarkCyan}
\newcommand*{\chapnumfont}{%
  \usefont{T1}{jkp}{b}{n}%
  \fontsize{100}{120}%
  \selectfont%
}
\newcommand*{\chaptitlefont}{%
  \usefont{T1}{qhv}{b}{n}%
  \fontsize{22}{26}%
  \selectfont%
}

\titleformat{name=\chapter}
{\normalfont\huge\bfseries}
{\rlap{\parbox{\textwidth}{\filleft\chapnumfont\color{chapnumcolor}\thechapter}}}
{0pt}
{\rlap{\parbox{0.7\textwidth}{\filright\chaptitlefont #1}}}
[\vspace{1pc}{\titlerule[2pt]}\thispagestyle{empty}]

\begin{document}
  \tableofcontents

  \chapter{The quick brown fox jumps over the lazy dog}
    \blindtext  % drop in actual document
\end{document}

enter image description here

  • Very nice! I've been trying to use the titlesec package with no success. Thank you very much for showing the way. – binoua Nov 5 '13 at 17:00
  • Once more, the second example is simply perfect. Thanks so much for your help. – binoua Nov 8 '13 at 9:42
  • @Thorsten Donig You're code doesn't work with a bibliography. It makes it appear as another appendix. I want the bibliography to be treated like the introduction or table of contents sections - is this possible? Thanks. – user11128 Jan 28 '16 at 19:57

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.