Getting compilation error with latex file in overleaf

3.7k Views Asked by At

This is my first time with overleaf. I have a latex template, and when I try to compile it shows the following error:

Emergency stop.

<*> header.tex
          
*** (job aborted, no legal \end found)


Here is how much of TeX's memory you used:
28699 strings out of 480906
561966 string characters out of 5908280
1147859 words of memory out of 5000000
43764 multiletter control sequences out of 15000+600000
539149 words of font info for 32 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
73i,1n,97p,10101b,276s stack positions out of 5000i,500n,10000p,200000b,80000s!  ==> Fatal error 
occurred, no output PDF file produced!

I am not sure what to do.

Can someone please suggest how I can solve this problem?

In case you need some more information, then please let me know. I will add here.

Edit: header file that is throwing error: http://www.itextpad.com/pH0GJ5Bfmg

1

There are 1 best solutions below

0
On

The document you have provided is simply a preamble file. It does not contain the document body \begin{document} ... \end{document} hence the Emergency stop fatal error.

What you should do is save this file under some name, say mypreamble.tex. Create a new .tex file and have both files under the same file directory. Finally, in the new file

\include{mypreamble.tex}
\begin{document}
    \thesistitle
    \section{Section 1}
    /*
     * Write stuff and commands here
     */
\end{document}

The file you have provided does not seem to be a classic template which you copy-paste, change some fields and have your product. It seems to look more like a file containing some functions and predefinitions which helps you structure your file in a certain way. I would suggest looking for another template that includes a document main body, which you would be able to implement and use immediately.