General ⇒ TeXLive: LaTeX Error: Missing \begin{document}
TeXLive: LaTeX Error: Missing \begin{document}
I am trying to compile a LaTeX beamer presentation to PDF under Winefish/TeXLive/pdfLaTeX (Gentoo Linux 64bit). However it always states " LaTeX Error: Missing \begin{document}." when I try to compile the files folien.tex or handout.tex. This problem did not occur with WinEdt/MiKTeX/pdfTeX (Win7 Pro 64bit).
In the attachment you will find the files where the problems occur.
It would be nice if you could help me, since I need this presentation for a homework in my vocational school.
In the attachment you will find the files where the problems occur.
It would be nice if you could help me, since I need this presentation for a homework in my vocational school.
- Attachments
-
- eCommerce.tar.bz2
- (355.8 KiB) Downloaded 241 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

TeXLive: LaTeX Error: Missing \begin{document}
Welcome to the LaTeX community!
It would have been nice if you had posted a
minimal working example instead of a complete project archive...
The complete error message reads:
which very much looks like the Byte Order Mark (BOM). A similar question has been asked on TeX.sx where Ulrike Fischer suggested to change the catcodes of the corresponding bytes:
Regards
It would have been nice if you had posted a

The complete error message reads:
Code: Select all
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 ï
»¿\documentclass[utf8, a4paper]{beamer}
However, for me it helped to save yourYou can e.g. change the\catcode
of the three problematic bytes before you input your file:You should then reset the catcodes in the document to 12.Code: Select all
pdflatex \catcode239=9 \catcode 187=9 \catcode 191=9 \input test-bom
folien.tex
once with iso-8859-1 encoding and then again with utf-8 encoding. (Maybe the second step alone would've also helped...)Regards
site moderator & package author
TeXLive: LaTeX Error: Missing \begin{document}
This does not work ...
And saving with iso-8859-1 encoding and then again with utf-8 also does not work ...
Code: Select all
mari@spixxi ~ $ cd /run/media/mari/Lexar/eCommerce
mari@spixxi /run/media/mari/Lexar/eCommerce $ pdflatex \catcode 239=9 \catcode 187=9 \catcode 191=9 \input folien
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
! I can't find file `catcode'.
Code: Select all
mari@spixxi /run/media/mari/Lexar/eCommerce $ iconv -fUTF-8 -tISO-8859-1 <folien.tex >folien_neu.tex
iconv: ungültige Eingabe-Sequenz an der Stelle 0
mari@spixxi /run/media/mari/Lexar/eCommerce $ od -h folien.tex
0000000 bbef 5cbf 6f64 7563 656d 746e 6c63 7361
0000020 5b73 7475 3866 202c 3461 6170 6570 5d72
0000040 627b 6165 656d 7d72 0a0a 695c 706e 7475
0000060 697b 686e 6c61 7d74 000a
0000071
Last edited by Spixi on Thu Aug 08, 2013 3:41 pm, edited 1 time in total.
TeXLive: LaTeX Error: Missing \begin{document}
Try only typing
Regards
pdflatex
. You should get a prompt starting with **
. You can then inserted the \catcode ... \input ...
stuff. However, IMHO you should first try saving the file again with correct encodings like I did. If that doesn't help you can still try this way.Regards
site moderator & package author
TeXLive: LaTeX Error: Missing \begin{document}
Thank you. That seems to work. However this is a very cumbersome solution.cgnieder wrote:Try only typingpdflatex
. You should get a prompt starting with**
. You can then inserted the\catcode ... \input ...
stuff. However, IMHO you should first try saving the file again with correct encodings like I did. If that doesn't help you can still try this way.
Regards
TeXLive: LaTeX Error: Missing \begin{document}
I know. But this isn't:Spixi wrote:[...] this is a very cumbersome solution.
Since the file only consists of two lines you could also simply create a newcgnieder wrote:However, for me it helped to save yourfolien.tex
once with iso-8859-1 encoding and then again with utf-8 encoding. (Maybe the second step alone would've also helped...)
folien.tex
with the right encoding from the start.Regards
site moderator & package author
Re: TeXLive: LaTeX Error: Missing \begin{document}
Saving as ISO-8859-1 failed. So I recreated "clean" files via copy and paste. Now it works again. Thank you.