下面是我收到 LaTeX 错误 missing 的 LaTeX 代码\begin document{}
。我该如何解决此错误?
\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}
\let\proof\relax
\let\endproof\relax
\def\nref#1{(\ref{#1})}
\def\figref#1{Fig.~\ref{#1}}
\def\Dirfig{./Figures/}
\begin{document}
\title{}
\maketitle
\begin{abstract}
\end{abstract}
\keywords{D, P, E}
\bibliographystyle{plain}
\bibliography{allcomm}
\end{document}
这是我在日志文件中使用 \filelist 得到的结果
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:\phases4en\trunk\PowerAwSC13\e2sc.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:\phases4en\trunk\PowerAwSC13\acm_proc_article-sp.cls
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\epsfig.sty"
Package: epsfig 1999/02/16 v1.7a (e)psfig emulation (SPQR)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.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 Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.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 Files\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
Package: amssymb 2013/01/14 v3.01 AMS font symbols
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.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 Files\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty"
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip41
For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amstext.sty"
Package: amstext 2000/06/29 v2.01
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks16
\ex@=\dimen106
))
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen107
)
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsopn.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
答案1
尝试将文档保存为 utf-8。很有可能文档中有一些不可见的 BOM 字符,会使解析器感到困惑。
可以使用 Notepad++(编码选项卡)检查文档编码。此外,您还可以使用 Notepad++ 的编码 -> 转换为 UTF-8 将其转换为 UTF-8。
答案2
我遇到了同样的错误,只需“删除辅助文件”即可。用新名称保存,特别是用 UTF-8 编码用新名称保存也有效,但我想这些解决方案只会分散我对实际问题的注意力。
答案3
放置\let
命令前包裹amsthm
:
...
\let\proof\relax
\let\endproof\relax
\usepackage{amsthm}
...
但是,看起来您不需要 ams 包。在我的文件列表中,您会在\listfiles
第一行看到它。它位于日志文件的末尾:
*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
***********
答案4
就我的情况而言,通过避免主文件标题中出现任何空白,问题得到了解决。这不是真正的解决方案,但确实有帮助。