% \iffalse meta-comment
%
% Copyright 1989-2004 Johannes L. Braams and any individual authors
% listed elsewhere in this file.  All rights reserved.
% 
% This file is part of the Babel system.
% --------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainer of this work is Johannes Braams.
% 
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.bbl. See also `legal.bbl' for additional
% information.
% 
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
% \CheckSum{446}
%
% \iffalse
%<si960>  \ProvidesFile{si960.def}
%<8859-8> \ProvidesFile{8859-8.def}
%<cp862>  \ProvidesFile{cp862.def}
%<cp1255> \ProvidesFile{cp1255.def}
%<*driver>
\ProvidesFile{hebinp.drv}
%</driver>
% \fi
% \ProvidesFile{hebinp.dtx}
        [2004/02/20 v1.1b Hebrew input encoding file]
% \iffalse meta-comment
%% File `hebinp.dtx' for installing the input hebrew encodings.
%% Copyright (C) 1997 -- 2004 Boris Lavva.
%
%% Babel package for LaTeX version 2e
%% Copyright (C) 1989 -- 2004 by Johannes Braams,
%%                            TeXniek
%%                            All rights reserved.
% \fi
%
% \providecommand\dst{\textsc{docstrip}}
% \GetFileInfo{hebinp.dtx}
%
% \changes{hebinp~1.0a}{1997/12/07}{%
%    Initial version. Provides 8859-8, cp862, cp1255, and old 7-bit
%    input encodings (by Boris Lavva)}
% \changes{hebinp~1.1}{2001/02/27}{%
%    Renamed hebrew letters: \cs{alef} to \cs{hebalef} etc. 
%    (by Tzafrir Cohen)}
% \changes{hebinp~1.1a}{2001/07/22}{%
%    Renamed CP1255 nikud \cs{patah} to \cs{hebpatah etc}. 
%    Added the macro \cs{DisableNikud} - may not be a good idea 
%    (by Tzafrir Cohen)}
%
% \section{Hebrew input encodings}\label{sec:hebinp}
%
% Hebrew input encodings defined in file |hebinp.dtx|\footnote{The
% files described in this section have version number \fileversion\
% and were last revised on \filedate.} should be used with |inputenc|
% \LaTeXe{} package. This package allows the user
% to specify an input encoding from this file (for example, ISO
% Hebrew/Latin 8859-8, IBM Hebrew codepage 862 or MS Windows
% Hebrew codepage 1255) 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 only practical use of this command within a document is when
% using text from several documents to build up a composite work such
% as a volume of journal articles.  Therefore this command will be
% used only in vertical mode.
% 
% The encodings provided by this package are:
% \begin{itemize}
% \item |si960|  7-bit Hebrew encoding for the range 32--127. This
%       encoding also known as ``old-code'' and defined by Israeli
%       Standard SI-960. 
% \item |8859-8| ISO 8859-8 Hebrew/Latin encoding commonly used in
%       UNIX systems. This encoding also known as ``new-code'' and
%       includes hebrew letters in positions starting from 224.
% \item |cp862|  IBM 862 code page commonly used by DOS on
%       IBM-compatible personal computers. This encoding also known as
%       ``pc-code'' and includes hebrew letters in positions starting
%       from 128.
% \item |cp1255| MS Windows 1255 (hebrew) code page which is similar to
%       8859-8. In addition to hebrew letters, this encoding contains
%       also hebrew vowels and dots (nikud).
% \end{itemize}
% Each encoding has an associated |.def| file, for example
% |8859-8.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, |8859-8.def| defines slots |"EA| (letter hebalef)
% and |"B5| ($\mu$) by saying:
%\begin{verbatim}
%    \DeclareInputText{224}{\hebalef}
%    \DeclareInputMath{181}{\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|.
% For example, |8859-8.def| defines:
%\begin{verbatim}
%    \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
%    \DeclareInputText{188}{\textonequarter}
%\end{verbatim}
%    The use of the `provide' forms here will ensure that a
%    better definition will not be over-written; their use is
%    recommended since, in general, the best defintion depends on the
%    fonts available.
%    
%    See the documentation in |inputenc.dtx| for details of how to
%    declare input definitions for various encodings.
%
% \StopEventually{}
%
% \iffalse
% \subsection{A driver for this document}
%
%    The next bit of code contains the documentation driver file for
%    \TeX{}, i.e., the file that will produce the documentation you
%    are currently reading. It will be extracted from this file by 
%    the \dst{} program.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\title{Hebrew input encodings for use with \LaTeXe}
\author{Boris Lavva}
\date{Printed \today}
\begin{document}
   \maketitle
   \DocInput{hebinp.dtx}
\end{document}
%</driver>
%    \end{macrocode}
% \fi
%
% \subsection{Default definitions for characters}
%
%    First, we insert a |\makeatletter| at the beginning of all |.def|
%    files to use |@| symbol in the macros' names.
%    \begin{macrocode}
%<-driver>\makeatletter
%    \end{macrocode}
%
%    Some input characters map to internal functions which are not in
%    either the |T1| or |OT1| font encoding. For this reason default
%    definitions are provided in the encoding file: these will be
%    used unless some other output encoding is used which supports
%    those glyphs.  In some cases this default defintion has to be
%    simply an error message.
%
%    Note that this works reasonably well only because the encoding
%    files for both |OT1| and |T1| are loaded in the standard LaTeX
%    format.
%
%    \begin{macrocode}
%<*8859-8|cp862|cp1255>
\ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}}
\ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
\ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
%</8859-8|cp862|cp1255>
%<*8859-8|cp1255>
\ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}
%</8859-8|cp1255>
%<*cp862|cp1255>
\ProvideTextCommandDefault{\textflorin}{\textit{f}}
%</cp862|cp1255>
%<*cp862>
\ProvideTextCommandDefault{\textpeseta}{Pt}
%</cp862>
%    \end{macrocode}
%
%    The name |\textblacksquare| is derived from the AMS symbol name
%    since Adobe seem not to want this symbol.  The default
%    definition, as a rule, makes no claim to being a good design.
%    \begin{macrocode}
%<*cp862>
\ProvideTextCommandDefault{\textblacksquare}
   {\vrule \@width .3em \@height .4em \@depth -.1em\relax}
%</cp862>
%    \end{macrocode}
%
% Some commands can't be faked, so we have them generate an error
% message.
%    \begin{macrocode}
%<*8859-8|cp862|cp1255>
\ProvideTextCommandDefault{\textcent}
   {\TextSymbolUnavailable\textcent}
\ProvideTextCommandDefault{\textyen}
   {\TextSymbolUnavailable\textyen}
%</8859-8|cp862|cp1255>
%<*8859-8>
\ProvideTextCommandDefault{\textcurrency}
   {\TextSymbolUnavailable\textcurrency}
%</8859-8>
%<*cp1255>
\ProvideTextCommandDefault{\newsheqel}
   {\TextSymbolUnavailable\newsheqel}
%</cp1255>
%<*8859-8|cp1255>
\ProvideTextCommandDefault{\textbrokenbar}
   {\TextSymbolUnavailable\textbrokenbar}
%</8859-8|cp1255>
%<*cp1255>
\ProvideTextCommandDefault{\textperthousand}
   {\TextSymbolUnavailable\textperthousand}
%</cp1255>
%    \end{macrocode}
%
% Characters that are supposed to be used only in math will be defined
% by |\providecommand| because \LaTeXe{} assumes that the font
% encoding for math fonts is static.
%    \begin{macrocode}
%<*8859-8|cp1255>
\providecommand{\mathonesuperior}{{^1}}
\providecommand{\maththreesuperior}{{^3}}
%</8859-8|cp1255>
%<*8859-8|cp862|cp1255>
\providecommand{\mathtwosuperior}{{^2}}
%</8859-8|cp862|cp1255>
%<*cp862>
\providecommand{\mathordmasculine}{{^o}}
\providecommand{\mathordfeminine}{{^a}}
%</cp862>
%    \end{macrocode}
%
% \subsection{The SI-960 encoding}
%
%% The SI-960 or ``old-code'' encoding only allows characters in the
%% range 32--127, so we only need to provide an empty |si960.def| file.
%
% \subsection{The ISO 8859-8 encoding and the MS Windows cp1255 encoding}
%
%    The |8859-8.def| encoding file defines the characters in the ISO
%    8859-8 encoding.
%
%    The MS Windows Hebrew character set incorporates the Hebrew
%    letter repertoire of ISO 8859-8, and uses the same code points
%    (starting from 224). It has also some important additions in the
%    128--159 and 190--224 ranges.
%
%    \begin{macrocode}
%<*cp1255>
\DeclareInputText{130}{\quotesinglbase}
\DeclareInputText{131}{\textflorin}
\DeclareInputText{132}{\quotedblbase}
\DeclareInputText{133}{\dots}
\DeclareInputText{134}{\dag}
\DeclareInputText{135}{\ddag}
\DeclareInputText{136}{\^{}}
\DeclareInputText{137}{\textperthousand}
\DeclareInputText{139}{\guilsinglleft}
\DeclareInputText{145}{\textquoteleft}
\DeclareInputText{146}{\textquoteright}
\DeclareInputText{147}{\textquotedblleft}
\DeclareInputText{148}{\textquotedblright}
\DeclareInputText{149}{\textbullet}
\DeclareInputText{150}{\textendash}
\DeclareInputText{151}{\textemdash}
\DeclareInputText{152}{\~{}}
\DeclareInputText{153}{\texttrademark}
\DeclareInputText{155}{\guilsinglright}
%</cp1255>
%    \end{macrocode}
%
%    \begin{macrocode}
%<*8859-8|cp1255>
\DeclareInputText{160}{\nobreakspace}
\DeclareInputText{162}{\textcent}
\DeclareInputText{163}{\pounds}
%<+8859-8>\DeclareInputText{164}{\textcurrency}
%<+cp1255>\DeclareInputText{164}{\newsheqel}
\DeclareInputText{165}{\textyen}
\DeclareInputText{166}{\textbrokenbar}
\DeclareInputText{167}{\S}
\DeclareInputText{168}{\"{}}
\DeclareInputText{169}{\textcopyright}
%<+8859-8>\DeclareInputMath{170}{\times}
\DeclareInputText{171}{\guillemotleft}
\DeclareInputMath{172}{\lnot}
\DeclareInputText{173}{\-}
\DeclareInputText{174}{\textregistered}
\DeclareInputText{175}{\@tabacckludge={}}
\DeclareInputText{176}{\textdegree}
\DeclareInputMath{177}{\pm}
\DeclareInputMath{178}{\mathtwosuperior}
\DeclareInputMath{179}{\maththreesuperior}
\DeclareInputText{180}{\@tabacckludge'{}}
\DeclareInputMath{181}{\mu}
\DeclareInputText{182}{\P}
\DeclareInputText{183}{\textperiodcentered}
%<+8859-8>\DeclareInputText{184}{\c\ }
\DeclareInputMath{185}{\mathonesuperior}
%<+8859-8>\DeclareInputMath{186}{\div}
\DeclareInputText{187}{\guillemotright}
\DeclareInputText{188}{\textonequarter}
\DeclareInputText{189}{\textonehalf}
\DeclareInputText{190}{\textthreequarters}
%</8859-8|cp1255>
%    \end{macrocode}
%
%    Hebrew vowels and dots (nikud) are included only to MS Windows cp1255
%    page and start from the position 192.
%    \begin{macrocode}
%<*cp1255>
\DeclareInputText{192}{\hebsheva}
\DeclareInputText{193}{\hebhatafsegol}
\DeclareInputText{194}{\hebhatafpatah}
\DeclareInputText{195}{\hebhatafqamats}
\DeclareInputText{196}{\hebhiriq}
\DeclareInputText{197}{\hebtsere}
\DeclareInputText{198}{\hebsegol}
\DeclareInputText{199}{\hebpatah}
\DeclareInputText{200}{\hebqamats}
\DeclareInputText{201}{\hebholam}
\DeclareInputText{203}{\hebqubuts}
\DeclareInputText{204}{\hebdagesh}
\DeclareInputText{205}{\hebmeteg}
\DeclareInputText{206}{\hebmaqaf}
\DeclareInputText{207}{\hebrafe}
\DeclareInputText{208}{\hebpaseq}
\DeclareInputText{209}{\hebshindot}
\DeclareInputText{210}{\hebsindot}
\DeclareInputText{211}{\hebsofpasuq}
\DeclareInputText{212}{\hebdoublevav}
\DeclareInputText{213}{\hebvavyod}
\DeclareInputText{214}{\hebdoubleyod}
%</cp1255>
%    \end{macrocode}
%
%    Hebrew letters start from the position 224 in both encodings.
%    \begin{macrocode}
%<*8859-8|cp1255>
\DeclareInputText{224}{\hebalef}
\DeclareInputText{225}{\hebbet}
\DeclareInputText{226}{\hebgimel}
\DeclareInputText{227}{\hebdalet}
\DeclareInputText{228}{\hebhe}
\DeclareInputText{229}{\hebvav}
\DeclareInputText{230}{\hebzayin}
\DeclareInputText{231}{\hebhet}
\DeclareInputText{232}{\hebtet}
\DeclareInputText{233}{\hebyod}
\DeclareInputText{234}{\hebfinalkaf}
\DeclareInputText{235}{\hebkaf}
\DeclareInputText{236}{\heblamed}
\DeclareInputText{237}{\hebfinalmem}
\DeclareInputText{238}{\hebmem}
\DeclareInputText{239}{\hebfinalnun}
\DeclareInputText{240}{\hebnun}
\DeclareInputText{241}{\hebsamekh}
\DeclareInputText{242}{\hebayin}
\DeclareInputText{243}{\hebfinalpe}
\DeclareInputText{244}{\hebpe}
\DeclareInputText{245}{\hebfinaltsadi}
\DeclareInputText{246}{\hebtsadi}
\DeclareInputText{247}{\hebqof}
\DeclareInputText{248}{\hebresh}
\DeclareInputText{249}{\hebshin}
\DeclareInputText{250}{\hebtav}
%</8859-8|cp1255>
%    \end{macrocode}
%
%    Special symbols which define the direction of symbols explicitly.
%    Currently, they are not used in \LaTeX.
%    \begin{macrocode}
%<*cp1255>
\DeclareInputText{253}{\lefttorightmark}
\DeclareInputText{254}{\righttoleftmark}
%</cp1255>
%    \end{macrocode}
%
% \subsection{The IBM code page 862}
%
% The |cp862.def| encoding file defines the characters in the IBM
% codepage 862 encoding. The DOS graphics `letters' and a few
% other positions are ignored (left undefined).
%
%    Hebrew letters start from the position 128.
%    \begin{macrocode}
%<*cp862>
\DeclareInputText{128}{\hebalef}
\DeclareInputText{129}{\hebbet}
\DeclareInputText{130}{\hebgimel}
\DeclareInputText{131}{\hebdalet}
\DeclareInputText{132}{\hebhe}
\DeclareInputText{133}{\hebvav}
\DeclareInputText{134}{\hebzayin}
\DeclareInputText{135}{\hebhet}
\DeclareInputText{136}{\hebtet}
\DeclareInputText{137}{\hebyod}
\DeclareInputText{138}{\hebfinalkaf}
\DeclareInputText{139}{\hebkaf}
\DeclareInputText{140}{\heblamed}
\DeclareInputText{141}{\hebfinalmem}
\DeclareInputText{142}{\hebmem}
\DeclareInputText{143}{\hebfinalnun}
\DeclareInputText{144}{\hebnun}
\DeclareInputText{145}{\hebsamekh}
\DeclareInputText{146}{\hebayin}
\DeclareInputText{147}{\hebfinalpe}
\DeclareInputText{148}{\hebpe}
\DeclareInputText{149}{\hebfinaltsadi}
\DeclareInputText{150}{\hebtsadi}
\DeclareInputText{151}{\hebqof}
\DeclareInputText{152}{\hebresh}
\DeclareInputText{153}{\hebshin}
\DeclareInputText{154}{\hebtav}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareInputText{155}{\textcent}
\DeclareInputText{156}{\pounds}
\DeclareInputText{157}{\textyen}
\DeclareInputText{158}{\textpeseta}
\DeclareInputText{159}{\textflorin}
\DeclareInputText{160}{\@tabacckludge'a}
\DeclareInputText{161}{\@tabacckludge'\i}
\DeclareInputText{162}{\@tabacckludge'o}
\DeclareInputText{163}{\@tabacckludge'u}
\DeclareInputText{164}{\~n}
\DeclareInputText{165}{\~N}
\DeclareInputMath{166}{\mathordfeminine}
\DeclareInputMath{167}{\mathordmasculine}
\DeclareInputText{168}{\textquestiondown}
\DeclareInputMath{170}{\lnot}
\DeclareInputText{171}{\textonehalf}
\DeclareInputText{172}{\textonequarter}
\DeclareInputText{173}{\textexclamdown}
\DeclareInputText{174}{\guillemotleft}
\DeclareInputText{175}{\guillemotright}
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareInputMath{224}{\alpha}
\DeclareInputText{225}{\ss}
\DeclareInputMath{226}{\Gamma}
\DeclareInputMath{227}{\pi}
\DeclareInputMath{228}{\Sigma}
\DeclareInputMath{229}{\sigma}
\DeclareInputMath{230}{\mu}
\DeclareInputMath{231}{\tau}
\DeclareInputMath{232}{\Phi}
\DeclareInputMath{233}{\Theta}
\DeclareInputMath{234}{\Omega}
\DeclareInputMath{235}{\delta}
\DeclareInputMath{236}{\infty}
\DeclareInputMath{237}{\phi}
\DeclareInputMath{238}{\varepsilon}
\DeclareInputMath{239}{\cap}
\DeclareInputMath{240}{\equiv}
\DeclareInputMath{241}{\pm}
\DeclareInputMath{242}{\ge}
\DeclareInputMath{243}{\le}
\DeclareInputMath{246}{\div}
\DeclareInputMath{247}{\approx}
\DeclareInputText{248}{\textdegree}
\DeclareInputText{249}{\textperiodcentered}
\DeclareInputText{250}{\textbullet}
\DeclareInputMath{251}{\surd}
\DeclareInputMath{252}{\mathnsuperior}
\DeclareInputMath{253}{\mathtwosuperior}
\DeclareInputText{254}{\textblacksquare}
\DeclareInputText{255}{\nobreakspace}
%</cp862>
%    \end{macrocode}
%    
%  \begin{macro}{\DisableNikud}
%    A utility macro to ignore any nikud character that may appear in the
%    input. This allows you to ignore cp1255 nikud characters that happened to
%    appear in the input.
%  \end{macro}
%    \begin{macrocode}
%<*8859-8>
\newcommand{\DisableNikud}{%
  \DeclareInputText{192}{}%
  \DeclareInputText{193}{}%
  \DeclareInputText{194}{}%
  \DeclareInputText{195}{}%
  \DeclareInputText{196}{}%
  \DeclareInputText{197}{}%
  \DeclareInputText{198}{}%
  \DeclareInputText{199}{}%
  \DeclareInputText{200}{}%
  \DeclareInputText{201}{}%
  \DeclareInputText{203}{}%
  \DeclareInputText{204}{}%
  \DeclareInputText{205}{}%
  \DeclareInputText{206}{}%
  \DeclareInputText{207}{}%
  \DeclareInputText{208}{}%
  \DeclareInputText{209}{}%
  \DeclareInputText{210}{}%
  \DeclareInputText{211}{}%
  \DeclareInputText{212}{}%
  \DeclareInputText{213}{}%
  \DeclareInputText{214}{}%
}
%</8859-8>
%    \end{macrocode}
%
%    Finally, we reset the category code of the |@| sign at the end of
%    all |.def| files.
%    \begin{macrocode}
%<-driver>\makeatother
%    \end{macrocode}
%
% \Finale
%%
%% \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         \~}
\endinput
