[Tex/LaTex] Number chapter disappeared

chaptersnumbering

I have no idea what happend. I had to reset TexStudio because it didn't show me the preview. Now there isn't chapter's numbers.
Before I had: Chapter 1, Chapter 2 etc. with its title. Now there's only the title without "Chapter 1", …
Sections starts from 0 and go on to the end of the document. Before the section in Chapter 1 was 1.1, 1.2 etc. Now 0.1, 0.2 0.100

This is the code

\documentclass[a4paper,italian,oneside,openright,12pt,draft]{book}
\usepackage{cmap} % makes PDF searchable
\usepackage{babel}
\usepackage[latin9]{inputenc}
\usepackage{lmodern} % Latin Modern font
\usepackage[T1]{fontenc}
\usepackage{textcomp} % needed for fontenc
\usepackage[bookmarksnumbered,final]{easyoutput}
\makeindex
\usepackage[binding=0.8cm]{layaureo}  % migliore copertura foglio A4 + margine rilegatura
\usepackage{tocbibind} 
\usepackage[labelfont=bf]{caption}[2004/07/16] % didascalie figure
\usepackage{indentfirst}
\usepackage{subfig}
\usepackage{float}
\usepackage{tabularx}
\usepackage{wrapfig}
% tabelle
\usepackage{booktabs}
\usepackage{tabulary}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
    \frenchspacing
    \frontmatter

\tableofcontents
%\listoffigures


\input{introduzione}


\input{capitolo1}
\input{capitolo2}
\input{capitolo3}

\backmatter

\medskip

\bibliographystyle{unsrt}
\bibliography{bibliografia}


\end{document}

In capitolo1 (=Chapter 1) I start the file with \chapter{}
It's not caused by \chapter*{}. Before the reset everything worked correctly.

Best Answer

\frontmatter removes the \chapter numbering, so you'll have to use \mainmatter somewhere... either in introduzione.tex or capitolo1.tex. However, I'd place it inside your main TeX file since it aids in the visible document structure.


\frontmatter is defined like this inside book.cls:

\newcommand\frontmatter{%
    \cleardoublepage
  \@mainmatterfalse
  \pagenumbering{roman}}

It sets the \if@mainmatter switch to false, which is used inside \@chapter to set a numbered chapter:

\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
Related Question