diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/hyacc-cm/hyacc-cm.tex |
Initial commit
Diffstat (limited to 'macros/generic/hyacc-cm/hyacc-cm.tex')
-rw-r--r-- | macros/generic/hyacc-cm/hyacc-cm.tex | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/macros/generic/hyacc-cm/hyacc-cm.tex b/macros/generic/hyacc-cm/hyacc-cm.tex new file mode 100644 index 0000000000..794c603d7a --- /dev/null +++ b/macros/generic/hyacc-cm/hyacc-cm.tex @@ -0,0 +1,250 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%% HyAcc-CM.tex is a system for European language hyphenation + %%% using the original CM fonts. It is based on an earlier + %%% system given by Jacques D\'esarm\'enien + + %%% for French in his fePlain format of the mid 1980's. + %%% + %%% AIM: + %%% Permit automatic TeX hyphenation, under the + %%% original Computer Modern font norm, in words containing + %%% composite accented characters; + %%% more precisely, allow those hyphenations + %%% that occur far from the accents. Without + %%% HyAcc-CM.tex, hyphenation is blocked near and after the + %%% first accented character. + %%% + %%% SETUP: + %%% \input at some point after Plain has been + %%% compiled with appropriate hyphenation patterns for the + %%% languages to be used. See HyMaster.tex for a typical + %%% example. + %%% + %%% COMMANDS: + %%% --- \JDaccents a modified international version of + %%% J. Desarmenien's e-accute accent in his "fePlain" format; + %%% hyphenation except near accents. This is default. + %%% --- \GFaccents similar to \JDaccents, but slightly + %%% fragile (for LaTeX); it avoids a dot matrix (low + %%% resolution) printer bug afflicting \JDaccents. From + %%% German.sty corrected for French and international use. + %%% --- \DKaccents gives Knuth's regime under which no + %%% hyphenation is allowed beyond first accent in word with + %%% accent. + %%% + %%% PECULIARITY: + %%% By default, non-zero lc and uc codes for the + %%% sporadic characters \ae, \AE, \oe, \OE, + %%% \o, \O, \i, \j following an oecumenical policy + %%% of M. Ferguson and D. Taupin. + %%% --- \noMLcodes makes them zero + %%% (Knuth's Plain setting) and + %%% --- \MLcodes returns to our default. + %%% + %%% RESTRICTIONS: + %%% For fonts of the original Computer Modern + %%% norm and NOT not the Cork norm. + %%% Do not use prose accents in math mode. + %%% + %%% VIRTUES: + %%% decent hyphenation without special European fonts; + %%% compatibility with Knuth's documentation.%%XX + %%% Temporary 100% return to Knuth's regime is possible + %%% via \DKaccents\noMLcodes + %%% + %%% HISTORY AND PROGRAMMER DOCUMENTATION see HyAcc-CM.doc. + %%% + %%% POSTING: by Daniel Flipo <flipo@frcitl81.bitnet> and + %%% Laurent Siebenmannn <siebenmann@LALCLS.IN2P3.FR> ftp + %%% rsovax.ups.circe.fr [130.84.128.100] logon: anonymous, + %%% password: your name. + %%% + %%% VERSION : August, 1992 + %%% Modifications: Polish \ogonek added, + %%% \box0 replaced by \box\hy@accbox + + \def\Msg{\immediate\write16} + %% Prevent this file from being loaded twice! + \let\this\relax + \ifx\JDaccents\undefined\relax + \else\Msg{}% + \Msg{ *** \string\JDaccents\space + already defined.}% + \let\this\endinput + \fi + \this + + %% If \allowhyphens is already defined + %% (by German.tex for instance), just complain. + \ifx\undefined\allowhyphens + \let\this\relax + \else + \Msg{}% + \message{ *** \string\allowhyphens\space + (from German.tex) already defined.}% + \let\this\endinput + \fi + \this + %%XX + \def\W@{\immediate\write16}% + \W@{ *************************************************** } + \W@{ HyAcc-CM INTERNATIONAL ACCENTUATION MECHANISM FOR CM FONTS} + \W@{ permitting decent hyphenation of words with accents.} + \W@{ Version of Aug 1992.} + \W@{ Updates: ftp rsovax.ups.circe.fr [130.84.128.100].} + \W@{ *************************************************** } + + \chardef\JDCatAt=\the\catcode`\@ + \catcode`\@=11 + \catcode`\~=12 %% was 13 + + \newbox\hy@accbox + + \def\hyaccent#1#2{{\accent#1 #2}\@Allowhyphens{#2}}% + + %% for \JDaccents + \def\@@allowhyphens{\penalty\@M\hskip\z@skip}%% for sporadics + \def\@@Allowhyphens#1{\setbox\hy@accbox\hbox{#1}%% \hyaccent + \penalty\@M\hskip-\wd\hy@accbox #1}% + + %% for \GFaccents + \def\preLetterSkip@{\ifcat + a\next\relax\penalty\@M\hskip\z@\fi} %XXspacing + + \def\@@@Allowhyphens#1{\noexpand + \futurelet\next\preLetterSkip@} + + \let\next\relax %% avoids some mysterious errormessages + %% in case you uncautiously use %%XX + %% accents in messages, %%XX + %% \GFaccents\message{Imb\'ecile!} + + %%% Composite accents for CM fonts + %% TeXbook p. 52 + + \def\DoCMAccents{%% cf \dospecials of Plain + \do`"12..%% grave + \do'"13..%% accute + \do^"5E..%% hat + \do""7F..%% umlaut + \do~"7E..%% tilde + \do="16..%% macron (bar over) + \do."5F..%% dot over + \do u"15..%% breve + \do v"14..%% check + \do H"7D..%% long umlaut + %%\t tie absent see below + } + + \def\CheckPeriod#1{\if#1.\else + \errmessage{ !!! Error in DoAccChars data}\fi} + + \def\DoAccent#1#2.#3{\CheckPeriod{#3}% + \expandafter + \def\csname #1\endcsname##1{% + \relax\hyaccent{#2}{##1}}% + } + + \let\do\DoAccent + \DoCMAccents %% Sets up principal new accent macros + + %%% Residual accents : \c,\aa,\AA,\l,\L + + \def\oldCedilla#1{\setbox\hy@accbox\hbox{#1}% + \ifdim\ht\hy@accbox=1ex\accent24 #1% + \else{\ooalign{\unhbox\hy@accbox\crcr\hidewidth\char24\hidewidth}}% + \fi} + + \def\c#1{{\oldCedilla#1}\@Allowhyphens{#1}} + + \def\L{\char32 L} + \def\l{\char32 l} + + \def\AA{\leavevmode\setbox\hy@accbox\hbox{h}% + \dimen@\ht\hy@accbox\advance\dimen@-1ex% + \rlap{\raise.67\dimen@\hbox{\char'27}}\@allowhyphens A} + + \def\aa{\hyaccent{"17}{a}} + + \def\oldUnderBar#1{\oalign{#1\crcr\hidewidth + \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}} + + \def\b#1{\oldUnderBar#1\@Allowhyphens{#1}}% underbar + + \def\d#1{\oalign{#1\crcr + \hidewidth.\hidewidth}\@Allowhyphens{#1}}%underdot + + \def\t#1{{\edef\next{\the\font}\the\textfont1\accent + "7F\next#1}\@Allowhyphens{#1}} + %% tie; \textfont1 is cmmi + + \def\oldOgonek#1{\setbox\hy@accbox=\hbox{`}\ooalign{\hidewidth + \lower\ht\hy@accbox\copy\hy@accbox%%\hidewidth + \crcr#1\crcr}} + \def\ogonek#1{{\oldOgonek#1}\@Allowhyphens{#1}}% ogonek + + + %%% Sporadic characters in cm + %%% Plain assigns codes 0; Ferguson and Taupin as follows + %%% see article of Taupin (to appear) + %%% For better or worse, this permits hyphenation of + %%% words containing these characters. + %%% More importantly it is a policy that + %%% is language-independant. + %%% But catcodes are left 12 and not 11, to prevent use + %%% in macro names when directly typed. + + \def\SetULCodes#1#2{% + \uccode#1=#1\lccode#1=#2 + \uccode#2=#1\lccode#2=#2 + } + + \def\KillULCodes#1#2{% + \uccode#1=0\lccode#1=0 + \uccode#2=0\lccode#2=0 + } + + \def\MLcodes{% + \SetULCodes{"19}{"19} %% \ss (degenerate case) + \SetULCodes{"1D}{"1A} %% \AE,\ae + \SetULCodes{"1E}{"1B} %% \OE,\oe + \SetULCodes{"1F}{"1C} %% \O, \o + \lccode"10="10 %% \i + } + + \def\noMLcodes{% + \KillULCodes{"19}{"19} %% \ss (degenerate case) + \KillULCodes{"1D}{"1A} %% \AE,\ae + \KillULCodes{"1E}{"1B} %% \OE,\oe + \KillULCodes{"1F}{"1C} %% \O, \o + \lccode"10=0 %% \i + } + + %%% For LaTeX 2.xx necessary change for \parbox macro + \ifx\documentstyle\undefined + \else %% if LaTeX IS loaded, save our new definitions of + %% \' \` and \= for \parbox macro (LaTeX 2.xx) + \let\@acci=\' + \let\@accii=\` + \let\@acciii=\= + \fi + + %% JD for Jacques Desarmenien + \def\JDaccents{\let\@Allowhyphens\@@Allowhyphens + \let\@allowhyphens\@@allowhyphens} + + %% GF for German French + \def\GFaccents{\let\@Allowhyphens\@@@Allowhyphens + \let\@allowhyphens\@@allowhyphens} + + %% DK for Don Knuth + \def\DKaccents{\def\@Allowhyphens##1{\relax}% + \let\@allowhyphens\relax} + + %% Back to normal catcodes + \catcode`\~=13 + \catcode`\@=\JDCatAt + + \MLcodes\JDaccents %% defaults + + \endinput |