Debian Codegraph @

texmf-dist/doc/plain/hyplain/hydoc.tex

raw
1 %%% This is part of the hyplain package by Enrico Gregorio
2 %%% You are allowed to do anything you want with this as long
3 %%% as you cite the source and change name to the file
4
5 \hoffset=.46truecm
6 \hsize=15truecm
7 \advance\voffset by -2.5\baselineskip
8 \advance\vsize by 5\baselineskip
9
10 \font\tensf=cmss10
11
12 \def\manyhyphens{%
13 \hyphenpenalty=-1000
14 \pretolerance=-1
15 \tolerance=1000
16 \doublehyphendemerits=-100000
17 \finalhyphendemerits=-100000
18 }
19
20 \def\LaTeX{L\kern-.36em\setbox0=\hbox{T}\vbox to\ht0
21 {\hbox{\sevenrm A}\vss}\kern-.15em\TeX}
22 \def\LaTeXe{\LaTeX$2_{\textstyle\varepsilon}$}
23
24 \def\cs#1{\char`\\#1}
25 \def\ar#1{\char`\{#1\char`\}}
26 \def\showcommand#1{\par\nobreak\medskip\begingroup\tt#1\endgroup\par\medskip
27 \noindent\ignorespaces}
28
29 \addto{it}{IT}{\frenchspacing}{\nonfrenchspacing}
30
31 \begingroup\manyhyphens
32
33 \centerline{\bf How to use hyplain --- version 1.0}
34
35 \medskip
36
37 Many (well, at least more than twelve) years ago, \LaTeX{} was not as usable as it is today.
38 So we were forced to use AMS-\TeX{} for typesetting mathematical papers.
39
40 At the very beginning there were two plain formats to use, the original one and the one
41 (called plainit) for Italian hyphenation. With the advent of \TeX3 we could use only one and
42 define some switch for selecting the language.
43
44 I found a package called HyMaster that could be used for this purpose; it was developed by
45 Daniel Flipo and Laurent Siebenmann for French. Since Italian typesetting rules do not
46 require the contortions of the French, it was simple to adapt only one file for canning a
47 format file.
48
49 With the advent of \LaTeXe, everything was forgotten. Until recently, when a user in a
50 discussion forum showed some code that I recognized as my modifications to HyMaster! He
51 proposed some procedure to build the format which was very complicated (you see, at that
52 time we were using Oz\TeX; nowadays, te\TeX{} or MiK\TeX{} require different actions). So I
53 tried to rethink to the business.
54
55 \IT
56
57 \bigskip
58
59 \hrule
60
61 \medskip
62
63 \centerline{\bf Come usare hyplain}
64
65 \medskip
66
67 Parecchi (be', almeno dodici) anni fa, \LaTeX{} non era cos\`{\i} facile da usare come \`e
68 oggi. Per comporre testi matematici eravamo quindi costretti a usare AMS-\TeX{}.
69
70 All'inizio c'erano due formati plain da usare, l'originale e quello (chiamato plainit) per
71 la sillabazione italiana. Con l'avvento di \TeX3, si pot\'e usare un solo formato con la
72 possibilit\`a di cambiare le regole di sillabazione con un comando.
73
74 Trovai un pacchetto chiamato HyMaster che poteva essere usato per questo scopo; era stato
75 sviluppato da Daniel Flipo e Laurent Siebenmann per il francese. Siccome la tipografia
76 italiana non richiede le contorsioni di quella francese, fu semplice adattare un solo {\it
77 file\/} per costruire un formato.
78
79 Con l'avvento di \LaTeXe, tutto fu dimenticato. Finch\'e, recentemente, un utente di un
80 gruppo di discussione esib\`{\i} del codice che riconobbi come le mie modifiche a HyMaster!
81 Proponeva una procedura piuttosto complicata per costruire il formato (a quel tempo usavamo
82 Oz\TeX; ora te\TeX{} e MiK\TeX{} richiedono azioni diverse). Perci\`o ho provato a ripensare
83 alla faccenda.
84
85 \medskip
86
87 \hrule
88
89 \bigskip
90
91 \endgroup
92
93 \US
94
95 As you can see, hyphenation in US~English and in Italian behave properly. The text above has
96 been typeset with more hyphens than usual.
97
98 \medskip
99
100 The package consists of three files: {\tt hyplain.tex}, {\tt hyrules.tex} and {\tt
101 hylang.tex}. Only the third one needs to be modified by the users who want to define
102 languages to employ.
103
104 The basic definition of a language is given by a command
105 \showcommand{\cs{definelanguage}\ar{xx}\ar{YY}\ar{filename}} where {\tt xx} is the ISO
106 abbreviation for the language ({\tt en} for English, {\tt it} for Italian, {\tt de} for
107 German), {\tt YY} is the ISO abbreviation for the nation and {\tt filename} is the name of
108 the hyphenation pattern file. Thus
109 \showcommand{\cs{definelanguage}\ar{it}\ar{IT}\ar{ithyph}} defines Italian.
110
111 There is also {\tt\cs{definedialect}} for defining a language which shares hyphenation
112 patterns with another; for example
113 \showcommand{\cs{definedialect}\ar{de}\ar{AT}\ar{de}\ar{DE}} defines ``German for Austria'',
114 assuming that \showcommand{\cs{definelanguage}\ar{de}\ar{DE}\ar{dehypht}} has already been
115 given.
116
117 After a {\tt\cs{definelanguage}} command, {\tt\cs{refinelanguage}} should be given; it has
118 four arguments
119
120 \nobreak\smallskip
121 \item{\tt\#1} the two-letter language abbreviation,
122
123 \item{\tt\#2} the two-letter nation abbreviation,
124
125 \item{\tt\#3} the code to be executed when the language comes into action,
126
127 \item{\tt\#4} the code to be executed when another language is called.
128 \smallskip
129
130 This command should always contain in the third argument the left and right hyphenation
131 minima: for example, we set
132 \showcommand{\cs{refinelanguage}\ar{en}\ar{US}%
133 \ar{\cs{hyphenmins}\ar{2}\ar{3}}\ar{}}
134 in order to enforce the usual conventions for American English; as another example, we set
135 \showcommand{\cs{refinelanguage}\ar{it}\ar{IT}%
136 \ar{\cs{hyphenmins}\ar{2}\ar{2}\cs{lccode}`\char`\\'=`\char`\\'}%
137 \ar{\cs{lccode}`\char`\\'=0 }}
138 because the lower case code of the right quote should not be zero for correct Italian
139 hyphenation. We need to ``undo'' the effect since we don't know whether the user calls the
140 language switch inside a group or not. The command
141 \showcommand{\cs{hyphenmins}\ar{x}\ar{y}}
142 is an abbreviation for {\tt\cs{lefthyphenmin}=x\cs{righthyphenmin}=y} and it is not
143 necessary to ``undo'' it.
144
145 The commands {\tt\cs{definedialect}} and {\tt\cs{refinedialect}} (analog to
146 {\tt\cs{refinelanguage}}) can be given also in the user's document where, of course, it is
147 too late to define new languages with their hyphenation patterns. Anyway, users can simulate
148 new language definitions by defining a dialect to language {\tt\cs{zz\_ZZ}}, which is a
149 fallback without hyphenation tables.
150
151 If one wants to extend the functionalities of a language, there is also the command
152 \showcommand{\cs{addto}\ar{xx}\ar{YY}\ar{do}\ar{undo}}
153 which can be used, for example, in the following way
154 \showcommand{\cs{addto}\ar{it}\ar{IT}%
155 \ar{\cs{frenchspacing}}\ar{\cs{nonfrenchspacing}}}
156 in order to enforce French spacing for Italian (in Italy).
157
158 Finally, there is a command to choose a defined language (or even an undefined one, try it)
159 \showcommand{\cs{selectlanguage}\ar{xx}\ar{YY}}
160 which selects language {\tt xx} for {\tt YY}. Users can add aliases for this with
161 \showcommand{\cs{addalias}\ar{\cs{command}}\ar{xx}\ar{YY}}
162 (see {\tt hylang.tex} for examples). After saying
163 \showcommand{\cs{addalias}\ar{\cs{IT}}\ar{it}\ar{IT}}
164 you can simply say {\tt\cs{IT}} to switch to Italian. This alias is actually predefined in
165 the present version of {\tt hylang.tex} as well as {\tt\cs{US}} for US~English.
166
167 \bigskip
168
169 \centerline{\bf Installation}
170
171 \nobreak\medskip
172
173 Put the three files in some directory and process with
174 \showcommand{tex -ini hyplain}
175 and after this put the produced format in some suitable place of the \TeX{} tree. After this
176 \showcommand{tex -fmt hyplain filename}
177 will typeset {\tt filename.tex} using the new format. This is for a *nix system and a
178 {\tensf Web2C} distribution like te\TeX{} or \TeX{}Live; for MiK\TeX{} find the way, I don't
179 use it. You can use also {\tt pdftex} and you can use the newly created {\tt hyplain.fmt} to
180 build AMS-\TeX{} over it. For {\tt pdftex} you should use
181 \showcommand{pdftex -ini hypdfplain.ini}
182 and then
183 \showcommand{pdftex -fmt hypdfplain filename}
184 If you want to access the extended features of $\varepsilon$-\TeX{}, then do
185 \showcommand{pdftex -ini '*hypdfplain.ini'}
186
187 \vfill
188
189 \rightline{Enrico Gregorio}
190 \rightline{October 17, 2006}
191 \bye