updated
[latex2e.git] / base / lterror.dtx
blobebc070f11d1e3238e65e3ff694225c18fab4055a
1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 Project and any individual authors listed elsewhere
5 % in this file. 
6
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 %    http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX 
16 % version 2005/12/01 or later.
17
18 % This file has the LPPL maintenance status "maintained".
19
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23
24 % The list of derived (unpacked) files belonging to the distribution 
25 % and covered by LPPL is defined by the unpacking scripts (with 
26 % extension .ins) which are part of the distribution.
27
28 % \fi
30 % \iffalse
31 %%% From File: lterror.dtx
32 %<def>\ProvidesFile{autoerr.sty}
33 %<def>       [1995/11/28 v1.2l LaTeX error autoload file]
34 %<*driver>
35 % \fi
36 \ProvidesFile{lterror.dtx}
37              [1998/05/28 v1.2n LaTeX Kernel (errors)]
38 % \iffalse
39 \documentclass{ltxdoc}
40 \GetFileInfo{lterror.dtx}
41 \title{\filename}
42 \date{\filedate}
43  \author{%
44   Johannes Braams\and
45   David Carlisle\and
46   Alan Jeffrey\and
47   Leslie Lamport\and
48   Frank Mittelbach\and
49   Chris Rowley\and
50   Rainer Sch\"opf}
51 \begin{document}
52 \maketitle
53  \DocInput{\filename}
54 \end{document}
55 %</driver>
56 % \fi
58 % \CheckSum{442}
60 % \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.}
61 % \changes{v1.1a}{1994/05/16}{(ASAJ) Completely new error interface.}
62 % \changes{v1.1b}{1994/05/17}{(ASAJ) Moved error stuff from
63 %    ltdefns.dtx.}
64 % \changes{v1.1c}{1994/05/20}{(ASAJ) Added \cs{@latex@info@no@line}.}
65 % \changes{v1.1c}{1994/05/20}{(ASAJ) Added missing full stops.}
66 % \changes{v1.1c}{1994/05/20}{(ASAJ) Fixed a bug with
67 %    \cs{@inmatherr}.}
68 % \changes{v1.1d}{1994/05/21}{(ASAJ) Made the error commands robust.}
69 % \changes{v1.1e}{1994/05/22}{(ASAJ) Replaced bgroup by begingroup in
70 %    error messages, to stop extra mathords creeping into math mode.}
71 % \changes{v1.2a}{1994/05/22}{(ASAJ) Replaced \cs{@generic@message} and 
72 %    \cs{@generic@error} by \cs{GenericError}, \cs{GenericWarning} and 
73 %    \cs{GenericInfo}.}
74 % \changes{v1.2a}{1994/05/22}{(ASAJ) Made \cs{GenericError}, 
75 %    \cs{GenericWarning} and \cs{GenericInfo} robust.}
76 % \changes{v1.2a}{1994/05/22}{(ASAJ) Replaced \cmd\\ and tilde by 
77 %    \cs{MessageBreak} and \cs{space}.}
78 % \changes{v1.2a}{1994/05/22}{(ASAJ) Replaces \cs{string} by 
79 %    \cs{protect} in some messages.}
80 % \changes{v1.2f}{1994/05/24}{(DPC) wrap long lines}
81 % \changes{v1.2h}{1994/11/17}
82 %         {\cs{@tempa} to \cs{reserved@a}}
83 % \changes{v1.2i}{1995/09/01}
84 %         {Add autoload support}
85 % \changes{v1.2j}{1995/10/09}
86 %         {Modify autoload support}
88 % \section{Error handling}
90 % This section defines \LaTeX's error commands.
92 % \StopEventually{}
95 % The `2ekernel' code ensures that a |\usepackage{autoerr}| is
96 % essentially ignored if a `full' format is being used that has
97 % the error messages already in the format.
98 %    \begin{macrocode}
99 %<2ekernel>\expandafter\let\csname ver@autoerr.sty\endcsname\fmtversion
100 %    \end{macrocode}
102 %    \begin{macrocode}
103 %<*2ekernel|autoload>
104 %    \end{macrocode}
106 % \subsection{General commands}
108 % \begin{macro}{\MessageBreak}
109 %    This command prints a new-line inside a message, followed by a 
110 %    continuation line begun with |\@msg@continuation|.  Normally it is 
111 %    defined to be |\relax|, but inside messages, it is let to 
112 %    |\@message@break|.
113 %    \begin{macrocode}
114 \let\MessageBreak\relax
115 %    \end{macrocode}
116 % \end{macro}
118 % \changes{v1.2g}{1994/11/04}{Added \cs{set@display@protect} to
119 %    \cs{Generic*} commands.  ASAJ.}
121 % \begin{macro}{\GenericInfo}
122 %    This takes two arguments: a continuation and a message, and sends 
123 %    the result to the log file.
124 %    \begin{macrocode}
125 \DeclareRobustCommand{\GenericInfo}[2]{%
126    \begingroup
127       \def\MessageBreak{^^J#1}%
128       \set@display@protect
129       \immediate\write\m@ne{#2\on@line.}%
130    \endgroup
132 %    \end{macrocode}
133 % \end{macro}
135 % \begin{macro}{\GenericWarning}
136 %    This takes two arguments: a continuation and a message, and sends 
137 %    the result to the screen.
138 %    \begin{macrocode}
139 \DeclareRobustCommand{\GenericWarning}[2]{%
140    \begingroup
141       \def\MessageBreak{^^J#1}%
142       \set@display@protect
143       \immediate\write\@unused{^^J#2\on@line.^^J}%
144    \endgroup
146 %</2ekernel|autoload>
147 %    \end{macrocode}
148 % \end{macro}
150 % \begin{macro}{\GenericError}
151 % This macro takes four arguments: a continuation,
152 % an error message, where to go for further information, and the help
153 % information.  It displays the error message, and sets the error help
154 % (the result of typing |h| to the prompt), and does a horrible hack
155 % to turn the last context line (which by default is the only context
156 % line) into just three dots.  This could be made more efficient.
157 % \changes{v1.2d}{1994/05/22}
158 %     {(DPC) New version using long command name.}
159 % \changes{v1.2d}{1994/05/22}
160 %     {(DPC) Alternative version added for old TeXs}
161 %    \begin{macrocode}
162 %<autoload>\def\GenericError{\@autoerr\GenericError}
163 %<*2ekernel|def>
164 \bgroup
165 \lccode`\@=`\ %
166 \lccode`\~=`\ %
167 \lccode`\}=`\ %
168 \lccode`\{=`\ %
169 \lccode`\T=`\T%
170 \lccode`\H=`\H%
171 \catcode`\ =11\relax%
172 \lowercase{%
173 \egroup%
174 %    \end{macrocode}
176 % Unfortunately \TeX\ versions older than 3.141 have a bug which means
177 % that |^^J| does not force a linebreak in |\message| and |\errmessage|
178 % commands. So for these old \TeX's we use |\typeout| to produce the
179 % message, and then have an empty |\errmessage| command. This causes an
180 % extra line of the form
181 %\begin{verbatim}
182 %! .
183 %\end{verbatim}
184 % To appear on the terminal, but if you do not like it, you can always
185 % upgrade your \TeX! In order for your format to use this version, you
186 % must define the macro |\@TeXversion| to be the version number, e.g.,
187 % 3.14 of the underlying \TeX. See the comments in
188 % \texttt{ltdircheck.dtx}.
189 %    \begin{macrocode}
190 \dimen@\ifx\@TeXversion\@undefined4\else\@TeXversion\fi\p@%
191 \ifdim\dimen@>3.14\p@%
192 %    \end{macrocode}
194 % First the `standard case'.
195 %    \begin{macrocode}
196 \DeclareRobustCommand{\GenericError}[4]{%
197 \begingroup%
198 \immediate\write\@unused{}%
199 \def\MessageBreak{^^J}%
200 \set@display@protect%
201 \edef%
202 %    %<-------------------do not delete this space!------------------->%
203 \@err@                                                                 %
204 {{#4}}%
205 \errhelp
206 %    %<-------------------do not delete this space!------------------->%
207 \@err@                                                                 %
208 \let
209 %    %<-------------------do not delete this space!------------------->%
210 \@err@                                                                 %
211 \@empty
212 \def\MessageBreak{^^J#1}%
213 \def~{\errmessage{%
214 #2.^^J^^J%
215 #3^^J%
216 Type  H <return>  for immediate help%
217 %    %<-------------------do not delete this space!------------------->%
218 \@err@                                                                 %
221 \endgroup}%
222 %    \end{macrocode}
224 %    \begin{macrocode}
225 \else%
226 %    \end{macrocode}
228 % Secondly the version for old \TeX's.
229 %    \begin{macrocode}
230 \DeclareRobustCommand{\GenericError}[4]{%
231 \begingroup%
232 \immediate\write\@unused{}%
233 \def\MessageBreak{^^J}%
234 \set@display@protect%
235 \edef%
236 %    %<-------------------do not delete this space!------------------->%
237 \@err@                                                                 %
238 {{#4}}%
239 \errhelp
240 %    %<-------------------do not delete this space!------------------->%
241 \@err@                                                                 %
242 \let
243 %    %<-------------------do not delete this space!------------------->%
244 \@err@                                                                 %
245 \errmessage
246 \def\MessageBreak{^^J#1}%
247 \def~{\typeout{! %
248 #2.^^J^^J%
249 #3^^J%
250 Type  H <return>  for immediate help.}%
251 %    %<-------------------do not delete this space!------------------->%
252 \@err@                                                                 %
253 {}}%
255 \endgroup}%
256 %    \end{macrocode}
258 %    \begin{macrocode}
259 \fi}%
260 %</2ekernel|def>
261 %    \end{macrocode}
262 % \end{macro}
264 % \begin{macro}{\PackageError}
265 % \begin{macro}{\PackageWarning}
266 % \begin{macro}{\PackageWarningNoLine}
267 % \begin{macro}{\PackageInfo}
268 % \begin{macro}{\ClassError}
269 % \begin{macro}{\ClassWarning}
270 % \begin{macro}{\ClassWarningNoLine}
271 % \begin{macro}{\ClassInfo}
272 %  These commands are intended for use by package and class writers, to
273 %  give information to authors.  The syntax is:
274 %    \begin{quote}
275 %       |\PackageError{|\meta{package}|}{|^^A
276 %          \meta{error}|}{|\meta{help}|}| \\
277 %       |\PackageWarning{|\meta{package}|}{|\meta{warning}|}| \\
278 %       |\PackageWarningNoLine{|\meta{package}|}{|\meta{warning}|}| \\
279 %       |\PackageInfo{|\meta{package}|}{|\meta{info}|}|
280 %    \end{quote}
281 %    and similarly for classes.  The |Error| commands print the
282 %    \meta{error} message, and present the interactive prompt; if the
283 %    author types |h|, then the \meta{help} information is displayed.
284 %    The |Warning| commands produce a warning but do not present the
285 %    interactive prompt.  The |WarningNoLine| commands do the same,
286 %    but don't print the input line number.  The |Info| commands write
287 %    the message to the
288 %    |log| file.  Within the messages, the command 
289 %    |\MessageBreak| can be used to
290 %    break a line, |\protect| can be used to protect command names,
291 %    and |\space| is a space, for example:
292 % \begin{verbatim}
293 %    \newcommand{\foo}{FOO}
294 %    \PackageWarning{ethel}{%
295 %       Your hovercraft is full of eels,\MessageBreak
296 %       and \protect\foo\space is \foo}
297 % \end{verbatim}
298 %    produces:
299 % \begin{verbatim}
300 %    Package ethel warning: Your hovercraft is full of eels,
301 %    (ethel)                and \foo is FOO on input line 54.
302 % \end{verbatim}
304 %    \begin{macrocode}
305 %<autoload>\def\PackageError{\@autoerr\PackageError}
306 %<*2ekernel|def>
307 \gdef\PackageError#1#2#3{%
308    \GenericError{%
309       (#1)\@spaces\@spaces\@spaces\@spaces
310    }{%
311       Package #1 Error: #2%
312    }{%
313       See the #1 package documentation for explanation.%
314    }{#3}%
316 %</2ekernel|def>
317 %    \end{macrocode}
319 %    \begin{macrocode}
320 %<*2ekernel|autoload>
321 \def\PackageWarning#1#2{%
322    \GenericWarning{%
323       (#1)\@spaces\@spaces\@spaces\@spaces
324    }{%
325       Package #1 Warning: #2%
326    }%
328 \def\PackageWarningNoLine#1#2{%
329    \PackageWarning{#1}{#2\@gobble}%
331 \def\PackageInfo#1#2{%
332    \GenericInfo{%
333       (#1) \@spaces\@spaces\@spaces
334    }{%
335       Package #1 Info: #2%
336    }%
338 %</2ekernel|autoload>
339 %    \end{macrocode}
341 % \changes{v1.2l}{1995/11/28}
342 %     {Typo in autoload code /1985}
343 %    \begin{macrocode}
344 %<autoload>\def\ClassError{\@autoerr\ClassError}
345 %<*2ekernel|def>
346 \gdef\ClassError#1#2#3{%
347    \GenericError{%
348       (#1) \space\@spaces\@spaces\@spaces
349    }{%
350       Class #1 Error: #2%
351    }{%
352       See the #1 class documentation for explanation.%
353    }{#3}%
355 %</2ekernel|def>
356 %    \end{macrocode}
358 %    \begin{macrocode}
359 %<*2ekernel|autoload>
360 \def\ClassWarning#1#2{%
361    \GenericWarning{%
362       (#1) \space\@spaces\@spaces\@spaces
363    }{%
364       Class #1 Warning: #2%
365    }%
367 \def\ClassWarningNoLine#1#2{%
368    \ClassWarning{#1}{#2\@gobble}%
370 \def\ClassInfo#1#2{%
371    \GenericInfo{%
372       (#1) \space\space\@spaces\@spaces
373    }{%
374       Class #1 Info: #2%
375    }%
377 %</2ekernel|autoload>
378 %    \end{macrocode}
379 % \end{macro}
380 % \end{macro}
381 % \end{macro}
382 % \end{macro}
383 % \end{macro}
384 % \end{macro}
385 % \end{macro}
386 % \end{macro}
388 % \begin{macro}{\@latex@error}
389 % \begin{macro}{\@latex@warning}
390 % \begin{macro}{\@latex@warning@no@line}
391 % \begin{macro}{\@latex@info}
392 % \begin{macro}{\@latex@info@no@line}
393 % \changes{v1.2e}{1994/05/24}{Macro added}
394 %    Errors and other info, for use in the \LaTeX{} core.
395 %    \begin{macrocode}
396 %<autoload>\def\@latex@error{\@autoerr\@latex@error}
397 %<*2ekernel|def>
398 \gdef\@latex@error#1#2{%
399    \GenericError{%
400       \space\space\space\@spaces\@spaces\@spaces
401    }{%
402       LaTeX Error: #1%
403    }{%
404       See the LaTeX manual or LaTeX Companion for explanation.%
405    }{#2}%
407 %</2ekernel|def>
408 %    \end{macrocode}
410 %    \begin{macrocode}
411 %<*2ekernel|autoload>
412 \def\@latex@warning#1{%
413    \GenericWarning{%
414       \space\space\space\@spaces\@spaces\@spaces
415    }{%
416       LaTeX Warning: #1%
417    }%
419 %    \end{macrocode}
421 %    \begin{macrocode}
422 \def\@latex@warning@no@line#1{%
423    \@latex@warning{#1\@gobble}}
424 %    \end{macrocode}
426 %    \begin{macrocode}
427 \def\@latex@info#1{%
428    \GenericInfo{%
429       \@spaces\@spaces\@spaces
430    }{%
431       LaTeX Info: #1%
432    }%
434 %    \end{macrocode}
436 %    \begin{macrocode}
437 \def\@latex@info@no@line#1{%
438   \@latex@info{#1\@gobble}}
439 %    \end{macrocode}
441 %    |\@font@warning| and |\@font@info| are defined later since they
442 %    have to be redefined by the \texttt{tracefnt} package.
443 %\begin{verbatim}
444 %\def\@font@warning#1{%
445 %   \GenericWarning{%
446 %      {(font)\@spaces\@spaces}%
447 %      {Font Warning: #1}%
448 % }
449 %\def\@font@info#1{%
450 %   \GenericInfo{%
451 %      (font)\space\@spaces
452 %   }{%
453 %      Font Info: #1%
454 %   }%
455 % }
456 %\end{verbatim}
457 % \end{macro}
458 % \end{macro}
459 % \end{macro}
460 % \end{macro}
461 % \end{macro}
463 % \begin{macro}{\c@errorcontextlines}
464 % \changes{LaTeX2e}{1993/11/22}{Macro added}
465 %  |\errorcontextlines| as a \LaTeX\ counter, so that it may be be
466 %  manipulated with |\setcounter| (once it is defined :-)
467 %    \begin{macrocode}
468 \let\c@errorcontextlines\errorcontextlines
469 \c@errorcontextlines=-1
470 %    \end{macrocode}
471 % \end{macro}
473 % \changes{v1.0d}{1994/03/28}
474 %     {Remove test for \cs{inputlineno} undefined.}
475 % \begin{macro}{\on@line}
476 %    The message ` on input line~$n$', if possible.
477 %    \begin{macrocode}
478 \ifnum\inputlineno=\m@ne
479   \let\on@line\@empty
480 \else
481   \def\on@line{ on input line \the\inputlineno}
483 %    \end{macrocode}
484 % \end{macro}
486 %  \begin{macro}{\@warning}
487 %  \begin{macro}{\@@warning}
488 %  \begin{macro}{\@latexerr}
489 %     Older \LaTeX{} messages.  For the moment, these
490 %     |\let| to the new message commands.  They may be changed later,
491 %     once only obsolete packages and classes contain them.
492 % \changes{v1.0b}{1993/12/03}{Set \cs{c@errorcontextlines} to -1}
493 % \changes{v1.0e}{1993/04/09}{Mention The Companion}
494 % \changes{v1.0f}{1993/04/11}{Remove setting of errorcontextlines}
495 % \changes{v1.0k}{1994/05/01}{(CAR) Added draft \cs{@latexinfo}.}
496 % \changes{v1.0n}{1994/05/10}{(ASAJ) Added extra blank lines to
497 %           \cs{@latexerr}.}
498 % \changes{v1.0o}{1994/05/11}
499 %     {(ASAJ) Removed one of the extra blank lines to \cs{@latexerr}.}
500 %    \begin{macrocode}
501 \let\@warning\@latex@warning
502 \let\@@warning\@latex@warning@no@line
503 %</2ekernel|autoload>
504 \global\let\@latexerr\@latex@error
505 %    \end{macrocode}
506 %  \end{macro}
507 %  \end{macro}
508 %  \end{macro}
510 % \begin{macro}{\@spaces}
511 %    Four spaces.
512 %    \begin{macrocode}
513 %<*2ekernel|autoload>
514 \def\@spaces{\space\space\space\space}
515 %</2ekernel|autoload>
516 %    \end{macrocode}
517 % \end{macro}
519 % \subsection{Specific errors}
521 % \begin{macro}{\@eha}
522 % \begin{macro}{\@ehb}
523 % \begin{macro}{\@ehc}
524 % \begin{macro}{\@ehd}
525 %    The more common error help messages.
526 %    \begin{macrocode}
527 %<*2ekernel|def>
528 \gdef\@eha{%
529   Your command was ignored.\MessageBreak
530   Type \space I <command> <return> \space to replace it %
531   with another command,\MessageBreak
532   or \space <return> \space to continue without it.}
533 \gdef\@ehb{%
534   You've lost some text. \space \@ehc}
535 \gdef\@ehc{%
536   Try typing \space <return> %
537   \space to proceed.\MessageBreak
538   If that doesn't work, type \space X <return> \space to quit.}
539 \gdef\@ehd{%
540   You're in trouble here.  \space\@ehc}
541 %</2ekernel|def>
542 %    \end{macrocode}
543 % As |\latex@error| triggers the autoload, these definitions
544 % should not be needed in the autoload format, but just to be safe\ldots
545 %    \begin{macrocode}
546 %<*autoload>
547 \let\@eha\@empty\let\@ehb\@empty\let\@ehc\@empty\let\@ehd\@empty
548 %</autoload>
549 %    \end{macrocode}
550 % \end{macro}
551 % \end{macro}
552 % \end{macro}
553 % \end{macro}
555 % Here are most of the error message-generating commands of \LaTeX.
556 % \begin{macro}{\@autoerr}
557 % Make this autoload command robust, as it may be read in at
558 % unpredicatble times.
559 %    \begin{macrocode}
560 %<autoload>\def\@autoerr{\protect\@autoload{err}\protect}
561 %    \end{macrocode}
562 % \end{macro}
564 % \begin{macro}{\@notdefinable}
565 %    Error message generated in |\@ifdefinable| from calls
566 %    to one of the commands |\newcommand|, |\newlength| or |\newtheorem|
567 %    specifying an already-defined command name or one that begins
568 %    |\end...|.
569 % \changes{v1.2n}{1998/05/28}{Added message re `end...' pr/1555}
570 %    \begin{macrocode}
571 \gdef\@notdefinable{%
572 %<!autoload> \@latex@error{%
573 %<!autoload>   Command \@backslashchar\reserved@a\space
574 %<!autoload>   already defined.\MessageBreak
575 %<!autoload>   Or name \@backslashchar\@qend... illegal,
576 %<!autoload>   see p.192 of the manual}\@eha}
577 %<autoload>  \@autoerr\@notdefinable}
578 %    \end{macrocode}
579 % \end{macro}
581 % \begin{macro}{\@nolnerr}
582 % Generated by |\newline| and |\\| when called in vertical mode.
583 %    \begin{macrocode}
584 \gdef\@nolnerr{%
585 %<!autoload>  \@latex@error{There's no line here to end}\@eha}
586 %<autoload>  \@autoerr\@nolnerr}
587 %    \end{macrocode}
588 % \end{macro}
590 % \begin{macro}{\@nocounterr}
591 % \changes{v1.0h}{1994/04/17}{New name for error message,
592 %       old error message (without arg) kept}
593 %  Generated by |\setcounter|, |\addtocounter| or
594 %  |\newcounter| if applied to an undefined counter \meta{cnt}.
596 % \begin{macro}{\@nocnterr}
597 % Obsolete error message generated in \LaTeX2.09 by
598 % |\setcounter|, |\addtocounter| or |\newcounter|
599 % for undefined counter.
600 % DO NOT use for \LaTeXe\ it MIGHT vanish!
601 % Use |\@nocounterr|\marg{cnt} instead.
602 %    \begin{macrocode}
603 \gdef\@nocounterr#1{%
604 %<!autoload>  \@latex@error{No counter '#1' defined}\@eha}
605 %<autoload>  \@autoerr\@nocounterr}
606 \gdef\@nocnterr{\@nocounterr?}
607 %    \end{macrocode}
608 % \end{macro}
609 % \end{macro}
611 % \begin{macro}{\@ctrerr}
612 % Called when trying to print the value of a counter
613 % numbered by letters that's greater than 26.
614 %    \begin{macrocode}
615 \gdef\@ctrerr{%
616 %<!autoload>  \@latex@error{Counter too large}\@ehb}
617 %<autoload>  \@autoerr\@ctrerr}
618 %    \end{macrocode}
619 % \end{macro}
621 % \begin{macro}{\@nodocument}
622 % Error produced if paragraphs are typeset in the preamble.
623 % \changes{v1.2m}{1996/11/04}{Always define \cs{@nodocument}
624 %           in kernel, so that it can be cleared by \cs{document}.}
625 %    \begin{macrocode}
626 %<!def>\gdef\@nodocument{%
627 %<!def>  \@latex@error{Missing \protect\begin{document}}\@ehd}
628 %    \end{macrocode}
629 % \end{macro}
631 % \begin{macro}{\@badend}
632 % Called by |\end| that doesn't match its |\begin|.
633 % RmS 1992/08/24: added code to |\@badend| to display position of
634 %               non-matching |\begin|.
635 % FMi 1993/01/14: missing space added.
636 %    \begin{macrocode}
637 \gdef\@badend#1{%
638 %<!autoload>  \@latex@error{\protect\begin{\@currenvir}\@currenvline
639 %<!autoload>                     \space ended by \protect\end{#1}}\@eha}
640 %<autoload>  \@autoerr\@badend}
641 %    \end{macrocode}
642 % \end{macro}
644 % \begin{macro}{\@badmath}
645 % Called by |\[|, |\]|, |\(| or |\)| when used in wrong mode.
646 %    \begin{macrocode}
647 \gdef\@badmath{%
648 %<!autoload>  \@latex@error{Bad math environment delimiter}\@eha}
649 %<autoload>  \@autoerr\@badmath}
650 %    \end{macrocode}
651 % \end{macro}
653 % \begin{macro}{\@toodeep}
654 % Called by a list environment nested more than six levels
655 % deep, or an enumerate or itemize nested more than four levels.
656 %    \begin{macrocode}
657 \gdef\@toodeep{%
658 %<!autoload>  \@latex@error{Too deeply nested}\@ehd}
659 %<autoload>  \@autoerr\@toodeep}
660 %    \end{macrocode}
661 % \end{macro}
663 % \begin{macro}{\@badpoptabs}
664 % Called by |\endtabbing| when not enough |\poptabs| have
665 % occurred, or by |\poptabs| when too many have occurred.
666 %    \begin{macrocode}
667 \gdef\@badpoptabs{%
668 %<!autoload>  \@latex@error{\protect\pushtabs\space and \protect\poptabs
669 %<!autoload>      \space don't match}\@ehd}
670 %<autoload>  \@autoerr\@badpoptabs}
671 %    \end{macrocode}
672 % \end{macro}
674 % \begin{macro}{\@badtab}
675 % Called by |\>|, |\+| , |\-| or |\<| when stepping to an undefined tab.
676 %    \begin{macrocode}
677 \gdef\@badtab{%
678 %<!autoload> \@latex@error{Undefined tab position}\@ehd}
679 %<autoload>  \@autoerr\@badtab}
680 %    \end{macrocode}
681 % \end{macro}
683 % \begin{macro}{\@preamerr}
684 % \changes{v1.2k}{1995/10/24}
685 %         {Modify autoload support}
686 %    This error is special: it appears in places where we normally have
687 %    to |\protect| expansions. However, to prevent a protection of
688 %    the error message itself (which would result in the message
689 %    getting printed not issued on the terminal) we need to locally
690 %    reset |\protect| to |\relax|.
691 %    \begin{macrocode}
692 \gdef\@preamerr#1{%
693   \begingroup
694     \let\protect\relax
695 %<*!autoload>
696     \@latex@error{\ifcase #1 Illegal character\or
697      Missing @-exp\or Missing p-arg\fi\space
698      in array arg}\@ehd
699 %</!autoload>
700 %<autoload>  \@autoerr\@preamerr{#1}%
701   \endgroup}
702 %    \end{macrocode}
703 % \end{macro}
705 % \begin{macro}{\@badlinearg}
706 % Occurs in |\line| and |\vector| command when a bad slope
707 % argument is encountered.
708 %    \begin{macrocode}
709 \gdef\@badlinearg{%
710 %<!autoload>  \@latex@error{%
711 %<!autoload>       Bad \protect\line\space or \protect\vector 
712 %<!autoload>       \space argument}\@ehb}
713 %<autoload>  \@autoerr\@badlinearg}
714 %    \end{macrocode}
715 % \end{macro}
717 % \begin{macro}{\@parmoderr}
718 % Occurs in a float environment or a |\marginpar| when
719 % encountered in inner vertical mode.
720 %    \begin{macrocode}
721 \gdef\@parmoderr{%
722 %<!autoload>  \@latex@error{Not in outer par mode}\@ehb}
723 %<autoload>  \@autoerr\@parmoderr}
724 %    \end{macrocode}
725 % \end{macro}
727 % \begin{macro}{\@fltovf}
728 % Occurs in float environment or |\marginpar| when there
729 % are no more free boxes for storing floats.
730 %    \begin{macrocode}
731 \gdef\@fltovf{%
732 %<!autoload>  \@latex@error{Too many unprocessed floats}\@ehb}
733 %<autoload>  \@autoerr\@fltovf}
734 %    \end{macrocode}
735 % \end{macro}
737 % \begin{macro}{\@latexbug}
738 % Occurs in output routine.  This is bad news.
739 %    \begin{macrocode}
740 \gdef\@latexbug{%
741 %<!autoload>  \@latex@error{This may be a LaTeX bug}{Call for help}}
742 %<autoload>  \@autoerr\@latexbug}
743 %    \end{macrocode}
744 % \end{macro}
746 % \begin{macro}{\@badcrerr}
747 %    This error was removed and replaced by |\@nolnerr|.
748 % \changes{v1.0m}{1994/05/04}{Error message removed}
749 %    \begin{macrocode}
750 %\def\@badcrerr {\@latex@error{Bad use of \protect\\}\@ehc}
751 %    \end{macrocode}
752 % \end{macro}
754 % \begin{macro}{\@noitemerr}
755 % |\addvspace| or |\addpenalty| was called when not in
756 %  vmode. Probably caused by a missing |\item|.
757 %    \begin{macrocode}
758 \gdef\@noitemerr{%
759 %<!autoload>  \@latex@error{Something's wrong--perhaps a missing %
760 %<!autoload>      \protect\item}\@ehc}
761 %<autoload>  \@autoerr\@noitemerr}
762 %    \end{macrocode}
763 % \end{macro}
765 % \begin{macro}{\@notprerr}
766 % A command that can be used only in the preamble
767 % appears after the command |\begin{document}|.
768 %    \begin{macrocode}
769 \gdef\@notprerr{%
770 %<!autoload>  \@latex@error{Can be used only in preamble}\@eha}
771 %<autoload>  \@autoerr\@notprerr}
772 %    \end{macrocode}
773 % \end{macro}
775 %  \begin{macro}{\@inmatherr}
776 % \changes{v1.0j}{1994/04/28}{Macro added}
777 % \changes{v1.1c}{1994/04/28}{Replaced \cs{noexpand} with \cs{protect}.}
778 %    Issued by commands that don't work correctly within math (like
779 %    |\item|). There is no real error recovery happening, e.g., the
780 %    user might get additional errors afterwards.
781 %    \begin{macrocode}
782 \gdef\@inmatherr#1{%
783    \relax
784    \ifmmode
785 %<!autoload> \@latex@error{Command \protect#1 invalid in math mode}\@ehc
786 %<autoload>  \@autoerr\@inmatherr#1%
787    \fi}
788 %    \end{macrocode}
789 %  \end{macro}
791 % \begin{macro}{\@invalidchar}
792 % \changes{LaTeX2.09}{1993/09/19}
793 %     {(RmS) Error message for invalid input characters.}
794 % \changes{v1.0d}{1994/03/28}
795 %     {(DPC) Comment out (use catcode15 instead)}
796 %    An error for use with invalid characters.  This is commented
797 %    out, since we decided to use chatcode 15 instead.
798 %    \begin{macrocode}
799 %\def\@invalidchar{\@latex@error{Invalid character in input}\@ehc}
800 %    \end{macrocode}
801 % \end{macro}
803 % As well as the above error commands some error messages are directly
804 % coded to save space. The Messages alrerady present in \LaTeX2.09
805 % included: 
807 % |Environment --- undefined|\\
808 %  Issued by |\begin| for undefined environment.
810 % |tab overflow|\\
811 %  Occurs in |\= when| maximum number of tabs exceeded.
813 % |\< in mid line|\\
814 % Occurs in |\<| when it appears in middle of line.
816 % |Float(s) lost|\\
817 % In output routine, caused by a float environment or
818 % |\marginpar| occurring in inner vertical mode.
820 %\Finale
821 \endinput