summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/hyph-utf8/hyphenation-distribution.tex
blob: b6d9747b60869ffa9832125b05ce9854b0ccac4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
\setuplayout
	[backspace=2cm,width=middle]

% \usetypescript[antykwa-poltawskiego]
% \setupbodyfont[antykwa-poltawskiego,10pt]
\usetypescript[antykwa-poltawskiego][ec]
\setupbodyfont[antykwa-poltawskiego,10pt]

\setuphead
	[section,subject]
	[style=\bfc]
\setuphead
	[subsection,subsubject]
	[style=\bfb]
\setuppagenumbering
	[location={footer}]
\setuplayout
	[header=0pt,headerdistance=0pt,height=24cm]
\setupwhitespace
	[medium]

\def\TeXLive{\TeX\ Live}
\def\MiKTeX{MiK\TeX}
\def\W32TeX{W32\TeX}
\def\pTeX{p\TeX}

\starttext

\section{\TeX\ distributions}

\subsection{\TeXLive}

In \TeXLive\ you can install different language collections \type{collection-lang}{\tt\sl <foo>}.

\placefigure[force]{}{\externalfigure[img/texlive-collection.png][width=340pt]}

For example, the German collection \type{collection-langgerman} contains packages \type{hyphen-german} and \type{dehyph-exptl} which both contain hyphenation patterns (in addition to many other packages related to German language). The Greek collection \type{collection-langgreek} contains \type{hyphen-greek} and \type{hyphen-ancientgreek} among other packages. The package \type{dehyph-exptl} is maintained independently, while all packages \type{hyphen-}{\tt\sl<foo>} belong to \type{hyph-utf8}.




Hyphenation packages may contain one or more patterns. For example \type{hyphen-norwegian} contains two directives for adding two hyphenation patterns:
\starttyping
execute AddHyphen \
        name=bokmal synonyms=norwegian,norsk \
        lefthyphenmin=2 \
        righthyphenmin=2 \
        file=loadhyph-nb.tex \
        file_patterns=hyph-nb.pat.txt \
        file_exceptions=hyph-nb.hyp.txt
execute AddHyphen \
        name=nynorsk \
        lefthyphenmin=2 \
        righthyphenmin=2 \
        file=loadhyph-nn.tex \
        file_patterns=hyph-nn.pat.txt \
        file_exceptions=hyph-nn.hyp.txt
\stoptyping

The keywords {\bf name} and {\bf synonyms} are used as language name to access the patterns in \TeX, {\bf file} is used as pattern loader for 8-bit engines and \XeTeX, while {\bf file\_patterns} and {\bf file\_exceptions} are plain text files used by \LuaTeX.

The information from \type{AddHyphen} directives end up in three different files: \type{language.dat} used by \LaTeX, \type{language.def} used by plain \eTeX\  and \type{language.dat.lua} used by \LuaTeX.

All the three are placed in\crlf
\strut\type{    $TEXMFSYSVAR/tex/generic/config},\crlf
for example in\crlf
\strut\type{    /usr/local/texlive/2017/texmf-var/tex/generic/config},\crlf
while a static copy also exists in\crlf
\strut\type{    $TEXMFDIST/tex/generic/config},\crlf
but that one contains all languages and only makes sense if you have a complete checkout from SVN repository for example.

\placefigure[force]{\type{language.dat}}{
\starttyping
% from hyphen-norwegian:
bokmal loadhyph-nb.tex
=norwegian
=norsk
nynorsk loadhyph-nn.tex
\stoptyping
}

\placefigure[force]{\type{language.def}}{
\starttyping
% from hyphen-norwegian:
\addlanguage{bokmal}{loadhyph-nb.tex}{}{2}{2}
\addlanguage{norwegian}{loadhyph-nb.tex}{}{2}{2}
\addlanguage{norsk}{loadhyph-nb.tex}{}{2}{2}
\addlanguage{nynorsk}{loadhyph-nn.tex}{}{2}{2}
\stoptyping
}

\placefigure[force]{\type{language.dat.lua} (the keyword \type{loader} is not used anywhere at the moment)}{
\starttyping
-- from hyphen-norwegian:
	['bokmal'] = {
		loader = 'loadhyph-nb.tex',
		lefthyphenmin = 2,
		righthyphenmin = 2,
		synonyms = { 'norwegian', 'norsk' },
		patterns = 'hyph-nb.pat.txt',
		hyphenation = 'hyph-nb.hyp.txt',
	},
	['nynorsk'] = {
		loader = 'loadhyph-nn.tex',
		lefthyphenmin = 2,
		righthyphenmin = 2,
		synonyms = {  },
		patterns = 'hyph-nn.pat.txt',
		hyphenation = 'hyph-nn.hyp.txt',
	},
\stoptyping
}

The files \type{language.dat} and \type{language.def} are used both by 8-bit and native Unicode engines. On one hand this simplifies things, while on the other it makes very little sense to include sanskrit patterns in \pdfTeX\ -- the package doesn't load any patterns in that case any way. It might be that there will be multiple copies of \type{language.dat} for different engines in future.

