1

I'm having a problem with titlesec's explicit option. Here's an MWE:

\documentclass{book}
\usepackage[explicit]{titlesec}

\titleformat{\chapter}[block]{}
{#1}{0pt}{}

\begin{document}

\tableofcontents
\chapter{hi there}

\end{document}

In this example code, we redefine the \chapter command. In my real example, I use the explicit option because I need to pass the title of the chapter to a complicated Tikz code. However, as it's written, the \chapter* of \tableofcontents doesn't display any heading at all.

The question is: how do you work titlesec when the explicit option is on, to allow the printing of starred chapters?

2
  • May be this answer for section can help you: tex.stackexchange.com/a/380116/120578 . You can use the same code for chapter instead and keep or not keep the old definition
    – koleygr
    Jan 14, 2018 at 14:05
  • 1
    You need to add an \titleformat command for the numberless chapters too. See the linked duplicate for an example.
    – Alan Munn
    Jan 14, 2018 at 14:18

0

Browse other questions tagged .