# \setcounter{} destroyed my file, it does not compile any more

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??

• 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 3 '14 at 18:35
• 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 3 '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 3 '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 3 '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 3 '14 at 18:49

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}
• @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 3 '14 at 22:40