TransWikia.com

LaTeX Error-Missing Begin Document

TeX - LaTeX Asked by Vaibhav Sundriyal on April 22, 2021

Below is the LaTeX code for which I am getting the LaTeX error missing begin document{}. How can I resolve this error?

 documentclass{acm_proc_article-sp}
    usepackage{algorithmic}
    usepackage{soul}
    usepackage[english]{babel}
    usepackage{setspace}
    usepackage{psfrag}
    usepackage{epsfig}
    usepackage{graphicx}
    usepackage{amssymb,amsmath}
    usepackage{graphicx}
    usepackage{footmisc}
    usepackage{cases}
    usepackage{verbatim}
    usepackage{fancyhdr}
    usepackage{color}
    usepackage{url}
    usepackage[capitalize]{cleveref}
    usepackage{placeins}
    usepackage{subfigure}
    usepackage{multirow}
    usepackage{makecell}
    usepackage{amsthm}
    usepackage{setspace}
    usepackage{moreverb}
    usepackage{paralist}
    letproofrelax
    letendproofrelax

    defnref#1{(ref{#1})}
    deffigref#1{Fig.~ref{#1}}
    defDirfig{./Figures/}



    begin{document}
     title{}
    maketitle
    begin{abstract}

    end{abstract}



    keywords{D, P, E}


     bibliographystyle{plain}

    bibliography{allcomm}
    end{document}

