% \iffalse meta-comment
%
% Copyright 1994 the LaTeX3 project and the individual authors.
% All rights reserved. For further copyright information see the file
% legal.txt, and any other copyright indicated in this file.
% 
% This file is part of the LaTeX2e system.
% ----------------------------------------
% 
%  This system is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% 
% 
% IMPORTANT NOTICE:
% 
% For error reports in case of UNCHANGED versions see bugs.txt.
% 
% Please do not request updates from us directly.  Distribution is
% done through Mail-Servers and TeX organizations.
% 
% You are not allowed to change this file.
% 
% You are allowed to distribute this file under the condition that
% it is distributed together with all files mentioned in manifest.txt.
% 
% If you receive only some of these files from someone, complain!
% 
% You are NOT ALLOWED to distribute this file alone.  You are NOT
% ALLOWED to take money for the distribution or use of either this
% file or a changed version, except for a nominal charge for copying
% etc.
% \fi
% \CheckSum{63}
% \iffalse
%%
%% File `alltt.dtx'.
%% Copyright (C) 1987 by Leslie Lamport
%% Copyright (C) 1994, 1994 LaTeX3 project, Johannes Braams
%%                       all rights reserved.
%%
%<*dtx>
\ProvidesFile{alltt.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{alltt}
%<driver>\ProvidesFile{alltt.drv}
%\ProvidesFile{alltt.dtx}
              [1994/10/29 v2.0b defines alltt environment]
%
%<*driver>
\documentclass{ltxdoc}
\begin{document}
\providecommand{\Lenv}[1]{\textsf{#1}}
\providecommand{\pkg}[1]{\texttt{#1}}
\providecommand{\file}[1]{\texttt{#1}}
\DocInput{alltt.dtx}
\end{document}
%</driver>
% \fi
%
%  \GetFileInfo{alltt.dtx}
%  \title{The \texttt{alltt} environment\thanks{This file
%        has version number \fileversion, last
%        revised \filedate.}}
%  \author{Johannes Braams}
%  \date{\filedate}
%  \maketitle
%
%    \begin{abstract}
%    This package defines the \Lenv{alltt} environment, which is like
%    the \Lenv{verbatim} environment except that |\|, |{|, and |}|
%    have their usual meanings. 
%
%    Thus, other commands and environemnts can appear within an
%    \Lenv{alltt} environment.
%    \end{abstract}
%
%  \section{Introduction}
%
%  \DescribeEnv{alltt}
%   Here are some things you may want to do in an \Lenv{alltt}
%   environment: 
%   \begin{itemize}
%   \item Change fonts--e.g., by typing |{\em empasized text\/}|
% 
%   \item Insert text from a file \file{foo.tex} by typing
%    |\input{foo}|. Beware that each |<return>| stars a new line, so
%    if \file{foo.tex} ends with a |<return>| you can wind up with an
%    extra blank line if you're not careful. 
% 
%   \item Insert a math formula.  Note that |$| just produces a dollar
%   sign, so you'll have to type |\(...\)| or |\[...\]|.  Also, |^|
%   and |_| just produce their characters; use |\sp| or |\sb| for
%   super- and subscripts, as in |\(x\sp{2}\)|.
%   \end{itemize}
%
%  \StopEventually{}
%
%  \section{The Implementation}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%  \begin{environment}{allttt}
%    The \Lenv{alltt} environment is similar to the \Lenv{verbatim}
%    environment, except that |\|, |{| and |}| have their usual
%    behaviour.
% \changes{v2.0b}{1994/10/29}{Added a missing \cs{dospecials}}
%    \begin{macrocode}
\newenvironment{alltt}{%
  \trivlist
  \item[]%
    \if@minipage
    \else
      \vskip\parskip
    \fi
    \leftskip\@totalleftmargin
    \rightskip\z@
    \parindent\z@\parfillskip
    \@flushglue\parskip\z@
    \@tempswafalse
    \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
    \obeylines
    \ttfamily
    \catcode``=13 \@noligs
    \g@remfrom@specials{\\}
    \g@remfrom@specials{\{}
    \g@remfrom@specials{\}}
    \let\do\@makeother
    \dospecials
    \frenchspacing\@vobeyspaces}
{\endtrivlist}
%    \end{macrocode}
%  \end{environment}
%
%  \begin{macro}{\g@remfrom@specials}
%    In the old implementation of the \pkg{alltt} package a fixed
%    |\dospecials| was used. However nowadays the |\dospecials|
%    command might contain more special characters at run-time then as
%    was defined in the format. There fore we remove the necessary
%    special character from |\dospecials| at the start of the
%    \Lenv{alltt} environment. For this we need a macro. Remember that
%    the list of special characters in |\dospecials| contains the
%    control sequence |\do| between the characters. We use that to
%    check whether a character has to be removed.
%
%    The macro |\g@remfrom@specials| takes one argument, the chracter
%    to be removed from the list.
%    \begin{macrocode}
\def\g@remfrom@specials#1{%
%    \end{macrocode}
%    We build up a new list in |\@new@speicals|.
%    \begin{macrocode}
  \def\@new@specials{}
%    \end{macrocode}
%    The command |\@remove| compares its argument with the argument of\\
%    |\g@remfrom@specials|. 
%    \begin{macrocode}
  \def\@remove##1{%
    \ifx##1#1\else
%    \end{macrocode}
%    When they are not the same the argument of |\@remove| is added
%    (together with |\do|) to the new list.
%    \begin{macrocode}
    \g@addto@macro\@new@specials{\do ##1}\fi}
%    \end{macrocode}
%    Now we |\let| |\do| be equal to |\@remove| and execute
%    |\dospecials|. 
%    \begin{macrocode}
  \let\do\@remove\dospecials
%    \end{macrocode}
%    All that's left is to make |\dospecials| point to the new list.
%    \begin{macrocode}
  \let\dospecials\@new@specials
  }
%    \end{macrocode}
%  \end{macro}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \Finale
\endinput
