LaTeX forum ⇒ Texmaker and TeXstudioJob aborted, no legal \end found Topic is solved

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

Job aborted, no legal \end found

Postby kwa2 » Sun Jan 29, 2012 4:52 am

Hello World!

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.

Recommended reading 2021: •
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
Stefan Kottwitz
Site Admin
Posts: 9846
Joined: Mon Mar 10, 2008 9:44 pm

Re: Job aborted, no legal \end found  Topic is solved

Postby Stefan Kottwitz » Sun Jan 29, 2012 12:17 pm


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 admin

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

Job aborted, no legal \end found

Postby toobadbear » Tue Jul 24, 2012 5:13 pm


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
header.tex:0:Emergency stop

In this, header.tex is the main file of the template. It ends with the following (If needed, I could attach the entire file):
% ---------------------------------------------------------------------------

%  1. Index erzeugen.

% ---------------------------------------------------------------------------

% ===========================================================================

The header.log says the following (I assume the important part is the end):
Writing index file header.idx
! 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.


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

Re: Job aborted, no legal \end found

Postby toobadbear » Sat Aug 11, 2012 8:38 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 ;-)


Posts: 1
Joined: Sun Aug 31, 2014 10:33 am

Re: Job aborted, no legal \end found

Postby rajadurai330 » Sun Sep 07, 2014 11:56 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 ?

User avatar
Site Moderator
Posts: 4183
Joined: Thu Nov 01, 2012 4:08 pm

Job aborted, no legal \end found

Postby Johannes_B » Sun Sep 07, 2014 12:02 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.

Posts: 1
Joined: Wed Feb 12, 2020 12:03 am

Job aborted, no legal \end found

Postby krisnotchris » Wed Feb 12, 2020 12:06 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 :lol:

Posts: 1
Joined: Wed Sep 23, 2020 4:49 pm

Job aborted, no legal \end found

Postby astawsky » Wed Sep 23, 2020 5:08 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.

Return to “Texmaker and TeXstudio”

Who is online

Users browsing this forum: No registered users and 2 guests