0

I'm begginer in Latex and I get this error when I compile my file

LaTeX Error: There's no line here to end.

following is the code that I used :

\documentclass[12pt,a4paper]{article}
  \usepackage[T1]{fontenc}
  \usepackage{array}
  \usepackage{url}
  \usepackage{hyperref}

  \input{style/packages.tex}
  \input{style/style.tex}
  \input{title/title.tex}

  \begin{document}
     \pagestyle{fancy}
     \maketitle
     \newpage
     \input{body/pages/remerciements.tex} \newpage
     \input{body/pages/abstract-fr.tex} \newpage
     \input{body/pages/abstract-en.tex} \newpage
     \renewcommand{\contentsname}{Table of Contents} 
     \tableofcontents \newpage
     \listoffigures
     \listoftables \newpage
     \input{body/pages/titre1/titre1.tex} \newpage
     \input{body/pages/titre2/titre2.tex} \newpage
     \input{body/pages/titre3/titre3.tex}   \newpage
     \input{body/pages/titre4/titre4.tex}   \newpage
     \input{body/pages/titre5/titre5.tex}   \newpage
     \input{body/pages/conclusion.tex} \newpage
     \bibliographystyle{unsrt}
     \bibliography{bibliografie}  \newpage
     \appendix
     \input{appendix/titreA.tex}
  \end{document}

This is the content of "title.tex"

\makeatletter

\renewcommand\maketitle{
  \begin{titlepage}
    \begin{center}
        \includegraphics[width=7.2cm]{title/images/logo_entreprise.png}
        \hspace{\stretch{1}}
        \includegraphics[width=7.2cm]{title/images/logo_centrale.png}



\vspace{\stretch{0.5}}

      \begin{tabular*}{1.0\textwidth}{l @{\extracolsep{\fill}} r}
                Université Pierre et Marie Curie        & \NomEntreprise                \\
                TFE \@date                          & Orsay         \\
        \end{tabular*}

\vspace{\stretch{1.5}}

    {\large \bf Rapport Final de Travail de Fin d'études \\}
\vspace{0.5cm}
{\LARGE \bf \@title\\}
\vspace{0.5cm}
{\large \it \@author\\}

  \vspace{\stretch{2}}
  \\
  \includegraphics[width=8cm, height=5cm]{title/images/Encryption.png}
  \vspace{\stretch{2}}

      \begin{tabular*}{1.0\textwidth}{|l @{\extracolsep{\fill}} r|}
            \hline
                Tuteurs :                       & Option : (sigle développé)    \\
                &\\
                \textit{ECL} :              &                                                       \\
                Nom, Prénom Tuteur 1    & Filière : (sigle développé)   \\
                Nom, Prénom Tuteur 2    &                                                       \\
                &\\
                \textit{Entreprise} :   &                                                       \\      
                Nom, Prénom Tuteur 1    & Métier : (sigle développé)        \\
                Nom, Prénom Tuteur 2    &                                                       \\  
            \hline
        \end{tabular*}


\end{center}\par 

\end{titlepage}
  \setcounter{footnote}{0}

%  \global\let\thanks\relax
%  \global\let\maketitle\relax
%  \global\let\@thanks\@empty
%  \global\let\@author\@empty
%  \global\let\@date\@empty
%  \global\let\@title\@empty
%  \global\let\title\relax
%  \global\let\author\relax
%  \global\let\date\relax
%  \global\let\and\relax
}


\makeatother

Can someone tell me where is the problem ?

  • 1
    Welcome, we can not help you with that as you are not showing us anything. Please make your post self-contained. Say, add any information (package...) which is needed in order to compile your document. We can not guess, what \input{title/title.tex} contains and even less, if it does matter here. Try to minimize as much as you can. Most probably, you will find the culprit command by your self. – LaRiFaRi Aug 20 '15 at 12:45
  • Also, see this site to read more about when such errors are raised. – sodd Aug 20 '15 at 12:48
  • I eddited the post, I put the content of "title.tex" – Hakim Aug 20 '15 at 12:55
  • @HakimBenyoucef Thanks. Still far away from minimal, but you got your answer. Off-topic: Please see tex.stackexchange.com/q/41681 – LaRiFaRi Aug 20 '15 at 13:09
3

The \\ here

\vspace{\stretch{2}}
\\

is spurious and will always generate this error, simply delete it.

Note also

{\LARGE \bf \@title\\}

should be

{\normalfont\LARGE \bfseries \@title\par}

so that the title is set with a baseline spacing appropriate for the size of the text.

|improve this answer|||||
  • \bfseries, maybe? – Bernard Aug 20 '15 at 13:38
  • When I compile title.tex alone I get the following error : ! LaTeX Error: \maketitle undefined – Hakim Aug 20 '15 at 13:42
  • 1
    @HakimBenyoucef that is expected, the file is designed to change the definitions from their otiginal values. It should be input into the preamble of a document as you show. It is not itself a document – David Carlisle Aug 20 '15 at 14:07
  • @Bernard probably not here. You could use \normalfont\bfseries but \bf comes to the same thing as you know it is an article class document. Headings and titles typically want a fixed font, not pick up the current font as \bfseries does. – David Carlisle Aug 20 '15 at 14:09
  • @David Carlisle: I didn't know that. Thanks, I've learnt something :o) – Bernard Aug 20 '15 at 14:12

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.