1% This is `hypht1.tex' as of January 31, 2000. 2% 3% Copyright (C) 1995-2000 Bernd Raichle/DANTE e.V. 4% 5% ----------------------------------------------------------------- 6% IMPORTANT NOTICE: 7% 8% This program can be redistributed and/or modified under the terms 9% of the LaTeX Project Public License Distributed from CTAN 10% archives in directory macros/latex/base/lppl.txt; either 11% version 1 of the License, or any later version. 12% ----------------------------------------------------------------- 13% 14% This file contains additional hyphenation patterns including 15% the character hyphen `-' to be used in conjunction with 16% 17% * all fonts with font encoding T1 and 18% * all national hyphenation patterns. 19% 20% It enables the hyphenation of words containing explicit hyphens 21% when using fonts with \hyphenchar\font <> `\- (e.g. EC fonts). 22% 23% It is an experimental version for testing and includes all 24% lowercase characters (including national characters) in T1 25% encoded fonts. 26% In 1990 at the TUG meeting at Cork, Ireland, the european TeX 27% user groups agreed on a 256 character encoding supporting many 28% european languages with latin writing. LaTeX2e supports this 29% character encoding as font encoding "T1". 30% 31% 32% The additional patterns add about 2600 patterns and 6 trie ops. 33% Be warned---to load the patterns in the IniTeX pass when creating 34% a new format a very large hyphenation trie is needed! 35% Example: TeX reports for "hyphen.tex" 36% Hyphenation trie of length 6075 has 181 ops out of ... 37% with the additional patterns it will report 38% Hyphenation trie of length 8618 has 187 ops out of ... 39% 40% 41% Note: 42% The \hyphenation command gives special interpretation to the 43% character `-'. Therefore it is not possible to include a 44% word with an explicit hyphen as hyphenation exception without 45% the following trick (from David Kastrup): 46% 47% \begingroup 48% % Make `=' to be seen as an explicit hyphen inside \hyphenation: 49% \lccode`\==`\- 50% % Example: Declare hyphenation points of `government-founded': 51% \hyphenation{gov-ern-ment=-foun-ded} 52% \endgroup 53% 54% 55% Error reports for "hypht1.tex" in case of UNCHANGED versions to 56% 57% Bernd Raichle 58% Stettener Str. 73 59% D-73732 Esslingen, FRG 60% Email: raichle@Informatik.Uni-Stuttgart.DE 61% 62% or 63% DANTE e.V., Koordinator `german.sty' 64% Postfach 10 18 40 65% D-69008 Heidelberg, FRG 66% Email: german@Dante.DE 67% 68% 69% Installation: 70% ============= 71% 72% 1. Make sure that the hyphenation trie of your TeX version has 73% enough room to load more hyphenation patterns (cf. "pattern 74% memory", "trie size" in the documentation of your 75% implementation). 76% 77% 2. load "hypht1.tex" in addition to _every_ hyphenation 78% patterns file (i.e. for every value of \language) you are 79% using; make sure that \language has not been changed. 80% 81% Example for LaTeX2e (without Babel's ``language.dat''): 82% To load US English and German hyphenation patterns, and load 83% "hypht1.tex" in addition to both sets of patterns, create a 84% file "hyphen.cfg" with the following contents: 85% 86% \chardef\l@USenglish=0 \language=\l@USenglish 87% \input hyphen 88% \input hypht1 89% 90% \newlanguage\l@german \language=\l@german 91% \input dehypht 92% \input hypht1 93% 94% \language=\l@USenglish 95% \lefthyphenmin=2 \righthyphenmin=3 96% \endinput 97% 98% Example for LaTeX2e (using Babel's ``language.dat''): 99% To load a second file including additional hyphenation patterns 100% and hyphenation exceptions you specify the name of the file 101% in ``language.dat'' in addition to the regular hyphenation 102% pattern file name. For example 103% USenglish hyphen.tex hypht1.tex 104% german dehypht.tex hypht1.tex 105% 106% 107% 3. Use IniTeX to create a new format file. 108% 109% 110% Changes: 111% 1997-04-13 v0.2 First release found on CTAN. 112% 2000-01-31 v0.3 added missing glyphs '340-'377 113% (thanks to Vladimir Volovich) 114% 115% ----------------------------------------------------------------- 116% 117\begingroup\expandafter\expandafter\expandafter 118\endgroup\expandafter\ifx\csname ProvidesFile\endcsname\relax 119 \wlog{File: hypht1.tex 2000/01/31 v0.3 % 120 Additional Hyphenation Patterns for T1-encoded fonts} 121\else 122 \ProvidesFile{hypht1.tex}% 123 [2000/01/31 v0.3 Additional Hyphenation Patterns % 124 for T1-encoded fonts] 125\fi 126% 127% 128% It is possible to use T1-encoded font with TeX 2.x and 129% include a subset '000-'177 of these additional hyphenation 130% patterns. Nonetheless TeX 2.x is unable to process more than 131% one \patterns. If you want to use these patterns, you have to 132% include some changes below and in the used set of patterns. 133% (You can contact the author for more information.) 134% 135\ifnum`\A=`\^^41 % TeX 2 or TeX 3? 136\else 137 \message{Sorry, you need TeX 3.x to use these patterns.} 138 \expandafter\endinput 139\fi 140% 141% 142% Make hyphen `-' a word constituent: 143% 144\lccode`\-=`\- 145% 146% 147% \patterns has a global effect, therefore we can open a group, 148% make local changes, call \patterns{...}, close the group, and 149% all changes are gone. 150% 151\begingroup 152% 153% Some feedback for users with slow computers: 154% 155\message{...please be patient...} 156% 157% 158\toksdef\L=0 \L={}% list of two letter patterns 159\toksdef\S=2 \S={}% list of "simple" patterns 160% 161\countdef\C=2 % use \C as temporary register for _c_har code 162\countdef\i=0 % temporary register: loop index i 163% 164\catcode`\Y=11 \lccode`\Y=0 % we need `Y' for special purposes 165\catcode`\X=11 \lccode`\X=0 % dto for `X' 166% 167% 168% 1) trivial cases: 169% 170\S={% 171 8-7 % disallow hyphenation before, allow after hyphen 172 .-8 % disallow hyphenation for cases like "bergauf und -ab" 173 --8 % disallow hyphenation "in" an en- or em-dash (-8-), 174 % disallow hyphenation before and after an en- or em-dash 175 % (--8 + 8-7 ==> 8-8-8) because EC fonts v1.0 are missing 176 % appropriate ligatures for --(-) + hyphenchar! 177} 178% \changes{v0.2}{1997/02/01}{Replaced `2-1', `.-2' by `8-7', `.-8', 179% otherwise it is possible that the `2' is overwritten by a 180% greater odd value of another pattern.} 181% \changes{v0.2}{1997/04/13}{Added `8-8-8' resp. `--8' for 182% EC fonts v1.0.} 183% 184% 185% 2a) for all lowercase letters: 186% change catcode to letter (or other) to make sure that these 187% characters are not active, ignored, etc. and 188% change lccode to a non-zero value to allow its use inside 189% \patterns 190% 191% 2b) Add the patterns 192% .X-8 % disallow "X-|ray", "n-|fach", etc. 193% 8X8Y- % => "\righthyphenmin"=3 and "\lefthyphenmin"=3 194% -X8Y % before and after the hyphen 195% for all X,Y in the set of lowercase letters. 196% 197% 198\def\a#1{% add pattern to pattern list \L 199 \C=#1\relax \catcode\C=11\lccode\C=\C 200 \lccode`X=\C 201 \lowercase{% 202 \S\expandafter{\the\S .X-8 }% 203 \L\expandafter{\the\L 8X8Y- -X8Y8 }% 204 }} 205% 206% \changes{v0.2}{1997/02/01}{Replaced `X-2' by `X-8, 207% otherwise it is possible that the `2' is overwritten by a 208% greater odd value of another pattern.} 209% 210\def\y{% 211 % 212 % Add patterns for "lowercase letter d with bar" 213 % 214 \a{'236}% lowercase letter d with bar 215 % 216 % ... and for all lowercase characters: 217 % 218 % for i=`z downto `a do 219 % change catcode & lccode of char with code i 220 % add patterns for this char 221 % endfor 222 % 223 \i=`\z \advance\i 1 % 224 % 225 \def\x{% 226 \ifnum\i>`\a % 227 \advance\i -1 % 228 \a\i % add patterns for char `i' 229 \expandafter\x 230 \fi}% 231 \x 232 % 233 % for i = char "ij" ('274) downto char "a breve" ('240) do 234 % change catcode & lccode of char with code i 235 % add patterns for this char 236 % endfor 237 % 238 \i='275 % = '274 + 1 '274: lowercase letter ij 239 % 240 \def\x{% 241 \ifnum\i>'240 % 242 \advance\i -1 % 243 \a\i % add patterns for char `i' 244 \expandafter\x 245 \fi}% 246 \x 247 % 248 % \changes{v0.3}{2000/01/31}{Added code for char '340-'377.} 249 % 250 % for i = char "sharp s" ('377) downto char "a grave" ('340) do 251 % change catcode & lccode of char with code i 252 % add patterns for this char 253 % endfor 254 % 255 \i='377 \advance\i 1 % 256 % 257 \def\x{% 258 \ifnum\i>'340 % 259 \advance\i -1 % 260 \a\i % add patterns for char `i' 261 \expandafter\x 262 \fi}% 263 \x 264 % 265}% -- end of \y -- 266% 267% Now do the real work: 268% 269\y 270% 271% 272% The list of "simple" patterns is ready to use: 273% 274\patterns{ \the\S }% 275\S={}% free memory used for token list 276% 277% 278% Now \L contains all needed patterns for all characters X 279% and one character Y. To finish our task we have to loop over Y 280% for all lowercase characters. 281% 282\def\h#1\relax{% lowercase #1 and add patterns 283 \lowercase{% 284 \patterns{#1}% 285 }} 286% 287\def\a#1{% add patterns in \L with Y replaced by #1 288 \lccode`Y=#1\relax 289 \expandafter\h\the\L\relax 290} 291% 292% Now do the real work (with the redefined macro \a): 293% 294\y 295% 296\message{done.} 297% 298% Restore all \catcode and \lccode setting, definitions for 299% csname, register changes, etc. 300% 301\endgroup 302\endinput 303%% 304%% End of file `hypht1.tex'. 305