I am using the following template for the thesis.
\documentclass[11pt,twoside]{book}
%\date{\today}
\begin{document}
\tableofcontents
\chapter{something}
\subsection{{$p: \underline{X}\rightarrow \mathcal{D}$} is an atlas for {$\mathcal{D}$}}
\subsection{Proof that $p: X\rightarrow \mathcal{D}$ is an epimorphism of stacks}
\end{document}
For some reason, when I run the file, there are 4 errors.
\contentsline {subsection}{\numberline {2.3.3}Proof that $p\penalty \@M \mskip 2mu\mathpunct {}\nonscript \mkern -\thinmuskip {:}\mskip 6muplus1mu\relax \relax $\@@underline {\hbox {X}}\mathsurround \z@ $\relax \rightarrow \mathcal {D}$ is an epimorphism of stacks}{71}{subsection.2.3.3}
\contentsline {subsection}{\numberline {2.3.4}$p\penalty \@M \mskip 2mu\mathpunct {}\nonscript \mkern -\thinmuskip {:}\mskip 6muplus1mu\relax \relax $\@@underline {\hbox {X}}\mathsurround \z@ $\relax \rightarrow \mathcal {D}$ is an atlas for $\mathcal {D}$}{73}{subsection.2.3.4}
I have written the following in subsection
"\subsection{Proof that $p\colon \underline{X}\ra \mc{D}$ is an epimorphism of stacks}" and "\subsection{$p\colon \underline{X}\ra \mc{D}$ is an atlas for $\mc{D}$}"
How do I fix this error. This is in thesis.toc
\subsection{.....})? Looks like you tried to put some fragile commands in a math display. Also, what version of latex are you running? – Willie Wong Mar 30 '21 at 16:55\apgtand\apltwhen there are perfectly good versions of\lesssimand\gtrsim?) – Willie Wong Mar 30 '21 at 16:58\lesssimthat, and also the greater than version. Have you gone through all the packages and all the newcommands that you were given and thought about whether they are all useful to you? For us to help you it would really make our lives easier if you can pare down the file to as little content as possible, while still reproducing the error, so that we don't get sidetracked by red herrings. – Willie Wong Mar 30 '21 at 17:11\subsectioncommands. We can't guess what you might or might not have done. – Peter Wilson Mar 30 '21 at 17:15\colonin a way that is fragile, or (b) your installation is so old that whatever fixed the\colonproblem is not installed. On TeXLive 2020 the\colonshouldn't cause a problem in section headings. – Willie Wong Mar 30 '21 at 17:15\underlineto. It got expanded when it should not have been. – Willie Wong Mar 30 '21 at 17:17\begin{document}\section{.. your section heading}\end{document}you most likely do not need\chapteror most of the packages you show to reproduce the error. – David Carlisle Mar 30 '21 at 17:22\protectbefore the commands in your section heading. – David Carlisle Mar 30 '21 at 17:23\colonand\underline{X}be fragile? – Willie Wong Mar 30 '21 at 17:27\subsection{...}command you typed should not have lead to what you saw in the ToC file. So something about your installation is borked. (Step 1) Please try deleting all.auxand.tocfiles and rerun latex, now that you upgraded. If the problem still persists, you need to (Step 2) Follow instructions of https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that to make a MWE. – Willie Wong Mar 30 '21 at 17:33bookclass and added in the two\subsection s. There were no errors. I have no idea what caused your problem or how to fix it. – Peter Wilson Mar 30 '21 at 17:55\protect\underlineetc to make them safe in section headings You will need to delete the.tocfile that has the errors. what version of latex do you have the log and terminal should have something likeLaTeX2e <2020-10-01> patch level 4what date does yours show? – David Carlisle Mar 30 '21 at 17:57