Received: by nummer-3.proteosys id <01C19442.D3B8948C@nummer-3.proteosys>; Thu, 3 Jan 2002 11:38:48 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19442.D3B8948C" x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: RE: ENVTEST.TEX Date: Wed, 22 Aug 1990 10:40:57 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: To: "Rainer Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 229 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19442.D3B8948C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable % In definitions using environments directly (no \begin \end) % there is no problem \def\example{Some bla ``\quotu'' some more bla } \def\endexample{\endquotu\ last bla.} \def\quotu % internal definitions {some blub \listi\ and blub % not using \begin \lista\ some more blub} \def\endquotu{\endlista\endlisti\ end blub} % \halign's need \@aligningtrue, otherwise a final \cr (as it happens % within the tabular, e.g., \\ \hline) will start a new column as shown. \makeatletter \def\tab{%\@aligningtrue \halign\bgroup b\"ah ##\cr} \def\endtab{\crcr\egroup} % some more primitive nonsense environments for testing % \def\listi{ listi } \def\endlisti{ endlisti } \def\lista{ lista } \def\endlista{ endlista } % here is an example of a command which allows checking. % Of course the implementation % with the dummy environment is not acceptable and anyway it would be = nicer % to allow commands like \fbox also as environments. % The only thing necessary is a different command name for the env = start. % That is, if all envs start with \_envname and are ended by \envname_ % we just have to replace dummy by those names. \catcode`\_=3D11 \let\oldfbox\fbox \def\fbox#1{\oldfbox{\inner_begin\dummy#1\inner_end\enddummy}} \catcode`\_=3D8 \let\dummy\empty \let\enddummy\empty \errorcontextlines=3D1000 \documentstyle[environ]{article} % Sometimes we turn errors into warnings for testing \makeatletter \catcode`\_=3D11 %\let\@latexerr\err_warn \catcode`\_=3D8 % here is now a user env definition where nested envs are allowed: \newenvironment{quota} {some blub \begin{listi} and blub \begin{lista} some more blub} {\end{lista}\end{listi} end blub} \begin{document} \fbox{\begin{minipage}{7cm} \begin{center} A Table\\[2pt] \begin{tabular}{|l|} \hline bla\\ blaaaa \\ \hline} \begin{itemizr} % this is an example for an misspelled begin environment % it will produce some problems because now \item is at a funny position % Try correcting the env name und watch the results. % The way \item reacts here is horrible it should be corrected. \item bla \end{itemize} % this will end the misspelled env. by either producing an error % (never opened) which should get perhaps a different text, or by % running smothly if the user inserted \begin{itemize} after the % first error message. \begin{quota} \end{listi} % this should insert quota with warning since it is % part of quota's definition. % Then should produce error message that listi was % never opened. This is perhaps confusing but it is logical because % listi is part of the quota definition. I this isn't the case, e.g., % if the user would have been misspelled quota (wuota) then we would % get the undefined message. \begin{quotu} \end{listi} % this should produce only an error message, i.e., quotu will be still % open afterwards because listi is an environment and its usage in % quotu is hidden. The recovery makes the assumption that it was left = over % after moving some code arround. If it is actually a misspelled quotu % then it will be detected at the next closing environment which was % actually open. The chances that is is the real reason are slight, is = there % are no envs with nearly identical names. \begin{lista} \begin{example} \begin{tab} bla \cr % the \cr in the line above will result in a new column (two b\"a in % the output), because we left out the \if@aligning switch. \end{ttab} % this should be turned into tab since it is undefined, i.e. the = assumption % is that it is misspelled. \end{document} % this should insert example and lista and the still open quotu from % above. ------_=_NextPart_001_01C19442.D3B8948C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: ENVTEST.TEX

% In definitions using environments directly (no = \begin \end)
% there is no problem

\def\example{Some bla ``\quotu'' some more bla = }
\def\endexample{\endquotu\ last bla.}


\def\quotu         =             &= nbsp;           &n= bsp; % internal definitions
       {some blub = \listi\ and = blub           % not = using \begin
        \lista\ = some more blub}
\def\endquotu{\endlista\endlisti\ end blub}


% \halign's need \@aligningtrue, otherwise a final \cr = (as it happens
% within the tabular, e.g., \\ \hline) will start a = new column as shown.
\makeatletter
\def\tab{%\@aligningtrue
         = \halign\bgroup b\"ah ##\cr}
\def\endtab{\crcr\egroup}


% some more primitive nonsense environments for = testing
%
\def\listi{ listi }
\def\endlisti{ endlisti }

\def\lista{ lista }
\def\endlista{ endlista }

% here is an example of a command which allows = checking.
% Of course the implementation
% with the dummy environment is not acceptable and = anyway it would be nicer
% to allow commands like \fbox also as = environments.
% The only thing necessary is a different command = name for the env start.
% That is, if all envs start with \_envname and are = ended by \envname_
% we just have to replace dummy by those = names.
\catcode`\_=3D11
\let\oldfbox\fbox
\def\fbox#1{\oldfbox{\inner_begin\dummy#1\inner_end\enddummy}}
\catcode`\_=3D8

\let\dummy\empty
\let\enddummy\empty

\errorcontextlines=3D1000

\documentstyle[environ]{article}

% Sometimes we turn errors into warnings for = testing
\makeatletter
\catcode`\_=3D11
%\let\@latexerr\err_warn
\catcode`\_=3D8


% here is now a user env definition where nested envs = are allowed:
\newenvironment{quota}
          &nbs= p;    {some blub \begin{listi} and blub
          &nbs= p;     \begin{lista} some more blub}
          &nbs= p;    {\end{lista}\end{listi} end blub}



\begin{document}



\fbox{\begin{minipage}{7cm}
      \begin{center}
           A = Table\\[2pt]
      = \begin{tabular}{|l|}
      \hline
       bla\\ blaaaa = \\
      \hline}





\begin{itemizr}
% this is an example for an misspelled begin = environment
% it will produce some problems because now \item is = at a funny position
% Try correcting the env name und watch the = results.
% The way \item reacts here is horrible it should be = corrected.
\item bla
\end{itemize}
% this will end the misspelled env. by either = producing an error
% (never opened) which should get perhaps a different = text, or by
% running smothly if the user inserted = \begin{itemize} after the
% first error message.


\begin{quota}
\end{listi}
% this should insert quota with warning since it = is
% part of quota's definition.
% Then should produce error message that listi = was
% never opened. This is perhaps confusing but it is = logical because
% listi is part of the quota definition. I this isn't = the case, e.g.,
% if the user would have been misspelled quota = (wuota) then  we would
% get the undefined message.


\begin{quotu}
\end{listi}
% this should produce only an error message, i.e., = quotu will be still
% open afterwards because listi is an environment and = its usage in
% quotu is hidden. The recovery makes the assumption = that  it was left over
% after moving some code arround. If it is actually a = misspelled quotu
% then it will be detected at the next closing = environment which was
% actually open. The chances that is is the real = reason are slight, is there
% are no envs with nearly identical names.


\begin{lista}
\begin{example}
\begin{tab}
bla \cr
% the \cr in the line above will result in a new = column (two b\"a in
% the output), because we left out the \if@aligning = switch.
\end{ttab}
% this should be turned into tab since it is = undefined, i.e. the assumption
% is that it is misspelled.
\end{document}
% this should insert example and lista and the still = open quotu from
% above.

------_=_NextPart_001_01C19442.D3B8948C--