1

I was doing \paragraph to include a third subsection but my third subsection came out not numbered at all. I got help from someone suggesting me to use setcounter (see my related question: Is there a \subsubsubsection command? ). The problem is that my thesis failed to compile! I deleted the command, and my file still not working! I used:

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}

what could be happening??

Naema
  • 2,305
  • 1
    I highly doubt that \setcounter{} has eaten, smashed, blown up, or otherwise d[e]stroyed your thesis. Try deleting the *.aux file and see if the problem is resolved. If not, post a minimal example and someone will surely be able to help. – Paul Gessler Jul 03 '14 at 18:35
  • 1
    Analyze your error message (location, ...). Probably one or more of your \paragraph titles contain fragile stuff that breaks during the move to the table of contents. Use \protect to protect fragile commands in \paragraph. – Heiko Oberdiek Jul 03 '14 at 18:37
  • I am sorry, I am still learning latex but at the same time I have a deadline so I had better not fell in so many errors. – Naema Jul 03 '14 at 18:38
  • oh, I finally figured it out. When I deleted the setcounter commands I used in my main thesis file, I did leave a space (an empty line) which was causing the problem. Now , I deleted the line and everything is working fine except that I am still not able to do subsubsubsection{} using \paragraph; \paragraph did not do any numbers , it showed a title but without any numbers. – Naema Jul 03 '14 at 18:45
  • \setlength{\itemsep}{-\parsep}}}% {\end{list}} (I inserted the setcounter commands right in the middle between \setlength and \end{list} and when I deleted the commands, I left an empty line which caused the compilation problem). – Naema Jul 03 '14 at 18:49
  • Have you looked at the accepted answer to the question your original question was closed as a duplicate of? That answer seems to do exactly what you're asking for. – Paul Gessler Jul 03 '14 at 18:53
  • Please change your question title. Nothing 'destroyed [your] file'. That suggests that you tex file disappeared into the ether which is not the case. – cfr Jul 04 '14 at 00:47
  • cfr, how to do that? – Naema Jul 04 '14 at 17:00

1 Answers1

2

sections are numbered up to secnumdepth which is 3 in article and \paragraph is level 4 heading so to have numbered paragraphs use \setcounter{secnumdepth}{4}

David Carlisle
  • 757,742
  • I did it but I had the following error:\begin{document} ended by \end{list} – Naema Jul 03 '14 at 22:36
  • here I inserted it just before ending the list {\begin{list}{}% {\renewcommand{\makelabel}[1]{\hfill\textnormal{##1 =}}% \settowidth{\labelwidth}{\textnormal{#1 =}}% \setlength{\leftmargin}{\labelwidth}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{-\parsep}}}% \setcounter{secnumdepth}{4} {\end{list}} – Naema Jul 03 '14 at 22:38
  • @Naema It makes no sense to change the settings there, they should be in the document preamble – David Carlisle Jul 03 '14 at 22:39
  • 1
    @Naema you need to post the error but also every question should have a complete small document that generates the error. Start from a copy of the document and delete everything you can delete while still having the error, your example code in teh question should have everything from \documentclass to \end{document} – David Carlisle Jul 03 '14 at 22:40
  • IT worked but gave me 2.1.2.0.1 (I should not have the zero in there), how to remove it?. I used /setcounter{secnumdepth}{4} and used \paragraph – Naema Jul 04 '14 at 16:49
  • @Naema that means you have skipped one level \section,\subsection,\subsubsection,\paragraph. But you still have not provided an example in your question that demonstrates any problem, so impossible to guess. – David Carlisle Jul 04 '14 at 19:17
  • David, yes , you are right. I figured out today that the level subsubsection is missed. The problem is solved now. – Naema Jul 07 '14 at 22:16
  • OK next time please put a proper example in the question:-) – David Carlisle Jul 07 '14 at 22:17
  • sure David. I wanted to include this third subsection in my table of contents but could not know how. Should I use a different command? – Naema Jul 07 '14 at 22:24
  • @Naema sorry I have no idea what you mean by that, but don't ask new questions in comments, if you have a new question ask a new question with a complete example document that shows the problem. – David Carlisle Jul 07 '14 at 22:25
  • @Naema unless you mean \setcounter{tocdepth}{4} – David Carlisle Jul 07 '14 at 22:27
  • I put those commands \setcounter{tocdepth}{4} \setcounter{secnumdepth}{4} but not sure if I put them in the right place. I have a different file for each chapter of my thesis and I have a main file in which I did the settings. – Naema Jul 07 '14 at 23:20