% hymltex2.tex / This file is based on % masthyph.tex for TeX V2 modified Oct. 91 by Bernard GAULLE % to define dynamically languages and load hyphenation files with MLTeX V2. % Updates: % 2/28/92 language number setting was wrong. % 3/20/92 allow hyphenation exceptions file (in language.dat) loading. % 8/24/92 introduce \l@ being the language number % 03/03/93 add dialect feature via ``='' sign. % 05/04/93 \fhyph, \ehyph & \ghyph revisited to avoid loops when % \openin can't access a full PATH. % 08/20/93 insert space after \input X for NFSS2 (H. Soulard) % 01/13/94 add \j def for non french language (noted by R. Lemieux). % 03/22/94 \LANGUAGESinFORMAT now contains all languages names (proposed % by Michel Lavaud). % \input hyphen replaced by \input ushyphen (sugg. of M.Lavaud). % 05/05/94 \patterns@loaded replace \LANGUAGESinFORMAT as in Babel. % 08/10/94 \input replaced by \@@input. % 12/13/94 Allow nothing else than =name in language.dat % 12/18/94 Let language counter progress event = sign after the first language. %-*-tex-*- % Copyright Michael J. Ferguson, INRS-Telecommunications % All rights reserved. %% %% checksum = "45824 131 533 4943" %% % ======== Master Multilingual Pattern Inputs ====== % This file defines the changes in the \lccodes needed for Multilingual TeX % and then inputs the patterns for English and French. % =========== Special lccodes and hyphenation for Bilingual Version ==== {\catcode`\^^?=12 \gdef\accentcodes{ \lccode`\^^R=1 %for \` \lccode`\^^S=1 % for \' \lccode`\^^V=1 % for \= \lccode`\^^X=1 % for \c cedilla .. perhaps should be 2 \lccode`\^^P=`\^^P % dotless i \lccode`\^^[=`\^^[ % \oe \lccode`\^^^=`\^^[ % \OE \lccode`\^ =1 % for \^ \lccode`\~ =1 % for \~ \lccode`\^^? =1 % for \" } \gdef\accenthyphcodes{ \def\`{^^R} %for \` \def\'{^^S} % for \' \def\={^^V} % for \= \def\c{^^X} % for \c cedilla \def\"{^^?} % \" \def\i{^^P} % \i \def\j{^^Q} % \j % appropriate character subsitution for patterns \def\oe{^^[} % \oe } } {\catcode`\^=12 \catcode`\~=12 \gdef\spechyphcodes{\def\^{^} % \^ \def\~{~} % \~ }} \accentcodes % inrstex defaults to this form \let\h@yphenation=\hyphenation \def\hyphenation#1{{\spechyphcodes\accenthyphcodes \h@yphenation{#1}}} \language=1000 % ======== Load Patterns as described in language.dat ====== % (language.dat was introduced by Johannes Braams) {\newcount\l@nguage\newcount\initl@\newcount\workl@% % Compatibility with TeX 2: \language count \ifx\language\let\language\l@nguage\fi \initl@=\language\l@nguage=\initl@\workl@=\l@nguage \xdef\patterns@loaded{}% will contain all languages names \def\@newlanguage[#1]#2{\language=#1% \workl@=#1\advance\workl@ by -\initl@ \message{The #2 language is used as language number \the\workl@}% \expandafter\xdef\csname l@#2\endcsname{\the\workl@}% 08/24/92 \xdef\patterns@loaded{\patterns@loaded\space #2} \expandafter\xdef\csname#2\endcsname{\language=\the\workl@\relax}%2/28/92 \ifx\undefined\defaultlanguage\gdef\defaultlanguage{\csname#2\endcsname}\fi}% % test if #1 equal ``='' that means same language hyphenation but a dialect. \def\@language#1#2 #3 #4/#5{\def\@tempa{=}\def\@tempb{#1}% \edef\@tempc{=}% \ifx\@tempa\@tempb% \ifnum\l@nguage > \initl@ \advance\l@nguage by -1\fi% \@newlanguage[\the\l@nguage]{#2}% \ifnum\l@nguage \@tempc \initl@ \advance\l@nguage by -1\fi% \else\edef\@tempc{<}\@l@ngu@ge#1#2 #3 #4/{#5}% \fi}% \def\@l@ngu@ge#1 #2 #3/#4{\begingroup\@newlanguage[#4]{#1}%20/3/92 mods \def\@tempa{#2} \ifx\@tempa\empty\else\expandafter\@@input#2 \relax\fi%% loading of patterns \edef\@tempa{#3}\edef\@tempb{\space\space} \ifx\@tempb\@tempa\else\expandafter\@@input#3 \relax\fi%% loading of exceptions \endgroup} \newif\if@more\@moretrue \openin1 = language.dat \ifeof1\message{Error: file language.dat not found, trying to load % US-english hyphenation file}\language=0\input ushyphen \else\advance\l@nguage by -1 \loop \endlinechar=-1 \read1 to \@lineD \endlinechar`\^^M \ifx\@lineD\empty \else \advance\l@nguage by 1% \edef\@lineD{\@lineD\space\space/{\the\l@nguage}}% \expandafter\@language\@lineD \fi \ifeof1 \@morefalse \fi \if@more\repeat \fi\closein1 %%% Needed material for MLTeX V2 which needs the real number of languages \begingroup \advance\l@nguage by -999\language=\the\l@nguage \input dumyhyph % dummy file requested by MLTeX \endgroup % to end patterns processing }\defaultlanguage% go to the default language (first defined in language,dat) % ======= definitions for fast e/f/g hyphenation ===== \def\ehyph{\language=\l@english \lccode`\'=0 \nonfrenchspacing}% \def\fhyph{\language=\l@french \lccode`\'=`\' \frenchspacing}% \def\ghyph{\language=\l@german}% \endinput