0

This question already has an answer here:

Here is my problem : in the titles of my sections and subsections, labels don't appear, leaving titles with only text (no numbers as "1.1.", etc.). A important remark is that this problem does not occur when building my document on another computer (at work)... I have no other problems with my document, and every other labeling (cross references for instance) works perfectly fine.

I use the texlive package. Here is a MWE, showing all the packages I use for my document, and the corresponding output :

\documentclass[a4paper,11pt,oneside,fleqn,openany]{book}

% ========
% PACKAGES
% ========
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{array}
\usepackage{arydshln}
\usepackage[english]{babel}
\usepackage{calc}    
\usepackage{color}   
\usepackage{empheq}  
\usepackage{fancyhdr}
\usepackage[T1]{fontenc}
\usepackage[top = 2 cm, bottom = 2 cm, inner = 2 cm, outer = 2 cm]{geometry}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}  
\usepackage[charter]{mathdesign}
\usepackage{microtype}
\usepackage{multirow}
\usepackage[final]{pdfpages}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{tocbibind}

\usepackage{varioref}

\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\chapter{First chapter example}

\section{First section example}
\subsection{First subsection example}
\subsection{Second subsection example}

\section{Second section example}

\end{document}

![enter image description here]1

Any ideas ?

marked as duplicate by Johannes_B, Stefan Pinnow, Werner sectioning Aug 27 '16 at 18:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Following the link of touhami in his/her comment on my above post, I tried the solution of egreg, which consists in the following five lines to add just after the \usepackage{titlesec} :

\usepackage{etoolbox}
\makeatletter
\patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}{}{}
\patchcmd{\ttlh@hang}{\noindent}{}{}{}
\makeatother

After that, my problem was solved. Thanks a lot touhami for your reference !

Not the answer you're looking for? Browse other questions tagged or ask your own question.