Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
generalites:erreurs:missing_begin_document [2021/01/10 16:36] – Rebalisage de la page. jejustgeneralites:erreurs:missing_begin_document [2021/01/10 16:38] (Version actuelle) – Suppression après fusion avec "generalites/erreurs/m/missing_begin_document". jejust
Ligne 1: Ligne 1:
-====== Missing "\begin{document}" ====== 
- 
- 
-The //preamble// of your document is the stuff before 
-''\begin{document}''; you put ''\usepackage'' commands and 
-your own macro definitions in there.  LaTeX doesn't like 
-//typesetting// anything in the preamble, so if you have: 
- 
-  * typed the odd grumble, 
-  * created a box with ''\newsavebox'' and put something in it using ''\sbox'' (or the like), 
-  * forgotten to put ''\begin{document}'' into the document, at all, or even 
-  * gave it the wrong file 
- 
-the error is inevitable and the solution is simple --- judicious use 
-of comment markers (''%'') at the beginning of a line 
-line, moving things around, providing something that was 
-missing ... or switching to the correct file. 
- 
-The error may also occur while reading the ''aux'' file from an 
-earlier processing run on the document; if so, delete the 
-''aux'' file and start again from scratch.  If the error 
-recurs, it could well be due to a buggy class or package. 
- 
-However, it may be that none of the above solves the problem. 
- 
-If so, remember that things that appear before ''\documentclass'' are 
-also problematical: they are inevitably before ''\begin{document}''! 
- 
-Unfortunately, modern editors are capable of putting things there, and 
-preventing you from seeing them.  This can happen when your document 
-is being "written" in [[FAQ-unicode|Unicode]].  The Unicode 
-standard defines "Byte Order Marks" (BOM), that reassure a 
-program (that reads the document) of the way the Unicode codes are 
-laid out.  Sadly ordinary LaTeX or pdfLaTeX choke on 
-BOMs, and consider them typesetting requests.  The error 
-message you see will look like: 
- 
-<code> 
-! LaTeX Error: Missing \begin{document}. 
-... 
-l.1 <?> 
-       <?><?>\documentclass{article} 
-</code> 
-(Those ''<?>''s are your operating system's representation of an 
-unknown character; on the author's system it's a reverse video 
-''?'' sign.) 
- 
-You can spot the BOM by examining the bytes; for example, the 
-Unix ''hexdump'' application can help: 
-<code> 
-$ hexdump -C <file> 
-00000000  ef bb bf 5c 64 6f 63 75 ... 
-</code> 
-The ''5c 64 6f 63 75'' are the ''\docu'' at the start of 
-(the "real" part of) your document; the three bytes before it form the 
-BOM. 
- 
-How to stop your editor from doing this to you depends, of course, on 
-the editor you use; if you are using GNU Emacs, you have to 
-change the encoding from ''utf-8-with-signature'' to "plain" 
-''utf-8''; instructions for that are found on 
-[[http://stackoverflow.com/questions/3859274/|the "stack overflow" site]] 
- 
-(So far, all instances of this problem that the author has seen have 
-afflicted GNU Emacs users.) 
- 
-Fortunately XeTeX and LuaTeX know about BOMs and what to 
-do with them, so LaTeX using them is "safe". 
- 
- 
------ 
-//Source:// [[faquk>FAQ-missbegdoc|Missing `\begin{document}`]] 
- 
-{{htmlmetatags>metatag-keywords=(LaTeX,errors) 
-metatag-og:title=(Missing `\begin{document}`) 
-metatag-og:site_name=(FAQ LaTeX francophone) 
-}} 
  
2_programmation/erreurs/missing_begin_document.1610296616.txt.gz · Dernière modification : 2021/01/10 16:36 de jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0