fix write 18 skipping in luatex as reported by Bruno
[latex2e.git] / latex2e-20160201 / required / tools / fileerr.dtx
blob9aadbd0f86defef8fa672c08b23913208b088779
1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
4 % 2006 2008 2009
5 % The LaTeX3 Project and any individual authors listed elsewhere
6 % in this file.
8 % This file is part of the Standard LaTeX `Tools Bundle'.
9 % -------------------------------------------------------
11 % It may be distributed and/or modified under the
12 % conditions of the LaTeX Project Public License, either version 1.3c
13 % of this license or (at your option) any later version.
14 % The latest version of this license is in
15 %    http://www.latex-project.org/lppl.txt
16 % and version 1.3c or later is part of all distributions of LaTeX
17 % version 2005/12/01 or later.
19 % The list of all files belonging to the LaTeX `Tools Bundle' is
20 % given in the file `manifest.txt'.
22 % \fi
23 % \def\fileversion{v1.1a} \def\filedate{2003/12/28}
24 % \CheckSum{18}
25 % \iffalse    This is a METACOMMENT
26 % Doc-Source file to use with LaTeX2e
27 % Copyright (C) 1994-2004 Frank Mittelbach, all rights reserved.
28 % \fi
29 % \title{File not found error\thanks{This file has version
30 % \fileversion\ last revised \filedate}}
31 % \author{Frank Mittelbach}
32 % \MaintainedByLaTeXTeam{tools}
33 % \maketitle
35 % \changes{v1.0e}{97/07/07}{Added q and r replies (PR/2525).}
37 % \section{Introduction}
38 %    When \LaTeXe{} is unable to find a file it will ask for an
39 %    alternative file name. However, sometimes the problem is
40 %    only noticed by \TeX{}, and in that case \TeX{} insists on
41 %    getting a valid file name; any other attempt to leave this
42 %    error loop will fail.\footnote{On some systems, \TeX{}
43 %    accepts a special character denoting the end of file to
44 %    return from this loop, e.g.\ Control-D on UNIX or Control-Z
45 %    on DOS.} Many users try to respond in the same way as to
46 %    normal error messages, e.g.\ by typing \meta{return}, or |s|
47 %    or |x|, but \TeX{} will interpret this as a file name and
48 %    will ask again.
49 %    \par To provide a graceful exit out of this loop, we define
50 %    a number of files which emulate the normal behavior of
51 %    \TeX{} in the error loop as far as possible.
52 %    \par After installing these files the user can respond with
53 %    |h|,  |q|, |r|, |s|, |e|, |x|, and on some systems also with
54 %    \meta{return} to \TeX's missing file name question.
55 % \StopEventually{}
57 % \section{The documentation driver}
58 %    This code will generate the documentation. Since it is the
59 %    first piece of code in the file, the documentation can be
60 %    obtained by simply processing this file with \LaTeXe.
61 %    \begin{macrocode}
62 %<*driver>
63 \documentclass{ltxdoc}
64 \begin{document} \DocInput{fileerr.dtx}  \end{document}
65 %</driver>
66 %    \end{macrocode}
67 % \section{The files}
69 % \subsection{Asking for help with {\tt h}}
70 %    When the user types |h| in the file error loop \TeX{} will
71 %    look for the file |h.tex|. In this file we put a message
72 %    informing the user about the situation (we use |^^J| to
73 %    start new lines in the message) and then finish with a
74 %    normal |\errmessage| command thereby bringing up \TeX's
75 %    normal error mechanism.
76 %    \begin{macrocode}
77 %<*help>
78 \newlinechar=`\^^J
79 \message{! The file name provided could not be found.^^J%
80 Use `<enter>' to continue processing,^^J%
81 `S' to scroll  future errors^^J%
82 `R' to run without stopping,^^J%
83 `Q' to run quietly,^^J%
84 or `X' to terminate TeX}
85 \errmessage{}
86 %</help>
87 %    \end{macrocode}
89 % \subsection{Scrolling this and further errors with {\tt s}}
90 %    For the response |s| we put a message into the file |s.tex|
91 %    and start |\scrollmode| to scroll further error messages in
92 %    this run.  On systems that allow |.tex| as a file name we
93 %    can also trap a single \meta{return} from the user.
94 %    \begin{macrocode}
95 %<+scroll|return|run,batch> \message{File ignored}
96 %<+scroll>            \scrollmode
97 %<+run>               \nonstopmode
98 %<+batch>             \batchmode
99 %    \end{macrocode}
101 % \subsection{Exiting the run with {\tt x} or {\tt e}}
103 %    If the user enters |x| or |e| to stop \TeX{}, we need to put
104 %    something into the corresponding file which will force \TeX{} to
105 %    give up.  We achieve this by turning off terminal output and then
106 %    asking \TeX{} to stop: first by using the internal \LaTeX{} name
107 %    |\@@end|, and if that doesn't work because something other than
108 %    \LaTeX{} is used, by trying the \TeX{} primitive |\end|.  The
109 %    |\errmessage| is there to ensure that \TeX{}'s internal "history"
110 %    variable is set to |error_message_issued|. This in turn will
111 %    hopefully set the exit code on those operating systems that
112 %    implement return codes (though there is no guarantee for this).
113 % \changes{v1.1a}{2003/12/28}{Attempt to set exit code (pr/3538).}
114 %    \begin{macrocode}
115 %<+edit|exit>  \batchmode \errmessage{}\csname @@end\endcsname \end
116 %    \end{macrocode}
117 %    We end every file with an explicit |\endinput| which prevents
118 %    the docstrip program from putting the character table into
119 %    the generated files.
120 %    \begin{macrocode}
121 \endinput
122 %    \end{macrocode}
123 %% \CharacterTable
124 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
125 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
126 %%   Digits        \0\1\2\3\4\5\6\7\8\9
127 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
128 %%   Dollar        \$     Percent       \%     Ampersand     \&
129 %%   Acute accent  \'     Left paren    \(     Right paren   \)
130 %%   Asterisk      \*     Plus          \+     Comma         \,
131 %%   Minus         \-     Point         \.     Solidus       \/
132 %%   Colon         \:     Semicolon     \;     Less than     \<
133 %%   Equals        \=     Greater than  \>     Question mark \?
134 %%   Commercial at \@     Left bracket  \[     Backslash     \\
135 %%   Right bracket \]     Circumflex    \^     Underscore    \_
136 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
137 %%   Right brace   \}     Tilde         \~}
139 % \Finale