0

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}
9
  • You didn't provide a complete file, so it's impossible to say what can go wrong. Adding your code to a minimal but complete LaTeX code compiles with no error. Also, please don't post screenshots for error, copy-paste them with this site's formatting tools.
    – Miyase
    May 14 at 9:06
  • I see you edited your code, but its still incomplete, so it can't be compiled. A LaTeX document must have a document environment (hence my request for a complete file).
    – Miyase
    May 14 at 9:11
  • That error has no sense... I compiled my code twice without changing the code right now, once the error the other one none ! May 14 at 9:59
  • 2
    Respectfully, if you want people to help you, provide the necessary information so that they can reproduce the problem : complete LaTeX file, which compiler, which LaTeX distribution... Again, on my computer, your code works fine once I add a document environment, so the problem must be elsewhere.
    – Miyase
    May 14 at 10:07
  • 1
    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. May 14 at 11:03

1 Answer 1

3

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.