# Error code in LaTeX

I have got the following error code:

"file ended while scanning use of \document"


I dont know what to do with it.

Regards,

Gabor Luko

• Try to reduce your code to a minimum code that reproduce the problem. Then edit your post with this code included and you will have possibilities to find help. Now you don't really have. – koleygr Sep 8 '17 at 18:26
• Welcome to TeX.SX! Please add a complete minimal working example (MWE) that begins at \documentclass and ends at \end{document} that reproduces the error/issue you're facing. – Skillmon likes topanswers.xyz Sep 8 '17 at 18:35
• the standard \document command will not give that error, even if used incorrectly so you must have a non standard definition of the command. – David Carlisle Sep 8 '17 at 18:46

A file that just contains the lines

\renewcommand\document[1]{}
\document


produces the error message

Runaway argument?
! File ended while scanning use of \document.
<inserted text>
\par


Because the command is defined to have an argument such as \document{hello} but the file ends with no argument after \document.

But \document is the core latex command which is the definition of \begin{document} as used in every LaTeX document, that command should not be redefined to take an argument.