| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% |
| 5 |
% The LaTeX Project and any individual authors listed elsewhere |
| 6 |
% in this file. |
| 7 |
% |
| 8 |
% This file is part of the Standard LaTeX `Tools Bundle'. |
| 9 |
% ------------------------------------------------------- |
| 10 |
% |
| 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 |
% https://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. |
| 18 |
% |
| 19 |
% The list of all files belonging to the LaTeX `Tools Bundle' is |
| 20 |
% given in the file `manifest.txt'. |
| 21 |
% |
| 22 |
% \fi |
| 23 |
% \def\fileversion{v1.1a} \def\filedate{2003/12/28} |
| 24 |
% \iffalse This is a METACOMMENT |
| 25 |
% Doc-Source file to use with LaTeX2e |
| 26 |
% Copyright (C) 1994-2004 Frank Mittelbach, all rights reserved. |
| 27 |
% \fi |
| 28 |
% \title{File not found error\thanks{This file has version |
| 29 |
% \fileversion\ last revised \filedate}} |
| 30 |
% \author{Frank Mittelbach} |
| 31 |
% \MaintainedByLaTeXTeam{tools} |
| 32 |
% \maketitle |
| 33 |
% |
| 34 |
% \changes{v1.0e}{97/07/07}{Added q and r replies (PR/2525).} |
| 35 |
% |
| 36 |
% \section{Introduction} |
| 37 |
% When \LaTeXe{} is unable to find a file it will ask for an |
| 38 |
% alternative file name. However, sometimes the problem is |
| 39 |
% only noticed by \TeX{}, and in that case \TeX{} insists on |
| 40 |
% getting a valid file name; any other attempt to leave this |
| 41 |
% error loop will fail.\footnote{On some systems, \TeX{} |
| 42 |
% accepts a special character denoting the end of file to |
| 43 |
% return from this loop, e.g.\ Control-D on UNIX or Control-Z |
| 44 |
% on DOS.} Many users try to respond in the same way as to |
| 45 |
% normal error messages, e.g.\ by typing \meta{return}, or |s| |
| 46 |
% or |x|, but \TeX{} will interpret this as a file name and |
| 47 |
% will ask again. |
| 48 |
% \par To provide a graceful exit out of this loop, we define |
| 49 |
% a number of files which emulate the normal behavior of |
| 50 |
% \TeX{} in the error loop as far as possible. |
| 51 |
% \par After installing these files the user can respond with |
| 52 |
% |h|, |q|, |r|, |s|, |e|, |x|, and on some systems also with |
| 53 |
% \meta{return} to \TeX's missing file name question. |
| 54 |
% \MaybeStop{} |
| 55 |
% |
| 56 |
% \section{The documentation driver} |
| 57 |
% This code will generate the documentation. Since it is the |
| 58 |
% first piece of code in the file, the documentation can be |
| 59 |
% obtained by simply processing this file with \LaTeXe. |
| 60 |
% \begin{macrocode} |
| 61 |
%<*driver> |
| 62 |
\documentclass{ltxdoc} |
| 63 |
\begin{document} \DocInput{fileerr.dtx} \end{document} |
| 64 |
%</driver> |
| 65 |
% \end{macrocode} |
| 66 |
% \section{The files} |
| 67 |
% |
| 68 |
% \subsection{Asking for help with {\tt h}} |
| 69 |
% When the user types |h| in the file error loop \TeX{} will |
| 70 |
% look for the file |h.tex|. In this file we put a message |
| 71 |
% informing the user about the situation (we use |^^J| to |
| 72 |
% start new lines in the message) and then finish with a |
| 73 |
% normal |\errmessage| command thereby bringing up \TeX's |
| 74 |
% normal error mechanism. |
| 75 |
% \begin{macrocode} |
| 76 |
%<*help> |
| 77 |
\newlinechar=`\^^J |
| 78 |
\message{! The file name provided could not be found.^^J% |
| 79 |
Use `<enter>' to continue processing,^^J% |
| 80 |
`S' to scroll future errors^^J% |
| 81 |
`R' to run without stopping,^^J% |
| 82 |
`Q' to run quietly,^^J% |
| 83 |
or `X' to terminate TeX} |
| 84 |
\errmessage{} |
| 85 |
%</help> |
| 86 |
% \end{macrocode} |
| 87 |
% |
| 88 |
% \subsection{Scrolling this and further errors with {\tt s}} |
| 89 |
% For the response |s| we put a message into the file |s.tex| |
| 90 |
% and start |\scrollmode| to scroll further error messages in |
| 91 |
% this run. On systems that allow |.tex| as a file name we |
| 92 |
% can also trap a single \meta{return} from the user. |
| 93 |
% \begin{macrocode} |
| 94 |
%<+scroll|return|run,batch> \message{File ignored} |
| 95 |
%<+scroll> \scrollmode |
| 96 |
%<+run> \nonstopmode |
| 97 |
%<+batch> \batchmode |
| 98 |
% \end{macrocode} |
| 99 |
% |
| 100 |
% \subsection{Exiting the run with {\tt x} or {\tt e}} |
| 101 |
% |
| 102 |
% If the user enters |x| or |e| to stop \TeX{}, we need to put |
| 103 |
% something into the corresponding file which will force \TeX{} to |
| 104 |
% give up. We achieve this by turning off terminal output and then |
| 105 |
% asking \TeX{} to stop: first by using the internal \LaTeX{} name |
| 106 |
% |\@@end|, and if that doesn't work because something other than |
| 107 |
% \LaTeX{} is used, by trying the \TeX{} primitive |\end|. The |
| 108 |
% |\errmessage| is there to ensure that \TeX{}'s internal "history" |
| 109 |
% variable is set to |error_message_issued|. This in turn will |
| 110 |
% hopefully set the exit code on those operating systems that |
| 111 |
% implement return codes (though there is no guarantee for this). |
| 112 |
% \changes{v1.1a}{2003/12/28}{Attempt to set exit code (pr/3538).} |
| 113 |
% \begin{macrocode} |
| 114 |
%<+edit|exit> \batchmode \errmessage{}\csname @@end\endcsname \end |
| 115 |
% \end{macrocode} |
| 116 |
% We end every file with an explicit |\endinput| which prevents |
| 117 |
% the docstrip program from putting the character table into |
| 118 |
% the generated files. |
| 119 |
% \begin{macrocode} |
| 120 |
\endinput |
| 121 |
% \end{macrocode} |
| 122 |
%% |
| 123 |
% \Finale |