[Tex/LaTex] Higher sections like Part are missing in the table of contents

lyxtable of contents

I am using LyX.

My document uses Part*, Section*, Subsection*, Subsubsection* sections, and babel with \usepackage[english,frenchle]{babel}. With the memoir document template, only Subsection* and Subsubsection* appear in the TOC, not the Section* nor Part*. With the LyXBook template, none at all, just the "Table of Contents" title.
My document was built with a huge use of awks, sed helpers, from a LbreOffice document. Though it compiles to produce a pdf, I may have broken something ?

EDIT : Below my MWE that fails with LyXBook – only parts appear in the TOC (but works with memoir).

What may have I broken ? Or what I could try to add in the preambul to make it work ?

EDIT: I suppressed the stars in the sections. Actually, they appear in the TOC and still I can suppress the numbering. As this MWE is from scratch, I did not break anything except a misuse of the stars in sections declarations (in the new MWE below, I have suppressed the stars).

So the remaining question is: can I have a more complete TOC, including Section and Subsection?

#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass LyXBook--Default
\use_default_options true
\begin_removed_modules
Endnote
\end_removed_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 1
\tocdepth 1
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Part
pppppp
\end_layout

\begin_layout Section
ssssssss
\end_layout

\begin_layout Standard
gergerg ertert
\end_layout

\begin_layout Subsection
xxxxxxxxxxxxx
\end_layout

\begin_layout Subsubsection
cccccccccc
\end_layout

\begin_layout Standard
fgergergerg rgterg
\end_layout

\end_body
\end_document

Best Answer

Finally, the solution is, following Torbjørn T & Gonzalo Medina advices:

  • Sections with a star like Section* permits to not put a section title in the TOC. So, one have to use the unstar section version.
  • Configure in Document --> Settings --> Numbering & ToC: tocdepth which specifies the lowest section level to put in the TOC, and secnumdepth which specifies the lowest section level to number.
Related Question