# titlesec: different formats for numbered and unnumbered sections/chapters

I'm not sure if this is too minimal. (In the real document the problem appears at the bibliography, table of contents and \chapter*)

\documentclass[a4paper, 11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[left=2cm,right=2cm,top=3cm,bottom=3cm]{geometry}

\usepackage{titlesec}

\begin{document}
\chapter*{Not numbered}
\chapter{Numbered}
\end{document}


How do I get the \thechapter\quad to not apply for unnumbered chapters?

• For numbered chapters, do you want the chapter number and chapter title on the same line or on different lines.? This is not clear from your code. May 16 '15 at 16:24
• @Bernard Same line May 16 '15 at 16:26
• So my proposition was correct. Chapter title is left-aligned. Also, do you want unnumbered chapters to appear in the table of contents? May 16 '15 at 16:28
• @Bernard Yes. I currently use \addcontentsline{toc}{chapter}{Preface} locally, but is it possible automate that operation? May 16 '15 at 16:32
• Yes. See my updated answer. You have to load titlesec with the explicit option. And hypothetically use titletoc to define a correct formatting of unnumbered chapters in the table of contents. May 16 '15 at 17:22

As far as I understand what you want to do, you should use the blockstyle. Add something like this to your preamble:
\usepackage[explicit]{titlesec}

\titleformat{\chapter}[block]{\normalfont\LARGE\bfseries}{\thechapter}{1em}{#1}