This is my preamble:

\usepackage[left=1.5in, right=1in, top=1in,bottom=1.5in]{geometry}
\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.


\usepackage[font=it,skip=0.5\baselineskip]{caption} % italic text for captions


[3pt]                                               % left margin
{\contentsmargin{0pt}                               % numbered entry format
{\contentsmargin{0pt}\large}                        % unnumbered entry format
{\titlerule*[.99pc]{.}\contentspage}                 % filler-page format (e.g dots)
[]                                                  % below code (e.g vertical space)

%to put page numbers as the header




%koleygr: Redefining chapter to include \thispagestyle{fancy}
{\GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}\@StarredWith}%

\renewcommand{\contentsname}{TABLE OF CONTENTS}


I was using this same set of codes earlier, and it was working fine. Then I wanted to change the format of the titles, 'List of figures,' and 'List of tables' into all caps, i.e. "LIST OF FIGURES," and "LIST OF TABLES." So I used a bunch of codes. After they showed error, I undid everything and came back to the original state, but it stopped compiling.

Finally, I got rid of \tableofcontents code, and it compiled. But, now I cannot add the table of contents.

It is showing a ton of errors. Here is the screenshot: enter image description here

For my codes for table of contents, I am just using the normal bunch of codes:







Is there some defect in my codes, somewhere?

Thanks a lot!!

  • I added some chapters and some sections, and then using \tableofcontents doesn't make any errors: I got this output.
    – user156344
    Apr 10 '19 at 5:46
  • You might have put \tableofcontents and other stuff out of scope of \begin{document}..\end{document}. I don't get any error compiling your code. Apr 10 '19 at 5:50
  • @JouleV, I just made a completely new document, and copy-pasted the entire code, and it works fine. But I went back to the original file, and it would still not compile, unless I get rid of the table of contents code. Not sure why that's happening! May be I will use the new document from now onward. [And I gotta learn how to use this forum better, thanks for your comment :) ]
    – Jerry
    Apr 10 '19 at 5:52
  • @MajidAbdolshah Yeah, not sure why that's happening just to that one document.
    – Jerry
    Apr 10 '19 at 5:53
  • 2
    If moving content to fresh file or renaming tex files clears an issue it usually indicates the original file still has borked auxiliaries so try the corresponding editor "clean" command
    – user170109
    Apr 10 '19 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.