1

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

  • What's the code for the heading of subsections 2.3.3 and 2.3.4? (The line \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
  • (Tangential: why define your own \apgt and \aplt when there are perfectly good versions of \lesssim and \gtrsim?) – Willie Wong Mar 30 '21 at 16:58
  • I am using TeXstudio 2.12.6 @WillieWong "\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}$}" – Praphulla Koushik Mar 30 '21 at 17:01
  • @WillieWong I have absolutely no idea of what \apgt and \aplt are. Someone here suggested me that. So, I am using that. Are you saying there would be no difference if I do not use that? – Praphulla Koushik Mar 30 '21 at 17:07
  • That someone chose to define his/her own version of ≲ instead of the standard \lesssim that, 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
  • Your MWE shows no \subsection commands. We can't guess what you might or might not have done. – Peter Wilson Mar 30 '21 at 17:15
  • In any case, TeXStudio 2.12.6 is 3 years old.... any chance you can upgrade? It looks like either (a) you've loaded a package which (re)defined \colon in a way that is fragile, or (b) your installation is so old that whatever fixed the \colon problem is not installed. On TeXLive 2020 the \colon shouldn't cause a problem in section headings. – Willie Wong Mar 30 '21 at 17:15
  • Actually, the same goes for \underline to. It got expanded when it should not have been. – Willie Wong Mar 30 '21 at 17:17
  • yoiu have post a lot of code but none of it is relevant to the question. Please post an example that produces the error that you are askig about. – David Carlisle Mar 30 '21 at 17:18
  • There is a small problem with that. I am using \include{chapter} and in that file "chapter" I have written that subsection. I do not know how do I add that here. – Praphulla Koushik Mar 30 '21 at 17:21
  • make an examplt that just has \begin{document}\section{.. your section heading}\end{document} you most likely do not need \chapter or most of the packages you show to reproduce the error. – David Carlisle Mar 30 '21 at 17:22
  • but this is a fragile command in a moving argument error, plave \protect before the commands in your section heading. – David Carlisle Mar 30 '21 at 17:23
  • @WillieWong Now I am using TeXstudio 3.1.1. It is still saying the same. – Praphulla Koushik Mar 30 '21 at 17:26
  • @DavidCarlisle I did not understand your comment about \protect. What should I do there? – Praphulla Koushik Mar 30 '21 at 17:27
  • @DavidCarlisle: the subsection headings are given in this comment. Should \colon and \underline{X} be fragile? – Willie Wong Mar 30 '21 at 17:27
  • @WillieWong I saw, no they should work, (and do when I tried it) – David Carlisle Mar 30 '21 at 17:28
  • @PraphullaKoushik I added a complete document with your subsections but it runs without error, try adding your local definitions back uunril you get an error then post the resulting document. – David Carlisle Mar 30 '21 at 17:29
  • @PraphullaKoushik: in a normal document (that David and I checked ourselves using the up-do-date TeXLive), that \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 .aux and .toc files 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:33
  • I do not think there is any issue with texstudio version. I have run the same file in "\documentclass[12pt,reqno,a4paper]{amsart}". It worked with no issues. – Praphulla Koushik Mar 30 '21 at 17:38
  • @WillieWong I have added mwe please see – Praphulla Koushik Mar 30 '21 at 17:51
  • @DavidCarlisle I have added mwe please see – Praphulla Koushik Mar 30 '21 at 17:51
  • I tried your original MWE where you used the book class 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
  • For me, it is saying "line 2: Missing $ inserted. ... {D}$} is an atlas for {$\mathcal {D}$}}{3} line 2: Missing $ inserted. ... {D}$} is an atlas for {$\mathcal {D}$}}{3} " @PeterWilson – Praphulla Koushik Mar 30 '21 at 17:57
  • your example makes no errors with a current latex, if you have a very old release you may need to use \protect\underline etc to make them safe in section headings You will need to delete the .toc file that has the errors. what version of latex do you have the log and terminal should have something like LaTeX2e <2020-10-01> patch level 4 what date does yours show? – David Carlisle Mar 30 '21 at 17:57
  • @DavidCarlisle Yes. \protect\underline worked. But are you sure this is about old release? I just downloaded new version :O – Praphulla Koushik Mar 30 '21 at 17:59
  • the example you post makes no errors in a current release. what release of latex did you doenload, what date is in the banner at the start of the log? – David Carlisle Mar 30 '21 at 17:59
  • @DavidCarlisle It says "This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2019.3.18)" I downloaded new version of texstudio from https://ubuntuhandbook.org/index.php/2019/12/how-to-install-texstudio-2-12-18-in-ubuntu-19-10-20-04/ – Praphulla Koushik Mar 30 '21 at 18:06
  • ah 2017 yes that goes back a bit. the current relase is 2020-10-01, but you probably installed a "stable" linux release rather than getting texlive from tug, that's OK they are just a few years behind. (the version of texstudio has no effect, thats just the editor you are using not the tex system) – David Carlisle Mar 30 '21 at 18:08
  • @DavidCarlisle can you suggest me how to install 2020 release for ubuntu 18.04 LTS – Praphulla Koushik Mar 30 '21 at 18:11
  • https://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu – David Carlisle Mar 30 '21 at 18:15
  • @DavidCarlisle sorry. last question for today. That is installing texlive. I am already using texstudio. Is there a way to install just the tex system – Praphulla Koushik Mar 30 '21 at 18:18
  • texlive is the tex system, texstudio, as I say is just the editor you are using, it does not include tex. You might want to wait a week or so, texlive 2021 will be released very soon. – David Carlisle Mar 30 '21 at 18:20
  • ok @DavidCarlisle – Praphulla Koushik Mar 30 '21 at 18:21

1 Answers1

0

I was using older version.

\protect\underline instead of only \underline solved the issue.

Werner
  • 603,163