summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/babel-contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/babel-contrib
Initial commit
Diffstat (limited to 'macros/latex/contrib/babel-contrib')
-rw-r--r--macros/latex/contrib/babel-contrib/albanian/albanian.dtx302
-rw-r--r--macros/latex/contrib/babel-contrib/albanian/albanian.ins149
-rw-r--r--macros/latex/contrib/babel-contrib/albanian/albanian.pdfbin0 -> 124157 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/azerbaijani/README16
-rw-r--r--macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.dtx314
-rw-r--r--macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.ins128
-rw-r--r--macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.pdfbin0 -> 231987 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/basque/basque.dtx390
-rw-r--r--macros/latex/contrib/babel-contrib/basque/basque.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/basque/basque.pdfbin0 -> 155126 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/belarusian/README.md127
-rw-r--r--macros/latex/contrib/babel-contrib/belarusian/belarusian.dtx1992
-rw-r--r--macros/latex/contrib/babel-contrib/belarusian/belarusian.pdfbin0 -> 152365 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/bosnian/README24
-rw-r--r--macros/latex/contrib/babel-contrib/bosnian/bosnian.dtx233
-rw-r--r--macros/latex/contrib/babel-contrib/bosnian/bosnian.ins150
-rw-r--r--macros/latex/contrib/babel-contrib/bosnian/bosnian.pdfbin0 -> 102481 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/breton/breton.dtx365
-rw-r--r--macros/latex/contrib/babel-contrib/breton/breton.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/breton/breton.pdfbin0 -> 117881 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/bulgarian/README20
-rw-r--r--macros/latex/contrib/babel-contrib/bulgarian/bulgarian.dtx2092
-rw-r--r--macros/latex/contrib/babel-contrib/bulgarian/bulgarian.ins138
-rw-r--r--macros/latex/contrib/babel-contrib/bulgarian/bulgarian.pdfbin0 -> 192288 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/catalan/catalan.dtx712
-rw-r--r--macros/latex/contrib/babel-contrib/catalan/catalan.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/catalan/catalan.pdfbin0 -> 209300 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/croatian/croatian.dtx231
-rw-r--r--macros/latex/contrib/babel-contrib/croatian/croatian.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/croatian/croatian.pdfbin0 -> 121541 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/czech/czech.dtx1157
-rw-r--r--macros/latex/contrib/babel-contrib/czech/czech.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/czech/czech.pdfbin0 -> 189098 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/danish/danish.dtx337
-rw-r--r--macros/latex/contrib/babel-contrib/danish/danish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/danish/danish.pdfbin0 -> 127671 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/dutch/dutch.dtx560
-rw-r--r--macros/latex/contrib/babel-contrib/dutch/dutch.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/dutch/dutch.pdfbin0 -> 153748 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/english/README13
-rw-r--r--macros/latex/contrib/babel-contrib/english/english.dtx477
-rw-r--r--macros/latex/contrib/babel-contrib/english/english.ins160
-rw-r--r--macros/latex/contrib/babel-contrib/english/english.pdfbin0 -> 130367 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/esperanto/esperanto.dtx343
-rw-r--r--macros/latex/contrib/babel-contrib/esperanto/esperanto.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/esperanto/esperanto.pdfbin0 -> 126338 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/estonian/README.txt58
-rw-r--r--macros/latex/contrib/babel-contrib/estonian/estonian.dtx580
-rw-r--r--macros/latex/contrib/babel-contrib/estonian/estonian.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/estonian/estonian.pdfbin0 -> 109181 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/finnish/finnish.dtx363
-rw-r--r--macros/latex/contrib/babel-contrib/finnish/finnish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/finnish/finnish.pdfbin0 -> 139268 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/french/README49
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb-doc.pdfbin0 -> 164871 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb-doc.tex2020
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.dtx5899
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.ins98
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.pdfbin0 -> 243396 bytes
l---------macros/latex/contrib/babel-contrib/frenchb1
-rw-r--r--macros/latex/contrib/babel-contrib/friulan/README.txt21
-rwxr-xr-xmacros/latex/contrib/babel-contrib/friulan/friulan.dtx235
-rwxr-xr-xmacros/latex/contrib/babel-contrib/friulan/friulan.pdfbin0 -> 137834 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/galician/galician.dtx2437
-rw-r--r--macros/latex/contrib/babel-contrib/galician/galician.ins151
-rw-r--r--macros/latex/contrib/babel-contrib/galician/galician.pdfbin0 -> 442011 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/georgian/README2
-rw-r--r--macros/latex/contrib/babel-contrib/georgian/georgian.ldf231
-rw-r--r--macros/latex/contrib/babel-contrib/georgian/georgian.sty57
-rw-r--r--macros/latex/contrib/babel-contrib/georgian/georgiancaps.tex168
-rw-r--r--macros/latex/contrib/babel-contrib/german/README73
-rw-r--r--macros/latex/contrib/babel-contrib/german/german.ins112
-rw-r--r--macros/latex/contrib/babel-contrib/german/germanb.dtx1004
-rw-r--r--macros/latex/contrib/babel-contrib/german/germanb.pdfbin0 -> 394468 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/german/ngermanb.dtx815
-rw-r--r--macros/latex/contrib/babel-contrib/german/ngermanb.pdfbin0 -> 371070 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/README248
-rw-r--r--macros/latex/contrib/babel-contrib/greek/README.html1036
-rw-r--r--macros/latex/contrib/babel-contrib/greek/athnum.dtx277
-rw-r--r--macros/latex/contrib/babel-contrib/greek/athnum.pdfbin0 -> 176656 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/babel-greek.dtx1326
-rw-r--r--macros/latex/contrib/babel-contrib/greek/babel-greek.ins105
-rw-r--r--macros/latex/contrib/babel-contrib/greek/babel-greek.pdfbin0 -> 254908 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/grmath.dtx168
-rw-r--r--macros/latex/contrib/babel-contrib/greek/grmath.pdfbin0 -> 120534 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-greek.pdfbin0 -> 234442 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-greek.tex428
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-unicode-greek.pdfbin0 -> 43050 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-unicode-greek.tex258
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.pdfbin0 -> 43380 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.tex264
-rw-r--r--macros/latex/contrib/babel-contrib/greek/usage.pdfbin0 -> 176226 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/greek/usage.tex257
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/00readme.heb605
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/heb209.dtx165
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/heb209.pdfbin0 -> 152604 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebinp.dtx550
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebinp.pdfbin0 -> 199654 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebrew.dtx3329
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebrew.fdd1297
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebrew.ins215
-rw-r--r--macros/latex/contrib/babel-contrib/hebrew/hebrew.pdfbin0 -> 418939 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/hungarian/README18
-rw-r--r--macros/latex/contrib/babel-contrib/hungarian/magyar.ldf5901
-rw-r--r--macros/latex/contrib/babel-contrib/icelandic/README.md27
-rw-r--r--macros/latex/contrib/babel-contrib/icelandic/icelandic.dtx860
-rw-r--r--macros/latex/contrib/babel-contrib/icelandic/icelandic.ins149
-rw-r--r--macros/latex/contrib/babel-contrib/icelandic/icelandic.pdfbin0 -> 227745 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/indonesian/README11
-rw-r--r--macros/latex/contrib/babel-contrib/indonesian/indonesian.dtx290
-rw-r--r--macros/latex/contrib/babel-contrib/indonesian/indonesian.ins154
-rw-r--r--macros/latex/contrib/babel-contrib/indonesian/indonesian.pdfbin0 -> 113675 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/interlingua/interlingua.dtx207
-rw-r--r--macros/latex/contrib/babel-contrib/interlingua/interlingua.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/interlingua/interlingua.pdfbin0 -> 109614 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/irish/irish.dtx218
-rw-r--r--macros/latex/contrib/babel-contrib/irish/irish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/irish/irish.pdfbin0 -> 109823 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/italian/README.txt13
-rw-r--r--macros/latex/contrib/babel-contrib/italian/italian.dtx1468
-rw-r--r--macros/latex/contrib/babel-contrib/italian/italian.pdfbin0 -> 443357 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/Makefile32
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/README.md85
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/japanese-sample.pdfbin0 -> 44091 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/japanese.dtx590
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/japanese.ins49
-rw-r--r--macros/latex/contrib/babel-contrib/japanese/japanese.pdfbin0 -> 139680 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/kurmanji/kurmanji.dtx401
-rw-r--r--macros/latex/contrib/babel-contrib/kurmanji/kurmanji.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/kurmanji/kurmanji.pdfbin0 -> 124538 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.dtx828
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.ins95
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.pdfbin0 -> 155817 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/latvian/README.md21
-rw-r--r--macros/latex/contrib/babel-contrib/latvian/latvian.dtx459
-rw-r--r--macros/latex/contrib/babel-contrib/latvian/latvian.ins150
-rw-r--r--macros/latex/contrib/babel-contrib/latvian/latvian.pdfbin0 -> 267036 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/macedonian/README.md28
-rw-r--r--macros/latex/contrib/babel-contrib/macedonian/macedonian.dtx983
-rw-r--r--macros/latex/contrib/babel-contrib/macedonian/macedonian.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/macedonian/macedonian.pdfbin0 -> 206945 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/malay/README11
-rw-r--r--macros/latex/contrib/babel-contrib/malay/malay.dtx296
-rw-r--r--macros/latex/contrib/babel-contrib/malay/malay.ins154
-rw-r--r--macros/latex/contrib/babel-contrib/malay/malay.pdfbin0 -> 113760 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/norsk/norsk.dtx454
-rw-r--r--macros/latex/contrib/babel-contrib/norsk/norsk.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/norsk/norsk.pdfbin0 -> 142246 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/occitan/README24
-rw-r--r--macros/latex/contrib/babel-contrib/occitan/occitan.dtx701
-rw-r--r--macros/latex/contrib/babel-contrib/occitan/occitan.pdfbin0 -> 411076 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/piedmontese/piedmontese.dtx294
-rw-r--r--macros/latex/contrib/babel-contrib/piedmontese/piedmontese.pdfbin0 -> 105945 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/polish/polish.dtx563
-rw-r--r--macros/latex/contrib/babel-contrib/polish/polish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/polish/polish.pdfbin0 -> 134292 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/portuges/portuges.dtx475
-rw-r--r--macros/latex/contrib/babel-contrib/portuges/portuges.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/portuges/portuges.pdfbin0 -> 146040 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/romanian/romanian.dtx232
-rw-r--r--macros/latex/contrib/babel-contrib/romanian/romanian.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/romanian/romanian.pdfbin0 -> 112743 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/romansh/romansh.dtx206
-rw-r--r--macros/latex/contrib/babel-contrib/romansh/romansh.ldf48
-rw-r--r--macros/latex/contrib/babel-contrib/romansh/romansh.pdfbin0 -> 111436 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/russian/README269
-rw-r--r--macros/latex/contrib/babel-contrib/russian/russianb.dtx2235
-rw-r--r--macros/latex/contrib/babel-contrib/russian/russianb.ins166
-rw-r--r--macros/latex/contrib/babel-contrib/russian/russianb.ldf684
-rw-r--r--macros/latex/contrib/babel-contrib/russian/russianb.pdfbin0 -> 136621 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/samin/samin.dtx232
-rw-r--r--macros/latex/contrib/babel-contrib/samin/samin.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/samin/samin.pdfbin0 -> 124782 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/scottish/scottish.dtx209
-rw-r--r--macros/latex/contrib/babel-contrib/scottish/scottish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/scottish/scottish.pdfbin0 -> 113507 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/serbian/README.md31
-rw-r--r--macros/latex/contrib/babel-contrib/serbian/serbian.dtx407
-rw-r--r--macros/latex/contrib/babel-contrib/serbian/serbian.ins131
-rw-r--r--macros/latex/contrib/babel-contrib/serbian/serbian.pdfbin0 -> 247725 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/serbianc/README.md90
-rw-r--r--macros/latex/contrib/babel-contrib/serbianc/serbianc.dtx652
-rw-r--r--macros/latex/contrib/babel-contrib/serbianc/serbianc.ins134
-rw-r--r--macros/latex/contrib/babel-contrib/serbianc/serbianc.pdfbin0 -> 296755 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/slovak/slovak.dtx1310
-rw-r--r--macros/latex/contrib/babel-contrib/slovak/slovak.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/slovak/slovak.pdfbin0 -> 195853 bytes
l---------macros/latex/contrib/babel-contrib/slovene1
-rw-r--r--macros/latex/contrib/babel-contrib/slovenian/slovene.dtx302
-rw-r--r--macros/latex/contrib/babel-contrib/slovenian/slovene.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/slovenian/slovene.pdfbin0 -> 127434 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/sorbian/lsorbian.dtx265
-rw-r--r--macros/latex/contrib/babel-contrib/sorbian/lsorbian.pdfbin0 -> 124566 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/sorbian/sorbian.ins149
-rw-r--r--macros/latex/contrib/babel-contrib/sorbian/usorbian.dtx400
-rw-r--r--macros/latex/contrib/babel-contrib/sorbian/usorbian.pdfbin0 -> 132650 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/spanglish/README32
-rw-r--r--macros/latex/contrib/babel-contrib/spanglish/spanglish.ldf268
-rw-r--r--macros/latex/contrib/babel-contrib/spanglish/spanglish.sty55
-rw-r--r--macros/latex/contrib/babel-contrib/spanish/README.md62
-rw-r--r--macros/latex/contrib/babel-contrib/spanish/spanish.dtx2749
-rw-r--r--macros/latex/contrib/babel-contrib/spanish/spanish.ins100
-rw-r--r--macros/latex/contrib/babel-contrib/spanish/spanish.pdfbin0 -> 183261 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/swedish/swedish.dtx442
-rw-r--r--macros/latex/contrib/babel-contrib/swedish/swedish.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/swedish/swedish.pdfbin0 -> 130054 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/thai/lthenc.def157
-rw-r--r--macros/latex/contrib/babel-contrib/thai/thai.dtx914
-rw-r--r--macros/latex/contrib/babel-contrib/thai/thai.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/thai/thai.pdfbin0 -> 216258 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/thai/tis620.def108
-rw-r--r--macros/latex/contrib/babel-contrib/turkish/README.md23
-rw-r--r--macros/latex/contrib/babel-contrib/turkish/turkish.dtx446
-rw-r--r--macros/latex/contrib/babel-contrib/turkish/turkish.ins150
-rw-r--r--macros/latex/contrib/babel-contrib/turkish/turkish.pdfbin0 -> 297619 bytes
l---------macros/latex/contrib/babel-contrib/ukraineb1
-rw-r--r--macros/latex/contrib/babel-contrib/ukrainian/README.md205
-rw-r--r--macros/latex/contrib/babel-contrib/ukrainian/ukraineb.dtx1674
-rw-r--r--macros/latex/contrib/babel-contrib/ukrainian/ukraineb.ins169
-rw-r--r--macros/latex/contrib/babel-contrib/ukrainian/ukraineb.pdfbin0 -> 448707 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/vietnamese/README12
-rw-r--r--macros/latex/contrib/babel-contrib/vietnamese/vietnamese.dtx690
-rw-r--r--macros/latex/contrib/babel-contrib/vietnamese/vietnamese.ins132
-rw-r--r--macros/latex/contrib/babel-contrib/vietnamese/vietnamese.pdfbin0 -> 48084 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/welsh/README12
-rw-r--r--macros/latex/contrib/babel-contrib/welsh/welsh.dtx215
-rw-r--r--macros/latex/contrib/babel-contrib/welsh/welsh.ins148
-rw-r--r--macros/latex/contrib/babel-contrib/welsh/welsh.pdfbin0 -> 111128 bytes
228 files changed, 71810 insertions, 0 deletions
diff --git a/macros/latex/contrib/babel-contrib/albanian/albanian.dtx b/macros/latex/contrib/babel-contrib/albanian/albanian.dtx
new file mode 100644
index 0000000000..e1f0952ee1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/albanian/albanian.dtx
@@ -0,0 +1,302 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2007 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{251}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{albanian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{albanian}
+%\fi
+%\ProvidesFile{albanian.dtx}
+ [2007/10/20 v1.0c albanian support from the babel system]
+%\iffalse
+% Babel package for LaTeX version 2e
+% Copyright (C) 1989 - 2007
+% by Johannes Braams, TeXniek
+%
+% Please report errors to: J.L. Braams
+% babel at braamsdot xs4all dot nl
+%
+% This file is part of the babel system, it provides the source
+% code for the albanian language definition file. A contribution
+% was made by Adi Zaimi (adizaimi at yahoo.com).
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{albanian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{albanian.dtx}
+% \changes{albanian-1.0a}{2005/11/21}{Started first version of the file}
+% \changes{albanian-1.0b}{2005/12/10}{A number of corrections in the
+% translations from Adi Zaimi}
+% \changes{albanian-1.0c}{2006/06/05}{Small documentation fix}
+%
+% \section{The Albanian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate} defines all the language definition macros for the
+% Albanian language.
+%
+% Albanian is written in a latin script, but it has 36 letters,
+% 9 which are diletters (dh, gj, ll, nj, rr, sh, th, xh, zh),
+% and two extra special characters.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:albanian-quote} an overview is given of its
+% purpose.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"c| & |\"c|, also implemented for the uppercase \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% \verb="|= & disable ligature at this position \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for Albanian left double quotes (looks like ,,). \\
+% |"'| & for Albanian right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{albanian.ldf}}\label{tab:albanian-quote}
+% \end{center}
+% \end{table}
+%
+% Apart from defining shorthands we need to make sure that the
+% first paragraph of each section is intended. Furthermore the
+% following new math operators are defined (|\tg|, |\ctg|,
+% |\arctg|, |\arcctg|, |\sh|, |\ch|, |\th|, |\cth|, |\arsh|,
+% |\arch|, |\arth|, |\arcth|, |\Prob|, |\Expect|, |\Variance|).
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{albanian}\captionsalbanian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{albanian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@albanian| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@albanian\@undefined
+ \@nopatterns{Albanian}
+ \adddialect\l@albanian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Albanian language.
+%
+% \begin{macro}{\captionsalbanian}
+% The macro |\captionsalbanian| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\addto\captionsalbanian{%
+ \def\prefacename{Parathenia}%
+ \def\refname{Referencat}%
+ \def\abstractname{P\"ermbledhja}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Kapitulli}%
+ \def\appendixname{Shtesa}%
+ \def\contentsname{P\"ermbajta}%
+ \def\listfigurename{Figurat}%
+ \def\listtablename{Tabelat}%
+ \def\indexname{Indeksi}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Pjesa}%
+ \def\enclname{Lidhja}%
+ \def\ccname{Kopja}%
+ \def\headtoname{P\"er}%
+ \def\pagename{Faqe}%
+ \def\seename{shiko}%
+ \def\alsoname{shiko dhe}%
+ \def\proofname{V\"ertetim}%
+ \def\glossaryname{P\"erhasja e Fjal\"eve}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datealbanian}
+% The macro |\datealbanian| redefines the command |\today| to
+% produce Albanian dates.
+% \begin{macrocode}
+\def\datealbanian{%
+ \def\today{\number\day~\ifcase\month\or
+ Janar\or Shkurt\or Mars\or Prill\or Maj\or
+ Qershor\or Korrik\or Gusht\or Shtator\or Tetor\or N\"entor\or
+ Dhjetor\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasalbanian}
+% \begin{macro}{\noextrasalbanian}
+% The macro |\extrasalbanian| will perform all the extra
+% definitions needed for the Albanian language. The macro
+% |\noextrasalbanian| is used to cancel the actions of
+% |\extrasalbanian|.
+%
+% For Albanian the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the albanian group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasalbanian{\languageshorthands{albanian}}
+\addto\extrasalbanian{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \begin{macrocode}
+\addto\noextrasalbanian{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define shorthands to facilitate the occurence of letters
+% such as \v{c}.
+% \begin{macrocode}
+\declare@shorthand{albanian}{"c}{\textormath{\v c}{\check c}}
+\declare@shorthand{albanian}{"e}{\textormath{\v e}{\check e}}
+\declare@shorthand{albanian}{"C}{\textormath{\v C}{\check C}}
+\declare@shorthand{albanian}{"E}{\textormath{\v E}{\check E}}
+% \end{macrocode}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \begin{macrocode}
+\declare@shorthand{albanian}{"`}{%
+ \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
+\declare@shorthand{albanian}{"'}{%
+ \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
+\declare@shorthand{albanian}{"<}{%
+ \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
+\declare@shorthand{albanian}{">}{%
+ \textormath{\guillemotright{}}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{albanian}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{albanian}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{albanian}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bbl@frenchindent}
+% \begin{macro}{\bbl@nonfrenchindent}
+% In albanian the first paragraph of each section should be indented.
+% Add this code only in \LaTeX.
+% \begin{macrocode}
+\ifx\fmtname plain \else
+ \let\@aifORI\@afterindentfalse
+ \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+ \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
+ \addto\extrasalbanian{\bbl@frenchindent}
+ \addto\noextrasalbanian{\bbl@nonfrenchindent}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\mathalbanian}
+% Some math functions in Albanian math books have other names:
+% e.g. |sinh| in Albanian is written as |sh| etc. So we define a
+% number of new math operators.
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh
+\def\ch{\mathop{\operator@font ch}\nolimits} % same as \cosh
+\def\th{\mathop{\operator@font th}\nolimits} % same as \tanh
+\def\cth{\mathop{\operator@font cth}\nolimits} % same as \coth
+\def\arsh{\mathop{\operator@font arsh}\nolimits}
+\def\arch{\mathop{\operator@font arch}\nolimits}
+\def\arth{\mathop{\operator@font arth}\nolimits}
+\def\arcth{\mathop{\operator@font arcth}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits} % same as \tan
+\def\ctg{\mathop{\operator@font ctg}\nolimits} % same as \cot
+\def\arctg{\mathop{\operator@font arctg}\nolimits} % same as \arctan
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\def\Prob{\mathop{\mathsf P\hskip0pt}\nolimits}
+\def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits}
+\def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{albanian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+
diff --git a/macros/latex/contrib/babel-contrib/albanian/albanian.ins b/macros/latex/contrib/babel-contrib/albanian/albanian.ins
new file mode 100644
index 0000000000..07d34783ec
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/albanian/albanian.ins
@@ -0,0 +1,149 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2007 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2005/11/21}
+\def\batchfile{albanian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2007 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{albanian.ldf}{\from{albanian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
+
diff --git a/macros/latex/contrib/babel-contrib/albanian/albanian.pdf b/macros/latex/contrib/babel-contrib/albanian/albanian.pdf
new file mode 100644
index 0000000000..3c4743139b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/albanian/albanian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/azerbaijani/README b/macros/latex/contrib/babel-contrib/azerbaijani/README
new file mode 100644
index 0000000000..3ac7685dda
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/azerbaijani/README
@@ -0,0 +1,16 @@
+Azerbaijani 1.0a
+------------
+
+This is the babel style for Azerbaijani.
+
+This language poses special challenges because no "traditional" font
+encoding contains the full character set, and therefore a mixture must
+be used (eg, T2A and T1).
+
+It's compatible with Unicode engines (luatex, xetex), which are
+very likely the most convenient way to write Azerbaijani documents.
+
+The manual explains how to handle the fi ligature, too.
+
+----------
+2017-05-03 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.dtx b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.dtx
new file mode 100644
index 0000000000..d7d6272104
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.dtx
@@ -0,0 +1,314 @@
+% \iffalse meta-comment
+%
+% Copyright 2014-2017 Namig J. Guliyev and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainers of this work are Namig J. Guliyev
+% and Javier Bezos
+%
+% To report error: http://www.texnia.com/contact.html
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{azerbaijani.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{azerbaijani}
+%\fi
+%\ProvidesFile{azerbaijani.dtx}
+ [2017/05/03 v1.0a Azerbaijani support from the babel system] %^^A
+%\iffalse
+%% File `azerbaijani.dtx'
+%
+%% Azerbaijani Language Definition File
+%% Copyright (C) 2014-2017
+%% by Namig J. Guliyev
+%
+% This file is part of the babel system, it provides the source
+% code for the Azerbaijani language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T2A,T1]{fontenc}
+\title{The Azerbaijani style for babel}
+\author{Namig J. Guliyev, Javier Bezos}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\DeclareUnicodeCharacter{018F}{\Azerbaijanischwa}
+\DeclareUnicodeCharacter{0259}{\azerbaijanischwa}
+\DeclareTextCommand{\Azerbaijanischwa}{T1}{%
+ \UseTextSymbol{T2A}{\char154}}
+\DeclareTextCommand{\azerbaijanischwa}{T1}{%
+ \UseTextSymbol{T2A}{\char186}}
+\begin{document}
+ \maketitle
+ \DocInput{azerbaijani.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{azerbaijani.dtx}
+%
+% \section{The Azerbaijani language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Azerbaijani language.
+%
+% Typical usage with pdf\TeX{} is:
+%\begin{verbatim}
+%\usepackage[T2A,T1]{fontenc}
+%\usepackage[utf8]{inputenc}
+%\usepackage[azerbaijani]{babel}
+%\end{verbatim}
+%
+% Note you must load two encondings: |T1| as the main one for most
+% characters, and |T2A| for the schwa, which is not provided by any
+% Latin encoding. This mixture of encodings means hyphenation in
+% traditional engines will be only partial -- words containing the
+% schwa will not be hyphenated if the point comes near this letter.
+%
+% Thus, if proper handling of hyphenation is required, you must
+% switch to a Unicode engine, like Xe\TeX{} or Lua\TeX.
+%
+% This style doesn't handle the \textit{fi} ligature (yet). You can
+% break it by hand with |f{}i| or |f{\kern0pt}i|, but this can be
+% done automatically, too. With pdf\TeX{} and monolingual
+% documents, use \textsf{microtype}, as for example:
+%\begin{verbatim}
+%\usepackage{microtype}
+%\DisableLigatures[f]{encoding = *, family = *}
+%\end{verbatim}
+%
+% With Xe\TeX, ligatures are handled internally by the font, provided the
+% corresponding feature has been implemented (not all fonts do); e.~g.:
+%\begin{verbatim}
+%\usepackage{fontspec}
+%\setmainfont[Language=Azerbaijani]{Iwona}
+%\end{verbatim}
+%
+% With Lua\TeX{} you can use either method (remember with
+% \textsf{microtype} you may need also set |Renderer=Basic| when
+% defining a font with \textsf{fontspec}, at least at the time of
+% this writing). Alternative approachs with Lua\TeX{} are the
+% \textsf{setnolig} package and
+% \verb|fonts.handlers.otf.addfeature| from \textsf{luaotfload}
+% (not done here).
+%
+% \StopEventually{}
+%
+% \subsection*{The code}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{azerbaijani}\captionsazerbaijani
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{azerbaijani} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@azerbaijani| to see whether we have to do something here.
+%
+% \changes{azerbaijani-1.2c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@azerbaijani\@undefined
+ \@nopatterns{Azerbaijani}
+ \adddialect\l@azerbaijani0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Azerbaijani language.
+%
+% \begin{macro}{\captionsazerbaijani}
+% \begin{macro}{\dateazerbaijani}
+% The macro |\captionsazerbaijani| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackagewith{inputenc}{utf8}{%
+ \DeclareUnicodeCharacter{018F}{\Azerbaijanischwa}%
+ \DeclareUnicodeCharacter{0259}{\azerbaijanischwa}}%
+ {\@ifpackagewith{inputenc}{utf8x}{%
+ \DeclareUnicodeCharacter{399}{\Azerbaijanischwa}%
+ \DeclareUnicodeCharacter{601}{\azerbaijanischwa}}{}}}
+\StartBabelCommands*{azerbaijani}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \SetString\prefacename{Ön söz}
+ \SetString\refname{Ədəbiyyat}
+ \SetString\abstractname{Annotasiya}
+ \SetString\bibname{Ədəbiyyat}
+ \SetString\chaptername{Fəsil}
+ \SetString\appendixname{Əlavə}
+ \SetString\contentsname{Mündəricat}
+ \SetString\listfigurename{Şəkillərin siyahısı}
+ \SetString\listtablename{Cədvəllərin siyahısı}
+ \SetString\indexname{Mövzu göstəricisi}
+ \SetString\figurename{Şəkil}
+ \SetString\tablename{Cədvəl}
+ \SetString\partname{Hissə}
+ \SetString\enclname{encl}
+ \SetString\ccname{cc}
+ \SetString\headtoname{To}
+ \SetString\pagename{səh.}
+ \SetString\seename{baxın}
+ \SetString\alsoname{həmçinin baxın}
+ \SetString\proofname{İsbatı}
+ \SetString\glossaryname{Terminlər lüğəti}
+ \SetCase[\azerbaijanischwa\Azerbaijanischwa]
+ {\uccode`i=`İ\relax
+ \uccode`ı=`I\relax}
+ {\lccode`İ=`i\relax
+ \lccode`I=`ı\relax}
+ \SetHyphenMap{%
+ \BabelLower{`İ}{`i}%
+ \BabelLower{`I}{`ı}}
+ \AfterBabelCommands{%
+ \DeclareTextCommandDefault{\Azerbaijanischwa}{Ə}%
+ \DeclareTextCommandDefault{\azerbaijanischwa}{ə}}
+\StartBabelCommands*{azerbaijani}{}[generic, fontenc=T1]
+ \AfterBabelCommands{%
+ \@ifundefined{T@T1}%
+ {\PackageWarning{azerbaijani}%
+ {The font encoding T1 has not been loaded. Expect errors\MessageBreak
+ and wrong hyphenations}}
+ {\@ifundefined{T@T2C}{}{\gdef\aze@cyrenc{T2C}}%
+ \@ifundefined{T@T2B}{}{\gdef\aze@cyrenc{T2B}}%
+ \@ifundefined{T@T2A}{}{\gdef\aze@cyrenc{T2A}}%
+ \@ifundefined{T@X2}{}{\gdef\aze@cyrenc{X2}}%
+ \ifx\aze@cyrenc\@undefined
+ \PackageError{azerbaijani}%
+ {No font containing the schwa has been detected.\MessageBreak
+ Please, load a Cyrillic encoding (T2A, T2B, T2C, X2)}%
+ {See the manual for further details.}%
+ \else
+ \AtBeginDocument{%
+ \DeclareTextCommand{\Azerbaijanischwa}{T1}{%
+ \UseTextSymbol{\aze@cyrenc}{\char154}\bbl@allowhyphens}
+ \DeclareTextCommand{\azerbaijanischwa}{T1}{%
+ \UseTextSymbol{\aze@cyrenc}{\char186}\bbl@allowhyphens}}%
+ \fi}}
+\StartBabelCommands*{azerbaijani}{captions}
+ \SetString\prefacename{\"{O}n s\"{o}z}
+ \SetString\refname{{\Azerbaijanischwa}d{\azerbaijanischwa}biyyat}
+ \SetString\abstractname{Annotasiya}
+ \SetString\bibname{{\Azerbaijanischwa}d{\azerbaijanischwa}biyyat}
+ \SetString\chaptername{F{\azerbaijanischwa}sil}
+ \SetString\appendixname{{\Azerbaijanischwa}lav{\azerbaijanischwa}}
+ \SetString\contentsname{M\"{u}nd{\azerbaijanischwa}ricat}
+ \SetString\listfigurename{%
+ \c{S}{\azerbaijanischwa}kill{\azerbaijanischwa}rin siyah{\i}s{\i}}
+ \SetString\listtablename{%
+ C{\azerbaijanischwa}dv{\azerbaijanischwa}ll{\azerbaijanischwa}rin
+ siyah{\i}s{\i}}
+ \SetString\indexname{M\"{o}vzu g\"{o}st{\azerbaijanischwa}ricisi}
+ \SetString\figurename{\c{S}{\azerbaijanischwa}kil}
+ \SetString\tablename{C{\azerbaijanischwa}dv{\azerbaijanischwa}l}
+ \SetString\partname{Hiss{\azerbaijanischwa}}
+ \SetString\enclname{encl}
+ \SetString\ccname{cc}
+ \SetString\headtoname{To}
+ \SetString\pagename{s{\azerbaijanischwa}h.}
+ \SetString\seename{bax{\i}n}
+ \SetString\alsoname{h{\azerbaijanischwa}m\c{c}inin bax{\i}n}
+ \SetString\proofname{\.{I}sbat{\i}}
+ \SetString\glossaryname{Terminl{\azerbaijanischwa}r l\"{u}\u{g}əti}
+ \SetCase[\azerbaijanischwa\Azerbaijanischwa]
+ {\uccode`i="9D\relax
+ \uccode"19=`I\relax}
+ {\lccode"9D=`i\relax
+ \lccode`I="19\relax}
+ \SetHyphenMap{%
+ \BabelLower{"9D}{`i}
+ \BabelLower{`I}{"19}}
+\StartBabelCommands*{azerbaijani}{date}
+ \SetStringLoop{month#1name}{%
+ yanvar,fevral,mart,aprel,may,iyun,iyul,%
+ avqust,sentyabr,oktyabr,noyabr,dekabr}
+ \SetString\today{%
+ \number\day~\@nameuse{month\romannumeral\month name}%
+ \space\number\year}
+\EndBabelCommands
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\extrasazerbaijani}
+% \begin{macro}{\noextrasazerbaijani}
+% The macro |\extrasazerbaijani| will perform all the extra definitions
+% needed for the Azerbaijani language. The macro |\noextrasazerbaijani| is
+% used to cancel the actions of |\extrasazerbaijani|.
+%
+% We specify that the azerbaijani group of shorthands should be used.
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\providehyphenmins{azerbaijani}{\tw@\tw@}
+\initiate@active@char{"}
+\declare@shorthand{azerbaijani}{"-}{\bbl@hy@soft}
+\declare@shorthand{azerbaijani}{"=}{\bbl@hy@hard}
+\addto\extrasazerbaijani{%
+ \bbl@activate{"}%
+ \languageshorthands{azerbaijani}%
+ \bbl@frenchspacing}
+\addto\noextrasazerbaijani{%
+ \bbl@deactivate{"}%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}|.
+% \begin{macrocode}
+\ldf@finish{azerbaijani}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.ins b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.ins
new file mode 100644
index 0000000000..76575d550d
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.ins
@@ -0,0 +1,128 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2014-2017 Namig J. Guliyev and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainers of this work are Namig J. Guliyev and
+%% Javier Bezos
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2017/05/03}
+\def\batchfile{azerbaijani.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2014-2017 Namig J. Guliyev and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainers of this work are Namig J. Guliyev and
+ Javier Bezos
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2014-2017 Namig J. Guliyev and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainers of this work are Namig J. Guliyev and
+ Javier Bezos
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel-azerbaijani}
+
+\usepreamble\mainpreamble
+\generate{\file{azerbaijani.ldf}{\from{azerbaijani.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.pdf b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.pdf
new file mode 100644
index 0000000000..9d1d1f78ae
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/basque/basque.dtx b/macros/latex/contrib/babel-contrib/basque/basque.dtx
new file mode 100644
index 0000000000..33789ccdfd
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/basque/basque.dtx
@@ -0,0 +1,390 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{193}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{basque.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{basque}
+%\fi
+%\ProvidesFile{basque.dtx}
+ [2005/03/29 v1.0f Basque support from the babel system]
+%\iffalse
+%% File `Basque.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Basque Language Definition File
+%% Copyright (C) 1997 - 2005
+%% by Juan M. Aguirregabiria
+% The University of the Basque Country
+% Dept. of Theoretical Physics
+% Apdo. 644
+% E-48080 Bilbao
+% Spain
+% tel: +34 946 012 593
+% fax: +34 944 648 500
+% e-mail: wtpagagj at lg.ehu.es
+% WWW: http://tp.lc.ehu.es/jma.html
+% based on the
+% Spanish Language Definition File
+% Copyright (C) 1991 - 1998
+% by Julio Sanchez
+% GMV, SA
+% c/ Isaac Newton 11
+% PTM - Tres Cantos
+% E-28760 Madrid
+% Spain
+% tel: +34 1 807 21 85
+% fax +34 1 807 21 99
+% jsanchez at gmv.es
+%
+% Acknowledgements: I am indebted to Zunbeltz Izaola,
+% who suggested the use of \discretionary in "-
+%
+%% Please report errors to: Juan M. Aguirregabiria <wtpagagj at lg.ehu.es>
+%% (or J.L. Braams <babel at braams.cistron.nl>)
+%
+% This file is part of the babel system, it provides the source
+% code for the basque language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{basque.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{basque.dtx}
+%
+% \section{The Basque language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Juan M. Aguirregabiria,
+% (\texttt{wtpagagj@lg.ehu.es}) and is based on the Spanish file
+% by Julio S\'anchez,
+% (\texttt{jsanchez@gmv.es}).} defines all the language definition
+% macro's for the Basque language.
+%
+% For this language the characters |~| and |"| are made
+% active. In table~\ref{tab:basque-quote} an overview is given of
+% their purpose.
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |~n| & a n with tilde. Works for uppercase too.
+% \end{tabular}
+% \caption{The extra definitions made by \file{basque.ldf}}
+% \label{tab:basque-quote}
+% \end{table}
+% These active accent characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table.
+%
+% \changes{basque-1.0f}{2002/01/07}{Changed url's for the patterns
+% file}
+% This option includes support for working with extended, 8-bit
+% fonts, if available. Support is based on
+% providing an appropriate definition for the accent macros on
+% entry to the Basque language. This is automatically done by
+% \LaTeXe\ or NFSS2. If T1 encoding is chosen, and provided that
+% adequate hyphenation patterns\footnote{One source for such
+% patterns is the archive at \texttt{tp.lc.ehu.es} that can be
+% accessed by anonymous FTP or in
+% \texttt{http://tp.lc.ehu.es/jma/basque.html}} are available.
+% The easiest way to use the new encoding with \LaTeXe{} is
+% to load the package \texttt{t1enc} with |\usepackage|. This must
+% be done before loading \babel.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{basque}\captionsbasque
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{basque} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@basque| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@basque\@undefined
+ \@nopatterns{Basque}
+ \adddialect\l@basque0
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Basque language.
+%
+% \begin{macro}{\captionsbasque}
+% The macro |\captionsbasque| defines all strings used in
+% the four standard documentclasses provided with \LaTeX.
+% \changes{basque-1.0e}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{basque-1.0f}{2002/01/07}{Added translation for Glossary}
+% \begin{macrocode}
+\addto\captionsbasque{%
+ \def\prefacename{Hitzaurrea}%
+ \def\refname{Erreferentziak}%
+ \def\abstractname{Laburpena}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Kapitulua}%
+ \def\appendixname{Eranskina}%
+ \def\contentsname{Gaien Aurkibidea}%
+ \def\listfigurename{Irudien Zerrenda}%
+ \def\listtablename{Taulen Zerrenda}%
+ \def\indexname{Kontzeptuen Aurkibidea}%
+ \def\figurename{Irudia}%
+ \def\tablename{Taula}%
+ \def\partname{Atala}%
+ \def\enclname{Erantsia}%
+ \def\ccname{Kopia}%
+ \def\headtoname{Nori}%
+ \def\pagename{Orria}%
+ \def\seename{Ikusi}%
+ \def\alsoname{Ikusi, halaber}%
+ \def\proofname{Frogapena}%
+ \def\glossaryname{Glosarioa}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebasque}
+% The macro |\datebasque| redefines the command |\today| to
+% produce Basque
+% \changes{basque-1.0b}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{basque-1.0b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{basque-1.0c}{1999/11/22}{fixed typo in April's name}
+% \begin{macrocode}
+\def\datebasque{%
+ \def\today{\number\year.eko\space\ifcase\month\or
+ urtarrilaren\or otsailaren\or martxoaren\or apirilaren\or
+ maiatzaren\or ekainaren\or uztailaren\or abuztuaren\or
+ irailaren\or urriaren\or azaroaren\or
+ abenduaren\fi~\number\day}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasbasque}
+% \begin{macro}{\noextrasbasque}
+% The macro |\extrasbasque| will perform all the extra definitions
+% needed for the Basque language. The macro |\noextrasbasque| is
+% used to cancel the actions of |\extrasbasque|. For Basque, some
+% characters are made active or are redefined. In particular, the
+% \texttt{"} character and the |~| character receive new
+% meanings. Therefore these characters have to be treated as
+% `special' characters.
+%
+% \begin{macrocode}
+\addto\extrasbasque{\languageshorthands{basque}}
+\initiate@active@char{"}
+\initiate@active@char{~}
+\addto\extrasbasque{%
+ \bbl@activate{"}%
+ \bbl@activate{~}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{basque-1.0d}{1999/12/16}{Deactivate shorthands ouside of
+% Basque}
+% \begin{macrocode}
+\addto\noextrasbasque{
+ \bbl@deactivate{"}\bbl@deactivate{~}}
+% \end{macrocode}
+%
+% Apart from the active characters some other macros get a new
+% definition. Therefore we store the current one to be able to
+% restore them later.
+% \begin{macrocode}
+\addto\extrasbasque{%
+ \babel@save\"%
+ \babel@save\~%
+ \def\"{\protect\@umlaut}%
+ \def\~{\protect\@tilde}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\basquehyphenmins}
+% Basque hyphenation uses |\lefthyphenmin| and |\righthyphenmin|
+% both set to~2.
+% \changes{basque-1.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dieresia}
+% \begin{macro}{\texttilde}
+% The original definition of |\"| is stored as |\dieresia|, because
+% the we do not know what is its definition, since it depends on
+% the encoding we are using or on special macros that the user
+% might have loaded. The expansion of the macro might use the \TeX\
+% |\accent| primitive using some particular accent that the font
+% provides or might check if a combined accent exists in the font.
+% These two cases happen with respectively OT1 and T1 encodings.
+% For this reason we save the definition of |\"| and use that in
+% the definition of other macros. We do likewise for |\'| and
+% |\~|. The present coding of this option file is incorrect in that
+% it can break when the encoding changes. We do not use
+% |\tilde| as the macro name because it is already defined as
+% |\mathaccent|.
+% \begin{macrocode}
+\let\dieresia\"
+\let\texttilde\~
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@umlaut}
+% \begin{macro}{\@tilde}
+% We check the encoding and if not using T1, we make the accents
+% expand but enabling hyphenation beyond the accent. If this is the
+% case, not all break positions will be found in words that contain
+% accents, but this is a limitation in \TeX. An unsolved problem
+% here is that the encoding can change at any time. The definitions
+% below are made in such a way that a change between two 256-char
+% encodings are supported, but changes between a 128-char and a
+% 256-char encoding are not properly supported. We check if T1 is
+% in use. If not, we will give a warning and proceed redefining the
+% accent macros so that \TeX{} at least finds the breaks that are
+% not too close to the accent. The warning will only be printed to
+% the log file.
+% \begin{macrocode}
+\ifx\DeclareFontShape\@undefined
+ \wlog{Warning: You are using an old LaTeX}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
+ \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
+\else
+ \edef\bbl@next{T1}
+ \ifx\f@encoding\bbl@next
+ \let\@umlaut\dieresia
+ \let\@tilde\texttilde
+ \else
+ \wlog{Warning: You are using encoding \f@encoding\space
+ instead of T1.}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
+ \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Now we can define our shorthands: the french quotes,
+% \changes{basque-1.0b}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{basque}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{basque}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% ordinals\footnote{The code for the ordinals was taken from the
+% answer provided by Raymond Chen
+% (\texttt{raymond@math.berkeley.edu}) to a question by Joseph Gil
+% (\texttt{yogi@cs.ubc.ca}) in \texttt{comp.text.tex}.},
+% \begin{macrocode}
+ \declare@shorthand{basque}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+% \end{macrocode}
+% tildes,
+% \begin{macrocode}
+\declare@shorthand{basque}{~n}{\textormath{\~n}{\@tilde n}}
+\declare@shorthand{basque}{~N}{\textormath{\~N}{\@tilde N}}
+% \end{macrocode}
+% and some additional commands.
+%
+% The shorthand |"-| should be used in places where a word contains
+% an explictit hyphenation character. According to the Academy of
+% the Basque language, when a word break occurs at an explicit
+% hyphen it must appear \emph{both} at the end of the first line
+% \emph{and} at the beginning of the second line.
+% \changes{changes-1.0f}{2002/01/07}{The hyphen char needs to appear
+% at the beginning of the line as well.}
+% \begin{macrocode}
+\declare@shorthand{basque}{"-}{%
+ \nobreak\discretionary{-}{-}{-}\bbl@allowhyphens}
+\declare@shorthand{basque}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{basque}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/basque/basque.ins b/macros/latex/contrib/babel-contrib/basque/basque.ins
new file mode 100644
index 0000000000..ccebb561ba
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/basque/basque.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{basque.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{basque.ldf}{\from{basque.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/basque/basque.pdf b/macros/latex/contrib/babel-contrib/basque/basque.pdf
new file mode 100644
index 0000000000..700b78e014
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/basque/basque.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/belarusian/README.md b/macros/latex/contrib/babel-contrib/belarusian/README.md
new file mode 100644
index 0000000000..1900f49e18
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/belarusian/README.md
@@ -0,0 +1,127 @@
+Belarusian language module for Babel, v1.5
+==========================================
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Belarusian
+(in both official and ‘classic’ forms). The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+Based on Russian language module v1.3h by Igor A. Kotelnikov <kia999 at mail dot ru>
+and Belarusian language module v1.1l by Aleksey Novodvorsky <aen@logic.ru>.
+
+The current maintainer is Andrej Shadura <andrew@shadura.me>.
+
+Installation
+------------
+
+- unpack babel-belarusian.zip
+- run `xelatex belarusian.dtx` (recommended)
+ or `pdflatex belarusian.dtx`;
+ run `tex belarusian.dtx`
+ or `tex belarusian.ins`, if you don’t need documentation
+- move "belarusian.ldf" to ${texmf}/tex/generic/babel/contrib/
+- move "belarusian.pdf" and README to ${texmf}/doc/latex/belarusian-babel/
+- update filename base (see documentation for your TeX system)
+
+Usage
+-----
+
+Belarusian language definition file can be used both with legacy 8-bit engines
+(such as latex or pdflatex) and Unicode compilers (xelatex or lualatex).
+The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+### 8-bit mode
+
+#### PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,belarusian]{babel}
+
+#### LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,belarusian]{babel}
+
+#### XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,belarusian]{babel}
+
+### Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,belarusian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may use any True Type or Open Type fonts installed on your computer.
+
+### Using "classic" (Taraškievič) spelling
+
+ \usepackage[english,belarusian]{babel}
+ \languageattribute{belarusian}{classic}
+
+or
+
+ \usepackage[english,belarusian.classic]{babel}
+
+or
+
+ \usepackage[english,belarusian]{babel}
+ \languageattribute{belarusian}{tarask}
+
+or
+
+ \usepackage[english,belarusian.tarask]{babel}
+
+Documentation
+-------------
+
+See belarusian.pdf for more information.
+
+Known problems
+--------------
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+Changes
+-------
+
+2018-10-09 version 1.5
+
+ * Replace \cyrmath with \textnormal.
+ Patch by Ivan Kokan.
+
+2018-08-25 version 1.4
+
+ * Rename belarusianb.dtx to belarusian.dtx since the patch to Babel
+ has been never submitted.
+ * Use textcomp package in the documentation.
+ * Formatting fixes.
+ * Convert the README to Markdown.
+ * Rename the Unicode detection macro to fix conflicts with babel-russian.
+
+2016-04-07 version 1.3h
+
+ * Initial version
+
+Original source: russianb.dtx
+
+2016-02-18 v1.3h Russian support from the babel system.
diff --git a/macros/latex/contrib/babel-contrib/belarusian/belarusian.dtx b/macros/latex/contrib/babel-contrib/belarusian/belarusian.dtx
new file mode 100644
index 0000000000..e28046e723
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/belarusian/belarusian.dtx
@@ -0,0 +1,1992 @@
+% \iffalse meta-comment
+% !TEX program = xeLaTeX
+% !Mode:: TEX:DTX:UNIX:UTF-8:US:RU
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+Belarusian language module for Babel, v1.5
+==========================================
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Belarusian
+(in both official and ‘classic’ forms). The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+Based on Russian language module v1.3h by Igor A. Kotelnikov <kia999 at mail dot ru>
+and Belarusian language module v1.1l by Aleksey Novodvorsky <aen@logic.ru>.
+
+The current maintainer is Andrej Shadura <andrew@shadura.me>.
+
+
+Installation
+------------
+
+- unpack babel-belarusian.zip
+- run `xelatex belarusian.dtx` (recommended)
+ or `pdflatex belarusian.dtx`;
+ run `tex belarusian.dtx`
+ or `tex belarusian.ins`, if you don’t need documentation
+- move "belarusian.ldf" to ${texmf}/tex/generic/babel/contrib/
+- move "belarusian.pdf" and README to ${texmf}/doc/latex/belarusian-babel/
+- update filename base (see documentation for your TeX system)
+
+
+Usage
+-----
+
+Belarusian language definition file can be used both with legacy 8-bit engines
+(such as latex or pdflatex) and Unicode compilers (xelatex or lualatex).
+The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+### 8-bit mode
+
+#### PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,belarusian]{babel}
+
+#### LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,belarusian]{babel}
+
+#### XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,belarusian]{babel}
+
+### Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,belarusian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may use any True Type or Open Type fonts installed on your computer.
+
+### Using "classic" (Taraškievič) spelling
+
+ \usepackage[english,belarusian]{babel}
+ \languageattribute{belarusian}{classic}
+
+or
+
+ \usepackage[english,belarusian.classic]{babel}
+
+or
+
+ \usepackage[english,belarusian]{babel}
+ \languageattribute{belarusian}{tarask}
+
+or
+
+ \usepackage[english,belarusian.tarask]{babel}
+
+Documentation
+-------------
+
+See belarusian.pdf for more information.
+
+
+Known problems
+--------------
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+
+Changes
+-------
+
+2018-10-09 version 1.5
+
+ * Replace \cyrmath with \textnormal.
+ Patch by Ivan Kokan.
+
+2018-08-25 version 1.4
+
+ * Rename belarusianb.dtx to belarusian.dtx since the patch to Babel
+ has been never submitted.
+ * Use textcomp package in the documentation.
+ * Formatting fixes.
+ * Convert the README to Markdown.
+ * Rename the Unicode detection macro to fix conflicts with babel-russian.
+
+2016-04-07 version 1.3h
+
+ * Initial version
+
+Original source: russianb.dtx
+
+2016-02-18 v1.3h Russian support from the babel system.
+%</readme>
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+Belarusian Language Support for the Babel package
+E-mail: andrew@shadura.me
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+\endpreamble
+\postamble
+----------------------------------------------------------------
+Copyright 2016, 2018 Andrej Shadura
+Copyright 2011-2016 Igor A. Kotelnikov.
+Copyright 2000 Aleksey Novodvorsky
+Copyright 1995-2008 Olga Lapko.
+Copyright 1989-2012 Johannes L. Braams.
+
+This file is a part of the Belarusian-Babel package.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+The package is "maintained" (as per LPPL maintenance status) by
+Andrej Shadura.
+
+The package consists of the file belarusian.dtx
+and the derived files belarusian.ins,
+ belarusian.ldf,
+ belarusian.pdf,
+ README.md
+----------------------------------------------------------------
+\endpostamble
+\usedir{tex/generic/babel/contrib}
+\generate{
+ \file{\jobname.ldf}{\from{\jobname.dtx}{code}}
+}
+%</install>
+%<install>\endbatchfile
+%<*internal>
+\usedir{source/latex/babel-belarusian}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+\usedir{doc/latex/babel-belarusian}
+\generate{
+ \file{README.md}{\from{\jobname.dtx}{readme}}
+}
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+%<*code>
+\NeedsTeXFormat{LaTeX2e}
+%\ProvidesFile{belarusian.ldf}[2018/10/09 1.5 Belarusian support for the Babel system]
+\ProvidesLanguage{belarusian}[2018/10/09 1.5 Belarusian support for the Babel system]
+%</code>
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+%%
+%% This document should be compiled by
+%% XeLaTeX or LuaLaTex since some cyrillic
+%% glyphs are absent in T2* encodings used
+%% by LaTeX.
+%%
+\usepackage{ifxetex,ifluatex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ %\setmonofont[Scale=MatchLowercase]{Courier New}
+ %\setmonofont[Scale=MatchUppercase]{Courier New}
+ %\setmonofont{Courier New}
+\else
+ \usepackage[X2,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+\fi
+\usepackage{textcomp}
+\usepackage[belarusian.classic,main=english]{babel}
+%\languageattribute{belarusian}{classic}
+\usepackage[dvipsnames,usenames]{xcolor}
+ \definecolor{thered} {rgb}{0.65,0.04,0.07}
+ \definecolor{thegreen}{rgb}{0.06,0.44,0.08}
+ \definecolor{thegrey} {gray}{0.8}
+ \definecolor{theshade}{rgb}{1,1,0.97}
+ \definecolor{theframe}{gray}{0.6}
+ \definecolor{theblue}{cmyk}{1.00, 0.50, 0.00, 0.40}
+%\usepackage[numbered]{hypdoc}
+\usepackage[colorlinks=true
+ ,linkcolor=violet %theblue %
+ ,filecolor=purple %thegreen%
+ ,citecolor=teal %thegreen%
+]{hyperref}
+% ====================================
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\xetex{\textsf{xetex}}
+\newcommand*\luatex{\textsf{luatex}}
+\providecommand*\m[1]{\mbox{$\langle$\normalfont\itshape#1\/$\rangle$}}
+\newcommand*\langlist{%
+ \meta{language}\texttt{,}\meta{language}\texttt{,}...}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\menv[1]{\char`\{#1\char`\}}
+\newcommand*\Eenv[1]{%
+ \quad\ldots\quad
+ \texttt{\color{thered}\string\end\menv{#1}}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+% ====================================
+\IfFileExists{listings.sty}{
+ \usepackage{listings}
+ \lstset{
+ gobble=1,
+ columns=flexible,
+ keepspaces,
+ basicstyle=\MacroFont,
+ keywords=[0]{\selectlanguage,\foreignlanguage
+ ,\babelhyphen,\babelhyphenation
+ ,\lefthyphenmin,\righthyphenmin
+ ,\StartBabelCommands,\SetString,\EndBabelCommands,\shorthandoff,\shorthandon
+ ,\languageshorthands,\useshorthands,\defineshorthand
+ ,\AddBabelHook,\SetStringLoop,\SetCase,\AfterBabelLanguage
+ ,\defaultfontfeatures,\setmainfont,\setsansfont,\setmonofont
+ ,\Belarusian,\cyrdash,\cdash
+ ,\cyr,\cyrillictext,\textcyrillic,\cyrillicencoding
+ ,\addto,\captionsbelarusian,\datebelarusian,\noextrasbelarusian,\extrasbelarusian
+ ,\languageattribute
+ ,\Asbuk,\asbuk,\ch,\sh,\tg,\ctg,\arctg,\arcctg\,\th,\cth,\cosec
+ ,\nod,\nok,\prog,\NOF\,\NOK,\Prog
+ ,\dq,\Proj,\nad,\NAD,\nak,\NAK,\Prob,\Variance
+ ,\nod,\NOD,\nok,\NOK
+ ,\XeTeXinputencoding
+ }
+ ,keywordstyle=[0]\color{thered}
+ ,keywords=[1]{main,belarusian,english,german,frenchb
+ ,shorthands,extrasenglish
+ ,stringprocess,afterextras
+ ,soft,empty,nobreak,hard
+ ,Renderer,Ligatures
+ ,official,classic,tarask
+ ,T1,T2A,lutf8,utf8
+ ,fontspec,babel,inputenc,fontenc
+ },
+ keywordstyle=[1]\color{thegreen},
+ comment=[l]\%,
+ commentstyle=\color{thegrey}\itshape,
+ alsoother={0123456789_},
+ frame=single,
+ backgroundcolor=\color{theshade},
+ rulecolor=\color{theframe},
+ framerule=\fboxrule,
+ }
+ \let\verbatim\relax
+ \lstnewenvironment{verbatim}[1][]{\lstset{##1}}{}
+ \AtBeginDocument{%
+ \DeleteShortVerb{\|}%
+ \lstMakeShortInline|%
+ }
+}{}
+\def\PrintDescribeMacro#1{%
+ \strut\MacroFont\color{thered}\normalsize\string#1}
+\def\Describe#1{%
+ \par\penalty-500\vskip3ex\noindent
+ \DescribeMacro{#1}\args}
+\def\DescribeOther{\vskip-5.8ex\Describe}
+\makeatletter
+\def\args#1{%
+ \def\bbl@tempa{#1}%
+ \ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
+\makeatother
+% ====================================
+\EnableCrossrefs
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\CodelineIndex % Index code by line number
+\RecordChanges % Gather update information
+%\PageIndex % Index code by page number
+% ====================================
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%\GetFileInfo{belarusian.dtx}
+%\GetFileInfo{belarusian.ldf}
+%
+%\title{^^A
+% \textsf{Belarusian} --- description text\thanks{^^A
+% This file describes version \fileversion, last revised \filedate.^^A
+% }^^A
+%}
+%\author{^^A
+% You\thanks{E-mail: you@your.domain}^^A
+%}
+% \title{The Belarusian Language\\
+% in the \babel\ system\\[0.5em]
+% \large Version \fileversion}
+%
+% \author{Andrej Shadura\footnote{E-mail: \href{mailto:andrew@shadura.me}{andrew@shadura.me}.}}
+%
+% \date{Released \filedate}
+%
+% \maketitle
+%
+% {\small\tableofcontents}
+%
+%
+% \section{The Belarusian Language Definition File}
+%
+% The file \file{\filename}\footnote{The file described in this document
+% has the version number \fileversion\ and was last revised on \filedate.}
+% is the source file for the Belarusian Language Definition file
+% \file{belarusian.ldf} to be loaded by the \babel\ package with
+% the option \Lopt{belarusian}. It's based on the Russian language definition
+% file derived by Igor A. Kotelnikov from the original version of \file{\filename}, first
+% released by Olga Lapko and Johannes Braams and then
+% adapted to the T2* and X2 Cyrillic encodings
+% by Vladimir Volovich and Werner Lemberg, and the Belarusian language definition
+% file written by Aleksey Novodvorsky based on even older version of the Russian
+% language definition file.
+%
+% Just like \file{russianb.ldf}, \file{belarusian.ldf} is designed to work both with
+% legacy non-unicode (8-bit) and new Unicode encodings of the source document
+% files (input encodings) and of the font files (font encodings). This is
+% achieved by excluding (bypassing) the |\cyr...| macros, which map every letter
+% in a source file with given input encoding to a corresponding code point in a
+% font file with a given font encoding when running modern engines, such as
+% Lua\LaTeX\ or Xe\LaTeX, in native Unicode mode instead of legacy engines, such
+% as \LaTeX\ or PDF\LaTeX, or Unicode engines in a compatibility (8-bit) mode. A
+% few obsolete and controversial macros has been eliminated in first public
+% release of version 1.2 of \file{russianb.ldf}.
+%
+% Similarly to \file{russianb.ldf}'s support for typesetting ancient and
+% Church Slavonic books, \file{belarusian.ldf} supports two versions of Belarusian
+% orthography, the official one (\Lopt{official}) and the ‘classic’ (Taraškievič)
+% orthography.
+%
+% \section{Usage}
+%
+% Typesetting Belarusian texts implies that a special input and output
+% encodings should be used. Input encodings are those which are used in source
+% (\file{.tex}) file. Output encoding is also known as the font encoding. It is
+% implemented within the font files.
+%
+% Generally, the user may choose between different available Cyrillic
+% encodings. The current support for Cyrillic uses LH family of MetaFont fonts
+% and theirs Postscript versions such as CM-super. Lua\LaTeX\ and Xe\LaTeX,
+% being the Unicode-based succeeders of \LaTeX, allow also for any Open Type
+% (OTF) and True Type (TTF) fonts which has Cyrillic script, e.g. Computer
+% Modern Unicode, Linux Libertine, and many other system fonts that came with
+% Linux, Mac and Windows operating systems.
+%
+% With the advent of Unicode, \LaTeX\ community are moving towards eliminating
+% all existing encodings in favor of Unicode, but nowadays one should take
+% care when switching from \LaTeX\ to Lua\LaTeX\ or Xe\LaTeX\ since
+% different packages should be loaded for those compilers.
+%
+% Since earlier versions \pkg{babel} did not
+% support Xe\LaTeX\ (at least for some languages including Belarusian), the
+% \pkg{polyglossia} package was generally recommended in the past for
+% use with Xe\LaTeX\ as a replacement for \pkg{babel}. Nowadays, \pkg{babel}
+% can be used with any engines, including \LaTeX, PDF\LaTeX, Lua\LaTeX, and
+% Xe\LaTeX. Nevertheless some troubles may occur with some languages which
+% have no promptly updated \file{.ldf} files.
+%
+%
+% \subsection{\LaTeX}
+%
+% When user's document is compiled with \file{latex} or \file{pdflatex},
+% recommended set of packages includes the \pkg{inputenc} and \pkg{fontenc}
+% packages. They should be loaded before \pkg{babel}, for example,
+% \begin{verbatim}
+% \usepackage[T1,T2A]{fontenc}
+% \usepackage[utf8]{inputenc}
+% \usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% Some variations in the order of loading the packages are allowed in this case
+% but it is better to follow one and the same convention at all circumstances:
+% the \pkg{babel} package should go last, and \pkg{fontenc} must be the first.
+%
+% Input encoding should be declared as option to the \pkg{inputenc}
+% package. Known Cyrillic encodings include
+% \texttt{cp1251} (Windows), \texttt{koi8-u} (UNIX) and their variants.
+% Nowadays, this list is appended with \texttt{utf8} input encoding.
+%
+% Output encodings (also known as font encodings) are declared as options to
+% the \pkg{fontenc} package. Known Cyrillic encodings are \texttt{T2A},
+% \texttt{T2B}, \texttt{T2C}, \texttt{LCY}, and \texttt{X2};
+% \texttt{LWN} is not supported since \texttt{LWN} has been excluded
+% from the \pkg{cyrillic} bundle of related files.
+%
+%
+% \subsection{Lua\LaTeX}
+%
+% If Unicode fonts are not available, Lua\LaTeX\ can run in compatibility
+% (8-bit) mode to use same font as \LaTeX\ does. However the package
+% \pkg{inputenc} does not work with Lua\LaTeX\ and should be substituted with
+% \pkg{luainputenc}. Source file is to be converted to \texttt{UTF8}
+% (Unicode-8) encoding; it is the only input encoding accepted by
+% Lua\LaTeX. The 8-bit mode is invoked by the following sequence of packages:
+%\begin{verbatim}
+%\usepackage[T1,T2A]{fontenc}
+%\usepackage[lutf8]{luainputenc}
+%\usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% The order of the packages is crucial for Lua\LaTeX\ in 8-bit mode. Since both
+% \pkg{luainputenc} and \pkg{babel} should know what is a selected font encoding,
+% the \pkg{fontenc} package should be loaded first. Input encoding management for
+% Lua\TeX\ is needed only for compatibility with old documents. For new
+% documents, using UTF-8 encoding and Unicode fonts is strongly recommended.
+% \emph{You've been warned!} See
+% \href{http://tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}%
+% {tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}.
+%
+%
+% To invoke Unicode mode, one needs to load the \pkg{fontspec} package instead
+% of \pkg{luainputenc} and \pkg{fontspec} and explicitly indicate which True Type
+% or Open Type fonts should be used for romanic, sans-serif and monospaced types.
+% The following example shows how to load Computer Modern Unicode (CMU) fonts,
+% which is a part of all modern \LaTeX\ distributions:
+%\begin{verbatim}
+%\usepackage{fontspec}
+% \defaultfontfeatures{Renderer=Basic,Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+%\usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% The |\defaultfontfeatures| declares default font features for subsequent
+% |\setmainfont| (which sets romanic fonts), |\setsansfont| (sans-serif) and
+% |\setmonofont| (monospaced font). Font features can be set up on per font
+% bases; for example
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \setmainfont[Renderer=Basic,Ligatures={TeX}]{CMU Serif}
+% \setsansfont[Renderer=Basic,Ligatures={TeX,Historic}]{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% Here |Renderer=Basic,Ligatures={TeX}| activates ligatures which are existed
+% in \LaTeX.
+%
+% Recall that the language enlisted last in the list of options of the \pkg{babel}
+% package is assumed to be the main language of the document, which is also active
+% language right after |\begin{document}|. As of version 3.9, the main language
+% can be set as a value of the |main| option as follows
+%\begin{verbatim}
+% \usepackage{fontspec}
+% \usepackage[english,main=belarusian,german]{babel}
+%\end{verbatim}
+% %\unskip
+%
+%
+%
+% \subsection{Xe\LaTeX}
+%
+% In Xe\LaTeX, there is also a special mode for 8-bit compatibility.
+% One can use |\XeTeXinputencoding| to change the input encoding
+% temporarily, and the \texttt{"bytes"} encoding makes Xe\LaTeX\ works
+% like a 8-bit \LaTeX\ engine:
+% \begin{verbatim}
+% \XeTeXinputencoding "bytes"
+% \usepackage[utf8]{inputenc}
+% \usepackage[T2A]{fontenc}
+% \usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% \unskip
+% Xe\TeX\ can use a different input encoding but it always uses the Unicode
+% internally, so that |\XeTeXinputencoding| performs a conversion of the input
+% into Unicode;
+% see \href{http://tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}
+% {tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}.
+%
+%
+% Unicode mode is set up same way as for Lua\LaTeX, however the option
+% |Renderer=Basic| can be dropped:
+%\begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,belarusian]{babel}
+%\end{verbatim}
+% %\unskip
+%
+%
+% \subsection{Official and ‘classic’ spelling}
+% \label{ssec:spelling}
+%
+% By default, the official spelling is enabled. The ‘classic’ (Taraškievič)
+% spelling can be enabled by setting the attribute to \Lopt{classic} or
+% \Lopt{tarask}. To set an attribute, put the |\languageattribute| macro
+% within a document preamble after \babel, for example,
+%\begin{verbatim}
+% \usepackage[english,belarusian]{babel}
+% \languageattribute{belarusian}{classic}
+%\end{verbatim}
+% Setting the \Lopt{classic} attribute changes the built-in strings (caption names)
+% and a date format. For example, the references list will be entitled as
+% `\textcyrillic{Спіс літаратуры}' by default and as `\textcyrillic{Сьпіс літаратуры}' if the
+% Belarusian language attribute is set to \Lopt{classic}.
+% The same result can be achieved using a modifier as follows:
+%\begin{verbatim}
+%\usepackage[english,belarusian.classic]{babel}
+%\end{verbatim}
+% Using a modifier in a package option is often better. A modifier is set after
+% the language name, and is prefixed with a dot (only when the language is set
+% as package option, neither global options nor the main key accept them).
+%
+% Both attributes \Lopt{classic} and \Lopt{tarask} may be used interchangeably.
+%
+%\section{User's commands}
+%
+% In a multilingual document, some typographic rules are language
+% dependent and should apply to the whole document.
+%
+%^^AAs of version~1.2, \file{belarusian.ldf} behaves differently
+%^^Aaccording to \babel's \emph{main language} defined as the \emph{last}
+%^^Aoption. When Belarusian is
+%^^A|babel|'s main language, it adjusts global layout of the document
+%^^Aaccording to typographical conventions of Belarusian language. Namely,
+%^^A\file{belarusian.ldf} makes the following changes to global layout even
+%^^Ain the parts where Belarusian is not current language:
+%^^A\begin{enumerate}
+%^^A\item
+%^^A the first paragraph of any section becomes indented (\LaTeX{} only).
+%^^A (this is obsolete statement starting from version 1.2a)
+%^^A\end{enumerate}
+%
+% Regarding local typography, the macro |\selectlanguage{belarusian}|
+% switches to the Belarusian language, with the following effects:
+% \begin{enumerate}
+% \item Belarusian hyphenation patterns are made active;
+% \item |\today| prints the date in Belarusian;
+% \item the caption names are translated into Belarusian
+% (\LaTeX{} only);
+% \item emdash typed by the ligature |---| might be 20\% shorter when Belarusian
+% is the current language; the result depends on the current encoding; |---|
+% always produce long emdash in Lua\TeX\ and Xe\TeX\ since these engines
+% use same encodings for all languages;
+% \item emdash typed by the ligature |"---| in Belarusian is 20\% shorter, however
+% the ligature |"---| might not be defined in other languges; a
+% shorter emdash (i.e. |\cyrdash|) can be typeset in any language using
+% special macros enlisted in table \ref{tab:belarusian-quote}.
+% \end{enumerate}
+%
+% By default, the official spelling is used for built-it strings (caption names) and
+% the date. The spelling can be reverted to the classic one by setting the language
+% attribute to \Lopt{classic} in the document preamble as discussed in
+% Sec.~\ref{ssec:spelling}.
+%
+% Since Belarusian has its own numbering system, \file{belarusian.ldf} adds macros
+% |\asbuk|\marg{counter} and |\Asbuk|\marg{counter} for formatting numbers appropriately the alphabetic
+% sequence in the Belarusian alphabet. Additional commands are provided
+% to typeset quotes:
+% \begin{enumerate}
+% \item French quotation marks can be entered using the commands
+% |\guillemotleft| and |\guillemotright| which work in \LaTeXe\
+% and Plain\TeX.
+% \item German quotation marks can be entered using the commands
+% |\glqq| and |\grqq| which work in \LaTeXe\ and Plain\TeX.
+% \end{enumerate}
+%
+% The macro |\Belarusian| is now defined as an alias for
+% |\selectlanguage{belarusian}|, and its ``opponent'' |\English|, existed
+% in \file{belarusian.ldf} prior to version 1.2 has been removed since the Belarusian
+% language definition file is wrong place for definition of macros which
+% switch to a distinct other language.
+%
+% The macro |\textcyrillic|\marg{text} is intended to typeset small chunks of text
+% in Belarusian; it is essentially an alias for |\foreignlanguage{belarusian}|\marg{text}.
+%
+%
+% \subsection{Active character}
+%
+% Table~\ref{tab:belarusian-quote} shows macros and active string which can be
+% used to typeset various dashes and quotes.
+% In the Belarusian language, the character |"| is made active. It can be
+% considered as second escape character in addition to |\|. Some dashes and
+% all quotes can be typed using both active character |"| and ordinary
+% macros as indicated in the table. However, some shorthanded hyphenations
+% have no macro counterpart.
+%
+% \begin{table}[ht]\centering
+% \caption{Extra definitions made
+% by \file{belarusian.ldf}}\label{tab:belarusian-quote}
+% \medskip
+% \begin{tabular}{llp{7cm}}
+% \hline\hline\\[-0.5em]
+% |\glqq| & |"`| &
+% German opening double quote (looks like ,\kern-0.08em,). \\
+% |\grqq| & |"'| &
+% German closing double quote (looks like ``). \\
+% |\guillemotleft| & |"<| &
+% French opening double quote (looks like $<\!\!<$). \\
+% |\guillemotright| & |">| &
+% French closing double quote (looks like $>\!\!>$). \\
+% |\dq| & &
+% Original quotes character (|"|). \\[0.5em]
+% |\babelhyphen{soft}|
+% & |"-| & Optional (soft) hyphen sign, similar to |\-| but allows
+% hyphenation in the rest of the word;
+% equivalent to |\babelhyphen{soft}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{empty}|
+% & |""| & Similar to |"-| but prints no hyphen sign
+% (used for compound words with hyphen, e.g. |x-""y|);
+% equivalent to |\babelhyphen{empty}| in \pkg{babel} 3.9. \\
+% |\babelhyphen*{nobreak}|
+% & |"~| & Compound word mark without a breakpoint, prints hyphen
+% prohibiting hyphenation at the point;
+% equivalent to |\babelhyphen*{nobreak}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{hard}|
+% & |"=| & A compound word mark with a breakpoint, prints hyphen
+% allowing hyphenation in the composing words.
+% equivalent to |\babelhyphen{hard}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{nobreak}|
+% & \verb="|= & Disables ligature at this position;
+% equivalent to |\babelhyphen{nobreak}| (??) in \pkg{babel} 3.9.
+% \\[0.5em]
+% |\cyrdash| & & Row Cyrillic emdash (does not care
+% spaces around). \\
+% |\cdash---| & |"---| &
+% Cyrillic emdash in plain text. \\
+% |\cdash--~| & |"--~| &
+% Cyrillic emdash in compound names
+% (as in |Mendeleev"--~Klapeiron|). \\
+% |\cdash--*| & |"--*| &
+% Cyrillic emdash for denoting direct speech. \\
+% & |",| & Thin space
+% (allows further hyphenation as in |D.",Mendeleev|). \\[0.5em]
+% \hline\hline
+% \end{tabular}
+% \end{table}
+% Note that the standard soft hyphen |\-| is equivalent to |\babelhyphen*{soft}|.
+%
+% \medskip
+%
+% The quotation marks traditionally used in Belarusian were borrowed from
+% other languages (e.g., French and German) so they keep their original
+% names.
+%
+% The French quotes are also available as ligatures `|<<|' and `|>>|' in
+% 8-bit Cyrillic font encodings (\texttt{LCY}, \texttt{X2}, \texttt{T2*})
+% and in Unicode encodings (\texttt{EU1} and \texttt{EU2})
+% and as `|<|' and `|>|' characters in 7-bit Cyrillic font encodings
+% (\texttt{OT2} and \texttt{LWN}).
+%
+% In Unicode encodings \texttt{EU1} and \texttt{EU2} cyrdashes and quotes
+% can be typed as single character if text editor makes it possible to
+% insert characters which absent of standard keyboard. This method works
+% as well for 8-bit fonts encoded according to \texttt{T2A} if source file
+% is encoded with \texttt{cp1251} or {utf8}.
+%
+% By default, active double quote is switched on. It can be switched off
+% any time using |\shorthandoff{"}| and the switched on again using
+% |\shorthandon{"}|. The aliases |\mdqoff| and |\mdqon| for these two macros
+% has been removed from \file{belarusian.ldf} starting from version 1.3 in favour of
+% the macros |\shorthandon| and |\shorthandoff| provided in the \pkg{babel} core.
+%
+%
+% \subsection{Math commands}
+%
+% \file{\filename} defines few macros than can be used independently
+% of current language. These are 9 macros to be used in math mode to type
+% the names of trigonometric functions common for Belarusian documents:
+% |\sh|, |\ch|, |\tg|, |\ctg|, |\arctg|, |\arcctg|, |\th|, |\cth|, and
+% |\cosec|. Cyrillic letters in math mode can be typed with the aid of
+% text commands such as |\textbf|, |\textsf|, |\textit|, |\texttt|, e.t.c.
+%
+% The macros |\Prob|, |\Variance|, |\NAD|, |\nad|, |\NAK|, |\nak|, |\Proj|
+% print some rare Belarusian mathematical symbols.
+%
+%
+% \section{\TeX{}nical details}
+%
+% The packages \pkg{inputenc} and \pkg{luainputenc}
+% make Cyrillic letters active so that a compiler converts them into
+% corresponding |\cyr...| macro at compilation time.
+% For example, Belarusian letter `a' matches
+% macro |\cyra|, and capital Belarusian letter `A' matches |\CYRA|. The
+% package \pkg{fontenc} then matches every macro |\cyr...| to corresponding
+% glyph in a font file depending on a declared font encoding.
+%
+% Nowadays, Unicode makes |\cyr...| macros outdated since both source
+% file and font file are encoded consistently. These macros
+% should therefore be removed because mixing them with Unicode characters
+% breaks sorting mechanism of such utilities as \file{bibtex} and
+% \file{makeindex}. For the sake of backward compatibility, |\cyr...| are
+% still kept for \LaTeX, but they are bypassed if Lua\LaTeX\ or Xe\LaTeX\
+% are detected.
+%
+% Some inconsistences of prior versions of \file{\filename} was also
+% overcame in the version 1.2. Those users who used |\selectlanguage| macro,
+% defined in the core \pkg{babel} system, to switch between
+% different languages should not worry. However, the macros
+% |\Belarusian|, |\Englsih| and their aliases |\Rus|, |\cyr|,
+% |\Eng| are modified or removed as they did not
+% conform the mechanism of language switching encoded into the
+% core of \pkg{babel} and therefore can mess it.
+%
+%
+% \section{Known problems}
+%
+% Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+% engine (xetex, luatex) and vise versa delete all |.aux|, |.toc|, |.lot|,
+% |.lof| files as they might have stored incompatible internal encodings.
+%
+% \cs{cyrdash} might produce dashes of different width in same document after
+% switching to/from Belarusian language if the document is compiled with legacy
+% engines.
+%
+% \section{History}
+%
+%\StopEventually{^^A
+% \setlength{\postmulticols}{100pt} % 20pt by default
+% \PrintChanges
+% \PrintIndex
+%}
+%
+%\iffalse
+%<*code>
+%\fi
+%
+%
+% \section{Implementation}
+%
+% \changes{1.3e}{2014/10/14}{Update documentation}
+% \changes{1.3d}{2014/10/02}{Fix bug in \cs{Proj}}
+% \changes{1.3c}{2014/06/02}{Fix bug in \cs{datebelarusian}}
+% \changes{1.3b}{2013/04/06}{Renamed to belarusian to work with babel 3.9}
+% \changes{1.2b}{2013/01/08}{Renamed to belarusianu to work with babel-beta 3.9}
+% \changes{1.2a}{2012/06/06}{Indentation of 1st paragraph removed}
+% \changes{1.1c}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{1.1d}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{1.1k}{1999/08/19}{replaced all \cs{penalty}\cs{@M}
+% with \cs{nobreak}}
+% \changes{1.1f}{1998/06/26}{%
+% Added definitions of Cyrillic emdash stuff and thinspace}
+% \changes{1.1f}{1998/06/26}{%
+% Added definitions of Cyrillic emdash stuff and thinspace}
+%
+%
+% \subsection{Initial setup}
+%
+% The macro |\LdfInit| performs a couple of standard checks that
+% must be made at the beginning of a language definition file,
+% such as checking the category code of the \texttt{@}-sign, preventing
+% the \file{.ldf} file from being processed twice, etc.
+%
+% \changes{1.1d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{1.1e}{1996/12/29}{Added closing brace to second
+% argument of \cs{LdfInit}}
+% \begin{macrocode}
+\LdfInit{belarusian}{captionsbelarusian}
+% \end{macrocode}
+%
+% First, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If so, we set
+% boolean key |\if@uni@ode@be| to true. It will be used to eliminate |\cyr...|
+% commands, which were introduced in \LaTeX2e\ to handle various
+% Cyrillic input encoding. With the advent of Unicode \LaTeX\ is
+% moving to universal input encoding, so we consider these |\cyr...|
+% commands as obsolete. They are preserved though for backward
+% compatibility in case if \LaTeX\ or PDF\LaTeX\ are running.
+%
+% We don't load the \pkg{ifluatex} or \pkg{ifxetex} package because
+% |\RequirePackage| is not allowed at the stage of processing options
+% (note that babel loads this file right when it processes its own options)
+% but we borrow code from these packages.
+%
+% \changes{1.2}{2011/10/20}{Check for LuaTeX}
+% \begin{macrocode}
+\ifdefined\if@uni@ode@be
+ \PackageError{babel}{if@uni@ode already defined.\MessageBreak
+ Please contact author of belarusian.ldf}
+ \relax
+\fi
+\newif\if@uni@ode@be
+\ifdefined\luatexversion \@uni@ode@betrue \else
+\ifdefined\XeTeXrevision \@uni@ode@betrue \fi\fi
+% \end{macrocode}
+%
+% Check if hyphenation patterns for the Belarusian language have been
+% loaded in \file{language.dat}. Namely, we check for the existence of
+% |\l@belarusian|. If it is not defined, we declare Belarusian as dialect
+% for the default language number 0 which almost for sure is English.
+%
+% \begin{macrocode}
+\ifx\l@belarusian\@undefined
+ \@nopatterns{Belarusian}
+ \adddialect\l@belarusian0
+\fi
+% \end{macrocode}
+% Now |\l@belarusian| is always defined.
+%
+% \subsection{Output encoding}
+%
+% We need to know font encoding that is supposed to be
+% active at the end of the \babel\ package. Default font encoding, set by
+% \LaTeX\ core, is \texttt{OT1}. This can be changed by the \pkg{fontenc}
+% package in case of \LaTeX\ and by \pkg{fontspec} package in case of
+% Lua\LaTeX. It matters weather these packages are loaded before of after
+% \pkg{babel}. In the latter case or if these packages are not loaded at all,
+% \file{belarusian.ldf} ignores their effect and tries to provide some
+% reasonable settings. In particular, \texttt{T2A} will be selected for
+% Belarusian language if \LaTeX\ is running but \texttt{EU1} in case of
+% Xe\LaTeX\ and \texttt{EU2} in case of Lua\LaTeX.
+%
+% \begin{macro}{\latinencoding}
+% \changes{1.2}{2011/10/20}{Removed \cs{latinencoding}}
+%
+% The macro |\latinencoding| keeps the name of Latin encoding. It is
+% defined in \file{babel.def} and is wrapped into |\AtBeginDocument| to allow
+% for late loading \pkg{fontenc}. Therefore it does not matter
+% whether \pkg{babel} is loaded before or after the \pkg{fontenc}.
+% As of version 1.2, definition of |\latinencoding| was removed from
+% \file{belarusian.ldf} since it is overruled in \file{babel.def}.
+% For example, after
+%\begin{verbatim}
+%\usepackage[T1,T2A]{fontenc}
+%\usepackage[english,belarusian]{babel}
+%\end{verbatim}%
+% as well as after
+%\begin{verbatim}
+%\usepackage[english,belarusian]{babel}
+%\usepackage[T1,T2A]{fontenc}
+%\end{verbatim}%
+% |\latinencoding| will be set to \texttt{T1}.
+% After
+%\begin{verbatim}
+%\usepackage[english,belarusian]{babel}
+%\end{verbatim}%
+% |\latinencoding| will be \texttt{OT1}.
+%
+% In Unicode mode, the package \pkg{fontspec} should be loaded instead of
+% \pkg{fontenc} to make font preparation; \pkg{fontspec} loads the package
+% \pkg{xunicode} which sets current encoding (kept in |\cf@encoding|) to
+% \texttt{EU1} for Xe\LaTeX\ and \texttt{EU2} for Lua\LaTeX, and the \pkg{babel}
+% package sets the macro |\latinencoding| to |\cf@encoding|. Since \pkg{babel} scan
+% for value |\cf@encoding| within |\AtBeginDocument|, |\latinencoding| will
+% be set to either \texttt{EU1} for Xe\LaTeX\ or \texttt{EU2} for Lua\LaTeX\
+% no matter which of the packages, \pkg{babel} or \pkg{fontspec} is loaded first.
+%
+% \end{macro}
+%
+% \Describe\cyrillicencoding{}
+% There is a limited list of encodings appropriate for Cyrillic text. We
+% will look which of them is declared and keep its name in the macro
+% |\cyrillicencoding|.
+% Correct (but obsolete and now deleted) 7-bit Cyrillic encoding is
+% \texttt{LWN}.
+% Correct 8-bit Cyrillic encodings are
+% \texttt{T2A} (default for 8-bit compilers), \texttt{T2B}, \texttt{T2C},
+% \texttt{LCY} and \texttt{X2}.
+% Correct utf8 encodings are
+% \texttt{EU1} (default for Xe\LaTeX),
+% \texttt{EU2} (default for Lua\LaTeX).
+%
+% In 8-bit (\LaTeX) mode, user may choose between different non-unicode Cyrillic
+% encodings---e.g., \texttt{X2} or \texttt{LCY}.\@ If user wants
+% to use another font encoding rather than default (\texttt{T2A}),
+% he has to load the corresponding file \emph{before} \file{babel.sty}.
+%
+% Remember that for the Belarusian language, the \texttt{T2A} encoding is
+% better than \texttt{X2}, because \texttt{X2} does not contain Latin
+% letters, and users should be very careful to switch the language
+% every time they want to typeset a Latin word inside a Belarusian phrase
+% or vice versa.
+%
+%
+% We parse the |\cdp@list| containing encodings known to \LaTeX\
+% in the order they were loaded by the time when \pkg{babel} is loaded.
+% We set the |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2}, \texttt{LCY},
+% \texttt{X2}, \texttt{T2C}, \texttt{T2B}, \texttt{T2A}. In Unicode mode
+% we also try the Unicode encodings \texttt{EU1} and \texttt{EU2}; 8-bit
+% encodings are kept for Unicode compilers (Lua\LaTeX\ and Xe\LaTeX) since
+% they can run in compatibility (8-bit) mode.
+%
+% \changes{1.2}{2011/10/20}{EU1 and EU2 encodings added}
+% \begin{macrocode}
+\def\@setcyrillicencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\cyrillicencoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{OT2}%
+ \sce@a{##1}{LCY}%
+ \sce@a{##1}{X2}%
+ \sce@a{##1}{T2C}%
+ \sce@a{##1}{T2B}%
+ \sce@a{##1}{T2A}%
+ \if@uni@ode@be
+ \sce@a{##1}{EU1}%
+ \sce@a{##1}{EU2}%
+ \fi}%
+ \cdp@list
+}
+\@setcyrillicencoding
+\@onlypreamble\@setcyrillicencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+% \end{macrocode}
+% The last lines are to free the memory occupied by the macros
+% |\@setcyrillicencoding| and |\sce@x| that are useless in the document.
+% The contents of |\@begindocumenthook| is cleared automatically.
+%
+% If |\cyrillicencoding| is still undefined, we issue warning and provide
+% reasonable default value for |\cyrillicencoding|. We then load default
+% encoding definitions; we use the lowercase names (i.e.,
+% \texttt{lcyenc.def} instead of \texttt{LCYenc.def}) when we do that.
+%
+% \changes{1.2}{2011/10/20}{Removed test for present of
+% encoding files}
+% \begin{macrocode}
+\ifdefined\cyrillicencoding
+\else
+ \if@uni@ode@be
+ \ifdefined\XeTeXrevision
+ \edef\cyrillicencoding{EU1}
+ \else\ifdefined\luatexversion
+ \edef\cyrillicencoding{EU2}
+ \fi\fi
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{babel}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+% \end{macrocode}
+% As final wisdom, we repeat |\@setcyrillicencoding| at |\begin{document}|
+% time. We could not avoid previous call to |\@setcyrillicencoding| since
+% compiler scan \file{.aux} file before it executes delayed code, and
+% \file{.aux} may contain |\set@langauge{belarusian}|; the latter rises an
+% error if |\cyrillicencoding| would not be defined by that time.
+% \begin{macrocode}
+ \AtBeginDocument{\@setcyrillicencoding}
+\fi
+% \end{macrocode}
+%
+% \Describe\Belarusian{}
+% \DescribeOther\cyr{}
+% \DescribeOther\cyrillictext{}
+% For the sake of backward compatibility we keep the macro |\Belarusian|
+% but redefine its meaning; now |\Belarusian| is simply an alias for
+% |\selectlanguage{belarusian}|.
+%
+% We define |\cyrillictext| and its alias |\cyr| but remove another alias
+% |\Rus|; these macros are intended for use within \texttt{babel} macros and
+% do not perform complete switch of the language.
+% In particular, they to do no switch captions and the name of current
+% language stored in the macro |\languagename|. This inconsistency might
+% break some assumptions embedded into \pkg{babel}'s.
+% For example, the |\iflanguage| macro will fail.
+%
+% Second, |\cyrillictext| does
+% not activate shorthands, so that |"<|, |">|, |"`|, |"'|,
+% |"---|, e.t.c. will not work.
+%
+% And third, |\cyrillictext| does not write its trace
+% to \file{.aux} file, which might result in wrong typesetting of
+% table of content, list of table and list of figures in multilingual
+% documents.
+%
+% Due to any of these reasons the use of the declaration |\cyrillictext| and
+% its aliases in ordinary text is strongly discouraged. Instead of the
+% declaration |\cyrillictext| it is recommended to use |\Belarusian| or the
+% command |\foreignlanguage| defined in the \pkg{babel} core; their
+% functionality is similar to |\selectlanguage{belarusian}| but they did not
+% switch caption names, dates and shorthands.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Belarusian}{\selectlanguage{\belarusian}}
+\DeclareRobustCommand{\cyrillictext}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\belarusianhyphenmins
+ \language\l@belarusian}%
+\let\cyr\cyrillictext
+% \end{macrocode}
+%
+% Starting from version v.1.2 we remove the |\English| macro and its
+% aliases. We believe that reasonable place for defining these macros
+% would be \file{englishb.ldf}.
+% Note also that the macro |\English| and its alias |\Eng| are absent
+% in \file{belarusian.ldf}'s counterpart in the package \pkg{polyglossia},
+% analog of \pkg{babel} for Xe\LaTeX.
+%
+% \changes{1.2}{2011/10/20}{Removed \cs{English} macro}
+% \begin{macrocode}
+%%\DeclareRobustCommand{\English}{%
+%% \fontencoding\latinencoding\selectfont
+%% \let\encodingdefault\latinencoding
+%% \expandafter\set@hyphenmins\englishhyphenmins
+%% \language\l@english}%
+%%\let\Eng\English
+% \end{macrocode}
+%
+% \textsc{Next part of code should be moved to \texttt{X2enc.def},
+% \texttt{X2enc.dfu}, if needed.}
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding dependent
+% in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are defined as |\r{A}| and
+% |\r{a}|. This leads to unpredictable results when the font encoding
+% does not contain the Latin letters `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+\fi
+% \end{macrocode}
+%
+%
+% The macro |\cyrillictext| switches current (e.g., Latin) font encoding
+% to a Cyrillic font encoding stored in |\cyrillicencoding|. The macro
+% |\latintext| switches back. This method assumes that an font
+% encoding is a Latin one. But in fact the latter assumption does not matter
+% if any other language is switched on using same method, i.e.
+% if corresponding \file{.ldf} file defines required macros to switch that
+% language on from same standard (Latin) state.
+% Since |\latintext| is defined by the core of babel we do not repeat its
+% definition here.
+%
+% \changes{1.1o}{2003/10/12}{\cs{latintext} is already
+% defined by the core of babel}
+% \changes{1.2}{2011/10/20}{\cs{lat} removed}
+% \begin{macrocode}
+%\DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+%\let\lat\latintext
+% \end{macrocode}
+%
+% \Describe\textcyrillic{\marg{text}}
+% The macros |\cyrillictext| and |\latintext| are declarations.
+% For shorter chunks of text the commands |\textcyrillic| and |\textlatin|
+% can be used.
+%
+% The macro |\textcyrillic| takes an argument which is then typeset using the
+% requested font encoding. It is thus an equivalent or
+% |\foreignlangauge{belarusian}|.
+% \changes{1.1o}{2003/10/12}{\cs{textlatin} already defined
+% by the core of babel}
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \end{macrocode}
+%
+%
+% \subsection{Input encoding}
+%
+% User should use the \pkg{inputenc} package when any 8-bit Cyrillic
+% font encoding is used, selecting one of the Cyrillic input encodings.
+% We do not assume any default input encoding, so
+% the \pkg{inputenc} package should be explicitly called by
+% |\usepackage{inputenc}| \emph{before} \pkg{babel}.
+% Note however that default font encoding \texttt{T2A} fits
+% well enough to Belarusian version of Windows ANSI encoding which is almost
+% equivalent to \texttt{cp1251}.
+%
+% \textsc{Should we wrap this chunk into At Begin document?}
+%
+% \changes{1.1l}{1999/08/27}{Made not using inputenc a
+% warning instead of an error}
+% \changes{1.2}{2011/10/11}{Added EU1 and EU2 encodings}
+% \changes{1.2}{2011/10/11}{Removed LWN encoding}
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{%
+ \if@uni@ode@be
+ \PackageWarning{babel}{inputenc should not be used with LuaTeX or XeTeX}
+ \fi
+}{%
+ %\def\reserved@a{LWN}%
+ %\ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{OT2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{EU1}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{EU2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \PackageWarning{babel}%
+ {No input encoding specified for Belarusian language}
+ \fi\fi\fi
+ %\fi
+}
+% \end{macrocode}
+%
+%
+% \subsection{Shorthands}
+%
+% The double quote character \texttt{"} is declared to be active in
+% Belarusian language.
+%
+% \changes{1.1a}{1995/03/07}{Use the new mechanism for dealing
+% with active characters}
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% \changes{1.1f}{1998/06/26}{Added switch for
+% doublequote shorthands}
+% \changes{1.3}{2013/01/10}{Removed switch for
+% doublequote shorthands}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% Obsolete: Active double quote can be both activated and deactivated at any time
+% using the macros |\mdqon| and |\mdqoff|.
+% \begin{macrocode}
+%\def\mdqon{\bbl@activate{"}}
+%\def\mdqoff{\bbl@deactivate{"}}
+% \end{macrocode}
+% Initial activation state will set to on later in section \ref{sss:extra}.
+% \end{macro}
+% \end{macro}
+%
+% \Describe\dq{}
+% The active character |"| is used as indicated in
+% table~\ref{tab:belarusian-quote}. We save the original double quote
+% character in the |\dq| macro to keep it available.
+% The math accent |\"| can now be typed as `|"|'.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \subsubsection{Quotes}
+%
+% We set |"`| and |"'| as shorthands for |\quotedblbase| and
+% |\textquotedblleft|, respectively. Prior to ver.1.2, these shorthands
+% were defined through german quotes |\glqq| and |\grqq|, which in their turn
+% are defined in \pkg{babel.def} via |\quotedblbase| and |\textquotedblleft|,
+% respectively. It occurred, that old definition caused errors in Unicode
+% mode if \pkg{fontspec} is loaded.
+%
+% Prior to version 1.2, the shorthands |"<| and |">| were
+% declared to be equivalents for the French quotes |\flqq| and |\frqq|,
+% respectively. They are defined in \pkg{babel.def} via |\guillemotleft| and
+% |\guillemotrigh|. However, |\flqq| and |\guillemotleft| (and their right
+% counterparts) are typeset differently if current encoding is not
+% \texttt{T1}. Therefore, since v.1.2, we define |"<| and |">| directly
+% through |\guillemotleft| and |\guillemotrigh|.
+%
+% \begin{macrocode}
+\declare@shorthand{belarusian}{"`}{\quotedblbase}
+\declare@shorthand{belarusian}{"'}{\textquotedblleft}
+\declare@shorthand{belarusian}{"<}{\guillemotleft}
+\declare@shorthand{belarusian}{">}{\guillemotright}
+% \end{macrocode}
+%
+% Next set of shorthands is intended for variations of standard macro |\-|
+% which indicates explicitly breakpoint for hyphenation in a word. Meaning
+% of these shorthands is explained in table~\ref{tab:belarusian-quote}.
+%
+% \begin{macrocode}
+\declare@shorthand{belarusian}{""}{\hskip\z@skip}
+\declare@shorthand{belarusian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{belarusian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{belarusian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+% \end{macrocode}
+%
+% \subsubsection{Emdash, endash and hyphenation sign}
+%
+% To distinguish between |"-| and |"---| we must check whether the next
+% after |-| token is a hyphen character.
+% If it is, we output an emdash, otherwise a hyphen sign. Therefor
+% \TeX\ looks for the next token after the first `|-|', writes
+% its meaning to |\belarusian@sh@next| and finally call for |\belarusian@sh@tmp|.
+%
+% \begin{macrocode}
+\declare@shorthand{belarusian}{"-}{%
+ \def\belarusian@sh@tmp{%
+ \if\belarusian@sh@next-\expandafter\belarusian@sh@emdash
+ \else\expandafter\belarusian@sh@hyphen\fi}%
+ \futurelet\belarusian@sh@next\belarusian@sh@tmp}
+% \end{macrocode}
+% Two macros |\belarusian@sh@hyphen| and |\belarusian@sh@emdash| called by
+% |\belarusian@sh@tmp| are defined below. The second of
+% them has two parameters since it must gobble next two hyphen signs.
+% \begin{macrocode}
+\def\belarusian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+\def\belarusian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \Describe\cdash{}
+% In its turn, |\belarusian@sh@emdash| simply calls for |\cdash| which has
+% rich use. It analyses 3rd of 3 characters and calls for one of few
+% predefined macros |\@Acdash|, |\@Bcdash|, |\@Ccdash|.
+% \begin{macrocode}
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+%
+% All these 3 internal macros call for |\cyrdash|, which type Cyrillic
+% emdash, but put different spaces around the dash.
+%
+% |\@Acdash| is invoked by |"---|. It types Cyrillic emdash to be used
+% inside a text and puts an unbreakable thin space before the dash if a
+% \textit{space} is placed before |"---| in the source file;
+% can be used after display maths formulae, formatted lists, enumerations, etc.
+% \begin{macrocode}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Bcdash| is invoked by |"--~|. It types Cyrillic emdash in compound
+% names (like Mendeleev--Klapeiron); requires no space characters around and
+% adds extra space after the dash.
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Ccdash| is invoked by |"--*|. It denotes direct speech and adds small
+% space after the dash.
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+% \end{macrocode}
+%
+% \Describe\cyrdash{}
+% The |\cyrdash| can be defined in a fontenc file as it is done for
+% the \texttt{T2*} encodings. We provide fake definition of |\cyrdash| only if
+% it is not defined there.
+%
+% Cyrillic \texttt{T2*} fonts contains shorter (Cyrillic) emdash. It can be
+% typeset also via the ligature |---|. So, if |\laticencoding| differs from
+% \texttt{T2*} switching of languages also changes the emdash length typed as
+% ligature in the source file.
+%
+% \changes{1.2}{2011/10/20}{Warning is added if \cs{cyrdash} defined}
+% \changes{1.3h}{2016/02/18}{\cs{cyrdash} is redefined}
+% |\textthreequartersemdash|=!\textthreequartersemdash!
+% \begin{macrocode}
+%\ifx\cyrdash\undefined
+% \def\cyrdash{\hbox to.8em{--\hss--}}
+% \PackageInfo{babel}{\string\cyrdash\space is defined}
+%\fi
+\ProvideTextCommandDefault{\cyrdash}{\iflanguage{belarusian}%
+ {\hbox to.8em{--\hss--}}{\textemdash}}
+% \end{macrocode}
+%
+% \changes{1.1f}{1998/06/26}{%
+% Add macro for thin space between initials}
+%
+% Finally, we define a shorthand thin space to be placed between initials
+% as in |D.",Mendeleev|. When used instead of |\,| as in |D.\,Mendeleev|
+% it allows hyphenation in the next word.
+%
+% \begin{macrocode}
+\declare@shorthand{belarusian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+%
+% \subsection{Switching to and from Belarusian}
+%
+% Now we define additional macros used to reset current language to
+% Belarusian and back
+% to some original state. The package \pkg{babel} based on the assumption
+% that original state is characterized by a Latin encoding. Previously,
+% for back reset the macro |\OriginalTeX| was used, but now use |\latintext|
+% for the same purpose.
+%
+%
+% \subsubsection{Caption names}
+%
+% First, we define Belarusian equivalents for Belarusian caption names.
+%
+% \Describe\captionsbelarusian{}
+% The macro |\captionsbelarusian| defines caption names used in the
+% four standard document classes provided with \LaTeX. The macro |\cyr|
+% activates Cyrillic encoding. It could be dropped if we would be sure
+% that Belarusian captions are called only if current language is Belarusian.
+% However, the macros such as |\Belarusian| do not conform to strict rules
+% of the package \pkg{babel} as explained in the above.
+%
+% As of version v.1.2 we eliminate |\cyr...| macros from caption names
+% if Unicode engine is running. In the latter case, Cyrillic letters are typed
+% in by their Unicode code-points, the |^^^^abcd| notation is not used
+% since it causes error at compilation time in case if \LaTeX\ is running
+% and \texttt{utf8} input encoding is not declared.
+%
+% \changes{1.2}{2011/10/20}{Unicode code-points added for LuaLaTeX}
+% \begin{macrocode}
+\if@uni@ode@be
+ %\captionsbelarusian@official
+ \addto\captionsbelarusian{%
+ \def\prefacename{Прадмова}% [babel]
+ \def\refname{Спіс літаратуры}% [only article]
+ \def\abstractname{Анатацыя}% [only article, report]
+ \def\bibname{Літаратура}% [only book, report]
+ \def\chaptername{Глава}% [only book, report]
+ \def\appendixname{Дадатак}%
+ \def\contentsname{Змест}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Спіс ілюстрацый}%
+ \def\listtablename{Спіс табліц}%
+ \def\indexname{Прадметны паказальнік}%
+ \def\authorname{Паказальнік імён}%
+ \def\figurename{Рыс.}%
+ \def\tablename{Табліца}%
+ \def\partname{Частка}%
+ \def\enclname{укл.}%
+ \def\ccname{зых.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}% [letter]
+ \def\seename{гл.}%
+ \def\alsoname{гл.\ таксама}%
+ \def\proofname{Доказ}% [amsthm]
+ \def\glossaryname{Слоўнік тэрмінаў}%
+ \def\acronymname{Абрэвіятуры}% [glossaries] {Acronyms}
+ \def\lstlistingname{Лістынг}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{Лістынгі}% [listings] (the "List of") {Listings}
+ \def\notesname{Нататкі}% [endnotes] {Notes}
+ }%
+% \end{macrocode}
+% Additional definitions for the package \pkg{nomencl}:
+% \begin{macrocode}
+ %% =========================================
+ %% nomencl
+ \ifdefined\nomname
+ \addto\captionsbelarusian{%
+ \def\nomname{Азначэнні}%
+ \def\eqdeclaration#1{, гл.\nobreakspace(#1)}%
+ \def\pagedeclaration#1{, стар.\nobreakspace#1}%
+ }%
+ \fi
+% \end{macrocode}
+% Additional captions for the \cls{revtex} class.
+% \begin{macrocode}
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %%\@ifclassloaded{revtex4-1}
+ %%{<true code>}
+ %%{<false coode>}%
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsbelarusian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рысункі}%{Figures}%
+ \def\tablesname{Табліцы}%{Tables}%
+ \def\appendixesname{Дадаткі}%{Appendixes}%
+ \def\acknowledgmentsname{Падзякі}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключавыя словы: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Атрымана }%{Received }%
+ \def\Revised@name{Выпраўленая версія }%{Revised }%
+ \def\Accepted@name{Прынята }%{Accepted }%
+ \def\Published@name{Апублікавана }%{Published }%
+ }%
+ %}{}%
+ \fi
+% \end{macrocode}
+%
+% \changes{1.3h}{2016/02/18}{Revtex captions fixed}
+% Now we proceed to the classic version in Unicode encoding.
+% \begin{macrocode}
+ \addto\captionsbelarusian@tarask{%
+ \def\prefacename{Прадмова}% [babel]
+ \def\refname{Сьпіс літаратуры}% [only article]
+ \def\abstractname{Анатацыя}% [only article, report]
+ \def\bibname{Літаратура}% [only book, report]
+ \def\chaptername{Глава}% [only book, report]
+ \def\appendixname{Дадатак}%
+ \def\contentsname{Зьмест}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Сьпіс ілюстрацый}%
+ \def\listtablename{Сьпіс табліц}%
+ \def\indexname{Прадметны паказальнік}%
+ \def\authorname{Паказальнік імён}%
+ \def\figurename{Рыс.}%
+ \def\tablename{Табліца}%
+ \def\partname{Частка}%
+ \def\enclname{укл.}%
+ \def\ccname{зых.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}% [letter]
+ \def\seename{гл.}%
+ \def\alsoname{гл.\ таксама}%
+ \def\proofname{Доказ}% [amsthm]
+ \def\glossaryname{Слоўнік тэрмінаў}%
+ \def\acronymname{Абрэвіятуры}% [glossaries] {Acronyms}
+ \def\lstlistingname{Лістынг}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{Лістынгі}% [listings] (the "List of") {Listings}
+ \def\nomname{Азначэньні}%
+ \def\notesname{Нататкі}% [endnotes] {Notes}
+ }
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsbelarusian@tarask{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рысункі}%{Figures}%
+ \def\tablesname{Табліцы}%{Tables}%
+ \def\appendixesname{Дадаткі}%{Appendixes}%
+ \def\acknowledgmentsname{Падзякі}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключавыя словы: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Атрымана }%{Received }%
+ \def\Revised@name{Выпраўленая вэрсыя }%{Revised }%
+ \def\Accepted@name{Прынята }%{Accepted }%
+ \def\Published@name{Апублікавана }%{Published }%
+ }%
+ %}{}%
+ \fi
+ %% =========================================
+\else
+ %\def\captionsbelarusian@official{%
+ \addto\captionsbelarusian{%
+ \def\prefacename{\CYRP\cyrr\cyra\cyrd\cyrm\cyro\cyrv\cyra}% [babel]
+ \def\refname{\CYRS\cyrp\cyrii\cyrs \cyrl\cyrii\cyrt\cyra\cyrr\cyra\cyrt\cyru\cyrr\cyrery}% [only article]
+ \def\abstractname{\CYRA\cyrn\cyra\cyrt\cyra\cyrc\cyrery\cyrya}% [only article, report]
+ \def\bibname{\CYRL\cyrii\cyrt\cyra\cyrr\cyra\cyrt\cyru\cyrr\cyra}% [only book, report]
+ \def\chaptername{\CYRG\cyrl\cyra\cyrv\cyra}% [only book, report]
+ \def\appendixname{\CYRD\cyra\cyrd\cyra\cyrt\cyra\cyrk}%
+ \def\contentsname{\CYRZ\cyrm\cyre\cyrs\cyrt}%
+ \let\tocname=\contentsname
+ \def\listfigurename{\CYRS\cyrp\cyrii\cyrs \cyrii\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrery\cyrishrt}%
+ \def\listtablename{\CYRS\cyrp\cyrii\cyrs \cyrt\cyra\cyrb\cyrl\cyrii\cyrc}%
+ \def\indexname{\CYRP\cyrr\cyra\cyrd\cyrm\cyre\cyrt\cyrn\cyrery \cyrp\cyra\cyrk\cyra\cyrz\cyra\cyrl\cyrsftsn\cyrn\cyrii\cyrk}%
+ \def\authorname{\CYRP\cyra\cyrk\cyra\cyrz\cyra\cyrl\cyrsftsn\cyrn\cyrii\cyrk \cyrii\cyrm\cyryo\cyrn}%
+ \def\figurename{\CYRR\cyrery\cyrs.}%
+ \def\tablename{\CYRT\cyra\cyrb\cyrl\cyrii\cyrc\cyra}%
+ \def\partname{\CYRCH\cyra\cyrs\cyrt\cyrk\cyra}%
+ \def\enclname{\cyru\cyrk\cyrl.}%
+ \def\ccname{\cyrz\cyrery\cyrh.}%
+ \def\headtoname{\cyrv\cyrh.}%
+ \def\pagename{\cyrs.}% [letter]
+ \def\seename{\cyrg\cyrl.}%
+ \def\alsoname{\cyrg\cyrl.\ \cyrt\cyra\cyrk\cyrs\cyra\cyrm\cyra}%
+ \def\proofname{\CYRD\cyro\cyrk\cyra\cyrz}% [amsthm]
+ \def\glossaryname{\CYRS\cyrl\cyro\cyrushrt\cyrn\cyrii\cyrk \cyrt\cyrerev\cyrr\cyrm\cyrii\cyrn\cyra\cyrushrt}%
+ \def\acronymname{\CYRA\cyrb\cyrr\cyrerev\cyrv\cyrii\cyrya\cyrt\cyru\cyrr\cyrery}% [glossaries] {Acronyms}
+ \def\lstlistingname{\CYRL\cyrii\cyrs\cyrt\cyrery\cyrn\cyrg}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{\CYRL\cyrii\cyrs\cyrt\cyrery\cyrn\cyrg\cyrii}% [listings] (the "List of") {Listings}
+ \def\nomname{\CYRA\cyrz\cyrn\cyra\cyrch\cyrerev\cyrn\cyrn\cyrii}%
+ \def\notesname{\CYRN\cyra\cyrt\cyra\cyrt\cyrk\cyrii}% [endnotes] {Notes}
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsbelarusian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyrery\cyrs\cyru\cyrn\cyrk\cyrii}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyrii\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRD\cyra\cyrd\cyra\cyrt\cyrk\cyrii}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRP\cyra\cyrd\cyrz\cyrya\cyrk\cyrii}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyra\cyrv\cyrery\cyrya \cyrs\cyrl\cyro\cyrv\cyrery: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRA\cyrt\cyrr\cyrery\cyrm\cyra\cyrn\cyra }%{Received }%
+ \def\Revised@name{\CYRV\cyrery\cyrp\cyrr\cyra\cyrushrt\cyrl\cyre\cyrn\cyra\cyrya \cyrv\cyre\cyrr\cyrs\cyrii\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyrery\cyrn\cyrya\cyrt\cyra }%{Accepted }%
+ \def\Published@name{\CYRA\cyrp\cyru\cyrb\cyrl\cyrii\cyrk\cyra\cyrv\cyra\cyrn\cyra }%{Published }%
+ }%
+ \fi
+ %% =========================================
+ \addto\captionsbelarusian@tarask{%
+ \def\prefacename{\CYRP\cyrr\cyra\cyrd\cyrm\cyro\cyrv\cyra}% [babel]
+ \def\refname{\CYRS\cyrsftsn\cyrp\cyrii\cyrs \cyrl\cyrii\cyrt\cyra\cyrr\cyra\cyrt\cyru\cyrr\cyrery}% [only article]
+ \def\abstractname{\CYRA\cyrn\cyra\cyrt\cyra\cyrc\cyrery\cyrya}% [only article, report]
+ \def\bibname{\CYRL\cyrii\cyrt\cyra\cyrr\cyra\cyrt\cyru\cyrr\cyra}% [only book, report]
+ \def\chaptername{\CYRG\cyrl\cyra\cyrv\cyra}% [only book, report]
+ \def\appendixname{\CYRD\cyra\cyrd\cyra\cyrt\cyra\cyrk}%
+ \def\contentsname{\CYRZ\cyrsftsn\cyrm\cyre\cyrs\cyrt}%
+ \let\tocname=\contentsname
+ \def\listfigurename{\CYRS\cyrsftsn\cyrp\cyrii\cyrs \cyrii\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrery\cyrishrt}%
+ \def\listtablename{\CYRS\cyrsftsn\cyrp\cyrii\cyrs \cyrt\cyra\cyrb\cyrl\cyrii\cyrc}%
+ \def\indexname{\CYRP\cyrr\cyra\cyrd\cyrm\cyre\cyrt\cyrn\cyrery \cyrp\cyra\cyrk\cyra\cyrz\cyra\cyrl\cyrsftsn\cyrn\cyrii\cyrk}%
+ \def\authorname{\CYRP\cyra\cyrk\cyra\cyrz\cyra\cyrl\cyrsftsn\cyrn\cyrii\cyrk \cyrii\cyrm\cyryo\cyrn}%
+ \def\figurename{\CYRR\cyrery\cyrs.}%
+ \def\tablename{\CYRT\cyra\cyrb\cyrl\cyrii\cyrc\cyra}%
+ \def\partname{\CYRCH\cyra\cyrs\cyrt\cyrk\cyra}%
+ \def\enclname{\cyru\cyrk\cyrl.}%
+ \def\ccname{\cyrz\cyrery\cyrh.}%
+ \def\headtoname{\cyrv\cyrh.}%
+ \def\pagename{\cyrs.}% [letter]
+ \def\seename{\cyrg\cyrl.}%
+ \def\alsoname{\cyrg\cyrl.\ \cyrt\cyra\cyrk\cyrs\cyra\cyrm\cyra}%
+ \def\proofname{\CYRD\cyro\cyrk\cyra\cyrz}% [amsthm]
+ \def\glossaryname{\CYRS\cyrl\cyro\cyrushrt\cyrn\cyrii\cyrk \cyrt\cyrerev\cyrr\cyrm\cyrii\cyrn\cyra\cyrushrt}%
+ \def\acronymname{\CYRA\cyrb\cyrr\cyrerev\cyrv\cyrii\cyrya\cyrt\cyru\cyrr\cyrery}% [glossaries] {Acronyms}
+ \def\lstlistingname{\CYRL\cyrii\cyrs\cyrt\cyrery\cyrn\cyrg}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{\CYRL\cyrii\cyrs\cyrt\cyrery\cyrn\cyrg\cyrii}% [listings] (the "List of") {Listings}
+ \def\nomname{\CYRA\cyrz\cyrn\cyra\cyrch\cyrerev\cyrn\cyrsftsn\cyrn\cyrii}%
+ \def\notesname{\CYRN\cyra\cyrt\cyra\cyrt\cyrk\cyrii}% [endnotes] {Notes}
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsbelarusian@tarask{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyrery\cyrs\cyru\cyrn\cyrk\cyrii}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyrii\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRD\cyra\cyrd\cyra\cyrt\cyrk\cyrii}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRP\cyra\cyrd\cyrz\cyrya\cyrk\cyrii}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyra\cyrv\cyrery\cyrya \cyrs\cyrl\cyro\cyrv\cyrery: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRA\cyrt\cyrr\cyrery\cyrm\cyra\cyrn\cyra }%{Received }%
+ \def\Revised@name{\CYRV\cyrery\cyrp\cyrr\cyra\cyrushrt\cyrl\cyre\cyrn\cyra\cyrya \cyrv\cyrerev\cyrr\cyrs\cyrery\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyrery\cyrn\cyrya\cyrt\cyra }%{Accepted }%
+ \def\Published@name{\CYRA\cyrp\cyru\cyrb\cyrl\cyrii\cyrk\cyra\cyrv\cyra\cyrn\cyra }%{Published }%
+ }%
+ \fi
+ %% =========================================
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Date in Belarusian}
+%
+% \Describe\datebelarusian{}
+% The macro |\datebelarusian| is used to reset the macro |\today| in Belarusian.
+%
+% \changes{1.2}{2011/10/20}{Unicode code-points added for LuaLaTeX}
+% \begin{macrocode}
+\if@uni@ode@be
+ \addto\datebelarusian{%
+ \def\today{\number\day~\ifcase\month\or
+ студзеня\or
+ лютага\or
+ сакавіка\or
+ красавіка\or
+ мая\or
+ чэрвеня\or
+ ліпеня\or
+ жніўня\or
+ верасня\or
+ кастрычніка\or
+ лістапада\or
+ снежня\fi
+ \space \number\year~г.}}
+ \def\datebelarusian@tarask{%
+ \def\today{\number\day~\ifcase\month\or%
+ студзеня\or
+ лютага\or
+ сакавіка\or
+ красавіка\or
+ траўня\or
+ чэрвеня\or
+ ліпеня\or
+ жніўня\or
+ верасьня\or
+ кастрычніка\or
+ лістапада\or
+ сьнежня\fi%
+ \space \number\year~г.}}
+\else
+ \def\datebelarusian{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrs\cyrt\cyru\cyrd\cyrz\cyre\cyrn\cyrya\or
+ \cyrl\cyryu\cyrt\cyra\cyrg\cyra\or
+ \cyrs\cyra\cyrk\cyra\cyrv\cyrii\cyrk\cyra\or
+ \cyrk\cyrr\cyra\cyrs\cyra\cyrv\cyrii\cyrk\cyra\or
+ \cyrm\cyra\cyrya\or
+ \cyrch\cyrerev\cyrr\cyrv\cyre\cyrn\cyrya\or
+ \cyrl\cyrii\cyrp\cyre\cyrn\cyrya\or
+ \cyrzh\cyrn\cyrii\cyrushrt\cyrn\cyrya\or
+ \cyrv\cyre\cyrr\cyra\cyrs\cyrn\cyrya\or
+ \cyrk\cyra\cyrs\cyrt\cyrr\cyrery\cyrch\cyrn\cyrii\cyrk\cyra\or
+ \cyrl\cyrii\cyrs\cyrt\cyra\cyrp\cyra\cyrd\cyra\or
+ \cyrs\cyrn\cyre\cyrzh\cyrn\cyrya\fi
+ \space \number\year~\cyrg.}}
+ \def\datebelarusian@tarask{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrs\cyrt\cyru\cyrd\cyrz\cyre\cyrn\cyrya\or
+ \cyrl\cyryu\cyrt\cyra\cyrg\cyra\or
+ \cyrs\cyra\cyrk\cyra\cyrv\cyrii\cyrk\cyra\or
+ \cyrk\cyrr\cyra\cyrs\cyra\cyrv\cyrii\cyrk\cyra\or
+ \cyrt\cyrr\cyra\cyrushrt\cyrn\cyrya\or
+ \cyrch\cyrerev\cyrr\cyrv\cyre\cyrn\cyrya\or
+ \cyrl\cyrii\cyrp\cyre\cyrn\cyrya\or
+ \cyrzh\cyrn\cyrii\cyrushrt\cyrn\cyrya\or
+ \cyrv\cyre\cyrr\cyra\cyrs\cyrsftsn\cyrn\cyrya\or
+ \cyrk\cyra\cyrs\cyrt\cyrr\cyrery\cyrch\cyrn\cyrii\cyrk\cyra\or
+ \cyrl\cyrii\cyrs\cyrt\cyra\cyrp\cyra\cyrd\cyra\or
+ \cyrs\cyrsftsn\cyrn\cyre\cyrzh\cyrn\cyrya\fi%
+ \space \number\year~\cyrg.}}
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Hyphenation patterns}
+%
+% Belarusian hyphenation patterns are automatically activated every time
+% Belarusian language is selected via |\selectlanguage|, |\foreignlanguage|
+% or equivalent command. But we need to declare values of
+% |\lefthyphenmin| and |\righthyphenmin|; both are set to~2.
+%
+% As of v.1.2 we removed a definition for |\englishhyphenmins|. It is
+% not deal of \file{belarusian.ldf}.
+%
+% \changes{1.1a}{1995/07/04}{use \cs{belarusianhyphenmins} to
+% store the correct values}
+% \changes{1.1m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \changes{1.2}{2011/10/20}{\cs{englishhyphenmins} is removed}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{belarusian}{\tw@\tw@}
+% \end{macrocode}
+%
+% \subsubsection{Extra definitions}
+% \label{sss:extra}
+%
+% \Describe\extrasbelarusian{}
+% \DescribeOther\noextrasbelarusian{}
+% The macro |\extrasbelarusian| performs extra definitions in addition to
+% resetting the caption names and date.
+% The macro |\noextrasbelarusian| is used to cancel the actions of
+% |\extrasbelarusian|.
+%
+% \changes{1.1b}{1996/02/20}{Added switch to \texttt{LWN}
+% encoding}
+%
+% First, we instruct \pkg{babel} to switch font encoding using earlier
+% defined macros |\cyrillictext| and |\latintext|.
+%
+% \begin{macrocode}
+\addto\extrasbelarusian{\cyrillictext}
+\addto\noextrasbelarusian{\latintext}
+% \end{macrocode}
+%
+% Second, we specify that the Belarusian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasbelarusian{\languageshorthands{belarusian}}
+\addto\extrasbelarusian{\bbl@activate{"}}
+\addto\noextrasbelarusian{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% Now the action |\extrasbelarusian| has to execute is to make sure that the
+% command |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasbelarusian| will switch it off again.
+%
+% \begin{macrocode}
+\addto\extrasbelarusian{\bbl@frenchspacing}
+\addto\noextrasbelarusian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+%
+% \subsection{Alphabetic counters}
+%
+% Do we need to reset |\@alph| and |\@Alph|? They are used in the
+% \LaTeX\ core to define the macros |\alph| and |\Alph|, respectively, which
+% type a counter with a corresponding letter of Latin alphabet.
+% We just want to make sure that correct |\latinencoding| is used instead of
+% |\latinencoding| to typeset the counter. Starting from v.1.2 we do not
+% reset these macros since all Cyrillic encoding but \texttt{X2} do have
+% Latin letters. When using the \texttt{X2} encoding user must himself
+% take care about selecting correct encoding when he switches his keyboard.
+% Our decision is motivated as follows. If selected Cyrillic font is visually
+% different from Latin font, the macro |\@alph| and |\@Alph| will produce
+% visually different output from surrounding text if they are used with
+% Belarusian text, which is completely legitimate.
+%
+% Notice for commented code:\\
+% We put |\latinencoding| in braces to avoid problems with
+% |\@alph| inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% Note added on 2013/03/22: |{\fontencoding{\latinencoding}\selectfont|
+% rises an error with recent version of \pkg{microtype} package after the
+% |\appendix| declaration (which resets |\thechapter| to |\@Alph\c@chapter}|).
+% Most languages do not reset |\@alph| and |\@Alph| macros and only
+% \pkg{ukrainian} and \pkg{bulgarian} add |\fontencoding| to |\@alph| and
+% |\@Alph|.
+%
+% Since v.1.3 we do not reset |\@alph| and |\@Alph| here.
+% Resetting |\fontencoding| in |\@alph| and |\@Alph| causes an error
+% if the package |smartref| is loaded and a |\sref| occurs after the
+% |\appendix| declaration which resets |\thechapter| to |\@Alph\c@chapter|.
+% \changes{1.3}{2013/03/22}{Removed \cs{@alph} and \cs{@Alph}}
+%
+% \begin{macrocode}
+%\def\@alph#1{{\fontencoding{\latinencoding}\selectfont
+% \ifcase#1\or
+% a\or b\or c\or d\or e\or f\or g\or h\or
+% i\or j\or k\or l\or m\or n\or o\or p\or
+% q\or r\or s\or t\or u\or v\or w\or x\or
+% y\or z\else\@ctrerr\fi}}%
+%\def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
+% \ifcase#1\or
+% A\or B\or C\or D\or E\or F\or G\or H\or
+% I\or J\or K\or L\or M\or N\or O\or P\or
+% Q\or R\or S\or T\or U\or V\or W\or X\or
+% Y\or Z\else\@ctrerr\fi}}%
+% \end{macrocode}
+%
+% We add new enumeration style for Belarusian manuscripts with
+% Cyrillic letters.
+%
+% \Describe\Asbuk{}
+% We begin by defining |\Asbuk| which works like |\Alph|, but produces
+% (uppercase) Cyrillic letters instead of Latin ones. The letters YO,
+% ISHRT, USHRT, ERY, and SFTSN are skipped, as usual for such
+% enumeration.
+%
+% \begin{macrocode}
+\def\Asbuk#1{\expandafter\belarusian@Alph\csname c@#1\endcsname}
+\if@uni@ode@be
+ \def\belarusian@Alph#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or
+ З\or І\or К\or Л\or М\or Н\or О\or
+ П\or Р\or С\or Т\or У\or Ф\or Х\or
+ Ц\or Ч\or Ш\or Э\or Ю\or Я\else\@ctrerr\fi}
+\else
+ \def\belarusian@Alph#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or
+ \CYRZ\or\CYRII\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or
+ \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or
+ \CYRC\or\CYRCH\or\CYRSH\or\CYREREV\or\CYRYU\or
+ \CYRYA\else\@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% \Describe\asbuk{}
+% The macro |\asbuk| is similar to |\alph|; it produces lowercase
+% Belarusian letters.
+%
+% \begin{macrocode}
+\def\asbuk#1{\expandafter\belarusian@alph\csname c@#1\endcsname}
+\if@uni@ode@be
+ \def\belarusian@alph#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or е\or ж\or
+ з\or і\or к\or л\or м\or н\or о\or
+ п\or р\or с\or т\or у\or ф\or х\or
+ ц\or ч\or ш\or э\or ю\or я\else\@ctrerr\fi}
+\else
+ \def\belarusian@alph#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or
+ \cyrz\or\cyrii\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or
+ \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or
+ \cyrc\or\cyrch\or\cyrsh\or\cyrerev\or\cyryu\or
+ \cyrya\else\@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% Babel 3.9 has introduced a notion of a language attribute.
+% The \Lopt{classic} attribute (or its alias \Lopt{tarask}) changes
+% the default behavior which uses the official Belarusian spelling,
+% and activates an alternative set of captions and date macros.
+% \begin{macrocode}
+\bbl@declare@ttribute{belarusian}{classic}{%
+ \PackageInfo{babel}{Belarusian attribute set to classic}%
+ \let\captionsbelarusian=\captionsbelarusian@tarask
+ \let\datebelarusian=\datebelarusian@tarask
+}
+\bbl@declare@ttribute{belarusian}{tarask}{%
+ \PackageInfo{babel}{Belarusian attribute set to tarask}%
+ \let\captionsbelarusian=\captionsbelarusian@tarask
+ \let\datebelarusian=\datebelarusian@tarask
+}
+% \end{macrocode}
+% We don't want for long internal macros to waste memory. So we declare
+% them to be usable within the preamble only.
+% \begin{macrocode}
+\@onlypreamble\captionsbelarusian@tarask
+\@onlypreamble\datebelarusian@tarask
+% \end{macrocode}
+%
+% \subsection{Cyrillic math}
+%
+% For compatibility with older Russian packages we could define the |\No|
+% macro. However the Belarusian number sign is now superseded with |\textnumero|.
+% Moreover, it can be found of Belarusian keyboard. Therefore we discard |\No|
+% since v.1.2.
+% \begin{macrocode}
+%\DeclareRobustCommand{\No}{%
+% \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+%
+% As of version 1.2 the macros |\cyrmath..| are not supported any more. They
+% requires package \pkg{textmath} which is not available now. Instead of
+% |\cyrmath..| it is advised to use corresponding |\text..| commands; they
+% do work in math mode.
+% \begin{macrocode}
+%\RequirePackage{textmath}
+% \@ifundefined{sym\cyrillicencoding letters}{}{%
+% \SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+% \rmdefault\bfdefault\updefault
+% \DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+% And we need few commands to switch to different variants.
+% \begin{macrocode}
+%\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+% \rmdefault\bfdefault\updefault
+%\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+% \sfdefault\mddefault\updefault
+%\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+% \rmdefault\mddefault\itdefault
+%\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+% \ttdefault\mddefault\updefault
+%
+%\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+% \sfdefault\bfdefault\updefault
+%\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+% \rmdefault\bfdefault\itdefault
+%}
+% \end{macrocode}
+%
+% \Describe\sh{}
+% \DescribeOther\ch{}%
+% \DescribeOther\tg{}%
+% \DescribeOther\ctg{}%
+% \DescribeOther\arctg{}%
+% \DescribeOther\arcctg{}%
+% \DescribeOther\th{}%
+% \DescribeOther\cth{}%
+% \DescribeOther\cosec{}%
+% We also define few math operator names according to Belarusian typesetting
+% traditions. Some math functions in Belarusian math books have names
+% different from English writings. For example, \texttt{sinh} in
+% Belarusian is called \texttt{sh}. Special consideration needs the
+% macro |\th| that conflicts with the text symbol |\th|
+% defined in Latin~1 encoding:
+%
+% \changes{1.2}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasbelarusian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% \Describe\Prob{}%
+% \DescribeOther\Variance{}%
+% \DescribeOther\nod{}%
+% \DescribeOther\nok{}%
+% \DescribeOther\NOD{}%
+% \DescribeOther\NOK{}%
+% \DescribeOther\Proj{}%
+% Finally, we define some rare Belarusian mathematical symbols:
+% \begin{macrocode}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\if@uni@ode@be
+ \def\nod{\mathop{\mathrm{н.а.д.}}\nolimits}
+ \def\nok{\mathop{\mathrm{н.а.к.}}\nolimits}
+ \def\NOD{\mathop{\mathrm{НАД}}\nolimits}
+ \def\NOK{\mathop{\mathrm{НАК}}\nolimits}
+ \def\nad{\mathop{\mathrm{н.а.д.}}\nolimits}
+ \def\nak{\mathop{\mathrm{н.а.к.}}\nolimits}
+ \def\NAD{\mathop{\mathrm{НАД}}\nolimits}
+ \def\NAK{\mathop{\mathrm{НАК}}\nolimits}
+ \def\Proj{\mathop{\mathrm{Пр}}\nolimits}
+\else
+ \def\nod{\mathop{\textnormal{\cyrn.\cyra.\cyrd.}}\nolimits}
+ \def\nok{\mathop{\textnormal{\cyrn.\cyra.\cyrk.}}\nolimits}
+ \def\NOD{\mathop{\textnormal{\CYRN\CYRA\CYRD}}\nolimits}
+ \def\NOK{\mathop{\textnormal{\CYRN\CYRA\CYRK}}\nolimits}
+ \def\nad{\mathop{\textnormal{\cyrn.\cyra.\cyrd.}}\nolimits}
+ \def\nak{\mathop{\textnormal{\cyrn.\cyra.\cyrk.}}\nolimits}
+ \def\NAD{\mathop{\textnormal{\CYRN\CYRA\CYRD}}\nolimits}
+ \def\NAK{\mathop{\textnormal{\CYRN\CYRA\CYRK}}\nolimits}
+ \def\Proj{\mathop{\textnormal{\CYRP\cyrr}}\nolimits}
+\fi
+% \end{macrocode}
+%
+% \subsection{Final settings}
+%
+% The macro |\ldf@finish| does work needed
+% at the end of each \file{.ldf} file. This
+% includes resetting the category code of the \texttt{@}-sign,
+% loading a local configuration file, and preparing the language
+% to be activated at |\begin{document}| time.
+%
+% \changes{1.1d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{belarusian}
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \end{macrocode}
+%\iffalse
+%</code>
+%\fi
+% \CheckSum{2215}
+%\Finale
diff --git a/macros/latex/contrib/babel-contrib/belarusian/belarusian.pdf b/macros/latex/contrib/babel-contrib/belarusian/belarusian.pdf
new file mode 100644
index 0000000000..18812034e2
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/belarusian/belarusian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/bosnian/README b/macros/latex/contrib/babel-contrib/bosnian/README
new file mode 100644
index 0000000000..0a49d5286e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bosnian/README
@@ -0,0 +1,24 @@
+Package: babel-bosnian
+Version: 1.1
+Dated: 20/08/2015
+
+The package provides language definition files for use with babel, which
+establishes Bosnian conventions in a document (or a subset of the
+conventions, if Bosnian is not the main language of the document).
+
+To install run the bosnian.ins file trough the TeX compiler. Then move
+the created bosnian.ldf file into a directory searched by TeX.
+
+To produce the documentation run the file bosnian.dtx through LaTeX.
+
+This material is subject to the LaTeX Project Public License v1.3.
+See http://ctan.org/license/lppl1.3 for the details of that license.
+
+Happy TeXing.
+
+--------------------------------------
+
+Halilcevic Samir
+<samir.halilcevic@fet.ba>
+August 20, 2015
+Version 1.1
diff --git a/macros/latex/contrib/babel-contrib/bosnian/bosnian.dtx b/macros/latex/contrib/babel-contrib/bosnian/bosnian.dtx
new file mode 100644
index 0000000000..7e05e29d85
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bosnian/bosnian.dtx
@@ -0,0 +1,233 @@
+% \iffalse meta-comment
+%
+% Copyright 2015 Samir Halilčević and any individual authors listed
+% elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{106}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{bosnian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{bosnian}
+%\fi
+%\ProvidesFile{bosnian.dtx}
+ [2015/08/20 v1.1 Bosnian support from the babel system]
+%\iffalse
+%
+% This file is part of the babel system, it provides the source
+% code for the Bosnian language definition file. A contribution
+% was made by Samir Halil\v{c}evi\'{c} (samir.halilcevic@fet.ba)
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{bosnian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{bosnian.dtx}
+%
+% \changes{bosnian-1.0}{2015/02/17}{Initial release}
+%
+% \changes{bosnian-1.1}{2015/07/11}{
+% Added support for math mode functions under the
+% *tg* shorthand instead of *tan*.
+% Updated the babel-bosnian maintaners and copyright
+% as stated in the CONTRIB file of the babel system.
+% Fixed some typos and improved documentation.
+% Changed authors mail addres to <samir.halilcevic@fet.ba>
+% }
+%
+% \section{The Bosnian language}%
+%
+% The package provides language definition files for use with
+% the babel system, which establishes Bosnian conventions in a
+% document (or a subset of the conventions, if Bosnian is not the
+% main language of the document).
+%
+% The file \file{\filename} defines all the language definition
+% macros for the Bosnian language.
+%
+% The default strings used in the four standard documentclasses
+% provided with \LaTeX, the names of the months and default date
+% formatting have been translated and defined.
+%
+% As it is common to use "tg" as an abbreviation instead for the
+% tangent trigonometry function and its relatives. Therefore the
+% following macros are activated for use in mathematic mode:
+% \begin{itemize}
+% \item\textbackslash th
+% \item\textbackslash ctg
+% \item\textbackslash arctg
+% \item\textbackslash atcctg
+% \end{itemize}
+%
+% The package version number is \fileversion\ and was last revised on
+% \filedate. A contribution was made by Samir Halil\v{c}evi\'{c}
+% \texttt{(samir.halilcevic@fet.ba}).
+%
+% \StopEventually{}
+%
+%
+% \section{Installation}
+% The package contains the files \file{bosnian.dtx},
+% \file{bosnian.ins}, \file{bosnian.pdf} and \file{README}. If any
+% of the files are missing or you want to check for a newer version
+% visit \texttt{www.ctan.org/pkg/babel-bosnian}.
+%
+% To install run the \file{bosnian.ins} file trough the TeX compiler.
+% Then move the created \file{bosnian.ldf} file into a directory
+% searched by TeX, suggested the installation directory or the
+% project folder.
+%
+% To produce the documentation (this file) run the file
+% \file{bosnian.dtx} through the LaTeX compiler.
+%
+%
+% \section{Code and comments}%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{bosnian}\captionsbosnian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{bosnian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@bosnian| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@bosnian\@undefined
+ \@nopatterns{Bosnian}
+ \adddialect\l@bosnian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Bosnian language.
+%
+% \begin{macro}{\captionsbosnian}
+% The macro |\captionsbosnian| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\addto\captionsbosnian{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Sa\v{z}etak}%
+ \def\bibname{Bibliografija}%
+ \def\chaptername{Poglavlje}%
+ \def\appendixname{Dodatak}%
+ \def\contentsname{Sadr\v{z}aj}%
+ \def\listfigurename{Popis slika}%
+ \def\listtablename{Popis tablica}%
+ \def\indexname{Indeks}%
+ \def\figurename{Slika}%
+ \def\tablename{Tablica}%
+ \def\partname{Dio}%
+ \def\enclname{Prilozi}%
+ \def\ccname{Kopija}%
+ \def\headtoname{Prima}%
+ \def\pagename{Stranica}%
+ \def\seename{Vidjeti}%
+ \def\alsoname{Tako\dj er vidjeti}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Rje\v{c}nik}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebosnian}
+% The macro |\datebosnian| redefines the command |\today| to
+% produce Bosnian dates.
+% \begin{macrocode}
+\def\datebosnian{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or mart\or april\or maj\or
+ juni\or juli\or august\or septembar\or oktobar\or novembar\or
+ decembar\fi \space \number\year.~}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasbosnian}
+% \begin{macro}{\noextrasbosnian}
+% The macro |\extrasbosnian| will perform all the extra
+% definitions needed for the Bosnian language. The macro
+% |\noextrasbosnian| is used to cancel the actions of
+% |\extrasbosnian|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extrasbosnian{}
+\addto\noextrasbosnian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\mathbosnian}
+% It is common to use "tg" instead of "tan" in function names.
+% Here are the definitions of the new math operators:
+%
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{bosnian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/bosnian/bosnian.ins b/macros/latex/contrib/babel-contrib/bosnian/bosnian.ins
new file mode 100644
index 0000000000..04a0fe5c2c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bosnian/bosnian.ins
@@ -0,0 +1,150 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2015 Samir Halilcevic and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2015/08/19}
+\def\batchfile{bosnian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2015 Samir Halilcevic and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Samir Halilcevic.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2015 Samir Halilcevic and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{bosnian.ldf}{\from{bosnian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/bosnian/bosnian.pdf b/macros/latex/contrib/babel-contrib/bosnian/bosnian.pdf
new file mode 100644
index 0000000000..a6099503a5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bosnian/bosnian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/breton/breton.dtx b/macros/latex/contrib/babel-contrib/breton/breton.dtx
new file mode 100644
index 0000000000..e87500aaf1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/breton/breton.dtx
@@ -0,0 +1,365 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{263}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{breton.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{breton}
+%\fi
+%\ProvidesFile{breton.dtx}
+ [2005/03/29 v1.0h Breton support from the babel system]
+%\iffalse
+%% File `breton.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Breton Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by Christian Rolland
+% Universite de Bretagne occidentale
+% Departement d'informatique
+% 6, avenue Le Gorgeu
+% BP 452
+% 29275 Brest Cedex -- FRANCE
+% Christian.Rolland at univ-brest.fr (Internet)
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Breton language definition file. It is based on the
+% language definition file for french, version 4.5c
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{breton.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{breton.dtx}
+% \changes{breton-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \changes{breton-1.0}{1994/09/21}{First release}
+%
+% \section{The Breton language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macros for the Breton
+% language.
+%
+% There are not really typographic rules for the Breton
+% language. It is a local language (it's one of the celtic
+% languages) which is spoken in Brittany (West of France). So we
+% have a synthesis between french typographic rules and english
+% typographic rules. The characters \texttt{:}, \texttt{;},
+% \texttt{!} and \texttt{?} are made active in order to get a
+% whitespace automatically before these characters.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{breton-1.0e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{breton}\captionsbreton
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{breton} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@breton| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@breton\@undefined
+ \@nopatterns{Breton}
+ \adddialect\l@breton0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to the
+% English language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsbreton}
+% The macro |\captionsbreton| defines all strings used in the
+% four standard document classes provided with \LaTeX.
+% \changes{breton-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{breton-1.0h}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsbreton{%
+ \def\prefacename{Rakskrid}%
+ \def\refname{Daveenno\`u}%
+ \def\abstractname{Dvierra\~n}%
+ \def\bibname{Lennadurezh}%
+ \def\chaptername{Pennad}%
+ \def\appendixname{Stagadenn}%
+ \def\contentsname{Taolenn}%
+ \def\listfigurename{Listenn ar Figurenno\`u}%
+ \def\listtablename{Listenn an taolenno\`u}%
+ \def\indexname{Meneger}%
+ \def\figurename{Figurenn}%
+ \def\tablename{Taolenn}%
+ \def\partname{Lodenn}%
+ \def\enclname{Diello\`u kevret}%
+ \def\ccname{Eilskrid da}%
+ \def\headtoname{evit}
+ \def\pagename{Pajenn}%
+ \def\seename{Gwelout}%
+ \def\alsoname{Gwelout ivez}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebreton}
+% The macro |\datebreton| redefines the command
+% |\today| to produce Breton dates.
+% \changes{breton-1.0f}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{breton-1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datebreton{%
+ \def\today{\ifnum\day=1\relax 1\/$^{\rm a\tilde{n}}$\else
+ \number\day\fi \space a\space viz\space\ifcase\month\or
+ Genver\or C'hwevrer\or Meurzh\or Ebrel\or Mae\or Mezheven\or
+ Gouere\or Eost\or Gwengolo\or Here\or Du\or Kerzu\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasbreton}
+% \begin{macro}{\noextrasbreton}
+% The macro |\extrasbreton| will perform all the extra
+% definitions needed for the Breton language. The macro
+% |\noextrasbreton| is used to cancel the actions of
+% |\extrasbreton|.
+%
+% The category code of the characters \texttt{:}, \texttt{;},
+% \texttt{!} and \texttt{?} is made |\active| to insert a little
+% white space.
+% \changes{breton-1.0b}{1995/03/07}{Use the new mechanism for dealing
+% with active chars}
+% \begin{macrocode}
+\initiate@active@char{:}
+\initiate@active@char{;}
+\initiate@active@char{!}
+\initiate@active@char{?}
+% \end{macrocode}
+% We specify that the breton group of shorthands should be used.
+% \begin{macrocode}
+\addto\extrasbreton{\languageshorthands{breton}}
+% \end{macrocode}
+% These characters are `turned on' once, later their definition may
+% vary.
+% \begin{macrocode}
+\addto\extrasbreton{%
+ \bbl@activate{:}\bbl@activate{;}%
+ \bbl@activate{!}\bbl@activate{?}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{breton-1.0g}{1999/12/16}{Deactivate shorthands ouside of Breton}
+% \begin{macrocode}
+\addto\noextrasbreton{%
+ \bbl@deactivate{:}\bbl@deactivate{;}%
+ \bbl@deactivate{!}\bbl@deactivate{?}}
+% \end{macrocode}
+%
+% The last thing |\extrasbreton| needs to do is to make sure that
+% |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasbreton| will switch it of again.
+% \begin{macrocode}
+\addto\extrasbreton{\bbl@frenchspacing}
+\addto\noextrasbreton{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@;@}
+% We have to reduce the amount of white space before \texttt{;},
+% \texttt{:} and \texttt{!} when the user types a space in front of
+% these characters. This should only happen outside mathmode, hence
+% the test with |\ifmmode|.
+%
+% \begin{macrocode}
+\declare@shorthand{breton}{;}{%
+ \ifmmode
+ \string;\space
+ \else\relax
+% \end{macrocode}
+% In horizontal mode we check for the presence of a `space' and
+% replace it by a |\thinspace|.
+% \begin{macrocode}
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string;\space
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@:@}
+% \begin{macro}{\breton@sh@!@}
+% Because these definitions are very similar only one is displayed
+% in a way that the definition can be easily checked.
+% \begin{macrocode}
+\declare@shorthand{breton}{:}{%
+ \ifmmode\string:\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi
+ \fi
+ \string:\space
+ \fi}
+\declare@shorthand{breton}{!}{%
+ \ifmmode\string!\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi
+ \fi
+ \string!\space
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\breton@sh@?@}
+% For the question mark something different has to be done. In this
+% case the amount of white space that replaces the space character
+% depends on the dimensions of the font.
+% \begin{macrocode}
+\declare@shorthand{breton}{?}{%
+ \ifmmode
+ \string?\space
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip
+ \kern\fontdimen2\font
+ \kern-1.4\fontdimen3\font
+ \fi
+ \fi
+ \string?\space
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% All that is left to do now is provide the breton user with some
+% extra utilities.
+%
+% Some definitions for special characters.
+% \begin{macrocode}
+\DeclareTextSymbol{\at}{OT1}{64}
+\DeclareTextSymbol{\at}{T1}{64}
+\DeclareTextSymbolDefault{\at}{OT1}
+\DeclareTextSymbol{\boi}{OT1}{92}
+\DeclareTextSymbol{\boi}{T1}{16}
+\DeclareTextSymbolDefault{\boi}{OT1}
+\DeclareTextSymbol{\circonflexe}{OT1}{94}
+\DeclareTextSymbol{\circonflexe}{T1}{2}
+\DeclareTextSymbolDefault{\circonflexe}{OT1}
+\DeclareTextSymbol{\tild}{OT1}{126}
+\DeclareTextSymbol{\tild}{T1}{3}
+\DeclareTextSymbolDefault{\tild}{OT1}
+\DeclareTextSymbol{\degre}{OT1}{23}
+\DeclareTextSymbol{\degre}{T1}{6}
+\DeclareTextSymbolDefault{\degre}{OT1}
+% \end{macrocode}
+%
+% The following macros are used in the redefinition of |\^| and
+% |\"| to handle the letter i.
+% \changes{breton-1.0c}{1995/07/07}{Postpone the
+% \cs{DeclareTextCompositeCommand}s untill \cs{AtBeginDocument}}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}
+ \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}}
+% \end{macrocode}
+%
+% And some more macros for numbering.
+% \begin{macrocode}
+\def\kentan{1\/${}^{\rm a\tilde{n}}$}
+\def\eil{2\/${}^{\rm l}$}
+\def\re{\/${}^{\rm re}$}
+\def\trede{3\re}
+\def\pevare{4\re}
+\def\vet{\/${}^{\rm vet}$}
+\def\pempvet{5\vet}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{breton-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{breton}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/breton/breton.ins b/macros/latex/contrib/babel-contrib/breton/breton.ins
new file mode 100644
index 0000000000..595e0cba1b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/breton/breton.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{breton.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{breton.ldf}{\from{breton.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/breton/breton.pdf b/macros/latex/contrib/babel-contrib/breton/breton.pdf
new file mode 100644
index 0000000000..7408c56cac
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/breton/breton.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/bulgarian/README b/macros/latex/contrib/babel-contrib/bulgarian/README
new file mode 100644
index 0000000000..837849bfbc
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bulgarian/README
@@ -0,0 +1,20 @@
+Bulgarian language definition file version 1.2g for Babel.
+----------
+
+To install, run latex on bulgarian.ins. This creates the file
+bulgarian.ldf. Use this newly created file to replace the
+existing file with the same name in your TeX installation (for MikTeX on
+Windows this may be something like
+c:\Program Files\Miktex 2.9\tex\generic\babel\bulgarian.ldf).
+
+Report bugs to Georgi Boshnakov.
+
+See bulgarian.pdf for usage details.
+
+Changes are described in bulgarian.pdf (section Change history).
+
+
+------------
+Georgi Boshnakov (georgi.boshnakov at manchester dot ac dot uk)
+2013-10-14
+
diff --git a/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.dtx b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.dtx
new file mode 100644
index 0000000000..ea52aa26f9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.dtx
@@ -0,0 +1,2092 @@
+% \iffalse meta-comment
+%
+% Copyright 2013 Georgi N. Boshnakov
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Georgi N. Boshnakov
+%
+% \fi
+% \CheckSum{1881}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{bulgarian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{bulgarian}
+ [2013/10/14 v1.2g Bulgarian support from the babel system]
+%
+%% File `bulgarian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989-2008
+%% by Johannes Braams,TeXniek
+%
+%% Bulgarian Language Definition File
+%% Copyright (C) 1995-2008
+%% by Georgi N. Boshnakov <georgi.boshnakov at umist.ac.uk>
+%% Johannes Braams, TeXniek
+%
+%% Original version adapted from russianb.dtx (August-1998 version)
+%% by Georgi N. Boshnakov <georgi.boshnakov at umist.ac.uk>
+%
+%% Copyright (C) 2013
+%% by Georgi N. Boshnakov
+%
+%% Please report errors to: Georgi N. Boshnakov
+%% georgi.boshnakov at manchester dot ac dot uk
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage{ifxetex,ifluatex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+\else
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+\fi
+\usepackage[main=bulgarian,english]{babel}
+%
+\newcommand\TeXhax{\TeX hax}
+\newcommand\babel{\textsf{babel}}
+\newcommand\langvar{$\langle\it lang \rangle$}
+\newcommand\note[1]{}
+\newcommand\Lopt[1]{\textsf{#1}}
+\newcommand\file[1]{\texttt{#1}}
+\newcommand\pkg[1]{\texttt{#1}}
+%\AtBeginDocument{\OnlyDescription} % uncomment to print only the user's guide
+% Indexes
+\AtBeginDocument{\CodelineIndex}
+%\PageIndex % Index code by page number
+\AtBeginDocument{\EnableCrossrefs}
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\AtBeginDocument{\RecordChanges} % Gather update information
+% print the indexes
+\AtEndDocument{\PrintIndex}
+\AtEndDocument{\PrintChanges}
+% To process the indexes do (see the documentation of 'doc'):
+% makeindex -s gind.ist bulgarian.idx
+% makeindex -s gglo.ist -o bulgarian.gls bulgarian.glo
+\DoNotIndex{%
+ \cyra,\cyrb,\cyrv,\cyrg,\cyrd,\cyre,\cyrzh,\cyrz,\cyri,\cyrishrt%
+ ,\cyrk,\cyrl,\cyrm,\cyrn,\cyro,\cyrp,\cyrr,\cyrs,\cyrt,\cyru,\cyrf%
+ ,\cyrh,\cyrc,\cyrch,\cyrsh,\cyrshch,\cyrhrdsn,\cyrsftsn,\cyryu,\cyrya%
+ ,\cyrery,\cyrerev,\cyrii,\cyryar
+ ,\CYRA,\CYRB,\CYRV,\CYRG,\CYRD,\CYRE,\CYRZH,\CYRZ,\CYRI,\CYRISHRT%
+ ,\CYRK,\CYRL,\CYRM,\CYRN,\CYRO,\CYRP,\CYRR,\CYRS,\CYRT,\CYRU,\CYRF%
+ ,\CYRH,\CYRC,\CYRCH,\CYRSH,\CYRSHCH,\CYRHRDSN,\CYRSFTSN,\CYRYU,\CYRYA%
+ ,\CYRERY,\CYREREV,\CYRII,\CYRYAR
+ ,\def,\edef,\else,\fi,\if
+}
+
+
+\begin{document}
+\GetFileInfo{bulgarian.dtx}
+
+\title{The Bulgarian language definition file \\
+ for the \babel\ system\footnote{The file described in this
+section has version number \fileversion\ and was last revised on
+\filedate.} \\[0.5em]
+ \large Version \fileversion}
+
+\author{Georgi N. Boshnakov\footnote{
+The original, non-babel, version (bulgaria.sty) was developed by Georgi
+N. Boshnakov in 1994--1996. It was later adapted for \babel{} by Georgi
+N. Boshnakov and Johannes Braams using as a template the August-1998
+version of \file{russianb.dtx} and heavily borrowing code from there. I
+am also grateful to Vladimir Volovich for his helpful and timely
+advice.
+For versions 1.1-1.2 of the Bulgarian style, significant additions and
+modification to the code were made and the user manual was almost
+completely rewritten.}
+%
+%\footnote{Current maintainer}
+%and
+%Johannes Braams\footnote{Maintainer from 1998-2008}
+%
+}
+
+\date{\filedate}
+
+\maketitle
+
+{\small\tableofcontents}
+
+
+\section{Introduction}
+
+This file provides Bulgarian language support for the \babel{} system.
+
+This version of the Bulgarian style is the first public revision afer the release of version
+3.9 of \babel{} but it should be compatible with previous versions of \babel. More
+specifically, documents that compile successfully with the last version of \babel{} before
+3.9 should continue to compile.
+% The main purpose of this release of the Bulgarian style is to establish if this statement
+% is true.
+The documentation is draft, suggestions and meaningful examples are welcome.
+
+This version corrects some bugs and introduces support for Luatex and
+XeTeX. The documentation has been rewritten (to a large extent).
+A few other small changes have been made as well, see the index
+of changes at the end of this document for details.
+
+Please report any bugs to the current maintainer (Georgi N. Boshnakov).
+
+
+
+% For The Bulgarian language the character |"| is made active. % | to make Emacs
+ % fontification happy
+
+\section{User guide}
+
+
+\subsection{Settings things up}
+\label{sec:settings-things-up}
+
+The Bulgarian style described in this document is used by supplying
+|bulgarian| as one of the language options to \babel{} when loading it.
+If more than one language is requested, the last one designates the main
+language of the document and it will be active after |begin{document}|.
+For example, the command
+\begin{verbatim}
+ \usepackage[english,bulgarian]{babel}
+\end{verbatim}
+loads \babel{} with the English and Bulgarian styles and sets Bulgarian
+as the main language.
+
+For recent versions of \babel{} the main language can be specified also
+with the help of the option |main|:
+\begin{verbatim}
+ \usepackage[main=bulgarian,english]{babel}
+\end{verbatim}
+
+
+For typesetting with the classic engines, \LaTeX{} and pdf\LaTeX{}, it
+is also necessary to specify the encoding of the source file (input
+encoding) and the font encoding. For the unicode based engines,
+LuaLaTeX and Xetex, this is not necessary but but one needs to specify
+fonts. These issues are briefly considered below.
+
+
+\subsubsection{Settings for LaTeX and pdfLaTeX }
+\label{sec:latex}
+
+Here is a template to be inserted towards the beginning of the main
+\LaTeX{} file, after the |documentclass| command:
+\begin{verbatim}
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[bulgarian]{babel}
+\end{verbatim}
+This assumes UTF-8 encoded file. If this is not the case, |utf8| should
+be replaced by the actual encoding, most likely |cp1251|:
+\begin{verbatim}
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[cp1251]{inputenc}
+ \usepackage[bulgarian]{babel}
+\end{verbatim}
+If the input encoding is not specified (i.e. the corresponding line
+above is missing), a warning is issued in the log file and \LaTeX{}
+still tries to typeset the document. It may be sucessful but it is
+better to specify the encoding explicitly.
+
+The options for |fontenc| may look misterious but it is safe to ignore
+the details and simply insert the above command as is. Basically, |T1|
+and |T2A| can be considered standard \TeX{} encodings for the Latin
+and Cyrillic letters, respectively. |T2A| contains Latin letters, as
+well, so |\usepackage[T2A]{fontenc}| is often good enough.
+
+Actually, the encodings have some fallback defaults and a document may
+compile successfully even if one or both of |fontenc| and |inputenc| are
+omitted. However, it is a good idea to supply explicit |inputenc| in any
+case.
+
+
+The support provided by \texttt{inputenc} package for unicode symbols is not
+complete. If \LaTeX{} complains about undefined or unknown unicode
+symbols, there is the alternative to use package |ucs| and specify
+|utf8x| for inputenc, as in:
+\begin{verbatim}
+ \usepackage{ucs}
+ \usepackage[utf8x]{inputenc}
+\end{verbatim}
+In many cases this simply works. Otherwise see the documentation of
+package |ucs| for further details.
+
+
+\subsubsection{Settings for Lualatex}
+\label{sec:lualatex}
+
+Lualatex requires that the source file is in UTF-8 encoding. It requires
+also the specification of fonts. This is done by loading package
+|fontspec| (attention: not |fontenc|) and issuing a sequence of font
+setting commands. The following can be used to arrange for the unicode
+versions of the traditional Computer Roman fonts to be used in the
+document:
+\begin{verbatim}
+ \usepackage{fontspec}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,bulgarian]{babel}
+\end{verbatim}
+Any system fonts can be used instead. For example, the main font command
+above could be replaced by the following:
+\begin{verbatim}
+ \setmainfont[Ligatures=TeX]{Times New Roman}
+\end{verbatim}
+Package |fontspec| offers a lot of flexibility for the font selection,
+see its documentation.
+%Another useful template is
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Renderer=Basic,Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% ...
+% \usepackage[english,bulgarian]{babel}
+% \end{verbatim}
+%
+
+\paragraph{Compatibility mode}
+
+Lualatex can be set up to use 8-bit fonts if the Unicode fonts do not
+work for some reason. Note that the source file still needs to be in
+UTF-8! Here is a template for this (the difference from \LaTeX{} is in
+the second line):
+\begin{verbatim}
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,bulgarian]{babel}
+\end{verbatim}
+The compatibility mode is a remedy for emergencies, not for routine
+use.
+
+
+\subsection{Switching to and from Bulgarian language}
+\label{sec:switch-from-bulg}
+
+The language at the beginning of the document, i.e. after
+|\begin{document}|, is determined by the options used to load package
+ \babel. Several ways of changing the language are available,
+ depending on what the user needs.
+
+
+
+\subsubsection{The most common case}
+\label{sec:typical-change}
+
+In the most common case the user just wants to typeset some piece of
+text in a different language, using the typesetting and hyphenation
+rules of that language, without changing generic strings like
+|\today|, names of sections and things like |\proofname| to the chosen
+language. This can be done with the command |\foreignlanguage| or the
+environment |otherlanguage*|.
+
+Here are some unimaginative examples to illustrate this. Here is a
+phrase in Bulgarian %we need to change to english to pretend
+\selectlanguage{english}%that English is the main language!
+ \foreignlanguage{bulgarian}{"`тази дата е форматирана по
+ американския начин: \today"'},
+\selectlanguage{bulgarian}
+typeset in a sentence written in English. This phrase was typeset as
+follows:
+\begin{verbatim}
+ \foreignlanguage{bulgarian}{"`тази дата е форматирана
+ по американския начин: \today"'}
+\end{verbatim}
+For longer pieces of text it is more convenient to use the equivalent
+environment.
+\begin{verbatim}
+\begin{otherlanguage*}{bulgarian}
+ Това е пример за американския начин за форматиране на дати: \today.
+ А тук думата \proofname е отпечатана с командата |\proofname|.
+\end{otherlanguage*}
+\end{verbatim}
+Notice the `*' in the name of the environment.
+The result is:
+
+\selectlanguage{english}
+\begin{quote}
+\begin{otherlanguage*}{bulgarian}
+ Това е пример за американския начин за форматиране на дати: \today.
+ А тук думата \proofname{} е отпечатана с командата |\proofname|.
+\end{otherlanguage*}
+\end{quote}
+\selectlanguage{bulgarian}
+
+
+Notice that the date and the heading for a proof are still in English.
+To change these and similar language dependent strings we need a total
+change of language. This is discussed below.
+
+
+\subsubsection{Total change of language}
+\label{sec:total-change-lang}
+
+The \babel{} system controls a number of typesetting features for each
+language. The command |\selectlanguage| is used to do a complete
+change to a new language. For example, |\selectlanguage{bulgarian}|
+switches every aspect of the \babel{} system to Bulgarian language. For
+example, the following snippet: {
+\begin{verbatim}
+ \selectlanguage{bulgarian}
+ Този документ е компилиран на \today.
+
+ Думата "`\proofname"'{} е отпечатана с командата |\proofname|.
+ \selectlanguage{english}
+ Some English text...
+\end{verbatim}
+}
+
+\noindent
+produces:
+\begin{quote}
+ \selectlanguage{bulgarian}
+ Този документ е компилиран на \today.
+
+ Думата "`\proofname"'{} е отпечатана с командата |\proofname|.
+ \selectlanguage{english}
+ Some English text...
+\end{quote}
+\selectlanguage{bulgarian}
+
+
+Compare the result here to the similar example in the previous
+section. Now everything is changed, including |\today| and other
+names.
+
+\subsubsection{Compatibility commands for change of language}
+\label{sec:comm-prov-bulg}
+
+Version 1.1 of the Bulgarian style continues to provide a number of
+additional commands for change of language. They are kept mainly for
+compatibility with older versions of the Bulgarian style and their use
+is discouraged.
+
+The command |\Bulgarian| changes only the hyphenation patterns and the
+encoding. It does not make a complete change of language and is really
+suitable for short fragments which do not contain special
+features. This may cause trouble in some cases, e.g. with |aux| files.
+Similarly, the command |\English| switches to the English language. It
+is left for compatibility.
+
+
+For historical and compatibility reasons with ancient version of the
+Bulgarian style, there are also several abbreviations equivalent to
+|\Bulgarian|. These are: |\Bul|, |\Bg|, |\cyrillictext|, |\cyr|. Also,
+|\selectbglanguage| is equivalent to |\selectlanguage{bulgarian}|.
+
+Similarly, |\Eng| is equivalent to |\English| and |\selectenglanguage|
+is equivalent to |\selectlanguage{english}|.
+
+
+
+
+
+
+\subsection{Quotation marks}
+
+Quotation marks with typographic quality used to be a problem in the
+past. They were not available on typewrites and keyboards. Moreover,
+the opening quotes used in Bulgarian typesetting were not available in
+the standard fonts and needed to be generated by other means. With
+modern computers, fonts and editing programs it is no longer a problem
+to enter directly the correct opening and closing quotation marks,
+especially when Unicode based encodigs are in use.
+
+Nevertheless, commands and shorthands are convenient. The special
+commands for quotation marks available for the Bulgarian language are
+shown in Table~\ref{tab:bulgarian-quote}.
+\begin{table}[htb]
+ \begin{center}
+ \begin{tabular}{llp{8cm}}
+ Command & Shorthand & Meaning \\ \hline
+ |\glqq| & |"`| & for German left double quotes (looks like,\kern-0.08em,). \\
+ |\grqq| & |"'| & for German right double quotes (looks like ``).\\^^A%''
+ |\flqq| & |"<| & for French left double quotes (looks like $<\!\!<$).\\
+ |\frqq| & |">| & for French right double quotes (looks like $>\!\!>$).\\
+ |\dq| & & the original quotes character (|"|). % |
+ \end{tabular}
+ \caption{Special quotes available for Bulgarian typesetting}
+ \label{tab:bulgarian-quote}
+ \end{center}
+\end{table}
+The German quotes are the current norm. The French ones can be
+found mostly in older texts.
+
+The French quotes are also available as ligatures `|<<|' and
+`|>>|' in 8-bit Cyrillic font encodings (\texttt{LCY},
+\texttt{X2}, \texttt{T2*}) and as `|<|' and `|>|' characters in
+7-bit Cyrillic font encodings (\texttt{OT2} and \texttt{LWN}).
+
+
+\subsection{Hyphens and dashes}
+
+The em-dash in Bulgarian texts is used for several purposes.
+Table~\ref{tab:bulgarian-emdash} shows the available commands and
+their intended contexts. The second column shows also the
+shorthands that are usually used to enter these dashes.
+\begin{table}[htb]
+ \begin{center}
+ \begin{tabular}{llp{7.8cm}}
+ Command & Shorthand & Meaning \\ \hline
+ |\cdash---| & |"---| & Cyrillic emdash in plain text. \\
+ |\cdash--~| & |"--~| & Cyrillic emdash in compound names (surnames). \\
+ |\cdash--*| & |"--*| & Cyrillic emdash for denoting direct speech.
+ \end{tabular}
+ \caption{The emdashes available for Bulgarian typesetting}
+ \label{tab:bulgarian-emdash}
+ \end{center}
+\end{table}
+
+
+\subsection{Hyphenation control}
+
+Table~\ref{tab:bulgarian-hyphen} gives commands for hyphenation
+control. Most of them aim to facilitate hyphenation in compound words
+and related circumstances.
+
+
+\begin{table}
+ \centering
+ \begin{tabular}{ll}
+ \LaTeX{} source & Typeset output \\ \hline
+ |П. П. Славейков| & П. П. Славейков \\
+ |П.",П.",Славейков| & П.",П.",Славейков
+ \end{tabular}
+ \caption{Example for initials spaced out by ordinary space (first line) and the
+ special command (second line). The command leaves a smaller, more visually
+ appealing space. It also allows hyphenation of the surname, although
+ this is not visible here.}
+\end{table}
+
+% П.",П.",Славейков
+
+\begin{table}[htb]
+ \begin{center}
+ \begin{tabular}{lp{8cm}}
+ Shorthand & Meaning \\ \hline
+ |"-| & an explicit hyphen sign, allowing hyphenation
+ in the rest of the word. \\
+ |""| & like |"-|, but producing no hyphen sign
+ (for compound words with hyphen, e.g.\ |x-""y|
+ or some other signs as ``disable/enable''). \\
+ |"~| & for a compound word mark without a breakpoint. \\
+ |"=| & for a compound word mark with a breakpoint, allowing
+ hyphenation in the composing words. \\
+ |",| & thinspace for initials with a breakpoint
+ in following surname. \\
+ \end{tabular}
+ \caption{Extra definitions, mainly for hyphenation control}
+ \label{tab:bulgarian-hyphen}
+ \end{center}
+\end{table}
+Hyphenating words containing a hyphen is not particularly desirable
+but may be necessary not only for long compounds words like
+министър-председател (prime minister), but also for comparative and
+superlative adjectives like по-""красноречива (more eloquent) or
+най-""безопасният (the safest), since the Bulgarian equivalents of
+`more' and `most' are connected to the adjective by a hyphen. Even so,
+when the line width is not short, which is the case for this document,
+\TeX{} is usually able to avoid hyphenating such words. In this
+paragraph one of the example words is hyphenated only because I
+deliberately edited it until this happened.
+
+
+\subsection{Other shorthands}
+%\label{sec:other-commands}
+
+Table~\ref{tab:lig} gives some additional shorthands.
+Currently there is only one entry and it concerns ligatures.
+Ligatures are not common in Bulgarian texts. A ligature is used to
+replace a sequence of two or more symbols by a more visually appealing
+glyph. This topic is not of much importance for typesetting Bulgarian
+texts and is beyond the scope of this document.
+For example, two dashes, `|--|', normally form a ligature to produce an
+en-dash, `--'. The command \verb+"|+ provides a way to prevent the
+formation of the ligature. So, `\verb+-"|-+' gives
+\DeleteShortVerb{\|}
+ `-"|-'.
+\MakeShortVerb{\|} % |
+
+\begin{table}[htb] % \label{tab:lig} - If I put the label here, the
+ % reference to this table is with two numbers
+ % like 2.5 rather than 5, as in other places!
+ % :TODO: incestigate!
+ \begin{center}
+ \begin{tabular}{lp{8cm}}
+ Shorthand & Meaning \\ \hline
+ \verb="|= & disable ligature at this position.
+ \end{tabular}
+ \caption{Extra shorthands.}
+ \label{tab:lig}
+ \end{center}
+\end{table}
+
+\subsection{Dates}
+\label{sec:dates}
+
+The command |\today| prints the current date. It is in Bulgarian if that
+is the active language, see also Section~\ref{sec:switch-from-bulg}.
+Alternatively, the command |\todayRoman| prints the current date using
+Roman numerals for months.
+So, when this document is compiled, |\today| and |\todayRoman|
+give "`\today"' and "`\todayRoman"', respectively.
+
+
+Note: Following a suggestion by Boyko Bantchev, the space between the
+year and `г.' was reduced in version 1.2b of this style.
+
+% \monthivname{}
+
+The command |\weekdaynamebulgarian| can be used to typeset the names of
+the days of the week. It is mostly intended for use in macros and has
+one argument, the number of the required day of the week. For example,
+|\weekdaynamebulgarian{1}| and
+|\weekdaynamebulgarian{7}|
+give
+\weekdaynamebulgarian{1} and
+\weekdaynamebulgarian{7},
+respectively.
+
+% \weekdayiname{} \weekdayiiname{}
+
+
+\subsection{Enumerations}
+
+The traditional alphabetical enumerations in Bulgarian texts use the
+Cyrillic alphabet (bar several letters). In principle, enumerations are
+a matter for class and style designers but the same can be said also
+about things, other than enumerations, such as names of sections and
+bibliography lists.
+% The alphabet is not the only difference differences are not only
+% in the letters --- Bulgarian authors generally prefer labels formatted
+% as `a)' rather than `(a)'.
+
+The Bulgarian style by default turns on enumeration with Cyrillic
+letters. This means that enumerated lists that would be labelled with
+Latin letters in Latin scripts are labelled with Cyrillic ones instead.
+
+This automatic feature may not always be desirable, so Version 1.1d of
+the Bulgarian style streamlines somewhat the support for Cyrillic
+enumerations. For compatibility with older documents, the default is
+still to turn on the Bulgarian enumerations when the active language is
+Bulgarian but facilities to control this are provided.
+
+The Cyrillic enumeration can also be turned on and off selectively for
+parts of the document using the commands |\abvon| and |\abvoff|.
+The command |\abvoff| turns off the Cyrillic enumeration.
+The command |\abvon| turns it on. It is thus possible to turn
+the feature on and off for parts of the document.
+
+The user can turn off the Cyrillic enumeration by using attribute
+`abvoff' when loading \babel, e.g.
+\begin{verbatim}
+ \usepackage[english,bulgarian .abvoff]{babel}
+\end{verbatim}
+The dot in front of the attribute's name is required and tells \babel{}
+that this is an attribute.
+
+\subsection{Mathematical functions}
+\label{sec:math-funct}
+
+The Bulgarian style provides definitions
+for some mathematical functions whose names differ from the
+corresponding English names.
+
+Currently these functions are:
+|\tg|,
+|\ctg|,
+|\cosec|,
+|\arctg|,
+|\arcctg|,
+|\sh|,
+|\ch|,
+|\cth|.
+
+
+\subsection{Troubleshooting}
+\label{sec:handl-cyrill-lett}
+
+The standard font encoding handling for Cyrillic letters in non-Uniceode
+encodings is based on
+definitions like |\CYRA| for the Cyrillic letters. These are not
+necessary for unicode engines (Luatex, XeTeX) but may still be
+present in other packages (for example |varioref|) that handle
+different languages by storing hard coded strings.
+
+If your document is using a Unicode encoding, most likely UTF-8, and you
+get errors like "`undefined command |\CYRA|"', then
+the command |\cyrxtounicode| may be used as an emergency patch.
+It is not to be used routinely as its use may hide
+unrelated bugs. Just put it at the beginning of your document.
+
+
+
+
+\section{History}
+
+\subsection{Changes in version 1.2}
+
+The user visible changes are in the documentation.
+
+The minor version number was changed from 1 to 2 (hence 1.2 rather than
+1.1) to accomodate a change in \babel{}~3.9g which removed the command
+|UseStrings| and replaced it with a starred version of
+\cs{StartBabelCommands}.
+
+
+\subsection{Changes in version 1.1}
+
+This is the first release after the individual languages were taken out
+of the core \babel{} system (\babel{} version 3.9f). Some of the most
+visible changes:
+
+\begin{itemize}
+\item Support for LuaTeX and XeTeX;
+\item Documentation rewritten;
+\item Facilities for turning on and off automatic Bulgarian enumeration;
+\item Some long standing bugs fixed. In particular, it should no longer
+ be necessary to load |amsmath| before \babel.
+
+
+\end{itemize}
+For more details on the changes, see the "`Change history"' index at
+the end of this document.
+
+
+\subsection{Changes in version 1.0a--1.0g}
+
+Bug fixes and small changes by Johannes Braams.
+
+
+\subsection{Version 1.0}
+
+Johannes Braams modified (and improved) the original draft to conform to
+the \babel{} system and incorporated \file{\filename} into it.
+
+
+\subsection{Older versions}
+
+The first draft of the Bulgarian style for \babel{} was created by
+modifying the August-1998 version of \file{russianb.dtx} for the
+Bulgarian language along the lines of the 1994/1996 (non-babel)
+Bulgarian style (\file{bulgaria.sty}) by Georgi N. Boshnakov. It is
+(reasonably) backward compatible with that style---files prepared for
+that style should compile successfully (with vastly improved appearance
+due to usage of standard fonts).
+
+ % Users should take note of the vaious ``cyrillic'' dashes
+ % available now (see below). These should remove many causes of
+ % headache. Also, although by default the Bulgarian quotation marks
+ % will appear automatically when typesetting in Bulgarian, it is
+ % better to use the new commands |"`| and |"'| which
+ % explicitly typeset them.
+ % Note: automatic switch to Bulgarian quotation is withdrawn
+ % for the moment and may not be reintroduced at all.
+ %
+
+
+
+\DocInput{bulgarian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \StopEventually{}
+%
+% \GetFileInfo{bulgarian.dtx}
+%
+% \section{Implementation}
+%
+% \changes{bulgarian-0.99}{2000/06/10}{
+% This is a prerelease version of this file.
+% Features needing further testing are removed.}
+%
+% \changes{bulgarian-1.2a}{2013/09/23}{Switch to babel 3.9g which
+% replaced \cs{UseStrings} with a mechanism based on starred
+% \cs{StartBabelCommands} commands.}
+%
+% \changes{bulgarian-1.2d}{2013/10/02}{Substantial clean-up of the
+% code and comments. In particular, removed commented out old code.}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{bulgarian}{captionsbulgarian}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{bulgarian} will be an `unknown' language, in
+% which case we have to make it known. So we check for the
+% existence of |\l@bulgarian| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\l@bulgarian\@undefined
+ \@nopatterns{Bulgarian}
+ \adddialect\l@bulgarian0
+\fi
+% \end{macrocode}
+%
+% New in version 1.1: detect luatex or xetex. The code is taken from
+% russinab.dtx but the counter is renamed to avoid possible conflicts.
+% \begin{macrocode}
+\newif\if@bul@unicode
+\ifdefined\luatexversion \@bul@unicodetrue \else
+\ifdefined\XeTeXrevision \@bul@unicodetrue \fi\fi
+% \end{macrocode}
+%
+%
+%
+% \subsection{Font encodings}
+% \label{sec:font-encodings}
+%
+%
+% \begin{macro}{\latinencoding}
+% \changes{bulgarian-1.1}{2013/06/08}{Removed.}
+%
+% We need to know the fond encoding for text that is supposed to be
+% active at the end of the \babel\ package. This is effectively assumed
+% to be a Latin encoding and the macro \cs{latinencoding}, defined by
+% \babel{}, contains the name of the Latin encoding.
+%
+% \end{macro}
+%
+% \begin{macro}{\cyrillicencoding}
+% We need also to determine the encoding for Cyrillic text. It is
+% normally loaded by the |fontenc| package. These days it is usually
+% \texttt{T2A}.
+%
+% We parse the |\cdp@list| containing the encodings known to \LaTeX\
+% in the order they were loaded. We set the |\cyrillicencoding| to the
+% \emph{last} loaded encoding in the list of supported Cyrillic
+% encodings: \texttt{OT2}, \texttt{LWN}, \texttt{LCY},
+% \texttt{X2}\footnote{Encoding \texttt{X2} does not contain Latin
+% letters and users should be very careful to switch the language
+% every time they want to typeset a Latin word inside a Bulgarian
+% phrase or vice versa.}, \texttt{T2C}, \texttt{T2B}, \texttt{T2A}, if
+% any.
+%
+%
+% \begin{macrocode}
+\def\reserved@a#1#2{%
+ \edef\reserved@b{#1}%
+ \edef\reserved@c{#2}%
+ \ifx\reserved@b\reserved@c
+ \let\cyrillicencoding\reserved@c
+ \fi}
+\def\cdp@elt#1#2#3#4{%
+ \reserved@a{#1}{OT2}%
+ \reserved@a{#1}{LWN}%
+ \reserved@a{#1}{LCY}%
+ \reserved@a{#1}{X2}%
+ \reserved@a{#1}{T2C}%
+ \reserved@a{#1}{T2B}%
+ \reserved@a{#1}{T2A}}
+ \cdp@list
+% \end{macrocode}
+%
+% \changes{bulgarian-1.1b}{2013/06/12}{%
+% Changing completely the handling of the case when
+% \cs{cyrillicencoding} is not defined, see russianb.dtx.
+% The old code is commented out.}
+%
+% \changes{bulgarian-1.2d}{2013/10/02}{%
+% Deleted the the old code for the case when the user did not
+% specify font encoding (it had been already commented out in
+% version 1.1b).}
+%
+% If |\cyrillicencoding| is undefined, then the user did not load any
+% of the supported encodings. The code below is new in version 1.1 of
+% this file and considers also the active \TeX{} engine. It was
+% inspired by russianb.dtx. We set a sensible default
+% |\cyrillicencoding| but still issue a warning to alert the user that
+% a default font encoding is used.
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \if@bul@unicode
+ \ifdefined\XeTeXrevision
+ \edef\cyrillicencoding{EU1}
+ \else\ifdefined\luatexversion
+ \edef\cyrillicencoding{EU2}
+ \fi\fi
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{bulgarian.ldf}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+% \end{macrocode}
+%
+% We avoid |\usepackage[\cyrillicencoding]{fontenc}| because we
+% don't want to force the switch of |\encodingdefault|.
+% \begin{macrocode}
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+\fi
+% \end{macrocode}
+%
+% \changes{bulgarian-1.1a}{2013/06/12}{PackageInfo was commented out, uncommented it}
+% \begin{macrocode}
+\PackageInfo{babel}
+ {Using `\cyrillicencoding' as a default Cyrillic encoding}%
+% \end{macrocode}
+% \unskip
+%
+% \end{macro}
+%
+% TODO: add |\English| to the extras for Bulgarian. It should not be
+% defined globally as it may be defined at a more appropriate place elsewhere.
+% In any case, the value of these abbreviations is limited as they do
+% not do a complete switch of language.
+%
+% The following commands are shorthands for switching to Bulgarian and
+% English. They are present here mainly for compatibility with older
+% versions of the Bulgarian style.
+% \begin{macro}{\Bulgarian}
+% A simple switch to Bulgarian language:
+% \begin{macrocode}
+\DeclareRobustCommand{\Bulgarian}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\bulgarianhyphenmins
+ \language\l@bulgarian}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\English}
+% A simple switch, similar to the above, but to the English language:
+% \begin{macrocode}
+\DeclareRobustCommand{\English}{%
+ \fontencoding\latinencoding\selectfont
+ \let\encodingdefault\latinencoding
+ \expandafter\set@hyphenmins\englishhyphenmins
+ \language\l@english}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Bul}
+% \begin{macro}{\Bg}
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\cyr}
+% \begin{macro}{\Eng}
+% \begin{macro}{\selectenglanguage}
+% \begin{macro}{\selectbglanguage}
+% Finally, a few shorthands for switching the languages. These are
+% mostly remnants from pre-babel times.
+% \begin{macrocode}
+\let\Bul\Bulgarian
+\let\Bg\Bulgarian
+\let\cyrillictext\Bulgarian
+\let\cyr\Bulgarian
+\let\Eng\English
+\def\selectenglanguage{\selectlanguage{english}}
+\def\selectbglanguage{\selectlanguage{bulgarian}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%\subsubsection{Adjustments for X2 encoding}
+%
+% The code in this section is executed only if the font encoding is
+% \texttt{X2}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+% \end{macrocode}
+%
+% We put |\latinencoding| in braces to avoid problems with |\@alph|
+% inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% \changes{bulgarian-1.0c}{2003/06/14}{Added missing closing brace}
+% \begin{macrocode}
+\def\@Alph@eng#1{{\fontencoding{\latinencoding}\selectfont \ifcase#1\or
+ A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or
+ N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else
+ \@ctrerr\fi}}%
+\def\@alph@eng#1{{\fontencoding{\latinencoding}\selectfont \ifcase#1\or
+ a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or
+ n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
+ \@ctrerr\fi}}%
+ \let\@Alph\@Alph@eng
+ \let\@alph\@alph@eng
+% \end{macrocode}
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding
+% dependent in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are
+% defined as |\r{A}| and |\r{a}|. This leads to unpredictable
+% results when the font encoding does not contain the Latin letters
+% `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+\fi
+% \end{macrocode}
+%
+%
+% \changes{bulgarian-1.1a}{2013/06/12}{Commenting out the code in
+% section ``Some Greek letters for maths'', which is not needed any
+% more. This also resolves a trouble with amsmath, which made it
+% necessary in the past to load the latter before babel.}
+%
+% \changes{bulgarian-1.2d}{2013/10/02}{Removed section "`Some Greek
+% letters for maths"'. The command had already been commented out in
+% version 1.1a.}
+%
+%
+%\subsection{Input encoding}
+%
+%
+% For \LaTeX{}, pdf\LaTeX{}, and compatibility mode of Lua\LaTeX{}, the
+% user should use the \pkg{inputenc} package (before loading \babel) to
+% specify the encoding of the input file\footnote{After the changes in
+% version 1.1b of |bulgarian.dtx|, if the font and input encoding are
+% \texttt{T2A} and \texttt{cp1251}, respectively, the document might be
+% processed correctly even without the |inputenc| package. Even so, it
+% is better to be explicit about the input encoding.}. For the Unicode
+% engines this is not necessary, as they require Unicode based encoding.
+%
+% We issue a warning if the input encoding has not been specified but do
+% not consider this an error.
+%
+% \changes{bulgarian-1.1b}{2013/06/12}{Added EU1 and EU2 and removed
+% LWN}
+% \changes{bulgarian-1.1b}{2013/06/12}{Produce warning rather then
+% an error when inputenc has not been loaded}
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{%
+ \if@bul@unicode
+ \PackageWarning{bulgarian.ldf}{inputenc should not be used with LuaTeX or XeTeX}
+ \fi
+}{%
+ %\def\reserved@a{LWN}%
+ %\ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{OT2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{EU1}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{EU2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \PackageWarning{bulgarian.ldf}%
+ {No input encoding specified for Bulgarian language}
+ \fi\fi\fi
+ %\fi
+}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\latintext}
+% \begin{macro}{\lat}
+%
+%\subsection{Switching between Cyrillic and Latin encodings}
+%
+% The command |\cyrillictext| will switch from Latin font encoding to
+% the Cyrillic font encoding, the command |\latintext| switches back.
+% We add the shorthand |\lat| for |\latintext|. This assumes that the
+% `normal' font encoding is a Latin one. These commands are
+% \emph{declarations}, for shorter peaces of text the commands
+% |\textlatin| and |\textcyrillic| can be used.
+%
+% |\latintext| is defined in the core of \babel, while |\cyrillictext|
+% is defined above.
+%
+% \begin{macrocode}
+\let\lat\latintext
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\textcyrillic}
+% \begin{macro}{\textlatin}
+%
+% These commands take an argument which is then typeset using the
+% requested font encoding. |\textlatin| is defined in the core of
+% babel. (It is defined there with |\DeclareRobustCommand| instead.)
+%
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%\subsection{Captions for Bulgarian}
+%
+%
+%
+% If |\bbl@version| is undefined we use the old approach (using
+% |\addto| commands).
+% \begin{macrocode}
+\ifx\bbl@version\@undefined
+\PackageInfo{bulgarian.ldf}{Executing the pre 3.9 branch for captions}
+% \end{macrocode}
+%
+% \subsubsection{Captions for pre3.9 babel}
+%
+% \begin{macro}{\captionsbulgarian}
+%
+% The macro |\captionsbulgarian| defines all strings used in the
+% four standard document classes provided with \LaTeX. The two
+% commands |\cyr| and |\lat| activate Cyrillic, resp. Latin, encoding.
+%
+% \changes{bulgarian-1.1}{2013/06/08}{Added translation for Proof}
+% \changes{bulgarian-1.1}{2013/06/08}{Added translation for
+% Glossary. todo: need to check if this is appropriate.}
+% \begin{macrocode}
+\addto\captionsbulgarian{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
+ \def\refname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrb\cyrs\cyrt\cyrr\cyra\cyrk\cyrt}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
+ \def\chaptername{%
+ {\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+ \def\contentsname{%
+ {\cyr\CYRS\cyrhrdsn\cyrd\cyrhrdsn\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}%
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\
+ \cyrf\cyri\cyrg\cyru\cyrr\cyri\cyrt\cyre}}%
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\
+ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyri\cyrt\cyre}}%
+ \def\indexname{%
+ {\cyr\CYRA\cyrz\cyrb\cyru\cyrch\cyre\cyrn\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyre\cyrn\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \def\figurename{%
+ {\cyr\CYRF\cyri\cyrg\cyru\cyrr\cyra}}%
+ \def\tablename{%
+ {\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{%
+ {\cyr\CYRCH\cyra\cyrs\cyrt}}%
+ \def\enclname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}}%
+ \def\ccname{%
+ {\cyr\cyrk\cyro\cyrp\cyri\cyrya}}%
+ \def\headtoname{%
+ {\cyr\CYRZ\cyra}}%
+ \def\pagename{%
+ {\cyr\CYRS\cyrt\cyrr.}}%
+ \def\seename{%
+ {\cyr\cyrv\cyrzh.}}%
+ \def\alsoname{%
+ {\cyr\cyrv\cyrzh.\ \cyrs\cyrhrdsn\cyrshch\cyro\ \cyri}}%
+ \def\proofname{%
+ {\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{%
+ {\cyr\CYRP\cyrr\cyri\cyrt\cyru\cyrr\cyrk\cyra}}% Glossary: Притурка, Глосар?
+}%
+% \end{macrocode}
+% \end{macro}
+%%
+% \subsubsection{Captions for babel 3.9 or later}
+%
+% \begin{macrocode}
+\else
+\PackageInfo{bulgarian.ldf}{Executing the post 3.9 branch for captions}
+\StartBabelCommands*{bulgarian}{captions}[unicode, fontenc=EU1 EU2, charset=utf8]
+ \SetString\prefacename{Предговор}
+ \SetString\refname{Литература}
+ \SetString\abstractname{Абстракт}
+ \SetString\bibname{Библиография}
+ \SetString\chaptername{Глава}
+ \SetString\appendixname{Приложение} % todo: Апендикс ?
+ \SetString\contentsname{Съдържание}
+ \SetString\listfigurename{Списък на фигурите}
+ \SetString\listtablename{Списък на таблиците}
+ \SetString\indexname{Азбучен указател}
+ \SetString\authorname{Именен указател}
+ \SetString\figurename{Фигура}
+ \SetString\tablename{Таблица}
+ \SetString\partname{Част}
+ \SetString\enclname{Приложения}
+ \SetString\ccname{копия}
+ \SetString\headtoname{За}
+ \SetString\pagename{Стр.} % todo: shouldn't this be all lowercase?
+ \SetString\seename{вж.}
+ \SetString\alsoname{вж. също и}
+ \SetString\proofname{Доказателство}
+ \SetString\glossaryname{Притурка}
+
+\StartBabelCommands*{bulgarian}{captions}
+ \SetString\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
+ \SetString\refname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \SetString\abstractname{%
+ {\cyr\CYRA\cyrb\cyrs\cyrt\cyrr\cyra\cyrk\cyrt}}%
+ \SetString\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
+ \SetString\chaptername{%
+ {\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \SetString\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+ \SetString\contentsname{%
+ {\cyr\CYRS\cyrhrdsn\cyrd\cyrhrdsn\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}%
+ \SetString\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\
+ \cyrf\cyri\cyrg\cyru\cyrr\cyri\cyrt\cyre}}%
+ \SetString\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\
+ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyri\cyrt\cyre}}%
+ \SetString\indexname{%
+ {\cyr\CYRA\cyrz\cyrb\cyru\cyrch\cyre\cyrn\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \SetString\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyre\cyrn\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
+ \SetString\figurename{%
+ {\cyr\CYRF\cyri\cyrg\cyru\cyrr\cyra}}%
+ \SetString\tablename{%
+ {\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \SetString\partname{%
+ {\cyr\CYRCH\cyra\cyrs\cyrt}}%
+ \SetString\enclname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}}%
+ \SetString\ccname{%
+ {\cyr\cyrk\cyro\cyrp\cyri\cyrya}}%
+ \SetString\headtoname{%
+ {\cyr\CYRZ\cyra}}%
+ \SetString\pagename{%
+ {\cyr\CYRS\cyrt\cyrr.}}%
+ \SetString\seename{%
+ {\cyr\cyrv\cyrzh.}}%
+ \SetString\alsoname{%
+ {\cyr\cyrv\cyrzh.\ \cyrs\cyrhrdsn\cyrshch\cyro\ \cyri}}%
+ \SetString\proofname{%
+ {\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrs\cyrt\cyrv\cyro}}%
+ \SetString\glossaryname{%
+ {\cyr\CYRP\cyrr\cyri\cyrt\cyru\cyrr\cyrk\cyra}}% Glossary: Притурка, Глосар?
+\EndBabelCommands
+\fi
+% \end{macrocode}
+%
+%
+%\subsection{Dates in Bulgarian}
+%
+% \changes{bulgarian-1.2b}{2013/09/26}{Change the ordinary space between
+% the date and g. to \cs{,} in \cs{today} and \cs{todayRoman} (suggested
+% by Boyko Bantchev).}
+%
+% The month is often written with Roman numbers in Bulgarian dates.
+% Below we define a version of \cs{today} in this format but here we
+% define a couple of potentially useful general commands.
+%
+% \begin{macro}{\month@Roman}
+% \begin{macro}{\Romannumeral}
+% |\Romannumeral| converts its argument to a capitalized Roman numeral.
+% |\month@Roman| gives the current month using capital Roman
+% numerals.
+% \begin{macrocode}
+\def\month@Roman{\expandafter\@Roman\month}%
+\def\Romannumeral#1{\uppercase\expandafter{\romannumeral #1}}
+%%% 2013-10-02 comment this out (it is repeated below):
+%%% \def\todayRoman{\number\day.\Romannumeral{\month}.\number\year\,\cyrg.}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% Define the dates of the switch from Julian to Gregorian calendar in Bulgaria.
+% \begin{macro}{\lastJulianDatebulgarian}
+% \changes{bulgarian-1.2e}{2013/10/10}{New macro.}
+% \begin{macro}{\firstGregorianDatebulgarian}
+% \changes{bulgarian-1.2e}{2013/10/10}{New macro.}
+% \begin{macro}{\weekdaynamebulgarian}
+% \changes{bulgarian-1.2e}{2013/10/10}{New macro.}
+% \begin{macrocode}
+\def\lastJulianDatebulgarian{19160331}
+\def\firstGregorianDatebulgarian{19160414}
+\def\weekdaynamebulgarian#1{\csname weekday\romannumeral#1 name\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Dates for pre3.9 babel}
+%
+% We use the new mechanism provided by \babel~v3.9 but for backward
+% compatibility, at least until version v3.9 of \babel{} becomes
+% ubiquitous we keep old code. The macro |\bbl@version| is undefined
+% in \babel{} versions prior to 3.9, so we use it.
+%
+% If |\bbl@version| is undefined we use the old approach
+% \begin{macrocode}
+\ifx\bbl@version\@undefined
+\PackageInfo{bulgarian.ldf}{Executing the pre 3.9 branch for dates}
+% \end{macrocode}
+%
+% \begin{macro}{\datebulgarian}
+%
+% The macro |\datebulgarian| redefines the command |\today| to
+% produce Bulgarian dates.
+% It also provides the command |\todayRoman| which produces the
+% date with the month in capital roman numerals, a popular format
+% for dates in Bulgarian.
+%
+% \begin{macrocode}
+\def\datebulgarian{%
+ \def\month@bulgarian{\ifcase\month\or
+ \cyrya\cyrn\cyru\cyra\cyrr\cyri\or
+ \cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or
+ \cyrm\cyra\cyrr\cyrt\or
+ \cyra\cyrp\cyrr\cyri\cyrl\or
+ \cyrm\cyra\cyrishrt\or
+ \cyryu\cyrn\cyri\or
+ \cyryu\cyrl\cyri\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\or
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or
+ \cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri\fi}%
+ \def\abbgyear{\cyrg.}
+
+ \def\today{\number\day~\month@bulgarian\ \number\year\,\abbgyear}%
+ \def\todayRoman{\number\day.\,\month@Roman.\,\number\year\,\abbgyear}%
+}%
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsubsection{Dates for babel 3.9 or later}
+%
+% \changes{bulgarian-1.2e}{2013/10/04}{Use \cs{SetStringLoop} for months}
+% \changes{bulgarian-1.2e}{2013/10/04}{Introduce names of days of week}
+%
+% \begin{macrocode}
+\else
+\PackageInfo{bulgarian.ldf}{Executing the post 3.9 branch for dates}
+\StartBabelCommands*{bulgarian}{date}[unicode, fontenc=EU1 EU2, charset=utf8]
+ \SetStringLoop{month#1name}{%
+ януари,февруари,март,април,май,юни,%
+ юли,август,септември,октомври,ноември,декември}
+
+ \SetStringLoop{weekday#1name}{%
+ понеделник,вторник,сряда,четвъртък,петък,събота,неделя}
+
+ \SetString\abbgyear{г.}
+% \end{macrocode}
+% The following |\if| clause is a patch.
+% |\if@bul@unicode| ensures that the following will not be executed
+% Unicode engines are in use. It should not be anyway but
+% |\SetStringLoop| seems to expand its argument prematurely and |\cyrya|
+% etc. are not defined for Unicode engines.
+%
+% \changes{bulgarian-1.2f}{2013/10/13}{(bug fix) put \cs{if@bul@unicode}
+% before \cs{StartBabelCommands} (the dates one)
+% to avoid an error when processing with Luatex.}
+%
+% \begin{macrocode}
+\StartBabelCommands*{bulgarian}{date}
+%%% %(princ (to-cyrx-string bulmonths))
+\if@bul@unicode
+\else
+ \SetStringLoop{month#1name}{%
+ \cyrya\cyrn\cyru\cyra\cyrr\cyri,\cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri,%
+ \cyrm\cyra\cyrr\cyrt,\cyra\cyrp\cyrr\cyri\cyrl,\cyrm\cyra\cyrishrt,%
+ \cyryu\cyrn\cyri,\cyryu\cyrl\cyri,\cyra\cyrv\cyrg\cyru\cyrs\cyrt,%
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri,%
+ \cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri,%
+ \cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri,\cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri}%
+%%% %(princ (to-cyrx-string "понеделник,вторник,сряда,четвъртък,петък,събота,неделя"))
+ \SetStringLoop{weekday#1name}{%
+ \cyrp\cyro\cyrn\cyre\cyrd\cyre\cyrl\cyrn\cyri\cyrk,%
+ \cyrv\cyrt\cyro\cyrr\cyrn\cyri\cyrk,\cyrs\cyrr\cyrya\cyrd\cyra,%
+ \cyrch\cyre\cyrt\cyrv\cyrhrdsn\cyrr\cyrt\cyrhrdsn\cyrk,%
+ \cyrp\cyre\cyrt\cyrhrdsn\cyrk,\cyrs\cyrhrdsn\cyrb\cyro\cyrt\cyra,%
+ \cyrn\cyre\cyrd\cyre\cyrl\cyrya}%
+\fi
+
+ \SetString\abbgyear{\cyrg.}
+
+ \SetString\today{\number\day~%
+ \csname month\romannumeral\month name\endcsname\space
+ \number\year\,\abbgyear}
+
+ \SetString\todayRoman{\number\day.\,\month@Roman.\,\number\year\,\abbgyear}
+% \end{macrocode}
+% \begin{macrocode}
+\EndBabelCommands
+\fi
+% \end{macrocode}
+
+
+%
+%\subsection{Extras for Bulgarian}
+%
+%
+% \begin{macro}{\extrasbulgarian}
+%
+% The macro |\extrasbulgarian| will perform all the extra
+% definitions needed for the Bulgarian language.
+% The macro |\noextrasbulgarian| is used to cancel the actions of
+% |\extrasbulgarian|.
+%
+% The first action we define is to switch on the selected Cyrillic
+% encoding whenever we enter `bulgarian'.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\cyrillictext}
+% \end{macrocode}
+%
+% When the encoding definition file was processed by \LaTeX\ the current
+% font encoding is stored in |\latinencoding|. We switch back to
+% |\latinencoding| whenever the Bulgarian language is no longer
+% `active'.
+%
+% \begin{macrocode}
+\addto\noextrasbulgarian{\latintext}
+% \end{macrocode}
+%
+% For Bulgarian, the \texttt{"} character is made active.
+% The user part of the documentation gives an overview of the
+% available shorthands, see Table~\ref{tab:bulgarian-quote}.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% We specify that the Bulgarian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\languageshorthands{bulgarian}}
+% \end{macrocode}
+%
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{%
+ \bbl@activate{"}}
+\addto\noextrasbulgarian{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% To be able to define the function of `|"|', we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+%
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"|can now be typed as `|"|'.
+% \changes{bulgarian-1.0c}{2003/04/10}{repaired typo}
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019}
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Now we can define the doublequote macros: german and french
+% quotes. We use definitions of these quotes made in babel.sty.
+% The french quotes are contained in the \texttt{T2*} encodings.
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{"`}{\glqq}
+\declare@shorthand{bulgarian}{"'}{\grqq}
+\declare@shorthand{bulgarian}{"<}{\flqq}
+\declare@shorthand{bulgarian}{">}{\frqq}
+% \end{macrocode}
+%
+% Some additional commands:
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{""}{\hskip\z@skip}
+\declare@shorthand{bulgarian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{bulgarian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{bulgarian}{"|}{% |
+\textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+\allowhyphens}{}}
+% \end{macrocode}
+%
+% The next two macros for |"-| and |"---| are somewhat different.
+% We must check whether the second token is a hyphen character:
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{"-}{%
+% \end{macrocode}
+%
+% If the next token is `|-|', we typeset an emdash, otherwise a
+% hyphen sign:
+%
+% \begin{macrocode}
+ \def\bulgarian@sh@tmp{%
+ \if\bulgarian@sh@next-\expandafter\bulgarian@sh@emdash
+ \else\expandafter\bulgarian@sh@hyphen\fi
+ }%
+% \end{macrocode}
+%
+% \TeX\ looks for the next token after the first `|-|': the meaning
+% of this token is written to |\bulgarian@sh@next| and
+% |\bulgarian@sh@tmp| is called.
+%
+% \begin{macrocode}
+ \futurelet\bulgarian@sh@next\bulgarian@sh@tmp}
+% \end{macrocode}
+%
+% Here are the definitions of hyphen and emdash. First the hyphen:
+%
+% \begin{macrocode}
+\def\bulgarian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+% \end{macrocode}
+%
+% For the emdash definition, there are the two parameters: we must
+% `eat' two last hyphen signs of our emdash \dots :
+%
+% \begin{macrocode}
+\def\bulgarian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \begin{macro}{\cdash}
+%
+% \dots\ these two parameters are useful for another macro:
+% |\cdash|:
+%
+% \changes{bulgarian-1.0e}{2006/03/31}{Two occurences of \cmd{temp}
+% were changed into tab followed by emp}
+% \begin{macrocode}
+\ifx\cdash\undefined % should be defined earlier
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+%
+% second parameter (or third for |\cdash|) shows what kind of emdash
+% to create in next step
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"---| & ordinary (plain) Cyrillic emdash inside text:
+% an unbreakable thinspace will be inserted before only in case of
+% a \textit{space} before the dash (it is necessary for dashes after
+% display maths formulae: there could be lists, enumerations etc.\
+% started with ``---where $a$ is ...'' i.e., the dash starts a line).
+% (Firstly there were planned rather soft rules for user:he may put
+% a space before the dash or not. But it is difficult to place this
+% thinspace automatically, i.e., by checking modes because after
+% display formulae \TeX{} uses horizontal mode. Maybe there is a
+% misunderstanding? Maybe there is another way?) After a dash
+% a breakable thinspace is always placed; \\
+% \end{tabular}
+% \end{center}
+%
+%
+% \begin{macrocode}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+\cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--~| & emdash in compound names or surnames
+% (like Mendeleev--Klapeiron); this dash has no space characters
+% around; after the dash some space is added by |\exhyphenpenalty|.
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--*| & for denoting direct speech (a space like |\enskip|
+% must follow the emdash); \\
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+%\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\cyrdash}
+%
+% Finally the macro for ``body'' of the Cyrillic emdash.
+% The |\cyrdash| macro will be defined in case this macro hasn't
+% been defined in a fontenc file. For T2*fonts, cyrdash will be
+% placed in the code of the English emdash thus it uses ligature
+% |---|.
+%
+% \begin{macrocode}
+% Is there an IF necessary?
+\ifx\cyrdash\undefined
+\def\cyrdash{\hbox to.8em{--\hss--}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Here a really new macro---to place thinspace between initials.
+% This macro used instead of |\,| allows hyphenation in the
+% following surname.
+%
+% \begin{macrocode}
+\declare@shorthand{bulgarian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+% The Bulgarian hyphenation patterns can be used with
+% |\lefthyphenmin|\footnote{Actually, it seems that the "`official"'
+% definition allows even one character for |lefthyphen| but I have
+% not investigated this completely.} and |\righthyphenmin| set to~2.
+% \changes{bulgarian-1.0b}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\fi
+% \end{macrocode}
+%
+% Bulgarian typesetting requires |frenchspacing|. So, we add commands
+% to |\extrasbulgarian| and |\noextrasbulgarian| to turn it on and
+% off, respectively.
+%
+% \begin{macrocode}
+\addto\extrasbulgarian{\bbl@frenchspacing}
+\addto\noextrasbulgarian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \changes{bulgarian-1.2d}{2013/10/02}{Removed the code that made two
+% single quotes automatically produce Bulgarian quotes in Bulgarian
+% text. That code had been commented out for many years, possibly to
+% avoid introducing to additional active characters.}
+%
+%
+% \end{macro}
+%
+% \subsection{Enumerations for Bulgarian}
+%
+% \changes{bulgarian-1.1d}{2013/06/13}{Major rewrite of code and
+% documentation for Bulgarian enumerations.}
+%
+% \begin{macro}{\@Alph@bul}
+%
+% \changes{bulgarian-1.1d}{2013/06/13}{New: support for Unicode based
+% engines.}
+%
+% We begin by defining |\@Alph@bul| which works like |\@Alph|, but
+% produces (uppercase) Cyrillic letters intead of Latin ones. The
+% letters й, ъ and ы (ISHRT, HRDSN and SFTSN) are skipped, as usual
+% for this kind of enumeration. Note that these macros do not switch
+% encodings (and never did)\footnote{Earlier in this file, there are
+% definitions of {|@Alph@eng|} and |@alph@eng| in the code for
+% handling the obsolete cyrillic encoding |X2|. They contain encoding
+% commands. This is necessary for |X2| since it does not contain Latin
+% letters. These precautions hardly had any effect before the changes
+% for versions 1.1, since the old code below was effectively
+% overwriting them. The changes to |\@Alph| and |\@alph| are now
+% honoured as a side effect of the changes.}.
+%
+% \begin{macrocode}
+\if@bul@unicode
+ \def\@Alph@bul#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or
+ З\or И\or К\or Л\or М\or Н\or О\or
+ П\or Р\or С\or Т\or У\or Ф\or Х\or
+ Ц\or Ч\or Ш\or Щ\or Ю\or Я\else
+ \@ctrerr\fi}
+\else
+ \def\@Alph@bul#1{\ifcase#1\or
+ \CYRA\or \CYRB\or \CYRV\or \CYRG\or \CYRD\or \CYRE\or \CYRZH\or
+ \CYRZ\or \CYRI\or \CYRK\or \CYRL\or \CYRM\or \CYRN\or \CYRO\or
+ \CYRP\or \CYRR\or \CYRS\or \CYRT\or \CYRU\or \CYRF\or \CYRH\or
+ \CYRC\or \CYRCH\or \CYRSH\or \CYRSHCH\or \CYRYU\or \CYRYA\else
+ \@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+% \begin{macro}{\@alph@bul}
+%
+% \changes{bulgarian-1.1d}{2013/06/13}{New: support for Unicode based
+% engines.}
+%
+% The macro |\@alph@bul| is similar to |\@Alph@bul|
+% but produces lowercase Bulgarian letters.
+%
+% \begin{macrocode}
+\if@bul@unicode
+ \def\@alph@bul#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or е\or ж\or
+ з\or и\or к\or л\or м\or н\or о\or
+ п\or р\or с\or т\or у\or ф\or х\or
+ ц\or ч\or ш\or щ\or э\or ю\or я\else\@ctrerr\fi}
+\else
+ \def\@alph@bul#1{\ifcase#1\or
+ \cyra\or \cyrb\or \cyrv\or \cyrg\or \cyrd\or \cyre\or \cyrzh\or
+ \cyrz\or \cyri\or \cyrk\or \cyrl\or \cyrm\or \cyrn\or \cyro\or
+ \cyrp\or \cyrr\or \cyrs\or \cyrt\or \cyru\or \cyrf\or \cyrh\or
+ \cyrc\or \cyrch\or \cyrsh\or \cyrshch\or \cyryu\or \cyrya\else
+ \@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+% \begin{macro}{\@Alph@eng}
+% \changes{bulgarian-1.1d}{2013/06/13}{Do not define this from
+% scratch}
+%
+% \begin{macro}{\@alph@eng}
+% \changes{bulgarian-1.1d}{2013/06/13}{Do not define this from
+% scratch}
+%
+% We no longer define English |\@Alph@eng| and |\@alph@eng| from
+% scratch. We copy the definitions active at the time this file is
+% loaded.
+% \begin{macrocode}
+\let\@Alph@eng\@Alph
+\let\@alph@eng\@alph
+% \end{macrocode}
+% For version 1.1d we store the original definitions in the following
+% macros. TODO: there is redundancy but need to check before removing
+% stuff.
+% \begin{macrocode}
+\let\@Alph@saved\@Alph
+\let\@alph@saved\@alph
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%%%
+%%% The old code for defining |\@Alph@eng| and |\@alph@eng| is commented out.
+%%% \begin{macrocode}
+%%\def\@Alph@eng#1{%
+%% \ifcase#1\or
+%% A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or
+%% N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else
+%% \@ctrerr\fi
+%% }
+%%\def\@alph@eng#1{%
+%% \ifcase#1\or
+%% a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or
+%% n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
+%% \@ctrerr\fi
+%% }
+%%% \end{macrocode}
+%%%
+% We define commands for manually switching to and from English based
+% enumeration. Note that this definition for |\enumBul| is really
+% suitable for switching back after using |\enumEng|, since
+% |\enumBul| does not specify encoding and therefore would give an
+% error if called when the active encoding does not know cyrillic
+% (but see the similar code for X2 which does take care of the encoding).
+% \begin{macrocode}
+\def\enumBul{\let\@Alph\@Alph@bul \let\@alph\@alph@bul}
+\def\enumEng{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+\def\enumLat{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\abvon}
+% \changes{bulgarian-1.1d}{2013/06/15}{New macro.}
+% \begin{macro}{\abvoff}
+% \changes{bulgarian-1.1d}{2013/06/15}{New macro.}
+% Commands are provided for manual switching on and off of the
+% enumeration with Cyrillic letters: |\abvon| turns it on, while
+% |\abvoff| turns it off.
+% \begin{macrocode}
+\def\abvon{\let\@Alph@saved\@Alph \let\@alph@saved\@alph \enumBul}
+\def\abvoff{\let\@Alph\@Alph@saved \let\@alph\@alph@saved}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% By default the Bulgarian enumeration scheme is turned on when
+% switching to Bulgarian.
+% todo: Could avoid adding to |noextrasbulgarian| by using |babel@save| in
+% the first command. TODO: there should be a better way to do this
+% but I do not know of a portable way to check if the user has
+% supplied the attribute `abvoff'. (Attributes are processed by babel
+% after it is loaded.)
+%
+% \changes{bulgarian-1.1d}{2013/06/13}{Introduced attributes {abvon} and {abvoff}}
+% \begin{macrocode}
+\def\autoabvon{\abvon}
+\def\autoabvoff{\abvoff}
+\addto\extrasbulgarian{\autoabvon}
+\addto\noextrasbulgarian{\autoabvoff}
+% \end{macrocode}
+%
+%
+% The user can stop babel from turning on the Cyrillic enumeration
+% style by using attribute `abvoff' when loading babel.
+% \begin{macrocode}
+\bbl@declare@ttribute{bulgarian}{abvoff}{%
+ \PackageInfo{babel}{Turned off automatic Cyrillic enumeration in
+ Bulgarian}%
+ \def\autoabvon{\relax}
+ \def\autoabvoff{\relax}
+ \def\abvon{\enumBul}
+}
+% \end{macrocode}
+%
+%
+%
+%\subsection{Cyrillic letters in maths}
+%
+%
+% Set up default Cyrillic math alphabets. To use Cyrillic letters
+% in math mode user should load the |textmath| package
+% \emph{before} loading fontenc package (or \babel). Note that by
+% default Cyrillic letters are taken from upright font in math mode
+% (unlike Latin letters).
+%
+% \begin{macrocode}
+%\RequirePackage{textmath}
+\@ifundefined{sym\cyrillicencoding letters}{}{%
+\SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+%
+% \begin{macro}{\cyrmathbf}
+% \begin{macro}{\cyrmathsf}
+% \begin{macro}{\cyrmathit}
+% \begin{macro}{\cyrmathtt}
+% And we need a few commands to be able to switch to different
+% variants.
+%
+% \begin{macrocode}
+\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+ \rmdefault\bfdefault\updefault
+\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+ \sfdefault\mddefault\updefault
+\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+ \rmdefault\mddefault\itdefault
+\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+ \ttdefault\mddefault\updefault
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% We define also some bold variants.
+% \begin{macrocode}
+\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+ \sfdefault\bfdefault\updefault
+\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+ \rmdefault\bfdefault\itdefault
+}
+% \end{macrocode}
+%
+%\subsection{Alternative names for math functions}
+%
+% \changes{bulgarian-1.1c}{2013/06/13}{Rewrote the text and rearranged
+% the code for the math operators}
+%
+% Here we define some math operator names in accordance with Bulgarian
+% typesetting traditions.
+% \begin{macro}{\tg}
+% \begin{macro}{\ctg}
+% \begin{macro}{\cosec}
+% \begin{macro}{\arctg}
+% \begin{macro}{\arcctg}
+% \begin{macro}{\sh}
+% \begin{macro}{\ch}
+% \begin{macro}{\cth}
+% Some math functions in Bulgarian have other names, e.g.
+% \texttt{sinh} is written as \texttt{sh}, etc. We define here
+% alternative math operators for |\tan|, |\cot|, |\csc|, |\arctan|,
+% |\arccot|, |\sinh|, |\cosh|, |\coth|, and |\tanh|.
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\th}
+% The macro |\th| conflicts with |\th| defined in Latin~1 encoding. We
+% define it as the hyperbolic tangent in math mode but keep the
+% existing definition for text.
+% \changes{bulgarian-1.0d}{2004/05/21}{Change definition of \cs{th}
+% only for this language.}
+% \changes{bulgarian-1.1a}{2013/06/08}{Add the local definition
+% to extrasbulgarian, not extrasrussian.}
+% \begin{macrocode}
+\addto\extrasbulgarian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cyrxtounicode}
+% The standard font encoding handling for Cyrillic letters uses
+% definitions like |\CYRA| for the Cyrillic letters. These are not
+% necessary for unicode engines (Luatex, XeTeX) but may still be
+% present in other packages (for example |varioref|) that handle
+% different languages by storing hard coded strings.
+%
+% The following command may be used as emergency patch for such
+% problems. It is not to be used routinely as its use may hide
+% unrelated bugs.
+% \begin{macrocode}
+\def\cyrxtounicode{%
+ \let\CYRA=А \let\CYRB=Б \let\CYRV=В \let\CYRG=Г \let\CYRD=Д
+ \let\CYRE=Е \let\CYRZH=Ж \let\CYRZ=З \let\CYRI=И \let\CYRISHRT=Й
+ \let\CYRK=К \let\CYRL=Л \let\CYRM=М \let\CYRN=Н \let\CYRO=О
+ \let\CYRP=П \let\CYRR=Р \let\CYRS=С \let\CYRT=Т \let\CYRU=У
+ \let\CYRF=Ф \let\CYRH=Х \let\CYRC=Ц \let\CYRCH=Ч \let\CYRSH=Ш
+ \let\CYRSHCH=Щ \let\CYRHRDSN=Ъ \let\CYRSFTSN=Ь \let\CYRYU=Ю
+ \let\CYRYA=Я
+ \let\cyra=а \let\cyrb=б \let\cyrv=в \let\cyrg=г \let\cyrd=д
+ \let\cyre=е \let\cyrzh=ж \let\cyrz=з \let\cyri=и \let\cyrishrt=й
+ \let\cyrk=к \let\cyrl=л \let\cyrm=м \let\cyrn=н \let\cyro=о
+ \let\cyrp=п \let\cyrr=р \let\cyrs=с \let\cyrt=т \let\cyru=у
+ \let\cyrf=ф \let\cyrh=х \let\cyrc=ц \let\cyrch=ч \let\cyrsh=ш
+ \let\cyrshch=щ \let\cyrhrdsn=ъ \let\cyrsftsn=ь \let\cyryu=ю
+ \let\cyrya=я
+}
+% \end{macrocode}
+% \end{macro}
+
+
+
+%
+%\subsection{Compatibility with older versions}
+%
+%
+% This is for compatibility with older Bulgarian packages and support
+% for \babel.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\No}{%
+ \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+%\subsection{Finish}
+%
+%
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of \texttt{@}
+% to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{bulgarian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+
+
+
+
+% А\or
+% Б\or
+% В\or
+% Г\or
+% Д\or
+% Е\or
+% Ж\or
+% З\or
+% И\or
+% Й\or
+% К\or
+% Л\or
+% М\or
+% Н\or
+% О\or
+% П\or
+% Р\or
+% С\or
+% Т\or
+% У\or
+% Ф\or
+% Х\or
+% Ц\or
+% Ч\or
+% Ш\or
+% Щ\or
+% Ъ\or
+% Ь\or
+% Ю\or
+% Я\or
+%
+% а\or
+% б\or
+% в\or
+% г\or
+% д\or
+% е\or
+% ж\or
+% з\or
+% и\or
+% й\or
+% к\or
+% л\or
+% м\or
+% н\or
+% о\or
+% п\or
+% р\or
+% с\or
+% т\or
+% у\or
+% ф\or
+% х\or
+% ц\or
+% ч\or
+% ш\or
+% щ\or
+% ъ\or
+% ь\or
+% ю\or
+% я\or
+
+\let\CYRA=А
+\let\CYRB=Б
+\let\CYRV=В
+\let\CYRG=Г
+\let\CYRD=Д
+\let\CYRE=Е
+\let\CYRZH=Ж
+\let\CYRZ=З
+\let\CYRI=И
+\let\CYRISHRT=Й
+\let\CYRK=К
+\let\CYRL=Л
+\let\CYRM=М
+\let\CYRN=Н
+\let\CYRO=О
+\let\CYRP=П
+\let\CYRR=Р
+\let\CYRS=С
+\let\CYRT=Т
+\let\CYRU=У
+\let\CYRF=Ф
+\let\CYRH=Х
+\let\CYRC=Ц
+\let\CYRCH=Ч
+\let\CYRSH=Ш
+\let\CYRSHCH=Щ
+\let\CYRHRDSN=Ъ
+\let\CYRSFTSN=Ь
+\let\CYRYU=Ю
+\let\CYRYA=Я
+
+\let\cyra=а
+\let\cyrb=б
+\let\cyrv=в
+\let\cyrg=г
+\let\cyrd=д
+\let\cyre=е
+\let\cyrzh=ж
+\let\cyrz=з
+\let\cyri=и
+\let\cyrishrt=й
+\let\cyrk=к
+\let\cyrl=л
+\let\cyrm=м
+\let\cyrn=н
+\let\cyro=о
+\let\cyrp=п
+\let\cyrr=р
+\let\cyrs=с
+\let\cyrt=т
+\let\cyru=у
+\let\cyrf=ф
+\let\cyrh=х
+\let\cyrc=ц
+\let\cyrch=ч
+\let\cyrsh=ш
+\let\cyrshch=щ
+\let\cyrhrdsn=ъ
+\let\cyrsftsn=ь
+\let\cyryu=ю
+\let\cyrya=я
diff --git a/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.ins b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.ins
new file mode 100644
index 0000000000..c30d24f28c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.ins
@@ -0,0 +1,138 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2013 Georgi N. Boshnakov
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Georgi N. Boshnakov.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2013/09/26}
+\def\batchfile{bulgarian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2013 Georgi N. Boshnakov
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Georgi N. Boshnakov.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2013 Georgi N. Boshnakov
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Georgi N. Boshnakov.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{bulgarian.ldf}{\from{bulgarian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+%\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{* \space\space bulgarian.ldf}
+\Msg{*}
+%\Msg{* To produce the documentation run the files ending with}
+%\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.pdf b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.pdf
new file mode 100644
index 0000000000..3e1fafab44
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/bulgarian/bulgarian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/catalan/catalan.dtx b/macros/latex/contrib/babel-contrib/catalan/catalan.dtx
new file mode 100644
index 0000000000..b8185af4df
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/catalan/catalan.dtx
@@ -0,0 +1,712 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{517}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{catalan.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{catalan}
+%\fi
+%\ProvidesFile{catalan.dtx}
+ [2005/03/29 v2.2p Catalan support from the babel system]
+%\iffalse
+%% File `catalan.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Catalan Language Definition File
+%% Copyright (C) 1991 - 2005
+%% by Goncal Badenes <badenes at imec.be>
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams babel at braams.cistron.nl
+%%
+% This file is part of the babel system, it provides the source
+% code for the Catalan language definition file.
+% This file was developped out of spanish.sty and suggestions by
+% Goncal Badenes <badenes at imec.be> and Joerg Knappen
+% <knappen at vkpmzd.kph.uni-mainz.de>.
+%
+% The file spanish.sty was written by Julio Sanchez,
+% (jsanchez@gmv.es) The code for the catalan language has been
+% removed and now is in this file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{catalan.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{catalan.dtx}
+%
+% \changes{catalan-2.0b}{1993/09/23}{Incorporated the changes from
+% \file{spanish.sty}}
+% \changes{catalan-2.1}{1994/02/27}{Update for \LaTeXe}
+% \changes{catalan-2.1d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{catalan-2.2b}{1995/07/04}{Made the activation of the grave
+% and acute accents optional}
+% \changes{catalan-2.2c}{1995/07/08}{Removed the use of the tilde for
+% catalan}
+% \changes{catalan-2.2f}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{catalan-2.2g}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{catalan-2.2k}{1999/05/05}{A wrong \cs{changes} entry made
+% typesetting impossible}
+%
+% \section{The Catalan language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macro's for the
+% Catalan language.
+%
+% For this language only the double quote character (|"|) is made
+% active by default. In table~\ref{tab:catalan-quote-def} an
+% overview is given of the new macros defined and the new meanings
+% of |"|. Additionally to that, the user can explicitly activate
+% the acute accent or apostrophe (|'|) and/or the grave accent
+% (|`|) characters by using the \Lopt{activeacute} and
+% \Lopt{activegrave} options. In that case, the definitions shown
+% in table~\ref{tab:catalan-quote-opt} also become
+% available\footnote{Please note that if the acute accent character
+% is active, it is necessary to take special care of coding
+% apostrophes in a way which cannot be confounded with
+% accents. Therefore, it is necessary to type \texttt{l'\{\}estri}
+% instead of \texttt{l'estri}.}.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |\l.l| & geminated-l digraph (similar to
+% l$\cdot$l). |\L.L| produces the uppercase version.\\
+% |\lgem| & geminated-l digraph (similar to
+% l$\cdot$l). |\Lgem| produces the uppercase version.\\
+% |\up| & Macro to help typing raised ordinals, like {1\raise
+% 1ex\hbox{\small er}}. Takes one argument.\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% |"i| & i with diaeresis, allowing hyphenation
+% in the rest of the word. Valid for the following vowels:
+% i, u (both lowercase and uppercase).\\
+% |"c| & c-cedilla (\c{c}). Valid for both uppercase and
+% lowercase c.\\
+% |"l| & geminated-l digraph (similar to
+% l$\cdot$l). Valid for both uppercase and lowercase l.\\
+% |"<| & French left double quotes (similar to $<<$).\\
+% |">| & French right double quotes (similar to $>>$).\\
+% |"-| & explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% \verb="|= & disable ligature at this position.
+% \end{tabular}
+% \caption{Extra definitions made by file \file{catalan.ldf}
+% (activated by default)}
+% \label{tab:catalan-quote-def}
+% \end{table}
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |'e| & acute accented a, allowing hyphenation
+% in the rest of the word. Valid for the following
+% vowels: e, i, o, u (both lowercase and uppercase).\\
+% |`a| & grave accented a, allowing hyphenation
+% in the rest of the word. Valid for the following
+% vowels: a, e, o (both lowercase and uppercase).
+% \end{tabular}
+% \caption{Extra definitions made by file \file{catalan.ldf}
+% (activated only when using the options \Lopt{activeacute} and
+% \Lopt{activegrave})}
+% \label{tab:catalan-quote-opt}
+% \end{table}
+% These active accents characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table.
+%
+% \StopEventually{}
+%
+% \changes{catalan-2.0}{1993/07/11}{Removed code to load
+% \file{latexhax.com}}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{catalan-2.2g}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{catalan}\captionscatalan
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{catalan} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@catalan| to see whether we have to do something here.
+%
+% \changes{catalan-2.1d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@catalan\@undefined
+ \@nopatterns{Catalan}
+ \adddialect\l@catalan0
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Catalan language.
+%
+% \begin{macro}{\catalanhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{catalan-2.2n}{2001/02/19}{Set the hyphenation parameters
+% both to two as required by \texttt{cahyph.tex}}
+% \begin{macrocode}
+\providehyphenmins{catalan}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionscatalan}
+% The macro |\captionscatalan| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{catalan-1.1}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{catalan-2.0}{1993/07/11}{Added some names}
+% \changes{catalan-2.1d}{1994/11/09}{Added a few missing translations}
+% \changes{catalan-2.2b}{1995/07/03}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{catalan-2.2d}{1995/07/10}{added translation of Proof}
+% \changes{catalan-2.2d}{1995/11/15}{Translations revised}
+% \changes{catalan-2.2m}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{catalan-2.2p}{2003/11/17}{Inserted translation for
+% Glossary}
+% \begin{macrocode}
+\addto\captionscatalan{%
+ \def\prefacename{Pr\`oleg}%
+ \def\refname{Refer\`encies}%
+ \def\abstractname{Resum}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Cap\'{\i}tol}%
+ \def\appendixname{Ap\`endix}%
+ \def\contentsname{\'Index}%
+ \def\listfigurename{\'Index de figures}%
+ \def\listtablename{\'Index de taules}%
+ \def\indexname{\'Index alfab\`etic}%
+ \def\figurename{Figura}%
+ \def\tablename{Taula}%
+ \def\partname{Part}%
+ \def\enclname{Adjunt}%
+ \def\ccname{C\`opies a}%
+ \def\headtoname{A}%
+ \def\pagename{P\`agina}%
+ \def\seename{Vegeu}%
+ \def\alsoname{Vegeu tamb\'e}%
+ \def\proofname{Demostraci\'o}%
+ \def\glossaryname{Glossari}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datecatalan}
+% The macro |\datecatalan| redefines the command |\today| to
+% produce Catalan dates. Months are written in
+% lowercase\footnote{This seems to be the common practice. See for
+% example: E.~Coromina, \emph{El 9 Nou: Manual de redacci\'o i
+% estil}, Ed.~Eumo, Vic, 1993}.
+% \changes{catalan-2.2b}{1995/06/18}{Month names in lowercase}
+% \changes{catalan-2.2i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{catalan-2.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datecatalan{%
+ \def\today{\number\day~\ifcase\month\or
+ de gener\or de febrer\or de mar\c{c}\or d'abril\or de maig\or
+ de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
+ de novembre\or de desembre\fi
+ \space de~\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrascatalan}
+% \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
+% \changes{catalan-2.2a}{1995/03/11}{Handling of active characters
+% completely rewritten}
+%
+% \begin{macro}{\noextrascatalan}
+% \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
+%
+% The macro |\extrascatalan| will perform all the extra definitions
+% needed for the Catalan language. The macro |\noextrascatalan| is
+% used to cancel the actions of |\extrascatalan|.
+%
+% \changes{catalan-2.2e}{1995/11/10}{Now give the apostrophe a
+% lowercase code}
+% To improve hyphenation we give the grave character (\texttt{'}) a
+% non-zero lower case code; when we do that \TeX\ will find more
+% breakpoints in words that contain this character in its r\^ole as
+% apostrophe.
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \lccode`'=`'}
+\addto\noextrascatalan{%
+ \lccode`'=0}
+% \end{macrocode}
+%
+% For Catalan, some characters are made active or are redefined. In
+% particular, the \texttt{"} character receives a new meaning; this
+% can also happen for the \texttt{'} character and the \texttt{`}
+% character when the options \Lopt{activegrave} and/or
+% \Lopt{activeacute} are specified.
+%
+% \changes{catalan-2.2b}{1995/07/07}{Make activating the accent
+% characters optional}
+% \changes{catalan-2.2e}{1995/08/17}{Need to split up the
+% \cs{@ifpackagewith} statements}
+% \begin{macrocode}
+\addto\extrascatalan{\languageshorthands{catalan}}
+\initiate@active@char{"}
+\addto\extrascatalan{\bbl@activate{"}}
+% \end{macrocode}
+% Because the grave character is being used in constructs such as
+% |\catcode``=\active| it needs to have it's original category code%''
+% when the auxiliary file is being read. Note that this file is
+% read twice, once at the beginning of the document; then there is
+% no problem; but the second time it is read at the end of the
+% document to check whether any labels changes. It's this second
+% time round that the actived grave character leads to error
+% messages.
+% \changes{catalan-2.2l}{1999/11/29}{Make sure that the grave accent
+% has catcode 12 \emph{before} it is made \cs{active}}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activegrave}{%
+ \AtBeginDocument{%
+ \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
+ \initiate@active@char{`}%
+ }{}
+\@ifpackagewith{babel}{activegrave}{%
+ \addto\extrascatalan{\bbl@activate{`}}%
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \initiate@active@char{'}%
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\extrascatalan{\bbl@activate{'}}%
+ }{}
+% \end{macrocode}
+% Now make sure that the characters that have been turned into
+% shorthanfd characters expand to `normal' characters outside the
+% catalan environment.
+% \changes{catalan-2.2l}{1999/12/16}{Don't forget do deactivate the
+% shorthands}
+% \begin{macrocode}
+\addto\noextrascatalan{\bbl@deactivate{"}}
+\@ifpackagewith{babel}{activegrave}{%
+ \addto\noextrascatalan{\bbl@deactivate{`}}}{}
+\@ifpackagewith{babel}{activeacute}{%
+ \addto\noextrascatalan{\bbl@deactivate{'}}}{}
+% \end{macrocode}
+%
+% \changes{catalan-2.2a}{1995/03/11}{All the code for handling active
+% characters is now moved to \file{babel.def}}
+%
+% Apart from the active characters some other macros get a new
+% definition. Therefore we store the current ones to be able
+% to restore them later.
+% When their current meanings are saved, we can safely redefine
+% them.
+%
+% We provide new definitions for the accent macros when one or
+% both of the options \Lopt{activegrave} or \Lopt{activeacute}
+% were specified.
+%
+% \changes{catalan-2.2h}{1997/01/08}{Added some comment signs to
+% prevent unwanted spaces in the output}
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \babel@save\"%
+ \def\"{\protect\@umlaut}}%
+\@ifpackagewith{babel}{activegrave}{%
+ \babel@save\`%
+ \addto\extrascatalan{\def\`{\protect\@grave}}
+ }{}
+\@ifpackagewith{babel}{activeacute}{%
+ \babel@save\'%
+ \addto\extrascatalan{\def\'{\protect\@acute}}
+ }{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% All the code above is necessary because we need a few extra
+% active characters. These characters are then used as indicated in
+% tables~\ref{tab:catalan-quote-def}
+% and~\ref{tab:catalan-quote-opt}.
+%
+% \begin{macro}{\dieresis}
+% \begin{macro}{\textacute}
+% \changes{catalan-2.1d}{1994/06/26}{Renamed from \cs{acute} as that
+% is a \cs{mathaccent}}
+% \begin{macro}{\textgrave}
+%
+% The original definition of |\"| is stored as |\dieresis|, because
+% the definition of |\"| might not be the default plain \TeX\
+% one. If the user uses \textsc{PostScript} fonts with the Adobe
+% font encoding the \texttt{"} character is not in the same
+% position as in Knuth's font encoding. In this case |\"| will not
+% be defined as |\accent"7F 1|, but as |\accent'310 #1|. Something
+% similar happens when using fonts that follow the Cork
+% encoding. For this reason we save the definition of |\"| and use
+% that in the definition of other macros. We do likewise for |\`|,
+% and |\'|.
+% \begin{macrocode}
+\let\dieresis\"
+\@ifpackagewith{babel}{activegrave}{\let\textgrave\`}{}
+\@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@umlaut}
+% \begin{macro}{\@acute}
+% \begin{macro}{\@grave}
+% We check the encoding and if not using T1, we make the accents
+% expand but enabling hyphenation beyond the accent. If this is the
+% case, not all break positions will be found in words that contain
+% accents, but this is a limitation in \TeX. An unsolved problem
+% here is that the encoding can change at any time. The definitions
+% below are made in such a way that a change between two 256-char
+% encodings are supported, but changes between a 128-char and a
+% 256-char encoding are not properly supported. We check if T1 is
+% in use. If not, we will give a warning and proceed redefining the
+% accent macros so that \TeX{} at least finds the breaks that are
+% not too close to the accent. The warning will only be printed to
+% the log file.
+%
+% \begin{macrocode}
+\ifx\DeclareFontShape\@undefined
+ \wlog{Warning: You are using an old LaTeX}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+ \@ifpackagewith{babel}{activeacute}{%
+ \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
+\else
+ \ifx\f@encoding\bbl@t@one
+ \let\@umlaut\dieresis
+ \@ifpackagewith{babel}{activeacute}{%
+ \let\@acute\textacute}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \let\@grave\textgrave}{}
+ \else
+ \wlog{Warning: You are using encoding \f@encoding\space
+ instead of T1.}
+ \wlog{Some word breaks will not be found.}
+ \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+ \@ifpackagewith{babel}{activeacute}{%
+ \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
+ \@ifpackagewith{babel}{activegrave}{%
+ \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
+ \fi
+\fi
+% \end{macrocode}
+% If the user setup has extended fonts, the Ferguson macros are
+% required to be defined. We check for their existance and, if
+% defined, expand to whatever they are defined to. For instance,
+% |\'a| would check for the existance of a |\@ac@a| macro. It is
+% assumed to expand to the code of the accented letter. If it is
+% not defined, we assume that no extended codes are available and
+% expand to the original definition but enabling hyphenation beyond
+% the accent. This is as best as we can do. It is better if you
+% have extended fonts or ML-\TeX{} because the hyphenation
+% algorithm can work on the whole word. The following macros are
+% directly derived from ML-\TeX{}.\footnote{A problem is perceived
+% here with these macros when used in a multilingual environment
+% where extended hyphenation patterns are available for some but
+% not all languages. Assume that no extended patterns exist at some
+% site for French and that \file{french.sty} would adopt this
+% scheme too. In that case, \mbox{\texttt{'e}} in French would
+% produce the combined accented letter, but hyphenation around it
+% would be suppressed. Both language options would need an
+% independent method to know whether they have extended patterns
+% available. The precise impact of this problem and the possible
+% solutions are under study.}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{catalan-2.2a}{1995/03/14}{All the code to deal with active
+% characters is now in \file{babel.def}}
+%
+% Now we can define our shorthands: the diaeresis and ``ela
+% geminada'' support,
+% \begin{macrocode}
+\declare@shorthand{catalan}{"i}{\textormath{\@umlaut\i}{\ddot\imath}}
+\declare@shorthand{catalan}{"l}{\lgem{}}
+\declare@shorthand{catalan}{"u}{\textormath{\@umlaut u}{\ddot u}}
+\declare@shorthand{catalan}{"I}{\textormath{\@umlaut I}{\ddot I}}
+\declare@shorthand{catalan}{"L}{\Lgem{}}
+\declare@shorthand{catalan}{"U}{\textormath{\@umlaut U}{\ddot U}}
+% \end{macrocode}
+% cedille,
+% \changes{catalan-2.2c}{1995/07/08}{cedile now produced by double
+% quote shorthand}
+% \begin{macrocode}
+\declare@shorthand{catalan}{"c}{\textormath{\c c}{^{\prime} c}}
+\declare@shorthand{catalan}{"C}{\textormath{\c C}{^{\prime} C}}
+% \end{macrocode}
+% `french' quote characters,
+% \changes{catalan-2.2c}{1995/07/08}{Added shorthands for guillemets}
+% \changes{catalan-2.2i}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{catalan}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{catalan}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% grave accents,
+% \changes{catalan-2.2e}{1996/03/05}{Added `{}` as an axtra shorthand}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activegrave}{%
+ \declare@shorthand{catalan}{`a}{\textormath{\@grave a}{\grave a}}
+ \declare@shorthand{catalan}{`e}{\textormath{\@grave e}{\grave e}}
+ \declare@shorthand{catalan}{`o}{\textormath{\@grave o}{\grave o}}
+ \declare@shorthand{catalan}{`A}{\textormath{\@grave A}{\grave A}}
+ \declare@shorthand{catalan}{`E}{\textormath{\@grave E}{\grave E}}
+ \declare@shorthand{catalan}{`O}{\textormath{\@grave O}{\grave O}}
+ \declare@shorthand{catalan}{``}{\textquotedblleft}%''
+ }{}
+% \end{macrocode}
+% acute accents,
+% \changes{catalan-2.2b}{1995/07/03}{Changed mathmode definition of
+% acute shorthands to expand to a single prime followed by the next
+% character in the input}
+% \changes{catalan-2.2e}{1995/09/05}{Added vertical bar as argument to
+% active acute}
+% \begin{macrocode}
+\@ifpackagewith{babel}{activeacute}{%
+ \declare@shorthand{catalan}{'a}{\textormath{\@acute a}{^{\prime} a}}
+ \declare@shorthand{catalan}{'e}{\textormath{\@acute e}{^{\prime} e}}
+ \declare@shorthand{catalan}{'i}{\textormath{\@acute\i{}}{^{\prime} i}}
+ \declare@shorthand{catalan}{'o}{\textormath{\@acute o}{^{\prime} o}}
+ \declare@shorthand{catalan}{'u}{\textormath{\@acute u}{^{\prime} u}}
+ \declare@shorthand{catalan}{'A}{\textormath{\@acute A}{^{\prime} A}}
+ \declare@shorthand{catalan}{'E}{\textormath{\@acute E}{^{\prime} E}}
+ \declare@shorthand{catalan}{'I}{\textormath{\@acute I}{^{\prime} I}}
+ \declare@shorthand{catalan}{'O}{\textormath{\@acute O}{^{\prime} O}}
+ \declare@shorthand{catalan}{'U}{\textormath{\@acute U}{^{\prime} U}}
+ \declare@shorthand{catalan}{'|}{%
+ \textormath{\csname normal@char\string'\endcsname}{^{\prime}}}
+% \end{macrocode}
+% the acute accent,
+% \changes{catalan-2.2c}{1995/07/08}{Added '{}' as an axtra shorthand,
+% removed 'n as a shorthand}
+% \begin{macrocode}
+ \declare@shorthand{catalan}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ }{}
+% \end{macrocode}
+% and finally, some support definitions
+% \begin{macrocode}
+\declare@shorthand{catalan}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{catalan}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% unfortunate for Catalan but not as much as for Dutch or German,
+% where long compound words are quite normal and all one needs is a
+% means to indicate an extra hyphenation position on top of the
+% ones that \TeX\ can generate from the hyphenation
+% patterns. However, the average length of words in Catalan makes
+% this desirable and so it is kept here.
+%
+% \begin{macrocode}
+\addto\extrascatalan{%
+ \babel@save{\-}%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lgem}
+% \begin{macro}{\Lgem}
+% \changes{catalan-2.2b}{1995/06/18}{Added support for typing the
+% catalan ``ela geminada'' with the macros \cs{lgem} and \cs{Lgem}}
+% \changes{catalan-2.2f}{1996/09/20}{Added a check for math mode as
+% the use of \cs{lgem} and \cs{Lgem} in math mode is not sensible.}
+%
+% Here we define a macro for typing the catalan ``ela geminada''
+% (geminated l). The macros |\lgem| and |\Lgem| have been chosen
+% for its lowercase and uppercase representation,
+% respectively\footnote{The macro names \cs{ll} and \cs{LL} were
+% not taken because of the fact that \cs{ll} is already used in
+% mathematical mode.}.
+%
+% The code used in the actual macro used is a combination of the
+% one proposed by Feruglio and Fuster\footnote{G.~Valiente and
+% R.~Fuster, Typesetting Catalan Texts with \TeX, \emph{TUGboat}
+% \textbf{14}(3), 1993.} and the proposal\footnote{G. Valiente,
+% Modern Catalan Typographical Conventions, \emph{TUGboat}
+% \textbf{16}(3), 1995.} from Valiente presented at the \TeX\ Users
+% Group Annual Meeting in 1995. This last proposal has not been
+% fully implemented due to its limitation to CM fonts.
+% \begin{macrocode}
+\newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
+\def\lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname l%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
+ \advance\raiselldim by \the\fontdimen5\the\font
+ \advance\raiselldim by -\ht2%
+ \leftllkern=-.25\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-.25\wd0%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{l-}{l}%
+ {\hbox{l}\kern\leftllkern\raise\raiselldim\hbox{.}%
+ \kern\rightllkern\hbox{l}}\allowhyphens
+ \fi
+ }
+\def\Lgem{%
+ \ifmmode
+ \csname normal@char\string"\endcsname L%
+ \else
+ \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
+ \setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
+ \advance\raiselldim by .5\ht0%
+ \advance\raiselldim by -.5\ht2%
+ \leftllkern=-.125\wd0%
+ \advance\leftllkern by \wd1%
+ \advance\leftllkern by -\wd0%
+ \rightllkern=-\wd0%
+ \divide\rightllkern by 6%
+ \advance\rightllkern by -\wd1%
+ \advance\rightllkern by \wd0%
+ \allowhyphens\discretionary{L-}{L}%
+ {\hbox{L}\kern\leftllkern\raise\raiselldim\hbox{.}%
+ \kern\rightllkern\hbox{L}}\allowhyphens
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\l.l}
+% \begin{macro}{\L.L}
+% \changes{catalan-2.2e}{1996/06/26}{Added redefinition of \cs{l} and
+% \cs{L}}
+% It seems to be the most natural way of entering the ``ela
+% geminda'' to use the sequences |\l.l| and |\L.L|. These are not
+% really macro's by themselves but the macros |\l| and |\L| with
+% delimited arguments. Therefor we define two macros that check if
+% the next character is a period. If not the ``polish l'' will be
+% typeset, otherwise a ``ela geminada'' will be typeset and the
+% next two tokens will be `eaten'.
+% \changes{catalan-2.2o}{2003/09/19}{Postpone the redefinition of
+% \cs{l} and \cs{L} until begin document to prevent overwriting by
+% fontenc}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \let\lslash\l
+ \let\Lslash\L
+ \DeclareRobustCommand\l{\@ifnextchar.\bbl@l\lslash}
+ \DeclareRobustCommand\L{\@ifnextchar.\bbl@L\Lslash}}
+\def\bbl@l#1#2{\lgem}
+\def\bbl@L#1#2{\Lgem}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\up}
+%
+% A macro for typesetting things like 1\raise1ex\hbox{\small er} as
+% proposed by Raymon Seroul\footnote{This macro has been borrowed
+% from francais.dtx}.
+% \changes{catalan-2.2b}{1995/06/18}{Added definition of macro
+% \cs{up}, which can be used to type ordinals}
+% \changes{catalan-2.2e}{1996/02/29}{Now use \cs{textsuperscript} and
+% make \cs{up} robust}
+% \begin{macrocode}
+\DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{catalan-2.2g}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{catalan}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/catalan/catalan.ins b/macros/latex/contrib/babel-contrib/catalan/catalan.ins
new file mode 100644
index 0000000000..982e9b8bba
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/catalan/catalan.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{catalan.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{catalan.ldf}{\from{catalan.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/catalan/catalan.pdf b/macros/latex/contrib/babel-contrib/catalan/catalan.pdf
new file mode 100644
index 0000000000..5daa7e8a84
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/catalan/catalan.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/croatian/croatian.dtx b/macros/latex/contrib/babel-contrib/croatian/croatian.dtx
new file mode 100644
index 0000000000..611e45113e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/croatian/croatian.dtx
@@ -0,0 +1,231 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{88}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{croatian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{croatian}
+%\fi
+%\ProvidesFile{croatian.dtx}
+ [2014/03/31 v1.3m Croatian support from the babel system]
+%\iffalse
+%% File `croatian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Croatian language definition file. A contribution
+% was made by Alan Pai\'{c} (paica@cernvm.cern.ch)
+% and Ivan Kokan (ivan.kokan@gmail.com)
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{croatian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{croatian.dtx}
+%
+% \changes{croatian-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{croatian-1.0c}{1992/01/25}{Removed some typos}
+% \changes{croatian-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{croatian-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{croatian-1.3g}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Croatian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Alan Pai\'{c}
+% (\texttt{paica@cernvm.cern.ch}) and Ivan Kokan (\texttt{ivan.kokan@gmail.com}).}
+% defines all the language definition macros for the Croatian language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{croatian-1.3g}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{croatian}\captionscroatian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{croatian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@croatian| to see whether we have to do something here.
+%
+% \changes{croatian-1.0b}{1991/10/07}{Removed use of
+% \cs{@ifundefined}}
+% \changes{croatian-1.1}{1992/02/15}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \begin{macrocode}
+\ifx\l@croatian\@undefined
+ \@nopatterns{Croatian}
+ \adddialect\l@croatian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Croatian language.
+%
+% \begin{macro}{\captionscroatian}
+% The macro |\captionscroatian| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{croatian-1.1}{1992/02/15}{Added \cs{seename},
+% \cs{alsoname} and \cs{prefacename}}
+% \changes{croatian-1.2}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{croatian-1.3d}{1995/05/08}{Added a few translations}
+% \changes{croatian-1.3e}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{croatian-1.3f}{1996/01/18}{Added translation of Proof}
+% \changes{croatian-1.3i}{1997/09/11}{Replaced some of the
+% translations with `better' words}
+% \changes{croatian-1.3k}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{croatian-1.3l}{2003/11/17}{Inserted translation for Glossary}
+% \changes{croatian-1.3m}{2014/03/31}{Better translation for Index,
+% cc, see also, Glossary}
+% \begin{macrocode}
+\addto\captionscroatian{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Sa\v{z}etak}%
+ \def\bibname{Bibliografija}%
+ \def\chaptername{Poglavlje}%
+ \def\appendixname{Dodatak}%
+ \def\contentsname{Sadr\v{z}aj}%
+ \def\listfigurename{Popis slika}%
+ \def\listtablename{Popis tablica}%
+ \def\indexname{Kazalo}%
+ \def\figurename{Slika}%
+ \def\tablename{Tablica}%
+ \def\partname{Dio}%
+ \def\enclname{Prilozi}%
+ \def\ccname{Kopija}%
+ \def\headtoname{Prima}%
+ \def\pagename{Stranica}%
+ \def\seename{Vidjeti}%
+ \def\alsoname{Tako\dj er vidjeti}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Pojmovnik}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datecroatian}
+% The macro |\datecroatian| redefines the command |\today| to
+% produce Croatian dates.
+% \changes{croatian-1.3f}{1996/01/18}{in croatian language, the
+% genitive for the name of the month has to be used}
+% \changes{croatian-1.3h}{1997/02/06}{\texttt{sijev\{c\}nja} should be
+% \texttt{seij\cs{v}\{c\}nja} and there should be a period after
+% the year}
+% \changes{croatian-1.3i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{croatian-1.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{croatian-1.3j}{1999/03/12}{changed \cs{od} into \cs{or}}
+% \changes{croatian-1.3m}{2014/03/31}{Changed \texttt{studenog}
+% into \texttt{studenoga}}
+% \begin{macrocode}
+\def\datecroatian{%
+ \def\today{\number\day.~\ifcase\month\or
+ sije\v{c}nja\or velja\v{c}e\or o\v{z}ujka\or travnja\or svibnja\or
+ lipnja\or srpnja\or kolovoza\or rujna\or listopada\or studenoga\or
+ prosinca\fi \space \number\year.}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrascroatian}
+% \begin{macro}{\noextrascroatian}
+% The macro |\extrascroatian| will perform all the extra
+% definitions needed for the Croatian language. The macro
+% |\noextrascroatian| is used to cancel the actions of
+% |\extrascroatian|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extrascroatian{}
+\addto\noextrascroatian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{croatian-1.3g}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{croatian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/croatian/croatian.ins b/macros/latex/contrib/babel-contrib/croatian/croatian.ins
new file mode 100644
index 0000000000..babb296ae0
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/croatian/croatian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{croatian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{croatian.ldf}{\from{croatian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/croatian/croatian.pdf b/macros/latex/contrib/babel-contrib/croatian/croatian.pdf
new file mode 100644
index 0000000000..91c59077dd
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/croatian/croatian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/czech/czech.dtx b/macros/latex/contrib/babel-contrib/czech/czech.dtx
new file mode 100644
index 0000000000..e4ae1a91aa
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/czech/czech.dtx
@@ -0,0 +1,1157 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1142}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{czech.dtx}
+%</dtx>
+%<+code>\ProvidesLanguage{czech}
+%\fi
+%\ProvidesFile{czech.dtx}
+ [2008/07/06 v3.1a Czech support from the babel system]
+%\iffalse
+%% File `czech.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Copyright (C) 2005, 2008
+%% by Petr Tesa\v r\'ik (babel at tesarici.cz)
+%%
+%% Czech Language Definition File
+% This file is also based on CSLaTeX
+% by Ji\v r\'i Zlatu\v ska, Zden\v ek Wagner,
+% Jaroslav \v Snajdr and Petr Ol\v s\'ak.
+%
+%% Please report errors to: Petr Tesa\v r\'ik
+%% babel at tesarici.cz
+%
+% This file is part of the babel system, it provides the source
+% code for the Czech language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{czech.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \def\CS{$\cal C\kern-.1667em
+% \lower.5ex\hbox{$\cal S$}\kern-.075em$}
+%
+% \GetFileInfo{czech.dtx}
+%
+% \changes{czech-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{czech-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{czech-1.2}{1993/07/11}{Included some features from Kasal's
+% czech.sty}
+% \changes{czech-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{czech-1.3d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{czech-1.3h}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{czech-3.0}{2005/09/10}{Implemented the functionality of
+% \CS\LaTeX's czech.sty. The version number was bumped to 3.0
+% to minimize confusion by being higher than the last version
+% of \CS\LaTeX.}
+%
+% \section{The Czech Language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was rewritten by Petr Tesa\v r\'ik
+% (\texttt{babel@tesarici.cz}).} defines all the language definition
+% macros for the Czech language. It is meant as a replacement of
+% \CS\LaTeX, the most-widely used standard for typesetting Czech
+% documents in \LaTeX.
+%
+% \subsection{Usage}
+% For this language |\frenchspacing| is set.
+%
+% Additionally, two macros are defined |\q| and |\w| for easy
+% access to two accents are defined.
+%
+% The command |\q| is used with the letters (\texttt{t},
+% \texttt{d}, \texttt{l}, and \texttt{L}) and adds a \texttt{'} to
+% them to simulate a `hook' that should be there. The result looks
+% like t\kern-2pt\char'47. The command |\w| is used to put the
+% ring-accent which appears in \aa ngstr\o m over the letters
+% \texttt{u} and \texttt{U}.
+%
+% \subsection{Compatibility}
+%
+% Great care has been taken to ensure backward compatibility with
+% \CS\LaTeX. In particular, documents which load this file with
+% |\usepackage{czech}| should produce identical output with no
+% modifications to the source. Additionally, all the \CS\LaTeX{}
+% options are recognized:
+%
+% \label{tab:czech-options}
+% \begin{list}{}
+% {\def\makelabel#1{\sbox0{\Lopt{#1}}%
+% \ifdim\wd0>\labelwidth
+% \setbox0\vbox{\box0\hbox{}} \wd0=0pt \fi
+% \box0\hfil}
+% \setlength{\labelwidth}{2\parindent}
+% \setlength{\leftmargin}{2\parindent}
+% \setlength{\rightmargin}{\parindent}}
+% \item[IL2, T1, OT1]
+% These options set the default font encoding. Please note
+% that their use is deprecated. You should use the |fontenc|
+% package to select font encoding.
+%
+% \item[split, nosplit]
+% These options control whether hyphenated words are
+% automatically split according to Czech typesetting rules.
+% With the \Lopt{split} option ``je-li'' is hyphenated as
+% ``je-/-li''. The \Lopt{nosplit} option disables this behavior.
+%
+% The use of this option is strongly discouraged, as it breaks
+% too many common things---hyphens cannot be used in labels,
+% negative arguments to \TeX{} primitives will not work in
+% horizontal mode (use \cs{minus} as a workaround), and there are
+% a few other peculiarities with using this mode.
+%
+% \item[nocaptions]
+%
+% This option was used in \CS\LaTeX{} to set up Czech/Slovak
+% typesetting rules, but leave the original captions and dates.
+% The recommended way to achieve this is to use English as the main
+% language of the document and use the environment |otherlanguage*|
+% for Czech text.
+%
+% \item[olduv]
+% There are two version of \cs{uv}. The older one allows the use
+% of \cs{verb} inside the quotes but breaks any respective kerning
+% with the quotes (like that in \CS{} fonts). The newer one honors
+% the kerning in the font but does not allow \cs{verb} inside the
+% quotes.
+%
+% The new version is used by default in \LaTeXe{} and the old version
+% is used with plain \TeX. You may use \Lopt{olduv} to override the
+% default in \LaTeXe.
+%
+% \item[cstex]
+% This option was used to include the commands \cs{csprimeson} and
+% \cs{csprimesoff}. Since these commands are always included now,
+% it has been removed and the empty definition lasts for compatibility.
+% \end{list}
+%
+% \StopEventually{}
+%
+% \subsection{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{czech-1.3h}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{czech} might be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@czech| to see whether we have to do something here.
+%
+% \changes{czech-1.0b}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{czech-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{czech-1.3d}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@czech\@undefined
+ \@nopatterns{Czech}
+ \adddialect\l@czech0\fi
+% \end{macrocode}
+%
+% We need to define these macros early in the process.
+%
+% \begin{macrocode}
+\def\cs@iltw@{IL2}
+\newif\ifcs@splithyphens
+\cs@splithyphensfalse
+% \end{macrocode}
+%
+% If Babel is not loaded, we provide compatibility with \CS\LaTeX.
+% However, if macro \cs{@ifpackageloaded} is not defined, we assume
+% to be loaded from plain and provide compatibility with csplain.
+% Of course, this does not work well with \LaTeX$\:$2.09, but I
+% doubt anyone will ever want to use this file with \LaTeX$\:$2.09.
+%
+% \begin{macrocode}
+\ifx\@ifpackageloaded\@undefined
+ \let\cs@compat@plain\relax
+ \message{csplain compatibility mode}
+\else
+ \@ifpackageloaded{babel}{}{%
+ \let\cs@compat@latex\relax
+ \message{cslatex compatibility mode}}
+\fi
+\ifx\cs@compat@latex\relax
+ \ProvidesPackage{czech}[2008/07/06 v3.1a CSTeX Czech style]
+% \end{macrocode}
+%
+% Declare \CS\LaTeX{} options (see also the descriptions on page
+% \pageref{tab:czech-options}).
+%
+% \begin{macrocode}
+ \DeclareOption{IL2}{\def\encodingdefault{IL2}}
+ \DeclareOption {T1}{\def\encodingdefault {T1}}
+ \DeclareOption{OT1}{\def\encodingdefault{OT1}}
+ \DeclareOption{nosplit}{\cs@splithyphensfalse}
+ \DeclareOption{split}{\cs@splithyphenstrue}
+ \DeclareOption{nocaptions}{\let\cs@nocaptions=\relax}
+ \DeclareOption{olduv}{\let\cs@olduv=\relax}
+ \DeclareOption{cstex}{\relax}
+% \end{macrocode}
+%
+% Make |IL2| encoding the default. This can be overriden with
+% the other font encoding options.
+% \begin{macrocode}
+ \ExecuteOptions{\cs@iltw@}
+% \end{macrocode}
+%
+% Now, process the user-supplied options.
+% \begin{macrocode}
+ \ProcessOptions
+% \end{macrocode}
+%
+% Standard \LaTeXe{} does not include the IL2 encoding in the format.
+% The encoding can be loaded later using the fontenc package, but
+% \CS\LaTeX{} included IL2 by default. This means existing documents
+% for \CS\LaTeX{} do not load that package, so load the encoding
+% ourselves in compatibility mode.
+%
+% \begin{macrocode}
+ \ifx\encodingdefault\cs@iltw@
+ \input il2enc.def
+ \fi
+% \end{macrocode}
+%
+% Restore the definition of \cs{CurrentOption}, clobbered by processing
+% the options.
+%
+% \begin{macrocode}
+ \def\CurrentOption{czech}
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Czech language.
+%
+% \begin{macro}{\captionsczech}
+% The macro \cs{captionsczech} defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+%
+% \changes{czech-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{czech-1.3f}{1995/07/04}{Added \cs{proofname} for AMS-\LaTeX}
+% \changes{czech-1.3g}{1996/02/12}{Fixed two errors and provided
+% translation for `proof'}
+% \changes{czech-1.3j}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{czech-1.3k}{2004/02/18}{Added translation for Glossary}
+% \changes{czech-3.0}{2005/11/25}{Updated some translations. Former
+% translations were: `Dodatek' for \cs{appendixname} and `Index'
+% for \cs{indexname}. Also removed spurious colon at the end of
+% \cs{ccname}.}
+%
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{P\v{r}edmluva}%
+ \def\refname{Reference}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitola}%
+ \def\appendixname{P\v{r}\'{\i}loha}%
+ \def\contentsname{Obsah}%
+ \def\listfigurename{Seznam obr\'azk\r{u}}%
+ \def\listtablename{Seznam tabulek}%
+ \def\indexname{Rejst\v{r}\'{\i}k}%
+ \def\figurename{Obr\'azek}%
+ \def\tablename{Tabulka}%
+ \def\partname{\v{C}\'ast}%
+ \def\enclname{P\v{r}\'{\i}loha}%
+ \def\ccname{Na v\v{e}dom\'{\i}}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strana}%
+ \def\seename{viz}%
+ \def\alsoname{viz tak\'e}%
+ \def\proofname{D\r{u}kaz}%
+ \def\glossaryname{Slovn\'{\i}k}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateczech}
+% The macro \cs{dateczech} redefines the command \cs{today}
+% to produce Czech dates.
+%
+% \CS\LaTeX{} allows line break between the day and the month.
+% However, this behavior has been agreed upon to be a bad thing by
+% the csTeX mailing list in December 2005 and has not been adopted.
+%
+% \changes{czech-1.3i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{czech-1.3i}{1998/03/28}{Use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or ledna\or \'unora\or
+ b\v{r}ezna\or dubna\or kv\v{e}tna\or \v{c}ervna\or \v{c}ervence\or
+ srpna\or z\'a\v{r}\'\i\or \v{r}\'{\i}jna\or listopadu\or
+ prosince\fi \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasczech}
+% \begin{macro}{\noextrasczech}
+% The macro |\extrasczech| will perform all the extra definitions
+% needed for the Czech language. The macro |\noextrasczech| is used
+% to cancel the actions of |\extrasczech|. This means saving the
+% meaning of two one-letter control sequences before defining them.
+%
+% For Czech texts \cs{frenchspacing} should be in effect. Language
+% group for shorthands is also set here.
+% \changes{czech-1.3e}{1995/03/14}{now use \cs{bbl@frenchspacing} and
+% \cs{bbl@nonfrenchspacing}}
+% \changes{czech-3.1}{2006/10/07}{move \cs{languageshorthands} here,
+% so that the language group is always initialized correctly}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing
+ \languageshorthands{czech}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \changes{czech-1.1a}{1992/07/07}{Removed typo, \cs{q} was restored
+% twice, once too many.}
+% \changes{czech-1.3e}{1995/03/15}{Use \LaTeX's \cs{v} and \cs{r}
+% accent commands}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\q\let\q\v
+ \babel@save\w\let\w\r}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sq}
+% \begin{macro}{\dq}
+% We save the original single and double quote characters in
+% \cs{sq} and \cs{dq} to make them available later.
+% \begin{macrocode}
+\begingroup\catcode`\"=12\catcode`\'=12
+\def\x{\endgroup
+ \def\sq{'}
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{czech-3.0}{2005/12/10}{Added default for setting hyphenmin
+% parameters. Values taken from \CS\LaTeX.}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+%
+% \begin{macro}{\v}
+% \LaTeX's normal |\v| accent places a caron over the letter that
+% follows it (\v{o}). This is not what we want for the letters d,
+% t, l and L; for those the accent should change shape. This is
+% acheived by the following.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\v}{OT1}{t}{%
+ t\kern-.23em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{d}{%
+ d\kern-.13em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{l}{\lcaron{}}
+ \DeclareTextCompositeCommand{\v}{OT1}{L}{\Lcaron{}}}
+% \end{macrocode}
+%
+% \begin{macro}{\lcaron}
+% \begin{macro}{\Lcaron}
+% For the letters \texttt{l} and \texttt{L} we want to disinguish
+% between normal fonts and monospaced fonts.
+% \begin{macrocode}
+\def\lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ l\kern-.13em\raise.24ex\hbox{'}\kern-.11em%
+ \else
+ l\raise.45ex\hbox to\z@{\kern-.35em '\hss}%
+ \fi}
+\def\Lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ L\raise.24ex\hbox to\z@{\kern-.28em'\hss}%
+ \else
+ L\raise.45ex\hbox to\z@{\kern-.40em '\hss}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Initialize active quotes. \CS\LaTeX{} provides a way of
+% converting English-style quotes into Czech-style ones. Both
+% single and double quotes are affected, i.e. |``text''| is
+% converted to something like |,,text``| and |`text'| is converted
+% to |,text`|. This conversion can be switched on and off with
+% \cs{csprimeson} and \cs{csprimesoff}.\footnote{By the way, the
+% names of these macros are misleading, because the handling of
+% primes in math mode is rather marginal, the most important thing
+% being the handling of quotes\ldots}
+%
+% These quotes present various troubles, e.g. the kerning is broken,
+% apostrophes are converted to closing single quote, some primitives
+% are broken (most notably the |\catcode`\|\meta{char} syntax will
+% not work any more), and writing them to \file{.aux} files cannot
+% be handled correctly. For these reasons, these commands are only
+% available in \CS\LaTeX{} compatibility mode.
+%
+% \begin{macrocode}
+\ifx\cs@compat@latex\relax
+ \let\cs@ltxprim@s\prim@s
+ \def\csprimeson{%
+ \catcode`\`\active \catcode`\'\active \let\prim@s\bbl@prim@s}
+ \def\csprimesoff{%
+ \catcode`\`12 \catcode`\'12 \let\prim@s\cs@ltxprim@s}
+ \begingroup\catcode`\`\active
+ \def\x{\endgroup
+ \def`{\futurelet\cs@next\cs@openquote}
+ \def\cs@openquote{%
+ \ifx`\cs@next \expandafter\cs@opendq
+ \else \expandafter\clq
+ \fi}%
+ }\x
+ \begingroup\catcode`\'\active
+ \def\x{\endgroup
+ \def'{\textormath{\futurelet\cs@next\cs@closequote}
+ {^\bgroup\prim@s}}
+ \def\cs@closequote{%
+ \ifx'\cs@next \expandafter\cs@closedq
+ \else \expandafter\crq
+ \fi}%
+ }\x
+ \def\cs@opendq{\clqq\let\cs@next= }
+ \def\cs@closedq{\crqq\let\cs@next= }
+% \end{macrocode}
+%
+% The way I recommend for typesetting quotes in Czech documents
+% is to use shorthands similar to those used in German.
+%
+% \begin{macrocode}
+\else
+ \initiate@active@char{"}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+ \declare@shorthand{czech}{"`}{\clqq}
+ \declare@shorthand{czech}{"'}{\crqq}
+ \declare@shorthand{czech}{"<}{\flqq}
+ \declare@shorthand{czech}{">}{\frqq}
+ \declare@shorthand{czech}{"=}{\cs@splithyphen}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\clqq}
+% This is the CS opening quote, which is similar to the German
+% quote (\cs{glqq}) but the kerning is different.
+%
+% For the OT1 encoding, the quote is constructed from the right
+% double quote (i.e. the ``Opening quotes'' character) by moving
+% it down to the baseline and shifting it to the right, or to the
+% left if italic correction is positive.
+%
+% For T1, the ``German Opening quotes'' is used. It is moved to
+% the right and the total width is enlarged. This is done in an
+% attempt to minimize the difference between the OT1 and T1
+% versions.
+%
+% \changes{3.0}{2006/04/20}{Added \cs{leavevmode} to allow an opening
+% quote at the beginning of a paragraph}
+% \begin{macrocode}
+\ProvideTextCommand{\clqq}{OT1}{%
+ \set@low@box{\textquotedblright}%
+ \setbox\@ne=\hbox{l\/}\dimen\@ne=\wd\@ne
+ \setbox\@ne=\hbox{l}\advance\dimen\@ne-\wd\@ne
+ \leavevmode
+ \ifdim\dimen\@ne>\z@\kern-.1em\box\z@\kern.1em
+ \else\kern.1em\box\z@\kern-.1em\fi\allowhyphens}
+\ProvideTextCommand{\clqq}{T1}
+ {\kern.1em\quotedblbase\kern-.0158em\relax}
+\ProvideTextCommandDefault{\clqq}{\UseTextSymbol{OT1}\clqq}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\crqq}
+% For OT1, the CS closing quote is basically the same as
+% \cs{grqq}, only the \cs{textormath} macro is not used, because
+% as far as I know, \cs{grqq} does not work in math mode anyway.
+%
+% For T1, the character is slightly wider and shifted to the
+% right to match its OT1 counterpart.
+%
+% \begin{macrocode}
+\ProvideTextCommand{\crqq}{OT1}
+ {\save@sf@q{\nobreak\kern-.07em\textquotedblleft\kern.07em}}
+\ProvideTextCommand{\crqq}{T1}
+ {\save@sf@q{\nobreak\kern.06em\textquotedblleft\kern.024em}}
+\ProvideTextCommandDefault{\crqq}{\UseTextSymbol{OT1}\crqq}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clq}
+% \begin{macro}{\crq}
+%
+% Single CS quotes are similar to double quotes (see the
+% discussion above).
+%
+% \begin{macrocode}
+\ProvideTextCommand{\clq}{OT1}
+ {\set@low@box{\textquoteright}\box\z@\kern.04em\allowhyphens}
+\ProvideTextCommand{\clq}{T1}
+ {\quotesinglbase\kern-.0428em\relax}
+\ProvideTextCommandDefault{\clq}{\UseTextSymbol{OT1}\clq}
+\ProvideTextCommand{\crq}{OT1}
+ {\save@sf@q{\nobreak\textquoteleft\kern.17em}}
+\ProvideTextCommand{\crq}{T1}
+ {\save@sf@q{\nobreak\textquoteleft\kern.17em}}
+\ProvideTextCommandDefault{\crq}{\UseTextSymbol{OT1}\crq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\uv}
+% There are two versions of \cs{uv}. The older one opens a group
+% and uses \cs{aftergroup} to typeset the closing quotes. This
+% version allows using \cs{verb} inside the quotes, because the
+% enclosed text is not passed as an argument, but unfortunately
+% it breaks any kerning with the quotes. Although the kerning
+% with the opening quote could be fixed, the kerning with the
+% closing quote cannot.
+%
+% The newer version is defined as a command with one parameter.
+% It preserves kerning but since the quoted text is passed as an
+% argument, it cannot contain \cs{verb}.
+%
+% Decide which version of \cs{uv} should be used. For sake
+% of compatibility, we use the older version with plain \TeX{}
+% and the newer version with \LaTeXe.
+% \begin{macrocode}
+\ifx\cs@compat@plain\@undefined\else\let\cs@olduv=\relax\fi
+\ifx\cs@olduv\@undefined
+ \DeclareRobustCommand\uv[1]{{\leavevmode\clqq#1\crqq}}
+\else
+ \DeclareRobustCommand\uv{\bgroup\aftergroup\closequotes
+ \leavevmode\clqq\let\cs@next=}
+ \def\closequotes{\unskip\crqq\relax}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\cs@wordlen}
+% Declare a counter to hold the length of the word after the
+% hyphen.
+%
+% \begin{macrocode}
+\newcount\cs@wordlen
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@hyphen}
+% \begin{macro}{\cs@endash}
+% \begin{macro}{\cs@emdash}
+% Store the original hyphen in a macro. Ditto for the ligatures.
+%
+% \changes{czech-3.1}{2006/10/07}{ensure correct catcode for the
+% saved hyphen}
+% \begin{macrocode}
+\begingroup\catcode`\-12
+\def\x{\endgroup
+ \def\cs@hyphen{-}
+ \def\cs@endash{--}
+ \def\cs@emdash{---}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@boxhyphen}
+% Provide a non-breakable hyphen to be used when a compound word
+% is too short to be split, i.e. the second part is shorter than
+% \cs{righthyphenmin}.
+%
+% \begin{macrocode}
+ \def\cs@boxhyphen{\hbox{-}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@splithyphen}
+% The macro \cs{cs@splithyphen} inserts a split hyphen, while
+% allowing both parts of the compound word to be hyphenated at
+% other places too.
+%
+% \begin{macrocode}
+ \def\cs@splithyphen{\kern\z@
+ \discretionary{-}{\char\hyphenchar\the\font}{-}\nobreak\hskip\z@}
+}\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{-}
+% To minimize the effects of activating the hyphen character,
+% the active definition expands to the non-active character
+% in all cases where hyphenation cannot occur, i.e. if not
+% typesetting (check \cs{protect}), not in horizontal mode,
+% or in inner horizontal mode.
+%
+% \begin{macrocode}
+\initiate@active@char{-}
+\declare@shorthand{czech}{-}{%
+ \ifx\protect\@typeset@protect
+ \ifhmode
+ \ifinner
+ \bbl@afterelse\bbl@afterelse\bbl@afterelse\cs@hyphen
+ \else
+ \bbl@afterfi\bbl@afterelse\bbl@afterelse\cs@firsthyphen
+ \fi
+ \else
+ \bbl@afterfi\bbl@afterelse\cs@hyphen
+ \fi
+ \else
+ \bbl@afterfi\cs@hyphen
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@firsthyphen}
+% \begin{macro}{\cs@firsthyph@n}
+% \begin{macro}{\cs@secondhyphen}
+% \begin{macro}{\cs@secondhyph@n}
+% If we encounter a hyphen, check whether it is followed
+% by a second or a third hyphen and if so, insert the
+% corresponding ligature.
+%
+% If we don't find a hyphen, the token found will be placed
+% in \cs{cs@token} for further analysis, and it will also stay
+% in the input.
+%
+% \begin{macrocode}
+\begingroup\catcode`\-\active
+\def\x{\endgroup
+ \def\cs@firsthyphen{\futurelet\cs@token\cs@firsthyph@n}
+ \def\cs@firsthyph@n{%
+ \ifx -\cs@token
+ \bbl@afterelse\cs@secondhyphen
+ \else
+ \bbl@afterfi\cs@checkhyphen
+ \fi}
+ \def\cs@secondhyphen ##1{%
+ \futurelet\cs@token\cs@secondhyph@n}
+ \def\cs@secondhyph@n{%
+ \ifx -\cs@token
+ \bbl@afterelse\cs@emdash\@gobble
+ \else
+ \bbl@afterfi\cs@endash
+ \fi}
+}\x
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkhyphen}
+% Check that hyphenation is enabled, and if so, start analyzing
+% the rest of the word, i.e. initialize \cs{cs@word} and \cs{cs@wordlen}
+% and start processing input with \cs{cs@scanword}.
+%
+% \begin{macrocode}
+\def\cs@checkhyphen{%
+ \ifnum\expandafter\hyphenchar\the\font=`\-
+ \def\cs@word{}\cs@wordlen\z@
+ \bbl@afterelse\cs@scanword
+ \else
+ \cs@hyphen
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@scanword}
+% \begin{macro}{\cs@continuescan}
+% \begin{macro}{\cs@gettoken}
+% \begin{macro}{\cs@gett@ken}
+% Each token is first analyzed with \cs{cs@scanword}, which expands
+% the token and passes the first token of the result to
+% \cs{cs@gett@ken}. If the expanded token is not identical to the
+% unexpanded one, presume that it might be expanded further and
+% pass it back to \cs{cs@scanword} until you get an unexpandable
+% token. Then analyze it in \cs{cs@examinetoken}.
+%
+% The \cs{cs@continuescan} macro does the same thing as
+% \cs{cs@scanword}, but it does not require the first token to be
+% in \cs{cs@token} already.
+%
+% \begin{macrocode}
+\def\cs@scanword{\let\cs@lasttoken= \cs@token\expandafter\cs@gettoken}
+\def\cs@continuescan{\let\cs@lasttoken\@undefined\expandafter\cs@gettoken}
+\def\cs@gettoken{\futurelet\cs@token\cs@gett@ken}
+\def\cs@gett@ken{%
+ \ifx\cs@token\cs@lasttoken \def\cs@next{\cs@examinetoken}%
+ \else \def\cs@next{\cs@scanword}%
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{cs@examinetoken}
+% Examine the token in \cs{cs@token}:
+%
+% \begin{itemize}
+% \item
+% If it is a letter (catcode 11) or other (catcode 12), add it
+% to \cs{cs@word} with \cs{cs@addparam}.
+%
+% \item
+% If it is the \cs{char} primitive, add it with \cs{cs@expandchar}.
+%
+% \item
+% If the token starts or ends a group, ignore it with
+% \cs{cs@ignoretoken}.
+%
+% \item
+% Otherwise analyze the meaning of the token with
+% \cs{cs@checkchardef} to detect primitives defined with
+% \cs{chardef}.
+%
+% \end{itemize}
+%
+% \begin{macrocode}
+\def\cs@examinetoken{%
+ \ifcat A\cs@token
+ \def\cs@next{\cs@addparam}%
+ \else\ifcat 0\cs@token
+ \def\cs@next{\cs@addparam}%
+ \else\ifx\char\cs@token
+ \def\cs@next{\afterassignment\cs@expandchar\let\cs@token= }%
+ \else\ifx\bgroup\cs@token
+ \def\cs@next{\cs@ignoretoken\bgroup}%
+ \else\ifx\egroup\cs@token
+ \def\cs@next{\cs@ignoretoken\egroup}%
+ \else\ifx\begingroup\cs@token
+ \def\cs@next{\cs@ignoretoken\begingroup}%
+ \else\ifx\endgroup\cs@token
+ \def\cs@next{\cs@ignoretoken\endgroup}%
+ \else
+ \def\cs@next{\expandafter\expandafter\expandafter\cs@checkchardef
+ \expandafter\meaning\expandafter\cs@token\string\char\end}%
+ \fi\fi\fi\fi\fi\fi\fi\cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkchardef}
+% Check the meaning of a token and if it is a primitive defined
+% with \cs{chardef}, pass it to \cs{\cs@examinechar} as if it were
+% a \cs{char} sequence. Otherwise, there are no more word characters,
+% so do the final actions in \cs{cs@nosplit}.
+%
+% \begin{macrocode}
+\expandafter\def\expandafter\cs@checkchardef
+ \expandafter#\expandafter1\string\char#2\end{%
+ \def\cs@token{#1}%
+ \ifx\cs@token\@empty
+ \def\cs@next{\afterassignment\cs@examinechar\let\cs@token= }%
+ \else
+ \def\cs@next{\cs@nosplit}%
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@ignoretoken}
+% Add a token to \cs{cs@word} but do not update the \cs{cs@wordlen}
+% counter. This is mainly useful for group starting and ending
+% primitives, which need to be preserved, but do not affect the word
+% boundary.
+%
+% \begin{macrocode}
+\def\cs@ignoretoken#1{%
+ \edef\cs@word{\cs@word#1}%
+ \afterassignment\cs@continuescan\let\cs@token= }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{cs@addparam}
+% Add a token to \cs{cs@word} and check its lccode. Note that
+% this macro can only be used for tokens which can be passed as
+% a parameter.
+%
+% \begin{macrocode}
+\def\cs@addparam#1{%
+ \edef\cs@word{\cs@word#1}%
+ \cs@checkcode{\lccode`#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@expandchar}
+% \begin{macro}{\cs@examinechar}
+% Add a \cs{char} sequence to \cs{cs@word} and check its lccode.
+% The charcode is first parsed in \cs{cs@expandchar} and then the
+% resulting \cs{chardef}-defined sequence is analyzed in
+% \cs{cs@examinechar}.
+%
+% \begin{macrocode}
+\def\cs@expandchar{\afterassignment\cs@examinechar\chardef\cs@token=}
+\def\cs@examinechar{%
+ \edef\cs@word{\cs@word\char\the\cs@token\space}%
+ \cs@checkcode{\lccode\cs@token}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkcode}
+% Check the lccode of a character. If it is zero, it does not count
+% to the current word, so finish it with \cs{cs@nosplit}. Otherwise
+% update the \cs{cs@wordlen} counter and go on scanning the word
+% with \cs{cs@continuescan}. When enough characters are gathered in
+% \cs{cs@word} to allow word break, insert the split hyphen and
+% finish.
+%
+% \begin{macrocode}
+\def\cs@checkcode#1{%
+ \ifnum0=#1
+ \def\cs@next{\cs@nosplit}%
+ \else
+ \advance\cs@wordlen\@ne
+ \ifnum\righthyphenmin>\the\cs@wordlen
+ \def\cs@next{\cs@continuescan}%
+ \else
+ \cs@splithyphen
+ \def\cs@next{\cs@word}%
+ \fi
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@nosplit}
+% Insert a non-breakable hyphen followed by the saved word.
+%
+% \begin{macrocode}
+\def\cs@nosplit{\cs@boxhyphen\cs@word}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@hyphen}
+% The \cs{minus} sequence can be used where the active hyphen
+% does not work, e.g. in arguments to \TeX{} primitives in outer
+% horizontal mode.
+%
+% \begin{macrocode}
+\let\minus\cs@hyphen
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\standardhyphens}
+% \begin{macro}{\splithyphens}
+% These macros control whether split hyphens are allowed in Czech
+% and/or Slovak texts. You may use them in any language, but the
+% split hyphen is only activated for Czech and Slovak.
+%
+% \changes{czech-3.1}{2006/10/07}{activate with split hyphens and
+% deactivate with standard hyphens, not vice versa}
+% \begin{macrocode}
+\def\standardhyphens{\cs@splithyphensfalse\cs@deactivatehyphens}
+\def\splithyphens{\cs@splithyphenstrue\cs@activatehyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@splitattr}
+% Now we declare the |split| language attribute. This is
+% similar to the |split| package option of cslatex, but it
+% only affects Czech, not Slovak.
+%
+% \changes{czech-3.1}{2006/10/07}{attribute added}
+% \begin{macrocode}
+\def\cs@splitattr{\babel@save\ifcs@splithyphens\splithyphens}
+\bbl@declare@ttribute{czech}{split}{%
+ \addto\extrasczech{\cs@splitattr}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@activatehyphens}
+% \begin{macro}{\cs@deactivatehyphens}
+% These macros are defined as \cs{relax} by default to prevent
+% activating/deactivating the hyphen character. They are redefined
+% when the language is switched to Czech/Slovak. At that moment
+% the hyphen is also activated if split hyphens were requested with
+% \cs{splithyphens}.
+%
+% When the language is de-activated, de-activate the hyphen and
+% restore the bogus definitions of these macros.
+%
+% \begin{macrocode}
+\let\cs@activatehyphens\relax
+\let\cs@deactivatehyphens\relax
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\cs@activatehyphens{\bbl@activate{-}}%
+ \def\cs@deactivatehyphens{\bbl@deactivate{-}}%
+ \ifcs@splithyphens\cs@activatehyphens\fi}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \cs@deactivatehyphens
+ \let\cs@activatehyphens\relax
+ \let\cs@deactivatehyphens\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@looseness}
+% \begin{macro}{\looseness}
+% One of the most common situations where an active hyphen will not
+% work properly is the \cs{looseness} primitive. Change its definition
+% so that it deactivates the hyphen if needed.
+%
+% \begin{macrocode}
+\let\cs@looseness\looseness
+\def\looseness{%
+ \ifcs@splithyphens
+ \cs@deactivatehyphens\afterassignment\cs@activatehyphens \fi
+ \cs@looseness}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@selectlanguage}
+% \begin{macro}{\cs@main@language}
+% Specifying the |nocaptions| option means that captions and dates
+% are not redefined by default, but they can be switched on later
+% with \cs{captionsczech} and/or \cs{dateczech}.
+%
+% We mimic this behavior by redefining \cs{selectlanguage}. This
+% macro is called once at the beginning of the document to set the
+% main language of the document. If this is \cs{cs@main@language},
+% it disables the macros for setting captions and date. In any
+% case, it restores the original definition of \cs{selectlanguage}
+% and expands it.
+%
+% The definition of \cs{selectlanguage} can be shared between Czech
+% and Slovak; the actual language is stored in \cs{cs@main@language}.
+%
+% \begin{macrocode}
+\ifx\cs@nocaptions\@undefined\else
+ \edef\cs@main@language{\CurrentOption}
+ \ifx\cs@origselect\@undefined
+ \let\cs@origselect=\selectlanguage
+ \def\selectlanguage{%
+ \let\selectlanguage\cs@origselect
+ \ifx\bbl@main@language\cs@main@language
+ \expandafter\cs@selectlanguage
+ \else
+ \expandafter\selectlanguage
+ \fi}
+ \def\cs@selectlanguage{%
+ \cs@tempdisable{captions}%
+ \cs@tempdisable{date}%
+ \selectlanguage}
+% \end{macrocode}
+%
+% \begin{macro}{\cs@tempdisable}
+% \cs{cs@tempdisable} disables a language setup macro temporarily,
+% i.e. the macro with the name of \meta{\#1}|\bbl@main@language|
+% just restores the original definition and purges the saved macro
+% from memory.
+%
+% \begin{macrocode}
+ \def\cs@tempdisable#1{%
+ \def\@tempa{cs@#1}%
+ \def\@tempb{#1\bbl@main@language}%
+ \expandafter\expandafter\expandafter\let
+ \expandafter \csname\expandafter \@tempa \expandafter\endcsname
+ \csname \@tempb \endcsname
+ \expandafter\edef\csname \@tempb \endcsname{%
+ \let \expandafter\noexpand \csname \@tempb \endcsname
+ \expandafter\noexpand \csname \@tempa \endcsname
+ \let \expandafter\noexpand\csname \@tempa \endcsname
+ \noexpand\@undefined}}
+% \end{macrocode}
+% \end{macro}
+%
+% These macros are not needed, once the initialization is over.
+%
+% \begin{macrocode}
+ \@onlypreamble\cs@main@language
+ \@onlypreamble\cs@origselect
+ \@onlypreamble\cs@selectlanguage
+ \@onlypreamble\cs@tempdisable
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The encoding of mathematical fonts should be changed to IL2. This
+% allows to use accented letter in some font families. Besides,
+% documents do not use CM fonts if there are equivalents in CS-fonts,
+% so there is no need to have both bitmaps of CM-font and CS-font.
+%
+% \cs{@font@warning} and \cs{@font@info} are temporarily redefined
+% to avoid annoying font warnings.
+%
+% \begin{macrocode}
+\ifx\cs@compat@plain\@undefined
+\ifx\cs@check@enc\@undefined\else
+ \def\cs@check@enc{
+ \ifx\encodingdefault\cs@iltw@
+ \let\cs@warn\@font@warning \let\@font@warning\@gobble
+ \let\cs@info\@font@info \let\@font@info\@gobble
+ \SetSymbolFont{operators}{normal}{\cs@iltw@}{cmr}{m}{n}
+ \SetSymbolFont{operators}{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathbf{normal}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{normal}{\cs@iltw@}{cmr}{m}{it}
+ \SetMathAlphabet\mathrm{normal}{\cs@iltw@}{cmr}{m}{n}
+ \SetMathAlphabet\mathsf{normal}{\cs@iltw@}{cmss}{m}{n}
+ \SetMathAlphabet\mathtt{normal}{\cs@iltw@}{cmtt}{m}{n}
+ \SetMathAlphabet\mathbf{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{bold}{\cs@iltw@}{cmr}{bx}{it}
+ \SetMathAlphabet\mathrm{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathsf{bold}{\cs@iltw@}{cmss}{bx}{n}
+ \SetMathAlphabet\mathtt{bold}{\cs@iltw@}{cmtt}{m}{n}
+ \let\@font@warning\cs@warn \let\cs@warn\@undefined
+ \let\@font@info\cs@info \let\cs@info\@undefined
+ \fi
+ \let\cs@check@enc\@undefined}
+ \AtBeginDocument{\cs@check@enc}
+\fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{cs@undoiltw@}
+%
+% The thing is that \LaTeXe{} core only supports the T1 encoding
+% and does not bother changing the uc/lc/sfcodes when encoding
+% is switched. :( However, the IL2 encoding \emph{does} change
+% these codes, so if encoding is switched back from IL2, we must
+% also undo the effect of this change to be compatible with
+% \LaTeXe. OK, this is not the right\textsuperscript{TM} solution
+% but it works. Cheers to Petr Ol\v s\'ak.
+%
+% \begin{macrocode}
+\def\cs@undoiltw@{%
+ \uccode158=208 \lccode158=158 \sfcode158=1000
+ \sfcode159=1000
+ \uccode165=133 \lccode165=165 \sfcode165=1000
+ \uccode169=137 \lccode169=169 \sfcode169=1000
+ \uccode171=139 \lccode171=171 \sfcode171=1000
+ \uccode174=142 \lccode174=174 \sfcode174=1000
+ \uccode181=149
+ \uccode185=153
+ \uccode187=155
+ \uccode190=0 \lccode190=0
+ \uccode254=222 \lccode254=254 \sfcode254=1000
+ \uccode255=223 \lccode255=255 \sfcode255=1000}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@@enc@update}
+%
+% Redefine the \LaTeXe{} internal function \cs{@@enc@update} to
+% change the encodings correctly.
+%
+% \begin{macrocode}
+\ifx\cs@enc@update\@undefined
+\ifx\@@enc@update\@undefined\else
+ \let\cs@enc@update\@@enc@update
+ \def\@@enc@update{\ifx\cf@encoding\cs@iltw@\cs@undoiltw@\fi
+ \cs@enc@update
+ \expandafter\ifnum\csname l@\languagename\endcsname=\the\language
+ \expandafter\ifx
+ \csname l@\languagename:\f@encoding\endcsname\relax
+ \else
+ \expandafter\expandafter\expandafter\let
+ \expandafter\csname
+ \expandafter l\expandafter @\expandafter\languagename
+ \expandafter\endcsname\csname l@\languagename:\f@encoding\endcsname
+ \fi
+ \language=\csname l@\languagename\endcsname\relax
+ \fi}
+\fi\fi
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{czech-1.3h}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/czech/czech.ins b/macros/latex/contrib/babel-contrib/czech/czech.ins
new file mode 100644
index 0000000000..587a0a8f89
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/czech/czech.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{czech.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{czech.ldf}{\from{czech.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/czech/czech.pdf b/macros/latex/contrib/babel-contrib/czech/czech.pdf
new file mode 100644
index 0000000000..2a3d08a980
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/czech/czech.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/danish/danish.dtx b/macros/latex/contrib/babel-contrib/danish/danish.dtx
new file mode 100644
index 0000000000..ba05ec2f82
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/danish/danish.dtx
@@ -0,0 +1,337 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2009 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{160}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{danish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{danish}
+%\fi
+%\ProvidesFile{danish.dtx}
+ [2009/09/19 v1.3r Danish support from the babel system]
+%\iffalse
+%% File `danish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2009
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.xs4all.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Danish language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{danish.dtx}
+\end{document}
+%</filedriver>
+% A contribution was made by Henning Larsen (larsen@cernvm.cern.ch)
+%\fi
+% \GetFileInfo{danish.dtx}
+%
+% \changes{danish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{danish-1.1}{1992/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{danish-1.3}{1994/02/27}{Update for \LaTeXe}
+% \changes{danish-1.3f}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{danish-1.3g}{1995/06/08}{Added the active double quote
+% character as suggested by Peter Busk Laursen}
+% \changes{danish-1.3j}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Danish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Henning Larsen
+% (\texttt{larsen@cernvm.cern.ch})} defines all the
+% language definition macros for the Danish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:danish-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"`| & lowered double left quotes (looks like ,,)\\
+% |"'| & normal double right quotes\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word.
+% \end{tabular}
+% \caption{The extra definitions made by \file{danish.ldf}}
+% \label{tab:danish-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{danish-1.3j}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{danish}\captionsdanish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{danish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@danish| to see whether we have to do something here.
+%
+% \changes{danish-1.0b}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{danish-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{danish-1.3f}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@danish\@undefined
+ \@nopatterns{Danish}
+ \adddialect\l@danish0\fi
+% \end{macrocode}
+%
+% \begin{macro}{\englishhyphenmins}
+% \changes{danish-1.3p}{2003/11/17}{Added default for setting of
+% hyphenmin parameters}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{danish-1.3q}{2008/03/17}{Set lefthyphenmin to two}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Danish language.
+%
+% \begin{macro}{\captionsdanish}
+% The macro |\captionsdanish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{danish-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{danish-1.2}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{danish-1.2b}{1993/10/23}{Added a few translations}
+% \changes{danish-1.3c}{1994/06/04}{Included some revisions from Peter
+% Busk Larsen}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{danish-1.3i}{1995/07/13}{Added translation of `Proof'}
+% \changes{danish-1.3n}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{danish-1.3o}{2003/04/10}{Added translation of `Glossary'}
+% \begin{macrocode}
+\addto\captionsdanish{%
+ \def\prefacename{Forord}%
+ \def\refname{Litteratur}%
+ \def\abstractname{Resum\'e}%
+ \def\bibname{Litteratur}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Bilag}%
+ \def\contentsname{Indhold}%
+ \def\listfigurename{Figurer}%
+ \def\listtablename{Tabeller}%
+ \def\indexname{Indeks}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabel}%
+ \def\partname{Del}%
+ \def\enclname{Vedlagt}%
+ \def\ccname{Kopi til}% or Kopi sendt til
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Se}%
+ \def\alsoname{Se ogs{\aa}}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Gloseliste}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datedanish}
+% The macro |\datedanish| redefines the command |\today| to produce
+% Danish dates.
+% \changes{danish-1.3a}{1994/03/23}{Added `.' to definition of
+% \cs{today}}
+% \changes{danish-1.3k}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{danish-1.3k}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datedanish{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or marts\or april\or maj\or juni\or
+ juli\or august\or september\or oktober\or november\or december\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasdanish}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{bbl@frenchspacing}}
+% \begin{macro}{\noextrasdanish}
+% \changes{danish-1.3h}{1995/07/02}{Added \cs{bbl@nonfrenchspacing}}
+% The macro |\extrasdanish| will perform all the extra definitions
+% needed for the Danish language. The macro |\noextrasdanish| is
+% used to cancel the actions of |\extrasdanish|.
+%
+% Danish typesetting requires |\frenchspacing| to be in effect.
+% \begin{macrocode}
+\addto\extrasdanish{\bbl@frenchspacing}
+\addto\noextrasdanish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+%
+% For Danish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the danish group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasdanish{\languageshorthands{danish}}
+\addto\extrasdanish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{danish-1.3m}{1999/12/16}{Deactivate shorthands ouside of
+% Danish}
+% \begin{macrocode}
+\addto\noextrasdanish{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% First we define access to the low opening double quote and
+% guillemets for quotations,
+% \changes{danish-1.3j}{1996/08/15}{Changed definition of \texttt{"'}
+% to print \texttt{``} instead of \texttt{''}}
+% \changes{danish-1.3k}{1997/04/03}{Removed empty groups after double
+% quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{danish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{danish}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{danish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{danish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define commands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \changes{danish-1.3j}{1996/08/15}{Added definition of
+% \texttt{"\char126} and \texttt{"\char61}}
+% \begin{macrocode}
+\declare@shorthand{danish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{danish}{""}{\hskip\z@skip}
+\declare@shorthand{danish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{danish}{"=}{\nobreak-\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{danish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+%
+% To enable hyphenation in two words, written together but
+% separated by a slash, as in `uitdrukking/opmerking' we define the
+% command |"/|.
+% \changes{danish-1.3q}{2008/03/17}{Added definition of \texttt{"/}
+% from \texttt{dutch.ldf}}
+% \changes{danish-1.3r}{2009/09/19}{Made "/ a real Danish shorthand}
+% \begin{macrocode}
+\declare@shorthand{danish}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+% \changes{danish-1.3q}{2008/03/17}{Added redefinition of \cs{-} from
+% \texttt{dutch.ldf}}
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch and German, where
+% long compound words are quite normal and all one needs is a means
+% to indicate an extra hyphenation position on top of the ones that
+% \TeX\ can generate from the hyphenation patterns.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\-}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{danish-1.3j}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{danish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/danish/danish.ins b/macros/latex/contrib/babel-contrib/danish/danish.ins
new file mode 100644
index 0000000000..5b113c6159
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/danish/danish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2009 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{danish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{danish.ldf}{\from{danish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/danish/danish.pdf b/macros/latex/contrib/babel-contrib/danish/danish.pdf
new file mode 100644
index 0000000000..2f1efd5605
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/danish/danish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/dutch/dutch.dtx b/macros/latex/contrib/babel-contrib/dutch/dutch.dtx
new file mode 100644
index 0000000000..24e2031922
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/dutch/dutch.dtx
@@ -0,0 +1,560 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{300}
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{dutch.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{dutch}
+%\fi
+%\ProvidesFile{dutch.dtx}
+ [2005/03/30 v3.8i Dutch support from the babel system]
+%\iffalse
+%% File `dutch.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Dutch Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Dutch language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\makeatletter
+\gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
+ \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
+ \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@
+ \dp\z@=\dp\tw@ \box\z@\kern-.04em}}
+\makeatother
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{dutch.dtx}
+\end{document}
+%</filedriver>
+% \fi
+% \GetFileInfo{dutch.dtx}
+%
+% \changes{dutch-2.0a}{1990/04/02}{Added checking of format}
+% \changes{dutch-2.0b}{1990/04/02}{Added extrasdutch}
+% \changes{dutch-2.0c}{1990/04/18}{Added grqq macros}
+% \changes{dutch-2.1}{1990/04/24}{reflect change to version 2.1 in
+% babel and changes in german v2.3}
+% \changes{dutch-2.1a}{1990/05/01}{Incorporated Nico's comments}
+% \changes{dutch-2.1b}{1990/07/04}{Incorporated more comments by Nico}
+% \changes{dutch-2.1c}{1990/07/16}{Fixed some typos}
+% \changes{dutch-2.2}{1990/07/16}{Fixed problem with the use of
+% \texttt{"} in moving arguments while \texttt{"} is active}
+% \changes{dutch-2.3}{1990/07/30}{When using PostScript fonts with the
+% Adobe font-encoding, the dieresis-accent is located elsewhere,
+% modified code}
+% \changes{dutch-2.3a}{1990/08/27}{Modified the documentation somewhat}
+% \changes{dutch-3.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{dutch-3.0a}{1991/05/25}{Removed some problems in change log}
+% \changes{dutch-3.1}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{dutch-3.2a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{dutch-3.3}{1991/10/31}{Rewritten parts of the code to use
+% the new features of babel version 3.1}
+% \changes{dutch-3.6}{1994/02/02}{Update or LaTeX2e}
+% \changes{dutch-3.6c}{1994/06/26}{Removed the use of \cs{filedate},
+% moved identification after the loading of babel.def}
+% \changes{dutch-3.7a}{1995/02/03}{Moved identification code to the
+% top of the file}
+% \changes{dutch-3.7a}{1995/02/04}{Rewrote the code with respect to
+% the active double quote character}
+% \changes{dutch-3.7f}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{dutch-3.8a}{1996/10/04}{Merged in the definitions for
+% `afrikaans'}
+%
+% \section{The Dutch language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion, and was last revised on
+% \filedate.} defines all the language-specific macros for the Dutch
+% language and the `Afrikaans' version\footnote{contributed by
+% Stoffel Lombard (\texttt{lombc@b31pc87.up.ac.za})} of it.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:dutch-quote} an overview is given of its purpose.
+% One of the reasons for this is that in the Dutch language a word
+% with a dieresis can be hyphenated just before the letter with the
+% umlaut, but the dieresis has to disappear if the word is broken
+% between the previous letter and the accented letter.
+%
+% In~\cite{treebus} the quoting conventions for the Dutch language
+% are discussed. The preferred convention is the single-quote
+% Anglo-American convention, i.e. `This is a quote'. An
+% alternative is the slightly old-fashioned Dutch method with
+% initial double quotes lowered to the baseline, \dlqq This is a
+% quote'', which should be typed as \texttt{"`This is a quote"'}.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |"a| & |\"a| which hyphenates as |-a|;
+% also implemented for the other letters. \\
+% |"y| & puts a negative kern between \texttt{i} and \texttt{j}\\
+% |"Y| & puts a negative kern between \texttt{I} and \texttt{J}\\
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |"~| & to produce a hyphencharcter without the following
+% |\discretionary{}{}{}|.\\
+% |""| & to produce an invisible `breakpoint'.\\
+% |"`| & lowered double left quotes (see example below).\\
+% |"'| & normal double right quotes. \\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word.
+% \end{tabular}
+% \caption{The extra definitions made by \file{dutch.ldf}}
+% \label{tab:dutch-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% \changes{dutch-3.2c}{1991/10/22}{Removed code to load
+% \file{latexhax.com}}
+% \changes{dutch-3.2a}{1991/07/15}{Added reset of catcode of @ before
+% \cs{endinput}.}
+% \changes{dutch-3.2c}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{dutch-3.3a}{1991/11/11}{Moved code to the beginning of the
+% file and added \cs{selectlanguage} call}
+% \begin{macrocode}
+% \changes{dutch-3.8a}{1996/10/04}{made check dependant on
+% \cs{CurrentOption}}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{dutch-3.8a}{1996/10/30}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{dutch} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@dutch| or |l@afrikaans| to see whether we have to do
+% something here.
+%
+% First we try to establish with which option we are being
+% processed.
+%
+% \changes{dutch-3.0}{1991/04/23}{Now use \cs{adddialect} if language
+% undefined}
+% \changes{dutch-3.2c}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{dutch-3.3b}{1992/01/25}{Added warning, if no dutch patterns
+% loaded}
+% \changes{dutch-3.6c}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \changes{dutch-3.8a}{1996/10/04}{this needs a more complicated check
+% as `afrikaans' may or may not have its own hyphenation patterns}
+% \begin{macrocode}
+\def\bbl@tempa{dutch}
+\ifx\CurrentOption\bbl@tempa
+% \end{macrocode}
+% If it is \Lopt{dutch} then we first check if the Dutch
+% hyphenation patterns wer loaded,
+% \begin{macrocode}
+ \ifx\l@dutch\undefined
+% \end{macrocode}
+% if no we issue a warning and make dutch a `dialect' of either the
+% hyphenation patterns that were loaded in slot 0 or of `afrikaans'
+% when it is available.
+% \begin{macrocode}
+ \@nopatterns{Dutch}
+ \ifx\l@afrikaans\undefined
+ \adddialect\l@dutch0
+ \else
+ \adddialect\l@dutch\l@afrikaans
+ \fi
+ \fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Dutch language.
+%
+% \begin{macro}{\captionsdutch}
+% The macro |\captionsdutch| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.1a}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{dutch-3.3a}{1991/11/11}{added \cs{seename} and
+% \cs{alsoname}}
+% \changes{dutch-3.3b}{1992/01/25}{added \cs{prefacename}}
+% \changes{dutch-3.5}{1993/07/11}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{dutch-3.7c}{1995/06/08}{We need the \texttt{"} to be active
+% while defining \cs{captionsdutch}}
+% \changes{dutch-3.7d}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{dutch-3.8b}{1997/01/06}{Use \texttt{Bew"ys} instead of
+% \texttt{Bewijs}}
+% \changes{dutch-3.8h}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+ \begingroup
+ \catcode`\"\active
+ \def\x{\endgroup
+ \def\captionsdutch{%
+ \def\prefacename{Voorwoord}%
+ \def\refname{Referenties}%
+ \def\abstractname{Samenvatting}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Hoofdstuk}%
+ \def\appendixname{B"ylage}%
+ \def\contentsname{Inhoudsopgave}%
+ \def\listfigurename{L"yst van figuren}%
+ \def\listtablename{L"yst van tabellen}%
+ \def\indexname{Index}%
+ \def\figurename{Figuur}%
+ \def\tablename{Tabel}%
+ \def\partname{Deel}%
+ \def\enclname{B"ylage(n)}%
+ \def\ccname{cc}%
+ \def\headtoname{Aan}%
+ \def\pagename{Pagina}%
+ \def\seename{zie}%
+ \def\alsoname{zie ook}%
+ \def\proofname{Bew"ys}%
+ \def\glossaryname{Verklarende Woordenl"yst}%
+ }
+ }\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datedutch}
+% The macro |\datedutch| redefines the command |\today| to produce
+% Dutch dates.
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.8e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{dutch-3.8e}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+ \def\datedutch{%
+ \def\today{\number\day~\ifcase\month\or
+ januari\or februari\or maart\or april\or mei\or juni\or
+ juli\or augustus\or september\or oktober\or november\or
+ december\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% When the option with which this file is being process was not
+% \Lopt{dutch} we assume it was \Lopt{afrikaans}. We perform a
+% similar check on the availability of the hyphenation paterns.
+% \begin{macrocode}
+\else
+ \ifx\l@afrikaans\undefined
+ \@nopatterns{Afrikaans}
+ \ifx\l@dutch\undefined
+ \adddialect\l@afrikaans0
+ \else
+ \adddialect\l@afrikaans\l@dutch
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \begin{macro}{\captionsafrikaans}
+% Now is the time to define the words for `Afrikaans'.
+% \begin{macrocode}
+ \def\captionsafrikaans{%
+ \def\prefacename{Voorwoord}%
+ \def\refname{Verwysings}%
+ \def\abstractname{Samevatting}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Hoofstuk}%
+ \def\appendixname{Bylae}%
+ \def\contentsname{Inhoudsopgawe}%
+ \def\listfigurename{Lys van figure}%
+ \def\listtablename{Lys van tabelle}%
+ \def\indexname{Inhoud}%
+ \def\figurename{Figuur}%
+ \def\tablename{Tabel}%
+ \def\partname{Deel}%
+ \def\enclname{Bylae(n)}%
+ \def\ccname{a.a.}%
+ \def\headtoname{Aan}%
+ \def\pagename{Bladsy}%
+ \def\seename{sien}%
+ \def\alsoname{sien ook}%
+ \def\proofname{Bewys}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateafrikaans}
+% Here is the `Afrikaans' version of the date macro.
+% \changes{dutch-3.8e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{dutch-3.8e}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+ \def\dateafrikaans{%
+ \def\today{\number\day~\ifcase\month\or
+ Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
+ Julie\or Augustus\or September\or Oktober\or November\or
+ Desember\fi
+ \space \number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasdutch}
+% \begin{macro}{\extrasafrikaans}
+% \changes{dutch-3.0b}{1991/05/29}{added some comment chars to prevent
+% white space}
+% \changes{dutch-3.1a}{1991/06/6}{Removed \cs{global} definitions}
+% \changes{dutch-3.2}{1991/07/02}{Save all redefined macros}
+% \changes{dutch-3.3}{1991/10/31}{Macro complete rewritten}
+% \changes{dutch-3.3b}{1992/01/25}{modified handling of
+% \cs{dospecials} and \cs{@sanitize}}
+%
+% \begin{macro}{\noextrasdutch}
+% \begin{macro}{\noextrasafrikaans}
+% \changes{dutch-2.3}{1990/07/30}{Added \cs{dieresis}}
+% \changes{dutch-3.0b}{1991/05/29}{added some comment chars to prevent
+% white space}
+% \changes{dutch-3.1a}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{dutch-3.2}{1991/07/02}{Try to restore everything to its
+% former state}
+% \changes{dutch-3.3}{1991/10/31}{Macro complete rewritten}
+% \changes{dutch-3.3b}{1992/01/25}{modified handling of \cs{dospecials}
+% and \cs{@sanitize}}
+% \changes{dutch-3.8a}{1996/10/04}{Made all definitions dependant on
+% \cs{CurrentOption}}
+%
+% The macros |\extrasdutch| and |\captionsafrikaans| will perform
+% all the extra definitions needed for the Dutch language. The
+% macros |\noextrasdutch| and |noextrasafrikaans| is used
+% to cancel the actions of |\extrasdutch| and |\captionsafrikaans|.
+%
+% For Dutch the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the dutch group of shorthands should
+% be used.
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+% Both version of the language use the same set of shorthand
+% definitions althoug the `ij' is not used in Afrikaans.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{\languageshorthands{dutch}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+%
+% The `umlaut' character should be positioned lower on \emph{all}
+% vowels in Dutch texts.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \umlautlow\umlautelow}
+\@namedef{noextras\CurrentOption}{%
+ \umlauthigh}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\dutchhyphenmins}
+% \begin{macro}{\afrikaanshyphenmins}
+% The dutch hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~3.
+% \changes{dutch-3.7a}{1995/05/13}{use \cs{dutchhyphenmins} to store
+% the correct values}
+% \changes{dutch-3.8h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{dutch-3.3a}{1991/11/11}{Added \cs{save@sf@q} macro from
+% germanb and rewrote all quote macros to use it}
+% \changes{dutch-3.4b}{1991/02/16}{moved definition of
+% \cs{allowhyphens}, \cs{set@low@box} and \cs{save@sf@q} to
+% \file{babel.com}}
+% \changes{dutch-3.7a}{1995/02/04}{Removed \cs{dlqq}, \cs{@dlqq},
+% \cs{drqq}, \cs{@drqq} and \cs{dieresis}}
+% \changes{dutch-3.7a}{1995/02/15}{moved the definition of the double
+% quote character at the baseline to \file{glyhps.def}}
+%
+% \begin{macro}{\@trema}
+% In the Dutch language vowels with a trema are treated
+% specially. If a hyphenation occurs before a vowel-plus-trema, the
+% trema should disappear. To be able to do this we could first
+% define the hyphenation break behaviour for the five vowels, both
+% lowercase and uppercase, in terms of |\discretionary|. But this
+% results in a large |\if|-construct in the definition of the
+% active |"|. Because we think a user should not use |"| when he
+% really means something like |''| we chose not to distinguish
+% between vowels and consonants. Therefore we have one macro
+% |\@trema| which specifies the hyphenation break behaviour for all
+% letters.
+%
+% \changes{dutch-2.3}{1990/07/30}{\cs{dieresis} instead of
+% \cs{accent127}}
+% \changes{dutch-3.3a}{1991/11/11}{renamed \cs{@umlaut} to
+% \cs{@trema}}
+% \begin{macrocode}
+\def\@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{dutch-3.7a}{1995/02/15}{Moved the definition of \cs{ij} and
+% \cs{IJ} to \file{glyphs.def}}
+% \changes{dutch-3.7a}{1995/02/03}{The support macros for the active
+% double quote have been moved to \file{babel.def}}
+%
+% Now we can define the doublequote macros: the tremas,
+%
+% \changes{dutch-2.3}{1990/07/30}{\cs{dieresis} instead of
+% \cs{accent127}}
+% \changes{dutch-3.2}{1991/07/02}{added case for \texttt{"y} and
+% \texttt{"Y}}
+% \changes{dutch-3.2b}{1991/07/16}{removed typo (allowhpyhens)}
+% \changes{dutch-3.7a}{1995/02/03}{Now use \cs{Declaredq{dutch}} to
+% define the functions of the active double quote}
+% \changes{dutch-3.7a}{1995/02/03}{Use \cs{ddot} instead of
+% \cs{@MATHUMLAUT}}
+% \changes{dutch-3.7a}{1995/03/05}{Use more general mechanism of
+% \cs{declare@shorthand}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"a}{\textormath{\@trema a}{\ddot a}}
+\declare@shorthand{dutch}{"e}{\textormath{\@trema e}{\ddot e}}
+\declare@shorthand{dutch}{"i}{\textormath
+ {\allowhyphens\discretionary{-}{i}{\"{\i}}\allowhyphens}%
+ {\ddot \imath}}
+\declare@shorthand{dutch}{"o}{\textormath{\@trema o}{\ddot o}}
+\declare@shorthand{dutch}{"u}{\textormath{\@trema u}{\ddot u}}
+% \end{macrocode}
+% dutch quotes,
+% \changes{dutch-3.8e}{1997/04/03}{Removed empty groups after double
+% quote characters}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{dutch}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+% \end{macrocode}
+% and some additional commands:
+% \changes{dutch-3.7b}{1995/06/04}{Added \texttt{""} shorthand}
+% \changes{dutch-3.8c}{1997/01/14}{Added the \texttt{"\~{}} shorthand}
+% \changes{dutch-3.8e}{1997/04/01}{Forgot to replace `german' by
+% `dutch' when copying definition for \texttt{"\~{}}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{dutch}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{dutch}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+\declare@shorthand{dutch}{""}{\hskip\z@skip}
+\declare@shorthand{dutch}{"y}{\textormath{\ij{}}{\ddot y}}
+\declare@shorthand{dutch}{"Y}{\textormath{\IJ{}}{\ddot Y}}
+% \end{macrocode}
+% To enable hyphenation in two words, written together but
+% separated by a slash, as in `uitdrukking/opmerking' we define the
+% command |"/|.
+% \changes{dutch-3.8e}{1997/10/03}{Added a shorthand with the slash
+% character}
+% \changes{dutch-3.8i}{2003/09/15}{\texttt{"/} should use
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{dutch}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch and German, where
+% long compound words are quite normal and all one needs is a means
+% to indicate an extra hyphenation position on top of the ones that
+% \TeX\ can generate from the hyphenation patterns.
+% \changes{dutch-3.8i}{2003/09/15}{\cs{-} should use
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\-}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{dutch-3.8a}{1996/10/30}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/dutch/dutch.ins b/macros/latex/contrib/babel-contrib/dutch/dutch.ins
new file mode 100644
index 0000000000..1437c660a7
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/dutch/dutch.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{dutch.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{dutch.ldf}{\from{dutch.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/dutch/dutch.pdf b/macros/latex/contrib/babel-contrib/dutch/dutch.pdf
new file mode 100644
index 0000000000..75cc627993
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/dutch/dutch.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/english/README b/macros/latex/contrib/babel-contrib/english/README
new file mode 100644
index 0000000000..1a3256a855
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/english/README
@@ -0,0 +1,13 @@
+English 3.3r
+------------
+
+This is the babel style for English.
+
+There are no new features in 3.3q, but "dialects" will be
+loaded with proxy files (american.ldf, british.ldf, etc.).
+
+Version 3.3r just fixes the names for UKenglish.ldf and
+USenglish.ldf (files were created lowercased).
+
+----------
+2017-06-06 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/english/english.dtx b/macros/latex/contrib/babel-contrib/english/english.dtx
new file mode 100644
index 0000000000..5b8f6f40f7
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/english/english.dtx
@@ -0,0 +1,477 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+% 2013-2017 Javier Bezos, Johannes L. Braams
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{english.dtx}
+%</dtx>
+%<english>\ProvidesLanguage{english}
+%<american>\ProvidesLanguage{american}
+%<usenglish>\ProvidesLanguage{USenglish}
+%<british>\ProvidesLanguage{british}
+%<ukenglish>\ProvidesLanguage{UKenglish}
+%<australian>\ProvidesLanguage{australian}
+%<newzealand>\ProvidesLanguage{newzealand}
+%<canadian>\ProvidesLanguage{canadian}
+%\fi
+%\ProvidesFile{english.dtx}
+ [2017/06/06 v3.3r English support from the babel system]
+%\iffalse
+%% File 'english.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%% 2013-2017 Javier Bezos, Johannes Braams
+%
+%
+% This file is part of the babel system, it provides the source
+% code for the English language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \mathit lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{english.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{english.dtx}
+%
+% \changes{english-2.0a}{1990/04/02}{Added checking of format}
+% \changes{english-2.1}{1990/04/24}{Reflect changes in babel 2.1}
+% \changes{english-2.1a}{1990/05/14}{Incorporated Nico's comments}
+% \changes{english-2.1b}{1990/05/14}{merged \file{USenglish.sty} into
+% this file}
+% \changes{english-2.1c}{1990/05/22}{fixed typo in definition for
+% american language found by Werenfried Spit (nspit@fys.ruu.nl)}
+% \changes{english-2.1d}{1990/07/16}{Fixed some typos}
+% \changes{english-3.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{english-3.0a}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{english-3.0c}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{english-3.1}{1991/11/05}{Rewrote parts of the code to use
+% the new features of babel version 3.1}
+% \changes{english-3.3}{1994/02/08}{Update or \LaTeXe}
+% \changes{english-3.3c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved the identification after the loading of
+% \file{babel.def}}
+% \changes{english-3.3g}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{english-3.3h}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{english-3.3q}{2017/01/10}{Added the proxy files for the
+% dialects}
+%
+% \section{The English language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% English language as well as for the American and Australian
+% version of this language. For the Australian version the British
+% hyphenation patterns will be used, if available, for the Canadian
+% variant the American patterns are selected.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{english-3.3h}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{english} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@english| to see whether we have to do something here.
+%
+% \changes{english-3.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{english-3.0d}{1991/10/22}{removed use of \cs{@ifundefined}}
+% \changes{english-3.3c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \changes{english-3.3g}{1996/07/10}{Allow british as the name of the
+% UK patterns}
+% \changes{english-3.3j}{2000/01/21}{Also allow american english
+% hyphenation patterns to be used for `english'}
+% We allow for the british english patterns to be loaded as either
+% `british', or `UKenglish'. When neither of those is
+% known we try to define |\l@english| as an alias for |\l@american|
+% or |\l@USenglish|.
+% \changes{english-3.3k}{2001/02/07}{Added support for canadian}
+% \changes{english-3.3n}{2004/06/12}{Added support for australian and
+% newzealand}
+% \begin{macrocode}
+\ifx\l@english\@undefined
+ \ifx\l@UKenglish\@undefined
+ \ifx\l@british\@undefined
+ \ifx\l@american\@undefined
+ \ifx\l@USenglish\@undefined
+ \ifx\l@canadian\@undefined
+ \ifx\l@australian\@undefined
+ \ifx\l@newzealand\@undefined
+ \@nopatterns{English}
+ \adddialect\l@english0
+ \else
+ \let\l@english\l@newzealand
+ \fi
+ \else
+ \let\l@english\l@australian
+ \fi
+ \else
+ \let\l@english\l@canadian
+ \fi
+ \else
+ \let\l@english\l@USenglish
+ \fi
+ \else
+ \let\l@english\l@american
+ \fi
+ \else
+ \let\l@english\l@british
+ \fi
+ \else
+ \let\l@english\l@UKenglish
+ \fi
+\fi
+% \end{macrocode}
+% Because we allow `british' to be used as the babel option we need
+% to make sure that it will be recognised by |\selectlanguage|. In
+% the code above we have made sure that |\l@english| was defined.
+% Now we want to make sure that |\l@british| and |\l@UKenglish| are
+% defined as well. When either of them is we make them equal to
+% each other, when neither is we fall back to the default,
+% |\l@english|.
+% \changes{english-3.3o}{2004/06/14}{Make sure that british patterns
+% are used if they were loaded}
+% \begin{macrocode}
+\ifx\l@british\@undefined
+ \ifx\l@UKenglish\@undefined
+ \adddialect\l@british\l@english
+ \adddialect\l@UKenglish\l@english
+ \else
+ \let\l@british\l@UKenglish
+ \fi
+\else
+ \let\l@UKenglish\l@british
+\fi
+% \end{macrocode}
+% `American' is a version of `English' which can have its own
+% hyphenation patterns. The default english patterns are in fact
+% for american english. We allow for the patterns to be loaded as
+% `english' `american' or `USenglish'.
+% \changes{english-3.0}{1990/04/23}{Now use \cs{adddialect} for
+% american}
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3d}{1995/02/01}{Only define american as a
+% dialect when no separate patterns have been loaded}
+% \changes{english-3.3g}{1996/07/10}{Allow USenglish as the name of
+% the american patterns}
+% \begin{macrocode}
+\ifx\l@american\@undefined
+ \ifx\l@USenglish\@undefined
+% \end{macrocode}
+% When the patterns are not know as `american' or `USenglish' we
+% add a ``dialect''.
+% \begin{macrocode}
+ \adddialect\l@american\l@english
+ \else
+ \let\l@american\l@USenglish
+ \fi
+\else
+% \end{macrocode}
+% Make sure that USenglish is known, even if the patterns were
+% loaded as `american'.
+% \changes{english-3.3j}{2000/01/21}{Ensure that \cs{l@USenglish} is
+% alway defined}
+% \changes{english-3.3l}{2001/04/15}{Added missing backslash}
+% \begin{macrocode}
+ \ifx\l@USenglish\@undefined
+ \let\l@USenglish\l@american
+ \fi
+\fi
+% \end{macrocode}
+%
+% \changes{english-3.3k}{2001/02/07}{Added support for canadian}
+% `Canadian' english spelling is a hybrid of British and American
+% spelling. Although so far no special `translations' have been
+% reported we allow this file to be loaded by the option
+% \Lopt{candian} as well.
+% \begin{macrocode}
+\ifx\l@canadian\@undefined
+ \adddialect\l@canadian\l@american
+\fi
+% \end{macrocode}
+%
+% \changes{english-3.3n}{2004/06/12}{Added support for australian and
+% newzealand}
+% `Australian' and `New Zealand' english spelling seem to be the
+% same as British spelling. Although so far no special
+% `translations' have been reported we allow this file to be loaded
+% by the options \Lopt{australian} and \Lopt{newzealand} as well.
+% \begin{macrocode}
+\ifx\l@australian\@undefined
+ \adddialect\l@australian\l@british
+\fi
+\ifx\l@newzealand\@undefined
+ \adddialect\l@newzealand\l@british
+\fi
+% \end{macrocode}
+%
+
+% \begin{macro}{\englishhyphenmins}
+% \changes{english-3.3m}{2003/11/17}{Added default for setting of
+% hyphenmin parameters}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the English language.
+% \begin{macro}{\captionsenglish}
+% The macro |\captionsenglish| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.0b}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{english-3.1a}{1991/11/11}{added \cs{seename} and
+% \cs{alsoname}}
+% \changes{english-3.1b}{1992/01/26}{added \cs{prefacename}}
+% \changes{english-3.2}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{english-3.3e}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{english-3.3g}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{english-3.3j}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Preface}%
+ \def\refname{References}%
+ \def\abstractname{Abstract}%
+ \def\bibname{Bibliography}%
+ \def\chaptername{Chapter}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Contents}%
+ \def\listfigurename{List of Figures}%
+ \def\listtablename{List of Tables}%
+ \def\indexname{Index}%
+ \def\figurename{Figure}%
+ \def\tablename{Table}%
+ \def\partname{Part}%
+ \def\enclname{encl}%
+ \def\ccname{cc}%
+ \def\headtoname{To}%
+ \def\pagename{Page}%
+ \def\seename{see}%
+ \def\alsoname{see also}%
+ \def\proofname{Proof}%
+ \def\glossaryname{Glossary}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateenglish}
+% In order to define |\today| correctly we need to know whether it
+% should be `english', `australian', or `american'. We can find
+% this out by checking the value of |\CurrentOption|.
+% \changes{english-3.3j}{2000/01/21}{Make sure that the value of
+% \cs{today} is correct for both options `american' and
+% `USenglish'}
+% \changes{english-3.3n}{2004/06/12}{Added support for `Australian'
+% and `Newzealand'}
+% \changes{english-3.3o}{2004/06/14}{Explicitly choose the UK form of
+% date}
+% \changes{english-3.3p}{2012/11/07}{Warning if `english' is used with
+% other options}
+% \begin{macrocode}
+\def\bbl@tempa{british}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{UK}\fi
+\def\bbl@tempa{UKenglish}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{UK}\fi
+\def\bbl@tempa{american}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{USenglish}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{canadian}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
+\def\bbl@tempa{australian}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{AU}\fi
+\def\bbl@tempa{newzealand}
+\ifx\CurrentOption\bbl@tempa\def\bbl@tempb{AU}\fi
+\def\bbl@tempa{english}
+\ifx\CurrentOption\bbl@tempa
+ \AtEndOfPackage{\@nameuse{bbl@englishwarning}}
+\else
+ \edef\bbl@englishwarning{%
+ \let\noexpand\bbl@englishwarning\relax
+ \noexpand\PackageWarning{Babel}{%
+ The package option `english' should not be used\noexpand\MessageBreak
+ with a more specific one (like `\CurrentOption')}}
+\fi
+% \end{macrocode}
+%
+% The macro |\dateenglish| redefines the command |\today| to
+% produce English dates.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3g}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{english-3.3i}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{english-3.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\bbl@tempa{UK}
+\ifx\bbl@tempa\bbl@tempb
+ \@namedef{date\CurrentOption}{%
+ \def\today{\ifcase\day\or
+ 1st\or 2nd\or 3rd\or 4th\or 5th\or
+ 6th\or 7th\or 8th\or 9th\or 10th\or
+ 11th\or 12th\or 13th\or 14th\or 15th\or
+ 16th\or 17th\or 18th\or 19th\or 20th\or
+ 21st\or 22nd\or 23rd\or 24th\or 25th\or
+ 26th\or 27th\or 28th\or 29th\or 30th\or
+ 31st\fi~\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateaustralian}
+% Now, test for `australian' or `american'.
+% \changes{english-3.3n}{2004/06/12}{Add australian date}
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% The macro |\dateaustralian| redefines the command |\today| to
+% produce Australian resp.\ New Zealand dates.
+% \begin{macrocode}
+ \def\bbl@tempa{AU}
+ \ifx\bbl@tempa\bbl@tempb
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day~\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateamerican}
+% The macro |\dateamerican| redefines the command |\today| to
+% produce American dates.
+% \changes{english-3.0b}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{english-3.3i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{english-3.3i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+ \else
+ \@namedef{date\CurrentOption}{%
+ \def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi \space\number\day, \number\year}}
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasenglish}
+% \begin{macro}{\noextrasenglish}
+% The macro |\extrasenglish| will perform all the extra definitions
+% needed for the English language. The macro |\noextrasenglish| is
+% used to cancel the actions of |\extrasenglish|. For the moment
+% these macros are empty but they are defined for compatibility
+% with the other language definition files.
+%
+% \changes{english-3.3g}{1996/07/10}{Construct control sequences on
+% the fly}
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{english-3.3h}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% Finally, We create a few proxy files, which just load english.ldf.
+%
+% \begin{macrocode}
+%<*american|usenglish|british|ukenglish|australian|newzealand|canadian>
+\input english.ldf\relax
+%</american|usenglish|british|ukenglish|australian|newzealand|canadian>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/english/english.ins b/macros/latex/contrib/babel-contrib/english/english.ins
new file mode 100644
index 0000000000..33f2ec8b85
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/english/english.ins
@@ -0,0 +1,160 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%% 2013-2017 Javier Bezos, Johannes L. Braams
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2017/06/06}
+\def\batchfile{english.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+ 2013-2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+ 2013-2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{english.ldf}{\from{english.dtx}{english,code}}
+ \file{american.ldf}{\from{english.dtx}{american}}
+ \file{USenglish.ldf}{\from{english.dtx}{usenglish}}
+ \file{british.ldf}{\from{english.dtx}{british}}
+ \file{UKenglish.ldf}{\from{english.dtx}{ukenglish}}
+ \file{australian.ldf}{\from{english.dtx}{australian}}
+ \file{newzealand.ldf}{\from{english.dtx}{newzealand}}
+ \file{canadian.ldf}{\from{english.dtx}{canadian}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/english/english.pdf b/macros/latex/contrib/babel-contrib/english/english.pdf
new file mode 100644
index 0000000000..0b8af616f3
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/english/english.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/esperanto/esperanto.dtx b/macros/latex/contrib/babel-contrib/esperanto/esperanto.dtx
new file mode 100644
index 0000000000..41ba946542
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/esperanto/esperanto.dtx
@@ -0,0 +1,343 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2007 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{261}
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{esperanto.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{esperanto}
+%\fi
+%\ProvidesFile{esperant.dtx}
+ [2007/10/20 v1.4t Esperanto support from the babel system]
+%\iffalse
+%% File 'esperanto.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2007
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams dot xs4all dot nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Esperanto language definition file. A contribution
+% was made by Ruiz-Altaba Marti (ruizaltb@cernvm.cern.ch) Code from
+% esperant.sty version 1.1 by Joerg Knappen
+% (\texttt{knappen@vkpmzd.kph.uni-mainz.de}) was included in
+% version 1.2.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{esperanto.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{esperanto.dtx}
+%
+% \changes{esperanto-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{esperanto-1.1}{1992/02/15}{Brought up-to-date with
+% babel~3.2a}
+% \changes{esperanto-1.2}{1992/02/18}{Included code from
+% \texttt{esperant.sty}}
+% \changes{esperanto-1.4a}{1994/02/04}{Updated for \LaTeXe}
+% \changes{esperanto-1.4d}{1994/06/25}{Removed the use of
+% \cs{filedate}, moved Identification after loading of
+% \file{babel.def}}
+% \changes{esperanto-1.4e}{1995/02/09}{Moved identification code to
+% the top of the file}
+% \changes{esperanto-1.4f}{1995/06/14}{Corrected typos (PR1652)}
+% \changes{esperanto-1.4i}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{esperanto-1.4i}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Esperanto language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Ruiz-Altaba Marti
+% (\texttt{ruizaltb@cernvm.cern.ch}). Code from the file
+% \texttt{esperant.sty} by J\"org Knappen
+% (\texttt{knappen@vkpmzd.kph.uni-mainz.de}) was included.} defines
+% all the language-specific macros for the Esperanto language.
+%
+% For this language the character |^| is made active.
+% In table~\ref{tab:esp-act} an overview is given of its purpose.
+% \changes{esperanto-1.4j}{1997/01/06}{fixed typo in table caption
+% (funtion instead of function)}
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |^c| & gives \^c with hyphenation in the rest of the word
+% allowed, this works for c, C, g, G, H, J, s, S, z, Z\\
+% |^h| & prevents h\llap{\^{}} from becoming too tall\\
+% |^j| & gives \^\j\\
+% |^u| & gives \u u, with hyphenation in the rest of the word
+% allowed\\
+% |^U| & gives \u U, with hyphenation in the rest of the word
+% allowed\\
+% \verb=^|= & inserts a |\discretionary{-}{}{}|\\
+% \end{tabular}
+% \caption{The functions of the active character for Esperanto.}
+% \label{tab:esp-act}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{esperanto-1.4i}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{esperanto}\captionsesperanto
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{esperanto} will be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@esperanto| to see whether we have to do
+% something here.
+%
+% \changes{esperanto-1.0b}{1991/10/29}{Removed use of
+% \cs{makeatletter}}
+% \changes{esperanto-1.1}{1992/02/15}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{esperanto-1.4d}{1994/06/25}{Use \cs{@nopatterns} for the
+% warning}
+% \begin{macrocode}
+\ifx\l@esperanto\@undefined
+ \@nopatterns{Esperanto}
+ \adddialect\l@esperanto0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Esperanto language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsesperanto}
+% The macro |\captionsesperanto| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{esperanto-1.1}{1992/02/15}{Added \cs{seename},
+% \cs{alsoname} and \cs{prefacename}}
+% \changes{esperanto-1.3}{1993/07/10}{Repaired a number of mistakes,
+% indicated by D. Ederveen}
+% \changes{esperanto-1.3}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{esperanto-1.4a}{1994/02/04}{added missing closing brace}
+% \changes{esperanto-1.4g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{esperanto-1.4i}{1996/07/06}{Replaced `Proof' by `Pruvo'
+% PR 2207}
+% \changes{esperanto-1.4p}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{esperanto-1.4q}{2002/01/07}{Added translation for Glossary}
+% \begin{macrocode}
+\addto\captionsesperanto{%
+ \def\prefacename{Anta\u{u}parolo}%
+ \def\refname{Cita\^\j{}oj}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliografio}%
+ \def\chaptername{{\^C}apitro}%
+ \def\appendixname{Apendico}%
+ \def\contentsname{Enhavo}%
+ \def\listfigurename{Listo de figuroj}%
+ \def\listtablename{Listo de tabeloj}%
+ \def\indexname{Indekso}%
+ \def\figurename{Figuro}%
+ \def\tablename{Tabelo}%
+ \def\partname{Parto}%
+ \def\enclname{Aldono(j)}%
+ \def\ccname{Kopie al}%
+ \def\headtoname{Al}%
+ \def\pagename{Pa\^go}%
+ \def\subjectname{Temo}%
+ \def\seename{vidu}% a^u: vd.
+ \def\alsoname{vidu anka\u{u}}% a^u vd. anka\u{u}
+ \def\proofname{Pruvo}%
+ \def\glossaryname{Glosaro}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateesperanto}
+% The macro |\dateesperanto| redefines the command |\today| to
+% produce Esperanto dates.
+% \changes{esperanto-1.3}{1993/07/10}{Removed the capitals from
+% \cs{today}}
+% \changes{esperanto-1.4k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{esperanto-1.4k}{1998/03/27}{Removed Rthe use of \cs{edef}
+% again}
+% \begin{macrocode}
+\def\dateesperanto{%
+ \def\today{\number\day{--a}~de~\ifcase\month\or
+ januaro\or februaro\or marto\or aprilo\or majo\or junio\or
+ julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
+ decembro\fi,\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasesperanto}
+% \begin{macro}{\noextrasesperanto}
+% The macro |\extrasesperanto| performs all the extra definitions
+% needed for the Esperanto language. The macro |\noextrasesperanto|
+% is used to cancel the actions of |\extrasesperanto|.
+%
+% For Esperanto the |^| character is made active. This is done
+% once, later on its definition may vary.
+%
+% \begin{macrocode}
+\initiate@active@char{^}
+% \end{macrocode}
+% Because the character |^| is used in math mode with quite a
+% different purpose we need to add an extra level of evaluation to
+% the definition of the active |^|. It checks whether math mode is
+% active; if so the shorthand mechanism is bypassed by a direct
+% call of |\normal@char^|.
+% \changes{esperanto-1.4n}{1999/09/30}{Added a check for math mode to
+% the definition of the shorthand character}
+% \changes{esperant0-1.4o}{1999/12/18}{Moved the check for math to
+% babel.def}
+% \begin{macrocode}
+\addto\extrasesperanto{\languageshorthands{esperanto}}
+\addto\extrasesperanto{\bbl@activate{^}}
+\addto\noextrasesperanto{\bbl@deactivate{^}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% In order to prevent problems with the active |^| we add a
+% shorthand on system level which expands to a `normal |^|.
+% \changes{esperanto-1.4l}{1999/04/11}{Added a shorthand definition on
+% system level}
+% \begin{macrocode}
+\declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% \end{macrocode}
+% And here are the uses of the active |^|:
+% \changes{esperanto-1.4h}{1995/07/27}{Added a few shorthands}
+% \begin{macrocode}
+\declare@shorthand{esperanto}{^c}{\^{c}\allowhyphens}
+\declare@shorthand{esperanto}{^C}{\^{C}\allowhyphens}
+\declare@shorthand{esperanto}{^g}{\^{g}\allowhyphens}
+\declare@shorthand{esperanto}{^G}{\^{G}\allowhyphens}
+\declare@shorthand{esperanto}{^h}{h\llap{\^{}}\allowhyphens}
+\declare@shorthand{esperanto}{^H}{\^{H}\allowhyphens}
+\declare@shorthand{esperanto}{^j}{\^{\j}\allowhyphens}
+\declare@shorthand{esperanto}{^J}{\^{J}\allowhyphens}
+\declare@shorthand{esperanto}{^s}{\^{s}\allowhyphens}
+\declare@shorthand{esperanto}{^S}{\^{S}\allowhyphens}
+\declare@shorthand{esperanto}{^u}{\u u\allowhyphens}
+\declare@shorthand{esperanto}{^U}{\u U\allowhyphens}
+\declare@shorthand{esperanto}{^|}{\discretionary{-}{}{}\allowhyphens}
+% \end{macrocode}
+%
+% \begin{macro}{\Esper}
+% \begin{macro}{\esper}
+% In \file{esperant.sty} J\"org Knappen provides the macros
+% |\esper| and |\Esper| that can be used instead of |\alph| and
+% |\Alph|. These macros are available in this file as well.
+%
+% Their definition takes place in two steps. First the toplevel.
+% \begin{macrocode}
+\def\esper#1{\@esper{\@nameuse{c@#1}}}
+\def\Esper#1{\@Esper{\@nameuse{c@#1}}}
+% \end{macrocode}
+% Then the second level.
+% \changes{esperanto-1.4q}{2002/01/08}{Removed the extra level of
+% expansion for more than five items, as was done in \LaTeX}
+% \changes{esperanto-1.4t}{2006/06/05}{Added the missing `r' in these
+% macros}
+% \begin{macrocode}
+\def\@esper#1{%
+ \ifcase#1\or a\or b\or c\or \^c\or d\or e\or f\or g\or \^g\or
+ h\or h\llap{\^{}}\or i\or j\or \^\j\or k\or l\or m\or n\or o\or
+ p\or r\or s\or \^s\or t\or u\or \u{u}\or v\or z\else\@ctrerr\fi}
+\def\@Esper#1{%
+ \ifcase#1\or A\or B\or C\or \^C\or D\or E\or F\or G\or \^G\or
+ H\or \^H\or I\or J\or \^J\or K\or L\or M\or N\or O\or
+ P\or R\or S\or \^S\or T\or U\or \u{U}\or V\or Z\else\@ctrerr\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hodiau}
+% \begin{macro}{\hodiaun}
+% In \file{esperant.sty} J\"org Knappen provides two alternative
+% macros for |\today|, |\hodiau| and |\hodiaun|. The second macro
+% produces an accusative version of the date in Esperanto.
+% \begin{macrocode}
+\addto\dateesperanto{\def\hodiau{la \today}}
+\def\hodiaun{la \number\day --an~de~\ifcase\month\or
+ januaro\or februaro\or marto\or aprilo\or majo\or junio\or
+ julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
+ decembro\fi, \space \number\year}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{esperanto-1.4i}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{esperanto}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/esperanto/esperanto.ins b/macros/latex/contrib/babel-contrib/esperanto/esperanto.ins
new file mode 100644
index 0000000000..89776ece1d
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/esperanto/esperanto.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2007 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/26}
+\def\batchfile{esperanto.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2007 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{esperanto.ldf}{\from{esperanto.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/esperanto/esperanto.pdf b/macros/latex/contrib/babel-contrib/esperanto/esperanto.pdf
new file mode 100644
index 0000000000..e51d60c37e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/esperanto/esperanto.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/estonian/README.txt b/macros/latex/contrib/babel-contrib/estonian/README.txt
new file mode 100644
index 0000000000..edbafdec20
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/estonian/README.txt
@@ -0,0 +1,58 @@
+=========================================================================
+The babel-estonian bundle
+
+Estonian language support for the babel multilingual package
+
+Authors: Enn Saar, Jaan Vajakas
+
+Current Maintainer: Jaan Vajakas
+E-mail: jaanvajakas (at) hot (dot) ee
+
+Released under the LaTeX Project Public License v1.3 or later
+See http://www.latex-project.org/lppl.txt
+=========================================================================
+
+== PURPOSE ==
+
+This bundle is an extension to the babel package for multilingual
+typesetting. It provides all necessary macros, definitions and settings
+to typeset Estonian documents.
+
+
+== CONTENTS ==
+
+The bundle consists of the following files:
+
+* estonian.ins (installation file to unpack the language definition
+ file estonian.ldf)
+* estonian.dtx (packed language definition file and documentation)
+* estonian.pdf (unpacked documentation for estonian.ldf)
+* README.txt (this file)
+
+
+== INSTALLATION ==
+
+If the latest version of this package is not included in your LaTeX
+distribution, do the following:
+
+* issue "latex estonian.ins" to unpack the language definition file
+* copy the file estonian.ldf to a location where TeX can find it
+ (default location: $TEXMF/tex/generic/babel-estonian/)
+
+To re-generate the manual, issue
+ latex estonian.dtx
+ makeindex -s gglo.ist -o estonian.gls estonian.glo
+ latex estonian.dtx
+ latex estonian.dtx
+ dvips estonian.dvi
+ ps2pdf estonian.ps
+
+
+== DOCUMENTATION ==
+
+See the included manual estonian.pdf for usage instructions.
+
+
+== CHANGES ==
+
+See the included manual estonian.pdf, section "Change History".
diff --git a/macros/latex/contrib/babel-contrib/estonian/estonian.dtx b/macros/latex/contrib/babel-contrib/estonian/estonian.dtx
new file mode 100644
index 0000000000..e0fa44272b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/estonian/estonian.dtx
@@ -0,0 +1,580 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2015 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Jaan Vajakas.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{325}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{estonian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{estonian}
+%\fi
+%\ProvidesFile{estonian.dtx}
+ [2015/08/05 v1.1a Estonian support for the babel system]
+%\iffalse
+%% File `estonian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2009
+%% by Johannes Braams, TeXniek
+%
+%% Estonian language Definition File
+%% Copyright (C) 1991 - 2009
+%% by Enn Saar, Tartu Astrophysical Observatory
+% Tartu Astrophysical Observatory
+% EE-2444 T\~oravere
+% Estonia
+% tel: +372 7 410 267
+% fax: +372 7 410 205
+% saar@aai.ee
+%
+% Johannes Braams, TeXniek
+%
+%% Please report errors to: Jaan Vajakas jaanvajakas at hot.ee
+%% (or Enn Saar saar at aai.ee
+%% or J. L. Braams babel at braams.xs4all.nl)
+%
+% This file is part of the babel system, it provides the source
+% code for the Estonian language definition file. The original
+% version of this file was written by Enn Saar (saar@aai.ee).
+% Modified by Jaan Vajakas (jaanvajakas@hot.ee).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{estonian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \RecordChanges
+%
+% \changes{estonian-1.0b}{1995/06/16}{corrected typos}
+% \changes{estonian-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{estonian-1.0k}{2009/03/07}{corrected documentation of the
+% commands \texttt{"-} and \cs{-}}
+% \changes{estonian-1.1}{2014/02/20}{added usage guidelines to the
+% documentation}
+% \changes{estonian-1.1a}{2015/08/05}{small improvements in documentation}
+%
+% \GetFileInfo{estonian.dtx}
+%
+% \title{Estonian language support for \babel}
+% \author{Enn Saar\footnote{\texttt{saar@aai.ee}, original author (inactive)},
+% Jaan Vajakas\footnote{\texttt{jaanvajakas@hot.ee}, maintainer since version 1.0k}}
+% \date{\filedate, \fileversion}
+%
+% \maketitle
+%
+% The file \file{\filename} defines the language definition macro's
+% for the Estonian language.
+%
+% This file was written as part of the TWGML project, and borrows
+% heavily from the \babel\ German and Spanish language files
+% \file{germanb.ldf} and \file{spanish.ldf}.
+%
+% Estonian has the same umlauts as German (\"a, \"o, \"u), but in
+% addition to this, we have also \~o, and two recent characters
+% \v s and \v z, so we need at least two active characters.
+% We shall use |"| and |~| to type Estonian accents on ASCII
+% keyboards (in the 7-bit character world). Their use is given in
+% table~\ref{tab:estonian-quote}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |~o| & |\~o|, (and uppercase); \\
+% |"a| & |\"a|, (and uppercase); \\
+% |"o| & |\"o|, (and uppercase); \\
+% |"u| & |\"u|, (and uppercase); \\
+% |~s| & |\v s|, (and uppercase); \\
+% |~z| & |\v z|, (and uppercase); \\
+% \verb="|= & disable ligature at this position and allow hyphenation at this position; \\
+% |"-| & like |\-|, but allowing hyphenation
+% in the rest of the word;\\
+% |"`| & for Estonian low left double quotes (same as German);\\
+% |"'| & for Estonian right double quotes;\\
+% |"<| & for French left double quotes (also rather popular)\\
+% |">| & for French right double quotes.\\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{estonian.ldf}}\label{tab:estonian-quote}
+% \end{center}
+% \end{table}
+% These active accent characters behave according to their original
+% definitions if not followed by one of the characters indicated in
+% that table; the original quote character can be typed using the
+% macro |\dq|.
+%
+% \section{Usage guidelines}
+%
+% \subsection{Overview and usage example}
+%
+% In short, it is recommended to include lines like the following in the preamble:
+% \begin{itemize}
+% \item in \LaTeX{}:
+%\begin{verbatim}
+%\usepackage[utf8]{inputenc}
+%\usepackage[T1]{fontenc}
+%\usepackage{mathptmx} % or \usepackage{lmodern} or something else
+%\usepackage[estonian .notilde]{babel}
+%\end{verbatim}
+% \item in XeLaTeX or LuaLaTeX:\footnote{In XeLaTeX and LuaLaTeX, you may want
+% to use the more modern \textsf{polyglossia} package instead of \babel{},
+% although the latter also works.}
+%\begin{verbatim}
+%\usepackage[estonian .notilde]{babel}
+%\usepackage{fontspec}
+%\end{verbatim}
+% \end{itemize}
+% When saving your file, make sure your text editor saves it in the UTF-8 encoding.
+%
+% In the following subsections, the rationale of these options is explained.
+% Some authors have also advised that ligatures should be turned off in Estonian;
+% the last subsection tries to explain why and how.
+%
+% \subsection{Use the T1 font encoding and avoid CM}
+% If using the Estonian package in \LaTeX, it is recommended to choose
+% the T1 output encoding (also known as the Cork encoding). It will give you better hyphenation,
+% as the standard Estonian hyphenation file \file{eehyph.tex} is in this encoding.
+% You can choose the T1 output encoding with
+% |\usepackage[T1]{fontenc}|.
+%
+% If you like Computer Modern (CM), the default font, then we recommend using
+% its successor Latin Modern (|\usepackage{lmodern}|) instead --- it is almost identical but
+% has the tilde in the letter ``\~o'' slightly lower, looking more natural.
+% (In the OT1 encoding, the Estonian package takes special care to lower the tilde,
+% but that feature is not supported for the T1 output encoding since
+% version 1.0k of the Estonian package, as it created many issues of its own.)
+%
+% In XeLaTeX and LuaLaTeX, the default font (CM) does not support accented letters
+% and therefore the \textsf{fontspec} package (or \textsf{xltxtra}) has to be used.
+%
+% \subsection{Use UTF-8 and disable the tilde shorthands}
+%
+% In the early 1990s, handling accented letters was a problem
+% for many programs. So shorthands for accented letters in Estonian (|~o|, |"a| etc.) were created.
+% Nowadays the UTF-8 standard is widespread, allowing to represent
+% letters from almost all the world's languages in a single text file.
+% Therefore it is recommended to use UTF-8 as input encoding and type Estonian accented
+% characters directly, instead of using the shorthands. We also recommend UTF-8 over
+% cp1257, the default encoding for Estonian on Windows, since UTF-8 contains more
+% characters and is more likely understood
+% by the text editors of your foreign partners.
+%
+% In addition, a problem is caused by the shorthands starting with tilde.
+% Namely, in \TeX, the |~| command originally means non-breaking space:
+% if \babel{} is not used then e.~g. |U.~S.| is rendered as ``U.~S.''.
+% However, with |\usepackage[estonian]{babel}| in preamble,
+% |U.~S.| is rendered as ``U.\v S.'' by default.
+% If you don't need the shorthands starting with tilde,
+% you can disable them and restore the original behavior of |~| by using the option
+% |notilde|, like this:
+%\begin{verbatim}\usepackage[estonian .notilde]{babel}\end{verbatim}
+% The option |notilde| was introduced in version 1.1 of the Estonian package (released 2014/02/21).
+% If you need compatibility with older versions, write instead
+%\begin{verbatim}
+%\usepackage[estonian]{babel}
+%\makeatletter\addto\extrasestonian{\bbl@deactivate{~}}\makeatother
+%\addto\captionsestonian{% Redefine captions containing ~o
+% \def\abstractname{Kokkuv\~ote}%
+% \def\proofname{T\~oestus}%
+% \def\glossaryname{S\~onastik}%
+%}
+%\end{verbatim}
+% If you don't disable the tilde shorthands, you must write |U.\nobreak{} S.|
+%
+% \subsection{Ligatures}
+% Using ligatures in Estonian is discouraged by some authors; it may
+% slightly harm readability and has been uncommon in the past.\footnote{
+% In their ``L\"uhike \LaTeX i\~opetus'' (1994), Hans Ibrus and Enn Saar say that \TeX's ligatures
+% are ``not recommended'' in Estonian and give the word ``fiiber'' as a (perhaps particularly) bad example.
+% Indeed, ``ii'' denotes a single long vowel, but the ligature seems to suggest
+% that instead the first two letters ``f'' and ``i'' are grouped together.
+% Ligatures are practically absent from Estonian books published throughout the Soviet
+% period (e.~g. mathematical books have no ligature in ``def\/initsioon'').
+% During Estonia's first independence period, ligatures
+% did occasionally appear in books: e.~g. Borkvell's ``Tasapinnalise ja ruumilise anal\"u\"utilise geomeetria p\~ohijooni'' from 1937
+% (fi ligature in ``definitsioon'') or ``Eesti Ents\"uklopeedia'' from 1932--1937
+% (having e.~g. ``Af\/fiinsus'' with ligature fi, but ``Af\/f\/iks'' without ligatures and ``aff\/iinseks'' with ligature ff ---
+% so ligatures were used quite randomly and arguably for the convenience of the typesetter rather than the reader).}
+% By default, \TeX{} creates the ligatures fi, ff, fl, ffi and ffl in the CM fonts (other fonts may have other
+% ligatures). You can disable ligatures one by one (e.~g. \verb=f\/ii"-ber= or {\tt \v sef"\textbar lu"-se}\footnote{The commands {\tt \textbackslash/} and {\tt "\textbar} both disable ligature; the latter also enables hyphenation \emph{\v sef-luse}. Unfortunately both disable hyphenation in the rest of the word; that's why we need the {\tt "-} here.}),
+% but if you want to get rid of all ligatures, then
+% \begin{itemize}
+% \item in \LaTeX, include the following two lines in your preamble:\footnote{
+% Note that these two lines disable only ligatures starting with f.
+% You would not want to apply {\tt \textbackslash DisableLigatures} to all letter combinations,
+% since it also disables kerning (and letter combinations like
+% ``Ve'' and ``AV'' look much nicer with kerning).}
+%\begin{verbatim}
+%\usepackage{microtype}
+%\DisableLigatures[f]{encoding = *, family = * }
+%\end{verbatim}
+% \item in XeLaTeX and LuaLaTeX, use this line instead (replace the font name):
+%\begin{verbatim}
+%\setmainfont[Ligatures={NoRequired,NoCommon,NoContextual}]{Font Name}
+%\end{verbatim}
+% \end{itemize}
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{estonian-1.0e}{1996/10/30}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{estonian}\captionsestonian
+% \end{macrocode}
+%
+% If Estonian is not included in the format file (does not have
+% hyphenation patterns), we shall use English hyphenation.
+%
+% \begin{macrocode}
+\ifx\l@estonian\@undefined
+ \@nopatterns{Estonian}
+ \adddialect\l@estonian0
+\fi
+% \end{macrocode}
+%
+% Now come the commands to switch to (and from) Estonian.
+%
+% \begin{macro}{\captionsestonian}
+% The macro |\captionsestonian| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+%
+% \changes{estonian-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{estonian-1.0d}{1995/07/27}{Added translation of `Proof'}
+% \changes{estonian-1.0h}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{estonian-1.0j}{2008/07/07}{Replaced the translation of
+% `Proof'}
+% \changes{estonian-1.0k}{2009/02/03}{Added translation of
+% `Glossary'}
+% \changes{estonian-1.1}{2014/02/20}{Replaced \texttt{\textasciitilde o} with \cs{\textasciitilde o}
+% for compatibility with the \texttt{notilde} option, and to have the same style,
+% also replaced \texttt{"u} with \cs{"u} in ``Peat\"ukk''.}
+% \begin{macrocode}
+\addto\captionsestonian{%
+ \def\prefacename{Sissejuhatus}%
+ \def\refname{Viited}%
+ \def\bibname{Kirjandus}%
+ \def\appendixname{Lisa}%
+ \def\contentsname{Sisukord}%
+ \def\listfigurename{Joonised}%
+ \def\listtablename{Tabelid}%
+ \def\indexname{Indeks}%
+ \def\figurename{Joonis}%
+ \def\tablename{Tabel}%
+ \def\partname{Osa}%
+ \def\enclname{Lisa(d)}%
+ \def\ccname{Koopia(d)}%
+ \def\headtoname{}%
+ \def\pagename{Lk.}%
+ \def\seename{vt.}%
+ \def\alsoname{vt. ka}%
+ \def\abstractname{Kokkuv\~ote}%
+ \def\chaptername{Peat\"ukk}%
+ \def\proofname{T\~oestus}%
+ \def\glossaryname{S\~onastik}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateestonian}
+% The macro |\dateestonian| redefines the command |\today| to
+% produce Estonian dates.
+% \changes{estonian-1.0f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{estonian-1.0f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\begingroup \catcode`\"\active
+\def\x{\endgroup
+ \def\month@estonian{\ifcase\month\or
+ jaanuar\or veebruar\or m"arts\or aprill\or mai\or juuni\or
+ juuli\or august\or september\or oktoober\or november\or
+ detsember\fi}}
+\x
+\def\dateestonian{%
+ \def\today{\number\day.\space\month@estonian
+ \space\number\year.\space a.}}
+% \end{macrocode}
+% \end{macro}
+%
+% Some useful macros, copied from the spanish package (and renamed |es@...| to |et@...|).
+% \begin{macrocode}
+\def\et@sdef#1{\babel@save#1\def#1}
+
+\@ifundefined{documentclass}
+ {\let\ifet@latex\iffalse}
+ {\let\ifet@latex\iftrue}
+% \end{macrocode}
+%
+% \begin{macro}{\extrasestonian}
+% \begin{macro}{\noextrasestonian}
+% The macro |\extrasestonian| will perform all the extra
+% definitions needed for Estonian. The macro |\noextrasestonian| is
+% used to cancel the actions of |\extrasestonian|. For Estonian,
+% |"| is made active and has to be treated as `special' (|~| is
+% active already).
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\initiate@active@char{~}
+\addto\extrasestonian{\languageshorthands{estonian}}
+\addto\extrasestonian{\bbl@activate{"}\bbl@activate{~}}
+% \end{macrocode}
+%
+% \changes{estonian-1.0d}{1995/07/27}{Removed the code that changes
+% category, lower case, uper case and space factor codes }
+%
+% \changes{estonian-1.1}{2014/02/20}{introduced the \texttt{notilde} option}
+% \begin{macro}{notilde}
+% The option |notilde| disables the shorthands starting with |~|,
+% restoring the original function of |~| as non-breaking space.
+% \begin{macrocode}
+\bbl@declare@ttribute{estonian}{notilde}{\addto\extrasestonian{\bbl@deactivate{~}}}
+% \end{macrocode}
+% \end{macro}
+%
+% Estonian does not use extra spaces after sentences.
+%
+% \begin{macrocode}
+\addto\extrasestonian{\bbl@frenchspacing}
+\addto\noextrasestonian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\estonianhyphenmins}
+% For Estonian, |\lefthyphenmin| and |\righthyphenmin| are
+% both~2.
+% \changes{estonian-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The standard \TeX\ accents are too high for Estonian typography,
+% we have to lower them (following the \babel\ German style).
+% For umlauts, we can use |\umlautlow| in \file{babel.ldf}.
+% \changes{estonian-1.0k}{2009/02/03}{use \cs{umlauthigh} to restore
+% umlauts (before, \cs{babel@save}\cs{"} was used but that did not work)}
+% \begin{macrocode}
+\addto\extrasestonian{\umlautlow}
+\addto\noextrasestonian{\umlauthigh}
+% \end{macrocode}
+%
+% Redefine tilde (as in \file{spanish.ldf}). In case of \LaTeX, we
+% redefine the internal macro for the OT1 encoding because in case of
+% T1, the display and hyphenation of words containing |\~o| works
+% better without redefining it (e. g. words containing |\et@gentilde|
+% are not hyphenated unless |\allowhyphens| is used; when copied from
+% Acrobat Reader, pasting an \~o generated using |\et@gentilde{o}|
+% gives |~o| rather than \~o; when the \textsf{times} package is used with T1
+% encoding, |\et@gentilde| places the tilde through the letter o).
+% In plain \TeX\ there is no encoding infrastructure, so we just
+% redefine |\~|.
+% \changes{estonian-1.0k}{2009/02/03}{redefine \cs{\textasciitilde} only for OT1 (before,
+% redefining \cs{\textasciitilde} resulted in no hyphenation of words containing
+% \cs{\textasciitilde}\texttt{o} in T1 and incorrect display of
+% \cs{\textasciitilde}\texttt{o} with the \textsf{times} package)}
+% \begin{macrocode}
+\ifet@latex
+ \addto\extrasestonian{%
+ \expandafter\et@sdef\csname OT1\string\~\endcsname{\et@gentilde}}
+\else
+ \addto\extrasestonian{\et@sdef\~{\et@gentilde}}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\et@gentilde}
+% \changes{estonian-1.0k}{2009/02/03}{use tilde for all letters except
+% s and z (instead of using caron for all letters except o), like
+% other \babel\ language packages do (this fixes the display of \~n
+% when using the utf8 package)}
+% \changes{estonian-1.0k}{2009/02/03}{do not redefine caron any
+% more because the default one looks good enough}
+% \changes{estonian-1.0k}{2009/02/03}{renamed macros \cs{gentilde} and
+% \cs{newtilde} to \cs{et@gentilde} and \cs{et@newtilde}}
+% \begin{macrocode}
+\def\et@gentilde#1{%
+ \if#1s\v{#1}\else\if#1S\v{#1}\else%
+ \if#1z\v{#1}\else\if#1Z\v{#1}\else%
+ \et@newtilde{#1}%
+ \fi\fi\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\et@newtilde}
+% For a detailed explanation of the following code see the
+% definition of \cs{lower@umlaut} in \file{babel.dtx}.
+% \changes{estonian-1.0k}{2009/02/04}{merged updates in the definition
+% \cs{lower@umlaut} into \cs{et@newtilde}: removed \cs{allowhyphens}
+% and added \cs{bgroup}}
+% \begin{macrocode}
+\def\et@newtilde#1{%
+ \leavevmode\bgroup\U@D 1ex%
+ {\setbox\z@\hbox{\char126}\dimen@ -.45ex\advance\dimen@\ht\z@
+ \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
+ \accent126\fontdimen5\font\U@D #1%
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% We save the double quote character in |\dq|, and tilde in |\til|.
+% \changes{estonian-1.0k}{2009/02/03}{removed macros \cs{dieresis} and
+% \cs{texttilde} that were used to store the original definitions of
+% \cs{"} and \cs{\textasciitilde}, as they would have no purpose now}
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\edef\x{\endgroup
+ \def\noexpand\dq{"}
+ \def\noexpand\til{~}}
+\x
+% \end{macrocode}
+%
+% If the encoding is T1, we have to tell \TeX\ about our redefined
+% accents.
+%
+% \changes{estonian-1.0g}{1999/04/11}{use \cs{bbl@t@one} instead of
+% \cs{bbl@next}}
+% \begin{macrocode}
+\ifx\f@encoding\bbl@t@one
+ \DeclareTextComposite{\~}{T1}{s}{178}
+ \DeclareTextComposite{\~}{T1}{S}{146}
+ \DeclareTextComposite{\~}{T1}{z}{186}
+ \DeclareTextComposite{\~}{T1}{Z}{154}
+ \DeclareTextComposite{\"}{T1}{'}{17}
+ \DeclareTextComposite{\"}{T1}{`}{18}
+ \DeclareTextComposite{\"}{T1}{<}{19}
+ \DeclareTextComposite{\"}{T1}{>}{20}
+% \end{macrocode}
+%
+% If the encoding differs from T1, we expand the accents, enabling
+% hyphenation beyond the accent. In this case \TeX\ will not find
+% all possible breaks, and we have to warn people.
+% \changes{estonian-1.0k}{2009/02/03}{removed definitions of macros
+% \cs{@umlaut} and \cs{@tilde} as they seemed to have no purpose}
+% \begin{macrocode}
+\else
+ \wlog{Warning: Hyphenation would work better for the T1 encoding.}
+\fi
+% \end{macrocode}
+%
+% Now we define the shorthands: umlauts,
+% \changes{estonian-1.0d}{1995/07/27}{The second argument was missing
+% in the definition of some of the double-quote shorthands}
+% \changes{estonian-1.0k}{2009/02/08}{use \cs{allowhyphens} to allow
+% hyphenation in words containing \texttt{"a}, \texttt{"A},
+% \texttt{"o}, \texttt{"O}, \texttt{"u} or \texttt{"U}}
+% \begin{macrocode}
+\declare@shorthand{estonian}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{estonian}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{estonian}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{estonian}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+\declare@shorthand{estonian}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
+\declare@shorthand{estonian}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}
+% \end{macrocode}
+% German and French quotes,
+% \changes{estonian-1.0f}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{estonian}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{estonian}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{estonian}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{estonian}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% tildes and carons
+% \begin{macrocode}
+\declare@shorthand{estonian}{~o}{\textormath{\~{o}\allowhyphens}{\tilde o}}
+\declare@shorthand{estonian}{~O}{\textormath{\~{O}\allowhyphens}{\tilde O}}
+\declare@shorthand{estonian}{~s}{\textormath{\v{s}\allowhyphens}{\check s}}
+\declare@shorthand{estonian}{~S}{\textormath{\v{S}\allowhyphens}{\check S}}
+\declare@shorthand{estonian}{~z}{\textormath{\v{z}\allowhyphens}{\check z}}
+\declare@shorthand{estonian}{~Z}{\textormath{\v{Z}\allowhyphens}{\check Z}}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{estonian}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{estonian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{estonian}{""}{\dq}
+\declare@shorthand{estonian}{~~}{\til}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{estonian-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{estonian}
+%</code>
+% \end{macrocode}
+%
+% \PrintChanges
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/estonian/estonian.ins b/macros/latex/contrib/babel-contrib/estonian/estonian.ins
new file mode 100644
index 0000000000..8032b81de7
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/estonian/estonian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2009 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{estonian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{estonian.ldf}{\from{estonian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/estonian/estonian.pdf b/macros/latex/contrib/babel-contrib/estonian/estonian.pdf
new file mode 100644
index 0000000000..92d3ca1a17
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/estonian/estonian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/finnish/finnish.dtx b/macros/latex/contrib/babel-contrib/finnish/finnish.dtx
new file mode 100644
index 0000000000..c8a019bd0a
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/finnish/finnish.dtx
@@ -0,0 +1,363 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2007 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{172}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{finnish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{finnish}
+%\fi
+%\ProvidesFile{finnish.dtx}
+ [2007/10/20 v1.3q Finnish support from the babel system]
+%\iffalse
+%% File `finnish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2007
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams dot xs4all dot nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Finnish language definition file. A contribution
+% was made by Mikko KANERVA (KANERVA@CERNVM) and Keranen Reino
+% (KERANEN@CERNVM).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{finnish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{finnish.dtx}
+%
+% \changes{finnish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{finnish-1.1}{1991/02/15}{Brought up-to-date with babel 3.2a}
+% \changes{finnish-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{finnish-1.3c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{finnish-1.3d}{1994/06/30}{Removed a few references to
+% \file{babel.com}}
+% \changes{finnish-1.3i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{finnish-1.3q}{2006/06/05}{Small documentation fix}
+%
+% \section{The Finnish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Mikko KANERVA
+% (\texttt{KANERVA@CERNVM}) and Keranen Reino
+% (\texttt{KERANEN@CERNVM}).} defines all the language definition
+% macros for the Finnish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:finnish-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |"=| & an explicit hyphen sign for expressions such as
+% ``pakastekaapit ja -arkut''.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"`| & lowered double left quotes (looks like ,,)\\
+% |"'| & normal double right quotes\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word.
+% \end{tabular}
+% \caption{The extra definitions made by \file{finnish.ldf}}
+% \label{tab:finnish-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{finnish-1.3i}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{finnish}\captionsfinnish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{finnish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@finnish| to see whether we have to do something here.
+%
+% \changes{finnish-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{finnish-1.1}{1992/02/15}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{finnish-1.3c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@finnish\@undefined
+ \@nopatterns{Finnish}
+ \adddialect\l@finnish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Finnish language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsfinnish}
+% The macro |\captionsfinnish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{finnish-1.1}{1992/02/15}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{finnish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{finnish-1.1.2}{1993/09/16}{Added translations}
+% \changes{finnish-1.3g}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{finnish-1.3h}{1995/07/25}{Added finnish word for `Proof'}
+% \changes{finnish-1.3n}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{finnish-1.3o}{2001/03/12}{Provided translation for
+% Glossary}
+% \begin{macrocode}
+\addto\captionsfinnish{%
+ \def\prefacename{Esipuhe}%
+ \def\refname{Viitteet}%
+ \def\abstractname{Tiivistelm\"a}
+ \def\bibname{Kirjallisuutta}%
+ \def\chaptername{Luku}%
+ \def\appendixname{Liite}%
+ \def\contentsname{Sis\"alt\"o}% /* Could be "Sis\"allys" as well */
+ \def\listfigurename{Kuvat}%
+ \def\listtablename{Taulukot}%
+ \def\indexname{Hakemisto}%
+ \def\figurename{Kuva}%
+ \def\tablename{Taulukko}%
+ \def\partname{Osa}%
+ \def\enclname{Liitteet}%
+ \def\ccname{Jakelu}%
+ \def\headtoname{Vastaanottaja}%
+ \def\pagename{Sivu}%
+ \def\seename{katso}%
+ \def\alsoname{katso my\"os}%
+ \def\proofname{Todistus}%
+ \def\glossaryname{Sanasto}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datefinnish}
+% The macro |\datefinnish| redefines the command |\today| to
+% produce Finnish dates.
+% \changes{finnish-1.3e}{1994/07/12}{Added a`.' after the number of
+% the day}
+% \changes{finnish-1.3k}{1997/10/01}{Use \cs{edef} to define \cs{today}
+% to save memory}
+% \changes{finnish-1.3k}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\datefinnish{%
+ \def\today{\number\day.~\ifcase\month\or
+ tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
+ toukokuuta\or kes\"akuuta\or hein\"akuuta\or elokuuta\or
+ syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasfinnish}
+% \begin{macro}{\noextrasfinnish}
+% Finnish has many long words (some of them compound, some not).
+% For this reason hyphenation is very often the only solution in
+% line breaking. For this reason the values of |\hyphenpenalty|,
+% |\exhyphenpenalty| and |\doublehyphendemerits| should be
+% decreased. (In one of the manuals of style Matti Rintala noticed
+% a paragraph with ten lines, eight of which ended in a hyphen!)
+%
+% Matti Rintala noticed that with these changes \TeX\ handles
+% Finnish very well, although sometimes the values of |\tolerance|
+% and |\emergencystretch| must be increased. However, I don't think
+% changing these values in \file{finnish.ldf} is appropriate, as
+% the looseness of the font (and the line width) affect the correct
+% choice of these parameters.
+% \changes{finnish-1.3f}{1995/05/13}{Added the setting of more
+% hyphenation parameters, according to PR1027}
+% \begin{macrocode}
+\addto\extrasfinnish{%
+ \babel@savevariable\hyphenpenalty\hyphenpenalty=30%
+ \babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
+ \babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
+ \babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%
+ }
+\addto\noextrasfinnish{}
+% \end{macrocode}
+%
+% Another thing |\extrasfinnish| needs to do is to ensure that
+% |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasfinnish| will switch it of again.
+% \changes{finnish-1.3f}{1995/05/15}{Added the setting of
+% \cs{frenchspacing}}
+% \begin{macrocode}
+\addto\extrasfinnish{\bbl@frenchspacing}
+\addto\noextrasfinnish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% For Finnish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the finnish group of shorthands
+% should be used.
+% \changes{finnish-1.3g}{1995/07/02}{Added the active double quote}
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasfinnish{\languageshorthands{finnish}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{finnish-1.3n}{1999/12/16}{Deactive shorthands ouside of Finnish}
+% \begin{macrocode}
+\addto\extrasfinnish{\bbl@activate{"}}
+\addto\noextrasfinnish{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+%
+% The `umlaut' character should be positioned lower on \emph{all}
+% vowels in Finnish texts.
+% \begin{macrocode}
+\addto\extrasfinnish{\umlautlow\umlautelow}
+\addto\noextrasfinnish{\umlauthigh}
+% \end{macrocode}
+%
+% First we define access to the low opening double quote and
+% guillemets for quotations,
+% \changes{finnish-1.3k}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \changes{finnish-1.3m}{1999/04/13}{Added misisng closing brace}
+% \begin{macrocode}
+\declare@shorthand{finnish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{finnish}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+\declare@shorthand{finnish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{finnish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \changes{finnish-1.3p}{2001/11/13}{\texttt{\symbol{34}\symbol{61}}
+% should also use \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{finnish}{""}{\hskip\z@skip}
+\declare@shorthand{finnish}{"=}{\hbox{-}\bbl@allowhyphens}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{finnish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch, Finnish and German,
+% where long compound words are quite normal and all one needs is a
+% means to indicate an extra hyphenation position on top of the
+% ones that \TeX\ can generate from the hyphenation patterns.
+% \changes{finnish-1.3g}{1995/07/02}{Added change of \cs{-}}
+% \changes{finnish-1.3n}{2000/09/19}{\cs{allowhyphens} should have
+% been \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\addto\extrasfinnish{\babel@save\-}
+\addto\extrasfinnish{\def\-{\bbl@allowhyphens
+ \discretionary{-}{}{}\bbl@allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\finishhyphenmins}
+% The finnish hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~2.
+% \changes{finnish-1.3f}{1995/05/13}{use \cs{finnishhyphenmins} to
+% store the correct values}
+% \changes{finnish-1.3n}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{finnish-1.3i}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{finnish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+
diff --git a/macros/latex/contrib/babel-contrib/finnish/finnish.ins b/macros/latex/contrib/babel-contrib/finnish/finnish.ins
new file mode 100644
index 0000000000..849e124a16
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/finnish/finnish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2007 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{finnish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2007 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{finnish.ldf}{\from{finnish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/finnish/finnish.pdf b/macros/latex/contrib/babel-contrib/finnish/finnish.pdf
new file mode 100644
index 0000000000..4e644554ef
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/finnish/finnish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/french/README b/macros/latex/contrib/babel-contrib/french/README
new file mode 100644
index 0000000000..168ac33d58
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/README
@@ -0,0 +1,49 @@
+=========================================================================
+The babel-french bundle (formerly known as `frenchb')
+
+French language support for the babel multilingual package
+
+Copyright 1996--2019 Daniel Flipo
+E-mail: daniel (dot) flipo (at) free (dot) fr
+
+Released under the LaTeX Project Public License v1.3 or later
+See http://www.latex-project.org/lppl.txt
+=========================================================================
+
+== PURPOSE ==
+
+This bundle is an extension to the babel package for multilingual
+typesetting. It provides all necessary macros, definitions and settings
+to typeset French documents. It is designed to work with the following
+engines: pdfTeX, XeTeX and LuaTeX.
+
+== CONTENTS ==
+
+The bundle consists of the following files:
+
+* frenchb.ins: installation file to unpack the language definition files,
+* frenchb.dtx: packed language definition files and documentation,
+* frenchb.pdf: unpacked documentation for babel-french,
+* frenchb-doc.pdf: comprehensive documentation in French,
+* frenchb-doc.tex: source file of frenchb-doc.pdf,
+* README (this file).
+
+== INSTALLATION ==
+
+If the latest version of this package is not included in your LaTeX
+distribution, do the following:
+
+* issue "luatex frenchb.ins" to unpack the language definition files;
+* copy the files frenchb.lua, french.ldf, frenchb.ldf, francais.ldf,
+ acadian.ldf and canadien.ldf to a location where TeX can find them
+ (default location: $TEXMF/tex/generic/babel-french/);
+* rebuild the database (mktexlsr or so).
+
+== DOCUMENTATION ==
+
+See the included manuals for usage instructions: frenchb.pdf in English or
+the French documentation frenchb-doc.pdf.
+
+== CHANGES ==
+
+See the included manual frenchb.pdf, section "Change History".
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf
new file mode 100644
index 0000000000..12b0e7a8fb
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex
new file mode 100644
index 0000000000..c370a86786
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex
@@ -0,0 +1,2020 @@
+\documentclass[a4paper,12pt,german,english,french]{article}
+
+\usepackage{xspace}
+\usepackage{array,longtable}
+\usepackage{varioref}
+\renewcommand{\reftextpagerange}[2]{\pageref{#1}--\pageref{#2}}
+\usepackage{url,alltt,shortvrb}
+\usepackage{graphics}
+\usepackage[dvipsnames]{xcolor}
+\usepackage{luatexbase} %%% Provisoire : pour microtype
+
+%%% Fontes OpenType avec moteur LuaTeX : Erewhon/Cabin/Inconsolata
+\usepackage[upright]{fourier} % Pour les maths seulement
+\usepackage[no-math]{fontspec}
+\usepackage{realscripts}
+\setmainfont{Erewhon}%
+ [BoldFeatures = {SmallCapsFont={Erewhon-Bold}},
+ ItalicFeatures={SmallCapsFont={Erewhon-RegularSlanted}},
+ BoldItalicFeatures={SmallCapsFont={Erewhon-BoldSlanted}},
+ ]
+\setsansfont{Cabin}[Scale=MatchLowercase]
+\setmonofont{Inconsolatazi4}% voir inconsolata-doc.pdf
+ [Scale=MatchLowercase,HyphenChar=None,StylisticSet={2,3},
+ AutoFakeSlant=0.2 % XeTeX only, sans effet avec LuaTeX
+ ]
+
+%%% *** APRÈS fontspec ***
+\usepackage{babel}
+\frenchbsetup{og=«, fg=», AutoSpacePunctuation=false}
+\frenchbsetup{ListItemsAsPar}
+
+\usepackage[babel=true,expansion=true,protrusion=true]{microtype}
+
+% Mise en page
+\usepackage[textwidth=160mm,textheight=247mm,hmarginratio=1:1
+ ]{geometry}
+%
+%\setlength{\parindentFFN}{0em}
+\setlength{\parindent}{0mm}
+\setlength{\parskip}{.5\baselineskip plus .2\baselineskip
+ minus .1\baselineskip}
+\ifFBListItemsAsPar
+\else
+ \setlength{\listindentFB}{0mm} % sans effet si ListItemsAsPar=true
+\fi
+
+\MakeShortVerb{\|}
+
+% Couleurs
+% \emph
+\let\emphORI\emph
+\renewcommand{\emph}[1]{\textcolor{BrickRed}{\emphORI{#1}}}
+% verbatim : modifier \verbatim@font
+\def\ColorVerb{\color{MidnightBlue}}
+\makeatletter
+\let\verbatim@fontORI\verbatim@font
+\def\verbatim@font{\ColorVerb\verbatim@fontORI}
+\makeatother
+% options de frenchb :
+ \def\ColorArg{\color{Sepia}}
+% N.B. URL color = ForestGreen
+%
+\newcommand*{\file}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\cls}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\ext}[1]{\texttt{\ColorVerb #1}}
+\let\pkg\ext
+\newcommand*{\exe}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\opt}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\bibsty}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\env}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\lang}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\code}[1]{\texttt{\ColorVerb #1}}
+\newcommand*{\argum}[1]{\textit{#1}}
+\newcommand*{\meta}[1]{\textit{\ColorArg #1}}
+
+\providecommand\marg[1]{% % from ltxdoc.cls
+ {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
+\providecommand\oarg[1]{%
+ {\ttfamily[}\meta{#1}{\ttfamily]}}
+
+\DeclareRobustCommand\cs[1]{\texttt{\ColorVerb \char`\\#1}}% from ltxdoc.cls
+\newcommand*\fbo[1]{\texttt{\ColorArg #1}}
+\newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}}
+
+\renewcommand*\descriptionlabel[1]{\hspace\labelsep
+ \normalfont\ttfamily\bfseries {\MyColor #1}}
+\let\MyColor\relax
+
+\providecommand*{\BibTeX}{%
+ B\textsc{i}\kern-.025em \textsc{b}\kern-.08em \TeX}%
+\providecommand*{\biber}{Biber}
+\providecommand*{\biblatex}{Biblatex}
+
+% URL de mon site perso :
+\begingroup
+\catcode`~=12
+\xdef\urlperso{http://daniel.flipo.free.fr}
+\endgroup
+
+% Adaptation des \subsubsection{} (thèmes des options de \frenchsetup{})
+\makeatletter
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+ {-1ex\@minus -.5ex}%
+ {1ex\@minus .5ex}%
+ {\normalfont\normalsize\bfseries}}
+\makeatother
+
+\usepackage{hyperref}
+\hypersetup{pdftitle={Documentation de babel-french},
+ pdfcreator={LuaTeX},
+ pdfauthor={Daniel FLIPO},
+ unicode,
+ bookmarksopen,
+ colorlinks,
+ urlcolor=ForestGreen,
+ linkcolor=black, % appel note bas de page en noir
+ }
+\newcommand*{\hlabel}[1]{\phantomsection\label{#1}}
+% notes bas de page consécutives avec le même numéro
+\newcommand*{\samefntmk}{%
+ \addtocounter{Hfootnote}{-1}\addtocounter{footnote}{-1}\footnotemark}
+
+\usepackage[open]{bookmark}
+%
+\title{Documentation sur le module \ext{babel-french}}
+\author{\href{mailto:daniel.flipo@free.fr}{Daniel \textsc{Flipo}}}
+\newcommand*{\latestversion}{3.5e}
+\date{Version {\latestversion} -- \today}
+
+\begin{document}
+\def\today{30 avril 2019}
+
+\maketitle
+\thispagestyle{empty}
+
+\begin{abstract}
+ La première version de frenchb (\textbf{french} pour \textbf{b}abel) est
+ sortie en 1996. La version~2, profondément remaniée, date de mai~2007.
+ La liste détaillée des changements intervenus depuis la version~2.6 se
+ trouve à la section~\ref{sec:changes-3.0} p.~\pageref{sec:changes-3.0}.
+
+ La version actuelle de frenchb (\latestversion), dont le nom officiel est
+ \ext{babel-french}, est prévue pour fonctionner aussi bien avec les anciens
+ formats TeX comme pdf(La)TeX qu’avec les nouveaux Lua(La)TeX et Xe(La)TeX.
+
+ Les mises à jour de \ext{babel-french} sont désormais affichées très
+ rapidement sur CTAN et immédiatement intégrées aux distributions TeXLive,
+ MikTeX, MacTeX, etc.
+ La présente documentation en français est également disponible sur CTAN,
+ il n’y a plus besoin de la récupérer sur mon site
+ personnel {\expandafter\expandafter\expandafter\url{\urlperso/babel-french}}.
+
+\end{abstract}
+
+\bgroup
+\renewcommand{\abstractname}%
+ {Historique des mises à jour de cette documentation}
+\newlength\mybox
+\settowidth{\mybox}{5 décembre 2012}
+\renewcommand{\descriptionlabel}[1]{\makebox[\mybox][l]{\textbf{#1 :}}}
+\vspace{\baselineskip}\noindent
+\begin{abstract}
+ \vspace{-\baselineskip}\noindent
+ \descindentFB=0pt
+ \begin{description}
+ \item[8 juillet 2014] Ajout des sections~\ref{ssec:captions}
+ p.~\pageref{ssec:captions} (\textit{caption names}) et \ref{ssec:biblatex}
+ p.~\pageref{ssec:biblatex} (\biblatex).
+ \item[28 juillet 2014] Présentation des listes,
+ configuration d’\ext{enumitem} (section~\ref{ssec:lists}).
+ \item[16 sept. 2014] Ajout de l’option \fbo{SmallCapsFigTabCaptions},
+ voir p.~\pageref{scfigtab}.
+ \item[9 avril 2015] Charger \ext{listings} après \ext{babel}
+ (section~\ref{sec:Incomp}).
+ \item[14 février 2016] Adaptation à la version 3.2a, voir
+ section~\ref{ssec:changes-3.2}.
+ \item[30 mars 2016] Charger \ext{subcaption} après \ext{babel}
+ (section~\ref{sec:Incomp}).
+ \item[14 mai 2016] Mise à jour pour TeXLive~2016,
+ voir section~\ref{ssec:changes-3.2}. L’historique des changements
+ antérieurs à la version~3.0 a été supprimé.
+ \item[3 juillet 2016] Ajout dans la version~3.2d, du paramètre
+ |\descindentFB| pour les listes \env{description}, voir
+ section~\ref{ssec:lists}.
+ \item[15 janvier 2017] La version~3.2f est compatible avec l’extension
+ \ext{icomma}.
+ \item[30 janvier 2017] Le comportement par défaut de la commande
+ |\frquote{}| sous LuaTeX est modifié, voir p.~\pageref{frquote}.
+ \item[30 avril 2017] Utiliser |\frenchsetup{}| de préférence à
+ |\frenchbsetup{}|, voir p.~\pageref{sec:Perso}.
+ Personnalisation de la commande |\part{}|, voir p.~\pageref{ssec:captions}.
+ \item[31 août 2017] Ajout de l’option \fbo{UnicodeNoBreakSpaces},
+ voir p.~\pageref{ucs-nbsp}.
+ \item[30 janvier 2018] Adaptation à la version 3.4a, voir
+ section~\ref{ssec:changes-3.4}.
+ \item[24 février 2018] Regroupement par thèmes des options de \fbsetup{}.
+ \item[6 juillet 2018] Nouvelle option \fbo{ListItemsAsPar},
+ voir p.~\pageref{ListAsPar}.
+ \item[24 janvier 2019] L’option \fbo{StandardListSpacing=true} est à utiliser
+ de préférence à \fbo{ReduceListSpacing=false}, voir p.~\pageref{ListAsPar}.
+ \item[14 mars 2019] Nouvelle commande |\NoEveryParQuote|, voir
+ p.~\pageref{frquote}.
+\end{description}
+\end{abstract}
+\egroup
+
+\newpage
+\renewcommand{\contentsname}{Sommaire}
+\tableofcontents{}%
+\label{ch-doc8}
+
+\newpage
+\section{Appel de l’extension Babel}
+
+Babel est installé en standard dans toutes distributions \LaTeXe,
+pour disposer des langues française et anglaise%
+\footnote{En fait américaine (US-english), il existe une variante
+ \opt{british} pour l’anglais « britannique ».},
+il suffit d’ajouter
+|\usepackage[english,french]{babel}|%
+\footnote{Les options \opt{frenchb} et
+ \opt{francais} (équivalentes à \opt{french}
+ depuis 2004), sont conservées pour des raisons de compatibilité, mais elles
+ \emph{ne devraient plus être utilisées}.}
+dans le préambule du document (entre |\documentclass|
+et |\begin{document}|).
+
+Il est recommandé de déclarer les options de langues comme arguments
+de |\documentclass|, elles peuvent alors être utilisées également par
+d’autres extensions :\\
+|\documentclass[12pt,english,french]{article}|\\
+|\usepackage{varioref}|\\
+|\usepackage{babel}|\\
+a le même effet que\\
+|\documentclass[12pt]{article}|\\
+|\usepackage[french]{varioref}|\\
+|\usepackage[english,french]{babel}|
+
+La \emph{dernière} langue chargée en option de Babel ou de |\documentclass|
+(le français dans les exemples ci-dessus) est la \emph{langue principale}
+du document, c’est elle qui est active au début du document et
+qui régit la présentation générale (listes, notes de bas de page,
+retrait des premiers paragraphes) quelle que soit la langue courante.
+
+Pour changer de langue en cours de document on utilise la commande standard
+de \mbox{Babel} |\selectlanguage{|\argum{lang}|}|,
+par exemple |\selectlanguage{english}| et pour revenir en français
+|\selectlanguage{french}|\footnote{Là encore, le nom de la langue
+ française est \opt{french}, pas \opt{frenchb} ou \opt{français}.}.
+
+Pour passer \emph{localement} dans une autre langue on peut utiliser
+l’environnement \\
+|\begin{otherlanguage}{|\argum{langue}|}|\\
+\hspace*{1em}\argum{texte\dots}\\
+|\end{otherlanguage}|\\
+ou pour une courte citation dans un paragraphe\\
+|\foreignlanguage{|\argum{langue}%
+|}{|\argum{texte\dots}|}|.
+
+Depuis la version~3.10 de Babel, une syntaxe allégée est proposée pour les
+changements de langue : en ajoutant par exemple dans le préambule
+|\babeltags{fr = french}|%
+\footnote{Rien n’empêche de remplacer \texttt{\ColorVerb fr} par
+ \texttt{\ColorVerb french}, on retrouve ainsi la syntaxe de
+ \ext{polyglossia}.}, on peut remplacer
+|\foreignlanguage{french}{texte}| par |\textfr{texte}| et\\
+|\begin{otherlanguage*}{french} \end{otherlanguage*}| par\hlabel{textfr}
+|\begin{fr} \end{fr}|.
+|\babeltags| peut s’appliquer à plusieurs langues :
+|\babeltags{fr=french, de=german}|.
+
+\emph{Remarque importante sur les fontes.}
+Le recours à \ext{babel-french} ne suffit pas pour obtenir des césures
+correctes des mots accentués, il faut en outre utiliser des fontes contenant
+tous les caractères spéciaux du français (â, é, ï, ù, ç, etc.) ; la façon de
+le faire dépend du format utilisé :
+\begin{itemize}
+\item avec pdfLaTeX il convient d’ajouter dans le préambule les deux
+ commandes\\
+ |\usepackage[T1]{fontenc}|\\
+ |\usepackage{lmodern}|\\
+ et de déclarer le codage d’entrée (celui qui est utilisé par l’éditeur choisi),
+ par exemple |utf8| (recommandé) ou |latin9| ou |latin1| ou |applemac|, etc.\\
+ |\usepackage[utf8]{inputenc}|
+\item avec LuaLaTeX ou XeLaTeX on peut ajouter |\usepackage{fontspec}| mais
+ ceci est devenu facultatif avec les formats LaTeX récents (2017).
+\end{itemize}
+Dans les deux cas, le document sera composé avec les fontes LM ou
+\textit{Latin Modern} qui sont la version moderne des fontes CM ou
+\textit{Computer Modern}, fontes historiques de TeX.
+Les fontes LM conviennent pour toutes les langues de l’Europe de l’ouest
+(latines, anglo-saxonnes et scandinaves).\\
+Rappelons qu’avec LuaLaTeX ou XeLaTeX aucun appel à
+|\usepackage[...]{inputenc}| n’est à faire puisque que le texte source
+\emph{doit être codé} en |utf8|.
+
+\goodbreak
+L’utilisation de fontes de la famille CM/LM n’est pas du tout indispensable,
+\begin{itemize}
+\item pour pdfLaTeX toute fonte PostScript en codage~T1 convient, ainsi on
+ pourra remplacer |lmodern|, au choix par |kpfonts|, |fourier| (Utopia),
+ |mathptmx| ou |txfonts| (Times), |mathpazo| ou |pxfonts| (Palatino), etc.
+\item pour LuaLaTeX ou XeLaTeX, il convient de faire appel aux fontes
+ OpenType, l’exemple suivant sélectionne une police pour chaque famille
+ (romain, sans-serif, chasse fixe) et uniformise la hauteur des minuscules :\\
+|\usepackage{fontspec}|\\
+|\setmainfont{Erewhon}|\\
+|\setsansfont[Scale=MatchLowercase]{Cabin}|\\
+|\setmonofont[Scale=MatchLowercase,HyphenChar=None]{Inconsolatazi4}|
+
+ Il est recommandé d’ajouter également |\usepackage{realscript}| afin de
+ profiter de vraies lettres supérieures lorsqu’elles sont disponibles.
+
+ Il est également possible d’utiliser des fontes PostScript, pour plus de
+ détails consulter par exemple le chapitre~15 du livre
+ \textit{\LaTeX, l’essentiel} de \bsc{D.~Bitouzé} et \bsc{J.-C.~Charpentier}.
+\end{itemize}
+
+\section{Description de la francisation par babel-french}
+\label{sec:description}
+
+Dans un document multilingue, il y a des conventions typographiques qui
+changent avec la langue, comme la présence ou non d’espaces avant
+la ponctuation haute et d’autres, la présentation des listes, des notes
+de bas de page ou le retrait des premiers paragraphes des sections qui
+devraient s’appliquer globalement à tout le document.
+
+Depuis la version~2.2, \ext{babel-french} utilise la notion de \emph{langue
+ principale} qui est la \emph{dernière option} (éventuellement la seule) de
+la commande |\usepackage[...]{babel}| ; c’est elle qui impose la présentation
+globale du document (listes, notes de bas de page, retrait des premiers
+paragraphes), les autres conventions typographiques restent locales (elles
+varient selon la langue utilisée). Lorsque le français n’est pas la langue
+principale, \ext{babel-french} ne modifie en rien la présentation globale du
+document : celle-ci est imposée uniquement par la classe et les autres
+extensions chargées.
+
+Lorsque le français est la langue principale, la présentation globale du
+document (ou maquette) est modifiée de la façon suivante%
+\footnote{Il est possible, pour chacun des points suivants, de revenir aux
+ réglages standard de LaTeX, voir section~\ref{sec:Perso}.} :
+
+\begin{itemize}
+
+\item Le premier paragraphe de chaque section est mis en retrait
+ comme les suivants.
+
+\pagebreak[3]
+\item Listes « \env{itemize} » :
+ \begin{itemize}
+ \item les marqueurs traditionnels du type «\textbullet» sont remplacés
+ par défaut par des tirets~longs «---», ou par un autre marqueur
+ choisi par l’utilisateur (voir section~\ref{sec:Perso}) ;
+
+ \item les espaces verticaux ajoutés par LaTeX entre les différents
+ éléments d’une liste (\textit{items}) sont supprimés.
+
+ \item la largeur des marges gauches dans les listes \env{itemize} est
+ ajustée en fonction du marqueur utilisé. Depuis la version~2.6a, le même
+ réglage s’applique aussi aux listes \env{enumerate} et trois paramètres
+ (|\listindentFB|, |\descindentFB| et |\labelwidthFB|) ont été
+ ajoutés pour permettre d’affiner la présentation des listes \env{itemize},
+ \env{enumerate} et \env{description} (voir section~\ref{ssec:lists}).
+ \end{itemize}
+
+\item Par défaut les espacements verticaux de \emph{toutes} les listes
+ (\env{enumerate}, \env{description} mais aussi
+ \env{abstract}, \env{quote}, \env{quotation}, \env{verse})
+ sont réduits.
+
+{\sloppy
+\item Les notes de bas de page sont présentées « à la française »
+ comme ceci\footnote{Une note de bas de page « à la française ».}
+ {\FBFrenchFootnotesfalse\makeatletter\let\@footnotemark\@footnotemarkORI
+ au lieu de ceci\footnote{Une note de bas de page standard (classe
+ \cls{article}), ça jure avec la précédente, non ?}\makeatother}.
+ Noter, outre la présentation différente du numéro dans la note elle-même,
+ l’ajout de l’espace fine avant l’appel de la première note.
+ Le retrait des notes par rapport à la marge gauche est par défaut fixé
+ au maximum de |\parindent| et de 1.5em, il peut être modifié en
+ donnant la valeur voulue à |\parindentFFN| dans le préambule :
+ |\setlength{\parindentFFN}{0mm}| par exemple.
+ De même, le point qui suit par défaut le numéro de note, ainsi que l’espace
+ insécable qui sépare ce point du texte de la note peuvent être redéfinis :
+ ajouter dans le préambule |\renewcommand{\dotFFN}{}|,
+ |\renewcommand{\kernFFN}{--}| (pas de point, un tiret double sans espace
+ après le numéro de note).\hlabel{FFN}
+\par}
+
+\item Les légendes des figures et des tables utilisent un tiret double
+ à la place du «\string:», on obtient
+ «Figure~1~--~Légende» au lieu de «Figure~1\string:~Légende».
+ Il est possible de choisir un autre séparateur :
+ pour remplacer le tiret double «--» par un tiret triple «---»,
+ ajouter dans le préambule
+ |\renewcommand*{\CaptionSeparator}{\space\textemdash\space}|.%
+ \hlabel{captionseparator}
+
+ Lorsque la langue principale n’est pas le français, le séparateur «\string:»
+ est utilisé pour toutes les langues mais une espace insécable est en principe
+ ajoutée en français ; lorsque l’ajout échoue, un message est affiché dans le
+ fichier \file{.log}.
+
+ Certaines classes ou extensions modifient la présentation des légendes;
+ parmi elles, les classes (\cls{memoir}, koma-script et AMS et les
+ extensions(\ext{caption} et \ext{floatrow} sont compatibles avec
+ \ext{babel-french}.
+
+ Un avertissement est inséré dans le fichier \file{.log} lorsqu’il y a risque
+ de conflit avec une autre extension ou classe qui modifie la définition de
+ la commande |\@makecaption| ou lorsque le chargement d’une extension
+ intervient trop tôt ou trop tard.
+\end{itemize}
+
+En ce qui concerne les conventions typographiques locales (variables avec la
+langue) la commande |\selectlanguage{french}|
+produit les effets suivants :
+\enlargethispage*{\baselineskip}
+\begin{itemize}
+
+\item Les motifs de césures françaises sont activés.
+
+\item Des espaces insécables et de taille adéquate sont ajoutés
+ automatiquement devant la ponctuation haute (|; : ! ?|)%
+ \footnote{Voir section~\ref{sec:Perso} p.~\pageref{sec:Perso} comment
+ éviter les ajouts abusifs d’espace avant ces caractères
+ et section~\ref{sec:active-char} p.~\pageref{sec:active-char} en cas de
+ problème dû aux caractères actifs.}.
+ Ceci impose que ces caractères soient rendus actifs (en fait dans tout le
+ document), \emph{sauf} avec les versions récentes de Xe(La)TeX ou Lua(La)TeX
+ qui disposent d’un mécanisme permettant d’accéder aux mêmes fonctionnalités
+ sans recours aux caractères actifs.
+
+\item la définition de |\dots| est modifiée pour
+ supprimer l’espace qui suit (cet espace est gênant devant une
+ parenthèse par exemple\dots)%
+ \footnote{Certains auteurs préfèrent en français «...» (codé \code{...}
+ sans espace) à «\dots» (codé \cs{dots}).}.
+
+\item La commande |\today| retourne la date en français.
+
+\item Les titres («caption names» en anglais) sont traduits en
+ français, ainsi la commande |\chapter| imprimera
+ « Chapitre » au lieu de « Chapter ». Voir section~\ref{ssec:captions}
+ p.~\pageref{ssec:captions} comment modifier ces intitulés.
+
+\end{itemize}
+
+La commande |\selectlanguage{english}| ramène
+au comportement standard de LaTeX (typographie américaine).
+
+Des commandes ont été prévues pour faciliter la saisie :
+\begin{itemize}
+
+\item Les guillemets peuvent être saisis grâce aux commandes |\og| et |\fg|%
+ \footnote{Si les caractères « et » sont accessibles au clavier,
+ ils peuvent être utilisés pour saisir les guillemets, voir
+ la fin de la section~\ref{sec:Perso}, p.~\pageref{og-fg}.},
+ ce qui donne selon la langue de travail « guillemets français » ou
+ \begin{otherlanguage}{english}``english quotes’’\end{otherlanguage}.
+
+ Notez que les guillemets français ne devraient \emph{jamais} être saisis
+ avec |<<| et |>>| contrairement à ce qui se fait avec
+ {e-French} (voir section~\ref{sec:CompatFP}).
+
+ Depuis la version~3.1, une alternative, |\frquote{|\textit{texte}|}|, est
+ proposée pour la saisie des guillemets français avec l’espace adéquat,
+ le résultat est \frquote{\textit{texte}}.
+
+ L’usage de |\frquote{}| est recommandé pour les citations longues
+ (c.-à-d. s’étendant sur plus d’un paragraphe) et pour les citations
+ imbriquées.\hlabel{frquote}
+
+ Pour les premières, |\frquote{}| insère automatiquement un guillemet ouvrant
+ au début de chaque paragraphe, sauf si \fbo{EveryParGuill=close} (guillemet
+ fermant dans ce cas) ou si \fbo{EveryParGuill=none} (aucun ajout).
+
+ Pour les citations imbriquées, plusieurs présentations sont proposées selon
+ les options choisies :
+ \begin{itemize}
+ \item Les citations internes sont balisées par des guillemets anglais
+ ``comme ceci’’ (recommandation de Aurel Ramat) sauf si
+ \fbo{InnerGuillSingle=true}, dans ce cas les guillemets anglais sont
+ remplacés par guillemets français simples \guilsinglleft\FBguillspace
+ comme ceci \FBguillspace\guilsinglright{} (suggestion de Jean Méron).
+ \item Avec les formats basés sur LuaTeX, il est possible d’insérer en début
+ de chaque ligne de la citation interne un guillemet dit « de suite »,
+ ouvrant --~comme le recommande l’Imprimerie nationale~-- avec l’option
+ \fbo{EveryLineGuill=open}, ou fermant (préconisé par
+ Jean-Pierre Lacroux) avec l’option \fbo{EveryLineGuill=close}.
+ Dans les deux cas l’option \fbo{InnerGuillSingle} est sans effet, la
+ citation interne est toujours balisée par des guillemets chevrons « et ».
+ \end{itemize}
+
+ Lorsque les citations internes et externes se terminent en même temps, il
+ est d’usage de supprimer le guillemet fermant de la citation interne. Pour
+ ce faire, il suffit de coder la citation interne avec |\frquote*{}| au lieu
+ de |\frquote{}|.
+
+Exemple de citation imbriquée :
+
+\vspace{0.5\baselineskip}
+\begin{minipage}[t]{.47\textwidth}
+\hspace*{\fill}%
+\fbox{\begin{minipage}[t]{.95\textwidth}
+ \FBInnerGuillSingletrue
+ \parindent=1em
+ Xavier raconte ainsi sa mésaventure :
+ \frquote{Au moment d’enregistrer mes bagages, l’hôtesse
+ m’a dit tout bonnement :
+ \frquote*{Je suis désolée, il n’y a plus de place.
+ Vous allez devoir attendre le prochain vol.\par
+ C’est un effet de ce qu’on appelle la surréservation,
+ ou \textit{surbooking} en anglais.}%
+ }%
+ \end{minipage}%
+}\\[.2\baselineskip]
+\hspace*{\fill}\fbo{InnerGuillSingle}\hspace*{\fill}
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.47\textwidth}
+\fbox{\begin{minipage}[t]{.95\textwidth}
+ \let\FBeverylineguill\FBguillopen
+ \parindent=1em
+ Xavier raconte ainsi sa mésaventure :
+ \frquote{Au moment d’enregistrer mes bagages, l’hôtesse
+ m’a dit tout bonnement :
+ \frquote*{Je suis désolée, il n’y a plus de place.
+ Vous allez devoir attendre le prochain vol.\par
+ C’est un effet de ce qu’on appelle la surréservation,
+ ou \textit{surbooking} en anglais.}%
+ }%
+ \end{minipage}%
+}\\[.2\baselineskip]
+\hspace*{\fill}LuaLaTeX + \fbo{EveryLineGuill=open}\hspace*{\fill}%
+\end{minipage}
+
+\vspace{0.5\baselineskip}
+Le codage est le suivant :
+{\ttfamily\ColorVerb Xavier raconte… |\frquote{|Au moment… l’hôtesse m’a
+ dit tout bonnement : |\frquote*{|Je suis désolée, … en anglais.|}}|}
+
+ Une commande |\NoEveryParQuote| permet de supprimer localement des guillemets
+ de début de paragraphe ajoutés inconsidérément par la commande |\frquote{}|
+ notamment dans les listes (après les labels) ; elle doit être utilisée dans
+ un environnement ou un groupe pour en limiter la portée.
+
+\item La commande |\up| facilite la saisie des exposants en mode texte :
+ |M\up{me}| imprime M\up{me},
+ |1\up{er}| donne 1\up{er} ; % 1\ier ;
+ on dispose aussi de
+ |\ier| |\iere| |\iers| |\ieres| |\ieme| |\iemes|
+ pour 1\ier, 1\iere, 1\iers, 1\ieres, 2\ieme, 2\iemes.
+ La commande |\up| utilise les lettres supérieures de la police lorsqu’elles
+ sont disponibles et les simule sinon.
+ On obtient de vraies lettres supérieures
+ \begin{itemize}
+ \item avec les moteurs LuaTeX et XeTeX, à condition de charger les extensions
+ \ext{fontspec} et \ext{realscripts} et d’utiliser une police de type
+ OpenType qui connaisse la directive «\code{VerticalPosition=Superior}»
+ (polices Linux Libertine O, Iwona, par exemple) ;
+ \item sous (pdf)LaTeX avec certaines polices type~1 expertes
+ (Fourier-Utopia).
+ \end{itemize}
+De plus |\up| empêche le passage en capitales des lettres supérieures dans
+les hauts de page par exemple.\hlabel{lettres-sup}
+
+Une variante étoilée |\up*| est prévue pour les polices qui disposent d’un jeu
+incomplet de lettres supérieures : la police OpenType Jenson Pro ou la police
+type~1 Utopia-expert par exemple, n’ont pas de «g supérieur» ; en codant
+|M\up{gr}| on obtient Mg\up{r} (Jenson) ou M\up{r} (Utopia-expert) tandis que
+|M\up*{gr}| force l’utilisation de supérieures simulées ce qui pallie l’absence
+du «g supérieur», le résultat est M\up*{gr}.
+
+Pour les perfectionnistes, il est facile d’ajuster la taille et le placement
+vertical des lettres supérieures simulées par |\fup|
+(voir dans le code de \file{frenchb.dtx} les commandes |\FBsupS| et
+|\FBsupR|).
+
+\item L’usage français veut que les noms propres soient imprimés en
+ petites capitales et ne soient pas coupés en bout de ligne, la commande
+ |\bsc| (\textit{boxed small caps}) en facilite la saisie :
+ on saisira par exemple |Leslie~\bsc{Lamport}| pour
+ obtenir Leslie~\bsc{Lamport} sans risque de coupure \textsc{Lam-port}
+ en bout de ligne.
+
+\item les commandes |\primo|, |\secundo|,
+ |\tertio| et |\quarto| peuvent
+ être utilisées dans les énumérations ; elles donnent
+ \primo, \secundo, \tertio, \quarto.
+ Ensuite, |\FrenchEnumerate{6}| donne \FrenchEnumerate{6}.
+
+\item Les abréviations de «numéro», \No, \Nos, \no{} et \nos, sont obtenues
+ en tapant |\No|, |\Nos|, |\no| et |\nos| ;
+ l’espace qui suit est insécable : coder |\no1| ou |\no 1|.
+
+\item Le caractère \degre{} (à ne pas confondre avec le petit «o» de \No)
+ est saisi |\degre|, mais comme les espaces avant
+ et après ce caractère dépendent fortement de la police utilisée
+ (PostScript ou non), on emploiera |\degres| pour saisir
+ les températures « 20~\textdegree C » (codé |20~\degres C|
+ avec espace insécable) ou les titres alcooliques « 45\degres{} »
+ (codé |45\degres| sans espace).
+ Lorsque l’extension \ext{textcomp} est chargée (elle donne accès
+ aux « \TeX{} Companion fonts » qui contiennent un vrai symbole degré),
+ |\degres| utilise celui-ci (|\textdegree|).
+
+\item \hlabel{frenchdate} La commande
+ |\frenchdate|\marg{année}\marg{mois}\marg{jour}, qui prend trois arguments
+ numériques obligatoires, affiche les dates en français :
+ |\frenchdate{2001}{01}{01}| donne \frenchdate{2001}{01}{01}, le résultat
+ est inclus par défaut dans une boîte (|\hbox|) afin de ne jamais subir de
+ coupure de ligne (cf.~Gouriou, Ramat). En cas de difficulté
+ il est possible de redéfinir, localement par exemple, les commandes
+ |\FBdatebox| (|\hbox| par défaut) et |\FBdatespace| (|\space| par défaut) :
+ |\renewcommand*{\FBdatebox}{\relax}| supprime la |\hbox| tandis que
+ |\renewcommand*{\FBdatespace}{~}| rend les deux espaces insécables.
+ L’effet de ces deux commandes appliquées simultanément est d’interdire la
+ coupure sur les espaces mais d’autoriser éventuellement celle du mois
+ (jan-vier, dé-cembre, …) qui est interdite par défaut.
+
+\enlargethispage{\baselineskip}
+\item En mode mathématique, la virgule est toujours suivie d’une espace
+ car elle est traitée comme un signe de ponctuation et non comme
+ une virgule décimale. La commande |\DecimalMathComma| supprime cette
+ espace (mais uniquement en français), on revient au comportement par
+ défaut avec |\StandardMathComma|. Remarquer qu’après une
+ commande |\DecimalMathComma|, il est nécessaire de saisir un espace
+ explicite dans les listes et les intervalles par exemple |$(x,\ y)$|
+ et |$[0,\ 1]$|.
+ Ces deux commandes sont utilisables n’importe où dans le document.
+ Une solution alternative consiste à utiliser l’extension \ext{icomma}.
+
+\item La commande |\nombre|, destinée à formater
+ automatiquement les nombres entiers ou décimaux par tranches de
+ trois chiffres séparées par des espaces en français et par des
+ virgules (usage anglo-saxon), fait désormais appel à la commande
+ |\numprint| de l’extension du même nom.
+ Lors du premier appel à la commande |\nombre|,
+ un message est affiché dans le fichier \file{.log} indiquant comment
+ charger \ext{numprint}. Le chargement de \ext{numprint} n’est pas fait
+ par \ext{babel-french} à cause du risque de conflit d’options.
+ Les utilisateurs devraient s’habituer progressivement à utiliser
+ |\numprint| (ou son raccourci |\np|) à la place de |\nombre|.
+
+\end{itemize}
+
+En ajoutant |\usepackage{xspace}| dans le préambule, les espaces suivant
+les commandes
+|\ier|,\dots, |\ieres|,
+|\ieme|, |\iemes|,
+|\fg| et |\dots| sont
+respectés sans avoir à les forcer par des |{}| ou des~\verb*+\ +.
+
+\section{Personnalisation}
+\label{sec:Perso}
+
+La commande \fbsetup{}, appelée précédemment |\frenchbsetup{}|%
+\footnote{Ce dernier nom sera gardé comme alias par souci de compatibilité,
+ le nouveau devrait être préféré depuis l’abandon du nom \ext{frenchb}
+ au profit de \ext{babel-french} pour désigner l’option \opt{french}
+ de babel.},
+est à placer dans le préambule de chaque document après
+le chargement de Babel ; elle permet de personnaliser le comportement de
+\ext{babel-french} grâce au large choix parmi des options disponibles.
+La syntaxe est celle de l’extension \ext{keyval}, largement
+utilisée par d’autres extensions comme \ext{geometry} ou \ext{hyperref}.
+
+Le recours à un fichier de configuration \file{frenchb.cfg} a été supprimé en
+version~3.0.
+
+\subsection[\textbackslash frenchsetup{}]
+ {\fbsetup{\textsl{$\langle$options$\rangle$}}}
+\label{ssec:frenchbsetup}
+
+La commande \fbsetup{ShowOptions} affiche dans le fichier \file{.log} la liste
+des options disponibles, nous allons parcourir cette liste et expliquer
+l’effet de chacune d’elles.
+Dans le cas d’une option booléenne, la mention \fbo{=true} peut être omise :
+\fbsetup{ShowOptions} est équivalent à \fbsetup{ShowOptions=true}.
+
+Dans la liste ci-dessous, l’option activée par défaut est indiquée entre
+parenthèses, éventuellement suivie d’un étoile. L’étoile indique que la valeur
+par défaut correspond au cas où le français \emph{est la langue principale}
+(voir section~\ref{sec:description}, page~\pageref{sec:description}), et que
+cette valeur est inversée sinon.
+
+La liste étant longue, les options sont regroupées par thèmes.
+\bgroup
+\let\MyColor\ColorArg
+
+\subsubsection*{Inventaire des options}
+
+\begin{description}
+\item [ShowOptions=true (false)]
+ affiche dans le fichier \file{.log} toutes les options
+ disponibles, ce qui permet de retrouver leurs noms facilement.
+\end{description}
+
+\subsubsection*{Maquette générale}
+
+\begin{description}
+
+\item [StandardLayout=true (false*)] supprime toute action de
+ \ext{babel-french} sur la maquette dans le cas où le français est la
+ langue principale : retour aux listes standard, pas de
+ retrait des 1\iers{} paragraphes des sections, notes de bas de page
+ standard, séparateur «\string:» dans les légendes de figures et tableaux.
+ Lorsque le français n’est pas la langue principale, elle est sans effet.
+
+\item [GlobalLayoutFrench=false (true*)] ne devrait plus être utilisée sauf,
+ lorsque le français est la langue principale, pour retrouver le comportement
+ des versions de \ext{babel-french} antérieures à~v2.2 : dans les parties
+ rédigées dans des langues autres que le français, la présentation des listes
+ redevient standard et la mise en retrait des 1\iers{} paragraphes des
+ sections est supprimée. La présentation des notes de bas de page est
+ toujours indépendante de la langue de travail (à la française ou standard
+ pour tout le document selon la langue principale).
+
+\item [IndentFirst=false (true*)] ; par défaut, \ext{babel-french} applique un
+ retrait identique pour tous les paragraphes (de largeur |\parindent|),
+ y compris le premier de chaque section, ce qui est conforme à l’usage
+ français. Avec \fbo{IndentFirst=false} le retrait du premier paragraphe de
+ chaque section est supprimé, comme c’est l’usage en anglais, soit dans tout
+ le document si le français est la langue principale, soit seulement en
+ français.
+
+\item [PartNameFull=false (true)] ; par défaut \ext{babel-french} numérote les
+ parties créées par la commande |\part| en « Première partie », « Deuxième
+ partie », etc. Ceci fonctionne bien pour la plupart des classes (classes
+ standard, classes koma-script, memoir) mais pas pour les classes AMS qui
+ redéfinissent la commande |\part|. L’option \fbo{PartNameFull=false} permet
+ de revenir à une numérotation des parties plus standard -- « Partie~I »,
+ « Partie~II », etc. --, ce qui supprime les risques de mauvais affichage du
+ genre « Première partie~1 » notamment dans la table des matières.
+
+\end{description}
+
+\subsubsection*{Présentation des listes}
+
+\begin{description}
+\item [ListItemsAsPar=true (false)] ; mettre cette option à \fbo{true}
+ est recommandé à ceux qui souhaitent une présentation des listes
+ conforme aux usages en vigueur à l’Imprimerie nationale, voir
+ p.~\pageref{ListAsPar} pour une comparaison avec la disposition par défaut.
+
+\item [StandardListSpacing=true (false*)] ; par défaut \ext{babel-french}
+ modifie (en général en les réduisant, sauf pour les classes SMF)
+ les espaces verticaux%
+ \footnote{Il s’agit de \cs{itemsep}, \cs{parsep}, \cs{topsep}
+ et \cs{partopsep}.}
+ dans \emph{toutes les listes} produites à partir de l’environnement
+ \env{list}, en particulier les listes \env{enumerate}, \env{itemize} et
+ \env{description} mais aussi \env{abstract}, \env{quote}, \env{quotation},
+ \env{verse}… \fbo{StandardListSpacing=true} permet de revenir
+ aux réglages standard (ceux de la classe utilisée), elle remplace l’ancienne
+ option \fbo{ReduceListSpacing} en l’inversant :
+ \fbo{StandardListSpacing=true} équivaut à \fbo{ReduceListSpacing=false} qui
+ pouvait être trompeuse dans le cas des classes SMF mais qui fonctionne
+ toujours pour ne pas compromettre la compilation d’anciens documents.
+
+\item [StandardItemizeEnv=true (false*)] ; par défaut l’environnement
+ \env{itemize} est redéfini pour qu’aucun espace vertical ne soit ajouté
+ à l’interligne standard entre les éléments d’une liste \env{itemize} et
+ pour adapter |\labelwidth| au marqueur utilisé.
+
+ L’option |StandardItemizeEnv=true| empêche cette redéfinition, ce qui est
+ nécessaire en cas de conflit avec une classe ou une extension qui redéfinit
+ aussi l’environnement \env{itemize} (\ext{enumitem} ou \ext{paralist}
+ par exemple%
+ \footnote{\ext{babel-french} met automatiquement le drapeau
+ \fbo{StandardItemizeEnv} à \fbo{true} lorsque l’une des extensions
+ \ext{enumitem} ou \ext{paralist} est chargée.}).
+ L’interligne entre les éléments des listes \env{itemize} est alors
+ légèrement augmenté si \fbo{StandardListSpacing=false} ou l’est
+ nettement plus (on revient au réglage de base de la classe utilisée) si
+ \fbo{StandardListSpacing=true}.
+
+ Les utilisateurs d’\ext{enumitem} qui souhaitent obtenir pour leurs listes
+ une présentation à la française, trouveront comment faire
+ page~\pageref{enumitem-cfg}.\hlabel{ch-enumitem}
+
+\item [StandardEnumerateEnv=true (false*)] ; depuis la version~2.6,
+ \ext{babel-french} redéfinit également les environnements \env{enumerate} et
+ \env{description} pour que leurs marges soient les mêmes que celles des
+ listes \env{itemize}.
+
+ \fbo{StandardEnumerateEnv=true} empêche cette redéfinition, ce qui est
+ nécessaire en cas de conflit avec une classe ou une extension qui redéfinit
+ aussi l’environnement \env{enumerate} (\ext{enumerate}, \ext{enumitem} ou
+ \ext{paralist} par exemple%
+ \footnote{\ext{babel-french} met automatiquement le drapeau
+ \fbo{StandardEnumerateEnv} à \fbo{true} lorsque l’une des extensions
+ \ext{enumerate}, \ext{enumitem} ou \ext{paralist} est chargée.}).
+
+\item [StandardItemLabels=true (false*)] restitue aux
+ marqueurs des listes \env{itemize} les valeurs standard attribuées par
+ la classe de document ou les extensions utilisées.
+
+{\sloppy
+\item [ItemLabels=\boi{}textbullet, \boi{}textendash,
+ \boi{}ding{43},... (\boi{}textemdash*)] ;
+ option qui permet de choisir le marqueur
+ utilisé dans les listes \env{itemize} en français (\emph{sauf} bien sûr
+ si \fbo{StandardItemLabels=true}).
+ Noter que |\ding{43}| suppose que l’extension \ext{pifont} soit
+ chargée. Cette option affecte tous les niveaux de la liste.
+ Les quatre options suivantes fonctionnent de même mais n’affectent elles
+ qu’un niveau chacune :
+\par}
+
+\item [ItemLabeli=\boi{}textbullet, \boi{}textendash,
+ \boi{}ding\{43\},... (\boi{}textemdash*)]
+
+\item [ItemLabelii=\boi{}textbullet, \boi{}textendash,
+ \boi{}ding\{43\},... (\boi{}textemdash*)]
+
+\item [ItemLabeliii=\boi{}textbullet, \boi{}textendash,
+ \boi{}ding\{43\},... (\boi{}textemdash*)]
+
+\item [ItemLabeliv=\boi{}textbullet, \boi{}textendash,
+ \boi{}ding\{43\},... (\boi{}textemdash*)]
+
+{\sloppy
+\item [StandardLists=true (false*)] ; supprime toute action de
+ \ext{babel-french} sur les listes, elle équivaut aux quatre options
+ \fbo{StandardItemLabels=true}, \fbo{StandardItemizeEnv=true},
+ \fbo{StandardEnumerateEnv=true} et \fbo{StandardListSpacing=true}.
+ Lors de l’utilisation d’une classe ou d’une extension qui modifie la
+ présentation des listes, il peut y avoir conflit avec \ext{babel-french} ;
+ dans ce cas l’option \fbo{StandardLists} (ou éventuellement l’une ou l’autre
+ des quatre sous-options plus ciblées qu’elle regroupe) devrait régler le
+ problème%
+ \footnote{L’option \fbo{StandardLists} est automatiquement activée avec la
+ classe \cls{beamer}.}.
+\par}
+
+\item [ListOldLayout=true (false*)] ne devrait être utilisée que pour
+ recomposer d’anciens documents à l’identique, c’est-à-dire pour retrouver
+ la présentation des listes qui prévalait avant la version~2.6a.
+
+\end{description}
+
+\subsubsection*{Présentation des notes de bas de page}
+
+\begin{description}
+
+\item [FrenchFootnotes=false (true*)] fait revenir à la
+ présentation standard des notes de page, telle que définie par la classe ou
+ les extensions utilisées. Cette option affecte la totalité du document.
+ La commande |\StandardFootnotes| peut encore être utilisée
+ \emph{localement}, par exemple dans les environnements \env{minipage} si la
+ présentation «à la française» ne convient pas (notes numérotées `a’, `b’,
+ etc.).
+
+\item [AutoSpaceFootnotes=false (true*)] supprime l’espace fine
+ insécable ajoutée par défaut avant l’appel de chaque note dans le texte
+ courant. Cette option affecte la totalité du document.
+
+\end{description}
+
+\subsubsection*{Ponctuation haute}
+
+\begin{description}
+
+\item [AutoSpacePunctuation=false (true)] ; par défaut, \ext{babel-french}
+ corrige la faute de saisie qui consiste à omettre l’espace devant la
+ ponctuation haute (\string: \string; \string? \string!) en ajoutant
+ automatiquement une espace insécable de taille adaptée.
+ Toutefois, l’ajout d’espace n’a pas lieu lorsque la police courante est
+ à espacement fixe%
+ \footnote{Ceci évite en particulier les problèmes en verbatim.} :
+ |\texttt{http://truc}| produit \texttt{http://truc}.
+
+ Le moteur LuaTeX permet un contrôle fin de l’ajout d’espace devant le
+ deux-points : si ce caractère n’est pas précédé d’un espace et que celui qui
+ le suit est de type \textit{glyphe} (lettre, chiffre, /, \textbackslash, etc.)
+ aucune espace n’est ajoutée en sortie, ce qui évite les espaces parasites
+ dans les URLs (ftp://monsite), les chemins MSDOS (C:\textbackslash) et les
+ horaires (10:55). Avec XeTeX ou pdfTeX |\textsf{http://truc}| donne
+ \textsf{http~://truc} (espace parasite avant le «:»).
+
+ Il y a une autre exception avec les moteurs LuaTeX et XeTeX :
+ si l’utilisateur code une espace insécable U+00A0 (\emph{pas}
+ \raisebox{-1ex}{\huge\code{\tild}}) ou une fine insécable
+ U+202F, ces caractères sont recopiés tels quels en sortie,
+ sans ajout d’espace par \ext{babel-french}.
+
+ Ceux qui sont sûrs de leur saisie peuvent mettre cette option à
+ \fbo{false} pour contrôler complètement l’ajout d’espace devant la
+ ponctuation haute : l’espace adéquate (toujours insécable) est ajoutée
+ si et seulement si un espace précède le signe de ponctuation dans le
+ fichier source. Ils éviteront ainsi, quel que soit le moteur utilisé,
+ de voir des espaces ajoutées à tort.
+
+ Autre solution pour les autres : laisser le mode par défaut et éviter,
+ le cas échéant, l’insertion d’espaces parasites en utilisant la commande
+ |\NoAutoSpacing| dans un groupe, par exemple |{\NoAutoSpacing 10:55}|
+ (XeTeX et pdfTeX, inutile avec LuaTeX).
+
+\item [ThinColonSpace=true (false)] ; par défaut l’espace placée
+ avant le `\string:’ est une espace-mot insécable, cette option la remplace
+ par une espace fine insécable. Certains auteurs font ce choix pour que les
+ espaces précédant les quatre signes de ponctuation haute soient identiques.
+ Le choix par défaut correspond à la maquette de l’Imprimerie nationale,
+ le Guide du typographe (ex-roman) préconise lui l’espace fine devant le
+ `\string:’.
+
+ Il est possible de redéfinir complètement la taille des espaces précédant
+ la ponctuation haute (ou les guillemets français) en utilisant dans le
+ préambule la commande |\FBsetspaces| qui admet un argument optionnel
+ (pour le dialecte \lang{french} ou \lang{acadian}, son absence équivaut
+ à \lang{french}) et quatre arguments obligatoires : le premier précise le
+ type d’espace à redéfinir, il doit être |colon| (pour le~`:’), |thin|
+ (pour~`;’ `!’ et `?’) ou |guill| pour les guillemets chevrons),
+ les trois suivants sont des nombres décimaux qui définissent la largeur
+ (\textit{width}), l’extensibilité (\textit{stretch}) et la compressibilité
+ (\textit{shrink}) de l’espace exprimées en \textit{fontdimen}.
+ \hlabel{FBsetspaces}
+ Le dialecte \lang{acadian} utilise les valeurs définies pour \lang{french}
+ sauf présence dans le préambule de commandes spécifiques
+ |\FBsetspaces[acadian]|.
+
+ Exemples : les valeurs |{1}{1}{1}| correspondent à l’espace-mot justifiante
+ (utilisée par défaut devant le deux-points), |{0.5}{0}{0}|
+ à l’espace fine (utilisée par défaut devant `;’ `!’ et `?’, noter son
+ absence d’élasticité) et |{0.8}{0.3}{0.8}| à l’espace utilisée par défaut
+ à l’intérieur des guillemets.
+
+ |\FBsetspaces{colon}{0.5}{0}{0}| est équivalent
+ à l’option~\fbo{ThinColonSpace} (vaut pour le français et le canadien).
+
+ |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| redéfinit l’espace précédant
+ le~`:’ en espace fine seulement pour le canadien.
+
+ |\FBsetspaces{colon}{1}{0}{0}| met une espace-mot sans élasticité devant
+ les~`:’.
+
+\item [OriginalTypewriter=true (false)] ; par défaut, lorsqu’une police
+ à espacement fixe est utilisée (|\texttt{}|, mode verbatim, listings, etc.)
+ \ext{babel-french}, n’ajoute jamais d’espace avant la ponctuation haute ni
+ après `«’, ni avant `»’ même si ces caractères ont été activés par l’option
+ \fbo{og=«, fg=»}. De plus, les espaces présents dans texte source ne sont
+ pas modifiés, par exemple |\texttt{X != Y}| produit \texttt{X != Y} (pas
+ d’espace fine avant le~`!’).
+ Mettre cette option à \fbo{true} supprime ce comportement, ce qui peut être
+ utile pour recompiler à l’identique des anciens textes.
+
+\item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp} cette option
+ expérimentale n’a d’effet qu’avec LuaLaTeX ; lorsqu’on la met à \fbo{true}
+ les espaces insécables ajoutées par \ext{babel-french} dans le fichier PDF
+ de sortie (ponctuation haute, guillemets, etc.) sont codées sous forme de
+ caractères Unicode (U+A0 ou U+202F fine) au lieu des pénalités et ressorts
+ de type \textit{glues}. Ceci devrait préserver ces espaces lors de la
+ conversion en HTML des fichiers produits par LuaLaTeX, malheureusement la
+ version actuelle de \exe{pdftotext} ne les restitue pas correctement.
+
+ En revanche, \exe{lwarp} (v.~0.37 et suivantes) est totalement compatible
+ avec \ext{babel-french} pour la conversion des fichiers PDF produits sous
+ XeLaTeX et pdfLaTeX : les espaces insécables sont préservées.
+
+\end{description}
+
+\subsubsection*{Guillemets}
+
+\begin{description}
+
+\item [og=«, fg=»]%
+ \footnote{Les valeurs affectées à \fbo{og} et \fbo{fg} sont les vrais
+ guillemets \fbo{«} et \fbo{»}, pas \fbo{<{}<} et \fbo{>{}>}.
+ Les espaces avant et après ces guillemets dans la commande
+ \fbsetup{} sont optionnels.} ;
+ \hlabel{og-fg} lorsqu’on dispose de guillemets français au
+ clavier (grâce à une touche \textit{compose} par exemple), cette option permet
+ d’utiliser directement ces guillemets à la place des commandes |\og| et |\fg|%
+ \footnote{Toutefois, si des guillemets doivent être utilisés dans une
+ commande \cs{index}, ils \emph{doivent} être codés en \cs{og} et
+ \cs{fg}.}.
+ On peut ainsi saisir \code{«guillemets»} ou \code{« guillemets »} (avec ou
+ sans espaces à l’intérieur) pour obtenir «guillemets» avec espaces
+ insécables adéquates en français. En revanche, si on active cette option,
+ \emph{il ne faut pas coder explicitement les espaces insécables} :
+ \code{«}|~|\code{guillemets}|~|\code{»}
+ produirait «~guillemets~» où l’espace qui suit le guillemet ouvrant est
+ trop large.
+
+ Les espaces insécables ne sont ajoutées que lorsque la langue
+ courante est le français : en allemand, le codage \code{(»Auf Deutsch«)}
+ produit \foreignlanguage{german}{(»Auf Deutsch«)}. %»
+
+ Ceci fonctionne en (pdf)LaTeX pour les codages d’entrée 8-bits (latin1,
+ latin9, ansinew, applemac,\dots) et pour les codages sur plusieurs octets
+ comme utf8 ou utf8x. Ceci fonctionne également avec LuaLaTeX et XeLaTeX ;
+ avec ces deux derniers toutefois, comme pour la ponctuation haute,
+ \ext{babel-french} respecte les espaces insécables U+00A0 et U+202F (fine).
+
+\item [INGuillSpace=true (false)] ; force \ext{babel-french} à mettre une
+ espace-mot justifiante insécable après les guillemets ouvrants et avant les
+ guillemets fermants comme le préconise l’Imprimerie nationale. Par défaut
+ les espaces insérées par \ext{babel-french} sont légèrement plus étroites et
+ moins extensibles qu’une espace-mot.\hlabel{INGuillspace}
+
+ Cette option est équivalente à |\FBsetspaces{guill}{1}{1}{1}|, voir
+ p.~\pageref{FBsetspaces}.
+
+\item [EveryParGuill=open, close, none (open)] ;
+ selon sa valeur, cette option
+ ajoute un guillemet ouvrant
+ \bgroup\NoAutoSpacing
+ («\FBguillspace), fermant (»\FBguillspace)%
+ \egroup{}
+ ou rien au début de chaque paragraphe inclus dans une citation de premier
+ rang codée avec |\frquote{}|.\hlabel{everyparguill}
+
+ Lorsque \fbo{InnerGuillSingle=true}, cette option est également prise en
+ compte pour les citations de second rang (internes) : selon sa valeur, un
+ guillemet simple ouvrant
+ \bgroup\NoAutoSpacing
+ (\guilsinglleft\FBguillspace), ou fermant (\guilsinglright\FBguillspace)%
+ \egroup,
+ ou rien, est ajouté à chaque début de paragraphe.
+
+ Lorsque \fbo{InnerGuillSingle=false}, rien n’est ajouté en début de
+ paragraphe dans les citations de second rang.
+
+\item [EveryLineGuill=open, close, none (none)] ;
+ selon sa valeur, cette option
+ ajoute un guillemet ouvrant, fermant, ou rien, au début de chaque ligne
+ d’une citation de second rang. Notez que les citations de premier et de
+ secong rang doivent être toutes deux codées avec |\frquote{}| et que l’ajout
+ automatique de guillemets au début de ligne \emph{ne fonctionne qu’avec
+ LuaTeX}.
+ Lorsque \fbo{EveryLineGuill=open} ou \fbo{close} la citation interne
+ est toujours balisée par des guillemets français « et », l’option suivante
+ est sans effet.
+
+\item [InnerGuillSingle=true (false)] ; si \fbo{InnerGuillSingle=true}
+ les citations internes sont balisées comme
+ \guilsinglleft\FBguillspace ceci\FBguillspace\guilsinglright,
+ sinon comme ``cela’’.
+
+\end{description}
+
+\subsubsection*{Présentation des nombres}
+
+\begin{description}
+
+ {\sloppy
+\item [ThinSpaceInFrenchNumbers=true (false)] remplace le
+ séparateur des milliers utilisé en français par la commande
+ |\numprint{}| (ou son alias |\nombre{}|) pour le formatage
+ des nombres, par une espace fine (par défaut c’est une espace mot
+ insécable et sans élasticité en français).
+ Cette option n’a d’effet que si l’extension \ext{numprint} est chargée
+ avec l’option \opt{autolanguage} ;
+ sans elle, \ext{numprint} formate les nombres indépendamment de la langue
+ courante et le séparateur des milliers est par défaut l’espace fine.
+\par}
+
+\end{description}
+
+\subsubsection*{Légendes de figures et tables}
+
+\begin{description}
+
+\item [SmallCapsFigTabcaptions=false (true*)]; si cette option est mise
+ à \fbo{false}, le recours aux petites capitales dans les intitulés des
+ légendes de figures et tables est supprimé, on obtient « Figure » et
+ « Table » au lieu de « \textsc{Figure} » et « \textsc{Table} ».%
+ \hlabel{scfigtab}
+
+\item [CustomiseFigTabcaptions=false (true*)] ; si cette option est mise
+ à \fbo{false}, le séparateur défini par |\CaptionSeparator| est remplacé par
+ le séparateur par défaut (deux-points) dans les légendes des figures et des
+ tables, ceci pour toutes les langues. En français, \ext{babel-french} ajoute
+ si possible une espace insécable adéquate devant le deux-points ou affiche
+ un message dans le fichier \file{.log}.
+
+\item [OldFigTabcaptions=true (false)] peut être utilisée pour retrouver
+ la présentation antérieure (pré~3.0) des légendes de figures et tables,
+ c.-à-d. |\CaptionSeparator| en français et deux-points pour les autres
+ langues. Cette option ne fonctionne que pour les classes standard
+ \cls{article}, \cls{report}, \cls{book}.
+
+\end{description}
+
+\subsubsection*{Divers : lettres supérieures et « warnings »}
+
+\begin{description}
+
+\item [FrenchSuperscripts=false (true)] ne devrait être utilisée que pour
+ recompiler des anciens fichiers à l’identique. Elle redéfinit |\up| comme
+ |\textsuperscript| alors que par défaut |\up| fait appel à la
+ commande |\fup| plus conforme aux usages francophones (voir
+ section~\ref{sec:description}, p.~\pageref{sec:description}.
+
+\item [LowercaseSuperscripts=false (true)] rend possible d’avoir des lettres
+ supérieures en capitales (est-ce bien utile ?). Par défaut, la nouvelle
+ commande |\up| (sauf si elle est redéfinie en |\textsuperscript| par l’option
+ précédente) empêche le passage en capitales des lettres supérieures dans les
+ hauts de pages par exemple.
+
+\item [SuppressWarning=true (false)] peut être utilisée pour supprimer les
+ avertissements non essentiels émis par \ext{babel-french}.
+
+\end{description}
+\egroup
+
+\subsubsection*{Ordre des options}
+
+Il faut se souvenir que les options sont prises en compte dans l’ordre où
+elles sont écrites dans la commande \fbsetup{}.
+
+Exemple : un utilisateur souhaitant que \ext{babel-french} ne touche pas à la
+présentation des listes ni à celle des notes de bas de page
+mais ajoute un renfoncement au début des 1\iers{} paragraphes de section
+peut faire \fbsetup{StandardLayout,IndentFirst}.
+S’il choisissait l’ordre inverse
+l’option \fbo{IndentFirst} serait annulée par \fbo{StandardLayout}.
+
+Cet utilisateur obtiendrait également le résultat souhaité en codant\\
+\fbsetup{StandardLists,FrenchFootnotes=false,AutoSpaceFootnotes=false}\\
+là, l’ordre est indifférent car les options sont indépendantes.
+
+\subsection[Traduction des intitulés]
+ {Traduction des intitulés (« caption names » en anglais)}
+\label{ssec:captions}
+
+Voici la liste des traductions proposées par \ext{babel-french} :
+
+{\setcounter{LTchunksize}{30} % Pour réduire le nombre de compilations.
+\setlength{\LTleft}{0pt} % Avec \extracolsep{\fill}, assure que le
+\setlength{\LTright}{0pt} % tableau prend toute la largeur de page.
+\setlength{\LTpost}{\smallskipamount}
+\newcommand*\name[1]{%
+ \texttt{\ColorVerb\textbackslash#1name}%
+ &\texttt{\ColorVerb\textbackslash french#1name}}
+
+\begin{longtable}{|l!{\extracolsep{\fill}}l!{\extracolsep{\fill}}l|}
+\hline
+Commande Babel & Commande pour le français & Intitulé par défaut en français\\*
+\hline
+\name{abstract} & Résumé\\*
+\name{bib} & Bibliographie\\
+\name{ref} & Références\\
+\name{preface} & Préface\\
+\name{chapter} & Chapitre\\
+\name{appendix} & Annexe\\
+\name{contents} & Table des matières\\
+\name{listfigure} & Table des figures\\
+\name{listtable} & Liste des tableaux\\
+\name{index} & Index\\
+\name{glossary} & Glossaire\\
+\name{figure} & {\scshape Figure}\\
+\name{table} & {\scshape Table}\\
+\name{part} & Première partie, Deuxième partie…\\
+\name{encl} & P.~J.\\
+\name{cc} & Copie à \\
+\name{headto} & $\langle$\textit{vide}$\rangle$\\
+\name{page} & page\\
+\name{see} & voir\\
+\name{also} & voir aussi\\*
+\name{proof} & Démonstration\\*
+\hline
+\end{longtable}
+}
+
+Il est facile de modifier ces traductions : pour remplacer « Démonstration »
+par « Preuve » (avec \ext{amsthm}) ajouter dans le préambule
+|\def\frenchproofname{Preuve}|%
+\footnote{Les puristes peuvent remplacer \cs{def} par \cs{renewcommand*}
+ s’ils le souhaitent.},
+noter que l’ancienne syntaxe |\addto\captionsfrench{\def\proofname{Preuve}}|
+fonctionne toujours.\hlabel{captionsfrench}
+
+{\sloppy
+\emph{Attention}, dans les deux cas, le nom de la langue est
+\emph{obligatoirement} \opt{french}, les variantes \opt{frenchb} ou
+\opt{francais} seraient sans effet ! Les commandes
+|\acadianabstractname|, \dots, |\acadianproofname| sont, elles, définies
+(comme leurs homologues françaises) et personnalisables pour le français du
+Canada (option \lang{acadian}).
+\par}
+
+La modification des noms de parties est plus complexe : si on préfère
+« Partie~I », « Partie~II » à « Première partie », « Deuxième partie »,
+il suffit de redéfinir |\frenchpartname| comme ceci
+|\def\frenchpartname{Partie}|\samefntmk{} ;
+utiliser l’option \fbo{FullPartName=false} dans \fbsetup{} aboutit au même
+résultat.
+Si en revanche on veut que |\part{}| produise par exemple « Première phase »,
+« Deuxième phase », il faut redéfinir |\frenchpartnameord| et non
+|\frenchpartname| : |\def\frenchpartnameord{phase}|\samefntmk.
+Le remplacement de « Deuxième » par « Seconde » est possible en codant
+|\def\frenchpartsecond{Seconde}|\samefntmk{} dans le préambule.
+De même il est possible de remplacer « Première » par « Premier » en codant
+|\def\frenchpartfirst{Premier}|\samefntmk.
+
+On remarquera que |\figurename| et |\tablename| sont en petites capitales en
+français. Il serait préférable, notamment dans un document multilingue, de
+s’en tenir à la traduction pure
+(|\def\frenchfigurename{Figure}|\samefntmk,
+|\def\frenchtablename{Table}|\samefntmk)
+et de choisir les attributs de la police
+(|\scshape| par exemple) au niveau de la classe ou d’une extension comme
+\ext{captions}. L’option \fbo{SmallCapsFigTabCaptions} (p.~\pageref{scfigtab})
+peut être mise à \fbo{false} pour supprimer le passage en petites capitales.
+
+\subsection{Présentation des listes}
+\label{ssec:lists}
+
+Voici la présentation par défaut%
+\footnote{L’option \fbo{ListItemsAsPar} permet une autre présentation, voir
+ ci-dessous p.~\pageref{ListAsPar}.}
+pour les listes \env{itemize} (tiret cadratin et alignement des tirets de
+premier niveau sur le retrait (|\parindent|) de début de paragraphe) :\par
+{\centering
+ \fbox{\begin{minipage}[t]{.40\textwidth}\raggedright
+ \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{itemize}
+ \item Premier élément sur plus d’une ligne\dots{}
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{itemize}
+ \item Second élément\dots
+ \end{itemize}
+ \end{minipage}}\par
+}
+
+Ceux qui préfèrent le tiret demi-cadratin (\textendash) comme marqueur peuvent
+ajouter l’option \fbsetup{ItemLabels=\boi{}textendash}, d’autres options
+existent voir section~\ref{ssec:frenchbsetup}.
+
+\ext{babel-french} applique aux listes \env{enumerate} et \env{description}
+les mêmes retraits horizontaux qu’aux listes \env{itemize}, tous sont donc
+basés sur la largeur du marqueur choisi, |\textemdash| par défaut,
+|\textendash|, ou autre.
+
+{\sloppy
+Trois paramètres dimensionnels permettent d’ajuster la présentation des
+listes \env{itemize}, \env{enumerate} et \env{description} :
+\begin{description}
+\item [\cs{listindentFB}] dont la valeur par défaut est
+ |\parindent| si |\parindent| est non nul et |1.5em| (valeur standard de
+ |\parindent|) sinon ; |\listindentFB| permet modifier la marge gauche du
+ premier niveau de liste (ce qui déplace aussi les listes incluses).
+
+ Exemple : en ajoutant |\setlength{\listindentFB}{0pt}| dans le préambule,
+ les étiquettes de toutes les listes de premier niveau colleront à la marge
+ gauche au lieu d’être décalées vers la droite.
+
+% Illustration de \parindent et \listindentFB
+\vspace{.5\baselineskip}
+\begin{minipage}[t]{.45\textwidth}
+\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright
+ \FBListItemsAsParfalse \parindent=0pt \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{itemize}
+ \item Premier élément sur plus d’une ligne\dots{}
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{itemize}
+ \item Second élément\dots
+ \end{itemize}
+ \end{minipage}
+}\\
+\hspace*{\fill}|\parindent=0pt|\hspace*{\fill}%
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.5\textwidth}
+\hspace*{\fill}
+\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72
+ \FBListItemsAsParfalse \parindent=0em \listindentFB=0em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{itemize}
+ \item Premier élément sur plus d’une ligne\dots{}
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{itemize}
+ \item Second élément\dots
+ \end{itemize}
+ \end{minipage}
+}\hspace*{\fill}\\
+\hspace*{\fill}|\parindent=0pt| \emph{et} |\listindentFB=0pt|\hspace*{\fill}%
+\end{minipage}
+
+\vspace{\baselineskip}
+\item [\cs{labelwidthFB}] dont la valeur par défaut est la largeur de
+ |\FrenchLabelItem| (c.-à.d. |\textemdash| sauf changement décidé par
+ l’utilisateur) ; il est possible de fixer la valeur de |\labelwidthFB|
+ niveau par niveau, voir le second exemple ci-dessous.
+
+% Illustration de \labelwidthFB
+\bgroup
+\renewcommand*{\thempfootnote}{\arabic{mpfootnote}}
+\parindentFFN=4pt\relax
+\begin{minipage}[t]{.45\textwidth}
+\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright
+ \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{enumerate}
+ \item Premier élément sur plus d’une ligne\dots{}
+ \begin{enumerate}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{enumerate}
+ \item Second élément\dots
+ \end{enumerate}
+ \end{minipage}
+}\\
+\hspace*{\fill}Présentation par défaut%
+\footnote{Remarquer l’alignement vertical avec l’exemple ci-dessus.}
+\hspace*{\fill}
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.5\textwidth} % .45
+\stepcounter{mpfootnote}
+\hspace*{\fill}
+\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright
+ \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{enumerate}
+ \item Premier élément sur plus d’une ligne\dots{}
+ \settowidth{\labelwidthFB}{(a)}%
+ \begin{enumerate}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{enumerate}
+ \item Second élément\dots
+ \end{enumerate}
+ \end{minipage}
+}\hspace*{\fill}\\
+\hspace*{\fill}|\settowidth{\labelwidthFB}{(a)}|%
+\footnote{Commande à placer juste avant le second environnement
+ \env{enumerate}.}%
+\hspace*{\fill}
+\end{minipage}
+\egroup
+
+\vspace{\baselineskip}
+\item [\cs{descindentFB}] dont la valeur par défaut est |\listindentFB| permet
+ de traiter les listes de type \env{description} différemment des autres :
+ pour que les étiquettes des seules listes \env{description} collent à la
+ marge gauche, il suffit d’ajouter dans le préambule
+ |\setlength{\descindentFB}{0pt}|.
+
+% Illustration de \parindent et \descindentFB
+\vspace{.5\baselineskip}
+\begin{minipage}[t]{.45\textwidth}
+\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright
+ \FBListItemsAsParfalse
+ \parindent=0pt \listindentFB=1.5em \descindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{description}
+ \item [Premier] élément occupant plus d’une ligne\dots{}
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{itemize}
+ \item [Second] élément\dots
+ \end{description}
+ \end{minipage}
+}\\
+\hspace*{\fill}|\parindent=0pt|\hspace*{\fill}%
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.5\textwidth}
+\hspace*{\fill}
+\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72
+ \FBListItemsAsParfalse
+ \parindent=0pt \listindentFB=1.5em \descindentFB=0pt
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste
+ \begin{description}
+ \item [Premier] élément occupant plus d’une ligne\dots{}
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2,
+ \end{itemize}
+ \item [Second] élément\dots
+ \end{description}
+ \end{minipage}
+}\hspace*{\fill}\\
+\hspace*{\fill}|\parindent=0pt| \emph{et} |\descindentFB=0pt|\hspace*{\fill}%
+\end{minipage}
+\end{description}
+\par}
+
+\vspace{\baselineskip}
+L’option \fbo{ListItemsAsPar} propose une présentation plus conforme aux
+usages typographiques français, voir par exemple ce qui est fait dans le
+« Lexique des règles typographiques en usage à l’Imprimerie nationale ».
+\hlabel{ListAsPar}
+Les éléments des listes sont alors présentés comme des paragraphes, les
+marqueurs (tirets, etc.) étant placées en retrait de la marge gauche ;
+dans la présentation par défaut les étiquettes sont placées en saillie dans la
+marge gauche et celle-ci est augmentée comme le montre l’exemple ci-dessous.
+
+Noter que toute cette documentation a été compilée avec l’option
+\fbo{ListItemsAsPar} dont l’effet est bien visible dans les
+sections~\ref{sec:description} (listes \env{itemize}) et
+\ref{sec:Perso} (listes \env{description}).
+
+% Illustration de l’option \fbo{ListItemsAsPar}
+\vspace{.5\baselineskip}
+\begin{minipage}[t]{.45\textwidth}
+\fbox{\begin{minipage}[t]{0.9\textwidth}\raggedright
+ \FBListItemsAsParfalse \parindent=1.5em \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste et qui s’étend sur deux lignes.
+ \begin{itemize}
+ \item Premier élément qui se prolonge sur plusieurs…
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2 sur plus d’une ligne…
+ \end{itemize}
+ \item Second élément\dots
+ \end{itemize}
+ \end{minipage}
+}\\
+\hspace*{\fill}Présentation par défaut\hspace*{\fill}%
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.5\textwidth}
+\hspace*{\fill}
+\fbox{\begin{minipage}[t]{.9\textwidth}\raggedright % .72
+ \FBListItemsAsPartrue \parindent=1.5em \listindentFB=1.5em
+ \noindent$\Leftarrow$ Marge gauche\par
+ Paragraphe précédant la liste et qui s’étend sur deux lignes.
+ \begin{itemize}
+ \item Premier élément qui se prolonge sur plusieurs lignes…
+ \begin{itemize}
+ \item Un élément niveau 2,
+ \item Second élément niveau 2 sur plus d’une ligne…
+ \end{itemize}
+ \item Second élément\dots
+ \end{itemize}
+ \end{minipage}
+}\hspace*{\fill}\\
+\hspace*{\fill}\fbo{ListItemsAsPar=true}\hspace*{\fill}%
+\end{minipage}
+
+\vspace{\baselineskip}
+Enfin, pour ceux qui voudraient bénéficier des facilités offertes par
+l’extension \ext{enumitem} et conserver une présentation des listes
+similaire à celle obtenue par défaut avec \ext{babel-french}, je propose
+les quelques lignes de code suivantes à copier-coller dans le
+préambule :\hlabel{enumitem-cfg}
+
+{%\small
+|\usepackage{enumitem}|\\
+|\newlength\mylabelwidth|\\
+|\newcommand*{\mylabel}{\textemdash} % ou \textendash (tiret plus court)|\\
+|\settowidth{\mylabelwidth}{\mylabel}|\\
+|\setlist[itemize]{label=\mylabel, nosep}|\\ % nosep ou noitemsep
+|\setlist[1]{labelindent=\parindent}|\\
+|\setlist{labelwidth=\mylabelwidth, leftmargin=!|\\
+| itemsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % enumitem ne redéfinit pas
+| parsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % \list, on peut s’en passer
+| topsep=0.8ex plus 0.4ex minus 0.4ex,|\\ % sauf option StandardLists,
+| partopsep=0.4ex plus 0.2ex minus 0.2ex}| % évidemment !
+}
+
+Pour une présentation correspondant à l’option \fbo{ListItemsAsPar=true} on
+aurait :
+
+{%\small
+|\usepackage{enumitem}|\\
+|\newlength\mylabelwidth|\\
+|\newlength\myitemindent|\\
+|\newcommand*{\mylabel}{\textemdash} % ou \textendash (tiret plus court)|\\
+|\settowidth{\mylabelwidth}{\mylabel}|\\
+|\setlength{\myitemindent}{\parindent}|\\
+|\addtolength{\myitemindent}{\mylabelwidth}|\\
+|\addtolength{\myitemindent}{\labelsep}|\\
+|\setlist[itemize]{label=\mylabel, nosep}|\\
+|\setlist[1]{leftmargin=0pt}|\\
+|\setlist{leftmargin=\parindent, itemindent=\myitemindent,|\\
+| itemsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % enumitem ne redéfinit pas
+| parsep=0.4ex plus 0.2ex minus 0.2ex,|\\ % \list, on peut s’en passer
+| topsep=0.8ex plus 0.4ex minus 0.4ex,|\\ % sauf option StandardLists,
+| partopsep=0.4ex plus 0.2ex minus 0.2ex}| % évidemment !
+}
+
+%\newpage
+\section{Changements entre les versions 3.4 et 2.6}
+\label{sec:changes-3.0}
+
+\subsection{Changements entre les versions \latestversion{} et 3.4d}
+\label{ssec:changes-3.5}
+
+La version 3.5a propose une nouvelle option \fbo{ListItemsAsPar} qui permet
+une présentation des listes plus conforme à la tradition typographique
+française, voir p.~\pageref{ListAsPar}. La présentation par défaut des listes
+est inchangée.
+
+Quelques bogues affectant la commande |\frquote{}| ont été corrigées dans les
+versions 3.5b à 3.5d. Cette dernière introduit une nouvelle option
+\fbo{StandardListSpacing} à utiliser à la place de \fbo{ReduceListSpacing},
+voir p.~\pageref{ListAsPar}. La présente documentation est maintenant
+incluse dans la distribution \ext{babel-french} sur CTAN.
+
+La commande |\NoEveryParQuote| a été ajoutée en version~3.5e, voir
+p.~\pageref{frquote}.
+
+\subsection{Changements entre les versions 3.4d et 3.3d}
+\label{ssec:changes-3.4}
+
+La version 3.4a introduit une nouvelle commande |\frenchdate| (voir
+p.~\pageref{frenchdate}) et corrige une bogue mineure : |\FBthousandsep| n’est
+plus une espace justifiante insécable mais une espace rigide (de même valeur).
+Le retour à l’ancien comportement est obtenu par l’ajout dans le préambule de
+|\renewcommand*{\FBthousandsep}{~}|.
+
+Les deux options \lang{french} et \lang{acadian} peuvent maintenant être
+utilisées simultanément dans un même document ; elles ne présentent par défaut
+aucune différence mais rien n’empêche de les personnaliser différemment
+en ce qui concerne les motifs de césures, les légendes ou la ponctuation.
+
+Une commande |\FBsetspaces| a été ajoutée pour faciliter le réglage des
+espaces précédant la ponctuation haute et les guillemets avec la possibilité
+de réglages différents selon l’option \lang{french} ou \lang{acadian}, voir
+p.~\pageref{FBsetspaces}.
+
+À partir de La version 3.4, eTeX et LuaTeX 1.0 sont requis.
+
+\subsection{Changements entre les versions 3.3d et 3.2h}
+\label{ssec:changes-3.3}
+
+Le contrôle de l’ajout d’espace devant le deux-points a été amélioré dans la
+version 3.3d mais uniquement avec le moteur LuaTeX : il n’y a plus d’ajout
+d’espace parasite dans les URL (http://monsite), les chemins MSDOS
+(C:\boi Mes Documents) ou les horaires (10:55).
+
+Lors de la conversion en HTML par \exe{lwarp} (versions 0.37 et suivantes)
+des fichiers compilés sous XeLaTeX ou pdfLaTeX, les espaces insécables ajoutées
+par \ext{babel-french} pour la ponctuation haute et les guillemets sont
+respectées.
+Une nouvelle option (expérimentale) \fbo{UnicodeNoBreakSpaces} pour LuaLaTeX
+a été ajoutée dans la version~3.3c, voir~\pageref{ucs-nbsp}.
+
+{\sloppy
+La version 3.3b a subi un réaménagement interne : chaque langue ou dialecte de
+Babel devrait avoir son propre fichier \file{.ldf}. Ainsi pour le français il
+y a dorénavant \file{french.ldf} qui contient le code principal et quatre
+fichiers satellites \file{frenchb.ldf}, \file{francais.ldf}, \file{acadian.ldf}
+et \file{canadien.ldf}. L’option à utiliser pour charger le français avec
+Babel est toujours \opt{french} (ou \opt{acadian} pour le français du Canada
+pour l’instant identique au français de base), les autres options (\opt{frenchb},
+\opt{francais} ou \opt{canadien}) sont déconseillées et affichent un message
+d’avertissement dans le fichier \file{.log}.\par
+}
+
+La version 3.3a disponible dans TeXLive 2017 est compatible avec LuaTeX 1.0.4
+(stable) mais aussi avec la version 0.95 (beta) de TL2016.
+L’espacement de la ponctuation haute et des guillemets français est maintenant
+contrôlé par les \emph{commandes} |\FBcolonspace|, |\FBthinspace| et
+|\FBguillspace| quel que soit le moteur utilisé (LuaTeX, XeTeX ou pdfTeX) ;
+auparavant LuaTeX avait recours à des \emph{glue} |\FBcolonskip|,
+|\FBthinskip| et |\FBguillskip|.
+
+L’option \opt{french} devant être préférée à \opt{frenchb}, il m’a semblé
+judicieux de renommer la commande de personnalisation |\frenchbsetup{}| en
+|\frenchsetup{}|, l’ancien nom étant conservé par souci de compatibilité.
+
+De nouvelles possibilités de personnalisation de la commande |\part{}| ont été
+introduites, voir page~\pageref{ssec:captions}.
+
+\subsection{Changements entre les versions 3.2h et 3.1m}
+\label{ssec:changes-3.2}
+
+La version 3.2g modifie le comportement par défaut de la commande |\frquote{}|
+sous LuaTeX qui est maintenant le même que sous XeTeX ou pdfTeX.
+Il suffit d’ajouter l’option \fbo{EveryLineGuill=open} pour retrouver le
+comportement des versions précédentes.
+
+Depuis la version 3.2f, \ext{babel-french} est compatible avec l’extension
+\ext{icomma} qui offre une solution alternative à la commande
+|\DecimalMathComma|.
+
+La construction des notes de bas de page a été revue pour les classes
+\cls{beamer}, \cls{memoir} et koma-script (\cls{scrartcl}, \cls{scrreprt}
+et \cls{scrbook}). Le rendu final est conservé mais les possibilités de
+personnalisation offertes par ces classes pour la présentation des notes de
+bas de page (changement de police, de couleur, etc.) sont désormais
+disponibles même lorsque l’option \fbo{FrenchFootnotes} est activée.
+
+Un vieux bug affectant le comportement de |\frquote{}| lorsque l’extension
+\ext{xspace} est chargée, a été corrigé.
+
+Les commandes |\NoAutoSpacing|, |\ttfamilyFB|, |\rmfamilyFB| et |\sffamilyFB|
+ont été complètement réécrites dans la version~3.2c afin de leur assurer un
+comportement identique quel que soit le moteur utilisé, pdfTeX, XeTeX ou
+LuaTeX.
+
+\textbf{{babel-french} v.3.2b et suivantes, mise en garde pour les
+ utilisateurs de Lua(La)TeX :}
+\nopagebreak
+La version~3.2b est la première compatible avec la version~0.95 de LuaTeX
+incluse dans TeXLive~2016. Les changements intervenus dans la structure des
+nœuds de type \textit{glue} rendent cette nouvelle version de LuaTeX
+incompatible avec les précédentes. Le code lua contenu dans les versions 3.2b
+et suivantes de \file{frenchb.lua} ne fonctionne pas avec les versions de
+LuaTeX antérieures à 0.95, aussi à partir de la version~3.2b \ext{babel-french}
+revient aux caractères actifs pour la gestion de la ponctuation haute avec les
+moteurs LuaTeX antérieurs à 0.95 !
+La bonne solution consiste à installer rapidement TeXLive~2016 ou une autre
+distribution contenant LuaTeX~0.95.
+En revanche il n’y a aucun problème de compatibilité ascendante avec les
+moteurs XeTeX et pdfTeX.
+
+\subsection{Changements entre les versions 3.1m et 3.0c}
+\label{ssec:changes-3.1}
+
+{\sloppy
+ Ajout de la commande |\frquote{}| et de sa variante |\frquote*{}|
+ recommandées pour saisir les citations, notamment les citations imbriquées
+ ou celles s’étendant sur plusieurs paragraphes, voir p.~\pageref{frquote}
+ et les nouvelles options \fbo{EveryParGuill}, \fbo{EveryLineGuill} et
+ \fbo{InnerGuillSingle}.
+\par}
+
+Nouvelle option \fbo{SmallCapsFigTabCaptions}, voir p.~\pageref{scfigtab}.
+
+\subsection{Changements entre les versions 3.0c et 2.6h}
+\label{ssec:changes-3.0}
+
+Plusieurs modifications de fond ont motivé le passage à la version~3.0.
+
+\begin{itemize}
+
+\item \ext{babel-french} ne fonctionne désormais qu’avec la version~3.9
+ de Babel ce qui donne accès à une syntaxe plus agréable pour modifier les
+ \textit{captions}, voir p.~\pageref{captionsfrench}.
+ Le séparateur utilisé dans les légendes de figures et de tableaux est
+ choisi de manière globale pour toutes les langues, voir
+ p.~\pageref{captionseparator}.
+
+\item La gestion des options par \fbsetup{} a été complètement remaniée ; deux
+ nouvelles options ont été ajoutées.
+
+\item La variante « canadien » du français fonctionne désormais comme un vrai
+ \textit{dialect} au sens de Babel ; parallèlement le français ne devrait
+ plus être désigné que sous le nom \opt{french}, à la fois en option de
+ |\usepackage[...]{babel}|%
+ \footnote{Le mieux est encore de mettre toutes les déclarations de langues
+ en option de \cs{documentclass}.}
+ et en argument de |\selectlanguage{}| et consorts.
+ Les variantes \opt{frenchb} et \opt{francais} sont encore tolérées mais
+ sans aucune garantie de pérennité.
+
+\item \ext{babel-french} ne charge plus le fichier \file{frenchb.cfg} ; la
+ personnalisation passe par l’utilisation exclusive de \fbsetup{}.
+
+\item Les étiquettes des listes \env{description} sont positionnées comme
+ celles des listes \env{itemize} et \env{enumerate} avec un retrait
+ paramétrable |\listindentFB| par rapport à la marge gauche.
+
+\item Enfin et c’est probablement le plus important, le recours aux
+ caractères actifs est supprimé pour la gestion de la ponctuation haute
+ lorsqu’un format basé sur LuaTeX%
+ \footnote{C’est déjà le cas pour XeTeX depuis la version~2.5 de
+ \ext{babel-french}.}
+ est utilisé (LuaLaTeX par exemple).
+ Le mécanisme des caractères actifs est remplacé par un appel aux
+ \textit{callbacks} |pre_linebreak_filter| et |hpack_filter|%
+ \footnote{Depuis la version 3.1g c’est le\textit{callbacks} \texttt{kerning}
+ qui est mis en œuvre à la place.}.
+
+ La base du code |lua| se trouve dans l’exposé de Paul Isambert
+ à la journée GUT’2010. Un grand merci à Paul pour cette source d’inspiration
+ et pour ses suggestions lors de la relecture finale de \file{frenchb.lua}.
+
+\end{itemize}
+
+À partir de la version 3.0c, \ext{babel-french} laisse le contrôle total des
+listes à la classe \cls{beamer} (option \fbo{StandardLists} automatiquement
+activée) ; nouvelle option \fbo{INGuillSpace} (voir p.~\pageref{INGuillspace}).
+
+\subsection{Comment recompiler un document écrit pour
+ {babel-french}~2.x ?}
+\label{ssec:compat-2.6}
+
+Penser d’abord à remplacer \opt{frenchb} et \opt{francais} par \opt{french}
+dans les options de Babel et dans |\selectlanguage{...}|,
+|\begin{otherlanguage}{...}|, |\foreignlanguage{...}|.
+Une exception toutefois : les classes SMF (\cls{smfart} et \cls{smfbook}) ne
+fonctionnent qu’avec l’option \opt{frenchb}… vieux reliquat d’un passé
+lointain où l’option \opt{french} de babel était ambiguë (ambiguïté levée depuis
+2004).
+
+Ajouter l’option \fbo{OldFigTabCaptions} à \fbsetup{} si on tient à avoir
+deux séparateurs différents pour les légendes de figures et de tableaux,
+|\CaptionSeparator| en français et deux-points pour les autres langues.
+
+Ajouter |\listindentFB=0pt| juste avant les environnements \env{description}
+si on souhaite que les étiquettes de ces environnements collent à la marge
+gauche au premier niveau.
+
+\section{Problèmes de césures}
+\label{sec:cesures}
+
+Pour vérifier que votre format LaTeX fonctionne correctement au niveau des
+césures, au moins en français et en anglais, téléchargez le fichier de test
+\expandafter\expandafter\expandafter\url{\urlperso/frenchb/frenchb-cesures.tex}
+et suivez les instructions figurant en début de fichier.
+
+Si les résultats du test ne sont pas corrects, vérifiez tout au début du
+fichier \file{.log} dans la ligne commençant par le mot « Babel », si
+« french » figure bien dans la liste des langues disponibles.
+
+Si ce n’est pas le cas, installez le paquet appelé « collection-langfrench »
+(TeXLive, MacTeX) ou « texlive-lang-french » (distributions Linux) ou
+similaire. Si vous travaillez avec « tlmgr », les formats sont refaits
+automatiquement, sinon il faut les faire à la main (la procédure dépend de
+votre installation).
+
+Recompilez le fichier \file{frenchb-cesures.tex}, les résultats devraient
+être corrects, contactez-moi par courriel si ce n’était pas le cas.
+
+\section{Problèmes avec les quatre caractères actifs
+ (\string; \string: \string! \string?)}
+\label{sec:active-char}
+
+Rappelons d’abord que ces quatre caractères \emph{ne sont pas rendus actifs}
+avec les moteurs LuaTeX ou XeTeX, donc aucun problème n’est à craindre
+avec ces moteurs%
+\footnote{N’est-ce pas une bonne raison d’abandonner pdf(La)TeX ?},
+cette section ne concerne \emph{que les vieux moteurs} TeX’82 et pdfTeX.
+
+Normalement, le nécessaire est fait par Babel pour que les caractères rendus
+actifs ne perturbent pas les autres extensions\dots{} mais il y a hélas des
+exceptions (\ext{tikz}, \ext{xypic}, \ext{xcolor}, \ext{autonum}, \ext{arabtex},
+\ext{cleveref} par exemple). Il faut savoir que les caractères
+rendus actifs par une langue \emph{le restent dans tout le document}, repasser
+en anglais par exemple ne désactive pas les \string; \string: \string!
+\string? s’ils ont été rendus actifs par \ext{babel-french} !
+
+Les espaces insécables ajoutés entre les guillemets peuvent également être
+gênants.
+
+Depuis la version~2.5, la commande à utiliser en cas de problème est
+|\NoAutoSpacing|%
+\footnote{Elle fonctionne avec tous les formats pdf(La)TeX, Lua(La)TeX
+ et Xe(La)TeX mais ne règle pas tous les problèmes de caractères actifs,
+ notamment dans les \texttt{\boi{}label} et autres \texttt{\boi{}caption},
+ voir la section~\ref{sec:Incomp} à ce sujet.
+.}
+\emph{dans un groupe} comme ceci :
+
+|{\NoAutoSpacing|\\
+ \textit{Partie ne supportant pas les caractères actifs}\\
+|}|
+
+ou à l’intérieur d’un environnement, par exemple
+
+|\begin{tikzpicture}\NoAutoSpacing|\\
+| ... |\\
+|\end{tikzpicture}|
+
+Avec \ext{tikz} v3.0, une solution alternative consiste à ajouter
+|\usetikzlibrary{babel}| dans le préambule, voir la documentation de TikZ
+(\file{pgfmanual.pdf}). L’avantage de cette solution est de tenter de préserver
+les caractères actifs dans les nœuds même si ça ne fonctionne pas toujours,
+notamment pour le point d’exclamation.
+
+Avec pdf(La)TeX, il est également possible de désactiver un seul ou plusieurs
+caractères actifs de manière sélective grâce à la commande |\shorthandoff| de
+Babel. Le mieux est de le faire \emph{localement} dans un environnement ou
+dans un groupe comme ceci :
+
+|{\shorthandoff{:!}%|\\
+ \textit{Partie ne supportant pas les caractères actifs `:’ et `!’}\\
+|}|
+
+\section{Incompatibilités connues et remèdes}
+\label{sec:Incomp}
+
+La liste suivante ne prétend pas être exhaustive, n’hésitez pas à me signaler
+les incompatibilités que vous rencontrez afin qu’elles puissent figurer dans
+cette liste.
+
+\begin{itemize}
+
+\item Les caractères rendus actifs par \ext{babel-french}%
+ \footnote{Ceci ne concerne ni Xe(La)TeX ni Lua(La)TeX qui gèrent autrement
+ la ponctuation haute.}
+ (\string; \string: \string! \string?) peuvent perturber certaines
+ extensions, c’est le cas de \ext{tikz}, \ext{xypic}, \ext{xcolor},
+ \ext{arabtex}, \ext{cleveref} par exemple, voir comment y remédier
+ section~\ref{sec:active-char}.
+
+ En règle générale, il vaudrait mieux éviter les caractères actifs dans les
+ |\label| et |\caption|, remplacer systématiquement les « \string: » par des
+ tirets « - » dans les |\label| est une saine précaution. Pour éviter les
+ problèmes de caractères actifs avec \ext{natbib} ou \ext{listings}, il
+ convient de charger \ext{natbib} \emph{avant} \ext{babel} et \ext{listings}
+ \emph{après} \ext{babel}.\hlabel{ch-doc3}
+ Un message est affiché dans le fichier \file{.log} lorsque l’ordre de
+ chargement n’est pas correct.
+
+ \ext{hyperref} ne fonctionne pas avec la commande |\cite| standard lorsque
+ celle-ci contient un caractère actif, charger l’extension \ext{cite} règle
+ le problème.
+
+\item En LaTeX, les caractères \string; \string: \string! \string? ne sont
+ rendus actifs
+ qu’au |\begin{document}|, ainsi les espaces attendues ne sont pas
+ ajoutées automatiquement lorsque ces caractères sont utilisés dans des
+ commandes définies dans le préambule ou dans des fichiers~\file{.sty}.\\
+ Exemple : la commande |\title{Quelle crise?}| placée dans le
+ préambule imprimera « Quelle crise\string? » (sans espace)%
+ \footnote{Mais l’espace sera préservée si on compile en LuaLaTeX ou
+ en XeLaTeX puisque le mécanisme est différent.}
+ lors de l’appel de |\maketitle|. Il y a plusieurs parades :
+ \begin{itemize}
+ \item soit placer la commande |\title{Quelle crise?}| après le
+ |\begin{document}| (et avant |\maketitle|),
+ \item soit placer les commandes du type |\title| entre un
+ |\shorthandon{;:!?}| (avant) et un |\shorthandoff{;:!?}|
+ (après), si on tient à les laisser dans le préambule.
+ \end{itemize}
+
+\item Les extensions \ext{caption}, \ext{subcaption}, \ext{floatrow}
+ doivent impérativement être chargées \emph{après} \ext{babel}.
+ En revanche \ext{beameraticle} doit être chargée \emph{avant} \ext{babel}.
+
+ À chaque fois que le bon ordre de chargement
+ n’est pas respecté, un avertissement le signale dans le fichier \file{.log}.
+
+\item \ext{babel-french} modifie la présentation des listes ce qui peut
+ perturber les classes ou extensions qui veulent également le faire.
+ \ext{babel-french} s’efface automatiquement lorsqu’une des extensions
+ \ext{enumitem}, \ext{enumerate} ou \ext{paralist} est chargée. Pour les
+ autres, ou si on veut soi-même agir sur la présentation des listes, il
+ convient de débrayer l’action de \ext{babel-french} en utilisant la commande
+ \fbsetup{} avec les options adéquates (cf. section~\ref{ssec:frenchbsetup})
+ dans le préambule du document (après le chargement de Babel).
+
+{\sloppy
+\item Certaines classes (\cls{amsbook}, \cls{smfbook},
+ \cls{beamer}, etc.) redéfinissent |\part|, ce qui peut conduire à
+ des titres du genre « Première partie~I ». La parade consiste à ajouter
+ l’option \fbo{PartNameFull=false} dans \fbsetup{}.
+\par}
+
+\item L’option \opt{multiple} de l’extension \ext{footmisc} insère normalement
+ une virgule entre les appels de notes multiples. Pour que ce mécanisme
+ fonctionne avec \ext{babel-french} il faut ajouter l’option
+ \fbsetup{AutoSpaceFootnotes=false}, sinon \ext{babel-french} remplace la
+ virgule par une espace fine.
+
+\item Dans une commande |\index{}|, les guillemets français doivent
+ obligatoirement être codés sous la forme |\og|, |\fg| :
+ \hlabel{ch-doc4}
+ |\index{\og toto\fg}| donne le résultat attendu, tandis que
+ |\index{«toto»}| provoque soit une erreur à la compilation (en LaTeX),
+ soit un mauvais classement de l’entrée |«toto»| dans l’index (en
+ XeLaTeX et LuaLaTeX).
+\end{itemize}
+
+\section{Bibliographie}
+\label{sec:biblio}
+
+Ce qui suit ne concerne \emph{pas} les bibliographies faites « à la main »
+dans l’environnement \env{thebibliography}, mais celles créées à partir d’un
+ou plusieurs fichiers~\file{.bib} avec \BibTeX{} ou mieux avec
+\biblatex/\biber{}.
+
+\vspace{-.5\baselineskip}
+\subsection{Bibliographie avec \texorpdfstring{\BibTeX}{BibTeX}}
+\label{ssec:bibtex}
+
+\BibTeX{} est obsolète, je conseille \emph{vraiment} de passer
+à \biblatex/\biber{} (voir section suivante).
+Néanmoins, voici quelques indications concernant la francisation des
+bibliographies créées avec \BibTeX{} :
+
+Certains champs (les dates notamment) et certains mots-clés figurant dans les
+fichiers~\file{.bib} (les «\emph{and}» des listes d’auteurs par exemple)
+devraient pouvoir être affichés différemment selon le contexte (les
+«\emph{and}» du fichier~\file{.bib} devraient pouvoir être transcrits en
+«\emph{et}» dans le fichier~\file{.bbl} pour les références en français).
+Babel n’opère pas au niveau \BibTeX, il faut donc agir
+directement au niveau des bases de données~\file{.bib} et des fichiers de
+style~\file{.bst}.
+
+\begin{description}
+
+\item [Fichiers~\file{.bib}] : s’assurer que chaque référence des bases de
+ données \file{.bib} utilisées comporte un champ « \code{language =
+ \{...\}} » définissant la langue d’origine de la référence.
+
+\item [Fichiers~\file{.bst}] : pour remplacer les styles standard
+ \bibsty{alpha}, \bibsty{plain}, \bibsty{unsrt}, faire appel à l’extension
+ \bibsty{babelbib} et aux styles \bibsty{babalpha}, \bibsty{babplain},
+ \bibsty{babunsrt} (voir la documentation \file{babelbib.pdf} et le fichier
+ d’exemples \file{babelbibtest.tex}). Selon les options, il est possible
+ d’afficher chaque référence dans sa langue ou bien de les afficher toutes
+ dans la langue principale du document%
+ \footnote{Les styles francisés \file{*-fr.bst} qu’on trouve sur CTAN dans
+ \url{tex-archive/biblio/bibtex/contrib/bib-fr} n’offrent que
+ la seconde possibilité (références toutes en français).}.
+
+ Ceux qui font appel à un style de bibliographie sur mesure créé à partir de
+ \file{custom-bib} devront choisir l’option \opt{babel} lors de la
+ création du fichier \file{.bst} et ensuite adapter le fichier
+ \file{babelbst.tex} aux langues utilisées.
+
+\end{description}
+
+\subsection{Bibliographie avec \biblatex/\biber}
+\label{ssec:biblatex}
+
+La solution \biblatex/\biber{} présente des nombreux avantages par rapport
+à \BibTeX{} :
+\begin{itemize}
+
+\item \biblatex{} prend en compte les options de Babel, les «\emph{and}» des
+ listes d’auteurs sont transcrits automatiquement en «\emph{et}» dans un
+ document en français ;
+
+\item \biblatex{}, associé à \biber{}, permet le traitement des fichiers
+ ~\file{.bib} codés en UTF-8 ce qui facilite grandement la coexistence
+ de références à des ouvrages en français, en russe et en grec par exemple ;
+
+\item \biblatex{} possède des options qui remplacent de nombreuses extensions
+ spécifiques telles que \ext{bibtopic}, \ext{bibunits}, \ext{chapterbib},
+ \ext{cite}, \ext{multibib}, \ext{natbib}, etc.
+
+\end{itemize}
+
+Pour la mise en œuvre pratique de \biblatex/\biber{}, consulter le manuel
+\textit{\LaTeX, l’essentiel} de \bsc{D.~Bitouzé} et \bsc{J.-C.~Charpentier} ou
+la documentation en anglais \file{biblatex.pdf}.
+
+\section[Compatibilité avec e-french]
+ {Compatibilité avec \ext{e-french}}
+\label{sec:CompatFP}
+
+Il est souhaitable qu’un texte saisi avec
+\ext{e-french} de Bernard~\bsc{Gaulle} puisse être compilé avec un
+minimum de modifications sur une machine utilisant \ext{babel-french}
+et réciproquement.
+
+En ce qui concerne les guillemets français, \ext{e-french} rend actifs les
+caractères |<| et |>| afin de saisir les guillemets sous la forme |<||<| et
+|>||>| tandis que \ext{babel-french} s’y refuse et utilise en interne des
+macros |\og| et |\fg|.
+
+Lorsqu’on travaille en codage~\texttt{T1} avec \ext{babel-french}, l’existence
+des ligatures~|<||<| et~|>||>| permet de saisir
+|<||<~|\code{guillemets français}|~>||>|,
+mais les espaces insécables sont \emph{indispensables}.
+Les commandes |\og| et |\fg| (ou leurs alias \fbo{«} et \fbo{»}, à condition
+que ceux-ci aient été activés dans \fbsetup{}) sont préférables : elles
+introduisent automatiquement des espaces insécables et plus fines pour un
+meilleur rendu typographique.
+
+Les points de suspensions sont saisis |...| avec
+\ext{e-french} et |\dots| avec \ext{babel-french}.
+
+Les commandes suivantes peuvent être ajoutées au préambule pour
+émuler certaines commandes de \ext{e-french} :
+\begin{verbatim}
+\let\numero=\no
+\let\Numero=\No
+\let\fsc=\bsc
+\let\lsc=\bsc
+\newcommand*{\french}{\leavevmode\selectlanguage{french}}
+\newcommand*{\english}{\leavevmode\selectlanguage{english}}
+\newcommand*{\AllTeX}{%
+ (L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)%
+ T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}
+\end{verbatim}
+
+Pour ceux qui éditent leurs sources LaTeX avec emacs, une fonction Lisp
+\file{french2b} opère une adaptation \emph{partielle} d’un fichier conçu pour
+\ext{e-french} facilitant sa compilation avec \ext{babel-french}. L’appel
+à \ext{e-french} est remplacé en un appel à \ext{babel-french}, les guillemets
+|<<| et |>>| sont convertis en |\og| et |\fg| et les |...| en |\dots|, enfin
+quelques commandes spécifiques à \ext{e-french} sont ajoutées dans le
+préambule.
+
+Cette fonction est disponible sur
+\expandafter\expandafter\expandafter\url{\urlperso/frenchb/french2b.el}.
+Il suffit de l’ajouter à un fichier \file{.emacs} et de l’exécuter par
+|Esc x french2b| sur le fichier à convertir.
+
+\nopagebreak
+\vspace{2\baselineskip}
+\nopagebreak
+\hspace*{\fill}%
+\begin{minipage}[b]{.5\linewidth}
+ \raggedleft
+ \href{mailto:daniel.flipo@free.fr}{Daniel \textsc{Flipo}}\\
+ \expandafter\expandafter\expandafter\url{\urlperso}
+\end{minipage}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-engine: luatex
+%%% TeX-master: t
+%%% coding: utf-8
+%%% TeX-source-correlate-mode: t
+%%% mode: flyspell
+%%% ispell-local-dictionary: "francais"
+%%% End:
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.dtx b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
new file mode 100644
index 0000000000..d916f838ac
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
@@ -0,0 +1,5899 @@
+%\CheckSum{3769}
+%
+%\iffalse
+% Tell the LaTeX system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{frenchb.dtx}
+%</dtx>
+%<acadian>\ProvidesLanguage{acadian}
+%<canadien>\ProvidesLanguage{canadien}
+%<francais>\ProvidesLanguage{francais}
+%<french>\ProvidesLanguage{french}
+%<frenchb>\ProvidesLanguage{frenchb}
+%<lua>--[[
+%<lua> File `frenchb.lua’ generated from frenchb.dtx
+ [2019/03/30 v3.5e French support from the babel system]
+%<*internal>
+\iffalse
+%</internal>
+%<*lua>
+ Copyright © 2014-2019 Daniel Flipo
+ <daniel (dot) flipo (at) free (dot) fr>
+ License LPPL: see french.ldf.
+--]]
+%</lua>
+%<*internal>
+\fi
+%</internal>
+%<*dtx>
+%% File `frenchb.dtx’
+%</dtx>
+%<*dtx|french>
+%%
+%% Babel package for LaTeX version 2e
+%% Copyright © 1996-2019
+%% by Daniel Flipo <daniel (dot) flipo (at) free (dot) fr>
+%%
+%</dtx|french>
+%<*dtx>
+%% This file is part of the babel system, it provides the source
+%% code for the French language definition file.
+%%
+%</dtx>
+%<*filedriver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage[left=42mm,right=42mm,top=40mm,bottom=40mm]{geometry}
+\usepackage[utf8]{inputenc}
+\usepackage{bera,textcomp}
+\renewcommand{\rmdefault}{fvs}
+\usepackage{array}
+\usepackage[dvipsnames]{xcolor}
+\def\PrintMacroName#1{%
+ \strut\MacroFont\color{Sepia}\normalsize\string#1}
+\usepackage[expansion=true,protrusion=true]{microtype}
+\def\ColorArg{\color{PineGreen}}
+\usepackage{url}
+\usepackage[numbered]{hypdoc}
+\hypersetup{colorlinks,urlcolor=blue,unicode}
+\newcommand*{\hlabel}[1]{\phantomsection\label{#1}}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\frenchb{\textsf{babel-french}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+\newcommand*\opt[1]{\texttt{#1}}
+\newcommand*\env[1]{\texttt{#1}}
+\newcommand*\exe[1]{\texttt{#1}}
+\newcommand*\fbo[1]{\texttt{\ColorArg #1}}
+\newcommand*\fbsetup[1]{\cs{frenchsetup\{\fbo{#1}\}}}
+\renewcommand\meta[1]{\textit{<#1>}} % no math mode (see doc.sty)
+\let\Module\meta % no math mode (see doc.sty)
+\renewcommand*\descriptionlabel[1]{%
+ \hspace\labelsep \normalfont \fbo{#1}}
+\let\up\textsuperscript
+\newcommand*{\FRguillspace}{\penalty 10000
+ \hskip.8\fontdimen2\font
+ plus.3\fontdimen3\font
+ minus.8\fontdimen4\font}
+\hyphenation{Lua-TeX Lua-LaTeX Xe-LaTeX}
+\lefthyphenmin=2 \righthyphenmin=3
+\RecordChanges
+\AtEndDocument{%
+ \clearpage
+ \section{Change History}%
+ \GlossaryPrologue{}%
+ Changes are listed in reverse order (latest first) and limited to
+ \frenchb{}~v3.
+ \PrintChanges
+}
+\begin{document}
+\setlength{\parindent}{0pt}
+\GetFileInfo{frenchb.dtx}
+\begin{center}
+ \textbf{\Large A Babel language definition file for French}\\[2mm]^^A\]
+ \textbf{\large frenchb.dtx \fileversion, \filedate}\\[3mm]^^A\]
+ Daniel Flipo\\
+ \texttt{daniel.flipo@free.fr}
+\end{center}
+\vspace{2\baselineskip}
+\thispagestyle{empty}
+\tableofcontents
+\clearpage
+\DocInput{frenchb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \section{The French language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.}, defines all the language definition macros for the
+% French language.
+%
+% Customisation for the French language is achieved following the
+% book ``Lexique des règles typographiques en usage à
+% l’Imprimerie Nationale’’ troisième édition (1994),
+% ISBN-2-11-081075-0.
+%
+% First version released: 1.1 (May 1996) as part of
+% \babel-3.6beta. Version~2.0a was released in February 2007 and
+% version~3.0a in February 2014.
+%
+% \frenchb{} has been improved using helpful suggestions from many
+% people, mainly from Jacques André, Michel Bovani, Thierry Bouche,
+% Vincent Jalby, Denis Bitouzé and Ulrike Fisher.
+% Thanks to all of them!
+%
+% LaTeX-2.09 is no longer supported.
+% This new version (3.x) has been designed to be used only with
+% LaTeX2e and Plain formats based on TeX, pdfTeX, LuaTeX or XeTeX
+% engines.
+%
+% Changes between version 3.0 and \fileversion{} are listed in
+% subsection~\ref{ssec-changes} p.~\pageref{ssec-changes}.
+%
+% An extensive documentation in French (file \file{frenchb-doc.pdf}) is
+% now included in \frenchb.
+%
+% \subsection{Basic interface}
+%
+% In a multilingual document, some typographic rules are language
+% dependent, i.e.\ spaces before `high punctuation’ (|:| |;| |!|
+% |?|) in French, others modify the general layout (i.e.\ layout of
+% lists, footnotes, indentation of first paragraphs of sections) and
+% should apply to the whole document.
+%
+% The French language can be loaded with \babel{} by a command like:
+% \\ |\usepackage[german,spanish,french,british]{babel}|%
+% \footnote{\emph{Always} use \opt{french} as option name for the
+% French language, former aliases \opt{frenchb} or \opt{francais}
+% are \emph{depreciated}; expect them to be removed sooner or later!}
+%
+% \frenchb{} takes account of \babel’s \emph{main language} defined
+% as the \emph{last} option at \babel’s loading. When French is
+% not \babel’s main language, \frenchb{} does not alter the general
+% layout of the document (even in parts where French is the current
+% language): the layout of lists, footnotes, indentation of first
+% paragraphs of sections are not customised by \frenchb.
+%
+% When French is loaded as the last option of \babel, \frenchb{}
+% makes the following changes to the global layout, \emph{both in
+% French and in all other languages}\footnote{%
+% For each item, hooks are provided to reset standard
+% LaTeX settings or to emulate the behavior of former versions
+% of \frenchb{} (see command \fbsetup{},
+% section~\ref{ssec-custom} p.~\pageref{ssec-custom}).}:
+% \begin{enumerate}
+% \item the first paragraph of each section is indented
+% (LaTeX only);
+% \item the default items in itemize environment are set to `---’
+% instead of `\textbullet’, and all vertical spacing and glue
+% is deleted; it is possible to change `---’ to something else
+% (`--’ for instance) using \fbsetup{} (see
+% section~\ref{ssec-custom} p.~\pageref{ssec-custom});
+% \item vertical spacing in general LaTeX lists is
+% shortened;
+% \item footnotes are displayed ``à la française’’.
+% \item the separator following the table or figure number in
+% captions is printed as `~--~’ instead of `:~’;
+% for changing this see~\ref{sssec-captions-fig}
+% p.~\pageref{sssec-captions-fig}.
+% \end{enumerate}
+%
+% Regarding local typography, the command |\selectlanguage{french}|
+% switches to the French language\footnote{%
+% \cs{selectlanguage\{francais\}} and
+% \cs{selectlanguage\{frenchb\}} are no longer supported.},
+% with the following effects:
+% \begin{enumerate}
+% \item French hyphenation patterns are made active;
+% \item `high punctuation’ characters (|:| |;| |!| |?|)
+% automatically add correct spacing%
+% \footnote{Well, the automatic insertion may add unwanted
+% spaces in some cases, for correction see
+% \fbo{AutoSpacePunctuation} option and \cs{NoAutoSpacing}
+% command p.~\pageref{autospacepunctuation}.}
+% in French; this is achieved using callbacks in Lua(La)TeX
+% or `XeTeXinterchar’ mechanism in Xe(La)TeX; with TeX’82 and
+% pdf(La)TeX these four characters are made active in the
+% whole document;
+% \item |\today| prints the date in French;
+% \item the caption names are translated into French
+% (LaTeX only). For customisation of caption names see
+% section~\ref{sssec-captions-name}
+% p.~\pageref{sssec-captions-name}.
+% \item the space after |\dots| is removed in French.
+% \end{enumerate}
+%
+% Some commands are provided by \frenchb{} to make typesetting
+% easier:
+% \begin{enumerate}
+% \item French quotation marks can be entered using the commands
+% |\og| and |\fg| which work in LaTeX2e and PlainTeX,
+% their appearance depending on what is available to draw
+% them; even if you use LaTeX2e \emph{and} |T1|-encoding,
+% you should refrain from entering them as
+% |<<~French quotation~>>|: |\og| and |\fg| provide
+% better horizontal spacing (controlled by |\FBguillspace|).
+% If French quote characters are available on your keyboard,
+% you can use them, to get proper spacing in LaTeX2e see
+% option \fbo{og=«, fg=»} p.~\pageref{option-og-fg}.
+%
+% |\og| and |\fg| can be used outside French, they typeset
+% then English quotes `` and ’’.
+%
+% A new command |\frquote{}| has been added in version~3.1 to
+% enter French quotations. |\frquote{|\textit{texte}|}| is
+% equivalent to |\og| \textit{texte} |\fg{}| for short
+% quotations.\hlabel{frquote}
+% For quotations spreading over more than one paragraph,
+% |\frquote| will add at the beginning of every paragraph of
+% the quotation either an opening French guillemet («), or
+% a closing one (») or nothing depending on option
+% \fbo{EveryParGuill=open} or \fbo{=close} or \fbo{=none},
+% see p.~\pageref{everyparguill}.
+% Command |\NoEveryParQuote| is provided to locally suppress
+% unwanted guillemets (typically when lists are embedded in
+% |\frquote{}|), it is meant to be used inside an environment
+% or a group.
+%
+% |\frquote| is recommended to enter embedded quotations ``à la
+% française’’, several variants are provided through options.
+% \begin{itemize}
+% \item with all engines: the inner quotation
+% is surrounded by double quotes (``\textit{texte}’’)
+% unless option \fbo{InnerGuillSingle=true}, then
+% a) the inner quotation is printed as
+% \guilsinglleft\FRguillspace\textit{texte}\FRguillspace
+% \guilsinglright{} and b) if the inner quotation
+% spreads over more than one paragraph, every paragraph
+% included in the inner quotation starts with
+% a \guilsinglleft{} or a \guilsinglright{} or nothing,
+% depending on option \fbo{EveryParGuill=open} (default)
+% or \fbo{=close} or \fbo{=none}.
+% \item with LuaTeX based engines, it is possible to add a
+% French opening or closing guillemet (« or ») at the
+% beginning of every line of the inner quotation using
+% option \fbo{EveryLineGuill=open} or \fbo{=close}; note
+% that with any of these options, the inner quotation is
+% surrounded by French guillemets (« and ») regardless
+% option \fbo{InnerGuillSingle};
+% the default is \fbo{EveryLineGuill=none} so that
+% |\frquote{}| behaves as with non-LuaTeX engines.
+% \end{itemize}
+% A starred variant |\frquote*| is meant for inner quotations
+% which end together with the outer one: using |\frquote*| for
+% the inner quotation will print only one closing quote
+% character (the outer one) as recommended by the French
+% `Imprimerie Nationale’.
+%
+% \item |\frenchdate|\marg{year}\marg{month}\marg{day} helps
+% typesetting dates in French: |\frenchdate{2001}{01}{01}|
+% will print 1\up{er} janvier 2001 in a box without any
+% linebreak.\label{frenchdate}
+%
+% \item A command |\up| is provided to typeset superscripts like
+% |M\up{me}| (abbreviation for ``Madame’’), |1\up{er}| (for
+% ``premier’’). Other commands are also provided for
+% ordinals: |\ier|, |\iere|, |\iers|, |\ieres|, |\ieme|,
+% |\iemes| (|3\iemes| prints 3\up{es}).
+% All these commands take advantage of real superscript
+% letters when they are available in the current font.
+%
+% \item Family names should be typeset in small capitals and never
+% be hyphenated, the macro |\bsc| (boxed small caps) does
+% this, e.g., |L.~\bsc{Lamport}| will print the same as
+% |L.~\mbox{\textsc{Lamport}}|. Note that composed names
+% (such as Dupont-Durant) may now be hyphenated on explicit
+% hyphens, this differs from \frenchb~v.~1.x.
+%
+% \item Commands |\primo|, |\secundo|, |\tertio| and |\quarto|
+% print 1\up{o}, 2\up{o}, 3\up{o}, 4\up{o}.
+% |\FrenchEnumerate{6}| prints 6\up{o}.
+% \item Abbreviations for ``Numéro(s)’’ and ``numéro(s)’’
+% (N\up{o} N\up{os} n\up{o} and n\up{os}~) are obtained
+% via the commands |\No|, |\Nos|, |\no|, |\nos|.
+%
+% \item Two commands are provided to typeset the symbol for
+% ``degré’’: |\degre| prints the raw character and
+% |\degres| should be used to typeset temperatures (e.g.,
+% ``|20~\degres C|’’ with a non-breaking space), or for
+% alcohols’’ strengths (e.g., ``|45\degres|’’ with \emph{no}
+% space in French).
+%
+% \item In math mode the comma has to be surrounded with
+% braces to avoid a spurious space being inserted after it,
+% in decimal numbers for instance (see the \TeX{}book p.~134).
+% The command |\DecimalMathComma| makes the comma behave as an
+% ordinary character \emph{when the current language is French}
+% (no space added);
+% as a counterpart, if |\DecimalMathComma| is active, an
+% explicit space has to be added in lists and intervals:
+% |$[0,\ 1]$|, |$(x,\ y)$|. |\StandardMathComma| switches
+% back to the standard behaviour of the comma in French.
+%
+% The \pkg{icomma} package is an alternative workaround.
+%
+% \item A command |\nombre| was provided in 1.x versions to easily
+% format numbers in slices of three digits separated either
+% by a comma in English or with a space in French; |\nombre|
+% is now mapped to |\numprint| from \file{numprint.sty}, see
+% \file{numprint.pdf} for more information.
+%
+% \item \frenchb{} has been designed to take advantage of the
+% \pkg{xspace} package if present: adding
+% |\usepackage{xspace}| in the preamble will force macros
+% like |\fg|, |\ier|, |\ieme|, |\dots|, \dots, to respect
+% the spaces you type after them, for instance typing
+% `|1\ier juin|’ will print `1\up{er} juin’
+% (no need for a forced space after |1\ier|).
+% \end{enumerate}
+%
+% \subsection{Customisation}
+% \label{ssec-custom}
+%
+% Customisation of \frenchb{} relies on command \fbsetup{}
+% (formerly called |\frenchbsetup{}|, the latter name will be kept
+% for ever to ensure backwards compatibility), options are entered
+% using the \file{keyval} syntax.
+% The command \fbsetup{} is to appear in the preamble only
+% (after loading \babel).
+%
+% \subsubsection[\textbackslash frenchsetup{}]
+% {\fbsetup{options}}
+% \label{sssec-frenchbsetup}
+%
+% \vspace{.5\baselineskip}
+% |\frenchsetup{}| and |\frenchbsetup{}| are synonymous;
+% the latter should be preferred as the language name for
+% French in \babel{} is no longer |frenchb| but |french|.
+%
+% \fbsetup{ShowOptions} prints all available options to
+% the \file{.log} file, it is just meant as a remainder of the
+% list of offered options. As usual with \file{keyval} syntax,
+% boolean options (as \fbo{ShowOptions}) can be entered as
+% \fbo{ShowOptions=true} or just \fbo{ShowOptions}, the
+% \fbo{=true} part can be omitted.
+%
+% \vspace{.5\baselineskip}
+% The other options are listed below. Their default value is
+% shown between braces, sometimes followed be a `\texttt{*}’.
+% The `\texttt{*}’ means that the default shown applies when
+% \frenchb{} is loaded as the \emph{last} option of \babel{}
+% ---\babel’s \emph{main language}---, and is toggled otherwise.
+% \begin{description}
+% \item [StandardLayout=true (false*)] forces \frenchb{} not to
+% interfere with the layout: no action on any kind of lists,
+% first paragraphs of sections are not indented (as in English),
+% no action on footnotes; it useless unless French is the main
+% language. This option can be used to avoid conflicts with
+% classes or packages which customise lists or footnotes.
+% \item [GlobalLayoutFrench=false (true*)] can only be used when
+% French is the main language; setting it to \fbo{false} will
+% emulate what prior versions of \frenchb{} (pre-2.2) did:
+% lists, and first paragraphs of sections will be displayed
+% the standard way in other languages than French, and ``à la
+% française’’ in French (changing the layout inside a document
+% is a bad practice imho). Note that the layout of footnotes is
+% language independent anyway (see below \fbo{FrenchFootnotes}
+% and \fbo{AutoSpaceFootnotes}).
+% \item [IndentFirst=false (true*)]; set this option to \fbo{false}
+% if you do not want \frenchb{} to force indentation of the
+% first paragraph of sections. When French is the main language,
+% this option applies to all languages.
+% \item [PartNameFull=false (true)]; when true, \frenchb{} numbers
+% the title of |\part{}| commands as ``Première partie’’,
+% ``Deuxième partie’’ and so on. With some classes which
+% change the |\part{}| command (AMS classes do so), you could
+% get ``Première partie~1’’, ``Deuxième partie~2’’ in the toc;
+% when this occurs, this option should be set to
+% \fbo{false}, part titles will then be printed as ``Partie I’’,
+% ``Partie II’’.
+%
+% \item [ListItemsAsPar=true (false)] setting this option to
+% \fbo{true} is recommended: list items will be displayed as
+% paragraphs with indented labels (in the ``Imprimerie Nationale’’
+% way) instead of having labels hanging into the left margin.
+% How these two layouts differ is shown below:\\[.5\baselineskip]
+% \fbox{\parbox[t]{.4\textwidth}{\raggedright
+% \parindent=1.5em
+% \def\FBlabel{\textemdash}%
+% \settowidth{\labelwidth}{\FBlabel}%
+% Text starting at `parindent’ \\
+% \noindent<= Leftmargin\par
+% \textemdash{} first item running on two
+% \hspace*{\parindent}\hspace*{\labelwidth}
+% lines or more\dots{}\par
+% \hspace*{\labelwidth} \textemdash{} first second level
+% \hspace*{\parindent}\hspace*{\labelwidth}%
+% \hspace*{\labelwidth} item on two lines\dots{}\par
+% \hspace*{\labelwidth} \textemdash{} next one\dots{}\par
+% \textemdash{} second item\dots
+% }}
+% \hfill \hlabel{ListAsPar}%
+% \fbox{\parbox[t]{.4\textwidth}{\raggedright
+% \parindent=1.5em
+% \def\FBlabel{\textemdash}%
+% \settowidth{\labelwidth}{\FBlabel}%
+% Text starting at `parindent’ \\
+% \noindent<= Leftmargin\par
+% \textemdash{} first item running on two
+% lines or more\dots{}\par
+% \hspace*{\labelwidth} \textemdash{} first second level
+% \hspace*{\parindent} item on two lines\dots{}\par
+% \hspace*{\labelwidth} \textemdash{} next one\dots{}\par
+% \textemdash{} second item\dots
+% }}\par
+% Default French layout%
+% \hspace{\fill}With \fbo{ListItemsAsPar=true}%
+% \item [StandardListSpacing=true (false*)]%
+% \footnote{This option should be used instead of former option
+% \fbo{ReduceListSpacing} (kept for backward compatibility) which
+% could be misleading: with some classes (smfart, smfbook f.i.)
+% you had to set \fbo{ReduceListSpacing=false} to revert to the
+% class settings which actually reduce list’s spacings even more
+% than \frenchb! \fbo{StandardListSpacing=true} replaces
+% \fbo{ReduceListSpacing=false}.}; \frenchb{} customises
+% the vertical spaces in the \env{list} environment, this affects
+% all lists, including \env{itemize} \env{enumerate},
+% \env{description}, but also \env{abstract}, \env{quote},
+% \env{quotation}, \env{verse}, etc. which are based on \env{list}.
+% Setting this option to \fbo{true} reverts to the standard
+% settings of the \env{list} environment as defined by the document
+% class.
+% \item [StandardItemizeEnv=true (false*)]; \frenchb{} redefines
+% the \env{itemize} environment to suppress any vertical space
+% between items of \env{itemize} lists in French and customises
+% left margins. Setting this option to \fbo{true} reverts to
+% the standard definition of \env{itemize}.
+% \item [StandardEnumerateEnv=true (false*)]; starting with
+% version~2.6 \frenchb{} redefines the \env{enumerate} and
+% \env{description} environments to make left margins match those
+% of the French version of \env{itemize} lists. Setting this
+% option to \fbo{true} reverts to the standard definition of
+% \env{enumerate} and \env{description}.
+% \item [StandardItemLabels=true (false*)] when set to \fbo{true}
+% this option prevents \frenchb{} from changing the labels in
+% \env{itemize} lists in French.
+% \item [ItemLabels=\cs{textbullet}, \cs{textendash},
+% \cs{ding\{43\}},...(\cs{textemdash}*)];\\
+% when \fbo{StandardItemLabels=false} (the default), this option
+% enables to choose the label used in French \env{itemize} lists
+% for all levels. The next four options do the same but each
+% one for a specific level only. Note that the example
+% |\ding{43}| requires |\usepackage{pifont}|.
+% \item [ItemLabeli=\cs{textbullet}, \cs{textendash},
+% \cs{ding\{43\}},...(\cs{textemdash}*)]
+% \item [ItemLabelii=\cs{textbullet}, \cs{textendash},
+% \cs{ding\{43\}},...(\cs{textemdash}*)]
+% \item [ItemLabeliii=\cs{textbullet}, \cs{textendash},
+% \cs{ding\{43\}},..(\cs{textemdash}*)]
+% \item [ItemLabeliv=\cs{textbullet}, \cs{textendash},
+% \cs{ding\{43\}},...(\cs{textemdash}*)]
+% \item [StandardLists=true (false*)] forbids \frenchb{} to
+% customise any kind of list. Try the option \fbo{StandardLists}
+% in case of conflicts with classes or packages that customise
+% lists too. This option is just a shorthand setting all four
+% options \fbo{StandardListSpacing=true},
+% \fbo{StandardItemizeEnv=true}, \fbo{StandardEnumerateEnv=true}
+% and \fbo{StandardItemLabels=true}.
+% \item [ListOldLayout=true (false)]; starting with version~2.6a,
+% the layout of lists has changed regarding leftmargins’ sizes
+% and default itemize label (`---’ instead of `--’ up to~2.5k).
+% This option, provided for backward compatibility, displays
+% lists as they were up to version~2.5k.
+%
+% \item [FrenchFootnotes=false (true*)] reverts to the standard
+% layout of footnotes. By default \frenchb{} typesets leading
+% numbers as `1.\hspace{.5em}’ instead of `\up{1}’, but
+% has no effect on footnotes numbered with symbols (as in the
+% |\thanks| command). Two commands |\StandardFootnotes|
+% and |\FrenchFootnotes| are available to change the layout of
+% footnotes locally; |\StandardFootnotes| can help when some
+% footnotes are numbered with letters (inside minipages for
+% instance).
+% \item [AutoSpaceFootnotes=false (true*)]; by default \frenchb{}
+% adds a thin space in the running text before the number or
+% symbol calling the footnote. Making this option \fbo{false}
+% reverts to the standard setting (no space added).
+%
+% \item [AutoSpacePunctuation=false (true)]; in French, the user
+% \hlabel{autospacepunctuation}
+% \emph{should} input a space before the four characters `|:;!?|’
+% but as many people forget about it (even among native French
+% writers!), the default behaviour of \frenchb{} is to
+% automatically typeset non-breaking spaces the width of which is
+% either |\FBthinspace| (defauts to a thin space) before `|;|’
+% `|!|’ `|?|’ or |\FBcolonspace| (defauts to |\space|) before
+% `|:|’; the defaults follow the French `Imprimerie Nationale’s
+% recommendations. This is convenient in most cases but can lead
+% to addition of spurious spaces in URLs, in MS-DOS paths or in
+% timetables (10:55) ---this no longer occurs with LuaTeX---,
+% except if they are typed in |\texttt| or verbatim mode.
+% When the current font is a monospaced (typewriter) font,
+% no spurious space is added in that case%
+% \footnote{Unless option \fbo{OriginalTypewriter} is set,
+% \cs{ttfamily} is redefined in French to switch off space
+% tuning, see below.},
+% so the default behaviour of of \frenchb{} in that area should
+% be fine in most circumstances.
+%
+% Choosing \fbo{AutoSpacePunctuation=false} will ensure that
+% a proper space is added before `|:;!?|’ \emph{if and only if}
+% a (normal) space has been typed in. This option gives full
+% control on space insertion before `|:;!?|’. Those who are
+% unsure about their typing in this area should stick to the
+% default option and use the provided |\NoAutoSpacing| command
+% inside a group in case an unwanted space is added by \frenchb{}
+% (i.e.\ |{\NoAutoSpacing http://mysite}|%
+% \footnote{Actually, this is needed only with the XeTeX and
+% pdfTeX engines. LuaTeX no longer inserts any space in strings
+% like http://mysite, C:\textbackslash Foo, 10:55…}
+% or |{\NoAutoSpacing ???}| (needed for pdfTeX only).
+% \item [ThinColonSpace=true (false)] changes the inter-word
+% non-breaking space added before the colon `:’ to a thin space,
+% so that the same amount of space is added before any of the
+% four `high punctuation’ characters. The default setting is
+% supported by the French `Imprimerie Nationale’.
+% \item [OriginalTypewriter=true (false)] prevents any
+% customisation of |\ttfamily| and |\texttt{}| in French.
+% This option should only be used to ensure backward compatibility.
+% The current default behaviour is to switch off any addition of
+% space before high punctuation with typewriter fonts
+% (\textit{e.g.} verbatim).
+% \item [UnicodeNoBreakSpaces=true (false)];\hlabel{ucs-nbsp}
+% (experimental) this option should be set to \fbo{true}
+% \emph{only while converting LuaLaTeX files} to HTML.
+% It ensures that non-breaking spaces added by \frenchb{} are
+% inserted in the PDF file as U+A0 or U+202F (thin) instead of
+% penalties and glues.
+% Note that \exe{lwarp} (v.~0.37 and up) is fully compatible with
+% \frenchb{} for translating PDFLaTeX or XeLaTeX files to HTML.
+%
+% \item [og=«, fg=»]; when guillemets characters are available on
+% the keyboard (through a compose key for instance), it is nice
+% to use them instead of typing |\og| and |\fg|. This option
+% tells \frenchb{} which characters are opening and closing
+% French guillemets (they depend on the input encoding), then
+% you can type either \hlabel{option-og-fg}
+% \texttt{« guillemets »} or \texttt{«guillemets»} (with or
+% without spaces) to get properly typeset French quotes.
+% This option works with LuaLaTeX and XeLaTeX; with pdfLaTeX it
+% requires \file{inputenc} to be loaded with a proper encoding:
+% 8-bits encoding (latin1, latin9, ansinew, applemac,\dots) or
+% multi-byte encoding (utf8, utf8x).
+% \item [INGuillSpace=true (false)] resets the dimensions of spaces
+% after opening French quotes and before closing French quotes to
+% the French `Imprimerie Nationale’ standards (inter-word space).
+% \frenchb’s default setting produces slightly narrower spaces
+% with less stretchability.
+% \item [EveryParGuill=open, close, none (open)]; sets whether
+% an opening quote (\texttt{«}) or a closing one (\texttt{»}) or
+% nothing should be printed by |\frquote{}| at the beginning of
+% every parapraph included in a level 1 (outer) quotation.
+% This option is also considered for level 2 (inner) quotations
+% to decide between \texttt{\guilsinglleft} and
+% \texttt{\guilsinglright} when \fbo{InnerGuillSingle=true}
+% (see below). \hlabel{everyparguill}
+% \item [EveryLineGuill=open, close, none (none)]; with LuaTeX
+% based engines \emph{only}, it is possible to set this option
+% to \fbo{open} [resp. \fbo{close}]; this ensures that a `«’
+% [resp. `»’] followed by a proper space will be inserted at the
+% beginning of every line of embedded (inner) quotations
+% spreading over more than one line (provided that both outer
+% and inner quotations are entered with |\frquote{}|). When
+% \fbo{EveryLineGuill=open} or \fbo{=close} the inner quotation is
+% always surrounded by « and », the next option is ineffective.
+% \item [InnerGuillSingle=true (false)];
+% if \fbo{InnerGuillSingle=false} (default), inner quotations
+% entered with |\frquote{}| start with~\texttt{``} and end
+% with~\texttt{’’}.
+% If \fbo{InnerGuillSingle=true}, \texttt{\guilsinglleft} and
+% \texttt{\guilsinglright} are used instead of British double
+% quotes; moreover if option \fbo{EveryParGuill=open} (or
+% \fbo{close}) is set, a \texttt{\guilsinglleft} (or
+% \texttt{\guilsinglright}) is added at the beginning of every
+% parapraph included in the inner quotation.
+%
+% \item [ThinSpaceInFrenchNumbers=true (false)]; if \pkg{numprint}
+% has been loaded with the \opt{autolanguage} option, while
+% typesetting numbers with the |\numprint{}| command,
+% |\npthousandsep| is defined as a non-breaking space (|~|)%
+% \footnote{Actually without stretch nor shrink.} in French;
+% when set to true, this option redefines |\npthousandsep|
+% as a thin space (|\,|).
+%
+% \item [SmallCapsFigTabCaptions=false (true*)]; when set to
+% \fbo{false}, |\figurename| and |\tablename| will be printed in
+% French captions as ``Figure’’ and ``Table’’ instead of being
+% printed in small caps (the default).
+% \item [CustomiseFigTabCaptions=false (true*)]; when \fbo{false}
+% the default separator (colon) is used instead of
+% |\CaptionSeparator|. Anyway, \frenchb{} tries hard to insert
+% a proper space before it and warns if it fails to do so.
+% \item [OldFigTabCaptions=true (false)] is to be used when
+% figures’ and tables’ captions must be typeset as with pre~3.0
+% versions of \frenchb{} (with |\CaptionSeparator| in French and
+% colon otherwise). Intended for standard LaTeX classes only.
+%
+% \item [FrenchSuperscripts=false (true)]; then
+% |\up=\textsuperscript|. % (option added in version 2.1).
+% Should only be made \fbo{false} to recompile documents written
+% before 2008 without changes: by default |\up| now relies on
+% |\fup| designed to produce better looking superscripts.
+% \item [LowercaseSuperscripts=false (true)]; by default \frenchb{}
+% inhibits the uppercasing of superscripts (for instance when
+% they are moved to page headers). Making this option
+% \fbo{false} will disable this behaviour (not recommended).
+% \item [SuppressWarning=true (false)]; can be turned to \fbo{true}
+% if you are bored with \frenchb’s warnings; use this option as
+% \emph{first} option of \fbsetup{} to cancel warnings launched
+% by other options.
+% \end{description}
+%
+% \textbf{Options’ order} -- Please remember that options are read
+% in the order they appear in the \fbsetup{} command.
+% Someone wishing that \frenchb{} leaves the layout of lists
+% and footnotes untouched but caring for indentation of first
+% paragraph of sections should choose\\
+% \fbsetup{StandardLayout,IndentFirst} to get the expected
+% layout. The reverse order
+% \fbsetup{IndentFirst,StandardLayout} would lead to option
+% \fbo{IndentFirst} being overwritten by \fbo{StandardLayout}.
+%
+% \subsubsection{Caption names}
+% \label{sssec-captions-name}
+%
+% All caption names can easily be customised in French using the
+% simplified syntax introduced by \babel~3.9, for instance
+% |\def\frenchproofname{Preuve}| or
+% |\def\acadianproofname{Preuve}| for the \opt{acadian} dialect.
+% The older syntax |\addto\captionsfrench{\def\proofname{Preuve}}|
+% still works. Keep in mind that \emph{only} |french| can be used
+% to redefine captions, even if \babel{}’s option was entered as
+% |frenchb| or |francais|.
+%
+% \subsubsection{Figure and table captions}
+% \label{sssec-captions-fig}
+%
+% In French, captions in figures and tables should never be printed
+% as ‘Figure~1: ’ which is the default in standard LaTeX2e
+% classes (a space should \emph{always} preceed a colon in French),
+% anyway ‘Figure 1 -- ’ is preferred.
+%
+% When French is the main language, the default behaviour of
+% \frenchb{} is to change the separator (colon) used in figures’ and
+% tables’ captions \emph{for all languages} to |\CaptionSeparator|
+% which defaults to ` -- ’ and can be redefined in the preamble with
+% |\renewcommand*{\CaptionSeparator}{...}|.
+% This works for the standard LaTeX2e classes, for the \cls{memoir}
+% and koma-script classes.
+% In case this procedure fails a warning is issued.
+%
+% When French is not the main language, the colon is preserved for
+% all languages including French but \frenchb{} tries hard to insert
+% a proper space before it and warns if it fails to do so.
+%
+% Three options are provided to customise figure and table captions:
+% \begin{itemize}
+% \item if \fbo{CustomiseFigTabCaptions} is set to \fbo{false} the
+% colon will be used as separator in all languages, with a proper
+% space before the colon in French (if possible);
+% \item the second option, \fbo{OldFigTabCaptions}, can be set to
+% \fbo{true} to print figures’ and tables’ captions as they were
+% with versions pre~3.0 of \frenchb{} (using |\CaptionSeparator|
+% in French and colon in other languages); this option only makes
+% sense with the standard LaTeX classes \cls{article},
+% \cls{report} and \cls{book};
+% \item the last option, \fbo{SmallCapsFigTabCaptions}, can be set
+% to \fbo{false} to typeset |\figurename| and |\tablename| in
+% French as ``Figure’’ and ``Table’’ rather than in small caps
+% (the default).
+% \end{itemize}
+%
+% \subsection{Hyphenation checks}
+% \label{ssec-hyphen}
+%
+% Once you have built your format, a good precaution would be to
+% perform some basic tests about hyphenation in French.
+% For LaTeX2e I suggest this:
+% \begin{itemize}
+% \item run |pdfLaTeX| on the following file:\\[3mm]^^A\]
+% |%%% Test file for French hyphenation.|\\
+% |\documentclass[french]{article}|\\
+% |\usepackage[utf8]{inputenc} % utf8, what else?|\\
+% |\usepackage[T1]{fontenc} % mandatory for French|\\
+% |\usepackage{lmodern} % or erewhon, palatino…|\\
+% |\usepackage{babel}|\\
+% |\begin{document}|\\
+% |\showhyphens{signal container \'ev\'enement alg\`ebre}|\\
+% |\showhyphens{signal container événement algèbre}|\\
+% |\end{document}|
+% \item check the hyphenations proposed by \TeX{} in your log-file;
+% in French you should get with both 7-bit and 8-bit encodings\\
+% \texttt{si-gnal contai-ner évé-ne-ment al-gèbre}.\\
+% Do not care about how accented characters are displayed in the
+% log-file, what matters is the position of the `|-|’ hyphen
+% signs \emph{only}.
+% \end{itemize}
+% If they are all correct, your installation (probably) works fine,
+% if one (or more) is (are) wrong, ask a local wizard to see what’s
+% going wrong and perform the test again (or e-mail me about what
+% happens).\\
+% Frequent mismatches:
+% \begin{itemize}
+% \item you get |sig-nal con-tainer|, this probably means that the
+% hyphenation patterns you are using are for US-English, not for
+% French;
+% \item you get no hyphen at all in \texttt{évé-ne-ment}, this
+% probably means that you are using CM fonts and the macro
+% |\accent| to produce accented characters.
+% Using 8-bits fonts with built-in accented characters avoids
+% this kind of mismatch.
+% \end{itemize}
+%
+% \subsection{Changes}
+% \label{ssec-changes}
+%
+% \subsubsection*{What’s new in version 3.5?}
+%
+% Version 3.5a offers a new option \fbo{ListItemsAsPar}. The default
+% layout of lists is unchanged (for backward compatibility), but
+% users should try this new option which ensures a layout of lists
+% closer to French typographic standards: see f.i.\ how lists are
+% typeset in the book ``Lexique des règles typographiques en usage
+% à l’Imprimerie Nationale’’.
+%
+% Version 3.5b fixes a bug due to wrong |\everypar|’s management in
+% |\frquote{}|; it showed up when |\frquote{}| immediately followed
+% a sectionning command.
+%
+% Starting with version 3.5d, a new option \fbo{StandardListSpacing}
+% has been added to supersede \fbo{ReduceListSpacing}.
+%
+% A new command |\NoEveryParQuote| has been added in version 3.5e:
+% it is meant to be used inside a group or environment to suppress
+% unwanted guillemets (typically when lists are embedded in
+% |\frquote{}|).
+%
+% \subsubsection*{What’s new in version 3.4?}
+%
+% Version 3.4a adds a new command |\frenchdate| (see
+% p.~\pageref{frenchdate}) and slightly changes number formatting:
+% |\FBthousandsep| is now a \textit{kern} instead of a rubber
+% length. |\renewcommand*{\FBthousandsep}{~}| will switch back
+% to the former (wrong) behaviour.
+%
+% Both options \opt{french} and \opt{acadian} can now be used
+% simultaneously in a document; currently \opt{french} and
+% \opt{acadian} are identical, it is up to the user to customise
+% \opt{acadian} in terms of hyphenation patterns, captionnames,
+% date format or high punctuation and quotes spacing if he/she
+% needs a variant for French.
+%
+% A new command |\FBsetspaces| has been added for easy customising of
+% spacing before high punctuation and inside quotes independently for
+% \opt{french} and \opt{acadian}, see p.~\pageref{FBsetspaces}.
+%
+% Version 3.4 requires eTeX and LuaTeX 1.0.4 or newer.
+%
+% \subsubsection*{What’s new in version 3.3?}
+%
+% In version~3.3d the automatic insertion of non-breaking spaces
+% before the colon character has been improved \emph{with engine
+% LuaTeX only}: a spurious space is no longer inserted in strings
+% like http://mysite, C:\textbackslash Program Files or 10:55.
+% Unfortunately, my attempts to do the same with XeTeX or pdfTeX
+% were unsuccessful.
+%
+% A few internal changes have been made in version~3.3c to improve
+% the convertion into HTML of non-breaking spaces added by \frenchb.
+% Usage of \exe{lwarp} (v.0.37 and up) is recommended for HTML
+% output, it works fine on files compiled with XeLaTeX or pdfLaTeX
+% formats.
+% A new experimental option \fbo{UnicodeNoBreakSpaces} has been
+% added for LuaLaTeX in version~3.3c, see p.~\pageref{ucs-nbsp}.
+%
+% According to current \babel’s standards, every dialect should
+% have it’s own \file{.ldf} file; starting with version~3.3b,
+% the main support for French is in \file{french.ldf}, portmanteau
+% files \file{frenchb.ldf},\file{francais.ldf}, \file{acadian.ldf}
+% and \file{canadien.ldf} have been added. Recommended options are
+% \opt{french} or \opt{acadian}, all other are deprecated.
+% BTW, options \opt{french} and \opt{acadian} are currently
+% strictly identical.
+%
+% Release 3.3a is compatible with LuaTeX v.~0.95 (TL2016) and up.
+% Former skips |\FBcolonskip|, |\FBthinskip| and |\FBguillskip|
+% controlling punctuation spacings in LuaTeX have been removed;
+% all three engines now rely on the same commands |\FBcolonspace|,
+% |\FBthinspace| and |\FBguillspace|.
+%
+% An alias |\frenchsetup{}| for |\frenchbsetup{}| has been added
+% in version 3.3a, it might appear more relevant in the future as
+% the language name |frenchb| should vanish.
+%
+% Further customisation of the |\part{}| command is provided via
+% three new commands |\frenchpartfirst|, |\frenchpartsecond| and
+% |\frenchpartnameord|.
+%
+% \subsubsection*{What’s new in version 3.2?}
+%
+% Version 3.2g changes the default behaviour of |\frquote{}|
+% with LuaTeX based engines, the output is now the same with
+% all engines; to recover the former behaviour, add option
+% \fbo{EveryLineGuill=open}.
+%
+% The handling of footnotes has been redesigned for the
+% \cls{beamer}, \cls{memoir} and koma-script classes.
+% The layout of footnotes ``à la française’’ should be unchanged
+% but footnotes’ customisations offered by these classes
+% (i.e.\ font or color changes) are now available even when option
+% \fbo{FrenchFootnotes} is \fbo{true}.
+%
+% A long standing bug regarding the \pkg{xspace} package has been
+% fixed: |\xspace| has been moved up from the internal command
+% |\FB@fg| to |\fg|; |\frquote{}| now works properly when the
+% \pkg{xspace} package is loaded.
+%
+% Version 3.2b is the first one designed to work with LuaTeX
+% v.~0.95 as included in TeXLive 2016 (LuaTeX’s new glue node
+% structure is not compatible with previous versions).
+%
+% \textbf{Warning to Lua(La)TeX users:} starting with version~3.2b
+% the lua code included in \file{frenchb.lua} will \emph{not work}
+% on older installations (TL2015 f.i.), so \frenchb{} reverts to
+% active characters while handling high punctuation with LuaTeX
+% engines older than 0.95!
+% The best way to go is to upgrade to TL2016 or equivalent asap.
+% Xe(La)TeX and pdf(La)TeX users can safely use \frenchb{} v.~3.2b
+% and later on older installations too.
+% \enlargethispage*{.5\baselineskip}
+%
+% Tne internals of commands |\NoAutoSpacing|, |\ttfamilyFB|,
+% |\rmfamilyFB| and |\sffamilyFB| have been completely redesigned
+% in version~3.2c, they behave now consistently with all engines.
+%
+% \subsubsection*{What’s new in version 3.1?}
+%
+% New command |\frquote{}| meant to enter French quotations,
+% especially long ones (spreading over several paragraphs) and/or
+% embedded ones. see p.~\pageref{frquote} for details.
+%
+% \subsubsection*{What’s new in version 3.0?}
+%
+% Many deep changes lead me to step \frenchb’s version number
+% to~3.0a:
+% \begin{itemize}
+% \item \babel{}~3.9 is required now to process
+% \file{frenchb.ldf}, this change allows for cleaner definitions
+% of dates and captions for the Unicode engines LuaTeX and
+% XeTeX and also provides a simpler syntax for end-users, see
+% section~\ref{sssec-captions-name}
+% p.\pageref{sssec-captions-name}.
+% \item \fbsetup{} options management has been completely
+% reworked; two new options added.
+% \item Canadian French didn’t work as a normal \babel’s dialect,
+% it should now; btw. the French language should now be loaded
+% as \opt{french}, \emph{not as} \opt{frenchb} or
+% \opt{francais} and preferably as a \emph{global} option of
+% |\documentclass|. Some tolerance still exists in v3.0, but
+% do not rely on it.
+% \item \frenchb{} no longer loads \file{frenchb.cfg}:
+% customisation should definitely be done using \fbsetup{}
+% options.
+% \item Description lists labels are now indented; try setting
+% |\descindentFB=0pt| (or |\listindentFB=0pt| for all lists)
+% in the preamble if you don’t like it.
+% \item The last but not least change affects the (recent)
+% LuaTeX-based engines, (this means version 0.76 as included in
+% TL2013 and up): active characters are no longer used in French
+% for `high punctuation’%
+% \footnote{The current \frenchb{} version requires LuaTeX
+% v.~1.0.4 as included in TL2017, see above.}.
+% Functionalities and user interface are unchanged.
+%
+% Many thanks to Paul Isambert who provided the basis for the
+% lua code (see his presentation at GUT’2010) and kindly
+% reviewed my first drafts suggesting significant improvements.
+%
+% Please note that this code, still experimental, is likely to
+% change until LuaTeX itself has reached version~1.0.
+% \end{itemize}
+%
+% Starting with version~3.0c, \frenchb{} no longer customises
+% lists with the \cls{beamer} class and offers a new option
+% (\fbo{INGuillSpace}) to follow French `Imprimerie Nationale’
+% recommendations regarding quotes’ spacing.
+%
+% \StopEventually{}
+%
+% \changes{v2.6c}{2013/05/20}{Dummy file frenchb.cfg is no longer
+% generated from frenchb.dtx.}
+%
+% \clearpage
+% \newgeometry{left=53mm,right=25mm}
+%
+% \section{The code}
+%
+% \subsection{Initial setup}
+%
+% \changes{v2.1d}{2008/05/02}{Argument of \cs{ProvidesLanguage} changed
+% above from `french’ to `frenchb’ (otherwise \cs{listfiles} prints
+% no date/version information). The real name of current language
+% (french) as to be corrected before calling \cs{LdfInit}.}
+%
+% \changes{v3.0a}{2014/02/28}{Support for options frenchb, francais,
+% canadien, acadian changed.}
+%
+% \changes{v3.0a}{2014/02/19}{\cs{LdfInit} checks \cs{captionsfrench}
+% instead of \cs{datefrench} to avoid a conflict with papertex.cls
+% which loads datetime.sty.}
+%
+% \changes{v3.4a}{2018/01/14}{\cs{LdfInit} checks \cs{FBclean@on@exit}
+% instead of \cs{captionsfrench} (undefined in PLain).
+% Prevents loading french.ldf again with acadian option.}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once (even if both options \opt{french} and
+% \opt{acadian} are used in the same document), checking the
+% category code of the \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*french>
+\LdfInit\CurrentOption{FBclean@on@exit}
+% \end{macrocode}
+%
+% \changes{v3.0a}{2014/02/15}{In Plain, provide a substitute for
+% \cs{PackageWarning} and \cs{PackageInfo}.}
+%
+% Let’s provide a substitute for |\PackageError|, |\PackageWarning|
+% and |\PackageInfo| not defined in Plain:
+% \begin{macrocode}
+\def\fb@error#1#2{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J(french.ldf) }%
+ \errhelp{#2}\errmessage{\\#1^^J}%
+ \endgroup}
+\def\fb@warning#1{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J(french.ldf) }%
+ \message{\\#1^^J}%
+ \endgroup}
+\def\fb@info#1{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J}%
+ \wlog{#1}%
+ \endgroup}
+% \end{macrocode}
+%
+% \changes{v3.4a}{2018/01/04}{babel-french now requires eTeX.}
+%
+% Quit if eTeX is not available.
+% \begin{macrocode}
+\let\bbl@tempa\relax
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \let\bbl@tempa\endinput
+ \fb@error{babel-french requires eTeX.\\
+ Aborting here}
+ {Orignal PlainTeX is not supported,\\
+ please use LuaTeX or XeTeX engines.}
+\fi
+\bbl@tempa
+% \end{macrocode}
+%
+% \changes{v3.0c}{2014/03/30}{babel-french requires babel-3.9i.}
+%
+% Quit if \babel’s version is less than 3.9i.
+% \begin{macrocode}
+\let\bbl@tempa\relax
+\ifdefined\babeltags
+\else
+ \let\bbl@tempa\endinput
+ \ifdefined\PackageError
+ \PackageError{french.ldf}
+ {babel-french requires babel v.3.16.\MessageBreak
+ Aborting here}
+ {Please upgrade Babel!}
+ \else
+ \fb@error{babel-french requires babel v.3.16.\\
+ Aborting here}
+ {Please upgrade Babel!}
+ \fi
+\fi
+\bbl@tempa
+% \end{macrocode}
+%
+% \changes{v3.0c}{2014/03/30}{No need to define \cs{l@french} as
+% \cs{lang@french}, babel.def (3.9j) takes care for this.}
+%
+% Make sure that |\l@french| is defined (fallbacks are
+% |\l@nohyphenation| if available or~0).
+% \file{babel.def} (3.9i and up) defines |\l@<languagename>| also for
+% eTeX, LuaTeX and XeTeX formats which set |\lang@<languagename>|.
+% \begin{macrocode}
+\def\FB@nopatterns{%
+ \ifdefined\l@nohyphenation
+ \adddialect\l@french\l@nohyphenation
+ \edef\bbl@nulllanguage{\string\language=nohyphenation}%
+ \else
+ \edef\bbl@nulllanguage{\string\language=0}%
+ \adddialect\l@french0
+ \fi
+ \@nopatterns{French}}
+\ifdefined\l@french \else \FB@nopatterns \fi
+% \end{macrocode}
+%
+% Babel’s French language can be loaded with option \opt{acadian}
+% which stands for Canadian French.
+% If no specific hyphenation patterns are available, Canadian French
+% will use the French ones.
+% \begin{macrocode}
+\ifdefined\l@acadian \else \adddialect\l@acadian\l@french \fi
+% \end{macrocode}
+%
+% French uses the standard values of |\lefthyphenmin| (2)
+% and |\righthyphenmin| (3); let’s provide their values though,
+% as required by \babel.
+%
+% \begin{macrocode}
+\providehyphenmins{french}{\tw@\thr@@}
+\providehyphenmins{acadian}{\tw@\thr@@}
+% \end{macrocode}
+%
+%\changes{v2.1d}{2008/05/04}{Avoid warning `\cs{end} occurred
+% when \cs{ifx} ... incomplete’ with LaTeX-2.09.}
+%
+% \begin{macro}{\ifLaTeXe}
+% No support is provided for late LaTeX-2.09: issue a warning
+% and exit if LaTeX-2.09 is in use. Plain is still supported.
+% \begin{macrocode}
+\newif\ifLaTeXe
+\let\bbl@tempa\relax
+\ifdefined\magnification
+\else
+ \ifdefined\@compatibilitytrue
+ \LaTeXetrue
+ \else
+ \PackageError{french.ldf}
+ {LaTeX-2.09 format is no longer supported.\MessageBreak
+ Aborting here}
+ {Please upgrade to LaTeX2e!}
+ \let\bbl@tempa\endinput
+ \fi
+\fi
+\bbl@tempa
+% \end{macrocode}
+% \end{macro}
+%
+%\begin{macro}{\ifFBunicode}
+% \begin{macro}{\ifFBLuaTeX}
+% \begin{macro}{\ifFBXeTeX}
+% French hyphenation patterns are now coded in Unicode, see file
+% \file{hyph-fr.tex}. XeTeX and LuaTeX engines require some extra
+% code to deal with the French ``apostrophe’’.
+% Let’s define three new `if’: |\ifFBLuaTeX|, |\ifFBXeTeX| and
+% |\ifFBunicode| which will be true for XeTeX and LuaTeX engines
+% and false for 8-bits engines.
+%
+% \changes{v2.4a}{2009/11/23}{Added a new `if’ \cs{FBunicode} and
+% some \cs{lccode} definitions to \cs{extrasfrench} and
+% \cs{noextrasfrench}.}
+%
+% \changes{v2.5d}{2011/01/17}{Added two new `if’ \cs{FBXeTeX} and
+% \cs{FBLuaTeX} as XeTeX and behave differently regarding the status
+% of the French `apostrophe’.}
+%
+% \changes{v2.6g}{2013/12/15}{lccode values for the French
+% `apostrophe’ are now the same for XeTeX and LuaTeX.}
+%
+% \changes{v3.4c}{2018/02/16}{Reverting to former test, beware of
+% \cs{XeTeXrevision} left as \cs{relax} by careless testing.}
+%
+% \begin{macrocode}
+\newif\ifFBunicode
+\newif\ifFBLuaTeX
+\newif\ifFBXeTeX
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname luatexversion\endcsname\relax
+\else
+ \FBunicodetrue \FBLuaTeXtrue
+\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname XeTeXrevision\endcsname\relax
+\else
+ \FBunicodetrue \FBXeTeXtrue
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.3b}{2017/07/08}{New `if’ \cs{ifFBfrench} to replace
+% \cs{iflanguage} test which is based on patterns.}
+%
+% \begin{macro}{\ifFBfrench}
+% True when the current language is French or any of its dialects;
+% will be set to true by |\extrasfrench| and to false by
+% |\noextrasfrench|. Used in |\DecimalMathComma| and
+% |frenchsetup{og=«, fg=»}|.
+% \begin{macrocode}
+\newif\ifFBfrench
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasfrench}
+% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s
+% \cs{babel@savevariable} to handle apostrophe’s \cs{lccode}.}
+%
+% \changes{v3.4a}{2018/01/06}{Change \cs{(no)extras}\cs{CurrentOption}
+% to \cs{(no)extrasfrench}. \cs{(no)extrasacadian} will be defined
+% as \cs{(no)extrasfrench} in file acadian.ldf.}
+%
+% \begin{macro}{\noextrasfrench}
+% The macro |\extrasfrench| will perform all the extra
+% definitions needed for the French language.
+% The macro |\noextrasfrench| is used to cancel the actions of
+% |\extrasfrench|.
+%
+% In French, character ``apostrophe’’ (U+27 or U+2019) is a letter in
+% expressions like |l’ambulance| (French hyphenation patterns provide
+% entries for this kind of words). This means that the |\lccode| of
+% ``apostrophe’’ has to be non null in French for proper hyphenation
+% of those expressions, and has to be reset to null when exiting
+% French.
+%
+% The following code ensures correct hyphenation of words like
+% |d’aventure|, |l’utopie|, with all TeX engines (XeTeX, LuaTeX,
+% pdfTeX) using \file{hyph-fr.tex} patterns.
+%
+% \changes{v3.5c}{2018/09/11}{\cs{lccode} of quote 0x27 changed from
+% 0x2019 to 0x27 for Unicode engines.}
+%
+% \begin{macrocode}
+\def\extrasfrench{%
+ \FBfrenchtrue
+ \babel@savevariable{\lccode"27}%
+ \lccode"27="27
+ \ifFBunicode
+ \babel@savevariable{\lccode"2019}%
+ \lccode"2019="2019
+ \fi
+}
+\def\noextrasfrench{\FBfrenchfalse}
+% \end{macrocode}
+%
+% One more thing |\extrasfrench| needs to do is to make sure that
+% ``Frenchspacing’’ is in effect. |\noextrasfrench| will switch
+% ``Frenchspacing’’ off again if necessary.
+% \begin{macrocode}
+\addto\extrasfrench{\bbl@frenchspacing}
+\addto\noextrasfrench{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Punctuation}
+% \label{ssec-punct}
+%
+% \changes{v2.5a}{2010/08/10}{Punctation is no longer made active
+% with XeTeX-based engines.}
+%
+% As long as no better solution is available, the `high
+% punctuation’ characters (|;| |!| |?| and |:|) have to be made
+% |\active| for an automatic control of the amount of space to be
+% inserted before them. Both XeTeX and LuaTeX provide an
+% alternative to active characters (`XeTeXinterchar’ mechanism and
+% LuaTeX’s callbacks).
+%
+% \changes{v3.0a}{2014/01/10}{New flag \cs{ifFB@luatex@punct} for
+% `high punctuation’ management with LuaTeX engines.}
+%
+% \begin{macro}{\ifFB@active@punct}
+% Three internal flags are needed for the three different techniques
+% used for `high punctuation’ management.
+% \begin{macrocode}
+\newif\ifFB@active@punct \FB@active@puncttrue
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifFB@luatex@punct}
+% With LuaTeX, starting with version 1.0.4, callbacks are used to
+% get rid of active punctuation. With previous versions, `high
+% punctuation’ characters remain active (see below).
+% \begin{macrocode}
+\newif\ifFB@luatex@punct
+\ifFBLuaTeX
+ \ifnum\luatexversion<100
+ \ifx\PackageWarning\@undefined
+ \fb@warning{Please upgrade LuaTeX to version 1.0.4 or above!\\%
+ babel-french will make high punctuation characters (;:!?)\\%
+ active with LuaTeX < 1.0.4.}%
+ \else
+ \PackageWarning{french.ldf}{Please upgrade LuaTeX
+ to version 1.0.4 or above!\MessageBreak
+ babel-french will make high punctuation characters%
+ \MessageBreak (;:!?) active with LuaTeX < 1.0.4;%
+ \MessageBreak reported}%
+ \fi
+ \else
+ \FB@luatex@puncttrue\FB@active@punctfalse
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifFB@xetex@punct}
+% For XeTeX, the availability of |\XeTeXinterchartokenstate|
+% decides whether the `high punctuation’ characters (|;| |!| |?|
+% and |:|) have to be made |\active| or not.
+%
+% \changes{v3.2b}{2016/04/18}{New counter \cs{FB@nonchar} needed for
+% non characters: it’s value will be 4095 for new engines and 255
+% for older ones.}
+%
+% The number of available character classes has been increased from
+% 256 to 4096 in XeTeX v.~0.99994, the class for non-characters is
+% now 4095 instead of 255.
+% \begin{macrocode}
+\newcount\FB@nonchar
+\newif\ifFB@xetex@punct
+\ifdefined\XeTeXinterchartokenstate
+ \FB@xetex@puncttrue\FB@active@punctfalse
+ \ifdim\the\XeTeXversion\XeTeXrevision pt<0.99994pt
+ \FB@nonchar=255 \relax
+ \else
+ \FB@nonchar=4095 \relax
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FBguillspace}
+% \begin{macro}{\FBcolonspace}
+% \begin{macro}{\FBthinspace}
+% \changes{v2.5a}{2010/08/10}{Define \cs{FBthinspace} for those who want
+% to customise the width of the space before ; and co.}
+%
+% \changes{v2.6d}{2013/06/19}{Rename \cs{Fthinspace} to
+% \cs{FBthinspace} and \cs{Fcolonspace} to \cs{FBcolonspace} to avoid
+% a conflict with fournier.sty.}
+%
+% \changes{v3.1f}{2015/05/31}{\cs{FBthinspace} is no longer a kern but
+% a skip (babel-french adds a nobreak penalty before it).}
+%
+% \changes{v3.2c}{2016/05/14}{Change .16667em to
+% .5\cs{fontdimen2}\cs{font} to get in XeTeX and pdfTeX
+% the same spacing as in LuaTeX.}
+%
+% \changes{v3.3a}{2016/04/30}{Skips \cs{FBcolonskip} and
+% \cs{FBthinskip} replaced by toks \cs{FBcolonsp} and
+% \cs{FBthinsp}.}
+%
+% These three commands are meant for basic French. Other French
+% dialects can use different settings, see below.
+% According to the I.N.\ specifications, the `:’ requires an
+% inter-word space before it, the other three require just a thin
+% space. We define |\FBcolonspace| as |\space| (inter-word space)
+% and |\FBthinspace| as an half inter-word space with no shrink nor
+% stretch.
+% |\FBguillspace| is defined btw. as spacing for French quotes is
+% handled together with high punctuation for LuaTeX and XeTeX.
+% |\FBguillspace| has been fine tuned by Thierry Bouche to 80\% of an
+% inter-word space with reduced stretchability.
+% All three are user customisable in the preamble, best using the
+% |\FBsetspaces| command described below.
+% A penalty will be added before these spaces to prevent line
+% breaking.
+% \begin{macrocode}
+\newcommand*{\FBguillspace}{\hskip .8\fontdimen2\font
+ plus .3\fontdimen3\font
+ minus .8\fontdimen4\font \relax}
+\newcommand*{\FBcolonspace}{\space}
+\newcommand*{\FBthinspace}{\hskip .5\fontdimen2\font \relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.3a}{2016/04/30}{Skip \cs{FBguillskip} for LuaTeX
+% replaced by toks \cs{FBguillsp}.}
+%
+% \changes{v3.4a}{2018/01/15}{Toks \cs{FBcolonsp}, \cs{FBthinsp} and
+% \cs{FBguillsp} removed.}
+%
+% \changes{v3.4a}{2018/01/26}{New command \cs{FBsetspaces} to fine tune
+% spacing independently in French and in French dialects.}
+%
+% \begin{macro}{\FBsetspaces}
+% This command makes it easy to fine tune |\FBguillspace|,
+% |\FBcolonspace| and |\FBthinspace| in French (defaut) or
+% independently in a French dialect using the optional argument.
+% They are meant for LaTeX2e \emph{only} and can only be used
+% in the preamble.
+% Four mandatory arguments are expected besides the optional one:
+% the first one is a \textit{string} either "guill", "colon", or
+% "thin", the last four are decimal numbers specifying
+% \textit{width}, \textit{stretch} and \textit{shrink} relative to
+% \textit{fontdimens}.\hlabel{FBsetspaces}
+% For instance |\FBsetspaces[acadian]{colon}{0.5}{0}{0}| defines
+% |\acadianFBcolonspace| as a thinspace which will be used for
+% the Acadian dialect only. When used without optional argument or
+% with argument `french’, the same command would tune the basic
+% |\FBcolonspace| command.
+% \begin{macrocode}
+\ifLaTeXe
+ \newcommand*{\FBsetspaces}[5][french]{%
+ \def\bbl@tempa{french}\def\bbl@tempb{#1}%
+ \ifx\bbl@tempa\bbl@tempb \def\bbl@tempb{}\fi
+ \@namedef{\bbl@tempb FB#2space}{\hskip #3\fontdimen2\font
+ plus #4\fontdimen3\font
+ minus #5\fontdimen4\font \relax}%
+% \end{macrocode}
+% With option "acadian", fill the corresponding LuaTeX table.
+% All unset values in the "acadian" subtables will be filled
+% `AtBeginDocument’ by |\set@glue@table| with the value available
+% for "french".
+% \begin{macrocode}
+ \ifFB@luatex@punct
+ \ifx\bbl@tempb\FB@acadian
+ \directlua{
+ FBsp.#2.gl.ac[1] = #3
+ FBsp.#2.gl.ac[2] = #4
+ FBsp.#2.gl.ac[3] = #5
+ if #3 > 0.6 then
+ FBsp.#2.ch.ac = 0xA0
+ elseif #3 > 0.2 then
+ FBsp.#2.ch.ac = 0x202F
+ else
+ FBsp.#2.ch.ac = 0x200B
+ end
+ }%
+ \fi
+ \fi
+ }
+ \@onlypreamble\FBsetspaces
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Remember that the \emph{same} |\extrasfrench| command is executed
+% when switching to French or to a French dialect (Acadian).
+% Acadian and French may share the same patterns (or not), and may
+% use different spacing for high punctuation and/or quotes.
+% Basically, for pdfLaTeX and XeLaTeX, the spacing is set for French,
+% then potentially tuned differently for Acadian.
+% LuaTeX relies on an attribute |\FB@dialect| to decide what spacing
+% is needed for French or Acadian (see LuaTeX table |FBsp|).
+% \hlabel{extrapunct}
+% As a rough test on |\languagename| would be unreliable to set the
+% value of |\FB@dialect| (see \file{babel.pdf}), we use a trick
+% based on |\detokenize|; another option would be to use the
+% |\IfLanguageName| command from Oberdiek’s package \file{iflang}.
+% \begin{macrocode}
+\ifLaTeXe
+ \addto\extrasfrench{%
+ \ifFB@luatex@punct
+ \edef\bbl@tempa{\detokenize\expandafter{\languagename}}%
+ \edef\bbl@tempb{\detokenize{french}}%
+ \ifx\bbl@tempa\bbl@tempb \FB@dialect=0 \relax
+ \else \FB@dialect=1 \relax
+ \fi
+% \end{macrocode}
+% The first time whe enter French, we have to set the LuaTeX
+% tables for French (|\FB@dialet=0|) \emph{before} any dialect
+% redefines any |\FB...space| command. Doing this `AtBeginDocument’
+% would be too late: if French or a French dialect is the main
+% language, |\extrasfrench| has been executed before!
+% \begin{macrocode}
+ \ifdefined\FB@once\else
+ \set@glue@table{colon}%
+ \set@glue@table{thin}%
+ \set@glue@table{guill}%
+ \def\FB@once{}%
+ \fi
+ \fi
+% \end{macrocode}
+% Any dialect dependent customisation done using
+% |\FBsetspaces[|\textit{dialect}|]| command or alike is now
+% taken into account: the value of |\FBthinspace| (meant for French,
+% i.e.|\FB@dialect=0|) is first saved then changed (for Acadian).
+% \begin{macrocode}
+ \ifcsname\languagename FBthinspace\endcsname
+ \babel@save\FBthinspace
+ \renewcommand*{\FBthinspace}{%
+ \csname\languagename FBthinspace\endcsname}%
+ \fi
+% \end{macrocode}
+% Same for |\FBcolonspace|:
+% \begin{macrocode}
+ \ifcsname\languagename FBcolonspace\endcsname
+ \babel@save\FBcolonspace
+ \renewcommand*{\FBcolonspace}{%
+ \csname\languagename FBcolonspace\endcsname}%
+ \fi
+% \end{macrocode}
+% And for |\FBguillspace|:
+% \begin{macrocode}
+ \ifcsname\languagename FBguillspace\endcsname
+ \babel@save\FBguillspace
+ \renewcommand*{\FBguillspace}{%
+ \csname\languagename FBguillspace\endcsname}%
+ \fi
+ }
+\fi
+% \end{macrocode}
+%
+% \changes{v3.2c}{2016/05/14}{Newif \cs{ifFB@spacing} and new commands
+% \cs{FB@spacingon}, \cs{FB@spacingoff} to control space tuning in
+% French.}
+%
+% The conditional |\ifFB@spacing| will be used by pdfTeX and XeTeX
+% engines to switch on or off space tuning before high punctuation
+% and inside French quotes.
+% A matching attribute will be defined later for LuaTeX.
+% \begin{macrocode}
+\newif\ifFB@spacing \FB@spacingtrue
+% \end{macrocode}
+%
+% \begin{macro}{\FB@spacing@off}
+% \begin{macro}{\FB@spacing@on}
+% Two internal commands to switch on and off all space tuning
+% for all six characters `;:!?«»’.
+% They will be triggered by user command |\NoAutoSpacing| and by
+% font family switching commands |\ttfamilyFB| |\rmfamilyFB| and
+% |\sffamilyFB|. These four commands will now behave the same with
+% any engine (up to version 3.2b, results were engine dependent).
+% \begin{macrocode}
+\newcommand*{\FB@spacing@on}{%
+ \ifFB@luatex@punct
+ \FB@spacing=1 \relax
+ \else
+ \FB@spacingtrue
+ \fi}
+\newcommand*{\FB@spacing@off}{%
+ \ifFB@luatex@punct
+ \FB@spacing=0 \relax
+ \else
+ \FB@spacingfalse
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Punctuation with LuaTeX}
+% \label{sssec-punct-luatex}
+%
+% \changes{v3.0a}{2014/01/10}{New handling of `high punctuation’
+% through callbacks with LuaTeX engines.}
+%
+% The following part holds specific code for punctuation with modern
+% LuaTeX engines, i.e. version 1.0.4 (included in TL2017) or newer.
+%
+% \changes{v3.0b}{2014/02/13}{Require luatexbase with LaTeX2e in case
+% fontspec has not been loaded before babel.}
+%
+% \changes{v3.0c}{2014/03/26}{Just load luatexbase.sty instead of
+% luaotfload.sty with plain formats.}
+%
+% \changes{v3.1a}{2014/05/30}{Misplaced \cs{fi} for plain formats.}
+%
+% \changes{v3.1j}{2015/10/16}{Loading luatexbase.sty is no longer
+% needed with LaTeX release 2015/10/01 or later.}
+%
+% \changes{v3.2b}{2016/04/18}{Load ltluatex.tex for plain LuaTeX to
+% ensure \cs{newattribute} is defined.}
+%
+% \changes{v3.2c}{2016/05/14}{New LuaTeX attribute \cs{FB@spacing}.}
+%
+% \changes{v3.3a}{2017/04/30}{Compatibility code for pre
+% 2015/10/01 LaTeX release removed, see ltnews23.tex.}
+%
+% \changes{v3.4a}{2018/01/15}{New attribute \cs{FB@dialect} for the
+% French dialect acadian.}
+%
+% \begin{macrocode}
+\ifFB@luatex@punct
+ \ifdefined\newluafunction\else
+% \end{macrocode}
+% This code is for Plain: load \file{ltluatex.tex} if it hasn’t been
+% loaded before \babel.
+% \begin{macrocode}
+ \input ltluatex.tex
+ \fi
+% \end{macrocode}
+% We define five LuaTeX attributes to control spacing in French
+% and/or Acadian for `high punctuation’ and quotes, making sure
+% that |\newattribute| is defined.
+%
+% |\FB@spacing=0| switches off any space tuning both before high
+% punctuation characters and inside French quotes (i.e.\ function
+% |french_punctuation| doesn’t alter the node list at all).
+%
+% |\FB@addDPspace=0| switches off automatic insertion of spaces
+% before high punctuation characters (but typed spaces are still
+% turned into non-breaking thin- or word-spaces).
+%
+% |\FB@addGUILspace| will be set to~1 by option \fbo{og=«, fg=»},
+% thus enabling automatic insertion of proper spaces after `«’ and
+% before `»’.
+%
+% |\FB@ucsNBSP| triggers the replacement of glues by characters, it
+% is controlled by option \fbo{UnicodeNoBreakSpaces}.
+%
+% |\FB@dialect| is 0 for French and 1 for Acadian; its value controls
+% which parts of the glue table (|.fr| or |.ac|) are taken into
+% account.
+% \begin{macrocode}
+ \newattribute\FB@spacing \FB@spacing=1 \relax
+ \newattribute\FB@addDPspace \FB@addDPspace=1 \relax
+ \newattribute\FB@addGUILspace \FB@addGUILspace=0 \relax
+ \newattribute\FB@ucsNBSP \FB@ucsNBSP=0 \relax
+ \newattribute\FB@dialect \FB@dialect=0 \relax
+ \ifLaTeXe
+ \PackageInfo{french.ldf}{No need for active punctuation
+ characters\MessageBreak with this version
+ of LuaTeX!\MessageBreak reported}
+ \else
+ \fb@info{No need for active punctuation characters\\
+ with this version of LuaTeX!}
+ \fi
+% \end{macrocode}
+% The next command will be used in the first call of |\extrasfrench|
+% to convert |\FBcolonspace|, |\FBthinspace| and |\FBguillspace|
+% into a table usable by LuaTeX. This way, any customisation done
+% in the preamble (by \fbsetup{}, redefinitions or |\FBsetspaces|
+% commands) are taken into account. Values not explicitly set for
+% Acadian by |\FBsetspaces[|\textit{acadian}|]| commands are copied
+% from the French ones.
+% In case parsing by the Lua function |FBget_glue| (defined in file
+% \file{frenchb.lua}) fails due to unexpected syntax in |\FB...space|
+% the table remains unchanged and a warning is issued.
+% The matching space characters for option \fbo{UnicodeNoBreakSpaces}
+% are set as word space, thin space or null space according to the
+% \textit{width} parameter.
+%
+% \changes{v3.4a}{2018/01/30}{Lua function token.get\_meaning requires
+% LuaTeX 1.0.}
+%
+% \begin{macrocode}
+ \newcommand*{\set@glue@table}[1]{%
+ \directlua {
+ local s = token.get_meaning("FB#1space")
+ local t = FBget_glue(s)
+ if t then
+ FBsp.#1.gl.fr = t
+ if not FBsp.#1.gl.ac[1] then
+ FBsp.#1.gl.ac = t
+ end
+ if FBsp.#1.gl.fr[1] > 0.6 then
+ FBsp.#1.ch.fr = 0xA0
+ elseif FBsp.#1.gl.fr[1] > 0.2 then
+ FBsp.#1.ch.fr = 0x202F
+ else
+ FBsp.#1.ch.fr = 0x200B
+ end
+ if not FBsp.#1.ch.ac then
+ FBsp.#1.ch.ac = FBsp.#1.ch.fr
+ end
+ else
+ texio.write_nl('term and log', '')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Unexpected syntax in FB#1space,')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: LuaTeX table FBsp unchanged.')
+ texio.write_nl('term and log',
+ '*** french.ldf warning: Consider using FBsetspaces to ')
+ texio.write('term and log', 'customise FB#1space.')
+ texio.write_nl('term and log', '')
+ end
+ }%
+ }
+\fi
+%</french>
+% \end{macrocode}
+%
+% \begin{macro}{frenchb.lua}
+% This is \file{frenchb.lua}. It holds Lua code to deal with `high
+% punctuation’ and quotes. This code is based on suggestions from
+% Paul Isambert.
+%
+% First we define two flags to control spacing before French `high
+% punctuation’ (thin space or inter-word space).
+%
+% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French
+% quotes in T1-encoding.}
+%
+% \changes{v3.3c}{2017/09/07}{Function `get\_glue’ robustified.
+% `french\_punctuation’ can insert Unicode characters instead
+% of glues.}
+%
+% \begin{macrocode}
+%<*lua>
+local FB_punct_thin =
+ {[string.byte("!")] = true,
+ [string.byte("?")] = true,
+ [string.byte(";")] = true}
+local FB_punct_thick =
+ {[string.byte(":")] = true}
+% \end{macrocode}
+% Managing spacing after `«’ (U+00AB) and before `»’ (U+00BB) can be
+% done by the way; we define two flags, |FB_punct_left| for
+% characters requiring some space before them and |FB_punct_right|
+% for `\guillemotleft’ which must be followed by some space.
+% In case LuaTeX is used to output T1-encoded fonts instead of
+% OpenType fonts, codes \texttt{0x13} and \texttt{0x14} have to be
+% added for `«’ and `»’.
+% \begin{macrocode}
+local FB_punct_left =
+ {[string.byte("!")] = true,
+ [string.byte("?")] = true,
+ [string.byte(";")] = true,
+ [string.byte(":")] = true,
+ [0x14] = true,
+ [0xBB] = true}
+local FB_punct_right =
+ {[0x13] = true,
+ [0xAB] = true}
+% \end{macrocode}
+% Two more flags will be needed to avoid spurious spaces in
+% strings like !! ?? or (?)
+% \begin{macrocode}
+local FB_punct_null =
+ {[string.byte("!")] = true,
+ [string.byte("?")] = true,
+ [string.byte("[")] = true,
+ [string.byte("(")] = true,
+% \end{macrocode}
+% or if the user has typed a non-breaking space U+00A0 or U+202F
+% (thin) before a `high punctuation’ character: no space
+% should be added by \frenchb. Same is true inside French quotes.
+% \begin{macrocode}
+ [0xA0] = true,
+ [0x202F] = true}
+local FB_guil_null =
+ {[0xA0] = true,
+ [0x202F] = true}
+% \end{macrocode}
+% \changes{v3.1g}{2015/06/17}{Node HLIST added; node TEMP added
+% for the first node of \cs{hbox}es.}
+%
+% Local definitions for nodes:
+% \begin{macrocode}
+local new_node = node.new
+local copy_node = node.copy
+local node_id = node.id
+local HLIST = node_id("hlist")
+local TEMP = node_id("temp")
+local KERN = node_id("kern")
+local GLUE = node_id("glue")
+local GLYPH = node_id("glyph")
+local PENALTY = node_id("penalty")
+local nobreak = new_node(PENALTY)
+nobreak.penalty = 10000
+local insert_node_before = node.insert_before
+local insert_node_after = node.insert_after
+local remove_node = node.remove
+% \end{macrocode}
+%
+%\changes{v3.4a}{2018/01/26}{Global `FBsp’ table added; local function
+% `get\_glue’ changed into global `FBget\_glue’.}
+%
+% Commands |\FBthinspace|, |\FBcolonspace| and |\FBguillspace| are
+% converted `AtBeginDocument’ by the next function |FBget_glue| into
+% tables of three values which are fractions of |\fontdimen2|,
+% |\fontdimen3| and |\fontdimen4|. \hlabel{lua-scaling}
+% If parsing fails due to unexpected syntax, the function returns
+% \textit{nil} instead of a table.
+% \begin{macrocode}
+function FBget_glue(toks)
+ local t = nil
+ local f = string.match(toks,
+ "[^%w]hskip%s*([%d%.]*)%s*[^%w]fontdimen 2")
+ if f == "" then f = 1 end
+ if tonumber(f) then
+ t = {tonumber(f), 0, 0}
+ f = string.match(toks, "plus%s*([%d%.]*)%s*[^%w]fontdimen 3")
+ if f == "" then f = 1 end
+ if tonumber(f) then
+ t[2] = tonumber(f)
+ f = string.match(toks, "minus%s*([%d%.]*)%s*[^%w]fontdimen 4")
+ if f == "" then f = 1 end
+ if tonumber(f) then
+ t[3] = tonumber(f)
+ end
+ end
+ elseif string.match(toks, "[^%w]F?B?thinspace") then
+ t = {0.5, 0, 0}
+ elseif string.match(toks, "[^%w]space") then
+ t = {1, 1, 1}
+ end
+ return t
+end
+% \end{macrocode}
+% Let’s initialize the global LuaTeX table |FBsp|: it holds the
+% characteristics of the glues used in French and Acadian for
+% high punctuation and quotes and the corresponding no-breaking
+% space characters for option \fbo{UnicodeNoBreakSpaces}.
+% \begin{macrocode}
+FBsp = {}
+FBsp.thin = {}
+FBsp.thin.gl = {}
+FBsp.thin.gl.fr = {.5, 0, 0} ; FBsp.thin.gl.ac = {}
+FBsp.thin.ch = {}
+FBsp.thin.ch.fr = 0x202F ; FBsp.thin.ch.ac = nil
+FBsp.colon = {}
+FBsp.colon.gl = {}
+FBsp.colon.gl.fr = { 1, 1, 1} ; FBsp.colon.gl.ac = {}
+FBsp.colon.ch = {}
+FBsp.colon.ch.fr = 0xA0 ; FBsp.colon.ch.ac = nil
+FBsp.guill = {}
+FBsp.guill.gl = {}
+FBsp.guill.gl.fr = {.8, .3, .8} ; FBsp.guill.gl.ac = {}
+FBsp.guill.ch = {}
+FBsp.guill.ch.fr = 0xA0 ; FBsp.guill.ch.ac = nil
+% \end{macrocode}
+% The next function converts the glue table returned by function
+% |FBget_glue| into sp for the current font; beware of null values
+% for fid, see |\nullfont| in TikZ, and of special fonts like
+% lcircle1.pfb for which |font.getfont(fid)| does not return a proper
+% font table, in such cases the function returns |nil|.
+%
+% \changes{v3.1l}{2016/02/13}{font.getfont(fid) possibly
+% returns nil even for a positive fid (i.e. AMS lcircle1.pfb).
+% Reported by François Legendre.}
+%
+% \changes{v3.1m}{2016/02/16}{new\_glue\_scaled returns
+% nil in case of invalid font table (i.e. lcircle1.pfb). In such
+% cases babel-french leaves the node list unchanged.}
+%
+% \changes{v3.2b}{2016/04/18}{glue\_spec removed;
+% starting with LuaTeX 0.95, glue specifications fit in glue.}
+%
+% \begin{macrocode}
+local font_table = {}
+local function new_glue_scaled (fid,table)
+ if fid > 0 and table[1] then
+ local fp = font_table[fid]
+ if not fp then
+ local ft = font.getfont(fid)
+ if ft then
+ font_table[fid] = ft.parameters
+ fp = font_table[fid]
+ end
+ end
+ local gl = new_node(GLUE,0)
+ if fp then
+ node.setglue(gl, table[1]*fp.space,
+ table[2]*fp.space_stretch,
+ table[3]*fp.space_shrink)
+ return gl
+ else
+ return nil
+ end
+ else
+ return nil
+ end
+end
+% \end{macrocode}
+% Let’s catch LuaTeX attributes |\FB@spacing|, |\FB@addDPspace|
+% and |\FB@addGUILspace|.
+% \begin{macrocode}
+local FBspacing = luatexbase.attributes['FB@spacing']
+local addDPspace = luatexbase.attributes['FB@addDPspace']
+local addGUILspace = luatexbase.attributes['FB@addGUILspace']
+local FBucsNBSP = luatexbase.attributes['FB@ucsNBSP']
+local FBdialect = luatexbase.attributes['FB@dialect']
+local has_attribute = node.has_attribute
+% \end{macrocode}
+% The following function will be added to |kerning| callback.
+% It catches all nodes of type |GLYPH| in the list starting at
+% |head| and checks the language attributes of the current glyph:
+% nothing is done if the current language is not French and only
+% specific punctuation characters (those for which |FB_punct_left|
+% or |FB_punct_right| is true) need a special treatment.
+% In French, local variables are defined to hold the properties of
+% the current glyph (|item|) and of the previous one (|prev|) or the
+% next one (|next|). Constants |FR_fr| (french) and |FR_ca|
+% (acadian) are defined by command |\activate@luatexpunct|.
+%
+% \changes{v3.1b}{2014/09/16}{Add a check for null fid
+% in french\_punctuation (Tikz \cs{nullfont}).
+% Bug pointed out by Paul Gaborit.}
+%
+% \begin{macrocode}
+local function french_punctuation (head)
+ for item in node.traverse_id(GLYPH, head) do
+ local lang = item.lang
+ local char = item.char
+ local fid = item.font
+ local FRspacing = has_attribute(item, FBspacing)
+ FRspacing = FRspacing and FRspacing > 0
+ local FRucsNBSP = has_attribute(item, FBucsNBSP)
+ FRucsNBSP = FRucsNBSP and FRucsNBSP > 0
+ local FRdialect = has_attribute(item, FBdialect)
+ FRdialect = FRdialect and FRdialect > 0
+ local SIG = has_attribute(item, addGUILspace)
+ SIG = SIG and SIG >0
+ if lang ~= FR_fr and lang ~= FR_ca then
+ FRspacing = nil
+ end
+ local nbspace = new_node("glyph")
+ if FRspacing and FB_punct_left[char] and fid > 0 then
+ local prev = item.prev
+ local prev_id, prev_subtype, prev_char
+ if prev then
+ prev_id = prev.id
+ prev_subtype = prev.subtype
+ if prev_id == GLYPH then
+ prev_char = prev.char
+ end
+ end
+% \end{macrocode}
+%
+% \changes{v3.0c}{2014/04/18}{Null glues should not trigger space
+% insertion before high ponctuation. Bug pointed out by Benoit
+% Rivet for the `lstlisting’ environment of the listings package.}
+%
+% \changes{v3.1c}{2014/10/25}{Previous bug fix for null glues
+% (v3.0c) did not work properly. Fixed now (I hope!).
+% Pointed out by Jacques André.}
+%
+% If the previous node is a glue, check its natural width, only
+% positive glues (actually glues > 1 sp, for tabular `l’
+% columns) are to be replaced by a non-breaking space.
+% \begin{macrocode}
+ local is_glue = prev_id == GLUE
+ local glue_wd
+ if is_glue then
+ glue_wd = prev.width
+ end
+ local realglue = is_glue and glue_wd > 1
+% \end{macrocode}
+%
+% \changes{v3.3d}{2017/10/17}{In default mode, for `:’ only, check
+% if next node is a glyph or not. If it is, turn the `auto’ flag
+% to false (avoids spurious spaces in URLs, MSDOS paths or 10:35).}
+%
+% For characters for which |FB_punct_thin| or |FB_punct_thick| is
+% \emph{true}, the amount of spacing to be typeset before them
+% is controlled by commands |\FBthinspace| and |\FBcolonspace|
+% respectively.
+% Two options: if a space has been typed in before (turned into
+% \emph{glue} in the node list), we remove the \emph{glue} and add a
+% nobreak penalty and the required \emph{glue}.
+% Otherwise (|auto| option), the penalty and the required
+% \emph{glue} are inserted if attribute |\FB@addDPspace| is set,
+% unless any of these four conditions is met:
+% a) node is `:’ and the next one is of type GLYPH (avoids spurious
+% spaces in http://mysite, C:\textbackslash{} or 10:35);
+% b) the previous character is part of type |FB_punct_null|
+% (avoids spurious spaces in strings like |(!)| or |??|);
+% c) a null glue (actually glues <= 1 sp for tabulars) preceeds
+% the punctuation character (for tabulars and listings);
+% d) the punctuation character starts a paragraph or an |\hbox{}|.
+%
+% When option \fbo{UnicodeNoBreakSpaces} is set to \fbo{true},
+% a Unicode character U+00A0 or U+202F is inserted instead of
+% penalty and glue.
+% \begin{macrocode}
+ if FB_punct_thin[char] or FB_punct_thick[char] then
+ local SBDP = has_attribute(item, addDPspace)
+ local auto = SBDP and SBDP > 0
+ if FB_punct_thick[char] and auto then
+ local next = item.next
+ local next_id
+ if next then
+ next_id = next.id
+ end
+ if next_id and next_id == GLYPH then
+ auto = false
+ end
+ end
+ if auto then
+ if (prev_char and FB_punct_null[prev_char]) or
+ (is_glue and glue_wd <= 1) or
+ (prev_id == HLIST and prev_subtype == 3) or
+ (prev_id == TEMP) then
+ auto = false
+ end
+ end
+ local fbglue
+ local t
+ if FB_punct_thick[char] then
+ if FRdialect then
+ t = FBsp.colon.gl.ac
+ nbspace.char = FBsp.colon.ch.ac
+ else
+ t = FBsp.colon.gl.fr
+ nbspace.char = FBsp.colon.ch.fr
+ end
+ else
+ if FRdialect then
+ t = FBsp.thin.gl.ac
+ nbspace.char = FBsp.thin.ch.ac
+ else
+ t = FBsp.thin.gl.fr
+ nbspace.char = FBsp.thin.ch.fr
+ end
+ end
+ fbglue = new_glue_scaled(fid, t)
+% \end{macrocode}
+% In case |new_glue_scaled| fails (returns |nil|) the node list
+% remains unchanged.
+% \begin{macrocode}
+ if (realglue or auto) and fbglue then
+ if realglue then
+ head = remove_node(head,prev,true)
+ end
+ if (FRucsNBSP) then
+ nbspace.font = fid
+ insert_node_before(head, item, copy_node(nbspace))
+ else
+ insert_node_before(head, item, copy_node(nobreak))
+ insert_node_before(head, item, copy_node(fbglue))
+ end
+ end
+% \end{macrocode}
+% Let’s consider `»’ now (the only remaining glyph of
+% |FB_punct_left| class): we just have to remove any \emph{glue}
+% possibly preceeding `»’, then to insert the nobreak penalty and
+% the proper \emph{glue} (controlled by |\FBguillspace|).
+% This is done only if French quotes have been `activated’ by
+% options \fbo{og=«, fg=»} in \fbsetup{} and can be denied locally
+% with |\NoAutoSpacing| (this is controlled by the |SIG| flag).
+% If either a) the preceding glyph is member of |FB_guil_null|, or
+% b) `»’ is the first glyph of an |\hbox{}| or a paragraph, nothing
+% is done, this is controlled by the |addgl| flag.
+%
+% \changes{v3.1a}{2014/06/18}{Added flag addgl which must also be true
+% when prev or next is not a char (i.e. \cs{kern}0 in
+% «\cs{texttt}\{a\}»).}
+%
+% \changes{v3.1g}{2015/06/26}{flag addgl set to false for `»’
+% at the beginning of an \cs{hbox} or a paragraph or a tabular
+% `l’ and `c’ columns.}
+%
+% \begin{macrocode}
+ elseif SIG then
+ local addgl = (prev_char and not FB_guil_null[prev_char]) or
+ (not prev_char and
+ prev_id ~= TEMP and
+ not (prev_id == HLIST and prev_subtype == 3)
+ )
+% \end{macrocode}
+% Correction for tabular `c’ (glue 0 plus 1 fil) and `l’ (glue 1sp)
+% columns:
+% \begin{macrocode}
+ if is_glue and glue_wd <= 1 then
+ addgl = false
+ end
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
+ if addgl and fbglue then
+ if is_glue then
+ head = remove_node(head,prev,true)
+ end
+ if (FRucsNBSP) then
+ nbspace.font = fid
+ insert_node_before(head, item, copy_node(nbspace))
+ else
+ insert_node_before(head, item, copy_node(nobreak))
+ insert_node_before(head, item, copy_node(fbglue))
+ end
+ end
+ end
+ end
+% \end{macrocode}
+% Similarly, for `«’ (unique member of the |FB_punct_right| class):
+% unless either a) the next glyph is member of |FB_guil_null|, or
+% b) `«’ is the last glyph of an |\hbox{}| or a paragraph (then the
+% |addgl| flag is false, nothing is done), we remove any \emph{glue}
+% possibly following it and insert first the proper \emph{glue} then
+% a nobreak penalty so that finally the penalty preceeds the
+% \emph{glue}.
+%
+% \changes{v3.1a}{2014/06/18}{Look ahead when next is a kern
+% (i.e. in « \cs{texttt}\{a\} »).}
+%
+% \changes{v3.1g}{2015/06/26}{Flag addgl set to false for
+% `«’ at the end of an \cs{hbox} or a paragraph or when followed by
+% a null glue (i.e. springs).}
+%
+% \begin{macrocode}
+ if FRspacing and FB_punct_right[char]
+ and fid > 0 and SIG then
+ local next = item.next
+ local next_id, next_subtype, next_char, nextnext, kern_wd
+ if next then
+ next_id = next.id
+ next_subtype = next.subtype
+ if next_id == GLYPH then
+ next_char = next.char
+% \end{macrocode}
+% A |kern0| might hide a |glue|, so look ahead if |next| is a kern
+% (this occurs with |« \texttt{a} »|):
+% \begin{macrocode}
+ elseif next_id == KERN then
+ kern_wd = next.kern
+ if kern_wd == 0 then
+ nextnext = next.next
+ if nextnext then
+ next = nextnext
+ next_id = nextnext.id
+ next_subtype = nextnext.subtype
+ if next_id == GLYPH then
+ next_char = nextnext.char
+ end
+ end
+ end
+ end
+ end
+ local is_glue = next_id == GLUE
+ if is_glue then
+ glue_wd = next.width
+ end
+ local addgl = (next_char and not FB_guil_null[next_char]) or
+ (next and not next_char)
+% \end{macrocode}
+% Correction for tabular `c’ columns. For `r’ columns, a final
+% `«’ character needs to be coded as |\mbox{«}| for proper spacing
+% (|\NoAutoSpacing| is another option).
+% \begin{macrocode}
+ if is_glue and glue_wd == 0 then
+ addgl = false
+ end
+ local fid = item.font
+ local t = FBsp.guill.gl.fr
+ nbspace.char = FBsp.guill.ch.fr
+ if FRdialect then
+ t = FBsp.guill.gl.ac
+ nbspace.char = FBsp.guill.ch.ac
+ end
+ local fbglue = new_glue_scaled(fid, t)
+ if addgl and fbglue then
+ if is_glue then
+ head = remove_node(head,next,true)
+ end
+ if (FRucsNBSP) then
+ nbspace.font = fid
+ insert_node_after(head, item, copy_node(nbspace))
+ else
+ insert_node_after(head, item, copy_node(fbglue))
+ insert_node_after(head, item, copy_node(nobreak))
+ end
+ end
+ end
+ end
+ return head
+end
+return french_punctuation
+%</lua>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FB@luatex@punct@french}
+% As a language tag is part of glyph nodes in LuaTeX, no more
+% switching has to be done in |\extrasfrench|, setting the dialect
+% attribute has already be done (see above, p.~\pageref{extrapunct}).
+% We will just redefine |\shorthandoff| and |\shorthandon| in French
+% to issue a warning reminding the user that active characters are no
+% longer used in French with recent LuaTeX engines.
+%
+% \changes{v3.1l}{2016/02/07}{Use \cs{babel@save} to save and restore
+% \cs{shorthandon} and \cs{shorthandoff}.}
+%
+% \begin{macrocode}
+%<*french>
+\ifFB@luatex@punct
+ \newcommand*{\FB@luatex@punct@french}{%
+ \babel@save\shorthandon
+ \babel@save\shorthandoff
+ \def\shorthandoff##1{%
+ \ifx\PackageWarning\@undefined
+ \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with
+ LuaTeX,\\ use \noexpand\NoAutoSpacing
+ *inside a group* instead.}%
+ \else
+ \PackageWarning{french.ldf}{\protect\shorthandoff{;:!?} is
+ helpless with LuaTeX,\MessageBreak use \protect\NoAutoSpacing
+ \space *inside a group* instead;\MessageBreak reported}%
+ \fi}%
+ \def\shorthandon##1{}%
+ }
+ \addto\extrasfrench{\FB@luatex@punct@french}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0b}{2014/02/13}{frenchb.lua was not found by
+% Lua function dofile (not kpathsea aware).
+% Call function kpse.find\_file first, as suggested by Paul Gaborit.}
+%
+% \changes{v3.1g}{2015/06/17}{Lua function french\_punctuation is now
+% inserted at the end of the `kerning’ callback (no priority)
+% instead of `hpack\_filter’ and `pre\_linebreak\_filter’.}
+%
+% The next definition will be used to activate Lua punctuation: it
+% loads \file{frenchb.lua} and adds function |french_punctuation|
+% at the end of the |kerning| callback (no priority).
+% \begin{macrocode}
+ \def\activate@luatexpunct{%
+ \directlua{%
+ FR_fr = \the\l@french ; FR_ca = \the\l@acadian ;
+ local path = kpse.find_file("frenchb.lua", "lua")
+ if path then
+ local f = dofile(path)
+ luatexbase.add_to_callback("kerning",
+ f, "frenchb.french_punctuation")
+ else
+ texio.write_nl('')
+ texio.write_nl('*****************************')
+ texio.write_nl('Error: frenchb.lua not found.')
+ texio.write_nl('*****************************')
+ texio.write_nl('')
+ end
+ }%
+ }
+\fi
+% \end{macrocode}
+% End of specific code for punctuation with LuaTeX engines.
+%
+% \subsubsection{Punctuation with XeTeX}
+% \label{sssec-punct-xetex}
+%
+% If |\XeTeXinterchartokenstate| is available, we use the
+% ``inter char’’ mechanism to provide correct spacing in French
+% before the four characters |;| |!| |?| and |:|. The basis of the
+% following code was borrowed from the \pkg{polyglossia} package,
+% see \file{gloss-french.ldf}. We use the same mechanism for French
+% quotes (\texttt{«} and \texttt{»}), when automatic spacing for
+% quotes is required by options \fbo{og=«} and \fbo{fg=»} in
+% \fbsetup{} (see section~\ref{ssec-keyval}).
+%
+% The default value for |\XeTeXcharclass| is 0 for characters tokens
+% and |\FB@nonchar| for all other tokens (glues, kerns, math and box
+% boundaries, etc.).
+% These defaults should not be changed otherwise the spacing before
+% the `high punctuation’ characters and inside quotes might not be
+% correct.
+%
+% We switch |\XeTeXinterchartokenstate| to 1 and change the
+% |\XeTeXcharclass| values of |;| |!| |?| |:| |(| |]|
+% \texttt{«} and \texttt{»} when
+% entering French. Special care is taken to restore them to their
+% inital values when leaving French.
+%
+% \changes{v2.5d}{2011/01/19}{Moved the \cs{newcount} command outside
+% \cs{ifFB@xetex@punct} ... \cs{fi} (it broke Plain formats).}
+%
+% \changes{v3.1g}{2015/06/14}{Use Babel defined loops \cs{bbl@for}
+% instead of \cs{@for} borrowed from file ltcntrl.dtx
+% (\cs{@for} is undefined in Plain).}
+%
+% The following part holds specific code for punctuation with XeTeX
+% engines.
+%
+% \begin{macrocode}
+\ifFB@xetex@punct
+ \ifLaTeXe
+ \PackageInfo{french.ldf}{No need for active punctuation characters%
+ \MessageBreak with this version of XeTeX!%
+ \MessageBreak reported}
+ \else
+ \fb@info{No need for active punctuation characters\\
+ with this version of XeTeX!}
+ \fi
+% \end{macrocode}
+%
+% \changes{v2.5i}{2012/04/20}{Temporary fix: as long as
+% \file{xeCJK.sty} will not use \cs{newXeTeXintercharclass} to
+% allocate its classes, we will have to define 3 fake classes.}
+%
+% \changes{v2.5j}{2012/05/08}{Previous fix removed: bug fixed in
+% \file{xeCJK.sty} version 3.0.4 (06-May-2012).}
+%
+% \changes{v2.6g}{2013/12/09}{U+00A0 (Unicode nobreakspace) and U+202F
+% (Unicode nobreakthinspace) added to class \cs{FB@punctnul}
+% to prevent frenchb from adding it’s own space before `high
+% punctuation’ characters.}
+%
+% \changes{v2.6h}{2014/01/03}{New class \cs{FB@guilnul} for characters
+% U+00A0 (Unicode nobreakspace) and U+202F (Unicode
+% nobreakthinspace), to prevent frenchb from adding spurious spaces
+% inside quotes.}
+%
+% Six new character classes are defined for \frenchb.
+% \begin{macrocode}
+ \newXeTeXintercharclass\FB@punctthick
+ \newXeTeXintercharclass\FB@punctthin
+ \newXeTeXintercharclass\FB@punctnul
+ \newXeTeXintercharclass\FB@guilo
+ \newXeTeXintercharclass\FB@guilf
+ \newXeTeXintercharclass\FB@guilnul
+% \end{macrocode}
+%
+% \changes{v3.1l}{2016/02/07}{Add a variant of \cs{babel@savevariable}
+% to save \cs{XeTeXcharclass}(es) in a loop.}
+%
+% As |\babel@savevariable| doesn’t work inside a |\bbl@for| loop,
+% we define a variant to save the |\XeTeXcharclass| values which
+% will be modified in French.
+% \begin{macrocode}
+ \def\FBsavevariable@loop#1#2{\begingroup
+ \toks@\expandafter{\originalTeX #1}%
+ \edef\x{\endgroup
+ \def\noexpand\originalTeX{\the\toks@ #2=\the#1#2\relax}}%
+ \x}
+% \end{macrocode}
+% |\FB@charlist| holds the all list of characters which have their
+% |\XeTeXcharclass| value modified in French: the first set includes
+% high punctuation, French quotes, opening delimiters and no-break
+% spaces \\[5pt]
+% \begin{tabular}{*{10}{|c}|}\hline
+% "21 &"3A &"3B &"3F &"AB &"BB &"28 &"5B &"A0 &"202F
+% \\ \hline
+% \char"21 &\char"3A &\char"3B &\char"3F & « & »
+% &\char"28 &\char"5B & & \\ \hline
+% \end{tabular}\\[5pt]
+% the second one holds those which need resetting in French when
+% \file{xeCJK.sty} is in use\\[5pt]
+% \begin{tabular}{*{12}{|c}|}\hline
+% "29 &"5D &"7B &"7D &"2C &"2D &"2E &"22 &"25 &"27 &"60 &"2019
+% \\ \hline
+% \char"29 &\char"5D &\char"7B &\char"7D &\char"2C &\char"2D
+% &\char"2E &\char"22 &\char"25 &\textquotesingle &\char"60
+% &\char"27 \\ \hline
+% \end{tabular}
+%
+% \begin{macrocode}
+ \def\FB@charlist{"21,"3A,"3B,"3F,"AB,"BB,"28,"5B,"A0,"202F,%
+ "29,"5D,"7B,"7D,"2C,"2D,"2E,"22,"25,"27,"60,"2019}
+% \end{macrocode}
+%
+% \begin{macro}{\FB@xetex@punct@french}
+% The following command will be executed when entering French, it
+% first saves the values to be modified, then fits them to our
+% needs. It also redefines |\shorthandoff| and |\shorthandon|
+% (locally) to avoid error messages with XeTeX-based engines.
+%
+% \changes{v2.5g}{2011/12/31}{XeTeXcharclass(es) for French quotes will
+% be set to \cs{FB@guilo} and \cs{FB@guilf} by options
+% `og’ and `fg’ in \cs{frenchbsetup}. French quotes should behave
+% as normal characters by default in XeLaTeX as in LaTeX.}
+%
+% \changes{v2.5i}{2012/04/20}{\file{xeCJK.sty} changes the
+% \cs{XeTeXcharclass} of ASCII chars `-’ `,’ `.’ `)’ `]’ `\}’
+% `\{’ `\%’ opening and closing single and double quotes.
+% We set their class to 0 in French and reset their class
+% to their original value when leaving French. See
+% \cs{FB@xetex@punct@nonfrench} below.}
+%
+% \changes{v3.1k}{2015/12/05}{Thin glues (less than 1sp) should not
+% trigger space insertion before high ponctuation. Add a check on
+% \cs{lastkip}.}
+%
+% \changes{v3.1l}{2016/02/07}{Save and restore
+% \cs{XeTeXinterchartokenstate}, \cs{shorthandon}, \cs{shorthandoff}
+% using \cs{babel@savevariable} and \cs{babel@save},
+% \cs{XeTeXcharclass}(es) using \cs{FB@savevariable@loop}.}
+%
+% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to all
+% \cs{XeTeXinterchartoks} commands.}
+%
+% \begin{macrocode}
+ \newcommand*{\FB@xetex@punct@french}{%
+ \babel@savevariable{\XeTeXinterchartokenstate}%
+ \babel@save{\shorthandon}%
+ \babel@save{\shorthandoff}%
+ \bbl@for\FB@char\FB@charlist
+ {\FBsavevariable@loop{\XeTeXcharclass}{\FB@char}}%
+ \def\shorthandoff##1{%
+ \ifx\PackageWarning\@undefined
+ \fb@warning{\noexpand\shorthandoff{;:!?} is helpless with
+ XeTeX,\\ use \noexpand\NoAutoSpacing
+ *inside a group* instead.}%
+ \else
+ \PackageWarning{french.ldf}{\protect\shorthandoff{;:!?} is
+ helpless with XeTeX,\MessageBreak use \protect\NoAutoSpacing
+ \space *inside a group* instead;\MessageBreak reported}%
+ \fi}%
+ \def\shorthandon##1{}%
+% \end{macrocode}
+% Let’s now set the classes and interactions between classes.
+% When false, the flag |\ifFB@spacing| switches off any interaction
+% between classes (this flag is controlled by user-level command
+% |\NoAutoSpacing|; this flag is also set to false when the current
+% font is a typewriter font).
+% \begin{macrocode}
+ \XeTeXinterchartokenstate=1
+ \XeTeXcharclass `\: = \FB@punctthick
+ \XeTeXinterchartoks \z@ \FB@punctthick = {%
+ \ifFB@spacing\ifhmode\FDP@colonspace\fi\fi}%
+ \XeTeXinterchartoks \FB@guilf \FB@punctthick = {%
+ \ifFB@spacing\FDP@colonspace\fi}%
+% \end{macrocode}
+% Small glues such as ``glue 1sp’’ in tabular `l’ columns or ``glue
+% 0 plus 1 fil’’ in tabular `c’ columns or \env{lstlisting}
+% environment should not trigger any extra space; they will still do
+% when \fbo{AutoSpacePunctuation} is true: unfortunately
+% |\XeTeXcharclass=\FB@nonchar| isn’t specific to glue tokens (this
+% class includes box and math boundaries f.i.), so the |\else| part
+% cannot be omitted.
+% \begin{macrocode}
+ \XeTeXinterchartoks \FB@nonchar \FB@punctthick = {%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBcolonspace
+ \else
+ \FDP@colonspace
+ \fi
+ \fi
+ \fi}%
+ \bbl@for\FB@char
+ {`\;,`\!,`\?}%
+ {\XeTeXcharclass\FB@char=\FB@punctthin}%
+ \XeTeXinterchartoks \z@ \FB@punctthin = {%
+ \ifFB@spacing\ifhmode\FDP@thinspace\fi\fi}%
+ \XeTeXinterchartoks \FB@guilf \FB@punctthin = {%
+ \ifFB@spacing\FDP@thinspace\fi}%
+ \XeTeXinterchartoks \FB@nonchar \FB@punctthin = {%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBthinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \fi}%
+ \XeTeXinterchartoks \FB@guilo \z@ = {%
+ \ifFB@spacing\FB@guillspace\fi}%
+ \XeTeXinterchartoks \FB@guilo \FB@nonchar = {%
+ \ifFB@spacing\FB@guillspace\ignorespaces\fi}%
+ \XeTeXinterchartoks \z@ \FB@guilf = {%
+ \ifFB@spacing\FB@guillspace\fi}%
+ \XeTeXinterchartoks \FB@punctthin \FB@guilf = {%
+ \ifFB@spacing\FB@guillspace\fi}%
+ \XeTeXinterchartoks \FB@nonchar \FB@guilf = {%
+ \ifFB@spacing\unskip\FB@guillspace\fi}%
+% \end{macrocode}
+% This will avoid spurious spaces in (!), [?] and with Unicode
+% non-breaking spaces (U+00A0, U+202F):
+% \begin{macrocode}
+ \bbl@for\FB@char
+ {`\[,`\(,"A0,"202F}%
+ {\XeTeXcharclass\FB@char=\FB@punctnul}%
+% \end{macrocode}
+% These characters have their class changed by \file{xeCJK.sty},
+% let’s reset them to 0 in French.
+% \begin{macrocode}
+ \bbl@for\FB@char
+ {`\{,`\,,`\.,`\-,`\),`\],`\},`\%,"22,"27,"60,"2019}%
+ {\XeTeXcharclass\FB@char=\z@}%
+ }
+ \addto\extrasfrench{\FB@xetex@punct@french}
+% \end{macrocode}
+% \end{macro}
+%
+% End of specific code for punctuation with modern XeTeX engines.
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Punctuation with standard (pdf)TeX}
+% \label{sssec-punct-tex}
+%
+% In standard (pdf)TeX we need to make the four characters |;| |!| |?|
+% and |:| `active’ and provide their definitions.
+% \begin{macrocode}
+\ifFB@active@punct
+ \initiate@active@char{:}%
+ \initiate@active@char{;}%
+ \initiate@active@char{!}%
+ \initiate@active@char{?}%
+% \end{macrocode}
+% We first tune the amount of space before \texttt{;}
+% \texttt{!} \texttt{?} and \texttt{:}. This should only happen
+% in horizontal mode, hence the test |\ifhmode|.
+%
+% In horizontal mode, if a space has been typed before `;’ we
+% remove it and put a non-breaking |\FBthinspace| instead.
+% If no space has been typed, we add |\FDP@thinspace| which will be
+% defined, up to the user’s wishes, as a non-breaking |\FBthinspace|
+% or as |\@empty|.
+%
+% \changes{v3.1k}{2015/12/05}{(pdfTeX shorthands) test on \cs{lastskip}
+% changed from 0pt to 1sp for active punctuation for consistency
+% with XeTeX and LuaTeX.}
+%
+% \changes{v3.2c}{2016/05/14}{Switch \cs{ifFB@spacing} added to the
+% four French shorthands.}
+%
+% \begin{macrocode}
+ \declare@shorthand{french}{;}{%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBthinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+% Now we can insert a |;| character.
+% \begin{macrocode}
+ \string;}
+% \end{macrocode}
+% The next three definitions are very similar.
+% \begin{macrocode}
+ \declare@shorthand{french}{!}{%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBthinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \fi
+ \string!}
+ \declare@shorthand{french}{?}{%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBthinspace
+ \else
+ \FDP@thinspace
+ \fi
+ \fi
+ \fi
+ \string?}
+ \declare@shorthand{french}{:}{%
+ \ifFB@spacing
+ \ifhmode
+ \ifdim\lastskip>1sp
+ \unskip\penalty\@M\FBcolonspace
+ \else
+ \FDP@colonspace
+ \fi
+ \fi
+ \fi
+ \string:}
+% \end{macrocode}
+% When the active characters appear in an environment where their
+% French behaviour is not wanted they should give an `expected’
+% result. Therefore we define shorthands at system level as well.
+% \begin{macrocode}
+ \declare@shorthand{system}{:}{\string:}
+ \declare@shorthand{system}{!}{\string!}
+ \declare@shorthand{system}{?}{\string?}
+ \declare@shorthand{system}{;}{\string;}
+%}
+% \end{macrocode}
+% We specify that the French group of shorthands should be used when
+% switching to French.
+% \begin{macrocode}
+ \addto\extrasfrench{\languageshorthands{french}%
+% \end{macrocode}
+% These characters are `turned on’ once, later their definition may
+% vary. Don’t misunderstand the following code: they keep being
+% active all along the document, even when leaving French.
+% \begin{macrocode}
+ \bbl@activate{:}\bbl@activate{;}%
+ \bbl@activate{!}\bbl@activate{?}%
+ }
+ \addto\noextrasfrench{%
+ \bbl@deactivate{:}\bbl@deactivate{;}%
+ \bbl@deactivate{!}\bbl@deactivate{?}%
+ }
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Punctuation switches common to all engines}
+% \label{sssec-punct-switches}
+%
+% A new `if’ |\ifFBAutoSpacePunctuation| needs to be defined now to
+% control the two possible ways of dealing with `high punctuation’.
+% it’s default value is true, but it can be set to false by
+% \fbsetup{AutoSpacePunctuation=false} for finer control.
+% \begin{macrocode}
+\newif\ifFBAutoSpacePunctuation \FBAutoSpacePunctuationtrue
+% \end{macrocode}
+%
+% \begin{macro}{\AutoSpaceBeforeFDP}
+% \begin{macro}{\NoAutoSpaceBeforeFDP}
+%
+% \changes{v2.3a}{2008/10/10}{\cs{NoAutoSpaceBeforeFDP} and
+% \cs{AutoSpaceBeforeFDP} now set the flag
+% \cs{ifFBAutoSpacePunctuation} accordingly (LaTeX only).}
+%
+% \changes{v2.3e}{2009/10/10}{Execute \cs{AutoSpaceBeforeFDP}
+% also in LaTeX to define \cs{FDP@colonspace}: needed for
+% tex4ht, pointed out by MPG.}
+%
+% |\autospace@beforeFDP| and |\noautospace@beforeFDP| are internal
+% commands. |\autospace@beforeFDP| defines |\FDP@thinspace| and
+% |\FDP@colonspace| as non-breaking spaces and sets LuaTeX attribute
+% |\FB@addDPspace| to 1 (true), while |\noautospace@beforeFDP|
+% lets these spaces empty and sets flag |\FB@addDPspace|
+% to 0 (false). User commands |\AutoSpaceBeforeFDP| and
+% |\NoAutoSpaceBeforeFDP| do the same and take care of the flag
+% |\ifFBAutoSpacePunctuation| in \LaTeX{}.
+% Set the default now for Plain (done later for LaTeX).
+% \begin{macrocode}
+\def\autospace@beforeFDP{%
+ \ifFB@luatex@punct\FB@addDPspace=1 \fi
+ \def\FDP@thinspace{\penalty\@M\FBthinspace}%
+ \def\FDP@colonspace{\penalty\@M\FBcolonspace}}
+\def\noautospace@beforeFDP{%
+ \ifFB@luatex@punct\FB@addDPspace=0 \fi
+ \let\FDP@thinspace\@empty
+ \let\FDP@colonspace\@empty}
+\ifLaTeXe
+ \def\AutoSpaceBeforeFDP{\autospace@beforeFDP
+ \FBAutoSpacePunctuationtrue}
+ \def\NoAutoSpaceBeforeFDP{\noautospace@beforeFDP
+ \FBAutoSpacePunctuationfalse}
+ \AtEndOfPackage{\AutoSpaceBeforeFDP}
+\else
+ \let\AutoSpaceBeforeFDP\autospace@beforeFDP
+ \let\NoAutoSpaceBeforeFDP\noautospace@beforeFDP
+ \AutoSpaceBeforeFDP
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v2.3a}{2008/10/10}{In LaTeX, frenchb no longer adds spaces
+% before `high punctuation’ characters in computer code.
+% Suggested by Yannis Haralambous.}
+%
+% \begin{macro}{\rmfamilyFB}
+% \begin{macro}{\sffamilyFB}
+% \begin{macro}{\ttfamilyFB}
+%
+% \changes{v2.3c}{2009/02/07}{Commands \cs{ttfamily}, \cs{rmfamily}
+% and \cs{sffamily} have to be robust. Bug introduced in 2.3a,
+% pointed out by Manuel Pégourié-Gonnard.}
+%
+% In LaTeX2e |\ttfamily| (and hence |\texttt|) will be redefined
+% `AtBeginDocument’ as |\ttfamilyFB| so that no space
+% is added before the four |; : ! ?| characters, even if
+% \fbo{AutoSpacePunctuation} is \fbo{true}. When
+% \fbo{AutoSpacePunctuation} is \fbo{false}, the eventually typed
+% spaces are left unchanged (not turned into thin spaces, no penalty
+% added). |\rmfamily| and |\sffamily| need to be redefined also
+% (|\ttfamily| is not always used inside a group, its effect can be
+% cancelled by |\rmfamily| or |\sffamily|).
+%
+% These redefinitions can be canceled if necessary, for instance to
+% recompile older documents, see option \fbo{OriginalTypewriter}
+% below.
+%
+% \changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel
+% automatic spaces inside French guillemets entered as characters
+% (see \cs{frenchbsetup}).}
+%
+% \changes{v3.2c}{2016/05/14}{New definitions of \cs{ttfamilyFB} and
+% co, common to all engines, based on \cs{FB@spacing@off}
+% and\cs{FB@spacing@on}.}
+%
+% To be consistent with what is done for the |; : ! ?|
+% characters, |\ttfamilyFB| also switches off insertion of spaces
+% inside French guillemets \emph{when they are typed in as
+% characters} with the `og’/`fg’ options in \fbsetup{}.
+% This is also a workaround for the weird behaviour of these
+% characters in verbatim mode.
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \DeclareRobustCommand\ttfamilyFB{\FB@spacing@off \ttfamilyORI}
+ \DeclareRobustCommand\rmfamilyFB{\FB@spacing@on \rmfamilyORI}
+ \DeclareRobustCommand\sffamilyFB{\FB@spacing@on \sffamilyORI}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v2.5a}{2010/08/14}{New command \cs{NoAutoSpacing},
+% suggested by MPG.}
+%
+% \begin{macro}{\NoAutoSpacing}
+% The following command disables automatic spacing for high
+% punctuation and French quote characters; it also switches off
+% active punctuation characters (if any).
+% It is engine independent (works for TeX, LuaTeX and
+% XeTeX based engines) and is meant to be used inside a group.
+%
+% \changes{v3.2b}{2016/04/18}{\cs{NoAutoSpacing} made robust.}
+%
+% \changes{v3.2c}{2016/05/14}{New definition based on
+% \cs{FB@spacing@off} common to all engines.}
+%
+% \begin{macrocode}
+\DeclareRobustCommand*{\NoAutoSpacing}{%
+ \FB@spacing@off
+ \ifFB@active@punct\shorthandoff{;:!?}\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Commands for French quotation marks}
+% \label{ssec-quotes}
+%
+% \begin{macro}{\guillemotleft}
+% \begin{macro}{\guillemotright}
+% \begin{macro}{\textquoteddblleft}
+% \begin{macro}{\textquoteddblright}
+% pdfLaTeX users are supposed to use 8-bit output
+% encodings (T1, LY1,\dots) to typeset French, those who still
+% stick to OT1 should load \pkg{aeguill} or a similar package.
+% In both cases the commands |\guillemotleft| and |\guillemotright|
+% will print the French opening and closing quote characters from
+% the output font.
+% For XeLaTeX and LuaLaTeX, |\guillemotleft| and |\guillemotright|
+% are defined by package \pkg{fontspec} (v.~2.5d and up).
+%
+% \changes{v2.5a}{2010/08/20}{Change \cs{guillemotleft} and
+% \cs{guillemotright} definitions for Unicode anf provide
+% definitions for \cs{textquotedblleft} and
+% \cs{textquotedbright}. Insures correct printing of quotes
+% by \cs{og} and \cs{fg} in French and outside.}
+%
+% We provide the following definitions for non-LaTeX users only as
+% fall-back, they are welcome to change them for anything better.
+% \begin{macrocode}
+\ifLaTeXe
+\else
+ \ifFBunicode
+ \def\guillemotleft{{\char"00AB}}
+ \def\guillemotright{{\char"00BB}}
+ \def\textquotedblleft{{\char"201C}}
+ \def\textquotedblright{{\char"201D}}
+ \else
+ \def\guillemotleft{\leavevmode\raise0.25ex
+ \hbox{$\scriptscriptstyle\ll$}}
+ \def\guillemotright{\raise0.25ex
+ \hbox{$\scriptscriptstyle\gg$}}
+ \def\textquotedblleft{``}
+ \def\textquotedblright{''}
+ \fi
+ \let\xspace\relax
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.4a}{2018/01/18}{New \cs{FBgspchar} to customise the
+% space character to be used for \cs{og} and\cs{fg} with the
+% UnicodeNoBreakSpaces option.}
+%
+% \begin{macro}{\FBgspchar}
+% \begin{macro}{\FB@og}
+% \begin{macro}{\FB@fg}
+% The next step is to provide correct spacing after `«’ and before
+% `»’; no line break is allowed neither \emph{after} the opening
+% one, nor \emph{before} the closing one.
+% French quotes (including spacing) are printed by |\FB@og| and
+% |\FB@fg|, the expansion of the top level commands |\og| and |\og|
+% is different in and outside French.
+%
+% \changes{v3.0a}{2014/01/10}{Definitions of \cs{FB@og} and \cs{FB@fg}
+% now depend on punctuation handling (LuaTeX / XeTeX / active).}
+%
+% The definitions of |\FB@og| and |\FB@fg| need some engine-dependent
+% tuning: for LuaTeX, |\FB@spacing| is set to~0 locally to prevent
+% the quotes characters from adding space when option
+% \fbo{og=«, fg=»} is set.
+% \begin{macrocode}
+\newcommand*{\FB@guillspace}{\penalty\@M\FBguillspace}
+\newcommand*{\FBgspchar}{\char"A0\relax}
+\newif\ifFBucsNBSP
+\ifFB@luatex@punct
+ \DeclareRobustCommand*{\FB@og}{\leavevmode
+ \bgroup\FB@spacing=0 \guillemotleft\egroup
+ \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi}
+ \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
+ \ifFBucsNBSP\FBgspchar\else\FB@guillspace\fi
+ \bgroup\FB@spacing=0 \guillemotright\egroup}
+\fi
+% \end{macrocode}
+% With XeTeX, |\ifFB@spacing| is set to |false| locally for the
+% same reason.
+% \begin{macrocode}
+\ifFB@xetex@punct
+ \DeclareRobustCommand*{\FB@og}{\leavevmode
+ \bgroup\FB@spacingfalse\guillemotleft\egroup
+ \FB@guillspace}
+ \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
+ \FB@guillspace
+ \bgroup\FB@spacingfalse\guillemotright\egroup}
+\fi
+\ifFB@active@punct
+ \DeclareRobustCommand*{\FB@og}{\leavevmode
+ \guillemotleft
+ \FB@guillspace}
+ \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi
+ \FB@guillspace
+ \guillemotright}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\og}
+% \begin{macro}{\fg}
+%
+% The user level macros for quotation marks are named |\og|
+% (``\underline{o}uvrez \underline{g}uillemets’’) and |\fg|
+% (``\underline{f}ermez \underline{g}uillemets’’).
+% Another option for typesetting quotes in French is to use the
+% command |\frquote| (see below).
+% Dummy definition of |\og| and |\fg| just to ensure that this
+% commands are not yet defined.
+% \begin{macrocode}
+\newcommand*{\og}{\@empty}
+\newcommand*{\fg}{\@empty}
+% \end{macrocode}
+%
+% The definitions of |\og| and |\fg| for quotation marks are
+% switched on and off through the |\extrasfrench| |\noextrasfrench|
+% mechanism. Outside French, |\og| and |\fg| will typeset standard
+% English opening and closing double quotes.
+% We’ll try to be smart to users of David~Carlisle’s \pkg{xspace}
+% package: if this package is loaded there will be no need for |{}|
+% or |\ | to get a space after |\fg|, otherwise |\xspace| will be
+% defined as |\relax| (done at the end of this file).
+%
+% \changes{v2.5a}{2010/08/20}{\cs{og} and \cs{fg} do not print
+% correctly in English when using XeTeX or LuaTeX, fixed by using
+% \cs{textquotedblleft} and \cs{textquotedblright} defined above.}
+%
+% \changes{v3.2a}{2016/03/18}{\cs{xspace} moved from \cs{FB@fg} to
+% \cs{fg}: \cs{xspace} messes up \cs{frquote}, pointed out by Sonia
+% Labetoulle. As a side effect \cs{xspace} is now active in \cs{fg}
+% in and outside French.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \def\bbl@frenchguillemets{%
+ \renewcommand*{\og}{\FB@og}%
+ \renewcommand*{\fg}{\FB@fg\xspace}}
+ \renewcommand*{\og}{\textquotedblleft}
+ \renewcommand*{\fg}{\ifdim\lastskip>\z@\unskip\fi
+ \textquotedblright\xspace}
+\else
+ \def\bbl@frenchguillemets{\let\og\FB@og
+ \let\fg\FB@fg}
+ \def\og{\textquotedblleft}
+ \def\fg{\ifdim\lastskip>\z@\unskip\fi\textquotedblright}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.0a}{2014/01/10}{\cs{bbl@nonfrenchguillemets} deleted,
+% use \cs{babel@save} instead.}
+%
+% \begin{macrocode}
+\addto\extrasfrench{\babel@save\og \babel@save\fg \bbl@frenchguillemets}
+% \end{macrocode}
+%
+% \changes{v3.1a}{2014/05/20}{New command \cs{frquote} for imbedded or
+% long French quotations.}
+%
+% \begin{macro}{\frquote}
+% Another way of entering French quotes relies on |\frquote{}|
+% with supports up to two levels of quotes.
+% Let’s define the default quote characters to be used for level one
+% or two of quotes\dots{}
+% \begin{macrocode}
+\newcommand*{\ogi}{\FB@og}
+\newcommand*{\fgi}{\FB@fg}
+\newcommand*{\@ogi}{\ifmmode\hbox{\ogi}\else\ogi\fi}
+\newcommand*{\@fgi}{\ifmmode\hbox{\fgi}\else\fgi\fi}
+\newcommand*{\ogii}{\textquotedblleft}
+\newcommand*{\fgii}{\textquotedblright}
+\newcommand*{\@ogii}{\ifmmode\hbox{\ogii}\else\ogii\fi}
+\newcommand*{\@fgii}{\ifmmode\hbox{\fgii}\else\fgii\fi}
+% \end{macrocode}
+% and the needed technical stuff to handle options:
+%
+% \changes{v3.2g}{2017/01/30}{Default options of \cs{frquote} are no
+% longer engine-dependent.}
+%
+% \changes{v3.5b}{2018/07/15}{New command \cs{FB@addquote@everypar} to
+% manage \cs{everypar}: \cs{frquote} failed when used immediately
+% after a sectionning command.}
+%
+% \begin{macrocode}
+\newcount\FBguill@level
+\newtoks\FBold@everypar
+% \end{macrocode}
+% |\FB@addquote@everypar| was borrowed from \file{csquotes.sty}.
+% \begin{macrocode}
+\def\FB@addquote@everypar{%
+ \let\FBnew@everypar\everypar
+ \FBold@everypar=\expandafter{\the\everypar}%
+ \FBnew@everypar={\the\FBold@everypar\FBeverypar@quote}%
+ \let\everypar\FBold@everypar
+ \let\FB@addquote@everypar\relax
+}
+\newif\ifFBcloseguill \FBcloseguilltrue
+\newif\ifFBInnerGuillSingle
+\def\FBguillopen{\bgroup\NoAutoSpacing\guillemotleft\egroup}
+\def\FBguillclose{\bgroup\NoAutoSpacing\guillemotright\egroup}
+\let\FBguillnone\empty
+\let\FBeveryparguill\FBguillopen
+\let\FBeverylineguill\FBguillnone
+\let\FBeverypar@quote\relax
+\let\FBeveryline@quote\empty
+% \end{macrocode}
+% The main command |\frquote| accepts (in LaTeX2e only) a starred
+% version which suppresses the closing quote; it is meant to be used
+% for inner quotations which end together with the outer one, then
+% only one closing guillemet (the outer one) should be printed.
+% \begin{macrocode}
+\ifLaTeXe
+ \DeclareRobustCommand\frquote{%
+ \@ifstar{\FBcloseguillfalse\fr@quote}%
+ {\FBcloseguilltrue\fr@quote}}
+\else
+ \newcommand\frquote[1]{\fr@quote{#1}}
+\fi
+% \end{macrocode}
+%
+% \changes{v3.1j}{2015/11/25}{\cs{fr@quote} completely rewritten:
+% \cs{leavevmode} added and explicitly save/retore \cs{everypar} and
+% \cs{localleftbox} instead of using a group in order to ensure
+% compatibility with package wrapfig.}
+%
+% \changes{v3.1j}{2015/11/21}{\cs{PackageWarning} is undefined in
+% Plain, use \cs{fb@warning} instead.}
+%
+% \changes{v3.3a}{2017/04/30}{\cs{FB@quotespace} (kern), changed
+% into \cs{FB@guillspace}.}
+%
+% The internal command |\fr@quote| takes one (long) argument: the
+% quotation text.
+% \begin{macrocode}
+\newcommand{\fr@quote}[1]{%
+ \leavevmode
+ \advance\FBguill@level by \@ne
+ \ifcase\FBguill@level
+ \or
+% \end{macrocode}
+% This for level 1 (outer) quotations: set |\FBeverypar@quote|
+% for level 1 quotations and add it to |\everypar| using
+% |\FB@addquote@everypar|, then print the quotation:
+% \begin{macrocode}
+ \ifx\FBeveryparguill\FBguillnone
+ \else
+ \def\FBeverypar@quote{\FBeveryparguill\FB@guillspace}%
+ \FB@addquote@everypar
+ \fi
+ \@ogi #1\@fgi
+ \or
+% \end{macrocode}
+% This for level 2 (inner) quotations: Omega’s command
+% |\localleftbox| included in LuaTeX, is convenient for repeating
+% guillemets at the beginning of every line.\hlabel{cs:localleftbox}
+%
+% \changes{v3.1i}{2015/10/04}{\cs{luatexlocalleftbox} changed to
+% \cs{localleftbox} by new LaTeX release 2015/10/01.}
+%
+% \changes{v3.5c}{2018/09/14}{\cs{FBeverypar@quote}’s value now properly
+% reset across level changes.}
+%
+% \changes{v3.5e}{2019/03/23}{reset \cs{FB@addGUILspace} attribute
+% inside \cs{localleftbox} (LuaTeX).}
+%
+% \begin{macrocode}
+ \ifx\FBeverylineguill\FBguillopen
+ \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotleft
+ \FB@guillspace}%
+ \localleftbox{\FBeveryline@quote}%
+ \let\FBeverypar@quote\relax
+ \@ogi #1\ifFBcloseguill\@fgi\fi
+ \else
+ \ifx\FBeverylineguill\FBguillclose
+ \def\FBeveryline@quote{\FB@addGUILspace=0 \guillemotright
+ \FB@guillspace}%
+ \localleftbox{\FBeveryline@quote}%
+ \let\FBeverypar@quote\relax
+ \@ogi #1\ifFBcloseguill\@fgi\fi
+ \else
+% \end{macrocode}
+% otherwise we need to redefine |\FBeverypar@quote| (and eventually
+% |\ogii|, |\fgii|) for level 2 quotations:
+% \begin{macrocode}
+ \let\FBeverypar@quote\relax
+ \ifFBInnerGuillSingle
+ \def\ogii{\leavevmode
+ \guilsinglleft\FB@guillspace}%
+ \def\fgii{\ifdim\lastskip>\z@\unskip\fi
+ \FB@guillspace\guilsinglright}%
+ \ifx\FBeveryparguill\FBguillopen
+ \def\FBeverypar@quote{\guilsinglleft\FB@guillspace}%
+ \fi
+ \ifx\FBeveryparguill\FBguillclose
+ \def\FBeverypar@quote{\guilsinglright\FB@guillspace}%
+ \fi
+ \fi
+ \@ogii #1\ifFBcloseguill \@fgii \fi
+ \fi
+ \fi
+ \else
+% \end{macrocode}
+% Warn if |\FBguill@level| >~2:
+% \begin{macrocode}
+ \ifx\PackageWarning\@undefined
+ \fb@warning{\noexpand\frquote\space handles up to
+ two levels.\\ Quotation not printed.}%
+ \else
+ \PackageWarning{french.ldf}{%
+ \protect\frquote\space handles up to two levels.
+ \MessageBreak Quotation not printed. Reported}
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \changes{v3.5e}{2019/03/14}{Make resettings global on exit.}
+%
+% Closing: step down |\FBguill@level| and clean on exit.
+% Changes made global in case |\frquote{}| ends inside an
+% environment.
+% \begin{macrocode}
+ \global\advance\FBguill@level by \m@ne
+ \ifcase\FBguill@level \global\let\FBeverypar@quote\relax
+ \or \gdef\FBeverypar@quote{\FBeveryparguill\FB@guillspace}%
+ \global\let\FBeveryline@quote\empty
+ \ifx\FBeverylineguill\FBguillnone\else\localleftbox{}\fi
+ \fi
+}
+% \end{macrocode}
+% \changes{v3.5e}{2019/03/14}{new command \cs{NoEveryParQuote}.}
+%
+% The next command is intended to be used in list environments to
+% suppress quotes which might be added by |\FBeverypar@quote| after
+% items for instance.
+% \begin{macrocode}
+\newcommand*{\NoEveryParQuote}{\let\FBeveryparguill\FBguillnone}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Date in French}
+% \label{sssec-date}
+%
+% \begin{macro}{\frenchtoday}
+% \begin{macro}{\frenchdate}
+% \begin{macro}{\datefrench}
+% The following code creates a macro |\datefrench| which in turn
+% defines command |\frenchtoday| (|\today| is defined as
+% |\frenchtoday| in French).
+% The corresponding commands for the French dialect, |\dateacadian|
+% and |\acadiantoday| are also created btw.
+% This new implementation relies on commands |\SetString| and
+% |\SetStringLoop|, therefore requires \babel~3.10 or newer.
+%
+% \changes{v2.0}{2006/11/06}{2 `\cs{relax}’ added in
+% \cs{today}’s definition.}
+%
+% \changes{v2.1a}{2008/03/25}{\cs{today} changed (correction in 2.0
+% was wrong: \cs{today} was printed without spaces in toc).}
+%
+% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString}
+% commands for \cs{datefrench}. Doesn’t work with Plain (yet?).}
+%
+% \changes{v3.4a}{2018/01/04}{Specific code for Plain finally removed
+% (babel bug reported).}
+%
+% \changes{v3.4b}{2018/02/04}{Do not redefine \cs{date} as
+% \cs{frenchdate} in French.}
+%
+% Explicitly defining |\BabelLanguages| as the list of all French
+% dialects defines \emph{both} |\datefrench| and |\dateacadian|;
+% this is required as \file{french.ldf} is read only once even if
+% both language options \opt{french} and \opt{acadian} are supplied
+% to \babel. Note that coding |\StartBabelCommands*{french,acadian}|
+% would \emph{only} define |\csname date\CurrentOption\endcsname|,
+% leaving the second language undefined in \babel’s sens.
+% \begin{macrocode}
+\def\BabelLanguages{french,acadian}
+\StartBabelCommands*{\BabelLanguages}{date}
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
+ \SetString\monthiiname{février}
+ \SetString\monthviiiname{août}
+ \SetString\monthxiiname{décembre}
+\StartBabelCommands*{\BabelLanguages}{date}
+ \SetStringLoop{month#1name}{%
+ janvier,f\'evrier,mars,avril,mai,juin,juillet,%
+ ao\^ut,septembre,octobre,novembre,d\'ecembre}
+ \SetString\today{\FB@date{\year}{\month}{\day}}
+\EndBabelCommands
+% \end{macrocode}
+% |\frenchdate| (which produces an unbreakable string) and
+% |\frenchtoday| (breakable) both rely on |\FB@date|, the inner
+% group is needed for |\hbox|.
+% \begin{macrocode}
+\newcommand*{\FB@date}[3]{%
+ {{\number#3}\ifnum1=#3{\ier}\fi\FBdatespace
+ \csname month\romannumeral#2name\endcsname
+ \ifx#1\@empty\else\FBdatespace\number#1\fi}}
+\newcommand*{\FBdatebox}{\hbox}
+\newcommand*{\FBdatespace}{\space}
+\newcommand*{\frenchdate}{\FBdatebox\FB@date}
+\newcommand*{\acadiandate}{\FBdatebox\FB@date}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Extra utilities}
+%
+% Let’s provide the French user with some extra utilities.
+%
+% \changes{v2.1a}{2008/03/24}{Command \cs{fup} added to produce
+% better superscripts than \cs{textsuperscript}.}
+%
+% \begin{macro}{\up}
+%
+% \changes{v2.1c}{2008/04/29}{Provide a temporary definition
+% (hyperref safe) of \cs{up} in case it has to be expanded in
+% the preamble (by beamer’s \cs{title} command for instance).}
+%
+% \changes{v2.4d}{2010/07/28}{Command \cs{up} defined with
+% \cs{providecommand} instead of \cs{newcommand} as \cs{up} may be
+% defined elsewhere (catalan.ldf).
+% Bug pointed out by Felip Manyé i Ballester.}
+%
+% \begin{macro}{\fup}
+%
+% \changes{v2.1b}{2008/04/02}{Command \cs{fup} changed to use
+% real superscripts from fourier v.~1.6.}
+%
+% \changes{v2.2a}{2008/05/08}{\cs{newif} and \cs{newdimen} moved
+% before \cs{ifLaTeXe} to avoid an error with plainTeX.}
+%
+% \changes{v2.3a}{2008/09/30}{\cs{lowercase} changed to
+% \cs{MakeLowercase} as the former doesn’t work for non ASCII
+% characters in encodings like applemac, utf-8,\dots}
+%
+% |\up| eases the typesetting of superscripts like
+% `1\up{er}’. Up to version 2.0 of \frenchb{} |\up| was just a
+% shortcut for |\textsuperscript| in LaTeX2e, but several users
+% complained that |\textsuperscript| typesets superscripts
+% too high and too big, so we now define |\fup| as an attempt to
+% produce better looking superscripts. |\up| is defined as |\fup|
+% but \fbsetup{FrenchSuperscripts=false} redefines |\up|
+% as |\textsuperscript| for compatibility with previous versions.
+%
+% When a font has built-in superscripts, the best thing to do is
+% to just use them, otherwise |\fup| has to simulate superscripts
+% by scaling and raising ordinary letters. Scaling is done using
+% package \pkg{scalefnt} which will be loaded at the end of
+% \babel’s loading (\frenchb{} being an option of \babel, it cannot
+% load a package while being read).
+%
+% \begin{macrocode}
+\newif\ifFB@poorman
+\newdimen\FB@Mht
+\ifLaTeXe
+ \AtEndOfPackage{\RequirePackage{scalefnt}}
+% \end{macrocode}
+% |\FB@up@fake| holds the definition of fake superscripts.
+% The scaling ratio is 0.65, raising is computed to put the top of
+% lower case letters (like `m’) just under the top of upper case
+% letters (like `M’), precisely 12\% down. The chosen settings
+% look correct for most fonts, but can be tuned by the end-user
+% if necessary by changing |\FBsupR| and |\FBsupS| commands.
+%
+% |\FB@lc| is defined as |\MakeLowercase| to inhibit the uppercasing
+% of superscripts (this may happen in page headers with the standard
+% classes but is wrong); |\FB@lc| can be redefined to do nothing
+% by option \fbo{LowercaseSuperscripts=false} of \fbsetup{}.
+% \begin{macrocode}
+ \newcommand*{\FBsupR}{-0.12}
+ \newcommand*{\FBsupS}{0.65}
+ \newcommand*{\FB@lc}[1]{\MakeLowercase{#1}}
+ \DeclareRobustCommand*{\FB@up@fake}[1]{%
+ \settoheight{\FB@Mht}{M}%
+ \addtolength{\FB@Mht}{\FBsupR \FB@Mht}%
+ \addtolength{\FB@Mht}{-\FBsupS ex}%
+ \raisebox{\FB@Mht}{\scalefont{\FBsupS}{\FB@lc{#1}}}%
+ }
+% \end{macrocode}
+% The only packages I currently know to take advantage of real
+% superscripts are a) \pkg{realscripts} used in conjunction with
+% XeLaTeX or LuaLaTeX and OpenType fonts having the font feature
+% `VerticalPosition=Superior’ and b) \pkg{fourier}
+% (from version 1.6) when Expert Utopia fonts are available.
+%
+% |\FB@up| checks whether the current font is a Type1 `Expert’
+% (or `Pro’) font with real superscripts or not (the code works
+% currently only with \file{fourier-1.6} but could work with any
+% Expert Type1 font with built-in superscripts, see below), and
+% decides to use real or fake superscripts.
+% It works as follows: the content of |\f@family| (family name of
+% the current font) is split by |\FB@split| into two pieces, the
+% first three characters (`|fut|’ for Fourier, `|ppl|’ for Adobe’s
+% Palatino, \dots) stored in |\FB@firstthree| and the rest stored
+% in |\FB@suffix| which is expected to be `|x|’ or `|j|’ for expert
+% fonts.
+% \begin{macrocode}
+ \def\FB@split#1#2#3#4\@nil{\def\FB@firstthree{#1#2#3}%
+ \def\FB@suffix{#4}}
+ \def\FB@x{x}
+ \def\FB@j{j}
+ \DeclareRobustCommand*{\FB@up}[1]{%
+ \bgroup \FB@poormantrue
+ \expandafter\FB@split\f@family\@nil
+% \end{macrocode}
+% Then |\FB@up| looks for a \file{.fd} file named \file{t1fut-sup.fd}
+% (Fourier) or \file{t1ppl-sup.fd} (Palatino), etc.\ supposed to
+% define the subfamily (|fut-sup| or |ppl-sup|, etc.) giving access
+% to the built-in superscripts. If the \file{.fd} file is not found
+% by |\IfFileExists|, |\FB@up| falls back on fake superscripts,
+% otherwise |\FB@suffix| is checked to decide whether to use fake or
+% real superscripts.
+% \begin{macrocode}
+ \edef\reserved@a{\lowercase{%
+ \noexpand\IfFileExists{\f@encoding\FB@firstthree -sup.fd}}}%
+ \reserved@a
+ {\ifx\FB@suffix\FB@x \FB@poormanfalse\fi
+ \ifx\FB@suffix\FB@j \FB@poormanfalse\fi
+ \ifFB@poorman \FB@up@fake{#1}%
+ \else \FB@up@real{#1}%
+ \fi}%
+ {\FB@up@fake{#1}}%
+ \egroup}
+% \end{macrocode}
+% |\FB@up@real| just picks up the superscripts from the subfamily
+% (and forces lowercase).
+% \begin{macrocode}
+ \newcommand*{\FB@up@real}[1]{\bgroup
+ \fontfamily{\FB@firstthree -sup}\selectfont \FB@lc{#1}\egroup}
+% \end{macrocode}
+% |\fup| is defined as |\FB@up| unless |\realsuperscript| is
+% defined by \file{realscripts.sty}.
+% \begin{macrocode}
+ \DeclareRobustCommand*{\fup}[1]{%
+ \ifx\realsuperscript\@undefined
+ \FB@up{#1}%
+ \else
+ \bgroup\let\fakesuperscript\FB@up@fake
+ \realsuperscript{\FB@lc{#1}}\egroup
+ \fi}
+% \end{macrocode}
+% Let’s provide a temporary definition for |\up| (redefined
+% `AtBeginDocument’ as |\fup| or |\textsuperscript| according to
+% \fbsetup{} options).
+% \begin{macrocode}
+ \providecommand*{\up}{\relax}
+% \end{macrocode}
+% Poor man’s definition of |\up| for Plain.
+% \begin{macrocode}
+\else
+ \providecommand*{\up}[1]{\leavevmode\raise1ex\hbox{\sevenrm #1}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ieme}
+% \begin{macro}{\ier}
+% \begin{macro}{\iere}
+% \begin{macro}{\iemes}
+% \begin{macro}{\iers}
+% \begin{macro}{\ieres}
+% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions
+% of \cs{ieme} and co: \cs{up} already does the conversion.}
+%
+% Some handy macros for those who don’t know how to abbreviate
+% ordinals:
+% \begin{macrocode}
+\def\ieme{\up{e}\xspace}
+\def\iemes{\up{es}\xspace}
+\def\ier{\up{er}\xspace}
+\def\iers{\up{ers}\xspace}
+\def\iere{\up{re}\xspace}
+\def\ieres{\up{res}\xspace}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.3c}{2017/07/23}{New configurable kerns \cs{FBmedkern},
+% and \cs{FBthickkern} suitable for HTML translation.}
+%
+% \begin{macro}{\FBmedkern}
+% \begin{macro}{\FBthickkern}
+% \begin{macrocode}
+\newcommand*{\FBmedkern}{\kern+.2em}
+\newcommand*{\FBthickkern}{\kern+.3em}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v2.1c}{2008/04/29}{Added commands \cs{Nos} and \cs{nos}.}
+%
+% \begin{macro}{\No}
+% \begin{macro}{\no}
+% \begin{macro}{\Nos}
+% \begin{macro}{\nos}
+% \begin{macro}{\primo}
+% \begin{macro}{\fprimo)}
+% \changes{v3.1b}{2014/06/23}{Removed \cs{lowercase} from definitions
+% of \cs{FrenchEnumerate}, \dots{} \cs{No} and co: \cs{up} already
+% does the conversion.}
+%
+% And some more macros relying on |\up| for numbering,
+% first two support macros.
+% \begin{macrocode}
+\newcommand*{\FrenchEnumerate}[1]{#1\up{o}\FBthickkern}
+\newcommand*{\FrenchPopularEnumerate}[1]{#1\up{o})\FBthickkern}
+% \end{macrocode}
+%
+% Typing |\primo| should result in `\up{o}\kern+.3em’,
+% \begin{macrocode}
+\def\primo{\FrenchEnumerate1}
+\def\secundo{\FrenchEnumerate2}
+\def\tertio{\FrenchEnumerate3}
+\def\quarto{\FrenchEnumerate4}
+% \end{macrocode}
+% while typing |\fprimo)| gives `\up{o})\kern+.3em.
+% \begin{macrocode}
+\def\fprimo){\FrenchPopularEnumerate1}
+\def\fsecundo){\FrenchPopularEnumerate2}
+\def\ftertio){\FrenchPopularEnumerate3}
+\def\fquarto){\FrenchPopularEnumerate4}
+% \end{macrocode}
+%
+% Let’s provide four macros for the common abbreviations
+% of ``Numéro’’.
+% \begin{macrocode}
+\DeclareRobustCommand*{\No}{N\up{o}\FBmedkern}
+\DeclareRobustCommand*{\no}{n\up{o}\FBmedkern}
+\DeclareRobustCommand*{\Nos}{N\up{os}\FBmedkern}
+\DeclareRobustCommand*{\nos}{n\up{os}\FBmedkern}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bsc}
+% As family names should be written in small capitals and never be
+% hyphenated, we provide a command (its name comes from Boxed Small
+% Caps) to input them easily. Note that this command has changed
+% with version~2 of \frenchb: a |\kern0pt| is used instead of |\hbox|
+% because |\hbox| would break microtype’s font expansion; as a
+% (positive?) side effect, composed names (such as Dupont-Durand)
+% can now be hyphenated on explicit hyphens.
+% Usage: |Jean~\bsc{Duchemin}|.
+%
+% \changes{v2.0}{2006/11/06}{\cs{hbox} dropped, replaced by
+% \cs{kern0pt}.}
+%
+% \begin{macrocode}
+\DeclareRobustCommand*{\bsc}[1]{\leavevmode\begingroup\kern0pt
+ \scshape #1\endgroup}
+\ifLaTeXe\else\let\scshape\relax\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Some definitions for special characters. We won’t define |\tilde|
+% as a Text Symbol not to conflict with the macro |\tilde| for math
+% mode and use the name |\tild| instead. Note that |\boi| may
+% \emph{not} be used in math mode, its name in math mode is
+% |\backslash|. |\degre| can be accessed by the command |\r{}|
+% for ring accent.
+%
+% \changes{v2.5f}{2011/07/18}{Changed definitions of \cs{at},
+% \cs{circonflexe}, \cs{tild}, \cs{boi} and \cs{degre} for
+% Unicode based engines.}
+%
+% \changes{v3.2g}{2017/01/24}{Changed Unicode definition of \cs{boi}.}
+%
+% \begin{macrocode}
+\ifFBunicode
+ \newcommand*{\at}{{\char"0040}}
+ \newcommand*{\circonflexe}{{\char"005E}}
+ \newcommand*{\tild}{{\char"007E}}
+ \newcommand*{\boi}{{\char"005C}}
+ \newcommand*{\degre}{{\char"00B0}}
+\else
+ \ifLaTeXe
+ \DeclareTextSymbol{\at}{T1}{64}
+ \DeclareTextSymbol{\circonflexe}{T1}{94}
+ \DeclareTextSymbol{\tild}{T1}{126}
+ \DeclareTextSymbolDefault{\at}{T1}
+ \DeclareTextSymbolDefault{\circonflexe}{T1}
+ \DeclareTextSymbolDefault{\tild}{T1}
+ \DeclareRobustCommand*{\boi}{\textbackslash}
+ \DeclareRobustCommand*{\degre}{\r{}}
+ \else
+ \def\T@one{T1}
+ \ifx\f@encoding\T@one
+ \newcommand*{\degre}{{\char6}}
+ \else
+ \newcommand*{\degre}{{\char23}}
+ \fi
+ \newcommand*{\at}{{\char64}}
+ \newcommand*{\circonflexe}{{\char94}}
+ \newcommand*{\tild}{{\char126}}
+ \newcommand*{\boi}{$\backslash$}
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\degres}
+% We now define a macro |\degres| for typesetting the abbreviation
+% for `degrees’ (as in `degrees Celsius’). As the bounding box of
+% the character `degree’ has \emph{very} different widths in CM/EC
+% and PostScript fonts, we fix the width of the bounding box of
+% |\degres| to 0.3\,em, this lets the symbol `degree’ stick to the
+% preceding (e.g., |45\degres|) or following character
+% (e.g., |20~\degres C|).
+%
+% \changes{v2.6e}{2013/07/06}{Refrain from redefining \cs{textdegree}
+% from latin1.def, applemac.def, etc. as \cs{degres} because it
+% loops in hyperref’s bookmarks. Pointed out by Eddy Flas on fctt.}
+%
+% If \TeX{} Companion fonts are available (\file{textcomp.sty}),
+% we pick up |\textdegree| from them instead of emulating `degrees’
+% from the |\r{}| accent. Otherwise we advise the user (once only)
+% to use TS1-encoding.
+%
+% \changes{v2.1c}{2008/04/29}{Provide a temporary definition (hyperref
+% safe) of \cs{degres} in case it has to be expanded in the preamble
+% (by beamer’s \cs{title} command for instance).}
+%
+% \changes{v2.5h}{2012/03/21}{textcomp.sty has changed. The test
+% about \cs{M@TS1} is no longer relevant, let’s change it.}
+%
+% \begin{macrocode}
+\ifLaTeXe
+ \newcommand*{\degres}{\degre}
+ \ifFBunicode
+ \DeclareRobustCommand*{\degres}{\degre}
+ \else
+ \def\Warning@degree@TSone{\FBWarning
+ {Degrees would look better in TS1-encoding:%
+ \MessageBreak add \protect
+ \usepackage{textcomp} to the preamble.%
+ \MessageBreak Degrees used}}
+ \AtBeginDocument{\ifx\DeclareEncodingSubset\@undefined
+ \DeclareRobustCommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}%
+ \Warning@degree@TSone
+ \global\let\Warning@degree@TSone\relax}%
+ \else
+ \DeclareRobustCommand*{\degres}{%
+ \hbox{\UseTextSymbol{TS1}{\textdegree}}}%
+ \fi
+ }
+ \fi
+\else
+ \newcommand*{\degres}{%
+ \leavevmode\hbox to 0.3em{\hss\degre\hss}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Formatting numbers}
+% \label{ssec-numbers}
+%
+% \begin{macro}{\StandardMathComma}
+% \begin{macro}{\DecimalMathComma}
+% As mentioned in the \TeX{}book p.~134, the comma is of type
+% |\mathpunct| in math mode: it is automatically followed by a
+% thin space. This is convenient in lists and intervals but
+% unpleasant when the comma is used as a decimal separator
+% in French: it has to be entered as |{,}|.
+% |\DecimalMathComma| makes the comma be an ordinary character
+% (of type |\mathord|) in French \emph{only} (no space added);
+% |\StandardMathComma| switches back to the standard behaviour
+% of the comma.
+%
+% \changes{v3.2e}{2017/01/09}{\cs{DecimalMathComma} didn’t work
+% with LuaTeX. Fixed now.}
+%
+% \changes{v3.2f}{2017/01/15}{Fixed conflict with the icomma
+% package.}
+%
+% Unfortunately, |\newcount| inside |\if| breaks Plain formats.
+% \begin{macrocode}
+\newif\ifFB@icomma
+\newcount\mc@charclass
+\newcount\mc@charfam
+\newcount\mc@charslot
+\newcount\std@mcc
+\newcount\dec@mcc
+\ifFBLuaTeX
+ \mc@charclass=\Umathcharclass`\,
+ \newcommand*{\dec@math@comma}{%
+ \mc@charfam=\Umathcharfam`\,
+ \mc@charslot=\Umathcharslot`\,
+ \Umathcode`\,= 0 \mc@charfam \mc@charslot
+ }
+ \newcommand*{\std@math@comma}{%
+ \mc@charfam=\Umathcharfam`\,
+ \mc@charslot=\Umathcharslot`\,
+ \Umathcode`\,= \mc@charclass \mc@charfam \mc@charslot
+ }
+\else
+ \std@mcc=\mathcode`\,
+ \dec@mcc=\std@mcc
+ \@tempcnta=\std@mcc
+ \divide\@tempcnta by "1000
+ \multiply\@tempcnta by "1000
+ \advance\dec@mcc by -\@tempcnta
+ \newcommand*{\dec@math@comma}{\mathcode`\,=\dec@mcc}
+ \newcommand*{\std@math@comma}{\mathcode`\,=\std@mcc}
+\fi
+\newcommand*{\DecimalMathComma}{%
+ \ifFBfrench\dec@math@comma\fi
+ \ifFB@icomma\else\addto\extrasfrench{\dec@math@comma}\fi
+}
+\newcommand*{\StandardMathComma}{%
+ \std@math@comma
+ \ifFB@icomma\else\addto\extrasfrench{\std@math@comma}\fi
+}
+\ifLaTeXe
+ \AtBeginDocument{\@ifpackageloaded{icomma}%
+ {\FB@icommatrue}%
+ {\addto\noextrasfrench{\std@math@comma}}%
+ }
+\else
+ \addto\noextrasfrench{\std@math@comma}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\nombre}
+%
+% \changes{v2.0}{2006/11/06}{\cs{nombre} now requires numprint.sty.}
+%
+% The command |\nombre| is now borrowed from \file{numprint.sty} for
+% LaTeX2e. There is no point to maintain the former tricky code
+% when a package is dedicated to do the same job and more.
+% For Plain based formats, |\nombre| no longer formats numbers,
+% it prints them as is and issues a warning about the change.
+%
+% Fake command |\nombre| for Plain based formats, warning users of
+% \frenchb{} v.~1.x.\ about the change:
+% \begin{macrocode}
+\newcommand*{\nombre}[1]{{#1}\fb@warning{*** \noexpand\nombre
+ no longer formats numbers\string! ***}}
+% \end{macrocode}
+% \end{macro}
+%
+% Let’s activate LuaTeX punctuation if necessary (LaTeX or Plain)
+% so that |\FBsetspaces| commands can be used in the preamble,
+% then cleanup and exit without loading any \file{.cfg} file
+% in case of Plain formats.
+%
+% \begin{macrocode}
+\ifFB@luatex@punct
+ \activate@luatexpunct
+\fi
+\let\FBstop@here\relax
+\def\FBclean@on@exit{%
+ \let\ifLaTeXe\undefined
+ \let\LaTeXetrue\undefined
+ \let\LaTeXefalse\undefined
+ \let\FB@llc\loadlocalcfg
+ \let\loadlocalcfg\@gobble}
+\ifx\magnification\@undefined
+\else
+ \def\FBstop@here{%
+ \FBclean@on@exit
+ \ldf@finish\CurrentOption
+ \let\loadlocalcfg\FB@llc
+ \endinput}
+\fi
+\FBstop@here
+% \end{macrocode}
+%
+% What follows is for LaTeX2e \emph{only}.
+% We redefine |\nombre| for LaTeX2e. A warning is issued
+% at the first call of |\nombre| if |\numprint| is not
+% defined, suggesting what to do. The package \pkg{numprint}
+% is \emph{not} loaded automatically by \frenchb{} because of
+% possible options conflict.
+%
+% \changes{v3.1i}{2015/10/03}{\cs{nombre} command changed when
+% numprint.sty is not loaded: only one warning, no error.}
+%
+% \begin{macrocode}
+\renewcommand*{\nombre}[1]{\Warning@nombre{#1}}
+\newcommand*{\Warning@nombre}[1]{%
+ \ifdefined\numprint
+ \numprint{#1}%
+ \else
+ \PackageWarning{french.ldf}{%
+ \protect\nombre\space now relies on package numprint.sty,%
+ \MessageBreak add \protect
+ \usepackage[autolanguage]{numprint},\MessageBreak
+ see file numprint.pdf for more options.\MessageBreak
+ \protect\nombre\space called}%
+ \global\let\Warning@nombre\relax
+ {#1}%
+ \fi
+}
+% \end{macrocode}
+%
+% \changes{v3.3c}{2017/08/10}{New command \cs{FBthousandsep} to
+% customise numprint.}
+%
+% \changes{v3.4a}{2017/12/29}{Shrink/stretch removed in
+% \cs{FBthousandsep}.}
+%
+% \begin{macrocode}
+\newcommand*{\FBthousandsep}{\kern \fontdimen2\font \relax}
+% \end{macrocode}
+%
+% \changes{v2.0c}{2007/06/25}{There is no need to define here
+% numprint’s command \cs{npstylefrench}, it will be redefined
+% `AtBeginDocument’ by \cs{FBprocess@options}.}
+%
+% \subsection{Caption names}
+% \label{ssec-captions-name}
+%
+% The next step consists in defining the French equivalents for
+% the LaTeX caption names.
+%
+% \begin{macro}{\captionsfrench}
+% Let’s first define |\captionsfrench| which sets all strings used
+% in the four standard document classes provided with LaTeX.
+%
+% \changes{v2.0}{2006/11/06}{`Fig.’ changed to `Figure’ and
+% `Tab.’ to `Table’.}
+%
+% \changes{v2.5a}{2010/08/16}{\cs{emph} deleted in \cs{seename}
+% and \cs{alsoname} to match what is done for the other languages.
+% Suggested by Marc Baudoin.}
+%
+% \changes{v3.0a}{2014/02/18}{Take advantage of babel’s \cs{SetString}
+% commands for captionnames.}
+%
+% \changes{v3.1b}{2014/09/15}{Change \cs{scshape} to customisable
+% \cs{FBfigtabshape} for \cs{figurename} and \cs{tablename}.}
+%
+% \changes{v3.1g}{2015/05/10}{\cs{partname}’s definition depends now on
+% flag PartNameFull. No need to redefine it in \cs{frenchbsetup}.}
+%
+% \changes{v3.3a}{2017/04/30}{Commands \cs{frenchpartfirst},
+% \cs{frenchpartsecond} and \cs{frenchpartnameord} added.}
+%
+% Let’s give a chance to a class or a package read before \frenchb{}
+% to define |\FBfigtabshape| as |\relax|, otherwise |\FBfigtabshape|
+% will be defined as |\scshape| (can be changed with
+% \fbsetup{SmallCapsFigTabCaptions=false}).
+% \begin{macrocode}
+\providecommand*{\FBfigtabshape}{\scshape}
+% \end{macrocode}
+%
+% New implementation for caption names( requires \babel’s~3.10 or
+% newer).
+% \begin{macrocode}
+\StartBabelCommands*{\BabelLanguages}{captions}
+ [unicode, fontenc=TU EU1 EU2, charset=utf8]
+ \SetString{\refname}{Références}
+ \SetString{\abstractname}{Résumé}
+ \SetString{\prefacename}{Préface}
+ \SetString{\contentsname}{Table des matières}
+ \SetString{\ccname}{Copie à }
+ \SetString{\proofname}{Démonstration}
+ \SetString{\partfirst}{Première}
+ \SetString{\partsecond}{Deuxième}
+ \SetStringLoop{ordinal#1}{%
+ \frenchpartfirst,\frenchpartsecond,Troisième,Quatrième,%
+ Cinquième,Sixième,Septième,Huitième,Neuvième,Dixième,Onzième,%
+ Douzième,Treizième,Quatorzième,Quinzième,Seizième,%
+ Dix-septième,Dix-huitième,Dix-neuvième,Vingtième}
+\StartBabelCommands*{\BabelLanguages}{captions}
+ \SetString{\refname}{R\'ef\'erences}
+ \SetString{\abstractname}{R\'esum\'e}
+ \SetString{\bibname}{Bibliographie}
+ \SetString{\prefacename}{Pr\'eface}
+ \SetString{\chaptername}{Chapitre}
+ \SetString{\appendixname}{Annexe}
+ \SetString{\contentsname}{Table des mati\`eres}
+ \SetString{\listfigurename}{Table des figures}
+ \SetString{\listtablename}{Liste des tableaux}
+ \SetString{\indexname}{Index}
+ \SetString{\figurename}{{\FBfigtabshape Figure}}
+ \SetString{\tablename}{{\FBfigtabshape Table}}
+ \SetString{\pagename}{page}
+ \SetString{\seename}{voir}
+ \SetString{\alsoname}{voir aussi}
+ \SetString{\enclname}{P.~J. }
+ \SetString{\ccname}{Copie \`a }
+ \SetString{\headtoname}{}
+ \SetString{\proofname}{D\'emonstration}
+ \SetString{\glossaryname}{Glossaire}
+% \end{macrocode}
+% When \fbo{PartNameFull=true} (default), |\part{}| is printed in
+% French as ``Première partie’’ instead of ``Partie I’’.
+% As logic is prohibited inside |\SetString|, let’s hide the test
+% about \fbo{PartNameFull} in |\FB@partname|.
+% \begin{macrocode}
+ \SetString{\partfirst}{Premi\`ere}
+ \SetString{\partsecond}{Deuxi\`eme}
+ \SetString{\partnameord}{partie}
+ \SetStringLoop{ordinal#1}{%
+ \partfirst,\partsecond,Troisi\`eme,Quatri\`eme,%
+ Cinqui\`eme,Sixi\`eme,Septi\`eme,Huiti\`eme,Neuvi\`eme,Dixi\`eme,%
+ Onzi\`eme,Douzi\`eme,Treizi\`eme,Quatorzi\`eme,Quinzi\`eme,%
+ Seizi\`eme,Dix-septi\`eme,Dix-huiti\`eme,Dix-neuvi\`eme,%
+ Vingti\`eme}
+ \AfterBabelCommands{%
+ \DeclareRobustCommand*{\FB@emptypart}{\def\thepart{}}%
+ \DeclareRobustCommand*{\FB@partname}{%
+ \ifFBPartNameFull
+ \csname ordinal\romannumeral\value{part}\endcsname\space
+ \partnameord\FB@emptypart
+ \else
+ Partie%
+ \fi}%
+ }
+ \SetString{\partname}{\FB@partname}
+\EndBabelCommands
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.0a}{2014/02/28}{Merging of \cs{captionsfrenchb},
+% \cs{captionsfrancais} with \cs{captionsfrench} deleted in favor
+% of new babel 3.9 syntax.}
+%
+% \subsection{Figure and table captions}
+% \label{ssec-captions-fig}
+%
+% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to
+% \cs{FBWarning} (in case \cs{@makecaption} has been customised).
+% \cs{FBWarning} is defined as \cs{PackageWarning} by default but
+% can be made silent using \cs{frenchbsetup}, (suggested by MPG).}
+%
+% \begin{macro}{\FBWarning}
+% |\FBWarning| is an alias of |\PackageWarning{french.ldf}| which
+% can be made silent by option \fbo{SuppressWarning}.
+% \begin{macrocode}
+\newcommand{\FBWarning}[1]{\PackageWarning{french.ldf}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CaptionSeparator}
+% Let’s consider now captions in figures and tables.
+% In French, captions in figures and tables should never be printed
+% as `Figure 1:~’ which is the default in standard LaTeX2e classes
+% (a space should preceed the colon in French). This flaw may occur
+% with pdfLaTeX as `:’ is made active too late.
+% With LuaLaTeX and XeLaTeX, this glitch doesn’t occur, you get
+% `Figure 1~:~’ which is correct in French. With pdfLaTeX \frenchb{}
+% provides the following workaround.
+%
+% The standard definition of |\@makecaption| (e.g., the one provided
+% in article.cls, report.cls, book.cls which is frozen for LaTeX2e
+% according to Frank Mittelbach), is saved in |\STD@makecaption|.
+% `AtBeginDocument’ we compare it to its current definition (some
+% classes like \cls{memoir}, koma-script classes, AMS classes,
+% ua-thesis.cls\dots change it).
+% If they are identical, \frenchb{} just adds a hook called
+% |\FBCaption@Separator| to |\@makecaption|; |\FBCaption@Separator|
+% defaults to `:~’ as in the standard |\@makecaption| and will be
+% changed to `~:~’ in French `AtBeginDocument’; it can be also set to
+% |\CaptionSeparator| (` -- ’) using \fbo{CustomiseFigTabCaptions}.
+%
+% \changes{v2.6c}{2013/05/18}{Former \cs{CaptionSeparator}
+% has been renamed as \cs{FBCaption@Separator};
+% Newif \cs{if@FBwarning@capsep} added.}
+%
+% \changes{v2.6h}{2014/01/03}{No active catcodes in
+% \cs{STD@makecaption}’s definition.}
+%
+% \changes{v3.0a}{2014/02/28}{Remove \cs{FBCaption@SeparatorORI}, use
+% \cs{babel@save} instead.}
+%
+% While saving the standard definition of |\@makecaption| we have to
+% make sure that characters `:’ and `|>|’ have |\catcode| 12
+% (\frenchb{} makes `:’ active and \file{spanish.ldf} makes `|>|’
+% active).
+% \begin{macrocode}
+\bgroup
+ \catcode`:=12 \catcode`>=12 \relax
+ \long\gdef\STD@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\egroup
+% \end{macrocode}
+%
+% No warning is issued for SMF, AMS and ACM classes as their layout
+% of captions is compatible with French typographic standards.
+%
+% With \cls{memoir} and koma-script classes, \frenchb{} customises
+% |\captiondelim| or |\captionformat| in French (unless option
+% \fbo{CustomiseFigTabCaptions} is set to \fbo{false}) and issues
+% no warning.
+%
+% When |\@makecaption| has been changed by another class
+% or package, a warning is printed in the .log file.
+%
+% Enable the standard warning only if high punctuation is active.
+% \begin{macrocode}
+\newif\if@FBwarning@capsep
+\ifFB@active@punct\@FBwarning@capseptrue\fi
+\newcommand*{\CaptionSeparator}{\space\textendash\space}
+\def\FBCaption@Separator{: }
+\long\def\FB@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1\FBCaption@Separator #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1\FBCaption@Separator #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for
+% AMS classes.}
+%
+% \changes{v3.0a}{2014/02/20}{No warning about \cs{@makecaption} for
+% SMF classes.}
+%
+% Disable the standard warning with ACM, AMS and SMF classes.
+% \begin{macrocode}
+\@ifclassloaded{acmart}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{amsart}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{amsbook}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{amsdtx}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{amsldoc}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{amproc}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{smfart}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{smfbook}{\@FBwarning@capsepfalse}{}
+% \end{macrocode}
+%
+% \changes{v2.6c}{2013/05/18}{No warning about \cs{@makecaption} for
+% koma-script classes. \cs{captionformat} customised in French.}
+%
+% \changes{v2.6h}{2014/01/05}{If \cs{@makecaption} is undefined, no
+% warning.}
+%
+% No warning with \cls{memoir} or koma-script classes: they change
+% |\@makecaption| but we will manage to customise them in French
+% later on (see below after executing |\FBprocess@options|)
+% \hlabel{ifFB@koma}.
+% \begin{macrocode}
+\newif\ifFB@koma
+\@ifclassloaded{memoir}{\@FBwarning@capsepfalse}{}
+\@ifclassloaded{scrartcl}{\@FBwarning@capsepfalse\FB@komatrue}{}
+\@ifclassloaded{scrbook}{\@FBwarning@capsepfalse\FB@komatrue}{}
+\@ifclassloaded{scrreprt}{\@FBwarning@capsepfalse\FB@komatrue}{}
+% \end{macrocode}
+% No warning with the \cls{beamer} class which defines
+% |\beamer@makecaption| (customised below) instead of
+% |\@makecaption|. No warning either if |\@makecaption| is
+% undefined (i.e.\ \cls{letter}).
+% \begin{macrocode}
+\@ifclassloaded{beamer}{\@FBwarning@capsepfalse}{}
+\ifdefined\@makecaption\else\@FBwarning@capsepfalse\fi
+% \end{macrocode}
+%
+% \changes{v2.6c}{2013/05/18}{Warning added when the caption
+% or floatrow package is loaded before babel/french.}
+%
+% \changes{v3.2b}{2016/03/30}{Warning added when the subcaption
+% package is loaded before babel/french.}
+%
+% \changes{v3.3c}{2017/08/16}{Reorganise warnings when the caption,
+% subcaption or floatrow packages are loaded before babel/french.}
+%
+% The \pkg{caption}, \pkg{subcaption} and \pkg{floatrow} packages are
+% compatible with \frenchb{} if they are loaded after \babel{}.
+%
+% Check if packages \pkg{caption3} \pkg{subcaption} or \pkg{floatrow}
+% are loaded now (before \frenchb) and step counter |FBcaption@count|
+% accordingly; it’s value will be checked |\AtBeginDocument|.
+% N.B.: \pkg{caption} loads \pkg{caption3}, \pkg{subcaption} loads
+% \pkg{caption3} and \pkg{floatrow} loads \pkg{caption3}.
+% \begin{macrocode}
+\newcounter{FBcaption@count}
+\@ifpackageloaded{caption3}{\addtocounter{FBcaption@count}{4}}{}
+\@ifpackageloaded{subcaption}{\addtocounter{FBcaption@count}{2}}{}
+\@ifpackageloaded{floatrow}{\stepcounter{FBcaption@count}}{}
+% \end{macrocode}
+%
+% \changes{v3.0a}{2014/02/20}{More informative, less TeXnical warning
+% about \cs{@makecaption}.}
+%
+% First check the definition of |\@makecaption|, change it or issue
+% a warning in case it has been changed by a class or package not
+% (yet) compatible with \frenchb; then change the definition of
+% |\FBCaption@Separator|, taking care that the colon is typeset
+% correctly in French (\emph{not} `Figure~1: légende’).
+%
+% \changes{v3.1f}{2015/05/31}{\cs{FBCaption@Separator} changed when
+% option CustomiseFigTabCaptions is set to false.}
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifx\@makecaption\STD@makecaption
+ \global\let\@makecaption\FB@makecaption
+% \end{macrocode}
+% If \fbo{OldFigTabCaptions=true}, do not overwrite
+% |\FBCaption@Separator| (already saved as `: ’ for other languages
+% and set to |\CaptionSeparator| by |\extrasfrench| when French is
+% the main language); otherwise add a space before the `:’ in French
+% in order to avoid problems when \fbo{AutoSpacePunctuation=false}.
+% \begin{macrocode}
+ \ifFBOldFigTabCaptions
+ \else
+ \def\FBCaption@Separator{\ifFBfrench\space\fi : }%
+ \fi
+ \ifFBCustomiseFigTabCaptions
+ \ifFB@mainlanguage@FR
+ \def\FBCaption@Separator{\CaptionSeparator}%
+ \fi
+ \fi
+ \@FBwarning@capsepfalse
+ \fi
+% \end{macrocode}
+% Cancel the warning if \file{caption3.sty} has been loaded
+% \emph{after} \babel.
+% \begin{macrocode}
+ \@ifpackageloaded{caption3}{%
+ \ifnum\value{FBcaption@count}=0 \@FBwarning@capsepfalse\fi
+ }{}%
+ \if@FBwarning@capsep
+ \ifnum\value{FBcaption@count}>0
+% \end{macrocode}
+% \file{caption3.sty} has been loaded \emph{before} babel, maybe by
+% the class\dots
+% \begin{macrocode}
+ \FBWarning
+ {Figures' and tables' captions might look like\MessageBreak
+ `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak
+ If you have loaded any of the packages caption,\MessageBreak
+ subcaption or floatrow BEFORE babel/french,\MessageBreak
+ please move them AFTER babel/french.\MessageBreak
+ If one of them is loaded by your class,\MessageBreak
+ you can still add AFTER babel/french\MessageBreak
+ \protect\usepackage[labelsep=period]{caption} or\MessageBreak
+ \protect\usepackage[labelsep=endash]{caption} or\MessageBreak
+ ... live with it; reported}%
+ \else
+% \end{macrocode}
+% \file{caption3.sty} hasn’t been loaded at all.
+% \begin{macrocode}
+ \FBWarning
+ {Figures' and tables' captions might look like\MessageBreak
+ `Figure 1:' in French instead of `Figure 1 :'.\MessageBreak
+ If it happens, see your class documentation to\MessageBreak
+ fix this issue or add AFTER babel/french\MessageBreak
+ \protect\usepackage[labelsep=period]{caption} or\MessageBreak
+ \protect\usepackage[labelsep=endash]{caption} or\MessageBreak
+ or ... live with it; reported}%
+ \fi
+ \fi
+ \let\FB@makecaption\relax
+ \let\STD@makecaption\relax
+}
+% \end{macrocode}
+%
+% \subsection{Dots\dots}
+% \label{ssec-dots}
+%
+% \begin{macro}{\FBtextellipsis}
+% LaTeX’s standard definition of |\dots| in text-mode is
+% |\textellipsis| which includes a |\kern| at the end;
+% this space is not wanted in some cases (before a closing brace
+% for instance) and |\kern| breaks hyphenation of the next word.
+% We define |\FBtextellipsis| for French (in LaTeX only).
+%
+% The |\if| construction in the LaTeX definition of |\dots|
+% doesn’t allow the use of |xspace| (|xspace| is always followed
+% by a |\fi|), so we use the AMS-LaTeX construction of |\dots|;
+% this has to be done `AtBeginDocument’ not to be overwritten
+% when \file{amsmath.sty} is loaded after \babel.
+%
+% \changes{v2.0}{2006/11/06}{Added special case for LY1 encoding,
+% see bug report from Bruno Voisin (2004/05/18).}
+%
+% \changes{v2.5f}{2011/06/18}{Unicode fonts also provide a ready made
+% character for \cs{textellipsis}, let’s just use it!
+% (reported by Maxime Chupin, 2011/06/04).}
+%
+% LY1 has a ready made character for |\textellipsis|, it should be
+% used in French too. The same is true for Unicode fonts in use
+% with XeTeX and LuaTeX.
+%
+% \begin{macrocode}
+\ifFBunicode
+ \let\FBtextellipsis\textellipsis
+\else
+ \DeclareTextSymbol{\FBtextellipsis}{LY1}{133}
+ \DeclareTextCommandDefault{\FBtextellipsis}{%
+ .\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}
+\fi
+% \end{macrocode}
+% |\Mdots@| and |\Tdots@| hold the definitions of |\dots| in
+% Math and Text mode. They default to those of amsmath-2.0, and
+% will revert to standard LaTeX definitions `AtBeginDocument’,
+% if amsmath has not been loaded. |\Mdots@| doesn’t change when
+% switching from/to French, while |\Tdots@| is redefined as
+% |\FBtextellipsis| in French.
+% \begin{macrocode}
+\newcommand*{\Tdots@}{\@xp\textellipsis}
+\newcommand*{\Mdots@}{\@xp\mdots@}
+\AtBeginDocument{\DeclareRobustCommand*{\dots}{\relax
+ \csname\ifmmode M\else T\fi dots@\endcsname}%
+ \ifdefined\@xp\else\let\@xp\relax\fi
+ \ifdefined\mdots@\else\let\Mdots@\mathellipsis\fi
+ }
+\def\bbl@frenchdots{\babel@save\Tdots@ \let\Tdots@\FBtextellipsis}
+\addto\extrasfrench{\bbl@frenchdots}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{More checks about packages’ loading order}
+% \label{ssec-loading-order}
+%
+% \changes{v3.1d}{2015/04/06}{New section: issue warnings if packages
+% listings, numprint and natbib are loaded too early or too late
+% vs babel.}
+%
+% \changes{v3.1i}{2015/10/03}{Remove restriction about loading
+% numprint.sty after babel.}
+%
+% Like packages \file{captions} and \file{floatrow} (see
+% section~\ref{ssec-captions-fig}), package \file{listings} should
+% be loaded after \frenchb{} due to active characters issues
+% (pdfLaTeX only).
+%
+% \begin{macrocode}
+\ifFB@active@punct
+ \@ifpackageloaded{listings}
+ {\AtBeginDocument{%
+ \FBWarning{Please load the "listings" package\MessageBreak
+ AFTER babel/french; reported}}%
+ }{}
+\fi
+% \end{macrocode}
+%
+% Package \file{natbib} should be loaded before \frenchb{}
+% due to active characters issues (pdfLaTeX only).
+%
+% \begin{macrocode}
+\newif\if@FBwarning@natbib
+\ifFB@active@punct
+ \@ifpackageloaded{natbib}{}{\@FBwarning@natbibtrue}
+\fi
+\AtBeginDocument{%
+ \if@FBwarning@natbib
+ \@ifpackageloaded{natbib}{}{\@FBwarning@natbibfalse}%
+ \fi
+ \if@FBwarning@natbib
+ \FBWarning{Please load the "natbib" package\MessageBreak
+ BEFORE babel/french; reported}%
+ \fi
+}
+% \end{macrocode}
+%
+% \changes{v3.2g}{2017/01/30}{Issue a warning if beamerarticle.sty
+% is loaded after babel.}
+%
+% Package \pkg{beamerarticle} should be loaded before \frenchb{}
+% to avoid list’s conflicts, see p.~\pageref{beamerarticle}.
+%
+% \begin{macrocode}
+\newif\if@FBwarning@beamerarticle
+\@ifpackageloaded{beamerarticle}{}{\@FBwarning@beamerarticletrue}
+\AtBeginDocument{%
+ \if@FBwarning@beamerarticle
+ \@ifpackageloaded{beamerarticle}{}%
+ {\@FBwarning@beamerarticlefalse}%
+ \fi
+ \if@FBwarning@beamerarticle
+ \FBWarning{Please load the "beamerarticle" package\MessageBreak
+ BEFORE babel/french; reported}%
+ \fi
+}
+% \end{macrocode}
+%
+% \subsection{Setup options: keyval stuff}
+% \label{ssec-keyval}
+%
+% \changes{v2.0}{2006/11/06}{New command \cs{frenchbsetup} added
+% for global customisation.}
+%
+% \changes{v3.0a}{2014/02/24}{Options processing completely
+% reorganised, now \cs{babel@save} and\cs{babel@savevariable} are
+% usable for French.}
+%
+% All setup options are handled by command \fbsetup{} using the
+% keyval syntax. A list of flags is defined and set to a default
+% value which will possibly be changed `AtEndOfPackage’ if French is
+% the main language. After this, \fbsetup{} eventually modifies the
+% preset values of these flags.
+%
+% Option processing can occur either in \fbsetup{}, but \emph{only
+% for options explicitly set} by \fbsetup{}, or `AtBeginDocument’;
+% any option affecting |\extrasfrench{}| \emph{must} be processed by
+% \fbsetup{}: when French is the main language, |\extrasfrench{}| is
+% executed by \babel{} when it switches the main language and this
+% occurs \emph{before} reading the stuff postponed by \frenchb{}
+% `AtBeginDocument’. Reexecuting |\extrasfrench{}| is an option
+% which was used up to v2.6h, it has been dropped in v3.0a because
+% of its side-effects (f.i.\ |\babel@save| and |\babel@savevariable|
+% did not work for French).
+%
+% \begin{macro}{\frenchsetup}
+% Let’s now define this command which reads and sets the options
+% to be processed either immediately (i.e.\ just after setting the
+% key) or later (at |\begin{document}|) by |\FBprocess@options|.
+% \fbsetup{} can only be called in the preamble.
+%
+% \changes{v2.0c}{2007/06/25}{Option ThinSpaceInFrenchNumbers added.}
+%
+% \changes{v2.0d}{2007/07/15}{Options og and fg changed: limit
+% the definition to French so that quote characters can be used
+% in German.}
+%
+% \changes{v2.0e}{2007/10/05}{New option: StandardLists.}
+%
+% \changes{v2.0f}{2008/03/23}{Two typos corrected in
+% option StandardLists.}
+%
+% \changes{v2.0f}{2008/03/23}{StandardLayout option had no
+% effect on lists. Test moved to \cs{FBprocess@options}.}
+%
+% \changes{v2.0g}{2008/03/23}{Revert previous change to
+% StandardLayout. This option must set the three flags
+% \cs{FBReduceListSpacingfalse}, \cs{FBCompactItemizefalse},
+% and \cs{FBStandardItemLabeltrue} instead of
+% \cs{FBStandardListstrue}, so that later options can still
+% change their value before executing \cs{FBprocess@options}.
+% Same thing for option StandardLists.}
+%
+% \changes{v2.1a}{2008/03/24}{New option: FrenchSuperscripts
+% to define \cs{up} as \cs{fup} or as \cs{textsuperscript}.}
+%
+% \changes{v2.1a}{2008/03/30}{New option: LowercaseSuperscripts.}
+%
+% \changes{v2.2a}{2008/05/08}{The global layout of the document is
+% no longer changed when frenchb is not the last option of babel
+% (\cs{bbl@main@language}). Suggested by Ulrike Fischer.}
+%
+% \changes{v2.2a}{2008/05/08}{Default values of flags changed:
+% default now means `StandardLayout’, they will be changed to
+% `FrenchLayout’ AtEndOfPackage only if french is
+% \cs{bbl@main@language}.}
+%
+% \changes{v2.2a}{2008/05/08}{When frenchb is babel’s last option,
+% French becomes the document’s main language, so
+% GlobalLayoutFrench applies.}
+%
+% \changes{v2.4a}{2009/11/23}{New option SuppressWarning.}
+%
+% \changes{v2.6a}{2013/01/30}{New options ListOldLayout,
+% StandardItemizeEnv and StandardEnumerateEnv (CompactItemize is
+% deprecated).}
+%
+% \changes{v3.0a}{2014/02/28}{New options OldFigTabCaptions and
+% CustomiseFigTabCaptions.}
+%
+% \changes{v3.0c}{2014/04/18}{New option INGuillSpace.}
+%
+% \changes{v3.1a}{2014/05/20}{New options InnerGuillSingle,
+% EveryParGuill and EveryLineGuill to control \cs{frquote}.}
+%
+% \changes{v3.1b}{2014/09/15}{New option SmallCapsFigTabCaptions.}
+%
+% \changes{v3.1e}{2015/04/10}{Corrected typo: SmallCapsFigTabcaptions
+% instead of SmallCapsFigTabCaptions. Pointed out by Céline
+% Chevalier.}
+%
+% \changes{v3.1g}{2015/05/10}{PartNameFull now just sets the flag,
+% nothing to add to \cs{captionsfrench} when false.}
+%
+% \changes{v3.3a}{2017/04/30}{\cs{frenchbsetup} is now an alias for
+% \cs{frenchsetup}.}
+%
+% \changes{v3.3a}{2017/04/30}{Options INGuillSpace, ThinColonSpace no
+% longer delayed AtBeginDocument.}
+%
+% \changes{v3.5a}{2018/07/04}{New option ListItemsAsPar for displaying
+% lists’ items ``as paragraphs’’.}
+%
+% \changes{v3.5d}{2019/01/24}{ReduceListSpacing option depreciated: see
+% StandardListSpacing.}
+%
+% \begin{macrocode}
+\newcommand*{\frenchsetup}[1]{%
+ \setkeys{FB}{#1}%
+}%
+\@onlypreamble\frenchsetup
+% \end{macrocode}
+% Keep the former name |\frenchbsetup| working for compatibility.
+% \begin{macrocode}
+\let\frenchbsetup\frenchsetup
+\@onlypreamble\frenchbsetup
+% \end{macrocode}
+%
+% We define a collection of conditionals with their defaults
+% (true or false).
+%
+% \begin{macrocode}
+\newif\ifFBShowOptions
+\newif\ifFBStandardLayout \FBStandardLayouttrue
+\newif\ifFBGlobalLayoutFrench \FBGlobalLayoutFrenchtrue
+\newif\ifFBReduceListSpacing
+\newif\ifFBStandardListSpacing \FBStandardListSpacingtrue
+\newif\ifFBListOldLayout
+\newif\ifFBListItemsAsPar
+\newif\ifFBCompactItemize
+\newif\ifFBStandardItemizeEnv \FBStandardItemizeEnvtrue
+\newif\ifFBStandardEnumerateEnv \FBStandardEnumerateEnvtrue
+\newif\ifFBStandardItemLabels \FBStandardItemLabelstrue
+\newif\ifFBStandardLists \FBStandardListstrue
+\newif\ifFBIndentFirst
+\newif\ifFBFrenchFootnotes
+\newif\ifFBAutoSpaceFootnotes
+\newif\ifFBOriginalTypewriter
+\newif\ifFBThinColonSpace
+\newif\ifFBThinSpaceInFrenchNumbers
+\newif\ifFBFrenchSuperscripts \FBFrenchSuperscriptstrue
+\newif\ifFBLowercaseSuperscripts \FBLowercaseSuperscriptstrue
+\newif\ifFBPartNameFull \FBPartNameFulltrue
+\newif\ifFBCustomiseFigTabCaptions
+\newif\ifFBOldFigTabCaptions
+\newif\ifFBSmallCapsFigTabCaptions \FBSmallCapsFigTabCaptionstrue
+\newif\ifFBSuppressWarning
+\newif\ifFBINGuillSpace
+% \end{macrocode}
+%
+% The defaults values of these flags have been choosen so that
+% \frenchb{} does not change anything regarding the global layout.
+% |\bbl@main@language|, set by the last option of \babel, controls
+% the global layout of the document. `AtEndOfPackage’ we check the
+% main language in |\bbl@main@language|; if it is French (or a
+% French dialect) the values of some flags have to be changed to
+% ensure a French looking layout for the whole document (even in
+% parts written in languages other than French); the end-user will
+% then be able to customise the values of all these flags with
+% \fbsetup{}.
+%
+% \changes{v2.5b}{2010/10/30}{Do not use the
+% test \cs{iflanguage}\{french\} to check whether French is the
+% main language or not, as it might be be erroneously positive
+% when English is the main language and no hyphenation patterns
+% are available for French.
+% In this case \cs{l@french} and \cs{l@english} are 0.
+% Pointed out by Günter Milde.}
+%
+% \changes{v3.1g}{2015/05/10}{Bug fix for koma-scripts classes:
+% a spurious dot was added by the \cs{partformat} command.}
+%
+% \changes{v3.4a}{2018/01/07}{Patch for koma-script classes moved here,
+% after \cs{ifFBPartNameFull} is defined, so that it applies to
+% \cs{extrasacadian} too: \cs{AtEndOfPackage} is too late.}
+%
+% The following patch is for koma-script classes: the |\partformat|
+% command, defined as |\partname~\thepart\autodot|, is incompatible
+% with our redefinition of |\partname|.
+% \begin{macrocode}
+\ifFB@koma
+ \ifdefined\partformat
+ \def\FB@partformat@fix{%
+ \ifFBPartNameFull
+ \babel@save\partformat
+ \renewcommand*{\partformat}{\partname}%
+ \fi}
+ \addto\extrasfrench{\FB@partformat@fix}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \changes{v3.0c}{2014/03/30}{No list customisation when beamer
+% class is loaded.}
+%
+% \changes{v3.2g}{2017/01/30}{Minimal list customisation when
+% beamerarticle.sty is loaded.}
+%
+% \changes{v3.2h}{2017/04/11}{Option GlobalLayoutFrench skipped
+% when French is not the main language.}
+%
+% \changes{v3.5e}{2019/03/14}{StandardLayout and GlobalLayoutFrench
+% options can no longer be toggled when French is not the main
+% language.}
+%
+% Our list customisation conflicts with the \cls{beamer} class and
+% with the \pkg{beamerarticle} package. The patch provided in
+% \pkg{beamerbasecompatibility} solves the conflict except in case
+% of language changes, so we provide our own patch.
+% When the \cls{beamer} is loaded, lists are not customised at all
+% to ensure compatibility.\hlabel{beamerarticle}
+% The \pkg{beamerarticle} package needs to be loaded \emph{before}
+% \babel, a warning is issued otherwise, see
+% section~\ref{ssec-loading-order}; a light customisation is
+% compatible with the \pkg{beamerarticle} package.
+%
+% \begin{macrocode}
+\def\FB@french{french}
+\def\FB@acadian{acadian}
+\newif\ifFB@mainlanguage@FR
+\AtEndOfPackage{%
+ \ifx\bbl@main@language\FB@french \FB@mainlanguage@FRtrue
+ \else \ifx\bbl@main@language\FB@acadian \FB@mainlanguage@FRtrue \fi
+ \fi
+ \ifFB@mainlanguage@FR
+ \FBGlobalLayoutFrenchtrue
+ \@ifclassloaded{beamer}%
+ {\PackageInfo{french.ldf}{%
+ No list customisation for the beamer class,%
+ \MessageBreak reported}}%
+ {\@ifpackageloaded{beamerarticle}%
+ {\FBStandardItemLabelsfalse
+ \FBStandardListSpacingfalse
+ \PackageInfo{french.ldf}{%
+ Minimal list customisation for the beamerarticle%
+ \MessageBreak package; reported}}%
+% \end{macrocode}
+% Otherwise customise lists ``à la française’’:
+% \begin{macrocode}
+ {\FBStandardListSpacingfalse
+ \FBStandardItemizeEnvfalse
+ \FBStandardEnumerateEnvfalse
+ \FBStandardItemLabelsfalse}%
+ }
+ \FBIndentFirsttrue
+ \FBFrenchFootnotestrue
+ \FBAutoSpaceFootnotestrue
+ \FBCustomiseFigTabCaptionstrue
+ \else
+ \FBGlobalLayoutFrenchfalse
+ \fi
+% \end{macrocode}
+% \frenchb{} being an option of \babel, it cannot load a package
+% (\pkg{keyval}) while \file{french.ldf} is read, so we defer the
+% loading of \file{keyval} and the options setup at the end of
+% \babel’s loading.
+% \begin{macrocode}
+ \RequirePackage{keyval}%
+ \define@key{FB}{ShowOptions}[true]%
+ {\csname FBShowOptions#1\endcsname}%
+% \end{macrocode}
+% The next two keys can only be toggled when French is the main
+% language.
+% \begin{macrocode}
+ \define@key{FB}{StandardLayout}[true]%
+ {\ifFB@mainlanguage@FR
+ \csname FBStandardLayout#1\endcsname
+ \else
+ \PackageWarning{french.ldf}%
+ {Option `StandardlLayout' skipped:\MessageBreak
+ French is *not* babel's last option.\MessageBreak
+ Reported}%
+ \fi
+ \ifFBStandardLayout
+ \FBStandardListSpacingtrue
+ \FBStandardItemizeEnvtrue
+ \FBStandardItemLabelstrue
+ \FBStandardEnumerateEnvtrue
+ \FBIndentFirstfalse
+ \FBFrenchFootnotesfalse
+ \FBAutoSpaceFootnotesfalse
+ \FBGlobalLayoutFrenchfalse
+ \else
+ \FBStandardListSpacingfalse
+ \FBStandardItemizeEnvfalse
+ \FBStandardItemLabelsfalse
+ \FBStandardEnumerateEnvfalse
+ \FBIndentFirsttrue
+ \FBFrenchFootnotestrue
+ \FBAutoSpaceFootnotestrue
+ \fi}%
+ \define@key{FB}{GlobalLayoutFrench}[true]%
+ {\ifFB@mainlanguage@FR
+ \csname FBGlobalLayoutFrench#1\endcsname
+ \else
+ \PackageWarning{french.ldf}%
+ {Option `GlobalLayoutFrench' skipped:\MessageBreak
+ French is *not* babel's last option.\MessageBreak
+ Reported}%
+ \fi}%
+% \end{macrocode}
+% If this key is set to \fbo{true} when French is the main language,
+% nothing to do: all flags keep their default value.
+% If this key is set to \fbo{false}, nothing to do either:
+% |\babel@save| will do the job.
+% \begin{macrocode}
+ \define@key{FB}{ReduceListSpacing}[true]%
+ {\csname FBReduceListSpacing#1\endcsname
+ \ifFBReduceListSpacing \FBStandardListSpacingfalse
+ \else \FBStandardListSpacingtrue\fi
+ }%
+ \define@key{FB}{StandardListSpacing}[true]%
+ {\csname FBStandardListSpacing#1\endcsname}%
+ \define@key{FB}{ListOldLayout}[true]%
+ {\csname FBListOldLayout#1\endcsname
+ \ifFBListOldLayout
+ \FBStandardEnumerateEnvtrue
+ \renewcommand*{\FrenchLabelItem}{\textendash}%
+ \fi}%
+ \define@key{FB}{CompactItemize}[true]%
+ {\csname FBCompactItemize#1\endcsname
+ \ifFBCompactItemize
+ \FBStandardItemizeEnvfalse
+ \FBStandardEnumerateEnvfalse
+ \else
+ \FBStandardItemizeEnvtrue
+ \FBStandardEnumerateEnvtrue
+ \fi}%
+ \define@key{FB}{StandardItemizeEnv}[true]%
+ {\csname FBStandardItemizeEnv#1\endcsname}%
+ \define@key{FB}{StandardEnumerateEnv}[true]%
+ {\csname FBStandardEnumerateEnv#1\endcsname}%
+ \define@key{FB}{StandardItemLabels}[true]%
+ {\csname FBStandardItemLabels#1\endcsname}%
+ \define@key{FB}{ItemLabels}%
+ {\renewcommand*{\FrenchLabelItem}{#1}}%
+ \define@key{FB}{ItemLabeli}%
+ {\renewcommand*{\Frlabelitemi}{#1}}%
+ \define@key{FB}{ItemLabelii}%
+ {\renewcommand*{\Frlabelitemii}{#1}}%
+ \define@key{FB}{ItemLabeliii}%
+ {\renewcommand*{\Frlabelitemiii}{#1}}%
+ \define@key{FB}{ItemLabeliv}%
+ {\renewcommand*{\Frlabelitemiv}{#1}}%
+ \define@key{FB}{StandardLists}[true]%
+ {\csname FBStandardLists#1\endcsname
+ \ifFBStandardLists
+ \FBStandardListSpacingtrue
+ \FBStandardItemizeEnvtrue
+ \FBStandardEnumerateEnvtrue
+ \FBStandardItemLabelstrue
+ \else
+ \FBStandardListSpacingfalse
+ \FBStandardItemizeEnvfalse
+ \FBStandardEnumerateEnvfalse
+ \FBStandardItemLabelsfalse
+ \fi}%
+ \define@key{FB}{ListItemsAsPar}[true]%
+ {\csname FBListItemsAsPar#1\endcsname}
+ \define@key{FB}{IndentFirst}[true]%
+ {\csname FBIndentFirst#1\endcsname}%
+ \define@key{FB}{FrenchFootnotes}[true]%
+ {\csname FBFrenchFootnotes#1\endcsname}%
+ \define@key{FB}{AutoSpaceFootnotes}[true]%
+ {\csname FBAutoSpaceFootnotes#1\endcsname}%
+ \define@key{FB}{AutoSpacePunctuation}[true]%
+ {\csname FBAutoSpacePunctuation#1\endcsname}%
+ \define@key{FB}{OriginalTypewriter}[true]%
+ {\csname FBOriginalTypewriter#1\endcsname}%
+ \define@key{FB}{ThinColonSpace}[true]%
+ {\csname FBThinColonSpace#1\endcsname
+ \ifFBThinColonSpace
+ \renewcommand*{\FBcolonspace}{\FBthinspace}%
+ \fi}%
+ \define@key{FB}{ThinSpaceInFrenchNumbers}[true]%
+ {\csname FBThinSpaceInFrenchNumbers#1\endcsname}%
+ \define@key{FB}{FrenchSuperscripts}[true]%
+ {\csname FBFrenchSuperscripts#1\endcsname}
+ \define@key{FB}{LowercaseSuperscripts}[true]%
+ {\csname FBLowercaseSuperscripts#1\endcsname}
+ \define@key{FB}{PartNameFull}[true]%
+ {\csname FBPartNameFull#1\endcsname}%
+ \define@key{FB}{CustomiseFigTabCaptions}[true]%
+ {\csname FBCustomiseFigTabCaptions#1\endcsname}%
+ \define@key{FB}{OldFigTabCaptions}[true]%
+ {\csname FBOldFigTabCaptions#1\endcsname
+ \ifFBOldFigTabCaptions
+ \def\FB@capsep@fix{\babel@save\FBCaption@Separator
+ \def\FBCaption@Separator{\CaptionSeparator}}%
+ \addto\extrasfrench{\FB@capsep@fix}%
+ \ifdefined\extrasacadian
+ \addto\extrasacadian{\FB@capsep@fix}%
+ \fi
+ \fi}%
+ \define@key{FB}{SmallCapsFigTabCaptions}[true]%
+ {\csname FBSmallCapsFigTabCaptions#1\endcsname
+ \ifFBSmallCapsFigTabCaptions
+ \let\FBfigtabshape\scshape
+ \else
+ \let\FBfigtabshape\relax
+ \fi}%
+ \define@key{FB}{SuppressWarning}[true]%
+ {\csname FBSuppressWarning#1\endcsname
+ \ifFBSuppressWarning
+ \renewcommand{\FBWarning}[1]{}%
+ \fi}%
+% \end{macrocode}
+% Here are the options controlling French guillemets spacing
+% and the output of |\frquote{}|.
+%
+% \changes{v3.2g}{2017/01/30}{Warn when wrong values are provided to
+% options EveryParGuill or EveryLineGuill.}
+%
+% \begin{macrocode}
+ \define@key{FB}{INGuillSpace}[true]%
+ {\csname FBINGuillSpace#1\endcsname
+ \ifFBINGuillSpace
+ \renewcommand*{\FBguillspace}{\space}%
+ \fi}%
+ \define@key{FB}{InnerGuillSingle}[true]%
+ {\csname FBInnerGuillSingle#1\endcsname}%
+ \define@key{FB}{EveryParGuill}[open]%
+ {\expandafter\let\expandafter
+ \FBeveryparguill\csname FBguill#1\endcsname
+ \ifx\FBeveryparguill\FBguillopen
+ \else\ifx\FBeveryparguill\FBguillclose
+ \else\ifx\FBeveryparguill\FBguillnone
+ \else
+ \let\FBeveryparguill\FBguillopen
+ \FBWarning{Wrong value for `EveryParGuill':
+ try `open',\MessageBreak
+ `close' or `none'. Reported}%
+ \fi
+ \fi
+ \fi}%
+ \define@key{FB}{EveryLineGuill}[open]%
+ {\ifFB@luatex@punct
+ \expandafter\let\expandafter
+ \FBeverylineguill\csname FBguill#1\endcsname
+ \ifx\FBeverylineguill\FBguillopen
+ \else\ifx\FBeverylineguill\FBguillclose
+ \else\ifx\FBeverylineguill\FBguillnone
+ \else
+ \let\FBeverylineguill\FBguillnone
+ \FBWarning{Wrong value for `EveryLineGuill':
+ try `open',\MessageBreak
+ `close' or `none'. Reported}%
+ \fi
+ \fi
+ \fi
+ \else
+ \FBWarning{Option `EveryLineGuill' skipped:%
+ \MessageBreak this option is for
+ LuaTeX *only*.\MessageBreak Reported}%
+ \fi}%
+% \end{macrocode}
+%
+% \changes{v3.3c}{2017/07/23}{New option `UnicodeNoBreakSpaces’ for
+% html translators (LuaLaTeX only).}
+%
+% Option \fbo{UnicodeNoBreakSpaces} (LuaLaTeX only) is meant for
+% HTML translators: when true, all non-breaking spaces added by
+% \frenchb{} are coded in the PDF file as Unicode characters, namely
+% U+A0 or U+202F, instead of penalties and glues.
+% \begin{macrocode}
+ \define@key{FB}{UnicodeNoBreakSpaces}[true]%
+ {\ifFB@luatex@punct
+ \csname FBucsNBSP#1\endcsname
+ \ifFBucsNBSP \FB@ucsNBSP=1 \fi
+ \else
+ \FBWarning{Option `UnicodeNoBreakSpaces' skipped:%
+ \MessageBreak this option is for
+ LuaTeX *only*.\MessageBreak Reported}%
+ \fi
+ }%
+% \end{macrocode}
+% Inputing French quotes as \emph{single characters} when they are
+% available on the keyboard (through a compose key for instance)
+% is more comfortable than typing |\og| and |\fg|.
+%
+% Life is simple here with modern LuaTeX or XeTeX engines: we just
+% have to activate the |\FB@addGUILspace| attribute for LuaTeX or
+% set |\XeTeXcharclass| of quotes to the proper value for XeTeX.
+%
+%\changes{v2.4c}{2010/05/23}{In \cs{ttfamilyFB}, also cancel
+% automatic spaces inside French guillemets coded as characters
+% (see \cs{frenchbsetup}).}
+%
+% \changes{v2.5g}{2011/12/31}{When \cs{ifFB@xetex@punct} is true,
+% `og’ and `fg’ options now set XeTeXcharclasses of these characters
+% to \cs{FB@guilo} and \cs{FB@guilf}. Otherwise French
+% quotes behave as normal characters (their XeTeXcharclass is 0).}
+%
+% \changes{v2.6h}{2014/01/03}{\cs{FG@og} and \cs{FG@fg} changed:
+% former clumsy code removed.}
+%
+% \changes{v3.1a}{2014/06/16}{Codes 0x13 and 0x14 added for French
+% quotes in T1-encoding. Support for older versions of LuaTeX and
+% XeTeX dropped.}
+%
+% \changes{v3.2c}{2016/05/03}{Add a warning about options og/fg for old
+% XeTeX or LuaTeX engines requiring active characters.}
+%
+% \changes{v3.4d}{2018/04/11}{New test for deciding about utf8 encoding
+% for keys og and fg (the former one fails with LaTeX 2018 release).}
+%
+% With pdfTeX (or old LuaTeX and XeTeX engines), quote characters
+% are made active and expand to |\og\ignorespaces| and |{\fg}|
+% respectively if the current language is French, and to
+% |\guillemotleft| and |\guillemotright| otherwise (think of German
+% quotes), this is done by |\FB@@og| and |\FB@@fg|; thus correct
+% non-breaking spaces will be added automatically to French quotes.
+% The quote characters typed in depend on the input encoding,
+% it can be single-byte (latin1, latin9, applemac,\dots) or
+% multi-bytes (utf-8, utf8x); the next command is meant for checking
+% whether a character is single-byte (|\FB@second| is empty) or not.
+% \begin{macrocode}
+ \def\FB@parse#1#2\endparse{\def\FB@second{#2}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \define@key{FB}{og}%
+ {\ifFBunicode
+% \end{macrocode}
+% LuaTeX or XeTeX in use, first try modern LuaTeX: we just need
+% to set LuaTeX’s attribute |\FB@addGUILspace| to 1,
+% \begin{macrocode}
+ \ifFB@luatex@punct
+ \FB@addGUILspace=1 \relax
+ \fi
+% \end{macrocode}
+% then with XeTeX it is a bit more tricky:
+% \begin{macrocode}
+ \ifFB@xetex@punct
+% \end{macrocode}
+% |\XeTeXinterchartokenstate| is defined, we just need to set
+% |\XeTeXcharclass| to |\FB@guilo| for the French opening quote
+% in T1 and Unicode encoding (see subsection~\ref{ssec-punct}).
+% \begin{macrocode}
+ \XeTeXcharclass"13 = \FB@guilo
+ \XeTeXcharclass"AB = \FB@guilo
+ \XeTeXcharclass"A0 = \FB@guilnul
+ \XeTeXcharclass"202F = \FB@guilnul
+ \fi
+% \end{macrocode}
+% Issue a warning with older Unicode engines requiring active
+% characters.
+% \begin{macrocode}
+ \ifFB@active@punct
+ \FBWarning{Option og=« not supported with this version
+ of\MessageBreak LuaTeX/XeTeX; reported}%
+ \fi
+ \else
+% \end{macrocode}
+% This is for conventional TeX engines:
+% \begin{macrocode}
+ \newcommand*{\FB@@og}{%
+ \ifFBfrench
+ \ifFB@spacing\FB@og\ignorespaces
+ \else\guillemotleft
+ \fi
+ \else\guillemotleft\fi}%
+ \AtBeginDocument{%
+ \ifdefined\uc@dclc
+% \end{macrocode}
+% Package \pkg{inputenc} with utf8x (ucs) encoding loaded,
+% use |\uc@dclc|:
+% \begin{macrocode}
+ \uc@dclc{171}{default}{\FB@@og}%
+ \else
+% \end{macrocode}
+% if encoding is not utf8x, check if the argument of |og|
+% is a single-byte character:
+% \begin{macrocode}
+ \FB@parse#1\endparse
+ \ifx\FB@second\@empty
+% \end{macrocode}
+% This means 8-bit character encoding.
+% Package \pkg{MULEenc} (from CJK) defines |\mule@def|
+% to map characters to control sequences.
+% \begin{macrocode}
+ \ifdefined\mule@def
+ \mule@def{11}{\FB@@og}%
+ \else
+ \ifdefined\DeclareInputText
+ \@tempcnta`#1\relax
+ \DeclareInputText{\the\@tempcnta}{\FB@@og}%
+ \else
+% \end{macrocode}
+% Package \pkg{inputenc} not loaded, no way\dots{}
+% \begin{macrocode}
+ \FBWarning{Option `og' requires package
+ inputenc;\MessageBreak reported}%
+ \fi
+ \fi
+ \else
+% \end{macrocode}
+% This means multi-byte character encoding, we assume UTF-8
+% \begin{macrocode}
+ \DeclareUnicodeCharacter{00AB}{\FB@@og}%
+ \fi
+ \fi}%
+ \fi
+ }%
+% \end{macrocode}
+%
+% Same code for the closing quote.
+% \begin{macrocode}
+ \define@key{FB}{fg}%
+ {\ifFBunicode
+ \ifFB@luatex@punct
+ \FB@addGUILspace=1 \relax
+ \fi
+ \ifFB@xetex@punct
+ \XeTeXcharclass"14 = \FB@guilf
+ \XeTeXcharclass"BB = \FB@guilf
+ \XeTeXcharclass"A0 = \FB@guilnul
+ \XeTeXcharclass"202F = \FB@guilnul
+ \fi
+ \ifFB@active@punct
+ \FBWarning{Option fg=» not supported with this version
+ of\MessageBreak LuaTeX/XeTeX; reported}%
+ \fi
+ \else
+ \newcommand*{\FB@@fg}{%
+ \ifFBfrench
+ \ifFB@spacing\FB@fg
+ \else\guillemotright
+ \fi
+ \else\guillemotright\fi}%
+ \AtBeginDocument{%
+ \ifdefined\uc@dclc
+ \uc@dclc{187}{default}{\FB@@fg}%
+ \else
+ \FB@parse#1\endparse
+ \ifx\FB@second\@empty
+ \ifdefined\mule@def
+ \mule@def{27}{{\FB@@fg}}%
+ \else
+ \ifdefined\DeclareInputText
+ \@tempcnta`#1\relax
+ \DeclareInputText{\the\@tempcnta}{\FB@@fg}%
+ \else
+ \FBWarning{Option `fg' requires package
+ inputenc;\MessageBreak reported}%
+ \fi
+ \fi
+ \else
+ \DeclareUnicodeCharacter{00BB}{\FB@@fg}%
+ \fi
+ \fi}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FBprocess@options}
+% |\FBprocess@options| will be executed at |\begin{document}|:
+% it first checks about packages loaded in the preamble (possibly
+% after \babel) which customise lists: currently \pkg{enumitem},
+% \pkg{paralist} and \pkg{enumerate}; then it processes the options
+% as set by \fbsetup{} or forced for compatibility with packages
+% loaded in the preamble.
+%
+% When French is the main language, |\extrasfrench| and
+% |\captionsfrench| \emph{have already been processed} by \babel{}
+% at |\begin{document}| \emph{before} |\FBprocess@options|.
+% \begin{macrocode}
+\newcommand*{\FBprocess@options}{%
+% \end{macrocode}
+% Update flags if a package customising lists has been loaded,
+% currently: \pkg{enumitem}, \pkg{paralist}, \pkg{enumerate}.
+% \begin{macrocode}
+ \@ifpackageloaded{enumitem}{%
+ \ifFBStandardItemizeEnv
+ \else
+ \FBStandardItemizeEnvtrue
+ \PackageInfo{french.ldf}%
+ {Setting StandardItemizeEnv=true for\MessageBreak
+ compatibility with enumitem package,\MessageBreak
+ reported}%
+ \fi
+ \ifFBStandardEnumerateEnv
+ \else
+ \FBStandardEnumerateEnvtrue
+ \PackageInfo{french.ldf}%
+ {Setting StandardEnumerateEnv=true for\MessageBreak
+ compatibility with enumitem package,\MessageBreak
+ reported}%
+ \fi}{}%
+ \@ifpackageloaded{paralist}{%
+ \ifFBStandardItemizeEnv
+ \else
+ \FBStandardItemizeEnvtrue
+ \PackageInfo{french.ldf}%
+ {Setting StandardItemizeEnv=true for\MessageBreak
+ compatibility with paralist package,\MessageBreak
+ reported}%
+ \fi
+ \ifFBStandardEnumerateEnv
+ \else
+ \FBStandardEnumerateEnvtrue
+ \PackageInfo{french.ldf}%
+ {Setting StandardEnumerateEnv=true for\MessageBreak
+ compatibility with paralist package,\MessageBreak
+ reported}%
+ \fi}{}%
+ \@ifpackageloaded{enumerate}{%
+ \ifFBStandardEnumerateEnv
+ \else
+ \FBStandardEnumerateEnvtrue
+ \PackageInfo{french.ldf}%
+ {Setting StandardEnumerateEnv=true for\MessageBreak
+ compatibility with enumerate package,\MessageBreak
+ reported}%
+ \fi}{}%
+% \end{macrocode}
+% Reset |\FB@ufl|’s normal meaning and update lists’ settings
+% now in case French is the main language: \hlabel{FB@ufl}
+% \begin{macrocode}
+ \def\FB@ufl{\update@frenchlists}
+ \ifFB@mainlanguage@FR
+ \update@frenchlists
+ \fi
+% \end{macrocode}
+% The layout of footnotes is handled at the |\begin{document}|
+% depending on the values of flags \fbo{FrenchFootnotes}
+% and \fbo{AutoSpaceFootnotes} (see section~\ref{ssec-footnotes}),
+% nothing has to be done here for footnotes.
+%
+% \fbo{AutoSpacePunctuation} adds a non-breaking space (in French
+% only) before the four active characters (:;!?) even if none has
+% been typed before them.
+% \begin{macrocode}
+ \ifFBAutoSpacePunctuation
+ \autospace@beforeFDP
+ \else
+ \noautospace@beforeFDP
+ \fi
+% \end{macrocode}
+% When \fbo{OriginalTypewriter} is set to \fbo{false} (the default),
+% |\ttfamily|, |\rmfamily| and |\sffamily| are redefined as
+% |\ttfamilyFB|, |\rmfamilyFB| and |\sffamilyFB| respectively
+% to prevent addition of automatic spaces before the four active
+% characters in computer code.
+% \begin{macrocode}
+ \ifFBOriginalTypewriter
+ \else
+ \let\ttfamilyORI\ttfamily
+ \let\rmfamilyORI\rmfamily
+ \let\sffamilyORI\sffamily
+ \let\ttfamily\ttfamilyFB
+ \let\rmfamily\rmfamilyFB
+ \let\sffamily\sffamilyFB
+ \fi
+% \end{macrocode}
+%
+% When package \pkg{numprint} is loaded with option
+% \opt{autolanguage}, \pkg{numprint}’s command |\npstylefrench| has
+% to be redefined differently according to the value of flag
+% \fbo{ThinSpaceInFrenchNumbers}.
+% As |\npstylefrench| was undefined in old versions of
+% \pkg{numprint}, we provide this command.
+% \begin{macrocode}
+ \@ifpackageloaded{numprint}%
+ {\ifnprt@autolanguage
+ \providecommand*{\npstylefrench}{}%
+ \ifFBThinSpaceInFrenchNumbers
+ \renewcommand*{\FBthousandsep}{\,}%
+ \fi
+ \g@addto@macro\npstylefrench{\npthousandsep{\FBthousandsep}}%
+ \fi
+ }{}%
+% \end{macrocode}
+% \fbo{FrenchSuperscripts}: if \fbo{true} |\up=\fup|, else
+% |\up=\textsuperscript|. Anyway |\up*=\FB@up@fake|. The star-form
+% |\up*{}| is provided for fonts that lack some superior letters:
+% Adobe Jenson Pro and Utopia Expert have no ``g superior’’ for
+% instance.
+% \begin{macrocode}
+ \ifFBFrenchSuperscripts
+ \DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}{\fup}}%
+ \else
+ \DeclareRobustCommand*{\up}{\@ifstar{\FB@up@fake}%
+ {\textsuperscript}}%
+ \fi
+% \end{macrocode}
+% \fbo{LowercaseSuperscripts}: if \fbo{false} |\FB@lc| is redefined
+% to do nothing.
+% \begin{macrocode}
+ \ifFBLowercaseSuperscripts
+ \else
+ \renewcommand*{\FB@lc}[1]{##1}%
+ \fi
+% \end{macrocode}
+%
+% \changes{v3.0a}{2014/02/20}{With koma-script and memoir class,
+% customise \cs{captionformat} and \cs{captiondelim}.}
+%
+% \changes{v3.1f}{2015/05/31}{Definition of \cs{captionformat} and
+% \cs{captiondelim} changed when option CustomiseFigTabCaptions
+% is set to false.}
+%
+% \changes{v3.1f}{2015/05/31}{Bug fix for the beamer class:
+% figure and table captions are now consistent with babel-french’s
+% documentation. Pointed out by Denis Bitouzé.}
+%
+% Unless \fbo{CustomiseFigTabCaptions} has been set to \fbo{false},
+% use |\CaptionSeparator| for koma-script, \cls{memoir} and
+% \cls{beamer} classes.
+% \begin{macrocode}
+ \ifFBCustomiseFigTabCaptions
+ \ifFB@koma
+ \renewcommand*{\captionformat}{\CaptionSeparator}%
+ \fi
+ \@ifclassloaded{memoir}%
+ {\captiondelim{\CaptionSeparator}}{}%
+ \@ifclassloaded{beamer}%
+ {\defbeamertemplate{caption label separator}{FBcustom}{%
+ \CaptionSeparator}%
+ \setbeamertemplate{caption label separator}[FBcustom]}{}%
+ \else
+% \end{macrocode}
+% When \fbo{CustomiseFigTabCaptions} is \fbo{false}, have the colon
+% behave properly in French: locally force |\autospace@beforeFDP| in
+% case of \fbo{AutoSpacePunctuation=false}.
+% \begin{macrocode}
+ \ifFB@koma
+ \renewcommand*{\captionformat}{{\autospace@beforeFDP : }}%
+ \fi
+ \@ifclassloaded{memoir}%
+ {\captiondelim{{\autospace@beforeFDP : }}%
+ }{}%
+ \@ifclassloaded{beamer}%
+ {\defbeamertemplate{caption label separator}{FBcolon}{%
+ {\autospace@beforeFDP : }}%
+ \setbeamertemplate{caption label separator}[FBcolon]%
+ }{}%
+ \fi
+% \end{macrocode}
+% \fbo{ShowOptions}: if \fbo{true}, print the list of all options
+% to the \file{.log} file.
+% \begin{macrocode}
+ \ifFBShowOptions
+ \GenericWarning{* }{%
+ ***** List of possible options for babel-french ****\MessageBreak
+ [Default values between brackets when french is loaded *LAST*]%
+ \MessageBreak
+ ShowOptions=true [false]\MessageBreak
+ StandardLayout=true [false]\MessageBreak
+ GlobalLayoutFrench=false [true]\MessageBreak
+ PartNameFull=false [true]\MessageBreak
+ IndentFirst=false [true]\MessageBreak
+ ListItemsAsPar=true [false]\MessageBreak
+ StandardListSpacing=true [false]\MessageBreak
+ StandardItemizeEnv=true [false]\MessageBreak
+ StandardEnumerateEnv=true [false]\MessageBreak
+ StandardItemLabels=true [false]\MessageBreak
+ ItemLabels=\textemdash, \textbullet,
+ \protect\ding{43},... [\textendash]\MessageBreak
+ ItemLabeli=\textemdash, \textbullet,
+ \protect\ding{43},... [\textendash]\MessageBreak
+ ItemLabelii=\textemdash, \textbullet,
+ \protect\ding{43},... [\textendash]\MessageBreak
+ ItemLabeliii=\textemdash, \textbullet,
+ \protect\ding{43},... [\textendash]\MessageBreak
+ ItemLabeliv=\textemdash, \textbullet,
+ \protect\ding{43},... [\textendash]\MessageBreak
+ StandardLists=true [false]\MessageBreak
+ ListOldLayout=true [false]\MessageBreak
+ FrenchFootnotes=false [true]\MessageBreak
+ AutoSpaceFootnotes=false [true]\MessageBreak
+ AutoSpacePunctuation=false [true]\MessageBreak
+ ThinColonSpace=true [false]\MessageBreak
+ OriginalTypewriter=true [false]\MessageBreak
+ UnicodeNoBreakSpaces=true [false]\MessageBreak
+ og= <left quote character>, fg= <right quote character>%
+ INGuillSpace=true [false]\MessageBreak
+ EveryParGuill=open, close, none [open]\MessageBreak
+ EveryLineGuill=open, close, none
+ [open in LuaTeX, none otherwise]\MessageBreak
+ InnerGuillSingle=true [false]\MessageBreak
+ ThinSpaceInFrenchNumbers=true [false]\MessageBreak
+ SmallCapsFigTabCaptions=false [true]\MessageBreak
+ CustomiseFigTabCaptions=false [true]\MessageBreak
+ OldFigTabCaptions=true [false]\MessageBreak
+ FrenchSuperscripts=false [true]\MessageBreak
+ LowercaseSuperscripts=false [true]\MessageBreak
+ SuppressWarning=true [false]\MessageBreak
+ \MessageBreak
+ *********************************************%
+ \MessageBreak\protect\frenchsetup{ShowOptions}}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v2.0}{2006/12/06}{Added warning for OT1 encoding.}
+%
+% \changes{v2.1b}{2008/04/07}{Disable some commands in bookmarks.}
+%
+% \changes{v2.5e}{2011/04/03}{\cs{pdfstringdefDisableCommands} should
+% redefine \cs{FB@og} and \cs{FB@fg} instead of \cs{og} and \cs{fg}
+% so that it works also when quotes are entered as characters.
+% Reported by Sébastien Gouezel.}
+%
+% At |\begin{document}|, we have to provide an |\xspace| command
+% in case the \pkg{xspace} package is not loaded, do some setup for
+% \file{hyperref}’s bookmarks, execute |\FBprocess@options|, switch
+% LuaTeX punctuation on and issue some warnings if necessary.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \providecommand*{\xspace}{\relax}%
+% \end{macrocode}
+%
+% \changes{v2.5g}{2011/11/13}{Redefine \cs{degre}, \cs{degres} \cs{at}
+% \cs{circonflexe} and \cs{tild} for bookmarks. Add \cs{fup} also.}
+%
+% \changes{v3.2g}{2017/01/24}{Add \cs{boi} to redefinitions for
+% bookmarks.}
+%
+% \changes{v3.5d}{2018/12/16}{Add \cs{frquote} to redefinitions for
+% bookmarks.}
+%
+% Let’s redefine some commands in \file{hyperref}’s bookmarks.
+% \begin{macrocode}
+ \ifdefined\pdfstringdefDisableCommands
+ \pdfstringdefDisableCommands{%
+ \let\up\relax
+ \let\fup\relax
+ \let\degre\textdegree
+ \let\degres\textdegree
+ \def\ieme{e\xspace}%
+ \def\iemes{es\xspace}%
+ \def\ier{er\xspace}%
+ \def\iers{ers\xspace}%
+ \def\iere{re\xspace}%
+ \def\ieres{res\xspace}%
+ \def\FrenchEnumerate#1{#1\degre\space}%
+ \def\FrenchPopularEnumerate#1{#1\degre)\space}%
+ \def\No{N\degre\space}%
+ \def\no{n\degre\space}%
+ \def\Nos{N\degre\space}%
+ \def\nos{n\degre\space}%
+ \def\FB@og{\guillemotleft\space}%
+ \def\FB@fg{\space\guillemotright}%
+ \def\frquote#1{\FB@og #1\FB@fg}%
+ \def\at{@}%
+ \def\circonflexe{\string^}%
+ \def\tild{\string~}%
+ \def\boi{\textbackslash}%
+ \let\bsc\textsc
+ }%
+ \fi
+% \end{macrocode}
+% Let’s now process the remaining options, either not explicitly
+% set by \fbsetup{} or possibly modified by packages loaded after
+% \frenchb.
+% \begin{macrocode}
+ \FBprocess@options
+% \end{macrocode}
+% When option \fbo{UnicodeNoBreakSpaces} is \fbo{true}
+% (LuaLaTeX only) we need to redefine |\FBmedkern|, |\FBthickkern|
+% and |\FBthousandsep| as Unicode characters.
+% \begin{macrocode}
+ \ifFBucsNBSP
+ \renewcommand*{\FBmedkern}{\char"202F\relax}%
+ \renewcommand*{\FBthickkern}{\char"A0\relax}%
+ \ifFBThinSpaceInFrenchNumbers
+ \renewcommand*{\FBthousandsep}{\char"202F\relax}%
+ \else
+ \renewcommand*{\FBthousandsep}{\char"A0\relax}%
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \changes{v3.0a}{2014/01/28}{Test \cs{ifXeTeX} changed to
+% \cs{ifFBunicode} and `xltxtra’ changed to `fontspec’.}
+%
+% \changes{v3.1a}{2014/06/14}{fontspec is not required for T1 fonts
+% used with the luainputenc.sty package.}
+%
+% \changes{v3.2g}{2017/01/24}{fontspec defines TU encoding now and
+% no longer loads xunicode.sty. Test changed.}
+%
+% \changes{v3.3c}{2017/09/06}{LaTeX 2017-04-15 defines TU encoding
+% for Unicode engines, fontspec is no longer required.}
+%
+% Finally, a warning is issued with pdfLaTeX when OT1 encoding
+% is in use at the |\begin{document}|; mind that |\encodingdefault|
+% is defined as `long’, the test would fail if |\FBOTone| was
+% defined with |\newcommand*|!
+% \begin{macrocode}
+ \begingroup
+ \newcommand{\FBOTone}{OT1}%
+ \ifx\encodingdefault\FBOTone
+ \FBWarning{OT1 encoding should not be used for French.%
+ \MessageBreak
+ Add \protect\usepackage[T1]{fontenc} to the
+ preamble\MessageBreak of your document; reported}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+%
+% \subsection{French lists}
+% \label{ssec-lists}
+%
+% \changes{v2.6a}{2013/01/30}{Bug correction: changing \cs{leftmargin}
+% cannot be done only for itemize-lists: it messes up
+% embedded enumerate lists. Pointed out by Denis Bitouzé.
+% Lists have been completely redesigned in frenchb v.~2.6a.
+% An option for backward compatibility is provided.}
+%
+% \begin{macro}{\listFB}
+% \begin{macro}{\listORI}
+% \begin{macro}{\FB@listVsettings}
+% Vertical spacing in lists should be shorter in French texts than
+% the defaults provided by LaTeX.
+% Note that the easy way, just changing values of vertical spacing
+% parameters when entering French and restoring them to their
+% defaults on exit would not work; so we define the command
+% |\FB@listVsettings| to hold the settings to be used by
+% the French variant |\listFB| of |\list|. Note that switching
+% to |\listFB| reduces vertical spacing in \emph{all} environments
+% built on |\list|: |itemize|, |enumerate|, |description|, but also
+% |abstract|, |quotation|, |quote| and |verse|\dots{}
+%
+% The amount of vertical space before and after a list is given by
+% |\topsep| + |\parskip| (+ |\partopsep| if the list starts a new
+% paragraph). IMHO, |\parskip| should be added \emph{only} when
+% the list starts a new paragraph, so I subtract |\parskip| from
+% |\topsep| and add it back to |\partopsep|; this will normally
+% make no difference because |\parskip|’s default value is 0pt, but
+% will be noticeable when |\parskip| is \emph{not} null.
+%
+% \begin{macrocode}
+\let\listORI\list
+\let\endlistORI\endlist
+\def\FB@listVsettings{%
+ \setlength{\itemsep}{0.4ex plus 0.2ex minus 0.2ex}%
+ \setlength{\parsep}{0.4ex plus 0.2ex minus 0.2ex}%
+ \setlength{\topsep}{0.8ex plus 0.4ex minus 0.4ex}%
+ \setlength{\partopsep}{0.4ex plus 0.2ex minus 0.2ex}%
+% \end{macrocode}
+% |\parskip| is of type `skip’, its mean value only (\emph{not
+% the glue}) should be subtracted from |\topsep| and added to
+% |\partopsep|, so convert |\parskip| to a `dimen’ using
+% |\@tempdima|.
+% \begin{macrocode}
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}%
+}
+\def\listFB#1#2{\listORI{#1}{\FB@listVsettings #2}}
+\let\endlistFB\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Let’s now consider French itemize-lists. They differ from those
+% provided by the standard LaTeX classes:
+% \begin{itemize}
+% \item The `\textbullet’ is never used in French itemize-lists,
+% an emdash `---’ or an endash `--’ is preferred for all
+% levels. The item label to be used in French is stored in
+% |\FrenchLabelItem}|, it defaults to `---’ and can be changed
+% using \fbsetup{} (see section~\ref{ssec-keyval}).
+% \item Vertical spacing between items, before and after
+% the list, should be \emph{null} with \emph{no glue} added;
+% \item In French the labels of itemize-lists are vertically
+% aligned as shown p.~\pageref{ListAsPar}.
+% \end{itemize}
+%
+% \begin{macro}{\FrenchLabelItem}
+% \changes{v2.6a}{2013/01/30}{default changed from \cs{textendash} to
+% \cs{textemdash}.}
+% \begin{macro}{\Frlabelitemi}
+% \begin{macro}{\Frlabelitemii}
+% \begin{macro}{\Frlabelitemiii}
+% \begin{macro}{\Frlabelitemiv}
+% Default labels for French itemize-lists (same label for all levels):
+% \begin{macrocode}
+\newcommand*{\FrenchLabelItem}{\textemdash}
+\newcommand*{\Frlabelitemi}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemii}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemiii}{\FrenchLabelItem}
+\newcommand*{\Frlabelitemiv}{\FrenchLabelItem}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\listindentFB}
+% \begin{macro}{\descindentFB}
+% \begin{macro}{\labelindentFB}
+% \begin{macro}{\labelwidthFB}
+% Let’s define four dimens |\listindentFB|, |\descindentFB|,
+% |\labelindentFB| and |\labelwidthFB| to customise lists’ horizontal
+% indentations.
+% They are given silly negative values here in order to eventually
+% enable their customisation in the preamble. They will get
+% reasonnable defaults later when entering French (see
+% |\setlabelitemsFB| and |\setlistindentFB|) unless they have been
+% customised.
+% \begin{macrocode}
+\newdimen\listindentFB
+\setlength{\listindentFB}{-1pt}
+\newdimen\descindentFB
+\setlength{\descindentFB}{-1pt}
+\newdimen\labelindentFB
+\setlength{\labelindentFB}{-1pt}
+\newdimen\labelwidthFB
+\setlength{\labelwidthFB}{-1pt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{v3.2e}{2016/10/28}{Add missing redefinitions for
+% \cs{leftmarginv}, \cs{leftmarginvi}. Suggested by J.F. Burnol.}
+%
+% \changes{v3.5a}{2018/07/04}{New optional layout for lists:
+% lists’ items can be typeset as paragraphs with indented labels
+% while the default leaves the labels hanging into the left margin.}
+%
+% \begin{macro}{\leftmarginFB}
+% \begin{macro}{\FB@listHsettings}
+% |\FB@listHsettings| holds the new horizontal settings chosen for
+% French lists \env{itemize}, \env{enumerate} and \env{description}
+% (two possible layouts).
+% \begin{macrocode}
+\newdimen\leftmarginFB
+\def\FB@listHsettings{%
+ \ifFBListItemsAsPar
+% \end{macrocode}
+% Optional layout: lists’ items are typeset as paragraphs with
+% indented labels.
+% \begin{macrocode}
+ \itemindent=\labelindentFB
+ \advance\itemindent by \labelwidthFB
+ \advance\itemindent by \labelsep
+ \leftmargini\z@
+ \bbl@for\FB@dp {2, 3, 4, 5, 6}%
+ {\csname leftmargin\romannumeral\FB@dp\endcsname=\labelindentFB}%
+ \else
+% \end{macrocode}
+% Default layout: labels hanging into the left margin.
+% \begin{macrocode}
+ \leftmarginFB=\labelwidthFB
+ \advance\leftmarginFB by \labelsep
+ \bbl@for\FB@dp {1, 2, 3, 4, 5, 6}%
+ {\csname leftmargin\romannumeral\FB@dp\endcsname=\leftmarginFB}%
+ \advance\leftmargini by \listindentFB
+ \fi
+ \leftmargin=\csname leftmargin\ifnum\@listdepth=\@ne i\else
+ ii\fi\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\itemizeFB}
+% \begin{macro}{\FB@itemizesettings}
+%
+% \changes{v2.6f}{2013/11/25}{\cs{labelwidth} must be reset, f.i. when
+% an itemize list occurs inside environments based on trivlist which
+% set \cs{labelwidth} to 0 (see proof environment in amsthm.sty).
+% Bug pointed out by Julien Hauseux.}
+%
+% \changes{v2.6g}{2013/12/30}{Suppress all vertical spaces only if
+% ReduceListSpacing is true. Pointed out by Pierre Willaime.}
+%
+% New environment for French itemize-lists.\\ |\FB@itemizesettings|
+% does two things: first suppress all vertical spaces including glue
+% unless option \fbo{StandardListSpacing} is set, then set horizontal
+% indentations according to |\FB@listHsettings| unless option
+% \fbo{ListOldLayout} is \fbo{true} (compatibility with lists
+% up to v.~2.5k).
+% \begin{macrocode}
+\def\FB@itemizesettings{%
+ \ifFBStandardListSpacing
+ \else
+ \setlength{\itemsep}{\z@}%
+ \setlength{\parsep}{\z@}%
+ \setlength{\topsep}{\z@}%
+ \setlength{\partopsep}{\z@}%
+ \@tempdima=\parskip
+ \addtolength{\topsep}{-\@tempdima}%
+ \addtolength{\partopsep}{\@tempdima}%
+ \fi
+ \settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
+ \ifFBListOldLayout
+ \setlength{\leftmargin}{\labelwidth}%
+ \addtolength{\leftmargin}{\labelsep}%
+ \addtolength{\leftmargin}{\parindent}%
+ \else
+ \FB@listHsettings
+ \fi
+}
+% \end{macrocode}
+% The definition of |\itemizeFB| follows the one of |\itemize|
+% in standard LaTeX classes (see \file{ltlists.dtx}),
+% spaces are customised by |\FB@itemizesettings|.
+%
+% \begin{macrocode}
+\def\itemizeFB{%
+ \ifnum \@itemdepth >\thr@@\@toodeep\else
+ \advance\@itemdepth by \@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter
+ \listORI
+ \csname\@itemitem\endcsname
+ \FB@itemizesettings
+ \fi
+}
+\let\enditemizeFB\endlistORI
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\setlabelitemsFB{%
+ \let\labelitemi\Frlabelitemi
+ \let\labelitemii\Frlabelitemii
+ \let\labelitemiii\Frlabelitemiii
+ \let\labelitemiv\Frlabelitemiv
+ \ifdim\labelwidthFB<\z@
+ \settowidth{\labelwidthFB}{\FrenchLabelItem}%
+ \fi
+}
+\def\setlistindentFB{%
+ \ifdim\labelindentFB<\z@
+ \ifdim\parindent=\z@
+ \setlength{\labelindentFB}{1.5em}%
+ \else
+ \setlength{\labelindentFB}{\parindent}%
+ \fi
+ \fi
+ \ifdim\listindentFB<\z@
+ \ifdim\parindent=\z@
+ \setlength{\listindentFB}{1.5em}%
+ \else
+ \setlength{\listindentFB}{\parindent}%
+ \fi
+ \fi
+ \ifdim\descindentFB<\z@
+ \ifFBListItemsAsPar
+ \setlength{\descindentFB}{\labelindentFB}%
+ \else
+ \setlength{\descindentFB}{\listindentFB}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\enumerateFB}
+% The definition of |\enumerateFB|, new to version~2.6a, follows
+% the one of |\enumerate| in standard LaTeX classes (see
+% \file{ltlists.dtx}), vertical spaces are customised (or not)
+% via |\list| (=|\listFB| or |\listORI|) and horizontal spaces
+% (leftmargins) are borrowed from |itemize| lists via
+% |\FB@listHsettings|.
+%
+% \begin{macrocode}
+\def\enumerateFB{%
+ \ifnum \@enumdepth >\thr@@\@toodeep\else
+ \advance\@enumdepth by \@ne
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \expandafter
+ \list
+ \csname label\@enumctr\endcsname
+ {\FB@listHsettings
+ \usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
+ \fi
+}
+\let\endenumerateFB\endlistORI
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\descriptionFB}
+% \changes{v2.6b}{2013/02/10}{Settings of \cs{FB@listHsettings} should
+% apply to description lists too.}
+%
+% \changes{v3.0a}{2014/02/28}{Added \cs{listindentFB} to
+% \cs{itemindent}. Suggested by Denis Bitouzé.}
+%
+% \changes{v3.2d}{2014/07/01}{Changed \cs{listindentFB} to
+% \cs{descindentFB} which defaults to \cs{listindentFB}.
+% \cs{leftmargini} reduced when \cs{descindentFB} is null.}
+%
+% \changes{v3.5a}{2018/07/04}{ListItemsAsPar option taken into account
+% for description lists.}
+%
+% Same tuning for the \env{description} environment (see
+% \file{classes.dtx} for the original definition).
+% Customisable dimen |\descindentFB|, which defaults to
+% |\listindentFB|, is added to |\itemindent| (first level only).
+% When |\descindentFB=0pt| (1rst level labels start at the left
+% margin), |\leftmargini| is reduced to |\listindentFB| instead
+% of |\listindentFB| + |\leftmarginFB|.
+%
+% When option \fbo{ListItemsAsPar} is turned to \fbo{true}, the
+% \env{description} items are also displayed as paragraphs;
+% |\descindentFB=0pt| can be used to push labels to the left margin.
+% \begin{macrocode}
+\def\descriptionFB{%
+ \list{}{\FB@listHsettings
+ \labelwidth=\z@
+ \ifFBListItemsAsPar
+ \itemindent=\descindentFB
+ \else
+ \itemindent=-\leftmargin
+ \ifnum\@listdepth=1
+ \ifdim\descindentFB=\z@
+ \ifdim\listindentFB>\z@
+ \leftmargini=\listindentFB
+ \leftmargin=\leftmargini
+ \itemindent=-\leftmargin
+ \fi
+ \else
+ \advance\itemindent by \descindentFB
+ \fi
+ \fi
+ \fi
+ \let\makelabel\descriptionlabel}%
+}
+\let\enddescriptionFB\endlistORI
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\update@frenchlists}
+% \begin{macro}{\bbl@frenchlistlayout}
+% |\update@frenchlists| will set up lists according to the final
+% options (default or part of \fbsetup{} eventually overruled in
+% |\FBprocess@options|).
+% \begin{macrocode}
+\def\update@frenchlists{%
+ \setlistindentFB
+ \ifFBStandardListSpacing
+ \else \let\list\listFB \fi
+ \ifFBStandardItemizeEnv
+ \else \let\itemize\itemizeFB \fi
+ \ifFBStandardItemLabels
+ \else \setlabelitemsFB \fi
+ \ifFBStandardEnumerateEnv
+ \else \let\enumerate\enumerateFB \let\description\descriptionFB \fi
+}
+% \end{macrocode}
+%
+% \changes{v3.2h}{2017/02/03}{Execute \cs{update@frenchlists} only
+% if GlobalLayoutFrench is false.
+% Delete stuff for lists in \cs{noextrasfrench}.}
+%
+% If \fbo{GlobalLayoutFrench=true}, nothing has to be done at
+% language’s switches regarding lists. Otherwise, |\extrasfrench|
+% saves the standard settings for lists and then executes
+% |\update@frenchlists|. In both cases, there is nothing to do for
+% lists in |\noextrasfrench|.
+%
+% In order to ensure compatibility with packages customising lists,
+% the command |\update@frenchlists| should not be included in the
+% first call to |\extrasfrench| which occurs \emph{before} the
+% relevant flags are finally set, so we define |\FB@ufl| as
+% |\relax|, it will be redefined later `AtBeginDocument’ by
+% |\FBprocess@options| as |\update@frenchlists|,
+% see p.~\pageref{FB@ufl}.
+% \begin{macrocode}
+\def\FB@ufl{\relax}
+\def\bbl@frenchlistlayout{%
+ \ifFBGlobalLayoutFrench
+ \else
+ \babel@save\list \babel@save\itemize
+ \babel@save\enumerate \babel@save\description
+ \babel@save\labelitemi \babel@save\labelitemii
+ \babel@save\labelitemiii \babel@save\labelitemiv
+ \FB@ufl
+ \fi
+}
+\addto\extrasfrench{\bbl@frenchlistlayout}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{French indentation of sections}
+% \label{ssec-indent}
+%
+% \begin{macro}{\bbl@frenchindent}
+% \begin{macro}{\bbl@nonfrenchindent}
+% In French the first paragraph of each section should be indented,
+% this is another difference with US-English. This is controlled
+% by the flag |\if@afterindent|.
+%
+% \changes{v2.3d}{2009/03/16}{Bug correction: previous versions of
+% frenchb set the flag \cs{if@afterindent} to false outside
+% French which is correct for English but wrong for some languages
+% like Spanish. Pointed out by Juan José Torrens.}
+%
+% We will need to save the value of the flag |\if@afterindent|
+% `AtBeginDocument’ before eventually changing its value.
+%
+% \begin{macrocode}
+\def\bbl@frenchindent{%
+ \ifFBGlobalLayoutFrench
+ \else
+ \babel@save\@afterindentfalse
+ \fi
+ \ifFBIndentFirst
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue
+ \fi}
+\def\bbl@nonfrenchindent{%
+ \ifFBGlobalLayoutFrench
+ \ifFBIndentFirst
+ \@afterindenttrue
+ \fi
+ \fi}
+\addto\extrasfrench{\bbl@frenchindent}
+\addto\noextrasfrench{\bbl@nonfrenchindent}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Formatting footnotes}
+% \label{ssec-footnotes}
+%
+% \changes{v2.0}{2006/11/06}{Footnotes are now printed
+% by default `à la française’ for the whole document.}
+%
+% \changes{v2.0b}{2007/04/18}{Footnotes: Just do nothing
+% (except warning) when the bigfoot package is loaded.}
+%
+% The \pkg{bigfoot} package deeply changes the way footnotes are
+% handled. When \file{bigfoot} is loaded, we just warn the user
+% that \frenchb{} will drop the customisation of footnotes.
+%
+% The layout of footnotes is controlled by two flags
+% |\ifFBAutoSpaceFootnotes| and |\ifFBFrenchFootnotes| which are
+% set by options of \fbsetup{} (see section~\ref{ssec-keyval}).
+% The layout of footnotes \emph{does not depend} on the current
+% language (just think of two footnotes on the same page looking
+% different because one was called in a French part, the other one
+% in English!).
+%
+% We save the original definition of |\@footnotemark| at the
+% |\begin{document}| in order to include any customisation that
+% packages might have done; we define a variant |\@footnotemarkFB|
+% which just adds a thin space before the number or symbol calling
+% a footnote (any space typed in is removed first). The choice
+% between the two definitions (valid for the whole document) is
+% controlled by flag |\ifFBAutoSpaceFootnotes|.
+%
+% \changes{v2.4a}{2009/11/23}{\cs{PackageWarning} changed to
+% \cs{PackageInfo} (when bigfoot package in use).}
+%
+% \begin{macrocode}
+\AtBeginDocument{\@ifpackageloaded{bigfoot}%
+ {\PackageInfo{french.ldf}%
+ {bigfoot package in use.\MessageBreak
+ babel-french will NOT customise footnotes;%
+ \MessageBreak reported}}%
+ {\let\@footnotemarkORI\@footnotemark
+ \def\@footnotemarkFB{\leavevmode\unskip\unkern
+ \,\@footnotemarkORI}%
+ \ifFBAutoSpaceFootnotes
+ \let\@footnotemark\@footnotemarkFB
+ \fi}%
+ }
+% \end{macrocode}
+%
+% \begin{macro}{\@makefntextFB}
+% We then define |\@makefntextFB|, a variant of |\@makefntext|
+% which is responsible for the layout of footnotes, to match the
+% specifications of the French `Imprimerie Nationale’: footnotes
+% will be indented by |\parindentFFN|, numbers (if any) typeset on
+% the baseline (instead of superscripts), right aligned on
+% |\parindentFFN| and followed by a dot and an half quad kern.
+% Whenever symbols are used to number footnotes (as in |\thanks|
+% for instance), we switch back to the standard layout (the French
+% layout of footnotes is meant for footnotes numbered by arabic or
+% roman digits).
+%
+% \changes{v2.0}{2006/11/06}{\cs{parindentFFN} not changed if
+% already defined (required by JA for cah-gut.cls).}
+%
+% \changes{v2.3b}{2008/12/06}{New commands \cs{dotFFN} and
+% \cs{kernFFN} for more flexibility (suggested by JA).}
+%
+% \changes{v3.2a}{2016/03/14}{beamer.cls requires a specific
+% definition of \cs{@makefntextFB} (pointed out by DB).
+% The same is true for memoir and koma-script classes (done).}
+%
+% The value of |\parindentFFN| will be redefined at the
+% |\begin{document}|, as the maximum of |\parindent| and 1.5em
+% \emph{unless} it has been set in the preamble (the weird value
+% 10in is just for testing whether |\parindentFFN| has been set
+% or not).
+% \begin{macrocode}
+\newdimen\parindentFFN
+\parindentFFN=10in
+% \end{macrocode}
+% |\FBfnindent| will be set `AtBeginDocument’ to the width of
+% the box holding the footnote mark, |\dotFFN| and |\kernFFN|
+% (flushed right). It is used by \cls{memoir} and koma-script
+% classes.
+% \begin{macrocode}
+\newcommand*{\dotFFN}{.}
+\newcommand*{\kernFFN}{\kern .5em}
+\newdimen\FBfnindent
+% \end{macrocode}
+% |\@makefntextFB|’s definition is now tuned according to the
+% document’s class for better compatibility.
+%
+% Koma-script classes provide |\deffootnote|, a handy command
+% to customise the footnotes’ layout (see English manual
+% \file{scrguien.pdf}); it redefines |\@makefntext| and
+% |\@@makefnmark|. First, save the original definitions.
+% \begin{macrocode}
+\ifFB@koma
+ \let\@makefntextORI\@makefntext
+ \let\@@makefnmarkORI\@@makefnmark
+% \end{macrocode}
+% |\@makefntextFB| and |\@@makefnmarkFB| will be used when option
+% \fbo{FrenchFootnotes} is \fbo{true}.
+% \begin{macrocode}
+ \deffootnote[\FBfnindent]{0pt}{\parindentFFN}%
+ {\thefootnotemark\dotFFN\kernFFN}
+ \let\@makefntextFB\@makefntext
+ \let\@@makefnmarkFB\@@makefnmark
+% \end{macrocode}
+% |\@makefntextTH| and |\@@makefnmarkTH| are meant for the
+% |\thanks| command used by |\maketitle| when \fbo{FrenchFootnotes}
+% is \fbo{true}.
+% \begin{macrocode}
+ \deffootnote[\parindentFFN]{0pt}{\parindentFFN}%
+ {\textsuperscript{\thefootnotemark}}
+ \let\@makefntextTH\@makefntext
+ \let\@@makefnmarkTH\@@makefnmark
+% \end{macrocode}
+% Restore the original definitions.
+% \begin{macrocode}
+ \let\@makefntext\@makefntextORI
+ \let\@@makefnmark\@@makefnmarkORI
+\fi
+% \end{macrocode}
+% Definitions for the \cls{memoir} class:
+% \begin{macrocode}
+\@ifclassloaded{memoir}
+% \end{macrocode}
+% (see original definition in \file{memman.pdf})
+% \begin{macrocode}
+ {\newcommand{\@makefntextFB}[1]{%
+ \def\footscript##1{##1\dotFFN\kernFFN}%
+ \setlength{\footmarkwidth}{\FBfnindent}%
+ \setlength{\footmarksep}{-\footmarkwidth}%
+ \setlength{\footparindent}{\parindentFFN}%
+ \makefootmark #1}%
+ }{}
+% \end{macrocode}
+% Definitions for the \cls{beamer} class:
+% \begin{macrocode}
+\@ifclassloaded{beamer}
+% \end{macrocode}
+% (see original definition in \file{beamerbaseframecomponents.sty}),
+% note that for the \cls{beamer} class footnotes are LR-boxes, not
+% paragraphs, so |\parindentFFN| is irrelevant.
+% class.
+%
+% \changes{v3.2h}{2016/04/09}{With beamer.cls, add \cs{llap} to
+% \cs{@thefnmark} for notes numbered over 99.}
+%
+% \begin{macrocode}
+ {\def\@makefntextFB#1{%
+ \def\insertfootnotetext{#1}%
+ \def\insertfootnotemark{\insertfootnotemarkFB}%
+ \usebeamertemplate***{footnote}}%
+ \def\insertfootnotemarkFB{%
+ \usebeamercolor[fg]{footnote mark}%
+ \usebeamerfont*{footnote mark}%
+ \llap{\@thefnmark}\dotFFN\kernFFN}%
+ }{}
+% \end{macrocode}
+% Now the default definition of |\@makefntextFB| for standard LaTeX
+% and AMS classes.
+%
+% The next command prints the footnote mark according to the
+% specifications of the French `Imprimerie Nationale’.
+% Keep in mind that |\@thefnmark| might be empty (i.e.\ in
+% AMS classes’ titles)!
+% \begin{macrocode}
+\providecommand*{\insertfootnotemarkFB}{%
+ \parindent=\parindentFFN
+ \rule\z@\footnotesep
+ \setbox\@tempboxa\hbox{\@thefnmark}%
+ \ifdim\wd\@tempboxa>\z@
+ \llap{\@thefnmark}\dotFFN\kernFFN
+ \fi}
+\providecommand\@makefntextFB[1]{\insertfootnotemarkFB #1}
+% \end{macrocode}
+% \end{macro}
+%
+% The rest of |\@makefntext|’s customisation is done at the
+% |\begin{document}|. We save the original definition of
+% |\@makefntext|, and then redefine |\@makefntext| according
+% to the value of flag |\ifFBFrenchFootnotes| (true or false).
+% Koma-script classes require a special treatment.
+%
+% \changes{v3.3c}{2017/07/28}{Reset \cs{localleftbox} locally
+% inside \cs{@makefntext}. Needed by \cs{frquote} with LuaTeX.}
+%
+% \changes{v3.5b}{2018/07/17}{Reset \cs{FBeverypar@quote} locally
+% inside \cs{@makefntext}. Needed by \cs{frquote}.}
+%
+% \changes{v3.5c}{2018/09/13}{Remove grouping inside \cs{@makefntext},
+% \cs{localleftbox} and \cs{FBeverypar@quote} saved and restored
+% instead.}
+%
+% The LuaTeX command |\localleftbox| and |\FBeverypar@quote| used
+% by |\frquote{}| have to be reset inside footnotes; done for LaTeX
+% based formats only.
+% \begin{macrocode}
+\providecommand\localleftbox[1]{}
+\AtBeginDocument{%
+ \@ifpackageloaded{bigfoot}{}%
+ {\ifdim\parindentFFN<10in
+ \else
+ \parindentFFN=\parindent
+ \ifdim\parindentFFN<1.5em \parindentFFN=1.5em \fi
+ \fi
+ \settowidth{\FBfnindent}{\dotFFN\kernFFN}%
+ \addtolength{\FBfnindent}{\parindentFFN}%
+ \let\@makefntextORI\@makefntext
+ \ifFB@koma
+% \end{macrocode}
+% Definition of |\@makefntext| for koma-script classes: running
+% \@makefntextORI inside a group to reset |\localleftbox{}| and
+% |\FBeverypar@quote| would mess up the layout of footnotes whenever
+% the first manadatory argument of |\deffootnote{}| (used as
+% |\leftskip|) is non-nil (default is 1em, 0pt in French).
+% \begin{macrocode}
+ \let\@@makefnmarkORI\@@makefnmark
+ \long\def\@makefntext#1{%
+ \localleftbox{}%
+ \let\FBeverypar@save\FBeverypar@quote
+ \let\FBeverypar@quote\relax
+ \ifFBFrenchFootnotes
+ \ifx\footnote\thanks
+ \let\@@makefnmark\@@makefnmarkTH
+ \@makefntextTH{#1}
+ \else
+ \let\@@makefnmark\@@makefnmarkFB
+ \@makefntextFB{#1}
+ \fi
+ \else
+ \let\@@makefnmark\@@makefnmarkORI
+ \@makefntextORI{#1}%
+ \fi
+ \let\FBeverypar@quote\FBeverypar@save
+ \localleftbox{\FBeveryline@quote}}%
+ \else
+% \end{macrocode}
+% Special add-on for the \cls{memoir} class: |\maketitle| redefines
+% |\@makefntext| as |\makethanksmark| which is customised as follows
+% to match the other notes’ vertical alignment.
+% \begin{macrocode}
+ \@ifclassloaded{memoir}%
+ {\ifFBFrenchFootnotes
+ \setlength{\thanksmarkwidth}{\parindentFFN}%
+ \setlength{\thanksmarksep}{-\thanksmarkwidth}%
+ \fi
+ }{}%
+% \end{macrocode}
+% Special add-on for the \cls{beamer} class: issue a warning
+% in case |\parindentFFN| has been changed.
+% \begin{macrocode}
+ \@ifclassloaded{beamer}%
+ {\ifFBFrenchFootnotes
+ \ifdim\parindentFFN=1.5em\else
+ \FBWarning{%
+ \protect\parindentFFN\space is ineffective%
+ \MessageBreak within the beamer class.%
+ \MessageBreak Reported}%
+ \fi
+ \fi
+ }{}%
+% \end{macrocode}
+% Definition of |\@makefntext| for all other classes:
+% \begin{macrocode}
+ \long\def\@makefntext#1{%
+ \localleftbox{}%
+ \let\FBeverypar@save\FBeverypar@quote
+ \let\FBeverypar@quote\relax
+ \ifFBFrenchFootnotes
+ \@makefntextFB{#1}%
+ \else
+ \@makefntextORI{#1}%
+ \fi
+ \let\FBeverypar@quote\FBeverypar@save
+ \localleftbox{\FBeveryline@quote}}%
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% For compatibility reasons, we provide definitions for the commands
+% dealing with the layout of footnotes in \frenchb{} version~1.6.
+% \fbsetup{} (see in section \ref{ssec-keyval}) should be
+% preferred for setting these options. |\StandardFootnotes| may
+% still be used locally (in minipages for instance), that’s why the
+% test |\ifFBFrenchFootnotes| is done inside |\@makefntext|.
+% \begin{macrocode}
+\newcommand*{\AddThinSpaceBeforeFootnotes}{\FBAutoSpaceFootnotestrue}
+\newcommand*{\FrenchFootnotes}{\FBFrenchFootnotestrue}
+\newcommand*{\StandardFootnotes}{\FBFrenchFootnotesfalse}
+% \end{macrocode}
+%
+% \subsection{Clean up and exit}
+%
+% \changes{v3.0a}{2014/02/20}{french.cfg will be loaded (if found)
+% instead of frenchb.cfg. NO NEED for .cfg files in French anyway.}
+%
+% \changes{v3.1h}{2015/08/19}{french.cfg from e-french conflicts with
+% babel-french. Do NOT load it (no need for .cfg files with
+% babel-french anyway).}
+%
+% Final cleaning.
+% The macro |\ldf@finish| takes care for setting the main language
+% to be switched on at |\begin{document}| and resetting the
+% category code of \texttt{@} to its original value. |\loadlocalcfg|
+% is redefined locally in order not to load any \file{.cfg} file for
+% French.
+% \begin{macrocode}
+\FBclean@on@exit
+\ldf@finish\CurrentOption
+\let\loadlocalcfg\FB@llc
+%</french>
+% \end{macrocode}
+%
+% \subsection[Files \file{frenchb.ldf}, \file{francais.ldf},
+% \file{canadien.ldf} and \file{acadian.ldf}]%
+% {Files \file{frenchb.ldf}, \file{francais.ldf},
+% \file{canadien.ldf} and\\ \file{acadian.ldf}}
+%
+% \changes{v3.3b}{2017/06/28}{Generate portmanteau files
+% \file{acadian.ldf}, \file{canadien.ldf}, \file{frenchb.ldf},
+% and \file{francais.ldf} and warn about deprecated options.}
+%
+% Babel now expects a \file{\meta{lang}.ldf} file for each
+% \meta{lang}.
+% So we create portmanteau \file{.ldf} files for options
+% \texttt{canadien}, \texttt{francais}, \texttt{frenchb} and
+% \texttt{acadian}. These files themselves only load
+% \file{french.ldf} which does the real work.
+% Warn users about options \opt{canadien}, \opt{frenchb} and
+% \opt{francais} being deprecated and force recommended options
+% \opt{acadian} or \opt{french}.
+% \begin{macrocode}
+%<*acadian>
+\PackageInfo{acadian.ldf}%
+ {`acadian' dialect is currently\MessageBreak
+ *absolutely identical* to the\MessageBreak
+ `french' language; reported}
+%</acadian>
+%<*canadien>
+\PackageWarning{canadien.ldf}%
+ {Option `canadien' for Babel is *deprecated*,\MessageBreak
+ it might be removed sooner or later. Please\MessageBreak
+ use `acadian' instead; reported}%
+\let\l@canadien\l@acadian
+\def\CurrentOption{acadian}
+%</canadien>
+%<*francais>
+\PackageWarning{francais.ldf}%
+ {Option `francais' for Babel is *deprecated*,\MessageBreak
+ it might be removed sooner or later. Please\MessageBreak
+ use `french' instead; reported}%
+\let\l@francais\l@french
+\def\CurrentOption{french}
+%</francais>
+% \end{macrocode}
+% Compatibility code for \babel{} pre-3.13: \file{frenchb.ldf}
+% could be loaded with options \opt{acadian}, \opt{canadien},
+% \opt{frenchb} or \opt{francais}.
+% \begin{macrocode}
+%<*frenchb>
+\def\bbl@tempa{frenchb}
+\ifx\CurrentOption\bbl@tempa
+ \let\l@frenchb\l@french
+ \def\CurrentOption{french}
+ \PackageWarning{babel-french}%
+ {Option `frenchb' for Babel is *deprecated*,\MessageBreak
+ it might be removed sooner or later. Please\MessageBreak
+ use `french' instead; reported}
+\else
+ \def\bbl@tempa{francais}
+ \ifx\CurrentOption\bbl@tempa
+ \let\l@francais\l@french
+ \def\CurrentOption{french}
+% \end{macrocode}
+% Plain formats: no warning when \file{francais.sty} loads
+% \file{frenchb.ldf} (\babel{} pre-3.13).
+% \begin{macrocode}
+ \ifx\magnification\@undefined
+ \PackageWarning{babel-french}%
+ {Option `francais' for Babel is *deprecated*,\MessageBreak
+ it might be removed sooner or later. Please\MessageBreak
+ use `french' instead; reported}%
+ \fi
+ \else
+ \def\bbl@tempa{canadien}
+ \ifx\CurrentOption\bbl@tempa
+ \let\l@canadien\l@acadian
+ \def\CurrentOption{acadian}
+ \PackageWarning{babel-french}%
+ {Option `canadien' for Babel is *deprecated*,\MessageBreak
+ it might be removed sooner or later. Please\MessageBreak
+ use `acadian' instead; reported}
+ \fi
+ \fi
+\fi
+%</frenchb>
+%<acadian|canadien|frenchb|francais>\input french.ldf\relax
+%<acadian|canadien>\let\extrasacadian\extrasfrench
+%<acadian|canadien>\let\noextrasacadian\noextrasfrench
+% \end{macrocode}
+%
+% \Finale
+% \iffalse
+%<*!lua>
+% \fi
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+% \iffalse
+%</!lua>
+% \fi
+\endinput
+
+%%% Local Variables:
+%%% fill-column: 72
+%%% coding: utf-8
+%%% End:
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.ins b/macros/latex/contrib/babel-contrib/french/frenchb.ins
new file mode 100644
index 0000000000..203ea2a6cc
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.ins
@@ -0,0 +1,98 @@
+%%
+%% This file will generate fast loadable files and documentation driver
+%% files from the doc files in this package when run through LuaTeX.
+%%
+%% Copyright 2001-2019 Daniel Flipo. All rights reserved.
+%%
+%% This is a generated file part of the the babel-french bundle
+%% to be used with the Babel system.
+%% -------------------------------------------------------------
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3 or, at your option, any later version.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2017/07/06}
+\def\batchfile{frenchb.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.4e or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file part of the babel-french bundle
+to be used with the Babel system.
+-------------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Daniel Flipo.
+
+Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+\usedir{tex/generic/babel-french}
+
+\usepreamble\mainpreamble
+\generate{\file{french.ldf}{\from{frenchb.dtx}{french}}
+ \file{acadian.ldf}{\from{frenchb.dtx}{acadian}}
+ \file{canadien.ldf}{\from{frenchb.dtx}{canadien}}
+ \file{frenchb.ldf}{\from{frenchb.dtx}{frenchb}}
+ \file{francais.ldf}{\from{frenchb.dtx}{francais}}
+ }
+
+\def\MetaPrefix{-- }
+
+\def\luapostamble{%
+ \MetaPrefix\space End of File frenchb.lua.%
+}
+
+\nopreamble
+\usepostamble\luapostamble
+
+\generate{\file{frenchb.lua}{\from{frenchb.dtx}{lua}}}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space frenchb.lua\space\space french.ldf}
+\Msg{* \space\space frenchb.ldf\space\space francais.ldf}
+\Msg{* \space\space canadian.ldf\space\space and acadian.ldf}
+\Msg{*}
+\Msg{* To produce the documentation run the file frenchb.dtx}
+\Msg{* through pdfLaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endbatchfile
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.pdf b/macros/latex/contrib/babel-contrib/french/frenchb.pdf
new file mode 100644
index 0000000000..829b2314f4
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/frenchb b/macros/latex/contrib/babel-contrib/frenchb
new file mode 120000
index 0000000000..d299271f75
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/frenchb
@@ -0,0 +1 @@
+french \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/friulan/README.txt b/macros/latex/contrib/babel-contrib/friulan/README.txt
new file mode 100644
index 0000000000..0b00fe4027
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/friulan/README.txt
@@ -0,0 +1,21 @@
+Package: babel-friulan
+
+
+The package provides a language definition file for use with babel, which establishes
+Friulan conventions in a document (or a subset of the conventions, if Friulan is not
+the main language of the document).
+
+
+To install run the friulan.dtx file trough pdfLaTeX; you get with the same run
+both the language description file and the documentation. Then you have to
+move the created friulan.ldf file into a directory searched by TeX.
+
+This material is subject to the LaTeX Project Public License v1.3.
+See http://ctan.org/license/lppl1.3 for the details of that license.
+
+Happy TeXing.
+
+--------------------------------------
+
+Claudio Beccari
+claudio dot beccari at gmail dot com \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/friulan/friulan.dtx b/macros/latex/contrib/babel-contrib/friulan/friulan.dtx
new file mode 100755
index 0000000000..a1b4423510
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/friulan/friulan.dtx
@@ -0,0 +1,235 @@
+% \iffalse meta-comment
+%<*internal>
+\begingroup
+\input docstrip.tex
+\keepsilent
+
+\preamble
+ ------------------------------------------------------------------
+ The friulan module for babel
+ Copyright (C) 2012-2016 Claudio Beccari
+ All rights reserved
+
+ Licence information appended
+
+ Created by Claudio Beccari claudio dot beccari at gmail dot com
+
+
+\endpreamble
+\postamble
+Distributable under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+This work is "author-maintained"
+The maintainer is Claudio Beccari
+
+\endpostamble
+
+\askforoverwritefalse
+
+\generate{\file{friulan.ldf}{\from{friulan.dtx}{code}}}
+
+\def\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+%</internal>
+%
+% \fi
+% \CheckSum{156}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{friulan.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{friulan}
+%\fi
+%\ProvidesFile{friulan.dtx}
+ [2016/02/23 v.1.3 friulan support for the babel system]
+%\iffalse
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\makeatletter\let\gobbletwo\@gobbletwo\makeatother
+\author{Claudio Beccari --- \texttt{claudio dot beccari at gmail dot com}}
+\title{The Friulan language module for \babel}
+\date{\filedate\ -- version \expandafter\gobbletwo\fileversion}
+\begin{document}
+ \DocInput{friulan.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{friulan.dtx}
+%\maketitle
+%
+% \section{The Friulan language}
+%
+% The file \file{\filename} defines all the language definition macros for the
+% Friulan language. It is worth noting that in English
+% ``Friulan'' is the name of the language, and ``Friulian'' is the
+% adjective concerning everything has to do with the Friuli Region
+% in North Eastern Italy.
+%
+% This revised version of the Friulan documentation corrects some infix words
+% that were hardcoded with an implied \Lopt{utf8} input encoding option to the
+% overall document, this making it impossible to typeset documents with some
+% other traditional input encoding options such as \Lopt{latin1}, \Lopt{latin9},
+% \Lopt{ansinew}, etc.
+%
+% Moreover if the hyphenation patterns are not available or are not loaded
+% into the format file, so that |l@friulan| is undefined, then this module
+% uses the patterns for Italian, instead of those for English, even if the
+% latter are always available by default, while the former might not be
+% available at all. If they are, they might not produce completely correct
+% hyphenated line breaks, but at least they are less improbable than using
+% English patterns. At the same time we avoid using the |nohyphenation|
+% language, even of some people prefer avoid hyphenation rather than risking
+% to have a few wrong line breaks.
+%
+% \StopEventually{}
+% \section{The code}
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc. |\CurrentOption| is actually the name of
+% language that was specified as an option in the call to \babel.
+% \begin{macrocode}
+%<*code>
+\LdfInit{\CurrentOption}{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{friulan} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@friulan| to see whether we have to do
+% something here. Since the name could be its alias |furlan|
+% we must check that either name is known to \babel. In case it
+% was undefined, we re-establish a meaning for the macros made up
+% with |\CurrentOption|.
+%
+% \begin{macrocode}
+\ifx\l@friulan\@undefined
+ \ifx\l@furlan\@undefined
+ \@nopatterns{friulan}
+ \unless\ifx\l@italian\@undefined
+ \adddialect\l@friulan \l@italian
+ \fi
+ \else
+ \let\l@friulan\l@furlan
+ \fi
+\fi
+\expandafter\ifx\csname l@\CurrentOption\endcsname\relax
+ \expandafter\let\csname l@\CurrentOption\endcsname\l@friulan
+\fi
+% \end{macrocode}
+% For the <Dialect> version of these definitions we just add a
+% ``dialect''. Also, the macros |\captions<dialect>| and
+% |\extras<dialect>| are |\let| to their \texttt{friulan}
+% counterparts when these parts are defined.
+% \begin{macrocode}
+\adddialect\l@furlan\l@friulan
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Friulan language.
+%
+%
+% \begin{macro}{\friulanhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsfriulan}
+% The macro |\captionsfriulan| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Prefazion}%
+ \def\refname{Riferiments}%
+ \def\abstractname{Somari}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Cjapitul}%
+ \def\appendixname{Zonte}%
+ \def\contentsname{Tabele gjener\^al}%
+ \def\listfigurename{Liste des figuris}%
+ \def\listtablename{Liste des tabelis}%
+ \def\indexname{Tabele analitiche}%
+ \def\figurename{Figure}%
+ \def\tablename{Tabele}%
+ \def\partname{Part}%
+ \def\enclname{Zonte(is)}%
+ \def\ccname{Cun copie a}%
+ \def\headtoname{Par}%
+ \def\pagename{Pagjine}%
+ \def\seename{cjale}%
+ \def\alsoname{cjale ancje}%
+ \def\proofname{Dimostrazion}%
+ \def\glossaryname{Glossari}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datefriulan}
+% The macro |\datefriulan| redefines the command |\today| to
+% produce friulan dates.
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space di\space\ifcase\month\or
+ Gen\^ar\or Fevr\^ar\or Mar\c{c}\or Avril\or Mai\or Jugn\or
+ Lui\or Avost\or Setembar\or Otobar\or Novembar\or Dicembar%
+ \fi\space dal\space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasfriulan}
+% \begin{macro}{\noextrasfriulan}
+% The macro |\extrasfriulan| will perform all the extra
+% definitions needed for the friulan language. The macro
+% |\noextrasfriulan| is used to cancel the actions of
+% |\extrasfriulan|. In particular we set pretty high
+% default values for widow and club lines and very high
+% demerits to avoid that the paragraph last line starts with the
+% second half of a hyphenated word. We also assign a non zero
+% value |\lccode| to the apostrophe that in Friulan is being
+% used for marking a vocalic elision; by giving it a non
+% zero value; the hyphenation algorithm treats the phrase formed
+% by the article or articulated preposition and the following
+% term as a single word and the patterns for Friulan take care
+% of avoiding line breaks right after the apostrophe.
+%
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \lccode`'=`'}%
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \lccode`'=0}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
diff --git a/macros/latex/contrib/babel-contrib/friulan/friulan.pdf b/macros/latex/contrib/babel-contrib/friulan/friulan.pdf
new file mode 100755
index 0000000000..c2a65f6feb
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/friulan/friulan.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/galician/galician.dtx b/macros/latex/contrib/babel-contrib/galician/galician.dtx
new file mode 100644
index 0000000000..3e7e5c4d99
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/galician/galician.dtx
@@ -0,0 +1,2437 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{2264}
+% \ProvidesFile{galician.dtx}
+% [2008/07/06 v4.3c Galician support from the babel system]
+%\iffalse
+%% File `galician.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Galcian Language Definition File
+%% Copyright (C) 1989 - 2006
+%% by Manuel Carriba mcarriba at eunetcom.net
+%% Johannes Braams, TeXniek
+%% Copyright (C) 2007 - 2008
+%% by Javier A. M\'ugica
+%% Johannes Braams, TeXniek
+%
+%% Please report errors to: Javier A. Mugica (preferably)
+%% jmugica at digi21.net
+%% J.L. Braams
+%% babel at braams.xs4all.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Galician language definition file.
+% The original version of the file spanish.dtx was written by Javier Bezos.
+%
+%<*filedriver>
+\documentclass[galician,a4paper]{ltxdoc}
+\usepackage[activeacute]{babel}
+%Small suport for the input encoding
+\catcode`\=\active \def{\'a}
+\catcode`\=\active \def{\'e}
+\catcode`\=\active \def{\'\i}
+\catcode`\=\active \def{\'o}
+\catcode`\=\active \def{\'u}
+\catcode`\=\active \def{\~n}
+%end
+
+%\usepackage{ps}
+
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+
+\setlength{\arrayrulewidth}{2\arrayrulewidth}
+\newcommand\toprule{\cline{1-2}\\[-2ex]}
+\newcommand\botrule{\\[.6ex]\cline{1-2}}
+\newcommand\hmk{$\string|$}
+
+\newcommand\New[1]{%
+ \leavevmode\marginpar{\raggedleft\sffamily Novo en #1}}
+
+\newcommand\nm[1]{\unskip\,$^{#1}$}
+\newcommand\nt[1]{\quad$^{#1}$\,\ignorespaces}
+
+\makeatletter
+ \renewcommand\@biblabel{}
+\makeatother
+
+\newcommand\DOT[1]{\msc{DOT},~#1}
+\newcommand\DTL[1]{\msc{DTL},~#1}
+\newcommand\MEA[1]{\msc{MEA},~#1}
+
+\raggedright
+\addtolength{\oddsidemargin}{-2pc}
+\addtolength{\textwidth}{2pc}
+\setlength{\parindent}{1em}
+
+\OnlyDescription
+\begin{document}
+ \DocInput{galician.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \begingroup
+%
+% \catcode`\{=11
+% \catcode`\[=1
+%
+% \gdef\ignoringuser[^^A
+% \bgroup
+% \let\end{userdtx\fi
+% \let\end{userdrv\fi
+% \aftergroup\endgroup
+% \catcode`\{=11
+% \catcode`f=14 ^^A kills \if... and \fi
+% \catcode`l=14 ^^A kills \else
+% \catcode`o=14 ^^A kills \or
+% \catcode`p=14 ^^A kills \repeat
+% \iffalse}
+%
+% \endgroup
+%
+% ^^A\def\langdeffile{}
+% \newenvironment{userdtx}
+% {\ifx\langdeffile\undefined
+% \else\expandafter\ignoringuser
+% \fi}{}
+%
+% \newenvironment{userdrv}
+% {\ifx\langdeffile\undefined
+% \expandafter\ignoringuser
+% \else\fi}{}
+%
+% \begin{userdtx}
+%^^A ======= Beginning of text as typeset by galician.dtx =========
+%
+% \title{Estilo \textsf{galician} para o sistema \babel\\[10pt]
+% \large Versin 4.3, de 29 de xaneiro do 2007}
+%
+% \author{Javier Mgica\footnote{O autor orixinal foi Javier Bezos.
+% Foi traduciro por min do casteln en xaneiro do 2007, e desde
+% entn e mantido e actualizado por min.}}
+%
+% \date{} ^^A@#
+%
+% \maketitle
+%
+% {\small\tableofcontents}
+%
+%% \section{\textsf{galician} coma lingua principal}
+%
+% En \babel{} considrase que a ltima lingua citada en |\usepackage| e |\documentclass|,
+% por esta orde, a lingua principal. Se a lingua principal |galician|, actvase o grupo
+% |\layoutgalician| que adapta varios elementos s usos tipogr'aficos galegos do seguinte modo:
+%
+% \begin{itemize}
+%
+% \item[$\diamond$] |enumerate| e |itemize|\vadjust{\nobreak}\\[1ex]
+%
+% O primeiro usa a seguinte secuencia:\vadjust{\nobreak}\\
+% \quad 1.\\
+% \qquad \emph{a})\\
+% \quad\qquad 1)\\
+% \qquad\qquad \emph{a$'$})\\
+% O segundo a seguinte:\\
+% \quad\leavevmode\hbox to 1.2ex
+% {\hss\vrule height .95ex width .8ex depth -.15ex\hss}\\
+% \qquad\textbullet\\
+% \quad\qquad $\circ$\\
+% \qquad\qquad $\diamond$
+%
+% Das rdenes permiten outros estilos en |itemize|: con |\galiciandashitems| cmbiase a raias en tdo-los niveis
+% e con |\galiciansignitems|, a \textbullet{} $\circ$
+% $\diamond$ $\triangleright$.
+%
+% \item[$\diamond$] |\alph| e |\Alph|\\[1ex]
+%
+% Inclen o e'ne, pero non k, j, w nin y.
+%
+% \item[$\diamond$] |\fnsymbol|\\[1ex]
+%
+% Emprganse un, dous, tres... asteriscos (*, **, ***, etc.),
+% en lugar da sucesi'on angloamericana de cruces, barras,
+% etc.\footnote{\DOT{162}.}
+%
+% \item[$\diamond$] |\guillemotleft| e |\guillemotright|\\[1ex]
+%
+% As comias latinas para |OT1| son menos angulosas e xenranse cunhas puntas de frecha |lasy|.
+%
+% \item[$\diamond$] |\roman|\\[1ex]
+%
+% Os nmeros romanos en minscula son propios das obras inglesas e non se empregan no continente.
+% Por iso se redefine |\roman| para que produza versalitas.
+%
+% \begin{quote}\small
+% \textbf{Nota.} MakeIndex non pode entender a forma na que
+% |\roman| escribe o n'umero de p'axina, polo que
+% elimina as lias afectadas. Por iso o aquivo |.idx|
+% ten que ser convertido antes de ser procesado con MakeIndex.
+% Con este paquete proporcinase a utilidade |glromidx.tex| que se
+% encarga diso. Simplemente componse ese arquivo con \LaTeX{}
+% e a continuaci'on respndese s preguntas que se formulan.
+% Este proceso non necesario se non se introduciu ningunha
+% entrada de 'indice en p'axinas numeradas con |\roman| (o que ser'a
+% o mis normal). Se un s'imbolo propio de \emph{MakeIndex} xenerara
+% problemas, debe encerrarse entre chaves: \verb={"|}=.
+% \end{quote}
+%
+% \item[$\diamond$] |\section|, |\subsection|, etc.\\[1ex]
+%
+% Os n'umeros nos t'itulos est'an seguidos dun punto tanto no texto coma
+% no 'indice. Adem'ais, o primeiro pargrafo tra-lo ttulo non elimina a sangr'ia
+% (de novo, un costume angloamericano).
+%
+% \end{itemize}
+%
+% Estes cambios funcionan coas clases est'andar ~---con otras
+% tal vez algn deles non tea efecto--- e persisten durante
+% todo o documento (non se poden desactivar). Ningn deles
+% necesario para compoer o documento, anda que naturalmente
+% o resultado ser'a distinto.
+%
+% \begin{itemize}
+%
+% \item[$\diamond$] |\selectgalician*|\vadjust{\nobreak}\\[1ex]
+%
+% Se non se desexan estes cambios, chega con usar no
+% pre'ambulo |\selectgalician*| (con asterisco) ou <<borralos>> con:
+%\begin{verbatim}
+% \let\layoutgalician\relax
+%\end{verbatim}
+%
+% \end{itemize}
+%
+% \section{Descripci'on}
+%
+% \subsection{Traduccins}
+%
+% Certas ordes defnense para proporcionar traduccins
+% galego dalgns trminos, tal e como se describe no cadro 1.
+%
+% \begin{table}
+% \center\small
+% \caption{Traduccins}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{3em}}l}
+% \toprule
+% |\refname| & Referencias\\
+% |\abstractname| & Resumo\\
+% |\bibname| & Bibliograf'ia\\
+% |\chaptername| & Cap'itulo\\
+% |\appendixname| & Ap'endice\\
+% |\contentsname| & 'Indice xeral\nm{a}\\
+% |\listfigurename| & 'Indice de figuras\\
+% |\listtablename| & 'Indice de cadros\\
+% |\indexname| & 'Indice alfab'etico\\
+% |\figurename| & Figura\\
+% |\tablename| & Cadro\\
+% |\partname| & Parte\\
+% |\enclname| & Adxunto\\
+% |\ccname| & Copia a\\
+% |\headtoname| & A\\
+% |\pagename| & P'axina\\
+% |\seename| & v'exase\\
+% |\alsoname| & v'exase tam'en\\
+% |\proofname| & Demostraci'on
+% \botrule
+% \end{tabular}
+%
+% \vspace{1.5ex}
+%
+% \begin{minipage}{6cm}\footnotesize
+% \nt{a} Pero s'olo <<'Indice>> en \textsf{article}.
+% \end{minipage}
+% \end{table}
+%
+% Non existe para o ndice unha terminolox'ia unificada. Tal vez
+% \emph{'Indice xeral} o que m'ais se usa, as'i que a
+% iso me ateo salvo en |article|, onde se compn coma secci'on
+% e polo tanto resulta algo ostentoso.\footnote{\'O contrario que en
+% ingl'es, en galego o 'indice por antonomasia o xeral.}
+%
+% Para o 'indice alfab'etico tense proposto \emph{'Indice de materias}
+% ou \emph{'Indice anal'itico}, anda que estes 'indices non soamente
+% adoitan inclur materias, mais tamn nomes; \emph{'Indice alfab'etico}
+% m'ais preciso.\footnote{\'E a usada en \DOT{300} as'i coma na meirande
+% parte dos libros que consultei azar nunha biblioteca. (J.B.)}
+%
+% En canto s de cadros e figuras, tam'en posible dicir
+% \emph{lista}, pero parceme preferible \emph{'indice}, que
+% implica a correspondencia coas p'axinas.
+%
+% \emph{Table} debe traducirse por \emph{cadro}, xa que \emph{tboa}
+% un \emph{falso amigo};\,\footnote{V'exanse as definicins
+% do \msc{DGII} e \DTL{67 ss.}} esa a pr'actica tradicional.
+% (Por exemplo, <<cadro de estados medievais>> frente a <<tboa de logaritmos>>.)
+%
+% As traduccin escrbense con min'usculas, salvo a inicial. Evtase
+% o anglicismo de comenzar con mai'usculas os substantivos.\footnote{\DOT{197}.}
+%
+% A orde |\today| d a data actual. Con |\galiciandatedo| e |\galiciandatede|
+% ptase por \textit{do} (predeterminado) ou \textit{de}.
+%
+% \subsection{Abreviacins}
+%
+% (O que en \babel{} denomnase `shorthands'.) A lista completa
+% pdese atopar no cadro~2. Nos seguintes apartados daranse mis
+% detalles sobre algunhas delas.
+%
+% \begin{table}[!t]
+% \center\small
+% \caption{Abreviacins}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{3em}}l}
+% \toprule
+% |'a 'e 'i 'o 'u| & 'a 'e 'i 'o 'u\\
+% |'A 'E 'I 'O 'U| & 'A 'E 'I 'O 'U\\
+% |'n 'N| & 'n 'N\nm{a}\\
+% |"u "U| & "u "U\\
+% |"i "I| & "i "I\\
+% |"a "A "o "O| & Ordinais: 1"a, 1"A, 1"o, 1"O\\
+% |"rr "RR| & rr, pero -r cando se divide\\
+% |"-| & Coma |\-|, pero permite m'ais divisins\\
+% |"=| & Coma |-|, pero permite mis divisins\nm{b}\\
+% |"~| & Gui'on estil'istico\nm{c}\\
+% |~- ~-- ~---| & Coma |-|, |--| e |---|, pero sen divisi'on\\
+% |""| & Permite mis divisins antes e despois\nm{d}\\
+% |"/| & Unha barra algo m'ais baixa\\
+% \verb+"|+ & Divide un logotipo\nm{e}\\
+% |<< >>| & << >>\\
+% |"< ">| & |\begin{quoting}| |\end{quoting}|\nm{f}\\
+% |?` !`| & ?` !`\nm{g}\\
+% |"? "!| & "? "! aliados coa lia base\nm{h}
+% \botrule
+% \end{tabular}
+%
+% \vspace{1.5ex}
+%
+% \begin{minipage}{11cm}
+% \footnotesize
+% \nt{a} A forma |~n| debe considerarse en extinci'on.
+% \nt{b} |"=| ven a ser o mesmo que |""-""|.
+% \nt{c} Esta abreviaci'on ten un uso distinto noutras
+% linguas. \nt{d} Coma en <<entrada/sada>>.
+% \nt{e} Carece de uso en galego. \nt{f} V'exase sec.~2.7.
+% \nt{g} Non proporcionadas por este paquete, mais por cada tipo;
+% figuran aqu'i coma simple recordatorio. \nt{h} 'Utiles en
+% r'otulos en mai'usculas.
+% \end{minipage}
+% \end{table}
+%
+% Para poder usar ap'ostrofos coma abreviacins de acentos
+% necesaria a opci'on |activeacute| en |\usepackage|.
+% Pode cambiarse este comportamento coa orde |\gl@acuteactive|
+% no arquivo de configuraci'on |galician.cfg|; nese caso os
+% ap'ostrofos actvanse sempre.
+%
+% Os caracteres usados coma abreviacins comprtanse coma
+% outras ordes de \TeX{} e polo tanto faise caso omiso
+% dos espacios que poidan seguir: \verb*|' a| o mesmo que |'a|.
+% Eso tam'en implica que tras eses caracteres non pode vir unha
+% chave de peche e que deber'a escribirse |{... '{}}| en lugar
+% de |{... '}|; en modo matem'atico non hai problema e |$x^{a'}$|
+% ($x^{a'}$) v'alido.
+%
+% \begin{itemize}
+%
+% \item[$\diamond$]
+% |\deactivatetilden|\\[1ex]
+%
+% Esta orde desactiva as abreviacins |~n| e |~N| debido s problemas
+% que presentan. Pode usarse no arquivo de configuraci'on (v'exase
+% m'ais abaixo).
+%
+% % \item[$\diamond$]
+% |\galiciandeactivate{<caracteres>}|\\[1ex]
+%
+% Permite desactivar as abreviacins correspondentes s caracteres dados.
+% Para evitar entrar en conflicto con outras linguas, sair de |galician|
+% reactvanse,\footnote{O punto para os decimais non estrictamente
+% unha abreviaci'on e non se reactiva.} polo que se se desexa que
+% persista cmpre engadi-la orde a |\shorthandsgalician| con |\addto|.
+% A orde |\renewcommand\shorthandsgalician{}| unha variante optimizada de
+%\begin{verbatim}
+% \addto\shorthandsgalician{\galiciandeactivate{.'"~<>}}
+%\end{verbatim}
+% e o recomendado se se desea prescindir do mecanismo de abreviacins.
+% \end{itemize}
+%
+% \subsection{Coma decimal}
+%
+% En \textsf{galician} tmase partido, coma en casteln, por separar
+% a parte enteira e a parte decimal mediante unha coma. O punto
+% tradicional en ingls, non en galego, e ademis chegouse a unha
+% normalizacin internacional pola que os milleiros sepranse por
+% un espacio fino e os decimais con coma.
+%
+% Dado que \TeX\ usa a coma coma separador en intervalos ou expresins
+% similares, o que engade un espacio fino, \textsf{galician} converte
+% todo punto en modo matem'atico nunha coma sempre que estea seguido
+% dunha cifra, pero non notras circunstancias:
+% \begin{quote}\small\begin{tabbing}
+% |$1\,234.567\,890$| \quad \= $1\,234.567\,890$\\
+% |$f(1,2)=12.34.$| \> $f(1,2)=12.34.$\\
+% |$1{.}000$| \> $1{.}000$, mais\\
+% |1.000| \> 1.000, pois non modo matem'atico.
+% \end{tabbing}\end{quote}
+%
+% As ordes |\decimalcomma| e |\decimalpoint| establecen se se usa
+% unha coma, que o valor predeterminado, ou un punto, mentras que
+% |\galiciandecimal{<math>}| permite darlle unha definici'on
+% arbitraria.\footnote{Internamente o mecanismo o dunha abreviaci'on,
+% e pdese desactivar coma as outras.}
+%
+% \subsection{Divisi'on de palabras}
+%
+% \textsf{Galician} comproba a codificaci'on no momento no que se
+% emprega un acento: se a codificaci'on |OT1| tmanse medidas para
+% facilitar a divisi'on, que pese a todo nunca ser'a perfecta, mentres
+% que con |T1| accdese directamente car'acter correspondente.
+%
+% Para matizar a divisi'on de palabras hai catro posibilidades, das
+% delas co m'etodo de abreviacins:
+% \begin{itemize}
+% \item a orde |\-| un gui'on opcional que non permite m'ais
+% divisins (coma en \TeX),
+%
+% \item |"-| similar pero permite m'ais divisins,
+%
+% \item un |-| un gui'on que non permite m'ais divisins nin
+% antes nin despois (coma en \TeX), e
+%
+% \item |"=| o equivalente que s'i as permite,\footnote{Non
+% unha boa idea usar esta orde, pero en medidas moi curtas
+% puede resultar necesario.}
+%
+% \end{itemize}
+% Por exemplo (coas posibles divisins marcadas con \hmk):
+% \begin{quote}\small\begin{tabbing}
+% |Zaragoza-Barcelona|\qquad \= Zaragoza-\hmk Barcelona\\
+% |Zaragoza"=Barcelona| \>
+% Za\hmk ra\hmk go\hmk za-\hmk Bar\hmk ce\hmk lo\hmk na\\
+% |semi\-aperto| \> semi\hmk aperto\\
+% |semi"-aperto| \> se\hmk mi\hmk aper\hmk to.\footnotemark
+% \end{tabbing}\footnotetext{Xusto antes e despis de
+% {\ttfamily\string"\string-} e {\ttfamily\string"\string=}
+% aplcanse os correspondentes valores de
+% {\ttfamily\string\...hyphenmin}, o que implica que a
+% divis'on semia\hmk perto non posible.
+% Este un comportamento correcto.}
+% \end{quote}
+%
+% Adem'ais hai abreviacins que evitan divisins: |~-|, que resulta
+% 'util para expresar unha serie de n'umeros sen que o gui'on os
+% divida (12~-14, |12~-14|), e |~---|, que a forma que debe usarse
+% para abrir incisos con raias, xa que do contrario pode haber unha
+% divisi'on entre a raia de abrir e a palabra que lle sigue:
+% \begin{quote}\small\begin{tabbing}
+% |Os concertos ~---ou academias--- que organiz'ou...|
+% \end{tabbing}\end{quote}
+% Mentras que este gui'on evita toda posible divisi'on nos elementos
+% que une, a raia (---) e a semirraia (--) permtenas nas palabras
+% que a precedan ou sigan.
+%
+% A abreviaci'on |"~| sase cando se quere que o gui'on tam'en apareza
+% comienzo da seguinte lia. Por exemplo:
+% \begin{quote}\small\begin{tabbing}
+% |infra"~vermello| \quad \= in\hmk fra-ver\hmk mello, pero infra-\hmk-vermello.
+% \end{tabbing}\end{quote}
+%
+% Outra abreviaci'on |"rr| que sirve para o 'unico cambio de escritura do
+% casteln en caso de haber divisi'on.\footnote{En galego non atopei un
+% pronunciamento respecto. A \msc{RAE} indica que a'nadir un prefixo
+% que reamta en vocal a unha palabra que comenza con \emph{r}, esta 'ultima debe
+% dobrarse a menos que se unan por un gui'on. Por exemplo:
+% |extra"{}rradio| divdese en ex\hmk trarra\hmk dio, mais extra-\hmk radio.}
+%
+% \subsection{Ordinais}
+%
+% As abreviaturas sempre levan punto, salvo algunhas nas que se
+% substite por unha barra (e salvo as siglas e s'imbolos, naturalmente),
+% que precede s letras voladitas.\footnote{\DTL{196}. V'exase tam'en \DOT{222 e 227}.}
+% Por ello, \textsf{galician} proporciona a orde |\sptext| que facilita a
+% creaci'on destas abreviaturas. Por exemplo: |adm\sptext{'on}|, que d
+% adm\sptext{'on}. Hai catro abreviacins asociadas a ordinais:
+% |"a|, |"A|, |"o| e |"O| que equivalen a |\sptext{a}|, etc.\footnote{Moitos
+% tipos engaden un pequeno subliado que debe evitarse, e polo tanto non se debe
+% escribi-los ordinais con \textsf{inputenc}.}
+%
+% Para axustar o tamano o mellor posible, sase o de 'indices en curso.
+% Esto funciona ben salvo para tama'nos moi grandes ou moi pequenos, onde
+% os resultados son meramente aceptables.
+%
+% En Plain \TeX{} exectase a orde |\sptextfont| para a letra voladita,
+% de xeito que |{\bf\let\sptextfont\bf 1"o}| d o resultado correcto
+% (|\mit| se para cursiva). Para usar un tipo novo con |\sptext| hai
+% que definir tam'en as variantes matem'aticas con |\newfam|.
+%
+% \subsection{Funcins matem'aticas}
+%
+% En casteln, tradicionalmente formronse as abreviacins
+% do que en \TeX\ coecense coma operadores a partir do nome casteln,
+% o que implica a presencia do acento en l'im, m'ax, m'in, 'inf e m'od.
+% Parece que isto e tamn o mis adecuado para o galego.
+%
+% Con |galician| pdense seguir varios criterios por medio das seguintes
+% ordes:
+% \begin{itemize}
+% \item[$\diamond$] |\accentedoperators| |\unaccentedoperators|\\[1ex]
+% Activa ou desactiva os acentos.
+% Por omisi'on acent'uanse, coma por exemplo: $\lim_{x\to 0}(1/x)$
+% (|$\lim_{x\to 0}(1/x)$|).
+%
+% \item[$\diamond$] |\spacedoperators| |\unspacedoperators|\\[1ex]
+% Activa ou desactiva o espacio entre "<arc"> e la funci'on. Por omisi'on
+% non se espacia.
+% \end{itemize}
+%
+% O i sen punto tam'en accesible directamente en modo matem'atico
+% coa orde |\dotlessi|, de forma que se pode escribir |\acute{\dotlessi}|.
+% Por exemplo,
+% |$V_{\mathbf{cr\acute{\dotlessi}t}}$| d $V_{\mathbf{cr\acute{\dotlessi}t}}$.
+%
+% Tam'en engdense |\sen|, |\cosec|, |\arcsen|, |\tx|, |\arctx|, e |senh|,
+% que dan as funcins respectivas. Ademis |\sin|,\New{galician~4.3}
+% |sinh| e |arcsin| producen os mesmos resultados que |\sen|, |\senh|
+% e |\arcsen| respectivamente. Outras funcins trigonom'etricas
+% atpanse almacenadas no par'ametro |\galicianoperators|,
+% que inicialmente incle cotx e txh. Deste xeito pdense cambiar por
+% outras e engadir mis, coma por exemplo:
+%\begin{verbatim}
+% \renewcommand{\galicianoperators}{cotan arc\,ctx tanh}
+%\end{verbatim}
+% (separadas con espacio). Cando se selecciona |galician| cranse
+% ordes con eses nomes e que dan esas funcins (sempre con |\nolimits|).
+% Adem'ais das letras sen acentuar acptanse as ordes |\,| e |\acute|, que
+% se pasan por alto para forma-lo nome. Por exemplo, |arc\,ctg| escribirase
+% no documento coma |\arcctg|, |M\acute{a}x| coma |\Max| e |cr\acute{i}t|
+% coma |\crit| (hai que usar |i| e non |\dotlessi|). A orde |\,| responde
+% a |\|(|un|)|spacedoperators|, e |\acute| a |\|(|un|)|accentedoperators|.
+%
+% |\renewcommand{\galicianoperators}| haber de estar no pre'ambulo do documento,
+% despois de |\sepackage[galician]{babel}| e antes de |\selectgalician| ou de
+% |\begin{document}|.
+%
+% \subsection{Entrecomiados}
+%
+% O entorno |quoting| entrecomia un texto, engadindo comias de seguir
+% comienzo de cada pargrafo ou no seu interior.\footnote{Pdese atopar unha
+% detallada exposici'on das comias en \DTL{44 ss.} De al tomouse alg'un exemplo.}
+% Tam'en pdense empregrar as abreviacins |"<| e |">| que se limitan a chamar
+% a |quoting|, que por ser entorno considera os seus cambios internos coma locais.
+% ( dicir, |"< ... ">| implica |{"< ... ">}|.) As abreviacins |<<| e |>>|
+% contin'uan dando sen m'ais os caracteres de comias de abrir e pechar.
+%
+% Por exemplo:
+%\begin{verbatim}
+% "<Chmanse "<comias de seguir"> as que son de peche, pero colcanse
+% comenzo de cada pargrafo cando se transcribe un texto
+% entrecomiado con m'ais dun par'agrafo.
+%
+% No seu interior, coma de costume, sanse as inglesas.">
+%\end{verbatim}
+% que ten por resultad:
+% \begin{quotation}\small
+% "<Chmanse "<comillas de seguir"> as que son de peche, pero colcanse
+% comenzo de cada par'agrafo cando se transcribe un texto
+% entrecomiado con m'ais dun par'agrafo.
+%
+% No seu interior, coma de costume, sanse as inglesas.">
+% \end{quotation}
+%
+% Este entorno pdese redefinir. Por exemplo:
+%\begin{verbatim}
+% \renewenvironment{quoting}{\itshape}{}
+%\end{verbatim}
+% pero non implica un novo par'agrafo, xa que est'a pensado
+% para ser usado tam'en no texto.
+%
+% En caso de inclur uns entornos |quoting| dentro doutros, modifcanse
+% as comias dos niveis interiores, que tam'en engadense s de seguir:
+%\begin{verbatim}
+% "<O di'alogo desenvolveuse desta forma:
+%
+% "<---Eu no fun ---grit'ou Antonio.
+%
+% ---Mais colaboraches ---asegur'ou Rafael">.
+%
+% Mais al'i ningen se aclarou.">
+%\end{verbatim}
+%
+% \begin{quotation}\small
+% "<O di'alogo desenvolveuse desta forma:
+%
+% "<---Eu no fun ---grit'ou Antonio.
+%
+% ---Mais colaboraches ---asegur'ou Rafael">.
+%
+% Mais al'i ningen se aclarou.">
+% \end{quotation}
+%
+% \begin{itemize}
+% \item[$\diamond$]
+% |\lquoti| |\rquoti| |\lquotii| |\rquotii| |\lquotiii|
+% |\rquotiii|\\[1ex]
+%
+% Controlan as comias en |quoting|, segundo o nivel no que nos
+% atopemos. |\lquoti| son as comias de abrir m'ais exteriores,
+% |\lquotii| as de segundo nivel, etc., e o mesmo para as de pechar
+% con |\rquoti|... Para as de seguir sempre se usan as de pechar.
+% Os valores predefinidos est'an no cadro 3.
+% \begin{table}
+% \center\small
+% \caption{Entrecomiados}
+% \vspace{1.5ex}
+% \begin{tabular}{l@{\hspace{5em}}l}
+% \toprule
+% |\lquoti| &|<<|\\
+% |\rquoti| &|>>|\\
+% |\lquotii| &|``|\\
+% |\rquotii| &|''|\\
+% |\lquotiii| &|`|\\
+% |\rquotiii| &|'|
+% \botrule
+% \end{tabular}
+% \end{table}
+%
+% \newenvironment{dialog}
+% {\def\lquoti{}\begin{quoting}---\ignorespaces}
+% {\def\rquoti{}\end{quoting}}
+%
+% As comias de seguir tam'en emprganse en di'alogos, incluso
+% se non as hai de abrir e pechar. Coa axuda do seguinte entorno,
+%\begin{verbatim}
+% \newenvironment{dialog}
+% {\def\lquoti{}\begin{quoting}---\ignorespaces}
+% {\def\rquoti{}\end{quoting}}
+%\end{verbatim}
+% podemos obter
+% \begin{quotation}\small
+% \begin{dialog}%
+% O di'alogo desenvolveuse deste xeito:
+%
+% "<---Eu non fun ---grit'ou Antonio.
+%
+% ---Mais colaboraches ---asegur'ou Rafael">.
+%
+% Mais al'i ningun se aclarou.
+% \end{dialog}
+% \end{quotation}
+%
+% \item[$\diamond$]
+% |\activatequoting \deactivatequoting|\\[1ex]
+%
+% As incompatibilidades potenciais destas abreviacins son enormes.
+% Por exemplo, en \textsf{ifthen} canclanse as comparacins entre
+% n'umeros;\,\footnote{E en |\string\ifnum|, etc. usado polos
+% desenroladores nos paquetes.} tam'en resultan inoperantes |@>>>|
+% e |@<<<| de \textsf{amstex}.\footnote{Anda que neste caso cabe
+% empregar os sin'onimos |@)))| e |@(((|.} Por iso, dase a posibilidade
+% de cancelalas e reactivalas con estas ordes, anda que se se
+% est'a a usar con \textsf{xmltex} xa se desactivan por completo de
+% modo autom'atico. O entorno |quoting| sempre permanece disponible.
+% \footnote{Algns tipos posen as ligaduras |<{}<| e |>{}>| de
+% forma interna para xenerar os caracteres de comias, polo que
+% neles tamb'en podemos usalos siempre.}
+%
+% \end{itemize}
+%
+% \subsection{Espaciado}
+%
+% O espaciado en galego afstase relativamente pouco do ingl'es;
+% Non obstante, o espacio tra-los signos de puntuaci'on debe
+% de ser o mesmo que o que hai entre palabras. Ou dito en
+% t'erminos de \TeX, |\frenchspacing| est'a activo.
+%
+% Tam'en noutros dous sitios hai diferencias. O primero son os
+% puntos suspensivos, para os que se redefine |\dots| e |\cdots|,\New{galician 4.3}
+% que os dan menos espaciados, e para |\dots| no texto engdese a
+% continuacin un espacio igual que o que seguira a un punto.
+% Por exemplo:
+% \begin{quote}\small\begin{tabbing}
+% |\dots non sei se canta\dots ou chora.|\quad \dots non sei se canta\dots ou chora.\\
+% |$f(x_1,\dots,x_n,y_1,\ldots,y_m)$|\quad $f(x_1,\dots,x_n,y_1,\ldots,y_m)$\\
+% |$1+2+\cdots+n$|\quad $1+2+\cdots+n$
+% \end{tabbing}\end{quote}
+% Tam'en poder'ianse escribir os tres puntos sen m'ais... , e na
+% pr'actica non hai diferencia. |galician| realiza as modificacins
+% a moi baixo nivel, para que sexan compatibles cos cambios que tamn
+% introduce |amsmath| nestes comandos.
+%
+% O segundo sitio un espacio fino antes do signo |\%| (que m'ais
+% exactamente |\,|, logo pdese <<recuperar>> co seu oposto |\!|,
+% se |\%| no segue a unha cifra).
+%
+% \subsection{Pequenas e medianas versais}
+%
+% |\lsc| pdese empregar para letras en versalitas. Tamn existe
+% |\msc|,\New{galician 4.3} que selecciona un tipo lixeiramente maior.
+% Por exemplo:
+% \begin{quote}\small\begin{tabbing}
+% |\lsc{DOG}, \lsc{RenFe}| \quad \= No \lsc{DOG} publicouse que \lsc{ReNFe} deber'a...\\
+% |\msc{DOG}, \msc{ReNFe}| \quad \= No \msc{DOG} publicouse que \msc{ReNFe} deber'a...
+% \end{tabbing}\end{quote}
+% Tam'en pode ser 'util para alguns usos dos n'umeros romanos:
+% \begin{quote}\small\begin{tabbing}
+% |s'eculo \msc{XVII}| \quad \= s'eculo \msc{XVII}\\
+% |cap'itulo \msc{II}| \quad \= cap'itulo \msc{II}.
+% \end{tabbing}\end{quote}
+%
+% Para evitar que con un tipo que carece de versalitas acabe
+% aparecendo (por substituci'on) un texto de min'usculas intntase
+% usar nestes casos as versais \emph{reais} dun tama'no menor.
+% Queda simplemente aceptable, pero mellor que nada. (\LaTeX{}
+% tende a substitur versalitas por versalitas, pero hai
+% excepcins, como coas negritas.)
+%
+% \subsection{Miscel'anea}
+%
+% \begin{itemize}
+% \item[$\bullet$] Pdese escribir |\'i| para |\'{\i}|.
+%
+% \item[$\bullet$] Hai unha abreviaci'on adicional como utilidade
+% tipogr'afica m'ais que especificamente galega. En certos
+% tipos, coma Times, o extremo inferior da barra est'a na lia
+% de base e expresins coma <<am/pm>> resultan pouco est'eticas.
+% |"/| produce unha barra que, de ser necesario, bixase lexeiramente.
+% Computer Modern ten unha barra ben dese'nada e non posible
+% ilustrar aqu'i este punto, pero en todo caso escribir'iase |am"/pm|.^^A
+% \footnote{En \MEA{141} recrrese a unha soluci'on que a 'unica
+% sinxela en programas de maquetaci'on: usar un corpo menor. Pero
+% con \TeX{} moito m'ais doado automatiza-las tareas.}
+%
+% \end{itemize}
+%
+% \section{Selecci'on da lingua}
+%
+% Por omisi'on, \babel{} deixa <<dormidas>> as linguas ata que se
+% chega a |\begin{document}| co fin de evitar conflictos polas
+% abreviacins; a cambio, prvase da posibilidade de usar as linguas
+% no pre'ambulo en ordes coma |\savebox|, |\title|, |\newtheorem|, etc.
+%
+% A orde |\selectgalician| permite activar |galician| coas sas
+% extensins e abreviacins antes de |\begin{document}|.\footnote{^^A
+% Algns detalles, que apenas afectan a \texttt{galician}, seguen sen
+% activarse ata o comenzo do documento.}
+% Deste xeito, poder'iamos dicir
+%\begin{verbatim}
+% \documentclass{book}
+% \usepackage[T1]{fontenc}
+% \usepackage[galician]{babel}
+% \usepackage[latin1]{inputenc}
+% \usepackage[centerlast]{caption2}
+% ... % M'ais paquetes
+%
+% \selectgalician
+%
+% \title{T'itulo}
+% \author{Autor}
+% \newcommand{\pste}{para"-psicoloxicamente}
+% \newsavebox{\mybox}
+% \savebox{\mybox}{m'ais cosas}
+% ... % M'ais definicins
+%
+% \begin{document}
+%\end{verbatim}
+%
+% \section{Adaptaci'on}
+% \subsection{Configuraci'on}
+%
+% Nas sas 'ultimas versions, \babel{} proporciona a posibilidade
+% de cargar autom'aticamente un arquivo co mesmo nome que o
+% principal, pero con extensi'on |.cfg|. \textsf{Galician}
+% proporciona unhas poucas ordes para seren usadas neste arquivo:
+% \begin{itemize}
+% \item[$\diamond$] |\gl@activeacute|\\[1ex]
+% Activa as abreviacins con ap'ostrofos, sen que sexa
+% necesario inclur |activeacute| coma opci'on en |\usepackage|.
+%
+% \item[$\diamond$] |\gl@enumerate{<leveli>}|%
+% |{<levelii>}{<leveliii>}{<leveliv>}|\\[1ex]
+% Cambia os valores preestablecidos por |galician| para
+% |enumerate|. \textit{leveln} consiste nunha letra, que
+% indica qu'e formato ter'a o n'umero, seguida de cualquera
+% texto. A letra ten que ser: |1| (ar'abigo), |a|
+% (min'uscula \emph{cursiva}\,\footnote{A letra cursiva
+% mais non os signos que a poidan seguir. M'ais ben debera
+% dicirse destacada, xa que se usa |\string\emph|. V'exase
+% \DTL{11}.}), |A| (versal), |i| (romano \emph{versalita},
+% con |\msc|), |I| (romano versal) ou finalmente |o| (ordinal\,
+% \footnote{O normal non engadir ning'un signo tras ordinal.}).
+%
+% Esta orde non est'a pensada para facer cambios elaborados, se
+% non solamente para meros reaxustes. Os valores preestablecidos
+% equivalen a
+%\begin{verbatim}
+% \gl@enumerate{1.}{a)}{1)}{a$'$)}
+%\end{verbatim}
+%
+% \item[$\diamond$] |\gl@itemize{<leveli>}|%
+% |{<levelii>}{<leveliii>}{<leveliv>}|\\[1ex]
+% O mesmo para |itemize|, s'olo que os argumentos sanse
+% de forma literal. Os valores orixinais de \LaTeX{} son
+% similares a
+%\begin{verbatim}
+% \gl@itemize{\textbullet}{\normalfont\bfseries\textendash}
+% {\textasteriskcentered}{\textperiodcentered}
+%\end{verbatim}
+%
+% \item[$\diamond$] |\gl@operators|\\[1ex]
+% Todo o relativo a operadores canclase con
+%\begin{verbatim}
+% \let\gl@operators\relax
+%\end{verbatim}
+% boa idea inclulo se no se van usar, xa que aforra memoria.
+%
+% \end{itemize}
+%
+% Outros axustes 'utiles neste contexto son |\galicianoperators|,
+% |\selectgalician| e |\deactivatequoting|.
+%
+%
+% Recordemos que tdo-los cambios operados dende este arquivo
+% restan compatibilidade documento, polo que se se distribe
+% conven adxuntarlo co entorno |filecontents|.
+%
+% \subsection{Outros cambios}
+%
+% \begin{itemize}
+%
+% \item A orde |\addto| permite
+% cambiar algunha das convencins internas. Esto resulta
+% interesante coas traduccins, xa que as formas proporcionadas
+% poden non ser as desexadas. Para iso necesario que
+% |galician| non estea seleccionado. Por exemplo, para cambiar
+% \emph{'Indice de figuras} por \emph{Lista de figuras}:
+%\begin{verbatim}
+% \addto\captionsgalician{%
+% \def\listfigurename{Lista de figuras}}
+%\end{verbatim}
+%
+% \item Para voltar elimina-la sangr'ia tra-la secci'on:
+%\begin{verbatim}
+% \def\@afterindentfalse{\let\if@afterindent\iffalse}
+% \@afterindentfalse
+%\end{verbatim}
+%
+% \item Para que |\roman| proporcione n'umeros romanos en
+% min'uscula, segundo a forma inglesa:
+%\begin{verbatim}
+% \def\@roman#1{\romannumeral #1};
+%\end{verbatim}
+% e para que emprege |\lsc| en troques de |\msc|:
+%\begin{verbatim}
+% \def\gl@roman##1{\protect\gl@lsc{\romannumeral##1}}
+%\end{verbatim}
+%
+% \item
+% Os extras atpanse organizados en varios grupos:
+% |\textgalician|, |\mathgalician|, |\shorthandsgalician|
+% e |\layoutgalician|. Poden cancelarse con:
+%\begin{verbatim}
+% \renewcommand\textgalician{}
+%\end{verbatim}
+%
+% \end{itemize}
+%
+% \section{Formatos distintos a \LaTeXe}
+%
+% O estilo |galician| funciona con outros formatos, anda que con un
+% subconxunto das funcins disponibles en \LaTeXe{}. Con Plain hai
+% que facer
+%\begin{verbatim}
+% \input galician.sty
+%\end{verbatim}
+% e con \LaTeX2.09, incluir |galician| entre as opcins de estilo.
+%
+% Inclense: traduccins, case todas as abreviacins, coma decimal,
+% utilidades para a divisi'on de palabras, ordinais nunha versi'on
+% simplificada (e non moi elegante), funcins matem'aticas,
+% entrecomiados en \LaTeX2.09, espaciado e |\'i|.
+% A selecci'on da lingua inmediata cargar o arquivo.
+%
+% En cambio non est'an disponibles: entrecomiados en Plain,
+% |\lsc|, |\msc| nin as adaptacins proporcionadas por |\layoutgalician|.
+%
+% A partir desta versi'on, o arquivo de configuraci'on lese sempre,
+% polo que aqueles que xa estean escritos espec'ificamante para \LaTeXe{}
+% poden presentar problemas se se usan con outros formatos. Se as
+% versins que se usan non son moi antigas, pdese comprobar o formato
+% coa variable |\fmtname|, que vale |LaTeX2e| ou |plain|. Por exemplo,
+%\begin{verbatim}
+% \def\temp{LaTeX2e}
+% \ifx\temp\fmtname
+% ...
+% \fi
+%\end{verbatim}
+%
+% \section{Bibliograf'ias}
+%
+% O arquivo |glbst.tex| que se xenera con \textsf{galician}
+% serve para que a utilidade \textsf{custom-bib} traballe en
+% conxunci'on con \babel. Define unha serie de ordes, que poden
+% consultarse no propio arquivo, que se utilizan para as
+% traduccins se se selecciona |babel| coma lingua xenerar un
+% estilo bibliogr'afico.
+%
+% \section{Incompatibilidades con versins anteriores}
+%
+% ^^A\begin{itemize}
+%
+% O t'ermino correspondente a |\tablename| estaba traducido
+% incorrectamente coma <<Tboa>>. Coma queira que <<tboa>> a
+% palabra con que pode aparecer no propio texto, ou ben pode
+% haber un artigo feminino ante |\tablename|, pode reponerse o
+% valor antigo con:
+%\begin{verbatim}
+% \addto\captionsgalician{%
+% \def\tablename{Tboa}%
+% \def\listtablename{\'Indice de tboas}}
+%\end{verbatim}
+%
+% ^^A\end{itemize}
+%
+% \section*{Referencias}
+% \addcontentsline{toc}{section}{Referencias}
+%
+% \begingroup
+% \small
+% \leftskip1.5cm \parindent-1.5cm
+%
+% \makebox[1.5cm][l]{\msc{DGII}}\textit{Diccionario de galego},
+% Ir Indo. Vigo, 2004.
+%
+% \makebox[1.5cm][l]{\msc{DOT}}Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de ortograf'ia t'ecnica},
+% Germ'an S'anchez Ruip'erez/Pir'amide. Madrid, 1987.
+% (Biblioteca del libro.)
+%
+% \makebox[1.5cm][l]{\msc{DTL}}Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de tipograf'ia y del libro},
+% Paraninfo. Madrid, 3"a ed., 1992.
+%
+% \makebox[1.5cm][l]{\msc{MEA}}Jos'e Mart'inez de Sousa,
+% \textit{Manual de edici'on y autoedici'on},
+% Pir'amide. Madrid 1994.
+%
+% \makebox[1.5cm][l]{\msc{OELG}}Xos'e Feix'o Cid,
+% \textit{Ortografa e estilo da lingua galega},
+% Pir'amide. Vigo, 2002.
+%
+% \leftskip0pt \parindent0pt \vspace{6pt}
+%
+% {\itshape
+% Como normalmente o primeiro contacto con \TeX{} por unha tesis,
+% cito libros que est'an relacionados co tema s que tiven acceso.
+% Est'an por orde de preferencia; en particular, os dous 'ultimos
+% parcenme pouco recomendables. (J. B.)}
+%
+% \parindent-1.5pc \leftskip1.5pc \vspace{3pt}
+%
+% Umberto Eco,
+% \textit{C'omo se hace una tesis}, Gedisa.
+% Barcelona 1982.
+%
+% Antonia Rigo Arnavat e Gabriel Genesc\`a Due'nas,
+% \textit{C'omo presentar una tesis y trabajos de investigaci'on},
+% Eumo-Octaedro. Barcelona, 2002.
+%
+% Prudenci Comes,
+% \textit{Gu'ia para la redacci'on y presentaci'on de trabajos
+% cient'ificos, informes t'ecnicos y tesinas},
+% Oikos-Tau. Barcelona, 1971.
+%
+% Javier Lasso de la Vega,
+% \textit{C'omo se hace una tesis doctoral},
+% Fundacion Universitaria Espa~nola. Madrid, 1977.
+%
+% Jos'e Romera Castillo e outros,
+% \textit{Manual de estilo},
+% Universidad Nacional de Educaci'on a Distancia. Madrid, 1996.
+%
+% Restituto Sierra Bravo,
+% \textit{Tesis doctorales y trabajos de investigaci'on cient'ifica},
+% Paraninfo. Madrid, 1986.
+%
+% \parindent0pc \leftskip0pc \vspace{6pt}
+%
+% {\itshape
+% Para outras cuestins tipogr'aficas, as referencias
+% usadas son, entre outras:}
+%
+% \parindent-1.5pc \leftskip1.5pc \vspace{3pt}
+%
+% Javier Bezos,
+% \textit{Tipograf'ia espa'nola con \TeX}, documento electr'onico
+% disponible en
+% \textsf{http://perso.wanadoo.es/jbezos/tipografia.html}.
+%
+% Ra'ul Cabanes Mart'inez,
+% <<El sistema internacional de unidades: ese desconocido>>,
+% \textit{Mundo Electr'onico}, n"o 142, p'axs.~119~-125. 1984.
+%
+% \textit{The Chicago Manual of Style}, University of Chicago
+% Press, 14"a~ed., esp.~p'axs.~333~-335. Chicago, 1993.
+%
+% Jos'e Fern'andez Castillo,
+% \textit{Normas para correctores y compositores tip'ografos},
+% Espasa-Calpe. Madrid, 1959.
+%
+% IRANOR [AENOR], Normas \msc{UNE} n'umeros 5010 (<<Signos
+% matem'aticos>>), 5028 (<<S'imbolos
+% geom'etricos>>) e 5029 (<<Impresi'on de los
+% s'imbolos de magnitudes y unidades y de los n'umeros>>).
+% [Obsoletas.]
+%
+% Real Academia Espa'nola,
+% \textit{Esbozo de una nueva gram'atica de la
+% lengua espa'nola}, Espasa-Calpe. Madrid, 1973.
+%
+% V.\ Mart'inez Sicluna,
+% \textit{Teor'ia y pr'actica de la tipograf'ia},
+% Gustavo Gili. Barcelona, 1945.
+%
+% Jos'e Mart'inez de Sousa,
+% \textit{Diccionario de ortograf'ia de la lengua espa'nola},
+% Paraninfo. Madrid, 1996.
+%
+% Juan Mart'inez Val, \textit{Tipograf'ia pr'actica},
+% Laberinto. Madrid, 2002.
+%
+% Juan Jos'e Morato, \textit{Gu'ia pr'actica del compositor
+% tipogr'afico}, Hernando, 2"a ed. Madrid, 1908 (1"a ed., 1900,
+% 3"a ed., 1933).
+%
+% Marion Neubauer,
+% <<Feinheiten bei wissenschaftlichen Publikationen>>,
+% \textit{Die \TeX nisches Kom\"odie}, parte I, vol. 8, n"o 4,
+% p'axs. 23-40. 1996; parte II, vol. 9, n"o 1, p'axs.~25~-44. 1997.
+%
+% Jos'e Polo,
+% \textit{Ortograf'ia y ciencia del lenguaje}, Paraninfo. Madrid, 1974.
+%
+% Pedro Valle,
+% \textit{C'omo corregir sin ofender}, Lumen. Buenos Aires, 1998.
+%
+% Hugh C. Wolfe, <<S'imbolos, unidades y nomenclatura>>,
+% \textit{Enciclopedia de F'isica}, t.~2, p'axs.~1423~-1451.
+% dir. Rita G. Lerner e George L. Trigg, Alianza. Madrid, 1987,
+%
+% \endgroup
+%
+% \end{userdtx}
+%
+% \begin{userdrv}
+%^^A ======= Beginning of text as typeset by user.drv =========
+%
+% \GetFileInfo{galician.dtx}
+%
+% \section{This file}
+%
+% This file defines all the language-specific macros for the
+% Galician language. The file galician.dtx was translated in
+% January 2007 by Javier A. M\'ugica from spanish.dtx. It was
+% given the version number 4.3, based on the version for spanish.dtx
+% at those times, that was 4.2b. The original author from
+% v4.0 to 4.2b was Javier Bezos. Previous versions were written
+% by Julio S\'anchez.
+
+% I decided to make \emph{tabula rasa} of all |\changes|
+% logs. Only changes from spanish 4.2b to galician 4.3 and thereafter
+% are documented. The change history for the original spanish.dtx
+% can be found in that file.
+%
+% \section{The Galcian language}
+%
+% Custumization is made following mainly the books on the subject
+% by Jos\'e Mart\'\i nez de Sousa and Xos\'e Feix\'o Cid.
+% By typesetting |galician.dtx| directly you will get the full
+% documentation (regrettably is in Galician only, but it is
+% pretty long). References in this part refers to that document.
+% There are several aditional features documented in the Galician
+% version only.
+%
+% This style provides:
+% \begin{itemize}
+% \item Translations following the International \LaTeX{}
+% conventions, as well as |\today|.
+%
+% \item Shorthands listed in Table~\ref{tab:galician-quote-def}.
+% Examples in subsection~3.4 are illustrative. Note that
+% |"~| has a special meaning in \textsf{galician}
+% different to other languages, and is used mainly in linguistic
+% contexts.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |'a| & acute accented a. Also for: e, i, o, u (both
+% lowercase and uppercase).\\
+% |'n| & \~n (also uppercase).\\
+% |~n| & \~n (also uppercase). Deprecated.\\
+% |"u| & \"u (also uppercase).\\
+% |"i| & \"i (also uppercase).\\
+% |"a| & Ordinal numbers (also |"A|, |"o|, |"O|).\\
+% |"rr| & rr, but -r when hyphenated\\
+% |"-| & Like |\-|, but allowing hyphenation in the rest
+% the word.\\
+% |"=| & Like |-|, but allowing hyphenation in the rest
+% the word.\\
+% |"~| & The hyphen is repeated at the very beginning of
+% the next line if the word is hyphenated at this
+% point.\\
+% |""| & Like |"-| but producing no hyphen sign.\\
+% |~-| & Like |-| but with no break after the hyphen. Also for:
+% en-dashes (|~--|) and em-dashes (|~---|). \\
+% |"/| & A slash slightly lowered, if necessary.\\
+% \verb+"|+ & disable ligatures at this point.\\
+% |<<| & Left guillemets.\\
+% |>>| & Right guillemets.\\
+% |"<| & |\begin{quoting}|. (See text.)\\
+% |">| & |\end{quoting}|. (See text.)
+% \end{tabular}
+% \caption{Extra definitions made by file \file{galician.ldf}}
+% \label{tab:galician-quote-def}
+% \end{table}
+%
+% \item |\deactivatetilden| deactivates the |~n| and |~N| shorthands.
+%
+% \item \emph{In math mode} a dot followed by a digit is replaced
+% by a decimal comma.
+%
+% \item Galicians ordinals and abbeviations with |\sptext|
+% as, for instance, |1\sptext{o}|. The
+% preceptive dot is included.
+%
+% \item Accented functions: l\'\i m, m\'ax, m\'\i n, m\'od. You may
+% globally omit the accents with |\unaccentedoperators|. Spaced
+% functions: arc\,cos, etc. You may globally kill that space with
+% |\unspacedoperators|. |\dotlessi| is provided for use in math mode.
+%
+% \item A |quoting| environment and a related pair of shorthands |<<|
+% and |>>|. The command
+% |\deactivatequoting| deactivates these shorthand in case
+% you want to use |<| and |>| in some AMS commands and numerical
+% comparisons.
+%
+% \item The command |\selectgalician| selects the |galician| language
+% \emph{and} its shorthands. (Intended for the preamble.)
+%
+% \item |\frenchspacing| is used.
+%
+% \item |\dots| is redefined. It is now equal to typing tree points
+% in a row (it preserves the space following).
+%
+% \item There is a small space before |\%|.
+%
+% \item |\msc| provides lowercase small caps. (See subsection~3.10.)
+% \end{itemize}
+%
+% Just in case |galician| is the main language, the group
+% |\layoutgalician| is activated, which modifies the standard
+% classes through the whole document (it cannot be deactivated)
+% in the following way:
+% \begin{itemize}
+% \item Both |enumerate| and |itemize| are adapted to Galician rules.
+%
+% \item Both |\alph| and |\Alph| include \textit{\~n} after \textit{n}.
+%
+% \item Symbol footmarks are one, two, three, etc., asteriscs.
+%
+% \item |OT1| guillemets are generated with two |lasy| symbols instead
+% of small |\ll| and |\gg|.
+%
+% \item |\roman| is redefined to write small caps roman numerals, since
+% lowercase roman numerals are not allowed. However, \textit{MakeIndex}
+% rejects entries containing pages in that format. The |.idx| file must
+% be preprocessed if the document has this kind of entries with
+% the provided |romanidx.tex| tool---just \TeX{} it and follow the
+% instructions.
+%
+% \item There is a dot after section numbers in titles and toc.
+% \end{itemize}
+% This group is ignored if you write |\selectgalician*| in the
+% preamble.
+%
+% Some additional commands are provided to be used in the
+% |galician.cfg| file:
+% \begin{itemize}
+% \item With |\gl@activeacute| acute accents are always active,
+% overriding the default \textsf{babel} behaviour.
+%
+% \item |\gl@enumerate| sets the labels to be used by |enumerate|. The
+% same applies to |\gl@itemize| and |itemize|.
+%
+% \item |\gl@operators| stores the operator commands.
+% All of them are canceled with
+%\begin{verbatim}
+% \let\gl@operators\relax
+%\end{verbatim}
+% \end{itemize}
+% The commands |\deactivatequoting|, |\deactivatetilden| and
+% |\selectgalician| may be used in this file, too.
+%
+% A subset of these commands is provided for
+% use in Plain \TeX{} (with |\input galician.sty|).
+%
+% \end{userdrv}
+%
+%\StopEventually{}
+%
+%^^A ========== End of manual ===============
+%
+% \begin{userdtx}
+% \section{The Code}
+% \end{userdtx}
+%
+% \begin{userdrv}
+% \subsection{The Code}
+% \end{userdrv}
+%
+% \changes{galician~4.3}{07/01/22}{Reversed "<, "> and <<, >>.}
+% \changes{galician~4.3}{07/01/22}{Removed the Spanish et sign.}
+% \changes{galician~4.3}{07/01/26}{Removed the shorthand for \c{c}. It
+% existed in medieval galician-portuguese, but that does not seem a
+% reason to be included here.}
+%
+% This file provides definition for both \LaTeXe{} and non
+% \LaTeXe{} formats.
+%
+% Identify the |ldf| file.
+%
+% \begin{macrocode}
+%<*code>
+\ProvidesLanguage{galician.ldf}
+ [2008/07/06 v4.3c Galician support from the babel system]
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{galician} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@galician| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\LdfInit{galician}\captionsgalician
+\ifx\undefined\l@galician
+ \@nopatterns{Galician}
+ \adddialect\l@galician0
+\fi
+% \end{macrocode}
+%
+% We define some tools which will be used in that style file:
+% (1) we make sure that |~| is active, (2) |\gl@delayed| delays
+% the expansion of the code in conditionals (in fact, quite similar
+% to |\bbl@afterfi|).
+%
+% \begin{macrocode}
+\edef\gl@savedcatcodes{%
+ \catcode`\noexpand\~=\the\catcode`\~
+ \catcode`\noexpand\"=\the\catcode`\"}
+\catcode`\~=\active
+\catcode`\"=12
+\long\def\gl@delayed#1\then#2\else#3\fi{%
+ #1%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {#2}{#3}}
+% \end{macrocode}
+%
+% Two tests are introduced. The first one tells us if the format is
+% \LaTeXe{}, and the second one if the format is Plain or any other.
+% If both are false, the format is \LaTeX2.09{}.
+%
+% \begin{macrocode}
+\gl@delayed
+\expandafter\ifx\csname documentclass\endcsname\relax\then
+ \let\ifes@LaTeXe\iffalse
+\else
+ \let\ifes@LaTeXe\iftrue
+\fi
+\gl@delayed
+\expandafter\ifx\csname newenvironment\endcsname\relax\then
+ \let\ifes@plain\iftrue
+\else
+ \let\ifes@plain\iffalse
+\fi
+% \end{macrocode}
+%
+% Translations for captions.
+%
+% \begin{macrocode}
+\addto\captionsgalician{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referencias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliograf\'{\i}a}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\'endice}%
+ \def\listfigurename{\'Indice de figuras}%
+ \def\listtablename{\'Indice de cadros}%
+ \def\indexname{\'Indice alfab\'etico}%
+ \def\figurename{Figura}%
+ \def\tablename{Cadro}%
+ \def\partname{Parte}%
+ \def\enclname{Adxunto}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{P\'axina}%
+ \def\seename{v\'exase}%
+ \def\alsoname{v\'exase tam\'en}%
+ \def\proofname{Demostraci\'on}%
+ \def\glossaryname{Glosario}}
+
+\expandafter\ifx\csname chapter\endcsname\relax
+ \addto\captionsgalician{\def\contentsname{\'Indice}}
+\else
+ \addto\captionsgalician{\def\contentsname{\'Indice xeral}}
+\fi
+% \end{macrocode}
+%
+% And the date.
+% \changes{galician~4.3}{07/01/21}{Set the default to \textit{do}}
+% \begin{macrocode}
+\def\dategalician{%
+ \def\today{\the\day~de \ifcase\month\or xaneiro\or febreiro\or
+ marzo\or abril\or maio\or xu\~no\or xullo\or agosto\or
+ setembro\or outubro\or novembro\or decembro\fi
+ \ \ifnum\year>1999\gl@yearl\else de\fi~\the\year}}
+\def\galiciandatedo{\def\gl@yearl{do}}
+\def\galiciandatede{\def\gl@yearl{de}}
+\galiciandatedo
+% \end{macrocode}
+%
+% The basic macros to select the language, in the preamble or the
+% config file. Use of |\selectlanguage| should be avoided at this
+% early stage because the active chars are not yet
+% active. |\selectgalician| makes them active.
+%
+% \begin{macrocode}
+\def\selectgalician{%
+ \def\selectgalician{%
+ \def\selectgalician{%
+ \PackageWarning{galician}{Extra \string\selectgalician ignored}}%
+ \gl@select}}
+
+\@onlypreamble\selectgalician
+
+\def\gl@select{%
+ \let\gl@select\@undefined
+ \selectlanguage{galician}%
+ \catcode`\"\active\catcode`\~=\active}
+% \end{macrocode}
+%
+% Instead of joining all the extras directly in |\extrasgalician|,
+% we subdivide them in three further groups.
+% \begin{macrocode}
+\def\extrasgalician{%
+ \textgalician
+ \mathgalician
+ \ifx\shorthandsgalician\@empty
+ \galiciandeactivate{."'~<>}%
+ \languageshorthands{none}%
+ \else
+ \shorthandsgalician
+ \fi}
+\def\noextrasgalician{%
+ \ifx\textgalician\@empty\else
+ \notextgalician
+ \fi
+ \ifx\mathgalician\@empty\else
+ \nomathgalician
+ \fi
+ \ifx\shorthandsgalician\@empty\else
+ \noshorthandsgalician
+ \fi
+ \gl@reviveshorthands}
+% \end{macrocode}
+%
+% And the first of these sub-groups is defined.
+%
+% \begin{macrocode}
+\addto\textgalician{%
+ \babel@save\sptext
+ \def\sptext{\protect\gl@sptext}}
+% \end{macrocode}
+%
+% The definition of |\sptext| is more elaborated than that of
+% |\textsuperscript|. With uppercase superscript text
+% the scriptscriptsize is used. The mandatory dot is already
+% included. There are two versions, depending on the
+% format.
+%
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \newcommand\gl@sptext[1]{%
+ {.\setbox\z@\hbox{8}\dimen@\ht\z@
+ \csname S@\f@size\endcsname
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \fontsize\sf@size\z@
+ \selectfont
+ \advance\dimen@-1.15ex
+ \else
+ \fontsize\ssf@size\z@
+ \selectfont
+ \advance\dimen@-1.5ex
+ \fi
+ \math@fontsfalse\raise\dimen@\hbox{#1}}}
+\else %<<<<<<
+ \let\sptextfont\rm
+ \newcommand\gl@sptext[1]{%
+ {.\setbox\z@\hbox{8}\dimen@\ht\z@
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \advance\dimen@-0.75ex
+ \raise\dimen@\hbox{$\scriptstyle\sptextfont#1$}%
+ \else
+ \advance\dimen@-0.8ex
+ \raise\dimen@\hbox{$\scriptscriptstyle\sptextfont#1$}%
+ \fi}}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% Now, lowercase small caps. First, we test if there are actual
+% small caps for the current font. If not, faked small caps are
+% used. |\msc| tries a slightly larger font.
+% Javier B. wrote: ``The \cs{selectfont} in \cs{gl@lsc} could
+% seem redundant, but it's not''. I cannot see how it can't be
+% redundant (it is the last thing executed by |\scshape|), but
+% I keep it.
+%
+% \changes{galician~4.3}{07/00/26}{Added \cs{msc}}
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \addto\textgalician{%
+ \babel@save\lsc
+ \def\lsc{\protect\gl@lsc}
+ \babel@save\msc
+ \def\msc{\protect\gl@msc}}
+
+ \def\gl@@msc{\expandafter\@tempdima\f@size pt \divide\@tempdima by 200 \multiply\@tempdima by 219
+ \edef\f@size{\strip@pt\@tempdima}\selectfont}
+ \def\gl@msc{\let\gl@do@msc\gl@@msc\lsc}
+ \let\gl@do@msc\relax
+
+ \def\gl@lsc#1{%
+ \leavevmode
+ \hbox{\gl@do@msc\scshape\selectfont
+ \expandafter\ifx\csname\f@encoding/\f@family/\f@series
+ /n/\f@size\expandafter\endcsname
+ \csname\curr@fontshape/\f@size\endcsname
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\selectfont
+ \PackageInfo{galician}{Replacing undefined sc font\MessageBreak
+ shape by faked small caps}%
+ \MakeUppercase{#1}%
+ \else
+ \MakeLowercase{#1}%
+ \fi}\let\gl@do@msc\relax}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The |quoting| environment. This part is not available
+% in Plain, hence the test. Overriding the default |\everypar| is
+% a bit tricky.
+%
+% \begin{macrocode}
+\newif\ifgl@listquot
+
+\ifes@plain\else %<<<<<<
+ \csname newtoks\endcsname\gl@quottoks
+ \csname newcount\endcsname\gl@quotdepth
+
+ \ifx\quoting\c@undefined\def\next{\let\next\relax\newenvironment}
+ \else\def\next{\PackageInfo{galician}{Redefining quoting}\let\next\relax\renewenvironment}
+ \fi
+ \next{quoting}
+ {\leavevmode
+ \advance\gl@quotdepth1
+ \csname lquot\romannumeral\gl@quotdepth\endcsname%
+ \ifnum\gl@quotdepth=\@ne
+ \gl@listquotfalse
+ \let\gl@quotpar\everypar
+ \let\everypar\gl@quottoks
+ \everypar\expandafter{\the\gl@quotpar}%
+ \gl@quotpar{\the\everypar
+ \ifgl@listquot\global\gl@listquotfalse\else\gl@quotcont\fi}%
+ \fi
+ \toks@\expandafter{\gl@quotcont}%
+ \edef\gl@quotcont{\the\toks@
+ \expandafter\noexpand
+ \csname rquot\romannumeral\gl@quotdepth\endcsname}}
+ {\csname rquot\romannumeral\gl@quotdepth\endcsname}
+
+ \def\lquoti{\guillemotleft{}}
+ \def\rquoti{\guillemotright{}}
+ \def\lquotii{``}
+ \def\rquotii{''}
+ \def\lquotiii{`}
+ \def\rquotiii{'}
+
+ \let\gl@quotcont\@empty
+% \end{macrocode}
+%
+% If there is a margin par inside quoting, we don't add the
+% quotes. |\gl@listqout| stores the quotes to be used before
+% item labels; otherwise they could appear after the labels.
+%
+% \begin{macrocode}
+ \addto\@marginparreset{\let\gl@quotcont\@empty}
+
+ \def\gl@listquot{%
+ \csname rquot\romannumeral\gl@quotdepth\endcsname
+ \global\gl@listquottrue}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% Now, the |\frenchspacing|, followed by |\...dots| and |\%|
+% Instead of redefining |\ldots| and |\cdots|, we redefine |\ldotp|
+% and |\cdotp|, so that this is compatible with amsmath.
+% In LaTeX we also redefine |\textellipsis|, and for plain or
+% other we redefine |\dots|.
+%
+% \changes{galician~4.3}{07/01/27}{\cs{...} is removed and instead
+% \cs{dots} and \cs{dots} are changed, by redefining \cs{ldotc},
+% \cs{dotc} and \cs{textellipsis} or \cs{dots}}
+% \begin{macrocode}
+\addto\textgalician{\bbl@frenchspacing}
+\addto\notextgalician{\bbl@nonfrenchspacing}
+
+\mathchardef\gl@cdot="0201
+\ifes@LaTeXe %<<<<<<
+\addto\textgalician{%
+ \babel@save\textellipsis
+ \babel@save\ldotp
+ \babel@save\cdotp%
+ \def\textellipsis{\hbox{...}\spacefactor\sfcode`.{} }%
+ \mathchardef\ldotp="013A%
+ \mathchardef\cdotp="0201%
+}
+\else %<<<<<<
+\addto\textgalician{%
+ \babel@save\dots
+ \babel@save\ldotp
+ \babel@save\cdotp
+ \mathchardef\ldotp="013A%
+ \mathchardef\cdotp="0201%
+ \def\dots{\ifmmode\ldots\else...\spacefactor\sfcode`.{} \fi}%
+}
+\fi %<<<<<<
+
+\ifes@LaTeXe %<<<<<<
+ \addto\textgalician{%
+ \let\percentsign\%%
+ \babel@save\%%
+ \def\%{\unskip\,\percentsign{}}}
+\else
+ \addto\textgalician{%
+ \let\percentsign\%%
+ \babel@save\%%
+ \def\%{\unskip\ifmmode\,\else$\m@th\,$\fi\percentsign{}}}
+\fi
+% \end{macrocode}
+%
+% We follow with the math group. It's not easy to add an accent
+% in an operator. The difficulty is that we must avoid using
+% text (that is, |\mbox|) because we have no control on font
+% and size, and at time we should access |\i|, which is a text
+% command forbidden in math mode. |\dotlessi| must be
+% converted to uppercase if necessary in \LaTeXe. There are
+% two versions, depending on the format.
+%
+% \begin{macrocode}
+\addto\mathgalician{%
+ \babel@save\dotlessi
+ \def\dotlessi{\protect\gl@dotlessi}}
+
+\let\nomathgalician\relax %% Unused, but called
+
+\ifes@LaTeXe %<<<<<<
+ \def\gl@texti{\i}
+ \addto\@uclclist{\dotlessi\gl@texti}
+\fi %<<<<<<
+
+\ifes@LaTeXe %<<<<<<
+ \def\gl@dotlessi{%
+ \ifmmode
+ {\ifnum\mathgroup=\m@ne
+ \imath
+ \else
+ \count@\escapechar \escapechar=\m@ne
+ \expandafter\expandafter\expandafter
+ \split@name\expandafter\string\the\textfont\mathgroup\@nil
+ \escapechar=\count@
+ \@ifundefined{\f@encoding\string\i}%
+ {\edef\f@encoding{\string?}}{}%
+ \expandafter\count@\the\csname\f@encoding\string\i\endcsname
+ \advance\count@"7000
+ \mathchar\count@
+ \fi}%
+ \else
+ \i
+ \fi}
+\else %<<<<<<
+ \def\gl@dotlessi{%
+ \ifmmode
+ \mathchar"7010
+ \else
+ \i
+ \fi}
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The switches for accents and spaces in math.
+%
+% \changes{galician~4.3}{07/01/21}{Set the default to \cs{unspacedoperators}}
+% \begin{macrocode}
+\def\accentedoperators{%
+ \def\gl@op@ac##1{\acute{##1}}%
+ \def\gl@op@i{\acute{\dotlessi}}}
+\def\unaccentedoperators{%
+ \def\gl@op@ac##1{##1}%
+ \def\gl@op@i{i}}
+\accentedoperators
+
+\def\spacedoperators{\let\gl@op@sp\,}
+\def\unspacedoperators{\let\gl@op@sp\@empty}
+\unspacedoperators
+% \end{macrocode}
+%
+% The operators are stored in |\gl@operators|, which in turn is
+% included in the math group. Since |\operator@font| is
+% defined in \LaTeXe{} only, we need to define them in the plain variant.
+%
+% \changes{galician~4.3}{07/01/21}{\cs{sin}, \cs{arcsin} and \cs{sinh}
+% are set to produce the same as \cs{sen}, \cs{arcsen} and \cs{senh}}
+% \changes{galician~4.3}{07/01/27}{cosec and senh moved from
+% \cs{galicianoperators} to the main group}
+%
+% \begin{macrocode}
+\addto\mathgalician{%
+ \gl@operators}
+
+\ifes@LaTeXe\else %<<<<<<
+ \let\operator@font\rm
+ \def\@empty{}
+\fi %<<<<<<
+
+\def\gl@operators{%
+ \babel@save\lim \def\lim{\mathop{\operator@font l\protect\gl@op@i m}}%
+ \babel@save\limsup \def\limsup{\mathop{\operator@font l\gl@op@i m\,sup}}%
+ \babel@save\liminf \def\liminf{\mathop{\operator@font l\gl@op@i m\,inf}}%
+ \babel@save\max \def\max{\mathop{\operator@font m\gl@op@ac ax}}%
+ \babel@save\inf \def\inf{\mathop{\operator@font \protect\gl@op@i nf}}%
+ \babel@save\min \def\min{\mathop{\operator@font m\protect\gl@op@i n}}%
+ \babel@save\bmod
+ \def\bmod{%
+ \nonscript\mskip-\medmuskip\mkern5mu%
+ \mathbin{\operator@font m\gl@op@ac od}\penalty900\mkern5mu%
+ \nonscript\mskip-\medmuskip}%
+ \babel@save\pmod
+ \def\pmod##1{%
+ \allowbreak\mkern18mu({\operator@font m\gl@op@ac od}\,\,##1)}%
+ \def\gl@a##1 {%
+ \gl@delayed
+ \if^##1^\then % is it empty? do nothing and continue
+ \gl@a
+ \else
+ \gl@delayed
+ \if&##1\then % is it &? do nothing and finish
+ \else
+ \begingroup
+ \let\,\@empty % \, is ignored when def'ing the macro name
+ \let\acute\@firstofone % same
+ \edef\gl@b{\expandafter\noexpand\csname##1\endcsname}%
+ \def\,{\noexpand\gl@op@sp}%
+ \def\acute####1{%
+ \if i####1%
+ \noexpand\gl@op@i
+ \else
+ \noexpand\gl@op@ac####1%
+ \fi}%
+ \edef\gl@a{\endgroup
+ \noexpand\babel@save\expandafter\noexpand\gl@b
+ \def\expandafter\noexpand\gl@b{%
+ \mathop{\noexpand\operator@font##1}\nolimits}}%
+ \gl@a % It restores itself
+ \gl@a
+ \fi
+ \fi}%
+ \let\gl@b\galicianoperators
+ \addto\gl@b{ }%
+ \expandafter\gl@a\gl@b sen tx cosec arc\,sen arc\,cos arc\,tx senh & %\, will be set to \gl@op@sp
+ %
+ \babel@save\sin \let\sin\sen
+ \babel@save\arcsin \let\arcsin\arcsen
+ \babel@save\sinh \let\sinh\senh
+}
+
+\def\galicianoperators{cotx txh}
+% \end{macrocode}
+%
+% Now comes the text shorthands. They are grouped in
+% |\shorthandsgalician| and this style performs some
+% operations before the babel shortands are called.
+% The goals are to allow espression like |$a^{x'}$|
+% and to deactivate the shorthands making them of
+% category `other'. After providing a |\'i| shorthand,
+% the new macros are defined.
+%
+% \begin{macrocode}
+\DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'{\i}}
+
+\def\gl@set@shorthand#1{%
+ \expandafter\edef\csname gl@savecat\string#1\endcsname
+ {\the\catcode`#1}%
+ \initiate@active@char{#1}%
+ \catcode`#1=\csname gl@savecat\string#1\endcsname\relax
+ \expandafter\let\csname gl@math\string#1\expandafter\endcsname
+ \csname normal@char\string#1\endcsname}
+
+\def\gl@use@shorthand{%
+ \gl@delayed
+ \ifx\thepage\relax\then
+ \string
+ \else{%
+ \gl@delayed
+ \ifx\protect\@unexpandable@protect\then
+ \noexpand
+ \else
+ \gl@use@sh
+ \fi}%
+ \fi}
+
+\def\gl@text@sh#1{\csname active@char\string#1\endcsname}
+\def\gl@math@sh#1{\csname gl@math\string#1\endcsname}
+
+\def\gl@use@sh{%
+ \gl@delayed
+ \if@safe@actives\then
+ \string
+ \else{%
+ \gl@delayed
+ \ifmmode\then
+ \gl@math@sh
+ \else
+ \gl@text@sh
+ \fi}%
+ \fi}
+
+\gdef\gl@activate#1{%
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \def~{\gl@use@shorthand~}}}
+
+\def\galiciandeactivate#1{%
+ \@tfor\@tempa:=#1\do{\expandafter\gl@spdeactivate\@tempa}}
+
+\def\gl@spdeactivate#1{%
+ \if.#1%
+ \mathcode`\.=\gl@period@code
+ \else
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \expandafter\let\expandafter~%
+ \csname normal@char\string#1\endcsname}%
+ \catcode`#1\csname gl@savecat\string#1\endcsname\relax
+ \fi}
+
+\def\gl@reviveshorthands{%
+ \gl@restore{"}\gl@restore{~}%
+ \gl@restore{<}\gl@restore{>}%
+ \gl@quoting}
+
+\def\gl@restore#1{%
+ \catcode`#1=\active
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \bbl@deactivate{~}}}
+% \end{macrocode}
+%
+% But \textsf{galician} allows two category codes for |'|,
+% so both should be taken into account in \cs{bbl@pr@m@s}.
+%
+% \begin{macrocode}
+\begingroup
+\catcode`\'=12
+\lccode`~=`' \lccode`'=`'
+\lowercase{%
+\gdef\bbl@pr@m@s{%
+ \gl@delayed
+ \ifx~\@let@token\then
+ \pr@@@s
+ \else
+ {\gl@delayed
+ \ifx'\@let@token\then
+ \pr@@@s
+ \else
+ {\gl@delayed
+ \ifx^\@let@token\then
+ \pr@@@t
+ \else
+ \egroup
+ \fi}%
+ \fi}%
+ \fi}}
+\endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\ifx\csname @tabacckludge\endcsname\relax
+ \let\gl@tak\a
+\else
+ \let\gl@tak\@tabacckludge
+\fi
+
+\ifes@LaTeXe %<<<<<<
+ \def\@tabacckludge#1{\expandafter\gl@tak\string#1}
+ \let\a\@tabacckludge
+\else\ifes@plain %<<<<<<
+ \def\@tabacckludge#1{\csname\string#1\endcsname}
+\else %<<<<<<
+ \def\@tabacckludge#1{\csname a\string#1\endcsname}
+\fi\fi %<<<<<<
+
+\expandafter\ifx\csname add@accent\endcsname\relax
+ \def\add@accent#1#2{\accent#1 #2}
+\fi
+% \end{macrocode}
+%
+% Instead of redefining |\'|, we redefine the internal macro for the OT1 encoding.
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \def\gl@accent#1#2#3{%
+ \expandafter\@text@composite
+ \csname OT1\string#1\endcsname#3\@empty\@text@composite
+ {\bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
+ \setbox\@tempboxa\hbox{#3%
+ \global\mathchardef\accent@spacefactor\spacefactor}%
+ \spacefactor\accent@spacefactor}}
+\else %<<<<<<
+ \def\gl@accent#1#2#3{%
+ \bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
+ \spacefactor\sfcode`#3 }
+\fi %<<<<<<
+% \end{macrocode}
+%
+% The shorthands are activated in the aux file. Now, we begin
+% the shorthands group.
+%
+% \begin{macrocode}
+\addto\shorthandsgalician{\languageshorthands{galician}}
+\let\noshorthandsgalician\relax
+% \end{macrocode}
+%
+% First, decimal comma.
+%
+% \begin{macrocode}
+\def\galiciandecimal#1{\def\gl@decimal{{#1}}}
+\def\decimalcomma{\galiciandecimal{,}}
+\def\decimalpoint{\galiciandecimal{.}}
+\decimalcomma
+
+\gl@set@shorthand{.}
+
+\@namedef{gl@math\string.}{%
+ \@ifnextchar\egroup
+ {\mathchar\gl@period@code\relax}%
+ {\gl@text@sh.}}
+
+\declare@shorthand{system}{.}{\mathchar\gl@period@code\relax}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\addto\shorthandsgalician{%
+ \mathchardef\gl@period@code\the\mathcode`\.%
+ \babel@savevariable{\mathcode`\.}%
+ \mathcode`\.="8000 %
+ \gl@activate{.}}
+
+\AtBeginDocument{%
+ \catcode`\.=12
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\catcode`\string\.=12}%
+ \fi}
+
+\declare@shorthand{galician}{.1}{\gl@decimal1}
+\declare@shorthand{galician}{.2}{\gl@decimal2}
+\declare@shorthand{galician}{.3}{\gl@decimal3}
+\declare@shorthand{galician}{.4}{\gl@decimal4}
+\declare@shorthand{galician}{.5}{\gl@decimal5}
+\declare@shorthand{galician}{.6}{\gl@decimal6}
+\declare@shorthand{galician}{.7}{\gl@decimal7}
+\declare@shorthand{galician}{.8}{\gl@decimal8}
+\declare@shorthand{galician}{.9}{\gl@decimal9}
+\declare@shorthand{galician}{.0}{\gl@decimal0}
+% \end{macrocode}
+%
+% Now accents and tools
+%
+% \begin{macrocode}
+\gl@set@shorthand{"}
+\def\gl@umlaut#1{%
+ \bbl@allowhyphens\add@accent{127}#1\bbl@allowhyphens
+ \spacefactor\sfcode`#1 }
+% \end{macrocode}
+%
+% We override the default |"| of babel, intended for german.
+%
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+ \addto\shorthandsgalician{%
+ \gl@activate{"}%
+ \gl@activate{~}%
+ \babel@save\bbl@umlauta
+ \let\bbl@umlauta\gl@umlaut
+ \expandafter\babel@save\csname OT1\string\~\endcsname
+ \expandafter\def\csname OT1\string\~\endcsname{\gl@accent\~{126}}%
+ \expandafter\babel@save\csname OT1\string\'\endcsname
+ \expandafter\def\csname OT1\string\'\endcsname{\gl@accent\'{19}}}
+\else %<<<<<<
+ \addto\shorthandsgalician{%
+ \gl@activate{"}%
+ \gl@activate{~}%
+ \babel@save\bbl@umlauta
+ \let\bbl@umlauta\gl@umlaut
+ \babel@save\~%
+ \def\~{\gl@accent\~{126}}%
+ \babel@save\'%
+ \def\'#1{\if#1i\gl@accent\'{19}\i\else\gl@accent\'{19}{#1}\fi}}
+\fi %<<<<<<
+% \end{macrocode}
+% \changes{galician~4.3}{07/01/22}{Removed the shorthands "er and "ER,
+% they don't exist in galician.}
+% \begin{macrocode}
+\declare@shorthand{galician}{"a}{\protect\gl@sptext{a}}
+\declare@shorthand{galician}{"A}{\protect\gl@sptext{A}}
+\declare@shorthand{galician}{"o}{\protect\gl@sptext{o}}
+\declare@shorthand{galician}{"O}{\protect\gl@sptext{O}}
+
+\declare@shorthand{galician}{"u}{\"u}
+\declare@shorthand{galician}{"U}{\"U}
+\declare@shorthand{galician}{"i}{\"i}
+\declare@shorthand{galician}{"I}{\"I}
+
+\declare@shorthand{galician}{"<}{\begin{quoting}}
+\declare@shorthand{galician}{">}{\end{quoting}}
+\declare@shorthand{galician}{"-}{\bbl@allowhyphens\-\bbl@allowhyphens}
+\declare@shorthand{galician}{"=}%
+ {\bbl@allowhyphens\char\hyphenchar\font\hskip\z@skip}
+\declare@shorthand{galician}{"~}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {\char\hyphenchar\font}{\char\hyphenchar\font}\bbl@allowhyphens}
+\declare@shorthand{galician}{"r}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{r}\bbl@allowhyphens}
+\declare@shorthand{galician}{"R}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{R}\bbl@allowhyphens}
+\declare@shorthand{galician}{""}{\hskip\z@skip}
+\declare@shorthand{galician}{"/}
+ {\setbox\z@\hbox{/}%
+ \dimen@\ht\z@
+ \advance\dimen@-1ex
+ \advance\dimen@\dp\z@
+ \dimen@.31\dimen@
+ \advance\dimen@-\dp\z@
+ \ifdim\dimen@>0pt
+ \kern.01em\lower\dimen@\box\z@\kern.03em
+ \else
+ \box\z@
+ \fi}
+\declare@shorthand{galician}{"?}
+ {\setbox\z@\hbox{?`}%
+ \leavevmode\raise\dp\z@\box\z@}
+\declare@shorthand{galician}{"!}
+ {\setbox\z@\hbox{!`}%
+ \leavevmode\raise\dp\z@\box\z@}
+
+\gl@set@shorthand{~}
+\declare@shorthand{galician}{~n}{\~n}
+\declare@shorthand{galician}{~N}{\~N}
+\declare@shorthand{galician}{~-}{%
+ \leavevmode
+ \bgroup
+ \let\@sptoken\gl@dashes % This assignation changes the
+ \@ifnextchar-% \@ifnextchar behaviour
+ {\gl@dashes}%
+ {\hbox{\char\hyphenchar\font}\egroup}}
+\def\gl@dashes-{%
+ \@ifnextchar-%
+ {\bbl@allowhyphens\hbox{---}\bbl@allowhyphens\egroup\@gobble}%
+ {\bbl@allowhyphens\hbox{--}\bbl@allowhyphens\egroup}}
+
+\def\deactivatetilden{%
+ \expandafter\let\csname galician@sh@\string~@n@\endcsname\relax
+ \expandafter\let\csname galician@sh@\string~@N@\endcsname\relax}
+% \end{macrocode}
+%
+% The shorthands for |quoting|.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname XML@catcodes\endcsname\relax
+ \addto\gl@select{%
+ \catcode`\<\active\catcode`\>=\active
+ \gl@quoting}
+
+ \gl@set@shorthand{<}
+ \gl@set@shorthand{>}
+
+ \declare@shorthand{system}{<}{\csname normal@char\string<\endcsname}
+ \declare@shorthand{system}{>}{\csname normal@char\string>\endcsname}
+
+ \addto\shorthandsgalician{%
+ \gl@activate{<}%
+ \gl@activate{>}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \ifes@LaTeXe %<<<<<<
+ \AtBeginDocument{%
+ \gl@quoting
+ \if@filesw
+ \immediate\write\@mainaux{\string\gl@quoting}%
+ \fi}%
+ \fi %<<<<<<
+
+ \def\activatequoting{%
+ \catcode`>=\active \catcode`<=\active
+ \let\gl@quoting\activatequoting}
+ \def\deactivatequoting{%
+ \catcode`>=12 \catcode`<=12
+ \let\gl@quoting\deactivatequoting}
+
+ \declare@shorthand{galician}{<<}{\guillemotleft{}}
+ \declare@shorthand{galician}{>>}{\guillemotright{}}
+\fi
+
+\let\gl@quoting\relax
+\let\deactivatequoting\relax
+\let\activatequoting\relax
+% \end{macrocode}
+%
+% The acute accents are stored in a macro. If |activeacute| was set
+% as an option it's executed. If not is not deleted for a possible
+% later use in the |cfg| file. In non \LaTeXe{} formats is always
+% executed.
+%
+% \begin{macrocode}
+\def\gl@activeacute{%
+ \gl@set@shorthand{'}%
+ \addto\shorthandsgalician{\gl@activate{'}}%
+ \addto\gl@reviveshorthands{\gl@restore{'}}%
+ \addto\gl@select{\catcode`'=\active}%
+ \declare@shorthand{galician}{'a}{\@tabacckludge'a}%
+ \declare@shorthand{galician}{'A}{\@tabacckludge'A}%
+ \declare@shorthand{galician}{'e}{\@tabacckludge'e}%
+ \declare@shorthand{galician}{'E}{\@tabacckludge'E}%
+ \declare@shorthand{galician}{'i}{\@tabacckludge'i}%
+ \declare@shorthand{galician}{'I}{\@tabacckludge'I}%
+ \declare@shorthand{galician}{'o}{\@tabacckludge'o}%
+ \declare@shorthand{galician}{'O}{\@tabacckludge'O}%
+ \declare@shorthand{galician}{'u}{\@tabacckludge'u}%
+ \declare@shorthand{galician}{'U}{\@tabacckludge'U}%
+ \declare@shorthand{galician}{'n}{\~n}%
+ \declare@shorthand{galician}{'N}{\~N}%
+ \declare@shorthand{galician}{''}{\textquotedblright}%
+ \let\gl@activeacute\relax}
+
+\ifes@LaTeXe %<<<<<<
+ \@ifpackagewith{babel}{activeacute}{\gl@activeacute}{}
+\else %<<<<<<
+ \gl@activeacute
+\fi %<<<<<<%
+% \end{macrocode}
+%
+% And the customization. By default these macros only
+% store the values and do nothing.
+%
+% \begin{macrocode}
+\def\gl@enumerate#1#2#3#4{%
+ \def\gl@enum{{#1}{#2}{#3}{#4}}}
+
+\def\gl@itemize#1#2#3#4{%
+ \def\gl@item{{#1}{#2}{#3}{#4}}}
+% \end{macrocode}
+%
+% The part formerly in the |.lld| file comes here. It performs
+% layout adaptation of \LaTeX{} to ``orthodox'' Galician rules.
+% \begin{macrocode}
+\ifes@LaTeXe %<<<<<<
+
+\gl@enumerate{1.}{a)}{1)}{a$'$}
+\def\galiciandashitems{\gl@itemize{---}{---}{---}{---}}
+\def\galiciansymbitems{%
+ \gl@itemize
+ {\leavevmode\hbox to 1.2ex
+ {\hss\vrule height .9ex width .7ex depth -.2ex\hss}}%
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}}
+\def\galiciansignitems{%
+ \gl@itemize
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}%
+ {$\m@th\triangleright$}}
+\galiciansymbitems
+
+\def\gl@enumdef#1#2#3\@@{%
+ \if#21%
+ \@namedef{theenum#1}{\arabic{enum#1}}%
+ \else\if#2a%
+ \@namedef{theenum#1}{\emph{\alph{enum#1}}}%
+ \else\if#2A%
+ \@namedef{theenum#1}{\Alph{enum#1}}%
+ \else\if#2i%
+ \@namedef{theenum#1}{\roman{enum#1}}%
+ \else\if#2I%
+ \@namedef{theenum#1}{\Roman{enum#1}}%
+ \else\if#2o%
+ \@namedef{theenum#1}{\arabic{enum#1}\protect\gl@sptext{o}}%
+ \fi\fi\fi\fi\fi\fi
+ \toks@\expandafter{\csname theenum#1\endcsname}
+ \expandafter\edef\csname labelenum#1\endcsname
+ {\noexpand\gl@listquot\the\toks@#3}}
+
+\addto\layoutgalician{%
+ \def\gl@enumerate##1##2##3##4{%
+ \gl@enumdef{i}##1\@empty\@empty\@@
+ \gl@enumdef{ii}##2\@empty\@empty\@@
+ \gl@enumdef{iii}##3\@empty\@empty\@@
+ \gl@enumdef{iv}##4\@empty\@empty\@@}%
+ \def\gl@itemize##1##2##3##4{%
+ \def\labelitemi{\gl@listquot##1}%
+ \def\labelitemii{\gl@listquot##2}%
+ \def\labelitemiii{\gl@listquot##3}%
+ \def\labelitemiv{\gl@listquot##4}}%
+ \def\p@enumii{\theenumi}%
+ \def\p@enumiii{\theenumi\theenumii}%
+ \def\p@enumiv{\p@enumiii\theenumiii}%
+ \expandafter\gl@enumerate\gl@enum
+ \expandafter\gl@itemize\gl@item
+ \DeclareTextCommand{\guillemotleft}{OT1}{%
+ \ifmmode\ll
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char40 \kern-0.19em\char40 }}%
+ \fi}%
+ \DeclareTextCommand{\guillemotright}{OT1}{%
+ \ifmmode\gg
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char41 \kern-0.19em\char41 }}%
+ \fi}%
+ \def\@fnsymbol##1%
+ {\ifcase##1\or*\or**\or***\or****\or
+ *****\or******\else\@ctrerr\fi}%
+ \def\@alph##1%
+ {\ifcase##1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or
+ l\or m\or n\or \~n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ x\or z\else\@ctrerr\fi}%
+ \def\@Alph##1%
+ {\ifcase##1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or
+ L\or M\or N\or \~N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ X\or Z\else\@ctrerr\fi}%
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue
+ \def\@seccntformat##1{\csname the##1\endcsname.\quad}%
+ \def\numberline##1{\hb@xt@\@tempdima{##1\if&##1&\else.\fi\hfil}}%
+ \def\@roman##1{\protect\gl@roman{\number##1}}%
+ \def\gl@roman##1{\protect\gl@msc{\romannumeral##1}}%
+ \def\glromanindex##1##2{##1{\protect\gl@msc{##2}}}}
+% \end{macrocode}
+%
+% We need to execute the following code when babel has been
+% run, in order to see if |galician| is the main language.
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \let\gl@activeacute\@undefined
+ \def\bbl@tempa{galician}%
+ \ifx\bbl@main@language\bbl@tempa
+ \AtBeginDocument{\layoutgalician}%
+ \addto\gl@select{%
+ \@ifstar{\let\layoutgalician\relax}%
+ {\layoutgalician\let\layoutgalician\relax}}%
+ \fi
+ \selectgalician}
+
+\fi %<<<<<<
+% \end{macrocode}
+%
+% After restoring the catcode of |~| and setting the minimal
+% values for hyphenation, the |.ldf| is finished.
+%
+% \begin{macrocode}
+\gl@savedcatcodes
+
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+
+\ifes@LaTeXe %<<<<<<
+ \ldf@finish{galician}
+\else %<<<<<<
+ \gl@select
+ \ldf@finish{galician}
+ \csname activatequoting\endcsname
+\fi %<<<<<<
+
+%</code>
+% \end{macrocode}
+% That's all in the main file. Now the file with
+% \textsf{custom-bib} macros.
+%
+% \begin{macrocode}
+%<*bblbst>
+\def\bbland{e}
+\def\bbleditors{directores} \def\bbleds{dirs.\@}
+\def\bbleditor{director} \def\bbled{dir.\@}
+\def\bbledby{dirixido por}
+\def\bbledition{edici\'on} \def\bbledn{ed.\@}
+\def\bbletal{e outros}
+\def\bblvolume{volumen} \def\bblvol{vol.\@}
+\def\bblof{de}
+\def\bblnumber{n\'umero} \def\bblno{n\sptext{o}}
+\def\bblin{en}
+\def\bblpages{p\'axinas} \def\bblpp{p\'axs.\@}
+\def\bblpage{p\'axina} \def\bblp{p\'ax.\@}
+\def\bblchapter{cap\'itulo} \def\bblchap{cap.\@}
+\def\bbltechreport{informe t\'ecnico}
+\def\bbltechrep{inf.\@ t\'ec.\@}
+\def\bblmthesis{proxecto de fin de carreira}
+\def\bblphdthesis{tesis doutoral}
+\def\bblfirst {primeira} \def\bblfirsto {1\sptext{a}}
+\def\bblsecond{segunda} \def\bblsecondo{2\sptext{a}}
+\def\bblthird {terceira} \def\bblthirdo {3\sptext{a}}
+\def\bblfourth{cuarta} \def\bblfourtho{4\sptext{a}}
+\def\bblfifth {quinta} \def\bblfiftho {5\sptext{a}}
+\def\bblth{\sptext{a}}
+\let\bblst\bblth \let\bblnd\bblth \let\bblrd\bblth
+\def\bbljan{xaneiro} \def\bblfeb{febreiro} \def\bblmar{marzo}
+\def\bblapr{abril} \def\bblmay{maio} \def\bbljun{xu\~no}
+\def\bbljul{xullo} \def\bblaug{agosto} \def\bblsep{setembro}
+\def\bbloct{outubro}\def\bblnov{novembro}\def\bbldec{decembro}
+%</bblbst>
+% \end{macrocode}
+%
+% The |galician| option writes a macro in the page field of
+% \textit{MakeIndex} in entries with medium caps number, and they
+% are rejected. This program is a preprocessor which moves this
+% macro to the entry field.
+%
+% \begin{macrocode}
+%<*indexgl>
+\makeatletter
+
+\newcount\gl@converted
+\newcount\gl@processed
+
+\def\gl@encap{`\|}
+\def\gl@openrange{`\(}
+\def\gl@closerange{`\)}
+
+\def\gl@split@file#1.#2\@@{#1}
+\def\gl@split@ext#1.#2\@@{#2}
+
+\typein[\answer]{^^JArchivo que convertir^^J%
+ (extension por omision .idx):}
+
+\@expandtwoargs\in@{.}{\answer}
+\ifin@
+ \edef\gl@input@file{\expandafter\gl@split@file\answer\@@}
+ \edef\gl@input@ext{\expandafter\gl@split@ext\answer\@@}
+\else
+ \edef\gl@input@file{\answer}
+ \def\gl@input@ext{idx}
+\fi
+
+\typein[\answer]{^^JArquivo de destino^^J%
+ (arquivo por omision: \gl@input@file.eix,^^J%
+ extension por omision .eix):}
+\ifx\answer\@empty
+ \edef\gl@output{\gl@input@file.eix}
+\else
+ \@expandtwoargs\in@{.}{\answer}
+ \ifin@
+ \edef\gl@output{\answer}
+ \else
+ \edef\gl@output{\answer.eix}
+ \fi
+\fi
+
+\typein[\answer]{%
+ ^^J?Usouse algun esquema especial de controles^^J%
+ de MakeIndex para encap, open_range ou close_range?^^J%
+ [s/n] (n por omision)}
+
+\if s\answer
+ \typein[\answer]{^^JCaracter para 'encap'^^J%
+ (\string| por omision)}
+ \ifx\answer\@empty\else
+ \edef\gl@encap{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'open_range'^^J%
+ (\string( por omision)}
+ \ifx\answer\@empty\else
+ \edef\gl@openrange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'close_range'^^J%
+ (\string) por omision)}
+ \ifx\answer\@empty\else
+ \edef\gl@closerange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+\fi
+
+\newwrite\gl@indexfile
+\immediate\openout\gl@indexfile=\gl@output
+
+\newif\ifgl@encapsulated
+
+\def\gl@roman#1{\romannumeral#1 }
+\edef\gl@slash{\expandafter\@gobble\string\\}
+
+\def\indexentry{%
+ \begingroup
+ \@sanitize
+ \gl@indexentry}
+
+\begingroup
+
+\catcode`\|=12 \lccode`\|=\gl@encap\relax
+\catcode`\(=12 \lccode`\(=\gl@openrange\relax
+\catcode`\)=12 \lccode`\)=\gl@closerange\relax
+
+\lowercase{
+\gdef\gl@indexentry#1{%
+ \endgroup
+ \advance\gl@processed\@ne
+ \gl@encapsulatedfalse
+ \gl@bar@idx#1|\@@
+ \gl@idxentry}%
+}
+
+\lowercase{
+\gdef\gl@idxentry#1{%
+ \in@{\gl@roman}{#1}%
+ \ifin@
+ \advance\gl@converted\@ne
+ \immediate\write\gl@indexfile{%
+ \string\indexentry{\gl@b|\ifgl@encapsulated\gl@p\fi glromanindex%
+ {\ifx\gl@a\@empty\else\gl@slash\gl@a\fi}}{#1}}%
+ \else
+ \immediate\write\gl@indexfile{%
+ \string\indexentry{\gl@b\ifgl@encapsulated|\gl@p\gl@a\fi}{#1}}%
+ \fi}
+}
+
+\lowercase{
+\gdef\gl@bar@idx#1|#2\@@{%
+ \def\gl@b{#1}\def\gl@a{#2}%
+ \ifx\gl@a\@empty\else\gl@encapsulatedtrue\gl@bar@eat#2\fi}
+}
+
+\lowercase{
+\gdef\gl@bar@eat#1#2|{\def\gl@p{#1}\def\gl@a{#2}%
+ \edef\gl@t{(}\ifx\gl@t\gl@p
+ \else\edef\gl@t{)}\ifx\gl@t\gl@p
+ \else
+ \edef\gl@a{\gl@p\gl@a}\let\gl@p\@empty%
+ \fi\fi}
+}
+
+\endgroup
+
+\input \gl@input@file.\gl@input@ext
+
+\immediate\closeout\gl@indexfile
+
+\typeout{*****************}
+\typeout{procesouse: \gl@input@file.\gl@input@ext }
+\typeout{Li'nas lidas: \the\gl@processed}
+\typeout{Li'nas convertidas: \the\gl@converted}
+\typeout{Resultado en: \gl@output}
+\ifnum\gl@converted>\z@
+ \typeout{Xenere o 'indice a partir deste arquivo}
+\else
+ \typeout{Non se realizou ning'un tipo de conversi'on}
+ \typeout{P'odese xenerar o arquivo directamente^^J%
+ de \gl@input@file.\gl@input@ext}
+\fi
+\typeout{*****************}
+\@@end
+%</indexgl>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/galician/galician.ins b/macros/latex/contrib/babel-contrib/galician/galician.ins
new file mode 100644
index 0000000000..215b447ea0
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/galician/galician.ins
@@ -0,0 +1,151 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{galician.ins}
+\def\filedate{2007/01/29}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.3c or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\keepsilent
+
+\usepreamble\mainpreamble
+\generate{\file{galician.ldf}{\from{galician.dtx}{code}}%
+ \file{glbst.tex}{\from{galician.dtx}{bblbst}}%
+ \file{glromidx.tex}{\from{galician.dtx}{indexgl}}}
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/galician/galician.pdf b/macros/latex/contrib/babel-contrib/galician/galician.pdf
new file mode 100644
index 0000000000..a00971a0a7
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/galician/galician.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/georgian/README b/macros/latex/contrib/babel-contrib/georgian/README
new file mode 100644
index 0000000000..c59bc7b55e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/georgian/README
@@ -0,0 +1,2 @@
+Georgian language support for babel.
+works with classic TeX/LaTex as well as for XELatex/LuaLatex (8bit and unicode modes) \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/georgian/georgian.ldf b/macros/latex/contrib/babel-contrib/georgian/georgian.ldf
new file mode 100644
index 0000000000..4469b3e6e7
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/georgian/georgian.ldf
@@ -0,0 +1,231 @@
+% Copyright 2017 Levan Shoshiashvili shoshia@hotmail.com and Werner Lemberg <wl@gnu.org>.
+% This file is part of georgiantex package. License: LPPL, version 1.3 or newer,
+% according to http://www.latex-project.org/lppl.txt
+%
+%
+% georgian.ldf
+%
+%
+% Changes
+%
+% 2.2 20/11/2017
+% Changed EU1,EU2 to TU encoding for utf-8 engines
+%
+%
+% 2.1 17 Apr. 2014
+% Bugs fixed.
+%
+%
+% 2.0 2013/06/06
+% Added unicode support similar to russianb.ldf
+%
+% 1.0 2012/09/21
+% First version.
+%
+%
+\ProvidesLanguage{georgian}
+ [2017/11/20 2.2 Georgian support from the babel system]
+\LdfInit{georgian}{captionsgeorgian}
+\ifdefined\if@kauni@ode
+ \PackageError{babel}{if@kauni@ode already defined.\MessageBreak
+ Please contact author of georgian.ldf}
+ \relax
+\fi
+\newif\if@kauni@ode
+\ifdefined\luatexversion \@kauni@odetrue \else
+\ifdefined\XeTeXrevision \@kauni@odetrue \fi\fi
+\ifx\l@georgian\@undefined
+ \@nopatterns{Georgian}
+ \adddialect\l@georgian0
+\fi
+\def\@setgeorgianencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\georgiancoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{T8K}%
+ \sce@a{##1}{T8M}%
+ \if@kauni@ode
+ \sce@a{##1}{TU}%EU1
+ \sce@a{##1}{TU}%EU2
+ \fi}%
+ \cdp@list
+}
+\@setgeorgianencoding
+\@onlypreamble\@setgeorgianencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+\ifdefined\georgianencoding
+\else
+ \if@kauni@ode
+ \ifdefined\XeTeXrevision
+ \edef\georgianencoding{TU}
+ \else\ifdefined\luatexversion
+ \edef\georgianencoding{TU}
+ \fi\fi
+ \else
+ \edef\georgianencoding{T8M}
+ \fi
+ \PackageWarning{babel}%
+ {No Georgian font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\georgianencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\georgianencoding enc.def\relax}%
+ \AtBeginDocument{\@setgeorgianencoding}
+\fi
+\DeclareRobustCommand{\Georgian}{\selectlanguage{\georgian}}
+\DeclareRobustCommand{\georgiantext}{%
+ \fontencoding\georgianencoding\selectfont
+ \let\encodingdefault\georgianencoding
+ \expandafter\set@hyphenmins\georgianhyphenmins
+ \language\l@georgian}%
+\let\geo\georgiantext
+\expandafter\ifx\csname T@8M\endcsname\relax\else
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+\fi
+\DeclareTextFontCommand{\textgeorgian}{\georgiantext}
+\@ifpackageloaded{inputenc}{%
+ \if@kauni@ode
+ \PackageWarning{babel}{inputenc should not be used with LuaTeX or XeTeX}
+ \fi
+}{%
+ \ifx\reserved@a\georgianencoding\else
+ \def\reserved@a{TU}%
+ \ifx\reserved@a\georgianencoding\else
+ \def\reserved@a{TU}%
+ \ifx\reserved@a\georgianencoding\else
+ \PackageWarning{babel}%
+ {No input encoding specified for Georgian language}
+ \fi\fi\fi
+ %\fi
+}
+\initiate@active@char{"}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+\declare@shorthand{georgian}{"`}{\quotedblbase}
+\declare@shorthand{georgian}{"'}{\textquotedblleft}
+\declare@shorthand{georgian}{"<}{\guillemotleft}
+\declare@shorthand{georgian}{">}{\guillemotright}
+\declare@shorthand{georgian}{""}{\hskip\z@skip}
+\declare@shorthand{georgian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{georgian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{georgian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+\declare@shorthand{georgian}{"-}{%
+ \def\georgian@sh@tmp{%
+ \if\georgian@sh@next-\expandafter\georgian@sh@emdash
+ \else\expandafter\russian@sh@hyphen\fi}%
+ \futurelet\georgian@sh@next\georgian@sh@tmp}
+\def\georgian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+\def\georgian@sh@emdash#1#2{\cdash-#1#2}
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \geodash\hskip.2em\ignorespaces}%
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\geodash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+\def\@Ccdash{\leavevmode
+ \nobreak\geodash\nobreak\hskip.35em\ignorespaces}%
+\ifx\geodash\undefined
+ \def\geodash{\hbox to.8em{--\hss--}}
+ \PackageInfo{babel}{\string\geodash\space is defined}
+\fi
+\declare@shorthand{georgian}{",}{\nobreak\hskip.2em\ignorespaces}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{georgian}{\tw@\tw@}
+\addto\extrasgeorgian{\georgiantext}
+\addto\noextrasgeorgian{\latintext}
+\addto\extrasgeorgian{\languageshorthands{georgian}}
+\addto\extrasgeorgian{\bbl@activate{"}}
+\addto\noextrasgeorgian{\bbl@deactivate{"}}
+\addto\extrasgeorgian{\bbl@frenchspacing}
+\addto\noextrasgeorgian{\bbl@nonfrenchspacing}
+\def\Anbani#1{\expandafter\georgian@Alph\csname c@#1\endcsname}
+\if@kauni@ode
+ \def\georgian@Alph#1{\ifcase#1\or
+ Ⴀ\or Ⴁ\or Ⴂ\or Ⴈ\or Ⴃ\or Ⴄ\or Ⴅ\or
+ Ⴆ\or Ⴇ\or Ⴉ\or Ⴊ\or Ⴋ\or Ⴌ\or Ⴍ\or
+ Ⴎ\or Ⴏ\or Ⴐ\or Ⴑ\or Ⴒ\or Ⴓ\or Ⴔ\or Ⴕ\or
+ Ⴖ\or Ⴗ\or Ⴘ\or Ⴙ\or Ⴚ\or Ⴛ\or Ⴜ\or
+ Ⴝ\or Ⴞ\or Ⴟ\or Ⴠ\or Ⴡ\or Ⴢ\or Ⴣ\or Ⴤ\or Ⴥ\else\@ctrerr\fi}
+\else
+ \def\georgian@Alph#1{\ifcase#1\or
+ \GEOA\or\GEOB\or\GEOG\or\GEOD\or\GEOE\or\GEOV\or\GEOZ\or
+ \GEOTH\or\GEOI\or\GEOK\or\GEOL\or\GEOM\or\GEON\or\GEOO\or
+ \GEOP\or\GEOZH\or\GEOR\or\GEOS\or\GEOT\or\GEOU\or\GEOPH\or
+ \GEOQ\or\GEOGH\or\GEOY\or\GEOSH\or\GEOCH\or\GEOC\or\GEODZ\or
+ \GEOTS\or\GEOTCH\or\GEOKH\or\GEOSJ\or\GEOH\or\GEOHE\or\GEOIOT\or
+ \GEOWE\or\GEOHAR\or\GEOHOE\else\@ctrerr\fi}
+\fi
+\def\anbani#1{\expandafter\georgian@alph\csname c@#1\endcsname}
+\if@kauni@ode
+ \def\georgian@alph#1{\ifcase#1\or
+ ა\or ბ\or გ\or г\or დ\or ე\or ვ\or
+ ზ\or თ\or ი\or კ\or ლ\or მ\or ნ\or
+ ო\or პ\or ჟ\or რ\or ს\or ტ\or უ\or ფ\or ქ\or ღ\or
+ ყ\or შ\or ჩ\or ც\or ძ\or წ\or ჭ\or
+ ხ\or ჯ\or ჰ\or ჱ\or ჲ\or ჳ\or ჴ\or
+ ჵ\or ჶ\or ჷ\or ჸ\or ჲ\or ჹ\or ჺ\else\@ctrerr\fi}
+\else
+ \def\georgian@alph#1{\ifcase#1\or
+ \geoa\or\geob\or\geog\or\geod\or\geoe\or\geov\or\geoz\or
+ \geoth\or\geoi\or\geok\or\geol\or\geom\or\geon\or\geoo\or
+ \geop\or\geozh\or\geor\or\geos\or\geot\or\geou\or\geoph\or
+ \geoq\or\geogh\or\geoy\or\geosh\or\geoch\or\geoc\or\geodz\or
+ \geots\or\geotch\or\geokh\or\geosj\or\geoh\or\geohe\or\geoiot\or
+ \geowe\or\geohar\or\geohoe\or\geofi\else\@ctrerr\fi}
+\fi
+\@ifundefined{sym\georgianencoding letters}{}{%
+\SetSymbolFont{\georgianencoding letters}{bold}\georgianencoding
+ \rmdefault\bfdefault\updefault
+\DeclareSymbolFontAlphabet\geomathrm{\georgianencoding letters}
+\DeclareMathAlphabet\geomathbf\georgianencoding
+ \rmdefault\bfdefault\updefault
+\DeclareMathAlphabet\geomathsf\georgianencoding
+ \sfdefault\mddefault\updefault
+\DeclareMathAlphabet\geomathit\georgianencoding
+ \rmdefault\mddefault\itdefault
+\DeclareMathAlphabet\geomathtt\georgianencoding
+ \ttdefault\mddefault\updefault
+\SetMathAlphabet\geomathsf{bold}\georgianencoding
+ \sfdefault\bfdefault\updefault
+\SetMathAlphabet\geomathit{bold}\georgianencoding
+ \rmdefault\bfdefault\itdefault
+}
+\input{georgiancaps.tex}
+\ldf@finish{georgian}
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+%%
+%% End of file `russianb.ldf'.
diff --git a/macros/latex/contrib/babel-contrib/georgian/georgian.sty b/macros/latex/contrib/babel-contrib/georgian/georgian.sty
new file mode 100644
index 0000000000..56f2281dbe
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/georgian/georgian.sty
@@ -0,0 +1,57 @@
+%% Georgian style file
+%% Copyright (C) 2017 by Levan Shoshiashvili,
+%% Please report errors to:
+%% l. shoshiashvili shoshia at hotmail.com
+\ifx\LdfInit\undefined
+ \def\LdfInit{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \LdfInit}
+\fi
+\ifx\PackageError\undefined
+ \def\ProvidesLanguage#1[#2 #3 #4]{%
+ \wlog{Language: #1 #4 #3 <#2>}}%
+\else
+ \def\bblstyerror{%
+ \PackageError{babel}%
+ {You have used an old interface to call babel\MessageBreak
+ You may expect compatibility problems wit other packages}%
+ {You could proceed but don't complain if you run into errors}%
+ \let\bblstyerror\@undefined
+ }
+ \ifx\ProvidesLanguage\undefined
+ \bblstyerror
+ \def\ProvidesLanguage{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \ProvidesLanguage}
+ \else
+ \bblstyerror
+ \fi
+\fi
+\def\CurrentOption{georgian}
+\input georgian.ldf\relax
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+
+\endinput
+%%
+%% End of file `georgian.sty'.
diff --git a/macros/latex/contrib/babel-contrib/georgian/georgiancaps.tex b/macros/latex/contrib/babel-contrib/georgian/georgiancaps.tex
new file mode 100644
index 0000000000..a6c9f9768c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/georgian/georgiancaps.tex
@@ -0,0 +1,168 @@
+%% Georgian captions file
+%% Copyright (C) 2017 by Levan Shoshiashvili,
+%% Please report errors to:
+%% l. shoshiashvili shoshia at hotmail.com
+\ifx\ProvidesFile\undefined \else
+ \ProvidesFile{georgiancaps.tex}[2013/06/06 v2.0 Captions in Georgian]
+\fi
+
+\ifx\providecommand\undefined
+\let\providecommand=\def
+\fi
+\if@kauni@ode
+ \addto\captionsgeorgian{%
+ \def\prefacename{წინასიტყვაობა}%
+ \def\refname{ლიტერატურა}%
+ \def\abstractname{ანოტაცია}%
+ \def\bibname{ლიტერატურა}%
+ \def\chaptername{თავი}%
+ \def\appendixname{დანართი}%
+ \@ifundefined{thechapter}
+ {\def\contentsname{შინაარსი}}%
+ {\def\contentsname{შინაარსი}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{სურათი}%
+ \def\listtablename{ცხრილი}%
+ \def\indexname{საძიებელი}%
+ \def\authorname{სახელთა საძიებელი}%
+ \def\figurename{სურ.}%
+ \def\tablename{ცხრ.}%
+ \def\partname{ნაწილი}%
+ \def\enclname{ჩათვ.}%
+ \def\ccname{წყარ.}%
+ \def\headtoname{შ.}%
+ \def\pagename{გვ.}%
+ \def\seename{იხ.}%
+ \def\alsoname{იხ.\ ასევე}%
+ \def\proofname{დამტკიცება}%
+ \def\glossaryname{ტერმინები}%
+ }%
+\else
+\addto\captionsgeorgian{
+ \def\prefacename{\geosh\geoe\geos\geoa\geov\geoa\geol\geoi}%
+ \def\refname{\geol\geoi\geot\geoe\geor\geoa\geot\geou\geor\geoa}
+ \def\abstractname{\geosh\geoe\geos\geoa\geov\geoa\geol\geoi}
+ \def\bibname{\geob\geoi\geob\geol\geoi\geoo\geog\geor\geoa\geof\geoi\geoa}%
+ \def\chaptername{\geoth\geoa\geov\geoi}
+ \def\appendixname{\geod\geoa\geon\geoa\geor\geoth\geoi}
+ \def\contentsname{\geos\geoa\geor\geoch\geoe\geov\geoi}
+ \def\listfigurename{\geos\geou\geor}
+ \def\listtablename{\geoc\geokh\geor\geoi\geol\geoi}
+ \def\indexname{\geos\geoa\geodz\geoi\geoe\geob\geoe\geol\geoi}
+ \def\figurename{\geos\geou\geor}
+ \def\tablename{\geoc\geokh\geor\geoi\geol\geoi}%
+ \def\partname{\geon\geoa\geots\geoi\geol\geoi}
+ \def\pagename{\geog\geov\geoe\geor\geod\geoi}
+ \def\headpagename{\geoth\geoa\geov\geoi}%
+ \def\seename{\geoi\geokh}
+ \def\alsoname{\geoa\geos\geoe\geov\geoe}%
+ \def\enclname{\geod\geoa\geon\geoa\geor\geoth\geoi}
+ \def\ccname{\geoc\geoc\geon\geoe\geoi\geom}
+ \def\headtoname{\geos\geoa\geoth\geoa\geou\geor\geoi}
+ \def\proofname{\geod\geoa\geom\geot\geok\geoi\geoc\geoe\geob\geoa}
+}
+\fi
+%%%%%%%%%%%%%%%%
+\providecommand\captionsgeorgiancapital{%
+ \def\prefacenamecap{\GEOSH\GEOE\GEOS\GEOA\GEOV\GEOA\GEOL\GEOI}%
+ \def\refnamecap{\GEOL\GEOI\GEOT\GEOE\GEOR\GEOA\GEOT\GEOU\GEOR\GEOA}%
+ \def\abstractnamecap{\GEOSH\GEOE\GEOS\GEOA\GEOV\GEOA\GEOL\GEOI}%
+ \def\bibnamecap{\GEOB\GEOI\GEOB\GEOL\GEOI\GEOO\GEOG\GEOR\GEOA\GEOF\GEOI\GEOA}%
+ \def\chapternamecap{\GEOTH\GEOA\GEOV\GEOI}%
+ \def\appendixnamecap{\GEOD\GEOA\GEON\GEOA\GEOR\GEOTH\GEOI}%
+ \def\contentsnamecap{\GEOS\GEOA\GEOR\GEOCH\GEOE\GEOV\GEOI}%
+ \def\listfigurenamecap{\GEOS\GEOU\GEOR\GEOA\GEOTH\GEOI}%
+ \def\listtablenamecap{\GEOC\GEOKH\GEOR\GEOI\GEOL\GEOI}%
+ \def\indexnamecap{\GEOS\GEOA\GEODZ\GEOI\GEOE\GEOB\GEOE\GEOL\GEOI}%
+ \def\figurenamecap{\GEOS\GEOU\GEOR.}%
+ \def\tablenamecap{\GEOC\GEOKH\GEOR\GEOI\GEOL\GEOI}%
+ \def\partnamecap{\GEON\GEOA\GEOTS\GEOI\GEOL\GEOI}%
+ \def\pagenamecap{\GEOG\GEOV\GEOE\GEOR\GEOD\GEOI}%
+ \def\headpagenamecap{\GEOTH\GEOA\GEOV\GEOI}%
+ \def\enclnamecap{\GEOD\GEOA\GEON\GEOA\GEOR\GEOTH\GEOI}%
+ \def\ccnamecap{\GEOC\GEOC\GEON\GEOE\GEOI\GEOM}%
+ \def\headtonamecap{\GEOS\GEOA\GEOTH\GEOA\GEOU\GEOR\GEOI}%
+ \def\proofnamecap{\GEOD\GEOA\GEOM\GEOT\GEOK\GEOI\GEOC\GEOE\GEOB\GEOA}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\if@kauni@ode
+ \addto\dategeorgian{%
+ \def\today{\number\day~\ifcase\month\or
+ იანვარი\or
+ თებერვალი\or
+ მარტი\or
+ აპრილი\or
+ მაისი\or
+ ივნისი\or
+ ივლისი\or
+ აგვისტო\or
+ სექტემბერი\or
+ ოქტომბერი\or
+ ნოემბერი\or
+ დეკემბერი\fi
+ \space \number\year~წ.}}
+\else
+\def\dategeorgian{%
+ \def\today{\number\day~\ifcase\month\or
+ \geoi\geoa\geon\geov\or
+ \geoth\geoe\geob\or
+\geom\geoa\geor\or
+\geoa\geop\geor\or
+\geom\geoa\geoi\or
+\geoi\geov\geon\or
+\geoi\geov\geol\or
+\geoa\geog\geov\or
+\geos\geoe\geoq\or
+\geoo\geoq\geot\or
+\geon\geoo\geoe\or
+\geod\geoe\geok\fi .
+ \ \number\year~\geots.}}
+\fi
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\providecommand\captionsenglish{%
+ \def\prefacename{Preface}%
+ \def\refname{References}%
+ \def\abstractname{Abstract}%
+ \def\bibname{Bibliography}%
+ \def\chaptername{Chapter}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Contents}%
+ \def\listfigurename{List of Figures}%
+ \def\listtablename{List of Tables}%
+ \def\indexname{\geos\geoa\geodz\geoi\geoe\geob\geoe\geol\geoi}%
+ \def\figurename{Figure}%
+ \def\tablename{Table}%
+ \def\partname{Part}%
+ \def\enclname{encl}%
+ \def\ccname{cc}%
+ \def\headtoname{To}%
+ \def\pagename{Page}%
+ \def\headpagename{Page}%
+ \def\prefacename{Preface}%
+ \def\seename{see}%
+ \def\alsoname{see also}}
+
+\providecommand\dateenglish{%
+ \def\today{%
+ \ifcase\day\or 1st\or 2nd\or 3rd\or 4th\or 5th\or 6th\or 7th\or
+ 8th\or 9th\or 10th\or 11th\or 12th\or 13th\or 14th\or 15th\or
+ 16th\or 17th\or 18th\or 19th\or 20th\or 21st\or 22nd\or 23rd\or
+ 24th\or 25th\or 26th\or 27th\or 28th\or 29th\or 30th\or 31st\fi
+ ~\ifcase\month\or January\or February\or March\or April\or May\or
+ June\or July\or August\or September\or October\or November\or
+ December\fi \space
+ \number\year}}
+
+\providecommand\dateUSenglish{%
+ \def\today{%
+ \ifcase\month\or January\or February\or March\or April\or May\or
+ June\or July\or August\or September\or October\or November\or
+ December\fi \space\number\day, \number\year}}
+\providecommand\mrglovani{
+\fontencoding{T8M}\selectfont %
+}
+\providecommand\khucuri{
+\fontencoding{T8K}\selectfont}
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/german/README b/macros/latex/contrib/babel-contrib/german/README
new file mode 100644
index 0000000000..f9189ba339
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/README
@@ -0,0 +1,73 @@
+=========================================================================
+The babel-german bundle
+
+German language support for the babel multilingual package
+
+Copyright 1989--2018 Johannes L. Braams
+ Bernd Raichle
+ Walter Schmidt,
+ Jürgen Spitzmüller
+
+Current Maintainer: Jürgen Spitzmüller
+E-mail: juergen (at) spitzmueller (dot) org
+
+Released under the LaTeX Project Public License v1.3 or later
+See http://www.latex-project.org/lppl.txt
+=========================================================================
+
+== PURPOSE ==
+
+This bundle is an extension to the babel package for multilingual
+typesetting. It provides all necessary macros, definitions and settings
+to typeset German documents. The bundle includes support for the
+traditional and reformed German orthography as well as for the Austrian
+and Swiss varieties of German.
+
+
+== CONTENTS ==
+
+The bundle consists of the following files:
+
+* german.ins (installation file to unpack the language definition
+ files)
+* germanb.dtx (packed language definition files and
+ documentation for the traditional [1901--1996] orthography)
+* ngermanb.dtx (packed language definition files and
+ documentation for the reformed [1996 ff.] orthography)
+* germanb.pdf: unpacked documentation for germanb.ldf (support
+ for traditional orthography)
+* ngermanb.pdf: unpacked documentation for ngermanb.ldf (support
+ for new orthography)
+* README (this file)
+
+
+== INSTALLATION ==
+
+If the latest version of this package is not included in your LaTeX
+distribution, do the following:
+
+* issue "latex german.ins" to unpack the language definition files
+* copy the files (austrian.ldf, german.ldf, germanb.ldf, naustrian.ldf,
+ ngerman.ldf, ngermanb.ldf, nswissgerman.ldf and swissgerman.ldf)
+ to a location where TeX can find them
+ (default location: $TEXMF/tex/generic/babel-german/)
+
+To re-generate the manuals, issue
+* pdflatex <file>.dtx
+* makeindex -s gglo.ist -o <file>.gls <file>.glo
+* pdflatex <file>.dtx
+* pdflatex <file>.dtx
+Substitute <file> either by germanb or ngermanb.
+
+
+== DOCUMENTATION ==
+
+See the included manuals germanb.pdf (traditional orthography) and
+ngermanb.pdf (new orthography) for usage instructions.
+
+
+== CHANGES ==
+
+See the included manuals germanb.pdf (traditional orthography) and
+ngermanb.pdf (new orthography), section "Change History".
+
diff --git a/macros/latex/contrib/babel-contrib/german/german.ins b/macros/latex/contrib/babel-contrib/german/german.ins
new file mode 100644
index 0000000000..92f2142bdf
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/german.ins
@@ -0,0 +1,112 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989--2018
+%% Johannes L. Braams
+%% Bernd Raichle
+%% Walter Schmidt
+%% Juergen Spitzmueller
+%% All rights reserved.
+%%
+%% This file is part of the babel-german bundle,
+%% an extension to the Babel system.
+%% ----------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Juergen Spitzmueller.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2018/12/08}
+
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\preamble
+This is a generated file.
+
+Copyright 1989--2018
+ Johannes L. Braams
+ Bernd Raichle
+ Walter Schmidt
+ Juergen Spitzmueller
+All rights reserved.
+
+This file is part of the babel-german bundle,
+an extension to the Babel system.
+----------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Juergen Spitzmueller.
+
+Please report errors to: Juergen Spitzmueller
+ via: https://github.com/jspitz/babel-german
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel-german}
+
+\generate{\file{germanb.ldf}{\from{germanb.dtx}{germanb}}
+ \file{german.ldf}{\from{germanb.dtx}{german}}
+ \file{austrian.ldf}{\from{germanb.dtx}{austrian}}
+ \file{swissgerman.ldf}{\from{germanb.dtx}{swissgerman}}
+ \file{ngermanb.ldf}{\from{ngermanb.dtx}{ngermanb}}
+ \file{ngerman.ldf}{\from{ngermanb.dtx}{ngerman}}
+ \file{naustrian.ldf}{\from{ngermanb.dtx}{naustrian}}
+ \file{nswissgerman.ldf}{\from{ngermanb.dtx}{nswissgerman}}
+ }
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space austrian.ldf, german.ldf, germanb.ldf,}
+\Msg{* \space\space naustrian.ldf, ngerman.ldf, ngermanb.ldf,}
+\Msg{* \space\space nswissgerman.ldf and swissgerman.ldf}
+\Msg{*}
+\Msg{* To produce the documentation run the files }
+\Msg{* germanb.dtx and ngermanb.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endbatchfile
diff --git a/macros/latex/contrib/babel-contrib/german/germanb.dtx b/macros/latex/contrib/babel-contrib/german/germanb.dtx
new file mode 100644
index 0000000000..4e8a344b55
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/germanb.dtx
@@ -0,0 +1,1004 @@
+% \iffalse meta-comment
+%
+% File `germanb.dtx'
+%
+% Copyright 1989--2016
+% Johannes L. Braams
+% Bernd Raichle
+% Walter Schmidt
+% Juergen Spitzmueller
+% All rights reserved.
+%
+% This file is part of the babel-german bundle,
+% an extension to the Babel system.
+% ----------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Juergen Spitzmueller.
+% \fi
+% \CheckSum{508}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{germanb.dtx}
+%</dtx>
+%<austrian>\ProvidesLanguage{austrian}
+%<german>\ProvidesLanguage{german}
+%<swissgerman>\ProvidesLanguage{swissgerman}
+%<germanb>\ProvidesLanguage{germanb}
+%\fi
+%\ProvidesFile{germanb.dtx}
+ [2018/12/08 v2.11 German support for babel (pre-1996 orthography)]
+%\iffalse
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[osf]{libertine}
+\usepackage[scaled=0.76]{beramono}
+\usepackage{url}
+\usepackage{array}
+\usepackage{booktabs}
+\usepackage[tableposition=top,skip=5pt]{caption}
+\usepackage{marginnote}
+\usepackage[svgnames]{xcolor}
+\usepackage[pdfusetitle]{hyperref}
+\hypersetup{%
+ colorlinks,
+ linkcolor=black,
+ filecolor=Maroon,
+ urlcolor=Maroon,
+ citecolor=black
+}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\graph[1]{$\langle$#1$\rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\texttt{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\newfeature[1]{\marginnote{\footnotesize New feature\\in v.\,#1!}}
+\GlossaryMin = .33\textheight
+
+\begin{document}
+ \DocInput{germanb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{germanb.dtx}
+%
+%\RecordChanges
+%
+% \changes{Version 2.9a=Version 2.10}{2016/11/07}{Improvements to the manual}
+%
+% \changes{Version 2.7}{2013/12/13}{Revised documentation: Turn the \babel{}
+% manual chapter into a self-enclosed manual.}
+% \changes{Version 2.7}{2013/12/13}{Added support for variety \Lopt{swissgerman}.}
+% \changes{Version 2.7}{2013/12/13}{Revised \Lopt{austrian} support.}
+%
+% \changes{Version 2.6d}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{Version 2.6d}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \changes{Version 2.6a}{1995/02/15}{Moved the identification to the
+% top of the file}
+% \changes{Version 2.6a}{1995/02/15}{Rewrote the code that handles the
+% active double quote character}
+%
+% \changes{Version 2.5c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved the identification after the loading of
+% \file{babel.def}}
+%
+% \changes{Version 2.5}{1994/02/08}{Update or \LaTeXe}
+%
+% \changes{Version 2.3e}{1991/11/10}{Brought up-to-date with
+% \file{german.tex} v2.3e (plus some bug fixes) [br]}
+%
+% \changes{Version 2.2a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+%
+% \changes{Version 2.3}{1991/11/05}{Rewritten parts of the code to use
+% the new features of babel version 3.1}
+%
+% \changes{Version 2.2}{1991/06/11}{Removed global assignments,
+% brought uptodate with \file{german.tex} v2.3d}
+%
+% \changes{Version 2.1}{1991/05/29}{Removed bug found by van der Meer}
+%
+% \changes{Version 2.0a}{1991/05/25}{Removed some problems in change
+% log}
+%
+% \changes{Version 2.0}{1991/04/23}{Modified for babel 3.0}
+%
+% \changes{Version 1.1a}{1990/08/27}{Modified the documentation
+% somewhat}
+%
+% \changes{Version 1.1}{1990/07/30}{When using PostScript fonts with
+% the Adobe fontencoding, the dieresis-accent is located elsewhere,
+% modified germanb}
+%
+% \changes{Version 1.0c}{1990/07/16}{Fixed some typos}
+%
+% \changes{Version 1.0b}{1990/05/22}{fixed typo in definition for
+% austrian language found by Werenfried Spit
+% \texttt{nspit@fys.ruu.nl}}
+%
+% \changes{Version 1.0a}{1990/05/14}{Incorporated Nico's comments}
+%
+% \title{Babel support for the German language (pre-1996~orthography)}
+% \author{Johannes Braams \and Bernd Raichle \and Walter Schmidt \and J\"urgen Spitzm\"uller\thanks{%
+% Current maintainer. Please report issues via \protect\url{https://github.com/jspitz/babel-german}.}}
+% \date{\fileversion\ (\filedate)}
+% \maketitle
+%
+% \begin{abstract}
+% \noindent This manual documents \babel\ language support for German (pre-1996 orthography),
+% including support for the Austrian and Swiss varieties of German.
+% The manual is part of the \textsf{babel-german} bundle.
+% \end{abstract}
+%
+% \section{Aim and usage}
+%
+% The \babel\ `language definition file' \file{germanb.ldf} documented in this manual provides
+% the \babel\ package with all language specific strings, settings and commands needed for writing
+% German texts, including texts in the Austrian and Swiss varieties of German, in \emph{traditional
+% (1901--1996) spelling}.\footnote{%
+% The file \file{germanb.ldf} started as a re-implementation of the
+% package \file{german.sty} (v.\,2.5b), which was originally
+% developed by Hubert Partl (cf.\,\cite{HP}) and later maintained by Bernd Raichle
+% (cf.\,\cite{gerdoc}). Johannes Braams did the initial re-implementation.}
+% As for support for contemporary (`reformed', i.\,e., post-1996) German orthography, please refer to
+% the complementary \href{file:ngermanb.pdf}{manual for the \file{ngermanb.ldf} language definition file}.
+% The `language definition file' also assures that the correct hyphenation patterns for the respective
+% language or variety are used (see sec.~\ref{sec:patterns} for details).
+%
+% In order to use the language definitions provided here, you need to use
+% the \babel\ package and pass the respective language\slash variety name as an
+% option, either of
+%
+% \begin{itemize}
+% \setlength{\itemsep}{0pt}
+% \item |\usepackage[german]{babel}|
+% \item |\usepackage[austrian]{babel}|
+% \item |\usepackage[swissgerman]{babel}|
+% \item |\usepackage[swissgerman.toss]{babel}|\newfeature{2.10}\footnote{%
+% See sec.~\ref{sec:toss} on the \Lopt{toss} modifier.}
+% \end{itemize}
+% Using multiple varieties in parallel is possible;
+% consult the \babel\ manual \cite{babel} for details.
+%
+% \section{Shorthands}
+%
+% For all three varieties of German, the character |"| is made active
+% in order to provide some shorthand macros.
+% Some of these shorthands address a peculiarity of pre-1996 German
+% spelling: consonantial character combinations that change in the context
+% of hyphenations.
+% Other shorthands are provided for frequently used
+% special characters as well as for better control of hyphenation,
+% line breaks and ligatures.
+%
+% Table~\ref{tab:german-quote} provides an overview of the shorthands
+% that are provided by \textsf{babel-german} for \Lopt{german}, \Lopt{austrian}
+% and \Lopt{swissgerman}.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \small
+% \caption{Shorthands provided by \file{germanb.ldf}}\label{tab:german-quote}
+% \begin{tabular}{l>{\raggedright}p{.9\textwidth}}
+% \toprule
+% |"a| & Umlaut \graph{\"a} (shorthand for |\"a|). Similar shorthands are
+% available for all other lower- and uppercase
+% vowels (umlauts: |"a|, |"o|, |"u|, |"A|, |"O|,
+% |"U|; tremata: |"e|, |"i|, |"E|, |"I|). \tabularnewline
+% |"s| & German \graph{\ss} (shorthand for |\ss{}|);
+% but cf. sec.~\ref{sec:toss}. \tabularnewline
+% |"z| & German \graph{\ss} (shorthand for |\ss{}|).
+% The difference to |"s| is the uppercase version;
+% but cf. sec.~\ref{sec:toss}. \tabularnewline
+% |"ck| & \graph{ck}, hyphenated as \graph{k-k}. \tabularnewline
+% |"ff| & \graph{ff}, hyphenated as \graph{ff-f};
+% this is also implemented for \graph{l}, \graph{m},
+% \graph{n}, \graph{p}, \graph{r} and \graph{t}.
+% Please refer to sec.~\ref{sec:toss} for why this does not
+% include \graph{s}. \tabularnewline
+% |"S| & |\uppercase{"s}|, typeset as \graph{SS} (\graph{\ss}
+% must be written as \graph{SS} [or \graph{SZ}, see below]
+% in uppercase writing). \tabularnewline
+% |"Z| & |\uppercase{"z}|, typeset as \graph{SZ} (\graph{\ss}
+% must be written as \graph{SZ} [or \graph{SS}, see above]
+% in uppercase writing). \tabularnewline
+% \verb="|= & Disable ligature at this position (e.\,g., at morpheme
+% boundaries, as in \verb=Auf"|lage=). \tabularnewline
+% |"-| & An additional breakpoint that does still
+% allow for hyphenation at the breakpoints preset in
+% the hyphenation patterns (as opposed to |\-|). \tabularnewline
+% |"=| & An explicit hyphen with a breakpoint, allowing
+% for hyphenation at the other points preset in the
+% hyphenation patterns (as opposed to plain |-|);
+% useful for long compounds such as
+% |IT"=Dienstleisterinnen|. \tabularnewline
+% |"~| & An explicit hyphen without a breakpoint. Useful for
+% cases where the hyphen should stick at the following
+% syllable, e.\,g., |bergauf und "~ab| . \tabularnewline
+% |""| & A breakpoint that does not output a hyphen if the line
+% break is performed (consider parenthetical extensions
+% as in |(pseudo"~)""wissenschaftlich|). \tabularnewline
+% |"/| & \newfeature{2.9}A slash that allows for a linebreak.
+% As opposed to |\slash{}|, hyphenation at the breakpoints
+% preset in the hyphenation patterns is still allowed. \tabularnewline
+% |"`| & German left double quotes \graph{,,}. \tabularnewline
+% |"'| & German right double quotes \graph{``}. \tabularnewline
+% |"<| & French/Swiss left double quotes \graph{<<}. \tabularnewline
+% |">| & French/Swiss right double quotes \graph{>>}. \tabularnewline
+% \bottomrule
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \noindent Table~\ref{tab:more-quote} lists some \babel\ macros for quotation marks
+% that might be used as an alternative to the quotation mark shorthands listed above.
+% \begin{table}[!h]
+% \begin{center}
+% \small
+% \caption{Alternative commands for quotation marks (provided by \babel)}\label{tab:more-quote}
+% \begin{tabular}{lp{.88\textwidth}}
+% \toprule
+% |\glqq| & German left double quotes \graph{,,}. \tabularnewline
+% |\grqq| & German right double quotes \graph{``}. \tabularnewline
+% |\glq| & German left single quotes \graph{,}. \tabularnewline
+% |\grq| & German right single quotes \graph{`}. \tabularnewline
+% |\flqq| & French/Swiss left double quotes \graph{<<}. \tabularnewline
+% |\frqq| & French/Swiss right double quotes \graph{>>}. \tabularnewline
+% |\flq| & French/Swiss left single quotes \graph{\guilsinglleft}. \tabularnewline
+% |\frq| & French/Swiss right single quotes \graph{\guilsinglright}. \tabularnewline
+% |\dq| & The straight quotation mark character \graph{\textquotedbl}. \tabularnewline
+% \bottomrule
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \section{Hyphenation patterns}\label{sec:patterns}
+%
+% The question which hyphenation patterns are used by \Babel\ in case of the varieties of German needs some elaboration.
+% There is a set of established hyphenation patterns for pre- and post-1996 German orthography that has been available
+% with \TeX\ distributions for a long time (currently, these are shipped in form of the \texttt{dehypht} and \texttt{dehyphn} files).
+% These patterns, though, have many flaws (they produce wrong hyphenations, and not much is known about their construction). Therefore, a group
+% of people developed completely new patterns that do much better, the so-called `experimental' new hyphenation patterns of German,
+% distributed in the \textsf{dehyph-exptl} package \cite{exptl}.
+% As opposed to the old patterns, the new ones undergo constant improvement. The price for this, however, is that hyphenation and thus
+% the typeset document is subject to change with, and only due to, pattern updates.
+%
+% Modern engines (i.\,e., \texttt{xetex} and \texttt{luatex}) have already embraced those new patterns, i.\,e., they are activated on these engines by default.
+% The classic \TeX\ engines (\texttt{tex}\slash\texttt{pdftex}), however, haven't: they continue to use the old patterns. The reason for this is one
+% of \TeX's quality standards: refrain, if ever possible, from changing the output of user's documents in the wake of software updates.
+% An exception is (pre-1996) Swiss German: here, the classic engines use the `experimental' patterns by default (since there were no patterns available
+% previously anyway).
+%
+% So you need to explicitly activate the new patterns for a given document (except for \Lopt{swissgerman}) with the classic engines, should you
+% want to use them instead of the old ones.
+% With \Babel, this can be done quite easily by means of the \textsf{hyphsubst} \cite{hyphsubst} package:
+% \begin{verbatim}
+% \usepackage[german=german-x-latest]{hyphsubst}
+% \usepackage[german]{babel}
+% \end{verbatim}\vspace{-\baselineskip}
+% Since \Lopt{austrian} uses the same patterns as \Lopt{german}, the given \textsf{hyphsubst} option activates
+% the new patterns for this variety as well; but note that \textsf{hyphsubst} must be loaded before \babel\ (please refer to \cite{exptl} and
+% \cite{hyphsubst} for details).
+%
+% If you only want to use experimental patterns for one variety, you can do like so:
+% \begin{verbatim}
+% \usepackage{hyphsubst}
+% \usepackage[german,austrian]{babel}
+% \HyphSubstLet{austrian}{german-x-latest}
+% \end{verbatim}\vspace{-\baselineskip}
+%
+%
+% \section{Variety-specific options}\label{sec:toss}
+%
+% In\newfeature{2.10} Swiss (and Liechtensteinian) German writing, the use of \graph{\ss} is rather uncommon.
+% Swiss writers would normally use \graph{ss} where German or Austrian writers use the \graph{\ss} character
+% (e.\,g., \emph{Bu\ss e} vs.\,\emph{Busse}). When texts (or names) from other German speaking areas are quoted,
+% however, the spelling and hence the \graph{\ss} is often maintained (particularly in scholarly writing where
+% the spelling of quoted text is not supposed to be touched).
+%
+% We assume that Swiss writers will normally input \graph{ss} directly when they mean \graph{ss}, and we assume furthermore
+% that the \graph{\ss}-related shorthands |"s| and |"z| are useful also for Swiss writers when they actually need \graph{\ss},
+% the more so since the \graph{\ss} is not as directly accessible on Swiss keyboards as it is on German and Austrian ones.
+% On the other hand, there might be occasions where writers want to transfer a text from German or Austrian Standard into Swiss
+% Standard German and adapt the spelling on the fly, i.\,e., transform all \graph{\ss} into \graph{ss}.
+%
+% For this special case, we provide an option to make the \graph{\ss}-related shorthands |"s| and |"z| expand to the
+% respective digraphs\footnote{In graphematics, the term \emph{digraph} denotes two characters that make a functional pair
+% (which means, depending on the theoretical assumptions: they represent a single sound or they are semantically distinctive).},
+% \graph{ss} and \graph{sz}, rather than to \graph{\ss}. This is not the default behavior with
+% \Lopt{swissgerman} since, as mentioned, there are situations when the \graph{\ss} is (and has to be) used in Swiss writing,
+% and normally, no shorthand is needed to input (or output) two simple \graph{s} characters. You can opt-in (and out) digraphical
+% expansion of |"s| and |"z| on a global and local level:
+% \begin{itemize}
+% \item To globally switch on the digraphical expansion, use the \Babel\ modifier \Lopt{toss} (read: `to \graph{ss}') with
+% \Lopt{swissgerman}. I.\,e., pass \Lopt{swissgerman.toss} (rather than \Lopt{swissgerman}) as \babel\ option.
+%
+% \item To switch on the digraphical expansion only locally, you can use the boolean switch |\tosstrue|. Likewise,
+% |\tossfalse| switches off (both locally and globally set) digraphical expansion.
+% \end{itemize}
+% Both these changes result in the following deviant behavior of two shorthands:
+% \begin{table}[!h]
+% \begin{tabular}{l>{\raggedright}p{.9\textwidth}}
+% |"s| & Expands to digraph \graph{ss} \tabularnewline
+% |"z| & Expands to digraph \graph{sz} \tabularnewline
+% \end{tabular}
+% \end{table}
+%
+% \noindent One further note related to the use of \graph{ss} in Swiss German. As opposed to other consonantial letters, the \graph{s}
+% is excluded from the three consonant rule (\emph{Dreikonsonantenregel}) of traditional German spelling which prescribes
+% that one of three identical consonants has to be omitted if a vowel follows the three consonants (i.\,e., \emph{Schiffahrt},
+% not \emph{Schifffahrt}), except if the word is hyphenated (\emph{Schiff-fahrt}); the shorthands |"ff| etc. account for that.
+% This does not apply to \graph{s}! In that case, always all three consonants are spelled out (e.\,g., \emph{Kongresssaal},
+% not \emph{Kongressaal}). This is why we don't provide a shorthand for the \graph{sss} case.
+%
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% \subsection{General settings}
+%
+% First, we define some helper macros that help us to identify later on
+% which variety of German we are currently dealing with.
+% \changes{Version 2.9a=Version 2.10}{2016/11/03}{Add helper macros to identify the current option.}
+% \iffalse
+%<*germanb>
+% \fi
+% \begin{macrocode}
+\def\bbl@opt@german{german}
+\def\bbl@opt@germanb{germanb}
+\def\bbl@opt@austrian{austrian}
+\def\bbl@opt@swissgerman{swissgerman}
+% \end{macrocode}
+%
+% If \file{germanb.ldf} is read via the deprecated \babel\ option
+% \Lopt{germanb}, we make it behave as if \Lopt{german} was specified.
+% \changes{Version 2.6l}{2008/03/17}{Making germanb behave like german
+% needs some more work besides defining \cs{CurrentOption}}
+% \changes{Version 2.6m}{2008/06/01}{Corrected a typo}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@germanb
+ \def\CurrentOption{german}
+ \ifx\l@german\@undefined
+ \@nopatterns{German (trad. orthography)}
+ \adddialect\l@german0
+ \fi
+ \let\l@germanb\l@german
+ \AtBeginDocument{%
+ \let\captionsgermanb\captionsgerman
+ \let\dategermanb\dategerman
+ \let\extrasgermanb\extrasgerman
+ \let\noextrasgermanb\noextrasgerman
+ }
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once with the same option, checking the category
+% code of the \texttt{@} sign, etc.
+% \changes{Version 2.6d}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% If \file{germanb.ldf} is read as an option, i.e. via |\usepackage|
+% command, \Lopt{german} could be an `unknown' language, so we
+% have to make it known. We check for the existence of
+% |\l@german| and issue a warning if it is unknown.
+%
+% \changes{Version 2.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{Version 2.2d}{1991/10/27}{Removed use of \cs{@ifundefined}}
+% \changes{Version 2.3e}{1991/11/10}{Added warning, if no german
+% patterns loaded}
+% \changes{Version 2.5c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@german\@undefined
+ \@nopatterns{German (trad. orthography)}
+ \adddialect\l@german0
+\fi
+% \end{macrocode}
+%
+% We set \Lopt{austrian} as a dialect of \Lopt{german},
+% since the Austrian variety uses the same hyphenation patterns as
+% Germany's Standard German. If no German patterns are found, we issue
+% a warning.
+% \changes{Version 2.0}{1991/04/23}{Now use \cs{adddialect} for
+% austrian}
+% \changes{Version 2.8}{2016/11/01}{Only add Austrian dialect if \Lopt{austrian} is loaded}
+% \changes{Version 2.9}{2016/11/02}{Do not attempt to load \cs{l@austrian}, which does not exist}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@austrian
+ \ifx\l@german\@undefined
+ \@nopatterns{German (trad. orthography), needed by Austrian (trad. orthography)}
+ \adddialect\l@austrian0
+ \else
+ \adddialect\l@austrian\l@german
+ \fi
+\fi
+% \end{macrocode}
+%
+% For the Swiss variety, we attempt to load the specific
+% \Lopt{swissgerman} hyphenation patterns and fall back to
+% \Lopt{german} if those are not available.
+% If no patterns are found, we issue a warning.
+% \changes{Version 2.7b}{2014/10/10}{Do not warn about missing swissgerman patterns
+% if \Lopt{swissgerman} is not loaded}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@swissgerman
+ \ifx\l@swissgerman\@undefined
+ \ifx\l@german\@undefined
+ \@nopatterns{Swiss German (trad. orthography) and German (trad. orthography)}
+ \adddialect\l@swissgerman0
+ \else
+ \@nopatterns{Swiss German (trad. orthography)}
+ \adddialect\l@swissgerman\l@german
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Language-specific strings (captions)}
+%
+% The next step consists of defining macros that provide language specific strings
+% and settings.
+%
+% \begin{macro}{\@captionsgerman}
+% The macro |\@captionsgerman| defines all strings used in the four
+% standard document classes provided with \LaTeX\ for German.
+% This is an internal macro that is inherited and modified by the following
+% macros for the respective language varieties.
+%
+% \changes{Version 2.2}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{Version 2.2}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{Version 2.3e}{1991/11/10}{Added \cs{prefacename},
+% \cs{seename} and \cs{alsoname}}
+% \changes{Version 2.4}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{Version 2.6b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{Version 2.6d}{1996/07/10}{Construct control sequence on the
+% fly}
+% \changes{Version 2.6j}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{Version 2.7}{2013/12/13}{Split \cs{captionsgerman} from
+% \cs{captionsaustrian} and
+% \cs{captionsswissgerman}.}
+% \changes{Version 2.7}{2013/12/13}{Changed \cs{enclname} in
+% \Lopt{austrian} to
+% \emph{Beilage(n)}.}
+% \changes{Version 2.8}{2016/11/01}{Define trans-variational base captions
+% which are loaded and modified by the varieties}
+% \begin{macrocode}
+\@namedef{@captionsgerman}{%
+ \def\prefacename{Vorwort}%
+ \def\refname{Literatur}%
+ \def\abstractname{Zusammenfassung}%
+ \def\bibname{Literaturverzeichnis}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Anhang}%
+ \def\contentsname{Inhaltsverzeichnis}%
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\indexname{Index}%
+ \def\figurename{Abbildung}%
+ \def\tablename{Tabelle}%
+ \def\partname{Teil}%
+ \def\enclname{Anlage(n)}%
+ \def\ccname{Verteiler}%
+ \def\headtoname{An}%
+ \def\pagename{Seite}%
+ \def\seename{siehe}%
+ \def\alsoname{siehe auch}%
+ \def\proofname{Beweis}%
+ \def\glossaryname{Glossar}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsgerman}
+% The macro |\captionsgerman| is identical to |\@captionsgerman|,
+% but only defined if \Lopt{german} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsgerman} if
+% \Lopt{german} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@german
+ \@namedef{captionsgerman}{%
+ \@nameuse{@captionsgerman}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsaustrian}
+% The macro |\captionsaustrian| builds on |\@captionsgerman|, but
+% redefines some strings following Austrian conventions (for the
+% respective variants, cf. \cite{vwb}). It is only defined if
+% \Lopt{austrian} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsaustrian} if
+% \Lopt{austrian} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@austrian
+ \@namedef{captionsaustrian}{%
+ \@nameuse{@captionsgerman}%
+ \def\enclname{Beilage(n)}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsswissgerman}
+% The macro |\captionsswissgerman| builds on |\@captionsgerman|, but
+% redefines some strings following Swiss conventions (for the
+% respective variants, cf. \cite{vwb}). It is only defined if
+% \Lopt{swissgerman} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsswissgerman} if
+% \Lopt{swissgerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@swissgerman
+ \@namedef{captionsswissgerman}{%
+ \@nameuse{@captionsgerman}%
+ \def\enclname{Beilage(n)}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Date localizations}
+%
+% \begin{macro}{\month@german}
+% The macro |\month@german| defines German month names for all varieties.
+% \changes{Version 2.3e}{1991/11/10}{Added \cs{month@german}}
+% \begin{macrocode}
+\def\month@german{\ifcase\month\or
+ Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
+ Juli\or August\or September\or Oktober\or November\or Dezember\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dategerman}
+% The macro |\dategerman| redefines the command
+% |\today| to produce German dates. It is only defined if
+% \Lopt{german} is requested.
+% \changes{Version 2.6f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{Version 2.6f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{dategerman} if
+% \Lopt{german} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@german
+ \def\dategerman{\def\today{\number\day.~\month@german
+ \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{dateswissgerman}.}
+% The macro |\dateswissgerman| does the same for Swiss German dates. It
+% is only defined if \Lopt{swissgerman} is requested.
+% The result is identical to German.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{dateswissgerman} if
+% \Lopt{swissgerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@swissgerman
+ \def\dateswissgerman{\def\today{\number\day.~\month@german
+ \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateaustrian}
+% The macro |\dateaustrian| redefines the command
+% |\today| to produce Austrian versions of the German dates.
+% Here, the naming of January (,,J\"anner``) differs from the
+% other German varieties. The macro is only defined if
+% \Lopt{austrian} is requested.
+% \changes{Version 2.6f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{Version 2.6f}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{dateaustrian} if
+% \Lopt{austrian} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@austrian
+ \def\dateaustrian{\def\today{\number\day.~\ifnum1=\month
+ J\"anner\else \month@german\fi \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Extras}
+%
+% \begin{macro}{\extrasgerman}
+% \changes{Version 2.0b}{1991/05/29}{added some comment chars to
+% prevent white space}
+% \changes{Version 2.2}{1991/06/11}{Save all redefined macros}
+% \begin{macro}{\extrasaustrian}
+% \begin{macro}{\extrasswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{extrasswissgerman}.}
+% \begin{macro}{\noextrasaustrian}
+% \begin{macro}{\noextrasswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{noextrasswissgerman}.}
+% \begin{macro}{\noextrasgerman}
+% \changes{Version 1.1}{1990/07/30}{Added \cs{dieresis}}
+% \changes{Version 2.0b}{1991/05/29}{added some comment chars to
+% prevent white space}
+% \changes{Version 2.2}{1991/06/11}{Try to restore everything to its
+% former state}
+% \changes{Version 2.6d}{1996/07/10}{Construct control sequence
+% \cs{extrasgerman} or \cs{extrasaustrian} on the fly}
+%
+% The macros |\extrasgerman|, |\extrasaustrian|
+% and |\extrasswissgerman|, respectively, will perform all the extra
+% definitions needed for the German language or the respective
+% variety. The macro |\noextrasgerman| is used to cancel the
+% actions of |\extrasgerman|. |\noextrasaustrian| and
+% |\noextrasswissgerman| behave analoguously.
+%
+% First, the character \texttt{"} is declared active for all German
+% varieties. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% Depending on the option with which the language definition file
+% has been loaded, the macro |\extrasgerman|, |\extrasaustrian|
+% or |\extrasswissgerman| is defined. Each of those is identical:
+% they load the shorthands defined below and activate the \texttt{"}
+% character.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{german}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+%
+% \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement boolean switch
+% \cs{tosstrue}\slash\cs{tossfalse} to customize \graph{\ss}-related
+% shorthands in Swiss German context.}
+% \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement modifier \Lopt{toss}
+% to customize \graph{\ss}-related shorthands in Swiss German context.}
+% \begin{macro}{toss}
+% \begin{macro}{\tosstrue}
+% \begin{macro}{\tossfalse}
+% For Swiss German, we allow optionally to expand the \graph{\ss}-related
+% shorthands the Swiss way, i.\,e. as \graph{ss} (globally, if the modifier \Lopt{toss}
+% is used or locally if |\tosstrue|.).
+% \begin{macrocode}
+\newif\iftoss\tossfalse
+\newif\ifbbl@toss\bbl@tossfalse
+\ifx\bbl@mod@swissgerman\@undefined\else
+ \@expandtwoargs\in@{,toss,}{,\bbl@mod@swissgerman,}
+ \ifin@
+ \tosstrue
+ \fi
+ \addto\extrasswissgerman{%
+ \iftoss\bbl@tosstrue\else\bbl@tossfalse\fi}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Next, again depending on the option with which the language definition
+% file has been loaded, the macro |\noextrasgerman|, |\noextrasaustrian|
+% or |\noextrasswissgerman| is defined.
+% These deactivate the \texttt{"} character and thus turn the shorthands
+% off again outside of the respective variety.
+% \changes{Version 2.6i}{1999/12/16}{Deactivate shorthands outside of
+% German.}
+% \changes{Version 2.7}{2013/12/13}{Deactivate shorthands also outside of
+% \Lopt{austrian} and \Lopt{swissgerman}.}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+\ifx\CurrentOption\bbl@opt@swissgerman
+ \addto\noextrasswissgerman{\bbl@tossfalse}
+\fi
+% \end{macrocode}
+%
+% \changes{Version 2.6a}{1995/02/15}{All the code to handle the active
+% double quote has been moved to \file{babel.def}}
+%
+% In order for \TeX\ to be able to hyphenate German words which
+% contain `\ss' (in the \texttt{OT1} position |^^Y|) we have to
+% give the character a nonzero |\lccode| (see Appendix H, the \TeX
+% book).
+% \changes{Version 2.6c}{1996/04/08}{Use decimal number instead of
+% hat-notation as the hat may be activated}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\lccode25}%
+ \lccode25=25}
+% \end{macrocode}
+% \changes{Version 2.6a}{1995/02/15}{Removeed \cs{3} as it is no
+% longer in \file{germanb.ldf}}
+%
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow}
+% \end{macrocode}
+% \changes{Version 2.7}{2013/12/13}{Do not use \cs{@namedef} when
+% \cs{noextras} is already defined and should not be overwritten.}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \umlauthigh}
+% \end{macrocode}
+% The German hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
+% \changes{Version 2.6a}{1995/05/13}{use \cs{germanhyphenmins} to store
+% the correct values}
+% \changes{Version 2.6j}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% For German texts we need to assure that |\frenchspacing| is
+% turned on.
+% \changes{Version 2.6k}{2001/01/26}{Turn frenchspacing on, as in
+% \file{german.sty}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \changes{Version 2.6a}{1995/02/15}{\cs{umlautlow} and
+% \cs{umlauthigh} moved to \file{glyphs.dtx}, as well as
+% \cs{newumlaut} (now \cs{lower@umlaut}}
+%
+% \subsection{Active characters, macros \& shorthands}
+%
+% The following code is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:german-quote}.
+%
+% In order to be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \changes{Version 2.3e}{1991/11/10}{Added \cs{save@sf@q} macro and
+% rewrote all quote macros to use it}
+% \changes{Version 2.3h}{1991/02/16}{moved definition of
+% \cs{allowhyphens}, \cs{set@low@box} and \cs{save@sf@q} to
+% \file{babel.com}}
+% \changes{Version 2.6a}{1995/02/15}{Moved all quotation characters to
+% \file{glyphs.dtx}}
+%
+% \begin{macro}{\dq}
+% We save the original double quotation mark character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+%
+% Furthermore, we define some helper macros for contextual \graph{\ss} handling.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\dq{"}
+ \def\@SS{\mathchar"7019 }
+ \def\bbl@ss{\ifbbl@toss ss\else\textormath{\ss}{\@SS{}}\fi}
+ \def\bbl@SS{SS}
+ \def\bbl@sz{\ifbbl@toss sz\else\textormath{\ss}{\@SS{}}\fi}
+ \def\bbl@SZ{SZ}
+}
+\x
+% \end{macrocode}
+% \end{macro}
+% \changes{Version 2.6c}{1996/01/24}{Moved \cs{german@dq@disc} to
+% babel.def, calling it \cs{bbl@disc}}
+%
+% \changes{Version 2.6a}{1995/02/15}{Use \cs{ddot} instead of
+% \cs{@MATHUMLAUT}}
+%
+% Now we can define the doublequote shorthands: the umlauts,
+% \changes{Version 2.6c}{1996/05/30}{added the \cs{allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{german}{"a}{\textormath{\"{a}\bbl@allowhyphens}{\ddot a}}
+\declare@shorthand{german}{"o}{\textormath{\"{o}\bbl@allowhyphens}{\ddot o}}
+\declare@shorthand{german}{"u}{\textormath{\"{u}\bbl@allowhyphens}{\ddot u}}
+\declare@shorthand{german}{"A}{\textormath{\"{A}\bbl@allowhyphens}{\ddot A}}
+\declare@shorthand{german}{"O}{\textormath{\"{O}\bbl@allowhyphens}{\ddot O}}
+\declare@shorthand{german}{"U}{\textormath{\"{U}\bbl@allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremata,
+% \begin{macrocode}
+\declare@shorthand{german}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{german}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{german}{"i}{\textormath{\"{\i}}%
+ {\ddot\imath}}
+\declare@shorthand{german}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% German \ss{},
+% \changes{Version 2.6f}{1997/05/08}{use \cs{SS} instead of
+% \texttt{SS}, removed braces after \cs{ss}}
+% \begin{macrocode}
+\declare@shorthand{german}{"s}{\bbl@ss}
+\declare@shorthand{german}{"S}{\bbl@SS}
+\declare@shorthand{german}{"z}{\bbl@sz}
+\declare@shorthand{german}{"Z}{\bbl@SZ}
+% \end{macrocode}
+% German and French/Swiss quotation marks,
+% \begin{macrocode}
+\declare@shorthand{german}{"`}{\glqq}
+\declare@shorthand{german}{"'}{\grqq}
+\declare@shorthand{german}{"<}{\flqq}
+\declare@shorthand{german}{">}{\frqq}
+% \end{macrocode}
+% discretionary commands
+% \begin{macrocode}
+\declare@shorthand{german}{"c}{\textormath{\bbl@disc ck}{c}}
+\declare@shorthand{german}{"C}{\textormath{\bbl@disc CK}{C}}
+\declare@shorthand{german}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{german}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{german}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{german}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{german}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{german}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{german}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{german}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{german}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{german}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{german}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{german}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{german}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% (we need to treat |"f| a bit differently in order to preserve the
+% ff-ligature)
+% \changes{Version 2.6f}{1998/06/15}{Copied the coding for \texttt{"f}
+% from german.dtx version 2.5d}
+% \begin{macrocode}
+\declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}
+\def\bbl@discff{\penalty\@M
+ \afterassignment\bbl@insertff \let\bbl@nextff= }
+\def\bbl@insertff{%
+ \if f\bbl@nextff
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\relax\discretionary{ff-}{f}{ff}\bbl@allowhyphens}{f\bbl@nextff}}
+\let\bbl@nextff=f
+% \end{macrocode}
+% and some additional commands (hyphenation, line breaking and ligature control):
+% \changes{Version 2.9}{2016/11/02}{Add \texttt{"/} shortcut for breakable slash
+% (taken from \file{dutch.ldf})}
+% \changes{Version 2.9b=Version 2.11}{2018/12/08}{Fix old hyphenation regression introduced with \babel\ 3.7
+% (2002) in a number of shorthands (change of meaning of \cs{allowhyphens}
+% vs. \cs{bbl@allowhyphens})}
+% \begin{macrocode}
+\declare@shorthand{german}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{german}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{german}{""}{\hskip\z@skip}
+\declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}
+\declare@shorthand{german}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% \begin{macro}{\ck}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \changes{Version 2.6f}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+\def\ck{\bbl@allowhyphens\discretionary{k-}{k}{ck}\bbl@allowhyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{Version 2.6d}{1996/11/02}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+% \end{macrocode}
+% \iffalse
+%</germanb>
+% \fi
+%
+%
+% \subsection{\file{austrian.ldf}, \file{german.ldf} and \file{swissgerman.ldf}}
+%
+% \changes{Version 2.7}{2013/12/13}{Generate portmanteau files \file{austrian.ldf},
+% \file{german.ldf} and \file{swissgerman.ldf}.}
+%
+% \Babel\ expects a \file{\langvar{}.ldf} file for each \langvar. So we create portmanteau
+% ldf files for \Lopt{austrian}, \Lopt{german} and \Lopt{swissgerman}.\footnote{%
+% For \Lopt{austrian} and \Lopt{german}, this is not strictly necessary,
+% since \babel\ provides aliases for these languages (pointing to \Lopt{germanb}).
+% However, since \babel\ does not officially support these aliases anymore after
+% the language definition files have been separated from the core, we provide
+% the whole range of ldf files for the sake of completeness.} These files themselves
+% only load \file{germanb.ldf}, which does the real work:
+%
+% \iffalse
+%<*austrian|german|swissgerman>
+% \fi
+% \begin{macrocode}
+\input germanb.ldf\relax
+% \end{macrocode}
+% \iffalse
+%</austrian|german|swissgerman>
+% \fi
+%
+%
+%\PrintChanges
+%
+% \begin{thebibliography}{9}
+% \bibitem{vwb} Ammon, Ulrich et al.:
+% \emph{Variantenw\"orterbuch des Deutschen. Die Standardsprache in \"Osterreich, der Schweiz
+% und Deutschland sowie in Liechtenstein, Luxemburg, Ostbelgien und S\"udtirol.}
+% Berlin, New York: De Gruyter.
+% \bibitem{babel} Braams, Johannes and Bezos, Javier:
+% \emph{Babel}.
+% \url{http://www.ctan.org/pkg/babel}.
+% \bibitem{exptl} Deutschsprachige Trennmustermannschaft:
+% \emph{dehyph-exptl -- Experimental hyphenation patterns for the German language}.
+% \url{https://ctan.org/pkg/dehyph-exptl}.
+% \bibitem{hyphsubst} Heiko Oberdiek:
+% \emph{hyphsubst -- Substitute hyphenation patterns}.
+% \url{https://ctan.org/pkg/hyphsubst}.
+% \bibitem{HP} Partl, Hubert:
+% \emph{German \TeX}, \emph{TUGboat} 9/1 (1988), p.~70--72.
+% \bibitem{gerdoc} Raichle, Bernd:
+% \emph{German}.
+% \url{http://www.ctan.org/pkg/german}.
+% \bibitem{hyph-utf8} Manuel P\'egouri\'e-Gonnard et al.:
+% \emph{hyph-utf8 -- Hyphenation patterns expressed in UTF-8}.
+% \url{https://ctan.org/pkg/hyph-utf8}.
+% \end{thebibliography}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/german/germanb.pdf b/macros/latex/contrib/babel-contrib/german/germanb.pdf
new file mode 100644
index 0000000000..e52056aa87
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/germanb.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/german/ngermanb.dtx b/macros/latex/contrib/babel-contrib/german/ngermanb.dtx
new file mode 100644
index 0000000000..01413286b9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/ngermanb.dtx
@@ -0,0 +1,815 @@
+% \iffalse meta-comment
+%
+% File `ngermanb.dtx'
+%
+% Copyright 1989--2016
+% Johannes L. Braams
+% Bernd Raichle
+% Walter Schmidt
+% Juergen Spitzmueller
+% All rights reserved.
+%
+% This file is part of the babel-german bundle,
+% an extension to the Babel system.
+% ----------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Juergen Spitzmueller.
+%
+% This file is based on german.tex version 2.5e
+% by Bernd Raichle, Hubert Partl et.al.
+%
+% \fi
+% \CheckSum{403}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{ngermanb.dtx}
+%</dtx>
+%<naustrian>\ProvidesLanguage{naustrian}
+%<ngerman>\ProvidesLanguage{ngerman}
+%<nswissgerman>\ProvidesLanguage{nswissgerman}
+%<ngermanb>\ProvidesLanguage{ngermanb}
+%\fi
+%\ProvidesFile{ngermanb.dtx}
+ [2018/12/08 v2.11 German support for babel (post-1996 orthography)]
+%\iffalse
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[osf]{libertine}
+\usepackage[scaled=0.76]{beramono}
+\usepackage{url}
+\usepackage{array}
+\usepackage{booktabs}
+\usepackage[tableposition=top,skip=5pt]{caption}
+\usepackage{marginnote}
+\usepackage[svgnames]{xcolor}
+\usepackage[pdfusetitle]{hyperref}
+\hypersetup{%
+ colorlinks,
+ linkcolor=black,
+ filecolor=Maroon,
+ urlcolor=Maroon,
+ citecolor=black
+}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\graph[1]{$\langle$#1$\rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\texttt{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\newfeature[1]{\marginnote{\footnotesize New feature\\in v.\,#1!}}
+\GlossaryMin = .33\textheight
+
+\begin{document}
+ \DocInput{ngermanb.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{ngermanb.dtx}
+%
+%\RecordChanges
+%
+% \changes{Version 2.9a=Version 2.10}{2016/11/07}{Improvements to the manual}
+%
+% \changes{Version 2.7}{2013/12/13}{Added support for variety \Lopt{nswissgerman}.}
+% \changes{Version 2.7}{2013/12/13}{Revised \Lopt{naustrian} support.}
+% \changes{Version 2.7}{2013/12/13}{Revised documentation: Turn the \babel{}
+% manual chapter into a self-enclosed manual.}
+%
+% \changes{Version 2.6f}{1999/03/24}{Renamed from \file{germanb.ldf};
+% language names changed from \Lopt{german} and \Lopt{austrian}
+% to \Lopt{ngerman} and \Lopt{naustrian}.}
+%
+% \title{Babel support for the German language (post-1996~orthography)}
+% \author{Johannes Braams \and Bernd Raichle \and Walter Schmidt \and J\"urgen Spitzm\"uller\thanks{%
+% Current maintainer. Please report issues via \protect\url{https://github.com/jspitz/babel-german}.}}
+% \date{\fileversion\ (\filedate)}
+% \maketitle
+%
+% \begin{abstract}
+% \noindent This manual documents \babel\ language support for German (post-1996 orthography),
+% including support for the Austrian and Swiss varieties of German.
+% The manual is part of the \textsf{babel-german} bundle.
+% \end{abstract}
+%
+% \section{Aim and usage}
+%
+% The \babel\ `language definition file' \file{ngermanb.ldf} documented in this manual provides
+% the \babel\ package with all language specific strings, settings and commands needed for writing
+% German texts, including texts in the Austrian and Swiss varieties of German.\footnote{%
+% The file \file{ngermanb.ldf} started as a re-implementation of the
+% package \file{ngerman.sty} by Bernd Raichle (cf.\,\cite{gerdoc}),
+% which itself builds on \file{german.sty}, originally developed by
+% Hubert Partl (cf.\,\cite{HP}) and later maintained by Bernd Raichle
+% as well. The initial re-implementation was done by Johannes Braams.}
+% Furthermore, it is assured that the correct hyphenation patterns for the respective
+% language or variety are used (see sec.~\ref{sec:patterns} for details).
+% The file, and hence this manual, addresses the contemporary (`reformed', i.\,e., post-1996) orthography.
+% For traditional (pre-1996) German orthography support, please refer to the complementary
+% \href{file:germanb.pdf}{manual for the \file{germanb.ldf} language definition file}.
+%
+% In order to use the language definitions provided here, you need to use
+% the \babel\ package and pass the respective language\slash variety name\footnote{%
+% Obviously, the prefix \graph{n} in the language\slash variety
+% names stands for `new' (orthography) here, since the names \Lopt{austrian}, \Lopt{german}
+% and \Lopt{swissgerman} were already used for pre-1996 orthography.}
+% as an option, either of
+%
+% \begin{itemize}
+% \setlength{\itemsep}{0pt}
+% \item |\usepackage[ngerman]{babel}|
+% \item |\usepackage[naustrian]{babel}|
+% \item |\usepackage[nswissgerman]{babel}|
+% \item |\usepackage[nswissgerman.toss]{babel}|\newfeature{2.10}\footnote{%
+% See sec.~\ref{sec:toss} on the \Lopt{toss} modifier.}
+% \end{itemize}
+% Using multiple varieties in parallel is possible;
+% consult the \babel\ manual \cite{babel} for details.
+%
+% \section{Shorthands}
+%
+% For all three varieties of German, the character |"| is made active
+% in order to provide some shorthand macros for frequently used special
+% characters as well as for better control of hyphenation, line breaks
+% and ligatures.
+% Table~\ref{tab:german-quote} provides an overview of the shorthands
+% that are provided by \textsf{babel-german} for \Lopt{ngerman}, \Lopt{naustrian}
+% and \Lopt{nswissgerman}.
+% \begin{table}[htb]
+% \begin{center}
+% \small
+% \caption{The extra definitions made
+% by \file{ngermanb.ldf}}\label{tab:german-quote}
+% \begin{tabular}{l>{\raggedright}p{.9\textwidth}}
+% \toprule
+% |"a| & Umlaut \graph{\"a} (shorthand for |\"a|). Similar shorthands are
+% available for all other lower- and uppercase
+% vowels (umlauts: |"a|, |"o|, |"u|, |"A|, |"O|,
+% |"U|; tremata: |"e|, |"i|, |"E|, |"I|). \tabularnewline
+% |"s| & German \graph{\ss} (shorthand for |\ss{}|);
+% but cf. sec.~\ref{sec:toss}. \tabularnewline
+% |"z| & German \graph{\ss} (shorthand for |\ss{}|).
+% Differs to |"s| in uppercase version;
+% but cf. sec.~\ref{sec:toss}. \tabularnewline
+% |"S| & |\uppercase{"s}|, typeset as \graph{SS}(\graph{\ss}
+% must be written as \graph{SS} in uppercase writing). \tabularnewline
+% |"Z| & |\uppercase{"z}|, typeset as \graph{SZ}. In traditional
+% spelling, \graph{\ss} could also be written as \graph{SZ}
+% instead of \graph{SS} in uppercase writing. Note that,
+% with reformed orthography, the \graph{SZ} variant has
+% been deprecated in favour of \graph{SS} only. \tabularnewline
+% \verb="|= & Disable ligature at this position (e.\,g., at morpheme
+% boundaries, as in \verb=Auf"|lage=). \tabularnewline
+% |"-| & An additional breakpoint that does still
+% allow for hyphenation at the breakpoints preset in
+% the hyphenation patterns (as opposed to |\-|). \tabularnewline
+% |"=| & An explicit hyphen with a breakpoint, allowing
+% for hyphenation at the other points preset in the
+% hyphenation patterns (as opposed to plain |-|);
+% useful for long compounds such as
+% |IT"=Dienstleisterinnen|. \tabularnewline
+% |"~| & An explicit hyphen without a breakpoint. Useful for
+% cases where the hyphen should stick at the following
+% syllable, e.\,g., |bergauf und "~ab| . \tabularnewline
+% |""| & A breakpoint that does not output a hyphen if the line
+% break is performed (consider parenthetical extensions
+% as in |(pseudo"~)""wissenschaftlich|). \tabularnewline
+% |"/| & \newfeature{2.9}A slash that allows for a linebreak.
+% As opposed to |\slash{}|, hyphenation at the breakpoints
+% preset in the hyphenation patterns is still allowed. \tabularnewline
+% |"`| & German left double quotes \graph{,,}. \tabularnewline
+% |"'| & German right double quotes \graph{``}. \tabularnewline
+% |"<| & French/Swiss left double quotes \graph{<<}. \tabularnewline
+% |">| & French/Swiss right double quotes \graph{>>}. \tabularnewline
+% \bottomrule
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \enlargethispage{\baselineskip}
+% \noindent Table~\ref{tab:more-quote} lists some \babel\ macros for quotation marks
+% that might be used as an alternative to the quotation mark shorthands listed above.
+% \begin{table}[!h]
+% \begin{center}
+% \small
+% \caption{Alternative commands for quotation marks (provided by \babel)}\label{tab:more-quote}
+% \begin{tabular}{lp{.88\textwidth}}
+% \toprule
+% |\glqq| & German left double quotes \graph{,,}. \tabularnewline
+% |\grqq| & German right double quotes \graph{``}. \tabularnewline
+% |\glq| & German left single quotes \graph{,}. \tabularnewline
+% |\grq| & German right single quotes \graph{`}. \tabularnewline
+% |\flqq| & French/Swiss left double quotes \graph{<<}. \tabularnewline
+% |\frqq| & French/Swiss right double quotes \graph{>>}. \tabularnewline
+% |\flq| & French/Swiss left single quotes \graph{\guilsinglleft}. \tabularnewline
+% |\frq| & French/Swiss right single quotes \graph{\guilsinglright}. \tabularnewline
+% |\dq| & The straight quotation mark character \graph{\textquotedbl}. \tabularnewline
+% \bottomrule
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \section{Hyphenation patterns}\label{sec:patterns}
+%
+% The question which hyphenation patterns are used by \Babel\ in case of the varieties of German needs some elaboration.
+% There is a set of established hyphenation patterns for pre- and post-1996 German orthography that has been available
+% with \TeX\ distributions for a long time (currently, these are shipped in form of the \texttt{dehypht} and \texttt{dehyphn} files).
+% These patterns, though, have many flaws (they produce wrong hyphenations, and not much is known about their construction). Therefore,
+% a group of people developed completely new patterns that do much better, the so-called `experimental' new hyphenation patterns of German,
+% distributed in the \textsf{dehyph-exptl} package \cite{exptl}.
+% As opposed to the old patterns, the new ones undergo constant improvement. The price for this, however, is that hyphenation and thus
+% the typeset document is subject to change with, and only due to, pattern updates.
+%
+% Modern engines (i.\,e., \texttt{xetex} and \texttt{luatex}) have already embraced those new patterns, i.\,e., they are activated on these
+% engines by default. The classic \TeX\ engines (\texttt{tex}\slash\texttt{pdftex}), however, haven't: they continue to use the old patterns.
+% The reason for this is one of \TeX's quality standards: refrain, if ever possible, from changing the output of user's documents in the wake
+% of software updates.
+%
+% This means that you need to explicitly activate the new patterns for a given document with the classic engines, should you want to use them
+% instead of the old ones. With \Babel, this can be done quite easily by means of the \textsf{hyphsubst} \cite{hyphsubst} package:
+% \begin{verbatim}
+% \usepackage[ngerman=ngerman-x-latest]{hyphsubst}
+% \usepackage[ngerman]{babel}
+% \end{verbatim}\vspace{-\baselineskip}
+% Since \Lopt{naustrian} and \Lopt{nswissgerman} use the same patterns as \Lopt{ngerman}, the given \textsf{hyphsubst} option activates
+% the new patterns for all varieties; but note that \textsf{hyphsubst} must be loaded before \babel\ (please refer to \cite{exptl} and
+% \cite{hyphsubst} for details).
+%
+% If you only want to use experimental patterns for one variety, you can do like so:
+% \begin{verbatim}
+% \usepackage{hyphsubst}
+% \usepackage[ngerman,naustrian]{babel}
+% \HyphSubstLet{naustrian}{ngerman-x-latest}
+% \end{verbatim}\vspace{-\baselineskip}
+%
+% \section{Variety-specific options}\label{sec:toss}
+%
+% In\newfeature{2.10} Swiss (and Liechtensteinian) German writing, the use of \graph{\ss} is rather uncommon.
+% Swiss writers would normally use \graph{ss} where German or Austrian writers use the \graph{\ss} character
+% (e.\,g., \emph{Bu\ss e} vs.\,\emph{Busse}). When texts (or names) from other German speaking areas are quoted,
+% however, the spelling and hence the \graph{\ss} is often maintained (particularly in scholarly writing where
+% the spelling of quoted text is not supposed to be touched).
+%
+% We assume that (1) Swiss writers normally input \graph{ss} directly when they mean \graph{ss}, and that (2) the
+% \graph{\ss}-related shorthands |"s| and |"z| are useful also for Swiss writers when they actually need \graph{\ss},
+% the more so since the \graph{\ss} is not as directly accessible on Swiss keyboards as it is on German and Austrian ones.
+% On the other hand, there might be occasions where writers want to transfer a text from German or Austrian into Swiss
+% Standard German and adapt the spelling on the fly, i.\,e., transform all \graph{\ss} into \graph{ss}.
+%
+% For this special case, we provide an option to make the \graph{\ss}-related shorthands |"s| and |"z| expand to the
+% respective digraphs\footnote{In graphematics, the term \emph{digraph} denotes two characters that make a functional pair
+% (which means, depending on the theoretical assumptions: they represent a single sound or they are semantically distinctive).},
+% \graph{ss} and \graph{sz}, rather than to \graph{\ss}. This is not the default behavior with
+% \Lopt{nswissgerman} since, as mentioned, there are situations when the \graph{\ss} is (and has to be) used in Swiss writing,
+% and normally, no shorthand is needed to input (or output) two simple \graph{s} characters. You can opt-in (and out) digraphical
+% expansion of |"s| and |"z| on a global and local level:
+% \begin{itemize}
+% \item To globally switch on the digraphical expansion, use the \Babel\ modifier \Lopt{toss} (read: `to \graph{ss}') with
+% \Lopt{nswissgerman}. I.\,e., pass \Lopt{nswissgerman.toss} (rather than \Lopt{nswissgerman}) as \babel\ option.
+%
+% \item To switch on the digraphical expansion only locally, you can use the boolean switch |\ntosstrue|. Likewise,
+% |\ntossfalse| switches off (both locally and globally set) digraphical expansion.
+% \end{itemize}
+% Both these changes result in the following deviant behavior of two shorthands:\\
+% \begin{tabular}{l>{\raggedright}p{.9\textwidth}}
+% |"s| & Expands to digraph \graph{ss} \tabularnewline
+% |"z| & Expands to digraph \graph{sz} \tabularnewline
+% \end{tabular}
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+% \subsection{General settings}
+%
+% First, we define some helper macros that help us to identify later on
+% which variety of German we are currently dealing with.
+% \changes{Version 2.9a=Version 2.10}{2016/11/03}{Add helper macros to identify the current option.}
+% \iffalse
+%<*ngermanb>
+% \fi
+% \begin{macrocode}
+\def\bbl@opt@ngerman{ngerman}
+\def\bbl@opt@ngermanb{ngermanb}
+\def\bbl@opt@naustrian{naustrian}
+\def\bbl@opt@nswissgerman{nswissgerman}
+% \end{macrocode}
+%
+% If \file{ngermanb.ldf} is read via the deprecated \babel\ option
+% \Lopt{ngermanb}, we make it behave as if \Lopt{ngerman} was specified.
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@ngermanb
+ \def\CurrentOption{ngerman}
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once with the same option, checking the category
+% code of the \texttt{@} sign, etc.
+% \begin{macrocode}
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% If \file{ngermanb.ldf} is read as an option, i.e., by the |\usepackage|
+% command, \Lopt{ngerman} could be an `unknown' language, so we
+% have to make it known. We check for the existence of
+% |\l@ngerman| and issue a warning if it is unknown.
+%
+% \begin{macrocode}
+\ifx\l@ngerman\@undefined
+ \@nopatterns{German (new orthography)}
+ \adddialect\l@ngerman0
+\fi
+% \end{macrocode}
+%
+% We set \Lopt{naustrian} and \Lopt{nswissgerman} as dialects
+% of \Lopt{ngerman}, since they use the same hyphenation patterns
+% than \Lopt{ngerman}. If no \Lopt{ngerman} patterns are found,
+% we issue a warning.
+% \changes{Version 2.8}{2016/11/01}{Only add dialects if the respective
+% variety is loaded}
+% \changes{Version 2.9}{2016/11/02}{Do not attempt to load \cs{l@naustrian}
+% or \cs{l@nswissgerman}, which do not exist}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@naustrian
+ \ifx\l@ngerman\@undefined
+ \@nopatterns{German (new orthography), needed by Austrian (new orthography)}
+ \adddialect\l@naustrian0
+ \else
+ \adddialect\l@naustrian\l@ngerman
+ \fi
+\fi
+\ifx\CurrentOption\bbl@opt@nswissgerman
+ \ifx\l@ngerman\@undefined
+ \@nopatterns{German (new orthography), needed by Swiss German (new orthography)}
+ \adddialect\l@nswissgerman0
+ \else
+ \adddialect\l@nswissgerman\l@ngerman
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Language-specific strings (captions)}
+%
+% The next step consists of defining macros that provide language specific strings
+% and settings.
+%
+% \begin{macro}{\@captionsngerman}
+% \changes{Version 2.6n}{2008/07/06}{Corrected typo
+% \cs{captionnsgerman}}
+% The macro |\@captionsngerman| defines all strings used in the four
+% standard document classes provided with \LaTeX\ for German.
+% This is an internal macro that is inherited and modified by the following
+% macros for the respective language varieties.
+%
+% \changes{Version 2.7}{2013/12/13}{Split \cs{captionsngerman} from
+% \cs{captionsnaustrian} and
+% \cs{captionsnswissgerman}.}
+% \changes{Version 2.7}{2013/12/13}{Changed \cs{enclname} in
+% \Lopt{naustrian} to
+% \emph{Beilage(n)}.}
+% \changes{Version 2.6k}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{Version 2.8}{2016/11/01}{Define trans-variational base captions
+% which are loaded and modified by the varieties}
+% \begin{macrocode}
+\@namedef{@captionsngerman}{%
+ \def\prefacename{Vorwort}%
+ \def\refname{Literatur}%
+ \def\abstractname{Zusammenfassung}%
+ \def\bibname{Literaturverzeichnis}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Anhang}%
+ \def\contentsname{Inhaltsverzeichnis}%
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\indexname{Index}%
+ \def\figurename{Abbildung}%
+ \def\tablename{Tabelle}%
+ \def\partname{Teil}%
+ \def\enclname{Anlage(n)}%
+ \def\ccname{Verteiler}%
+ \def\headtoname{An}%
+ \def\pagename{Seite}%
+ \def\seename{siehe}%
+ \def\alsoname{siehe auch}%
+ \def\proofname{Beweis}%
+ \def\glossaryname{Glossar}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsngerman}
+% The macro |\captionsngerman| is identical to |\@captionsngerman|,
+% but only defined if \Lopt{ngerman} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsngerman} if
+% \Lopt{ngerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@ngerman
+ \@namedef{captionsngerman}{%
+ \@nameuse{@captionsngerman}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsnaustrian}
+% The macro |\captionsnaustrian| builds on |\@captionsngerman|, but
+% redefines some strings following Austrian conventions (for the
+% respective variants, cf. \cite{vwb}). It is only defined if
+% \Lopt{naustrian} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsnaustrian} if
+% \Lopt{naustrian} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@naustrian
+ \@namedef{captionsnaustrian}{%
+ \@nameuse{@captionsngerman}%
+ \def\enclname{Beilage(n)}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\captionsnswissgerman}
+% The macro |\captionsnswissgerman| builds on |\@captionsngerman|, but
+% redefines some strings following Swiss conventions (for the
+% respective variants, cf. \cite{vwb}). It is only defined if
+% \Lopt{nswissgerman} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{captionsnswissgerman} if
+% \Lopt{nswissgerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@nswissgerman
+ \@namedef{captionsnswissgerman}{%
+ \@nameuse{@captionsngerman}%
+ \def\enclname{Beilage(n)}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Date localizations}
+%
+% \begin{macro}{\month@ngerman}
+% The macro |\month@ngerman| defines German month names for all varieties.
+% \begin{macrocode}
+\def\month@ngerman{\ifcase\month\or
+ Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
+ Juli\or August\or September\or Oktober\or November\or Dezember\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datengerman}
+% The macro |\datengerman| redefines the command
+% |\today| to produce German dates. It is only defined if
+% \Lopt{ngerman} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{datengerman} if
+% \Lopt{ngerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@ngerman
+ \def\datengerman{\def\today{\number\day.~\month@ngerman
+ \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datenswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{datenswissgerman}.}
+% The macro |\datenswissgerman| does the same for Swiss German dates.
+% The result is identical to German. This macro is only defined if
+% \Lopt{nswissgerman} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{datenswissgerman} if
+% \Lopt{nswissgerman} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@nswissgerman
+ \def\datenswissgerman{\def\today{\number\day.~\month@ngerman
+ \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datenaustrian}
+% The macro |\datenaustrian| redefines the command
+% |\today| to produce Austrian versions of the German dates.
+% Here, the naming of January (,,J\"anner``) differs from the
+% other German varieties. The macro is only defined if
+% \Lopt{naustrian} is requested.
+% \changes{Version 2.8}{2016/11/01}{Only define \cs{datenaustrian} if
+% \Lopt{naustrian} is requested.}
+% \begin{macrocode}
+\ifx\CurrentOption\bbl@opt@naustrian
+ \def\datenaustrian{\def\today{\number\day.~\ifnum1=\month
+ J\"anner\else \month@ngerman\fi \space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Extras}
+%
+% \begin{macro}{\extrasnaustrian}
+% \begin{macro}{\extrasnswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{extrasnswissgerman}.}
+% \begin{macro}{\extrasngerman}
+% \begin{macro}{\noextrasnaustrian}
+% \begin{macro}{\noextrasnswissgerman}
+% \changes{Version 2.7}{2013/12/13}{Added \cs{noextrasnswissgerman}.}
+% \begin{macro}{\noextrasngerman}
+% The macros |\extrasngerman|, |\extrasnaustrian|
+% and |\extrasnswissgerman|, respectively, will perform all the extra
+% definitions needed for the German language or the respective
+% variety. The macro |\noextrasngerman| is used to cancel the
+% actions of |\extrasngerman|. |\noextrasnaustrian| and
+% |\noextrasnswissgerman| behave analoguously.
+%
+% First, the character \texttt{"} is declared active for all German
+% varieties. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% Depending on the option with which the language definition file
+% has been loaded, the macro |\extrasngerman|, |\extrasnaustrian|
+% or |\extrasnswissgerman| is defined. Each of those is identical:
+% they load the shorthands defined below and activate the \texttt{"}
+% character.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{ngerman}%
+}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+%
+% \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement boolean switch
+% \cs{ntosstrue}\slash\cs{ntossfalse} to customize \graph{\ss}-related
+% shorthands in Swiss German context.}
+% \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement modifier \Lopt{toss}
+% to customize \graph{\ss}-related shorthands in Swiss German context.}
+% \begin{macro}{toss}
+% \begin{macro}{\ntosstrue}
+% \begin{macro}{\ntossfalse}
+% For Swiss German, we allow optionally to expand the \graph{\ss}-related
+% shorthands the Swiss way, i.\,e. as \graph{ss} (globally, if the modifier \Lopt{toss}
+% is used or locally if |\ntosstrue|.).
+% \begin{macrocode}
+\newif\ifntoss\ntossfalse
+\newif\ifbbl@ntoss\bbl@ntossfalse
+\ifx\bbl@mod@nswissgerman\@undefined\else
+ \@expandtwoargs\in@{,toss,}{,\bbl@mod@nswissgerman,}
+ \ifin@
+ \ntosstrue
+ \fi
+ \addto\extrasnswissgerman{%
+ \ifntoss\bbl@ntosstrue\else\bbl@ntossfalse\fi}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Next, again depending on the option with which the language definition
+% file has been loaded, the macro |\noextrasngerman|, |\noextrasnaustrian|
+% or |\noextrasnswissgerman| is defined.
+% These deactivate the \texttt{"} character and thus turn the shorthands
+% off again outside of the respective variety.
+% \changes{Version 2.6j}{1999/12/16}{Deactivate shorthands outside of
+% German}
+% \changes{Version 2.7}{2013/12/13}{Deactivate shorthands also outside of
+% \Lopt{naustrian} and \Lopt{nswissgerman}.}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+\ifx\CurrentOption\bbl@opt@nswissgerman
+ \addto\noextrasnswissgerman{\bbl@ntossfalse}
+\fi
+% \end{macrocode}
+%
+%
+% In order for \TeX\ to be able to hyphenate German words which
+% contain `\ss' (in the \texttt{OT1} position |^^Y|) we have to
+% give the character a nonzero |\lccode| (see Appendix H, the \TeX
+% book).
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\lccode25}%
+ \lccode25=25}
+% \end{macrocode}
+%
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow}
+% \end{macrocode}
+% \changes{Version 2.7}{2013/12/13}{Do not use \cs{@namedef} when
+% \cs{noextras} is already defined and should not be overwritten.}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \umlauthigh}
+% \end{macrocode}
+% The current
+% version of the `new' German hyphenation patterns (\file{dehyphn.tex})
+% is to be used with |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{Version 2.6k}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% For German texts we need to assure that |\frenchspacing| is
+% turned on.
+% \changes{Version 2.6m}{2001/01/26}{Turn frenchspacing on, as in
+% \file{german.sty}}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Active characters, macros \& shorthands}
+%
+% The following code is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:german-quote}.
+%
+% In order to be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+%
+% \begin{macro}{\dq}
+% We save the original double quotation mark character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+%
+% Furthermore, we define some helper macros for contextual \graph{\ss} handling.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\dq{"}
+ \def\@SS{\mathchar"7019 }
+ \def\bbl@ss{\ifbbl@ntoss ss\else\textormath{\ss}{\@SS{}}\fi}
+ \def\bbl@SS{SS}
+ \def\bbl@sz{\ifbbl@ntoss sz\else\textormath{\ss}{\@SS{}}\fi}
+ \def\bbl@SZ{SZ}
+}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote shorthands: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"a}{\textormath{\"{a}\bbl@allowhyphens}{\ddot a}}
+\declare@shorthand{ngerman}{"o}{\textormath{\"{o}\bbl@allowhyphens}{\ddot o}}
+\declare@shorthand{ngerman}{"u}{\textormath{\"{u}\bbl@allowhyphens}{\ddot u}}
+\declare@shorthand{ngerman}{"A}{\textormath{\"{A}\bbl@allowhyphens}{\ddot A}}
+\declare@shorthand{ngerman}{"O}{\textormath{\"{O}\bbl@allowhyphens}{\ddot O}}
+\declare@shorthand{ngerman}{"U}{\textormath{\"{U}\bbl@allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremata,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{ngerman}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{ngerman}{"i}{\textormath{\"{\i}}%
+ {\ddot\imath}}
+\declare@shorthand{ngerman}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% German \ss{},
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"s}{\bbl@ss}
+\declare@shorthand{ngerman}{"S}{\bbl@SS}
+\declare@shorthand{ngerman}{"z}{\bbl@sz}
+\declare@shorthand{ngerman}{"Z}{\bbl@SZ}
+% \end{macrocode}
+% German and French/Swiss quotation marks,
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"`}{\glqq}
+\declare@shorthand{ngerman}{"'}{\grqq}
+\declare@shorthand{ngerman}{"<}{\flqq}
+\declare@shorthand{ngerman}{">}{\frqq}
+% \end{macrocode}
+% and some additional commands (hyphenation, line breaking and ligature control):
+% \changes{Version 2.9}{2016/11/02}{Add \texttt{"/} shortcut for breakable slash
+% (taken from \file{dutch.ldf})}
+% \changes{Version 2.9b=Version 2.11}{2018/12/08}{Fix old hyphenation regression introduced with \babel\ 3.7
+% (2002) in a number of shorthands (change of meaning of \cs{allowhyphens}
+% vs. \cs{bbl@allowhyphens})}
+% \begin{macrocode}
+\declare@shorthand{ngerman}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{ngerman}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{ngerman}{""}{\hskip\z@skip}
+\declare@shorthand{ngerman}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{ngerman}{"=}{\penalty\@M-\hskip\z@skip}
+\declare@shorthand{ngerman}{"/}{\textormath
+ {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+% \end{macrocode}
+% \iffalse
+%</ngermanb>
+% \fi
+%
+% \subsection{\file{naustrian.ldf}, \file{ngerman.ldf} and \file{nswissgerman.ldf}}
+%
+% \changes{Version 2.7}{2013/12/13}{Generate portmanteau files \file{naustrian.ldf},
+% \file{ngerman.ldf} and \file{nswissgerman.ldf}.}
+%
+% \Babel\ expects a \file{\langvar{}.ldf} file for each \langvar. So we create portmanteau
+% ldf files for \Lopt{naustrian}, \Lopt{ngerman} and \Lopt{nswissgerman}.\footnote{%
+% For \Lopt{naustrian} and \Lopt{ngerman}, this is not strictly necessary,
+% since \babel\ provides aliases for these languages (pointing to \Lopt{ngermanb}).
+% However, since \babel\ does not officially support these aliases anymore after
+% the language definition files have been separated from the core, we provide
+% the whole range of ldf files for the sake of completeness.} These files themselves
+% only load \file{ngermanb.ldf}, which does the real work:
+%
+% \iffalse
+%<*naustrian|ngerman|nswissgerman>
+% \fi
+% \begin{macrocode}
+\input ngermanb.ldf\relax
+% \end{macrocode}
+% \iffalse
+%</naustrian|ngerman|nswissgerman>
+% \fi
+%
+%\PrintChanges
+%
+% \begin{thebibliography}{9}
+% \bibitem{vwb} Ammon, Ulrich et al.:
+% \emph{Variantenw\"orterbuch des Deutschen. Die Standardsprache in \"Osterreich, der Schweiz
+% und Deutschland sowie in Liechtenstein, Luxemburg, Ostbelgien und S\"udtirol.}
+% Berlin, New York: De Gruyter.
+% \bibitem{babel} Braams, Johannes and Bezos, Javier:
+% \emph{Babel}.
+% \url{http://www.ctan.org/pkg/babel}.
+% \bibitem{exptl} Deutschsprachige Trennmustermannschaft:
+% \emph{dehyph-exptl -- Experimental hyphenation patterns for the German language}.
+% \url{https://ctan.org/pkg/dehyph-exptl}.
+% \bibitem{hyphsubst} Heiko Oberdiek:
+% \emph{hyphsubst -- Substitute hyphenation patterns}.
+% \url{https://ctan.org/pkg/hyphsubst}.
+% \bibitem{HP} Partl, Hubert:
+% \emph{German \TeX}, \emph{TUGboat} 9/1 (1988), p.~70--72.
+% \bibitem{hyph-utf8} Manuel P\'egouri\'e-Gonnard et al.:
+% \emph{hyph-utf8 -- Hyphenation patterns expressed in UTF-8}.
+% \url{https://ctan.org/pkg/hyph-utf8}.
+% \bibitem{gerdoc} Raichle, Bernd:
+% \emph{German}.
+% \url{http://www.ctan.org/pkg/german}.
+% \end{thebibliography}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/german/ngermanb.pdf b/macros/latex/contrib/babel-contrib/german/ngermanb.pdf
new file mode 100644
index 0000000000..1bb41c513d
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/german/ngermanb.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/README b/macros/latex/contrib/babel-contrib/greek/README
new file mode 100644
index 0000000000..86678690a9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/README
@@ -0,0 +1,248 @@
+babel-greek
+***********
+Babel support for the Greek language and script
+===============================================
+
+:Copyright: © 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms,
+ © 2013 Günter Milde
+:Licence: This work may be distributed and/or modified under the
+ conditions of the `LaTeX Project Public License`_, either
+ version 1.3 of this license or any later version.
+
+:Abstract: Babel-greek is a contributed package providing support for the
+ Greek language and script via the Babel_ system.
+
+ The file ``greek.ldf`` provides options for the monotonic
+ (single-diacritic), polytonic (multiple-diacritic) and ancient
+ orthography of the Greek language.
+
+ Since 2013-07-19, babel-greek supports also Unicode-aware TeX
+ engines (XeTeX/LuaTeX).
+
+News
+----
+
+.. class:: borderless
+
+===== ============ ============================================================
+1.4 2013-05-17 New maintainer.
+.. The encoding definition file ``lgrenc.def`` moved to the
+ greek-fontenc_ package.
+
+1.5 2013-06-21 bugfixes and cleanup,
+.. LICR macros in string definitions,
+.. LGR font encoding not used with XeTeX/LuaTeX,
+.. input "xgreek-fixes.def" from polyglossia_ with Xe/LuaTeX.
+1.5a 2013-07-02 Fix LaTeX bugs babel/3707, `babel/4303`_ and `babel/4305`_
+1.6 2013-07-19 Experimental support for XeTeX/LuaTeX.
+1.7 2013-09-09 CB-Fonts font definition files moved to CB-Fonts package.
+.. Do not auto-load euenc.def with XeTeX/LuaTeX.
+1.7a 2013-09-13 Fix bug `babel/4360`_: spurious ``\fi``.
+1.7b 2013-10-01 bugfix: correct upcasing of babel strings with Xe/LuaTeX.
+1.8 2013-12-02 Rename ``greek.dtx`` to ``babel-greek`` so that texdoc_
+ shows the right documentation.
+.. Compatibility with Xe/LuaTeX in Unicode and 8-bit mode.
+1.8a 2013-12-03 Set ``\encodingdefault`` in ``\greekscript`` to fix
+ Greek in footnotes etc. with document language Greek.
+1.9 2014-07-20 Added attribute for ancient Greek, load correct hyphenation
+ patterns: Patch by Claudio Beccari. Bugfix for Makeuppercase
+1.9a 2014-09-12 Remove duplicate code, documentation review.
+1.9b 2014-09-18 Remove spurious whitespace from "extrasgreek" definition.
+.. Use named macros instead of non-standard short macros
+ for psili and dasia in the string definitions.
+1.9c 2014-10-21 Fix dummy hyphenation language names (patch Ulrike Fischer).
+1.9d 2015-09-04 Remove `grsymb` (macros for Greek symbols).
+ This package is outdated and obsoleted by greek-fontenc_
+ (reported by Claudio Beccari).
+.. Unicode uc/lc corrections now in greek-fontenc
+ (polyglossia's ``xgreek-fixes.def`` has bugs).
+1.9e 2015-11-27 Fix bug in lccode-setting loop (patch by Enrico Gregorio).
+1.9f 2016-02-04 Support for standard Unicode text font encoding "TU"
+ (new in fontspec v2.5a).
+1.9g 2016-09-07 Babel 3.9i deprecated ``\textlatin``
+ and fixed ``\latinencoding``.
+1.9.h 2019-07-11 Move breathing composite commands to textalpha_.
+===== ============ ============================================================
+
+
+.. _babel/4303: http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4303
+.. _babel/4305: http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4305
+.. _babel/4360: http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4360
+
+Files
+-----
+
+`<babel-greek.ins>`_; `<babel-greek.pdf>`_
+ Source of the language definition file ``greek.ldf`` for use with Babel_.
+`<athnum.dtx>`_; `<athnum.pdf>`_
+ Athenian Numerals.
+`<grmath.dtx>`_; `<grmath.pdf>`_
+ Greek log-like Operators.
+`<test-greek.pdf>`_; `<test-greek.tex>`_
+ Tests and Examples for 8-bit TeX.
+`<test-unicode-greek.pdf>`_; `<test-unicode-greek.tex>`_
+ Tests and Examples for XeTeX/LuaTeX.
+`<test-unicode-lgr.pdf>`_; `<test-unicode-lgr.tex>`_
+ Tests and Examples for XeTeX/LuaTeX with LGR 8-bit fonts.
+
+`<usage.pdf>`_; `<usage.tex>`_
+ Description of the `LGR Latin transliteration`_.
+
+
+
+Requirements
+------------
+
+The "babel-greek" package requires the babel_ base package and font
+definition files from the greek-fontenc_ package. The greek-inputenc_
+package is recommended when using 8-bit TeX engines.
+
+Typesetting Greek texts requires `Greek text fonts`_.
+
+Plain TeX is currently not supported. Patches are welcome.
+
+
+Installation
+------------
+
+If possible, get this package from your distribution using its installation
+manager.
+
+Otherwise, make sure LaTeX can find the required files:
+
+* Download and unpack `babel-greek.zip`.
+
+* Run ``tex`` or ``latex`` on the batch file ``babel-greek.ins``.
+
+ This will generate the files ``greek.ldf``, ``athnum.sty``, and
+ ``grmath.sty`` in the current directory. [#]_
+
+* Move all files ending in ``.ldf`` or ``.sty`` into a directory searched by
+ TeX.
+
+* To produce the documentation, run the file ``usage.tex`` and all files
+ ending in ``.dtx`` through LaTeX.
+
+.. [#] If these files already exist somewhere in the TeX-path, you will be
+ warned that they might be overwritten. You can ignore this
+ warning and answer `y` unless the *current directory* contains versions
+ of these files you want to keep.
+
+ This is done by docstrip_. Try ``texdoc docstrip`` for details.
+
+Usage
+-----
+
+Use the "greek" document option or pass the "greek" option to babel::
+
+ \usepackage[greek]{babel}
+
+For polytonic Greek, set the language attribute "polutoniko"::
+
+ \usepackage[greek]{babel}
+ \languageattribute{greek}{polutoniko}
+
+or ::
+
+ \usepackage[greek.polutoniko,english]{babel}
+
+Similarly, the attribute "ancient" selects the ancient Greek language
+variant.
+
+For details see `<babel-greek.pdf>`_ and the babel_ documentation.
+
+With XeTeX/LuaTeX, load fontspec_ before babel_, so that babel-greek can
+set up the Unicode font encoding for use with Greek, e.g. ::
+
+ \usepackage{fontspec}
+ \setmainfont{Linux Libertine O}
+ \setsansfont{Linux Biolinum O}
+ \usepackage[greek,english]{babel}
+
+Note, that the default font used with XeTeX/LuaTeX (Latin Modern) misses most
+Greek letters. Warnings about missing charcters are only written to the log
+file, not the console output!
+
+
+Input of Greek characters is possible as literal characters (with the
+greek-inputenc_ package or with XeTeX or LuaTeX) or the `LGR Latin
+transliteration`_. See `<usage.pdf>`_ and the example files provided with
+greek-fontenc_.
+
+Greek text fonts
+----------------
+
+A list of Greek text fonts for use with LaTeX is available at the CTAN
+http://www.ctan.org/topic/font-greek
+
+With the XeTeX or LuaTeX engines, the user should ensure that the chosen
+font contains the required glyphs (the default Latin Modern fonts miss
+them). Examples for suitable fonts are the CM-unicode_ or the `Linux
+Libertine`_ OpenType fonts as well as any system-wide installed OTF fonts
+that support Greek (e.g. `Deja Vu`_).
+
+The LGR `font encoding`_ is the de-facto standard for typesetting Greek with
+8-bit LaTeX. Fonts in this encoding include the `CB fonts`_ (matching CM),
+grtimes_ (Greek Times), Kerkis_ (matching URW Bookman), and the `GFS font
+collection`_. Setup of these fonts as Greek variant to matching Latin fonts
+is facilitated by the substitutefont_ package.
+
+LGR Latin Transliteration
+-------------------------
+
+The LGR font encoding allows input of Greek characters via an ASCII
+transliteration. This enables simple input with a Latin keyboard. Characters
+with diacritics may be selected with accent macros (cf. greek-fontenc_) or
+via the ligature definitions in the font (see `<usage.pdf>`_).
+
+The following ASCII characters are converted to Greek symbols:
+
+= = = = = = = = = = = = = = = = = = = = = = = = =
+A B G D E Z H J I K L M N X O P R S T U F Q Y W
+Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω
+a b g d e z h j i k l m n x o p r s c t u f q y w
+α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω
+= = = = = = = = = = = = = = = = = = = = = = = = =
+
+Accent symbols and punctuation:
+
+================= ===== == ====================== ======== ====
+tonos ``'`` ά semicolon ``;`` ·
+varia \` ὰ question mark ``?`` ;
+perispomeni ``~`` ᾶ left apostrophe \` \` ‘
+dasia ``<`` ἁ right apostrophe ``''`` ’
+psili ``>`` ἀ left quotation mark ``((`` «
+ypogegrammeni ``|`` ᾳ right quotation mark ``))`` »
+dialytika ``"`` ϊ zero width non-joiner v
+================= ===== == ====================== ======== ====
+
+A major drawback of the LGR transliteration is that you cannot access Latin
+letters and some symbols if LGR is the active font encoding (e.g. in
+documents or parts of documents given the `Babel` language ``greek``). This
+means that for every Latin-written word or acronym an explicit
+language-switch is required. This problem can only be solved via a
+font-encoding comprising both Latin and Greek like the hypothetical T7 or
+Unicode (with XeTeX or LuaTeX).
+
+.. References
+ ----------
+
+.. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
+.. _babel: http://www.ctan.org/pkg/babel
+.. _docstrip: http://www.ctan.org/pkg/docstrip
+.. _font encoding: http://mirror.ctan.org/macros/latex/doc/encguide.pdf
+.. _fontspec: http://www.ctan.org/pkg/fontspec
+.. _CB Fonts: http://www.ctan.org/pkg/cbgreek-complete
+.. _CM-unicode: http://www.ctan.org/pkg/cm-unicode
+.. _Deja Vu: http://dejavu-fonts.org
+.. _e-TeX: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=etex
+.. _grtimes: http://www.ctan.org/pkg/grtimes
+.. _textalpha:
+.. _greek-fontenc: http://www.ctan.org/pkg/greek-fontenc
+.. _greek-inputenc: http://www.ctan.org/pkg/greek-inputenc
+.. _GFS font collection: http://www.ctan.org/pkg/gfs
+.. _Kerkis: http://www.ctan.org/pkg/kerkis
+.. _Linux Libertine: http://www.ctan.org/pkg/libertine
+.. _polyglossia: http://www.ctan.org/pkg/polyglossia
+.. _substitutefont: http://www.ctan.org/pkg/substitutefont
+.. _texdoc: http://www.ctan.org/pkg/texdoc
diff --git a/macros/latex/contrib/babel-contrib/greek/README.html b/macros/latex/contrib/babel-contrib/greek/README.html
new file mode 100644
index 0000000000..5eb279899e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/README.html
@@ -0,0 +1,1036 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta charset="utf-8"/>
+<meta name="generator" content="Docutils 0.15b.dev: http://docutils.sourceforge.net/" />
+<title>babel-greek</title>
+<meta name="dcterms.rights" content="© 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms, © 2013 Günter Milde" />
+<link rel="schema.dcterms" href="http://purl.org/dc/terms/">
+<style type="text/css">
+
+/* Minimal style sheet for the HTML output of Docutils. */
+/* */
+/* :Author: Günter Milde, based on html4css1.css by David Goodger */
+/* :Id: $Id$ */
+/* :Copyright: © 2015 Günter Milde. */
+/* :License: Released under the terms of the `2-Clause BSD license`_, */
+/* in short: */
+/* */
+/* Copying and distribution of this file, with or without modification, */
+/* are permitted in any medium without royalty provided the copyright */
+/* notice and this notice are preserved. */
+/* */
+/* This file is offered as-is, without any warranty. */
+/* */
+/* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
+
+/* This CSS2.1_ stylesheet defines rules for Docutils elements without */
+/* HTML equivalent. It is required to make the document semantic visible. */
+/* */
+/* .. _CSS2.1: http://www.w3.org/TR/CSS2 */
+/* .. _validates: http://jigsaw.w3.org/css-validator/validator$link */
+
+/* alignment of text and inline objects inside block objects*/
+.align-left { text-align: left; }
+.align-right { text-align: right; }
+.align-center { clear: both; text-align: center; }
+.align-top { vertical-align: top; }
+.align-middle { vertical-align: middle; }
+.align-bottom { vertical-align: bottom; }
+
+/* titles */
+h1.title, p.subtitle {
+ text-align: center;
+}
+p.admonition-title,
+p.topic-title,
+p.sidebar-title,
+p.rubric,
+p.system-message-title {
+ font-weight: bold;
+}
+h1 + p.subtitle,
+h1 + p.section-subtitle {
+ font-size: 1.6em;
+}
+h2 + p.section-subtitle { font-size: 1.28em; }
+p.subtitle,
+p.section-subtitle,
+p.sidebar-subtitle {
+ font-weight: bold;
+ margin-top: -0.5em;
+}
+p.sidebar-title,
+p.rubric {
+ font-size: larger;
+}
+p.rubric { color: maroon; }
+a.toc-backref {
+ color: black;
+ text-decoration: none; }
+
+/* Warnings, Errors */
+div.caution p.admonition-title,
+div.attention p.admonition-title,
+div.danger p.admonition-title,
+div.error p.admonition-title,
+div.warning p.admonition-title,
+div.system-messages h1,
+div.error,
+span.problematic,
+p.system-message-title {
+ color: red;
+}
+
+/* inline literals */
+span.docutils.literal {
+ font-family: monospace;
+ white-space: pre-wrap;
+}
+/* do not wraph at hyphens and similar: */
+.literal > span.pre { white-space: nowrap; }
+
+/* Lists */
+
+/* compact and simple lists: no margin between items */
+.simple li, .compact li,
+.simple ul, .compact ul,
+.simple ol, .compact ol,
+.simple > li p, .compact > li p,
+dl.simple > dd, dl.compact > dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+/* Table of Contents */
+div.topic.contents { margin: 0; }
+div.topic.contents ul {
+ list-style-type: none;
+ padding-left: 1.5em;
+}
+
+/* Enumerated Lists */
+ol.arabic { list-style: decimal }
+ol.loweralpha { list-style: lower-alpha }
+ol.upperalpha { list-style: upper-alpha }
+ol.lowerroman { list-style: lower-roman }
+ol.upperroman { list-style: upper-roman }
+
+dt span.classifier { font-style: italic }
+dt span.classifier:before {
+ font-style: normal;
+ margin: 0.5em;
+ content: ":";
+}
+
+/* Field Lists and drivatives */
+/* bold field name, content starts on the same line */
+dl.field-list > dt,
+dl.option-list > dt,
+dl.docinfo > dt,
+dl.footnote > dt,
+dl.citation > dt {
+ font-weight: bold;
+ clear: left;
+ float: left;
+ margin: 0;
+ padding: 0;
+ padding-right: 0.5em;
+}
+/* Offset for field content (corresponds to the --field-name-limit option) */
+dl.field-list > dd,
+dl.option-list > dd,
+dl.docinfo > dd {
+ margin-left: 9em; /* ca. 14 chars in the test examples */
+}
+/* start field-body on a new line after long field names */
+dl.field-list > dd > *:first-child,
+dl.option-list > dd > *:first-child
+{
+ display: inline-block;
+ width: 100%;
+ margin: 0;
+}
+/* field names followed by a colon */
+dl.field-list > dt:after,
+dl.docinfo > dt:after {
+ content: ":";
+}
+
+/* Bibliographic Fields (docinfo) */
+pre.address { font: inherit; }
+dd.authors > p { margin: 0; }
+
+/* Option Lists */
+dl.option-list { margin-left: 40px; }
+dl.option-list > dt { font-weight: normal; }
+span.option { white-space: nowrap; }
+
+/* Footnotes and Citations */
+dl.footnote.superscript > dd {margin-left: 1em; }
+dl.footnote.brackets > dd {margin-left: 2em; }
+dl > dt.label { font-weight: normal; }
+a.footnote-reference.brackets:before,
+dt.label > span.brackets:before { content: "["; }
+a.footnote-reference.brackets:after,
+dt.label > span.brackets:after { content: "]"; }
+a.footnote-reference.superscript,
+dl.footnote.superscript > dt.label {
+ vertical-align: super;
+ font-size: smaller;
+}
+dt.label > span.fn-backref { margin-left: 0.2em; }
+dt.label > span.fn-backref > a { font-style: italic; }
+
+/* Line Blocks */
+div.line-block { display: block; }
+div.line-block div.line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 40px;
+}
+
+/* Figures, Images, and Tables */
+.figure.align-left,
+img.align-left,
+object.align-left,
+table.align-left {
+ margin-right: auto;
+}
+.figure.align-center,
+img.align-center,
+object.align-center {
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+}
+table.align-center {
+ margin-left: auto;
+ margin-right: auto;
+}
+.figure.align-right,
+img.align-right,
+object.align-right,
+table.align-right {
+ margin-left: auto;
+}
+/* reset inner alignment in figures and tables */
+/* div.align-left, div.align-center, div.align-right, */
+table.align-left, table.align-center, table.align-right
+{ text-align: inherit }
+
+/* Admonitions and System Messages */
+div.admonition,
+div.system-message,
+div.sidebar{
+ margin: 40px;
+ border: medium outset;
+ padding-right: 1em;
+ padding-left: 1em;
+}
+
+/* Sidebar */
+div.sidebar {
+ width: 30%;
+ max-width: 26em;
+ float: right;
+ clear: right;
+}
+
+/* Text Blocks */
+blockquote,
+div.topic,
+pre.literal-block,
+pre.doctest-block,
+pre.math,
+pre.code {
+ margin-left: 1.5em;
+ margin-right: 1.5em
+}
+pre.code .ln { color: gray; } /* line numbers */
+
+/* Tables */
+table { border-collapse: collapse; }
+td, th {
+ border-style: solid;
+ border-color: silver;
+ padding: 0 1ex;
+ border-width: thin;
+}
+td > p:first-child, th > p:first-child { margin-top: 0; }
+td > p, th > p { margin-bottom: 0; }
+
+table > caption {
+ text-align: left;
+ margin-bottom: 0.25em
+}
+
+table.borderless td, table.borderless th {
+ border: 0;
+ padding: 0;
+ padding-right: 0.5em /* separate table cells */
+}
+
+</style>
+<style type="text/css">
+
+/* CSS31_ style sheet for the output of Docutils HTML writers. */
+/* Rules for easy reading and pre-defined style variants. */
+/* */
+/* :Author: Günter Milde, based on html4css1.css by David Goodger */
+/* :Id: $Id$ */
+/* :Copyright: © 2015 Günter Milde. */
+/* :License: Released under the terms of the `2-Clause BSD license`_, */
+/* in short: */
+/* */
+/* Copying and distribution of this file, with or without modification, */
+/* are permitted in any medium without royalty provided the copyright */
+/* notice and this notice are preserved. */
+/* */
+/* This file is offered as-is, without any warranty. */
+/* */
+/* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
+/* .. _CSS3: http://www.w3.org/TR/CSS3 */
+
+
+/* Document Structure */
+/* ****************** */
+
+/* "page layout" */
+body {
+ margin: 0;
+ background-color: #dbdbdb;
+}
+div.document {
+ line-height:1.3;
+ counter-reset: table;
+ /* counter-reset: figure; */
+ /* avoid long lines --> better reading */
+ /* OTOH: lines should not be too short because of missing hyphenation, */
+ max-width: 50em;
+ padding: 1px 2%; /* 1px on top avoids grey bar above title (mozilla) */
+ margin: auto;
+ background-color: white;
+}
+
+/* Sections */
+
+/* Transitions */
+
+hr.docutils {
+ width: 80%;
+ margin-top: 1em;
+ margin-bottom: 1em;
+ clear: both;
+}
+
+/* Paragraphs */
+/* ========== */
+
+/* vertical space (parskip) */
+p, ol, ul, dl,
+div.line-block,
+table{
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+h1, h2, h3, h4, h5, h6,
+dl > dd {
+ margin-bottom: 0.5em;
+}
+
+/* Lists */
+/* ========== */
+
+/* Definition Lists */
+
+dl > dd > p:first-child { margin-top: 0; }
+/* :last-child is not part of CSS 2.1 (introduced in CSS 3) */
+dl > dd > p:last-child { margin-bottom: 0; }
+
+/* lists nested in definition lists */
+/* :only-child is not part of CSS 2.1 (introduced in CSS 3) */
+dd > ul:only-child, dd > ol:only-child { padding-left: 1em; }
+
+/* Description Lists */
+/* styled like in most dictionaries, encyclopedias etc. */
+dl.description > dt {
+ font-weight: bold;
+ clear: left;
+ float: left;
+ margin: 0;
+ padding: 0;
+ padding-right: 0.5em;
+}
+
+/* Field Lists */
+
+/* example for custom field-name width */
+dl.field-list.narrow > dd {
+ margin-left: 5em;
+}
+/* run-in: start field-body on same line after long field names */
+dl.field-list.run-in > dd p {
+ display: block;
+}
+
+/* Bibliographic Fields */
+
+/* generally, bibliographic fields use special definition list dl.docinfo */
+/* but dedication and abstract are placed into "topic" divs */
+div.abstract p.topic-title {
+ text-align: center;
+}
+div.dedication {
+ margin: 2em 5em;
+ text-align: center;
+ font-style: italic;
+}
+div.dedication p.topic-title {
+ font-style: normal;
+}
+
+/* Citations */
+dl.citation dt.label {
+ font-weight: bold;
+}
+span.fn-backref {
+ font-weight: normal;
+}
+
+/* Text Blocks */
+/* ============ */
+
+/* Literal Blocks */
+
+/* Block Quotes */
+
+blockquote > table,
+div.topic > table {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+blockquote p.attribution,
+div.topic p.attribution {
+ text-align: right;
+ margin-left: 20%;
+}
+
+/* Tables */
+/* ====== */
+
+/* th { vertical-align: bottom; } */
+
+table tr { text-align: left; }
+
+/* "booktabs" style (no vertical lines) */
+table.booktabs {
+ border: 0;
+ border-top: 2px solid;
+ border-bottom: 2px solid;
+ border-collapse: collapse;
+}
+table.booktabs * {
+ border: 0;
+}
+table.booktabs th {
+ border-bottom: thin solid;
+}
+
+/* numbered tables (counter defined in div.document) */
+table.numbered > caption:before {
+ counter-increment: table;
+ content: "Table " counter(table) ": ";
+ font-weight: bold;
+}
+
+/* Explicit Markup Blocks */
+/* ====================== */
+
+/* Footnotes and Citations */
+/* ----------------------- */
+
+/* line on the left */
+dl.footnote {
+ padding-left: 1ex;
+ border-left: solid;
+ border-left-width: thin;
+}
+
+/* Directives */
+/* ---------- */
+
+/* Body Elements */
+/* ~~~~~~~~~~~~~ */
+
+/* Images and Figures */
+
+/* let content flow to the side of aligned images and figures */
+.figure.align-left,
+img.align-left,
+object.align-left {
+ display: block;
+ clear: left;
+ float: left;
+ margin-right: 1em
+}
+.figure.align-right,
+img.align-right,
+object.align-right {
+ display: block;
+ clear: right;
+ float: right;
+ margin-left: 1em
+}
+/* Stop floating sidebars, images and figures at section level 1,2,3 */
+h1, h2, h3 { clear: both; }
+
+/* Sidebar */
+
+/* Move into the margin. In a layout with fixed margins, */
+/* it can be moved into the margin completely. */
+div.sidebar {
+ width: 30%;
+ max-width: 26em;
+ margin-left: 1em;
+ margin-right: -5.5%;
+ background-color: #ffffee ;
+}
+
+/* Code */
+
+pre.code { padding: 0.7ex }
+pre.code, code { background-color: #eeeeee }
+pre.code .ln { color: gray; } /* line numbers */
+/* basic highlighting: for a complete scheme, see */
+/* http://docutils.sourceforge.net/sandbox/stylesheets/ */
+pre.code .comment, code .comment { color: #5C6576 }
+pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
+pre.code .literal.string, code .literal.string { color: #0C5404 }
+pre.code .name.builtin, code .name.builtin { color: #352B84 }
+pre.code .deleted, code .deleted { background-color: #DEB0A1}
+pre.code .inserted, code .inserted { background-color: #A3D289}
+
+/* Math */
+/* styled separately (see math.css for math-output=HTML) */
+
+/* Epigraph */
+/* Highlights */
+/* Pull-Quote */
+/* Compound Paragraph */
+/* Container */
+
+/* can be styled in a custom stylesheet */
+
+/* Document Header and Footer */
+
+div.footer, div.header {
+ clear: both;
+ font-size: smaller;
+}
+
+/* Inline Markup */
+/* ============= */
+
+/* Emphasis */
+/* em */
+/* Strong Emphasis */
+/* strong */
+/* Interpreted Text */
+/* span.interpreted */
+/* Title Reference */
+/* cite */
+/* Inline Literals */
+/* possible values: normal, nowrap, pre, pre-wrap, pre-line */
+/* span.docutils.literal { white-space: pre-wrap; } */
+
+/* Hyperlink References */
+a { text-decoration: none; }
+
+/* External Targets */
+/* span.target.external */
+/* Internal Targets */
+/* span.target.internal */
+/* Footnote References */
+/* a.footnote-reference */
+/* Citation References */
+/* a.citation-reference */
+
+</style>
+</head>
+<body>
+<div class="document" id="babel-greek">
+<h1 class="title">babel-greek</h1>
+<p class="subtitle" id="babel-support-for-the-greek-language-and-script">Babel support for the Greek language and script</p>
+<dl class="docinfo simple">
+<dt class="copyright">Copyright</dt>
+<dd class="copyright">© 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms,
+© 2013 Günter Milde</dd>
+<dt class="licence">Licence</dt>
+<dd class="licence"><p>This work may be distributed and/or modified under the
+conditions of the <a class="reference external" href="http://www.latex-project.org/lppl.txt">LaTeX Project Public License</a>, either
+version 1.3 of this license or any later version.</p>
+</dd>
+</dl>
+<div class="abstract topic">
+<p class="topic-title first">Abstract</p>
+<p>Babel-greek is a contributed package providing support for the
+Greek language and script via the <a class="reference external" href="http://www.ctan.org/pkg/babel">Babel</a> system.</p>
+<p>The file <span class="docutils literal">greek.ldf</span> provides options for the monotonic
+(single-diacritic), polytonic (multiple-diacritic) and ancient
+orthography of the Greek language.</p>
+<p>Since 2013-07-19, babel-greek supports also Unicode-aware TeX
+engines (XeTeX/LuaTeX).</p>
+</div>
+<div class="section" id="news">
+<h1>News</h1>
+<table class="borderless">
+<colgroup>
+<col style="width: 6%" />
+<col style="width: 16%" />
+<col style="width: 78%" />
+</colgroup>
+<tbody>
+<tr><td><p>1.4</p></td>
+<td><p>2013-05-17</p></td>
+<td><p>New maintainer.</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>The encoding definition file <span class="docutils literal">lgrenc.def</span> moved to the
+<a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">greek-fontenc</a> package.</p></td>
+</tr>
+<tr><td><p>1.5</p></td>
+<td><p>2013-06-21</p></td>
+<td><p>bugfixes and cleanup,</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>LICR macros in string definitions,</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>LGR font encoding not used with XeTeX/LuaTeX,</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>input “xgreek-fixes.def” from <a class="reference external" href="http://www.ctan.org/pkg/polyglossia">polyglossia</a> with Xe/LuaTeX.</p></td>
+</tr>
+<tr><td><p>1.5a</p></td>
+<td><p>2013-07-02</p></td>
+<td><p>Fix LaTeX bugs babel/3707, <a class="reference external" href="http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4303">babel/4303</a> and <a class="reference external" href="http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4305">babel/4305</a></p></td>
+</tr>
+<tr><td><p>1.6</p></td>
+<td><p>2013-07-19</p></td>
+<td><p>Experimental support for XeTeX/LuaTeX.</p></td>
+</tr>
+<tr><td><p>1.7</p></td>
+<td><p>2013-09-09</p></td>
+<td><p>CB-Fonts font definition files moved to CB-Fonts package.</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>Do not auto-load euenc.def with XeTeX/LuaTeX.</p></td>
+</tr>
+<tr><td><p>1.7a</p></td>
+<td><p>2013-09-13</p></td>
+<td><p>Fix bug <a class="reference external" href="http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4360">babel/4360</a>: spurious <span class="docutils literal">\fi</span>.</p></td>
+</tr>
+<tr><td><p>1.7b</p></td>
+<td><p>2013-10-01</p></td>
+<td><p>bugfix: correct upcasing of babel strings with Xe/LuaTeX.</p></td>
+</tr>
+<tr><td><p>1.8</p></td>
+<td><p>2013-12-02</p></td>
+<td><p>Rename <span class="docutils literal">greek.dtx</span> to <span class="docutils literal"><span class="pre">babel-greek</span></span> so that <a class="reference external" href="http://www.ctan.org/pkg/texdoc">texdoc</a>
+shows the right documentation.</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>Compatibility with Xe/LuaTeX in Unicode and 8-bit mode.</p></td>
+</tr>
+<tr><td><p>1.8a</p></td>
+<td><p>2013-12-03</p></td>
+<td><p>Set <span class="docutils literal">\encodingdefault</span> in <span class="docutils literal">\greekscript</span> to fix
+Greek in footnotes etc. with document language Greek.</p></td>
+</tr>
+<tr><td><p>1.9</p></td>
+<td><p>2014-07-20</p></td>
+<td><p>Added attribute for ancient Greek, load correct hyphenation
+patterns: Patch by Claudio Beccari. Bugfix for Makeuppercase</p></td>
+</tr>
+<tr><td><p>1.9a</p></td>
+<td><p>2014-09-12</p></td>
+<td><p>Remove duplicate code, documentation review.</p></td>
+</tr>
+<tr><td><p>1.9b</p></td>
+<td><p>2014-09-18</p></td>
+<td><p>Remove spurious whitespace from “extrasgreek” definition.</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>Use named macros instead of non-standard short macros
+for psili and dasia in the string definitions.</p></td>
+</tr>
+<tr><td><p>1.9c</p></td>
+<td><p>2014-10-21</p></td>
+<td><p>Fix dummy hyphenation language names (patch Ulrike Fischer).</p></td>
+</tr>
+<tr><td><p>1.9d</p></td>
+<td><p>2015-09-04</p></td>
+<td><p>Remove <cite>grsymb</cite> (macros for Greek symbols).
+This package is outdated and obsoleted by <a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">greek-fontenc</a>
+(reported by Claudio Beccari).</p></td>
+</tr>
+<tr><td><!-- -->
+</td>
+<td></td>
+<td><p>Unicode uc/lc corrections now in greek-fontenc
+(polyglossia’s <span class="docutils literal"><span class="pre">xgreek-fixes.def</span></span> has bugs).</p></td>
+</tr>
+<tr><td><p>1.9e</p></td>
+<td><p>2015-11-27</p></td>
+<td><p>Fix bug in lccode-setting loop (patch by Enrico Gregorio).</p></td>
+</tr>
+<tr><td><p>1.9f</p></td>
+<td><p>2016-02-04</p></td>
+<td><p>Support for standard Unicode text font encoding “TU”
+(new in fontspec v2.5a).</p></td>
+</tr>
+<tr><td><p>1.9g</p></td>
+<td><p>2016-09-07</p></td>
+<td><p>Babel 3.9i deprecated <span class="docutils literal">\textlatin</span>
+and fixed <span class="docutils literal">\latinencoding</span>.</p></td>
+</tr>
+<tr><td><p>1.9.h</p></td>
+<td><p>2019-07-11</p></td>
+<td><p>Move breathing composite commands to <a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">textalpha</a>.</p></td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="section" id="files">
+<h1>Files</h1>
+<dl class="simple">
+<dt><a class="reference external" href="babel-greek.ins">babel-greek.ins</a>; <a class="reference external" href="babel-greek.pdf">babel-greek.pdf</a></dt>
+<dd><p>Source of the language definition file <span class="docutils literal">greek.ldf</span> for use with <a class="reference external" href="http://www.ctan.org/pkg/babel">Babel</a>.</p>
+</dd>
+<dt><a class="reference external" href="athnum.dtx">athnum.dtx</a>; <a class="reference external" href="athnum.pdf">athnum.pdf</a></dt>
+<dd><p>Athenian Numerals.</p>
+</dd>
+<dt><a class="reference external" href="grmath.dtx">grmath.dtx</a>; <a class="reference external" href="grmath.pdf">grmath.pdf</a></dt>
+<dd><p>Greek log-like Operators.</p>
+</dd>
+<dt><a class="reference external" href="test-greek.pdf">test-greek.pdf</a>; <a class="reference external" href="test-greek.tex">test-greek.tex</a></dt>
+<dd><p>Tests and Examples for 8-bit TeX.</p>
+</dd>
+<dt><a class="reference external" href="test-unicode-greek.pdf">test-unicode-greek.pdf</a>; <a class="reference external" href="test-unicode-greek.tex">test-unicode-greek.tex</a></dt>
+<dd><p>Tests and Examples for XeTeX/LuaTeX.</p>
+</dd>
+<dt><a class="reference external" href="test-unicode-lgr.pdf">test-unicode-lgr.pdf</a>; <a class="reference external" href="test-unicode-lgr.tex">test-unicode-lgr.tex</a></dt>
+<dd><p>Tests and Examples for XeTeX/LuaTeX with LGR 8-bit fonts.</p>
+</dd>
+<dt><a class="reference external" href="usage.pdf">usage.pdf</a>; <a class="reference external" href="usage.tex">usage.tex</a></dt>
+<dd><p>Description of the <a class="reference internal" href="#lgr-latin-transliteration">LGR Latin transliteration</a>.</p>
+</dd>
+</dl>
+</div>
+<div class="section" id="requirements">
+<h1>Requirements</h1>
+<p>The “babel-greek” package requires the <a class="reference external" href="http://www.ctan.org/pkg/babel">babel</a> base package and font
+definition files from the <a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">greek-fontenc</a> package. The <a class="reference external" href="http://www.ctan.org/pkg/greek-inputenc">greek-inputenc</a>
+package is recommended when using 8-bit TeX engines.</p>
+<p>Typesetting Greek texts requires <a class="reference internal" href="#greek-text-fonts">Greek text fonts</a>.</p>
+<p>Plain TeX is currently not supported. Patches are welcome.</p>
+</div>
+<div class="section" id="installation">
+<h1>Installation</h1>
+<p>If possible, get this package from your distribution using its installation
+manager.</p>
+<p>Otherwise, make sure LaTeX can find the required files:</p>
+<ul>
+<li><p>Download and unpack <cite>babel-greek.zip</cite>.</p></li>
+<li><p>Run <span class="docutils literal">tex</span> or <span class="docutils literal">latex</span> on the batch file <span class="docutils literal"><span class="pre">babel-greek.ins</span></span>.</p>
+<p>This will generate the files <span class="docutils literal">greek.ldf</span>, <span class="docutils literal">athnum.sty</span>, and
+<span class="docutils literal">grmath.sty</span> in the current directory.<a class="footnote-reference superscript" href="#id2" id="id1">1</a></p>
+</li>
+<li><p>Move all files ending in <span class="docutils literal">.ldf</span> or <span class="docutils literal">.sty</span> into a directory searched by
+TeX.</p></li>
+<li><p>To produce the documentation, run the file <span class="docutils literal">usage.tex</span> and all files
+ending in <span class="docutils literal">.dtx</span> through LaTeX.</p></li>
+</ul>
+<dl class="footnote superscript">
+<dt class="label" id="id2"><span class="superscript"><a class="fn-backref" href="#id1">1</a></span></dt>
+<dd><p>If these files already exist somewhere in the TeX-path, you will be
+warned that they might be overwritten. You can ignore this
+warning and answer <cite>y</cite> unless the <em>current directory</em> contains versions
+of these files you want to keep.</p>
+<p>This is done by <a class="reference external" href="http://www.ctan.org/pkg/docstrip">docstrip</a>. Try <span class="docutils literal">texdoc docstrip</span> for details.</p>
+</dd>
+</dl>
+</div>
+<div class="section" id="usage">
+<h1>Usage</h1>
+<p>Use the “greek” document option or pass the “greek” option to babel:</p>
+<pre class="literal-block">\usepackage[greek]{babel}</pre>
+<p>For polytonic Greek, set the language attribute “polutoniko”:</p>
+<pre class="literal-block">\usepackage[greek]{babel}
+\languageattribute{greek}{polutoniko}</pre>
+<p>or</p>
+<pre class="literal-block">\usepackage[greek.polutoniko,english]{babel}</pre>
+<p>Similarly, the attribute “ancient” selects the ancient Greek language
+variant.</p>
+<p>For details see <a class="reference external" href="babel-greek.pdf">babel-greek.pdf</a> and the <a class="reference external" href="http://www.ctan.org/pkg/babel">babel</a> documentation.</p>
+<p>With XeTeX/LuaTeX, load <a class="reference external" href="http://www.ctan.org/pkg/fontspec">fontspec</a> before <a class="reference external" href="http://www.ctan.org/pkg/babel">babel</a>, so that babel-greek can
+set up the Unicode font encoding for use with Greek, e.g.</p>
+<pre class="literal-block">\usepackage{fontspec}
+\setmainfont{Linux Libertine O}
+\setsansfont{Linux Biolinum O}
+\usepackage[greek,english]{babel}</pre>
+<p>Note, that the default font used with XeTeX/LuaTeX (Latin Modern) misses most
+Greek letters. Warnings about missing charcters are only written to the log
+file, not the console output!</p>
+<p>Input of Greek characters is possible as literal characters (with the
+<a class="reference external" href="http://www.ctan.org/pkg/greek-inputenc">greek-inputenc</a> package or with XeTeX or LuaTeX) or the <a class="reference internal" href="#lgr-latin-transliteration">LGR Latin
+transliteration</a>. See <a class="reference external" href="usage.pdf">usage.pdf</a> and the example files provided with
+<a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">greek-fontenc</a>.</p>
+</div>
+<div class="section" id="greek-text-fonts">
+<h1>Greek text fonts</h1>
+<p>A list of Greek text fonts for use with LaTeX is available at the CTAN
+<a class="reference external" href="http://www.ctan.org/topic/font-greek">http://www.ctan.org/topic/font-greek</a></p>
+<p>With the XeTeX or LuaTeX engines, the user should ensure that the chosen
+font contains the required glyphs (the default Latin Modern fonts miss
+them). Examples for suitable fonts are the <a class="reference external" href="http://www.ctan.org/pkg/cm-unicode">CM-unicode</a> or the <a class="reference external" href="http://www.ctan.org/pkg/libertine">Linux
+Libertine</a> OpenType fonts as well as any system-wide installed OTF fonts
+that support Greek (e.g. <a class="reference external" href="http://dejavu-fonts.org">Deja Vu</a>).</p>
+<p>The LGR <a class="reference external" href="http://mirror.ctan.org/macros/latex/doc/encguide.pdf">font encoding</a> is the de-facto standard for typesetting Greek with
+8-bit LaTeX. Fonts in this encoding include the <a class="reference external" href="http://www.ctan.org/pkg/cbgreek-complete">CB fonts</a> (matching CM),
+<a class="reference external" href="http://www.ctan.org/pkg/grtimes">grtimes</a> (Greek Times), <a class="reference external" href="http://www.ctan.org/pkg/kerkis">Kerkis</a> (matching URW Bookman), and the <a class="reference external" href="http://www.ctan.org/pkg/gfs">GFS font
+collection</a>. Setup of these fonts as Greek variant to matching Latin fonts
+is facilitated by the <a class="reference external" href="http://www.ctan.org/pkg/substitutefont">substitutefont</a> package.</p>
+</div>
+<div class="section" id="lgr-latin-transliteration">
+<h1>LGR Latin Transliteration</h1>
+<p>The LGR font encoding allows input of Greek characters via an ASCII
+transliteration. This enables simple input with a Latin keyboard. Characters
+with diacritics may be selected with accent macros (cf. <a class="reference external" href="http://www.ctan.org/pkg/greek-fontenc">greek-fontenc</a>) or
+via the ligature definitions in the font (see <a class="reference external" href="usage.pdf">usage.pdf</a>).</p>
+<p>The following ASCII characters are converted to Greek symbols:</p>
+<table>
+<colgroup>
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+<col style="width: 4%" />
+</colgroup>
+<tbody>
+<tr><td><p>A</p></td>
+<td><p>B</p></td>
+<td><p>G</p></td>
+<td><p>D</p></td>
+<td><p>E</p></td>
+<td><p>Z</p></td>
+<td><p>H</p></td>
+<td><p>J</p></td>
+<td><p>I</p></td>
+<td><p>K</p></td>
+<td><p>L</p></td>
+<td><p>M</p></td>
+<td><p>N</p></td>
+<td><p>X</p></td>
+<td><p>O</p></td>
+<td><p>P</p></td>
+<td><p>R</p></td>
+<td><p>S</p></td>
+<td></td>
+<td><p>T</p></td>
+<td><p>U</p></td>
+<td><p>F</p></td>
+<td><p>Q</p></td>
+<td><p>Y</p></td>
+<td><p>W</p></td>
+</tr>
+<tr><td><p>Α</p></td>
+<td><p>Β</p></td>
+<td><p>Γ</p></td>
+<td><p>Δ</p></td>
+<td><p>Ε</p></td>
+<td><p>Ζ</p></td>
+<td><p>Η</p></td>
+<td><p>Θ</p></td>
+<td><p>Ι</p></td>
+<td><p>Κ</p></td>
+<td><p>Λ</p></td>
+<td><p>Μ</p></td>
+<td><p>Ν</p></td>
+<td><p>Ξ</p></td>
+<td><p>Ο</p></td>
+<td><p>Π</p></td>
+<td><p>Ρ</p></td>
+<td><p>Σ</p></td>
+<td></td>
+<td><p>Τ</p></td>
+<td><p>Υ</p></td>
+<td><p>Φ</p></td>
+<td><p>Χ</p></td>
+<td><p>Ψ</p></td>
+<td><p>Ω</p></td>
+</tr>
+<tr><td><p>a</p></td>
+<td><p>b</p></td>
+<td><p>g</p></td>
+<td><p>d</p></td>
+<td><p>e</p></td>
+<td><p>z</p></td>
+<td><p>h</p></td>
+<td><p>j</p></td>
+<td><p>i</p></td>
+<td><p>k</p></td>
+<td><p>l</p></td>
+<td><p>m</p></td>
+<td><p>n</p></td>
+<td><p>x</p></td>
+<td><p>o</p></td>
+<td><p>p</p></td>
+<td><p>r</p></td>
+<td><p>s</p></td>
+<td><p>c</p></td>
+<td><p>t</p></td>
+<td><p>u</p></td>
+<td><p>f</p></td>
+<td><p>q</p></td>
+<td><p>y</p></td>
+<td><p>w</p></td>
+</tr>
+<tr><td><p>α</p></td>
+<td><p>β</p></td>
+<td><p>γ</p></td>
+<td><p>δ</p></td>
+<td><p>ε</p></td>
+<td><p>ζ</p></td>
+<td><p>η</p></td>
+<td><p>θ</p></td>
+<td><p>ι</p></td>
+<td><p>κ</p></td>
+<td><p>λ</p></td>
+<td><p>μ</p></td>
+<td><p>ν</p></td>
+<td><p>ξ</p></td>
+<td><p>ο</p></td>
+<td><p>π</p></td>
+<td><p>ρ</p></td>
+<td><p>σ</p></td>
+<td><p>ς</p></td>
+<td><p>τ</p></td>
+<td><p>υ</p></td>
+<td><p>φ</p></td>
+<td><p>χ</p></td>
+<td><p>ψ</p></td>
+<td><p>ω</p></td>
+</tr>
+</tbody>
+</table>
+<p>Accent symbols and punctuation:</p>
+<table>
+<colgroup>
+<col style="width: 29%" />
+<col style="width: 9%" />
+<col style="width: 3%" />
+<col style="width: 38%" />
+<col style="width: 14%" />
+<col style="width: 7%" />
+</colgroup>
+<tbody>
+<tr><td><p>tonos</p></td>
+<td><p><span class="docutils literal">'</span></p></td>
+<td><p>ά</p></td>
+<td><p>semicolon</p></td>
+<td><p><span class="docutils literal">;</span></p></td>
+<td><p>·</p></td>
+</tr>
+<tr><td><p>varia</p></td>
+<td><p>`</p></td>
+<td><p>ὰ</p></td>
+<td><p>question mark</p></td>
+<td><p><span class="docutils literal">?</span></p></td>
+<td><p>;</p></td>
+</tr>
+<tr><td><p>perispomeni</p></td>
+<td><p><span class="docutils literal">~</span></p></td>
+<td><p>ᾶ</p></td>
+<td><p>left apostrophe</p></td>
+<td><p>` `</p></td>
+<td><p>‘</p></td>
+</tr>
+<tr><td><p>dasia</p></td>
+<td><p><span class="docutils literal">&lt;</span></p></td>
+<td><p>ἁ</p></td>
+<td><p>right apostrophe</p></td>
+<td><p><span class="docutils literal">''</span></p></td>
+<td><p>’</p></td>
+</tr>
+<tr><td><p>psili</p></td>
+<td><p><span class="docutils literal">&gt;</span></p></td>
+<td><p>ἀ</p></td>
+<td><p>left quotation mark</p></td>
+<td><p><span class="docutils literal">((</span></p></td>
+<td><p>«</p></td>
+</tr>
+<tr><td><p>ypogegrammeni</p></td>
+<td><p><span class="docutils literal">|</span></p></td>
+<td><p>ᾳ</p></td>
+<td><p>right quotation mark</p></td>
+<td><p><span class="docutils literal">))</span></p></td>
+<td><p>»</p></td>
+</tr>
+<tr><td><p>dialytika</p></td>
+<td><p><span class="docutils literal">&quot;</span></p></td>
+<td><p>ϊ</p></td>
+<td><p>zero width non-joiner</p></td>
+<td><p>v</p></td>
+<td></td>
+</tr>
+</tbody>
+</table>
+<p>A major drawback of the LGR transliteration is that you cannot access Latin
+letters and some symbols if LGR is the active font encoding (e.g. in
+documents or parts of documents given the <cite>Babel</cite> language <span class="docutils literal">greek</span>). This
+means that for every Latin-written word or acronym an explicit
+language-switch is required. This problem can only be solved via a
+font-encoding comprising both Latin and Greek like the hypothetical T7 or
+Unicode (with XeTeX or LuaTeX).</p>
+<!-- References
+- - - - - - - - - - -->
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/babel-contrib/greek/athnum.dtx b/macros/latex/contrib/babel-contrib/greek/athnum.dtx
new file mode 100644
index 0000000000..3ea1f5325a
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/athnum.dtx
@@ -0,0 +1,277 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%% \CheckSum{125}
+%\iffalse
+%
+%% This is file `athnum.dtx'
+%% (c) 1997-2007 Apostolos Syropoulos.
+%% All rights reserved.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos
+% 366, 28th October Str.
+% GR-671 00 Xanthi, GREECE
+% apostolo at platon.ee.duth.gr or apostolo at obelix.ee.duth.gr
+%
+%\fi
+%
+% \iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\def\PiIt#1{{%
+ \newdimen\boxW \newdimen\boxH
+ \settowidth{\boxW}{#1}%
+ \settoheight{\boxH}{#1}%
+ \addtolength{\boxW}{0.8pt}
+ \vbox{%
+ \hrule width\boxW\hbox{%
+ \vrule height\boxH\mbox{#1}%
+ \vrule height\boxH}}\kern.5pt}}
+\GetFileInfo{athnum.drv}
+\begin{document}
+ \DocInput{athnum.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+%\title{Athenian Numerals II\footnote{The documentation of this
+% package is essentially the same as that of the package `grnumalt'.
+% The `II' serves as a means to distinguish the two documents.}}
+% \author{Apostolos Syropoulos\\366, 28th October Str.\\
+% GR-671 00 Xanthi, HELLAS\\ Email:\texttt{apostolo@platon.ee.duth.gr}}
+% \date{2003/08/24}
+%\maketitle
+%
+%\MakeShortVerb{\|}
+%
+%\section{Introduction}
+%
+% This \LaTeX\ package implements the macro
+% \DescribeMacro{\athnum}
+% |\athnum|. The macro transforms an Arabic numeral, i.e., the kind
+% of numerals we all use (e.g., 1, 5, 789 etc), to the corresponding
+% {\itshape Athenian} numeral. Athenian numerals were in use only in
+% ancient Athens. The package can be used only in conjunction with the
+% |greek| option of the |babel| package.
+%
+%\section{The Numbering System}
+%
+% The athenian numbering system, like the roman one, employs
+% letters to denote important numbers. Multiple occurrence of a letter denote
+% a multiple of the ``important'' number, e.g., the letter I denotes 1, so
+% III denotes 3. Here are the basic digits used in the Athenian numbering
+% system:
+% \begin{itemize}
+% \item I denotes the number one (1)
+% \item $\Pi$ denotes the number five (5)
+% \item $\Delta$ denotes the number ten (10)
+% \item H denotes the number one hundred (100)
+% \item X denotes the number one thousand (1000)
+% \item M denotes the number ten thousands (10000)
+%\end{itemize}
+% Moreover, the letters $\Delta$, H, X, and M under the letter $\Pi$,
+% denote five times their original value, e.g., the symbol
+% \PiIt{X}, denotes the number 5000, and the symbol
+% \PiIt{$\Delta$}, denotes the number 50. It must be noted that
+% the numbering system does not provide negative numerals or a symbol for
+% zero.
+%
+% The Athenian numbering system is described, among others, in an article in
+% Encyclopedia $\Delta o\mu\acute{\eta}$, Vol. 2, page 280, 7th edition,
+% Athens, October 2, 1975.
+%
+% \section{The Code}
+% Before we do anything further, we have to identify the package.
+% \StopEventually
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[1996/01/01]
+\ProvidesPackage{athnum}[2003/08/24\space v1.1]
+\typeout{Package: `athnum' v1.1\space <2003/08/24> (A. Syropoulos)}
+% \end{macrocode}
+% Next we check to see if the |babel| package is loaded with at least
+% the |greek| option. In case it isn't, we opt to produce an error message.
+% \begin{macrocode}
+\@ifpackagewith{babel}{greek}{}{%
+ \@ifpackagewith{babel}{polutonikogreek}{}{%
+ \PackageError{athnum}{%
+ `greek' option of the `babel'\MessageBreak
+ package hasn't been loaded}{%
+ The commands provided by this package\MessageBreak
+ are specially designed for greek language\MessageBreak
+ typesetting with the `babel' package. Load\MessageBreak
+ it with at least the `greek' option.}\relax
+ }}
+% \end{macrocode}
+%
+% As it is mentioned in the introduction, the Athenian numerals employ
+% some special digits. These digits are included in the |cb| fonts of
+% Claudio Beccari, and so we must provide access commands.
+% \begin{macrocode}
+\DeclareTextCommand{\PiDelta}{LGR}{\char"02\relax}
+\DeclareTextCommand{\PiEta}{LGR}{\char"03\relax}
+\DeclareTextCommand{\PiChi}{LGR}{\char"04\relax}
+\DeclareTextCommand{\PiMu}{LGR}{\char"05\relax}
+% \end{macrocode}
+%\begin{macro}{\@@athnum}
+% Now, we turn our attention to the definition of the macro
+% |\@@athnum|. This macro uses one integer variable (or counter in
+% \TeX's jargon.)
+% \begin{macrocode}
+\newcount\@ath@num
+% \end{macrocode}
+% The macro |\@@athnum| is also defined as a robust command.
+% \begin{macrocode}
+\DeclareRobustCommand*{\@@athnum}[1]{%
+% \end{macrocode}
+% After assigning to variable |\@ath@num| the value of the macro's argument,
+%we make sure that the argument is in the expected range, i.e., it is greater
+% than zero, and less or equal to $249999$. In case it isn't, we simply
+% produce a |\space|, warn the user about it and quit. Although, the
+% |\athnum| macro is capable to produce an Athenian numeral for even greater
+% intergers, the following argument by Claudio Beccari convised me to place
+% this above upper limit:
+% \begin{quote}
+% According to psychological perception studies (that ancient Athenians
+% and Romans perfectly knew without needing to study Freud and Jung)
+% living beings (which includes at least all vertebrates, not only
+% humans) can perceive up to four randomly set objects of the same kind
+% without the need of counting, the latter activity being a specific
+% acquired ability of human kind; the biquinary numbering notation
+% used by the Athenians and the Romans exploits this natural
+% characteristic of human beings.
+% \end{quote}
+% \begin{macrocode}
+ \@ath@num#1\relax
+ \ifnum\@ath@num<\@ne%
+ \space%
+ \PackageWarning{athnum}{%
+ Illegal value (\the\@ath@num) for athenian numeral}%
+ \else\ifnum\@ath@num>249999%
+ \space%
+ \PackageWarning{athnum}{%
+ Illegal value (\the\@ath@num) for athenian numeral}%
+ \else
+% \end{macrocode}
+% Having done all the necessary checks, we are now ready to do the actual
+% computation. If the number is greater than $49999$, then it certainly
+% has at least one \PiIt{M} ``digit''. We find all such digits by continuously
+% subtracting $50000$ from |\@ath@num|, until |\@ath@num| becomes less than
+% $50000$.
+% \begin{macrocode}
+ \@whilenum\@ath@num>49999\do{%
+ \PiMu\advance\@ath@num-50000}%
+% \end{macrocode}
+% We now check for tens of thousands.
+% \begin{macrocode}
+ \@whilenum\@ath@num>9999\do{%
+ M\advance\@ath@num-\@M}%
+% \end{macrocode}
+% Since a number can have only one \PiIt{X} ``digit'' (equivalent to 5000), it
+% is easy to check it out and produce the corresponding numeral in case it does
+% have one.
+% \begin{macrocode}
+ \ifnum\@ath@num>4999%
+ \PiChi\advance\@ath@num-5000%
+ \fi\relax
+% \end{macrocode}
+% Next, we check for thousands, the same way we checked for tens of thousands.
+% \begin{macrocode}
+ \@whilenum\@ath@num>999\do{%
+ Q\advance\@ath@num-\@m}%
+% \end{macrocode}
+% Like the five thousands, a numeral can have at most one \PiIt{H} ``digit''
+% (equivalent to 500).
+% \begin{macrocode}
+ \ifnum\@ath@num>499%
+ \PiEta\advance\@ath@num-500%
+ \fi\relax
+% \end{macrocode}
+% It is time to check hundreds, which follow the same pattern as thousands
+% \begin{macrocode}
+ \@whilenum\@ath@num>99\do{%
+ H\advance\@ath@num-100}%
+% \end{macrocode}
+% A numeral can have only one \PiIt{$\Delta$} ``digit'' (equivalent to 50).
+% \begin{macrocode}
+ \ifnum\@ath@num>49%
+ \PiDelta\advance\@ath@num-50%
+ \fi\relax
+% \end{macrocode}
+% Let's check now decades.
+% \begin{macrocode}
+ \@whilenum\@ath@num>9\do{%
+ D\advance\@ath@num by-10}%
+% \end{macrocode}
+% We check for five and, finally, for the digits 1, 2, 3, and 4.
+% \begin{macrocode}
+ \@whilenum\@ath@num>4\do{%
+ P\advance\@ath@num-5}%
+ \ifcase\@ath@num\or I\or II\or III\or IIII\fi%
+ \fi\fi}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@athnum}
+% The command |\@athnum| has one argument, which
+% is a counter. It calls the command |\@@athnum| to process the value of
+% the counter.
+% \begin{macrocode}
+\def\@athnum#1{%
+ \expandafter\@@athnum\expandafter{\the#1}}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\athnum}
+% The command |\athnum| is a wrapper that declares
+% a new counter in a local scope, assigns to it the argument of the command
+% and calls the macro |\@athnum|. This way the command can process correctly
+% either a number or a counter.
+% \begin{macrocode}
+\def\athnum#1{%
+ \@ath@num#1\relax
+ \@athnum{\@ath@num}}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%
+% \section*{Acknowledgment}
+% I would like to thank Claudio Beccari for reading the documentation
+% and for his very helpful suggestions. In addition, Antonis Tsolomitis
+% spotted a bug in the first version, which is corrected in the present
+% version.
+% \section*{Dedication}
+% I would like to dedicate this piece of work to my son
+% \begin{center}Demetrios-Georgios.\end{center}
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/greek/athnum.pdf b/macros/latex/contrib/babel-contrib/greek/athnum.pdf
new file mode 100644
index 0000000000..6301b00730
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/athnum.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx b/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx
new file mode 100644
index 0000000000..677eb4d480
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx
@@ -0,0 +1,1326 @@
+% \iffalse meta-comment
+% !TEX encoding = UTF-8 Unicode
+%
+% Copyright 1989-2008 Apostolos Syropoulos, Johannes L. Braams
+% and the authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the babel-greek package.
+% ---------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Günter Milde <milde@users.sf.net>.
+%
+% Babel-greek is a contributed package providing support for the Greek
+% language and script via the Babel system (http://www.ctan.org/pkg/babel).
+%
+% The list of derived (unpacked) files belonging to this work
+% and covered by LPPL is defined by the unpacking script (babel-greek.ins)
+% which is part of the package.
+% \fi
+% \CheckSum{1552}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{babel-greek.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{greek}
+%\fi
+%\ProvidesFile{babel-greek.dtx}
+ [2016/09/07 v1.9h Greek support for the babel system]
+%\iffalse
+%% File `babel-greek.dtx'
+%% Greek language Definition File
+%% Copyright © 1997, 2005 Apostolos Syropoulos, Johannes Braams
+%% Copyright © 2013, 2019 Günter Milde
+%
+%% Please report errors to: Günter Milde <milde@users.sf.net>
+%
+% This file is part of the babel-greek package, it provides the source
+% code for the greek language definition file. The original
+% version of this file was written by Apostolos Syropoulos.
+% It was then enhanced by adding code from kdgreek.sty from David
+% Kastrup <dak@gnu.org> with his
+% consent.
+%<*filedriver>
+\documentclass{ltxdoc}
+% \usepackage{lmodern}
+\usepackage[utf8]{inputenc}
+\usepackage{hyperref,bookmark}
+\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=black}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\newcommand*{\pkg}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{babel-greek.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{babel-greek.dtx}
+%
+% \changes{greek-1.0b}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{greek-1.0b}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning}
+% \changes{greek-1.2}{1997/10/28}{Classical Greek is now a dialect}
+% \changes{greek-1.2b}{1997/11/01}{Classical Greek is now called
+% ``Polutoniko'' Greek. The previous name was at least misleading}
+% \changes{greek-1.2c}{1998/06/26}{This version conforms to version
+% 2.0 of the CB fonts and consequently we added a few new
+% symbol-producing commands}
+% \changes{greek-1.3a}{1998/07/04}{polutoniko is now an attribute to
+% Greek, no longer a `dialect'}
+% \changes{greek-1.4}{2013/05/17}{new maintainer}
+% \changes{greek-1.5}{2013/06/21}{bugfixes,
+% change some symbol macros to aliases,
+% LGR fixes via DeclareTextCommand instead of
+% extrasgreek/noextrasgreek definitions,
+% LICR macros in string definitions,
+% LGR font encoding not used with XeTeX/LuaTeX.}
+% \changes{greek-1.5a}{2013/06/27}{``extraspolutonikogreek'' definition
+% was missing with Xe/LuaTeX.
+% Replaced non-printable literal character with ^^-notation.}
+% \changes{greek-1.6}{2013/07/18}{fix \cs{@roman} and \cs{@Roman}
+% redefinition (thanks to Enrico Gregorio and Claudio Beccari),
+% load LICR macro definitions for Xe/LuaTeX.}
+% \changes{greek-1.7}{2013/09/09}{Do not load euenc.def with XeTeX/LuaTeX.
+% Prevent re-loading lgrenc.def.}
+% \changes{greek-1.7a}{2013/09/13}{bugfix: remove spurious ``fi''.}
+% \changes{greek-1.7b}{2013/10/01}{bugfix: correct upcasing of babel strings
+% with Xe/LuaTeX.}
+% \changes{babel-greek-1.8}{2013/11/27}{Rename to ``babel-greek.dtx''.
+% Restore compatibility with Xe/LuaTeX in 8-bit and Unicode mode.
+% Load ``euenc.def'' if EU1 or EU2 font encoding is detected.
+% New TextCommands ``greekscript'' and ``ensuregreek''.}
+% \changes{babel-greek-1.8a}{2013/12/03}{Set `encodingdefault' in `greekscript'
+% to fix Greek in footnotes etc. with document language Greek.}
+% \changes{babel-greek-1.9}{2014/07/20}{Added attribute for ancient Greek.
+% Load correct hyphenation patterns. Patch by Claudio Beccari.}
+% \changes{babel-greek-1.9b}{2014/09/18}{Remove spurious whitespace from
+% `extrasgreek' definition (report Eike Schmidt).
+% Use named macros instead of non-standard short accent macros for
+% psili and dasia.}
+% \changes{babel-greek-1.9c}{2014/10/21}{Fix dummy hyphenation language names
+% (report/patch Ulrike Fischer).}
+% \changes{babel-greek-1.9d}{2015/07/06}{uc-/lccode corrections from xgreek are now
+% in greek-euenc.def (the polyglossia version has bugs).}
+% \changes{babel-greek-1.9e}{2015/11/27}{Fix bug in lccode-setting loop
+% (patch by Enrico Gregorio).}
+% \changes{babel-greek-1.9f}{2016/02/04}{Support for standard
+% Unicode text encoding ``TU'' (new in fontspec v2.5a).}
+% \changes{babel-greek-1.9g}{2016/09/07}{Babel 3.9i deprecated textlatin
+% and fixed latinencoding.}
+% \changes{babel-greek-1.9h}{2019/07/11}{Move breathing composite commands
+% to textalpha.}
+%
+% \title{Babel support for the Greek language}
+% \author{Apostolos Syropoulos, Günter Milde}
+% \maketitle
+%
+% Babel-greek is a contributed package providing support for the Greek
+% language and script via the \href{http://www.ctan.org/pkg/babel}{Babel}
+% system. See the \href{README.html}{README} file for an overwiew of the
+% \pkg{babel-greek} package and links to requirements and related packages.
+%
+% The file \file{\filename}%
+% \footnote{
+% The file described in this section has version number \fileversion\
+% and was last revised on \filedate.
+% The original author is Apostolos Syropoulos, code from \file{kdgreek.sty}
+% by David Kastrup was used.}
+% is the literate source for the Babel language definition file
+% \file{greek.ldf}.
+%
+% \section{Requirements}
+%
+% Typesetting Greek with Babel requires (of course) the
+% \href{http://www.ctan.org/pkg/babel}{Babel core}, support for Greek font
+% encodings (\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc})
+% and a \href{README.html#greek-text-fonts}{text font supporting the
+% Greek script}.
+%
+% The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts}
+% created by \textsc{Claudio Beccari}\footnote{Apostolos Syropoulos
+% wishes to thank Claudio Beccari for his
+% patience, collaboration, comments and suggestions.}
+% are a complete set of 8-bit TeX fonts matching \textsc{Knuth}'s
+% Computer Modern.
+% The package \pkg{\href{http://www.ctan.org/pkg/cbfonts-fd}{cbfonts-fd}}
+% sets them up as Greek substitute for the Computer Modern and Latin Modern
+% font families.
+% The \pkg{\href{http://www.ctan.org/pkg/substitutefont}{substitutefont}}
+% package can be used to set up Greek supplements for other
+% font families (like Times or Palatino).
+%
+% The \href{http://ctan.org/pkg/lm}{Latin Modern} OpenType font that is the
+% default font for XeTeX/LuaTeX does not support the Greek script. The user
+% needs to set up an alternative font like Linux Libertine or DejaVu with
+% \pkg{\href{http://www.ctan.org/pkg/fontspec}{fontspec}}.
+%
+% \section{Usage}
+%
+% To activate Greek support with babel, specify the option
+% \Lopt{greek}, either as global option or as option to the
+% \pkg{babel} package. Remember, that the \emph{last} language
+% option determines the document language, e.g.
+% \begin{verbatim}
+% \usepackage[greek,english]{babel}\end{verbatim}
+% activates support for Greek in an English document.
+% The default is modern ``monotonic'' Greek, while
+% \begin{verbatim}
+% \usepackage[english,greek]{babel}
+% \languageattribute{greek}{polutoniko}
+% \end{verbatim}
+% sets the document language to modern Greek with ``polytonic''
+% spelling and
+% \begin{verbatim}
+% \usepackage[english,greek]{babel}
+% \languageattribute{greek}{ancient}
+% \end{verbatim}
+% sets the document language to ancient Greek.
+%
+% Both attributes may also be used as modifiers as in
+% \begin{verbatim}
+% \usepackage[greek.polutoniko,english]{babel}
+% \end{verbatim}
+% and similarly
+% \begin{verbatim}
+% \usepackage[greek.ancient,english]{babel}
+% \end{verbatim}
+%
+% Version 1.9 fixes the activation of hyphenation patterns: By default,
+% \pkg{babel-greek} activates the modern Greek monotonic hyphenation;
+% the attribute/modifier |polutoniko| activates the modern Greek
+% polytonic hyphenation and the attribute/modifier |ancient| activates
+% the ancient Greek hyphenation. 8-bit TeX and XeTeX requires the
+% hyphenation patterns to be pre-loaded in the format file.
+% This is a limitation by TeX, common to all languages.
+% The LuaTeX engine loads hyphenation patterns on demand.
+%
+% \DescribeMacro\selectlanguage
+% \DescribeMacro\foreignlanguage
+% The Babel core provides two commands to switch the active language:
+% The declaration |\selectlanguage{greek}| switches to the Greek language.
+% The macro \verb|\foreignlanguage{greek}{<some text>}| sets its second argument
+% in the Greek language. This is intended for short text parts.
+% For details see the \href{http://www.ctan.org/pkg/babel}{Babel} documentation.
+%
+% For backwards compatibility, ``polytonic'' spelling can also be
+% selected via the dummy language \Lopt{polutonikogreek}. In this
+% case, the language name \Lopt{polutonikogreek} must also be
+% used for language switches with |\selectlanguage| or
+% |\foreignlanguage|. However, it is not possible to use
+% both options, \Lopt{greek} and \Lopt{polutonikogreek} in one document.
+%
+% \subsection{Input of Greek text}
+%
+% There are several alternatives to write Greek text.
+% \begin{itemize}
+% \item With the packages \pkg{inputenc} and
+% \pkg{\href{http://www.ctan.org/pkg/greek-inputenc}{greek-inputenc}},
+% literal Greek characters can be input using the utf-8, iso-8859-7,
+% or macgreek encoding.
+%
+% Literal input using the utf-8 encoding is also the standard input
+% method if compiling with the XeTeX and LuaTeX engines.
+%
+% \item The Latin transliteration defined by the LGR font encoding
+% is explained in the file \file{\href{usage.pdf}{usage.pdf}}.
+%
+% \item The package
+% \pkg{\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc}}
+% defines \emph{LaTeX internal character representation} (LICR) macros
+% for Greek letters and text symbols. It is required by \pkg{babel-greek},
+% so the |\textAlpha| \ldots |\textomega|
+% macros are a safe but cumbersome method to input Greek characters.
+%
+% \item The \pkg{alphabeta} package bundled with
+% \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} makes the
+% short macro names |\Alpha| \ldots |\omega| available in text mode, too.
+% \end{itemize}
+% The \href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} bundle
+% has details and examples for all these input methods.
+%
+% \subsection{Greek vs. Latin script}
+% When switching the language to Greek, \pkg{babel-greek} ensures that the
+% Greek script is supported.
+% With 8-bit LaTeX, Greek text fonts use a non-standard
+% font encoding\footnote{LaTeX font encodings are described in
+% the \emph{LaTeX font guide} (fntguide.pdf).}
+% (LGR) that misses Latin letters. Latin characters in the source are
+% instead interpreted as a transcription for Greek characters.
+% The following macros allow the use of Greek vs. Latin script without
+% changing the active language.
+% \DescribeMacro\greekscript
+% \DescribeMacro\greektext
+% The \emph{TextCommand}\footnote{For a discussion of TextCommands, see
+% the \emph{LaTeX font guide} (fntguide.pdf), too.}
+% |\greekscript| switches to a font encoding
+% supporting the Greek script.
+% The declaration |\greektext| always switches the font encoding
+% to LGR. Both declarations do not change the active language.
+% \DescribeMacro\latintext
+% |\latintext| (defined by the Babel
+% core) can be used to switch back to an encoding supporting the Latin
+% script (deprecated since Babel 3.9i from March 2014).
+%
+% \DescribeMacro\ensuregreek
+% \DescribeMacro\textgreek
+% The macros |\ensuregreek| and |\textgreek| take one argument
+% which is typeset using a font encoding supporting the Greek
+% script. While |\ensuregreek| only switches the
+% font encoding if required, |\textgreek| always uses the LGR font
+% encoding.
+% \DescribeMacro\textlatin
+% The Babel core defines a corresponding |\textlatin| macro
+% (deprecated in favour of |\ensureascii| in Babel 3.9i from March 2014).
+%
+% \section{Greek numbering}
+%
+% The Greek alphabetical numbering system, like the Roman one, is
+% still used in everyday life for short enumerations. Unfortunately
+% most Greeks don't know how to write Greek numbers bigger than 20 or
+% 30. Nevertheless, in official editions of the last century and
+% beginning of this century this numbering system was also used for
+% dates and numbers in the range of several thousands. Nowadays
+% this numbering system is primary used by the Eastern Orthodox
+% Church and by certain scholars. It is hence necessary to be able
+% to typeset any Greek numeral up to \hbox{999\,999}. Here are the
+% conventions:
+% \begin{itemize}
+% \item There is no Greek numeral for any number less than or equal
+% to $0$.
+% \item Numbers from $1$ to $9$ are denoted by letters alpha, beta,
+% gamma, delta, epsilon, stigma, zeta, eta, theta, followed by a
+% mark similar to the mathematical symbol ``prime''. (Nowadays
+% instead of letter stigma the digraph sigma tau is used for number
+% $6$. Mainly because the letter stigma is not always available, so
+% people opt to write down the first two letters of its name as an
+% alternative. In our implementation we produce the letter stigma,
+% not the digraph sigma tau.)
+% \item Decades from $10$ to $90$ are denoted by letters iota,
+% kappa, lambda, mu, nu, xi, omikron, pi, qoppa, again followed by
+% the numeric mark. The qoppa used for this purpose has a special
+% zig-zag form, which doesn't resemble at all the original
+% `q'-like qoppa.
+% \item Hundreds from $100$ to $900$ are denoted by letters rho,
+% sigma, tau, upsilon, phi, chi, psi, omega, sampi, followed by the
+% numeric mark.
+% \item Any number between $1$ and $999$ is obtained by a group of
+% letters denoting the hundreds decades and units, followed by a
+% numeric mark.
+% \item To denote thousands one uses the same method, but this time
+% the mark is placed in front of the letter, and under the baseline
+% (it is inverted by 180 degrees). When a group of letters denoting
+% thousands is followed by a group of letters denoting a number
+% under $1000$, then both marks are used.
+% \end{itemize}
+%
+% Using these conventions one obtains numbers up to \hbox{999\,999}.
+% \DescribeMacro{\greeknumeral}
+% The command |\greeknumeral| makes it possible to typeset Greek
+% numerals. There is also an
+% \DescribeMacro{\Greeknumeral}
+% ``uppercase'' version of this macro: |\Greeknumeral|.
+%
+% Another system which was in wide use only in Athens, could
+% express any positive number. This system is implemented in
+% package |athnum|.
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{greek-1.0b}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+% When the option \Lopt{polutonikogreek} was used, redefine
+% |\CurrentOption| to prevent problems later on.
+% \begin{macrocode}
+\gdef\CurrentOption{greek}
+% \end{macrocode}
+%
+% Hyphenation patterns:
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{greek} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of the three variants of the Greek language
+% |\l@greek|, |\l@monogreek|, and |l@ancientgreek| to see whether
+% we have to do something here.
+% \changes{greek-1.9}{2014/07/20}{Support all 3 language (hyphenation)
+% variants.}
+% \begin{macrocode}
+\ifx\l@greek\@undefined
+ \@nopatterns{greek}
+ \adddialect\l@greek 0\fi
+\ifx\l@monogreek\@undefined
+ \adddialect\l@monogreek 0\fi
+\ifx\l@ancientgreek\@undefined
+ \adddialect\l@ancientgreek 0\fi
+\newcount\bbl@monogreek \bbl@monogreek=\l@monogreek
+\newcount\bbl@polygreek \bbl@polygreek=\l@greek
+\newcount\bbl@ancientgreek \bbl@ancientgreek=\l@ancientgreek
+% \end{macrocode}
+% The |\extrasgreek| macro is called when switching the language to Greek.
+% We collect code for polytonic and ancient greek in the macros
+% |extraspolutonikogreek| and |extrasancientgreek| and add it later to
+% |extrasgreek|.
+% \begin{macrocode}
+\addto\extrasgreek{\let\l@greek\bbl@monogreek\relax}
+\addto\extraspolutonikogreek{\l@greek=\bbl@polygreek}
+\addto\extrasancientgreek{\l@greek=\bbl@ancientgreek}
+% \end{macrocode}
+%
+% Now we declare the |polutoniko| language attribute.
+% \begin{macrocode}
+\bbl@declare@ttribute{greek}{polutoniko}{%
+% \end{macrocode}
+% This code adds the expansion of |\extraspolutonikogreek| to
+% |\extrasgreek| and changes the definition of |\today| for Greek
+% to produce polytonic month names (by re-defining |\gr@month|).
+% \begin{macrocode}
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extraspolutonikogreek}%
+ \let\captionsgreek\captionspolutonikogreek
+ \let\gr@month\gr@c@month
+% \end{macrocode}
+% We need to take some extra precautions in order not to break
+% older documents which still use the old \Lopt{polutonikogreek}
+% pseuso-language option: language switching commands like
+% |\selectlanguage{polutonikogreek}|, call the
+% |extraspolutonikogreek| macro, set the language to |\l@polutonikogreek|
+% and use |\datepolutonikogreek| for |\today|. We define aliases:
+% \changes{greek-1.3f}{1999/09/29}{Added some code to make older
+% documents work}
+% \changes{greek-1.3g}{2000/02/04}{\cs{noextraspolutonikogreek} was
+% missing}
+% \begin{macrocode}
+ \let\l@polutonikogreek\l@greek
+ \let\datepolutonikogreek\dategreek
+ \let\extraspolutonikogreek\extrasgreek
+ \let\noextraspolutonikogreek\noextrasgreek
+ }
+% \end{macrocode}
+% The |ancient| language attribute is used for classical Greek.
+% \changes{greek-1.9}{2014/07/20}{Add support for ancient Greek.}
+% \begin{macrocode}
+\bbl@declare@ttribute{greek}{ancient}{%
+% \end{macrocode}
+% This attribute adds the expansion of |\extraspolutonikogreek| and
+% |\extrasancientgreek| to |\extrasgreek| to set up support for
+% multi-accented characters and ancient hyphenation patterns.
+% Auto-strings (captions) are specific to ancient Greek while |\today|
+% uses modern polytonic month names (as there existed incompatible
+% sets of month names and no common calendar in ancient Greece.
+% \begin{macrocode}
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extraspolutonikogreek}% multi-accented letters
+ \expandafter\addto\expandafter\extrasgreek
+ \expandafter{\extrasancientgreek}%
+ \let\captionsgreek\captionsancientgreek
+ \let\gr@month\gr@c@month % (modern) polytonic month names
+ }
+% \end{macrocode}
+%
+% \section{Font setup}
+%
+% Typesetting Greek texts requires a font with Greek characters:
+%
+% For 8-bit LaTeX, this package uses fonts with the
+% \href{http://www.ctan.org/pkg/greek-fontenc}{LGR font encoding}.
+% With the XeTeX or LuaTeX engines and Unicode fonts, the user must ensure
+% that the selected font contains the required glyphs.
+% LGR-encoded fonts can also be used alongside Unicode fonts with XeTeX/LuaTeX
+% to enable the input of Greek letters via the Latin transcription provided by
+% this font encoding.
+%
+% \changes{greek-1.2a}{1997/10/31}{filename \file{lgrenc.def} now
+% lowercase}
+% \changes{greek-1.4}{2013/05/17}{\file{lgrenc.def} moved to the
+% separate package `greek-fontenc'}
+% \changes{greek-1.5}{2013/06/21}{LGR setup skipped with XeTeX/LuaTeX}
+% \changes{greek-1.7}{2013/09/09}{Do not load euenc.def with XeTeX/LuaTeX
+% (too complicated to get it right).}
+% \changes{greek-1.8}{2013/11/30}{Check for EU1/EU2 font encoding
+% instead of engine}
+% \changes{babel-greek-1.9f}{2016/02/04}{Check also for TU font encoding.}
+%
+% \DescribeMacro\greekfontencoding
+% We test for available font encodings and set |\greekfontencoding|
+% and the internal macro |\bbl@greek@fontencdef| with the name of the
+% font definition file with Greek LICR macros. The fallback is LGR.
+% \begin{macrocode}
+\@ifl@aded{def}{tuenc}{
+ \providecommand*{\greekfontencoding}{TU}
+ \providecommand*{\bbl@greek@fontencdef}{greek-euenc}
+ \renewcommand*{\LastDeclaredEncoding}{TU}
+}{}
+\@ifl@aded{def}{eu1enc}{
+ \providecommand*{\greekfontencoding}{EU1}
+ \providecommand*{\bbl@greek@fontencdef}{greek-euenc}
+ \renewcommand*{\LastDeclaredEncoding}{EU1}
+}{}
+\@ifl@aded{def}{eu2enc}{
+ \providecommand*{\greekfontencoding}{EU2}
+ \providecommand*{\bbl@greek@fontencdef}{greek-euenc}
+ \renewcommand{\LastDeclaredEncoding}{EU2}
+}{}
+\providecommand*{\greekfontencoding}{LGR}
+\providecommand*{\bbl@greek@fontencdef}{lgrenc}
+% \end{macrocode}
+% Ensure that the Greek LICR macros are available:
+% \begin{macrocode}
+\@ifl@aded{def}{\bbl@greek@fontencdef}{}{
+ \InputIfFileExists{\bbl@greek@fontencdef .def}{}{
+ \errhelp{I can't find the \bbl@greek@fontencdef .def file
+ for the Greek fonts}%
+ \errmessage{Font support for the Greek script missing.^^J
+ babel-greek can't typeset Greek.^^J
+ Install the "greek-fontenc" package^^J
+ or use XeTeX/LuaTeX with polyglossia.}%
+ \@@end
+ }
+}
+% \end{macrocode}
+% \begin{macro}{\greekscript}
+% The TextCommand |\greekscript| is a declaration that switches the font
+% encoding to |\greekfontencoding| if the current font encoding does not
+% provide a (typically empty) local variant.
+% \changes{greek-1.8.1}{2013/12/03}{Set `encodingdefault' in `greekscript'
+% to fix Greek in footnotes etc. with document language Greek.
+% TODO: This is from `greektext' but are there side effects?}
+% \begin{macrocode}
+\ProvideTextCommandDefault{\greekscript}{%
+ \fontencoding{\greekfontencoding}\selectfont
+ \def\encodingdefault{\greekfontencoding}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ensuregreek}
+% The TextCommand |\ensuregreek| sets it argument in |\greekfontencoding|
+% if the current font encoding does not provide a (typically empty) local
+% variant.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\ensuregreek}[1]{%
+ \leavevmode{\greekscript #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Fixes for the LGR font encoding}
+%
+% \begin{macrocode}
+\@ifl@aded{def}{lgrenc}{%
+% \end{macrocode}
+%
+% We redefine a few commands in the LGR encoding to work around problems
+% because LGR is no \emph{standard text encoding} but has Greek letters in
+% the places of Latin ones.
+% \changes{greekfdd-2.2c}{1999/04/05}{Fixed typos, \cs{textrademark}
+% misses a `t', \cs{copyright} should be \cs{textcopyright}}
+% \changes{greekfdd-2.2d}{1999/04/25}{removed redefinition of \cs{\&}}
+% \changes{greek-1.4}{2013/05/17}{moved here from \file{lgrenc.def} because
+% the definitions require the \texttt{\textbackslash latintext} macro
+% defined by Babel.}
+% \changes{greek-1.5}{2013/05/27}{enable use of "textcomp" characters
+% for "textcopyright" and "textregistered" macros}
+% \changes{greek-1.5}{2013/06/15}{\textbackslash & made TextCommand}
+%
+% \begin{macrocode}
+ \ProvideTextCommand{\textcopyright}{LGR}{\ensureascii{\textcopyright}}
+ \ProvideTextCommand{\textregistered}{LGR}{\ensureascii{\textregistered}}
+ \ProvideTextCommand{\texttrademark}{LGR}{\ensureascii{\texttrademark}}
+ \let\ltx@amp\&
+ \DeclareTextCommandDefault{\&}{\ltx@amp}
+ \DeclareTextCommand{\&}{LGR}{\ensureascii{\ltx@amp}}
+ \ProvideTextCommand{\SS}{LGR}{\ensureascii{\SS}}
+% \end{macrocode}
+%
+% \begin{macro}{\greek@roman}
+% \begin{macro}{\greek@Roman}
+% \changes{greek-1.2e}{1999/04/16}{Moved redefinition of \cs{@roman}
+% back to the language specific file}
+% \changes{greek-1.3d}{1999/08/27}{\cs{@roman} and \cs{@Roman} need to
+% be added to \cs{extraspolutonikogreek}}
+% \changes{greek-1.3e}{1999/09/24}{\cs{@roman} and \cs{@Roman} need
+% \emph{not} be in \cs{extraspolutonikogreek} when they are already
+% in \cs{extrasgreek}}
+% \changes{greek-1.5}{2013/06/15}{\cs{@roman} and \cs{@Roman} as TextCommands
+% (BUG: this extended the expansion problem to all languages!)}
+% \changes{greek-1.6}{2013/07/19}{apply a patch by Enrico Gregorio.
+% Thanks to Claudio Beccari for testing and reporting.}
+%
+% To prevent roman numerals being typeset in greek letters we need
+% to adopt the internal \LaTeX\ commands |\@roman| and
+% |\@Roman|. \emph{Up to version 1.5, the definition caused errors where
+% |\@roman| ends up in a situation where the argument needs to be expanded
+% (e.g. Roman page numbers in the ToC).}
+% \begin{macrocode}
+ \def\@roman#1{\expandafter\ensureascii\expandafter{\romannumeral#1}}
+ \def\@Roman#1{\expandafter\ensureascii\expandafter{%
+ \expandafter\@slowromancap\romannumeral#1@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Now we define two commands that switch
+% to the LGR font encoding. The Babel core defines corresponding commands
+% to switch to a Latin font encoding.
+%
+% \begin{macro}{\greektext}
+% The declaration |\greektext| switches to LGR.
+% For shorter pieces of text the |\textgreek| macro should be
+% used.
+% \begin{macrocode}
+ \DeclareRobustCommand{\greektext}{%
+ \fontencoding{LGR}\selectfont
+ \def\encodingdefault{LGR}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textgreek}
+% This command takes an argument which is then typeset using the
+% LGR font encoding. In order to avoid many encoding switches
+% it operates in a local scope.
+% \changes{greek-1.0b}{1996/09/23}{Added a level of braces to keep
+% encoding change local}
+% \changes{greek-1.3k}{2003/03/19}{Added \cs{leavevmode} as was done
+% with \cs{latintext}}
+% \begin{macrocode}
+ \DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textol}
+% The \href{http://www.ctan.org/pkg/cbgreek-complete}{CB Greek fonts}
+% contain an outline family. In order to make it available,
+% we define the command |\textol|. (This font-specific macro does not
+% fit in a language defintion file is and only kept for backwards
+% compatibility.)
+% \begin{macrocode}
+ \def\outlfamily{\usefont{LGR}{cmro}{m}{n}}
+ \DeclareTextFontCommand{\textol}{\outlfamily}
+}{} % End of LGR fixes.
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Definitions for the Greek language}
+%
+% The next step consists in defining commands to switch to (and
+% from) the Greek language.
+%
+% \begin{macro}{\greekhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{greek-1.3h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+% Yannis Haralambous has suggested this value
+\providehyphenmins{\CurrentOption}{\@ne\@ne}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{greek-1.1e}{1997/10/12}{Added caption name for proof}
+% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe ep'ishc}
+% instead of \texttt{bl'pe ep'ishc}}
+%
+% \begin{macro}{\captionsgreek}
+% The macro |\captionsgreek| defines all strings used in the
+% four standard document classes provided with \LaTeX.
+% \changes{greek-1.3h}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{greek-1.3i}{2000/10/02}{The final sigma in all names appears
+% as `s' instead of `c'.}
+% \begin{macrocode}
+\addto\captionsgreek{%
+ \def\prefacename{\textPi\textrho\acctonos\textomicron\textlambda
+ \textomicron\textgamma\textomicron\textfinalsigma}%
+ \def\refname{\textAlpha\textnu\textalpha
+ \textphi\textomicron\textrho\acctonos\textepsilon\textfinalsigma}%
+ \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota
+ \textlambda\texteta\textpsi\texteta}%
+ \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron
+ \textgamma\textrho\textalpha\textphi\acctonos\textiota\textalpha}%
+ \def\chaptername{\textKappa\textepsilon\textphi\acctonos\textalpha
+ \textlambda\textalpha\textiota\textomicron}%
+ \def\appendixname{\textPi\textalpha\textrho\acctonos\textalpha\textrho
+ \texttau\texteta\textmu\textalpha}%
+ \def\contentsname{\textPi\textepsilon\textrho\textiota
+ \textepsilon\textchi\acctonos\textomicron\textmu\textepsilon
+ \textnu\textalpha}%
+ \def\listfigurename{\textKappa\textalpha\texttau\acctonos\textalpha
+ \textlambda\textomicron\textgamma\textomicron\textfinalsigma{}
+ \textSigma\textchi\texteta\textmu\acctonos\textalpha\texttau
+ \textomega\textnu}%
+ \def\listtablename{\textKappa\textalpha\texttau\acctonos\textalpha
+ \textlambda\textomicron\textgamma\textomicron\textfinalsigma{}
+ \textPi\textiota\textnu\acctonos\textalpha\textkappa\textomega\textnu}%
+ \def\indexname{\textEpsilon\textupsilon\textrho\textepsilon
+ \texttau\acctonos\texteta\textrho\textiota\textomicron}%
+ \def\figurename{\textSigma\textchi\acctonos\texteta\textmu\textalpha}%
+ \def\tablename{\textPi\acctonos\textiota\textnu\textalpha
+ \textkappa\textalpha\textfinalsigma}%
+ \def\partname{\textMu\acctonos\textepsilon\textrho\textomicron
+ \textfinalsigma}%
+ \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu
+ \textmu\acctonos\textepsilon\textnu\textalpha}%
+ \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron
+ \textpi\textomicron\acctonos\textiota\texteta\textsigma\texteta}%
+ \def\headtoname{\textPi\textrho\textomicron\textfinalsigma}%
+ \def\pagename{\textSigma\textepsilon\textlambda\acctonos\textiota
+ \textdelta\textalpha}%
+ \def\seename{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon}%
+ \def\alsoname{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon{}
+ \textepsilon\textpi\acctonos\textiota\textsigma\texteta\textfinalsigma}%
+ \def\proofname{\textAlpha\textpi\acctonos\textomicron
+ \textdelta\textepsilon\textiota\textxi\texteta}%
+ \def\glossaryname{\textGamma\textlambda\textomega\textsigma
+ \textsigma\acctonos\textalpha\textrho\textiota}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \changes{greek-1.2}{1997/10/28}{Added caption names for
+% \cs{polutonikogreek}}
+% \changes{greek-1.3d}{1999/08/28}{Fixed typo, \texttt{bl'epe >ep'ishc}
+% instead of \texttt{bl'pe >ep'ishc}}
+%
+% \begin{macro}{\captionspolutonikogreek}
+% For texts written in the $\pi o\lambda\upsilon\tau
+% o\nu\kappa\acute{o}$ (polytonic greek) the translations are
+% the same as above, but some words are spelled differently. For
+% now we just add extra definitions to |\captionsgreek| in order to
+% override the earlier definitions.
+% \begin{macrocode}
+\let\captionspolutonikogreek\captionsgreek
+\addto\captionspolutonikogreek{%
+ \def\refname{\accpsili\textAlpha\textnu\textalpha
+ \textphi\textomicron\textrho\accvaria\textepsilon\textfinalsigma}%
+ \def\indexname{\textEpsilon\accdasia\textupsilon\textrho\textepsilon
+ \texttau\acctonos\texteta\textrho\textiota\textomicron}%
+ \def\figurename{\textSigma\textchi\accperispomeni\texteta\textmu\textalpha}%
+ \def\headtoname{\textPi\textrho\accvaria\textomicron\textfinalsigma}%
+ \def\alsoname{\textbeta\textlambda\acctonos\textepsilon\textpi\textepsilon{}
+ \accpsili\textepsilon\textpi\acctonos\textiota\textsigma\texteta\textfinalsigma}%
+ \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron
+ \textdelta\textepsilon\textiota\textxi\texteta}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{babel-greek-1.9}{2014/07/20}{Added caption names for
+% \cs{ancientgreek}}
+%
+% \begin{macro}{\captionsancientgreek}
+% For texts written in ancient Greek, we took
+% the translations from Apostolos Syropoulos' |xgreek| package. For
+% now we just add extra definitions to |\captionsgreek| in order to
+% override the earlier definitions.
+% \begin{macrocode}
+\let\captionsancientgreek\captionsgreek
+\addto\captionsancientgreek{%
+ \def\prefacename{\textPi\textrho\textomicron\textomicron\acctonos\textiota\textmu
+ \textiota\textomicron\textnu}%
+ \def\refname{\accpsili\textAlpha\textnu\textalpha\textphi\textomicron\textrho
+ \textalpha\accvaria\textiota}%
+ \def\abstractname{\textPi\textepsilon\textrho\acctonos\textiota\textlambda\texteta
+ \textpsi\textiota\textvarsigma}%
+ \def\bibname{\textBeta\textiota\textbeta\textlambda\textiota\textomicron
+ \textgamma\textrho\textalpha\textphi\acctonos\textiota\textalpha}%
+ \def\chaptername{\textKappa\textepsilon\textphi\acctonos\textalpha\textlambda
+ \textalpha\textiota\textomicron\textnu}%
+ \def\appendixname{\textPi\textalpha\textrho\acctonos\textalpha\textrho\texttau
+ \texteta\textmu\textalpha}%
+ \def\contentsname{\textPi\textepsilon\textrho\textiota\textepsilon\textchi
+ \acctonos\textomicron\textmu\textepsilon\textnu\textalpha}%
+ \def\listfigurename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
+ \textomicron\textgamma\textomicron\textvarsigma{}
+ \textsigma\textchi\texteta\textmu\acctonos\textalpha\texttau\textomega\textnu}%
+ \def\listtablename{\textKappa\textalpha\texttau\acctonos\textalpha\textlambda
+ \textomicron\textgamma\textomicron\textvarsigma{}
+ \textpi\textiota\textnu\acctonos\textalpha\textkappa\textomega\textnu}%
+ \def\indexname{\textEpsilon\accdasia\textupsilon\textrho\textepsilon\texttau
+ \acctonos\texteta\textrho\textiota\textomicron\textnu}%
+ \def\figurename{\textSigma\textchi\accperispomeni\texteta\textmu\textalpha}%
+ \def\tablename{\textPi\acctonos\textiota\textnu\textalpha\textxi}%
+ \def\partname{\textMu\acctonos\textepsilon\textrho\textomicron\textvarsigma}%
+ \def\enclname{\textSigma\textupsilon\textnu\texteta\textmu\textmu
+ \acctonos\textepsilon\textnu\textomega\textvarsigma}%
+ \def\ccname{\textKappa\textomicron\textiota\textnu\textomicron\textpi
+ \textomicron\acctonos\textiota\texteta\textsigma\textiota\textvarsigma}%
+ \def\headtoname{\textPi\textrho\accvaria\textomicron\textvarsigma}%
+ \def\pagename{\textSigma\textepsilon\textlambda\accvaria\textiota\textvarsigma}%
+ \def\seename{\accdasiavaria\textomicron\textrho\textalpha}%
+ \def\alsoname{\accdasiavaria\textomicron\textrho\textalpha{} \accdasia\textomega\textsigma
+ \textalpha\acctonos\textupsilon\texttau\textomega\textvarsigma}%
+ \def\proofname{\accpsili\textAlpha\textpi\acctonos\textomicron\textdelta\textepsilon
+ \textiota\textxi\textiota\textvarsigma}%
+ \def\glossaryname{\textGamma\textlambda\textomega\textsigma\textsigma
+ \acctonos\textalpha\textrho\textiota\textomicron\textnu}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gr@month}
+% \changes{greek-1.1e}{1997/10/12}{Macro added}
+% \begin{macro}{\dategreek}
+% The macro |\dategreek| redefines the command |\today| to
+% produce greek dates. The name of the month is now produced
+% by the macro |\gr@month| since it is needed in the definition
+% of the macro |\Grtoday|.
+% \changes{greek-1.1a}{1997/03/03}{Fixed typo, \texttt{Oktwbr'iou}
+% instead of \texttt{Oktobr'iou}}
+% \changes{greek-1.1d}{1997/10/12}{Macro \cs{gr@month} now produces
+% the name of the month}
+% \changes{greek-1.2a}{1997/10/31}{Use \cs{edef} to define \cs{today}}
+% \changes{greek-1.2b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\gr@month{%
+ \ifcase\month\or
+ \textIota\textalpha\textnu\textomicron\textupsilon\textalpha
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon
+ \textalpha\textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textMu\textalpha\textrho\texttau\acctonos\textiota\textomicron\textupsilon
+ \or \textAlpha\textpi\textrho\textiota\textlambda\acctonos\textiota
+ \textomicron\textupsilon \or
+ \textMu\textalpha\'"\textiota\textomicron\textupsilon \or
+ \textIota\textomicron\textupsilon\textnu\acctonos\textiota
+ \textomicron\textupsilon \or
+ \textIota\textomicron\textupsilon\textlambda\acctonos\textiota
+ \textomicron\textupsilon \or
+ \textAlpha\textupsilon\textgamma\textomicron\acctonos\textupsilon
+ \textsigma\texttau\textomicron\textupsilon \or
+ \textSigma\textepsilon\textpi\texttau\textepsilon\textmu
+ \textbeta\textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textOmicron\textkappa\texttau\textomega\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textNu\textomicron\textepsilon\textmu\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textDelta\textepsilon\textkappa\textepsilon\textmu\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon
+ \fi
+}
+\def\dategreek{%
+ \def\today{\number\day \space \gr@month\space \number\year}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gr@c@greek}
+% \changes{greek-1.2}{1997/10/28}{Added macro \cs{gr@cl@month}}
+% \changes{greek-1.2}{1997/10/28}{Added macro
+% \cs{datepolutonikogreek}}
+% \changes{greek-1.3a}{1997/10/28}{removed macro
+% \cs{datepolutonikogreek}}
+% \begin{macrocode}
+\def\gr@c@month{%
+ \ifcase\month\or
+ \accpsili\textIota\textalpha\textnu\textomicron\textupsilon\textalpha
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textPhi\textepsilon\textbeta\textrho\textomicron\textupsilon
+ \textalpha\textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textMu\textalpha\textrho\texttau\acctonos\textiota\textomicron
+ \textupsilon \or
+ \accpsili\textAlpha\textpi\textrho\textiota\textlambda
+ \acctonos\textiota\textomicron\textupsilon \or
+ \textMu\textalpha\"'\textiota\textomicron\textupsilon \or
+ \accpsili\textIota\textomicron\textupsilon\textnu
+ \acctonos\textiota\textomicron\textupsilon \or
+ \accpsili\textIota\textomicron\textupsilon\textlambda
+ \acctonos\textiota\textomicron\textupsilon \or
+ \textAlpha\accpsili\textupsilon\textgamma\textomicron\acctonos
+ \textupsilon\textsigma\texttau\textomicron\textupsilon \or
+ \textSigma\textepsilon\textpi\texttau\textepsilon\textmu\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \accpsili\textOmicron\textkappa\texttau\textomega\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textNu\textomicron\textepsilon\textmu\textbeta
+ \textrho\acctonos\textiota\textomicron\textupsilon \or
+ \textDelta\textepsilon\textkappa\textepsilon\textmu
+ \textbeta\textrho\acctonos\textiota\textomicron\textupsilon
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Grtoday}
+% \changes{greek-1.1}{1996/10/28}{Added macro \cs{Grtoday}}
+% The macro |\Grtoday| produces the current date, only that the
+% month and the day are shown as greek numerals instead of arabic
+% as it is usually the case.
+% \begin{macrocode}
+\def\Grtoday{%
+ \expandafter\Greeknumeral\expandafter{\the\day}\space
+ \gr@c@month \space
+ \expandafter\Greeknumeral\expandafter{\the\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasgreek}
+% \begin{macro}{\noextrasgreek}
+% The macro |\extrasgreek| will perform all the extra definitions
+% needed for the Greek language. The macro |\noextrasgreek| is used
+% to cancel the actions of |\extrasgreek|. For the moment these
+% macros switch the fontencoding (with 8-bit TeX) and the definition of
+% the internal macros |\@alph| and |\@Alph| because in Greek we do use
+% the Greek numerals.
+% \changes{greek-1.5}{2013/06/21}{LGR not used with XeTeX/LuaTeX.}
+% \changes{greek-1.8}{2013/11/27}{use font-encoding specific TextCommands.
+% Use EU1 or EU2 for Latin script if available}
+% \begin{macrocode}
+\addto\extrasgreek{\greekscript}
+\addto\noextrasgreek{\latintext}
+% \addto\noextrasgreek{\RestoreFontEncoding} % TODO define \RestoreFontEncoding
+% \end{macrocode}
+%
+% \begin{macro}{\gr@ill@value}
+% When the argument of |\greeknumeral| has a value outside of the
+% acceptable bounds ($0 < x < 999999$) a warning will be issued
+% (and nothing will be printed).
+% \begin{macrocode}
+\def\gr@ill@value#1{%
+ \PackageWarningNoLine{babel}{Illegal value (#1) for greeknumeral}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\anw@true}
+% \begin{macro}{\anw@false}
+% \begin{macro}{\anw@print}
+% When a a large number with three \emph{trailing} zero's is to be
+% printed those zeros \emph{and} the numeric mark need to be
+% discarded. As each `digit' is processed by a separate macro
+% \emph{and} because the processing needs to be expandable we need
+% some helper macros that help remember to \emph{not} print the
+% numeric mark (|\anwtonos|).
+%
+% The command |\anw@false| switches the printing of the numeric
+% mark off by making |\anw@print| expand to nothing. The command
+% |\anw@true| (re)enables the printing of the numeric marc. These
+% macro's need to be robust in order to prevent improper expansion
+% during writing to files or during |\uppercase|.
+% \begin{macrocode}
+\DeclareRobustCommand\anw@false{%
+ \DeclareRobustCommand\anw@print{}}
+\DeclareRobustCommand\anw@true{%
+ \DeclareRobustCommand\anw@print{\textdexiakeraia}} % \anwtonos
+\anw@true
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\greeknumeral}
+% The command |\greeknumeral| needs to be \emph{fully} expandable
+% in order to get the right information in auxiliary
+% files. Therefore we use a big |\if|-construction to check the
+% value of the argument and start the parsing at the right level.
+% \begin{macrocode}
+\def\greeknumeral#1{%
+% \end{macrocode}
+% If the value is negative or zero nothing is printed and a warning
+% is issued.
+% \changes{greek-1.3b}{1999/04/03}{Added \cs{expandafter} and
+% \cs{number} (PR3000) in order to make a counter an acceptable
+% argument}
+% \begin{macrocode}
+ \ifnum#1<\@ne\space\gr@ill@value{#1}%
+ \else
+ \ifnum#1<10\expandafter\gr@num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\gr@num@ii\number#1%
+ \else
+% \end{macrocode}
+% We use the available shorthands for 1.000 (|\@m|) and 10.000
+% (|\@M|) to save a few tokens.
+% \begin{macrocode}
+ \ifnum#1<\@m\expandafter\gr@num@iii\number#1%
+ \else
+ \ifnum#1<\@M\expandafter\gr@num@iv\number#1%
+ \else
+ \ifnum#1<100000\expandafter\gr@num@v\number#1%
+ \else
+ \ifnum#1<1000000\expandafter\gr@num@vi\number#1%
+ \else
+% \end{macrocode}
+% If the value is too large, nothing is printed and a warning
+% is issued.
+% \begin{macrocode}
+ \space\gr@ill@value{#1}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Greeknumeral}
+% The command |\Greeknumeral| prints uppercase greek numerals.
+% The parsing is performed by the macro |\greeknumeral|.
+% \begin{macrocode}
+\def\Greeknumeral#1{%
+ \expandafter\MakeUppercase\expandafter{\greeknumeral{#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\greek@alph}
+% \begin{macro}{\greek@Alph}
+% In the previous release of this language definition the
+% commands |\greek@aplh| and |\greek@Alph| were kept just for
+% reasons of compatibility. Here again they become meaningful macros.
+% They are definited in a way that even page numbering with greek
+% numerals is possible. Since the macros |\@alph| and |\@Alph| will
+% lose their original meaning while the Greek option is active, we
+% must save their original value.
+% macros |\@alph|
+% \begin{macrocode}
+\let\latin@alph\@alph
+\let\latin@Alph\@Alph
+% \end{macrocode}
+% Then we define the Greek versions; the additional |\expandafter|s
+% are needed in order to make sure the table of contents will be
+% correct, e.g., when we have appendixes.
+% \begin{macrocode}
+\def\greek@alph#1{\expandafter\greeknumeral\expandafter{\the#1}}
+\def\greek@Alph#1{\expandafter\Greeknumeral\expandafter{\the#1}}
+% \end{macrocode}
+%
+% Now we can set up the switching.
+% \changes{greek-1.1a}{1997/03/03}{removed two superfluous @'s which
+% made \cs{@alph} undefined}
+% \begin{macrocode}
+\addto\extrasgreek{%
+ \let\@alph\greek@alph
+ \let\@Alph\greek@Alph}
+\addto\noextrasgreek{%
+ \let\@alph\latin@alph
+ \let\@Alph\latin@Alph}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% What is left now is the definition of a set of macros to produce
+% the various digits.
+% \begin{macro}{\gr@num@i}
+% \begin{macro}{\gr@num@ii}
+% \begin{macro}{\gr@num@iii}
+% \changes{greek-1.2b}{1997/11/13}{No longer use \cs{\let} in the
+% expansion of the \cs{gr@num@x} macros as they ned to be
+% expandable}
+% As there is no representation for $0$ in this system the zeros
+% are simply discarded. When we have a large number with three
+% \emph{trailing} zero's also the numeric mark is discarded.
+% Therefore these macros need to pass the information to each other
+% about the (non-)translation of a zero.
+% \begin{macrocode}
+\def\gr@num@i#1{%
+ \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or \textdelta\or
+ \textepsilon\or \textstigma\or \textzeta\or \texteta\or \texttheta\fi
+ \ifnum#1=\z@\else\anw@true\fi\anw@print}
+\def\gr@num@ii#1{%
+ \ifcase#1\or \textiota\or \textkappa\or \textlambda\or \textmu\or
+ \textnu\or \textxi\or \textomicron\or \textpi\or \textqoppa\fi
+ \ifnum#1=\z@\else\anw@true\fi\gr@num@i}
+\def\gr@num@iii#1{%
+ \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon\or
+ \textphi\or \textchi\or \textpsi\or \textomega\or \textsampi\fi
+ \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gr@num@iv}
+% \begin{macro}{\gr@num@v}
+% \begin{macro}{\gr@num@vi}
+% The first three `digits' always have the numeric mark, except
+% when one is discarded because it's value is zero.
+% \begin{macrocode}
+\def\gr@num@iv#1{%
+ \ifnum#1=\z@\else\textaristerikeraia\fi
+ \ifcase#1\or \textalpha\or \textbeta\or \textgamma\or \textdelta\or
+ \textepsilon\or \stigma\or \textzeta\or \texteta\or \texttheta\fi
+ \gr@num@iii}
+\def\gr@num@v#1{%
+ \ifnum#1=\z@\else\textaristerikeraia\fi
+ \ifcase#1\or \textiota\or \textkappa\or \textlambda\or \textmu\or
+ \textnu\or \textxi\or \textomicron\or \textpi\or \textqoppa\fi
+ \gr@num@iv}
+\def\gr@num@vi#1{%
+ \textaristerikeraia
+ \ifcase#1\or \textrho\or \textsigma\or \texttau\or \textupsilon\or
+ \textphi\or \textchi\or \textpsi\or \textomega\or \textsampi\fi
+ \gr@num@v}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \section{Character codes}
+%
+% Greek letters drop diacritics (eccept dialytika and sub-iota) in
+% UPPERCASE. This is not cared for by the Unicode standard.
+% The file \file{greek-euenc.def} from \pkg{greek-fontenc}
+% contains the required |\lccode| and |\uccode| corrections from the
+% \pkg{xgreek} package by Apostolos Syropoulos.
+% \changes{greek-1.5}{2013/06/21}{Support XeTeX/LuaTeX.}
+% \changes{greek-1.9d}{2015/07/06}{uclc fixes not included in greek-euenc.def}
+%
+% The LGR encoded fonts that are used to typeset Greek with 8-bit TeX
+% define ligatures for characters with diacritics. In order for this to
+% work, some characters need to be considered as letters. These
+% characters are |<|, |>|, |~|, |`|, |'|, |"| and
+% \verb=|=. Therefore, their |\lccode| is changed when Greek is in
+% effect. In order to let |\uppercase| give correct results, the
+% |\uccode| of these characters is set to a non-existing character
+% to make them disappear. Of course not all characters are needed
+% when typesetting ``modern'' $\mu o\nu o\tau o\nu
+% \iota\kappa\acute{o}$. In that case we only need the |'| and |"|
+% symbols which are treated in the proper way.
+%
+% \begin{macro}{\greek@tilde}
+% \changes{greek-1.0c}{1997/02/19}{Added command}
+% The Greek script uses a number of characters with more
+% than one accent. In LGR encoded fonts combined diacritics can be
+% obtained using Knuth's ligature mechanism (see usage.pdf).
+% Characters we need to have ligatures with are the tilde, the
+% acute and grave accent characters, the rough and smooth breathings,
+% the subscript, and the double quote character.
+% In text input the |~| is normally used to produce an
+% unbreakable space.
+% \changes{greek-1.3k}{2003/04/10}{Make sure the character `!' is not
+% active during the definition of \cs{greek@tilde}}
+% \changes{greek-1.4}{2013/05/17}{do not re-define the tilde accent macro:
+% it works as expected with \file{lgrenc.def} from \pkg{greek-fontenc}.}
+% \begin{macrocode}
+\@ifl@aded{def}{lgrenc}{%
+ \begingroup
+ \@ifundefined{active@char\string!}{}{\catcode`!=12\relax}
+ \catcode`\~=12%
+ \lccode`\!=`\~%
+ \lowercase{\def\x{\endgroup
+ \def\greek@tilde{!}}\x}
+% \end{macrocode}
+% \end{macro}
+% In order to get correct hyphenation we need to set the lower case
+% code of a number of characters. The `v' character has a special
+% usage for the |cb| fonts: in fact this ligature mechanism detects
+% the end of a word and assures that a final sigma is typeset with
+% the proper sign wich is different from that of an initial or
+% medial sigma; the `v 'after an \textit{isolated} sigma fools
+% the ligature mechanism in order to typeset $\sigma$ in place of
+% $\varsigma$. Because of this we make sure its lowercase code is
+% not changed. For ``modern'' greek we have to deal only with |'|
+% and |"| and so things are easy.
+% \changes{greek-1.1c}{1997/04/30}{fixed two typos}
+% \changes{greek-1.1e}{1997/10/12}{Added lowercase code for v}
+% \changes{greek-1.2}{1997/10/28}{Definitions for ``modern'' Greek are
+% now the definitions of ``Polutoniko'' Greek}
+% \changes{greek-1.2}{1997/10/28}{Added lowercase codes for ``modern''
+% greek}
+% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
+% \cs{extraspolutonikogreek} should be complementary}
+% \changes{babel-greek-1.9}{2014/07/20}{Added lc codes for chars 128 to 255}
+% In order to process the suitable characters and in such a way that
+% hyphenation patterns work also with precomposed characters, it is
+% necessary to declare the lc code for all characters, that can be part
+% of a word. We do this in |\extrasgreek| because this is a feature of
+% the LGR font encoding (which is the same in all language variants).
+% This means that multi-accented characters are regarded parts of a word
+% (and not non-word characters) also in monotonic spelling.
+% \changes{babel-greek-1.9e}{2015/11/27}{Fix bug in lccode-setting loop
+% (patch by Enrico Gregorio).}
+% \begin{macrocode}
+ \addto\extrasgreek{%
+ \babel@savevariable{\lccode`v}\lccode`v=`v%
+ \babel@savevariable{\lccode`\'}\lccode`\'=`\'%
+ \babel@savevariable{\lccode`\"}\lccode`\"=`\"%
+ % ``high bit characters'': set in a loop and correct exceptions
+ \@tempcnta=128%
+ \@whilenum\@tempcnta<253\do{%
+ \expandafter\babel@savevariable\expandafter{%
+ \expandafter\lccode\the\@tempcnta}%
+ \lccode\@tempcnta=\@tempcnta
+ \advance\@tempcnta\@ne
+ }%
+ % Fix non-word characters:
+ \lccode151=0%
+ \lccode155=0%
+ \lccode159=0%
+ \lccode199=0%
+ % Fix capital letters:
+ \lccode195=147% GREEK LETTER DIGAMMA
+ \lccode219=240% GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+ \lccode223=244% GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+ }
+
+ \addto\extraspolutonikogreek{%
+ % \l@greek=\bbl@polygreek
+ \babel@savevariable{\lccode`\<}\lccode`\<=`\<%
+ \babel@savevariable{\lccode`\>}\lccode`\>=`\>%
+ \babel@savevariable{\lccode`\~}\lccode`\~=`\~%
+ \babel@savevariable{\lccode`\|}\lccode`\|=`\|%
+ \babel@savevariable{\lccode`\`}\lccode`\`=`\`%
+ }
+% \end{macrocode}
+% And in order to get rid of all accents and breathings when a
+% string is |\uppercase|d we also change a number of uppercase
+% codes.
+% \changes{greek-1.1b}{1997/03/06}{Added setting of \cs{uccode}s
+% (after \file{kdgreek.sty})}
+% \changes{greek-1.1e}{1997/10/12}{Added uppercase code for special
+% letter ``v''. Uppercase code for accents is now \texttt{9f},
+% instead of \texttt{ff}}
+% \changes{greek-1.2}{1997/10/28}{Added uppercase codes for ``modern''
+% Greek. The old codes are now for ``Polutoniko'' Greek}
+% \changes{greek-1.3e}{1999/09/24}{\cs{extrasgreek} and
+% \cs{extraspolutonikogreek} should be complementary}
+% {\catcode`|=12\relax\gdef\indexbar{\cs{|}}}
+% \changes{greek-1.3g}{1999/11/17}{uc code of \indexbar{} is now just
+% \indexbar{} to reflect recent changes in the cb fonts}
+% \changes{greek-1.3i}{2000/10/02}{uc code of `v' is switched to V
+% so that mixed text appears correctly in headers.}
+% \changes{greek-1.3j}{2001/02/03}{Because other languages might
+% make the caret active, we can't use the double caret notation
+% here}
+% \begin{macrocode}
+ \addto\extrasgreek{%
+ \babel@savevariable{\uccode`\"}\uccode`\"=`\"%
+ \babel@savevariable{\uccode`\'}\uccode`\'=159% 159 == ^^9f
+ }
+ \addto\extraspolutonikogreek{%
+ \babel@savevariable{\uccode`\~}\uccode`\~=159%
+ \babel@savevariable{\uccode`\>}\uccode`\>=159%
+ \babel@savevariable{\uccode`\<}\uccode`\<=159%
+ \babel@savevariable{\uccode`\|}\uccode`\|=`\|%
+ \babel@savevariable{\uccode`\`}\uccode`\`=159%
+ }
+% \end{macrocode}
+% For this to work we make the character |^^9f| a shorthand that
+% expands to nothing. In order for this to work we need to make a
+% character look like |^^9f| in \TeX's eyes. The trick is to have
+% another character and assign it a different lowercase code. The
+% execute the macros needed in a |\lowercase| environment. Usually
+% the tilde |~| character is used for such purposes. Before we do
+% this we save it's original lowercase code to restore it once
+% we're done.
+% \changes{greek-1.1b}{1997/03/06}{Added shorthand for \cs{char255}}
+% \changes{greek-1.1e}{1997/10/12}{Shorthand is changed. Active
+% character is now \cs{char159}}
+% \changes{greek-1.2a}{1997/10/31}{Need shorthand to exist for
+% ``monotoniko'' Greek, not ``polutoniko'' Greek}
+% \changes{greek-1.3j}{2001/02/03}{Use the tilde as an alias for
+% character 159}
+% \begin{macrocode}
+ \@tempcnta=\lccode`\~
+ \lccode`\~=159
+ \lowercase{%
+ \initiate@active@char{~}%
+ \declare@shorthand{greek}{~}{}}
+ \lccode`\~=\@tempcnta
+% \end{macrocode}
+% Add composite commands, so that the dialytika is kept or put on the
+% following character of a diphthong with |\MakeUppercase|
+% (see lgrdef.enc from the the greek-fontenc package for details).
+% \changes{greek-1.4}{2013/05/17}{Add TextCompositeCommands for
+% ``uppercase diacritics''.}
+% \changes{greek-1.5}{2013/05/27}{Bugfix: @hiatus->LGR@hiatus}
+% \changes{greek-1.5a}{2013/07/02}{Replaced non-printable literal character
+% with ^^-notation (thanks to Heiko Oberdiek for the hint).}
+% \changes{greek-1.9}{2014/07/20}{The |^^|-notation seems to require lower case
+% letters. |^^9F| failed.}
+% \begin{macrocode}
+ \DeclareTextCompositeCommand{\"}{LGR}{^^9f}{\accdialytika}
+ \DeclareTextCompositeCommand{\'}{LGR}{^^9f}{\LGR@hiatus}
+ \DeclareTextCompositeCommand{\`}{LGR}{^^9f}{\LGR@hiatus}
+% \end{macrocode}
+%
+% We can also make the tilde character itself expand to a tilde with
+% category code 12 to make the typing of texts easier.
+% \changes{greek-1.1b}{1997/03/06}{Made tilde expand to a tilde with
+% \cs{catcode 12}.}
+% \changes{greek-1.5a}{2013/06/27}{provide ``extraspolutonikogreek'' also
+% for Xe/LuaTeX.}
+% \begin{macrocode}
+ \addto\extraspolutonikogreek{\languageshorthands{greek}}%
+ \declare@shorthand{greek}{~}{\greek@tilde}
+}{} % End of LGR-specific code.
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{symbol name aliases}
+% For backwards compatibility, we keep aliases for a few symbols.
+% \changes{greek-1.1c}{1997/03/10}{Added a couple of symbols, needed
+% for \cs{greeknumeral}}
+% \changes{greek-1.1e}{1997/10/12}{Most symbols are removed and are
+% now defined in package grsymb}
+% \changes{greek-1.2c}{1998/06/26}{Package grsymb has been eliminated
+% because the CB fonts v2.0 do not inlcude certain symbols and so
+% the remaining symbol definitions have been moved here}
+% \changes{greek-1.5}{2013/06/11}{change symbol macros to aliases}
+% \begin{macrocode}
+\providecommand*{\anwtonos}{\textdexiakeraia}
+\providecommand*{\katwtonos}{\textaristerikeraia}
+\providecommand*{\qoppa}{\textqoppa}
+\providecommand*{\stigma}{\textstigma}
+\providecommand*{\sampi}{\textsampi}
+\providecommand*{\Digamma}{\textDigamma}
+\providecommand*{\ddigamma}{\textdigamma}
+\providecommand*{\vardigamma}{\textvardigamma}
+\providecommand*{\euro}{\texteuro}
+\providecommand*{\permill}{\textperthousand}
+% \end{macrocode}
+%
+% \changes{greek-1.3l}{2004/02/19}{Commented these lines out as this
+% change has made it into \LaTeX{} itself.}
+% \changes{greek-1.8}{2013/11/27}{Remove the redefintion of fnum@figure
+% and fnum@table.}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{greek-1.0b}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek.ins b/macros/latex/contrib/babel-contrib/greek/babel-greek.ins
new file mode 100644
index 0000000000..15e136d3ad
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/babel-greek.ins
@@ -0,0 +1,105 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the babel-greek package.
+%% ---------------------------------------------
+%%
+%% Babel-greek is a contributed package providing support for the Greek
+%% language and script via the Babel system (http://www.ctan.org/pkg/babel)
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Günter Milde <milde@users.sf.net>.
+%%
+%% The list of derived (unpacked) files belonging to the package
+%% and covered by LPPL is defined by the unpacking script (babel-greek.ins)
+%% which is part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2015/07/06}
+\def\batchfile{babel-greek.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Apostolos Syropoulos, Johannes L. Braams, Guenter Milde,
+and the authors listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the babel-greek package.
+----------------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Günter Milde <milde@users.sf.net>.
+
+Babel-greek is a contributed package providing support for the Greek
+language and script via the Babel system (http://www.ctan.org/pkg/babel).
+
+The list of derived (unpacked) files belonging to this work
+and covered by LPPL is defined by the unpacking script (babel-greek.ins)
+which is part of the package.
+\endpreamble
+
+
+\keepsilent
+
+\usedir{macros/latex/contrib/babel-contrib/greek}
+
+\usepreamble\mainpreamble
+\generate{\file{greek.ldf}{\from{babel-greek.dtx}{code}}
+ \file{athnum.sty}{\from{athnum.dtx}{package}}
+ \file{grmath.sty}{\from{grmath.dtx}{package}}
+ }
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move `greek.ldf and all}
+\Msg{* files ending with `.sty' into a directory searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf b/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf
new file mode 100644
index 0000000000..d877d86834
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/grmath.dtx b/macros/latex/contrib/babel-contrib/greek/grmath.dtx
new file mode 100644
index 0000000000..000daadcd8
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/grmath.dtx
@@ -0,0 +1,168 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%% \CheckSum{126}
+%
+%\iffalse
+%
+%% This is file `grmath.sty'
+%% (c) 1997-2005 Apostolos Syropoulos.
+%% All rights reserved.
+% You are allowed to modify this file as long the initial copyright notice
+% appears in the modified file.
+%
+% Please report errors or suggestions for improvement to
+%
+% Apostolos Syropoulos
+% 366, 28th October Str.
+% GR-671 00 Xanthi, GREECE
+%
+% apostolo at platon.ee.duth.gr or apostolo at obelix.ee.duth.gr
+%
+%\fi
+%\iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{grmath.drv}
+\begin{document}
+ \DocInput{grmath.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%\fi
+%
+% \changes{grmath-1.2}{2001/02/12}{Package provides options ``grlog''
+% (default) and ``enlog'' that create Greek and Latin names
+% log functions}
+%
+% \title{Greek log-like Operators}
+% \author{Apostolos Syropoulos\\
+% 366, 28th October Str.\\
+% GR-671 00 Xanthi, HELLAS\\
+% E-mail: \texttt{apostolo@platon.ee.duth.gr}}
+% \date{2001/02/12}
+% \maketitle
+%
+% \MakeShortVerb{|}
+% \section{What is this all about?}
+%
+% In Greece, until recently, it was common practice to write down most
+% log-like functions as abbreviations of their Greek names. Consequently,
+% high school students and even university freshmen were not familiar with
+% the Latin names employed in international literature. However, this practice
+% is fading away in universities but it is still in wide use in books for
+% high schools, mainly because the Latin names would produce nothing but
+% confusion. The package |grmath| redefines most log-like definitions
+% so that they produce the Greek name, instead of the Latin one. The package
+% can be used only in conjunction with the |greek| option of the |babel|
+% package. The new option |enlog| allows one to keep the Latin names for
+% the log functions.
+% \StopEventually
+%
+% \section{The Implementation}
+%
+% As usual we must first identify ourselves.
+%
+% \begin{macrocode}
+%<*package>
+\ProvidesPackage{grmath}[2001/02/12\space v1.2]
+\typeout{Package: `grmath' v1.2\space <2001/02/12> (A. Syropoulos)}
+% \end{macrocode}
+%
+% The next thing we do is to process the options. The default option
+% ``grlog'' generates Greek names for log functions and the ``enlog''
+% option generates Latin names for log functions.
+% \begin{macrocode}
+\DeclareOption{grlog}{%
+ \def\log{\mathop{\mathgroup\symgroperators log_{10}}\nolimits}
+ \def\ln{\mathop{\mathgroup\symgroperators log_%
+ {\mathgroup\symoperators e}}\nolimits}
+}
+\DeclareOption{enlog}{%
+ \def\log{\mathop{\operator@font log}\nolimits}
+ \def\ln{\mathop{\operator@font ln}\nolimits}
+}
+\ExecuteOptions{grlog}
+\ProcessOptions
+% \end{macrocode}
+%
+% Now we check to see if the |babel| package is loaded with at least
+% the |greek| option. In case it isn't, we opt to produce an error message.
+% \begin{macrocode}
+\@ifpackagewith{babel}{greek}{}{%
+ \@ifpackagewith{babel}{polutonikogreek}{}{%
+ \PackageError{grmath}{%
+ `greek' option of the `babel'\MessageBreak
+ package hasn't been loaded}{%
+ The commands provided by this package\MessageBreak
+ are specially designed for greek language\MessageBreak
+ typesetting with the `babel' package. Load\MessageBreak
+ it with at least the `greek' option.}\relax
+ }}
+% \end{macrocode}
+%
+% We define the mathematical font which will be used to typeset
+% the log-like functions.
+% \begin{macrocode}
+\DeclareSymbolFont{groperators}{LGR}{cmr}{m}{n}
+\SetSymbolFont{groperators}{bold}{LGR}{cmr}{bx}{n}
+% \end{macrocode}
+%
+% We are now ready to proceed with the redefinitions of the log-like
+% operator names.
+% \begin{macrocode}
+\def\sin{\mathop{\mathgroup\symgroperators hm}\nolimits}
+\def\cos{\mathop{\mathgroup\symgroperators sun}\nolimits}
+\def\tan{\mathop{\mathgroup\symgroperators ef}\nolimits}
+\def\arcsin{\mathop{\mathgroup\symgroperators toxhm}\nolimits}
+\def\arccos{\mathop{\mathgroup\symgroperators toxsun}\nolimits}
+\def\arctan{\mathop{\mathgroup\symgroperators toxef}\nolimits}
+\def\cot{\mathop{\mathgroup\symgroperators sf}\nolimits}
+\def\sec{\mathop{\mathgroup\symgroperators tem}\nolimits}
+\def\csc{\mathop{\mathgroup\symgroperators stem}\nolimits}
+\def\gcd{\mathop{\mathgroup\symgroperators MKD}\nolimits}
+% \end{macrocode}
+% In the standard \LaTeX\ distribution there is no provision for a
+% Least Common Multiple (lcm) log-like operator. Since, this operator
+% appears quite often in greek literature we opt to include it. Moreover,
+% we include three more log-like functions: |\arccot|, |\arcsec| and
+% |\arccsc|.
+% \begin{macrocode}
+\def\lcm{\mathop{\mathgroup\symgroperators EKP}\nolimits}
+\def\arccot{\mathop{\mathgroup\symgroperators toxsf}\nolimits}
+\def\arcsec{\mathop{\mathgroup\symgroperators toxtem}\nolimits}
+\def\arccsc{\mathop{\mathgroup\symgroperators toxstem}\nolimits}
+%</package>
+% \end{macrocode}
+%
+% \section*{Dedication}
+% I would like to dedicate this piece of work to my son
+% \begin{center}Demetrios-Georgios.\end{center}
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/greek/grmath.pdf b/macros/latex/contrib/babel-contrib/greek/grmath.pdf
new file mode 100644
index 0000000000..b97893d195
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/grmath.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/test-greek.pdf b/macros/latex/contrib/babel-contrib/greek/test-greek.pdf
new file mode 100644
index 0000000000..ac09a44166
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-greek.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/test-greek.tex b/macros/latex/contrib/babel-contrib/greek/test-greek.tex
new file mode 100644
index 0000000000..5498dfc96b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-greek.tex
@@ -0,0 +1,428 @@
+\documentclass[a4paper]{article}
+\usepackage[LGR,T1]{fontenc}
+
+% Xe/LuaTeX in 8-bit compatibility mode:
+% hyphenation in Greek text parts fails!
+% (would require the 8-bit, LGR-encoded patterns in the XeTeX ini and a
+% loader fix for luatex).
+
+% TODO: why does XeTeXinputencoding "bytes" no longer work with inputenc's
+% utf8 option?
+\ifdefined \XeTeXrevision
+ \XeTeXinputencoding "bytes"
+\fi
+
+\ifdefined\luatexversion
+ \usepackage[utf8]{luainputenc}
+\else
+ \usepackage[utf8]{inputenc}
+\fi
+% \usepackage{textalpha}
+\usepackage{textcomp}
+\usepackage{hyperref,bookmark}
+\usepackage{parskip}
+\usepackage{booktabs}
+
+\usepackage{lmodern}
+% \usepackage{kerkis}
+% \usepackage{gfsdidot}
+
+% Load the Babel package with Greek and English language definitions:
+%
+% Uncomment the desired language variant
+
+% Default: modern monotonic Greek
+\usepackage[greek,english]{babel}
+% Obsolete: used instead of `greek', kept for backwards compatibility:
+% \usepackage[polutonikogreek,english]{babel}
+
+% For backwards compatibility, you can also use
+% \selectlanguage{polutonikogreek} instead of \selectlanguage{greek} etc.
+% if the (modern) polytonic Greek language variant is selected.
+
+% uncomment for modern polytonic Greek
+% \languageattribute{greek}{polutoniko}
+
+% uncomment for ancient Greek
+\languageattribute{greek}{ancient}
+
+% \message{Latin encoding is \latinencoding}
+
+\DeclareTextCommandDefault{\ensuregreek}{\textgreek}
+
+\begin{document}
+
+\title{Test the Greek support for Babel}
+\author{Günter Milde}
+\date{2014/09/02}
+\maketitle
+
+The babel option ``greek'' activates the support for the Greek language
+defined in the file \texttt{greek.ldf} (source \texttt{greek.dtx}).
+
+\section{Language Switch}
+
+The declaration \verb|\selectlanguage| switches between languages.
+
+\begin{quote}
+ \selectlanguage{greek}
+ Τί φήις; Ἱδὼν ἐνθέδε παῖδ’ ἐλευθέραν
+ τὰς πλησίον Νύμφας στεφανοῦσαν, Σώστρατε,
+ ἐρῶν άπῆλθες εὐθύς;
+\end{quote}
+
+The macro \verb|\foreignlanguage| sets its second argument in the specified
+language. This is intended for short text parts or single words like
+\foreignlanguage{greek}{Βιβλιοθήκη}.
+
+There should be no inserted space before or after the language switch (may
+happen if there are unescaped linebreaks in the font or language definitions):
+
+\begin{quote}
+ Change script with \verb|ensuregreek|: |\ensuregreek{do\~ulos}|. Change
+ language with \verb|\foreignlanguage|: |\foreignlanguage{greek}{do\~ulos}|.
+\end{quote}
+
+\section{Font Encoding}
+
+In Greek text parts, the font encoding is automatically set to LGR if an
+8-bit TeX engine is used. (See \url{test-unicode-greek.tex} for usage of
+babel-greek with XeTeX or LuaTeX.)
+
+LGR has Greek characters in the slots reserved in a TeX \emph{standard text
+font encoding}. This means you need an explicit font encoding change for
+every Latin letter and some other symbols if the current font encoding is
+LGR.
+
+The Babel core defines the declaration \verb|\latintext| and the command
+\verb|\textlatin| to switch to the T1 or OT1 font encoding or typeset the
+argument using this encoding.
+
+Switching to a font encoding supporting the Greek script is possible without
+switching the Babel language using the declarations \verb|\greekscript| (no
+switch if the current encoding supports Greek script (e.g. the Unicode font
+encodings EU1, EU2)) or \verb|\greektext| (always switch to LGR) and the
+corresponding macros \verb|\ensuregreek| or \verb|\textgreek|. These
+commands do not start a new paragraph:
+
+\greekscript Φίλων τοῦ \textlatin{TeX} (ΕΦΤ) --
+\latintext Friends (\ensuregreek{F\'ilwn}) of TeX.
+
+\texttt{greek.ldf} has some workarounds, so that macros relying on Latin
+characters in the ``right'' positions keep working. We test, that these
+definitions do not overwrite the selection of pre-composed characters for
+``copyright'' and ``registered trade mark'' by ``textcomp'' (try copy and
+paste from the PDF output):
+
+Greek (LGR): \ensuregreek{Α \& Ω, \textcopyright{} \textregistered{}
+\texttrademark{}, © ® ™ } \\
+Latin: A \& O.
+
+To prevent Roman numerals being typeset in Greek letters we need to adopt
+the internal LaTeX commands. Note that this may cause errors when roman
+numerals are used in a situation where the macros need to be expanded:
+
+\makeatletter
+Greek: \ensuregreek{
+\@roman{1}, \@roman{2}, \@roman{3}, \@roman{4}, \ldots, \@roman{1975}
+\@Roman{1}, \@Roman{2}, \@Roman{3}, \@Roman{4}, \ldots, \@Roman{1975}
+}
+
+Latin:
+\@roman{1}, \@roman{2}, \@roman{3}, \@roman{4}, \ldots, \@roman{1975}
+\@Roman{1}, \@Roman{2}, \@Roman{3}, \@Roman{4}, \ldots, \@Roman{1975}
+\makeatother
+
+\section{MakeUppercase, MakeLowercase}
+
+Capital Greek letters have diacritics (except the dialytika and sub-iota) to
+the left (instead of above) and drop them in uppercase, e.g.
+\ensuregreek{μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}}.
+
+Upcased letters with diacritics keep the dialytika. This is implemented for
+all input variants of diacritics with dialytika. (\texttt{greek.ldf} has
+\emph{composite command} definitions to ensure this also works for accent
+characters "upcased" to the charcter No 159.)
+
+\foreignlanguage{greek}{\"i \"'i \"`i \"~i \'"i \`"i \~"i
+ \"u \"\'u \"\`u \"\~u
+ ϊ ΐ ῒ ῗ ΐ ῒ ῗ ϋ ΰ ῢ ῧ
+ $\mapsto$ \MakeUppercase{\"i \"'i \"`i \"~i \'"i \`"i \~"i
+ \"u \"\'u \"\`u \"\~u
+ ϊ ΐ ῒ ῗ ΐ ῒ ῗ ϋ ΰ ῢ ῧ
+ }
+}
+
+
+Tonos and dasia mark a \emph{hiatus} (break-up of a diphtong) if
+placed on the first vowel of a diphtong
+(\ensuregreek{\'ai, \'au, \'ei, \'>ai, \'>au, \'>ei}).
+A dialytika must be placed on the second vowel if they are dropped:
+(\ensuregreek{\MakeUppercase{\'ai, \'au, \'ei, \'>ai, \'>au, \'>ei}}).
+
+\selectlanguage{greek}
+% from teubner: άυλος/ΑΫΛΟΣ
+\'aulos $\mapsto$ \MakeUppercase{\'aulos},
+\'>aulos $\mapsto$ \MakeUppercase{\'>aulos},
+% from http://diacritics.typo.cz/index.php?id=69 μάινα -> ΜΑΪΝΑ
+m\'aina $\mapsto$ \MakeUppercase{m\'aina},
+% from http://de.wikipedia.org/wiki/Neugriechische_Orthographie#Das_Trema
+% κέικ, ἀυπνία/αϋπνία
+k\'eik, $\mapsto$ \MakeUppercase{k\'eik}
+\accpsili{a}upn\'ia $\mapsto$ \MakeUppercase{\accpsili{a}upn\'ia}
+\selectlanguage{english}
+
+There are several alternative styles for the capitalized sub-iota.
+
+In order to let the Up/Downcasing work also with the Latin transcription
+defined by the LGR font encoding, ``babel-greek'' also defines lc/uccodes
+for non-standard assignments:
+
+\selectlanguage{greek}
+', ", `, >, <, | $\mapsto$ \MakeUppercase{', ", `, >, <, |}
+\selectlanguage{english}
+
+The uppercase of the zero-width space at the place of ``v'' is kept to point
+to the glyph at the position of ``V'', the Dasia-Oxia accent
+(\ensuregreek{\MakeUppercase{v}}):
+
+\begin{quotation}
+ greek-1.3i 2000/10/02: uc code of `v' is switched to V
+ so that mixed text appears correctly in headers.
+\end{quotation}
+
+Use \verb+\textcompwordmark+:
+not \foreignlanguage{greek}{avu $\mapsto$ \MakeUppercase{avu}} but
+\foreignlanguage{greek}{a\textcompwordmark u
+$\mapsto$ \MakeUppercase{a\textcompwordmark u}}
+
+The following subsections test MakeUppercase and MakeLowercase with all
+characters defined in lgrenc.dfu:
+
+\subsection{Greek and Coptic}
+
+\newcommand{\GreekAndCoptic}{\ensuregreek{
+ʹ͵ͺ; ΄ ΅Ά·ΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϘϚϜϠ}}
+\newcommand{\greekandcoptic}{\ensuregreek{
+άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϙϛϝϟϡ}}
+
+Characters of the Greek and Coptic Unicode Block:
+
+\begin{quote}
+ \GreekAndCoptic\\
+ \greekandcoptic
+\end{quote}
+
+MakeUppercase:
+
+\begin{quote}
+ \MakeUppercase{\GreekAndCoptic}\\
+ \MakeUppercase{\greekandcoptic}
+\end{quote}
+
+Letters and sub-iota upcased, other diacritics except dialytika dropped.
+
+There is no capital Koppa in LGR, therefore \ensuregreek{ϟ} is left
+unchanged with MakeUppercase.
+
+
+MakeLowercase:
+
+\begin{quote}
+ \MakeLowercase{\GreekAndCoptic}\\
+ \MakeLowercase{\greekandcoptic}
+\end{quote}
+
+The lowercase of \ensuregreek{Σ} is the «auto-sigma» (\verb+\textautosigma+):
+\ensuregreek{ΣΣ $\mapsto$ \MakeLowercase{ΣΣ}}. Add a ZWNJ or use the
+\verb+\noboundary+ macro to prevent conversion to final sigma:
+\ensuregreek{\MakeLowercase{ΣΣ‌}}. The lowercase of GREEK LETTER STIGMA
+\ensuregreek{Ϛ} is \ensuregreek{\MakeLowercase{Ϛ}} not \verb|\textvarstigma|
+(\ensuregreek\textvarstigma).
+
+% \newpage
+
+\subsection{Greek extended}
+
+Characters of the Greek extended Unicode block:
+
+\selectlanguage{greek}
+ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ \\
+ἐ ἑ ἒ ἓ ἔ ἕ Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ \\
+ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ \\
+ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ \\
+ὀ ὁ ὂ ὃ ὄ ὅ Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ \\
+ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ Ὑ Ὓ Ὕ Ὗ \\
+ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ \\
+ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ \\
+ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ \\
+ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ \\
+ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ \\
+ᾰ ᾱ ᾲ ᾳ ᾴ ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ \\
+῀ ῁ ῂ ῃ ῄ ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ \\
+ῐ ῑ ῒ ΐ ῖ ῗ Ῐ Ῑ Ὶ Ί ῝ ῞ ῟ \\
+ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` \\
+ ῲ ῳ ῴ ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾
+\selectlanguage{english}
+
+MakeUppercase:
+
+\selectlanguage{greek}
+
+\MakeUppercase{ ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ }\\
+\MakeUppercase{ ἐ ἑ ἒ ἓ ἔ ἕ Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ }\\
+\MakeUppercase{ ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ }\\
+\MakeUppercase{ ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ }\\
+\MakeUppercase{ ὀ ὁ ὂ ὃ ὄ ὅ Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ }\\
+\MakeUppercase{ ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ Ὑ Ὓ Ὕ Ὗ }\\
+\MakeUppercase{ ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ }\\
+\MakeUppercase{ ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ }\\
+\MakeUppercase{ ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ }\\
+\MakeUppercase{ ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ }\\
+\MakeUppercase{ ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ }\\
+\MakeUppercase{ ᾰ ᾱ ᾲ ᾳ ᾴ ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ }\\
+\MakeUppercase{ ῀ ῁ ῂ ῃ ῄ ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ }\\
+\MakeUppercase{ ῐ ῑ ῒ ΐ ῖ ῗ Ῐ Ῑ Ὶ Ί ῝ ῞ ῟ }\\
+\MakeUppercase{ ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` }\\
+\MakeUppercase{ ῲ ῳ ῴ ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾ }
+\selectlanguage{english}
+
+MakeLowercase:
+
+\selectlanguage{greek}
+\MakeLowercase{ ἀ ἁ ἂ ἃ ἄ ἅ ἆ ἇ Ἀ Ἁ Ἂ Ἃ Ἄ Ἅ Ἆ Ἇ }\\
+\MakeLowercase{ ἐ ἑ ἒ ἓ ἔ ἕ Ἐ Ἑ Ἒ Ἓ Ἔ Ἕ }\\
+\MakeLowercase{ ἠ ἡ ἢ ἣ ἤ ἥ ἦ ἧ Ἠ Ἡ Ἢ Ἣ Ἤ Ἥ Ἦ Ἧ }\\
+\MakeLowercase{ ἰ ἱ ἲ ἳ ἴ ἵ ἶ ἷ Ἰ Ἱ Ἲ Ἳ Ἴ Ἵ Ἶ Ἷ }\\
+\MakeLowercase{ ὀ ὁ ὂ ὃ ὄ ὅ Ὀ Ὁ Ὂ Ὃ Ὄ Ὅ }\\
+\MakeLowercase{ ὐ ὑ ὒ ὓ ὔ ὕ ὖ ὗ Ὑ Ὓ Ὕ Ὗ }\\
+\MakeLowercase{ ὠ ὡ ὢ ὣ ὤ ὥ ὦ ὧ Ὠ Ὡ Ὢ Ὣ Ὤ Ὥ Ὦ Ὧ }\\
+\MakeLowercase{ ὰ ά ὲ έ ὴ ή ὶ ί ὸ ό ὺ ύ ὼ ώ }\\
+\MakeLowercase{ ᾀ ᾁ ᾂ ᾃ ᾄ ᾅ ᾆ ᾇ ᾈ ᾉ ᾊ ᾋ ᾌ ᾍ ᾎ ᾏ }\\
+\MakeLowercase{ ᾐ ᾑ ᾒ ᾓ ᾔ ᾕ ᾖ ᾗ ᾘ ᾙ ᾚ ᾛ ᾜ ᾝ ᾞ ᾟ }\\
+\MakeLowercase{ ᾠ ᾡ ᾢ ᾣ ᾤ ᾥ ᾦ ᾧ ᾨ ᾩ ᾪ ᾫ ᾬ ᾭ ᾮ ᾯ }\\
+\MakeLowercase{ ᾰ ᾱ ᾲ ᾳ ᾴ ᾶ ᾷ Ᾰ Ᾱ Ὰ Ά ᾼ ᾽ ι ᾿ }\\
+\MakeLowercase{ ῀ ῁ ῂ ῃ ῄ ῆ ῇ Ὲ Έ Ὴ Ή ῌ ῍ ῎ ῏ }\\
+\MakeLowercase{ ῐ ῑ ῒ ΐ ῖ ῗ Ῐ Ῑ Ὶ Ί ῝ ῞ ῟ }\\
+\MakeLowercase{ ῠ ῡ ῢ ΰ ῤ ῥ ῦ ῧ Ῠ Ῡ Ὺ Ύ Ῥ ῭ ΅ ` }\\
+\MakeLowercase{ ῲ ῳ ῴ ῶ ῷ Ὸ Ό Ὼ Ώ ῼ ´ ῾ }
+\selectlanguage{english}
+
+\section{Babel Strings}
+
+Babel defines macros for several autogenerated strings so that they may
+appear in the choosen language. babel-greek uses LICRs in order to let the
+string macros work independent of the font encoding, in both 8-bit and
+Unicode-aware TeX.
+
+\subsection{Captions}
+
+\selectlanguage{greek}
+\prefacename,
+\refname,
+\abstractname,
+\bibname,
+\chaptername,
+\appendixname,
+\contentsname,
+\listfigurename ,
+\listtablename,
+\indexname,
+\figurename,
+\tablename,
+\partname,
+\enclname,
+\ccname,
+\headtoname,
+\pagename,
+\seename,
+\alsoname,
+\proofname,
+\glossaryname,
+\selectlanguage{english}
+
+
+\subsection{Months}
+
+\selectlanguage{greek}
+\newcounter{foo}
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\selectlanguage{english}
+
+\section{Greek Numerals}
+
+See greek.pdf for the formation rules of Greek numerals.
+Some examples:
+
+\selectlanguage{greek}
+
+\greeknumeral{1},
+\greeknumeral{2},
+\greeknumeral{3},
+\greeknumeral{4},
+\greeknumeral{5},
+\greeknumeral{6},
+\greeknumeral{7},
+\greeknumeral{8},
+\greeknumeral{9},
+\greeknumeral{10},
+\greeknumeral{11},
+\greeknumeral{12},
+\greeknumeral{20},
+\greeknumeral{345},
+\greeknumeral{500},
+\greeknumeral{1997},
+\greeknumeral{2013},
+
+\Greeknumeral{1},
+\Greeknumeral{2},
+\Greeknumeral{3},
+\Greeknumeral{4},
+\Greeknumeral{5},
+\Greeknumeral{6},
+\Greeknumeral{7},
+\Greeknumeral{8},
+\Greeknumeral{9},
+\Greeknumeral{10},
+\Greeknumeral{11},
+\Greeknumeral{12},
+\Greeknumeral{20},
+\Greeknumeral{345},
+\Greeknumeral{500},
+\Greeknumeral{1997},
+\Greeknumeral{2013},
+
+\selectlanguage{english}
+
+Enumerated lists use Greek numerals in the second and fourth level:
+
+\selectlanguage{greek}
+\begin{enumerate}
+ \item \textlatin{Item} 1
+ \begin{enumerate}
+ \item \textlatin{Item} 1.1
+ \begin{enumerate}
+ \item \textlatin{Item} 1.1.1
+ \begin{enumerate}
+ \item \textlatin{Item} 1.1.1.1
+ \item \textlatin{Item} 1.1.1.2
+ \end{enumerate}
+ \item \textlatin{Item} 1.1.2
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+\selectlanguage{english}
+
+
+\end{document}
diff --git a/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.pdf b/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.pdf
new file mode 100644
index 0000000000..b243fcc3ed
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.tex b/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.tex
new file mode 100644
index 0000000000..b794be139b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-unicode-greek.tex
@@ -0,0 +1,258 @@
+\documentclass[a4paper]{article}
+% \usepackage{textcomp}
+\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
+\usepackage{bookmark}
+\usepackage{parskip}
+
+\usepackage[tuenc]{fontspec}
+\setmainfont{Linux Libertine O}
+\setsansfont{Linux Biolinum O}
+% \setmainfont{DejaVu Serif}
+% \setmainfont{Droid Serif} % only monotonic Greek (subset of Greek and Coptic)
+
+\usepackage[greek,english]{babel}
+% \languageattribute{greek}{polutoniko}
+\languageattribute{greek}{ancient}
+
+\message{greek-euenc ist}
+\makeatletter
+\@ifl@aded{def}{greek-fontenc}{\message{geladen}}{\message{nicht geladen}}
+\makeatother
+
+
+\begin{document}
+
+\title{Greek support for Babel with XeTeX/LuaTeX}
+\author{Günter Milde}
+\date{2016/09/07}
+\maketitle
+
+The babel option «greek» activates the support for the Greek language
+defined in the file «greek.ldf» (source «greek.dtx»).
+
+Typesetting Greek texts requires a font containing Greek letters. With the
+XeTeX or LuaTeX engines, the user must ensure that the selected font
+contains the required glyphs (the default Latin Modern fonts miss them).
+Examples for suitable fonts are the «Deja Vu», «Linux Libertine», or
+«Free Serif» OpenType fonts.
+
+\section{Language Switch}
+
+The declaration \verb|\selectlanguage| switches between languages.
+
+\begin{quote}
+ \selectlanguage{greek}
+ Τί φήις; Ἱδὼν ἐνθέδε παῖδ’ ἐλευθέραν
+ τὰς πλησίον Νύμφας στεφανοῦσαν, Σώστρατε,
+ ἐρῶν άπῆλθες εὐθύς;
+\end{quote}
+
+The command \verb|\foreignlanguage| sets its second argument in the language
+specified as first argument. This is intended for short text parts like
+\foreignlanguage{greek}{Βιβλιοθήκη}.
+
+\section{Font Encoding}
+
+Every language switch to \texttt{greek} calls the \verb|\extrasgreek|
+command which in turn calls \verb|\greekscript| to ensure a Greek-supporting
+font encoding (LGR, TU, EU1, or EU2). Under XeTeX/LuaTeX the font encoding
+normally just remains Unicode (TU, EU1, or EU2). For customization, you can
+add to or redefine the \verb|\extrasgreek| command.
+
+The LGR font encoding does not support Latin characters. Therefore, the
+Babel core defines the declaration \verb|\latintext| and the command
+\verb|\textlatin| to switch to the TU, EU1, EU2, T1 or OT1 font encoding or
+typeset the argument using this encoding. At this point, the «latinencoding»
+is \latinencoding.
+
+Every language switch from \texttt{greek} calls the \verb|\noextrasgreek|
+command which in turn calls \verb|\latintext|.\\
+For customization, you can
+add to or redefine the \verb|\noextrasgreek| command.
+
+With the Unicode font encodings TU, EU1 (XeTeX), or EU2 (LuaTeX),
+Latin characters can be used in Greek text parts and
+input via the «LGR Latin transcription» is not possible.%
+\footnote{%
+ The \emph{xunicode} package provides with the \texttt{tipa} emulation an
+ example how this could be achieved also for Unicode fonts. Alternatively,
+ LGR encoded fonts can be used (see test-unicode-lgr.tex).
+}
+
+\begin{quote}
+ \greekscript Φίλων τοῦ \textlatin{TeX} (ΕΦΤ) --
+ \latintext Friends (\ensuregreek{F\'ilwn}) of TeX.%
+ \footnote{Compare the printout to the similar example in test-greek.pdf.}
+\end{quote}
+
+\section{LICR Macros}
+
+Babel defines macros for several autogenerated strings so that they may
+appear in the choosen language. \emph{babel-greek} uses LICR macros in
+order to let the string macros work independent of the font encoding.
+
+If \emph{fontspec} is loaded, \emph{babel-greek} loads Greek LICR
+definitions for the Unicode font encoding (TU, EU1 or EU2) from the file
+\texttt{greek-euenc.def} provided with
+\href{http://www.ctan.org/pkg/greek-fontenc}{greek-fontenc} since
+version~0.10.
+
+With this setup, it is also possible to use accent macros instead of
+pre-composed Unicode characters for letters with diacritics:
+«Τ\'ι φ\'ηις;», «\`<ορα = \accdasiavaria{ο}ρα».
+
+
+\subsection{Captions}
+
+\selectlanguage{greek}
+\prefacename,
+\refname,
+\abstractname,
+\bibname,
+\chaptername,
+\appendixname,
+\contentsname,
+\listfigurename ,
+\listtablename,
+\indexname,
+\figurename,
+\tablename,
+\partname,
+\enclname,
+\ccname,
+\headtoname,
+\pagename,
+\seename,
+\alsoname,
+\proofname,
+\glossaryname
+\selectlanguage{english}
+
+Test correct upcasing (dropping of accents):
+
+\selectlanguage{greek}
+\MakeUppercase{
+\prefacename,
+\refname,
+\abstractname,
+\bibname,
+\chaptername,
+\appendixname,
+\contentsname,
+\listfigurename,
+\listtablename,
+\indexname,
+\figurename,
+\tablename,
+\partname,
+\enclname,
+\ccname,
+\headtoname,
+\pagename,
+\seename,
+\alsoname,
+\proofname,
+\glossaryname
+}
+\selectlanguage{english}
+
+
+\subsection{Months}
+
+\selectlanguage{greek}
+\newcounter{foo}
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\selectlanguage{english}
+
+\section{Greek Numerals}
+
+See greek.pdf for the formation rules of Greek numerals.
+Some examples:
+
+\selectlanguage{greek}
+
+\greeknumeral{1},
+\greeknumeral{2},
+\greeknumeral{3},
+\greeknumeral{4},
+\greeknumeral{5},
+\greeknumeral{6},
+\greeknumeral{7},
+\greeknumeral{8},
+\greeknumeral{9},
+\greeknumeral{10},
+\greeknumeral{11},
+\greeknumeral{12},
+\greeknumeral{20},
+\greeknumeral{345},
+\greeknumeral{500},
+\greeknumeral{1997},
+\greeknumeral{2013},
+
+\Greeknumeral{1},
+\Greeknumeral{2},
+\Greeknumeral{3},
+\Greeknumeral{4},
+\Greeknumeral{5},
+\Greeknumeral{6},
+\Greeknumeral{7},
+\Greeknumeral{8},
+\Greeknumeral{9},
+\Greeknumeral{10},
+\Greeknumeral{11},
+\Greeknumeral{12},
+\Greeknumeral{20},
+\Greeknumeral{345},
+\Greeknumeral{500},
+\Greeknumeral{1997},
+\Greeknumeral{2013},
+
+
+Enumerated lists use Greek characters/numerals in the second and fourth level:
+
+\selectlanguage{greek}
+\begin{enumerate}
+ \item item 1
+ \begin{enumerate}
+ \item item 1.1
+ \begin{enumerate}
+ \item item 1.1.1
+ \begin{enumerate}
+ \item item 1.1.1.1
+ \item item 1.1.1.2
+ \end{enumerate}
+ \item item 1.1.2
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+\selectlanguage{english}
+
+
+This may be problematic with fonts that only partially support Greek and
+miss the numeral signs (dexiakeraia and aristerikeraia).
+
+You may redefine the commands \verb+\textdexiakeraia+ and
+\verb+\textaristerikeraia+ to some substitute characters.
+Or, if you prefer the ``normal'' enumeration, write in the preamble after
+loading babel:
+
+\begin{verbatim}
+ \makeatletter
+ \addto\extrasgreek{\let\@alph\latin@alph
+ \let\@Alph\latin@Alph}
+ \makeatother
+\end{verbatim}
+
+
+\end{document}
diff --git a/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.pdf b/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.pdf
new file mode 100644
index 0000000000..fb7ebe0ecc
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.tex b/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.tex
new file mode 100644
index 0000000000..af3502c071
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/test-unicode-lgr.tex
@@ -0,0 +1,264 @@
+\documentclass[a4paper]{article}
+% \usepackage{textcomp}
+\usepackage{hyperref,bookmark}
+\usepackage{parskip}
+
+% Declare the font encoding and Greek LICR definitions:
+\usepackage[LGR]{fontenc}
+
+% Set up Latin Modern OpenType unicode font
+\usepackage[tuenc]{fontspec}
+
+\usepackage[greek,english]{babel}
+% \languageattribute{greek}{polutoniko}
+% \languageattribute{greek}{ancient}
+
+% use LGR (8-bit CB-fonts) instead of Unicode fonts for Greek:
+% Alternatives:
+% \renewcommand*{\greekscript}{\fontencoding{LGR}\selectfont}
+\addto{\extrasgreek}{\greektext}
+
+\begin{document}
+
+\title{XeTeX/LuaTeX with LGR fonts}
+\author{Günter Milde}
+\date{2014/09/02}
+\maketitle
+
+The babel option «greek» activates the support for the Greek language
+defined in the file «greek.ldf» (source «greek.dtx»).
+
+Typesetting Greek texts requires a font containing Greek letters. With the
+XeTeX or LuaTeX engines, the user must ensure that the selected font
+contains the required glyphs (the default Latin Modern fonts miss them).
+
+Latin Modern can be combined with the matching CB-Greek 8-bit font. For the
+setup, see the preamble of this document \texttt{test-unicode-lgr.tex}
+
+Caveat: Currently, hyphenation does not work with this setup. Use it only
+for short Greek quotes or as a last ressort.
+
+\section{Language Switch}
+
+The declaration \verb|\selectlanguage| switches between languages. With
+XeTeX or LuaTeX and LGR, Unicode input is not possible. Instead, use the
+Latin transliteration or LICR macros:
+
+\begin{quote}
+ \selectlanguage{greek}
+ T'i f'hic? <Id`wn >enj'ede pa~id'' >eleuj'eran\\
+ t`ac plhs'ion N'umfac stefano~usan, S'wstrate,\\
+ >er~wn 'ap~hljec e>uj'uc?
+\end{quote}
+
+The macro \verb|\foreignlanguage| sets its second argument in the specified
+language. This is intended for short text parts like
+\foreignlanguage{greek}{Biblioj'hkh}.
+
+\section{Font Encoding}
+
+Switching to a font encoding supporting the Greek script is possible without
+switching the text language using the declarations \verb|\greekscript| or
+\verb|\greektext| (always LGR) and the macros \verb|\ensuregreek| or
+\verb|\textgreek|. These commands do not start a new paragraph.
+
+The Babel core defines the declaration \verb|\latintext| and the command
+\verb|\textlatin| to switch to the T1 or OT1 font encoding or typeset the
+argument using this encoding. \texttt{greek.ldf} adds a test for the Unicode
+font encodings TU, EU1, and EU2. Here, \verb|\latinencoding| is
+\latinencoding.
+
+With Unicode fonts, the macros \verb|\greektext| and \verb|\textgreek| are
+only defined, if the LGR font encoding is loaded via the \texttt{fontenc}
+package (see test-unicode-lgr.tex).
+
+% don't change the font encoding.
+With LGR, Latin characters in Greek text parts are typeset as Greek characters
+according to the Latin transcription defined in LGR.%
+
+\begin{quote}
+ \greektext F\'ilwn to\~u \textlatin{TeX} (EFT) --
+ \latintext{Friends (\textgreek{F\'ilwn}) of TeX.}%
+\end{quote}
+
+\section{MakeUppercase, MakeLowercase}
+
+Capital Greek letters have diacritics (except the dialytika and sub-iota) to
+the left (instead of above) and drop them in uppercase.
+
+Tonos and dasia mark a \emph{hiatus} (break-up of a diphthong) if placed on
+the first vowel of a diphtong (\textgreek{\'ai, \'au, \'ei, \'>ai, \'>au,
+\'>ei}). A dialytika must be placed on the second vowel if they are dropped.
+(\foreignlanguage{greek}{\MakeUppercase{\'ai, \'au, \'ei, \'>ai, \'>au,
+\'>ei}}).
+
+\section{LICR Macros}
+
+Babel defines macros for several autogenerated strings so that they may
+appear in the choosen language. \emph{babel-greek} uses LICR macros in
+order to let the string macros work independent of the font encoding.
+
+If \texttt{fontspec} is loaded before babel, babel-greek loads Greek LICR
+for EU1 or EU2 from the file \texttt{greek-euenc.def}
+provided with \emph{greek-fontenc} since version~0.10.
+
+\subsection{Hiatus}
+
+The «hiatus» feature works with macro input:
+
+\selectlanguage{greek}
+% from teubner: άυλος/ΑΫΛΟΣ
+\acctonos\textalpha\textupsilon\textlambda\textomicron\textfinalsigma{}
+$\mapsto$
+\MakeUppercase{\acctonos\textalpha\textupsilon\textlambda\textomicron\textfinalsigma},
+\'>\textalpha\textupsilon\textlambda\textomicron\textfinalsigma{} $\mapsto$
+\MakeUppercase{\'>\textalpha\textupsilon\textlambda\textomicron\textfinalsigma},
+% from http://diacritics.typo.cz/index.php?id=69 μάινα -> ΜΑΪΝΑ
+\textmu\acctonos\textalpha\textiota\textnu\textalpha{} $\mapsto$
+\MakeUppercase{\textmu\acctonos\textalpha\textiota\textnu\textalpha},
+% from http://de.wikipedia.org/wiki/Neugriechische_Orthographie#Das_Trema
+% κέικ, ἀυπνία/αϋπνία
+\textkappa\acctonos\textepsilon\textiota\textkappa $\mapsto$
+\MakeUppercase{\textkappa\acctonos\textepsilon\textiota\textkappa},
+\accpsili\textalpha\textupsilon\textpi\textnu\'\textiota\textalpha{} $\mapsto$
+\MakeUppercase{\accpsili\textalpha\textupsilon\textpi\textnu\'\textiota\textalpha}.
+\selectlanguage{english}
+
+\subsection{Captions}
+
+\selectlanguage{greek}
+\prefacename,
+\refname,
+\abstractname,
+\bibname,
+\chaptername,
+\appendixname,
+\contentsname,
+\listfigurename ,
+\listtablename,
+\indexname,
+\figurename,
+\tablename,
+\partname,
+\enclname,
+\ccname,
+\headtoname,
+\pagename,
+\seename,
+\alsoname,
+\proofname,
+\glossaryname
+\selectlanguage{english}
+
+Test correct upcasing (dropping of accents):
+
+\selectlanguage{greek}
+\MakeUppercase{
+\prefacename,
+\refname,
+\abstractname,
+\bibname,
+\chaptername,
+\appendixname,
+\contentsname,
+\listfigurename,
+\listtablename,
+\indexname,
+\figurename,
+\tablename,
+\partname,
+\enclname,
+\ccname,
+\headtoname,
+\pagename,
+\seename,
+\alsoname,
+\proofname,
+\glossaryname
+}
+\selectlanguage{english}
+
+
+\subsection{Months}
+
+\selectlanguage{greek}
+\newcounter{foo}
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\stepcounter{foo} \month=\value{foo} \today \\
+\selectlanguage{english}
+
+\section{Greek Numerals}
+
+See greek.pdf for the formation rules of Greek numerals.
+Some examples:
+
+\selectlanguage{greek}
+
+\greeknumeral{1},
+\greeknumeral{2},
+\greeknumeral{3},
+\greeknumeral{4},
+\greeknumeral{5},
+\greeknumeral{6},
+\greeknumeral{7},
+\greeknumeral{8},
+\greeknumeral{9},
+\greeknumeral{10},
+\greeknumeral{11},
+\greeknumeral{12},
+\greeknumeral{20},
+\greeknumeral{345},
+\greeknumeral{500},
+\greeknumeral{1997},
+\greeknumeral{2013},
+
+\Greeknumeral{1},
+\Greeknumeral{2},
+\Greeknumeral{3},
+\Greeknumeral{4},
+\Greeknumeral{5},
+\Greeknumeral{6},
+\Greeknumeral{7},
+\Greeknumeral{8},
+\Greeknumeral{9},
+\Greeknumeral{10},
+\Greeknumeral{11},
+\Greeknumeral{12},
+\Greeknumeral{20},
+\Greeknumeral{345},
+\Greeknumeral{500},
+\Greeknumeral{1997},
+\Greeknumeral{2013},
+
+
+\selectlanguage{english}
+Enumerated lists use Greek characters/numerals in the second and fourth level:
+
+\selectlanguage{greek}
+\begin{enumerate}
+ \item \textlatin{item} 1
+ \begin{enumerate}
+ \item \textlatin{item} 1.1
+ \begin{enumerate}
+ \item \textlatin{item} 1.1.1
+ \begin{enumerate}
+ \item \textlatin{item} 1.1.1.1
+ \item \textlatin{item} 1.1.1.2
+ \end{enumerate}
+ \item \textlatin{item} 1.1.2
+ \end{enumerate}
+ \end{enumerate}
+\end{enumerate}
+\selectlanguage{english}
+
+\end{document}
diff --git a/macros/latex/contrib/babel-contrib/greek/usage.pdf b/macros/latex/contrib/babel-contrib/greek/usage.pdf
new file mode 100644
index 0000000000..946f41514c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/usage.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/greek/usage.tex b/macros/latex/contrib/babel-contrib/greek/usage.tex
new file mode 100644
index 0000000000..50d76aae02
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/greek/usage.tex
@@ -0,0 +1,257 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Günter Milde.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+\documentclass[11pt]{article}
+\usepackage[american,greek]{babel}
+\languageattribute{greek}{polutoniko}
+\usepackage{athnum,grmath}
+\newcommand{\sg}{\selectlanguage{greek}}
+\newcommand{\sa}{\selectlanguage{american}}
+\begin{document}
+% \show\extrasgreek
+%\show\extraspolutonikogreek
+\selectlanguage{american}
+
+\title{Writing Greek with the \ttfamily greek\rmfamily\ option of the
+\ttfamily babel\rmfamily\ package}
+\author{Apostolos Syropoulos\\
+ 366, 28th October Str.\\
+ GR-671 00 Xanthi, GREECE\\
+ e-mail: \texttt{apostolo@platon.ee.duth.gr}}
+\date{October 15, 1997}
+\maketitle
+
+\abstract{\noindent
+This document describes the use of the Latin transliteration for Greek that
+is defined by the LGR font encoding. Today, all modern LaTeX distributions
+support literal input of Greek, which is the preferred method for new
+documents. [G. Milde 2013/12/02]}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Overview}
+
+The \texttt{greek} option of the \texttt{babel} package is an attempt to
+make it possible for someone to write Greek text with \LaTeX. The current
+version of the \texttt{greek} option supports the
+\textgreek{monotonik'o} and \textgreek{polutonik'o}
+accentual systems of the Greek language.
+Moreover, there is now support for Greek numerals. One can produce easily
+valid Greek numerals both in uppercase and lowercase forms, e.g,
+\textgreek{\greeknumeral{1997}}\ and \textgreek{\Greeknumeral{1997}}. The
+labels in second and fourth level enumerations are lowercase
+and uppercase Greek numerals correspondingly.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Typing Greek Text}
+By default, \TeX\ understands only 7-bit ASCII characters, so it is not
+possible to enter directly Greek letters.%
+\footnote{Literal input of Greek characters
+is possible with XeTeX, LuaTeX, or the greek-inputenc LaTeX package.
+G. Milde, 2013/07/19}
+Instead, someone enters Latin letters
+which are mapped to their Greek ``counterparts'' by \TeX. The following
+table shows the transliteration employed:
+\begin{center}
+\begin{tabular}{|lllllllllllll|}\hline
+\textgreek{a}&
+\textgreek{b}&
+\textgreek{g}&
+\textgreek{d}&
+\textgreek{e}&
+\textgreek{z}&
+\textgreek{h}&
+\textgreek{j}&
+\textgreek{i}&
+\textgreek{k}&
+\textgreek{l}&
+\textgreek{m}&
+\textgreek{n}\\
+a& b& g& d& e& z& h& j& i& k& l& m& n\\
+\hline
+\textgreek{x}&
+\textgreek{o}&
+\textgreek{p}&
+\textgreek{r}&
+\textgreek{sv}&
+\textgreek{t}&
+\textgreek{u}&
+\textgreek{f}&
+\textgreek{q}&
+\textgreek{y}&
+\textgreek{w}&
+\textgreek{c}& \hbox{ } \\
+x& o& p& r& s&
+t& u& f& q& y& w& c& \hbox{ }\\ \hline
+\end{tabular}
+\end{center}
+Please, note that in order to produce the letter \textgreek{sv} in isolation
+on has to type \texttt{sv}. This feature is due to the strong ligature
+that \TeX\ employs.
+In the ``modern'' \textgreek{monotonik'o} accentual system only one accent is
+used---\textgreek{oxe'ia} (acute). In the traditional \textgreek{polutonik'o}
+accentual system we
+need more accents and breathing signs. We can produce an accented letter by
+prefixing the letter with he symbol that denotes the accent, e.g.,
+\texttt{>a'erac} produces the word \sg >a'erac.\sa\footnote{For the
+technically inclined reader, we must say that \TeX\ uses the ligature table of
+the font in order to determine the character that corresponds to the
+input character sequence.} Here are the symbols that are recognized:
+
+\begin{center}
+\begin{tabular}{cccc}\hline
+Accent & Symbol & Example & Output\\ \hline
+acute & \texttt{'} & \texttt{g'ata} & \textgreek{g'ata}\\
+grave & \texttt{`} & \texttt{dad`i} & \textgreek{dad`i}\\
+circumflex & \verb+~+ & \verb+ful~hc+ & \sg\textgreek{ful~hc}\sa\\
+rough breathing & \verb+<+ & \verb+<'otan+ & \sg\textgreek{<'otan}\sa\\
+smooth breathing & \verb+>+ & \verb+>'aneu+ & \sg\textgreek{>'aneu}\sa\\
+subscript & \texttt{|} & \verb+>anate'ilh|+ & \sg\textgreek{>anate'ilh|}\\
+dieresis & \texttt{"}& \texttt{qa"ide'uh|c} & \sg\textgreek{qa"ide'uh|c}\\
+\hline
+\end{tabular}
+\end{center}
+Note that the subscript symbol is placed \textbf{after} the letter.
+The last thing someone must know in order to be able to write normal Greek
+text is the punctuation marks used in the language:
+\begin{center}
+\begin{tabular}{ccc}\hline
+Punctuation Sign & Symbol & Output\\ \hline
+period & \texttt{.} & \sg\textgreek{.}\sa\\
+semicolon & \texttt{;} & \sg\textgreek{;}\sa\\
+exclamation mark & \texttt{!} & \sg\textgreek{!}\sa\\
+comma & \texttt{,} & \sg\textgreek{,}\sa\\
+colon & \texttt{:} & \sg\textgreek{:}\sa\\
+question mark & \texttt{?} & \sg\textgreek{?}\sa\\
+left apostrophe & \texttt{``} & \sg\textgreek{``}\sa\\
+right apostrophe & \texttt{''} & \sg\textgreek{''}\sa\\
+left quotation mark & \texttt{((} & \sg\textgreek{))}\sa\\
+right quotation mark & \texttt{))} & \sg\textgreek{))}\sa\\ \hline
+\end{tabular}
+\end{center}
+Using these conventions it is a straightforward exercise to write Greek
+\textgreek{polutoniko} text. For example the following excerpt from
+\textgreek{D'uskoloc} of \textgreek{M'enandroc}
+\sg
+\begin{quote}
+T'i f'hic? <Id`wn >enj'ede pa~id'' >eleuj'eran\\
+t`ac plhs'ion N'umfac stefano~usan, S'wstrate,\\
+>er~wn 'ap~hljec e>uj'uc?
+\end{quote}
+\sa can be produced by the following \LaTeX\ code:
+\begin{center}
+\begin{tabular}{l}
+\verb+T'i f'hic? <Id`wn >enj'ede pa~id'' >eleuj'eran+\\
+\verb+t`ac plhs'ion N'umfac stefano~usan, S'wstrate,+\\
+\verb+>er~wn 'ap~hljec e>uj'uc?+
+\end{tabular}
+\end{center}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Producing Greek Text}
+Once the Greek language is selected with the command
+\begin{center}
+\verb+\selectlanguage{greek}+
+\end{center}
+whatever we type will be typeset with the Greek fonts. The command
+\verb+\textlatin+ can be used for short passages in some language that
+uses the Latin alphabet, while the the command \verb+\latintext+ changes
+the base fonts to the ones used by languages that use the Latin alphabet.
+However, all words will be hyphenated by following the Greek hyphenation
+rules! Similar commands are available once someone has selected some
+other language. The commands \verb+\textgreek+ and \verb+\greektext+
+behave exactly like their ``latin'' counterparts. For example, the
+word \textgreek{M'imhc} has been produced with the command
+\verb+\textgreek{M'imhc}+. Please note that certain symbols cannot have
+their expected result for Greek text, unless someone has selected the Greek
+language, e.g., \verb+~+ is such a symbol.
+
+As we have mentioned above this version of the \texttt{greek} option of the
+\texttt{babel} package supports the use of Greek numerals. The commands
+\verb+\greeknumeral+ and \verb+\Greeknumeral+ produce the lowercase and
+the uppercase Greek numeral, e.g.,
+\begin{center}
+\begin{tabular}{cc}\hline
+Command & Output\\ \hline
+\verb+\Greeknumeral{9999}+ & \sg\textgreek{\Greeknumeral{9999}}\\
+\verb+\greeknumeral{9999}+ & \sg\textgreek{\greeknumeral{9999}}\\
+\hline
+\end{tabular}
+\end{center}
+In order to correctly typeset the greek numerals the greek option file
+provides the following commands:
+\begin{center}
+\begin{tabular}{cc}\hline
+Command & Output\\ \hline
+\verb+\qoppa+ & \textgreek{\qoppa}\\
+\verb+\sampi+ & \textgreek{\sampi}\\
+\verb+\stigma+ & \textgreek{\stigma}\\
+\hline
+\end{tabular}
+\end{center}
+
+In traditional Greek typography the first paragraph after a header is
+always indented, contrary to the habit of, say, American typography. This
+effect can be achieved by using the package \verb+indentfirst+.
+
+Additional greek symbols are available:
+\begin{center}
+\begin{tabular}{cc}\hline
+Command & Output\\ \hline
+\verb+\Digamma+ & \sg\textgreek{\Digamma}\\
+\verb+\ddigamma+ & \sg\textgreek{\ddigamma}\\
+%\verb+\tao+ & \sg\textgreek{\tao}\\
+%\verb+\Qoppa+ & \sg\textgreek{\Qoppa}\\
+%\verb|\VarQoppa| & \sg\textgreek{\VarQoppa}\\
+%\verb+\varqoppa+ & \sg\textgreek{\varqoppa}\\
+%\verb+\Sampi+ & \sg\textgreek{\Sampi}\\
+%\verb|\Stigma| & \sg\textgreek{\Stigma}\\
+\verb|\euro| & \sg\textgreek{\euro}\\
+\verb|\permill| & \sg\textgreek{\permill}\\
+\hline
+\end{tabular}
+\end{center}
+
+The package \verb|athnum| provides the command \verb|\athnum|, with which
+one can produce the so called \textit{Athenian numerals}:
+\begin{center}
+\begin{tabular}{cc}\hline
+Command & Output\\ \hline
+\verb|\athnum{1997}| & \sg\textgreek{\athnum{1997}}\\
+\hline
+\end{tabular}
+\end{center}
+
+The package \verb|grmath| renames the basic log-like functions with their
+greek counterparts:
+\begin{center}
+\begin{tabular}{cc}\hline
+Command & Output\\ \hline
+\verb|$\sin^{2}x+\cos^{2}x=1$| & $\sin^{2}x+\cos^{2}x=1$\\
+\hline
+\end{tabular}
+\end{center}
+\end{document}
diff --git a/macros/latex/contrib/babel-contrib/hebrew/00readme.heb b/macros/latex/contrib/babel-contrib/hebrew/00readme.heb
new file mode 100644
index 0000000000..b4ae253092
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/00readme.heb
@@ -0,0 +1,605 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+ Hebrew Package for babel system and LaTeX2e
+
+This new support package for Hebrew language is based on the old LaTeX 2.09
+hebrew.sty and is backward compatible with it. A new babel-based language
+switching interface is also supported.
+
+Bi-directional support uses TeX--XeT or newer e-TeX engine.
+
+The package is available on-line at http://www.dsg.technion.ac.il/heblatex/
+or at ftp://tochna.technion.ac.il/pub/staff/lavva/heblatex/. It consists of:
+
+ 1. Hebrew package for babel/LaTeX 2e: heblatex.tar.gz or heblatex.zip.
+ 2. Hebrew fonts (available also on CTAN or ftp.cc.huji.ac.il):
+ hebfonts.tar.gz or hebfonts.zip.
+ 3. Examples of hebrew documents: hebexmpl.tar.gz or hebexmpl.zip.
+ 4. This README.html file, available also in plain text format as
+ README.txt.
+
+The babel/LaTeX 2e edition of the hebrew package, as well as documentation
+(including this README file) was developed and will be supported by Boris
+Lavva, lavva@tx.technion.ac.il. Please direct your additions, modifications,
+bug fixes and comments to this address.
+
+------------------------------------------------------
+Table of contents
+
+ Acknowledgement
+ Copyright
+ Installation
+ Hebrew package usage
+ Input code pages
+ Font encodings
+ Bi-directional sectioning commands
+ Table of contents, List of figures, List of tables
+ Hebrew calendar
+ Document class for preparing Hebrew/English or English/Hebrew thesis
+ Compatibility with LaTeX 2.09 style
+ Future work
+
+------------------------------------------------------
+Acknowledgment
+
+The following people have contributed to Hebrew package in one way or
+another, knowingly or unknowingly. In alphabetical order:
+Irina Abramovici, Yaniv Bargury, Yael Dubinsky, Sergio Fogel, Dan Haran,
+Rama Porrat, Michail Rozman, Alon Ziv.
+
+Johannes Braams is the author of babel - a multilingual support for LaTeX.
+
+Tatiana Samoilov and Vitaly Surazhsky found a number of serious bugs in
+preliminary version of Hebrew package.
+
+A number of other people have contributed comments and information. Specific
+contributions are acknowledged within the documentation.
+
+I want to thank my wife, Vita, and son, Mishka, for their infinite love and
+patience.
+
+If you made a contribution and I haven't mentioned it, don't worry, it was
+an accident. I'm sorry. Just tell me and I will add you to the next version.
+
+------------------------------------------------------
+Copyright
+
+The copyright similar to other LaTeX 2e packages is added to prevent
+inconsistency in version numbers and wide-spread distribution of unsupported
+macro files (which was common with the old distributions).
+
+Changes, bug fixes and additions are always welcome, but they should be or
+distributed under other name, or incorporated in this package (by mailing
+me).
+
+ --------------------------------------------------
+
+ Copyright 1997-1998 Boris Lavva and any individual authors listed
+ elsewhere in this file. All rights reserved.
+
+ For further copyright information, and conditions for modification and
+ distribution, see any other copyright notices in this file.
+
+ This file is contributed to the Babel system, release 3.6.
+
+ --------------------------------------------------
+ This system is distributed in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ For error reports concerning UNCHANGED versions of this file no more
+ than one year old, see bugs.txt.
+
+ Please do not request updates from me directly. Primary distribution
+ will be through the CTAN archives.
+
+ IMPORTANT COPYRIGHT NOTICE:
+
+ You are NOT ALLOWED to distribute this file alone.
+
+ You are allowed to distribute this file under the condition that it
+ is distributed together with all the files listed in manifest.txt.
+
+ If you receive only some of these files from someone, complain!
+
+ Permission is granted to customize the declarations in this file to
+ serve the needs of your installation, provided that you comply with the
+ conditions in the file legal.txt.
+
+ However, NO PERMISSION is granted to distribute a modified version of
+ this file under its original name.
+
+ MODIFICATION ADVICE:
+ If you want to customize this file, it is best to make a copy of the
+ source file(s) from which it was produced. Use a different name for your
+ copy(ies) and modify the copy(ies); this will ensure that your modifications
+ do not get overwritten when you install a new release of the standard system.
+
+ You can then easily distribute your modifications by distributing the
+ modified and renamed copy of the source file, together with a suitable
+ .ins file, taking care to observe the conditions in legal.txt; this will
+ ensure that other users can safely use your modifications.
+
+------------------------------------------------------
+Installation
+
+ 1. Full LaTeX 2e distribution should be installed, including TeX--XeT or
+ e-TeX. Known such distributions include:
+ o teTeX 0.9 for UNIX with e-TeX
+ (ftp://ftp.informatik.uni-hannover.de/home/te/private/.0.9/)
+ o NTeX for UNIX with TeX--XeT
+ (http://darfnix.mathematik.uni-stuttgart.de/pub/tex/ntex/)
+ o Web2C for Windows 95 and NT (see at CTAN:systems/win32, for
+ example, ftp://ftp.dante.de/tex-archive/systems/win32/)
+ o TeX Live CD-ROMs distributed by TeX Users Group (TUG), see details
+ at http://www.tug.org.
+ 2. If e-TeX is installed, check if its format is available in extended
+ mode, by running elatex or latex on some .tex file:
+ -----------------------------------------------------------------------
+
+ This is e-TeX, Version 3.14159-1.1 (Web2c 7.0)
+ entering extended mode
+ -----------------------------------------------------------------------
+
+ The second line should be "entering extended mode".
+ 3. If TeX--XeT is installed, it will use a LaTeX 2e format file, called
+ laxet.fmt from the formats directory. This directory is commonly
+ located at texmf/web2c or texmf/web2c/ini subdirectories. To produce
+ format file, run initexxet program on the following laxet.ini file:
+ -----------------------------------------------------------------------
+
+ % Prevent dumping of LaTeX2e
+ \let\xxdump=\dump
+ \let\dump=\endinput
+ % LaTeX2e format
+ \input latex.ltx
+ % Read latex2e.add
+ \openin1=latex2e.add
+ \ifeof1\closein1\message{latex2e.add not found}
+ \else\closein1\input latex2e.add
+ \fi
+ % dump
+ \let\dump=\xxdump
+ \let\xxdump=\undefined
+ \dump
+ -----------------------------------------------------------------------
+
+ Put the resulting file laxet.fmt to the formats directory and link (or
+ copy) the virtexxet program as laxet.
+ 4. Download the babel sources from the CTAN sites, directory
+ macros/latex/packages/babel. This version of Hebrew package is tested
+ with babel version 3.6.
+ 5. Apply the following changes to the standard babel sources:
+ o babel.dtx -- after the line 916 (greek) add:
+ \DeclareOption{hebrew}{\input{rlbabel.def}\input{hebrew.ldf}}
+ o bbcompat.dtx -- after the line 134 (welsh) add:
+ %<+hebrew>\input rlbabel.def\input hebrew.ldf\relax
+ o babel.ins -- after the line 346 (bahasa) add:
+ \generate{\compatfile{hebrew}}
+ 6. Download the hebrew package, fonts and examples from the above
+ mentioned place.
+ 7. Open heblatex to the babel sources directory.
+ 8. Run latex babel.ins and then latex hebrew.ins.
+ 9. Move all *.cls, *.sty, *.def, *.fd, *.ldf to the babel directory
+ searchable by TeX (run MakeTeXls-R or similar program). Usually, babel
+ is located at TEXROOT/share/texmf/tex/latex/packages/babel or
+ TEXROOT/share/texmf/tex/generic/babel.
+ 10. Install hebrew fonts from hebfonts as following:
+ o Find your public font sources directory, it is usually:
+ TEXROOT/share/texmf/fonts/source/public.
+ o Unpack hebfonts file into the abovenamed public directory. It will
+ create a new directory called hebrew inside public.
+ o Find your special.map file - it is usually found at
+ TEXROOT/share/texmf/fontname/special.map and add the following
+ lines at the end of this file:
+ @c Hebrew fonts
+ jerus10 public hebrew
+ deads10 public hebrew
+ oldjaf10 public hebrew
+ telav10 public hebrew
+ crml10 public hebrew
+ crmlsl10 public hebrew
+ fr public hebrew
+ frbx public hebrew
+ frsl public hebrew
+ hclassic public hebrew
+ hcaption public hebrew
+ redis7 public hebrew
+ redis8 public hebrew
+ redis9 public hebrew
+ redis10 public hebrew
+ redis12 public hebrew
+ redis17 public hebrew
+ redisb10 public hebrew
+ rediss8 public hebrew
+ rediss9 public hebrew
+ rediss10 public hebrew
+ rediss12 public hebrew
+ shold10 public hebrew
+ shscr10 public hebrew
+ shstk10 public hebrew
+ o Run REHASH from texconfig utility or program MakeTeXls-R or newer
+ mktexlsr (if available) to build a new ls-R database in
+ TEXROOT/share/texmf directory. You can add inserted file names
+ manually to ls-R if you cannot find abovenamed programs.
+ o Note that only 7-bit (old code) fonts are used by new Hebrew
+ package.
+ 11. You can check if your installation succeed by LaTeXing examples from
+ hebexmpl file.
+
+Finally, you can prepare the LaTeX documentation of all components of the
+new Hebrew package by running:
+
+ ------------------------------------
+
+ latex hebrew.dtx
+ makeindex -s bbind.ist hebrew.idx
+ makeindex -s bbglo.ist -o hebrew.gls hebrew.glo
+ latex hebrew.dtx
+ latex hebrew.dtx
+
+ ------------------------------------
+
+The same procedure can be applied on babel.dtx (or babel.drv) to create the
+babel documentation. Files bbind.ist and bbglo.ist are included with babel
+installation.
+
+------------------------------------------------------
+Hebrew package usage
+
+The usage is simple, for example:
+
+\documentclass[12pt,twoside]{book}
+\usepackage[hebrew,english,russian,danish,greek,...]{babel}
+
+LaTeX 2.09 style is also supported (in compatibility mode) to process
+existing documents, for example:
+
+\documentstyle[12pt,hebrew_newcode]{article}
+
+Languages can be switched by the following macros:
+
+ 1. \sethebrew or \unsethebrew
+ 2. \selectlanguage{hebrew}, \selectlanguage{english}, etc.
+ 3. \begin{otherlanguage}{hebrew} ... \end{otherlanguage}, or any other
+ language
+ 4. \R{hebrew text} inside the latin text
+ 5. \L{latin text} inside the hebrew text
+
+First three commands are equivalent: first one provides switching interface,
+compatible with LaTeX 2.09 hebrew style, while second and third ---
+babel-based interface.
+
+Last two commands are used for language and direction switching inside
+paragraph.
+
+hmbox and embox macros should be used for inserting Hebrew and English text
+(respectively) inside a mathematical formula.
+
+------------------------------------------------------
+Input code pages
+
+Hebrew package supports the following input code pages:
+
+ 1. 7-bit hebrew encoding, also known as old code, defined by Israeli
+ Standard 960 (si960)
+ 2. IBM PC code page also known as pc code (cp862)
+ 3. WINDOWS code page also known as new code (cp1255)
+ 4. ISO 8859-8 Hebrew/Latin code page commonly used in UNIX, also known as
+ new code (8859-8 also known as new code)
+
+The default input encoding can be set using option defined above in
+parentheses with inputenc style (but *before* babel), for example :
+
+\usepackage[cp1255]{inputenc}
+
+Input encoding can be changed also inside the document by the \inputencoding
+command, for example:
+
+\inputencoding{cp862}
+
+------------------------------------------------------
+Font encodings
+
+Various font encodings can be used, including, of course, Local Hebrew
+Encoding (LHE), with the aid of fontenc style (but *before* babel), for
+example:
+
+\usepackage[LHE,OT2,LCY,T1]{fontenc}
+
+Many useful font-switching commands are provided in hebfont package which
+can be included *after* the babel:
+
+\usepackage{hebfont}
+
+These commands are in format \text<font>{Hebrew text}, for example:
+\textoj{Text printed with Old Jaffa font}, \textredis{Text printed with
+redis font}.
+
+In addition, for backward compatibility in LaTeX 2.09 documents, the four
+old font-switching commands are supported:
+{\jm ...}, {\oj ...}, {\ds ...} and {\ta ...} for Jerusalem, Old Jaffa, Dead
+Sea and Tel-Aviv fonts respectively.
+
+The following TeX fonts are supported:
+
+ * Jerusalem (used as default font)
+ * Dead Sea (used as bold font)
+ * Tel-Aviv (used as sans-serif or typewriter font)
+ * Old Jaffa (used as italic or slanted font and for emphasize)
+ * Hebrew classic normal and slanted (command \textclas)
+ * Shalom Old Style (command \textshold)
+ * Shalom Script (command \textshscr)
+ * Shalom Stick (command \textshstk)
+ * Carmel normal and slanted (command \textcrml)
+ * Frank Ruehl normal, bold and slanted (command \textfr)
+ * Redis normal, bold and slanted (command \textredis)
+
+------------------------------------------------------
+Bi-directional sectioning commands
+
+These commands inserts both Hebrew title to the RL table of contents or list
+of figures/tables, and English (or other LR language) title to the LR table
+of contents or list of figures/tables.
+
+ 1. \bpart{hebrew}{english}
+ 2. \bchapter{hebrew}{english}
+ 3. \bsection{hebrew}{english}
+ 4. \bsubsection{hebrew}{english}
+ 5. \bsubsubsection{hebrew}{english}
+ 6. \bcaption{hebrew}{english}
+ 7. \bchapternn{hebrew}{english} - replaces \chapter*
+ 8. \bsectionnn{hebrew}{english} - replaces \section*
+
+A number of additional bi-directional commands are defined in the
+hebtech.cls - thesis document class file, described below.
+
+------------------------------------------------------
+Table of contents, List of figures, List of tables
+
+Both Right-to-Left and Left-to-Right versions of the tables (toc, lof and
+lot) can be generated simultaneously. The LR files have the default
+extensions (.toc, .lof and .lot), while the RL files have reversed
+extensions (.cot, .fol and .tol). For example, to include RL tables at the
+beginning and LR tables before the end of the document:
+
+ ------------------------------------
+
+ \begin{document}
+ \sethebrew
+ \tableofcontents % Generates .cot file
+ \listoffigures % Generates .fol file
+ \listoftables % Generates .tol file
+ ...
+ \unsethebrew
+ \tableofcontents % Generates .toc file
+ \listoffigures % Generates .lof file
+ \listoftables % Generates .lot file
+ \end{document}
+
+ ------------------------------------
+
+All 6 files are generated simultaneously in two latex passes !
+
+------------------------------------------------------
+Hebrew calendar
+
+Original Hebrew calendar style was created by Michail Rozman, and corrected
+by Rama Porrat, Michail Rozman and Dan Haran.
+
+This style was adjusted to LaTeX 2e by Boris Lavva, and provided in hebcal
+package. It can be included *after* the babel:
+
+\usepackage{hebcal}
+
+The following 2 user-level commands are provided with the package:
+
+\newcount\hd \newcount\hm \newcount\hy
+
+\hd=10 \hm=3 \hy=1992
+
+\HebrewDate{\hd}{\hm}{\hy}
+
+which converts the requested Gregorian date to Hebrew calendar date and
+prints it in Hebrew or English (depends on the current language) and:
+
+\HebrewToday or \hebrewtoday
+
+which prints the current Hebrew date (today) .
+
+------------------------------------------------------
+Document class for preparing Hebrew/English or English/Hebrew thesis
+
+A useful document class file hebtech for preparing M.Sc. and Ph.D. theses
+for the Technion (English/Hebrew and Hebrew/English) is included with this
+package too. I believe that it can be adjusted for the needs of other
+academic institutions in Israel too. This class automatically includes babel
+with hebrew and english option, hebfont and hebcal packages.
+
+The original version for LaTeX 2.09 and old code Hebrew was created in 1994
+by Irina Abramovici, at Taub Computer Center, Technion.
+
+How to use this document class?
+
+\documentclass[12pt]{hebtech}
+
+The following parameters should be included in thesis preamble (before
+\begin{document}):
+
+ 1. Thesis title
+ \title{hebrew}{english}
+ 2. Thesis author
+ \author{hebrew}{english}
+ 3. Department name, e.g. Electrical Engineering Department
+ \dept{hebrew}{english}
+ 4. Domain of research, e.g. Food Processing
+ \dom{hebrew}{english}
+ 5. Main advisor
+ \advisori{hebrew}{english}
+ 6. Second advisor, if exists
+ \advisorii{hebrew}{english}
+ 7. Main sponsor
+ \donori{hebrew}{english}
+ 8. Additional sponsor, if exists
+ \donorii{hebrew}{english}
+ 9. Set thestype counter to:
+ o 1 --- for a research thesis
+ o 2 --- for a project thesis
+ o 3 --- for a final paper
+
+ \setcounter{thestype}{1}
+ 10. Set grade counter to:
+ o 1 --- for master of science
+ o 2 --- for master
+ o 3 --- for master of technology
+ o 4 --- for doctor of science
+
+ \setcounter{grade}{1}
+ 11. Date is optional, if not included, today's date will be used. The
+ Gregorian date entered will be printed and get converted the Jewish
+ date.
+ \date{28}{2}{1998}
+ 12. Page style is optional too, if not included, plain will be used.
+ \pagestyle{thesis}
+
+In the main document the following additional commands and environments can
+be used:
+
+ 1. \makecover - creates Hebrew or English cover page, depending on the
+ current language.
+ 2. \maketitle - creates Hebrew or English title page, depending on the
+ current language.
+ 3. \begin{acknowledgment} ... \end{acknowledgment} - builds the
+ acknowledgment page and adds inserted customized acknowledgment in
+ Hebrew or English, depending on the current language.
+ 4. \begin{dedication} ... \end{dedication} - builds the dedication page in
+ Hebrew or English, depending on the current language.
+ 5. \tableofcontents, \listoffigures, \listoftables - builds tables
+ depending on the current language (all 6 tables can be used
+ simultaneously).
+ 6. \begin{abstract} ... \end{abstract} - builds the abstract pages in
+ Hebrew or English, depending on the current language, adds contents
+ line to the 2 tables of contents.
+ 7. \frontmatter, \mainmatter, \backmatter - should be inserted at the
+ beginning, before the main part, and at the ending of the thesis to
+ change numbering and other style parameters.
+ 8. \bibliography{...} - now adds "References" line to the 2 tables of
+ contents: English and Hebrew.
+
+Some useful bi-directional commands, for figures and tables provided in this
+file too:
+
+ 1. \bcaptionf{hebrew}{english} - similar to \bcaption but answers to
+ thesis formatting requirements at the Technion, used for figures.
+ 2. \bcaptionff{to RL lof}{to LR lof}{hebrew}{english} - a customized one
+ for figures.
+ 3. \bcaptiont{hebrew}{english} - similar to \bcaption but answers to
+ thesis formatting requirements at the Technion, used for tables.
+ 4. \bcaptiontt{to RL lot}{to LR lot}{hebrew}{english} - a customized one
+ for tables.
+
+------------------------------------------------------
+Compatibility with LaTeX 2.09 style
+
+Generally, the new package is compatible with LaTeX 2.09 style file
+hebrew.sty, i.e. in most cases one can use the new package on old documents
+without any errors. Howver, it does not support Plain TeX, please use
+heb_macros.tex, or other TeX macro file for Hebrew instead.
+
+A few incompatibilities are described below:
+
+ * The macros with Hebrew names are not provided, for example, macro
+ \hadgesh when the command name "hadgesh" is given in Hebrew is not
+ supported. The reason is that in new LaTeX 2e it is forbidden to use
+ 8-bit macros, because all characters 128-255 became to be "active".
+ However, the following English-coded equivalents are supported for
+ backward compatibility with LaTeX 2.09 style and can be used even in
+ the new documents:
+ 1. \hebday (replaced "hayom").
+ 2. \hebcopy (for use in letter style)
+ 3. \hebincl (for use in letter style)
+ 4. \hebpage (for use in letter style)
+ 5. \hebto (for use in letter style)
+ 6. \hadgesh (produces ``poor man's bold'' - heavy printout, it is
+ advisable to use real bold fonts, e.g. DeadSea instead)
+ 7. \piska (can be used only in compatibility mode)
+ 8. \piskapiska (can be used only in compatibility mode)
+ 9. \makafgadol (=\textendash)
+ 10. \makafanak (=\textemdash)
+ 11. \geresh (=\textquoteright)
+ 12. \opengeresh (=\textquoteright)
+ 13. \closegeresh (=\textquoteleft)
+ 14. \openquote (=\textquotedblright)
+ 15. \closequote (=\textquotedblleft)
+ 16. \leftquotation (=\textquotedblright)
+ 17. \rightquotation (=\textquotedblleft)
+ 18. \undertext (=\underline, can be used only in compatibility mode)
+ * In \documentstyle line the following 3 styles can be used in Hebrew
+ documents:
+ 1. \documentstyle[hebrew_oldcode,...]{...} in old 7-bit documents
+ (instead of "hebrew"!).
+ 2. \documentstyle[hebrew_newcode,...]{...} in 8-bit UNIX or Windows
+ documents.
+ 3. \documentstyle[hebrew_p,...]{...} in 8-bit DOS documents.
+ * hebcal style should always be used (instead of older hebcal_p and
+ hebcal_newcode).
+ * Font names for the included 7-bit fonts were renamed (for the sake of
+ multiplatform support) to lowercase names with no more than 8
+ characters as following:
+ o jerus10.mf - for Jerusalem (10pt)
+ o deads10.mf - for Dead Sea (10pt)
+ o telav10.mf - for TelAviv (10pt)
+ o oldjaf10.mf - for Old Jaffa (10pt)
+ o shold10.mf - for Shalom Old Style (10pt)
+ o shscr10.mf - for Shalom Script (10pt)
+ o shstk10.mf - for Shalom Stick (10pt)
+ o Some other font-related files were renamed too (to lowercase and <
+ 8 characters):
+ + frank_ruehl.mf became frruehl.mf
+ + redisfont.mf became redisfnt.mf
+ + redisbx10.mf became redisb10.mf
+ o All other font names remain unchanged
+
+------------------------------------------------------
+Future work
+
+ 1. Visual enviroments i.e. tabular, tabbing and array have to be supported
+ for hebrew. Now only left-to-right direction of lines is supported.
+ 2. Update hebrew package for the future babel-3.7 release.
+ 3. Hebrew points and dots ("nikud") support should be added, so it can be
+ used in font-independent way.
+ Currently, nikud can be used only on font-dependent way: only shalom
+ and classic families of fonts provide nikud, and hebrew point glyphs
+ are located in different places.
+ 4. Machintosh Hebrew/English input code page support should be added.
+ 5. Type1/TrueType Hebrew fonts should be supported.
+
+------------------------------------------------------
+Created by Boris Lavva, lavva@tx.technion.ac.il
+Last modified March 1, 1998
diff --git a/macros/latex/contrib/babel-contrib/hebrew/heb209.dtx b/macros/latex/contrib/babel-contrib/hebrew/heb209.dtx
new file mode 100644
index 0000000000..69101ca766
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/heb209.dtx
@@ -0,0 +1,165 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{8}
+%
+% \iffalse meta-comment
+%% File `heb209.dtx' - obsolete LaTeX 2.09 compatible style files.
+%% Copyright (C) 1997 -- 2004 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2004 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%\fi
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\babel{\textsf{babel}}
+% \GetFileInfo{heb209.dtx}
+%
+% \changes{heb209~1.0a}{1998/01/06}{%
+% Initial version. Provides hebrew\_newcode, hebrew\_oldcode and
+% hebrew\_p style files for \LaTeX~2.09 (by Boris Lavva)}
+%
+% \section{Hebrew in \LaTeX~2.09 compatibility mode}\label{sec:heb209}
+%
+% |\documentstyle| command in the preamble of \LaTeX\ document
+% indicates that it is a \LaTeX~2.09 document, and should be processed
+% in \emph{compatibility mode}. In such documents, one of the following
+% three Hebrew style options can be included:
+% \begin{enumerate}
+% \item \texttt{hebrew\_newcode} indicates that document will use UNIX
+% ISO 8859-8 or Windows cp1255 input encoding, i.e.\ \emph{Alef}
+% letter will be represented as 224.
+% \item \texttt{hebrew\_p} indicates that document is encoded with IBM
+% PC cp862 encoding, i.e.\ \emph{Alef} letter will be represented as
+% 128.
+% \item \texttt{hebrew\_oldcode} indicates that document uses old 7-bit
+% encoding, as defined in Israeli Standard 960, i.e.\ \emph{Alef} is
+% character number 96.
+% \end{enumerate}
+% Note, that other hebrew-related styles, such as \texttt{hebcal} can
+% be included \emph{after} the abovenamed Hebrew style option, for
+% example:
+% \begin{quote}
+% |\documentstyle[12pt,hebrew_p,hebcal]{report}|.
+% \end{quote}
+%
+% Any Hebrew document which compiled under \LaTeX~2.09 should compile
+% under compatibility mode, unless it uses low-level commands such as
+% |\tenrm|.
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating the external files:
+% \begin{center}
+% \begin{tabular}{ll}
+% newcode & produce \texttt{hebrew\_newcode.sty} \\
+% pccode & produce \texttt{hebrew\_p.sty} \\
+% oldcode & produce \texttt{hebrew\_oldcode.sty}
+% \end{tabular}
+% \end{center}
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you
+% are currently reading. It will be extracted from this file by
+% the \dst{} program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew \LaTeX~2.09 compatibility style files}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{heb209.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{Obsolete style files}
+%
+% For each of the Hebrew \LaTeX~2.09 Hebrew styles, we produce a
+% file which uses correct input encoding and calls \babel\ with
+% Hebrew and English language options.
+% This means that any styles which say |\input hebrew_newcode.sty|
+% or |\documentstyle[|\ldots|hebrew_newcode|\ldots|]{|\ldots|}|
+% should still work.
+%
+% \begin{macrocode}
+%<*newcode|pccode|oldcode>
+\NeedsTeXFormat{LaTeX2e}
+%</newcode|pccode|oldcode>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*newcode>
+\@obsoletefile{hebrew.sty}{hebrew_newcode.sty}
+\RequirePackage[8859-8]{inputenc}
+%</newcode>
+%<*pccode>
+\@obsoletefile{hebrew.sty}{hebrew_p.sty}
+\RequirePackage[cp862]{inputenc}
+%</pccode>
+%<*oldcode>
+\@obsoletefile{hebrew.sty}{hebrew_oldcode.sty}
+\RequirePackage[si960]{inputenc}
+%</oldcode>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*newcode|pccode|oldcode>
+\RequirePackage[english,hebrew]{babel}
+%</newcode|pccode|oldcode>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/hebrew/heb209.pdf b/macros/latex/contrib/babel-contrib/hebrew/heb209.pdf
new file mode 100644
index 0000000000..e55684275c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/heb209.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebinp.dtx b/macros/latex/contrib/babel-contrib/hebrew/hebinp.dtx
new file mode 100644
index 0000000000..a6a9d60c39
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebinp.dtx
@@ -0,0 +1,550 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{446}
+%
+% \iffalse
+%<si960> \ProvidesFile{si960.def}
+%<8859-8> \ProvidesFile{8859-8.def}
+%<cp862> \ProvidesFile{cp862.def}
+%<cp1255> \ProvidesFile{cp1255.def}
+%<*driver>
+\ProvidesFile{hebinp.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebinp.dtx}
+ [2004/02/20 v1.1b Hebrew input encoding file]
+% \iffalse meta-comment
+%% File `hebinp.dtx' for installing the input hebrew encodings.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+% \fi
+%
+% \providecommand\dst{\textsc{docstrip}}
+% \GetFileInfo{hebinp.dtx}
+%
+% \changes{hebinp~1.0a}{1997/12/07}{%
+% Initial version. Provides 8859-8, cp862, cp1255, and old 7-bit
+% input encodings (by Boris Lavva)}
+% \changes{hebinp~1.1}{2001/02/27}{%
+% Renamed hebrew letters: \cs{alef} to \cs{hebalef} etc.
+% (by Tzafrir Cohen)}
+% \changes{hebinp~1.1a}{2001/07/22}{%
+% Renamed CP1255 nikud \cs{patah} to \cs{hebpatah etc}.
+% Added the macro \cs{DisableNikud} - may not be a good idea
+% (by Tzafrir Cohen)}
+%
+% \section{Hebrew input encodings}\label{sec:hebinp}
+%
+% Hebrew input encodings defined in file |hebinp.dtx|\footnote{The
+% files described in this section have version number \fileversion\
+% and were last revised on \filedate.} should be used with |inputenc|
+% \LaTeXe{} package. This package allows the user
+% to specify an input encoding from this file (for example, ISO
+% Hebrew/Latin 8859-8, IBM Hebrew codepage 862 or MS Windows
+% Hebrew codepage 1255) by saying:
+% \begin{quote}
+% |\usepackage[|\emph{encoding name}|]{inputenc}|
+% \end{quote}
+% The encoding can also be selected in the document with:
+% \begin{quote}
+% |\inputencoding{|\emph{encoding name}|}|
+% \end{quote}
+% The only practical use of this command within a document is when
+% using text from several documents to build up a composite work such
+% as a volume of journal articles. Therefore this command will be
+% used only in vertical mode.
+%
+% The encodings provided by this package are:
+% \begin{itemize}
+% \item |si960| 7-bit Hebrew encoding for the range 32--127. This
+% encoding also known as ``old-code'' and defined by Israeli
+% Standard SI-960.
+% \item |8859-8| ISO 8859-8 Hebrew/Latin encoding commonly used in
+% UNIX systems. This encoding also known as ``new-code'' and
+% includes hebrew letters in positions starting from 224.
+% \item |cp862| IBM 862 code page commonly used by DOS on
+% IBM-compatible personal computers. This encoding also known as
+% ``pc-code'' and includes hebrew letters in positions starting
+% from 128.
+% \item |cp1255| MS Windows 1255 (hebrew) code page which is similar to
+% 8859-8. In addition to hebrew letters, this encoding contains
+% also hebrew vowels and dots (nikud).
+% \end{itemize}
+% Each encoding has an associated |.def| file, for example
+% |8859-8.def| which defines the behaviour of each input character,
+% using the commands:
+% \begin{quote}
+% |\DeclareInputText{|\emph{slot}|}{|\emph{text}|}| \\
+% |\DeclareInputMath{|\emph{slot}|}{|\emph{math}|}|
+% \end{quote}
+% This defines the input character \emph{slot} to be the
+% \emph{text} material or \emph{math} material respectively.
+% For example, |8859-8.def| defines slots |"EA| (letter hebalef)
+% and |"B5| ($\mu$) by saying:
+%\begin{verbatim}
+% \DeclareInputText{224}{\hebalef}
+% \DeclareInputMath{181}{\mu}
+%\end{verbatim}
+% Note that the \emph{commands} should be robust, and should not be
+% dependent on the output encoding. The same \emph{slot} should not
+% have both a text and a math declaration for it. (This restriction
+% may be removed in future releases of inputenc).
+%
+% The |.def| file may also define commands using the declarations:\\
+% |\providecommand| or |\ProvideTextCommandDefault|.
+% For example, |8859-8.def| defines:
+%\begin{verbatim}
+% \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
+% \DeclareInputText{188}{\textonequarter}
+%\end{verbatim}
+% The use of the `provide' forms here will ensure that a
+% better definition will not be over-written; their use is
+% recommended since, in general, the best defintion depends on the
+% fonts available.
+%
+% See the documentation in |inputenc.dtx| for details of how to
+% declare input definitions for various encodings.
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you
+% are currently reading. It will be extracted from this file by
+% the \dst{} program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew input encodings for use with \LaTeXe}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{hebinp.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{Default definitions for characters}
+%
+% First, we insert a |\makeatletter| at the beginning of all |.def|
+% files to use |@| symbol in the macros' names.
+% \begin{macrocode}
+%<-driver>\makeatletter
+% \end{macrocode}
+%
+% Some input characters map to internal functions which are not in
+% either the |T1| or |OT1| font encoding. For this reason default
+% definitions are provided in the encoding file: these will be
+% used unless some other output encoding is used which supports
+% those glyphs. In some cases this default defintion has to be
+% simply an error message.
+%
+% Note that this works reasonably well only because the encoding
+% files for both |OT1| and |T1| are loaded in the standard LaTeX
+% format.
+%
+% \begin{macrocode}
+%<*8859-8|cp862|cp1255>
+\ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}}
+\ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
+\ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
+%</8859-8|cp862|cp1255>
+%<*8859-8|cp1255>
+\ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}
+%</8859-8|cp1255>
+%<*cp862|cp1255>
+\ProvideTextCommandDefault{\textflorin}{\textit{f}}
+%</cp862|cp1255>
+%<*cp862>
+\ProvideTextCommandDefault{\textpeseta}{Pt}
+%</cp862>
+% \end{macrocode}
+%
+% The name |\textblacksquare| is derived from the AMS symbol name
+% since Adobe seem not to want this symbol. The default
+% definition, as a rule, makes no claim to being a good design.
+% \begin{macrocode}
+%<*cp862>
+\ProvideTextCommandDefault{\textblacksquare}
+ {\vrule \@width .3em \@height .4em \@depth -.1em\relax}
+%</cp862>
+% \end{macrocode}
+%
+% Some commands can't be faked, so we have them generate an error
+% message.
+% \begin{macrocode}
+%<*8859-8|cp862|cp1255>
+\ProvideTextCommandDefault{\textcent}
+ {\TextSymbolUnavailable\textcent}
+\ProvideTextCommandDefault{\textyen}
+ {\TextSymbolUnavailable\textyen}
+%</8859-8|cp862|cp1255>
+%<*8859-8>
+\ProvideTextCommandDefault{\textcurrency}
+ {\TextSymbolUnavailable\textcurrency}
+%</8859-8>
+%<*cp1255>
+\ProvideTextCommandDefault{\newsheqel}
+ {\TextSymbolUnavailable\newsheqel}
+%</cp1255>
+%<*8859-8|cp1255>
+\ProvideTextCommandDefault{\textbrokenbar}
+ {\TextSymbolUnavailable\textbrokenbar}
+%</8859-8|cp1255>
+%<*cp1255>
+\ProvideTextCommandDefault{\textperthousand}
+ {\TextSymbolUnavailable\textperthousand}
+%</cp1255>
+% \end{macrocode}
+%
+% Characters that are supposed to be used only in math will be defined
+% by |\providecommand| because \LaTeXe{} assumes that the font
+% encoding for math fonts is static.
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\providecommand{\mathonesuperior}{{^1}}
+\providecommand{\maththreesuperior}{{^3}}
+%</8859-8|cp1255>
+%<*8859-8|cp862|cp1255>
+\providecommand{\mathtwosuperior}{{^2}}
+%</8859-8|cp862|cp1255>
+%<*cp862>
+\providecommand{\mathordmasculine}{{^o}}
+\providecommand{\mathordfeminine}{{^a}}
+%</cp862>
+% \end{macrocode}
+%
+% \subsection{The SI-960 encoding}
+%
+%% The SI-960 or ``old-code'' encoding only allows characters in the
+%% range 32--127, so we only need to provide an empty |si960.def| file.
+%
+% \subsection{The ISO 8859-8 encoding and the MS Windows cp1255 encoding}
+%
+% The |8859-8.def| encoding file defines the characters in the ISO
+% 8859-8 encoding.
+%
+% The MS Windows Hebrew character set incorporates the Hebrew
+% letter repertoire of ISO 8859-8, and uses the same code points
+% (starting from 224). It has also some important additions in the
+% 128--159 and 190--224 ranges.
+%
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{130}{\quotesinglbase}
+\DeclareInputText{131}{\textflorin}
+\DeclareInputText{132}{\quotedblbase}
+\DeclareInputText{133}{\dots}
+\DeclareInputText{134}{\dag}
+\DeclareInputText{135}{\ddag}
+\DeclareInputText{136}{\^{}}
+\DeclareInputText{137}{\textperthousand}
+\DeclareInputText{139}{\guilsinglleft}
+\DeclareInputText{145}{\textquoteleft}
+\DeclareInputText{146}{\textquoteright}
+\DeclareInputText{147}{\textquotedblleft}
+\DeclareInputText{148}{\textquotedblright}
+\DeclareInputText{149}{\textbullet}
+\DeclareInputText{150}{\textendash}
+\DeclareInputText{151}{\textemdash}
+\DeclareInputText{152}{\~{}}
+\DeclareInputText{153}{\texttrademark}
+\DeclareInputText{155}{\guilsinglright}
+%</cp1255>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\DeclareInputText{160}{\nobreakspace}
+\DeclareInputText{162}{\textcent}
+\DeclareInputText{163}{\pounds}
+%<+8859-8>\DeclareInputText{164}{\textcurrency}
+%<+cp1255>\DeclareInputText{164}{\newsheqel}
+\DeclareInputText{165}{\textyen}
+\DeclareInputText{166}{\textbrokenbar}
+\DeclareInputText{167}{\S}
+\DeclareInputText{168}{\"{}}
+\DeclareInputText{169}{\textcopyright}
+%<+8859-8>\DeclareInputMath{170}{\times}
+\DeclareInputText{171}{\guillemotleft}
+\DeclareInputMath{172}{\lnot}
+\DeclareInputText{173}{\-}
+\DeclareInputText{174}{\textregistered}
+\DeclareInputText{175}{\@tabacckludge={}}
+\DeclareInputText{176}{\textdegree}
+\DeclareInputMath{177}{\pm}
+\DeclareInputMath{178}{\mathtwosuperior}
+\DeclareInputMath{179}{\maththreesuperior}
+\DeclareInputText{180}{\@tabacckludge'{}}
+\DeclareInputMath{181}{\mu}
+\DeclareInputText{182}{\P}
+\DeclareInputText{183}{\textperiodcentered}
+%<+8859-8>\DeclareInputText{184}{\c\ }
+\DeclareInputMath{185}{\mathonesuperior}
+%<+8859-8>\DeclareInputMath{186}{\div}
+\DeclareInputText{187}{\guillemotright}
+\DeclareInputText{188}{\textonequarter}
+\DeclareInputText{189}{\textonehalf}
+\DeclareInputText{190}{\textthreequarters}
+%</8859-8|cp1255>
+% \end{macrocode}
+%
+% Hebrew vowels and dots (nikud) are included only to MS Windows cp1255
+% page and start from the position 192.
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{192}{\hebsheva}
+\DeclareInputText{193}{\hebhatafsegol}
+\DeclareInputText{194}{\hebhatafpatah}
+\DeclareInputText{195}{\hebhatafqamats}
+\DeclareInputText{196}{\hebhiriq}
+\DeclareInputText{197}{\hebtsere}
+\DeclareInputText{198}{\hebsegol}
+\DeclareInputText{199}{\hebpatah}
+\DeclareInputText{200}{\hebqamats}
+\DeclareInputText{201}{\hebholam}
+\DeclareInputText{203}{\hebqubuts}
+\DeclareInputText{204}{\hebdagesh}
+\DeclareInputText{205}{\hebmeteg}
+\DeclareInputText{206}{\hebmaqaf}
+\DeclareInputText{207}{\hebrafe}
+\DeclareInputText{208}{\hebpaseq}
+\DeclareInputText{209}{\hebshindot}
+\DeclareInputText{210}{\hebsindot}
+\DeclareInputText{211}{\hebsofpasuq}
+\DeclareInputText{212}{\hebdoublevav}
+\DeclareInputText{213}{\hebvavyod}
+\DeclareInputText{214}{\hebdoubleyod}
+%</cp1255>
+% \end{macrocode}
+%
+% Hebrew letters start from the position 224 in both encodings.
+% \begin{macrocode}
+%<*8859-8|cp1255>
+\DeclareInputText{224}{\hebalef}
+\DeclareInputText{225}{\hebbet}
+\DeclareInputText{226}{\hebgimel}
+\DeclareInputText{227}{\hebdalet}
+\DeclareInputText{228}{\hebhe}
+\DeclareInputText{229}{\hebvav}
+\DeclareInputText{230}{\hebzayin}
+\DeclareInputText{231}{\hebhet}
+\DeclareInputText{232}{\hebtet}
+\DeclareInputText{233}{\hebyod}
+\DeclareInputText{234}{\hebfinalkaf}
+\DeclareInputText{235}{\hebkaf}
+\DeclareInputText{236}{\heblamed}
+\DeclareInputText{237}{\hebfinalmem}
+\DeclareInputText{238}{\hebmem}
+\DeclareInputText{239}{\hebfinalnun}
+\DeclareInputText{240}{\hebnun}
+\DeclareInputText{241}{\hebsamekh}
+\DeclareInputText{242}{\hebayin}
+\DeclareInputText{243}{\hebfinalpe}
+\DeclareInputText{244}{\hebpe}
+\DeclareInputText{245}{\hebfinaltsadi}
+\DeclareInputText{246}{\hebtsadi}
+\DeclareInputText{247}{\hebqof}
+\DeclareInputText{248}{\hebresh}
+\DeclareInputText{249}{\hebshin}
+\DeclareInputText{250}{\hebtav}
+%</8859-8|cp1255>
+% \end{macrocode}
+%
+% Special symbols which define the direction of symbols explicitly.
+% Currently, they are not used in \LaTeX.
+% \begin{macrocode}
+%<*cp1255>
+\DeclareInputText{253}{\lefttorightmark}
+\DeclareInputText{254}{\righttoleftmark}
+%</cp1255>
+% \end{macrocode}
+%
+% \subsection{The IBM code page 862}
+%
+% The |cp862.def| encoding file defines the characters in the IBM
+% codepage 862 encoding. The DOS graphics `letters' and a few
+% other positions are ignored (left undefined).
+%
+% Hebrew letters start from the position 128.
+% \begin{macrocode}
+%<*cp862>
+\DeclareInputText{128}{\hebalef}
+\DeclareInputText{129}{\hebbet}
+\DeclareInputText{130}{\hebgimel}
+\DeclareInputText{131}{\hebdalet}
+\DeclareInputText{132}{\hebhe}
+\DeclareInputText{133}{\hebvav}
+\DeclareInputText{134}{\hebzayin}
+\DeclareInputText{135}{\hebhet}
+\DeclareInputText{136}{\hebtet}
+\DeclareInputText{137}{\hebyod}
+\DeclareInputText{138}{\hebfinalkaf}
+\DeclareInputText{139}{\hebkaf}
+\DeclareInputText{140}{\heblamed}
+\DeclareInputText{141}{\hebfinalmem}
+\DeclareInputText{142}{\hebmem}
+\DeclareInputText{143}{\hebfinalnun}
+\DeclareInputText{144}{\hebnun}
+\DeclareInputText{145}{\hebsamekh}
+\DeclareInputText{146}{\hebayin}
+\DeclareInputText{147}{\hebfinalpe}
+\DeclareInputText{148}{\hebpe}
+\DeclareInputText{149}{\hebfinaltsadi}
+\DeclareInputText{150}{\hebtsadi}
+\DeclareInputText{151}{\hebqof}
+\DeclareInputText{152}{\hebresh}
+\DeclareInputText{153}{\hebshin}
+\DeclareInputText{154}{\hebtav}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareInputText{155}{\textcent}
+\DeclareInputText{156}{\pounds}
+\DeclareInputText{157}{\textyen}
+\DeclareInputText{158}{\textpeseta}
+\DeclareInputText{159}{\textflorin}
+\DeclareInputText{160}{\@tabacckludge'a}
+\DeclareInputText{161}{\@tabacckludge'\i}
+\DeclareInputText{162}{\@tabacckludge'o}
+\DeclareInputText{163}{\@tabacckludge'u}
+\DeclareInputText{164}{\~n}
+\DeclareInputText{165}{\~N}
+\DeclareInputMath{166}{\mathordfeminine}
+\DeclareInputMath{167}{\mathordmasculine}
+\DeclareInputText{168}{\textquestiondown}
+\DeclareInputMath{170}{\lnot}
+\DeclareInputText{171}{\textonehalf}
+\DeclareInputText{172}{\textonequarter}
+\DeclareInputText{173}{\textexclamdown}
+\DeclareInputText{174}{\guillemotleft}
+\DeclareInputText{175}{\guillemotright}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareInputMath{224}{\alpha}
+\DeclareInputText{225}{\ss}
+\DeclareInputMath{226}{\Gamma}
+\DeclareInputMath{227}{\pi}
+\DeclareInputMath{228}{\Sigma}
+\DeclareInputMath{229}{\sigma}
+\DeclareInputMath{230}{\mu}
+\DeclareInputMath{231}{\tau}
+\DeclareInputMath{232}{\Phi}
+\DeclareInputMath{233}{\Theta}
+\DeclareInputMath{234}{\Omega}
+\DeclareInputMath{235}{\delta}
+\DeclareInputMath{236}{\infty}
+\DeclareInputMath{237}{\phi}
+\DeclareInputMath{238}{\varepsilon}
+\DeclareInputMath{239}{\cap}
+\DeclareInputMath{240}{\equiv}
+\DeclareInputMath{241}{\pm}
+\DeclareInputMath{242}{\ge}
+\DeclareInputMath{243}{\le}
+\DeclareInputMath{246}{\div}
+\DeclareInputMath{247}{\approx}
+\DeclareInputText{248}{\textdegree}
+\DeclareInputText{249}{\textperiodcentered}
+\DeclareInputText{250}{\textbullet}
+\DeclareInputMath{251}{\surd}
+\DeclareInputMath{252}{\mathnsuperior}
+\DeclareInputMath{253}{\mathtwosuperior}
+\DeclareInputText{254}{\textblacksquare}
+\DeclareInputText{255}{\nobreakspace}
+%</cp862>
+% \end{macrocode}
+%
+% \begin{macro}{\DisableNikud}
+% A utility macro to ignore any nikud character that may appear in the
+% input. This allows you to ignore cp1255 nikud characters that happened to
+% appear in the input.
+% \end{macro}
+% \begin{macrocode}
+%<*8859-8>
+\newcommand{\DisableNikud}{%
+ \DeclareInputText{192}{}%
+ \DeclareInputText{193}{}%
+ \DeclareInputText{194}{}%
+ \DeclareInputText{195}{}%
+ \DeclareInputText{196}{}%
+ \DeclareInputText{197}{}%
+ \DeclareInputText{198}{}%
+ \DeclareInputText{199}{}%
+ \DeclareInputText{200}{}%
+ \DeclareInputText{201}{}%
+ \DeclareInputText{203}{}%
+ \DeclareInputText{204}{}%
+ \DeclareInputText{205}{}%
+ \DeclareInputText{206}{}%
+ \DeclareInputText{207}{}%
+ \DeclareInputText{208}{}%
+ \DeclareInputText{209}{}%
+ \DeclareInputText{210}{}%
+ \DeclareInputText{211}{}%
+ \DeclareInputText{212}{}%
+ \DeclareInputText{213}{}%
+ \DeclareInputText{214}{}%
+}
+%</8859-8>
+% \end{macrocode}
+%
+% Finally, we reset the category code of the |@| sign at the end of
+% all |.def| files.
+% \begin{macrocode}
+%<-driver>\makeatother
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebinp.pdf b/macros/latex/contrib/babel-contrib/hebrew/hebinp.pdf
new file mode 100644
index 0000000000..3fd35427f1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebinp.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebrew.dtx b/macros/latex/contrib/babel-contrib/hebrew/hebrew.dtx
new file mode 100644
index 0000000000..19f0fbf0fc
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebrew.dtx
@@ -0,0 +1,3329 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{3345}
+%
+% \iffalse meta-comment
+%% Hebrew language definition and additional packages.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%<*calendar>
+%% TeX & LaTeX macros for computing Hebrew date from Gregorian one
+%% Copyright (C) 1991 by Michail Rozman, misha@iop.tartu.ew.su
+%%
+%</calendar>
+% \fi
+%
+%
+% \iffalse
+%<hebrew>\ProvidesFile{hebrew.ldf}
+%<rightleft>\ProvidesFile{rlbabel.def}
+%<calendar>\ProvidesPackage{hebcal}
+%<*driver>
+\ProvidesFile{hebrew.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebrew.dtx}
+ [2005/03/30 v2.3h %
+% \iffalse
+%<hebrew> Hebrew language definition from the babel system
+%<rightleft> Right-to-Left support from the babel system
+%<calendar> Hebrew calendar
+%<driver> Driver file for hebrew support
+% \fi
+ Hebrew language support from the babel system]
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you are
+% currently reading. It will be extracted from this file by the \dst{}
+% program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\providecommand\babel{\textsf{babel}}
+\providecommand\file[1]{\texttt{#1}}
+\makeatletter
+% \end{macrocode}
+%
+% The code lines are numbered within sections,
+% \begin{macrocode}
+\@addtoreset{CodelineNo}{section}
+\renewcommand\theCodelineNo{%
+ \reset@font\scriptsize\thesection.\arabic{CodelineNo}}
+% \end{macrocode}
+% which should also be visible in the index; hence this
+% redefinition of a macro from \file{doc.sty}.
+% \begin{macrocode}
+\renewcommand\codeline@wrindex[1]{\if@filesw
+ \immediate\write\@indexfile
+ {\string\indexentry{#1}%
+ {\number\c@section.\number\c@CodelineNo}}\fi}
+% \end{macrocode}
+%
+% The glossary environment is used or the change log, but its
+% definition needs changing for this document.
+% \begin{macrocode}
+\renewenvironment{theglossary}{%
+ \glossary@prologue%
+ \GlossaryParms \let\item\@idxitem \ignorespaces}%
+ {}
+\makeatother
+\DisableCrossrefs
+\CodelineIndex
+\RecordChanges
+\title{Hebrew language support from the \babel\ system}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \tableofcontents
+ \DocInput{hebrew.dtx}
+ \DocInput{hebinp.dtx}
+ \DocInput{hebrew.fdd}
+ \DocInput{heb209.dtx}
+ \clearpage
+ \def\filename{index}
+ \PrintIndex
+ \clearpage
+ \def\filename{changes}
+ \PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \providecommand\babel{\textsf{babel}}
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\file[1]{\texttt{#1}}
+% \providecommand\pkg[1]{\texttt{#1}}
+% \providecommand\XeT{X\kern-.125em\lower.5ex\hbox{E}\kern-.1667emT\@}
+% \providecommand\scrunch{\setlength{\itemsep}{-.05in}}
+% \GetFileInfo{hebrew.dtx}
+%
+% \changes{hebrew~0.1}{??/??/??}{%
+% Preliminary \LaTeX\ Hebrew option (by Sergio Fogel)}
+% \changes{hebrew~0.2}{??/??/??}{%
+% Corrections and additions (by Rama Porrat)}
+% \changes{hebrew~0.6}{??/??/??}{Additions (by Yael Dubinsky)}
+% \changes{hebrew~1.2}{??/??/??}{%
+% Bilingual tables, penalties, documentation and more changes
+% (by Yaniv Bargury)}
+% \changes{hebrew~1.30}{1992/05/15}{%
+% Font selection, various (by Alon Ziv)}
+% \changes{hebrew~1.31}{1993/02/22}{Bug fixes (by Alon Ziv)}
+% \changes{hebrew~1.32}{1993/03/10}{Made font-change command
+% for numbers `\cs{protect}'ed (by Alon Ziv)}
+% \changes{hebrew~1.33}{1993/03/11}{%
+% Made \cs{refstepcounter} work using \cs{@ltor} (by Alon Ziv)}
+% \changes{hebrew~1.34}{1993/03/22}{%
+% Moved font loading to another file. Added \cs{mainsec}.
+% Made all text strings be produced by control codes (similar to
+% \LaTeX 2.09 Mar '92). Fixed \cs{noindent} (by Alon Ziv)}
+% \changes{hebrew~1.35}{1993/03/22}{%
+% Moved the texts to a file selected by the current encoding
+% (by Alon Ziv)}
+% \changes{hebrew~1.36}{1993/03/24}{Use \TeX\ tricks to redefine
+% \cs{theXXXX} without keeping old definitions.
+% Use only \cs{@eng} for direction/font change (removed \cs{@ltor}).
+% Switched from use of \cs{mainsec} to code taken from \babel\
+% system (by Alon Ziv)}
+% \changes{hebrew~1.37}{1993/03/28}{%
+% Use \cs{add@around} in defining font size commands. Small bug
+% fixes (by Alon Ziv)}
+% \changes{hebrew~1.38}{1993/04/20}{%
+% \cs{everypar} changed so that \cs{noindent} works unmodified
+% (by Alon Ziv, thanks to Chris Rowley)}
+% \changes{hebrew~1.39}{1993/08/10}{%
+% Redefined primitive sectioning commands. Changed \cs{include} so
+% it finds \texttt{.h}, \texttt{.xet}, and \texttt{.ltx} files (no
+% extension needed). Reinstated use of \cs{@ltor} (by Alon Ziv)}
+% \changes{hebrew~1.40}{1993/09/01}{Added the \cs{@brackets} hack
+% (by Alon Ziv)}
+% \changes{hebrew~1.41}{1993/09/09}{%
+% Reworked towards using NFSS2. Changed some macro names to be more
+% logical: renamed \cs{@ltor} to \cs{@number}, \cs{@eng} to
+% \cs{@latin}, and (in \texttt{hebrew.ldf}) \cs{@heb} to
+% \cs{@hebrew} (by Alon Ziv)}
+% \changes{hebrew~1.42}{1993/09/22}{%
+% Made list environments work better. Fixed thebibliography
+% environment (by Alon Ziv)}
+% \changes{hebrew~2.0a}{1998/01/01}{%
+% Completely rewritten for \LaTeXe\ and \babel\ support. Various
+% input and font encodings (with NFSS2) are supported too. The
+% original \pkg{hebrew.sty} is divided to a number of packages and
+% definition files for better readability and extensibility. Added
+% some user- and code-level documentation inside the \texttt{.dtx}
+% and \texttt{.fdd} files, and \LaTeX -driven installation with
+% \pkg{hebrew.ins} (by Boris Lavva)}
+% \changes{hebrew~2.1}{2000/11/23}{%
+% corrections from Sivan Toledo: sender name in letter, and section name in
+% headings. (by Tzafrir Cohen)}
+% \changes{hebrew~2.2}{2000/12/11}{%
+% renamed hebrew letters to heb* (e.g.: alef renamed to hebalef)
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3}{2001/02/27}{
+% added several \cs{@ifclassloaded}\{slides\} to allow the use of the
+% slides class. (by Tzafrir Cohen)}
+% \changes{hebrew~2.3a}{2001/07/09}{
+% The documentation should now be built fine (broken since at least
+% 2.1, and probably 2.0) (by Tzafrir Cohen)}
+% \changes{hebrew~2.3b}{2001/08/16}{
+% minor clean-ups. The documentation builds now with no warnings.
+% Also removed \cs{R} from the caption macro (added in 2.1)
+% Added internal \cs{@ensure@L} and \cs{@ensure@R}
+% (Is there a real need for them? Maybe should they be exposed?)
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3c}{2001/10/05}{
+% a temporary fix to the \cs{gim} macro. Should be replaced by stuff
+% from hebcal.
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3d}{2002/01/04}{
+% Initial support for the prosper class. Added \cs{arabicnorl} .
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3e}{2002/08/09}{
+% Removing hebtech from this distriution (not relevant to babel),
+% added \cs{HeblatexEncoding}. some docs cleanup
+% (by Tzafrir Cohen)}
+% \changes{hebrew~2.3f}{2002/12/26}{
+% redefined \cs{list} instead of redefining every environment
+% that uses it. some pscolor handling, removed HeblatexEncoding
+% (don't use 2.3e) (by Tzafrir Cohen)}
+% \changes{hebrew~2.3g}{2003/06/05}{
+% Reimplemented the printing of Hebrew numerals and Hebrew
+% counters; modified \pkg{hebcal.sty} to use this implementation
+% when typesetting Hebrew dates; added option |full| to package
+% \pkg{hebcal}; also removed some gratuitous
+% spaces inserted by \pkg{hebcal.sty} by adding comment marks.
+% CAUTION: the changes to \pkg{hebcal.sty} make it dependent on
+% \pkg{babel} and not useable as a stand-alone package. Is this a
+% problem? (by Ron Artstein)}
+%
+% \section{The Hebrew language}\label{sec:hebrew}
+%
+% The file \file{\filename}\footnote{The Hebrew language support
+% files described in this section have version number \fileversion\
+% and were last revised on \filedate.} provides the following
+% packages and files for Hebrew language support:
+% \begin{description}
+% \item[\file{hebrew.ldf}] file defines all the language-specific
+% macros for the Hebrew language.
+% \item[\file{rlbabel.def}] file is used by |hebrew.ldf| for
+% bidirectional versions of the major \LaTeX{} commands and
+% environments. It is designed to be used with other right-to-left
+% languages, not only with Hebrew.
+% \item[\pkg{hebcal.sty}] package defines a set of macros for
+% computing Hebrew date from Gregorian one.
+% \end{description}
+%
+% Additional Hebrew input and font encoding definition files that
+% should be included and used with \file{hebrew.ldf} are:
+% \begin{description}
+% \item[\file{hebinp.dtx}] provides Hebrew input encodings, such as
+% ISO 8859-8, MS Windows codepage 1255 or IBM PC codepage 862
+% (see Section~\ref{sec:hebinp} on page~\pageref{sec:hebinp}).
+% \item[\file{hebrew.fdd}] contains Hebrew font encodings, related
+% font definition files and \pkg{hebfont} package that
+% provides Hebrew font switching commands (see
+% Section~\ref{sec:hebfdd} on page~\pageref{sec:hebfdd} for
+% further details).
+% \end{description}
+%
+% \LaTeX~2.09 compatibility files are included with
+% \file{heb209.dtx} and gives possibility to compile existing
+% \LaTeX~2.09 Hebrew documents with small (if any) changes (see
+% Section~\ref{sec:heb209} on page~\pageref{sec:heb209} for
+% details).
+%
+% Finally, optional document class \pkg{hebtech} may be useful for
+% writing theses and dissertations in both Hebrew and English (and
+% any other languages included with \babel). It designed to meet
+% requirements of the Graduate School of the Technion --- Israel
+% Institute of Technology.
+%
+% \emph{As of version 2.3e hebtech is no longer distributed together
+% with heblatex. It should be part of a new "hebclasses" package}
+%
+% \subsection{Acknowledgement}
+%
+% The following people have contributed to Hebrew package in one
+% way or another, knowingly or unknowingly. In alphabetical order:
+% Irina Abramovici, Yaniv Bargury, Yael Dubinsky, Sergio Fogel,
+% Dan Haran, Rama Porrat, Michail Rozman, Alon Ziv.
+%
+% Tatiana Samoilov and Vitaly Surazhsky found a number of serious
+% bugs in preliminary version of Hebrew package.
+%
+% A number of other people have contributed comments and
+% information. Specific contributions are acknowledged within the
+% document.
+%
+% I want to thank my wife, Vita, and son, Mishka, for their
+% infinite love and patience.
+%
+% If you made a contribution and I haven't mentioned it, don't
+% worry, it was an accident. I'm sorry. Just tell me and I will add
+% you to the next version.
+%
+% \StopEventually{}
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating external files:
+% \begin{center}
+% \begin{tabular}{@{}ll}
+% driver & produce a documentation driver file \\[4pt]
+% hebrew & produce Hebrew language support file\\
+% rightleft & create right-to-left support file\\
+% calendar & create Hebrew calendar package
+% \end{tabular}
+% \end{center}
+% A typical \dst{} command file would then have entries like:
+% \begin{quote}
+% |\generateFile{hebrew.ldf}{t}{\from{hebrew.dtx}{hebrew}}|
+% \end{quote}
+%
+% \subsection{Hebrew language definitions}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the |@|
+% sign, etc.
+% \begin{macrocode}
+%<*hebrew>
+\LdfInit{hebrew}{captionshebrew}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, |hebrew| will be an `unknown' language, in which case we
+% have to make it known. So we check for the existence of
+% |\l@hebrew| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@hebrew\@undefined
+ \@nopatterns{Hebrew}%
+ \adddialect\l@hebrew0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\hebrewencoding}
+% \emph{FIX DOCS REGARDING 8BIT}
+%
+% Typesetting Hebrew texts implies that a special input and output
+% encoding needs to be used. Generally, the user may choose
+% between different available Hebrew encodings provided. The
+% current support for Hebrew uses all available fonts from the
+% Hebrew University of Jerusalem encoded in `old-code' 7-bit
+% encoding also known as Israeli Standard SI-960. We define for
+% these fonts the Local Hebrew Encoding |LHE| (see the file
+% |hebrew.fdd| for more details), and the |LHE| encoding definition
+% file should be loaded by default.
+%
+% Other fonts are available in windows-cp1255 (a superset of ISO-8859-8
+% with nikud). For those, the encoding |HE8| should be used. Such fonts
+% are, e.g., windows' TrueType fonts (once cnverted to Type1 or MetaFont)
+% and IBM's Type1 fonts.
+%
+% However, if an user wants to use another font encoding, for
+% example, cyrillic encoding T2 and extended latin encoding T1, ---
+% he/she has to load the corresponding file \emph{before} the
+% \pkg{hebrew} package. This may be done in the following way:
+% \begin{quote}
+% |\usepackage[LHE,T2,T1]{fontenc}|\\
+% |\usepackage[hebrew,russian,english]{babel}|
+% \end{quote}
+% We make sure that the |LHE| encoding is known to \LaTeX{} at end
+% of this package.
+%
+% Also note that if you want to use the encoding |HE8| , you should define
+% the following in your document, \emph{before loading babel}:
+% \begin{quote}
+% |\def\HeblatexEncoding{HE8}|\\
+% |\def\HeblatexEncodingFile{he8enc}|
+% \end{quote}
+% \changes{hebrew-2.3h}{2004/02/20}{Make LHE the default encoding for
+% compatibility reasons}
+% \begin{macrocode}
+\providecommand{\HeblatexEncoding}{LHE}%
+\providecommand{\HeblatexEncodingFile}{lheenc}%
+\newcommand{\heblatex@set@encoding}[2]{
+}
+\AtEndOfPackage{%
+ \@ifpackageloaded{fontenc}{%
+ \@ifl@aded{def}{%
+ \HeblatexEncodingFile}{\def\hebrewencoding{\HeblatexEncoding}}{}%
+ }{%
+ \input{\HeblatexEncodingFile.def}%
+ \def\hebrewencoding{\HeblatexEncoding}%
+ }}
+% \end{macrocode}
+% \end{macro}
+%
+% We also need to load inputenc package with one of the Hebrew
+% input encodings. By default, we set up the |8859-8| codepage.
+% If an user wants to use many input encodings in the same
+% document, for example, the MS Windows Hebrew codepage |cp1255|
+% and the standard IBM PC Russian codepage |cp866|, he/she has to
+% load the corresponding file \emph{before} the hebrew package
+% too. This may be done in the following way:
+% \begin{quote}
+% |\usepackage[cp1255,cp866]{inputenc}|\\
+% |\usepackage[hebrew,russian,english]{babel}|
+% \end{quote}
+%
+% An user can switch input encodings in the document using the
+% command |\inputencoding|, for example, to use the |cp1255|:
+% \begin{quote}
+% |\inputencoding{cp1255}|
+% \end{quote}
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \@ifpackageloaded{inputenc}{}{\RequirePackage[8859-8]{inputenc}}}
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Hebrew language.
+%
+% \begin{macro}{\hebrewhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|. They are set
+% to~2.
+% \changes{hebrew~2.0b}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionshebrew}
+% The macro |\captionshebrew| replaces all captions used in the four
+% standard document classes provided with \LaTeXe with their Hebrew
+% equivalents.
+% \changes{hebrew-2.0b}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionshebrew{%
+ \def\prefacename{\@ensure@R{\hebmem\hebbet\hebvav\hebalef}}%
+ \def\refname{\@ensure@R{\hebresh\hebshin\hebyod\hebmem\hebtav\ %
+ \hebmem\hebqof\hebvav\hebresh\hebvav\hebtav}}%
+ \def\abstractname{\@ensure@R{\hebtav\hebqof\hebtsadi\hebyod\hebresh}}%
+ \def\bibname{\@ensure@R{\hebbet\hebyod\hebbet\heblamed\hebyod\hebvav%
+ \hebgimel\hebresh\hebpe\hebyod\hebhe}}%
+ \def\chaptername{\@ensure@R{\hebpe\hebresh\hebqof}}%
+ \def\appendixname{\@ensure@R{\hebnun\hebsamekh\hebpe\hebhet}}%
+ \def\contentsname{\@ensure@R{%
+ \hebtav\hebvav\hebkaf\hebfinalnun\ %
+ \hebayin\hebnun\hebyod\hebyod\hebnun\hebyod\hebfinalmem}}%
+ \def\listfigurename{\@ensure@R{%
+ \hebresh\hebshin\hebyod\hebmem\hebtav\ %
+ \hebalef\hebyod\hebvav\hebresh\hebyod\hebfinalmem}}%
+ \def\listtablename{\@ensure@R{%
+ \hebresh\hebshin\hebyod\hebmem\hebtav\
+ \hebtet\hebbet\heblamed\hebalef\hebvav\hebtav}}%
+ \def\indexname{\@ensure@R{\hebmem\hebpe\hebtav\hebhet}}%
+ \def\figurename{\@ensure@R{\hebalef\hebyod\hebvav\hebresh}}%
+ \def\tablename{\@ensure@R{\hebtet\hebbet\heblamed\hebhe}}%
+ \def\partname{\@ensure@R{\hebhet\heblamed\hebqof}}%
+ \def\enclname{\@ensure@R{\hebresh\hebtsadi"\hebbet}}%
+ \def\ccname{\@ensure@R{\hebhe\hebayin\hebtav\hebqof\hebyod%
+ \hebfinalmem}}%
+ \def\headtoname{\@ensure@R{\hebalef\heblamed}}%
+ \def\pagename{\@ensure@R{\hebayin\hebmem\hebvav\hebdalet}}%
+ \def\psname{\@ensure@R{\hebnun.\hebbet.}}%
+ \def\seename{\@ensure@R{\hebresh\hebalef\hebhe}}%
+ \def\alsoname{\@ensure@R{\hebresh\hebalef\hebhe \hebgimel%
+ \hebmemesof}}%
+ \def\proofname{\@ensure@R{\hebhe\hebvav\hebkaf\hebhet\hebhe}}
+ \def\glossaryname{\@ensure@L{Glossary}}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\slidelabel}
+% Here we fix the macro |slidelabel| of the seminar package. Note
+% that this still won't work well enough when overlays will be
+% involved
+% \begin{macrocode}
+\@ifclassloaded{seminar}{%
+ \def\slidelabel{\bf \if@rl\R{\hebshin\hebqof\hebfinalpe{} \theslide}%
+ \else\L{Slide \theslide}%
+ \fi}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% Here we provide an user with translation of Gregorian dates
+% to Hebrew. In addition, the \pkg{hebcal} package can be used
+% to create Hebrew calendar dates.
+%
+% \begin{macro}{\hebmonth}
+% The macro |\hebmonth{|\emph{month}|}| produces month names in
+% Hebrew.
+% \begin{macrocode}
+\def\hebmonth#1{%
+ \ifcase#1\or \hebyod\hebnun\hebvav\hebalef\hebresh\or %
+ \hebpe\hebbet\hebresh\hebvav\hebalef\hebresh\or %
+ \hebmem\hebresh\hebfinaltsadi\or %
+ \hebalef\hebpe\hebresh\hebyod\heblamed\or %
+ \hebmem\hebalef\hebyod\or \hebyod\hebvav\hebnun\hebyod\or %
+ \hebyod\hebvav\heblamed\hebyod\or %
+ \hebalef\hebvav\hebgimel\hebvav\hebsamekh\hebtet\or %
+ \hebsamekh\hebpe\hebtet\hebmem\hebbet\hebresh\or %
+ \hebalef\hebvav\hebqof\hebtet\hebvav\hebbet\hebresh\or %
+ \hebnun\hebvav\hebbet\hebmem\hebbet\hebresh\or %
+ \hebdalet\hebtsadi\hebmem\hebbet\hebresh\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hebdate}
+% The macro |\hebdate{|\emph{day}|}{|\emph{month}|}{|\emph{year}|}|
+% translates a given Gregorian date to Hebrew.
+% \begin{macrocode}
+\def\hebdate#1#2#3{%
+ \beginR\beginL\number#1\endL\ \hebbet\hebmonth{#2}
+ \beginL\number#3\endL\endR}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hebday}
+% The macro |\hebday| will replace |\today| command when in Hebrew
+% mode.
+% \begin{macrocode}
+\def\hebday{\hebdate{\day}{\month}{\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datehebrew}
+% The macro |\datehebrew| redefines the command |\today| to produce
+% Gregorian dates in Hebrew. It uses the macro |\hebday|.
+% \begin{macrocode}
+\def\datehebrew{\let\today=\hebday}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\extrashebrew| will perform all the extra definitions
+% needed for the Hebrew language. The macro |\noextrashebrew|
+% is used to cancel the actions of |\extrashebrew|.
+%
+% \begin{macro}{\extrashebrew}
+% We switch font encoding to Hebrew and direction to
+% right-to-left. We cannot use the regular language switching
+% commands (for example, |\sethebrew| and |\unsethebrew| or
+% |\selectlanguage{hebrew}|), when in restricted horizontal mode,
+% because it will result in \emph{unbalanced} |\beginR| or
+% |\beginL| primitives.
+% Instead, in \TeX 's restricted horizontal mode, the
+% |\L{|\emph{latin text}|}| and |\R{|\emph{hebrew text}|}|, or
+% |\embox{|\emph{latin text}|}| and |\hmbox{|\emph{hebrew text}|}|
+% should be used.
+%
+% Hence, we use |\beginR| and |\beginL| switching commands only
+% when not in restricted horizontal mode.
+% \begin{macrocode}
+\addto\extrashebrew{%
+ \tohebrew%
+ \ifhmode\ifinner\else\beginR\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noextrashebrew}
+% The macro |\noextrashebrew| is used to cancel the actions of
+% |\extrashebrew|. We switch back to the previous font encoding and
+% restore left-to-right direction.
+% \begin{macrocode}
+\addto\noextrashebrew{%
+ \fromhebrew%
+ \ifhmode\ifinner\else\beginL\fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% Generally, we can switch to- and from- Hebrew by means of
+% standard \babel -defined commands, for example,
+% \begin{quote}
+% |\selectlanguage{hebrew}|
+% \end{quote}
+% or
+% \begin{quote}
+% |\begin{otherlanguage}{hebrew}|\\
+% \hspace*{1.5em} some Hebrew text\\
+% |\end{otherlanguage}|
+% \end{quote}
+% Now we define two additional commands that offer the possibility
+% to switch to and from Hebrew language. These commands are
+% backward compatible with the previous versions of
+% \pkg{hebrew.sty}.
+%
+% \begin{macro}{\sethebrew}
+% \begin{macro}{\unsethebrew}
+% The command |\sethebrew| will switch from the current font encoding
+% to the hebrew font encoding, and from the current direction of
+% text to the right-to-left mode. The command |\unsethebrew| switches
+% back.
+%
+% Both commands use standard right-to-left switching macros
+% |\setrllanguage{|\emph{ r2l language name}|}| and
+% |\unsetrllanguage{|\emph{r2l language name}|}|, that
+% defined in the \file{rlbabel.def} file.
+% \begin{macrocode}
+\def\sethebrew{\setrllanguage{hebrew}}
+\def\unsethebrew{\unsetrllanguage{hebrew}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hebrewtext}
+% \begin{macro}{\nohebrewtext}
+% The following two commands are \emph{obsolete} and work only
+% in \LaTeX 2.09 compatibility mode. They are synonyms of
+% |\sethebrew| and |\unsethebrew| defined above.
+% \begin{macrocode}
+\if@compatibility
+ \let\hebrewtext=\sethebrew
+ \let\nohebrewtext=\unsethebrew
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tohebrew}
+% \begin{macro}{\fromhebrew}
+% These two commands change only the current font encoding to- and
+% from- Hebrew encoding. Their implementation uses
+% |\@torl{|\emph{language name}|}| and |\@fromrl| macros defined in
+% \file{rlbabel.def} file. Both commands may be useful \emph{only}
+% for package and class writers, not for regular users.
+% \begin{macrocode}
+\def\tohebrew{\@torl{hebrew}}%
+\def\fromhebrew{\@fromrl}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@hebrew}
+% Sometimes we need to preserve Hebrew mode without knowing in
+% which environment we are located now. For these cases, the
+% |\@hebrew{|\emph{hebrew text}|}| macro will be useful. Not that
+% this macro is similar to the |\@number| and |\@latin| macros
+% defined in \file{rlbabel.def} file.
+% \begin{macrocode}
+\def\@@hebrew#1{\beginR{{\tohebrew#1}}\endR}
+\def\@hebrew{\protect\@@hebrew}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Hebrew numerals}
+%
+% We provide commands to print numbers in the traditional
+% notation using Hebrew letters. We need commands that print
+% a Hebrew number from a decimal input, as well as commands
+% to print the value of a counter as a Hebrew number.
+% \begin{macro}{\if@gim@apost}
+% \begin{macro}{\if@gim@final}
+% Hebrew numbers can be written in various styles: with or without
+% apostrophes, and with the letters kaf, mem, nun, pe, tsadi as either
+% final or initial forms when they are the last letters in the
+% sequence. We provide two flags to set the style options.
+% \begin{macrocode}
+\newif\if@gim@apost % whether we print apostrophes
+\newif\if@gim@final % whether we use final or initial letters
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\hebrewnumeral}
+% \begin{macro}{\Hebrewnumeral}
+% \begin{macro}{\Hebrewnumeralfinal}
+% The commands that print a Hebrew number
+% must specify the style locally: relying on a global style
+% option could cause a counter to
+% print in an inconsistent manner---for instance, page numbers
+% might appear in different styles if the global style option
+% changed mid-way through a document.
+% The commands only allow three of the four possible flag
+% combinations (I do not know of a use that requires the
+% combination of final letters and no apostrophes --RA).
+%
+% Each command sets the style flags and calls |\@hebrew@numeral|.
+% Double braces are used in order to protect the values of
+% |\@tempcnta| and |\@tempcntb|, which are changed by this call;
+% they also keep the flag assignments local (this is not important
+% because the global values are never used).
+% \begin{macrocode}
+\newcommand*{\hebrewnumeral}[1] % no apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@apostfalse\@hebrew@numeral{#1}}}
+\newcommand*{\Hebrewnumeral}[1] % apostrophe, no final letters
+ {{\@gim@finalfalse\@gim@aposttrue\@hebrew@numeral{#1}}}
+\newcommand*{\Hebrewnumeralfinal}[1] % apostrophe, final letters
+ {{\@gim@finaltrue\@gim@aposttrue\@hebrew@numeral{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\alph}
+% \begin{macro}{\@alph}
+% \begin{macro}{\Alph}
+% \begin{macro}{\@Alph}
+% \begin{macro}{\Alphfinal}
+% \begin{macro}{\@Alphfinal}
+% Counter-printing commands are based on the above commands. The
+% natural name for the counter-printing commands is |\alph|, because
+% Hebrew numerals are the only way to represent numbers with
+% Hebrew letters (kaf always means~20, never~11). Hebrew has no
+% uppercase letters, hence no need for the familiar meaning of |\Alph|;
+% we therefore define |\alph| to print counters as Hebrew numerals
+% without apostrophes, and |\Alph| to print with apostrophes. A third
+% form, |\Alphfinal|, is provided to print with apostrophes and final
+% letters, as is required for Hebrew year designators. The commands
+% |\alph| and |\Alph| are defined in \pkg{latex.ltx}, and we only
+% need to redefine the internal commands |\@alph| and
+% |\@Alph|; for |\Alphfinal| we need to provide both a wrapper and
+% an internal command.
+% The counter printing commands are made semi-robust: without the
+% |\protect|, commands like |\theenumii| break (I'm not quite clear
+% on why this happens, --RA); at the same time, we cannot make the
+% commands too robust (e.g.~with |\DeclareRobustCommand|) because
+% this would enter the command name rather than its value into
+% files like |.aux|, |.toc| etc\@.
+% The old meanings of meaning of |\@alph| and |\@Alph| are saved
+% upon entering Hebrew mode and restored upon exiting it.
+% \begin{macrocode}
+\addto\extrashebrew{%
+ \let\saved@alph=\@alph%
+ \let\saved@Alph=\@Alph%
+ \renewcommand*{\@alph}[1]{\protect\hebrewnumeral{\number#1}}%
+ \renewcommand*{\@Alph}[1]{\protect\Hebrewnumeral{\number#1}}%
+ \def\Alphfinal#1{\expandafter\@Alphfinal\csname c@#1\endcsname}%
+ \providecommand*{\@Alphfinal}[1]{\protect\Hebrewnumeralfinal{\number#1}}}
+\addto\noextrashebrew{%
+ \let\@alph=\saved@alph%
+ \let\@Alph=\saved@Alph}
+% \end{macrocode}
+% Note that |\alph| (without apostrophes) is already the
+% appropriate choice for the second-level enumerate label, and
+% |\Alph| (with apostrophes) is an appropriate choice for appendix;
+% however, the default \LaTeX\ labels need to be redefined for
+% appropriate cross-referencing, see below.
+% \LaTeX\ default class files specify |\Alph| for
+% the fourth-level enumerate level, this should probably be changed.
+% Also, the way labels get flushed left by default looks inappropriate
+% for Hebrew numerals, so we should redefine |\labelenumii| as well
+% as |\labelenumiv| (presently not implemented).
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\theenumii}
+% \begin{macro}{\theenumiv}
+% \begin{macro}{\label}
+% Cross-references to counter labels need to be printed according
+% to the language environment in which a label was issued, not
+% the environment in which it is called: for example, a label~(1b)
+% issued in a Latin environment should be referred to as~(1b) in a
+% Hebrew text, and label~(2dalet) issued in a Hebrew environment
+% should be referred to as~(2dalet) in a Latin text. This was the
+% unanimous opinion in a poll sent to the Ivri\TeX\ list.
+% We therefore redefine |\theenumii| and |\theenumiv|, so that an
+% explicit language instruction gets written to the |.aux| file.
+% \begin{macrocode}
+\renewcommand{\theenumii}
+ {\if@rl\protect\hebrewnumeral{\number\c@enumii}%
+ \else\protect\L{\protect\@@alph{\number\c@enumii}}\fi}
+\renewcommand{\theenumiv}
+ {\if@rl\protect\Hebrewnumeral{\number\c@enumiv}%
+ \else\protect\L{\protect\@@Alph{\number\c@enumiv}}\fi}
+% \end{macrocode}
+% We also need to control for the font and direction in which a
+% counter label is printed. Direction is straightforward: a Latin
+% label like~(1b) should be written left-to-right when called in a
+% Hebrew text, and a Hebrew label like~(2dalet) should be written
+% right-to-left when called in a Latin text. The font question is
+% more delicate, because we should decide whether the numerals
+% should be typeset in the font of the language enviroment in which
+% the label was issued, or that of the environment in which it is
+% called.
+% \begin{itemize}
+% \item
+% A purely numeric label like~(23) looks best if it is set in the
+% font of the surrounding language.
+% \item
+% But a mixed alphanumeric label like~(1b) lookes weird if
+% the~`1' is taken from the Hebrew font; likewise, (2dalet) looks
+% weird if the~`2' is taken from a Latin font.
+% \item
+% Finally, mixing the two possibilities is worst, because a
+% single Hebrew sentence referring to examples~(1b) and~(2) would
+% take the~`1' from the Latin font and the~`2' from the Hebrew
+% font, and this looks really awful. (It is also very hard to
+% implement).
+% \end{itemize}
+% In light of the conflicting considerations it seems like there's
+% no perfect solution. I have chosen to implement the top option,
+% where numerals are taken from the font of the surrounding
+% language, because it seems to me that reference to purely numeric
+% labels is the most common, so this gives a good solution to the
+% majority of cases and a mediocre solution to the minority.
+%
+% We redefine the |\label| command which writes to the
+% |.aux| file. Depending on the language environment we issue
+% appropriate |\beginR/L|$\cdots$|\endR/L| commands to control the
+% direction without affecting the font. Since these commands do not
+% affect the value of |\if@rl|, we cannot use the macro
+% |\@brackets| to determine the correct brackets to be used with
+% |\p@enumiii|; instead, we let the language environment determine an
+% explicit definition.
+% \begin{macrocode}
+\def\label#1{\@bsphack
+ \if@rl
+ \def\p@enumiii{\p@enumii)\theenumii(}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{{\beginR\@currentlabel\endR}{\thepage}}}%
+ \else
+ \def\p@enumiii{\p@enumii(\theenumii)}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{{\beginL\@currentlabel\endL}{\thepage}}}%
+ \fi
+ \@esphack}
+% \end{macrocode}
+% NOTE: it appears that the definition of |\label| is
+% language-independent and thus belongs in \pkg{rlbabel.def}, but
+% this is not the case. The decision to typeset label numerals
+% in the font of the surrounding language is reasonable for Hebrew,
+% because mixed-font (1b) and (2dalet) are somewhat acceptable. The
+% same may not be acceptable for Arabic, whose numeral glyphs are
+% radically different from those in the Latin fonts. The decision
+% about the direction may also be different for Arabic, which is
+% more right-to-left oriented than Hebrew (two examples: dates like
+% 15/6/2003 are written left-to-right in Hebrew but right-to-left
+% in Arabic; equations like $1+2=3$ are written left-to-right in
+% Hebrew but right-to-left in Arabic elementary school textbooks
+% using Arabic numeral glyphs). My personal hunch is that a label
+% like~(1b) in an Arabic text would be typeset left-to-right if
+% the~`1' is a Western glyph, but right-to-left if the~`1' is an
+% Arabic glyph. But this is just a guess, I'd have to ask Arab
+% typesetters to find the correct answer. --RA.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\appendix}
+% The following code provides for the proper printing of appendix
+% numbers in tables of contents. Section and chapter headings are
+% normally bilingual: regardless of the text language, the author
+% supplies each section/chapter with two headings---one for the
+% Hebrew table of contents and one for the Latin table of contents.
+% It makes sense that the label should be a Latin letter in the
+% Latin table of contents and a Hebrew letter in the Hebrew table
+% of contents. The definition is similar to that of |\theenumii|
+% and |\theenumiv| above, but additional |\protect| commands ensure
+% that the entire condition is written the |.aux| file. The
+% appendix number will therefore be typeset according to the
+% environment in which it is used rather than issued: a Hebrew
+% number (with apostrophes) in a Hebrew environment and a Latin
+% capital letter in a Latin environment (the command
+% |\@@Alph| is set in \pkg{rlbabel.def} to hold the default meaning
+% of \LaTeX\ [latin] |\@Alph|, regardless of the mode in which it is
+% issued). The net result is that
+% the second appendix will be marked with~`B' in the Latin table of
+% contents and with `bet' in the Hebrew table of contents; the mark
+% in the main text will depend on the language of the appendix itself.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+\@ifclassloaded{slides}{}{%
+ \let\@@appendix=\appendix%
+ \@ifclassloaded{article}{%
+ \renewcommand\appendix{\@@appendix%
+ \renewcommand\thesection
+ {\protect\if@rl\protect\Hebrewnumeral{\number\c@section}%
+ \protect\else\@@Alph\c@section\protect\fi}}}
+ {\renewcommand\appendix{\@@appendix%
+ \renewcommand\thechapter
+ {\protect\if@rl\protect\Hebrewnumeral{\number\c@chapter}%
+ \protect\else\@@Alph\c@chapter\protect\fi}}}}}
+% \end{macrocode}
+% QUESTION: is this also the appropriate way to refer to an
+% appendix in the text, or should we retain the original label the
+% same way we did with |enumerate| labels?
+% ANOTHER QUESTION: are similar redefinitions needed for other
+% counters that generate texts in bilingual lists like |.lof/.fol|
+% and |.lot/.tol|? --RA.
+% \end{macro}
+% \begin{macro}{\@hebrew@numeral}
+% The command |\@hebrew@numeral| prints a Hebrew number. The groups
+% of thousands, millions, billions are separated by apostrophes and
+% typeset without apostrophes or final letters; the remainder
+% (under 1000) is typeset conventionally, with the selected styles
+% for apostrophes and final letters.
+% The function calls on |\gim@no@mil| to typeset each
+% three-digit block. The algorithm
+% is recursive, but the maximum recursion depth is~4 because \TeX\
+% only allows numbers up to $2^{31}-1 = 2{,}147{,}483{,}647$.
+% The typesetting routine is wrapped in |\@hebrew| in order to
+% ensure that numbers are always typeset in Hebrew mode.
+%
+% Initialize: |\@tempcnta| holds the value, |\@tempcntb| is used for
+% calculations.
+% \begin{macrocode}
+\newcommand*{\@hebrew@numeral}[1]
+{\@hebrew{\@tempcnta=#1\@tempcntb=#1\relax
+ \divide\@tempcntb by 1000
+% \end{macrocode}
+% If we're under 1000, call |\gim@nomil|
+% \begin{macrocode}
+ \ifnum\@tempcntb=0\gim@nomil\@tempcnta\relax
+% \end{macrocode}
+% If we're above 1000 then force no apostrophe and no final letter
+% styles for the value above~1000, recur for the value above~1000,
+% add an apostrophe, and call |\gim@nomil| for the remainder.
+% \begin{macrocode}
+ \else{\@gim@apostfalse\@gim@finalfalse\@hebrew@numeral\@tempcntb}'%
+ \multiply\@tempcntb by 1000\relax
+ \advance\@tempcnta by -\@tempcntb\relax
+ \gim@nomil\@tempcnta\relax
+ \fi
+}}
+% \end{macrocode}
+% NOTE: is it the case that 15,000 and 16,000 are written as
+% yod-he and yod-vav, rather than tet-vav and tet-zayin? This
+% vaguely rings a bell, but I'm not certain. If this is the case,
+% then the current behavior is incorrect and should be changed. --RA.
+% \end{macro}
+% \begin{macro}{\gim@nomil}
+% The command |\gim@nomil| typesets an integer between 0~and~999
+% (for~0 it typesets nothing). The code has been modified from the
+% old |hebcal.sty|
+% (appropriate credits---Boris Lavva and Michail Rozman ?).
+% |\@tempcnta| holds the total value that remains to be typeset.
+% At each stage we find the highest valued letter that is
+% less than or equal to |\@tempcnta|, and call on |\gim@print| to
+% subtract this value and print the letter.
+%
+% Initialize: |\@tempcnta| holds the value, there is no previous
+% letter.
+% \begin{macrocode}
+\newcommand*{\gim@nomil}[1]{\@tempcnta=#1\@gim@prevfalse
+% \end{macrocode}
+% Find the hundreds digit.
+% \begin{macrocode}
+ \@tempcntb=\@tempcnta\divide\@tempcntb by 100\relax % hundreds digit
+ \ifcase\@tempcntb % print nothing if no hundreds
+ \or\gim@print{100}{\hebqof}%
+ \or\gim@print{200}{\hebresh}%
+ \or\gim@print{300}{\hebshin}%
+ \or\gim@print{400}{\hebtav}%
+ \or\hebtav\@gim@prevtrue\gim@print{500}{\hebqof}%
+ \or\hebtav\@gim@prevtrue\gim@print{600}{\hebresh}%
+ \or\hebtav\@gim@prevtrue\gim@print{700}{\hebshin}%
+ \or\hebtav\@gim@prevtrue\gim@print{800}{\hebtav}%
+ \or\hebtav\@gim@prevtrue\hebtav\gim@print{900}{\hebqof}%
+ \fi
+% \end{macrocode}
+% Find the tens digit. The numbers 15 and 16 are traditionally
+% printed as tet-vav ($9+6$) and tet-zayin ($9+7$) to avoid
+% spelling the Lord's name.
+% \begin{macrocode}
+ \@tempcntb=\@tempcnta\divide\@tempcntb by 10\relax % tens digit
+ \ifcase\@tempcntb % print nothing if no tens
+ \or % number between 10 and 19
+ \ifnum\@tempcnta = 16 \gim@print {9}{\hebtet}% tet-zayin
+ \else\ifnum\@tempcnta = 15 \gim@print {9}{\hebtet}% tet-vav
+ \else \gim@print{10}{\hebyod}%
+ \fi % \@tempcnta = 15
+ \fi % \@tempcnta = 16
+% \end{macrocode}
+% Initial or final forms are selected according to the current
+% style option; |\gim@print| will force a non-final letter in
+% non-final position by means of a local style change.
+% \begin{macrocode}
+ \or\gim@print{20}{\if@gim@final\hebfinalkaf\else\hebkaf\fi}%
+ \or\gim@print{30}{\heblamed}%
+ \or\gim@print{40}{\if@gim@final\hebfinalmem\else\hebmem\fi}%
+ \or\gim@print{50}{\if@gim@final\hebfinalnun\else\hebnun\fi}%
+ \or\gim@print{60}{\hebsamekh}%
+ \or\gim@print{70}{\hebayin}%
+ \or\gim@print{80}{\if@gim@final\hebfinalpe\else\hebpe\fi}%
+ \or\gim@print{90}{\if@gim@final\hebfinaltsadi\else\hebtsadi\fi}%
+ \fi
+% \end{macrocode}
+% Print the ones digit.
+% \begin{macrocode}
+ \ifcase\@tempcnta % print nothing if no ones
+ \or\gim@print{1}{\hebalef}%
+ \or\gim@print{2}{\hebbet}%
+ \or\gim@print{3}{\hebgimel}%
+ \or\gim@print{4}{\hebdalet}%
+ \or\gim@print{5}{\hebhe}%
+ \or\gim@print{6}{\hebvav}%
+ \or\gim@print{7}{\hebzayin}%
+ \or\gim@print{8}{\hebhet}%
+ \or\gim@print{9}{\hebtet}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\gim@print}
+% \begin{macro}{\if@gim@prev}
+% The actual printing routine typesets a digit with the appropriate
+% apostrophes: if a number sequence consists of a
+% single letter then it is followed by a single apostrophe, and if
+% it consists of more than one letter then a double
+% apostrophe is inserted before the last letter.
+% We typeset the letters one at a time, keeping a flag that tells
+% us if any previous letters had been typeset.
+% \begin{macrocode}
+\newif\if@gim@prev % flag if a previous letter has been typeset
+% \end{macrocode}
+% For each letter, we
+% first subtract its value from the total. Then,
+% \begin{itemize}
+% \item
+% if the result is zero then this is the last letter; we check
+% the flag to see if this is the only letter and print it with
+% the appropriate apostrophe;
+% \item
+% if the result is not zero then there remain additional letters
+% to be typeset; we print without an apostrophe and set the
+% `previous letter' flag.
+% \end{itemize}
+% |\@tempcnta| holds the total value that remains to be typeset.
+% We first deduct the letter's value from |\@tempcnta|,
+% so |\@tempcnta| is zero if and only if this is the last letter.
+% \begin{macrocode}
+\newcommand*{\gim@print}[2]{% #2 is a letter, #1 is its value.
+ \advance\@tempcnta by -#1\relax% deduct the value from the remainder
+% \end{macrocode}
+% If this is the last letter, we print with the appropriate
+% apostrophe (depending on the style option):
+% if there is a preceding letter, print |"x| if the style calls for
+% apostrophes, |x| if it doesn't;
+% otherwise, this is the only letter: print |x'| if the style calls
+% for apostrophes, |x| if it doesn't.
+% \begin{macrocode}
+ \ifnum\@tempcnta=0% if this is the last letter
+ \if@gim@prev\if@gim@apost"\fi#2%
+ \else#2\if@gim@apost'\fi\fi%
+% \end{macrocode}
+% If this is not the last letter: print a non-final form (by
+% forcing a local style option) and set the `previous letter' flag.
+% \begin{macrocode}
+ \else{\@gim@finalfalse#2}\@gim@prevtrue\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hebr}
+% \begin{macro}{\gim}
+% The older Hebrew counter commands |\hebr| and |\gim| are retained
+% in order to keep older documents from breaking. They are set to
+% be equivalent to |\alph|, and their use is deprecated. Note that
+% |\hebr| gives different results than it had in the past---it
+% now typesets 11 as yod-alef rather than kaf.
+% \begin{macrocode}
+\let\hebr=\alph
+\let\gim=\alph
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% For backward compatibility with `older' \pkg{hebrew.sty}
+% packages, we define Hebrew equivalents of some useful \LaTeX\
+% commands. Note, however, that 8-bit macros defined in Hebrew
+% are no longer supported.
+% \begin{macrocode}
+\def\hebcopy{\protect\R{\hebhe\hebayin\hebtav\hebqof}}
+\def\hebincl{\protect\R{\hebresh\hebtsadi"\hebbet}}
+\def\hebpage{\protect\R{\hebayin\hebmem\hebvav\hebdalet}}
+\def\hebto{\protect\R{\hebayin\hebdalet}}
+% \end{macrocode}
+% |\hadgesh| produce ``poor man's bold'' (heavy printout), when
+% used with normal font glyphs. It is advisable to use bold font
+% (for example, \emph{Dead Sea}) instead of this macro.
+% \begin{macrocode}
+\def\hadgesh#1{\leavevmode\setbox0=\hbox{#1}%
+ \kern-.025em\copy0\kern-\wd0
+ \kern.05em\copy0\kern-\wd0
+ \kern-.025em\raise.0433em\box0 }
+% \end{macrocode}
+% |\piska| and |\piskapiska| sometimes used in `older' hebrew
+% sources, and should not be used in \LaTeXe.
+% \begin{macrocode}
+\if@compatibility
+ \def\piska#1{\item{#1}\hangindent=-\hangindent}
+ \def\piskapiska#1{\itemitem{#1}\hangindent=-\hangindent}
+\fi
+% \end{macrocode}
+% The following commands are simply synonyms for the standard ones,
+% provided with \LaTeXe.
+% \begin{macrocode}
+\let\makafgadol=\textendash
+\let\makafanak=\textemdash
+\let\geresh=\textquoteright
+\let\opengeresh=\textquoteright
+\let\closegeresh=\textquoteleft
+\let\openquote=\textquotedblright
+\let\closequote=\textquotedblleft
+\let\leftquotation=\textquotedblright
+\let\rightquotation=\textquotedblleft
+% \end{macrocode}
+%
+% We need to ensure that Hebrew is used as the default
+% right-to-left language at |\begin{document}|. The mechanism of
+% defining the |\@rllanguagename| is the same as in \babel 's
+% |\languagename|: the last right-to-left language in the
+% |\usepackage{babel}| line is set as the default right-to-left
+% language at document beginning.
+%
+% For example, the following code:
+% \begin{quote}
+% |\usepackage[russian,hebrew,arabic,greek,english]{babel}|
+% \end{quote}
+% will set the Arabic language as the default right-to-left
+% language and the English language as the default language.
+% As a result, the commands |\L{}| and |\embox{}| will use English
+% and |\R{}| and |\hmbox{}| will use Arabic by default. These
+% defaults can be changed with the next |\sethebrew| or
+% |\selectlanguage{|\emph{language name}|}| command.
+% \begin{macrocode}
+\AtBeginDocument{\def\@rllanguagename{hebrew}}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of |@| to its
+% original value.
+% \begin{macrocode}
+\ldf@finish{hebrew}
+%</hebrew>
+% \end{macrocode}
+%
+% \subsection{Right to left support}
+%
+% This file \pkg{rlbabel.def} defines necessary bidirectional macro
+% support for \LaTeXe. It is designed for use not only with Hebrew,
+% but with any Right-to-Left languages, supported by \babel. The
+% macros provided in this file are language and encoding
+% independent.
+%
+% Right-to-left languages will use \TeX\ extensions, namely \TeX\
+% primitives |\beginL|, |\endL| and |\beginR|, |\endR|, currently
+% implemented only in $\varepsilon$-\TeX\ and in \TeX{-}{-}\XeT.
+%
+% If $\varepsilon$-\TeX\ is used, we should switch it to the
+% \emph{enhanced} mode:
+% \begin{macrocode}
+%<*rightleft>
+\ifx\TeXXeTstate\undefined\else%
+ \TeXXeTstate=1
+\fi
+% \end{macrocode}
+%
+% Note, that $\varepsilon$-\TeX 's format file should be created
+% for \emph{extended} mode. Mode can be checked by running
+% $\varepsilon$-\TeX\ on some \TeX{} file, for example:
+% \begin{quote}
+% |This is e-TeX, Version 3.14159-1.1 (Web2c 7.0)|\\
+% |entering extended mode|
+% \end{quote}
+% The second line should be \texttt{entering extended mode}.
+%
+% We check if user uses Right-to-Left enabled engine instead of
+% regular Knuth's \TeX:
+% \begin{macrocode}
+\ifx\beginL\@undefined%
+ \newlinechar`\^^J
+ \typeout{^^JTo avoid this error message,^^J%
+ run TeX--XeT or e-TeX engine instead of regular TeX.^^J}
+ \errmessage{Right-to-Left Support Error: use TeX--XeT or e-TeX
+ engine}%
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Switching from LR to RL mode and back}
+%
+% \cs{@torl} and \cs{@fromrl} are called each time the horizontal
+% direction changes. They do all that is necessary besides changing
+% the direction. Currently their task is to change the encoding
+% information and mode (condition \cs{if@rl}). They should not
+% normally be called by users: user-level macros, such as
+% \cs{sethebrew} and \cs{unsethebrew}, as well as \babel 's
+% \cs{selectlanguage} are defined in language-definition files and
+% should be used to change default language (and direction).
+%
+% Local direction changing commands (for small pieces of text):
+% |\L{}|, |\R{}|, |\embox{}| and |\hmbox{}| are defined below in
+% this file in language-independent manner.
+%
+% \begin{macro}{\if@rl}
+% \begin{description}\scrunch
+% \item[|\@rltrue|] means that the main mode is currently
+% Right-to-Left.
+% \item[|\@rlfalse|] means that the main mode is currently
+% Left-to-Right.
+% \end{description}
+% \begin{macrocode}
+\newif\if@rl
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@rlmain}
+% This is the main direction of the document. Unlike |\if@rl|
+% it is set once and never changes.
+% \begin{description}\scrunch
+% \item[|\@rltrue|] means that the document is Right-to-Left.
+% \item[|\@rlfalse|] means that the document is Left-to-Right.
+% \end{description}
+% Practically |\if@rlmain| is set according to the value of |\if@rl|
+% in the beginning of the run.
+% \begin{macrocode}
+\AtBeginDocument{% Here we set the main document direction
+ \newif\if@rlmain%
+ \if@rl% e.g: if the options to babel were [english,hebrew]
+ \@rlmaintrue%
+ \else% e.g: if the options to babel were [hebrew,english]
+ \@rlmainfalse%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@torl}
+% Switches current direction to Right-to-Left: saves current
+% Left-to-Right encoding in |\lr@encodingdefault|, sets required
+% Right-to-Left language name in |\@rllanguagename| (similar to
+% \babel 's |\languagename|) and changes derection.
+%
+% The Right-to-Left language encoding should be defined in |.ldf|
+% file as special macro created by concatenation of the language
+% name and string \texttt{encoding}, for example, for Hebrew it
+% will be |\hebrewencoding|.
+% \begin{macrocode}
+\DeclareRobustCommand{\@torl}[1]{%
+ \if@rl\else%
+ \let\lr@encodingdefault=\encodingdefault%
+ \fi%
+ \def\@rllanguagename{#1}%
+ \def\encodingdefault{\csname#1encoding\endcsname}%
+ \fontencoding{\encodingdefault}%
+ \selectfont%
+ \@rltrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@fromrl}
+% Opposite to |\@torl|, switches current direction to
+% Left-to-Right: restores saved Left-to-Right encoding
+% (|\lr@encodingdefault|) and changes direction.
+% \begin{macrocode}
+\DeclareRobustCommand{\@fromrl}{%
+ \if@rl%
+ \let\encodingdefault=\lr@encodingdefault%
+ \fi%
+ \fontencoding{\encodingdefault}%
+ \selectfont%
+ \@rlfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\selectlanguage}
+% This standard \babel 's macro should be redefined to support
+% bidirectional tables. We divide |\selectlanguage| implementation
+% to two parts, and the first part calls the second
+% |\@@selectlanguage|.
+% \begin{macrocode}
+\expandafter\def\csname selectlanguage \endcsname#1{%
+ \edef\languagename{%
+ \ifnum\escapechar=\expandafter`\string#1\@empty
+ \else \string#1\@empty\fi}%
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@selectlanguage}
+% This new internal macro redefines a final part of the standard
+% \babel 's |\select|\-|language| implementation.
+%
+% Standard \LaTeX\ provides us with 3 tables: Table of Contents
+% (|.toc|), List of Figures (|.lof|), and List of Tables
+% (|.lot|). In multi-lingual texts mixing Left-to-Right languages
+% with Right-to-Left ones, the use of various directions in one
+% table results in very ugly output. Therefore, these 3 standard
+% tables will be used now only for Left-to-Right languages, and we
+% will add 3 Right-to-Left tables (their extensions are simply
+% reversed ones): RL Table of Contents (|.cot|), RL List of Figures
+% (|.fol|), and RL List of Tables (|.lof|).
+% \begin{macrocode}
+\def\@@selectlanguage#1{%
+ \select@language{#1}%
+ \if@filesw
+ \protected@write\@auxout{}{\string\select@language{#1}}%
+ \if@rl%
+ \addtocontents{cot}{\xstring\select@language{#1}}%
+ \addtocontents{fol}{\xstring\select@language{#1}}%
+ \addtocontents{tol}{\xstring\select@language{#1}}%
+ \else%
+ \addtocontents{toc}{\xstring\select@language{#1}}%
+ \addtocontents{lof}{\xstring\select@language{#1}}%
+ \addtocontents{lot}{\xstring\select@language{#1}}%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setrllanguage}
+% \begin{macro}{\unsetrllanguage}
+% The |\setrllanguage| and |\unsetrllanguage| pair of macros is
+% proved to very useful in bilingual texts, for example, in
+% Hebrew-English texts. The language-specific commands, for example,
+% |\sethebrew| and |\unsethebrew| use these macros as basis.
+%
+% Implementation saves and restores other language in
+% |\other@languagename| variable, and uses internal macro
+% |\@@selectlanguage|, defined above, to switch between languages.
+% \begin{macrocode}
+\let\other@languagename=\languagename
+\DeclareRobustCommand{\setrllanguage}[1]{%
+ \if@rl\else%
+ \let\other@languagename=\languagename%
+ \fi%
+ \def\languagename{#1}%
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\unsetrllanguage}[1]{%
+ \if@rl%
+ \let\languagename=\other@languagename%
+ \fi
+ \@@selectlanguage{\languagename}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\L}
+% \begin{macro}{\R}
+% \begin{macro}{\HeblatexRedefineL}
+% Macros for changing direction, originally taken from TUGboat.
+% Usage: |\L{|\emph{Left to Right text}|}| and |\R{|\emph{Right to
+% Left text}|}|. Numbers should also be enclosed in |\L{}|, as in
+% |\L{123}|.
+%
+% Note, that these macros do not receive language name as
+% parameter. Instead, the saved |\@rllanguagename| will be
+% used. We assume that each Right-to-Left language defines
+% |\to|\emph{languagename} and |\from|\emph{languagename} macros in
+% language definition file, for example, for Hebrew: |\tohebrew|
+% and |\fromhebrew| macros in \pkg{hebrew.ldf} file.
+%
+% The macros \cs{L} and \cs{R} include `protect' to to make them robust and
+% allow use, for example, in tables.
+%
+% Due to the fact that some packages have different definitions for \cs{L}
+% the macro |\HeblatexRedefineL| is provided to overide them. This may
+% be required with hyperref, for instance.
+% \begin{macrocode}
+\let\next=\
+\def\HeblatexRedefineL{%
+ \def\L{\protect\pL}%
+}
+\HeblatexRedefineL
+\def\pL{\protect\afterassignment\moreL \let\next= }
+\def\moreL{\bracetext \aftergroup\endL \beginL\csname
+ from\@rllanguagename\endcsname}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\R{\protect\pR}
+\def\pR{\protect\afterassignment\moreR \let\next= }
+\def\moreR{\bracetext \aftergroup\endR \beginR\csname
+ to\@rllanguagename\endcsname}
+\def\bracetext{\ifcat\next{\else\ifcat\next}\fi
+ \errmessage{Missing left brace has been substituted}\fi \bgroup}
+\everydisplay{\if@rl\aftergroup\beginR\fi }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ensure@R}
+% \begin{macro}{\@ensure@L}
+% Two small internal macros, a-la |\ensuremath|
+% \begin{macrocode}
+\def\@ensure@R#1{\if@rl#1\else\R{#1}\fi}
+\def\@ensure@L#1{\if@rl\L{#1}\else#1\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Take care of Right-to-Left indentation in every paragraph.
+% Originally, \cs{noindent} was redefined for right-to-left by
+% Yaniv Bargury, then the implementation was rewritten by Alon Ziv
+% using an idea by Chris Rowley: \cs{noindent} now works
+% unmodified.
+% \begin{macrocode}
+\def\rl@everypar{\if@rl{\setbox\z@\lastbox\beginR\usebox\z@}\fi}
+\let\o@everypar=\everypar
+\def\everypar#1{\o@everypar{\rl@everypar#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\hmbox}
+% \begin{macro}{\embox}
+% Useful vbox commands. All text in math formulas is best enclosed
+% in these: LR text in |\embox| and RL text in |\hmbox|. |\mbox{}|
+% is useless for both cases, since it typesets in Left-to-Right
+% even for Right-to-Left languages (additions by Yaniv Bargury).
+% \begin{macrocode}
+\newcommand{\hmbox}[1]{\mbox{\R{#1}}}
+\newcommand{\embox}[1]{\mbox{\L{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@brackets}
+% When in Right-to-Left mode, brackets should be swapped. This
+% macro receives 3 parameters: left bracket, content, right
+% bracket. Brackets can be square brackets, braces, or
+% parentheses.
+% \begin{macrocode}
+\def\@brackets#1#2#3{\protect\if@rl #3#2#1\protect\else
+ #1#2#3\protect\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@number}
+% \begin{macro}{\@latin}
+% \cs{@number} preserves numbers direction from Left to Right.
+% \cs{@latin} in addition switches current encoding to the latin.
+% \begin{macrocode}
+\def\@@number#1{\ifmmode\else\beginL\fi#1\ifmmode\else\endL\fi}
+\def\@@latin#1{\@@number{{\@fromrl#1}}}
+\def\@number{\protect\@@number}
+\def\@latin{\protect\@@latin}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Counters}
+%
+% To make counter references work in Right to Left text, we need
+% to surround their original definitions with an
+% |\@number{|\ldots|}| or |\@latin{|\ldots|}|. Note, that
+% language-specific counters, such as \cs{hebr} or \cs{gim} are
+% provided with language definition file.
+%
+% We start with saving the original definitions:
+% \begin{macrocode}
+\let\@@arabic=\@arabic
+\let\@@roman=\@roman
+\let\@@Roman=\@Roman
+\let\@@alph=\@alph
+\let\@@Alph=\@Alph
+% \end{macrocode}
+%
+% \begin{macro}{\@arabic}
+% \begin{macro}{\@roman}
+% \begin{macro}{\@Roman}
+% Arabic and roman numbers should be from Left to Right. In
+% addition, roman numerals, both lower- and upper-case should be in
+% latin encoding.
+% \begin{macrocode}
+\def\@arabic#1{\@number{\@@arabic#1}}
+\def\@roman#1{\@latin{\@@roman#1}}
+\def\@Roman#1{\@latin{\@@Roman#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\arabicnorl}
+% This macro preserves the original definition of |\arabic|
+% (overrides the overriding of |\@arabic|)
+% \begin{macrocode}
+\def\arabicnorl#1{\expandafter\@@arabic\csname c@#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make@lr}
+% In Right to Left documents all counters defined in the standard
+% document classes \emph{article}, \emph{report} and \emph{book}
+% provided with \LaTeXe, such as |\thesection|, |\thefigure|,
+% |\theequation| should be typed as numbers from left to right. To
+% ensure direction, we use the following
+% |\make@lr{|\emph{counter}|}| macro:
+% \begin{macrocode}
+\def\make@lr#1{\begingroup
+ \toks@=\expandafter{#1}%
+ \edef\x{\endgroup
+ \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
+ \x}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+ \@ifclassloaded{slides}{}{%
+ \make@lr\thesection
+ \make@lr\thesubsection
+ \make@lr\thesubsubsection
+ \make@lr\theparagraph
+ \make@lr\thesubparagraph
+ \make@lr\thefigure
+ \make@lr\thetable
+ }
+ \make@lr\theequation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Preserving logos}
+%
+% Preserve \TeX, \LaTeX\ and \LaTeXe\ logos.
+% \begin{macro}{\TeX}
+% \begin{macrocode}
+\let\@@TeX\TeX
+\def\TeX{\@latin{\@@TeX}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LaTeX}
+% \begin{macrocode}
+\let\@@LaTeX\LaTeX
+\def\LaTeX{\@latin{\@@LaTeX}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LaTeXe}
+% \begin{macrocode}
+\let\@@LaTeXe\LaTeXe
+\def\LaTeXe{\@latin{\@@LaTeXe}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{List environments}
+%
+% List environments in Right-to-Left languages, are ticked and
+% indented from the right instead of from the left. All the
+% definitions that caused indentation are revised for Right-to-Left
+% languages. \LaTeX\ keeps track on the indentation with the
+% \cs{leftmargin} and \cs{rightmargin} values.
+%
+% \begin{macro}{list}
+% Thus we need to override the definition of the |\list| macro: when
+% in RTL mode, the right margins are the begining of the line.
+% \begin{macrocode}
+\def\list#1#2{%
+ \ifnum \@listdepth >5\relax
+ \@toodeep
+ \else
+ \global\advance\@listdepth\@ne
+ \fi
+ \rightmargin\z@
+ \listparindent\z@
+ \itemindent\z@
+ \csname @list\romannumeral\the\@listdepth\endcsname
+ \def\@itemlabel{#1}%
+ \let\makelabel\@mklab
+ \@nmbrlistfalse
+ #2\relax
+ \@trivlist
+ \parskip\parsep
+ \parindent\listparindent
+ \advance\linewidth -\rightmargin
+ \advance\linewidth -\leftmargin
+% \end{macrocode}
+% The only change in the macro is the |\if@rl| case:
+% \begin{macrocode}
+ \if@rl
+ \advance\@totalleftmargin \rightmargin
+ \else
+ \advance\@totalleftmargin \leftmargin
+ \fi
+ \parshape \@ne \@totalleftmargin \linewidth
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\labelenumii}
+% \begin{macro}{\p@enumiii}
+% The \cs{labelenumii} and \cs{p@enumiii} commands use
+% \emph{parentheses}. They are revised to work Right-to-Left with
+% the help of \cs{@brackets} macro defined above.
+% \begin{macrocode}
+\def\labelenumii{\@brackets(\theenumii)}
+\def\p@enumiii{\p@enumii\@brackets(\theenumii)}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Tables of moving stuff}
+%
+% Tables of moving arguments: table of contents (|toc|), list of
+% figures (|lof|) and list of tables (|lot|) are handles here. These
+% three default \LaTeX\ tables will be used now exclusively for
+% Left to Right stuff.
+%
+% Three additional Right-to-Left tables: RL table of contents
+% (|cot|), RL list of figures (|fol|), and RL list of tables
+% (|tol|) are added.
+% These three tables will be used exclusively for Right to
+% Left stuff.
+%
+% \begin{macro}{\@tableofcontents}
+% \begin{macro}{\@listoffigures}
+% \begin{macro}{\@listoftables}
+% We define 3 new macros similar to the standard \LaTeX\ tables,
+% but with one parameter --- table file extension. These macros
+% will help us to define our additional tables below.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+ \@ifclassloaded{article}{% article
+ \newcommand\@tableofcontents[1]{%
+ \section*{\contentsname\@mkboth%
+ {\MakeUppercase\contentsname}%
+ {\MakeUppercase\contentsname}}%
+ \@starttoc{#1}}
+ \newcommand\@listoffigures[1]{%
+ \section*{\listfigurename\@mkboth%
+ {\MakeUppercase\listfigurename}%
+ {\MakeUppercase\listfigurename}}%
+ \@starttoc{#1}}
+ \newcommand\@listoftables[1]{%
+ \section*{\listtablename\@mkboth%
+ {\MakeUppercase\listtablename}%
+ {\MakeUppercase\listtablename}}%
+ \@starttoc{#1}}}%
+ {% else report or book
+ \newcommand\@tableofcontents[1]{%
+ \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
+ \fi\chapter*{\contentsname\@mkboth%
+ {\MakeUppercase\contentsname}%
+ {\MakeUppercase\contentsname}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}
+ \newcommand\@listoffigures[1]{%
+ \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
+ \fi\chapter*{\listfigurename\@mkboth%
+ {\MakeUppercase\listfigurename}%
+ {\MakeUppercase\listfigurename}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}
+ \newcommand\@listoftables[1]{%
+ \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
+ \chapter*{\listtablename\@mkboth%
+ {\MakeUppercase\listtablename}%
+ {\MakeUppercase\listtablename}}%
+ \@starttoc{#1}\if@restonecol\twocolumn\fi}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\lrtableofcontents}
+% \begin{macro}{\lrlistoffigures}
+% \begin{macro}{\lrlistoftables}
+% Left-to-Right tables are called now |\lr|\emph{xxx} and defined
+% with the aid of three macros defined above (extensions |toc|,
+% |lof|, and |lot|).
+% \begin{macrocode}
+ \newcommand\lrtableofcontents{\@tableofcontents{toc}}%
+ \newcommand\lrlistoffigures{\@listoffigures{lof}}%
+ \newcommand\lrlistoftables{\@listoftables{lot}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rltableofcontents}
+% \begin{macro}{\rllistoffigures}
+% \begin{macro}{\rllistoftables}
+% Right-to-Left tables will be called |\rl|\emph{xxx} and defined
+% with the aid of three macros defined above (extensions |cot|,
+% |fol|, and |tol|).
+% \begin{macrocode}
+ \newcommand\rltableofcontents{\@tableofcontents{cot}}%
+ \newcommand\rllistoffigures{\@listoffigures{fol}}%
+ \newcommand\rllistoftables{\@listoftables{tol}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tableofcontents}
+% \begin{macro}{\listoffigures}
+% \begin{macro}{\listoftables}
+% Let |\|\emph{xxx} be |\rl|\emph{xxx} if the current direction is
+% Right-to-Left and |\lr|\emph{xxx} if it is Left-to-Right.
+% \begin{macrocode}
+ \renewcommand\tableofcontents{\if@rl\rltableofcontents%
+ \else\lrtableofcontents\fi}
+ \renewcommand\listoffigures{\if@rl\rllistoffigures%
+ \else\lrlistoffigures\fi}
+ \renewcommand\listoftables{\if@rl\rllistoftables%
+ \else\lrlistoftables\fi}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@dottedtocline}
+% The following makes problems when making a Right-to-Left tables,
+% since it uses \cs{leftskip} and \cs{rightskip} which are both
+% mode dependent.
+% \begin{macrocode}
+\def\@dottedtocline#1#2#3#4#5{%
+ \ifnum #1>\c@tocdepth \else
+ \vskip \z@ \@plus.2\p@
+ {\if@rl\rightskip\else\leftskip\fi #2\relax
+ \if@rl\leftskip\else\rightskip\fi \@tocrmarg \parfillskip
+ -\if@rl\leftskip\else\rightskip\fi
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\if@rl\rightskip\else\leftskip\fi \@tempdima
+ \null\nobreak\hskip -\if@rl\rightskip\else\leftskip\fi
+ {#4}\nobreak
+ \leaders\hbox{$\m@th
+ \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+ mu$}\hfill
+ \nobreak
+ \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor \beginL#5\endL}%
+ \par}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@part}
+% This standard macro was redefined for table of contents since it
+% uses \cs{rightskip} which is mode dependent.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+\renewcommand*\l@part[2]{%
+ \ifnum \c@tocdepth >-2\relax
+ \addpenalty{-\@highpenalty}%
+ \addvspace{2.25em \@plus\p@}%
+ \begingroup
+ \setlength\@tempdima{3em}%
+ \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
+ \parfillskip -\@pnumwidth
+ {\leavevmode
+ \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss#2}}\par
+ \nobreak
+ \global\@nobreaktrue
+ \everypar{\global\@nobreakfalse\everypar{}}%
+ \endgroup
+ \fi}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@part}
+% Part is redefined to support new Right-to-Left table of contents
+% (|cot|) as well as the Left-to-Right one (|toc|).
+% \begin{macrocode}
+\@ifclassloaded{article}{% article class
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \addcontentsline{cot}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \partname~\thepart
+ \par\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}%
+}{% report and book classes
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \addcontentsline{cot}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \partname~\thepart
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% Section was redefined from the \pkg{latex.ltx} file. It is
+% changed to support both Left-to-Right (|toc|) and Right-to-Left
+% (|cot|) table of contents simultaneously.
+% \begin{macrocode}
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M #8\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \addcontentsline{cot}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec #8}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}%
+ \addcontentsline{cot}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@caption}
+% Caption was redefined from the \pkg{latex.ltx} file. It is
+% changed to support Left-to-Right list of figures and list of
+% tables (|lof| and |lot|) as well as new Right-to-Left lists
+% (|fol| and |tol|) simultaneously.
+% \begin{macrocode}
+\long\def\@caption#1[#2]#3{%
+ \par
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}%
+ \def\@fignm{figure}
+ \ifx#1\@fignm\addcontentsline{fol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \def\@tblnm{table}
+ \ifx#1\@tblnm\addcontentsline{tol}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}%
+ {\ignorespaces #2}}\fi%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@chapter}
+% This standard macro was redefined for table of contents since it
+% uses \cs{rightskip} which is mode dependent.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{%
+\@ifclassloaded{slides}{}{%
+ \@ifclassloaded{article}{}{%
+ \renewcommand*\l@chapter[2]{%
+ \ifnum \c@tocdepth >\m@ne
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \bfseries
+ \advance\if@rl\rightskip\else\leftskip\fi\@tempdima
+ \hskip -\if@rl\rightskip\else\leftskip\fi
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss#2}\par
+ \penalty\@highpenalty
+ \endgroup
+ \fi}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% \begin{macro}{\l@subsection}
+% \begin{macro}{\l@subsubsection}
+% \begin{macro}{\l@paragraph}
+% \begin{macro}{\l@subparagraph}
+% The toc entry for section did not work in article style.
+% Also it does not print dots, which is funny when most of your
+% work is divided into sections.
+%
+% It was revised to use |\@dottedtocline| as in \pkg{report.sty}
+% (by Yaniv Bargury) and was updated later for all kinds of
+% sections (by Boris Lavva).
+% \begin{macrocode}
+\@ifclassloaded{article}{%
+\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
+\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
+\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
+\renewcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
+\renewcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Two-column mode}
+%
+% This is the support of \texttt{twocolumn} option for the standard
+% \LaTeXe\ classes.
+% The following code was originally borrowed from the Arab\TeX\
+% package, file \pkg{latexext.sty}, copyright by Klaus Lagally,
+% Institut fuer Informatik, Universitaet Stuttgart. It was updated
+% for this package by Boris Lavva.
+%
+% \begin{macro}{\@outputdblcol}
+% \begin{macro}{\set@outputdblcol}
+% \begin{macro}{rl@outputdblcol}
+% First column is \cs{@leftcolumn} will be shown at the right side,
+% Second column is \cs{@outputbox} will be shown at the left side.
+%
+% |\set@outputdblcol| IS CURRENTLY DISABLED. TODO: REMOVE IT [tzafrir]
+% \begin{macrocode}
+\let\@@outputdblcol\@outputdblcol
+%\def\set@outputdblcol{%
+% \if@rl\renewcommand{\@outputdblcol}{\rl@outputdblcol}%
+% \else\renewcommand{\@outputdblcol}{\@@outputdblcol}\fi}
+\renewcommand{\@outputdblcol}{%
+ \if@rlmain%
+ \rl@outputdblcol%
+ \else%
+ \@@outputdblcol%
+ \fi%
+}
+\newcommand{\rl@outputdblcol}{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \else
+ \global \@firstcolumntrue
+ \setbox\@outputbox \vbox {\hb@xt@\textwidth {%
+ \hskip\columnwidth%
+ \hfil\vrule\@width\columnseprule\hfil
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hb@xt@\columnwidth {%
+ \hskip-\textwidth%
+ \box\@outputbox \hss}%
+ \hskip\columnsep%
+ \hskip\columnwidth}}%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Footnotes}
+%
+% \begin{macro}{\footnoterule}
+% The Right-to-Left footnote rule is simply reversed default
+% Left-to-Right one. Footnotes can be used in RL or LR main
+% modes, but changing mode while a footnote is pending is still
+% unsolved.
+% \begin{macrocode}
+\let\@@footnoterule=\footnoterule
+\def\footnoterule{\if@rl\hb@xt@\hsize{\hss\vbox{\@@footnoterule}}%
+ \else\@@footnoterule\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Headings and two-side support}
+%
+% When using \texttt{headings} or \texttt{myheadings} modes, we
+% have to ensure that the language and direction of heading is the
+% same as the whole chapter/part of the document. This is
+% implementing by setting special variable \cs{headlanguage} when
+% starting new chapter/part.
+%
+% In addition, when selecting the \texttt{twoside} option (default in
+% \texttt{book} document class), the LR and RL modes need to be set
+% properly for things on the heading and footing. This is done
+% here too.
+%
+% \begin{macro}{ps@headings}
+% \begin{macro}{ps@myheadings}
+% \begin{macro}{headeven}
+% \begin{macro}{headodd}
+% First, we will support the standard \pkg{letter} class:
+% \begin{macrocode}
+\@ifclassloaded{letter}{%
+ \def\headodd{\protect\if@rl\beginR\fi\headtoname{}
+ \ignorespaces\toname
+ \hfil \@date
+ \hfil \pagename{} \thepage\protect\if@rl\endR\fi}
+ \if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@evenhead\@oddhead}
+ \else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}}
+ \fi
+ \def\headfirst{\protect\if@rl\beginR\fi\fromlocation \hfill %
+ \telephonenum\protect\if@rl\endR\fi}
+ \def\ps@firstpage{%
+ \let\@oddhead\@empty
+ \def\@oddfoot{\raisebox{-45\p@}[\z@]{%
+ \hb@xt@\textwidth{\hspace*{100\p@}%
+ \ifcase \@ptsize\relax
+ \normalsize
+ \or
+ \small
+ \or
+ \footnotesize
+ \fi
+ \select@language{\headlanguage}\headfirst}}\hss}}
+%
+ \renewcommand{\opening}[1]{%
+ \let\headlanguage=\languagename%
+ \ifx\@empty\fromaddress%
+ \thispagestyle{firstpage}%
+ {\raggedleft\@date\par}%
+ \else % home address
+ \thispagestyle{empty}%
+ {\raggedleft
+ \if@rl\begin{tabular}{@{\beginR\csname%
+ to\@rllanguagename\endcsname}r@{\endR}}\ignorespaces
+ \fromaddress \\*[2\parskip]%
+ \@date \end{tabular}\par%
+ \else\begin{tabular}{l}\ignorespaces
+ \fromaddress \\*[2\parskip]%
+ \@date \end{tabular}\par%
+ \fi}%
+ \fi
+ \vspace{2\parskip}%
+ {\raggedright \toname \\ \toaddress \par}%
+ \vspace{2\parskip}%
+ #1\par\nobreak}
+}
+% \end{macrocode}
+% Then, the \pkg{article}, \pkg{report} and \pkg{book} document
+% classes are supported. Note, that in one-sided mode
+% \cs{markright} was changed to \cs{markboth}.
+% \begin{macrocode}
+{% article, report, book
+ \def\headeven{\protect\if@rl\beginR\thepage\hfil\rightmark\endR
+ \protect\else\thepage\hfil{\slshape\leftmark}
+ \protect\fi}
+ \def\headodd{\protect\if@rl\beginR\leftmark\hfil\thepage\endR
+ \protect\else{\slshape\rightmark}\hfil\thepage
+ \protect\fi}
+ \@ifclassloaded{article}{% article
+ \if@twoside % two-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection\quad
+ \fi
+ ##1}}{}}%
+ \def\subsectionmark##1{%
+ \markright{%
+ \ifnum \c@secnumdepth >\@ne
+ \thesubsection\quad
+ \fi
+ ##1}}}
+ \else % one-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\headodd}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection\quad
+ \fi
+ ##1}}{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection\quad
+ \fi
+ ##1}}}}
+ \fi
+%
+ \def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+ }}{% report and book
+ \if@twoside % two-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection. \ %
+ \fi
+ ##1}}}}
+ \else % one-sided
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\select@language{\headlanguage}\headodd}
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \@chapapp\ \thechapter. \ %
+ \fi
+ ##1}}}}
+ \fi
+ \def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\select@language{\headlanguage}\headeven}%
+ \def\@oddhead{\select@language{\headlanguage}\headodd}%
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Postscript Porblems}
+% Any command that is implemented by PostScript directives, e.g
+% commands from the ps-tricks package, needs to be fixed, because the
+% PostScript directives are being interpeted after the document has been
+% converted by \TeX to visual Hebrew (DVI, PostScript and PDF have visual
+% Hebrew).
+%
+% For instance: Suppose you wrote in your document:
+%
+% |\textcolor{cyan}{some ltr text}|
+%
+% This would be interpeted by \TeX to something like:
+%
+% |[postscript:make color cyan]some LTR text[postscript:make color black]|
+%
+%
+% However, with the bidirectionality support we get:
+%
+% |\textcolor{cyan}{\hebalef\hebbet}|
+%
+% Translated to:
+%
+% |[postscript:make color black]{bet}{alef}[postscript:make color cyan]|
+%
+% While we want:
+%
+% |[postscript:make color cyan]{bet}{alef}[postscript:make color black]|
+%
+% The following code will probably work at least with code that stays in the
+% same line:
+% \begin{macro}{@textcolor}
+% \begin{macrocode}
+\AtBeginDocument{%
+ %I assume that \@textcolor is only defined by the package color
+ \ifx\@textcolor\@undefined\else%
+ % If that macro was defined before the beginning of the document,
+ % that is: the package was loaded: redefine it with bidi support
+ \def\@textcolor#1#2#3{%
+ \if@rl%
+ \beginL\protect\leavevmode{\color#1{#2}\beginR#3\endR}\endL%
+ \else%
+ \protect\leavevmode{\color#1{#2}#3}%
+ \fi%
+ }%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\thetrueSlideCounter}
+% This macro probably needs to be overriden for when using |prosper|,
+% (waiting for feedback. Tzafrir)
+% \begin{macrocode}
+\@ifclassloaded{prosper}{%
+ \def\thetrueSlideCounter{\arabicnorl{trueSlideCounter}}
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Miscellaneous internal \LaTeX\ macros}
+%
+% \begin{macro}{\raggedright}
+% \begin{macro}{\raggedleft}
+% \cs{raggedright} was changed from \pkg{latex.ltx} file to support
+% Right-to-Left mode, because of the bug in its implementation.
+% \begin{macrocode}
+\def\raggedright{%
+ \let\\\@centercr
+ \leftskip\z@skip\rightskip\@flushglue
+ \parindent\z@\parfillskip\z@skip}
+% \end{macrocode}
+% Swap meanings of \cs{raggedright} and \cs{raggedleft} in
+% Right-to-Left mode.
+% \begin{macrocode}
+\let\@@raggedleft=\raggedleft
+\let\@@raggedright=\raggedright
+\renewcommand\raggedleft{\if@rl\@@raggedright%
+ \else\@@raggedleft\fi}
+\renewcommand\raggedright{\if@rl\@@raggedleft%
+ \else\@@raggedright\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\author}
+% \cs{author} is inserted with \texttt{tabular} environment, and
+% will be used in restricted horizontal mode. Therefore we have to
+% add explicit direction change command when in Right-to-Left
+% mode.
+% \begin{macrocode}
+\let\@@author=\author
+\renewcommand{\author}[1]{\@@author{\if@rl\beginR #1\endR\else #1\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeUppercase}
+% \begin{macro}{\MakeLowercase}
+% There are no uppercase and lowercase letters in most
+% Right-to-Left languages, therefore we should redefine
+% \cs{MakeUppercase} and \cs{MakeLowercase} \LaTeXe\ commands.
+% \begin{macrocode}
+\let\@@MakeUppercase=\MakeUppercase
+\def\MakeUppercase#1{\if@rl#1\else\@@MakeUppercase{#1}\fi}
+\let\@@MakeLowercase=\MakeLowercase
+\def\MakeLowercase#1{\if@rl#1\else\@@MakeLowercase{#1}\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\underline}
+% We should explicitly use \cs{L} and \cs{R} commands in
+% \cs{underline}d text.
+% \begin{macrocode}
+\let\@@@underline=\underline
+\def\underline#1{\@@@underline{\if@rl\R{#1}\else #1\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \cs{undertext} was added for \LaTeX 2.09 compatibility mode.
+% \begin{macrocode}
+\if@compatibility
+ \let\undertext=\underline
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\@xnthm}
+% \begin{macro}{\@opargbegintheorem}
+% The following has been inserted to correct the appearance of the
+% number in \cs{newtheorem} to reorder theorem number components. A
+% similar correction in the definition of \cs{@opargbegintheorem}
+% was added too.
+% \begin{macrocode}
+\def\@xnthm#1#2[#3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname
+ {\@definecounter{#1}\@addtoreset{#1}{#3}%
+ \expandafter\xdef\csname the#1\endcsname{\noexpand\@number
+ {\expandafter\noexpand\csname the#3\endcsname \@thmcountersep
+ \@thmcounter{#1}}}%
+ \global\@namedef{#1}{\@thm{#1}{#2}}%
+ \global\@namedef{end#1}{\@endtheorem}}}
+%
+\def\@opargbegintheorem#1#2#3{%
+ \trivlist
+ \item[\hskip \labelsep{\bfseries #1\ #2\
+ \@brackets({#3})}]\itshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@chapter}
+% \begin{macro}{\@schapter}
+% The following was added for pretty printing of the chapter
+% numbers, for supporting Right-to-Left tables (\texttt{cot},
+% \texttt{fol}, and \texttt{tol}), to save \cs{headlanguage}
+% for use in running headers, and to start two-column mode
+% depending on chapter's main language.
+% \begin{macrocode}
+\@ifclassloaded{article}{}{%
+ % For pretty priniting
+ \def\@@chapapp{Chapter}
+ \def\@@thechapter{\@@arabic\c@chapter}
+ \def\@chapter[#1]#2{%
+ \let\headlanguage=\languagename%
+ %\set@outputdblcol%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@@chapapp\space\@@thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}
+ \addcontentsline{cot}{chapter}%
+ {\protect\numberline{\thechapter}#1}
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \addcontentsline{cot}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{fol}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \addtocontents{tol}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+ %
+ \def\@schapter#1{%
+ \let\headlanguage=\languagename%
+ %\set@outputdblcol%
+ \if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendix}
+% Changed mainly for pretty printing of appendix numbers, and to
+% start two-column mode with the right language (if needed).
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+ \@ifclassloaded{article}{% article
+ \renewcommand\appendix{\par
+ \setcounter{section}{0}%
+ \setcounter{subsection}{0}%
+ \renewcommand\thesection{\@Alph\c@section}}
+ }{% report and book
+ \renewcommand\appendix{\par
+ %\set@outputdblcol%
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \renewcommand\@chapapp{\appendixname}%
+ % For pretty priniting
+ \def\@@chapapp{Appendix}%
+ \def\@@thechapter{\@@Alph\c@chapter}
+ \renewcommand\thechapter{\@Alph\c@chapter}}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Bibliography and citations}
+%
+% \begin{macro}{\@cite}
+% \begin{macro}{\@biblabel}
+% \begin{macro}{\@lbibitem}
+% Citations are produced by the macro
+% |\@cite{|\emph{LABEL}|}{|\emph{NOTE}|}|. Both the citation label
+% and the note is typeset in the current direction. We have to use
+% \cs{@brackets} macro in \cs{@cite} and \cs{@biblabel} macros. In
+% addition, when using \emph{alpha} or similar bibliography style,
+% the \cs{@lbibitem} is used and have to be update to support bot
+% Right-to-Left and Left-to-Right citations.
+%
+% \begin{macrocode}
+\def\@cite#1#2{\@brackets[{#1\if@tempswa , #2\fi}]}
+\def\@biblabel#1{\@brackets[{#1}]}
+\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
+ {\let\protect\noexpand
+ \immediate
+ \if@rl\write\@auxout{\string\bibcite{#2}{\R{#1}}}%
+ \else\write\@auxout{\string\bibcite{#2}{\L{#1}}}\fi%
+ }\fi\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{thebibliography}
+% Use \cs{rightmargin} instead of \cs{leftmargin} when in RL mode.
+% \begin{macrocode}
+\@ifclassloaded{letter}{}{% other
+\@ifclassloaded{slides}{}{% other
+\@ifclassloaded{article}{%
+ \renewenvironment{thebibliography}[1]
+ {\section*{\refname\@mkboth%
+ {\MakeUppercase\refname}%
+ {\MakeUppercase\refname}}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \if@rl\leftmargin\else\rightmargin\fi\labelwidth
+ \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}}%
+{\renewenvironment{thebibliography}[1]{%
+ \chapter*{\bibname\@mkboth%
+ {\MakeUppercase\bibname}%
+ {\MakeUppercase\bibname}}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \if@rl\leftmargin\else\rightmargin\fi\labelwidth
+ \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}}}}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@verbatim}
+% All kinds of verbs (\cs{verb},\cs{verb*},\texttt{verbatim} and
+% \texttt{verbatim*}) now can be used in Right-to-Left mode. Errors
+% in latin mode solved too.
+% \begin{macrocode}
+\def\@verbatim{%
+ \let\do\@makeother \dospecials%
+ \obeylines \verbatim@font \@noligs}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecaption}
+% Captions are set always centered. This allows us to use bilingual
+% captions, for example: |\caption{\R{RLtext} \\ \L{LRtext}}|,
+% which will be formatted as:
+% \begin{center}
+% Right to left caption here (RLtext) \\
+% Left to right caption here (LRtext)
+% \end{center}
+% See also \cs{bcaption} command below.
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip%
+ \begin{center}%
+ #1: #2%
+ \end{center} \par%
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Additional bidirectional commands}
+%
+% \begin{itemize}
+% \item Section headings are typeset with the default global
+% direction.
+% \item Text in section headings in the reverse language \emph{do
+% not} have to be protected for the reflection command, as in:
+% |\protect\L{|\emph{Latin Text}|}|, because \cs{L} and \cs{R} are
+% robust now.
+% \item Table of contents, list of figures and list of tables
+% should be typeset with the \cs{tableofcontents},
+% \cs{listoffigures} and \cs{listoftables} commands respectively.
+% \item The above tables will be typeset in the main direction (and
+% language) in effect where the above commands are placed.
+% \item Only 2 tables of each kind are supported: one for
+% Right-to-Left and another for Left-to-Right directions.
+% \end{itemize}
+%
+% How to include line to both tables? One has to use bidirectional
+% sectioning commands as following:
+% \begin{enumerate}
+% \item Use the |\b|\emph{xxx} version of the sectioning commands
+% in the text instead of the |\|\emph{xxx} version (\emph{xxx} is
+% one of: \texttt{part}, \texttt{chapter}, \texttt{section},
+% \texttt{subsection}, \texttt{subsubsection}, \texttt{caption}).
+% \item Syntax of the |\b|\emph{xxx} command is
+% |\b|\emph{xxx}|{|\emph{RL text}|}{|\emph{LR text}|}|.
+% Both arguments are typeset in proper direction by default (no
+% need to change direction for the text inside).
+% \item The section header inside the document will be typeset in
+% the global direction in effect at the time. i.e. The |{|\emph{RL
+% text}|}| will be typeset if Right-to-Left mode is in effect and
+% |{|\emph{LR text}|}| otherwise.
+% \end{enumerate}
+%
+% \begin{macro}{\bpart}
+% \begin{macrocode}
+\newcommand{\bpart}[2]{\part{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bchapter}
+% \begin{macrocode}
+\newcommand{\bchapter}[2]{\chapter{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsection}
+% \begin{macrocode}
+\newcommand{\bsection}[2]{\section{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsubsection}
+% \begin{macrocode}
+\newcommand{\bsubsection}[2]{\subsection{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsubsubsection}
+% \begin{macrocode}
+\newcommand{\bsubsubsection}[2]{\subsubsection{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bcaption}
+% \begin{macrocode}
+\newcommand{\bcaption}[2]{%
+ \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
+ \if@rl\R{#1}\protect\\ \L{#2}
+ \else\L{#2}\protect\\ \R{#1}\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% The following definition is a modified version of \cs{bchapter}, meant
+% as a bilingual twin for \cs{chapter*} and \cs{section*}
+% (added by Irina Abramovici).
+%
+% \begin{macro}{\bchapternn}
+% \begin{macrocode}
+\newcommand{\bchapternn}[2]{\chapter*{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bsectionnn}
+% \begin{macrocode}
+\newcommand{\bsectionnn}[2]{\section*{\protect\if@rl%
+ #1 \protect\else #2 \protect\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% Finally, at end of \babel\ package, the \cs{headlanguage} and
+% two-column mode will be initialized according to the current
+% language.
+% \begin{macrocode}
+\AtEndOfPackage{\rlAtEndOfPackage}
+%
+\def\rlAtEndOfPackage{%
+ \global\let\headlanguage=\languagename%\set@outputdblcol%
+}
+%</rightleft>
+% \end{macrocode}
+%
+% \subsection{Hebrew calendar}
+%
+% The original version of the package \pkg{hebcal.sty}\footnote{The
+% following description of \pkg{hebcal} package is based on the
+% comments included with original source by the author, Michail
+% Rozman.} for \TeX\ and \LaTeX2.09, entitled ``\TeX{} \& \LaTeX{}
+% macros for computing Hebrew date from Gregorian one'' was created
+% by Michail Rozman, |misha@iop.tartu.ew.su|\footnote{Please direct
+% any comments, bug reports, questions, etc. about the package to
+% this address.}
+%
+% \begin{tabular}{@{}lr@{}c@{}ll}
+% Released: &Tammuz 12, 5751&--&June 24, 1991 &\\
+% Corrected:&Shebat 10, 5752&--&January 15, 1992&by Rama Porrat\\
+% Corrected:&Adar II 5, 5752&--&March 10, 1992 &by Misha\\
+% Corrected:&Tebeth, 5756 &--&January 1996 &Dan Haran\\
+% &&&&(haran@math.tau.ac.il)
+% \end{tabular}
+%
+% The package was adjusted for \babel{} and \LaTeXe{} by Boris
+% Lavva.
+%
+% Changes to the printing routine (only) by Ron Artstein, June 1,
+% 2003.
+%
+% This package should be included \emph{after} the \pkg{babel} with
+% \pkg{hebrew} option, as following:
+% \begin{quote}
+% |\documentclass[|\ldots|]{|\ldots|}|\\
+% |\usepackage[hebrew,|\ldots|,|\emph{other languages}|,|
+% \ldots|]{babel}|\\
+% |\usepackage{hebcal}|
+% \end{quote}
+%
+% Two main user-level commands are provided by this package:
+%
+% \DescribeMacro{\Hebrewtoday}
+% Computes today's Hebrew date and prints it. If we are presently
+% in Hebrew mode, the date will be printed in Hebrew, otherwise ---
+% in English (like Shebat 10, 5752).
+%
+% \DescribeMacro{\Hebrewdate}
+% Computes the Hebrew date from the given Gregorian date and
+% prints it. If we are presently in Hebrew mode, the date will be
+% printed in Hebrew, otherwise --- in English (like Shebat 10,
+% 5752). An example of usage is shown below:
+% \begin{quote}
+% |\newcount\hd \newcount\hm \newcount\hy|\\
+% |\hd=10 \hm=3 \hy=1992|\\
+% |\Hebrewdate{\hd}{\hm}{\hy}|
+% \end{quote}
+%
+% \DescribeMacro{full}
+% The package option |full| sets the flag |\@full@hebrew@year|,
+% which causes years from the current millenium to be printed with
+% the thousands digit (he-tav-shin-samekh-gimel). Without this
+% option, thousands are not printed for the current millenium.
+% NOTE: should this be a command option rather than a package
+% option? --RA.
+%
+% \subsubsection{Introduction}
+%
+% The Hebrew calendar is inherently complicated: it is lunisolar --
+% each year starts close to the autumn equinox, but each month must
+% strictly start at a new moon. Thus Hebrew calendar must be
+% harmonized simultaneously with both lunar and solar events. In
+% addition, for reasons of the religious practice, the year cannot
+% start on Sunday, Wednesday or Friday.
+%
+% For the full description of Hebrew calendar and for the list of
+% references see:
+% \begin{quote}
+% Nachum Dershowitz and Edward M. Reingold,
+% \emph{``Calendarical Calculations''}, Software--Pract.Exper.,
+% vol. 20 (9), pp.899--928 (September 1990).
+% \end{quote}
+% |C| translation of |LISP| programs from the above article
+% available from Mr. Wayne Geiser, |geiser%pictel@uunet.uu.net|.
+%
+% The 4\textsuperscript{th} distribution (July 1989) of hdate/hcal
+% (Hebrew calendar programs similar to UNIX date/cal) by Mr. Amos
+% Shapir, |amos@shum.huji.ac.il|, contains short and very clear
+% description of algorithms.
+%
+% \subsubsection{Registers, Commands, Formatting Macros}
+%
+% The command |\Hebrewtoday| produces today's date for Hebrew
+% calendar. It is similar to the standard \LaTeXe{} command
+% |\today|. In addition three numerical registers |\Hebrewday|,
+% |\Hebrewmonth| and |\Hebrewyear| are set.
+% For setting this registers without producing of date string
+% command |\Hebrewsetreg| can be used.
+%
+% The command
+% |\Hebrewdate{|\emph{Gday}|}{|\emph{Gmonth}|}{|\emph{Gyear}|}|
+% produces Hebrew calendar date corresponding to Gregorian date
+% |Gday.Gmonth.Gyear|. Three numerical registers |\Hebrewday|,
+% |\Hebrewmonth| and |\Hebrewyear| are set.
+%
+% For converting arbitrary Gregorian date |Gday.Gmonth.Gyear|
+% to Hebrew date |Hday.Hmonth.Hyear| without producing date string
+% the command:
+% \begin{center}
+% |\HebrewFromGregorian{|\emph{Gday}|}{|\emph{Gmonth}|}{|%
+% \emph{Gyear}|}{|\emph{Hday}|}{|\emph{Hmonth}|}{|\emph{Hyear}|}|
+% \end{center}
+% can be used.
+%
+% \begin{macrocode}
+%<*calendar>
+\newif\if@full@hebrew@year
+\@full@hebrew@yearfalse
+\DeclareOption{full}{\@full@hebrew@yeartrue}
+\ProcessOptions
+\newcount\Hebrewday \newcount\Hebrewmonth \newcount\Hebrewyear
+% \end{macrocode}
+%
+% \begin{macro}{\Hebrewdate}
+% Hebrew calendar date corresponding to Gregorian date
+% |Gday.Gmonth.Gyear|. If Hebrew (right-to-left) fonts \& macros
+% are not loaded, we have to use English format.
+% \begin{macrocode}
+\def\Hebrewdate#1#2#3{%
+ \HebrewFromGregorian{#1}{#2}{#3}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \ifundefined{if@rl}%
+ \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \else%
+ \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hebrewtoday}
+% Today's date in Hebrew calendar.
+% \begin{macrocode}
+\def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
+\let\hebrewtoday=\Hebrewtoday
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Hebrewsetreg}
+% Set registers: today's date in hebrew calendar.
+% \begin{macrocode}
+\def\Hebrewsetreg{%
+ \HebrewFromGregorian{\day}{\month}{\year}
+ {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FormatDate}
+% Prints a Hebrew calendar date |Hebrewday.Hebrewmonth.Hebrewyear|.
+% \begin{macrocode}
+\def\FormatDate#1#2#3{%
+ \if@rl%
+ \FormatForHebrew{#1}{#2}{#3}%
+ \else%
+ \FormatForEnglish{#1}{#2}{#3}
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% To prepare another language version of Hebrew calendar commands,
+% one should change or add commands here.
+%
+% We start with Hebrew language macros.
+% \begin{macro}{\HebrewYearName}
+% Prints Hebrew year as a Hebrew number. Disambiguates strings by
+% adding lamed-pe-gimel to years of the first Jewish millenium and
+% to years divisible by 1000. Suppresses the thousands digit in the
+% current millenium unless the package option |full| is selected.
+% NOTE: should this be provided as a command option rather than a
+% package option? --RA.
+% \begin{macrocode}
+\def\HebrewYearName#1{{%
+ \@tempcnta=#1\divide\@tempcnta by 1000\multiply\@tempcnta by 1000
+ \ifnum#1=\@tempcnta\relax % divisible by 1000: disambiguate
+ \Hebrewnumeralfinal{#1}\ )\heblamed\hebpe"\hebgimel(%
+ \else % not divisible by 1000
+ \ifnum#1<1000\relax % first millennium: disambiguate
+ \Hebrewnumeralfinal{#1}\ )\heblamed\hebpe"\hebgimel(%
+ \else
+ \ifnum#1<5000
+ \Hebrewnumeralfinal{#1}%
+ \else
+ \ifnum#1<6000 % current millenium, print without thousands
+ \@tempcnta=#1\relax
+ \if@full@hebrew@year\else\advance\@tempcnta by -5000\fi
+ \Hebrewnumeralfinal{\@tempcnta}%
+ \else % #1>6000
+ \Hebrewnumeralfinal{#1}%
+ \fi
+ \fi
+ \fi
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewMonthName}
+% The macro |\HebrewMonthName{|\emph{month}|}{|\emph{year}|}|
+% returns the name of month in the `year'.
+% \begin{macrocode}
+\def\HebrewMonthName#1#2{%
+ \ifnum #1 = 7 %
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap \hebalef\hebdalet\hebresh\ \hebbet'%
+ \else \hebalef\hebdalet\hebresh%
+ \fi%
+ \else%
+ \ifcase#1%
+ % nothing for 0
+ \or\hebtav\hebshin\hebresh\hebyod%
+ \or\hebhet\hebshin\hebvav\hebfinalnun%
+ \or\hebkaf\hebsamekh\heblamed\hebvav%
+ \or\hebtet\hebbet\hebtav%
+ \or\hebshin\hebbet\hebtet%
+ \or\hebalef\hebdalet\hebresh\ \hebalef'%
+ \or\hebalef\hebdalet\hebresh\ \hebbet'%
+ \or\hebnun\hebyod\hebsamekh\hebfinalnun%
+ \or\hebalef\hebyod\hebyod\hebresh%
+ \or\hebsamekh\hebyod\hebvav\hebfinalnun%
+ \or\hebtav\hebmem\hebvav\hebzayin%
+ \or\hebalef\hebbet%
+ \or\hebalef\heblamed\hebvav\heblamed%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewDayName}
+% Name of day in Hebrew letters (gimatria).
+% \begin{macrocode}
+\def\HebrewDayName#1{\Hebrewnumeral{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\FormatForHebrew}
+% The macro |\FormatForHebrew{|\emph{hday}|}{|\emph{hmonth}
+% |}{|\emph{hyear}|}| returns the formatted Hebrew date in Hebrew
+% language.
+% \begin{macrocode}
+\def\FormatForHebrew#1#2#3{%
+ \HebrewDayName{#1}~\hebbet\HebrewMonthName{#2}{#3},~%
+ \HebrewYearName{#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% We continue with two English language macros for Hebrew calendar.
+% \begin{macro}{\HebrewMonthNameInEnglish}
+% The macro |\HebrewMonthNameInEnglish{|\emph{month}|}{|%
+% \emph{year}|}| is similar to |\Hebrew|\-|Month|\-|Name| described
+% above. It returns the name of month in the Hebrew `year' in
+% English.
+% \begin{macrocode}
+\def\HebrewMonthNameInEnglish#1#2{%
+ \ifnum #1 = 7%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap Adar II\else Adar\fi%
+ \else%
+ \ifcase #1%
+ % nothing for 0
+ \or Tishrei%
+ \or Heshvan%
+ \or Kislev%
+ \or Tebeth%
+ \or Shebat%
+ \or Adar I%
+ \or Adar II%
+ \or Nisan%
+ \or Iyar%
+ \or Sivan%
+ \or Tammuz%
+ \or Av%
+ \or Elul%
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FormatForEnglish}
+% The macro |\FormatForEnglish{|\emph{hday}|}{|\emph{hmonth}
+% |}{|\emph{hyear}|}| is similar to |\Format|\-|For|\-|Hebrew|
+% macro described above and returns the formatted Hebrew date in
+% English.
+% \begin{macrocode}
+\def\FormatForEnglish#1#2#3{%
+ \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Auxiliary Macros}
+%
+% \begin{macrocode}
+\newcount\@common
+% \end{macrocode}
+% \begin{macro}{\Remainder}
+% |\Remainder{|\emph{a}|}{|\emph{b}|}{|\emph{c}|}| calculates
+% $c = a\%b == a-b\times\frac{a}{b}$
+% \begin{macrocode}
+\def\Remainder#1#2#3{%
+ #3 = #1% % c = a
+ \divide #3 by #2% % c = a/b
+ \multiply #3 by -#2% % c = -b(a/b)
+ \advance #3 by #1}% % c = a - b(a/b)
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\newif\if@Divisible
+% \end{macrocode}
+% \begin{macro}{\CheckIfDivisible}
+% |\CheckIfDivisible{|\emph{a}|}{|\emph{b}|}| sets
+% |\@Divisibletrue| if $a\%b == 0$
+% \begin{macrocode}
+\def\CheckIfDivisible#1#2{%
+ {%
+ \countdef\tmp = 0% \tmp == \count0 - temporary variable
+ \Remainder{#1}{#2}{\tmp}%
+ \ifnum \tmp = 0%
+ \global\@Divisibletrue%
+ \else%
+ \global\@Divisiblefalse%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifundefined}
+% From the \TeX book, ex. 7.7:
+% \begin{quote}
+% |\ifundefined{|\emph{command}|}<true text>\else<false text>\fi|
+% \end{quote}
+% \begin{macrocode}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Gregorian Part}
+%
+% \begin{macrocode}
+\newif\if@GregorianLeap
+% \end{macrocode}
+% \begin{macro}{\IfGregorianLeap}
+% Conditional which is true if Gregorian `year' is a leap year:
+% $((year\%4==0)\wedge(year\%100\neq 0))\vee(year\%400==0)$
+% \begin{macrocode}
+\def\IfGregorianLeap#1{%
+ \CheckIfDivisible{#1}{4}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{100}%
+ \if@Divisible%
+ \CheckIfDivisible{#1}{400}%
+ \if@Divisible%
+ \@GregorianLeaptrue%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \else%
+ \@GregorianLeaptrue%
+ \fi%
+ \else%
+ \@GregorianLeapfalse%
+ \fi%
+ \if@GregorianLeap}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GregorianDaysInPriorMonths}
+% The macro |\GregorianDaysInPriorMonths{|\emph{month}|}{|^^A
+% \emph{year}|}{|\emph{days}|}| calculates the number of days in
+% months prior to `month' in the `year'.
+% \begin{macrocode}
+\def\GregorianDaysInPriorMonths#1#2#3{%
+ {%
+ #3 = \ifcase #1%
+ 0 \or% % no month number 0
+ 0 \or%
+ 31 \or%
+ 59 \or%
+ 90 \or%
+ 120 \or%
+ 151 \or%
+ 181 \or%
+ 212 \or%
+ 243 \or%
+ 273 \or%
+ 304 \or%
+ 334%
+ \fi%
+ \IfGregorianLeap{#2}%
+ \ifnum #1 > 2% % if month after February
+ \advance #3 by 1% % add leap day
+ \fi%
+ \fi%
+ \global\@common = #3}%
+ #3 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\GregorianDaysInPriorYears}
+% The macro |\GregorianDaysInPriorYears{|\emph{year}|}{|^^A
+% \emph{days}|}| calculates the number of days in years prior to
+% the `year'.
+% \begin{macrocode}
+\def\GregorianDaysInPriorYears#1#2{%
+ {%
+ \countdef\tmpc = 4% % \tmpc==\count4
+ \countdef\tmpb = 2% % \tmpb==\count2
+ \tmpb = #1% %
+ \advance \tmpb by -1% %
+ \tmpc = \tmpb% % \tmpc = \tmpb = year-1
+ \multiply \tmpc by 365% % Days in prior years =
+ #2 = \tmpc% % = 365*(year-1) ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 4% % \tmpc = (year-1)/4
+ \advance #2 by \tmpc% % ... plus Julian leap days ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 100% % \tmpc = (year-1)/100
+ \advance #2 by -\tmpc% % ... minus century years ...
+ \tmpc = \tmpb% %
+ \divide \tmpc by 400% % \tmpc = (year-1)/400
+ \advance #2 by \tmpc% % ... plus 4-century years.
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AbsoluteFromGregorian}
+% The macro |\AbsoluteFromGregorian{|\emph{day}|}{|\emph{month}^^A
+% |}{|\emph{year}|}{|\emph{absdate}|}| calculates the absolute date
+% (days since $01.01.0001$) from Gregorian date |day.month.year|.
+% \begin{macrocode}
+\def\AbsoluteFromGregorian#1#2#3#4{%
+ {%
+ \countdef\tmpd = 0% % \tmpd==\count0
+ #4 = #1% % days so far this month
+ \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior months
+ \GregorianDaysInPriorYears{#3}{\tmpd}%
+ \advance #4 by \tmpd% % add days in prior years
+ \global\@common = #4}%
+ #4 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Hebrew Part}
+%
+% \begin{macrocode}
+\newif\if@HebrewLeap
+% \end{macrocode}
+% \begin{macro}{\CheckLeapHebrewYear}
+% Set |\@HebrewLeaptrue| if Hebrew `year' is a leap year, i.e.\ if
+% $(1+7\times year)\%19 < 7$ then \emph{true} else \emph{false}
+% \begin{macrocode}
+\def\CheckLeapHebrewYear#1{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+%
+ \tmpa = #1%
+ \multiply \tmpa by 7%
+ \advance \tmpa by 1%
+ \Remainder{\tmpa}{19}{\tmpb}%
+ \ifnum \tmpb < 7% % \tmpb = (7*year+1)%19
+ \global\@HebrewLeaptrue%
+ \else%
+ \global\@HebrewLeapfalse%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewElapsedMonths}
+% The macro |\HebrewElapsedMonths{|\emph{year}|}{|\emph{months}|}|
+% determines the number of months elapsed from the Sunday prior to
+% the start of the Hebrew calendar to the mean conjunction of
+% Tishri of Hebrew `year'.
+% \begin{macrocode}
+\def\HebrewElapsedMonths#1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \tmpa = #1% %
+ \advance \tmpa by -1% %
+ #2 = \tmpa% % #2 = \tmpa = year-1
+ \divide #2 by 19% % Number of complete Meton cycles
+ \multiply #2 by 235% % #2 = 235*((year-1)/19)
+%
+ \Remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
+ \tmpc = \tmpb% %
+ \multiply \tmpb by 12% %
+ \advance #2 by \tmpb% % add regular months this cycle
+%
+ \multiply \tmpc by 7% %
+ \advance \tmpc by 1% %
+ \divide \tmpc by 19% % \tmpc = (1+7*((year-1)%19))/19 -
+% % number of leap months this cycle
+ \advance #2 by \tmpc% % add leap months
+%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewElapsedDays}
+% The macro |\HebrewElapsedDays{|\emph{year}|}{|\emph{days}|}|
+% determines the number of days elapsed from the Sunday prior to
+% the start of the Hebrew calendar to the mean conjunction of
+% Tishri of Hebrew `year'.
+% \begin{macrocode}
+\def\HebrewElapsedDays#1#2{%
+ {%
+ \countdef\tmpa = 0% % \tmpa==\count0
+ \countdef\tmpb = 1% % \tmpb==\count1
+ \countdef\tmpc = 2% % \tmpc==\count2
+%
+ \HebrewElapsedMonths{#1}{#2}%
+ \tmpa = #2% %
+ \multiply \tmpa by 13753% %
+ \advance \tmpa by 5604% % \tmpa=MonthsElapsed*13758 + 5604
+ \Remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
+ \divide \tmpa by 25920%
+%
+ \multiply #2 by 29%
+ \advance #2 by 1%
+ \advance #2 by \tmpa% % #2 = 1 + MonthsElapsed*29 +
+% % PartsElapsed/25920
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpc < 19440%
+ \ifnum \tmpc < 9924%
+ \else% % New moon at 9 h. 204 p. or later
+ \ifnum \tmpa = 2% % on Tuesday ...
+ \CheckLeapHebrewYear{#1}% of a common year
+ \if@HebrewLeap%
+ \else%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum \tmpc < 16789%
+ \else% % New moon at 15 h. 589 p. or later
+ \ifnum \tmpa = 1% % on Monday ...
+ \advance #1 by -1%
+ \CheckLeapHebrewYear{#1}% at the end of leap year
+ \if@HebrewLeap%
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \advance #2 by 1% % new moon at or after midday
+ \fi%
+%
+ \Remainder{#2}{7}{\tmpa}% % \tmpa == DayOfWeek
+ \ifnum \tmpa = 0% % if Sunday ...
+ \advance #2 by 1%
+ \else% %
+ \ifnum \tmpa = 3% % Wednesday ...
+ \advance #2 by 1%
+ \else%
+ \ifnum \tmpa = 5% % or Friday
+ \advance #2 by 1%
+ \fi%
+ \fi%
+ \fi%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DaysInHebrewYear}
+% The macro |\DaysInHebrewYear{|\emph{year}|}{|\emph{days}|}|
+% calculates the number of days in Hebrew `year'.
+% \begin{macrocode}
+\def\DaysInHebrewYear#1#2{%
+ {%
+ \countdef\tmpe = 12% % \tmpe==\count12
+%
+ \HebrewElapsedDays{#1}{\tmpe}%
+ \advance #1 by 1%
+ \HebrewElapsedDays{#1}{#2}%
+ \advance #2 by -\tmpe%
+ \global\@common = #2}%
+ #2 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewDaysInPriorMonths}
+% The macro |\HebrewDaysInPriorMonths{|\emph{month}|}{|^^A
+% \emph{year}|}{|\emph{days}|}| calculates the nu\-mber of days in
+% months prior to `month' in the `year'.
+% \begin{macrocode}
+\def\HebrewDaysInPriorMonths#1#2#3{%
+ {%
+ \countdef\tmpf= 14% % \tmpf==\count14
+%
+ #3 = \ifcase #1% % Days in prior month of regular year
+ 0 \or% % no month number 0
+ 0 \or% % Tishri
+ 30 \or% % Heshvan
+ 59 \or% % Kislev
+ 89 \or% % Tebeth
+ 118 \or% % Shebat
+ 148 \or% % Adar I
+ 148 \or% % Adar II
+ 177 \or% % Nisan
+ 207 \or% % Iyar
+ 236 \or% % Sivan
+ 266 \or% % Tammuz
+ 295 \or% % Av
+ 325 \or% % Elul
+ 400% % Dummy
+ \fi%
+ \CheckLeapHebrewYear{#2}%
+ \if@HebrewLeap% % in leap year
+ \ifnum #1 > 6% % if month after Adar I
+ \advance #3 by 30% % add 30 days
+ \fi%
+ \fi%
+ \DaysInHebrewYear{#2}{\tmpf}%
+ \ifnum #1 > 3%
+ \ifnum \tmpf = 353% %
+ \advance #3 by -1% %
+ \fi% % Short Kislev
+ \ifnum \tmpf = 383% %
+ \advance #3 by -1% %
+ \fi% %
+ \fi%
+%
+ \ifnum #1 > 2%
+ \ifnum \tmpf = 355% %
+ \advance #3 by 1% %
+ \fi% % Long Heshvan
+ \ifnum \tmpf = 385% %
+ \advance #3 by 1% %
+ \fi% %
+ \fi%
+ \global\@common = #3}%
+ #3 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AbsoluteFromHebrew}
+% The macro |\AbsoluteFromHebrew{|\emph{day}|}{|\emph{month}^^A
+% |}{|\emph{year}|}{|\emph{absdate}|}| calculates the absolute date
+% of Hebrew date |day.month.year|.
+% \begin{macrocode}
+\def\AbsoluteFromHebrew#1#2#3#4{%
+ {%
+ #4 = #1%
+ \HebrewDaysInPriorMonths{#2}{#3}{#1}%
+ \advance #4 by #1% % Add days in prior months this year
+ \HebrewElapsedDays{#3}{#1}%
+ \advance #4 by #1% % Add days in prior years
+ \advance #4 by -1373429% % Subtract days before Gregorian
+ \global\@common = #4}% % 01.01.0001
+ #4 = \@common}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\HebrewFromGregorian}
+% The macro |\HebrewFromGregorian{|\emph{Gday}|}{|\emph{Gmonth}^^A
+% |}{|\emph{Gyear}|}{|\emph{Hday}|}{|\emph{Hmonth}|}|\-|{|^^A
+% \emph{Hyear}|}| evaluates Hebrew date |Hday|, |Hmonth|, |Hyear|
+% from Gregorian date |Gday|, |Gmonth|, |Gyear|.
+% \begin{macrocode}
+\def\HebrewFromGregorian#1#2#3#4#5#6{%
+ {%
+ \countdef\tmpx= 17% % \tmpx==\count17
+ \countdef\tmpy= 18% % \tmpy==\count18
+ \countdef\tmpz= 19% % \tmpz==\count19
+%
+ #6 = #3% %
+ \global\advance #6 by 3761% approximation from above
+ \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
+ \tmpz = 1 \tmpy = 1%
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \ifnum \tmpx > #4% %
+ \global\advance #6 by -1% Hyear = Gyear + 3760
+ \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
+ \fi% %
+ \advance #4 by -\tmpx% % Days in this year
+ \advance #4 by 1% %
+ #5 = #4% %
+ \divide #5 by 30% % Approximation for month from below
+ \loop% % Search for month
+ \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
+ \ifnum \tmpx < #4%
+ \advance #5 by 1%
+ \tmpy = \tmpx%
+ \repeat%
+ \global\advance #5 by -1%
+ \global\advance #4 by -\tmpy}}
+%</calendar>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebrew.fdd b/macros/latex/contrib/babel-contrib/hebrew/hebrew.fdd
new file mode 100644
index 0000000000..f61d06f430
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebrew.fdd
@@ -0,0 +1,1297 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{610}
+%
+% \iffalse meta-comment
+%% File `hebrew.fdd' for installing the Hebrew encodings and fonts.
+%% Copyright (C) 1997 -- 2005 Boris Lavva.
+%
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+% \fi
+% \iffalse
+%<LHEenc>\ProvidesFile{lheenc.def}
+%<LHEcmr>\ProvidesFile{lhecmr.fd}
+%<LHEcmss>\ProvidesFile{lhecmss.fd}
+%<LHEcmtt>\ProvidesFile{lhecmtt.fd}
+%<LHEclas>\ProvidesFile{lheclas.fd}
+%<LHEshold>\ProvidesFile{lheshold.fd}
+%<LHEshscr>\ProvidesFile{lheshscr.fd}
+%<LHEshstk>\ProvidesFile{lheshstk.fd}
+%<LHEfr>\ProvidesFile{lhefr.fd}
+%<LHEcrml>\ProvidesFile{lhecrml.fd}
+%<LHEredis>\ProvidesFile{lheredis.fd}
+%<HE8enc>\ProvidesFile{HE8enc.def}
+%<HE8cmr>\ProvidesFile{HE8cmr.fd}
+%<HE8cmss>\ProvidesFile{HE8cmss.fd}
+%<HE8cmtt>\ProvidesFile{HE8cmtt.fd}
+% The recoded Omega font (only Hebrew glyphs. Lacks other glyphs)
+%<HE8OmegaHebrew>\ProvidesFile{HE8OmegaHebrew.fd}
+% The culmus fonts:
+%<HE8aharoni>\ProvidesFile{HE8aharoni.fd}
+%<HE8david>\ProvidesFile{HE8david.fd}
+%<HE8drugulin>\ProvidesFile{HE8drugulin.fd}
+%<HE8ellinia>\ProvidesFile{HE8ellinia.fd}
+%<HE8frankruehl>\ProvidesFile{HE8frankruehl.fd}
+%<HE8yad>\ProvidesFile{HE8yad.fd}
+%<HE8miriam>\ProvidesFile{HE8miriam.fd}
+%<HE8nachlieli>\ProvidesFile{HE8nachlieli.fd}
+% The IBM Type1 fonts (not freely distributable
+%<HE8CourierShalom>\ProvidesFile{HE8CourierShalom.fd}
+%<HE8HelveticaNarkissTam>\ProvidesFile{HE8HelveticaNarkissTam.fd}
+%<HE8TimesNarkissim>\ProvidesFile{HE8TimesNarkissim.fd}
+% Placeholders for windows fonts:
+%<HE8mfdavid>\ProvidesFile{HE8mfdavid.fd}
+%<HE8mffrank>\ProvidesFile{HE8mffrank.fd}
+%<HE8mffrankthick>\ProvidesFile{HE8mffrankthick.fd}
+%<HE8mffrankthin>\ProvidesFile{HE8mffrankthin.fd}
+%<HE8mfmiriam>\ProvidesFile{HE8mfmiriam.fd}
+%<HE8mfmiriamwide>\ProvidesFile{HE8mfmiriamwide.fd}
+%<HE8mfnarkistam>\ProvidesFile{HE8mfnarkistam.fd}
+%<hebfont>\ProvidesPackage{hebfont}
+%<*driver>
+\ProvidesFile{hebrew.drv}
+%</driver>
+% \fi
+% \ProvidesFile{hebrew.fdd}
+ [2005/05/20 v1.2c %
+% \iffalse
+%<LHEenc> 7-bit Hebrew font encoding
+%<LHEcmr> Hebrew default font
+%<LHEcmss> Hebrew sans-serif font
+%<LHEcmtt> Hebrew typewriter font
+%<LHEclas> Hebrew classic font (by Joel M. Hoffman)
+%<LHEshold> Hebrew shalom old font (by Jonathan Brecher)
+%<LHEshscr> Hebrew shalom script font (by Jonathan Brecher)
+%<LHEshstk> Hebrew shalom stick font (by Jonathan Brecher)
+%<LHEfr> Hebrew frank-ruehl font
+%<LHEcrml> Hebrew carmel font (by Dr. Samy Zafrany)
+%<LHEredis> Hebrew redis font (by Prof. Jacques J. Goldberg)
+%<HE8enc> 8-bit Hebrew font encoding
+%<HE8cmr> Hebrew default font
+%<HE8cmss> Hebrew sans-serif font
+%<HE8cmtt> Hebrew typewriter font
+%<HE8OmegaHebrew> Hebrew font from the Omega project (by ???)
+%<HE8aharoni> Hebrew sans-serif font (Culmus)
+%<HE8david> Hebrew serif font (Culmus)
+%<HE8drugulin> Hebrew old serif font (Culmus)
+%<HE8ellinia> Hebrew sans-serif font (Culmus)
+%<HE8frankruehl> Hebrew serif font (Culmus)
+%<HE8yad> Hebrew handwriting font (Culmus)
+%<HE8miriam> Hebrew monospaced font (Culmus)
+%<HE8nachlieli> Hebrew sans-serif font (Culmus)
+%<HE8CourierShalom> Hebrew Shalom (Courier) font (by IBM)
+%<HE8HelveticaNarkissTam> Hebrew NarkisTam (Helvetica) (by Zvi Narkis)
+%<HE8TimesNarkissim> Hebrew Narkissim (Times) (by Zvi Narkis)
+%<HE8mfdavid> Hebrew David font (by ???)
+%<HE8mffrank> Hebrew Frank-Ruehl font (by ??)
+%<HE8mffrankthick> Hebrew Frank-Ruehl (thick) font (by ??)
+%<HE8mffrankthin> Hebrew Frank-Ruehl (thin) font (by ??)
+%<HE8mfmiriam> Hebrew Miriam font (by ???)
+%<HE8mfmiriamwide> Hebrew Miriam (wide) font (by ???)
+%<HE8mfnarkistam> Hebrew Narkis Tam font (by ???)
+%<hebfont> Hebrew font switching commands
+%<driver> Driver file for hebrew.fdd file
+% \fi
+% Hebrew font encodings support
+ (test version: still liable to change)]
+%
+% \font\manual=logo10
+% \providecommand\MF{{\manual META}\-{\manual FONT}}
+% \providecommand\PS{\textsc{PostScript}}
+% \providecommand\dst{\textsc{docstrip}}
+% \providecommand\LHE{\texttt{LHE}}
+% \providecommand\HEH{\texttt{HE8}}
+% \providecommand\file[1]{\texttt{#1}}
+% \providecommand\pkg[1]{\texttt{#1}}
+% \GetFileInfo{hebrew.fdd}
+%
+% \changes{hebfdd-1.0a}{1998/01/01}{%
+% Initial version. Supports only 7-bit LHE font encoding and all
+% available Hebrew \TeX\ fonts (by Boris Lavva)}
+% \changes{hebfdd-1.0b}{2001/08/16}{%
+% fixed lhecmr.fd to use oldjaf10 for a slanted font
+% available Hebrew \TeX\ fonts (by Tzafrir Cohen)}
+% \changes{hebfdd-1.1a}{2001/08/16}{%
+% Adding 8-bit HE8 fonts. Note that most of them cannot be distributed
+% with heb\LaTeX\ (by Tzafrir Cohen)}
+% \changes{hebfdd-1.2a}{2003/08/19}{%
+% Adding configurations for the Culmus fonts, currently 0.90
+% (by Tzafrir Cohen)}
+% \changes{hebfdd-1.2b}{2004/02/20}{Reinstated the test whether LHE or
+% HE8 is to be used}
+%
+% \changes{hebrew-1.2c}{2005/05/18}{Typo's in the docstrip guards made
+% HE8nachlieli.fd unusable}
+% \section{Hebrew font encodings}\label{sec:hebfdd}
+%
+% % Don't forget to update the docs...
+% \subsection{THIS SECTION IS OUT OF DATE. UPDATE DOCS TO MATCH HE8
+% ENCODING}
+%
+% The file \file{\filename}\footnote{The files described in this
+% section have version number \fileversion{} and were last revised
+% on \filedate.} contains the Local Hebrew Encoding (\LHE)
+% definition, the external font information needed to use the
+% Hebrew 7-bit fonts (old code fonts) and \pkg{hebfont} package
+% that provides Hebrew font switching commands.
+%
+% Using this file as an input, |lheenc.def| encoding definition
+% file, all |.fd| files (font definition files) and font switching
+% package for available Hebrew fonts are generated. We chose to use
+% 7-bit encoding as default font encoding, because:
+% \begin{enumerate}
+% \item There are many 7-bit encoded Hebrew fonts available, more
+% then for any other encoding.
+% \item Available \TeX{} Hebrew fonts do not include latin
+% alphabet, and we can safely map Hebrew glyphs to the
+% \texttt{ASCII} positions (0 -- 127).
+% \end{enumerate}
+%
+% Current definition of the \LHE{} encoding supports only Hebrew
+% letters (|\hebalef|--|\hebtav|), but not Hebrew points, such as
+% |\hebdagesh|, |\hebqamats|, |\hebpatah|, |\hebshindot|, etc. We
+% are working now on such addition.
+%
+% \StopEventually{}
+%
+% \iffalse
+% \subsection{A driver for this document}
+%
+% The next bit of code contains the documentation driver file for
+% \TeX{}, i.e., the file that will produce the documentation you are
+% currently reading. It will be extracted from this file by the \dst{}
+% program.
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\title{Hebrew font encodings for use with \LaTeXe}
+\author{Boris Lavva}
+\date{Printed \today}
+\begin{document}
+ \maketitle
+ \DocInput{hebrew.fdd}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \subsection{The {\normalfont\dst{}} modules}
+%
+% The following modules are used in the implementation to direct
+% \dst{} in generating external files:
+% \begin{center}
+% \begin{tabular}{@{}ll}
+% driver & produce a documentation driver file \\[4pt]
+% HE8enc & produce the encoding definition for CodePage 1255
+% (\HEH)\\[4pt]
+% HE8cmr & make Hebrew default font in \HEH\\
+% HE8cmss & make Hebrew sans-serif font in \HEH\\
+% HE8cmtt & make Hebrew typewriter font in \HEH\\
+% HE8OmegaHebrew & Hebrew font from the Omega project (by ???)\\
+% HE8aharoni & Hebrew sans-serif font (Culmus)\\
+% HE8david & Hebrew serif font (Culmus)\\
+% HE8drugulin & Hebrew old serif font (Culmus)\\
+% HE8ellinia & Hebrew isans-serif font (Culmus)\\
+% HE8frankruehl & Hebrew serif font (Culmus)\\
+% HE8KtavYad & Hebrew handwriting font (Culmus)\\
+% HE8MiriamMono & Hebrew monospaced font\\
+% HE8Nachlieli & Hebrew sans-serif font (Culmus)\\
+% HE8CourierShalom & Hebrew Shalom (Courier) font (by IBM)\\
+% HE8HelveticaNarkissTam &Hebrew NarkisTam (Helvetica) (by Zvi Narkis)\\
+% HE8TimesNarkissim & Hebrew Narkissim (Times) (by Zvi Narkis) \\
+% HE8mfdavid & Hebrew David font (by ???)\\
+% HE8mffrank & Hebrew Frank-Ruehl font (by ??)\\
+% HE8mffrankthick & Hebrew Frank-Ruehl (thick) font (by ??)\\
+% HE8mffrankthin & Hebrew Frank-Ruehl (thin) font (by ??)\\
+% HE8mfmiriam & Hebrew Miriam font (by ???)\\
+% HE8mfmiriamwide & Hebrew Miriam (wide) font (by ???)\\
+% HE8mfnarkistam & Hebrew Narkis Tam font (by ???)\\
+% LHEenc & produce the encoding definition for Local Hebrew
+% Encoding (\LHE)\\[4pt]
+% LHEcmr & make Hebrew default font in \LHE\\
+% LHEcmss & make Hebrew sans-serif font in \LHE\\
+% LHEcmtt & make Hebrew typewriter font in \LHE\\
+% LHEclas & make Hebrew classic font (by Joel M.~Hoffman) in \LHE\\
+% LHEshold & make Hebrew shalom old font (by Jonathan Brecher)
+% in \LHE\\
+% LHEshscr & make Hebrew shalom script font (by Jonathan Brecher)
+% in \LHE\\
+% LHEshstk & make Hebrew shalom stick font (by Jonathan Brecher)
+% in \LHE\\
+% LHEfr & make Hebrew frank-ruehl font in \LHE\\
+% LHEcrml & make Hebrew carmel font (by Dr. Samy Zafrany) in \LHE\\
+% LHEredis & make Hebrew redis font (by Prof. Jacques J.~Goldberg)
+% in \LHE\\[4pt]
+% nowarn & option for font definition files, that used\\
+% & to produce ``silent'' font substitutions without
+% giving warnings\\[4pt]
+% hebfont & create Hebrew font switching commands package
+% \end{tabular}
+% \end{center}
+% A typical \dst{} command file would then have entries like:
+%\begin{verbatim}
+%\generateFile{lhecmr.fd}{t}{\from{hebrew.fdd}{LHEcmr,nowarn}}
+%\end{verbatim}
+%
+% \subsection{The \LHE encoding definition file}
+%
+% The Hebrew font encoding \LHE{} is based upon the old-code encoding
+% also known as the Israeli Standard SI-960. Many Hebrew \TeX{}
+% fonts from the Hebrew University of Jerusalem are encoded
+% in this encoding. It only uses the lower 128 positions of the font
+% table. As local encoding its name start with the letter `L'.
+%
+% First we define the Local Hebrew Encoding; specify a default
+% for the font substitution process for the \LHE{} encoding and
+% supply a font to be used when all else fails.
+%
+% \begin{macrocode}
+%<*LHEenc>
+\DeclareFontEncoding{LHE}{}{}
+\DeclareFontSubstitution{LHE}{cmr}{m}{n}
+\DeclareErrorFont{LHE}{cmr}{m}{n}{10}
+%</LHEenc>
+% \end{macrocode}
+% Then we define a few commands in the \LHE{} encoding.
+% \begin{macrocode}
+%<*LHEenc>
+\ProvideTextCommand{\textcopyright}{LHE}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{LHE}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{LHE}{\textsuperscript{\@latin{TM}}}
+%</LHEenc>
+% \end{macrocode}
+%
+% Because not everyone can input Hebrew input text directly from
+% the keyboard we need to define control sequences for all the
+% Hebrew glyphs in the fonts. In addition, we want to support
+% many input encodings for Hebrew and to keep the language
+% definition file (|hebrew.ldf|) independent of the
+% encoding. Therefore, we exploit the standard \LaTeXe{} font
+% encoding mechanism to define control sequences for all the Hebrew
+% glyphs in the fonts in encoding-specific way. The language
+% definition file uses only the control sequences and doesn't need
+% to check the current font or input encoding.
+%
+% In the \LHE{} encoding (7-bit encoding) all the Hebrew glyphes
+% reside in the \emph{lower} half of the font. Currently, only the
+% Hebrew letters are supported. They use the same positions as the
+% latin small letters in |ASCII| encoding and the position of |`|.
+%
+% The symbol |`| (glyph 96) is used by Hebrew letter \emph{Alef},
+% so we need to define its |lccode| to allow hyphenation. All other
+% letters retain the same |lccode|s as their latin counterparts.
+% \begin{macrocode}
+%<+LHEenc>\lccode``=``
+% \end{macrocode}
+% Hebrew letters occupy the positions 96--122 in \LHE{} encoding:
+% \begin{macrocode}
+%<*LHEenc>
+\DeclareTextSymbol{\hebalef}{LHE}{96}
+\DeclareTextSymbol{\hebbet}{LHE}{97}
+\DeclareTextSymbol{\hebgimel}{LHE}{98}
+\DeclareTextSymbol{\hebdalet}{LHE}{99}
+\DeclareTextSymbol{\hebhe}{LHE}{100}
+\DeclareTextSymbol{\hebvav}{LHE}{101}
+\DeclareTextSymbol{\hebzayin}{LHE}{102}
+\DeclareTextSymbol{\hebhet}{LHE}{103}
+\DeclareTextSymbol{\hebtet}{LHE}{104}
+\DeclareTextSymbol{\hebyod}{LHE}{105}
+\DeclareTextSymbol{\hebfinalkaf}{LHE}{106}
+\DeclareTextSymbol{\hebkaf}{LHE}{107}
+\DeclareTextSymbol{\heblamed}{LHE}{108}
+\DeclareTextSymbol{\hebfinalmem}{LHE}{109}
+\DeclareTextSymbol{\hebmem}{LHE}{110}
+\DeclareTextSymbol{\hebfinalnun}{LHE}{111}
+\DeclareTextSymbol{\hebnun}{LHE}{112}
+\DeclareTextSymbol{\hebsamekh}{LHE}{113}
+\DeclareTextSymbol{\hebayin}{LHE}{114}
+\DeclareTextSymbol{\hebfinalpe}{LHE}{115}
+\DeclareTextSymbol{\hebpe}{LHE}{116}
+\DeclareTextSymbol{\hebfinaltsadi}{LHE}{117}
+\DeclareTextSymbol{\hebtsadi}{LHE}{118}
+\DeclareTextSymbol{\hebqof}{LHE}{119}
+\DeclareTextSymbol{\hebresh}{LHE}{120}
+\DeclareTextSymbol{\hebshin}{LHE}{121}
+\DeclareTextSymbol{\hebtav}{LHE}{122}
+%</LHEenc>
+% \end{macrocode}
+% Letter |\hebsin| is defined as a synonym of |\hebshin|:
+% \begin{macrocode}
+%<+LHEenc>\let\hebsin=\hebshin
+% \end{macrocode}
+%
+% \subsection{The font definition files (in \LHE{} encoding)}
+%
+% \subsubsection{Hebrew default font}
+%
+% It uses \emph{Jerusalem} font for regular font, \emph{Old
+% Jaffa} font for italic shape and small-caps, \emph{Dead Sea}
+% font for bold face, and \emph{Tel-Aviv} for bold-italic
+% \begin{macrocode}
+%<*LHEcmr>
+\DeclareFontFamily{LHE}{cmr}{\hyphenchar\font45}
+\DeclareFontShape{LHE}{cmr}{m}{n}
+ {<-> jerus10 }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmr}{m}{it}
+ {<-> oldjaf10 }{}
+\DeclareFontShape{LHE}{cmr}{m}{sl}
+ {<-> oldjaf10 }{}
+\DeclareFontShape{LHE}{cmr}{m}{sc}
+ {<-> oldjaf10 }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmr}{bx}{n}
+ {<-> deads10 }{}
+\DeclareFontShape{LHE}{cmr}{b}{n}
+ {<-> deads10 }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{LHE}{cmr}{bx}{sl}
+ {<-> telav10 }{}
+\DeclareFontShape{LHE}{cmr}{bx}{it}
+ {<-> telav10 }{}
+%</LHEcmr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew sans-serif font}
+%
+% We use \emph{Tel Aviv} font for the Sans family. \emph{Old
+% Jaffa} font is used for italic shape and \emph{Dead Sea}
+% used for bold face.
+% \begin{macrocode}
+%<*LHEcmss>
+\DeclareFontFamily{LHE}{cmss}{\hyphenchar\font45}
+\DeclareFontShape{LHE}{cmss}{m}{n}
+ {<-> telav10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{m}{sc}
+%<-nowarn> {<->sub * cmss/m/n}{}
+%<+nowarn> {<->ssub * cmss/m/n}{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmss}{m}{it}
+ {<-> oldjaf10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{m}{sl}
+%<-nowarn> {<->sub * cmss/m/it}{}
+%<+nowarn> {<->ssub * cmss/m/it}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmss}{bx}{n}
+ {<-> deads10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{b}{n}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{bx}{sl}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmss}{bx}{it}
+%<-nowarn> {<->sub * cmss/bx/n}{}
+%<+nowarn> {<->ssub * cmss/bx/n}{}
+%</LHEcmss>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew typewriter font}
+%
+% We use \emph{Tel Aviv} font as the typewriter font. \emph{Old
+% Jaffa} font is used for italic shape and \emph{Dead Sea}
+% used for bold face.
+% \begin{macrocode}
+%<*LHEcmtt>
+\DeclareFontFamily{LHE}{cmtt}{\hyphenchar \font\m@ne}
+\DeclareFontShape{LHE}{cmtt}{m}{n}
+ {<-> telav10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{m}{sc}
+%<-nowarn> {<->sub * cmtt/m/n}{}
+%<+nowarn> {<->ssub * cmtt/m/n}{}
+%%%%%%% Italicized shape
+\DeclareFontShape{LHE}{cmtt}{m}{it}
+ {<-> oldjaf10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{m}{sl}
+%<-nowarn> {<->sub * cmtt/m/it}{}
+%<+nowarn> {<->ssub * cmtt/m/it}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{cmtt}{bx}{n}
+ {<-> deads10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{cmtt}{bx}{it}
+%<-nowarn> {<->sub * cmtt/bx/n}{}
+%<+nowarn> {<->ssub * cmtt/bx/n}{}
+%</LHEcmtt>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew classic font}
+%
+% \emph{Hclassic} and \emph{hcaption} fonts are distributed freely
+% from |CTAN| sites and copyrighted by Joel M.~Hoffman, of 19
+% Hillcrest Lane, Rye, NY 10580 USA, e-mail:
+% |72700.402@compuserve.com|.
+%
+% Hclassic is a modernized Classical Hebrew font (in the same way
+% that Knuth's |cmr| family is a modernized Roman font --- but his
+% fonts are much nicer). Hcaption is a slanted version of hclassic
+% font. Both fonts contain all of the Hebrew consonants,
+% the (rarely used) ligature \emph{alef-lamed} and two versions of
+% the letter \emph{ayin} for use with and without
+% vowels. Hclassic also contains all of the vowels found in Hebrew,
+% a symbol for \emph{meteg}, and dots for use as a \emph{dagesh}
+% and for differentiating \emph{shin} and \emph{sin} letters.
+%
+% Currently, only the Hebrew consonants (\emph{hebalef} -- \emph{hebtav})
+% from these fonts are supported by \LaTeXe{}, however one can use
+% vowels and dots directly with \PlainTeX{} macros. We are working
+% on generic vowels and dots support for \LaTeXe.
+%
+% \begin{macrocode}
+%<*LHEclas>
+\DeclareFontFamily{LHE}{clas}{}
+\DeclareFontShape{LHE}{clas}{m}{n}
+ {<-> s * [0.83345] hclassic }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{clas}{m}{sc}
+%<-nowarn> {<->sub * clas/m/n}{}
+%<+nowarn> {<->ssub * clas/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{clas}{m}{sl}
+ {<-> s * [0.69389] hcaption }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{clas}{m}{it}
+%<-nowarn> {<->sub * clas/m/sl}{}
+%<+nowarn> {<->ssub * clas/m/sl}{}
+%</LHEclas>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew shalom fonts}
+%
+% All three shalom fonts (\emph{ShalomScript10},
+% \emph{ShalomStick10} and \emph{ShalomOldStyle10}) have been
+% created by Jonathan Brecher, of 9 Skyview Road, Lexington, MA
+% 02173-1112 USA, e-mail: |brecher@husc.harvard.edu|.
+%
+% All shalom fonts have been written in \PS{} via Fontographer on a
+% Mac. The fonts have been converted to \MF{} by Rama Porrat
+% (e-mail: |rama@cc.huji.ac.il|), using
+% the utility typo, a font editor + converter between font formats
+% (a commercial product). |ShalomScript10.mf| is the \MF{}
+% equivalent of |ShalomScript.ps|, |ShalomStick10.mf| came from
+% |ShalomStick.ps| and |ShalomOldStyle10.mf| originated in
+% |ShalomOldStyle.ps|.
+%
+% The fonts differ in the letters' style. ShalomScript10 contains
+% hand writing Hebrew letters; ShalomStick10 contains sans-serif
+% letters, and ShalomOldStyle10 contains old style letters. All
+% three fonts contain vowels and dots (nikud). While converting to
+% \MF{}, letters and symbols within the fonts have been arranged
+% so as to get a usable font for writing Hebrew documents in \TeX{}
+% or \LaTeX{}, with as well as without vowels.
+%
+% Currently, only the Hebrew consonants (\emph{hebalef} -- \emph{hebtav})
+% from these fonts are supported by \LaTeXe{}, however one can use
+% vowels and dots directly with \PlainTeX{} macros. We are working
+% on generic vowels and dots support for \LaTeXe.
+%
+% \begin{macrocode}
+%<*LHEshold>
+\DeclareFontFamily{LHE}{shold}{}
+\DeclareFontShape{LHE}{shold}{m}{n}
+ {<-> shold10 }{}
+%</LHEshold>
+%<*LHEshscr>
+\DeclareFontFamily{LHE}{shscr}{}
+\DeclareFontShape{LHE}{shscr}{m}{n}
+ {<-> shscr10 }{}
+%</LHEshscr>
+%<*LHEshstk>
+\DeclareFontFamily{LHE}{shstk}{}
+\DeclareFontShape{LHE}{shstk}{m}{n}
+ {<-> shstk10 }{}
+%</LHEshstk>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew frank-ruehl font}
+%
+% \emph{Frank Ruehl} font was written in \MF{} and includes three
+% shapes: regular, bold extaneded and slanted.
+%
+% \begin{macrocode}
+%<*LHEfr>
+\DeclareFontFamily{LHE}{fr}{}
+\DeclareFontShape{LHE}{fr}{m}{n}
+ {<-> fr }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{m}{sc}
+%<-nowarn> {<->sub * fr/m/n}{}
+%<+nowarn> {<->ssub * fr/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{fr}{m}{sl}
+ {<-> frsl }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{m}{it}
+%<-nowarn> {<->sub * fr/m/sl}{}
+%<+nowarn> {<->ssub * fr/m/sl}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{fr}{bx}{n}
+ {<-> frbx }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{b}{n}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{bx}{sl}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{fr}{bx}{it}
+%<-nowarn> {<->sub * fr/bx/n}{}
+%<+nowarn> {<->ssub * fr/bx/n}{}
+%</LHEfr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew carmel font}
+%
+% \emph{Carmel} font includes regular and slanted shapes. It was
+% created by Dr.~Samy Zafrany of the Technion, Haifa, Israel with
+% the intention of making nice fonts for headers and emphasized
+% text.
+%
+% \begin{macrocode}
+%<*LHEcrml>
+\DeclareFontFamily{LHE}{crml}{}
+\DeclareFontShape{LHE}{crml}{m}{n}
+ {<-> crml10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{crml}{m}{sc}
+%<-nowarn> {<->sub * crml/m/n}{}
+%<+nowarn> {<->ssub * crml/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{crml}{m}{sl}
+ {<-> crmlsl10 }{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{crml}{m}{it}
+%<-nowarn> {<->sub * crml/m/sl}{}
+%<+nowarn> {<->ssub * crml/m/sl}{}
+%</LHEcrml>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew redis font}
+%
+% \emph{Redis} font has been created by Prof.~Jacques J.~Goldberg
+% of the Technion. Haifa, Israel. The font is available in regular,
+% slanted and bold extanded shapes. This font contains a full set
+% of Hebrew letters in a ``sans-serif vectorized'' style, and
+% selected punctuation.
+%
+% \begin{macrocode}
+%<*LHEredis>
+\DeclareFontFamily{LHE}{redis}{}
+\DeclareFontShape{LHE}{redis}{m}{n}{%
+ <5> <6> redis7
+ <7> <8> <9> <10> <12> gen * redis
+ <10.95> redis10
+ <14.4> redis12
+ <17.28> <20.74> <24.88> redis17}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{m}{sc}
+%<-nowarn> {<->sub * redis/m/n}{}
+%<+nowarn> {<->ssub * redis/m/n}{}
+%%%%%%% Slanted shape
+\DeclareFontShape{LHE}{redis}{m}{sl}{%
+ <5> <6> <7> rediss8
+ <8> <9> <10> <12> gen * rediss
+ <10.95> rediss10
+ <14.4> <17.28> <20.74> <24.88> rediss12}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{m}{it}
+%<-nowarn> {<->sub * redis/m/sl}{}
+%<+nowarn> {<->ssub * redis/m/sl}{}
+%%%%%%% Bold extended series
+\DeclareFontShape{LHE}{redis}{bx}{n}{%
+ <5> <6> <7> <8> <9> <10> <10.95> <12>
+ <14.4> <17.28> <20.74> <24.88> redisb10}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{b}{n}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{bx}{sl}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%%%%%%% Font/shape undefined, therefore substituted
+\DeclareFontShape{LHE}{redis}{bx}{it}
+%<-nowarn> {<->sub * redis/bx/n}{}
+%<+nowarn> {<->ssub * redis/bx/n}{}
+%</LHEredis>
+% \end{macrocode}
+%
+% \subsection{The \HEH encoding definition file}
+%
+% The Hebrew font encoding \HEH{} is based upon an extention by
+% Microsoft to the ISO-8859-8 standard. This is an 8bit encoding. The
+% extentions include hebrew points (``Nikud'').
+%
+% First we define the Codepage 1255; specify a default
+% for the font substitution process for the \HEH{} encoding and
+% supply a font to be used when all else fails.
+%
+% \begin{macrocode}
+%<*HE8enc>
+\DeclareFontEncoding{HE8}{}{}
+\DeclareFontSubstitution{HE8}{cmr}{m}{n}
+\DeclareErrorFont{HE8}{cmr}{m}{n}{10}
+%</HE8enc>
+% \end{macrocode}
+% Then we define a few commands in the \HEH{} encoding.
+% \begin{macrocode}
+%<*HE8enc>
+\ProvideTextCommand{\textcopyright}{HE8}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{HE8}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{HE8}{\textsuperscript{\@latin{TM}}}
+%</HE8enc>
+% \end{macrocode}
+%
+% \subsubsection{CHECK HERE FOR HE8 UPDATES}
+%
+% Because not everyone can input Hebrew input text directly from
+% the keyboard we need to define control sequences for all the
+% Hebrew glyphs in the fonts. In addition, we want to support
+% many input encodings for Hebrew and to keep the language
+% definition file (|hebrew.ldf|) independent of the
+% encoding. Therefore, we exploit the standard \LaTeXe{} font
+% encoding mechanism to define control sequences for all the Hebrew
+% glyphs in the fonts in encoding-specific way. The language
+% definition file uses only the control sequences and doesn't need
+% to check the current font or input encoding.
+%
+% % In the \LHE{} encoding (7-bit encoding) all the Hebrew glyphes
+% % reside in the \emph{lower} half of the font. Currently, only the
+% % Hebrew letters are supported. They use the same positions as the
+% % latin small letters in |ASCII| encoding and the position of |`|.
+%
+% Some general symbols:
+% \begin{macrocode}
+%<*HE8enc>
+\ProvideTextCommand{\textcopyright}{HE8}{\textcircled{\@latin{c}}}
+\ProvideTextCommand{\textregistered}{HE8}{\textcircled{\scshape%
+ \@latin{r}}}
+\ProvideTextCommand{\texttrademark}{HE8}{\textsuperscript{\@latin{TM}}}
+%</HE8enc>
+% \end{macrocode}
+%
+% The hebrew points:
+% \begin{macrocode}
+%<*HE8enc>
+\DeclareTextSymbol{\sheva}{HE8}{192}
+\DeclareTextSymbol{\hatafsegol}{HE8}{193}
+\DeclareTextSymbol{\hatafpatah}{HE8}{194}
+\DeclareTextSymbol{\hatafqamats}{HE8}{195}
+\DeclareTextSymbol{\hiriq}{HE8}{196}
+\DeclareTextSymbol{\tsere}{HE8}{197}
+\DeclareTextSymbol{\segol}{HE8}{198}
+\DeclareTextSymbol{\patah}{HE8}{199}
+\DeclareTextSymbol{\qamats}{HE8}{200}
+\DeclareTextSymbol{\holam}{HE8}{201}
+\DeclareTextSymbol{\qubuts}{HE8}{203}
+\DeclareTextSymbol{\dagesh}{HE8}{204}
+\DeclareTextSymbol{\meteg}{HE8}{205}
+\DeclareTextSymbol{\maqaf}{HE8}{206}
+\DeclareTextSymbol{\rafe}{HE8}{207}
+\DeclareTextSymbol{\paseq}{HE8}{208}
+\DeclareTextSymbol{\shindot}{HE8}{209}
+\DeclareTextSymbol{\sindot}{HE8}{210}
+\DeclareTextSymbol{\sofpasuq}{HE8}{211}
+\DeclareTextSymbol{\doublevav}{HE8}{212}
+\DeclareTextSymbol{\vavyod}{HE8}{213}
+\DeclareTextSymbol{\doubleyod}{HE8}{214}
+%</HE8enc>
+% \end{macrocode}
+%
+% Hebrew letters occupy the positions 224--250 in \HEH{} encoding [WHAT
+% ABOUT OTHER MARKS]:
+% \begin{macrocode}
+%<*HE8enc>
+% \lccode``=`` % probably not needed (Tzafrir)
+\DeclareTextSymbol{\hebalef}{HE8}{224}
+\DeclareTextSymbol{\hebbet}{HE8}{225}
+\DeclareTextSymbol{\hebgimel}{HE8}{226}
+\DeclareTextSymbol{\hebdalet}{HE8}{227}
+\DeclareTextSymbol{\hebhe}{HE8}{228}
+\DeclareTextSymbol{\hebvav}{HE8}{229}
+\DeclareTextSymbol{\hebzayin}{HE8}{230}
+\DeclareTextSymbol{\hebhet}{HE8}{231}
+\DeclareTextSymbol{\hebtet}{HE8}{232}
+\DeclareTextSymbol{\hebyod}{HE8}{233}
+\DeclareTextSymbol{\hebfinalkaf}{HE8}{234}
+\DeclareTextSymbol{\hebkaf}{HE8}{235}
+\DeclareTextSymbol{\heblamed}{HE8}{236}
+\DeclareTextSymbol{\hebfinalmem}{HE8}{237}
+\DeclareTextSymbol{\hebmem}{HE8}{238}
+\DeclareTextSymbol{\hebfinalnun}{HE8}{239}
+\DeclareTextSymbol{\hebnun}{HE8}{240}
+\DeclareTextSymbol{\hebsamekh}{HE8}{241}
+\DeclareTextSymbol{\hebayin}{HE8}{242}
+\DeclareTextSymbol{\hebfinalpe}{HE8}{243}
+\DeclareTextSymbol{\hebpe}{HE8}{244}
+\DeclareTextSymbol{\hebfinaltsadi}{HE8}{245}
+\DeclareTextSymbol{\hebtsadi}{HE8}{246}
+\DeclareTextSymbol{\hebqof}{HE8}{247}
+\DeclareTextSymbol{\hebresh}{HE8}{248}
+\DeclareTextSymbol{\hebshin}{HE8}{249}
+\DeclareTextSymbol{\hebtav}{HE8}{250}
+%</HE8enc>
+% \end{macrocode}
+% Letter |\hebsin| is defined as a synonym of |\hebshin|:
+% \begin{macrocode}
+%<+HE8enc>\let\hebsin=\hebshin
+% \end{macrocode}
+%
+% \subsection{The font definition files (in \HEH{} encoding)}
+%
+% \subsubsection{Hebrew default font}
+%
+% It uses \emph{OmegaHebrew} font for regular font, \emph{Old
+% Jaffa} font for italic shape and small-caps, \emph{Dead Sea}
+% font for bold face, and \emph{Tel-Aviv} for bold-italic
+% \begin{macrocode}
+%<*HE8cmr>
+\DeclareFontFamily{HE8}{cmr}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmr}{m}{n}
+ {<-> david }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmr}{m}{it}
+ {<-> davidi }{}
+\DeclareFontShape{HE8}{cmr}{m}{sl}
+ {<-> davidi }{}
+\DeclareFontShape{HE8}{cmr}{m}{sc}
+ {<-> david }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmr}{bx}{n}
+ {<-> davidb }{}
+\DeclareFontShape{HE8}{cmr}{b}{n}
+ {<-> davidb }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmr}{bx}{sl}
+ {<-> davidbi }{}
+\DeclareFontShape{HE8}{cmr}{bx}{it}
+ {<-> davidbi }{}
+%</HE8cmr>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew sans-serif font}
+%
+% Until we have a real sans-serif font in this distribution, this file
+% will remain a copy of the roman fonts definitons above.
+% \begin{macrocode}
+%<*HE8cmss>
+\DeclareFontFamily{HE8}{cmss}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmss}{m}{n}
+ {<-> nachlieli }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmss}{m}{it}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{m}{sl}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{m}{sc}
+ {<-> nachlieli }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmss}{bx}{n}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{b}{n}
+ {<-> nachlieli }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmss}{bx}{sl}
+ {<-> nachlieli }{}
+\DeclareFontShape{HE8}{cmss}{bx}{it}
+ {<-> nachlieli }{}
+%</HE8cmss>
+% \end{macrocode}
+%
+% \subsubsection{Hebrew typewriter font}
+%
+% Until we have a real sans-serif font in this distribution, this file
+% will remain a copy of the roman fonts definitons above.
+% \begin{macrocode}
+%<*HE8cmtt>
+\DeclareFontFamily{HE8}{cmtt}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{cmtt}{m}{n}
+ {<-> miriam }{}
+%%%%%%% Italicized shape
+\DeclareFontShape{HE8}{cmtt}{m}{it}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{m}{sl}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{m}{sc}
+ {<-> miriam }{}
+%%%%%%% Bold extended series
+\DeclareFontShape{HE8}{cmtt}{bx}{n}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{b}{n}
+ {<-> miriam }{}
+%%%%%%% Bold extended (Italic) series
+\DeclareFontShape{HE8}{cmtt}{bx}{sl}
+ {<-> miriam }{}
+\DeclareFontShape{HE8}{cmtt}{bx}{it}
+ {<-> miriam }{}
+%</HE8cmtt>
+% \end{macrocode}
+%
+% \subsubsection{8Bit OmegaHebrew font}
+%
+% \emph{OmegaHebrew} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8OmegaHebrew>
+\def\OmegaHebrewscale{0.9}
+\DeclareFontFamily{HE8}{OmegaHebrew}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{OmegaHebrew}{m}{n}{<-> [\OmegaHebrewscale] OmegaHebrew }{}
+%\endinput % is it needed [tzafrir]
+%</HE8OmegaHebrew>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Aharoni font}
+%
+% \emph{Aharoni} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8aharoni>
+\def\Aharoniscale{1.0}
+\DeclareFontFamily{HE8}{aharoni}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{aharoni}{m}{n} {<-> [\Aharoniscale] aharoni}{}
+\DeclareFontShape{HE8}{aharoni}{m}{it} {<-> [\Aharoniscale] aharonii}{}
+\DeclareFontShape{HE8}{aharoni}{m}{sl} {<-> [\Aharoniscale] aharonii}{}
+\DeclareFontShape{HE8}{aharoni}{b}{n} {<-> [\Aharoniscale] aharonib}{}
+\DeclareFontShape{HE8}{aharoni}{bx}{n} {<-> [\Aharoniscale] aharonib}{}
+\DeclareFontShape{HE8}{aharoni}{bx}{it} {<-> [\Aharoniscale] aharonibi}{}
+
+%\endinput % is it needed [tzafrir]
+%</HE8aharoni>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit David font}
+%
+% \emph{David} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8david>
+\def\Davidscale{1.0}
+\DeclareFontFamily{HE8}{david}{\hyphenchar\font45}
+
+\DeclareFontShape{HE8}{david}{m}{n} {<-> [\Davidscale] david}{}
+\DeclareFontShape{HE8}{david}{m}{it} {<-> [\Davidscale] davidi}{}
+\DeclareFontShape{HE8}{david}{m}{sl} {<-> [\Davidscale] davidi}{}
+\DeclareFontShape{HE8}{david}{b}{n} {<-> [\Davidscale] davidb}{}
+\DeclareFontShape{HE8}{david}{bx}{n} {<-> [\Davidscale] davidb}{}
+\DeclareFontShape{HE8}{david}{bx}{it} {<-> [\Davidscale] davidbi}{}
+
+
+%\endinput % is it needed [tzafrir]
+%</HE8david>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Drugulin font}
+%
+% \emph{Drugulin} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8drugulin>
+\def\Drugulinscale{1.0}
+\DeclareFontFamily{HE8}{drugulin}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{drugulin}{m}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{m}{it} {<-> [\Drugulinscale] drugulinbi}{}
+\DeclareFontShape{HE8}{drugulin}{m}{sl} {<-> [\Drugulinscale] drugulinbi}{}
+\DeclareFontShape{HE8}{drugulin}{b}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{bx}{n} {<-> [\Drugulinscale] drugulinb}{}
+\DeclareFontShape{HE8}{drugulin}{bx}{it} {<-> [\Drugulinscale] drugulinbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8drugulin>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Ellinia font}
+%
+% \emph{Ellinia} is a sans-serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8ellinia>
+\def\Elliniascale{1.0}
+\DeclareFontFamily{HE8}{ellinia}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{ellinia}{m}{n} {<-> [\Elliniascale] ellinia}{}
+\DeclareFontShape{HE8}{ellinia}{m}{it} {<-> [\Elliniascale] elliniai}{}
+\DeclareFontShape{HE8}{ellinia}{m}{sl} {<-> [\Elliniascale] elliniai}{}
+\DeclareFontShape{HE8}{ellinia}{b}{n} {<-> [\Elliniascale] elliniab}{}
+\DeclareFontShape{HE8}{ellinia}{bx}{n} {<-> [\Elliniascale] elliniab}{}
+\DeclareFontShape{HE8}{ellinia}{bx}{it} {<-> [\Elliniascale] elliniabi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8ellinia>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit FrankRuehl font}
+%
+% \emph{FrankRuehl} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8frankruehl>
+\def\FrankRuehlscale{1.0}
+\DeclareFontFamily{HE8}{frank}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{frank}{m}{n} {<-> [\FrankRuehlscale] frank}{}
+\DeclareFontShape{HE8}{frank}{m}{it} {<-> [\FrankRuehlscale] franki}{}
+\DeclareFontShape{HE8}{frank}{m}{sl} {<-> [\FrankRuehlscale] franki}{}
+\DeclareFontShape{HE8}{frank}{b}{n} {<-> [\FrankRuehlscale] frankb}{}
+\DeclareFontShape{HE8}{frank}{bx}{n} {<-> [\FrankRuehlscale] frankb}{}
+\DeclareFontShape{HE8}{frank}{bx}{it} {<-> [\FrankRuehlscale] frankbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8frankruehl>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit KtavYad font}
+%
+% \emph{KtavYad} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8yad>
+\def\KtavYadscale{1.0}
+\DeclareFontFamily{HE8}{yad}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{yad}{m}{n} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{m}{it} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{m}{sl} {<-> [\KtavYadscale] yadi}{}
+\DeclareFontShape{HE8}{yad}{b}{n} {<-> [\KtavYadscale] yadbi}{}
+\DeclareFontShape{HE8}{yad}{bx}{n} {<-> [\KtavYadscale] yadbi}{}
+\DeclareFontShape{HE8}{yad}{bx}{it} {<-> [\KtavYadscale] yadbi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8yad>
+% \end{macrocode}
+%
+% \subsubsection{8Bit MiriamMono font}
+%
+% \emph{MiriamMono} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8miriam>
+\def\MiriamMonoscale{1.0}
+\DeclareFontFamily{HE8}{miriam}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{miriam}{m}{n} {<-> [\MiriamMonoscale] miriam}{}
+\DeclareFontShape{HE8}{miriam}{m}{it} {<-> [\MiriamMonoscale] miriami}{}
+\DeclareFontShape{HE8}{miriam}{m}{sl} {<-> [\MiriamMonoscale] miriami}{}
+\DeclareFontShape{HE8}{miriam}{b}{n} {<-> [\MiriamMonoscale] miriamb}{}
+\DeclareFontShape{HE8}{miriam}{bx}{n} {<-> [\MiriamMonoscale] miriamb}{}
+\DeclareFontShape{HE8}{miriam}{bx}{it} {<-> [\MiriamMonoscale] miriambi}{}
+
+%\endinput % is it needed [tzafrir]
+%</HE8miriam>
+% \end{macrocode}
+%
+%
+% \subsubsection{8Bit Nachlieli font}
+%
+% \emph{Nachlieli} is a serif hebrew font created by the omega project
+% [FILL IN CREDITS]
+% [FILL IN GENERAL SHAPE DESCRIPTION]
+% shapes: [FILL IN]
+%
+% \begin{macrocode}
+%<*HE8nachlieli>
+\def\Nachlieliscale{1.0}
+\DeclareFontFamily{HE8}{nachlieli}{\hyphenchar\font45}
+\DeclareFontShape{HE8}{nachlieli}{m}{n} {<-> [\Nachlieliscale] nachlieli}{}
+\DeclareFontShape{HE8}{nachlieli}{m}{it} {<-> [\Nachlieliscale] nachlielii}{}
+\DeclareFontShape{HE8}{nachlieli}{m}{sl} {<-> [\Nachlieliscale] nachlielii}{}
+\DeclareFontShape{HE8}{nachlieli}{b}{n} {<-> [\Nachlieliscale] nachlielib}{}
+\DeclareFontShape{HE8}{nachlieli}{bx}{n} {<-> [\Nachlieliscale] nachlielib}{}
+\DeclareFontShape{HE8}{nachlieli}{bx}{it} {<-> [\Nachlieliscale] nachlielibi}{}
+%\endinput % is it needed [tzafrir]
+%</HE8nachlieli>
+% \end{macrocode}
+%
+%
+% \subsubsection{Hebrew font switching commands}
+%
+% The \pkg{hebfont} package defines a number of high-level commands
+% (all starting with |\text..| similar to the standard \LaTeXe{}
+% font-change commands, for example |\textbf|) that have one
+% argument and typeset this argument in the requested way. These
+% commands are defined for all available Hebrew fonts defined above
+% and change only font parameters but not direction.
+%
+% For example, to use Hebrew Classic font family, the following
+% sequence of commands should be included in a \LaTeXe{} document:
+% \begin{quote}
+% |\sethebrew|\\
+% |\textclas{Hebrew text printed with Classic fonts}|
+% \end{quote}
+% or to use Hebrew with Classic fonts locally:
+% \begin{quote}
+% |\R{\textclas{Hebrew text printed with Classic fonts}}|
+% \end{quote}
+%
+% \begin{table}[t]
+% \begin{center}
+% \begin{tabular}{lll}
+% \textit{Command} & \textit{Corresponds to} &
+% \textit{Font family} \\[4pt]
+% |\textjm{..}| & |\rmfamily| & Jerusalem font \\
+% |\textds{..}| & |\bfseries| & Dead Sea font \\
+% |\textoj{..}| & |\itshape| & Old Jaffa font \\
+% & |\slshape| & \\
+% & |\emph| & \\
+% |\textta{..}| & |\sffamily| & Tel-Aviv font \\
+% & |\ttfamily| & \\[2pt]
+% |\textcrml{..}| & |\fontfamily{crml}| & Carmel fonts \\[2pt]
+% |\textfr{..}| & |\fontfamily{fr}| & Frank-Ruehl fonts \\[2pt]
+% |\textredis{..}| & |\fontfamily{redis}| & Redis fonts \\[2pt]
+% |\textclas{..}| & |\fontfamily{redis}| & Classic fonts \\[2pt]
+% |\textshold{..}| & |\fontfamily{shold}| & Shalom Old Style font \\
+% |\textshscr{..}| & |\fontfamily{shscr}| & Shalom Script font \\
+% |\textshstk{..}| & |\fontfamily{shstk}| & Shalom Stick font
+% \end{tabular}
+% \end{center}
+% \caption{Hebrew font-change commands with arguments}
+% \label{tab:fntcmds}
+% \begin{quote}
+% The font change commands provided here all start with |\text..|
+% to emphasize that they are for use in normal text and to be
+% easily memorable.
+% \end{quote}
+% \end{table}
+%
+% We declare \LaTeXe{} font commands, e.g.\ |\textjm{|\ldots|}|
+% for all available fonts. Table~\ref{tab:fntcmds} shows the
+% meanings of all these new high-level commands.
+%
+% \begin{macro}{\textjm}
+% Switches to \emph{Jerusalem} font which is default regular Hebrew
+% font (``roman'' family). Commands |\textrm{|\ldots|}| and
+% old-style |{\rm |\ldots|}| will produce the same result.
+% \begin{macrocode}
+%<*hebfont>
+\def\ivritex@tmp{HE8}
+\ifx\ivritex@tmp\HeblatexEncoding %
+ % compatibility with hebfonts:
+ \DeclareTextFontCommand{\textjm}{\rmfamily\selectfont}
+ \DeclareTextFontCommand{\textds}{\bfseries\selectfont}
+ \DeclareTextFontCommand{\textoj}{\itshape\selectfont}
+ \DeclareTextFontCommand{\textta}{\sffamily\selectfont}
+
+ % an attempt to give some replacements to the original hebfonts:
+ %
+ \DeclareTextFontCommand{\textcrml}{\fontfamily{david}\selectfont}
+ \DeclareTextFontCommand{\textfr}{\fontfamily{frank}\selectfont}
+ \DeclareTextFontCommand{\textredis}{\fontfamily{aharoni}\selectfont}
+ \DeclareTextFontCommand{\textclas}{\fontfamily{drugulin}\selectfont}
+ \DeclareTextFontCommand{\textshold}{\fontfamily{frank}\selectfont}
+ \DeclareTextFontCommand{\textshscr}{\fontfamily{yad}\selectfont}
+ \DeclareTextFontCommand{\textshstk}{\fontfamily{aharoni}\selectfont}
+ % note that redis is larger than shstk
+
+
+ \DeclareTextFontCommand{\textaha}{\fontfamily{aharoni}\selectfont}
+ \DeclareTextFontCommand{\textdav}{\fontfamily{david}\selectfont}
+ \DeclareTextFontCommand{\textdru}{\fontfamily{drugulin}\selectfont}
+ \DeclareTextFontCommand{\textel} {\fontfamily{ellinia}\selectfont}
+ % \textfr is already declared above
+ \DeclareTextFontCommand{\textmir}{\fontfamily{miriam}\selectfont}
+ \DeclareTextFontCommand{\textna} {\fontfamily{nachlieli}\selectfont}
+ % is this necessary:
+ \DeclareTextFontCommand{\textyad} {\fontfamily{yad}\selectfont}
+
+\else%
+\DeclareTextFontCommand{\textjm}{\rmfamily\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textds}
+% Switches to \emph{Dead Sea} font which is default bold font in
+% Hebrew. Commands |\textbf{|\ldots|}| and old-style
+% |{\bf |\ldots|}| will produce the same result.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textds}{\bfseries\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textoj}
+% Switches to \emph{Old Jaffa} font which is default italic font in
+% Hebrew. Commands |\textit{|\ldots|}|, |\textsl{|\ldots|}|,
+% |\emph{|\ldots|}| and old-style |{\it |\ldots|}| or
+% |{\em |\ldots|}| will produce the same result.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textoj}{\itshape\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textta}
+% Switches to \emph{Tel-Aviv} font which is default sans-serif font
+% in Hebrew. Commands |\textsf{|\ldots|}|, |\texttt{|\ldots|}| and
+% old-style |{\sf |\ldots|}| or |{\tt |\ldots|}| will produce the
+% same result (because sans-serif is used as typewriter font when
+% in Hebrew mode).
+% \begin{macrocode}
+\DeclareTextFontCommand{\textta}{\sffamily\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textcrml}
+% Switches to \emph{Carmel} font. Regular and slanted variants of
+% carmel font will be used..
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcrml}{\fontfamily{crml}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textfr}
+% Switches to \emph{Frank-Ruehl} font family. Regular, bold and
+% slanted frank ruehl fonts will be used.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textfr}{\fontfamily{fr}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textredis}
+% Switches to \emph{Redis} font family. Regular, bold and slanted
+% redis fonts of various sizes will be used.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textredis}{\fontfamily{redis}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textclas}
+% Switches to \emph{Classic} font family. The normal font will be
+% hclassic and slanted --- hcaption.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textclas}{\fontfamily{clas}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshold}
+% Switches to \emph{Shalom Old Style} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshold}{\fontfamily{shold}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshscr}
+% Switches to \emph{Shalom Script} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshscr}{\fontfamily{shscr}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textshstk}
+% Switches to \emph{Shalom Stick} font.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textshstk}{\fontfamily{shstk}\selectfont}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Finally, for backward compatibility with \LaTeX2.09. four old
+% font commands, e.g.\ |{\jm |\ldots|}| are defined too (see
+% Table~\ref{tab:oldcmds}).
+% \begin{table}[t]
+% \begin{center}
+% \begin{tabular}{lll}
+% \textit{Old font command} & \textit{Font name} &
+% \textit{Comment}\\[4pt]
+% |{\jm ..}| & Jerusalem & default regular (roman) font \\
+% |{\ds ..}| & Dead Sea & default bold font \\
+% |{\oj ..}| & Old Jaffa & default italic and slanted font \\
+% & & used also to emphasize text \\
+% |{\ta ..}| & Tel-Aviv & default sans-serif and typewriter font\\
+% \end{tabular}
+% \end{center}
+% \caption{Hebrew old font-change commands for compatibility mode}
+% \label{tab:oldcmds}
+% \end{table}
+% \begin{macrocode}
+\if@compatibility
+ \DeclareOldFontCommand{\jm}{\normalfont\rmfamily\selectfont}%
+ {\@nomath\jm}
+ \DeclareOldFontCommand{\ds}{\normalfont\bfseries\selectfont}%
+ {\@nomath\ds}
+ \DeclareOldFontCommand{\oj}{\normalfont\itshape\selectfont}%
+ {\@nomath\oj}
+ \DeclareOldFontCommand{\ta}{\normalfont\sffamily\selectfont}%
+ {\@nomath\ta}
+\fi
+%</hebfont>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebrew.ins b/macros/latex/contrib/babel-contrib/hebrew/hebrew.ins
new file mode 100644
index 0000000000..80f35a41ec
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebrew.ins
@@ -0,0 +1,215 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+%%
+%% Copyright (C) 1997 -- 1998 Boris Lavva.
+%% Copyright (C) 1989 -- 2004 by Johannes Braams,
+%% TeXniek
+%% All rights reserved.
+%%
+%% This file is contributed to the `babel' system.
+%%
+%% You are allowed to distribute this file together with all files
+%% mentioned in manifest.bbl.
+%%
+%% You are not allowed to modify its contents.
+%%
+\def\filedate{2004/02/20}
+\def\batchfile{hebrew.ins}
+\input docstrip
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+
+This is a generated file.
+
+Copyright 1997-2004 Boris Lavva and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+
+This is a generated file.
+
+Copyright 1997-2004 Boris Lavva and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\Msg{*** Generating hebrew font encoding files ***}
+\usepreamble\fdpreamble
+\generate{\file{lheenc.def}{\from{hebrew.fdd}{LHEenc}}
+ \file{lhecmr.fd}{\from{hebrew.fdd}{LHEcmr,nowarn}}
+ \file{lhecmss.fd}{\from{hebrew.fdd}{LHEcmss,nowarn}}
+ \file{lhecmtt.fd}{\from{hebrew.fdd}{LHEcmtt,nowarn}}
+ \file{lheclas.fd}{\from{hebrew.fdd}{LHEclas,nowarn}}
+ \file{he8enc.def}{\from{hebrew.fdd}{HE8enc}}
+ \file{he8cmr.fd}{\from{hebrew.fdd}{HE8cmr,nowarn}}
+ \file{he8cmss.fd}{\from{hebrew.fdd}{HE8cmss,nowarn}}
+ \file{he8cmtt.fd}{\from{hebrew.fdd}{HE8cmtt,nowarn}}
+ \file{he8aharoni.fd}{\from{hebrew.fdd}{HE8aharoni,nowarn}}
+ \file{he8david.fd}{\from{hebrew.fdd}{HE8david,nowarn}}
+ \file{he8drugulin.fd}{\from{hebrew.fdd}{HE8drugulin,nowarn}}
+ \file{he8frankruehl.fd}{\from{hebrew.fdd}{HE8frankruehl,nowarn}}
+ \file{he8yad.fd}{\from{hebrew.fdd}{HE8yad,nowarn}}
+ \file{he8miriam.fd}{\from{hebrew.fdd}{HE8miriam,nowarn}}
+ \file{he8nachlieli.fd}{\from{hebrew.fdd}{HE8nachlieli,nowarn}}
+ \file{he8OmegaHebrew.fd}{\from{hebrew.fdd}{HE8OmegaHebrew,nowarn}}
+ \file{lheshold.fd}{\from{hebrew.fdd}{LHEshold,nowarn}}
+ \file{lheshscr.fd}{\from{hebrew.fdd}{LHEshscr,nowarn}}
+ \file{lheshstk.fd}{\from{hebrew.fdd}{LHEshstk,nowarn}}
+ \file{lhefr.fd}{\from{hebrew.fdd}{LHEfr,nowarn}}
+ \file{lhecrml.fd}{\from{hebrew.fdd}{LHEcrml,nowarn}}
+ \file{lheredis.fd}{\from{hebrew.fdd}{LHEredis,nowarn}}
+ \file{hebfont.sty}{\from{hebrew.fdd}{hebfont}}
+ }
+
+\Msg{*** Generating hebrew input encoding files ***}
+\usepreamble\mainpreamble
+\generate{\file{8859-8.def}{\from{hebinp.dtx}{8859-8}}
+ \file{cp1255.def}{\from{hebinp.dtx}{cp1255}}
+ \file{cp862.def}{\from{hebinp.dtx}{cp862}}
+ \file{si960.def}{\from{hebinp.dtx}{si960}}
+ }
+
+\Msg{*** Generating hebrew language support files ***}
+\generate{\file{hebrew.ldf}{\from{hebrew.dtx}{hebrew}}
+ \file{rlbabel.def}{\from{hebrew.dtx}{rightleft}}
+ \file{hebcal.sty}{\from{hebrew.dtx}{calendar}}
+ }
+
+\Msg{*** Generating hebrew 2.09 compatibility files ***}
+\generate{\file{hebrew_newcode.sty}{\from{heb209.dtx}{newcode}}
+ \file{hebrew_p.sty}{\from{heb209.dtx}{pccode}}
+ \file{hebrew_oldcode.sty}{\from{heb209.dtx}{oldcode}}
+ }
+
+\ifToplevel{
+\Msg{*************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.cls, *.sty, *.ldf, *.fd and *.def}
+\Msg{*}
+\Msg{* To produce the documentation run `hebrew.dtx' through LaTeX}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*************************************************************}
+}
+
+\endbatchfile
diff --git a/macros/latex/contrib/babel-contrib/hebrew/hebrew.pdf b/macros/latex/contrib/babel-contrib/hebrew/hebrew.pdf
new file mode 100644
index 0000000000..4e46d124d9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hebrew/hebrew.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/hungarian/README b/macros/latex/contrib/babel-contrib/hungarian/README
new file mode 100644
index 0000000000..e86990a763
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hungarian/README
@@ -0,0 +1,18 @@
+This is the new version 1.5 for Hungarian in LaTeX. See more info about
+Hungarian typography in LaTeX in our TUG 2004 article:
+http://www.math.bme.hu/latex/dl/pts_tug2004_magyarldf2.pdf .
+There is a longer user manual in Hungarian:
+http://math.bme.hu/latex/magyarldf-doc.pdf .
+
+This file is intended to be part of the standard Babel system, but the
+maintainer of Babel has not had time to incorporate it into the
+official distribution.
+
+Users are urged to report their experiences with the package to the
+maintainer of Babel as well as to the author of the package. The
+maintainer of Babel is interested in positive feedback about the
+package as well as problems.
+
+Usage:
+
+ \usepackage[magyar]{babel}
diff --git a/macros/latex/contrib/babel-contrib/hungarian/magyar.ldf b/macros/latex/contrib/babel-contrib/hungarian/magyar.ldf
new file mode 100644
index 0000000000..18158434e4
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/hungarian/magyar.ldf
@@ -0,0 +1,5901 @@
+% -*- coding: iso-8859-2 -*-
+%
+% magyar.ldf -- LaTeX Language Definition for `magyar' (Hungarian), v1.5c
+% written and copyright (C) by P\'eter SZAB\'O <pts@fazekas.hu>
+% (version 1.5 -- Early October 2003 -- February 2004 --)
+%
+% The newest version of this magyar.ldf is part of MagyarLaTeX, available from
+% http://www.math.bme.hu/latex/ . The web page is in Hungarian language, but
+% it is easy to figure out how to download the newest magyar.ldf. Please
+% bookmark this link as the definitive source of the newest version.
+%
+% This program is free software. There is NO WARRANTY. Use at your own risk!
+% You can choose any of these licenses: GNU GPL, LaTeX's license,
+% Babel's license.
+%
+% When will magyar.ldf 1.5 be part of mainstream LaTeX / Babel? I have no
+% idea, ask the maintainer of Babel. magyar.ldf 1.5 has ptebeen converted to
+% magyar.dtx on June 27, 2004. That version has been submitted to the
+% maintainer of the Babel package. No reply from him since then.
+%
+% Should magyar.ldf 1.5 be part of tetex, or should it be available as a
+% supplementary package in TeX distributions? Yes, but this is the task of the
+% creators of those distributions. The Debian package ``magyarlatex'',
+% which supplements the teTeX shipped with Debian Woody, Sarge and Sid,
+% is available from http://www.math.bme.hu/latex/dl
+% (file magyarlatex-latest.deb).
+%
+% The author of magyar.ldf 1.5 has uploaded it to CTAN
+% (http://www.ctan.org), but he doesn't re-upload regularly, because he
+% doesn't have time to maintain it and re-upload it after each bugfix. If
+% you think that magyar.ldf 1.5 should be on CTAN, feel free to upload a
+% snapshot, since it is free software.
+%
+% magyar.ldf 1.5 is based on magyar.ldf 1.4. However, it has been totally
+% rewritten and extended (just compare the file sizes), and it doesn't share
+% code from the earlier versions anymore. However, its default configuration
+% tries to be compatible with older versions.
+%
+% Earlier versions of file `magyar.dtx' Babel package for LaTeX version 2e
+% Copyright (C) 1989--2004 by Johannes Braams, TeXniek
+% Copyright (C) 1989--2004 by
+% \'Arp\'ad B\'IR\'O
+% J\'ozsef B\'ERCES (version 1.4c -- 2001; contains a lot of work of him)
+%
+% To typeset text in Hungarian, please
+%
+% 1. Include `magyar huhyph.tex' in language.dat, re-run initex(1) (initex
+% 'latex.ini \dump') or pdfinitex(1), verify that running latex(1) displays
+% the word `magyar' in the line containing `hyphenation patterns' in its
+% console output.
+%
+% 2. In the document preamble, use
+%
+% \def\magyarOptions{defaults=hu-min}
+% \usepackage[magyar]{babel}
+% \usepackage{t1enc}% for automatic hyphenation of accented chars
+% \usepackage[latin2]{inputenc}% for typing chars
+%
+% This file is quite long, because it implements a lot of parametric features
+% related to typesetting Hungarian text with \LaTeX. Sorry.
+%
+% Motto: ``There is a lot to do in the future'' -- by Gyngyi Bujdos and
+% Ferenc Wettl in their conference proceedings article ``On the localization
+% of TeX in Hungary'', presented at EuroBachoTeX 2002.
+%
+% Most of the code and comments in this file are written by P\'eter Szab\'o.
+% The newest version is available from http://www.math.bme.hu/latex/
+%
+% The version of this file is 1.5, even when new releases come out. Please see
+% the \expandafter\ProvidesLanguage line for the release date.
+%
+
+\expandafter\ifx\csname CurrentOption\endcsname\relax
+ \def\CurrentOption{magyar}%
+\fi
+%** So `\input magyar.ldf' will work as well.
+\expandafter\ifx\csname ver@babel.sty\endcsname\relax
+ \csname fi\endcsname
+ \endinput \expandafter\RequirePackage\expandafter[\CurrentOption]{babel}
+\fi
+
+%\ProvidesFile{magyar.ldf}[1996/12/23 v1.3h Magyar support from the babel system]
+%\ProvidesLanguage{magyar}[2001/03/05 v1.4c Magyar support from the babel system]
+% vvv for Babel v3.7
+\expandafter\ProvidesLanguage\expandafter{\CurrentOption}[2019/01/14 v1.5c Magyar (Hungarian) support for babel]
+
+% Possibly do \endinput if .ldf already loaded
+\expandafter\LdfInit\expandafter{\CurrentOption}{captions\CurrentOption}%
+
+% Fix \catcodes{} possibly screwed up by other Babel languages.
+% Dat: \string`\string! could have been written as \string`!
+\edef\@@magyar@restcats{%
+ \catcode\string`\string`\the\catcode\string``\space\space
+ \catcode\string`\string!\the\catcode\string`!\space\space
+ \catcode\string`\string*\the\catcode\string`*\space\space
+ \catcode\string`\string+\the\catcode\string`+\space\space
+ \catcode\string`\string-\the\catcode\string`-\space\space
+ \catcode\string`\string=\the\catcode\string`=\space\space
+ \catcode\string`\string|\the\catcode\string`|\space\space
+ \catcode\string`\string;\the\catcode\string`;\space\space
+ \catcode\string`\string:\the\catcode\string`:\space\space
+ \catcode\string`\string'\the\catcode\string`'\space\space
+ \catcode\string`\string"\the\catcode\string`"\space\space
+ \catcode\string`\string?\the\catcode\string`?\space\space
+ \catcode\string`\string/\the\catcode\string`/\space\space
+ \let\noexpand\@@magyar@restcats\noexpand\@undefined
+}
+\catcode\string``12 \catcode`!12 \catcode`*12 \catcode`+12 \catcode`-12
+\catcode`=12 \catcode`|12 \catcode`;12 \catcode`:12 \catcode`'12 \catcode`"12
+\catcode`?12 \catcode`/12
+
+%** Expand \CurrentOption early.
+\edef\@@magyar@error#1{\noexpand\PackageError{\CurrentOption.ldf}{#1}\noexpand\@ehc}
+
+% --- Declare options.
+%
+% Dat: \languageattribute{magyar}{...} and \bbl@declare@ttribute{magyar}{foo}{...}
+% isn't enough for us, because it is processed
+% after \usepackage[magyar]{babel}, but we need the options information
+% earlier. And also it cannot contain `='.
+%
+
+%** `\dMf foo-bar {...}' is `\def\foo-bar{...}' where `-' is a letter
+\def\dMf#1 {\expandafter\def\csname#1\endcsname}
+\def\magyar@@unchanged{unchanged}
+\def\magyar@enumarg#1#2{%
+ \expandafter\ifx\csname magyar@opt@#1@@#2\endcsname\relax
+ \@@magyar@error{Invalid arg for option: #1 = #2}%
+ \else
+ \csname magyar@opt@#1@@#2\endcsname
+ \fi
+}
+\def\@@magyar@argw@no {0}%
+\def\@@magyar@argw@weak{1}%
+\def\@@magyar@argw@yes {2}%
+\def\magyar@yesweaknoarg#1#2{%
+ \expandafter\ifx\csname @@magyar@argw@#2\endcsname\relax
+ \@@magyar@error{Invalid arg for option: #1 = #2\MessageBreak Must be =no, =yes or =weak}%
+ \else
+ \expandafter\edef\csname magyar@opt@@#1\endcsname{\csname @@magyar@argw@#2\endcsname}%
+ \fi
+}
+
+% Declare defaults.
+
+%** These defaults load most of the new functionality, but try not to
+%** introduce visible typographical changes over magyar.ldf v1.4. These
+%** are the ovarall defaults of magyar.ldf v1.5, in case of
+%** \def\magyarOptions{} (or if is missing).
+%**
+%** These are the defaults: (over-1.4)
+%** \def\magyarOptions{
+%** accents=defaulthigh, % or =high or =low
+%** active=safe, % or =problematic or =none or =onlycs
+%** activeprefix=babelopt2, % or =none or =babelopt3 or =grave or =acute or =quotedbl
+%** activespace=none, % or =safe or =problematic
+%** afterindent=unchanged, % or =force-no or =force-yes
+%** amslevelfix=fix-ams, % or =unchanged or =fix-all
+%** amsuppercasefix=fix-ams, % or =unchanged or =fix-all
+%** amstocnumskip=\enskip, % TeX code or --empty--
+%** amstocnumlang=all, % or =hu
+%** amspostsectiondot=no, % or =unchanged
+%** appendixdot=yes, % or =no % !! dokumentlni
+%** az=weak, % or =yes or =no
+%** babelmarkfix=yes, % or =unchanged
+%** captionfix=yes, % or =unchanged
+%** captions=hu, % or =unchanged
+%** chapterhead=yes, % or =unchanged(=no)
+%** chapternumber=unchanged, % see partnumber=
+%** cjhebrewfix=yes, % or =unchanged or =onlyouter
+%** classmod=yes, % or =unchanged(=no) or TeX class name
+%** %defaults=over-1.4, % or =compat-1.4 or =safest or =prettiest
+%** dottedtocline=fix, % or =unchanged
+%** emitdate=weak, % or =no or =yes
+%** extras=yes, % or =no
+%** fancyhdr=hu, % or =unchanged
+%** figurecaptions=hu, % or =us or =unchanged
+%** frenchspacing=unchanged, % or =no or =yes
+%** hang=weak, % or =no or =yes
+%** hunnewlabel=yes, % or =no or =only-hu
+%** hunumbers=yes, % or =no
+%** hutoday=yes, % or =no
+%** hyphenmins=22, % or =unchanged or two chars: \lefthyphenmin\righthyphenmin
+%** hyphenation=huhyph3, % or =none or =composite or =phonetic or =huhyphn
+%** hynumberline=unchanged, % or =hu
+%** labelenums=unchanged, % or =hu-a or =hu-A or =hu-d
+%** labelitems=unchanged, % or =hu
+%** longcaption=justified, % or =centered or =centernewline or =none (=unchanged)
+%** mathbrk=define, % or =unchanged or =fix
+%** mathhucomma=define, % or =unchanged or =fix
+%** mathfactorial=define, % or =unchanged or =fix
+%** mathmuskips=unchanged, % or =latex or =hu
+%** mathreal=weak, % or =no or =yes
+%** mond=weak, % or =no or =yes
+%** ntheoremfix=yes, % or =unchanged
+%** openqq=maybedown, % or =up or =down or =unchanged
+%** partnumber=unchanged, % or =huordinal or =Huordinal
+%** postdescription=unchanged, % see postpara=
+%** postpara=unchanged, % or =bfdot or =dot or =quad or =diamond or =enskip or =quad or =em or =empty ... (\magyar@post@...)
+%** postsubpara=unchanged, % see postpara=
+%** refstruc=weak, % or =no or =yes
+%** %safest=no, % or =yes (safest=no has no effect, safest=yes is equivalent to defaults=safest)
+%** sectiondot=safe, % or =none or =problematic
+%** shorthandcs=\shu, % or =none or a csname or a \cs, e.g shorthandcs=\shu
+%** shortrefcmds=yes, % or =no
+%** showfix=yes, % or =unchanged
+%** suggestions=yes, % or =no
+%** tablecaptions=hu, % or =us or =unchanged
+%** textqq=weak, % or =no or =yes
+%** theoremtitle=hu, % or =unchanged
+%** footnote=yes, % or =unchanged or =huplain or =starplain
+%** titles=\enskip, % TeX code: =unchanged, =\quad or other
+%** toclang=good, % or =badfloat or =badall or =unchanged
+%** told=weak, % or =no or =yes
+%** varioref=hu, % or =unchanged
+%** }\usepackage[magyar]{babel}
+\dMf magyar@opt@defaults@@over-1.4 {%
+ \magyar@opt@accents@@defaulthigh
+ \magyar@opt@active@@safe
+ \magyar@opt@activeprefix{activeprefix}{babelopt2}%
+ \magyar@opt@activespace@@none
+ \magyar@opt@afterindent@@unchanged
+ \magyar@opt@amslevelfix{amslevelfix}{fix-ams}%
+ \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}%
+ \magyar@opt@amspostsectiondot@@no% change over 1.4
+ \magyar@opt@amstocnumlang@@all
+ \magyar@opt@amstocnumskip{amstocnumskip}{\enskip}% change over 1.4
+ \magyar@opt@appendixdot@@yes
+ \magyar@opt@babelmarkfix@@yes
+ \magyar@opt@az{az}{weak}%
+ \magyar@opt@captionfix@@yes
+ \magyar@opt@captions@@hu
+ \magyar@opt@chapternumber@@unchanged
+ \magyar@opt@classmod@@yes
+ \magyar@opt@dottedtocline@@fix
+ \magyar@opt@emitdate{emitdate}{weak}%
+ \magyar@opt@extras@@yes
+ \magyar@opt@chapterhead@@yes
+ \magyar@opt@fancyhdr@@hu% change over 1.4
+ \magyar@opt@figurecaptions@@hu
+ \magyar@opt@footnote@@yes
+ \magyar@opt@frenchspacing@@unchanged
+ \magyar@opt@hang{hang}{weak}%
+ \magyar@opt@hunnewlabel@@yes
+ \magyar@opt@hunumbers@@yes
+ \magyar@opt@hutoday@@yes
+ \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}%
+ \magyar@opt@hyphenmins{hyphenmins}{22}% change over 1.4 Dat: Default LaTeX is {23}
+ \magyar@opt@labelenums@@unchanged
+ \magyar@opt@labelitems@@unchanged
+ \magyar@opt@longcaption@@justified
+ \magyar@opt@mathbrk@@define
+ \magyar@opt@mathfactorial@@define
+ \magyar@opt@mathhucomma@@define
+ \magyar@opt@mathmuskips@@unchanged
+ \magyar@opt@hynumberline@@unchanged
+ \magyar@opt@mathreal{mathreal}{weak}%
+ \magyar@opt@mond{mond}{weak}%
+ \magyar@opt@ntheoremfix@@yes
+ \magyar@opt@openqq@@maybedown
+ \magyar@opt@partnumber@@unchanged
+ \magyar@opt@postdescription{postdescription}{unchanged}%
+ \magyar@opt@postpara{postpara}{unchanged}%
+ \magyar@opt@postsubpara{postsubpara}{unchanged}%
+ \magyar@opt@refstruc{refstruc}{weak}%
+ \magyar@opt@sectiondot@@safe
+ \magyar@opt@shorthandcs{shorthandcs}{\shu}%
+ \magyar@opt@shortrefcmds@@yes
+ \magyar@opt@showfix@@yes
+ \magyar@opt@suggestions@@yes
+ \magyar@opt@tablecaptions@@hu
+ \magyar@opt@textqq{textqq}{weak}%
+ \magyar@opt@theoremtitle@@hu
+ \magyar@opt@titles{}{\enskip}% change over 1.4
+ \magyar@opt@toclang@@good
+ \magyar@opt@told{told}{weak}%
+ \magyar@opt@varioref@@hu
+ \magyar@opt@cjhebrewfix@@yes
+}
+
+%** These defaults try to be compatible with magyar.ldf v1.4 as much as
+%** possible -- but avoids stupid, problematic, dangerous implementation
+%** mistakes that would make magyar.ldf incompatible with many LaTeX
+%** packages. The purpose of compat-1.4 is to make the document compilable:
+%** if a fix would produce better results, but documents are compilable
+%** without the fix, the fix will not be applied in compat-1.4.
+%** Some very useful fixes are not applied here -- please use
+%** defaults=over-1.4 to have them. Also some very nice features such
+%** as \emitdate and \told are not available here.
+\dMf magyar@opt@defaults@@compat-1.4 {%
+ \magyar@opt@accents@@defaulthigh% OK
+ \magyar@opt@active@@safe% we don't want =problematic
+ \magyar@opt@activeprefix@@grave% OK
+ \magyar@opt@activespace@@none% OK
+ \magyar@opt@afterindent@@unchanged% OK
+ \magyar@opt@amslevelfix@@unchanged% OK
+ \magyar@opt@amsuppercasefix@@unchanged% OK
+ \magyar@opt@amspostsectiondot@@unchanged% OK
+ \magyar@opt@amstocnumlang@@all% OK, irrelevant
+ \magyar@opt@amstocnumskip{amstocnumskip}{}% OK
+ \magyar@opt@appendixdot@@yes
+ \magyar@opt@babelmarkfix@@unchanged
+ \magyar@opt@az{az}{yes}% OK
+ \magyar@opt@captionfix@@unchanged
+ \magyar@opt@captions@@hu% OK
+ \magyar@opt@chapterhead@@yes% OK
+ \magyar@opt@chapternumber@@unchanged% OK
+ \magyar@opt@classmod@@yes% OK
+ \magyar@opt@dottedtocline@@unchanged% OK
+ \magyar@opt@emitdate{emitdate}{no}% OK
+ \magyar@opt@extras@@yes% OK
+ \magyar@opt@fancyhdr@@unchanged% OK
+ \magyar@opt@figurecaptions@@hu% OK
+ \magyar@opt@footnote@@unchanged% OK
+ \magyar@opt@frenchspacing@@unchanged% OK
+ \magyar@opt@hang{hang}{no}% OK
+ \magyar@opt@hunnewlabel@@yes% OK
+ \magyar@opt@hunumbers@@no% OK
+ \magyar@opt@hutoday@@yes% OK
+ \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}% OK
+ \magyar@opt@hyphenmins{hyphenmins}{unchanged}%
+ \magyar@opt@labelenums@@unchanged% OK
+ \magyar@opt@labelitems@@unchanged% OK
+ \magyar@opt@longcaption@@justified% OK
+ \magyar@opt@mathbrk@@unchanged% OK
+ \magyar@opt@mathhucomma@@unchanged% OK
+ \magyar@opt@mathfactorial@@unchanged% OK
+ \magyar@opt@mathmuskips@@unchanged% OK
+ \magyar@opt@hynumberline@@unchanged% OK
+ \magyar@opt@mathreal{mathreal}{no}%
+ \magyar@opt@mond{mond}{no}% OK
+ \magyar@opt@ntheoremfix@@yes% OK
+ \magyar@opt@openqq@@maybedown% OK
+ \magyar@opt@partnumber@@unchanged% OK
+ \magyar@opt@postdescription{postdescription}{unchanged}% OK
+ \magyar@opt@postpara{postpara}{unchanged}% OK
+ \magyar@opt@postsubpara{postsubpara}{unchanged}% OK
+ \magyar@opt@refstruc{refstruc}{no}% OK
+ \magyar@opt@sectiondot@@safe% we don't want =problematic
+ \magyar@opt@shorthandcs{shorthandcs}{none}% OK
+ \magyar@opt@shortrefcmds@@yes% OK
+ \magyar@opt@showfix@@yes% OK
+ \magyar@opt@suggestions@@no% OK -- user has explicity requested defaults=compat-1.4
+ \magyar@opt@tablecaptions@@hu% OK
+ \magyar@opt@textqq{textqq}{no}% OK
+ \magyar@opt@theoremtitle@@hu% OK
+ \magyar@opt@titles{}{\quad}% OK -- ugly, but compatible
+ \magyar@opt@toclang@@good% we don't want weird errors and mischosen languages (would be =badall)
+ \magyar@opt@told{told}{no}% OK
+ \magyar@opt@varioref@@hu% was =unchanged, but varioref.sty (2000) is buggy
+ \magyar@opt@cjhebrewfix@@yes
+}
+
+%** These defaults turn of most features -- the effect is similar to as if
+%** magyar.ldf hasn't been loaded at all. Useful for debugging purposes.
+\def\magyar@opt@defaults@@safest{%
+ \magyar@opt@accents@@defaulthigh
+ \magyar@opt@active@@none
+ \magyar@opt@activeprefix@@none
+ \magyar@opt@activespace@@none
+ \magyar@opt@afterindent@@unchanged
+ \magyar@opt@amslevelfix@@unchanged
+ \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}%
+ \magyar@opt@amspostsectiondot@@unchanged
+ \magyar@opt@amstocnumlang@@all% OK, irrelevant
+ \magyar@opt@amstocnumskip{amstocnumskip}{}%
+ \magyar@opt@appendixdot@@yes
+ \magyar@opt@az{az}{no}%
+ \magyar@opt@babelmarkfix@@yes
+ \magyar@opt@captionfix@@yes
+ \magyar@opt@captions@@unchanged
+ \magyar@opt@chapternumber@@unchanged
+ \magyar@opt@classmod@@unchanged
+ \magyar@opt@dottedtocline@@unchanged
+ \magyar@opt@emitdate{emitdate}{no}%
+ \magyar@opt@extras@@no
+ \magyar@opt@chapterhead@@no
+ \magyar@opt@fancyhdr@@unchanged
+ \magyar@opt@figurecaptions@@unchanged
+ \magyar@opt@footnote@@unchanged
+ \magyar@opt@frenchspacing@@unchanged
+ \magyar@opt@hang{hang}{no}%
+ \magyar@opt@hunnewlabel@@no
+ \magyar@opt@hunumbers@@no
+ \magyar@opt@hutoday@@no
+ \magyar@opt@hyphenation{hyphenation}{huhyph3-or-any}%
+ \magyar@opt@hyphenmins{hyphenmins}{unchanged}%
+ \magyar@opt@labelenums@@unchanged
+ \magyar@opt@labelitems@@unchanged
+ \magyar@opt@longcaption@@unchanged
+ \magyar@opt@mathbrk@@unchanged
+ \magyar@opt@mathhucomma@@unchanged
+ \magyar@opt@mathfactorial@@unchanged
+ \magyar@opt@mathmuskips@@unchanged
+ \magyar@opt@hynumberline@@unchanged
+ \magyar@opt@mathreal{mathreal}{no}%
+ \magyar@opt@mond{mond}{no}%
+ \magyar@opt@ntheoremfix@@unchanged
+ \magyar@opt@openqq@@unchanged
+ \magyar@opt@partnumber@@unchanged
+ \magyar@opt@postdescription{postdescription}{unchanged}%
+ \magyar@opt@postpara{postpara}{unchanged}%
+ \magyar@opt@postsubpara{postsubpara}{unchanged}%
+ \magyar@opt@refstruc{refstruc}{no}%
+ \magyar@opt@sectiondot@@none
+ \magyar@opt@shorthandcs{shorthandcs}{none}%
+ \magyar@opt@shortrefcmds@@no
+ \magyar@opt@showfix@@unchanged
+ \magyar@opt@suggestions@@yes
+ \magyar@opt@tablecaptions@@unchanged
+ \magyar@opt@textqq{textqq}{no}%
+ \magyar@opt@theoremtitle@@unchanged
+ \magyar@opt@titles{}{unchanged}%
+ \magyar@opt@toclang@@unchanged
+ \magyar@opt@told{told}{no}%
+ \magyar@opt@varioref@@unchanged
+ \magyar@opt@cjhebrewfix@@unchanged
+}
+
+%** These defaults load almost all features, and try to do their best to make
+%** the document comply to the Hungarian typography standards. Full compliance
+%** is not achieved yet, and as new features are implemented, they will be
+%** added to these defaults.
+\def\magyar@opt@defaults@@prettiest{%
+ \magyar@opt@accents@@defaulthigh% {low} would have no effect with \usepackage{t1enc}
+ \magyar@opt@active@@safe
+ \magyar@opt@activeprefix{activeprefix}{babelopt2}%
+ \magyar@opt@activespace@@safe
+ \magyar@opt@afterindent@@unchanged% keep =force-no
+ \magyar@opt@amslevelfix{amslevelfix}{fix-ams}%
+ \magyar@opt@amsuppercasefix{amsuppercasefix}{fix-ams}%
+ \magyar@opt@amspostsectiondot@@no
+ \magyar@opt@amstocnumlang@@all
+ \magyar@opt@amstocnumskip{amstocnumskip}{\enskip}%
+ \magyar@opt@appendixdot@@no
+ \magyar@opt@az{az}{yes}%
+ \magyar@opt@babelmarkfix@@yes
+ \magyar@opt@captionfix@@yes
+ \magyar@opt@captions@@hu
+ \magyar@opt@chapternumber@@unchanged
+ \magyar@opt@classmod@@yes
+ \magyar@opt@dottedtocline@@fix
+ \magyar@opt@emitdate{emitdate}{yes}%
+ \magyar@opt@extras@@yes
+ \magyar@opt@chapterhead@@yes
+ \magyar@opt@fancyhdr@@hu
+ \magyar@opt@figurecaptions@@hu
+ \magyar@opt@footnote@@yes
+ \magyar@opt@frenchspacing@@yes
+ \magyar@opt@hang{hang}{yes}%
+ \magyar@opt@hunnewlabel@@yes
+ \magyar@opt@hunumbers@@yes
+ \magyar@opt@hutoday@@yes
+ \magyar@opt@hyphenation{hyphenation}{composite-or-any}%
+ \magyar@opt@hyphenmins{hyphenmins}{22}% Dat: Default LaTeX is {23}
+ \magyar@opt@labelenums{labelenums}{hu-a}%
+ \magyar@opt@labelitems@@hu
+ \magyar@opt@longcaption@@centered
+ \magyar@opt@mathbrk@@fix
+ \magyar@opt@mathhucomma@@fix
+ \magyar@opt@mathfactorial@@fix
+ \magyar@opt@mathmuskips@@hu
+ \magyar@opt@hynumberline@@hu
+ \magyar@opt@mathreal{mathreal}{yes}%
+ \magyar@opt@mond{mond}{yes}%
+ \magyar@opt@ntheoremfix@@yes
+ \magyar@opt@openqq@@maybedown
+ \magyar@opt@partnumber@@Huordinal
+ \magyar@opt@postdescription{postdescription}{dot}%
+ \magyar@opt@postpara{postpara}{diamond}%
+ \magyar@opt@postsubpara{postsubpara}{star}%
+ \magyar@opt@refstruc{refstruc}{yes}%
+ \magyar@opt@sectiondot@@safe
+ \magyar@opt@shorthandcs{shorthandcs}{\shu}%
+ \magyar@opt@shortrefcmds@@no
+ \magyar@opt@showfix@@yes
+ \magyar@opt@suggestions@@yes
+ \magyar@opt@tablecaptions@@hu
+ \magyar@opt@textqq{textqq}{yes}%
+ \magyar@opt@theoremtitle@@hu
+ \magyar@opt@titles{}{\enskip}%
+ \magyar@opt@toclang@@good
+ \magyar@opt@told{told}{yes}%
+ \magyar@opt@varioref@@hu
+ \magyar@opt@cjhebrewfix@@yes
+}
+
+%** Expands to the \magyarOptions changes defaults=hu-min makes over
+%** defaults=safest.
+\def\magyar@@humin@options{%
+ active=safe,
+ activeprefix=babelopt2,
+ activespace=safe,
+ amslevelfix=fix-ams,
+ amspostsectiondot=no,
+ amstocnumlang=all,
+ amstocnumskip=\enskip,
+ appendixdot=no,
+ az=weak,
+ captions=hu,
+ chapterhead=yes,
+ cjhebrewfix=yes,
+ classmod=yes,
+ classmod=yes,
+ dottedtocline=fix,
+ emitdate=weak,
+ extras=yes,
+ fancyhdr=hu,
+ figurecaptions=hu,
+ footnote=huplain,
+ frenchspacing=yes,
+ hang=weak,
+ hunnewlabel=yes,
+ hunumbers=yes,
+ hutoday=yes,
+ hynumberline=hu,
+ hyphenmins=22,
+ labelenums=hu-d,
+ labelitems=hu,
+ longcaption=centered,
+ mathbrk=fix,
+ mathfactorial=define,
+ mathhucomma=fix,
+ mathreal=weak,
+ mond=weak,
+ ntheoremfix=yes,
+ openqq=maybedown, % Not: openqq=unchanged
+ postdescription=dot,
+ postpara=diamond,
+ postsubpara=star,
+ refstruc=weak,
+ sectiondot=safe,
+ shorthandcs=\shu,
+ shortrefcmds=yes,
+ showfix=yes,
+ tablecaptions=hu,
+ textqq=weak,
+ theoremtitle=hu,
+ titles=\enskip,
+ toclang=good,
+ told=weak,
+ varioref=hu,
+}
+
+%** Matches Hungarian typographic rules most closely -- and most
+%** simplistically (minimally).
+\dMf magyar@opt@defaults@@hu-min {%
+ \magyar@opt@defaults@@safest
+ \expandafter\magyar@doopt\magyar@@humin@options\hfuzz,%
+}
+
+\def\magyarDumpHuMin{%
+ \begingroup
+ \typeout{}
+ \typeout{\expandafter\@gobble\string\% for defaults=hu-min}%
+ \typeout{\string\def\string\magyarOptions\expandafter\@gobble\string\{}%
+ \typeout{ \space defaults=safest,}%
+ \typeout{ \space\expandafter\@gobble\string\%}%
+ \def\magyar@applyopt##1##2{%
+ \def\reserved@a{##1=##2,}%
+ \typeout{ \space\expandafter\strip@prefix\meaning\reserved@a}%
+ }%
+ \expandafter\magyar@doopt\magyar@@humin@options\hfuzz,%
+ \typeout{\expandafter\@gobble\string\}}%
+ \typeout{\string\usepackage[magyar]{babel}}%
+ \typeout{}%
+ \endgroup
+}
+
+\let\magyar@opt@defaults\magyar@enumarg
+\def\magyar@opt@safest@@yes{\magyar@opt@defaults@@safest}
+\def\magyar@opt@safest@@no{}
+\let\magyar@opt@safest\magyar@enumarg
+
+% Declare normal options.
+
+\def\magyar@opt@titles#1#2{\def\magyar@opt@@titleskip{#2}}
+\def\@@magyar@twodigitcheck#1#2#3\hfuzz#4#5{%
+ \csname if\ifnum0<0\string#1 \ifnum0<0\string#2 false\else true\fi\else true\fi\endcsname
+ \@@magyar@error{Option #4 needs [1-9][1-9], got #1#2}%
+ \fi
+}
+\def\magyar@opt@hyphenmins#1#2{%
+ \def\reserved@a{#2}%
+ \ifx\reserved@a\magyar@@unchanged
+ \let\magyar@opt@@hyphenmins\@empty
+ \else
+ \@@magyar@twodigitcheck#2..\hfuzz{#1}{#2}%
+ \def\magyar@opt@@hyphenmins{#2}%
+ \fi
+}
+
+\def\magyar@opt@amstocnumskip#1#2{\def\magyar@opt@@amstocnumskip{#2}}
+\def\magyar@opt@amstocnumlang@@all{\def\magyar@opt@@amstocnumlang{2}}
+\def\magyar@opt@amstocnumlang@@hu {\def\magyar@opt@@amstocnumlang{1}}
+\let\magyar@opt@amstocnumlang\magyar@enumarg
+\def\magyar@opt@active@@none{\def\magyar@opt@@active{0}}
+\def\magyar@opt@active@@onlycs{\def\magyar@opt@@active{1}}
+\def\magyar@opt@active@@safe{\def\magyar@opt@@active{2}}
+\def\magyar@opt@active@@problematic{\def\magyar@opt@@active{3}}
+\let\magyar@opt@active\magyar@enumarg
+\def\magyar@opt@activeprefix@@none {\let\magyar@opt@@activeprefix\relax}
+\def\magyar@opt@activeprefix@@acute {\def\magyar@opt@@activeprefix{'}}
+\def\magyar@opt@activeprefix@@grave {\def\magyar@opt@@activeprefix{`}}
+\def\magyar@opt@activeprefix@@quotedbl{\def\magyar@opt@@activeprefix{"}}
+\dMf magyar@opt@activeprefix@@babelopt2 {%
+ \@ifpackagewith{babel}{activeacute}% Dat: not expandable
+ {\def\magyar@opt@@activeprefix{'}}%
+ {\def\magyar@opt@@activeprefix{`}}%
+}
+\dMf magyar@opt@activeprefix@@babelopt3 {%
+ \@ifpackagewith{babel}{activeacute}%
+ {\def\magyar@opt@@activeprefix{'}}%
+ {\@ifpackagewith{babel}{activegrave}%
+ {\def\magyar@opt@@activeprefix{`}}%
+ {\def\magyar@opt@@activeprefix{"}}}%
+}
+\let\magyar@opt@activeprefix\magyar@enumarg
+\def\magyar@opt@activespace@@none{\def\magyar@opt@@activespace{0}}
+\def\magyar@opt@activespace@@safe{\def\magyar@opt@@activespace{2}}
+\def\magyar@opt@activespace@@problematic{\def\magyar@opt@@activespace{3}}
+\let\magyar@opt@activespace\magyar@enumarg
+\def\magyar@opt@amspostsectiondot@@no {\def\magyar@opt@@amspostsectiondot{1}}
+\def\magyar@opt@amspostsectiondot@@unchanged{\def\magyar@opt@@amspostsectiondot{0}}
+\let\magyar@opt@amspostsectiondot\magyar@enumarg
+\let\magyar@opt@hyphenation\magyar@enumarg
+\def\magyar@opt@hyphenation@@huhyphf {\magyar@opt@hyphenation@@phonetic}
+\def\magyar@opt@hyphenation@@huhyphc {\magyar@opt@hyphenation@@composite}
+\expandafter\ifx\csname @OFWO\endcsname\relax
+% Imp: fix --:hyphenation= reporting above
+\def\magyar@opt@hyphenation@@none {\def\magyar@opt@@hyphenation{}}
+\dMf magyar@opt@hyphenation@@huhyph3 {\def\magyar@opt@@hyphenation{3rN}}
+\dMf magyar@opt@hyphenation@@huhyph3-or-any {\def\magyar@opt@@hyphenation{3CmhwN}}
+\def\magyar@opt@hyphenation@@huhyphn {\def\magyar@opt@@hyphenation{nrN}}
+\def\magyar@opt@hyphenation@@composite {\def\magyar@opt@@hyphenation{crN}}
+\dMf magyar@opt@hyphenation@@composite-or-any {\def\magyar@opt@@hyphenation{cCmhwN}}
+\def\magyar@opt@hyphenation@@any {\def\magyar@opt@@hyphenation{CmhwN}}
+\def\magyar@opt@hyphenation@@phonetic {\def\magyar@opt@@hyphenation{frN}}
+\else% report to lafmtgen.pl
+ \typeout{--:hyphenation-=\CurrentOption}
+ \def\magyar@opt@@hyphenation{}%
+ \def\magyar@opt@hyphenation@@none {\def\magyar@opt@@hypr{}}
+ \dMf magyar@opt@hyphenation@@huhyph3 {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyar3}\typeout{--:hyphenation=magyar}}} % install both for safety
+ \def\magyar@opt@hyphenation@@huhyphn {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarn}\typeout{--:hyphenation=magyar}}}
+ \def\magyar@opt@hyphenation@@composite{\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarc}\typeout{--:hyphenation=magyar}}}
+ \def\magyar@opt@hyphenation@@phonetic {\def\magyar@opt@@hypr{\typeout{--:hyphenation=magyarf}}}
+\fi
+\def\magyar@opt@sectiondot@@none{\def\magyar@opt@@sectiondot{0}}
+\def\magyar@opt@sectiondot@@safe{\def\magyar@opt@@sectiondot{1}}
+\def\magyar@opt@sectiondot@@problematic{\def\magyar@opt@@sectiondot{2}}
+\let\magyar@opt@sectiondot\magyar@enumarg
+\def\magyar@opt@captions@@unchanged{\def\magyar@opt@@captions{0}}
+\def\magyar@opt@captions@@hu{\def\magyar@opt@@captions{1}}
+\let\magyar@opt@captions\magyar@enumarg
+\def\magyar@opt@varioref@@unchanged{\def\magyar@opt@@varioref{0}}
+\def\magyar@opt@varioref@@hu{\def\magyar@opt@@varioref{1}}
+\let\magyar@opt@varioref\magyar@enumarg
+\def\magyar@opt@cjhebrewfix@@unchanged{\def\magyar@opt@@cjhebrewfix{0}}
+\def\magyar@opt@cjhebrewfix@@onlyouter{\def\magyar@opt@@cjhebrewfix{1}}
+\def\magyar@opt@cjhebrewfix@@yes{\def\magyar@opt@@cjhebrewfix{2}}
+\let\magyar@opt@cjhebrewfix\magyar@enumarg
+\def\magyar@opt@fancyhdr@@unchanged{\def\magyar@opt@@fancyhdr{0}}
+\def\magyar@opt@fancyhdr@@hu{\def\magyar@opt@@fancyhdr{1}}
+\let\magyar@opt@fancyhdr\magyar@enumarg
+\def\magyar@opt@ntheoremfix@@unchanged{\def\magyar@opt@@ntheoremfix{0}}
+\def\magyar@opt@ntheoremfix@@yes{\def\magyar@opt@@ntheoremfix{1}}
+\let\magyar@opt@ntheoremfix\magyar@enumarg
+\def\magyar@opt@figurecaptions@@unchanged{\def\magyar@opt@@figurecaptions{0}}
+\def\magyar@opt@figurecaptions@@hu{\def\magyar@opt@@figurecaptions{1}}
+\def\magyar@opt@figurecaptions@@us{\def\magyar@opt@@figurecaptions{2}}
+\let\magyar@opt@figurecaptions\magyar@enumarg
+\def\magyar@opt@tablecaptions@@unchanged{\def\magyar@opt@@tablecaptions{0}}
+\def\magyar@opt@tablecaptions@@hu{\def\magyar@opt@@tablecaptions{1}}
+\def\magyar@opt@tablecaptions@@us{\def\magyar@opt@@tablecaptions{2}}
+\let\magyar@opt@tablecaptions\magyar@enumarg
+\def\magyar@opt@toclang@@unchanged{\def\magyar@opt@@toclang{0}}% same as =badall
+\def\magyar@opt@toclang@@badall{\def\magyar@opt@@toclang{0}}
+\def\magyar@opt@toclang@@badfloat{\def\magyar@opt@@toclang{1}}
+\def\magyar@opt@toclang@@good{\def\magyar@opt@@toclang{2}}
+\let\magyar@opt@toclang\magyar@enumarg
+\def\magyar@opt@mathbrk@@unchanged{\def\magyar@opt@@mathbrk{0}}
+\def\magyar@opt@mathbrk@@define{\def\magyar@opt@@mathbrk{1}}
+\def\magyar@opt@mathbrk@@fix{\def\magyar@opt@@mathbrk{2}}
+\let\magyar@opt@mathbrk\magyar@enumarg
+\def\magyar@opt@mathfactorial@@unchanged{\def\magyar@opt@@mathfactorial{0}}
+\def\magyar@opt@mathfactorial@@define{\def\magyar@opt@@mathfactorial{1}}
+\def\magyar@opt@mathfactorial@@fix{\def\magyar@opt@@mathfactorial{2}}
+\let\magyar@opt@mathfactorial\magyar@enumarg
+\def\magyar@opt@mathhucomma@@unchanged{\def\magyar@opt@@mathhucomma{0}}
+\def\magyar@opt@mathhucomma@@define{\def\magyar@opt@@mathhucomma{1}}
+\def\magyar@opt@mathhucomma@@fix{\def\magyar@opt@@mathhucomma{2}}
+\let\magyar@opt@mathhucomma\magyar@enumarg
+\def\magyar@opt@mathmuskips@@unchanged{\def\magyar@opt@@mathmuskips{0}}
+\def\magyar@opt@mathmuskips@@latex{\def\magyar@opt@@mathmuskips{1}}
+\def\magyar@opt@mathmuskips@@hu{\def\magyar@opt@@mathmuskips{2}}
+\let\magyar@opt@mathmuskips\magyar@enumarg
+\def\magyar@opt@hynumberline@@unchanged{\def\magyar@opt@@hynumberline{0}}
+\def\magyar@opt@hynumberline@@latex{\def\magyar@opt@@hynumberline{1}}
+\def\magyar@opt@hynumberline@@hu{\def\magyar@opt@@hynumberline{2}}
+\let\magyar@opt@hynumberline\magyar@enumarg
+\def\magyar@opt@hunnewlabel@@no {\def\magyar@opt@@hunnewlabel{0}}
+\dMf magyar@opt@hunnewlabel@@only-hu {\def\magyar@opt@@hunnewlabel{1}}
+\def\magyar@opt@hunnewlabel@@yes{\def\magyar@opt@@hunnewlabel{2}}
+\let\magyar@opt@hunnewlabel\magyar@enumarg
+\def\magyar@opt@partnumber@@unchanged{\def\magyar@opt@@partnumber{0}}
+\def\magyar@opt@partnumber@@huordinal{\def\magyar@opt@@partnumber{1}}
+\def\magyar@opt@partnumber@@Huordinal{\def\magyar@opt@@partnumber{2}}
+\let\magyar@opt@partnumber\magyar@enumarg
+\def\magyar@opt@chapternumber@@unchanged{\def\magyar@opt@@chapternumber{0}}
+\def\magyar@opt@chapternumber@@huordinal{\def\magyar@opt@@chapternumber{1}}
+\def\magyar@opt@chapternumber@@Huordinal{\def\magyar@opt@@chapternumber{2}}
+\let\magyar@opt@chapternumber\magyar@enumarg
+\def\magyar@opt@accents@@high{\def\magyar@opt@@umlaut{\umlauthigh}}
+\def\magyar@opt@accents@@low{\def\magyar@opt@@umlaut{\umlautlow\umlautelow}}
+\def\magyar@opt@accents@@defaulthigh{\let\magyar@opt@@umlaut\@empty}
+\let\magyar@opt@accents\magyar@enumarg
+\def\magyar@opt@longcaption@@centered{\def\magyar@caption@centering{\centering}\def\magyar@caption@newline{\ }}
+\def\magyar@opt@longcaption@@justified{\def\magyar@caption@centering{\relax}\def\magyar@caption@newline{\ }}
+\def\magyar@opt@longcaption@@centernewline{\def\magyar@caption@centering{\centering}\def\magyar@caption@newline{\\\relax}}
+\def\magyar@opt@longcaption@@none{\let\magyar@caption@centering\@empty}
+\def\magyar@opt@longcaption@@unchanged{\let\magyar@caption@centering\@empty}
+\let\magyar@opt@longcaption\magyar@enumarg
+\def\magyar@opt@suggestions@@no {\def\magyar@opt@@suggestions{0}}
+\def\magyar@opt@suggestions@@yes{\def\magyar@opt@@suggestions{1}}
+\let\magyar@opt@suggestions\magyar@enumarg
+\def\magyar@opt@appendixdot@@no {\def\@@magyar@appendixname{\appendixname}}
+\def\magyar@opt@appendixdot@@yes{\def\@@magyar@appendixname{}}
+\let\magyar@opt@appendixdot\magyar@enumarg
+\def\magyar@opt@extras@@no {\def\magyar@opt@@extras{0}}
+\def\magyar@opt@extras@@yes{\def\magyar@opt@@extras{1}}
+\let\magyar@opt@extras\magyar@enumarg
+\def\magyar@opt@chapterhead@@unchanged{\def\magyar@opt@@chapterhead{0}}
+\def\magyar@opt@chapterhead@@no{\def\magyar@opt@@chapterhead{0}}
+\def\magyar@opt@chapterhead@@yes{\def\magyar@opt@@chapterhead{1}}
+\let\magyar@opt@chapterhead\magyar@enumarg
+\def\magyar@opt@classmod@@no {\let\magyar@opt@@classmod\relax}
+\def\magyar@opt@classmod@@unchanged{\let\magyar@opt@@classmod\relax}
+\def\magyar@opt@classmod@@yes {\let\magyar@opt@@classmod\@empty}
+\def\magyar@opt@classmod#1#2{%
+ \expandafter\ifx\csname magyar@opt@#1@@#2\endcsname\relax
+ \@namedef{magyar@opt@@#1}{#2}%
+ \else
+ \csname magyar@opt@#1@@#2\endcsname
+ \fi
+}
+\def\magyar@opt@shorthandcs#1#2{%
+ \def\reserved@a{#2}%
+ \def\reserved@b{none}%
+ \ifx\reserved@a\reserved@b
+ \def\magyar@opt@@shorthandcs{0}% overridable
+ \else
+ \def\magyar@opt@@shorthandcs{1}%
+ \ifcat\hfuzz\noexpand#2\relax% #2 is \shu \shu`tty is `tty
+ \def#2##1{\protect\@@magyar@shorthand}% Dat: ##1 is usually `_12
+ \else
+ \@namedef{#2}{\protect\@@magyar@shorthand}%
+ \fi
+ \fi
+}
+\def\magyar@opt@hunumbers@@no{\def\magyar@opt@@hunumbers{0}}
+\def\magyar@opt@hunumbers@@yes{\def\magyar@opt@@hunumbers{1}}
+\let\magyar@opt@hunumbers\magyar@enumarg
+\let\magyar@opt@az\magyar@yesweaknoarg
+\let\magyar@opt@told\magyar@yesweaknoarg
+\let\magyar@opt@textqq\magyar@yesweaknoarg
+\let\magyar@opt@emitdate\magyar@yesweaknoarg
+\let\magyar@opt@mathreal\magyar@yesweaknoarg
+\let\magyar@opt@refstruc\magyar@yesweaknoarg
+\let\magyar@opt@mond\magyar@yesweaknoarg
+\let\magyar@opt@hang\magyar@yesweaknoarg
+\def\magyar@opt@theoremtitle@@unchanged{\def\magyar@opt@@theoremtitle{0}}
+\def\magyar@opt@theoremtitle@@hu{\def\magyar@opt@@theoremtitle{1}}
+\let\magyar@opt@theoremtitle\magyar@enumarg
+\def\magyar@opt@footnote@@unchanged{\def\magyar@opt@@footnote{0}}
+\def\magyar@opt@footnote@@yes{\def\magyar@opt@@footnote{1}}
+\def\magyar@opt@footnote@@huplain{\def\magyar@opt@@footnote{2}}
+\def\magyar@opt@footnote@@starplain{\def\magyar@opt@@footnote{3}}
+\let\magyar@opt@footnote\magyar@enumarg
+\def\magyar@opt@hutoday@@no{\def\magyar@opt@@hutoday{0}}
+\def\magyar@opt@hutoday@@yes{\def\magyar@opt@@hutoday{1}}
+\let\magyar@opt@hutoday\magyar@enumarg
+\def\magyar@opt@shortrefcmds@@no{\def\magyar@opt@@shortrefcmds{0}}
+\def\magyar@opt@shortrefcmds@@yes{\def\magyar@opt@@shortrefcmds{1}}
+\let\magyar@opt@shortrefcmds\magyar@enumarg
+\def\magyar@opt@dottedtocline@@fix{\def\magyar@opt@@dottedtocline{1}}
+\def\magyar@opt@dottedtocline@@unchanged{\def\magyar@opt@@dottedtocline{0}}
+\let\magyar@opt@dottedtocline\magyar@enumarg
+\let\magyar@opt@amslevelfix\magyar@enumarg
+\def\magyar@opt@amslevelfix@@unchanged{\def\magyar@opt@@amslevelfix{0}}
+\dMf magyar@opt@amslevelfix@@fix-ams {\def\magyar@opt@@amslevelfix{1}}
+\dMf magyar@opt@amslevelfix@@fix-all {\def\magyar@opt@@amslevelfix{2}}
+\let\magyar@opt@amsuppercasefix\magyar@enumarg
+\def\magyar@opt@amsuppercasefix@@unchanged{\def\magyar@opt@@amsuppercasefix{0}}
+\dMf magyar@opt@amsuppercasefix@@fix-ams {\def\magyar@opt@@amsuppercasefix{1}}
+\dMf magyar@opt@amsuppercasefix@@fix-all {\def\magyar@opt@@amsuppercasefix{2}}
+\let\magyar@opt@captionfix\magyar@enumarg
+\def\magyar@opt@captionfix@@unchanged{\def\magyar@opt@@captionfix{0}}
+\def\magyar@opt@captionfix@@yes {\def\magyar@opt@@captionfix{1}}
+\let\magyar@opt@babelmarkfix\magyar@enumarg
+\def\magyar@opt@babelmarkfix@@unchanged{\def\magyar@opt@@babelmarkfix{0}}
+\def\magyar@opt@babelmarkfix@@yes {\def\magyar@opt@@babelmarkfix{1}}
+\let\magyar@opt@showfix\magyar@enumarg
+\def\magyar@opt@showfix@@unchanged{\def\magyar@opt@@showfix{0}}
+\def\magyar@opt@showfix@@yes {\def\magyar@opt@@showfix{1}}
+\def\magyar@opt@labelenums@@unchanged{\def\magyar@opt@@labelenums{0}}
+\dMf magyar@opt@labelenums@@hu-a {\def\magyar@opt@@labelenums{1}}
+\dMf magyar@opt@labelenums@@hu-A {\def\magyar@opt@@labelenums{2}}
+\dMf magyar@opt@labelenums@@hu-d {\def\magyar@opt@@labelenums{3}}
+\let\magyar@opt@labelenums\magyar@enumarg
+\def\magyar@opt@labelitems@@unchanged{\def\magyar@opt@@labelitems{0}}
+\def\magyar@opt@labelitems@@hu {\def\magyar@opt@@labelitems{1}}
+\let\magyar@opt@labelitems\magyar@enumarg
+\def\magyar@opt@openqq@@unchanged{\def\magyar@opt@@openqq{0}}
+\def\magyar@opt@openqq@@up{\def\magyar@opt@@openqq{1}}
+\def\magyar@opt@openqq@@down{\def\magyar@opt@@openqq{2}}
+\def\magyar@opt@openqq@@maybedown{\def\magyar@opt@@openqq{3}}
+\let\magyar@opt@openqq\magyar@enumarg
+\def\magyar@opt@frenchspacing@@unchanged{\def\magyar@opt@@frenchspacing{0}}% same as =no
+\def\magyar@opt@frenchspacing@@no {\def\magyar@opt@@frenchspacing{1}}
+\def\magyar@opt@frenchspacing@@yes{\def\magyar@opt@@frenchspacing{2}}
+\let\magyar@opt@frenchspacing\magyar@enumarg
+\dMf magyar@opt@afterindent@@force-no {\def\magyar@opt@@afterindent{0}}
+\dMf magyar@opt@afterindent@@force-yes {\def\magyar@opt@@afterindent{1}}
+\dMf magyar@opt@afterindent@@unchanged {\def\magyar@opt@@afterindent{9}}
+\let\magyar@opt@afterindent\magyar@enumarg
+\def\magyar@paragraphopt#1#2{%
+ \ifx#2\magyar@@unchanged\else
+ \expandafter\def\csname magyar@opt@@#1\endcsname{#2}%
+ \fi
+}
+\let\magyar@opt@postdescription\magyar@paragraphopt
+\let\magyar@opt@postpara\magyar@paragraphopt
+\let\magyar@opt@postsubpara\magyar@paragraphopt
+
+% --- Option processing code of \magyarOptions
+%
+% Example: \def\magyarOptions{titles=\quad,active=safe} \usepackage[magyar]{babel}
+% Dat: Babel has \languageoptions, but it is quite weak and it's too late
+% Dat: this is a complete rewrite based on examplep.sty
+
+%** @param #1 to gobble a space token
+%** @usage \magyar@doopt foo=bar,foo2=bar2,\hfuzz,%
+\def\magyar@doopt#1,{%
+ \if,\noexpand#1,% ignore multiple commas (#1 is empty)
+ \expandafter\magyar@doopt
+ \else
+ \csname fi\endcsname% don't count as `\fi' when being skipped
+ \magyar@doopt@low#1,=,%
+ \fi
+}
+\@gobble\iftrue% \def\magyar@doopt@low contains `\fi'. Make it skippable.
+\def\magyar@applyopt#1#2{\csname magyar@opt@#1\endcsname{#1}{#2}}%
+%** @param #1 is here for gobbling space tokens
+\def\magyar@doopt@low#1#2=#3,#4\fi{%
+ % Dat: Normal case: #1#2 is key, #3 is value, #4 is `=,'
+ % Dat: MissingArg case: #1#2 is `key,', #3 is empty, #4 is empty
+ % Dat: Terminator case: #1#2 is `\hfuzz,', #3 is empty, #4 is empty
+ % Dat: OnlySpace case: #1 is `,', #2 is empty, #3 is empty, #4 is empty
+ \ifx\relax#4\relax% MissingArg or Terminator
+ \ifx#1\hfuzz% Terminator
+ \else
+ \if,\noexpand#1\else% OnlySpace case
+ \if=\noexpand#1\magyar@doopt@missingkey#2% #2 already contains comma at end
+ \else \magyar@doopt@missingval#1#2\fi
+ \fi
+ \expandafter\expandafter\expandafter\magyar@doopt
+ \fi
+ \else% Normal
+ \expandafter\ifx\csname magyar@opt@#1#2\endcsname\relax
+ \@@magyar@error{Unknown option: #1#2 (= #3)}%
+ \else
+ \magyar@applyopt{#1#2}{#3}%
+ \fi
+ \expandafter\magyar@doopt
+ \fi
+}
+\def\magyar@doopt@missingkey#1,{%
+ \@@magyar@error{Key missing for value: #1}%
+}
+\def\magyar@doopt@missingval#1,{%
+ \@@magyar@error{Value (=) missing for option: #1}%
+}
+%** Dat: Spaces and newlines at end of #1 are not ignored, so please prefix
+%** them with a comma, e.g \magyar@doopts{foo=bar, }
+%** @param #1 comma-separated optoinname=value pairs
+%\def\magyar@doopts#1{\magyar@doopt #1,\hfuzz,}%
+
+\def\magyar@dooptions{%
+ \expandafter\ifx\csname opt@\CurrentOption.ldf.sty\endcsname\relax\else
+ % Usage: \PassOptionsToPackage{foo=bar}{magyar.ldf}
+ \expandafter\expandafter\expandafter
+ \magyar@doopt\csname opt@\CurrentOption.ldf.sty\endcsname,\hfuzz,%
+ \expandafter\let\csname opt@\CurrentOption.ldf.sty\endcsname\relax
+ \fi
+ \expandafter\ifx\csname \CurrentOption Options\endcsname\relax\else% \magyarOptions
+ \expandafter\expandafter\expandafter
+ \magyar@doopt\csname\CurrentOption Options\endcsname,\hfuzz,%
+ \expandafter\let\csname \CurrentOption Options\endcsname\relax
+ \fi
+}
+\def\magyar@do@option@low#1#2=#3=,\vfuzz{%
+ \ifx#1\hfuzz\else
+ %%\typeout{(#1#2)=(#3)}%
+ % vvv wastes some heap (\csname), but never mind
+ \fi
+}
+
+
+\magyar@opt@defaults{defaults}{over-1.4} % defaults=over-1.4 by default
+\def\magyar@opt@@hdrtitleskip{\enskip}% !! option for that
+\magyar@dooptions% in \magyarOptions
+\ifnum\magyar@opt@@openqq=3 % =maybedown
+ \ifnum\magyar@opt@@active=0
+ \def\magyar@opt@@openqq{0}% =unchanged
+ \else
+ \def\magyar@opt@@openqq{2}% =down
+ \fi
+\fi
+\ifnum\magyar@opt@@partnumber >0 \let\magyar@needopt@hunumbers\@empty \fi
+\ifnum\magyar@opt@@chapternumber>0 \let\magyar@needopt@hunumbers\@empty \fi
+\expandafter\ifx\csname magyar@needopt@hunumbers\endcsname\relax\else
+ \ifnum\magyar@opt@@hunumbers=0
+ \@@magyar@error{(chapter|part)number=... needs hunumbers=yes}%
+ \magyar@opt@@hunumbers1
+ \fi
+ \def\magyar@hunumbers@noclassmod{%
+ \@@magyar@error{unsupported \string\documentclass,\MessageBreak
+ hunumbers=yes,chapternumber=...,partnumber=... disabled}%
+ }%
+ % This may get redefined to \@empty later.
+ \def\magyar@hunumbers@errmsg{\magyar@hunumbers@noclassmod}%
+ \AtBeginDocument\magyar@hunumbers@errmsg
+\fi
+\if0\magyar@opt@@shorthandcs\else
+ \if\magyar@opt@@active0%
+ \@@magyar@error{active=none implies shorthandcs=none}%
+ \magyar@opt@@active2 % active=safe
+ \fi
+\fi
+% Imp: undef \magyar\@opt@* to save memory
+
+\@gobble\iftrue
+%** Usage: `\if...\else\@@magyar@skiplong\fi ... \@gobble{^}', where {^} is in
+%** its own line
+\def\@@magyar@skiplong#1{%
+ \fi
+ %\typeout{--skipfrom:\the\inputlineno}
+ \bgroup% so ^} would close it
+ \catcode\string`^13 \lccode\string`~=\string`^
+ \lowercase{\let~\fi}% \lowercase because catcode of ^ in \let^ would have been already assigned
+ %\lowercase{\def~{\typeout{--skipto:\inputlineno}\fi}}%
+ \catcode\string`\\14 % comment -- avoid using hash memory
+ \catcode\string`$14 % %$
+ \iffalse
+}
+\@gobble\fi
+
+\@namedef{extras\CurrentOption}{}%
+
+% --- hyphenation=
+
+\csname magyar@opt@@hypr\endcsname
+\let\magyar@sugg@pa\@gobble
+%\show\magyar@opt@@hyphenation
+\ifx\magyar@opt@@hyphenation\@empty
+ % Hungarian words won't be hyphenated automatically
+ \expandafter\chardef\csname l@\CurrentOption\endcsname255
+ \@@magyar@skiplong\fi
+% Define a warning, will be printed later.
+\def\@@magyar@suggpa@req@def{%
+ \def\magyar@sugg@pa##1{%
+ \PackageWarningNoLine{##1.ldf}{%
+ Requested Hungarian hyphenation= patterns missing.\MessageBreak
+ To make LaTeX hyphenate Hungarian words, please\MessageBreak
+ modify language.dat and rerun initex or texconfig}}}%
+% Define a warning, will be printed later.
+\def\@@magyar@suggpa@all@def{%
+ \def\magyar@sugg@pa##1{%
+ \PackageWarningNoLine{##1.ldf}{%
+ All Hungarian hyphenation= patterns missing.\MessageBreak
+ To make LaTeX hyphenate Hungarian words, please\MessageBreak
+ modify language.dat and rerun initex or texconfig}}}%
+\def\@@magyar@hyphenation@last#1\@@magyar@hyphenation@next#2\hfuzz{#1}%
+\def\@@magyar@hyphenation@defcs#1#2{\ifx#1#2\else\chardef#1#2\fi}% Dat: \chardef\foo\foo doesn't work
+\def\@@magyar@hyphenation@def#1{%
+ \expandafter\ifx\csname l@#1\endcsname\relax\else
+ \expandafter\expandafter\expandafter\@@magyar@hyphenation@defcs
+ \expandafter\expandafter\csname l@\CurrentOption\endcsname
+ \csname l@#1\endcsname
+ \@@magyar@hyphenation@last\fi}%
+\def\@@magyar@hyphenation@next#1{%
+ \ifx#1\hfuzz
+ \else\if#1N% none
+ % Turn of hyphenation.
+ \expandafter\chardef\csname l@\CurrentOption\endcsname255
+ \@@magyar@hyphenation@last
+ \else\if#1C% use l@\CurrentOption if defined
+ \expandafter\ifx\csname l@\CurrentOption\endcsname\relax\else
+ \@@magyar@hyphenation@last
+ \fi
+ \else\if#1w% print the all-missing-warning
+ \@@magyar@suggpa@all@def
+ \else\if#1r% print the req-missing-warning
+ \@@magyar@suggpa@req@def
+ \else\if#1h\@@magyar@hyphenation@def{hungarian}%
+ \else\if#1m\@@magyar@hyphenation@def{magyar}%
+ \else\if#13\@@magyar@hyphenation@def{magyar3}%
+ \else\if#1c\@@magyar@hyphenation@def{magyarc}%
+ \else\if#1f\@@magyar@hyphenation@def{magyarf}%
+ \else\if#1n\@@magyar@hyphenation@def{magyarn}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\@@magyar@hyphenation@next
+ % Dat: no \adddialect\l@magyar... - it's only a chardef
+}%
+
+%\tracingmacros1 \show\magyar@opt@@hyphenation
+\expandafter\@@magyar@hyphenation@next\magyar@opt@@hyphenation\hfuzz
+%\show\l@magyar
+%\tracingmacros0
+\expandafter\ifx\csname l@\CurrentOption\endcsname\relax
+ \expandafter\newcount\csname l@\CurrentOption\endcsname
+ % ^^^ BUGFIX at Tue Oct 12 14:13:54 CEST 2004
+\fi
+\let\@@magyar@suggpa@all@def\@undefined
+\let\@@magyar@suggpa@req@def\@undefined
+\@gobble
+{^}
+
+% --- accents=
+
+\ifx\magyar@opt@@umlaut\@empty\else% !! test this
+ % Dat: this only affects \"
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow \magyar@opt@@umlaut}
+\fi
+
+% --- theorem title number ordering and the dot; theoremtitle=
+%
+% Dat: \ref{mytheorem} never appends a dot
+%
+% If you want to define your own theorem style without using theorem.sty or
+% ntheorem.sty, then do a
+% \PassOptionsToPackage{theoremtitle=unchanged}{magyar.ldf} , and then
+% define a custom \@begintheorem, \@opargbegintheorem and \@endtheorem.
+
+\if0\magyar@opt@@theoremtitle \@@magyar@skiplong\fi
+% for theorem.sty and ntheorem.sty
+% Define your \newtheorem commands in the preamble, before \theoremstyle
+\def\magyar@th@magyar{%
+ \def\@begintheorem##1##2{%
+ \item[\hskip \labelsep{\theorem@headerfont ##2.\ ##1.}]}%
+ \def\@opargbegintheorem##1##2##3{%
+ \item[\hskip \labelsep{\theorem@headerfont ##2.\ ##1\ (##3).}]}%
+}
+
+% vvv Dat: theorem.sty needs \th@magyar-plain when \theoremstyle{...}
+% is called, so we have to define it early (even if theorem.sty is not
+% loaded).
+\expandafter\let\csname th@\CurrentOption-plain\endcsname\magyar@th@magyar% Dat: moved to earlier
+% !! now \usepackage{theorem}
+% \usepackage[magyar]{babel}
+% \theoremstyle{magyar-plain}% % Dat: must be put before \new
+% \newtheorem{Def}{Defin\'{i}ci\'o}
+
+%** @param #1 magyar
+\def\@@magyar@setup@theoremstyle#1{%
+ \expandafter\ifx\csname theorem@headerfont\endcsname\relax
+ \let\magyar@th@magyar\@undefined
+ \else
+ %\expandafter\let\csname th@#1-plain\endcsname\magyar@th@magyar% Dat: moved to earlier
+ % vvv Dat: activate the Hungarian theorem style by default.
+ \def\theorem@headerfont{\bf}%
+ \edef\reserved@a{\the\theorem@style}%
+ \def\reserved@b{plain}%
+ \ifx\reserved@a\reserved@b
+ \expandafter\theorem@style\expandafter{#1-plain}%
+ \fi
+ \fi
+}
+
+% Do this quite late in case theorem.sty or ntheorem.sty is loaded late.
+\expandafter\AtBeginDocument\expandafter{\expandafter
+ \@@magyar@setup@theoremstyle\expandafter{\CurrentOption}}
+
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ %%\show\theorem@headerfont
+ \expandafter\ifx\csname thm@swap\endcsname\relax
+ \expandafter\ifx\csname theorem@headerfont\endcsname\relax% no theorem.sty
+ \babel@save\@begintheorem
+ % Dat: amsart.cls: \def\@begintheorem#1#2[#3]{}%
+ \def\@begintheorem#1#2{\trivlist
+ \item[\hskip \labelsep{\bfseries #2.\ #1.}]\itshape}% old: \slshape
+ \babel@save\@opargbegintheorem
+ \def\@opargbegintheorem#1#2#3{\trivlist
+ \item[\hskip \labelsep{\bfseries #2.\ #1\ (#3).}]\itshape}% old: \slshape
+ \else% theorem.sty or ntheorem.sty
+ % Nothing -- style already set up in the preamble.
+ \fi
+ \else% amsthm.sty
+ \babel@save\thmhead
+ \babel@save\swappedhead
+ %** \swapnumbers. \newtheorem{...}{...} already inserts the trailing dot
+ % \def\thm@swap{S}% no effect :-(
+ %** overrides amsart.cls
+ \def\thmhead#1#2#3{%
+ \thmnumber{\@upn{#2}\@ifnotempty{#1}{.~}}%
+ \thmname{#1}%
+ \thmnote{ {\the\thm@notefont(#3)}}%
+ }%
+ \let\swappedhead\thmhead
+ \fi
+}%
+\@gobble
+{^}%
+
+% --- Quotation marks with \textqq
+%
+% Symbols of Hungarian quoting: unquoted ,,outer >>middle 'inner'<<''
+% Equivalent: unquoted \quotedblbase outer \guillemotright middle
+% \textquoteright inner\textquoteright\guillemotleft\textquotedblright
+% With magyar.ldf: unquoted \textqq{outer \textqq{middle \textqq{inner}}}
+% Typing this with magyar.ldf works for outer: \textqq{foo}
+% Typing this works with T1 and OT1 for outer: \glqq foo''
+% Typing this works in T1, but not in OT1 for outer: ,,foo''
+%
+
+\if0\magyar@opt@@textqq \@@magyar@skiplong\fi
+\def\magyar@textqq@level{0}
+%** Provide a placeholder for language-unspecific \textqq
+\def\@@magyar@textqq@nolang#1{%
+ \ifcase\magyar@textqq@level
+ \def\magyar@textqq@level{1}%
+ \textquotedblleft#1\textquotedblright
+ \def\magyar@textqq@level{0}%
+ \or
+ \textquoteleft#1\textquoteright
+ \fi
+}
+\def\@@magyar@textqq@hu#1{\ifmmode\expandafter\mbox\fi{%
+ % Imp: \textqq{\textqq{foo}} -> \textqq{\textqq{foo}\,}
+ % Dat: \showhyphens{\textqq{hello bello}} --> hel-lo bel-lo
+ % Dat: \guillemotleft is provided by babel.def even for the OT1 encoding
+ \ifcase\magyar@textqq@level
+ \def\magyar@textqq@level{1}%
+ % Dat: \hskip instead of \kern to allow hyphenation
+ % \nobreak\hskip-.06em adds a non-breakable skip and allows hyphenation
+ % of the following word.
+ \quotedblbase\nobreak\hskip-.06em\relax#1\kern\z@\textquotedblright% skip OK for the CM and EC fonts
+ \def\magyar@textqq@level{0}%
+ \or
+ \def\magyar@textqq@level{2}%
+ \guillemotright\nobreak\hskip-.07em\relax#1\kern-0.05em\guillemotleft% skip OK for CM and EC fonts
+ \def\magyar@textqq@level{1}%
+ \or
+ \def\magyar@textqq@level{3}%
+ \textquoteright\nobreak\hskip\z@\relax#1\kern\z@\textquoteright
+ \def\magyar@textqq@level{2}%
+ \else
+ \quotedblbase\nobreak\hskip-.06em\relax#1\kern\z@\textquotedblright% skip OK for the CM and EC fonts
+ \fi
+}}%
+
+\catcode`\ =11\relax% make space a letter
+\ifnum\magyar@opt@@textqq\expandafter\ifx\csname\@gobble.textqq\endcsname\relax1\fi>1\relax% 21, 2, 11, 1
+\def\textqq{\protect\textqq }% \MakeRobust
+\def\@@magyar@textqq{\protect\textqq }%
+\let\textqq \@@magyar@textqq@nolang%
+\expandafter\addto\csname\@gobble.extras\CurrentOption\endcsname%
+{\babel@save\textqq \let\textqq \@@magyar@textqq@hu}%
+\else%
+\def\@@magyar@textqq{\protect\@@magyar@textqq }% \MakeRobust
+\let\@@magyar@textqq \@@magyar@textqq@nolang%
+\expandafter\addto\csname\@gobble.extras\CurrentOption\endcsname%
+{\babel@save\@@magyar@textqq \let\@@magyar@textqq \@@magyar@textqq@hu}%
+\fi%
+\catcode`\ =10\relax% back to space again
+\@gobble
+{^}%
+
+% --- Definite articles (\az, \pageref -> \apageref etc.)
+
+\if0\magyar@opt@@az \@@magyar@skiplong\fi
+
+\makeatletter
+
+%** modified by pts at Fri Oct 3 22:19:13 CEST 2003
+%** @param #1 tokens, will be \edef\vfuzz'ed
+\def\@@magyar@az@vfuzzedef#1{%
+ \begingroup
+ \@safe@activestrue% Allow active `:' inside labels.
+ \def\hyper@@link[##1]##2##3##4{##4}% Dat: \def\b@abook{\hyper@@link [cite]{}{cite.sokt}{2}}% with hyperref.sty
+ \let\romannumeral\number% by pts@fazekas.hu at Mon Oct 27 23:44:06 CET 2003
+ % Dat: deliberately no \autoref for hyperref.sty !! (why??)
+ \let\ref\@@magyar@zeroref \let\pageref\@@magyar@zeropageref
+ \let\cite\@@magyar@zerocite \let\eqref\@@magyar@zeroeqref
+ % ^^^ fix so \az{\ref{...}} works
+ \let\refstruc\@@magyar@zerorefplus
+ \let\refstrucparen\@@magyar@zerorefplus
+ \def\setbox ##1{}% to get rid of accents and special letters
+ \def\hbox ##1{}%
+ \def\accent ##1 ##2{##2}%
+ \def\add@accent ##1##2{##2}%
+ \def\@text@composite@x ##1##2{##2}%
+ % TODO(pts): Add more from t1enc.def
+ %\let\`\@empty \let\'\@empty \let\^\@empty \let\~\@empty \let\"\@empty
+ %\let\H\@empty \let\r\@empty \let\v\@empty \let\u\@empty \let\=\@empty
+ %\let\.\@empty
+ \def\DH{DH}\def\DJ{DJ}\def\NG{NG}\def\O{O}\def\SS{S}\def\TH{TH}\def\IJ{IJ}%
+ \def\dh{dh}\def\dj{dj}\def\o{o}\def\ng{ng}\def\l{l}%
+ \def\th{th}\def\i{i}\def\j{j}\def\ij{ij}%
+ \def\ae{a}\def\AE{A}\def\oe{o}\def\OE{O}%
+ \def\ss{s}\def\L{L}\def\i{i}\def\j{j}%
+ \def\d{}\def\b{}\def\c{}\def\t{}%
+ %
+ \def\IeC{}% \usepackage[utf8]{inputenc} generates \IeC{\'a}.
+ \def\ { }%
+ %
+ % Dat: no need to remove \textsf or \mdseries, because they are
+ % handled properly by \protect == \string here.
+ \let\@safe@activestrue\@empty% babel puts these inside \b@...: % Dat: \def\b@abook{\@safe@activesfalse 2}% (what is \@safe@actives??)
+ \let\@safe@activesfalse\@empty
+ \edef\vfuzz{\noexpand\def\noexpand\vfuzz{#1}}%
+ \expandafter\endgroup\vfuzz
+}
+
+%** Makes \az etc. not emit the definite article.
+%** Unused.
+\def\@@magyar@noaz{%
+ \def\@@magyar@az@lowt{\@ifstar\@gobble\@firstofone}%
+ \def\az{\@@magyar@az@lowt}%
+ \let\Az\az
+ \def\aref{\@ifstar\@gobble\@@magyar@az@lowa}%
+ \let\Aref\aref
+ \def\apageref{\@ifstar\@gobble\firstoftwo}%
+ \let\Apageref\apageref
+ \def\acite{\@ifstar\@gobble\cite}%
+ \let\Acite\acite
+}
+
+%** Usage: \az{alma} -> `az alma'; \Az*{alma} -> `az'
+%** Usage: \az+\ref{foo} is equivalent to \az{\ref{foo}}
+%** TODO(pts): fix \aref{l5} if the body of l5 is empty.
+\def\@@magyar@az@lowt{\@ifstar{\@@magyar@az@lowy}{\@ifnextchar+\@@magyar@az@lowz\@@magyar@az@lowx}}
+%** #1 is +.
+\def\@@magyar@az@lowz#1#2#3{\@@magyar@az@lowy{#2{#3}}~#2{#3}}
+%** Used by new varioref.sty
+\def\@@magyar@az@lowxu{\unskip\@@magyar@az@lowx}%
+\def\@@magyar@az@lowx#1{\@@magyar@az@lowy{#1}~\ignorespaces#1}
+\def\@@magyar@az@lowy#1{%
+ \begingroup
+ \begingroup
+ %\def\protect{\noexpand\protect\noexpand}%
+ % TODO(pts): Is \set@display@protect called in other invocations of
+ % \@@magyar@az@vfuzzedef, such as \aref or \az+\ref? Make it
+ % consistent.
+ % latex.ltx: \let\@typeset@protect\relax
+ % latex.ltx: \def\set@display@protect{\let\protect\string}
+ % latex.ltx: \def\set@typeset@protect{\let\protect\@typeset@protect}
+ \set@display@protect% \let\protect\string; screws up \r
+ \@@magyar@az@vfuzzedef{#1}%
+ \expandafter\endgroup\expandafter
+ \set@display@protect\expandafter% fixes \r; why??
+ \@@magyar@az@set\expandafter{\vfuzz}\hbox$%
+ \endgroup
+}
+
+\def\@@magyar@firstarg#1#2\hbox${#1}%
+
+%** \Aref({e:foo}) -> `az~(5)'; \aref*{e:foo}: `az'
+\def\@@magyar@az@lowa{\@ifnextchar({\@@magyar@az@lowb}{\@@magyar@az@lowb\@empty}}
+\def\@@magyar@az@lowb#1#2{\@@magyar@az@ref\@firstoftwo{#2}~#1\ref{#2}}
+%** @param #1 \@firstoftwo (for \ref) or \@secondoftwo (for \pageref)
+%** everything which is not \@secondoftwo is treated is \@firstoftwo
+%** @param #2 for \csname r@#2\endcsname
+\def\@@magyar@az@ref#1#2{%
+ \begingroup
+ % Dat: this works when turning on hyperref.sty for the 1st time (1st .aux file) -- but the original \ref doesn't work (\@fifthoffive)
+ % Dat: #2 might contain an active : ; ! ? in case
+ % \def\magyarOptions{activespace=safe}
+ \begingroup\lccode`~`: \lowercase{\endgroup\edef~{\string~}}%
+ \begingroup\lccode`~`; \lowercase{\endgroup\edef~{\string~}}%
+ \begingroup\lccode`~`! \lowercase{\endgroup\edef~{\string~}}%
+ \begingroup\lccode`~`? \lowercase{\endgroup\edef~{\string~}}%
+ \@ifundefined{@@magyar@r@#2}{%
+ \@ifundefined{r@#2}{\let\reserved@a\@empty}{\expandafter\let\expandafter\reserved@a\csname r@#2\endcsname}%
+ }{\expandafter\let\expandafter\reserved@a\csname @@magyar@r@#2\endcsname}%
+ \ifx\reserved@a\@empty\endgroup\else% a speed boost
+ \ifx#1\@secondoftwo\relax % Dat: remove the 1st {...} arg inside \reserved@a
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter
+ \expandafter\reserved@a\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter\@gobble\reserved@a{}}%
+ \fi
+ % vvv keep only the 1st arg (w/o braces) of \vbox, without expansion.
+ % This is to have hyperref.sty with `\newlabel{tab}{{1}{2}{\texorpdfstring {\textit {bg}}{asd}\relax }{section.1}{}}'
+ % right, and \texorpdfstring not expanded in the \edef below.
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter
+ \expandafter\reserved@a\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter\@@magyar@firstarg\reserved@a{}\hbox$}%
+ \expandafter\@@magyar@az@vfuzzedef\expandafter{\reserved@a}%
+ \expandafter\endgroup\expandafter\@@magyar@az@set\expandafter{\vfuzz}\hbox$%
+ \fi
+}
+
+\def\@@magyar@az@lowd#1{\@@magyar@az@ref\@secondoftwo{#1}~\pageref{#1}}
+
+\def\@@magyar@acite@lowb{\@ifnextchar [{\@@magyar@acite@lowa}{\@@magyar@acite@lowa[]}}
+\def\@@magyar@acite@lowa[#1]#2{%
+ \@@magyar@acite@lowd{#2}~%
+ \ifx\vfuzz#1\vfuzz\cite{#2}\else\cite[#1]{#2}\fi
+}
+\def\@@magyar@acite@lowd#1{\@@magyar@acite@lowc#1,\hbox$}
+\def\@@magyar@acite@lowc#1,#2\hbox#3${%
+ \begingroup
+ \@ifundefined{@@magyar@b@#1}{%
+ \@ifundefined{b@#1}{\def\vfuzz{}}{%
+ \@@magyar@az@vfuzzedef{%
+ \expandafter\expandafter\expandafter\@@magyar@b@number
+ \expandafter\expandafter\expandafter{\csname b@#1\endcsname}}}%
+ } {\@@magyar@az@vfuzzedef{\csname @@magyar@b@#1\endcsname}}%
+ \expandafter\endgroup\expandafter
+ \@@magyar@az@set\expandafter{\vfuzz}\hbox$%
+}
+
+% The original version of the \@az macros below were written by
+% David Carlisle, but they have been completely rewritten by pts.
+
+%** Adds definite article for a word #1#2#3 if #1 is in [A..Z]. Spaces
+%** between #1, #2 and #3 can be -- fortunately -- ignored.
+%** This is used to distinguish single-letter labels from text labels.
+%** Dat: by pts: `\Az{Sz} bet' emits `Az Sz bet'; `\az{szlam}' is also OK
+%** @param #1#2#3 doesn't contain \hbox (but may contain space)
+%** @param #1 #2 #3 never lower case
+\def\@@magyar@azuc#1#2#3{%
+ \if\noexpand#1Az%
+ \else\if\noexpand#1Ez%
+ \else\if\noexpand#1F\ifcat a\noexpand#2\else z\fi
+ \else\if\noexpand#1Iz%
+ \else\if\noexpand#1L\ifcat a\if\noexpand#2Y\expandafter\noexpand#3\else\expandafter\noexpand#2\fi\else z\fi
+ \else\if\noexpand#1M\ifcat a\noexpand#2\else z\fi
+ \else\if\noexpand#1N\ifcat a\if\noexpand#2Y\expandafter\noexpand#3\else\expandafter\noexpand#2\fi\else z\fi
+ \else\if\noexpand#1Oz%
+ \else\if\noexpand#1S\ifcat a\if\noexpand#2Z\expandafter\noexpand#3\else\expandafter\noexpand#2\fi\else z\fi
+ \else\if\noexpand#1R\ifcat a\noexpand#2\else z\fi
+ \else\if\noexpand#1Uz%
+ \else\if\noexpand#1X\ifcat a\noexpand#2\else z\fi
+ \else\if\noexpand#1Y\ifcat a\noexpand#2\else z\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+\def\@@magyar@azuc@pre#1#2#3#4\hbox${%
+ \uppercase{\@@magyar@azuc#1#2#3}% Dat: we map a..z -> A..Z
+}
+
+%** Also defined elsewhere.
+%** @param #2 \else...\else...\fi...\fi etc.
+\def\@@magyar@swaprelax#1#2\relax{#2#1}
+\def\@@magyar@ignorehbox@pre#1\hbox${}%
+%** Counts the number of digits until a nondigit is found, and insert `z' if
+%** appropriate (divisible by 3).
+%** We need this to properly handle \aref for eg. 1.3.12 (subsec number)
+%** or 3-45 (pagenumber preceeded by chapter number).
+\def\@@magyar@eatddd#1#2#3#4{%
+ % Wizardry: \@@magyar@eatddd throws away #1 (\@@magyar@ignorehbox@pre)
+ \ifnum9<1\string#2 \ifnum9<1\string#3 \ifnum9<1\string#4 % test for digits
+ \@@magyar@swaprelax\@@magyar@eatddd\fi\fi\else z\fi
+ \relax\@@magyar@ignorehbox@pre
+}
+
+% vvv Wizardry: ignore everything (second number?) after first space
+\def\@@magyar@eatddd@pre#1 #2\hbox${\@@magyar@eatddd.#1[][]\hbox$}%
+
+\@gobble\iftrue
+\def\@@magyar@azrb@stop#1#2\fi{#1}%
+%** Strips spaces and braces, up to \hfuzz.
+%** @expands to `z' or nothing (last char of definite article)
+%** @example \message{R:\removebraces {{foo}{{}{b}{{{{a\fi}}}}r}}\hfuzz;}
+\def\@@magyar@azrb#1{%
+ \ifx\hfuzz#1\@@magyar@azrb@stop\fi
+ \expandafter\@@magyar@azrb\expandafter{%
+ \ifcat{\noexpand#1\hfuzz\iffalse}\fi\expandafter
+ \@@magyar@azrb\else\hfuzz}\@@magyar@azrb@nob{#1}\fi}
+\def\@@magyar@azrb@nob#1#2{#2% #2 is \fi
+ \ifx\hfuzz#1\hfuzz\expandafter\@firstoftwo
+ \expandafter\@@magyar@azrb\fi\@@magyar@azrb@nobone#1}
+\def\@@magyar@azrb@nobone#1{\noexpand#1\@@magyar@azrb}%
+
+\def\@@magyar@aznospace#1{%
+ \if\hfuzz\noexpand#1\expandafter\@@magyar@aznospace\else % a \cs, ignored -- may be \relax
+ \expandafter\@@magyar@aznospace@short\expandafter#1%
+ \fi
+}
+
+% Expandable macro which removes single-letter control sequences, converts
+% multiletter control sequences to dots, and keeps letters, and converts
+% everything else (i.e. non-letter, non-control sequence tokens) to `other'.
+%
+% Usage: \@@magyar@azro...\hfuzz, where ... doesn't contain braces, spaces
+% or \hfuzz.
+%
+% Wizardry: this uses the following tricks:
+%
+% \expandafter\@gobble\if...\fi\@@selfcontinue trick.
+%
+% % Tests that #1 is a control sequence token, provided it's a single, non-space, non-brace token.
+% \def\testcs#1{\ifcat a\expandafter\@gobble\string#1aNO\else CS\fi}
+%
+% % Tests that #1 is a control sequence token of 1 character, provided it's a single control sequence token.
+% \def\testcso#1{\ifcat a\expandafter\@gobbletwo\string#1\@empty aCSO\else NO\fi}
+%
+% % Tests that #1 is other character, provided it's a single, non-space, non-brace token.
+% \def\testother#1{\ifcat\string*\noexpand#1OTHER\else NO\fi}
+\def\@@magyar@azro#1{%
+ \ifx#1\hfuzz\expandafter\@gobble% Stop at \hfuzz.
+ \else\ifcat a\expandafter\@gobble\string#1a% Not a control sequence.
+ \ifcat a\noexpand#1\else\expandafter\string\fi#1% Keep letters, convert everything else with \string.
+ \else\ifcat a\expandafter\@gobbletwo\string#1\@empty a% Single-character control sequence, e.g. \/, \', \H, \ , remove it.
+ \else.% Replace multiletter control sequence with a dot.
+ \fi\fi\fi\@@magyar@azro}
+
+% Expandable macro which converts outermost spaces to dots, and occasionally
+% removes some layers of braces. It also adds an extra dot (as a side
+% effect).
+%
+% Usage: `\\@magyar@azrs...\hfuzz ', where ... argument doesn't contain
+% \if..., \else and \fi tokens.
+\def\@@magyar@azrs#1 {%
+ \ifx\hfuzz#1\expandafter\@gobble% Stop at \hfuzz.
+ \else#1.%
+ \fi\@@magyar@azrs}%
+
+%** @param #1 might not be \cs -- and isn't empty
+\def\@@magyar@aznospace@short#1{%
+ \if5\noexpand#1z% Dat: emit `az 5'
+ \@@magyar@swaprelax\@@magyar@ignorehbox@pre
+ \else\if1\noexpand#1%
+ % Dat: properly handle `az 1001 jszaka', `az 1234567 ves bolyg'
+ \@@magyar@swaprelax\@@magyar@eatddd@pre
+ \else\ifnum1<1\noexpand#1 % a different digit, emit `a '
+ \@@magyar@swaprelax\@@magyar@ignorehbox@pre
+ \else\if-\noexpand#1% \az{-5} yields `a~-5'
+ \@@magyar@swaprelax\@@magyar@ignorehbox@pre
+ \else\ifcat\string*\noexpand#1% puncuation in the beginning, such as `(' in `(5)'
+ \@@magyar@swaprelax\@@magyar@aznospace % ignore punctuation
+ \else
+ \@@magyar@swaprelax{\@@magyar@azuc@pre#1}%
+ \fi\fi\fi\fi\fi\relax
+}
+
+%** Typesets `z' or nothing (last char of definite article). Is _not_
+%** expandable.
+%** @param #1 may contain space(_10) tokens, but mustn't contain expandable
+%** tokens.
+\def\@@magyar@az@set#1#2\hbox${% by pts
+ % ^^^ Dat: we have `$' instead of `!' because of catcode changes (shouldn't affect)
+ % We use \@firstofone to strip a leading space.
+ \edef\reserved@a{\expandafter\@@magyar@azrs\@firstofone#1 \hfuzz\@gobble{} }%
+ \edef\reserved@a{\expandafter\@@magyar@azrb\reserved@a\hfuzz}%
+ \edef\reserved@a{\expandafter\@@magyar@azro\reserved@a\hfuzz}%
+ \expandafter\@@magyar@aznospace\reserved@a[b][][] \hbox$%
+ % ^^^ Wizardry: [b][][] is a smart sentinel for \@@magyar@azuc and `b' for
+ % \@@magyar@aznospace@short. First `[' is there for aesthetics. Space
+ % is there for \@@magyar@eatddd@pre. \hbox$ is something that will not
+ % occur in normal text.
+}
+
+\ifnum\magyar@opt@@az \expandafter\ifx\csname az\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\az{a\@@magyar@az@lowt}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname Az\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\Az{A\@@magyar@az@lowt}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname aref\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\aref{a\@ifstar{\@@magyar@az@ref\@firstoftwo}{\@@magyar@az@lowa}}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname Aref\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\Aref{A\@ifstar{\@@magyar@az@ref\@firstoftwo}{\@@magyar@az@lowa}}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname apageref\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\apageref{a\@ifstar{\@@magyar@az@ref\@secondoftwo}{\@@magyar@az@lowd}}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname Apageref\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\Apageref{A\@ifstar{\@@magyar@az@ref\@secondoftwo}{\@@magyar@az@lowd}}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname acite\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\acite{a\@ifstar{\@@magyar@acite@lowd}{\@@magyar@acite@lowb}}\fi
+\ifnum\magyar@opt@@az \expandafter\ifx\csname Acite\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\Acite{A\@ifstar{\@@magyar@acite@lowd}{\@@magyar@acite@lowb}}\fi
+
+\@gobble
+{^}
+
+% --- hunnewlabel=
+
+\if0\magyar@opt@@hunnewlabel
+ \let\hunnewlabel\@gobbletwo
+ % ^^^ with this the user would be able to switch from hunnewlabel=yes
+ % to hunnewlabel=no without removing the .aux file. But now I have a
+ % better solution to that. (??) !!
+ \@@magyar@skiplong\fi
+
+% [pts] Done properly by pts@fazekas.hu at Mon Mar 2 21:53:30 CET 2009
+%
+% \label will be redefined to write another line to .aux file:
+% \hunnewlabel{...}{...}: similar to \newlabel{sectionStructNr}{pageNr},
+% where the roman numerals are replaced by their arabic representations, so
+% \aref and \apageref will work (`a II. rsz'). The name \hunnewlabel is a
+% legacy.
+%
+% We have to redefine \refstepcounter, which defines \@currentlabel, so we
+% can define \magyar@@currentlabel@arabic, wich is the same as \@currentlabel,
+% but it contains the number in arabic instead of roman. Without
+% \magyar@@currentlabel@arabic, \label would have no clue that a roman number
+% was involved. hyperref.sty also redefines \refstepcounter, but we are
+% agnostic to that: it doesn't matter if we are first.
+
+\let\magyar@@orig@refstepcounter\refstepcounter
+% \relax, or {currentlabel}{pagenumber}
+\let\magyar@@currentlabel@intact\relax
+% \relax, or {currentlabel-in-arabic}{pagenumber-in-arabic}
+\let\magyar@@currentlabel@arabic\relax
+
+\def\@@magyar@setup@romantoarabic{%
+ \let\romannumeral\number
+ \let\@Roman\@roman % avoid uppercasing
+}
+
+\def\refstepcounter#1{%
+ \magyar@@orig@refstepcounter{#1}%
+ \begingroup
+ % Imp: wait till \shipout before expanding \thepage, in case of
+ % \pagenumbering{roman}.
+ % \c@page might be wrong (it's correcy at \shipout only), se we fake it.
+ \c@page\@m
+ \edef\reserved@b{{\thepage}}%
+ \let\reserved@a\@currentlabel
+ % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a.
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\reserved@a%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\reserved@a\expandafter}\reserved@b}%
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter\def\expandafter\magyar@@currentlabel@intact\expandafter{%
+ \reserved@a}}%
+ \expandafter\endgroup\reserved@b
+ \begingroup
+ \c@page\@m
+ \@@magyar@setup@romantoarabic
+ % This \protected@edef is from the \refstepcounter code.
+ \protected@edef\reserved@a{%
+ {\csname p@#1\endcsname\csname the#1\endcsname}{\thepage}}%
+ \let\reserved@b\@empty
+ \ifx\reserved@a\@currentlabel\else
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter\def\expandafter\magyar@@currentlabel@arabic\expandafter{%
+ \reserved@a}}%
+ \fi
+ \expandafter\endgroup\reserved@b
+}
+
+%** Make its expansion short so \ifx would be fast down in noextras...
+\def\@@magyar@labela{\@@magyar@labelb}%
+\def\@@magyar@labelb#1{%
+ \@@magyar@orig@label{#1}% output \newlabel to \@auxout
+ \begingroup
+ \c@page\@m
+ \edef\reserved@b{{\thepage}}%
+ \let\reserved@a\@currentlabel
+ % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a.
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\reserved@a%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\reserved@a\expandafter}\reserved@b}%
+ \ifx\reserved@a\magyar@@currentlabel@intact
+ % \@currentlabel created by our overridden \refstepcounter.
+ \ifx\magyar@@currentlabel@arabic\magyar@@currentlabel@intact\else
+ \expandafter\@@magyar@labelc\magyar@@currentlabel@arabic{#1}%
+ \fi
+ \else
+ % \@currentlabel from unknown origin.
+ % Emit \hunnewlabel if \thepage is roman.
+ \@@magyar@setup@romantoarabic
+ \edef\reserved@c{{\thepage}}%
+ \ifx\reserved@b\reserved@c\else % \thepage is roman
+ \@@magyar@labelc\@currentlabel{}{#1}%
+ \fi
+ \fi
+ \endgroup
+}
+% @param #1 \@currentlabel (maybe expanded) as roman converted to arabic
+% @param #2 any page number in any format; ignored
+% @param #3 name of the label
+\def\@@magyar@labelc#1#2#3{%
+ % We have \noexpand\number below to prevent the \edef in \protected@write
+ % from expanding the page number. It will be expanded at \shipout.
+ \protected@write\@auxout{}{%
+ \string\hunnewlabel{#3}{{#1}{\noexpand\number\c@page}}}%
+}
+
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ %%\message{--EXTRAS--}\show\label
+ \ifx\label\@@magyar@labela\else
+ \let\@@magyar@orig@label\label
+ \let\label\@@magyar@labela
+ \fi
+}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ %%\message{--NO--}%
+ \ifx\label\@@magyar@labela
+ % The trick here is not to restore the ``original'' label command if
+ % somebody has changed it since the previous save in \extrasmagyar. This
+ % adds compatibility with hyperref.sty, because it loads nameref.sty which
+ % changes \label after babel.sty and magyar.ldf has been loaded.
+ % 1. \usepackage[magyar]{babel}% \AtBeginDocument{\select@language{magyar}}
+ % 2. \usepackage{hyperref}% \AtBeginDocument{\RequirePackage{nameref}}
+ % 3. \begin{document}:
+ % 4. \input \jobname.aux
+ % 5. \AtBeginDocument hooks:
+ % 6. \select@language{magyar}
+ % 7. \extrasmagyar
+ % 8. \let\@@magyar@orig@label\label
+ % 9. \RequirePackage{nameref}:
+ % 10. \def\label#1{...}
+ \if1\magyar@opt@@hunnewlabel % only hunnewlabel=only-hu
+ \let\label\@@magyar@orig@label
+ \fi
+ \fi
+ % \let\@@magyar@orig@label\relax % Dat: commenting out this makes it possible to load magyar.ldf twice
+}
+\def\hunnewlabel#1#2{%
+ \def\reserved@a{#2}%
+ \expandafter\ifx\csname r@#1\endcsname\reserved@a% hun and normal labels are the same
+ \relax% \message{No need for def: #1}%
+ \else
+ \global\expandafter\let\csname @@magyar@r@#1\endcsname\reserved@a%
+ \fi
+}
+
+\@gobble
+{^}
+
+% --- captions=
+
+\if0\magyar@opt@@captions\@@magyar@skiplong\fi
+\@namedef{captions\CurrentOption}{%
+ % Dat: inputenc isn't known, so we just use the safe \'a for accented letters.
+ \def\prefacename{El\H osz\'o}%
+ \def\refname{Hivatkoz\'asok}%
+ \def\abstractname{Kivonat}%
+ \def\bibname{Irodalomjegyz\'ek}%
+ \def\appendixname{f\"uggel\'ek}% BUGFIX at Sun Feb 29 22:02:51 CET 2004
+ \def\contentsname{Tartalomjegyz\'ek}%
+ \def\listfigurename{\'Abr\'ak jegyz\'eke}%
+ \def\listtablename{T\'abl\'azatok jegyz\'eke}%
+ \def\indexname{T\'argymutat\'o}%
+ \def\enclname{Mell\'eklet}%
+ \def\ccname{K\"orlev\'el--c\'\i mzettek}% ??
+ \def\headtoname{C\'\i mzett}%
+ \def\proofname{Bizony\'\i t\'as}% AMS-\LaTeX
+ \def\glossaryname{Sz\'ojegyz\'ek}% glosszrium, (magyarzatos) szjegyzk
+ % vvv All these are start with a small letter
+ \def\figurename{\'abra}%
+ \def\chaptername{fejezet}%
+ \def\tablename{t\'abl\'azat}%
+ \def\notesname{Jegyzetek}% endnotes.sty
+ \def\partname{r\'esz}%
+ \def\pagename{oldal}%
+ \def\seename{l\'asd}%
+ \def\alsoname{l\'asd m\'eg}%
+}
+\@gobble
+{^}
+
+% --- Changing the order of the table numbers; tablecaptions=
+
+\if0\magyar@opt@@tablecaptions\@@magyar@skiplong\fi
+ % Wee need `1. tblzat' instead of `Table 1'
+ \if1\magyar@opt@@tablecaptions
+ \def\@@magyar@fnum@table{\thetable.~\tablename}%
+ \else \def\@@magyar@fnum@table{\tablename\nobreakspace\thetable}\fi
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\fnum@table\let\fnum@table\@@magyar@fnum@table}
+ \@gobble
+{^}
+
+% --- Changing the order of the figure numbers; figurecaptions=
+
+\if0\magyar@opt@@figurecaptions\@@magyar@skiplong\fi
+ \if1\magyar@opt@@figurecaptions
+ \def\@@magyar@fnum@figure{\thefigure.~\figurename}%
+ \else \def\@@magyar@fnum@figure{\figurename\nobreakspace\thefigure}\fi
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\fnum@figure\let\fnum@figure\@@magyar@fnum@figure}
+ \@gobble
+{^}
+
+% --- dottedtocline=
+
+\if0\magyar@opt@@dottedtocline\@@magyar@skiplong\fi
+ % Dat: It is quite safe to re-define \@dottedtocline, because it isn't
+ % redefined in standard packages of teTeX 1.
+ %** Overrides latex.ltx. Allows the page number extend beyond \@pnumwidth.
+ \def\@dottedtocline#1#2#3#4#5{%
+ \ifnum #1>\c@tocdepth \else
+ \vskip \z@ \@plus.2\p@
+ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+ {#4}\nobreak
+ \leaders\hbox{\(\m@th
+ \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+ mu\)}\hfill
+ \nobreak
+ % \begingroup needed because of https://tex.stackexchange.com/a/316692/820
+ \setbox\@tempboxa\hbox{\begingroup\normalfont \normalcolor #5\endgroup}% ****pts****
+ \ifdim\wd\@tempboxa<\@pnumwidth\setbox\@tempboxa\hb@xt@\@pnumwidth{\hfil\unhbox\@tempboxa}\fi
+ \box\@tempboxa
+ \par}%
+ \fi}
+ \@gobble
+{^}%
+
+% --- amslevelfix=
+
+% detect ams{ldoc,dtx,art,book,proc}.sty
+\ifnum1<0%
+ \magyar@opt@@amslevelfix
+ \expandafter\ifx\csname setTrue\endcsname\relax\else 1\fi
+ \expandafter\ifx\csname allowttyhyphens\endcsname\relax\else 1\fi
+\space\else\@@magyar@skiplong\fi
+ % Fix amsart.cls etc. so no Overfull \hbox occurs in the \listoffigures.
+ % Changes \@tocline{0}{3pt plus2pt}{0pt}{}{} to \@tocline{0}{3pt plus2pt}{0pt}{\parindent}{}
+ \def\magyar@amslevelfix#1#2#3#4#5#6#7\vfuzz{%
+ \def\reserved@a{#6}%
+ \ifx\@tocline#2\ifx\reserved@a\@empty%
+ \def#1{\@tocline{#3}{#4}{#5}{\parindent}{}}%
+ \fi\fi
+ }
+ \expandafter\magyar@amslevelfix\expandafter\l@table \l@table ,,,,,,,\vfuzz
+ \expandafter\magyar@amslevelfix\expandafter\l@figure\l@figure,,,,,,,\vfuzz
+ \@gobble
+{^}%
+
+% --- amsuppercasefix=
+
+% Fix for small \'\i in capitalized title (no fix needed for \'i and ):
+% \documentlcass{amsart} % amsart.cls
+% \usepackage{t1enc}
+% \usepackage[latin2]{inputenc}
+% \author{author Anal{\'\i}{\'i}zis}
+% \title {title Anal{\'\i}{\'i}zis}
+% \begin{document} \maketitle a\newpage b\newpage c \end{document}
+% This bug is a general amsart.cls bug, not specific to magyar.ldf.
+\ifnum1<0%
+ \magyar@opt@@amsuppercasefix
+ \expandafter\ifx\csname altucnm\endcsname\relax\else 1\fi
+\space\else\@@magyar@skiplong\fi
+ % textcase.sty is not available by default (Ubuntu 8.04 TeX Live), and
+ % newer amsart.cls doesn't have this bug (\'\i gets capitalized properly)
+ \AtEndOfPackage{\IfFileExists{textcase.sty}{\RequirePackage{textcase}}{}}
+ \@gobble
+{^}%
+
+% --- babelmarkfix=
+
+% Fix the language name (\foreignlanguage{\languagename}}) appearing in
+% \@evenhead. Reason: both amsart.cls and babel.def 3.8 redefine \markboth.
+% (There is no problem in Babel 3.7.)
+% This bug is a general Babel 3.8 + amsart.cls bug, not specific to
+% magyar.ldf.
+%
+% Dat: amsart.cls redefines \markboth defined in latex.ltx
+\ifnum0<0%
+ \magyar@opt@@babelmarkfix\relax
+\space\else\@@magyar@skiplong\fi
+ \begingroup
+ %\def\foreignlanguage{\fffffff} % Dat: not called here
+ % Dat: usually called: \mark{\the\@temptokena}
+ %\def\mark#1{\showthe\@temptokena{\toks@{B#1}\global\edef\@@magyar@@marktest{\the\toks@}}}
+ %\def\mark#1{\global\def\@@magyar@@marktest{#1}}
+ \def\mark#1{\global\edef\@@magyar@@marktest{#1}}
+ \let\if@nobreak\iffalse \@gobble\fi\@gobble\fi % Dat: \@gobble: make skippable
+ \def\@@magyar@@marktest@noexp{{\noexpand\@empty BA}{\noexpand\@empty BB}}
+ \expandafter\org@markboth\@@magyar@@marktest@noexp
+ % ^^^ Dat: since we call \org@markboth, the result doesn't depend on the Babel
+ % version, i.e. how Babel redefines \markboth
+ % ^^^ Dat: call changes \@@magyar@@marktest
+ % amsart.cls -> {\noexpand \@empty BA}{\noexpand \@empty BB}
+ % article.cls -> {\@empty BA}{\@empty BB}
+ \ifx\@@magyar@@marktest\@@magyar@@marktest@noexp
+ % OK, now test for \markboth, as defined in Babel 3.8
+ \def\org@markboth#1#2{\global\def\@@magyar@@marktest{#1..#2}}%
+ \markboth{CA}{CB}%
+ % ^^^ Dat: call changes \@@magyar@@marktest
+ % Babel 3.7 -> \foreignlanguage {magyar}{CA}..\foreignlanguage {magyar}{CB}
+ % Babel 3.8 -> \noexpand \foreignlanguage {\languagename }{\noexpand \bbl@restore@actives CA}..\noexpand \foreignlanguage {\languagename }{\noexpand \bbl@restore@actives CB}
+ \def\reserved@a#1#2\hfuzz${#1}%
+ \expandafter\expandafter\expandafter\ifx
+ \expandafter\expandafter\expandafter\noexpand
+ \expandafter\reserved@a\@@magyar@@marktest\relax\hfuzz$%
+ % Dat: we reach this if \@@magyar@@marktest starts by \noexpand
+ % Dat: So now we have amsart.cls + \markboth of Babel 3.8.
+ % The solution is to restore \markboth and \markright of Babel 3.7
+ %\let\reserved@a\@empty \zzzzzz
+ \def\reserved@a{%
+ \let\markright\org@markright
+ \bbl@redefine\markright##1{%
+ \toks@{##1}%
+ \edef\bbl@tempa{%
+ \noexpand\org@markright{%
+ \noexpand\foreignlanguage{\languagename}{\the\toks@}}}%
+ \bbl@tempa
+ }
+ \let\markboth\org@markboth
+ \bbl@redefine\markboth##1##2{%
+ \toks@{##1}\toks8{##2}%
+ \edef\bbl@tempa{%
+ \noexpand\org@markboth{%
+ \noexpand\foreignlanguage{\languagename}{\the\toks@}}{%
+ \noexpand\foreignlanguage{\languagename}{\the\toks8}}}%
+ \bbl@tempa
+ }%
+ }%
+ \else \let\reserved@a\@empty
+ \fi
+ \else \let\reserved@a\empty
+ \fi
+ %\show\reserved@a \let\reserved@a\@empty
+ \global\let\@@magyar@@marktest\@undefined
+ \global\let\@@magyar@@marktest@noexp\@undefined
+ \expandafter\endgroup\reserved@a
+ \@gobble
+{^}%
+
+% --- showfix=
+%
+% Fix stupid \def\show{...} in AtBeginDocument in ucsencs.def by restoring the original
+% definition.
+
+\ifnum0<0%
+ \magyar@opt@@showfix\relax
+\space\else\@@magyar@skiplong\fi
+ \def\magyar@stripcolon#1:#2\vfuzz{#2}%
+ \def\magyar@show@begin@fix{%
+ \edef\reserved@a{\expandafter\magyar@stripcolon\meaning\show:\vfuzz}%
+ \ifx\reserved@a\@empty\else % \show is a macro
+ \let\show\@@magyar@orig@show
+ \fi
+ }
+ \edef\reserved@a{\expandafter\magyar@stripcolon\meaning\show:\vfuzz}%
+ \ifx\reserved@a\@empty % \show is not a macro
+ \let\@@magyar@orig@show\show
+ \expandafter\gdef\expandafter\@preamblecmds\expandafter{%
+ \expandafter\magyar@show@begin@fix\@preamblecmds}%
+ %\show\@begindocumenthook
+ %\AtBeginDocument{\magyar@show@begin@fix}%
+ \fi
+ \@gobble
+{^}%
+
+% --- captionfix=
+%
+% Fix ``1. bra'' order in \caption defined by caption.sty 2004/07/16 v3.0c.
+%
+% The manual fix would be:
+%
+% \DeclareCaptionLabelFormat{simpleMagyar}{#2.\bothIfSecond{\nobreakspace}{#1}}
+% \let\caption@lfmt\caption@lfmt@simpleMagyar
+%
+
+\if0\magyar@opt@@captionfix\@@magyar@skiplong\fi
+ \def\@@magyar@captionfix{\@ifundefined{caption@lfmt}{}{%
+ % Dat: only in preamble: \DeclareCaptionLabelFormat{simpleMagyar}{#2.\bothIfSecond{\nobreakspace}{#1}}
+ \def\caption@lfmt@simpleMagyar##1##2{##2.\bothIfSecond{\nobreakspace}{##1}}%
+ }}
+ \AtBeginDocument{\@@magyar@captionfix}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \ifx\caption@lfmt\caption@lfmt@default % Imp: not if both undefined
+ \ifx\caption@lfmt@simpleMagyar\@undefined\else
+ \babel@save\caption@lfmt
+ \let\caption@lfmt\caption@lfmt@simpleMagyar
+ \fi
+ \fi}
+ \@gobble
+{^}%
+
+
+% --- shortrefcmds=
+
+\if0\magyar@opt@@shortrefcmds\@@magyar@skiplong\fi
+ \def\azr{\aref}% better than \let, because it won't keep old value
+ \def\Azr{\Aref}
+ \def\azp{\apageref}
+ \def\Azp{\Apageref}
+ \def\azc{\acite}
+ \def\Azc{\Acite}
+ \@gobble
+{^}%
+
+% --- longcaption=
+
+\ifx\magyar@caption@centering\@empty\@@magyar@skiplong\fi
+ \def\magyar@caption@hsizecheck{\hsize}
+ % We don't emit the two dots of `1. tblzat.' here, because
+ % has already been emitted by \fnum@table etc.
+ % We apply some formatting depending on the longcaption= option.
+ % Dat: Gyurgyk, p95. says: `11. bra. Hajtsi vltozatok.'
+ \let\@@magyar@do@makecaption\relax% before .toc
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \@@magyar@do@makecaption}
+ \def\@@magyar@do@makecaption@captiontwo@yes{%
+ % Dat: caption2.sty or caption3.sty is loaded; do nothing.
+ }
+ \def\@@magyar@do@makecaption@captiontwo@no{%
+ %** @param #1 \fnum@table or \fnum@figure
+ \def\@makecaption##1##2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{##1.\ ##2}% Dat: `: ' changed to `. ' to match Hungarian typography
+ \ifdim \wd\@tempboxa>\magyar@caption@hsizecheck\relax
+ {\magyar@caption@centering ##1.\magyar@caption@newline ##2\csname par\endcsname}%
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}}
+ \AtBeginDocument{%
+ \expandafter\ifx\csname captionlabeldelim\endcsname\relax
+ \expandafter\ifx\csname caption@lsep@period\endcsname\relax
+ \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@no
+ \else
+ % Dat: caption3.sty is loaded, and it has caption@lsep defined
+ % Dat: \show\caption@lsep@colon % \long\def\caption@lsep@colon{: }
+ % Dat: \show\caption@lsep %\def\caption@lsep{\caption@lsep@colon}
+ \ifx\caption@lsep\caption@lsep@default
+ % There was no \captionsetup{labelsep=...} yet, so we set the
+ % default to period (dot).
+ %
+ % This sets \caption@lsep@default and \caption@lsep.
+ \caption@setdefaultlabelsep{period}%
+ \fi
+ \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@yes
+ \fi
+ \else
+ % Dat: caption2.sty is loaded (and has \def\captionlabeldelim{.} -- but it might have {:})
+ % Dat: we now redefine {:} to {.}
+ % Dat: the user can force {:} by \def\captionlabeldelim{:\empty}
+ % Dat: this works now: \usepackage[german,french,magyar]{babel} \usepackage{caption2} \begin{document} \renewcommand*\captionfont{\itshape} \renewcommand*\captionlabelfont{\scshape}
+ \def\reserved@a{:}%
+ \ifx\reserved@a\captionlabeldelim \def\captionlabeldelim{.}\fi
+ \let\@@magyar@do@makecaption\@@magyar@do@makecaption@captiontwo@yes
+ \fi}
+ \@gobble
+{^}%
+
+% --- labelenums=
+
+\if0\magyar@opt@@labelenums \@@magyar@skiplong\fi
+ \providecommand\@greekalph[1]{%
+ % We use the robust \ensuremath here, similarly to \def\@fnsymbol in
+ % latex.ltx.
+ \ensuremath{\ifcase#1\or\alpha\or\beta\or\gamma\or\delta%
+ \or\varepsilon\or\zeta\or\eta\or\vartheta\or\iota\or\kappa%
+ \or\lambda\or\mu\or\nu\or\xi\or\varphi\or\varpi\or\varrho%
+ \or\varsigma\or\tau\or\upsilon\or\chi\or\psi\or\omega%
+ \else\@ctrerr\fi}}
+ \expandafter\ifx\csname c@enumv\endcsname\relax
+ \@definecounter{enumv}% call this before \def\theenumv
+ \fi
+ \if3\magyar@opt@@labelenums
+ \def\theenumi {\@arabic \c@enumi} \def\labelenumi {\theenumi.}
+ \def\theenumii {\@alph \c@enumii} \def\labelenumii {\itshape\theenumii)}
+ \def\theenumiii{\@greekalph\c@enumiii}\def\labelenumiii{\itshape\theenumiii)}
+ \def\theenumiv {\@Alph \c@enumiv} \def\labelenumiv {\itshape\theenumiv)}
+ \def\theenumv {\@Roman \c@enumv} \def\labelenumc {\theenumv.} % Dat: I'm not sure
+ \else
+ \def\theenumi{\@Roman\c@enumi} \def\labelenumi{\theenumi.}
+ \def\theenumii{\@arabic\c@enumii} \def\labelenumii{\theenumii.}
+ % !! correct \ref style for \the
+ \if1\magyar@opt@@labelenums % hu-a
+ \def\theenumiii{\@alph\c@enumiii} \def\labelenumiii{\itshape\theenumiii)}
+ \def\theenumiv{\@greekalph\c@enumiv} \def\labelenumiv{\itshape\theenumiv)}
+ \def\theenumv{\@Alph\c@enumv} \def\labelenumv {\itshape\theenumv)}
+ \else% hu-A
+ \def\theenumiii{\@Alph\c@enumiii} \def\labelenumiii{\itshape\theenumiii)}
+ \def\theenumiv{\@alph\c@enumiv} \def\labelenumiv{\itshape\theenumiv)}
+ \def\theenumv{\@greekalph\c@enumv} \def\labelenumv {\itshape\theenumv)}
+ \fi
+ \fi
+ \def\reserved@a{% copied from latex.ltx
+ \ifnum \@enumdepth >\thr@@\@toodeep\else
+ \advance\@enumdepth\@ne
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \expandafter\list
+ \csname label\@enumctr\endcsname
+ {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
+ \fi}
+ \ifx\reserved@a\enumerate
+ \def\enumerate{% no \@enumdepth>3
+ \advance\@enumdepth\@ne
+ \expandafter\ifx\csname labelenum\romannumeral\the\@enumdepth\endcsname\relax
+ \@toodeep\advance\@enumdepth\m@ne\else
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \expandafter\list
+ \csname label\@enumctr\endcsname
+ {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
+ \fi}
+ \fi
+ \@gobble
+{^}%
+
+% --- labelitems=
+
+\if0\magyar@opt@@labelitems \@@magyar@skiplong\fi
+ \def\labelitemi{\textendash}
+ % vvv Dat: formerly 2.5pt
+ \def\labelitemii {\raise0.58ex\hbox{\scriptsize\textbullet}}
+ \def\labelitemiii{\raise0.58ex\hbox{\(\scriptstyle\circ\)}}
+ \def\labelitemiv {\raise0.58ex\hbox{\scriptsize\textasteriskcentered}}
+ \def\labelitemv {\raise0.58ex\hbox{\scriptsize\textperiodcentered}}
+ \def\reserved@a{% copied from latex.ltx
+ \ifnum \@itemdepth >\thr@@\@toodeep\else
+ \advance\@itemdepth\@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter\list
+ \csname\@itemitem\endcsname
+ {\def\makelabel##1{\hss\llap{##1}}}%
+ \fi}
+ \ifx\reserved@a\itemize
+ \def\itemize{% no \@itemdepth>3
+ \advance\@itemdepth\@ne
+ \expandafter\ifx\csname labelitem\romannumeral\the\@itemdepth\endcsname\relax
+ \@toodeep\advance\@enumdepth\m@ne\else
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter\list
+ \csname\@itemitem\endcsname
+ {\def\makelabel##1{\hss\llap{##1}}}%
+ \fi}
+ \fi
+ \@gobble
+{^}%
+
+% --- postpara= and postsubpara= and postdescription=
+
+%\show\magyar@opt@@postpara
+%\show\magyar@@unchanged
+\let\magyar@opt@override@paragraphs\@empty
+ \ifx\magyar@opt@@postpara\magyar@@unchanged
+ \ifx\magyar@opt@@postsubpara\magyar@@unchanged
+ \ifx\magyar@opt@@postdescription\magyar@@unchanged
+ \let\magyar@opt@override@paragraphs\@undefined
+ \fi\fi\fi
+\expandafter\ifx\csname magyar@opt@override@paragraphs\endcsname\relax\@@magyar@skiplong\fi
+ % Dat: We make sure that hspaces emitted by \magyar@post@... are unstretchable
+ \def\magyar@post@dot{.\enskip}% \bfseries is the default, same as =bfdot
+ \def\magyar@post@mddot{\textmd.\enskip}%
+ \def\magyar@post@bfdot{\textbf.\enskip}%
+ \let\magyar@post@quad\quad% not recommended in Hungarian
+ \let\magyar@post@enskip\enskip% not recommended in Hungarian
+ \def\magyar@post@em{\hskip1em\relax}%
+ \let\magyar@post@empty\@empty
+ %** from Gyurgy\'ak J\'anos: Szerkeszt\H{o}k \'es szerz\H{o}k k\'ezik\"onyve.
+ %** We don't have a square-shaped, black diamond in our math fonts :-(.
+ \def\magyar@post@diamond{%
+ \enskip\raise.5ex\hbox{\font\f=msam10 at1.3ex \f\char7}\enskip%\ignorespaces% raised \blacklozenge
+ %{\usefont{U}{msa}{m}{n}\small\char7}
+ }
+ \def\magyar@post@star{\enskip\({}^*\)\enskip}%
+ \def\magyar@post@endash{ -- }%
+ \def\magyar@post@semicolon{:\enskip}%
+ \def\magyar@first#1#2\vfuzz{\noexpand#1}%
+ %** Calls \magyar@pf@lowb, and never emits code resulting from #3 to TOC
+ %** @param #1 empty or `*'
+ %** @param #2 \@startsection{...}{...}... call
+ %** @param #3 \paragraph or \subparagraph (selects one of \magyar@post@...)
+ %** @param #4 paragraph title text
+ \def\magyar@pf@lowa#1#2#3#4{%
+ \if#1*\relax
+ \bbl@afterelse\magyar@pf@lowb*%
+ \else
+ \bbl@afterfi \magyar@pf@lowb{[#4]}%
+ \fi
+ {#2}{#3}{#4}%
+ }%
+ % !! a less obscure way for \paragraph, without -1sp etc.
+ %** Calls \magyar@pf@lowb, and never emits code resulting from #3 to TOC
+ %** @param #1 \@startsection{...}{...}... call
+ %** @param #2 \paragraph or \subparagraph (selects one of \magyar@post@...)
+ %** @param #3 paragraph title text
+ %** @param #4 [...] arg to \paragraph
+ \def\magyar@pf@lowc#1#2#3[#4]{%
+ \magyar@pf@lowb{[#4]}{#1}{#2}{#3}%
+ }%
+ %** Calls \magyar@post@paragraph and \magyar@post@subparagraph
+ %** @param #1 [#4] or `*' (what goes to TOC?)
+ %** @param #2 \@startsection{...}{...}... call
+ %** @param #3 \paragraph or \subparagraph
+ %** @param #4 paragraph title text
+ \def\magyar@pf@lowb#1#2#3#4{%
+ #2#1{#4\csname magyar@post@\expandafter\@gobble\string#3\endcsname\kern\z@}%
+ % ^^^ Dat: \kern\z@ is needed so \unskip won't occur at \paragraph*
+ % ^^^ Dat: {#4\csname...} is needed so \magyar@post@dot makes a {\bf.}
+ % Dat: \ignorespaces is superflous here, it also doesn't ignore \par
+ }%
+ %** Fixes (redefines) the specified macro so postpara= and postsubpara=
+ %** takes effect. It is useful to call this after a `\renewcommand\paragraph'
+ %** in a package. Has no effect if the definition of #1 doesn't look like
+ %** the one in article.cls (i.e. \@startsection) or if it's not defined
+ %** (such as in beamer.cls).
+ %** @param #1 \paragraph or \subparagraph
+ \def\magyar@paragraphfix#1{%
+ \ifx#1\@undefined\else
+ % Change only if defined.
+ \expandafter\magyar@paragraphfix@defined\expandafter#1\fi
+ }
+ \def\magyar@paragraphfix@defined#1{%
+ \expandafter\magyar@pf@lowd\expandafter#1#1\hfuzz........\vfuzz
+ }
+ \def\magyar@pf@lowd#1#2#3#4#5#6#7#8#9\vfuzz{%
+ % Dat: \unskip doesn't work, have to change \hskip to -1sp: 1sp is the
+ % amount of horizontal space between the diamond and the paragraph text
+ % 0sp would be bad, because it isn't negative (positive skips are
+ % interpreted as vertical).
+ %%
+ \expandafter\def\expandafter\reserved@a\expandafter{\magyar@first#9\vfuzz}%
+ %\def\reserved@a{#9}\ifx\reserved@a\@empty
+ \if\reserved@a\hfuzz\ifx#2\@startsection\if-\magyar@first#7\vfuzz
+ \def#1{\@ifstar
+ {\magyar@pf@lowa *{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}%
+ {\@ifnextchar[%]
+ {\magyar@pf@lowc{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}%
+ {\magyar@pf@lowa{}{#2{#3}{#4}{#5}{#6}{-1sp}{#8}}#1}%
+ }%
+ }%
+ \fi\fi\fi
+ }
+ % !! Imp: change Hungarian \paragraph()s only, with dual load
+ \ifx\magyar@opt@@postpara\magyar@@unchanged\else
+ \expandafter\let\expandafter\magyar@post@paragraph\csname magyar@post@\magyar@opt@@postpara\endcsname
+ \ifx\magyar@post@paragraph\relax
+ \@@magyar@error{Invalid arg for option: postpara = \magyar@opt@@postpara}%
+ \else
+ \magyar@paragraphfix\paragraph
+ \fi
+ \fi
+ \ifx\magyar@opt@@postsubpara\magyar@@unchanged\else
+ \expandafter\let\expandafter\magyar@post@subparagraph\csname magyar@post@\magyar@opt@@postsubpara\endcsname
+ \ifx\magyar@post@subparagraph\relax
+ \@@magyar@error{Invalid arg for option: postsubpara = \magyar@opt@@postsubpara}%
+ \else
+ \magyar@paragraphfix\subparagraph
+ \fi
+ \fi
+ \ifx\magyar@opt@@postdescription\magyar@@unchanged\else
+ \expandafter\let\expandafter\magyar@post@description\csname magyar@post@\magyar@opt@@postdescription\endcsname
+ \ifx\magyar@post@description\relax
+ \@@magyar@error{Invalid arg for option: postdescription = \magyar@opt@@postdescription}%
+ \else
+ \def\magyar@@descriptionfont{\normalfont\bfseries}%
+ \def\descriptionlabel#1{\hskip\labelsep{\magyar@@descriptionfont#1}\magyar@post@description\hskip-\labelsep}%
+ \fi
+ \fi
+ \@gobble
+{^}%
+
+% --- afterindent=
+
+\ifnum\magyar@opt@@afterindent>8 \@@magyar@skiplong\fi
+ \ifnum\magyar@opt@@afterindent<1 % force-no
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@afterindenttrue
+ \let\@afterindenttrue\@afterindentfalse
+ }%
+ \else% force-yes
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@afterindentfalse
+ \let\@afterindentfalse\@afterindenttrue
+ }%
+ \fi
+ \@gobble
+{^}
+
+% --- default \frenchspacing; frenchspacing=
+
+\if0\magyar@opt@@frenchspacing \@@magyar@skiplong\fi
+ \if1\magyar@opt@@frenchspacing% =no
+ \def\@@magyar@antifrenchspacing{% only does some caching
+ \ifnum\the\sfcode`\.=\@m
+ \nonfrenchspacing
+ \let\@@magyar@nonfrenchspacing\frenchspacing
+ \else
+ \let\@@magyar@nonfrenchspacing\relax
+ \fi}
+ \let\@@magyar@nonantifrenchspacing\frenchspacing
+ \expandafter\addto\csname extras\CurrentOption\endcsname{\@@magyar@antifrenchspacing}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{\@@magyar@nonantifrenchspacing}
+ \else
+ \expandafter\addto\csname extras\CurrentOption\endcsname{\bbl@frenchspacing}
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{\bbl@nonfrenchspacing}
+ \fi
+ \@gobble
+{^}
+
+
+% --- Putting dots after section number in toc/lof/lot; sectiondot=
+%
+% This is to have a dot after figure/table numbers in lof/lot and
+% section numbers in toc.
+%
+% The option sectiondot= is ill-named, because it doesn't apply to what is
+% displayed in \section, but it applies to \tableofcontents, \listoftables
+% and \listoffigures.
+
+\if0\magyar@opt@@sectiondot \@@magyar@skiplong\fi
+ \ifnum\magyar@opt@@sectiondot>1
+ % This solution (for sectiondot=problematic) is what was provided by
+ % magyar.ldf v1.4. It is incomatible with lots of packages.
+ %
+ % [pts] This doesn't work with nameref.sty.
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@caption
+ \long\def\@caption#1[#2]#3{%
+ \csname par\endcsname
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@#1\endcsname}%
+ {\ignorespaces #3}\csname par\endcsname
+ \endgroup}}
+
+ % [pts] This is incompatible with some packages.
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ % Alas, \@sect must also be redefined to have that dot in toc too.
+ % On the other hand, we include a dot after a run-in head.
+ \babel@save\@sect
+ \def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \let\@svsec\@empty
+ \else
+ \refstepcounter{#1}%
+ \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+ \fi
+ \@tempskipa #5\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #6{%
+ \@hangfrom{\hskip #3\relax\@svsec}%
+ \interlinepenalty \@M #8\@@par}%
+ \endgroup
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname.}%
+ \fi
+ #7}%
+ \else
+ \def\@svsechd{%
+ #6{\hskip #3\relax
+ \@svsec #8.}%
+ \csname #1mark\endcsname{#7}%
+ \addcontentsline{toc}{#1}{%
+ \ifnum #2>\c@secnumdepth \else
+ \protect\numberline{\csname the#1\endcsname.}%
+ \fi
+ #7}}%
+ \fi
+ \@xsect{#5}}}
+
+ % [pts] This is incompatible with some packages.
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ % In order to have that dot after a run-in head when the star form of the
+ % sectioning commands is used, we have to redefine \@ssect
+ \babel@save\@ssect
+ \def\@ssect#1#2#3#4#5{%
+ \@tempskipa #3\relax
+ \ifdim \@tempskipa>\z@
+ \begingroup
+ #4{%
+ \@hangfrom{\hskip #1}%
+ \interlinepenalty \@M #5\@@par}%
+ \endgroup
+ \else
+ \def\@svsechd{#4{\hskip #1\relax #5.}}%
+ \fi
+ \@xsect{#3}}}
+ \else
+ % This implements option sectiondot=safe.
+ %
+ % [pts] We definitely want \numberline to emit table number in \listoftables as
+ % `5.6.' instead of the default `5.6', but we don't want to redefine \@caption,
+ % because the # args \addcontentsline adds to \contentsline depends on whether
+ % nameref.sty (hyperref.sty) is loaded (no nameref: 3, w/ nameref: 4); this
+ % would cause the strange `Package hyperref Warning: No destination for
+ % bookmark of \addcontentsline'.
+ % So we rather redefine \numberline. But we cannot simply add a dot, because
+ % it might be already present (e.g in \tableofcontents). So we add a dot only
+ % if it is missing. This modification affects \tableofcontents, \listoffigures
+ % and \listoftables. The presence of the dot in TOC depends on the language
+ % the section was defined in.
+ % amsart.sty uses \tocsection instead of \numberline, see amstocnumskip=
+ % below
+ \def\magyar@striplastdot@lowa#1.\relax{#1\relax}%
+ \def\magyar@striplastdot@lowb#1\relax#2\relax{#1}%
+ %** \@tempdima is set by \@dottedtocline, called by \l@section
+ \def\magyar@numberline#1\vfuzz{\hb@xt@\@tempdima{#1.\hfil}}%
+ \def\@@magyar@numberline@pre#1{%
+ \expandafter\expandafter\expandafter\magyar@numberline
+ \expandafter\magyar@striplastdot@lowb\magyar@striplastdot@lowa#1\relax.\relax\vfuzz
+ }%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\numberline
+ %** Overrides latex.ltx
+ \let\numberline\@@magyar@numberline@pre
+ }
+ \fi
+ \@gobble
+{^}
+
+% --- amspostsectiondot=
+
+\if0\magyar@opt@@amspostsectiondot \@@magyar@skiplong\fi
+ % Now fix ams*.cls so that they don't put a dot after the section title.
+ % First check whether the definition of \@sect contains
+ % \global\@nobreaktrue\@xsect
+ \long\def\@@magyar@amssect@fixa#1\global\@nobreaktrue\@xsect#2\hfuzz#3{%
+ \ifx\hfuzz#2\hfuzz\else% found
+ \@@magyar@amssect@fixb#3\fi}
+ %** @param #1 a \cs, e.g \@sect
+ \def\@@magyar@amssect@fixb#1{%
+ \expandafter\let\csname @@magyar@amssect@saved\string#1\endcsname#1%
+ \edef#1{\noexpand\expandafter\noexpand\@@magyar@amssect@low
+ \expandafter\noexpand\csname @@magyar@amssect@saved\string#1\endcsname}%
+ \let\@svsechd\@empty% prevent Undefied \cs
+ %** Definition of \@sect in ams*.cs ends by `\global\@nobreaktrue{#5}'
+ \long\def\@@magyar@amssect@low##1\global\@nobreaktrue{%
+ ##1%
+ \expandafter\def\expandafter\@svsechd\expandafter{%
+ \expandafter\let\expandafter\@addpunct\expandafter\@gobble \@svsechd}%
+ \global\@nobreaktrue
+ }%
+ }
+ \expandafter\@@magyar@amssect@fixa\@sect[][][][][][][][]\global\@nobreaktrue\@xsect\hfuzz\@sect
+ \expandafter\@@magyar@amssect@fixa\@sect[][][][][][][][]\global\@nobreaktrue\@xsect\hfuzz\NR@sect% with nameref.sty
+ \@gobble
+{^}%
+
+% --- amstocnumskip=, amstocnumlang=
+%
+% Change \tocsection, \tocsubsection etc. in amsart.cls etc. These commands
+% have effect in \tableofcontents, e.g. in the .toc file:
+% `\contentsline {section}{\tocsubsection {}{1.1}{Foo}}{1}'
+%
+% We should be careful not to define \tocchapter and \tocsection if
+% tocbibind.sty is (or will be) loaded, because it provides its own definition
+% as \newcommand.
+
+\ifx\@empty\magyar@opt@@amstocnumskip \@@magyar@skiplong\fi
+ % Similar to titleskip=, but AMS classes don't look at \@seccntformat
+ \def\@@magyar@amstocnumskip@lets{%
+ \ifx\tocsubsection\@undefined\else
+ \ifx\tocsubsection\tocparagraph
+ \def\tocsubsection{\tocsection}%
+ % These lines are similar to those in amsart.cls.
+ \let\tocsubsubsection\tocsubsection
+ \let\tocparagraph\tocsubsection
+ \let\tocsubparagraph\tocsubsection
+ \let\tocpart\tocsubsection
+ \let\tocchapter\tocsubsection
+ \fi
+ \fi
+ }%
+ \def\@@magyar@amstocnumskip@defs{%
+ \ifx\tocsubsection\@undefined\else
+ \ifx\tocsubsection\tocparagraph
+ %** Overrides amsart.cls, amsbook.cls etc.
+ %** Only for Hungarian \section{}s. Changes \quad to
+ %** \magyar@opt@@amstocnumskip in the definition. Also changes
+ %** ``fejezet 1'' to ``1. fejezet'' for \chapter
+ %** (We have \def\tocchapter{\tocsection} by default.)
+ \def\tocsection##1##2##3{%
+ %%\typeout{--##3--}%
+ \indentlabel{%
+ \def\reserved@a{##1}%
+ \def\reserved@b{##2}%
+ \ifx\reserved@b\empty
+ \else\ifx\reserved@a\chaptername
+ % * Sometimes (but not in \tableofcontents) #1 is
+ % `\csname chaptername\endcsname'. Why?
+ % * \tocappendix is called instead of \tocsection for the
+ % appendix.
+ \ifnum\magyar@opt@@chapternumber=1 \@huordinal{##2}~%
+ \else\ifnum\magyar@opt@@chapternumber=2 \@Huordinal{##2}~%
+ \else##2.~%
+ \fi\fi
+ ##1.\magyar@opt@@amstocnumskip
+ \else\ifx\reserved@a\partname
+ \ifnum\magyar@opt@@partnumber=1 \@huordinal{##2}~%
+ \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal{##2}~%
+ \else##2.~%
+ \fi\fi
+ ##1.\magyar@opt@@amstocnumskip
+ \else
+ \ignorespaces##1 ##2.\magyar@opt@@amstocnumskip
+ \fi\fi\fi}%
+ ##3}%
+ %** Overrides amsart.cls etc. Only for Hungarian \section{}s. Changes \quad to
+ %** \magyar@opt@@amstocnumskip in the definition.
+ \def\tocappendix##1##2##3{%
+ \indentlabel{%
+ \def\reserved@a{##1}%
+ \ifx\reserved@a\appendixname
+ ##2\ifx\@@magyar@appendixname\@empty.\fi~##1%
+ \else
+ ##1\@ifnotempty{##2}{ ##2}%
+ \fi
+ .\magyar@opt@@amstocnumskip}%
+ ##3}%
+ \fi
+ \fi
+ }%
+ \AtBeginDocument\@@magyar@amstocnumskip@lets % must be before @defs
+ \if2\magyar@opt@@amstocnumlang
+ \AtBeginDocument\@@magyar@amstocnumskip@defs
+ %\let\@@magyar@amstocnumskip@defs\@undefined% for use by the user
+ \else
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\tocsection \babel@save\tocappendix
+ \@@magyar@amstocnumskip@defs
+ }
+ \fi
+ \@gobble
+{^}%
+
+
+% --- Fixup Babel language selection glitches; toclang=
+
+% There are fundamental problem of emitting \select@language items in LOT
+% files.
+%
+% Problem (3): When using \begin{table}...\end{table} \selectlanguage{foo}
+% \begin{table}...\end{table}, the LaTeX-Babel scheme will not emit a
+% \select@language{foo} between the two \contentsline{}s in \jobname.lot. The
+% TOC file is OK, because section titles aren't floats. (But what about
+% \mark{}s?).
+%
+% Problem (1): \selectlanguage emits .aux entries even
+% if the language isn't really changed.
+%
+% Problem (2): babel.def has
+% `\AtBeginDocument...\selectlanguage...\bbl@main@language', from which an
+% \immediate is missing, so the \select@language is emitted to the .aux file
+% after the first float has been typeset. A better solution would be
+% `\select@language{\languagename}', which forcibly activates the default
+% language.
+%
+% Problem (4): \ps@headings isn't run \AtBeginDocument, but book.cls runs
+% \pagestyle{headings} when it is loaded. We should change this to
+% \AtBeginDocument or similar.
+
+\ifnum\magyar@opt@@toclang=0 \@@magyar@skiplong\fi
+ \ifnum\magyar@opt@@toclang>1 % toclang=good
+ % Solve problems (2) and (4). Timing is critical. \select@language must
+ % be called after \AtBeginDocument, so \catcode{}s won't be \activated
+ % too early. (Because some code in \AtBeginDocument might issue an
+ % \input such as hyperref.sty which does \RequirePackage{nameref}.)
+ % Note that \extrasmagyar containing the \catcode changes is
+ % only run when `magyar' is the default language (last arg of
+ % \usepackage[...]{babel}). If that is run after \AtBeginDocument hooks,
+ % then most packages will use 12 as \catcode\string``, which is intended.
+ % \@@magyar@setup@psheadings might just be run \AtBeginDocument, it doesn't
+ % need \@preamblecmds -- but it must be after \select@language.
+ %
+ % \@preamblecmds is expanded after \@begindocumenthook
+ \expandafter\gdef\expandafter\@preamblecmds\expandafter{\@preamblecmds
+ \@@magyar@setup@psheadings% Solve problem (4). Before \selectlanguage.
+ \select@language{\languagename}% force initial language
+ }%
+ % Solve problem (1) and assist solving problem (2) by not emitting
+ % \select@language twice.
+ \def\bbl@set@language#1{%
+ \edef\@Lang@tmp{%
+ \ifcat\noexpand\noexpand\noexpand#1% a control sequence
+ \expandafter\expandafter\expandafter\@gobble\expandafter\string
+ \fi
+ #1%
+ }%
+ \ifx\languagename\@Lang@tmp\else
+ \let\languagename\@Lang@tmp
+ \select@language{\languagename}%
+ \fi
+ }%
+ % Solve problem (3).
+ \long\def\addtocontents#1#2{%
+ % Dat: \noexpand should be avoided in \protected@write
+ \protected@write\@auxout
+ {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble \let\select@language\relax}%
+ {\string\@writefile{#1}{\string\select@language{\languagename} #2}}}
+ \else
+ % Solve problems (2) and (4).
+ \AtBeginDocument{%
+ \if@filesw \immediate\write\@mainaux{%
+ \string\select@language{\languagename}%
+ \string\@writefile{toc}{\string\select@language{\languagename}}%
+ \string\@writefile{lof}{\string\select@language{\languagename}}%
+ \string\@writefile{lot}{\string\select@language{\languagename}}%
+ }\fi
+ \@@magyar@setup@psheadings% Solve problem (4). Before \selectlanguage.
+ \select@language{\languagename}% force initial language
+ }
+ % Solve problem (1) and assist solving problem (2) by not emitting
+ % \select@language twice.
+ \def\bbl@set@language#1{%
+ \edef\@Lang@tmp{%
+ \ifcat\noexpand\noexpand\noexpand#1% a control sequence
+ \expandafter\expandafter\expandafter\@gobble\expandafter\string
+ \fi
+ #1%
+ }%
+ \ifx\languagename\@Lang@tmp\else
+ \let\languagename\@Lang@tmp
+ \select@language{\languagename}%
+ \if@filesw \protected@write\@auxout{}{%
+ \string\select@language{\languagename}%
+ \string\@writefile{toc}{\string\select@language{\languagename}}%
+ \string\@writefile{lof}{\string\select@language{\languagename}}%
+ \string\@writefile{lot}{\string\select@language{\languagename}}%
+ \fi}%
+ \fi
+ }%
+ % Don't solve problem (3).
+ \fi
+ \@gobble
+{^}%
+
+% --- suggestions=
+
+\ifnum\magyar@opt@@suggestions=0 \@@magyar@skiplong\fi
+ % Dat: buggy varioref.sty adds this to extrasmagyar (\AtBeginDocument is
+ % buggy, can be used only in the preamble.
+ % \def\reftextfaceafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}%
+ % \def\reftextfacebefore{az el\H{o}\-z\H{o} ol\-da\-lon}%
+ % \def\reftextafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}%
+ % \def\reftextbefore {az el\H{o}\-z\H{o} ol\-da\-lon}%
+ % \def\reftextcurrent {ezen az ol\-da\-lon}%
+ % \def\reftextfaraway#1{\aza{\pageref{#1}} \pageref{#1}.~ol\-da\-lon}%
+ % \def\reftextpagerange#1#2{\vref@stringwarning\reftextpagerange
+ % on pages~\pageref{#1}--\pageref{#2}}%
+ % \def\reftextlabelrange#1#2{\vref@stringwarning\reflabelpagerange
+ % \ref{#1} to~\ref{#2}}%
+ % \AtBeginDocument{\providecommand\aza[1]{a/az%
+ % \PackageError{varioref}{%
+ % Proper definition for command \noexpand\aza missing}%
+ % {You need to (re)define the command \noexpand\aza that
+ % takes one argument (a number or a \noexpand\pageref command)
+ % and produces the string `a' or `az' depending on the argument
+ % value. It should also accept an optional argument (default `l')
+ % to denote whether or not the string should be lowercase or
+ % uppercase.}}}%
+ \def\@@magyar@ignorehbox@pree#1\hbox$#2{}%$
+ %\def\@@magyar@grep@reftextcurrent#1\def\reftextcurrent#2\hbox$
+ \def\@@magyar@grep@reftextbegin#1\def\reftextfaceafter#2\hfuzz\hfuzz\hfuzz#3\hbox$#4{%$
+ \toks@={#1#3}% Dat: # -> ## conversion for \def
+ \expandafter\global\expandafter\edef\csname extras#4\endcsname
+ {\the\toks@}%
+ }
+ \def\@@magyar@grep@reftextcurrent#1\def\reftextlabelrange#2#3#4#5#6%
+ \AtBeginDocument#7#8\hbox$#9{%$ Dat: no need for \long\def
+ % ^^^ Dat: Don't use `#21', because then #2 would match multiple tokens
+ \ifx#31% found real data, not sentinel
+ \PackageWarningNoLine{#9.ldf}{Do not load buggy \string\usepackage[magyar]{varioref},\MessageBreak load simply \string\usepackage{varioref}}%
+ % vvv remove code inserted by varioref.sty
+ \@@magyar@grep@reftextbegin#1\hfuzz\hfuzz\hfuzz#8\hbox${#9}%$
+ \fi
+ }
+ \def\magyar@sugg@vr#1{%
+ \expandafter\expandafter\expandafter\@@magyar@grep@reftextcurrent
+ \csname extras#1\endcsname\hbox${#1}\@@magyar@ignorehbox@pree%$
+ \def\reftextlabelrange23456\AtBeginDocument78\hbox${#1}%$
+ }
+ \def\magyar@sugg@to#1{%
+ % In lualatex, the (unchecked) recommendation is: don't do \usepackage{t1enc}.
+ \ifnum0\ifx\luatexversion\@undefined1\fi\ifx\luatexversion\relax1\fi>0
+ \def\reserved@a{T1}%
+ \edef\reserved@b{\encodingdefault}% \encodingdefault is \long for t1enc.sty, but not for fontenc.sty
+ \ifx\reserved@a\reserved@b\else
+ \@latex@warning@no@line{Please use \string\usepackage{t1enc} with\MessageBreak \string\usepackage[#1]{babel}, to get accented chars hyphenated}%
+ % ^^^ Dat: \usepackage[T1]{fontenc} is equally good, but less effective
+ \fi
+ \fi
+ }
+ \def\magyar@sugg@ie@lowb#1{\@latex@warning@no@line{%
+ Please use \string\usepackage[latin2]{inputenc}\MessageBreak
+ or \string\usepackage[utf8]{inputenc}\MessageBreak
+ with \string\usepackage[#1]{babel}}}%
+ %** @param #1 Code to run if encoding in \reserved@b is unknown.
+ \def\magyar@sugg@ie@lowu#1{%
+ \def\reserved@a{latin2}%
+ \ifx\reserved@a\reserved@b\else
+ \def\reserved@a{utf8}%
+ \ifx\reserved@a\reserved@b\else
+ \def\reserved@a{utf8x}%
+ \ifx\reserved@a\reserved@b\else
+ \def\reserved@a{cp1250}%
+ \ifx\reserved@a\reserved@b\else
+ #1%
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+ %** @param #1 empty (old) or \protect
+ %** @param #2 input encoding name
+ \def\magyar@sugg@ie@low#1\@inpenc@undefined@#2#3\vfuzz#4{%
+ \def\reserved@b{#2}%
+ \magyar@sugg@ie@lowu{\magyar@sugg@ie@lowb{#4}}%
+ }%
+ \def\magyar@sugg@ie#1{%
+ % In lualatex, the (unchecked) recommendation is: don't do \usepackage[...]{inputenc}, do \usepackage[...]{luainputenc} only if not utf8.
+ \ifnum0\ifx\luatexversion\@undefined1\fi\ifx\luatexversion\relax1\fi>0
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter
+ \reserved@b\expandafter\expandafter\expandafter{%
+ \csname inputencodingname\endcsname}%
+ \magyar@sugg@ie@lowu{%
+ \ifx\reserved@a\reserved@b\else
+ % Dat: don't print warning for missing \usepackage
+ \expandafter\ifx\csname @inpenc@undefined\endcsname\relax
+ \magyar@sugg@ie@lowb{#1}%
+ \else
+ % from inputenc.sty: \edef\@inpenc@undefined{\noexpand\@inpenc@undefined@{#1}}%
+ % > \@inpenc@undefined=macro:
+ % ->\@inpenc@undefined@ {latin2}.
+ \expandafter\magyar@sugg@ie@low\@inpenc@undefined....\vfuzz{#1}%
+ \fi
+ \fi
+ }%
+ \fi
+ }%
+ \def\magyar@sugg@af#1{%
+ \expandafter\ifx\csname#1Options\endcsname\relax\else
+ \PackageWarningNoLine{#1.ldf}{No effect of \string\def\@backslashchar #1Options{...}\MessageBreak
+ please move it before \string\usepackage[#1]{babel}}%
+ \fi
+ }%
+ \def\@@magyar@@ps@fancy{\relax}%\@fancyplainfalse\ps@@fancy}%
+ \def\magyar@sugg@fh#1{%
+ \ifx\ps@fancy\@@magyar@@ps@fancy
+ \PackageWarningNoLine{#1.ldf}{No effect on fancyhdr.sty,\MessageBreak
+ please load it before \string\usepackage[#1]{babel}}%
+ \fi
+ }%
+ \def\magyar@sugg@ap#1{%
+ \expandafter\ifx\csname opt@#1.ldf.sty\endcsname\relax\else
+ \PackageWarningNoLine{#1.ldf}{No effect of \@backslashchar PassOptionsToPackage{?}{#1.ldf}\MessageBreak
+ please move it before \string\usepackage[#1]{babel}}%
+ \fi
+ }%
+ \edef\reserved@a{\noexpand\AtBeginDocument{%
+ \noexpand\magyar@sugg@pa{\CurrentOption}%
+ \noexpand\magyar@sugg@af{\CurrentOption}%
+ \noexpand\magyar@sugg@ap{\CurrentOption}%
+ \noexpand\magyar@sugg@to{\CurrentOption}%
+ \noexpand\magyar@sugg@ie{\CurrentOption}%
+ \noexpand\magyar@sugg@vr{\CurrentOption}%
+ \noexpand\magyar@sugg@fh{\CurrentOption}%
+ }}\reserved@a
+ \@gobble
+{^}%
+
+% --- Active characters and shorthands; active=, activeprefix=, activespace=
+
+\ifnum0=\magyar@opt@@activespace\magyar@opt@@active\space
+ \def\@@magyar@declare@shorthandx#1#2{%
+ \expandafter\def\csname @@magyar@shorthand@\string#1\endcsname{#2}%
+ }
+\@@magyar@skiplong\fi
+ \def\magyar@activate@shorthands{%
+ \edef\reserved@a{%
+ \noexpand\addto\expandafter\noexpand\csname extras\CurrentOption\endcsname
+ {\noexpand\languageshorthands{\CurrentOption}}%
+ }
+ \reserved@a
+ \let\magyar@activate@shorthands\relax
+ }
+ \let\@@magyar@saved@initiate@active@char\initiate@active@char
+ %
+ % vvv Fri Oct 1 18:09:55 CEST 2004
+ % This is the ultimate fix of the .aux file catcodes when
+ % \usepackage[german,magyar]{babel} or
+ % \usepackage[french,magyar]{babel}.
+ % This enforces \catcode\string``=12 very early into the .aux file.
+ % Imp: don't let \catcode``\active too early...
+ {\toks@\expandafter{\expandafter\@@magyar@protect@backtick\@begindocumenthook}%
+ \xdef\@begindocumenthook{\the\toks@}}% Dat: \@begindocumenthook has #1 #2 etc.
+ \def\@@magyar@protect@backtick{%
+ \if@filesw\immediate\write\@auxout{\catcode\noexpand\string``=12}\fi}
+ %
+ %** @param #1 a non-active char token
+ %** @param #2 activation type: 0, 1, 2 or 3
+ % !! quick link to \@@magyar@shorthand
+ \def\magyar@activate@char#1#2{%
+ \ifnum#2>1 % ignore 0 and 1
+ \ifnum#2>2 % 3
+ % SUXX, breaks compatibility with graphicx.sty and hyperref.sty and possibly
+ % with many other packages using \catcode`` etc.
+ %** Fix .aux load timing bug.
+ \AtBeginDocument{%
+ \if@filesw\immediate\write\@auxout{\catcode\noexpand\string`#1=12}\fi
+ }
+ \initiate@active@char{#1}%
+ \else% 2
+ % Dat: german.ldf emits `\catcode`"\active'; we should emit our
+ % catcode change (\catcode\string``=12) before that
+ % Dat: this works only with \usepackage[magyar,german,magyar]{babel},
+ % not with \usepackage[german,magyar]{babel}
+ % solution: \AtBeginDocument{\if@filesw\immediate\write\@auxout{\catcode\noexpand\string`#1=12}\fi}
+ \let\magyar@saved@AtBeginDocument\AtBeginDocument
+ \let\AtBeginDocument\@gobble
+ % vvv Calls \AtBeginDocument to set \catcode to \active and also write such a
+ % line to the .aux file. We just ignore it.
+ \initiate@active@char{#1}%
+ \let\AtBeginDocument\magyar@saved@AtBeginDocument
+ \let\magyar@saved@AtBeginDocument\@undefined
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\catcode\string`#1}%
+ \catcode\string`#1=13 %
+ }%
+ \fi
+ % Dat: now #1 is \active (done by \initiate@active@char)
+ \lccode\string`~=\string`#1\lowercase{% Dat: luckily everything below is in lowercase
+ \expandafter\addto\csname extras\CurrentOption\endcsname {\bbl@activate{~}}%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{\bbl@deactivate{~}}%
+ }
+ \lccode\string`~=0
+ \catcode\string`#1=12 % Imp: restore _old_ catcode
+ \fi
+ }
+ %** @param #1 shorthand prefix character (depends on activeprefix=)
+ %** @param #2 a single character (will be prefixed)
+ %* @param #3 TeX code
+ \def\@@magyar@declare@shorthand@low#1#2#3{%
+ \declare@shorthand{\CurrentOption}{#1#2}{#3}%
+ }
+ \edef\@@magyar@shorthandprefix{\string`}%
+ %** @param #1 a single character (will be prefixed by ``' etc.)
+ %* @param #2 TeX code
+ %\def\@@magyar@declare@shorthand#1#2{\magyar@opt@@activeprefix#1{#2}}% defined below
+ \ifx\magyar@opt@@activeprefix\relax
+ \def\magyar@opt@@active{0}% =none
+ \def\magyar@opt@@openqq{0}% =unchanged (this must be defined before processing openqq below)
+ \else\edef\@@magyar@declare@shorthand#1#2{\noexpand\@@magyar@declare@shorthand@low\expandafter\string\magyar@opt@@activeprefix#1{#2}}\fi
+ %\magyar@activate@shorthands% not yet
+ \def\@@magyar@declare@shorthandx#1#2{%
+ \magyar@activate@shorthands
+ \expandafter\def\csname @@magyar@shorthand@\string#1\endcsname{#2}%
+ \expandafter\@@magyar@declare@shorthand\expandafter#1\expandafter{\csname @@magyar@shorthand@\string#1\endcsname}%
+ }
+ \@gobble
+{^}%
+
+%** Call \@@magyar@shorthand@... For example: {`tty} and
+%** {\@@magyar@shorthand tty} are interchangeable.
+%** @param #1 a char token.
+\def\@@magyar@shorthand#1{%
+ \expandafter\ifx\csname @@magyar@shorthand@\string#1\endcsname\relax
+ \@@magyar@error{Unknown shorthand: \string#1 }%
+ \else
+ \expandafter\expandafter\csname @@magyar@shorthand@\string#1\endcsname
+ \fi
+}
+
+% --- activespace= Extra \thispace before :, ;, ! and ?
+%
+% french.ldf has \space after `:', but we only have \thinspace
+
+\ifnum\magyar@opt@@activespace=0 \@@magyar@skiplong\fi
+ %** @param #1 any of : ; ! ?
+ \def\magyar@thinspaced#1{%
+ % Dat: `!' at the end of the word is OK, but at the beginning it makes the
+ % word unhyphenatable. Imp: maybe \nobreak\hskip\z@skip?
+ % Dat: This is math-mode safe, because \ifhmode is false in math mode.
+ \ifhmode% \ifhmode and \ifmmode are never true
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\kern.1em% \thinspace is .16667em
+ \else
+ \kern.1em
+ \fi
+ \fi
+ \string#1%
+ }
+ \magyar@activate@shorthands
+ \magyar@activate@char;\magyar@opt@@activespace
+ \declare@shorthand{\CurrentOption}{;}{\magyar@thinspaced;}
+ \magyar@activate@char!\magyar@opt@@activespace
+ \declare@shorthand{\CurrentOption}{!}{%
+ \ifmmode
+ \expandafter\ifx\csname factorial\endcsname\relax\mathchar"5021 \else\factorial\fi
+ \else\magyar@thinspaced!\fi}
+ % ^^^ compatibility with nath.sty
+ \magyar@activate@char?\magyar@opt@@activespace
+ \declare@shorthand{\CurrentOption}{?}{\magyar@thinspaced?}
+ \magyar@activate@char:\magyar@opt@@activespace
+ \declare@shorthand{\CurrentOption}{:}{\magyar@thinspaced:}
+ \@gobble
+{^}%
+
+
+% --- active=
+%
+% Dat: active=safe isn't safe unless other .ldf files used don't call
+% \initiate@active@char{`}.
+%
+% `` `' `= `_ `-- `- `| `< `> `" `~ etc.
+
+\ifnum\magyar@opt@@active=0
+ \ifnum\magyar@opt@@openqq>0 \@@magyar@error{active=none implies openqq=unchanged}\fi
+\@@magyar@skiplong\fi
+ \ifnum\magyar@opt@@active>1
+ \magyar@activate@shorthands% Dat: don't do it if \magyar@opt@@active=0
+ \expandafter\magyar@activate@char\magyar@opt@@activeprefix\magyar@opt@@active
+ \fi
+ %
+ \ifnum\magyar@opt@@openqq>1 % =down
+ % Same as in in ukraineb.ldf
+ \@@magyar@declare@shorthandx`{\glqq}% down 99 \glqq is Babel's macro containing \quotedblbase
+ \@@magyar@declare@shorthandx'{\grqq}% up 66
+ \else\ifnum\magyar@opt@@openqq>0 % =up
+ \@@magyar@declare@shorthandx`{\grqq}% up 66
+ \@@magyar@declare@shorthandx'{\glqq}% down 99
+ \else
+ \dMf @@magyar@shorthand@\string` {\string`\string`}% unchanged -- expect a ligature in font
+ \dMf @@magyar@shorthand@\string' {\string`\string'}% unchanged -- expect a ligature in font
+ \fi\fi
+ %
+ %** A hyphen, but hyphenation is OK at both sides
+ %** reported and asked by Jzsa Mrton <jozsineni@freemail.hu>
+ \@@magyar@declare@shorthandx ={\leavevmode\nobreak-\hskip\z@skip}
+ % ^^^ Dat: no need for \nobreak\hskip\z@skip, because of the empty discretionary
+ %** \shu?-- typesets an endash (--) with a small space around it (the one to
+ %** the right is breakable). \shu?- typesets a normal hyphen, having
+ %** hyphenation OK at both sides.
+ %** @example Kiss Eld\shu?--Nagy Pl
+ %** @example kzgazdasg\shu?-tudomnyi
+ \def\@@magyar@shorthandminus{%
+ \ifmmode \mskip2.4mu plus3.6mu minus1.8mu \else % ,`- is just a space in math mode
+ \if-\noexpand\@Lang@tmp \leavevmode\nobreak\,\nobreak\hbox{--}\,\expandafter\expandafter\expandafter\@gobble% Dat: \@gobble -
+ \else \leavevmode\nobreak-\hskip\z@skip\fi% Dat: e.g hegyes`-szg
+ \fi
+ }
+ \@@magyar@declare@shorthandx -{\futurelet\@Lang@tmp\@@magyar@shorthandminus}%
+ %** A hyphen that is displayed in both next and current lines. Hyphenation
+ %** is OK at both sides. This differs from ukraineb.ldf.
+ %** \showhyphens{ntrium`|klorid} -> nt-ri-um--klo-rid
+ \@@magyar@declare@shorthandx |{\leavevmode\nobreak-\nobreak\discretionary{}{-}{}\nobreak\hskip\z@skip}% Dat: all \nobreak s are important % e.g egyszer`|ktszer
+ \@@magyar@declare@shorthandx _{\leavevmode\nobreak\-\nobreak\hskip\z@skip}
+ \@@magyar@declare@shorthandx <{\flqq}
+ \@@magyar@declare@shorthandx >{\frqq}
+ \@@magyar@declare@shorthandx "{\hskip\z@skip}% \allowbreak, but hyphenation is OK at both sides
+ \@@magyar@declare@shorthandx ~{\textormath{\leavevmode\hbox{-}}{-}}% a hyphen that isn't part of ligatures -- and ---
+ %
+ % Dat: `CXY means \discretionary{CS-}{XY}{CXY}, which makes sense only for
+ % `CCS. But `Ccs wouldn't make sense, since there is no Hungarian word
+ % (whose first letter has to be capitalized) beginning with ccs.
+ % Dat: \nobreak\bbl@allowhyphens: \showhyphens{ho`sszabbra} -> hosz-szabb-ra
+ % Dat: \def\foo{`}\declare@shorthand{\CurrentOption{\foo c}{...} doesn't work
+ % Dat: these work quite well in math mode
+ % Dat: \showhyphens{a\hskip\z@skip b} displays "ab", but
+ % \showhyphens{a\hskip0pt b} displays "a b"
+ %** These should be equivalent:
+ %** \showhyphens{verembepot\nobreak\discretionary{y-}{}{}\nobreak\hskip\z@skip tyantam}
+ %** \showhyphens{verembepo`ttyantam}
+ \def\@@magyar@disc#1#2{#1\textormath{\nobreak\discretionary{#2-}{}{}}{}\nobreak\hskip\z@skip}%
+ \@@magyar@declare@shorthandx c{\@@magyar@disc cs}% loccsan --> locs-csan (lo`ccsan)
+ \@@magyar@declare@shorthandx C{\@@magyar@disc CS}
+ \@@magyar@declare@shorthandx g{\@@magyar@disc gy}% poggy\'asz --> pogy-gy\'asz (po`ggy\'asz)
+ \@@magyar@declare@shorthandx G{\@@magyar@disc GY}
+ \@@magyar@declare@shorthandx l{\@@magyar@disc ly}% Kod\'allyal --> Kod\'aly-lyal (Kod\'a`llyal)
+ \@@magyar@declare@shorthandx L{\@@magyar@disc LY}
+ \@@magyar@declare@shorthandx n{\@@magyar@disc ny}% mennyei --> meny-nyei (me`nnyei)
+ \@@magyar@declare@shorthandx N{\@@magyar@disc NY}
+ \@@magyar@declare@shorthandx s{\@@magyar@disc sz}% vissza --> visz-sza (vi`ssza)
+ \@@magyar@declare@shorthandx S{\@@magyar@disc SZ}
+ \@@magyar@declare@shorthandx t{\@@magyar@disc ty}% pottyan --> poty-tyan (po`ttyan)
+ \@@magyar@declare@shorthandx T{\@@magyar@disc TY}
+ \@@magyar@declare@shorthandx z{\@@magyar@disc zs}% rizzsel --> rizs-zsel (ri`zzsel)
+ \@@magyar@declare@shorthandx Z{\@@magyar@disc ZS}
+ \def\magyar@fixddzs{\@@magyar@declare@shorthandx d{% bridzs-dzsel
+ % vvv doesn't handle the rare combination dzs-dzs
+ %\@@magyar@declare@shorthandx D}{\@@magyar@disc DZ}
+ %\@@magyar@declare@shorthandx d}{\@@magyar@disc dz}% eddz\"unk (felsz. m.) --> edz-dz\"unk (e`ddz\"unk)
+ \def\reserved@a{%
+ \if\noexpand\reserved@b d%
+ \def\reserved@a{%
+ \if\noexpand\reserved@b z%
+ \def\reserved@a{%
+ \nobreak% so word before `ddzs gets hyphenated
+ \if\noexpand\reserved@b s%
+ \discretionary{dzs-}{dz}{ddz}% \showhyphens{szuper`ddzsungelben}
+ \else
+ \discretionary{dz-}{d}{dd}z% \showhyphens{szuper`ddzungelben}
+ \fi
+ \nobreak\hskip\z@skip% allow both pre- and post breaks
+ }%
+ \bbl@afterelse\expandafter\futurelet\expandafter\reserved@b\expandafter\reserved@a\@gobble
+ \else
+ \bbl@afterfi dd%
+ \fi
+ }%
+ \bbl@afterelse\expandafter\futurelet\expandafter\reserved@b\expandafter\reserved@a\@gobble
+ \else\bbl@afterfi d\fi
+ }%
+ \futurelet\reserved@b\reserved@a% doesn't remove next token
+ }}%
+ \magyar@fixddzs \expandafter\uppercase\expandafter{\magyar@fixddzs}
+ \@gobble
+{^}%
+
+
+% --- hunumbers=
+
+\ifnum\magyar@opt@@hunumbers=0 \@@magyar@skiplong\fi
+\def\@@magyar@egyjegyu#1{%
+ \ifcase#1 \or\or k\'et\or h\'arom\or n\'egy\or \"ot\or hat\or h\'et\or
+ nyolc\or kilenc\fi
+}
+\def\@@magyar@upperfi@nine#1\fi\fi\fi\fi\fi\fi\fi\fi\fi{\fi\fi\fi\fi\fi\fi\fi\fi\fi#1}
+\def\@@magyar@upperelse@nine#1\else#2\fi\fi\fi\fi\fi\fi\fi\fi\fi{\fi#1}
+\def\@@magyar@uppernum#1{%
+ \ifx#1\"\@@magyar@upperelse@nine\"O\@gobble% \"o
+ \else\if\noexpand#1eE%
+ \else\if\noexpand#1hH%
+ \else\if\noexpand#1kK%
+ \else\if\noexpand#1mM% mnusz
+ \else\if\noexpand#1nN%
+ \else\if\noexpand#1oO%
+ \else\if\noexpand#1sS% sokadik
+ \else\if\noexpand#1tT%
+ \else\@@magyar@upperfi@nine\expandafter\@@magyar@uppernum#1% do an extra expansion
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+%** For \pagenumbering{huordinal}. Expands to the Hungarian ordered numeral,
+%** spelled out in letters (i.e 1 --> first --> els). Suitable for numbering
+%** \part{}s and \chapter{}s of a book (\def\thepart{\@Huordinal\c@part}})
+%** @param #1 a number (input for \number) in -9999..9999
+\def\@huordinal#1{%
+ % !! larger numbers, also for \@hunumeral
+ \ifnum#1=-1 m\'nusz egyedik\else
+ \ifnum#1=-2 m\'nusz kettedik\else
+ \ifnum#1<0 m\'inusz \expandafter\@huordinal\expandafter{\number-#1 }\else
+ \ifcase\number#1 nulladik\or els\H o\or m\'asodik\or harmadik\or negyedik\or
+ \"ot\"odik\or hatodik\or hetedik\or nyolcadik\or kilencedik\else
+ \ifnum#1>999 \expandafter\@@magyar@ezresedik\number#1.\else
+ \ifnum#1>99 \expandafter\@@magyar@szazasodik\number#1\else
+ \expandafter\@@magyar@tizesedik\number#1%
+ \fi\fi\fi\fi\fi\fi
+}
+%** @param #1#2 1000..9999
+\def\@@magyar@ezresedik#1#2.{%
+ \ifnum#1#2>9999 sokadik\else
+ \@@magyar@egyjegyu#1%
+ \ifnum#2=0 ezredik\else
+ ezer\ifnum#1>1 -\fi% ktezer-harmadik
+ \ifnum#2<100
+ \expandafter\@@magyar@tizesedik\number#2%
+ \else
+ \ifnum#2<200 egy\fi% ezerszzadik -> ezeregyszzadik
+ \@@magyar@szazasodik#2%
+ \fi
+ \fi
+ \fi
+}
+%** @param #1#2 100..999
+%** Imp: binary search
+\def\@@magyar@szazasodik#1#2#3{%
+ \@@magyar@egyjegyu#1sz\'az%
+ \@@magyar@tizesedik#2#3%
+}
+%** @param #1 a digit
+%** @param #2 a digit
+%** Imp: binary search
+\def\@@magyar@tizesedik#1#2{%
+ \ifnum#1#2>89 kilencven\@@magyar@egyesedik#2e%
+ \else\ifnum#1#2>79 nyolcvan\@@magyar@egyesedik#2a%
+ \else\ifnum#1#2>69 hetven\@@magyar@egyesedik#2e%
+ \else\ifnum#1#2>59 hatvan\@@magyar@egyesedik#2a%
+ \else\ifnum#1#2>49 \"otven\@@magyar@egyesedik#2e%
+ \else\ifnum#1#2>39 negyven\@@magyar@egyesedik#2e%
+ \else\ifnum#1#2>29 harminc\@@magyar@egyesedik#2a%
+ \else\ifnum#1#2>20 huszon\@@magyar@egyesedik#2.%
+ \else\ifnum#1#2=20 huszadik%
+ \else\ifnum#1#2>10 tizen\@@magyar@egyesedik#2.%
+ \else\ifnum#1#2=10 tizedik%
+ \else \@@magyar@egyesedik#2a% ``ktszzadik''
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}%
+\def\@@magyar@egyesedik#1#2{%
+ \ifcase#1 #2\or egye\or kette\or harma\or negye\or
+ \"ot\"o\or hato\or hete\or nyolca\or kilence\fi dik%
+}
+%** Same as \@huordinal, but uppercase
+\def\@Huordinal#1{%
+ % Dat: \newlabel{hellopart}{{Els\H o}{3}} is correctly written out
+ \ifcase#1 Nulladik\or Els\H o\or M\'asodik\or Harmadik\or Negyedik\or
+ \"Ot\"odik\or Hatodik\or Hetedik\or Nyolcadik\or Kilencedik\or Tizedik%
+ \or Tizenegyedik\or Tizenkettedik\else\@@magyar@uppernum\@huordinal{#1}\fi
+}
+\def\huordinal#1{\expandafter\@huordinal\csname c@#1\endcsname}
+\def\Huordinal#1{\expandafter\@Huordinal\csname c@#1\endcsname}
+
+%** For \pagenumbering{hunumeral}. Expands to the Hungarian ordered numeral,
+%** spelled out in letters (i.e 1 --> first --> els). Suitable for numbering
+%** \part{}s and \chapter{}s of a book (\def\thepart{\@Hunumeral\c@part}})
+%** @param #1 a number (input for \number) in -9999..9999
+\def\@hunumeral#1{%
+ \ifnum#1<0 m\'inusz \expandafter\@hunumeral\expandafter{\number-#1 }\else
+ \ifcase#1 nulla\or egy\or kett\H{o}\or h\'arom\or n\'egy\or
+ \"ot\or hat\or h\'et\or nyolc\or kilenc\else
+ \ifnum#1>999 \expandafter\@@magyar@ezer\number#1.\else
+ \ifnum#1>99 \expandafter\@@magyar@szaz\number#1\else
+ \expandafter\@@magyar@tiz\number#1%
+ \fi\fi\fi\fi
+}
+%** @param #1#2 1000..9999
+\def\@@magyar@ezer#1#2.{%
+ \ifnum#1#2>9999 sokadik\else
+ \@@magyar@egyjegyu#1%
+ \ifnum#2=0 ezer\else
+ ezer\ifnum#1>1 -\fi% ktezer-harmadik
+ \ifnum#2<100
+ \expandafter\@@magyar@tiz\number#2%
+ \else
+ \ifnum#2<200 egy\fi% ezerszzadik -> ezeregyszzadik
+ \@@magyar@szaz#2%
+ \fi
+ \fi
+ \fi
+}
+%** @param #1#2 100..999
+%** Imp: binary search
+\def\@@magyar@szaz#1#2#3{%
+ \@@magyar@egyjegyu#1sz\'az%
+ \@@magyar@tiz#2#3%
+}
+%** @param #1 a digit
+%** @param #2 a digit
+%** Imp: binary search
+\def\@@magyar@tiz#1#2{%
+ \ifnum#1#2>89 kilencven\@@magyar@egy#2%
+ \else\ifnum#1#2>79 nyolcvan\@@magyar@egy#2%
+ \else\ifnum#1#2>69 hetven\@@magyar@egy#2%
+ \else\ifnum#1#2>59 hatvan\@@magyar@egy#2%
+ \else\ifnum#1#2>49 \"otven\@@magyar@egy#2%
+ \else\ifnum#1#2>39 negyven\@@magyar@egy#2%
+ \else\ifnum#1#2>29 harminc\@@magyar@egy#2%
+ \else\ifnum#1#2>20 huszon\@@magyar@egy#2%
+ \else\ifnum#1#2=20 h\'usz%
+ \else\ifnum#1#2>10 tizen\@@magyar@egy#2%
+ \else\ifnum#1#2=10 t\'iz%
+ \else \@@magyar@egy#2% ``ktszzadik''
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}%
+\def\@@magyar@egy#1{%
+ \ifcase#1 \or egy\or kett\H{o}\or h\'arom\or n\'egy\or
+ \"ot\or hat\or h\'et\or nyolc\or kilenc\fi%
+}
+%** Same as \@hunumeral, but uppercase
+\def\@Hunumeral#1{%
+ % Dat: \newlabel{hellopart}{{Els\H o}{3}} is correctly written out
+ \ifcase#1 Nulla\or Egy\or Kett\H{o}\or H\'arom\or N\'egy\or
+ \"Ot\or Hat\or H\'et\or Nyolc\or Kilenc\else\@@magyar@uppernum\@hunumeral{#1}\fi
+}
+\def\hunumeral#1{\expandafter\@hunumeral\csname c@#1\endcsname}
+\def\Hunumeral#1{\expandafter\@Hunumeral\csname c@#1\endcsname}
+
+\@gobble
+{^}%
+
+% --- Appending suffixes to numbers; told=
+
+\ifnum\magyar@opt@@told=0 \@@magyar@skiplong\fi
+% Dat: double accent combinations: +adik,+a,+as,+ad +hoz,+an,+on,+at,+ban...
+
+% vvv Terminal suffix variants
+
+% Dat: meaning of classes(#1): {\ifcase 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or 10\or 11/-1\or 12/-2\or 100\or 1000\or 10^6\or 10^9\or 20\or 30\or 40\or 60\fi}
+% Dat: ...@st is is special for appending +t to \refstruc names
+\def\@@magyar@suffix@adik#1{\ifnum#1=1 s\H o\else
+ \ifcase#1 a\or e\or o\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\or e\or e\fi dik\fi}%
+\def\@@magyar@suffix@a#1{\ifcase #1 a\or je\or a\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi}%
+\def\@@magyar@suffix@as#1{\ifcase #1 \or e\or e\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi s}%
+\def\@@magyar@suffix@ad#1{\ifcase #1 a\or e\or e\or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi d}%
+\def\@@magyar@suffix@@hoz#1#2{\ifcase#2 o\or e\or\"o\or o\or e\or\"o\or o\or e\or o\or e\or e\or e\or\"o\or o\or e\or o\or o\or o\or o\or e\or o\fi#1}%
+\def\@@magyar@suffix@@an#1{\ifcase #1 \or e\or e\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi n}%
+\def\@@magyar@suffix@on#1{\ifcase #1 \or e\or \or o\or e\or\"o\or o\or e\or a\or e\or e\or e\or e\or o\or e\or \or o\or o\or o\or e\or o\fi n}%
+\def\@@magyar@suffix@st#1{\ifcase #1 \or \or \or \or e\or \or \or \or \or \or \or \or \or \or \or \or \or \or \or \or \fi t}%
+\def\@@magyar@suffix@@at#1{\ifcase #1 \or e\or \or a\or e\or\"o\or o\or e\or a\or e\or e\or e\or \or a\or e\or \or a\or a\or a\or e\or a\fi t}%
+\def\@@magyar@suffix@@a#1#2{\ifcase #2 a\or e\or e\or a\or e\or e\or a\or e\or a\or e\or e\or e\or e\or a\or e\or a\or a\or a\or a\or e\or a\fi#1}%
+\def\@@magyar@suffix@nal#1{n\ifcase #1 \'a\or \'e\or \'e\or\'a\or \'e\or \'e\or\'a\or \'e\or\'a\or \'e\or \'e\or \'e\or \'e\or\'a\or \'e\or \'a\or \'a\or \'a\or\'a\or \'e\or\'a\fi l}%
+\def\@@magyar@suffix@@ol#1{\ifcase #1 \'o\or\H o\or\H o\or\'o\or\H o\or\H o\or\'o\or\H o\or\'o\or\H o\or\H o\or\H o\or\H o\or\'o\or\H o\or \'o\or \'o\or \'o\or\'o\or\H o\or\'o\fi l}%
+\def\@@magyar@suffix@ul#1{\ifcase #1 u\or \"u\or \"u\or u\or \"u\or \"u\or u\or \"u\or u\or \"u\or \"u\or \"u\or \"u\or u\or \"u\or u\or u\or u\or u\or \"u\or u\fi l}%
+\def\@@magyar@suffix@val#1{\ifcase #1 va\or gye\or ve\or ma\or gye\or te\or ta\or te\or ca\or ce\or ze\or gye\or ve\or za\or re\or va\or da\or sza\or ca\or ne\or na\fi l}%
+% @example: \atold(2.31)+es+sel{}
+\def\@@magyar@suffix@sal#1{\ifcase #1 sa\or se\or se\or sa\or se\or se\or sa\or se\or sa\or se\or se\or se\or se\or sa\or se\or sa\or sa\or sa\or sa\or se\or sa\fi l}%
+% @example: \atold(2.31)+ed+del{}
+\def\@@magyar@suffix@dal#1{\ifcase #1 da\or de\or de\or da\or de\or de\or da\or de\or da\or de\or de\or de\or de\or da\or de\or da\or da\or da\or da\or de\or da\fi l}%
+% @example: \atold(2.31)+edik+kel{}
+\def\@@magyar@suffix@kal#1{\ifcase #1 ka\or ke\or ke\or ka\or ke\or ke\or ka\or ke\or ka\or ke\or ke\or ke\or ke\or ka\or ke\or ka\or ka\or ka\or ka\or ke\or da\fi l}%
+\def\@@magyar@suffix@an{\@@magyar@suffix@@an}% make \ifx\@@magyar@suffix@an faster
+\def\@@magyar@suffix@at{\@@magyar@suffix@@at}% make \ifx\@@magyar@suffix@at faster
+\def\@@magyar@suffix@hoz{h\@@magyar@suffix@@hoz z}
+\def\@@magyar@suffix@ban{b\@@magyar@suffix@@a n}
+\def\@@magyar@suffix@nak{n\@@magyar@suffix@@a k}
+\def\@@magyar@suffix@ba{b\@@magyar@suffix@@a \@empty}
+\def\@@magyar@suffix@ra{r\@@magyar@suffix@@a \@empty}
+\def\@@magyar@suffix@bol{b\@@magyar@suffix@@ol}
+\def\@@magyar@suffix@tol{t\@@magyar@suffix@@ol}
+\def\@@magyar@suffix@rol{r\@@magyar@suffix@@ol}
+\def\@@magyar@suffix@szor{sz\@@magyar@suffix@@hoz r}
+
+% vvv Continued suffix variants
+
+\def\@@magyar@skipfi\fi\else{\fi}%
+%** Usage: \@@magyar@suffix@aS{5}\magyar@@suffix@hoz
+\def\@@magyar@suffix@aS#1#2{%
+ \ifnum#2=5 \ifx#1\@@magyar@suffix@at \"oset\else\@@magyar@skipfi\fi\else
+ \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi s%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \ifx#1\@@magyar@suffix@val\@@magyar@suffix@sal\else#1\fi % +es+vel -> +es+sel
+ % Imp: +ad+val, +adik+val etc.
+ \ifcase#2 3\or 1\or 1\or 3\or 1\or 5\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi
+ \fi
+}%
+\def\@@magyar@suffix@aD#1#2{%
+ \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi d%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \ifx#1\@@magyar@suffix@val\@@magyar@suffix@dal\else#1\fi % +ed+vel -> +ed+del
+ \ifcase#2 3\or 1\or 1\or 3\or 1\or 5\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi
+}%
+\def\@@magyar@suffix@adiK#1#2{%
+ \ifnum#2=1 \ifx#1\@@magyar@suffix@at s\"ot\else\@@magyar@skipfi\fi\else
+ \ifcase#2 \or e\or e\or a\or e\or \"o\or o\or e\or a\or e\or e\or e\or e\or a\or e\or \or a\or a\or a\or e\or a\fi dik%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+ \ifx#1\@@magyar@suffix@val\@@magyar@suffix@kal\else#1\fi % +edik+vel -> +ed+kel
+ \ifcase#2 3\or 1\or 1\or 3\or 1\or 1\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi
+ \fi
+}%
+\def\@@magyar@suffix@A#1#2{%
+ \ifcase#2 \'a\or j\'e\or \'a\or \'a\or \'e\or \'e\or \'a\or \'e\or \'a\or \'e\or \'e\or \'e\or \'e\or \'a\or \'e\or \'a\or\'a\or\'a\or\'a\or\'e\or\'a\fi
+ \ifx#1\@@magyar@suffix@at t\else
+ \ifx#1\@@magyar@suffix@an n\else% Dat: suffix overload: 2-a-an => 2-n
+ \expandafter#1\ifcase#2 3\or 1\or 1\or 3\or 1\or 1\or 3\or 1\or 3\or 1\or 1\or 1\or 1\or 3\or 1\or 3\or 3\or 3\or 3\or 1\or 3\fi
+ \fi\fi
+}%
+\def\@@magyar@suffix@@bad#1#2{\@@magyar@error{Unknown suffix \string`#1' for \string\told}}
+
+% vvv Input suffix parser
+
+%** Also defined elsewhere.
+%** @param #2 \else...\else...\fi...\fi etc.
+\def\@@magyar@swaprelax#1#2\relax{#2#1}
+%\def\@@magyar@swapno#1\noexpand{...}
+\def\@@magyar@contn#1\relax{#1\@@magyar@told@cont{}}
+\def\@@magyar@conta#1#2#3\relax{#3\noexpand#1\@@magyar@told@cont{#2}}
+\def\@@magyar@badsuffix#1#2\relax{#2\noexpand\@@magyar@suffix@@bad{#1}\@@magyar@told@cont{#1}}%
+\def\@@magyar@fs@#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@a\else
+ \if b\noexpand#1\@@magyar@swaprelax\@@magyar@fs@b\else
+ \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@d\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@e\else
+ \if h\noexpand#1\@@magyar@swaprelax\@@magyar@fs@h\else
+ \if k\noexpand#1\@@magyar@swaprelax\@@magyar@fs@k\else
+ \if n\noexpand#1\@@magyar@swaprelax\@@magyar@fs@n\else
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@o\else
+ \if r\noexpand#1\@@magyar@swaprelax\@@magyar@fs@r\else
+ \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@s\else
+ \if t\noexpand#1\@@magyar@swaprelax\@@magyar@fs@t\else
+ \if u\noexpand#1\@@magyar@swaprelax\@@magyar@fs@u\else
+ \if v\noexpand#1\@@magyar@swaprelax\@@magyar@fs@v\else
+ % Imp: SUXX: badsuffix doesn't work for +qal here -- fix error reporting
+ \@@magyar@badsuffix{#1}{}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
+}
+\def\@@magyar@fs@a#1{%
+ %\if -\noexpand#1\@@magyar@swapno\else
+ \if +\noexpand#1\noexpand\@@magyar@suffix@A\@@magyar@swaprelax\@@magyar@fs@\else
+ \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else
+ \if n\noexpand#1\noexpand\@@magyar@suffix@an\@@magyar@contn\else
+ \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else
+ \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else
+ \@@magyar@conta\@@magyar@suffix@a{#1}%
+ \fi\fi\fi\fi\fi\relax
+}
+\def\@@magyar@fs@ad#1{%
+ %\if -\noexpand#1\@@magyar@swapno\else
+ \if +\noexpand#1\noexpand\@@magyar@suffix@aD\@@magyar@swaprelax\@@magyar@fs@\else
+ \if i\noexpand#1\@@magyar@swaprelax\@@magyar@fs@adi\else
+ \@@magyar@conta\@@magyar@suffix@ad{#1}%
+ \fi\fi\relax
+}
+\def\@@magyar@fs@adi#1{%
+ \if k\noexpand#1\@@magyar@swaprelax\@@magyar@fs@adik\else
+ \@@magyar@badsuffix{adi#1}{}\fi\relax
+}
+\def\@@magyar@fs@adik#1{%
+ %\if -\noexpand#1\@@magyar@swapno\else
+ \if +\noexpand#1\noexpand\@@magyar@suffix@adiK\@@magyar@swaprelax\@@magyar@fs@\else
+ \@@magyar@conta\@@magyar@suffix@adik{#1}%
+ \fi\relax
+}
+\def\@@magyar@fs@as#1{%
+ %\if -\noexpand#1\@@magyar@swapno\else
+ \if +\noexpand#1\noexpand\@@magyar@suffix@aS\@@magyar@swaprelax\@@magyar@fs@\else
+ \@@magyar@conta\@@magyar@suffix@as{#1}%
+ \fi\relax
+}
+\def\@@magyar@fs@b#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ba\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ba\else
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@bo\else
+ \@@magyar@badsuffix{b#1}{}\fi\fi\fi\relax
+}
+\def\@@magyar@fs@ba#1{%
+ \if n\noexpand#1\noexpand\@@magyar@suffix@ban\@@magyar@contn\else
+ \@@magyar@conta\@@magyar@suffix@ba{#1}%
+ \fi\relax
+}
+\def\@@magyar@fs@bo#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@bol\@@magyar@contn\else
+ \@@magyar@badsuffix{bo#1}{}\fi\relax
+}
+\def\@@magyar@fs@d#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@da\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@da\else
+ \@@magyar@badsuffix{d#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@da#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@dal\@@magyar@contn\else
+ \@@magyar@badsuffix{da#1}{}\fi\relax
+}
+\def\@@magyar@fs@e#1{%
+ \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else
+ \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else
+ \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else
+ \if n\noexpand#1\noexpand\@@magyar@suffix@an\@@magyar@contn\else
+ \if +\noexpand#1\noexpand\@@magyar@suffix@A\@@magyar@swaprelax\@@magyar@fs@\else
+ %\@@magyar@badsuffix{e#1}{}
+ \@@magyar@conta\@@magyar@suffix@a{#1}{}%
+ \fi\fi\fi\fi\fi\relax
+}
+\def\@@magyar@fs@h#1{%
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ho\else
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ho\else
+ \@@magyar@badsuffix{h#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@ho#1{%
+ \if z\noexpand#1\noexpand\@@magyar@suffix@hoz\@@magyar@contn\else
+ \@@magyar@badsuffix{ho#1}{}\fi\relax
+}
+\def\@@magyar@fs@k#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ka\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ka\else
+ \@@magyar@badsuffix{k#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@ka#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@kal\@@magyar@contn\else
+ \@@magyar@badsuffix{ka#1}{}\fi\relax
+}
+\def\@@magyar@fs@n#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@na\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@na\else
+ \@@magyar@badsuffix{n#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@na#1{%
+ \if k\noexpand#1\noexpand\@@magyar@suffix@nak\@@magyar@contn\else
+ \if l\noexpand#1\noexpand\@@magyar@suffix@nal\@@magyar@contn\else
+ \@@magyar@badsuffix{na#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@o#1{%
+ \if d\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ad\else
+ \if n\noexpand#1\noexpand\@@magyar@suffix@on\@@magyar@contn\else
+ \if s\noexpand#1\@@magyar@swaprelax\@@magyar@fs@as\else
+ \if t\noexpand#1\noexpand\@@magyar@suffix@at\@@magyar@contn\else
+ \@@magyar@badsuffix{o#1}{}\fi\fi\fi\fi\relax
+}
+\def\@@magyar@fs@r#1{%
+ \if a\noexpand#1\noexpand\@@magyar@suffix@ra\@@magyar@contn\else
+ \if e\noexpand#1\noexpand\@@magyar@suffix@ra\@@magyar@contn\else
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@ro\else
+ \@@magyar@badsuffix{r#1}{}\fi\fi\fi\relax
+}
+\def\@@magyar@fs@ro#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@rol\@@magyar@contn\else
+ \@@magyar@badsuffix{ro#1}{}\fi\relax
+}
+\def\@@magyar@fs@s#1{%
+ \if z\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sz\else
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sa\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@sa\else
+ \if t\noexpand#1\noexpand\@@magyar@suffix@st\@@magyar@contn\else
+ \@@magyar@badsuffix{s#1}{}\fi\fi\fi\fi\relax
+}
+\def\@@magyar@fs@sa#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@sal\@@magyar@contn\else
+ \@@magyar@badsuffix{sa#1}{}\fi\relax
+}
+\def\@@magyar@fs@sz#1{%
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@szo\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@szo\else
+ \@@magyar@badsuffix{sz#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@szo#1{%
+ \if r\noexpand#1\noexpand\@@magyar@suffix@szor\@@magyar@contn\else
+ \@@magyar@badsuffix{szo#1}{}\fi\relax
+}
+\def\@@magyar@fs@t#1{%
+ \if o\noexpand#1\@@magyar@swaprelax\@@magyar@fs@to\else% Dat: works even if #1 is empty
+ \@@magyar@conta\@@magyar@suffix@at{#1}%
+ \fi\relax
+}
+\def\@@magyar@fs@to#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@tol\@@magyar@contn\else
+ \@@magyar@badsuffix{to#1}{}\fi\relax
+}
+\def\@@magyar@fs@u#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@ul\@@magyar@contn\else
+ \@@magyar@badsuffix{u#1}{}\fi\relax
+}
+\def\@@magyar@fs@v#1{%
+ \if a\noexpand#1\@@magyar@swaprelax\@@magyar@fs@va\else
+ \if e\noexpand#1\@@magyar@swaprelax\@@magyar@fs@va\else
+ \@@magyar@badsuffix{v#1}{}\fi\fi\relax
+}
+\def\@@magyar@fs@va#1{%
+ \if l\noexpand#1\noexpand\@@magyar@suffix@val\@@magyar@contn\else
+ \@@magyar@badsuffix{va#1}{}\fi\relax
+}
+
+% vvv Classification
+
+% Old: \def\@@magyar@skipor#1\or#2\fi{\fi#1}%
+%** Usage: \expandafter\@@magyar@skipor\expandafter\token\ifcase ... \else ... \or\else\fi
+\def\@@magyar@skipor#1\or{\@@magyar@skipelse#1\else}%
+\def\@@magyar@skipelse#1\else#2\fi{\fi#1}%
+
+%** Usage: \@@magyar@classify@none{N}{...}
+%** Reads till \vfuzz, considers the last decimal number, ignores space,
+%** punctuation and the minus `-' sign. Ignores spaces, so `1 2' and `12' are
+%** treated the same number. There must ne no `{' or `}' inside `...'.
+%** x ends by 0..9, y ends by 1..9 below.
+%** @expands to:
+%** c0: 0
+%** c1: 1
+%** c2: x2 ...
+%** c9: x9
+%** c10: x10
+%** c11: x1
+%** c12: x2
+%** c13: y00
+%** c14: y000 y0000 y00000
+%** c15: y000000 y0000000 y00000000
+%** c16: x000000000
+%** c17: x20
+%** c18: x30
+%** c19: x40 x50 x70 x90
+%** c20: x60 x80
+%** On error, expansion doesn't start with `c'
+%** @param #1 default classification, if no (more) numbers found
+%** @param #2 next token
+\def\@@magyar@classify@none#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@none{c0}}\else
+ % Dat: smart way to test whether #1 is in 1..9: \ifnum0<0\string#1 foo\fi
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@single#2}\else
+ \if\noexpand#2- \@@magyar@swaprelax{\@@magyar@classify@neg{#1}}\else
+ \ifx#2\vfuzz \@@magyar@swaprelax{#1}\else% stop processing if terminating \vfuzz is found
+ \@@magyar@swaprelax{\@@magyar@classify@none{#1}}% find next (possibly) number
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\fi\fi\relax
+}
+\def\@@magyar@classify@neg#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@none{c0}}\else
+ % Dat: smart way to test whether #1 is in 1..9: \ifnum0<0\string#1 foo\fi
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@singleneg#2}\else
+ \if\noexpand#2- \@@magyar@swaprelax{\@@magyar@classify@none{#1}}\else% double negation
+ \ifx#2\vfuzz \@@magyar@swaprelax{#1}\else% stop processing if terminating \vfuzz is found
+ \@@magyar@swaprelax{\@@magyar@classify@none{#1}}% find next (possibly) number, start as positive
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\fi\fi\relax
+}
+%** @param #1 previous digit 1..9
+%** @param #2 next token
+\def\@@magyar@classify@single#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else
+ \ifx#2\vfuzz \@@magyar@swaprelax{c#1}\else
+ \@@magyar@swaprelax{\@@magyar@classify@none{c#1}#2}%
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\fi\relax
+}
+%** @param #1 previous digit 1..9
+%** @param #2 next token
+\def\@@magyar@classify@singleneg#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else
+ \ifx#2\vfuzz \@@magyar@swaprelax{c\ifcase#1 0\or11\or12\else#1\fi}\else % turn `-1' -> `11' and `-2' to `12'
+ \if#11\@@magyar@swaprelax{\@@magyar@classify@neg{c11}#2}\else
+ \if#12\@@magyar@swaprelax{\@@magyar@classify@neg{c12}#2}\else
+ \@@magyar@swaprelax{\@@magyar@classify@neg{c#1}#2}%
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\fi\fi\fi\relax
+}
+%** @param #1 previous digit 1..9
+%** @param #2 next token
+\def\@@magyar@classify@more#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@tens#1}\else
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else
+ \@@magyar@swaprelax{%
+ \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none
+ \ifcase#1 M\or {c11}\or {c12}\else {c#1}\or\else\fi#2}%
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\relax
+}
+%** @param #1 prev-prev digit, 1..9
+%** @param #2 next token
+\def\@@magyar@classify@tens#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{\@@magyar@classify@zeroes2}\else
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else
+ \@@magyar@swaprelax{%
+ \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none
+ \ifcase#1 T\or{c10}\or{c17}\or{c18}\or{c19}\or{c19}\or{c20}\or{c19}\or{c20}\else{c19}\or\else\fi#2}%
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\relax
+}
+%** @param #1 zero-count 2..9
+%** @param #2 next token
+\def\@@magyar@classify@zeroes#1#2{%
+ \if\noexpand#20\@@magyar@swaprelax{%
+ %\def\foo#1,{.(#1)}
+ %\message{\expandafter\expandafter\expandafter\foo\expandafter
+ % \@@magyar@skipor\ifcase3 zero\or one\or two\else three\or\fi,done}
+ \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@zeroes
+ %\ifcase#1 Y\or Y\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or 9\or% Dat: no \else
+ \ifcase#1 Y\or Y\or 3\or 4\or 5\or 6\or 7\or 8\else 9%
+ \or\else\fi}\else% ^^^ Dat: 2 -> 3 ... 8 -> 9, 9 -> 9
+ \ifnum0<0\string#2 \@@magyar@swaprelax{\@@magyar@classify@more#2}\else
+ \@@magyar@swaprelax{%
+ \expandafter\@@magyar@skipor\expandafter\@@magyar@classify@none
+ \ifcase#1 Z\or Z\or {c13}\or {c14}\or {c14}\or {c14}\or {c15}\or {c15}\or
+ {c15}\else {c16}\or\else\fi#2}%
+ % ^^^ Dat: it is safe to call \@@magyar@swaprelax here, even if #2 contains \relax
+ \fi\fi\relax
+}
+
+% vvv The user interface for suffixing
+
+\def\@@magyar@ccheck#1#2\vfuzz#3{%
+ \if\noexpand#1c\relax\else
+ \@@magyar@error{\string\told\space needs number, not \string`#3'}%
+ \def\reserved@a{c0}%
+ \fi
+}
+
+%** Expands #1 with \the if it is \cs (possibly \count or \toks etc.)
+\def\@@magyar@the#1{%
+ \ifx#1\relax\else\if\noexpand\noexpand\noexpand#1%
+ \expandafter\expandafter\expandafter\the\fi\fi#1%
+}%
+
+\def\@@magyar@firsthfuzz#1#2\hfuzz{#1}
+\def\@@magyar@secondhfuzz#1#2#3\hfuzz{#2}
+%** See docs in magyar.dtx
+\def\@@magyar@zerocite#1{%
+ \ifx[#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo
+ {\@@magyar@zerocite@lowa[, }% had `['
+ {\@@magyar@zerocite@lowa[]{#1}}%
+}
+\def\@@magyar@zerocite@lowa[#1]#2{[\@@magyar@zerocite@lowb#2,\hbox,${#1}}
+\def\@@magyar@swapvfuzz#1#2\vfuzz{#2#1}
+\def\@@magyar@zerocite@lowb#1#2,{%
+ \ifx\hfuzz#1\hfuzz
+ \else\ifx\hbox#1\@@magyar@swapvfuzz\@@magyar@zerocite@lowc
+ \else\ifx,#1\@@magyar@swapvfuzz\@@magyar@zerocite@lowb{#2,}%
+ \else\expandafter\ifx\csname b@#1#2\endcsname\relax
+ 0, \@@magyar@swapvfuzz\@@magyar@zerocite@lowb
+ \else\expandafter\expandafter\expandafter\@@magyar@b@number
+ \expandafter\expandafter\expandafter{\csname b@#1#2\endcsname},
+ \@@magyar@swapvfuzz\@@magyar@zerocite@lowb
+ \fi\fi\fi\fi\vfuzz}
+\def\@@magyar@zerocite@lowc$#1{]#1}
+
+%** Expands to the numeric value of a \b@foobar definition
+%** Dat: with natbib.sty, we get \def\b@foobar{{1}{...}...},
+%** otherwise something like \def\b@foobar{\... 1}
+%** @param #1 value of a \b@foobar
+\def\@@magyar@b@number{%
+ \expandafter\ifx\csname ver@natbib.sty\endcsname\relax
+ \expandafter\@firstofone
+ \else \expandafter\@@magyar@b@number@natbibone \fi
+}
+\def\@@magyar@b@number@natbibone#1{\@@magyar@b@number@natbibtwo#1.\vfuzz}
+\def\@@magyar@b@number@natbibtwo#1#2\vfuzz{#1}%
+
+\def\@@magyar@zeroaref#1{%
+ % Dat: we cannot use \@ifnextchar here, because it is not expandable
+ \ifx(#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo
+ {\@@magyar@zeroref}{% Dat: gobble the (
+ \ifx*#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo
+ {\NotAllowedArefStar\@@magyar@zeropageref}% Dat: gobble the *
+ {\@@magyar@zeroref{#1}}%
+ {\@@magyar@zeroref{#1}}}%
+}
+
+\def\@@magyar@zeroapageref#1{%
+ % Dat: we cannot use \@ifnextchar here, because it is not expandable
+ \ifx*#1\expandafter\@secondoftwo\fi\@thirdofthree\@firstoftwo
+ {\NotAllowedApagerefStar\@@magyar@zeropageref}% Dat: gobble the *
+ {\@@magyar@zeropageref{#1}}%
+}
+
+\def\@@magyar@zeroref#1{%
+ \expandafter\ifx\csname r@#1\endcsname\relax0\else
+ \expandafter\expandafter\expandafter\@@magyar@firsthfuzz\csname r@#1\endcsname00\hfuzz
+ \fi
+}%
+\def\@@magyar@zeroeqref#1{(\@@magyar@zeroref{#1})}%
+\def\@@magyar@zerorefplus#1{\@@magyar@zerorefplus@low#1+\vfuzz}
+\def\@@magyar@zerorefplus@low#1+#2\vfuzz{%
+ \expandafter\ifx\csname r@#1\endcsname\relax0\else
+ \expandafter\expandafter\expandafter\@@magyar@firsthfuzz\csname r@#1\endcsname00\hfuzz
+ \fi
+}%
+\def\@@magyar@zeropageref#1{%
+ \expandafter\ifx\csname r@#1\endcsname\relax0\else
+ \expandafter\expandafter\expandafter\@@magyar@secondhfuzz\csname r@#1\endcsname00\hfuzz
+ \fi
+}%
+
+%** A space might be discared after the suffix, depending on the suffix. So
+%** please use `\told5+adik{} ' to ensure the space.
+%** May raise `! Package magyar.ldf Error: Unknown suffix `...' for \told', but
+%** emits unchanged suffix to DVI file.
+%** \atold\apageref emits double article
+%** \cite, \acite etc. is allowed, but without comma
+%** \aref({...}), \aref*, \apageref*, \acite* aren't allowed
+%** \refstruc doesn't work inside it, because \refstruc isn't expandable
+%** @example \told4+a+a+a+a+adik raises strange error
+%** @example no -en is provided for -an/-on, to avoid ambiguity
+%** @example \told4+adik: 0-adik 1-s 2-odik 3-adik 12-edik 10^8-adik
+%** @example augusztus \told20-a: 1-je 2-a 3-a 4-e 5-e 6-a ... (augusztus 20-a)
+%** @example \told3+as: 0-s(??) 1-es 2-es 3-as 4-es 5-s 10^6-s
+%** @example \told0+ad: 0-ad 1-ed 2-ed 3-ad 5-d 10^6-ad
+%** @example \told1000+hoz: 0-hoz 3-hoz 6-hoz 8-hoz 100-hoz 10^6-hoz 10^9-hoz 1-hez 4-hez 7-hez 9-hez 10-hez 1000-hez 2-hz 5-hz
+%** @example \told5+an: 5-en 2-en 100-an 10^6-n
+%** @example \told5+on: 5-n 2-n 3-on 100-on 10^6-n
+%** @example \told0+at: 0-t 2-t 10^6-t 1-et 4-et 7-et 9-et 10-et 1000-et 3-at 8-at 6-ot 10^9-ot 5-t
+%** @example \told1000+ban: 1000-ben
+%** @example \told7+ba: 7-be
+%** @example \told5+nak: 7-nek
+%** @example \told2+ra: 2-re
+%** @example \told4+nal: 4-nl
+%** @example \told7+bol: 7-bl
+%** @example \told5+tol: 5-tl
+%** @example \told3+rol: 3-rl
+%** @example \told2+ul: 0-ul 1-l 2-l 3-ul
+%** @example \told5+odik+hoz
+%** @example \told{300}+szor
+%** @example -i and -ig don't change have alternate forms
+%** @param #1 something that expands to an integer, or `\count...' or `\toks...'
+\DeclareRobustCommand \@@magyar@told{\@@magyar@xtold 0}
+\DeclareRobustCommand\@@magyar@atold{\@@magyar@xtold a}
+\DeclareRobustCommand\@@magyar@Atold{\@@magyar@xtold A}
+\def\@@magyar@xtold#1#2+{\@@magyar@told@low{#2}#1}
+%** @param #1 something that expands to an integer, or `\count...' or `\toks...'
+%** @param #2 add \az? (0: no, a: lowercase A: uppercase)
+\def\@@magyar@told@low#1#2{%
+ % Dat: a level of braces has already been stripped from #1
+ % Dat: negative sign isn't important, because it is skipped by \@@magyar@classify@none
+ \begingroup\begingroup
+ \@safe@activestrue% allow active `:' inside labels
+ \let\@safe@activesfalse\@empty \let\@safe@activestrue\@empty% inside \b@... emitted by \cite
+ % vvv Dat: gobbles its arg and `-' below
+ % `\@@magyar@toldas{42}' must be the very end of #1
+ \let\@@magyar@toldas\@gobbletwo
+ \let\-\relax
+% \let\@@magyar@save@tilde~%
+ \let~\relax% influenced by \@safe@activestrue
+ \let\refstruc\relax \let\refstrucparen\relax
+ \let \ref\relax \let \pageref\relax \let \cite\relax % all unexpandable, even for \@@magyar@the
+ \let\aref\relax \let\apageref\relax \let\acite\relax
+ \let\Aref\relax \let\Apageref\relax \let\Acite\relax
+ \let\autoref\relax
+ \let\hbox\@firstofone % Make \hbox{...} work by removing the braces. TODO(pts): Make \hbox to...{...} work.
+ \let\@@magyar@told@optdot\@empty % The optional dot disappears.
+ %\set@display@protect% \string. Why?? doesn't seem to screw up \r
+ \set@typeset@protect% \relax.
+ \edef\reserved@c{#1-}%
+ \edef\reserved@c{\def\noexpand\reserved@c{\expandafter\@@magyar@the\reserved@c\@empty}}% `\expandafter' is here so `the' and `number' take place
+ %
+ \def\@@magyar@toldas##1{.##1.}% emit the number
+ \let\romannumeral\number
+ \def\refstruc##1{0}%
+ \def\refstrucparen##1{0}%
+ \let\@safe@activestrue\@empty% babel puts these inside \b@...: % Dat: \def\b@abook{\@safe@activesfalse 2}% (what is \@safe@actives??)
+ \let\@safe@activesfalse\@empty% \b@DuplanJauneau1986 ->\@safe@activesfalse 15
+ \def\hyper@@link[##1]##2##3##4{##4}% Dat: \def\b@abook{\hyper@@link [cite]{}{cite.sokt}{2}}% with hyperref.sty % BUGFIX at Tue Nov 21 03:15:32 CET 2006
+ %
+ \let\ref\@@magyar@zeroref
+ \let\pageref\@@magyar@zeropageref
+ \let\cite\@@magyar@zerocite
+ \let\eqref\@@magyar@zeroeqref
+ %
+ \let\aref\@@magyar@zeroaref \let\Aref\aref % Dat: supports \aref* and \aref(
+ \let\apageref\@@magyar@zeroapageref \let\Apageref\apageref % Dat: supports \apageref* and \apageref(
+ \let\acite\cite \let\Acite\acite
+ %
+ \let\autoref\ref% Dat: SUXX: ``section 1-gyel''
+ \edef\reserved@a{#1}%
+ \edef\reserved@a{\expandafter\@@magyar@the\reserved@a\@empty}% `\expandafter' is here so `the' and `number' take place
+ %\let~\@@magyar@save@tilde% vvv for ~ below etc.
+ \if0#2\else
+ #2% a or A
+ % vvv Dat: we do \az with \romannumeral changed to \number
+ \expandafter\@@magyar@az@set\expandafter{\reserved@a}\hbox$% Dat: \reserved@a is already expanded, as required by \@@magyar@az@set
+ \nobreakspace% Dat: `~' is wrong here, it has been redefined !!
+ \fi
+ \edef\reserved@a{\noexpand\reserved@c\def\noexpand\reserved@a{\reserved@a}}%
+ %
+ \expandafter\expandafter\expandafter\endgroup\reserved@a% keep \reserved@a and \reserved@c
+ %%\show\reserved@a \show\reserved@c \show\@@magyar@toldas
+ % vvv Dat: shows friendly LaTeX error: \told{\refstruc{refstruc=}}+ban
+ \def\refstruc{\@@magyar@error{Cannot use \string\refstruc\space inside \string\told}\@@magyar@refstruc}%
+ \edef\reserved@a{\expandafter\@@magyar@classify@none\expandafter N\reserved@a\vfuzz}%
+ %%\show\reserved@a
+ \expandafter\@@magyar@ccheck\reserved@a..\vfuzz\reserved@c%
+ %\edef\reserved@a{{\ifcase\expandafter\@gobble\reserved@a\space 0\or1\or2\or
+ % 3\or4\or5\or6\or7\or8\or9\or10\or11\or12\or13\or14\or15\or16\or
+ % 8\or8\else 9\fi}}% 20->8 30->8 40->9 % no need for this anymore
+ \edef\reserved@a{{\number\expandafter\@gobble\reserved@a}}% keeps 17,18,19 for +val
+ \expandafter\edef\expandafter\reserved@b\expandafter{\if}.\fi\@@magyar@fs@
+}
+\def\@@magyar@told@optdot{.}
+%** @in \reserved@a is suffix classification in braces: {0}, {1} ... or {16}
+%** @param #1 \@empty or a char token
+\def\@@magyar@told@cont#1{%
+ \reserved@a% add the suffix class, example: {11}
+ #1%\if/\noexpand#1\else#1\fi% add extra char unless `/'
+ \if{.\fi}% close \edef\reserved@b opened in \@@magyar@told
+ % Now: example \reserved@b: \@@magyar@suffix@aS \@@magyar@suffix@sal {11}
+ % Now: example \reserved@b: \@@magyar@suffix@aS \@@magyar@suffix@val {11}
+ % Dat: \reserved@b is now like \@@magyar@suffix@A \@@magyar@suffix@ban
+ % vvv Dat: \aref in \reserved@c may modify \reserved@b, so we call it
+ % late by \expandafter
+ \expandafter\reserved@c% print the number and the hyphen
+ \reserved@b% print the suffix
+ \endgroup
+}
+% Dat: \told is an unused \cs in LaTeX and its standard packages
+\ifnum\magyar@opt@@told>1
+ \let \told\@@magyar@told
+ \let\atold\@@magyar@atold
+ \let\Atold\@@magyar@Atold
+\else
+ \expandafter\ifx\csname told\endcsname\relax \let \told\@@magyar@told\fi
+ \expandafter\ifx\csname atold\endcsname\relax \let\atold\@@magyar@atold\fi
+ \expandafter\ifx\csname Atold\endcsname\relax \let\Atold\@@magyar@Atold\fi
+\fi
+\@gobble
+{^}%
+
+% --- hutoday=
+
+% Dat: latex.ltx has \edef for \today, but we have \def
+\def\SafeToday{\the\year/\two@digits{\the\month}/\two@digits{\the\day}:%
+ \two@digits{\the\count@}:\two@digits{\the\count2}}
+
+\ifnum\magyar@opt@@hutoday=0 \@namedef{date\CurrentOption}{\let\today\SafeToday}\@@magyar@skiplong\fi
+%** Same as what latex.ltx has. Expansion doesn't change it, doesn't contain
+%** accents.
+\@namedef{date\CurrentOption}{%
+ \def\today{%
+ \number\year.~\ifcase\month\or
+ janu\'ar\or febru\'ar\or m\'arcius\or
+ \'aprilis\or m\'ajus\or j\'unius\or
+ j\'ulius\or augusztus\or szeptember\or
+ okt\'ober\or november\or december\fi
+ \space\number\day.\hbox{}}%
+ }
+% vvv Dat: ondate... and \ontoday is specific to magyar.ldf
+\@namedef{ondate\CurrentOption}{%
+ \number\year.~\ifcase\month\or janu\'ar\or febru\'ar\or m\'arcius\or
+ \'aprilis\or m\'ajus\or j\'unius\or j\'ulius\or augusztus\or szeptember\or
+ okt\'ober\or november\or december\fi\space\ifcase\day\or
+ 1-j\'en\or 2-\'an\or 3-\'an\or 4-\'en\or 5-\'en\or
+ 6-\'an\or 7-\'en\or 8-\'an\or 9-\'en\or 10-\'en\or
+ 11-\'en\or 12-\'en\or 13-\'an\or 14-\'en\or 15-\'en\or
+ 16-\'an\or 17-\'en\or 18-\'an\or 19-\'en\or 20-\'an\or
+ 21-\'en\or 22-\'en\or 23-\'an\or 24-\'en\or 25-\'en\or
+ 26-\'an\or 27-\'en\or 28-\'an\or 29-\'en\or 30-\'an\or
+ 31-\'en\fi}
+\edef\reserved@a{%
+ \noexpand\addto\expandafter\noexpand\csname extras\CurrentOption\endcsname{%
+ \noexpand\babel@save\noexpand\ontoday
+ \let\noexpand\ontoday\expandafter\noexpand\csname ondate\CurrentOption\endcsname}
+}
+\reserved@a
+\@gobble
+{^}%
+
+% --- refstruc=
+
+\if0\magyar@opt@@refstruc \@@magyar@skiplong\fi
+\def\@@magyar@nonumbers@skipa#1\@@magyar@nonumbers@s{#1\@@magyar@nonumbers@a}
+%** Changes arabic and roman numbers to 1 or i, respectively.
+%** Usage: \typeout{((\@@magyar@nonumbers@a 35.2.iv\hfuzz))} -> ((1.1.i))
+\def\@@magyar@nonumbers@a#1{%
+ \ifx#1\hfuzz \expandafter\@gobble
+ \else\if\noexpand#101% !! Imp: 1<1\string#1
+ \else\if\noexpand#111%
+ \else\if\noexpand#121%
+ \else\if\noexpand#131%
+ \else\if\noexpand#141%
+ \else\if\noexpand#151%
+ \else\if\noexpand#161%
+ \else\if\noexpand#171%
+ \else\if\noexpand#181%
+ \else\if\noexpand#191%
+ \else\if\noexpand#1mi%
+ \else\if\noexpand#1di%
+ \else\if\noexpand#1ci%
+ \else\if\noexpand#1li%
+ \else\if\noexpand#1xi%
+ \else\if\noexpand#1vi%
+ \else\if\noexpand#1ii%
+ \else\if\noexpand#1MI%
+ \else\if\noexpand#1DI%
+ \else\if\noexpand#1CI%
+ \else\if\noexpand#1LI%
+ \else\if\noexpand#1XI%
+ \else\if\noexpand#1VI%
+ \else\if\noexpand#1II%
+ \else\noexpand#1\@@magyar@nonumbers@skipa
+ \fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi \fi
+ \@@magyar@nonumbers@s
+}
+\def\@@magyar@nonumbers@s#1{%
+ \ifx#1\hfuzz \expandafter\@gobble
+ \else\if\noexpand#10%
+ \else\if\noexpand#11%
+ \else\if\noexpand#12%
+ \else\if\noexpand#13%
+ \else\if\noexpand#14%
+ \else\if\noexpand#15%
+ \else\if\noexpand#16%
+ \else\if\noexpand#17%
+ \else\if\noexpand#18%
+ \else\if\noexpand#19%
+ \else\if\noexpand#1m%
+ \else\if\noexpand#1d%
+ \else\if\noexpand#1c%
+ \else\if\noexpand#1l%
+ \else\if\noexpand#1x%
+ \else\if\noexpand#1v%
+ \else\if\noexpand#1i%
+ \else\if\noexpand#1M%
+ \else\if\noexpand#1D%
+ \else\if\noexpand#1C%
+ \else\if\noexpand#1L%
+ \else\if\noexpand#1X%
+ \else\if\noexpand#1V%
+ \else\if\noexpand#1I%
+ \else\noexpand#1\@@magyar@nonumbers@skipa
+ \fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi \fi
+ \@@magyar@nonumbers@s
+}
+
+\let\@@magyar@toldas\@gobble
+\def\@@magyar@strucname@part{r\'esz\@@magyar@toldas{4}}% SUXX: may not contain \-; !! rsszel (vs. rszszel)
+\def\@@magyar@strucname@chapter{fejezet\@@magyar@toldas{9}}% !! fejezettel
+\def\@@magyar@strucname@appendix{f\"ug\-gel\'ek\@@magyar@toldas{4}}% !! fuggelekkel
+\def\@@magyar@strucname@section{szakasz\@@magyar@toldas{20}}%
+\def\@@magyar@strucname@subsection{al\-sza\-kasz\@@magyar@toldas{20}}%
+\def\@@magyar@strucname@subsubsection{al\-al\-szakasz\@@magyar@toldas{20}}%
+\def\@@magyar@strucname@subsubsubsection{al\-al\-al\-szakasz\@@magyar@toldas{20}}%
+\def\@@magyar@strucname@paragraph{bekezd\'es\@@magyar@toldas{4}}%
+\def\@@magyar@strucname@subparagraph{albekezd\'es\@@magyar@toldas{4}}%
+\def\@@magyar@strucname@subsubparagraph{alalbekezd\'es\@@magyar@toldas{4}}%
+\def\@@magyar@strucname@figure{\'ab\-ra\@@magyar@toldas{4}}% !! brban etc.
+\def\@@magyar@strucname@table{t\'ab\-l\'azat\@@magyar@toldas{6}}%
+\def\@@magyar@strucname@equation{egyenlet\@@magyar@toldas{7}}%
+\def\@@magyar@strucname@footnote{l\'ab\-jegy\-zet\@@magyar@toldas{7}}%
+\def\@@magyar@strucname@item{elem\@@magyar@toldas{4}}% !! elemmel etc.
+\def\@@magyar@strucname@FancyVerbLine{sor\@@magyar@toldas{8}}% !! sorral
+\def\@@magyar@strucname@theorem{t\'e-tel\@@magyar@toldas{4}}% !! ttellel
+
+%** Must be expandable.
+%** @param #1 `section' etc.
+%** @expands to its name in English
+\def\@@magyar@strucname#1{#1}
+%** @param #1 `section' etc.
+%** @expands to its name in Hungarian
+\def\@@magyar@strucname@hu#1{\csname @@magyar@strucname@#1\endcsname}
+
+%** Keeps only structure number, discards page number etc.
+\def\@@magyar@refstruc@parse#1#2\vfuzz{%
+ \ifx\relax#1\let\reserved@a\relax
+ \else\def\reserved@a{#1}\fi
+}%
+%** Retrieves the structure name (arg #4) from arg 2 of a \newlabel emitted
+%** by hyperref.sty.
+%** @example \newlabel{fig:vonal}{{1}{1}{my title}{figure.1}{}}
+%** \@namedef{r@fig:vonal}{{1}{1}{my title}{figure.1}{}}
+%** -> extract `figure' to \reserved@c
+\def\@@magyar@refstruc@parsehyname#1#2#3#4#5\vfuzz{%
+ \ifx\relax#1%
+ \else\expandafter\@@magyar@refstruc@parsehynamedot#4\vfuzz\fi
+}%
+\def\@@magyar@refstruc@parsehynamedot#1.#2\vfuzz{%
+ \expandafter\ifx\csname @@magyar@strucname@#1\endcsname\relax
+ \else\def\reserved@c{#1}\fi
+}
+
+%** @param #1 name of a count register (e.g c@part)
+\def\@@magyar@refstruc@setcnt#1{%
+ \expandafter\ifx\csname#1\endcsname\relax\expandafter\@tempcnta
+ \else\csname#1\endcsname\fi
+}%
+
+%** @param #1 a label name
+\def\@@magyar@refstruc@ref#1{%
+ \ref{#1}.~%
+}
+
+%** May not touch \reserved@a
+\def\@@magyar@refstruc@split#1+#2\vfuzz#3{%
+ \if\noexpand#30\else\@@magyar@refstruc@ref{#1}\fi
+ \ifx\vfuzz#2%
+ \textbf{??}%
+ \G@refundefinedtrue
+ \else
+ \begingroup
+ \@safe@activestrue% so active `:' etc. will work inside \csname...
+ \edef\reserved@c{\noexpand\@@magyar@refstruc@splitlow
+ \expandafter\ifx\csname r@#1\endcsname\relax\relax\else
+ \expandafter\noexpand\csname r@#1\endcsname\fi}%
+ % ^^^ Dat: would emit `undefined' instead of `\relax' w/o \ifx
+ \expandafter\endgroup\reserved@c{#2}%
+ \fi
+}
+
+%** @param #1 csname \r@foo:bar
+%** @param #2 suffix to add
+\def\@@magyar@refstruc@splitlow#1#2{%
+ \ifx#1\relax
+ \textbf{??+#2}%
+ \G@refundefinedtrue
+ \else
+ \expandafter\@@magyar@refstruc@parse#1..\vfuzz%
+ \@@magyar@refstruc@work#1%
+ \let\@@magyar@save@m\-%
+ \let\-\relax
+ \let\@@magyar@toldas\relax
+ \edef\reserved@c{\expandafter\@@magyar@strucname\expandafter{\reserved@c}}%
+ \let\-\@@magyar@save@m
+ \let\@@magyar@suffix@at\@@magyar@suffix@st% fix the -t suffix
+ \ifx\reserved@b\@empty\else
+ \@@magyar@refstruc@splitb#2\vfuzz% strip `+' from the end of #2
+ \fi
+ \fi
+}
+
+\def\@@magyar@refstruc@splitb#1+\vfuzz{%
+ \expandafter\@@magyar@told\reserved@c+#1{}% fejezet -> fejezetben
+}
+
+%** The +val suffix does not produce the desired result.
+%** @param #1 \ref id or with \told
+%** (@param #2 1 to prefix with 1\ref{...}.~' in Hungarian order)
+%** @example \refstruc{sec:foo}
+%** @example \refstruc{sec:foo+as+an}
+%** May not touch \reserved@a
+\def\@@magyar@refstruc@name#1{%
+ \begingroup
+ \begingroup
+ \@safe@activestrue% so active `:' etc. will work inside \csname...
+ \edef\reserved@c{\noexpand\@@magyar@refstruc@namelow
+ \expandafter\ifx\csname r@#1\endcsname\relax\relax\else
+ \expandafter\noexpand\csname r@#1\endcsname\fi}%
+ % ^^^ Dat: would emit `undefined' instead of `\relax' w/o \ifx
+ \expandafter\endgroup\reserved@c{#1}%
+}
+
+%** @param #1 csname \r@foo:bar
+%** @param #2 foo:bar
+%** @param #3 1 to prefix with 1\ref{...}.~' in Hungarian order)
+\def\@@magyar@refstruc@namelow#1#2#3{%
+ \ifx#1\relax
+ \@@magyar@refstruc@split#2+\vfuzz#3% ends by +suffix, needs \told
+ \else
+ \expandafter\@@magyar@refstruc@parse#1..\vfuzz% sets \reserved@a to ref target
+ %%\show\reserved@a% first arg of ref, i.e section number, eg. `1.2.3' -- or \relax
+ \if\noexpand#30\else
+ \begingroup% Dat: \ref might redefine \reserved@a, especially in hyperref.sty
+ \@@magyar@refstruc@ref{#2}\endgroup\fi
+ \@@magyar@refstruc@work#1%
+ \expandafter\@@magyar@strucname\expandafter{\reserved@c}%
+ \fi
+ \endgroup
+}
+
+\def\@@magyar@appendix@chapapp{\appendixname}%
+
+%** Input is \reserved@a, output is \reserved@c
+%** @param #1 the control sequence \r@foo:bar
+\def\@@magyar@refstruc@work#1{%
+ \edef\reserved@a{\expandafter\@@magyar@nonumbers@a\reserved@a\hfuzz}%
+ %\expandafter\lowercase\expandafter{\expandafter\def\expandafter\reserved@a\expandafter{\reserved@a}}%
+ % ^^^ Dat: don't do lowercasing, deliberately.
+ % Imp: referring from \@alph sections such as the appendix
+ \@@magyar@refstruc@setcnt{c@part}1
+ \@@magyar@refstruc@setcnt{c@chapter}1
+ \@@magyar@refstruc@setcnt{c@section}1
+ \@@magyar@refstruc@setcnt{c@subsection}1
+ \@@magyar@refstruc@setcnt{c@subsubsection}1
+ \@@magyar@refstruc@setcnt{c@subsubsubsection}1
+ \@@magyar@refstruc@setcnt{c@paragraph}1
+ \@@magyar@refstruc@setcnt{c@subparagraph}1
+ \@@magyar@refstruc@setcnt{c@subsubparagraph}1
+ \let\reserved@c\relax
+ \expandafter\@@magyar@refstruc@parsehyname#1....\vfuzz%
+ \ifx\reserved@c\relax% hyperref.sty and nameref.sty has helped us
+ \def\reserved@c{subsubparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{paragraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsubsubsection}\edef\reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsubsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{section}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{chapter}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{appendix}\edef \reserved@b{\expandafter\ifx\csname c@chapter\endcsname\relax\else\@Alph\c@chapter\fi}\ifx\reserved@a\reserved@b\else% Imp: do this without changing counters in \appendix
+ \def\reserved@c{part}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ %%\show\@chapapp \show\@@magyar@appendix@chapapp
+ \ifx\@chapapp\@@magyar@appendix@chapapp% we're in an appendix referring to a normal chapter
+ \def\thechapter{\@arabic\c@chapter}\fi
+ \def\reserved@c{subsubparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subparagraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{paragraph}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsubsubsection}\edef\reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsubsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{subsection}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{section}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ \def\reserved@c{chapter}\edef \reserved@b{\csname the\reserved@c\endcsname}\ifx\reserved@a\reserved@b\else
+ %
+ \@latex@error{Unknown structure level for ref \string`\reserved@a';
+ \reserved@b}\@ehc%
+ \def\reserved@c{??}% Dat: must be expandable
+ \let\reserved@b\@empty
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+
+\def\@@magyar@refstruc@hu#1{\@@magyar@refstruc@name{#1}1}%
+% Imp: Undocumented: \refstrucparen can be used instead of \refstruc
+% to format the section number inside parentheses.
+\def\@@magyar@refstrucparen@hu#1{%
+ \begingroup
+ \def\@@magyar@refstruc@ref##1{\told(\ref{##1})+es{}~}%
+ \@@magyar@refstruc@name{#1}1%
+ \endgroup}%
+\def\@@magyar@refstruc#1{\@@magyar@refstruc@name{#1}0~\ref{#1}}%
+\def\@@magyar@refstrucparen#1{\@@magyar@refstruc@name{#1}0~(\ref{#1})}%
+
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@@magyar@refstruc
+ \babel@save\@@magyar@strucname
+ \let\@@magyar@refstruc \@@magyar@refstruc@hu
+ \let\@@magyar@refstrucparen \@@magyar@refstrucparen@hu
+ \let\@@magyar@strucname\@@magyar@strucname@hu
+}
+
+\ifnum\magyar@opt@@refstruc \expandafter\ifx\csname refstruc\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \DeclareRobustCommand\refstruc{\@@magyar@refstruc}%
+ \DeclareRobustCommand\refstrucparen{\@@magyar@refstrucparen}%
+\fi
+\@gobble
+{^}
+
+% --- Printing dates; emitdate=
+
+\ifnum\magyar@opt@@emitdate=0 \@@magyar@skiplong\fi
+%** @param #1 1..12 (month number)
+\def\@@magyar@month@a#1{\two@digits{#1}}%
+\def\@@magyar@month@b#1{\ifcase#1\or janu\'ar\or febru\'ar\or m\'arcius\or
+ \'aprilis\or m\'ajus\or j\'unius\or j\'ulius\or augusztus\or szeptember\or
+ okt\'ober\or november\or december\fi}%
+\def\@@magyar@month@c#1{\ifcase#1\or jan\or feb\or m\'arc\or
+ \'apr\or m\'aj\or j\'un\or j\'ul\or aug\or szept\or
+ okt\or nov\or dec\fi.\hbox{}}%
+\def\@@magyar@month@d#1{\@Roman{#1}}%
+
+\def\@@magyar@four@digits#1{%
+ \ifnum#1<10 000\else\ifnum#1<100 00\else\ifnum#1<1000 0\fi\fi\fi\number#1%
+}
+
+\def\@@magyar@date@a#1#2#3{#1-\@@magyar@month@a{#2}-\two@digits{#3}}
+\def\@@magyar@date@b#1#2#3{#1.~\@@magyar@month@b{#2} \number#3\@@magyar@told@optdot\hbox{}}% Dat: \hbox is to force \frenchspacing
+\def\@@magyar@date@c#1#2#3{#1.~\@@magyar@month@c{#2} \number#3\@@magyar@told@optdot\hbox{}}
+\def\@@magyar@date@d#1#2#3{#1.~\@@magyar@month@d{#2}.\ \number#3\@@magyar@told@optdot\hbox{}}
+\def\@@magyar@date@e#1#2#3{#1.~\@@magyar@month@a{#2}.\ \two@digits{#3}\@@magyar@told@optdot\hbox{}}
+\def\@@magyar@date@f#1#2#3{#1.~\@@magyar@month@b{#2}}
+\def\@@magyar@date@g#1#2#3{#1.~\@@magyar@month@b{#2} \number#3}% Dat: \told{\@@magyar@date@g{1848}{3}{15}}+e{}
+\def\@@magyar@date@h#1#2#3{#1~\@@magyar@month@b{#2}}% Imp: suffixes to months
+\def\@@magyar@date@i#1#2#3{#1/\@@magyar@month@a{#2}/\two@digits{#3}}% not Hungarian
+
+\def\@@magyar@parsedate@a#1-#2-#3!#4\hfuzz{% ISO date: YYYY-MM-DD
+ \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax
+ \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}%
+ \fi\fi\fi\fi
+}
+\def\@@magyar@parsedate@b#1/#2/#3!#4\hfuzz{% LaTeX date: YYYY/MM/DD
+ \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax
+ \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}%
+ \fi\fi\fi\fi
+}
+\def\@@magyar@parsedate@c#1.#2.#3!#4\hfuzz{% English date: YYYY.DD.MM
+ \ifx\hfuzz#4\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax
+ \def\reserved@a{\@@magyar@fixdate{#1}{#3}{#2}}%
+ \fi\fi\fi\fi
+}
+\def\@@magyar@mon@jan{1}%
+\def\@@magyar@mon@feb{2}%
+\def\@@magyar@mon@mar{3}%
+\def\@@magyar@mon@apr{4}%
+\def\@@magyar@mon@maj{5}%
+\def\@@magyar@mon@may{5}% english.ldf
+\def\@@magyar@mon@jun{6}%
+\def\@@magyar@mon@jul{7}%
+\def\@@magyar@mon@aug{8}%
+\def\@@magyar@mon@sze{9}%
+\def\@@magyar@mon@sep{9}% english.ldf
+\def\@@magyar@mon@okt{10}%
+\def\@@magyar@mon@oct{10}% english.ldf
+\def\@@magyar@mon@nov{11}%
+\def\@@magyar@mon@dec{12}%
+\def\@@magyar@parsedate@d#1. #2#3#4#5 #6!#7\hfuzz{% {2003. oktober 25} with \catcodes 12 and 10
+ \ifx\hfuzz#7\hfuzz\else
+ % Dat: now: {#1} is {2003}, {#2#3#4#5} is {oktober}, {#6} is {25}
+ \ifnum1<1\string#1\relax \ifnum1<1\string#6\relax
+ \lowercase{%
+ \expandafter\ifx\csname @@magyar@mon@#2#3#4\endcsname\relax\else
+ %%\errmessage{(#1)(#2#3#4)(#6)}%
+ \edef\reserved@a{\noexpand\@@magyar@fixdate{\number#1}{\csname @@magyar@mon@#2#3#4\endcsname}{\number#6}}\fi
+ }%
+ \fi\fi\fi
+}
+\def\@@magyar@parsedate@e#1#2#3#4 #5, #6!#7\hfuzz{% {October 25, 2003} with \catcodes 12 and 10
+ \ifx\hfuzz#7\hfuzz\else
+ \ifnum1<1\string#5\relax \ifnum1<1\string#6\relax
+ \lowercase{%
+ \expandafter\ifx\csname @@magyar@mon@#1#2#3\endcsname\relax\else
+ \edef\reserved@a{\noexpand\@@magyar@fixdate{\number#6}{\csname @@magyar@mon@#1#2#3\endcsname}{\number#5}}\fi
+ }%
+ \fi\fi\fi
+}
+
+\def\@@magyar@parsedate@f#1/#2/#3:#4!#5\hfuzz{% LaTeX default \today: YYYY/MM/DD:XX:YY
+ \ifx\hfuzz#5\hfuzz\else \ifnum1<1\string#1\relax \ifnum1<1\string#2\relax \ifnum1<1\string#3\relax
+ \def\reserved@a{\@@magyar@fixdate{#1}{#2}{#3}}%
+ \fi\fi\fi\fi
+}
+
+\def\@@magyar@stripdot@lowa#1.\relax{#1\relax}%
+\def\@@magyar@stripdot@lowb#1\relax#2\relax{#1}%
+%** by pts@fazekas.hu at Sun Jul 27 15:17:57 CEST 2003
+%** Expands to #1, with a single optional dot (token `.') at the end removed.
+%** @param #1 a token list not containing `\relax' (sic)
+\def\@@magyar@stripdot#1{\expandafter\@@magyar@stripdot@lowb\@@magyar@stripdot@lowa#1\relax.\relax}%
+
+%** Definies \reserved@a to {{YYYY}{MM}{DD}} (possibly fewer digits). Parsing
+%** is not perfect, but can distinguish between the known formats
+%** @param #1 a date in any format, will be expanded
+\def\@@magyar@parsedate#1{%
+ %\let\@@protect\protect \let\protect\@gobble \afterassignment\restore@protect
+ \begingroup
+ \def\today{\the\year-\the\month-\the\day}% ISO format
+ \let\protect\string
+ \let\'\@firstofone% Dat: (j\'unius, janu\'ar, okt\'ober) date won't contain other accents -- I hope
+ \let~\space
+ % ^^^ change `2003.~okt\'ober 25.' to `2003. oktober 25.'
+ \edef\reserved@b{\def\noexpand\reserved@b{#1}}%
+ \expandafter\endgroup\reserved@b
+ \edef\reserved@b{\expandafter\@@magyar@stripdot\expandafter{\reserved@b}}%
+ %%\show\reserved@b\tracingmacros1
+ % vvv Wizardry: deep, parsing dates
+ \let\reserved@a\@empty \expandafter\@@magyar@parsedate@a\reserved@b!--!\hfuzz
+ \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@f\reserved@b!//:!\hfuzz \fi
+ \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@b\reserved@b!//!\hfuzz \fi
+ \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@c\reserved@b!..!\hfuzz \fi
+ \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@d\reserved@b!. xyz !\hfuzz \fi
+ \ifx\reserved@a\@empty \expandafter\@@magyar@parsedate@e\reserved@b!xyz , !\hfuzz \fi
+ %%\show\reserved@a
+ \ifx\reserved@a\@empty
+ \@@magyar@error{Unrecognised date: \reserved@b}%
+ %\@@magyar@fixdate{0}{1}{1}}%
+ \def\reserved@a{{0}{1}{1} {\noexpand\reset@font\noexpand\bfseries \string?date\string?}}%
+ \else
+ \reserved@a% calls \@@magyar@fixdate, which sets \reserved@a
+ \fi
+ %%\show\reserved@a
+}%
+%** Definies \reserved@a to {{YYYY}{MM}{DD}} (possibly fewer digits)
+%** @param #1 year (50..99 += 1900, 0..49 += 2000)
+%** @param #2 month (1..12)
+%** @param #3 day of month (1..31), validity of 29..31 not verified
+\def\@@magyar@fixdate#1#2#3{%
+ \edef\reserved@a{\number#1}%
+ \ifnum\reserved@a<0 \def\reserved@a{0}\@@magyar@error{Year too small: #1}\else
+ \ifnum\reserved@a<10 \edef\reserved@a{200\reserved@a}\else
+ \ifnum\reserved@a<50 \edef\reserved@a{20\reserved@a}\else
+ \ifnum\reserved@a<100 \edef\reserved@a{19\reserved@a}\else
+ \ifnum\reserved@a<10000 \else
+ \def\reserved@a{0}\@@magyar@error{Year too large: #1}%
+ \fi\fi\fi\fi\fi
+ \ifnum#2<1 \@@magyar@error{Month too small: #2}\fi% Imp: reset to 0?
+ \ifnum#2>12 \@@magyar@error{Month too large: #2}\fi
+ \ifnum#3<1 \@@magyar@error{Day of month too small: #3}\fi% Imp: reset to 0?
+ \ifnum#3>31 \@@magyar@error{Day of month too large: #3}\fi
+ \edef\reserved@a{{\reserved@a}{\number#2}{\number#3}}%
+}
+
+%** Usage: \magyar@emitdate{FMT}{DATE} or \magyar@emitdate[SUFFIX]{FMT}{DATE}
+%** @example [\emitdate{b}{October 25, 2003}]
+%** @example %[\emitdate{b}{x-y-z}]% ! Package magyar.ldf Error: Unrecognised date: x-y-z.
+%** @example A mai dtum: [\emitdate{b}{\today}].
+%** @example [\emitdate[e]{g}{1848.15.3}] a nap, mikor elhangzott a Nemzeti dal.
+%** @example [\emitdate{b}{1956-10-23}]
+%** @example \told{\@@magyar@date@g{1848}{3}{115}}+a{}
+%** @param SUFFIX any suffix for \told, e.g `e' or `adik+an'
+%** @param DATE date in any format, will be expanded
+%** @param FMT a single letter, specifies the format of the emitted date
+%** a: 1848-03-15 (ISO dtumformtum, 2002-tl(?) a magyar helyesrs rsze)
+%** b: 1848.\ mrcius 15.
+%** c: 1848.\ mrc.\ 15.
+%** d: 1848.\ III.\ 15.
+%** e: 1848.\ 03.\ 15.
+%** f: 1848. mrcius kzepe
+%** g: 1848. mrcius 15[-e reggele]
+%** h: 1848 mrcius [hnapjnak kzepe, mrciusnak kzepe, mrciusban stb.] birtokos rag
+%** english.ldf: `October 25, 2003' or [UK]: `25th October 2003'
+\def\@@magyar@emitdate{%
+ \@ifnextchar[\@@magyar@emitdate@opt{\@@magyar@emitdate@opt[]}%]
+}
+\def\@@magyar@emitdate@opt[#1]#2#3{%
+ \begingroup
+ \@@magyar@parsedate{#3}%
+ % Imp: error message if \@@magyar@told is undefined
+ %\show\reserved@a
+ \edef\reserved@a{%
+ \ifx\vfuzz#1\vfuzz \expandafter\noexpand\csname @@magyar@date@#2\endcsname\reserved@a
+ \else \noexpand\@@magyar@told{\expandafter\noexpand\csname @@magyar@date@#2\endcsname\reserved@a}+#1{}\fi
+ }%
+ %\show\reserved@a
+ %%\show~
+ %\show\reserved@a% \told {\@@magyar@date@g {1848}{3}{15}}+e{}
+ \reserved@a
+ \endgroup
+}
+
+\ifnum\magyar@opt@@emitdate \expandafter\ifx\csname emitdate\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \let\emitdate\@@magyar@emitdate
+\fi
+\@gobble
+{^}%
+
+% --- titleskip=
+
+\ifx\magyar@opt@@titleskip\magyar@@unchanged
+ \def\magyar@opt@@titleskip{\enspace}% for the appendix with appendixdot=no
+\@@magyar@skiplong\fi
+ \expandafter\addto\csname extras\CurrentOption\endcsname{\magyar@@seccntfix}%
+ \let\magyar@@seccntfix\@empty
+ \let\magyar@@default@seccntformat\@seccntformat
+ \AtBeginDocument{%
+ % vvv \ifx added for compatiblity with other packages redefining \@seccntformat _after_ magyar.ldf has been loaded
+ \ifx\@seccntformat\magyar@@default@seccntformat
+ % \@seccntformat affects dot after the section number in the main text.
+ % We don't change the TOC file, because we've changed \numberline. Also
+ % \ps@headings in book.cls already contains a dot.
+ \def\magyar@@seccntfix{%
+ \ifx\@seccntformat\@gobble\else
+ \babel@save\@seccntformat
+ \def\@seccntformat##1{\csname the##1\endcsname.\magyar@opt@@titleskip}%
+ \fi
+ }
+ \fi
+ }
+ \@gobble
+{^}%
+
+% --- footnote=
+
+\if0\magyar@opt@@footnote \@@magyar@skiplong\fi
+ %** Overrides latex.ltx. Expand old contents of \cl@#2 only once.
+ \def\@addtoreset#1#2{%
+ \begingroup
+ \edef\reserved@a{\noexpand\@elt{#1}}%
+ \expandafter\magyar@fo@consra\csname cl@#2\endcsname\gdef
+ \endgroup
+ }
+ %** Similar to \@cons in latex.ltx
+ %** Appends first-level expansion of \reserved@a
+ %** @param #1 a \cs
+ %** @param #2 \def or \gdef
+ \def\magyar@fo@consra{\expandafter\magyar@fo@cons\expandafter{\reserved@a}}%
+ %** @param #1 tokens to append
+ %** @param #2 a \cs
+ %** @param #3 \def or \gdef
+ \def\magyar@fo@cons#1#2#3{\expandafter#3\expandafter#2\expandafter{#2#1}}%
+
+ % vvv Dat: \@definecounter can be called twice, \newcounter cannot
+ \@definecounter{footnote@add}% \newcounter{footnote@add}
+ %** Number of times footnote numbering has been reset
+ \@definecounter{footnote@ch}
+
+ \def\magyar@fo@pickzero#1#2#3\hfuzz#4{%
+ \ifx\relax#1\else \def#4{{#1}{#2}}\fi% pick {#1}{#2}
+ }
+ %** Dat: footnotes inside \begin{minipage} are not affected -- intentionally.
+ %** Will be called by \stepcounter{...} after `\advance\c@footnote1'
+ \def\magyar@fo@resetzero@afterpage{%
+ {% { is better \begingroup, because { works in a tabular
+ \@tempcnta\c@footnote@add
+ \advance\@tempcnta\c@footnote
+ \let\reserved@a\@empty% default
+ % Dat: we ignore \@roman etc. in \thefootnote
+ \expandafter\expandafter\expandafter\magyar@fo@pickzero\csname r@footnote&\the\c@footnote@ch&\the\@tempcnta\endcsname00\hfuzz\reserved@a% this footnote
+ \ifx\reserved@a\@empty \G@refundefinedtrue\fi
+ %
+ \def\magyar@fo@@prevfn{-}% default
+ \advance\@tempcnta\m@ne
+ \expandafter\expandafter\expandafter\magyar@fo@pickzero\csname r@footnote&\the\c@footnote@ch&\the\@tempcnta\endcsname00\hfuzz\magyar@fo@@prevfn% previous footnote
+ \advance\@tempcnta\@ne
+ %
+ \ifx\reserved@a\magyar@fo@@prevfn\else
+ % Restart footnote numbering (from 1) if \label is missing for previous
+ % footnote, or \label reports that prev and this footnotes aren't on the
+ % same page.
+ \global\advance\c@footnote@add\c@footnote
+ \global\advance\c@footnote@add\m@ne
+ \global\c@footnote\@ne
+ \fi
+ \def\@currentlabel{\noexpand\number\c@page}%
+ % ^^^ Dat: \noexpand is here to make \number\c@page expanded during \shipout
+ \ifx\@listdepth\@mplistdepth% inside \begin{minipage}
+ % vvv Dat: expand \thepage both early (minipage) and late (real page)
+ \edef\@currentlabel{\@currentlabel-\thepage}%
+ \fi
+ \edef\reserved@a{\noexpand\label{footnote&\the\c@footnote@ch&\the\@tempcnta}}%
+ % ^^^ Dat: the \label command above produces correct warning (LaTeX
+ % Warning: Label(s) may have changed. Rerun to get cross-references
+ % right.), and it also produces `LaTeX Warning: There were undefined
+ % references.' in case a footnote is removed or changed, and also for
+ % the very first run. Fine.
+ \reserved@a
+ }%\endgroup
+ }
+
+ \let\magyar@fo@resetzero\relax
+
+ %\magyar@fo@cons{XY}\cl@footnote\gdef
+ \magyar@fo@cons{\magyar@fo@resetzero}\cl@footnote\gdef
+
+ %\def\magyar@fo@resetadd{%
+ % \global\advance\c@footnote\c@footnote@add
+ % \global\c@footnote@add\z@
+ %}
+ \def\magyar@fo@aftergrouprelax#1{%
+ \ifx#1\relax\else
+ \aftergroup#1%
+ \expandafter\magyar@fo@aftergrouprelax
+ \fi
+ }
+
+ \def\magyar@fo@mtostar#1{%
+ \if#1m%
+ *\expandafter\magyar@fo@mtostar
+ \fi
+ }
+ %** Producing `m's based on the idea of David Kastrup.
+ %** The default `*' character is in raised position, and we also move it to
+ %** \@textsuperscript, so it will be double raised. But never mind.
+ \def\magyar@fo@thefootnote@stars{\expandafter\magyar@fo@mtostar\romannumeral\number\c@footnote000A}%
+ \def\magyar@fo@thefootnote@starsspmax{\ifcase\c@footnote\or*\or**\or***\or\dag\or\dag\dag\or\dag\dag\dag\else*\the\c@footnote\fi}%
+ \def\magyar@fo@thefootnote@arabic{\@arabic\c@footnote}
+ \def\magyar@fo@thempfootnote@stars{\expandafter\magyar@fo@mtostar\romannumeral\number\c@mpfootnote000 A}%
+ \def\magyar@fo@thempfootnote@starsspmax{\ifcase\c@mpfootnote\or*\or**\or***\or\dag\or\dag\dag\or\dag\dag\dag\else*\the\c@mpfootnote\fi}%
+ \def\magyar@fo@thempfootnote@arabic{\@arabic\c@mpfootnote}
+
+ % !! indent=article must work within \maketitle for article.cls etc.
+
+ %** Copied from article.cls, added \,.
+ %** Has #1, but partially applied here
+ \def\magyar@fo@indent@articlesp{%
+ \parindent1em % SUXX: impossible to acquire default value
+ % Dat: don't use \@makefnmark here, because it puts the footnote mark
+ % only to the main text
+ \noindent\hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark\,}}%
+ }
+ %** Same as \@makefntext in article.cls
+ %** Has #1, but partially applied here
+ \def\magyar@fo@indent@articlenosp{%
+ \parindent1em % SUXX: impossible to acquire default value
+ % Dat: don't use \@makefnmark here, because it puts the footnote mark
+ % only to the main text
+ \noindent\hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark}}%
+ }
+ \def\magyar@@fo@indent@dimensetup{%
+ \parindent1em % SUXX: impossible to acquire default value
+ %\advance\leftskip1.8em % SUXX: impossible to acquire default value
+ \leftskip\leftmargini % SUXX: impossible to acquire default value
+ }
+ %** Has #1, but partially applied here
+ \def\magyar@fo@indent@hulist{%
+ % Dat: superscript is emitted by \@makefnmark
+ % Dat: \parindent doesn't apply for the 1st par of the footnote
+ \magyar@@fo@indent@dimensetup
+ \ifvmode\noindent\hb@xt@\z@\else\hbox\fi
+ % ^^^ \usepackage[para]{footmisc} emits footnotes in horizontal mode
+ {\hss\@textsuperscript{\normalfont\@thefnmark\,}}%
+ }
+
+ %** Limit the size of the footnote mark (in main text) to \normalsize.
+ %** Overrides latex.ltx
+ \def\magyar@fo@makefnmark{%
+ \hbox{% has \begingroup
+ \edef\reserved@a{\f@size}%
+ {\normalsize\edef\reserved@b{\def\noexpand\reserved@b{\f@size}}\expandafter}\reserved@b
+ \ifdim\reserved@a pt>\reserved@b pt
+ %\normalsize\@textsuperscript{\normalfont\footnotesize\@thefnmark}% Dat: would place index too low
+ \@textsuperscript{\normalfont\scriptsize\@thefnmark}%
+ \else\@textsuperscript{\normalfont\@thefnmark}\fi
+ }%
+ }
+ \let\magyar@fo@@cont@number\@empty
+ \def\magyar@fo@savecont{\global\edef\magyar@fo@@cont@number{\global\c@footnote\the\c@footnote\space}}
+
+ %** \footnoterule, as defined in latex.ltx
+ \def\magyar@fo@defaultrule{\kern-3\p@
+ \hrule \@width 2in \kern 2.6\p@} % the \hrule is .4pt high
+ \def\magyar@fo@fourthrule{\kern-3\p@%\hrule\hrule\hrule
+ \hrule \@width .25\textwidth \kern 2.6\p@} % the \hrule is .4pt high
+ \def\magyar@fo@onelinerule{%
+ \unskip% undo \vskip\skip\footins
+ {\normalsize% Dat: \normalfont is superfluous
+ \vskip1\baselineskip plus.1\baselineskip minus .1\baselineskip}%
+ % ^^^ Dat: plus,minus is necessary to avoid `Overfull \vbox (8.86676pt too high)'
+ }
+ \def\magyar@fo@chooserule{\relax
+ \ifx \@listdepth\@mplistdepth \mpfootnoterule \else
+ \ifnum\split@prev=\z@ \pagefootnoterule \else \splitfootnoterule
+ \fi
+ %%\typeout{\string\split@prev=\split@prev}%
+ \xdef\split@prev{\the\insertpenalties}%
+ \fi
+ }
+
+ % `Szerkesztk s szerzk kziknyve, p. 116' says this about Hungarian
+ % footnotes. Implementation notes are marked with [...]. See better docs
+ % in magyarldf-doc.tex
+ %
+ % (1) Use numbering and/or stars (in upper index) for footnote marks.
+ % Numbering is recommended.
+ % [1] Use \footnotestyle{mark=...}
+ % (2) You can put footnotes by the editor with a star, and footnotes by the
+ % author with numbers.
+ % [2] Use \footnotestyle{huplain} in the preamble, and emit each editorial
+ % footnote with {\footnotestyle{editor}\footnote{Her note.}}
+ % (3) Don't put \footnoterule if the footnote starts on current page.
+ % [3] Use \footnotestyle{rule=none}. Please make sure that the group lasts
+ % till \shipout.
+ % (4) Put a \footnoterule (1/3\textwidth or 1/4\textwidth) if footnote is
+ % continued from previous page.
+ % [4] Not supported. Imp: how to?
+ % (5) Multiple short footnotes may be put into a single line.
+ % [5] \usepackage[para]{footmisc} or \usepackage{fnpara}
+ % (6) Footnotes for \begin{figure} and \begin{table} must be put just under
+ % them, not at EOP.
+ % [6] The author should enclose the matrial in a \begin{minipage}
+ % (7) The size of the \footnotemark should not be scaled up.
+ % [7] Use \footnotestyle{marksize=max-normal}
+ % (8) It is possible to use either \parindent or \item when starting a
+ % footnote.
+ % [8] Use \footnotestyle{indent=hulist}
+ % (9) The footnotemark must be followed by a thin space (only at BOP).
+ % [9] OK, see \@makefntext
+ % (10) Don't emit too much stars. Recommended: * ** *** + ++ +++
+ % [10] OK, see \footnoterule{mark=stars-max}. `\dag' is emitted instead
+ % of `+', and `*7' is emitted for the 7th footnote on the page.
+ %
+
+ \@namedef{fos@reset=none}{\let\magyar@fo@resetzero\relax}%
+ %** Similar to \@addtoreset{footnote}{section}, but isn't \global.
+ \@namedef{fos@reset=section}{%
+ \let\magyar@fo@resetzero\relax
+ \magyar@fo@cons{\@elt{footnote}}\cl@section\def
+ \magyar@fo@cons{\@elt{footnote}}\cl@chapter\def
+ }%
+ \@namedef{fos@reset=chapter}{%
+ \let\magyar@fo@resetzero\relax
+ \magyar@fo@cons{\@elt{footnote}}\cl@chapter\def
+ }%
+ %** Next footnote-mark will be `*'. The slots of `*'s of \fos@huplain
+ %** were skipped when changing back to \fos@plain. Restarts numbering from
+ %** 1 (`*'). Usually called as \footnotestyle{resume,reset=page-cont}
+ \@namedef{fos@reset=page}{%
+ \stepcounter{footnote@ch}%
+ \global\c@footnote@add\z@%
+ \global\c@footnote\z@%
+ \let\magyar@fo@resetzero\magyar@fo@resetzero@afterpage
+ %\aftergroup\magyar@fo@resetadd% switched off deliberately
+ }
+ %** editorial footnote on the same page
+ \@namedef{fos@reset=page-cont}{%
+ \aftergroup\magyar@fo@savecont
+ \fos@resume% only \aftergroup
+ \magyar@fo@@cont@number
+ \let\magyar@fo@resetzero\magyar@fo@resetzero@afterpage
+ }
+ \@namedef{fos@reset=page-resume}{%
+ \fos@resume \csname fos@reset=page\endcsname
+ }
+ %** Resume to the previous footnote number at the end of the group. (Default: don't
+ %** resume)
+ %** \footnotestyle{resume,reset=page} is the correct order
+ \def\fos@resume{%
+ \aftergroup\global
+ \aftergroup\c@footnote
+ \expandafter\magyar@fo@aftergrouprelax\the\c@footnote\relax
+ \aftergroup\space
+ %\magyar@fo@resetadd% Dat: not needed because \magyar@fo@resetzero@afterpage won't find prev. ref
+ }
+ %
+ \@namedef{fos@indent=article-sp}{\let\@makefntext\magyar@fo@indent@articlesp}%
+ \@namedef{fos@indent=article-nosp}{\let\@makefntext\magyar@fo@indent@articlenosp}%
+ \@namedef{fos@indent=hulist}{\let\@makefntext\magyar@fo@indent@hulist}%
+ %** This is not a 100% solution, because there might be multiple iterations
+ %** of \footnoterule with different \split@prev values.
+ \@namedef{fos@rule=choose}{% ripped from footmisc.sty
+ \ifx\footnoterule\magyar@fo@chooserule
+ \let\footnoterule\magyar@fo@defaultrule
+ \fi
+ \expandafter\ifx\csname pagefootnoterule\endcsname\relax \let \pagefootnoterule\footnoterule\fi
+ \expandafter\ifx\csname mpfootnoterule\endcsname\relax \let \mpfootnoterule\footnoterule\fi
+ \expandafter\ifx\csname splitfootnoterule\endcsname\relax \let\splitfootnoterule\magyar@fo@fourthrule\fi
+ \expandafter\ifx\csname split@prev\endcsname\relax \gdef\split@prev{0}\fi
+ % ^^^ Dat: \split@prev is named the same in footmisc.sty
+ \let\footnoterule\magyar@fo@chooserule
+ }
+ \@namedef{fos@rule=none}{\let\footnoterule\@empty}%
+ \@namedef{fos@rule=fourth}{\let\footnoterule\magyar@fo@fourthrule}%
+ \@namedef{fos@rule=one-line}{\let\footnoterule\magyar@fo@onelinerule}%
+ \@namedef{fos@marksize=max-normal}{\let\@makefnmark\magyar@fo@makefnmark}%
+ \@namedef{fos@mark=arabic}{\let\thefootnote\magyar@fo@thefootnote@arabic}%
+ \@namedef{fos@mark=stars}{\let\thefootnote\magyar@fo@thefootnote@stars}%
+ \@namedef{fos@mark=stars-max}{\let\thefootnote\magyar@fo@thefootnote@starsspmax}%
+ \@namedef{fos@mpmark=arabic}{\let\thempfootnote\magyar@fo@thempfootnote@arabic}%
+ \@namedef{fos@mpmark=stars}{\let\thempfootnote\magyar@fo@thempfootnote@stars}%
+ \@namedef{fos@mpmark=stars-max}{\let\thempfootnote\magyar@fo@thempfootnote@starsspmax}%
+ %\def\fos@globalmark{\expandafter\global\expandafter\let\csname the\@mpfn\endcsname\endcsname\thefootnote}
+ %\def\fos@globalmpmark{\global\let\thempfootnote\thefootnote}
+
+ \def\fos@plain{\csname fos@reset=none\endcsname\csname fos@mark=arabic\endcsname}
+ \def\fos@huplain {\csname fos@marksize=max-normal\endcsname \csname fos@reset=none\endcsname\csname fos@mark=arabic\endcsname\csname fos@rule=none\endcsname\csname fos@indent=hulist\endcsname}
+ \def\fos@starplain{\fos@huplain\csname fos@reset=page\endcsname\csname fos@mark=stars-max\endcsname}%
+ %\def\fos@editor{\fos@resume\fos@starplain}%
+ \def\fos@editor{\fos@huplain\csname fos@reset=page-cont\endcsname\csname fos@mark=stars-max\endcsname}%
+
+ \def\footnotestyle#1{%
+ \@for\reserved@a:=#1\do{%
+ \@ifundefined{fos@\reserved@a}{\@latex@error{Undefined footnote style: \reserved@a}\@ehc}%
+ {\csname fos@\reserved@a\endcsname}%
+ }%
+ }
+
+ \def\editorfootnote#1{\begingroup\footnotestyle{editor}%
+ \footnote{#1}\endgroup}%
+ \def\headingfootnote{%
+ \ifx\protect\@typeset@protect\expandafter\footnote
+ \else\expandafter\@gobble\fi
+ % ^^^ Dat: this test is better, because it makes magyar.ldf compatible
+ % with nath.sty that says \def\protect{\noexpand} in its redefinition
+ % of \addtocontents
+ %\ifx\protect\@unexpandable@protect\expandafter\@gobble
+ %\else\expandafter\footnote\fi
+ }
+
+ %** @param #1 an end-csname, example: \endfigure
+ \def\magyar@fo@mp@setup#1{%
+ \let\@footnotetext\@mpfootnotetext
+ \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
+ % ^^^ This line is optional, but strongly recommended. Restart numbering
+ % for each float, and number with \thempfootnote.
+ % vvv Very tricky use of `#' in expansion.
+ % Dat: \magyar@fo@mp@show is idempotent
+ % vvv Prepend \magyar@fo@mp@show to the definition of \@makecaption
+ \expandafter\def\expandafter\@makecaption\expandafter##\expandafter1%
+ \expandafter##\expandafter2\expandafter{\expandafter\magyar@fo@mp@show%
+ \@makecaption{##1}{##2}%
+ }%
+ %%\show\@currenvir
+ % vvv Dat: this prepending has only local effect.
+ \expandafter\def\expandafter#1\expandafter{%
+ \expandafter\magyar@fo@mp@show#1}%
+ %\expandafter\magyar@fo@mp@prepend\csname\@currenvir\endcsname
+ \setbox\@mpfootins\box\voidb@x
+ }
+ \def\magyar@fo@mp@show{% ripped from latex.ltx (\endminipage)
+ \ifvoid\@mpfootins\else
+ \par\unskip \vskip\skip\@mpfootins
+ \normalcolor \footnoterule
+ \expandafter\ifx\csname mpmakefootnoteparagraph\endcsname\relax
+ \unvbox\@mpfootins
+ \else% fnpara.sty
+ \mpmakefootnoteparagraph
+ \fi
+ \fi
+ }
+
+ %** Only works if \cs of #1 doesn't have macro arguments. It works for
+ %** \figure and \table, because their optional argument `[b]' etc. is not
+ %** a macro argument.
+ %** @example \makeFootnotable{figure}
+ %** @example \makeFootnotable{} -- current instance of current environment
+ \def\makeFootnotable#1{%
+ \if\relax#1\relax
+ \expandafter\magyar@fo@mp@setup\csname end\@currenvir\endcsname
+ \else
+ \expandafter\expandafter\expandafter\magyar@fo@makef@low
+ \expandafter\expandafter\csname #1\endcsname
+ \csname end#1\endcsname
+ \fi
+ }
+ %** @example \magyar@fo@makef@low\table\endtable
+ \def\magyar@fo@makef@low#1#2{\expandafter\def\expandafter#1\expandafter{%
+ \expandafter\magyar@fo@mp@setup\expandafter#2#1}}%
+
+ \if2\magyar@opt@@footnote \fos@huplain\fi
+ \if3\magyar@opt@@footnote \fos@starplain\fi
+ \@gobble
+{^}
+
+% --- mathbrk=
+
+\if0\magyar@opt@@mathbrk \@@magyar@skiplong\fi % mathbrk=define and mathbrk=fix
+ %** Similar to \@@magyar@fixmathcmd@low, but inserts symbol immediately.
+ %** @param #1 `\mathchar', all catcodes
+ %** @param #2 hex code
+ %** @param #3 ignored
+ %** @param #4 a \cs
+ \def\@@magyar@breakmathcmd@low#1"#2"#3\hfuzz#4{%
+ \def\reserved@a{#1}%
+ \edef\reserved@b{\string\mathchar}%
+ \ifx\reserved@a\reserved@b
+ \mathchar"#2
+ \ifnum"#2<"8000 % redundant sanity check, trueness implied by #1==\mathchar
+ \nobreak\discretionary{}{\hbox{\(\mathchar"#2 \)}}{}%
+ \fi
+ \fi
+ }%
+ %** Dat: robustness is tested and works with nath.sty
+ %** @param #1 a \cs or char of a MathBin or MathRel, e.g `\prec' or `+'
+ \DeclareRobustCommand\MathBrkAll[1]{%
+ \ifcat\noexpand#1\relax
+ \expandafter\@@magyar@breakmathcmd@low\meaning#1""\hfuzz#1%
+ \else
+ \ifnum\mathcode`#1="8000
+ \expandafter\expandafter\expandafter#1% keep original meaning
+ \else
+ \mathchar\the\mathcode`#1\relax% disable \active meaning
+ \ifnum\mathcode`#1<"8000 % redundant sanity check
+ \nobreak\discretionary{}{\hbox{\(\mathchar\the\mathcode`#1\relax\)}}{}%
+ \fi
+ \fi
+ \fi
+ }
+ \let\MathBrk\relax
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\MathBrk
+ \let\MathBrk\MathBrkAll
+ }
+ \@gobble
+{^}
+
+\if2\magyar@opt@@mathbrk\else \@@magyar@skiplong\fi % mathbrk=fix
+ \def\@@magyar@resetmathchars{%
+ \mathcode`+"202B \catcode`+12
+ \mathcode`-"2200 \catcode`-12
+ \mathcode`*"2203 \catcode`*12
+ \mathcode`/"013D \catcode`/12
+ \mathcode`>"313E \catcode`>12
+ \mathcode`<"313C \catcode`<12
+ \mathcode`="303D \catcode`=12
+ % vvv Dat: leave these chars intact, for compatibility (with nath.sty and others)
+ %\mathcode`:"303A \catcode`:12
+ %\mathcode`;"603B \catcode`;12
+ %\mathcode`,"613B \catcode`,12
+ %\mathcode`!"5021 \catcode`!12
+ %\mathcode`?"503F \catcode`?12
+ %\mathcode`|"026A \catcode`|12
+ %\mathcode`."013A \catcode`.12
+ }
+ %** Dat: don't do `/', because slash is unbreakable
+ \def\@@magyar@domathbins{%
+ \do-\@@magyar@fix@newmcodes@dash
+ \do+\do*\do>\do<\do=}%
+ %** @param #1 a char token with \mathcode != "8000, like +
+ \def\@@magyar@fixmathbinchar#1{%
+ \ifnum\mathcode`#1="8000 \else
+ % Dat: \(...\) is safer than `$...$', because \( has a fixed \catcode
+ % that works with and w/o nath.sty
+ \begingroup\lccode\string`~\string`#1\lowercase{\endgroup\edef~}{%
+ \mathchar\the\mathcode`#1\relax% Dat: would need \space\space
+ \noexpand\ifx\noexpand\MathBrk\noexpand\MathBrkAll% Hungarian language is active
+ \nobreak\discretionary{}{\hbox{\noexpand\(\mathchar\the\mathcode`#1 \noexpand\)}}{}%
+ \noexpand\fi}%
+ \mathcode`#1"8000
+ \fi
+ \catcode`#112
+ }
+ %** \newmcodes@ defined in amsopn.sty doesn't work (triggered by
+ %** \DeclareMathOperator{\tg}{tg} $\tg$) because it wants to assign
+ %** \mathchardef\std@minus\mathcode`\-, which is "8000, which is a bad
+ %** matchar. We fix that by prepending \mathcode`-45 to \newmcodes@ .
+ %** This is OK, because \newmcodes@ is protected by a block set up by
+ %** \qopname.
+ \def\@@magyar@newmcodes@fixed{\mathcode`-"45 \magyar@@newmcodes}%
+ \def\@@magyar@fix@newmcodes@dash{%
+ \ifx\newmcodes@\@undefined\else
+ \ifx\newmcodes@\@@magyar@newmcodes@fixed\else % Protect against double redefinition such as in \begin{align*}\tg\end{align*}
+ \let\magyar@@newmcodes\newmcodes@
+ \let\newmcodes@\@@magyar@newmcodes@fixed
+ \fi
+ \fi
+ }%
+
+ %** @param #1 `\mathchar', all catcodes
+ %** @param #2 hex code
+ %** @param #3 ignored
+ %** @param #4 a \cs
+ \def\@@magyar@fixmathcmd@low#1"#2"#3\hfuzz#4{%
+ % Imp: check \cong and \notin with txfonts and pxfonts. Do they look OK?
+ \def\reserved@a{#1}%
+ \edef\reserved@b{\string\mathchar}%
+ \ifx\reserved@a\reserved@b
+ \ifnum"#2<"8000 % redundant sanity check, trueness implied by #1==\mathchar
+ % Make #4 robust.
+ \edef#4{\noexpand\protect\expandafter\noexpand\csname
+ \expandafter\@gobble\string#4 \endcsname}%
+ % vvv Imp: \def would be better than \edef?
+ \expandafter\edef\csname\expandafter\@gobble\string#4 \endcsname{%
+ % Dat: \mathchar already produces: `! Missing $ inserted.'
+ \mathchar"#2
+ \noexpand\ifx\noexpand\MathBrk\noexpand\MathBrkAll% Hungarian language is active
+ \nobreak\discretionary{}{\hbox{\noexpand\(\mathchar"#2 \noexpand\)}}{}%
+ \noexpand\fi
+ }%
+ \fi
+ \fi
+ }%
+ %** Works even if #1 is undefined (but consumes hash memory)
+ %** @param #1 a \cs of a MathBin or MathRel, e.g \prec
+ \def\@@magyar@fixmathcmd#1{%
+ \expandafter\@@magyar@fixmathcmd@low\meaning#1""\hfuzz#1%
+ }
+
+ \let\@@magyar@domathbins@prefix\@empty
+ \def\@@magyar@onmathstart{%
+ \@@magyar@resetmathchars
+ \let\do\@@magyar@fixmathbinchar
+ \@@magyar@domathbins@prefix\@@magyar@domathbins% only in math mode start
+ }
+
+ \def\@@magyar@fixeverymathcmds@appendto#1#2{% A generic \appendto.
+ \expandafter\def\expandafter#1\expandafter{#1#2}}%
+ \def\@@magyar@fixeverymathcmds@setup{%
+ \expandafter\ifx\csname mathoptions@on\endcsname\relax% no nath.sty
+ \@@magyar@fixeverymathcmds@appendto\check@mathfonts\@@magyar@onmathstart
+ \else\@@magyar@fixeverymathcmds@appendto\mathoptions@on\@@magyar@onmathstart\fi
+ }
+
+ % The definition of \@tabular contains a $, which calls
+ % \@@magyar@domathbins, which has some unintended side effects of changing
+ % \catcode values and the meaning of the active character : . This magic
+ % prevents the call to \@@magyar@domathbins .
+ %
+ % Test code: \author{a:b} \maketitle
+ % Test code: \def\foo{a:b} \begin{tabular}[t]{c}x\foo y\end{tabular}
+ \def\@@magyar@mathbins@tabularfix#1${%
+ #1\def\@@magyar@domathbins@prefix{%
+ \let\@@magyar@domathbins@prefix\@empty\@gobble}$}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\@tabular
+ \expandafter\expandafter\expandafter{%
+ \expandafter\@@magyar@mathbins@tabularfix\@tabular}
+
+ \def\@@magyar@fixmathcmds{%
+ \let\do\@@magyar@fixmathcmd
+ % vvv Binary relations listed in Table 3.4 in lshort.dvi
+ \do\leq\do\le\do\ll\do\prec\do\preceq\do\subset\do\subseteq\do\sqsubset
+ \do\sqsubseteq\do\in\do\vdash\do\mid\do\smile\do\geq\do\ge\do\gg\do\succ
+ \do\succeq\do\supset\do\supseteq\do\sqsupset\do\sqsupseteq\do\ni\do\owns
+ \do\dashv\do\parallel\do\frown\do\notin\do\equiv\do\doteq\do\sim\do\simeq
+ \do\approx\do\cong\do\Join\do\bowtie\do\propto\do\models\do\perp\do\asymp
+ \do\neq\do\ne
+ % vvv Binary operators listed in Table 3.5 in lshort.dvi
+ %\do\cdot% unbreakable
+ \do\pm\do\times\do\cup\do\sqcup\do\vee\do\lor\do\oplus\do\odot\do\otimes
+ \do\bigtriangleup\do\lhd\do\unlhd\do\mp\do\div\do\setminus\do\cap\do\sqcap
+ \do\wedge\do\land\do\ominus\do\oslash\do\bigcirc\do\bigtriangledown\do\rhd
+ \do\unrhd\do\triangleleft\do\triangleright\do\star\do\ast\do\circ\do\bullet
+ \do\diamond\do\uplus\do\amalg\do\dagger\do\ddagger\do\wr
+ \edef\cdot{\noexpand\protect\csname cdot \endcsname}%
+ \expandafter\def\csname cdot \endcsname{\nobreak\mathchar"2201\nobreak}%
+ \def\slash{\nobreak/\nobreak}% only in math-mode start, \nobreak
+ % ^^^ Dat: \slash is fragile in latex.ltx
+ }
+
+ % This fixes \url defined in url.sty, by making \@@magyar@onmathstart a no-op
+ % with a URL. This is important because \url defines its own math mode with
+ % its own \mathcode and \catcode values, and we don't want mathbrk=fix clash
+ % with that.
+ \def\@@magyar@mathfixurl{%
+ \ifx\Url\@undefined\else
+ % Prepend \let\@@magyar@onmathstart\@empty to \Url.
+ \expandafter\def\expandafter\Url\expandafter{%
+ \expandafter\let\expandafter\@@magyar@onmathstart\expandafter\@empty
+ \Url}%
+ \fi
+ }%
+
+ \AtBeginDocument{%
+ \@@magyar@mathfixurl\@@magyar@fixmathcmds\@@magyar@fixeverymathcmds@setup}
+ \@gobble
+{^}
+
+% --- mathfactorial=
+
+\if0\magyar@opt@@mathfactorial \@@magyar@skiplong\fi
+ % Imp: weak define? It doesn't conflict with nath.sty -- yet.
+ \def\factorial{\mathchar"5021\mathopen{}\mathinner{}}
+ \@gobble
+{^}
+
+\if2\magyar@opt@@mathfactorial\else \@@magyar@skiplong\fi
+ \expandafter\addto\csname \expandafter\ifx\csname mathoptions@on\endcsname
+ \relax check@mathfonts\else mathoptions@on\fi\endcsname{% detect nath.sty
+ \catcode`!12 \mathcode`!"8000
+ \begingroup\lccode`~`!\lowercase{\endgroup\def~}{\factorial}%
+ }
+ \@gobble
+{^}
+
+% --- mathhucomma=
+
+\if0\magyar@opt@@mathhucomma \@@magyar@skiplong\fi
+ %** Dat: works for all catcodes, even for `end group character 5'
+ %** Inspired by Donald Aresenau
+ %** @param #1 the
+ %** @param #2 character
+ %** @example The sample in your article would be typed
+ %** \[ F_{i}(x,y) = y^i + 1,3x \qquad x,y \in A,\ i = 1, 2, 3,\ldots \]
+ \edef\@@magyar@hucomma@lowa#1#2 #3#4 #5#6\hfuzz{%
+ \noexpand\ifnum9<1#5 \noexpand\if#1t\noexpand\if#3c%
+ \noexpand\mathord\noexpand\fi\noexpand\fi\noexpand\fi\mathchar
+ \ifnum\mathcode`,="8000 "613B \else\the\mathcode`, \space\fi% immed expand
+ % Dat: "613B is the punctuation, "013B is ordinary
+ }%
+ %%\show\@@magyar@hucomma@lowa
+ \def\@@magyar@hucomma@lowb{\expandafter\@@magyar@hucomma@lowa\meaning\reserved@a/ / /\hfuzz}%
+ %** Put a \mathord, if it is followed by a digit; otherwise put a normal,
+ \DeclareRobustCommand\HuComma{\futurelet\reserved@a\@@magyar@hucomma@lowb}
+ \@gobble
+{^}
+
+\if2\magyar@opt@@mathhucomma\else \@@magyar@skiplong\fi
+ % !! into \extrasmagyar
+ \expandafter\addto\csname \expandafter\ifx\csname mathoptions@on\endcsname
+ \relax check@mathfonts\else mathoptions@on\fi\endcsname{% detect nath.sty
+ \catcode`,12 \mathcode`,"8000
+ \begingroup\lccode`~`,\lowercase{\endgroup\def~}{\HuComma}%
+ }
+ \@gobble
+{^}
+
+% --- mathmuskips=
+
+\if1\magyar@opt@@mathmuskips% =latex, as defined in latex.ltx
+ \thickmuskip 5mu plus 5mu
+ \medmuskip 4mu plus 2mu minus 4mu
+ \thinmuskip 3mu
+\fi
+\if2\magyar@opt@@mathmuskips% =hu
+ \thickmuskip 4mu plus 2mu minus 4mu
+ \medmuskip 2mu plus 1.5mu minus 2mu % \medmuskip<\thinmuskip OK
+ \thinmuskip 3mu
+\fi
+
+% --- hynumberline=
+% by pts@fazekas.hu at Tue Nov 21 00:34:37 CET 2006
+%
+% hynumberline=hu adds a dot after the section number in the bookmarks/outline
+% with \hypersetup{bookmarksnumbered=true} in hyperref.sty.
+
+\if0\magyar@opt@@hynumberline \@@magyar@skiplong\fi
+ %** Overrides original definition (\def\Hy@numberline#1{#1 }) in
+ %** pdfmark.def.
+ %** Also possible with:
+ %** \pdfstringdefDisableCommands{\renewcommand*{\numberline}[1]{#1. }}
+ \def\@@magyar@@hynumberline@old#1{#1 }% as defined in pdfmark.def
+ \def\@@magyar@@hynumberline@hu #1{#1. }%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \ifx \Hy@numberline\@@magyar@@hynumberline@old
+ \let\Hy@numberline\@@magyar@@hynumberline@hu \fi}%
+\@gobble
+{^}%
+
+% --- mathreal=
+
+\if0\magyar@opt@@mathreal \@@magyar@skiplong\fi
+ %** @param #1 a number with a possible decimal digit, e.g `12' or `-12.3'
+ \def\@@magyar@mathreal@lowa#1{\ensuremath{\@@magyar@mathreal@lowb#1\@gobble.}}%
+ \def\@@magyar@mathreal@lowb#1.{%
+ #1%
+ \@secondoftwo\@gobble% Wizardry: \@secondoftwo may be \@gobbled by token before `.'
+ {\mathchar"013B \@@magyar@mathreal@lowb}%
+ }
+ \DeclareRobustCommand\@@magyar@mathreal{\ensuremath}%
+ \expandafter\expandafter\expandafter\addto
+ \expandafter\expandafter\csname extras\CurrentOption\endcsname\expandafter{%
+ \expandafter\babel@save\csname @@magyar@mathreal \endcsname
+ \expandafter\let\csname @@magyar@mathreal \endcsname \@@magyar@mathreal@lowa}%
+ \ifnum\magyar@opt@@mathreal \expandafter\ifx\csname mathreal\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \let\MathReal\@@magyar@mathreal
+ \fi
+\@gobble
+{^}%
+
+% --- \documentclass-specific modifications; classmod=
+
+% Callback which redefines \ps@headings and runs it again if needed, when
+% magyar.ldf has an override for the standard \ps@headings, and
+% \pagestyle{headings} is active either explictly (e.g. in article.cls) or
+% by default (e.g. in book.cls).
+\let\@@magyar@setup@psheadings\relax
+
+%** Localized definition which replaces \ps@headings, if appropriate.
+\let\@@magyar@overridden@psheadings\@empty
+
+\ifx\magyar@opt@@classmod\relax\@@magyar@skiplong\fi
+
+%** Appends the first-level expansion of argless macro ##2 to ##1.
+\def\magyar@letappendto#1#2{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{%
+ \expandafter#1#2}}%
+
+%** Defines #1 to the concatenation of \partmark ... \subparagraphmark,
+%** \oddfoot, \evenfoot, \oddhead, \evenhead.
+\def\magyar@mark@fingerprint@def#1{%
+ % We have ! here because some macros (such as \partmark) have #1, which
+ % gets expanded by \expandafter
+ \def#1{markfp: }%
+ \ifx\partmark\@undefined
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{-partmark}}%
+ \else
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\partmark!:partmark}}%
+ \fi
+ \magyar@letappendto#1\reserved@b
+ %
+ \ifx\chaptermark\@undefined
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{-chaptermark}}%
+ \else
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\chaptermark!:chaptermark}}%
+ \fi
+ \magyar@letappendto#1\reserved@b
+ %
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\sectionmark!:sectionmark}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\subsectionmark!:subsectionmark}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\paragraphmark!:paragraphmark}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\subparagraphmark!}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\@oddfoot!:oddfoot}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\@evenfoot!:evenfoot}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\@evenhead!:evenhead}}%
+ \magyar@letappendto#1\reserved@b
+ \expandafter\def\expandafter\reserved@b\expandafter{%
+ \expandafter{\@oddhead!:oddhead}}%
+ \magyar@letappendto#1\reserved@b
+ % Dat: don't use \@mkboth (\let\@mkboth\markboth)
+}%
+
+%** Branches based on whether the \pagestyle has changed since loading the
+%** class file.
+%** @param #1 class file name, e.g. `book.cls'. Tested with book.cls and
+%** report.cls.
+%** @param #2 tokens to insert before fingerprinting the current page style.
+%** @param implicit-#3 then-branch
+%** @param implicit-#4 else-branch
+\def\magyar@if@originalpagestyle#1#2{%
+ \begingroup
+ % article.cls calls \pagenumbering, which does a \gdef\thepage and
+ % \global\c@page=1. We'll cancel that below.
+ \let\magyar@@pagestyle@save@thepage\thepage
+ \edef\magyar@@pagestyle@save@c@page{\the\c@page\space}
+ \edef\magyar@@pagestyle@save@c@tocdepth{\the\c@tocdepth\space}
+ % Dat: no \paragraphmark or \subparagraphmark
+ % vvv Dat: already defined in latex.ltx
+ %\providecommand\sectionmark[1]{\relax}
+ %\providecommand\subsectionmark[1]{\relax}
+ #2\magyar@mark@fingerprint@def\@@magyar@now@marks
+ %
+ \def\ProvidesClass##1[##2]{}%
+ \def\NeedsTeXFormat##1[##2]{}% avoid ``can be used only in preamble''
+ \long\def\DeclareOption##1##2{}%
+ \def\ExecuteOptions##1{}%
+ \def\ProcessOptions{}%
+ \def\DeclareOldFontCommand##1##2##3{}%
+ %
+ \def\magyar@gobbleopt[##1]{}%
+ % Dat: \newcommand etc. are not \global. Good.
+ \let\@onlypreamble\@gobble % In letter.cls .
+ \let\newdimen\@gobble
+ \let\newif\@gobble
+ \let\newskip\@gobble
+ \let\newmuskip\@gobble
+ \let\newcount\@gobble
+ \let\newbox\@gobble
+ \let\newtoks\@gobble
+ \let\newread\@gobble
+ \let\newwrite\@gobble
+ \let\newlaunguage\@gobble
+ \let\newlength\@gobble
+ \def\newcounter##1{\@ifnextchar[\magyar@gobbleopt{}}%
+ \def\setcounter##1##2{\@ifundefined{c@##1}{\@nocounterr{##1}}%
+ {\csname c@##1\endcsname##2\relax}}
+ %** Like \newcommand, but always overrides old values.
+ \def\magyar@defcommand{\@star@or@long\magyar@defcommand@low}
+ \def\magyar@defcommand@low##1{%
+ \begingroup
+ \escapechar\m@ne\xdef\@gtempa{\string##1}%
+ \endgroup
+ \expandafter\let\csname\@gtempa\endcsname\@undefined
+ \@star@or@long\new@command##1%
+ }%
+ \def\newcommand{\magyar@defcommand}%
+ \def\renewcommand{\magyar@defcommand}%
+ \def\magyar@defenvironment##1{%
+ \@ifundefined{##1}{}{%
+ \expandafter\let\csname ##1\endcsname\@undefined
+ \expandafter\let\csname end##1\endcsname\@undefined
+ }%
+ \@star@or@long\new@environment{##1}%
+ }%
+ \def\newenvironment{\magyar@defenvironment}%
+ \def\renewenvironment{\magyar@defenvironment}%
+ %
+ \ps@empty % Clean \@oddhead as of latex.ltx
+ \let\@mkboth\@gobbletwo
+ \let\@oddhead\@empty
+ \let\@evenhead\@empty
+ \let\@oddfoot\@empty
+ \let\@evenfoot\@empty
+ %
+ \def\input##1 {} % size10.clo etc.
+ \makeatletter \@@input #1 %
+ #2\magyar@mark@fingerprint@def\@@magyar@class@marks
+ %\message{AAA \meaning\@@magyar@now@marks}%
+ %\message{BBB \meaning\@@magyar@class@marks}%
+ \global\let\thepage\magyar@@pagestyle@save@thepage
+ \global\c@page\magyar@@pagestyle@save@c@page
+ \global\c@tocdepth\magyar@@pagestyle@save@c@tocdepth
+ \ifx\@@magyar@now@marks\@@magyar@class@marks
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi
+}
+
+%\begingroup
+%\magyar@mark@fingerprint@def\OOO
+%\message{OOO \meaning\OOO}%
+%\endgroup
+
+%** Branches based on whether the specified \pagestyle is active.
+%** @param #1 tokens which change to the \pagestyle specified, e.g.
+%** `\ps@headings'.
+%** @param implicit-#2 then-branch
+%** @param implicit-#3 else-branch
+\def\magyar@if@currentpagestyle#1{%
+ \begingroup
+ \magyar@mark@fingerprint@def\@@magyar@now@marks
+ #1%
+ \magyar@mark@fingerprint@def\@@magyar@specified@marks
+ \ifx\@@magyar@now@marks\@@magyar@specified@marks
+ \endgroup\expandafter\@firstoftwo
+ \else
+ \endgroup\expandafter\@secondoftwo
+ \fi
+}
+
+%** Redefine \@@magyar@setup@psheadings for #2.cls.
+%** @param #1 is the expanded value of \CurrentOption (`magyar').
+\def\magyar@def@psheadings#1#2{%
+ \def\@@magyar@setup@psheadings{%
+ % SUXX: \show doesn't work here.
+ \ifx\@@magyar@overridden@psheadings\ps@headings
+ \@@magyar@error{assert: \string\let\string\ps@headings\string\@@magyar@overridden@psheadings\space was too early}%
+ \else\ifx\@@magyar@overridden@psheadings\@empty
+ \@@magyar@error{assert: \string\@@magyar@overridden@psheadings\space should be redefined}%
+ \else
+ \magyar@if@originalpagestyle{#2.cls}{\ps@headings}{%
+ % \ps@headings still has its original definition (as of #1.cls).
+ %
+ % For efficiency reasons, we make the following restriction. If the
+ % user does \selectlanguage{...} throughout the document, he should
+ % call \pagetsyle{...} after that to make the pagestyle
+ % language-dependent.
+ %
+ % !! add support for \thispagestyle in the preamble.
+ % !! don't add this if extras gets cleared.
+ \expandafter\addto\csname extras#1\endcsname{%
+ \babel@save\ps@headings
+ \let\ps@headings\@@magyar@overridden@psheadings
+ }%
+ \magyar@if@currentpagestyle{\ps@headings}{%
+ % The current \pagestyle has been selected by the current
+ % \ps@headings, i.e. \pagestyle{headings} is active.
+ \edef\reserved@a{\languagename}%
+ \edef\reserved@a{\expandafter\strip@prefix\meaning\reserved@a}%
+ \edef\reserved@b{#1}%
+ \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@a}%
+ \ifx\reserved@a\reserved@b
+ % Localize the current \pagestyle to Hungarian `headings'.
+ \@@magyar@overridden@psheadings
+ \fi
+ }{}%
+ }{}%
+ \fi\fi
+ }%
+}
+
+\def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional
+
+\def\@@magyar@macro@appendixname{\appendixname}
+
+%** \thechapter (possibly with huordinal), dot, space.
+\def\magyar@huordinal@chapterheaddot{%
+ \ifx\@chapapp\@@magyar@appendixname \thechapter\hbox{\magyar@opt@@titleskip}% appendixdot=no
+ \else\ifx\@chapapp\@@magyar@macro@appendixname \thechapter.~%
+ \else\ifnum\magyar@opt@@chapternumber=1 \@huordinal\c@chapter~%
+ \else\ifnum\magyar@opt@@chapternumber=2 \@Huordinal\c@chapter~%
+ \else \thechapter.~%
+ \fi\fi\fi\fi
+}
+
+%** \thepart (possibly with huordinal), dot, space.
+\def\magyar@huordinal@partheaddot{%
+ \ifnum\magyar@opt@@partnumber=1 \@huordinal\c@part~%
+ \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal\c@part~%
+ \else \thepart.~%
+ \fi\fi
+}
+
+%** Emits the rule to the running head. Must put something of zero width
+%** to the horizontal list.
+%** @param #1 0: even page, 1: odd page, 3: page w/o [twoside]
+\def\@@magyar@headrule#1{}
+\def\@@magyar@slshape{}% running head is not slanted
+
+\ifx\magyar@opt@@classmod\@empty
+ \let\@@magyar@ifclassloaded\@ifclassloaded
+\else
+ \def\@@magyar@ifclassloaded#1#2{% force specific class
+ \def\reserved@a{#1}%
+ \ifx\reserved@a\magyar@opt@@classmod #2\fi
+ }
+\fi
+
+\@@magyar@ifclassloaded{amsbook}{%
+ \let\magyar@hunumbers@errmsg\@empty
+ \let\@@magyar@orig@makechapterhead\@makechapterhead
+ \def\@makechapterhead#1{%
+ \begingroup
+ \let\@@magyar@orig@centerline\centerline
+ \def\centerline##1{%
+ \@@magyar@orig@centerline{%
+ \normalsize\mdseries
+ \ifx\chaptername\appendixname % We're in the appendix.
+ \ifx\@@magyar@appendixname\@empty
+ % print a dot in the appendix only if appendixdot=yes
+ \thechapter.~%
+ \else
+ \thechapter\hbox{\magyar@opt@@titleskip}%
+ \fi
+ \else\ifnum\magyar@opt@@chapternumber=1
+ \uppercase\@xp{\@huordinal\c@chapter}~%
+ \else\ifnum\magyar@opt@@chapternumber=2
+ \uppercase\@xp{\@Huordinal\c@chapter}~%
+ \else\thechapter.~%
+ \fi\fi\fi
+ \uppercase\@xp{\chaptername}%
+ }%
+ }%
+ \@@magyar@orig@makechapterhead{#1}%
+ \endgroup
+ }%
+ \let\@@magyar@orig@chapter\@chapter
+ \def\@chapter{%
+ \let\@@magyar@orig@chapter@typeout\typeout
+ \def\typeout##1{%
+ % Original: \typeout{\chaptername\space\@secnumber}
+ \@@magyar@orig@chapter@typeout{%
+ \ifnum\c@secnumdepth<\z@
+ \chaptername\space
+ \else
+ \thechapter\ifx\chaptername\appendixname\else.\fi
+ \space\chaptername
+ \fi
+ }%
+ \let\typeout\@@magyar@orig@chapter@typeout
+ }%
+ \@@magyar@orig@chapter
+ }%
+ % Just to be sure, no need for this in amsbook.cls 2004/08/06
+ \@ifundefined{tocpart}{\let\tocpart\tocsection}{}
+ % TODO(pts): Override only parts of \@part
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}%
+ % TODO(pts): What does \tocpart do for a non-hungarian \tableofcontents?
+ \addcontentsline{toc}{part}{\protect\tocpart{\partname}{\thepart}%
+ {#1}}%
+ \else
+ \addcontentsline{toc}{part}{#1}\fi
+ \begingroup\centering
+ \ifnum \c@secnumdepth >-2\relax
+ {\fontsize{\@xviipt}{22}\bfseries
+ \ifnum\magyar@opt@@partnumber=1 \@huordinal\c@part~%
+ \else\ifnum\magyar@opt@@partnumber=2 \@Huordinal\c@part~%
+ \else\thechapter.~%
+ \fi\fi
+ \partname
+ } \vskip 20\p@ \fi
+ \fontsize{\@xxpt}{25}\bfseries
+ #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}}
+}{}
+
+\@@magyar@ifclassloaded{book}{%
+ \let\magyar@hunumbers@errmsg\@empty
+ % Headings: inserting dots, changing orders
+ %\def\@@magyar@appendixname{\appendixname}% by appendixdot=
+ \def\@@magyar@overridden@psheadings{%
+ \if@twoside
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}%
+ \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter% Dat: mainmatter only in book.cls, not in report.cls
+ \magyar@huordinal@chapterheaddot
+ \@chapapp.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ ##1}}}%
+ \else
+ \let\@oddfoot\@empty
+ \def\@oddhead{\@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \magyar@huordinal@chapterheaddot
+ \@chapapp.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ \fi
+ ##1}}}%
+ \fi
+ }%
+ \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{book}%
+ % Part: inserting dot, changing order, toc
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@part
+ \def\@part[#1]#2{% book
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi
+ \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \magyar@huordinal@partheaddot\partname% hu
+ \csname par\endcsname
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\csname par\endcsname}%
+ \@endpart}}
+ % Chapter: dot, changing typeout, toc
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@chapter
+ \def\@chapter[#1]#2{% !! don't \def, but \let, other places, too
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \refstepcounter{chapter}%
+ \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}%
+ \ifx\@chapapp\@@magyar@appendixname
+ % \@gobble gobbles the dot emitted by \numberline.
+ \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
+ \fi
+ \ifx\@chapapp\@@magyar@appendix@chapapp\else
+ \ifnum\magyar@opt@@chapternumber>0 \protected@edef\@currentlabel{\@huordinal\c@chapter}\fi
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ %\csname par\endcsname
+ \@afterheading % Imp: why doesn't it work?
+ \fi}}
+ \if0\magyar@opt@@chapterhead\else
+ % Chapter: dot, changing order
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@makechapterhead
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \huge\bfseries
+ \magyar@huordinal@chapterheaddot \@chapapp{}%
+ \csname par\endcsname\nobreak
+ \vskip 20\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\csname par\endcsname\nobreak
+ \vskip 40\p@
+ }}%
+ }%
+ \fi
+}{}
+
+\@@magyar@ifclassloaded{report}{%
+ \let\magyar@hunumbers@errmsg\@empty
+ %\def\@@magyar@appendixname{\appendixname}% by appendixdot=
+ % Headings: inserting dots, changing orders
+ \def\@@magyar@overridden@psheadings{%
+ \if@twoside
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}%
+ \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \magyar@huordinal@chapterheaddot
+ \@chapapp.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ ##1}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ ##1}}}%
+ \else
+ \let\@oddfoot\@empty
+ \def\@oddhead{%
+ \@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \magyar@huordinal@chapterheaddot
+ \@chapapp.\magyar@opt@@hdrtitleskip% \ %
+ \fi
+ ##1}}}%
+ \fi
+ }%
+ \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{report}%
+ % Chapter: dot, changing typeout, toc
+ % Part...
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@chapter
+ \def\@chapter[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}%
+ \ifx\@chapapp\@@magyar@appendixname
+ % \@gobble gobbles the dot emitted by \numberline.
+ \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
+ \fi
+ \ifx\@chapapp\@@magyar@appendix@chapapp\else
+ \ifnum\magyar@opt@@chapternumber>0 \protected@edef\@currentlabel{\@huordinal\c@chapter}\fi
+ \fi
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}%
+ \babel@save\@part
+ \def\@part[#1]#2{% report; added at Fri Jul 23 11:45:57 CEST 2004
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi
+ \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}% %%%%% \l@chapter in report.cls
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \magyar@huordinal@partheaddot\partname% hu
+ \csname par\endcsname
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\csname par\endcsname}%
+ \@endpart}%
+ }
+ \if0\magyar@opt@@chapterhead\else
+ % Chapter: dot, changing order
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@makechapterhead
+ \def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries
+ \magyar@huordinal@chapterheaddot \@chapapp{}%
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\csname par\endcsname\nobreak
+ \vskip 40\p@
+ }}%
+ }%
+ \fi
+}{}
+
+\@@magyar@ifclassloaded{article}{%
+ % article.cls has no \chapter. We'll hook \part below though.
+ \let\magyar@hunumbers@errmsg\@empty
+ % Headings: inserting dots
+ % In order for this to take effect, \pagestyle{plain} should be put below
+ % \begin{document}.
+ \def\@@magyar@overridden@psheadings{%
+ \if@twoside
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ % Dat: by pts: \slshape -> \relax
+ \def\@evenhead{\@@magyar@headrule0\thepage\hfil\@@magyar@slshape\leftmark}%
+ \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \thesection.\magyar@opt@@hdrtitleskip
+ \fi
+ ##1}}{}}%
+ \def\subsectionmark##1{%
+ \markright {%
+ \ifnum \c@secnumdepth >\@ne
+ \thesubsection.\magyar@opt@@hdrtitleskip
+ \fi
+ ##1}}%
+ \else
+ \let\@oddfoot\@empty
+ \def\@oddhead{\@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \thesection.\magyar@opt@@hdrtitleskip
+ \fi
+ ##1}}}
+ \fi}%
+ \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{article}%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\@part
+ \def\@part[#1]#2{% article % added at Fri Jul 23 11:45:57 CEST 2004
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \ifnum\magyar@opt@@partnumber>0 \protected@edef\@currentlabel{\@huordinal\c@part}\fi
+ \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \magyar@huordinal@partheaddot\partname% hu
+ \csname par\endcsname\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\csname par\endcsname}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}}%
+}{}
+
+\@@magyar@ifclassloaded{letter}{%
+ % letter.cls has no \part or \chapter. No need to hook anything here, but
+ % we make \magyar@hunumbers@errmsg just to pacify
+ % `\PassOptionsToPackage{defaults=prettiest}{magyar.ldf}'.
+ \let\magyar@hunumbers@errmsg\@empty
+ % Headings: inserting dots
+ % In order for this to take effect, \pagestyle{plain} should be put below
+ % \begin{document}.
+ \def\@@magyar@overridden@psheadings{%
+ \if@twoside
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@oddhead{\@@magyar@headrule3\@@magyar@slshape\headtoname{:} \ignorespaces\toname
+ \hfil \@date
+ \hfil \thepage.~\pagename}%
+ \let\@evenhead\@oddhead
+ \else
+ \let\@oddfoot\@empty
+ \def\@oddhead{\@@magyar@headrule3\@@magyar@slshape\headtoname{:} \ignorespaces\toname
+ \hfil \@date
+ \hfil \thepage.~\pagename}%
+ \fi}%
+ \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{letter}%
+}{}
+\@gobble
+{^}%
+
+% --- mond=
+
+\if0\magyar@opt@@mond \@@magyar@skiplong\fi
+%** Dat: `--\enspace' would be too much
+%** Use this in the beginning of the paragraph.
+\def\@@magyar@mond{%
+ % Dat: \noindent after \subsection in article.cls
+ % Dat: \indent after \subsection in amsart.cls (\@noskipsecfalse)
+ % vvv Dat: strange: \ifvmode anf \if@noskipsec.
+ \ifvmode\if@noskipsec\leavevmode\fi\par\vskip-\parskip
+ \else\@noskipsecfalse\par\vskip-\parskip\fi
+ \leavevmode--\hbox{ }}
+\ifnum\magyar@opt@@mond \expandafter\ifx\csname mond\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \let\mond\@@magyar@mond
+\fi
+\@gobble
+{^}%
+
+% --- hang=
+
+\if0\magyar@opt@@hang \@@magyar@skiplong\fi
+%** Usage: \hang{-- } Foo\par
+\def\@@magyar@hang#1{%
+ \begingroup
+ \setbox0\hbox{#1}%
+ \advance\linewidth-\wd0 % not \hsize
+ \advance\@totalleftmargin\wd0
+ \edef\reserved@a{\parshape=1 \the\@totalleftmargin\space\space\the\linewidth\space}%
+ \par\noindent\kern-\wd0 \box0 % Dat: \box0 destroys \wd0
+ \expandafter\endgroup\expandafter\begingroup\reserved@a
+ \let\hang@@par\par
+ \def\par{\hang@@par\endgroup}% OK, works even inside \begin{quotation}
+ %\def\par{\endgroup\par}% doesn't work, restores \parshape too early
+ \ignorespaces
+}%
+\ifnum\magyar@opt@@hang \expandafter\ifx\csname hang\endcsname\relax1\fi>1 % 21, 2, 11, 1
+ \let\hang\@@magyar@hang
+\fi
+\@gobble
+{^}%
+
+% vvv hyphenmins=
+
+\ifx\magyar@opt@@hyphenmins\@empty\else
+ \edef\reserved@a{\noexpand\@namedef{\CurrentOption hyphenmins}{\magyar@opt@@hyphenmins}}
+ \reserved@a
+\fi
+
+% !!
+
+%\def\skipfoo #1foo {%
+% \ifx#1\hfuzz\else
+% (#1)%
+% \expandafter\skipfoo
+% \fi
+%}
+
+
+% vvv cjhebrewfix= % by pts@fazekas.hu at Tue Apr 19 18:26:54 CEST 2005
+% thanks to Zoltn Hamar for reporting the problem
+% Dat: the ultimate solution is active=onlycs, but it limits other
+% functionality
+% Dat: use \def\h{\cjRL} in the preamble to abbreviate \cjRL
+% wrong: \let\h\cjRL
+% wrong: \newcommand{\h}[1]{\cjRL{#1}}
+% Dat: cjhebrew uses the following strings for typesetting Hebrew letters:
+% ' b g d h w z .h .t y k K l m M n N s ` p P .s .S q r ,s +s t * a a:
+% /a e i o O u U E E: A A: | * : ; --
+% Dat: headings in `\pagestyle{headings} \section{(\cjRL{`l})}' doesn't work
+% as expected, because \MakeUppercase capitalizes the L, too.
+% Solution #1:
+% \DeclareRobustCommand\mycjcommand{\cjRL{`l}}
+% \section{(\mycjcommand)}
+% Solution #2: (won't convert any heading to uppercase)
+% % change the definition of \ps@headings, remove \MakeUppercase
+% \makeatletter \def\ps@headings{%
+% \let\@oddfoot\@empty \let\@mkboth\markboth
+% \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+% \def\sectionmark##1{\markright {\iffalse\MakeUppercase\fi{%
+% \ifnum \c@secnumdepth >\m@ne \thesection\quad \fi##1}}}}
+\if0\magyar@opt@@cjhebrewfix \@@magyar@skiplong\fi
+% Dat: \cjRL{`l} in cjhebrew.sty should typeset two letters, but typesets
+% only one if ` is \active. Use this code to fix it.
+% Imp: also fix in command arguments etc. Change catcode later.
+\if1\magyar@opt@@cjhebrewfix % =onlyouter
+% Dat: this doesn't work in the argument of \section etc., but it allows
+% LaTeX commands (\) in the arg of \cjRL
+\def\@@magyar@cjhebrewfix{%
+ \let\@@magyar@orig@cjRL\cjRL
+ \def\cjRL{\begingroup\catcode\string``=12 \@@magyar@cjRL@low}%
+ \def\@@magyar@cjRL@low##1{\@@magyar@orig@cjRL{##1}\endgroup}}
+\else % =yes
+% Dat: this works in the argument of \section etc., but it doesn't allow
+% LaTeX commands (\) in the arg of \cjRL
+\def\reserved@b{\protect}
+\edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}
+%\show\reserved@b
+\edef\reserved@a{%
+ \noexpand\def\noexpand\@@magyar@cjhebrew@skipa##1\reserved@b{%
+ \noexpand\ifx##1\noexpand\hfuzz\noexpand\@empty\noexpand\else
+ ##1%(##1)%
+ \noexpand\expandafter\noexpand\@@magyar@cjhebrew@skipa
+ \noexpand\fi}%
+ \noexpand\def\noexpand\@@magyar@cjhebrew@skipb##1\noexpand\hfuzz{% Dat: this removes all `\protect '
+ \noexpand\@@magyar@cjhebrew@skipa##1\reserved@b\noexpand\hfuzz\reserved@b}}
+\reserved@a
+\def\@@magyar@cjhebrewfix{%
+ \let\@@magyar@orig@cjRL\cjRL
+ %\let\@@magyar@orig@cjRL\bf
+ \DeclareRobustCommand\cjRL[1]{\begingroup
+ \toks@{##1}%
+ %\showthe\toks@
+ \edef\reserved@a{\the\toks@}%
+ \edef\reserved@a{\expandafter\strip@prefix\meaning\reserved@a}%
+ % Dat: we're almost complete here, but 1st we want to remove all
+ % instances of `\protect ' (catcodes 12 and 10), which were inserted
+ % into \firstmark, i.e. with \section{A\cjRL{`l}B}, \firstmark
+ % becomes: `{}{\protect \csname foreignlanguage \endcsname {magyar}{\protect \MakeUppercase {1\hskip 1em\relax A\protect \cjRL {\protect `l}B}}}'
+ \edef\reserved@a{\expandafter\@@magyar@cjhebrew@skipb\reserved@a\hfuzz}%
+ %\show\reserved@a
+ \expandafter\@@magyar@orig@cjRL\expandafter{\reserved@a}\endgroup}}
+\fi
+\AtBeginDocument{\ifx\cjRL\@undefined\else\@@magyar@cjhebrewfix\fi}
+\@gobble
+{^}%
+
+% vvv varioref=
+
+\if0\magyar@opt@@varioref \@@magyar@skiplong\fi
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \@@magyar@setup@varioref} % Dat: we are we late enough so we override varioref.sty
+% vvv Don't apply changes if varioref.sty wasn't loaded.
+\AtBeginDocument{\expandafter\ifx\csname vpagerefrange\endcsname\relax
+ \let\@@magyar@setup@varioref\@empty\fi}
+\def\@@magyar@setup@varioref{% Dat: must be a separate macro for suggestions= not to find our \reftextfaceafter etc.
+ \def\reftextfaceafter {\reftextvario{a t\'ul\-ol\-da\-lon}{a k\"o\-vet\-kez\H{o} ol\-da\-lon}}%
+ \def\reftextfacebefore{\reftextvario{a t\'ul\-ol\-da\-lon}{az el\H{o}\-z\H{o} ol\-da\-lon}}%
+ \def\reftextafter {a k\"o\-vet\-kez\H{o} ol\-da\-lon}%
+ \def\reftextbefore {az el\H{o}\-z\H{o} ol\-da\-lon}%
+ \def\reftextcurrent {ezen az ol\-da\-lon}%
+ \def\reftextfaraway##1{a~\csname @@magyar@az@lowxu\endcsname{\pageref{##1}}.~ol\-da\-lon}%
+ \def\reftextpagerange##1##2{a~\csname @@magyar@az@lowxu\endcsname{\pageref{##1}}%
+ --\pageref{##2}.~ol\-da\-la\-kon}%
+ \def\reftextlabelrange##1##2{{}\csname @@magyar@told\endcsname\ref{##1}+tol{}
+ \ref{##2}-ig}% Dat: `{}' is here for anti-\capitalize
+}
+\@gobble
+{^}%
+
+% vvv fancyhdr=
+%
+% Dat: magyar.ldf has to be loaded first, otherwise it cannot fix
+% `\usepackage{fancyhdr} \pagestyle{fancy}'
+
+\if0\magyar@opt@@fancyhdr \@@magyar@skiplong\fi
+\expandafter\ifx\csname ps@fancy\endcsname\relax
+ % Emit a warning if \pagestyle{fancy} is used after this.
+ % The original definition: \def\ps@fancy{\@fancyplainfalse\ps@@fancy}
+ \def\@@magyar@@ps@fancy{\@fancyplainfalse\ps@@fancy}%
+\else
+ \addto\ps@fancy{% works for article.cls, report.cls and book.cls
+ \@ifundefined{chapter}{%
+ % article:
+ % > \sectionmark=macro:
+ %#1->\markboth {\MakeUppercase {\ifnum \c@secnumdepth >\z@
+ %\thesection \hskip 1em\relax \fi #1}}{}.
+ \def\sectionmark#1{\markboth{\MakeUppercase{\ifnum \c@secnumdepth>\z@
+ \thesection.\magyar@opt@@hdrtitleskip \fi #1}}{}}%
+ % vvv Imp: do we need \if@twoside to set \subsectionmark here?
+ % #1->\markright {\ifnum \c@secnumdepth >\@ne \thesubsection
+ % \hskip 1em\relax \fi #1}.
+ \def\subsectionmark#1{\markright {\ifnum \c@secnumdepth >\@ne
+ \thesubsection.\magyar@opt@@hdrtitleskip \fi #1}}%
+ }{\def\chaptermark#1{
+ \markboth{\MakeUppercase{\ifnum \c@secnumdepth>\m@ne
+ % report.cls doesn't have \if@mainmatter, so we replace it with \iftrue
+ \@gobble\iftrue % balance for quick skipping
+ \@@magyar@ifmainmatter % must be macro if quick skipping
+ \magyar@huordinal@chapterheaddot
+ \@chapapp.\magyar@opt@@hdrtitleskip
+ \fi % for \if@mainmatter
+ \fi#1}}{}}%
+ \def\sectionmark#1{\markright{\MakeUppercase{\ifnum \c@secnumdepth>\z@
+ \thesection.\magyar@opt@@hdrtitleskip \fi#1}}}}}%
+ \def\@@magyar@@ps@fancy{\relax}% must be done after suggestions=
+\fi
+% This definition must be outside \iffalse.
+\def\@@magyar@ifmainmatter{%
+ \csname \ifx\if@mainmatter\@undefined iftrue\else if@mainmatter\fi
+ \endcsname}
+\@gobble
+{^}%
+
+% vvv ntheoremfix=
+
+%** Fix for the `! Undefined control sequence. \select' error message with
+%** ntheorem.sty
+%**
+%** The reason for the error is that magyar.ldf emits
+%** \select@language{magyar} into .thm files (as well as .toc, .lof, .lot
+%** etc. files), and LaTeX cannot read those files without \makeatletter
+%** because of the @ in the \select@language command.
+%**
+%** Our solution: add \makeatletter somewhere before \@input{\jobname.thm} to
+%** the macro which reads the .thm file (\thm@processlist) in ntheorem.sty .
+\if0\magyar@opt@@ntheoremfix \@@magyar@skiplong\fi
+ \def\magyar@@ntheoremfix{%
+ \expandafter\ifx\csname ver@ntheorem.sty\endcsname\relax\else
+ \ifx\thm@processlist\@undefined\else
+ % This doesn't work, because the body of \thm@processlist contains #
+ %\expandafter\def\expandafter\thm@processlist\expandafter{%
+ % \expandafter\begingroup\expandafter\makeatletter
+ % \thm@processlist\endgroup}%
+ \expandafter\@temptokena\expandafter{%
+ \expandafter\begingroup\expandafter\makeatletter
+ \thm@processlist\endgroup}%
+ \edef\thm@processlist{\the\@temptokena}%
+ \fi
+ \fi
+ }
+ \AtBeginDocument{\magyar@@ntheoremfix}
+ \@gobble
+{^}%
+
+% vvv extras=, must be last
+
+\ifnum\magyar@opt@@extras=0
+ % Dat: \extrasmagyar might break compatibility with future LaTeX packages.
+ % Use this option to turn all of them off, for debugging purposes.
+ \expandafter\let\csname extras\CurrentOption\endcsname\@empty
+ \expandafter\let\csname noextras\CurrentOption\endcsname\@empty
+\fi
+
+% --- Finish
+
+\ldf@finish\CurrentOption% \input \CurrentOption.cfg
+
+% !! doc: (\string!)
+% !! doc: \umlautlow is much more important in OT1 cmr fonts than in T1
+% !! %** @example rtelmezs\/bellts
+% \def\per{/\penalty\exhyphenpenalty\hskip\z@skip}
+% !! \itemize identation
+% !! layout.sty
+%\DeclareOption{magyar}{%
+% \def\Headertext{Fejl\'ec}
+% \def\Bodytext{A dokumentum teste\qquad}
+% \def\Footertext{L\'abl\'ec}
+% \def\MarginNotestext{Sz\'el-\\jegyzet}
+% \def\oneinchtext{1 inch}
+% \def\notshown{nem l\'atszik}
+% }
+% !! vvv this w/ and w/o nathb.sty: $H_{`symm}$, $H_``symm $
+%\let\@@magyar@saved@mathoptions@on\mathoptions@on
+%\def\mathoptions@on{% overrides nath.sty
+% \catcode``12 % deactivate
+% \begingroup\lccode`~``\lowercase{\endgroup\def~}{\abbreviation}%
+% % ^^^ \def`{\abbreviation}, but with active `
+% \@@magyar@saved@mathoptions@on
+%}
+% !! doc: hegyes`-szg
+% !! option to detect new magyar.ldf from a TeX file
+% !! book.cls \appendix \chapter, sub-numbers into TOC, need dot after `A. fggelk'? Gyurgyk recommends `1. fggelk'.
+% !! \MathReal, frenchb.ldf, \nombre
+% !! \told\ref{foo}+ban{}, if \foo expands to empty (no \section etc. in .tex file)
+% !! french.ldf number decimal comma etc.
+% !! \hunnewlabel should store `table', `figure', `section', `equation' etc.
+% !! letter.cls
+% !! should \newlabel emit a `.' ? (now doesn't) -- compatibility
+% `\aref{ekezetek}.\ tblzat' needs explicit `.'
+% !! alternative solutions for meny-nyi (possibly defining ligatures?)
+% !! baseline grid?
+% !! Bujdos`--Wettl: http://www.math.bme.hu/~wettl/plcv/pdf/BWfinal.pdf
+% !! some comments not related to magyar.ldf, but to *hyph.tex etc.
+% !! add their postpara symbols
+% !! section title sizes
+% !! baseline grid
+% !! rigid \parskip=0pt unless in prospestus or other short doc with \parindent=0pt
+% !! add their \leftmargini and variations
+% !! substitute bold-extended fonts with bold fonts
+% !! no page numbers on blank pages
+% !! \hsize <= 24cc (or 20cc) => parindent:=1quad else 2quad
+% !! length of last line of par... (break line)
+% !! reduce vertical whitespace around \section
+%
+% !! \MathReal{1.25 cm}
+% !! \H,\. in OT1 \texttt
+% !! maybe \index{|run husort.pl}
+% !! virtual fonts to support \umlauthigh and \umlautlow in T1 encoding
+% fnt_def1: scaled size is relative (2^20==1), design size is absolute (same as in local TFM)
+% disallowed DVI: bop,eop, >=243
+% down(2^19) moves down 10/2 pt if the design size is 10pt
+% dimensions must be <2^24 (160pt, ~5.62cm)
+% w=x=y=z=0
+% !! \begin{description} \bf -> \em ?, auto-dot
+% !! \def\mdqon{\shorthandon{"}} \def\mdqoff{\shorthandoff{"}} (possibly deactivate `?' etc.)
+% !! fix \initiate@active@char for other languages
+% !! \addto\shorthandsspanish...
+% !! spanish.ldf \es@activate, \if@safe@actives\then
+% !! esperanto.ldf why? \declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% !! add other low accents for umlaut=low: \. (i) and \'
+% !! full amsart.cls compatibility??
+% !! huhyph.tex wrong \showhyphens{azthehe}% az-t-hehe
+% !! huhyph.tex wrong zs-hehe
+% !! huhyph.tex why sza-badstrand, but szbadsg-rand
+% !! \index{foo|hyperpagearg{\textbf}}
+% !! combine \magyar@opt@@titleskip, amstocnumskip and \magyar@post@...
+% !! \begin{textqq} ? combined command and env
+% !! tmagyar.tex \tableofcontents wide \section
+% !! \restoreparindent in \item in \itemize
+% \edef\restoreparindent{\parindent\the\parindent\relax} in \@listi
+% !! 1848 mrcius+nak kzepe
+% !! should \told insert \, ?? (no, only \told*??)
+% !! \told45{-ed-hez} ??
+% !! \told{45}-ed-hez ??
+% !! \told45\od\hoz \told45+\od\hoz
+% !! \told45+adik+val +ad+val etc.
+% !! \azhuphy
+% !! \huphy{-3331234.5678pF^{-1}} -> $-$3\,331\,234,5678\,pF^{-1}
+% !! \huphy if non-Hungarian is the lang {,}->{.}
+% !! \huphy ifmmode?
+% !! french.ldf \CyrillicGuillemets
+% !! french.ldf \LasyGuillemets
+% !! huplain.bst editor = "Wizar{\BN dj} V. Oz and Mihalis Yannakakis",
+% !! huplain.bst w/o magyar.ldf
+% !! hyperref.sty bugfix when turning hyperref.sty on, \ref is spoiled:
+% w/ or w/o magyar.ldf
+% ! Argument of \@fifthoffive has an extra }.
+% <inserted text>
+% \par
+% l.48 Ld. \ref{tab}
+% !! > Kiprbltam, s tnyleg pontosan ugyanaz a fjl magyar.ldf (texmf fban) s
+% > magyar-0510.ldf (aktulis knyvtrban) nven ms eredmnyt ad.
+% (cjhebrew)
+% !! a4wide.sty doesn't compile
+% \documentclass[12pt,a4paper]{article}
+% \usepackage{t1enc}
+% \usepackage{times}% Imp: math mode
+% \usepackage[magyar]{babel}
+% \usepackage{graphicx}
+% \usepackage[latin2]{inputenc}
+% %\usepackage{a4wide}% SUXX: doesn't work with magyar.ldf
+% \pagestyle{empty}
+% \begin{document}
+% !! % Imp: magyar.ldf: \textdt{tudja`=e}, \textdt{tudja`-e};
+% !! space in front of `;' is too large with \usepackage{times}
+% \declare@shorthand{\CurrentOption}{;}{\magyar@thinspaced;}
+% !! doc: `- not suitable in .bib files etc.
+% !! \cite{foo,bar} -> `[2, 1]' increasing order preferred
+% Imp: indent using the maximum footnotemark *** count on the current page
+% Imp: generate ,,harminchrombl'' by \told{\@huordinal{33}}+bol etc.
+%
+% Dat: \mathcode`\,="013B % s gy a tizedes trtekben matematikai mdban sem lesz kz
+% Dat: \mathchardef\comma="613B % a vesz (,) ami matematikai mdban elvlaszt karakterknt hasznlhat
+% Dat: additive \PassOptionsToPackage{foo=bar}{magyar.ldf}
+% Dat: for book.cls and article.cls: the user has to run \pagestyle{headings} after \selectlanguage{magyar} -- for performance reasons
+% Dat: doc: \let\@@magyar@setup@psheadings\relax maybe needed in the preamble
+% Dat: \pagestyle{headings} is forced \AtBeginDocument -- user should change it later
+% Dat: babel.def assumes we have: \textquotedblright \textquoteright \ll \gg
+% < >
+% Dat: babel.def defines for OT1 and others: \quotedblbase \quotesinglbase
+% \guillemotleft \guillemotright \guilsinglleft \guilsinglright \ij \IJ
+% \dj \DJ \SS
+% Dat: babel.def defines the following robust commands in math and text modes:
+% \glq \grq \glqq \grqq \flq \frq \flqq \frqq
+% Dat: OT1 encoding respects accents=low (\umlauthigh and \umlautlow), but T1
+% doesn't -- but we need T1 for hyphenation of accented words
+% Dat: \usepackage{t1enc} is faster than \usepackage[T1]{fontenc}
+% Dat: \languageattribute should be specified in the document preamble, and
+% not changed again
+% Dat: it is possible to have 1 letter, e.g \declare@shorthand{turkish}{=}{...}
+% Dat: Babel \@activated emits a \PackageInfo entry
+% Dat: (` `) is equivalent to (``), because TeX ignores spaces before macro
+% arguments
+% Dat: example of the so-called ``dual load'':
+% \PassOptionsToPackage{frenchspacing=yes}{magyar.ldf}
+% \PassOptionsToPackage{frenchspacing=no}{hungarian.ldf}
+% \usepackage[hungarian,magyar]{babel}
+% Dat: argument of \az and \told may not contain \if..., \else and \fi
+% OK: works with article.cls: (mathbrk=fix)
+% \noindent s ebbl a tovbbi hrom rsz terlete
+% $\displaystyle{1\over3}-{1\over 4}={1\over 12}$,
+% $\displaystyle{1\over 2}-{1\over 4}={1\over 4}$ s
+% $\displaystyle{1\over 4}+\bigg({1\over 2}-{1\over 3}\bigg)={1\over 4}+{1\over 6}}=\displaystyle{5\over 12}$
+% terletegysg.
+% OK: doc in magyarldf-doc.tex: enumeration in math, see $a,\ b$ in nath.sty
+% OK: mathbrk=fix +\\+ (all binary ops and relations) in math, \nobreak\cdot, \nobreak\slash
+% OK: footnote text indented, asterisks on pages
+% OK: Kiss Eld\nobreak\,\nobreak--\,Nagy Pl ...
+% OK: \partname in book.cls (seems to work now)
+% OK: Els rsz
+% OK: smartly disable active chars in preamble
+% OK: \@inpenc@undefined defined and != latin2 => recommend \usepackage[latin2]{inputenc}
+% OK: \encodingdefault != T1 => recommend \usepackage{t1enc}
+% OK: Warning if \l@hungarian vs \l@magyar undefined
+% OK: amsart.cls \listoftables overfull \hbox (\magyar@amslevelfix)
+% OK: dzs-dzs
+% OK: \expandafter\addto\csname extras\CurrentOption\endcsname{\bbl@frenchspacing}
+% OK: provide \magyarhyphenmins
+% OK: compatibility with latex.ltx, theorem.sty, ntheorem.sty, amsthm.sty
+% OK: \PackageWarning if \magyarOptions defined too late
+% OK: like frenchb.ldf \declare@shorthand{french}{;}{
+% OK: \told\ref{hellopart}+es{} rszt olvasd el.
+% OK: \told appends suffixes to numbers
+% OK: activeacute, activegrave babel options
+% OK: even more parts made conditional
+% OK: \@hunumeral \@huordinal \@Hunumeral \@Huordinal
+% OK: negative numbers \told-5-nek, `mnusz kettedik' etc.
+% OK: magyar.ldf defaults=hu-min (mathbrk=define) $x+116=\break x-97$ adds space only to BOL; added \nobreak before \discretionary -- and the problem was solved
+% OK: fixed. varioref.sty (2001/09/04 v1.3c) mustn't be loaded with option
+% [magyar], because that option contains a stupid \AtBeginDocument hook
+% added to \extrasmagyar
+% OK: Bujdos`--Wettl: add their {itemize} symbols and {enumerate} styles
+% OK: spacing around excl. marks in math mode ! closing(5) -> punct(6)
+% better solution (found in nath.sty): \def!{\mathchar20513\relax\mathopen{}\mathinner{}},
+% because it doesn't need braces
+% No: \@makecaption in frenchb.ldf -> magyar.ldf
+
+\@@magyar@restcats
+\endinput% of magyar.ldf
diff --git a/macros/latex/contrib/babel-contrib/icelandic/README.md b/macros/latex/contrib/babel-contrib/icelandic/README.md
new file mode 100644
index 0000000000..32924c27e5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/icelandic/README.md
@@ -0,0 +1,27 @@
+Icelandic 1.3
+--------------
+
+This is the babel style for Icelandic.
+
+**This package is NOT being actively maintained, but bugs might
+got fixed if you report them. If you want to take over maintenance of
+this language style, please contact me at
+http://www.texnia.com/contact.html .**
+
+Changes 1.3
+------------
+
+* Updated to TU (and therefore removed the warning with EUx).
+
+Changes 1.2b
+------------
+
+* Warning with xe/lua without EUx (and documented)
+
+
+Changes 1.2a
+------------
+
+* It now works with LuaTeX
+* UTF-8 encoded strings for XeTeX and LuaTeX
+* Old icelandic with inputenc utf8
diff --git a/macros/latex/contrib/babel-contrib/icelandic/icelandic.dtx b/macros/latex/contrib/babel-contrib/icelandic/icelandic.dtx
new file mode 100644
index 0000000000..a79eddbd95
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/icelandic/icelandic.dtx
@@ -0,0 +1,860 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2019 Einar \'Arnason, Johannes L. Braams, Javier
+% Bezos and any individual authors listed elsewhere in this file. All
+% rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{646}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{icelandic.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{icelandic}
+%\fi
+%\ProvidesFile{icelandic.dtx}
+ [2019/07/04 v1.3 Icelandic support from the babel system]
+%\iffalse
+%% File iceland.dtx
+%
+%% Icelandic Language Definition File
+%% Copyright (C) 1996--2019
+%% by Einar \'Arnason <einar@lif.hi.is>
+%% Johannes Braams, TeXniek
+%% Javier Bezos (>=1.2a)
+%
+%%
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\OnlyDescription
+% \expandafter\def\csname u8:ǫ\endcsname{\k{o}}
+% \expandafter\def\csname u8:Ǫ\endcsname{\k{O}}
+\usepackage[utf8]{inputenc}
+\usepackage[icelandic.utf8old,english]{babel}
+\font\manual=logo10 % font used for the METAFONT logo, etc.
+\newcommand*\MF{{\manual META}\-{\manual FONT}}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+\begin{center}
+ \textbf{\Large A Babel language definition file for
+ Icelandic}\\[3mm]^^A\]
+ Einar \'Arnason\\
+ \texttt{einar@lif.hi.is}
+\end{center}
+ \DocInput{icelandic.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{iceland.dtx}
+%
+%
+% \changes{icelandic-1.1c}{1997/05/21}{Removed code already present in
+% \file{babel.def}}
+%
+% \section{The Icelandic language}
+%
+% \subsection{Overview}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number 1.3 and was last revised on 2019-07-04
+% by Javier Bezos to fix some issues.} defines all the language
+% definition macros for the Icelandic language
+%
+% Customization for the Icelandic language was made following
+% several official and semiofficial publications~\cite{74:_augl,
+% 77:_augl,88:_reglur,94:_si,97:_forst_fs}. These publications do
+% not always agree and we indicate those instances.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:icelandic-extras} an overview is given of its
+% purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{otherlanguage*}{icelandic}
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |"`| & for Icelandic left double quotes (looks like ,,). \\
+% |"'| & for Icelandic right double quotes. \\
+% |">| & for Icelandic `french' left double quotes
+% (similar to $>>$).\\
+% |"<| & for Icelandic `french' right double quotes
+% (similar to $<<$).\\
+% |"o| & for old Icelandic "o \\
+% |"O| & for old Icelandic "O \\
+% |"ó| & for old Icelandic "ó \\
+% |"Ó| & for old Icelandic "Ó \\
+% |"e| & for old Icelandic "e \\
+% |"E| & for old Icelandic "E \\
+% |"é| & for old Icelandic "é \\
+% |"É| & for old Icelandic "É \\
+% |\tala| & for typesetting numbers\\
+% |\grada| & for the `degree' symbol\\
+% |\gradur| & for `degrees', e.g. 5~\gradur C\\
+% |\upp| & for textsuperscript \\
+% \end{tabular}
+% \end{otherlanguage*}
+% \caption{The shorthands and extra definitions made
+% by \file{icelandic.ldf}}\label{tab:icelandic-extras}
+% \end{center}
+% \end{table}
+% The shorthands in table~\ref{tab:icelandic-extras} can also be
+% typeset by using the commands in
+% table~\ref{tab:icelandic-commands}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{otherlanguage*}{icelandic}
+% \begin{tabular}{lp{8cm}}
+% |\ilqq| & for Icelandic left double quotes
+% (looks like ,,). \\
+% |\irqq| & for Icelandic right double quotes
+% (looks like ``). \\
+% |\ilq| & for Icelandic left single quotes
+% (looks like ,). \\
+% |\irq| & for Icelandic right single quotes
+% (looks like `). \\
+% |\iflqq| & for Icelandic `french' left double quotes
+% (similar to $>>$).\\
+% |\ifrqq| & for Icelandic `french' right double quotes
+% (similar to $<<$).\\
+% |\ifrq| & for Icelandic `french' right single quotes
+% (similar to $<$).\\
+% |\iflq| & for Icelandic `french' left single quotes
+% (similar to $>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% |\oob| & for old Icelandic "o \\
+% |\Oob| & for old Icelandic "O \\
+% |\ooob| & for old Icelandic "ó \\
+% |\OOob| & for old Icelandic "Ó \\
+% |\eob| & for old Icelandic "e \\
+% |\Eob| & for old Icelandic "E \\
+% |\eeob| & for old Icelandic "é \\
+% |\EEob| & for old Icelandic "É \\
+% \end{tabular}
+% \end{otherlanguage*}
+% \caption{Commands which produce quotes and old Icelandic
+% diacritics, defined by
+% \file{icelandic.ldf}}\label{tab:icelandic-commands}
+% \end{center}
+% \end{table}
+%
+% Version 1.2 does not raise an error with \textsf{luatex}, and in
+% addition Unicode strings are defined. Shorthands for ó, Ó, é and
+% É with ogonek now works with \verb|utf8| and \textsf{inputenc} in
+% 8-bit engines, but for compatibility and due to some limitations
+% they must be activated explicitly with the modifier
+% \verb|utf8old|, ie:
+% \begin{verbatim}
+% \usepackage[icelandic.utf8old]{babel}
+% \end{verbatim}
+% This modifier is not necessary with \textsf{xe/luatex}. Note with
+% the latter you need a font containing those glyphs (or at least
+% with the possibility to compose them), as well as defining the
+% \verb|EU1| or \verb|EU2| encoding (with \textsf{fontspec} and/or
+% \textsf{fontenc}).\footnote{If you definitely don't want to load
+% it, there is still an alternative -- the \texttt{strings=generic}
+% option described in the \textsf{babel} manual, which relies
+% entirely on the LICR, but this is discouraged.} For example:
+% \begin{verbatim}
+% \documentclass{article}
+% \usepackage[icelandic]{babel}
+% \usepackage{fontspec}
+% \setmainfont{Arial}
+% \begin{document}
+% Íslenska er indóevrópskt, germanskt og vesturnorrænt tungumál sem
+% er einkum talað og ritað á Íslandi og er móðurmál langflestra
+% Íslendinga. (From Wikipedia.)
+% \end{document}
+% \end{verbatim}
+%
+% The original definitions for the ogonek are preserved, even if
+% the results are not always satisfactory. To be fixed.
+%
+% See also below for some extra features.
+%
+% \begin{thebibliography}{1}
+%
+% \bibitem{88:_reglur}
+% Alþingi.
+% \newblock {\em Reglur um frágang þingskjala og prentun umræðna},
+% 1988.
+%
+% \bibitem{74:_augl}
+% Auglýsing um greinarmerkjasetningu.
+% \newblock Stj.tíð B, nr. 133/1974, 1974.
+%
+% \bibitem{77:_augl}
+% Auglýsing um breyting auglýsingu nr. 132/1974 um íslenska
+% stafsetningu.
+% \newblock Stj.tíð B, nr. 261/1977, 1977.
+%
+% \bibitem{unknown72:_first_gramm_treat}
+% Einar Haugen, editor.
+% \newblock {\em First Grammatical Treatise}.
+% \newblock Longman, London, 2 edition, 1972.
+%
+% \bibitem{97:_forst_fs}
+% Staðlaráð Íslands og Fagráð í upplýsingatækni, Reykjavík.
+% \newblock {\em Forstaðall FS 130:1997}, 1997.
+%
+% \bibitem{94:_si}
+% STRÍ Staðlaráð Íslands.
+% \newblock {\em SI - kerfið}, 2 edition, 1994.
+%
+% \end{thebibliography}
+%
+% \StopEventually{}
+%
+%
+% \subsection{\TeX{}nical details}
+%
+% When this file was read through the option \Lopt{icelandic} we make
+% it behave as if \Lopt{icelandic} was specified.
+%
+% \begin{macrocode}
+\def\bbl@tempa{icelandic}
+\ifx\CurrentOption\bbl@tempa
+ \def\CurrentOption{icelandic}
+\fi
+% \end{macrocode}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{icelandic} will be an `unknown' language, so we
+% have to make it known. So we check for the existence of
+% |\l@icelandic| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@icelandic\@undefined
+ \@nopatterns{Icelandic}
+ \adddialect\l@icelandic0
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\if@Two@E}
+% We will need a new `if' : |\if@Two@E| is true if and only if
+% \LaTeXe{} is running \emph{not} in compatibility mode. It is
+% used in the definitions of the command |\tala| and |\upp|.
+% The definition is somewhat complicated, due to the fact that
+% |\if@compatibility| is not recognized as a |\if| in
+% \LaTeX-2.09 based formats.
+% \begin{macrocode}
+\newif\if@Two@E \@Two@Etrue
+\def\@FI@{\fi}
+\ifx\@compatibilitytrue\@undefined
+ \@Two@Efalse \def\@FI@{\relax}
+\else
+ \if@compatibility \@Two@Efalse \fi
+\@FI@
+% \end{macrocode}
+% \end{macro}
+%
+% The icelandic hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{icelandic-1.1f}{2000/09/22}{Now use \cs{providehyphenmins}
+% to provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+%
+% \subsection{Captionnames and date}
+%
+% The next step consists of defining the Icelandic equivalents for
+% the \LaTeX{} captionnames.
+%
+% \begin{macro}{\captionsicelandic}
+% The macro |\captionsicelandic| will define all strings used
+% used in the four standard document classes provided
+% with \LaTeX.
+% \changes{icelandic-1.1f}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{icelandic-1.1g}{2002/01/00}{Only use 7-bit ASCII characters
+% in order to keep the texts input encoding independant}
+% \changes{icelandic-1.1g}{2002/01/09}{Added translation for Glossary}
+%
+% \begin{macro}{\dateicelandic}
+% The macro |\dateicelandic| redefines the command |\today|
+% to produce Icelandic dates.
+% \changes{icelandic-1.1c}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{icelandic-1.1c}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{icelandic-1.2a}{2015/12/28}{Define strings using
+% \cs{StartBabelCommands}}
+% \changes{icelandic-1.2b}{2016/01/14}{Warning if used with xe/lua
+% without EUx encondings}
+%
+% \begin{macrocode}
+\StartBabelCommands*{icelandic}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \SetString{\prefacename}{Formáli}
+ \SetString{\abstractname}{Útdráttur}
+ \SetString{\appendixname}{Viðauki}
+ \SetString{\listfigurename}{Myndaskrá}
+ \SetString{\listtablename}{Töfluskrá}
+ \SetString{\indexname}{Atriðisorðaskrá}
+ \SetString{\enclname}{Hjálagt}
+ \SetString{\pagename}{Blaðsíða}
+ \SetString{\seename}{Sjá}
+ \SetString{\alsoname}{Sjá einnig}
+ \SetString{\proofname}{Sönnun}
+ \SetString{\glossaryname}{Orðalisti}
+\StartBabelCommands*{icelandic}{date}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \SetStringLoop{month#1name}{%
+ janúar,febrúar,mars,apríl,maí,júní,%
+ júlí,ágúst,september,október,nóvember,desember}
+% \end{macrocode}
+%
+% And now, the generic branch, using the LICR and assuming T1.
+%
+% \begin{macrocode}
+\StartBabelCommands*{icelandic}{captions}
+ \SetString{\prefacename}{Form\'{a}li}
+ \SetString{\refname}{Heimildir}
+ \SetString{\abstractname}{\'{U}tdr\'{a}ttur}
+ \SetString{\bibname}{Heimildir}
+ \SetString{\chaptername}{Kafli}
+ \SetString{\appendixname}{Vi{\dh}auki}
+ \SetString{\contentsname}{Efnisyfirlit}
+ \SetString{\listfigurename}{Myndaskr\'{a}}
+ \SetString{\listtablename}{T\"{o}fluskr\'{a}}
+ \SetString{\indexname}{Atri{\dh}isor{\dh}askr\'{a}}
+ \SetString{\figurename}{Mynd}
+ \SetString{\tablename}{Tafla}
+ \SetString{\partname}{Hluti}
+ \SetString{\enclname}{Hj\'{a}lagt}
+ \SetString{\ccname}{Samrit}
+ \SetString{\headtoname}{Til:} % in letter
+ \SetString{\pagename}{Bla{\dh}s\'{\i}{\dh}a}
+ \SetString{\seename}{Sj\'{a}}
+ \SetString{\alsoname}{Sj\'{a} einnig}
+ \SetString{\proofname}{S\"{o}nnun}
+ \SetString{\glossaryname}{Or{\dh}alisti}
+\StartBabelCommands*{icelandic}{date}
+ \SetStringLoop{month#1name}{%
+ jan\'{u}ar,febr\'{u}ar,mars,apr\'{\i}l,ma\'{\i},j\'{u}n\'{\i},%
+ j\'{u}l\'{\i},\'{a}g\'{u}st,september,okt\'{o}ber,n\'{o}vember,desember}
+ \SetString\today{%
+ {\number\day}.~\@nameuse{month\romannumeral\month name}
+ {\number\year}}
+\EndBabelCommands
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Icelandic quotation marks}
+%
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the icelandic and icelandic `french' quotes.
+% The icelandic `french' guillemets are the reverse of french
+% guillemets. We define single icelandic `french' quotes for
+% compatibility. Shorthands are provided for a number of different
+% quotation marks, which make them useable both outside and
+% inside mathmode.
+%
+% \begin{macrocode}
+\let\ilq\grq
+\let\irq\grq
+\let\iflq\frq
+\let\ifrq\flq
+\let\ilqq\glqq
+\let\irqq\grqq
+\let\iflqq\frqq
+\let\ifrqq\flqq
+% \end{macrocode}
+%
+% \section{Shorthands}
+%
+% The code below is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:icelandic-commands}.
+%
+% To be able to define the function of |"|, we also define a
+% couple of `support' macros.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\declare@shorthand{icelandic}{"`}{\glqq}
+\declare@shorthand{icelandic}{"'}{\grqq}
+\declare@shorthand{icelandic}{">}{\frqq}
+\declare@shorthand{icelandic}{"<}{\flqq}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{icelandic}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{icelandic}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{icelandic}{""}{\hskip\z@skip}
+\declare@shorthand{icelandic}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{icelandic}{"=}{\nobreak-\hskip\z@skip}
+% \end{macrocode}
+%
+%
+% \subsection{Old Icelandic}
+% \label{oldicelandic}
+%
+% \changes{icelandic-1.1}{1997/04/24}{Added definitions for old
+% icelandic.}
+% \changes{icelandic-1.2a}{2105/03/28}{Reorganized for luatex,
+% Unicode and utf8.}
+%
+% In old Icelandic some letters have special diacritical marks,
+% described for example in \emph{First Grammatical
+% Treatise}~\cite{unknown72:_first_gramm_treat,97:_forst_fs}. We
+% provide these in the \texttt{T1} encoding with the `ogonek', as
+% well in \verb|EU|$x$ encondings. The ogonek is placed with the
+% letters `o', and `O', `ó' and `Ó', `e' and `E', and `é' and
+% `É'. Shorthands are provided for these as well.
+%
+% The following code by Leszek Holenderski lifted from
+% \texttt{polish.dtx} is designed to position the diacritics
+% correctly for every font in every size in Computer Modern. In
+% other fonts they might be slightly misplaced. These macros need a
+% few extra dimension variables.
+%
+% \begin{macrocode}
+\newdimen\pl@left
+\newdimen\pl@down
+\newdimen\pl@right
+\newdimen\pl@temp
+% \end{macrocode}
+%
+% \begin{macro}{\sob}
+% The macro |\sob| is used to put the `ogonek' in the right
+% place.
+%
+% \begin{macrocode}
+\def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
+ \setbox0\hbox{#1}\setbox1\hbox{\k{}}\setbox2\hbox{p}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oob}
+% \begin{macro}{\Oob}
+% \begin{macro}{\ooob}
+% \begin{macro}{\OOob}
+% \begin{macro}{\eob}
+% \begin{macro}{\Eob}
+% \begin{macro}{\eeob}
+% \begin{macro}{\EEob}
+%
+% Now, just define the composite characters.
+%
+% \begin{macrocode}
+\DeclareTextCommandDefault{\oob}{\sob{o}{.85}{0}{.04}{0}}
+\DeclareTextCommandDefault{\Oob}{\sob{O}{.7}{0}{0}{0}}
+\DeclareTextCommandDefault{\ooob}{\sob{\'{o}}{.85}{0}{.04}{0}}
+\DeclareTextCommandDefault{\OOob}{\sob{\'{O}}{.7}{0}{0}{0}}
+\DeclareTextCommandDefault{\eob}{\sob{e}{1}{0}{.04}{0}}
+\DeclareTextCommandDefault{\Eob}{\sob{E}{1}{0}{.04}{0}}
+\DeclareTextCommandDefault{\eeob}{\sob{\'{e}}{1}{0}{.04}{0}}
+\DeclareTextCommandDefault{\EEob}{\sob{\'{E}}{1}{0}{.04}{0}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% And their shorthands.
+%
+% \begin{macrocode}
+\declare@shorthand{icelandic}{"o}{\oob}
+\declare@shorthand{icelandic}{"O}{\Oob}
+\declare@shorthand{icelandic}{"e}{\eob}
+\declare@shorthand{icelandic}{"E}{\Eob}
+\StartBabelCommands*{icelandic}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \AfterBabelCommands{%
+ \newcommand\icelandic@og{%
+ \@ifundefined{T@\ifcase\bbl@engine\or EU2\or EU1\fi}%
+ {\edef\icelandic@tempa##1{\noexpand\DeclareTextCommand{##1}{TU}}}%
+ {\edef\icelandic@tempa##1{%
+ \noexpand\DeclareTextCommand
+ {##1}{\ifcase\bbl@engine\or EU2\or EU1\fi}}}%
+ \icelandic@tempa{\oob}{ǫ}%
+ \icelandic@tempa{\Oob}{Ǫ}%
+ \icelandic@tempa{\ooob}{\'{ǫ}}%
+ \icelandic@tempa{\OOob}{\'{Ǫ}}%
+ \icelandic@tempa{\eob}{ę}%
+ \icelandic@tempa{\Eob}{Ę}%
+ \icelandic@tempa{\eeob}{\'{ę}}%
+ \icelandic@tempa{\EEob}{\'{Ę}}%
+ \declare@shorthand{icelandic}{"ó}{\ooob}%
+ \declare@shorthand{icelandic}{"Ó}{\OOob}%
+ \declare@shorthand{icelandic}{"é}{\eeob}%
+ \declare@shorthand{icelandic}{"É}{\EEob}}}
+\StartBabelCommands*{icelandic}{captions}
+ \AfterBabelCommands{%
+ \providecommand\icelandic@og{%
+ \declare@shorthand{icelandic}{"^^db}{\OOob}%
+ \declare@shorthand{icelandic}{"^^e9}{\eeob}%
+ \declare@shorthand{icelandic}{"^^c9}{\EEob}%
+ \declare@shorthand{icelandic}{"^^fb}{\ooob}%
+ \@expandtwoargs\in@{,utf8old,}{,\BabelModifiers,}%
+ \ifin@
+ \declare@shorthand{icelandic}{"^^c3}{\icelandic@preq}%
+ \@namedef{icelandic@preq@^^b3}{\ooob}%
+ \@namedef{icelandic@preq@^^93}{\OOob}%
+ \@namedef{icelandic@preq@^^a9}{\eeob}%
+ \@namedef{icelandic@preq@^^89}{\EEob}%
+ \def\icelandic@preq##1{%
+ \@ifundefined{icelandic@preq@\string##1}%
+ {"{}\UTFviii@two@octets ^^c3##1}%
+ {\@nameuse{icelandic@preq@\string##1}}}%
+ \fi}%
+ \icelandic@og
+ \let\icelandic@og\relax}
+\EndBabelCommands
+
+% \end{macrocode}
+%
+% \begin{macro}{\extrasicelandic}
+% \begin{macro}{\noextrasicelandic}
+%
+% The macro |\extrasicelandic|
+% will perform all the extra definitions needed for the Icelandic
+% language. The macro |\noextrasicelandic| is used to cancel the
+% actions of |\extrasicelandic|.
+%
+% For Icelandic the \texttt{"} character is
+% made active. This is done once, later on its definition may vary.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{%
+ \languageshorthands{icelandic}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{icelandic-1.1e}{1999/12/17}{Deactivate shorthands ouside of
+% Icelandic}
+% \begin{macrocode}
+\addto\noextrasicelandic{\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Formatting numbers}
+% \label{numbers}
+%
+% \changes{icelandic-1.1a}{1997/04/26}{Added definitions for
+% formatting numbers in Icelandic and some extra utilities.}
+% This section is lifted from \texttt{frenchb.dtx} by D. Flipo.
+% In English the decimal part starts with a point and thousands
+% should be separated by a comma: an approximation of $1000\pi$
+% should be inputed as |$3{,}141.592{,}653$| in math-mode and
+% as |3,141.592,653| in text.
+% \changes{icelandic-1.1b}{1997/05/05}{Added references to various
+% publications used}
+%
+% In Icelandic the decimal part starts with a comma and thousands
+% should be separated by a space~\cite{88:_reglur} or by a
+% period~\cite{97:_forst_fs}; we have the space. The above
+% approximation of $1000\pi$ should be inputed as
+% |$3\;141{,}592\;653$| in math-mode and as something like
+% |3~141,592~653| in text. Braces are mandatory around the comma in
+% math-mode, the reason is mentioned in the \TeX{}book p.~134:
+% the comma is of type |\mathpunct| (thus normally followed by a
+% space) while the point is of type |\mathord| (no space added).
+%
+% Thierry Bouche suggested that a second type of comma, of type
+% |\mathord| would be useful in math-mode, and proposed to
+% introduce a command (named |\decimalsep| in this package),
+% the expansion of which would depend on the current language.
+%
+% Vincent Jalby suggested a command |\nombre| to conveniently
+% typeset numbers: inputting |\nombre{3141,592653}| either in
+% text or in math-mode will format this number properly according
+% to the current language (Icelandic or non-Icelandic). We use
+% |\nombre| to define command |\tala| in Icelandic.
+%
+% |\tala| accepts an optional argument which happens to be
+% useful with the extension `dcolumn', it specifies the decimal
+% separator used in the \emph{source code}:
+% |\newcolumntype{d}{D{,}{\decimalsep}{-1}}| \\
+% |\begin{tabular}{|d|}\hline | \\
+% | 3,14 \\ | \\
+% | \tala[,]{123,4567} \\ | \\
+% | \tala[,]{9876,543}\\\hline| \\
+% |\end{tabular} | \\
+% will print a column of numbers aligned on the decimal point
+% (comma or point depending on the current language), each slice
+% of 3 digits being separated by a space or a comma according to
+% the current language.
+%
+% \begin{macro}{\decimalsep}
+% \begin{macro}{\thousandsep}
+% We need a internal definition, valid in both text and math-mode,
+% for the comma (|\@comma@|) and another one for the unbreakable
+% fixed length space (no glue) used in Icelandic (|\f@thousandsep|).
+%
+% The commands |\decimalsep| and |\thousandsep| get default
+% definitions (for the English language) when |icelandic| is loaded;
+% these definitions will be updated when the current language is
+% switched to or from Icelandic.
+% \begin{macrocode}
+\mathchardef\m@comma="013B \def\@comma@{\ifmmode\m@comma\else,\fi}
+\def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
+\newcommand{\decimalsep}{.} \newcommand{\thousandsep}{\@comma@}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\decimalsep{\@comma@}%
+ \def\thousandsep{\f@thousandsep}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \def\decimalsep{.}%
+ \def\thousandsep{\@comma@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tala}
+% The decimal separator used when \emph{inputing} a number
+% with |\tala| \emph{has to be a comma}.
+% |\tala| splits the inputed number into two parts: what
+% comes before the first comma will be formatted by
+% \cs{@integerpart} while the rest (if not empty) will be
+% formatted by \cs{@decimalpart}. Both parts, once formatted
+% separately will be merged together with between them, either
+% the decimal separator \cs{decimalsep} or (in \LaTeXe{}
+% \emph{only}) the optional argument of |\tala|.
+%
+% \begin{macrocode}
+\if@Two@E
+ \newcommand{\tala}[2][\decimalsep]{%
+ \def\@decimalsep{#1}\@tala#2\@empty,\@empty,\@nil}
+\else
+ \newcommand{\tala}[1]{%
+ \def\@decimalsep{\decimalsep}\@tala#1\@empty,\@empty,\@nil}
+\fi
+\def\@tala#1,#2,#3\@nil{%
+ \ifx\@empty#2%
+ \@integerpart{#1}%
+ \else
+ \@integerpart{#1}\@decimalsep\@decimalpart{#2}%
+ \fi}
+% \end{macrocode}
+% The easiest bit is the decimal part:
+% We attempt to read the first four digits of the decimal part, if
+% it has less than 4 digits, we just have to print them, otherwise
+% |\thousandsep| has to be appended after the third digit, and the
+% algorithm is applied recursively to the rest of the decimal part.
+% \begin{macrocode}
+\def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
+\def\@@decimalpart#1#2#3#4{#1#2#3%
+ \ifx\@empty#4%
+ \else
+ \thousandsep\expandafter\@@decimalpart\expandafter#4%
+ \fi}
+% \end{macrocode}
+% Formatting the integer part is more difficult because the slices
+% of 3 digits start from the \emph{bottom} while the number is
+% read from the top!
+% This (tricky) code is borrowed from David Carlisle's comma.sty.
+% \begin{macrocode}
+\def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
+\def\@@integerpart#1#2#3#4{%
+ \ifx\@empty#2%
+ \@addthousandsep#1\relax
+ \else
+ \ifx\@empty#3%
+ \@addthousandsep\@empty\@empty#1#2\relax
+ \else
+ \ifx\@empty#4%
+ \@addthousandsep\@empty#1#2#3\relax
+ \else
+ \@@integerpartafterfi{#1#2#3#4}%
+ \fi
+ \fi
+ \fi}
+\def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
+\def\@addthousandsep#1#2#3#4{#1#2#3%
+ \if#4\relax
+ \else
+ \thousandsep\expandafter\@addthousandsep\expandafter#4%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Extra utilities}
+%
+% We now provide the Icelandic user with some extra utilities.
+%
+% \begin{macro}{\upp}
+% |\upp| is for typesetting superscripts. |\upp| relies on
+% \begin{macro}{\upp@size}
+% The internal macro |\upp@size| holds the size at which the
+% superscript will be typeset. The reason for this is that we have
+% to specify it differently for different formats.
+% \begin{macrocode}
+\ifx\sevenrm\@undefined
+ \ifx\@ptsize\@undefined
+ \let\upp@size\small
+ \else
+ \ifx\selectfont\@undefined
+% \end{macrocode}
+% In this case the format is the original \LaTeX-2.09:
+% \begin{macrocode}
+ \ifcase\@ptsize
+ \let\upp@size\ixpt\or
+ \let\upp@size\xpt\or
+ \let\upp@size\xipt
+ \fi
+% \end{macrocode}
+% When |\selectfont| is defined we probably have NFSS available:
+% \begin{macrocode}
+ \else
+ \ifcase\@ptsize
+ \def\upp@size{\fontsize\@ixpt{10pt}\selectfont}\or
+ \def\upp@size{\fontsize\@xpt{11pt}\selectfont}\or
+ \def\upp@size{\fontsize\@xipt{12pt}\selectfont}
+ \fi
+ \fi
+ \fi
+\else
+% \end{macrocode}
+% If we end up here it must be a plain based \TeX{} format, so:
+% \begin{macrocode}
+ \let\upp@size\sevenrm
+\fi
+% \end{macrocode}
+% \end{macro}
+% Now we can define |\upp|. When \LaTeXe{} runs in
+% compatibility mode (\LaTeX-2.09 emulation), |\textsuperscript| is
+% also defined, but does no good job, so we give two different
+% definitions for |\upp| using |\if@Two@E|.
+% \begin{macrocode}
+\if@Two@E
+ \DeclareRobustCommand*{\upp}[1]{\textsuperscript{#1}}
+\else
+ \DeclareRobustCommand*{\upp}[1]{%
+ \leavevmode\raise1ex\hbox{\upp@size#1}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Some definitions for special characters.
+% |\grada| needs a special treatment: it is |\char6|
+% in T1-encoding and |\char23| in OT1-encoding.
+% \begin{macrocode}
+\ifx\fmtname\LaTeXeFmtName
+ \DeclareTextSymbol{\grada}{T1}{6}
+ \DeclareTextSymbol{\grada}{OT1}{23}
+\else
+ \def\T@one{T1}
+ \ifx\f@encoding\T@one
+ \newcommand{\grada}{\char6}
+ \else
+ \newcommand{\grada}{\char23}
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\gradur}
+% Macro for typesetting the abbreviation for `degrees' (as in
+% `degrees Celsius'). As the bounding box of the character `degree'
+% has \emph{very} different widths in CMR/DC and PostScript fonts,
+% we fix the width of the bounding box of |\gradur| to 0.3\,em,
+% this lets the symbol `degree' stick to the preceding
+% (e.g., |45\gradur|) or following character (e.g., |20~\gradur C|).
+% \begin{macrocode}
+\DeclareRobustCommand*{\gradur}{%
+ \leavevmode\hbox to 0.3em{\hss\grada\hss}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/icelandic/icelandic.ins b/macros/latex/contrib/babel-contrib/icelandic/icelandic.ins
new file mode 100644
index 0000000000..55ed1075a3
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/icelandic/icelandic.ins
@@ -0,0 +1,149 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2015/12/29}
+\def\batchfile{icelandic.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse %%LOCAL%%
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{icelandic.ldf}{\from{icelandic.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/icelandic/icelandic.pdf b/macros/latex/contrib/babel-contrib/icelandic/icelandic.pdf
new file mode 100644
index 0000000000..3d8c0fc4af
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/icelandic/icelandic.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/indonesian/README b/macros/latex/contrib/babel-contrib/indonesian/README
new file mode 100644
index 0000000000..3f44089503
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/indonesian/README
@@ -0,0 +1,11 @@
+Indonesian 1.0m
+------------
+
+This is the babel style for Indonesian
+
+Changes 1.0m
+-----------
+* Just renamed (from bahasa to indonesian), with some proxy files
+
+----------
+2017-02-15 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/indonesian/indonesian.dtx b/macros/latex/contrib/babel-contrib/indonesian/indonesian.dtx
new file mode 100644
index 0000000000..90cb399da5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/indonesian/indonesian.dtx
@@ -0,0 +1,290 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+% 2017 Javier Bezos, Johannes L. Braams
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{indonesian.dtx}
+%</dtx>
+%<indonesian>\ProvidesLanguage{indonesian}
+%<indon>\ProvidesLanguage{indon}
+%<bahasai>\ProvidesLanguage{bahasai}
+%<bahasa>\ProvidesLanguage{bahasa}
+%\fi
+%\ProvidesFile{indonesian.dtx}
+ [2017/02/15 v1.0m Bahasa Indonesia support from the babel system]
+%\iffalse
+%% File `indonesian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%% 2017 Javier Bezos, Johannes Braams
+%
+%% Bahasa Language Definition File
+%% Copyright (C) 1994 - 2008
+%% by J"org Knappen, (joerg.knappen at alpha.ntp.springer.de)
+% Terry Mart (mart at vkpmzd.kph.uni-mainz.de)
+% Institut f\"ur Kernphysik
+% Johannes Gutenberg-Universit\"at Mainz
+% D-55099 Mainz
+% Germany
+%
+% This file is part of the babel system, it provides the source
+% code for the Bahasa Indonesia language definition
+% file. The original version of this file was written by Terry
+% Mart (mart@vkpmzd.kph.uni-mainz.de) and J"org Knappen
+% (knappen@vkpmzd.kph.uni-mainz.de).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \mathit lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{indonesian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{indonesian.dtx}
+%
+% \changes{indonesian-1.0m}{2017/02/15}{Renamed from bahasa to
+% indonesian, with proxy files}
+% \changes{bahasa-0.9c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{bahasa-1.0d}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{bahasa-1.0e}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Bahasa Indonesian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Bahasa Indonesia. Bahasa just means `language' in Bahasa Indonesia.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{bahasa-v1.0k}{2005/11/23}{Make it possible that this file
+% is loaded by variuos options}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{bahasa} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@bahasa| to see whether we have to do something here.
+%
+% For both Bahasa Indonesia and Bahasa Malaysia the same set of
+% hyphenation patterns can be used which are available in the file
+% \file{inhyph.tex}. However it could be loaded using any of the
+% possible Babel options fot the Indonesian and Malaysian
+% language. So first we try to find out whether this is the case.
+%
+% \changes{bahasa-0.9c}{1994/06/26}{Now use \cs{@patterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@bahasa\@undefined
+ \ifx\l@bahasai\@undefined
+ \ifx\l@indon\@undefined
+ \ifx\l@indonesian\@undefined
+ \ifx\l@bahasam\@undefined
+ \ifx\l@malay\@undefined
+ \ifx\l@meyalu\@undefined
+ \@nopatterns{Bahasa Indonesia}
+ \adddialect\l@bahasa0\relax
+ \else
+ \let\l@bahasa\l@meyalu
+ \fi
+ \else
+ \let\l@bahasa\l@malay
+ \fi
+ \else
+ \let\l@bahasa\l@bahasam
+ \fi
+ \else
+ \let\l@bahasa\l@indonesian
+ \fi
+ \else
+ \let\l@bahasa\l@indon
+ \fi
+ \else
+ \let\l@bahasa\l@bahasai
+ \fi
+\fi
+% \end{macrocode}
+%
+% Now that we are sure the |\l@bahasa| has some valid definition we
+% need to make sure that a name to access the hyphenation patterns,
+% corresponding to the option used, is available.
+% \begin{macrocode}
+\expandafter\expandafter\expandafter\let
+ \expandafter\csname
+ \expandafter l\expandafter @\CurrentOption\endcsname
+ \l@bahasa
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Bahasa language.
+%
+% \begin{macro}{\captionsbahasa}
+% The macro |\captionsbahasa| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{bahasa-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{bahasa-1.0d}{1996/07/09}{Replaced `Proof' by `Bukti'
+% (PR2214)}
+% \changes{bahasa-1.0h}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{bahasa-1.0i}{2003/11/17}{Inserted translation for Glossary}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Pendahuluan}%
+ \def\refname{Pustaka}%
+ \def\abstractname{Ringkasan}% (sometime it's called 'intisari'
+ % or 'ikhtisar')
+ \def\bibname{Bibliografi}%
+ \def\chaptername{Bab}%
+ \def\appendixname{Lampiran}%
+ \def\contentsname{Daftar Isi}%
+ \def\listfigurename{Daftar Gambar}%
+ \def\listtablename{Daftar Tabel}%
+ \def\indexname{Indeks}%
+ \def\figurename{Gambar}%
+ \def\tablename{Tabel}%
+ \def\partname{Bagian}%
+% Subject: Subyek
+% From: Dari
+ \def\enclname{Lampiran}%
+ \def\ccname{cc}%
+ \def\headtoname{Kepada}%
+ \def\pagename{Halaman}%
+% Notes (Endnotes): Catatan
+ \def\seename{lihat}%
+ \def\alsoname{lihat juga}%
+ \def\proofname{Bukti}%
+ \def\glossaryname{Daftar Istilah}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebahasa}
+% The macro |\datebahasa| redefines the command |\today| to produce
+% Bahasa Indonesian dates.
+% \changes{bahasa-1.0f}{1997/10/01}{Use \cs{edef} to define \cs{today}}
+% \changes{bahasa~1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}
+% to save memory}
+% \changes{bahasa-1.0g}{1999/03/12}{Februari should be spelled as
+% Pebruari}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day~\ifcase\month\or
+ Januari\or Pebruari\or Maret\or April\or Mei\or Juni\or
+ Juli\or Agustus\or September\or Oktober\or Nopember\or Desember\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrasbahasa}
+% \begin{macro}{\noextrasbahasa}
+% The macro |\extrasbahasa| will perform all the extra definitions
+% needed for the Bahasa language. The macro |\extrasbahasa| is used
+% to cancel the actions of |\extrasbahasa|. For the moment these
+% macros are empty but they are defined for compatibility with the
+% other language definition files.
+%
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bahasahyphenmins}
+% The bahasa hyphenation patterns should be used with
+% |\lefthyphenmin| set to~2 and |\righthyphenmin| set to~2.
+% \changes{bahasa-1.0e}{1996/08/07}{use \cs{bahasahyphenmins} to store
+% the correct values}
+% \changes{bahasa-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+% Finally, We create a few proxy files, which just load indonesian.ldf.
+%
+% \begin{macrocode}
+%<*bahasa|indon|bahasai>
+\input indonesian.ldf\relax
+%</bahasa|indon|bahasai>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/indonesian/indonesian.ins b/macros/latex/contrib/babel-contrib/indonesian/indonesian.ins
new file mode 100644
index 0000000000..6fae1e8743
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/indonesian/indonesian.ins
@@ -0,0 +1,154 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%% 2017 Javier Bezos, Johannes L. Braams
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2017/02/15}
+\def\batchfile{indonesian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+ 2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+ 2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{indonesian.ldf}{\from{indonesian.dtx}{indonesian,code}}
+ \file{bahasai.ldf}{\from{indonesian.dtx}{bahasai}}
+ \file{indon.ldf}{\from{indonesian.dtx}{indon}}
+ \file{bahasa.ldf}{\from{indonesian.dtx}{bahasa}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/indonesian/indonesian.pdf b/macros/latex/contrib/babel-contrib/indonesian/indonesian.pdf
new file mode 100644
index 0000000000..7b7f920aa1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/indonesian/indonesian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/interlingua/interlingua.dtx b/macros/latex/contrib/babel-contrib/interlingua/interlingua.dtx
new file mode 100644
index 0000000000..56b109fdca
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/interlingua/interlingua.dtx
@@ -0,0 +1,207 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{85}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{interlingua.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{interlingua}
+%\fi
+%\ProvidesFile{interlingua.dtx}
+ [2005/03/30 v1.6 Interlingua support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source code for
+% the Interlingua language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\usepackage{url}
+\begin{document}
+ \DocInput{interlingua.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{interlingua.dtx}
+%
+% \section{The Interlingua language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Interlingua language. This file was contributed by Peter
+% Kleiweg, kleiweg at let.rug.nl.
+%
+% Interlingua is an auxiliary language, built from the common
+% vocabulary of Spanish/Portuguese, English, Italian and French,
+% with some normalisation of spelling. The grammar is very easy,
+% more similar to English's than to neolatin languages. The site
+% \url{http://www.interlingua.com} is mostly written in interlingua
+% (as is \url{http://interlingua.altervista.org}), in case you want
+% to read some sample of it.
+%
+% You can have a look at the grammar at
+% \url{http://www.geocities.com/linguablau}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{interlingua}{captionsinterlingua}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{interlingua} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@interlingua| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@interlingua
+ \@nopatterns{Interlingua}
+ \adddialect\l@interlingua0\fi
+% \end{macrocode}
+
+% The next step consists of defining commands to switch to (and
+% from) the Interlingua language.
+%
+%
+% \begin{macro}{\interlinguahyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{interlingua}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsinterlingua}
+% The macro |\captionsinterlingua| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\def\captionsinterlingua{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referentias}%
+ \def\abstractname{Summario}%
+ \def\bibname{Bibliographia}%
+ \def\chaptername{Capitulo}%
+ \def\appendixname{Appendice}%
+ \def\contentsname{Contento}%
+ \def\listfigurename{Lista de figuras}%
+ \def\listtablename{Lista de tabellas}%
+ \def\indexname{Indice}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Parte}%
+ \def\enclname{Incluso}%
+ \def\ccname{Copia}%
+ \def\headtoname{A}%
+ \def\pagename{Pagina}%
+ \def\seename{vide}%
+ \def\alsoname{vide etiam}%
+ \def\proofname{Prova}%
+ \def\glossaryname{Glossario}%
+ }
+% \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\dateinterlingua}
+% The macro |\dateinterlingua| redefines the command |\today| to
+% produce Interlingua dates.
+% \begin{macrocode}
+\def\dateinterlingua{%
+ \def\today{le~\number\day\space de \ifcase\month\or
+ januario\or februario\or martio\or april\or maio\or junio\or
+ julio\or augusto\or septembre\or octobre\or novembre\or
+ decembre\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\extrasinterlingua}
+% \begin{macro}{\noextrasinterlingua}
+% The macro |\extrasinterlingua| will perform all the extra
+% definitions needed for the Interlingua language. The macro
+% |\noextrasinterlingua| is used to cancel the actions of
+% |\extrasinterlingua|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extrasinterlingua{}
+\addto\noextrasinterlingua{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{interlingua}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/interlingua/interlingua.ins b/macros/latex/contrib/babel-contrib/interlingua/interlingua.ins
new file mode 100644
index 0000000000..679af1e10c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/interlingua/interlingua.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2003/11/13}
+\def\batchfile{interlingua.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{interlingua.ldf}{\from{interlingua.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/interlingua/interlingua.pdf b/macros/latex/contrib/babel-contrib/interlingua/interlingua.pdf
new file mode 100644
index 0000000000..72b7425aaa
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/interlingua/interlingua.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/irish/irish.dtx b/macros/latex/contrib/babel-contrib/irish/irish.dtx
new file mode 100644
index 0000000000..221c08f91a
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/irish/irish.dtx
@@ -0,0 +1,218 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{122}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{irish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{irish}
+%\fi
+%\ProvidesFile{irish.dtx}
+ [2005/03/30 v1.0h Irish support from the babel system]
+%\iffalse
+%% File `irish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Irish language definition file.
+%
+% The Gaeilge or Irish Gaelic terms were tranlated from those
+% provided by Fraser Grant \texttt{FRASER@CERNVM} by Marion Gunn.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{irish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{irish.dtx}
+%
+% \changes{irish-1.0b}{1995/06/14}{Corrected typo (PR1652)}
+% \changes{irish-1.0e}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Irish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Marion Gunn.} defines all
+% the language definition macros for the Irish language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{irish-1.0e}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{irish}\captionsirish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{irish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@irish| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@irish\@undefined
+ \@nopatterns{irish}
+ \adddialect\l@irish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Irish language.
+%
+% \begin{macro}{\irishhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{irish-1.0f}{1998/06/08}{Added definition of
+% \cs{hyphenmins}}
+% \changes{irish-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsirish}
+% The macro |\captionsirish| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{irish-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{irish-1.0f}{1998/06/08}{Added missing translations provided
+% in PR 2719}
+% \changes{irish-1.0h}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsirish{%
+ \def\prefacename{R\'eamhr\'a}% <-- also "Brollach"
+ \def\refname{Tagairt\'{\i}}%
+ \def\abstractname{Achoimre}%
+ \def\bibname{Leabharliosta}%
+ \def\chaptername{Caibidil}%
+ \def\appendixname{Aguis\'{\i}n}%
+ \def\contentsname{Cl\'ar \'Abhair}%
+ \def\listfigurename{L\'ear\'aid\'{\i}}%
+ \def\listtablename{T\'abla\'{\i}}%
+ \def\indexname{Inn\'eacs}%
+ \def\figurename{L\'ear\'aid}%
+ \def\tablename{T\'abla}%
+ \def\partname{Cuid}%
+ \def\enclname{faoi iamh}%
+ \def\ccname{cc}% abrv. `c\'oip chuig'
+ \def\headtoname{Go}%
+ \def\pagename{Leathanach}%
+ \def\seename{f\'each}%
+ \def\alsoname{f\'each freisin}%
+ \def\proofname{Cruth\'unas}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateirish}
+% The macro |\dateirish| redefines the command |\today| to produce
+% Irish dates.
+% \changes{irish-1.0f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{irish-1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \begin{macrocode}
+\def\dateirish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ Ean\'air\or Feabhra\or M\'arta\or Aibre\'an\or
+ Bealtaine\or Meitheamh\or I\'uil\or L\'unasa\or
+ Me\'an F\'omhair\or Deireadh F\'omhair\or
+ M\'{\i} na Samhna\or M\'{\i} na Nollag\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasirish}
+% \begin{macro}{\noextrasirish}
+% The macro |\extrasirish| will perform all the extra definitions
+% needed for the Irish language. The macro |\noextrasirish| is used
+% to cancel the actions of |\extrasirish|. For the moment these
+% macros are empty but they are defined for compatibility with the
+% other language definition files.
+%
+% \begin{macrocode}
+\addto\extrasirish{}
+\addto\noextrasirish{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{irish-1.0e}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{irish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/irish/irish.ins b/macros/latex/contrib/babel-contrib/irish/irish.ins
new file mode 100644
index 0000000000..33a3172ee2
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/irish/irish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{irish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{irish.ldf}{\from{irish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/irish/irish.pdf b/macros/latex/contrib/babel-contrib/irish/irish.pdf
new file mode 100644
index 0000000000..b8b0005c00
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/irish/irish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/italian/README.txt b/macros/latex/contrib/babel-contrib/italian/README.txt
new file mode 100644
index 0000000000..11598a8e32
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/italian/README.txt
@@ -0,0 +1,13 @@
+The italian.dtx file has version number 1.4.01 dated 2019-01-05.
+It is and update of a series fo files stating with the first one in 1990
+Copyright (C) 1990-2019 Claudio Beccari
+Maintainer Claudio Beccari
+Contact: claudio dot beccari at gmail dot com
+
+Description
+This file contain the necessary and supplementary data for typesetting documents in Italiana with babel as the manager of the language management.
+It defines the infix words, the date in various formats. Optionally lets the user activate a number of shorthands to performe routine frequent tasks by means of the active character " that can be freely activated and deactivated. It defines an intelligent mathematical comma that recognises if it has to perform as a punctuation mark or as a decimal separator. Another user command activates or deactivates some commands to supply a minimum of performance that is fully provided by the siunitx package. The file allows using babel also when a document is typeset with XeLaTeX or LuaLaTeX, even if, according to the author, polyglossia is preferred when typesetting documents in Italian, even if the gloss-italian.ldf for polyglossia provides less facilities than the ones available with babel.
+
+The documentation that is provided by running LaTeX on the italian.dtx file provides full documentation of every facility provided by the italian.ldf file.
+
+
diff --git a/macros/latex/contrib/babel-contrib/italian/italian.dtx b/macros/latex/contrib/babel-contrib/italian/italian.dtx
new file mode 100644
index 0000000000..a7a234fea1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/italian/italian.dtx
@@ -0,0 +1,1468 @@
+% \iffalse meta-comment
+% !TEX TS-program = pdflatex
+% !TEX encoding = UTF-8 Unicode
+%<*internal>
+\begingroup
+\input docstrip.tex
+\keepsilent
+
+
+\preamble
+------------------------------------------
+The Italian support for babel: italian.ldf.
+Copyright (C) 1990-2019 Claudio Beccari
+All rights reserved
+
+License information appended.
+\endpreamble
+\postamble
+
+Copyright (C) 1990-2019 Claudio Beccari
+
+ It may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3c
+ of this license or (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3c or later is part of all distributions of LaTeX
+ version 2003/12/01 or later.
+
+ This work has the LPPL maintenance status "maintained".
+
+ The Current Maintainer of the babel system is Javier Bezos
+ The current maintainer of Italian language support is Claudio Beccari
+
+This work consists of this file italian.dtx and the derived
+file italian.ldf
+
+ The list of all files belonging to the LaTeX base distribution is
+ given in the file `manifest.bbl. See also `legal.bbl' for additional
+ information.
+
+This file is a self unpacking one.
+\endpostamble
+\askforoverwritefalse
+\generate{\file{italian.ldf}{\from{italian.dtx}{code}}}
+
+\def\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+%</internal>
+%
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%\fi
+%\iffalse
+%<*driver>
+\ProvidesFile{italian.dtx}
+%</driver>
+%<code>\ProvidesLanguage{italian}
+%<*code>
+ [2019/01/05 v.1.4.01 Italian support for the babel system]
+%</code>
+%%
+%% Please report errors to: claudio dot beccari at gmail dot com
+%%
+%
+% This file is part of the babel system, it provides the source
+% code for the Italian language definition file.
+% The original version of this file was written by Maurizio
+% Codogno, (mau@beatles.cselt.stet.it).
+% The package was completely rewritten by Claudio Beccari, who added
+% several features.
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{italian.dtx}
+\title{The Italian support for babel}
+\date{\fileversion\space--- \filedate}
+\author{\makebox[\textwidth]{Claudio Beccari ---
+mail: \texttt{claudio dot beccari at gmail dot com}}}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{booktabs}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+\maketitle
+\begin{multicols}{2}
+\tableofcontents
+\end{multicols}
+ \setlength\hfuzz{20pt}
+ \DocInput{italian.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+% \CheckSum{755}
+%
+% \changes{italian-0.99}{1990/07/11}{First version, from english.doc}
+% \changes{italian-1.0}{1991/04/23}{Modified for babel 3.0}
+% \changes{italian-1.0a}{1991/05/23}{removed typo}
+% \changes{italian-1.0b}{1991/05/29}{Removed bug found by van der Meer}
+% \changes{italian-1.0e}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{italian-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{italian-1.2}{1994/02/09}{Update for\ LaTeXe}
+% \changes{italian-1.2e}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{italian-1.2f}{1995/05/28}{Updated for babel 3.5}
+% \changes{italian-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{italian-1.2l}{1999/04/24}{Added \cs{unit}, \cs{ap}, and
+% \cs{ped} macros}
+% \changes{italian-1.2m}{2000/01/05}{Added support for etymological
+% hyphenation}
+% \changes{italian-1.2n}{2000/02/02}{Completely modified etymological
+% hyphenation facility}
+% \changes{italian-1.2n}{2000/05/28}{Added several commands for the
+% caporali double quotes and for simplifying the accented vowel input}
+% \changes{italian-1.2o}{2000/12/12}{Added \cs{glossaryname}}
+% \changes{italian-1.2p}{2002/07/10}{Removed redefinition of
+% \cs{add@acc} since its functionality has been introduced into the
+% kernel of LaTeX 2001/06/01}
+% \changes{italian-1.2q}{2005/02/05}{Added test for avoiding conflict
+% with package units.sty; adjusted caporali functionality, since
+% the previous one did not work with the standard (although obsolete)
+% slides class file}
+% \changes{italian-1.3}{2013/09/29}{Completely changed the Italian
+% guillemet functionality in order to simplify their handling}
+% \changes{italian-1.3}{2013/09/30}{Eliminated the \emph{traditional}
+% attribute; the same functionality is obtained with the declaration
+% \cs{XXIletters}}
+% \changes{italian-1.3}{2013/09/30}{Command \cs{unit} is disabled if
+% packages units, SIunits, or siunitx have been loaded; this control is
+% now deferred at the end of the preamble, when all packages have already
+% been loaded}
+% \changes{italian-1.3a}{2013/10/02}{Eliminated conflict with the amsmath
+% package}
+% \changes{italian-1.3-d}{2013/11/11}{Corrected the \string" behaviour for
+% etymological hyphenation}
+% \changes{italian-1.3f}{2013/11/22}{Deleted extra \cs{selectlanguage}%
+% \{italian\}}
+% \changes{italian-1.3g}{2014/02/16}{Corrected the \string"/ shorthand}
+% \changes{italian-1.3g}{2014/02/16}{Italian shorthandss are now optional
+% as well as the intelligent comma facility}
+% \changes{italian-i.3i}{2014/02/17}{Updated documentation}
+% \changes{italian-1.3i}{2014/02/17}{Modified the \string"- shorthand}
+% \changes{italian-1.3j}{2014/02/22}{\string\setactivedoublequote\ does
+% work but it must be delayed until \string\begin\{document\}; with babel
+% 3.9g the main language is set before this point, therefore it is
+% necessary to select again the Italian language if this is the main one}
+% \changes{italian-1.3k}{2014/03/29}{Corrected discrepancy between
+% \cs{SetISOcompliance} (wrong in documentation) and
+% \cs{setISOcompliance} (correct in code)}
+% \changes{italian-1.3l}{2014/05/25}{Corrections in the documentation}
+% \changes{italian-1.3m}{2015/03/12}{More corrections to the
+% documentations, specifically on conflicts with the dcolumn package and
+% its D column. The whole \(No)IntelligentComma mechanism has been
+% actually completely rewritten; so the change does not deal only with
+% documentation, but also with code.}
+% \changes{italian-1.3n}{2015/03/26}{Minor corrections}
+% \changes{italian-1.4.00}{2019/01/01}{Fixed the problem with the
+% apostrophe unicode code for when babel=italian is used with
+% xelatex or lualatex.}
+% \changes{italian-1.4.01}{2019/01/05}{Rewritten code introduced in 1.4.00,
+% and the documentation modified accordingly.}
+%
+% \section{The Italian language}
+% \textbf{Important notice}: This language description file relies on
+% functionalities provided by a modern TeX system distribution with
+% pdfLaTeX working in extended mode (eTeX commands available); it
+% should perform correctly also with XeLaTeX and LuaLaTeX; tests have
+% been made also with the latter programs, but it was really tested in
+% depth with |babel| and pdfLaTeX.
+%
+% \bigskip
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Maurizio Codogno.
+% It was initially revised
+% by Johannes Braams and then completely rewritten by Claudio Beccari}
+% defines all the required and some optional language-specific
+% macros for the Italian language.
+%
+% \begin{table}[htb]\centering
+% \begin{tabular}{cp{90mm}}
+% \toprule
+% |"| & inserts a compound word mark where hyphenation is legal;
+% it allows etymological hyphenation which is recommended
+% for technical terms, chemical names and the like; it
+% does not work if the next character is represented with
+% a control sequence or is an accented character.\\
+% \texttt{\string"\string|}
+% & the same as the above without the limitation on
+% characters represented with control sequences or accented
+% ones.\\
+% |""| & inserts open quotes ``.\\ %^^A'' emacs matching
+% |"<| & inserts open guillemets without trailing space.\\
+% |">| & inserts closed guillemets without leading space.\\
+% |"/| & allows hyphenation of both words connected with slash.\\
+% |"-| & allows hyphenation of both words connected with a short dash
+% (\emph{trattino copulativo}, in Italian)\\
+% \bottomrule
+% \end{tabular}
+% \caption{shorthands for the Italian language. These shorthands are
+% available only if command \texttt{\string\setactivedoublequote} is given
+% after loading \babel\ and before \texttt{\string\begin\{document\}}.}
+% \label{t:itshrtct}
+% \end{table}
+%
+% The features of this language definition file are the following:
+% \begin{enumerate}
+% \item The Italian hyphenation is invoked, provided that the Italian
+% hyphenation pattern files were loaded when the specific format file
+% was built.
+% \item The language dependent infix words to be inserted by such
+% commands as |\chapter|, |\caption|, |\tableofcontents|,
+% etc. are redefined in accordance with the Italian
+% typographical practice.
+% \item Since Italian can be easily hyphenated and Italian practice
+% allows to break a word before the last two letters, hyphenation
+% parameters have been set accordingly, but a very high demerit
+% value has been set in order to avoid word breaks in the
+% penultimate line of a paragraph. Specifically the |\clubpenalty|,
+% and the |\widowpenalty| are set to rather high values and
+% |\finalhyphendemerits| is set to such a high value that
+% hyphenation is strongly discouraged between the last two lines
+% of a paragraph.
+%^^A
+%^^A Qui ci si potrebbero mettere le indicazioni per gli attributi e modificatori
+%^^A
+% \item Some language specific shorthands have been defined so as to
+% allow etymological hyphenation, specifically |"| inserts a
+% break point at any word boundary that the typesetter chooses,
+% provided it is not followed by an accented letter (very unlikely
+% in Italian, where compulsory accents fall only on the last and
+% ending vowel of a word, but it may take place with compound words
+% that include foreign roots), and \verb="|= when the desired break
+% point falls before an accented letter. As you can read in
+% table~\ref{t:itshrtct}, these shorthands are available only if
+% they get activated with |\setactivedoublequote| after
+% loading \babel\ but before the |\begin{docuemnt}| statement. This
+% is done in order to preserve the user from package conflicts:
+% if s/he wants to use these facilities s/he must remember that
+% conflicts may arise unless active characters are deactivated;
+% this can be done with the \babel\ command |\shorthadsoff{"}|
+% (and reactivated with |\shorthandson{"}|) when its wise to do
+% so; conflicts have been reported with package \file{xypic} and
+% with \texttt{TikZ}, but the latter has its own library to
+% deactivate all active characters, not just the double quotes,
+% the only Italian language possibly activated character.
+% \item Some Italian compound words have a connecting short dash (a
+% hyphen sign) between them without any space between the component
+% words and the short dash; in this situation standard \LaTeX\ allows
+% a line break only just after the short dash; this may lead to
+% paragraphs with protruding lines or with ugly looking wide inter
+% word spaces. If a break point is desired in the second word, one
+% may use a |"| sign just after the short dash; but if a line break
+% is required in the first word, them the |"-| shorthand comes in handy;
+% pay attention though, that if you use an en-dash or an em-dash (both
+% should not be used in Italian as compound words connectors, but\dots)
+% then the |"-| shorthand might impeach the |--| or |---| ligatures, thus
+% producing an unacceptable appearance.
+% \item The shorthand |""| introduces the raised (English) opening
+% double quotes; this shorthand proves its usefulness when one
+% reminds that the Italian keyboard misses the backtick key, and
+% the backtick on a Windows based platform may be obtained only by
+% pressing the \texttt{Alt} key while keying the numerical code
+% 0096 in the numeric keypad; very, very annoying!
+% \item The shorthands |"<| and |">| insert the guillemets sometimes
+% used also in Italian typography; with the T1 font encoding
+% the ligatures |<<| and |>>| should insert such signs directly,
+% but not all the virtual fonts that claim to follow the T1 font
+% encoding actually contain the guillemets; with the OT1 encoding
+% the guillemets are not available and must be faked in some
+% way. By using the |"<| and |">| shorthands (even with the T1
+% encoding) the necessary tests are performed and in case the
+% guillemets are faked by means of the special LaTeX math symbols.
+% At the same time if OpenType fonts are being used with XeLaTeX
+% or LuaLaTeX, there are no problems with guillemets.
+% \item Three new specific commands |\unit|, |\ped|, and |\ap| are
+% introduced so as to enable the correct composition of technical
+% mathematics according to the ISO~31/XI recommendations.
+% The definition of |\unit| takes place only at ``begin document''
+% so that it is possible to verify if some other similar functionalities
+% have already been defined by other packages, such as |units.sty|
+% or |siunitx.sty|. In particular command |\unit| is deactivated by
+% default; the user can activate it by entering the command
+% |\setISOcompliance| after loading the \babel\ package and before the
+% |\begin{document}| statement. The above checks will enter into
+% action even if this ISO compliance is set, in order to avoid conflicts
+% with the above named packages. The |\ap| and |\ped| commands remain
+% available because up to now no specific conflicts have been reported.
+% \item Since in all languages different from English the decimal separator
+% according to the ISO regulations \emph{must} be a comma\footnote{Actually
+% the Bureau International des Pois et M\'esures allows also the point
+% as a decimal separator without mentioning any language, but recommends
+% to follow the national typographical traditions}; since
+% no language description file nor the \babel\ package itself provides
+% for this functionality, a not so simple intelligent comma definition is
+% provided such that at least in mathematics it behaves correctly.
+% There are other packages that provide a similar functionality, for
+% example |icomma| and |ncccomma|; |icomma|, apparently is not in conflict
+% with |dcolomn|, but requires a space after the comma all the times it
+% plays the r\^ole of a punctuation mark; |ncccomma|, checks if the next
+% token is a digit, but it repeated ten tests every time it meets a comma,
+% irrespective from what it is followed by. I believe that my solution
+% is better than that provided by both those packages; but I assume that
+% if the user loads on of those packages, it prefers to use that
+% functionality; In case one of those pachages is loaded, this module
+% excludes its intelligent comma functionality.
+% By default this functionality is turned \emph{off}, therefore the user
+% should turn it on by means of the |\IntelligentComma| command; it can
+% turn it off by means of |\NoIntelligentComma|. Please, read
+% subsection~\ref{ssec:comma} to see the various situations where a
+% mathematical comma may be used and how to overcome the few cases when
+% the macros of this file don't behave as expected. The section describes
+% also some limitations when some cong=flicting packages are being loaded.
+% \item In Italian legal documents it is common to tag list-items
+% with the old fashioned 21-letter Italian alphabet, that differs from
+% the Latin one by the omission of the letters `j', `k', `w',`x', and
+% `y'. This applies for both upper and lower case tags.
+% This feature is obtained by using the commands |\XXIletters| and
+% |\XXVIletters| that allow to switch back and forth
+% between 21- and 26-letter tagging.
+% \end{enumerate}
+%
+% For this language a few shorthands have been defined,
+% table~\ref{t:itshrtct}, some of which are introduced to overcome
+% certain limitations of the Italian keyboard; in
+% section~\ref{s:itkbd} there are other comments and hints in order
+% to overcome some other keyboard limitations.
+%
+% \subsection*{Acknowlegements}
+% It is my pleasure to acknowledge the contributions of Giovanni Dore,
+% Davide Liessi, Grazia Messineo, Giuseppe Toscano, who spotted some bugs
+% or conflicts with other packages, mainly |amsmath| and |icomma|, and
+% with digits hidden inside macros or control sequences representing
+% implicit characters. Testing by real users and their feedback is
+% essential with open software such as the uncountable contributions
+% to the \TeX\ system. Thank you very much.
+%
+% \begin{thebibliography}{1}
+% \bibitem{CBec} Beccari C., ``Computer Aided Hyphenation for
+% Italian and Modern Latin'', \textsf{TUGboat} vol.~13, n.~1,
+% pp.~23-33 (1992).
+% \bibitem{Becc2} Beccari C., ``Typesetting mathematics for science
+% and technology according to ISO\,31/XI'', \textsf{TUGboat}
+% vol.~18, n.~1, pp.~39-48 (1997).
+% \end{thebibliography}
+%
+% \StopEventually{}%
+%
+%\subsection{The commented code}
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{italian-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{italian-1.2j}{1996/12/29}{Added braces around second arg of
+% \cs{LdfInit}}
+%\iffalse
+%<*code>
+%\fi
+% \begin{macrocode}
+\LdfInit{italian}{captionsitalian}%
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{italian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@italian| to see whether we have to do something here.
+%
+% \changes{italian-1.0}{1991/04/23}{Now use \cs{adddialect} if
+% language undefined}
+% \changes{italian-1.0h}{1991/10/08}{Removed use of \cs{@ifundefined}}
+% \changes{italian-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{italian-1.2e}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@italian\@undefined
+ \@nopatterns{Italian}%
+ \adddialect\l@italian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Italian language.
+%
+% \begin{macro}{\captionsitalian}
+% The macro |\captionsitalian| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
+% \changes{italian-1.0c}{1991/06/06}{\cs{pagename} should be
+% \cs{headpagename}}
+% \changes{italian-1.0d}{1991/07/01}{`contiene' substitued by `Allegati'
+% as suggested by Marco Bozzo (\texttt{BOZZO@CERNVM}).}
+% \changes{italian-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{italian-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{italian-1.2b}{1994/05/19}{Changed some of the infix words}
+% \changes{italian-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{italian-1.2h}{1995/07/27}{Added translation of `Proof'}
+% \begin{macrocode}
+\addto\captionsitalian{%
+ \def\prefacename{Prefazione}%
+ \def\refname{Riferimenti bibliografici}%
+ \def\abstractname{Sommario}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Capitolo}%
+ \def\appendixname{Appendice}%
+ \def\contentsname{Indice}%
+ \def\listfigurename{Elenco delle figure}%
+ \def\listtablename{Elenco delle tabelle}%
+ \def\indexname{Indice analitico}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Parte}%
+ \def\enclname{Allegati}%
+ \def\ccname{e~p.~c.}%
+ \def\headtoname{Per}%
+ \def\pagename{Pag.}%
+ \def\seename{vedi}%
+ \def\alsoname{vedi anche}%
+ \def\proofname{Dimostrazione}%
+ \def\glossaryname{Glossario}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateitalian}
+% The macro |\dateitalian| redefines the command
+% |\today| to produce Italian dates.
+% \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
+% \begin{macrocode}
+\def\dateitalian{%
+ \def\today{\number\day~\ifcase\month\or
+ gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
+ luglio\or agosto\or settembre\or ottobre\or novembre\or
+ dicembre\fi\space \number\year}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\italianhyphenmins}
+% \changes{italian-1.2b}{1994/05/19}{Added setting of left and
+% righthyphenmin}
+%
+% The italian hyphenation patterns can be used with both
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{italian-1.2m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasitalian}
+% \begin{macro}{\noextrasitalian}
+%
+% \changes{italian-1.2b}{1994/05/19}{Added settings of club- and
+% widowpenalty}
+% Lower the chance that clubs or widows occur.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+% \end{macrocode}
+%
+% \changes{italian-1.2b}{1994/05/19}{Added setting of
+% finalhyphendemerits}
+%
+% Never ever break a word between the last two lines of a paragraph
+% in Italian texts.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+% \end{macrocode}
+%
+% \changes{italian-1.2h}{1995/11/10}{Now give the apostrophe a
+% lowercase code}
+% \changes{italian-1.2l}{1999/04/5}{Changed example ``begl'italiani''
+% (obsolete spelling) with another, ``nell'altezza'', that behaves
+% the same way}
+% In order to enable the hyphenation of words such as
+% ``nell'altezza'' we give the \texttt{'} a non-zero lower case
+% code. When we do that \TeX\ finds the following hyphenation
+% points |nel-l'al-tez-za| instead of none. If this |italian.ldf| is
+% (improperly) used with |babel| when typesetting with |xelatex| or
+% |lualatex| the apostrophe must receive a unicode code point.
+% Therefore we use the same test that is being used by the |iftex|
+% package in order to check if this option to |babel| is used while
+% typesetting with |pdflatex| or another typesetting engine.
+% \begin{macrocode}
+
+\addto\extrasitalian{%
+\lccode\string`'=`' \unless\ifcsname pdfmatch\endcsname
+\lccode\string"2019=\string"2019\fi}
+\addto\noextrasitalian{%
+\lccode\string`'=0 \unless\ifcsname pdfmatch\endcsname
+\lccode\string"2019=0\fi}
+
+% \end{macrocode}
+% Notice, though, that if you use |babel| when typesetting with |lualatex| or |xelatex| using the |fontspec| usual commands and options may not lead to their proper font alternative variants being used. Apparently the |\balefont| command is more performant in transmitting the proper information to |fontspec|. Of course |\babelfont| must be used after the |babel| package has been invoked; while there appears to be any loading precedence requirements when |fontspec| and |polyglossa| are used
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Traditionally labelled enumerate environment}
+% \changes{italian-1.2v}{2010/01/02}{Support for traditional Italian}
+% In some traditional texts, especially of legal nature, enumerations labelled
+% with lower or upper case letters use the reduced Latin alphabet that omits
+% the so called ``non Italian letters'': j, k, w, x, and y.
+%
+% \changes{italian-1.2w}{2011/01/03}{Added switching mechanism between normal
+% and traditional enumeration labelling}
+% \changes{italian-1.3}{2013/09/27}{The |traditional| language attribute has
+% been dropped while the commands to switch back and forth from 21- to
+% 26-letter alphabet are retained}
+% \begin{macro}{\XXIletters}
+% \begin{macro}{\XXVIletters}
+% At the same time it is considered useful to have the possibility of
+% switching back and forth from the 21-letter tagging and the 26-letter one.
+% This requires a counter that keeps the switching status (0 for 21 letters
+% and 1 for 26 letters) and commands |\XXIletters| and |\XXVIletters|
+% to set the switch. Default is 26 letter tagging.
+% \begin{macrocode}
+\newcount\it@lettering \it@lettering=\@ne
+\newcommand*\XXIletters{\it@lettering=\z@}
+\newcommand*\XXVIletters{\it@lettering=\@ne}
+\let\bbl@alph\@alph \let\bbl@Alph\@Alph
+\addto\extrasitalian{\babel@savevariable\it@lettering
+ \let\@alph\it@alph \let\@Alph\it@Alph}
+\addto\noextrasitalian{\let\@alph\bbl@alph\let\@Alph\bbl@Alph}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% To make this feasible it's necessary to redefine the way the \LaTeX\ |\@alph|
+% and |\@Alph| work. Let's make the alternate definitions:
+% \begin{macrocode}
+\def\it@alph#1{%
+\ifcase\it@lettering
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or
+ l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ z\else\@ctrerr\fi
+\or
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or
+ j\or k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ w\or x\or y\or z\else\@ctrerr\fi
+\fi}%
+\def\it@Alph#1{%
+\ifcase\it@lettering
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or
+ L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ Z\else\@ctrerr\fi
+\or
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or
+ J\or K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ W\or X\or Y\or Z\else\@ctrerr\fi
+\fi}%
+% \end{macrocode}
+%
+% In order to have a complete description, the situation is as such:
+% \begin{enumerate}
+% \item If you want to always use the 21-letter item tagging, simply
+% use the |\XXIletters| declaration just after |\begin{document}|
+% and this setting remains global (provided, of course, that the
+% declaration is defined, i.e. that the Italian language is the
+% default one); in this way the setting is global while you use
+% the Italian language.
+% \item The |XXVIletter| command, issued outside any environment sets
+% the 26-letter item tagging in a global way; this setting is the default one.
+% \item If you specify |\XXIletters| just before entering an
+% environment that uses alphabetic tagging, this environment will
+% be tagged with the 21-letter alphabet, but this is a local setting,
+% because the letter tagging takes place only from the second level
+% of enumeration.
+% \item The declarations |\XXIletters| and |\XXVIletters| let you
+% switch back and forth between the two kinds of tagging, But this
+% kind of tagging, the 21-letter one, is meaningful only in Italian
+% and when you change language, letter tagging reverts to the 26-letter
+% one.
+% \end{enumerate}
+%
+% \changes{italian-1.2m}{2000/01/05}{Support for etymological
+% hyphenation}
+%
+% \subsection{Support for etymological hyphenation}
+
+% In Italian etymological hyphenation is desirable with
+% technical terms, chemical names, and the like.
+
+% \subsubsection{Some history}
+% In his article on Italian hyphenation \cite{CBec} Beccari pointed
+% out that the Italian language gets hyphenated on a phonetic
+% basis, although etymological hyphenation is allowed; this is in
+% contrast with what happens in Latin, for example, where
+% etymological hyphenation is always used. Since the patterns for
+% both languages would become too complicated in order to cope with
+% etymological hyphenation, in his paper Beccari proposed the
+% definition of an active character `|_|' such that it could insert
+% a ``soft'' discretionary hyphen at the compound word
+% boundary. For several reasons that idea and the specific active
+% character proved to be unpractical and was abandoned.
+%
+% This problem is so important with the majority of the European
+% languages, that \babel\ from the very beginning developed
+% the tradition of making the |"| character active so as to perform
+% several actions that turned useful with every language.
+% One of these actions consisted in defining the shorthand \verb="|=,
+% that was extensively used in German and in many other languages,
+% in order to insert a discretionary hyphen such that hyphenation
+% would not be precluded in the rest of the word as it happens with
+% the standard \TeX\ command |\-|.
+%
+% Meanwhile the \texttt{ec} fonts with the double Cork encoding
+% (thus formerly called the \texttt{dc} fonts) have become more or
+% less standard and are widely used by virtually all Europeans that
+% write languages with many special national characters; by so
+% doing they avoid the use of the |\accent| primitive which would
+% be required with the standard OT1 encoded \texttt{cm} fonts;
+% with such OT1 encoded fonts the primitive command |\accent| is such
+% that hyphenation becomes almost impossible, in any case strongly
+% impeached.
+%
+% The T1 encoded fonts contain a special character, named
+% ``compound word mark'', that occupies slot 23 (or |'27| or |"17|
+% in the font scheme and may be input with the sequence |^^W|.
+% Up to now, apparently, this special character has never been used
+% in a practical way for typesetting languages rich of compound
+% words; moreover it has never been inserted in the hyphenation pattern
+% files of any language. Beccari modified his pattern file
+% \file{ithyph.tex v4.8b} for Italian so as to contain five new
+% patterns that involve |^^W|, and he tried to give the
+% \babel\ active character |"| a new shorthand definition,
+% so as to allow the insertion of the ``compound word mark'' in the
+% proper place within any word where two semantic fragments join
+% up. With such facility for marking the compound word boundaries,
+% etymological hyphenation becomes possible even if the patterns
+% know nothing about etymology (but the typesetter hopefully
+% does!).
+%
+% \subsubsection{The current solution}
+%
+% Even this solution proved to be inconvenient on certain *NIX
+% platforms, so Beccari resorted to another approach that uses the
+% \babel\ active character |"| and relies on the category
+% code of the character that follows |"|.
+%
+% \changes{italian-1.2n}{2000/02/02}{Completely new etymological
+% hyphenation facility}
+% \changes{italian-1.3g}{2014/01/22}{The active double straight
+% quote conflicts with other packages; set as an optional facility.}
+% Instead of a boolean switch we use a private counter so as to check
+% at |\begin{document}| if this facility has to be activated. The default
+% value is zero; anything different from zero means that the facility
+% has to be activated; this is done with command |\setactivedoublequote|
+% to be issued before |\begin{document}|
+%
+% \begin{macrocode}
+\newcount\it@doublequoteactive \it@doublequoteactive=\z@
+\def\setactivedoublequote{\it@doublequoteactive=\@ne}
+{\catcode`"=12 \global\let\it@doublequote"}
+{\catcode`"=13 \global\let\it@@dqactive"}
+\AtBeginDocument{%
+ \unless\ifnum\it@doublequoteactive=\z@
+ \initiate@active@char{"}%
+ \addto\extrasitalian{\bbl@activate{"}\languageshorthands{italian}}%
+% \end{macrocode}
+% \begin{macro}{\it@cwm}
+% The active character |"| is now defined for language |italian| so
+% as to perform different actions in math mode compared to text
+% mode; specifically in math mode a double quote is inserted so as
+% to produce a double prime sign, while in text mode the temporary
+% macro |\it@next| is defined so as to defer any further action
+% until the next token category code has been tested.
+% \begin{macrocode}
+ \declare@shorthand{italian}{"}{%
+ \ifmmode
+ \def\it@next{''}%
+ \else
+ \def\it@next{\futurelet\it@temp\it@cwm}%
+ \fi
+ \it@next
+ }%
+\fi
+% \end{macrocode}
+% The following statement must be conditionally executed after the above
+% modification of the |\extraasitalian| list; in facts at the ``begin
+% document'' execution the main language has already been set without
+% the above modifications; therefore nothing takes place unless the
+% Italian main language is selected again with the explicit command
+% |\selectlanguage| without this trick the active double quotes would
+% remain inactive; of course |\languagename| contains the string |italian|
+% if this language was the main one; by testing this string, the suitable
+% command may be issued again with the new settings and the double quotes
+% become really active. Thanks to Davide Liessi for reporting this bug.
+% \begin{macrocode}
+\ifdefstring{\languagename}{italian}{\selectlanguage{italian}}{\relax}
+}%
+% \end{macrocode}
+% \begin{macro}{\it@cwm}
+% The \cs{it@next} service control sequence is such that upon its
+% execution a temporary variable \cs{it@temp} is made equivalent to
+% the next token in the input list without actually removing it.
+% Such temporary token is then tested by the macro \cs{it@cwm}
+% and if it is found to be a letter token (cathode=11), then it
+% introduces a compound word separator control sequence
+% \cs{it@allowhyphens} whose expansion introduces a discretionary
+% hyphen and an unbreakable zero space;
+% otherwise the token is not a letter; then it is therefore
+% tested against \verb=|=$_{12}$: if so a compound word separator
+% is inserted and the \verb=|= token is removed;
+% otherwise two other tests are performed to see if guillemets
+% have to be inserted, and in case a suitable intelligent
+% guillemet macro is introduced that gobbles unwanted leading
+% or trailing spaces;
+% otherwise a test is made to see if the next char is a slash
+% character, and in case a special discretionary break is inserted
+% such as to maintain the slash while allowing the hyphenation
+% of both words before and after the slash;
+% otherwise another test is performed to see if another
+% double quote sign follows: in this case a double open quote
+% mark is inserted;
+% otherwise another test is made to see if a connecting hyphen char
+% follows, and in this case the hyphen char is substituted with
+% a discretionary break that allows hyphenation of both words
+% before and after the hyphen char;
+% otherwise nothing is done.
+%
+% The double quote shorthand for inserting a double open quote sign
+% is useful for people who are inputting Italian text by means of
+% an Italian keyboard which unfortunately misses the grave or
+% backtick key.
+% The shorthand |""| becomes equivalent to |``| for inserting
+% raised open high double quotes.
+% \begin{macrocode}
+\def\it@@cwm{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}%
+\def\it@@slash{\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}%
+\def\it@@trattino{\bbl@allowhyphens\discretionary{-}{}{-}\bbl@allowhyphens}%
+\def\it@@ocap#1{\it@ocap}\def\it@@ccap#1{\it@ccap}%
+\DeclareRobustCommand*{\it@cwm}{\let\it@@next\it@doublequote
+\ifcat\noexpand\it@temp a%
+ \def\it@@next{\it@@cwm}%
+\else
+ \if\noexpand\it@temp \string|%
+ \def\it@@next{\it@@cwm\@gobble}%
+ \else
+ \if\noexpand\it@temp \string<%
+ \def\it@@next{\it@@ocap}%
+ \else
+ \if\noexpand\it@temp \string>%
+ \def\it@@next{\it@@ccap}%
+ \else
+ \if\noexpand\it@temp\string/%
+ \def\it@@next{\it@@slash\@gobble}%
+ \else
+ \ifcat\noexpand\it@temp\noexpand\it@@dqactive
+ \def\it@@next{``\@gobble}%
+ \else
+ \if\noexpand\it@temp\string-%
+ \def\it@@next{\it@@trattino\@gobble}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+\fi
+\it@@next}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{sloppypar}
+% By this definition of |"| if one types |macro"istruzione| the
+% possible break points become \textsf{ma-cro-istru-zio-ne}, while
+% without the |"| mark they would be \textsf{ma-croi-stru-zio-ne},
+% according to the phonetic rules such that the |macro| prefix is
+% not taken as a unit.
+% A chemical name such as \texttt{des"clor"fenir"amina"cloridrato}
+% is breakable as \textsf{des-clor-fe-nir-ami-na-clo-ri-dra-to}
+% instead of \textsf{de-sclor-fe-ni-ra-mi-na-\dots}
+%
+% In other language description files a shorthand is defined so as
+% to allow a break point without actually inserting any hyphen
+% sign; examples are given such as \mbox{entrada/salida}; actually
+% if one wants to allow a breakpoint after the slash, it is much
+% clearer to type |\slash| instead of |/| and \LaTeX\ does
+% everything by itself; here the shorthand |"/| was introduced to
+% stand for |\slash| so that one can type |input"/output| and allow
+% a line break after the slash.
+% This shorthand works only for the slash, since in Italian such
+% constructs are extremely rare.
+% \end{sloppypar}
+%
+% Attention: the expansion of |"| takes place before the actual
+% expansion of OT1 or T1 accented sequences such as |\`{a}|;
+% therefore this etymological hyphenation facility works as it
+% should only when the semantic word fragments \textit{do not
+% start} with an accented letter; this in Italian is always
+% avoidable, because compulsory accents fall only on the last
+% vowel, but it may be necessary to mark a compound word where one
+% or more components come from a foreign language and contain
+% diacritical marks according to the spelling rules of that
+% language. In this case the special shorthand \verb!"|! may be
+% used that performs exactly as |"| normally does, except that the
+% \verb!|! sign is removed from the token input list:
+% \verb!kilo"|\"orsted! gets hyphenated as
+% \texttt{ki-lo-\"or-sted}; but also
+% \texttt{kilo\string"\string|\"orsted} gets hyphenated correctly
+% as \texttt{ki-lo-\"or-sted} The \verb="|= macro is necessary
+% because, even with a suitable option specified to the |inputenc|
+% package, the letter `\"o' does not have category code 11, as the ASCII
+% letters do, because of the LICR (LaTeX Internal Character
+% Representation), i.e. the set of intermediate macros that have to be
+% expanded in order to fetch the proper glyph in the output font.
+%
+% \changes{italian-1.2l}{1999/04/05}{Added useful macros for
+% fulfilling ISO 31/XI regulations}
+%
+% \subsection{Facilities required by the ISO 31/XI regulations}
+% The ISO 31/XI regulations require that units of measure are
+% typeset in upright font in both math and text, and
+% that in text mode they are separated from the numerical
+% indication of the measure with an unbreakable (thin) space.
+% The command |\unit| that was defined for achieving this
+% goal happened to conflict with the homonymous command defined by the
+% |units.sty| package; we therefore need to test if that package
+% has already been loaded so as to avoid conflicts; we assume that
+% if the user loads that package, s/he wants to use that package
+% facilities and command syntax.
+%
+% Actually there are around several packages that help to typeset
+% units of measure in the proper way; besides |units.sty| there are also
+% |SIunits| and |siunitx.sty|; the latter nowadays offers the best
+% performances in this domain. Therefore we keep controlling the
+% possibility that |units.sty| has been loaded just for backwards
+% compatibility, but we must do the same with |SIunits| and
+% |siunitx.sty|. In order to avoid the necessity o loading packages
+% in a certain order, we delay the test until |\begin{document}|.
+%
+% The same ISO regulations require also that super and subscripts
+% (apices and pedices) are in upright font, \emph{not in math
+% italics}, when they represent ``adjectives'' or appositions to
+% mathematical or physical variables that do not represent
+% countable or measurable entities: for example,
+% $V_{\mathrm{max}}$ or $V_{\mathrm{rms}}$ for a maximum voltage or
+% a root mean square voltage, compared to $V_i$ or $V_T$ as the $i$-th
+% voltage in a set, or a voltage that depends on the thermodynamic
+% temperature $T$. See \cite{Becc2} for a complete description of
+% the ISO regulations in connection with typesetting.
+%
+% More rarely it happens to use superscripts that are not
+% mathematical variables, such as the notation
+% $\mathbf{A}^{\!\mathrm{T}}$ to denote the transpose of matrix
+% $\mathbf{A}$; text superscripts are useful also as ordinals or
+% in old fashioned abbreviations in text mode; for example the
+% feminine ordinal $1^{\mathrm{a}}$ or the old fashioned obsolete
+% abbreviation F$^{\mathrm{lli}}$ for \mbox{Fratelli} in company
+% names (compare with ``Bros.'' for \underline{Bro}ther\underline{s}
+% in American English); text subscripts are mostly used in logos.
+%
+% \begin{macro}{\unit}
+% \begin{macro}{\ap}
+% \begin{macro}{\ped}
+% \begin{macro}{\setISOcompliance}
+% First we define the new (internal) commands |\bbl@unit|, |\bbl@ap|,
+% and |\bbl@ped| as robust ones.
+% \changes{italian-1.3}{2013/09/27}{Added testing to avoid conflicts
+% with the units.sty and siunitx.sty packages}
+% \changes{italian-1.3g}{2014/01/22}{Besides controlling conflicts with
+% units, siunitx, this facility is deactivated by default, and activated
+% only if the user wants to}
+% This facility is deactivated by default according to the contents of
+% an internal counter and the setting of the activation command by the
+% user; commands for apices and pedices remain available in any case.
+% \begin{macrocode}
+\newcount\it@ISOcompliance \it@ISOcompliance=\z@
+\def\setISOcompliance{\it@ISOcompliance=\@ne}
+\AtBeginDocument{\unless\ifnum\it@ISOcompliance=\z@%
+\def\activate@it@unit{\DeclareRobustCommand*{\bbl@it@unit}[1]{%
+ \textormath{\,\textup{##1}}{\,\mathrm{##1}}}}
+\@ifpackageloaded{units}{}{\@ifpackageloaded{siunitx}{}{%
+ \@ifpackageloaded{SIunits}{}{%
+ \activate@it@unit\addto\extrasitalian{%
+ \babel@save\unit\let\unit\bbl@it@unit}%
+ }}}\ifcsstring{bbl@main@language}{italian}{\selectlanguage{italian}}{}%
+\fi}
+\DeclareRobustCommand*{\bbl@it@ap}[1]{%
+ \textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
+\DeclareRobustCommand*{\bbl@it@ped}[1]{%
+ \textormath{$_{\mbox{\fontsize\sf@size\z@
+ \selectfont#1}}$}{_\mathrm{#1}}}%
+% \end{macrocode}
+% Then we can use |\let| to define the user level commands, but in
+% case the macros already have a different meaning before entering
+% in Italian mode typesetting, we first save their meaning so
+% as to restore them on exit.
+% \begin{macrocode}
+\addto\extrasitalian{%
+ \babel@save\ap\let\ap\bbl@it@ap
+ \babel@save\ped\let\ped\bbl@it@ped
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Intelligent comma}\label{ssec:comma}
+%
+% We need to perform some tests that require some
+% smart control-sequence handling; therefore we call the |etoolbox|
+% package that allows us more testing functionality. There are no problems
+% with this package that can be invoked also by other ones before or
+% after |babel| is called; the |\RequirePackage| mechanism is sufficiently
+% smart to avoid reloading the same package more than once. But we
+% have to delay this call, because |italian.ldf| is being read while
+% processing the options passed to |babel|, and while options are being
+% scanned and processed it is forbidden to load packages; we
+% delay it at the end of processing the |babel| package itself.
+% \begin{macrocode}
+\AtEndOfPackage{\RequirePackage{etoolbox}}
+% \end{macrocode}
+%
+% \begin{macro}{\IntelligentComma}
+% \begin{macro}{\NoIntellgentComma}
+% This feature is optional, in the sense that it is necessary to issue
+% a specific command to activate it; actually this functionality is
+% activated or, respectively, deactivated with the self explanatory
+% commands |\IntelligentComma| and |\NoIntelligentComma|. They operate
+% by setting or resetting the comma sign as an active character in
+% mathematics. We defer the definition of the commands that turn on and
+% off the intelligent comma feature at the end of the preamble, so as to
+% avoid possible conflicts with other packages. It has already been
+% pointed out that this procedure for setting up the active comma to
+% behave intelligently in math mode, conflicts with the |dcolumn|
+% package; therefore we assume these commands are defined when the final
+% user typesets a document, but they will be possibly defined only at
+% the end of the preamble when it will be known if the |dcolumn| package
+% has been loaded. We do the same if packages |icomma| or |ncccomma|
+% have been loaded, since that assumes that the user wants to use their
+% functionality, not the functionality of this package.
+%
+% We need a command to set the comma as an active charter only in math
+% mode; the special |\mathcode| that classifies an active character in
+% math is the hexadecimal value |"8000|. By default we set the
+% punctuation type of comma, but we let |\IntelligentComma| and
+% |\NoIntelligentComma| to |\relax| so that their use is forbidden when
+% one of the named packages is loaded. In this way all known conflicts
+% are avoided; should the user find out other conflicts, s/he is kindly
+% required to notify it to the maintainer.
+% \begin{macrocode}
+\AtEndOfPackage{\AtEndPreamble{%
+\newcommand*\IntelligentComma{\mathcode`\,=\string"8000}% Active comma
+\newcommand*\NoIntelligentComma{\mathcode`\,=\string"613B}% Punctuation comma
+\@ifpackageloaded{icomma}{\let\IntelligentComma\relax
+ \let\NoIntelligentComma\relax}{%
+ \@ifpackageloaded{ncccomma}{\let\IntelligentComma\relax
+ \let\NoIntelligentComma\relax}{%
+ \@ifpackageloaded{dcolumn}{\let\IntelligentComma\relax
+ \let\NoIntelligentComma\relax}{%
+ \@ifpackageloaded{polyglossia}{%
+ \ifcsstring{xpg@main@language}{english}{\relax}{%
+ \mathcode`\,=\string"613B}
+ }{%
+ \ifcsstring{languagename}{english}{\relax}{%
+ \mathcode`\,=\string"613B}
+ }%
+ }}}%
+}}
+% \end{macrocode}
+% These commands are defined only in the |babel| support for the Italian
+% language (this file) and are not defined in the corresponding
+% |polyglossia| support for the language.
+% In order to have this functionality work properly with pdfLaTeX,
+% XeLaTeX, and LuaLaTeX, it is necessary to discover which engine
+% is being used, or better, which language handling package is
+% being used: |babel| or |polyglossia|? Let us remember that testing
+% the actual engine, as it would be possible with package |iftex|,
+% does not tell the whole truth, because LuaLaTeX and XeLaTeX behave
+% in a similar way for what concerns language handling since they can
+% use both |babel| and |polyglossia| (obviously not at the same time);
+% so the use of |babel| or |polyglossia| is the real discriminant
+% factor, not the typesetting engine.
+%
+% \begin{macro}{\virgola}
+% \begin{macro}{\virgoladecimale}
+% We need two kinds of comma, one that is a decimal separator, and
+% a second one that is a punctuation mark.
+% \begin{macrocode}
+ \DeclareMathSymbol{\virgola}{\mathpunct}{letters}{"3B}
+ \DeclareMathSymbol{\virgoladecimale}{\mathord}{letters}{"3B}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{italian-1.3a}{2013/10/02}{Corrected the bug of the intelligent
+% comma when used within the AMS alignment environments}
+%
+% Math comma activation is done only after the preamble has been
+% completed, that is after the |\begin{document}| statement has been
+% completely executed. Now we must give a definition to the active
+% comma: probably it is not necessary to pass through an intermediate
+% robust command, but certainly it is not wrong to do it.
+% \begin{macrocode}
+\DeclareRobustCommand*\it@comma@def{\futurelet\let@token\@@math@comma}%
+{\catcode `,=\active \gdef,{\it@comma@def}}%
+% \end{macrocode}
+% The real work shall be performed by |\it@comma@def|. In facts the
+% above macro stores the token that immediately follows |\@@math@comma|
+% into a temporary control sequence that behaves as an implicit
+% character if that token is a single character, even a space, or
+% behaves as an alias of a control sequence otherwise. Actually at the
+% end of the preamble this macro shall be |\let| to be an alias for the
+% real |\@math@comma|.
+%
+% Is is important to remark that |\@math@comma| must be a command that
+% does not require arguments; this makes it robust when it is followed
+% by other characters that may play special r\^oles within the arguments
+% of other macros or environments. Matter of fact the first version
+% of this file in version 1.3 did accept an argument; and the result was
+% that the active comma would ``eat up'' the |&| in vertical math
+% alignments and very nasty errors took place, especially within the
+% |amsmath| defined ones. This macro |\@@math@comma| without arguments
+% does not do any harm to the AMS environments and the actual
+% intelligent comma work shall be executed by other macros.
+%
+% At this point the situation may become complicated: the comma
+% character in the input file may be followed by a real digit, by an
+% analphabetic character of category 12 (other character), by an
+% implicit digit, by a macro defined to be a digit, by a macro that is
+% not defined to be a digit, by a special character (for example a
+% closed brace, an alignment command, et cetera); therefore it is
+% necessary to distinguish all these situations; remember that an
+% implicit digit cannot be used as a real digit, and a macro gets
+% expanded when used with any |\if| clause, unless it is a |\ifx| one,
+% or is prefixed with |noexpand|. The tests that are going to be made
+% are therefore of different kinds, according to this scheme:
+% \begin{itemize}
+% \item
+% the |\let@token| is tested against an asterisk to see it it is of
+% category 12; this is true if the token is a real digit, or an implicit
+% digit, or an analphabetic character;
+% \begin{itemize}
+% \item
+% an implicit digit is represented by a control sequence; so we
+% first check this feature;
+% \item
+% if it is a control sequence, we have to test its nature of a
+% digit by testing if it represented one of the ten digits;
+% \item otherwise it is an analphabetic character.
+% \end{itemize}
+% \item
+% otherwise the |\let@token| is a special character or a
+% macro/command;
+% \item
+% a test is made to see if it is a macro; in this case we check
+% if has been defined to be a digit,
+% \item
+% it is not a macro, it must be some other kind of token for
+% example a space or another special character.
+% \end{itemize}
+%
+% Notice that if the token is a macro, we do not test if it is defined
+% to be a single digit or a string made up of more digits and/or other
+% charters. If the macro represents one digit the test is correct,
+% otherwise funny results may take place. For this reason it is always
+% better to prefix any macro with a space, whatever its definition might
+% be; if the macro represents a parameter defined to have a variable
+% value in the range 0--9, then it may represent the fractional part of
+% a (short) decimal value, and it is correct to avoid prefixing it with
+% a space; but the user is warned not to make use of numeric strings in
+% the definition of parameters, unless he knows what he is doing.
+% The user may rather use a balanced brace comma group |{,}| in the
+% input file so that the macro will not be considered by the expansion
+% of the active comma. For example if |\x| is defined to be the
+% numerical string |89|, the source input |$2{,}\x$| will be correctly
+% typeset as 2,89; the input \verb*!$2, \x$! will be typeset as 2,\,89
+% (with an unbreakable thin space after the comma) while |$2,\x$| will
+% be typeset as 29,89, obviously wrong.
+%
+% So first we test if the comma must act intelligently; if the counter
+% |\Virgola| contains zero, we assume that the comma must always perform
+% as a punctuation mark; but if we want to distinguish if it must behave
+% as a decimal separator, we have to perform more delicate tests; this
+% latter task is demanded to other macros with arguments |\@math@@comma|
+% and |\@@math@@comma|. In order to make the various tests robust we
+% have to resort to the usual trick of the auxiliary macros
+% |\@firstoftwo| and |\@secondoftwo| and various |\expandafter| commands
+% so as to be sure that every |\if| clause is correctly exited without
+% leaving any trace behind.
+% \begin{macrocode}
+\DeclareRobustCommand*\@math@comma{%
+ \ifcat\noexpand\let@token*%
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi{% \let@token is of category 12
+ \@math@@comma
+ }{% test if \let@token is a macro
+ \ifcat\noexpand\let@token\noexpand\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi{% it is a macro
+ \@@math@@comma
+ }{% it is something else.
+ \virgola
+ }
+ }
+}
+% \end{macrocode}
+%
+% In particular this macro must test if the argument has category
+% code 12, that is ``other character'', not a letter, nor other
+% special signs, as |&| for example. In case the category code is
+% not 12, the comma must act as a punctuation mark; but if it is,
+% it might be a digit, or another character, an asterisk, for example;
+% so we have to test its digit nature; the simplest that was found
+% to test if a token is a digit, is to test its ASCII code against
+% the ASCII codes of `0' (zero) and `9'.
+% The typesetting engines give the backtick, |`|, the property that
+% when a number is required, it yields the ASCII code if the following
+% token in an explicit character or a macro argument; this is why we
+% can't use the temporary implicit token we just tested, but we must
+% examine the first non blank token that follows the |\@math@@comma|
+% macro. Only if the token is a digit, we use the decimal comma,
+% otherwise the punctuation mark. This is therefore the definition of
+% the |\@math@@comma| macro which is not that simple, although the
+% testing macros have clear meanings:
+% \begin{macrocode}
+\DeclareRobustCommand*\@math@@comma[1]{% argument is certainly of category 12
+ \ifcsundef{\expandafter\@gobble\string #1}{% test if it is a real digit
+ \ifnumless{`#1}{`0}{\virgola}%
+ {\ifnumgreater{`#1}{`9}{\virgola}%
+ {\virgoladecimale}}%
+ }{% it's an implicit character of category 12
+ \let\@tempVirgola\virgola
+ \@tfor\@tempCifra:=0123456789\do{%
+ \expandafter\if\@tempCifra#1\let\@tempVirgola\virgoladecimale
+ \@break@tfor\fi}\@tempVirgola
+ }#1}
+
+\DeclareRobustCommand*\@@math@@comma[1]{% argument is a macro
+ \let\@tempVirgola\virgola
+ \@tfor\@tempCifra:=0123456789\do{%
+ \if\@tempCifra#1\let\@tempVirgola\virgoladecimale
+ \@break@tfor\fi}\@tempVirgola#1
+}
+% \end{macrocode}
+% The service macros |\ifcsundef|, |\ifnumless|, and |\ifnumgreater| are
+% provided by the |etoolbox| package, that shall be read at most at the
+% end of the |babel| package processing; therefore we must delay the
+% code at ``end preamble'' time, since only at that time
+% it will be known if the main language is English, or any other one.
+% This is why we have to perform such a baroque definition as the
+% following one:
+% \begin{macrocode}
+\AtEndOfPackage{\AtEndPreamble{\let\@@math@comma\@math@comma}}
+% \end{macrocode}
+% This intelligent comma definition is pretty intelligent, but it
+% requires some kind of information from the context; this context does
+% not give enough bits of information to this `intelligence' in just one
+% case: when the comma plays the r\^ole of a serial separator in
+% expressions such as $i=1, 2, 3,\dots,\infty$, entered as
+% \verb*?$i=1, 2, 3,\dots,\infty$?. Only in this case the comma must
+% be followed by an explicit space; should this space be absent the
+% macro takes the following non blank token as a digit, and since it
+% actually is a digit, it would use the decimal comma, which
+% would be wrong. The control sequences |\dots| and |\infty| are
+% tested to see if they are undefined, and since they are defined and
+% do not represent digits, the macro inserts a punctuation mark,
+% instead of a decimal separator.
+%
+% Notice that this macro may appear to be inconsistent with the contents
+% of a language description file. I don't agree: matter of facts even
+% math is part of typesetting a text in a certain language.
+% Does this set of macros influence other language description files?
+% May be, but I think that the clever use of macros |\IntelligentComma|
+% and |\NoIntellingentComma| may solve any interference; they allow to
+% use the proper mark even if the Italian language is not the main
+% language, the important point is to turn the switch on and/or off.
+% By default it is off, so there should not be any interference even
+% with legacy documents typeset in Italian.
+%
+% Notice that there are other packages that contain facilities for
+% using the decimal comma as the correct decimal separator; for
+% example |SIunitx| defines a command |\num| that not only correctly
+% spaces the decimal separator, but also can change the input glyph
+% with another one, so that it is possible to copy and paste numbers
+% from texts in English (with the decimal point) and paste them
+% into the argument of the |\num| macro in an Italian document where
+% the decimal point is changed automatically into a decimal comma. Of
+% course |SIunitx| does much more than that; if it's being loaded,
+% then the default |\NoIntelligentComma| declaration disables the
+% functionality defined in this language description file and the
+% user can do what he desires with the many functionalities of that
+% package.
+%
+% Apparently a conflict with the active comma arises with the D column
+% defined by the |dcolomn| package. Disabling the “Italian” active comma
+% allows the D column operate correctly. Thanks to Giuseppe Toscano for
+% telling me about this conflict.
+% \end{macro}
+% \end{macro}
+%
+% \subsection*{Accents}\label{s:itkbd}
+% Most of the other language description files introduce a number
+% of shorthands for inserting accents and other language specific
+% diacritical marks in a more comfortable way compared with the
+% lengthy standard \TeX\ conventions. When an Italian keyboard is
+% being used on a Windows based platform, it exhibits such
+% limitations that to my best knowledge no convenient shorthands have
+% been developed; the reason lies in the fact that the Italian keyboard
+% lacks the grave accent (also known as ``backtick''), which is
+% compulsory on all accented vowels, but, on the
+% opposite, it carries the keys with all the accented \emph{lowercase}
+% vowels \`a, \`e, \'e, \`i, \`o, \`u, bot no \emph{uppercase} accented
+% vowels are directly avalaible from the keyboard; the keyboard lacks
+% also the tie |~| (tilde) key, while the curly braces require pressing
+% three keys simultaneously.
+%
+% The best solution Italians have found so far is to use a smart
+% editor that accepts shorthand definitions such that, for example,
+% by striking |"(| one gets directly |{| on the screen and the same
+% sign is saved into the \file{.tex} file; the same smart editor
+% should be capable of translating the accented characters into the
+% standard \TeX\ sequences when writing a file to disk (for the
+% sake of file portability), and to transform the standard \TeX\
+% sequences into the corresponding signs when loading a \file{.tex}
+% file from disk to memory. Such smart editors do exist and can be
+% downloaded from the \textsc{ctan} archives.
+%
+% \changes{italian-1.2p}{2002/07/10}{Removed redefinition of \cs{add@acc}
+% since its functionality has been introduced into the kernel of LaTeX
+% 2001/06/01}
+%
+% For what concerns the missing backtick key,
+% which is used also for inputting the open quotes, it must be
+% noticed that the shorthand |""| described above completely solves
+% the problem for \textit{double} raised open quotes; besides this,
+% a single open raised quote may be input whit the little known
+% \LaTeX\ kernel command |\lq|; according to
+% the traditions of particular publishing houses, since there are
+% no compulsory regulations on the matter, the guillemets
+% may be used; in this case the T1 font encoding solves the problem
+% by means of its built in ligatures |<<| and |>>|; such ligatures
+% are also available when using OpenType fonts with XeLaTeX and
+% LuaLaTeX, provided they are loaded with the option
+% \texttt{Ligatures = TeX}. But\dots
+%
+% \subsection*{\emph{Caporali} or French double quotes}
+% Although the T1 font encoding ligatures solve the problem, there
+% are some circumstances where even the T1 font encoding cannot be
+% used, either because the author\slash typesetter wants to use the
+% OT1 encoding, or because s/he uses a font set that does
+% not comply completely with the T1 font encoding; some virtual
+% fonts, for example, are supposed to implement the double Cork
+% font encoding but actually miss some glyphs; one such virtual
+% font set is given by the \texttt{ae} virtual fonts, because they
+% are supposed to implement such double font encoding by using
+% virtual fonts that map the |CM| fonts to a T1 font scheme; the
+% type~1 PostScript version of the |CM| fonts do exist, therefore
+% one believes to be able of using them with pdfLaTeX; but since
+% the |CM| fonts do not contain the guillemets, neither the |AM|
+% ones do.
+% Since guillemets (in Italian \emph{caporali}) do not exist in
+% any OT1 encoded \texttt{cm} Latin font, their glyphs must be
+% substituted with something else that fakes them.
+%
+% \changes{italian-1.2q}{2005/02/05}{Redefined the caporali machinery
+% so as to avoid incompatibilities with the slides class, as there
+% are no Cyrillic slides fonts as there are for Latin script}
+% \changes{italian-1.3}{2013/09/30}{The slide font fix up is not any
+% more necessary with the new caporali handling method.}
+%
+% In the previous versions of this language description file the
+% absent guillemets were faked with other fonts, by taking example
+% from the solution the French had found for their language
+% description file; they would get suitable guillemets from the
+% cyrillic fonts; this solution was good in most cases, except when
+% the ``slides fonts'' were used, because there is no Cyryllic slide
+% font around.
+%
+% This might seem a negligible ``feature'' because the modern classes
+% or extension modules to produce slides mostly avoid the ``old'' fonts
+% for slides created by Leslie Lamport when he made available the macro
+% package LaTeX to the TeX community.
+%
+% Since I designed renewed slide fonts extending those
+% created by Leslie Lamport to the T1 encoding, the Text Companion
+% fonts, and the most frequent ``regular'' and AMS math fonts with the
+% same graphic style and excellent legibility (LXfonts), I thought that
+% this feature is not so negligible. It's true that nowadays nobody
+% should use the old OT1 encoding when typesetting in any language,
+% English included, because independently form the document main
+% language, it is very frequent to quote passages in other languages,
+% or to type foreign proper names of persons or places; nevertheless
+% having in mind a minimum of backwards compatibility and hoping
+% that the deliberate use of OT1 encoding (still necessary to typeset
+% mathematics) is being abandoned, I decided to simplify the previous
+% handling of guillemets.
+%
+% Therefore here I will test at ``begin document'' only if the OT1
+% encoding is the default one, while if the T1 encoding is the default
+% one, that the font collection |AE| is not being used; should
+% it be the case, I will substitute the guillemets with the LaTeX
+% special symbols reduced to script size, and I will not try to fake
+% the guillemets with better solutions; evidently if OpenType fonts
+% are being used, nothing is done; so the tests that follow concern
+% only typesetting old documents or the lack of a wiser choice of fonts
+% and their encodings; an info message is issued and output to the
+% |.log| file.
+%
+% \begin{macro}{\LtxSymbCaporali}
+% \begin{macro}{\it@ocap}
+% \begin{macro}{\it@ccap}
+% First the macro |\LtxSymvCaporali| is defined so as to assign a
+% default definition of the faked guillemets: each one of these macro
+% sets actually redefines the control sequences |\it@ocap| and
+% |\it@ccap| that are the ones effectively activated by the shorthands
+% |"<| and |">|.
+% By default the caporali glyphs are taken from T1-encoded fonts; at
+% the end of the preamble some tests are performed to control if the
+% default fonts contain such glyphs, and in case a different font is
+% chosen.
+% \begin{macrocode}
+\def\LtxSymbCaporali{%
+ \DeclareRobustCommand*{\it@ocap}{\mbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}%
+ \ignorespaces}%
+ \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi
+ \mbox{%
+ \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}%
+}%
+\def\T@unoCaporali{\DeclareRobustCommand*{\it@ocap}{<<\ignorespaces}%
+ \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi>>}}%
+\T@unoCaporali
+% \end{macrocode}
+% Nevertheless a macro for choosing where to get glyphs for real
+% guillemets is offered; the syntax is the following:
+% \begin {flushleft}
+% |\CaporaliFrom|\marg{encoding}\marg{family}\marg{open guill. slot}%
+% \marg{close guill. slot}
+% \end{flushleft}
+% where \meta{encoding} and \meta{family} identify the font family
+% name of that particular encoding from which to get the missing
+% guillemets; \meta{open guill. slot} and \meta{close guill. slot}
+% are the (preferably) decimal slot addresses of the opening and
+% closing guillemets the user wants to use. For example if the
+% T1-encoded Latin Modern fonts are desired, the specific command
+% should be
+% \begin {flushleft}
+% |\CaporaliFrom{T1}{lmr}{19}{20}|
+% \end{flushleft}
+% These user choices might be necessary for assuring the correct
+% typesetting
+% with fonts that contain the required glyphs and are available
+% also in PostScript form so as to use them directly with {pdfLaTeX},
+% for example.
+% \begin{macrocode}
+\def\CaporaliFrom#1#2#3#4{%
+ \DeclareFontEncoding{#1}{}{}%
+ \DeclareTextCommand{\it@ocap}{T1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\it@ccap}{T1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}%
+ \DeclareTextCommand{\it@ocap}{OT1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\it@ccap}{OT1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
+% \end{macrocode}
+% Notice that the above macro is strictly tied to the T1 encoding;
+% it won't do anything if the default encoding is not the T1 one.
+% Therefore if the |AE| font collection is being used it would be
+% good idea to issue the command shown above as an example in order
+% to get the proper guillemets\footnote{Actually the \texttt{AE}
+% fonts should not be used at all; the same results, more or less
+% are obtained by using the Latin Modern ones, that are not virtual
+% fonts and contain the whole T1 font scheme. Nevertheless the faked
+% glyphs are not so bad, so the solution I restored from old versions
+% of the language description file is acceptable}.
+
+% Then we set a boolean variable and test the default family;
+% if such family has a name that starts with the letters ``ae''
+% then we have no built in guillemets; of course if the AE font family
+% is chosen after the \babel\ package is loaded, the test does not
+% perform as required.
+% \begin{macrocode}
+\def\get@ae#1#2#3!{\def\bbl@ae{#1#2}}%
+\def\@ifT@one@noCap{\expandafter\get@ae\f@family!%
+\def\bbl@temp{ae}\ifx\bbl@ae\bbl@temp\expandafter\@firstoftwo\else
+ \expandafter\@secondoftwo\fi}%
+% \end{macrocode}
+% Now we can set some real settings; first we start by testing
+% the encoding; if the encoding is OT1 we set the faked caporali
+% with LaTeX symbols and issue a warning; then we test if the font
+% family is the AE one we set again the faked caporali and issue
+% another warning\footnote{Notice the it is impossible to check
+% if the slots 19 and 20 of the AE fonts are defined by means of
+% the eTeX macro \texttt{\char92iffontchar}, because they are
+% actually defined as black squares!}; otherwise we set the commands
+% valid for the T1 encoding, that work well also with the TeX
+% Ligatures of the OpenType fonts.
+% \begin{macrocode}
+\AtBeginDocument{\normalfont\def\bbl@temp{OT1}%
+ \ifx\cf@encoding\bbl@temp
+ \LtxSymbCaporali
+ \GenericWarning{italian.ldf\space}{%
+ File italian.ldf warning: \MessageBreak\space\space\space
+ With OT1 encoding guillemets are poorly faked\MessageBreak
+ \space\space\space
+ Use T1 encoding\MessageBreak\space\space\space
+ or specify a font with command \string\CaporaliFrom\MessageBreak
+ \space\space\space
+ See the documentation concerning the babel-italian typesetting
+ \MessageBreak\space\space}%
+ \else
+ \ifx\cf@encoding\bbl@t@one
+ \@ifT@one@noCap{%
+ \LtxSymbCaporali
+ \GenericWarning{italian.ldf\space}{%
+ File italian.ldf warning: \MessageBreak\space\space\space
+ The AE font collection does not contain the guillemets
+ \MessageBreak\space\space\space
+ Use the Latin Modern font collection instead
+ \MessageBreak\space}
+ }%
+ {\T@unoCaporali}\fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection*{Finishing commands}
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{italian-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{italian}%
+% \end{macrocode}
+%\iffalse
+%</code>
+%\fi
+%
+% \Finale
+%%
+%%
+%% \endinput
diff --git a/macros/latex/contrib/babel-contrib/italian/italian.pdf b/macros/latex/contrib/babel-contrib/italian/italian.pdf
new file mode 100644
index 0000000000..ecb435c1f3
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/italian/italian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/japanese/Makefile b/macros/latex/contrib/babel-contrib/japanese/Makefile
new file mode 100644
index 0000000000..a9d9212709
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/Makefile
@@ -0,0 +1,32 @@
+# Makefile for babel-japanese
+# Note that all files are UTF-8 (without BOM) encoded!
+
+STRIPTARGET = japanese.ldf japanese-sample.tex
+PDFTARGET = japanese.pdf japanese-sample.pdf
+DVITARGET = japanese.dvi japanese-sample.dvi
+KANJI = --kanji=utf8
+FONTMAP = -f ptex-ipaex.map -f ipaex.map
+
+default: $(STRIPTARGET) $(DVITARGET)
+strip: $(STRIPTARGET)
+all: $(STRIPTARGET) $(PDFTARGET)
+
+japanese.ldf: japanese.dtx
+ platex $(KANJI) japanese.ins
+
+japanese.dvi: japanese.dtx
+ platex $(KANJI) japanese.dtx
+ platex $(KANJI) japanese.dtx
+
+.SUFFIXES: .tex .dvi .pdf
+.tex.dvi:
+ platex $(KANJI) $<
+ platex $(KANJI) $<
+.dvi.pdf:
+ dvipdfmx $(FONTMAP) $<
+
+.PHONY: clean
+clean:
+ rm -f \
+ japanese.ldf japanese-sample.tex \
+ japanese.pdf japanese-sample.pdf
diff --git a/macros/latex/contrib/babel-contrib/japanese/README.md b/macros/latex/contrib/babel-contrib/japanese/README.md
new file mode 100644
index 0000000000..7e52f31134
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/README.md
@@ -0,0 +1,85 @@
+# babel-japanese
+
+The package "babel-japanese" (or shortly, "japanese" package) provides
+`japanese` option for Babel package. It defines all the language
+definition macros in Japanese.
+
+Currently this package works on pLaTeX, upLaTeX, XeLaTeX and LuaLaTeX.
+
+
+## Limitations
+
+Note that this package is not perfect: the word order in Japanese is
+different from that in most Western languages including English, so
+the words like "Part" or "Chapter" cannot be replaced with Japanese
+counterpart. This limitation is due to the design of classes.dtx
+(article.cls etc), which has \chaptername in front of the numbering
+but no sequence behind the number.
+
+The common Japanese classes including (u)jclasses in (u)pLaTeX,
+jsclasses, ltj(s)classes in LuaTeX-ja are well-supported.
+
+
+## Installation
+
+1) Process japanese.ins with some tex engine. For example, using lualatex:
+
+ lualatex japanese.ins
+
+When you use platex, give -kanji=utf8 option.
+
+ platex -kanji=utf8 japanese.ins
+
+You will get japanese.ldf (the main code) and japanese-sample.tex (sample
+document for pLaTeX).
+
+2) Process documentation, japanese.dtx and japanese-sample.tex, as you wish.
+japanese.dtx can be processed with pLaTeX, upLaTeX or LuaLaTeX.
+japanese-sample.tex is written for pLaTeX or LuaLaTeX.
+
+If you use lualatex:
+
+ lualatex japanese.dtx
+ lualatex japanese-sample.tex
+
+If you use platex:
+
+ platex -kanji=utf8 japanese.dtx
+ dvipdfmx japanese.dvi
+ platex -kanji=utf8 japanese-sample.tex
+ dvipdfmx japanese-sample.dvi
+
+3) Deploy the directory or files in an appropriate place under the TEXMF tree.
+
+ * japanese.ldf
+ => $TEXMF/tex/latex/japanese
+ * japanese.dtx
+ => $TEXMF/source/latex/japanese
+ * japanese.pdf, japanese-sample.tex, japanese-sample.pdf
+ => $TEXMF/doc/latex/japanese
+
+4) Execute mktexlsr.
+
+
+## Repository
+
+The bundle is maintained on GitHub:
+ https://github.com/texjporg/babel-japanese
+
+If you have issues, please let us know from the above page.
+
+
+## License
+
+Copyright (C) 1999-2007 by ING (Toru Inagaki)
+Copyright (C) 2016- by Japanese TeX Development Community
+
+This package is free software that can be redistributed and/or
+modified under the terms of the LaTeX Project Public License 1.3.
+
+
+## Release Date
+
+2019-04-03
+
+Japanese TeX Development Community
diff --git a/macros/latex/contrib/babel-contrib/japanese/japanese-sample.pdf b/macros/latex/contrib/babel-contrib/japanese/japanese-sample.pdf
new file mode 100644
index 0000000000..622d69cb8d
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/japanese-sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/japanese/japanese.dtx b/macros/latex/contrib/babel-contrib/japanese/japanese.dtx
new file mode 100644
index 0000000000..8a7bf5558b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/japanese.dtx
@@ -0,0 +1,590 @@
+% \iffalse meta-comment
+%
+% This file is part of the `japanese' package,
+% providing Japanese language support for Babel.
+%
+% Copyright (C) 1999--2007 by ING (Toru INAGAKI)
+% 2016--2019 by Japanese TeX Development Community
+%
+% This package 'japanese.dtx' supports the following Babel package:
+%
+% ====================================================================
+%
+% Copyright (C) 2012-2018 Javier Bezos and Johannes L. Braams.
+% Copyright (C) 1989-2012 Johannes L. Braams and
+% any individual authors listed elsewhere in this file.
+% All rights reserved.
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% ====================================================================
+%
+% \fi
+%
+% ^^A Ensure UTF-8 input encoding for pLaTeX
+% ^^A (effective since e-pTeX 20160201, thus TeX Live 2016)
+\ifx\epTeXinputencoding\undefined\else
+ \epTeXinputencoding utf8
+\fi
+%
+%\iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{japanese.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{japanese}
+%<*!sample>
+%\ProvidesFile{japanese.dtx}
+ [2019/04/03 v2.2 Japanese support for babel (texjporg)]
+%</!sample>
+%\fi
+%
+%\iffalse
+%
+%<*filedriver>
+\ifx\directlua\undefined
+ \documentclass{jltxdoc}
+\else
+ \documentclass{ltjltxdoc}
+\fi
+\GetFileInfo{japanese.dtx}
+\setcounter{StandardModuleDepth}{1}
+\CodelineNumbered
+\MakeShortVerb{\|}
+\OnlyDescription
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+%\newcommand*\Lopt[1]{\textsf{#1}}
+%\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{japanese.dtx}
+\end{document}
+%</filedriver>
+%
+%\fi
+%
+% \title{Babel-Option {\sffamily japanese} {\Large version \fileversion}}
+% \author{\copyright\ 1999--2007 ING\\ 2016-- Japanese \TeX\ Development Community}
+% \date{\filedate}
+% \maketitle
+% \baselineskip=14pt
+%
+% \section*{The Japanese language}
+%
+% \file{japanese}パッケージは日本語による見出し語と日付を出力するためのマクロを
+% 定義しています。\babel のオプションの最後で日本語を指定します。
+% \begin{quote}
+% |\usepackage[...,japanese]{babel}|
+% \end{quote}
+%
+% バージョンv2.0以降では,p\TeX{}系(p\LaTeX{},up\LaTeX{})に加えて,
+% 新しいUnicodeな\TeX{}エンジン(Xe\TeX{},Lua\TeX{})もサポートしました。
+% このため,ファイルはUTF-8エンコーディングで保存するようにしてください。
+%
+% 2016年以降,本パッケージのメンテナンスは日本語\TeX{}開発コミュニティ
+% (Japanese \TeX\ Development Community)によって行われています。開発版は
+% GitHubリポジトリ
+%\begin{verbatim}
+% https://github.com/texjporg/babel-japanese
+%\end{verbatim}
+% にあります。バグ報告は上記のリポジトリ,またはIssue Mailing List
+%\begin{verbatim}
+% issue@texjp.org
+%\end{verbatim}
+% までお願いします。
+%
+%
+% \section{この文書について}
+%
+% この文書ファイル(\jobname.pdf)自体はp\LaTeX{},up\LaTeX{},Lua\LaTeX{}で
+% 処理できるようになっています。
+%
+%
+% \section{コード}
+%
+% p\TeX{}系(p\LaTeX{},up\LaTeX{})でなく,かつUnicodeな\TeX{}(Xe\LaTeX{},
+% Lua\LaTeX{})でもない場合は,最初にエラーを出します。
+%
+% \begin{macrocode}
+%<*code>
+\ifx\kanjiskip\@undefined\ifx\directlua\@undefined
+\ifx\XeTeXversion\@undefined
+ \@latex@error{Option '\CurrentOption' requires one of the followings:\MessageBreak
+ pTeX, upTeX, XeTeX, LuaTeX\MessageBreak
+ It seems you are running unsupported engine!}\@ehc
+\fi
+\fi\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+% \DescribeMacro{\l@japanese}
+% ここでは|\l@japanese|が定義されているか否かを判断し,定義されていれば
+% 日本語用ハイフネーションパターンを読み込みます。
+% \DescribeMacro{\adddialect}
+% しかし,日本語にはハイフネーションパタンが存在しないので
+% |\adddialect|に|\l@japanese|を代入し,\file{language.dat}
+% で最初に指定した言語(言語番号0,通常は英語)のハイフネーションパターンを
+% 使用します。
+%
+% [2016-12-16] 旧バージョン(v1.3)では
+%\begin{quote}\small\begin{verbatim}
+% Package babel Warning: No hyphenation patterns were loaded for
+% (babel) the language `Japanese'
+% (babel) I will use the patterns loaded for \language=0
+% instead.
+%\end{verbatim}\end{quote}
+% という警告が出るのを無視する方針でしたが,新しい\babel では警告が
+% よりうるさくなっていました。
+%\begin{quote}\small\begin{verbatim}
+% Package babel Warning: No hyphenation patterns were preloaded for
+% (babel) the language `Japanese' into the format.
+% (babel) Please, configure your TeX system to add them and
+% (babel) rebuild the format. Now I will use the patterns
+% (babel) preloaded for english instead on input line 47.
+%\end{verbatim}\end{quote}
+% そこで,新しいバージョン(v2.0)からは警告を出さないことにして,代わりに
+% ログファイルにのみInfoを出力します。
+%
+% \begin{macrocode}
+\ifx\l@japanese\@undefined
+% \@nopatterns{Japanese}% comment out (2016-12-16)
+ \PackageInfo{babel}{%
+ No hyphenation patterns are available for Japanese,\MessageBreak
+ so I will use the patterns preloaded for \bbl@nulllanguage\MessageBreak
+ instead}
+ \adddialect\l@japanese0\fi
+% \end{macrocode}
+%
+% \DescribeMacro{\captionsjapanese}
+% |\captionsjapanese|マクロはp\LaTeX{}の標準のクラスファイルで使われる
+% 見出し語を日本語で出力します。\LaTeX{}の標準のクラスファイルでも動作
+% しますが,元が英語用ですので,語順の関係上すべてを日本語化することは
+% できません(たとえば、Part 1→第1部とは変更することは不可能です)。
+%
+% [2016-12-15] 「証明」と「用語集」も日本語化するようにしました。
+% |\postpartname| がタイポで |\postpartnam| になっていたのを直しました。
+%
+% 新しいUnicodeな\TeX{}エンジン(Xe\TeX{},Lua\TeX{})の場合は,
+% UTF-8エンコーディングで直接和文文字を記述します。
+% \begin{macrocode}
+\ifx\kanjiskip\@undefined
+ \def\bbl@jpn@prefacename{前書き}%
+ \def\bbl@jpn@refname{参考文献}%
+ \def\bbl@jpn@abstractname{概要}%
+ \def\bbl@jpn@bibname{参考文献}%
+ %\def\bbl@jpn@chaptername{Chapter}%
+ \def\bbl@jpn@prechaptername{第}% -- added
+ \def\bbl@jpn@postchaptername{章}% -- added
+ \def\bbl@jpn@presectionname{}% 第 -- added
+ \def\bbl@jpn@postsectionname{}% 節 -- added
+ \def\bbl@jpn@appendixname{付録}%
+ \def\bbl@jpn@contentsname{目次}%
+ \def\bbl@jpn@listfigurename{図目次}%
+ \def\bbl@jpn@listtablename{表目次}%
+ \def\bbl@jpn@indexname{索引}%
+ \def\bbl@jpn@figurename{図}%
+ \def\bbl@jpn@tablename{表}%
+ %\def\bbl@jpn@partname{Part}%
+ \def\bbl@jpn@prepartname{第}% -- added
+ \def\bbl@jpn@postpartname{部}% -- added
+ %\def\bbl@jpn@enclname{encl}% 同封物
+ %\def\bbl@jpn@ccname{cc}% Cc
+ %\def\bbl@jpn@headtoname{To}% To(宛先)
+ %\def\bbl@jpn@pagename{Page}% ページ
+ %\def\bbl@jpn@seename{see}% 参照
+ %\def\bbl@jpn@alsoname{see also}% も参照
+ \def\bbl@jpn@proofname{証明}%
+ \def\bbl@jpn@glossaryname{用語集}%
+% \end{macrocode}
+%
+% p\TeX{}系の場合は,UTF-8を読めない可能性があるため,
+% |\kansuji| トリックを使って和文文字の代わりにします。
+%
+% \begin{macrocode}
+\else
+\begingroup
+ \kansujichar1=\jis"4130\relax % 前
+ \kansujichar2=\jis"3D71\relax % 書
+ \kansujichar3=\jis"242D\relax % き
+ \kansujichar4=\jis"3B32\relax % 参
+ \kansujichar5=\jis"394D\relax % 考
+ \kansujichar6=\jis"4A38\relax % 文
+ \kansujichar7=\jis"3825\relax % 献
+ \kansujichar8=\jis"3335\relax % 概
+ \kansujichar9=\jis"4D57\relax % 要
+ \xdef\bbl@jpn@prefacename{\kansuji123}%
+ \xdef\bbl@jpn@refname{\kansuji4567}%
+ \xdef\bbl@jpn@abstractname{\kansuji89}%
+ \xdef\bbl@jpn@bibname{\kansuji4567}%
+ \kansujichar1=\jis"4268\relax % 第
+ \kansujichar2=\jis"3E4F\relax % 章
+ \kansujichar3=\jis"4061\relax % 節
+ \kansujichar4=\jis"4955\relax % 付
+ \kansujichar5=\jis"4F3F\relax % 録
+ \kansujichar6=\jis"3A77\relax % 索
+ \kansujichar7=\jis"307A\relax % 引
+ \kansujichar8=\jis"4974\relax % 部
+ \xdef\bbl@jpn@prechaptername{\kansuji1}%
+ \xdef\bbl@jpn@postchaptername{\kansuji2}%
+ \xdef\bbl@jpn@presectionname{}%
+ \xdef\bbl@jpn@postsectionname{}%
+ \xdef\bbl@jpn@appendixname{\kansuji45}%
+ \xdef\bbl@jpn@indexname{\kansuji67}%
+ \xdef\bbl@jpn@prepartname{\kansuji1}%
+ \xdef\bbl@jpn@postpartname{\kansuji8}%
+ \kansujichar1=\jis"4C5C\relax % 目
+ \kansujichar2=\jis"3C21\relax % 次
+ \kansujichar3=\jis"3F5E\relax % 図
+ \kansujichar4=\jis"493D\relax % 表
+ \kansujichar5=\jis"3E5A\relax % 証
+ \kansujichar6=\jis"4C40\relax % 明
+ \kansujichar7=\jis"4D51\relax % 用
+ \kansujichar8=\jis"386C\relax % 語
+ \kansujichar9=\jis"3D38\relax % 集
+ \xdef\bbl@jpn@contentsname{\kansuji12}%
+ \xdef\bbl@jpn@listfigurename{\kansuji312}%
+ \xdef\bbl@jpn@listtablename{\kansuji412}%
+ \xdef\bbl@jpn@figurename{\kansuji3}%
+ \xdef\bbl@jpn@tablename{\kansuji4}%
+ \xdef\bbl@jpn@proofname{\kansuji56}%
+ \xdef\bbl@jpn@glossaryname{\kansuji789}%
+\endgroup
+\fi
+% \end{macrocode}
+%
+% 実際の命令にこれらをコピーします。
+%
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \let\prefacename\bbl@jpn@prefacename
+ \let\refname\bbl@jpn@refname
+ \let\abstractname\bbl@jpn@abstractname
+ \let\bibname\bbl@jpn@bibname
+ %\def\chaptername{Chapter}%
+ \let\prechaptername\bbl@jpn@prechaptername % -- added
+ \let\postchaptername\bbl@jpn@postchaptername % -- added
+ \let\presectionname\bbl@jpn@presectionname % -- added
+ \let\postsectionname\bbl@jpn@postsectionname % -- added
+ \let\appendixname\bbl@jpn@appendixname
+ \let\contentsname\bbl@jpn@contentsname
+ \let\listfigurename\bbl@jpn@listfigurename
+ \let\listtablename\bbl@jpn@listtablename
+ \let\indexname\bbl@jpn@indexname
+ \let\figurename\bbl@jpn@figurename
+ \let\tablename\bbl@jpn@tablename
+ %\def\partname{Part}%
+ \let\prepartname\bbl@jpn@prepartname % -- added
+ \let\postpartname\bbl@jpn@postpartname % -- added
+ %\def\enclname{encl}% 同封物
+ %\def\ccname{cc}% Cc
+ %\def\headtoname{To}% To(宛先)
+ %\def\pagename{Page}% ページ
+ %\def\seename{see}% 参照
+ %\def\alsoname{see also}% も参照
+ \let\proofname\bbl@jpn@proofname
+ \let\glossaryname\bbl@jpn@glossaryname
+ }
+% \end{macrocode}
+%
+% \DescribeMacro{\datejapanese}
+% |\datejapanese|マクロは日本語で日付を出力するように |\today|コマンドを
+% 再定義します。デフォルトの出力は西暦です。和暦を使用する際は,プリアンブルで
+% |\和暦| を指定するか,本文で |\和暦\today| のように指定します。
+%
+% フラグの準備。
+% \begin{macrocode}
+\newif\ifbbl@jpn@Seireki \bbl@jpn@Seirekitrue
+% \end{macrocode}
+%
+% Unicodeな\TeX{}エンジン(Xe\TeX{},Lua\TeX{})の場合は,
+% UTF-8エンコーディングで直接和文文字を記述します。
+% Xe\TeX{}の場合は |\bbl@jpn@Tate...| の2つは実際には使いません。
+% \begin{macrocode}
+\ifx\kanjiskip\@undefined
+ \def\西暦{\bbl@jpn@Seirekitrue}%
+ \def\和暦{\bbl@jpn@Seirekifalse}%
+ \def\bbl@jpn@kanjishowa{昭和}
+ \def\bbl@jpn@kanjiheisei{平成}
+ \def\bbl@jpn@kanjireiwa{令和}
+ \def\bbl@jpn@kanjigan{元}%
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
+ \def\bbl@jpn@TateWarekiToday{%
+ \bbl@jpn@gengo\bbl@jpn@maybekansuji\bbl@jpn@gengoyear 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
+ \def\bbl@jpn@SeirekiToday{%
+ \number\year 年%
+ \number\month 月%
+ \number\day 日}
+ \def\bbl@jpn@WarekiToday{%
+ \bbl@jpn@gengo\number\bbl@jpn@gengoyear 年%
+ \number\month 月%
+ \number\day 日}
+% \end{macrocode}
+%
+% p\TeX{}系では |\kansuji| トリックで同じ命令を定義します。
+% \begin{macrocode}
+\else
+\begingroup
+ \kansujichar1=\jis"472F\relax % 年
+ \kansujichar2=\jis"376E\relax % 月
+ \kansujichar3=\jis"467C\relax % 日
+ \xdef\bbl@jpn@kanjinen{\kansuji1}%
+ \xdef\bbl@jpn@kanjigatsu{\kansuji2}%
+ \xdef\bbl@jpn@kanjinichi{\kansuji3}%
+ \kansujichar1=\jis"403E\relax % 西
+ \kansujichar2=\jis"4F42\relax % 和
+ \kansujichar3=\jis"4E71\relax % 暦
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\csname\kansuji13\endcsname{\bbl@jpn@Seirekitrue}%
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\csname\kansuji23\endcsname{\bbl@jpn@Seirekifalse}%
+ \kansujichar4=\jis"4A3F\relax % 平
+ \kansujichar5=\jis"402E\relax % 成
+ \kansujichar6=\jis"3E3C\relax % 昭
+ \kansujichar7=\jis"4E61\relax % 令
+ \xdef\bbl@jpn@kanjishowa{\kansuji62}%
+ \xdef\bbl@jpn@kanjiheisei{\kansuji45}%
+ \xdef\bbl@jpn@kanjireiwa{\kansuji72}%
+ \kansujichar0=\jis"3835\relax % 元
+ \xdef\bbl@jpn@kanjigan{\kansuji0}%
+\endgroup
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@TateWarekiToday{%
+ \bbl@jpn@gengo\bbl@jpn@maybekansuji\bbl@jpn@gengoyear\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@SeirekiToday{%
+ \number\year\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@WarekiToday{%
+ \bbl@jpn@gengo\number\bbl@jpn@gengoyear\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+\fi
+% \end{macrocode}
+%
+% |\bbl@jpn@gengo| の内部で,元号を計算します。
+%
+% [2019-04-03] 2019年5月1日から始まる予定の新元号「令和」に対応しました。
+% \begin{macrocode}
+\def\bbl@jpn@gengo#1\bbl@jpn@gengoyear{%
+ \@tempcnta\year\relax
+ \multiply\@tempcnta100
+ \advance\@tempcnta\month
+ \multiply\@tempcnta100
+ \advance\@tempcnta\day
+ \@tempcntb\year\relax
+ \ifnum\@tempcnta<19890108
+ \bbl@jpn@kanjishowa
+ \advance\@tempcntb-1925
+ \else\ifnum\@tempcnta<20190501
+ \bbl@jpn@kanjiheisei
+ \advance\@tempcntb-1988
+ \else
+ \bbl@jpn@kanjireiwa
+ \advance\@tempcntb-2018
+ \fi\fi
+ \ifnum\@tempcntb=1
+ \bbl@jpn@kanjigan % 元年は \number も \kansuji も関係ない
+ \else
+ #1\@tempcntb % この #1 は \number または \bbl@jpn@maybekansuji
+ \fi
+}
+% \end{macrocode}
+%
+% (u)p\LaTeXe{}とLua\TeX-jaで組方向判定方法が異なるため,|\catcode| のトリックで
+% 別々のコードを使い分けます。Xe\LaTeX{}の場合,およびLua\LaTeX{}でLua\TeX-ja不使用の
+% 場合は,縦組をサポートしません。
+% \begin{macrocode}
+\chardef\bbl@jpn@l@catcode=\catcode`\L\relax
+\chardef\bbl@jpn@p@catcode=\catcode`\P\relax
+\chardef\bbl@jpn@x@catcode=\catcode`\X\relax
+\ifx\directlua\@undefined
+ \ifx\XeTeXversion\@undefined % ptex/uptex
+ \catcode`\L=14\relax
+ \catcode`\P=9\relax
+ \catcode`\X=9\relax
+ \else % xetex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \fi
+\else
+ \ifx\luatexjaLoaded\@undefined % luatex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \else % luatex + luatexja
+ \catcode`\L=9\relax
+ \catcode`\P=14\relax
+ \catcode`\X=9\relax
+ \fi
+\fi
+% \end{macrocode}
+%
+% 実際に使用する命令にコピーします。
+%
+% [2019-04-03] 縦数式ディレクションは横組と同じ出力とします。
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{%
+P \iftdir\ifmdir % tate-math
+P \ifbbl@jpn@Seireki
+P \bbl@jpn@SeirekiToday
+P \else
+P \bbl@jpn@WarekiToday
+P \fi
+P \else % tate
+L \ifnum\ltjgetparameter{direction}=3 % tate
+X \ifbbl@jpn@Seireki
+X \bbl@jpn@TateSeirekiToday
+X \else
+X \bbl@jpn@TateWarekiToday
+X \fi
+P \fi
+X \else
+ \ifbbl@jpn@Seireki
+ \bbl@jpn@SeirekiToday
+ \else
+ \bbl@jpn@WarekiToday
+ \fi
+X \fi
+ }%
+}
+% \end{macrocode}
+%
+% [2017-02-05] 新機能:|\languageattribute{japanese}{kansujitoday}|を指定すると,
+% 縦書きでは |\today| の表記が漢数字(例:二〇一六年一二月二八日)になります。
+% \begin{macrocode}
+\let\bbl@jpn@maybekansuji\number
+\bbl@declare@ttribute{japanese}{kansujitoday}{\let\bbl@jpn@maybekansuji\kansuji}
+% \end{macrocode}
+%
+% トリックに使用した文字の |\catcode| を元に戻します。
+% \begin{macrocode}
+\catcode`\L=\bbl@jpn@l@catcode\relax
+\catcode`\P=\bbl@jpn@p@catcode\relax
+\catcode`\X=\bbl@jpn@x@catcode\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \section*{謝辞}
+%
+% Babel-Option \Lopt{japanese}の作成に当って,バグフィックスや改良案を
+% ご提案いただいた方に感謝します。
+% bookworm $<$BYV01204$>$さんから,新しい言語を定義し,それに固有の
+% 言語番号を付けるマクロ \verb+\addlanguage+の機能について,詳しい
+% 解説をいただきました。本パッケージでは採用していませんが,\babel
+% の言語切り替え機能を理解する上でたいへん参考になりました。
+% Tony $<$PAG01322$>$さんから,キャプションと日付の定義について
+% ご提案をいただきました。
+% 大石勝 $<$DZH00446$>$さんから,初版に含まれていた \verb+\ifx\undefined+
+% のバグをご指摘いただきました。
+%
+% \section*{変更履歴}
+% \begin{itemize}
+% \item 2005年2月:日付の定義を修正しました。
+% \item 2007年10月:ZRさんからいただいた詳細なご指摘をもとに修正しました。\\
+% \verb|http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/48625.html|
+% \item 2007年12月:ZRさん,ttkさんからいただいたご指摘を反映しました。
+% \item 2016年12月:日本語\TeX{}開発コミュニティが開発を引き継ぎました。
+% 以降の変更履歴は本文中に直接書いてあります。
+% \end{itemize}
+%
+% \StopEventually{}
+%
+% \begin{macrocode}
+%<*sample>
+\ifx\directlua\undefined
+ \documentclass{jbook}
+\else
+ \documentclass{ltjbook}
+\fi
+\usepackage[german,english,japanese]{babel}
+\makeatletter
+\def\tbcaption{\def\@captype{table}\caption{キャプションの例}}
+\def\fgcaption{\def\@captype{figure}\caption{キャプションの例}}
+\makeatother
+\def\yes{--- はい。}
+\def\no{--- いいえ。}
+\def\TEXT{Textverarbeitung mit einem Rechner kann in vielf\"altiger Weise
+erfolgen. Eigenschaften und Leistungsf\"ahigkeit sind hierbei weniger
+vom jeweiligen Rechnertype, sondern vielmehr vom verwendeten
+\textit{Textverarbeitungsprogramm} bestimmt.}
+\def\se{\selectlanguage{english}}
+\def\sj{\selectlanguage{japanese}}
+\def\sg{\selectlanguage{german}}
+\setlength{\hoffset}{-13mm}
+\setlength{\textwidth}{16cm}
+\begin{document}
+
+\chapter{babel}
+\section{japaneseパッケージ}
+japaneseパッケージは日本語による見出し語と日付を出力するためのマクロを
+定義しています。
+
+\fgcaption
+
+\begin{itemize}
+\se
+\item ここで英語(\texttt{english})に変更します。(languageの値は\the\language)
+
+\TEXT
+
+ここは英語? \iflanguage{english}{\yes}{\no}\par
+ここはドイツ語? \iflanguage{german}{\yes}{\no}\par
+ここは日本語? \iflanguage{japanese}{\yes}{\no}
+
+※ \verb:\adddialect\l@japanese0: と設定しているため,日本語?も「はい」となります。
+
+\sg
+\item ここでドイツ語(\texttt{german})に変更します。(languageの値は\the\language)
+
+\TEXT
+
+ここは英語? \iflanguage{english}{\yes}{\no}\par
+ここはドイツ語? \iflanguage{german}{\yes}{\no}\par
+ここは日本語? \iflanguage{japanese}{\yes}{\no}
+
+※ ハイフネーションがドイツ語―旧正書法―に切り替わっている点に注目。
+なお,新正書法(\texttt{ngerman})では\texttt{Leis-tungs-f\"a-hig-keit}のように分綴します。
+
+\sj
+\item ここで日本語(\texttt{japanese})に変更します。(languageの値は\the\language)
+\tbcaption
+\item \verb:\和暦: は日付の表示をデフォルトの西暦「\today 」から和暦「\和暦\today 」に変更します。
+\end{itemize}
+\end{document}
+%</sample>
+% \end{macrocode>
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/japanese/japanese.ins b/macros/latex/contrib/babel-contrib/japanese/japanese.ins
new file mode 100644
index 0000000000..1e2d13cd0b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/japanese.ins
@@ -0,0 +1,49 @@
+%% japanese.ins
+%%
+%% Docstrip installation instruction file
+%% for the `japanese' package (Japanese support for Babel)
+%%
+%%
+
+\def\batchfile{japanese.ins}
+\input docstrip.tex
+
+\expandafter\ifx\csname declarepreamble\endcsname\relax
+ \Msg{==> This file requires docstrip version 2.4}
+ \Msg{}\expandafter\endinput\fi
+
+\keepsilent
+
+\preamble
+
+This file is part of the `japanese' package,
+providing Japanese language support for Babel.
+
+Copyright (C) 1999--2007 by ING (Toru INAGAKI)
+ 2016-- by Japanese TeX Development Community
+
+This package is free software that can be redistributed and/or
+modified under the terms of the LaTeX Project Public License.
+
+Previous version of this work was written by ING, based on ideas
+from bookworm, Tony and Ohishi.
+Current maintainer is Japanese TeX Development Community.
+
+Please report errors to
+ Japanese TeX Development Community Issue List <issue@texjp.org>
+or, GitHub repository is also available:
+ https://github.com/texjporg/babel-japanese
+
+\endpreamble
+
+\declarepreamble\emptypreamble
+\endpreamble
+
+\Msg{*** Generating files ***}
+\generateFile{japanese.ldf}{f}{\from{japanese.dtx}{code}}
+\usepreamble\emptypreamble
+\generateFile{japanese-sample.tex}{f}{\from{japanese.dtx}{sample}}
+\endbatchfile
+
+%%
+%% End of file `japanese.ins'.
diff --git a/macros/latex/contrib/babel-contrib/japanese/japanese.pdf b/macros/latex/contrib/babel-contrib/japanese/japanese.pdf
new file mode 100644
index 0000000000..65f89c5396
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/japanese/japanese.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.dtx b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.dtx
new file mode 100644
index 0000000000..f4587a5118
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.dtx
@@ -0,0 +1,401 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2009 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{344}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{kurmanji.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{kurmanji}
+%\fi
+%\ProvidesFile{kurmanji.dtx}
+ [2009/06/25 v1.1 Kurmanji support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2009
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.xs4all.nl
+%
+% This file is part of the babel system, it provides the source code for
+% the Kurmanji language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{kurmanji.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{kurmanji.dtx}
+%
+% \changes{kurmanji-1.1}{2009/02/13}{Removed old changes from
+% language.skeleton}
+% \changes{kurmanji-1.1}{2009/02/13}{Corrected some typographical errors
+% in the documentation}
+% \changes{kurmanji-1.1}{2009/02/13}{Added documentation about the date}
+% \changes{kurmanji-1.1}{2009/02/13}{Rewrote the code for Kurmanji date}
+% \changes{kurmanji-1.1}{2009/02/13}{Set both hyphenmins to two}
+% \changes{kurmanji-1.1}{2009/02/13}{Use frenchspacing}
+% \changes{kurmanji-1.1}{2009/05/11}{Make month > 12 an error}
+% \changes{kurmanji-1.1}{2009/05/11}{Documentation of hyphenmins}
+% \changes{kurmanji-1.1}{2009/05/11}{Added three numerical date formats}
+% \changes{kurmanji-1.1}{2009/06/25}{Page, Chapter, and Apppendix inflected}
+% \changes{kurmanji-1.1}{2009/06/25}{Added Makro \cs{ontoday}}
+%
+% \section{The Kurmanji language}
+%
+% The Kurmanji language belongs to the Kurdish languages.
+% Of the Kurdish languages, Kurmanji has the largest
+% number of speakers and is written with the turkish based latin alphabet
+% by Mir Celadet Bedirxan. Kurmanji is spoken in Turkey, Syria and by
+% the majority of the Kurdish diaspora in Europe.
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Kurmanji language. Versions 1.0 and 1.1 of this file were
+% contributed by
+% J\"org Knappen and Medeni Shemd\^e. The code for the active |^|
+% was lifted from esperanto.dtx.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% |^c| & gives \c c with hyphenation in the rest of the word
+% allowed, this works for c, C, s, S\\
+% |^e| & gives \^e, with hyphenation in the rest of the word
+% allowed, this works for e, E, i, I, u, U\\
+% \verb=^|= & inserts a |\discretionary{-}{}{}|\\
+% |"`| & gives lower left double german style quotes, like~,,\\
+% |"'| & gives upper right double igerman style quotes, like~``\\
+% \end{tabular}
+% \caption{The functions of the active character for Kurmanji.}
+% \label{tab:kur-act}
+% \end{table}
+%
+% \subsection{The date in Kurmanji}
+%
+% Currently, there is no agreed set of month names for the gregorian calendar
+% in Kurmanji. We provide two lists of month names, |\datekurmanji| selects
+% month names based on traditional sources, |\datekurmanjialternate| gives
+% another selection. In addition, we provide macros |\januaryname| to
+% |\decembername| allowing the user to redefine each single month name
+% according to their preferences.
+%
+% The predefinded month names can be found in table~\ref{tab:kur-mon}.
+%
+% \begin{table}[htb]
+% \begin{tabular}{lll}
+% English & Kurmanji (traditional) & Kurmanji (alternate) \\ \hline
+% January & \c{C}ileya Pa\c{s}{\^\i}n & R\^ebendan\\
+% February & Sibat & Re\c{s}emih\\
+% March & Adar & Adar\\
+% April & N{\^\i}san & Cotan\\
+% May & Gulan & Gulan\\
+% June & Hez{\^\i}ran & P\^u\c{s}per\\
+% July & T{\^\i}rmeh & T{\^\i}rmeh\\
+% August & Tebax & Gelav\^ej\\
+% September& \^Ilon & Gelarezan\\
+% Oktober & \c{C}iriya P\^e\c{s}{\^\i}n & Kew\c{c}\^er\\
+% November & \c{C}iriya Pa\c{s}{\^\i}n & Sermawez\\
+% December & \c{C}ileya P\^e\c{s}{\^\i}n & Berfandar
+% \end{tabular}
+% \caption{Month names in Kurmanji.}
+% \label{tab:kur-mon}
+% \end{table}
+%
+% \changes{kurmanji-1.1}{2009/06/25}{Added Makro \cs{ontoday}}
+% The macro \cs{ontoday} gives the date in the inflected form. This form is
+% used in the head of a letter and looks like 25'\^e Hez{\^\i}ran\^e 2009.
+%
+% \changes{kurmanji-1.1}{2009/05/11}{Added three numerical date formats}
+% In addition to the date formats with month names we provide three
+% numerical date formats: \cs{datesymd} provides the date in the swedish style
+% YYYY-MM-DD, \cs{datesdmy} provides the date in the style D/M YYYY (also
+% popular in sweden), and \cs{dategdmy} provides the date in the style
+% D. M. YYYY (popular in germany and many other countries).
+% These commands should be issued after \cs{begin{document}}.
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{kurmanji}{captionskurmanji}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{kurmanji} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@kurmanji| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@kurmanji
+ \@nopatterns{Kurmanji}
+ \adddialect\l@kurmanji0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Kurmanji language.
+%
+% Now we declare the |<attrib>| language attribute.
+% \begin{macrocode}
+\bbl@declare@ttribute{kurmanji}{<attrib>}{%
+% \end{macrocode}
+% This code adds the expansion of |\extras<attrib>kurmanji| to
+% |\extraskurmanji|.
+% \begin{macrocode}
+ \expandafter\addto\expandafter\extraskurmanji
+ \expandafter{\extras<attrib>kurmanji}%
+ \let\captionskurmanji\captions<attrib>kurmanji
+ }
+% \end{macrocode}
+%
+% \changes{kurmanji-1.1}{2009/02/13}{Set both hyphenmins to two}
+% \changes{kurmanji-1.1}{2009/05/11}{Documentation of hyphenmins}
+% The kurmanji hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
+% \begin{macro}{\kurmanjihyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{kurmanji}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{kurmanji-1.1}{2009/06/25}{Page, Chapter, and Apppendix inflected}
+% \begin{macro}{\captionskurmanji}
+% The macro |\captionskurmanji| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\def\captionskurmanji{%
+ \def\prefacename{Pe\c{s}gotin}% % Gotina Pe\c{s}\^i
+ \def\refname{Pirtuken bijart{\^\i}}%
+ \def\abstractname{Kurteb{\^\i}r}% % En\c{c}am
+ \def\bibname{\c{C}avkan{\^\i}ya Pirtukan}%
+ \def\chaptername{Ser\^e}%
+ \def\appendixname{Teb{\^\i}n{\^\i}ya}%
+ \def\contentsname{Nav\^erok}% % Navedank
+ \def\listfigurename{Hejmara Dimena}%
+ \def\listtablename{Hejmara Kevalen}%
+ \def\indexname{Endeks}%
+ \def\figurename{Dimen\^e}% % Weney\^e
+ \def\tablename{Kevala}%
+ \def\partname{B\^e\c{s}a}%
+ \def\enclname{Dumahik}% % Duvik
+ \def\ccname{Belavker}%
+ \def\headtoname{Ji bo}% % Ji ... re
+ \def\pagename{R\^upel\^e}%
+ \def\seename{bin\^era}% % bala xwe bida
+ \def\alsoname{le v\^eya ji bin\^era}%
+ \def\proofname{Del{\^\i}l}%
+ \def\glossaryname{\c{C}avkan{\^\i}ya l\^ekol{\^\i}n\^e}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \changes{kurmanji-1.1}{2009/02/13}{Rewrote the code for Kurmanji date}
+% \begin{macro}{\datekurmanji}
+% \begin{macro}{\datekurmanjialternate}
+% The macro |\datekurmanji| redefines the command |\today| to
+% produce Kurmanji dates. We choose the traditional names for the months.
+% The macro |\datekurmanjialternate|
+% defines an alternate set of month names. It is
+% also very common to use numbers for the month.
+% \changes{kurmanji-1.1}{2009/06/25}{Added Makro \cs{ontoday}}
+%
+% \changes{kurmanji-1.1}{2009/05/11}{Make month > 12 an error}
+% We define the general date format in terms of macros |\januaryname| to
+% |\decembername| which can be redefined by the user.
+% \begin{macrocode}
+\def\datekurmanji{%
+ \def\today{\number\day.~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi~\number\year}%
+ \def\ontoday{\number\day'\^e~\ifcase\month\or
+ \januaryname\or \februaryname\or \marchname\or \aprilname\or
+ \mayname\or \junename\or \julyname\or \augustname\or
+ \septembername\or \octobername\or \novembername\or
+ \decembername\or \@ctrerr\fi\^e~\number\year}%
+ \def\januaryname{\c{C}ileya Pa\c{s}{\^\i}n}%
+ \def\februaryname{Sibat}%
+ \def\marchname{Adar}%
+ \def\aprilname{N\^{\i}san}%
+ \def\mayname{Gulan}%
+ \def\junename{Hez{\^\i}ran}%
+ \def\julyname{T{\^\i}rmeh}%
+ \def\augustname{Tebax}%
+ \def\septembername{\^Ilon}%
+ \def\octobername{\c{C}iriya P\^e\c{s}{\^\i}n}%
+ \def\novembername{\c{C}iriya Pa\c{s}{\^\i}n}%
+ \def\decembername{\c{C}ileya P\^e\c{s}{\^\i}n}%
+}
+\def\datekurmanjialternate{%
+ \datekurmanji
+ \def\januaryname{R\^ebendan}%
+ \def\februaryname{Re\c{s}emih}%
+ \def\aprilname{Cotan}% % Avr\^el
+ \def\junename{P\^u\c{s}per}%
+ \def\augustname{Gelav\^ej}%
+ \def\septembername{Gelarezan}% % Rezber
+ \def\octobername{Kew\c{c}\^er}%
+ \def\novembername{Sermawez}%
+ \def\decembername{Berfandar}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \changes{kurmanji-1.1}{2009/05/11}{Added three numerical date formats}
+% \begin{macro}{\datesymd}
+% \changes{swedish-2.3a}{2000/01/20}{Command added}
+% The macro |\datesymd| redefines the command |\today| to
+% produce dates in the format YYYY-MM-DD, common in Sweden.
+% \begin{macrocode}
+\def\datesymd{%
+ \def\today{\number\year-\two@digits\month-\two@digits\day}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesdmy}
+% The macro |\datesdmy| redefines the command |\today| to
+% produce Swedish dates in the format DD/MM YYYY, also common in
+% Sweden.
+% \begin{macrocode}
+\def\datesdmy{%
+ \def\today{\number\day/\number\month\space\number\year}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dategdmy}
+% The macros |\dategdmy| redefines the command |\today| to produce
+% german style dates in the format D. M. YYYY.
+% \begin{macrocode}
+\def\dategdmy{%
+ \def\today{\number\day.\space\number\month.\space\number\year}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraskurmanji}
+% \begin{macro}{\noextraskurmanji}
+% The macro |\extraskurmanji| will perform all the extra
+% definitions needed for the Kurmanji language. The macro
+% |\noextraskurmanji| is used to cancel the actions of
+% |\extraskurmanji|.
+%
+% For Kurmanji the |^| character is made active. This is done
+% once, later on its definition may vary.
+%
+% \begin{macrocode}
+\initiate@active@char{^}
+% \end{macrocode}
+% Because the character |^| is used in math mode with quite a
+% different purpose we need to add an extra level of evaluation to
+% the definition of the active |^|. It checks whether math mode is
+% active; if so the shorthand mechanism is bypassed by a direct
+% call of |\normal@char^|.
+% \begin{macrocode}
+\addto\extraskurmanji{\languageshorthands{kurmanji}}
+\addto\extraskurmanji{\bbl@activate{^}}
+\addto\noextraskurmanji{\bbl@deactivate{^}}
+% \end{macrocode}
+%
+% In order to prevent problems with the active |^| we add a
+% shorthand on system level which expands to a `normal |^|.
+% \begin{macrocode}
+\declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% \end{macrocode}
+% And here are the uses of the active |^|:
+% \begin{macrocode}
+\declare@shorthand{kurmanji}{^c}{\c{c}\allowhyphens}
+\declare@shorthand{kurmanji}{^C}{\c{C}\allowhyphens}
+\declare@shorthand{kurmanji}{^e}{\^e\allowhyphens}
+\declare@shorthand{kurmanji}{^E}{\^E\allowhyphens}
+\declare@shorthand{kurmanji}{^i}{{\^\i}\allowhyphens}
+\declare@shorthand{kurmanji}{^I}{\^I\allowhyphens}
+\declare@shorthand{kurmanji}{^s}{\c{s}\allowhyphens}
+\declare@shorthand{kurmanji}{^S}{\c{S}\allowhyphens}
+\declare@shorthand{kurmanji}{^u}{\^u\allowhyphens}
+\declare@shorthand{kurmanji}{^U}{\^U\allowhyphens}
+\declare@shorthand{kurmanji}{^`}{\glqq}
+\declare@shorthand{kurmanji}{^'}{\grqq}
+\declare@shorthand{kurmanji}{^|}{\discretionary{-}{}{}\allowhyphens}
+% \end{macrocode}
+%
+% \changes{kurmanji-1.1}{2009/02/13}{Use frenchspacing}
+% For typesetting Kurmanji text, frenchspacing is preferred.
+% \begin{macrocode}
+\addto\extraskurmanji{\bbl@frenchspacing}
+\addto\noextraskurmanji{\bbl@nonfrenchspacing}
+% \end{macrocode}
+
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{kurmanji}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.ins b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.ins
new file mode 100644
index 0000000000..ca18be14cb
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2009 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2009/09/19}
+\def\batchfile{kurmanji.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2009 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{kurmanji.ldf}{\from{kurmanji.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.pdf b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.pdf
new file mode 100644
index 0000000000..0e9e220dae
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/kurmanji/kurmanji.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.dtx b/macros/latex/contrib/babel-contrib/latin/latin.dtx
new file mode 100644
index 0000000000..5c69e291b1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latin/latin.dtx
@@ -0,0 +1,828 @@
+% \CheckSum{510}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*driver>
+\ProvidesFile{latin.dtx}
+%</driver>
+%<code>\ProvidesLanguage{latin}
+%<*code>
+ [2015/08/20 v.3.5 Latin support from the babel system]
+%</code>
+%% File `babel-latin.dtx'
+%% Babel package for LaTeX2e
+%% Copyright (C) 1989 - 2008 by Johannes Braams, TeXniek
+%% Copyright (C) 2009 - 2015 by Claudio Beccari
+%
+%% Please report errors to: Claudio Beccari
+%% claudio.beccari at gmail.com
+%
+% This file is part of the babel system, it provides the source
+% code for the Latin language description file.
+% The original version of this file was written by
+% Claudio Beccari, (claudio.beccari at gmail.com) and includes contributions
+% by Krzysztof Konrad \.Zelechowski, (\texttt{kkz@alfa.mimuw.edu.pl}). It was
+% modified and made compatible with the babel system by J.L. Braams
+%<*driver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\providecommand*\pkg[1]{\textsf{#1}}
+\begin{document}
+\DocInput{latin.dtx}
+\end{document}
+%</driver>
+%\fi
+% \GetFileInfo{latin.dtx}
+%
+% \changes{latin-0.99}{1999/12/06}{First version, from italian.dtx (CB)}
+% \changes{latin-0.99}{1999/12/06}{Added shorthands for breve, macron,
+% and etymological hyphenation (CB)}
+% \changes{latin-1.2}{2000/01/31}{Added suggestions from Krzysztof
+% Konrad \.Zelechowski (CB)}
+% \changes{latin-2.0}{2000/02/10}{Completely new etymological
+% hyphenation (CB)}
+% \changes{latin-2.0a}{2000/10/15}{Revised by JB}
+% \changes{latin-2.0b}{2000/12/13}{Simplified shorthands for
+% etymological hyphenation; modified breve and macro shorthands;
+% language attribute medieval declared}
+% \changes{latin-2.0c}{2001/06/04}{Restored caret and equals sign
+% category codes before exiting}
+% \changes{latin-2.0d}{2001/06/04}{Restored caret and equals sign
+% category codes before exiting}
+% \changes{latin-2.0e}{2003/04/11}{Introduced the language attribute
+% `withprosodicmarks'; modified use of breve and macron shorthands
+% in order to avoid possible conflicts with other packages}
+% \changes{latin-2.0i}{2008/02/17}{Corrected the \cs{@clubpenalty} problem}
+% \changes{latin-2.0j}{2010/01/03}{Corrected sectioning}
+% \changes{latin-2.0k}{2014/02/18}{subsections turned into subsections*}
+%^^A --------------------------------
+% \changes{latin-3.0}{2014/06/01}{Added modifier for classical spelling
+% and hyphenation}
+% \changes{latin-3.0}{2014/06/01}{Restored the subsection numbering}
+% \changes{latin-3.5}{2015/08/17}{Added the modifier for the ecclesiastic
+% Latin variety}
+%
+% \section{The Latin language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. The original author is Claudio Beccari.} defines all the
+% language-specific macros for the Latin language including the classical
+% spelling and hyphenation and the special ecclesiastic spelling.
+%
+% Without modifiers or attributes, this file describes the modern usage
+% of Latin; with this we mean the kind of Latin that is used as an official
+% language in the State of Vatican City, and in the teaching of Latin in
+% modern schools. This file description language accepts several modifiers,
+% in order to be adapted to other situations.
+%\begin{enumerate}\csname c@enumi\endcsname=-1
+%^^A
+%\item Modern spelling and hyphenation; this is the default setting.
+%^^A
+%\item Medieval spelling and hyphenation: in this spelling the lower and
+% upper case alphabets become the following:\\
+%\makebox[\linewidth]{\tabcolsep=2pt
+%\begin{tabular}{*{26}c}
+% a&\ae&b&c&d&e&f&g&h&i&k&l&m&n&o&\oe&p&q&r&s&t&u&x&y&z \\
+% A&\AE&B&C&D&E&F&G&H&I&K&L&M&N&O&\OE&P&Q&R&S&T&V&X&Y&Z
+%\end{tabular}}
+% It must be noted that this file description language does not make
+% any spelling correction in order to use only `u' in lower case and only
+% `V' in upper case: if the input text is wrongly typed in, it remains as
+% such; this means it's the typesetter's responsibility to correctly input
+% the source text to be typeset; in spite of this, when the transformation
+% from lower to upper case is performed (such as, for example, while
+% typesetting headers with some classes) the correct capitalisation is
+% performed and `u' is capitalised to `V'; the reverse takes place when
+% transforming to lowercase.
+%^^A
+%\item Classical Latin and classical hyphenation; the spelling is similar
+% to the medieval one, except for the ligatures \ae, \AE, \oe\ and \OE\
+% that are missing; again it is the typesetter's responsibility to input the
+% text to be typeset in a correct way; while the hyphenation patterns for
+% modern and medieval Latin form a non contrasting set of patterns, this
+% is impossible with classical Latin and a different pattern set has been
+% prepared as explained below.
+%^^A
+%\item Modern spelling with prosodic marks: this is to be used mainly
+% in modern grammars and dictionaries. Its settings can be turned on and
+% off according to the user needs.
+%^^A
+% \item Ecclesiastic Latin is a spelling variety of modern Latin; it is
+% taken care by the external module |ecclesiastic.sty|, that is being loaded
+% by this language description file at the right moment, that is when \babel\
+% has been completely read together with all the options and modifiers.
+% This special spelling of modern Latin is used in theological
+% and devotional books of the Roman Catholic clergy where ligatures \ae\
+% and \oe\ are widely used and where acute accents are used in order to
+% mark the tonic vowel of many words so as to allows clergy with different
+% backgrounds and mother languages to recite their community prayers with
+% the same rhythmic scheme.
+% This ecclesiastic Latin spelling contains also other differences, including
+% a certain degree of ``frenchisation'' of spaces around some punctuation
+% marks and guillemots, and the typesetting style of footnotes.
+% When this spelling is chosen, its features are
+% irrevocable, especially those that concern spacing. And this is the main
+% reason why we decided not to include the ecclesiastic style modifications
+% into the language description file, thus avoiding to mess up any setting
+% for the other Latin typesetting styles.
+%^^A
+%\end{enumerate}
+%
+% Package \babel\ is not directly concerned with hyphenation; nevertheless
+% in this case it is necessary to switch the hyphenation rules to those
+% of another language, |classiclatin|, that must be available
+% while creating the format files so that this language description
+% file can chose between the modern and medieval hyphenation rules or
+% the classical ones.
+%
+% In summary modern and medieval Latin hyphenation rules are similar
+% to those of current Italian, except that the patterns must include
+% also some consonant groups that do not exist in Italian; furthermore
+% with medieval spelling there are many more vocalic groups than in
+% Italian, because of the widespread use of the letter `u' that often
+% actually plays the r\^ole of a consonant.
+%
+% The rules for classical Latin are taken from Raffaello Farina and Nino
+% Marinone's guide \emph{Metodologia} published by Societ\`a Editrice
+% Internazionale, Torino, 1979.
+% In spite of the publication date of this guide the
+% hyphenation rules did not change in the meanwhile, since the Classical
+% Latin Language is sort of frozen during the past, say, twenty
+% centuries. Yes, it is true that the original writings in Classical
+% Latin were not hyphenated, and the hyphenation rules were established
+% at the beginning of the Renaissance, when mechanical typography
+% required suitable justification. Therefore such rules are sort of a
+% compromise between the procedures used by the various proto-typographers
+% and the scholars' of these disciplines. Nevertheless the rules given
+% by Farina and Marinone are generally shared among modern
+% scholars and are sort of official at both universities of Torino
+% and Vercelli; in the latter University they are adopted by the working
+% group that founded the DigilibLT laboratory; I acknowledge their
+% contribution in letting me become aware of the problem, and therefore
+% to create this update by adding the classical Latin support for the
+% \pkg{babel} package, with its special hyphenation rules.
+%
+% In order to implement the above described styles of typesetting,
+% four modifiers/attributes have to be defined: |medieval|, |withprosodicmarks|,
+% |classic|, and |ecclesiastic|. They can be used in any order so that
+% several combinations are possible, although, generally speaking, just
+% the isolated four described ones have a real meaning.
+%
+% Among these modifiers only |withprosodicmarks| can be turned on and off;
+% the others are sort of global; for example, once |classic| is specified,
+% there is no easy way to revert to modern spelling and hypehenation; the
+% same holds true for the other modifiers, except |withprosodicmarks|.
+%
+% The typesetting style |withprosodicmarks| is
+% defined in order to use special shorthands for inserting breves
+% and macrons while typesetting grammars, dictionaries, teaching
+% texts, and the like, where prosodic marks are important for the
+% complete information on the words or the verses. The shorthands,
+% listed in table~\ref{t:lashrtct} and described in
+% subsection~\ref{s:shrtcts}, may interfere with other packages;
+% therefore by default this style is turned off and no interference
+% is introduced. If this style is used and interference is
+% experienced, there are special commands for turning on and off
+% its specific shorthand commands.
+%
+% For what concerns \babel\ and typesetting with \LaTeX, the
+% differences between the spelling styles reveal themselves
+% in the strings used to name, for example, the ``Preface'' that
+% becomes ``Praefatio'' or ``Pr\ae fatio'' respectively.
+% Hyphenation rules are also different, but the hyphenation pattern
+% file \file{hyph-la.tex} takes care of the modern and medieval versions
+% of the language, while \file{hyph-la-x-classic.tex} takes care of the
+% classical hyphenation. The user should not attempt to modify these files,
+% because they are not dealt with by \babel\ they are used only during the
+% creation of format files. If some errors or modifications are required
+% or suggested, it is necessary to ask their maintainer.
+%
+% The name strings for chapters, figures, tables, et cetera, have been
+% suggested by prof. Raffaella Tabacco, a latinist of the
+% University of Vercelli, Italy, to whom we address our warmest
+% thanks. The names suggested by Krzysztof Konrad \.Zelechowski,
+% when different, are used as the names for the medieval variety,
+% since he made a word and spelling choice more suited for this
+% variety.
+%
+% For this language some shorthands are defined according to
+% table~\ref{t:lashrtct}; all of them are supposed to work with
+% all spelling styles, except where the opposite is explicitly
+% stated.
+% \begin{table}[htb]\centering
+% \begin{tabular}{cp{80mm}}
+% |^i| & inserts the breve accent as \u{\i}; valid also for the
+% other lowercase vowels, but it does not operate on the
+% medieval ligatures \ae\ and \oe\ because they are naturally long.\\
+% |=a| & inserts the macron accent as \=a; valid also for the
+% other lowercase vowels, but it does not operate on the
+% medieval ligatures \ae\ and \oe\ because they are naturally long.\\
+% |"| & inserts a compound word mark where hyphenation is legal;
+% the next character must not be either a non-letter token
+% or an accented letter (for foreign names). With the ecclesiastic
+% spelling it eases the insertion of the ligatures \ae\ and \oe\
+% by simply typing \texttt{\string"ae} and \texttt{\string"oe}
+% without the need of curly brackets or spaces after the character
+% macros |\ae| and |\oe|.\\
+% \texttt{\string"\string|}
+% & inserts a compound word mark, but operates also when the next token
+% is not a letter or it is an accented character.
+% \end{tabular}
+% \caption[]{Shorthands defined for the Latin language. The
+% characters \texttt{\string^} and \texttt{\string=} are
+% active only when the language attribute
+% \texttt{withprosodicmarks} has been declared,
+% otherwise they are disabled; see
+% subsection~\ref{s:shrtcts} at page~\pageref{s:shrtcts}
+% for more details.}%
+% \label{t:lashrtct}
+% \end{table}
+%
+% The user should attentively remember that this file describes an option
+% for the \pkg{babel} package; it works as expected when a document containing
+% a text in part or completely in Latin is being processed with |pdfLaTeX|
+% and 8-bit encoded fonts that contain at most 256 glyphs. \babel\ can be
+% used also with |XeLaTeX| and possibly by |LuaLaTeX|, may be with reduced
+% functionalities; expect anomalous results if you typeset your document
+% with this language option and |XeLaTeX|. If you need the functionalities
+% provided by |XeLaTeX| or |LuaLaTeX|, then use |polyglossia| in place of
+% \babel\ and set the Latin desired functionalities with suitable values to
+% the |variant| keyword to the Latin language specifications; The valid values
+% have the same names as this \babel\ module modifiers, i.e.\ |medieval|,
+% |classic|, |ecclesiastic|; with |XeLaTeX| and |LuaLaTeX| that use OpenType
+% fonts, the |withprosodicmaks| functionality is not required as the required
+% glyphs can be directly input with a UNICODE input encoding. Actually with
+% such an encoding this modifier is not necessary even with |pdfLaTeX|, but
+% it eases input when one is using a vintage computer or operating system; backwards compatibility is therefore maintained.
+% \StopEventually{}
+%
+% \section{The code}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%\iffalse
+%<*code>
+%\fi
+% \begin{macrocode}
+\LdfInit{latin}{captionslatin}
+% \end{macrocode}
+%
+% Never load this file as if it was a |.sty| file by means of the
+% |\usepackage| command; this practice is deprecated. We check for
+% the existence of |\l@latin| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@latin
+ \@nopatterns{Latin}
+ \adddialect\l@latin0\fi
+% \end{macrocode}
+%
+%
+% Now we declare the |medieval| language attribute.
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{medieval}{%
+ \addto\captionslatin{\def\prefacename{Pr{\ae}fatio}}%
+ \expandafter\addto\expandafter\extraslatin
+ \expandafter{\extrasmedievallatin}%
+ }
+% \end{macrocode}
+%
+% The typesetting style |withprosodicmarks| is defined here:
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{withprosodicmarks}{%
+ \expandafter\addto\expandafter\extraslatin
+ \expandafter{\extraswithprosodicmarks}%
+ }
+% \end{macrocode}
+%
+% The `classic' typesetting style is described here: notice that the general
+% typesetting rules are identical with those of modern Latin, the default
+% one, but the hyphenation rules are different; therefore we just change
+% the meaning of counter |\l@latin| so that it points to the language
+% counter of classical Latin. In order to avoid a fatal error we test if
+% language |classiclatin| has its patterns already loaded, otherwise we issue
+% a warning and keep going with the default modern hyphenation
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{classic}{%
+ \expandafter\addto\expandafter\extraslatin
+ \expandafter{\extrasclassic}%
+ }
+\ifx\l@classiclatin\undefined
+ \let\l@classiclatin\l@latin
+ \PackageWarningNoLine{babel}{%
+ Attention: hyphenation patterns for language\MessageBreak
+ classiclatin have not been loaded.\MessageBreak
+ I go on using the modern Latin hyphenation patterns.\MessageBreak
+ Please, load the suitable patterns or upgrade your TeX distribution}
+\fi
+\addto\extrasclassic{\let\l@latin\l@classiclatin}
+% \end{macrocode}
+% It must be remembered that the |medieval| and the |withprosodicmarks|
+% styles might be used together. They are also compatible with
+% the |classic| attribute, but it would be unusual to typeset classical
+% Latin with some medieval features and/or with the prosodic marks that were
+% unknown twenty centuries ago.
+%
+% The next step consists in defining commands to switch to (and
+% from) the Latin language\footnote{Most of these names were
+% kindly suggested by Raffaella Tabacco.}.
+%
+% \begin{macro}{\captionslatin}
+% The macro |\captionslatin| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \begin{macrocode}
+\@namedef{captionslatin}{%
+ \def\prefacename{Praefatio}%
+ \def\refname{Conspectus librorum}%
+ \def\abstractname{Summarium}%
+ \def\bibname{Conspectus librorum}%
+ \def\chaptername{Caput}%
+ \def\appendixname{Additamentum}%
+ \def\contentsname{Index}%
+ \def\listfigurename{Conspectus descriptionum}%
+ \def\listtablename{Conspectus tabularum}%
+ \def\indexname{Index rerum notabilium}%
+ \def\figurename{Descriptio}%
+ \def\tablename{Tabula}%
+ \def\partname{Pars}%
+ \def\enclname{Adduntur}% Or " Additur" ? Or simply Add.?
+ \def\ccname{Exemplar}% Use the recipient's dative
+ \def\headtoname{\ignorespaces}% Use the recipient's dative
+ \def\pagename{Charta}%
+ \def\seename{cfr.}%
+ \def\alsoname{cfr.}% Tabacco never saw "cfr" + `atque' or similar forms
+ \def\proofname{Demonstratio}%
+ \def\glossaryname{Glossarium}%
+ }
+% \end{macrocode}
+% \end{macro}
+% In the above definitions there are some points that might change
+% in the future or that require a minimum of attention from the
+% typesetter.
+% \begin{enumerate}
+% \item the \cs{enclname} is translated by a passive verb, that
+% literally means ``(they) are being added''; if just one
+% enclosure is joined to the document, the plural passive is not
+% suited any more; nevertheless a generic plural passive might be
+% incorrect but suited for most circumstances. On the opposite
+% ``Additur'', the corresponding singular passive, might be more
+% correct with one enclosure and less suited in general: what
+% about the abbreviation ``Add.'' that works in both cases, but
+% certainly is less elegant?
+% \item The \cs{headtoname} is empty and gobbles the possible
+% following space; in practice the typesetter should use the
+% dative of the recipient's name; since nowadays not all such
+% names can be translated into Latin, they might result
+% indeclinable. The clever use of a dative appellative by the
+% typesetter such as ``Domino'' or ``Dominae'' might solve the
+% problem, but the header might get too impressive. The typesetter
+% must make a decision on his own.
+% \item The same holds true for the copy recipient's name in the
+% ``Cc'' field of \cs{ccname}.
+% \end{enumerate}
+%
+% \begin{macro}{\datelatin}
+% The macro |\datelatin| redefines the command |\today| to produce
+% Latin dates; the choice of small caps Latin numerals for the day number is
+% arbitrary and may be changed in the future. For medieval and classic Latin
+% the spelling of `Novembris' should be \textit{Nouembris}. This is
+% taken care of by using a control sequence which can be redefined
+% when the attribute `medieval' and/or `classic' is selected.
+% \changes{latin-2.0f}{2005/03/30}{Added a comment character to
+% prevent unwanted space}
+% \changes{latin-2.0k}{2011/02/06}{Inserted the various `November' Latin
+% spellings to the proper `extras' macros}
+% \begin{macrocode}
+\addto\extraslatin{\def\november{Novembris}}
+\addto\extrasmedievallatin{\def\november{Nouembris}}
+\addto\extrasclassiclatin{\def\november{Nouembris}}
+%
+\def\datelatin{%
+ \def\today{%
+ {\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont
+ \uppercase\expandafter{\romannumeral\day}}~\ifcase\month\or
+ Ianuarii\or Februarii\or Martii\or Aprilis\or Maii\or Iunii\or
+ Iulii\or Augusti\or Septembris\or Octobris\or \november\or
+ Decembris\fi
+ \space{\uppercase\expandafter{\romannumeral\year}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\latinhyphenmins}
+% The Latin hyphenation patterns can be used with both
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{latin-2.0a}{2000/10/15}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraslatin}
+% \begin{macro}{\noextraslatin}
+% For Latin the |\clubpenalty|, |\widowpenalty| are set to
+% rather high values and |\finalhyphendemerits| is set to such a
+% high value that hyphenation is almost prohibited between the last two
+% lines of a paragraph.
+%
+% \begin{macrocode}
+\addto\extraslatin{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\@clubpenalty
+ \babel@savevariable\widowpenalty
+ \clubpenalty3000\@clubpenalty3000\widowpenalty3000}
+% \end{macrocode}
+% Hopefully never ever break a word between the last two lines of
+% a paragraph in Latin texts.
+% \begin{macrocode}
+\addto\extraslatin{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% With medieval and classic Latin we need the suitable correspondence between
+% upper case V and lower case u, since in that spelling there is
+% only one sign, and the u shape is the (uncial) version of the
+% capital V. Everything else is identical with Latin.
+% \begin{macrocode}
+\addto\extrasmedievallatin{%
+\babel@savevariable{\lccode`\V}%
+\babel@savevariable{\uccode`\u}%
+\lccode`\V=`\u \uccode`\u=`\V}
+\addto\extrasclassiclatin{%
+\babel@savevariable{\lccode`\V}%
+\babel@savevariable{\uccode`\u}%
+\lccode`\V=`\u \uccode`\u=`\V}
+% \end{macrocode}
+%
+% \begin{macro}{\SetLatinLigatures}
+% We need also the lccodes for \ae\ and \oe; since they occupy
+% different positions in the OT1 \TeX-fontencoding compared to the
+% T1 one, we must save the lc- and the uccodes for both encodings,
+% but we specify the new lc- and uccodes separately as it appears
+% natural not to change encoding while typesetting the same
+% language. The encoding is assumed to be set before starting to
+% use the Latin language, so that if Latin is the default language,
+% the font encoding must be chosen before requiring the \babel\
+% package with the |latin| option, in any case before any
+% |\selectlanguage| or |\foreignlanguage| command.
+%
+% All this fuss is made in order to allow the use of the medieval
+% ligatures \ae\ and \oe\ while typesetting with the medieval
+% spelling; I have my doubts that the medieval spelling should be
+% used at all in modern books, reports, and the like; the uncial
+% `u' shape of the lower case `v' and the above ligatures were
+% fancy styles of the copyists who were able to write faster with
+% those rounded glyphs; with typesetting there is no question of
+% handling a quill penn\dots\ Moreover in medieval times it was very
+% frequent to close such ligatures to the corresponding sound,
+% therefore instead of writing \ae\ or \oe\ they would often simply
+% write `e'. Since my (CB) opinion may be wrong, I managed to set
+% up the instruments and it is up to the typesetter to use them or not.
+%
+% \begin{macrocode}
+\addto\extrasmedievallatin{%
+ \babel@savevariable{\lccode`\^^e6}% T1 \ae
+ \babel@savevariable{\uccode`\^^e6}% T1 \ae
+ \babel@savevariable{\lccode`\^^c6}% T1 \AE
+ \babel@savevariable{\lccode`\^^f7}% T1 \oe
+ \babel@savevariable{\uccode`\^^f7}% T1 \OE
+ \babel@savevariable{\lccode`\^^d7}% T1 \OE
+ \babel@savevariable{\lccode`\^^1a}% OT1 \ae
+ \babel@savevariable{\uccode`\^^1a}% OT1 \ae
+ \babel@savevariable{\lccode`\^^1d}% OT1 \AE
+ \babel@savevariable{\lccode`\^^1b}% OT1 \oe
+ \babel@savevariable{\uccode`\^^1b}% OT1 \OE
+ \babel@savevariable{\lccode`\^^1e}% OT1 \OE
+ \SetLatinLigatures}
+
+\providecommand\SetLatinLigatures{%
+ \def\@tempA{T1}\ifx\@tempA\f@encoding
+ \catcode`\^^e6=11 \lccode`\^^e6=`\^^e6 \uccode`\^^e6=`\^^c6 % \ae
+ \catcode`\^^c6=11 \lccode`\^^c6=`\^^e6 % \AE
+ \catcode`\^^f7=11 \lccode`\^^f7=`\^^f7 \uccode`\^^f7=`\^^d7 % \oe
+ \catcode`\^^d7=11 \lccode`\^^d7=`\^^f7 % \OE
+ \else
+ \catcode`\^^1a=11 \lccode`\^^1a=`\^^1a \uccode`\^^1a=`\^^1d % \ae
+ \catcode`\^^1d=11 \lccode`\^^1d=`\^^1a % \AE
+ \catcode`\^^1b=11 \lccode`\^^1b=`\^^1b \uccode`\^^1b=`\^^1e % \oe
+ \catcode`\^^1e=11 \lccode`\^^1e=`\^^1b % \OE
+ \fi
+ \let\@tempA\@undefined
+ }
+% \end{macrocode}
+% With the above definitions we are sure that |\MakeUppercase|
+% works properly and |\MakeUppercase{C{\ae}sar}| correctly yields
+% ``C{\AE}SAR''; correspondingly |\MakeUppercase{Heluetia}|
+% correctly yields ``HELVETIA''.
+% \end{macro}
+%
+% \changes{latin-2.0j}{20104/02/18}{Renamed this section to subsection}
+% \subsection{Latin shorthands}\label{s:shrtcts}
+% For writing dictionaries or school texts (in modern spelling
+% only) we defined a language attribute or
+% typesetting style, such that a couple of other active characters are
+% defined: |^| for marking a vowel with the breve sign, and |=| for
+% marking a vowel with the macron sign. Please take notice that
+% neither the OT1 font encoding, nor the T1 one for most vowels,
+% contain directly the marked vowels, therefore hyphenation of
+% words containing these ``accents'' may become problematic; for
+% this reason the above active characters not only introduce the
+% required accent, but also an unbreakable zero skip that in
+% practice does not introduce a discretionary break, but allows
+% breaks in the rest of the word.
+%
+% It must be remarked that the active characters |^| and |=| may
+% have other meanings in other contexts. For example, besides math,
+% the equals sign is used by the graphic extensions for specifying
+% keyword options for handling the graphic elements to be included
+% in the document. At the same time, as mentioned in the previous
+% paragraph, diacritical marking in Latin is used only for
+% typesetting certain kinds of document, such as grammars and
+% dictionaries. It is reasonable that the breve and macron active
+% characters are turned on and off at will; by default
+% they are off if the attribute |withprosodicmarks|
+% has not been set.
+%
+% \begin{macro}{\ProsodicMarksOn}
+% \begin{macro}{\ProsodicMarksOff}
+% We begin by adding to the normal typesetting style the
+% definitions of the new commands |\ProsodicMarksOn| and
+% |\ProsodicMarksOff| that should produce error messages when
+% this style is not declared:
+% \begin{macrocode}
+\addto\extraslatin{\def\ProsodicMarksOn{%
+\GenericError{(latin)\@spaces\@spaces\@spaces\@spaces}%
+ {Latin language error: \string\ProsodicMarksOn\space
+ is defined by setting the\MessageBreak
+ language attribute to `withprosodicmarks'\MessageBreak
+ If you continue you are likely to encounter\MessageBreak
+ fatal errors that I can't recover}%
+ {See the Latin language description in the babel
+ documentation for explanation}{\@ehd}}}
+\addto\extraslatin{\let\ProsodicMarksOff\relax}
+% \end{macrocode}
+%
+% Next we temporarily set the caret and the equals sign to active
+% characters so that they can receive their definitions:
+% \begin{macrocode}
+\catcode`\= \active
+\catcode`\^ \active
+% \end{macrocode}
+% and we add the necessary declarations to the macros that are
+% being activated when the Latin language and its typesetting
+% styles are declared:
+% \begin{macrocode}
+\addto\extraslatin{\languageshorthands{latin}}%
+\addto\extraswithprosodicmarks{\bbl@activate{^}}%
+\addto\extraswithprosodicmarks{\bbl@activate{=}}%
+\addto\noextraswithprosodicmarks{\bbl@deactivate{^}}%
+\addto\noextraswithprosodicmarks{\bbl@deactivate{=}}%
+\addto\extraswithprosodicmarks{\ProsodicMarks}
+% \end{macrocode}
+%
+% \begin{macro}{\ProsodicMarks}
+% Next we define the macros for the active characters
+% \begin{macrocode}
+\def\ProsodicMarks{%
+\def\ProsodicMarksOn{\catcode`\^ 13\catcode`\= 13\relax}%
+\def\ProsodicMarksOff{\catcode`\^ 7\catcode`\= 12\relax}%
+}
+% \end{macrocode}
+% Notice that with the above redefinitions of the commands
+% |\ProsodicMarksOn| and |\ProsodicMarksOff|, the operation of the
+% newly defined shorthands may be switched on and off at will, so
+% that even if a picture has to be inserted in the document by
+% means of the commands and keyword options of the \pkg{graphicx}
+% package, it suffices to switch them off before invoking the
+% picture including command, and switched on again afterwards; or,
+% even better, since the picture very likely is being inserted
+% within a |figure| environment, it suffices to switch them off
+% within the environment, being conscious that their deactivation
+% remains local to the environment.
+% \changes{latin-2.0g}{2005/11/17}{changed \cs{allowhyphens} to
+% \cs{bbl@allowhyphens}}
+% \begin{macrocode}
+\initiate@active@char{^}%
+\initiate@active@char{=}%
+\declare@shorthand{latin}{^a}{%
+ \textormath{\u{a}\bbl@allowhyphens}{\hat{a}}}%
+\declare@shorthand{latin}{^e}{%
+ \textormath{\u{e}\bbl@allowhyphens}{\hat{e}}}%
+\declare@shorthand{latin}{^i}{%
+ \textormath{\u{\i}\bbl@allowhyphens}{\hat{\imath}}}%
+\declare@shorthand{latin}{^o}{%
+ \textormath{\u{o}\bbl@allowhyphens}{\hat{o}}}%
+\declare@shorthand{latin}{^u}{%
+ \textormath{\u{u}\bbl@allowhyphens}{\hat{u}}}%
+%
+\declare@shorthand{latin}{=a}{%
+ \textormath{\={a}\bbl@allowhyphens}{\bar{a}}}%
+\declare@shorthand{latin}{=e}{%
+ \textormath{\={e}\bbl@allowhyphens}{\bar{e}}}%
+\declare@shorthand{latin}{=i}{%
+ \textormath{\={\i}\bbl@allowhyphens}{\bar{\imath}}}%
+\declare@shorthand{latin}{=o}{%
+ \textormath{\={o}\bbl@allowhyphens}{\bar{o}}}%
+\declare@shorthand{latin}{=u}{%
+ \textormath{\={u}\bbl@allowhyphens}{\bar{u}}}%
+% \end{macrocode}
+% Notice that the short hand definitions are given only for lower
+% case letters; it would not be difficult to extend the set of
+% definitions to upper case letters, but it appears of very little
+% use in view of the kinds of document where prosodic marks are
+% supposed to be used. Nevertheless in those rare cases when it's
+% required to set some uppercase letters with their prosodic
+% marks, it is always possible to use the standard \LaTeX\ commands
+% such as |\u{I}| for typesetting \u{I}, or |\={A}| (or |\=A|) for
+% typesetting~\=A.
+%
+% Finally we restore the caret and equals sign initial default
+% category codes
+% \begin{macrocode}
+\catcode`\= 12\relax
+\catcode`\^ 7\relax
+% \end{macrocode}
+% so as to avoid conflicts with other packages or other \babel\
+% options.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\LatinMarksOn}
+% \begin{macro}{\LatinMarksOff}
+% \changes{latin-2.0g}{2005/11/17}{Added two commands}
+% \changes{latin-2.0h}{2007/10/19}{Added missing backslash}
+% The following commands remain defined for backwards compatibility,
+% but they are obsolete and should not be used.
+% \changes{latin-2.0h}{2007/10/20}{Removed the setting of
+% \cs{LatinMarksOff} from \cs{extraslatin}}
+% \begin{macrocode}
+\addto\extraslatin{\def\LatinMarksOn{\shorthandon{^}\shorthandon{=}}}
+\addto\extraslatin{\def\LatinMarksOff{\shorthandoff{^}\shorthandoff{=}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% It must be understood that by using the above prosodic marks,
+% line breaking is somewhat impeached; since such prosodic marks
+% are used almost exclusively in dictionaries, grammars, and poems
+% (only in school textbooks), this shouldn't be of any importance
+% for what concerns the quality of typesetting.
+%
+%\changes{latin-3.5}{2015/08/20}{New subsection}
+% \subsection{Ecclesiastic Latin style}
+% We declare the |ecclesiastic| attribute; its purpose is to load the
+% \pkg{ecclesiastic.sty} package, deferring this action to the moment when
+% \babel\ finishes executing; actually it sends \babel\ the information to act;
+% then \babel\ defers the package loading to the |\begin{document}| execution.
+% This implies the availability of the |\AtEndOfPackage| and |\AtBeginDocument|
+% macros which are contained in the \LaTeX\ kernel. Since
+% this file is read by \babel\ the current package at the end of which
+% the code is deferred is \babel\ itself, not simply this language description
+% file.
+%
+% Differently from other attribute settings we do not declare anything
+% in a possible |\extrasecclesiasticlatin| macro, because once the package
+% has been read, it is impossible to pretend to delete all what the package
+% defined. Actually this |ecclesiastic| attribute simply mimics the actual
+% loading of a package by means of a |\usepackage| or |\RequirePackage| command;
+% if loading was done with one of these commands, it would be impossible to
+% unload the loaded package.
+% \begin{macrocode}
+\bbl@declare@ttribute{latin}{ecclesiastic}{%
+\AtEndOfPackage{%
+ \AtBeginDocument{\RequirePackage{ecclesiastic}[2015/08/20]}%
+ }%
+}
+% \end{macrocode}
+%
+% \changes{latin-2.0j}{2014/02/18}{Renamed this section to subsection}
+% \subsection{Etymological hyphenation}
+% In order to deal in a clean way with prefixes and compound words
+% to be divided etymologically, the active character |"| is given
+% a special definition so as to behave as a discretionary break
+% with hyphenation allowed after it. You may consider this sign as a
+% substitute for a ``compound word mark''.
+%
+% This is particularly useful with classical Latin because this
+% language requires etymological hyphenation; patterns were created
+% with etymological hyphenation in mind, but even if for certain
+% prefixes or suffixes it works pretty well, it does not for certain
+% other ones. For example the word `redire' should be hyphenated as
+% `red-i-re'; but there are plenty of other words starting with the
+% string `red' that does not play the role of a prefix; therefore
+% it should be necessary to extract all the Latin words where `red'
+% is a prefix, and enter the suitable patterns to hyphenate correctly
+% only those words; in the simple case of the verb `redire' it would
+% be necessary to enter all the words that belong to the conjugation
+% of this verb and the declination of the present, future and past
+% participles and gerundive in masculine, feminine and neutral forms;
+% the same problem takes place with prefix `trans' where sometimes it is
+% a real prefix, such as in `transire' (hyphenation trans-i-re), and
+% sometimes is modified with the absorption of an initial `s' of the
+% suffix, such as in `transubstantialis' (classical hyphenation:
+% tran-subs-tan-tia-lis).
+
+% Obviously this task would render the pattern file enormous, and mostly
+% useless. The active character |"| solves the problem for isolated instances,
+% while the hyphenations exception lists of the only forms actually used
+% in a specific document, would do the rest.
+%
+% Most of the code for dealing with the active |"| is already
+% contained in the core of \babel, but we are going to use it as a
+% single character shorthand for Latin.
+% \begin{macrocode}
+\initiate@active@char{"}%
+\addto\extraslatin{\bbl@activate{"}%
+}
+% \end{macrocode}
+%
+% A temporary macro is defined so as to take different actions in math
+% mode and text mode: specifically in the former case the macro inserts a
+% double quote as it should in math mode, otherwise another delayed macro
+% comes into action.
+% \begin{macrocode}
+\declare@shorthand{latin}{"}{%
+ \textormath{\def\lt@@next{\futurelet\lt@temp\lt@cwm}}%
+ {\def\lt@@next{''}}%
+ \lt@@next
+}%
+% \end{macrocode}
+% In text mode the \cs{lt@@next} control sequence is such that upon
+% its execution a temporary variable \cs{lt@temp} is made
+% equivalent to the next token in the input list without actually
+% removing it. Such temporary token is then tested by the macro
+% \cs{lt@cwm} and if it is found to be a letter token, then it
+% introduces a compound word separator control sequence
+% \cs{lt@allowhyphens} whose expansion introduces a discretionary
+% hyphen and an unbreakable space; in case the token is not a
+% letter, it is tested against the definitions of |\ae| and |\oe|,
+% and if the test is true than such definitions are treated as
+% letters (as they actually are), otherwise the token is tested
+% again to find if it is the character \texttt{\string|}, in which
+% case it is gobbled and a discretionary break is introduced.
+% \changes{latin-2.0g}{2005/11/17}{Added a \cs{nobreak}}
+% \changes{latin-3.0}{2014/06/01}{\cs{lt@allowhyphens} rewritten so as
+% to use the babel core command \cs{bbl@allowhyphens}}
+% \changes{latin-3.0}{2014/06/01}{Introduced the tests for the ligatures
+% \cs{ae} and \cs{oe}}
+% \begin{macrocode}
+\def\lt@allowhyphens{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}
+
+\newcommand*{\lt@cwm}{\let\lt@n@xt\relax
+ \ifcat\noexpand\lt@temp a%
+ \let\lt@n@xt\lt@allowhyphens
+ \else
+ \ifx\lt@temp\ae
+ \let\lt@n@xt\lt@allowhyphens
+ \else
+ \ifx\lt@temp\oe
+ \let\lt@n@xt\lt@allowhyphens
+ \else
+ \if\noexpand\lt@temp\string|%
+ \def\lt@n@xt{\lt@allowhyphens\@gobble}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \lt@n@xt}%
+% \end{macrocode}
+%
+% Attention: the ligature commands |\ae| and |\oe| are detected correctly
+% if they are not included within a group. In facts an input such as
+% |super"{\ae}quitas|\footnote{This word does not exist in
+% ``regular'' Latin, and it is used just as an example.} gets wrongly
+% hyphenated as \texttt{su-pe-r\ae-qui-tas} while |super"\ae{}quitas|,
+% that uses an empty group to terminate the |\ae| control sequence, gets
+% correctly hyphenated as \texttt{su-per-\ae-qui-tas}. If one prefers to
+% close the |\ae| or |\oe| ligature commands within a group, then it is
+% necessary to use the alternate etymological hyphenation command \verb+"|+
+% as in \verb!super"|{\ae}quitas! in order to get
+% \texttt{su-per-{\ae}-qui-tas}.
+% .
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{latin}
+% \end{macrocode}
+%\iffalse
+%</code>
+%\fi
+%
+% \Finale
+%
+\endinput
+
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.ins b/macros/latex/contrib/babel-contrib/latin/latin.ins
new file mode 100644
index 0000000000..b7b8bac612
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latin/latin.ins
@@ -0,0 +1,95 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2000 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system, release 3.7.
+%% ---------------------------------------------------
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.1 or, at your option, any later version.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2014/05/27}
+\def\batchfile{latin.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+
+This is a generated file.
+
+Copyright 1989-2000 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is part of the Babel system release 3.7.
+--------------------------------------------------
+
+It may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.1 or, at your option, any later version.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2000 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is part of the Babel system, release 3.7.
+---------------------------------------------------
+
+It may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.1 or, at your option, any later version.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usepreamble\mainpreamble
+\generate{\file{latin.ldf}{\from{latin.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.pdf b/macros/latex/contrib/babel-contrib/latin/latin.pdf
new file mode 100644
index 0000000000..592b907926
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latin/latin.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/latvian/README.md b/macros/latex/contrib/babel-contrib/latvian/README.md
new file mode 100644
index 0000000000..dc9d7d99e9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latvian/README.md
@@ -0,0 +1,21 @@
+## Latvian 2.0b
+
+This is the babel style for Latvian. It bears the version number 2.0
+because there were a 1.x, by Andris Lasis. Version 2.0 is heavily
+based on the latter.
+
+### Changes 2.0b
+
+```
+* Fix - Extra space was inserted by \extraslatvian
+```
+
+### Changes 2.0a
+
+```
+* UTF-8 encoded strings for XeTeX and LuaTeX
+* Modififier t1composite, which redefines some T1 'composite commands'
+ related to the cedilla.
+```
+
+2018-02-19 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/latvian/latvian.dtx b/macros/latex/contrib/babel-contrib/latvian/latvian.dtx
new file mode 100644
index 0000000000..82c44e2980
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latvian/latvian.dtx
@@ -0,0 +1,459 @@
+% \iffalse meta-comment
+%
+% Copyright 1999 - 2000 Andris Lasis, 2014-2018 Javier Bezos and any
+% individual authors listed elsewhere in this file. All rights
+% reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% This works is heavily based on the previous work by:
+%
+% Copyright (C) 1999 - 2000
+% by Andris Lasis, Faculty of Physics and Mathematics,
+% University of Latvia
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{latvian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{latvian}
+% \fi
+% \ProvidesLanguage{latvian}
+ [2018/02/19 v2.0b Latvian support from the babel system]
+% \iffalse
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[L7x,T1]{fontenc}
+\title{The Latvian style for babel}
+\author{Andris Lasis, Javier Bezos}
+\newcommand*\babel{\textsf{babel}}
+\DeclareTextCompositeCommand{\=}{T1}{i}{\={\i}}
+\begin{document}
+ \maketitle
+ \DocInput{latvian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \section{The Latvian Language}
+%
+% The file \textsf{latvian.ldf}\footnote{The file described in this
+% section has version number 2.0a and was last revised on 2018/02/19.}
+% defines the language definition macros for the Latvian language. It
+% is heavily based on the work by Andris Lasis, and this file just
+% cleans the code up and adapts it to babel 3.9.
+%
+% Since the |T1| encoding doesn't contain all the characters required
+% for Latvian, you should use |L7x| instead (note the lowercase
+% |x|). The |dfu| file (ie, |utf8| for \textsf{fontenc}) for this
+% encoding is included in Lithuanian. Unfortunately, not many fonts
+% come in this encoding. Of course, you can use either \textsf{luatex} or
+% \textsf{xetex}, too, because Unicode strings are also defined.
+%
+% Actually, you can use the |T1| encoding, but hyphenation will not be
+% correct, and oddly it doesn't work with \textsf{inputenc} and |utf8|
+% (future releases will fix this issue), except if you request the
+% |L7x| encoding before |T1| (this is, of course, just a trick, which
+% may not work; note some fonts render macron-i with the dot, because
+% |l7xenc.def| defines it as |\=i|). If |T1| is used, you must load
+% \textsf{fontenc} before \textsf{babel} and set the modifier
+% |t1composite| (because it redefines some `composite commands' which
+% may affect other languages). A complete example is:
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage[utf8]{inputenc}
+%\usepackage[L7x,T1]{fontenc}
+%\usepackage{combelow} % Optional, see below
+%\usepackage[latvian.t1composite]{babel}
+%\usepackage{fourier}
+%
+%\begin{document}
+%Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ,
+%Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž
+%\end{document}
+%\end{verbatim}
+% By loading also the package \textsf{combelow} you get much better
+% results (it is detected automatically), but you should use |T1| only
+% as a last resort and only for small chuncks of Latvian text. |OT1|
+% is not directly supported.
+%
+% There are two commands for the date: |\datumaa| (locative) and
+% |\datums| (nominative); |\today| is defined as |\datumaa|, but you
+% can change it with |\renewcommand{\latviantoday}{\datums}|. By
+% default \textit{g.} is used, but you can change it with, say,
+% |\renewcommand\latviangada{gada}|.
+%
+% |\alph| and |\Alph| exclude the letter \textit{q}.
+%
+% \StopEventually{}
+%
+% \subsection*{The code}
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{latvian}\captionslatvian
+\ifx\l@latvian\@undefined
+ \@nopatterns{Latvian}
+ \adddialect\l@latvian0
+\fi
+% \end{macrocode}
+%
+% Captions and date.
+%
+% \begin{macrocode}
+\StartBabelCommands*{latvian}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+
+\SetString\prefacename{Priekšvārds}
+\SetString\refname{Literatūra}
+\SetString\abstractname{Anotācija}
+\SetString\bibname{Bibliogrāfija}
+\SetString\chaptername{nodaļa}
+\SetString\listfigurename{Attēlu rādītājs}
+\SetString\listtablename{Tabulu rādītājs}
+\SetString\indexname{Priekšmetu rādītājs}
+\SetString\figurename{zīm.\@}
+\SetString\partname{daļa}
+\SetString\enclname{Pielikumā}
+\SetString\alsoname{skat.\@ arī}
+
+\StartBabelCommands*{latvian}{date}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+
+\SetStringLoop{month#1name}{janvārī,februārī,martā,aprīlī,maijā,%
+ jūnijā,jūlijā,augustā,septembrī,oktobrī,novembrī,decembrī}
+\SetStringLoop{nommonth#1name}{janvāris,februāris,marts,aprīlis,maijs,%
+ jūnijs,jūlijs,augusts,septembris,oktobris,novembris,decembris}
+
+\StartBabelCommands*{latvian}{captions}
+
+\SetString\prefacename{Priek\v sv\=ards}%
+\SetString\refname{Literat\=ura}
+\SetString\abstractname{Anot\=acija}
+\SetString\bibname{Bibliogr\=afija}
+\SetString\chaptername{noda\c la}
+\SetString\appendixname{Pielikums}
+\SetString\contentsname{Saturs}
+\SetString\listfigurename{Att\=elu r\=ad\={\i}t\=ajs}
+\SetString\listtablename{Tabulu r\=ad\={\i}t\=ajs}
+\SetString\indexname{Priek\v smetu r\=ad\={\i}t\=ajs}
+\SetString\figurename{z\={\i}m.\@}
+\SetString\tablename{tabula}
+\SetString\partname{da\c la}
+\SetString\enclname{Pielikum\=a}
+\SetString\ccname{Kopija(s)}
+\SetString\headtoname{}
+\SetString\pagename{lpp.\@}
+\SetString\seename{skat.\@}
+\SetString\alsoname{skat.\@ ar\={\i}}
+
+\StartBabelCommands*{latvian}{date}
+
+\SetStringLoop{month#1name}{janv\=ar\={\i},febru\=ar\={\i},mart\=a,%
+ apr\={\i}l\={\i},maij\=a,j\=unij\=a,j\=ulij\=a,august\=a,%
+ septembr\={\i},oktobr\={\i},novembr\={\i},decembr\={\i}}
+\SetStringLoop{nommonth#1name}{janv\=aris,febru\=aris,marts,%
+ apr\={\i}lis,maijs,j\=unijs,j\=ulijs,augusts,septembris,%
+ oktobris,novembris,decembris}
+
+\SetString\datumaa{\number\year.~\latviangada\ \number\day.~%
+ \csname month\romannumeral\month name\endcsname}
+\SetString\datums{\number\year.~\latviangada\ \number\day.~%
+ \csname nommonth\romannumeral\month name\endcsname}
+
+\SetString\today{\datumaa}
+
+\AfterBabelCommands{\newcommand\latviangada{g.}}
+
+\EndBabelCommands
+% \end{macrocode}
+%
+% Section numbering.
+%
+% \begin{macrocode}
+\gdef\the@chapter{%
+ \ifx\chapter\undefined\relax\else
+ \ifnum\c@chapter>\z@\thechapter\fi\fi}
+\def\thechapter{%
+ \ifx\chapter\undefined\relax\else
+ \arabic{chapter}.\fi}
+\def\thesection{\the@chapter\arabic{section}.}
+\def\thesubsection{\thesection\arabic{subsection}.}
+\def\thesubsubsection{\thesubsection\arabic{subsubsection}.}
+\def\theparagraph{\thesubsubsection\arabic{paragraph}.}
+\def\thesubparagraph{\theparagraph\arabic{subparagraph}.}
+% \end{macrocode}
+%
+% Part numbering
+%
+% \begin{macrocode}
+\def\depth@{\ifx\chapter\undefined\m@ne\else-2\relax\fi}
+\def\@part[#1]#2{%
+ \relax
+ \ifnum\c@secnumdepth>\depth@
+ \refstepcounter{part}
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}\fi
+ \ifx\chapter\undefined
+ \bgroup\parindent\z@\raggedright
+ \else
+ \markboth{}{}\bgroup\centering
+ \fi
+ \interlinepenalty\@M
+ \ifnum\c@secnumdepth>\depth@
+ \normalfont\bfseries\thepart~\partname % adapted to Latvian order
+ \par
+ \ifx\chapter\undefined\nobreak\else\vskip 20\p@\fi
+ \fi
+ \ifx\chapter\undefined\huge\else\Huge\fi\normalfont\bfseries#2%
+ \ifx\chapter\undefined\markboth{}{}\fi
+ \par\egroup
+ \ifx\chapter\undefined\nobreak
+ \vskip3ex \@afterheading\else\@endpart
+ \fi}
+% \end{macrocode}
+%
+% Chapter head
+%
+% \begin{macrocode}
+\def\@makechapterhead#1{%
+ \vspace*{50pt}%
+ {\parindent 0pt \raggedright
+ \ifnum\c@secnumdepth>\m@ne
+ \huge\normalfont\bfseries\thechapter\space\@chapapp{}%
+ \par
+ \vskip20pt
+ \fi
+ \Huge\normalfont\bfseries#1\par\nobreak\vskip40pt }}
+% \end{macrocode}
+%
+% First paragraph indent (of the text following a heading).
+%
+% \begin{macrocode}
+\let\@aifORI\@afterindentfalse
+\def\bbl@latvianindent{%
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+\def\bbl@nonlatvianindent{%
+ \let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
+\addto\extraslatvian{\bbl@latvianindent}
+\addto\noextraslatvian{\bbl@nonlatvianindent}
+% \end{macrocode}
+%
+% Float numbering.
+%
+% \begin{macrocode}
+\def\thefigure{\the@chapter\@arabic\c@figure.}
+\def\thetable{\the@chapter\@arabic\c@table.}
+\def\fnum@figure{\thefigure~\figurename}
+\def\fnum@table{\thetable~\tablename}
+\long\def\@makecaption#1#2{%
+ \vskip10\p@
+ \sbox\@tempboxa{#1\if\empty#2\else: #2\fi}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1: #2\par
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi}
+% \end{macrocode}
+%
+% Theorems
+%
+% \begin{macrocode}
+\def\@thmcountersep{}
+\gdef\@makethmnumber#1#2{%
+ \ifx\thmno@left0{#1\ #2}\else {#2. #1}\fi}
+\def\@begintheorem#1#2{%
+ \normalfont\itshape\trivlist
+ \item[\hskip\labelsep
+ \hskip\parindent\normalfont\bfseries
+ {\@makethmnumber{#1}{#2}}.]}
+\def\@opargbegintheorem#1#2#3{%
+ \normalfont\itshape\trivlist
+ \item[\hskip\labelsep \hskip\parindent\normalfont\bfseries
+ {\@makethmnumber{#1}{#2} (#3).}]}
+\gdef\thmnoleft{\let\thmno@left=1}
+\gdef\thmnoright{\let\thmno@left=0}
+\thmnoleft
+% \end{macrocode}
+%
+% Equations
+%
+% \begin{macrocode}
+\def\theequation{\the@chapter\arabic{equation}}
+% \end{macrocode}
+%
+% Marks.
+%
+% \begin{macrocode}
+\ifx\@chapapp\undefined
+ \if@twoside
+ \def\sectionmark#1{%
+ \markboth
+ {\uppercase{\ifnum\c@secnumdepth>\z@ne\thesection\hskip1em\relax\fi#1}}%
+ {}}
+ \def\subsectionmark#1{%
+ \markright
+ {\uppercase{\ifnum\c@secnumdepth>\@ne\thesubsection\ \fi#1}}}
+ \else
+ \def\sectionmark#1{%
+ \markright
+ {\uppercase{\ifnum\c@secnumdepth>\z@\thesection\hskip1em\relax\fi#1}}}
+ \fi%
+\else
+ \def\chaptermark#1{%
+ \markboth
+ {\uppercase{\ifnum\c@secnumdepth>\m@ne\thechapter~\@chapapp: \fi#1}}%
+ {}}
+ \def\sectionmark#1{%
+ \markright{\uppercase{\ifnum\c@secnumdepth>\z@\thesection\ \fi#1}}}
+\fi
+% \end{macrocode}
+%
+% Counters. Only locally.
+%
+% \begin{macrocode}
+\addto\extraslatvian{%
+ \babel@save\@alph
+ \def\@alph#1{%
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or
+ l\or m\or n\or o\or p\or r\or s\or t\or u\or v\or
+ z\else\@ctrerr\fi}%
+ \babel@save\@Alph
+ \def\@Alph#1{%
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or
+ L\or M\or N\or O\or P\or R\or S\or T\or U\or V\or Z\else\@ctrerr\fi}}
+% \end{macrocode}
+%
+% Hyphenmins and shorthands.
+%
+% \begin{macrocode}
+\def\latvianhyphenmins{\tw@\tw@}
+\initiate@active@char{"}
+\addto\extraslatvian{\languageshorthands{latvian}}
+\addto\extraslatvian{\bbl@activate{"}}
+
+\DeclareTextCompositeCommand{\=}{OT1}{i}{\@tabacckludge={\i}}
+\DeclareTextCompositeCommand{\=}{T1}{i}{\@tabacckludge={\i}}
+
+\@expandtwoargs\in@{,t1composite,}{,\BabelModifiers,}
+\ifin@
+
+ \DeclareTextCommand{\lv@cb}{T1}[1]% same as \c
+ {\leavevmode
+ \setbox\z@\hbox{#1}%
+ \ifdim\ht\z@=1ex\accent11 #1%
+ \else{\ooalign{\unhbox\z@\crcr\hidewidth\char11\hidewidth}}%
+ \fi}
+ \let\lv@cbg\lv@cb
+
+ \DeclareTextCompositeCommand{\c}{T1}{g}{\lv@cbg{g}}
+ \DeclareTextCompositeCommand{\c}{T1}{G}{\lv@cb{G}}
+ \DeclareTextCompositeCommand{\c}{T1}{r}{\lv@cb{r}}
+ \DeclareTextCompositeCommand{\c}{T1}{R}{\lv@cb{R}}
+ \DeclareTextCompositeCommand{\c}{T1}{k}{\lv@cb{k}}
+ \DeclareTextCompositeCommand{\c}{T1}{K}{\lv@cb{K}}
+ \DeclareTextCompositeCommand{\c}{T1}{l}{\lv@cb{l}}
+ \DeclareTextCompositeCommand{\c}{T1}{L}{\lv@cb{L}}
+ \DeclareTextCompositeCommand{\c}{T1}{n}{\lv@cb{n}}
+ \DeclareTextCompositeCommand{\c}{T1}{N}{\lv@cb{N}}
+
+ \def\lv@ifcombelow{\@ifpackageloaded{combelow}}
+ \AtBeginDocument{% because \@ifpackageloaded is 'only preamble'
+ \@ifpackageloaded{combelow}%
+ {\let\lv@ifcombelow\@firstoftwo}%
+ {\let\lv@ifcombelow\@secondoftwo}}
+
+ \addto\extraslatvian{%
+ \babel@save\lv@cbg
+ \lv@ifcombelow
+ {\babel@save\lv@cb
+ \let\lv@cb\cb
+ \let\lv@cbg\cb}%
+ {\let\lv@cbg\v}}
+
+\fi
+
+\declare@shorthand{latvian}{"a}{\textormath{\={a}}{\=a}}
+\declare@shorthand{latvian}{"e}{\textormath{\={e}}{\=e}}
+\declare@shorthand{latvian}{"u}{\textormath{\={u}}{\=u}}
+\declare@shorthand{latvian}{"i}{\textormath{\={\i}}{\=\i}}
+\declare@shorthand{latvian}{"o}{\textormath{\={o}}{\=o}}
+
+\declare@shorthand{latvian}{"A}{\textormath{\={A}}{\=A}}
+\declare@shorthand{latvian}{"E}{\textormath{\={E}}{\=E}}
+\declare@shorthand{latvian}{"U}{\textormath{\={U}}{\=U}}
+\declare@shorthand{latvian}{"I}{\textormath{\={I}}{\=I}}
+\declare@shorthand{latvian}{"O}{\textormath{\={O}}{\=O}}
+
+\declare@shorthand{latvian}{"r}{\textormath{\c{r}}{\c r}}
+\declare@shorthand{latvian}{"s}{\textormath{\v{s}}{\v s}}
+\declare@shorthand{latvian}{"g}{\textormath{\c{g}}{\c g}}
+\declare@shorthand{latvian}{"k}{\textormath{\c{k}}{\c k}}
+\declare@shorthand{latvian}{"l}{\textormath{\c{l}}{\c l}}
+\declare@shorthand{latvian}{"z}{\textormath{\v{z}}{\v z}}
+\declare@shorthand{latvian}{"c}{\textormath{\v{c}}{\v c}}
+\declare@shorthand{latvian}{"n}{\textormath{\c{n}}{\c n}}
+
+\declare@shorthand{latvian}{"R}{\textormath{\c{R}}{\c R}}
+\declare@shorthand{latvian}{"S}{\textormath{\v{S}}{\v S}}
+\declare@shorthand{latvian}{"G}{\textormath{\c{G}}{\c G}}
+\declare@shorthand{latvian}{"K}{\textormath{\c{K}}{\c K}}
+\declare@shorthand{latvian}{"L}{\textormath{\c{L}}{\c L}}
+\declare@shorthand{latvian}{"Z}{\textormath{\v{Z}}{\v Z}}
+\declare@shorthand{latvian}{"C}{\textormath{\v{C}}{\v C}}
+\declare@shorthand{latvian}{"N}{\textormath{\c{N}}{\c N}}
+
+\declare@shorthand{latvian}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{latvian}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{latvian}{""}{\hskip\z@skip}
+\declare@shorthand{latvian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{latvian}{"=}{\penalty\@M-\hskip\z@skip}
+
+\ldf@finish{latvian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+% \endinput
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/latvian/latvian.ins b/macros/latex/contrib/babel-contrib/latvian/latvian.ins
new file mode 100644
index 0000000000..2f81a80010
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latvian/latvian.ins
@@ -0,0 +1,150 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2014 Javier Bezos and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2014/05/02}
+\def\batchfile{latvian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2014 Javier Bezos and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2014 Javier Bezos and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{latvian.ldf}{\from{latvian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/latvian/latvian.pdf b/macros/latex/contrib/babel-contrib/latvian/latvian.pdf
new file mode 100644
index 0000000000..fce2fa1395
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latvian/latvian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/macedonian/README.md b/macros/latex/contrib/babel-contrib/macedonian/README.md
new file mode 100644
index 0000000000..b3fbc909de
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/macedonian/README.md
@@ -0,0 +1,28 @@
+Macedonian cyrillic support for LaTeX Babel
+
+maintainer: Stojan Trajanovski, [name].[surname]@gmail.com
+
+This package may be distributed under the terms of the LaTeX Project Public License
+
+1. INSTALLATION AND MODIFICATIONS
+
+Installation:
+1. Just copy the file macedonian.ldf, where (a) your .tex document is stored; or (b) in your latex distribution babel folder.
+
+If you want to modify something:
+1. compile the file: macedonian.dtx using pdfLatex
+2. compile the file: macedonian.ins using pdfLatex, after completing 1. A file named: macedonian.ldf will be created
+3. copy this file (macedonian.ldf), where your .tex document is stored or in your latex distribution babel folder.
+
+
+2. HOW TO USE IT
+
+You set the keyboard layout to Macedonian cyrillic, and you have to use unicode-compliant text editor. You also have to save your file in utf-8x encoding.
+
+All you have to do, in order to use Macedonian cyrillic support for latex is typing:
+
+\usepackage[utf8x]{inputenc}
+
+\usepackage[macedonian]{babel}
+
+somewhere near the beginning of your .tex file. \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/macedonian/macedonian.dtx b/macros/latex/contrib/babel-contrib/macedonian/macedonian.dtx
new file mode 100644
index 0000000000..ee0997a1f8
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/macedonian/macedonian.dtx
@@ -0,0 +1,983 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Stojan Trajanovski.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1401}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{macedonian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{macedonian}
+ [2016/02/05 v1.1 Macedonian support from the babel system]
+%
+%% File `macedonian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989-2008
+%% by Johannes Braams,TeXniek
+%
+%% Macedonian Language Definition File
+%% Copyright (C) [to be defined]
+%
+%% Adapted from bulgarian.dtx
+%% by Stojan.Trajanovski <stojan.trajanovski at gmail.com>
+%
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand\TeXhax{\TeX hax}
+\newcommand\babel{\textsf{babel}}
+\newcommand\langvar{$\langle\it lang \rangle$}
+\newcommand\note[1]{}
+\newcommand\Lopt[1]{\textsf{#1}}
+\newcommand\file[1]{\texttt{#1}}
+\newcommand\pkg[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{macedonian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{macedonian.dtx}
+%
+% \section{The Macedonian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. This file provides the source
+% code for the Macedonian language definition file. A contribution
+% was made by Stojan Trajanovski ([name].[surname]@gmail.com)
+%
+% The file heavily relies on the \file{bulgarian.dtx} version of the babel class and \file{bulgarian.dtx} was used as a starting point. \file{bulgarian.dtx} was initially developed by Georgi N. Boshnakov with a final modification by Johannes L. Braams. In addition, some parts from \file{serbianc.dtx} (created by Filip Br\v{c}i\'{c}) are also used. The specific differences of the Macedonian language from Bulgarian and Serbian have been addressed in this class.} provides the language-specific macros for the
+% Macedonian language.
+%
+% \subsection{Most important points}
+% The following most important points of the Macedonian language are implemented in this class:
+% \begin{enumerate}
+%\item The alphabet is complete and is in a correct order, so the numbering (enumerate option) will be in a correct way in Macedonian.
+%\item Some italic letters in Macedonian (like: d, g, t, p) differ from Bulgarian (and Russian). These characters in italic are perhaps similar to Serbian language. Moreover, the character gje "g with accent" is unique and does not appear in both Bulgarian and Serbian alphabets. These issues have been addressed in the class.
+% \item The first paragraph of each section is indented.
+%\item The date format is according to the Macedonian practice. (e.g., [dd] [month in Macadonian] [yyyy] god.)
+%\item All the terms like chapter, bibliography, index, figure, table, theorem, months names are all adjusted according to the Macedonian practice in books and other materials.
+%\end{enumerate}
+% Various ``cyrillic'' dashes and quotation marks traditionally used in Macedonian are borrowed
+% from German language. French quotation marks may be seen as well in older books. To make them available, the implementation from \file{bulgarian.dtx} have been inherited for this class. Additional details for dashes and quotation marks can be found in \file{bulgarian.dtx}. % For example, the character |"| is made active. %
+% \subsection{Updates to v1.1.}
+% The month names are now in accordance with the Macedonian orthography i.e. a month starts with a non-capital letter\footnote{Dario Gjorgjevski contributed for this addition.}. A small typo is fixed.
+%
+% \StopEventually{}
+% \subsection{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{macedonian}{captionsmacedonian}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{macedonian} will be an `unknown' language, in
+% which case we have to make it known. So we check for the
+% existence of |\l@macedonian| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\l@macedonian\@undefined
+ \@nopatterns{Macedonian}
+ \adddialect\l@macedonian0
+\fi
+% \end{macrocode}
+%
+%
+%
+% \begin{macro}{\latinencoding}
+%
+% We need to know the encoding for text that is supposed to be
+% which is active at the end of the \babel\ package. If the
+% \pkg{fontenc} package is loaded later, then \ldots too bad!
+%
+% \begin{macrocode}
+\let\latinencoding\cf@encoding
+% \end{macrocode}
+%
+% \end{macro}
+%
+% The user may choose between different available Cyrillic
+% encodings---e.g., \texttt{X2}, \texttt{LCY}, or \texttt{LWN}.
+% If the user wants to use a font encoding other than the default
+% (\texttt{T2A}), he has to load the corresponding file
+% \emph{before} \file{macedonian.sty}.
+% This may be done in the following way:
+%
+% \begin{verbatim}
+% \usepackage[LCY,OT1]{fontenc} %overwrite the default encoding;
+% \usepackage[english,macedonian]{babel}
+% \end{verbatim}
+% \unskip
+%
+% Note: most people would prefer the \texttt{T2A} to \texttt{X2},
+% because \texttt{X2} does not contain Latin letters, and users
+% should be very careful to switch the language every time they
+% want to typeset a Latin word inside a Macedonian phrase or vice
+% versa. On the other hand, switching the language is a good
+% practice anyway. With a decent text processing program it does
+% not involve more work than switching between the Macedonian and
+% English keyboard. Moreover that the far most common disruption
+% occurs as a result of forgetting to switch back to cyrillic
+% keyboard.
+%
+% We parse the |\cdp@list| containing the encodings known to
+% \LaTeX\ in the order they were loaded. We set the
+% |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2}, \texttt{LWN},
+% \texttt{LCY}, \texttt{X2}, \texttt{T2C}, \texttt{T2B},
+% \texttt{T2A}, if any.
+%
+%
+% \begin{macrocode}
+\def\reserved@a#1#2{%
+ \edef\reserved@b{#1}%
+ \edef\reserved@c{#2}%
+ \ifx\reserved@b\reserved@c
+ \let\cyrillicencoding\reserved@c
+ \fi}
+\def\cdp@elt#1#2#3#4{%
+ \reserved@a{#1}{OT2}%
+ \reserved@a{#1}{LWN}%
+ \reserved@a{#1}{LCY}%
+ \reserved@a{#1}{X2}%
+ \reserved@a{#1}{T2C}%
+ \reserved@a{#1}{T2B}%
+ \reserved@a{#1}{T2A}}
+\cdp@list
+% \end{macrocode}
+%
+% Now, if |\cyrillicencoding| is undefined, then the user did not
+% load any of supported encodings. So, we have to set
+% |\cyrillicencoding| to some default value. We test the presence
+% of the encoding definition files in the order from less
+% preferable to more preferable encodings. We use the lowercase
+% names (i.e., \file{lcyenc.def} instead of \file{LCYenc.def}).
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
+ \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
+ \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
+ \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
+ \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
+ \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
+ \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax
+% \end{macrocode}
+%
+% If |\cyrillicencoding| is still undefined, then the user seems
+% not to have a properly installed distribution. A fatal error.
+%
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \PackageError{babel}%
+ {No Cyrillic encoding definition files were found}%
+ {Your installation is incomplete. \MessageBreak
+ You need at least one of the following files: \MessageBreak
+ \space\space
+ x2enc.def, t2aenc.def, t2benc.def, t2cenc.def, \MessageBreak
+ \space\space
+ lcyenc.def, lwnenc.def, ot2enc.def.}%
+ \else
+% \end{macrocode}
+%
+% We avoid |\usepackage[\cyrillicencoding]{fontenc}| because we
+% don't want to force the switch of |\encodingdefault|.
+%
+% \begin{macrocode}
+ \lowercase
+ \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% \begin{verbatim}
+% \PackageInfo{babel}
+% {Using `\cyrillicencoding' as a default Cyrillic encoding}%
+% \end{verbatim}
+% \unskip
+%
+%
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Macedonian}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\macedonianhyphenmins
+ \language\l@macedonian}
+\DeclareRobustCommand{\English}{%
+ \fontencoding\latinencoding\selectfont
+ \let\encodingdefault\latinencoding
+ \expandafter\set@hyphenmins\englishhyphenmins
+ \language\l@english}
+\let\Mkd\Macedonian
+\let\Mk\Macedonian
+\let\cyrillictext\Macedonian
+\let\cyr\Macedonian
+\let\Eng\English
+\def\selectenglanguage{\selectlanguage{english}}
+\def\selectmklanguage{\selectlanguage{macedonian}}
+% \end{macrocode}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters,we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+% \end{macrocode}
+%
+% We put |\latinencoding| in braces to avoid problems with |\@alph|
+% inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% \changes{macedonian-1.0c}{2003/06/14}{Added missing closing brace}
+% \begin{macrocode}
+ \def\@Alph@eng#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or
+ X\or Y\or Z\else \@ctrerr\fi}}%
+ \def\@alph@eng#1{{\fontencoding{\latinencoding}\selectfont
+ \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
+ k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or
+ x\or y\or z\else \@ctrerr\fi}}%
+ \let\@Alph\@Alph@eng
+ \let\@alph\@alph@eng
+% \end{macrocode}
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding
+% dependent in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are
+% defined as |\r{A}| and |\r{a}|. This leads to unpredictable
+% results when the font encoding does not contain the Latin letters
+% `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+\fi
+% \end{macrocode}
+%
+% The following block redefines the character class of uppercase
+% Greek letters and some accents, if it is equal to 7 (variable
+% family), to avoid incorrect results if the font encoding in some
+% math family does not contain these characters in places of OT1
+% encoding. The code was taken from |amsmath.dtx|. See comments and
+% further explanation there.
+%
+% \begin{macrocode}
+\begingroup\catcode`\"=12
+% uppercase greek letters:
+\def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
+ "0000\@nil#1}
+\def\@tempb#1"#2#3#4#5#6\@nil#7{%
+\ifnum"#2=7 \count@"1#3#4#5\relax
+\ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
+ \fi}
+\@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
+\@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
+\@tempa\Omega
+% some accents:
+\def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
+\expandafter\@tempa\hat\relax\relax\@nil
+\ifx\@tempb\@tempc
+\def\@tempa#1\@nil{#1}%
+\def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
+\def\do#1"#2{}
+\def\@tempd#1{\expandafter\@tempb#1\@nil
+ \ifnum\@tempc>"FFF
+ \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%
+ \fi}
+\@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
+\@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar
+\fi
+\endgroup
+% \end{macrocode}
+%
+% The user should use the \pkg{inputenc} package when any 8-bit
+% Cyrillic font encoding is used, selecting one of the Cyrillic
+% input encodings. We do not assume any default input encoding, so
+% the user should explicitly call the \pkg{inputenc} package by
+% |\usepackage{inputenc}|. We also removed |\AtBeginDocument|, so
+% \pkg{inputenc} should be used before \babel.
+%
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{}{%
+\def\reserved@a{LWN}%
+\ifx\reserved@a\cyrillicencoding\else
+\def\reserved@a{OT2}%
+\ifx\reserved@a\cyrillicencoding\else
+\PackageWarning{babel}%
+{No input encoding specified for Macedonian language}\fi\fi}
+% \end{macrocode}
+%
+% Now we define two commands that offer the possibility to switch
+% between Cyrillic and Roman encodings.
+%
+% \begin{macro}{\cyrillictext}
+% \begin{macro}{\latintext}
+%
+% The command |\cyrillictext| will switch from Latin font encoding
+% to the Cyrillic font encoding, the command |\latintext| switches
+% back. This assumes that the `normal' font encoding is a Latin
+% one. These commands are \emph{declarations}, for shorter peaces
+% of text the commands |\textlatin| and |\textcyrillic| can be
+% used.
+%
+% We comment out |\latintext| since it is defined in the core of
+% babel (babel.def). We add the shorthand |\lat| for |\latintext|.
+% Note that |\cyrillictext| has been defined above.
+%
+% \begin{macrocode}
+% \DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+\let\lat\latintext
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\textcyrillic}
+% \begin{macro}{\textlatin}
+%
+% These commands take an argument which is then typeset using the
+% requested font encoding.
+% |\textlatin| is commented out since it is defined in the core of
+% babel. (It is defined there with |\DeclareRobustCommand| instead.)
+%
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \DeclareTextFontCommand{\textlatin}{\latintext}
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Macedonian language.
+%
+% \begin{macro}{\captionsmacedonian}
+%
+% The macro |\captionsmacedonian| defines all strings used in the
+% four standard document classes provided with \LaTeX. The two
+% commands |\cyr| and |\lat| activate Cyrillic resp. Latin encoding.
+%
+% \begin{macrocode}
+\addto\captionsmacedonian{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
+ \def\refname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrb\cyrs\cyrt\cyrr\cyra\cyrk\cyrt}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrje\cyra}}%
+ \def\chaptername{%
+ {\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrg}}%
+ \def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyrr\cyrzh\cyri\cyrn\cyra}}%
+ \def\listfigurename{%
+ {\cyr\CYRL\cyri\cyrs\cyrt\cyra\ \cyrn\cyra\ \cyrs\cyrl\cyri\cyrk\cyri}}%
+ \def\listtablename{%
+ {\cyr\CYRL\cyri\cyrs\cyrt\cyra\ \cyrn\cyra\ \cyrt\cyra\cyrb\cyre\cyrl\cyri}}%
+ \def\indexname{%
+ {\cyr\CYRI\cyrn\cyrd\cyre\cyrk\cyrs\ \cyrn\cyra\ \cyrt\cyre\cyrr\cyrm\cyri\cyrn\cyri}}%
+ \def\authorname{%
+ {\cyr\CYRA\cyrv\cyrt\cyro\cyrr}}%
+ \def\figurename{%
+ {\cyr\CYRS\cyrl\cyri\cyrk\cyra}}%
+ \def\tablename{%
+ {\cyr\CYRT\cyra\cyrb\cyre\cyrl\cyra}}%
+ \def\partname{%
+ {\cyr\CYRD\cyre\cyrl}}%
+ \def\enclname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrz\cyri}}%
+ \def\ccname{%
+ {\cyr\cyrk\cyro\cyrp\cyri\cyrje\cyra}}%
+ \def\headtoname{%
+ {\cyr\CYRZ\cyra}}%
+ \def\pagename{%
+ {\cyr\cyrs\cyrt\cyrr.}}%
+ \def\seename{%
+ {\cyr\cyrv\cyri\cyrd\cyri}}%
+ \def\alsoname{%
+ {\cyr\cyrv\cyri\cyrd\cyri\ \cyri\cyrs\cyrt\cyro\cyrt\cyra\cyrk\cyra}}%
+ \def\proofname{%
+ {\normalfont \textbf{\cyr\cyrd\cyro\cyrk\cyra\cyrz}}}%
+ \def\theoremname{%
+ {\normalfont \textbf{\cyr\CYRT\cyre\cyro\cyrr\cyre\cyrm\cyra}}}%
+ \def\corollaryname{%
+ {\normalfont \textbf{\cyr\CYRP\cyro\cyrs\cyrl\cyre\cyrd\cyri\cyrc\cyra}}}%
+ \def\lemmaname{%
+ {\normalfont \textbf{\cyr\CYRL\cyre\cyrm\cyra}}}%
+ \def\glossaryname{%
+ {\cyr\CYRR\cyre\cyrc\cyrn\cyri\cyrk}}%
+}
+% \end{macrocode}
+% \end{macro}
+%%
+% \begin{macro}{\datemacedonian}
+%
+% The macro |\datemacedonian| redefines the command |\today| to
+% produce Macedonian dates.
+% It also provides the command |\todayRoman| which produces the
+% date with the month in capital roman numerals, a popular format
+% for dates in Macedonian.
+%
+% \begin{macrocode}
+\def\datemacedonian{%
+ \def\month@macedonian{\ifcase\month\or
+ \cyrje\cyra\cyrn\cyru\cyra\cyrr\cyri\or
+ \cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or
+ \cyrm\cyra\cyrr\cyrt\or
+ \cyra\cyrp\cyrr\cyri\cyrl\or
+ \cyrm\cyra\cyrje\or
+ \cyrje\cyru\cyrn\cyri\or
+ \cyrje\cyru\cyrl\cyri\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\or
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or
+ \cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or
+ \cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri\fi}%
+ \def\month@Roman{\expandafter\@Roman\month}%
+ \def\today{\number\day~\month@macedonian\ \number\year~\cyrg\cyro\cyrd.}%
+ \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~\cyrg\cyro\cyrd.}%
+}
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\todayRoman}
+%
+% The month is often written with roman numbers in Macedonian dates.
+% Here we define date in this format:
+%
+% \begin{macrocode}
+\def\Romannumeral#1{\uppercase\expandafter{\romannumeral #1}}
+\def\todayRoman{\number\day.\Romannumeral{\month}.\number\year~\cyrg\cyro\cyrd.}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\extrasmacedonian}
+%
+% The macro |\extrasmacedonian| will perform all the extra
+% definitions needed for the Macedonian language.
+% The macro |\noextrasmacedonian| is used to cancel the actions of
+% |\extrasmacedonian|.
+%
+% The first action we define is to switch on the selected Cyrillic
+% encoding whenever we enter `macedonian'.
+%
+% \begin{macrocode}
+\addto\extrasmacedonian{\cyrillictext}
+% \end{macrocode}
+%
+% When the encoding definition file was processed by \LaTeX\ the
+% current font encoding is stored in |\latinencoding|, assuming
+% that \LaTeX\ uses \texttt{T1} or \texttt{OT1} as
+% default. Therefore we switch back to |\latinencoding| whenever
+% the Macedonian language is no longer `active'.
+%
+% \begin{macrocode}
+\addto\noextrasmacedonian{\latintext}
+% \end{macrocode}
+%
+% For Macedonian the \texttt{"} character also is made active.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% The code above is necessary because we need extra active
+% characters. The character |"| is used as indicated in
+% table~\ref{tab:macedonian-quote}. We specify that the Macedonian
+% group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasmacedonian{\languageshorthands{macedonian}}
+% \end{macrocode}
+%
+% These characters are `turned on' once, later their definition may
+% vary.
+%
+% \begin{macrocode}
+\addto\extrasmacedonian{%
+ \bbl@activate{"}}
+\addto\noextrasmacedonian{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The \texttt{X2} and \texttt{T2*} encodings do not contain
+% |spanish_shriek| and |spanish_query| symbols; as a consequence,
+% the ligatures `|?`|' and `|!`|' do not work with them (these
+% characters are useless for Cyrillic texts anyway). But we define
+% the shorthands to emulate these ligatures (optionally).
+%
+% We do not use |\latinencoding| here (but instead explicitly use
+% \texttt{OT1}) because the user may choose \texttt{T2A} to be the
+% primary encoding, but it does not contain these characters.
+%
+% \begin{macrocode}
+%<*spanishligs>
+\declare@shorthand{macedonian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
+\declare@shorthand{macedonian}{!`}{\UseTextSymbol{OT1}\textexclamdown}
+%</spanishligs>
+% \end{macrocode}
+%
+% To be able to define the function of `|"|', we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+%
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"|can now be typed as `|"|'.
+% \changes{macedonian-1.0c}{2003/04/10}{repaired typo}
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019}
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Now we can define the doublequote macros: german and french
+% quotes. We use definitions of these quotes made in babel.sty.
+% The french quotes are contained in the \texttt{T2*} encodings.
+%
+% \begin{macrocode}
+\declare@shorthand{macedonian}{"`}{\glqq}
+\declare@shorthand{macedonian}{"'}{\grqq}
+\declare@shorthand{macedonian}{"<}{\flqq}
+\declare@shorthand{macedonian}{">}{\frqq}
+% \end{macrocode}
+%
+% Some additional commands:
+%
+% \begin{macrocode}
+\declare@shorthand{macedonian}{""}{\hskip\z@skip}
+\declare@shorthand{macedonian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{macedonian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{macedonian}{"|}{%
+\textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+\allowhyphens}{}}
+% \end{macrocode}
+%
+% The next two macros for |"-| and |"---| are somewhat different.
+% We must check whether the second token is a hyphen character:
+%
+% \begin{macrocode}
+\declare@shorthand{macedonian}{"-}{%
+% \end{macrocode}
+%
+% If the next token is `|-|', we typeset an emdash, otherwise a
+% hyphen sign:
+%
+% \begin{macrocode}
+ \def\macedonian@sh@tmp{%
+ \if\macedonian@sh@next-\expandafter\macedonian@sh@emdash
+ \else\expandafter\macedonian@sh@hyphen\fi
+ }%
+% \end{macrocode}
+%
+% \TeX\ looks for the next token after the first `|-|': the meaning
+% of this token is written to |\macedonian@sh@next| and
+% |\macedonian@sh@tmp| is called.
+%
+% \begin{macrocode}
+ \futurelet\macedonian@sh@next\macedonian@sh@tmp}
+% \end{macrocode}
+%
+% Here are the definitions of hyphen and emdash. First the hyphen:
+%
+% \begin{macrocode}
+\def\macedonian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+% \end{macrocode}
+%
+% For the emdash definition, there are the two parameters: we must
+% `eat' two last hyphen signs of our emdash \dots :
+%
+% \begin{macrocode}
+\def\macedonian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \begin{macro}{\cdash}
+%
+% \dots\ these two parameters are useful for another macro:
+% |\cdash|:
+%
+% \changes{macedonian-1.0e}{2006/03/31}{Two occurences of \cmd{temp}
+% were changed into tab followed by emp}
+% \begin{macrocode}
+\ifx\cdash\undefined % should be defined earlier
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+%
+% second parameter (or third for |\cdash|) shows what kind of emdash
+% to create in next step
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"---| & ordinary (plain) Cyrillic emdash inside text:
+% an unbreakable thinspace will be inserted before only in case of
+% a \textit{space} before the dash (it is necessary for dashes after
+% display maths formulae: there could be lists, enumerations etc.\
+% started with ``---where $a$ is ...'' i.e., the dash starts a line).
+% (Firstly there were planned rather soft rules for user:he may put
+% a space before the dash or not. But it is difficult to place this
+% thinspace automatically, i.e., by checking modes because after
+% display formulae \TeX{} uses horizontal mode. Maybe there is a
+% misunderstanding? Maybe there is another way?) After a dash
+% a breakable thinspace is always placed; \\
+% \end{tabular}
+% \end{center}
+%
+%
+% \begin{macrocode}
+% What is more grammatically: .2em or .2\fontdimen6\font?
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+\cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--~| & emdash in compound names or surnames
+% (like Mendeleev--Klapeiron); this dash has no space characters
+% around; after the dash some space is added
+% |\exhyphenalty| \\
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% \begin{center}
+% \begin{tabular}{@{}p{.1\hsize}@{}p{.9\hsize}@{}}
+% |"--*| & for denoting direct speech (a space like |\enskip|
+% must follow the emdash); \\
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+%\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\cyrdash}
+%
+% Finally the macro for ``body'' of the Cyrillic emdash.
+% The |\cyrdash| macro will be defined in case this macro hasn't
+% been defined in a fontenc file. For T2*fonts, cyrdash will be
+% placed in the code of the English emdash thus it uses ligature
+% |---|.
+%
+% \begin{macrocode}
+% Is there an IF necessary?
+\ifx\cyrdash\undefined
+\def\cyrdash{\hbox to.8em{--\hss--}}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Here a really new macro---to place thinspace between initials.
+% This macro used instead of |\,| allows hyphenation in the
+% following surname.
+%
+% \begin{macrocode}
+\declare@shorthand{macedonian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+% The Macedonian hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{macedonian-1.0b}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\fi
+% \end{macrocode}
+%
+% Now the action |\extrasmacedonian| has to execute is to make sure
+% that the command |\frenchspacing| is in effect. If this is not
+% the case the execution of |\noextrasmacedonian| will switch it off
+% again.
+%
+% \begin{macrocode}
+\addto\extrasmacedonian{\bbl@frenchspacing}
+\addto\noextrasmacedonian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% Make the double quotes produce the traditional quotes
+% used in Macedonian texts (these are the German quotes).
+%
+% \begin{macrocode}
+% \initiate@active@char{`}
+% \initiate@active@char{'}
+% \addto\extrasmacedonian{%
+% \bbl@activate{`}}
+% \addto\extrasmacedonian{%
+% \bbl@activate{'}}
+% \addto\noextrasmacedonian{%
+% \bbl@deactivate{`}}
+% \addto\noextrasmacedonian{%
+% \bbl@deactivate{'}}
+% \def\mlron{\bbl@activate{`}\bbl@activate{'}}
+% \def\mlroff{\bbl@deactivate{`}\bbl@deactivate{'}}
+% \declare@shorthand{macedonian}{``}{\glqq}
+% \declare@shorthand{macedonian}{''}{\grqq}
+% \end{macrocode}
+%
+% In Macedonian the first paragraph of each section should be indented. The implementation from \file{serbianc.dtx}
+% (created by Filip Br\v{c}i\'{c} [brcha@gna.org]) is used for such a purpose.
+% \begin{macrocode}
+\ifx\fmtname plain \else
+ \let\@aifORI\@afterindentfalse
+ \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+ \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
+ \@afterindentfalse}
+ \addto\extrasmacedonian{\bbl@frenchindent}
+ \addto\noextrasmacedonian{\bbl@nonfrenchindent}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Next we add a new enumeration style for Macedonian manuscripts with
+% Cyrillic letters,and later on we define some math operator names in
+% accordance with Macedonian typesetting traditions.
+%
+% \begin{macro}{\@Alph@mkd}
+%
+% We begin by defining |\@Alph@mkd| which works like |\@Alph|, but
+% produces (uppercase) Cyrillic letters intead of Latin ones.%
+% \begin{macrocode}
+
+\def\enumBul{\let\@Alph\@Alph@mkd \let\@alph\@alph@mkd}
+\def\enumEng{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+\def\enumLat{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
+\addto\extrasmacedonian{\enumBul}
+\addto\noextrasmacedonian{\enumLat}
+\def\@Alph@mkd#1{%
+ \ifcase#1\or
+ \CYRA\or \CYRB\or \CYRV\or \CYRG\or \CYRD\or \'{\CYRG}\or \CYRE\or \CYRZH\or
+ \CYRZ\or \CYRDZE\or \CYRI\or \CYRJE\or \CYRK\or \CYRL\or \CYRLJE\or
+ \CYRM\or \CYRN\or \CYRNJE\or \CYRO\or \CYRP\or \CYRR\or \CYRS\or
+ \CYRT\or \'{\CYRK}\or \CYRU\or \CYRF\or \CYRH\or \CYRC\or \CYRCH\or \CYRDZHE\or \CYRSH\else
+ \@ctrerr\fi
+ }
+\def\@Alph@eng#1{%
+ \ifcase#1\or
+ A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or
+ N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else
+ \@ctrerr\fi
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@alph@mkd}
+%
+% The macro |\@alph@mkd| is similar to |\@Alph@mkd|;
+% it produces lowercase Macedonian letters.
+%
+% \begin{macrocode}
+\def\@alph@mkd#1{%
+ \ifcase#1\or
+ \cyra\or \cyrb\or \cyrv\or \cyrg\or \cyrd\or \'{\cyrg}\or \cyre\or \cyrzh\or
+ \cyrz\or \cyrdze\or \cyri\or \cyrje\or \cyrk\or \cyrl\or \cyrlje\or
+ \cyrm\or \cyrn\or \cyrnje\or \cyro\or \cyrp\or \cyrr\or \cyrs\or
+ \cyrt\or \'{\cyrk}\or \cyru\or \cyrf\or \cyrh\or \cyrc\or \cyrch\or \cyrdzhe\or \cyrsh\else
+ \@ctrerr\fi
+ }
+\def\@alph@eng#1{%
+ \ifcase#1\or
+ a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or
+ n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
+ \@ctrerr\fi
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{Characters in italic}
+% When writing in italic, Macedonian differs from Bulgarian, Russian and other Slavic languages. (Perhaps similar to Serbian), the small italic letters: b, d, g, t and p are different. Moreover, the character gje "g with accent" is kind of unique. The following code ensures these characters to have a correct appearance in Macedonian Italic.
+% \begin{macrocode}
+\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-0.2mu}\mkern 1.0mu}
+\newcommand*{\textoverline}[1]{$\overbar{\hbox{#1}}\m@th$}
+\newcommand{\overbarshort}[1]{\mkern 1.7mu\overline{\mkern-0.0mu#1\mkern+1.2mu}\mkern 0.0mu}
+\newcommand*{\textoverlineshort}[1]{$\overbarshort{\hbox{#1}}\m@th$}
+\newcommand*{\my@test@it}{it}
+\newcommand*{\IfItalic}[2]{%
+ \ifx\f@shape\my@test@it
+ #1%\expandafter#1
+ \else
+ #2%\expandafter#2
+ \fi
+}
+\newcommand{\tbar}[1]{\mbox{%
+ \sbox0{#1}\sbox2{\'{}}%
+ \ooalign{\hidewidth\raise\dimexpr\ht0-\ht2+0.45ex\box2 \hidewidth\cr#1\cr}}}
+\let\oldcyrb\cyrb
+\renewcommand{\cyrb}{\IfItalic{\textit{$\delta$}}{\oldcyrb}}
+\let\oldcyrd\cyrd
+\renewcommand{\cyrd}{\IfItalic{\textit{g}}{\oldcyrd}}
+\let\oldcyrg\cyrg
+\renewcommand{\cyrg}{\IfItalic{\textoverlineshort{\i}}{\oldcyrg}}
+\DeclareTextCompositeCommand{\'}{T2A}{\cyrg}{\IfItalic{\tbar{\textoverlineshort{\i}}}
+{\'{\oldcyrg}}}
+\let\oldcyrt\cyrt
+\renewcommand{\cyrt}{\IfItalic{\textoverline{\textit{\cyrsh}}}{\oldcyrt}}
+\let\oldcyrp\cyrp
+\renewcommand{\cyrp}{\IfItalic{\textoverline{\textit{\cyri}}}{\oldcyrp}}
+% \end{macrocode}
+% \end{macro}
+% Some math functions in Macedonian math books have other names:
+% e.g., \texttt{sinh} in Macedonian is written as \texttt{sh}
+% etc. So we define a number of new math operators.
+%
+% |\sinh|:
+%
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+% \end{macrocode}
+%
+% |\cosh|:
+%
+% \begin{macrocode}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+% \end{macrocode}
+%
+% |\tan|:
+%
+% \begin{macrocode}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+% \end{macrocode}
+%
+% |\arctan|:
+%
+% \begin{macrocode}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+% \end{macrocode}
+%
+% |\arccot|:
+%
+% \begin{macrocode}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+% \end{macrocode}
+%
+% The following macro conflicts with |\th| defined in Latin~1
+% encoding:
+% |\tanh|:
+% \changes{macedonian-1.0d}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+% \end{macrocode}
+%
+% |\cot|:
+%
+% \begin{macrocode}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+% \end{macrocode}
+%
+% |\coth|:
+%
+% \begin{macrocode}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+% \end{macrocode}
+%
+% |\csc|:
+%
+% \begin{macrocode}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+% The macro |\ldf@finish| takes care of looking for a configuration
+% file, setting the main language to be switched on at
+% |\begin{document}| and resetting the category code of \texttt{@}
+% to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{macedonian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/macedonian/macedonian.ins b/macros/latex/contrib/babel-contrib/macedonian/macedonian.ins
new file mode 100644
index 0000000000..01698b93f9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/macedonian/macedonian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Stojan Trajanovski.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/21}
+\def\batchfile{macedonian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Stojan Trajanovski.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{macedonian.ldf}{\from{macedonian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/macedonian/macedonian.pdf b/macros/latex/contrib/babel-contrib/macedonian/macedonian.pdf
new file mode 100644
index 0000000000..517693043c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/macedonian/macedonian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/malay/README b/macros/latex/contrib/babel-contrib/malay/README
new file mode 100644
index 0000000000..b351db9760
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/malay/README
@@ -0,0 +1,11 @@
+Malay 1.0m
+------------
+
+This is the babel style for Malay
+
+Changes 1.0m
+-----------
+* Just renamed (from bahasam to malay), with some proxy files
+
+----------
+2017-02-15 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/malay/malay.dtx b/macros/latex/contrib/babel-contrib/malay/malay.dtx
new file mode 100644
index 0000000000..39ccf44a43
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/malay/malay.dtx
@@ -0,0 +1,296 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+% 2017 Javier Bezos, Johannes L. Braams
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{malay.dtx}
+%</dtx>
+%<malay>\ProvidesLanguage{malay}
+%<bahasam>\ProvidesLanguage{bahasam}
+%<melayu>\ProvidesLanguage{melayu}
+%<meyalu>\ProvidesLanguage{meyalu}
+%\fi
+%\ProvidesFile{malay.dtx}
+ [2017/02/15 v1.0m Bahasa Malaysia support from the babel system]
+%\iffalse
+%% File `malay.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%% 2017 Javier Bezos, Johannes Braams
+%
+%% Bahasa Malaysia Language Definition File
+%% Copyright (C) 1994 - 2008
+%% by J"org Knappen, (joerg.knappen at alpha.ntp.springer.de)
+% Terry Mart (mart at vkpmzd.kph.uni-mainz.de)
+% Institut f\"ur Kernphysik
+% Johannes Gutenberg-Universit\"at Mainz
+% D-55099 Mainz
+% Germany
+%
+% This file is part of the babel system, it provides the source
+% code for the Bahasa Malaysia language definition
+% file. The original version of this file was written by Terry
+% Mart (mart@vkpmzd.kph.uni-mainz.de) and J"org Knappen
+% (knappen@vkpmzd.kph.uni-mainz.de).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \mathit lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{malay.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{malay.dtx}
+%
+% \changes{malay-1.0m}{2017/02/15}{Renamed from bahasam to malay, with
+% proxy files}
+% \changes{bahasa-0.9c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{bahasa-1.0d}{1996/07/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{bahasa-1.0e}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{bahasam-0.9f}{2005/11/22}{A number of changes to make this
+% specific to Bahasa Mayasia}
+%
+% \section{The Bahasa Malaysia language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Bahasa Malaysia language. Bahasa just means
+% `language' in Bahasa Malaysia.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{bahasam-v1.0j}{2005/11/23}{Make it possible that this file
+% is loaded by variuos options}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{bahasa} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@bahasa| to see whether we have to do something here.
+%
+% For both Bahasa Malaysia and Bahasa Indonesia the same set of
+% hyphenation patterns can be used which are available in the file
+% \file{inhyph.tex}. However it could be loaded using any of the
+% possible Babel options fot the Malaysian and Indonesian
+% language. So first we try to find out whether this is the case.
+%
+% \changes{bahasa-0.9c}{1994/06/26}{Now use \cs{@patterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@malay\@undefined
+ \ifx\l@meyalu\@undefined
+ \ifx\l@bahasam\@undefined
+ \ifx\l@bahasa\@undefined
+ \ifx\l@bahasai\@undefined
+ \ifx\l@indon\@undefined
+ \ifx\l@indonesian\@undefined
+ \@nopatterns{Bahasa Malaysia}
+ \adddialect\l@malay0\relax
+ \else
+ \let\l@malay\l@indonesian
+ \fi
+ \else
+ \let\l@malay\l@indon
+ \fi
+ \else
+ \let\l@malay\l@bahasai
+ \fi
+ \else
+ \let\l@malay\l@bahasa
+ \fi
+ \else
+ \let\l@malay\l@bahasam
+ \fi
+ \else
+ \let\l@malay\l@meyalu
+ \fi
+\fi
+% \end{macrocode}
+%
+% Now that we are sure the |\l@malay| has some valid definition we
+% need to make sure that a name to access the hyphenation patterns,
+% corresponding to the option used, is available.
+% \begin{macrocode}
+\expandafter\expandafter\expandafter\let
+ \expandafter\csname
+ \expandafter l\expandafter @\CurrentOption\endcsname
+ \l@malay
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Bahasa language.
+%
+% \begin{macro}{\captionsbahasam}
+% The macro |\captionsbahasam| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{bahasa-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{bahasa-1.0d}{1996/07/09}{Replaced `Proof' by `Bukti'
+% (PR2214)}
+% \changes{bahasa-1.0h}{2000/09/19}{Added \cs{glossaryname}}
+% \changes{bahasa-1.0i}{2003/11/17}{Inserted translation for Glossary}
+% \changes{bahasam-1.0k}{2008/01/27}{Inserted changes from Awangku Merali }
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Prakata}%
+ \def\refname{Rujukan}%
+ \def\abstractname{Abstrak}% (sometime it's called 'intisari'
+ % or 'ikhtisar')
+ \def\bibname{Bibliografi}%
+ \def\chaptername{Bab}%
+ \def\appendixname{Lampiran}%
+ \def\contentsname{Kandungan}%
+ \def\listfigurename{Senarai Gambar}%
+ \def\listtablename{Senarai Jadual}%
+ \def\indexname{Indeks}%
+ \def\figurename{Gambar}%
+ \def\tablename{Jadual}%
+ \def\partname{Bahagian}%
+% Subject: Perkara
+% From: Dari
+ \def\enclname{Lampiran}%
+ \def\ccname{sk}% (short form for 'Salinan Kepada')
+ \def\headtoname{Kepada}%
+ \def\pagename{Halaman}%
+% Notes (Endnotes): Catatan
+ \def\seename{sila rujuk}%
+ \def\alsoname{rujuk juga}%
+ \def\proofname{Bukti}%
+ \def\glossaryname{Istilah}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebahasam}
+% The macro |\datebahasam| redefines the command |\today| to produce
+% Bahasa Malaysian dates.
+% \changes{bahasa-1.0f}{1997/10/01}{Use \cs{edef} to define \cs{today}}
+% \changes{bahasa~1.0f}{1998/03/28}{use \cs{def} instead of \cs{edef}
+% to save memory}
+% \changes{bahasa-1.0g}{1999/03/12}{Februari should be spelled as
+% Pebruari}
+% \changes{bahasam-1.0k}{2008/01/27}{Februari restored to BM spelling;
+% see Collins Kamus Dwibahasa 2005}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day~\ifcase\month\or
+ Januari\or Februari\or Mac\or April\or Mei\or Jun\or
+ Julai\or Ogos\or September\or Oktober\or November\or Disember\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrasbahasam}
+% \begin{macro}{\noextrasbahasam}
+% The macro |\extrasbahasa| will perform all the extra definitions
+% needed for the Bahasa language. The macro |\extrasbahasa| is used
+% to cancel the actions of |\extrasbahasa|. For the moment these
+% macros are empty but they are defined for compatibility with the
+% other language definition files.
+%
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bahasamhyphenmins}
+% The bahasam hyphenation patterns should be used with
+% |\lefthyphenmin| set to~2 and |\righthyphenmin| set to~2.
+% \changes{bahasa-1.0e}{1996/08/07}{use \cs{bahasamhyphenmins} to store
+% the correct values}
+% \changes{bahasa-1.0h}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{bahasa-1.0e}{1996/11/02}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+% Finally, We create a few proxy files, which just load malay.ldf.
+%
+% \begin{macrocode}
+%<*bahasam|melayu|meyalu>
+\input malay.ldf\relax
+%</bahasam|melayu|meyalu>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/malay/malay.ins b/macros/latex/contrib/babel-contrib/malay/malay.ins
new file mode 100644
index 0000000000..2f47870716
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/malay/malay.ins
@@ -0,0 +1,154 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%% 2017 Javier Bezos, Johannes L. Braams
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2017/02/15}
+\def\batchfile{malay.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+ 2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+ 2017 Javier Bezos, Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{malay.ldf}{\from{malay.dtx}{malay,code}}
+ \file{bahasam.ldf}{\from{malay.dtx}{bahasam}}
+ \file{melayu.ldf}{\from{malay.dtx}{melayu}}
+ \file{meyalu.ldf}{\from{malay.dtx}{meyalu}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/malay/malay.pdf b/macros/latex/contrib/babel-contrib/malay/malay.pdf
new file mode 100644
index 0000000000..6950e28463
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/malay/malay.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/norsk/norsk.dtx b/macros/latex/contrib/babel-contrib/norsk/norsk.dtx
new file mode 100644
index 0000000000..e8b8880190
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/norsk/norsk.dtx
@@ -0,0 +1,454 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%\CheckSum{305}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{norsk.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{norsk}
+%\fi
+%\ProvidesFile{norsk.dtx}
+ [2012/08/06 v2.0i Norsk support from the babel system]
+%\iffalse
+%%File `norsk.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Norwegian language definition file. Contributions
+% were made by Haavard Helstrup (HAAVARD@CERNVM) and Alv Kjetil
+% Holme (HOLMEA@CERNVM); the `nynorsk' variant has been supplied by
+% Per Steinar Iversen (iversen@vxcern.cern.ch) and Terje Engeset
+% Petterst (TERJEEP@VSFYS1.FI.UIB.NO)
+%
+% Rune Kleveland (runekl at math.uio.no) added the shorthand
+% definitions
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{norsk.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{norsk.dtx}
+%
+% \changes{norsk-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{norsk-1.1a}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{norsk-1.1c}{1993/11/11}{Added a couple of translations
+% (from Per Norman Oma, TeX@itk.unit.no)}
+% \changes{norsk-1.2a}{1994/02/27}{Update for \LaTeXe}
+% \changes{norsk-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{norsk-1.2h}{1996/07/12}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{norsk-1.2h}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+%
+% \section{The Norwegian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Haavard Helstrup
+% (\texttt{HAAVARD@CERNVM)} and Alv Kjetil Holme
+% (\texttt{HOLMEA@CERNVM}); the `nynorsk' variant has been supplied
+% by Per Steinar Iversen \texttt{iversen@vxcern.cern.ch}) and Terje
+% Engeset Petterst (\texttt{TERJEEP@VSFYS1.FI.UIB.NO)}; the
+% shorthand definitions were provided by Rune Kleveland
+% (\texttt{runekl@math.uio.no}).} defines all the language definition
+% macros for the Norwegian language as well as for an alternative
+% variant `nynorsk' of this language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:norsk-quote} an overview is given of its purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{.7\textwidth}}
+% |"ff|& for |ff| to be hyphenated as |ff-f|,
+% this is also implemented for b, d, f, g, l, m, n,
+% p, r, s, and t. (|o"ppussing|) \\
+% |"ee|& Hyphenate |"ee| as |\'e-e|. (|komit"een|) \\
+% |"-| & an explicit hyphen sign, allowing hyphenation in the
+% composing words. Use this for compound words when the
+% hyphenation patterns fail to hyphenate
+% properly. (|alpin"-anlegg|) \\
+% \verb="|= & Like |"-|, but inserts 0.03em space. Use it if
+% the compound point is spanned by a ligature.
+% (\verb=hoff"|intriger=) \\
+% |""| & Like |"-|, but producing no hyphen sign.
+% (|i""g\aa{}r|) \\
+% |"~| & Like |-|, but allows no hyphenation at all. (|E"~cup|)\\
+% |"=| & Like |-|, but allowing hyphenation in the composing
+% words. (|marksistisk"=leninistisk|) \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{norsk.sty}}\label{tab:norsk-quote}
+% \end{center}
+% \end{table}
+% \changes{norsk-2.0a}{1998/06/24}{Describe the use of double quote as
+% active character}
+%
+% Rune Kleveland distributes a Norwegian dictionary for ispell
+% (570000 words). It can be found at
+% |http://www.uio.no/~runekl/dictionary.html|.
+%
+% This dictionary supports the spellings |spi"sslede| for
+% `spisslede' (hyphenated spiss-slede) and other such words, and
+% also suggest the spelling |spi"sslede| for `spisslede' and
+% `spissslede'.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{norsk-1.2h}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{norsk} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@norsk| to see whether we have to do something here.
+%
+% \changes{norsk-1.0c}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{norsk-1.1a}{1992/02/16}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{norsk-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to produce
+% the warning}
+% \begin{macrocode}
+\ifx\l@norsk\@undefined
+ \@nopatterns{Norsk}
+ \adddialect\l@norsk0\fi
+% \end{macrocode}
+%
+% \begin{macro}{\norskhyphenmins}
+% Some sets of Norwegian hyphenation patterns can be used with
+% |\lefthyphenmin| set to~1 and |\righthyphenmin| set to~2, but
+% the most common set |nohyph.tex| can't. So we use
+% |\lefthyphenmin=2| by default.
+% \changes{norsk-1.2f}{1995/07/02}{Added setting of hyphenmin
+% parameters}
+% \changes{norsk-2.0a}{1998/06/24}{Changed setting of hyphenmin
+% parameters to 2~2}
+% \changes{norsk-2.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% Now we have to decide which version of the captions should be
+% made available. This can be done by checking the contents of
+% |\CurrentOption|.
+% \begin{macrocode}
+\def\bbl@tempa{norsk}
+\ifx\CurrentOption\bbl@tempa
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Norwegian language.
+%
+% \begin{macro}{\captionsnorsk}
+% The macro |\captionsnorsk| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
+% \cs{prefacename}}
+% \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{norsk-1.2f}{1995/07/02}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
+% translation}
+% \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
+% translation}
+% \begin{macrocode}
+ \def\captionsnorsk{%
+ \def\prefacename{Forord}%
+ \def\refname{Referanser}%
+ \def\abstractname{Sammendrag}%
+ \def\bibname{Bibliografi}% or Litteraturoversikt
+ % or Litteratur or Referanser
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}% or Appendiks
+ \def\contentsname{Innhold}%
+ \def\listfigurename{Figurer}% or Figurliste
+ \def\listtablename{Tabeller}% or Tabelliste
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi sendt}%
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Se}%
+ \def\alsoname{Se ogs\aa{}}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+ }
+\else
+% \end{macrocode}
+% \end{macro}
+%
+% For the `nynorsk' version of these definitions we just add a
+% ``dialect''.
+% \begin{macrocode}
+ \adddialect\l@nynorsk\l@norsk
+% \end{macrocode}
+%
+% \begin{macro}{\captionsnynorsk}
+% The macro |\captionsnynorsk| defines all strings used in the four
+% standard documentclasses provided with \LaTeX, but using a
+% different spelling than in the command |\captionsnorsk|.
+% \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
+% \cs{prefacename}}
+% \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
+% translation}
+% \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
+% translation}
+% \changes{norks-2.0h}{2001/01/12}{Changed \cs{ccname} and \cs{alsoname}}
+% \begin{macrocode}
+ \def\captionsnynorsk{%
+ \def\prefacename{Forord}%
+ \def\refname{Referansar}%
+ \def\abstractname{Samandrag}%
+ \def\bibname{Litteratur}% or Litteraturoversyn
+ % or Referansar
+ \def\chaptername{Kapittel}%
+ \def\appendixname{Tillegg}% or Appendiks
+ \def\contentsname{Innhald}%
+ \def\listfigurename{Figurar}% or Figurliste
+ \def\listtablename{Tabellar}% or Tabelliste
+ \def\indexname{Register}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+ \def\enclname{Vedlegg}%
+ \def\ccname{Kopi til}%
+ \def\headtoname{Til}% in letter
+ \def\pagename{Side}%
+ \def\seename{Sj\aa{}}%
+ \def\alsoname{Sj\aa{} \`{o}g}%
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordliste}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datenorsk}
+% The macro |\datenorsk| redefines the command |\today| to produce
+% Norwegian dates.
+% \changes{norsk-1.2i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{norsk-1.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{norsk-2.0i}{2012/08/06}{Removed extra space after `desember'}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or mars\or april\or mai\or juni\or
+ juli\or august\or september\or oktober\or november\or
+ desember\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasnorsk}
+% \begin{macro}{\extrasnynorsk}
+% The macro |\extrasnorsk| will perform all the extra definitions
+% needed for the Norwegian language. The macro |\noextrasnorsk| is
+% used to cancel the actions of |\extrasnorsk|.
+%
+% Norwegian typesetting requires |\frencspacing| to be in effect.
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{\bbl@frenchspacing}
+\@namedef{noextras\CurrentOption}{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% For Norsk the \texttt{"} character is made active. This is done
+% once, later on its definition may vary.
+% \changes{norsk-2.0a}{1998/06/24}{Made double quote character active}
+% \begin{macrocode}
+\initiate@active@char{"}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \languageshorthands{norsk}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{norsk-2.0c}{1999/12/17}{Deactivate shorthands ouside of
+% Norsk}
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% The code above is necessary because we need to define a number of
+% shorthand commands. These sharthand commands are then used as
+% indicated in table~\ref{tab:norsk-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the discretionary shorthand commands.
+% The number of words where such hyphenation is required is for
+% each character
+% \begin{center}
+% \begin{tabular}{*{11}c}
+% b&d&f &g&k &l &n&p &r&s &t \\
+% 4&4&15&3&43&30&8&12&1&33&35
+% \end{tabular}
+% \end{center}
+% taken from a list of 83000 ispell-roots.
+%
+% \changes{norsk-2.0d}{2000/02/29}{Shorthands are the same for both
+% spelling variants, no need to use \cs{CurrentOption}}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"b}{\textormath{\bbl@disc b{bb}}{b}}
+\declare@shorthand{norsk}{"B}{\textormath{\bbl@disc B{BB}}{B}}
+\declare@shorthand{norsk}{"d}{\textormath{\bbl@disc d{dd}}{d}}
+\declare@shorthand{norsk}{"D}{\textormath{\bbl@disc D{DD}}{D}}
+\declare@shorthand{norsk}{"e}{\textormath{\bbl@disc e{\'e}}{}}
+\declare@shorthand{norsk}{"E}{\textormath{\bbl@disc E{\'E}}{}}
+\declare@shorthand{norsk}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{norsk}{"g}{\textormath{\bbl@disc g{gg}}{g}}
+\declare@shorthand{norsk}{"G}{\textormath{\bbl@disc G{GG}}{G}}
+\declare@shorthand{norsk}{"k}{\textormath{\bbl@disc k{kk}}{k}}
+\declare@shorthand{norsk}{"K}{\textormath{\bbl@disc K{KK}}{K}}
+\declare@shorthand{norsk}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{norsk}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{norsk}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{norsk}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{norsk}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{norsk}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{norsk}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{norsk}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{norsk}{"s}{\textormath{\bbl@disc s{ss}}{s}}
+\declare@shorthand{norsk}{"S}{\textormath{\bbl@disc S{SS}}{S}}
+\declare@shorthand{norsk}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{norsk}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% We need to treat |"f| a bit differently in order to preserve the
+% ff-ligature.
+% \changes{norsk-2.0b}{1999/11/19}{Copied the coding for \texttt{"f}
+% from germanb.dtx version 2.6g}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"f}{\textormath{\bbl@discff}{f}}
+\def\bbl@discff{\penalty\@M
+ \afterassignment\bbl@insertff \let\bbl@nextff= }
+\def\bbl@insertff{%
+ \if f\bbl@nextff
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
+\let\bbl@nextff=f
+% \end{macrocode}
+% We now define the French double quotes and some commands
+% concerning hyphenation:
+% \changes{norsk-2.0b}{1999/11/22}{added the french double quotes}
+% \changes{norsk-2.0d}{2000/01/28}{Use \cs{bbl@allowhyphens} in
+% \texttt{"-}}
+% \begin{macrocode}
+\declare@shorthand{norsk}{"<}{\flqq}
+\declare@shorthand{norsk}{">}{\frqq}
+\declare@shorthand{norsk}{"-}{\penalty\@M\-\bbl@allowhyphens}
+\declare@shorthand{norsk}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{norsk}{""}{\hskip\z@skip}
+\declare@shorthand{norsk}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{norsk}{"=}{\penalty\@M-\hskip\z@skip}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{norsk-1.2h}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/norsk/norsk.ins b/macros/latex/contrib/babel-contrib/norsk/norsk.ins
new file mode 100644
index 0000000000..9ec2729e64
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/norsk/norsk.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{norsk.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{norsk.ldf}{\from{norsk.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/norsk/norsk.pdf b/macros/latex/contrib/babel-contrib/norsk/norsk.pdf
new file mode 100644
index 0000000000..896d926f50
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/norsk/norsk.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/occitan/README b/macros/latex/contrib/babel-contrib/occitan/README
new file mode 100644
index 0000000000..6a714db9a5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/occitan/README
@@ -0,0 +1,24 @@
+Package: babel-occitan
+
+
+The package provides a language definition file for use with babel, which establishes
+Occitan conventions in a document (or a subset of the conventions, if Occitan is not
+the main language of the document).
+
+Some functionalities have to be explicitly activated even if Occitan is the main
+language. Please read the documentation that explains why and what functionalities
+are not activated by default.
+
+To install run the occitan.dtx file trough pdfLaTeX; you get with the same run
+both the language description file and the documentation.. Then you have to
+move the created occitan.ldf file into a directory searched by TeX.
+
+This material is subject to the LaTeX Project Public License v1.3.
+See http://ctan.org/license/lppl1.3 for the details of that license.
+
+Happy TeXing.
+
+--------------------------------------
+
+Cédric Valmary
+cvalmary at yahoo dot fr \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/occitan/occitan.dtx b/macros/latex/contrib/babel-contrib/occitan/occitan.dtx
new file mode 100644
index 0000000000..24b0ac743a
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/occitan/occitan.dtx
@@ -0,0 +1,701 @@
+% \iffalse meta-comment
+%<*internal>
+\begingroup
+\input docstrip.tex
+\keepsilent
+
+\preamble
+ ------------------------------------------------------------------
+ The occitan module for babel
+ Copyright (C) 2015 Cédric Valmary
+ All rights reserved
+
+ Licence information appended
+
+ Created by Cédric Valmary: cvalmary at yahoo dot fr
+ of Tot en òc <http://www.totenoc.eu/>
+
+
+\endpreamble
+\postamble
+Distributable under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+This work is "author-maintained"
+The maintainer is Cédric Valmary
+
+\endpostamble
+
+\askforoverwritefalse
+
+\generate{\file{occitan.ldf}{\from{occitan.dtx}{code}}}
+
+\def\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+%</internal>
+%
+%
+% \fi
+% \CheckSum{344}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%\fi
+%\iffalse
+%<*filedriver>
+\ProvidesFile{occitan.dtx}
+%</filedriver>
+%<code>\ProvidesLanguage{occitan}
+%<*code>
+ [2016/02/04 0.2 Occitan support from the babel system]
+%</code>
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage[utf8]{inputenc}
+\usepackage{booktabs}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\pack[1]{\textsf{#1}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\author{Cédric Valmary--- \texttt{cvalmary at yahoo dot fr }}
+\title{The Occitan language module for \babel}
+\date{\filedate\ -- version \fileversion}
+\begin{document}
+ \DocInput{occitan.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{occitan.dtx}
+%
+% \maketitle
+%
+% \section{The Occitan language}
+% \textbf{Important notice}: This language description file relies on
+% functionalities provided by a modern TeX system distribution with
+% pdfLaTeX working in extended mode (eTeX commands available); it
+% should perform correctly also with XeLaTeX and LuaLaTeX; tests have
+% been made also with the latter programs, but it was really tested in
+% depth with |babel| and pdfLaTeX. Actually, even if it possible to use
+% \pack{babel} with XeLaTeX and LuaLaTeX, the latter programs have
+% available the specific \pack{polyglossia} package with the proper
+% settings also for the Occitan language.
+%
+% \bigskip
+%
+% The Occitan language nowadays exists as a \emph{koinè} for the multitude
+% of Occitan varieties, each one with its dialects; the main varieties are
+% Auver\-nhat, Gascon, Lemosin, Lengadocian, Niçard, Porovençal, Vivaroalpenc
+% as they are named in the document published by the \emph{Conselh de la
+% lenga occitana}
+% (see \url{http://gianni.vacca.perso.sfr.fr/guilhemix/clo-sintesi.pdf}).
+% This Conselh takes care also of maintaining a common standard at least
+% for spelling, but admits a variety of pronunciations and in some cases
+% a variety of spellings; for example the Gascon variety changes the
+% initial `f\/' into an aspirated `h'; this implies the necessity of
+% distinguishing when the digraphs `lh', `nh', and `sh' are really digraphs
+% or are to be considered distinct letters that in Gascon are rendered as
+% `l$\cdot$h', `n$\cdot$h', and `s$\cdot$h' respectively. A similar situation
+% takes place in the Vivaroalpenc variety, where the intervocalic `d'
+% vanishes. This language description file should not be concerned with these
+% variant spellings; the hyphenation pattern files might not correctly
+% handle all such situations so that some manual intervention might be
+% necessary. The tests carried on so far apparently work correctly, but users
+% are invited to let me know about possible necessary corrections.
+%
+% \bigskip
+%
+% The file \file{\filename} defines all the required and some optional
+% language-specific macros for the Occitan language.
+%
+% \begin{table}[htb]\centering
+% \begin{tabular}{cp{90mm}}
+% \toprule
+% |"| & inserts a compound word mark where hyphenation is legal;
+% it allows etymological hyphenation which is recommended
+% for technical terms, chemical names and the like; it
+% does not work if the next character is represented with
+% a control sequence or is an accented character.\\
+% \texttt{\string"\string|}
+% & the same as the above without the limitation on
+% characters represented with control sequences or accented
+% ones.\\
+% |"<| & inserts open guillemets without trailing space.\\
+% |">| & inserts closed guillemets without leading space.\\
+% |"/| & allows hyphenation of both words connected with slash.\\
+% |".| & allows hyphenation of both words fragments connected with
+% a half height dot (ponch interior in Occitan)\\
+% \bottomrule
+% \end{tabular}
+% \caption{Shorthands for the Occitan language. These shorthands are
+% available only if command \texttt{\string\setactivedoublequote} is given
+% after loading \babel\ and before \texttt{\string\begin\{document\}}.}
+% \label{t:itshrtct}
+% \end{table}
+%
+% The features of this language definition file are the following:
+% \begin{enumerate}
+% \item The Occitan hyphenation is invoked, provided that the Occitan
+% hyphenation pattern files were loaded when the specific format file
+% was built.
+% \item The language dependent infix words to be inserted by such
+% commands as |\chapter|, |\caption|, |\tableofcontents|,
+% etc. are redefined in accordance with the Occitan
+% typographical practice.
+% \item Since Occitan can be easily hyphenated and Occitan practice
+% allows to break a word before the last two letters, hyphenation
+% parameters have been set accordingly, but a very high demerit
+% value has been set in order to avoid word breaks in the
+% penultimate line of a paragraph. Specifically the |\clubpenalty|,
+% and the |\widowpenalty| are set to rather high values and
+% |\finalhyphendemerits| is set to such a high value that
+% hyphenation is strongly discouraged between the last two lines
+% of a paragraph.
+% \item Some language specific shorthands have been defined so as to
+% allow etymological hyphenation, specifically |"| inserts a
+% break point at any word boundary that the typesetter chooses,
+% provided it is not followed by an accented letter, and \verb="|=
+% when the desired break point falls before an accented letter.
+% As you can read in table~\ref{t:itshrtct}, these shorthands are
+% available only if they get activated with |\setactivedoublequote|
+% after loading \babel\ but before the |\begin{docuemnt}| statement.
+% This is done in order to preserve the user from package conflicts:
+% if s/he wants to use these facilities s/he must remember that
+% conflicts may arise unless active characters are deactivated;
+% this can be done with the \babel\ command |\shorthadsoff{"}|
+% (and reactivated with |\shorthandson{"}|) when its wise to do
+% so; conflicts have been reported with package \file{xypic} and
+% with \texttt{TikZ}, but the latter has its own library to
+% deactivate all active characters, not just the double quotes,
+% the only Occitan language specific activated character.
+% \item The shorthands |"<| and |">| insert the guillemets
+% used in Occitan typography, but without any spacing as, on the
+% opposite, it is done in French typography; with the T1 font encoding
+% the ligatures |<<| and |>>| should insert such signs directly,
+% but not all the virtual fonts that claim to follow the T1 font
+% encoding actually contain the guillemets; with the OT1 encoding
+% the guillemets are not available and must be faked in some
+% way. By using the |"<| and |">| shorthands (even with the T1
+% encoding) the necessary tests are performed and in case the
+% guillemets are replaced with the ones contained in the Latin Modern fonts.
+% At the same time if OpenType fonts are being used with XeLaTeX
+% or LuaLaTeX, there are no problems with guillemets.
+% \end{enumerate}
+%
+%
+% \StopEventually{}
+%
+%\subsection{The commented code}
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{occitan-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{occitan-1.2j}{1996/12/29}{Added braces around second arg of
+% \cs{LdfInit}}
+%\iffalse
+%<*code>
+%\fi
+% \begin{macrocode}
+\LdfInit{occitan}{captionsoccitan}%
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{occitan} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@occitan| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@occitan\@undefined
+ \@nopatterns{occitan}%
+ \adddialect\l@occitan \z@\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Occitan language.
+%
+% \begin{macro}{\captionsoccitan}
+% The macro |\captionsoccitan| defines all strings used
+% in the four standard document classes provided with \LaTeX.
+% \begin{macrocode}
+\addto\captionsoccitan{%
+ \def\refname{Refer\'encias}%
+ \def\abstractname{Resumit}%
+ \def\bibname{Bibliografia}%
+ \def\prefacename{Prefaci}%
+ \def\chaptername{Cap\'itol}%
+ \def\appendixname{Ann\`ex}%
+ \def\contentsname{Ensenhador}%
+ \def\listfigurename{Taula de las figuras}%
+ \def\listtablename{Taula dels tabl\`eus}%
+ \def\indexname{Ind\`ex}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabl\`eu}%
+ \def\partname{Partida}%
+ \def\pagename{Pagina}%
+ \def\seename{vejatz}%
+ \def\alsoname{vejatz tanben}%
+ \def\enclname{P\`e\c{c}a junta}%
+ \def\ccname{c\`opia a}%
+ \def\headtoname{A}%
+ \def\proofname{Demostracion}%
+ \def\glossaryname{Glossari}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateoccitan}
+% The macro |\dateoccitan| defines the command |\today| to typeset
+% the current date according to the Occitan style of using the suitable
+% prepositions before the month name and the year number; moreover the
+% first day of the month is marked with the ordinal abbreviation,
+% while the other day numbers are left without any ordinal indication.
+% \begin{macrocode}
+\def\dateoccitan{%
+ \def\today{%
+ \ifcase \day\or
+ 1èr\else
+ \number\day
+ \fi~%
+ \ifcase\month\or
+ de~geni\`er\or
+ de~febri\`er\or
+ de~mar\c{c}\or
+ d'abril\or
+ de~mai\or
+ de~jiunh\or
+ de~julhet\or
+ d'agost\or
+ de~setembre\or
+ d'octobre\or
+ de~novembre\or
+ de~decembre%
+ \fi\space
+ de~\number\year}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\occitanhyphenmins}
+% The occitan hyphenation patterns can be used with both
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasoccitan}
+% \begin{macro}{\noextrasoccitan}
+%
+% Lower the chance that clubs or widows occur; lower the chances that a line
+% break takes place between the last two lines of a paragraph.
+% \begin{macrocode}
+\addto\extrasoccitan{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+
+\addto\extrasoccitan{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+% \end{macrocode}
+%
+% In order to enable the hyphenation of words such as
+% ``l'Occitània'' we give the \texttt{'} a non-zero lower case
+% code. This allows \TeX\ to find the following hyphenation
+% points |l'Oc-ci-tà-nia| instead of none.
+% \begin{macrocode}
+\addto\extrasoccitan{%
+ \lccode`'=`'}%
+\addto\noextrasoccitan{%
+ \lccode`'=0}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Support for etymological hyphenation}
+%
+% In Occitan etymological hyphenation is desirable with
+% technical terms, chemical names, and the like.
+% We reach this goal by means of shorthands tied to the active character |"|.
+% The active double straight quote may conflict with other packages;
+% so we set it as an optional facility.
+%
+% Instead of a boolean switch we use a private counter so as to check
+% at |\begin{document}| if this facility has to be activated. The default
+% value is zero; anything different from zero means that the facility
+% has to be activated; this is done with command |\setactivedoublequote|
+% to be issued before |\begin{document}|
+%
+% \begin{macrocode}
+\newcount\oc@doublequoteactive \oc@doublequoteactive=\z@
+\def\setactivedoublequote{\oc@doublequoteactive=\@ne}
+\AtBeginDocument{%
+ \unless\ifnum\oc@doublequoteactive=\z@
+ \initiate@active@char{"}%
+ \addto\extrasoccitan{\bbl@activate{"}\languageshorthands{occitan}}%
+% \end{macrocode}
+% \begin{macro}{\oc@cwm}
+% The active character |"| is now defined for language |occitan| so
+% as to perform different actions in math mode compared to text
+% mode; specifically in math mode a double quote is inserted so as
+% to produce a double prime sign, while in text mode the temporary
+% macro |\oc@next| is defined so as to defer any further action
+% until the next token category code has been tested.
+% \begin{macrocode}
+ \declare@shorthand{occitan}{"}{%
+ \ifmmode
+ \def\oc@next{''}%
+ \else
+ \def\oc@next{\futurelet\oc@temp\oc@cwm}%
+ \fi
+ \oc@next
+ }%
+\fi
+% \end{macrocode}
+% The following statement must be conditionally executed after the above
+% modification of the |\extraasoccitan| list; in facts at the ``begin
+% document'' execution, the main language has already been set without
+% the above modifications; therefore nothing takes place unless the
+% occitan main language is selected again with the explicit command
+% |\selectlanguage|; without this trick the active double quotes would
+% remain inactive; of course |\languagename| contains the string |occitan|
+% if this language was the main one; by testing this string, the suitable
+% command may be issued again with the new settings and the double quotes
+% become really active.
+% \begin{macrocode}
+\ifdefstring{\languagename}{occitan}{\selectlanguage{occitan}}{\relax}
+}%
+% \end{macrocode}
+% \begin{macro}{\oc@cwm}
+% The \cs{oc@next} service control sequence is such that upon its
+% execution a temporary variable \cs{oc@temp} is made equivalent to
+% the next token in the input list without actually removing it.
+% Yes, this is a point to be underlined: a token that has made
+% equivalent with |\futurelet| to some other token, does not remove
+% the latter; while a macro that is followed by a space ignores it
+% and reads the first non-space token. This can be exploited in the
+% following macros.
+%
+% Such temporary token is then tested by the macro \cs{oc@cwm}
+% and if it is found to be equivalent to a letter token (catcode=11),
+% then it introduces the compound word separator control sequence
+% \cs{oc@allowhyphens} whose expansion introduces a discretionary
+% hyphen and an unbreakable zero space;
+% otherwise the token is not a letter; then it is tested against
+% \verb=|=$_{12}$: if so a macro is defined that gobbles the token
+% and introduces a compound word separator;
+% otherwise two other tests are performed to see if guillemets
+% have to be inserted, and in case suitable intelligent
+% guillemet macros are introduced that gobble unwanted leading
+% or trailing spaces;
+% otherwise a test is made to see if the next char is a slash
+% character, and in case a special discretionary break is inserted
+% so as to maintain the slash while allowing the hyphenation
+% of both words before and after the slash;
+% otherwise another test is made to see if a period follows, and in case
+% the period is gobbled and a special discretionary is inserted that
+% introduces a hyphen sign if a line break occurs, or a centered
+% dot otherwise;
+% otherwise nothing is done.
+%
+% \begin{macrocode}
+\def\oc@@cwm{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}%
+\def\oc@@slash{\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}%
+\def\oc@ponchinterior{\nobreak
+ \discretionary{-}{}{\mbox{$\cdot$}}\nobreak\hskip\z@skip}%
+\def\oc@@oguil#1{\oc@oguil}\def\oc@@cguil#1{\oc@cguil}%
+
+\DeclareRobustCommand*{\oc@cwm}{\let\oc@@next\oc@doublequote
+\ifcat\noexpand\oc@temp a%
+ \def\oc@@next{\oc@@cwm}%
+\else
+ \if\noexpand\oc@temp \string|%
+ \def\oc@@next##1{\oc@@cwm}%
+ \else
+ \if\noexpand\oc@temp \string<%
+ \def\oc@@next{\oc@@oguil}%
+ \else
+ \if\noexpand\oc@temp \string>%
+ \def\oc@@next{\oc@@cguil}%
+ \else
+ \if\noexpand\oc@temp\string/%
+ \def\oc@@next##1{\oc@@slash}%
+ \else
+ \if\noexpand\oc@temp\string.%
+ \def\oc@@next##1{\oc@ponchinterior}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+\fi
+\oc@@next}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{sloppypar}
+% By this definition of |"| if one types |macro"istrucion| the
+% possible break points become \textsf{ma-cro-is-tru-cion}, while
+% without the |"| mark they would be \textsf{ma-crois-tru-cion},
+% according to the phonetic rules such that the |macro| prefix is
+% not taken as a unit.
+% A chemical name such as \texttt{des"clor"fenir"amina"cloridrat}%
+% \footnote{Not all \texttt{\string"} signs are necessary, but all
+% have been indicated in order to mark in an explicit way the various
+% components of the technical compound word.}
+% is breakable as \textsf{des-clor-fe-nir-ami-na-clo-ri-drat}
+% instead of \textsf{des-clor-fe-ni-ra-mi-na-\dots} Of course the
+% use of this |"| functionality is useful if it is used for single
+% words or to fine tune a final document. If a certain word that
+% requires special break points appears quite often in a specific
+% document, it would be much more convenient to specify these special
+% break points in the argument of a |\hyphenation| command. See the
+% \babel\ documentation to set hyphenation exceptions for several
+% languages in a specific document.
+%
+% In other language description files a shorthand is defined so as
+% to allow a break point without actually inserting any hyphen
+% sign; examples are given such as \mbox{input/output}; actually
+% if one wants to allow a breakpoint after the slash, it is much
+% clearer to type |\slash| instead of |/| and \LaTeX\ does
+% everything by itself; here the shorthand |"/| was introduced to
+% stand for |\slash| so that one can type |input"/output| and allow
+% a line break after the slash.
+%
+% But what is really important in some Occitan varieties is the macro
+% |\oc@ponchinterior| that inserts the special discretionary break that
+% inserts a hyphen sign if a line break takes place or a centered dot
+% otherwise.
+% \end{sloppypar}
+%
+% Attention: the expansion of |"| takes place before the actual
+% expansion of OT1 or T1 accented sequences such as |\`{a}|;
+% therefore this etymological hyphenation facility works as it
+% should only when the semantic word fragments \textit{do not
+% start} with an accented letter; this in Occitan is almost always
+% avoidable, because very rarely accented vowels start a new syllable
+% and the only consonant that carries a diacritic mark, `ç', is
+% already taken care of by the hyphenation pattern files.
+% In this case the special shorthand \verb!"|! may be
+% used that performs exactly as |"| normally does, except that the
+% \verb!|! sign is removed from the token input list:
+% \verb!kilo\"orsted! or |kiloörsted| gets hyphenated as
+% \texttt{ki-loör-sted}; but
+% \verb!kilo"|örsted! gets hyphenated correctly
+% as \texttt{ki-lo-ör-sted} The \verb="|= macro is necessary
+% because, even with a suitable option specified to the |inputenc|
+% package, the letter `ö' does not have category code 11, as the \textsc{ascii}
+% letters do, because of the LICR (LaTeX Internal Character Representation);
+% the LICRs are the set of intermediate macros that have to be expanded
+% in order to fetch the proper glyph in the output font or to build up
+% a composite glyph if it is not available in the output font.
+%
+% \subsection{Extra advanced macros}
+%
+% We need to perform some tests that require some
+% smart control-sequence handling; therefore we call the |etoolbox|
+% package that allows us more testing functionality. There are no problems
+% with this package that can be invoked also by other ones before or
+% after \babel\ is called; the |\RequirePackage| mechanism is sufficiently
+% smart to avoid reloading the same package more than once. But we
+% have to delay this call, because |occitan.ldf| is being read while
+% processing the options passed to \babel\, and while options are being
+% scanned and processed it is forbidden to load packages; we
+% delay it at the end of processing the \babel\ package itself.
+% \begin{macrocode}
+\AtEndOfPackage{\RequirePackage{etoolbox}}
+% \end{macrocode}
+%
+%
+% \subsection{Accents}\label{s:ockbd}
+% Most of the other language description files introduce a number
+% of shorthands for inserting accents and other language specific
+% diacritical marks in a more comfortable way compared with the
+% lengthy standard \TeX\ conventions. I don't know if every user has
+% a specific keyboard layout or keyboard driver dedicated to the Occitan
+% language; it is possible that Occitan users, living in countries where the
+% Occitan language is actually used (France, Italy, and Spain), use
+% the more common local national keyboard and have already available
+% the suitable keys for entering (some of)the Occitan non \textsc{ascii}
+% characters; table~\ref{tab:chars} displays the lowercase special Occitan
+% characters.
+% \begin{table}\centering
+% \begin{tabular}{*4c}
+% \toprule
+% à & & á & \\
+% è & & é & \\
+% & ï & í & \\
+% ò & & ó & \\
+% & ü & ú & \\
+% & & & ç \\
+% \bottomrule
+% \end{tabular}
+% \caption{Specific Occitan characters}
+% \label{tab:chars}
+% \end{table}
+% Among the national keyboards it seems that the Italian one is the
+% least suited to typeset in Occitan; it actually is not fully functional
+% with Italian itself (it misses any two-key combination to enter accented
+% uppercase letters). In any case the recent distributions of the Windows
+% operating systems (may be from Win7 on, certainly from Win8) and the
+% Apple OS~X have a virtual keyboard application that allows to enter any
+% glyph by clicking on the virtual keys; all operating systems have a
+% Character Table Viewer that allows to enter any UNICODE glyph (very
+% uncomfortable if needed to enter long stretches of text, but\dots).
+% I suppose that the French national keyboard is the most comfortable to
+% use when entering Occitan text, thanks to the fact that the French language
+% uses many diacritics.
+%
+% The best solution, may be, consists in using a smart
+% editor that accepts shorthand definitions such that, for example,
+% by striking |"a| one gets directly |à| on the screen and the same
+% string is saved into the \file{.tex} file; the same smart editor
+% might be capable of translating the accented characters into the
+% standard \TeX\ sequences when writing a file to disk (for the
+% sake of file portability), and to transform the standard \TeX\
+% sequences into the corresponding signs when loading a \file{.tex}
+% file from disk to screen memory. Such smart editors do exist and can be
+% downloaded from the \textsc{ctan} archives.
+%
+%
+% \subsection{Guillemets or French double quotes}
+%
+% Although the T1 font encoding ligatures solve the problem, there
+% are some circumstances where even the T1 font encoding cannot be
+% used, either because the author\slash typesetter wants to use the
+% OT1 encoding, or because s/he uses a font set that does
+% not comply completely with the T1 font encoding; some virtual
+% fonts, for example, are supposed to implement the double Cork
+% font encoding but actually miss some glyphs; one such virtual
+% font set is given by the \texttt{ae} virtual fonts, because they
+% are supposed to implement such double font encoding by using
+% virtual fonts that map the |CM| fonts to a T1 font scheme; the
+% type~1 PostScript version of the |CM| fonts do exist, therefore
+% one believes to be able of using them with pdfLaTeX; but since
+% the |CM| fonts do not contain the guillemets, neither do the |AE|
+% ones.
+% Since guillemets do not exist in any OT1 encoded \texttt{cm}
+% Latin font, their glyphs must be substituted with something else
+% that fakes them.
+% Therefore if the OT1 encoding is being used the T1 encoded Latin
+% Modern font guillemets are used, otherwise the current font
+% ones are actually used.
+%
+% \begin{macro}{\oc@oguil}
+% \begin{macro}{\oc@cguil}
+% A new macro that the user may possibly use, if the default does not
+% meet his/her requirements, is defined so as to chose which family the
+% guillemets should be taken from; but through the |\DeclareTextCommand|,
+% we tie the definitions of the macros |\oc@oguil| and |\oc@cguil| to the
+% current actual encoding.
+% \begin{macrocode}
+\def\GuillemetsFrom#1#2#3#4{%
+ \DeclareFontEncoding{#1}{}{}%
+ \DeclareTextCommand{\oc@oguil}{T1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\oc@cguil}{T1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}%
+ \DeclareTextCommand{\oc@oguil}{OT1}{%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
+ \DeclareTextCommand{\oc@cguil}{OT1}{\ifdim\lastskip>\z@\unskip\fi%
+ {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
+% \end{macrocode}
+% This macro requires four arguments with the syntax:
+% \begin {flushleft}\small
+% |\GuillemetsFrom|\marg{encoding}\marg{family}\marg{open guill. slot}%
+% \marg{closed guill. slot}
+% \end{flushleft}
+% where \meta{encoding} and \meta{family} identify the font family
+% name of that particular encoding from which to get the substitution
+% guillemets; \meta{open guill. slot} and \meta{closed guill. slot}
+% are the (preferably) decimal slot addresses of the opening and
+% closing guillemets the user wants to use. For example if the
+% T1-encoded Latin Modern fonts are desired, the specific command
+% should be
+% \begin {flushleft}
+% |\GuillemetsFrom{T1}{lmr}{19}{20}|
+% \end{flushleft}
+%
+% We define a default macro for using the current font in encoding T1:
+% \begin{macrocode}
+\def\T@unoGuillemets{\DeclareRobustCommand*{\oc@oguil}{<<\ignorespaces}%
+ \DeclareRobustCommand*{\oc@cguil}{\ifdim\lastskip>\z@\unskip\fi>>}}%
+% \end{macrocode}
+% Notice that the above macro is strictly tied to the T1 encoding;
+% it won't do anything if the default encoding is not the T1 one.
+% Therefore if the |AE| font collection is being used it would be a
+% good idea to issue the command (shown above as an example) in order
+% to get the proper guillemets; of course using directly the |LM|
+% fonts instead of the |AE| ones would be a much better idea.
+%
+% Now we set a boolean variable and test the default family;
+% if such family has a name that starts with the letters ``ae''
+% then we have no built in guillemets; of course if the |AE| fonts
+% are chosen after the \babel\ package is loaded, the test
+% does not perform as expected.
+% \begin{macrocode}
+\def\get@ae#1#2#3!{\def\oc@ae{#1#2}}%
+\def\@ifT@one@noGuil{\expandafter\get@ae\f@family!%
+\ifdefstring{\oc@ae}{ae}}%
+% \end{macrocode}
+% Now we can set some real settings; first we start by testing
+% the encoding; if the encoding is OT1 we substitute the missing guillemets
+% with the Latin Modern ones and issue a message; then we test if the font
+% family is the |AE| one and we set again the Latin Modern ones and issue
+% another message\footnote{Notice that it is impossible to check
+% if the slots 19 and 20 of the AE fonts are defined by means of
+% the eTeX macro \texttt{\char92iffontchar}, because they are
+% actually defined as black squares!}; otherwise we set the commands
+% valid for the T1 encoding, that work well also with the TeX
+% Ligatures of the OpenType fonts.
+% \begin{macrocode}
+\AtBeginDocument{\normalfont
+ \ifdefstring{\cf@encoding}{OT1}{%
+ \GuillemetsFrom{T1}{lmr}{19}{20}%
+ \GenericWarning{occitan.ldf\space}{%
+ File occitan.ldf warning: \MessageBreak\space\space\space
+ With OT1 encoding guillemets are taken form the
+ \MessageBreak\space\space\space
+ T1 encoded Latin Modern fonts\MessageBreak\space\space\space
+ \MessageBreak\space\space}%
+ }{%
+ \ifdefstring{\cf@encoding}{T1}{%
+ \@ifT@one@noGuil{%
+ \GuillemetsFrom{T1}{lmr}{19}{20}%
+ \GenericWarning{occitan.ldf\space}{%
+ File occitan.ldf warning: \MessageBreak\space\space\space
+ The AE font collection does not contain the guillemets
+ \MessageBreak\space\space\space
+ Using Latin Modern guillemets instead
+ \MessageBreak\space}
+ }{%
+ \T@unoGuillemets}}{\T@unoGuillemets}
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Finishing commands}
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{occitan}%
+% \end{macrocode}
+%\iffalse
+%</code>
+%\fi
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/occitan/occitan.pdf b/macros/latex/contrib/babel-contrib/occitan/occitan.pdf
new file mode 100644
index 0000000000..e014910c02
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/occitan/occitan.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.dtx b/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.dtx
new file mode 100644
index 0000000000..781004cd99
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.dtx
@@ -0,0 +1,294 @@
+% \iffalse
+% !TEX encoding = UTF-8 Unicode
+%
+% file piedmontese.dtx file. By running this file through (pdf)LaTeX
+% you get the documentation concerning the babel option for the language
+% piedmontese. The extraction of the code apparently is done simultaneously
+% with the production of the documentation.
+%
+%<*internal>
+\begingroup
+\input docstrip.tex
+\keepsilent
+\preamble
+ ______________________________________________________
+ The piedmontese file for babel
+ Copyright (C) 2013 Claudio Beccari
+ All rights reserved
+
+ License information appended
+
+\endpreamble
+\postamble
+Copyright 2013 Claudio Beccari
+
+Distributable under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+This work is "author-maintained"
+
+This work consists of this file piedmontese.dtx,
+and the derived files piedmontese.ldf and piedmontese.pdf.
+
+\endpostamble
+\askforoverwritefalse
+\generate{\file{piedmontese.ldf}{\from{piedmontese.dtx}{code}}}
+%
+\def\tmpa{plain}
+\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
+\endgroup
+%</internal>
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write en entry
+% in the transcript.
+%<*dtx>
+\ProvidesFile{piedmontese.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{piedmontese}
+%<code>\ProvidesFile{piedmontese}
+ [2013/02/12 v.1.0 Piedmontese support for the babel system]
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{piedmontese.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{piedmontese.dtx}
+%
+% \section{The Piedmontese language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Piedmontese language\footnote{Language ISO 639 coded with letter identification \texttt{pms}. This file was created by Claudio Beccari; see the source file for more information.}.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc. |\CurrentOption| is actually the name of
+% language that was specified as an option in the call to \babel.
+% \iffalse
+%<*code>
+% \fi
+% \begin{macrocode}
+\LdfInit{\CurrentOption}{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option to the |\usepackage|
+% command that loads |babel|, \texttt{piedmontese} could be an
+% `unknown' language, or better, a language who's patterns have
+% not been loaded into the format file; in this case we have to
+% make it known. So we check for the existence of |\l@piedmontese|
+% to see whether we have to do something here. If the Piedmontese
+% patterns have not (yet) been loaded in the format file, we prefer
+% to declare |piedmontese| a dialect of |italian| rather than
+% a dialect of |english|, although we resort to the latter language
+% if also the Italian patterns have not been loaded into the format
+% file: this unfortunately happens when a basic \TeX\ system
+% installation is being used.
+%
+% \begin{macrocode}
+\LdfInit\CurrentOption{captions\CurrentOption}
+\ifx\l@piedmontese\@undefined
+ \@nopatterns{piedmontese}
+ \ifx\l@italian\@undefined
+ \@nopatterns{italian}
+ \adddialect\l@piedmontese\l@english
+ \else
+ \adddialect\l@piedmontese\l@italian
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macro}{\captionspiedmontese}
+% The macro |\captionspiedmontese| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Prefassion}%
+ \def\refname{Riferiment}%
+ \def\abstractname{Somari}%
+ \def\bibname{Bibliograf\`ia}%
+ \def\chaptername{Cap\`itol}%
+ \def\appendixname{Gionta}%
+ \def\contentsname{T\`aula}%
+ \def\listfigurename{Lista dle figure}%
+ \def\listtablename{Lista dle tabele}%
+ \def\indexname{T\`aula anal\`itica}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Part}%
+ \def\enclname{Gionta/e}%
+ \def\ccname{Con c\`opia a}%
+ \def\headtoname{P\"er}%
+ \def\pagename{P\`agina}%
+ \def\seename{v\"ed}%
+ \def\alsoname{v\"ed anche}%
+ \def\proofname{Dimostrassion}%
+ \def\glossaryname{Glossari}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datepiedmontese}
+% The macro |\datepiedmontese| redefines the command |\today| to
+% produce Piedmontese dates. The proposition corresponding to
+% `of' has three spellings in Piedmontese, one general (\"ed), one to
+% be used in front of words starting with a group of consonants (d\"e),
+% and a third one, that derives from the latter by vocalic elision (d')
+% to be used in front of words starting with a vowel.
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space \space\ifcase\month\or
+ \"ed gen\'e\or \"ed fevr\'e\or \"ed mars\or d'avril\or
+ \"ed maj\or \"ed giugn\or \"ed luj\or d'agost\or
+ d\"e st\`ember\or d'ot\'ober\or \"ed nov\`ember\or
+ d\"e dz\`ember\fi\space dal\space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\piedmontesehyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraspiedmontese}
+% \begin{macro}{\noextraspiedmontese}
+% The next step consists of defining commands to switch to (and
+% from) the Piedmontese language.
+%
+% The macro |\extraspiedmontese| will perform all the extra
+% definitions needed for the Piedmontese language. The macro
+% |\noextraspiedmontese| is used to cancel the actions of
+% |\extraspiedmontese|. In particular we set pretty high
+% default values for widow and club lines and very high
+% demerits to avoid that the last line starts with the
+% second half of a hyphenated word. We also assign a non zero
+% value |\lccode| to the apostrophe that in Piedmontese is being
+% used for marking a vocalic elision and for apocope; by giving it a non
+% zero value, the hyphenation algorithm treats the phrase formed
+% by the article or articulated preposition and the following
+% term as a single word and the patterns for Piedmontese take care
+% of avoiding line breaks right after the apostrophe.
+%
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \lccode`'=`'}%
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \lccode`'=0}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The double straight quote |"| is made active for the current language.
+% Its purpose is primarily to produce a diacritic hyphen; meanwhile
+% it is convenient to let it perform some other little tasks, such as
+% to insert an etymologic line break, to simplify the |\slash| command,
+% and to ease the introduction of the double raised open quotes, that are
+% cumbersome to insert with the Italian keyboard.
+%
+% The main activation of the |"| sign is done through the babel command
+% |\declare@shorthand| that checks if the |"| has been used in math or
+% in text mode; if in text mode, a service macro |\pms@next| is defined
+% that upon execution lets a future token be aliased by the implicit token
+% c.s. |\pms@temp|, while the actual work is demanded to |\pms@cwm|.
+% \begin{macrocode}
+\initiate@active@char{"}%
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+\bbl@activate{"}\languageshorthands{piedmontese}}%
+\declare@shorthand{piedmontese}{"}{%
+\ifmmode
+ \def\pms@next{''}%
+\else
+ \def\pms@next{\futurelet\pms@temp\pms@cwm}%
+\fi
+\pms@next
+}%
+% \end{macrocode}
+%
+% After defining another service macro |\pms@@cwm| for introducing a
+% discretionary break that may be inserted in the middle of a word,
+% allowing another break point, but allowing hyphenation in both letter
+% strings that sit at either side of this break point. The the |\pms@cwm|
+% macro is defined to perform the necessary actions depending on the
+% nature of the token memorized into the temporary c.s. |\pms@temp|.
+% The |\@gobble| macro must be repeated at each test, otherwise it
+% gobbles the |\fi| of the outer test. An |\expandafter| construct might
+% reduce this repetition.
+% \begin{macrocode}
+\DeclareRobustCommand*{\pms@cwm}{\let\pms@@next\relax
+\ifcat\noexpand\pms@temp a%
+ \def\pms@@next{\pms@@cwm}%
+\else
+ \ifx\pms@temp/%
+ \def\pms@@next{\bbl@allowhyphens/\bbl@allowhyphens\@gobble}%
+ \else
+ \ifx\pms@temp-%
+ \def\pms@@next{\bbl@allowhyphens-\bbl@allowhyphens\@gobble}%
+ \else
+ \ifx\pms@temp"%
+ \def\pms@@next{``\expandafter\@gobble\string}%
+ \fi
+ \fi
+ \fi
+\fi
+\pms@@next}%
+% \end{macrocode}
+% \begin{macro}{\noextraspiedmontese}
+% This done, we are ready to prepare the switch back to another language"
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+% \end{macrocode}
+% \iffalse
+%</code>
+% \fi
+% \CheckSum{226}
+% \Finale
+%\endinput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.pdf b/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.pdf
new file mode 100644
index 0000000000..8e5595672d
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/piedmontese/piedmontese.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/polish/polish.dtx b/macros/latex/contrib/babel-contrib/polish/polish.dtx
new file mode 100644
index 0000000000..a2e6697855
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/polish/polish.dtx
@@ -0,0 +1,563 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{543}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{polish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{polish}
+%\fi
+%\ProvidesFile{polish.dtx}
+ [2005/03/31 v1.2l Polish support from the babel system]
+%\iffalse
+%% File `polish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Polish Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Elmar Schalueck, Michael Janich
+% Universitaet-Gesamthochschule Paderborn
+% Warburger Strasse 100
+% 4790 Paderborn
+% Germany
+% elmar at uni-paderborn.de
+% massa at uni-paderborn.de
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Polish language definition file. It was developped
+% out of Polish.tex, which was written by Elmar Schalueck and
+% Michael Janich. Polish.tex was based on code by Leszek
+% Holenderski, Jerzy Ryll and J. S. Bie\'n from Faculty of
+% Mathematics,Informatics and Mechanics of Warsaw University, exept
+% of Jerzy Ryll (Instytut Informatyki Uniwersytetu Warszawskiego).
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{polish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{polish.dtx}
+%
+% \changes{polish-1.1c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of babel.def}
+% \changes{polish-1.2d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Polish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language-specific macros for the
+% Polish language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:polish-quote} an overview is given of its purpose.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & or |\aob|, for tailed-a (like \c{a})\\
+% |"A| & or |\Aob|, for tailed-A (like \c{A})\\
+% |"e| & or |\eob|, for tailed-e (like \c{e})\\
+% |"E| & or |\Eob|, for tailed-E (like \c{E})\\
+% |"c| & or |\'c|, for accented c (like \'c),
+% same with uppercase letters and n,o,s\\
+% |"l| & or |\lpb{}|, for l with stroke (like \l)\\
+% |"L| & or |\Lpb{}|, for L with stroke (like \L)\\
+% |"r| & or |\zkb{}|, for pointed z (like \.z), cf.
+% pronounciation\\
+% |"R| & or |\Zkb{}|, for pointed Z (like \.Z)\\
+% |"z| & or |\'z|, for accented z\\
+% |"Z| & or |\'Z|, for accented Z\\
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for German left double quotes (looks like ,,). \\
+% |"'| & for German right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$).\\
+% \end{tabular}
+% \caption{The extra definitions made by \file{polish.sty}}
+% \label{tab:polish-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{polish-1.2d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{polish}\captionspolish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{polish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@polish| to see whether we have to do something here.
+%
+% \changes{polish-1.1c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@polish\@undefined
+ \@nopatterns{Polish}
+ \adddialect\l@polish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Polish language.
+%
+% \begin{macro}{\captionspolish}
+% The macro |\captionspolish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{polish-1.2b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{polish-1.2f}{1997/09/11}{Added translation for Proof and
+% changed translation of Contents}
+% \changes{polish-1.2i}{2000/09/19}{\cs{bibname} and \cs{refname} were
+% swapped}
+% \changes{polish-1.2i}{2000/09/19}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionspolish{%
+ \def\prefacename{Przedmowa}%
+ \def\refname{Literatura}%
+ \def\abstractname{Streszczenie}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Rozdzia\l}%
+ \def\appendixname{Dodatek}%
+ \def\contentsname{Spis tre\'sci}%
+ \def\listfigurename{Spis rysunk\'ow}%
+ \def\listtablename{Spis tablic}%
+ \def\indexname{Indeks}%
+ \def\figurename{Rysunek}%
+ \def\tablename{Tablica}%
+ \def\partname{Cz\eob{}\'s\'c}%
+ \def\enclname{Za\l\aob{}cznik}%
+ \def\ccname{Kopie:}%
+ \def\headtoname{Do}%
+ \def\pagename{Strona}%
+ \def\seename{Por\'ownaj}%
+ \def\alsoname{Por\'ownaj tak\.ze}%
+ \def\proofname{Dow\'od}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datepolish}
+% The macro |\datepolish| redefines the command |\today| to produce
+% Polish dates.
+% \changes{polish-1.2f}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{polish-1.2f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{polish-1.2i}{2000/01/08}{A missing comment character caused
+% an unwanted space character in the output}
+% \begin{macrocode}
+\def\datepolish{%
+ \def\today{\number\day~\ifcase\month\or
+ stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or lipca\or
+ sierpnia\or wrze\'snia\or pa\'zdziernika\or listopada\or grudnia\fi
+ \space\number\year}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extraspolish}
+% \begin{macro}{\noextraspolish}
+% The macro |\extraspolish| will perform all the extra definitions
+% needed for the Polish language. The macro |\noextraspolish| is
+% used to cancel the actions of |\extraspolish|.
+%
+% For Polish the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the polish group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extraspolish{\languageshorthands{polish}}
+\addto\extraspolish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{polish-1.2h}{1999/12/17}{Deactivate shorthands ouside of
+% Polish}
+% \begin{macrocode}
+\addto\noextraspolish{\bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra
+% active character. This character is then used as indicated in
+% table~\ref{tab:polish-quote}.
+%
+% If you have problems at the end of a word with a linebreak, use
+% the other version without hyphenation tricks. Some TeX wizard may
+% produce a better solution with forcasting another token to decide
+% whether the character after the double quote is the last in a
+% word. Do it and let us know.
+%
+% In Polish texts some letters get special diacritical marks.
+% Leszek Holenderski designed the following code to position the
+% diacritics correctly for every font in every size. These macros
+% need a few extra dimension variables.
+%
+% \begin{macrocode}
+\newdimen\pl@left
+\newdimen\pl@down
+\newdimen\pl@right
+\newdimen\pl@temp
+% \end{macrocode}
+%
+% \begin{macro}{\sob}
+% The macro |\sob| is used to put the `ogonek' in the right
+% place.
+%
+% \changes{polish-1.2d}{1996/08/18}{This macro is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
+ \setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aob}
+% \begin{macro}{\Aob}
+% \begin{macro}{\eob}
+% \begin{macro}{\Eob}
+% The ogonek is placed with the letters `a', `A', `e', and `E'.
+% \changes{polish-1.2d}{1996/08/18}{Use the constructed version of the
+% characters only in OT1; use proper characters in T1.}
+% \begin{macrocode}
+\DeclareTextCommand{\aob}{OT1}{\sob a{.66}{.20}{0}{.90}}
+\DeclareTextCommand{\Aob}{OT1}{\sob A{.80}{.50}{0}{.90}}
+\DeclareTextCommand{\eob}{OT1}{\sob e{.50}{.35}{0}{.93}}
+\DeclareTextCommand{\Eob}{OT1}{\sob E{.60}{.35}{0}{.90}}
+% \end{macrocode}
+% For the 'new' \texttt{T1} encoding we can provide simpler
+% definitions.
+% \begin{macrocode}
+\DeclareTextCommand{\aob}{T1}{\k a}
+\DeclareTextCommand{\Aob}{T1}{\k A}
+\DeclareTextCommand{\eob}{T1}{\k e}
+\DeclareTextCommand{\Eob}{T1}{\k E}
+% \end{macrocode}
+% Construct the characters by default from the OT1 encoding.
+% \begin{macrocode}
+\ProvideTextCommandDefault{\aob}{\UseTextSymbol{OT1}{\aob}}
+\ProvideTextCommandDefault{\Aob}{\UseTextSymbol{OT1}{\Aob}}
+\ProvideTextCommandDefault{\eob}{\UseTextSymbol{OT1}{\eob}}
+\ProvideTextCommandDefault{\Eob}{\UseTextSymbol{OT1}{\Eob}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\spb}
+% The macro |\spb| is used to put the `poprzeczka' in the
+% right place.
+%
+% \changes{polish-1.2d}{1996/08/18}{\cs{spb} is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\spb#1#2#3#4#5{%
+ \setbox0\hbox{#1}\setbox1\hbox{\char'023}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \ht1=\pl@down \dp1=-\pl@down
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\skb}
+% The macro |\skb| is used to put the `kropka' in the
+% right place.
+%
+% \changes{polish-1.2d}{1996/08/18}{\cs{skb} is meant to be used in
+% horizontal mode; so leave vertical mode if necessary}
+% \begin{macrocode}
+\def\skb#1#2#3#4#5{%
+ \setbox0\hbox{#1}\setbox1\hbox{\char'056}%
+ \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
+ \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
+ \pl@left=\pl@right \advance\pl@left by\wd1
+ \leavevmode
+ \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textpl}
+% For the `poprzeczka' and the `kropka' in text fonts we don't need
+% any special coding, but we can (almost) use what is already
+% available.
+%
+% \begin{macrocode}
+\def\textpl{%
+ \def\lpb{\plll}%
+ \def\Lpb{\pLLL}%
+ \def\zkb{\.z}%
+ \def\Zkb{\.Z}}
+% \end{macrocode}
+% Initially we assume that typesetting is done with text fonts.
+% \changes{polish-1.0a}{1993/11/05}{Initially execute `textpl}
+% \begin{macrocode}
+\textpl
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\lll=\l \let\LLL=\L
+\def\plll{\lll}
+\def\pLLL{\LLL}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\telepl}
+% But for the `teletype' font in `OT1' encoding we have to take some
+% special actions, involving the macros defined above.
+%
+% \begin{macrocode}
+\def\telepl{%
+ \def\lpb{\spb l{.45}{.5}{.4}{.8}}%
+ \def\Lpb{\spb L{.23}{.5}{.4}{.8}}%
+ \def\zkb{\skb z{.5}{.5}{1.2}{0}}%
+ \def\Zkb{\skb Z{.5}{.5}{1.1}{0}}}
+% \end{macrocode}
+% \end{macro}
+%
+% To activate these codes the font changing commands as they are
+% defined in \LaTeX\ are modified. The same is done for plain
+% \TeX's font changing commands.
+%
+% When |\selectfont| is undefined the current format is spposed to be
+% either plain (based) or \LaTeX$\:$2.09.
+% \changes{polish-1.2a}{1995/06/06}{Don't modify \cs{rm} and friends for
+% \LaTeXe, take \cs{selectfont } instead}
+% \begin{macrocode}
+\ifx\selectfont\@undefined
+ \ifx\prm\@undefined \addto\rm{\textpl}\else \addto\prm{\textpl}\fi
+ \ifx\pit\@undefined \addto\it{\textpl}\else \addto\pit{\textpl}\fi
+ \ifx\pbf\@undefined \addto\bf{\textpl}\else \addto\pbf{\textpl}\fi
+ \ifx\psl\@undefined \addto\sl{\textpl}\else \addto\psl{\textpl}\fi
+ \ifx\psf\@undefined \else \addto\psf{\textpl}\fi
+ \ifx\psc\@undefined \else \addto\psc{\textpl}\fi
+ \ifx\ptt\@undefined \addto\tt{\telepl}\else \addto\ptt{\telepl}\fi
+\else
+% \end{macrocode}
+% When |\selectfont| exists we assume \LaTeXe.
+% \begin{macrocode}
+ \expandafter\addto\csname selectfont \endcsname{%
+ \csname\f@encoding @pl\endcsname}
+\fi
+% \end{macrocode}
+% Currently we support the OT1 and T1 encodings. For T1 we don't
+% have to make a difference between typewriter fonts and other
+% fonts, they all have the same glyphs.
+% \begin{macrocode}
+\expandafter\let\csname T1@pl\endcsname\textpl
+% \end{macrocode}
+% For OT1 we need to check the current font family, stored in
+% |\f@family|. Unfortunately we need a hack as |\ttdefault| is
+% defined as a |\long| macro, while |\f@family| is not.
+% \begin{macrocode}
+\expandafter\def\csname OT1@pl\endcsname{%
+ \long\edef\curr@family{\f@family}%
+ \ifx\curr@family\ttdefault
+ \telepl
+ \else
+ \textpl
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros for diacritics,
+% \changes{polish-1.1d}{1995/01/31}{The dqmacro for C used \cs{'c}}
+% \begin{macrocode}
+\declare@shorthand{polish}{"a}{\textormath{\aob}{\ddot a}}
+\declare@shorthand{polish}{"A}{\textormath{\Aob}{\ddot A}}
+\declare@shorthand{polish}{"c}{\textormath{\'c}{\acute c}}
+\declare@shorthand{polish}{"C}{\textormath{\'C}{\acute C}}
+\declare@shorthand{polish}{"e}{\textormath{\eob}{\ddot e}}
+\declare@shorthand{polish}{"E}{\textormath{\Eob}{\ddot E}}
+\declare@shorthand{polish}{"l}{\textormath{\lpb}{\ddot l}}
+\declare@shorthand{polish}{"L}{\textormath{\Lpb}{\ddot L}}
+\declare@shorthand{polish}{"n}{\textormath{\'n}{\acute n}}
+\declare@shorthand{polish}{"N}{\textormath{\'N}{\acute N}}
+\declare@shorthand{polish}{"o}{\textormath{\'o}{\acute o}}
+\declare@shorthand{polish}{"O}{\textormath{\'O}{\acute O}}
+\declare@shorthand{polish}{"s}{\textormath{\'s}{\acute s}}
+\declare@shorthand{polish}{"S}{\textormath{\'S}{\acute S}}
+% \end{macrocode}
+% \begin{macro}{\polishrz}
+% \begin{macro}{\polishzx}
+% \changes{polish-1.2j}{2000/11/11}{Added support for two
+% notationstyles for kropka and accented z}
+% The command |\polishrz| defines the shorthands |"r|, |"z| and
+% |"x| to produce pointed z, accented z and |"x|. This is the
+% default as these shorthands were defined by this language
+% definition file for quite some time.
+% \begin{macrocode}
+\newcommand*{\polishrz}{%
+ \declare@shorthand{polish}{"r}{\textormath{\zkb}{\ddot r}}%
+ \declare@shorthand{polish}{"R}{\textormath{\Zkb}{\ddot R}}%
+ \declare@shorthand{polish}{"z}{\textormath{\'z}{\acute z}}%
+ \declare@shorthand{polish}{"Z}{\textormath{\'Z}{\acute Z}}%
+ \declare@shorthand{polish}{"x}{\dq x}%
+ \declare@shorthand{polish}{"X}{\dq X}%
+ }
+\polishrz
+% \end{macrocode}
+% The command |\polishzx| switches to a different set of
+% shorthands, |"z|, |"x| and |"r| to produce pointed z, accented z
+% and |"r|; a different shorthand notation also in use.
+% \changes{polish-1.2k}{2003/10/12}{Fixed a typo}
+% \begin{macrocode}
+\newcommand*{\polishzx}{%
+ \declare@shorthand{polish}{"z}{\textormath{\zkb}{\ddot z}}%
+ \declare@shorthand{polish}{"Z}{\textormath{\Zkb}{\ddot Z}}%
+ \declare@shorthand{polish}{"x}{\textormath{\'z}{\acute x}}%
+ \declare@shorthand{polish}{"X}{\textormath{\'Z}{\acute X}}%
+ \declare@shorthand{polish}{"r}{\dq r}%
+ \declare@shorthand{polish}{"R}{\dq R}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \changes{polish-1.2e}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \changes{polish-1.2l}{2004/02/18}{Changed closing quote}
+% \begin{macrocode}
+\declare@shorthand{polish}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{polish}{"'}{%
+ \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
+\declare@shorthand{polish}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{polish}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behavew a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{polish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{polish}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{polish}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{polish.tex}.
+% \changes{polish-1.2f}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{polish-1.2d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{polish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/polish/polish.ins b/macros/latex/contrib/babel-contrib/polish/polish.ins
new file mode 100644
index 0000000000..00a5e50a92
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/polish/polish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{polish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{polish.ldf}{\from{polish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/polish/polish.pdf b/macros/latex/contrib/babel-contrib/polish/polish.pdf
new file mode 100644
index 0000000000..19b5c0b01b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/polish/polish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/portuges/portuges.dtx b/macros/latex/contrib/babel-contrib/portuges/portuges.dtx
new file mode 100644
index 0000000000..7797f12541
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/portuges/portuges.dtx
@@ -0,0 +1,475 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{320}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{portuges.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{portuges}
+%\fi
+%\ProvidesFile{portuges.dtx}
+ [2008/03/18 v1.2q Portuguese support from the babel system]
+%\iffalse
+%% File `portuges.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Portuguese Language Definition File
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Portuguese language definition file. The Portuguese
+% words were contributed by Jose Pedro Ramalhete, (JRAMALHE@CERNVM
+% or Jose-Pedro_Ramalhete@MACMAIL).
+%
+% Arnaldo Viegas de Lima <arnaldo@VNET.IBM.COM> contributed
+% brasilian translations and suggestions for enhancements.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{portuges.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{portuges.dtx}
+%
+% \changes{portuges-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{portuges-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{portuges-1.2}{1994/02/26}{Update for \LaTeXe}
+% \changes{portuges-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{portuges-1.2g}{1995/06/04}{Enhanced support for brasilian}
+% \changes{portuges-1.2j}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{portuges-1.2j}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Portuguese language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Jose Pedro Ramalhete
+% (\texttt{JRAMALHE@CERNVM} or
+% \texttt{Jose-Pedro\_Ramalhete@MACMAIL}) and Arnaldo Viegas de
+% Lima \texttt{arnaldo@VNET.IBM.COM}.} defines all the
+% language-specific macros for the Portuguese language as well as
+% for the Brasilian version of this language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:port-quote} an overview is given of its purpose.
+%
+% \begin{table}[htb]
+% \centering
+% \begin{tabular}{lp{8cm}}
+% \verb="|= & disable ligature at this position.\\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word.\\
+% |""| & like \verb="-=, but producing no hyphen sign (for
+% words that should break at some sign such as
+% ``entrada/salida.''\\
+% |"<| & for French left double quotes (similar to $<<$).\\
+% |">| & for French right double quotes (similar to $>>$).\\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% \end{tabular}
+% \caption{The extra definitions made by \file{portuges.ldf}}
+% \label{tab:port-quote}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{portuges-1.2j}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{portuges} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@portuges| to see whether we have to do something here. Since
+% it is possible to load this file with any of the following four
+% options to babel: \Lopt{portuges}, \Lopt{portuguese},
+% \Lopt{brazil} and \Lopt{brazilian} we also allow that the
+% hyphenation patterns are loaded under any of these four names. We
+% just have to find out which one was used.
+%
+% \changes{portuges-1.0b}{1991/10/29}{Removed use of cs{@ifundefined}}
+% \changes{portuges-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{portuges-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@portuges\@undefined
+ \ifx\l@portuguese\@undefined
+ \ifx\l@brazil\@undefined
+ \ifx\l@brazilian\@undefined
+ \@nopatterns{Portuguese}
+ \adddialect\l@portuges0
+ \else
+ \let\l@portuges\l@brazilian
+ \fi
+ \else
+ \let\l@portuges\l@brazil
+ \fi
+ \else
+ \let\l@portuges\l@portuguese
+ \fi
+\fi
+% \end{macrocode}
+% By now |\l@portuges| is defined. When the language definition
+% file was loaded under a different name we make sure that the
+% hyphenation patterns can be found.
+% \begin{macrocode}
+\expandafter\ifx\csname l@\CurrentOption\endcsname\relax
+ \expandafter\let\csname l@\CurrentOption\endcsname\l@portuges
+\fi
+% \end{macrocode}
+%
+% Now we have to decide whether this language definition file was
+% loaded for Portuguese or Brasilian use. This can be done by
+% checking the contents of |\CurrentOption|. When it doesn't
+% contain either `portuges' or `portuguese' we make |\bbl@tempb|
+% empty.
+% \begin{macrocode}
+\def\bbl@tempa{portuguese}
+\ifx\CurrentOption\bbl@tempa
+ \let\bbl@tempb\@empty
+\else
+ \def\bbl@tempa{portuges}
+ \ifx\CurrentOption\bbl@tempa
+ \let\bbl@tempb\@empty
+ \else
+ \def\bbl@tempb{brazil}
+ \fi
+\fi
+\ifx\bbl@tempb\@empty
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and from)
+% the Portuguese language.
+%
+% \begin{macro}{\captionsportuges}
+% The macro |\captionsportuges| defines all strings used
+% in the four standard documentclasses provided with \LaTeX.
+% \changes{portuges-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{portuges-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{portuges-1.2e}{1994/11/09}{Added a few missing
+% translations}
+% \changes{portuges-1.2h}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{portuges-1.2i}{1995/11/25}{Substituted `Prova' for `Proof'}
+% \begin{macrocode}
+ \@namedef{captions\CurrentOption}{%
+ \def\prefacename{Pref\'acio}%
+ \def\refname{Refer\^encias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Bibliografia}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\^endice}%
+% \end{macrocode}
+% Some discussion took place around the correct translations for
+% `Table of Contents' and `Index'. the translations differ for
+% Portuguese and Brasilian based the following history:
+% \begin{quote}
+% The whole issue is that some books without a real index at the
+% end misused the term `\'Indice' as table of contents. Then,
+% what happens is that some books apeared with `\'Indice' at the
+% begining and a `\'Indice Remissivo' at the end. Remissivo is a
+% redundant word in this case, but was introduced to make up the
+% difference. So in Brasil people started using `Sum\'ario' and
+% `\'Indice Remissivo'. In Portugal this seems not to be very
+% common, therefore we chose `\'Indice' instead of `\'Indice
+% Remissivo'.
+% \end{quote}
+% \begin{macrocode}
+ \def\contentsname{Conte\'udo}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{\'Indice}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\enclname{Anexo}%
+ \def\ccname{Com c\'opia a}%
+ \def\headtoname{Para}%
+ \def\pagename{P\'agina}%
+ \def\seename{ver}%
+ \def\alsoname{ver tamb\'em}%
+% \end{macrocode}
+% An alternate term for `Proof' could be `Prova'.
+% \changes{portuges-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{portuges-1.2p}{2003/05/23}{Substituted `Gloss\'ario' for
+% `Glossary'}
+% \begin{macrocode}
+ \def\proofname{Demonstra\c{c}\~ao}%
+ \def\glossaryname{Gloss\'ario}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateportuges}
+% The macro |\dateportuges| redefines the command |\today| to
+% produce Portuguese dates.
+% \changes{portuges-1.2k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{portuges-1.2k}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{portuges-1.2n}{2001/01/27}{Removed spurious space after
+% Dezembro}
+% \begin{macrocode}
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space de\space\ifcase\month\or
+ Janeiro\or Fevereiro\or Mar\c{c}o\or Abril\or Maio\or Junho\or
+ Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro%
+ \fi
+ \space de\space\number\year}}
+\else
+% \end{macrocode}
+% \end{macro}
+%
+% For the Brasilian version of these definitions we just add a
+% ``dialect''.
+% \begin{macrocode}
+ \expandafter
+ \adddialect\csname l@\CurrentOption\endcsname\l@portuges
+% \end{macrocode}
+%
+% \begin{macro}{\captionsbrazil}
+% \changes{portuges-1.2g}{1995/06/04}{The captions for brasilian and
+% portuguese are different now}
+%
+% The ``captions'' are different for both versions of the language,
+% so we define the macro |\captionsbrazil| here.
+% \changes{portuges-1.2i}{1995/11/25}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{portuges-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{portuges-1.2q}{2008/03/18}{Substituted `Gloss\'ario' for
+% `Glossary'}
+% \begin{macrocode}
+ \@namedef{captions\CurrentOption}{%
+ \def\prefacename{Pref\'acio}%
+ \def\refname{Refer\^encias}%
+ \def\abstractname{Resumo}%
+ \def\bibname{Refer\^encias Bibliogr\'aficas}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\^endice}%
+ \def\contentsname{Sum\'ario}%
+ \def\listfigurename{Lista de Figuras}%
+ \def\listtablename{Lista de Tabelas}%
+ \def\indexname{\'Indice Remissivo}%
+ \def\figurename{Figura}%
+ \def\tablename{Tabela}%
+ \def\partname{Parte}%
+ \def\enclname{Anexo}%
+ \def\ccname{C\'opia para}%
+ \def\headtoname{Para}%
+ \def\pagename{P\'agina}%
+ \def\seename{veja}%
+ \def\alsoname{veja tamb\'em}%
+ \def\proofname{Demonstra\c{c}\~ao}%
+ \def\glossaryname{Gloss\'ario}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datebrazil}
+% The macro |\datebrazil| redefines the command
+% |\today| to produce Brasilian dates, for which the names
+% of the months are not capitalized.
+% \changes{portuges-1.2k}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{portuges-1.2k}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{portuges-1.2n}{2001/01/27}{Removed spurious space after
+% dezembro}
+% \begin{macrocode}
+ \@namedef{date\CurrentOption}{%
+ \def\today{\number\day\space de\space\ifcase\month\or
+ janeiro\or fevereiro\or mar\c{c}o\or abril\or maio\or junho\or
+ julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
+ \fi
+ \space de\space\number\year}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\portugeshyphenmins}
+% \changes{portuges-1.2g}{1995/06/04}{Added setting of hyphenmin
+% values}
+% Set correct values for |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{portuges-1.2m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \changes{portuges-1.2o}{2001/02/16}{Set \cs{righthyphenmin} to 3 if
+% not provided by the pattern file.}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasportuges}
+% \changes{portuges-1.2g}{1995/06/04}{Added the definition of some
+% \texttt{"} shorthands}
+% \begin{macro}{\noextrasportuges}
+% The macro |\extrasportuges| will perform all the extra
+% definitions needed for the Portuguese language. The macro
+% |\noextrasportuges| is used to cancel the actions of
+% |\extrasportuges|.
+%
+% For Portuguese the \texttt{"} character is made active. This is
+% done once, later on its definition may vary. Other languages in
+% the same document may also use the \texttt{"} character for
+% shorthands; we specify that the portuguese group of shorthands
+% should be used.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{\languageshorthands{portuges}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{portuges-1.2m}{1999/12/17}{Deactivate shorthands ouside of
+% Basque}
+% \begin{macrocode}
+\addto\noextrasportuges{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define access to the guillemets for quotations,
+% \changes{portuges-1.2k}{1997/04/03}{Removed empty groups after
+% guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{portuges}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{portuges}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behave a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{portuges}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{portuges}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{portuges}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\-}
+%
+% All that is left now is the redefinition of |\-|. The new version
+% of |\-| should indicate an extra hyphenation position, while
+% allowing other hyphenation positions to be generated
+% automatically. The standard behaviour of \TeX\ in this respect is
+% very unfortunate for languages such as Dutch and German, where
+% long compound words are quite normal and all one needs is a means
+% to indicate an extra hyphenation position on top of the ones that
+% \TeX\ can generate from the hyphenation patterns.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\-}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\-{\allowhyphens\discretionary{-}{}{}\allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ord}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\ro}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\orda}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% \begin{macro}{\ra}
+% \changes{portuges-1.2g}{1995/06/04}{Added macro}
+% We also provide an easy way to typeset ordinals, both in the male
+% (|\ord| or |\ro|) and the female (|orda| or |\ra|) form.
+% \begin{macrocode}
+\def\ord{$^{\rm o}$}
+\def\orda{$^{\rm a}$}
+\let\ro\ord\let\ra\orda
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{portuges-1.2j}{1996/11/03}{ow use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/portuges/portuges.ins b/macros/latex/contrib/babel-contrib/portuges/portuges.ins
new file mode 100644
index 0000000000..e4e3c2e029
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/portuges/portuges.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{portuges.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{portuges.ldf}{\from{portuges.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/portuges/portuges.pdf b/macros/latex/contrib/babel-contrib/portuges/portuges.pdf
new file mode 100644
index 0000000000..05697c6b84
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/portuges/portuges.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/romanian/romanian.dtx b/macros/latex/contrib/babel-contrib/romanian/romanian.dtx
new file mode 100644
index 0000000000..8895057030
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romanian/romanian.dtx
@@ -0,0 +1,232 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{89}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{romanian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{romanian}
+%\fi
+%\ProvidesFile{romanian.dtx}
+ [2005/03/31 v1.2l Romanian support from the babel system]
+%\iffalse
+%% File `romanian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Romanian Language Definition File
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Romanian language definition file. A contribution
+% was made by Umstatter Horst (hhu at cernvm.cern.ch) and Robert
+% Juhasz (robertj at uni-paderborn.de)
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{romanian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{romanian.dtx}
+%
+% \changes{romanian-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{romanian-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{romanian-1.2}{1994/02/27}{Update for LaTeX2e}
+% \changes{romanian-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of babel.def}
+% \changes{romanian-1.2e}{1995/05/25}{Updated for babel release 3.5}
+% \changes{romanian-1.2h}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Romanian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Umstatter Horst
+% (\texttt{hhu@cernvm.cern.ch}).} defines all the
+% language-specific macros for the Romanian language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{romanian-1.2h}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{romanian}\captionsromanian
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{romanian} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@romanian| to see whether we have to do something here.
+%
+% \changes{romanian-1.0b}{1991/10/29}{Removed use of
+% \cs{@ifundefined}}
+% \changes{romanian-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{romanian-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@romanian\@undefined
+ \@nopatterns{Romanian}
+ \adddialect\l@romanian0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Romanian language.
+%
+% \begin{macro}{\captionsromanian}
+% The macro |\captionsromanian| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{romanian-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{romanian-1.1}{1992/02/17}{Translation errors found by
+% Robert Juhasz fixed}
+% \changes{romanian-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{romanian-1.2f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{romanian-1.2g}{1995/11/10}{Added translation of `Proof'}
+% \changes{romanian-1.2k}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{romanian-1.2l}{2003/06/10}{Added translation for Glossary}
+% \begin{macrocode}ls
+\addto\captionsromanian{%
+ \def\prefacename{Prefa\c{t}\u{a}}%
+ \def\refname{Bibliografie}%
+ \def\abstractname{Rezumat}%
+ \def\bibname{Bibliografie}%
+ \def\chaptername{Capitolul}%
+ \def\appendixname{Anexa}%
+ \def\contentsname{Cuprins}%
+ \def\listfigurename{List\u{a} de figuri}%
+ \def\listtablename{List\u{a} de tabele}%
+ \def\indexname{Glosar}%
+ \def\figurename{Figura}% % sau Plan\c{s}a
+ \def\tablename{Tabela}%
+ \def\partname{Partea}%
+ \def\enclname{Anex\u{a}}% % sau Anexe
+ \def\ccname{Copie}%
+ \def\headtoname{Pentru}%
+ \def\pagename{Pagina}%
+ \def\seename{Vezi}%
+ \def\alsoname{Vezi de asemenea}%
+ \def\proofname{Demonstra\c{t}ie} %
+ \def\glossaryname{Glosar}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateromanian}
+% The macro |\dateromanian| redefines the command |\today| to
+% produce Romanian dates.
+% \changes{romanian-1.1}{1992/02/17}{Translation errors found by Robert
+% Juhasz fixed}
+% \changes{romanian-1.2i}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{romanian-1.2i}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateromanian{%
+ \def\today{\number\day~\ifcase\month\or
+ ianuarie\or februarie\or martie\or aprilie\or mai\or
+ iunie\or iulie\or august\or septembrie\or octombrie\or
+ noiembrie\or decembrie\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasromanian}
+% \begin{macro}{\noextrasromanian}
+% The macro |\extrasromanian| will perform all the extra
+% definitions needed for the Romanian language. The macro
+% |\noextrasromanian| is used to cancel the actions of
+% |\extrasromanian| For the moment these macros are empty but they
+% are defined for compatibility with the other language definition
+% files.
+%
+% \begin{macrocode}
+\addto\extrasromanian{}
+\addto\noextrasromanian{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{romanian-1.2h}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{romanian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/romanian/romanian.ins b/macros/latex/contrib/babel-contrib/romanian/romanian.ins
new file mode 100644
index 0000000000..749b4561ea
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romanian/romanian.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{romanian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{romanian.ldf}{\from{romanian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/romanian/romanian.pdf b/macros/latex/contrib/babel-contrib/romanian/romanian.pdf
new file mode 100644
index 0000000000..799d91042e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romanian/romanian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/romansh/romansh.dtx b/macros/latex/contrib/babel-contrib/romansh/romansh.dtx
new file mode 100644
index 0000000000..fa1843c1db
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romansh/romansh.dtx
@@ -0,0 +1,206 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2009 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{0}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{romansh.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{romansh}
+%\fi
+%\ProvidesFile{romansh.dtx}
+ [2012/01/13 v1.0 Romansh support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2012
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.xs4all.nl
+% Claudio Beccari
+% claudio dot beccari at gmail.com
+%
+% This file is part of the babel system, it provides the source code for
+% the Romansh language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{romansh.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{romansh.dtx}
+% \section{The Romansh language}
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Romansh language. Here the language name Romansh refers itself to
+% the official language Rumantsch Grischun used in Switzerland as
+% the formal language used by the Federal offices for its communications
+% with the Romansh speakers, mostly living in Chantun Grischun. Actually
+% the Romansh speakers us one of seven Romansh dialects, but they can
+% understand each other in spate of certain differences in wording and
+% spelling. The Official Rumantsch Grischun has been developed as a
+% unifying language, with no doubts in the written form, hopefully also
+% in the spoken one.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%<*code>
+% \begin{macrocode}
+\LdfInit{romansh}{captionsromansh}%
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{romansh} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@romansh| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\l@romansh\@undefined
+ \@nopatterns{romansh}%
+ \ifx\l@italian\@undefined
+ \adddialect\l@romansh0\else
+ \adddialect\l@romansh\l@italian\fi\fi
+% \end{macrocode}
+% \begin{macro}{\romanshhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \begin{macrocode}
+\providehyphenmins{romansh}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionsromansh}
+% The macro |\captionsromansh| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\addto\captionsromansh{%
+ \def\prefacename{Prefaziun}%
+ \def\refname{Bibliografia}%
+ \def\abstractname{Recapitulaziun}%
+ \def\bibname{Index bibliografic}%
+ \def\chaptername{Chapitel}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Tavla dal cuntegn}%
+ \def\listfigurename{Tavla da las figuras}%
+ \def\listtablename{Tavla da las tabellas}%
+ \def\indexname{Register da materias}% Index?
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Part}%
+ \def\enclname{Agiunta(s)}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{pagina}%
+ \def\seename{vesair }%
+ \def\alsoname{vesair era}%
+ \def\proofname{Demonstraziun}%
+ \def\glossaryname{Glossari}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateromansh}
+% The macro |\dateromansh| redefines the command |\today| to
+% produce Romansh dates.
+% \begin{macrocode}
+\def\dateromansh{%
+ \def\today{\ifcase\day\or 1.\else ils~\number\day\fi~da~%
+ \ifcase\month\or
+ schaner\or favrer\or mars\or avrigl\or matg\or zercladur\or
+ fanadur\or avust\or settember\or october\or november\or
+ december\fi\space \number\year}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasromansh}
+% \begin{macro}{\noextrasromansh}
+% The macro |\extrasromansh| will perform all the extra
+% definitions needed for the Romansh language. The macro
+% |\noextrasromansh| is used to cancel the actions of
+% |\extrasromansh|.
+%
+% \begin{macrocode}
+\addto\extrasromansh{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+\addto\extrasromansh{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+\addto\extrasromansh{%
+ \lccode`'=`' }%
+\addto\noextrasromansh{%
+ \lccode`'=0 }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{romansh}
+\endinput
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%% \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/romansh/romansh.ldf b/macros/latex/contrib/babel-contrib/romansh/romansh.ldf
new file mode 100644
index 0000000000..d015fcde26
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romansh/romansh.ldf
@@ -0,0 +1,48 @@
+\LdfInit{romansh}{captionsromansh}%
+\ifx\l@romansh\@undefined
+ \@nopatterns{romansh}%
+ \adddialect\l@romansh\l@italian\fi
+\addto\captionsromansh{%
+ \def\prefacename{Prefaziun}%
+ \def\refname{Bibliografia}%
+ \def\abstractname{Recapitulaziun}%
+ \def\bibname{Index bibliografic}%
+ \def\chaptername{Chapitel}%
+ \def\appendixname{Appendix}%
+ \def\contentsname{Tavla dal cuntegn}%
+ \def\listfigurename{Tavla da las figuras}%
+ \def\listtablename{Tavla da las tabellas}%
+ \def\indexname{Register da materias}% Index?
+ \def\figurename{Figura}%
+ \def\tablename{Tabella}%
+ \def\partname{Part}%
+ \def\enclname{Agiunta(s)}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{pagina}%
+ \def\seename{vesair }%
+ \def\alsoname{vesair era}%
+ \def\proofname{Demonstraziun}%
+ \def\glossaryname{Glossari}%
+ }%
+\def\dateromansh{%
+ \def\today{\ifcase\day\or il 1.\else ils~\number\day\fi~da~%
+ \ifcase\month\or
+ schaner\or favrer\or mars\or avrigl\or matg\or zercladur\or
+ fanadur\or avust\or settember\or october\or november\or
+ december\fi\space \number\year}}%
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\addto\extrasromansh{%
+ \babel@savevariable\clubpenalty
+ \babel@savevariable\widowpenalty
+ \babel@savevariable\@clubpenalty
+ \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
+\addto\extrasromansh{%
+ \babel@savevariable\finalhyphendemerits
+ \finalhyphendemerits50000000}%
+\addto\extrasromansh{%
+ \lccode`'=`' }%
+\addto\noextrasromansh{%
+ \lccode`'=0 }%
+\ldf@finish{romansh}%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/romansh/romansh.pdf b/macros/latex/contrib/babel-contrib/romansh/romansh.pdf
new file mode 100644
index 0000000000..e0abff810c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/romansh/romansh.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/russian/README b/macros/latex/contrib/babel-contrib/russian/README
new file mode 100644
index 0000000000..f0b392a357
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/russian/README
@@ -0,0 +1,269 @@
+----------------------------------------------------------------
+
+Russian language module for Babel, v1.3j
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Russian
+(in both traditional and ancient forms). The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+The Current Maintainer is Igor A. Kotelnikov <kia999 at mail dot ru>.
+
+1. INSTALLATION
+
+- unpack babel-russian.zip
+- run "xelatex.exe russianb.dtx" (recommended)
+ or "pdflatex.exe russianb.dtx";
+ run "tex.exe russianb.dtx"
+ or "tex.exe russianb.ins", if you don't need documentation
+- move "russianb.ldf" to <textmf>/tex/generic/babel/contrib/
+- move "russianb.pdf" and README to <textmf>/doc/latex/russian-babel/
+- update filename base (see documentation for your TeX system)
+
+2. USAGE
+
+Russian language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe). The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+2.1. 8-bit mode
+
+2.1.1 PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,russian]{babel}
+
+2.1.2 LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,russian]{babel}
+
+2.1.3 XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,russian]{babel}
+
+2.2 Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,russian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may try any True Type or Open Type font installed on your computer provided
+that that font came with Russian letters.
+
+2.3 Typesetting ancient book
+
+ \usepackage[english,russian]{babel}
+ \languageattribute{russian}{ancient}
+or
+ \usepackage[english,russian.ancient]{babel}
+
+Using Unicode mode is strongly recommended for typesetting ancient texts.
+Be sure to take X2 or OT2 font encodings when running 8-bit engine such
+as latex or pdflatex.
+
+3. DOCUMENTATION
+
+See russianb.pdf for more information.
+
+4. KNOWN PROBLEMS
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+T2* font encodings do not have legacy Cyrillic letters `yat', which is
+hard-coded in ancient caption names. Be sure to use an Unicode engine
+or borrow `\cyryat` and `\CYRYAT` commands from X2 font encoding when setting
+the language attribute to "ancient", for example:
+
+ \usepackage[X2,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \DeclareUnicodeCharacter{0462}{\CYRYAT}
+ \DeclareTextSymbolDefault{\CYRYAT}{X2}
+ \DeclareUnicodeCharacter{0463}{\cyryat}
+ \DeclareTextSymbolDefault{\cyryat}{X2}
+ \usepackage[english,russian.ancient]{babel}
+
+Consult your font documentation for other ancient glyphs which
+might be absent.
+
+5. CHANGES
+
+2017-08-08 version 1.3j
+
+ * TU encoding is set as default for X∃TeX and LuaTeX.
+
+ * \cyrdash now always prints dash 20% shorter than emdash.
+
+2017-01-12 version 1.3i
+
+ * Bug fixed in \NOD, \NOK and similar log-functions (thanks to V. Vlasov).
+
+2016-02-18 version 1.3h
+
+ * Bugs fixed in captions for revtex4 and revtex4-1 classes.
+
+ * \cyrdash is now faked using \ProvideTextCommandDefault rather
+ than \def.
+
+2015-05-01 version 1.3g
+
+ * Added support for revtex4 and revtex4-1 classes.
+
+2014-10-21 version 1.3f
+
+ * A documentation file russianb.pdf can now be generated by
+ running pdflatex.exe over russianb.dtx although xelatex.exe
+ is still recommended.
+
+ * russianb.ins was missed in version 1.3e.
+
+2014-10-14 version 1.3e
+
+ * Generating all stuff from single dtx file.
+
+2014-10-02 version 1.3d
+
+ * Bug fix in \Proj.
+
+2014-06-02 version 1.3c
+
+ * Bug fix in \daterussian.
+
+2013-04-06 version 1.3b
+
+ * Added support for the packages \pkg{listing}, \pkg{nomencl}, and
+ \pkg{nomentbl}.
+
+2013-04-18 version 1.3a
+
+ * Added the language attribute 'ancient' for typesetting old
+ Slavonic and Church books.
+
+2013-04-08 version 1.3
+
+ * Updated for babel 3.9.
+ * \Alph and \alph commands are not redefined any more by russianb.ldf.
+
+2012-06-02 version 1.2a
+
+ * russian/russianb.dtx, v1.2a : Indentation of 1st paragraph removed;
+ use the indentfirst package to automatically indent first paragraph
+ after sectioning commands.
+
+2011-10-20 version 1.2 Igor A. Kotelnikov <kia999 at mail dot ru>
+
+ * Added support for LuaTeX and XeTeX;
+ added translation for Glossary; removed \Rus, \English,
+ \Eng, \cyrmath.., \latinencoding, \latintext;
+ \Russian is now an alias for \selectlanguage{russian}.
+
+Original source: russianb.dtx,
+ 2008/03/21 v1.1r Russian support from the babel system.
+
+----------------------------------------------------------------
+
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
diff --git a/macros/latex/contrib/babel-contrib/russian/russianb.dtx b/macros/latex/contrib/babel-contrib/russian/russianb.dtx
new file mode 100644
index 0000000000..b843e43bd2
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/russian/russianb.dtx
@@ -0,0 +1,2235 @@
+% \iffalse meta-comment
+% !TEX program = xeLaTeX
+% !Mode:: TEX:DTX:UNIX:UTF-8:US:RU
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+----------------------------------------------------------------
+
+Russian language module for Babel, v1.3j
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Russian
+(in both traditional and ancient forms). The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+The Current Maintainer is Igor A. Kotelnikov <kia999 at mail dot ru>.
+
+
+1. INSTALLATION
+
+- unpack babel-russian.zip
+- run "xelatex.exe russianb.dtx" (recommended)
+ or "pdflatex.exe russianb.dtx";
+ run "tex.exe russianb.dtx"
+ or "tex.exe russianb.ins", if you don't need documentation
+- move "russianb.ldf" to <textmf>/tex/generic/babel/contrib/
+- move "russianb.pdf" and README to <textmf>/doc/latex/russian-babel/
+- update filename base (see documentation for your TeX system)
+
+
+2. USAGE
+
+Russian language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe). The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+2.1. 8-bit mode
+
+2.1.1 PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,russian]{babel}
+
+2.1.2 LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,russian]{babel}
+
+2.1.3 XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,russian]{babel}
+
+2.2 Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,russian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may try any True Type or Open Type font installed on your computer provided
+that that font came with Russian letters.
+
+2.3 Typesetting ancient book
+
+ \usepackage[english,russian]{babel}
+ \languageattribute{russian}{ancient}
+or
+ \usepackage[english,russian.ancient]{babel}
+
+Using Unicode mode is strongly recommended for typesetting ancient texts.
+Be sure to take X2 or OT2 font encodings when running 8-bit engine such
+as latex or pdflatex.
+
+
+3. DOCUMENTATION
+
+See russianb.pdf for more information.
+
+
+4. KNOWN PROBLEMS
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+T2* font encodings do not have legacy Cyrillic letters `yat', which is
+hard-coded in ancient caption names. Be sure to use an Unicode engine
+or borrow `\cyryat` and `\CYRYAT` commands from X2 font encoding when setting
+the language attribute to "ancient", for example:
+
+ \usepackage[X2,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \DeclareUnicodeCharacter{0462}{\CYRYAT}
+ \DeclareTextSymbolDefault{\CYRYAT}{X2}
+ \DeclareUnicodeCharacter{0463}{\cyryat}
+ \DeclareTextSymbolDefault{\cyryat}{X2}
+ \usepackage[english,russian.ancient]{babel}
+
+Consult your font documentation for other ancient glyphs which
+might be absent.
+
+
+5. CHANGES
+
+2017-08-08 version 1.3j
+
+ * TU encoding is set as default for X∃TeX and LuaTeX.
+
+ * \cyrdash now always prints dash 20% shorter than emdash.
+
+
+2017-01-12 version 1.3i
+
+ * Bug fixed in \NOD, \NOK and similar log-functions (thanks to V. Vlasov).
+
+2016-02-18 version 1.3h
+
+ * Bugs fixed in captions for revtex4 and revtex4-1 classes.
+
+ * \cyrdash is now faked using \ProvideTextCommandDefault rather
+ than \def.
+
+2015-05-01 version 1.3g
+
+ * Added support for revtex4 and revtex4-1 classes.
+
+2014-10-21 version 1.3f
+
+ * A documentation file russianb.pdf can now be generated by
+ running pdflatex.exe over russianb.dtx although xelatex.exe
+ is still recommended.
+
+ * russianb.ins was missed in version 1.3e.
+
+2014-10-14 version 1.3e
+
+ * Generating all stuff from single dtx file.
+
+2014-10-02 version 1.3d
+
+ * Bug fix in \Proj.
+
+2014-06-02 version 1.3c
+
+ * Bug fix in \daterussian.
+
+2013-04-06 version 1.3b
+
+ * Added support for the packages \pkg{listing}, \pkg{nomencl}, and
+ \pkg{nomentbl}.
+
+2013-04-18 version 1.3a
+
+ * Added the language attribute 'ancient' for typesetting old
+ Slavonic and Church books.
+
+2013-04-08 version 1.3
+
+ * Updated for babel 3.9.
+ * \Alph and \alph commands are not redefined any more by russianb.ldf.
+
+2012-06-02 version 1.2a
+
+ * russian/russianb.dtx, v1.2a : Indentation of 1st paragraph removed;
+ use the indentfirst package to automatically indent first paragraph
+ after sectioning commands.
+
+2011-10-20 version 1.2 Igor A. Kotelnikov <kia999 at mail dot ru>
+
+ * Added support for LuaTeX and XeTeX;
+ added translation for Glossary; removed \Rus, \English,
+ \Eng, \cyrmath.., \latinencoding, \latintext;
+ \Russian is now an alias for \selectlanguage{russian}.
+
+Original source: russianb.dtx,
+ 2008/03/21 v1.1r Russian support from the babel system.
+
+----------------------------------------------------------------
+%</readme>
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+Russian Language Support for the Babel package
+E-mail: kia999@mail.ru
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+\endpreamble
+\postamble
+----------------------------------------------------------------
+Copyright 2011-2017 Igor A. Kotelnikov.
+Copyright 1995-2008 Olga Lapko.
+Copyright 1989-2012 Johannes L. Braams.
+
+This file is a part of the Russian-Babel package.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+The package is "maintained" (as per LPPL maintenance status) by
+Igor A. Kotelnikov.
+
+The package consists of the file russianb.dtx
+and the derived files russianb.ins,
+ russianb.ldf,
+ russianb.pdf,
+ README.
+----------------------------------------------------------------
+\endpostamble
+\usedir{tex/generic/babel/contrib}
+\generate{
+ \file{\jobname.ldf}{\from{\jobname.dtx}{code}}
+}
+%</install>
+%<install>\endbatchfile
+%<*internal>
+\usedir{source/latex/babel-russian}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+\usedir{doc/latex/babel-russian}
+\generate{
+ \file{README.}{\from{\jobname.dtx}{readme}}
+}
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+%<*code>
+\NeedsTeXFormat{LaTeX2e}
+%\ProvidesFile{russianb.ldf}[2017/08/08 1.3j Russian support for the Babel system]
+%</code>
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+%%
+%% This document should be compiled by
+%% XeLaTeX or LuaLaTex since some cyrillic
+%% glyphs are absent in T2* encodings used
+%% by LaTeX.
+%%
+\usepackage{ifxetex,ifluatex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ %\setmonofont[Scale=MatchLowercase]{Courier New}
+ %\setmonofont[Scale=MatchUppercase]{Courier New}
+ %\setmonofont{Courier New}
+\else
+ \usepackage[X2,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \DeclareUnicodeCharacter{0462}{\CYRYAT}
+ \DeclareTextSymbolDefault{\CYRYAT}{X2}
+ \DeclareUnicodeCharacter{0463}{\cyryat}
+ \DeclareTextSymbolDefault{\cyryat}{X2}
+ %% serbian letter, looks as a ligature IE, not defined anywhare
+ %\DeclareUnicodeCharacter{0464}{\CYRESHRT} % no surch cmd in X2
+ %% serbian letter, looks as a ligature ie, not defined anywhare
+ %\DeclareUnicodeCharacter{0465}{\cyreshrt} % no surch cmd in X2
+ %% therefor, we substitute it with є (#0454, \cyrie)
+ \DeclareUnicodeCharacter{0464}{\CYRIE}%
+ %\DeclareTextSymbolDefault{\CYRIE}{X2}
+ \DeclareUnicodeCharacter{0465}{\cyrie}%
+ %\DeclareTextSymbolDefault{\cyrie}{X2}
+\fi
+\usepackage[russian.ancient,main=english]{babel}
+%\languageattribute{russian}{ancient}
+\usepackage[dvipsnames,usenames]{xcolor}
+ \definecolor{thered} {rgb}{0.65,0.04,0.07}
+ \definecolor{thegreen}{rgb}{0.06,0.44,0.08}
+ \definecolor{thegrey} {gray}{0.8}
+ \definecolor{theshade}{rgb}{1,1,0.97}
+ \definecolor{theframe}{gray}{0.6}
+ \definecolor{theblue}{cmyk}{1.00, 0.50, 0.00, 0.40}
+%\usepackage[numbered]{hypdoc}
+\usepackage[colorlinks=true
+ ,linkcolor=violet %theblue %
+ ,filecolor=purple %thegreen%
+ ,citecolor=teal %thegreen%
+]{hyperref}
+% ====================================
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\xetex{\textsf{xetex}}
+\newcommand*\luatex{\textsf{luatex}}
+\providecommand*\m[1]{\mbox{$\langle$\normalfont\itshape#1\/$\rangle$}}
+\newcommand*\langlist{%
+ \meta{language}\texttt{,}\meta{language}\texttt{,}...}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\menv[1]{\char`\{#1\char`\}}
+\newcommand*\Eenv[1]{%
+ \quad\ldots\quad
+ \texttt{\color{thered}\string\end\menv{#1}}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+% ====================================
+\IfFileExists{listings.sty}{
+ \usepackage{listings}
+ \lstset{
+ gobble=1,
+ columns=flexible,
+ keepspaces,
+ basicstyle=\MacroFont,
+ keywords=[0]{\selectlanguage,\foreignlanguage
+ ,\babelhyphen,\babelhyphenation
+ ,\lefthyphenmin,\righthyphenmin
+ ,\StartBabelCommands,\SetString,\EndBabelCommands,\shorthandoff,\shorthandon
+ ,\languageshorthands,\useshorthands,\defineshorthand
+ ,\AddBabelHook,\SetStringLoop,\SetCase,\AfterBabelLanguage
+ ,\defaultfontfeatures,\setmainfont,\setsansfont,\setmonofont
+ ,\Russian,\cyrdash,\cdash
+ ,\cyr,\cyrillictext,\textcyrillic,\cyrillicencoding
+ ,\addto,\captionsrussian,\daterussian,\noextrasrussian,\extrasrussian
+ ,\languageattribute
+ ,\glqq,\grqq,\guillemotleft,\guillemotright
+ ,\Asbuk,\asbuk,\ch,\sh,\tg,\ctg,\arctg,\arcctg\,\th,\cth,\cosec
+ ,\nod3,\nok,\prog,\NOF\,\NOK,\Prog
+ ,\dq,\Proj,\nod,\NOD,\nok,\NOK,\Prob,\Variance
+ ,\XeTeXinputencoding
+ }
+ ,keywordstyle=[0]\color{thered}
+ ,keywords=[1]{main,russian,english,german,frenchb
+ ,shorthands,extrasenglish
+ ,stringprocess,afterextras
+ ,soft,empty,nobreak,hard
+ ,Renderer,Ligatures
+ ,modern,ancient
+ ,T1,T2A,lutf8,utf8
+ ,fontspec,babel,inputenc,fontenc
+ },
+ keywordstyle=[1]\color{thegreen},
+ comment=[l]\%,
+ commentstyle=\color{thegrey}\itshape,
+ alsoother={0123456789_},
+ frame=single,
+ backgroundcolor=\color{theshade},
+ rulecolor=\color{theframe},
+ framerule=\fboxrule,
+ }
+ \let\verbatim\relax
+ \lstnewenvironment{verbatim}[1][]{\lstset{##1}}{}
+ \AtBeginDocument{%
+ \DeleteShortVerb{\|}%
+ \lstMakeShortInline|%
+ }
+}{}
+\def\PrintDescribeMacro#1{%
+ \strut\MacroFont\color{thered}\normalsize\string#1}
+\def\Describe#1{%
+ \par\penalty-500\vskip3ex\noindent
+ \DescribeMacro{#1}\args}
+\def\DescribeOther{\vskip-5.8ex\Describe}
+\makeatletter
+\def\args#1{%
+ \def\bbl@tempa{#1}%
+ \ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
+\makeatother
+% ====================================
+\EnableCrossrefs
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\CodelineIndex % Index code by line number
+\RecordChanges % Gather update information
+%\PageIndex % Index code by page number
+% ====================================
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \DoNotIndex{\cyra,\cyrb,\cyrv,\cyrg,\cyrd,\cyre}
+% \DoNotIndex{\CYRP,\cyrii,\cyrr,\cyre,\cyro,\CYRU,\cyrk,\cyrl,\CYRS,\cyrs|}
+% \DoNotIndex{\cyrt,\cyri,\cyrz,\CYRT,\cyrm}
+% \DoNotIndex{\cyr,\cyrc,\CYRD,\cyrery,\cyrh,\CYRK,\CYRM,\CYRN,\cyrn}
+% \DoNotIndex{\cyrp,\cyrs,\cyrshch,\cyru,\CYRV,\cyrya}
+% \DoNotIndex{\CYRA,\CYRB,\cyrch,\CYRE,\CYREREV,\CYRF,\cyrf,\CYRI,\cyrishrt}
+% \DoNotIndex{\CYRO,\CYRR,\cyrsftsn,\CYRYA,\cyryu,\cyrzh}
+% \DoNotIndex{\CYRCH, \CYRG, \CYRL, \CYRZH}
+% \DoNotIndex{\z@skip,\z@}
+% \DoNotIndex{\|,\~,\ ,\,}
+%
+
+%\GetFileInfo{russianb.dtx}
+%\GetFileInfo{russianb.ldf}
+%
+% \title{The Russian Language\\
+% in the \babel\ system\\[0.5em]
+% \large Version \fileversion}
+%
+% \author{Igor A. Kotelnikov\footnote{E-mail: \href{mailto:kia999@mail.ru}{kia999 at mail dot ru}.}}
+%
+% \date{Released \filedate}
+%
+% \maketitle
+%
+% {\small\tableofcontents}
+%
+%
+% \section{The Russian Language Definition File}
+%
+% The file \file{\filename}\footnote{The file described in this document
+% has the version number \fileversion\ and was last revised on \filedate.}
+% is the source file for the Russian Language Definition file
+% \file{russianb.ldf} to be loaded by the \babel\ package with
+% the option \Lopt{russian}. It was derived by Igor A.
+% Kotelnikov from the original version of \file{\filename}, first
+% released by Olga Lapko and Johannes Braams and then
+% adapted to the T2* and X2 Cyrillic encodings
+% by Vladimir Volovich and Werner Lemberg.
+%
+% Starting the version 1.2, \file{russianb.ldf} is designed to work both with
+% legacy non-unicode (8-bit) and new Unicode encodings of the source document
+% files (input encodings) and of the font files (font encodings). This is
+% achieved by excluding (bypassing) the |\cyr...| macros, which map every letter
+% in a source file with given input encoding to a corresponding code point in a
+% font file with a given font encoding when running modern engines, such as
+% Lua\LaTeX\ or Xe\LaTeX, in native Unicode mode instead of legacy engines, such
+% as \LaTeX\ or PDF\LaTeX, or Unicode engines in a compatibility (8-bit) mode. A
+% few obsolete and controversial macros has been eliminated in first public
+% release of version 1.2 of \file{russianb.ldf}.
+%
+% The version 1.3 of \file{russianb.ldf} has been adapted to new features
+% introduced in the version 3.9 of the \pkg{babel} package. In particular, the
+% language attribute \Lopt{ancient} has been introduced to support typesetting
+% ancient and Church Slavonic books.
+%
+% \section{Usage}
+%
+% Typesetting Russian texts implies that a special input and output
+% encodings should be used. Input encodings are those which are used in source
+% (\file{.tex}) file. Output encoding is also known as the font encoding. It is
+% implemented within the font files.
+%
+% Generally, the user may choose between different Cyrillic
+% encodings. The current support for Cyrillic uses LH family of MetaFont fonts
+% and theirs Postscript versions such as CM-super. Lua\LaTeX\ and Xe\LaTeX,
+% being the Unicode-based succeeders of \LaTeX, allow also for any Open Type
+% (OTF) and True Type (TTF) fonts which have Cyrillic script, e.g. Computer
+% Modern Unicode, Linux Libertine, and many other system fonts that came with
+% Linux, Mac and Windows operating systems.
+%
+% With the advent of Unicode, \LaTeX\ community are moving towards eliminating
+% all existing encodings in favor of Unicode, but nowadays one should take
+% care when switching from \LaTeX\ to Lua\LaTeX\ or Xe\LaTeX\ since
+% different packages should be loaded for those compilers.
+%
+% Since earlier versions \pkg{babel} did not
+% support Xe\LaTeX\ (at least for some languages including Russian), the
+% \pkg{polyglossia} package was generally recommended in the past for
+% use with Xe\LaTeX\ as a replacement for \pkg{babel}. Nowadays, \pkg{babel}
+% can be used with any engines, including \LaTeX, PDF\LaTeX, Lua\LaTeX, and
+% Xe\LaTeX. Nevertheless some troubles may occur with some languages which
+% have no promptly updated \file{.ldf} files.
+%
+%
+% \subsection{\LaTeX}
+%
+% When user's document is compiled with \file{latex.exe} or \file{pdflatex.exe},
+% recommended set of packages includes the \pkg{inputenc} and \pkg{fontenc}
+% packages. They should be loaded before \pkg{babel}, for example,
+% \begin{verbatim}
+% \usepackage[T1,T2A]{fontenc}
+% \usepackage[utf8]{inputenc}
+% \usepackage[english,russian]{babel}
+%\end{verbatim}
+% Some variations in the order of loading the packages are allowed in this case
+% but it is better to follow one and the same convention at all circumstances:
+% the \pkg{babel} package should go last, and \pkg{fontenc} must be the first.
+%
+% Input encoding should be declared as option to the \pkg{inputenc}
+% package. Known Cyrillic encodings include \texttt{cp866} (MS DOS),
+% \texttt{cp1251} (Windows), \texttt{koi8-u} (UNIX) and their variants.
+% Nowadays, this list is appended with \texttt{utf8} input encoding.
+%
+% Output encodings (also known as font encodings) are declared as options to
+% the \pkg{fontenc} package. Known Cyrillic encodings are \texttt{T2A},
+% \texttt{T2B}, \texttt{T2C}, \texttt{LCY}, and \texttt{X2};
+% \texttt{LWN} is excluded from Russian support starting version 1.2 of
+% \file{\filename} since \texttt{LWN} is excluded from the \pkg{cyrillic}
+% bundle of related files.
+%
+%
+% \subsection{Lua\LaTeX}
+%
+% If Unicode fonts are not available, Lua\LaTeX\ can run in compatibility
+% (8-bit) mode to use same font as \LaTeX\ does. However the package
+% \pkg{inputenc} does not work with Lua\LaTeX\ and should be substituted with
+% \pkg{luainputenc}. Source file is to be converted to \texttt{UTF8}
+% (Unicode-8) encoding; it is the only input encoding accepted by
+% Lua\LaTeX. The 8-bit mode is invoked by the following sequence of packages:
+%\begin{verbatim}
+%\usepackage[T1,T2A]{fontenc}
+%\usepackage[lutf8]{luainputenc}
+%\usepackage[english,russian]{babel}
+%\end{verbatim}
+% The order of the packages is crucial for Lua\LaTeX\ in 8-bit mode. Since both
+% \pkg{luainputenc} and \pkg{babel} should know what font encoding is selected,
+% the \pkg{fontenc} package should be loaded first. Legacy input encoding
+% management for Lua\TeX\ is needed only for compatibility with old documents.
+% For new documents, using UTF-8 encoding and Unicode fonts is strongly
+% recommended. \emph{You've been warned!} See
+% \href{http://tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}%
+% {tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}.
+%
+%
+% To invoke Unicode mode, one needs to load the \pkg{fontspec} package instead
+% of \pkg{luainputenc} and \pkg{fontenc} and explicitly indicate which True Type
+% or Open Type fonts should be used for romanic, sans-serif and monospaced types.
+% The following example shows how to load Computer Modern Unicode (CMU) fonts,
+% which is a part of all modern \LaTeX\ distributions:
+%\begin{verbatim}
+%\usepackage{fontspec}
+% \defaultfontfeatures{Renderer=Basic,Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+%\usepackage[english,russian]{babel}
+%\end{verbatim}
+% The |\defaultfontfeatures| declares default font features for subsequent
+% |\setmainfont| (which sets romanic fonts), |\setsansfont| (sans-serif) and
+% |\setmonofont| (monospaced font). Font features can be set up on per font
+% bases; for example
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \setmainfont[Renderer=Basic,Ligatures={TeX}]{CMU Serif}
+% \setsansfont[Renderer=Basic,Ligatures={TeX,Historic}]{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,russian]{babel}
+%\end{verbatim}
+% Here |Renderer=Basic,Ligatures={TeX}| activates ligatures available in \LaTeX.
+%
+% Recall that the language enlisted last in the list of options of the \pkg{babel}
+% package is assumed to be the main language of the document, which is also active
+% language right after |\begin{document}|. As of version 3.9, the main language
+% can be set as a value of the |main| option as follows
+%\begin{verbatim}
+% \usepackage{fontspec}
+% \usepackage[english,main=russian,german]{babel}
+%\end{verbatim}
+% %\unskip
+%
+%
+%
+% \subsection{Xe\LaTeX}
+%
+% In Xe\LaTeX, there is also a special mode for 8-bit compatibility.
+% One can use |\XeTeXinputencoding| to change the input encoding
+% temporarily, and the \texttt{"bytes"} encoding makes Xe\LaTeX\ to work
+% like a 8-bit \LaTeX\ engine:
+% \begin{verbatim}
+% \XeTeXinputencoding "bytes"
+% \usepackage[utf8]{inputenc}
+% \usepackage[T2A]{fontenc}
+% \usepackage[english,russian]{babel}
+%\end{verbatim}
+% \unskip
+% Xe\TeX\ can use a different input encoding but it always uses the Unicode
+% internally, so that |\XeTeXinputencoding| performs a conversion of the input
+% stream into Unicode;
+% see \href{http://tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}
+% {tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}.
+%
+%
+% Unicode mode is set up same way as for Lua\LaTeX, however the option
+% |Renderer=Basic| can be dropped:
+%\begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,russian]{babel}
+%\end{verbatim}
+% %\unskip
+%
+%
+% \subsection{Modern and Ancient spelling}
+% \label{ssec:speeling}
+%
+% By default, a modern spelling is enabled. For Church Slavonic and other old books
+% ancient spelling can be enabled by setting the attribute to \Lopt{ancient}. To set
+% an attribute, put the |\languageattribute| macro within a document preamble after
+% \babel, for example,
+%\begin{verbatim}
+% \usepackage[english,russian]{babel}
+% \languageattribute{russian}{ancient}
+%\end{verbatim}
+% Setting the \Lopt{ancient} attribute changes the built-in strings (caption names)
+% and a date format. For example, the bibliography will be entitled as
+% `\textcyrillic{Литература}' by default and as `\textcyrillic{Библіографія}' if the
+% Russian language attribute is set to \Lopt{ancient}.
+% Same result can be achieved using a modifier as follows:
+%\begin{verbatim}
+%\usepackage[english,russian.ancient]{babel}
+%\end{verbatim}
+% Using a modifier in a package option is often better. A modifier is set after
+% the language name, and is prefixed with a dot (only when the language is set
+% as package option – neither global options nor the main key accept them).
+%
+%
+%\section{User's commands}
+%
+% In a multilingual document, some typographic rules are language
+% dependent and should apply to the whole document.
+%
+%^^AAs of version~1.2, \file{russianb.ldf} behaves differently
+%^^Aaccording to \babel's \emph{main language} defined as the \emph{last}
+%^^Aoption. When Russian is
+%^^A|babel|'s main language, it adjusts global layout of the document
+%^^Aaccording to typographical conventions of Russian language. Namely,
+%^^A\file{russianb.ldf} makes the following changes to global layout even
+%^^Ain the parts where Russian is not current language:
+%^^A\begin{enumerate}
+%^^A\item
+%^^A the first paragraph of any section becomes indented (\LaTeX{} only).
+%^^A (this is obsolete statement starting from version 1.2a)
+%^^A\end{enumerate}
+%
+% Regarding local typography, the macro |\selectlanguage{russian}|
+% switches to the Russian language, with the following effects:
+% \begin{enumerate}
+% \item Russian hyphenation patterns are made active;
+% \item |\today| prints the date in Russian;
+% \item the caption names are translated into Russian;
+% \item emdash typed by the ligature |---| might be 20\% shorter when Russian
+% is the current language; the result depends on the current encoding; |---|
+% always produce long emdash in Lua\TeX\ and Xe\TeX\ since these engines
+% use same encodings for all languages;
+% \item emdash typed by the ligature |"---| in Russian is 20\% shorter, however
+% the ligature |"---| might not be defined in other languges; a
+% shorter emdash (i.e. |\cyrdash|) can be typeset in any language using
+% special macros enlisted in table \ref{tab:russian-quote}.
+% \end{enumerate}
+%
+% By default, a modern spelling is used for built-it strings (caption names) and
+% the date. The spelling can be reverted to ancient by setting the language
+% attribute to \Lopt{ancient} in the document preamble as discussed in
+% Sec.~\ref{ssec:speeling}.
+%
+% Since Russian has its own numbering system, \file{russianb.ldf} adds macros
+% |\asbuk|\marg{counter} and |\Asbuk|\marg{counter} for formatting numbers appropriately the alphabetic
+% sequence in the Russian alphabet. Additional commands are provided
+% to typeset quotes:
+% \begin{enumerate}
+% \item French quotation marks can be entered using the commands
+% |\guillemotleft| and |\guillemotright| which work in \LaTeXe\
+% and Plain\TeX.
+% \item German quotation marks can be entered using the commands
+% |\glqq| and |\grqq| which work in \LaTeXe\ and Plain\TeX.
+% \end{enumerate}
+%
+% The macro |\Russian| is now defined as an alias for
+% |\selectlanguage{russian}|, and its ``opponent'' |\English|, existed
+% in \file{russianb.ldf} prior to version 1.2 has been removed since the Russian
+% language definition file is wrong place for definition of macros which
+% switch to a distinct other language.
+%
+% The macro |\textcyrillic|\marg{text} is intended to typeset small chunks of text
+% in Russian; it is essentially an alias for |\foreignlanguage{russian}|\marg{text}.
+%
+%
+% \subsection{Active character}
+%
+% Table~\ref{tab:russian-quote} shows macros and active string which can be
+% used to typeset various dashes and quotes.
+% In the Russian language, the character |"| is made active. It can be
+% considered as second escape character in addition to |\|. Some dashes and
+% all quotes can be typed using both active character |"| and ordinary
+% macros as indicated in the table. However, some shorthanded hyphenations
+% have no macro counterpart.
+%
+% \begin{table}[ht]\centering
+% \caption{Extra definitions made
+% by \file{russianb.ldf}}\label{tab:russian-quote}
+% \medskip
+% \begin{tabular}{llp{7cm}}
+% \hline\hline\\[-0.5em]
+% |\glqq| & |"`| &
+% German opening double quote (looks like ,\kern-0.08em,). \\
+% |\grqq| & |"'| &
+% German closing double quote (looks like ``). \\
+% |\guillemotleft| & |"<| &
+% French opening double quote (looks like $<\!\!<$). \\
+% |\guillemotright| & |">| &
+% French closing double quote (looks like $>\!\!>$). \\
+% |\dq| & &
+% Original quotes character (|"|). \\[0.5em]
+% |\babelhyphen{soft}|
+% & |"-| & Optional (soft) hyphen sign, similar to |\-| but allows
+% hyphenation in the rest of the word;
+% equivalent to |\babelhyphen{soft}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{empty}|
+% & |""| & Similar to |"-| but prints no hyphen sign
+% (used for compound words with hyphen, e.g. |x-""y|);
+% equivalent to |\babelhyphen{empty}| in \pkg{babel} 3.9. \\
+% |\babelhyphen*{nobreak}|
+% & |"~| & Compound word mark without a breakpoint, prints hyphen
+% prohibiting hyphenation at the point;
+% equivalent to |\babelhyphen*{nobreak}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{hard}|
+% & |"=| & A compound word mark with a breakpoint, prints hyphen
+% allowing hyphenation in the composing words.
+% equivalent to |\babelhyphen{hard}| in \pkg{babel} 3.9. \\
+% |\babelhyphen{nobreak}|
+% & \verb="|= & Disables ligature at this position;
+% equivalent to |\babelhyphen{nobreak}| (??) in \pkg{babel} 3.9.
+% \\[0.5em]
+% |\cyrdash| & & Row Cyrillic emdash (does not care
+% spaces around). \\
+% |\cdash---| & |"---| &
+% Cyrillic emdash in plain text. \\
+% |\cdash--~| & |"--~| &
+% Cyrillic emdash in compound names
+% (as in |Mendeleev"--~Klapeiron|). \\
+% |\cdash--*| & |"--*| &
+% Cyrillic emdash for denoting direct speech. \\
+% & |",| & Thin space
+% (allows further hyphenation as in |D.",Mendeleev|). \\[0.5em]
+% \hline\hline
+% \end{tabular}
+% \end{table}
+% Note that the standard soft hyphen |\-| is equivalent to |\babelhyphen*{soft}|.
+%
+% \medskip
+%
+% The quotation marks traditionally used in Russian were borrowed from
+% other languages (e.g., French and German) so they keep their original
+% names.
+%
+% The French quotes are also available as ligatures `|<<|' and `|>>|' in
+% 8-bit Cyrillic font encodings (\texttt{LCY}, \texttt{X2}, \texttt{T2*})
+% and in Unicode encoding (\texttt{TU}) as `|<|' and `|>|' characters in 7-bit
+% Cyrillic font encodings (\texttt{OT2} and \texttt{LWN}).
+%
+% In Unicode encoding \texttt{TU} cyrdashes and quotes
+% can be typed as single character if your text editor allows
+% inserting characters which absent of standard keyboard. This method works
+% as well for 8-bit fonts encoded according to \texttt{T2A} if source file
+% is encoded with \texttt{cp1251} or {utf8}.
+%
+% By default, active double quote is switched on. It can be switched off
+% any time using |\shorthandoff{"}| and the switched on again using
+% |\shorthandon{"}|. The aliases |\mdqoff| and |\mdqon| for these two macros
+% has been removed from \file{russianb.ldf} starting from version 1.3 in favour of
+% the macros |\shorthandon| and |\shorthandoff| provided in the \pkg{babel} core.
+%
+%
+% \subsection{Math commands}
+%
+% \file{\filename} defines few macros than can be used independently
+% of current language. These are 9 macros to be used in math mode to type
+% the names of trigonometric functions common for Russian documents:
+% |\sh|, |\ch|, |\tg|, |\ctg|, |\arctg|, |\arcctg|, |\th|, |\cth|, and
+% |\cosec|. Cyrillic letters in math mode can be typed with the aid of
+% text commands such as |\textbf|, |\textsf|, |\textit|, |\texttt|, e.t.c.
+%
+% The macros |\Prob|, |\Variance|, |\NOD|, |\nod|, |\NOK|, |\nok|, |\Proj|
+% print some rare Russian mathematical symbols.
+%
+%
+% \section{\TeX{}nical details}
+%
+% The packages \pkg{inputenc} and \pkg{luainputenc}
+% make Cyrillic letters active so that a compiler converts them into
+% corresponding |\cyr...| macro at compilation time.
+% For example, Russian letter `a' matches
+% macro |\cyra|, and capital Russian letter `A' matches |\CYRA|. The
+% package \pkg{fontenc} then matches every macro |\cyr...| to corresponding
+% glyph in a font file depending on a declared font encoding.
+%
+% Nowadays, Unicode makes |\cyr...| macros outdated since both source
+% file and font file are encoded consistently. These macros
+% should therefore be removed because mixing them with Unicode characters
+% breaks sorting mechanism of such utilities as \file{bibtex} and
+% \file{makeindex}. For the sake of backward compatibility, |\cyr...| are
+% still kept for \LaTeX, but they are bypassed if Lua\LaTeX\ or Xe\LaTeX\
+% are detected.
+%
+% Some inconsistences of prior versions of \file{\filename} was also
+% overcame in the version 1.2. Those users who used |\selectlanguage| macro,
+% defined in the core \pkg{babel} system, to switch between
+% different languages should not worry. However, the macros
+% |\Russian|, |\Englsih| and their aliases |\Rus|, |\cyr|,
+% |\Eng| are modified or removed as they did not
+% conform the mechanism of language switching encoded into the
+% core of \pkg{babel} and therefore can mess it.
+%
+%
+% \section{Known problems}
+%
+% Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+% engine (xetex, luatex) and vise versa delete all |.aux|, |.toc|, |.lot|,
+% |.lof| files as they might have stored incompatible internal encodings.
+%
+% T2* font encodings do not have old Slavonic letter `yat' (Ѣ, ѣ), which is
+% hard-coded in ancient caption names. Be sure to use an Unicode engine
+% or borrow |\cyryat| and |\CYRYAT| commands from X2 font encoding when setting
+% the language attribute to ``ancient'', for example:
+%
+%\begin{verbatim}
+%\usepackage[X2,T2A]{fontenc}
+%\usepackage[utf8]{inputenc}
+%\DeclareUnicodeCharacter{0462}{\CYRYAT}
+%\DeclareTextSymbolDefault{\CYRYAT}{X2}
+%\DeclareUnicodeCharacter{0463}{\cyryat}
+%\DeclareTextSymbolDefault{\cyryat}{X2}
+%\usepackage[english,russian.ancient]{babel}
+%\end{verbatim}
+%
+% None of Cyrillic font encoding has `iotated E' (Ѥ, ѥ). When running legacy
+% engines you are advised to substitute it with |\CYRIE|, |\cyrie| (Є, є):
+%
+%\begin{verbatim}
+%\DeclareUnicodeCharacter{0464}{\CYRIE}
+%\DeclareUnicodeCharacter{0465}{\cyrie}
+%\end{verbatim}
+%
+% The dash might change its length after switching the current language
+% with |\selectlanguage|. Legacy engines (\texttt{latex.exe},
+% \texttt{pdflatex.exe}) take the dash symbol (---) from same code
+% point 22 of a font file but from different fonts for Cyrillic and Latin
+% languages. Cyrillic fonts take care that Cyrillic dash is 20\% shorter than
+% Latin one. Unicode engines (\texttt{xelatex.exe}, \texttt{lualatex.exe})
+% take the dash from the code point x2022, but may substitute the font dash
+% with fake symbol which is shorter. See discussion at
+% \href{https://tex.stackexchange.com/questions/294178/what-about-cyrdash-in-eu1-and-eu2-encodings}
+% {https://tex.stackexchange.com/questions/294178/what-about-cyrdash-in-eu1-and-eu2-encodings}.
+%
+%
+% \StopEventually{
+% \IndexPrologue{\section{Index}
+% Numbers written in dark blue refer to the page where the corresponding
+% entry is described; numbers in black roman refer to the code lines where
+% the entry is used.
+% }
+% \GlossaryPrologue{\section{Change History}}
+% \PrintChanges
+% \PrintIndex
+% }
+%
+%\iffalse
+%<*code>
+%\fi
+%
+%
+% \section{Implementation}
+%
+% \changes{1.3h}{2016/02/18}{\cs{cyrdash} is redefined}
+% \changes{1.3h}{2016/02/18}{Bugs fixed in captions for revtex4 and revtex4-1}
+% \changes{1.3g}{2015/05/01}{Added support for revtex4 and revtex4-1 classes}
+% \changes{1.3f}{2014/10/21}{Update documentation for generating by pdflatex.exe}
+% \changes{1.3e}{2014/10/14}{Update documentation}
+% \changes{1.3d}{2014/10/02}{Fix bug in \cs{Proj}}
+% \changes{1.3c}{2014/06/02}{Fix bug in \cs{daterussian}}
+% \changes{1.3b}{2013/04/06}{Renamed to russianb to work with babel 3.9}
+% \changes{1.2b}{2013/01/08}{Renamed to russianu to work with babel-beta 3.9}
+% \changes{1.2a}{2012/06/06}{Indentation of 1st paragraph removed}
+% \changes{1.1c}{1996/07/11}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{1.1d}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+% \changes{1.1k}{1999/08/19}{replaced all \cs{penalty}\cs{@M}
+% with \cs{nobreak}}
+% \changes{1.1f}{1998/06/26}{%
+% Added definitions of Cyrillic emdash stuff and thinspace}
+% \changes{1.1f}{1998/06/26}{%
+% Added definitions of Cyrillic emdash stuff and thinspace}
+%
+%
+% \subsection{Initial setup}
+%
+% The macro |\LdfInit| performs a couple of standard checks that
+% must be made at the beginning of a language definition file,
+% such as checking the category code of the \texttt{@}-sign, preventing
+% the \file{.ldf} file from being processed twice, etc.
+%
+% \changes{1.1d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{1.1e}{1996/12/29}{Added closing brace to second
+% argument of \cs{LdfInit}}
+% \begin{macrocode}
+\ProvidesLanguage{russian}
+ [2017/08/12 1.3j Russian support for the Babel system]
+\LdfInit{russian}{captionsrussian}
+% \end{macrocode}
+%
+% First, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If so, we set
+% boolean key |\if@uni@ode| to true. It will be used to eliminate |\cyr...|
+% commands, which were introduced in \LaTeX2e\ to handle various
+% Cyrillic input encoding. With the advent of Unicode \LaTeX\ is
+% moving to universal input encoding, so we consider these |\cyr...|
+% commands as obsolete. They are preserved though for backward
+% compatibility in case if \LaTeX\ or PDF\LaTeX\ are running.
+%
+% We don't load the \pkg{ifluatex} or \pkg{ifxetex} package because
+% |\RequirePackage| is not allowed at the stage of processing options
+% (note that babel loads this file right when it processes its own options)
+% but we borrow code from these packages.
+%
+% \changes{1.2}{2011/10/20}{Check for LuaTeX}
+% \begin{macrocode}
+\ifdefined\if@uni@ode
+ \PackageError{babel}{if@uni@ode already defined.\MessageBreak
+ Please contact author of russianb.ldf}
+ \relax
+\fi
+\newif\if@uni@ode
+\ifdefined\luatexversion \@uni@odetrue \else
+\ifdefined\XeTeXrevision \@uni@odetrue \fi\fi
+% \end{macrocode}
+%
+% Check if hyphenation patterns for the Russian language have been
+% loaded in \file{language.dat}. Namely, we check for the existence of
+% |\l@russian|. If it is not defined, we declare Russian as dialect
+% for the default language number 0 which almost for sure is English.
+%
+% \begin{macrocode}
+\ifx\l@russian\@undefined
+ \@nopatterns{Russian}
+ \adddialect\l@russian0
+\fi
+% \end{macrocode}
+% Now |\l@russian| is always defined.
+%
+% \subsection{Output encoding}
+%
+% We need to know font encoding that is supposed to be
+% active at the end of the \babel\ package. Default font encoding, set by
+% \LaTeX\ core, is \texttt{OT1}. This can be changed by the \pkg{fontenc}
+% package in case of \LaTeX\ and by \pkg{fontspec} package in case of
+% Lua\LaTeX. It matters weather these packages are loaded before of after
+% \pkg{babel}. In the latter case or if these packages are not loaded at all,
+% \file{russianb.ldf} ignores their effect and tries to provide some
+% reasonable settings. In particular, \texttt{T2A} will be selected for
+% Russian language if \LaTeX\ is running but \texttt{TU} in case of
+% Xe\LaTeX\ or Lua\LaTeX.
+%
+% \begin{macro}{\latinencoding}
+% \changes{1.2}{2011/10/20}{Removed \cs{latinencoding}}
+%
+% The macro |\latinencoding| keeps the name of Latin encoding. It is
+% defined in \file{babel.def} and is wrapped into |\AtBeginDocument| to allow
+% for late loading \pkg{fontenc}. Therefore it does not matter
+% whether \pkg{babel} is loaded before or after the \pkg{fontenc}.
+% As of version 1.2, definition of |\latinencoding| was removed from
+% \file{russianb.ldf} since it is overruled in \file{babel.def}.
+% For example, after
+%\begin{verbatim}
+%\usepackage[T1,T2A]{fontenc}
+%\usepackage[english,russian]{babel}
+%\end{verbatim}%
+% as well as after
+%\begin{verbatim}
+%\usepackage[english,russian]{babel}
+%\usepackage[T1,T2A]{fontenc}
+%\end{verbatim}%
+% |\latinencoding| will be set to \texttt{T1}.
+% After
+%\begin{verbatim}
+%\usepackage[english,russian]{babel}
+%\end{verbatim}%
+% |\latinencoding| will be \texttt{OT1}.
+%
+% In Unicode mode, the package \pkg{fontspec} should be loaded instead of
+% \pkg{fontenc} to make font preparation; \pkg{fontspec} sets current encoding
+% (kept in |\cf@encoding|) to \texttt{TU}, and the \pkg{babel} package sets the
+% macro |\latinencoding| to |\cf@encoding|. Since \pkg{babel} scan for value
+% |\cf@encoding| within |\AtBeginDocument|, |\latinencoding| will
+% be set to \texttt{TU} for Xe\LaTeX\ or Lua\LaTeX\ no matter which of the
+% packages, \pkg{babel} or \pkg{fontspec} is loaded first.
+%
+% \end{macro}
+%
+% \Describe\cyrillicencoding{}
+% There is a limited list of encodings appropriate for Cyrillic text. We
+% will look which of them is declared and keep its name in the macro
+% |\cyrillicencoding|.
+% Correct (but obsolete and now deleted) 7-bit Cyrillic encoding is
+% \texttt{LWN}.
+% Correct 8-bit Cyrillic encodings are
+% \texttt{T2A} (default for 8-bit compilers), \texttt{T2B}, \texttt{T2C},
+% \texttt{LCY} and \texttt{X2}.
+% Correct utf8 encodings are
+% \texttt{TU} (default for Xe\LaTeX\ and Lua\LaTeX),
+% \texttt{EU1} (obsolete, formerly used for Xe\LaTeX),
+% \texttt{EU2} (obsolete, formerly used for Lua\LaTeX).
+%
+% In 8-bit (\LaTeX) mode, user may choose between different non-unicode Cyrillic
+% encodings---e.g., \texttt{X2} or \texttt{LCY}.\@ If user wants
+% to use another font encoding rather than default (\texttt{T2A}),
+% he has to load the corresponding file \emph{before} \file{babel.sty}.
+%
+% Remember that for the Russian language, the \texttt{T2A} encoding is
+% better than \texttt{X2}, because \texttt{X2} does not contain Latin
+% letters, and users should be very careful to switch the language
+% every time they want to typeset a Latin word inside a Russian phrase
+% or vice versa.
+%
+% We parse the |\cdp@list| containing encodings known to \LaTeX\
+% in the order they have been loaded by the time \pkg{babel} is called.
+% We set the |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2}, \texttt{LCY},
+% \texttt{X2}, \texttt{T2C}, \texttt{T2B}, \texttt{T2A}. In Unicode mode,
+% |\cyrillicencoding| is set to \texttt{TU} by \pkg{fontspec}. Nevertheless
+% here we provide similar definitions; 8-bit encodings are kept for Unicode
+% compilers (Lua\LaTeX\ and Xe\LaTeX) since they can run in compatibility
+% (8-bit) mode.
+%
+% \changes{1.2}{2011/10/20}{EU1 and EU2 encodings added}
+% \changes{1.3j}{2017/08/07}{TU encoding added}
+% \begin{macrocode}
+\def\@setcyrillicencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\cyrillicencoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{OT2}%
+ \sce@a{##1}{LCY}%
+ \sce@a{##1}{X2}%
+ \sce@a{##1}{T2C}%
+ \sce@a{##1}{T2B}%
+ \sce@a{##1}{T2A}%
+ \if@uni@ode
+ %\sce@a{##1}{EU1}%
+ %\sce@a{##1}{EU2}%
+ \sce@a{##1}{TU}%
+ \fi}%
+ \cdp@list
+}
+\ifx\cyrillicencoding\undefined
+ \@setcyrillicencoding
+\fi
+\@onlypreamble\@setcyrillicencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+% \end{macrocode}
+% The last lines are to free the memory occupied by the macros
+% |\@setcyrillicencoding| and |\sce@x| that are useless in the document.
+% The contents of |\@begindocumenthook| is cleared automatically.
+%
+% If |\cyrillicencoding| is still undefined, we issue warning and provide
+% reasonable default value for |\cyrillicencoding|. We then load default
+% encoding definitions; we use the lowercase names (i.e.,
+% \texttt{lcyenc.def} instead of \texttt{LCYenc.def}) when we do that.
+%
+% \changes{1.2}{2011/10/20}{Removed test for present of
+% encoding files}
+% \begin{macrocode}
+\ifx\cyrillicencoding\undefined
+ \if@uni@ode
+ %\ifdefined\XeTeXrevision
+ % \edef\cyrillicencoding{EU1}
+ %\else\ifdefined\luatexversion
+ % \edef\cyrillicencoding{EU2}
+ %\fi\fi
+ \edef\cyrillicencoding{TU}
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{babel}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+% \end{macrocode}
+% As a final wisdom, we repeat |\@setcyrillicencoding| at |\begin{document}|
+% time. We could not avoid previous call to |\@setcyrillicencoding| since
+% compiler scan \file{.aux} file before it executes delayed code, and
+% \file{.aux} may contain |\set@langauge{russian}|; the latter rises an
+% error if |\cyrillicencoding| would not be defined by that time.
+% \begin{macrocode}
+ \AtBeginDocument{\@setcyrillicencoding}
+\fi
+% \end{macrocode}
+%
+% \Describe\Russian{}
+% For the sake of backward compatibility we keep the macro |\Russian|
+% but redefine its meaning; now |\Russian| is simply an alias for
+% |\selectlanguage{russian}|.
+% \begin{macrocode}
+\DeclareRobustCommand{\Russian}{\selectlanguage{\russian}}
+% \end{macrocode}
+%
+% \Describe\cyrillictext{}
+% \DescribeOther\cyr{}
+% We define |\cyrillictext| and its alias |\cyr| but remove another alias
+% |\Rus|; these macros are intended for use within \texttt{babel} macros and
+% do not perform complete switch of the language.
+%
+% In particular, they to do no switch captions and the name of current
+% language stored in the macro |\languagename|. This inconsistency might
+% break some assumptions embedded into \pkg{babel}'s.
+% For example, the |\iflanguage| macro will fail.
+%
+% Second, |\cyrillictext| does
+% not activate shorthands, so that |"<|, |">|, |"`|, |"'|,
+% |"---|, e.t.c. will not work.
+%
+% And third, |\cyrillictext| does not write its trace
+% to \file{.aux} file, which might result in wrong typesetting of
+% table of content, list of table and list of figures in multilingual
+% documents.
+%
+% Due to any of these reasons the use of the declaration |\cyrillictext| and
+% its aliases in ordinary text is strongly discouraged. Instead of the
+% declaration |\cyrillictext| it is recommended to use |\Russian| or the
+% command |\foreignlanguage| defined in the \pkg{babel} core; their
+% functionality is similar to |\selectlanguage{russian}| but they did not
+% switch caption names, dates and shorthands.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\cyrillictext}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\russianhyphenmins
+ \language\l@russian}%
+\let\cyr\cyrillictext
+% \end{macrocode}
+%
+% Since version v.1.2, the |\English| macro and its alias |\Eng| were removed
+% as a reasonable place for defining these macros would be \file{englishb.ldf}.
+% Note also that these macros are absent from \file{russianb.ldf}'s counterpart
+% of the package \pkg{polyglossia}, analog of \pkg{babel} for Xe\LaTeX.
+%
+% \changes{1.2}{2011/10/20}{Removed \cs{English} and \cs{Eng} macros}
+% \begin{macrocode}
+%%\DeclareRobustCommand{\English}{%
+%% \fontencoding\latinencoding\selectfont
+%% \let\encodingdefault\latinencoding
+%% \expandafter\set@hyphenmins\englishhyphenmins
+%% \language\l@english}%
+%%\let\Eng\English
+% \end{macrocode}
+% The macro |\cyrillictext| switches current (e.g., Latin) font encoding
+% to a Cyrillic font encoding stored in |\cyrillicencoding|. The macro
+% |\latintext| switches back. This method assumes that main font
+% encoding is a Latin one. But, in fact, the latter assumption does not matter
+% if any other language is switched on using same method, i.e.
+% if corresponding \file{.ldf} file defines required macros to switch that
+% language on from same standard (Latin) state.
+% Since |\latintext| is defined by the core of babel we do not repeat its
+% definition here.
+%
+% \changes{1.1o}{2003/10/12}{\cs{latintext} is already
+% defined by the core of babel}
+% \changes{1.2}{2011/10/20}{\cs{lat} removed}
+% \begin{macrocode}
+%%\DeclareRobustCommand{\latintext}{%
+%% \fontencoding{\latinencoding}\selectfont
+%% \def\encodingdefault{\latinencoding}}
+%%\let\lat\latintext
+% \end{macrocode}
+%
+% \Describe\textcyrillic{\marg{text}}
+% The macro |\textcyrillic| takes an argument which is then typeset using the
+% |\cyrillictext| declaration.
+% \changes{1.1o}{2003/10/12}{\cs{textlatin} already defined
+% by the core of babel}
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \end{macrocode}
+%
+%
+% \textsc{Next chunk of code should be moved to \texttt{X2enc.def},
+% \texttt{X2enc.dfu}, if needed.}
+%
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters. Unfortunately, the commands |\AA| and |\aa| are not
+% encoding dependent in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are defined
+% as |\r{A}| and |\r{a}|. This leads to unpredictable results when the font
+% encoding does not contain the Latin letters `A' and `a' (like \texttt{X2}).
+% \begin{macrocode}
+%%\expandafter\ifx\csname T@X2\endcsname\relax\else
+%% \DeclareTextSymbolDefault{\AA}{OT1}
+%% \DeclareTextSymbolDefault{\aa}{OT1}
+%% \DeclareTextCommand{\aa}{OT1}{\r a}
+%% \DeclareTextCommand{\AA}{OT1}{\r A}
+%%\fi
+% \end{macrocode}
+%
+%
+% \subsection{Input encoding}
+%
+% We do not assume any default input encoding of the source file,
+% so the \pkg{inputenc} package should be explicitly loaded by
+% |\usepackage[...]{inputenc}| \emph{before} \pkg{babel}.
+% Note that default font encoding \texttt{T2A} for legacy 8-bit latex
+% engines fits well enough to Russian version of Windows ANSI encoding which
+% is almost equivalent to \texttt{cp1251} input encoding.
+%
+% \textsc{Should we wrap this chunk into AtBeginDocument? Note also that
+% \pkg{inputenc} has its own check whether it is correctly called. Also,
+% it is difficult to imagine that TU encoding is not declared in case of
+% unicode engines. Hence, we remove this check in babel starting since
+% version 1.3j.}
+%
+% \changes{1.1l}{1999/08/27}{Made not using inputenc a
+% warning instead of an error}
+% \changes{1.2}{2011/10/11}{Added EU1 and EU2 encodings}
+% \changes{1.2}{2011/10/11}{Removed LWN encoding}
+% \changes{1.3j}{2017/08/08}{Removed check if inputenc is loaded}
+% \begin{macrocode}
+%%\@ifpackageloaded{inputenc}{%
+%%% \if@uni@ode
+%%% \PackageWarning{babel}{inputenc should not be used with LuaTeX or XeTeX}
+%%% \fi
+%% \ifdefined\luatexversion
+%% \PackageWarning{babel}{inputenc should not be used with LuaTeX}
+%% \fi}{%
+%% %\def\reserved@a{LWN}%
+%% %\ifx\reserved@a\cyrillicencoding\else
+%% \def\reserved@a{OT2}%
+%% \ifx\reserved@a\cyrillicencoding\else
+%% \def\reserved@a{TU}%
+%% \ifx\reserved@a\cyrillicencoding\else
+%% \PackageWarning{babel}%
+%% {No input encoding specified for Russian language}
+%% \fi\fi
+%% %\fi
+%%}
+% \end{macrocode}
+%
+%
+% \subsection{Shorthands}
+%
+% The double quote character \texttt{"} is declared to be active in
+% Russian language.
+%
+% \changes{1.1a}{1995/03/07}{Use the new mechanism for dealing
+% with active characters}
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% \changes{1.1f}{1998/06/26}{Added switch for
+% doublequote shorthands}
+% \changes{1.3}{2013/01/10}{Removed switch for
+% doublequote shorthands}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% Obsolete: Active double quote can be both activated and deactivated at any time
+% using the macros |\mdqon| and |\mdqoff|.
+% \begin{macrocode}
+%%\def\mdqon{\bbl@activate{"}}
+%%\def\mdqoff{\bbl@deactivate{"}}
+% \end{macrocode}
+% Initial activation state is set in section \ref{sss:extra}.
+% \end{macro}
+% \end{macro}
+%
+% \Describe\dq{}
+% The active character |"| is used as indicated in
+% table~\ref{tab:russian-quote}. We save the original double quote
+% character in the |\dq| macro to keep it available.
+% The math accent |\"| can now be typed as `|"|'.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \subsubsection{Quotes}
+%
+% We set |"`| and |"'| as shorthands for |\quotedblbase| and
+% |\textquotedblleft|, respectively. Prior to ver.1.2, these shorthands
+% were defined through German quotes |\glqq| and |\grqq|, which in their turn
+% are defined in \pkg{babel.def} via |\quotedblbase| and |\textquotedblleft|,
+% respectively. It occurred, that old definition caused errors in Unicode
+% mode if \pkg{fontspec} is loaded.
+%
+% Prior to version 1.2, the shorthands |"<| and |">| had been
+% declared to be equivalents for the French quotes |\flqq| and |\frqq|,
+% respectively. They are defined in \pkg{babel.def} via |\guillemotleft| and
+% |\guillemotright|. However, |\flqq| and |\guillemotleft| (and their right
+% counterparts) are typeset differently if current encoding is not
+% \texttt{T1}. Therefore, since v.1.2, we define |"<| and |">| directly
+% through |\guillemotleft| and |\guillemotright|.
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{"`}{\quotedblbase}
+\declare@shorthand{russian}{"'}{\textquotedblleft}
+\declare@shorthand{russian}{"<}{\guillemotleft}
+\declare@shorthand{russian}{">}{\guillemotright}
+% \end{macrocode}
+%
+% Next set of shorthands is intended for variations of standard macro |\-|
+% which indicates explicitly breakpoint for hyphenation in a word. Meaning
+% of these shorthands is explained in table~\ref{tab:russian-quote}.
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{""}{\hskip\z@skip}
+\declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{russian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+% \end{macrocode}
+%
+% \subsubsection{Emdash, endash and hyphenation sign}
+%
+% To distinguish between |"-| and |"---| we must check whether the next token
+% after |-| is a hyphen character.
+% If it is, we output an emdash, otherwise a hyphen sign. Therefor
+% \TeX\ looks for the next token after the first `|-|', writes
+% its meaning to |\russian@sh@next| and finally call for |\russian@sh@tmp|.
+% \begin{macrocode}
+\declare@shorthand{russian}{"-}{%
+ \def\russian@sh@tmp{%
+ \if\russian@sh@next-\expandafter\russian@sh@emdash
+ \else\expandafter\russian@sh@hyphen\fi}%
+ \futurelet\russian@sh@next\russian@sh@tmp}
+% \end{macrocode}
+% Two macros |\russian@sh@hyphen| and |\russian@sh@emdash| called by
+% |\russian@sh@tmp| are defined below. The second of
+% them has two parameters since it must gobble next two hyphen signs.
+% \begin{macrocode}
+\def\russian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+\def\russian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \Describe\cdash{}
+% In its turn, |\russian@sh@emdash| simply calls for |\cdash| which has
+% rich use. It analyses 3rd of 3 characters and calls for one of few
+% predefined macros |\@Acdash|, |\@Bcdash|, |\@Ccdash|.
+% \begin{macrocode}
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+% \end{macrocode}
+%
+% All these 3 internal macros call for |\cyrdash|, which type Cyrillic
+% emdash, but put different spaces around the dash.
+%
+% |\@Acdash| is invoked by |"---|. It types Cyrillic emdash to be used
+% inside a text and puts an unbreakable thin space before the dash if a
+% \textit{space} is placed before |"---| in the source file;
+% can be used after display maths formulae, formatted lists, enumerations, etc.
+% \begin{macrocode}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Bcdash| is invoked by |"--~|. It types Cyrillic emdash in compound
+% names (like Mendeleev--Klapeiron); requires no space characters around and
+% adds extra space after the dash.
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Ccdash| is invoked by |"--*|. It denotes direct speech and adds small
+% space after the dash.
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+% \end{macrocode}
+%
+% \changes{1.1f}{1998/06/26}{%
+% Add macro for thin space between initials}
+%
+% Finally, we define a shorthand thin space to be placed between initials
+% as in |D.",Mendeleev|. When used instead of |\,| as in |D.\,Mendeleev|
+% it allows hyphenation in the next word.
+%
+% \begin{macrocode}
+\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+%
+% \Describe\cyrdash{}
+% The |\cyrdash| macro is defined in Cyrillic font encodings (LCY, T2*, OT2,
+% and |X2|) by means of |\DeclareTextSymbol|. In T2* encodings |\cyrdash|
+% refers to same code point 22 as |\textemdash| does so that these two macros
+% are equivalent. However the dash at the code point 22 have different length
+% in different fonts. The dash in Cyrillic fonts LH is 20\% shorter as
+% compared to Latin fonts such as CM (Computer Modern). As a result, the dash
+% typed by the ligature |---| or its variations mentioned in Table
+% \ref{tab:russian-quote} might change its length after |\selectlanguage|.
+%
+% The |\cyrdash| macro is not available in Latin encodings such as T1. Therefor
+% an explicit or implicit call for |\cyrdash| when current language is English
+% causes an error. For such a case, we provide a fake default. A standard check
+% such as |\ifx\cyrdash\undefined ...\fi| fails to detect absent definitions
+% for Latin encodings since the |\cyrdash| macro is in fact defined. Therefor
+% we use the |\ProvideTextCommandDefault| method:
+% \changes{1.3j}{2017/08/08}{Default for \cs{cyrdash} is provided}
+% \begin{macrocode}
+\PackageInfo{babel}{Default for \string\cyrdash\space is provided}
+%%\ProvideTextCommandDefault{\cyrdash}{\iflanguage{russian}%
+%% {\hbox to.8em{--\hss--}}{\textemdash}}
+\ProvideTextCommandDefault{\cyrdash}{\hbox to.8em{--\hss--}}
+% \end{macrocode}%
+%
+% The |\cyrdash| macro is not defined in the Unicode encoding TU. The fake
+% definition given above cope with this case.
+%
+%
+% \subsection{Switching to/from Russian}
+%
+% Now we define additional macros used to reset current language to
+% Russian and back
+% to some original state. The package \pkg{babel} based on the assumption
+% that original state is characterized by a Latin encoding. Previously,
+% for back reset the macro |\OriginalTeX| was used, but now use |\latintext|
+% for the same purpose.
+%
+%
+% \subsubsection{Caption names}
+%
+% First, we define Russian equivalents for Russian caption names.
+%
+% \Describe\captionsrussian{}
+% The macro |\captionsrussian| defines caption names used in the
+% four standard document classes provided with \LaTeX. The macro |\cyr|
+% activates Cyrillic encoding. It could be dropped if we would be sure
+% that Russian captions are called only if current language is Russian.
+% However, the macros such as |\Russian| do not conform to strict rules
+% of the package \pkg{babel} as explained in the above.
+%
+% As of version v.1.2 we eliminate |\cyr...| macros from caption names
+% if Unicode engine is running. In the latter case, Cyrillic letters are typed
+% in by their Unicode code-points, the |^^^^abcd| notation is not used
+% since it causes error at compilation time in case if \LaTeX\ is running
+% and \texttt{utf8} input encoding is not declared.
+%
+% \changes{1.2}{2011/10/20}{Unicode code-points added for LuaLaTeX}
+% \begin{macrocode}
+\if@uni@ode
+ %\captionsrussian@modern
+ \addto\captionsrussian{%
+ \def\prefacename{Предисловие}% [babel]
+ \def\refname{Список литературы}% [only article]
+ \def\abstractname{Аннотация}% [only article, report]
+ \def\bibname{Литература}% [only book, report]
+ \def\chaptername{Глава}% [only book, report]
+ \def\appendixname{Приложение}%
+% \end{macrocode}
+% Note that two names for the Table of Contents can be used in Russian
+% publications. For books (and reports) the second variant is
+% appropriate, but for proceedings the first variant is preferred:
+% \begin{macrocode}
+ \@ifundefined{thechapter}
+ {\def\contentsname{Содержание}}%
+ {\def\contentsname{Оглавление}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Список иллюстраций}%
+ \def\listtablename{Список таблиц}%
+ \def\indexname{Предметный указатель}%
+ \def\authorname{Именной указатель}%
+ \def\figurename{Рис.}%
+ \def\tablename{Таблица}%
+ \def\partname{Часть}%
+ \def\enclname{вкл.}%
+ \def\ccname{исх.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}% [letter]
+ \def\seename{см.}%
+ \def\alsoname{см.\ также}%
+ \def\proofname{Доказательство}% [amsthm]
+ \def\glossaryname{Словарь терминов}%
+ \def\acronymname{Аббревиатуры}% [glossaries] {Acronyms}
+ \def\lstlistingname{Листинг}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{Листинги}% [listings] (the "List of") {Listings}
+ \def\notesname{Заметки}% [endnotes] {Notes}
+ }%
+% \end{macrocode}
+% Additional definitions for the package \pkg{nomencl}:
+% \begin{macrocode}
+ %% =========================================
+ %% nomencl
+ \ifdefined\nomname
+ \addto\captionsrussian{%
+ \def\nomname{Обозначения}%
+ \def\eqdeclaration#1{, см.\nobreakspace(#1)}%
+ \def\pagedeclaration#1{, стр.\nobreakspace#1}%
+ }%
+ \fi
+% \end{macrocode}
+% Additional captions for the \cls{revtex} class.
+% \begin{macrocode}
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %%\@ifclassloaded{revtex4-1}
+ %%{<true code>}
+ %%{<false coode>}%
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рисунки}%{Figures}%
+ \def\tablesname{Таблицы}%{Tables}%
+ \def\appendixesname{Приложения}%{Appendixes}%
+ \def\acknowledgmentsname{Благодарности}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключевые слова: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Получено }%{Received }%
+ \def\Revised@name{Исправленная версия }%{Revised }%
+ \def\Accepted@name{Принято }%{Accepted }%
+ \def\Published@name{Опубликовано }%{Published }%
+ }%
+ %}{}%
+ \fi
+% \end{macrocode}
+%
+% \changes{1.3h}{2016/02/18}{Revtex captions fixed}
+% Now we proceed to the ancient version in Unicode encoding.
+% \begin{macrocode}
+ \addto\captionsrussian@ancient{%
+ \def\prefacename{Предисловіе}%
+ \def\refname{Примѣчанія}%
+ \def\abstractname{Аннотація}%
+ \def\bibname{Библіографія}%
+ \def\chaptername{Глава}%
+ \def\appendixname{Приложеніе}%
+ \@ifundefined{thechapter}
+ {\def\contentsname{Содержаніе}}%
+ {\def\contentsname{Оглавленіе}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Списокъ иллюстрацій}%
+ \def\listtablename{Списокъ таблицъ}%
+ \def\indexname{Предмѣтный указатель}%
+ \def\authorname{Именной указатель}%
+ \def\figurename{Рис.}%
+ \def\tablename{Таблица}%
+ \def\partname{Часть}%
+ \def\enclname{вкл.}%
+ \def\ccname{исх.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}%
+ \def\seename{см.}%
+ \def\alsoname{см.~также}%
+ \def\proofname{Доказательство}%
+ \def\glossaryname{Словарь терминов}%
+ \def\acronymname{Аббревиатуры}%
+ \def\lstlistingname{Листинг}%
+ \def\lstlistlistingname{Листинги}%
+ %\ifdefined\nomname
+ % see http://old_russian.academic.ru/8433/%D0%BE%D0%B1%D1%8A%CB%AB%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D1%A5
+ \def\nomname{Обозначенія}%{Объавлениѥ}% <-- #0465
+ %\fi
+ \def\notesname{Заметки}%
+ }
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian@ancient{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рисунки}%{Figures}%
+ \def\tablesname{Таблицы}%{Tables}%
+ \def\appendixesname{Приложения}%{Appendixes}%
+ \def\acknowledgmentsname{Благодарности}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключевые слова: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Получено }%{Received }%
+ \def\Revised@name{Исправленная версия }%{Revised }%
+ \def\Accepted@name{Принято }%{Accepted }%
+ \def\Published@name{Опубликовано }%{Published }%
+ }%
+ %}{}%
+ \fi
+ %% =========================================
+\else
+ %\def\captionsrussian@modern{%
+ \addto\captionsrussian{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyri\cyre}}%
+ \def\refname{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\
+ \cyrl\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyrery}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya}}%
+ \def\bibname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+ \@ifundefined{thechapter}%
+ {\def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}}%
+ {\def\contentsname{%
+ {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyri\cyre}}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyri\cyrishrt}}%
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc}}%
+ \def\indexname{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyre\cyrt\cyrn\cyrery\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%
+ \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
+ \def\headtoname{{\cyr\cyrv\cyrh.}}%
+ \def\pagename{{\cyr\cyrs.}}%
+ \def\seename{{\cyr\cyrs\cyrm.}}%
+ \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
+ \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyra\cyrr\cyrsftsn\
+ \cyrt\cyre\cyrr\cyrm\cyri\cyrn\cyro\cyrv}}%
+ \def\acronymname{\CYRA\cyrb\cyrb\cyrr\cyre\cyrv\cyri\cyra\cyrt\cyru\cyrr\cyrery}%
+ \def\lstlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg}%
+ \def\lstlistlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg\cyri}%
+ \def\nomname{\CYRO\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri\cyrya}%
+ \def\notesname{\CYRZ\cyra\cyrm\cyre\cyrt\cyrk\cyri}%
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyri\cyrs\cyru\cyrn\cyrk\cyri}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRB\cyrl\cyra\cyrg\cyro\cyrd\cyra\cyrr\cyrn\cyro\cyrs\cyrt\cyri}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyre\cyrv\cyrery\cyre \cyrs\cyrl\cyro\cyrv\cyra: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRP\cyro\cyrl\cyru\cyrch\cyre\cyrn\cyro }%{Received }%
+ \def\Revised@name{\CYRI\cyrs\cyrp\cyrr\cyra\cyrv\cyrl\cyre\cyrn\cyrn\cyra\cyrya \cyrv\cyre\cyrr\cyrs\cyri\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyri\cyrn\cyrya\cyrt\cyro }%{Accepted }%
+ \def\Published@name{\CYRO\cyrp\cyru\cyrb\cyrl\cyri\cyrk\cyro\cyrv\cyra\cyrn\cyro }%{Published }%
+ }%
+ \fi
+ %% =========================================
+ \addto\captionsrussian@ancient{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyrii\cyre}}%
+ \def\refname{%
+ {\cyr\CYRP\cyrr\cyri\cyrm\cyryat\cyrch\cyra\cyrn\cyrii\cyrya}}% <-- Примѣчанія, нет \cyryat в кодировке T2*
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyrii\cyrya}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyrii\cyro\cyrg\cyrr\cyra\cyrf\cyrii\cyrya}}% <-- Библіографія
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyrii\cyre}}%
+ \@ifundefined{thechapter}%
+ {\def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyrii\cyre}}}%
+ {\def\contentsname{%
+ {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyrii\cyre}}}%
+ \let\tocname=\contentsname
+ % Списокъ иллюстрацій
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\cyrhrdsn\
+ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrii\cyrishrt}}
+ % Списокъ таблицъ
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\cyrhrdsn\
+ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyrhrdsn}}%
+ % Предмѣтный указатель, ѣ (\cyryat) in X2 encoding only
+ \def\indexname{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyryat\cyrt\cyrn\cyrery\cyrishrt\space
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%
+ \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
+ \def\headtoname{{\cyr\cyrv\cyrh.}}%
+ \def\pagename{{\cyr\cyrs.}}%
+ \def\seename{{\cyr\cyrs\cyrm.}}%
+ \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
+ \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyra\cyrr\cyrsftsn\
+ \cyrt\cyre\cyrr\cyrm\cyri\cyrn\cyro\cyrv}}% <-- Needs translation
+ \def\acronymname{\CYRA\cyrb\cyrb\cyrr\cyre\cyrv\cyri\cyra\cyrt\cyru\cyrr\cyrery}%
+ \def\lstlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg}%
+ \def\lstlistlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg\cyri}%
+ \def\nomname{\CYRO\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrii\cyrya}%
+ \def\notesname{\CYRZ\cyra\cyrm\cyre\cyrt\cyrk\cyri}%
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian@ancient{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyri\cyrs\cyru\cyrn\cyrk\cyri}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRB\cyrl\cyra\cyrg\cyro\cyrd\cyra\cyrr\cyrn\cyro\cyrs\cyrt\cyri}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyre\cyrv\cyrery\cyre \cyrs\cyrl\cyro\cyrv\cyra: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRP\cyro\cyrl\cyru\cyrch\cyre\cyrn\cyro }%{Received }%
+ \def\Revised@name{\CYRI\cyrs\cyrp\cyrr\cyra\cyrv\cyrl\cyre\cyrn\cyrn\cyra\cyrya \cyrv\cyre\cyrr\cyrs\cyri\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyri\cyrn\cyrya\cyrt\cyro }%{Accepted }%
+ \def\Published@name{\CYRO\cyrp\cyru\cyrb\cyrl\cyri\cyrk\cyro\cyrv\cyra\cyrn\cyro }%{Published }%
+ }%
+ \fi
+ %% =========================================
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Date in Russian}
+%
+% \Describe\daterussian{}
+% The macro |\daterussian| is used to reset the macro |\today| in Russian.
+%
+% \changes{1.2}{2011/10/20}{Unicode code-points added for LuaLaTeX}
+% \begin{macrocode}
+\if@uni@ode
+ \addto\daterussian{%
+ \def\today{\number\day~\ifcase\month\or
+ января\or
+ февраля\or
+ марта\or
+ апреля\or
+ мая\or
+ июня\or
+ июля\or
+ августа\or
+ сентября\or
+ октября\or
+ ноября\or
+ декабря\fi
+ \space \number\year~г.}}
+ \def\daterussian@ancient{%
+ \def\today{\number\day~\ifcase\month\or%
+ января\or
+ февраля\or
+ марта\or
+ апреля\or
+ мая\or
+ іюня\or
+ іюля\or
+ августа\or
+ сентября\or
+ октября\or
+ ноября\or
+ декабря\fi%
+ \space \number\year~г.}}
+\else
+ \def\daterussian{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
+ \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
+ \cyrm\cyra\cyrr\cyrt\cyra\or
+ \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
+ \cyrm\cyra\cyrya\or
+ \cyri\cyryu\cyrn\cyrya\or
+ \cyri\cyryu\cyrl\cyrya\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
+ \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
+ \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
+ \space \number\year~\cyrg.}}
+ \def\daterussian@ancient{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
+ \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
+ \cyrm\cyra\cyrr\cyrt\cyra\or
+ \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
+ \cyrm\cyra\cyrya\or
+ \cyrii\cyryu\cyrn\cyrya\or
+ \cyrii\cyryu\cyrl\cyrya\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
+ \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
+ \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
+ \space \number\year~\cyrg.}}
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Hyphenation patterns}
+%
+% Russian hyphenation patterns are automatically activated every time
+% Russian language is selected via |\selectlanguage|, |\foreignlanguage|
+% or equivalent command. But we need to declare values of
+% |\lefthyphenmin| and |\righthyphenmin|; both are set to~2.
+%
+% As of v.1.2 we removed a definition for |\englishhyphenmins|. It is
+% not deal of \file{russianb.ldf}.
+%
+% \changes{1.1a}{1995/07/04}{use \cs{russianhyphenmins} to
+% store the correct values}
+% \changes{1.1m}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \changes{1.2}{2011/10/20}{\cs{englishhyphenmins} is removed}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{russian}{\tw@\tw@}
+% \end{macrocode}
+%
+% \subsubsection{Extra definitions}
+% \label{sss:extra}
+%
+% \Describe\extrasrussian{}
+% \DescribeOther\noextrasrussian{}
+% The macro |\extrasrussian| performs extra definitions in addition to
+% resetting the caption names and date.
+% The macro |\noextrasrussian| is used to cancel the actions of
+% |\extrasrussian|.
+%
+% \changes{1.1b}{1996/02/20}{Added switch to \texttt{LWN}
+% encoding}
+%
+% First, we instruct \pkg{babel} to switch font encoding using earlier
+% defined macros |\cyrillictext| and |\latintext|.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\cyrillictext}
+\addto\noextrasrussian{\latintext}
+% \end{macrocode}
+%
+% Second, we specify that the Russian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\languageshorthands{russian}}
+\addto\extrasrussian{\bbl@activate{"}}
+\addto\noextrasrussian{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% Now the action |\extrasrussian| has to execute is to make sure that the
+% command |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasrussian| will switch it off again.
+%
+% \begin{macrocode}
+\addto\extrasrussian{\bbl@frenchspacing}
+\addto\noextrasrussian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+%
+% \subsection{Alphabetic counters}
+%
+% Do we need to reset |\@alph| and |\@Alph|? They are used in the
+% \LaTeX\ core to define the macros |\alph| and |\Alph|, respectively, which
+% type a counter with a corresponding letter of Latin alphabet.
+% We just want to make sure that correct |\latinencoding| is used instead of
+% |\latinencoding| to typeset the counter. Starting from v.1.2 we do not
+% reset these macros since all Cyrillic encoding but \texttt{X2} do have
+% Latin letters. When using the \texttt{X2} encoding user must himself
+% take care about selecting correct encoding when he switches his keyboard.
+% Our decision is motivated as follows. If selected Cyrillic font is visually
+% different from Latin font, the macro |\@alph| and |\@Alph| will produce
+% visually different output from surrounding text if they are used with
+% Russian text, which is completely legitimate.
+%
+% Notice for commented code:\\
+% We put |\latinencoding| in braces to avoid problems with
+% |\@alph| inside minipages (e.g., footnotes inside minipages) where
+% |\@alph| is expanded and we get for example `|\fontencoding OT1|'
+% (|\fontencoding| is robust).
+%
+% Note added on 2013/03/22: |{\fontencoding{\latinencoding}\selectfont|
+% rises an error with recent version of \pkg{microtype} package after the
+% |\appendix| declaration (which resets |\thechapter| to |\@Alph\c@chapter}|).
+% Most languages do not reset |\@alph| and |\@Alph| macros and only
+% \pkg{ukrainian} and \pkg{bulgarian} add |\fontencoding| to |\@alph| and
+% |\@Alph|.
+%
+% Since v.1.3 we do not reset |\@alph| and |\@Alph| here.
+% Resetting |\fontencoding| in |\@alph| and |\@Alph| causes an error
+% if the package |smartref| is loaded and a |\sref| occurs after the
+% |\appendix| declaration which resets |\thechapter| to |\@Alph\c@chapter|.
+% \changes{1.3}{2013/03/22}{Removed \cs{@alph} and \cs{@Alph}}
+%
+% \begin{macrocode}
+%\def\@alph#1{{\fontencoding{\latinencoding}\selectfont
+% \ifcase#1\or
+% a\or b\or c\or d\or e\or f\or g\or h\or
+% i\or j\or k\or l\or m\or n\or o\or p\or
+% q\or r\or s\or t\or u\or v\or w\or x\or
+% y\or z\else\@ctrerr\fi}}%
+%\def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
+% \ifcase#1\or
+% A\or B\or C\or D\or E\or F\or G\or H\or
+% I\or J\or K\or L\or M\or N\or O\or P\or
+% Q\or R\or S\or T\or U\or V\or W\or X\or
+% Y\or Z\else\@ctrerr\fi}}%
+% \end{macrocode}
+%
+% We add new enumeration style for Russian manuscripts with
+% Cyrillic letters.
+%
+% \Describe\Asbuk{}
+% We begin by defining |\Asbuk| which works like |\Alph|, but produces
+% (uppercase) Cyrillic letters instead of Latin ones. The letters YO,
+% ISHRT, HRDSN, ERY, and SFTSN are skipped, as usual for such
+% enumeration.
+%
+% \begin{macrocode}
+\def\Asbuk#1{\expandafter\russian@Alph\csname c@#1\endcsname}
+\if@uni@ode
+ \def\russian@Alph#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or
+ З\or И\or К\or Л\or М\or Н\or О\or
+ П\or Р\or С\or Т\or У\or Ф\or Х\or
+ Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\@ctrerr\fi}
+\else
+ \def\russian@Alph#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or
+ \CYRZ\or\CYRI\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or
+ \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or
+ \CYRC\or\CYRCH\or\CYRSH\or\CYRSHCH\or\CYREREV\or\CYRYU\or
+ \CYRYA\else\@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% \Describe\asbuk{}
+% The macro |\asbuk| is similar to |\alph|; it produces lowercase
+% Russian letters.
+%
+% \begin{macrocode}
+\def\asbuk#1{\expandafter\russian@alph\csname c@#1\endcsname}
+\if@uni@ode
+ \def\russian@alph#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or е\or ж\or
+ з\or и\or к\or л\or м\or н\or о\or
+ п\or р\or с\or т\or у\or ф\or х\or
+ ц\or ч\or ш\or щ\or э\or ю\or я\else\@ctrerr\fi}
+\else
+ \def\russian@alph#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or
+ \cyrz\or\cyri\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or
+ \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or
+ \cyrc\or\cyrch\or\cyrsh\or\cyrshch\or\cyrerev\or\cyryu\or
+ \cyrya\else\@ctrerr\fi}
+\fi
+% \end{macrocode}
+%
+% Babel 3.9 has introduced a notion of a language attribute.
+% An \Lopt{ancient} attribute changes default behavior, which
+% uses modern Russian spelling, an activates an alternative set of
+% captions and date macros suitable for typesetting ancient
+% Slavonic and Church books.
+% \begin{macrocode}
+\bbl@declare@ttribute{russian}{ancient}{%
+ \PackageInfo{babel}{Russian attribute set to ancient}%
+ \let\captionsrussian=\captionsrussian@ancient
+ \let\daterussian=\daterussian@ancient
+}
+% \end{macrocode}
+% We don't want for long internal macros to waste memory. So we declare
+% them to be usable within the preamble only.
+% \begin{macrocode}
+\@onlypreamble\captionsrussian@ancient
+\@onlypreamble\daterussian@ancient
+% \end{macrocode}
+%
+% \subsection{Cyrillic math}
+%
+% For compatibility with older Russian packages we could define the |\No|
+% macro. However the Russian number sign is now superseded with |\textnumero|.
+% Moreover, it can be found on the keyboard. Therefore we discard |\No|
+% since v.1.2.
+% \begin{macrocode}
+%\DeclareRobustCommand{\No}{%
+% \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+%
+% As of version 1.2 the macros |\cyrmath..| are not supported any more. They
+% requires package \pkg{textmath} which is not available now. Instead of
+% |\cyrmath..| it is advised to use corresponding |\text..| commands; they
+% do work in math mode.
+% \begin{macrocode}
+%\RequirePackage{textmath}
+% \@ifundefined{sym\cyrillicencoding letters}{}{%
+% \SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
+% \rmdefault\bfdefault\updefault
+% \DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}
+% \end{macrocode}
+% And we need few commands to switch to different variants.
+% \begin{macrocode}
+%\DeclareMathAlphabet\cyrmathbf\cyrillicencoding
+% \rmdefault\bfdefault\updefault
+%\DeclareMathAlphabet\cyrmathsf\cyrillicencoding
+% \sfdefault\mddefault\updefault
+%\DeclareMathAlphabet\cyrmathit\cyrillicencoding
+% \rmdefault\mddefault\itdefault
+%\DeclareMathAlphabet\cyrmathtt\cyrillicencoding
+% \ttdefault\mddefault\updefault
+%
+%\SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
+% \sfdefault\bfdefault\updefault
+%\SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
+% \rmdefault\bfdefault\itdefault
+%}
+% \end{macrocode}
+%
+% \Describe\sh{}
+% \DescribeOther\ch{}%
+% \DescribeOther\tg{}%
+% \DescribeOther\ctg{}%
+% \DescribeOther\arctg{}%
+% \DescribeOther\arcctg{}%
+% \DescribeOther\th{}%
+% \DescribeOther\cth{}%
+% \DescribeOther\cosec{}%
+% We also define few math operator names according to Russian typesetting
+% traditions. Some math functions in Russian math books have names
+% different from English writings. For example, \texttt{sinh} in
+% Russian is called \texttt{sh}. Special consideration needs the
+% macro |\th| that conflicts with the text symbol |\th|
+% defined in Latin~1 encoding:
+%
+% \changes{1.2}{2004/05/21}{Change definition of \cs{th}
+% only for this language}
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% \Describe\Prob{}%
+% \DescribeOther\Variance{}%
+% \DescribeOther\nod{}%
+% \DescribeOther\nok{}%
+% \DescribeOther\NOD{}%
+% \DescribeOther\NOK{}%
+% \DescribeOther\Proj{}%
+% Finally, we define some rare Russian mathematical symbols:
+% \changes{1.3i}{2017/01/04}{\cs{NOD} and similar log-functions fixed}
+% \begin{macrocode}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\if@uni@ode
+ \def\nod{\mathop{\mathrm{н.о.д.}}\nolimits}
+ \def\nok{\mathop{\mathrm{н.о.к.}}\nolimits}
+ \def\NOD{\mathop{\mathrm{НОД}}\nolimits}
+ \def\NOK{\mathop{\mathrm{НОК}}\nolimits}
+ \def\Proj{\mathop{\mathrm{Пр}}\nolimits}
+\else
+% \def\nod{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrd.}}\nolimits}
+% \def\nok{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrk.}}\nolimits}
+% \def\NOD{\mathop{\cyrmathrm{\CYRN\CYRO\CYRD}}\nolimits}
+% \def\NOK{\mathop{\cyrmathrm{\CYRN\CYRO\CYRK}}\nolimits}
+% \def\Proj{\mathop{\cyrmathrm{\CYRP\cyrr}}\nolimits}
+ \def\nod{\mathop{\textnormal{\cyrn.\cyro.\cyrd.}}\nolimits}
+ \def\nok{\mathop{\textnormal{\cyrn.\cyro.\cyrk.}}\nolimits}
+ \def\NOD{\mathop{\textnormal{\CYRN\CYRO\CYRD}}\nolimits}
+ \def\NOK{\mathop{\textnormal{\CYRN\CYRO\CYRK}}\nolimits}
+ \def\Proj{\mathop{\textnormal{\CYRP\cyrr}}\nolimits}
+\fi
+% \end{macrocode}
+%
+% \subsection{Final settings}
+%
+% The macro |\ldf@finish| does work needed
+% at the end of each \file{.ldf} file. This
+% includes resetting the category code of the \texttt{@}-sign,
+% loading a local configuration file, and preparing the language
+% to be activated at |\begin{document}| time.
+%
+% \changes{1.1d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{russian}
+% \end{macrocode}
+%\iffalse
+%</code>
+%\fi
+%\CheckSum{2327}
+%\Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+%\endinput
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
diff --git a/macros/latex/contrib/babel-contrib/russian/russianb.ins b/macros/latex/contrib/babel-contrib/russian/russianb.ins
new file mode 100644
index 0000000000..1d77461d26
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/russian/russianb.ins
@@ -0,0 +1,166 @@
+%%
+%% This is file `russianb.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% russianb.dtx (with options: `install')
+%% ----------------------------------------------------------------
+%% Russian Language Support for the Babel package
+%% E-mail: kia999@mail.ru
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+Russian Language Support for the Babel package
+E-mail: kia999@mail.ru
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+\endpreamble
+\postamble
+----------------------------------------------------------------
+Copyright 2011-2017 Igor A. Kotelnikov.
+Copyright 1995-2008 Olga Lapko.
+Copyright 1989-2012 Johannes L. Braams.
+
+This file is a part of the Russian-Babel package.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+The package is "maintained" (as per LPPL maintenance status) by
+Igor A. Kotelnikov.
+
+The package consists of the file russianb.dtx
+and the derived files russianb.ins,
+ russianb.ldf,
+ russianb.pdf,
+ README.
+----------------------------------------------------------------
+\endpostamble
+\usedir{tex/generic/babel/contrib}
+\generate{
+ \file{\jobname.ldf}{\from{\jobname.dtx}{code}}
+}
+\endbatchfile
+
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
+%% ----------------------------------------------------------------
+%% Copyright 2011-2017 Igor A. Kotelnikov.
+%% Copyright 1995-2008 Olga Lapko.
+%% Copyright 1989-2012 Johannes L. Braams.
+%%
+%% This file is a part of the Russian-Babel package.
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License (LPPL), either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% The package is "maintained" (as per LPPL maintenance status) by
+%% Igor A. Kotelnikov.
+%%
+%% The package consists of the file russianb.dtx
+%% and the derived files russianb.ins,
+%% russianb.ldf,
+%% russianb.pdf,
+%% README.
+%% ----------------------------------------------------------------
+%%
+%% End of file `russianb.ins'.
diff --git a/macros/latex/contrib/babel-contrib/russian/russianb.ldf b/macros/latex/contrib/babel-contrib/russian/russianb.ldf
new file mode 100644
index 0000000000..8c64872334
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/russian/russianb.ldf
@@ -0,0 +1,684 @@
+%%
+%% This is file `russianb.ldf',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% russianb.dtx (with options: `code')
+%% ----------------------------------------------------------------
+%% Russian Language Support for the Babel package
+%% E-mail: kia999@mail.ru
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+\NeedsTeXFormat{LaTeX2e}
+
+\ProvidesLanguage{russian}
+ [2017/08/12 1.3j Russian support for the Babel system]
+\LdfInit{russian}{captionsrussian}
+\ifdefined\if@uni@ode
+ \PackageError{babel}{if@uni@ode already defined.\MessageBreak
+ Please contact author of russianb.ldf}
+ \relax
+\fi
+\newif\if@uni@ode
+\ifdefined\luatexversion \@uni@odetrue \else
+\ifdefined\XeTeXrevision \@uni@odetrue \fi\fi
+\ifx\l@russian\@undefined
+ \@nopatterns{Russian}
+ \adddialect\l@russian0
+\fi
+\def\@setcyrillicencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\cyrillicencoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{OT2}%
+ \sce@a{##1}{LCY}%
+ \sce@a{##1}{X2}%
+ \sce@a{##1}{T2C}%
+ \sce@a{##1}{T2B}%
+ \sce@a{##1}{T2A}%
+ \if@uni@ode
+ %\sce@a{##1}{EU1}%
+ %\sce@a{##1}{EU2}%
+ \sce@a{##1}{TU}%
+ \fi}%
+ \cdp@list
+}
+\ifx\cyrillicencoding\undefined
+ \@setcyrillicencoding
+\fi
+\@onlypreamble\@setcyrillicencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+\ifx\cyrillicencoding\undefined
+ \if@uni@ode
+ %\ifdefined\XeTeXrevision
+ % \edef\cyrillicencoding{EU1}
+ %\else\ifdefined\luatexversion
+ % \edef\cyrillicencoding{EU2}
+ %\fi\fi
+ \edef\cyrillicencoding{TU}
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{babel}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \AtBeginDocument{\@setcyrillicencoding}
+\fi
+\DeclareRobustCommand{\Russian}{\selectlanguage{\russian}}
+\DeclareRobustCommand{\cyrillictext}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\russianhyphenmins
+ \language\l@russian}%
+\let\cyr\cyrillictext
+%%\DeclareRobustCommand{\English}{%
+%% \fontencoding\latinencoding\selectfont
+%% \let\encodingdefault\latinencoding
+%% \expandafter\set@hyphenmins\englishhyphenmins
+%% \language\l@english}%
+%%\let\Eng\English
+%%\DeclareRobustCommand{\latintext}{%
+%% \fontencoding{\latinencoding}\selectfont
+%% \def\encodingdefault{\latinencoding}}
+%%\let\lat\latintext
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+%%\expandafter\ifx\csname T@X2\endcsname\relax\else
+%% \DeclareTextSymbolDefault{\AA}{OT1}
+%% \DeclareTextSymbolDefault{\aa}{OT1}
+%% \DeclareTextCommand{\aa}{OT1}{\r a}
+%% \DeclareTextCommand{\AA}{OT1}{\r A}
+%%\fi
+%%\@ifpackageloaded{inputenc}{%
+%%% \if@uni@ode
+%%% \PackageWarning{babel}{inputenc should not be used with LuaTeX or XeTeX}
+%%% \fi
+%% \ifdefined\luatexversion
+%% \PackageWarning{babel}{inputenc should not be used with LuaTeX}
+%% \fi}{%
+%% %\def\reserved@a{LWN}%
+%% %\ifx\reserved@a\cyrillicencoding\else
+%% \def\reserved@a{OT2}%
+%% \ifx\reserved@a\cyrillicencoding\else
+%% \def\reserved@a{TU}%
+%% \ifx\reserved@a\cyrillicencoding\else
+%% \PackageWarning{babel}%
+%% {No input encoding specified for Russian language}
+%% \fi\fi
+%% %\fi
+%%}
+\initiate@active@char{"}
+%%\def\mdqon{\bbl@activate{"}}
+%%\def\mdqoff{\bbl@deactivate{"}}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+\declare@shorthand{russian}{"`}{\quotedblbase}
+\declare@shorthand{russian}{"'}{\textquotedblleft}
+\declare@shorthand{russian}{"<}{\guillemotleft}
+\declare@shorthand{russian}{">}{\guillemotright}
+\declare@shorthand{russian}{""}{\hskip\z@skip}
+\declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{russian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+\declare@shorthand{russian}{"-}{%
+ \def\russian@sh@tmp{%
+ \if\russian@sh@next-\expandafter\russian@sh@emdash
+ \else\expandafter\russian@sh@hyphen\fi}%
+ \futurelet\russian@sh@next\russian@sh@tmp}
+\def\russian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+\def\russian@sh@emdash#1#2{\cdash-#1#2}
+\def\cdash#1#2#3{\def\tempx@{#3}%
+\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash\else
+ \ifx\tempx@\tempb@\@Bcdash\else
+ \ifx\tempx@\tempc@\@Ccdash\else
+ \errmessage{Wrong usage of cdash}\fi\fi\fi}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}
+\PackageInfo{babel}{Default for \string\cyrdash\space is provided}
+%%\ProvideTextCommandDefault{\cyrdash}{\iflanguage{russian}%
+%% {\hbox to.8em{--\hss--}}{\textemdash}}
+\ProvideTextCommandDefault{\cyrdash}{\hbox to.8em{--\hss--}}
+\if@uni@ode
+ %\captionsrussian@modern
+ \addto\captionsrussian{%
+ \def\prefacename{Предисловие}% [babel]
+ \def\refname{Список литературы}% [only article]
+ \def\abstractname{Аннотация}% [only article, report]
+ \def\bibname{Литература}% [only book, report]
+ \def\chaptername{Глава}% [only book, report]
+ \def\appendixname{Приложение}%
+ \@ifundefined{thechapter}
+ {\def\contentsname{Содержание}}%
+ {\def\contentsname{Оглавление}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Список иллюстраций}%
+ \def\listtablename{Список таблиц}%
+ \def\indexname{Предметный указатель}%
+ \def\authorname{Именной указатель}%
+ \def\figurename{Рис.}%
+ \def\tablename{Таблица}%
+ \def\partname{Часть}%
+ \def\enclname{вкл.}%
+ \def\ccname{исх.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}% [letter]
+ \def\seename{см.}%
+ \def\alsoname{см.\ также}%
+ \def\proofname{Доказательство}% [amsthm]
+ \def\glossaryname{Словарь терминов}%
+ \def\acronymname{Аббревиатуры}% [glossaries] {Acronyms}
+ \def\lstlistingname{Листинг}% [listings] (the environment) {Listing}
+ \def\lstlistlistingname{Листинги}% [listings] (the "List of") {Listings}
+ \def\notesname{Заметки}% [endnotes] {Notes}
+ }%
+ %% =========================================
+ %% nomencl
+ \ifdefined\nomname
+ \addto\captionsrussian{%
+ \def\nomname{Обозначения}%
+ \def\eqdeclaration#1{, см.\nobreakspace(#1)}%
+ \def\pagedeclaration#1{, стр.\nobreakspace#1}%
+ }%
+ \fi
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %%\@ifclassloaded{revtex4-1}
+ %%{<true code>}
+ %%{<false coode>}%
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рисунки}%{Figures}%
+ \def\tablesname{Таблицы}%{Tables}%
+ \def\appendixesname{Приложения}%{Appendixes}%
+ \def\acknowledgmentsname{Благодарности}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключевые слова: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Получено }%{Received }%
+ \def\Revised@name{Исправленная версия }%{Revised }%
+ \def\Accepted@name{Принято }%{Accepted }%
+ \def\Published@name{Опубликовано }%{Published }%
+ }%
+ %}{}%
+ \fi
+ \addto\captionsrussian@ancient{%
+ \def\prefacename{Предисловіе}%
+ \def\refname{Примѣчанія}%
+ \def\abstractname{Аннотація}%
+ \def\bibname{Библіографія}%
+ \def\chaptername{Глава}%
+ \def\appendixname{Приложеніе}%
+ \@ifundefined{thechapter}
+ {\def\contentsname{Содержаніе}}%
+ {\def\contentsname{Оглавленіе}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{Списокъ иллюстрацій}%
+ \def\listtablename{Списокъ таблицъ}%
+ \def\indexname{Предмѣтный указатель}%
+ \def\authorname{Именной указатель}%
+ \def\figurename{Рис.}%
+ \def\tablename{Таблица}%
+ \def\partname{Часть}%
+ \def\enclname{вкл.}%
+ \def\ccname{исх.}%
+ \def\headtoname{вх.}%
+ \def\pagename{с.}%
+ \def\seename{см.}%
+ \def\alsoname{см.~также}%
+ \def\proofname{Доказательство}%
+ \def\glossaryname{Словарь терминов}%
+ \def\acronymname{Аббревиатуры}%
+ \def\lstlistingname{Листинг}%
+ \def\lstlistlistingname{Листинги}%
+ %\ifdefined\nomname
+ % see http://old_russian.academic.ru/8433/%D0%BE%D0%B1%D1%8A%CB%AB%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D1%A5
+ \def\nomname{Обозначенія}%{Объавлениѥ}% <-- #0465
+ %\fi
+ \def\notesname{Заметки}%
+ }
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ %\@ifclassloaded{revtex4-1}
+ %{%
+ \ifnum\@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian@ancient{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{Рисунки}%{Figures}%
+ \def\tablesname{Таблицы}%{Tables}%
+ \def\appendixesname{Приложения}%{Appendixes}%
+ \def\acknowledgmentsname{Благодарности}%{Acknowledgments}
+ \def\andname{и}%{and}
+ \def\@pacs@name{PACS коды: }%{PACS numbers: }%
+ \def\@keys@name{Ключевые слова: }%{Keywords: }%
+ \def\Dated@name{Дата: }%{Dated: }%
+ \def\Received@name{Получено }%{Received }%
+ \def\Revised@name{Исправленная версия }%{Revised }%
+ \def\Accepted@name{Принято }%{Accepted }%
+ \def\Published@name{Опубликовано }%{Published }%
+ }%
+ %}{}%
+ \fi
+ %% =========================================
+\else
+ %\def\captionsrussian@modern{%
+ \addto\captionsrussian{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyri\cyre}}%
+ \def\refname{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\
+ \cyrl\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyrery}}%
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya}}%
+ \def\bibname{%
+ {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
+ \@ifundefined{thechapter}%
+ {\def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}}%
+ {\def\contentsname{%
+ {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyri\cyre}}}%
+ \let\tocname=\contentsname
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyri\cyrishrt}}%
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
+ \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc}}%
+ \def\indexname{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyre\cyrt\cyrn\cyrery\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt
+ \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%
+ \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
+ \def\headtoname{{\cyr\cyrv\cyrh.}}%
+ \def\pagename{{\cyr\cyrs.}}%
+ \def\seename{{\cyr\cyrs\cyrm.}}%
+ \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
+ \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyra\cyrr\cyrsftsn\
+ \cyrt\cyre\cyrr\cyrm\cyri\cyrn\cyro\cyrv}}%
+ \def\acronymname{\CYRA\cyrb\cyrb\cyrr\cyre\cyrv\cyri\cyra\cyrt\cyru\cyrr\cyrery}%
+ \def\lstlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg}%
+ \def\lstlistlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg\cyri}%
+ \def\nomname{\CYRO\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyri\cyrya}%
+ \def\notesname{\CYRZ\cyra\cyrm\cyre\cyrt\cyrk\cyri}%
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyri\cyrs\cyru\cyrn\cyrk\cyri}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRB\cyrl\cyra\cyrg\cyro\cyrd\cyra\cyrr\cyrn\cyro\cyrs\cyrt\cyri}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyre\cyrv\cyrery\cyre \cyrs\cyrl\cyro\cyrv\cyra: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRP\cyro\cyrl\cyru\cyrch\cyre\cyrn\cyro }%{Received }%
+ \def\Revised@name{\CYRI\cyrs\cyrp\cyrr\cyra\cyrv\cyrl\cyre\cyrn\cyrn\cyra\cyrya \cyrv\cyre\cyrr\cyrs\cyri\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyri\cyrn\cyrya\cyrt\cyro }%{Accepted }%
+ \def\Published@name{\CYRO\cyrp\cyru\cyrb\cyrl\cyri\cyrk\cyro\cyrv\cyra\cyrn\cyro }%{Published }%
+ }%
+ \fi
+ %% =========================================
+ \addto\captionsrussian@ancient{%
+ \def\prefacename{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyrii\cyre}}%
+ \def\refname{%
+ {\cyr\CYRP\cyrr\cyri\cyrm\cyryat\cyrch\cyra\cyrn\cyrii\cyrya}}% <-- Примѣчанія, нет \cyryat в кодировке T2*
+ \def\abstractname{%
+ {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyrii\cyrya}}%
+ \def\bibname{%
+ {\cyr\CYRB\cyri\cyrb\cyrl\cyrii\cyro\cyrg\cyrr\cyra\cyrf\cyrii\cyrya}}% <-- Библіографія
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{%
+ {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyrii\cyre}}%
+ \@ifundefined{thechapter}%
+ {\def\contentsname{%
+ {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyrii\cyre}}}%
+ {\def\contentsname{%
+ {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyrii\cyre}}}%
+ \let\tocname=\contentsname
+ % Списокъ иллюстрацій
+ \def\listfigurename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\cyrhrdsn\
+ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrii\cyrishrt}}
+ % Списокъ таблицъ
+ \def\listtablename{%
+ {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk\cyrhrdsn\
+ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyrhrdsn}}%
+ % Предмѣтный указатель, ѣ (\cyryat) in X2 encoding only
+ \def\indexname{%
+ {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyryat\cyrt\cyrn\cyrery\cyrishrt\space
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\authorname{%
+ {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt\
+ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
+ \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
+ \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
+ \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%
+ \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
+ \def\headtoname{{\cyr\cyrv\cyrh.}}%
+ \def\pagename{{\cyr\cyrs.}}%
+ \def\seename{{\cyr\cyrs\cyrm.}}%
+ \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
+ \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
+ \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyra\cyrr\cyrsftsn\
+ \cyrt\cyre\cyrr\cyrm\cyri\cyrn\cyro\cyrv}}% <-- Needs translation
+ \def\acronymname{\CYRA\cyrb\cyrb\cyrr\cyre\cyrv\cyri\cyra\cyrt\cyru\cyrr\cyrery}%
+ \def\lstlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg}%
+ \def\lstlistlistingname{\CYRL\cyri\cyrs\cyrt\cyri\cyrn\cyrg\cyri}%
+ \def\nomname{\CYRO\cyrb\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrii\cyrya}%
+ \def\notesname{\CYRZ\cyra\cyrm\cyre\cyrt\cyrk\cyri}%
+ }%
+ %% =========================================
+ %% RevTeX4 & RevTeX4-1
+ \ifnum \@ifclassloaded{revtex4}{1}{\@ifclassloaded{revtex4-1}{1}{0}}>0
+ \addto\captionsrussian@ancient{%
+ \def\lofname{\listfigurename}
+ \def\lotname{\listtablename}
+ \def\figuresname{\CYRR\cyri\cyrs\cyru\cyrn\cyrk\cyri}%{Figures}%
+ \def\tablesname{\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrery}%{Tables}%
+ \def\appendixesname{\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}%{Appendixes}%
+ \def\acknowledgmentsname{\CYRB\cyrl\cyra\cyrg\cyro\cyrd\cyra\cyrr\cyrn\cyro\cyrs\cyrt\cyri}%{Acknowledgments}
+ \def\andname{\cyri}%{and}
+ \def\@pacs@name{PACS \cyrk\cyro\cyrd\cyrery: }%{PACS numbers: }%
+ \def\@keys@name{\CYRK\cyrl\cyryu\cyrch\cyre\cyrv\cyrery\cyre \cyrs\cyrl\cyro\cyrv\cyra: }%{Keywords: }%
+ \def\Dated@name{\CYRD\cyra\cyrt\cyra: }%{Dated: }%
+ \def\Received@name{\CYRP\cyro\cyrl\cyru\cyrch\cyre\cyrn\cyro }%{Received }%
+ \def\Revised@name{\CYRI\cyrs\cyrp\cyrr\cyra\cyrv\cyrl\cyre\cyrn\cyrn\cyra\cyrya \cyrv\cyre\cyrr\cyrs\cyri\cyrya }%{Revised }%
+ \def\Accepted@name{\CYRP\cyrr\cyri\cyrn\cyrya\cyrt\cyro }%{Accepted }%
+ \def\Published@name{\CYRO\cyrp\cyru\cyrb\cyrl\cyri\cyrk\cyro\cyrv\cyra\cyrn\cyro }%{Published }%
+ }%
+ \fi
+ %% =========================================
+\fi
+\if@uni@ode
+ \addto\daterussian{%
+ \def\today{\number\day~\ifcase\month\or
+ января\or
+ февраля\or
+ марта\or
+ апреля\or
+ мая\or
+ июня\or
+ июля\or
+ августа\or
+ сентября\or
+ октября\or
+ ноября\or
+ декабря\fi
+ \space \number\year~г.}}
+ \def\daterussian@ancient{%
+ \def\today{\number\day~\ifcase\month\or%
+ января\or
+ февраля\or
+ марта\or
+ апреля\or
+ мая\or
+ іюня\or
+ іюля\or
+ августа\or
+ сентября\or
+ октября\or
+ ноября\or
+ декабря\fi%
+ \space \number\year~г.}}
+\else
+ \def\daterussian{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
+ \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
+ \cyrm\cyra\cyrr\cyrt\cyra\or
+ \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
+ \cyrm\cyra\cyrya\or
+ \cyri\cyryu\cyrn\cyrya\or
+ \cyri\cyryu\cyrl\cyrya\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
+ \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
+ \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
+ \space \number\year~\cyrg.}}
+ \def\daterussian@ancient{%
+ \def\today{\number\day~\ifcase\month\or
+ \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
+ \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
+ \cyrm\cyra\cyrr\cyrt\cyra\or
+ \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
+ \cyrm\cyra\cyrya\or
+ \cyrii\cyryu\cyrn\cyrya\or
+ \cyrii\cyryu\cyrl\cyrya\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
+ \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
+ \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
+ \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
+ \space \number\year~\cyrg.}}
+\fi
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{russian}{\tw@\tw@}
+\addto\extrasrussian{\cyrillictext}
+\addto\noextrasrussian{\latintext}
+\addto\extrasrussian{\languageshorthands{russian}}
+\addto\extrasrussian{\bbl@activate{"}}
+\addto\noextrasrussian{\bbl@deactivate{"}}
+\addto\extrasrussian{\bbl@frenchspacing}
+\addto\noextrasrussian{\bbl@nonfrenchspacing}
+\def\Asbuk#1{\expandafter\russian@Alph\csname c@#1\endcsname}
+\if@uni@ode
+ \def\russian@Alph#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or
+ З\or И\or К\or Л\or М\or Н\or О\or
+ П\or Р\or С\or Т\or У\or Ф\or Х\or
+ Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я\else\@ctrerr\fi}
+\else
+ \def\russian@Alph#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or
+ \CYRZ\or\CYRI\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or
+ \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or
+ \CYRC\or\CYRCH\or\CYRSH\or\CYRSHCH\or\CYREREV\or\CYRYU\or
+ \CYRYA\else\@ctrerr\fi}
+\fi
+\def\asbuk#1{\expandafter\russian@alph\csname c@#1\endcsname}
+\if@uni@ode
+ \def\russian@alph#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or е\or ж\or
+ з\or и\or к\or л\or м\or н\or о\or
+ п\or р\or с\or т\or у\or ф\or х\or
+ ц\or ч\or ш\or щ\or э\or ю\or я\else\@ctrerr\fi}
+\else
+ \def\russian@alph#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or
+ \cyrz\or\cyri\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or
+ \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or
+ \cyrc\or\cyrch\or\cyrsh\or\cyrshch\or\cyrerev\or\cyryu\or
+ \cyrya\else\@ctrerr\fi}
+\fi
+\bbl@declare@ttribute{russian}{ancient}{%
+ \PackageInfo{babel}{Russian attribute set to ancient}%
+ \let\captionsrussian=\captionsrussian@ancient
+ \let\daterussian=\daterussian@ancient
+}
+\@onlypreamble\captionsrussian@ancient
+\@onlypreamble\daterussian@ancient
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasrussian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\if@uni@ode
+ \def\nod{\mathop{\mathrm{н.о.д.}}\nolimits}
+ \def\nok{\mathop{\mathrm{н.о.к.}}\nolimits}
+ \def\NOD{\mathop{\mathrm{НОД}}\nolimits}
+ \def\NOK{\mathop{\mathrm{НОК}}\nolimits}
+ \def\Proj{\mathop{\mathrm{Пр}}\nolimits}
+\else
+ \def\nod{\mathop{\textnormal{\cyrn.\cyro.\cyrd.}}\nolimits}
+ \def\nok{\mathop{\textnormal{\cyrn.\cyro.\cyrk.}}\nolimits}
+ \def\NOD{\mathop{\textnormal{\CYRN\CYRO\CYRD}}\nolimits}
+ \def\NOK{\mathop{\textnormal{\CYRN\CYRO\CYRK}}\nolimits}
+ \def\Proj{\mathop{\textnormal{\CYRP\cyrr}}\nolimits}
+\fi
+\ldf@finish{russian}
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
+%% ----------------------------------------------------------------
+%% Copyright 2011-2017 Igor A. Kotelnikov.
+%% Copyright 1995-2008 Olga Lapko.
+%% Copyright 1989-2012 Johannes L. Braams.
+%%
+%% This file is a part of the Russian-Babel package.
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License (LPPL), either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% The package is "maintained" (as per LPPL maintenance status) by
+%% Igor A. Kotelnikov.
+%%
+%% The package consists of the file russianb.dtx
+%% and the derived files russianb.ins,
+%% russianb.ldf,
+%% russianb.pdf,
+%% README.
+%% ----------------------------------------------------------------
+%%
+%% End of file `russianb.ldf'.
diff --git a/macros/latex/contrib/babel-contrib/russian/russianb.pdf b/macros/latex/contrib/babel-contrib/russian/russianb.pdf
new file mode 100644
index 0000000000..32025a01ef
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/russian/russianb.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/samin/samin.dtx b/macros/latex/contrib/babel-contrib/samin/samin.dtx
new file mode 100644
index 0000000000..b3d951204c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/samin/samin.dtx
@@ -0,0 +1,232 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{120}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{samin.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{samin}
+%\fi
+%\ProvidesFile{samin.dtx}
+ [2004/02/20 v1.0c North Sami support from the babel system]
+%\iffalse
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2004
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source code for
+% the North Sami language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{samin.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{samin.dtx}
+%
+% \section{The North Sami language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Regnor Jernsletten,
+% (\texttt{Regnor.Jernsletten@sami.uit.no}) or
+% (\texttt{Regnor.Jernsletten@eunet.no}).}
+% defines all the language definition macros for the North Sami language.
+%
+% Several Sami dialects/languages are spoken in Finland, Norway, Sweden
+% and on the Kola Peninsula (Russia). The alphabets differ, so there
+% will eventually be a need for more \texttt{.dtx} files for e.g. Lule
+% and South Sami. Hence the name \file{samin.dtx} (and not
+% \file{sami.dtx} or the like) in the North Sami case.
+%
+% There are currently no hyphenation patterns available for the North
+% Sami language, but you might consider using the patterns for Finnish
+% (\file{fi8hyph.tex}), Norwegian (\file{nohyph.tex}) or Swedish
+% (\file{sehyph.tex}). Add a line for the \texttt{samin} language to
+% the \file{language.dat} file, and rebuild the \LaTeX\ format file.
+% See the documentation for your \LaTeX\ distribution.
+%
+% A note on writing North Sami in \LaTeX: The TI encoding and EC fonts
+% do not include the T WITH STROKE letter, which you will need a
+% workaround for. My suggestion is to place the lines\\
+% |\newcommand{\tx}{\mbox{t\hspace{-.35em}-}}|\\
+% |\newcommand{\txx}{\mbox{T\hspace{-.5em}-}}|\\
+% in the preamble of your documents. They define the commands\\
+% |\txx{}| for LATIN CAPITAL LETTER T WITH STROKE and \\
+% |\tx{}| for LATIN SMALL LETTER T WITH STROKE.
+%
+% \subsection{The code of \file{samin.dtx}}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{samin}{captionssamin}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{samin} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@samin| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@samin
+ \@nopatterns{Samin}
+ \adddialect\l@samin0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the North Sami language.
+%
+% \begin{macro}{\saminhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{samin-1.0b}{2000/09/26}{use \cs{providehyphenmins}}
+% \begin{macrocode}
+\providehyphenmins{samin}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionssamin}
+% The macro |\captionssamin| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{samin-1.0b}{2000/09/26}{Added \cs{glossaryname}}
+% \changes{samin-1.0c}{2000/10/04}{Provided the translation for
+% glossary}
+% \begin{macrocode}
+\def\captionssamin{%
+ \def\prefacename{Ovdas\'atni}%
+ \def\refname{\v Cujuhusat}%
+ \def\abstractname{\v Coahkk\'aigeassu}%
+ \def\bibname{Girjj\'ala\v svuohta}%
+ \def\chaptername{Kapihttal}%
+ \def\appendixname{\v Cuovus}%
+ \def\contentsname{Sisdoallu}%
+ \def\listfigurename{Govvosat}%
+ \def\listtablename{Tabeallat}%
+ \def\indexname{Registtar}%
+ \def\figurename{Govus}%
+ \def\tablename{Tabealla}%
+ \def\partname{Oassi}%
+ \def\enclname{Mielddus}%
+ \def\ccname{Kopia s\'addejuvvon}%
+ \def\headtoname{Vuost\'aiv\'aldi}%
+ \def\pagename{Siidu}%
+ \def\seename{geah\v ca}%
+ \def\alsoname{geah\v ca maidd\'ai}%
+ \def\proofname{Duo\dj{}a\v stus}%
+ \def\glossaryname{S\'atnelistu}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesamin}
+% The macro |\datesamin| redefines the command |\today| to
+% produce North Sami dates.
+% \begin{macrocode}
+\def\datesamin{%
+ \def\today{\ifcase\month\or
+ o\dj{}\dj{}ajagem\'anu\or
+ guovvam\'anu\or
+ njuk\v cam\'anu\or
+ cuo\ng{}om\'anu\or
+ miessem\'anu\or
+ geassem\'anu\or
+ suoidnem\'anu\or
+ borgem\'anu\or
+ \v cak\v cam\'anu\or
+ golggotm\'anu\or
+ sk\'abmam\'anu\or
+ juovlam\'anu\fi
+ \space\number\day.~b.\space\number\year}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\extrassamin}
+% \begin{macro}{\noextrassamin}
+% The macro |\extrassamin| will perform all the extra
+% definitions needed for the North Sami language. The macro
+% |\noextrassamin| is used to cancel the actions of
+% |\extrassamin|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extrassamin{}
+\addto\noextrassamin{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{samin}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/samin/samin.ins b/macros/latex/contrib/babel-contrib/samin/samin.ins
new file mode 100644
index 0000000000..e94cf6f90a
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/samin/samin.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2000/09/26}
+\def\batchfile{samin.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{samin.ldf}{\from{samin.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/samin/samin.pdf b/macros/latex/contrib/babel-contrib/samin/samin.pdf
new file mode 100644
index 0000000000..b47a57923b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/samin/samin.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/scottish/scottish.dtx b/macros/latex/contrib/babel-contrib/scottish/scottish.dtx
new file mode 100644
index 0000000000..82613e5cd0
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/scottish/scottish.dtx
@@ -0,0 +1,209 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{95}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{scottish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{scottish}
+%\fi
+%\ProvidesFile{scottish.dtx}
+ [2005/03/31 v1.0g Scottish support from the babel system]
+%\iffalse
+%% File `scottish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Scottish language definition file.
+%
+% The Gaidhlig or Scottish Gaelic terms were provided by Fraser
+% Grant \texttt{FRASER@CERNVM}.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{scottish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{scottish.dtx}
+%
+% \changes{scottish-1.0b}{1995/06/14}{Corrected typos (PR1652)}
+% \changes{scottish-1.0d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Scottish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. A contribution was made by Fraser Grant
+% (\texttt{FRASER@CERNVM}).} defines all the language definition
+% macros for the Scottish language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{scottish-1.0d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{scottish}\captionsscottish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{scottish} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@scottish| to see whether we have to do something
+% here.
+%
+% \begin{macrocode}
+\ifx\l@scottish\@undefined
+ \@nopatterns{scottish}
+ \adddialect\l@scottish0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Scottish language.
+%
+% \begin{macro}{\captionsscottish}
+% The macro |\captionsscottish| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{scottish-1.0c}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{scottish-1.0g}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsscottish{%
+ \def\prefacename{Preface}% <-- needs translation
+ \def\refname{Iomraidh}%
+ \def\abstractname{Br\`{\i}gh}%
+ \def\bibname{Leabhraichean}%
+ \def\chaptername{Caibideil}%
+ \def\appendixname{Ath-sgr`{\i}obhadh}%
+ \def\contentsname{Cl\`ar-obrach}%
+ \def\listfigurename{Liosta Dhealbh }%
+ \def\listtablename{Liosta Chl\`ar}%
+ \def\indexname{Cl\`ar-innse}%
+ \def\figurename{Dealbh}%
+ \def\tablename{Cl\`ar}%
+ \def\partname{Cuid}%
+ \def\enclname{a-staigh}%
+ \def\ccname{lethbhreac gu}%
+ \def\headtoname{gu}%
+ \def\pagename{t.d.}% abrv. `taobh duilleag'
+ \def\seename{see}% <-- needs translation
+ \def\alsoname{see also}% <-- needs translation
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datescottish}
+% The macro |\datescottish| redefines the command |\today| to
+% produce Scottish dates.
+% \changes{scottish-1.0e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{scottish-1.0e}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\datescottish{%
+ \def\today{%
+ \number\day\space \ifcase\month\or
+ am Faoilteach\or an Gearran\or am M\`art\or an Giblean\or
+ an C\`eitean\or an t-\`Og mhios\or an t-Iuchar\or
+ L\`unasdal\or an Sultuine\or an D\`amhar\or
+ an t-Samhainn\or an Dubhlachd\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasscottish}
+% \begin{macro}{\noextrasscottish}
+% The macro |\extrasscottish| will perform all the extra
+% definitions needed for the Scottish language. The macro
+% |\noextrasscottish| is used to cancel the actions of
+% |\extrasscottish|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\addto\extrasscottish{}
+\addto\noextrasscottish{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{scottish-1.0d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{scottish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/scottish/scottish.ins b/macros/latex/contrib/babel-contrib/scottish/scottish.ins
new file mode 100644
index 0000000000..5937bb1c44
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/scottish/scottish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{scottish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{scottish.ldf}{\from{scottish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/scottish/scottish.pdf b/macros/latex/contrib/babel-contrib/scottish/scottish.pdf
new file mode 100644
index 0000000000..c478ec3454
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/scottish/scottish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/serbian/README.md b/macros/latex/contrib/babel-contrib/serbian/README.md
new file mode 100644
index 0000000000..31e932a583
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbian/README.md
@@ -0,0 +1,31 @@
+----------------------------------------------------------------
+
+Serbian Latin language module for Babel, v2.0
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Serbian Latin
+(in ekavian or ijekavian dialect). The support is adapted for use both
+under legacy TeX engines, and under XeTeX and LuaTeX.
+
+The Current Maintainer is Uroš Stefanović.
+
+USAGE
+
+Serbian language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe).
+
+Typesetting in ijekavian dialect:
+
+ \usepackage[english,serbianc]{babel}
+ \languageattribute{serbianc}{ijekav}
+or
+ \usepackage[english,serbianc.ijekav]{babel}
+
+Also, the attributes 'datei' and 'quotes' are defined.
+
+DOCUMENTATION
+
+See serbian.pdf for more information.
diff --git a/macros/latex/contrib/babel-contrib/serbian/serbian.dtx b/macros/latex/contrib/babel-contrib/serbian/serbian.dtx
new file mode 100644
index 0000000000..a9dee24bf4
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbian/serbian.dtx
@@ -0,0 +1,407 @@
+% \iffalse meta-comment
+%
+% Copyright 2019 Uroš Stefanović and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is intended to be used with the Babel system.
+% ------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Uroš Stefanović.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{serbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{serbian}
+%\fi
+%\ProvidesFile{serbian.dtx}
+ [2019/07/16 2.0 Serbian Latin support for the Babel system]
+%\iffalse
+%% File `serbian.dtx'
+%
+% This file is part of the babel system, it provides the source
+% code for the Serbian Latin language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\title{The Serbian Latin Language in the \babel\ system}
+\author{Uroš Stefanović\footnote{\texttt{urostajms@gmail.com}}}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \maketitle
+ \DocInput{serbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{serbian.dtx}
+%
+% \section*{The Serbian Latin Language}
+%
+% The file \file{\filename} defines all the language definition
+% macros for the Serbian language, typeset in a Latin script.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:serbian-quote} an overview is given of its
+% purpose. One of the reasons for this is that in the Serbian
+% language some special characters are used.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"c| & |\v c|, also implemented for the lowercase and uppercase s and z. \\
+% |"d| & |\dj|, also implemented for |"D|. \\
+% |"-| & An explicit hyphen sign, allowing hyphenation
+% in the rest of the word; inserts a hyphen which is repeated at the beginning of the
+% next line (recommended to use for compound words with hyphen). \\
+% \verb="|= & Disables ligature at this position. \\
+% |""| & Similar to |"-| but prints no hyphen sign. \\
+% |"~| & Compound word mark without a breakpoint, prints hyphen
+% prohibiting hyphenation at the point. \\
+% |"=| & A compound word mark with a breakpoint, prints hyphen
+% allowing hyphenation in the composing words. \\
+% |"`| & German opening double quote (looks like ,\kern-0.08em,). \\
+% |"'| & German closing double quote (looks like ``). \\
+% |"'| & (if the \Lopt{quotes} attribute is used) Closing double quote (looks like ''). \\
+% |"<| & French opening double quote (looks like $<\!\!<$). \\
+% |">| & French closing double quote (looks like $>\!\!>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{serbian.ldf}}\label{tab:serbian-quote}
+% \end{center}
+% \end{table}
+%
+% Macro |\today| prints the date in Serbian. Alternatively, if attribute \Lopt{datei} is used,
+% |\today| prints the current date, but prints `juni' and `juli' for `June' and `July'.
+% If you prefer to use `juni' and `juli' instead of default `jun' and `jul',
+% use the \Lopt{datei} attribute. Also, the |\today*| macro prints the date without dot after the year
+% (used when after the date is the punctuation mark, such as comma).
+% Alternatively, the commands |\todayRoman| and |\todayRoman*| prints the current date using Roman numerals for months.
+%
+% Apart from defining shorthands we need to make sure that the
+% first paragraph of each section is indented. Furthermore the
+% following new math operators are defined: |\sh|, |\ch|, |\tg|, |\ctg|,
+% |\arctg|, |\arcctg|, |\th|, |\cth|, |\arsh|,
+% |\arch|, |\arth|, |\arcth|, |\cosec|, |\Prob|, |\Expect|, |\Variance|,
+% |\arcsec|, |\arccosec|, |\sech|, |\cosech|, |\arsech|, |\arcosech|,
+% |\NZD|, |\nzd|, |\NZS|, |\nzs|.
+%
+% By default, a ekavian spelling is enabled. For ijekavian
+% spelling can be enabled by setting the attribute to \Lopt{ijekav}. To set
+% an attribute, put the |\languageattribute| macro within a document preamble after
+% \babel, for example,
+%\begin{verbatim}
+% \usepackage[english,serbian]{babel}
+% \languageattribute{serbian}{ijekav}
+%\end{verbatim}
+% Setting the \Lopt{ijekav} attribute changes the built-in strings (caption names).
+% For example, the part will be entitled as
+% `Deo' by default and as `Dio' if the
+% Serbian language attribute is set to \Lopt{ijekav}.
+% Same result can be achieved using a modifier as follows:
+%\begin{verbatim}
+% \usepackage[english,serbian.ijekav]{babel}
+%\end{verbatim}
+% Using a modifier in a package option is often better. A modifier is set after
+% the language name, and is prefixed with a dot (only when the language is set
+% as package option — neither global options nor the main key accept them).
+% Also, it's possible to use more than one attribute:
+%\begin{verbatim}
+% \usepackage[english,serbian.ijekav.datei.quotes]{babel}
+%\end{verbatim}
+%
+% The file \file{serbian.ldf} is designed to work both with
+% legacy non-unicode (8-bit) and new Unicode encodings of the source document
+% files (input encodings) and of the font files (font encodings).
+%
+% \StopEventually{}
+%
+% \section*{The code}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{serbian}{captionsserbian}
+% \end{macrocode}
+%
+% First, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If so, we set
+% boolean key |\if@srb@uni@ode| to true.
+%
+% \begin{macrocode}
+\ifdefined\if@srb@uni@ode
+ \PackageError{babel}{if@srb@uni@ode already defined.}
+ \relax
+\fi
+\newif\if@srb@uni@ode
+\ifdefined\luatexversion \@srb@uni@odetrue \else
+\ifdefined\XeTeXrevision \@srb@uni@odetrue \fi\fi
+% \end{macrocode}
+%
+% Check if hyphenation patterns for the Serbian language have been
+% loaded in \file{language.dat}. Namely, we check for the existence of
+% |\l@serbian|. If it is not defined, we declare Serbian as dialect
+% for the default language number 0 which almost for sure is English.
+%
+% \begin{macrocode}
+\ifx\l@serbian\@undefined
+ \@nopatterns{Serbian}
+ \adddialect\l@serbian0
+\fi
+% \end{macrocode}
+%
+% For Serbian the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"}~character for
+% shorthands; we specify that the Serbian group of shorthands
+% should be used. We save the original double quote character
+% in the |\dq| macro to keep it available. The shorthand \texttt{"-}
+% should be used in places where a word contains an explictit
+% hyphenation character. According to the rules of the Serbian language, when
+% a word break occurs at an explicit hyphen it must appear both at the end of the
+% first line and at the beginning of the second line.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+\declare@shorthand{serbian}{"c}{\textormath{\v c}{\check c}}
+\declare@shorthand{serbian}{"d}{\textormath{\dj}{\textnormal{\dj}}}
+\declare@shorthand{serbian}{"s}{\textormath{\v s}{\check s}}
+\declare@shorthand{serbian}{"z}{\textormath{\v z}{\check z}}
+\declare@shorthand{serbian}{"C}{\textormath{\v C}{\check C}}
+\declare@shorthand{serbian}{"D}{\textormath{\DJ}{\textnormal{\DJ}}}
+\declare@shorthand{serbian}{"S}{\textormath{\v S}{\check S}}
+\declare@shorthand{serbian}{"Z}{\textormath{\v Z}{\check Z}}
+\declare@shorthand{serbian}{"`}{\quotedblbase}
+\declare@shorthand{serbian}{"'}{\textquotedblleft}
+\declare@shorthand{serbian}{"<}{\guillemotleft}
+\declare@shorthand{serbian}{">}{\guillemotright}
+\declare@shorthand{serbian}{""}{\hskip\z@skip}
+\declare@shorthand{serbian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{serbian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{serbian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+\declare@shorthand{serbian}{"-}{\nobreak\discretionary{-}{-}{-}\bbl@allowhyphens}
+% \end{macrocode}
+%
+% The macro |\captionsserbian| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+%
+% \begin{macrocode}
+\addto\captionsserbian{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Sa\v zetak}%
+ \def\bibname{Bibliografija}%
+ \def\chaptername{Glava}%
+ \def\appendixname{Dodatak}%
+ \def\contentsname{Sadr\v zaj}%
+ \def\listfigurename{Spisak slika}%
+ \def\listtablename{Spisak tabela}%
+ \def\indexname{Indeks}%
+ \def\figurename{Slika}%
+ \def\tablename{Tabela}%
+ \def\partname{Deo}%
+ \def\enclname{Prilozi}%
+ \def\ccname{Kopije}%
+ \def\headtoname{Prima}%
+ \def\pagename{strana}%
+ \def\seename{vidi}%
+ \def\alsoname{vidi tako\dj e}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Re\v cnik}%
+}%
+\if@srb@uni@ode
+ \addto\captionsserbian{%
+ \def\abstractname{Sažetak}%
+ \def\contentsname{Sadržaj}%
+ \def\alsoname{vidi takođe}%
+ \def\glossaryname{Rečnik}%
+ }%
+\fi
+\let\captionsserbian@ijekav=\captionsserbian
+\addto\captionsserbian@ijekav{
+ \def\partname{Dio}%
+ \def\glossaryname{Rje\v cnik}%
+}
+\if@srb@uni@ode
+ \addto\captionsserbian@ijekav{
+ \def\glossaryname{Rječnik}%
+ }
+\fi
+% \end{macrocode}
+%
+% The macro |\dateserbian| redefines the commands |\today|, |\today*|, |\todayRoman| and |\todayRoman*| to produce Serbian dates.
+%
+% \begin{macrocode}
+ \def\dateserbian{%
+ \def\month@serbian{\ifcase\month\or
+ januar\or
+ februar\or
+ mart\or
+ april\or
+ maj\or
+ jun\or
+ jul\or
+ avgust\or
+ septembar\or
+ oktobar\or
+ novembar\or
+ decembar\fi}
+ \def\today{\number\day.~\month@serbian\ \number\year\@ifstar{}{.}}
+ \def\todayRoman{\number\day.~\@Roman\month~\number\year\@ifstar{}{.}}}
+ \let\dateserbian@datei=\dateserbian
+ \addto\dateserbian@datei{
+ \def\month@serbian@datei{\ifnum\month=6 juni%
+ \else\ifnum\month=7 juli\else\month@serbian\fi\fi}
+ \def\today{\number\day.~\month@serbian@datei\ \number\year\@ifstar{}{.}}
+}
+% \end{macrocode}
+%
+% The Serbian hyphenation patterns can be used with |\lefthyphenmin| and
+% |\righthyphenmin| set to 2. (Actually, the “official” definition allows even one character for |lefthyphen|, but it is recommended to use value two for better results.)
+%
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{serbian}{\tw@\tw@}
+% \end{macrocode}
+%
+% We specify that the Serbian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasserbian{\languageshorthands{serbian}}
+\addto\extrasserbian{\bbl@activate{"}}
+\addto\noextrasserbian{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% Serbian typesetting requires |frenchspacing|. So, we add commands to
+% |\extrasserbian| and |\noextrasserbian| to turn it on and off, respectively.
+%
+% \begin{macrocode}
+\addto\extrasserbian{\bbl@frenchspacing}
+\addto\noextrasserbian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% In Serbian the first paragraph of each section should be indented.
+%
+% \begin{macrocode}
+\let\@aifORI\@afterindentfalse
+\def\bbl@serbianindent{\let\@afterindentfalse\@afterindenttrue\@afterindenttrue}
+\def\bbl@nonserbianindent{\let\@afterindentfalse\@aifORI\@afterindentfalse}
+\addto\extrasserbian{\bbl@serbianindent}
+\addto\noextrasserbian{\bbl@nonserbianindent}
+% \end{macrocode}
+%
+% An |ijekav| attribute changes default behavior and activates an
+% alternative set of captions suitable for typesetting in ijekavian dialect.
+% The |quotes| attribute changes the |"'| shorthand to produce '' as closing quote,
+% instead the traditional `` quote of Serbian language.
+% Also, the |datei| attribute will produce `juni' and `juli' instead `jun' and `jul'
+% for date.
+%
+% \begin{macrocode}
+\bbl@declare@ttribute{serbian}{ijekav}{%
+ \PackageInfo{babel}{Serbian attribute set to ijekav}%
+ \let\captionsserbian=\captionsserbian@ijekav }
+\@onlypreamble\captionsserbian@ijekav
+\bbl@declare@ttribute{serbian}{quotes}{%
+ \PackageInfo{babel}{Serbian attribute set to quotes}%
+ \declare@shorthand{serbian}{"'}{\textquotedblright} }
+\bbl@declare@ttribute{serbian}{datei}{%
+ \PackageInfo{babel}{Serbian attribute set to datei}%
+ \let\dateserbian=\dateserbian@datei }
+\@onlypreamble\dateserbian@datei
+% \end{macrocode}
+%
+% Some math functions in Serbian math books have other names:
+% e.g. |sinh| in Serbian is written as |sh| etc. So we define a
+% number of new math operators.
+%
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasserbian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\arsh{\mathop{\operator@font arsh}\nolimits}
+\def\arch{\mathop{\operator@font arch}\nolimits}
+\def\arth{\mathop{\operator@font arth}\nolimits}
+\def\arcth{\mathop{\operator@font arcth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+\def\arcsec{\mathop{\operator@font arcsec}\nolimits}
+\def\arccosec{\mathop{\operator@font arccosec}\nolimits}
+\def\sech{\mathop{\operator@font sech}\nolimits}
+\def\cosech{\mathop{\operator@font cosech}\nolimits}
+\def\arsech{\mathop{\operator@font arsech}\nolimits}
+\def\arcosech{\mathop{\operator@font arcosech}\nolimits}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Expect{\mathop{\kern\z@\mathsf{E}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\def\nzs{\mathop{\operator@font nzs}\nolimits}
+\def\nzd{\mathop{\operator@font nzd}\nolimits}
+\def\NZS{\mathop{\operator@font NZS}\nolimits}
+\def\NZD{\mathop{\operator@font NZD}\nolimits}
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{serbian}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/serbian/serbian.ins b/macros/latex/contrib/babel-contrib/serbian/serbian.ins
new file mode 100644
index 0000000000..e163deea29
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbian/serbian.ins
@@ -0,0 +1,131 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2019 Uroš Stefanović and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is intended to be used with the Babel system.
+%% ------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Uroš Stefanovic.
+%%
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2019/07/16}
+\def\batchfile{serbian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2019 Uroš Stefanović and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Uroš Stefanović.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2019 Uroš Stefanović and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Uroš Stefanović.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel/contrib}
+
+\usepreamble\mainpreamble
+\generate{\file{serbian.ldf}{\from{serbian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/serbian/serbian.pdf b/macros/latex/contrib/babel-contrib/serbian/serbian.pdf
new file mode 100644
index 0000000000..acebed5fc1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbian/serbian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/serbianc/README.md b/macros/latex/contrib/babel-contrib/serbianc/README.md
new file mode 100644
index 0000000000..2cba6d923e
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbianc/README.md
@@ -0,0 +1,90 @@
+----------------------------------------------------------------
+
+Serbian Cyrillic language module for Babel, v3.0
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Serbian Cyrillic
+(in ekavian or ijekavian dialect). The support is adapted for use both
+under legacy TeX engines, and under XeTeX and LuaTeX.
+
+The Current Maintainer is Uroš Stefanović.
+
+USAGE
+
+Serbianc language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe). The Unicode engines can be run either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep the recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+ 8-bit mode:
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,serbanc]{babel}
+
+ Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX},Language=Serbian,Script=Cyrillic}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,serbianc]{babel}
+
+Typesetting in ijekavian dialect:
+
+ \usepackage[english,serbianc]{babel}
+ \languageattribute{serbianc}{ijekav}
+or
+ \usepackage[english,serbianc.ijekav]{babel}
+
+Also, the attributes 'datei' and 'quotes' are defined.
+
+DOCUMENTATION
+
+See serbianc.pdf for more information.
+
+CHANGES
+
+ * Command \todayRoman is added;
+
+ * Commands \today* and \todayRoman* print dates without dot after year;
+
+ * Ijekavian dialect is now supported (if 'ijekav' attribute is used);
+
+ * Shorthand "' prints '' quotes instead of traditional `` quotes (if 'quotes' attribute is used);
+
+ * 'јуни' and 'јули' is printed instead of 'јун' and 'јул' (if 'datei' attribute is used);
+
+ * Some captions strings are fixeds;
+
+ * Cyrillic enumeration is added.
+
+ * Encodings T2A, X2, OT2 (8-bit mode) and TU (Unicode mode) are supported.
+
+----------------------------------------------------------------
+
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
diff --git a/macros/latex/contrib/babel-contrib/serbianc/serbianc.dtx b/macros/latex/contrib/babel-contrib/serbianc/serbianc.dtx
new file mode 100644
index 0000000000..22f69bf0f8
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbianc/serbianc.dtx
@@ -0,0 +1,652 @@
+% \iffalse meta-comment
+%
+%Copyright 2019 Uroš Stefanović,
+%2002--2019 Filip Brčić
+%All rights reserved.
+%
+% This file is intended to be used with the Babel system.
+% ------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Uroš Stefanović.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{serbianc.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{serbianc}
+%\fi
+%\ProvidesFile{serbianc.dtx}
+ [2019/01/12 3.0 Serbian Cyrillic support for the Babel system]
+%\iffalse
+%% File `serbianc.dtx'
+%
+% This file is part of the babel system, it provides the source
+% code for the Serbian Cyrillic language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T2A]{fontenc}
+\title{The Serbian Cyrillic Language in the \babel\ system}
+\author{Uroš Stefanović\footnote{\texttt{urostajms@gmail.com}}}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \maketitle
+ \DocInput{serbianc.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{serbianc.dtx}
+%
+% \section*{Serbian Cyrillic Language}
+%
+% The file \file{\filename} defines all the language definition
+% macros for Serbian language, typeset in a Cyrillic script.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:serbianc-quote} an overview is given of its
+% purpose. One of the reasons for this is that, in the Serbian
+% language, some special characters are used.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"-| & An explicit hyphen sign, allowing hyphenation
+% in the rest of the word; inserts a hyphen which is repeated at the beginning of the
+% next line (recommended to use for compound words with hyphen). \\
+% \verb="|= & Disables ligature at this position. \\
+% |""| & Similar to |"-| but prints no hyphen sign. \\
+% |"~| & Compound word mark without a breakpoint, prints hyphen
+% prohibiting hyphenation at the point. \\
+% |"=| & A compound word mark with a breakpoint, prints hyphen
+% allowing hyphenation in the composing words. \\
+% |"`| & German opening double quote (looks like ,\kern-0.08em,). \\
+% |"'| & German closing double quote (looks like ``). \\
+% |"'| & (if the \Lopt{quotes} attribute is used) Closing double quote (looks like ''). \\
+% |"<| & French opening double quote (looks like $<\!\!<$). \\
+% |">| & French closing double quote (looks like $>\!\!>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{serbianc.ldf}}\label{tab:serbianc-quote}
+% \end{center}
+% \end{table}
+%
+% Macro |\today| prints the date in Serbian. Alternatively, if attribute \Lopt{datei} is used,
+% |\today| prints the current date, but prints `јуни' and `јули' for `June' and `July'.
+% If you prefer to use `јуни' and `јули' instead of default `јун' and `јул',
+% use the \Lopt{datei} attribute. Also, the |\today*| macro prints the date without dot after the year
+% (used when after the date is the punctuation mark, such as comma).
+% Alternatively, the commands |\todayRoman| and |\todayRoman*| print the current date using Roman numerals for months.
+%
+% The alphabetical enumerations in texts use the Cyrillic alphabet and alphabetic order.
+% In principle, enumerations are a matter for class and style designers but the same can be
+% said also about things, other than enumerations, such as names of sections and bibliography lists.
+%
+% Apart from defining shorthands, we need to make sure that the
+% first paragraph of each section is indented. Furthermore, the
+% following new math operators are defined: |\sh|, |\ch|, |\tg|, |\ctg|,
+% |\arctg|, |\arcctg|, |\th|, |\cth|, |\arsh|,
+% |\arch|, |\arth|, |\arcth|, |\cosec|, |\Prob|, |\Expect|, |\Variance|,
+% |\arcsec|, |\arccosec|, |\sech|, |\cosech|, |\arsech|, |\arcosech|,
+% |\NZD|, |\nzd|, |\NZS|, |\nzs|. Cyrillic letters
+% in math mode can be typed with the aid of text commands such as |\textbf|, |\textsf|, |\textit|,
+% |\texttt|, e.t.c.
+%
+% By default, ekavian spelling is enabled. Ijekavian
+% spelling can be enabled by setting the attribute to \Lopt{ijekav}. To set
+% an attribute, put the |\languageattribute| macro within a document preamble after
+% \babel, for example,
+%\begin{verbatim}
+% \usepackage[english,serbianc]{babel}
+% \languageattribute{serbianc}{ijekav}
+%\end{verbatim}
+% Setting the \Lopt{ijekav} attribute changes the built-in strings (caption names).
+% For example, the part will be entitled as
+% `Део' by default and as `Дио' if the
+% Serbianc language attribute is set to \Lopt{ijekav}.
+% Same result can be achieved using a modifier as follows:
+%\begin{verbatim}
+% \usepackage[english,serbianc.ijekav]{babel}
+%\end{verbatim}
+% Using a modifier in a package option is often better. A modifier is set after
+% the language name, and is prefixed with a dot (only when the language is set
+% as package option — neither global options nor the main key accept them).
+% Also, it's possible to use more than one attribute:
+%\begin{verbatim}
+% \usepackage[english,serbianc.ijekav.datei.quotes]{babel}
+%\end{verbatim}
+%
+% The file \file{serbianc.ldf} is designed to work both with
+% legacy non-unicode (8-bit) and new Unicode encodings of the source document
+% files (input encodings) and of the font files (font encodings). This is
+% achieved by excluding (bypassing) the |\cyr...| macros, which map every letter
+% in a source file with given input encoding to a corresponding code point in a
+% font file with a given font encoding when running modern engines, such as
+% Lua\LaTeX\ or Xe\LaTeX, in native Unicode mode instead of legacy engines, such
+% as \LaTeX\ or PDF\LaTeX, or Unicode engines in a compatibility (8-bit) mode.
+%
+% For Lua\LaTeX\ or Xe\LaTeX\ one needs to load the |fontspec| package.
+% The following example shows how to load Computer Modern Unicode (CMU) fonts (which is a
+% part of all modern \LaTeX\ distributions), and also to get correct italic shape of the letters |б|, |г|, |д|, |п| and |т| for Serbian language:
+%\begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Ligatures={TeX},Language=Serbian,Script=Cyrillic}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,serbianc]{babel}
+%\end{verbatim}
+%
+% \StopEventually{}
+%
+% \section*{The code}
+%
+% The macro |\LdfInit| takes care of preventing this file from
+% loading more than once, checking the category code of the
+% \texttt{@} sign, etc.
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{serbianc}{captionsserbianc}
+% \end{macrocode}
+%
+% First, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If it is, we set
+% the boolean key |\if@srbc@uni@ode| to true. It will be used to eliminate |\cyr...|
+% commands, which were introduced in \LaTeX2e\ to handle various
+% Cyrillic input encodings. With the introduction of Unicode, \LaTeX\ is
+% moving to universal input encoding, so we consider these |\cyr...|
+% commands obsolete. However, they are still preserved for backward
+% compatibility in case \LaTeX\ or PDF\LaTeX\ are running.
+%
+% \begin{macrocode}
+\ifdefined\if@srbc@uni@ode
+ \PackageError{babel}{if@srbc@uni@ode already defined.}
+ \relax
+\fi
+\newif\if@srbc@uni@ode
+\ifdefined\luatexversion \@srbc@uni@odetrue \else
+\ifdefined\XeTeXrevision \@srbc@uni@odetrue \fi\fi
+% \end{macrocode}
+%
+% Check if hyphenation patterns for the Serbianc language have been
+% loaded in \file{language.dat}. Namely, we check for the existence of
+% |\l@serbianc|. If it is not defined, we declare Serbianc as dialect
+% for the default language number 0, which is almost certainly English.
+%
+% \begin{macrocode}
+\ifx\l@serbianc\@undefined
+ \@nopatterns{Serbianc}
+ \adddialect\l@serbianc0
+\fi
+% \end{macrocode}
+%
+% There is a limited list of encodings appropriate for Serbian Cyrillic text. We
+% will look at which one of them is declared and keep its name in the macro
+% |\cyrillicencoding|.
+% The correct 7-bit Cyrillic encoding is \texttt{OT2}.
+% The correct 8-bit Cyrillic encodings are
+% \texttt{T2A} (default for 8-bit compilers) and \texttt{X2}.
+% The correct utf8 encodings are
+% \texttt{TU} (default for Xe\LaTeX\ and Lua\LaTeX),
+% \texttt{EU1} (obsolete, formerly used for Xe\LaTeX),
+% \texttt{EU2} (obsolete, formerly used for Lua\LaTeX).
+%
+% In 8-bit (\LaTeX) mode, the user may choose a different non-unicode Cyrillic
+% encoding---\texttt{X2} or \texttt{OT2}. If one wants
+% to use another font encoding rather than default (\texttt{T2A}),
+% he or she has to load the corresponding file \emph{before} \file{babel.sty}.
+%
+% Remember that, for the Serbian language, the \texttt{T2A} encoding is
+% better than \texttt{X2}, because \texttt{X2} does not contain Latin
+% letters, and users should pay attention and switch the language
+% every time they want to type a Latin word inside a Serbian phrase
+% or vice versa.
+%
+% We parse the |\cdp@list| containing encodings known to \LaTeX\
+% in the order in which they have been loaded by the time \texttt{babel} is called.
+% We set the |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2},
+% \texttt{X2}, \texttt{T2A}. In Unicode mode,
+% |\cyrillicencoding| is set to \texttt{TU} by \texttt{fontspec}. Nevertheless,
+% here we provide similar definitions; 8-bit encodings are kept for Unicode
+% compilers (Lua\LaTeX\ and Xe\LaTeX) since they can run in compatibility
+% (8-bit) mode.
+%
+% \begin{macrocode}
+\def\@setcyrillicencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\cyrillicencoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{OT2}%
+ \sce@a{##1}{X2}%
+ \sce@a{##1}{T2A}%
+ \if@srbc@uni@ode
+ \sce@a{##1}{TU}%
+ \fi}%
+ \cdp@list
+}
+\ifx\cyrillicencoding\undefined
+ \@setcyrillicencoding
+\fi
+\@onlypreamble\@setcyrillicencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+\ifx\cyrillicencoding\undefined
+ \if@srbc@uni@ode
+ \edef\cyrillicencoding{TU}
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{babel}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+ \AtBeginDocument{\@setcyrillicencoding}
+\fi
+% \end{macrocode}
+%
+% We define the macro |\Serbianc| simply as an alias for
+% |\selectlanguage{serbianc}|.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Serbianc}{\selectlanguage{\serbianc}}
+% \end{macrocode}
+%
+% We define |\cyrillictext| and its alias |\cyr|; these macros are intended for use within the \texttt{babel} macros and
+% do not perform the complete change of the language.
+%
+% In particular, they to do not change the captions and the name of current
+% language stored in the macro |\languagename|. This inconsistency might
+% break some assumptions embedded into \texttt{babel}.
+% For example, the |\iflanguage| macro will fail.
+%
+% Furthermore, |\cyrillictext| does
+% not activate shorthands, so |"<|, |">|, |"`|, |"'|, e.t.c. will not work.
+%
+% Lastly, |\cyrillictext| does not write its trace
+% to \file{.aux} file, which might result in wrong typesetting of
+% table of contents, list of tables and list of figures in multilingual
+% documents.
+%
+% For these reasons, the use of the declaration |\cyrillictext| and
+% its aliases in ordinary text is strongly discouraged. Instead of the
+% declaration |\cyrillictext|, it is recommended to use |\Serbianc| or the
+% command |\foreignlanguage| defined in the \texttt{babel} core; their
+% functionality is similar to |\selectlanguage{serbianc}|, but they do not
+% change caption names, dates and shorthands.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\cyrillictext}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\serbianchyphenmins
+ \language\l@serbianc}%
+\let\cyr\cyrillictext
+% \end{macrocode}
+%
+% The macro |\textcyrillic| takes an argument which is then typeset using the
+% |\cyrillictext| declaration.
+%
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \end{macrocode}
+%
+% For Serbian, the \texttt{"} character is made active. This is done
+% once; later on, its definition may vary. Other languages in the
+% same document may also use the \texttt{"}~character for
+% shorthands; we specify that the Serbian group of shorthands
+% should be used. We save the original double quote character
+% in the |\dq| macro to keep it available. The shorthand \texttt{"-}
+% should be used in places where a word contains an explictit
+% hyphenation character. According to the rules of the Serbian language, when
+% a word break occurs at an explicit hyphen, it must appear both at the end of the
+% first line and at the beginning of the second line.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+\declare@shorthand{serbianc}{"`}{\quotedblbase}
+\declare@shorthand{serbianc}{"'}{\textquotedblleft}
+\declare@shorthand{serbianc}{"<}{\guillemotleft}
+\declare@shorthand{serbianc}{">}{\guillemotright}
+\declare@shorthand{serbianc}{""}{\hskip\z@skip}
+\declare@shorthand{serbianc}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{serbianc}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{serbianc}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+\declare@shorthand{serbianc}{"-}{\nobreak\discretionary{-}{-}{-}\bbl@allowhyphens}
+% \end{macrocode}
+%
+% The |\cyrdash| macro will be defined if it hadn't already been defined in a fontenc file. For |T2A| and |X2| fonts,
+% |cyrdash| will be placed in the code of the English emdash.
+%
+% \begin{macrocode}
+\ProvideTextCommandDefault{\cyrdash}{\hbox to.8em{--\hss--}}
+% \end{macrocode}
+%
+% The macro |\captionsserbianc| defines all strings used in the four
+% standard documentclasses provided by \LaTeX.
+%
+% \begin{macrocode}
+\if@srbc@uni@ode
+ \addto\captionsserbianc{%
+ \def\prefacename{Предговор}%
+ \def\refname{Литература}%
+ \def\abstractname{Сажетак}%
+ \def\bibname{Библиографија}%
+ \def\chaptername{Глава}%
+ \def\appendixname{Додатак}%
+ \def\contentsname{Садржај}%
+ \def\listfigurename{Списак слика}%
+ \def\listtablename{Списак табела}%
+ \def\indexname{Индекс}%
+ \def\figurename{Слика}%
+ \def\tablename{Табела}%
+ \def\partname{Део}%
+ \def\enclname{Прилози}%
+ \def\ccname{Копије}%
+ \def\headtoname{Прима}%
+ \def\pagename{страна}%
+ \def\seename{види}%
+ \def\alsoname{види такође}%
+ \def\proofname{Доказ}%
+ \def\glossaryname{Речник}%
+ }%
+ \let\captionsserbianc@ijekav=\captionsserbianc
+ \addto\captionsserbianc@ijekav{
+ \def\partname{Дио}%
+ \def\glossaryname{Рjечник}%
+ }
+\else
+ \addto\captionsserbianc{%
+ \def\prefacename{{\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
+ \def\refname{{\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \def\abstractname{{\cyr\CYRS\cyra\cyrzh\cyre\cyrt\cyra\cyrk}}%
+ \def\bibname{{\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrje\cyra}}%
+ \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
+ \def\appendixname{{\cyr\CYRD\cyro\cyrd\cyra\cyrt\cyra\cyrk}}%
+ \def\contentsname{{\cyr\CYRS\cyra\cyrd\cyrr\cyrzh\cyra\cyrje}}%
+ \def\listfigurename{{\cyr\CYRS\cyrp\cyri\cyrs\cyra\cyrk\ \cyrs\cyrl\cyri\cyrk\cyra}}%
+ \def\listtablename{{\cyr\CYRS\cyrp\cyri\cyrs\cyra\cyrk\ \cyrt\cyra\cyrb\cyre\cyrl\cyra}}%
+ \def\indexname{{\cyr\CYRI\cyrn\cyrd\cyre\cyrk\cyrs}}%
+ \def\figurename{{\cyr\CYRS\cyrl\cyri\cyrk\cyra}}%
+ \def\tablename{{\cyr\CYRT\cyra\cyrb\cyre\cyrl\cyra}}%
+ \def\partname{{\cyr\CYRD\cyre\cyro}}%
+ \def\enclname{{\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrz\cyri}}%
+ \def\ccname{{\cyr\CYRK\cyro\cyrp\cyri\cyrje\cyre}}%
+ \def\headtoname{{\cyr\CYRP\cyrr\cyri\cyrm\cyra}}%
+ \def\pagename{{\cyr\cyrs\cyrt\cyrr\cyra\cyrn\cyra}}%
+ \def\seename{{\cyr\cyrv\cyri\cyrd\cyri}}%
+ \def\alsoname{{\cyr\cyrv\cyri\cyrd\cyri\ \cyrt\cyra\cyrk\cyro\cyrdje\cyre}}%
+ \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz}}%
+ \def\glossaryname{{\cyr\CYRR\cyre\cyrch\cyrn\cyri\cyrk}}%
+ }%
+ \let\captionsserbianc@ijekav=\captionsserbianc
+ \addto\captionsserbianc@ijekav{
+ \def\partname{{\cyr\CYRD\cyri\cyro}}%
+ \def\glossaryname{{\cyr\CYRR\cyrje\cyre\cyrch\cyrn\cyri\cyrk}}%
+ }
+\fi
+% \end{macrocode}
+%
+% The macro |\dateserbianc| redefines the commands |\today|, |\today*|, |\todayRoman| and |\todayRoman*| to produce Serbian dates.
+%
+% \begin{macrocode}
+\if@srbc@uni@ode
+ \addto\dateserbianc{%
+ \def\month@serbianc{\ifcase\month\or
+ јануар\or
+ фебруар\or
+ март\or
+ април\or
+ мај\or
+ јун\or
+ јул\or
+ август\or
+ септембар\or
+ октобар\or
+ новембар\or
+ децембар\fi}
+ \def\today{\number\day.~\month@serbianc\ \number\year\@ifstar{}{.}}
+ \def\todayRoman{\number\day.~\@Roman\month~\number\year\@ifstar{}{.}}}
+ \let\dateserbianc@datei=\dateserbianc
+ \addto\dateserbianc@datei{
+ \def\month@serbianc@datei{\ifnum\month=6 јуни%
+ \else\ifnum\month=7 јули\else\month@serbianc\fi\fi}
+ \def\today{\number\day.~\month@serbianc@datei\ \number\year\@ifstar{}{.}}}
+\else
+ \def\dateserbianc{%
+ \def\month@serbianc{\ifcase\month\or
+ \cyrje\cyra\cyrn\cyru\cyra\cyrr\or
+ \cyrf\cyre\cyrb\cyrr\cyru\cyra\cyrr\or
+ \cyrm\cyra\cyrr\cyrt\or
+ \cyra\cyrp\cyrr\cyri\cyrl\or
+ \cyrm\cyra\cyrje\or
+ \cyrje\cyru\cyrn\or
+ \cyrje\cyru\cyrl\or
+ \cyra\cyrv\cyrg\cyru\cyrs\cyrt\or
+ \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrb\cyra\cyrr\or
+ \cyro\cyrk\cyrt\cyro\cyrb\cyra\cyrr\or
+ \cyrn\cyro\cyrv\cyre\cyrm\cyrb\cyra\cyrr\or
+ \cyrd\cyre\cyrc\cyre\cyrm\cyrb\cyra\cyrr\fi}
+ \def\today{\number\day.~\month@serbianc\ \number\year\@ifstar{}{.}}
+ \def\todayRoman{\number\day.~\@Roman\month~\number\year\@ifstar{}{.}}}
+ \let\dateserbianc@datei=\dateserbianc
+ \addto\dateserbianc@datei{
+ \def\month@serbianc@datei{\ifnum\month=6\cyrje\cyru\cyrn\cyri%
+ \else\ifnum\month=7\cyrje\cyru\cyrl\cyri\else\month@serbianc\fi\fi}
+ \def\today{\number\day.~\month@serbianc@datei\ \number\year\@ifstar{}{.}}
+}
+\fi
+% \end{macrocode}
+%
+% The Serbian hyphenation patterns can be used with |\lefthyphenmin| and
+% |\righthyphenmin| set to 2. (Actually, the “official” definition even allows one character for |lefthyphen|, but in that case,
+% the \LaTeX{} hyphenation patterns will give the wrong results.)
+%
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{serbianc}{\tw@\tw@}
+% \end{macrocode}
+%
+% We instruct babel to switch font encoding using earlier defined macros
+% |\cyrillictext| and |\latintext|.
+%
+% \begin{macrocode}
+\addto\extrasserbianc{\cyrillictext}
+\addto\noextrasserbianc{\latintext}
+% \end{macrocode}
+%
+% Also, we specify that the Serbian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasserbianc{\languageshorthands{serbianc}}
+\addto\extrasserbianc{\bbl@activate{"}}
+\addto\noextrasserbianc{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% Serbian typesetting requires |frenchspacing|. So, we add commands to
+% |\extrasserbianc| and |\noextrasserbianc| to turn it on and off, respectively.
+%
+% \begin{macrocode}
+\addto\extrasserbianc{\bbl@frenchspacing}
+\addto\noextrasserbianc{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% In Serbian, the first paragraph of each section should be indented.
+%
+% \begin{macrocode}
+\let\@aifORI\@afterindentfalse
+\def\bbl@serbiancindent{\let\@afterindentfalse\@afterindenttrue\@afterindenttrue}
+\def\bbl@nonserbiancindent{\let\@afterindentfalse\@aifORI\@afterindentfalse}
+\addto\extrasserbianc{\bbl@serbiancindent}
+\addto\noextrasserbianc{\bbl@nonserbiancindent}
+% \end{macrocode}
+%
+% We redefine the macro |\Alph|, which now produces (uppercase) Cyrillic letters instead of Latin
+% ones when Serbian is switched on.
+%
+% \begin{macrocode}
+\addto\extrasserbianc{
+\babel@save\@Alph
+\if@srbc@uni@ode
+ \def\@Alph#1{\ifcase#1\or
+ А\or Б\or В\or Г\or Д\or Ђ\or Е\or Ж\or З\or
+ И\or Ј\or К\or Л\or Љ\or М\or Н\or Њ\or О\or
+ П\or Р\or С\or Т\or Ћ\or У\or Ф\or Х\or Ц\or
+ Ч\or Џ\or Ш\else\@ctrerr\fi}
+\else
+ \def\@Alph#1{\ifcase#1\or
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRDJE\or\CYRE\or\CYRZH\or\CYRZ\or
+ \CYRI\or\CYRJE\or\CYRK\or\CYRL\or\CYRLJE\or\CYRM\or\CYRN\or\CYRNJE\or\CYRO\or
+ \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRTSHE\or\CYRU\or\CYRF\or\CYRH\or\CYRC\or
+ \CYRCH\or\CYRDZHE\or\CYRSH\else\@ctrerr\fi}
+\fi
+}
+% \end{macrocode}
+%
+% The macro |\alph| produces lowercase Cyrillic letters.
+%
+% \begin{macrocode}
+\addto\extrasserbianc{
+\babel@save\@alph
+\if@srbc@uni@ode
+ \def\@alph#1{\ifcase#1\or
+ а\or б\or в\or г\or д\or ђ\or е\or ж\or з\or
+ и\or ј\or к\or л\or љ\or м\or н\or њ\or о\or
+ п\or р\or с\or т\or ћ\or у\or ф\or х\or ц\or
+ ч\or џ\or ш\else\@ctrerr\fi}
+\else
+ \def\@alph#1{\ifcase#1\or
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyrdje\or\cyre\or\cyrzh\or\cyrz\or
+ \cyri\or\cyrje\or\cyrk\or\cyrl\or\cyrlje\or\cyrm\or\cyrn\or\cyrnje\or\cyro\or
+ \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyrtshe\or\cyru\or\cyrf\or\cyrh\or\cyrc\or
+ \cyrch\or\cyrdzhe\or\cyrsh\else\@ctrerr\fi}
+\fi
+}
+% \end{macrocode}
+%
+% An |ijekav| attribute changes the default behavior and activates an
+% alternative set of captions suitable for typesetting in ijekavian dialect.
+% The |quotes| attribute changes the |"'| shorthand to produce '' as closing quotation mark,
+% instead of the traditional `` quotation mark of Serbian language.
+% Also, the |datei| attribute will produce `јуни' and `јули' instead `јун' and `јул'
+% for date.
+%
+% \begin{macrocode}
+\bbl@declare@ttribute{serbianc}{ijekav}{%
+ \PackageInfo{babel}{Serbianc attribute set to ijekav}%
+ \let\captionsserbianc=\captionsserbianc@ijekav }
+\@onlypreamble\captionsserbianc@ijekav
+\bbl@declare@ttribute{serbianc}{quotes}{%
+ \PackageInfo{babel}{Serbianc attribute set to quotes}%
+ \declare@shorthand{serbianc}{"'}{\textquotedblright} }
+\bbl@declare@ttribute{serbianc}{datei}{%
+ \PackageInfo{babel}{Serbianc attribute set to datei}%
+ \let\dateserbianc=\dateserbianc@datei }
+\@onlypreamble\dateserbianc@datei
+% \end{macrocode}
+%
+% Some math functions in Serbian math books have other names:
+% e.g. |sinh| in Serbian is written as |sh| etc. So we define a
+% number of new math operators.
+%
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasserbianc{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+ }
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\arsh{\mathop{\operator@font arsh}\nolimits}
+\def\arch{\mathop{\operator@font arch}\nolimits}
+\def\arth{\mathop{\operator@font arth}\nolimits}
+\def\arcth{\mathop{\operator@font arcth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+\def\arcsec{\mathop{\operator@font arcsec}\nolimits}
+\def\arccosec{\mathop{\operator@font arccosec}\nolimits}
+\def\sech{\mathop{\operator@font sech}\nolimits}
+\def\cosech{\mathop{\operator@font cosech}\nolimits}
+\def\arsech{\mathop{\operator@font arsech}\nolimits}
+\def\arcosech{\mathop{\operator@font arcosech}\nolimits}
+\def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
+\def\Expect{\mathop{\kern\z@\mathsf{E}}\nolimits}
+\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
+\if@srbc@uni@ode
+ \def\nzs{\mathop{\mathrm{нзс}}\nolimits}
+ \def\nzd{\mathop{\mathrm{нзд}}\nolimits}
+ \def\NZS{\mathop{\mathrm{НЗС}}\nolimits}
+ \def\NZD{\mathop{\mathrm{НЗД}}\nolimits}
+\else
+ \def\nzs{\mathop{\textnormal{\cyrn\cyrz\cyrs}}\nolimits}
+ \def\nzd{\mathop{\textnormal{\cyrn\cyrz\cyrd}}\nolimits}
+ \def\NZS{\mathop{\textnormal{\CYRN\CYRZ\CYRS}}\nolimits}
+ \def\NZD{\mathop{\textnormal{\CYRN\CYRZ\CYRD}}\nolimits}
+\fi
+% \end{macrocode}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+%
+% \begin{macrocode}
+\ldf@finish{serbianc}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/serbianc/serbianc.ins b/macros/latex/contrib/babel-contrib/serbianc/serbianc.ins
new file mode 100644
index 0000000000..0ba9b6de47
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbianc/serbianc.ins
@@ -0,0 +1,134 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2019 Uroš Stefanović,
+%% 2002--2019 Filip Brčić
+%% All rights reserved.
+%%
+%% This file is intended to be used with the Babel system.
+%% ------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Uroš Stefanovic.
+%%
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2019/01/12}
+\def\batchfile{serbianc.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2019 Uroš Stefanović,
+2002--2019 Filip Brčić
+All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Uroš Stefanović.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2019 Uroš Stefanović,
+2002--2019 Filip Brčić
+All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Uroš Stefanović.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel/contrib}
+
+\usepreamble\mainpreamble
+\generate{\file{serbianc.ldf}{\from{serbianc.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/serbianc/serbianc.pdf b/macros/latex/contrib/babel-contrib/serbianc/serbianc.pdf
new file mode 100644
index 0000000000..810d77e36c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/serbianc/serbianc.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/slovak/slovak.dtx b/macros/latex/contrib/babel-contrib/slovak/slovak.dtx
new file mode 100644
index 0000000000..d2d0c00a79
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovak/slovak.dtx
@@ -0,0 +1,1310 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{1382}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{slovak.dtx}
+%</dtx>
+%<+code>\ProvidesLanguage{slovak}
+%\fi
+%\ProvidesFile{slovak.dtx}
+ [2008/07/06 v3.1a Slovak support from the babel system]
+%\iffalse
+%% File `slovak.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Slovak Language Definition File
+%% Copyright (C) 1989 - 2001
+%% by Jana Chlebikova
+% Department of Artificial Intelligence
+% Faculty of Mathematics and Physics
+% Mlynska dolina
+% 84215 Bratislava
+% Slovakia
+% (42)(7) 720003 l. 835
+% (42)(7) 725882
+% chlebikj at mff.uniba.cs (Internet)
+% and Johannes Braams, TeXniek
+%
+%% Copyright (C) 2002-2005
+%% by Tobias Schlemmer
+% Braunsdorfer Stra\ss e 101
+% 01159 Dresden
+% Deutschland
+% Tobias.Schlemmer at web.de
+%
+%% Copyright (C) 2005-2008
+%% by Petr Tesa\v r\'ik (babel at tesarici.cz)
+%
+% This file is also based on CSLaTeX
+% by Ji\v r\'i Zlatu\v ska, Zden\v ek Wagner,
+% Jaroslav \v Snajdr and Petr Ol\v s\'ak.
+%
+%% Please report errors to: Petr Tesa\v r\'ik
+%% babel at tesarici.cz
+%
+% This file is part of the babel system, it provides the source
+% code for the Slovak language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{slovak.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \def\CS{$\cal C\kern-.1667em
+% \lower.5ex\hbox{$\cal S$}\kern-.075em$}
+%
+% \GetFileInfo{slovak.dtx}
+%
+% \changes{slovak-1.0}{1992/07/15}{First version}
+% \changes{slovak-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{slovak-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{slovak-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{slovak-1.3a}{2004/02/20}{Added contributed shorthand
+% definitions}
+% \changes{slovak-3.0}{2005/09/10}{Implemented the functionality of
+% \CS\LaTeX's slovak.sty. The version number was bumped to 3.0
+% to minimize confusion by being higher than the last version
+% of \CS\LaTeX.}
+%
+% \section{The Slovak language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was originally written by Jana Chlebikova
+% (\texttt{chlebik@euromath.dk}) and modified by Tobias Schlemmer
+% (\texttt{Tobias.Schlemmer@web.de}). It was then rewritten by
+% Petr Tesa\v r\'ik (\texttt{babel@tesarici.cz}).} defines all the
+% language-specific macros for the Slovak language.
+%
+% For this language the macro |\q| is defined. It was used with the
+% letters (\texttt{t}, \texttt{d}, \texttt{l}, and \texttt{L}) and
+% adds a \texttt{'} to them to simulate a `hook' that should be
+% there. The result looks like t\kern-2pt\char'47. Since the the T1
+% font encoding has the corresponding characters it is mapped to |\v|.
+% Therefore we recommend using T1 font encoding. If you don't want to
+% use this encoding, please, feel free to redefine |\q| in your file.
+% I think babel will honour this |;-)|.
+%
+% For this language the characters |"|, |'| and |^| are made
+% active. In table~\ref{tab:slovak-quote} an overview is given of
+% its purpose. Also the vertical placement of the
+% umlaut can be controlled this way.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & |\"a|, also implemented for the other
+% lowercase and uppercase vowels. \\
+% |^d| & |\q d|, also implemented for l, t and L. \\
+% |^c| & |\v c|, also implemented for C, D, N, n, T, Z and z. \\
+% |^o| & |\^o|, also implemented for O. \\
+% |'a| & |\'a|, also implemented for the other lowercase and
+% uppercase l, r, y and vowels. \\
+% \verb="|= & disable ligature at this position. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"~| & for a compound word mark without a breakpoint. \\
+% |"=| & for a compound word mark with a breakpoint, allowing
+% hyphenation in the composing words. \\
+% |"`| & for German left double quotes (looks like ,,). \\
+% |"'| & for German right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$). \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{slovak.ldf}}\label{tab:slovak-quote}
+% \end{center}
+% \end{table}
+%
+% The quotes in table~\ref{tab:slovak-quote} can also be typeset by
+% using the commands in table~\ref{tab:smore-quote}.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |\glqq| & for German left double quotes (looks like ,,). \\
+% |\grqq| & for German right double quotes (looks like ``). \\
+% |\glq| & for German left single quotes (looks like ,). \\
+% |\grq| & for German right single quotes (looks like `). \\
+% |\flqq| & for French left double quotes (similar to $<<$). \\
+% |\frqq| & for French right double quotes (similar to $>>$).\\
+% |\flq| & for (French) left single quotes (similar to $<$). \\
+% |\frq| & for (French) right single quotes (similar to $>$). \\
+% |\dq| & the original quotes character (|"|). \\
+% |\sq| & the original single quote (|'|). \\
+% \end{tabular}
+% \caption{More commands which produce quotes, defined
+% by \file{slovak.ldf}}\label{tab:smore-quote}
+% \end{center}
+% \end{table}
+%
+% \subsection{Compatibility}
+%
+% Great care has been taken to ensure backward compatibility with
+% \CS\LaTeX. In particular, documents which load this file with
+% |\usepackage{slovak}| should produce identical output with no
+% modifications to the source. Additionally, all the \CS\LaTeX{}
+% options are recognized:
+%
+% \label{tab:slovak-options}
+% \begin{list}{}
+% {\def\makelabel#1{\sbox0{\Lopt{#1}}%
+% \ifdim\wd0>\labelwidth
+% \setbox0\vbox{\box0\hbox{}} \wd0=0pt \fi
+% \box0\hfil}
+% \setlength{\labelwidth}{2\parindent}
+% \setlength{\leftmargin}{2\parindent}
+% \setlength{\rightmargin}{\parindent}}
+% \item[IL2, T1, OT1]
+% These options set the default font encoding. Please note
+% that their use is deprecated. You should use the |fontenc|
+% package to select font encoding.
+%
+% \item[split, nosplit]
+% These options control whether hyphenated words are
+% automatically split according to Slovak typesetting rules.
+% With the \Lopt{split} option ``je-li'' is hyphenated as
+% ``je-/-li''. The \Lopt{nosplit} option disables this behavior.
+%
+% The use of this option is strongly discouraged, as it breaks
+% too many common things---hyphens cannot be used in labels,
+% negative arguments to \TeX{} primitives will not work in
+% horizontal mode (use \cs{minus} as a workaround), and there are
+% a few other peculiarities with using this mode.
+%
+% \item[nocaptions]
+%
+% This option was used in \CS\LaTeX{} to set up Czech/Slovak
+% typesetting rules, but leave the original captions and dates.
+% The recommended way to achieve this is to use English as the main
+% language of the document and use the environment |otherlanguage*|
+% for Czech text.
+%
+% \item[olduv]
+% There are two version of \cs{uv}. The older one allows the use
+% of \cs{verb} inside the quotes but breaks any respective kerning
+% with the quotes (like that in \CS{} fonts). The newer one honors
+% the kerning in the font but does not allow \cs{verb} inside the
+% quotes.
+%
+% The new version is used by default in \LaTeXe{} and the old version
+% is used with plain \TeX. You may use \Lopt{olduv} to override the
+% default in \LaTeXe.
+%
+% \item[cstex]
+% This option was used to include the commands \cs{csprimeson} and
+% \cs{csprimesoff}. Since these commands are always included now,
+% it has been removed and the empty definition lasts for compatibility.
+% \end{list}
+%
+% \StopEventually{}
+%
+% \subsection{Implementation}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{slovak-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{slovak} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@slovak| to see whether we have to do something here.
+%
+% \changes{slovak-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@slovak\@undefined
+ \@nopatterns{Slovak}
+ \adddialect\l@slovak0\fi
+% \end{macrocode}
+%
+% We need to define these macros early in the process.
+%
+% \begin{macrocode}
+\def\cs@iltw@{IL2}
+\newif\ifcs@splithyphens
+\cs@splithyphensfalse
+% \end{macrocode}
+%
+% If Babel is not loaded, we provide compatibility with \CS\LaTeX.
+% However, if macro \cs{@ifpackageloaded} is not defined, we assume
+% to be loaded from plain and provide compatibility with csplain.
+% Of course, this does not work well with \LaTeX$\:$2.09, but I
+% doubt anyone will ever want to use this file with \LaTeX$\:$2.09.
+%
+% \begin{macrocode}
+\ifx\@ifpackageloaded\@undefined
+ \let\cs@compat@plain\relax
+ \message{csplain compatibility mode}
+\else
+ \@ifpackageloaded{babel}{}{%
+ \let\cs@compat@latex\relax
+ \message{cslatex compatibility mode}}
+\fi
+\ifx\cs@compat@latex\relax
+ \ProvidesPackage{slovak}[2008/07/06 v3.1a CSTeX Slovak style]
+% \end{macrocode}
+%
+% Declare \CS\LaTeX{} options (see also the descriptions on page
+% \pageref{tab:slovak-options}).
+%
+% \begin{macrocode}
+ \DeclareOption{IL2}{\def\encodingdefault{IL2}}
+ \DeclareOption {T1}{\def\encodingdefault {T1}}
+ \DeclareOption{OT1}{\def\encodingdefault{OT1}}
+ \DeclareOption{nosplit}{\cs@splithyphensfalse}
+ \DeclareOption{split}{\cs@splithyphenstrue}
+ \DeclareOption{nocaptions}{\let\cs@nocaptions=\relax}
+ \DeclareOption{olduv}{\let\cs@olduv=\relax}
+ \DeclareOption{cstex}{\relax}
+% \end{macrocode}
+%
+% Make |IL2| encoding the default. This can be overriden with
+% the other font encoding options.
+% \begin{macrocode}
+ \ExecuteOptions{\cs@iltw@}
+% \end{macrocode}
+%
+% Now, process the user-supplied options.
+% \begin{macrocode}
+ \ProcessOptions
+% \end{macrocode}
+%
+% Standard \LaTeXe{} does not include the IL2 encoding in the format.
+% The encoding can be loaded later using the fontenc package, but
+% \CS\LaTeX{} included IL2 by default. This means existing documents
+% for \CS\LaTeX{} do not load that package, so load the encoding
+% ourselves in compatibility mode.
+%
+% \begin{macrocode}
+ \ifx\encodingdefault\cs@iltw@
+ \input il2enc.def
+ \fi
+% \end{macrocode}
+%
+% Restore the definition of \cs{CurrentOption}, clobbered by processing
+% the options.
+%
+% \begin{macrocode}
+ \def\CurrentOption{slovak}
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Slovak language.
+%
+% \begin{macro}{\captionsslovak}
+% The macro \cs{captionsslovak} defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{slovak-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{slovak-1.2k}{1999/02/28}{Repaired a few spelling mistakes}
+% \changes{slovak-1.2l}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{slovak-3.0}{2005/12/22}{Updated some translations. Former
+% translations were: `\'Uvod' for \cs{prefacename}, `Referencie' for
+% \cs{refname}, `Index' for \cs{indexname}, `Obr\'azok' for
+% \cs{figurename}, `Pr\'ilohy' for \cs{enclname}, `CC' for \cs{ccname},
+% `Komu' for \cs{headtoname}, `Strana' for \cs{pagename}}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Predhovor}%
+ \def\refname{Literat\'ura}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literat\'ura}%
+ \def\chaptername{Kapitola}%
+ \def\appendixname{Dodatok}%
+ \def\contentsname{Obsah}%
+ \def\listfigurename{Zoznam obr\'azkov}%
+ \def\listtablename{Zoznam tabuliek}%
+ \def\indexname{Register}%
+ \def\figurename{Obr.}%
+ \def\tablename{Tabu\v{l}ka}%
+ \def\partname{\v{C}as\v{t}}%
+ \def\enclname{Pr\'{\i}loha}%
+ \def\ccname{cc.}%
+ \def\headtoname{Pre}%
+ \def\pagename{Str.}%
+ \def\seename{vi\v{d}}%
+ \def\alsoname{vi\v{d} tie\v{z}}%
+ \def\proofname{D\^okaz}%
+ \def\glossaryname{Slovn\'{\i}k}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateslovak}
+% The macro \cs{dateslovak} redefines the command \cs{today}
+% to produce Slovak dates.
+% \changes{slovak-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{slovak-1.2j}{1998/03/28}{use \cs{def} instead of \cs{edef}}
+% \changes{slovak-1.2k}{1999/02/28}{Repaired a spelling mistake}
+% \begin{macrocode}
+\@namedef{date\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ janu\'ara\or febru\'ara\or marca\or apr\'{\i}la\or m\'aja\or
+ j\'una\or j\'ula\or augusta\or septembra\or okt\'obra\or
+ novembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasslovak}
+% \begin{macro}{\noextrasslovak}
+% The macro \cs{extrasslovak} will perform all the extra definitions
+% needed for the Slovak language. The macro \cs{noextrasslovak} is
+% used to cancel the actions of \cs{extrasslovak}.
+%
+% For Slovak texts \cs{frenchspacing} should be in effect. Language
+% group for shorthands is also set here.
+% \changes{slovak-3.0}{1995/04/21}{now use \cs{bbl@frenchspacing} and
+% \cs{bbl@nonfrenchspacing}}
+% \changes{slovak-3.1}{2006/10/07}{move \cs{languageshorthands} here,
+% so that the language group is always initialized correctly}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@frenchspacing
+ \languageshorthands{slovak}}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \changes{slovak-1.2e}{1995/05/28}{Use \LaTeX's \cs{v} accent
+% command}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\q\let\q\v}
+% \end{macrocode}
+%
+% For Slovak three characters are used to define shorthands, they
+% need to be made active.
+% \changes{slovak-1.3a}{2004/02/20}{Make three characters available
+% for shorthands}
+% \begin{macrocode}
+\ifx\cs@compat@latex\relax\else
+ \initiate@active@char{^}
+ \addto\extrasslovak{\bbl@activate{^}}
+ \addto\noextrasslovak{\bbl@deactivate{^}}
+ \initiate@active@char{"}
+ \addto\extrasslovak{\bbl@activate{"}\umlautlow}
+ \addto\noextrasslovak{\bbl@deactivate{"}\umlauthigh}
+ \initiate@active@char{'}
+ \@ifpackagewith{babel}{activeacute}{%
+ \addto\extrasslovak{\bbl@activate{'}}
+ \addto\noextrasslovak{\bbl@deactivate{'}}%
+ }{}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sq}
+% \begin{macro}{\dq}
+% We save the original single and double quote characters in
+% \cs{sq} and \cs{dq} to make them available later. The math
+% accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup\catcode`\"=12\catcode`\'=12
+\def\x{\endgroup
+ \def\sq{'}
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{slovak-1.2b}{1994/06/04}{Added setting of left- and
+% righthyphenmin}
+%
+% The slovak hyphenation patterns should be used with
+% |\lefthyphenmin| set to~2 and |\righthyphenmin| set to~3.
+% \changes{slovak-1.2e}{1995/05/28}{Now use \cs{slovakhyphenmins}}
+% \changes{slovak-1.2l}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \changes{slovak-3.0}{2005/12/22}{Changed default \cs{righthyphenmin}
+% to 3 characters.}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+%
+% In order to prevent problems with the active |^| we add a
+% shorthand on system level which expands to a `normal |^|.
+% \begin{macrocode}
+\ifx\cs@compat@latex\relax\else
+ \declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}
+% \end{macrocode}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \begin{macrocode}
+ \declare@shorthand{slovak}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+ \declare@shorthand{slovak}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+ \declare@shorthand{slovak}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
+ \declare@shorthand{slovak}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+ \declare@shorthand{slovak}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+ \declare@shorthand{slovak}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+ \declare@shorthand{slovak}{"e}{\textormath{\"{e}\allowhyphens}{\ddot e}}
+ \declare@shorthand{slovak}{"E}{\textormath{\"{E}\allowhyphens}{\ddot E}}
+ \declare@shorthand{slovak}{"i}{\textormath{\"{\i}\allowhyphens}%
+ {\ddot\imath}}
+ \declare@shorthand{slovak}{"I}{\textormath{\"{I}\allowhyphens}{\ddot I}}
+% \end{macrocode}
+% other slovak characters
+% \begin{macrocode}
+ \declare@shorthand{slovak}{^c}{\textormath{\v{c}\allowhyphens}{\check{c}}}
+ \declare@shorthand{slovak}{^d}{\textormath{\q{d}\allowhyphens}{\check{d}}}
+ \declare@shorthand{slovak}{^l}{\textormath{\q{l}\allowhyphens}{\check{l}}}
+ \declare@shorthand{slovak}{^n}{\textormath{\v{n}\allowhyphens}{\check{n}}}
+ \declare@shorthand{slovak}{^o}{\textormath{\^{o}\allowhyphens}{\hat{o}}}
+ \declare@shorthand{slovak}{^s}{\textormath{\v{s}\allowhyphens}{\check{s}}}
+ \declare@shorthand{slovak}{^t}{\textormath{\q{t}\allowhyphens}{\check{t}}}
+ \declare@shorthand{slovak}{^z}{\textormath{\v{z}\allowhyphens}{\check{z}}}
+ \declare@shorthand{slovak}{^C}{\textormath{\v{C}\allowhyphens}{\check{C}}}
+ \declare@shorthand{slovak}{^D}{\textormath{\v{D}\allowhyphens}{\check{D}}}
+ \declare@shorthand{slovak}{^L}{\textormath{\q{L}\allowhyphens}{\check{L}}}
+ \declare@shorthand{slovak}{^N}{\textormath{\v{N}\allowhyphens}{\check{N}}}
+ \declare@shorthand{slovak}{^O}{\textormath{\^{O}\allowhyphens}{\hat{O}}}
+ \declare@shorthand{slovak}{^S}{\textormath{\v{S}\allowhyphens}{\check{S}}}
+ \declare@shorthand{slovak}{^T}{\textormath{\v{T}\allowhyphens}{\check{T}}}
+ \declare@shorthand{slovak}{^Z}{\textormath{\v{Z}\allowhyphens}{\check{Z}}}
+% \end{macrocode}
+% acute accents,
+% \begin{macrocode}
+ \@ifpackagewith{babel}{activeacute}{%
+ \declare@shorthand{slovak}{'a}{\textormath{\'a\allowhyphens}{^{\prime}a}}
+ \declare@shorthand{slovak}{'e}{\textormath{\'e\allowhyphens}{^{\prime}e}}
+ \declare@shorthand{slovak}{'i}{\textormath{\'\i{}\allowhyphens}{^{\prime}i}}
+ \declare@shorthand{slovak}{'l}{\textormath{\'l\allowhyphens}{^{\prime}l}}
+ \declare@shorthand{slovak}{'o}{\textormath{\'o\allowhyphens}{^{\prime}o}}
+ \declare@shorthand{slovak}{'r}{\textormath{\'r\allowhyphens}{^{\prime}r}}
+ \declare@shorthand{slovak}{'u}{\textormath{\'u\allowhyphens}{^{\prime}u}}
+ \declare@shorthand{slovak}{'y}{\textormath{\'y\allowhyphens}{^{\prime}y}}
+ \declare@shorthand{slovak}{'A}{\textormath{\'A\allowhyphens}{^{\prime}A}}
+ \declare@shorthand{slovak}{'E}{\textormath{\'E\allowhyphens}{^{\prime}E}}
+ \declare@shorthand{slovak}{'I}{\textormath{\'I\allowhyphens}{^{\prime}I}}
+ \declare@shorthand{slovak}{'L}{\textormath{\'L\allowhyphens}{^{\prime}l}}
+ \declare@shorthand{slovak}{'O}{\textormath{\'O\allowhyphens}{^{\prime}O}}
+ \declare@shorthand{slovak}{'R}{\textormath{\'R\allowhyphens}{^{\prime}R}}
+ \declare@shorthand{slovak}{'U}{\textormath{\'U\allowhyphens}{^{\prime}U}}
+ \declare@shorthand{slovak}{'Y}{\textormath{\'Y\allowhyphens}{^{\prime}Y}}
+ \declare@shorthand{slovak}{''}{%
+ \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ }{}
+ % \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+ \declare@shorthand{slovak}{"-}{\nobreak\-\bbl@allowhyphens}
+ \declare@shorthand{slovak}{"|}{%
+ \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+ \declare@shorthand{slovak}{""}{\hskip\z@skip}
+ \declare@shorthand{slovak}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+ \declare@shorthand{slovak}{"=}{\cs@splithyphen}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\v}
+% \LaTeX's normal |\v| accent places a caron over the letter that
+% follows it (\v{o}). This is not what we want for the letters d,
+% t, l and L; for those the accent should change shape. This is
+% acheived by the following.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareTextCompositeCommand{\v}{OT1}{t}{%
+ t\kern-.23em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{d}{%
+ d\kern-.13em\raise.24ex\hbox{'}}
+ \DeclareTextCompositeCommand{\v}{OT1}{l}{\lcaron{}}
+ \DeclareTextCompositeCommand{\v}{OT1}{L}{\Lcaron{}}}
+% \end{macrocode}
+%
+% \begin{macro}{\lcaron}
+% \begin{macro}{\Lcaron}
+% For the letters \texttt{l} and \texttt{L} we want to disinguish
+% between normal fonts and monospaced fonts.
+% \begin{macrocode}
+\def\lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ l\kern-.13em\raise.24ex\hbox{'}\kern-.11em%
+ \else
+ l\raise.45ex\hbox to\z@{\kern-.35em '\hss}%
+ \fi}
+\def\Lcaron{%
+ \setbox0\hbox{M}\setbox\tw@\hbox{i}%
+ \ifdim\wd0>\wd\tw@\relax
+ L\raise.24ex\hbox to\z@{\kern-.28em'\hss}%
+ \else
+ L\raise.45ex\hbox to\z@{\kern-.40em '\hss}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Initialize active quotes. \CS\LaTeX{} provides a way of
+% converting English-style quotes into Slovak-style ones. Both
+% single and double quotes are affected, i.e. |``text''| is
+% converted to something like |,,text``| and |`text'| is converted
+% to |,text`|. This conversion can be switched on and off with
+% \cs{csprimeson} and \cs{csprimesoff}.\footnote{By the way, the
+% names of these macros are misleading, because the handling of
+% primes in math mode is rather marginal, the most important thing
+% being the handling of quotes\ldots}
+%
+% These quotes present various troubles, e.g. the kerning is broken,
+% apostrophes are converted to closing single quote, some primitives
+% are broken (most notably the |\catcode`\|\meta{char} syntax will
+% not work any more), and writing them to \file{.aux} files cannot
+% be handled correctly. For these reasons, these commands are only
+% available in \CS\LaTeX{} compatibility mode.
+%
+% \begin{macrocode}
+\ifx\cs@compat@latex\relax
+ \let\cs@ltxprim@s\prim@s
+ \def\csprimeson{%
+ \catcode``\active \catcode`'\active \let\prim@s\bbl@prim@s}
+ \def\csprimesoff{%
+ \catcode``12 \catcode`'12 \let\prim@s\cs@ltxprim@s}
+ \begingroup\catcode``\active
+ \def\x{\endgroup
+ \def`{\futurelet\cs@next\cs@openquote}
+ \def\cs@openquote{%
+ \ifx`\cs@next \expandafter\cs@opendq
+ \else \expandafter\clq
+ \fi}%
+ }\x
+ \begingroup\catcode`'\active
+ \def\x{\endgroup
+ \def'{\textormath{\futurelet\cs@next\cs@closequote}
+ {^\bgroup\prim@s}}
+ \def\cs@closequote{%
+ \ifx'\cs@next \expandafter\cs@closedq
+ \else \expandafter\crq
+ \fi}%
+ }\x
+ \def\cs@opendq{\clqq\let\cs@next= }
+ \def\cs@closedq{\crqq\let\cs@next= }
+% \end{macrocode}
+%
+% The way I recommend for typesetting quotes in Slovak documents
+% is to use shorthands similar to those used in German.
+%
+% \changes{3.0}{2006/04/21}{|"`| and |"'| changed from German quotes
+% to Slovak quotes}
+% \begin{macrocode}
+\else
+ \declare@shorthand{slovak}{"`}{\clqq}
+ \declare@shorthand{slovak}{"'}{\crqq}
+ \declare@shorthand{slovak}{"<}{\flqq}
+ \declare@shorthand{slovak}{">}{\frqq}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\clqq}
+% This is the CS opening quote, which is similar to the German
+% quote (\cs{glqq}) but the kerning is different.
+%
+% For the OT1 encoding, the quote is constructed from the right
+% double quote (i.e. the ``Opening quotes'' character) by moving
+% it down to the baseline and shifting it to the right, or to the
+% left if italic correction is positive.
+%
+% For T1, the ``German Opening quotes'' is used. It is moved to
+% the right and the total width is enlarged. This is done in an
+% attempt to minimize the difference between the OT1 and T1
+% versions.
+%
+% \changes{3.0}{2006/04/20}{Added \cs{leavevmode} to allow an opening
+% quote at the beginning of a paragraph}
+% \begin{macrocode}
+\ProvideTextCommand{\clqq}{OT1}{%
+ \set@low@box{\textquotedblright}%
+ \setbox\@ne=\hbox{l\/}\dimen\@ne=\wd\@ne
+ \setbox\@ne=\hbox{l}\advance\dimen\@ne-\wd\@ne
+ \leavevmode
+ \ifdim\dimen\@ne>\z@\kern-.1em\box\z@\kern.1em
+ \else\kern.1em\box\z@\kern-.1em\fi\allowhyphens}
+\ProvideTextCommand{\clqq}{T1}
+ {\kern.1em\quotedblbase\kern-.0158em\relax}
+\ProvideTextCommandDefault{\clqq}{\UseTextSymbol{OT1}\clqq}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\crqq}
+% For OT1, the CS closing quote is basically the same as
+% \cs{grqq}, only the \cs{textormath} macro is not used, because
+% as far as I know, \cs{grqq} does not work in math mode anyway.
+%
+% For T1, the character is slightly wider and shifted to the
+% right to match its OT1 counterpart.
+%
+% \begin{macrocode}
+\ProvideTextCommand{\crqq}{OT1}
+ {\save@sf@q{\nobreak\kern-.07em\textquotedblleft\kern.07em}}
+\ProvideTextCommand{\crqq}{T1}
+ {\save@sf@q{\nobreak\kern.06em\textquotedblleft\kern.024em}}
+\ProvideTextCommandDefault{\crqq}{\UseTextSymbol{OT1}\crqq}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clq}
+% \begin{macro}{\crq}
+%
+% Single CS quotes are similar to double quotes (see the
+% discussion above).
+%
+% \begin{macrocode}
+\ProvideTextCommand{\clq}{OT1}
+ {\set@low@box{\textquoteright}\box\z@\kern.04em\allowhyphens}
+\ProvideTextCommand{\clq}{T1}
+ {\quotesinglbase\kern-.0428em\relax}
+\ProvideTextCommandDefault{\clq}{\UseTextSymbol{OT1}\clq}
+\ProvideTextCommand{\crq}{OT1}
+ {\save@sf@q{\nobreak\textquoteleft\kern.17em}}
+\ProvideTextCommand{\crq}{T1}
+ {\save@sf@q{\nobreak\textquoteleft\kern.17em}}
+\ProvideTextCommandDefault{\crq}{\UseTextSymbol{OT1}\crq}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\uv}
+% There are two versions of \cs{uv}. The older one opens a group
+% and uses \cs{aftergroup} to typeset the closing quotes. This
+% version allows using \cs{verb} inside the quotes, because the
+% enclosed text is not passed as an argument, but unfortunately
+% it breaks any kerning with the quotes. Although the kerning
+% with the opening quote could be fixed, the kerning with the
+% closing quote cannot.
+%
+% The newer version is defined as a command with one parameter.
+% It preserves kerning but since the quoted text is passed as an
+% argument, it cannot contain \cs{verb}.
+%
+% Decide which version of \cs{uv} should be used. For sake
+% of compatibility, we use the older version with plain \TeX{}
+% and the newer version with \LaTeXe.
+% \begin{macrocode}
+\ifx\cs@compat@plain\@undefined\else\let\cs@olduv=\relax\fi
+\ifx\cs@olduv\@undefined
+ \DeclareRobustCommand\uv[1]{{\leavevmode\clqq#1\crqq}}
+\else
+ \DeclareRobustCommand\uv{\bgroup\aftergroup\closequotes
+ \leavevmode\clqq\let\cs@next=}
+ \def\closequotes{\unskip\crqq\relax}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@wordlen}
+% Declare a counter to hold the length of the word after the
+% hyphen.
+%
+% \begin{macrocode}
+\newcount\cs@wordlen
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@hyphen}
+% \begin{macro}{\cs@endash}
+% \begin{macro}{\cs@emdash}
+% Store the original hyphen in a macro. Ditto for the ligatures.
+%
+% \changes{slovak-3.1}{2006/10/07}{ensure correct catcode for the
+% saved hyphen}
+% \begin{macrocode}
+\begingroup\catcode`\-12
+\def\x{\endgroup
+ \def\cs@hyphen{-}
+ \def\cs@endash{--}
+ \def\cs@emdash{---}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@boxhyphen}
+% Provide a non-breakable hyphen to be used when a compound word
+% is too short to be split, i.e. the second part is shorter than
+% \cs{righthyphenmin}.
+%
+% \begin{macrocode}
+ \def\cs@boxhyphen{\hbox{-}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@splithyphen}
+% The macro \cs{cs@splithyphen} inserts a split hyphen, while
+% allowing both parts of the compound word to be hyphenated at
+% other places too.
+%
+% \begin{macrocode}
+ \def\cs@splithyphen{\kern\z@
+ \discretionary{-}{\char\hyphenchar\the\font}{-}\nobreak\hskip\z@}
+}\x
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{-}
+% To minimize the effects of activating the hyphen character,
+% the active definition expands to the non-active character
+% in all cases where hyphenation cannot occur, i.e. if not
+% typesetting (check \cs{protect}), not in horizontal mode,
+% or in inner horizontal mode.
+%
+% \begin{macrocode}
+\initiate@active@char{-}
+\declare@shorthand{slovak}{-}{%
+ \ifx\protect\@typeset@protect
+ \ifhmode
+ \ifinner
+ \bbl@afterelse\bbl@afterelse\bbl@afterelse\cs@hyphen
+ \else
+ \bbl@afterfi\bbl@afterelse\bbl@afterelse\cs@firsthyphen
+ \fi
+ \else
+ \bbl@afterfi\bbl@afterelse\cs@hyphen
+ \fi
+ \else
+ \bbl@afterfi\cs@hyphen
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@firsthyphen}
+% \begin{macro}{\cs@firsthyph@n}
+% \begin{macro}{\cs@secondhyphen}
+% \begin{macro}{\cs@secondhyph@n}
+% If we encounter a hyphen, check whether it is followed
+% by a second or a third hyphen and if so, insert the
+% corresponding ligature.
+%
+% If we don't find a hyphen, the token found will be placed
+% in \cs{cs@token} for further analysis, and it will also stay
+% in the input.
+%
+% \begin{macrocode}
+\begingroup\catcode`\-\active
+\def\x{\endgroup
+ \def\cs@firsthyphen{\futurelet\cs@token\cs@firsthyph@n}
+ \def\cs@firsthyph@n{%
+ \ifx -\cs@token
+ \bbl@afterelse\cs@secondhyphen
+ \else
+ \bbl@afterfi\cs@checkhyphen
+ \fi}
+ \def\cs@secondhyphen ##1{%
+ \futurelet\cs@token\cs@secondhyph@n}
+ \def\cs@secondhyph@n{%
+ \ifx -\cs@token
+ \bbl@afterelse\cs@emdash\@gobble
+ \else
+ \bbl@afterfi\cs@endash
+ \fi}
+}\x
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkhyphen}
+% Check that hyphenation is enabled, and if so, start analyzing
+% the rest of the word, i.e. initialize \cs{cs@word} and \cs{cs@wordlen}
+% and start processing input with \cs{cs@scanword}.
+%
+% \begin{macrocode}
+\def\cs@checkhyphen{%
+ \ifnum\expandafter\hyphenchar\the\font=`\-
+ \def\cs@word{}\cs@wordlen\z@
+ \bbl@afterelse\cs@scanword
+ \else
+ \cs@hyphen
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@scanword}
+% \begin{macro}{\cs@continuescan}
+% \begin{macro}{\cs@gettoken}
+% \begin{macro}{\cs@gett@ken}
+% Each token is first analyzed with \cs{cs@scanword}, which expands
+% the token and passes the first token of the result to
+% \cs{cs@gett@ken}. If the expanded token is not identical to the
+% unexpanded one, presume that it might be expanded further and
+% pass it back to \cs{cs@scanword} until you get an unexpandable
+% token. Then analyze it in \cs{cs@examinetoken}.
+%
+% The \cs{cs@continuescan} macro does the same thing as
+% \cs{cs@scanword}, but it does not require the first token to be
+% in \cs{cs@token} already.
+%
+% \begin{macrocode}
+\def\cs@scanword{\let\cs@lasttoken= \cs@token\expandafter\cs@gettoken}
+\def\cs@continuescan{\let\cs@lasttoken\@undefined\expandafter\cs@gettoken}
+\def\cs@gettoken{\futurelet\cs@token\cs@gett@ken}
+\def\cs@gett@ken{%
+ \ifx\cs@token\cs@lasttoken \def\cs@next{\cs@examinetoken}%
+ \else \def\cs@next{\cs@scanword}%
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{cs@examinetoken}
+% Examine the token in \cs{cs@token}:
+%
+% \begin{itemize}
+% \item
+% If it is a letter (catcode 11) or other (catcode 12), add it
+% to \cs{cs@word} with \cs{cs@addparam}.
+%
+% \item
+% If it is the \cs{char} primitive, add it with \cs{cs@expandchar}.
+%
+% \item
+% If the token starts or ends a group, ignore it with
+% \cs{cs@ignoretoken}.
+%
+% \item
+% Otherwise analyze the meaning of the token with
+% \cs{cs@checkchardef} to detect primitives defined with
+% \cs{chardef}.
+%
+% \end{itemize}
+%
+% \begin{macrocode}
+\def\cs@examinetoken{%
+ \ifcat A\cs@token
+ \def\cs@next{\cs@addparam}%
+ \else\ifcat 0\cs@token
+ \def\cs@next{\cs@addparam}%
+ \else\ifx\char\cs@token
+ \def\cs@next{\afterassignment\cs@expandchar\let\cs@token= }%
+ \else\ifx\bgroup\cs@token
+ \def\cs@next{\cs@ignoretoken\bgroup}%
+ \else\ifx\egroup\cs@token
+ \def\cs@next{\cs@ignoretoken\egroup}%
+ \else\ifx\begingroup\cs@token
+ \def\cs@next{\cs@ignoretoken\begingroup}%
+ \else\ifx\endgroup\cs@token
+ \def\cs@next{\cs@ignoretoken\endgroup}%
+ \else
+ \def\cs@next{\expandafter\expandafter\expandafter\cs@checkchardef
+ \expandafter\meaning\expandafter\cs@token\string\char\end}%
+ \fi\fi\fi\fi\fi\fi\fi\cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkchardef}
+% Check the meaning of a token and if it is a primitive defined
+% with \cs{chardef}, pass it to \cs{\cs@examinechar} as if it were
+% a \cs{char} sequence. Otherwise, there are no more word characters,
+% so do the final actions in \cs{cs@nosplit}.
+%
+% \begin{macrocode}
+\expandafter\def\expandafter\cs@checkchardef
+ \expandafter#\expandafter1\string\char#2\end{%
+ \def\cs@token{#1}%
+ \ifx\cs@token\@empty
+ \def\cs@next{\afterassignment\cs@examinechar\let\cs@token= }%
+ \else
+ \def\cs@next{\cs@nosplit}%
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@ignoretoken}
+% Add a token to \cs{cs@word} but do not update the \cs{cs@wordlen}
+% counter. This is mainly useful for group starting and ending
+% primitives, which need to be preserved, but do not affect the word
+% boundary.
+%
+% \begin{macrocode}
+\def\cs@ignoretoken#1{%
+ \edef\cs@word{\cs@word#1}%
+ \afterassignment\cs@continuescan\let\cs@token= }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{cs@addparam}
+% Add a token to \cs{cs@word} and check its lccode. Note that
+% this macro can only be used for tokens which can be passed as
+% a parameter.
+%
+% \begin{macrocode}
+\def\cs@addparam#1{%
+ \edef\cs@word{\cs@word#1}%
+ \cs@checkcode{\lccode`#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@expandchar}
+% \begin{macro}{\cs@examinechar}
+% Add a \cs{char} sequence to \cs{cs@word} and check its lccode.
+% The charcode is first parsed in \cs{cs@expandchar} and then the
+% resulting \cs{chardef}-defined sequence is analyzed in
+% \cs{cs@examinechar}.
+%
+% \begin{macrocode}
+\def\cs@expandchar{\afterassignment\cs@examinechar\chardef\cs@token=}
+\def\cs@examinechar{%
+ \edef\cs@word{\cs@word\char\the\cs@token\space}%
+ \cs@checkcode{\lccode\cs@token}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@checkcode}
+% Check the lccode of a character. If it is zero, it does not count
+% to the current word, so finish it with \cs{cs@nosplit}. Otherwise
+% update the \cs{cs@wordlen} counter and go on scanning the word
+% with \cs{cs@continuescan}. When enough characters are gathered in
+% \cs{cs@word} to allow word break, insert the split hyphen and
+% finish.
+%
+% \begin{macrocode}
+\def\cs@checkcode#1{%
+ \ifnum0=#1
+ \def\cs@next{\cs@nosplit}%
+ \else
+ \advance\cs@wordlen\@ne
+ \ifnum\righthyphenmin>\the\cs@wordlen
+ \def\cs@next{\cs@continuescan}%
+ \else
+ \cs@splithyphen
+ \def\cs@next{\cs@word}%
+ \fi
+ \fi \cs@next}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@nosplit}
+% Insert a non-breakable hyphen followed by the saved word.
+%
+% \begin{macrocode}
+\def\cs@nosplit{\cs@boxhyphen\cs@word}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@hyphen}
+% The \cs{minus} sequence can be used where the active hyphen
+% does not work, e.g. in arguments to \TeX{} primitives in outer
+% horizontal mode.
+%
+% \begin{macrocode}
+\let\minus\cs@hyphen
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\standardhyphens}
+% \begin{macro}{\splithyphens}
+% These macros control whether split hyphens are allowed in Czech
+% and/or Slovak texts. You may use them in any language, but the
+% split hyphen is only activated for Czech and Slovak.
+%
+% \changes{slovak-3.1}{2006/10/07}{activate with split hyphens and
+% deactivate with standard hyphens, not vice versa}
+% \begin{macrocode}
+\def\standardhyphens{\cs@splithyphensfalse\cs@deactivatehyphens}
+\def\splithyphens{\cs@splithyphenstrue\cs@activatehyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@splitattr}
+% Now we declare the |split| language attribute. This is
+% similar to the |split| package option of cslatex, but it
+% only affects Slovak, not Czech.
+%
+% \changes{slovak-3.1}{2006/10/07}{attribute added}
+% \begin{macrocode}
+\def\cs@splitattr{\babel@save\ifcs@splithyphens\splithyphens}
+\bbl@declare@ttribute{slovak}{split}{%
+ \addto\extrasslovak{\cs@splitattr}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cs@activatehyphens}
+% \begin{macro}{\cs@deactivatehyphens}
+% These macros are defined as \cs{relax} by default to prevent
+% activating/deactivating the hyphen character. They are redefined
+% when the language is switched to Czech/Slovak. At that moment
+% the hyphen is also activated if split hyphens were requested with
+% \cs{splithyphens}.
+%
+% When the language is de-activated, de-activate the hyphen and
+% restore the bogus definitions of these macros.
+%
+% \begin{macrocode}
+\let\cs@activatehyphens\relax
+\let\cs@deactivatehyphens\relax
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\cs@activatehyphens{\bbl@activate{-}}%
+ \def\cs@deactivatehyphens{\bbl@deactivate{-}}%
+ \ifcs@splithyphens\cs@activatehyphens\fi}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \cs@deactivatehyphens
+ \let\cs@activatehyphens\relax
+ \let\cs@deactivatehyphens\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@looseness}
+% \begin{macro}{\looseness}
+% One of the most common situations where an active hyphen will not
+% work properly is the \cs{looseness} primitive. Change its definition
+% so that it deactivates the hyphen if needed.
+%
+% \begin{macrocode}
+\let\cs@looseness\looseness
+\def\looseness{%
+ \ifcs@splithyphens
+ \cs@deactivatehyphens\afterassignment\cs@activatehyphens \fi
+ \cs@looseness}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cs@selectlanguage}
+% \begin{macro}{\cs@main@language}
+% Specifying the |nocaptions| option means that captions and dates
+% are not redefined by default, but they can be switched on later
+% with \cs{captionsslovak} and/or \cs{dateslovak}.
+%
+% We mimic this behavior by redefining \cs{selectlanguage}. This
+% macro is called once at the beginning of the document to set the
+% main language of the document. If this is \cs{cs@main@language},
+% it disables the macros for setting captions and date. In any
+% case, it restores the original definition of \cs{selectlanguage}
+% and expands it.
+%
+% The definition of \cs{selectlanguage} can be shared between Czech
+% and Slovak; the actual language is stored in \cs{cs@main@language}.
+%
+% \begin{macrocode}
+\ifx\cs@nocaptions\@undefined\else
+ \edef\cs@main@language{\CurrentOption}
+ \ifx\cs@origselect\@undefined
+ \let\cs@origselect=\selectlanguage
+ \def\selectlanguage{%
+ \let\selectlanguage\cs@origselect
+ \ifx\bbl@main@language\cs@main@language
+ \expandafter\cs@selectlanguage
+ \else
+ \expandafter\selectlanguage
+ \fi}
+ \def\cs@selectlanguage{%
+ \cs@tempdisable{captions}%
+ \cs@tempdisable{date}%
+ \selectlanguage}
+% \end{macrocode}
+%
+% \begin{macro}{\cs@tempdisable}
+% \cs{cs@tempdisable} disables a language setup macro temporarily,
+% i.e. the macro with the name of \meta{\#1}|\bbl@main@language|
+% just restores the original definition and purges the saved macro
+% from memory.
+%
+% \begin{macrocode}
+ \def\cs@tempdisable#1{%
+ \def\@tempa{cs@#1}%
+ \def\@tempb{#1\bbl@main@language}%
+ \expandafter\expandafter\expandafter\let
+ \expandafter \csname\expandafter \@tempa \expandafter\endcsname
+ \csname \@tempb \endcsname
+ \expandafter\edef\csname \@tempb \endcsname{%
+ \let \expandafter\noexpand \csname \@tempb \endcsname
+ \expandafter\noexpand \csname \@tempa \endcsname
+ \let \expandafter\noexpand\csname \@tempa \endcsname
+ \noexpand\@undefined}}
+% \end{macrocode}
+% \end{macro}
+%
+% These macros are not needed, once the initialization is over.
+%
+% \begin{macrocode}
+ \@onlypreamble\cs@main@language
+ \@onlypreamble\cs@origselect
+ \@onlypreamble\cs@selectlanguage
+ \@onlypreamble\cs@tempdisable
+ \fi
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The encoding of mathematical fonts should be changed to IL2. This
+% allows to use accented letter in some font families. Besides,
+% documents do not use CM fonts if there are equivalents in CS-fonts,
+% so there is no need to have both bitmaps of CM-font and CS-font.
+%
+% \cs{@font@warning} and \cs{@font@info} are temporarily redefined
+% to avoid annoying font warnings.
+%
+% \begin{macrocode}
+\ifx\cs@compat@plain\@undefined
+\ifx\cs@check@enc\@undefined\else
+ \def\cs@check@enc{
+ \ifx\encodingdefault\cs@iltw@
+ \let\cs@warn\@font@warning \let\@font@warning\@gobble
+ \let\cs@info\@font@info \let\@font@info\@gobble
+ \SetSymbolFont{operators}{normal}{\cs@iltw@}{cmr}{m}{n}
+ \SetSymbolFont{operators}{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathbf{normal}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{normal}{\cs@iltw@}{cmr}{m}{it}
+ \SetMathAlphabet\mathrm{normal}{\cs@iltw@}{cmr}{m}{n}
+ \SetMathAlphabet\mathsf{normal}{\cs@iltw@}{cmss}{m}{n}
+ \SetMathAlphabet\mathtt{normal}{\cs@iltw@}{cmtt}{m}{n}
+ \SetMathAlphabet\mathbf{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{bold}{\cs@iltw@}{cmr}{bx}{it}
+ \SetMathAlphabet\mathrm{bold}{\cs@iltw@}{cmr}{bx}{n}
+ \SetMathAlphabet\mathsf{bold}{\cs@iltw@}{cmss}{bx}{n}
+ \SetMathAlphabet\mathtt{bold}{\cs@iltw@}{cmtt}{m}{n}
+ \let\@font@warning\cs@warn \let\cs@warn\@undefined
+ \let\@font@info\cs@info \let\cs@info\@undefined
+ \fi
+ \let\cs@check@enc\@undefined}
+ \AtBeginDocument{\cs@check@enc}
+\fi
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{cs@undoiltw@}
+%
+% The thing is that \LaTeXe{} core only supports the T1 encoding
+% and does not bother changing the uc/lc/sfcodes when encoding
+% is switched. :( However, the IL2 encoding \emph{does} change
+% these codes, so if encoding is switched back from IL2, we must
+% also undo the effect of this change to be compatible with
+% \LaTeXe. OK, this is not the right\textsuperscript{TM} solution
+% but it works. Cheers to Petr Ol\v s\'ak.
+%
+% \begin{macrocode}
+\def\cs@undoiltw@{%
+ \uccode158=208 \lccode158=158 \sfcode158=1000
+ \sfcode159=1000
+ \uccode165=133 \lccode165=165 \sfcode165=1000
+ \uccode169=137 \lccode169=169 \sfcode169=1000
+ \uccode171=139 \lccode171=171 \sfcode171=1000
+ \uccode174=142 \lccode174=174 \sfcode174=1000
+ \uccode181=149
+ \uccode185=153
+ \uccode187=155
+ \uccode190=0 \lccode190=0
+ \uccode254=222 \lccode254=254 \sfcode254=1000
+ \uccode255=223 \lccode255=255 \sfcode255=1000}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@@enc@update}
+%
+% Redefine the \LaTeXe{} internal function \cs{@@enc@update} to
+% change the encodings correctly.
+%
+% \begin{macrocode}
+\ifx\cs@enc@update\@undefined
+\ifx\@@enc@update\@undefined\else
+ \let\cs@enc@update\@@enc@update
+ \def\@@enc@update{\ifx\cf@encoding\cs@iltw@\cs@undoiltw@\fi
+ \cs@enc@update
+ \expandafter\ifnum\csname l@\languagename\endcsname=\the\language
+ \expandafter\ifx
+ \csname l@\languagename:\f@encoding\endcsname\relax
+ \else
+ \expandafter\expandafter\expandafter\let
+ \expandafter\csname
+ \expandafter l\expandafter @\expandafter\languagename
+ \expandafter\endcsname\csname l@\languagename:\f@encoding\endcsname
+ \fi
+ \language=\csname l@\languagename\endcsname\relax
+ \fi}
+\fi\fi
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{slovak-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/slovak/slovak.ins b/macros/latex/contrib/babel-contrib/slovak/slovak.ins
new file mode 100644
index 0000000000..c8c7d88326
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovak/slovak.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{slovak.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{slovak.ldf}{\from{slovak.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/slovak/slovak.pdf b/macros/latex/contrib/babel-contrib/slovak/slovak.pdf
new file mode 100644
index 0000000000..5839b693ee
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovak/slovak.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/slovene b/macros/latex/contrib/babel-contrib/slovene
new file mode 120000
index 0000000000..b7a07b1eb1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovene
@@ -0,0 +1 @@
+slovenian \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/slovenian/slovene.dtx b/macros/latex/contrib/babel-contrib/slovenian/slovene.dtx
new file mode 100644
index 0000000000..391f39e7f9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovenian/slovene.dtx
@@ -0,0 +1,302 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{142}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{slovene.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{slovene}
+%\fi
+%\ProvidesFile{slovene.dtx}
+ [2005/03/31 v1.2m Slovene support from the babel system]
+%\iffalse
+%% File `slovene.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Slovenian language definition file. The Slovenian
+% words were contributed by Danilo Zavrtanik, University of
+% Ljubljana (Slovenia, former Yugoslavia).
+% The usage of the active " was introduced by
+% Leon \v{Z}lajpah
+% Jo\v{z}ef Stefan Institute,
+% Jamova 39, Ljubljana,
+% Slovenia
+% e-mail: leon.zlajpah at ijs.si
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{{textsf \1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{slovene.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{slovene.dtx}
+%
+% \changes{slovene-1.0a}{1991/07/15}{Renamed babel.sty in babel.com}
+% \changes{slovene-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{slovene-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{slovene-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{slovene-1.2i}{1995/11/03}{Replaced `Slovanian' with correct
+% `Slovenian'}
+% \changes{slovene-1.2i}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Slovenian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Danilo Zavrtanik,
+% University of Ljubljana (YU) and Leon \v{Z}lajpah
+% (\texttt{leon.zlajpah@ijs.si}).} defines all the
+% language-specific macros for the Slovenian language.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:slovene-quote} an overview is given of its
+% purpose. One of the reasons for this is that in the Slovene
+% language some special characters are used.
+%
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"c| & |\"c|, also implemented for the
+% lowercase and uppercase s and z. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for compund words with hyphen, e.g.\ |x-""y|). \\
+% |"`| & for Slovene left double quotes (looks like ,,). \\
+% |"'| & for Slovene right double quotes. \\
+% |"<| & for French left double quotes (similar to $<<$). \\
+% |">| & for French right double quotes (similar to $>>$).\\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{slovene.ldf}}\label{tab:slovene-quote}
+% \end{center}
+% \end{table}
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{slovene-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{slovene}\captionsslovene
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{slovene} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@slovene| to see whether we have to do something here.
+%
+% \changes{slovene-1.0b}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{slovene-1.1}{1992/02/16}{Added a warning when no
+% hyphenation patterns were loaded.}
+% \changes{slovene-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@slovene\@undefined
+ \@nopatterns{Slovene}
+ \adddialect\l@slovene0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Slovenian language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsslovene}
+% The macro |\captionsslovene| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{slovene-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{slovene-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{slovene-1.2b}{1994/06/04}{Added extra translations from
+% Josef Leydold, \texttt{leydold@statrix2.wu-wien.ac.at}}
+% \changes{slovene-1.2g}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{slovene-1.2h}{1995/07/25}{Added translation of `Proof'}
+% \changes{slovene-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsslovene{%
+ \def\prefacename{Predgovor}%
+ \def\refname{Literatura}%
+ \def\abstractname{Povzetek}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Poglavje}%
+ \def\appendixname{Dodatek}%
+ \def\contentsname{Kazalo}%
+ \def\listfigurename{Slike}%
+ \def\listtablename{Tabele}%
+ \def\indexname{Stvarno kazalo}% used to be Indeks
+ \def\figurename{Slika}%
+ \def\tablename{Tabela}%
+ \def\partname{Del}%
+ \def\enclname{Priloge}%
+ \def\ccname{Kopije}%
+ \def\headtoname{Prejme}%
+ \def\pagename{Stran}%
+ \def\seename{glej}%
+ \def\alsoname{glej tudi}%
+ \def\proofname{Dokaz}%
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateslovene}
+% The macro |\dateslovene| redefines the command |\today| to
+% produce Slovenian dates.
+% \changes{slovene-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{slovene-1.2j}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateslovene{%
+ \def\today{\number\day.~\ifcase\month\or
+ januar\or februar\or marec\or april\or maj\or junij\or
+ julij\or avgust\or september\or oktober\or november\or december\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasslovene}
+% \begin{macro}{\noextrasslovene}
+% The macro |\extrasslovene| performs all the extra definitions
+% needed for the Slovenian language. The macro |\noextrasslovene|
+% is used to cancel the actions of |\extrasslovene|.
+%
+% For Slovene the \texttt{"} character is made active. This is done
+% once, later on its definition may vary. Other languages in the
+% same document may also use the \texttt{"} character for
+% shorthands; we specify that the slovenian group of shorthands
+% should be used.
+%
+% \changes{slovene-1.2f}{1995/06/04}{Introduced the active \texttt{"}}
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasslovene{\languageshorthands{slovene}}
+\addto\extrasslovene{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{slovene-1.2l}{1999/12/17}{Deactivate shorthands ouside of
+% Slovene}
+% \begin{macrocode}
+\addto\noextrasslovene{\bbl@deactivate{"}}
+% \end{macrocode}
+% First we define shorthands to facilitate the occurence of letters
+% such as \v{c}.
+% \changes{slovene-1.2i}{1996/09/21}{removed shorthand for \texttt{"L}
+% as it is not needed for slovenian}
+% \begin{macrocode}
+\declare@shorthand{slovene}{"c}{\textormath{\v c}{\check c}}
+\declare@shorthand{slovene}{"s}{\textormath{\v s}{\check s}}
+\declare@shorthand{slovene}{"z}{\textormath{\v z}{\check z}}
+\declare@shorthand{slovene}{"C}{\textormath{\v C}{\check C}}
+\declare@shorthand{slovene}{"S}{\textormath{\v S}{\check S}}
+\declare@shorthand{slovene}{"Z}{\textormath{\v Z}{\check Z}}
+% \end{macrocode}
+%
+% Then we define access to two forms of quotation marks, similar
+% to the german and french quotation marks.
+% \changes{slovene-1.2j}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{slovene}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{slovene}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{slovene}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{slovene}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% then we define two shorthands to be able to specify hyphenation
+% breakpoints that behavew a little different from |\-|.
+% \begin{macrocode}
+\declare@shorthand{slovene}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{slovene}{""}{\hskip\z@skip}
+% \end{macrocode}
+% And we want to have a shorthand for disabling a ligature.
+% \begin{macrocode}
+\declare@shorthand{slovene}{"|}{%
+ \textormath{\discretionary{-}{}{\kern.03em}}{}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{slovene-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{slovene}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/slovenian/slovene.ins b/macros/latex/contrib/babel-contrib/slovenian/slovene.ins
new file mode 100644
index 0000000000..86760a5e13
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovenian/slovene.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{slovene.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{slovene.ldf}{\from{slovene.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/slovenian/slovene.pdf b/macros/latex/contrib/babel-contrib/slovenian/slovene.pdf
new file mode 100644
index 0000000000..9966e7a9e0
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/slovenian/slovene.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/sorbian/lsorbian.dtx b/macros/latex/contrib/babel-contrib/sorbian/lsorbian.dtx
new file mode 100644
index 0000000000..f5adbe4763
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/sorbian/lsorbian.dtx
@@ -0,0 +1,265 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{152}
+% \iffalse
+%
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{lsorbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{lsorbian}
+%\fi
+%\ProvidesFile{lsorbian.dtx}
+ [2008/03/17 v1.0g Lower Sorbian support from the babel system]
+%\iffalse
+%% File `lsorbian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Lower Sorbian Language Definition File
+%% Copyright (C) 1994 - 2008
+%% by Eduard Werner
+% Werner, Eduard",
+% Serbski institut z. t.,
+% Dw\'orni\v{s}\'cowa 6
+% 02625 Budy\v{s}in/Bautzen
+% Germany",
+% (??)3591 497223",
+% edi at kaihh.hanse.de",
+%
+%% Please report errors to: Eduard Werner edi at kaihh.hanse.de
+%%
+% This file is part of the babel system, it provides the source
+% code for the Lower Sorbian definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{lsorbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{lsorbian.dtx}
+%
+% \changes{lsorbian-0.1}{1994/10/10}{First version}
+% \changes{lsorbian-1.0d}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+%
+% \section{The Lower Sorbian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Eduard Werner
+% (\texttt{edi@kaihh.hanse.de}).} It defines all the
+% language-specific macros for Lower Sorbian.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{lsorbian-1.0d}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{lsorbian-1.0g}{2007/10/19}{This file can be loaded under
+% more than one name.}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{lsorbian} will be an `unknown' language, in which
+% case we have to make it known. So we check for the existence of
+% |\l@lsorbian| to see whether we have to do something here.
+% \changes{lsorbian-1.0g}{2007/10/19}{This file can be loaded under
+% more than one name.}
+% As
+% \babel\ also knwos the option \Lopt{lowersorbian} we have to
+% check that as well.
+%
+% \begin{macrocode}
+\ifx\l@lowersorbian\@undefined
+ \ifx\l@lsorbian\@undefined
+ \@nopatterns{Lsorbian}
+ \adddialect\l@lsorbian\z@
+ \let\l@lowersorbian\l@lsorbian
+ \else
+ \let\l@lowersorbian\l@lsorbian
+ \fi
+\else
+ \let\l@lsorbian\l@lowersorbian
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Lower Sorbian language.
+%
+% \begin{macro}{\captionslsorbian}
+% The macro |\captionslsorbian| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{lsorbian-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{lsorbian-1.0f}{2000/09/22}{Added \cs{glossaryname}}
+% \changes{lsorbian-1.0g}{2007/10/19}{Make this work for more than one
+% option name.}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Zawod}%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wop\'simje\'se}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ \def\partname{\'Z\v el}%
+ \def\enclname{P\'si\l oga}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strona}%
+ \def\seename{gl.}%
+ \def\alsoname{gl.~teke}%
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newdatelsorbian}
+% The macro |\newdatelsorbian| redefines the command |\today| to
+% produce Lower Sorbian dates.
+% \changes{lsorbian-1.0e}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{lsorbian-1.0e}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{lsorbian-1.0g}{2007/10/19}{Make this work for more than one
+% option name.}
+% \begin{macrocode}
+\@namedef{newdate\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ januara\or februara\or m\v erca\or apryla\or maja\or
+ junija\or julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\olddatelsorbian}
+% The macro |\olddatelsorbian| redefines the command |\today| to
+% produce old-style Lower Sorbian dates.
+% \changes{lsorbian-1.0g}{2007/10/19}{Make this work for more than one
+% option name.}
+% \begin{macrocode}
+\@namedef{olddate\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ wjelikego ro\v zka\or
+ ma\l ego ro\v zka\or
+ nal\v etnika\or
+ jat\v sownika\or
+ ro\v zownika\or
+ sma\v znika\or
+ pra\v znika\or
+ \v znje\'nca\or
+ po\v znje\'nca\or
+ winowca\or
+ nazymnika\or
+ godownika\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% The default will be the new-style dates.
+% \changes{lsorbian-1.0g}{2007/10/19}{Make this work for more than one
+% option name.}
+% \begin{macrocode}
+\expandafter\let\csname date\CurrentOption\expandafter\endcsname
+ \csname newdate\CurrentOption\endcsname
+% \end{macrocode}
+%
+% \begin{macro}{\extraslsorbian}
+% \begin{macro}{\noextraslsorbian}
+% The macro |\extraslsorbian| will perform all the extra
+% definitions needed for the lsorbian language. The macro
+% |\noextraslsorbian| is used to cancel the actions of
+% |\extraslsorbian|. For the moment these macros are empty but
+% they are defined for compatibility with the other language
+% definition files.
+%
+% \begin{macrocode}
+\@namedef{extras\CurrentOption}{}
+\@namedef{noextras\CurrentOption}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{lsorbian-1.0d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \changes{lsorbian-1.0g}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/sorbian/lsorbian.pdf b/macros/latex/contrib/babel-contrib/sorbian/lsorbian.pdf
new file mode 100644
index 0000000000..c02cb8ee80
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/sorbian/lsorbian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/sorbian/sorbian.ins b/macros/latex/contrib/babel-contrib/sorbian/sorbian.ins
new file mode 100644
index 0000000000..5fb2d70123
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/sorbian/sorbian.ins
@@ -0,0 +1,149 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2008 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{sorbian.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2008 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{lsorbian.ldf}{\from{lsorbian.dtx}{code}}
+ \file{usorbian.ldf}{\from{usorbian.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/sorbian/usorbian.dtx b/macros/latex/contrib/babel-contrib/sorbian/usorbian.dtx
new file mode 100644
index 0000000000..7c02a293cd
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/sorbian/usorbian.dtx
@@ -0,0 +1,400 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2008 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{344}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{usorbian.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{usorbian}
+%\fi
+%\ProvidesFile{usorbian.dtx}
+ [2008/03/17 v1.0k Upper Sorbian support from the babel system]
+%\iffalse
+%% File `usorbian.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2008
+%% by Johannes Braams, TeXniek
+%
+%% Upper Sorbian Language Definition File
+%% Copyright (C) 1994 - 2004
+%% by Eduard Werner
+% Werner, Eduard",
+% Serbski institut z. t.,
+% Dw\'orni\v{s}\'cowa 6
+% 02625 Budy\v{s}in/Bautzen
+% Germany",
+% (??)3591 497223",
+% edi at kaihh.hanse.de",
+%
+%% Please report errors to: Eduard Werner edi at kaihh.hanse.de
+%%
+% This file is part of the babel system, it provides the source
+% code for the Upper Sorbian definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\newfont{\logo}{logo10}
+\newcommand*\MF{{\logo METAFONT}}
+\begin{document}
+ \DocInput{usorbian.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{usorbian.dtx}
+%
+% \changes{usorbian-0.1}{1994/10/10}{First version}
+% \changes{usorbian-0.1b}{1994/10/18}{Made it possible to run through
+% \LaTeX; added \cs{MF} and removed extra \cs{end{macro}}}
+% \changes{usorbian-1.0d}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{usorbian-1.0e}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Upper Sorbian language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. It was written by Eduard Werner
+% (\texttt{edi@kaihh.hanse.de}).} It defines all the
+% language-specific macros for Upper Sorbian.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{usorbian-1.0e}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \changes{usorbian-1.0j}{2007/10/19}{This file can be loaded under
+% more than one name.}
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{date\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{usorbian} will be an `unknown' language, in which
+% case we have to make it known. So we check for the existence of
+% |\l@usorbian| to see whether we have to do something here.
+% \changes{usorbian-1.0j}{2007/10/19}{Check for the option
+% lowersorbian}
+% As
+% \babel\ also knwos the option \Lopt{uppersorbian} we have to
+% check that as well.
+%
+% \begin{macrocode}
+\ifx\l@uppersorbian\@undefined
+ \ifx\l@usorbian\@undefined
+ \@nopatterns{Usorbian}
+ \adddialect\l@usorbian\z@
+ \let\l@uppersorbian\l@usorbian
+ \else
+ \let\l@uppersorbian\l@usorbian
+ \fi
+\else
+ \let\l@usorbian\l@uppersorbian
+\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Upper Sorbian language.
+%
+% \begin{macro}{\captionsusorbian}
+% The macro |\captionsusorbian| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{usorbian-0.1c}{1994/11/27}{Removed two typos (Kapitel and
+% Dodatki)}
+% \changes{usorbian-1.0b}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{usorbian-1.0i}{2000/09/22}{Added \cs{glossaryname}}
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\@namedef{captions\CurrentOption}{%
+ \def\prefacename{Zawod}%
+ \def\refname{Referency}%
+ \def\abstractname{Abstrakt}%
+ \def\bibname{Literatura}%
+ \def\chaptername{Kapitl}%
+ \def\appendixname{Dodawki}%
+ \def\contentsname{Wobsah}%
+ \def\listfigurename{Zapis wobrazow}%
+ \def\listtablename{Zapis tabulkow}%
+ \def\indexname{Indeks}%
+ \def\figurename{Wobraz}%
+ \def\tablename{Tabulka}%
+ \def\partname{D\'z\v el}%
+ \def\enclname{P\v r\l oha}%
+ \def\ccname{CC}%
+ \def\headtoname{Komu}%
+ \def\pagename{Strona}%
+ \def\seename{hl.}%
+ \def\alsoname{hl.~te\v z}
+ \def\proofname{Proof}% <-- needs translation
+ \def\glossaryname{Glossary}% <-- Needs translation
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newdateusorbian}
+% The macro |\newdateusorbian| redefines the command |\today| to
+% produce Upper Sorbian dates.
+% \changes{usorbian-1.0g}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{usorbian-1.0g}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\@namedef{newdate\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ januara\or februara\or m\v erca\or apryla\or meje\or junija\or
+ julija\or awgusta\or septembra\or oktobra\or
+ nowembra\or decembra\fi
+ \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\olddateusorbian}
+% The macro |\olddateusorbian| redefines the command |\today| to
+% produce old-style Upper Sorbian dates.
+% \changes{usorbian-1.0g}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{usorbian-1.0g}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\@namedef{olddate\CurrentOption}{%
+ \def\today{\number\day.~\ifcase\month\or
+ wulkeho r\'o\v zka\or ma\l eho r\'o\v zka\or nal\v etnika\or
+ jutrownika\or r\'o\v zownika\or sma\v znika\or pra\v znika\or
+ \v znjenca\or po\v znjenca\or winowca\or nazymnika\or
+ hodownika\fi \space \number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% The default will be the new-style dates.
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\expandafter\let\csname date\CurrentOption\expandafter\endcsname
+ \csname newdate\CurrentOption\endcsname
+% \end{macrocode}
+%
+% \begin{macro}{\extrasusorbian}
+% The macro |\extrasusorbian| will perform all the extra
+% definitions needed for the Upper Sorbian language. It's pirated
+% from |germanb.sty|. The macro |\noextrasusorbian| is used to
+% cancel the actions of |\extrasusorbian|.
+%
+% Because for Upper Sorbian (as well as for Dutch) the \texttt{"}
+% character is made active. This is done once, later on its
+% definition may vary.
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\initiate@active@char{"}
+\@namedef{extras\CurrentOption}{\languageshorthands{usorbian}}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{usorbian-1.0h}{1999/12/17}{Deactivate shorthands ouside of
+% Upper Sorbian}
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}}
+% \end{macrocode}
+%
+% In order for \TeX\ to be able to hyphenate German Upper Sorbian
+% words which contain `\ss' we have to give the character a nonzero
+% |\lccode| (see Appendix H, the \TeX book). As some of the other
+% language definitions turn the character |^| into a shorthand we
+% need to make sure that it has it's orginial definition here.
+% \changes{usorbian-1.0k}{2008/03/17}{Make sure the caret has the
+% right \cs{catcdoe}}
+% \begin{macrocode}
+\begingroup \catcode`\^7
+\def\x{\endgroup
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@savevariable{\lccode`\^^Y}%
+ \lccode`\^^Y`\^^Y}}
+\x
+% \end{macrocode}
+% The umlaut accent macro |\"| is changed to lower the umlaut dots.
+% The redefinition is done with the help of |\umlautlow|.
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\"\umlautlow}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \umlauthigh}
+% \end{macrocode}
+% The Upper Sorbian hyphenation patterns can be used with
+% |\lefthyphenmin| and |\righthyphenmin| set to~2.
+% \changes{usorbian-1.0i}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{usorbian-1.0a}{1995/05/27}{Removed stuff that has been
+% moved to \file{babel.def}}
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep it
+% available, the math accent |\"| can now be typed as |"|. Also we
+% store the original meaning of the command |\"| for future use.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros: the umlauts,
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"a}{\textormath{\"{a}}{\ddot a}}
+\declare@shorthand{usorbian}{"o}{\textormath{\"{o}}{\ddot o}}
+\declare@shorthand{usorbian}{"u}{\textormath{\"{u}}{\ddot u}}
+\declare@shorthand{usorbian}{"A}{\textormath{\"{A}}{\ddot A}}
+\declare@shorthand{usorbian}{"O}{\textormath{\"{O}}{\ddot O}}
+\declare@shorthand{usorbian}{"U}{\textormath{\"{U}}{\ddot U}}
+% \end{macrocode}
+% tremas,
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"e}{\textormath{\"{e}}{\ddot e}}
+\declare@shorthand{usorbian}{"E}{\textormath{\"{E}}{\ddot E}}
+\declare@shorthand{usorbian}{"i}{\textormath{\"{\i}}{\ddot\imath}}
+\declare@shorthand{usorbian}{"I}{\textormath{\"{I}}{\ddot I}}
+% \end{macrocode}
+% usorbian es-zet (sharp s),
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"s}{\textormath{\ss{}}{\@SS{}}}
+\declare@shorthand{usorbian}{"S}{SS}
+% \end{macrocode}
+% german and french quotes,
+% \changes{usorbian-1.0f}{1997/04/03}{Removed empty groups after
+% double quote and guillemot characters}
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"`}{%
+ \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
+\declare@shorthand{usorbian}{"'}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\declare@shorthand{usorbian}{"<}{%
+ \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+\declare@shorthand{usorbian}{">}{%
+ \textormath{\guillemotright}{\mbox{\guillemotright}}}
+% \end{macrocode}
+% discretionary commands
+% \changes{usorbian-1.0c}{1996/01/24}{Now use \cs{bbl@disc}}
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"c}{\textormath{\bbl@disc ck}{c}}
+\declare@shorthand{usorbian}{"C}{\textormath{\bbl@disc CK}{C}}
+\declare@shorthand{usorbian}{"f}{\textormath{\bbl@disc f{ff}}{f}}
+\declare@shorthand{usorbian}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{usorbian}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{usorbian}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{usorbian}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{usorbian}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{usorbian}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{usorbian}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{usorbian}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{usorbian}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{usorbian}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{usorbian}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% and some additional commands:
+% \begin{macrocode}
+\declare@shorthand{usorbian}{"-}{\nobreak\-\bbl@allowhyphens}
+\declare@shorthand{usorbian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}{}}
+\declare@shorthand{usorbian}{""}{\hskip\z@skip}
+% \end{macrocode}
+%
+% \begin{macro}{\mdqon}
+% \begin{macro}{\mdqoff}
+% \begin{macro}{\ck}
+% All that's left to do now is to define a couple of commands
+% for reasons of compatibility with \file{german.sty}.
+% \changes{usorbian-1.0g}{1998/06/07}{Now use \cs{shorthandon} and
+% \cs{shorthandoff}}
+% \begin{macrocode}
+\def\mdqon{\shorthandon{"}}
+\def\mdqoff{\shorthandoff{"}}
+\def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{usorbian-1.0e}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \changes{usorbian-1.0j}{2007/10/19}{Make this work for more than one
+% option name}
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/sorbian/usorbian.pdf b/macros/latex/contrib/babel-contrib/sorbian/usorbian.pdf
new file mode 100644
index 0000000000..d4848e69e5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/sorbian/usorbian.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/spanglish/README b/macros/latex/contrib/babel-contrib/spanglish/README
new file mode 100644
index 0000000000..65b38855de
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanglish/README
@@ -0,0 +1,32 @@
+
+The \textsf{Spanglish} ``language'' is a compromise between the use of the
+Spanish language in writing and English mathematics.
+
+Thus, there are no Spanish mathematical features supported (no accented
+operators, no decimal comma), and there is (probably less than) minimal
+Spanish language support for text.
+There is a conscious effort to make this ``language'' upwards compatible with
+the ``standard'' Spanish language definition, so the shorthands implemented here
+are but a very narrow subset of the standard Spanish language:
+those strictly necessary to handle Spanish hyphenation properly,
+and a few extras to straighten the text a little in a Spanish layout and support
+plain ASCII input in LaTeX, like frenchspacing, indentfirst,
+symbolic footnotes, lowercase roman numerals,
+and a few shorthands to improve hyphenation.
+All other typographic decisions are left to other macro packages
+according to user's taste (or lack thereof).
+So, in a sense, this ``language'' is a very stripped down or ultra-sloppy
+version of the ``standard'' spanish.ldf, mainly as a fallback solution.
+
+There are two public attributes/modifiers enabled for this ``language'',
+asc and tn, designed to improve support of ASCII input;
+the former activates all shorthands necessary to input Spanish with plain ASCII
+characters: this modifier supersedes the need to call the activeacute option
+from Babel;
+while the latter supports the input of Spanish \~n with the tilde ~n.
+Both modifiers are provided for backwards compatibility, assuming that most
+Spanish users actually choose a suitable 8bit font and input encoding.
+
+Questions, comments? Drop me an email at jlrn77 at gmail dot com
+
+April 1, 2015.
diff --git a/macros/latex/contrib/babel-contrib/spanglish/spanglish.ldf b/macros/latex/contrib/babel-contrib/spanglish/spanglish.ldf
new file mode 100644
index 0000000000..0c7a7f0e23
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanglish/spanglish.ldf
@@ -0,0 +1,268 @@
+%%
+%% This is file `spanglish.ldf',
+%% Copyright 2008-2015 Luis Rivera and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+% The 'spanglish' dialect was originally adapted from the 'galician'
+% language (v1.2l 2005/03/30), by Manuel Carriba (mcarriba at eunetcom.net),
+% based on the original spanish.sty, written by Julio S\'anchez,
+% (jsanchez at gmv.es)
+% Additional code from spanish.ldf v4.2, by Javier Bezos L\'opez (JBL).
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is J. Luis Rivera N.
+%% jlrn77 at gmail dot com
+%%
+%% \changes{2010/12/28}{Release version, from 2007/01/26 code.}
+%5 \changes{2013/03/01}{Bug fixes.}
+%% \changes{2015/04/01}{Removed accented math operators and \bbl@activate patch.}
+%% \changes{2015/04/10}{Removed activeacute support and added ascii input modifiers.}
+%% \changes{2015/04/10}{Removed dependency on esindex: now you have to load it yourself.}
+%%
+\ProvidesLanguage{spanglish}
+ [2015/04/01 v0.3 Spanglish: Simpler Spanish support]
+\LdfInit{spanglish}\captionsspanglish
+% spanglish is a dialect of either Spanish or English
+\ifx\l@spanglish\@undefined
+ \ifx\l@spanish\@undefined
+ \@nopatterns{span[gl]ish}
+ \adddialect\l@spanglish0
+ \else
+ \adddialect\l@spanglish\l@spanish
+ \fi\fi
+%
+\addto\captionsspanglish{%
+ \def\prefacename{Prefacio}%
+ \def\refname{Referencias}%
+ \def\abstractname{Resumen}%
+ \def\bibname{Bibliograf\'{\i}a}%
+ \def\chaptername{Cap\'{\i}tulo}%
+ \def\appendixname{Ap\'endice}%
+ \def\contentsname{\'Indice}%
+ \def\listfigurename{\'Indice de Figuras}%
+ \def\listtablename{\'Indice de Cuadros}%
+ \def\indexname{\'Indice Alfab\'etico}%
+ \def\figurename{Figura}%
+ \def\tablename{Cuadro}%
+ \def\partname{Parte}%
+ \def\enclname{Anexo}%
+ \def\ccname{Copia a}%
+ \def\headtoname{A}%
+ \def\pagename{P\'agina}%
+ \def\seename{v\'ease}%
+ \def\alsoname{v\'ease tambi\'en}%
+ \def\proofname{Demostraci\'on}%
+ \def\glossaryname{Glosario}%
+}
+%
+\def\datespanglish{%
+ \def\today{\number\day\space de \ifcase\month\or
+ enero\or febrero\or marzo\or abril\or mayo\or junio\or
+ julio\or agosto\or septiembre\or octubre\or noviembre\or diciembre\fi
+ \space de \number\year}}
+\addto\extrasspanglish{\bbl@frenchspacing}
+\addto\noextrasspanglish{\bbl@nonfrenchspacing}
+%
+\newif\ifesmx@latex
+\@ifundefined{documentclass}
+ {\esmx@latexfalse}
+ {\esmx@latextrue}
+%
+\addto\extrasspanglish{\languageshorthands{spanglish}}
+\initiate@active@char{"}% Only doublequote is active by default
+\addto\extrasspanglish{%
+ \bbl@activate{"}}
+\addto\noextrasspanglish{%
+ \bbl@deactivate{"}}
+\addto\extrasspanglish{%
+ \babel@save\"%
+ \def\"{\protect\@umlaut}}
+\let\dieresis\"
+\def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
+% shorthands for hyphenation
+\declare@shorthand{spanglish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{spanglish}{"|}{\discretionary{-}{}{\kern.03em}}
+\declare@shorthand{spanglish}{"r}% to hyphenate para"rrayos properly
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{r}\bbl@allowhyphens}
+\declare@shorthand{spanglish}{"R}
+ {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
+ {}{R}\bbl@allowhyphens}
+\ifesmx@latex% this guillemets hack, by jbl
+ \DeclareTextCommand{\guillemotleft}{OT1}{%
+ \ifmmode\ll
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char40 \kern-0.19em\char40 }}%
+ \fi}%
+ \DeclareTextCommand{\guillemotright}{OT1}{%
+ \ifmmode\gg
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char41 \kern-0.19em\char41 }}%
+ \fi}%
+% end jbl; jlrn's American double quotes
+\declare@shorthand{spanglish}{"`}{\textquotedblleft{}}
+\declare@shorthand{spanglish}{"'}{\textquotedblright{}}
+\fi % end quotedbldefs
+% three hacks by JBL to adjust height of ?`!`/ with all uppercase letters
+\declare@shorthand{spanglish}{"/}% first
+ {\setbox\z@\hbox{/}%
+ \dimen@\ht\z@
+ \advance\dimen@-1ex
+ \advance\dimen@\dp\z@
+ \dimen@.31\dimen@
+ \advance\dimen@-\dp\z@
+ \ifdim\dimen@>0pt
+ \kern.01em\lower\dimen@\box\z@\kern.03em
+ \else
+ \box\z@
+ \fi}
+\declare@shorthand{spanglish}{"?}% second
+ {\setbox\z@\hbox{?`}%
+ \leavevmode\raise\dp\z@\box\z@}
+\declare@shorthand{spanglish}{"!}% third
+ {\setbox\z@\hbox{!`}%
+ \leavevmode\raise\dp\z@\box\z@}
+\addto\extrasspanglish{% JS's discretionary hyphens
+ \babel@save{\-}%
+ \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
+%%%
+%%% some code to support accented and spaced math operators was here. RIP.
+%%%
+% support for abbreviations
+\def\esmx@plain@esabrv#1{.$^{{\rm #1}}$}
+\def\esmx@ltx@esabrv#1{.\textsuperscript{#1}}
+\def\esmx@esabrv@r#1#2{\esabrv{#1#2}}% nice trick by JBL
+\ifesmx@latex
+ \let\esabrv\esmx@ltx@esabrv
+ \else
+ \let\esabrv\esmx@plain@esabrv
+\fi
+%% ascii shorthands, rearranged, without activeacute...
+\bbl@declare@ttribute{spanglish}{asc}{
+ \initiate@active@char{'}
+ \addto\extrasspanglish{\bbl@activate{'}}
+ \addto\noextrasspanglish{\bbl@deactivate{'}}
+ \babel@save\'%
+ \addto\extrasspanglish{\def\'{\protect\@acute}}
+ \let\textacute\'
+ \def\@acute##1{\allowhyphens\textacute{##1}\allowhyphens}
+ \declare@shorthand{spanglish}{'a}{\textormath{\@acute a}{^{\prime} a}}
+ \declare@shorthand{spanglish}{'e}{\textormath{\@acute e}{^{\prime} e}}
+ \declare@shorthand{spanglish}{'i}{\textormath{\@acute\i{}}{^{\prime}i}}
+ \declare@shorthand{spanglish}{'o}{\textormath{\@acute o}{^{\prime} o}}
+ \declare@shorthand{spanglish}{'u}{\textormath{\@acute u}{^{\prime} u}}
+ \declare@shorthand{spanglish}{'A}{\textormath{\@acute A}{^{\prime} A}}
+ \declare@shorthand{spanglish}{'E}{\textormath{\@acute E}{^{\prime} E}}
+ \declare@shorthand{spanglish}{'I}{\textormath{\@acute I}{^{\prime} I}}
+ \declare@shorthand{spanglish}{'O}{\textormath{\@acute O}{^{\prime} O}}
+ \declare@shorthand{spanglish}{'U}{\textormath{\@acute U}{^{\prime} U}}
+ \declare@shorthand{spanglish}{'n}{\textormath{\~n}{^{\prime} n}}
+ \declare@shorthand{spanglish}{'N}{\textormath{\~N}{^{\prime} N}}
+ \declare@shorthand{spanglish}{''}{\textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
+ \declare@shorthand{spanglish}{"u}{\@umlaut{u}}
+ \declare@shorthand{spanglish}{"U}{\@umlaut{U}}
+ \declare@shorthand{spanglish}{"i}{\@umlaut{\i}}
+ \declare@shorthand{spanglish}{"I}{\@umlaut{I}}
+ \declare@shorthand{spanglish}{"a}{\esabrv{a}}
+ \declare@shorthand{spanglish}{"o}{\esabrv{o}}
+ \declare@shorthand{spanglish}{"e}{\protect\esmx@esabrv@r{e}}
+ \declare@shorthand{spanglish}{"A}{\esabrv{A}}
+ \declare@shorthand{spanglish}{"O}{\esabrv{O}}
+ \declare@shorthand{spanglish}{"E}{\protect\esmx@esabrv@r{E}}
+ \declare@shorthand{spanglish}{"<}{\guillemotleft{}}
+ \declare@shorthand{spanglish}{">}{\guillemotright{}}
+}
+%% tilden tildeN
+\bbl@declare@ttribute{spanglish}{nt}{
+ \initiate@active@char{~}
+ \addto\extrasspanglish{\bbl@activate{~}\def\~{\protect\@tilde}}
+ \addto\noextrasspanglish{\bbl@deactivate{~}}
+ \addto\extrasspanglish{\babel@save\~}
+ \let\texttilde\~
+ \let\@tilde\texttilde
+ \declare@shorthand{spanglish}{~n}{\textormath{\~n}{\@tilde n}}
+ \declare@shorthand{spanglish}{~N}{\textormath{\~N}{\@tilde N}}
+}
+% A crude hack to turn ES into US abbreviations.
+\bbl@declare@ttribute{spanglish}{usord}{
+\addto\extrasspanglish{% this code should state ordinal 1"o as 1o.
+ \def\esmx@usabrv##1{##1.}
+ \let\esabrv\esmx@usabrv
+ \def\esmx@esabrv@r##1##2{\esabrv{##1##2}}
+ }
+}
+% spanish layout
+\addto\extrasspanglish{%
+ \def\@alph#1%
+ {\ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
+ k\or l\or m\or n\or \~n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ w\or x\or y\or z\else\@ctrerr\fi}%
+ \def\@Alph#1%
+ {\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or \~N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ W\or X\or Y\or Z\else\@ctrerr\fi}
+ }
+% JBL's fix (lowercase small caps) for lowercase roman numbers and acronyms.
+\ifesmx@latex
+ \addto\textspanish{%
+ \babel@save\lsc
+ \def\lsc{\protect\esmx@lsc}}
+%
+ \def\esmx@lsc#1{%
+ \leavevmode
+ \hbox{\scshape\selectfont
+ \expandafter\ifx\csname\f@encoding/\f@family/\f@series
+ /n/\f@size\expandafter\endcsname
+ \csname\curr@fontshape/\f@size\endcsname
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\selectfont
+ \PackageInfo{spanglish}{Replacing undefined sc font\MessageBreak
+ shape by faked small caps}%
+ \MakeUppercase{#1}%
+ \else
+ \MakeLowercase{#1}%
+ \fi}}
+%
+\DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'{\i}}
+%
+ \def\spanglishlayout{
+ \def\theenumii{\alph{enumii}}% fix the second level enumeration label
+ \def\labelenumii{\textit{\theenumii})}
+ \def\p@enumii{\textit{\theenumii}}
+ \def\theenumiii{\Roman{enumiii}}% fix the third level enumeration label
+ \def\labelenumiii{\theenumiii.}
+ \def\p@enumiii{\theenumiii}
+ \let\@afterindentfalse\@afterindenttrue% afterindent true
+ \@afterindenttrue%
+ \def\@fnsymbol##1%
+ {\ifcase##1\or*\or**\or***\or****\or
+ *****\or******\else\@ctrerr\fi}%
+ \def\@roman##1{\protect\esmx@roman{\number##1}}%
+ \def\esmx@roman##1{\protect\esmx@lsc{\romannumeral##1}}%
+ %\def\esromanindex##1##2{##1{\protect\esmx@lsc{##2}}}
+ }
+\AtEndOfPackage{%
+ %\RequirePackage{esindex}% now load it on your own!
+ \def\bbl@tempa{spanglish}%
+ \ifx\bbl@main@language\bbl@tempa%
+ \AtBeginDocument{\spanglishlayout}\fi%
+ }
+\fi
+%% A patch to fix a bug in \bbl@activate was here. RIP.
+\ldf@finish{spanglish}
+\endinput
+%%
+%% End of file `spanglish.ldf'. \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/spanglish/spanglish.sty b/macros/latex/contrib/babel-contrib/spanglish/spanglish.sty
new file mode 100644
index 0000000000..cfd269ff65
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanglish/spanglish.sty
@@ -0,0 +1,55 @@
+%%
+%% This is file `spanglish.sty',
+%%
+%% Copyright 2008 Luis Rivera and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Luis Rivera.
+%% jlrn7 at gmail dot com
+%%
+\ifx\LdfInit\undefined
+ \def\LdfInit{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \LdfInit}
+\fi
+\ifx\PackageError\undefined
+ \def\ProvidesLanguage#1[#2 #3 #4]{%
+ \wlog{Language: #1 #4 #3 <#2>}}%
+\else
+ \def\bblstyerror{%
+ \PackageError{babel}%
+ {You have used an old interface to call babel\MessageBreak
+ You may expect compatibility problems wit other packages}%
+ {You could proceed but don't complain if you run into errors}%
+ \let\bblstyerror\@undefined
+ }
+ \ifx\ProvidesLanguage\undefined
+ \bblstyerror
+ \def\ProvidesLanguage{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \ProvidesLanguage}
+ \else
+ \bblstyerror
+ \fi
+\fi
+\def\CurrentOption{spanglish}
+\input spanglish.ldf\relax
+\endinput
+%%
+%% End of file `spanglish.sty'. \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/spanish/README.md b/macros/latex/contrib/babel-contrib/spanish/README.md
new file mode 100644
index 0000000000..6ced2b5f67
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanish/README.md
@@ -0,0 +1,62 @@
+Spanish for babel 5.0p
+======================
+
+This is the babel style for the Spanish language (5.0p).
+
+History
+-------
+
+5.0a. 2007-02-21
+Reimplemented in full, which some parts rewritten from scratch. Added
+the es- mechanism and the mexico option. Many bug fixes
+
+5.0d. 2008-05-25
+Fixed two bugs: misplaced subscripts with lim and the like; problem
+with \roman and hyperref
+
+5.0e. 2008-07-06
+Fixed '', which gobbled the space following.
+
+[5.0f. Internal.]
+
+5.0g. 2008-07-19
+Fixed '' again, which killed the preceding kerning
+
+5.0h. 2009-01-02
+Added two package options: es-noenumerate, es-noitemize.
+
+5.0i. 2009-05-11
+Fixed bug with romanidx.
+
+5.0j. 2010-05-23
+Fixed a babel bug for spanish to work with french.
+Fixed a bug with ifthen.
+Fixed a bug with \... and \.
+
+5.0k. 2011-10-06
+Fixed an error when . had mathcode "8000 before loading spanish
+
+5.0l (mistakenly identified as 5.0j). 2013-04-11
+Adapted to new babel modifiers
+
+5.0m. 2014-01-29
+Fixed (rare) bug in font sizes when superscript o/a where used
+Fixed bad spacing in tabular and accents in OT1 encoding
+Restored code for ., accidentally deleted in previous version
+
+5.0n. 2014-04-24
+New macros \spanishdate, \spanishDate, which format dates
+ (\today, \Today are now based on them)
+Mainly internal changes, using the new tools in babel 3.9
+Fixed error with \foreignlanguage in tabular
+
+5.0o. 2016-01-15
+New macro \spanishdatefirst
+Fixed a bug when \alph reached tilde-n
+Fixed \dotlessi with lua (but not \acute, yet)
+
+5.0p. 2016-03-03
+Fixed \acute with lua (it now uses the composite char)
+
+----------
+2016-03-03
diff --git a/macros/latex/contrib/babel-contrib/spanish/spanish.dtx b/macros/latex/contrib/babel-contrib/spanish/spanish.dtx
new file mode 100644
index 0000000000..6311cf329c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanish/spanish.dtx
@@ -0,0 +1,2749 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 1997 - 2016
+% Javier Bezos (www.tex-tipografia.com)
+% and
+% CervanTeX (www.cervantex.es)
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.3 of this license or
+% (at your option) any later version. The latest version of this
+% license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX version
+% 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+%
+% \ProvidesFile{spanish.dtx}
+% [2016/03/03 v5.0p Spanish support from the babel system]
+%\iffalse
+%% File `spanish.dtx'
+%
+%% Spanish Language Definition File
+%% Copyright (C) 1997 - 2016
+%% Javier Bezos (www.tex-tipografia.com)
+%% and
+%% CervanTeX (www.cervantex.es)
+%
+%% Please report errors to: Javier Bezos (preferably)
+%% www.tex-tipografia.com
+%
+% This file is part of the babel system, it provides the source
+% code for the Spanish language definition file.
+% The original version of this file was written by Javier Bezos.
+% The latest release is available on CTAN:/language/spanish/
+% \fi
+%
+% \iffalse
+%<*filedriver>
+\let\ooverb\verb
+\documentclass[spanish,a4paper]{ltxdoc}
+\let\verb\ooverb
+\usepackage{babel}
+\usepackage{hyperref}
+
+\let\meta\emph
+
+\usepackage{pslatex,mathptmx,color}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\newcommand\act[1]{%
+ \\%
+ \makebox[1.5pc][l]{\textcolor{green}{$\surd$}}%
+ \textsf{#1}\ignorespaces}
+\newcommand\deact[1]{%
+ \\%
+ \makebox[1.5pc][l]{\textcolor{red}{$\times$}}%
+ \texttt{#1}\ignorespaces}
+\newcommand\txt{\makebox[1.5pc][l]{\textcolor{blue}{$\Rightarrow$}}\ignorespaces}
+\newcommand\con{\makebox[1.5pc][l]{\textcolor{magenta}{$\star$}}\ignorespaces}
+\newcommand\alw{%
+ \\%
+ \makebox[1.5pc][l]{\textcolor{green}{$\surd$}}%
+ Se define siempre, sin depender de un grupo.}
+\newcommand\opp{\qquad Opción de paquete}
+
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\file[1]{\texttt{#1}}
+
+\setlength{\arrayrulewidth}{2\arrayrulewidth}
+\newcommand\toprule[1]{\cline{1-#1}\\[-2ex]}
+\newcommand\botrule[1]{\\[.6ex]\cline{1-#1}}
+\newcommand\hmk{$\string|$}
+
+\newenvironment{decl}[1][]%
+ {\par\small\addvspace{4.5ex plus 1ex}%
+ \vskip-\parskip
+ \ifx\relax#1\relax
+ \def\@decl@date{}%
+ \else
+ \def\@decl@date{\NEWfeature{#1}}%
+ \fi
+ \noindent
+ \begin{tabular}{|l|}\hline\ignorespaces}%
+ {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
+ \vspace{2.3ex}\vskip-\parskip}
+
+\newcommand\New[1]{%
+ \leavevmode\marginpar{\raggedleft\sffamily Nuevo en #1}}
+
+\newcommand\nm[1]{\unskip\,$^{#1}$}
+\newcommand\nt[1]{\quad$^{#1}$\,\ignorespaces}
+
+\makeatletter
+ \renewcommand\@biblabel{}
+\makeatother
+
+\newcommand\DOT[1]{\lsc{DOT},~#1}
+\newcommand\DTL[1]{\lsc{DTL},~#1}
+\newcommand\MEA[1]{\lsc{MEA},~#1}
+
+\raggedright
+\setlength{\parindent}{0em}
+\setlength{\parskip}{3pt}
+
+\addtolength{\oddsidemargin}{-4pc}
+\addtolength{\textwidth}{7pc}
+
+\OnlyDescription
+\begin{document}
+
+\title{Estilo \textsf{spanish}\\
+para el sistema \babel.\footnote{Este archivo está actualmente
+en la versión 5.0p con fecha 3 de marzo del 2016.
+Esta copia del manual se compuso el~\today.}}
+
+\author{Javier Bezos\footnote{Por favor, envíen comentarios y
+sugerencias en http://www.tex-tipografia.com/spanish.html. Han
+colaborado de una u otra forma muchas personas, a las cuales agradezco
+sus comentarios y sugerencias; en particular, han sido muy activos
+Juan Luis Varona y José Luis Rivera. Para información sobre
+actualizaciones: http://www.cervantex.es/}}
+
+\date{3 de marzo del 2016}
+
+\maketitle
+
+{\small\tableofcontents}
+
+\section*{Símbolos empleados}
+
+\begin{itemize}
+\item[\textcolor{blue}{$\Rightarrow$}] Macros para ser usadas en el
+ texto (generan texto o lo estructuran).
+\item[\textcolor{magenta}{$\star$}] Macros de configuración y
+ preferencias.
+\item[\textcolor{green}{$\surd$}] Grupo que activa la orden.
+\item[\textcolor{red}{$\times$}] Opciones de paquete que anulan la
+ orden. En redonda van las destinadas específicamente a anular ese
+ punto, y en cursiva las que además anulan otros aspectos del estilo.
+\end{itemize}
+
+\section{Uso de \textsf{spanish} para babel}
+
+El estilo \textsf{spanish} para babel adapta una serie de elementos de
+los documentos de \LaTeX\ al castellano, tanto en las traducciones
+como en la tipografía. Para usarlo, basta con dar la opción
+\textsf{spanish} al cargar babel:
+\begin{verbatim}
+\usepackage[spanish]{babel}
+\end{verbatim}
+
+Esto es todo lo que hace falta para conseguir que el documento tenga
+un aspecto español. En caso de estar en México, véase, además, el
+apartado \ref{paises} (<<Opciones por países>>):\footnote{En próximas
+versiones se añadirán más países.}
+\begin{verbatim}
+\usepackage[spanish,mexico]{babel}
+\end{verbatim}
+
+El estilo \textsf{spanish} se puede cargar junto con otras lenguas
+(véase el manual de babel). Si \textsf{spanish} es la última de las
+lenguas cargadas, entonces se considera la lengua principal y se hacen
+ajustes tipográficos adicionales. En particular, se
+modifican órdenes y entornos como:
+\begin{center}
+\begin{tabular}{lll}
+ |enumerate| & |\roman| & |\section|\\
+ |itemize| & |\fnsymbol| & |\subsection|\\
+ |\%| & |\alph| & |\subsubsection|\\
+ & |\Alph| & \\
+\end{tabular}
+\end{center}
+
+El estilo está pensado para que sea fácilmente configurable. Para
+ello, se proporcionan una serie de opciones de paquete, que en caso de
+emplearse deben ir \textit{después} de \textsf{spanish}. Por ejemplo:
+\begin{verbatim}
+\usepackage[french, spanish,es-noindentfirst]{babel}
+\end{verbatim}
+carga los estilos para el francés y el español, esta última como
+lengua principal; además, evita que \textsf{spanish} sangre el
+primer párrafo tras un título. Otras opciones se pueden ajustar por
+medio de macros, en particular aquellas que se puede desear cambiar
+en medio del documento (por ejemplo, el formato de la fecha). Todas
+estas opciones se pueden pasar como modificadores de la lengua:
+\begin{verbatim}
+\usepackage[french spanish.noindentfirst]{babel}
+\end{verbatim}
+
+Los cambios están organizados en una serie de grupos:
+\textsf{captions, date, text, math} y \textsf{shorthands}. Los tres
+ultimos corresponden a lo que en babel sería normalmente
+\textsf{extras}.
+
+\section{\textsf{spanish} como lengua principal}
+
+Si la lengua principal es \textsf{spanish}, se introducen una serie de
+cambios en el momento de cargar la lengua para adaptar varios
+elementos a los usos tipográficos españoles. Estos cambios funcionan
+con las clases estándar "+--con otras tal vez alguno de ellos no tenga
+efecto--- y perduran todo el documento. Ninguno de ellos es necesario
+para componer el documento, aunque naturalmente el resultado será
+distinto.
+
+\subsection{Listas}
+
+\begin{decl} \txt |\begin{enumerate} ... \end{enumerate}|%
+\deact{es-nolists, es-noenumerate, \textit{es-nolayout, es-minimal,
+es-sloppy}} \end{decl}
+
+Usa la siguiente secuencia:\\
+\quad 1.\\
+\qquad \emph{a})\\
+\quad\qquad 1)\\
+\qquad\qquad \emph{a$'$})
+
+\begin{decl} \txt |\begin{itemize} ... \end{itemize}|%
+\deact{es-nolists, es-noitemize, \textit{es-nolayout, es-minimal,
+es-sloppy}} \end{decl}
+
+Usa la siguiente secuencia:\\
+\quad\leavevmode\hbox to 1.2ex
+ {\hss\vrule height .95ex width .8ex depth -.15ex\hss}\\
+\qquad\textbullet\\
+\quad\qquad $\circ$\\
+\qquad\qquad $\diamond$
+
+\begin{decl}
+\con |\spanishdashitems \spanishsignitems|
+\end{decl}
+
+Dos órdenes para cambiar a otros estilos en |itemize|: rayas en todos
+los niveles y \textbullet{} $\circ$ $\diamond$ $\triangleright$,
+respectivamente.
+
+\begin{decl}
+\con |es-nolists|\opp
+\end{decl}
+
+Desactiva los cambios en las listas (aunque |\es@enumerate| y
+|\es@itemize| siguen disponibles).
+
+\subsection{Contadores}
+
+\begin{decl}
+\txt |\alph \Alph|\deact{\textit{es-nolayout, es-sloppy}}
+\end{decl}
+
+Incluyen la eñe.
+
+\begin{decl}
+\txt |\fnsymbol|\deact{\textit{es-nolayout, es-sloppy}}
+\end{decl}
+
+Se emplean uno, dos, tres... asteriscos (*, **, ***, etc.), en lugar
+de la sucesión angloamericana de cruces, barras,
+etc.\footnote{\DOT{162}.}
+
+\begin{decl}
+\txt |\roman|\deact{es-ucroman, es-lcroman, \textit{es-nolayout, es-minimal, es-sloppy}}
+\end{decl}
+
+Como en castellano no se usan números romanos en minúscula, |\roman|
+se redefine para que los dé en versalitas.\footnote{\DTL{197}.} La
+opción de paquete |es-minimal| los desactiva con |es-ucroman|, y
+|es-sloppy| con |es-lcroman|.
+
+\begin{decl}
+\con |es-ucroman|\opp
+\end{decl}
+
+Opción de paquete adicional, que pasa los romanos a versales, en
+caso de que no se quiera la versalita o por incompatibilidad con algún
+paquete que use de forma indebida |\roman|.\footnote{En el momento de
+escribir esto, como mínimo son: \textsf{dramatist, epiolmec,
+flashcards, lipsum, ntheorem, ntheorem-hyper, texmate.} Otros paquetes
+como \textsf{hyperref, easy} y \textsf{exam} ya han sido corregidos.}
+
+\begin{decl}
+\con |es-lcroman|\opp
+\end{decl}
+
+Como último recurso, de haber problemas con el valor predeterminado o
+con |es-ucroman|, con esta opción de paquete puede dejarse la
+definición de \LaTeX, aunque en español los romanos en minúscula sean
+una falta ortográfica.
+
+\begin{decl}
+\con |es-preindex|\opp
+\end{decl}
+
+\textit{MakeIndex} no puede entender cómo escribe |\roman|
+el número de página, por lo que elimina las líneas afectadas. Por
+ello, el archivo |.idx| ha de ser convertido antes de procesarlo con
+\textit{MakeIndex}. Con este paquete se proporciona la utilidad
+|romanidx.sty| que se encarga de ello. Simplemente se compone ese
+archivo con \LaTeX{} y a continuación se responde a las preguntas que
+se formulan; el archivo resultante, es decir, el que hay que procesar
+con \textit{MakeIndex,} tiene la extensión \texttt{eix}.
+
+Este proceso no es necesario si no se introdujo ninguna entrada de
+índice en páginas numeradas con |\roman| (lo cual será lo más normal).
+Si un símbolo propio de \emph{MakeIndex} generara problemas, debe
+encerrarse entre llaves: \verb={"|}=.
+
+Con la opción de paquete |es-preindex| se llama desde el documento
+|romanidx.sty|, de forma que no es necesaria su ejecución
+aparte. Tampoco pide ningún dato, sino que ha de darse en el documento
+principal con la siguiente orden.
+
+\begin{decl}
+\con |\spanishindexchars|\marg{encap}\marg{open\_range}\marg{close\_range}
+\end{decl}
+
+De usarse |es-preindex| con un estilo de índice que no tiene los
+valores predeterminados de estos tres caracteres especiales, hay que
+darlos con esta orden (es decir, por omisión es
+\verb+\spanishindexchars{|}{(}{)}+).
+
+\begin{decl}
+\con |\spanishscroman \spanishlcroman \spanishucroman|
+\end{decl}
+
+Estas tres macros permiten cambios temporales en el documento de
+|\roman| a versalitas, minúsculas y mayúsculas, respectivamente.
+
+\subsection{Otros}
+
+\begin{decl}
+\txt |\guillemotleft \guillemotright|\deact{\textit{es-nolayout, es-sloppy}}
+\end{decl}
+
+Las comillas latinas para |OT1| son menos angulosas y se generan con
+unas puntas de flecha de |lasy|. En |T1| no hay cambios.
+
+\begin{decl}
+\txt |\section|, |\subsection|, etc.,
+|\tableofcontents|\deact{es-nosectiondot, es-noindentfirst, \textit{es-nolayout,
+es-mininal, es-sloppy}}
+\end{decl}
+
+Los números en los títulos están seguidos de un punto tanto en el
+texto como en el índice. Además, el primer párrafo tras el título no
+elimina la sangría.
+
+\begin{decl}
+\con |es-nolayout|\opp
+\end{decl}
+
+Si no se desea ninguno de estos cambios, basta con usar esta opción de
+paquete.
+
+\section{Traducciones}
+
+\subsection{Nombres}
+
+\begin{decl}
+\txt |\refname|, |\tablename|, |\contentsname|, etc.\\
+\con |\spanishrefname|, |\spanishtablename|, |\spanishcontentsname|, etc.
+\act{captions}
+\end{decl}
+
+Establecen las traducciones al castellano de algunos términos, tal y
+como se describe en el cuadro 1. Para cambiar el texto de ellas,
+conviene redefinir la forma que empieza con |\spanish...|, ya que, al
+contrario que las órdenes |\refname|, |\abstractname|, etc., se pueden
+redefinir cuando se desee y entran en acción al momento y de forma
+permanente, sin necesidad de |\addto|.
+
+\begin{table}
+\center\small
+\newcommand\name[2]{%
+\texttt{\textbackslash#1name}&%
+\texttt{\textbackslash spanish#1name}&}
+\caption{Traducciones}
+\vspace{1.5ex}
+\begin{tabular}{l@{\hspace{3em}}l@{\hspace{3em}}l}
+\toprule3
+\name{ref} & Referencias\\
+\name{abstract} & Resumen\\
+\name{bib} & Bibliografía\\
+\name{chapter} & Capítulo\\
+\name{appendix} & Apéndice\\
+\name{contents} & índice general\nm{a}\\
+\name{listfigure} & índice de figuras\\
+\name{listtable} & índice de cuadros\\
+\name{index} & índice alfabético\\
+\name{figure} & Figura\\
+\name{table} & Cuadro\\
+\name{part} & Parte\\
+\name{encl} & Adjunto\\
+\name{cc} & Copia a\\
+\name{headto} & A\\
+\name{page} & página\\
+\name{see} & véase\\
+\name{also} & véase también\\
+\name{proof} & Demostración
+\botrule3
+\end{tabular}
+
+\vspace{1.5ex}
+
+\begin{minipage}{10cm}\footnotesize
+\nt{a} Pero solo <<índice>> en \textsf{article}.
+\end{minipage}
+\end{table}
+
+\begin{decl}
+\con |es-uppernames|\opp
+\end{decl}
+
+Aunque sea un anglicismo,\footnote{\DOT{197}.} con esta opción de
+paquete los sustantivos tienen mayúscula inicial.
+
+\begin{decl}
+\con |es-tabla|\opp
+\end{decl}
+
+En caso de que todos los cuadros sean tablas, esta opción permite
+cambiar \textit{cuadro} por \textit{tabla} (en cierto modo,
+\textit{cuadro} es a \textit{tabla} lo que \texttt{table} es a
+\texttt{tabular}).
+
+\subsection{Fechas}
+
+\begin{decl}
+\txt |\today \Today|
+\act{date}
+\end{decl}
+
+Fecha actual, en la forma \textit{1 de enero de 2004.} Con |\Today| el
+mes va en mayúscula. Estas macros se definen a su vez con las siguientes.
+
+\begin{decl}
+\txt |\spanishdate|\marg{año}\marg{mes}\marg{día}
+ | \spanishDate|\marg{año}\marg{mes}\marg{día}\alw
+\end{decl}
+
+El orden de los datos es el de la ISO. Así, |\today| es lo mismo que
+|\spanishdate{\year}{\month}{\day}|. Solo maneja bien (de momento) los
+años de nuestra era.
+
+\begin{decl}
+\con |\spanishdatedel \spanishdatede|
+\end{decl}
+
+Con la primera se cambia el formato para que a partir del 2000 se
+emplee \textit{del} y no \textit{de} (recomendado). La segunda hace
+justo lo contrario (predeterminado).
+
+\begin{decl}
+\con |\spanishreverseddate|
+\end{decl}
+
+Cambia el formato de |\today| a la forma \textit{enero 1 del 2004.}
+Con |\Today| el mes va en mayúscula.
+
+\begin{decl}
+\con |\spanishdatefirst|\marg{día-uno}
+\end{decl}
+
+Establece el formato del primer día. Por defecto es \textit{1}, pero
+se puede cambiar a \textit{1.º}, por ejemplo.
+
+\section{Abreviaciones (\textit{shorthands})}
+
+La lista completa se puede encontrar en el cuadro 2. En los
+siguientes apartados sedarán más detalles sobre algunas de ellas.
+
+\begin{table}[!t]
+\center\small
+\caption{Abreviaciones}
+\vspace{1.5ex}
+\begin{tabular}{l@{\hspace{3em}}l@{\hspace{3em}}l}
+\toprule2
+|á é í ó ú| & á é í ó ú\\
+|á é í ó ú| & á é í ó ú\\
+|ñ ñ| & ñ ñ\nm{a}\\
+|"u "U| & "u "U\\
+|"i "I| & "i "I\\
+|"a "A "o "O| & Ordinales: 1"a, 1"A, 1"o, 1"O\\
+|"er "ER| & Ordinales: 1"er, 1"ER\\
+|"c "C| & "c "C\\
+|"rr "RR| & rr, pero -r cuando se divide\\
+|"y| & El antiguo signo para <<y>>\\
+|"-| & Como |\-|, pero permite más divisiones\\
+|"=| & Como |-|, pero permite mas divisiones\nm{b}\\
+|"~| & Guión estilístico\nm{c}\\
+|"+ "+- "+--| & Como |-|, |--| y |---|, pero sin división\\
+|~- ~-- ~---| & Lo mismo que el anterior.\\
+|""| & Permite mas divisiones antes y después\nm{d}\\
+|"/| & Una barra algo más baja\\
+\verb+"|+ & Divide un logotipo\nm{e}\\
+|"< ">| & "< ">\\
+|"` "'| & |\begin{quoting}| |\end{quoting}|\nm{f}\\
+|<< >>| & Lo mismo que el anterior.\\
+|?` !`| & ?` !`\nm{g}\\
+|"? "!| & "? "! alineados con la linea base\nm{h}
+\botrule2
+\end{tabular}
+
+\vspace{1.5ex}
+
+\begin{minipage}{11cm}
+\footnotesize
+\nt{a} La forma |~n| no está activada por omisión a partir de
+la versión 5.
+\nt{b} |"=| es lo mismo que |""-""|.
+\nt{c} Esta abreviación tiene un uso distinto en otras lenguas
+de babel.
+\nt{d} Como en <<entrada/salida>>.
+\nt{e} Carece de uso en castellano.
+\nt{f} Véase sec.~2.7.
+\nt{g} No proporcionadas por este paquete, sino por cada tipo;
+figuran aquí como simple recordatorio.
+\nt{h} útiles en rótulos en mayúsculas.
+\end{minipage}
+\end{table}
+
+Los caracteres usados como abreviaciones se comportan como otras
+órdenes de \TeX{} y por tanto se hace caso omiso de los espacios que
+les puedan seguir: \verb*|' a| es lo mismo que |á|. Eso también implica
+que tras esos caracteres no puede ir una llave de cierre y que deberá
+escribirse |{... '{}}| en lugar de |{... '}|; en modo matemático no
+hay ningún problema y |$x^{a'}$| ($x^{a'}$) es válido.
+
+\begin{decl}
+\con |activeacute|\opp
+\end{decl}
+
+Para poder usar apóstrofos como abreviaciones de acentos es necesaria
+esta opción en |\usepackage|. Puede cambiarse este comportamiento con
+|\es@acuteactive| en el archivo de configuración |spanish.cfg|; en ese
+caso los apóstrofos se activan siempre.
+
+\begin{decl}
+\con |es-tilden|\opp
+\end{decl}
+
+Esta orden activa las abreviaciones |~n| y |~N| por compatibilidad con
+versiones anteriores de \textsf{spanish} (y siempre que no se emplee
+también |es-notilde|). En la versión 5 no están activadas de forma
+predeterminada.
+
+\begin{decl}
+\con |\spanishdeactivate|\marg{caracteres}
+\end{decl}
+
+Permite desactivar las abreviaciones correspondientes a los caracteres
+dados. Para evitar entrar en conflicto con otras lenguas, al salir de
+\textsf{spanish} se reactivan,\footnote{El punto para los decimales no
+es estrictamente una abreviación y no se reactiva.} por lo que si se
+desea que persistan hay que añadir la orden a |\shorthandsspanish| con
+|\addto|. La orden |\renewcommand\shorthandsspanish{}| es una variante
+optimizada de
+\begin{verbatim}
+\addto\shorthandsspanish{\spanishdeactivate{.'"~<>}}
+\end{verbatim}
+
+\begin{decl}
+\con |es-noshorthands|\opp
+\end{decl}
+
+No activa ninguna abreviación.
+
+\subsection{Coma decimal}
+
+\begin{decl}
+\txt |.|\textit{número}\act{shorthands}\deact{es-nodecimaldot,
+\textit{es-noshorthands, es-minimal, es-sloppy}}
+\end{decl}
+
+En \textsf{spanish}, el punto en matemáticas sirve como marca decimal
+genérica que puede representarse como coma o punto; funciona por tanto
+como marcado lógico del signo para decimales. Por omisión, se siguen
+las normas internacionales ISO y la legislación de diversos países
+(como de España y México), tal como eran hasta el 2009, de emplear la
+coma; desde el año 2010 las Academias de la Lengua recomiendan el
+punto. Ya que \TeX\ usa la coma como separador en intervalos o
+expresiones similares, lo que añade un espacio fino, \textsf{spanish}
+interpreta todo punto en modo matemático de esta forma siempre que
+esté seguido de una cifra, pero no en otras circunstancias:
+\begin{quote}\small\begin{tabbing}
+|$1\,234.567\,890$| \quad \= $1\,234.567\,890$\\
+|$f(1,2)=12.34.$| \> $f(1,2)=12.34.$\\
+|$1{.}000$| \> $1{.}000$, pero\\
+|1.000| \> 1.000, pues no es modo matemático.
+\end{tabbing}\end{quote}
+
+\begin{decl}
+\con |\decimalcomma \decimalpoint \spanishdecimal|\marg{math}
+\end{decl}
+
+Las dos primeras establecen si se usa una coma (predeterminado) o un
+punto, mientras que |\spanishdecimal|\marg{math} permite darle una
+definición arbitraria.
+
+\begin{decl}
+\con |es-nodecimaldot|\opp
+\end{decl}
+
+Cancela el mecanismo del punto decimal.
+
+\subsection{División de palabras}
+
+\textsf{Spanish} comprueba la codificación en el momento en que se
+usa un acento: si es |OT1|, se toman medidas para facilitar la
+división (que pese a todo nunca será perfecta), y si es |T1|,
+se accede directamente al carácter correspondiente.
+
+\begin{decl}
+\txt |"- "= "~|\act{shorthands}
+\deact{\textit{es-noshorthands, es-sloppy}}
+\end{decl}
+
+Para matizar la división de palabras hay cuatro posibilidades, dos de
+ellas con el método de abreviaciones:
+\begin{itemize}
+\item |\-| es un guión opcional que no permite más divisiones,
+\item |"-| es similar pero permite más divisiones,
+\item |-| es un guión que no permite más divisiones ni antes ni
+ después, y
+\item |"=| es el equivalente que sí las permite.\footnote{No es una
+ buena idea usar esta orden, pero en medidas muy cortas puede
+ resultar necesario.}
+\end{itemize}
+Por ejemplo (con las posibles divisiones marcadas con \hmk):
+\begin{quote}\small\begin{tabbing}
+|Zaragoza-Barcelona|\qquad \= Zaragoza-\hmk Barcelona\\
+|Zaragoza"=Barcelona| \>
+ Za\hmk ra\hmk go\hmk za-\hmk Bar\hmk ce\hmk lo\hmk na\\
+|semi\-abierto| \> semi\hmk abierto\\
+|semi"-abierto| \> se\hmk mi\hmk abier\hmk to.\footnotemark
+\end{tabbing}\footnotetext{Justo antes y después de
+{\ttfamily\string"\string-} y {\ttfamily\string"\string=} se aplican
+los correspondientes valores de {\ttfamily\string\...hyphenmin} lo que
+implica que la divisón semia\hmk bierto no es posible. Este es un
+comportamiento correcto.}
+\end{quote}
+
+Con la abreviación |"~|, el guión también aparece al comienzo de la
+siguiente línea. Por ejemplo:
+\begin{quote}\small\begin{tabbing}
+|infra"~rojo| \quad \= in\hmk fra-ro\hmk jo, pero infra-\hmk-rojo.
+\end{tabbing}\end{quote}
+
+\begin{decl}
+\txt |"+ "+- "+--|\act{shorthands}\deact{\emph{no-shorthands,
+es-sloppy}}
+\end{decl}
+\vskip-1.5pc\vskip0pt
+\begin{decl}
+\txt |~- ~-- ~---|\act{shorthands}\deact{es-notilde, \emph{no-shorthands,
+es-minimal, es-sloppy}}
+\end{decl}
+
+Evitan divisiones: |~-|, que resulta útil para expresar una serie de
+números sin que el guión los divida (12~-14, |12~-14|), y |~---|, que
+es la forma que debe usarse para abrir incisos con rayas, ya que de lo
+contrario puede haber una división entre la raya de abrir y la palabra
+que le sigue:
+\begin{quote}\small\begin{tabbing}
+|Los conciertos ~---o % academias--- que organizó...|
+\end{tabbing}\end{quote}
+
+También pueden emplearse para esta misma función las abreviaciones
+|"+|, |"+-| y |"+---|. Mientras que este guión evita toda posible
+división en los elementos que une, la raya (---) y la semirraya (--)
+las permiten en las palabras que le precedan o le sigan.
+
+Otra abreviación es |"rr| que sirve para el único cambio de escritura
+que ha tenido algo de uso en una división. La {RAE} indica que al
+añadir un prefijo que termina en vocal a una palabra que comienza con
+\emph{r}, esta última debe doblarse a menos que se unan por un
+guión. Por ejemplo:
+\begin{quote}\small\begin{tabbing}
+|extra"rradio| \quad \= ex\hmk trarra\hmk dio, pero extra-\hmk
+ radio.
+\end{tabbing}\end{quote}
+Actualmente, este cambio se suele rechazar y la {RAE} no lo
+considera.
+
+\subsection{Otros}
+
+\begin{decl}
+\txt |"/|\act{shorthands}\deact{\textit{es-noshorthands, es-sloppy}}
+\end{decl}
+
+Es una utilidad tipográfica más que específicamente española. En
+ciertos tipos, como Times, el extremo inferior de la barra está en la
+línea de base y expresiones como <<am/pm>> resultan poco estéticas.
+|"/| produce una barra que, de ser necesario, se baja ligeramente.
+Computer Modern tiene una barra bien diseñada y no es posible ilustrar
+aquí este punto, pero se escribiría |am"/pm|.
+
+\begin{decl}
+\txt |"y|\act{shorthand}\deact{\textit{es-noshorthands, es-sloppy}}
+\end{decl}
+
+El signo \textit{et tironiano}, que en español se empleó muy a menudo,
+se puede <<imitar>> con |"y|, siempre que se haya cargado el paquete
+|graphics|; de no ser así, se usa la letra $\tau$, aunque la variante
+normal de \TeX{} no es demasiado apropiada.
+
+\section{Funciones de texto y matemáticas}
+
+\subsection{Abreviaturas}
+
+\begin{decl}
+\txt |\sptext|\marg{texto}\act{text}\deact{\textit{es-sloppy}}
+\end{decl}
+
+Pone un punto y le sigue el argumento en voladitas. Para abreviaturas
+como |adm\sptext{ón}| que da adm\sptext{ón}. Hay seis abreviaciones
+asociadas a ordinales: |"a|, |"A|, |"o|, |"O|, |"er| y |"ER| que
+equivalen a |\sptext{a}|, etc. Muchos tipos añaden un pequeño
+subrayado que debe evitarse, y por tanto no se deben escribir los
+ordinales con \textsf{inputenc} (a menos que se esté seguro de que el
+resultado es el que se busca).
+
+Para ajustar el tamaño lo mejor posible, se usa el de índices en
+curso. Esto funciona bien salvo para tamaños muy grandes o muy
+pequeños, donde los resultados son meramente aceptables.
+
+En Plain \TeX{} se ejecuta |\sptextfont| para la letra voladita, de
+forma que |{\bf\let\sptextfont\bf 1"o}| da el resultado correcto
+(|\mit| si es para cursiva). Para usar un tipo nuevo con |\sptext| hay
+que definir también las variantes matemáticas con |\newfam|.
+
+\subsection{Espaciado}
+
+El espaciado español difiere relativamente poco del inglés, con alguna
+excepción; una de ellas es que en \textsf{spanish} |\frenchspacing|
+está activo.
+
+\begin{decl}
+\txt |\...|\act{text}\deact{\textit{es-sloppy}}
+\end{decl}
+
+Puntos suspensivos menos espaciados que |\dots|. El espacio que sigue
+se conserva:
+\begin{quote}\small\begin{tabbing}
+|\... y solo estaba\... ella.|\quad\=\... y solo estaba\... ella.
+\end{tabbing}\end{quote}
+También podrían escribirse los tres puntos sin más |...|, y en la
+práctica no hay diferencia, a menos que se cambie el valor del espacio
+tras punto; en ese caso, la forma con barra da los valores apropiados
+\emph{dentro} de una sentencia, y los tres puntos \emph{al final} de
+ella. Esta orden no interfiere con el valor original de |\.| (un punto
+suprascrito).
+
+\begin{decl}
+\txt |\%|\act{text}\deact{\textit{es-minimal, es-sloppy}}
+\end{decl}
+
+Se añade un espacio fino antes del signo (en concreto |\,|), con lo
+cual se puede "<recuperar"> con su opuesto |\!| si |\%| no sigue a una
+cifra; también se puede emplear |\percentsign|).
+
+\begin{decl}
+\con |\spanishplainpercent|
+\end{decl}
+
+Orden para que |\%| no añada el espacio fino. Puede ser útil en
+cuadros, si |\%| aparece siempre entre paréntesis.
+
+\subsection{Fuentes}
+
+\begin{decl}
+\txt |\lsc|\marg{texto}\act{text}\deact{\textit{es-sloppy}}
+\end{decl}
+
+Pasa \textit{texto} a versalitas:
+\begin{quote}\small\begin{tabbing}
+|\lsc{RAE}| \quad \= \lsc{RAE}\\
+|\lsc{ReNFe}| \quad \= \lsc{ReNFe}.\\
+|siglo \lsc{XVII}| \quad \= siglo \lsc{XVII}\\
+|capítulo \lsc{II}| \quad \= capítulo \lsc{II}.
+\end{tabbing}\end{quote}
+
+Para evitar que con un tipo que carece de versalitas acabe apareciendo
+(por substitución) un texto de minúsculas se intenta usar en estos
+casos las versales \emph{reales} de un tamaño menor (\LaTeX\ tiende a
+sustituir versalitas por versalitas, pero hay excepciones, como con
+las negritas).
+
+\begin{decl}
+\txt |\'{i}|\alw
+\end{decl}
+
+Lo mismo que |\'{\i}|.
+
+\subsection{Entrecomillados}
+
+\begin{decl}
+\txt |\begin{quoting} ... \end{quoting}|\alw
+\end{decl}
+
+El entorno |quoting| entrecomilla un texto, añadiendo comillas de
+seguir al comienzo de cada párrafo en su interior.\footnote{Se puede
+encontrar una detallada exposición de las comillas en \DTL{44 ss.} De
+ahí se ha tomado algún ejemplo.}
+
+\begin{decl}
+\txt |<< >>|\act{shorthands}\deact{es-noquoting,
+ \textit{es-noshorthands, es-minimal, es-sloppy}}
+\end{decl}
+\vskip-1.5pc\vskip0pt
+\begin{decl}
+\txt |"` "'|\act{shorthands}\deact{\textit{es-noshorthands, es-sloppy}}
+\end{decl}
+
+También se pueden emplear las abreviaciones |<<| y |>>| (o
+alternativamente |"`| y |"'|) que se limitan a llamar a |quoting|, que
+por ser entorno considera sus cambios internos como locales. (Es
+decir, |<< ... >>| implica |{<< ... >>}|.) Las abreviaciones |"<| y
+|">| continúan dando sin más los caracteres de comillas de abrir y
+cerrar, respectivamente.
+
+Por ejemplo:
+\begin{verbatim}
+<<Se llaman <<comillas de seguir>> a las que son de cierre,
+pero se colocan al comienzo de cada párrafo cuando se transcribe
+un texto entrecomillado con más de un párrafo.
+
+En su interior, como de costumbre, se usan inglesas.>>
+\end{verbatim}
+cuyo resultado es:
+\begin{quotation}\small
+<<Se llaman <<comillas de seguir>> a las que son de cierre,
+pero se colocan al comienzo de cada párrafo cuando se transcribe
+un texto entrecomillado con más de un párrafo.
+
+En su interior, como de costumbre, se usan inglesas.>>
+\end{quotation}
+
+También se añaden comillas de seguir en listas, excepto con la opción
+\texttt{es-nolists} o cualquier otra que las desactive.
+
+Este entorno se puede redefinir, como por ejemplo:
+\begin{verbatim}
+\renewenvironment{quoting}{\itshape}{}
+\end{verbatim}
+pero en principio no implica un nuevo párrafo, ya que está pensado
+para ser usado también en el texto.
+
+\begin{decl}
+\con |\lquoti| |\rquoti| |\lquotii| |\rquotii| |\lquotiii|
+|\rquotiii|
+\end{decl}
+
+Controlan las comillas en |quoting|, según el nivel en que nos
+encontremos. |\lquoti| son las comillas de abrir más exteriores,
+|\lquotii| las de segundo nivel, etc., y lo mismo para las de cerrar
+con |\rquoti|... Para las de seguir siempre se usan las de cerrar. Los
+valores predefinidos están en el cuadro 3.
+\begin{table}
+\center\small
+\caption{Entrecomillados}
+\vspace{1.5ex}
+\begin{tabular}{l@{\hspace{5em}}l}
+\toprule2
+|\lquoti| &|"<|\\
+|\rquoti| &|">|\\
+|\lquotii| &|``|\\
+|\rquotii| &|''|\\
+|\lquotiii| &|`|\\
+|\rquotiii| &|'|
+\botrule2
+\end{tabular}
+\end{table}
+
+\begin{decl}
+\con |\activatequoting \deactivatequoting|
+\end{decl}
+
+Las incompatibilidades potenciales de estas abreviaciones son
+enormes. Por ejemplo, en \textsf{ifthen} se cancelan las comparaciones
+entre números;\,\footnote{Y en \texttt{\textbackslash ifnum},
+\texttt{\textbackslash ifdim}, etc., usado por los desarrolladores en
+los paquetes.} también resultan inoperantes |@>>>| y |@<<<| de
+\textsf{amstex}.\footnote{Aunque en este caso cabe usar los sinónimos
+|@)))| y |@(((|.} Por ello, se da la posibilidad de cancelarlas y
+reactivarlas con estas órdenes, aunque si se está usando
+\textsf{xmltex} ya se desactivan por completo de forma automática. El
+entorno |quoting| siempre permanece disponible.\footnote{Algunos tipos
+disponen de esta ligadura de forma interna para generar los caracteres
+de comillas, por lo que en ellos también podemos usarlos siempre,
+aunque los ajustes proporcionados por \textsf{spanish} se pueden
+perder; por otra parte, tampoco se usan demasiado a menudo.}
+
+\subsection{Funciones matemáticas}
+
+\begin{decl}
+\txt |\lim \limsup \liminf \bmod \pmod \sen \tg|
+etc.\act{math}\deact{\textit{es-minimal, es-sloppy}}
+\end{decl}
+
+Tradicionalmente, las abreviaciones de lo que en \TeX\ se conocen como
+operadores se han formado a partir del nombre castellano, lo que
+implica la presencia del acento en lím (en sus tres formas |\lim|,
+|\limsup| y |\liminf|), máx, mín, ínf y mód (en sus dos formas |\bmod|
+y |\pmod|).
+
+Con \textsf{spanish} pueden seguirse varias convenciones con ayuda de
+las siguientes órdenes:
+\begin{decl} \con |\accentedoperators| |\unaccentedoperators|
+\end{decl}
+Activa o desactiva los acentos. Por omisión se acentúan, como por
+ejemplo: $\lim_{x\to 0}(1/x)$ (|$\lim_{x\to 0}(1/x)$|).
+
+\begin{decl}
+\con |\spacedoperators| |\unspacedoperators|
+\end{decl}
+Activa o desactiva el espacio entre "<arc"> y la función. Lo habitual
+ha sido con espacio; así pues, por omisión se espacia.
+
+También se añaden |\sen|, |\arcsen|, |\tg| y |\arctg|, que dan las
+funciones respectivas.
+\begin{decl}
+\con |\spanishoperators|
+\end{decl}
+
+Otras funciones trigonométricas se encuentran almacenadas en el
+parámetro |\spanishoperators|, que inicialmente incluye cotg, cosec,
+senh y tgh. Estas funciones se han separado porque su forma no está
+normalizada en el ámbito hispanohablante. De esta forma se puede
+cambiar por otras con, por ejemplo:
+\begin{verbatim}
+\renewcommand{\spanishoperators}{ctg arc\,ctg sh ch th}
+\end{verbatim}
+(separadas con espacio). Cuando se selecciona \textsf{spanish} se
+crean órdenes con esos nombres y que dan esas funciones (siempre con
+|\nolimits|). Además de las letras sin acentuar se aceptan las órdenes
+|\,| y |\acute|, que se pasan por alto para formar el nombre. Por
+ejemplo, |arc\,ctg| se escribe en el documento con |\arcctg|,
+|M\acute{a}x| como |\Max| y |cr\acute{i}t| como |\crit| (hay que usar
+|i| y no |\dotlessi|). La orden |\,| responde a
+|\|(|un|)|spacedoperators|, y |\acute| a |\|(|un|)|accentedoperators|.
+
+Conviene que |\spanishoperators| esté en el preámbulo del documento en
+sí, antes de |\selectspanish| o de |\begin{document}|.
+
+\begin{decl}
+\txt |\dotlessi|\act{math}\deact{\textit{es-sloppy}}
+\end{decl}
+
+La \textit{i} sin punto también es accesible directamente en modo
+matemático con |\dotlessi|, de forma que se puede escribir
+|\acute{\dotlessi}|. Por ejemplo,
+|$V_{\mathbf{cr\acute{\dotlessi}t}}$| da
+$V_{\mathbf{cr\acute{\dotlessi}t}}$.
+
+De momento no funciona con luatex ni xetex, por lo que en estos
+sistemas hay que desactivar la acentuación (donde se usa |\dotlessi|)
+o reajustar las definiciones matemáticas.
+
+\section{Opciones generales}
+
+Están pensadas principalmente para documentos basados en una clase
+o un estilo editorial muy preciso que no debe tocarse. Para conocer
+los cambios exactos, véanse las diferentes entradas que describen
+las funciones de \textsf{spanish}.
+
+\begin{decl}
+\con |es-minimal|\opp
+\end{decl}
+
+Anula la mayoría de los cambios pero deja unas cuantas utilidades que
+pueden resultar utiles en el momento de escribir el texto.
+
+\begin{decl}
+\con |es-sloppy|\opp
+\end{decl}
+
+Anula, además, todas las ligaduras sin excepción, la eñe en listas y
+los grupos \textsf{text} y \textsf{math}.
+
+\section{Selección}
+
+\begin{decl}
+|\selectspanish|
+\end{decl}
+
+Por omisión, \babel{} deja <<dormidas>> las lenguas hasta que se llega
+a |\begin{document}| con el fin de evitar conflictos por las
+abreviaciones; a cambio, se priva de la posibilidad de usar las
+lenguas en el preámbulo en órdenes como |\savebox|, |\title|,
+|\newtheorem|, etc.
+
+La orden |\selectspanish| permite activar \textsf{spanish} con sus
+extensiones y abreviaciones antes de
+|\begin{document}|.\footnote{Algunos detalles, que apenas afectan a
+\textsf{spanish}, siguen sin activarse hasta el comienzo del
+documento.} De esta forma, podríamos decir
+\begin{verbatim}
+\documentclass{book}
+\usepackage[T1]{fontenc}
+\usepackage[cp1252]{inputenc}
+\usepackage[spanish,activeacute,es-notilde]{babel}
+... % Mas paquetes
+
+\selectspanish
+
+\title{Título}
+\author{Autor}
+\newcommand{\pste}{para"-psicológicamente}
+... % Mas definiciones
+
+\begin{document}
+\end{verbatim}
+
+\section{Adaptación}
+
+\subsection{Opciones por países}
+\label{paises}
+
+\begin{decl} \con |mexico| \quad |mexico-com|\end{decl}
+
+La primera cambia \textit{cuadro} a \textit{tabla} y desactiva tanto
+|<||<>||>| como el punto decimal. También cambia |"`| y |"'| a
+``\,`\,"<\,">\,'\,''. Es decir, aparte de redefinir las comillas, equivale a:
+\begin{verbatim}
+\usepackage[spanish,es-nodecimaldot,es-tabla,es-noquoting]{spanish}
+\end{verbatim}
+La segunda es similar pero sí activa el punto decimal. (Obsérvese que
+no van precedidas de |es-|.)
+
+Probablemente, esta opción también sea apropiada en algunos países de
+América Central y del Sur.
+
+\subsection{Configuración}
+
+En sus últimas versiones, \babel{} ofrece la posibilidad de cargar
+automáticamente un archivo con el mismo nombre que el principal, pero
+con extensión |.cfg|. Aunque se desaconseja su uso, \textsf{spanish}
+proporciona unas pocas órdenes para ser usadas en este archivo.
+
+\begin{decl}
+\con |\es@activeacute|
+\end{decl}
+Activa las abreviaciones con apóstrofos, sin que sea necesario incluir
+|activeacute| como opción en |\usepackage|.
+
+\begin{decl} \con |\es@enumerate{<leveli>}|%
+ |{<levelii>}{<leveliii>}{<leveliv>}|\alw
+\end{decl}
+Cambia los valores preestablecidos por \textsf{spanish} para
+|enumerate|. \textit{leveln} consiste en una letra, que indica qué
+formato tendrá el número, seguida de cualquier texto. La letra tiene
+que ser: |1| (arábigo), |a| (minúscula \emph{cursiva}\,\footnote{La
+letra es cursiva pero no los signos que le puedan seguir. Más bien
+debería decirse destacada, ya que se usa |\string\emph|. Véase
+\DTL{11}.}), |A| (versal), |i| (romano \emph{versalita}), |I| (romano
+versal) o finalmente |o| (ordinal\,\footnote{Lo normal es no añadir
+ningún signo tras ordinal.}).
+
+Esta orden no está pensada para hacer cambios elaborados, sino
+solo meros reajustes. Los valores preestablecidos
+equivalen a
+\begin{verbatim}
+\es@enumerate{1.}{a)}{1)}{a$'$)}
+\end{verbatim}
+
+\begin{decl} \con |\es@itemize{<leveli>}|%
+ |{<levelii>}{<leveliii>}{<leveliv>}|\alw
+\end{decl}
+Lo mismo para |itemize|, solo que los argumentos se usan de forma
+literal. Los valores originales de \LaTeX{} son similares a
+\begin{verbatim}
+\es@itemize{\textbullet}{\normalfont\bfseries\textendash}
+ {\textasteriskcentered}{\textperiodcentered}
+\end{verbatim}
+
+\begin{decl}\con |\es@operators|\act{math}
+\end{decl}
+Todo lo relativo a operadores se cancela con
+\begin{verbatim}
+\let\es@operators\relax
+\end{verbatim}
+
+Otros ajustes útiles en este contexto son |\spanishoperators|,
+|\selectspanish| y |\deactivatequoting|.
+
+Recordemos que todos los cambios operados desde este archivo restan
+compatibilidad al documento, por lo que si se distribuye conviene
+adjuntarlo con el entorno |filecontents|.
+
+\subsection{Pasar opciones desde un paquete o clase}
+
+\begin{decl} \con |\spanishoptions|
+\end{decl}
+
+Como |\PassOptionsToPackage| añade opciones al comienzo y las opciones
+específicas de \textsf{spanish} han de ir al final, definiendo esta
+macro se puede controlar el comportamiento de \textsf{spanish} antes
+de su carga.
+
+\subsection{Otros cambios}
+
+Las adaptaciones se encuentran organizadas en varios grupos, a los
+que corresponden sendas macros:
+|\textspanish|, |\mathspanish|,
+|\shorthandsspanish|, |\datespanish| y |\captionsspanish|. Pueden
+cancelarse con:
+\begin{verbatim}
+ \renewcommand\textspanish{}
+\end{verbatim}
+
+\section{Plain \TeX}
+
+Con Plain hay que hacer:
+\begin{verbatim}
+\input spanish.sty
+\end{verbatim}
+
+Se incluyen: traducciones, casi todas las abreviaciones, coma decimal,
+utilidades para división de palabras, ordinales en una versión
+simplificada (y no muy elegante), funciones matemáticas, |\í| y
+espaciado. La selección de la lengua es inmediata al cargar el
+archivo.
+
+En cambio no están disponibles: entrecomillados, |\lsc| ni las
+adaptaciones de lengua principal.
+
+\section{Compatibilidad con versiones anteriores}
+
+En versiones de \textsf{babel} bastante antiguas, las abreviaciones
+con |'| se activaban por omisión, mientras que ahora es necesario
+|activeacute|.
+
+En la versión 4, la abreviación |~n| se consideró para extinguir.
+En la versión 5 sigue disponible, pero \textit{no} se activa por
+omisión, sino que hay que emplear |es-tilden|.
+
+En la versión 5 el grupo \textsf{layout} no se retrasa a
+|\begin{document}|, como en la 4, sino que se ejecuta
+inmediatamente. Esto permite cambios en el preámbulo con otros
+paquetes. Con ello, además, |\selectspanish*| carece de utilidad. La
+opción de paquete |es-delayed| restaura el comportamiento anterior,
+por si hubiera alguna incompatibilidad.
+
+La compatibilidad con la versión 2.09 de \LaTeX{} se ha suprimido.
+
+\section*{Referencias}
+\addcontentsline{toc}{section}{Referencias}
+
+\begingroup
+\small
+\leftskip1.5cm \parindent-1.5cm
+
+\makebox[1.5cm][l]{\lsc{DRAE}}\textit{Diccionario de la Academia
+ Española}, Madrid, Espasa-Calpe, 21"a ed., 1992.
+
+\makebox[1.5cm][l]{\lsc{DOT}}José Martínez de Sousa,
+ \textit{Diccionario de ortografía técnica},
+ Madrid, Germán Sánchez Ruipérez/Pirámide, 1987.
+ (Biblioteca del libro.)
+
+\makebox[1.5cm][l]{\lsc{DTL}}José Martínez de Sousa,
+ \textit{Diccionario de tipografía y del libro},
+ Madrid, Paraninfo, 3"a ed., 1992.
+
+\makebox[1.5cm][l]{\lsc{MEA}}José Martínez de Sousa,
+ \textit{Manual de edición y autoedición},
+ Madrid, Pirámide, 1994.
+
+\leftskip0pt \parindent0pt \vspace{6pt}
+
+{\itshape
+Para otras cuestiones tipográficas, las referencias
+usadas son, entre otras:}
+
+\parindent-1.5pc \leftskip1.5pc \vspace{3pt}
+
+Asociación de Academias de la Lengua Española,
+\textit{Diccionario panhispánico de dudas}, Madrid, Santillana, 2005.
+
+Javier Bezos,
+\textit{Tipografía española con \TeX}, documento electrónico
+disponible en
+\textsf{http://perso.wanadoo.es/jbezos/tipografia.html}.
+
+Javier Bezos,
+\textit{Tipografía y notaciones científicas}, Gijón,
+Trea, 2008.
+
+Bureau International des Poids et mesures,
+\textit{Le Sist\`{e}me international dúnités},
+8"a ed., París, {\footnotesize BIPM}, 2006,
+\textsf{http://www.bipm.org/""fr/""si/""si\_brochure/}, 2006-11-10.
+
+Jorge de Buen,
+\textit{Manual de diseño editorial,} México, Santillana, 2000.
+
+\textit{The Chicago Manual of Style}, Chicago, University of
+Chicago Press, 14"a~ed., 1993, esp.~págs.~333~-335.
+
+José Fernández Castillo,
+\textit{Normas para correctores y compositores tipógrafos},
+Madrid, Espasa-Calpe, 1959.
+
+IRANOR [AENOR], Normas \lsc{UNE} números 5010 (<<Signos
+matemáticos>>), 5028 (<<Símbolos
+geométricos>>) y 5029 (<<Impresión de los
+símbolos de magnitudes y unidades y de los números>>).
+[Obsoletas.]
+
+Llerena, Mario,
+\textit{Un manual de estilo,} Miami, Unilit, 1999.
+
+Real Academia Española,
+\textit{Esbozo de una nueva gramática de la
+lengua española}, Madrid, Espasa-Calpe, 1973.
+
+V.\ Martínez Sicluna,
+\textit{Teoría y práctica de la tipografía},
+Barcelona, Gustavo Gili, 1945.
+
+José Martínez de Sousa,
+\textit{Diccionario de ortografía de la lengua española},
+Madrid, Paraninfo, 1996.
+
+Juan Martínez Val, \textit{Tipografía práctica}, Madrid,
+Laberinto, 2002.
+
+Juan José Morato, \textit{Guía práctica del compositor
+tipográfico}, Madrid, Hernando, 2"a ed., 1908 (1"a ed., 1900,
+3"a ed., 1933).
+
+Marion Neubauer,
+<<Feinheiten bei wissenschaftlichen Publikationen>>,
+\textit{Die \TeX nisches Kom\"odie}, parte I, vol. 8, n"o 4, 1996,
+págs. 23-40; parte II, vol. 9, n"o 1, 1997, págs.~25~-44.
+
+Notimex, \textit{Manual de operación y estilo editorial}, México,
+Notimex, 1999.
+
+José Polo,
+\textit{Ortografía y ciencia del lenguaje}, Madrid, Paraninfo,
+1974.
+
+Siglo 21, \textit{Libro de estilo}, México, Alda,
+$\mathrm{^s}\!$/$\mathrm{_f}$
+(impr. 1995).
+
+Pedro Valle,
+\textit{Cómo corregir sin ofender}, Buenos Aires, Lumen, 1998.
+
+Hugh C. Wolfe, <<Símbolos, unidades y nomenclatura>>,
+\textit{Enciclopedia de Física}, dir. Rita G. Lerner y George L.
+Trigg, Madrid, Alianza, 1987, t.~2, págs.~1423~-1451.
+
+\endgroup
+
+\part*{English Summary}
+
+\section{The Spanish language}
+
+The file \file{spanish.dtx}\footnote{The file described in this
+section has version number 5.0p and was last revised on 2016-03-03.
+The maintainer from v4.0 on is Javier Bezos
+(http://www.tex-tipografia.com). Previous versions were made by Julio
+S\'anchez. The English documentation has been improved by José Luis
+Rivera; thanks to him it is now a lot clearer.} defines all the
+language-specific macros for the Spanish language.
+
+Spanish support is implemented following mainly the guidelines given
+by Jos\'e Mart\'\i nez de Sousa. There are examples and some
+additional features documented in the Spanish version only.
+Cross-references in this section point to that document.
+
+\paragraph{Features} This style provides:
+
+\begin{itemize}
+\item Translations following the International \LaTeX{} conventions,
+ as well as |\today|.
+\item Shorthands listed in Table~\ref{tab:spanish-quote-def}.
+ Examples in subsection~3.4 are illustrative. Notice that |"~| has a
+ special meaning in \textsf{spanish} different to other languages,
+ and is used mainly in linguistic contexts.
+\begin{table}[htb]
+\centering
+\begin{tabular}{lp{8cm}}
+|'a| & Acute accented a. Works for e, i, o, u, too (both
+ lowercase and uppercase).\\
+|'n| & \~n (uppercase too).\\
+|"i| & \"i (uppercase too).\\
+|"u| & \"u (uppercase too).\\
+|"a| |"o| & Ordinal numbers (uppercase |"A|, |"O| too).\\
+|"er "ER| & Ordinal 1.\textsuperscript{er} 1.\textsuperscript{\textsc{er}}\\
+|"c| & \c{c} (uppercase too).\\
+|"rr| & rr, but -r when hyphenated.\\
+|"y| & An old ligature for ``et'' (like the English \&).\\
+|"-| & Like |\-|, but allowing hyphenation in the rest
+ the word.\\
+|"=| & Like |-|, but allowing hyphenation in the rest
+ the word.\\
+|"~| & The hyphen is repeated at the very beginning of
+ the next line if the word is hyphenated at this
+ point.\\
+|""| & Like |"-| but producing no hyphen sign.\\
+|~-| & Like |"-| but with no break after the hyphen. Works for
+ en-dashes (|~--|) and em-dashes (|~---|). |"+|, |"+-|
+ and |"+--| are synonymous.\\
+|"/| & A slash slightly lowered, if necessary.\\
+\verb+"|+ & Disable ligatures at this point.\\
+|"<| & Left guillemets.\\
+|">| & Right guillemets.\\
+|<<| |>>| & |\begin{quoting}| and |\end{quoting}|. (See below.)
+ |"`| and |"'| are synonymous.\\
+|"? "!| & Opening question and exlamation marks (?`!`)
+ aligned on the baseline, useful for all-caps headings, etc.
+\end{tabular}
+\caption{Extra definitions made by file \file{spanish.ldf}}
+\label{tab:spanish-quote-def}
+\end{table}
+\item |\frenchspacing|.
+\item \emph{In math mode}, a dot followed by a digit is replaced by a
+ decimal comma.
+\item Spanish ordinals and abbreviations with the |\sptext|\marg{text}
+ command as, for instance, |1\sptext{er}|. The preceptive dot is
+ included.
+\item Accented (l\'\i m, m\'ax, m\'\i n, m\'od) and spaced (arc\,cos,
+ etc.) functions.
+\item |\dotlessi| is provided for use in math mode.
+\item A |quoting| environment and a related pair of shorthands |<<|
+ and |>>|. Useful for traditional spanish multi-paragraph quoting.
+\item There is a small space before the percent |\%| sign.
+\item |\lsc| provides lowercase small caps. (See subsection~3.10.)
+\item Ellipsis is best typed as |...| or, within a sentence, as |\...|
+\end{itemize}
+
+If \textsf{spanish} is the main language, the command
+|\layoutspanish| is added to the main group, modifying the standard
+classes throughout the whole document in the following way:
+
+\begin{itemize}
+\item Paragraphs are set with |\indentfirst|.
+\item Both |enumerate| and |itemize| are adapted to Spanish rules.
+\item Both |\alph| and |\Alph| include \textit{\~n} after \textit{n}.
+\item Symbol footmarks are one, two, three, etc., asterisks.
+\item |OT1| guillemets are generated with two |lasy| symbols instead
+ of small |\ll| and |\gg|.
+\item |\roman| is redefined to write small caps Roman numerals, since
+lowercase Roman numerals are discouraged (see below).
+\item There is a dot after section numbers in titles, headings, and toc.
+\end{itemize}
+
+A subset of these features is implemented for Plain \TeX{}
+(accesible with the command |\input spanish.sty|). Most
+significantly, |\lsc|, the |quoting| environment, and features
+provided by |\layoutspanish| are missing.
+
+\paragraph{Customization}
+
+Beginning with version 5.0, customization is made following two paths:
+via |options| or via |commands|; these options and commands override
+the layout for Spanish documents at different levels: options are meant for
+use at the preamble only, while commands may be used in the configuration
+file or at document level.
+
+Global options control the overall appearance of the document, and may
+be set on the |{babel}| call, right after calling |spanish|, or
+shortly before the call to |{babel}|, to ensure their proper loading
+at runtime. Thus, the following calls are roughly equivalent:
+
+\begin{verbatim}
+\usepackage[...,spanish,es-nosectiondot,es-nodecimaldot,...]{babel}
+
+\def\spanishoptions{es-nosectiondot,es-nodecimaldot}
+\usepackage[...,spanish,...]{babel}
+\end{verbatim}
+
+\begin{table}
+\centering
+\begin{tabular}{cccc}\hline
+ Basic Options & |es-minimal| & |es-sloppy| & |es-noshorthands| \\\hline
+ |es-noindentfirst| & X & X & \\
+ |es-nosectiondot| & X & X & \\
+ |es-nolists| & X & X & \\
+ |es-noquoting| & X & X & X \\
+ |es-notilde| & X & X & X \\
+ |es-nodecimaldot| & X & X & X \\
+ |es-nolayout| & & X & \\
+ |es-ucroman| & X & & \\
+ |es-lcroman| & X & X & \\\hline
+\end{tabular}
+ \caption{Spanish Customization Options}
+ \label{tab:SpanishCustomizationOptions}
+\end{table}
+
+Some global options are built upon lower level options, and may be
+used as shorthand for more global customizations.
+Table~\ref{tab:SpanishCustomizationOptions} gives an overview of the
+global options constructed this way. Most of these options are
+self-explanatory: they disable the changes made to the basic \LaTeX\
+layout by |spanish|. |es-lcroman| however, and a few others, need a
+bit of explanation, and they may be described as follows:
+
+\begin{itemize}
+\item Traditional Spanish typography discourages the use of lowercase
+ Roman numerals; instead, a smallcaps variant is implemented.
+ However, since |Makeindex| seems to choke on the code implementing
+ lowercase Roman numerals (via the |\lsc| macro), two workarounds are
+ implemented: the |es-ucroman| option converts all Roman numerals to
+ uppercase, and the |es-lcroman| option turns all Roman numerals to
+ lowercase; the former should be preferred over the latter. Three
+ macros control local changes to Roman numbers: |\spanishscroman|,
+ |\spanishucroman|, and |\spanishlcroman|.
+\item The |es-preindex| option calls the |romanidx.sty| package
+ automatically to fix index entries in smallcaps roman form. An
+ additional macro,
+ |\spanishindexchars|\marg{encap}\marg{openrange}\marg{closerange}
+ determines the characters delimiting index entries. Defaults are
+ \verb=\spanishindexchars{|}{(}{)}=.
+\item The |es-tilden| option restores the old tilde |~| shorthand for
+ \~n. This shorthand is however \emph{strongly} deprecated.
+\item The |es-nolayout| option disables layout changes in the document
+ when |spanish| is the main language. These changes affect
+ enumerated and itemized lists, enumerations (alphabetic order
+ excludes \~n), and symbolic footnotes.
+\item The |es-noshorthands| disables the shorthand mechanism
+ completely: neither |"| nor |'| nor |<| nor |>| nor |~| nor |.| work
+ at all.
+\item The |es-noquoting| option disables the macros |<<| and |>>|
+ calling the |quoting| environment; the alternative macros |"`| and
+ |"'| are still available.
+\item The |es-uppernames| option makes uppercase versions of captions
+ for chapter, tablename, etc.
+\item The |es-tabla| option changes ``cuadro'' for ``tabla'' in
+ captions.
+\end{itemize}
+
+Finally, the Spanish 5 series begins the implementation of national
+variations of Spanish typography, beginning with Mexico. Thus the
+global options |mexico| and |mexico-com| are adapted to practices
+spread in Mexico, and perhaps Central America, the Caribbean, and
+some countries in South America.\footnote{The main difference is
+that |mexico| disables the |decimaldot| mechanism, while
+|mexico-com| keeps it enabled; both change the |quoting|
+environment, disabling the use of guillemets.}
+
+Many of the global options are implemented via macros, which may be
+included in the configuration file |spanish.cfg|, in the preamble,
+after the call to |babel|, and in the body of the document. These
+macros are the following.
+
+\begin{itemize}
+\item The macros |\spanishdashitems| and |\spanishsignitems| change
+ the values of itemized lists to a series of dashes or an alternative
+ series of symbols, respectively.
+\item The command |\deactivatequoting| deactivates the |<<| and |>>|
+ shorthands if you want to use |<| and |>| in numerical comparisons
+ and some AMS\TeX\ commands.
+\item You may kill the space in spaced operators with
+ |\unspacedoperators|.
+\item You may kill the accents on accented operators with
+ |\unaccentedoperators|.
+\item The command |\decimalpoint| resets the decimal separator to its
+ default (dot) value, while |\spanishdecimal|\marg{symbol} allows for
+ an arbitrary definition.
+\item |\spanishplainpercent| prevents the addition of a thinspace
+ before the percent sign in texts. This might be useful for
+ parenthesized percent signs in tables, etc.
+\item The macros |\spanishdatedel| and |\spanishdatede| control the if
+ the article is given in years (|del| or |de|).
+\item The macro |\spanishreverseddate| sets the date of the format
+ ``Month Day del Year''.
+\item The macro |\Today| gives months in uppercase.
+\item The macros |\spanish|\textit{caption} change the value of the
+ \emph{caption} automatically (no need to add an |\addto|).
+\item The command |\spanishdeactivate|\marg{characters} disables the
+ shorthand characters listed in the argument. Elegible characters
+ are the set |.'"~<>|. These shorthand characters may be globally
+ deactivated for Spanish adding this command to |\shorthandsspanish|.
+\item Extras are divided in groups controlled by the commands
+ |\textspanish|, |\mathspanish|, |\shorthandsspanish| y
+ |\layoutspanish|; their values may be cancelled typing
+ |\renewcommand|\marg{command}|{}|, or changed at will (check the
+ Spanish documentation or the code for details).
+\item The command |\spanishoperators|\marg{operators} defines command
+ names for operators in Spanish. There is no standard name for some
+ of them, so they may be created or changed at will. For instance,
+ the command |\renewcommand{\spanishoperators}{arc\,ctg m\acute{i}n}|
+ creates commands for these functions. The command |\,| adds
+ thinspaces at the appropriate places for spaced operators (like
+ |\arcctg| in this case), and the command |\acute|\marg{letter} adds
+ an accent to the letter included in the definition (thus,
+ |m\acute{i}n| defines the accented function |\min| (m\'\i{}n);
+ please notice that |\dotlessi| is not necessary).
+\item The commands |\lquoti|\marg{string} |\rquoti|\marg{string}
+ |\lquotii|\marg{string} |\rquotii|\marg{string}
+ |\lquotiii|\marg{string} |\rquotiii|\marg{string} set the quoting
+ signs in the |quoting| environment, nested from outside in. They may
+ be |\renew|ed at will. Default values are shown in
+ table~\ref{tab:spanish-quote-ref}.
+\begin{table}
+\center\small
+\vspace{1.5ex}
+\begin{tabular}{l@{\hspace{5em}}l}
+|\lquoti| &|"<|\\
+|\rquoti| &|">|\\
+|\lquotii| &|``|\\
+|\rquotii| &|''|\\
+|\lquotiii| &|`|\\
+|\rquotiii| &|'|
+\end{tabular}
+\caption{Default quoting signs set for the \texttt{quoting} environment.}
+\label{tab:spanish-quote-ref}
+\end{table}
+
+\item The command |\selectspanish*| is obsolete: if |spanish| is the
+main language, all its features are available right after loading
+|babel|. The |es-delayed| option is provided to restore the
+previous behavior and macros for backwards compatibility.
+
+\end{itemize}
+
+\end{document}
+%</filedriver>
+%\fi
+%
+% \StopEventually{}
+% \section{The Code}
+%
+% \changes{spanish~5.0a}{2007/02/21}{Reimplemented in full, which some
+% parts rewritten from scratch. Added the es- mechanism and the mexico
+% option. Many bug fixes.}
+% \changes{spanish~5.0d}{2008/05/25}{Fixed two bugs: misplaced
+% subscripts with lim and the like; problem with \cs{roman} and hyperref.}
+% \changes{spanish~5.0h}{2009/01/02}{Removed unnecessary \cs{string}s
+% with two acutes. Added es-noenumerate, es-noitemize.}
+% \changes{spanish~5.0i}{2009/05/11}{romanidx not working. Some \cs{es@roman}
+% replaced with \cs{es@scroman}.}
+% \changes{spanish~5.0j}{2010/01/06}{Overdot \cs{.} was not robust.}
+% \changes{spanish~5.0j}{2010/04/04}{Colon in saved catcodes, because
+% babel doesn't restore it after french}
+% \changes{spanish~5.0j}{2010/05/08}{Changed order of tests in
+% shorthands, to fix a bug with ifthen}
+% \changes{spanish~5.0k}{2011/08/08}{When saving ., check if
+% \cs{mathcode} is 8000}
+% \changes{spanish~5.0l}{2013/04/11}{Support for babel modifiers}
+% \changes{spanish~5.0m}{2014/01/29}{\cs{S@}size surrounded by
+% \cs{globalsdef} to avoid global changes in the size}
+% \changes{spanish~5.0m}{2014/01/29}{Execute the first \cs{bbl@allowhyphens}
+% in \cs{es@accent} only in horizontal mode}
+% \changes{spanish~5.0n}{2014/01/30}{\cs{es@accent} -- Removed first
+% \cs{bbl@allowhyphens}, the second one is ignored if a space
+% follows, removed code for spacefactor, removed code for primes}
+% \changes{spanish~5.0n}{2014/04/14}{Check font name in \cs{dotlessi}}}
+% \changes{spanish~5.0n}{2014/04/23}{Added \cs{spanishdate} and
+% \cs{spanishDate}}
+% \changes{spanish~5.0o}{2016/01/14}{Added \cs{spanishdate} and
+% \cs{spanishDate}}
+%
+% This file is (hopefully) for both \LaTeXe{} and Plain formats.
+%
+% \begin{macrocode}
+%<*code>
+\ProvidesLanguage{spanish.ldf}
+ [2016/03/03 v5.0p Spanish support from the babel system]
+\LdfInit{spanish}\captionsspanish
+
+\edef\es@savedcatcodes{%
+ \catcode`\noexpand\~=\the\catcode`\~
+ \catcode`\noexpand\"=\the\catcode`\"
+ \catcode`\noexpand\:=\the\catcode`\:}
+\catcode`\~=\active
+\catcode`\"=12
+\catcode`\:=12
+
+\ifx\undefined\l@spanish
+ \@nopatterns{Spanish}
+ \adddialect\l@spanish0
+\fi
+
+\def\es@sdef#1{\babel@save#1\def#1}
+\def\es@sDRC#1{\babel@save#1\DeclareRobustCommand*#1}
+
+\@ifundefined{documentclass}
+ {\let\ifes@latex\iffalse}
+ {\let\ifes@latex\iftrue}
+% \end{macrocode}
+%
+% Package options for spanish. To avoid error messages dummy
+% options are created on the fly when neccessary.
+%
+% \begin{macrocode}
+\ifes@latex
+
+\@ifundefined{spanishoptions}{}
+{\PassOptionsToPackage{\spanishoptions}{babel}}
+
+\def\es@genoption#1#2#3{%
+ \DeclareOption{#1}{}%
+ \@ifpackagewith{babel}{#1}%
+ {\def\es@a{#1}%
+ \expandafter\let\expandafter\es@b\csname opt@babel.sty\endcsname
+ \addto\es@b{,#2}%
+ \expandafter\let\csname opt@babel.sty\endcsname\es@b
+ \AtEndOfPackage{#3}}%
+ {}}
+
+\es@genoption{es-minimal}
+ {es-ucroman,es-noindentfirst,es-nosectiondot,es-noenumerate,%
+ es-noitemize,es-noquoting,es-notilde,es-nodecimaldot}
+ {\spanishplainpercent
+ \let\es@operators\relax}
+\es@genoption{es-nolists}
+ {es-noenumerate,es-noitemize}{}
+\es@genoption{es-sloppy}
+ {es-nolayout,es-noshorthands}{}
+\es@genoption{es-noshorthands}
+ {es-noquoting,es-nodecimaldot,es-notilde}{}
+\es@genoption{mexico}
+ {mexico-com,es-nodecimaldot}{}
+\es@genoption{mexico-com}
+ {es-tabla,es-noquoting}
+ {\def\lquoti{``}\def\rquoti{''}%
+ \def\lquotii{`}\def\rquotii{'}%
+ \def\lquotiii{\guillemotleft{}}%
+ \def\rquotiii{\guillemotright{}}}
+
+\def\es@ifoption#1#2#3{%
+ \@ifundefined{BabelModifiers}%
+ {\DeclareOption{es-#1}{}%
+ \@ifpackagewith{babel}{es-#1}{#2}{#3}}
+ {\@expandtwoargs\in@{,#1,}{,\BabelModifiers,}%
+ \ifin@#2\else#3\fi}}
+
+\def\es@optlayout#1#2{\es@ifoption{#1}{}{\addto\layoutspanish{#2}}}
+
+\else
+
+\def\es@ifoption#1#2#3{\@namedef{spanish#1}{#2}}
+
+\fi
+
+\let\es@uclc\@secondoftwo
+\es@ifoption{uppernames}{\let\es@uclc\@firstoftwo}{}
+
+\def\es@tablename{Ccuadro}
+\es@ifoption{tabla}{\def\es@tablename{Ttabla}}{}
+\es@ifoption{cuadro}{\def\es@tablename{Ccuadro}}{}
+% \end{macrocode}
+%
+% Captions follow a two step schema, so that, say, |\refname| is
+% defined as |\spanishrefname| which in turn contains the string
+% to be printed. The final definition of |\captionsspanish|
+% is built below.
+%
+% \begin{macrocode}
+\StartBabelCommands*{spanish}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+
+ \AddBabelHook{spanish}{stringprocess}{%
+ \protected@edef\BabelString{\BabelString}}
+ \SetString{\bibname}{Bibliografía}%
+ \SetString{\chaptername}{Capítulo}%
+ \SetString{\appendixname}{Apéndice}%
+ \SetString{\listfigurename}{Índice de \es@uclc Ffiguras}%
+ \SetString{\listtablename}{Índice de \expandafter\es@uclc\es@tablename s}%
+ \SetString{\indexname}{Índice \es@uclc Aalfabético}%
+ \SetString{\pagename}{página}%
+ \SetString{\seename}{véase}%
+ \SetString{\alsoname}{véase también}%
+ \SetString{\proofname}{Demostración}%
+ \@ifundefined{chapter}
+ {\SetString{\contentsname}{Índice}}%
+ {\SetString{\contentsname}{Índice \es@uclc Ggeneral}}
+
+\StartBabelCommands*{spanish}{captions}
+
+ \AddBabelHook{spanish}{stringprocess}{%
+ \protected@edef\BabelString{\BabelString}}
+ \SetString{\prefacename}{Prefacio}%
+ \SetString{\refname}{Referencias}%
+ \SetString{\abstractname}{Resumen}%
+ \SetString{\bibname}{Bibliograf\'{\i}a}%
+ \SetString{\chaptername}{Cap\'{\i}tulo}%
+ \SetString{\appendixname}{Ap\'{e}ndice}%
+ \SetString{\listfigurename}{\'{I}ndice de \es@uclc Ffiguras}%
+ \SetString{\listtablename}{\'{I}ndice de \expandafter\es@uclc\es@tablename s}%
+ \SetString{\indexname}{\'{I}ndice \es@uclc Aalfab\'{e}tico}%
+ \SetString{\figurename}{Figura}%
+ \SetString{\tablename}{\expandafter\@firstoftwo\es@tablename}%
+ \SetString{\partname}{Parte}%
+ \SetString{\enclname}{Adjunto}%
+ \SetString{\ccname}{Copia a}%
+ \SetString{\headtoname}{A}%
+ \SetString{\pagename}{p\'{a}gina}%
+ \SetString{\seename}{v\'{e}ase}%
+ \SetString{\alsoname}{v\'{e}ase tambi\'{e}n}%
+ \SetString{\proofname}{Demostraci\'{o}n}%
+ \SetString{\glossaryname}{Glosario}%
+ \@ifundefined{chapter}
+ {\SetString{\contentsname}{\'{I}ndice}}%
+ {\SetString{\contentsname}{\'{I}ndice \es@uclc Ggeneral}}
+% \end{macrocode}
+%
+% Now two macros for dates (upper and lowercase).
+%
+% \begin{macrocode}
+\StartBabelCommands*{spanish}{date}
+
+ \SetStringLoop{month#1name}{enero,febrero,marzo,abril,mayo,junio,%
+ julio,agosto,septiembre,octubre,noviembre,diciembre}
+ \SetStringLoop{ucmonth#1name}{Enero,Febrero,Marzo,Abril,Mayo,Junio,%
+ Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre}
+ \SetString\today{\spanishdate{\year}{\month}{\day}}
+ \SetString\Today{\spanishDate{\year}{\month}{\day}}
+
+\EndBabelCommands
+
+\newcommand\spanishdate{\es@date{}}
+\newcommand\spanishDate{\es@date{uc}}
+\def\es@date#1#2#3#4{%
+ \ifcase\es@datefmt
+ \ifnum#4=1
+ \es@datefirst
+ \else
+ \number#4\relax
+ \fi
+ ~de \csname#1month\romannumeral#3name\endcsname
+ \else
+ \csname#1month\romannumeral#3name\endcsname~%
+ \ifnum#4=1
+ \es@datefirst
+ \else
+ \number#4\relax
+ \fi
+ \fi
+ \ de%
+ \ifnum#2>1999\relax\es@yearl
+ \else\ifnum#2<1100\es@yearl
+ \fi\fi
+ ~\number#2\relax}
+\chardef\es@datefmt=\z@
+\def\spanishreverseddate{\chardef\es@datefmt=\@ne}
+\def\spanishdatedel{\def\es@yearl{l}}
+\def\spanishdatede{\let\es@yearl\@empty}
+\spanishdatede
+\def\spanishdatefirst{\def\es@datefirst}
+\spanishdatefirst{1}
+% \end{macrocode}
+%
+% The basic macros to select the language in the preamble or the
+% config file. Use of |\selectlanguage| should be avoided at this
+% early stage because the active chars are not yet
+% active. |\selectspanish| makes them active.
+%
+% \begin{macrocode}
+\def\selectspanish{%
+ \def\selectspanish{%
+ \def\selectspanish{%
+ \PackageWarning{spanish}{Extra \string\selectspanish\space ignored}}%
+ \es@select}}
+\@onlypreamble\selectspanish
+\def\es@select{%
+ \let\es@select\@undefined
+ \selectlanguage{spanish}}
+
+\let\es@shlist\@empty
+% \end{macrocode}
+%
+% Instead of joining all the extras directly in |\extrasspanish|,
+% we subdivide them in three further groups: text, math and shorthands.
+%
+% \begin{macrocode}
+\def\extrasspanish{%
+ \textspanish
+ \mathspanish
+ \ifx\shorthandsspanish\@empty
+ \expandafter\spanishdeactivate\expandafter{\es@shlist}%
+ \languageshorthands{none}%
+ \else
+ \shorthandsspanish
+ \fi}
+\def\noextrasspanish{%
+ \ifx\textspanish\@empty\else
+ \notextspanish
+ \fi
+ \ifx\mathspanish\@empty\else
+ \nomathspanish
+ \fi
+ \ifx\shorthandsspanish\@empty\else
+ \noshorthandsspanish
+ \fi
+ \csname es@restorelist\endcsname}
+
+\addto\textspanish{\es@sDRC\sptext{\es@sptext}}
+
+\def\es@orddot{.}
+% \end{macrocode}
+%
+% The definition of |\sptext| is more elaborated than that of
+% |\textsuperscript|. With uppercase superscript text
+% the scriptscriptsize is used. The mandatory dot is already
+% included. There are two versions, depending on the
+% format.
+%
+% \begin{macrocode}
+\ifes@latex
+ \def\es@sptext#1{%
+ {\es@orddot
+ \setbox\z@\hbox{8}\dimen@\ht\z@
+ \globaldefs\m@ne
+ \csname S@\f@size\endcsname
+ \globaldefs\z@
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \fontsize\sf@size\z@
+ \selectfont
+ \advance\dimen@-1.15ex
+ \else
+ \fontsize\ssf@size\z@
+ \selectfont
+ \advance\dimen@-1.5ex
+ \fi
+ \math@fontsfalse\raise\dimen@\hbox{#1}}}
+\else
+ \let\sptextfont\rm
+ \def\es@sptext#1{%
+ {\es@orddot
+ \setbox\z@\hbox{8}\dimen@\ht\z@
+ \edef\@tempa{\def\noexpand\@tempc{#1}%
+ \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
+ \ifx\@tempb\@tempc
+ \advance\dimen@-0.75ex
+ \raise\dimen@\hbox{$\scriptstyle\sptextfont#1$}%
+ \else
+ \advance\dimen@-0.8ex
+ \raise\dimen@\hbox{$\scriptscriptstyle\sptextfont#1$}%
+ \fi}}
+\fi
+% \end{macrocode}
+%
+% Lowercase small caps. We check if the current font has small
+% caps. If not, we fake them. \cs{selectfont} in \cs{es@lsc}
+% seems redundant, but it's not. An intermediate macro allows
+% for an optimized variant for Roman numerals.
+%
+% \begin{macrocode}
+\ifes@latex
+ \addto\textspanish{\es@sDRC\lsc{\es@lsc}}
+ \def\es@lsc{\es@xlsc\MakeUppercase\MakeLowercase}
+ \def\es@xlsc#1#2#3{%
+ \leavevmode
+ \hbox{%
+ \scshape\selectfont
+ \expandafter\ifx\csname\f@encoding/\f@family/\f@series
+ /n/\f@size\expandafter\endcsname
+ \csname\curr@fontshape/\f@size\endcsname
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\selectfont
+ \PackageWarning{spanish}{Replacing `\curr@fontshape' by
+ \MessageBreak faked small caps}%
+ #1{#3}%
+ \else
+ #2{#3}%
+ \fi}}
+\fi
+% \end{macrocode}
+%
+% The |quoting| environment (not available in Plain). Overriding
+% the default |\everypar| is a bit tricky.
+%
+% \begin{macrocode}
+\newif\ifes@listquot
+
+\ifes@latex
+ \csname newtoks\endcsname\es@quottoks
+ \csname newcount\endcsname\es@quotdepth
+ \newenvironment{quoting}
+ {\leavevmode
+ \advance\es@quotdepth\@ne
+ \csname lquot\romannumeral\es@quotdepth\endcsname
+ \ifnum\es@quotdepth=\@ne
+ \es@listquotfalse
+ \let\es@quotpar\everypar
+ \let\everypar\es@quottoks
+ \everypar\expandafter{\the\es@quotpar}%
+ \es@quotpar{\the\everypar
+ \ifes@listquot\global\es@listquotfalse\else\es@quotcont\fi}%
+ \fi
+ \toks@\expandafter{\es@quotcont}%
+ \edef\es@quotcont{%
+ \the\toks@
+ \expandafter\noexpand
+ \csname rquot\romannumeral\es@quotdepth\endcsname}}
+ {\csname rquot\romannumeral\es@quotdepth\endcsname}
+ \def\lquoti{\guillemotleft{}}
+ \def\rquoti{\guillemotright{}}
+ \def\lquotii{``}
+ \def\rquotii{''}
+ \def\lquotiii{`}
+ \def\rquotiii{'}
+ \let\es@quotcont\@empty
+% \end{macrocode}
+%
+% If there is a marginpar inside quoting, we don't add the
+% quotes. |\es@listqout| stores the quotes to be used before
+% item labels; otherwise they could appear after the labels.
+%
+% \begin{macrocode}
+ \addto\@marginparreset{\let\es@quotcont\@empty}
+ \DeclareRobustCommand\es@listquot{%
+ \csname rquot\romannumeral\es@quotdepth\endcsname
+ \global\es@listquottrue}
+\fi
+% \end{macrocode}
+%
+% |\frenchspacing|, |\...| and |\%|.
+%
+% \begin{macrocode}
+\addto\textspanish{\bbl@frenchspacing}
+\addto\notextspanish{\bbl@nonfrenchspacing}
+\addto\textspanish{%
+ \let\es@save@dot\.%
+ \es@sDRC\.{\@ifnextchar.{\es@dots}{\es@save@dot}}}
+\def\es@dots..{\leavevmode\hbox{...}\spacefactor\@M}
+\def\es@sppercent{\unskip\textormath{$\m@th\,$}{\,}}
+\def\spanishplainpercent{\let\es@sppercent\@empty}
+\addto\textspanish{%
+ \let\percentsign\%%
+ \es@sDRC\%{\es@sppercent\percentsign{}}}
+% \end{macrocode}
+%
+% Now, the math group. It's not easy to add an accent to an
+% operator, because we must avoid using text (that is, |\mbox|)
+% where we have no control on font and size, and at the same time
+% we need |\i|, which is forbidden in math mode. |\dotlessi| must
+% be converted to uppercase if necessary in \LaTeXe. There are two
+% versions, depending on the format.
+% \changes{spanish~5.0o}{2016/01/10}{Fixed EUx: deal with them
+% separately, to be improved}
+% \changes{spanish~5.0p}{2016/03/02}{Added TU. Now with uni encs use the
+% actual composite char}
+%
+% \begin{macrocode}
+\addto\mathspanish{\es@sDRC\dotlessi{\es@dotlessi}}
+\let\nomathspanish\relax
+
+\ifes@latex
+ \def\es@texti{\i}
+ \addto\@uclclist{\dotlessi\es@texti}
+\fi
+
+\def\es@fetchenc{%
+ \count@\escapechar \escapechar=\m@ne
+ \edef\es@a{\expandafter\string\the\textfont\mathgroup}%
+ \expandafter\split@name\es@a////\@nil
+ \escapechar=\count@
+ \@expandtwoargs\in@{////}{\f@size}%
+ \ifin@\else
+ \PackageError{spanish}{%
+ Non-NFSS font name. The current math font (\es@a)\MessageBreak
+ doesn't follow the NFSS conventions. I'll use the\MessageBreak
+ default \string\i\space for \string\dotlessi,
+ but expect a wrong output.}%
+ {Find where this font has been (re)defined, and fix it.}%
+ \def\f@encoding{OT1}%
+ \fi}
+
+\ifes@latex
+ \ifx\Umathchardef\@undefined\else
+ \expandafter\Umathchardef\csname es@EU1@dotlessi\endcsname"7"1"0131\relax
+ \expandafter\Umathchardef\csname es@EU2@dotlessi\endcsname"7"1"0131\relax
+ \expandafter\Umathchardef\csname es@TU@dotlessi\endcsname"7"1"0131\relax
+ \fi
+ \def\es@dotlessi{%
+ \ifmmode
+ {\ifnum\mathgroup=\m@ne
+ \imath
+ \else
+ \es@fetchenc
+ \@ifundefined{es@\f@encoding @dotlessi}%
+ {\@ifundefined{\f@encoding\string\i}%
+ {\edef\f@encoding{\string?}}{}%
+ \expandafter\count@\the\csname\f@encoding\string\i\endcsname
+ \advance\count@"7000
+ \mathchar\count@}%
+ {\csname es@\f@encoding @dotlessi\endcsname}%
+ \fi}%
+ \else
+ \i
+ \fi}
+\else
+ \def\es@dotlessi{\textormath{\i}{\mathchar"7010}}
+\fi
+
+\def\es@op@ac@base#1{\acute{\if i#1\dotlessi\else#1\fi}}
+\ifx\Umathchar\@undefined\else
+ \def\es@ac@TU@a{"00E1}\def\es@ac@TU@A{"00C1}%
+ \def\es@ac@TU@e{"00E9}\def\es@ac@TU@E{"00C9}%
+ \def\es@ac@TU@i{"00ED}\def\es@ac@TU@I{"00CD}%
+ \def\es@ac@TU@o{"00F3}\def\es@ac@TU@O{"00D3}%
+ \def\es@ac@TU@u{"00FA}\def\es@ac@TU@U{"00DA}%
+ \def\es@op@ac@TU#1{%
+ \ifnum\mathgroup=\m@ne
+ \es@op@ac@base{#1}%
+ \else
+ \es@fetchenc
+ \@ifundefined{es@op@ac@\f@encoding}%
+ {\es@op@ac@base{#1}}%
+ {\@ifundefined{es@ac@TU@#1}%
+ {\es@op@ac@base{#1}}%
+ {\Umathchar"7"1\csname es@ac@TU@#1\endcsname}}%
+ \fi}%
+ \expandafter\let\csname es@op@ac@EU1\endcsname\es@op@ac@TU
+ \expandafter\let\csname es@op@ac@EU2\endcsname\es@op@ac@TU
+\fi
+\def\accentedoperators{%
+ \@ifundefined{es@op@ac@TU}%
+ {\let\es@op@ac\es@op@ac@base}%
+ {\let\es@op@ac\es@op@ac@TU}}
+\def\unaccentedoperators{%
+ \def\es@op@ac##1{##1}}
+\accentedoperators
+\def\spacedoperators{\let\es@op@sp\,}
+\def\unspacedoperators{\let\es@op@sp\@empty}
+\spacedoperators
+\addto\mathspanish{\es@operators}
+
+\ifes@latex\else
+ \let\operator@font\rm
+\fi
+% \end{macrocode}
+%
+% Operators are stored in |\es@operators|, which is
+% included in the math group. Since |\operator@font| is
+% defined in \LaTeXe{} only, we define it in the plain variant.
+% \changes{spanish~5.0n}{2014-03-28}{tabular didn't like the
+% ampersand used in tests. Replaced by double backslash.}
+%
+% \begin{macrocode}
+\def\es@operators{%
+ \es@sdef\bmod{\nonscript\mskip-\medmuskip\mkern5mu
+ \mathbin{\operator@font m\es@op@ac od}\penalty900\mkern5mu
+ \nonscript\mskip-\medmuskip}%
+ \@ifundefined{@amsmath@err}%
+ {\es@sdef\pmod##11{\allowbreak\mkern18mu
+ ({\operator@font m\es@op@ac od}\,\,##11)}}%
+ {\es@sdef\mod##1{\allowbreak\if@display\mkern18mu
+ \else\mkern12mu\fi{\operator@font m\es@op@ac od}\,\,##1}%
+ \es@sdef\pmod##1{\pod{{\operator@font m\es@op@ac od}%
+ \mkern6mu##1}}}%
+ \def\es@a##1 {%
+ \ifx\relax##1\relax % empty? continue
+ \bbl@afterelse
+ \es@a
+ \else
+ \bbl@afterfi
+ {\ifx\\##1% \@emtpy? finish
+ \else
+ \bbl@afterfi
+ \begingroup
+ \let\,\@empty % ignore when def'ing name
+ \let\acute\@firstofone % id
+ \edef\es@b{\expandafter\noexpand\csname##1\endcsname}%
+ \def\,{\noexpand\es@op@sp}%
+ \def\acute{\noexpand\es@op@ac}%
+ \edef\es@a{\endgroup
+ \noexpand\es@sdef\expandafter\noexpand\es@b{%
+ \mathop{\noexpand\operator@font##1}\es@c}}%
+ \es@a % restores itself
+ \es@a
+ \fi}%
+ \fi}%
+ \let\es@b\spanishoperators
+ \addto\es@b{ }%
+ \let\es@c\@empty
+ \expandafter\es@a\es@b l\acute{i}m l\acute{i}m\,sup
+ l\acute{i}m\,inf m\acute{a}x \acute{i}nf m\acute{i}n \\ %
+ \def\es@c{\nolimits}%
+ \expandafter\es@a\es@b sen tg arc\,sen arc\,cos arc\,tg \\ }
+\def\spanishoperators{cotg cosec senh tgh }
+% \end{macrocode}
+%
+% Now comes the text shorthands. They are grouped in
+% |\shorthandsspanish| and this style performs some
+% operations before the babel shortands are called.
+% The aims are to allow espression like |$a^{x'}$|
+% and to deactivate shorthands by making them of
+% category `other.' After providing a |\'i| shorthand,
+% the new macros are defined.
+%
+% \begin{macrocode}
+\DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'{\i}}
+
+\def\es@set@shorthand#1{%
+ \expandafter\edef\csname es@savecat\string#1\endcsname
+ {\the\catcode`#1}%
+ \initiate@active@char{#1}%
+ \catcode`#1=\csname es@savecat\string#1\endcsname\relax
+ \if.#1\else
+ \addto\es@restorelist{\es@restore{#1}}%
+ \addto\es@select{\shorthandon{#1}}%
+ \addto\shorthandsspanish{\es@activate{#1}}%
+ \addto\es@shlist{#1}%
+ \fi}
+
+\def\es@use@shorthand{%
+ \if@safe@actives
+ \bbl@afterelse
+ \string
+ \else
+ \bbl@afterfi
+ {\ifx\thepage\relax
+ \bbl@afterelse
+ \string
+ \else
+ \bbl@afterfi
+ \es@use@sh
+ \fi}%
+ \fi}
+
+\def\es@use@sh#1{%
+ \ifx\protect\@unexpandable@protect
+ \bbl@afterelse
+ \noexpand#1%
+ \else%
+ \bbl@afterfi
+ \textormath
+ {\csname active@char\string#1\endcsname}%
+ {\csname normal@char\string#1\endcsname}%
+ \fi}
+
+\gdef\es@activate#1{%
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \def~{\es@use@shorthand~}}}
+
+\def\spanishdeactivate#1{%
+ \@tfor\@tempa:=#1\do{\expandafter\es@spdeactivate\@tempa}}
+
+\def\es@spdeactivate#1{%
+ \if.#1%
+ \mathcode`\.=\es@period@math\relax
+ \begingroup\lccode`\~=`\.\lowercase{\endgroup\let~\es@period@code}%
+ \else
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \expandafter\let\expandafter~%
+ \csname normal@char\string#1\endcsname}%
+ \catcode`#1=\csname es@savecat\string#1\endcsname\relax
+ \fi}
+% \end{macrocode}
+%
+% |\es@restore| is used in the list |\es@restorelist|, which in
+% turn restores all shorthands as defined by \babel. The latter
+% macros also has |\es@quoting|.
+%
+% \begin{macrocode}
+\def\es@restore#1{%
+ \shorthandon{#1}%
+ \begingroup
+ \lccode`\~=`#1
+ \lowercase{%
+ \endgroup
+ \bbl@deactivate{~}}}
+% \end{macrocode}
+%
+% To selectively define the shorthands we have a couple of
+% macros, which defines a certain combination if the first
+% character has been activated as a shorthand. The second
+% one is intended for a few shorthands with an alternative
+% form.
+%
+% \begin{macrocode}
+\def\es@declare#1{%
+ \@ifundefined{es@savecat\expandafter\string\@firstoftwo#1}%
+ {\@gobble}%
+ {\declare@shorthand{spanish}{#1}}}
+\def\es@declarealt#1#2#3{%
+ \es@declare{#1}{#3}%
+ \es@declare{#2}{#3}}
+
+\ifes@latex\else
+ \def\@tabacckludge#1{\csname\string#1\endcsname}
+\fi
+
+\@ifundefined{add@accent}{\def\add@accent#1#2{\accent#1 #2}}{}
+% \end{macrocode}
+%
+% Instead of redefining |\'|, we redefine the internal
+% macro for the OT1 encoding.
+%
+% \begin{macrocode}
+\ifes@latex
+ \def\es@accent#1#2#3{%
+ \expandafter\@text@composite
+ \csname OT1\string#1\endcsname#3\@empty\@text@composite
+ {\add@accent{#2}{#3}\futurelet\@let@token\bbl@sptest}}
+ \def\bbl@sptest{\ifx\@let@token\@sptoken\else\bbl@allowhyphens\fi}
+\else
+ \def\es@accent#1#2#3{%
+ \add@accent{#2}{#3}\bbl@allowhyphens}
+\fi
+
+\addto\shorthandsspanish{\languageshorthands{spanish}}%
+\es@ifoption{noshorthands}{}{\es@set@shorthand{"}}
+% \end{macrocode}
+%
+% We override the default |"| of babel, intended for german. Note
+% this only applies to OT1.
+%
+% \begin{macrocode}
+\def\es@umlaut#1{\add@accent{127}#1\bbl@allowhyphens}
+
+\addto\shorthandsspanish{%
+ \babel@save\bbl@umlauta
+ \let\bbl@umlauta\es@umlaut}
+\let\noshorthandsspanish\relax
+
+\ifes@latex
+\addto\shorthandsspanish{%
+ \expandafter\es@sdef\csname OT1\string\~\endcsname{\es@accent\~{126}}%
+ \expandafter\es@sdef\csname OT1\string\'\endcsname{\es@accent\'{19}}}
+\else
+\addto\shorthandsspanish{%
+ \es@sdef\~{\es@accent\~{126}}%
+ \es@sdef\'#1{\if#1i\es@accent\'{19}\i\else\es@accent\'{19}{#1}\fi}}
+\fi
+
+\def\es@sptext@r#1#2{\es@sptext{#1#2}}
+\es@declare{"a}{\sptext{a}}
+\es@declare{"A}{\sptext{A}}
+\es@declare{"o}{\sptext{o}}
+\es@declare{"O}{\sptext{O}}
+\es@declare{"e}{\protect\es@sptext@r{e}}
+\es@declare{"E}{\protect\es@sptext@r{E}}
+\es@declare{"u}{\"u}
+\es@declare{"U}{\"U}
+\es@declare{"i}{\"{\i}}
+\es@declare{"I}{\"I}
+\es@declare{"c}{\c{c}}
+\es@declare{"C}{\c{C}}
+\es@declare{"<}{\guillemotleft{}}
+\es@declare{">}{\guillemotright{}}
+\def\es@chf{\char\hyphenchar\font}
+\es@declare{"-}{\bbl@allowhyphens\-\bbl@allowhyphens}
+\es@declare{"=}{\bbl@allowhyphens\es@chf\hskip\z@skip}
+\es@declare{"~}
+ {\bbl@allowhyphens
+ \discretionary{\es@chf}{\es@chf}{\es@chf}%
+ \bbl@allowhyphens}
+\es@declare{"r}
+ {\bbl@allowhyphens
+ \discretionary{\es@chf}{}{r}%
+ \bbl@allowhyphens}
+\es@declare{"R}
+ {\bbl@allowhyphens
+ \discretionary{\es@chf}{}{R}%
+ \bbl@allowhyphens}
+\es@declare{"y}
+ {\@ifundefined{scalebox}%
+ {\ensuremath{\tau}}%
+ {\raisebox{1ex}{\scalebox{-1}{\resizebox{.45em}{1ex}{2}}}}}
+\es@declare{""}{\hskip\z@skip}
+\es@declare{"/}
+ {\setbox\z@\hbox{/}%
+ \dimen@\ht\z@
+ \advance\dimen@-1ex
+ \advance\dimen@\dp\z@
+ \dimen@.31\dimen@
+ \advance\dimen@-\dp\z@
+ \ifdim\dimen@>0pt
+ \kern.01em\lower\dimen@\box\z@\kern.03em
+ \else
+ \box\z@
+ \fi}
+\es@declare{"?}
+ {\setbox\z@\hbox{?`}%
+ \leavevmode\raise\dp\z@\box\z@}
+\es@declare{"!}
+ {\setbox\z@\hbox{!`}%
+ \leavevmode\raise\dp\z@\box\z@}
+
+\def\spanishdecimal#1{\def\es@decimal{{#1}}}
+\def\decimalcomma{\spanishdecimal{,}}
+\def\decimalpoint{\spanishdecimal{.}}
+\decimalcomma
+\es@ifoption{nodecimaldot}{}
+ {\AtBeginDocument{\bgroup\@fileswfalse}%
+ \begingroup\lccode`\~=`\.\lowercase{\endgroup
+ \let\es@period@code~%
+ \es@set@shorthand{.}%
+ \let~\es@period@code}%
+ \AtBeginDocument{\egroup}%
+ \@namedef{normal@char\string.}{%
+ \@ifnextchar\egroup
+ {\es@period@code}%
+ {\csname active@char\string.\endcsname}}%
+ \declare@shorthand{system}{.}{\es@period@code}%
+ \addto\shorthandsspanish{%
+ \babel@savevariable{\mathcode`\.}%
+ \edef\es@period@math{\the\mathcode`\.}%
+ \babel@save\es@period@code
+ \ifnum\es@period@math="8000 %
+ \begingroup\lccode`\~=`\.\lowercase{\endgroup\let\es@period@code~}%
+ \else
+ \mathchardef\es@period@code\es@period@math\relax
+ \mathcode`\.="8000 %
+ \fi
+ \begingroup\lccode`\~=`\.\lowercase{\endgroup\babel@save~}%
+ \es@activate{.}}%
+ \def\es@a#1{\es@declare{.#1}{\es@decimal#1}}%
+ \es@a1\es@a2\es@a3\es@a4\es@a5\es@a6\es@a7\es@a8\es@a9\es@a0}
+
+\es@ifoption{notilde}{}{\es@set@shorthand{~}}
+\def\deactivatetilden{%
+ \expandafter\let\csname spanish@sh@\string~@n@\endcsname\relax
+ \expandafter\let\csname spanish@sh@\string~@N@\endcsname\relax}
+\es@ifoption{tilden}
+ {\es@declare{~n}{\~n}%
+ \es@declare{~N}{\~N}}
+ {\let\deactivatetilden\relax}
+\es@declarealt{~-}{"+}{%
+ \leavevmode
+ \bgroup
+ \let\@sptoken\es@dashes % Changes \@ifnextchar behaviour
+ \@ifnextchar-%
+ {\es@dashes}%
+ {\hbox{\es@chf}\egroup}}
+\def\es@dashes-{%
+ \@ifnextchar-%
+ {\bbl@allowhyphens\hbox{---}\bbl@allowhyphens\egroup\@gobble}%
+ {\bbl@allowhyphens\hbox{--}\bbl@allowhyphens\egroup}}
+
+\es@ifoption{noquoting}%
+ {\let\es@quoting\relax
+ \let\activatequoting\relax
+ \let\deactivatequoting\relax}
+ {\@ifundefined{XML@catcodes}%
+ {\es@set@shorthand{<}%
+ \es@set@shorthand{>}%
+ \declare@shorthand{system}{<}{\csname normal@char\string<\endcsname}%
+ \declare@shorthand{system}{>}{\csname normal@char\string>\endcsname}%
+ \addto\es@restorelist{\es@quoting}%
+ \addto\es@select{\es@quoting}%
+ \ifes@latex
+ \AtBeginDocument{%
+ \es@quoting
+ \if@filesw
+ \immediate\write\@mainaux{\string\@nameuse{es@quoting}}%
+ \fi}%
+ \fi
+ \def\activatequoting{%
+ \shorthandon{<>}%
+ \let\es@quoting\activatequoting}%
+ \def\deactivatequoting{%
+ \shorthandoff{<>}%
+ \let\es@quoting\deactivatequoting}}{}}
+
+\es@declarealt{<<}{"`}{\begin{quoting}}
+\es@declarealt{>>}{"'}{\end{quoting}}
+% \end{macrocode}
+%
+% Acute accent shorthands are stored in a macro. If |activeacute| was
+% set as an option it is executed. If not it is not deleted for a
+% possible later use in the |cfg| file. In non \LaTeXe{} formats it's
+% always executed.
+%
+% \changes{spanish~5.0e}{2008/07/06}{Two acutes in a row should be
+% turned into a double right quote}
+% \changes{spanish~5.0g}{2008/07/20}{Fixed bad kerning before two
+% acutes}
+% \changes{spanish~5.0g}{2008/07/20}{Fixed bad kerning before two
+% acutes}
+% \changes{spanish~5.0o}{2015/12/14}{Fixed typo in \cs{numberline} (\cs{if}
+% to \cs{ifx})}
+%
+% \begin{macrocode}
+\begingroup
+\catcode`\'=12
+\gdef\es@activeacute{%
+ \es@set@shorthand{'}%
+ \def\es@a##1{\es@declare{'##1}{\@tabacckludge'##1}}%
+ \es@a a\es@a e\es@a i\es@a o\es@a u%
+ \es@a A\es@a E\es@a I\es@a O\es@a U%
+ \es@declare{'n}{\~n}%
+ \es@declare{'N}{\~N}%
+ \es@declare{''}{''}%
+ \let\es@activeacute\relax}
+\endgroup
+
+\ifes@latex
+ \@ifpackagewith{babel}{activeacute}{\es@activeacute}{}
+\else
+ \es@activeacute
+\fi
+% \end{macrocode}
+%
+% And the customization. By default these macros only
+% store the values and do nothing.
+%
+% \begin{macrocode}
+\def\es@enumerate#1#2#3#4{\def\es@enum{{#1}{#2}{#3}{#4}}}
+\def\es@itemize#1#2#3#4{\def\es@item{{#1}{#2}{#3}{#4}}}
+
+\ifes@latex
+\es@enumerate{1.}{a)}{1)}{a$'$}
+\def\spanishdashitems{\es@itemize{---}{---}{---}{---}}
+\def\spanishsymbitems{%
+ \es@itemize
+ {\leavevmode\hbox to 1.2ex
+ {\hss\vrule height .9ex width .7ex depth -.2ex\hss}}%
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}}
+\def\spanishsignitems{%
+ \es@itemize
+ {\textbullet}%
+ {$\m@th\circ$}%
+ {$\m@th\diamond$}%
+ {$\m@th\triangleright$}}
+\spanishsymbitems
+\def\es@enumdef#1#2#3\@@{%
+ \if#21%
+ \@namedef{theenum#1}{\arabic{enum#1}}%
+ \else\if#2a%
+ \@namedef{theenum#1}{\emph{\alph{enum#1}}}%
+ \else\if#2A%
+ \@namedef{theenum#1}{\Alph{enum#1}}%
+ \else\if#2i%
+ \@namedef{theenum#1}{\roman{enum#1}}%
+ \else\if#2I%
+ \@namedef{theenum#1}{\Roman{enum#1}}%
+ \else\if#2o%
+ \@namedef{theenum#1}{\arabic{enum#1}\sptext{o}}%
+ \fi\fi\fi\fi\fi\fi
+ \toks@\expandafter{\csname theenum#1\endcsname}%
+ \expandafter\edef\csname labelenum#1\endcsname
+ {\noexpand\es@listquot\the\toks@#3}}
+\def\es@guillemot#1#2{%
+ \ifmmode#1%
+ \else
+ \save@sf@q{\penalty\@M
+ \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
+ \char#2 \kern-0.19em\char#2 }}%
+ \fi}
+\def\layoutspanish{%
+ \let\layoutspanish\@empty
+ \DeclareTextCommand{\guillemotleft}{OT1}{\es@guillemot\ll{40}}%
+ \DeclareTextCommand{\guillemotright}{OT1}{\es@guillemot\gg{41}}%
+ \def\@fnsymbol##1%
+ {\ifcase##1\or*\or**\or***\or****\or
+ *****\or******\else\@ctrerr\fi}%
+ \def\@alph##1%
+ {\ifcase##1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
+ k\or l\or m\or n\or \~n\or o\or p\or q\or r\or s\or t\or u\or v\or
+ w\or x\or y\or z\else\@ctrerr\fi}%
+ \def\@Alph##1%
+ {\ifcase##1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
+ K\or L\or M\or N\or \~N\or O\or P\or Q\or R\or S\or T\or U\or V\or
+ W\or X\or Y\or Z\else\@ctrerr\fi}}
+
+\es@optlayout{noenumerate}{%
+ \def\es@enumerate#1#2#3#4{%
+ \es@enumdef{i}#1\@empty\@empty\@@
+ \es@enumdef{ii}#2\@empty\@empty\@@
+ \es@enumdef{iii}#3\@empty\@empty\@@
+ \es@enumdef{iv}#4\@empty\@empty\@@}%
+ \def\p@enumii{\theenumi}%
+ \def\p@enumiii{\p@enumii\theenumii}%
+ \def\p@enumiv{\p@enumiii\theenumiii}%
+ \expandafter\es@enumerate\es@enum}
+\es@optlayout{noitemize}{%
+ \def\es@itemize#1#2#3#4{%
+ \def\labelitemi{\es@listquot#1}%
+ \def\labelitemii{\es@listquot#2}%
+ \def\labelitemiii{\es@listquot#3}%
+ \def\labelitemiv{\es@listquot#4}}%
+ \expandafter\es@itemize\es@item}
+\let\esromanindex\@secondoftwo
+\es@ifoption{ucroman}
+ {\def\es@romandef{%
+ \def\esromanindex##1##2{##1{\uppercase{##2}}}%
+ \def\@roman{\@Roman}}}
+ {\def\es@romandef{%
+ \def\esromanindex##1##2{##1{\es@scroman{##2}}}%
+ \def\@roman##1{\es@roman{\number##1}}%
+ \def\es@roman##1{\es@scroman{\romannumeral##1}}%
+ \DeclareRobustCommand\es@scroman{\es@xlsc\uppercase\@firstofone}}}
+\es@optlayout{lcroman}{\es@romandef}
+\newcommand\spanishlcroman{\def\@roman##1{\romannumeral##1}}
+\newcommand\spanishucroman{\def\@roman{\@Roman}}
+\newcommand\spanishscroman{\def\@roman##1{\es@roman{\romannumeral##1}}}
+\es@optlayout{noindentfirst}{%
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue}
+\es@optlayout{nosectiondot}{%
+ \def\@seccntformat#1{\csname the#1\endcsname.\quad}%
+ \def\numberline#1{\hb@xt@\@tempdima{#1\ifx&#1&\else.\fi\hfil}}}
+\es@ifoption{nolayout}{\let\layoutspanish\relax}{}
+\es@ifoption{sloppy}{\let\textspanish\relax\let\mathspanish\relax}{}
+\es@ifoption{delayed}{}{\def\es@layoutspanish{\layoutspanish}}
+\es@ifoption{preindex}{\AtEndOfPackage{\RequirePackage{romanidx}}}{}
+% \end{macrocode}
+%
+% We need to execute the following code when babel has been
+% run, in order to see if |spanish| is the main language.
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \let\es@activeacute\@undefined
+ \def\bbl@tempa{spanish}%
+ \ifx\bbl@main@language\bbl@tempa
+ \@nameuse{es@layoutspanish}%
+ \addto\es@select{%
+ \@ifstar{\PackageError{spanish}%
+ {Old syntax--use es-nolayout}%
+ {If you don't want changes in layout\MessageBreak
+ use the package option `es-nolayout'}}%
+ {}}%
+ \AtBeginDocument{\layoutspanish}%
+ \fi
+ \selectspanish}
+\fi % of \ifes@latex
+% \end{macrocode}
+%
+% After restoring the catcode of |~| and setting the minimal
+% values for hyphenation, the |.ldf| is finished.
+% \changes{spanish~5.0o}{2015/12/14}{Misplaced line -- activatequoting
+% must precede \cs{ldf@finish}}
+%
+% \begin{macrocode}
+\es@savedcatcodes
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\ifes@latex\else
+ \es@select
+\fi
+\csname activatequoting\endcsname
+\ldf@finish{spanish}
+%</code>
+% \end{macrocode}
+% That's all in the main file.
+%
+% The |spanish| option writes a macro in the page field of
+% \textit{MakeIndex} in entries with small caps number, but they
+% are rejected. This program is a preprocessor which moves this
+% macro to the entry field. It can be called from the main
+% document as a package or with the package option |es-preindex|.
+%
+% \begin{macrocode}
+%<*indexes>
+\makeatletter
+
+\@ifundefined{es@idxfile}
+ {\def\spanishindexchars#1#2#3{%
+ \edef\es@encap{`\expandafter\noexpand\csname\string#1\endcsname}%
+ \edef\es@openrange{`\expandafter\noexpand\csname\string#2\endcsname}%
+ \edef\es@closerange{`\expandafter\noexpand\csname\string#3\endcsname}}%
+ \spanishindexchars{|}{(}{)}%
+ \ifx\documentclass\@twoclasseserror
+ \edef\es@idxfile{\jobname}%
+ \AtEndDocument{%
+ \addto\@defaultsubs{%
+ \immediate\closeout\@indexfile
+ \input{romanidx.sty}}}%
+ \expandafter\endinput
+ \fi}{}
+
+\newcount\es@converted
+\newcount\es@processed
+
+\def\es@split@file#1.#2\@@{#1}
+\def\es@split@ext#1.#2\@@{#2}
+
+\@ifundefined{es@idxfile}
+ {\typein[\answer]{^^JArchivo que convertir^^J%
+ (extension por omision .idx):}}
+ {\let\answer\es@idxfile}
+
+\@expandtwoargs\in@{.}{\answer}
+\ifin@
+ \edef\es@input@file{\expandafter\es@split@file\answer\@@}
+ \edef\es@input@ext{\expandafter\es@split@ext\answer\@@}
+\else
+ \edef\es@input@file{\answer}
+ \def\es@input@ext{idx}
+\fi
+
+\@ifundefined{es@idxfile}
+ {\typein[\answer]{^^JArchivo de destino^^J%
+ (archivo por omision: \es@input@file.eix,^^J%
+ extension por omision .eix):}}
+ {\let\answer\es@idxfile}
+\ifx\answer\@empty
+ \edef\es@output{\es@input@file.eix}
+\else
+ \@expandtwoargs\in@{.}{\answer}
+ \ifin@
+ \edef\es@output{\answer}
+ \else
+ \edef\es@output{\answer.eix}
+ \fi
+\fi
+
+\@ifundefined{es@idxfile}
+ {\typein[\answer]{%
+ ^^J?Se ha usado algun esquema especial de controles^^J%
+ de MakeIndex para encap, open_range o close_range?^^J%
+ [s/n] (n por omision)}}
+ {\def\answer{n}}
+
+\if s\answer
+ \typein[\answer]{^^JCaracter para 'encap'^^J%
+ (\string| por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@encap{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'open_range'^^J%
+ (\string( por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@openrange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+ \typein[\answer]{^^JCaracter para 'close_range'^^J%
+ (\string) por omision)}
+ \ifx\answer\@empty\else
+ \edef\es@closerange{%
+ `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}
+ \fi
+\fi
+
+\newwrite\es@indexfile
+\immediate\openout\es@indexfile=\es@output
+
+\newif\ifes@encapsulated
+
+\def\es@scroman#1{#1}
+\edef\es@slash{\expandafter\@gobble\string\\}
+
+\def\indexentry{%
+ \begingroup
+ \@sanitize
+ \es@indexentry}
+
+\begingroup
+
+\catcode`\|=12 \lccode`\|=\es@encap\relax
+\catcode`\(=12 \lccode`\(=\es@openrange\relax
+\catcode`\)=12 \lccode`\)=\es@closerange\relax
+
+\lowercase{
+\gdef\es@indexentry#1{%
+ \endgroup
+ \advance\es@processed\@ne
+ \es@encapsulatedfalse
+ \es@bar@idx#1|\@@
+ \es@idxentry}%
+}
+
+\lowercase{
+\gdef\es@idxentry#1{%
+ \in@{\es@scroman}{#1}%
+ \ifin@
+ \advance\es@converted\@ne
+ \immediate\write\es@indexfile{%
+ \string\indexentry{\es@b|\ifes@encapsulated\es@p\fi esromanindex%
+ {\ifx\es@a\@empty\else\es@slash\es@a\fi}}{#1}}%
+ \else
+ \immediate\write\es@indexfile{%
+ \string\indexentry{\es@b\ifes@encapsulated|\es@p\es@a\fi}{#1}}%
+ \fi}
+}
+
+\lowercase{
+\gdef\es@bar@idx#1|#2\@@{%
+ \def\es@b{#1}\def\es@a{#2}%
+ \ifx\es@a\@empty\else\es@encapsulatedtrue\es@bar@eat#2\fi}
+}
+
+\lowercase{
+\gdef\es@bar@eat#1#2|{\def\es@p{#1}\def\es@a{#2}%
+ \edef\es@t{(}\ifx\es@t\es@p
+ \else\edef\es@t{)}\ifx\es@t\es@p
+ \else
+ \edef\es@a{\es@p\es@a}\let\es@p\@empty%
+ \fi\fi}
+}
+
+\endgroup
+
+\input \es@input@file.\es@input@ext
+
+\immediate\closeout\es@indexfile
+
+\typeout{*****************}
+\typeout{Se ha procesado: \es@input@file.\es@input@ext }
+\typeout{Lineas leidas: \the\es@processed}
+\typeout{Lineas convertidas: \the\es@converted}
+\typeout{Resultado en: \es@output}
+\ifnum\es@converted>\z@
+ \typeout{Genere el indice a partir de ese archivo}
+\else
+ \typeout{No se ha convertido nada. Se puede generar}
+ \typeout{el .ind directamente de \es@input@file.\es@input@ext}
+\fi
+\typeout{*****************}
+
+\@ifundefined{es@sdef}{\@@end}{}
+
+\endinput
+%</indexes>
+% \end{macrocode}
+%
+% \Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
+%
+% Local Variables:
+% mode: doctex
+% coding: utf-8
+% End: \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/spanish/spanish.ins b/macros/latex/contrib/babel-contrib/spanish/spanish.ins
new file mode 100644
index 0000000000..20be5cc9e3
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanish/spanish.ins
@@ -0,0 +1,100 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright (C) 1997 - 2014
+%% Javier Bezos (www.tex-tipografia.com)
+%% and
+%% CervanTeX (www.cervantex.es)
+%%
+%% It may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License, either version 1.3 of this license or
+%% (at your option) any later version. The latest version of this
+%% license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{spanish.ins}
+\def\filedate{2014/01/30}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+ \Msg{**********************************************}
+ \Msg{*}
+ \Msg{* This installation requires docstrip}
+ \Msg{* version 2.3c or later.}
+ \Msg{*}
+ \Msg{* An older version of docstrip has been input}
+ \Msg{*}
+ \Msg{**********************************************}
+ \errhelp{Move or rename old docstrip.tex.}
+ \errmessage{Old docstrip in input path}
+ \batchmode
+ \csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright (C) 1997 - 2014
+ Javier Bezos (www.tex-tipografia.com)
+ and
+ CervanTeX (www.cervantex.es)
+
+It may be distributed and/or modified under the conditions of the
+LaTeX Project Public License, either version 1.3 of this license or
+(at your option) any later version. The latest version of this
+license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX version
+2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\usedir{tex/generic/babel}
+
+\keepsilent
+
+\ifx\askover\undefined\else % for personal use
+ \askforoverwritefalse
+\fi
+
+\usepreamble\mainpreamble
+\generate{\file{spanish.ldf}{\from{spanish.dtx}{code}}%
+ \file{romanidx.sty}{\from{spanish.dtx}{indexes}}}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/spanish/spanish.pdf b/macros/latex/contrib/babel-contrib/spanish/spanish.pdf
new file mode 100644
index 0000000000..1c92661aae
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/spanish/spanish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/swedish/swedish.dtx b/macros/latex/contrib/babel-contrib/swedish/swedish.dtx
new file mode 100644
index 0000000000..6beb68787b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/swedish/swedish.dtx
@@ -0,0 +1,442 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2005 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Johannes Braams.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{272}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{swedish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{swedish}
+%\fi
+%\ProvidesFile{swedish.dtx}
+ [2005/03/31 v2.3d Swedish support from the babel system]
+%\iffalse
+%% File `swedish.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 - 2005
+%% by Johannes Braams, TeXniek
+%
+%% Please report errors to: J.L. Braams
+%% babel at braams.cistron.nl
+%
+% This file is part of the babel system, it provides the source
+% code for the Swedish language definition file. A contribution
+% was made by Sten Hellman HELLMAN@CERNVM.CERN.CH
+%
+% Further enhancements for version 2.0 were provided by
+% Erik "Osthols <erik\_osthols@yahoo.com>
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{swedish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{swedish.dtx}
+%
+% \changes{swedish-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
+% \file{babel.com}}
+% \changes{swedish-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
+% \changes{swedish-1.2}{1994/02/27}{Update for LaTeX2e}
+% \changes{swedish-1.3d}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{swedish-1.3e}{1995/05/28}{Update for release 3.5}
+% \changes{swedish-2.0}{1996/01/24}{Introduced active double quote}
+% \changes{swedish-2.1}{1996/10/10}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX, moved the definition of \cs{atcatcode} right to the
+% beginning.}
+% \changes{swedish-2.3d}{2001/11/16}{Fixed a \cs{changes} entry}
+%
+% \section{The Swedish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate. Contributions were made by Sten Hellman
+% (\texttt{HELLMAN@CERNVM.CERN.CH}) and Erik \"Osthols
+% (\texttt{erik\_osthols@yahoo.com}).} defines all the
+% language-specific macros for the Swedish language. This
+% file has borrowed heavily from |finnish.dtx| and |germanb.dtx|.
+%
+% For this language the character |"| is made active. In
+% table~\ref{tab:swedish-quote} an overview is given of its
+% purpose. The vertical placement of the "umlaut" in some letters
+% can be controlled this way.
+% \begin{table}[htb]
+% \begin{center}
+% \begin{tabular}{lp{8cm}}
+% |"a| & Gives \"a, also implemented for |"A|, |"o| and |"O|. \\
+% |"w|, |"W| & gives {\aa} and {\AA}. \\
+% |"ff| & for |ff| to be hyphenated as |ff-f|. Used for compound
+% words, such as \texttt{stra|"|ff{\aa}nge}, which
+% should be hyphenated as \texttt{straff-f{\aa}nge}.
+% This is also implemented for b, d, f, g, l, m, n,
+% p, r, s, and t. \\
+% \verb="|= & disable ligature at this position. This should be
+% used for compound words, such as
+% ``\texttt{stra|"|ffinr\"attning}'',
+% which should not have the ligature ``ffi''. \\
+% |"-| & an explicit hyphen sign, allowing hyphenation
+% in the rest of the word, such as e. g. in
+% ``x|"-|axeln''. \\
+% |""| & like |"-|, but producing no hyphen sign
+% (for words that should break at some sign such as
+% \texttt{och/|""|eller}). \\
+% |"~| & for an explicit hyphen without a breakpoint; useful for
+% expressions such as ``2|"~|3 veckor'' where no linebreak
+% is desirable. \\
+% |"=| & an explicit hyphen sign allowing subsequent hyphenation,
+% for expressions such as ``studiebidrag och \newline
+% -l{\aa}n''. \\
+% |\-| & like the old |\-|, but allowing hyphenation
+% in the rest of the word. \\
+% \end{tabular}
+% \caption{The extra definitions made
+% by \file{swedish.sty}}\label{tab:swedish-quote}
+% \end{center}
+% \end{table}
+%
+% Two variations for formatting of dates are added. \cs{datesymd}
+% makes \cs{today} output dates formatted as YYYY-MM-DD, which is
+% commonly used in Sweden today. \cs{datesdmy} formats the date as
+% D/M YYYY, which is also very common in Sweden. These commands
+% should be issued after \cs{begin{document}}.
+%
+% \StopEventually{}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{swedish-2.1}{1996/11/03}{Now use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{swedish}\captionsswedish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{swedish} will be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@swedish| to see whether we have to do something here.
+%
+% \changes{swedish-1.0c}{1991/10/29}{Removed use of \cs{@ifundefined}}
+% \changes{swedish-1.1}{1992/02/16}{Added a warning when no hyphenation
+% patterns were loaded.}
+% \changes{swedish-1.3d}{1994/06/26}{Now use \cs{@nopatterns} to
+% producew the warning}
+% \begin{macrocode}
+\ifx\l@swedish\@undefined
+ \@nopatterns{Swedish}
+ \adddialect\l@swedish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the
+% Swedish language. The reason for this is that a user might want
+% to switch back and forth between languages.
+%
+% \begin{macro}{\captionsswedish}
+% The macro |\captionsswedish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{swedish-1.0b}{1991/08/21}{removed type in definition of
+% \cs{contentsname}}
+% \changes{swedish-1.0b}{1991/08/21}{added definition for \cs{enclname}}
+% \changes{swedish-1.0b}{1991/08/21}{made definition of \cs{refname}
+% pluralis}
+% \changes{swedish-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
+% and \cs{prefacename}}
+% \changes{swedish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{swedish-1.1b}{1993/09/16}{Added translations}
+% \changes{swedish-1.3d}{1994/07/27}{Changed \cs{aa} to
+% \cs{csname}\texttt{ aa}\cs{endcsname}, to make \cs{uppercase} do
+% the right thing}
+% \changes{swedish-1.3f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \begin{macrocode}
+\addto\captionsswedish{%
+ \def\prefacename{F\"orord}%
+ \def\refname{Referenser}%
+ \def\abstractname{Sammanfattning}%
+ \def\bibname{Litteraturf\"orteckning}%
+ \def\chaptername{Kapitel}%
+ \def\appendixname{Bilaga}%
+ \def\contentsname{Inneh\csname aa\endcsname ll}%
+ \def\listfigurename{Figurer}%
+ \def\listtablename{Tabeller}%
+ \def\indexname{Sakregister}%
+ \def\figurename{Figur}%
+ \def\tablename{Tabell}%
+ \def\partname{Del}%
+% \end{macrocode}
+% \changes{swedish-2.3a}{2000/01/19}{Added full stop after ``Bil''}
+% \begin{macrocode}
+ \def\enclname{Bil.}%
+ \def\ccname{Kopia f\"or k\"annedom}%
+ \def\headtoname{Till}% in letter
+ \def\pagename{Sida}%
+ \def\seename{se}%
+% \end{macrocode}
+% \changes{swedish-1.3e}{1995/05/29}{Changed \cs{alsoname} from
+% `\texttt{se ocks\aa}'}
+% \begin{macrocode}
+ \def\alsoname{se \"aven}%
+% \end{macrocode}
+% \changes{swedish-1.3g}{1995/11/03}{Replaced `Proof' by its
+% translation}
+% \changes{swedish-2.3b}{2000/09/26}{Added \cs{glossaryname}}
+% \changes{swedish-2.3c}{2001/03/12}{Provided translation for
+% Glossary}
+% \begin{macrocode}
+ \def\proofname{Bevis}%
+ \def\glossaryname{Ordlista}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateswedish}
+% The macro |\dateswedish| redefines the command |\today| to
+% produce Swedish dates.
+% \changes{swedish-2.2}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{swedish-2.2}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \begin{macrocode}
+\def\dateswedish{%
+ \def\today{%
+ \number\day~\ifcase\month\or
+ januari\or februari\or mars\or april\or maj\or juni\or
+ juli\or augusti\or september\or oktober\or november\or
+ december\fi
+ \space\number\year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesymd}
+% \changes{swedish-2.3a}{2000/01/20}{Command added}
+% The macro |\datesymd| redefines the command |\today| to
+% produce dates in the format YYYY-MM-DD, common in Sweden.
+% \begin{macrocode}
+\def\datesymd{%
+ \def\today{\number\year-\two@digits\month-\two@digits\day}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\datesdmy}
+% \changes{swedish-2.3a}{2000/01/20}{Command added}
+% The macro |\datesdmy| redefines the command |\today| to
+% produce Swedish dates in the format DD/MM YYYY, also common in
+% Sweden.
+% \begin{macrocode}
+\def\datesdmy{%
+ \def\today{\number\day/\number\month\space\number\year}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\swedishhyphenmins}
+% The swedish hyphenation patterns can be used with |\lefthyphenmin|
+% set to~2 and |\righthyphenmin| set to~2.
+% \changes{swedish-1.3e}{1995/06/02}{use \cs{swedishhyphenmins} to
+% store the correct values}
+% \begin{macrocode}
+\providehyphenmins{swedish}{\tw@\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasswedish}
+% \changes{swedish-1.3e}{1995/05/29}{Added \cs{bbl@frenchspacing}}
+% \begin{macro}{\noextrasswedish}
+% \changes{swedish-1.3e}{1995/05/29}{Added \cs{bbl@nonfrenchspacing}}
+% The macro |\extrasswedish| performs all the extra definitions
+% needed for the Swedish language. The macro |\noextrasswedish| is
+% used to cancel the actions of |\extrasswedish|.
+%
+% For Swedish texts |\frenchspacing| should be in effect. We make
+% sure this is the case and reset it if necessary.
+%
+% \begin{macrocode}
+\addto\extrasswedish{\bbl@frenchspacing}
+\addto\noextrasswedish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% For Swedish the \texttt{"} character is made active. This is done
+% once, later on its definition may vary.
+% \changes{swedish-2.0}{1996/01/24}{Added active double quote
+% character}
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\addto\extrasswedish{\languageshorthands{swedish}}
+\addto\extrasswedish{\bbl@activate{"}}
+% \end{macrocode}
+% Don't forget to turn the shorthands off again.
+% \changes{swedish-2.2b}{1999/12/17}{Deactivate shorthands ouside of
+% Swedish}
+% \begin{macrocode}
+\addto\noextrasswedish{\bbl@deactivate{"}}
+% \end{macrocode}
+% The ``umlaut'' accent macro |\"| is changed to lower the
+% ``umlaut'' dots. The redefinition is done with the help of
+% |\umlautlow|.
+%^^A PROBLEM:
+%^^A What happens to ``umlaut''
+%^^A characters entered using e. g. latin input encoding? They should
+%^^A be lowered as well.
+% \begin{macrocode}
+\addto\extrasswedish{\babel@save\"\umlautlow}
+\addto\noextrasswedish{\umlauthigh}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The code above is necessary because we need an extra active
+% character. This character is then used as indicated in
+% table~\ref{tab:swedish-quote}.
+%
+% To be able to define the function of |"|, we first define a
+% couple of `support' macros.
+%
+% \begin{macro}{\dq}
+% We save the original double quote character in |\dq| to keep
+% it available, the math accent |\"| can now be typed as |"|.
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\x{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\x
+% \end{macrocode}
+% \end{macro}
+%
+% Now we can define the doublequote macros: the umlauts and {\aa}.
+% \changes{swedish-2.3a}{2000/01/20}{added \cs{allowhyphens}}
+% \begin{macrocode}
+\declare@shorthand{swedish}{"w}{\textormath{{\aa}\allowhyphens}{\ddot w}}
+\declare@shorthand{swedish}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
+\declare@shorthand{swedish}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
+\declare@shorthand{swedish}{"W}{\textormath{{\AA}\allowhyphens}{\ddot W}}
+\declare@shorthand{swedish}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
+\declare@shorthand{swedish}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
+% \end{macrocode}
+% discretionary commands
+%^^A PROBLEM:
+%^^A Will these allow subsequent hyphenation? Perhaps we need to
+%^^A add \cs{allowhyphens} here as well?
+% \begin{macrocode}
+\declare@shorthand{swedish}{"b}{\textormath{\bbl@disc b{bb}}{b}}
+\declare@shorthand{swedish}{"B}{\textormath{\bbl@disc B{BB}}{B}}
+\declare@shorthand{swedish}{"d}{\textormath{\bbl@disc d{dd}}{d}}
+\declare@shorthand{swedish}{"D}{\textormath{\bbl@disc D{DD}}{D}}
+\declare@shorthand{swedish}{"f}{\textormath{\bbl@disc f{ff}}{f}}
+\declare@shorthand{swedish}{"F}{\textormath{\bbl@disc F{FF}}{F}}
+\declare@shorthand{swedish}{"g}{\textormath{\bbl@disc g{gg}}{g}}
+\declare@shorthand{swedish}{"G}{\textormath{\bbl@disc G{GG}}{G}}
+\declare@shorthand{swedish}{"l}{\textormath{\bbl@disc l{ll}}{l}}
+\declare@shorthand{swedish}{"L}{\textormath{\bbl@disc L{LL}}{L}}
+\declare@shorthand{swedish}{"m}{\textormath{\bbl@disc m{mm}}{m}}
+\declare@shorthand{swedish}{"M}{\textormath{\bbl@disc M{MM}}{M}}
+\declare@shorthand{swedish}{"n}{\textormath{\bbl@disc n{nn}}{n}}
+\declare@shorthand{swedish}{"N}{\textormath{\bbl@disc N{NN}}{N}}
+\declare@shorthand{swedish}{"p}{\textormath{\bbl@disc p{pp}}{p}}
+\declare@shorthand{swedish}{"P}{\textormath{\bbl@disc P{PP}}{P}}
+\declare@shorthand{swedish}{"r}{\textormath{\bbl@disc r{rr}}{r}}
+\declare@shorthand{swedish}{"R}{\textormath{\bbl@disc R{RR}}{R}}
+\declare@shorthand{swedish}{"s}{\textormath{\bbl@disc s{ss}}{s}}
+\declare@shorthand{swedish}{"S}{\textormath{\bbl@disc S{SS}}{S}}
+\declare@shorthand{swedish}{"t}{\textormath{\bbl@disc t{tt}}{t}}
+\declare@shorthand{swedish}{"T}{\textormath{\bbl@disc T{TT}}{T}}
+% \end{macrocode}
+% and some additional commands:
+% \def\indexeqs{=}
+% \changes{swedish-2.3a}{2000/01/28}{changed definition of
+% \texttt{"\protect\indexeqs}, \cs{-} and \texttt{"~}}
+% \begin{macrocode}
+\declare@shorthand{swedish}{"-}{\nobreak-\bbl@allowhyphens}
+\declare@shorthand{swedish}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
+ \bbl@allowhyphens}{}}
+\declare@shorthand{swedish}{""}{\hskip\z@skip}
+\declare@shorthand{swedish}{"~}{%
+ \textormath{\leavevmode\hbox{-}\bbl@allowhyphens}{-}}
+\declare@shorthand{swedish}{"=}{\hbox{-}\allowhyphens}
+% \end{macrocode}
+%
+% \begin{macro}{\-}
+% Redefinition of |\-|. The new version of |\-| should indicate an
+% extra hyphenation position, while allowing other hyphenation
+% positions to be generated automatically. The standard behaviour
+% of \TeX\ in this respect is very unfortunate for languages such
+% as Dutch, Finnish, German and Swedish, where long compound words
+% are quite normal and all one needs is a means to indicate an
+% extra hyphenation position on top of the ones that \TeX\ can
+% generate from the hyphenation patterns.
+% \begin{macrocode}
+\addto\extrasswedish{\babel@save\-}
+\addto\extrasswedish{\def\-{\allowhyphens
+ \discretionary{-}{}{}\allowhyphens}}
+% \end{macrocode}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{swedish-2.1}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
+% \begin{macrocode}
+\ldf@finish{swedish}
+%</code>
+% \end{macrocode}
+%
+%\Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/swedish/swedish.ins b/macros/latex/contrib/babel-contrib/swedish/swedish.ins
new file mode 100644
index 0000000000..34916c0021
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/swedish/swedish.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{swedish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{swedish.ldf}{\from{swedish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/swedish/swedish.pdf b/macros/latex/contrib/babel-contrib/swedish/swedish.pdf
new file mode 100644
index 0000000000..ef105bc33b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/swedish/swedish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/thai/lthenc.def b/macros/latex/contrib/babel-contrib/thai/lthenc.def
new file mode 100644
index 0000000000..1632b6ea78
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/thai/lthenc.def
@@ -0,0 +1,157 @@
+%% This file is part of the thailatex package
+%% Created by Surapant Meknavin: surapan@nectec.or.th
+%% 2011/12/26 Theppitak Karoonboonyanan <thep@linux.thai.net>
+%% - add ASCII symbols \textdollar \textasciicircum \textasciitilde
+%% \textbackslash \textbar \textbraceleft \textbraceright
+%% \textgreater \textless \textquotedbl
+%% - add Latin symbols \textdagger \textdaggerdbl \textsection
+%% \textparagraph \copyright \textregistered \texttrademark
+%% \ss \ae \AE \oe \OE \i \j
+%% - drop text commands for copyright, registered, trademark, SS,
+%% in favor of native font glyphs
+%% - drop Latin wrapper to \TeX and \LaTeX commands
+%% 2004/06/14 Theppitak Karoonboonyanan <thep@linux.thai.net>
+%% - guard against recursive assignments of \ltxTeX and \ltxLaTeX
+%% (Reported by donzakh)
+%% 2002/04/21 Theppitak Karoonboonyanan <thep@linux.thai.net>
+%% - add special shape declarations e.g. \textquoteleft
+%% 2000/05/10 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
+%% - encoding changed from TIS to LTH, according to TeX convention
+
+\ProvidesFile{LTHenc.def}
+ [2011/12/26 v1.2
+ Thai Encoding]
+\DeclareFontEncoding{LTH}{}{}
+\DeclareFontSubstitution{LTH}{norasi}{m}{n}
+\DeclareErrorFont{LTH}{norasi}{m}{n}{10}
+% ASCII/Latin
+\DeclareTextSymbol{\textdollar}{LTH}{`\$}
+\DeclareTextSymbol{\textasciicircum}{LTH}{`\^}
+\DeclareTextSymbol{\textasciitilde}{LTH}{`\~}
+\DeclareTextSymbol{\textbackslash}{LTH}{`\\}
+\DeclareTextSymbol{\textbar}{LTH}{`\|}
+\DeclareTextSymbol{\textbraceleft}{LTH}{`\{}
+\DeclareTextSymbol{\textbraceright}{LTH}{`\}}
+\DeclareTextSymbol{\textgreater}{LTH}{`\>}
+\DeclareTextSymbol{\textless}{LTH}{`\<}
+\DeclareTextSymbol{\textquotedbl}{LTH}{`\"}
+\DeclareTextSymbol{\textquoteleft}{LTH}{145}
+\DeclareTextSymbol{\textquoteright}{LTH}{146}
+\DeclareTextSymbol{\textquotedblleft}{LTH}{147}
+\DeclareTextSymbol{\textquotedblright}{LTH}{148}
+\DeclareTextSymbol{\textbullet}{LTH}{149}
+\DeclareTextSymbol{\textendash}{LTH}{150}
+\DeclareTextSymbol{\textemdash}{LTH}{151}
+\DeclareTextSymbol{\textdagger}{LTH}{4}
+\DeclareTextSymbol{\textdaggerdbl}{LTH}{5}
+\DeclareTextSymbol{\textsection}{LTH}{6}
+\DeclareTextSymbol{\textparagraph}{LTH}{7}
+\DeclareTextSymbol{\copyright}{LTH}{8}
+\DeclareTextSymbol{\textregistered}{LTH}{9}
+\DeclareTextSymbol{\texttrademark}{LTH}{10}
+\DeclareTextSymbol{\ss}{LTH}{11}
+\DeclareTextSymbol{\ae}{LTH}{12}
+\DeclareTextSymbol{\AE}{LTH}{13}
+\DeclareTextSymbol{\oe}{LTH}{14}
+\DeclareTextSymbol{\OE}{LTH}{15}
+\DeclareTextSymbol{\i}{LTH}{25}
+\DeclareTextSymbol{\j}{LTH}{26}
+% Thai special characters
+\DeclareTextSymbol{\textyamakkan}{LTH}{238}
+\DeclareTextSymbol{\textfongmun}{LTH}{239}
+\DeclareTextSymbol{\textangkhankhu}{LTH}{250}
+\DeclareTextSymbol{\textkhomut}{LTH}{251}
+% Pali-Sanskrit
+\DeclareTextSymbol{\textYoYingPali}{LTH}{144}
+\DeclareTextSymbol{\textThoThanPali}{LTH}{128}
+% UCS support
+\DeclareTextSymbol{\thaiKoKai}{LTH}{161}
+\DeclareTextSymbol{\thaiKhoKhai}{LTH}{162}
+\DeclareTextSymbol{\thaiKhoKhuat}{LTH}{163}
+\DeclareTextSymbol{\thaiKhoKhwai}{LTH}{164}
+\DeclareTextSymbol{\thaiKhoKhon}{LTH}{165}
+\DeclareTextSymbol{\thaiKhoRakhang}{LTH}{166}
+\DeclareTextSymbol{\thaiNgoNgu}{LTH}{167}
+\DeclareTextSymbol{\thaiChoChan}{LTH}{168}
+\DeclareTextSymbol{\thaiChoChing}{LTH}{169}
+\DeclareTextSymbol{\thaiChoChang}{LTH}{170}
+\DeclareTextSymbol{\thaiSoSo}{LTH}{171}
+\DeclareTextSymbol{\thaiChoChoe}{LTH}{172}
+\DeclareTextSymbol{\thaiYoYing}{LTH}{173}
+\DeclareTextSymbol{\thaiDoChada}{LTH}{174}
+\DeclareTextSymbol{\thaiToPatak}{LTH}{175}
+\DeclareTextSymbol{\thaiThoThan}{LTH}{176}
+\DeclareTextSymbol{\thaiThoNangmontho}{LTH}{177}
+\DeclareTextSymbol{\thaiThoPhuthao}{LTH}{178}
+\DeclareTextSymbol{\thaiNoNen}{LTH}{179}
+\DeclareTextSymbol{\thaiDoDek}{LTH}{180}
+\DeclareTextSymbol{\thaiToTao}{LTH}{181}
+\DeclareTextSymbol{\thaiThoThung}{LTH}{182}
+\DeclareTextSymbol{\thaiThoThahan}{LTH}{183}
+\DeclareTextSymbol{\thaiThoThong}{LTH}{184}
+\DeclareTextSymbol{\thaiNoNu}{LTH}{185}
+\DeclareTextSymbol{\thaiBoBaimai}{LTH}{186}
+\DeclareTextSymbol{\thaiPoPla}{LTH}{187}
+\DeclareTextSymbol{\thaiPhoPhung}{LTH}{188}
+\DeclareTextSymbol{\thaiFoFa}{LTH}{189}
+\DeclareTextSymbol{\thaiPhoPhan}{LTH}{190}
+\DeclareTextSymbol{\thaiFoFan}{LTH}{191}
+\DeclareTextSymbol{\thaiPhoSamphao}{LTH}{192}
+\DeclareTextSymbol{\thaiMoMa}{LTH}{193}
+\DeclareTextSymbol{\thaiYoYak}{LTH}{194}
+\DeclareTextSymbol{\thaiRoRua}{LTH}{195}
+\DeclareTextSymbol{\thaiRu}{LTH}{196}
+\DeclareTextSymbol{\thaiLoLing}{LTH}{197}
+\DeclareTextSymbol{\thaiLu}{LTH}{198}
+\DeclareTextSymbol{\thaiWoWaen}{LTH}{199}
+\DeclareTextSymbol{\thaiSoSala}{LTH}{200}
+\DeclareTextSymbol{\thaiSoRusi}{LTH}{201}
+\DeclareTextSymbol{\thaiSoSua}{LTH}{202}
+\DeclareTextSymbol{\thaiHoHip}{LTH}{203}
+\DeclareTextSymbol{\thaiLoChula}{LTH}{204}
+\DeclareTextSymbol{\thaiOAng}{LTH}{205}
+\DeclareTextSymbol{\thaiHoNokhuk}{LTH}{206}
+\DeclareTextSymbol{\thaiPaiyannoi}{LTH}{207}
+\DeclareTextSymbol{\thaiSaraA}{LTH}{208}
+\DeclareTextSymbol{\thaiMaiHanakat}{LTH}{209}
+\DeclareTextSymbol{\thaiSaraAa}{LTH}{210}
+\DeclareTextSymbol{\thaiSaraAm}{LTH}{211}
+\DeclareTextSymbol{\thaiSaraI}{LTH}{212}
+\DeclareTextSymbol{\thaiSaraIi}{LTH}{213}
+\DeclareTextSymbol{\thaiSaraUe}{LTH}{214}
+\DeclareTextSymbol{\thaiSaraUee}{LTH}{215}
+\DeclareTextSymbol{\thaiSaraU}{LTH}{216}
+\DeclareTextSymbol{\thaiSaraUu}{LTH}{217}
+\DeclareTextSymbol{\thaiPhinthu}{LTH}{218}
+\DeclareTextSymbol{\textbaht}{LTH}{223}
+\DeclareTextSymbol{\thaiSaraE}{LTH}{224}
+\DeclareTextSymbol{\thaiSaraAe}{LTH}{225}
+\DeclareTextSymbol{\thaiSaraO}{LTH}{226}
+\DeclareTextSymbol{\thaiSaraAiMaimuan}{LTH}{227}
+\DeclareTextSymbol{\thaiSaraAiMaimalai}{LTH}{228}
+\DeclareTextSymbol{\thaiLakkhangyao}{LTH}{229}
+\DeclareTextSymbol{\thaiMaiyamok}{LTH}{230}
+\DeclareTextSymbol{\thaiMaitaikhu}{LTH}{231}
+\DeclareTextSymbol{\thaiMaiEk}{LTH}{232}
+\DeclareTextSymbol{\thaiMaiTho}{LTH}{233}
+\DeclareTextSymbol{\thaiMaiTri}{LTH}{234}
+\DeclareTextSymbol{\thaiMaiChattawa}{LTH}{235}
+\DeclareTextSymbol{\thaiThanthakhat}{LTH}{236}
+\DeclareTextSymbol{\thaiNikhahit}{LTH}{237}
+\DeclareTextSymbol{\thaiYamakkan}{LTH}{238}
+\DeclareTextSymbol{\thaiFongman}{LTH}{239}
+\DeclareTextSymbol{\thaizero}{LTH}{240}
+\DeclareTextSymbol{\thaione}{LTH}{241}
+\DeclareTextSymbol{\thaitwo}{LTH}{242}
+\DeclareTextSymbol{\thaithree}{LTH}{243}
+\DeclareTextSymbol{\thaifour}{LTH}{244}
+\DeclareTextSymbol{\thaifive}{LTH}{245}
+\DeclareTextSymbol{\thaisix}{LTH}{246}
+\DeclareTextSymbol{\thaiseven}{LTH}{247}
+\DeclareTextSymbol{\thaieight}{LTH}{248}
+\DeclareTextSymbol{\thainine}{LTH}{249}
+\DeclareTextSymbol{\thaiAngkhankhu}{LTH}{250}
+\DeclareTextSymbol{\thaiKhomut}{LTH}{251}
+\endinput
+%%
+%% End of file `LTHenc.def'.
diff --git a/macros/latex/contrib/babel-contrib/thai/thai.dtx b/macros/latex/contrib/babel-contrib/thai/thai.dtx
new file mode 100644
index 0000000000..6b30f049d1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/thai/thai.dtx
@@ -0,0 +1,914 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 1999 National Electronics and Computer Technology Center
+% (NECTEC), Thailand. All rights reserved.
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Theppitak Karoonboonyanan.
+%
+% This work consists of the files thai.dtx and thai.ins
+% and the derived file thai.ldf.
+%
+% \fi
+% \CheckSum{272}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{thai.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{thai}
+%\fi
+%\ProvidesFile{thai.dtx}
+ [2013/03/31 v1.8 Thai support from the babel system]
+%\iffalse
+%% File `thai.dtx'
+%% Thai Language Definition File
+%% Copyright (C) 1999 - 2013
+%% by Surapant Meknavin,
+%% Theppitak Karoonboonyanan (thep at linux.thai.net),
+%% Chanop Silpa-Anan (chanop at debian.org),
+%% Poonlap Veerathanabutr (poonlap at linux.thai.net)
+%% Thai Linux Working Group
+%% http://linux.thai.net/
+%%
+%% Please report errors to: Theppitak Karoonboonyanan
+%% (thep at linux.thai.net)
+%%
+%% This file is part of the babel system, it provides the source
+%% code for the Thai language definition file. The original version
+%% was written by Surapant Meknavin.
+%%
+%% It is currently maintained by Theppitak Karoonboonyanan
+%% (thep at linux.thai.net), Chanop Silpa-Anan (chanop at debian.org)
+%% and Poonlap Veerathanabutr (poonlap at linux.thai.net).
+%
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{thai.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{thai.dtx}
+%
+% \changes{thai-1.0d}{2000/05/09}{Theppitak Karoonboonyanan:
+% Encoding changed from TIS to LTH, according to TeX convention.
+% Let `norasi' be Thai roman font, `dbttx' Thai sans serif.
+% Correct some Thai translations.}
+% \changes{thai-1.0d}{2001/12/04}{Theppitak Karoonboonyanan:
+% Add checks for \cs{thechapter} existence before redefining
+% digits as Thai.
+% Move thaitoday definitions into thainumber and remove
+% thainumber option.
+% Use \cs{ifcase} instead of nested \cs{if} in \cs{thaitranslate}.
+% Fix wrong encoding in heading for book style (as suggested by Chanop).}
+% \changes{thai-1.0d}{2001/12/04}{Chanop Silpa-Anan:
+% Add thainumber and thaitoday option}
+% \changes{thai-1.0d}{2002/01/16}{Theppitak Karoonboonyanan:
+% Fix extra spaces appearing in \cs{selectlanguage\{thai\}}
+% (as suggested by C. Visavakul)}
+% \changes{thai-1.0d}{2003/01/07}{Poonlap Veerathanabutr:
+% Change `dbttx' to `dbtt'}
+% \changes{thai-1.0d}{2003/02/26}{Theppitak Karoonboonyanan:
+% Run Thai number in part, subsubsection, paragraph,
+% subparagraph also}
+% \changes{thai-1.0d}{2003/06/02}{Chanop Silpa-Anan:
+% Use `garuda' for default Thai sans serif since
+% `dbtt' is still slightly buggy}
+% \changes{thai-1.0d}{2003/08/10}{Theppitak Karoonboonyanan:
+% Fix translation of \cs{prefacename}.
+% Redefine \cs{frontmatter} and \cs{mainmatter} for book class
+% so thainumber option applies to the page numbering styles.
+% (Experimental:) Add initialization of Thai character codes
+% to fix the \cs{MakeUppercase} and \cs{MakeLowercase} problem
+% also comment out the old workarounds.}
+% \changes{thai-1.0d}{2004/02/02}{Poonlap Veerathanabutr:
+% Fix \cs{lccode} and \cs{uccode}}
+% \changes{thai-1.0d}{2004/02/28}{Theppitak Karoonboonyanan:
+% Always use Thai alphabets for appendix (as suggested by K. chakkree01)}
+% \changes{thai-1.0d}{2004/03/04}{Theppitak Karoonboonyanan:
+% Use `pmono' as default Thai ttfamily}
+% \changes{thai-1.0d}{2004/03/06}{Theppitak Karoonboonyanan:
+% Use `garuda' instead of `dbtt' as default Thai sffamily}
+% \changes{thai-1.0d}{2004/03/18}{Theppitak Karoonboonyanan:
+% Move \cs{frontmatter} and \cs{mainmatter} redefinition back under
+% `thainumber' option (wrongly moved along with previous
+% appendix fix)}
+% \changes{thai-1.0d}{2004/04/08}{Theppitak Karoonboonyanan:
+% Borrow code from previous encoding fix to inhibit capitalizing
+% chapters \& sections in book headers. (proposed by P'Joy)}
+% \changes{thai-1.0d}{2004/11/15}{Theppitak Karoonboonyanan:
+% `pmono' is now `ttype'}
+% \changes{thai-1.1}{2006/07/05}{Theppitak Karoonboonyanan:
+% Create `thai.dtx' for documenting and generating `thai.ldf'.
+% Remove unnecessary workarounds for inhibition of capitalization
+% of headers, as the catcodes already do the job.
+% Also remove the mysterious redefinitions of figure and table counters.}
+% \changes{thai-1.2}{2009/07/27}{Theppitak Karoonboonyanan:
+% Re-encode Thai messages with unicode symbolic names, instead of explicit
+% TIS-620 bytes. Adjust documentation to cover UTF-8 support. Make
+% \cs{ttypist} the default typewriter font instead of \cs{ttype}.
+% Drop the obsolete \cs{\backslash{}thai} command.}
+% \changes{thai-1.3}{2011/03/17}{Theppitak Karoonboonyanan:
+% Add \cs{\backslash{}textpali} macro for typesetting Pali text with
+% descender-less Yo Ying and Tho Than. Update translation for
+% \cs{\backslash{}refname}}
+% \changes{thai-1.4}{2011/10/18}{Theppitak Karoonboonyanan:
+% Remove font-specific macros}
+% \changes{thai-1.4a}{2011/11/23}{Theppitak Karoonboonyanan:
+% Revise documentation}
+% \changes{thai-1.4b}{2011/12/16}{Theppitak Karoonboonyanan:
+% Remove extra space in \cs{\backslash{}wbr}. Word spacing is considered
+% suboptimal.}
+% \changes{thai-1.4c}{2011/12/19}{Theppitak Karoonboonyanan:
+% Revise documentation}
+% \changes{thai-1.4d}{2012/02/10}{Theppitak Karoonboonyanan:
+% Revise documentation. Add documentation for Thai line stretching.}
+% \changes{thai-1.5}{2013/01/29}{Theppitak Karoonboonyanan:
+% Add space stretching support.}
+% \changes{thai-1.6}{2013/03/12}{Theppitak Karoonboonyanan:
+% Fix crash on \cs{\backslash{}renewcommand} when \cs{thainumber} option
+% is used with section-less document classes, such as letter.}
+% \changes{thai-1.7}{2013/03/13}{Theppitak Karoonboonyanan:
+% Limit the scope of emergency stretch within Thai language by using
+% \cs{\backslash{}extrasthai} and \cs{\backslash{}noextrasthai}.}
+% \changes{thai-1.8}{2013/03/31}{Pruet Boonma:
+% Add \Lopt{thaiindentfirst} option to force indentation on section's
+% first paragraph.}
+%
+% \section{The Thai language}
+%
+% The file \file{\filename}\footnote{The file described in this section has
+% version number \fileversion\ and was last revised on \filedate. The
+% original author was Surapant Meknavin, and it was composed into
+% \file{\filename} and maintained by Theppitak Karoonboonyanan
+% (\texttt{thep@linux.thai.net}).}
+% defines language-specific macros for Thai language.
+%
+% \subsection{Input encoding}
+%
+% Thai documents supported by this language definition can be encoded in
+% either TIS-620 (ISO/IEC 8859-11) or UTF-8 with the aids of the
+% \texttt{inputenc} package.
+%
+% \DescribeMacro{\thaitext}
+% \DescribeMacro{\latintext}
+% The commands |\thaitext| and |\latintext| can be used to switch to Thai
+% or Latin fonts. These are declarations.
+%
+% \DescribeMacro{\textthai}
+% \DescribeMacro{\textlatin}
+% The commands |\textthai| and |\textlatin| both take one text argument
+% which is then typeset using the requested language settings.
+%
+% \DescribeMacro{\textpali}
+% The command |\textpali| takes one text argument which is then typeset
+% using Thai font, with special shapes for certain characters, such as
+% descender-less Yo Ying and Tho Than, as required by usual Pali-Sanskrit
+% transliteration.
+%
+% \subsection{Word breaks}
+%
+% Thai is written continuously without word delimitors. The word boundary
+% analysis is considered too complicated for rule-based approaches.
+% Most available good-quality word analysis tools employ special matching
+% algorithms against pre-defined dictionaries. Some even use
+% statistics-based contextual analysis to resolve ambiguities. Therefore,
+% no good hyphenation pattern is found to be comparable with those tools
+% yet.
+%
+% \DescribeMacro{\wbr}
+% What provided here for the word boundary problem is the |\wbr| command
+% for separating words. It delimits words without taking physical space,
+% so that the \TeX\ typesetter still wraps lines at word boundary like
+% when it typesets English text.
+%
+% Therefore, one can preprocess their Thai document using Thai word analysis
+% tools which automatically insert the |\wbr| commands between words, such
+% as:
+% \begin{itemize}
+% \item \emph{cttex} by Vuthichai Ampornaramveth
+% \item \emph{swath} by Phaisarn Charoenpornsawat, now maintained by Thai
+% Linux Working Group, which can be downloaded from:\\
+% \texttt{ftp://linux.thai.net/pub/thailinux/software/swath}
+%
+% To compile \emph{swath}, you need \emph{libdatrie} as the
+% dependency, which is provided under the \emph{libthai} project:\\
+% \texttt{ftp://linux.thai.net/pub/thailinux/software/libthai}
+% \end{itemize}
+%
+% \subsection{Thai paragraph}
+% \label{thai-paragraph}
+% Generally speaking, Thai paragraph uses the same rule as in English.
+% However, there are some differences, such as how to start the paragraph
+% in a new chapter or section.
+%
+% \DescribeEnv{thaiindentfirst}
+% As suggested by English writing guideline, the first paragraph in each
+% section shall not be indented. However, for Thai language, indenting the
+% first paragraph is more popular and widely suggested. The option
+% \Lopt{thaiindentfirst} can be used to control this behavior.
+%
+% \subsection{Thai numbering}
+% \label{thai-numbering}
+%
+% Some certain Thai documents use Thai digits instead of Arabic.
+% And Thai alphabetic numbering is also commonly used for appendices.
+% This file provides a number of numbering styles that can be applied
+% to \LaTeX\ |\pagenumbering| command:
+%
+% \begin{itemize}
+% \item |\thainum| for plain Thai digits
+% \item |\thaibracenum| for Thai digits in parentheses
+% \item |\thaialph| for Thai alphabetic numbering, using a reduced set
+% (with three alphabets skipped: Kho Khuat, Kho Khon and Kho Rakhang)
+% \item |\thaiAlph| for Thai alphabetic numbering, using the full set
+% (with full alphabet set, plus two semi-vowels, Ru and Lu, in the
+% order defined in Thai official dictionary)
+% \end{itemize}
+%
+% \DescribeEnv{thainumber}
+% The above numbering styles can be automatically chosen using the
+% \Lopt{thainumber} option. When this option is supplied to the \babel{}
+% package, Thai numberings will be applied to pages, sections,
+% enumerations, dates, etc.
+%
+% \StopEventually{}
+%
+% \subsection{Thai language definition}
+%
+% The macro |\LdfInit| takes care of preventing file from being
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit\CurrentOption{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage{babel}|
+% command, \texttt{thai} will be an `unknown' language, in which
+% case we have to make it known. So, we check for the existence of
+% |\l@thai| to see whether we have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@thai\@undefined
+ \@nopatterns{thai}
+ \adddialect\l@thai0\fi
+% \end{macrocode}
+%
+% \subsubsection{Thai character encoding}
+%
+% In this language definition, we support TIS-620, the national standard
+% 8-bit character encoding, and Unicode by means of \texttt{inputenc}
+% package.
+%
+% The encoding has been described in terms of TIS-620 as \texttt{LTH} in
+% the \file{lthenc.def} file. So, we require it.
+%
+% \begin{macrocode}
+\InputIfFileExists{lthenc.def}%
+ {\message{Loading the definitions for the Thai font encoding}}%
+ {%
+ \errhelp{I can't find the lthenc.def file for the Thai fonts}%
+ \errmessage{Since I do not know what the LTH encoding means^^J
+ I can't typeset Thai.^^J
+ I stop here, while you get a suitable lthenc.def file}\@@end
+ }
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to the Thai
+% language, for users to switch back and forth between languages.
+%
+% \begin{macro}{\thaitext}
+% We define |\thaitext| as a declarative switch to Thai font encoding.
+% \begin{macrocode}
+\DeclareRobustCommand{\thaitext}{%
+ \fontencoding{LTH}\selectfont%
+ \def\encodingdefault{LTH}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textthai}
+% This command takes one text argument which is then typeset using Thai font
+% encoding.
+% \begin{macrocode}
+\DeclareRobustCommand{\textthai}[1]{{\thaitext #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Pali-Sanskrit Transliteration}
+%
+% Thai script can also be used for writing Pali and Sanskrit. Additional
+% conventions are applied when doing so: (a) Yo Ying and Tho Than must be
+% written without descender; (b) Phinthu is used for marking cluster;
+% (c) Nikhahit is used as a Pali-Sanskrit consonant.
+%
+% (b) is inherently applicable as combining character. So is (c), with
+% an exception for the case in which it is combined over upper vowel
+% (namely, Sara I), where it must be shifted to higher position. Nikhahit
+% shifting is implemented in the ligkern rules with the extra glyph
+% provision in the fonts.
+%
+% What is left here is (a). Yo Ying and Tho Than must be converted to
+% their descender-less variants. The |\textpali| macro is defined
+% for this purpose. Note that |\wbr| commands which are normally inserted
+% by automatic tools are ignored here, as most of such tools are not
+% designed for Pali/Sanskrit. Besides, Pali/Sanskrit is already space
+% delimited.
+%
+% \begin{macro}{\textpali}
+% This command converts all Yo Ying and Tho Than in its argument to
+% their descender-less variations.
+% \begin{macrocode}
+\DeclareRobustCommand{\textpali}[1]{%
+ \begingroup
+ \def\thaiYoYing{\textYoYingPali{}}%
+ \def\thaiThoThan{\textThoThanPali{}}%
+ \def\wbr{}%
+ \scantokens\expandafter{#1}\relax
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Hyphenation}
+%
+% We define |\thaihyphenmins| macro for hyphenation parameters. This is
+% one of the five macros required by \babel{}.
+%
+% \begin{macro}{\thaihyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|. They are set to 11.
+% \changes{thai-1.1}{2006/07/02}{Theppitak Karoonboonyanan:
+% Now use \cs{providehyphenmins} to provide a default value}
+% \begin{macrocode}
+\providehyphenmins{thai}{11}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Captions translation}
+%
+% We define |\captionsthai| macro for translations of strings. This is
+% one of the five macros required by \babel{}.
+%
+% \begin{macro}{\captionsthai}
+% The macro |\captionsthai| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \begin{macrocode}
+\addto\captionsthai{%
+ \def\prefacename{\thaiKhoKhwai\thaiSaraAm\thaiNoNu\thaiSaraAm}%
+ \def\refname{\thaiSaraE\thaiOAng\thaiKoKai\thaiSoSua\thaiSaraAa\thaiRoRua%
+ \thaiOAng\thaiMaiTho\thaiSaraAa\thaiNgoNgu%
+ \thaiOAng\thaiSaraI\thaiNgoNgu}%
+ \def\abstractname{\thaiBoBaimai\thaiThoThahan%
+ \thaiKhoKhwai\thaiMaiHanakat\thaiDoDek%
+ \thaiYoYak\thaiMaiEk\thaiOAng}%
+ \def\bibname{\thaiBoBaimai\thaiRoRua\thaiRoRua\thaiNoNen\thaiSaraAa%
+ \thaiNoNu\thaiSaraU\thaiKoKai\thaiRoRua\thaiMoMa}%
+ \def\chaptername{\thaiBoBaimai\thaiThoThahan%
+ \thaiThoThahan\thaiSaraIi\thaiMaiEk}%
+ \def\appendixname{\thaiPhoSamphao\thaiSaraAa\thaiKhoKhwai%
+ \thaiPhoPhung\thaiNoNu\thaiWoWaen\thaiKoKai}%
+ \def\contentsname{\thaiSoSua\thaiSaraAa\thaiRoRua%
+ \thaiBoBaimai\thaiMaiHanakat\thaiYoYing}%
+ \def\listfigurename{\thaiSoSua\thaiSaraAa\thaiRoRua%
+ \thaiBoBaimai\thaiMaiHanakat\thaiYoYing%
+ \thaiRoRua\thaiSaraUu\thaiPoPla}%
+ \def\listtablename{\thaiSoSua\thaiSaraAa\thaiRoRua%
+ \thaiBoBaimai\thaiMaiHanakat\thaiYoYing%
+ \thaiToTao\thaiSaraAa\thaiRoRua\thaiSaraAa\thaiNgoNgu}%
+ \def\indexname{\thaiDoDek\thaiRoRua\thaiRoRua\thaiChoChang%
+ \thaiNoNu\thaiSaraIi}%
+ \def\figurename{\thaiRoRua\thaiSaraUu\thaiPoPla%
+ \thaiThoThahan\thaiSaraIi\thaiMaiEk}%
+ \def\tablename{\thaiToTao\thaiSaraAa\thaiRoRua\thaiSaraAa\thaiNgoNgu%
+ \thaiThoThahan\thaiSaraIi\thaiMaiEk}%
+ \def\partname{\thaiPhoSamphao\thaiSaraAa\thaiKhoKhwai}%
+ \def\enclname{\thaiSoSua\thaiSaraI\thaiMaiEk\thaiNgoNgu%
+ \thaiThoThahan\thaiSaraIi\thaiMaiEk%
+ \thaiSaraAe\thaiNoNu\thaiBoBaimai%
+ \thaiMoMa\thaiSaraAa%
+ \thaiDoDek\thaiMaiTho\thaiWoWaen\thaiYoYak}%
+ \def\ccname{\thaiSoSua\thaiSaraAm\thaiSaraE\thaiNoNu\thaiSaraAa%
+ \thaiThoThung\thaiSaraUe\thaiNgoNgu}%
+ \def\headtoname{\thaiSaraE\thaiRoRua\thaiSaraIi\thaiYoYak\thaiNoNu}%
+ \def\pagename{\thaiHoHip\thaiNoNu\thaiMaiTho\thaiSaraAa}%
+ \def\seename{\thaiDoDek\thaiSaraUu}%
+ \def\alsoname{\thaiDoDek\thaiSaraUu%
+ \thaiSaraE\thaiPhoPhan\thaiSaraI\thaiMaiEk\thaiMoMa%
+ \thaiSaraE\thaiToTao\thaiSaraI\thaiMoMa}%
+ \def\proofname{\thaiPhoPhan\thaiSaraI%
+ \thaiSoSua\thaiSaraUu\thaiChoChan\thaiNoNu\thaiThanthakhat}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Date}
+%
+% Here we define |\datethai| macro for Thai date format. This is
+% one of the five macros required by \babel{}.
+%
+% First, let's define the months in Thai.
+%
+% \begin{macrocode}
+\def\th@month{%
+ \ifcase\month\or
+ \thaiMoMa\thaiKoKai\thaiRoRua\thaiSaraAa\thaiKhoKhwai\thaiMoMa \or
+ \thaiKoKai\thaiSaraU\thaiMoMa\thaiPhoSamphao\thaiSaraAa%
+ \thaiPhoPhan\thaiMaiHanakat\thaiNoNu\thaiThoThong\thaiThanthakhat \or
+ \thaiMoMa\thaiSaraIi\thaiNoNu\thaiSaraAa\thaiKhoKhwai\thaiMoMa \or
+ \thaiSaraE\thaiMoMa\thaiSoRusi\thaiSaraAa\thaiYoYak\thaiNoNu \or
+ \thaiPhoPhan\thaiRu\thaiSoRusi\thaiPhoSamphao\thaiSaraAa%
+ \thaiKhoKhwai\thaiMoMa \or
+ \thaiMoMa\thaiSaraI\thaiThoThung\thaiSaraU\thaiNoNu\thaiSaraAa%
+ \thaiYoYak\thaiNoNu \or
+ \thaiKoKai\thaiRoRua\thaiKoKai\thaiDoChada\thaiSaraAa%
+ \thaiKhoKhwai\thaiMoMa \or
+ \thaiSoSua\thaiSaraI\thaiNgoNgu\thaiHoHip\thaiSaraAa%
+ \thaiKhoKhwai\thaiMoMa \or
+ \thaiKoKai\thaiMaiHanakat\thaiNoNu\thaiYoYak\thaiSaraAa%
+ \thaiYoYak\thaiNoNu \or
+ \thaiToTao\thaiSaraU\thaiLoLing\thaiSaraAa\thaiKhoKhwai\thaiMoMa \or
+ \thaiPhoPhan\thaiRu\thaiSoSala\thaiChoChan\thaiSaraI\thaiKoKai\thaiSaraAa%
+ \thaiYoYak\thaiNoNu \or
+ \thaiThoThong\thaiMaiHanakat\thaiNoNu\thaiWoWaen\thaiSaraAa%
+ \thaiKhoKhwai\thaiMoMa
+ \fi}
+% \end{macrocode}
+%
+% Thai official calendar uses Buddhist Era, the era whose start is marked
+% by Buddha's entry into Parinirvana. In original form, it is a lunar
+% calendar. But in Thai contemporary calendar, it is synchronized to
+% Gregorian calendar, with offset of 543 years back.
+%
+% \begin{macrocode}
+\newcount\th@year
+\th@year=\year
+\advance\th@year by 543
+% \end{macrocode}
+%
+% Then, we come to the |\datethai| macro.
+%
+% \begin{macro}{\datethai}
+% Thai date format is in the day-month-year order, using Buddhist Era.
+% \begin{macrocode}
+\def\datethai{%
+ \def\today{\number\day \space \th@month\space %
+ \thaiPhoPhan.\thaiSoSala.~\number\th@year}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Extra definitions for language switching}
+%
+% Then, the last two macros required by \babel{} are |\extrasthai| and
+% |\noextrasthai| containing extra definitions needed for Thai language
+% upon switching to and out of it, respectively.
+%
+% \begin{macrocode}
+\addto\extrasthai{\thaitext}
+\addto\noextrasthai{\latintext}
+% \end{macrocode}
+%
+% \subsection{Word break support}
+%
+% As Thai script is written continuously without word delimitors, we define
+% |\wbr| command to mark word boundaries without taking space, so that
+% \TeX typesetter can wrap Thai lines at proper positions.
+%
+% \begin{macrocode}
+\def\wbr{\hskip0pt\relax}
+% \end{macrocode}
+%
+% \subsection{Space stretching}
+%
+% Since ordinary Thai text contains fewer spaces than English,
+% the \TeX{} justification is stressed with fewer places to stretch
+% to make the line reach the right margin. This usually ends up with
+% overfull lines when \TeX{} decides to include the next word to fill
+% the space, instead of trying to manipulate spacing with appropriate
+% amount of text. Possible solutions to this problem include:
+% \begin{itemize}
+% \item \emph{Use letter spacing.} This is a common practice in Thai
+% publishing. However, \TeX{} does not allow this, probably not to
+% shag sheep.\footnote{\emph{``Men who would letterspace blackletter
+% would shag sheep'' --- Frederick Goudy.}}
+% \item \emph{Allow stretching between words.} This used to be a simple
+% hack in an old version of this module, until it was finally
+% dropped in version 1.4b, as it was considered suboptimal.
+% \item \emph{Allow more space stretching.} This can be more acceptable,
+% compared to the ragged right margin. And it is what we do here.
+% \end{itemize}
+%
+% \begin{macrocode}
+\addto\extrasthai{%
+ \edef\th@restoreemstretch{\emergencystretch=\the\emergencystretch}
+ \setlength{\emergencystretch}{0.6em}}
+\addto\noextrasthai{\th@restoreemstretch}
+% \end{macrocode}
+%
+% \subsection{Line spacing}
+%
+% Due to multi-level combining character stacking, Thai text lines
+% can occupy more vertical space than English. To prevent overlapping,
+% \TeX{} allocates more height for lines with combining characters
+% but not for those without. This can cause irregular line spacing.
+% To avoid this problem, we need to stretch the line spacing.
+%
+% \begin{macrocode}
+\renewcommand{\baselinestretch}{1.2}
+% \end{macrocode}
+%
+% \subsection{Paragraph}
+% This section provides Thai paragarph formating style as described in
+% \S\ref{thai-paragraph}.
+%
+% \subsubsection{\Lopt{thaiindentfirst} option}
+%
+% If \Lopt{thaiindentfirst} is supplied in the |\usepackage| command, the
+% first Thai paragraph in each section will be indented. The other
+% paragraphs will behave as default.
+%
+% \begin{macrocode}
+\DeclareOption{thaiindentfirst} {%
+% \end{macrocode}
+%
+% When switching to Thai language, point |\@afterindentfalse| to
+% |\@afterindentrue|, so that \LaTeX\ will never indent the first
+% paragraph.
+%
+% \begin{macrocode}
+ \addto\extrasthai{%
+ \let\th@afterindentfalse\@afterindentfalse
+ \let\@afterindentfalse\@afterindenttrue
+ \@afterindenttrue
+ }
+% \end{macrocode}
+%
+% When switching out of Thai language, point |\@afterindentfalse|
+% back to its original function.
+%
+% \begin{macrocode}
+ \addto\noextrasthai{%
+ \let\@afterindentfalse\th@afterindentfalse
+ }
+}
+% \end{macrocode}
+%
+% \subsection{Thai numbering support}
+%
+% This section provides Thai numbering styles as described in
+% \S\ref{thai-numbering}: |\thainum|, |\thaibracenum|, |\thaialph| and
+% |\thaiAlph|.
+%
+% First, we define a macro for translating decimal digits into Thai digits.
+%
+% \begin{macro}{\thaitranslate}
+% The |\thaitranslate| macro determines decimal digits in the argument and
+% convert them to Thai digit one by one, until the `|@|' terminator is found.
+% \begin{macrocode}
+\def\thaitranslate#1{\ifx @#1%
+ \else\ifcase#1
+ \thaizero \or \thaione \or \thaitwo \or \thaithree \or \thaifour \or
+ \thaifive \or \thaisix \or \thaiseven \or \thaieight \or \thainine
+ \else\fi
+ \expandafter\thaitranslate
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thainum}
+% The |\thainum| macro is to be used as a numbering style in \LaTeX\
+% |\pagenumbering| command.
+%
+% It takes a counter name and converts its value into Thai digits.
+% In details, it prepends the counter name with `|c@|' to access the counter
+% value, then calls |\@thainum| to convert it into Thai digits.
+%
+% The |\@thainum| macro converts a number into Thai digits. It expands the
+% argument into a number, terminates it with `|@|', and calls
+% |\thaitranslate| to convert it into Thai digits.
+%
+% \begin{macrocode}
+\def\@thainum#1{\expandafter\thaitranslate\number#1@}
+\def\thainum#1{\expandafter\@thainum\csname c@#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thaibracenum}
+% Similar to |\thainum|, the |\thaibracenum| macro is to be used as a
+% numbering style in \LaTeX\ |\pagenumbering| command.
+%
+% It provides Thai digits numbering, surrounded by parentheses.
+%
+% \begin{macrocode}
+\def\@thaibracenum#1{(\expandafter\thaitranslate\number#1@)}
+\def\thaibracenum#1{\expandafter\@thaibracenum\csname c@#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% Now come to Thai alphabetic numbering, beginning with the reduced set.
+%
+% \begin{macro}{\thaialph}
+% The |\thaialph| macro is to be used as a numbering style in \LaTeX\
+% |\pagenumbering| command.
+%
+% It converts a number not greater than 41 into Thai alphabet in the
+% corresponding order in the reduced set. In this set, 3 characters
+% are skipped: Kho Khuat, Kho Khon and Kho Rakhang.
+%
+% \begin{macrocode}
+\def\thaialph#1{\expandafter\@thaialph\csname c@#1\endcsname}
+\def\@thaialph#1{%
+ \ifcase#1\or \thaiKoKai\or \thaiKhoKhai\or \thaiKhoKhwai\or \thaiNgoNgu\or
+ \thaiChoChan\or \thaiChoChing\or \thaiChoChang\or \thaiSoSo\or
+ \thaiChoChoe\or \thaiYoYing\or \thaiDoChada\or \thaiToPatak\or
+ \thaiThoThan\or \thaiThoNangmontho\or \thaiThoPhuthao\or \thaiNoNen\or
+ \thaiDoDek\or \thaiToTao\or \thaiThoThung\or \thaiThoThahan\or
+ \thaiThoThong\or \thaiNoNu\or \thaiBoBaimai\or \thaiPoPla\or
+ \thaiPhoPhung\or \thaiFoFa\or \thaiPhoPhan\or \thaiFoFan\or
+ \thaiPhoSamphao\or \thaiMoMa\or \thaiYoYak\or \thaiRoRua\or
+ \thaiLoLing\or \thaiWoWaen\or \thaiSoSala\or \thaiSoRusi\or
+ \thaiSoSua\or \thaiHoHip\or \thaiLoChula\or \thaiOAng\or
+ \thaiHoNokhuk\else\@ctrerr\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thaiAlph}
+% Similar to |\thaialph|, the |\thaiAlph| macro provides Thai alphabetic
+% numbering with full alphabet set in the order defined in Thai official
+% dictionary. So, it supports up to 44 entries.
+%
+% \begin{macrocode}
+\def\thaiAlph#1{\expandafter\@thaiAlph\csname c@#1\endcsname}
+\def\@thaiAlph#1{%
+ \ifcase#1\or \thaiKoKai\or \thaiKhoKhai\or \thaiKhoKhuat\or \thaiKhoKhwai\or
+ \thaiKhoKhon\or \thaiKhoRakhang\or \thaiNgoNgu\or \thaiChoChan\or
+ \thaiChoChing\or \thaiChoChang\or \thaiSoSo\or \thaiChoChoe\or
+ \thaiYoYing\or \thaiDoChada\or \thaiToPatak\or \thaiThoThan\or
+ \thaiThoNangmontho\or \thaiThoPhuthao\or \thaiNoNen\or \thaiDoDek\or
+ \thaiToTao\or \thaiThoThung\or \thaiThoThahan\or \thaiThoThong\or
+ \thaiNoNu\or \thaiBoBaimai\or \thaiPoPla\or \thaiPhoPhung\or
+ \thaiFoFa\or \thaiPhoPhan\or \thaiFoFan\or \thaiPhoSamphao\or
+ \thaiMoMa\or \thaiYoYak\or \thaiRoRua\or \thaiLoLing\or
+ \thaiWoWaen\or \thaiSoSala\or \thaiSoRusi\or \thaiSoSua\or
+ \thaiHoHip\or \thaiLoChula\or \thaiOAng\or \thaiHoNokhuk\else\@ctrerr\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\Lopt{thainumber} option}
+%
+% Not all Thai documents use Thai digits. So, we support this as an
+% option. If \Lopt{thainumber} option is supplied in the |\usepackage|
+% command, Thai digits will be used in all numberings.
+%
+% \begin{macrocode}
+\DeclareOption{thainumber}{
+% \end{macrocode}
+%
+% We need to use the `|@|' character in macro implementations. So, make it
+% a normal charactor.
+%
+% \begin{macrocode}
+\catcode`\@=11
+% \end{macrocode}
+%
+% Since |\renewcommand| will fail if the renewed command does not exist,
+% and we are redefining counters independently on the document class
+% being used, we had better check for the counters' existence before
+% redefining them. To do so, we define a helper macro for this.
+%
+% \begin{macrocode}
+\def\@overridecommand#1#2{\ifdefined#1\renewcommand{#1}{#2}\fi}
+% \end{macrocode}
+%
+% Then, set default page numbering to |thainum|, and redefine counters
+% to |thainum|.
+%
+% \begin{macrocode}
+\pagenumbering{thainum}
+\@overridecommand\theenumi{\@thainum\c@enumi}
+\@overridecommand\theenumii{\@thaialph\c@enumii}
+%\@overridecommand\theenumiii{\@roman\c@enumiii}
+%\@overridecommand\theenumiv{\@Alph\c@enumiv}
+\@ifundefined{thechapter}%
+ {\@overridecommand\thesection{\@thainum\c@section}%
+ \@overridecommand\thesubsection{\thesection.\@thainum\c@subsection}%
+ \@overridecommand\thesubsubsection{\thesubsection.\@thainum\c@subsubsection}%
+ \@overridecommand\theparagraph {\thesubsubsection.\@thainum\c@paragraph}%
+ \@overridecommand\thesubparagraph {\theparagraph.\@thainum\c@subparagraph}%
+ \@overridecommand\theequation{\@thainum\c@equation}%
+ \@overridecommand\thetable{\@thainum\c@table}%
+ \@overridecommand\thefigure{\@thainum\c@figure}}%
+ {\@overridecommand\thepart{\@thainum\c@part}%
+ \@overridecommand\thechapter{\@thainum\c@chapter}%
+ \@overridecommand\thesection{\thechapter.\@thainum\c@section}%
+ \@overridecommand\thesubsection{\thesection.\@thainum\c@subsection}%
+ \@overridecommand\thesubsubsection{\thesubsection.\@thainum\c@subsubsection}%
+ \@overridecommand\theparagraph {\thesubsubsection.\@thainum\c@paragraph}%
+ \@overridecommand\thesubparagraph {\theparagraph.\@thainum\c@subparagraph}%
+ \@overridecommand\theequation%
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@thainum\c@equation}%
+ \@overridecommand \thetable%
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@thainum\c@table}%
+ \@overridecommand \thefigure%
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@thainum\c@figure}}
+\@overridecommand\thefootnote{\@thainum\c@footnote}
+% \end{macrocode}
+%
+% For theorems, we support all custom theorem counters at once by
+% redefining |\@thmcounter| macro.
+%
+% \begin{macrocode}
+\def\@thmcounter#1{\noexpand\thainum{#1}}
+% \end{macrocode}
+%
+% In book class, page numberings for frontmatter and mainmatter are
+% different. So, redefine them.
+%
+% \begin{macrocode}
+\@ifclassloaded{book}{%
+ % redefine page numbering for frontmatter and mainmatter
+ \def\ps@headnum{\let\@mkboth\@gobbletwo
+ \def\@oddhead{\reset@font\hfil\thepage\hfil}\let\@oddfoot\@empty
+ \let\@evenhead\@oddhead\let\@evenfoot\@empty}
+ \let\@ltxfrontmatter\frontmatter
+ \renewcommand\frontmatter%
+ {\@ltxfrontmatter\pagestyle{headnum}\pagenumbering{thaibracenum}}
+ \let\@ltxmainmatter\mainmatter
+ \renewcommand\mainmatter%
+ {\@ltxmainmatter\pagestyle{headings}\pagenumbering{thainum}}
+}{}
+% \end{macrocode}
+%
+% Redefine Thai date using Thai digits.
+%
+% \begin{macrocode}
+\def\datethai{%
+ \def\today{\@thainum\day\space \th@month\space %
+ \thaiPhoPhan.\thaiSoSala.~\@thainum\th@year}
+}
+% \end{macrocode}
+%
+% And finish declaration of \Lopt{thainumber} option
+%
+% \begin{macrocode}
+\relax
+}
+% \end{macrocode}
+%
+% Always use thaialph as counter for appendix
+%
+% \begin{macrocode}
+\@ifclassloaded{book}{%
+\renewcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \gdef\@chapapp{\appendixname}%
+ \gdef\thechapter{\@thaialph\c@chapter}}
+}{}
+\@ifclassloaded{report}{%
+\renewcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \gdef\@chapapp{\appendixname}%
+ \gdef\thechapter{\@thaialph\c@chapter}}
+}{}
+\@ifclassloaded{article}{%
+\renewcommand\appendix{\par
+ \setcounter{section}{0}%
+ \setcounter{subsection}{0}%
+ \gdef\thesection{\@thaialph\c@section}}
+}{}
+% \end{macrocode}
+%
+% \subsection{Miscellaneous}
+%
+% Initialize character codes for Thai
+%
+% \begin{macrocode}
+\catcode`\^^a1=11 \lccode`\^^a1=`\^^a1 \uccode`\^^a1=`\^^a1
+\catcode`\^^a2=11 \lccode`\^^a2=`\^^a2 \uccode`\^^a2=`\^^a2
+\catcode`\^^a3=11 \lccode`\^^a3=`\^^a3 \uccode`\^^a3=`\^^a3
+\catcode`\^^a4=11 \lccode`\^^a4=`\^^a4 \uccode`\^^a4=`\^^a4
+\catcode`\^^a5=11 \lccode`\^^a5=`\^^a5 \uccode`\^^a5=`\^^a5
+\catcode`\^^a6=11 \lccode`\^^a6=`\^^a6 \uccode`\^^a6=`\^^a6
+\catcode`\^^a7=11 \lccode`\^^a7=`\^^a7 \uccode`\^^a7=`\^^a7
+\catcode`\^^a8=11 \lccode`\^^a8=`\^^a8 \uccode`\^^a8=`\^^a8
+\catcode`\^^a9=11 \lccode`\^^a9=`\^^a9 \uccode`\^^a9=`\^^a9
+\catcode`\^^aa=11 \lccode`\^^aa=`\^^aa \uccode`\^^aa=`\^^aa
+\catcode`\^^ab=11 \lccode`\^^ab=`\^^ab \uccode`\^^ab=`\^^ab
+\catcode`\^^ac=11 \lccode`\^^ac=`\^^ac \uccode`\^^ac=`\^^ac
+\catcode`\^^ad=11 \lccode`\^^ad=`\^^ad \uccode`\^^ad=`\^^ad
+\catcode`\^^ae=11 \lccode`\^^ae=`\^^ae \uccode`\^^ae=`\^^ae
+\catcode`\^^af=11 \lccode`\^^af=`\^^af \uccode`\^^af=`\^^af
+\catcode`\^^b0=11 \lccode`\^^b0=`\^^b0 \uccode`\^^b0=`\^^b0
+\catcode`\^^b1=11 \lccode`\^^b1=`\^^b1 \uccode`\^^b1=`\^^b1
+\catcode`\^^b2=11 \lccode`\^^b2=`\^^b2 \uccode`\^^b2=`\^^b2
+\catcode`\^^b3=11 \lccode`\^^b3=`\^^b3 \uccode`\^^b3=`\^^b3
+\catcode`\^^b4=11 \lccode`\^^b4=`\^^b4 \uccode`\^^b4=`\^^b4
+\catcode`\^^b5=11 \lccode`\^^b5=`\^^b5 \uccode`\^^b5=`\^^b5
+\catcode`\^^b6=11 \lccode`\^^b6=`\^^b6 \uccode`\^^b6=`\^^b6
+\catcode`\^^b7=11 \lccode`\^^b7=`\^^b7 \uccode`\^^b7=`\^^b7
+\catcode`\^^b8=11 \lccode`\^^b8=`\^^b8 \uccode`\^^b8=`\^^b8
+\catcode`\^^b9=11 \lccode`\^^b9=`\^^b9 \uccode`\^^b9=`\^^b9
+\catcode`\^^ba=11 \lccode`\^^ba=`\^^ba \uccode`\^^ba=`\^^ba
+\catcode`\^^bb=11 \lccode`\^^bb=`\^^bb \uccode`\^^bb=`\^^bb
+\catcode`\^^bc=11 \lccode`\^^bc=`\^^bc \uccode`\^^bc=`\^^bc
+\catcode`\^^bd=11 \lccode`\^^bd=`\^^bd \uccode`\^^bd=`\^^bd
+\catcode`\^^be=11 \lccode`\^^be=`\^^be \uccode`\^^be=`\^^be
+\catcode`\^^bf=11 \lccode`\^^bf=`\^^bf \uccode`\^^bf=`\^^bf
+\catcode`\^^c0=11 \lccode`\^^c0=`\^^c0 \uccode`\^^c0=`\^^c0
+\catcode`\^^c1=11 \lccode`\^^c1=`\^^c1 \uccode`\^^c1=`\^^c1
+\catcode`\^^c2=11 \lccode`\^^c2=`\^^c2 \uccode`\^^c2=`\^^c2
+\catcode`\^^c3=11 \lccode`\^^c3=`\^^c3 \uccode`\^^c3=`\^^c3
+\catcode`\^^c4=11 \lccode`\^^c4=`\^^c4 \uccode`\^^c4=`\^^c4
+\catcode`\^^c5=11 \lccode`\^^c5=`\^^c5 \uccode`\^^c5=`\^^c5
+\catcode`\^^c6=11 \lccode`\^^c6=`\^^c6 \uccode`\^^c6=`\^^c6
+\catcode`\^^c7=11 \lccode`\^^c7=`\^^c7 \uccode`\^^c7=`\^^c7
+\catcode`\^^c8=11 \lccode`\^^c8=`\^^c8 \uccode`\^^c8=`\^^c8
+\catcode`\^^c9=11 \lccode`\^^c9=`\^^c9 \uccode`\^^c9=`\^^c9
+\catcode`\^^ca=11 \lccode`\^^ca=`\^^ca \uccode`\^^ca=`\^^ca
+\catcode`\^^cb=11 \lccode`\^^cb=`\^^cb \uccode`\^^cb=`\^^cb
+\catcode`\^^cc=11 \lccode`\^^cc=`\^^cc \uccode`\^^cc=`\^^cc
+\catcode`\^^cd=11 \lccode`\^^cd=`\^^cd \uccode`\^^cd=`\^^cd
+\catcode`\^^ce=11 \lccode`\^^ce=`\^^ce \uccode`\^^ce=`\^^ce
+\catcode`\^^cf=11 \lccode`\^^cf=`\^^cf \uccode`\^^cf=`\^^cf
+\catcode`\^^d0=11 \lccode`\^^d0=`\^^d0 \uccode`\^^d0=`\^^d0
+\catcode`\^^d1=11 \lccode`\^^d1=`\^^d1 \uccode`\^^d1=`\^^d1
+\catcode`\^^d2=11 \lccode`\^^d2=`\^^d2 \uccode`\^^d2=`\^^d2
+\catcode`\^^d3=11 \lccode`\^^d3=`\^^d3 \uccode`\^^d3=`\^^d3
+\catcode`\^^d4=11 \lccode`\^^d4=`\^^d4 \uccode`\^^d4=`\^^d4
+\catcode`\^^d5=11 \lccode`\^^d5=`\^^d5 \uccode`\^^d5=`\^^d5
+\catcode`\^^d6=11 \lccode`\^^d6=`\^^d6 \uccode`\^^d6=`\^^d6
+\catcode`\^^d7=11 \lccode`\^^d7=`\^^d7 \uccode`\^^d7=`\^^d7
+\catcode`\^^d8=11 \lccode`\^^d8=`\^^d8 \uccode`\^^d8=`\^^d8
+\catcode`\^^d9=11 \lccode`\^^d9=`\^^d9 \uccode`\^^d9=`\^^d9
+\catcode`\^^da=11 \lccode`\^^da=`\^^da \uccode`\^^da=`\^^da
+\catcode`\^^df=12 \lccode`\^^df=`\^^df \uccode`\^^df=`\^^df
+\catcode`\^^e0=11 \lccode`\^^e0=`\^^e0 \uccode`\^^e0=`\^^e0
+\catcode`\^^e1=11 \lccode`\^^e1=`\^^e1 \uccode`\^^e1=`\^^e1
+\catcode`\^^e2=11 \lccode`\^^e2=`\^^e2 \uccode`\^^e2=`\^^e2
+\catcode`\^^e3=11 \lccode`\^^e3=`\^^e3 \uccode`\^^e3=`\^^e3
+\catcode`\^^e4=11 \lccode`\^^e4=`\^^e4 \uccode`\^^e4=`\^^e4
+\catcode`\^^e5=11 \lccode`\^^e5=`\^^e5 \uccode`\^^e5=`\^^e5
+\catcode`\^^e6=11 \lccode`\^^e6=`\^^e6 \uccode`\^^e6=`\^^e6
+\catcode`\^^e7=11 \lccode`\^^e7=`\^^e7 \uccode`\^^e7=`\^^e7
+\catcode`\^^e8=11 \lccode`\^^e8=`\^^e8 \uccode`\^^e8=`\^^e8
+\catcode`\^^e9=11 \lccode`\^^e9=`\^^e9 \uccode`\^^e9=`\^^e9
+\catcode`\^^ea=11 \lccode`\^^ea=`\^^ea \uccode`\^^ea=`\^^ea
+\catcode`\^^eb=11 \lccode`\^^eb=`\^^eb \uccode`\^^eb=`\^^eb
+\catcode`\^^ec=11 \lccode`\^^ec=`\^^ec \uccode`\^^ec=`\^^ec
+\catcode`\^^ed=11 \lccode`\^^ed=`\^^ed \uccode`\^^ed=`\^^ed
+\catcode`\^^ee=11 \lccode`\^^ee=`\^^ee \uccode`\^^ee=`\^^ee
+\catcode`\^^ef=12 \lccode`\^^ef=`\^^ef \uccode`\^^ef=`\^^ef
+\catcode`\^^f0=12 \lccode`\^^f0=`\^^f0 \uccode`\^^f0=`\^^f0
+\catcode`\^^f1=12 \lccode`\^^f1=`\^^f1 \uccode`\^^f1=`\^^f1
+\catcode`\^^f2=12 \lccode`\^^f2=`\^^f2 \uccode`\^^f2=`\^^f2
+\catcode`\^^f3=12 \lccode`\^^f3=`\^^f3 \uccode`\^^f3=`\^^f3
+\catcode`\^^f4=12 \lccode`\^^f4=`\^^f4 \uccode`\^^f4=`\^^f4
+\catcode`\^^f5=12 \lccode`\^^f5=`\^^f5 \uccode`\^^f5=`\^^f5
+\catcode`\^^f6=12 \lccode`\^^f6=`\^^f6 \uccode`\^^f6=`\^^f6
+\catcode`\^^f7=12 \lccode`\^^f7=`\^^f7 \uccode`\^^f7=`\^^f7
+\catcode`\^^f8=12 \lccode`\^^f8=`\^^f8 \uccode`\^^f8=`\^^f8
+\catcode`\^^f9=12 \lccode`\^^f9=`\^^f9 \uccode`\^^f9=`\^^f9
+\catcode`\^^fa=12 \lccode`\^^fa=`\^^fa \uccode`\^^fa=`\^^fa
+\catcode`\^^fb=12 \lccode`\^^fb=`\^^fb \uccode`\^^fb=`\^^fb
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/thai/thai.ins b/macros/latex/contrib/babel-contrib/thai/thai.ins
new file mode 100644
index 0000000000..a7dc43dde5
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/thai/thai.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{thai.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{thai.ldf}{\from{thai.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/thai/thai.pdf b/macros/latex/contrib/babel-contrib/thai/thai.pdf
new file mode 100644
index 0000000000..4401e38a20
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/thai/thai.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/thai/tis620.def b/macros/latex/contrib/babel-contrib/thai/tis620.def
new file mode 100644
index 0000000000..589dea77e8
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/thai/tis620.def
@@ -0,0 +1,108 @@
+\ProvidesFile{tis620.def}
+ [2011/03/16 v1.0 Thai TIS-620 input encoding file]
+% tis620 input encoding file by Theppitak Karoonboonyanan
+%
+% Copyright 2011 Theppitak Karoonboonyanan. All rights reserved.
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.3 of this license or
+% (at your option) any later version.
+%
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Theppitak Karoonboonyanan.
+%
+
+\DeclareInputText{161}{\thaiKoKai}
+\DeclareInputText{162}{\thaiKhoKhai}
+\DeclareInputText{163}{\thaiKhoKhuat}
+\DeclareInputText{164}{\thaiKhoKhwai}
+\DeclareInputText{165}{\thaiKhoKhon}
+\DeclareInputText{166}{\thaiKhoRakhang}
+\DeclareInputText{167}{\thaiNgoNgu}
+\DeclareInputText{168}{\thaiChoChan}
+\DeclareInputText{169}{\thaiChoChing}
+\DeclareInputText{170}{\thaiChoChang}
+\DeclareInputText{171}{\thaiSoSo}
+\DeclareInputText{172}{\thaiChoChoe}
+\DeclareInputText{173}{\thaiYoYing}
+\DeclareInputText{174}{\thaiDoChada}
+\DeclareInputText{175}{\thaiToPatak}
+\DeclareInputText{176}{\thaiThoThan}
+\DeclareInputText{177}{\thaiThoNangmontho}
+\DeclareInputText{178}{\thaiThoPhuthao}
+\DeclareInputText{179}{\thaiNoNen}
+\DeclareInputText{180}{\thaiDoDek}
+\DeclareInputText{181}{\thaiToTao}
+\DeclareInputText{182}{\thaiThoThung}
+\DeclareInputText{183}{\thaiThoThahan}
+\DeclareInputText{184}{\thaiThoThong}
+\DeclareInputText{185}{\thaiNoNu}
+\DeclareInputText{186}{\thaiBoBaimai}
+\DeclareInputText{187}{\thaiPoPla}
+\DeclareInputText{188}{\thaiPhoPhung}
+\DeclareInputText{189}{\thaiFoFa}
+\DeclareInputText{190}{\thaiPhoPhan}
+\DeclareInputText{191}{\thaiFoFan}
+\DeclareInputText{192}{\thaiPhoSamphao}
+\DeclareInputText{193}{\thaiMoMa}
+\DeclareInputText{194}{\thaiYoYak}
+\DeclareInputText{195}{\thaiRoRua}
+\DeclareInputText{196}{\thaiRu}
+\DeclareInputText{197}{\thaiLoLing}
+\DeclareInputText{198}{\thaiLu}
+\DeclareInputText{199}{\thaiWoWaen}
+\DeclareInputText{200}{\thaiSoSala}
+\DeclareInputText{201}{\thaiSoRusi}
+\DeclareInputText{202}{\thaiSoSua}
+\DeclareInputText{203}{\thaiHoHip}
+\DeclareInputText{204}{\thaiLoChula}
+\DeclareInputText{205}{\thaiOAng}
+\DeclareInputText{206}{\thaiHoNokhuk}
+\DeclareInputText{207}{\thaiPaiyannoi}
+\DeclareInputText{208}{\thaiSaraA}
+\DeclareInputText{209}{\thaiMaiHanakat}
+\DeclareInputText{210}{\thaiSaraAa}
+\DeclareInputText{211}{\thaiSaraAm}
+\DeclareInputText{212}{\thaiSaraI}
+\DeclareInputText{213}{\thaiSaraIi}
+\DeclareInputText{214}{\thaiSaraUe}
+\DeclareInputText{215}{\thaiSaraUee}
+\DeclareInputText{216}{\thaiSaraU}
+\DeclareInputText{217}{\thaiSaraUu}
+\DeclareInputText{218}{\thaiPhinthu}
+\DeclareInputText{223}{\textbaht}
+\DeclareInputText{224}{\thaiSaraE}
+\DeclareInputText{225}{\thaiSaraAe}
+\DeclareInputText{226}{\thaiSaraO}
+\DeclareInputText{227}{\thaiSaraAiMaimuan}
+\DeclareInputText{228}{\thaiSaraAiMaimalai}
+\DeclareInputText{229}{\thaiLakkhangyao}
+\DeclareInputText{230}{\thaiMaiyamok}
+\DeclareInputText{231}{\thaiMaitaikhu}
+\DeclareInputText{232}{\thaiMaiEk}
+\DeclareInputText{233}{\thaiMaiTho}
+\DeclareInputText{234}{\thaiMaiTri}
+\DeclareInputText{235}{\thaiMaiChattawa}
+\DeclareInputText{236}{\thaiThanthakhat}
+\DeclareInputText{237}{\thaiNikhahit}
+\DeclareInputText{238}{\thaiYamakkan}
+\DeclareInputText{239}{\thaiFongman}
+\DeclareInputText{240}{\thaizero}
+\DeclareInputText{241}{\thaione}
+\DeclareInputText{242}{\thaitwo}
+\DeclareInputText{243}{\thaithree}
+\DeclareInputText{244}{\thaifour}
+\DeclareInputText{245}{\thaifive}
+\DeclareInputText{246}{\thaisix}
+\DeclareInputText{247}{\thaiseven}
+\DeclareInputText{248}{\thaieight}
+\DeclareInputText{249}{\thainine}
+\DeclareInputText{250}{\thaiAngkhankhu}
+\DeclareInputText{251}{\thaiKhomut}
+
diff --git a/macros/latex/contrib/babel-contrib/turkish/README.md b/macros/latex/contrib/babel-contrib/turkish/README.md
new file mode 100644
index 0000000000..ca7c9f9c40
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/turkish/README.md
@@ -0,0 +1,23 @@
+Turkish 1.4
+-----------
+
+This is the babel style for Turkish.
+
+**This package is NOT being actively maintained, but bugs might
+got fixed if you report them. If you want to take over maintenance of
+this language style, please contact me at
+http://www.texnia.com/contact.html .**
+
+Changes 1.4
+-----------
+* Added TU encoding
+
+
+Changes 1.3
+-----------
+* UTF-8 encoded strings for XeTeX and LuaTeX
+* Upper/Lowercase and hyphenation mappings for T1 and EUx (and
+ incomplete for OT1).
+* Translation for Glossary.
+* The manual describes how to deal with the ligature fi and
+ how to disable the = shorthand.
diff --git a/macros/latex/contrib/babel-contrib/turkish/turkish.dtx b/macros/latex/contrib/babel-contrib/turkish/turkish.dtx
new file mode 100644
index 0000000000..09ebca1309
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/turkish/turkish.dtx
@@ -0,0 +1,446 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2019 Johannes L. Braams and any individual authors
+% listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos.
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{347}
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{turkish.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{turkish}
+%\fi
+%\ProvidesFile{turkish.dtx}
+ [2019/07/05 v1.4 Turkish support from the babel system]
+%\iffalse
+%% File `turkish.dtx'
+%
+%% Turkish Language Definition File
+%% Copyright (C) 1994 - 2005
+%% by Mustafa Burc
+%% rz6001@rziris01.rrz.uni-hamburg.de
+%% (40) 2503476
+%
+% This file is part of the babel system, it provides the source
+% code for the Turkish language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\title{The Turkish style for babel}
+\author{Mustafa Burc, Johannes Braams, Javier Bezos}
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \maketitle
+ \DocInput{turkish.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{turkish.dtx}
+%
+% \changes{turkish-1.2}{1994/02/27}{Update for \LaTeXe}
+% \changes{turkish-1.2c}{1994/06/26}{Removed the use of \cs{filedate}
+% and moved identification after the loading of \file{babel.def}}
+% \changes{turkish-1.2h}{1996/07/13}{Replaced \cs{undefined} with
+% \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
+% with \LaTeX}
+% \changes{turkish-1.2i}{1996/10/10}{Moved the definition of
+% \cs{atcatcode} right to the beginning.}
+%
+% \section{The Turkish language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Turkish language\footnote{Mustafa Burc,
+% \texttt{z6001@rziris01.rrz.uni-hamburg.de} provided the code for
+% this file. It is based on the work by Pierre Mackay; Turgut Uyar,
+% \texttt{uyar@cs.itu.edu.tr} supplied additional translations in
+% version 1.2j and later. Version 1.3 was prepared by Javier Bezos.}.
+%
+% Turkish typographic rules specify that a little `white space'
+% should be added before the characters `\texttt{:}', `\texttt{!}'
+% and `\texttt{=}'. In order to insert this white space
+% automatically these characters are made `active'. Also
+% |\frenhspacing| is set.
+%
+% Typical usage with pdf\TeX{} is:
+%\begin{verbatim}
+%\usepackage[T1]{fontenc}
+%\usepackage[utf8]{inputenc} % also latin5
+%\usepackage[turkish]{babel}
+%\end{verbatim}
+%
+% The |=| shorthand is potentially dangerous. You can deactivate
+% with the \textsf{babel} option |shorthands| or with |\shorthandoff|:
+%
+%\begin{verbatim}
+%\usepackage[turkish,shorthands=:!]{babel}
+%\end{verbatim}
+%
+%
+% This style doesn't handle the fi ligature (yet). You can break it by
+% hand with |f{}i| or |f{\kern0pt}i|, but this can be
+% done automatically, too. With pdf\TeX{} and monolingual documents,
+% use \textsf{microtype}, as for example:
+%\begin{verbatim}
+%\usepackage{microtype}
+%\DisableLigatures[f]{encoding = *, family = *}
+%\end{verbatim}
+%
+% With Xe\TeX, ligatures are handled internally by the font, provided the
+% corresponding feature has been implemented (not all fonts do); e.~g.:
+%\begin{verbatim}
+%\usepackage{fontspec}
+%\setmainfont[Language=Turkish]{Iwona}
+%\end{verbatim}
+%
+% With Lua\TeX{} you can use either method (remember with
+% \textsf{microtype} you have also to set |Renderer=Basic|, at
+% least at the time of this writing). Alternative approachs with
+% Lua\TeX{} are the \textsf{setnolig} package or a |fea| file (not
+% provided here).
+%
+% \StopEventually{}
+%
+% \subsection*{The code}
+%
+% The macro |\LdfInit| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \changes{turkish-1.2i}{1996/11/03}{ow use \cs{LdfInit} to perform
+% initial checks}
+% \begin{macrocode}
+%<*code>
+\LdfInit{turkish}\captionsturkish
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{turkish} could be an `unknown' language in which
+% case we have to make it known. So we check for the existence of
+% |\l@turkish| to see whether we have to do something here.
+%
+% \changes{turkish-1.2c}{1994/06/26}{Now use \cs{@nopatterns} to
+% produce the warning}
+% \begin{macrocode}
+\ifx\l@turkish\@undefined
+ \@nopatterns{Turkish}
+ \adddialect\l@turkish0\fi
+% \end{macrocode}
+%
+% The next step consists of defining commands to switch to (and
+% from) the Turkish language.
+%
+% \begin{macro}{\captionsturkish}
+% The macro |\captionsturkish| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+% \changes{turkish-1.1}{1993/07/15}{\cs{headpagename} should be
+% \cs{pagename}}
+% \changes{turkish-1.2b}{1994/06/04}{Added braces behind \cs{i} in
+% strings}
+% \changes{turkish-1.2f}{1995/07/04}{Added \cs{proofname} for
+% AMS-\LaTeX}
+% \changes{turkish-1.2j}{1997/09/29}{Added and modified translations}
+% \changes{turkish-1.2k}{1999/04/18}{Incorporated some more
+% corrections}
+% \changes{turkish-1.2m}{2000/09/20}{Added \cs{glossaryname}}
+% \begin{macrocode}
+\addto\captionsturkish{%
+ \def\prefacename{\"Ons\"oz}%
+ \def\refname{Kaynaklar}%
+ \def\abstractname{\"Ozet}%
+ \def\bibname{Kaynak\c ca}%
+ \def\chaptername{B\"ol\"um}%
+ \def\appendixname{Ek}%
+ \def\contentsname{\.I\c cindekiler}%
+ \def\listfigurename{\c Sekil Listesi}%
+ \def\listtablename{Tablo Listesi}%
+ \def\indexname{Dizin}%
+ \def\figurename{\c Sekil}%
+ \def\tablename{Tablo}%
+ \def\partname{K\i s\i m}%
+ \def\enclname{\.Ili\c sik}%
+ \def\ccname{Di\u ger Al\i c\i lar}%
+ \def\headtoname{Al\i c\i}%
+ \def\pagename{Sayfa}%
+ \def\subjectname{\.Ilgili}%
+ \def\seename{bkz.}%
+ \def\alsoname{ayr\i ca bkz.}%
+ \def\proofname{Kan\i t}%
+ \def\glossaryname{L\"ugat\c ce}% <-- Tentative
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dateturkish}
+% The macro |\dateturkish| redefines the command |\today| to
+% produce Turkish dates.
+% \changes{turkish-1.2b}{1994/06/04}{Added braces behind \cs{i} in
+% strings}
+% \changes{turkish-1.2d}{1995/01/31}{removed extra closing brace,
+% \cs{mont} should be \cs{month}}
+% \changes{turkish-1.2j}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{turkish-1.2j}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{turkish-1.2l}{1999/05/17}{removed dot from the date format}
+% \begin{macrocode}
+\def\dateturkish{%
+ \def\today{\number\day~\ifcase\month\or
+ Ocak\or \c Subat\or Mart\or Nisan\or May\i s\or Haziran\or
+ Temmuz\or A\u gustos\or Eyl\"ul\or Ekim\or Kas\i m\or
+ Aral\i k\fi
+ \space\number\year}}
+% \end{macrocode}
+%
+% The following code is taken into account only with babel 3.9g and
+% later. Defines case and hyphen mapping, as well as UTF-8
+% strings. First the Unicode branch.
+% \changes{turkish-1.3a}{2014/01/02}{Code for babel 3.9: case and
+% hyphen mapping, utf8 strings}
+% \changes{turkish-1.3a}{2014/01/03}{Use space instead of braces after
+% \cs{i}}
+% \changes{turkish-1.3b}{2014/03/22}{Now only tests \cs{BabelLower}. babel
+% >=3.9i required}
+% \begin{macrocode}
+\ifx\BabelLower\@undefined\else
+\StartBabelCommands*{turkish}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \SetString\prefacename{Önsöz}
+ \SetString\refname{Kaynaklar}
+ \SetString\abstractname{Özet}
+ \SetString\bibname{Kaynakça}
+ \SetString\chaptername{Bölüm}
+ \SetString\appendixname{Ek}
+ \SetString\contentsname{İçindekiler}
+ \SetString\listfigurename{Şekil Listesi}
+ \SetString\listtablename{Tablo Listesi}
+ \SetString\indexname{Dizin}
+ \SetString\figurename{Şekil}
+ \SetString\tablename{Tablo}
+ \SetString\partname{Kısım}
+ \SetString\enclname{İlişik}
+ \SetString\ccname{Diğer Alıcılar}
+ \SetString\headtoname{Alıcı}
+ \SetString\pagename{Sayfa}
+ \SetString\subjectname{İlgili}
+ \SetString\seename{bkz.}
+ \SetString\alsoname{ayrıca bkz.}
+ \SetString\proofname{Kanıt}
+ \SetString\glossaryname{Lügatçe}% <-- Tentative
+ \SetCase
+ {\uccode`i=`İ\relax
+ \uccode`ı=`I\relax}
+ {\lccode`İ=`i\relax
+ \lccode`I=`ı\relax}
+ \SetHyphenMap{%
+ \BabelLower{`İ}{`i}%
+ \BabelLower{`I}{`ı}}
+\StartBabelCommands*{turkish}{date}
+ [unicode, charset=utf8, fontenc=EU1 EU2 TU]
+ \SetStringLoop{month#1name}{%
+ Ocak,Şubat,Mart,Nisan,Mayıs,Haziran,%
+ Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık}
+% \end{macrocode}
+% Now the OT1 branch, only partially, because this encoding is not
+% suited for Turkish (no dotted I).
+% \begin{macrocode}
+\StartBabelCommands{turkish}{}[ot1enc, fontenc=OT1]
+ \SetCase
+ {\uccode"10=`I\relax}
+ {\lccode`I="10\relax}
+% \end{macrocode}
+% And finally, the generic branch, using the LICR and assuming T1.
+% \begin{macrocode}
+\StartBabelCommands*{turkish}{captions}
+ \SetString\prefacename{\"Ons\"oz}
+ \SetString\refname{Kaynaklar}
+ \SetString\abstractname{\"Ozet}
+ \SetString\bibname{Kaynak\c ca}
+ \SetString\chaptername{B\"ol\"um}
+ \SetString\appendixname{Ek}
+ \SetString\contentsname{\.I\c cindekiler}
+ \SetString\listfigurename{\c Sekil Listesi}
+ \SetString\listtablename{Tablo Listesi}
+ \SetString\indexname{Dizin}
+ \SetString\figurename{\c Sekil}
+ \SetString\tablename{Tablo}
+ \SetString\partname{K\i s\i m}
+ \SetString\enclname{\.Ili\c sik}
+ \SetString\ccname{Di\u ger Al\i c\i lar}
+ \SetString\headtoname{Al\i c\i}
+ \SetString\pagename{Sayfa}
+ \SetString\subjectname{\.Ilgili}
+ \SetString\seename{bkz.}
+ \SetString\alsoname{ayr\i ca bkz.}
+ \SetString\proofname{Kan\i t}
+ \SetString\glossaryname{L\"ugat\c ce}% <-- Tentative
+ \SetCase
+ {\uccode`i="9D\relax
+ \uccode"19=`I\relax}
+ {\lccode"9D=`i\relax
+ \lccode`I="19\relax}
+ \SetHyphenMap{%
+ \BabelLower{"9D}{`i}%
+ \BabelLower{`I}{"19}}
+\StartBabelCommands*{turkish}{date}
+ \SetStringLoop{month#1name}{%
+ Ocak,\c Subat,Mart,Nisan,May\i s,Haziran,%
+ Temmuz,A\u gustos,Eyl\"ul,Ekim,Kas\i m,Aral\i k}
+ \SetString\today{%
+ \number\day~\@nameuse{month\romannumeral\month name}%
+ \space\number\year}
+\EndBabelCommands
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasturkish}
+% \changes{turkish-1.2e}{1995/05/15}{Completely rewrote macro}
+% \begin{macro}{\noextrasturkish}
+% The macro |\extrasturkish| will perform all the extra definitions
+% needed for the Turkish language. The macro |\noextrasturkish| is
+% used to cancel the actions of |\extrasturkish|.
+%
+% Turkish typographic rules specify that a little `white space'
+% should be added before the characters `\texttt{:}', `\texttt{!}'
+% and `\texttt{=}'. In order to insert this white space
+% automatically these characters are made |\active|, so they have
+% to be treated in a special way.
+% \begin{macrocode}
+\initiate@active@char{:}
+\initiate@active@char{!}
+% \end{macrocode}
+% We specify that the turkish group of shorthands should be used.
+% These characters are `turned on' once, later their definition may
+% vary.
+% \begin{macrocode}
+\addto\extrasturkish{%
+ \languageshorthands{turkish}%
+ \bbl@activate{:}%
+ \bbl@activate{!}%
+ \bbl@activate{=}%
+ \bbl@frenchspacing}
+% \end{macrocode}
+%
+% For Turkish texts |\frenchspacing| should be in effect. We
+% make sure this is the case and reset it if necessary.
+% \changes{turkish-1.2e}{1995/05/15}{now use \cs{bbl@frenchspacing}
+% and \cs{bbl@nonfrenchspacing}}
+% \begin{macrocode}
+\addto\noextrasturkish{\bbl@nonfrenchspacing}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\turkish@sh@!@}
+% \begin{macro}{\turkish@sh@=@}
+% \begin{macro}{\turkish@sh@:@}
+% The definitions for the three active characters were made using
+% intermediate macros. These are defined now. The insertion of
+% extra `white space' should only happen outside math mode, hence
+% the check |\ifmmode| in the macros.
+% \changes{turkish-1.2d}{1995/01/31}{Added missing \cs{def}}
+% \changes{turkish-1.2e}{1995/05/15}{Use the new mechanism of
+% \cs{declare@shorthand}}
+% \begin{macrocode}
+\declare@shorthand{turkish}{:}{%
+ \ifmmode
+ \string:%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string:%
+ \fi}
+\declare@shorthand{turkish}{!}{%
+ \ifmmode
+ \string!%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\penalty\@M\thinspace
+ \fi
+ \fi
+ \string!%
+ \fi}
+\initiate@active@char{=}
+\declare@shorthand{turkish}{=}{%
+ \ifmmode
+ \string=%
+ \else\relax
+ \ifhmode
+ \ifdim\lastskip>\z@
+ \unskip\kern\fontdimen2\font
+ \kern-1.4\fontdimen3\font
+ \fi
+ \fi
+ \string=%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \changes{turkish-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
+% up}
+% \begin{macrocode}
+\ldf@finish{turkish}
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/turkish/turkish.ins b/macros/latex/contrib/babel-contrib/turkish/turkish.ins
new file mode 100644
index 0000000000..03b68c7b44
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/turkish/turkish.ins
@@ -0,0 +1,150 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Javier Bezos.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{turkish.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Javier Bezos.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{turkish.ldf}{\from{turkish.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/turkish/turkish.pdf b/macros/latex/contrib/babel-contrib/turkish/turkish.pdf
new file mode 100644
index 0000000000..4dff0e72d9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/turkish/turkish.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/ukraineb b/macros/latex/contrib/babel-contrib/ukraineb
new file mode 120000
index 0000000000..9cce833833
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/ukraineb
@@ -0,0 +1 @@
+ukrainian \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/ukrainian/README.md b/macros/latex/contrib/babel-contrib/ukrainian/README.md
new file mode 100644
index 0000000000..76f0121584
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/ukrainian/README.md
@@ -0,0 +1,205 @@
+----------------------------------------------------------------
+
+Ukrainian language module for Babel, v1.4c
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Ukrainian. The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+Based on Russian language module v1.3i by Igor A. Kotelnikov <kia999 at mail dot ru>.
+
+The current maintainer is Sergiy Ponomarenko <sergiy.ponomarenko@gmail.com>.
+
+1. INSTALLATION
+
+- unpack babel-ukrainian.zip
+- run "xelatex.exe ukraineb.dtx" (recommended)
+ or "pdflatex.exe ukraineb.dtx";
+ run "tex.exe ukraineb.dtx"
+ or "tex.exe ukraineb.ins", if you don't need documentation
+- move "ukraineb.ldf" to <textmf>/tex/generic/babel/babel-ukrainian/
+- move "ukraineb.pdf" and README to <textmf>/doc/generic/babel-ukrainian/
+- update filename base (see documentation for your TeX system)
+
+2. USAGE
+
+Ukrainian language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe). The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+2.1. 8-bit mode
+
+2.1.1 PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.1.2 LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.1.3 XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.2 Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,ukrainian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may try any True Type or Open Type font installed on your computer provided
+that that font came with Ukrainian letters.
+
+3. DOCUMENTATION
+
+See ukraineb.pdf for more information.
+
+4. KNOWN PROBLEMS
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+5. CHANGES
+
+2018-04-11 version 1.4с
+ * Fixed unprotected endlines.
+
+2017-08-10 version 1.4b
+
+ * Default for \cyrdash is provided.
+ * TU encoding is set as default for XeTeX and LuaTeX; EU1 and EU2 encodings
+ are kept for backward compatibility.
+
+2017-06-13 version 1.4a
+
+ * Removing \week<roman number>day macro, since it is should be define in datetime2 class
+ * Removing revtex4(4-1) classes ukrainization because it unused in ukainian text typesetting
+ * Adding \acronymname, \lstlistingname and \lstlistlistingname macros to nonunicode captions
+
+2017-06-10 version 1.4
+
+ * For compatibility with older Ukrainian packages we leave definition of the \No macro
+ * Fix Ukrainian translation of babel unicode string \chaptername
+ * Macros \Asbuk and \asbuk are removed
+ * Cyrillic alphabetical enumeration is provided by \Alph and \alph macros when Ukrainian loaded
+ * Used babel's 3.9 (and later) macros for defining caption names and date for Unicode case
+
+2017-06-08 version 1.3i
+
+ * Corrections according to alphabetical enumeration Ukrainian standart ДСТУ 3008:2015
+ * Some math macro from original russian.ldf was removed because of seldom usage
+
+2017-06-06 version 1.3h
+
+ * Initial version
+
+Original source: russianb.dtx,
+ 2017-01-12 v1.3i Russian support from the babel system.
+
+----------------------------------------------------------------
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
diff --git a/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.dtx b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.dtx
new file mode 100644
index 0000000000..126924480c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.dtx
@@ -0,0 +1,1674 @@
+% \iffalse meta-comment
+% !TEX program = LuaLaTeX
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+----------------------------------------------------------------
+
+Ukrainian language module for Babel, v1.4c
+
+Released under the LaTeX Project Public License v1.3c or later.
+See http://www.latex-project.org/lppl.txt
+
+The package provides support for use of Babel in documents written in Ukrainian. The support is adapted for use both
+under legacy TEX engines, and under X∃TEX and LuaTEX.
+
+Based on Russian language module v1.3i by Igor A. Kotelnikov <kia999 at mail dot ru>.
+
+The current maintainer is Sergiy Ponomarenko <sergiy.ponomarenko@gmail.com>.
+
+
+1. INSTALLATION
+
+- unpack babel-ukrainian.zip
+- run "xelatex.exe ukraineb.dtx" (recommended)
+ or "pdflatex.exe ukraineb.dtx";
+ run "tex.exe ukraineb.dtx"
+ or "tex.exe ukraineb.ins", if you don't need documentation
+- move "ukraineb.ldf" to <textmf>/tex/generic/babel/babel-ukrainian/
+- move "ukraineb.pdf" and README to <textmf>/doc/generic/babel-ukrainian/
+- update filename base (see documentation for your TeX system)
+
+
+2. USAGE
+
+Ukrainian language definition file can be used both with legacy 8-bit engines
+(such as latex.exe or pdflatex.exe) and Unicode compilers (xelatex.exe or
+lualatex.exe). The Unicode engines can be ran either in Unicode mode or 8-bit
+compatibility mode, which emulates the legacy engines. The two modes differ by
+a set of packages loaded in the preamble of a source TeX file. It is important
+to keep recommended order of the packages loaded, especially when running
+Unicode engines in a compatibility 8-bit mode.
+
+In the examples below, it is assumed that a source file has utf8 input encoding.
+
+2.1. 8-bit mode
+
+2.1.1 PDFLATeX, LaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.1.2 LuaLaTeX
+
+ \usepackage[T1,T2A]{fontenc}
+ \usepackage[lutf8]{luainputenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.1.3 XeLaTeX
+
+ \XeTeXinputencoding "bytes"
+ \usepackage[utf8]{inputenc}
+ \usepackage[T2A]{fontenc}
+ \usepackage[english,ukrainian]{babel}
+
+2.2 Unicode mode, LuaLaTeX or XeLaTeX
+
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ \usepackage[english,ukrainian]{babel}
+
+Instead of the Computer Modern Unicode (CMU) fonts loaded in this example,
+you may try any True Type or Open Type font installed on your computer provided
+that that font came with Ukrainian letters.
+
+3. DOCUMENTATION
+
+See ukraineb.pdf for more information.
+
+
+4. KNOWN PROBLEMS
+
+Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+engine (xetex, luatex) and vise versa delete all .aux, .toc, .lot, .lof
+files as they might have stored incompatible internal encodings.
+
+5. CHANGES
+
+2018-04-11 version 1.4с
+ * Fixed unprotected endlines.
+
+2017-08-10 version 1.4b
+
+ * Default for \cyrdash is provided.
+ * TU encoding is set as default for XeTeX and LuaTeX; EU1 and EU2 encodings
+ are kept for backward compatibility.
+
+2017-06-13 version 1.4a
+
+ * Removing \week<roman number>day macro, since it is should be define in datetime2 class
+ * Removing revtex4(4-1) classes ukrainization because it unused in ukainian text typesetting
+ * Adding \acronymname, \lstlistingname and \lstlistlistingname macros to nonunicode captions
+
+2017-06-10 version 1.4
+
+ * For compatibility with older Ukrainian packages we leave definition of the \No macro
+ * Fix Ukrainian translation of babel unicode string \chaptername
+ * Macros \Asbuk and \asbuk are removed
+ * Cyrillic alphabetical enumeration is provided by \Alph and \alph macros when Ukrainian loaded
+ * Used babel's 3.9 (and later) macros for defining caption names and date for Unicode case
+
+2017-06-08 version 1.3i
+
+ * Corrections according to alphabetical enumeration Ukrainian standart ДСТУ 3008:2015
+ * Some math macro from original russian.ldf was removed because of seldom usage
+
+2017-06-06 version 1.3h
+
+ * Initial version
+
+Original source: russianb.dtx,
+ 2017-01-12 v1.3i Russian support from the babel system.
+
+----------------------------------------------------------------
+%</readme>
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+Ukrainian Language Support for the Babel package
+E-mail: sergiy.ponomarenko@gmailcom
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+\endpreamble
+\postamble
+----------------------------------------------------------------
+Copyright 2017 Sergiy М. Ponomarenko
+Copyright 2011-2017 Igor A. Kotelnikov.
+Copyright 2000 Aleksey Novodvorsky
+Copyright 1995-2008 Olga Lapko.
+Copyright 1989-2012 Johannes L. Braams.
+
+This file is a part of the Ukrainian-Babel package.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+The package is "maintained" (as per LPPL maintenance status) by
+Sergiy М. Ponomarenko.
+
+The package consists of the file ukraineb.dtx
+and the derived files ukraineb.ins,
+ ukraineb.ldf,
+ ukraineb.pdf,
+ README.
+----------------------------------------------------------------
+\endpostamble
+\usedir{tex/generic/babel/contrib}
+\generate{
+ \file{\jobname.ldf}{\from{\jobname.dtx}{code}}
+}
+%</install>
+%<install>\endbatchfile
+%<*internal>
+\usedir{source/latex/babel-ukrainian}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+\usedir{doc/latex/babel-ukrainian}
+\generate{
+ \file{README.}{\from{\jobname.dtx}{readme}}
+}
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+%<*code>
+\NeedsTeXFormat{LaTeX2e}
+%\ProvidesLanguage{\jobname}[2018/04/11 1.4c Ukrainian support for the Babel system]
+\ProvidesLanguage{ukraineb}[2018/04/11 1.4c Ukrainian support for the Babel system]
+%</code>
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+%%
+%% This document should be compiled by
+%% XeLaTeX or LuaLaTex since some cyrillic
+%% glyphs are absent in T2* encodings used
+%% by LaTeX.
+%%
+\usepackage[%
+ a4paper,%
+ footskip=1cm,%
+ headsep=0.3cm,%
+ top=2cm, %поле сверху
+ bottom=2cm, %поле снизу
+ left=4cm, %поле ліворуч
+ right=2cm, %поле праворуч
+ ]{geometry}
+\usepackage{ifxetex,ifluatex}
+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0
+ \usepackage{fontspec}
+ \defaultfontfeatures{Ligatures={TeX}}
+ \setmainfont{CMU Serif}
+ \setsansfont{CMU Sans Serif}
+ \setmonofont{CMU Typewriter Text}
+ %\setmonofont[Scale=MatchLowercase]{Courier New}
+ %\setmonofont[Scale=MatchUppercase]{Courier New}
+ %\setmonofont{Courier New}
+\else
+ \usepackage[X2,T2A]{fontenc}
+ \usepackage[utf8]{inputenc}
+ %% ukrainian letter, looks as a ligature IE, not defined anywhare
+ %\DeclareUnicodeCharacter{0464}{\CYRESHRT} % no surch cmd in X2
+ %% ukrainian letter, looks as a ligature ie, not defined anywhare
+ %\DeclareUnicodeCharacter{0465}{\cyreshrt} % no surch cmd in X2
+ %% therefor, we substitute it with є (#0454, \cyrie)
+ \DeclareUnicodeCharacter{0464}{\CYRIE}%
+ %\DeclareTextSymbolDefault{\CYRIE}{X2}
+ \DeclareUnicodeCharacter{0465}{\cyrie}%
+ %\DeclareTextSymbolDefault{\cyrie}{X2}
+\fi
+\usepackage[dvipsnames,usenames]{xcolor}
+\usepackage{colortbl}
+ \definecolor{thered} {rgb}{0.65,0.04,0.07}
+ \definecolor{thegreen}{rgb}{0.06,0.44,0.08}
+ \definecolor{thegrey} {gray}{0.8}
+ \definecolor{theshade}{rgb}{1,1,0.97}
+ \definecolor{theframe}{gray}{0.6}
+ \definecolor{theblue}{cmyk}{1.00, 0.50, 0.00, 0.40}
+%\usepackage[numbered]{hypdoc}
+\usepackage[colorlinks=true
+ ,linkcolor=violet %theblue %
+ ,filecolor=purple %thegreen%
+ ,citecolor=teal %thegreen%
+ ,pdfpagelayout=TwoPageRight%
+ ,pdfauthor={Ponomarenko S.M. aka sergiokapone}%
+ ,pdfdisplaydoctitle=true%
+ ,pdfencoding=auto%
+ ]{hyperref}
+% ====================================
+\newcommand*\TeXhax{\TeX hax}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\Babel{\textsf{Babel}}
+\newcommand*\xetex{\textsf{xetex}}
+\newcommand*\luatex{\textsf{luatex}}
+\providecommand*\m[1]{\mbox{$\langle$\normalfont\itshape#1\/$\rangle$}}
+\newcommand*\langlist{%
+ \meta{language}\texttt{,}\meta{language}\texttt{,}...}
+\newcommand*\langvar{\m{lang}}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\menv[1]{\char`\{#1\char`\}}
+\newcommand*\Eenv[1]{%
+ \quad\ldots\quad
+ \texttt{\color{thered}\string\end\menv{#1}}}
+\newcommand*\file[1]{\texttt{#1}}
+\newcommand*\cls[1]{\texttt{#1}}
+\newcommand*\pkg[1]{\texttt{#1}}
+% --------------------------------------------------
+\IfFileExists{listings.sty}{
+ \usepackage{listings}
+ \lstset{
+ gobble=1,
+ columns=flexible,
+ keepspaces,
+ basicstyle=\MacroFont,
+ keywords=[0]{\selectlanguage,\foreignlanguage
+ ,\babelhyphen,\babelhyphenation
+ ,\lefthyphenmin,\righthyphenmin
+ ,\StartBabelCommands,\SetString,\EndBabelCommands,\shorthandoff,\shorthandon
+ ,\languageshorthands,\useshorthands,\defineshorthand
+ ,\AddBabelHook,\SetStringLoop,\SetCase,\AfterBabelLanguage
+ ,\defaultfontfeatures,\setmainfont,\setsansfont,\setmonofont
+ ,\Ukrainian,\cyrdash,\cdash
+ ,\cyr,\cyrillictext,\textcyrillic,\cyrillicencoding
+ ,\addto,\captionsukrainian,\dateukrainian,\noextrasukrainian,\extrasukrainian
+ ,\languageattribute
+ ,\ch,\sh,\tg,\ctg,\arctg,\arcctg\,\th,\cth,\cosec
+ ,\dq
+ ,\XeTeXinputencoding
+ }
+ ,keywordstyle=[0]\color{thered}
+ ,keywords=[1]{main,ukrainian,english,german,frenchb
+ ,shorthands,extrasenglish
+ ,stringprocess,afterextras
+ ,soft,empty,nobreak,hard
+ ,Renderer,Ligatures
+ ,T1,T2A,lutf8,utf8
+ ,fontspec,babel,inputenc,fontenc
+ },
+ keywordstyle=[1]\color{thegreen},
+ comment=[l]\%,
+ commentstyle=\color{thegrey}\itshape,
+ alsoother={0123456789_},
+ frame=single,
+ backgroundcolor=\color{theshade},
+ rulecolor=\color{theframe},
+ framerule=\fboxrule,
+ }
+ \let\verbatim\relax
+ \lstnewenvironment{verbatim}[1][]{\lstset{##1}}{}
+ \AtBeginDocument{%
+ \DeleteShortVerb{\|}%
+ \lstMakeShortInline|%
+ }
+}{}
+\def\PrintDescribeMacro#1{%
+ \strut\MacroFont\color{thered}\normalsize\string#1}
+\def\Describe#1{%
+ \par\penalty-500\vskip3ex\noindent
+ \DescribeMacro{#1}\args}
+\def\DescribeOther{\vskip-5.8ex\Describe}
+\makeatletter
+\def\args#1{%
+ \def\bbl@tempa{#1}%
+ \ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces}
+\makeatother
+% ====================================
+\EnableCrossrefs
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\CodelineIndex % Index code by line number
+\RecordChanges % Gather update information
+%\PageIndex % Index code by page number
+% ====================================
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{\jobname.dtx}
+% \GetFileInfo{\jobname.ldf}
+%
+% \title{^^A
+% \textsf{Ukrainian} --- description text\thanks{^^A
+% This file describes version \fileversion, last revised \filedate.^^A
+% }^^A
+% }
+% \author{^^A
+% You\thanks{E-mail: you@your.domain}^^A
+% }
+% \title{The Ukrainian Language\\
+% in the \babel\ system\\[0.5em]
+% \large Version \fileversion}
+%
+% \author{Sergiy M. Ponomarenko\footnote{E-mail: \href{mailto:sergiy.ponomarenko@gmail.com}{sergiy dot ponomarenko at gmail dot com}.}}
+%
+% \date{Released \filedate}
+%
+% \maketitle
+%
+% {\small\tableofcontents}
+%
+%
+% \section{The Ukrainian Language Definition File}
+%
+% The file \file{\filename}\footnote{The file described in this document
+% has the version number \fileversion\ and was last revised on \filedate.}
+% is the source file for the Ukrainian Language Definition file
+% \file{\jobname.ldf} to be loaded by the \babel\ package with
+% the option \Lopt{ukrainian}. It's based on the Russian language definition
+% file \file{russianb.ldf} derived by Igor~A.~Kotelnikov.
+%
+% \section{Usage}
+%
+% Typesetting Ukrainian texts implies that a special input and output
+% encodings should be used. Input encodings are those which are used in source
+% (\file{.tex}) file. Output encoding is also known as the font encoding. It is
+% implemented within the font files.
+%
+% Generally, the user may choose between different available Cyrillic
+% encodings. The current support for Cyrillic uses LH family of MetaFont fonts
+% and theirs Postscript versions such as \texttt{CM-super}. Lua\LaTeX\ and Xe\LaTeX,
+% being the Unicode-based succeeders of \LaTeX, allow also for any Open Type
+% (OTF) and True Type (TTF) fonts which has Cyrillic script, e.g. Computer
+% Modern Unicode, Linux Libertine, and many other system fonts that came with
+% Linux, Mac and Windows operating systems.
+%
+% With the advent of Unicode, \LaTeX\ community are moving towards eliminating
+% all existing encodings in favor of Unicode, but nowadays one should take
+% care when switching from \LaTeX\ to Lua\LaTeX\ or Xe\LaTeX\ since
+% different packages should be loaded for those compilers.
+%
+% Since earlier versions \babel{} did not
+% support Xe\LaTeX\ (at least for some languages including Ukrainian), the
+% \pkg{polyglossia} package was generally recommended in the past for
+% use with Xe\LaTeX\ as a replacement for \babel. Nowadays, \babel{}
+% can be used with any engines, including \LaTeX, PDF\LaTeX, Lua\LaTeX, and
+% Xe\LaTeX. Nevertheless some troubles may occur with some languages which
+% have no promptly updated \file{.ldf} files.
+%
+%
+% \subsection{\LaTeX}
+%
+% When user's document is compiled with \file{latex.exe} or \file{pdflatex.exe},
+% recommended set of packages includes the \pkg{inputenc} and \pkg{fontenc}
+% packages. They should be loaded before \babel, for example,
+% \begin{verbatim}
+% \usepackage[T1,T2A]{fontenc}
+% \usepackage[utf8]{inputenc}
+% \usepackage[english,ukrainian]{babel}
+%\end{verbatim}
+% Some variations in the order of loading the packages are allowed in this case
+% but it is better to follow one and the same convention at all circumstances:
+% the \babel{} package should go last, and \pkg{fontenc} must be the first.
+%
+% Input encoding should be declared as option to the \pkg{inputenc}
+% package. Known Cyrillic encodings include \texttt{cp866} (MS DOS),
+% \texttt{cp1251} (Windows), \texttt{koi8-u} (UNIX) and their variants.
+% Nowadays, this list is appended with \texttt{utf8} input encoding.
+%
+% Output encodings (also known as font encodings) are declared as options to
+% the \pkg{fontenc} package. Known Cyrillic encodings are \texttt{T2A},
+% \texttt{T2B}, \texttt{T2C}, \texttt{LCY}, and \texttt{X2};
+% \texttt{LWN} is excluded from Ukrainian support of
+% \file{\filename} since \texttt{LWN} is excluded from the \pkg{cyrillic}
+% bundle of related files.
+%
+%
+% \subsection{Lua\LaTeX}
+%
+% If Unicode fonts are not available, Lua\LaTeX\ can run in compatibility
+% (8-bit) mode to use same font as \LaTeX\ does. However the package
+% \pkg{inputenc} does not work with Lua\LaTeX\ and should be substituted with
+% \pkg{luainputenc}. Source file is to be converted to \texttt{UTF8}
+% (Unicode-8) encoding; it is the only input encoding accepted by
+% Lua\LaTeX. The 8-bit mode is invoked by the following sequence of packages:
+% \begin{verbatim}
+% \usepackage[T1,T2A]{fontenc}
+% \usepackage[lutf8]{luainputenc}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+% The order of the packages is crucial for Lua\LaTeX\ in 8-bit mode. Since both
+% \pkg{luainputenc} and \babel{} should know what is a selected font encoding,
+% the \pkg{fontenc} package should be loaded first. Input encoding management for
+% Lua\TeX\ is needed only for compatibility with old documents. For new
+% documents, using UTF-8 encoding and Unicode fonts is strongly recommended.
+% \emph{You've been warned!} See
+% \href{http://tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}%
+% {tex.stackexchange.com/questions/31709/can-one-instruct-lualatex-to-use-t2a-encoded-fonts}.
+%
+%
+% To invoke Unicode mode, one needs to load the \pkg{fontspec} package instead
+% of \pkg{luainputenc} and \pkg{fontspec} and explicitly indicate which True Type
+% or Open Type fonts should be used for romanic, sans-serif and monospaced types.
+% The following example shows how to load Computer Modern Unicode (CMU) fonts,
+% which is a part of all modern \LaTeX\ distributions:
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Renderer=Basic,Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+% The |\defaultfontfeatures| declares default font features for subsequent
+% |\setmainfont| (which sets romanic fonts), |\setsansfont| (sans-serif) and
+% |\setmonofont| (monospaced font). Font features can be set up on per font
+% bases; for example
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \setmainfont[Renderer=Basic,Ligatures={TeX}]{CMU Serif}
+% \setsansfont[Renderer=Basic,Ligatures={TeX,Historic}]{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+% Here |Renderer=Basic,Ligatures={TeX}| activates ligatures which are existed
+% in \LaTeX.
+%
+% Recall that the language enlisted last in the list of options of the \babel{}
+% package is assumed to be the main language of the document, which is also active
+% language right after |\begin{document}|. As of version 3.9, the main language
+% can be set as a value of the |main| option as follows
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \usepackage[english,main=ukrainian,german]{babel}
+% \end{verbatim}
+% %\unskip
+%
+%
+%
+% \subsection{Xe\LaTeX}
+%
+% In Xe\LaTeX, there is also a special mode for 8-bit compatibility.
+% One can use |\XeTeXinputencoding| to change the input encoding
+% temporarily, and the \texttt{"bytes"} encoding makes Xe\LaTeX\ works
+% like a 8-bit \LaTeX\ engine:
+% \begin{verbatim}
+% \XeTeXinputencoding "bytes"
+% \usepackage[utf8]{inputenc}
+% \usepackage[T2A]{fontenc}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+% \unskip
+% Xe\TeX\ can use a different input encoding but it always uses the Unicode
+% internally, so that |\XeTeXinputencoding| performs a conversion of the input
+% into Unicode;
+%
+% \noindent%
+% see \href{http://tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}
+% {tex.stackexchange.com/questions/36188/do-xetex-and-luatex-always-use-unicode}.
+%
+%
+% Unicode mode is set up same way as for Lua\LaTeX, however the option
+% |Renderer=Basic| can be dropped:
+% \begin{verbatim}
+% \usepackage{fontspec}
+% \defaultfontfeatures{Ligatures={TeX}}
+% \setmainfont{CMU Serif}
+% \setsansfont{CMU Sans Serif}
+% \setmonofont{CMU Typewriter Text}
+% \usepackage[english,ukrainian]{babel}
+% \end{verbatim}
+%
+% \section{User's commands}
+%
+% In a multilingual document, some typographic rules are language
+% dependent and should apply to the whole document.
+%
+% Regarding local typography, the macro |\selectlanguage{ukrainian}|
+% switches to the Ukrainian language, with the following effects:
+% \begin{enumerate}
+% \item Ukrainian hyphenation patterns are made active;
+% \item |\today| prints the date in Ukrainian;
+% \item the caption names are translated into Ukrainian
+% (\LaTeX{} only);
+% \item emdash typed by the ligature |---| might be 20\% shorter when Ukrainian
+% is the current language; the result depends on the current encoding; |---|
+% always produce long emdash in Lua\TeX\ and Xe\TeX\ since these engines
+% use same encodings for all languages;
+% \item emdash typed by the ligature |"---| in Ukrainian is 20\% shorter, however
+% the ligature |"---| might not be defined in other languges; a
+% shorter emdash (i.e. |\cyrdash|) can be typeset in any language using
+% special macros enlisted in table \ref{tab:ukrainian-quote}.
+% \end{enumerate}
+%
+% Additional commands are provided to typeset quotes:
+%
+% \begin{enumerate}
+% \item French quotation marks can be entered using the commands
+% |\guillemotleft| and |\guillemotright| which work in \LaTeXe\
+% and Plain\TeX.
+% \item German quotation marks can be entered using the commands
+% |\glqq| and |\grqq| which work in \LaTeXe\ and Plain\TeX.
+% \end{enumerate}
+%
+% The macro |\Ukrainian| defined as an alias for
+% |\selectlanguage{ukrainian}|, and its ``opponent'' |\English|, existed
+% in \file{\jobname.ldf} has been removed since the Ukrainian
+% language definition file is wrong place for definition of macros which
+% switch to a distinct other language.
+%
+% The macro |\textcyrillic|\marg{text} is intended to typeset small chunks of text
+% in Ukrainian; it is essentially an alias for |\foreignlanguage{ukrainian}|\marg{text}.
+%
+%
+% \subsection{Active character}
+%
+% Table~\ref{tab:ukrainian-quote} shows macros and active string which can be
+% used to typeset various dashes and quotes.
+% In the Ukrainian language, the character |"| is made active. It can be
+% considered as second escape character in addition to |\|. Some dashes and
+% all quotes can be typed using both active character |"| and ordinary
+% macros as indicated in the table. However, some shorthanded hyphenations
+% have no macro counterpart.
+%
+% \begin{table}[!ht]\centering
+% \caption{Extra definitions made
+% by \file{\jobname.ldf}}\label{tab:ukrainian-quote}
+% \medskip
+% \begin{tabular}{llp{7cm}}
+% \hline\hline\\[-0.5em]
+% |\glqq| & |"`| &
+% German opening double quote (looks like ,\kern-0.08em,). \\
+% |\grqq| & |"'| &
+% German closing double quote (looks like ``). \\
+% |\guillemotleft| & |"<| &
+% French opening double quote (looks like $<\!\!<$). \\
+% |\guillemotright| & |">| &
+% French closing double quote (looks like $>\!\!>$). \\
+% |\dq| & &
+% Original quotes character (|"|). \\[0.5em]
+% |\babelhyphen{soft}|
+% & |"-| & Optional (soft) hyphen sign, similar to |\-| but allows
+% hyphenation in the rest of the word;
+% equivalent to |\babelhyphen{soft}| in \babel{} 3.9. \\
+% |\babelhyphen{empty}|
+% & |""| & Similar to |"-| but prints no hyphen sign
+% (used for compound words with hyphen, e.g. |x-""y|);
+% equivalent to |\babelhyphen{empty}| in \babel{} 3.9. \\
+% |\babelhyphen*{nobreak}|
+% & |"~| & Compound word mark without a breakpoint, prints hyphen
+% prohibiting hyphenation at the point;
+% equivalent to |\babelhyphen*{nobreak}| in \babel{} 3.9. \\
+% |\babelhyphen{hard}|
+% & |"=| & A compound word mark with a breakpoint, prints hyphen
+% allowing hyphenation in the composing words.
+% equivalent to |\babelhyphen{hard}| in \babel{} 3.9. \\
+% |\babelhyphen{nobreak}|
+% & \verb="|= & Disables ligature at this position;
+% equivalent to |\babelhyphen{nobreak}| (??) in \babel{} 3.9.
+% \\[0.5em]
+% |\cyrdash| & & Row Cyrillic emdash (does not care
+% spaces around). \\
+% |\cdash---| & |"---| &
+% Cyrillic emdash in plain text. \\
+% |\cdash--~| & |"--~| &
+% Cyrillic emdash in compound names
+% (as in |Mendeleev"--~Klapeiron|). \\
+% |\cdash--*| & |"--*| &
+% Cyrillic emdash for denoting direct speech. \\
+% & |",| & Thin space
+% (allows further hyphenation as in |D.",Mendeleev|). \\[0.5em]
+% \hline\hline
+% \end{tabular}
+% \end{table}
+% Note that the standard soft hyphen |\-| is equivalent to |\babelhyphen*{soft}|.
+%
+% \medskip
+%
+% The quotation marks traditionally used in Ukrainian were borrowed from
+% other languages (e.g., French and German) so they keep their original
+% names.
+%
+% The French quotes are also available as ligatures `|<<|' and `|>>|' in
+% 8-bit Cyrillic font encodings (\texttt{LCY}, \texttt{X2}, \texttt{T2*})
+% and in Unicode encodings (\texttt{EU1} and \texttt{EU2})
+% and as `|<|' and `|>|' characters in 7-bit Cyrillic font encodings
+% (\texttt{OT2} and \texttt{LWN}).
+%
+% In Unicode encodings \texttt{EU1} and \texttt{EU2} cyrdashes and quotes
+% can be typed as single character if text editor makes it possible to
+% insert characters which absent of standard keyboard. This method works
+% as well for 8-bit fonts encoded according to \texttt{T2A} if source file
+% is encoded with \texttt{cp1251} or {utf8}.
+%
+% By default, active double quote is switched on. It can be switched off
+% any time using |\shorthandoff{"}| and the switched on again using
+% |\shorthandon{"}|.
+%
+% \subsection{Math commands}
+%
+% The \file{\filename} defines few macros that can be used independently
+% of current language. These are macros to be used in math mode to type
+% the names of trigonometric functions common for Ukrainian documents:
+% |\sh|, |\ch|, |\tg|, |\ctg|, |\arctg|, |\arcctg|, |\th|, |\cth|, and
+% |\cosec|. Cyrillic letters in math mode can be typed with the aid of
+% text commands such as |\textbf|, |\textsf|, |\textit|, |\texttt|, e.t.c.
+%
+%
+% \section{\TeX{}nical details}
+%
+% The packages \pkg{inputenc} and \pkg{luainputenc}
+% make Cyrillic letters active so that a compiler converts them into
+% corresponding |\cyr<letter>| macro at compilation time.
+% For example, Ukrainian letter `a' matches
+% macro |\cyra|, and capital Ukrainian letter `A' matches |\CYRA|. The
+% package \pkg{fontenc} then matches every macro |\cyr<letter>| to corresponding
+% glyph in a font file depending on a declared font encoding.
+%
+% Nowadays, Unicode makes |\cyr<letter>| macros outdated since both source
+% file and font file are encoded consistently. These macros
+% should therefore be removed because mixing them with Unicode characters
+% breaks sorting mechanism of such utilities as \file{bibtex} and
+% \file{makeindex}. For the sake of backward compatibility, |\cyr<letter>| are
+% still kept for \LaTeX, but they are bypassed if Lua\LaTeX\ or Xe\LaTeX\
+% are detected.
+%
+% \section{Known problems}
+%
+% Before switching from a legacy 8-bit engine (tex, pdftex) to an Unicode
+% engine (xetex, luatex) and vise versa delete all |.aux|, |.toc|, |.lot|,
+% |.lof| files as they might have stored incompatible internal encodings.
+%
+%
+% \StopEventually{^^A
+% \setlength{\postmulticols}{100pt}
+% \PrintChanges
+% \PrintIndex
+% }
+%
+% \iffalse
+%<*code>
+% \fi
+%
+% \section{Implementation}
+% \changes{1.4a}{2017/06/13}{Removing \cs{week<roman number>day} macro, since it is should be define in \cls{datetime2} class}
+% \changes{1.4a}{2017/06/13}{Removing \cls{revtex4(4-1)} classes ukrainization because it unused in ukainian text typesetting}
+% \changes{1.4a}{2017/06/13}{Adding \cs{acronymname}, \cs{lstlistingname} and \csc{lstlistlistingname} macros to nonunicode captions}
+% \changes{1.4}{2017/06/10}{For compatibility with older Ukrainian packages we leave definition of the \cs{No} macro}
+% \changes{1.4}{2017/06/09}{Fix Ukrainian translation of babel unicode string \cs{chaptername}}
+% \changes{1.4}{2017/06/09}{Macros \cs{Asbuk} and \cs{asbuk} are removed}
+% \changes{1.4}{2017/06/09}{Cyrillic alphabetical enumeration is provided by \cs{Alph} and \cs{alph} macros when Ukrainian loaded}
+% \changes{1.4}{2017/06/09}{Used babel's 3.9 (and later) macros for defining caption names and date for Unicode case}
+% \changes{1.3i}{2017/06/08}{Corrections according to alphabetical enumeration Ukrainian standart ДСТУ 3008:2015}
+% \changes{1.3i}{2017/06/08}{Some math macro from original russian.ldf was removed because of seldom usage}
+% \changes{1.3h}{2017/06/06}{Initial version}
+%
+% \subsection{Initial setup}
+%
+% The macro |\LdfInit| performs a couple of standard checks that
+% must be made at the beginning of a language definition file,
+% such as checking the category code of the \texttt{@}-sign, preventing
+% the \file{.ldf} file from being processed twice, etc.
+%
+% \begin{macrocode}
+\LdfInit{ukrainian}{captionsukrainian}
+% \end{macrocode}
+%
+% First, we check if Lua\LaTeX\ or Xe\LaTeX\ is running. If so, we set
+% boolean key |\if@ukr@uni@ode| to true. It will be used to eliminate |\cyr...|
+% commands, which were introduced in \LaTeX2e\ to handle various
+% Cyrillic input encoding. With the advent of Unicode \LaTeX\ is
+% moving to universal input encoding, so we consider these |\cyr...|
+% commands as obsolete. They are preserved though for backward
+% compatibility in case if \LaTeX\ or PDF\LaTeX\ are running.
+%
+% We don't load the \pkg{ifluatex} or \pkg{ifxetex} package because
+% |\RequirePackage| is not allowed at the stage of processing options
+% (note that babel loads this file right when it processes its own options)
+% but we borrow code from these packages.
+%
+% \begin{macrocode}
+\ifdefined\if@ukr@uni@ode
+ \PackageError{babel}{if@ukr@uni@ode already defined.\MessageBreak
+ Please contact author of ukraineb.ldf}
+ \relax
+\fi
+\newif\if@ukr@uni@ode
+\ifdefined\luatexversion
+ \@ukr@uni@odetrue
+\else
+ \ifdefined\XeTeXrevision
+ \@ukr@uni@odetrue
+ \fi
+\fi
+% \end{macrocode}
+%
+% Check if hyphenation patterns for the Ukrainian language have been
+% loaded in \file{language.dat}. Namely, we check for the existence of
+% |\l@ukrainian|. If it is not defined, we declare Ukrainian as dialect
+% for the default language number 0 which almost for sure is English.
+%
+% \begin{macrocode}
+\ifx\l@ukrainian\@undefined
+ \@nopatterns{Ukrainian}
+ \adddialect\l@ukrainian0
+\fi
+% \end{macrocode}
+% Now |\l@ukrainian| is always defined.
+%
+% \subsection{Output encoding}
+%
+% We need to know font encoding that is supposed to be
+% active at the end of the \babel\ package. Default font encoding, set by
+% \LaTeX\ core, is \texttt{OT1}. This can be changed by the \pkg{fontenc}
+% package in case of \LaTeX\ and by \pkg{fontspec} package in case of
+% Lua\LaTeX. It matters weather these packages are loaded before of after
+% \babel. In the latter case or if these packages are not loaded at all,
+% \file{ukraineb.ldf} ignores their effect and tries to provide some
+% reasonable settings. In particular, \texttt{T2A} will be selected for
+% Ukrainian language if \LaTeX\ is running but \texttt{EU1} in case of
+% Xe\LaTeX\ and \texttt{EU2} in case of Lua\LaTeX.
+%
+%
+% In Unicode mode, the package \pkg{fontspec} should be loaded instead of
+% \pkg{fontenc} to make font preparation; \pkg{fontspec} loads the package
+% \pkg{xunicode} which sets current encoding (kept in |\cf@encoding|) to
+% \texttt{EU1} for Xe\LaTeX\ and \texttt{EU2} for Lua\LaTeX, and the \babel{}
+% package sets the macro |\latinencoding| to |\cf@encoding|. Since \babel{} scan
+% for value |\cf@encoding| within |\AtBeginDocument|, |\latinencoding| will
+% be set to either \texttt{EU1} for Xe\LaTeX\ or \texttt{EU2} for Lua\LaTeX\
+% no matter which of the packages, \babel{} or \pkg{fontspec} is loaded first.
+%
+%
+% \Describe\cyrillicencoding{}
+% There is a limited list of encodings appropriate for Cyrillic text. We
+% will look which of them is declared and keep its name in the macro
+% |\cyrillicencoding|.
+% Correct (but obsolete and now deleted) 7-bit Cyrillic encoding is
+% \texttt{LWN}.
+% Correct 8-bit Cyrillic encodings are
+% \texttt{T2A} (default for 8-bit compilers), \texttt{T2B}, \texttt{T2C},
+% \texttt{LCY} and \texttt{X2}.
+% Correct utf8 encodings are
+% \texttt{TU} (default for Xe\LaTeX\ and Lua\LaTeX),
+% \texttt{EU1} (obsolete, formerly used for Xe\LaTeX),
+% \texttt{EU2} (obsolete, formerly used for Lua\LaTeX).
+%
+% In 8-bit (\LaTeX) mode, user may choose between different non-unicode Cyrillic
+% encodings---e.g., \texttt{X2} or \texttt{LCY}.\@ If user wants
+% to use another font encoding rather than default (\texttt{T2A}),
+% he has to load the corresponding file \emph{before} \file{babel.sty}.
+%
+% Remember that for the Ukrainian language, the \texttt{T2A} encoding is
+% better than \texttt{X2}, because \texttt{X2} does not contain Latin
+% letters, and users should be very careful to switch the language
+% every time they want to typeset a Latin word inside a Ukrainian phrase
+% or vice versa.
+%
+% We parse the |\cdp@list| containing encodings known to \LaTeX\
+% in the order they have been loaded by the time \pkg{babel} is called.
+% We set the |\cyrillicencoding| to the \emph{last} loaded encoding in the
+% list of supported Cyrillic encodings: \texttt{OT2}, \texttt{LCY},
+% \texttt{X2}, \texttt{T2C}, \texttt{T2B}, \texttt{T2A}. In Unicode mode,
+% |\cyrillicencoding| is set to \texttt{TU} by \pkg{fontspec}. Nevertheless
+% here we provide similar definitions; 8-bit encodings are kept for Unicode
+% compilers (Lua\LaTeX\ and Xe\LaTeX) since they can run in compatibility
+% (8-bit) mode.
+%
+% \changes{1.4b}{2017/08/10}{TU encoding added}
+% \begin{macrocode}
+\def\@setcyrillicencoding{%
+ \def\sce@a##1##2{%
+ \edef\sce@b{##1}%
+ \edef\sce@c{##2}%
+ \ifx\sce@b\sce@c
+ \let\cyrillicencoding\sce@c
+ \fi}%
+ \def\cdp@elt##1##2##3##4{%
+ \sce@a{##1}{OT2}%
+ \sce@a{##1}{LCY}%
+ \sce@a{##1}{X2}%
+ \sce@a{##1}{T2C}%
+ \sce@a{##1}{T2B}%
+ \sce@a{##1}{T2A}%
+ \if@ukr@uni@ode
+ %\sce@a{##1}{EU1}%
+ %\sce@a{##1}{EU2}%
+ \sce@a{##1}{TU}%
+ \fi}%
+ \cdp@list
+}
+\ifx\cyrillicencoding\undefined
+ \@setcyrillicencoding
+\fi
+\@onlypreamble\@setcyrillicencoding
+\@onlypreamble\sce@a
+\@onlypreamble\sce@b
+\@onlypreamble\sce@c
+% \end{macrocode}
+% The last lines are to free the memory occupied by the macros
+% |\@setcyrillicencoding| and |\sce@x| that are useless in the document.
+% The contents of |\@begindocumenthook| is cleared automatically.
+%
+% If |\cyrillicencoding| is still undefined, we issue warning and provide
+% reasonable default value for |\cyrillicencoding|. We then load default
+% encoding definitions; we use the lowercase names (i.e.,
+% \texttt{lcyenc.def} instead of \texttt{LCYenc.def}) when we do that.
+%
+% \begin{macrocode}
+\ifdefined\cyrillicencoding
+\else
+ \if@ukr@uni@ode
+ \ifdefined\XeTeXrevision
+ \edef\cyrillicencoding{EU1}
+ \else
+ \ifdefined\luatexversion
+ \edef\cyrillicencoding{EU2}
+ \fi
+ \fi
+ \else
+ \edef\cyrillicencoding{T2A}
+ \fi
+ \PackageWarning{babel}%
+ {No Cyrillic font encoding has been loaded so far.\MessageBreak
+ A font encoding should be declared before babel.\MessageBreak
+ Default `\cyrillicencoding' encoding will be loaded
+ }%
+ \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
+% \end{macrocode}
+% As final wisdom, we repeat |\@setcyrillicencoding| at |\begin{document}|
+% time. We could not avoid previous call to |\@setcyrillicencoding| since
+% compiler scan \file{.aux} file before it executes delayed code, and
+% \file{.aux} may contain |\set@langauge{ukrainian}|; the latter rises an
+% error if |\cyrillicencoding| would not be defined by that time.
+% \begin{macrocode}
+ \AtBeginDocument{\@setcyrillicencoding}
+\fi
+% \end{macrocode}
+%
+% \Describe\Ukrainian{}
+% \DescribeOther\cyr{}
+% \DescribeOther\cyrillictext{}
+% For the sake of backward compatibility we keep the macro |\Ukrainian|
+% but redefine its meaning; now |\Ukrainian| is simply an alias for
+% |\selectlanguage{ukrainian}|.
+%
+% We define |\cyrillictext| and its alias |\cyr| but remove another alias
+% |\Ukr|; these macros are intended for use within \texttt{babel} macros and
+% do not perform complete switch of the language.
+% In particular, they to do no switch captions and the name of current
+% language stored in the macro |\languagename|. This inconsistency might
+% break some assumptions embedded into \babel's.
+% For example, the |\iflanguage| macro will fail.
+%
+% Second, |\cyrillictext| does
+% not activate shorthands, so that |"<|, |">|, |"`|, |"'|,
+% |"---|, e.t.c. will not work.
+%
+% And third, |\cyrillictext| does not write its trace
+% to \file{.aux} file, which might result in wrong typesetting of
+% table of content, list of table and list of figures in multilingual
+% documents.
+%
+% Due to any of these reasons the use of the declaration |\cyrillictext| and
+% its aliases in ordinary text is strongly discouraged. Instead of the
+% declaration |\cyrillictext| it is recommended to use |\Ukrainian| or the
+% command |\foreignlanguage| defined in the \babel{} core; their
+% functionality is similar to |\selectlanguage{ukrainian}| but they did not
+% switch caption names, dates and shorthands.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\Ukrainian}{\selectlanguage{\ukrainian}}
+\DeclareRobustCommand{\cyrillictext}{%
+ \fontencoding\cyrillicencoding\selectfont
+ \let\encodingdefault\cyrillicencoding
+ \expandafter\set@hyphenmins\ukrainianhyphenmins
+ \language\l@ukrainian}%
+\let\cyr\cyrillictext
+% \end{macrocode}
+%
+% \textsc{Next part of code should be moved to \texttt{X2enc.def},
+% \texttt{X2enc.dfu}, if needed.}
+% Since the \texttt{X2} encoding does not contain Latin letters, we
+% should make some redefinitions of \LaTeX\ macros which implicitly
+% produce Latin letters.
+%
+% Unfortunately, the commands |\AA| and |\aa| are not encoding dependent
+% in \LaTeX\ (unlike e.g., |\oe| or |\DH|). They are defined as |\r{A}| and
+% |\r{a}|. This leads to unpredictable results when the font encoding
+% does not contain the Latin letters `A' and `a' (like \texttt{X2}).
+%
+% \begin{macrocode}
+\expandafter\ifx\csname T@X2\endcsname\relax\else
+ \DeclareTextSymbolDefault{\AA}{OT1}
+ \DeclareTextSymbolDefault{\aa}{OT1}
+ \DeclareTextCommand{\aa}{OT1}{\r a}
+ \DeclareTextCommand{\AA}{OT1}{\r A}
+\fi
+% \end{macrocode}
+%
+%
+% The macro |\cyrillictext| switches current (e.g., Latin) font encoding
+% to a Cyrillic font encoding stored in |\cyrillicencoding|. The macro
+% |\latintext| switches back. This method assumes that an font
+% encoding is a Latin one. But in fact the latter assumption does not matter
+% if any other language is switched on using same method, i.e.
+% if corresponding \file{.ldf} file defines required macros to switch that
+% language on from same standard (Latin) state.
+% Since |\latintext| is defined by the core of babel we do not repeat its
+% definition here.
+%
+% \begin{macrocode}
+%\DeclareRobustCommand{\latintext}{%
+% \fontencoding{\latinencoding}\selectfont
+% \def\encodingdefault{\latinencoding}}
+%\let\lat\latintext
+% \end{macrocode}
+%
+%\Describe\textcyrillic{\marg{text}}
+% The macros |\cyrillictext| and |\latintext| are declarations.
+% For shorter chunks of text the commands |\textcyrillic| and |\textlatin|
+% can be used.
+%
+% The macro |\textcyrillic| takes an argument which is then typeset using the
+% requested font encoding. It is thus an equivalent or
+% |\foreignlangauge{ukrainian}|.
+%
+% \begin{macrocode}
+\DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
+% \end{macrocode}
+%
+%
+% \subsection{Input encoding}
+%
+% User should use the \pkg{inputenc} package when any 8-bit Cyrillic
+% font encoding is used, selecting one of the Cyrillic input encodings.
+% We do not assume any default input encoding, so
+% the \pkg{inputenc} package should be explicitly called by
+% |\usepackage{inputenc}| \emph{before} \babel.
+% Note however that default font encoding \texttt{T2A} fits
+% well enough to Ukrainian version of Windows ANSI encoding which is almost
+% equivalent to \texttt{cp1251}.
+%
+% \begin{macrocode}
+\@ifpackageloaded{inputenc}{%
+ \if@ukr@uni@ode
+ \PackageWarning{babel}{inputenc should not be used with LuaTeX or XeTeX}
+ \fi
+}{%
+ %\def\reserved@a{LWN}%
+ %\ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{OT2}%
+ \ifx\reserved@a\cyrillicencoding
+ \else
+ \def\reserved@a{EU1}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \def\reserved@a{EU2}%
+ \ifx\reserved@a\cyrillicencoding\else
+ \PackageWarning{babel}%
+ {No input encoding specified for Ukrainian language}
+ \fi
+ \fi
+ \fi
+ %\fi
+}
+% \end{macrocode}
+%
+%
+% \subsection{Shorthands}
+%
+% The double quote character \texttt{"} is declared to be active in
+% Ukrainian language.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+% \end{macrocode}
+%
+% Initial activation state will set to on later in section \ref{sss:extra}.
+%
+% \Describe\dq{}
+% The active character |"| is used as indicated in
+% table~\ref{tab:ukrainian-quote}. We save the original double quote
+% character in the |\dq| macro to keep it available.
+% The math accent |\"| can now be typed as `|"|'.
+%
+% \begin{macrocode}
+\begingroup \catcode`\"12
+\def\reserved@a{\endgroup
+ \def\@SS{\mathchar"7019 }
+ \def\dq{"}}
+\reserved@a
+% \end{macrocode}
+%
+% \subsubsection{Quotes}
+%
+% We set |"`| and |"'| as shorthands for |\quotedblbase| and
+% |\textquotedblleft|, respectively. These shorthands
+% were defined through german quotes |\glqq| and |\grqq|, which in their turn
+% are defined in \pkg{babel.def} via |\quotedblbase| and |\textquotedblleft|,
+% respectively. It occurred, that old definition caused errors in Unicode
+% mode if \pkg{fontspec} is loaded.
+%
+% The shorthands |"<| and |">| were
+% declared to be equivalents for the French quotes |\flqq| and |\frqq|,
+% respectively. They are defined in \pkg{babel.def} via |\guillemotleft| and
+% |\guillemotrigh|. However, |\flqq| and |\guillemotleft| (and their right
+% counterparts) are typeset differently if current encoding is not
+% \texttt{T1}. Therefore, we define |"<| and |">| directly
+% through |\guillemotleft| and |\guillemotrigh|.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{"`}{\quotedblbase}
+\declare@shorthand{ukrainian}{"'}{\textquotedblleft}
+\declare@shorthand{ukrainian}{"<}{\guillemotleft}
+\declare@shorthand{ukrainian}{">}{\guillemotright}
+% \end{macrocode}
+%
+% Next set of shorthands is intended for variations of standard macro |\-|
+% which indicates explicitly breakpoint for hyphenation in a word. Meaning
+% of these shorthands is explained in table~\ref{tab:ukrainian-quote}.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{""}{\hskip\z@skip}
+\declare@shorthand{ukrainian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
+\declare@shorthand{ukrainian}{"=}{\nobreak-\hskip\z@skip}
+\declare@shorthand{ukrainian}{"|}{%
+ \textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}
+% \end{macrocode}
+%
+% \subsubsection{Emdash, endash and hyphenation sign}
+%
+% To distinguish between |"-| and |"---| we must check whether the next
+% after |-| token is a hyphen character.
+% If it is, we output an emdash, otherwise a hyphen sign. Therefor
+% \TeX\ looks for the next token after the first `|-|', writes
+% its meaning to |\ukrainian@sh@next| and finally call for |\ukrainian@sh@tmp|.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{"-}{%
+ \def\ukrainian@sh@tmp{%
+ \if\ukrainian@sh@next-\expandafter\ukrainian@sh@emdash
+ \else%
+ \expandafter\ukrainian@sh@hyphen%
+ \fi}%
+ \futurelet\ukrainian@sh@next\ukrainian@sh@tmp}
+% \end{macrocode}
+% Two macros |\ukrainian@sh@hyphen| and |\ukrainian@sh@emdash| called by
+% |\ukrainian@sh@tmp| are defined below. The second of
+% them has two parameters since it must gobble next two hyphen signs.
+% \begin{macrocode}
+\def\ukrainian@sh@hyphen{\nobreak\-\bbl@allowhyphens}
+\def\ukrainian@sh@emdash#1#2{\cdash-#1#2}
+% \end{macrocode}
+%
+% \Describe\cdash{}
+% In its turn, |\ukrainian@sh@emdash| simply calls for |\cdash| which has
+% rich use. It analyses 3rd of 3 characters and calls for one of few
+% predefined macros |\@Acdash|, |\@Bcdash|, |\@Ccdash|.
+% \begin{macrocode}
+\def\cdash#1#2#3{\def\tempx@{#3}%
+ \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
+ \ifx\tempx@\tempa@\@Acdash%
+ \else%
+ \ifx\tempx@\tempb@\@Bcdash%
+ \else%
+ \ifx\tempx@\tempc@\@Ccdash%
+ \else%
+ \errmessage{Wrong usage of cdash}
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% All these 3 internal macros call for |\cyrdash|, which type Cyrillic
+% emdash, but put different spaces around the dash.
+%
+% |\@Acdash| is invoked by |"---|. It types Cyrillic emdash to be used
+% inside a text and puts an unbreakable thin space before the dash if a
+% \textit{space} is placed before |"---| in the source file;
+% can be used after display maths formulae, formatted lists, enumerations, etc.
+% \begin{macrocode}
+\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
+ \cyrdash\hskip.2em\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Bcdash| is invoked by |"--~|. It types Cyrillic emdash in compound
+% names (like Mendeleev--Klapeiron); requires no space characters around and
+% adds extra space after the dash.
+% \begin{macrocode}
+\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
+ \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
+% \end{macrocode}
+%
+% |\@Ccdash| is invoked by |"--*|. It denotes direct speech and adds small
+% space after the dash.
+% \begin{macrocode}
+\def\@Ccdash{\leavevmode
+ \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
+% \end{macrocode}
+%
+% \Describe\cyrdash{}
+% The |\cyrdash| macro is defined in Cyrillic font encodings (LCY, T2*, OT2,
+% and |X2|) by means of |\DeclareTextSymbol|. In T2* encodings |\cyrdash|
+% refers to same code point 22 as |\textemdash| does so that these two macros
+% are equivalent. However the dash at the code point 22 have different length
+% in different fonts. The dash in Cyrillic fonts LH is 20\% shorter as
+% compared to Latin fonts such as CM (Computer Modern). As a result, the dash
+% typed by the ligature |---| or its variations mentioned in Table
+% \ref{tab:russian-quote} might change its length after |\selectlanguage|.
+%
+% The |\cyrdash| macro is not available in Latin encodings such as T1. Therefor
+% an explicit or implicit call for |\cyrdash| when current language is English
+% causes an error. For such a case, we provide a fake default. A standard check
+% such as |\ifx\cyrdash\undefined ...\fi| fails to detect absent definitions
+% for Latin encodings since the |\cyrdash| macro is in fact defined. Therefor
+% we use the |\ProvideTextCommandDefault| method:
+% \changes{1.4b}{2017/08/10}{Default for \cs{cyrdash} is provided}
+% \begin{macrocode}
+\PackageInfo{babel}{Default for \string\cyrdash\space is provided}
+%%\ProvideTextCommandDefault{\cyrdash}{\iflanguage{ukrainian}%
+%% {\hbox to.8em{--\hss--}}{\textemdash}}
+\ProvideTextCommandDefault{\cyrdash}{\hbox to.8em{--\hss--}}
+% \end{macrocode}%
+%
+% The |\cyrdash| macro is not defined in the Unicode encoding TU. The fake
+% definition given above cope with this case.
+%
+% Finally, we define a shorthand thin space to be placed between initials
+% as in |D.",Mendeleev|. When used instead of |\,| as in |D.\,Mendeleev|
+% it allows hyphenation in the next word.
+%
+% \begin{macrocode}
+\declare@shorthand{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}
+% \end{macrocode}
+%
+%
+% \subsection{Switching to and from Ukrainian}
+%
+% Now we define additional macros used to reset current language to
+% Ukrainian and back
+% to some original state. The package \babel{} based on the assumption
+% that original state is characterized by a Latin encoding. Previously,
+% for back reset the macro |\OriginalTeX| was used, but now use |\latintext|
+% for the same purpose.
+%
+%
+% \subsubsection{Caption names}
+%
+% First, we define Ukrainian equivalents for Ukrainian caption names.
+%
+% \Describe\captionsukrainian{}
+% The macro |\captionsukrainian| defines caption names used in the
+% four standard document classes provided with \LaTeX. The macro |\cyr|
+% activates Cyrillic encoding. It could be dropped if we would be sure
+% that Ukrainian captions are called only if current language is Ukrainian.
+% However, the macros such as |\Ukrainian| do not conform to strict rules
+% of the package \babel{} as explained in the above.
+%
+% We now use \babel{}'s 3.9 |\Set<macro>| macro for defining caption names as well
+% as date. If Unicode engine is running, Cyrillic letters are typed
+% in by their Unicode code-points.
+%
+% \begin{macrocode}
+%
+% ------------------------- Caption Names (Unucode case) -------------------------------
+%
+\if@ukr@uni@ode
+ \PackageInfo{ukrainian.ldf}{Executing the 3.9 or latter}
+ \StartBabelCommands*{ukrainian}{captions}[unicode, fontenc=EU1 EU2, charset=utf8]
+ \SetString\prefacename{Вступ}% [babel]
+ \SetString\refname{Література}% [only article]
+ \SetString\abstractname{Анотація}% [only article, report]
+ \SetString\bibname{Бібліоґрафія}% [only book, report]
+ \SetString\chaptername{Розділ}% [only book, report]
+ \SetString\appendixname{Додаток}%
+ \SetString\contentsname{Зміст}%
+ \SetString\tocname{\contentsname}%
+ \SetString\listfigurename{Перелік ілюстрацій}%
+ \SetString\listtablename{Перелік таблиць}%
+ \SetString\indexname{Предметний покажчик}%
+ \SetString\authorname{Іменний покажчик}%
+ \SetString\figurename{Рис.}%
+ \SetString\tablename{Таблиця}%
+ \SetString\partname{Частина}%
+ \SetString\enclname{вкл.}%
+ \SetString\ccname{вих.}%
+ \SetString\headtoname{вх.}%
+ \SetString\pagename{с.}% [letter]
+ \SetString\seename{див.}%
+ \SetString\alsoname{див.\ також}%
+ \SetString\proofname{Доведення}% [amsthm]
+ \SetString\glossaryname{Словник термінів}%
+ \SetString\acronymname{Абревіатури}% [glossaries] {Acronyms}
+ \SetString\lstlistingname{Лістинг}% [listings] (the environment) {Listing}
+ \SetString\lstlistlistingname{Лістинги}% [listings] (the "List of") {Listings}
+ \SetString\nomname{Позначення}%
+ \SetString\notesname{Нотатки}% [endnotes] {Notes}
+% \end{macrocode}
+% Additional definitions for the package \pkg{nomencl}:
+% \begin{macrocode}
+%
+% ----------------------------- nomencl (Unucode case) ---------------------------------
+%
+ \ifdefined\nomname%
+ \addto\captionsukrainian{%
+ \def\eqdeclaration#1{, див.\nobreakspace(#1)}%
+ \def\pagedeclaration#1{, стор.\nobreakspace#1}%
+ }%
+ \fi
+ \EndBabelCommands
+\else
+%
+% ------------------------- Caption Names (Nonunucode case) ----------------------------
+%
+ \StartBabelCommands*{ukrainian}{captions}
+ \SetString\prefacename{{\cyr\CYRV\cyrs\cyrt\cyru\cyrp}}%
+ \SetString\refname{%
+ {\cyr\CYRL\cyrii\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
+ \SetString\abstractname{%
+ {\cyr\CYRA\cyrn\cyro\cyrt\cyra\cyrc\cyrii\cyrya}}%
+ \SetString\bibname{%
+ {\cyr\CYRB\cyrii\cyrb\cyrl\cyrii\cyro\cyrgup\cyrr\cyra\cyrf\cyrii\cyrya}}%
+ \SetString\chaptername{{\cyr\CYRR\cyro\cyrz\cyrd\cyrii\cyrl}}%
+ \SetString\appendixname{{\cyr\CYRD\cyro\cyrd\cyra\cyrt\cyro\cyrk}}%
+ \SetString\contentsname{{\cyr\CYRZ\cyrm\cyrii\cyrs\cyrt}}%
+ \SetString\tocname{\contentsname}%
+ \SetString\listfigurename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
+ \ \cyrii\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrii\cyrishrt}}%
+ \SetString\listtablename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
+ \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyrsftsn}}%
+ \SetString\indexname{{\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyre\cyrt\cyrn\cyri\cyrishrt
+ \ \cyrp\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
+ \SetString\authorname{{\cyr\CYRII\cyrm\cyre\cyrn\cyrn\cyri\cyrishrt
+ \ \cyrp\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
+ \SetString\figurename{{\cyr\CYRR\cyri\cyrs.}}%
+ \SetString\tablename{{\cyr\CYRT\cyra\cyrb\cyrl.}}%
+ \SetString\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyri\cyrn\cyra}}%
+ \SetString\enclname{{\cyr\cyrv\cyrk\cyrl\cyra\cyrd\cyrk\cyra}}%
+ \SetString\ccname{{\cyr\cyrk\cyro\cyrp\cyrii\cyrya}}%
+ \SetString\headtoname{{\cyr\cyrv\cyrh.}}%
+ \SetString\pagename{{\cyr\cyrs.}}%
+ \SetString\seename{{\cyr\cyrd\cyri\cyrv.}}%
+ \SetString\alsoname{{\cyr\cyrd\cyri\cyrv.\ \cyrt\cyra\cyrk\cyro\cyrzh}}%
+ \SetString\proofname{{\cyr\CYRD\cyro\cyrv\cyre\cyrd\cyre\cyrn\cyrn\cyrya}}%
+ \SetString\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyrn\cyri\cyrk
+ \ \cyrt\cyre\cyrr\cyrm\cyrii\cyrn\cyrii\cyrv}}%
+ \SetString\acronymname{\cyr\CYRA\cyrb\cyrr\cyre\cyrv\cyrii\cyra\cyrt\cyru\cyri\cyri}%
+ \SetString\lstlistingname{\cyr\CYRL\cyrii\cyrs\cyrt\cyri\cyrn\cyrg}%
+ \SetString\lstlistlistingname{\cyr\CYRL\cyrii\cyrs\cyrt\cyri\cyrn\cyrg\cyri}%
+ \SetString\nomname{\CYRP\cyro\cyrz\cyrn\cyra\cyrch\cyre\cyrn\cyrn\cyrya}%
+ \SetString\notesname{\CYRN\cyro\cyrt\cyra\cyrt\cyrk\cyri}%
+ \EndBabelCommands
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Date in Ukrainian}
+%
+% \Describe\dateukrainian{}
+% The macro |\dateukrainian| is used to reset the macro |\today| in Ukrainian.
+%
+% \begin{macrocode}
+%
+% ---------------------------- Date (Unicode case) -------------------------------------
+%
+\if@ukr@uni@ode
+ \PackageInfo{ukrainian.ldf}{Executing the post 3.9 branch for dates}
+ \StartBabelCommands*{ukrainian}{date}[unicode, fontenc=EU1 EU2, charset=utf8]
+ \SetStringLoop{month#1name}{%
+ січня,%
+ лютого,%
+ березня,%
+ квітня,%
+ травня,%
+ червня,%
+ липня,%
+ серпня,%
+ вересня,%
+ жовтня,%
+ листопада,%
+ грудня%
+ }
+ \SetString\abbgyear{р.}%
+\else
+%
+% ---------------------------- Date (Nonunicode case) ----------------------------------
+%
+ \StartBabelCommands*{ukrainian}{date}
+ \SetStringLoop{month#1name}{%
+ \cyrs\cyrii\cyrch\cyrn\cyrya,%
+ \cyrl\cyryu\cyrt\cyro\cyrg\cyro,%
+ \cyrb\cyre\cyrr\cyre\cyrz\cyrn\cyrya,%
+ \cyrk\cyrv\cyrii\cyrt\cyrn\cyrya,%
+ \cyrt\cyrr\cyra\cyrv\cyrn\cyrya,%
+ \cyrch\cyre\cyrr\cyrv\cyrn\cyrya,%
+ \cyrl\cyri\cyrp\cyrn\cyrya,%
+ \cyrs\cyre\cyrr\cyrp\cyrn\cyrya,%
+ \cyrv\cyre\cyrr\cyre\cyrs\cyrn\cyrya,%
+ \cyrzh\cyro\cyrv\cyrt\cyrn\cyrya,%
+ \cyrl\cyri\cyrs\cyrt\cyro\cyrp\cyra\cyrd\cyra,%
+ \cyrg\cyrr\cyru\cyrd\cyrn\cyrya%
+ }%
+ \SetString\abbgyear{\cyrr.}%
+\fi
+% \end{macrocode}
+% Typesetting date in both unicode and nonunicode cases
+% \begin{macrocode}
+%
+% ---------------------------- Date typesetting ----------------------------------------
+%
+\SetString\today{\number\day~\csname month\romannumeral\month name\endcsname\space
+ \number\year~\abbgyear}%
+\EndBabelCommands
+% \end{macrocode}
+%
+% \subsubsection{Hyphenation patterns}
+%
+% Ukrainian hyphenation patterns are automatically activated every time
+% Ukrainian language is selected via |\selectlanguage|, |\foreignlanguage|
+% or equivalent command. But we need to declare values of
+% |\lefthyphenmin| and |\righthyphenmin|; both are set to~2.
+%
+%
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
+\providehyphenmins{ukrainian}{\tw@\tw@}
+% \end{macrocode}
+%
+% \subsubsection{Extra definitions}\label{sss:extra}
+%
+% \Describe\extrasukrainian{}
+% \DescribeOther\noextrasukrainian{}
+% The macro |\extrasukrainian| performs extra definitions in addition to
+% resetting the caption names and date.
+% The macro |\noextrasukrainian| is used to cancel the actions of
+% |\extrasukrainian|.
+%
+%
+% First, we instruct \babel{} to switch font encoding using earlier
+% defined macros |\cyrillictext| and |\latintext|.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\cyrillictext}
+\addto\noextrasukrainian{\latintext}
+% \end{macrocode}
+%
+% Second, we specify that the Ukrainian group of shorthands should be used.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\languageshorthands{ukrainian}}
+\addto\extrasukrainian{\bbl@activate{"}}
+\addto\noextrasukrainian{\bbl@deactivate{"}}
+% \end{macrocode}
+%
+% Now the action |\extrasukrainian| has to execute is to make sure that the
+% command |\frenchspacing| is in effect. If this is not the case the
+% execution of |\noextrasukrainian| will switch it off again.
+%
+% \begin{macrocode}
+\addto\extrasukrainian{\bbl@frenchspacing}
+\addto\noextrasukrainian{\bbl@nonfrenchspacing}
+% \end{macrocode}
+%
+% \subsection{Alphabetic enumerations}
+%
+% The traditional alphabetical enumerations in Ukrainan texts use the
+% Cyrillic alphabet (bar several letters). In principle, enumerations are
+% a matter for class and style designers but the same can be said also
+% about things, other than enumerations, such as names of sections and
+% bibliography lists.
+%
+% The alphabet is not the only difference, differences also in the labels format.
+% According to Cyrillic typesetting tradition and also with ДСТУ 3008:2015,
+% label format should be with one right parenthesis and the top level enumerate should be
+% alphabetical, but we believe that this is not necessary
+% for including such changes in \file{\jobname.ldf}, for this purpose you can simply redefine
+% required counters in preamle by common \LaTeX way.
+%
+% \begin{verbatim}
+% \def\theenumi{\alph{enumi}}
+% \def\labelenumi{\theenumi)}
+% \def\theenumii{\alph{enumii}}
+% \def\labelenumii{\theenumii)}
+% \end{verbatim}
+
+%
+% Nevertheless, the Ukrainian \babel{} by default turns on alphabetical enumeration
+% with Cyrillic letters. This means that enumerated lists that would be labelled with
+% Latin letters in Latin scripts are labelled with Cyrillic ones instead.
+%
+% \Describe\Alph{}
+% Starting from this virsion, we remove an macro |\Asbuk|
+% (also it lowercase counterpart |\asbuk|). Now we redefine the macro |\Alph|,
+% which is now produces (uppercase) Cyrillic letters instead of Latin ones
+% when Ukrainian is switched on.
+%
+% The letters Ґ, Є, З, І, Ї, Й, О, Ч, Ь, are skipped for such enumeration (see \href{http://www.uintei.kiev.ua/readarticle.php?article_id=151}{ДСТУ 3008:2015}).
+%
+% \begin{macrocode}
+\addto\extrasukrainian{%
+% \end{macrocode}
+% When Ukrainian swithsed off, the previous meaning of |\@Alph| will be restored
+% \begin{macrocode}
+ \babel@save{\@Alph}%
+ \if@ukr@uni@ode%
+ \def\@Alph#1{%
+ \ifcase#1\or%
+ А\or Б\or В\or Г\or Д\or Е\or Ж\or%
+ И\or К\or Л\or М\or Н\or П\or Р\or%
+ С\or Т\or У\or Ф\or Х\or Ц\or Ш\or%
+ Щ\or Ю\or Я%
+ \else%
+ \@ctrerr%
+ \fi}%
+ \else
+ \def\@Alph#1{%
+ \ifcase#1\or%
+ \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or%
+ \CYRI\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRP\or\CYRR\or%
+ \CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or\CYRC\or\CYRSH\or%
+ \CYRSHCH\or\CYRYU\or\CYRYA%
+ \else%
+ \@ctrerr%
+ \fi}%
+ \fi
+}
+% \end{macrocode}
+% \Describe\alph{}
+% Now the macro |\alph| produces lowercase Cyrillic letters.
+%
+% The lowercase letters ґ, є, з, і, ї, й, о, ч, ь, are also skipped such enumeration (see \href{http://www.uintei.kiev.ua/readarticle.php?article_id=151}{ДСТУ 3008:2015}).
+% \begin{macrocode}
+\addto\extrasukrainian{%
+% \end{macrocode}
+% When Ukrainian swithsed off, the previous meaning of |\@alph| will be restored
+% \begin{macrocode}
+ \babel@save{\@alph}%
+ \if@ukr@uni@ode%
+ \def\@alph#1{%
+ \ifcase#1\or%
+ а\or б\or в\or г\or д\or е\or ж\or%
+ и\or к\or л\or м\or н\or п\or р\or%
+ с\or т\or у\or ф\or х\or ц\or ш\or%
+ щ\or ю\or я%
+ \else%
+ \@ctrerr%
+ \fi}%
+ \else
+ \def\@alph#1{%
+ \ifcase#1\or%
+ \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or%
+ \cyri\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyrp\or\cyrr\or%
+ \cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or\cyrc\or\cyrsh\or%
+ \cyrshch\or\cyryu\or\cyrya%
+ \else%
+ \@ctrerr%
+ \fi}%
+ \fi
+}
+% \end{macrocode}
+%
+% \subsection{Ukrainian mathetematical typography traditions}
+%
+% \Describe\sh{}
+% \DescribeOther\ch{}%
+% \DescribeOther\tg{}%
+% \DescribeOther\ctg{}%
+% \DescribeOther\arctg{}%
+% \DescribeOther\arcctg{}%
+% \DescribeOther\th{}%
+% \DescribeOther\cth{}%
+% \DescribeOther\cosec{}%
+% We also define few math operator names according to Ukrainian mathetematical
+% typography traditions. Some math functions in Ukrainian math books have names
+% different from English writings. For example, \texttt{sinh} in
+% Ukrainian is called \texttt{sh}. Special consideration needs the
+% macro |\th| that conflicts with the text symbol |\th|
+% defined in Latin~1 encoding:
+%
+% \begin{macrocode}
+\def\sh{\mathop{\operator@font sh}\nolimits}
+\def\ch{\mathop{\operator@font ch}\nolimits}
+\def\tg{\mathop{\operator@font tg}\nolimits}
+\def\ctg{\mathop{\operator@font ctg}\nolimits}
+\def\arctg{\mathop{\operator@font arctg}\nolimits}
+\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
+\addto\extrasukrainian{%
+ \babel@save{\th}%
+ \let\ltx@th\th
+ \def\th{\textormath{\ltx@th}%
+ {\mathop{\operator@font th}\nolimits}}%
+}
+\def\cth{\mathop{\operator@font cth}\nolimits}
+\def\cosec{\mathop{\operator@font cosec}\nolimits}
+% \end{macrocode}
+%
+% For compatibility with older Ukrainian packages we leave definition of the |\No|
+% macro. However the Ukrainian number sign is now superseded with |\textnumero|.
+% Moreover, it can be found on the keyboard.
+% \begin{macrocode}
+\DeclareRobustCommand{\No}{%
+ \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}
+% \end{macrocode}
+%
+% \subsection{Final settings}
+%
+% The macro |\ldf@finish| does work needed
+% at the end of each \file{.ldf} file. This
+% includes resetting the category code of the \texttt{@}-sign,
+% loading a local configuration file, and preparing the language
+% to be activated at |\begin{document}| time.
+%
+% \begin{macrocode}
+\ldf@finish{ukrainian}
+% \end{macrocode}
+%
+%
+%\iffalse
+%</code>
+%\fi
+% \CheckSum{1088}
+%\Finale
+%
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+%\endinput
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.ins b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.ins
new file mode 100644
index 0000000000..2a42612c86
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.ins
@@ -0,0 +1,169 @@
+%%
+%% This is file `ukraineb.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% ukraineb.dtx (with options: `install')
+%% ----------------------------------------------------------------
+%% Ukrainian Language Support for the Babel package
+%% E-mail: sergiy.ponomarenko@gmailcom
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+----------------------------------------------------------------
+Ukrainian Language Support for the Babel package
+E-mail: sergiy.ponomarenko@gmailcom
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+\endpreamble
+\postamble
+----------------------------------------------------------------
+Copyright 2017 Sergiy М. Ponomarenko
+Copyright 2011-2017 Igor A. Kotelnikov.
+Copyright 2000 Aleksey Novodvorsky
+Copyright 1995-2008 Olga Lapko.
+Copyright 1989-2012 Johannes L. Braams.
+
+This file is a part of the Ukrainian-Babel package.
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+The package is "maintained" (as per LPPL maintenance status) by
+Sergiy М. Ponomarenko.
+
+The package consists of the file ukraineb.dtx
+and the derived files ukraineb.ins,
+ ukraineb.ldf,
+ ukraineb.pdf,
+ README.
+----------------------------------------------------------------
+\endpostamble
+\usedir{tex/generic/babel/contrib}
+\generate{
+ \file{\jobname.ldf}{\from{\jobname.dtx}{code}}
+}
+\endbatchfile
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+
+%% Nonunicode Cyrillic Letters
+%% \CYRA=А
+%% \CYRB=Б
+%% \CYRV=В
+%% \CYRG=Г
+%% \CYRGUP=Ґ
+%% \CYRD=Д
+%% \CYRE=Е
+%% \CYRIE=Є
+%% \CYRZH=Ж
+%% \CYRZ=З
+%% \CYRI=И
+%% \CYRII=I
+%% \CYRYI=Ї
+%% \CYRISHRT=Й
+%% \CYRK=К
+%% \CYRL=Л
+%% \CYRM=М
+%% \CYRN=Н
+%% \CYRO=О
+%% \CYRP=П
+%% \CYRR=Р
+%% \CYRS=С
+%% \CYRT=Т
+%% \CYRU=У
+%% \CYRF=Ф
+%% \CYRH=Х
+%% \CYRC=Ц
+%% \CYRCH=Ч
+%% \CYRSH=Ш
+%% \CYRSHCH=Щ
+%% \CYRYU=Ю
+%% \CYRYA=Я
+%% \CYRSFTSN=Ь
+%%
+%% \cyra=а
+%% \cyrb=б
+%% \cyrv=в
+%% \cyrg=г
+%% \cyrgup=ґ
+%% \cyrd=д
+%% \cyre=е
+%% \cyrie=є
+%% \cyrzh=ж
+%% \cyrz=з
+%% \cyri=и
+%% \cyrii=i
+%% \cyryi=ї
+%% \cyrishrt=й
+%% \cyrk=к
+%% \cyrl=л
+%% \cyrm=м
+%% \cyrn=н
+%% \cyro=о
+%% \cyrp=п
+%% \cyrr=р
+%% \cyrs=с
+%% \cyrt=т
+%% \cyru=у
+%% \cyrf=ф
+%% \cyrh=х
+%% \cyrc=ц
+%% \cyrch=ч
+%% \cyrsh=ш
+%% \cyrshch=щ
+%% \cyryu=ю
+%% \cyrya=я
+%% \cyrsftsn=ь
+%% ----------------------------------------------------------------
+%% Copyright 2017 Sergiy М. Ponomarenko
+%% Copyright 2011-2017 Igor A. Kotelnikov.
+%% Copyright 2000 Aleksey Novodvorsky
+%% Copyright 1995-2008 Olga Lapko.
+%% Copyright 1989-2012 Johannes L. Braams.
+%%
+%% This file is a part of the Ukrainian-Babel package.
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License (LPPL), either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in the file:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% The package is "maintained" (as per LPPL maintenance status) by
+%% Sergiy М. Ponomarenko.
+%%
+%% The package consists of the file ukraineb.dtx
+%% and the derived files ukraineb.ins,
+%% ukraineb.ldf,
+%% ukraineb.pdf,
+%% README.
+%% ----------------------------------------------------------------
+%%
+%% End of file `ukraineb.ins'.
diff --git a/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.pdf b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.pdf
new file mode 100644
index 0000000000..633972a3e3
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/ukrainian/ukraineb.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/vietnamese/README b/macros/latex/contrib/babel-contrib/vietnamese/README
new file mode 100644
index 0000000000..cf763b43e1
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/vietnamese/README
@@ -0,0 +1,12 @@
+Vietnamese Support for Babel
+============================
+
+This bundle contains the Babel support files for Vietnamese. Since version
+1.3 it supersedes the Babel support files in the VnTeX bundle.
+
+
+Version 1.4 (2015-Dec-31)
+-------------------------
+
+Javier Bezos contributed better Unicode support for XeTeX and luatex,
+avoiding a dependency on the (8-bit) T5 font encoding for those two engines.
diff --git a/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.dtx b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.dtx
new file mode 100644
index 0000000000..2ccbe89d56
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.dtx
@@ -0,0 +1,690 @@
+% \iffalse meta-comment
+%
+% Copyright 2000-2015 Werner Lemberg <wl@gnu.org>.
+% This file is part of vntex. License: LPPL, version 1.3 or newer,
+% according to http://www.latex-project.org/lppl.txt
+%
+% This file is intended to be used with the Babel system.
+% ------------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The current maintainers of this work are Werner Lemberg, Han The
+% Thanh, and Reinhard Kotucha.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%
+% vietnam.ldf
+%
+% written by Werner LEMBERG <wl@gnu.org>
+%
+% History
+%
+% 1.0 2000/09/01
+%
+% First version.
+%
+% 1.1 2001/05/26
+%
+% Moved \endlinechar downwards.
+%
+% post 1.1 ?
+%
+% Don't check for dblaccnt.sty.
+% Add support for ucs.sty.
+% Don't define \captionsvietnam but load vncaps.tex.
+%
+% 1.2 2005/04/21
+%
+% Add copyright message.
+% Minor clean-ups.
+%
+% 1.3 2013/04/14
+%
+% Renamed file.
+% Move this file from VnTeX to Babel.
+%
+% 1.4 2015/12/31
+%
+% Adapt to Unicode (Javier Bezos <listas@tex-tipografia.com>).
+%
+%<*dtx>
+\ProvidesFile{vietnamese.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{vietnamese}
+%\fi
+%\ProvidesFile{vietnamese.dtx}
+% [2015/12/31 1.4 Vietnamese support from the babel system]
+%\iffalse
+%% File `vietnamese.dtx'
+%
+% This file is part of the babel system, it provides the source
+% code for the Vietnamese language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\usepackage[utf8]{inputenc}
+\usepackage[T5]{fontenc}
+\title{The \textsf{babel} style for \textsf{Vietnamese}}
+\author{Werner Lemberg, Han The Thanh, and Reinhard Kotucha}
+\date{2015/12/31}
+\newcommand*\babel{\textsf{babel}}
+\newcommand*\langvar{$\langle \it lang \rangle$}
+\newcommand*\note[1]{}
+\newcommand*\Lopt[1]{\textsf{#1}}
+\newcommand*\file[1]{\texttt{#1}}
+\begin{document}
+ \maketitle
+ \DocInput{vietnamese.dtx}
+\end{document}
+%</filedriver>
+%\fi
+%
+% \GetFileInfo{vietnamese.dtx}
+%
+% \section{Vietnamese language support}
+%
+% This file provides definitions for the Vietnamese language. It can
+% be loaded by \textsf{babel} with either the \texttt{vietnamese} or
+% the \texttt{vietnam} option. It works with \textsf{xetex} and
+% \textsf{luatex}, as well as with 8-bit engines.
+%
+% Unicode engines don't require loading a font encoding,
+% but you may use |EU1| and |EU2|, respectively, if you want. In
+% addition, you may load the language with the modifier |licr| to have
+% access to LICR entities like |\uhook|, for example (but then
+% \textsf{fontenc} \textit{must} be loaded).
+%
+% \begin{verbatim}
+% \usepackage[vietnamese.licr]{babel}
+% \end{verbatim}
+%
+% In 8-bit engines you must use the |T5| font encoding, which always
+% defines the LICR entities. If for some reason you don't want the
+% encoding to be loaded by the package, just use the modifier
+% |noencoding|.
+%
+% \StopEventually{}
+%
+% \subsection*{The code}
+%
+% \begin{macrocode}
+%<*code>
+\LdfInit{\CurrentOption}{captions\CurrentOption}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e., by the |\usepackage|
+% command, \texttt{vietnamese} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@vietnamese| and |\l@vietnam| to see whether we
+% have to do something here.
+%
+% \begin{macrocode}
+\ifx\l@vietnamese\@undefined
+ \ifx\l@vietnam\@undefined
+ \@nopatterns{Vietnamese}
+ \adddialect\l@vietnamese 0
+ \adddialect\l@vietnam 0
+ \else
+ \chardef\l@vietnamese\l@vietnam
+ \fi
+\else
+ \ifx\l@vietnam\@undefined
+ \chardef\l@vietnam\l@vietnamese
+ \fi
+\fi
+% \end{macrocode}
+%
+% If |utf8x| (from \textsf{ucs}) is used instead of |utf8|, do
+% some additional adjustments.
+%
+% \begin{macrocode}
+\@ifpackageloaded{ucs}{%
+ \PreloadUnicodePage{0}%
+ \PreloadUnicodePage{1}%
+ \PreloadUnicodePage{30}%
+ \ifx\UnicodeCharFilter\@undefined
+ \UCSProtectionIeC
+ \else
+ \UnicodeCharFilter\IeC
+ \fi}{}
+% \end{macrocode}
+%
+% In 8-bit \TeX{} we load and set the encoding, but not
+% yet (this temporary command is redefined for Unicode engines).
+%
+% \begin{macrocode}
+\def\vn@@tempa{%
+ \@expandtwoargs\in@{,noencoding,}{,\BabelModifiers,}%
+ \ifin@\else
+ \InputIfFileExists{t5enc.def}%
+ {\message{Loading definitions for the Vietnamese font encoding}}%
+ {\errhelp{I can't find the file `t5enc.def' for Vietnamese fonts}%
+ \errmessage{%
+ Since I do not know what the T5 encoding means^^J
+ I can't typeset Vietnamese.^^J
+ I stop here, while you install the VnTeX package^^J
+ to get a suitable `t5enc.def' file}
+ \@@end}%
+ \@ifpackageloaded{inputenc}{}%
+ {\PackageWarning{babel}{No input encoding specified for
+ Vietnamese}}%
+ \fi
+ \DeclareRobustCommand{\viettext}{%
+ \fontencoding{T5}\selectfont
+ \def\encodingdefault{T5}}%
+ \let\viet\viettext
+ \DeclareTextFontCommand{\textviet}{\viet}}
+% \end{macrocode}
+%
+% \begin{macro}{\captionsvietnamese}
+% The macro |\captionsvietnamese| defines all strings used in the four
+% standard documentclasses provided with \LaTeX.
+%
+% \begin{macrocode}
+\StartBabelCommands*{vietnamese,vietnam}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+ \SetString{\prefacename}{Lời nói đầu}
+ \SetString{\refname}{Tài liệu}
+ \SetString{\abstractname}{Tóm tắt nội dung}
+ \SetString{\bibname}{Tài liệu tham khảo}
+ \SetString{\chaptername}{Chương}
+ \SetString{\appendixname}{Phụ lục}
+ \SetString{\contentsname}{Mục lục}
+ \SetString{\listfigurename}{Danh sách hình vẽ}
+ \SetString{\listtablename}{Danh sách bảng}
+ \SetString{\indexname}{Chỉ mục}
+ \SetString{\figurename}{Hình}
+ \SetString{\tablename}{Bảng}
+ \SetString{\partname}{Phần}
+ \SetString{\enclname}{Kèm theo}
+ \SetString{\ccname}{Cùng gửi}
+ \SetString{\headtoname}{Gửi}
+ \SetString{\pagename}{Trang}
+ \SetString{\seename}{Xem}
+ \SetString{\alsoname}{Xem thổm}
+ \SetString{\proofname}{Chứng minh}
+ \SetString{\glossaryname}{Từ điển chú giải}
+
+\StartBabelCommands*{vietnamese,vietnam}{date}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+ \SetString\today{Ngày \number\day\space
+ tháng \number\month\space
+ năm \number\year}
+
+\AfterBabelCommands{%
+ \def\vn@@tempa{%
+ \DeclareRobustCommand{\viettext}{}%
+ \let\viet\viettext
+ \DeclareTextFontCommand{\textviet}{\viet}%
+ \@expandtwoargs\in@{,licr,}{,\BabelModifiers,}%
+ \ifin@
+ \input{uvnenc}%
+ \fi}}
+% \end{macrocode}
+%
+% And now the generic branch, using the LICR and assuming |T5|.
+%
+% \begin{macrocode}
+\StartBabelCommands*{vietnamese,vietnam}{captions}
+ \SetString{\prefacename}{L\`\ohorn i n\'oi \dj\`\acircumflex u}%
+ \SetString{\refname}{T\`ai li\d\ecircumflex u}%
+ \SetString{\abstractname}{T\'om t\'\abreve t n\d\ocircumflex i dung}%
+ \SetString{\bibname}{T\`ai li\d\ecircumflex u tham kh\h{a}o}%
+ \SetString{\chaptername}{Ch\uhorn \ohorn ng}%
+ \SetString{\appendixname}{Ph\d{u} l\d{u}c}%
+ \SetString{\contentsname}{M\d{u}c l\d{u}c}%
+ \SetString{\listfigurename}{Danh s\'ach h\`inh v\~e}%
+ \SetString{\listtablename}{Danh s\'ach b\h{a}ng}%
+ \SetString{\indexname}{Ch\h{i} m\d{u}c}%
+ \SetString{\figurename}{H\`inh}%
+ \SetString{\tablename}{B\h{a}ng}%
+ \SetString{\partname}{Ph\`\acircumflex n}%
+ \SetString{\pagename}{Trang}%
+ \SetString{\headpagename}{Trang}%
+ \SetString{\seename}{Xem}%
+ \SetString{\alsoname}{Xem th\ecircumflex m}%
+ \SetString{\enclname}{K\`em theo}%
+ \SetString{\ccname}{C\`ung g\h\uhorn i}%
+ \SetString{\headtoname}{G\h\uhorn i}%
+ \SetString{\proofname}{Ch\'\uhorn ng minh}%
+ \SetString{\glossaryname}{T\`\uhorn{} \dj i\h\ecircumflex n ch\'u gi\h ai}
+
+\StartBabelCommands*{vietnamese,vietnam}{date}
+ \SetString\today{Ng\`ay \number\day\space
+ th\'ang \number\month\space
+ n\abreve m \number\year}
+
+\EndBabelCommands
+\vn@@tempa
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extrasvietnamese}
+% \begin{macro}{\noextrasvietnamese}
+% The macro |\extrasvietnamese| performs all the extra definitions
+% needed for the Vietnamese language. The macro |\noextrasvietnamese| is
+% used to cancel the actions of |\extrasvietnamese|.
+%
+% \begin{macrocode}
+\initiate@active@char{"}
+\declare@shorthand{\CurrentOption}{"-}{\bbl@hy@soft}
+\declare@shorthand{\CurrentOption}{"=}{\bbl@hy@hard}
+\declare@shorthand{\CurrentOption}{"|}{\discretionary{-}{}{kern.03em}}
+% \end{macrocode}
+%
+% We specify that the Vietnamese group of shorthands should be used.
+% These characters are `turned on' once; later on their definition may
+% vary. For Vietnamese texts |\frenchspacing| should be in effect. We
+% make sure this is the case and reset it if necessary.
+%
+% \begin{macrocode}
+\expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \viettext
+ \bbl@frenchspacing
+ \languageshorthands{vietnamese}%
+ \bbl@activate{"}}
+% \end{macrocode}
+%
+% We restore the encoding with |\latintext|, but this is far from
+% ideal. A better approach would be preferable.
+%
+% \begin{macrocode}
+\expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \latintext
+ \bbl@nonfrenchspacing
+ \bbl@deactivate{"}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\ldf@finish{\CurrentOption}
+%</code>
+% \end{macrocode}
+%
+% \section{LICR for Unicode}
+%
+% The file \verb|uvnenc.def| maps the LICR to the actual characters if
+% the Unicode engine is used.
+%
+% \begin{macrocode}
+%<*unilicr>
+\ProvidesFile{uvnenc.def}[2015/12/31 v1.0a Vietnamese EUx encoding]
+\ifcase\bbl@engine\or
+ \def\vn@enc{EU2}
+\or
+ \def\vn@enc{EU1}
+\fi
+\DeclareTextAccent{\h}{\vn@enc}{12}
+% \end{macrocode}
+%
+% A fake accent for the horn.
+%
+% \begin{macrocode}
+\DeclareTextCommand{\horn}{\vn@enc}[1]{\TextSymbolUnavailable{\horn{#1}}#1}
+% \end{macrocode}
+%
+% If the \textsf{dblaccnt} package is not loaded, make a dummy
+% \verb|\DeclareTextDoubleComposite|.
+%
+% \begin{macrocode}
+\ifx \DeclareTextDoubleComposite \undefined
+ \def\DeclareTextDoubleComposite#1#2#3#4#5{}
+\fi
+
+\DeclareTextComposite{\`}{\vn@enc}{A}{192} % Agrave
+\DeclareTextComposite{\'}{\vn@enc}{A}{193} % Aacute
+\DeclareTextComposite{\~}{\vn@enc}{A}{195} % Atilde
+\DeclareTextComposite{\h}{\vn@enc}{A}{7842} % Ahookabove
+\DeclareTextComposite{\d}{\vn@enc}{A}{7840} % Adotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{A}{194} % Acircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{A}{7846} % Acircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{A}{7844} % Acircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{A}{7850} % Acircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{A}{7848} % Acircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{A}{7852} % Acircumflexdotbelow
+
+\DeclareTextComposite{\u}{\vn@enc}{A}{258} % Abreve
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\u}{A}{7856} % Abrevegrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\u}{A}{7854} % Abreveacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\u}{A}{7860} % Abrevetilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\u}{A}{7858} % Abrevehookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\u}{A}{7862} % Abrevedotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{E}{200} % Egrave
+\DeclareTextComposite{\'}{\vn@enc}{E}{201} % Eacute
+\DeclareTextComposite{\~}{\vn@enc}{E}{7868} % Etilde
+\DeclareTextComposite{\h}{\vn@enc}{E}{7866} % Ehookabove
+\DeclareTextComposite{\d}{\vn@enc}{E}{7864} % Edotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{E}{202} % Ecircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{E}{7872} % Ecircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{E}{7870} % Ecircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{E}{7876} % Ecircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{E}{7874} % Ecircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{E}{7878} % Ecircumflexdotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{I}{416} % Igrave
+\DeclareTextComposite{\'}{\vn@enc}{I}{7900} % Iacute
+\DeclareTextComposite{\~}{\vn@enc}{I}{296} % Itilde
+\DeclareTextComposite{\h}{\vn@enc}{I}{7880} % Ihookabove
+\DeclareTextComposite{\d}{\vn@enc}{I}{7882} % Idotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{O}{217} % Ograve
+\DeclareTextComposite{\'}{\vn@enc}{O}{218} % Oacute
+\DeclareTextComposite{\~}{\vn@enc}{O}{7910} % Otilde
+\DeclareTextComposite{\h}{\vn@enc}{O}{7886} % Ohookabove
+\DeclareTextComposite{\d}{\vn@enc}{O}{7884} % Odotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{O}{360} % Ocircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{O}{7890} % Ocircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{O}{7888} % Ocircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{O}{7894} % Ocircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{O}{7892} % Ocircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{O}{7896} % Ocircumflexdotbelow
+
+\DeclareTextComposite{\horn}{\vn@enc}{O}{416} % Ohorn
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\horn}{O}{7900} % Ohorngrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\horn}{O}{7898} % Ohornacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\horn}{O}{7904} % Ohorntilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\horn}{O}{7902} % Ohornhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\horn}{O}{7906} % Ohorndotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{U}{217} % Ugrave
+\DeclareTextComposite{\'}{\vn@enc}{U}{218} % Uacute
+\DeclareTextComposite{\~}{\vn@enc}{U}{360} % Utilde
+\DeclareTextComposite{\h}{\vn@enc}{U}{7910} % Uhookabove
+\DeclareTextComposite{\d}{\vn@enc}{U}{7908} % Udotbelow
+
+\DeclareTextComposite{\horn}{\vn@enc}{U}{431} % Uhorn
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\horn}{U}{7914} % Uhorngrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\horn}{U}{7912} % Uhornacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\horn}{U}{7918} % Uhorntilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\horn}{U}{7916} % Uhornhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\horn}{U}{7920} % Uhorndotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{Y}{7922} % Ygrave
+\DeclareTextComposite{\'}{\vn@enc}{Y}{221} % Yacute
+\DeclareTextComposite{\~}{\vn@enc}{Y}{7928} % Ytilde
+\DeclareTextComposite{\h}{\vn@enc}{Y}{26} % Yhookabove
+\DeclareTextComposite{\d}{\vn@enc}{Y}{28} % Ydotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{a}{7883} % agrave
+\DeclareTextComposite{\'}{\vn@enc}{a}{242} % aacute
+\DeclareTextComposite{\~}{\vn@enc}{a}{245} % atilde
+\DeclareTextComposite{\h}{\vn@enc}{a}{7843} % ahookabove
+\DeclareTextComposite{\d}{\vn@enc}{a}{7841} % adotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{a}{243} % acircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{a}{7847} % acircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{a}{7845} % acircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{a}{7851} % acircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{a}{7849} % acircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{a}{7853} % acircumflexdotbelow
+
+\DeclareTextComposite{\u}{\vn@enc}{a}{259} % abreve
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\u}{a}{7857} % abrevegrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\u}{a}{7855} % abreveacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\u}{a}{7861} % abrevetilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\u}{a}{7859} % abrevehookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\u}{a}{7863} % abrevedotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{e}{7889} % egrave
+\DeclareTextComposite{\'}{\vn@enc}{e}{7895} % eacute
+\DeclareTextComposite{\~}{\vn@enc}{e}{7869} % etilde
+\DeclareTextComposite{\h}{\vn@enc}{e}{7867} % ehookabove
+\DeclareTextComposite{\d}{\vn@enc}{e}{7865} % edotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{e}{7893} % ecircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{e}{7873} % ecircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{e}{7871} % ecircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{e}{7877} % ecircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{e}{7875} % ecircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{e}{7879} % ecircumflexdotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{i}{417} % igrave
+\DeclareTextComposite{\'}{\vn@enc}{i}{7901} % iacute
+\DeclareTextComposite{\~}{\vn@enc}{i}{297} % itilde
+\DeclareTextComposite{\h}{\vn@enc}{i}{7881} % ihookabove
+\DeclareTextComposite{\d}{\vn@enc}{i}{7883} % idotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{\i}{417} % igrave
+\DeclareTextComposite{\'}{\vn@enc}{\i}{7901} % iacute
+\DeclareTextComposite{\~}{\vn@enc}{\i}{297} % itilde
+\DeclareTextComposite{\h}{\vn@enc}{\i}{7881} % ihookabove
+\DeclareTextComposite{\d}{\vn@enc}{\i}{7883} % idotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{o}{242} % ograve
+\DeclareTextComposite{\'}{\vn@enc}{o}{243} % oacute
+\DeclareTextComposite{\~}{\vn@enc}{o}{245} % otilde
+\DeclareTextComposite{\h}{\vn@enc}{o}{7887} % ohookabove
+\DeclareTextComposite{\d}{\vn@enc}{o}{7885} % odotbelow
+
+\DeclareTextComposite{\^}{\vn@enc}{o}{244} % ocircumflex
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\^}{o}{7891} % ocircumflexgrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\^}{o}{7889} % ocircumflexacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\^}{o}{7895} % ocircumflextilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\^}{o}{7893} % ocircumflexhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\^}{o}{7897} % ocircumflexdotbelow
+
+\DeclareTextComposite{\horn}{\vn@enc}{o}{417} % ohorn
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\horn}{o}{7901} % ohorngrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\horn}{o}{7899} % ohornacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\horn}{o}{7905} % ohorntilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\horn}{o}{7903} % ohornhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\horn}{o}{7907} % ohorndotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{u}{7913} % ugrave
+\DeclareTextComposite{\'}{\vn@enc}{u}{250} % uacute
+\DeclareTextComposite{\~}{\vn@enc}{u}{361} % utilde
+\DeclareTextComposite{\h}{\vn@enc}{u}{7911} % uhookabove
+\DeclareTextComposite{\d}{\vn@enc}{u}{7909} % udotbelow
+
+\DeclareTextComposite{\horn}{\vn@enc}{u}{432} % uhorn
+\DeclareTextDoubleComposite{\`}{\vn@enc}{\horn}{u}{7915} % uhorngrave
+\DeclareTextDoubleComposite{\'}{\vn@enc}{\horn}{u}{7913} % uhornacute
+\DeclareTextDoubleComposite{\~}{\vn@enc}{\horn}{u}{7919} % uhorntilde
+\DeclareTextDoubleComposite{\h}{\vn@enc}{\horn}{u}{7917} % uhornhookabove
+\DeclareTextDoubleComposite{\d}{\vn@enc}{\horn}{u}{7921} % uhorndotbelow
+
+\DeclareTextComposite{\`}{\vn@enc}{y}{7923} % ygrave
+\DeclareTextComposite{\'}{\vn@enc}{y}{253} % yacute
+\DeclareTextComposite{\~}{\vn@enc}{y}{7929} % ytilde
+\DeclareTextComposite{\h}{\vn@enc}{y}{27} % yhookabove
+\DeclareTextComposite{\d}{\vn@enc}{y}{29} % ydotbelow
+
+\DeclareTextSymbol{\DJ}{\vn@enc}{30} % Dcroat
+\DeclareTextSymbol{\dj}{\vn@enc}{31} % dcroat
+
+
+% For compatibility with ET5.
+
+\DeclareTextSymbol{\Acircumflex}{\vn@enc}{194} % Acircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\Acircumflex}{7846} % Acircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\Acircumflex}{7844} % Acircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\Acircumflex}{7850} % Acircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\Acircumflex}{7848} % Acircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Acircumflex}{7852} % Acircumflexdotbelow
+
+\DeclareTextSymbol{\Abreve}{\vn@enc}{258} % Abreve
+\DeclareTextComposite{\`}{\vn@enc}{\Abreve}{7856} % Abrevegrave
+\DeclareTextComposite{\'}{\vn@enc}{\Abreve}{7854} % Abreveacute
+\DeclareTextComposite{\~}{\vn@enc}{\Abreve}{7860} % Abrevetilde
+\DeclareTextComposite{\h}{\vn@enc}{\Abreve}{7858} % Abrevehookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Abreve}{7862} % Abrevedotbelow
+
+\DeclareTextSymbol{\Ecircumflex}{\vn@enc}{202} % Ecircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\Ecircumflex}{7872} % Ecircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\Ecircumflex}{7870} % Ecircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\Ecircumflex}{7876} % Ecircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\Ecircumflex}{7874} % Ecircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Ecircumflex}{7878} % Ecircumflexdotbelow
+
+\DeclareTextSymbol{\Ocircumflex}{\vn@enc}{360} % Ocircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\Ocircumflex}{7890} % Ocircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\Ocircumflex}{7888} % Ocircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\Ocircumflex}{7894} % Ocircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\Ocircumflex}{7892} % Ocircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Ocircumflex}{7896} % Ocircumflexdotbelow
+
+\DeclareTextSymbol{\Ohorn}{\vn@enc}{416} % Ohorn
+\DeclareTextComposite{\`}{\vn@enc}{\Ohorn}{7900} % Ohorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\Ohorn}{7898} % Ohornacute
+\DeclareTextComposite{\~}{\vn@enc}{\Ohorn}{7904} % Ohorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\Ohorn}{7902} % Ohornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Ohorn}{7906} % Ohorndotbelow
+
+\DeclareTextSymbol{\Uhorn}{\vn@enc}{431} % Uhorn
+\DeclareTextComposite{\`}{\vn@enc}{\Uhorn}{7914} % Uhorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\Uhorn}{7912} % Uhornacute
+\DeclareTextComposite{\~}{\vn@enc}{\Uhorn}{7918} % Uhorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\Uhorn}{7916} % Uhornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\Uhorn}{7920} % Uhorndotbelow
+
+\DeclareTextSymbol{\acircumflex}{\vn@enc}{243} % acircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\acircumflex}{7847} % acircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\acircumflex}{7845} % acircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\acircumflex}{7851} % acircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\acircumflex}{7849} % acircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\acircumflex}{7853} % acircumflexdotbelow
+
+\DeclareTextSymbol{\abreve}{\vn@enc}{259} % abreve
+\DeclareTextComposite{\`}{\vn@enc}{\abreve}{7857} % abrevegrave
+\DeclareTextComposite{\'}{\vn@enc}{\abreve}{7855} % abreveacute
+\DeclareTextComposite{\~}{\vn@enc}{\abreve}{7861} % abrevetilde
+\DeclareTextComposite{\h}{\vn@enc}{\abreve}{7859} % abrevehookabove
+\DeclareTextComposite{\d}{\vn@enc}{\abreve}{7863} % abrevedotbelow
+
+\DeclareTextSymbol{\ecircumflex}{\vn@enc}{7893} % ecircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\ecircumflex}{7873} % ecircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\ecircumflex}{7871} % ecircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\ecircumflex}{7877} % ecircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\ecircumflex}{7875} % ecircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ecircumflex}{7879} % ecircumflexdotbelow
+
+\DeclareTextSymbol{\ocircumflex}{\vn@enc}{244} % ocircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\ocircumflex}{7891} % ocircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\ocircumflex}{7889} % ocircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\ocircumflex}{7895} % ocircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\ocircumflex}{7893} % ocircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ocircumflex}{7897} % ocircumflexdotbelow
+
+\DeclareTextSymbol{\ohorn}{\vn@enc}{417} % ohorn
+\DeclareTextComposite{\`}{\vn@enc}{\ohorn}{7901} % ohorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\ohorn}{7899} % ohornacute
+\DeclareTextComposite{\~}{\vn@enc}{\ohorn}{7905} % ohorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\ohorn}{7903} % ohornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ohorn}{7907} % ohorndotbelow
+
+\DeclareTextSymbol{\uhorn}{\vn@enc}{432} % uhorn
+\DeclareTextComposite{\`}{\vn@enc}{\uhorn}{7915} % uhorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\uhorn}{7913} % uhornacute
+\DeclareTextComposite{\~}{\vn@enc}{\uhorn}{7919} % uhorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\uhorn}{7917} % uhornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\uhorn}{7921} % uhorndotbelow
+
+% Make these ugly names still valid (needed for use with utf8).
+
+\DeclareTextSymbol{\ACIRCUMFLEX}{\vn@enc}{194} % Acircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\ACIRCUMFLEX}{7846} % Acircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\ACIRCUMFLEX}{7844} % Acircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\ACIRCUMFLEX}{7850} % Acircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\ACIRCUMFLEX}{7848} % Acircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ACIRCUMFLEX}{7852} % Acircumflexdotbelow
+
+\DeclareTextSymbol{\ABREVE}{\vn@enc}{258} % Abreve
+\DeclareTextComposite{\`}{\vn@enc}{\ABREVE}{7856} % Abrevegrave
+\DeclareTextComposite{\'}{\vn@enc}{\ABREVE}{7854} % Abreveacute
+\DeclareTextComposite{\~}{\vn@enc}{\ABREVE}{7860} % Abrevetilde
+\DeclareTextComposite{\h}{\vn@enc}{\ABREVE}{7858} % Abrevehookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ABREVE}{7862} % Abrevedotbelow
+
+\DeclareTextSymbol{\ECIRCUMFLEX}{\vn@enc}{202} % Ecircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\ECIRCUMFLEX}{7872} % Ecircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\ECIRCUMFLEX}{7870} % Ecircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\ECIRCUMFLEX}{7876} % Ecircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\ECIRCUMFLEX}{7874} % Ecircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\ECIRCUMFLEX}{7878} % Ecircumflexdotbelow
+
+\DeclareTextSymbol{\OCIRCUMFLEX}{\vn@enc}{360} % Ocircumflex
+\DeclareTextComposite{\`}{\vn@enc}{\OCIRCUMFLEX}{7890} % Ocircumflexgrave
+\DeclareTextComposite{\'}{\vn@enc}{\OCIRCUMFLEX}{7888} % Ocircumflexacute
+\DeclareTextComposite{\~}{\vn@enc}{\OCIRCUMFLEX}{7894} % Ocircumflextilde
+\DeclareTextComposite{\h}{\vn@enc}{\OCIRCUMFLEX}{7892} % Ocircumflexhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\OCIRCUMFLEX}{7896} % Ocircumflexdotbelow
+
+\DeclareTextSymbol{\OHORN}{\vn@enc}{416} % Ohorn
+\DeclareTextComposite{\`}{\vn@enc}{\OHORN}{7900} % Ohorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\OHORN}{7898} % Ohornacute
+\DeclareTextComposite{\~}{\vn@enc}{\OHORN}{7904} % Ohorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\OHORN}{7902} % Ohornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\OHORN}{7906} % Ohorndotbelow
+
+\DeclareTextSymbol{\UHORN}{\vn@enc}{431} % Uhorn
+\DeclareTextComposite{\`}{\vn@enc}{\UHORN}{7914} % Uhorngrave
+\DeclareTextComposite{\'}{\vn@enc}{\UHORN}{7912} % Uhornacute
+\DeclareTextComposite{\~}{\vn@enc}{\UHORN}{7918} % Uhorntilde
+\DeclareTextComposite{\h}{\vn@enc}{\UHORN}{7916} % Uhornhookabove
+\DeclareTextComposite{\d}{\vn@enc}{\UHORN}{7920} % Uhorndotbelow
+% \end{macrocode}
+%
+% Finally, we extend \verb|\@uclclist| to make
+% \verb|\MakeUppercase| and \verb|\MakeLowercase| work
+% correctly. This case mapping is ``global'' and directly related
+% to the encoding and the LICR, so we don't use \verb|\SetCase|,
+% which is intended for small readjustments required by a certain
+% language.
+%
+% \begin{macrocode}
+\expandafter\def\expandafter\@uclclist\expandafter{%
+ \@uclclist
+ \abreve\Abreve
+ \abreve\ABREVE
+ \acircumflex\Acircumflex
+ \acircumflex\ACIRCUMFLEX
+ \dj\DJ
+ \ecircumflex\Ecircumflex
+ \ecircumflex\ECIRCUMFLEX
+ \ocircumflex\Ocircumflex
+ \ocircumflex\OCIRCUMFLEX
+ \ohorn\Ohorn
+ \ohorn\OHORN
+ \uhorn\Uhorn
+ \uhorn\UHORN}
+\endinput
+%</unilicr>
+% \end{macrocode}
+% \Finale
+%%
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.ins b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.ins
new file mode 100644
index 0000000000..a0f34bb891
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.ins
@@ -0,0 +1,132 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2015 Werner Lemberg and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is intended to be used with the Babel system.
+%% ------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Werner Lemberg.
+%%
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{2015/12/31}
+\def\batchfile{vietnamese.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 2015 Werner Lemberg and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Werner Lemberg.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 2015 Werner Lemberg and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file is intended to be used with the Babel system.
+------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Werner Lemberg.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\askforoverwritefalse
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{
+ \file{vietnamese.ldf}{\from{vietnamese.dtx}{code}}
+ \file{uvnenc.tex}{\from{vietnamese.dtx}{unilicr}}}
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.pdf b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.pdf
new file mode 100644
index 0000000000..f68a91bb5b
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/vietnamese/vietnamese.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/welsh/README b/macros/latex/contrib/babel-contrib/welsh/README
new file mode 100644
index 0000000000..65ac842dc9
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/welsh/README
@@ -0,0 +1,12 @@
+Welsh 1.1a
+------------
+
+This is the babel style for Welsh.
+
+Changes 1.1
+-----------
+* Date fixed
+* UTF-8 encoded strings for XeTeX and LuaTeX
+
+----------
+2015-09-03 \ No newline at end of file
diff --git a/macros/latex/contrib/babel-contrib/welsh/welsh.dtx b/macros/latex/contrib/babel-contrib/welsh/welsh.dtx
new file mode 100644
index 0000000000..d39ced6622
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/welsh/welsh.dtx
@@ -0,0 +1,215 @@
+% \iffalse meta-comment
+%
+% Copyright 1989-2015 Johannes L. Braams, Javier Bezos and any
+% individual authors listed elsewhere in this file. All rights
+% reserved.
+%
+% This file is part of the Babel system.
+% --------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Javier Bezos
+%
+% The list of all files belonging to the Babel system is
+% given in the file `manifest.bbl. See also `legal.bbl' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+% \fi
+% \CheckSum{81}
+%
+% \iffalse
+% Tell the \LaTeX\ system who we are and write an entry on the
+% transcript.
+%<*dtx>
+\ProvidesFile{welsh.dtx}
+%</dtx>
+%<code>\ProvidesLanguage{welsh}
+%\fi
+%\ProvidesFile{welsh.dtx}
+ [2015/09/03 v1.1a Welsh support from the babel system]
+%\iffalse
+%% File `welsh.dtx'
+%% Babel package for LaTeX version 2e
+%% Copyright (C) 1989 -- 2015
+%% by Johannes Braams, TeXniek
+% by Javier Bezos
+%
+% This file is part of the babel system, it provides the source
+% code for the Welsh language definition file.
+%<*filedriver>
+\documentclass{ltxdoc}
+\newcommand*{\TeXhax}{\TeX hax}
+\newcommand*{\babel}{\textsf{babel}}
+\newcommand*{\langvar}{$\langle \mathit lang \rangle$}
+\newcommand*{\note}[1]{}
+\newcommand*{\Lopt}[1]{\textsf{#1}}
+\newcommand*{\file}[1]{\texttt{#1}}
+\begin{document}
+ \DocInput{welsh.dtx}
+\end{document}
+%</filedriver>
+%\fi
+% \GetFileInfo{welsh.dtx}
+%
+% \section{The Welsh language}
+%
+% The file \file{\filename}\footnote{The file described in this
+% section has version number \fileversion\ and was last revised on
+% \filedate.} defines all the language definition macros for the
+% Welsh language.
+%
+% For this language currently no special definitions are needed or
+% available.
+%
+% \StopEventually{}
+%
+% \section{Code}
+%
+% The macro |\ldf@init| takes care of preventing that this file is
+% loaded more than once, checking the category code of the
+% \texttt{@} sign, etc.
+% \begin{macrocode}
+%<*code>
+\LdfInit{welsh}{captionswelsh}
+% \end{macrocode}
+%
+% When this file is read as an option, i.e. by the |\usepackage|
+% command, \texttt{welsh} could be an `unknown' language in
+% which case we have to make it known. So we check for the
+% existence of |\l@welsh| to see whether we have to do
+% something here.
+%
+% \begin{macrocode}
+\ifx\undefined\l@welsh
+ \@nopatterns{welsh}
+ \adddialect\l@welsh0\fi
+% \end{macrocode}
+% The next step consists of defining commands to switch to (and
+% from) the Welsh language.
+%
+% \begin{macro}{\welshhyphenmins}
+% This macro is used to store the correct values of the hyphenation
+% parameters |\lefthyphenmin| and |\righthyphenmin|.
+% \changes{welsh-1.0c}{2000/09/22}{Now use \cs{providehyphenmins} to
+% provide a default value}
+% \begin{macrocode}
+\providehyphenmins{\CurrentOption}{\tw@\thr@@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\captionswelsh}
+% The macro |\captionswelsh| defines all strings used in the
+% four standard documentclasses provided with \LaTeX.
+% \changes{welsh-1.0c}{2000/09/20}{Added \cs{glossaryname}}
+% \changes{welsh-1.0d}{2005/03/31}{Provided the translation for
+% Glossary}
+% \begin{macro}{\datewelsh}
+% The macro |\datewelsh| redefines the command |\today| to
+% produce welsh dates.
+% \changes{welsh-1.0b}{1997/10/01}{Use \cs{edef} to define
+% \cs{today} to save memory}
+% \changes{welsh-1.0b}{1998/03/28}{use \cs{def} instead of
+% \cs{edef}}
+% \changes{welsh-1.0d}{2005/03/31}{removed `a viz' from the definition
+% of \cs{today}}
+% \changes{welsh-1.1a}{2015/09/03}{Strings are defined in the 3.9 way.
+% Also Unicode strings}
+% \begin{macrocode}
+\StartBabelCommands*{welsh}{captions}
+ [unicode, charset=utf8, fontenc=EU1 EU2]
+ \SetString{\enclname}{amgaeëdig}
+ \SetString{\ccname}{copï au}
+% \end{macrocode}
+%
+% And now, the generic branch, using the LICR and assuming T1.
+%
+% \begin{macrocode}
+\StartBabelCommands*{welsh}{captions}
+ \SetString{\prefacename}{Rhagair}
+ \SetString{\refname}{Cyfeiriadau}
+ \SetString{\abstractname}{Crynodeb}
+ \SetString{\bibname}{Llyfryddiaeth}
+ \SetString{\chaptername}{Pennod}
+ \SetString{\appendixname}{Atodiad}
+ \SetString{\contentsname}{Cynnwys}
+ \SetString{\listfigurename}{Rhestr Ddarluniau}
+ \SetString{\listtablename}{Rhestr Dablau}
+ \SetString{\indexname}{Mynegai}
+ \SetString{\figurename}{Darlun}
+ \SetString{\tablename}{Taflen}
+ \SetString{\partname}{Rhan}
+ \SetString{\enclname}{amgae\"edig}
+ \SetString{\ccname}{cop\"\i au}
+ \SetString{\headtoname}{At}
+ \SetString{\pagename}{tudalen}
+ \SetString{\seename}{gweler}
+ \SetString{\alsoname}{gweler hefyd}
+ \SetString{\proofname}{Prawf}
+ \SetString{\glossaryname}{Rhestr termau}
+\StartBabelCommands*{welsh}{date}
+ \SetStringLoop{month#1name}{%
+ Ionawr,Chwefror,Mawrth,Ebrill,Mai,Mehefin,%
+ Gorffennaf,Awst,Medi,Hydref,Tachwedd,Rhagfyr}
+ \SetString\today{%
+ {\number\day} \@nameuse{month\romannumeral\month name} {\number\year}}
+\EndBabelCommands
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\extraswelsh}
+% \begin{macro}{\noextraswelsh}
+% The macro |\extraswelsh| will perform all the extra
+% definitions needed for the welsh language. The macro
+% |\noextraswelsh| is used to cancel the actions of
+% |\extraswelsh|. For the moment these macros are empty but
+% they are defined for compatibility with the other
+% language definition files.
+%
+% \begin{macrocode}
+\addto\extraswelsh{}
+\addto\noextraswelsh{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The macro |\ldf@finish| takes care of looking for a
+% configuration file, setting the main language to be switched on
+% at |\begin{document}| and resetting the category code of
+% \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish{welsh}
+\endinput
+%</code>
+% \end{macrocode}
+%
+% \Finale
+%\endinput
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/welsh/welsh.ins b/macros/latex/contrib/babel-contrib/welsh/welsh.ins
new file mode 100644
index 0000000000..a807ec6272
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/welsh/welsh.ins
@@ -0,0 +1,148 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 1989-2005 Johannes L. Braams and any individual authors
+%% listed elsewhere in this file. All rights reserved.
+%%
+%% This file is part of the Babel system.
+%% --------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Johannes Braams.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.bbl. See also `legal.bbl' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\filedate{1999/04/11}
+\def\batchfile{welsh.ins}
+\input docstrip.tex
+
+{\ifx\generate\undefined
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* This installation requires docstrip}
+\Msg{* version 2.3c or later.}
+\Msg{*}
+\Msg{* An older version of docstrip has been input}
+\Msg{*}
+\Msg{**********************************************}
+\errhelp{Move or rename old docstrip.tex.}
+\errmessage{Old docstrip in input path}
+\batchmode
+\csname @@end\endcsname
+\fi}
+
+\declarepreamble\mainpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+The list of derived (unpacked) files belonging to the distribution
+and covered by LPPL is defined by the unpacking scripts (with
+extension .ins) which are part of the distribution.
+\endpreamble
+
+\declarepreamble\fdpreamble
+This is a generated file.
+
+Copyright 1989-2005 Johannes L. Braams and any individual authors
+listed elsewhere in this file. All rights reserved.
+
+This file was generated from file(s) of the Babel system.
+---------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Johannes Braams.
+
+This file may only be distributed together with a copy of the Babel
+system. You may however distribute the Babel system without
+such generated files.
+
+The list of all files belonging to the Babel distribution is
+given in the file `manifest.bbl'. See also `legal.bbl for additional
+information.
+
+In particular, permission is granted to customize the declarations in
+this file to serve the needs of your installation.
+
+However, NO PERMISSION is granted to distribute a modified version
+of this file under its original name.
+
+\endpreamble
+
+\keepsilent
+
+\usedir{tex/generic/babel}
+
+\usepreamble\mainpreamble
+\generate{\file{welsh.ldf}{\from{welsh.dtx}{code}}
+ }
+\usepreamble\fdpreamble
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/babel-contrib/welsh/welsh.pdf b/macros/latex/contrib/babel-contrib/welsh/welsh.pdf
new file mode 100644
index 0000000000..fcac31cc60
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/welsh/welsh.pdf
Binary files differ