2

I'm using LyX (before it was TeXMaker) and I was very happy, I'm a student so you know ... not time at all.

But I see a "bug" or plausibly a mistake, my document is very beautiful all things works good ... if I don't think of the Table of contents.

It just don't appear, but let's place of the picture : Here the page of the table of contents


So it's strange, of course I run (compile) LyX more than twice times but nothing.

Here the picture of what is it in LyX : picture of my doc in LyX (the application)


Here, the code in .LyX :

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language french
\language_package babel
\inputencoding utf8-plain
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format pdf5
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 11
\spacing single
\use_hyperref false
\papersize a4paper
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 1
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style french
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 0 2 13 -1
\bullet 1 2 15 -1
\bullet 2 2 12 -1
\bullet 3 2 14 -1
\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
\noindent
\align center
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
thispagestyle{empty}
\end_layout

\end_inset


\begin_inset Graphics
    filename DATA/logo_CESI.png
    lyxscale 50
    scale 40
    rotateOrigin center

\end_inset


\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash

\backslash
[0.5cm]
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\align center

\series bold
\shape smallcaps
\size larger
CESI - École d'ingénieurs
\series default
\shape default
\size default

\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash

\backslash
[1.5cm]
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\align center

\shape smallcaps
\size larger
Cahier d'étude et de recherche
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash

\backslash
[3cm]
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
noindent
\backslash
rule{
\backslash
linewidth}{0.5mm}
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\align center

\shape smallcaps
\size huge
Type
\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
noindent
\backslash
rule{
\backslash
linewidth}{0.5mm}
\end_layout

\end_inset


\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash

\backslash
[7cm]
\end_layout

\end_inset


\end_layout

\begin_layout Standard
Louis Margot
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
hfill
\end_layout

\end_inset

 Tuteurs : G.
 Renaut,
\end_layout

\begin_layout Standard
CPI A1
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
hfill
\end_layout

\end_inset

 A.
 Chabane
\end_layout

\begin_layout Standard
\align center
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
today
\end_layout

\end_inset


\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*
\noindent

\shape smallcaps
Analyse
\end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Synthèse
\end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Mots-clés
\end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Définition de la problématique
\end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Définition des contraintes
\end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Plan d'action
    \end_layout

\begin_layout Standard
test
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Réalisation du plan d'action
\end_layout

\begin_layout Standard
test
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Validation
\end_layout

\begin_layout Standard
test
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Conclusion
\end_layout

\begin_layout Standard
test
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Bilan
\end_layout

\begin_layout Standard
test
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Part*

\shape smallcaps
Référence
\end_layout

\begin_layout Standard
test
\end_layout

\end_body
\end_document

There is parameters for the table of contents ("table des matières", in french ; "Oui" = 'Yes' ; "Non" = 'No' ; "Partie" = 'Part' ; "Sous..." = 'Sub...' ; "Apparaît dans la TbM" = 'Display (show) in the ToC') : Parameters of the file


So I'm confused. Until Monday 14 I'm in holidays so I can experiment and wait, don't feel obligated to give an answer instantly.

Thanks for reading, I hope we can found the problem and solve it.

Enjoy the life !!!

2 Answers2

1

The problem is that by default, unnumbered sections/parts are not listed in the table of contents. The "numéroté" column refers to whether the titles in the table of contents are numbered, not whether unnumbered sections are included in the table of contents. One solution is to add \addcontentsline commands in custom LaTeX code (i.e., ERT) next to your unnumbered parts. For example, for your first part, you would put the following:

\addcontentsline{toc}{part}{Analyse}

Note that you have to put the command where the unnumbered part is for the TOC to give the correct page number.

For more information, you might find Adding unnumbered sections to TOC useful.

Other information: welcome and great first post to tex.se! I am picky though, so I cannot help but give comments :)

  1. Your example is more complicated than it should be (for example, it includes a graphic that I don't have). Please read https://wiki.lyx.org/FAQ/MinimalExample.

  2. You might find it useful to export to LaTeX and also post the LaTeX here. That will help users who know LaTeX but don't know LyX have an idea of what's going on. Then we can try to adapt the answer to a "LyX answer".

  3. You might be interested in joining a LyX mailing list. We have a lyx-users list and even a French LyX users list: lyx-fr. The French list is low traffic but whenever anyone asks a question I think there is a high success rate of an answer. You can find information on joining the lists at https://www.lyx.org/MailingLists#toc11. It would be great to have someone with such a positive attitude as yourself around the lists. I hope you solve this problem quickly so that you can enjoy your holiday!

scottkosty
  • 13,164
0

you can found the file in .TeX here :

%% LyX 2.3.4 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,a4paper,french]{article}
\usepackage[T1]{fontenc}
\setcounter{secnumdepth}{1}
\usepackage{pifont}
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\special{papersize=\the\paperwidth,\the\paperheight}


\AtBeginDocument{
  \def\labelitemi{\ding{112}}
  \def\labelitemii{\ding{114}}
  \def\labelitemiii{\ding{111}}
  \def\labelitemiv{\ding{113}}
}

\makeatother

\usepackage{babel}
\makeatletter
\addto\extrasfrench{%
   \providecommand{\og}{\leavevmode\flqq~}%
   \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%
}

\makeatother
\begin{document}
\noindent \begin{center}
 \thispagestyle{empty}\includegraphics[scale=0.4]{DATA/logo_CESI}\\[0.5cm]
\par\end{center}

\begin{center}
\textbf{\textsc{\Large{}CESI - École d'ingénieurs}}\\[1.5cm]
\par\end{center}

\begin{center}
\textsc{\Large{}Cahier d'étude et de recherche\\[3cm]}{\Large\par}
\par\end{center}

\noindent\rule{\linewidth}{0.5mm}
\begin{center}
\textsc{\huge{}Type}{\huge\par}
\par\end{center}

\noindent\rule{\linewidth}{0.5mm}\\[7cm]

Louis Margot\hfill Tuteurs : G. Renaut,

CPI A1\hfill A. Chabane
\begin{center}
\today\newpage{}
\par\end{center}

\tableofcontents{}

\newpage{}

\part{\textsc{Analyse}}

test\newpage{}

\part{\textsc{Synthèse}}

test\newpage{}

\part{\textsc{Mots-clés}}

test\newpage{}

\part{\textsc{Définition de la problématique}}

test\newpage{}

\part{\textsc{Définition des contraintes}}

test\newpage{}

\part{\textsc{Plan d'action}}

test\newpage{}

\part{\textsc{Réalisation du plan d'action}}

test

\newpage{}

\part{\textsc{Validation}}

test

\newpage{}

\part{\textsc{Conclusion}}

test

\newpage{}

\part{\textsc{Bilan}}

test

\newpage{}

\part{\textsc{Référence}}

test
\end{document}

ps : it's the file without the mistake for the table of contents.