Errors – Fixing ‘Emergency Stop’ Compilation Error in Overleaf

compilation errorerrors

I have a big problem with my LaTeX project. I haven't modified it for 15 hours (worked before !), just copied it to get the same template in another project, and now the original document stopped working:

error code

Here is the code of "packages.tex" below – I would be glad if you could help me since this is a very important project:

\documentclass[a4paper, 11pt, oneside]{article}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[french]{babel}
    \selectlanguage{french}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb, mathrsfs}
\usepackage[LGRgreek]{mathastext}
\usepackage{fixmath}
\usepackage{siunitx}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{palatino}
\usepackage{caption}
\usepackage{float}
\usepackage[version=4]{mhchem}
\usepackage{titlesec}
\usepackage{verbatim}
\usepackage{mdframed}
\usepackage{subfig}
\usepackage{appendix}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage{multirow}
\usepackage{makeidx}
\usepackage{eurosym}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{gensymb}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}
\newcommand{\tabitem}{~~\lap{\textbullet}~~}
\usepackage{longtable}
\usepackage{array}
\usepackage{enumitem}
\usepackage[backend=biber]{biblatex}
\addbibresource{biblio.bib}
\usepackage[left = 2 cm, right = 2.5cm, top = 2.5cm, bottom = 2.5cm]{geometry}
\usepackage{wrapfig}
\usepackage{setspace}
%\singlespacing

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

\titleformat{\section}
  {\normalfont\large\bfseries\scshape}{\thesection}{1em}{}[{\titlerule[0.8pt]}]
 \titleformat{\subsection}
  {\normalfont\bfseries}{\thesubsection}{1em}{}[{\titlerule[0.4pt]}]
 \titleformat{\subsubsection}
  {\normalfont\itshape}{\thesubsection}{1em}{}[{\titlerule[0.2pt]}]
  
\usepackage{multicol}  
\newenvironment{Figure}
  {\par\medskip\noindent\minipage{\linewidth}}
  {\endminipage\par\medskip}

EDIT: This also just happened in the copyed document, even if worked 5 minutes ago…

SECOND EDIT: here is the code of "main.tex":

\include{Template/packages}

\begin{document}

\include{Template/titlepage} %%% just the code of the title page

%%% Text using Figure and multicols


\include{Template/doc end} %%% For the bibliography "biblio.bib"


\end{document}

Best Answer

you can not use \include in the preamble so the input is incorrect even if sometimes you avoid an error. Use \input (I would also put the \documenclass command in your main document not in the input one but latex doesn't care which way you do that).

the error is because you ran latex on packages.tex not on your main file. Probably because overleaf guessed that packages.tex was the main file as it has \documentclass.