Babel, a Multilingual Package for Use with LATEX's Standard Document
Total Page:16
File Type:pdf, Size:1020Kb
Babel, a multilingual package for use with LATEX’s standard document classes∗ Johannes Braams Kersengaarde 33 2723 BP Zoetermeer The Netherlands [email protected] Printed May 28, 2005 Abstract The standard distribution of LATEX contains a number of document classes that are meant to be used, but also serve as examples for other users to create their own document classes. These document classes have become very popular among LATEX users. But it should be kept in mind that they were designed for American tastes and typography. At one time they contained a number of hard-wired texts. This report describes babel, a package that makes use of the new capabilities of TEX version 3 to pro- vide an environment in which documents can be typeset in a non-American language, or in more than one language. Contents core of babel and the lan- guage definition files 11 1 The user interface 5 6.1 Support for active char- 1.1 Languages supported by acters . 13 Babel ............ 6 6.2 Support for saving macro 1.2 Workarounds . 7 definitions . 13 2 Changes for LATEX 2ε 7 6.3 Support for extending macros . 14 3 Changes in Babel version 3.7 8 6.4 Macros common to a number of languages . 14 4 Changes in Babel version 3.6 9 5 Changes in Babel version 3.5 10 7 Compatibility with german.sty 14 6 The interface between the 8 Compatibility with ngerman.sty 15 ∗During the development ideas from Nico Poppelier, Piet van Oostrum and many others have been used. Bernd Raichle has provided many helpful suggestions. 1 9 Compatibility with the 15 Conclusion 80 french package 15 16 Acknowledgements 80 10 Identification 15 17 The Esperanto language 81 11 The Package File 16 11.1 Language options . 16 18 The Interlingua language 84 12 The Kernel of Babel 20 19 The Dutch language 86 12.1 Encoding issues (part 1) . 21 12.2 Multiple languages . 21 20 The English language 91 12.3 Support for active char- acters . 37 21 The German language 96 12.4 Shorthands . 38 12.5 Language attributes . 49 22 The German language – new 12.6 Support for saving macro orthography 101 definitions . 52 12.7 Support for extending 23 The Breton language 105 macros . 53 12.8 Macros common to a 24 The Welsh language 109 number of languages . 54 12.9 Making glyphs available . 55 25 The Irish language 111 12.10Quotation marks . 55 12.11Letters . 56 26 The Scottish language 113 12.12Shorthands for quotation marks . 57 27 The Greek language 115 12.13Umlauts and trema’s . 59 27.1 Typing conventions . 115 12.14The redefinition of the 27.2 Greek numbering . 115 style commands . 60 12.14.1 Redefinition of 28 The French language 125 macros . 61 12.15Cross referencing macros . 65 29 TEXnical details 135 12.16marks . 70 29.1 Initial setup . 135 12.17Encoding issues (part 2) . 71 29.2 Caption names . 138 12.18Preventing clashes with 29.3 Punctuation . 140 other packages . 71 29.4 French quotation marks . 142 12.18.1 ifthen . 71 29.5 French lists . 144 12.18.2 varioref . 72 29.6 French indentation of 12.18.3 hhline . 73 sections . 147 12.18.4 General . 73 29.7 Formatting footnotes . 147 29.8 Formatting numbers . 148 13 Local Language Configura- tion 74 29.9 Dots. 152 29.10Global layout . 152 14 Driver files for the docu- 29.11Extra utilities . 153 mented source code 76 29.12Date and clean up . 157 2 30 The Italian language 158 46 The Hungarian language 255 30.1 Support for etymological hyphenation . 161 47 The Estonian language 274 30.2 Facilities required by the 47.1 Implementation . 275 ISO 31/XI regulations . 163 30.3 Accents . 164 48 The Croatian language 279 30.4 Caporali or French dou- 49 The Czech language 281 ble quotes . 165 30.5 Finishing commands . 168 50 The Polish language 284 31 The Latin language 169 51 The Serbocroatian language290 32 Latin shortcuts 173 52 The Slovak language 294 33 Etymological hyphenation 175 53 The Slovenian language 299 34 The Portuguese language 178 54 The Russian language 302 35 The Spanish language 183 55 The Bulgarian language 317 35.1 The Code . 185 56 The Ukrainian language 330 36 The Catalan language 206 57 The Lower Sorbian lan- 37 The Galician language 214 guage 345 38 The Basque language 219 58 The Upper Sorbian lan- guage 347 39 The Romanian language 223 59 The Turkish language 351 40 The Danish language 225 60 The Hebrew language 354 41 The Icelandic language 228 60.1 Acknowledgement . 354 41.1 Overview . 228 60.2 The docstrip modules . 355 41.2 TEXnical details . 229 60.3 Hebrew language defini- 41.3 Captionnames and date . 231 tions . 355 41.4 Icelandic quotation marks 231 60.3.1 Hebrew numerals . 359 41.5 Old Icelandic . 232 60.4 Right to left support . 367 41.6 Formatting numbers . 233 60.4.1 Switching from 41.7 Extra utilities . 235 LR to RL mode and back . 367 42 The Norwegian language 238 60.4.2 Counters . 371 43 The Swedish language 243 60.4.3 Preserving logos . 372 60.4.4 List environments 372 44 The North Sami language 248 60.4.5 Tables of moving 44.1 The code of samin.dtx . 248 stuff . 373 60.4.6 Two-column mode 378 45 The Finnish language 251 60.4.7 Footnotes . 379 3 60.4.8 Headings and 62.4.5 Hebrew shalom two-side support . 379 fonts . 415 60.4.9 Postscript Porblems383 62.4.6 Hebrew frank- 60.4.10 Miscellaneous in- ruehl font . 415 ternal LATEX macros384 62.4.7 Hebrew carmel font 416 60.4.11 Bibliography and 62.4.8 Hebrew redis font . 417 citations . 386 62.5 The HE8encoding defini- 60.4.12 Additional bidi- tion file . 418 rectional commands388 62.5.1 CHECK HERE 60.5 Hebrew calendar . 389 FOR HE8 UP- 60.5.1 Introduction . 390 DATES . 418 62.6 The font definition files 60.5.2 Registers, Com- (in HE8 encoding) . 420 mands, Format- 62.6.1 Hebrew default font420 ting Macros . 391 62.6.2 Hebrew sans-serif 60.5.3 Auxiliary Macros . 394 font . 420 60.5.4 Gregorian Part . 394 62.6.3 Hebrew type- 60.5.5 Hebrew Part . 396 writer font . 421 62.6.4 8Bit OmegaHe- 61 Hebrew input encodings 400 brew font . 421 61.1 Default definitions for 62.6.5 8Bit Aharoni font 422 characters . 402 62.6.6 8Bit David font . 422 61.2 The SI-960 encoding . 403 62.6.7 8Bit Drugulin font 422 61.3 The ISO 8859-8 encod- 62.6.8 8Bit Ellinia font . 423 ing and the MS Windows 62.6.9 8Bit FrankRuehl cp1255 encoding . 403 font . 423 61.4 The IBM code page 862 . 406 62.6.10 8Bit KtavYad font 423 62.6.11 8Bit Miri- 62 Hebrew font encodings 408 amMono font . 424 62.1 THIS SECTION IS OUT 62.6.12 8Bit Nachlieli font 424 OF DATE. UPDATE 62.6.13 Hebrew font DOCS TO MATCH HE8 switching com- ENCODING . 408 mands . 424 62.2 The docstrip modules . 409 62.3 The LHEencoding defini- 63 Hebrew in LATEX 2.09 com- tion file . 411 patibility mode 427 62.4 The font definition files 63.1 The docstrip modules . 428 (in LHE encoding) . 412 63.2 Obsolete style files . 428 62.4.1 Hebrew default font412 64 The Bahasa language 429 62.4.2 Hebrew sans-serif font . 413 65 Not renaming hyphen.tex 431 62.4.3 Hebrew type- writer font . 413 66 Support for formats based 62.4.4 Hebrew classic font 414 on plainTEX 432 4 1 The user interface The user interface of this package is quite simple. It consists of a set of commands that switch from one language to another, and a set of commands that deal with shorthands. It is also possible to find out what the current language is. \selectlanguage When a user wants to switch from one language to another he can do so using the macro \selectlanguage. This macro takes the language, defined previously by a language definition file, as its argument. It calls several macros that should be defined in the language definition files to activate the special definitions for the language chosen. otherlanguage The environment otherlanguage does basically the same as \selectlanguage, except the language change is local to the environment. This environment is re- quired for intermixing left-to-right typesetting with right-to-left typesetting. The language to switch to is specified as an argument to \begin{otherlanguage}. \foreignlanguage The command \foreignlanguage takes two arguments; the second argument is a phrase to be typeset according to the rules of the language named in its first argument. This command only switches the extra definitions and the hyphenation rules for the language, not the names and dates. otherlanguage* In the environment otherlanguage* only the typesetting is done according to the rules of the other language, but the text-strings such as ‘figure’, ‘table’, etc. are left as they were set outside this environment. hyphenrules The environment hyphenrules can be used to select only the hyphenation rules to be used. This can for instance be used to select ‘nohyphenation’, pro- vided that in language.dat the ‘language’ nohyphenation is defined by loading serohyph.tex. \languagename The control sequence \languagename contains the name of the current lan- guage. \iflanguage If more than one language is used, it might be necessary to know which lan- guage is active at a specific time.