I keep getting an error on MikTeX

  • Thread starter Thread starter flyingpig
  • Start date Start date
  • Tags Tags
    Error
Click For Summary
SUMMARY

The forum discussion addresses a common error encountered in MiKTeX, specifically the "Missing \begin{document}" error during LaTeX compilation. This error arises when extraneous text is placed in the preamble, such as "Hello" before the \begin{document} command. Users are advised to ensure that all commands are correctly formatted and to utilize code tags for clarity when posting LaTeX code. The discussion highlights the importance of proper syntax in LaTeX documents to avoid compilation issues.

PREREQUISITES
  • Familiarity with LaTeX document structure and commands
  • Understanding of MiKTeX 2.8 installation and configuration
  • Knowledge of LaTeX error messages and troubleshooting
  • Basic skills in using forum code formatting tools
NEXT STEPS
  • Review LaTeX documentation on document classes and preamble requirements
  • Learn about common LaTeX errors and their resolutions
  • Explore MiKTeX troubleshooting techniques for compilation issues
  • Practice using code tags in forum discussions for clearer communication
USEFUL FOR

LaTeX users, students working on academic papers, and anyone utilizing MiKTeX for document preparation who seeks to resolve compilation errors effectively.

flyingpig
Messages
2,574
Reaction score
1

Homework Statement




I don't know what's going on, but i can't compile anything

I keep getting the following error

error said:
This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8)
entering extended mode
(C:\Users\l\Desktop\untitled-10.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, loaded.

! LaTeX Error: Missing \begin{document}.

This was my input

input said:
documentclass{report}

\begin{document}

hi

\end{document}
 
Physics news on Phys.org
Hmm, unfortunately, the forum tries to render the \LaTeX code.
The "Missing \begin{document}" error - apart from the obvious cause - also occurs when you put some stuff in the pre-amble which is not expected there. For example.
Code:
\documentclass{article}
Hello
\begin{document}
world!
\end{document}

would also produce the error, because when LaTeX encounters the text "Hello" it expects that you should have written \begin{document} already.

Did you put a backslash before \documentclass, or is that just the quote being mangled? Otherwise, maybe you can post the document again using
Code:
 tags.
 
The stupid backslash!

Thank you very much! you just saved my life.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 4 ·
Replies
4
Views
12K