-1

When I compile my thesis.tex file which is compiled fine including the \addchap, I noticed that I have used \usepackage{unnumberedtotoc}. When I want to use my thesis.tex file on another computer it says tex capacity exceeded, sorry [input stack size=5000]. When I uncomment \usepackage{unnumberedtotoc}, it says ! undefined control sequence \addchap. Here I have pasted all the beginning of the packages that I have used in my thesis but I still get some problems in compilation, I don't know why, but I think if I can compile this code, then I can solve the problem :

 \immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass[12pt]{report}
\DeclareMathSizes{12}{30}{16}{12}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{lineno}
\usepackage{amsmath}
 \usepackage{array, nccmath}
 \usepackage[nottoc]{tocbibind}
\newcolumntype{L}{>{$}l<{$}}
\newcolumntype{m}{>{\displaystyle}l}
\usepackage{framed}
\usepackage{cclicenses}
\usepackage{makecell}
\usepackage[french]{babel}
\usepackage{setspace}
\usepackage{mathptmx}
 \usepackage{multirow}
 \usepackage{gensymb}
 \usepackage{empheq}
  \usepackage{mathtools}
  \usepackage{array}
  \renewcommand{\arraystretch}{1.9}
  \newcolumntype{P}{>{\centering\arraybackslash$}p{1.6em}<{$}}
  \newcolumntype{C}{>{\centering\arraybackslash$}c<{$}}
  \usepackage{makecell}
  \usepackage{booktabs}
  \usepackage{subcaption}
  \usepackage[intoc]{nomencl}
  \makenomenclature
  \setcounter{secnumdepth}{4}
  \setcounter{tocdepth}{4}
  \usepackage[justification=centering]{caption}
   \usepackage{etoolbox}
    \usepackage{unnumberedtotoc} %https://github.com/johannesbottcher/unnumberedtotoc/
    \usepackage[automark,
    plainheadsepline,
    headsepline,
    plainfootsepline,
     footsepline,
    markcase=ignoreupper]{scrlayer-scrpage}
   \clearpairofpagestyles
   \ihead*{\leftmark}
   \cfoot*{\pagemark}
   \setkomafont{pageheadfoot}{\scshape}
   \usepackage{titlesec}
   \graphicspath{{imagesthesis/}}
   \def\frenchlistfigurename{Liste des figures}
   \usepackage[a4paper,right=20mm,left=25mm,top=26mm, bottom=26mm]{geometry}
   \makeatletter
   \titleformat{\chapter}[display]
   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
   % this alters "before" spacing (the second length argument) to 0
   \titlespacing*{\chapter}{0pt}{0pt}{20pt}
   %\patchcmd{\@makechapterhead}{\vspace*{20\p@}}{}{}{}% Removes space above \chapter head
   %\patchcmd{\@makeschapterhead}{\vspace*{20\p@}}{}{}{}% Removes space above \chapter* head
   \makeatother
   \title {itle of the thesis}
   \titleformat{\paragraph}
   {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
   \titlespacing*{\paragraph}
    {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}



 \usepackage[thin, , thinc]{esdiff}
 \usepackage{subcaption}
 \usepackage{caption}
 \usepackage{framed}  
 \usepackage{nomencl} 
 \setlength{\nomitemsep}{-\parskip}\usepackage{booktabs,multirow}
 \renewcommand{\cellset}{\renewcommand{\arraystretch}{0.5}}

 \begin{document}
 \renewcommand\arraystretch{0.8}
%\noindent
 \doublespacing
 \maketitle
 \tableofcontents
%\listoffigures
 \addchap{Publications et communications}

 \section*{$\:$  a. Publications:}
 \section*{$\:$  b. Communications:}
 \addchap{Remerciements}
 \end{document}
Vincent
  • 20,157

1 Answers1

0

I don't know what \addchap does (texdoc unnumberedtotoc returns nothing) but I'm guessing that it generates an unnumbered \chapter and possibly adds it to the ToC. The general way of doing this is to use \chapter*{Unnumbered title} followed by \addcontentsline{toc}{chapter}{Unnumbered title}. I have reduced your MWE and added examples of \addtcontentsline.

% tocprob3.tex SE 531673 add to ToC???
\documentclass{report}
\begin{document}
\tableofcontents
% \addchap{Publications et communications}
\chapter*{Publications et communications}
\addcontentsline{toc}{chapter}{Publications et communications}
\section*{$\:$ a. Publications}
\addcontentsline{toc}{section}{$\:$ a. Publications}
\section*{$\:$ b. Communications}
% \addchap{Remerciements}
\chapter*{Remerciements}
\addcontentsline{toc}{chapter}{Remerciements}
\end{document}

For more details about \addcontentsline one place to look, among others, is the documentation of the tocloft package (> texdoc tocloft).

Peter Wilson
  • 28,066