Here is what I get by using filelist in the log file

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2013.10.13)  13 OCT 2013 07:50
entering extended mode
**e2sc.tex
(F:phases4entrunkPowerAwSC13e2sc.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic, 
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
 lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
(F:phases4entrunkPowerAwSC13acm_proc_article-sp.cls
("C:Program FilesMiKTeX 2.9texlatexgraphicsepsfig.sty"
Package: epsfig 1999/02/16 v1.7a (e)psfig emulation (SPQR)

("C:Program FilesMiKTeX 2.9texlatexgraphicsgraphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:Program FilesMiKTeX 2.9texlatexgraphicskeyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
KV@toks@=toks14
)
("C:Program FilesMiKTeX 2.9texlatexgraphicsgraphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

("C:Program FilesMiKTeX 2.9texlatexgraphicstrig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:Program FilesMiKTeX 2.9texlatex0miktexgraphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.

("C:Program FilesMiKTeX 2.9texlatexpdftex-defpdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

("C:Program FilesMiKTeX 2.9texgenericoberdiekinfwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:Program FilesMiKTeX 2.9texgenericoberdiekltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
Gread@gobject=count79
))
Gin@req@height=dimen102
Gin@req@width=dimen103
)
epsfxsize=dimen104
epsfysize=dimen105
)
("C:Program FilesMiKTeX 2.9texlatexamsfontsamssymb.sty"
Package: amssymb 2013/01/14 v3.01 AMS font symbols

("C:Program FilesMiKTeX 2.9texlatexamsfontsamsfonts.sty"
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
@emptytoks=toks15
symAMSa=mathgroup4
symAMSb=mathgroup5
LaTeX Font Info:    Overwriting math alphabet `mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
))
("C:Program FilesMiKTeX 2.9texlatexamsmathamsmath.sty"
Package: amsmath 2013/01/14 v2.14 AMS math features
@mathmargin=skip41

For additional information on amsmath, use the `?' option.
("C:Program FilesMiKTeX 2.9texlatexamsmathamstext.sty"
Package: amstext 2000/06/29 v2.01

("C:Program FilesMiKTeX 2.9texlatexamsmathamsgen.sty"
File: amsgen.sty 1999/11/30 v2.0
@emptytoks=toks16
ex@=dimen106
))
("C:Program FilesMiKTeX 2.9texlatexamsmathamsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d
pmbraise@=dimen107
)
("C:Program FilesMiKTeX 2.9texlatexamsmathamsopn.sty"
Package: amsopn 1999/12/14 v2.01 operator names
)
inf@bad=count80
LaTeX Info: Redefining frac on input line 210.
uproot@=count81
leftroot@=count82
LaTeX Info: Redefining overline on input line 306.
classnum@=count83
DOTSCASE@=count84
LaTeX Info: Redefining ldots on input line 378.
LaTeX Info: Redefining dots on input line 381.
LaTeX Info: Redefining cdots on input line 466.
Mathstrutbox@=box26
strutbox@=box27
big@size=dimen108
LaTeX Font Info:    Redeclaring font encoding OML on input line 566.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 567.
macc@depth=count85
c@MaxMatrixCols=count86
dotsspace@=muskip1

7 Answers

put the let-commands before package amsthm:

...
letproofrelax
letendproofrelax
usepackage{amsthm}
...

However, it lokks like that you do not need the ams package. My filelist, you'll get it with listfiles as first line. It is at the end of your logfile:

*File List*
acm_proc_article-sp.cls 2009/04/22 - V3.2SP - based on esub2acm.sty <23 Apri
l 96>
epsfig.sty 1999/02/16 v1.7a (e)psfig emulation (SPQR)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
amsmath.sty 2013/01/14 v2.14 AMS math features
amstext.sty 2000/06/29 v2.01
amsgen.sty 1999/11/30 v2.0
amsbsy.sty 1999/11/29 v1.2d
amsopn.sty 1999/12/14 v2.01 operator names
latexsym.sty 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
t1aer.fd 1997/11/16 Font definitions for T1/aer.
algorithmic.sty 2009/08/24 v0.1 Document Style `algorithmic'
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
soul.sty 2003/11/17 v2.4 letterspacing/underlining (mf)
babel.sty 2013/05/16 v3.9f The Babel package
english.ldf 2012/08/20 v3.3p English support from the babel system
setspace.sty 2011/12/19 v6.7a set line spacing
psfrag.sty 1998/04/11 v3.04 PSfrag (MCG)
footmisc.sty 2011/06/06 v5.5b a miscellany of footnote facilities
cases.sty 2002/05/02 ver 2.5
verbatim.sty 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
fancyhdr.sty
color.sty 2005/11/14 v1.0j Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc.
cleveref.sty 2013/03/22 v0.18.9 Intelligent cross-referencing
placeins.sty 2005/04/18 v 2.2
subfigure.sty 2002/03/15 v2.1.5 subfigure package
subfigure.cfg
multirow.sty
makecell.sty 2009/08/03 V0.1e Managing of Tab Column Heads and Cells
array.sty 2008/09/09 v2.4c Tabular extension package (FMi)
amsthm.sty 2004/08/06 v2.20
moreverb.sty 2008/06/03 v2.3a `more' verbatim facilities
paralist.sty 2013/06/09 v2.4 Extended list environments
supp-pdf.mkii
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
umsa.fd 2013/01/14 v3.01 AMS symbols A
umsb.fd 2013/01/14 v3.01 AMS symbols B
ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
***********

Answered by user2478 on April 22, 2021

Try saving the document as utf-8. Chances are it has been saved with some invisible BOM characters that confuse the parser.

The document encoding can be checked with e.g. Notepad++ (Encoding tab). Also, you may convert to UTF-8 with Notepad++ with Encoding -> Convert to UTF-8.

Answered by Cam Cairns on April 22, 2021

I had the same error and simply had to "Trash Aux Files". Saving under a new name and in particular saving under a new name with UTF-8 encoding also worked, but I guess those solutions only distract from what the real issue was in my case.

Answered by Jacob Akkerboom on April 22, 2021

I was using LyX and that kind of error message appeared. The reason was that there was a special character (umlaut) in the path of the .lyx file. Renaming the relevant directory helped.

Answered by ominug on April 22, 2021

In my case the error was caused by a spurious empty line after setbeamertemplate{...}:

Error:

setbeamertemplate{mytemplate}

{
leavemode%
% ...
}

works:

setbeamertemplate{mytemplate}
{
leavemode%
%...
}

Answered by konstantin on April 22, 2021

In my case, the problem was solved by avoiding any empty space in the main file title. It is not a real solution, but it helps.

Answered by MaoZed on April 22, 2021

In my case, this error was caused by the incompatibility of the class (osajnl.cls) with the newer version of MiKTeX compiler. After downloading the upgraded version of the class, the MiKTeX compiling went smoothly.

Answered by Dejan Pljevljakusic on April 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP