Hi there..
I'd like to be able to customize the style of my chapter headings. I've been looking at different chapter styles for the memoir-class (though I'm using the report documentclass), but I'm having difficulties understanding the original code for these styles.
I'd like my chapter heading style to be like this:
At the left, the chapter number (e.g. Chapter 1), and being able to control the font style and size. At one line beneath, flushed right, the chaptertitle. Right to the chaptertitle I'd like a vertical rule with the same hight as the chaptertitel.
However, the chapter style of my ToC - and the sections before that - must not be changed, so I need to be able to control when this style shall aply!
Can anyone help me achieve this!?
Thanks in advance!
\David
Page Layout ⇒ Customization of chapter style
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Customization of chapter style
Hi David,
this can be done with the
titlesec package. Besides just documentation, the manual contains an appendix which explains how the standard headings are typeset. I think this is a good start, copying this and customize it.
Perhaps try, and post what you tried if you have questions regarding it.
Stefan
this can be done with the

Perhaps try, and post what you tried if you have questions regarding it.
Stefan
LaTeX.org admin
Customization of chapter style
Alright, this is what I've done so far
However, I still got two issues.
- The first is that I would like to decrease the horisontal space in which the chaptertitle is written. When I have long titles, sometimes a single word is placed on the next line, which doesn't look good.
- Also the space from the top of the page to \thechapter is too big.
I've been looking at the \titlespacing command, but I can't get this to solve the problem.
How do I solve these problems!?
David
Code: Select all
\usepackage{titlesec}
\newcommand{\mainchapterstyle}{%
\titleformat{\chapter}[display]%
{\flushright \Huge\bfseries}%
{\flushleft \Large\sc Chapter \thechapter}%
{1.0em}{}}
- The first is that I would like to decrease the horisontal space in which the chaptertitle is written. When I have long titles, sometimes a single word is placed on the next line, which doesn't look good.
- Also the space from the top of the page to \thechapter is too big.
I've been looking at the \titlespacing command, but I can't get this to solve the problem.
How do I solve these problems!?
David
Last edited by DavidH on Sat Apr 14, 2012 11:55 am, edited 1 time in total.
Customization of chapter style
I just found some code that, partly, solves the problem with too much white space above the chapter title / label:
This, however, also reduces the white space when I do the starred version of the headings, e.g. \chapter*, and is not what I want. How do I either alter the above code not to change the starred chapters, or incorporate it in \titleformat command?
Code: Select all
\makeatletter
\let\@makechapterheadOLD\@makechapterhead
\renewcommand{\@makechapterhead}{\mbox{}\vspace*{-50pt}\@makechapterheadOLD}
\let\@makeschapterheadOLD\@makeschapterhead
\renewcommand{\@makeschapterhead}{\mbox{}\vspace*{-50pt}\@makeschapterheadOLD}
\makeatother
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Customization of chapter style
You could use, for example,
within your
Stefan
Code: Select all
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
\mainchapterstyle
command.Stefan
LaTeX.org admin