Latex常见错误解析

Latex Error Classes

http://blog.sina.com.cn/s/blog_5e16f1770100pawb.html

转自:http://blog.sina.com.cn/s/blog_5e16f1770100pawb.html

较为模糊的错误

This is a list of error classes with ambiguos error messages. Here either the errors are have different causes and the message output is same or else the errors have the same root cause but the messages are different.

S.NoClass错误提示信息错误原因简析
1 e_des ! LaTeX Error: There's no line here to end Usage of \\ at the end of a long label in 'description' environment
2 e_center ! LaTeX Error: There's no line here to end Usage of \\ after the heading line in 'center' environment
3 e_foot ! Argument of \@sect has an extra } Usage of a fragile command 'footnote' within \section
4 e_ragged ! Argument of \@caption has an extra } Usage of \\ within \raggedright or \raggedleft environment
5 e_and ! Extra alignment tab has been changed to \cr Too many &s in a row of a table or array or eqnarray.
6 e_cline ! Extra alignment tab has been changed to \cr Reference no non existing column in \cline
7 e_col ! Extra alignment tab has been changed to \cr. Usage @ in tabular* environment
8 e_num ! Missing number treated as zero Usage of non numeric parameter after \\
9 e_asterisk Missing * at the end of the line * is not printed when used without brace after \\
10 e_pbox_miss ! Missing number, treated as zero. \parbox[t]{} ..Missing argument to parbox
11 e_mis_circle ! Missing number, treated as zero. Missing numeric parameter to \circle
12 e_list ! Argument of \lst@next has an extra } Usage of 1stlisting inside fragile command \parbox
13 e_capacity ! TeX capacity exceeded, sorry [input stack size=1500] Usage of 1stlisting inside fragile command \parbox
14 e_runaway Runaway argument? Generally because of missing braces, e.g \cline{1-2 instead of \cline{1-2}
15 e_verbatim Runaway argument? Usage of verbatim within scope of another command e.g: \ifthenelse
16 e_undefined ! Undefined control sequence Usage of an unknown command
17 e_footnote ! Undefined control sequence Usage of \footnote within \footnote
18 e_integral ! Missing { inserted. Integral bounds are malformed
19 e_zeta ! Missing { inserted. Extra subscript before integral upper limit term
20 e_bezier ! Illegal unit of measure (pt inserted). Missing numeric argument to \qbezier
21 e_too_bezier ! Illegal unit of measure (pt inserted). Too many arguments to \qbezier
22 e_unit ! Illegal unit of measure (pt inserted) \parbox[t]{2} ..Illegal unit of second parameter
23 e_symfoot ! LaTeX Error: Counter too large. More than 9 footnotes when using symbolic footnotes
24 e_large_count ! LaTeX Error: Counter too large. Trying to display a corresponding letter for a counter vallue >26
25 e_begin ! LaTeX Error: Missing \begin{document} Either text has been placed before \begin{document} or \begin{document} is missing
26 e_margin ! LaTeX Error: Missing \begin{document}. Misuse of \marginsize

常见错误

S.NoClass错误提示信息错误原因简析
1 e_fileEnd ! File ended while scanning use of \end. Generally caused because of missing a brace
2 e_end No message only an asterisk, i.e * Missing \end{document}
3 e_illegal LaTeX Error: Illegal character in array arg Usage of a letter other than r,l and c in tabular environment
4 e_tab ! Misplaced alignment tab character & Missing \begin{tabular} while using tabular environment
5 e_backslash ! Missing \endcsname inserted Usage of a backslash in front of the name of an environment, e.g \begin{\itemize}
6 e_delimiter ! LaTeX Error: Bad math environment delimiter Missing \right immediately after the array environment
7 e_right ! Extra \right \right has no matching \left OR \end{array} is missing
8 e_package ! LaTeX Error: Can only be used in preamble Usage of \usepackage outside the preamble
9 e_math ! Missing $ inserted Missing a starting or ending $ in Math mode, e.g m_e instead of $m_e$
10 e_parameter ! Illegal parameter number in definition of... Usage of parameter number greater than the number of parameters defined in \newcommand, e.g \newcommand{\test}[1]{#3}
11 e_cmd ! LaTeX Error: Command ... already defined Trying to define already existing command, e.g \newcommand{\time}
12 e_caption ! LaTeX Error: \caption outside float \caption{...} used outside table environment
13 e_braces ! Too many }'s Missing \begin{table}statement
14 e_parbox ! Argument of \@caption has an extra } Usage of \parbox in a \caption
15 e_item ! LaTeX Error: Something's wrong--perhaps a missing \item Missing \item within enumerate environment
16 e_fraction ! Argument of \end has an extra } Misuse of fraction cmd e.g \frac{1,2}
17 e_verb ! LaTeX Error: \verb ended by end of line Newline after \verb, e.g. \verb*dir*
18 e_invalid ! LaTeX Error: Command \end{itemize} invalid in math mode Missing $ while using math mode in \itemize
19 e_equation ! Display math should end with $$ Usage of $$ inside equation mode
20 e_column ! Misplaced \omit Usage of \newcommand and \multicolumn within tabular environment
21 e_subscript ! Double subscript. Usage of double subscript
22 e_cls ! LaTeX Error: File `artcle.cls' not found. Missing .sty or .cls file
23 e_nofile ! LaTeX Error: File `file1.tex' not found. Missing file1.tex, e.g. \input{file1.tex}
24 e_sty ! LaTeX Error: File `anysize1.sty' not found Use of unavailable package
25 e_doc_class ! LaTeX Error: Can be used only in preamble. Usage of \documentclass outside preamble
26 e_circle ! LaTeX Error: Command \circle invalid in math mode. Usage of \circle in math mode
27 e_picture ! Use of \pictur@ doesn't match its definition. Bad parameter to \picture
28 e_line ! Use of \put dosen't match its definition Badly formatted \line directive
29 e_line_arg ! LaTeX Error: Bad \line or \vector argument. Bad \line parameter
30 e_counter ! LaTeX Error: No counter '10' defined. Counter undefined
31 e_outer ! LaTeX Error: Not in outer par mode. Using figure inside parbox
32 e_minipage ! LaTeX Error: Not in outer par mode. Using figure minipage
33 e_lost ! LaTeX Error: Float(s) lost. Counter undefined
34 e_lonely ! LaTeX Error: Lonely \item--perhaps a missing list environment. Usage of \item outside list environment
35 e_parg ! LaTeX Error: Missing p-arg in array arg. Missing p argument in tabular environment
36 e_hash ! You can't use `macro parameter character #' in vertical mode. Usage of # in normal mode
37 e_enlarge ! LaTeX Error: Suggested extra height (14454.0pt) dangerously large. Too big a number given in \enlargethispage
38 e_deftab ! LaTeX Error: Undefined tab position. Undefined tabbing
39 e_pushtab ! LaTeX Error: \pushtabs and \poptabs don't match. Unequal numbers of push and pop tabs
40 e_overtab ! LaTeX Error: Tab overflow. Too many \= in tabbing environment
41 e_nest ! LaTeX Error: Too deeply nested. Too many list environments
42 e_eqnarray ! LaTeX Error: Too many columns in eqnarray environment. More than three columns in eqnarray
43 e_classpkg ! LaTeX Error: \usepackage before \documentclass. Usage of usepackage before loading documentclass
44 e_load ! LaTeX Error: Two \LoadClass commands. More than one load class command
45 e_require ! LaTeX Error: \RequirePackage or \LoadClass in Options Section. RequirePackage may not be used with \DeclareOption
46 e_twoclass ! LaTeX Error: Two \documentclass or \documentstyle commands. More than one documentclass declaration
47 e_font ! LaTeX Error: This NFSS system isn't set up properly. Invalid font used in \DeclareErrorFont
48 e_superscript ! Double superscript. Usage of two superscripts for the same variable, e.g. 2^3^4
49 e_clash_opt ! LaTeX Error: Option clash for package csvtools. Clashing options for the same package
50 e_unknown_opt ! LaTeX Error: Unknown option ... for package ... Unkown option for a package
51 e_hyphenation ! Improper \hyphenation will be flushed. Improper parameter to \hyphenation
52 e_stack_size ! TeX capacity exceeded, sorry [main memory size=1000000] Overflow of buffer due to mistake in command definition
53 e_environment ! LaTeX Error: Environment ... undefined. Undefined environment
54 e_midline ! LaTeX Error: \< in mid line Command \< may appear only at the beginning of a line
55 e_infinite Goes into infinite loop Usage of \\strut\hrule

### 回答1: 这句话的意思是“只能在导言部分使用。 \usepackage”。在 LaTeX 中,导言部分是指文档的开头,用于定义文档的格式、样式和宏包等。因此,\usepackage 命令只能在导言部分使用,用于引入需要的宏包。如果在文档正文中使用该命令,会导致编译错误。 ### 回答2: \usepackage是LaTeX中一种用于加载宏包的命令。通常,宏包是一种预定义好的文件,包含了一些扩展、定制或自定义的功能,以便LaTeX用户更方便地编辑或排版文档。而\usepackage命令则是告诉LaTeX引擎需要使用哪些宏包来实现一些特定的功能。 然而,可以使用\usepackage命令的位置有限制,只能在文档的导言区(即在\begin{document}命令之前)使用。因此,\usepackage命令不能在文档正文或环境中使用。这是因为宏包必须在LaTeX引擎开始编译前被加载,否则就会出现一些奇怪的错误。 在导言区中使用\usepackage命令的一般格式如下: \documentclass{article} \usepackage{宏包1} \usepackage{宏包2} ... \usepackage{宏包n} \begin{document} ... \end{document} 其中,宏包1到宏包n表示需要加载的宏包名字,多个宏包可以用逗号分隔。在加载宏包时,需要注意宏包之间的依赖关系,有些宏包需要依赖其他宏包才能正常工作,因此我们需要按照依赖顺序正确加载宏包。 总之,\usepackage命令是LaTeX中非常重要的命令之一,它可以用于加载宏包来实现各种功能,但是必须在导言区中使用,不能在文档正文或环境中使用。 ### 回答3: 在LaTeX中,\usepackage命令用于加载宏包,它只能在文档的导言区使用。导言区是文档正文之前的一段代码区域,用于定义文档的基本格式和样式,包括设置文档类型、页面布局、字体、页眉页脚、图表等。因为宏包是用来扩展LaTeX功能的一种工具,其定义的命令和环境需要在文档正文中使用,所以必须在导言区用\usepackage命令将宏包加载到文档中,才能在正文中使用它们。 \usepackage命令的语法格式是: \usepackage[options]{package name} 其中,options是可选的宏包选项,package name是要加载的宏包名字。使用宏包选项可以为宏包提供额外的配置信息,以满足特定的需求。 例如,当我们需要在LaTeX文档中插入图片时,需要用到graphicx宏包。在文档的导言区使用\usepackage{graphicx}命令将该宏包加载进来,并设置好图片插入的默认选项。然后,在正文中使用\includegraphics命令即可插入图片。如果没有加载graphicx宏包,则无法使用该命令,导致无法插入图片。 总之,\usepackage命令是LaTeX中常用的命令之一,用于加载宏包以扩展LaTeX功能。虽然它只能在文档导言区使用,但它为LaTeX用户提供了更多的功能选择和定制化的机会。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值