## LaTeX forum ⇒ Texmaker and TeXstudio ⇒ Job aborted, no legal \end found Topic is solved

Information and discussion about Texmaker, an integrated LaTeX environment for several platforms, and the related TeXstudio
kwa2
Posts: 1
Joined: Sun Jan 29, 2012 1:35 am

### Job aborted, no legal \end found

\documentclass[10pt]{article}\begin{document}Hello World!\end{document}

I type in this to the Texmaker and it gives me an error that the job has aborted because no legal \end command is found, even though it clearly is there.
Last edited by localghost on Sun Jan 29, 2012 11:27 am, edited 1 time in total.
Reason: Source code has to be tagged as such to keep a post clear and legible (see Board Rules).

Stefan Kottwitz
Posts: 9617
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

welcome to the board!

This document is compilable. Perhaps post your .log file here as attachment to a post, the cause can probably seen in the log.

Stefan

Posts: 2
Joined: Tue Jul 24, 2012 4:06 pm
Hi,

I'm also new to LaTeX and have a problem: For a thesis I am using a template created by a friend, but I can't get it to compile in either TeXnicCenter (1 or 2)/MikTex2.9 in Win7 or Kile 2.1.0/TeX-Live (2009-15, latest version in the repositories). However, it compiles just fine on his computer.

The error I get is:
[PDFLatex] finished with exit code 1

In this, header.tex is the main file of the template. It ends with the following (If needed, I could attach the entire file):
%% D. AKTIONEN% ---------------------------------------------------------------------------% %%  1. Index erzeugen.%\makeindex  %% E. SILBENTRENNUNG% ---------------------------------------------------------------------------%\input{hyphenation}  %% ===========================================================================% EOF%

The header.log says the following (I assume the important part is the end):
Writing index file header.idx(./hyphenation.tex))! Emergency stop.<*> header.tex *** (job aborted, no legal \end found)  Here is how much of TeX's memory you used:  26860 strings out of 493848  531728 string characters out of 1152824  763925 words of memory out of 3000000  29540 multiletter control sequences out of 15000+50000  4808 words of font info for 17 fonts, out of 3000000 for 9000  714 hyphenation exceptions out of 8191  53i,1n,97p,461b,245s stack positions out of 5000i,500n,10000p,200000b,50000s!  ==> Fatal error occurred, no output PDF file produced!

I have tried commenting /input{hyphenation} and /makeindex out, but that does not change anything. I have checked for missing /end in all .tex files that are part of the template (there is no /begin of any kind in the header). I have removed and reinstalled Tex-Live-full and Kile (without the purge-option, though).

I would really appreciate some help, especially since the error message doesn't really point me towards any obvious reason.

Cheers,
Chris

Posts: 2
Joined: Tue Jul 24, 2012 4:06 pm
So the problem got solved, proving me a total idiot. The main file was in fact a different one (which had header.tex as input file) and the compilation stopped due to a missing document body. Posting this just in case someone else runs across the same problem and wants to avoid looking like a fool

Chris

Posts: 1
Joined: Sun Aug 31, 2014 10:33 am
Hi, I am also facing the same problem. But I couldn't find a proper solution from this post. So please, let me know how can this problem be solved ?

Johannes_B
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm
Hi and welcome.

There is no solution provided in this thread as it is document dependant.

Run your document using texworks and boil it down to a Minimal working example. Post this with an appropriate title and the log file in a new thread.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

krisnotchris
Posts: 1
Joined: Wed Feb 12, 2020 12:03 am
@toobadbear I had that problem also, and I have no idea how I set settings.tex to be main... Thanks for sharing! Unfortunately I came acrross your post after hours of online research

astawsky
Posts: 1
Joined: Wed Sep 23, 2020 4:49 pm
You can click in the top left where it says menu with the overleaf symbol. Then you'll be able to change the main file to be main.