After reinstalling TeXLive distribution (install-tl-20160318, Ubuntu 14.04), a issue occurs with the updated version of the titlesec package: the section numbering is lost.

What could it be missing? Is there a modification I have not seen?

Below is a MWE comparison of the two versions. The prevtitlesec package is a reinstall of the previous version (2011/12/15).

%\usepackage{prevtitlesec}% 2011/12/15 version
\usepackage{titlesec}% 2016/03/15 version


\chapter{Title of the first chapter}
\section{A test section}
\subsection{A test subsection}
\subsection{A test subsection}


titlesec package 2011/12/15:


titlesec package 2016/03/15:

enter image description here


2 Answers 2



The issue has been solved with titlesec version 2.10.2 (released 2016/03/21)

Original answer

The bug in the new version 2.10.1 is not properly starting horizontal mode as it was done previously.

You can cure the bug by adding



after \usepackage{titlesec}.

Here is the “proper” code for \ttlh@hang (titlesec.sty line 746)

     \leavevmode % <------ MISSING
          \box\z@ % \noindent was redundant

enter image description here

  • 1
    Many thanks for the patch and your instrutive explanations.
    – ejazz
    Mar 22, 2016 at 10:02
  • Thanks for the code! This was driving me crazy after I've updated my installation. I've just mailed the developer regarding this issue. Hope it will be fixed in an upcoming update.
    – fdiog
    Mar 22, 2016 at 16:37
  • Thanks for the solution. This question has been around since a week yet today I updated my TeX installation and ran into the same problem, and the report is due tomorrow! Although this one is the cure, it's a bit overkill to me :) For a temporal solution, I'll build the final output on another PC which has the old set of packages :)
    – Jim Raynor
    Mar 22, 2016 at 22:19
  • @JimRaynor Just the first five lines are necessary; the rest is the complete macro definition, but the patch is easier.
    – egreg
    Mar 22, 2016 at 22:30
  • 2
    @JimRaynor fixed: new version titlesec
    – touhami
    Mar 23, 2016 at 13:50

For Ubuntu 16.04 with texlive:

sudo wget http://mirrors.ctan.org/macros/latex/contrib/titlesec/titlesec.sty -O /usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty

For other Linux distros:

First run locate /titlesec.sty then adapt the previous code.

Local tree for a single non-admin user:

mkdir -p ~/texmf/tex/latex/titlesec/ ; wget http://mirrors.ctan.org/macros/latex/contrib/titlesec/titlesec.sty -O ~/texmf/tex/latex/titlesec/titlesec.sty

  • 9
    long life to you Sir!
    – PeterB
    Apr 21, 2017 at 19:47
  • 3
    I am not sure, but maybe it is a better idea to put it in your personal texmf instead. The command in my case is wget http://mirrors.ctan.org/macros/latex/contrib/titlesec/titlesec.sty -O ~/texmf/tex/latex/titlesec/titlesec.sty. You have to make sure the directory already exists. Jul 31, 2017 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .