0

I have a error in a document and I'm unable to debug it.

The errors

At the second compilation of my document, the command \ref{} raises the error

Missing control sequence inserted

\inaccessible

l.628 ...au paragraphe \ref{bus}

If I remove the command \ref{bus}, the document compiles (several times, also).

If I try to recompile after this error, I have the following error and I need to trash "aux files" in order to recompile the document.

File ended while scanning use of @writefile

The context

The reference "bus" points to

\subsection{Les bus}\label{bus}

The document loads many packages and I'm unable to produce a MWE. Sorry for that, but maybe someone with more knowledge of TeX can guess what is the problem.

As pointed by Ulrich, the issue comes from the redefinition of \subsection. Indeed, I tend to replace \def by \gdef. Here is the guilty definition.

% cf. https://tex.stackexchange.com/a/508837/8323

\gdef\mystars{}
\gdef\myexclmarks{}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}\mystars\myexclmarks\setImportance{0}\setStars{0}}

\newcounter{secstars}
\newcommand\setStars[1]{%
\gdef\mystars{}%
\ifnum#1=0%
\else
\setcounter{secstars}{0}%
\loop\edef\mystars{*\mystars}%
\stepcounter{secstars}%
\ifnum\value{secstars}<#1\repeat
\edef\mystars{\,\mystars}
\fi%
}

\newcounter{secexclmarks}
\newcommand\setImportance[1]{%
\gdef\myexclmarks{}%
\ifnum#1=0%
\else
\def\myexclmarksaux{}%
\setcounter{secexclmarks}{0}%
\loop\edef\myexclmarksaux{!\myexclmarksaux}%
\stepcounter{secexclmarks}%
\ifnum\value{secexclmarks}<#1\repeat
\gdef\myexclmarks{\,$^{\displaystyle\textbf{\myexclmarksaux}}$}
\fi%
}

The aux files

After the first (successful) compilation, the aux file is

\relax 
\providecommand\zref@newlabel[2]{}
\catcode `:\active 
\catcode `;\active 
\catcode `!\active 
\catcode `?\active 
\providecommand\tcolorbox@label[2]{}
\select@language{french}
\@writefile{toc}{\select@language{french}}
\@writefile{lof}{\select@language{french}}
\@writefile{lot}{\select@language{french}}
\select@language{french}
\@writefile{toc}{\select@language{french}}
\@writefile{lof}{\select@language{french}}
\@writefile{lot}{\select@language{french}}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1\gdef {}\relax \gdef {}\relax }L'ordinateur...}{1}}
\zref@newlabel{mdf@pagelabel-1}{\default{1.1\gdef {}\relax \gdef {}\relax }\page{1}\abspage{1}\mdf@pagevalue{1}}
\savepicturepage{pgfid2}{1}
\pgfsyspdfmark {pgfid2}{4661699}{34744117}
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Exemple d'ordinateurs : PC domestique, smartphone, automate programmable, plate-forme de calcul.\relax }}{1}}
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{ordinateurs}{{1}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2\gdef {}\relax \gdef {}\relax }Un peu d'histoire}{1}}
\newlabel{babbage}{{2a}{2}}
\newlabel{sub@babbage}{{(a)}{a}}
\newlabel{HM1}{{2b}{2}}
\newlabel{sub@HM1}{{(b)}{b}}
\newlabel{intel-4004}{{2c}{2}}
\newlabel{sub@intel-4004}{{(c)}{c}}
\newlabel{altair-8800}{{2d}{2}}
\newlabel{sub@altair-8800}{{(d)}{d}}
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{2}}
\newlabel{photos_histoire}{{2}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {La machine m\IeC {\'e}canique de calcul de Babbage.}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Havard Mark 1.}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(c)}{\ignorespaces {Microprocesseur Intel 4004 (1971)}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(d)}{\ignorespaces {Micro-ordinateur Altair 8800 (1975)}}}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Architecture globale}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1\gdef {}\relax \gdef {}\relax }Principaux constituants d'un ordinateur}{2}}
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Vue globale d'un ordinateur.\relax }}{3}}
\newlabel{ordinateur-global}{{3}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2\gdef {}\relax \gdef {}\relax }Branchements et connecteurs}{3}}
\@writefile{toc}{\contentsline {section}{\numberline {3}Architecture interne}{3}}
\newlabel{interne}{{3}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1\gdef {}\relax \gdef {}\relax }L'unit\IeC {\'e} centrale}{3}}
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Ensemble des principaux connecteurs de p\IeC {\'e}riph\IeC {\'e}riques externes.\relax }}{4}}
\newlabel{connecteurs}{{4}{4}}
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Principaux constituants de l'unit\IeC {\'e} centrale.\relax }}{5}}
\newlabel{unite-centrale}{{5}{5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2\gdef {}\relax \gdef {}\relax }Le processeur}{5}}
\zref@newlabel{mdf@pagelabel-2}{\default{3.2\gdef {}\relax \gdef {}\relax }\page{5}\abspage{5}\mdf@pagevalue{5}}
\savepicturepage{pgfid3}{5}
\pgfsyspdfmark {pgfid3}{4661699}{22094269}
\zref@newlabel{mdf@pagelabel-3}{\default{3.2\gdef {}\relax \gdef {}\relax }\page{5}\abspage{5}\mdf@pagevalue{5}}
\savepicturepage{pgfid4}{5}
\pgfsyspdfmark {pgfid4}{4661699}{16973636}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax }Les bus}{6}}
\newlabel{bus}{{3.3\gdef {}\relax \gdef {}\relax }{6}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax .1}D\IeC {\'e}finitions}{6}}
\zref@newlabel{mdf@pagelabel-4}{\default{3.3\gdef {}\relax \gdef {}\relax .1}\page{6}\abspage{6}\mdf@pagevalue{6}}
\savepicturepage{pgfid5}{6}
\pgfsyspdfmark {pgfid5}{4661699}{36729600}
\newlabel{branchement-direct}{{6a}{6}}
\newlabel{sub@branchement-direct}{{(a)}{a}}
\newlabel{branchement-bus}{{6b}{6}}
\newlabel{sub@branchement-bus}{{(b)}{b}}
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Diff\IeC {\'e}rentes possibilit\IeC {\'e}s pour communiquer avec le processeur.\relax }}{6}}
\newlabel{bus-interet}{{6}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Branchement direct\newline Le processeur a 16 pattes}}}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Branchement par bus\newline Le processeur n'a que 6 pattes}}}{6}}
\newlabel{bus-parallele}{{7a}{6}}
\newlabel{sub@bus-parallele}{{(a)}{a}}
\newlabel{bus-serie}{{7b}{6}}
\newlabel{sub@bus-serie}{{(b)}{b}}
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Exemple de types de bus\relax }}{6}}
\newlabel{type-ports}{{7}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Bus~parall\IeC {\`e}le\newline (Port~IDE~pour~les~disques~durs)}}}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Bus~s\IeC {\'e}rie \newline (Port~USB)}}}{6}}
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces \relax }}{7}}
\newlabel{bus-interne-extension}{{8}{7}}
\zref@newlabel{mdf@pagelabel-5}{\default{3.3\gdef {}\relax \gdef {}\relax .1}\page{7}\abspage{7}\mdf@pagevalue{7}}
\savepicturepage{pgfid6}{7}
\pgfsyspdfmark {pgfid6}{4661699}{29159213}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax .2}Principe de fonctionnement}{7}}
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Sch\IeC {\'e}ma repr\IeC {\'e}sentant les bus de donn\IeC {\'e}es et d'adresses, reliant le processeur aux p\IeC {\'e}riph\IeC {\'e}riques.\relax }}{7}}
\newlabel{bus-donnees-adresses}{{9}{7}}
\zref@newlabel{mdf@pagelabel-6}{\default{3.3\gdef {}\relax \gdef {}\relax .2}\page{8}\abspage{8}\mdf@pagevalue{8}}
\savepicturepage{pgfid7}{8}
\pgfsyspdfmark {pgfid7}{4661699}{44368859}
\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces Tous les p\IeC {\'e}riph\IeC {\'e}riques peuvent voir les donn\IeC {\'e}es, mais seuls ceux appel\IeC {\'e}s par le bus d'adresse r\IeC {\'e}agissent.\relax }}{8}}
\newlabel{mafia}{{10}{8}}
\zref@newlabel{mdf@pagelabel-7}{\default{3.3\gdef {}\relax \gdef {}\relax .2}\page{8}\abspage{8}\mdf@pagevalue{8}}
\savepicturepage{pgfid8}{8}
\pgfsyspdfmark {pgfid8}{4661699}{16354796}
\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Quelque part dans l'ordinateur d'un professeur de fran\IeC {\c c}ais...\relax }}{9}}
\newlabel{mafia-pilotes}{{11}{9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4\gdef {}\relax \gdef {}\relax }Les m\IeC {\'e}moires}{9}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4\gdef {}\relax \gdef {}\relax .1}Les m\IeC {\'e}moires... en g\IeC {\'e}n\IeC {\'e}ral}{9}}
\zref@newlabel{mdf@pagelabel-8}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid9}{9}
\pgfsyspdfmark {pgfid9}{4661699}{25876282}
\zref@newlabel{mdf@pagelabel-9}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid10}{9}
\pgfsyspdfmark {pgfid10}{4661699}{15790298}
\zref@newlabel{mdf@pagelabel-10}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid11}{9}
\pgfsyspdfmark {pgfid11}{4661699}{9050292}
\@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces Stockage des donn\IeC {\'e}es bit par bit, organis\IeC {\'e} en case-m\IeC {\'e}moire.\relax }}{10}}
\newlabel{cases-memoires}{{12}{10}}
\@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces Technologie de stockage des donn\IeC {\'e}es.\relax }}{10}}
\newlabel{technologie}{{13}{10}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Carte du champ magn\IeC {\'e}tique \IeC {\`a} la surface d'un disque dur}}}{10}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Sillons microscopiques grav\IeC {\'e}s dans un CD}}}{10}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(c)}{\ignorespaces {Circuit int\IeC {\'e}gr\IeC {\'e} de m\IeC {\'e}moire RAM (volatile)}}}{10}}
\zref@newlabel{mdf@pagelabel-11}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{10}\abspage{10}\mdf@pagevalue{10}}
\savepicturepage{pgfid12}{10}
\pgfsyspdfmark {pgfid12}{4661699}{11945793}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4\gdef {}\relax \gdef {}\relax .2}Les m\IeC {\'e}moires dans l'ordinateur}{10}}
\@writefile{toc}{\contentsline {paragraph}{$\bullet $ Organisation :}{10}}
\zref@newlabel{mdf@pagelabel-12}{\default{3.4\gdef {}\relax \gdef {}\relax .2}\page{11}\abspage{11}\mdf@pagevalue{11}}
\savepicturepage{pgfid13}{11}
\pgfsyspdfmark {pgfid13}{4661699}{41095701}
\@writefile{lof}{\contentsline {figure}{\numberline {14}{\ignorespaces Diff\IeC {\'e}rents types de m\IeC {\'e}moires dans un ordinateur.\relax }}{11}}
\newlabel{type-memoires-ordi}{{14}{11}}
\@writefile{toc}{\contentsline {paragraph}{$\bullet $ Adressage m\IeC {\'e}moire de la m\IeC {\'e}moire vive:}{11}}
\@writefile{lof}{\contentsline {figure}{\numberline {15}{\ignorespaces Illustration d'un stockage de donn\IeC {\'e}es par adressage, sur le bus-syst\IeC {\`e}me.\relax }}{12}}
\newlabel{mafia-memoire}{{15}{12}}
\newlabel{LastPage}{{}{12}}

After the second (and unsuccessful) compilation, the aux file is

\relax 
\providecommand\zref@newlabel[2]{}
\catcode `:\active 
\catcode `;\active 
\catcode `!\active 
\catcode `?\active 
\providecommand\tcolorbox@label[2]{}
\select@language{french}
\@writefile{toc}{\select@language{french}}
\@writefile{lof}{\select@language{french}}
\@writefile{lot}{\select@language{french}}
\select@language{french}
\@writefile{toc}{\select@language{french}}
\@writefile{lof}{\select@language{french}}
\@writefile{lot}{\select@language{french}}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1\gdef {}\relax \gdef {}\relax }L'ordinateur...}{1}}
\zref@newlabel{mdf@pagelabel-1}{\default{1.1\gdef {}\relax \gdef {}\relax }\page{1}\abspage{1}\mdf@pagevalue{1}}
\savepicturepage{pgfid2}{1}
\pgfsyspdfmark {pgfid2}{4661699}{34744117}
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Exemple d'ordinateurs : PC domestique, smartphone, automate programmable, plate-forme de calcul.\relax }}{1}}
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{ordinateurs}{{1}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2\gdef {}\relax \gdef {}\relax }Un peu d'histoire}{1}}
\newlabel{babbage}{{2a}{2}}
\newlabel{sub@babbage}{{(a)}{a}}
\newlabel{HM1}{{2b}{2}}
\newlabel{sub@HM1}{{(b)}{b}}
\newlabel{intel-4004}{{2c}{2}}
\newlabel{sub@intel-4004}{{(c)}{c}}
\newlabel{altair-8800}{{2d}{2}}
\newlabel{sub@altair-8800}{{(d)}{d}}
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \relax }}{2}}
\newlabel{photos_histoire}{{2}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {La machine m\IeC {\'e}canique de calcul de Babbage.}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Havard Mark 1.}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(c)}{\ignorespaces {Microprocesseur Intel 4004 (1971)}}}{2}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(d)}{\ignorespaces {Micro-ordinateur Altair 8800 (1975)}}}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Architecture globale}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1\gdef {}\relax \gdef {}\relax }Principaux constituants d'un ordinateur}{2}}
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Vue globale d'un ordinateur.\relax }}{3}}
\newlabel{ordinateur-global}{{3}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2\gdef {}\relax \gdef {}\relax }Branchements et connecteurs}{3}}
\@writefile{toc}{\contentsline {section}{\numberline {3}Architecture interne}{3}}
\newlabel{interne}{{3}{3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1\gdef {}\relax \gdef {}\relax }L'unit\IeC {\'e} centrale}{3}}
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Ensemble des principaux connecteurs de p\IeC {\'e}riph\IeC {\'e}riques externes.\relax }}{4}}
\newlabel{connecteurs}{{4}{4}}
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Principaux constituants de l'unit\IeC {\'e} centrale.\relax }}{5}}
\newlabel{unite-centrale}{{5}{5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2\gdef {}\relax \gdef {}\relax }Le processeur}{5}}
\zref@newlabel{mdf@pagelabel-2}{\default{3.2\gdef {}\relax \gdef {}\relax }\page{5}\abspage{5}\mdf@pagevalue{5}}
\savepicturepage{pgfid3}{5}
\pgfsyspdfmark {pgfid3}{4661699}{22094269}
\zref@newlabel{mdf@pagelabel-3}{\default{3.2\gdef {}\relax \gdef {}\relax }\page{5}\abspage{5}\mdf@pagevalue{5}}
\savepicturepage{pgfid4}{5}
\pgfsyspdfmark {pgfid4}{4661699}{16973636}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax }Les bus}{6}}
\newlabel{bus}{{3.3\gdef {}\relax \gdef {}\relax }{6}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax .1}D\IeC {\'e}finitions}{6}}
\zref@newlabel{mdf@pagelabel-4}{\default{3.3\gdef {}\relax \gdef {}\relax .1}\page{6}\abspage{6}\mdf@pagevalue{6}}
\savepicturepage{pgfid5}{6}
\pgfsyspdfmark {pgfid5}{4661699}{36729600}
\newlabel{branchement-direct}{{6a}{6}}
\newlabel{sub@branchement-direct}{{(a)}{a}}
\newlabel{branchement-bus}{{6b}{6}}
\newlabel{sub@branchement-bus}{{(b)}{b}}
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Diff\IeC {\'e}rentes possibilit\IeC {\'e}s pour communiquer avec le processeur.\relax }}{6}}
\newlabel{bus-interet}{{6}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Branchement direct\newline Le processeur a 16 pattes}}}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Branchement par bus\newline Le processeur n'a que 6 pattes}}}{6}}
\newlabel{bus-parallele}{{7a}{6}}
\newlabel{sub@bus-parallele}{{(a)}{a}}
\newlabel{bus-serie}{{7b}{6}}
\newlabel{sub@bus-serie}{{(b)}{b}}
\@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces Exemple de types de bus\relax }}{6}}
\newlabel{type-ports}{{7}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Bus~parall\IeC {\`e}le\newline (Port~IDE~pour~les~disques~durs)}}}{6}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(b)}{\ignorespaces {Bus~s\IeC {\'e}rie \newline (Port~USB)}}}{6}}
\@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces \relax }}{7}}
\newlabel{bus-interne-extension}{{8}{7}}
\zref@newlabel{mdf@pagelabel-5}{\default{3.3\gdef {}\relax \gdef {}\relax .1}\page{7}\abspage{7}\mdf@pagevalue{7}}
\savepicturepage{pgfid6}{7}
\pgfsyspdfmark {pgfid6}{4661699}{29159213}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3\gdef {}\relax \gdef {}\relax .2}Principe de fonctionnement}{7}}
\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces Sch\IeC {\'e}ma repr\IeC {\'e}sentant les bus de donn\IeC {\'e}es et d'adresses, reliant le processeur aux p\IeC {\'e}riph\IeC {\'e}riques.\relax }}{7}}
\newlabel{bus-donnees-adresses}{{9}{7}}
\zref@newlabel{mdf@pagelabel-6}{\default{3.3\gdef {}\relax \gdef {}\relax .2}\page{8}\abspage{8}\mdf@pagevalue{8}}
\savepicturepage{pgfid7}{8}
\pgfsyspdfmark {pgfid7}{4661699}{44368859}
\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces Tous les p\IeC {\'e}riph\IeC {\'e}riques peuvent voir les donn\IeC {\'e}es, mais seuls ceux appel\IeC {\'e}s par le bus d'adresse r\IeC {\'e}agissent.\relax }}{8}}
\newlabel{mafia}{{10}{8}}
\zref@newlabel{mdf@pagelabel-7}{\default{3.3\gdef {}\relax \gdef {}\relax .2}\page{8}\abspage{8}\mdf@pagevalue{8}}
\savepicturepage{pgfid8}{8}
\pgfsyspdfmark {pgfid8}{4661699}{16354796}
\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Quelque part dans l'ordinateur d'un professeur de fran\IeC {\c c}ais...\relax }}{9}}
\newlabel{mafia-pilotes}{{11}{9}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4\gdef {}\relax \gdef {}\relax }Les m\IeC {\'e}moires}{9}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.4\gdef {}\relax \gdef {}\relax .1}Les m\IeC {\'e}moires... en g\IeC {\'e}n\IeC {\'e}ral}{9}}
\zref@newlabel{mdf@pagelabel-8}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid9}{9}
\pgfsyspdfmark {pgfid9}{4661699}{25876282}
\zref@newlabel{mdf@pagelabel-9}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid10}{9}
\pgfsyspdfmark {pgfid10}{4661699}{15790298}
\zref@newlabel{mdf@pagelabel-10}{\default{3.4\gdef {}\relax \gdef {}\relax .1}\page{9}\abspage{9}\mdf@pagevalue{9}}
\savepicturepage{pgfid11}{9}
\pgfsyspdfmark {pgfid11}{4661699}{9050292}
\@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces Stockage des donn\IeC {\'e}es bit par bit, organis\IeC {\'e} en case-m\IeC {\'e}moire.\relax }}{10}}
\newlabel{cases-memoires}{{12}{10}}
\@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces Technologie de stockage des donn\IeC {\'e}es.\relax }}{10}}
\newlabel{technologie}{{13}{10}}
\@writefile{lof}{\contentsline {subfigure}{\numberline{(a)}{\ignorespaces {Carte du champ magn\IeC {\'e}tique \IeC {\`a} la surface d'un disque dur}}}{10}}
\@writefile{lof}{\contentsline {subfig
8
  • Is this the only subsection for which you use a label? The other labels all seem to be sections or some sort of subfigures (like sub@intel-4004). Can you reference other subsections successfully? The number in the label (3.3\gdef {}\relax \gdef {}\relax ) looks rather strange, maybe there is an issue with the way subsection numbers are defined in your document. Without code it is almost impossible to tell, though - if you could try making an MWE it would help a lot.
    – Marijn
    Sep 22, 2019 at 8:03
  • Your document (or the class you're using) has a faulty definition for \thesubsection. What it is can only be conjectured.
    – egreg
    Sep 22, 2019 at 8:13
  • In her document Creating a LaTeX Minimal Example Dr. Nicola Talbot describes the method of "hacking down" for obtaining minimal examples which reproduce inscrutable errors. Perhaps you can create a backup of your work and then try that approach. Sep 22, 2019 at 9:22
  • this is a classic "fragile command in a moving argument" error but you are not supposed to get one of those from the fragment shown so it is rather hard to say anything. surely you can make a document that only has that \subsection and if it still errors remove packages from the preamble if removing them does not make the error go, then post the resulting document. It's much easier for you to debug this than anyone else Sep 22, 2019 at 9:25
  • 1
    probably unrelated but never do \ifnum#1=0% it will cause the \else clause to be seen before the test is made. (remove the %) Sep 22, 2019 at 13:25

1 Answer 1

1

You have defined \mystars to be a fragile command (it uses multiple internal definitions) use \protect\mystars or define it to be robust by using

\DeclareRobustCommand\setStars

instead of

\newcommand\setStars

similarly your other definition.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .