Page Layout ⇒ Customization of chapter style
Customization of chapter style
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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Customization of chapter style
this can be done with the

Perhaps try, and post what you tried if you have questions regarding it.
Stefan
Customization of chapter style
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
Customization of chapter style
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: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Customization of chapter style
Code: Select all
\titlespacing*{\chapter}{0pt}{0pt}{40pt}
\mainchapterstyle
command.Stefan