% \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
% \title{An input encoding package for \LaTeXe}
% \author{Alan Jeffrey}
% \date{v0.09}
%
% \CheckSum{266}
%
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
% \maketitle
%
% \changes{v0.01}{1994/03/09}{Created file.}
% \changes{v0.02}{1994/07/14}{Replaced \cs{Dh} by \cs{DH} and \cs{Th}
%    by \cs{TH}.}
% \changes{v0.02}{1994/07/14}{Added \cs{ensuremath} to the math
%    commands.}
% \changes{v0.02}{1994/07/14}{Added \cs{inputencoding}.}
% \changes{v0.03}{1994/09/04}{Added \cs{DeclareInputComposite} and the
%    \cs{ProvidesCommand}s to the encoding files.}
% \changes{v0.03}{1994/09/04}{Removed the definition of the accent slots
%     in Latin-1.}
% \changes{v0.04}{1994/10/20}{Replaced \cs{DeclareInputCharacter} by 
%     \cs{DeclareInputText} and \cs{DeclareInputMath}.}
% \changes{v0.04}{1994/10/20}{Removed \cs{DeclareInputComposite}.}
% \changes{v0.04}{1994/10/20}{Made many Latin-1 characters math-only.}
% \changes{v0.05}{1994/10/27}{Updated for the new version of ltoutenc.}
% \changes{v0.06}{1994/11/21}{Added \cs{textregistered}.}
% \changes{v0.06}{1994/11/21}{Added slot hex A0 to Latin-1.}
% \changes{v0.07}{1994/11/22}{Fixed typo A1 rather than A0.}
% \changes{v0.07}{1994/11/28}{Fixed where docstrip option had moved a
%    line.} 
% \changes{v0.09}{1994/12/10}{Added `beta test' message.}
% \changes{v0.09}{1994/12/10}{Made letters active and undefined by
%    default, rather than illegal.}
%
% \section{Introduction}
%
% This package allows the user to specify an input encoding (for
% example, ASCII, ISO Latin-1 or Macintosh) by saying:
% \begin{quote}
%    |\usepackage[|\emph{encoding name}|]{inputenc}|
% \end{quote}
% The encoding can also be selected in the document with:
% \begin{quote}
%    |\inputencoding{|\emph{encoding name}|}|
% \end{quote}
% The encodings provided by this pacakage are:
% \begin{itemize}
% \item |ascii| ASCII encoding for the range 32--127.
% \item |latin1| ISO Latin-1 encoding.
% \end{itemize}
% Each encoding has an associated |.def| file, for example
% |latin1.def| which defines the behaviour of each input character,
% using the commands:
% \begin{quote}
%    |\DeclareInputText{|\emph{slot}|}{|\emph{text}|}| \\
%    |\DeclareInputMath{|\emph{slot}|}{|\emph{math}|}| 
% \end{quote}
% This defines the input character \emph{slot} to be the
% \emph{text} material or \emph{math} material respectively.  
% For example, |latin1.def| defines slots |"D6| (\AE)
% and |"B5| ($\mu$) by saying:
%\begin{verbatim}
%    \DeclareInputText{"D6}{\AE}
%    \DeclareInputMath{"B5}{\mu}
%\end{verbatim}
% Note that the \emph{commands} should be robust, and should not be
% dependent on the output encoding.  The same \emph{slot} should not
% have both a text and a math declaration for it. (This restriction
% may be removed in future releases of inputenc).
%
% The |.def| file may also define
% commands using the declarations:\\
% |\providecommand| or |\ProvideTextCommandDefault|, 
%\begin{verbatim}
%    \ProvideTextCommandDefault{\textonequarter}{$\frac14$}
%    \DeclareInputText{"BC}{\textonequarter}
%\end{verbatim}
% This means that a package can change the behaviour of the `!`' slot
% by redefining the command |\textexclamdown|.  See the documentation in
% |fntguide.tex| and |ltoutenc.dtx| for details of how to declare text 
% commands. 
%
% \StopEventually{}
%
% \section{Driver}
%
% This section contains the driver for this documentation.
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\begin{document}
   \DocInput{inputenc.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \section{Announcing the files}
%
% We announce the files:
%    \begin{macrocode}
%<package>\message{beta test version} 
%<package>\ProvidesPackage{inputenc}
%<ascii> \ProvidesFile{ascii.def}
%<latin1> \ProvidesFile{latin1.def}
   [1994/12/10 Input ecoding file.]
%    \end{macrocode}
%
% \section{The package}
%
% \changes{v0.04}{1994/10/20}{Improved codeing of \cs{DeclareInputText} 
%    and changed name from \cs{DeclareInputCharacter}.}
%
% \begin{macro}{\DeclareInputText}
%    Defines its first argument to be its second.  At the moment, these 
%    macros are both the same, but this may change!
%    \begin{macrocode}
%<*package>
\def\DeclareInputText#1{%
   \bgroup
      \uccode`\~#1%
      \uppercase{%
   \egroup
      \def~%
   }%
}
\let\DeclareInputMath\DeclareInputText
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\inputencoding}
%    To set the encoding to be \emph{foo}, we input an encoding file
%    \emph{foo}|.def| with the command
%    |\inputencoding|.  This sets all the slots
%    128--255 to be active characters, sets their initial definition
%    to be |\@undefined|, then inputs \emph{foo}|.def|.
%    \begin{macrocode}
\def\inputencoding#1{%
   \@tempcnta=128
   \loop\ifnum\@tempcnta<256
      \catcode\@tempcnta\active
      \bgroup
         \uccode`\~\@tempcnta
         \uppercase{%
      \egroup
         \let~\@undefined
      }%
      \advance\@tempcnta\@ne
   \repeat
   \input{#1.def}%
}
%    \end{macrocode}
% \end{macro}
% Then for each option, we input that encoding file.
%    \begin{macrocode}
\DeclareOption*{\inputencoding{\CurrentOption}}
\ProcessOptions
%</package>
%    \end{macrocode}
%
% \section{The ASCII encoding}
%
% The ASCII encoding only allows characters in the range 32--127, so
% we only need to provide an empty |.def| file.
%
% \section{The ISO Latin-1 encoding}
%
% The ISO Latin-1 encoding file defines the characters in the ISO
% encoding.
%
% First of all, the commands used to define the input characters:
%    \begin{macrocode}
%<*latin1>
\ProvideTextCommandDefault{\textonequarter}{$\frac14$}
\ProvideTextCommandDefault{\textonehalf}{$\frac12$}
\ProvideTextCommandDefault{\textthreequarters}{$\frac34$}
\ProvideTextCommandDefault{\textregistered}{\textcircled{\textsc r}}
\providecommand{\mathdegree}{{{}^\circ}}
\providecommand{\mathordmasculine}{{{}^a}}
\providecommand{\mathordfeminine}{{{}^o}}
\providecommand{\mathonesuperior}{{{}^1}}
\providecommand{\mathtwosuperior}{{{}^2}}
\providecommand{\maththreesuperior}{{{}^3}}
%    \end{macrocode}
% Note that the following commands are not defined: |\textcent|,
% |\textcurrency|, |\textyen| and |\textbrokenbar|.
%
% Then the characters themselves:
%    \begin{macrocode}
\DeclareInputText{"A0}{~}
\DeclareInputText{"A1}{\textexclamdown}
\DeclareInputText{"A2}{\textcent}
\DeclareInputText{"A3}{\textsterling}
\DeclareInputText{"A4}{\textcurrency}
\DeclareInputText{"A5}{\textyen}
\DeclareInputText{"A6}{\textbrokenbar}
\DeclareInputText{"A7}{\S}
\DeclareInputText{"A8}{\"{}}
\DeclareInputText{"A9}{\copyright}
\DeclareInputMath{"AA}{\mathordmasculine}
\DeclareInputText{"AB}{\guillemotleft}
\DeclareInputMath{"AC}{\lnot}
\DeclareInputText{"AD}{\textendash}
\DeclareInputText{"AE}{\textregistered}
\DeclareInputText{"AF}{\={}}
\DeclareInputMath{"B0}{\mathdegree}
\DeclareInputMath{"B1}{\pm}
\DeclareInputMath{"B2}{\mathtwosuperior}
\DeclareInputMath{"B3}{\maththreesuperior}
\DeclareInputText{"B4}{\'{}}
\DeclareInputMath{"B5}{\mu}
\DeclareInputText{"B6}{\P}
\DeclareInputMath{"B7}{\cdot}
\DeclareInputText{"B8}{\c{}}
\DeclareInputMath{"B9}{\mathonesuperior}
\DeclareInputMath{"BA}{\mathordfeminine}
\DeclareInputText{"BB}{\guillemotright}
\DeclareInputMath{"BC}{\textonequarter}
\DeclareInputMath{"BD}{\textonehalf}
\DeclareInputMath{"BE}{\textthreequarters}
\DeclareInputText{"BF}{\textquestiondown}
\DeclareInputText{"C0}{\`A}
\DeclareInputText{"C1}{\'A}
\DeclareInputText{"C2}{\^A}
\DeclareInputText{"C3}{\~A}
\DeclareInputText{"C4}{\"A}
\DeclareInputText{"C5}{\AA}
\DeclareInputText{"C6}{\AE}
\DeclareInputText{"C7}{\c C}
\DeclareInputText{"C8}{\`E}
\DeclareInputText{"C9}{\'E}
\DeclareInputText{"CA}{\^E}
\DeclareInputText{"CB}{\"E}
\DeclareInputText{"CC}{\`I}
\DeclareInputText{"CD}{\'I}
\DeclareInputText{"CE}{\^I}
\DeclareInputText{"CF}{\"I}
\DeclareInputText{"D0}{\DH}
\DeclareInputText{"D1}{\~N}
\DeclareInputText{"D2}{\`O}
\DeclareInputText{"D3}{\'O}
\DeclareInputText{"D4}{\^O}
\DeclareInputText{"D5}{\~O}
\DeclareInputText{"D6}{\"O}
\DeclareInputMath{"D7}{\times}
\DeclareInputText{"D8}{\O}
\DeclareInputText{"D9}{\`U}
\DeclareInputText{"DA}{\'U}
\DeclareInputText{"DB}{\^U}
\DeclareInputText{"DC}{\"U}
\DeclareInputText{"DD}{\'Y}
\DeclareInputText{"DE}{\TH}
\DeclareInputText{"DF}{\ss}
\DeclareInputText{"E0}{\`a}
\DeclareInputText{"E1}{\'a}
\DeclareInputText{"E2}{\^a}
\DeclareInputText{"E3}{\~a}
\DeclareInputText{"E4}{\"a}
\DeclareInputText{"E5}{\aa}
\DeclareInputText{"E6}{\ae}
\DeclareInputText{"E7}{\c c}
\DeclareInputText{"E8}{\`e}
\DeclareInputText{"E9}{\'e}
\DeclareInputText{"EA}{\^e}
\DeclareInputText{"EB}{\"e}
\DeclareInputText{"EC}{\`\i}
\DeclareInputText{"ED}{\'\i}
\DeclareInputText{"EE}{\^\i}
\DeclareInputText{"EF}{\"\i}
\DeclareInputText{"F0}{\dh}
\DeclareInputText{"F1}{\~n}
\DeclareInputText{"F2}{\`o}
\DeclareInputText{"F3}{\'o}
\DeclareInputText{"F4}{\^o}
\DeclareInputText{"F5}{\~o}
\DeclareInputText{"F6}{\"o}
\DeclareInputMath{"F7}{\div}
\DeclareInputText{"F8}{\o}
\DeclareInputText{"F9}{\`u}
\DeclareInputText{"FA}{\'u}
\DeclareInputText{"FB}{\^u}
\DeclareInputText{"FC}{\"u}
\DeclareInputText{"FD}{\'y}
\DeclareInputText{"FE}{\th}
\DeclareInputText{"FF}{\"y}
%</latin1>
%    \end{macrocode}
%
% \DeleteShortVerb{\|}
% \Finale
\endinput
