Emergency stop, what does it mean? How to repair? enter image description here

  • 1
    Welcome, you have a serious probem in your code that lets LaTeX stop. You have not shown the reason. You can find the reason using this simple algorithm.
    – Johannes_B
    Commented Feb 18, 2017 at 17:37
  • 1
    if you for example \input a file that doesn't exist then normally tex prompts for a different file namebut in batch mode it never interactively prompts so does an "emergency stop" The log file will show the error (you only see a summary in that screenshot). unrelated but the following bad box warning is almost certainly \\ misused at the end of a paragarph, Commented Feb 18, 2017 at 20:25
  • 2
    a common cause is no \end{document}
    – geordie
    Commented Aug 5, 2018 at 18:27

3 Answers 3


Most likely you tried \input{texstudio_hy2940} and that file does not exist and you are running in \batchmode so TeX can not stop and ask for a different file name.

Look in the log file for the full error message.

The TeXBook says:

Sometimes an error is so bad that TeX is forced to quit prematurely. For example, if you are running in \batchmode or \nonstopmode, TeX makes an "emergency stop" if it needs input from the terminal; this happens when a necessary file cannot be opened, or when no \end command was found in the input document.


As mentioned by @geordie in the comment, a common cause is no \end{document}. So, scroll down and check that on your document.


Note: I came here because of that, but did not read the comment. Just realize the answer that I'm looking is in the comment after I find the culprit from git diff. That is way I post this answer to help others like me.


Well, like others pointed, it can be caused due to myriad of reasons. Going to Log > Log file (it was in Log > Issues in above screenshot) is the way to get more hints about it.

One possible reason can also be that if some used package (say minted) which uses shell commands, and you have set the ComSpec environment variable to something other than cmd (like bash). Then that package won't work and emergencies in batch mode abound.

You must log in to answer this question.