\subsection{\MiKTeX}

In \MiKTeX\ application {\bf MiKTeX Options} which you can run from Start menu ({\em Maintenance} $\rightarrow$ {\em Settings} or {\em Maintenance (Admin)} $\rightarrow$ {\em Settings (Admin)\/}) or from command line (\type{mo.exe} or \type{mo_admin.exe}) you can select which languages you want to include into \TeX\ formats.

\placefigure[force]{user interface to select the desired languages}{\externalfigure[img/MiKTeX-languages.png]}%[width=7cm]

Based on that selection \MiKTeX\ creates three files \type{language.dat}, \type{language.def} and \type{language.dat.lua} in directory
\starttyping
    C:\ProgramData\MiKTeX\2.9\tex\generic\config
\stoptyping

The contents of those files are the same as described in \TeXLive\ section, but the needed information about names of languages and required files comes from
\starttyping
    C:\Program Files\MiKTeX 2.9\MiKTeX\config\languages.ini
\stoptyping
instead of special \type{hyphen-}{\tt\sl<foo>} packages.

(Exact location might depend on where you install \MiKTeX\ and whether you install it for all users or just for yourself. It may also depend on Windows version. The information above holds for \MiKTeX\ 2.9 on Windows 7 with system-wide installation.)

\placefigure[force]{\type{languages.ini}}{
\starttyping
[bokmal]
loader=loadhyph-nb.tex
lefthyphenmin=2
righthyphenmin=2
synonyms=norwegian,norsk
patterns=hyph-nb.pat.txt

[nynorsk]
loader=loadhyph-nn.tex
lefthyphenmin=2
righthyphenmin=2
patterns=hyph-nn.pat.txt
\stoptyping
}

% \subsection{\W32TeX}

\page

List of languages in \TeXLive\ 2017:
\startcolumns[two]
\starttyping
collection-langarabic
  hyphen-arabic
    arabic
  hyphen-farsi
    farsi,persian
collection-langchinese
  hyphen-chinese
    pinyin
collection-langcyrillic
  hyphen-belarusian
    belarusian
  hyphen-bulgarian
    bulgarian
  hyphen-churchslavonic
    churchslavonic
  hyphen-mongolian
    mongolian
    mongolianlmc
  hyphen-russian
    russian
  hyphen-serbian
    serbian
    serbianc
  hyphen-ukrainian
    ukrainian
collection-langczechslovak
  hyphen-czech
    czech
  hyphen-slovak
    slovak
collection-langenglish
  hyphen-english
    ukenglish,british,UKenglish
    usenglishmax
collection-langeuropean
  hyphen-armenian
    armenian
  hyphen-croatian
    croatian
  hyphen-danish
    danish
  hyphen-dutch
    dutch
  hyphen-estonian
    estonian
  hyphen-finnish
    finnish
  hyphen-friulan
    friulan
  hyphen-hungarian
    hungarian
  hyphen-icelandic
    icelandic
  hyphen-irish
    irish
  hyphen-kurmanji
    kurmanji
  hyphen-latin
    classiclatin
    latin
    liturgicallatin
  hyphen-latvian
    latvian
  hyphen-lithuanian
    lithuanian
  hyphen-norwegian
    bokmal,norwegian,norsk
    nynorsk
  hyphen-occitan
    occitan
  hyphen-piedmontese
    piedmontese
  hyphen-romanian
    romanian
  hyphen-romansh
    romansh
  hyphen-slovenian
    slovenian,slovene
  hyphen-swedish
    swedish
  hyphen-turkish
    turkish
  hyphen-uppersorbian
    uppersorbian
  hyphen-welsh
    welsh
collection-langfrench
  hyphen-basque
    basque
  hyphen-french
    french,patois,francais
collection-langgerman
  hyphen-german
    german
    ngerman
    swissgerman
collection-langgreek
  hyphen-greek
    monogreek
    greek,polygreek
  hyphen-ancientgreek
    ancientgreek
    ibycus
collection-langitalian
  hyphen-italian
    italian
collection-langother
  hyphen-afrikaans
    afrikaans
  hyphen-coptic
    coptic
  hyphen-esperanto
    esperanto
  hyphen-ethiopic
    ethiopic,amharic,geez
  hyphen-georgian
    georgian
  hyphen-indic
    assamese
    bengali
    gujarati
    hindi
    kannada
    malayalam
    marathi
    oriya
    panjabi
    tamil
    telugu
  hyphen-indonesian
    indonesian
  hyphen-interlingua
    interlingua
  hyphen-sanskrit
    sanskrit
  hyphen-thai
    thai
  hyphen-turkmen
    turkmen
collection-langpolish
  hyphen-polish
    polish
collection-langportuguese
  hyphen-portuguese
    portuguese,portuges
collection-langspanish
  hyphen-spanish
    spanish,espanol
  hyphen-catalan
    catalan
  hyphen-galician
    galician
\stoptyping
\stopcolumns

% \section{Special cases}
% 
% \subsection{German}
% 
% \subsection{Russian and Ukrainian}
% 
% \section{How to add your own language?}

\stoptext