logo logo

Titlesec package for LaTeX

Updated: 2011-12-21

The titlesec bundle is a set of 3 packages for sectioning titles — when used as such (titlesec), in headers and footers (titleps) and in tables of contents (titletoc). They can be used separately, but you will get most of them when used together. The goal is to provide new features unavailable in current LaTEX, such as:


Different classes and “shapes” of titles, with tools for fancy formats (like margin and “wrap” titles). You can define different formats for left and right pages, or numbered and unnumbered titles, measure the width of the title, add a new section level, use graphics and rules, and many more.


TOC entries, with the possibility of changing the format in the middle of a document, grouping the entries in a single paragraph, pretty free-forms entries, partial tocs, etc.


Page styles with an one-stage higher-level mechanim, without intermediate \leftmark’s or \rightmark’s. Also top marks correctly syncronized with titles, even with floats; access to top, first and bot marks in a single header/footer; rules; headers/footers for specific floats (kinda \thispagestyle); multiple sets of marks, etc.

Examples for titlesec

In the following examples the program fully automates the format and no manual intervention is required to readjust individual titles. In the first one, there is a rule of dots whose width is that of the longest line plus 2 pc:

Sample 1

The wrap style measures the title and wraps the text around it:

Sample 2

Finally a margin title with a rule above both title and text.

Sample 3

Free downloads

Download page for titlesec
ttltips.pdf. Tips and tricks (in progress, PDF, 55k).

Bugs, feature requests and known issues

Due to an internal optimization when \boxing text, run-in titles are not correctly splitted at a line end if there is a hyphen or a dash. I’ve found no way to fix it without breaking, for example, color. Well, a “fix” is to use luatex, which has removed this optimization (fortunately). While intended for efficiency reasons, the original behaviour es clearly a misfeature.

Feature request: Opción uppercase
Sent by: Gonzalo Medina Arellano (2010-03-31)
Status: Closed (released)

Añadir a las opciones «rápidas» (opciones de paquete) una para convertir los títulos a mayúsculas.

Feature request: Compatibility with ltxdoc
Sent by: GL (2011-03-20)
Status: Pending

Add compatibility with ltxdoc, which changes lots of catcodes (including %).

Bug: assignpagestyle doesn’t work properly
Sent by: Valentino Mariotto (2011-01-27)
Status: Closed (released)

When using \titleformat on a command, \assignpagestyle no longer works.

A present?

The packages listed here are free – you don’t have to pay anything to use them. However, if you have found them useful enough as to give me a little present, I would be very grateful. Just go to the following wish list at Amazon.


You might consider supporting the development of these packages with a donation, too.

© 2000-2023 Javier Bezos • www.texnia.comjbezos.github.io