Many books, theses and reports are written in LaTeX using the report
or book
document classes. Often, the authors make use of the default chapter style. There are, however, a great number of alternative styles available, some of which being very fancy or playful. This post is a collection of alternative chapter styles available, some as packages, others simply in form of LaTeX code.
Default chapter style
The default chapter style is often used in (academic) books and theses. Here is an example:
\documentclass{report} \begin{document} \chapter{Default Chapter Heading} \end{document}
Package titlesec
The titlesec package allows basic changes to the standard chapter style, including setting the font style and size or placement of the title. You can do great things with titlesec
package and the titleformat
command in particular, just be creative (and let me know below)!
Here is a neat example:
\documentclass{report} \usepackage[T1]{fontenc} \usepackage{titlesec, blindtext, color} \definecolor{gray75}{gray}{0.75} \newcommand{\hsp}{\hspace{20pt}} \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries} \begin{document} \chapter{Less is More} \blindtext \end{document}
See the documentation for more details.
Package fncychap
The fncychap package has a nice set of predefined chapter styles. The style is set through the optional argument when loading the package. Available styles include: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, and Bjornstrup. The package documentation has examples for all available styles. The package will use the LaTeX default chapter style in case the optional argument is not set (i.e. \usepackage{fncychap}
).
\documentclass{report} %Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup \usepackage[Sonny]{fncychap} \begin{document} \chapter{Sonny} \end{document}
Examples of Glenn and Bjornstrup chapter styles provided from the fncychap
package:
Chapter styles with memoir
The memoir document class is more flexible in terms of chapter styles than report or book.
I will not go into detail since there is extensive documentation on the memoir document class (see page 83 onwards). Furthermore, there is additional documentation describing the memoir chapter styles including code examples and output. Below you’ll find one of the examples taken from that document named hansen
.
\documentclass{memoir} \usepackage[T1]{fontenc} \usepackage{kpfonts} \setSingleSpace{1.1} \SingleSpacing \usepackage{xcolor,calc, blindtext} \definecolor{chaptercolor}{gray}{0.8} % helper macros \newcommand\numlifter[1]{\raisebox{-2cm}[0pt][0pt]{\smash{#1}}} \newcommand\numindent{\kern37pt} \newlength\chaptertitleboxheight \makechapterstyle{hansen}{ \renewcommand\printchaptername{\raggedleft} \renewcommand\printchapternum{% \begingroup% \leavevmode% \chapnumfont% \strut% \numlifter{\thechapter}% \numindent% \endgroup% } \renewcommand*{\printchapternonum}{% \vphantom{\begingroup% \leavevmode% \chapnumfont% \numlifter{\vphantom{9}}% \numindent% \endgroup} \afterchapternum} \setlength\midchapskip{0pt} \setlength\beforechapskip{0.5\baselineskip} \setlength{\afterchapskip}{3\baselineskip} \renewcommand\chapnumfont{% \fontsize{4cm}{0cm}% \bfseries% \sffamily% \color{chaptercolor}% } \renewcommand\chaptitlefont{% \normalfont% \huge% \bfseries% \raggedleft% }% \settototalheight\chaptertitleboxheight{% \parbox{\textwidth}{\chaptitlefont \strut bg\\bg\strut}} \renewcommand\printchaptertitle[1]{% \parbox[t][\chaptertitleboxheight][t]{\textwidth}{% %\microtypesetup{protrusion=false}% add this if you use microtype \chaptitlefont\strut ##1\strut}% }} \chapterstyle{hansen} \aliaspagestyle{chapter}{empty} % just to save some space \begin{document} \chapter{Hansen Memoir Chapter Style} \blindtext \end{document}
Styling the chapter
Henrik Stuart wrote this article in 2007 with a series of great chapter styles. They are also based on the memoir document class and the PGF/TikZ package. Here is an example that I like a lot, simply beautiful!
\documentclass{memoir} \usepackage{tikz, blindtext} \makechapterstyle{box}{ \renewcommand*{\printchaptername}{} \renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries} \renewcommand*{\printchapternum}{ \flushright \begin{tikzpicture} \draw[fill,color=black] (0,0) rectangle (2cm,2cm); \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter }; \end{tikzpicture} } \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries} \renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1} } \chapterstyle{box} \begin{document} \chapter{Fancy chapter with TikZ} \blindtext \end{document}
A few more resources worth checking out
I found a discussion on tex.SX quite enlightening with lots of rather fancy chapter style examples.
This greatly colored example is another chapter style based on PGF/TikZ and titlesec. You can get the code and screenshots from texblog.net or texample.
Did I forget anything? Drop me a comment.
Thanatos
Thank you…
BG
I really like the “Less is More” style – it’s just what I’ve been looking for. Thanks!
tom
Thanks for dropping a comment! Appreciate it. Tom.
Ole J. Forsberg, Ph.D.
First of all: Tom, thank you for an excellent source of TeX and LaTeX information. I reference it frequently.
Second: I just wrote an include for making my chapters look good (to me). Here is the code:
I like the effect (others may not). I offer it PD.
tom
Hi Ole,
Thanks for sharing the code! For others to use it the way you designed it however, you would also have to provide the jpg and some things that got lost from the preamble like which packages you load and the color definition of
chapterbackground
. If you agree, I will send you an e-mail so you can attach the picture. Or if you have a place to upload it to, just send me the link.Looking forward to seeing your chapter style!
Thanks, Tom.
Adil
Sir; can you give complete code plz; a running one; Thanks anyways
tom
Hi Adil,
I provided complete minimal working example for all chapter styles. Please let me know which example is not running.
Thanks, Tom
Harsha
Thank you.
JK
Wonderful examples. I’m always looking for customisations of these types, of which your blog is full of, to finesse my thesis. Thank you.
The new chapter definitions however, don’t seem to work on unnumbered chapters (ie. \chapter*{Name of Unnumbered Chapter})
Any thoughts?
Cheers,
tom
Please tell me which style you are having problems with and I will look into it. Thanks, Tom.
JK
Initially I have been playing around with your more is less style and the titlesec package.
Cheers,
JK
tom
Hi JK,
I works perfectly for me (see the code below). Please provide a minimal example illustrating the problem.
Best, Tom.
JK
Cheers Tom. The code is working fine for me now too. I must have had something commented out before, else some other random oddity was present.
tom
Great, I’m glad it worked out. Thanks for the feedback! Tom.
Nazma
hi,
I use latex in linux (ubutu). Please tell me how I use fancychapter. For using the same I am have to download any package. From where I download it and tell me the stps.
tom
Hi Nazma,
Thanks for your question. You are right, the
fancychapter
package is not included in the standard TeX distributions. However, you can get the style file here. The easiest way would be to just keep the file in your project folder where your tex-file is located. Apart from loading it, that’s all you need.Hope it works.
Best, Tom.
Phil
Thank you so very much! Been looking all over for this…
Prakash
Thanks for the nice post. This is very helpful. Is there anyway I can give author names and affliations beneath the chapter title?
tom
Hi Prakash,
You may find the answer to a similar question on tex.SX useful.
HTH, Tom.
Hassan
Good work. Thank you for the post. You are doing a great job.
tom
Thanks Hassan!
Rafik Margaryan (@raffdoc)
Hi Tom,
I liked very much the “Less is More” style.
But it creates a problem for me!
It eats practically APPENDIX word but after comes appendices with letter: A,B etc.
How can I fix this?
Many thanks.
tom
Hi Rafik,
Thanks for your question. I’m not sure whether I understand your problem. Please provide a minimal working example which I can run on my computer.
Here is some code that adds the word Chapter and later Appendix to the title. You might find this useful.
Rafik Margaryan (@raffdoc)
Thank you very much, indeed!
But I truly satisfied with the chapter having only number without word “chapter”. I would like only to Have Appendix word before A, B etc appendices !
Could you help with this?
Tanks in advance.
tom
Hi Rafik,
A possible solution is to use the code I provided below with a minor modification, set
\chaptername
to “empty” for regular chapters. Here is the code:Rafik Margaryan (@raffdoc)
Thank you very much Tom!
Sarang
Hi…..!
for thesis chapter lay out, i want a particular design, but i couldn’t able to paste an image of that design, how can I post that image for further corresponding, in order to need code for that designing.
Currently I am using following package:
%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\usepackage[Sonny]{fncychap}
tom
Hi,
You can upload it to Dropbox, Picasaweb, Facebook, Flickr, Instagram, anywhere you like and share the link.
if you would rather not post the design publicly, you can get in touch here.
Cheers, Tom
Alexandre Jaguar F. Siqueira
Hi Tom,
first of all, thanks dude. I’ve favourited your page, btw, many useful info here.
I have a question, what about just “Chapter 1 – Name_of_the_chapter”? How could I do that?
Thanks again, keep up the great work.
See ya!
tom
Using the
titlesec
example from above with a few minor modifications:Alexandre Jaguar F. Siqueira
Great Tom! Thanks for your help.
That was a hand in the wheel, hahaha! I’ll use that to generate a thesis model to use in my doctorate program.
Thank you very much!
Sarang
Hi TOM,,,,,
I am also sending a link contained a PDF file for a particular chapter design, that i want for my thesis..
https://www.dropbox.com/s/jrgzuzt2z2r1km1/Chapter%20style.pdf
thanks…….
tom
Thanks for the link.
I’m generally happy to help with problems. However, if you are asking me for code, at least try yourself first, please. Most of the information can be found in the post above and package documentation.
Anyway, here is what I came up with:
Sarang
thanks tom……
Since I am beginner in Latex, that’s why asked for the code, I have tried, but due to some minor errors I didn’t do it. Well after referring your code, I got it, . . . . . I have rectified many things by visiting this blog, really great job,,,,,
once again thanks for code…..
cheers.
tom
That’s ok. Please consider creating a minimal working example next time that would let me reproduce the minor errors. By doing so, there is a good change you find a solution and by posting it on my blog, you will help other people with similar issues.
Matthias
Hi Tom,
Thanks for the extremely usefull information. Personally I very much like the ‘less is more’ style for my thesis. I was wondering though if it were possible to add two horizontal lines: one above and one underneath the title. Is there an easy way to do this?
Either way, thanks a million ! Your resumation was clear and very helpfull.
Greetings,
Matthias
Matthias
I think I figured it out, but my way might not be according to LaTeX etiquette. My code:
tom
Hi Matthias,
Sorry it took me so long to get back to you. I’m glad you found a solution that works. Thanks for posting it here. Alternatively, you one could also add the top rule with
format
(see the documentation).Cheers,
Tom
Sousa
Really nice! Thank you very much, Less is More rules! 😀
tom
Thank you!
Hedi Naily
Hi, I’d like to put the chapter title in the center of a separate page. How to achieve this
tom
Hey!
Thanks for your question. Try this and let me know what you think:
Govind
Hi Tom,
I am using the book class for writing my thesis. I am happy with its formatting but I have a issue with its chapter title. It consumes a lot of vertical space and comes in the middle of the page. Is there a way to keep the chapter heading at the top like this:
Chapter 1
Power System Analysis and Optimization
Regards,
Govind
tom
I didn’t quite catch whether you wanted to center the heading horizontally. Below is an example that should give you enough flexibility to customize the chapter heading to your needs.
Cheers, Tom.
Max Horn
Seems the image links in this blog post are broken :-(… Any chance to get them restored
tom
Thanks for the notification, I’m working on it 🙂
shastry
Hi Tom,
I am writing my thesis in latex. I just want to change the
font size of chapter title (by default it is very big). I used the titlesec package. But the problem is now “Chapter #” disappear and it just appears “# followed by Introduction”.
I used
and the result is
#
Introduction
I
want to display it as
Chapter #
Introduction
or is there any other way to change the font size interactively?
Thanks you very much
shastry
tom
Hi Shastry,
Thanks for your comment. I tried your code and it seems to work fine. Here’s a minimal working example:
If this doesn’t help, please provide a similar complete example and I’ll be happy to take a look.
Cheers, Tom
anantmdixit
Thank you very much. 🙂
Adil
The text size should be 12; in less is more; and less is less
tom
The default font size for all standard document classes is
10pt
. You can change it to12pt
using:HTH, Tom
Adil
Thanks …. i did it, do you have some beautiful thesis template with nice looking chapters?
tom
Hi Adil,
Thesis templates are frequently provided by the university and there is not a lot of flexibility. If your institution doesn’t provide an official template, you might use any of the chapter styles described in the post above and change them to your liking. Also, it may be worthwhile to take a look at templates from other universities and adapt them according to your needs/preferences.
HTH, Tom
Emiliano Amendola
Tom, is there a way that i can change the language of the default “Chapter 1” ? I need it to say “Capitulo 1”, for example in the “daleif1” chapter style at the top right chapter numeration. I’m using the spanish language package but nothing changes, i think the problem is the default configuration of the chapter style.
Thanks..
tom
Dear Emiliano,
Thanks for your question. I removed the code as I wasn’t able to run it. If you’d like me to look at your code, please provide a minimal working example that I can copy-paste (similar to the example below). In general, you can set the language through babel. This works for me in the example. Alternatively, you can manually redefine
\chaptername
(code commented out). These approaches are not the same however. Babel also changes the language of other keywords like “Contents”, “List of Figures”, etc.Best, Tom
Emiliano Amendola
Thanks for the reply Tom, but the “\renewcommand\chaptername” suggestion isn’t working, i post here a snippet to see what the problem is, at page 7 the first chapter “Introducción” is generated with “Chapter 1” caption at the top right corner numeration, and subsecuent pages are generated with “Chapter 1. Introducción ” at the header note
tom
Hi Emiliano,
Thanks for the code. The problem is that you use babel with the option
spanish,english
which sets it to English. The latter overwrites the former. What you’ll have to do is load babel withspanish
only. If you see an error, try commenting out the first line (nag package), it seems to only work withenglish
.Nice chapter style by the way.
Best, Tom.
Emiliano Amendola
Thanks again Tom, but unfortunately i do have an error, even i’ve commented out the line “\RequirePackage[l2tabu]{nag}”. The error goes:
Introduccion.tex:7:
Argument of \@firstofone has an extra
}.
\par
l.7 \chapter{Introducción}
tom
Well, it says there is an extra closing brace “}”.
andreasm
Hey Tom,
First of all thanks for this awesome tutorial!
I am currently trying to put your “Less is more” style to the template I am using but for some reason, the text of the chapter won’t show up !
It would be awesome if you could help me !
tom
Hi Andreas,
I’m glad you like the chapter style. I hope you don’t mind that I shortened your code to the most relevant bits. The code works if you load
titlesec
without theexplicit
option. Please see the titlesec package documentation for more details.Cheers, Tom
andreasm
Wow awesome,
Thank you very much Tom and thanks for the explanation, didn’t figure out it could have its origin in the way the package was loaded.
Cheers,
tom
No problem, glad to help. Best wishes.
Martins
Could you please tell me how to make a chapter look like this:
(supposing I am using \usepackage[latin]{babel} for the sake of editing a latin text)
De Lusitanae oppida celebriora
Caput undeuicesimum
That is, the numbering in full and with words (not numbers) and after the name of the chapter (that is how the manuscript has it).
Thanks a lot.
tom
Hi Martins,
Thanks for your question. Rearranging the chapter heading is fairly straight forward using the titlesec package. Whereas producing the number as a word is more tricky. Either do it manually with an array-like structure or email the authors of the fmtcount package to add support for latin.
Hope this helps,
Tom
Alexander
Hi Tom
I really like the Less is More style. However it seems to overwrite my footer. The page numbering on the chapter sides are different from the other pages. I would like them to be identical. My footer is defined as:
Do you know how I can fix this issue?
tom
Hi Alexander,
Thanks for your comment. By default, for pages with a chapter heading the page-style
plain
is used. The example below shows how to change that.Best,
Tom
Alex
Thanks Tom!
Dreni
I dont have any idea why, but by writing $|$, the line showed up vertically.
tom
Hi Dreni,
Thanks for your comment. Isn’t that what you would expect? Can you provide a minimal working example to illustrate your problem, please?
Best, Tom
Corli
Hi. I am trying to use the ‘less is more’ chapter style. It works perfectly fine, except that the \chapter* command produces no title. Can you please assist?
tom
Hi Corli,
When I use a starred chapter in the example from the post it works as expected. Can you please provide a minimal working example to illustrate your problem.
Thanks, Tom
qaqcvccc
Thanks, it helps me a lot