% This is `hypht1.tex' as of January 31, 2000.
%
% Copyright (C) 1995-2000 Bernd Raichle/DANTE e.V.
%
% -----------------------------------------------------------------
% IMPORTANT NOTICE:
%
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
% -----------------------------------------------------------------
%
% This file contains additional hyphenation patterns including
% the character hyphen `-' to be used in conjunction with
%
%   * all fonts with font encoding T1 and
%   * all national hyphenation patterns.
%
% It enables the hyphenation of words containing explicit hyphens
% when using fonts with \hyphenchar\font <> `\- (e.g. EC fonts).
%
% It is an experimental version for testing and includes all
% lowercase characters (including national characters) in T1
% encoded fonts.
% In 1990 at the TUG meeting at Cork, Ireland, the european TeX
% user groups agreed on a 256 character encoding supporting many
% european languages with latin writing.  LaTeX2e supports this
% character encoding as font encoding "T1".
%
%
% The additional patterns add about 2600 patterns and 6 trie ops.
% Be warned---to load the patterns in the IniTeX pass when creating
% a new format a very large hyphenation trie is needed!
% Example: TeX reports for "hyphen.tex"
%    Hyphenation trie of length 6075 has 181 ops out of ...
% with the additional patterns it will report
%    Hyphenation trie of length 8618 has 187 ops out of ...
%
%
% Note:
%    The \hyphenation command gives special interpretation to the
%    character `-'.  Therefore it is not possible to include a
%    word with an explicit hyphen as hyphenation exception without
%    the following trick (from David Kastrup):
%
%    \begingroup
%      % Make `=' to be seen as an explicit hyphen inside \hyphenation:
%      \lccode`\==`\-
%      % Example: Declare hyphenation points of `government-founded':
%      \hyphenation{gov-ern-ment=-foun-ded}
%    \endgroup
%
%
% Error reports for "hypht1.tex" in case of UNCHANGED versions to
%
%          Bernd Raichle
%          Stettener Str. 73
%          D-73732 Esslingen, FRG
%   Email: raichle@Informatik.Uni-Stuttgart.DE
%
% or 
%          DANTE e.V., Koordinator `german.sty'
%          Postfach 10 18 40
%          D-69008 Heidelberg, FRG
%   Email: german@Dante.DE
%
%
% Installation:
% =============
%
% 1. Make sure that the hyphenation trie of your TeX version has
%    enough room to load more hyphenation patterns (cf. "pattern
%    memory", "trie size" in the documentation of your
%    implementation).
%
% 2. load "hypht1.tex" in addition to _every_ hyphenation
%    patterns file (i.e. for every value of \language) you are
%    using; make sure that \language has not been changed.
%
%    Example for LaTeX2e (without Babel's ``language.dat''):
%    To load US English and German hyphenation patterns, and load
%    "hypht1.tex" in addition to both sets of patterns, create a
%    file "hyphen.cfg" with the following contents:
%
%       \chardef\l@USenglish=0 \language=\l@USenglish
%       \input hyphen
%       \input hypht1
%
%       \newlanguage\l@german \language=\l@german
%       \input dehypht
%       \input hypht1
%
%       \language=\l@USenglish
%       \lefthyphenmin=2 \righthyphenmin=3
%       \endinput
%
%    Example for LaTeX2e (using Babel's ``language.dat''):
%    To load a second file including additional hyphenation patterns
%    and hyphenation exceptions you specify the name of the file
%    in ``language.dat'' in addition to the regular hyphenation
%    pattern file name.  For example
%       USenglish       hyphen.tex    hypht1.tex
%       german          dehypht.tex   hypht1.tex
%
%
% 3. Use IniTeX to create a new format file.
%
%
% Changes:
%  1997-04-13 v0.2 First release found on CTAN.
%  2000-01-31 v0.3 added missing glyphs '340-'377
%             (thanks to Vladimir Volovich)
%
% -----------------------------------------------------------------
%
\begingroup\expandafter\expandafter\expandafter
\endgroup\expandafter\ifx\csname ProvidesFile\endcsname\relax
  \wlog{File: hypht1.tex 2000/01/31 v0.3 %
        Additional Hyphenation Patterns for T1-encoded fonts}
\else
  \ProvidesFile{hypht1.tex}%
     [2000/01/31 v0.3 Additional Hyphenation Patterns %
                      for T1-encoded fonts]
\fi
%
%
% It is possible to use T1-encoded font with TeX 2.x and
% include a subset '000-'177 of these additional hyphenation
% patterns.  Nonetheless TeX 2.x is unable to process more than
% one \patterns.  If you want to use these patterns, you have to
% include some changes below and in the used set of patterns.
% (You can contact the author for more information.)
%
\ifnum`\A=`\^^41 % TeX 2 or TeX 3?
\else
  \message{Sorry, you need TeX 3.x to use these patterns.}
  \expandafter\endinput
\fi
%
%
% Make hyphen `-' a word constituent:
%
\lccode`\-=`\-
%
%
% \patterns has a global effect, therefore we can open a group,
% make local changes, call \patterns{...}, close the group, and
% all changes are gone.
%
\begingroup
%
% Some feedback for users with slow computers:
%
\message{...please be patient...}
%
%
\toksdef\L=0 \L={}%  list of two letter patterns
\toksdef\S=2 \S={}%  list of "simple" patterns
%
\countdef\C=2  % use \C as temporary register for _c_har code
\countdef\i=0  % temporary register: loop index i
%
\catcode`\Y=11 \lccode`\Y=0   % we need `Y' for special purposes
\catcode`\X=11 \lccode`\X=0   % dto for `X'
%
%
% 1) trivial cases:
%
\S={%
  8-7    % disallow hyphenation before, allow after hyphen
  .-8    % disallow hyphenation for cases like "bergauf und -ab"
  --8    % disallow hyphenation "in" an en- or em-dash (-8-),
         % disallow hyphenation before and after an en- or em-dash
         % (--8 + 8-7 ==> 8-8-8) because EC fonts v1.0 are missing
         % appropriate ligatures for --(-) + hyphenchar!
}
% \changes{v0.2}{1997/02/01}{Replaced `2-1', `.-2' by `8-7', `.-8',
%    otherwise it is possible that the `2' is overwritten by a
%    greater odd value of another pattern.}
% \changes{v0.2}{1997/04/13}{Added `8-8-8' resp. `--8' for
%    EC fonts v1.0.}
%
%
% 2a) for all lowercase letters:
%     change catcode to letter (or other) to make sure that these
%            characters are not active, ignored, etc. and
%     change lccode to a non-zero value to allow its use inside
%            \patterns
%
% 2b) Add the patterns
%         .X-8    % disallow "X-|ray", "n-|fach", etc.
%         8X8Y-   % => "\righthyphenmin"=3 and "\lefthyphenmin"=3
%         -X8Y    %    before and after the hyphen
%     for all X,Y in the set of lowercase letters.
%
%
\def\a#1{%     add pattern to pattern list \L
  \C=#1\relax \catcode\C=11\lccode\C=\C
  \lccode`X=\C
  \lowercase{%
    \S\expandafter{\the\S .X-8 }%
    \L\expandafter{\the\L 8X8Y- -X8Y8 }%
  }}
%
% \changes{v0.2}{1997/02/01}{Replaced `X-2' by `X-8,
%    otherwise it is possible that the `2' is overwritten by a
%    greater odd value of another pattern.}
%  
\def\y{%
  %
  % Add patterns for "lowercase letter d with bar"
  %
  \a{'236}%  lowercase letter d with bar
  %
  % ... and for all lowercase characters:
  %
  % for i=`z downto `a do
  %  change catcode & lccode of char with code i
  %  add patterns for this char
  % endfor
  %
  \i=`\z \advance\i 1 %
  %
  \def\x{%
    \ifnum\i>`\a %
      \advance\i -1 %
      \a\i            % add patterns for char `i'
      \expandafter\x
    \fi}%
  \x
  %
  % for i = char "ij" ('274) downto char "a breve" ('240) do
  %  change catcode & lccode of char with code i
  %  add patterns for this char
  % endfor
  %
  \i='275  % = '274 + 1   '274: lowercase letter ij
  %
  \def\x{%
    \ifnum\i>'240 %
      \advance\i -1 %
      \a\i            % add patterns for char `i'
      \expandafter\x
    \fi}%
  \x
  %
  % \changes{v0.3}{2000/01/31}{Added code for char '340-'377.}
  %
  % for i = char "sharp s" ('377) downto char "a grave" ('340) do
  %  change catcode & lccode of char with code i
  %  add patterns for this char
  % endfor
  %
  \i='377 \advance\i 1 %
  %
  \def\x{%
    \ifnum\i>'340 %
      \advance\i -1 %
      \a\i            % add patterns for char `i'
      \expandafter\x
    \fi}%
  \x
  %
}% -- end of \y --
%
% Now do the real work:
%
\y
%
%
% The list of "simple" patterns is ready to use:
%
\patterns{ \the\S }%
\S={}% free memory used for token list
%
%
% Now \L contains all needed patterns for all characters X
% and one character Y.  To finish our task we have to loop over Y
% for all lowercase characters.
%
\def\h#1\relax{% lowercase #1 and add patterns
  \lowercase{%
    \patterns{#1}%
  }}
%
\def\a#1{%     add patterns in \L with Y replaced by #1
  \lccode`Y=#1\relax
  \expandafter\h\the\L\relax
}
%
% Now do the real work (with the redefined macro \a):
%
\y
%
\message{done.}
%
% Restore all \catcode and \lccode setting, definitions for
% csname, register changes, etc.
%
\endgroup
\endinput
%% 
%% End of file `hypht1.tex'.
