Babel, a multilingual package for use with L^{A}TEX’s standard document classes^{∗}

Johannes Braams Kersengaarde 33 2723 BP Zoetermeer The Netherlands

                   JLBraams@cistron.nl

Printed 22nd February 2001

Abstract The standard distribution of L^{A}TEX 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 L^{A}TEX 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 provide an environment in which documents can be typeset in a non-american language or in more than one language.

Contents

1 The user interface 4

1.1 Languages supported by

Babel . . . . . . . . . . . . 5 1.2 Workarounds . . . . . . . 6

2 Changes for L^{A}TEX 2ε 7

3 Changes in Babel version 3.7 7

4 Changes in Babel version 3.6 8

5 Changes in Babel version 3.5 9

6 The interface between the core of babel and the language definition files 10 6.1 Support for active char-

acters . . . . . . . . . . . 12 6.2 Support for saving macro

definitions . . . . . . . . . 12 6.3 Support for extending

macros . . . . . . . . . . . 12 6.4 Macros common to a

number of languages … 13

7 Compatibility with german.sty 13

8 Compatibility with ngerman.sty 13

9 Compatibility with the french package 14

10 Identification 14

11 The Package File 15 11.1 Language options . . . . . 15 12 The Kernel of Babel 18

∗During the development ideas from Nico Poppelier, Piet van Oostrum and many others have been used. Bernd Raichle has provided many helpful suggestions.

12.1 Encodig issues (part 1) . . 19 12.2 Multiple languages …. 20 12.3 Support for active char-

acters . . . . . . . . . . . 33 12.4 Shorthands . . . . . . . . 34 12.5 Language attributes … 43 12.6 Support for saving macro

definitions . . . . . . . . . 45 12.7 Support for extending

macros . . . . . . . . . . . 46 12.8 Macros common to a

number of languages … 47 12.9 Making glyphs available . 48 12.10Quotation marks . . . . . 48 12.11Letters . . . . . . . . . . . 49 12.12Shorthands for quotation

marks . . . . . . . . . . . 50 12.13Umlauts and trema’s … 51 12.14The redefinition of the

style commands . . . . . . 52 12.14.1 Redefinition of

macros . . . . . . . 53

12.15Cross referencing macros . 57 12.16marks . . . . . . . . . . . 61 12.17Encodig issues (part 2) . . 62 12.18Preventing clashes with

other packages . . . . . . 62 12.18.1 ifthen . . . . . . 62 12.18.2 varioref . . . . . 63 12.18.3 hhline . . . . . . 63 12.18.4 fancyhdr . . . . . 64

13 Local Language Configuration 64

14 Driver files for the documented source code 66

15 Conclusion 70

16 Acknowledgements 70

17 The Esperanto language 71

18 The Dutch language 74

19 The English language 79

20 The German language 82 21 The German language – new

orthography 87

22 The Breton language 91

23 The Welsh language 95

24 The Irish language 97

25 The Scottish language 99

26 The Greek language 101 26.1 Typing conventions …. 101 26.2 Greek numbering . . . . . 101

27 The French language 110

28 TEXnical details 118 28.1 Caption names . . . . . . 120 28.2 Punctuation . . . . . . . . 122 28.3 French quotation marks . 124 28.4 French lists . . . . . . . . 126 28.5 French indentation of

sections . . . . . . . . . . 128 28.6 Formatting numbers … 129 28.7 Dots. . . . . . . . . . . . . 132 28.8 Global layout . . . . . . . 132 28.9 Extra utilities . . . . . . . 133 28.10Date and clean up …. 136

29 The Italian language 137 29.1 Support for etymological

hyphenation . . . . . . . . 139 29.2 Facilities required by the

ISO 31/XI regulations . . 142 29.3 Accents . . . . . . . . . . 143 29.4 Caporali or French

double quotes . . . . . . . 144 29.5 Finishing commands … 146

30 The Latin language 147

31 The Portuguese language 153

32 The Spanish language 158 32.1 The Code . . . . . . . . . 160

33 The Catalan language 179

34 The Galician language 187

35 The Basque language 192 36 The Romanian language 196

37 The Danish language 198

38 The Icelandic language 201 38.1 Overview . . . . . . . . . 201 38.2 TEXnical details . . . . . . 202 38.3 Captionnames and date . 203 38.4 Icelandic quotation marks 204 38.5 Old Icelandic . . . . . . . 205 38.6 Formatting numbers … 206 38.7 Extra utilities . . . . . . . 208

39 The Norwegian language 210

40 The Swedish language 215

41 The North Sami language 219 41.1 The code of samin.dtx . 219

42 The Finnish language 221

43 The Hungarian language 224

44 The Estonian language 242 44.1 Implementation . . . . . . 242

45 The Croatian language 246

46 The Czech language 248

47 The Polish language 250

48 The Serbocroatian language256

49 The Slovak language 259

50 The Slovenian language 261

51 The Russian language 264

52 The Bulgarian language 278

53 The Ukrainian language 290

54 The Lower Sorbian language 304

55 The Upper Sorbian language 306

56 The Turkish language 310 57 The Hebrew language 313 57.1 Acknowledgement . . . . . 313 57.2 The docstrip modules . 314 57.3 Hebrew language defini-

tions . . . . . . . . . . . . 314 57.4 Right to left support … 320 57.4.1 Switching from

LR to RL mode

and back . . . . . 320 57.4.2 Counters . . . . . 323 57.4.3 Preserving logos . 324 57.4.4 List environments 324 57.4.5 Tables of moving

stuff . . . . . . . . 326 57.4.6 Two-column mode 331 57.4.7 Footnotes . . . . . 331 57.4.8 Headings and

two-side support . 331 57.4.9 Miscellaneous in-

ternal L^{A}TEX macros334 57.4.10 Bibliography and

citations . . . . . . 337 57.4.11 Additional bid-

irectional com-

mands . . . . . . . 338

57.5 Hebrew calendar . . . . . 340 57.5.1 Introduction … 340 57.5.2 Registers, Com-

mands, Format-

ting Macros …. 341 57.5.3 Auxiliary Macros . 346 57.5.4 Gregorian Part . . 347 57.5.5 Hebrew Part … 349

58 Hebrew input encodings 353 58.1 Default definitions for

characters . . . . . . . . . 354 58.2 The SI-960 encoding … 355 58.3 The ISO 8859-8 encoding and the MS Windows cp1255 encoding . . . . . 355 58.4 The IBM code page 862 . 358 59 Hebrew font encodings 359

59.1 The docstrip modules . 360 59.2 The encoding definition file360 59.3 The font definition files

(in LHE encoding) . . . . . 362 59.3.1 Hebrew default font362 59.3.2 Hebrew sans-serif

font . . . . . . . . 363 59.3.3 Hebrew type-

writer font …. 363 59.3.4 Hebrew classic font 364 59.3.5 Hebrew shalom

fonts . . . . . . . . 365 59.3.6 Hebrew frank-

ruehl font . . . . . 365 59.3.7 Hebrew carmel font 366 59.3.8 Hebrew redis font . 366 59.3.9 Hebrew font

switching com-

mands . . . . . . . 367 60 Hebrew in L^{A}TEX 2.09 com-

patibility mode 369 60.1 The docstrip modules . 370 60.2 Obsolete style files …. 370

61 Writing Hebrew/English thesis with L^{A}TEX 2ε 371 61.1 Common definitions … 371 61.2 Parameters for title pages 375 61.3 English part . . . . . . . . 376 61.4 Hebrew part . . . . . . . . 377 61.5 User-level commands

and macros . . . . . . . . 378

62 The Bahasa language 383

63 Not renaming hyphen.tex 385

64 Support for formats based on plainTEX 386

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 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. For mixing left-to-right typesetting with right-to-left typesetting the use of this environment is a prerequisite. 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’, provided that in language.dat the ‘language’ nohyphenation is defined by loading

serohyph.tex.

\languagename The control sequence \languagename contains the name of the current language.

\iflanguage If more than one language is used it might be necessary to know which language is active at a specific time. This can be checked by a call to \iflanguage. This macro takes three arguments. The first argument is the name of a language, the second and third arguments are the actions to take if the result of the test is true or false respectively.

\useshorthands The command \useshorthands initiates the definition of user-defined shorthand sequences. It has one argument, the character which starts these personal shorthands.

\defineshorthand The command \defineshorthand takes two arguments, the first of which is a one or two character sequence, the second argument is the code the shorthand should expand to.

\aliasshorthand The command \aliasshorthand can be used to let another character perform the same functions as the default shorthand character. If one prefers for example to use the character / over " in typing polish texts this can be acheived by entering

\aliasshorthand{"}{/}.

\languageshorthands The command \languageshorthands can be used to switch the shorthands on the language level. It takes one argument, the name of a language. Note that for this to work the language should have been specified as an option when loading the babel package.

\shorthandon It is sometimes necessary to be able to switch a shorthand character off tem- \shorthandoff porarily because it needs to be used in an entire different way. For this purpose the

user commands \shorthandoff and \shorthandon are provided. They each take a list of characters as their arguments. The command \shorthandoff sets the \catcode for each of the characters in its argument to other (12); the command \shorthandon sets the \catcode to active (13). Both commands only perform their duty on ‘known’ shorthand characters. If a character is not known to be a shorthand character its category code will be left unchanged.

\languageattribute This is a user-level command, to be used in the preamble of a document (after \usepackage[...]{babel} which declares wich attributes are to be used for a given languages. It takes two arguments, the first being the name of the language, the second a (list of) attribute(s) to used. The command checks whether the language is known in this document and whether the attribute(s) are known for this language.

1.1 Languages supported by Babel

In the following table all the languages supported by Babel are listed, together with the names of the options with which you can load babel for each language.

Language Option(s)
Afrikaans afrikaans
Bahasa  bahasa
Basque  basque
Breton  breton
Bulgarian bulgarian
Catalan  catalan
Croatian croatian
Czech  czech
Danish  danish

Language  Option(s)
Dutch  dutch

English english, USenglish, american, UKenglish, british, ca-

nadian

Esperanto  esperanto
Estonian  estonian
Finnish  finnish
French  french, francais, canadien, acadian
Galician  galician
German  austrian, german, germanb, ngerman, naustrian
Greek  greek, polutonikogreek
Hebrew  hebrew
Hungarian  magyar, hungarian
Icelandic  icelandic
Irish Gaelic  irish
Italian  italian
Latin  latin
Lower Sorbian lowersorbian
North Sami  samin
Norwegian  norsk, nynorsk
Polish  polish
Portuguese  portuges, portuguese, brazilian, brazil
Romanian  romanian
Russian  russian
Scottish Gaelic scottish
Spanish  spanish
Slovakian  slovak
Slovenian  slovene
Swedish  swedish
Serbian  serbian
Turkish  turkish
Ukrainian  ukrainian
Upper Sorbian uppersorbian
Welsh  welsh

For some languages babel supports the options activeacute and activegrave; for typestting russian texts babel knows about the options LWN and LCY to specify the fontencoding of the cyrillic font used. Currently only LWN is supported.

1.2 Workarounds

When you use the document class book and you use \ref inside the argument of \chapter you will experience the problem that L^{A}TEX will keep complaining about an undefined label. The reason is that the argument of \ref is passed through \uppercase at some time during processing. To prevent such problems you could revert to using uppercase labels, or you can use \lowercase{\ref{foo}} inside the argument of \chapter.

2 Changes for L^{A}TEX 2ε

With the advent of L^{A}TEX 2ε the interface to babel in the preamble of the doument has changed. With L^{A}TEX2.09 one used to call up the babel system with a line such as:

\documentstyle[dutch,english]{article}

which would tell L^{A}TEX that the document would be written in two languages, dutch and english and that english would be the first language in use.

The L^{A}TEX 2ε way of providing the same information is:

\documentclass{article}
\usepackage[dutch,english]{babel}

or, making dutch and english global options in order to let other packages detect and use them:

\documentclass[dutch,english]{article}
\usepackage{babel}
\usepackage{varioref}

In this last example the package varioref will also see the options and will be able to use them.

3 Changes in Babel version 3.7

In Babel version 3.7 a number of bugs that were found in version 3.6 are fixed. Also a number of changes and additions have occured:

• Shorthands are expandable again. The disadvantage is that one has to type '{}a when the acute accent is used as a shorthand character. The advantage is that a number of other problems (such as the breaking of ligatures, etc.) have vanished.

• Two new commands, \shorthandon and \shorthandoff have been introduced to enable to temporarely switch off one or more shorthands.

• Support for typesetting Greek has been enhaced. Code from the kdgreek package (suggested by the author) was added and \greeknumeral has been added.

• Support for typesetting Basque is now available thanks to Juan Aguirregabiria.

• Support for typesetting Serbian with latin script is now available thanks to Dejan Muhamedagić and Jankovic Slobodan.

• Support for typesetting Hebrew (and potential support for typesetting other rigth-to-left written languages) is now available thanks to Rama Porrat and Boris Lavva.

• Support for typesetting Bulgarian is nowavailable thanks to Georgi Boshnakov.

• Support for typesetting Latin is now available, thanks to Claudio Beccari and Krzysztof Konrad Żelechowski.

• Support for typesetting North Sami is now available, thanks to Regnor Jernsletten.

• The options canadian, candien and acadien have been added for Canadian English and French use.

• A language attribute has been added to the \mark... commands in order to make sure that a greek header line comes out right on the last page before a language switch.

• Hyphenation pattern files are now read inside a group; therefor any changes a pattern file needs to make to lowercase codes, uppercase codes and category codes are kept local to that group. If they are needed for the language, these changes will need to be repeated and stored in \extras...

• The concept of language attributes is introduced. It is intended to be used for giving the user some control over the use of the features a language definition file provides. It’s first use is for the Greek language where the user can select to use the πoλυτoνκó (“Polutoniko” or multiaccented) Greek way of typesetting texts. These attributes wil possibly find wider use in future releases.

• The environment hyphenrules is introduced.

• The syntax of the file language.dat has been extended in order to be able to (optionaly) specify the font encoding to be used while processing the patterns file.

• The command \providehyphenmins should now be used in language definition files in order to be able to keep any settings provided by the pattern file.

4 Changes in Babel version 3.6

In Babel version 3.6 a number of bugs that were found in version 3.5 are fixed. Also a number of changes and additions have occured:

• A new environment otherlanguage* is introduced. it only switches the ‘specials’, but leaves the ‘captions’ untouched.

• The shorthands are no longer fully expandable. Some problems could only be solved by peeking at the token following an active character. The advantage is that '{}a works as expected for languages that have the ' active.

• Support for typesetting french texts is much enhanced; the file francais.ldf is now replaced by frenchb.ldf which is maintained by Daniel Flipo.

• Support for typesetting the russian language is again available. The languange definition file was originally developped by Olga Lapko from Cyr-TUG. The fonts needed to typeset the russian language are now part of the babel distribution. The support is not yet up to the level which is needed according to Olga, but this is a start.

• Support for typesetting greek texts is now also available. What is offered in this release is a first attempt; it will be enhanced later on by Yannis Haralambous.

• in babel 3.6j some hooks have been added for the development of support for Hebrew typesetting.

• Support for typesetting texts in Afrikaans (a variant of Dutch, spoken in South Africa) has been added to dutch.ldf.

• Support for typesetting welsh texts is now available.

• A new command \aliasshorthand is introduced. It seems that in Poland various conventions are used to type the necessary polish letters. It is now possible to use the character / as a shorthand character instead of the character " by issuing the command \aliasshorthand{"}{/}.

• The shorthand mechanism now deals correctly with characters that are already active.

• Shorthand characters are made active at \begin{document}, not earlier. This is to prevent problems with other packages.

• A preambleonly command \substitutefontfamily has been added to create .fd files on the fly when the font families of the latin text differ from the families used for the cyrillic or greek parts of the text.

• Three new comands \LdfInit, \ldf@quit and \ldf@finish are introduced that perform a number of standard tasks.

• In babel 3.6k the language Ukrainian has been added and the support for russian typesetting has been adapted to the package ’cyrillic’ to be released with the december 1998 release of L^{A}TEX 2ε.

5 Changes in Babel version 3.5

In Babel version 3.5 a lot of changes have been made when compared with the previous release. Here is a list of the most important ones:

• the selection of the language is delayed untill \begin{document}, this has the consequence that you need to add appropriate \selectlanguage commands if you include \hyphenation lists in the preamble of your document.

• babel now has a language environment and a new command \foreignlanguage;

• the way active characters are dealt with is completely changed. They are called ‘shorthands’; one can have three levels of shorthands: on the user level, the language level and on ‘system level’. A consequence of the new way of handling active characters is that they are now written to auxiliary files ‘verbatim’; • A language change now also writes information in the .aux file as the change

might also affect typesetting the table of contents. The consequence is that an .aux file generated by a LaTeX format with babel preloaded gives errors when read with a LaTeX format without babel, but I think this problaly doesn’t occur;

• babel is now compatible with the inputenc and fontenc packages;

• the language definition files now have a new extension, ldf;

• the syntax of the file language.dat is extended to be compatible with the french package by Bernard Gaulle;

• each language definition file looks for a configuration file which has the same name, but the extension .cfg. It can cantain any valid L^{A}TEX code.

6 The interface between the core of babel and the language definition files

In the core of the babel system a number of macros are defined that are to be used in language definition files. Their purpose is to make a new language known.

\addlanguage The macro \addlanguage is a non-outer version of the macro \newlanguage, defined in plain.tex version 3.x. For older versions of plain.tex and lplain.tex a substitute definition is used.

\adddialect The macro \adddialect can be used in the case where two languages can (or have to) use the same hyphenation patterns. This can also be usefull when a user wants to use a language for which no patterns are preloaded in the format. In such a case the default behaviour of the babel system is to define this language as a ‘dialect’ of the language for which the patterns were loaded as \language0.

The language definition files have to conform to a number of conventions. The reason for this is that these files have to fill in the gaps left by the common code in babel.def, i. e., the definitions of the macros that produce texts. Also the language-switching possibility which has been built into the babel system has its implications.

The following assumptions are made:

• Some of the language-specific definitions might be used by plain TEX users, so the files have to be coded such that they can be read by L^{A}TEX as well as by plain TEX. The current format can be checked by looking at the value of the macro \fmtname.

• The common part of the babel system redefines a number of macros and environments (defined previously in the document style) to put in the names of macros that replace the previously hard-wired texts. These macros have to be defined in the language definition files.

• The language definition files define five macros, used to activate and deactivate the language-specific definitions. These macros are \⟨lang⟩hyphenmins, \captions⟨lang⟩, \date⟨lang⟩, \extras⟨lang⟩ and \noextras⟨lang⟩; where ⟨lang⟩ is either the name of the language definition file or the name of the L^{A}TEX option that is to be used. These macros and their functions are discussed below.

• When a language definition file is loaded, it can define \l@⟨lang⟩ to be a dialect of \language0 when \l@⟨lang⟩ is undefined.

• The language definition files can be read in the preamble of the document, but also in the middle of document processing. This means that they have to function independently of the current \catcode of the @ sign.

\providehyphenmins The macro \providehyphenmins should be used in the language definition files to set the \lefthyphenmin and \righthyphenmin. This macro will check whether these parameters were provided by the hyphenation file before it takes any action.

\langhyphenmins The macro \⟨lang⟩hyphenmins is used to store the values of the \lefthyphenmin

and \righthyphenmin.

\captionslang The macro \captions⟨lang⟩ defines the macros that hold the texts to replace

the original hard-wired texts.

\datelang The macro \date⟨lang⟩ defines \today and \extraslang The macro \extras⟨lang⟩ contains all the extra definitions needed for a specific

language.

\noextraslang Because we want to offer the user the possibility to switch between languages and we do not know in what state TEX might be after the execution of \extras⟨lang⟩, a macro that brings TEX into a predefined state is needed. It will be no surprise that the name of this macro is \noextras⟨lang⟩.

\bbl@declare@ttribute This is a command to be used in the language definition files for declaring a language attribute. It takes three arguments, the name of the language, the attribute to be defined, and the code to be executed when the attribute is to be used.

\main@language To postpone the activation of the definitions needed for a language untill the beginning of a document, all language definition files should use \main@language instead of \selectlanguage. This will just store the name of the language and the proper language will be activated at the start of the document.

\ProvidesLanguage The macro \ProvidesLanguage should be used to identify the language definition files. It’s syntax is similar to the syntax of the L^{A}TEX command

\ProvidesPackage.

\LdfInit The macro \LdfInit performs a couple of standard checks that have to be made at the beginning of a language definition file, such as checking the category code of the @-sign, preventing that the .ldf file is processed twice, etc.

\ldf@quit The macro \ldf@quit performs a couple of tasks that need to be taken care of when a .ldf file was processed earlier. These tasks include the resetting of the category code of the @-sign, preparing the language to be activated at \begin{document} time and ending the input stream.

\ldf@finish The macro \ldf@finish performs a couple of tasks that need to be taken care of at the end of each .ldf file. These tasks include the resetting of the category code of the @-sign, the loading of a local configuration file and preparing the language to be activated at \begin{document} time.

\loadlocalcfg At the end of the processing of a language definition file L^{A}TEX can be instructed to load a local configuration file. This file can for instance be used to add strings to \captions⟨lang⟩ in order to support local document classes. The user will be informed of the fact that this configuration file is loaded. This macro is called by

\ldf@finish.

\subsitutefontfamily This command takes three arguments, a font encoding and two font family names. It creates a font description file for the first font in the given encoding.

This .fd file will instruct L^{A}TEX to use a font from the second family when a font from the first family in the given encoding seems to be needed.

6.1 Support for active characters

In quite a number of language definition files, active characters are introduced. To facilitate this, some support macros are provided.

\initiate@active@char The internal macro \initiate@active@char is used in language definition files to instruct L^{A}TEX to give a character the category code ‘active’. When a character has been made active it will remain that way untill the end of then document. Its definition may vary.

\bbl@activate The command \bbl@activate is used to change the way an active character \bbl@deactivate expands. \bbl@activate ‘switches on’ the active behaviour of the character.

\bbl@deactivate lets the active character expand to its former (mostly) nonactive self.

\declare@shorthand The macro \declare@shorthand is used to define the various shorthands. It takes three arguments, the name for the collection of shorthands this definition belongs to; the character (sequence) that makes up the shorthand i.i. ~ or "a and the code to be executed when the shorthand is encountered.

\bbl@add@special The TEXbook states: “Plain TEX includes a macro called \dospecials that \bbl@remove@special is essentially a set macro, representing the set of all characters that have a spe-

cial category code.” [1, p. 380] It is used to set text ‘verbatim’. To make this work if more characters get a special category code, you have to add this character to the macro \dospecial. L^{A}TEX adds another macro called \@sanitize representing the same character set, but without the curly braces. The macros

\bbl@add@special⟨char⟩ and \bbl@remove@special⟨char⟩ add and remove the

character ⟨char⟩ to these two sets.

6.2 Support for saving macro definitions

Language definition files may want to redefine macros that already exist. Therefor a mechanism for saving (and restoring) the original definition of those macros is provided. We provide two macros for this^{1}.

\babel@save To save the current meaning of any control sequence the macro \babel@save is provided. It takes one argument, ⟨csname⟩, the control sequence for which the meaning has to be saved.

\babel@savevariable A second macro is provided to save the current value of a variable. In this context anything that is allowed after the \the primitive is considered to be a variable. The macro takes one argument, the ⟨variable⟩.

The effect of the aforementioned macros is that a piece of code is appended to the current definition of \originalTeX. When \originalTeX is expanded this code restores the previous definition of the control sequence or the previous value of the variable.

6.3 Support for extending macros

\addto The macro \addto{⟨control sequence⟩}{⟨TEX code⟩} can be used to extend the definition of a macro. The macro need not be defined. This macro can, for instance, be used in adding instructions to a macro like \extrasenglish.

1This mechanism was introduced by Bernd Raichle.

6.4 Macros common to a number of languages

\allowhyphens In a couple of european languages compound words are used. This means that when TEX has to hyphenate such a compound word it only does that at the ‘-’ that is used in such words. To allow hyphenation in the rest of such a compound word the macro \allowhyphens can be used.

\set@low@box For some languages quotes need to be lowered to the baseline. For this purpose the macro \set@low@box is available. It takes one argument and puts that argument in an \hbox, at the baseline. The result is available in \box0 for further processing.

\save@sf@q Sometimes it is necessary to preserve the \spacefactor. For this purpose the macro \save@sf@q is available. It takes one argument, saves the current spacefactor, executes the argument and restores the spacefactor.

\bbl@frenchspacing  The commands \bbl@frenchspacing and \bbl@nonfrenchspacing can be

\bbl@nonfrenchspacing used to properly switch french spacing on and off.

7 Compatibility with german.sty

The file german.sty has been one of the sources of inspiration for the babel system. Because of this I wanted to include german.sty in the babel system. To be able to do that I had to allow for one incompatibility: in the definition of the macro \selectlanguage in german.sty the argument is used as the ⟨number⟩ for an \ifcase. So in this case a call to \selectlanguage might look like

\selectlanguage{\german}.

In the definition of the macro \selectlanguage in babel.def the argument is used as a part of other macronames, so a call to \selectlanguage now looks like \selectlanguage{german}. Notice the absence of the escape character. As of version 3.1a of babel both syntaxes are allowed.

All other features of the original german.sty have been copied into a new file,

called germanb.sty^{2}.

Although the babel system was developed to be used with L^{A}TEX, some of the features implemented in the language definition files might be needed by plain TEX users. Care has been taken that all files in the system can be processed by plain TEX.

8 Compatibility with ngerman.sty

When used with the options ngerman or naustrian babel will provide all features of the package ngerman. There is however one exception: The commands for special hyphenation of double consonants ("ff etc.) and ck ("ck), which are no longer required with the new German orthography, are undefined. With the ngerman package, however, these commands will generate appropriate warning messages only.

2The ‘b’ is added to the name to distinguish the file from Partls’ file.

9 Compatibility with the french package

It has been reported to me that the package french by Bernard Gaulle (gaulle@idris.fr) works together with babel.

Therefor, babel will first search for the file french.ldf when you give it the option french; then it will try to load frenchb.ldf. When you give babel the option francais it will only look for frenchb.ldf.

10 Identification

The file babel.sty^{3} is meant for L^{A}TEX 2ε, therefor we make sure that the format file used is the right one.

\ProvidesLanguage The identification code for each file is something that was introduced in L^{A}TEX 2ε. When the command \ProvidesFile does not exist, a dummy definition is provided temporarily. For use in the language definition file the command

\ProvidesLanguage is defined by babel.

10.1 ⟨∗!package⟩

10.2 \ifx\ProvidesFile\@undefined
10.3 \def\ProvidesFile#1[#2 #3 #4]{%
10.4  \wlog{File: #1 #4 #3 <#2>}%

10.5 ⟨∗kernel & patterns⟩

10.6  \toks8{Babel <#3> and hyphenation patterns for }%

10.7 ⟨/kernel & patterns⟩

10.8  \let\ProvidesFile\@undefined

10.9 }

As an alternative for \ProvidesFile we define \ProvidesLanguage here to be used in the language definition files.

10.10 ⟨∗kernel⟩

10.11 \def\ProvidesLanguage#1[#2 #3 #4]{%
10.12  \wlog{Language: #1 #4 #3 <#2>}%

10.13 }

10.14 \else

In this case we save the orginal definition of \ProvidesFile in \bbl@tempa and restore it after we have stored the version of the file in \toks8.

10.15 ⟨∗kernel & patterns⟩

10.16 \let\bbl@tempa\ProvidesFile
10.17 \def\ProvidesFile#1[#2 #3 #4]{%
10.18  \toks8{Babel <#3> and hyphenation patterns for }%
10.19  \bbl@tempa#1[#2 #3 #4]%
10.20  \let\ProvidesFile\bbl@tempa}

10.21 ⟨/kernel & patterns⟩

When \ProvidesFile is defined we give \ProvidesLanguage a similar definition.

10.22 \def\ProvidesLanguage#1{%
10.23  \begingroup
10.24  \catcode`\ 10 %
10.25  \@makeother\/%
10.26  \@ifnextchar[%]

3The file described in this section is called babel.dtx, has version number v3.7g and was last revised on 2001/02/09.

10.27  {\@provideslanguage{#1}}{\@provideslanguage{#1}[]}}
10.28 \def\@provideslanguage#1[#2]{%
10.29  \wlog{Language: #1 #2}%
10.30  \expandafter\xdef\csname ver@#1.ldf\endcsname{#2}%
10.31  \endgroup}

10.32 ⟨/kernel⟩ 10.33 \fi 10.34 ⟨/!package⟩

Identify each file that is produced from this source file.

10.35 ⟨+package⟩\ProvidesPackage{babel}
10.36 ⟨+core⟩\ProvidesFile{babel.def}
10.37 ⟨+kernel & patterns⟩\ProvidesFile{hyphen.cfg}
10.38 ⟨+kernel&!patterns⟩\ProvidesFile{switch.def}
10.39 ⟨+driver&!user⟩\ProvidesFile{babel.drv}
10.40 ⟨+driver & user⟩\ProvidesFile{user.drv}
10.41  [2001/02/09 v3.7g %
10.42 ⟨+package⟩  The Babel package]
10.43 ⟨+core⟩  Babel common definitions]
10.44 ⟨+kernel⟩  Babel language switching mechanism]

10.45 ⟨+driver⟩]

11 The Package File

In order to make use of the features of L^{A}TEX 2ε, the babel system contains a package file, babel.sty. This file is loaded by the \usepackage command and defines all the language options known in the babel system. It also takes care of a number of compatibility issues with other packages.

11.1 Language options

11.1 ⟨∗package⟩

 11.2 \ifx\LdfInit\@undefined\input babel.def\relax\fi

For all the languages supported we need to declare an option.

 11.3 \DeclareOption{acadian}{\input{frenchb.ldf}}
 11.4 \DeclareOption{afrikaans}{\input{dutch.ldf}}
 11.5 \DeclareOption{american}{\input{english.ldf}}

Austrian is really a dialect of German.

 11.6 \DeclareOption{austrian}{\input{germanb.ldf}}
 11.7 \DeclareOption{bahasa}{\input{bahasa.ldf}}
 11.8 \DeclareOption{basque}{\input{basque.ldf}}
 11.9 \DeclareOption{brazil}{\input{portuges.ldf}}
11.10 \DeclareOption{brazilian}{\input{portuges.ldf}}
11.11 \DeclareOption{breton}{\input{breton.ldf}}
11.12 \DeclareOption{british}{\input{english.ldf}}
11.13 \DeclareOption{bulgarian}{\input{bulgarian.ldf}}
11.14 \DeclareOption{canadian}{\input{english.ldf}}
11.15 \DeclareOption{canadien}{\input{frenchb.ldf}}
11.16 \DeclareOption{catalan}{\input{catalan.ldf}}
11.17 \DeclareOption{croatian}{\input{croatian.ldf}}
11.18 \DeclareOption{czech}{\input{czech.ldf}}

11.19 \DeclareOption{danish}{\input{danish.ldf}}
11.20 \DeclareOption{dutch}{\input{dutch.ldf}}
11.21 \DeclareOption{english}{\input{english.ldf}}
11.22 \DeclareOption{esperanto}{\input{esperanto.ldf}}
11.23 \DeclareOption{estonian}{\input{estonian.ldf}}
11.24 \DeclareOption{finnish}{\input{finnish.ldf}}

The babel support or French used to be stored in francais.ldf; therefor the L^{A}TEX2.09 option used to be francais. The hyphenation patterns may be loaded as either ‘french’ or as ‘francais’.

11.25 \DeclareOption{francais}{\input{frenchb.ldf}}
11.26 \DeclareOption{frenchb}{\input{frenchb.ldf}}

With L^{A}TEX 2ε we can now also use the option french and still call the file

  frenchb.ldf.
11.27 \IfFileExists{french.ldf}{%
11.28 \DeclareOption{french}{\input{french.ldf}}%

11.29 }{%

11.30 \DeclareOption{french}{\input{frenchb.ldf}}%

11.31 }

11.32 \DeclareOption{galician}{\input{galician.ldf}}
11.33 \DeclareOption{german}{\input{germanb.ldf}}
11.34 \DeclareOption{germanb}{\input{germanb.ldf}}
11.35 \DeclareOption{greek}{\input{greek.ldf}}
11.36 \DeclareOption{polutonikogreek}{%
11.37 \input{greek.ldf}%
11.38 \languageattribute{greek}{polutoniko}}
11.39 \DeclareOption{hebrew}{%
11.40 \input{rlbabel.def}%
11.41 \input{hebrew.ldf}}

hungarian is just a synonym for magyar

11.42 \DeclareOption{hungarian}{\input{magyar.ldf}}
11.43 \DeclareOption{icelandic}{\input{icelandic.ldf}}
11.44 \DeclareOption{irish}{\input{irish.ldf}}
11.45 \DeclareOption{italian}{\input{italian.ldf}}
11.46 \DeclareOption{latin}{\input{latin.ldf}}
11.47 \DeclareOption{lowersorbian}{\input{lsorbian.ldf}}
11.48 %^^A\DeclareOption{kannada}{\input{kannada.ldf}}
11.49 \DeclareOption{magyar}{\input{magyar.ldf}}
11.50 %^^A\DeclareOption{nagari}{\input{nagari.ldf}}

‘New’ German orthography, including Austrian variant:

11.51 \DeclareOption{naustrian}{\input{ngermanb.ldf}}
11.52 \DeclareOption{ngerman}{\input{ngermanb.ldf}}
11.53 \DeclareOption{norsk}{\input{norsk.ldf}}
11.54 \DeclareOption{samin}{\input{samin.ldf}}

For Norwegian two spelling variants are provided.

11.55 \DeclareOption{nynorsk}{\input{norsk.ldf}}
11.56 \DeclareOption{polish}{\input{polish.ldf}}
11.57 \DeclareOption{portuges}{\input{portuges.ldf}}
11.58 \DeclareOption{portuguese}{\input{portuges.ldf}}
11.59 \DeclareOption{romanian}{\input{romanian.ldf}}
11.60 \DeclareOption{russian}{\input{russianb.ldf}}

11.61 %^^A\DeclareOption{sanskrit}{\input{sanskrit.ldf}}
11.62 \DeclareOption{scottish}{\input{scottish.ldf}}
11.63 \DeclareOption{serbian}{\input{serbian.ldf}}
11.64 \DeclareOption{slovak}{\input{slovak.ldf}}
11.65 \DeclareOption{slovene}{\input{slovene.ldf}}
11.66 \DeclareOption{spanish}{\input{spanish.ldf}}
11.67 \DeclareOption{swedish}{\input{swedish.ldf}}
11.68 %^^A\DeclareOption{tamil}{\input{tamil.ldf}}
11.69 \DeclareOption{turkish}{\input{turkish.ldf}}
11.70 \DeclareOption{ukrainian}{\input{ukraineb.ldf}}
11.71 \DeclareOption{uppersorbian}{\input{usorbian.ldf}}
11.72 \DeclareOption{welsh}{\input{welsh.ldf}}
11.73 \DeclareOption{UKenglish}{\input{english.ldf}}
11.74 \DeclareOption{USenglish}{\input{english.ldf}}

For all those languages for which the option name is the same as the name of the language specific file we specify a default option, which tries to load the file specified. If this doesn’t succeed an error is signalled.

11.75 \DeclareOption*{%
11.76 \InputIfFileExists{\CurrentOption.ldf}{}{%
11.77  \PackageError{babel}{%
11.78  Language definition file \CurrentOption.ldf not found}{%
11.79  Maybe you misspelled the language option?}}%

11.80 }

Another way to extend the list of ‘known’ options for babel is to create the file bblopts.cfg in which one can add option declarations.

11.81 \InputIfFileExists{bblopts.cfg}{%
11.82 \typeout{*************************************^^J%
11.83  * Local config file bblopts.cfg used^^J%

11.84 *}% 11.85 }{}

Apart from all the language options we also have a few options that influence the behaviour of language definition files.

The following options don’t do anything themselves, they are just defined in order to make it possible for language definition files to check if one of them was specified by the user.

11.86 \DeclareOption{activeacute}{}
11.87 \DeclareOption{activegrave}{}

The next option tells babel to leave shorthand characters active at the end of processing the package. This is not the default as it can cause problems with other packages, but for those who want to use the shorthand characters in the preamble of their documents this can help.

11.88 \DeclareOption{KeepShorthandsActive}{}

The options have to be processed in the order in which the user specified them:

11.89 \ProcessOptions*

In order to catch the case where the user forgot to specify a language we check whether \bbl@main@language, has become defined. If not, no language has been loaded and an error message is displayed.

11.90 \ifx\bbl@main@language\@undefined
11.91 \PackageError{babel}{%
11.92  You haven't specified a language option}{%

 11.93  You need to specify a language, either as a global
 11.94  option\MessageBreak
 11.95  or as an optional argument to the \string\usepackage\space
 11.96  command; \MessageBreak
 11.97  You shouldn't try to proceed from here, type x to quit.}

To prevent undefined command errors when the user insists on continuing we load babel.def here. He should expect more errors though.

 11.98 \input{babel.def}

11.99 \fi

\substitutefontfamily The command \substitutefontfamily creates an .fd file on the fly. The first

argument is an encoding mnemonic, the second and third arguments are font family names.

11.100 \def\substitutefontfamily#1#2#3{%
11.101 \immediate\openout15=#1#2.fd\relax
11.102 \immediate\write15{%
11.103  \string\ProvidesFile{#1#2.fd}%
11.104  [\the\year/\two@digits{\the\month}/\two@digits{\the\day}
11.105  \space generated font description file]^^J
11.106  \string\DeclareFontFamily{#1}{#2}{}^^J
11.107  \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J
11.108  \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J
11.109  \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J
11.110  \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J
11.111  \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J
11.112  \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J
11.113  \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J
11.114  \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J

11.115 }%

11.116 \closeout15

11.117 }

This command should only be used in the preamble of a document.

11.118 \@onlypreamble\substitutefontfamily

11.119 ⟨/package⟩

12 The Kernel of Babel

The kernel of the babel system is stored in either hyphen.cfg or switch.def and babel.def. The file hyphen.cfg is a file that can be loaded into the format, which is necessary when you want to be able to switch hyphenation patterns. The file babel.def contains some TEX code that can be read in at run time. When babel.def is loaded it checks if hyphen.cfg is in the format; if not the file

   switch.def is loaded.

Because plain TEX users might want to use some of the features of the babel system too, care has to be taken that plain TEX can process the files. For this reason the current format will have to be checked in a number of places. Some of the code below is common to plain TEX and L^{A}TEX, some of it is for the L^{A}TEX case only.

When the command \AtBeginDocument doesn’t exist we assume that we are dealing with a plain-based format. In that case the file plain.def is needed.

12.1 ⟨∗kernel | core⟩

12.2 \ifx\AtBeginDocument\@undefined

But we need to use the second part of plain.def (when we load it from switch.def) which we can do by defining \adddialect.

12.3 ⟨kernel&!patterns⟩ \def\adddialect{}

12.4 \input plain.def\relax

12.5 \fi 12.6 ⟨/kernel | core⟩

Check the presence of the command \iflanguage, if it is undefined read the

file switch.def.

12.7 ⟨∗core⟩

12.8 \ifx\iflanguage\@undefined
12.9 \input switch.def\relax

12.10 \fi 12.11 ⟨/core⟩

12.1 Encodig issues (part 1)

The first thing we need to do is to determine, at \begin{document} which latin fontencoding to to use.

\latinencoding When text is being typeset in an encoding other then ‘latin’ (OT1 or T1) it would be nice to still have roman numerals come out in the latin encoding. In order to acheive this we first assume that the current encoding at the emd of processing the package is the latin encoding.

12.12 ⟨∗core⟩

12.13 \AtEndOfPackage{\edef\latinencoding{\cf@encoding}}

But this might be overruled with a later loading of the package fontenc. Therefor we check at the execution of \begin{document} whether it was loaded with the T1 option. The normal way to do this (using \@ifpackageloaded) is disabled for this package. Now we have to revert to parsing the internal macro \@filelist which contains all the filenames loaded.

12.14 \AtBeginDocument{%
12.15 \gdef\latinencoding{OT1}%
12.16 \ifx\cf@encoding\bbl@t@one
12.17  \xdef\latinencoding{\bbl@t@one}%
12.18 \else
12.19  \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%

12.20 \fi 12.21 }

\latintext Then we can define the command \latintext which is a declarative switch to a

latin font-encoding.

12.22 \DeclareRobustCommand{\latintext}{%
12.23 \fontencoding{\latinencoding}\selectfont
12.24 \def\encodingdefault{\latinencoding}}

\textlatin This command takes an argument which is then typeset using the requested font

encoding. In order to avoid many encoding switches it operates in a local scope.

12.25 \DeclareRobustCommand{\textlatin}[1]{{\latintext #1}}

12.26 ⟨/core⟩

We also need to redefine a number of commands to ensure that the right font encoding is used, but this can’t be done before babel.def is loaded.

12.2 Multiple languages

With TEX version 3.0 it has become possible to load hyphenation patterns for more than one language. This means that some extra administration has to be taken care of. The user has to know for which languages patterns have been loaded, and what values of \language have been used.

Some discussion has been going on in the TEX world about how to use \language. Some have suggested to set a fixed standard, i. e., patterns for each language should always be loaded in the same location. It has also been suggested to use the iso list for this purpose. Others have pointed out that the iso list contains more than 256 languages, which have not been numbered consecutively.

I think the best way to use \language, is to use it dynamically. This code implements an algorithm to do so. It uses an external file in which the person who maintains a TEX environment has to record for which languages he has hyphenation patterns and in which files these are stored^{4}. When hyphenation exceptions are stored in a separate file this can be indicated by naming that file after the file with the hyphenation patterns.

This “configuration file” can contain empty lines and comments, as well as lines which start with an equals (=) sign. Such a line will instruct L^{A}TEX that the hyphenation patterns just processed have to be known under an alternative name. Here is an example:

    % File    : language.dat
    % Purpose : tell iniTeX what files with patterns to load.
    english    english.hyphenations
    =british
    dutch      hyphen.dutch exceptions.dutch % Nederlands
    german hyphen.ger

As the file switch.def needs to be read only once, we check whether it was read before. If it was, the command \iflanguage is already defined, so we can stop processing.

12.27 ⟨∗kernel⟩ 12.28 ⟨∗!patterns⟩

12.29 \expandafter\ifx\csname iflanguage\endcsname\relax \else
12.30 \expandafter\endinput

12.31 \fi 12.32 ⟨/!patterns⟩

\language Plain TEX version 3.0 provides the primitive \language that is used to store the current language. When used with a pre-3.0 version this function has to be implemented by allocating a counter.

12.33 \ifx\language\@undefined
12.34 \csname newcount\endcsname\language

12.35 \fi

4This is because different operating systems sometimes use very different filenaming conventions.

\last@language Another counter is used to store the last language defined. For pre-3.0 formats an

extra counter has to be allocated,

12.36 \ifx\newlanguage\@undefined
12.37 \csname newcount\endcsname\last@language

plain TEX version 3.0 uses \count 19 for this purpose.

12.38 \else
12.39 \countdef\last@language=19

12.40 \fi

\addlanguage To add languages to TEX’s memory plain TEX version 3.0 supplies \newlanguage, in a pre-3.0 environment a similar macro has to be provided. For both cases a new macro is defined here, because the original \newlanguage was defined to be

\outer.

For a format based on plain version 2.x, the definition of \newlanguage can not be copied because \count 19 is used for other purposes in these formats. Therefor \addlanguage is defined using a definition based on the macros used to define \newlanguage in plain TEX version 3.0.

12.41 \ifx\newlanguage\@undefined
12.42 \def\addlanguage#1{%
12.43  \global\advance\last@language \@ne
12.44  \ifnum\last@language<\@cclvi
12.45  \else
12.46  \errmessage{No room for a new \string\language!}%

12.47 \fi

12.48  \global\chardef#1\last@language
12.49  \wlog{\string#1 = \string\language\the\last@language}}

For formats based on plain version 3.0 the definition of \newlanguage can be simply copied, removing \outer.

12.50 \else
12.51 \def\addlanguage{\alloc@9\language\chardef\@cclvi}

12.52 \fi

\adddialect The macro \adddialect can be used to add the name of a dialect or variant

language, for which an already defined hyphenation table can be used.

12.53 \def\adddialect#1#2{%
12.54  \global\chardef#1#2\relax
12.55  \wlog{\string#1 = a dialect from \string\language#2}}

\iflanguage Users might want to test (in a private package for instance) which language is currently active. For this we provide a test macro, \iflanguage, that has three arguments. It checks whether the first argument is a known language. If so, it compares the first argument with the value of \language. Then, depending on the result of the comparison, it executes either the second or the third argument.

12.56 \def\iflanguage#1{%
12.57 \expandafter\ifx\csname l@#1\endcsname\relax
12.58  \@nolanerr{#1}%
12.59 \else
12.60  \bbl@afterfi{\ifnum\csname l@#1\endcsname=\language
12.61  \expandafter\@firstoftwo
12.62  \else

12.63  \expandafter\@secondoftwo
12.64  \fi}%

12.65 \fi}

\selectlanguage The macro \selectlanguage checks whether the language is already defined before it performs its actual task, which is to update \language and activate language-specific definitions.

To allow the call of \selectlanguage either with a control sequence name or with a simple string as argument, we have to use a trick to delete the optional escape character.

To convert a control sequence to a string, we use the \string primitive. Next we have to look at the first character of this string and compare it with the escape character. Because this escape character can be changed by setting the internal integer \escapechar to a character number, we have to compare this number with the character of the string. To do this we have to use TEX’s backquote notation to specify the character as a number.

If the first character of the \string’ed argument is the current escape character, the comparison has stripped this character and the rest in the ‘then’ part consists of the rest of the control sequence name. Otherwise we know that either the argument is not a control sequence or \escapechar is set to a value outside of the character range 0–255.

If the user gives an empty argument, we provide a default argument for \string. This argument should expand to nothing.

12.66 \edef\selectlanguage{%
12.67 \noexpand\protect
12.68 \expandafter\noexpand\csname selectlanguage \endcsname

12.69 }

Because the command \selectlanguage could be used in a moving argument it expands to \protect\selectlanguage␣. Therefor, we have to make sure that a macro \protect exists. If it doesn’t it is \let to \relax.

12.70 \ifx\@undefined\protect\let\protect\relax\fi

As L^{A}TEX 2.09 writes to files expanded whereas L^{A}TEX 2ε takes care not to expand the arguments of \write statements we need to be a bit clever about the way we add information to .aux files. Therefor we introduce the macro \xstring which should expand to the right amount of \string’s.

12.71 \ifx\documentclass\@undefined
12.72 \def\xstring{\string\string\string}
12.73 \else
12.74 \let\xstring\string

12.75 \fi

Since version 3.5 babel writes entries to the auxiliary files in order to typeset table of contents etc. in the correct language environment.

\bbl@pop@language But when the language change happens inside a group the end of the group doesn’t write anything to the auxiliary files. Therefor we need TEX’s aftergroup mechanism to help us. The command \aftergroup stores the token immediately following it to be executed when the current group is closed. So we define a temporary control sequence \bbl@pop@language to be executed at the end of the group. It calls \bbl@set@language with the name of the current language as its argument.

12.76 \expandafter\def\csname selectlanguage \endcsname#1{%
12.77 \edef\bbl@pop@language{%
12.78  \noexpand\bbl@set@language{\languagename}}%
12.79 \aftergroup\bbl@pop@language
12.80 \bbl@set@language{#1}}

When a package, such as the CJK package, adds an extra level of grouping to the document before the first \selectlanguage occurs L^{A}TEX will complain about an undefined control sequence. Therefor we provide a default, dummy definition.

12.81 \let\bbl@pop@language\relax

\bbl@set@language The macro \bbl@set@language takes care of switching the language environment

and of writing entries on the auxiliary files.

12.82 \def\bbl@set@language#1{%
12.83 \edef\languagename{%
12.84  \ifnum\escapechar=\expandafter`\string#1\@empty
12.85  \else \string#1\@empty\fi}%
12.86 \select@language{\languagename}%

We also write a command to change the current language in the auxiliary files.

12.87 \if@filesw
12.88  \protected@write\@auxout{}{\string\select@language{\languagename}}%
12.89  \addtocontents{toc}{\xstring\select@language{\languagename}}%
12.90  \addtocontents{lof}{\xstring\select@language{\languagename}}%
12.91  \addtocontents{lot}{\xstring\select@language{\languagename}}%

12.92 \fi}

First, check if the user asks for a known language. If so, update the value of \language and call \originalTeX to bring TEX in a certain pre-defined state.

12.93 \def\select@language#1{%
12.94 \expandafter\ifx\csname date#1\endcsname\relax
12.95  \@nolanerr{#1}%
12.96 \else
12.97  \language=\csname l@#1\endcsname\relax
12.98  \originalTeX

The name of the language is stored in the control sequence \languagename. The contents of this control sequence could be tested in the following way:

      \edef\tmp{\string english}
      \ifx\languagename\tmp
          ...
      \else
          ...
      \fi

The construction with \string is necessary because \languagename returns the name with characters of category code 12 (other). Then we have to redefine \originalTeX to compensate for the things that have been activated. To save memory space for the macro definition of \originalTeX, we construct the control sequence name for the \noextras⟨lang⟩ command at definition time by expanding the \csname primitive.

12.99  \expandafter\def\expandafter\originalTeX
12.100  \expandafter{\csname noextras#1\endcsname
12.101  \let\originalTeX\@empty}%

12.102  \languageshorthands{none}%
12.103  \babel@beginsave

Now activate the language-specific definitions. This is done by constructing the names of three macros by concatenating three words with the argument of \selectlanguage, and calling these macros.

12.104  \csname captions#1\endcsname
12.105  \csname date#1\endcsname
12.106  \csname extras#1\endcsname\relax

The switching of the values of \lefthyphenmin and \righthyphenmin is somewhat different. First we save their current values, then we check if \⟨lang⟩hyphenmins is defined. If it is not, we set default values (2 and 3), otherwise the values in \⟨lang⟩hyphenmins will be used.

12.107  \babel@savevariable\lefthyphenmin
12.108  \babel@savevariable\righthyphenmin
12.109  \expandafter\ifx\csname #1hyphenmins\endcsname\relax
12.110  \set@hyphenmins\tw@\thr@@\relax

12.111 \else

12.112  \expandafter\expandafter\expandafter\set@hyphenmins
12.113  \csname #1hyphenmins\endcsname\relax

12.114 \fi 12.115 \fi}

otherlanguage The otherlanguage environment can be used as an alternative to using the \selectlanguage declarative command. When you are typesetting a document which mixes left-to-right and right-to-left typesetting you have to use this environment in order to let things work as you expect them to.

The first thing this environment does is store the name of the language in \languagename; it then calls \selectlanguage␣ to switch on everything that is needed for this language The \ignorespaces command is necessary to hide the environment when it is entered in horizontal mode.

12.116 \long\def\otherlanguage#1{%
12.117 \def\languagename{#1}%
12.118 \csname selectlanguage \endcsname{#1}%
12.119 \ignorespaces

12.120 }

The \endotherlanguage part of the environment calls \originalTeX to restore (most of) the settings and tries to hide itself when it is called in horizontal mode.

12.121 \long\def\endotherlanguage{%
12.122 \originalTeX
12.123 \global\@ignoretrue\ignorespaces

12.124 }

otherlanguage* The otherlanguage environment is meant to be used when a large part of text from a different language needs to be typeset, but without changing the translation of words such as ‘figure’.

This environment makes use of \foreign@language.

12.125 \expandafter\def\csname otherlanguage*\endcsname#1{%
12.126 \foreign@language{#1}%

12.127 }

At the end of the environment we need to switch off the extra definitions. The grouping mechanism of the environment will take care of resetting the correct hyphenation rules.

12.128 \expandafter\def\csname endotherlanguage*\endcsname{%
12.129 \csname noextras\languagename\endcsname

12.130 }

\foreignlanguage The \foreignlanguage command is another substitute for the \selectlanguage

command. This command takes two arguments, the first argument is the name of the language to use for typesetting the text specified in the second argument.

Unlike \selectlanguage this command doesn’t switch everything, it only switches the hyphenation rules and the extra definitions for the language specified. It does this within a group and assumes the \extras⟨lang⟩ command doesn’t make any \global changes. The coding is very similar to part of \selectlanguage.

12.131 \def\foreignlanguage{\protect\csname foreignlanguage \endcsname}
12.132 \expandafter\def\csname foreignlanguage \endcsname#1#2{%
12.133 \begingroup
12.134  \originalTeX
12.135  \foreign@language{#1}%

12.136 #2%

12.137  \csname noextras#1\endcsname
12.138 \endgroup

12.139 }

\foreign@language This macro does the work for \foreignlanguage and the otherlanguage* environ-

ment.

12.140 \def\foreign@language#1{%

First we need to store the name of the language and check that it is a known language.

12.141 \def\languagename{#1}%
12.142 \expandafter\ifx\csname l@#1\endcsname\relax
12.143  \@nolanerr{#1}%

12.144 \else

If it is we can select the proper hyphenation table and switch on the extra definitions for this language.

12.145  \language=\csname l@#1\endcsname\relax
12.146  \languageshorthands{none}%

Then we set the left- and right hyphenmin variables.

12.147  \csname extras#1\endcsname
12.148  \expandafter\ifx\csname #1hyphenmins\endcsname\relax
12.149  \set@hyphenmins\tw@\thr@@\relax

12.150 \else

12.151  \expandafter\expandafter\expandafter\set@hyphenmins
12.152  \csname #1hyphenmins\endcsname\relax

12.153 \fi 12.154 \fi 12.155 }

hyphenrules The environment hyphenrules can be used to select just the hyphenation rules. This environment does not change \languagename and when the hypheantion rules specified were not loaded it has no effect.

12.156 \def\hyphenrules#1{%
12.157 \expandafter\ifx\csname l@#1\endcsname\@undefined
12.158  \@nolanerr{#1}%

12.159 \else

12.160  \language=\csname l@#1\endcsname\relax
12.161  \languageshorthands{none}%

12.162 \fi 12.163 }

12.164 \def\endhyphenrules{}

\providehyphenmins The macro \providehyphenmins should be used in the language definition files to provide a default settting for the hyphenation parameters \lefthyphenmin and \righthyphenmin. If the macro \⟨lang⟩hyphenmins is already defined this command has no effect.

12.165 \def\providehyphenmins#1#2{%
12.166 \expandafter\ifx\csname #1hyphenmins\endcsname\relax
12.167  \@namedef{#1hyphenmins}{#2}%

12.168 \fi}

\set@hyphenmins This macro sets the values of \lefthyphenmin and \righthyphenmin. It expects

two values as its argument.

12.169 \def\set@hyphenmins#1#2{\lefthyphenmin#1\righthyphenmin#2}

\LdfInit This macro is defined in two versions. The first version is to be part of the ‘kernel’ of babel, ie. the part that is loaded in the format; the second version is defined in babel.def. The version in the format just checks the category code of the ampersand and then loads babel.def.

12.170 \def\LdfInit{%
12.171 \chardef\atcatcode=\catcode`\@
12.172 \catcode`\@=11\relax
12.173 \input babel.def\relax

The category code of the ampersand is restored and the macro calls itself again with the new definition from babel.def

12.174 \catcode`\@=\atcatcode \let\atcatcode\relax
12.175 \LdfInit}

12.176 ⟨/kernel⟩

The second version of this macro takes two arguments. The first argument is the name of the language that will be defined in the language definition file; the second argument is either a control sequence or a string from which a control sequence should be constructed. The existence of the control sequence indicates that the file has been processed before.

At the start of processing a language definition file we always check the category code of the ampersand. We make sure that it is a ‘letter’ during the processing of the file.

12.177 ⟨∗core⟩

12.178 \def\LdfInit#1#2{%
12.179 \chardef\atcatcode=\catcode`\@
12.180 \catcode`\@=11\relax

Now we check whether we should perhaps stop the processing of this file. To do this we first need to check whether the second argument that is passed to \LdfInit is a control sequence. We do that by looking at the first token after passing #2 through string. When it is equal to \@backslashchar we are dealing with a control sequence which we can compare with \@undefined.

12.181 \let\bbl@tempa\relax
12.182 \expandafter\if\expandafter\@backslashchar
12.183  \expandafter\@car\string#2\@nil
12.184  \ifx#2\@undefined

12.185 \else

If so, we call \ldf@quit (but after the end of this \if construction) to set the main language, restore the category code of the @-sign and call \endinput.

12.186  \def\bbl@tempa{\ldf@quit{#1}}

12.187 \fi 12.188 \else

When #2 was not a control sequence we construct one and compare it with \relax.

12.189  \expandafter\ifx\csname#2\endcsname\relax

12.190 \else

12.191  \def\bbl@tempa{\ldf@quit{#1}}

12.192 \fi 12.193 \fi

12.194 \bbl@tempa

Finally we check \orginalTeX.

12.195 \ifx\originalTeX\@undefined
12.196  \let\originalTeX\@empty

12.197 \else

12.198  \originalTeX

12.199 \fi}

\ldf@quit This macro interrupts the processing of a language definition file.

12.200 \def\ldf@quit#1{%
12.201 \expandafter\main@language\expandafter{#1}%
12.202 \catcode`\@=\atcatcode \let\atcatcode\relax
12.203 \endinput

12.204 }

\ldf@finish This macro takes one argument. It is the name of the language that was defined

in the language definition file.

We load the local configuration file if one is present, we set the main language (taking into account that the argument might be a control sequence that needs to be expanded) and reset the category code of the @-sign.

12.205 \def\ldf@finish#1{%
12.206 \loadlocalcfg{#1}
12.207 \expandafter\main@language\expandafter{#1}%
12.208 \catcode`\@=\atcatcode \let\atcatcode\relax

12.209 }

After the preamble of the document the commands \LdfInit, \ldf@quit and \ldf@finish are no longer needed. Therefor they are turned into warning messages in L^{A}TEX.

12.210 \@onlypreamble\LdfInit
12.211 \@onlypreamble\ldf@quit
12.212 \@onlypreamble\ldf@finish

\main@language \bbl@main@language This command should be used in the various language definition files. It stores its argument in \bbl@main@language; to be used to switch to the correct language at the beginning of the document.

12.213 \def\main@language#1{%
12.214 \def\bbl@main@language{#1}%
12.215 \let\languagename\bbl@main@language
12.216 \language=\csname l@\languagename\endcsname\relax

12.217 }

The default is to use English as the main language.

12.218 \ifx\l@english\@undefined
12.219 \let\l@english\z@

12.220 \fi

12.221 \main@language{english}

We also have to make sure that some code gets executed at the beginning of the document.

12.222 \AtBeginDocument{%
12.223 \expandafter\selectlanguage\expandafter{\bbl@main@language}}

12.224 ⟨/core⟩

\originalTeX The macro\originalTeX should be known to TEX at this moment. As it has to

be expandable we \let it to \@empty instead of \relax.

12.225 ⟨∗kernel⟩

12.226 \ifx\originalTeX\@undefined\let\originalTeX\@empty\fi

Because this part of the code can be included in a format, we make sure that the macro which initialises the save mechanism, \babel@beginsave, is not considered to be undefined.

12.227 \ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi

\@nolanerr \@nopatterns The babel package will signal an error when a documents tries to select a language that hasn’t been defined earlier. When a user selects a language for which no hyphenation patterns were loaded into the format he will be given a warning about that fact. We revert to the patterns for \language=0 in that case. In most formats that will be (US)english, but it might also be empty.

When the format knows about \PackageError it must be L^{A}TEX 2ε, so we can safely use its error handling interface. Otherwise we’ll have to ‘keep it simple’.

12.228 \ifx\PackageError\@undefined
12.229 \def\@nolanerr#1{%
12.230  \errhelp{Your command will be ignored, type <return> to proceed}%
12.231  \errmessage{You haven't defined the language #1\space yet}}
12.232 \def\@nopatterns#1{%
12.233  \message{No hyphenation patterns were loaded for}
12.234  \message{the language `#1'}
12.235  \message{I will use the patterns loaded for \string\language=0
12.236  instead}}
12.237 \def\@activated#1{%
12.238  \wlog{Package babel Info: Making #1 an active character}}

12.239 \else

12.240 \newcommand*{\@nolanerr}[1]{%
12.241  \PackageError{babel}%
12.242  {You haven't defined the language #1\space yet}%
12.243  {Your command will be ignored, type <return> to proceed}}

12.244 \newcommand*{\@nopatterns}[1]{%
12.245  \PackageWarningNoLine{babel}%
12.246  {No hyphenation patterns were loaded for\MessageBreak
12.247  the language `#1'\MessageBreak
12.248  I will use the patterns loaded for \string\language=0
12.249  instead}}
12.250 \newcommand*{\@activated}[1]{%
12.251  \PackageInfo{babel}{%
12.252  Making #1 an active character}}

12.253 \fi

The following code is meant to be read by iniTEX because it should instruct TEX to read hyphenation patterns. To this end the docstrip option patterns can be used to include this code in the file hyphen.cfg.

12.254 ⟨∗patterns⟩

\process@line Each line in the file language.dat is processed by \process@line after it is read. The first thing this macro does is to check wether the line starts with =. When the first token of a line is an =, the macro \process@synonym is called; otherwise the macro \process@language will continue.

12.255 \def\process@line#1#2 #3/{%
12.256 \ifx=#1
12.257  \process@synonym#2 /

12.258 \else

12.259  \process@language#1#2 #3/%

12.260 \fi 12.261 }

\process@synonym This macro takes care of the lines which start with an =. It needs an empty token

register to begin with.

12.262 \toks@{}
12.263 \def\process@synonym#1 /{%
12.264 \ifnum\last@language=\m@ne

When no languages have been loaded yet the name following the = will be a synonym for hyphenation register 0.

12.265  \expandafter\chardef\csname l@#1\endcsname0\relax
12.266  \wlog{\string\l@#1=\string\language0}

As no hyphenation patterns are read in yet, we can not yet set the hyphenmin paramaters. Therefor a commands to do so is stored in a token register and executed when the first pattern file has been processed.

12.267  \toks@\expandafter{\the\toks@
12.268  \expandafter\let\csname #1hyphenmins\expandafter\endcsname
12.269  \csname\languagename hyphenmins\endcsname}%

12.270 \else

Otherwise the name will be a synonym for the language loaded last.

12.271  \expandafter\chardef\csname l@#1\endcsname\last@language
12.272  \wlog{\string\l@#1=\string\language\the\last@language}

We also need to copy the hyphenmin paramaters for the synonym.

12.273  \expandafter\let\csname #1hyphenmins\expandafter\endcsname
12.274  \csname\languagename hyphenmins\endcsname

12.275 \fi 12.276 }

\process@language The macro \process@language is used to process a non-empty line from the ‘configuration file’. It has three arguments, each delimited by white space. The third argument is optional, therfore a / character is expected to delimit the last argument. The first argument is the ‘name’ of a language, the second is the name of the file that contains the patterns. The optional third argument is the name of a file containing hyphenation exceptions.

The first thing to do is call \addlanguage to allocate a pattern register and to make that register ‘active’.

12.277 \def\process@language#1 #2 #3/{%
12.278 \expandafter\addlanguage\csname l@#1\endcsname
12.279 \expandafter\language\csname l@#1\endcsname
12.280 \def\languagename{#1}%

Then the ‘name’ of the language that will be loaded now is added to the token register \toks8. and finally the pattern file is read.

12.281 \global\toks8\expandafter{\the\toks8#1, }%

For some hyphenation patterns it is needed to load them with a specific font encoding selected. This can be specified in the file language.dat by adding for instance ‘:T1’ to the name of the language. The macro \bbl@get@enc extracts the font encoding from the language name and stores it in \bbl@hyph@enc.

12.282 \begingroup
12.283  \bbl@get@enc#1:\@@@
12.284  \ifx\bbl@hyph@enc\@empty

12.285 \else

12.286  \fontencoding{\bbl@hyph@enc}\selectfont

12.287 \fi

Some pattern files contain assignments to \lefthyphenmin and \righthyphenmin. TEX does not keep track of these assignments. Therefor we try to detect such assignments and store them in the \⟨lang⟩hyphenmins macro. When no assignments were made we provide a default setting.

12.288  \lefthyphenmin\m@ne

Some pattern files contain changes to the \lccode en \uccode arrays. Such changes should remain local to the language; therefor we process the pattern file in a group; the \patterns command acts globally so it’s effect will be remembered.

12.289  \input #2\relax

Now we globally store the settings of \lefthyphenmin and \righthyphenmin and close the group.

12.290  \ifnum\lefthyphenmin=\m@ne

12.291 \else

12.292  \expandafter\xdef\csname #1hyphenmins\endcsname{%
12.293  \the\lefthyphenmin\the\righthyphenmin}%

12.294 \fi

12.295 \endgroup

If the counter \language is still equal to zero we set the hyphenmin parameters to the values for the language loaded on pattern register 0.

12.296 \ifnum\the\language=\z@

12.297  \expandafter\ifx\csname #1hyphenmins\endcsname\relax
12.298  \set@hyphenmins\tw@\thr@@\relax

12.299 \else

12.300  \expandafter\expandafter\expandafter\set@hyphenmins
12.301  \csname #1hyphenmins\endcsname

12.302 \fi

Now execute the contents of token register zero as it may contain commands which set the hyphenmin parameters for synonyms that were defined before the first pattern file is read in.

12.303  \the\toks@

12.304 \fi

Empty the token register after use.

12.305 \toks@{}%

When the hyphenation patterns have been processed we need to see if a file with hyphenation exceptions needs to be read. This is the case when the third argument is not empty and when it does not contain a space token.

12.306 \def\bbl@tempa{#3}%
12.307 \ifx\bbl@tempa\@empty

12.308 \else

12.309  \ifx\bbl@tempa\space

12.310 \else

12.311  \input #3\relax

12.312 \fi 12.313 \fi 12.314 }

\bbl@get@enc \bbl@hyph@enc The macro \bbl@get@enc extracts the font encoding from the language name and

stores it in \bbl@hyph@enc. It uses delimited arguments to acheive this.

12.315 \def\bbl@get@enc#1:#2\@@@{%

First store both arguments in temporary macros,

12.316 \def\bbl@tempa{#1}%
12.317 \def\bbl@tempb{#2}%

then, if the second argument was empty, no font encoding was specified and we’re done.

12.318 \ifx\bbl@tempb\@empty
12.319  \let\bbl@hyph@enc\@empty

12.320 \else

But if the second argument was not empty it will now have a superfluous colon attached to it which we need to remove. This done by feeding it to \bbl@get@enc. The string that we are after will then be in the first argument and be stored in

\bbl@tempa.
12.321  \bbl@get@enc#2\@@@
12.322  \edef\bbl@hyph@enc{\bbl@tempa}%

12.323 \fi}

\readconfigfile The configuration file can now be opened for reading.

12.324 \openin1 = language.dat

See if the file exists, if not, use the default hyphenation file hyphen.tex. The user will be informed about this.

12.325 \ifeof1
12.326 \message{I couldn't find the file language.dat,\space
12.327  I will try the file hyphen.tex}
12.328 \input hyphen.tex\relax

12.329 \else

Pattern registers are allocated using count register \last@language. Its initial value is 0. The definition of the macro \newlanguage is such that it first increments the count register and then defines the language. In order to have the first patterns loaded in pattern register number 0 we initialize \last@language with the value −1.

12.330 \last@language\m@ne

We now read lines from the file untill the end is found

12.331 \loop

While reading from the input it is useful to switch off recognition of the endof-line character. This saves us stripping off spaces from the contents of the controlsequence.

12.332  \endlinechar\m@ne
12.333  \read1 to \bbl@line
12.334  \endlinechar`\^^M

Empty lines are skipped.

12.335  \ifx\bbl@line\@empty

12.336 \else

Now we add a space and a / character to the end of \bbl@line. This is needed to be able to recognize the third, optional, argument of \process@language later on.

12.337  \edef\bbl@line{\bbl@line\space/}%
12.338  \expandafter\process@line\bbl@line

12.339 \fi

Check for the end of the file. To avoid a new if control sequence we create the necessary \iftrue or \iffalse with the help of \csname. But there is one complication with this approach: when skipping the loop...repeat TEX has to read \if/\fi pairs. So we have to insert a ‘dummy’ \iftrue.

12.340  \iftrue \csname fi\endcsname
12.341  \csname if\ifeof1 false\else true\fi\endcsname
12.342 \repeat

Reactivate the default patterns,

12.343 \language=0

12.344 \fi

and close the configuration file.

12.345 \closein1

Also remove some macros from memory

12.346 \let\process@language\@undefined
12.347 \let\process@synonym\@undefined
12.348 \let\process@line\@undefined

12.349 \let\bbl@tempa\@undefined
12.350 \let\bbl@tempb\@undefined
12.351 \let\bbl@eq@\@undefined
12.352 \let\bbl@line\@undefined
12.353 \let\bbl@get@enc\@undefined

We add a message about the fact that babel is loaded in the format and with which language patterns to the \everyjob register.

12.354 \ifx\addto@hook\@undefined

12.355 \else

12.356 \expandafter\addto@hook\expandafter\everyjob\expandafter{%
12.357  \expandafter\typeout\expandafter{\the\toks8 loaded.}}

12.358 \fi

Here the code for iniTEX ends.

12.359 ⟨/patterns⟩ 12.360 ⟨/kernel⟩

12.3 Support for active characters

\bbl@add@special The macro \bbl@add@special is used to add a new character (or single character

control sequence) to the macro \dospecials (and \@sanitize if L^{A}TEX is used).

To keep all changes local, we begin a new group. Then we redefine the macros \do and \@makeother to add themselves and the given character without expansion.

12.361 ⟨∗core | shorthands⟩

12.362 \def\bbl@add@special#1{\begingroup
12.363  \def\do{\noexpand\do\noexpand}%
12.364  \def\@makeother{\noexpand\@makeother\noexpand}%

To add the character to the macros, we expand the original macros with the additional character inside the redefinition of the macros. Because \@sanitize can be undefined, we put the definition inside a conditional.

12.365  \edef\x{\endgroup
12.366  \def\noexpand\dospecials{\dospecials\do#1}%
12.367  \expandafter\ifx\csname @sanitize\endcsname\relax \else
12.368  \def\noexpand\@sanitize{\@sanitize\@makeother#1}%

12.369 \fi}%

The macro \x contains at this moment the following:

   \endgroup\def\dospecials{old contents \do⟨char⟩}.

If \@sanitize is defined, it contains an additional definition of this macro. The last thing we have to do, is the expansion of \x. Then \endgroup is executed, which restores the old meaning of \x, \do and \@makeother. After the group is closed, the new definition of \dospecials (and \@sanitize) is assigned.

12.370 \x}

\bbl@remove@special The companion of the former macro is \bbl@remove@special. It is used to remove

a character from the set macros \dospecials and \@sanitize.

To keep all changes local, we begin a new group. Then we define a help macro \x, which expands to empty if the characters match, otherwise it expands to its nonexpandable input. Because TEX inserts a \relax, if the corresponding \else or \fi is scanned before the comparison is evaluated, we provide a ‘stop sign’ which should expand to nothing.

12.371 \def\bbl@remove@special#1{\begingroup
12.372  \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty
12.373  \else\noexpand##1\noexpand##2\fi}%

With the help of this macro we define \do and \make@other.

12.374  \def\do{\x\do}%
12.375  \def\@makeother{\x\@makeother}%

The rest of the work is similar to \bbl@add@special.

12.376  \edef\x{\endgroup
12.377  \def\noexpand\dospecials{\dospecials}%
12.378  \expandafter\ifx\csname @sanitize\endcsname\relax \else
12.379  \def\noexpand\@sanitize{\@sanitize}%

12.380 \fi}% 12.381 \x}

12.4 Shorthands

\initiate@active@char A language definition file can call this macro to make a character active. This macro takes one argument, the character that is to be made active. When the character was already active this macro does nothing. Otherwise, this macro defines the control sequence \normal@char⟨char⟩ to expand to the character in its ‘normal state’ and it defines the active character to expand to \normal@char⟨char⟩ by default (⟨char⟩ being the character to be made active). Later its definition can be changed to expand to \active@char⟨char⟩ by calling \bbl@activate{⟨char⟩}.

For example, to make the double quote character active one could have the following line in a language definition file:

    \initiate@active@char{"}

\bbl@afterelse \bbl@afterfi Because the code that is used in the handling of active characters may need to look ahead, we take extra care to ‘throw’ it over the \else and \fi parts of an \if-statement^{5}. These macros will break if another \if...\fi statement appears in one of the arguments.

12.382 \long\def\bbl@afterelse#1\else#2\fi{\fi#1}
12.383 \long\def\bbl@afterfi#1\fi{\fi#1}

\peek@token In order to prevent error messages when a shorthand, which normally takes an argument sees a \par, or }, or similar tokens we need to be able to ‘peek’ at what is coming up next in the input stream. Depending on the category code of the token that is seen we need to either continue the code for the active character, or insert the non-active version of that character in the output. The macro \peek@token therefor takes two arguments, with which it constructs the control sequence to expand next. It \let’s \bbl@nexta and \bbl@nextb to the two possible macro’s. This is necessary for \bbl@test@token to take the right decision.

12.384 %\def\peek@token#1#2{%
12.385 %  \expandafter\let\expandafter\bbl@nexta\csname #1\string#2\endcsname
12.386 %  \expandafter\let\expandafter\bbl@nextb
12.387 %    \csname system@active\string#2\endcsname
12.388 %  \futurelet\bbl@token\bbl@test@token}

5This code is based on code presented in TUGboat vol. 12, no2, June 1991 in “An expansion Power Lemma” by Sonja Maus.

\bbl@test@token When the result of peeking at the next token has yeilded a token with category ‘letter’, ‘other’ or ‘active’ it is safe to proceed with evaluating the code for the shorthand. When a token is found with any other category code proceeding is unsafe and therefor the orginal shorthand character is inserted in the output. The

   macro that calls \bbl@test@token needs to setup \bbl@nexta and \bbl@nextb

in order to achieve this.

12.389 %\def\bbl@test@token{%
12.390 %  \let\bbl@next\bbl@nexta
12.391 %  \ifcat\noexpand\bbl@token a%
12.392 %  \else
12.393 %    \ifcat\noexpand\bbl@token=%
12.394 %    \else
12.395 %      \ifcat\noexpand\bbl@token\noexpand\bbl@next
12.396 %      \else
12.397 %        \let\bbl@next\bbl@nextb

12.398 % \fi 12.399 % \fi 12.400 % \fi

12.401 %  \bbl@next}

The macro \initiate@active@char takes all the necessary actions to make it’s argument a shorthand character. The real work is performed once for each character.

12.402 \def\initiate@active@char#1{%
12.403 \expandafter\ifx\csname active@char\string##1\endcsname\relax
12.404  \bbl@afterfi{\@initiate@active@char{#1}}%

12.405 \fi}

Note that the definition of \@initiate@active@char needs an active character, for this the ~ is used. Some of the changes we need, do not have to become available later on, so we do it inside a group.

12.406 \begingroup
12.407 \catcode`\~\active
12.408 \def\x{\endgroup
12.409  \def\@initiate@active@char##1{%

If the character is already active we provide the default expansion under this shorthand mechanism.

12.410  \ifcat\noexpand##1\noexpand~\relax
12.411  \@ifundefined{normal@char\string##1}{%
12.412  \expandafter\let\csname normal@char\string##1\endcsname##1%
12.413  \expandafter\gdef
12.414  \expandafter##1%
12.415  \expandafter{%
12.416  \expandafter\active@prefix\expandafter##1%
12.417  \csname normal@char\string##1\endcsname}}{}

12.418 \else

Otherwise we write a message in the transcript file,

12.419  \@activated{##1}%

and define \normal@char⟨char⟩ to expand to the character in its default state.

12.420  \@namedef{normal@char\string##1}{##1}%

If we are making the right quote active we need to change \pr@m@s as well.

12.421  \ifx##1'%
12.422  \let\prim@s\bbl@prim@s

Also, make sure that a single ' in math mode ‘does the righth thing’.

12.423  \@namedef{normal@char\string##1}{%
12.424  \textormath{##1}{^\bgroup\prim@s}}%

12.425 \fi

If we are using the caret as a shorthand character special care should be taken to make sure math still works. Therefor an extra level of expansion is introduced with a check for math mode on the upper level.

12.426  \ifx##1^%
12.427  \gdef\bbl@act@caret{%
12.428  \ifmmode
12.429  \csname normal@char\string^\endcsname

12.430 \else

12.431  \bbl@afterfi
12.432  {\if@safe@actives
12.433  \bbl@afterelse\csname normal@char\string##1\endcsname

12.434 \else

12.435  \bbl@afterfi\csname user@active\string##1\endcsname

12.436 \fi}% 12.437 \fi} 12.438 \fi

To prevent problems with the loading of other packages after babel we reset the catcode of the character at the end of the package.

12.439  \@ifpackagewith{babel}{KeepShorthandsActive}{}{%
12.440  \edef\bbl@tempa{\catcode`\noexpand##1\the\catcode`##1}
12.441  \expandafter\AtEndOfPackage\expandafter{\bbl@tempa}}%

Now we set the lowercase code of the ~ equal to that of the character to be made active and execute the rest of the code inside a \lowercase ‘environment’.

12.442  \@tempcnta=\lccode`\~
12.443  \lccode`~=`##1%
12.444  \lowercase{%

Make the character active and add it to \dospecials and \@sanitize.

12.445  \catcode`~\active
12.446  \expandafter\bbl@add@special
12.447  \csname \string##1\endcsname

Also re-activate it again at \begin{document}.

12.448  \AtBeginDocument{%
12.449  \catcode`##1\active

We also need to make sure that the shorthands are active during the processing of the .aux file. Otherwise some citations may give unexpected results in the printout when a shorthand was used in the optional argument of \bibitem for example.

12.450  \if@filesw
12.451  \immediate\write\@mainaux{%
12.452  \string\catcode`##1\string\active}%

12.453 \fi}%

Define the character to expand to

                  \active@prefix ⟨char⟩ \normal@char⟨char⟩

(where \active@char⟨char⟩ is one control sequence!).

12.454  \expandafter\gdef
12.455  \expandafter~%
12.456  \expandafter{%
12.457  \expandafter\active@prefix\expandafter##1%
12.458  \csname normal@char\string##1\endcsname}}%
12.459  \lccode`\~\@tempcnta

12.460 \fi

For the active caret we first expand to \bbl@act@caret in order to be able to handle math mode correctly.

12.461  \ifx##1^%
12.462  \@namedef{active@char\string##1}{\bbl@act@caret}%

12.463 \else

We define the first level expansion of \active@char⟨char⟩ to check the status of the @safe@actives flag. If it is set to true we expand to the ‘normal’ version of this character, otherwise we call \@active@char⟨char⟩.

12.464  \@namedef{active@char\string##1}{%
12.465  \if@safe@actives
12.466  \bbl@afterelse\csname normal@char\string##1\endcsname

12.467 \else

12.468  \bbl@afterfi\csname user@active\string##1\endcsname

12.469 \fi}% 12.470 \fi

The next level of the code checks whether a user has defined a shorthand for himself with this character. First we check for a single character shorthand. If that doesn’t exist we check for a shorthand with an argument.

12.471  \@namedef{user@active\string##1}{%
12.472  \expandafter\ifx
12.473  \csname \user@group @sh@\string##1@\endcsname
12.474  \relax
12.475  \bbl@afterelse\csname @sh@\string##1@sel\endcsname
12.476  {user@active@arg\string##1}{language@active\string##1}%

12.477 \else

12.478  \bbl@afterfi\csname \user@group @sh@\string##1@\endcsname

12.479 \fi}%

When there is also no user-level shorthand with an argument we will check whether there is a language defined shorthand for this active character. Before the next token is absorbed as argument we need to make sure that this is safe. Therefor \peek@token is called to decide that.

12.480  \long\@namedef{user@active@arg\string##1}####1{%
12.481  \expandafter\ifx
12.482  \csname \user@group @sh@\string##1@\string####1@\endcsname
12.483  \relax
12.484  \bbl@afterelse
12.485  \csname language@active\string##1\endcsname####1%

12.486 \else

12.487  \bbl@afterfi
12.488  \csname \user@group @sh@\string##1@\string####1@%
12.489  \endcsname

12.490 \fi}%

In order to do the right thing when a shorthand with an argument is used by itself at the end of the line we provide a definition for the case of an empty argument. For that case we let the shorthand character expand to its non-active self.

12.491  \@namedef{\user@group @sh@\string##1@@}{%
12.492  \csname normal@char\string##1\endcsname}

Like the shorthands that can be defined by the user, a language definition file can also define shorthands with and without an argument, so we need two more macros to check if they exist.

12.493  \@namedef{language@active\string##1}{%
12.494  \expandafter\ifx
12.495  \csname \language@group @sh@\string##1@\endcsname
12.496  \relax
12.497  \bbl@afterelse\csname @sh@\string##1@sel\endcsname
12.498  {language@active@arg\string##1}{system@active\string##1}%

12.499 \else

12.500  \bbl@afterfi
12.501  \csname \language@group @sh@\string##1@\endcsname

12.502 \fi}%

12.503  \long\@namedef{language@active@arg\string##1}####1{%
12.504  \expandafter\ifx
12.505  \csname \language@group @sh@\string##1@\string####1@\endcsname
12.506  \relax
12.507  \bbl@afterelse
12.508  \csname system@active\string##1\endcsname####1%

12.509 \else

12.510  \bbl@afterfi
12.511  \csname \language@group @sh@\string##1@\string####1@%
12.512  \endcsname

12.513 \fi}%

And the same goes for the system level.

12.514  \@namedef{system@active\string##1}{%
12.515  \expandafter\ifx
12.516  \csname \system@group @sh@\string##1@\endcsname
12.517  \relax
12.518  \bbl@afterelse\csname @sh@\string##1@sel\endcsname
12.519  {system@active@arg\string##1}{normal@char\string##1}%

12.520 \else

12.521  \bbl@afterfi\csname \system@group @sh@\string##1@\endcsname

12.522 \fi}%

When no shorthands were found the ‘normal’ version of the active character is inserted.

12.523  \long\@namedef{system@active@arg\string##1}####1{%
12.524  \expandafter\ifx
12.525  \csname \system@group @sh@\string##1@\string####1@\endcsname
12.526  \relax
12.527  \bbl@afterelse\csname normal@char\string##1\endcsname####1%

12.528 \else

12.529  \bbl@afterfi
12.530  \csname \system@group @sh@\string##1@\string####1@\endcsname

12.531 \fi}%

When a shorthand combination such as '' ends up in a heading TEX would see \protect'\protect'. To prevent this from happening a shorthand needs to be defined at user level.

12.532  \@namedef{user@sh@\string##1@\string\protect@}{%
12.533  \csname user@active\string##1\endcsname}%

12.534 }% 12.535 }\x

\active@prefix The command \active@prefix which is used in the expansion of active characters has a function similar to \OT1-cmd in that it \protects the active character

whenever \protect is not \@typeset@protect.
12.536 \def\active@prefix#1{%
12.537 \ifx\protect\@typeset@protect

12.538 \else

12.539  \bbl@afterfi\protect#1\@gobble

12.540 \fi}

\if@safe@actives In some circumstances it is necessary to be able to change the expansion of an active character on the fly. For this purpose the switch @safe@actives is available. The setting of this switch should be checked in the first level expansion of

\active@char⟨char⟩.
12.541 \newif\if@safe@actives
12.542 \@safe@activesfalse

\bbl@activate This macro takes one argument, like \initiate@active@char. The macro is used to change the definition of an active character to expand to \active@char⟨char⟩ instead of \normal@char⟨char⟩.

12.543 \def\bbl@activate#1{%
12.544 \expandafter\def
12.545 \expandafter#1\expandafter{%
12.546  \expandafter\active@prefix
12.547  \expandafter#1\csname active@char\string#1\endcsname}%

12.548 }

\bbl@deactivate This macro takes one argument, like \bbl@activate. The macro doesn’t really make a character non-active; it changes its definition to expand to

\normal@char⟨char⟩.
12.549 \def\bbl@deactivate#1{%
12.550 \expandafter\def
12.551 \expandafter#1\expandafter{%
12.552  \expandafter\active@prefix
12.553  \expandafter#1\csname normal@char\string#1\endcsname}%

12.554 }

\bbl@firstcs \bbl@scndcs These macros have two arguments. They use one of their arguments to build a

control sequence from.

12.555 \def\bbl@firstcs#1#2{\csname#1\endcsname}
12.556 \def\bbl@scndcs#1#2{\csname#2\endcsname}

\declare@shorthand The command \declare@shorthand is used to declare a shorthand on a certain level. It takes three arguments:

1. a name for the collection of shorthands, i.e. ‘system’, or ‘dutch’; 2. the character (sequence) that makes up the shorthand, i.e. ~ or "a;

3. the code to be executed when the shorthand is encountered.

12.557 \def\declare@shorthand#1#2{\@decl@short{#1}#2\@nil}
12.558 \def\@decl@short#1#2#3\@nil#4{%
12.559 \def\bbl@tempa{#3}%
12.560 \ifx\bbl@tempa\@empty
12.561  \expandafter\let\csname @sh@\string#2@sel\endcsname\bbl@scndcs
12.562  \@namedef{#1@sh@\string#2@}{#4}%

12.563 \else

12.564  \expandafter\let\csname @sh@\string#2@sel\endcsname\bbl@firstcs
12.565  \@namedef{#1@sh@\string#2@\string#3@}{#4}%

12.566 \fi}

\textormath Some of the shorthands that will be declared by the language definition files have to be useable in both text and mathmode. To achieve this the helper macro

\textormath is provided.
12.567 \def\textormath#1#2{%
12.568 \ifmmode
12.569  \bbl@afterelse#2%

12.570 \else

12.571  \bbl@afterfi#1%

12.572 \fi}

\user@group \language@group \system@group The current concept of ‘shorthands’ supports three levels or groups of shorthands. For each level the name of the level or group is stored in a macro. The default is to have a user group; use language group ‘english’ and have a system group called ‘system’.

12.573 \def\user@group{user}
12.574 \def\language@group{english}
12.575 \def\system@group{system}

\useshorthands This is the user level command to tell L^{A}TEX that user level shorthands will be used

in the document. It takes one argument, the character that starts a shorthand.

12.576 \def\useshorthands#1{%
12.577 \def\user@group{user}%
12.578 \initiate@active@char{#1}%
12.579 \bbl@activate{#1}}

\defineshorthand Currently we only support one group of user level shorthands, called ‘user’.

12.580 \def\defineshorthand{\declare@shorthand{user}}

\languageshorthands A user level command to change the language from which shorthands are used.

12.581 \def\languageshorthands#1{\def\language@group{#1}}

\aliasshorthand Because we deal with active characters here we need to use the \lccode trick. Therefor we save the current \lccode of the ~-character and restore it later. Then we make the new character active and \let it be equal to the original.

12.582 \def\aliasshorthand#1#2{%
12.583 \@tempcnta\lccode`\~
12.584 \lccode`~=`#2%
12.585 \lowercase{\catcode`~\active\let~#1\catcode`#112\relax}%
12.586 \lccode`\~\@tempcnta}

\shorthandon \shorthandoff The first level definition of these macros just passes the argument on to \bbl@switch@sh, adding \@nil at the end to denote the end of the list of characters.

12.587 \newcommand*\shorthandon[1]{\bbl@switch@sh{on}#1\@nil}
12.588 \newcommand*\shorthandoff[1]{\bbl@switch@sh{off}#1\@nil}

\bbl@switch@sh The macro \bbl@switch@sh takes the list of characters apart one by one and subsequently switches the category code of the shorthand character according to the first argument of \bbl@switch@sh.

12.589 \def\bbl@switch@sh#1#2#3\@nil{%

But before any of this switching takes place we make sure that the character we are dealing with is known as a shorthand character. If it is, a macro such as

\active@char" should exist.
12.590 \@ifundefined{active@char\string#2}{%
12.591  \PackageError{babel}{%
12.592  The character '\string #2' is not a shorthand character
12.593  in \languagename}{%
12.594  Maybe you made a typing mistake?\MessageBreak
12.595  I will ignore your instruction}}{%
12.596  \csname bbl@switch@sh@#1\endcsname#2}

Now that, as the first character in the list has been taken care of, we pass the rest of the list back to \bbl@switch@sh.

12.597 \ifx#3\@empty\else
12.598  \bbl@afterfi\bbl@switch@sh{#1}#3\@nil

12.599 \fi}

\bbl@switch@sh@off All that is left to do is define the actual switching macros. Switching off is easy,

we just set the category code to ‘other’ (12).

12.600 \def\bbl@switch@sh@off#1{\catcode`#112\relax}

\bbl@switch@sh@on But switching the shorthand character back on is a bit more tricky. It involves making sure that we have an active character to begin with when the macro is being defined. It also needs the use of \lowercase and \lccode trickery to get everything to work out as expected. And to keep things local that need to remain local a group is opened, which is closed as soon as \x gets executed.

12.601 \begingroup
12.602 \catcode`\~\active
12.603 \def\x{\endgroup
12.604  \def\bbl@switch@sh@on##1{%
12.605  \lccode`~=`##1%
12.606  \lowercase{%
12.607  \catcode`~\active

12.608 } 12.609 } 12.610 }

The next operation makes the above definition effective.

12.611 \x 12.612 %

To prevent problems with constructs such as \char"01A when the double quote is made active, we define a shorthand on system level.

12.613 \declare@shorthand{system}{"}{\csname normal@char\string"\endcsname}

When the right quote is made active we need to take care of handling it correctly in mathmode. Therefor we define a shorthand at system level to make it expand to a non-active right quote in textmode, but expand to its original definition in mathmode. (Note that the right quote is ‘active’ in mathmode because of its mathcode.)

12.614 \declare@shorthand{system}{'}{%
12.615 \textormath{\csname normal@char\string'\endcsname}%
12.616  {\sp\bgroup\prim@s}}

When the left quote is made active we need to take care of handling it correctly when it is followed by for instance an open brace token. Therefor we define a shorthand at system level to make it expand to a non-active left quote.

12.617 \declare@shorthand{system}{`}{\csname normal@char\string`\endcsname}

\bbl@prim@s \bbl@pr@m@s One of the internal macros that are involved in substituting \prime for each right quote in mathmode is \prim@s. This checks if the next character is a right quote. When the right quote is active, the definition of this macro needs to be adapted to look for an active right quote.

12.618 \def\bbl@prim@s{%
12.619 \prime\futurelet\@let@token\bbl@pr@m@s}
12.620 \begingroup
12.621 \catcode`\'\active\let'\relax
12.622 \def\x{\endgroup
12.623  \def\bbl@pr@m@s{%
12.624  \ifx'\@let@token
12.625  \expandafter\pr@@@s

12.626 \else

12.627  \ifx^\@let@token
12.628  \expandafter\expandafter\expandafter\pr@@@t

12.629 \else

12.630  \egroup

12.631 \fi 12.632 \fi}% 12.633 } 12.634 \x

12.635 ⟨/core | shorthands⟩

Normally the ~ is active and expands to \penalty\@M\␣. When it is written to the .aux file it is written expanded. To prevent that and to be able to use the character ~ as a start character for a shorthand, it is redefined here as a one character shorthand on system level.

12.636 ⟨∗core⟩

12.637 \initiate@active@char{~}
12.638 \declare@shorthand{system}{~}{\leavevmode\nobreak\ }
12.639 \bbl@activate{~}

\OT1dqpos \T1dqpos The position of the double quote character is different for the OT1 and T1 encodings. It will later be selected using the \f@encoding macro. Therefor we define two macros here to store the position of the character in these encodings.

12.640 \expandafter\def\csname OT1dqpos\endcsname{127}
12.641 \expandafter\def\csname T1dqpos\endcsname{4}

When the macro \f@encoding is undefined (as it is in plain TEX) we define it here to expand to OT1

12.642 \ifx\f@encoding\@undefined
12.643 \def\f@encoding{OT1}

12.644 \fi

12.5 Language attributes

Language attributes provide a means to give the user control over which features of the language definition files he wants to enable.

\languageattribute The macro \languageattribute checks whether its arguments are valid and then

activates the selected language attribute.

12.645 \newcommand\languageattribute[2]{%

First check whether the language is known.

12.646 \expandafter\ifx\csname l@#1\endcsname\relax
12.647  \@nolanerr{#1}%

12.648 \else

Than process each attribute in the list.

12.649  \@for\bbl@attr:=#2\do{%

We want to make sure that each attribute is selected only once; therefor we store the already selected attrributes in \bbl@known@attribs. When that control sequence is not yet defined this attribute is certainly not selected before.

12.650  \ifx\bbl@known@attribs\@undefined
12.651  \in@false

12.652 \else

Now we need to see if the attribute occurs in the list of already selected attributes.

12.653  \edef\bbl@tempa{\noexpand\in@{,#1-\bbl@attr,}%
12.654  {,\bbl@known@attribs,}}%
12.655  \bbl@tempa

12.656 \fi

When the attribute was in the list we issue a warning; this might not be the users intention.

12.657  \ifin@
12.658  \PackageWarning{Babel}{%
12.659  You have more than once selected the attribute
12.660  '\bbl@attr'\MessageBreak for language #1}

12.661 \else

When we end up here the attribute is not selected before. So, we add it to the list of selected attributes and execute the associated TEX-code.

12.662  \edef\bbl@tempa{%
12.663  \noexpand\bbl@add@list\noexpand\bbl@known@attribs{#1-\bbl@attr}}
12.664  \bbl@tempa
12.665  \edef\bbl@tempa{#1-\bbl@attr}%
12.666  \expandafter\bbl@ifknown@ttrib\expandafter{\bbl@tempa}\bbl@attributes%
12.667  {\csname#1@attr@\bbl@attr\endcsname}%
12.668  {\@attrerr{#1}{\bbl@attr}}

12.669 \fi 12.670 } 12.671 \fi}

This command should only be used in the preamble of a document.

12.672 \@onlypreamble\languageattribute

The error text to be issued when an unknown attribute is selected.

12.673 \newcommand*{\@attrerr}[2]{%
12.674  \PackageError{babel}%
12.675  {The attribute #2 is unknown for language #1.}%
12.676  {Your command will be ignored, type <return> to proceed}}

\bbl@declare@ttribute This command adds the new language/attribute combination to the list of known

attributes.

12.677 \def\bbl@declare@ttribute#1#2#3{%
12.678 \bbl@add@list\bbl@attributes{#1-#2}%

Then it defines a control sequence to be executed when the attribute is used in a document. The result of this should be that the macro \extras... for the current language is extended, otherwise the attribute will not work as its code is removed

from memory at \begin{document}.
12.679 \expandafter\def\csname#1@attr@#2\endcsname{#3}

12.680 }

\bbl@ifattributeset This internal macro has 4 arguments. It can be used to interprete TEX code based on whether a certain attribute was set. This command should appear inside the argument to \AtBeginDocument because the attributes are set in the document preamble, after babel is loaded.

The first argument is the language, the second argument the attribute being checked on and the third and fourth arguments are the true and false clauses.

12.681 \def\bbl@ifattributeset#1#2#3#4{%

First we need to find out if any attributes were set; if not we’re done.

12.682 \ifx\bbl@known@attribs\@undefined
12.683  \in@false

12.684 \else

The we need to check the list of known attributes.

12.685  \edef\bbl@tempa{\noexpand\in@{,#1-#2,}%
12.686  {,\bbl@known@attribs,}}%
12.687  \bbl@tempa

12.688 \fi

When we’re this far \ifin@ has a value indicating if the attribute in question was set or not. Just to be safe the code to be executed is ‘thrown over the \fi’.

12.689 \ifin@
12.690  \bbl@afterelse#3%

12.691 \else

12.692  \bbl@afterfi#4%

12.693 \fi 12.694 }

\bbl@add@list This internal macro adds it’s second argument to a comma separated list in it’s first argument. When the list is not defined yet (or empty), it will be initiated

12.695 \def\bbl@add@list#1#2{%
12.696 \ifx#1\@undefined
12.697  \def#1{#2}%

12.698 \else

12.699  \ifx#1\@empty
12.700  \def#1{#2}%

12.701 \else

12.702  \edef#1{#1,#2}%

12.703 \fi 12.704 \fi 12.705 }

\bbl@ifknown@ttrib An internal macro to check whether a given language/attribute is known. The macro takes 4 arguments, the language/attribute, the attribute list, the TEX-code to be executed when the attribute is known and the TEX-code to be executed otherwise.

12.706 \def\bbl@ifknown@ttrib#1#2{%

We first assume the attribute is unknwon.

12.707 \let\bbl@tempa\@secondoftwo

Then we loop over the list of known attributes, trying to find a match.

12.708 \@for\bbl@tempb:=#2\do{%
12.709  \expandafter\in@\expandafter{\expandafter,\bbl@tempb,}{,#1,}%
12.710  \ifin@

When a match is found the definition of \bbl@tempa is changed.

12.711  \let\bbl@tempa\@firstoftwo

12.712 \else 12.713 \fi}%

Finally we execute \bbl@tempa.

12.714 \bbl@tempa

12.715 }

\bbl@clear@ttribs This macro removes all the attribute code from L^{A}TEX’s memory at \begin{document}

time (if any is present).

12.716 \def\bbl@clear@ttribs{%
12.717 \ifx\bbl@attributes\@undefined\else
12.718  \@for\bbl@tempa:=\bbl@attributes\do{%
12.719  \expandafter\bbl@clear@ttrib\bbl@tempa.

12.720 }

12.721  \let\bbl@attributes\@undefined

12.722 \fi 12.723 }

12.724 \def\bbl@clear@ttrib#1-#2.{%
12.725 \expandafter\let\csname#1@attr@#2\endcsname\@undefined}
12.726 \AtBeginDocument{\bbl@clear@ttribs}

12.6 Support for saving macro definitions

To save the meaning of control sequences using \babel@save, we use temporary control sequences. To save hash table entries for these control sequences, we don’t use the name of the control sequence to be saved to construct the temporary name. Instead we simply use the value of a counter, which is reset to zero each time we begin to save new values. This works well because we release the saved meanings before we begin to save a new set of control sequence meanings (see

\selectlanguage and \originalTeX).

\babel@savecnt \babel@beginsave The initialization of a new save cycle: reset the counter to zero.

12.727 \def\babel@beginsave{\babel@savecnt\z@}

Before it’s forgotten, allocate the counter and initialize all.

12.728 \newcount\babel@savecnt
12.729 \babel@beginsave

\babel@save The macro \babel@save⟨csname⟩ saves the current meaning of the control sequence ⟨csname⟩ to \originalTeX^{6}. To do this, we let the current meaning to a temporary control sequence, the restore commands are appended to \originalTeX and the counter is incremented.

12.730 \def\babel@save#1{%
12.731 \expandafter\let\csname babel@\number\babel@savecnt\endcsname #1\relax
12.732 \begingroup
12.733  \toks@\expandafter{\originalTeX \let#1=}%
12.734  \edef\x{\endgroup
12.735  \def\noexpand\originalTeX{\the\toks@ \expandafter\noexpand
12.736  \csname babel@\number\babel@savecnt\endcsname\relax}}%

12.737 \x

12.738 \advance\babel@savecnt\@ne}

\babel@savevariable The macro \babel@savevariable⟨variable⟩ saves the value of the variable.

⟨variable⟩ can be anything allowed after the \the primitive.

12.739 \def\babel@savevariable#1{\begingroup
12.740  \toks@\expandafter{\originalTeX #1=}%
12.741  \edef\x{\endgroup
12.742  \def\noexpand\originalTeX{\the\toks@ \the#1\relax}}%

12.743 \x}

\bbl@frenchspacing \bbl@nonfrenchspacing Some languages need to have \frenchspacing in effect. Others don’t want that.

The command \bbl@frenchspacing switches it on when it isn’t already in effect and \bbl@nonfrenchspacing switches it off if necessary.

12.744 \def\bbl@frenchspacing{%
12.745 \ifnum\the\sfcode`\.=\@m
12.746  \let\bbl@nonfrenchspacing\relax

12.747 \else

12.748  \frenchspacing
12.749  \let\bbl@nonfrenchspacing\nonfrenchspacing

12.750 \fi}

12.751 \let\bbl@nonfrenchspacing\nonfrenchspacing

12.7 Support for extending macros

\addto For each language four control sequences have to be defined that control the language-specific definitions. To be able to add something to these macro once they have been defined the macro \addto is introduced. It takes two arguments, a ⟨control sequence⟩ and TEX-code to be added to the ⟨control sequence⟩.

6\originalTeX has to be expandable, i. e. you shouldn’t let it to \relax.

If the ⟨control sequence⟩ has not been defined before it is defined now.

12.752 \def\addto#1#2{%
12.753 \ifx#1\@undefined
12.754  \def#1{#2}

12.755 \else

The control sequence could also expand to \relax, in which case a circular definition results. The net result is a stack overflow.

12.756  \ifx#1\relax
12.757  \def#1{#2}

12.758 \else

Otherwise the replacement text for the ⟨control sequence⟩ is expanded and stored in a token register, together with the TEX-code to be added. Finally the ⟨control sequence⟩ is redefined, using the contents of the token register.

12.759  {\toks@\expandafter{#1#2}%
12.760  \xdef#1{\the\toks@}}%

12.761 \fi 12.762 \fi 12.763 }

12.8 Macros common to a number of languages

\allowhyphens This macro makes hyphenation possible. Basically its definition is nothing more

than \nobreak \hskip 0pt plus 0pt^{7}.
12.764 \def\bbl@t@one{T1}
12.765 \def\allowhyphens{%
12.766 \ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi}
12.767 \def\bbl@allowhyphens{\nobreak\hskip\z@skip}

\set@low@box The following macro is used to lower quotes to the same level as the comma. It

prepares its argument in box register 0.

12.768 \def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}%
12.769  \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@%
12.770  \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@}

\save@sf@q The macro \save@sf@q is used to save and reset the current space factor.

12.771 \def\save@sf@q #1{\leavevmode
12.772 \begingroup
12.773 \edef\@SF{\spacefactor \the\spacefactor}#1\@SF
12.774 \endgroup

12.775 }

\bbl@disc For some languages the macro \bbl@disc is used to ease the insertion of discre-

tionaries for letters that behave ‘abnormally’ at a breakpoint.

12.776 \def\bbl@disc#1#2{%
12.777 \nobreak\discretionary{#2-}{}{#1}\allowhyphens}

7TEX begins and ends a word for hyphenation at a glue node. The penalty prevents a linebreak at this glue node.

12.9 Making glyphs available

The file babel.dtx^{8} makes a number of glyphs available that either do not exist in the OT1 encoding and have to be ‘faked’, or that are not accessible through

   T1enc.def.

12.10 Quotation marks

\quotedblbase In the T1 encoding the opening double quote at the baseline is available as a separate character, accessible via \quotedblbase. In the OT1 encoding it is not available, therefor we make it available by lowering the normal open quote character to the baseline.

12.778 \ProvideTextCommand{\quotedblbase}{OT1}{%
12.779 \save@sf@q{\set@low@box{\textquotedblright\/}%
12.780  \box\z@\kern-.04em\allowhyphens}}

Make sure that when an encoding other then OT1 ot T1 is used this glyph can still be typeset.

12.781 \ProvideTextCommandDefault{\quotedblbase}{%
12.782 \UseTextSymbol{OT1}{\quotedblbase}}

\quotesinglbase We also need the single quote character at the baseline.

12.783 \ProvideTextCommand{\quotesinglbase}{OT1}{%
12.784 \save@sf@q{\set@low@box{\textquoteright\/}%
12.785  \box\z@\kern-.04em\allowhyphens}}

Make sure that when an encoding other then OT1 ot T1 is used this glyph can still be typeset.

12.786 \ProvideTextCommandDefault{\quotesinglbase}{%
12.787 \UseTextSymbol{OT1}{\quotesinglbase}}

\guillemotleft \guillemotright The guillemot characters are not available in OT1 encoding. They are faked.

12.788 \ProvideTextCommand{\guillemotleft}{OT1}{%
12.789 \ifmmode

12.790 \ll 12.791 \else

12.792  \save@sf@q{\nobreak
12.793  \raise.2ex\hbox{$\scriptscriptstyle\ll$}\allowhyphens}%

12.794 \fi}

12.795 \ProvideTextCommand{\guillemotright}{OT1}{%
12.796 \ifmmode

12.797 \gg 12.798 \else

12.799  \save@sf@q{\nobreak
12.800  \raise.2ex\hbox{$\scriptscriptstyle\gg$}\allowhyphens}%

12.801 \fi}

Make sure that when an encoding other then OT1 ot T1 is used these glyphs can still be typeset.

12.802 \ProvideTextCommandDefault{\guillemotleft}{%
12.803 \UseTextSymbol{OT1}{\guillemotleft}}
12.804 \ProvideTextCommandDefault{\guillemotright}{%
12.805 \UseTextSymbol{OT1}{\guillemotright}}

8The file described in this section has version number v3.7g, and was last revised on 2001/02/09.

\guilsinglleft \guilsinglright The single guillemots are not available in OT1 encoding. They are faked.

12.806 \ProvideTextCommand{\guilsinglleft}{OT1}{%
12.807 \ifmmode

12.808 <% 12.809 \else

12.810  \save@sf@q{\nobreak
12.811  \raise.2ex\hbox{$\scriptscriptstyle<$}\allowhyphens}%

12.812 \fi}

12.813 \ProvideTextCommand{\guilsinglright}{OT1}{%
12.814 \ifmmode

12.815 >% 12.816 \else

12.817  \save@sf@q{\nobreak
12.818  \raise.2ex\hbox{$\scriptscriptstyle>$}\allowhyphens}%

12.819 \fi}

Make sure that when an encoding other then OT1 or T1 is used these glyphs can still be typeset.

12.820 \ProvideTextCommandDefault{\guilsinglleft}{%
12.821 \UseTextSymbol{OT1}{\guilsinglleft}}
12.822 \ProvideTextCommandDefault{\guilsinglright}{%
12.823 \UseTextSymbol{OT1}{\guilsinglright}}

12.11 Letters

{\ij \atop \IJ} The dutch language uses the letter ‘ij’. It is available in T1 encoded fonts, but not

in the OT1 encoded fonts. Therefor we fake it for the OT1 encoding.

12.824 \DeclareTextCommand{\ij}{OT1}{%
12.825 \allowhyphens i\kern-0.02em j\allowhyphens}
12.826 \DeclareTextCommand{\IJ}{OT1}{%
12.827 \allowhyphens I\kern-0.02em J\allowhyphens}
12.828 \DeclareTextCommand{\ij}{T1}{\char188}
12.829 \DeclareTextCommand{\IJ}{T1}{\char156}

Make sure that when an encoding other then OT1 or T1 is used these glyphs can still be typeset.

12.830 \ProvideTextCommandDefault{\ij}{%
12.831 \UseTextSymbol{OT1}{\ij}}
12.832 \ProvideTextCommandDefault{\IJ}{%
12.833 \UseTextSymbol{OT1}{\IJ}}

{\dj \atop \DJ} The croatian language needs the letters \dj and \DJ; they are available in the T1

encoding, but not in the OT1 encoding by default.

Some code to construct these glyphs for the OT1 encoding was made available to me by Stipcevic Mario, (stipcevic@olimp.irb.hr).

12.834 \def\crrtic@{\hrule height0.1ex width0.3em}
12.835 \def\crttic@{\hrule height0.1ex width0.33em}

12.836 %

12.837 \def\ddj@{%
12.838 \setbox0\hbox{d}\dimen@=\ht0
12.839 \advance\dimen@1ex
12.840 \dimen@.45\dimen@
12.841 \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@

12.842 \advance\dimen@ii.5ex
12.843 \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crrtic@}}}}
12.844 \def\DDJ@{%
12.845 \setbox0\hbox{D}\dimen@=.55\ht0
12.846 \dimen@ii\expandafter\rem@pt\the\fontdimen\@ne\font\dimen@
12.847 \advance\dimen@ii.15ex %            correction for the dash position
12.848 \advance\dimen@ii-.15\fontdimen7\font %     correction for cmtt font
12.849 \dimen\thr@@\expandafter\rem@pt\the\fontdimen7\font\dimen@
12.850 \leavevmode\rlap{\raise\dimen@\hbox{\kern\dimen@ii\vbox{\crttic@}}}}

12.851 %

12.852 \DeclareTextCommand{\dj}{OT1}{\ddj@ d}
12.853 \DeclareTextCommand{\DJ}{OT1}{\DDJ@ D}

Make sure that when an encoding other then OT1 or T1 is used these glyphs can still be typeset.

12.854 \ProvideTextCommandDefault{\dj}{%
12.855 \UseTextSymbol{OT1}{\dj}}
12.856 \ProvideTextCommandDefault{\DJ}{%
12.857 \UseTextSymbol{OT1}{\DJ}}

\SS For the T1 encoding \SS is defined and selects a specific glyph from the font, but

for other encodings it is not available. Therefor we make it available here.

12.858 \DeclareTextCommand{\SS}{OT1}{SS}
12.859 \ProvideTextCommandDefault{\SS}{\UseTextSymbol{OT1}{\SS}}

12.12 Shorthands for quotation marks

Shorthands are provided for a number of different quotation marks, which make them useable both outside and inside mathmode.

{\glq \atop \grq} The ‘german’ single quotes.

12.860 \DeclareRobustCommand{\glq}{%
12.861 \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}

The definition of \grq depends on the fontencoding. With T1 encoding no extra kerning is needed.

12.862 \ProvideTextCommand{\grq}{T1}{%
12.863 \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
12.864 \ProvideTextCommand{\grq}{OT1}{%
12.865 \save@sf@q{\kern-.0125em%
12.866 \textormath{\textquoteleft}{\mbox{\textquoteleft}}%
12.867 \kern.07em\relax}}
12.868 \ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}

\glqq \grqq The ‘german’ double quotes.

12.869 \DeclareRobustCommand{\glqq}{%
12.870 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}

The definition of \grqq depends on the fontencoding. With T1 encoding no extra kerning is needed.

12.871 \ProvideTextCommand{\grqq}{T1}{%
12.872 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
12.873 \ProvideTextCommand{\grqq}{OT1}{%
12.874 \save@sf@q{\kern-.07em%

12.875 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}%
12.876 \kern.07em\relax}}
12.877 \ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}

{\flq \atop \frq} The ‘french’ single guillemets.

12.878 \DeclareRobustCommand{\flq}{%
12.879 \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
12.880 \DeclareRobustCommand{\frq}{%
12.881 \textormath{\guilsinglright}{\mbox{\guilsinglright}}}

\flqq \frqq The ‘french’ double quillemets.

12.882 \DeclareRobustCommand{\flqq}{%
12.883 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
12.884 \DeclareRobustCommand{\frqq}{%
12.885 \textormath{\guillemotright}{\mbox{\guillemotright}}}

12.13 Umlauts and trema’s

The command \" needs to have a different effect for different languages. For German for instance, the ‘umlaut’ should be positioned lower than the default position for placing it over the letters a, o, u, A, O and U. When placed over an e, i, E or I it can retain its normal position. For Dutch the same glyph is always placed in the lower position.

\umlauthigh \umlautlow To be able to provide both positions of \" we provide two commands to switch

the positioning, the default will be \umlauthigh (the normal positioning).

12.886 \def\umlauthigh{%
12.887 \def\bbl@umlauta##1{{%
12.888  \expandafter\accent\csname\f@encoding dqpos\endcsname
12.889  ##1\allowhyphens}}%
12.890 \let\bbl@umlaute\bbl@umlauta}
12.891 \def\umlautlow{%
12.892 \def\bbl@umlauta{\protect\lower@umlaut}}
12.893 \def\umlautelow{%
12.894 \def\bbl@umlaute{\protect\lower@umlaut}}
12.895 \umlauthigh

\lower@umlaut The command \lower@umlaut is used to position the \" closer the the letter.

We want the umlaut character lowered, nearer to the letter. To do this we need an extra ⟨dimen⟩ register.

12.896 \expandafter\ifx\csname U@D\endcsname\relax
12.897 \csname newdimen\endcsname\U@D

12.898 \fi

The following code fools TEX’s make_accent procedure about the current x-height of the font to force another placement of the umlaut character.

12.899 \def\lower@umlaut#1{%

First we have to save the current x-height of the font, because we’ll change this font dimension and this is always done globally.

12.900 {\U@D 1ex%

Then we compute the new x-height in such a way that the umlaut character is lowered to the base character. The value of .45ex depends on the parameters with which the fonts were built. (Just try out, which value will look best.)

12.901 {\setbox\z@\hbox{%
12.902  \expandafter\char\csname\f@encoding dqpos\endcsname}%
12.903  \dimen@ -.45ex\advance\dimen@\ht\z@

If the new x-height is too low, it is not changed.

12.904 \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%

Finally we call the \accent primitive, reset the old x-height and insert the base character in the argument.

12.905 \expandafter\accent\csname\f@encoding dqpos\endcsname
12.906 \fontdimen5\font\U@D #1}}

For all vowels we declare \" to be a composite command which uses \bbl@umlauta or \bbl@umlaute to position the umlaut character. We need to be sure that these definitions override the ones that are provided when the package fontenc with option OT1 is used. Therefor these declarations are postponed until the beginning of the document.

12.907 \AtBeginDocument{%
12.908 \DeclareTextCompositeCommand{\"}{OT1}{a}{\bbl@umlauta{a}}%
12.909 \DeclareTextCompositeCommand{\"}{OT1}{e}{\bbl@umlaute{e}}%
12.910 \DeclareTextCompositeCommand{\"}{OT1}{i}{\bbl@umlaute{\i}}%
12.911 \DeclareTextCompositeCommand{\"}{OT1}{\i}{\bbl@umlaute{\i}}%
12.912 \DeclareTextCompositeCommand{\"}{OT1}{o}{\bbl@umlauta{o}}%
12.913 \DeclareTextCompositeCommand{\"}{OT1}{u}{\bbl@umlauta{u}}%
12.914 \DeclareTextCompositeCommand{\"}{OT1}{A}{\bbl@umlauta{A}}%
12.915 \DeclareTextCompositeCommand{\"}{OT1}{E}{\bbl@umlaute{E}}%
12.916 \DeclareTextCompositeCommand{\"}{OT1}{I}{\bbl@umlaute{I}}%
12.917 \DeclareTextCompositeCommand{\"}{OT1}{O}{\bbl@umlauta{O}}%
12.918 \DeclareTextCompositeCommand{\"}{OT1}{U}{\bbl@umlauta{U}}%

12.919 }

12.14 The redefinition of the style commands

The rest of the code in this file can only be processed by L^{A}TEX, so we check the current format. If it is plain TEX, processing should stop here. But, because of the need to limit the scope of the definition of \format, a macro that is used locally in the following \if statement, this comparison is done inside a group. To prevent TEX from complaining about an unclosed group, the processing of the command \endinput is deferred until after the group is closed. This is accomplished by the

   command \aftergroup.
12.920 {\def\format{lplain}
12.921 \ifx\fmtname\format

12.922 \else

12.923 \def\format{LaTeX2e}
12.924 \ifx\fmtname\format

12.925 \else

12.926  \aftergroup\endinput

12.927 \fi 12.928 \fi}

Now that we’re sure that the code is seen by L^{A}TEX only, we have to find out what the main (primary) document style is because we want to redefine some macros. This is only necessary for releases of L^{A}TEX dated before december 1991. Therefor this part of the code can optionally be included in babel.def by specifying the docstrip option names.

12.929 ⟨∗names⟩

The standard styles can be distinguished by checking whether some macros are defined. In table 1 an overview is given of the macros that can be used for this purpose.

article : both the \chapter and \opening macros are un-

defined

report and book : the \chapter macro is defined and the \opening is

undefined

letter : the \chapter macro is undefined and the \opening is defined

Table 1: How to determine the main document style

The macros that have to be redefined for the report and book document styles happen to be the same, so there is no need to distinguish between those two styles.

\doc@style First a parameter \doc@style is defined to identify the current document style. This parameter might have been defined by a document style that already uses macros instead of hard-wired texts, such as artikel1.sty [6], so the existence of \doc@style is checked. If this macro is undefined, i. e., if the document style is unknown and could therefor contain hard-wired texts, \doc@style is defined to the default value ‘0’.

12.930 \ifx\@undefined\doc@style
12.931 \def\doc@style{0}%

This parameter is defined in the following if construction (see table 1):

12.932 \ifx\@undefined\opening
12.933  \ifx\@undefined\chapter
12.934  \def\doc@style{1}%

12.935 \else

12.936  \def\doc@style{2}%

12.937 \fi 12.938 \else

12.939  \def\doc@style{3}%

12.940 \fi% 12.941 \fi%

12.14.1 Redefinition of macros

Now here comes the real work: we start to redefine things and replace hard-wired texts by macros. These redefinitions should be carried out conditionally, in case it has already been done.

For the figure and table environments we have in all styles:

12.942 \@ifundefined{figurename}{\def\fnum@figure{\figurename{} \thefigure}}{}
12.943 \@ifundefined{tablename}{\def\fnum@table{\tablename{} \thetable}}{}

The rest of the macros have to be treated differently for each style. When \doc@style still has its default value nothing needs to be done.

12.944 \ifcase \doc@style\relax

12.945 \or

This means that babel.def is read after the article style, where no \chapter and \opening commands are defined^{9}.

      First we have the \tableofcontents, \listoffigures and \listoftables:
12.946 \@ifundefined{contentsname}%
12.947  {\def\tableofcontents{\section*{\contentsname\@mkboth
12.948  {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
12.949  \@starttoc{toc}}}{}

12.950

12.951 \@ifundefined{listfigurename}%
12.952  {\def\listoffigures{\section*{\listfigurename\@mkboth
12.953  {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}
12.954  \@starttoc{lof}}}{}

12.955

12.956 \@ifundefined{listtablename}%
12.957  {\def\listoftables{\section*{\listtablename\@mkboth
12.958  {\uppercase{\listtablename}}{\uppercase{\listtablename}}}
12.959  \@starttoc{lot}}}{}
      Then the \thebibliography and \theindex environments.
12.960 \@ifundefined{refname}%
12.961  {\def\thebibliography#1{\section*{\refname
12.962  \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
12.963  \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
12.964  \leftmargin\labelwidth
12.965  \advance\leftmargin\labelsep
12.966  \usecounter{enumi}}%
12.967  \def\newblock{\hskip.11em plus.33em minus.07em}%
12.968  \sloppy\clubpenalty4000\widowpenalty\clubpenalty
12.969  \sfcode`\.=1000\relax}}{}

12.970

12.971 \@ifundefined{indexname}%
12.972  {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
12.973  \columnseprule \z@
12.974  \columnsep 35pt\twocolumn[\section*{\indexname}]%
12.975  \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
12.976  \thispagestyle{plain}%
12.977  \parskip\z@ plus.3pt\parindent\z@\let\item\@idxitem}}{}

The abstract environment:

12.978 \@ifundefined{abstractname}%
12.979  {\def\abstract{\if@twocolumn
12.980  \section*{\abstractname}%
12.981  \else \small
12.982  \begin{center}%
12.983  {\bf \abstractname\vspace{-.5em}\vspace{\z@}}%
12.984  \end{center}%
12.985  \quotation

9A fact that was pointed out to me by Nico Poppelier and was already used in Piet van Oostrum’s document style option nl.

 12.986  \fi}}{}

And last but not least, the macro \part:

 12.987 \@ifundefined{partname}%
 12.988 {\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne
 12.989  \refstepcounter{part}%
 12.990  \addcontentsline{toc}{part}{\thepart
 12.991  \hspace{1em}#1}\else
 12.992  \addcontentsline{toc}{part}{#1}\fi
 12.993 {\parindent\z@ \raggedright
 12.994  \ifnum \c@secnumdepth >\m@ne
 12.995  \Large \bf \partname{} \thepart
 12.996  \par \nobreak

12.997 \fi

 12.998  \huge \bf
 12.999  #2\markboth{}{}\par}%
12.1000  \nobreak
12.1001  \vskip 3ex\@afterheading}%

12.1002 }{}

This is all that needs to be done for the article style.

12.1003 \or

The next case is formed by the two styles book and report. Basically we have to do the same as for the article style, except now we must also change the

   \chapter command.

The tables of contents, figures and tables:

12.1004 \@ifundefined{contentsname}%
12.1005  {\def\tableofcontents{\@restonecolfalse
12.1006  \if@twocolumn\@restonecoltrue\onecolumn
12.1007  \fi\chapter*{\contentsname\@mkboth
12.1008  {\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
12.1009  \@starttoc{toc}%
12.1010  \csname if@restonecol\endcsname\twocolumn
12.1011  \csname fi\endcsname}}{}

12.1012

12.1013 \@ifundefined{listfigurename}
12.1014  {\def\listoffigures{\@restonecolfalse
12.1015  \if@twocolumn\@restonecoltrue\onecolumn
12.1016  \fi\chapter*{\listfigurename\@mkboth
12.1017  {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}%
12.1018  \@starttoc{lof}%
12.1019  \csname if@restonecol\endcsname\twocolumn
12.1020  \csname fi\endcsname}}{}

12.1021

12.1022 \@ifundefined{listtablename}
12.1023  {\def\listoftables{\@restonecolfalse
12.1024  \if@twocolumn\@restonecoltrue\onecolumn
12.1025  \fi\chapter*{\listtablename\@mkboth
12.1026  {\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
12.1027  \@starttoc{lot}%
12.1028  \csname if@restonecol\endcsname\twocolumn
12.1029  \csname fi\endcsname}}{}

Again, the bibliography and index environments; notice that in this case we use \bibname instead of \refname as in the definitions for the article style. The reason for this is that in the article document style the term ‘References’ is used in the definition of \thebibliography. In the report and book document styles the term ‘Bibliography’ is used.

12.1030 \@ifundefined{bibname}
12.1031  {\def\thebibliography#1{\chapter*{\bibname
12.1032  \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
12.1033  \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
12.1034  \leftmargin\labelwidth \advance\leftmargin\labelsep
12.1035  \usecounter{enumi}}%
12.1036  \def\newblock{\hskip.11em plus.33em minus.07em}%
12.1037  \sloppy\clubpenalty4000\widowpenalty\clubpenalty
12.1038  \sfcode`\.=1000\relax}}{}

12.1039

12.1040 \@ifundefined{indexname}
12.1041  {\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
12.1042  \columnseprule \z@
12.1043  \columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]%
12.1044  \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}%
12.1045  \thispagestyle{plain}%
12.1046  \parskip\z@ plus.3pt\parindent\z@ \let\item\@idxitem}}{}

Here is the abstract environment:

12.1047 \@ifundefined{abstractname}
12.1048  {\def\abstract{\titlepage
12.1049  \null\vfil
12.1050  \begin{center}%
12.1051  {\bf \abstractname}%
12.1052  \end{center}}}{}

And last but not least the \chapter, \appendix and \part macros.

12.1053 \@ifundefined{chaptername}{\def\@chapapp{\chaptername}}{}

12.1054 %

12.1055 \@ifundefined{appendixname}
12.1056  {\def\appendix{\par
12.1057  \setcounter{chapter}{0}%
12.1058  \setcounter{section}{0}%
12.1059  \def\@chapapp{\appendixname}%
12.1060  \def\thechapter{\Alph{chapter}}}}{}

12.1061 %

12.1062 \@ifundefined{partname}
12.1063  {\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax
12.1064  \refstepcounter{part}%
12.1065  \addcontentsline{toc}{part}{\thepart
12.1066  \hspace{1em}#1}\else
12.1067  \addcontentsline{toc}{part}{#1}\fi
12.1068  \markboth{}{}%
12.1069  {\centering
12.1070  \ifnum \c@secnumdepth >-2\relax
12.1071  \huge\bf \partname{} \thepart

12.1072 \par

12.1073  \vskip 20pt \fi
12.1074  \Huge \bf

12.1075  #1\par}\@endpart}}{}%

12.1076 \or

Now we address the case where babel.def is read after the letter style. The letter document style defines the macro \opening and some other macros that are specific to letter. This means that we have to redefine other macros, compared to the previous two cases.

First two macros for the material at the end of a letter, the \cc and \encl macros.

12.1077 \@ifundefined{ccname}%
12.1078  {\def\cc#1{\par\noindent
12.1079  \parbox[t]{\textwidth}%
12.1080  {\@hangfrom{\rm \ccname : }\ignorespaces #1\strut}\par}}{}

12.1081

12.1082 \@ifundefined{enclname}%
12.1083  {\def\encl#1{\par\noindent
12.1084  \parbox[t]{\textwidth}%
12.1085  {\@hangfrom{\rm \enclname : }\ignorespaces #1\strut}\par}}{}

The last thing we have to do here is to redefine the headings pagestyle:

12.1086 \@ifundefined{headtoname}
12.1087  {\def\ps@headings{%
12.1088  \def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil
12.1089  \@date \hfil \pagename{} \thepage}%
12.1090  \def\@oddfoot{}}}{}

This was the last of the four standard document styles, so if \doc@style has another value we do nothing and just close the if construction.

12.1091 \fi

Here ends the code that can be optionally included when a version of L^{A}TEX is in use that is dated before december 1991.

12.1092 ⟨/names⟩ 12.1093 ⟨/core⟩

12.15 Cross referencing macros

The L^{A}TEX book states:

The key argument is any sequence of letters, digits, and punctuation symbols; upper- and lowercase letters are regarded as different.

When the above quote should still be true when a document is typeset in a language that has active characters, special care has to be taken of the category codes of these characters when they appear in an argument of the cross referencing macros.

When a cross referencing command processes its argument, all tokens in this argument should be character tokens with category ‘letter’ or ‘other’.

The only way to accomplish this in most cases is to use the trick described in the TEXbook [1] (Appendix D, page 382). The primitive \meaning applied to a token expands to the current meaning of this token. For example, ‘\meaning\A’ with \A defined as ‘\def\A#1{\B}’ expands to the characters ‘macro:#1->\B’ with all category codes set to ‘other’ or ‘space’.

\bbl@redefine To redefine a command, we save the old meaning of the macro. Then we redefine it to call the original macro with the ‘sanitized’ argument. The reason why we do it this way is that we don’t want to redefine the L^{A}TEX macros completely in case their definitions change (they have changed in the past).

Bacsuse we need to redefine a number of commands we define the command \bbl@redefine which takes care of this. It creates a new control sequence,

   \org@...

12.1094 ⟨∗core | shorthands⟩

12.1095 \def\bbl@redefine#1{%
12.1096 \edef\bbl@tempa{\expandafter\@gobble\string#1}%
12.1097 \expandafter\let\csname org@\bbl@tempa\endcsname#1
12.1098 \expandafter\def\csname\bbl@tempa\endcsname}

This command should only be used in the preamble of the document.

12.1099 \@onlypreamble\bbl@redefine

\bbl@redefine@long This version of \babel@redefine can be used to redefine \long commands such

   as \ifthenelse.
12.1100 \def\bbl@redefine@long#1{%
12.1101 \edef\bbl@tempa{\expandafter\@gobble\string#1}%
12.1102 \expandafter\let\csname org@\bbl@tempa\endcsname#1
12.1103 \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname}
12.1104 \@onlypreamble\bbl@redefine@long

\bbl@redefinerobust For commands that are redefined, but which might be robust we need a slightly more intelligent macro. A robust command foo is defined to expand to \protect\foo␣. So it is necessary to check whether \foo␣ exists.

12.1105 \def\bbl@redefinerobust#1{%
12.1106 \edef\bbl@tempa{\expandafter\@gobble\string#1}%
12.1107 \expandafter\ifx\csname \bbl@tempa\space\endcsname\relax
12.1108  \expandafter\let\csname org@\bbl@tempa\endcsname#1
12.1109  \expandafter\edef\csname\bbl@tempa\endcsname{\noexpand\protect
12.1110  \expandafter\noexpand\csname\bbl@tempa\space\endcsname}%

12.1111 \else

12.1112  \expandafter\let\csname org@\bbl@tempa\expandafter\endcsname
12.1113  \csname\bbl@tempa\space\endcsname

12.1114 \fi

The result of the code above is that the command that is being redefined is always robust afterwards. Therefor all we nee to do now is define \foo␣.

12.1115 \expandafter\def\csname\bbl@tempa\space\endcsname}

This command should only be used in the preamble of the document.

12.1116 \@onlypreamble\bbl@redefinerobust

\newlabel The macro \label writes a line with a \newlabel command into the .aux file to

define labels.

12.1117 %\bbl@redefine\newlabel#1#2{%
12.1118 %  \@safe@activestrue\org@newlabel{#1}{#2}\@safe@activesfalse}

\@newl@bel We need to change the definition of the L^{A}TEX-internal macro \@newl@bel. This is needed because we need to make sure that shorthand characters expand to their non-active version.

12.1119 \def\@newl@bel#1#2#3{%

First we open a new group to keep the changed setting of \protect local and then we set the @safe@actives switch to true to make sure that any shorthand that appears in any of the arguments immediately expands to it’s non-active self.

12.1120 {%

12.1121  \@safe@activestrue
12.1122  \@ifundefined{#1@#2}%

12.1123 \relax 12.1124 {%

12.1125  \gdef \@multiplelabels {%
12.1126  \@latex@warning@no@line{There were multiply-defined labels}}%
12.1127  \@latex@warning@no@line{Label `#2' multiply defined}%

12.1128 }%

12.1129  \global\@namedef{#1@#2}{#3}%

12.1130 }% 12.1131 }

\@testdef An internal L^{A}TEX macro used to test if the labels that have been written on the .aux file have changed. It is called by the \enddocument macro. This macro needs to be completely rewritten, using \meaning. The reason for this is that in some cases the expansion of \#1@#2 contains the same characters as the #3; but the character codes differ. Therefor L^{A}TEX keeps reporting that the labels may have changed.

12.1132 \CheckCommand*\@testdef[3]{%
12.1133 \def\reserved@a{#3}%
12.1134 \expandafter \ifx \csname #1@#2\endcsname \reserved@a

12.1135 \else

12.1136  \@tempswatrue

12.1137 \fi}

Now that we made sure that \@testdef still has the same definition we can rewrite it. First we make the shorthands ‘safe’.

12.1138 \def\@testdef #1#2#3{%
12.1139 \@safe@activestrue

Then we use \bbl@tempa as an ‘alias’ for the macro that contains the label which is being checked.

12.1140 \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname

Then we define \bbl@tempb just as \@newl@bel does it.

12.1141 \def\bbl@tempb{#3}%
12.1142 \@safe@activesfalse

When the label is defined we replace the definition of \bbl@tempa by its meaning.

12.1143 \ifx\bbl@tempa\relax

12.1144 \else

12.1145  \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}%

12.1146 \fi

We do the same for \bbl@tempb.

12.1147 \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%

Whne the label didn’t change \bbl@tempa and \bbl@tempb should be identical macro’s.

12.1148 \ifx \bbl@tempa \bbl@tempb

12.1149 \else

12.1150  \@tempswatrue

12.1151 \fi}

\ref \pageref The same holds for the macro \ref that references a label and \pageref to reference a page. So we redefine \ref and \pageref. While we change these macros, we make them robust as well (if they weren’t already) to prevent problems if they should become expanded at the wrong moment.

12.1152 \bbl@redefinerobust\ref#1{%
12.1153 \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
12.1154 \bbl@redefinerobust\pageref#1{%
12.1155 \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}

\@citex The macro used to cite from a bibliography, \cite, uses an internal macro, \@citex. It is this internal macro that picks up the argument(s), so we redefine this internal macro and leave \cite alone. The first argument is used for typesetting, so the shorthands need only be deactivated in the second argument.

12.1156 \bbl@redefine\@citex[#1]#2{%
12.1157 \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse
12.1158 \org@@citex[#1]{\@tempa}}

Unfortunately, the pakages natbib and cite need a different definition of \@citex... To begin with, natbib has a definition for \@citex with three arguments... We only know that a package is loaded when \begin{document} is executed, so we need to postpone the different redefinition.

12.1159 \AtBeginDocument{%
12.1160 \@ifpackageloaded{natbib}{%

Notice that we use \def here instead of \bbl@redefine because \org@@citex is already defined and we don’t want to overwrite that definition (it would result in parameter stack overflow because of a circular definition).

12.1161  \def\@citex[#1][#2]#3{%
12.1162  \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
12.1163  \org@@citex[#1][#2]{\@tempa}}%

12.1164 }{}}

The package cite has a definition of \@citex where the shorthands need to be turned off in both arguments.

12.1165 \AtBeginDocument{%
12.1166 \@ifpackageloaded{cite}{%
12.1167  \def\@citex[#1]#2{%
12.1168  \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}%

12.1169 }{}}

\nocite The macro \nocite which is used to instruct BiBTEX to extract uncited references

from the database.

12.1170 \bbl@redefine\nocite#1{%
12.1171 \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}

\bibcite The macro that is used in the .aux file to define citation labels. When packages such as natbib or cite are not loaded it’s second argument is used to typeset the citation label. In that case, this second argument can contain active characters but is used in an environment where \@safe@activestrue is in effect. This switch needs to be reset inside the \hbox which contains the citation label. In order to determine during .aux file processing which definition of \bibcite is needed we define \bibcite in such a way that it redefines itself with the proper definition.

12.1172 \bbl@redefine\bibcite{%

We call \bbl@cite@choice to select the proper definition for \bibcite. This new definition is then activated.

12.1173 \bbl@cite@choice
12.1174 \bibcite}

\bbl@bibcite The macro \bbl@bibcite holds the definition of \bibcite needed when neither

natbib nor cite is loaded.

12.1175 \def\bbl@bibcite#1#2{%
12.1176 \org@bibcite{#1}{\@safe@activesfalse#2}}

\bbl@cite@choice The macro \bbl@cite@choice determines which definition of \bibcite is needed.

12.1177 \def\bbl@cite@choice{%

First we give \bibcite its default definition.

12.1178 \global\let\bibcite\bbl@bibcite

Then, when natbib is loaded we restore the original definition of \bibcite .

12.1179 \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}%

For cite we do the same.

12.1180 \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}%

Make sure this only happens once.

12.1181 \global\let\bbl@cite@choice\relax

12.1182 }

When a document is run for the first time no .aux file is available and \bibcite will not yet be properly defined. In this case this has to happen before the document starts.

12.1183 \AtBeginDocument{\bbl@cite@choice}

\@bibitem One of the two internal L^{A}TEX macros called by \bibitem that write the citation

label on the .aux file.

12.1184 \bbl@redefine\@bibitem#1{%
12.1185 \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse}

12.16 marks

\markright \markboth Due to the asynchronous nature of the output routine we need to pass the current language attribute to the head lines together with the text that is put into them. To acheive this we need to adapt the definition of \markright and \markboth somewhat.

12.1186 \bbl@redefine\markright#1{%

First we store the argument to \markright in a scratch token register; this way it will not be expanded by using \edef later on.

12.1187 \toks@{#1}%

Then we define a temporary control sequence using \edef,

12.1188 \edef\bbl@tempa{%

in such a way that only \languagename is expanded.

12.1189  \noexpand\org@markright{%
12.1190  \noexpand\foreignlanguage{\languagename}{\the\toks@}}}%
12.1191 \bbl@tempa

12.1192 }

The definition of \markboth is equivalent to that of \markright, except that we need two token registers.

12.1193 \bbl@redefine\markboth#1#2{%
12.1194 \toks@{#1}\toks8{#2}%
12.1195 \edef\bbl@tempa{%
12.1196  \noexpand\org@markboth{%
12.1197  \noexpand\foreignlanguage{\languagename}{\the\toks@}}{%
12.1198  \noexpand\foreignlanguage{\languagename}{\the\toks8}}}%
12.1199 \bbl@tempa

12.1200 } 12.1201 ⟨/core | shorthands⟩

12.17 Encodig issues (part 2)

\TeX \LaTeX Because documents may use font encodings other than one of the latin encodings, we make sure that the logo’s of TEX and L^{A}TEX always come out in the right encoding.

12.1202 ⟨∗core⟩

12.1203 \bbl@redefine\TeX{\textlatin{\org@TeX}}
12.1204 \bbl@redefine\LaTeX{\textlatin{\org@LaTeX}}

12.1205 ⟨/core⟩

12.18 Preventing clashes with other packages

12.18.1 ifthen

\ifthenelse Sometimes a document writer wants to create a special effect depending on the page a certain fragment of text appears on. This can be acheived by the following piece of code:

    \ifthenelse{\isodd{\pageref{some:label}}}
               {code for odd pages}
               {code for even pages}

In order for this to work the argument of \isodd needs to be fully expandable. With the above redefinition of \pageref it is not in the case of this example. To overcome that, we add some code to the definition of \ifthenelse to make things work.

The first thing we need to do is check if the package ifthen is loaded. This should be done at \begin{document} time.

12.1206 ⟨∗package⟩

12.1207 \AtBeginDocument{%
12.1208 \@ifpackageloaded{ifthen}{%

Then we can redefine \ifthenelse:

12.1209  \bbl@redefine@long\ifthenelse#1#2#3{%

We want to revert the definition of \pageref to its orginal definition for the duration of \ifthenelse, so we first need to store its current meaning.

12.1210  \let\bbl@tempa\pageref
12.1211  \let\pageref\org@pageref

Then we can set the \@safe@actives switch and call the original \ifthenelse. In order to be able to use shorthands in the second and third arguments of \ifthenelse the resetting of the switch and the definition of \pageref happens inside those arguments.

12.1212  \@safe@activestrue
12.1213  \org@ifthenelse{#1}{%
12.1214  \let\pageref\bbl@tempa
12.1215  \@safe@activesfalse

12.1216 #2}{%

12.1217  \let\pageref\bbl@tempa
12.1218  \@safe@activesfalse

12.1219 #3}% 12.1220 }%

When the package wasn’t loaded we do nothing.

12.1221 }{}% 12.1222 }

12.18.2 varioref

\@@vpageref When the package varioref is in use we need to modify its internal command \@@vpageref in order to prevent problems when an active character ends up in the argument of \vref.

12.1223 \AtBeginDocument{%
12.1224 \@ifpackageloaded{varioref}{%
12.1225  \bbl@redefinerobust\@@vpageref#1[#2]#3{%
12.1226  \@safe@activestrue
12.1227  \org@@@vpageref{#1}[#2]{#3}%
12.1228  \@safe@activesfalse}%

12.1229 }{}% 12.1230 }

12.18.3 hhline

\hhline Delaying the activation of the shorthand characters has introduced a problem with the hhline package. The reason is that it uses the ‘:’ character which is made active by the french support in babel. Therefor we need to reload the package when the ‘:’ is an active character.

So at \begin{document} we check whether hhline is loaded.

12.1231 \AtBeginDocument{%
12.1232 \@ifpackageloaded{hhline}

Then we check whether the expansion of \normal@char: is not equal to \relax.

12.1233  {\expandafter\ifx\csname normal@char:\endcsname\relax

12.1234 \else

In that case we simply reload the package. Note that this happens after the category code of the @-sign has been changed to other, so we need to temporarily change it to letter again.

12.1235  \makeatletter
12.1236  \def\@currname{hhline}\input{hhline.sty}\makeatother

12.1237 \fi} 12.1238 {}}

12.18.4 fancyhdr

The package fancyhdr treats the running head and fout lines somehat differently as the standard classes. A simptom of this is that the command \foreignlanguage which babel adds to the marks can end up inside the argument of \MakeUppercase. To prevent unexpected results we need to define

\FOREIGNLANGUAGE here.
12.1239 \AtBeginDocument{%
12.1240 \@ifpackageloaded{fancyhdr}{%
12.1241  \DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
12.1242  \lowercase{\foreignlanguage{#1}}}}{}}

12.1243 ⟨/package⟩

\nfss@catcodes L^{A}TEX’s font selection scheme sometimes wants to read font definition files in the middle of processing the document. In order to guard against any characters having the wrong \catcodes it always calls \nfss@catcodes before loading a file. Unfortunately, the characters " and ' are not dealt with. Therefor we have to add them until L^{A}TEX does that herself.

12.1244 ⟨∗core | shorthands⟩

12.1245 \ifx\nfss@catcodes\@undefined

12.1246 \else

12.1247 \addto\nfss@catcodes{%
12.1248  \@makeother\'%
12.1249  \@makeother\"%

12.1250 } 12.1251 \fi

12.1252 ⟨/core | shorthands⟩

13 Local Language Configuration

\loadlocalcfg At some sites it may be necessary to add site specific actions to a language definition file. This can be done by creating a file with the same name as the language defintion file, but with the extension .cfg. For instance the file norsk.cfg will be loaded when the language definition file norsk.ldf is loaded.

13.1 ⟨∗core⟩

For plain based formats we don’t want to override the definition of \loadlocalcfg

from plain.def.
13.2 \ifx\loadlocalcfg\@undefined
13.3 \def\loadlocalcfg#1{%
13.4  \InputIfFileExists{#1.cfg}
13.5  {\typeout{*************************************^^J%
13.6  * Local config file #1.cfg used^^J%

13.7 *}% 13.8 } 13.9 {}} 13.10 \fi

Just to be compatible with L^{A}TEX 2.09 we add a few more lines of code:

13.11 \ifx\@unexpandable@protect\@undefined
13.12 \def\@unexpandable@protect{\noexpand\protect\noexpand}
13.13 \long\def \protected@write#1#2#3{%
13.14  \begingroup
13.15  \let\thepage\relax

13.16 #2%

13.17  \let\protect\@unexpandable@protect
13.18  \edef\reserved@a{\write#1{#3}}%
13.19  \reserved@a
13.20  \endgroup
13.21  \if@nobreak\ifvmode\nobreak\fi\fi

13.22 } 13.23 \fi 13.24 ⟨/core⟩

14 Driver files for the documented source code

Since babel version 3.4 all source files that are part of the babel system can be typeset separately. But in order to typeset them all in one document the file babel.drv can be used. If you only want the information on how to use the babel system and what goodies are provided by the language spcific files you can run the file user.drv through L^{A}TEX to get a user guide.

14.1 ⟨∗driver⟩

 14.2 \documentclass{ltxdoc}
 14.3 \usepackage{t1enc,supertabular}
 14.4 \usepackage[icelandic,english]{babel}
 14.5 \DoNotIndex{\!,\',\,,\.,\-,\:,\;,\?,\/,\^,\`,\@M}
 14.6 \DoNotIndex{\@,\@ne,\@m,\@afterheading,\@date,\@endpart}
 14.7 \DoNotIndex{\@hangfrom,\@idxitem,\@makeschapterhead,\@mkboth}
 14.8 \DoNotIndex{\@oddfoot,\@oddhead,\@restonecolfalse,\@restonecoltrue}
 14.9 \DoNotIndex{\@starttoc,\@unused}
14.10 \DoNotIndex{\accent,\active}
14.11 \DoNotIndex{\addcontentsline,\advance,\Alph,\arabic}
14.12 \DoNotIndex{\baselineskip,\begin,\begingroup,\bf,\box,\c@secnumdepth}
14.13 \DoNotIndex{\catcode,\centering,\char,\chardef,\clubpenalty}
14.14 \DoNotIndex{\columnsep,\columnseprule,\crcr,\csname}
14.15 \DoNotIndex{\day,\def,\dimen,\discretionary,\divide,\dp,\do}
14.16 \DoNotIndex{\edef,\else,\@empty,\end,\endgroup,\endcsname,\endinput}
14.17 \DoNotIndex{\errhelp,\errmessage,\expandafter,\fi,\filedate}
14.18 \DoNotIndex{\fileversion,\fmtname,\fnum@figure,\fnum@table,\fontdimen}
14.19 \DoNotIndex{\gdef,\global}
14.20 \DoNotIndex{\hbox,\hidewidth,\hfil,\hskip,\hspace,\ht,\Huge,\huge}
14.21 \DoNotIndex{\ialign,\if@twocolumn,\ifcase,\ifcat,\ifhmode,\ifmmode}
14.22 \DoNotIndex{\ifnum,\ifx,\immediate,\ignorespaces,\input,\item}
14.23 \DoNotIndex{\kern}
14.24 \DoNotIndex{\labelsep,\Large,\large,\labelwidth,\lccode,\leftmargin}
14.25 \DoNotIndex{\lineskip,\leavevmode,\let,\list,\ll,\long,\lower}
14.26 \DoNotIndex{\m@ne,\mathchar,\mathaccent,\markboth,\month,\multiply}
14.27 \DoNotIndex{\newblock,\newbox,\newcount,\newdimen,\newif,\newwrite}
14.28 \DoNotIndex{\nobreak,\noexpand,\noindent,\null,\number}
14.29 \DoNotIndex{\onecolumn,\or}
14.30 \DoNotIndex{\p@,par, \parbox,\parindent,\parskip,\penalty}
14.31 \DoNotIndex{\protect,\ps@headings}
14.32 \DoNotIndex{\quotation}
14.33 \DoNotIndex{\raggedright,\raise,\refstepcounter,\relax,\rm,\setbox}
14.34 \DoNotIndex{\section,\setcounter,\settowidth,\scriptscriptstyle}
14.35 \DoNotIndex{\sfcode,\sl,\sloppy,\small,\space,\spacefactor,\strut}
14.36 \DoNotIndex{\string}
14.37 \DoNotIndex{\textwidth,\the,\thechapter,\thefigure,\thepage,\thepart}
14.38 \DoNotIndex{\thetable,\thispagestyle,\titlepage,\tracingmacros}
14.39 \DoNotIndex{\tw@,\twocolumn,\typeout,\uppercase,\usecounter}
14.40 \DoNotIndex{\vbox,\vfil,\vskip,\vspace,\vss}
14.41 \DoNotIndex{\widowpenalty,\write,\xdef,\year,\z@,\z@skip}

Here \dlqq is defined so that an example of "' can be given.

14.42 \makeatletter
14.43 \gdef\dlqq{{\setbox\tw@=\hbox{,}\setbox\z@=\hbox{''}%
14.44 \dimen\z@=\ht\z@ \advance\dimen\z@-\ht\tw@
14.45 \setbox\z@=\hbox{\lower\dimen\z@\box\z@}\ht\z@=\ht\tw@

14.46 \dp\z@=\dp\tw@ \box\z@\kern-.04em}}

The code lines are numbered within sections,

14.47 ⟨∗!user⟩

14.48 \@addtoreset{CodelineNo}{section}
14.49 \renewcommand\theCodelineNo{%
14.50 \reset@font\scriptsize\thesection.\arabic{CodelineNo}}

which should also be visible in the index; hence this redefinition of a macro from

  doc.sty.
14.51 \renewcommand\codeline@wrindex[1]{\if@filesw
14.52  \immediate\write\@indexfile
14.53  {\string\indexentry{#1}%
14.54  {\number\c@section.\number\c@CodelineNo}}\fi}

The glossary environment is used or the change log, but its definition needs changing for this document.

14.55 \renewenvironment{theglossary}{%
14.56  \glossary@prologue%
14.57  \GlossaryParms \let\item\@idxitem \ignorespaces}%

14.58 {} 14.59 ⟨/!user⟩

14.60 \makeatother

A few shorthands used in the documentation

14.61 \font\manual=logo10 % font used for the METAFONT logo, etc.
14.62 \newcommand*\MF{{\manual META}\-{\manual FONT}}
14.63 \newcommand*\TeXhax{\TeX hax}
14.64 \newcommand*\babel{\textsf{babel}}
14.65 \newcommand*\Babel{\textsf{Babel}}
14.66 \newcommand*\m[1]{\mbox{$\langle$\it#1\/$\rangle$}}
14.67 \newcommand*\langvar{\m{lang}}

Some more definitions needed in the documentation.

14.68 %\newcommand*\note[1]{\textbf{#1}}
14.69 \newcommand*\note[1]{}
14.70 \newcommand*\bsl{\protect\bslash}
14.71 \newcommand*\Lopt[1]{\textsf{#1}}
14.72 \newcommand*\Lenv[1]{\textsf{#1}}
14.73 \newcommand*\file[1]{\texttt{#1}}
14.74 \newcommand*\cls[1]{\texttt{#1}}
14.75 \newcommand*\pkg[1]{\texttt{#1}}
14.76 \newcommand*\langdeffile[1]{%

14.77 ⟨−user⟩ \clearpage

14.78 \DocInput{#1}}

When a full index should be generated uncomment the line with \EnableCrossres. Beware, processing may take some time. Use \DisableCrossrefs when the index is ready.

14.79 %  \EnableCrossrefs
14.80 \DisableCrossrefs

Inlude the change log.

14.81 ⟨−user⟩\RecordChanges

The index should use the linenumbers of the code.

14.82 ⟨−user⟩\CodelineIndex

Set everything in \MacroFont instead of \AltMacroFont

 14.83 \setcounter{StandardModuleDepth}{1}

For the user guide we only want the description parts of all the files.

 14.84 ⟨+user⟩\OnlyDescription

Here starts the document

 14.85 \begin{document}
 14.86 \DocInput{babel.dtx}

All the language definition files.

14.87 ⟨+user⟩\clearpage

 14.88 \langdeffile{esperanto.dtx}
 14.89 \langdeffile{dutch.dtx}
 14.90 \langdeffile{english.dtx}
 14.91 \langdeffile{germanb.dtx}
 14.92 \langdeffile{ngermanb.dtx}

14.93 %

 14.94 \langdeffile{breton.dtx}
 14.95 \langdeffile{welsh.dtx}
 14.96 \langdeffile{irish.dtx}
 14.97 \langdeffile{scottish.dtx}

14.98 %

 14.99 \langdeffile{greek.dtx}

14.100 %

14.101 \langdeffile{frenchb.dtx}
14.102 \langdeffile{italian.dtx}
14.103 \langdeffile{latin.dtx}
14.104 \langdeffile{portuges.dtx}
14.105 \langdeffile{spanish.dtx}
14.106 \langdeffile{catalan.dtx}
14.107 \langdeffile{galician.dtx}
14.108 \langdeffile{basque.dtx}
14.109 \langdeffile{romanian.dtx}

14.110 %

14.111 \langdeffile{danish.dtx}
14.112 \langdeffile{icelandic.dtx}
14.113 \langdeffile{norsk.dtx}
14.114 \langdeffile{swedish.dtx}
14.115 \langdeffile{samin.dtx}

14.116 %

14.117 \langdeffile{finnish.dtx}
14.118 \langdeffile{magyar.dtx}
14.119 \langdeffile{estonian.dtx}

14.120 %

14.121 \langdeffile{croatian.dtx}
14.122 \langdeffile{czech.dtx}
14.123 \langdeffile{polish.dtx}
14.124 \langdeffile{serbian.dtx}
14.125 \langdeffile{slovak.dtx}
14.126 \langdeffile{slovene.dtx}
14.127 \langdeffile{russianb.dtx}
14.128 \langdeffile{bulgarian.dtx}
14.129 \langdeffile{ukraineb.dtx}

14.130 %

14.131 \langdeffile{lsorbian.dtx}
14.132 \langdeffile{usorbian.dtx}
14.133 \langdeffile{turkish.dtx}

14.134 %

14.135 \langdeffile{hebrew.dtx}
14.136 \DocInput{hebinp.dtx}
14.137 \DocInput{hebrew.fdd}
14.138 \DocInput{heb209.dtx}
14.139 \DocInput{hebtech.dtx}
14.140 \langdeffile{bahasa.dtx}
14.141 %\langdeffile{sanskrit.dtx}
14.142 %\langdeffile{kannada.dtx}
14.143 %\langdeffile{nagari.dtx}
14.144 %\langdeffile{tamil.dtx}
14.145 \clearpage
14.146 \DocInput{bbplain.dtx}

Finally print the index and change log (not for the user guide).

14.147 ⟨∗!user⟩

14.148 \clearpage
14.149 \def\filename{index}
14.150 \PrintIndex
14.151 \clearpage
14.152 \def\filename{changes}
14.153 \PrintChanges

14.154 ⟨/!user⟩

14.155 \end{document}

14.156 ⟨/driver⟩

15 Conclusion

A system of document options has been presented that enable the user of L^{A}TEX to adapt the standard document classes of L^{A}TEX to the language he or she prefers to use. These options offer the possibility to switch between languages in one document. The basic interface consists of using ones option, which is the same for all standard document classes.

In some cases the language definition files provide macros that can be of use to plain TEX users as well as to L^{A}TEX users. The babel system has been implemented in such a way that it can be used by both groups of users.

16 Acknowledgements

I would like to thank all who volunteered as β-testers for their time. I would like to mention Julio Sanchez who supplied the option file for the Spanish language and Maurizio Codogno who supplied the option file for the Italian language. Michel Goossens supplied contributions for most of the other languages. Nico Poppelier helped polishing the text of the documentation and supplied parts of the macros for the Dutch language. Paul Wackers and Werenfried Spit helped finding and repairing bugs.

During the further development of the babel system I received much help from Bernd Raichle, for which I am grateful.

References

[1] Donald E. Knuth, The TEXbook, Addison-Wesley, 1986.

[2] Leslie Lamport, L^{A}TEX, A document preparation System, Addison-Wesley, 1986.

[3] K.F. Treebus. Tekstwijzer, een gids voor het grafisch verwerken van tekst. SDU Uitgeverij (’s-Gravenhage, 1988). A Dutch book on layout design and typography.

[4] Hubert Partl, German TEX, TUGboat 9 (1988) #1, p. 70–72.

[5] Leslie Lamport, in: TEXhax Digest, Volume 89, #13, 17 februari 1989.

[6] Johannes Braams, Victor Eijkhout and Nico Poppelier, The development of national L^{A}TEX styles, TUGboat 10 (1989) #3, p. 401–406.

[7] Joachim Schrod, International L^{A}TEX is ready to use, TUGboat 11 (1990) #1, p. 87–90.

17 The Esperanto language

The file esperanto.dtx^{10} defines all the language-specific macros for the Esperanto language.

For this language the character ^is made active. In table 2 an overview is given of its purpose.

^c gives ĉ with hyphenation in the rest of the word allowed, this works for c, C, g, G, H, J, s, S, z, Z

^h prevents ĥ from becoming too tall
^j gives ĵ

^u gives ŭ, with hyphenation in the rest of the word

allowed ^U gives Ŭ, with hyphenation in the rest of the word

allowed

          ^| inserts a \discretionary{-}{}{}

Table 2: The functions of the active character for Esperanto.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

17.1 ⟨∗code⟩

17.2 \LdfInit{esperanto}\captionsesperanto

When this file is read as an option, i.e. by the \usepackage command, 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.

17.3 \ifx\l@esperanto\@undefined
17.4 \@nopatterns{Esperanto}
17.5 \adddialect\l@esperanto0\fi

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.

\captionsesperanto The macro \captionsesperanto defines all strings used in the four standard documentclasses provided with L^{A}TEX.

17.6 \addto\captionsesperanto{%
17.7 \def\prefacename{Anta\u{u}parolo}%
17.8 \def\refname{Cita\^\j{}oj}%
17.9 \def\abstractname{Resumo}%
17.10 \def\bibname{Bibliografio}%
17.11 \def\chaptername{{\^C}apitro}%
17.12 \def\appendixname{Apendico}%
17.13 \def\contentsname{Enhavo}%
17.14 \def\listfigurename{Listo de figuroj}%
17.15 \def\listtablename{Listo de tabeloj}%
17.16 \def\indexname{Indekso}%

10The file described in this section has version number ? and was last revised on ?. A contribution was made by Ruiz-Altaba Marti (ruizaltb@cernvm.cern.ch). Code from the file esperant.sty by Jörg Knappen (knappen@vkpmzd.kph.uni-mainz.de) was included.

17.17 \def\figurename{Figuro}%
17.18 \def\tablename{Tabelo}%
17.19 \def\partname{Parto}%
17.20 \def\enclname{Aldono(j)}%
17.21 \def\ccname{Kopie al}%
17.22 \def\headtoname{Al}%
17.23 \def\pagename{Pa\^go}%
17.24 \def\subjectname{Temo}%
17.25 \def\seename{vidu}%   a^u: vd.
17.26 \def\alsoname{vidu anka\u{u}}% a^u vd. anka\u{u}
17.27 \def\proofname{Pruvo}%
17.28 \def\glossaryname{Glossary}% <-- Needs translation

17.29 }

\dateesperanto The macro \dateesperanto redefines the command \today to produce Esperanto

dates.

17.30 \def\dateesperanto{%
17.31 \def\today{\number\day{--a}~de~\ifcase\month\or
17.32  januaro\or februaro\or marto\or aprilo\or majo\or junio\or
17.33  julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
17.34  decembro\fi,\space \number\year}}
\extrasesperanto \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.

17.35 \initiate@active@char{^}

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^.
17.36 \addto\extrasesperanto{\languageshorthands{esperanto}}
17.37 \addto\extrasesperanto{\bbl@activate{^}}
17.38 \addto\noextrasesperanto{\bbl@deactivate{^}}

In order to prevent problems with the active ^we add a shorthand on system level which expands to a ‘normal ^.

17.39 \declare@shorthand{system}{^}{\csname normal@char\string^\endcsname}

And here are the uses of the active ^:

17.40 \declare@shorthand{esperanto}{^c}{\^{c}\allowhyphens}
17.41 \declare@shorthand{esperanto}{^C}{\^{C}\allowhyphens}
17.42 \declare@shorthand{esperanto}{^g}{\^{g}\allowhyphens}
17.43 \declare@shorthand{esperanto}{^G}{\^{G}\allowhyphens}
17.44 \declare@shorthand{esperanto}{^h}{h\llap{\^{}}\allowhyphens}
17.45 \declare@shorthand{esperanto}{^H}{\^{H}\allowhyphens}
17.46 \declare@shorthand{esperanto}{^j}{\^{\j}\allowhyphens}
17.47 \declare@shorthand{esperanto}{^J}{\^{J}\allowhyphens}
17.48 \declare@shorthand{esperanto}{^s}{\^{s}\allowhyphens}
17.49 \declare@shorthand{esperanto}{^S}{\^{S}\allowhyphens}
17.50 \declare@shorthand{esperanto}{^u}{\u u\allowhyphens}

17.51 \declare@shorthand{esperanto}{^U}{\u U\allowhyphens}
17.52 \declare@shorthand{esperanto}{^|}{\discretionary{-}{}{}\allowhyphens}

\Esper \esper In esperant.sty Jörg 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 three steps. First the toplevel.

17.53 \def\esper#1{\@esper{\@nameuse{c@#1}}}
17.54 \def\Esper#1{\@Esper{\@nameuse{c@#1}}}

Then the first five occasions that are probably used the most.

17.55 \def\@esper#1{\ifcase#1\or a\or b\or c\or \^c\or d\else\@iesper{#1}\fi}
17.56 \def\@Esper#1{\ifcase#1\or A\or B\or C\or \^C\or D\else\@Iesper{#1}\fi}

And the 33 other cases.

17.57 \def\@iesper#1{\ifcase#1\or \or \or \or \or \or e\or f\or g\or \^g\or
17.58  h\or h\llap{\^{}}\or i\or j\or \^\j\or k\orl\or m\or n\or o\or
17.59  p\or s\or \^s\or t\or u\or \u{u}\or v\or z\else\@ctrerr\fi}
17.60 \def\@Iesper#1{\ifcase#1\or \or \or \or \or \or E\or F\or G\or \^G\or
17.61  H\or \^H\or I\or J\or \^\J\or K\or L\or M\or N\or O\or
17.62  P\or S\or \^S\or T\or U\or \u{U}\or V\or Z\else\@ctrerr\fi}

\hodiau \hodiaun In esperant.sty Jörg Knappen provides two alternative macros for \today, \hodiau and \hodiaun. The second macro produces an accusative version of the date in Esperanto.

17.63 \addto\dateesperanto{\def\hodiau{la \today}}
17.64 \def\hodiaun{la \number\day --an~de~\ifcase\month\or
17.65 januaro\or februaro\or marto\or aprilo\or majo\or junio\or
17.66 julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
17.67 decembro\fi, \space \number\year}

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.

17.68 \ldf@finish{esperanto}

17.69 ⟨/code⟩

18 The Dutch language

The file dutch.dtx^{11} defines all the language-specific macros for the Dutch language and the ‘Afrikaans’ version^{12} of it.

For this language the character " is made active. In table 3 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 [3] 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, ”This is a quote”, which should be typed as

"`This is a quote"'.

"a \"a which hyphenates as -a; also implemented for

the other letters.

"y puts a negative kern between i and j
"Y puts a negative kern between I and J
"| 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.

Table 3: The extra definitions made by dutch.ldf

18.1 % \changes{dutch-3.8a}{1996/10/04}{made check dependant on
18.2 %    \cs{CurrentOption}}

18.3 %

18.4 %    The macro |\LdfInit| takes care of preventing that this file is
18.5 %    loaded more than once, checking the category code of the
18.6 %    \texttt{@} sign, etc.
18.7 % \changes{dutch-3.8a}{1996/10/30}{Now use \cs{LdfInit} to perform
18.8 %    initial checks}
18.9 %    \begin{macrocode}

18.10 ⟨∗code⟩

18.11 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e. by the \usepackage command, 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.

11The file described in this section has version number v3.8h, and was last revised on 2001/01/30.

12contributed by Stoffel Lombard (lombc@b31pc87.up.ac.za)

First we try to establish with which option we are being processed.

18.12 \def\bbl@tempa{dutch}
18.13 \ifx\CurrentOption\bbl@tempa

If it is dutch then we first check if the Dutch hyphenation patterns wer loaded,

18.14 \ifx\l@dutch\undefined

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.

18.15  \@nopatterns{Dutch}
18.16  \ifx\l@afrikaans\undefined
18.17  \adddialect\l@dutch0
18.18  \else
18.19  \adddialect\l@dutch\l@afrikaans

18.20 \fi 18.21 \fi

The next step consists of defining commands to switch to (and from) the Dutch language.

\captionsdutch The macro \captionsdutch defines all strings used in the four standard document

classes provided with L^{A}TEX.

18.22 \begingroup
18.23  \catcode`\"\active
18.24  \def\x{\endgroup
18.25  \def\captionsdutch{%
18.26  \def\prefacename{Voorwoord}%
18.27  \def\refname{Referenties}%
18.28  \def\abstractname{Samenvatting}%
18.29  \def\bibname{Bibliografie}%
18.30  \def\chaptername{Hoofdstuk}%
18.31  \def\appendixname{B"ylage}%
18.32  \def\contentsname{Inhoudsopgave}%
18.33  \def\listfigurename{L"yst van figuren}%
18.34  \def\listtablename{L"yst van tabellen}%
18.35  \def\indexname{Index}%
18.36  \def\figurename{Figuur}%
18.37  \def\tablename{Tabel}%
18.38  \def\partname{Deel}%
18.39  \def\enclname{B"ylage(n)}%
18.40  \def\ccname{cc}%
18.41  \def\headtoname{Aan}%
18.42  \def\pagename{Pagina}%
18.43  \def\seename{zie}%
18.44  \def\alsoname{zie ook}%
18.45  \def\proofname{Bew"ys}%
18.46  \def\glossaryname{Verklarende Woordenl"yst}%

18.47 } 18.48 }\x

\datedutch The macro \datedutch redefines the command \today to produce Dutch dates.

18.49 \def\datedutch{%
18.50  \def\today{\number\day~\ifcase\month\or

18.51  januari\or februari\or maart\or april\or mei\or juni\or
18.52  juli\or augustus\or september\or oktober\or november\or
18.53  december\fi
18.54  \space \number\year}}

When the option with which this file is being process was not dutch we assume it was afrikaans. We perform a similar check on the availability of the hyphenation paterns.

18.55 \else
18.56 \ifx\l@afrikaans\undefined
18.57  \@nopatterns{Afrikaans}
18.58  \ifx\l@dutch\undefined
18.59  \adddialect\l@afrikaans0
18.60  \else
18.61  \adddialect\l@afrikaans\l@dutch

18.62 \fi 18.63 \fi

\captionsafrikaans Now is the time to define the words for ‘Afrikaans’.

18.64 \def\captionsafrikaans{%
18.65  \def\prefacename{Voorwoord}%
18.66  \def\refname{Verwysings}%
18.67  \def\abstractname{Samevatting}%
18.68  \def\bibname{Bibliografie}%
18.69  \def\chaptername{Hoofstuk}%
18.70  \def\appendixname{Bylae}%
18.71  \def\contentsname{Inhoudsopgawe}%
18.72  \def\listfigurename{Lys van figure}%
18.73  \def\listtablename{Lys van tabelle}%
18.74  \def\indexname{Inhoud}%
18.75  \def\figurename{Figuur}%
18.76  \def\tablename{Tabel}%
18.77  \def\partname{Deel}%
18.78  \def\enclname{Bylae(n)}%
18.79  \def\ccname{a.a.}%
18.80  \def\headtoname{Aan}%
18.81  \def\pagename{Bladsy}%
18.82  \def\seename{sien}%
18.83  \def\alsoname{sien ook}%
18.84  \def\proofname{Bewys}%

18.85 }

\dateafrikaans Here is the ‘Afrikaans’ version of the date macro.

18.86 \def\dateafrikaans{%
18.87  \def\today{\number\day~\ifcase\month\or
18.88  Januarie\or Februarie\or Maart\or April\or Mei\or Junie\or
18.89  Julie\or  Augustus\or September\or Oktober\or November\or
18.90  Desember\fi
18.91  \space \number\year}}

18.92 \fi

\extrasdutch \extrasafrikaans \noextrasdutch \noextrasafrikaans The macros \extrasdutch and \captionsafrikaans will perform all the ex-

tra definitions needed for the Dutch language. The macros \noextrasdutch and noextrasafrikaans is used to cancel the actions of \extrasdutch and

   \captionsafrikaans.

For Dutch the " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the dutch group of shorthands should be used.

 18.93 \initiate@active@char{"}

Both version of the language use the same set of shorthand definitions althoug the ‘ij’ is not used in Afrikaans.

 18.94 \@namedef{extras\CurrentOption}{\languageshorthands{dutch}}
 18.95 \expandafter\addto\csname extras\CurrentOption\endcsname{%
 18.96 \bbl@activate{"}}

The ‘umlaut’ character should be positioned lower on all vowels in Dutch texts.

 18.97 \expandafter\addto\csname extras\CurrentOption\endcsname{%
 18.98 \umlautlow\umlautelow}
 18.99 \@namedef{noextras\CurrentOption}{%
18.100 \umlauthigh}
\dutchhyphenmins \afrikaanshyphenmins The dutch hyphenation patterns can be used with \lefthyphenmin set to 2 and
   \righthyphenmin set to 3.
18.101 \providehyphenmins{\CurrentOption}{\tw@\thr@@}

\@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.

18.102 \def\@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}

Now we can define the doublequote macros: the tremas,

18.103 \declare@shorthand{dutch}{"a}{\textormath{\@trema a}{\ddot a}}
18.104 \declare@shorthand{dutch}{"e}{\textormath{\@trema e}{\ddot e}}
18.105 \declare@shorthand{dutch}{"i}{\textormath
18.106 {\allowhyphens\discretionary{-}{i}{\"{\i}}\allowhyphens}%
18.107 {\ddot \imath}}
18.108 \declare@shorthand{dutch}{"o}{\textormath{\@trema o}{\ddot o}}
18.109 \declare@shorthand{dutch}{"u}{\textormath{\@trema u}{\ddot u}}

dutch quotes,

18.110 \declare@shorthand{dutch}{"`}{%
18.111 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
18.112 \declare@shorthand{dutch}{"'}{%
18.113 \textormath{\textquotedblright}{\mbox{\textquotedblright}}}

and some additional commands:

18.114 \declare@shorthand{dutch}{"-}{\nobreak-\bbl@allowhyphens}
18.115 \declare@shorthand{dutch}{"~}{\textormath{\leavevmode\hbox{-}}{-}}

18.116 \declare@shorthand{dutch}{"|}{%
18.117 \textormath{\discretionary{-}{}{\kern.03em}}{}}
18.118 \declare@shorthand{dutch}{""}{\hskip\z@skip}
18.119 \declare@shorthand{dutch}{"y}{\textormath{\ij{}}{\ddot y}}
18.120 \declare@shorthand{dutch}{"Y}{\textormath{\IJ{}}{\ddot Y}}

To enable hyphenation in two words, written together but separated by a slash, as in ‘uitdrukking/opmerking’ we define the command "/.

18.121 \declare@shorthand{dutch}{"/}{\textormath
18.122 {\allowhyphens\discretionary{/}{}{/}\allowhyphens}{}}

\- 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.

18.123 \expandafter\addto\csname extras\CurrentOption\endcsname{%
18.124 \babel@save\-}
18.125 \expandafter\addto\csname extras\CurrentOption\endcsname{%
18.126 \def\-{\allowhyphens\discretionary{-}{}{}\allowhyphens}}

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.

18.127 \ldf@finish\CurrentOption

18.128 ⟨/code⟩

19 The English language

The file english.dtx^{13} defines all the language definition macros for the English language as well as for the American version of this language.

For this language currently no special definitions are needed or available.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

19.1 ⟨∗code⟩

19.2 \LdfInit\CurrentOption{date\CurrentOption}

When this file is read as an option, i.e. by the \usepackage command, 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.

We allow for the british english patterns to be loaded as either ‘english’, ‘british’, or ‘UKenglish’. When neither of those is known we try to define \l@english

as an alias for \l@american or \l@USenglish.
19.3 \ifx\l@english\@undefined
19.4 \ifx\l@UKenglish\@undefined
19.5  \ifx\l@british\@undefined
19.6  \ifx\l@american\@undefined
19.7  \ifx\l@USenglish\@undefined
19.8  \ifx\l@canadian\@undefined
19.9  \@nopatterns{English}
19.10  \adddialect\l@english0
19.11  \else
19.12  \let\l@english\l@canadian

19.13 \fi

19.14  \else
19.15  \let\l@english\l@USenglish

19.16 \fi

19.17  \else
19.18  \let\l@english\l@american

19.19 \fi

19.20  \else
19.21  \let\l@english\l@british

19.22 \fi

19.23 \else
19.24  \let\l@english\l@UKenglish

19.25 \fi 19.26 \fi

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 has a sensible value; now we make \l@british equal to that. The same holds for \l@UKenglish.

19.27 \ifx\l@british\@undefined
19.28 \let\l@british\l@english

19.29 \fi

19.30 \ifx\l@UKenglish\@undefined
19.31 \let\l@UKenglish\l@english

13The file described in this section has version number v3.3k and was last revised on 2001/02/07.

19.32 \fi

‘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’.

19.33 \ifx\l@american\@undefined
19.34 \ifx\l@USenglish\@undefined

When the patterns are not know as ‘american’ or ‘USenglish’ we add a “dialect”.

19.35  \adddialect\l@american\l@english
19.36 \else
19.37  \let\l@american\l@USenglish

19.38 \fi

19.39 \else

make sure that USenglish is known, even if the patterns were loaded as ‘maerican’.

19.40 \ifx\l@USenglish\@undefined
19.41  \let\l@USenglishl@american

19.42 \fi 19.43 \fi

‘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 candian as well.

19.44 \ifx\l@canadian\@undefined
19.45 \adddialect\l@canadian\l@english

19.46 \fi

The next step consists of defining commands to switch to (and from) the English language.

\captionsenglish The macro \captionsenglish defines all strings used in the four standard docu-

ment classes provided with L^{A}TEX.

19.47 \@namedef{captions\CurrentOption}{%
19.48 \def\prefacename{Preface}%
19.49 \def\refname{References}%
19.50 \def\abstractname{Abstract}%
19.51 \def\bibname{Bibliography}%
19.52 \def\chaptername{Chapter}%
19.53 \def\appendixname{Appendix}%
19.54 \def\contentsname{Contents}%
19.55 \def\listfigurename{List of Figures}%
19.56 \def\listtablename{List of Tables}%
19.57 \def\indexname{Index}%
19.58 \def\figurename{Figure}%
19.59 \def\tablename{Table}%
19.60 \def\partname{Part}%
19.61 \def\enclname{encl}%
19.62 \def\ccname{cc}%
19.63 \def\headtoname{To}%
19.64 \def\pagename{Page}%
19.65 \def\seename{see}%
19.66 \def\alsoname{see also}%
19.67 \def\proofname{Proof}%
19.68 \def\glossaryname{Glossary}%

19.69 }

\dateenglish In order to define \today correctly we need to know whether it should be ‘english’

or ‘american’. We can find this out by checking the value of \CurrentOption.

19.70 \def\bbl@tempa{american}
19.71 \def\bbl@tempb{UK}
19.72 \ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
19.73 \def\bbl@tempa{USenglish}
19.74 \ifx\CurrentOption\bbl@tempa\def\bbl@tempb{US}\fi
19.75 \def\bbl@tempa{UK}

The macro \dateenglish redefines the command \today to produce English dates.

19.76 \ifx\bbl@tempa\bbl@tempb
19.77 \@namedef{date\CurrentOption}{%
19.78  \def\today{\ifcase\day\or
19.79  1st\or 2nd\or 3rd\or 4th\or 5th\or
19.80  6th\or 7th\or 8th\or 9th\or 10th\or
19.81  11th\or 12th\or 13th\or 14th\or 15th\or
19.82  16th\or 17th\or 18th\or 19th\or 20th\or
19.83  21st\or 22nd\or 23rd\or 24th\or 25th\or
19.84  26th\or 27th\or 28th\or 29th\or 30th\or
19.85  31st\fi~\ifcase\month\or
19.86  January\or February\or March\or April\or May\or June\or
19.87  July\or August\or September\or October\or November\or
19.88  December\fi\space \number\year}}

\dateamerican The macro \dateamerican redefines the command \today to produce American

dates.

19.89 \else
19.90 \@namedef{date\CurrentOption}{%
19.91  \def\today{\ifcase\month\or
19.92  January\or February\or March\or April\or May\or June\or
19.93  July\or August\or September\or October\or November\or
19.94  December\fi \space\number\day, \number\year}}

19.95 \fi

\extrasenglish \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.

19.96 \@namedef{extras\CurrentOption}{}
19.97 \@namedef{noextras\CurrentOption}{}

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.

19.98 \ldf@finish\CurrentOption

19.99 ⟨/code⟩

20 The German language

The file germanb.dtx^{14} defines all the language definition macros for the German language as well as for the Austrian dialect of this language^{15}.

For this language the character " is made active. In table 4 an overview is given of its purpose. One of the reasons for this is that in the German language some character combinations change when a word is broken between the combination. Also the vertical placement of the umlaut can be controlled this way. The quotes

"a \"a, also implemented for the other lowercase and

uppercase vowels.

"s to produce the German ß (like \ss{}).
"z to produce the German ß (like \ss{}).
"ck for ck to be hyphenated as k-k.

"ff for ff to be hyphenated as ff-f, this is also imple-

mented for l, m, n, p, r and t

"S for SS to be \uppercase{"s}.
"Z for SZ to be \uppercase{"z}.

"| 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, allow-

ing 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 >>).

Table 4: The extra definitions made by german.ldf

in table 4 can also be typeset by using the commands in table 5.

When this file was read through the option germanb we make it behave as if german was specified.

20.1 \def\bbl@tempa{germanb}
20.2 \ifx\CurrentOption\bbl@tempa
20.3 \def\CurrentOption{german}

20.4 \fi

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

20.5 ⟨∗code⟩

20.6 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e., by the \usepackage command, german will be an ‘unknown’ language, so we have to make it known. So we check for the

14The file described in this section has version number v2.6k and was last revised on 2001/01/26.

15This file is a re-implementation of Hubert Partl’s german.sty version 2.5b, see [4].

\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 (").

Table 5: More commands which produce quotes, defined by german.ldf

existence of \l@german to see whether we have to do something here.

 20.7 \ifx\l@german\@undefined
 20.8 \@nopatterns{German}
 20.9 \adddialect\l@german0

20.10 \fi

For the Austrian version of these definitions we just add another language.

20.11 \adddialect\l@austrian\l@german

The next step consists of defining commands to switch to (and from) the German language.

\captionsgerman \captionsaustrian Either the macro \captionsgerman or the macro \captionsaustrian will define

all strings used in the four standard document classes provided with L^{A}TEX.

20.12 \@namedef{captions\CurrentOption}{%
20.13 \def\prefacename{Vorwort}%
20.14 \def\refname{Literatur}%
20.15 \def\abstractname{Zusammenfassung}%
20.16 \def\bibname{Literaturverzeichnis}%
20.17 \def\chaptername{Kapitel}%
20.18 \def\appendixname{Anhang}%
20.19 \def\contentsname{Inhaltsverzeichnis}%    % oder nur: Inhalt
20.20 \def\listfigurename{Abbildungsverzeichnis}%
20.21 \def\listtablename{Tabellenverzeichnis}%
20.22 \def\indexname{Index}%
20.23 \def\figurename{Abbildung}%
20.24 \def\tablename{Tabelle}%                  % oder: Tafel
20.25 \def\partname{Teil}%
20.26 \def\enclname{Anlage(n)}%                 % oder: Beilage(n)
20.27 \def\ccname{Verteiler}%                   % oder: Kopien an
20.28 \def\headtoname{An}%
20.29 \def\pagename{Seite}%
20.30 \def\seename{siehe}%
20.31 \def\alsoname{siehe auch}%
20.32 \def\proofname{Beweis}%
20.33 \def\glossaryname{Glossar}%

20.34 }

\dategerman The macro \dategerman redefines the command \today to produce German dates.

20.35 \def\month@german{\ifcase\month\or
20.36 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
20.37 Juli\or August\or September\or Oktober\or November\or Dezember\fi}
20.38 \def\dategerman{\def\today{\number\day.~\month@german
20.39  \space\number\year}}

\dateaustrian The macro \dateaustrian redefines the command \today to produce Austrian

version of the German dates.

20.40 \def\dateaustrian{\def\today{\number\day.~\ifnum1=\month
20.41 J\"anner\else \month@german\fi \space\number\year}}
\extrasgerman \extrasaustrian \noextrasgerman \noextrasaustrian Either the macro \extrasgerman or the macros \extrasaustrian will per-

form all the extra definitions needed for the German language. The macro

  \noextrasgerman is used to cancel the actions of \extrasgerman.

For German (as well as for Dutch) the " character is made active. This is done once, later on its definition may vary.

20.42 \initiate@active@char{"}
20.43 \@namedef{extras\CurrentOption}{%
20.44 \languageshorthands{german}}
20.45 \expandafter\addto\csname extras\CurrentOption\endcsname{%
20.46 \bbl@activate{"}}

Don’t forget to turn the shorthands off again.

20.47 \addto\noextrasgerman{\bbl@deactivate{"}}

In order for TEX to be able to hyphenate German words which contain ‘ß’ (in the OT1 position ^^Y) we have to give the character a nonzero \lccode (see Appendix H, the TEXbook).

20.48 \expandafter\addto\csname extras\CurrentOption\endcsname{%
20.49 \babel@savevariable{\lccode25}%
20.50 \lccode25=25}

The umlaut accent macro \" is changed to lower the umlaut dots. The redefinition is done with the help of \umlautlow.

20.51 \expandafter\addto\csname extras\CurrentOption\endcsname{%
20.52 \babel@save\"\umlautlow}
20.53 \@namedef{noextras\CurrentOption}{\umlauthigh}

The german hyphenation patterns can be used with \lefthyphenmin and

  \righthyphenmin set to 2.
20.54 \providehyphenmins{\CurrentOption}{\tw@\tw@}

For German texts we need to make sure that \frenchspacing is turned on.

20.55 \expandafter\addto\csname extras\CurrentOption\endcsname{%
20.56 \bbl@frenchspacing}
20.57 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
20.58 \bbl@nonfrenchspacing}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 4.

To be able to define the function of ", we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

20.59 \begingroup \catcode`\"12
20.60 \def\x{\endgroup
20.61 \def\@SS{\mathchar"7019 }
20.62 \def\dq{"}}

20.63 \x

Now we can define the doublequote macros: the umlauts,

20.64 \declare@shorthand{german}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
20.65 \declare@shorthand{german}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
20.66 \declare@shorthand{german}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
20.67 \declare@shorthand{german}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
20.68 \declare@shorthand{german}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
20.69 \declare@shorthand{german}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}

tremas,

20.70 \declare@shorthand{german}{"e}{\textormath{\"{e}}{\ddot e}}
20.71 \declare@shorthand{german}{"E}{\textormath{\"{E}}{\ddot E}}
20.72 \declare@shorthand{german}{"i}{\textormath{\"{\i}}%
20.73  {\ddot\imath}}
20.74 \declare@shorthand{german}{"I}{\textormath{\"{I}}{\ddot I}}

german es-zet (sharp s),

20.75 \declare@shorthand{german}{"s}{\textormath{\ss}{\@SS{}}}
20.76 \declare@shorthand{german}{"S}{\SS}
20.77 \declare@shorthand{german}{"z}{\textormath{\ss}{\@SS{}}}
20.78 \declare@shorthand{german}{"Z}{SZ}

german and french quotes,

20.79 \declare@shorthand{german}{"`}{\glqq}
20.80 \declare@shorthand{german}{"'}{\grqq}
20.81 \declare@shorthand{german}{"<}{\flqq}
20.82 \declare@shorthand{german}{">}{\frqq}

discretionary commands

20.83 \declare@shorthand{german}{"c}{\textormath{\bbl@disc ck}{c}}
20.84 \declare@shorthand{german}{"C}{\textormath{\bbl@disc CK}{C}}
20.85 \declare@shorthand{german}{"F}{\textormath{\bbl@disc F{FF}}{F}}
20.86 \declare@shorthand{german}{"l}{\textormath{\bbl@disc l{ll}}{l}}
20.87 \declare@shorthand{german}{"L}{\textormath{\bbl@disc L{LL}}{L}}
20.88 \declare@shorthand{german}{"m}{\textormath{\bbl@disc m{mm}}{m}}
20.89 \declare@shorthand{german}{"M}{\textormath{\bbl@disc M{MM}}{M}}
20.90 \declare@shorthand{german}{"n}{\textormath{\bbl@disc n{nn}}{n}}
20.91 \declare@shorthand{german}{"N}{\textormath{\bbl@disc N{NN}}{N}}
20.92 \declare@shorthand{german}{"p}{\textormath{\bbl@disc p{pp}}{p}}
20.93 \declare@shorthand{german}{"P}{\textormath{\bbl@disc P{PP}}{P}}
20.94 \declare@shorthand{german}{"r}{\textormath{\bbl@disc r{rr}}{r}}
20.95 \declare@shorthand{german}{"R}{\textormath{\bbl@disc R{RR}}{R}}
20.96 \declare@shorthand{german}{"t}{\textormath{\bbl@disc t{tt}}{t}}
20.97 \declare@shorthand{german}{"T}{\textormath{\bbl@disc T{TT}}{T}}

We need to treat "f a bit differently in order to preserve the ff-ligature.

20.98 \declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}}
20.99 \def\bbl@discff{\penalty\@M
20.100 \afterassignment\bbl@insertff \let\bbl@nextff= }

20.101 \def\bbl@insertff{%
20.102 \if f\bbl@nextff
20.103  \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
20.104 {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
20.105 \let\bbl@nextff=f

and some additional commands:

20.106 \declare@shorthand{german}{"-}{\nobreak\-\bbl@allowhyphens}
20.107 \declare@shorthand{german}{"|}{%
20.108 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
20.109  \allowhyphens}{}}
20.110 \declare@shorthand{german}{""}{\hskip\z@skip}
20.111 \declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
20.112 \declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip}

\mdqon \mdqoff \ck All that’s left to do now is to define a couple of commands for reasons of compat-

ibility with german.sty.

20.113 \def\mdqon{\shorthandon{"}}
20.114 \def\mdqoff{\shorthandoff{"}}
20.115 \def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}

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.

20.116 \ldf@finish\CurrentOption

20.117 ⟨/code⟩

21 The German language – new orthography

The file ngermanb.dtx^{16} defines all the language definition macros for the German language with the ‘new orthography’ introduced in August 1998. This includes also the Austrian dialect of this language.

As with the ‘traditional’ German orthography, the character " is made active, and the commands in table 4 can be used, except for "ck and "ff etc., which are no longer required.

The internal language names are ngerman and naustrian.

When this file was read through the option ngermanb we make it behave as if ngerman was specified.

21.1 \def\bbl@tempa{ngermanb}
21.2 \ifx\CurrentOption\bbl@tempa
21.3 \def\CurrentOption{ngerman}

21.4 \fi

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

21.5 ⟨∗code⟩

21.6 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e., by the \usepackage command, ngerman will be an ‘unknown’ language, so we have to make it known. So we check for the existence of \l@ngerman to see whether we have to do something here.

21.7 \ifx\l@ngerman\@undefined
21.8 \@nopatterns{ngerman}
21.9 \adddialect\l@ngerman0

21.10 \fi

For the Austrian version of these definitions we just add another language.

21.11 \adddialect\l@naustrian\l@ngerman

The next step consists of defining commands to switch to (and from) the German language.

\captionsngerman \captionsnaustrian Either the macro \captionnsgerman or the macro \captionsnaustrian will

define all strings used in the four standard document classes provided with L^{A}TEX.

21.12 \@namedef{captions\CurrentOption}{%
21.13 \def\prefacename{Vorwort}%
21.14 \def\refname{Literatur}%
21.15 \def\abstractname{Zusammenfassung}%
21.16 \def\bibname{Literaturverzeichnis}%
21.17 \def\chaptername{Kapitel}%
21.18 \def\appendixname{Anhang}%
21.19 \def\contentsname{Inhaltsverzeichnis}%    % oder nur: Inhalt
21.20 \def\listfigurename{Abbildungsverzeichnis}%
21.21 \def\listtablename{Tabellenverzeichnis}%
21.22 \def\indexname{Index}%
21.23 \def\figurename{Abbildung}%
21.24 \def\tablename{Tabelle}%                  % oder: Tafel
21.25 \def\partname{Teil}%

16The file described in this section has version number v2.6m and was last revised on 2001/02/06.

21.26 \def\enclname{Anlage(n)}%                 % oder: Beilage(n)
21.27 \def\ccname{Verteiler}%                   % oder: Kopien an
21.28 \def\headtoname{An}%
21.29 \def\pagename{Seite}%
21.30 \def\seename{siehe}%
21.31 \def\alsoname{siehe auch}%
21.32 \def\proofname{Beweis}%
21.33 \def\glossaryname{Glossar}%

21.34 }

\datengerman The macro \datengerman redefines the command \today to produce German

dates.

21.35 \def\month@ngerman{\ifcase\month\or
21.36 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
21.37 Juli\or August\or September\or Oktober\or November\or Dezember\fi}
21.38 \def\datengerman{\def\today{\number\day.~\month@ngerman
21.39  \space\number\year}}

\dateanustrian The macro \datenaustrian redefines the command \today to produce Austrian

version of the German dates.

21.40 \def\datenaustrian{\def\today{\number\day.~\ifnum1=\month
21.41 J\"anner\else \month@ngerman\fi \space\number\year}}
\extrasngerman \extrasnaustrian \noextrasngerman \noextrasnaustrian Either the macro \extrasngerman or the macros \extrasnaustrian will per-

form all the extra definitions needed for the German language. The macro

  \noextrasngerman is used to cancel the actions of \extrasngerman.

For German (as well as for Dutch) the " character is made active. This is done once, later on its definition may vary.

21.42 \initiate@active@char{"}
21.43 \@namedef{extras\CurrentOption}{%
21.44 \languageshorthands{ngerman}}
21.45 \expandafter\addto\csname extras\CurrentOption\endcsname{%
21.46 \bbl@activate{"}}

Don’t forget to turn the shorthands off again.

21.47 \addto\noextrasngerman{\bbl@deactivate{"}}

In order for TEX to be able to hyphenate German words which contain ‘ß’ (in the OT1 position ^^Y) we have to give the character a nonzero \lccode (see Appendix H, the TEXbook).

21.48 \expandafter\addto\csname extras\CurrentOption\endcsname{%
21.49 \babel@savevariable{\lccode25}%
21.50 \lccode25=25}

The umlaut accent macro \" is changed to lower the umlaut dots. The redefinition is done with the help of \umlautlow.

21.51 \expandafter\addto\csname extras\CurrentOption\endcsname{%
21.52 \babel@save\"\umlautlow}
21.53 \@namedef{noextras\CurrentOption}{\umlauthigh}

The current version of the ‘new’ German hyphenation patterns (dehyphn.tex is

  to be used with \lefthyphenmin and \righthyphenmin set to 2.
21.54 \providehyphenmins{\CurrentOption}{\tw@\tw@}

For German texts we need to make sure that \frenchspacing is turned on.

21.55 \expandafter\addto\csname extras\CurrentOption\endcsname{%
21.56 \bbl@frenchspacing}
21.57 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
21.58 \bbl@nonfrenchspacing}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 4.

To be able to define the function of ", we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

21.59 \begingroup \catcode`\"12
21.60 \def\x{\endgroup
21.61 \def\@SS{\mathchar"7019 }
21.62 \def\dq{"}}

21.63 \x

Now we can define the doublequote macros: the umlauts,

21.64 \declare@shorthand{ngerman}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
21.65 \declare@shorthand{ngerman}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
21.66 \declare@shorthand{ngerman}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
21.67 \declare@shorthand{ngerman}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
21.68 \declare@shorthand{ngerman}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
21.69 \declare@shorthand{ngerman}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}

tremas,

21.70 \declare@shorthand{ngerman}{"e}{\textormath{\"{e}}{\ddot e}}
21.71 \declare@shorthand{ngerman}{"E}{\textormath{\"{E}}{\ddot E}}
21.72 \declare@shorthand{ngerman}{"i}{\textormath{\"{\i}}%
21.73  {\ddot\imath}}
21.74 \declare@shorthand{ngerman}{"I}{\textormath{\"{I}}{\ddot I}}

german es-zet (sharp s),

21.75 \declare@shorthand{ngerman}{"s}{\textormath{\ss}{\@SS{}}}
21.76 \declare@shorthand{ngerman}{"S}{\SS}
21.77 \declare@shorthand{ngerman}{"z}{\textormath{\ss}{\@SS{}}}
21.78 \declare@shorthand{ngerman}{"Z}{SZ}

german and french quotes,

21.79 \declare@shorthand{ngerman}{"`}{\glqq}
21.80 \declare@shorthand{ngerman}{"'}{\grqq}
21.81 \declare@shorthand{ngerman}{"<}{\flqq}
21.82 \declare@shorthand{ngerman}{">}{\frqq}

and some additional commands:

21.83 \declare@shorthand{ngerman}{"-}{\nobreak\-\bbl@allowhyphens}
21.84 \declare@shorthand{ngerman}{"|}{%
21.85 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
21.86  \allowhyphens}{}}
21.87 \declare@shorthand{ngerman}{""}{\hskip\z@skip}
21.88 \declare@shorthand{ngerman}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
21.89 \declare@shorthand{ngerman}{"=}{\penalty\@M-\hskip\z@skip}

\mdqon \mdqoff All that’s left to do now is to define a couple of commands for reasons of compat-

ibility with german.sty.

21.90 \def\mdqon{\shorthandon{"}}
21.91 \def\mdqoff{\shorthandoff{"}}

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.

21.92 \ldf@finish\CurrentOption

21.93 ⟨/code⟩

22 The Breton language

The file breton.dtx^{17} 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 :, ;, ! and ? are made active in order to get a whitespace automatically before these characters.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

22.1 ⟨∗code⟩

22.2 \LdfInit{breton}\captionsbreton

When this file is read as an option, i.e. by the \usepackage command, 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.

22.3 \ifx\l@breton\@undefined
22.4  \@nopatterns{Breton}
22.5  \adddialect\l@breton0\fi

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.

\captionsbreton The macro \captionsbreton defines all strings used in the four standard document classes provided with L^{A}TEX.

22.6 \addto\captionsbreton{%
22.7 \def\prefacename{Rakskrid}%
22.8 \def\refname{Daveenno\`u}%
22.9 \def\abstractname{Dvierra\~n}%
22.10 \def\bibname{Lennadurezh}%
22.11 \def\chaptername{Pennad}%
22.12 \def\appendixname{Stagadenn}%
22.13 \def\contentsname{Taolenn}%
22.14 \def\listfigurename{Listenn ar Figurenno\`u}%
22.15 \def\listtablename{Listenn an taolenno\`u}%
22.16 \def\indexname{Meneger}%
22.17 \def\figurename{Figurenn}%
22.18 \def\tablename{Taolenn}%
22.19 \def\partname{Lodenn}%
22.20 \def\enclname{Diello\`u kevret}%
22.21 \def\ccname{Eilskrid da}%
22.22 \def\headtoname{evit}
22.23 \def\pagename{Pajenn}%
22.24 \def\seename{Gwelout}%
22.25 \def\alsoname{Gwelout ivez}%
22.26 \def\proofname{Proof}%  <-- needs translation
22.27 \def\glossaryname{Glossary}% <-- Needs translation

22.28 }

17The file described in this section has version number v1.0h and was last revised on 2001/02/19.

\datebreton The macro \datebreton redefines the command \today to produce Breton dates.

22.29 \def\datebreton{%
22.30 \def\today{\ifnum\day=1\relax 1\/$^{\rm a\tilde{n}}$\else
22.31  \number\day\fi \space a\space viz\space\ifcase\month\or
22.32  Genver\or C'hwevrer\or Meurzh\or Ebrel\or Mae\or Mezheven\or
22.33  Gouere\or Eost\or Gwengolo\or Here\or Du\or Kerzu\fi
22.34  \space\number\year}}

\extrasbreton \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 :, ;, ! and ? is made \active to insert a little white space.

22.35 \initiate@active@char{:}
22.36 \initiate@active@char{;}
22.37 \initiate@active@char{!}
22.38 \initiate@active@char{?}

We specify that the breton group of shorthands should be used.

22.39 \addto\extrasbreton{\languageshorthands{breton}}

These characters are ‘turned on’ once, later their definition may vary.

22.40 \addto\extrasbreton{%
22.41 \bbl@activate{:}\bbl@activate{;}%
22.42 \bbl@activate{!}\bbl@activate{?}}

Don’t forget to turn the shorthands off again.

22.43 \addto\noextrasbreton{%
22.44 \bbl@deactivate{:}\bbl@deactivate{;}%
22.45 \bbl@deactivate{!}\bbl@deactivate{?}}

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.

22.46 \addto\extrasbreton{\bbl@frenchspacing}
22.47 \addto\noextrasbreton{\bbl@nonfrenchspacing}

\breton@sh@;@ We have to reduce the amount of white space before ;, : and ! when the user types a space in front of these characters. This should only happen outside mathmode, hence the test with \ifmmode.

22.48 \declare@shorthand{breton}{;}{%
22.49  \ifmmode
22.50  \string;\space
22.51  \else\relax

In horizontal mode we check for the presence of a ‘space’ and replace it by a

  \thinspace.
22.52  \ifhmode
22.53  \ifdim\lastskip>\z@
22.54  \unskip\penalty\@M\thinspace

22.55 \fi 22.56 \fi

22.57  \string;\space
22.58  \fi}%

\breton@sh@:@ \breton@sh@!@ Because these definitions are very similar only one is displayed in a way that the

definition can be easily checked.

22.59 \declare@shorthand{breton}{:}{%
22.60 \ifmmode\string:\space
22.61 \else\relax
22.62  \ifhmode
22.63  \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi

22.64 \fi

22.65  \string:\space

22.66 \fi}

22.67 \declare@shorthand{breton}{!}{%
22.68 \ifmmode\string!\space
22.69 \else\relax
22.70  \ifhmode
22.71  \ifdim\lastskip>\z@\unskip\penalty\@M\thinspace\fi

22.72 \fi

22.73  \string!\space

22.74 \fi}

\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.

22.75 \declare@shorthand{breton}{?}{%
22.76 \ifmmode
22.77  \string?\space
22.78 \else\relax
22.79  \ifhmode
22.80  \ifdim\lastskip>\z@
22.81  \unskip
22.82  \kern\fontdimen2\font
22.83  \kern-1.4\fontdimen3\font

22.84 \fi 22.85 \fi

22.86  \string?\space

22.87 \fi}

All that is left to do now is provide the breton user with some extra utilities. Some definitions for special characters.

22.88 \DeclareTextSymbol{\at}{OT1}{64}
22.89 \DeclareTextSymbol{\at}{T1}{64}
22.90 \DeclareTextSymbolDefault{\at}{OT1}
22.91 \DeclareTextSymbol{\boi}{OT1}{92}
22.92 \DeclareTextSymbol{\boi}{T1}{16}
22.93 \DeclareTextSymbolDefault{\boi}{OT1}
22.94 \DeclareTextSymbol{\circonflexe}{OT1}{94}
22.95 \DeclareTextSymbol{\circonflexe}{T1}{2}
22.96 \DeclareTextSymbolDefault{\circonflexe}{OT1}
22.97 \DeclareTextSymbol{\tild}{OT1}{126}
22.98 \DeclareTextSymbol{\tild}{T1}{3}
22.99 \DeclareTextSymbolDefault{\tild}{OT1}
22.100 \DeclareTextSymbol{\degre}{OT1}{23}
22.101 \DeclareTextSymbol{\degre}{T1}{6}
22.102 \DeclareTextSymbolDefault{\degre}{OT1}

The following macros are used in the redefinition of \^and \" to handle the letter i.

22.103 \AtBeginDocument{%
22.104 \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}
22.105 \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}}

And some more macros for numbering.

22.106 \def\kentan{1\/${}^{\rm a\tilde{n}}$}
22.107 \def\eil{2\/${}^{\rm l}$}
22.108 \def\re{\/${}^{\rm re}$}
22.109 \def\trede{3\re}
22.110 \def\pevare{4\re}
22.111 \def\vet{\/${}^{\rm vet}$}
22.112 \def\pempvet{5\vet}

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.

22.113 \ldf@finish{breton}

22.114 ⟨/code⟩

23 The Welsh language

The file welsh.dtx^{18} defines all the language definition macros for the Welsh language as well as for the <Dialect> version of this language.

For this language currently no special definitions are needed or available. The macro \ldf@init takes care of preventing that this file is loaded more

than once, checking the category code of the @ sign, etc.

23.1 ⟨∗code⟩

 23.2 \LdfInit{welsh}{captionswelsh}

When this file is read as an option, i.e. by the \usepackage command, 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.

 23.3 \ifx\undefined\l@welsh
 23.4 \@nopatterns{welsh}
 23.5 \adddialect\l@welsh0\fi

The next step consists of defining commands to switch to (and from) the Welsh language.

\welshhyphenmins This macro is used to store the correct values of the hyphenation parameters

  \lefthyphenmin and \righthyphenmin.
 23.6 \providehyphenmins{\CurrentOption}{\tw@\thr@@}

\captionswelsh The macro \captionswelsh defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 23.7 \def\captionswelsh{%
 23.8 \def\prefacename{Rhagair}%
 23.9 \def\refname{Cyfeiriadau}%
23.10 \def\abstractname{Crynodeb}%
23.11 \def\bibname{Llyfryddiaeth}%
23.12 \def\chaptername{Pennod}%
23.13 \def\appendixname{Atodiad}%
23.14 \def\contentsname{Cynnwys}%
23.15 \def\listfigurename{Rhestr Ddarluniau}%
23.16 \def\listtablename{Rhestr Dablau}%
23.17 \def\indexname{Mynegai}%
23.18 \def\figurename{Darlun}%
23.19 \def\tablename{Taflen}%
23.20 \def\partname{Rhan}%
23.21 \def\enclname{amgae\"edig}%
23.22 \def\ccname{cop\"\i au}%
23.23 \def\headtoname{At}%  % `at' on letters meaning `to ( a person)'
23.24  % `to (a place)' is `i' in Welsh
23.25 \def\pagename{tudalen}%
23.26 \def\seename{gweler}%
23.27 \def\alsoname{gweler hefyd}%
23.28 \def\proofname{Prawf}%
23.29 \def\glossaryname{Glossary}% <-- Needs translation

23.30 }

18The file described in this section has version number v1.0c and was last revised on

2001/01/31.

\datewelsh The macro \datewelsh redefines the command \today to produce welsh dates.

23.31 \def\datewelsh{%
23.32 \def\today{\ifnum\day=1\relax 1\/$^{\mathrm{a\tilde{n}}}$\else
23.33  \number\day\fi \space a\space viz\space\ifcase\month\or
23.34  Ionawr\or Chwefror\or Mawrth\or Ebrill\or
23.35  Mai\or Mehefin\or Gorffennaf\or Awst\or
23.36  Medi\or Hydref\or Tachwedd\or Rhagfyr\fi
23.37 \space\number\year}}

\extraswelsh \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.

23.38 \addto\extraswelsh{}
23.39 \addto\noextraswelsh{}

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.

23.40 \ldf@finish{welsh}

23.41 ⟨/code⟩

24 The Irish language

The file irish.dtx^{19} defines all the language definition macros for the Irish language.

For this language currently no special definitions are needed or available. The macro \LdfInit takes care of preventing that this file is loaded more than

once, checking the category code of the @ sign, etc.

24.1 ⟨∗code⟩

 24.2 \LdfInit{irish}\captionsirish

When this file is read as an option, i.e. by the \usepackage command, 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.

 24.3 \ifx\l@irish\@undefined
 24.4 \@nopatterns{irish}
 24.5 \adddialect\l@irish0\fi

The next step consists of defining commands to switch to (and from) the Irish language.

\irishhyphenmins This macro is used to store the correct values of the hyphenation parameters

  \lefthyphenmin and \righthyphenmin.
 24.6 \providehyphenmins{\CurrentOption}{\tw@\thr@@}

\captionsirish The macro \captionsirish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 24.7 \addto\captionsirish{%
 24.8 \def\prefacename{R\'eamhr\'a}%    <-- also "Brollach"
 24.9 \def\refname{Tagairt\'{\i}}%
24.10 \def\abstractname{Achoimre}%
24.11 \def\bibname{Leabharliosta}%
24.12 \def\chaptername{Caibidil}%
24.13 \def\appendixname{Aguis\'{\i}n}%
24.14 \def\contentsname{Cl\'ar \'Abhair}%
24.15 \def\listfigurename{L\'ear\'aid\'{\i}}%
24.16 \def\listtablename{T\'abla\'{\i}}%
24.17 \def\indexname{Inn\'eacs}%
24.18 \def\figurename{L\'ear\'aid}%
24.19 \def\tablename{T\'abla}%
24.20 \def\partname{Cuid}%
24.21 \def\enclname{faoi iamh}%
24.22 \def\ccname{cc}%                 abrv. `c\'oip chuig'
24.23 \def\headtoname{Go}%
24.24 \def\pagename{Leathanach}%
24.25 \def\seename{f\'each}%
24.26 \def\alsoname{f\'each freisin}%
24.27 \def\proofname{Cruth\'unas}%
24.28 \def\glossaryname{Glossary}% <-- Needs translation

24.29 }

19The file described in this section has version number v1.0h and was last revised on

2001/01/30. A contribution was made by Marion Gunn.

\dateirish The macro \dateirish redefines the command \today to produce Irish dates.

24.30 \def\dateirish{%
24.31 \def\today{%
24.32  \number\day\space \ifcase\month\or
24.33  Ean\'air\or Feabhra\or M\'arta\or Aibre\'an\or
24.34  Bealtaine\or Meitheamh\or I\'uil\or L\'unasa\or
24.35  Me\'an F\'omhair\or Deireadh F\'omhair\or
24.36  M\'{\i} na Samhna\or M\'{\i} na Nollag\fi
24.37  \space \number\year}}

\extrasirish \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.

24.38 \addto\extrasirish{}
24.39 \addto\noextrasirish{}

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.

24.40 \ldf@finish{irish}

24.41 ⟨/code⟩

25 The Scottish language

The file scottish.dtx^{20} defines all the language definition macros for the Scottish language.

For this language currently no special definitions are needed or available. The macro \LdfInit takes care of preventing that this file is loaded more than

once, checking the category code of the @ sign, etc.

25.1 ⟨∗code⟩

 25.2 \LdfInit{scottish}\captionsscottish

When this file is read as an option, i.e. by the \usepackage command, 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.

 25.3 \ifx\l@scottish\@undefined
 25.4 \@nopatterns{scottish}
 25.5 \adddialect\l@scottish0\fi

The next step consists of defining commands to switch to (and from) the Scottish language.

\captionsscottish The macro \captionsscottish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 25.6 \addto\captionsscottish{%
 25.7 \def\prefacename{Preface}%    <-- needs translation
 25.8 \def\refname{Iomraidh}%
 25.9 \def\abstractname{Br\`{\i}gh}%
25.10 \def\bibname{Leabhraichean}%
25.11 \def\chaptername{Caibideil}%
25.12 \def\appendixname{Ath-sgr`{\i}obhadh}%
25.13 \def\contentsname{Cl\`ar-obrach}%
25.14 \def\listfigurename{Liosta Dhealbh }%
25.15 \def\listtablename{Liosta Chl\`ar}%
25.16 \def\indexname{Cl\`ar-innse}%
25.17 \def\figurename{Dealbh}%
25.18 \def\tablename{Cl\`ar}%
25.19 \def\partname{Cuid}%
25.20 \def\enclname{a-staigh}%
25.21 \def\ccname{lethbhreac gu}%
25.22 \def\headtoname{gu}%
25.23 \def\pagename{t.d.}%             abrv. `taobh duilleag'
25.24 \def\seename{see}%    <-- needs translation
25.25 \def\alsoname{see also}%    <-- needs translation
25.26 \def\proofname{Proof}%    <-- needs translation
25.27 \def\glossaryname{Glossary}% <-- Needs translation

25.28 }

\datescottish The macro \datescottish redefines the command \today to produce Scottish

dates.

25.29 \def\datescottish{%
25.30 \def\today{%

20The file described in this section has version number v1.0g and was last revised on

2001/01/30. A contribution was made by Fraser Grant (FRASER@CERNVM).

25.31  \number\day\space \ifcase\month\or
25.32  am Faoilteach\or an Gearran\or am M\`art\or an Giblean\or
25.33  an C\`eitean\or an t-\`Og mhios\or an t-Iuchar\or
25.34  L\`unasdal\or an Sultuine\or an D\`amhar\or
25.35  an t-Samhainn\or an Dubhlachd\fi
25.36  \space \number\year}}

\extrasscottish \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.

25.37 \addto\extrasscottish{}
25.38 \addto\noextrasscottish{}

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.

25.39 \ldf@finish{scottish}

25.40 ⟨/code⟩

26 The Greek language

The file greek.dtx^{21} defines all the language definition macros for the Greek language, i.e., as it used today with only one accent, and the attribute πoλυτoνκó (“Polutoniko”) for typesetting greek text with all accents. This separation arose out of the need to simplify things, for only very few people will be really interested to typeset polytonic Greek text.

\greektext The commands \greektext and \latintext can be used to switch to greek \latintext or latin fonts. These are declarations. \textgreek The commands \textgreek and \textlatin both take one argument which is \textlatin then typeset using the requested font encoding. The command \greekol switches

\textol to the greek outline font family, while the command \textol typests a short text in outline font. A number of extra greek characters are made available through the

added text commands \stigma, \qoppa, \sampi, \ddigamma, \Digamma, \euro,
\permill, and \vardigamma.

26.1 Typing conventions

Entering greek text can be quite difficult because of the many diacritical signs that need to be added for various purposes. The fonts that are used to typeset Greek make this a lot easier by offering a lot of ligatures. But in order for this to work, some characters need to be considered as letters. These characters are <, >, ~, `, ', " and |. 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” μoνoτoνικó. In that case we only need the ' and " symbols which are treated in the proper way.

26.2 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 999 999. Here are the conventions:

• There is no Greek numeral for any number less than or equal to 0.

• 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.

21The file described in this section has version number v1.3j and was last revised on 2001/02/22. The original author is Apostolos Syropoulos (apostolo@platon.ee.duth.gr), code from kdgreek.sty by David Kastrup dak@neuroinformatik.ruhr-uni-bochum.de was used to enhance the support for typesetting greek texts.

In our implementation we produce the letter stigma, not the digraph sigma tau.)

• 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.

• Hundreds from 100 to 900 are denoted by letters rho, sigma, tau, upsilon, phi, chi, psi, omega, sampi, followed by the numeric mark.

• Any number between 1 and 999 is obtained by a group of letters denoting the hundreds decades and units, followed by a numeric mark.

• 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.

\greeknumeral Using these conventions one obtains numbers up to 999 999. The command

\greeknumeral makes it possible to typeset Greek numerals. There is also an

\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.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

26.1 ⟨∗code⟩

26.2 \LdfInit\CurrentOption{captions\CurrentOption}

When the option polutonikogreek was used, redefine \CurrentOption to prevent problems later on.

26.3 \gdef\CurrentOption{greek}%

When this file is read as an option, i.e. by the \usepackage command, greek could be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@greek to see whether we have to do something here.

26.4 \ifx\l@greek\@undefined
26.5 \@nopatterns{greek}
26.6 \adddialect\l@greek0\fi

Now we declare the polutoniko language attribute.

26.7 \bbl@declare@ttribute{greek}{polutoniko}{%
This code adds the expansion of \extraspolutonikogreek to \extrasgreek and

changes the definition of \today for Greek to produce polytonic month names.

26.8 \expandafter\addto\expandafter\extrasgreek
26.9 \expandafter{\extraspolutonikogreek}%
26.10 \let\captionsgreek\captionspolutonikogreek
26.11 \let\gr@month\gr@c@month

We need to take some extra precautions in order not to break older documents which still use the old polutonikogreek option.

26.12 \let\l@polutonikogreek\l@greek
26.13 \let\datepolutonikogreek\dategreek
26.14 \let\extraspolutonikogreek\extrasgreek

26.15 \let\noextraspolutonikogreek\noextrasgreek

26.16 }

Typesetting Greek texts implies that a special set of fonts needs to be used. The current support for greek uses the cb fonts created by Claudio Beccari^{22}. The cb fonts provide all sorts of font combinations. In order to use these fonts we define the Local GReek encoding (LGR, see the file greek.fdd). We make sure that this encoding is known to L^{A}TEX, and if it isn’t we abort.

26.17 \InputIfFileExists{lgrenc.def}{%
26.18 \message{Loading the definitions for the Greek font encoding}}{%
26.19 \errhelp{I can't find the lgrenc.def file for the Greek fonts}%
26.20 \errmessage{Since I do not know what the LGR encoding means^^J
26.21  I can't typeset Greek.^^J
26.22  I stop here, while you get a suitable lgrenc.def file}\@@end

26.23 }

Now we define two commands that offer the possibility to switch between Greek and Roman encodings.

\greektext The command \greektext will switch from Latin font encoding to the Greek font encoding. This assumes that the ‘normal’ font encoding is a Latin one. This command is a declaration, for shorter pieces of text the command \textgreek should be used.

26.24 \DeclareRobustCommand{\greektext}{%
26.25 \fontencoding{LGR}\selectfont
26.26 \def\encodingdefault{LGR}}

\textgreek This command takes an argument which is then typeset using the requested font

encoding. In order to avoid many encoding switches it operates in a local scope.

26.27 \DeclareRobustCommand{\textgreek}[1]{{\greektext #1}}

\textol A last aspect of the set of fonts provided with this version of support for typesetting Greek texts is that it contains an outline family. In order to make it available we define the command \textol.

26.28 \def\outlfamily{\usefont{LGR}{cmro}{m}{n}}
26.29 \DeclareTextFontCommand{\textol}{\outlfamily}

The next step consists in defining commands to switch to (and from) the Greek language.

\greekhyphenmins This macro is used to store the correct values of the hyphenation parameters

\lefthyphenmin and \righthyphenmin.
26.30 % Yannis Haralambous has suggested this value
26.31 \providehyphenmins{\CurrentOption}{\@ne\@ne}

\captionsgreek The macro \captionsgreek defines all strings used in the four standard document

classes provided with L^{A}TEX.

26.32 \addto\captionsgreek{%
26.33 \def\prefacename{Pr'ologos}%
26.34 \def\refname{Anafor'es}%

22Apostolos Syropoulos wishes to thank him for his patience, collaboration, cooments and suggestions.

26.35 \def\abstractname{Per'ilhyh}%
26.36 \def\bibname{Bibliograf'ia}%
26.37 \def\chaptername{Kef'alaio}%
26.38 \def\appendixname{Par'arthma}%
26.39 \def\contentsname{Perieq'omena}%
26.40 \def\listfigurename{Kat'alogos Sqhm'atwn}%
26.41 \def\listtablename{Kat'alogos Pin'akwn}%
26.42 \def\indexname{Euret'hrio}%
26.43 \def\figurename{Sq'hma}%
26.44 \def\tablename{P'inakas}%
26.45 \def\partname{M'eros}%
26.46 \def\enclname{Sunhmm'ena}%
26.47 \def\ccname{Koinopo'ihsh}%
26.48 \def\headtoname{Pros}%
26.49 \def\pagename{Sel'ida}%
26.50 \def\seename{bl'epe}%
26.51 \def\alsoname{bl'epe ep'ishs}%
26.52 \def\proofname{Ap'odeixh}%
26.53 \def\glossaryname{Glwss'ari}%

26.54 }

\captionspolutonikogreek For texts written in the πoλυτ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.

26.55 \let\captionspolutonikogreek\captionsgreek
26.56 \addto\captionspolutonikogreek{%
26.57 \def\refname{>Anafor`es}%
26.58 \def\indexname{E<uret'hrio}%
26.59 \def\figurename{Sq~hma}%
26.60 \def\headtoname{Pr`os}%
26.61 \def\alsoname{bl'epe >ep'ishs}%
26.62 \def\proofname{>Ap'odeixh}%

26.63 }

\gr@month \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.

26.64 \def\gr@month{%
26.65 \ifcase\month\or
26.66  Ianouar'iou\or Febrouar'iou\or Mart'iou\or April'iou\or
26.67  Ma'"iou\or Ioun'iou\or Ioul'iou\or Augo'ustou\or
26.68  Septembr'iou\or Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi}
26.69 \def\dategreek{%
26.70 \def\today{\number\day \space \gr@month\space \number\year}}
\gr@c@greek
26.71 \def\gr@c@month{%
26.72 \ifcase\month\or >Ianouar'iou\or
26.73  Febrouar'iou\or Mart'iou\or >April'iou\or Ma"'iou\or
26.74  >Ioun'iou\or  >Ioul'iou\or A>ugo'ustou\or Septembr'iou\or
26.75  >Oktwbr'iou\or Noembr'iou\or Dekembr'iou\fi}

\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.

26.76 \def\Grtoday{%
26.77 \expandafter\Greeknumeral\expandafter{\the\day}\space
26.78 \gr@c@month \space
26.79 \expandafter\Greeknumeral\expandafter{\the\year}}

\extrasgreek \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 used and the definition of the internal macros \@alph and \@Alph because in Greek we do use the Greek numerals.

26.80 \addto\extrasgreek{\greektext}
26.81 \addto\noextrasgreek{\latintext}

\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).

26.82 \def\gr@ill@value#1{%
26.83 \PackageWarning{babel}{Illegal value (#1) for greeknumeral}}

\anw@true \anw@false \anw@print When a a large number with three trailing zero’s is to be printed those zeros and the numeric mark need to be discarded. As each ‘digit’ is processed by a separate macro and because the processing needs to be expandable we need some helper macros that help remember to 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.

26.84 \DeclareRobustCommand\anw@false{%
26.85 \DeclareRobustCommand\anw@print{}}
26.86 \DeclareRobustCommand\anw@true{%
26.87 \DeclareRobustCommand\anw@print{\anwtonos}}
26.88 \anw@true

\greeknumeral The command \greeknumeral needs to be 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.

26.89 \def\greeknumeral#1{%

If the value is negative or zero nothing is printed and a warning is issued.

26.90 \ifnum#1<\@ne\space\gr@ill@value{#1}%
26.91 \else
26.92  \ifnum#1<10\expandafter\gr@num@i\number#1%
26.93  \else
26.94  \ifnum#1<100\expandafter\gr@num@ii\number#1%
26.95  \else

We use the available shorthands for 1.000 (\@m) and 10.000 (\@M) to save a few tokens.

26.96  \ifnum#1<\@m\expandafter\gr@num@iii\number#1%
26.97  \else

26.98  \ifnum#1<\@M\expandafter\gr@num@iv\number#1%
26.99  \else
26.100  \ifnum#1<100000\expandafter\gr@num@v\number#1%

26.101 \else

26.102  \ifnum#1<1000000\expandafter\gr@num@vi\number#1%

26.103 \else

If the value is too large, nothing is printed and a warning is issued.

26.104  \space\gr@ill@value{#1}%

26.105 \fi 26.106 \fi 26.107 \fi 26.108 \fi 26.109 \fi 26.110 \fi 26.111 \fi 26.112 }

\Greeknumeral The command \Greeknumeral prints uppercase greek numerals. The parsing is

performed by the macro \greeknumeral.

26.113 \def\Greeknumeral#1{%
26.114 \expandafter\MakeUppercase\expandafter{\greeknumeral{#1}}}

\greek@alph \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

26.115 \let\latin@alph\@alph
26.116 \let\latin@Alph\@Alph

Then we define the Greek versions; the additional \expandafters are needed in order to make sure the table of contents will be correct, e.g., when we have appendixes.

26.117 \def\greek@alph#1{\expandafter\greeknumeral\expandafter{\the#1}}
26.118 \def\greek@Alph#1{\expandafter\Greeknumeral\expandafter{\the#1}}

Now we can set up the switching.

26.119 \addto\extrasgreek{%
26.120 \let\@alph\greek@alph
26.121 \let\@Alph\greek@Alph}
26.122 \addto\noextrasgreek{%
26.123 \let\@alph\latin@alph
26.124 \let\@Alph\latin@Alph}

\greek@roman \greek@Roman To prevent roman numerals being typeset in greek letters we need to adopt the internal L^{A}TEX commands \@roman and \@Roman. Note that this may cause errors where roman ends up in a situation where it needs to be expanded; problems are known to exist with the AMS document classes.

26.125 \let\latin@roman\@roman
26.126 \let\latin@Roman\@Roman
26.127 \def\greek@roman#1{\textlatin{\latin@roman{#1}}}
26.128 \def\greek@Roman#1{\textlatin{\latin@Roman{#1}}}

26.129 \addto\extrasgreek{%
26.130 \let\@roman\greek@roman
26.131 \let\@Roman\greek@Roman}
26.132 \addto\noextrasgreek{%
26.133 \let\@roman\latin@roman
26.134 \let\@Roman\latin@Roman}

\greek@amp \ltx@amp The greek fonts do not contain an ampersand, so the L^{A}TEX command \& dosn’t

give the expected result if we do not do something about it.

26.135 \let\ltx@amp\&
26.136 \def\greek@amp{\textlatin{\ltx@amp}}
26.137 \addto\extrasgreek{\let\&\greek@amp}
26.138 \addto\noextrasgreek{\let\&\ltx@amp}

What is left now is the definition of a set of macros to produce the various digits.

\gr@num@i \gr@num@ii \gr@num@iii As there is no representation for 0 in this system the zeros are simply discarded. When we have a large number with three 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.

26.139 \def\gr@num@i#1{%
26.140 \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi
26.141 \ifnum#1=\z@\else\anw@true\fi\anw@print}
26.142 \def\gr@num@ii#1{%
26.143 \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi
26.144 \ifnum#1=\z@\else\anw@true\fi\gr@num@i}
26.145 \def\gr@num@iii#1{%
26.146 \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi
26.147 \ifnum#1=\z@\anw@false\else\anw@true\fi\gr@num@ii}

\gr@num@iv \gr@num@v \gr@num@vi The first three ‘digits’ always have the numeric mark, except when one is discarded

because it’s value is zero.

26.148 \def\gr@num@iv#1{%
26.149 \ifnum#1=\z@\else\katwtonos\fi
26.150 \ifcase#1\or a\or b\or g\or d\or e\or \stigma\or z\or h\or j\fi
26.151 \gr@num@iii}
26.152 \def\gr@num@v#1{%
26.153 \ifnum#1=\z@\else\katwtonos\fi
26.154 \ifcase#1\or i\or k\or l\or m\or n\or x\or o\or p\or \qoppa\fi
26.155 \gr@num@iv}
26.156 \def\gr@num@vi#1{%
26.157 \katwtonos
26.158 \ifcase#1\or r\or sv\or t\or u\or f\or q\or y\or w\or \sampi\fi
26.159 \gr@num@v}

\greek@tilde In greek typesetting we need a number of characters with more than one accent. In the underlying family of fonts (the cb fonts) this is solved using Knuth’s ligature mechanism. 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 normaly used to produce an unbreakable space. The command \~ normally produces a tilde accent. For polytonic Greek we change the definition of \~ to produce the tilde character itself, making sure it has category code 12.

26.160 \begingroup
26.161 \catcode`\~=12
26.162 \lccode`\!=`\~
26.163 \lowercase{\def\x{\endgroup
26.164  \def\greek@tilde{!}}\x}
26.165 \addto\extraspolutonikogreek{%
26.166 \babel@save\~\let\~\greek@tilde}

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 isolated sigma fools the ligature mechanism in order to typeset σ in place of ς. 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.

26.167 \addto\extrasgreek{%
26.168 \babel@savevariable{\lccode`v}\lccode`v=`v%
26.169 \babel@savevariable{\lccode`\'}\lccode`\'=`\'%
26.170 \babel@savevariable{\lccode`\"}\lccode`\"=`\"}
26.171 \addto\extraspolutonikogreek{%
26.172 \babel@savevariable{\lccode`\<}\lccode`\<=`\<%
26.173 \babel@savevariable{\lccode`\>}\lccode`\>=`\>%
26.174 \babel@savevariable{\lccode`\~}\lccode`\~=`\~%
26.175 \babel@savevariable{\lccode`\|}\lccode`\|=`\|%
26.176 \babel@savevariable{\lccode`\`}\lccode`\`=`\`}

And in order to get rid of all accents and breathings when a string is \uppercased we also change a number of uppercase codes.

26.177 \addto\extrasgreek{%
26.178 \babel@savevariable{\uccode`\"}\uccode`\"=`\"%
26.179 \babel@savevariable{\uccode`\'}\uccode`\'=159} %% 159 == ^^9f
26.180 \addto\extraspolutonikogreek{%
26.181 \babel@savevariable{\uccode`\~}\uccode`\~=159%
26.182 \babel@savevariable{\uccode`\>}\uccode`\>=159%
26.183 \babel@savevariable{\uccode`\<}\uccode`\<=159%
26.184 \babel@savevariable{\uccode`\|}\uccode`\|=`\|%
26.185 \babel@savevariable{\uccode`\`}\uccode`\`=159}

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 tile ~ character is used for such purposes. Before we do this we save it’s original lowercase code to restore it once we’re done.

26.186 \@tempcnta=\lccode`\~
26.187 \lccode`\~=159
26.188 \lowercase{%
26.189 \initiate@active@char{~}%
26.190 \declare@shorthand{greek}{~}{}}
26.191 \lccode`\~=\@tempcnta

We can also make the tilde character itself expand to a tilde with category code 12 to make the typing of texts easier.

26.192 \addto\extraspolutonikogreek{\languageshorthands{greek}}%
26.193 \declare@shorthand{greek}{~}{\greek@tilde}

We now define a few symbols which are used in the typesetting of greek numerals, as well as some other symbols which are usefull, such as the ϵυρω symbol, etc.

26.194 \DeclareTextCommand{\anwtonos}{LGR}{\char"FE\relax}
26.195 \DeclareTextCommand{\katwtonos}{LGR}{\char"FF\relax}
26.196 \DeclareTextCommand{\qoppa}{LGR}{\char"12\relax}
26.197 \DeclareTextCommand{\stigma}{LGR}{\char"06\relax}
26.198 \DeclareTextCommand{\sampi}{LGR}{\char"1B\relax}
26.199 \DeclareTextCommand{\Digamma}{LGR}{\char"C3\relax}
26.200 \DeclareTextCommand{\ddigamma}{LGR}{\char"93\relax}
26.201 \DeclareTextCommand{\vardigamma}{LGR}{\char"07\relax}
26.202 \DeclareTextCommand{\euro}{LGR}{\char"18\relax}
26.203 \DeclareTextCommand{\permill}{LGR}{\char"19\relax}

Since the ~ cannot be used to produce an unbreakable white space we must redefine at least the commands \fnum@figure and \fnum@table so they do not produce a ~ instead of white space.

26.204 \def\fnum@figure{\figurename\nobreakspace\thefigure}
26.205 \def\fnum@table{\tablename\nobreakspace\thetable}

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.

26.206 \ldf@finish{\CurrentOption}

26.207 ⟨/code⟩

27 The French language

The file frenchb.dtx^{23}, derived from frenchy.sty, defines all the language definition macros for the French language.

Customization 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.

This file has been designed to be used with L^{A}TEX 2ε, L^{A}TEX-2.09 and PlainTEX formats. If you are still using L^{A}TEX-2.09, you should consider switching to L^{A}TEX 2ε!

The command \selectlanguage{french} switches to the French language ^{24}, with the following effects:

1. French hyphenation patterns are made active;

2. ‘double punctuation’ is made active for correct spacing in French;

3. \today prints the date in French;

4. the caption names are translated into French (L^{A}TEX only);

5. the default items in itemize environment are set to ‘–’ instead of •, and no vertical spacing and no glue is added, a hook to reset standard L^{A}TEX spacing is provided (\FrenchItemizeSpacingfalse); it is possible to change ‘–’ to something else (‘—’ for instance) by redefining \FrenchLabelItem; apart from the global hook \FrenchLabelItem, it is also possible to change the ‘labelitems’ at any level (1 to 4) in French, using the standard L^{A}TEX syntax,

for instance: \renewcommand{\labelitemii}{\textbullet}; in order to

be effective in French, the redefinitions have to be made when French is the current language (i.e. after the \begin{document}), the changes are saved when switching to another language and will be remembered of, when switching back to French;

6. vertical spacing in general L^{A}TEX lists is shortened, a hook to reset standard L^{A}TEX settings is provided (\FrenchListSpacingfalse) ;

7. the first paragraph of each section is indented (L^{A}TEX only);

8. the space after \dots is removed in French.

Some commands are provided in frenchb to make typesetting easier:

1. French quotation marks can be entered using the commands \og and \fg which work in L^{A}TEX 2ε, L^{A}TEX-2.09 and PlainTEX, their appearance depending on what is available to draw them; if you use L^{A}TEX 2ε and T1-encoding you can also enter them as <<~French quotation marks~>> but then don’t forget the unbreakable spaces, (\og and \fg provide for correct line breaks and better horizontal spacing). \og and \fg can be used outside French, they provide then English quotes “ and ”.

23The file described in this section has version number ? and was last revised on ?.

24\selectlanguage{francais} and \selectlanguage{frenchb} are kept for backward compatibility but should no longer be used.

2. A command \up is provided to typeset superscripts like M\up{me} (abbreviation for “Madame”), 1\up{er} (for “premier”).

3. Family names should be typeset in small capitals and never be hyphenated, the macro \bsc (boxed small caps) does this, e.g., Leslie~\bsc{Lamport} will produce Leslie Lamport.

4. Commands \primo, \secundo, \tertio and \quarto may be used to enumerate in lists.

5. Abbreviations for “Numéro” and “numéro” are obtained via the commands

\No, \no.

6. 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 an unbreakable space), or for alcohols’ strengths (e.g., “45\degres” with no space in French).

7. 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 TEXbook p. 134). The command \DecimalMathComma makes the comma be an ordinary character in French only (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.

8. A command \nombre is provided to easily typeset numbers: it works both in text and in math-mode: inputting \nombre{3141,592653} will format this number properly according to the current language (French or non-French): each slice of three digits will be separated either with a comma in English or with a space in French (if you prefer a thin space instead of a normal space, just add the command \ThinSpaceInFrenchNumbers to the preamble of your document, or to frenchb.cfg). The command \nombre is a contribution of Vincent Jalby using ideas of David Carlisle in comma.sty.

9. frenchb has been designed to take advantage of the xspace package if present: adding \usepackage{xspace} in the preamble will force macros like \fg, \ier, \ieme, \dots, …, to respect the spaces you type after them, for instance typing ‘1\ier juin’ will print ‘1^{er} juin’ (no need for a forced space after 1\ier).

10. Two commands, \FrenchLayout and \StandardLayout (to be used only in the preamble) are provided to unify the layout of multilingual documents (it mainly concerns lists) regardless the current language (see section 28.8 for details).

All commands previously available in francais.ldf have been included in frenchb.ldf for compatibility, sometimes with updated definitions.

The french package, by Bernard Gaulle, was not designed to run with babel (although the latest versions claim to be babel compatible), but rather as a standalone package for the French language. It provides many more functionalities (like \lettrine, \sommaire…) not available in frenchb, at the cost of a much greater complexity and possible incompatibilities with other languages.

As french is known to produce the best layout available for French typography, I have borrowed many ideas from Bernard’s file. I did my best to help users of both packages (french and frenchb) to exchange their sources files easily (see the example configuration file below in section 27), with one exception which affects the way French quotation marks are entered: frenchb uses macros (\og and \fg) while french uses active characters (<< and >>).

French typographic rules specify that some white space should be present before ‘double punctuation’ characters. These characters are ;!? and :. In order to get this white space automatically, the category code of these characters is made \active. In French, the user should input these four characters preceded with a space, but as many people forget about it (even among native French writers!), the default behaviour of frenchb is to automatically add a \thinspace before ‘;’ ‘!’ ‘?’ and a normal (unbreakable) space before ‘:’ (this is the rule in French typography). It’s up to the user to add or not a space after ‘double punctuation’ characters: usually a space is necessary, but not always (before a full point or a closing brace for instance), so this cannot done automatically.

In (rare) cases where no space should be added before a ‘double punctu-

ation’, either use \string; \string: \string! \string? instead of ; : !

?, or switch locally to English. For instance you can type C\string:TEX or

\begin{otherlanguage}{english}{C:TEX}\end{otherlanguage} to avoid the

space before : in a MS-DOS path.

Some users dislike this automatic insertion of a space before ‘double punctuation’, and prefer to decide themselves whether a space should be added or not; so a hook \NoAutoSpaceBeforeFDP is provided: if this command is added (in file frenchb.cfg, or anywhere in a document) frenchb will respect your typing, and introduce a suitable space before ‘double punctuation’ if and only if a space is typed in the source file before those signs.

The command \AutoSpaceBeforeFDP switches back to the default behaviour

of frenchb.

Once you have built your format, a good precaution would be to perform some basic tests about hyphenation in French. For L^{A}TEX 2ε I suggest this:

• run the following file, with the encoding suitable for your machine (myencoding will be latin1 for unix machines and PCs running Windows, applemac for Macintoshs, or cp850 for PCs running DOS).

     %%% Test file for French hyphenation.
     \documentclass{article}
     \usepackage[my-encoding]{inputenc}
     \usepackage[T1]{fontenc} % Use EC fonts for French
     %\usepackage{mltex}      % Uncomment this line and
                              % comment out the preceeding one
                              % to use standard CM fonts.
     \usepackage[francais]{babel}
     \begin{document}
     \showhyphens{signal container \'ev\'enement alg\`ebre}

\showhyphens{signal container événement algèbre}
\end{document}

• check the hyphenations proposed by TEX in your log-file; in French you should get with both 7-bit and 8-bit encodings

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 only.

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:

• you get sig-nal con-tainer, this probably means that the hyphenation patterns you are using are for US-English, not for French;

• you get no hyphen at all in évé-ne-ment, this probably means that you are using CM fonts and the macro \accent to produce accented characters. Using EC fonts with built-in accented characters or MlTEX with CM fonts avoids this type of mismatch.

frenchb has been improved using helpful suggestions from many people, the main contributions came from Vincent Jalby. Thanks to all of them!

Changes

First version released: 1.1 as of 1996/05/31 part of babel-3.6beta.

Changes in version 1.1b: update for babel-3.6. Changes in version 1.2: new command \nombre to format numbers; re-

moved command \fup borrowed from the french package (\up does a better job in L^{A}TEX 2ε); also removed aliases \french and \english (frenchb.cfg is a better place for these).

Changes in version 1.3:

• The ‘xspace’ package, when present, now controls spacing after all (sensible) macros, formerly ‘xspace’ worked on \fg (suggested by Vincent Jalby);

• spacing after opening and before closing guillemets improved as suggested by Thierry Bouche;

• a replacement for poor looking guillemets in OT1 encoding (math fonts are used to emulate them) is provided if the file ot2wncyr.fd is found: this file defines an OT2 encoding using AMS Cyrillic fonts; these have built-in guillemets, they are text fonts, are free, and are distributed as METAFONT and Type1 fonts (good for pdftex!), the replacement was suggested by Gérard De-

grez; if the files ot2wncyr.fd, wncy*.mf, wncy*.tfm, and wncy*.pfb aren’t

available on your system, you should get them from CTAN; if your system complains about missing wncy*.tfm fonts, it means your TEX system is incomplete, as a quick fix, you can either remove ot2wncyr.fd or add the command \LasyGuillemets to the preamble of your document or to frenchb.cfg, then frenchb will behave as it did in the previous versions.

In case Cyrillic guillemets do not fit, it is possible to pick French guillemets from any font using the command \FrenchGuillemetsFrom which requires 4 arguments \FrenchGuillemetsFrom{coding}{font}{char-left}{char-right},

for instance, add \FrenchGuillesIn{T1}{ppl}{19}{20} to the preamble of

your document or to frenchb.cfg, to pick French guillemets from Palatino (fontname=ppl, char 19 and 20 are left and right guillemets in T1-encoding). This was suggested by Michel Bovani.

• the environment ‘itemize’ has been redesigned in French according to specifications from Jacques André and Thierry Bouche; it is possible to switch back to the settings of version 1.2: add \FrenchItemizeSpacingfalse after loading frenchb in the preamble (this can be useful to process old documents);

• two switches have been added to go back to standard L^{A}TEX list spacing

\FrenchItemizeSpacingfalse and \FrenchListSpacingfalse;

• \nombre now properly handles signs in L^{A}TEX 2ε;

• definition of \dots changed in French;

• in French, with the standard L^{A}TEX classes, captions in figures and tables are printed with an endash instead of a colon.

Changes in version 1.4:

• the redefinition of\@makecaption is changed not to overwrite the changes made by some classes (koma-script, amsart, ua-thesis…) as pointed out by Werner Lemberg;

• a hook, \FrenchGuillemetsFrom, is provided to pick French guillemets from any font (suggested by Michel Bovani);

• a hook, \FrenchLabelItem, is provided to enable marks other than ‘–’ (\textendash) in French lists (also suggested by Michel Bovani);

• \DecimalMathComma, \StandardMathComma, \ThinSpaceInFrenchNumbers

added;

• \FrenchLayout and \StandardLayout added;

• an example of customization file frenchb.cfg is included in frenchb.dtx.

Changes in version 1.5:

• The settings for spacing in French lists are no longer tuned at the \@trivlist level but within \list; this enables the users to provide their own settings for the lists they define with \list (suggested by P. Pichaureau). Although the layout of the standard lists has not changed, some lists, based directly on \@trivlist or \trivlist, could possibly be typeset differently when upgrading from version 1.4 to 1.5. The command \FrenchOldTrivlisttrue could then, be useful to process older documents.

• Apart from the global hook \FrenchLabelItem, it is now also possible to change the ‘labelitems’ at any level (1 to 4) in French, using the standard

L^{A}TEX syntax, for instance: \renewcommand{\labelitemii}{\textbullet}.

• The internal name for the French language has been changed from frenchb

       to french, it means that \captionsfrench, \datefrench, \extrasfrench,
       \noextrasfrench, are to be used now instead of \captionsfrenchb,
       \datefrenchb, \extrasfrenchb, \noextrasfrenchb.

Customizing frenchb: an example of configuration file

27.1 ⟨∗cfg⟩

 27.2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 27.3 %% If you want to customize frenchb, please DO NOT hack into the code,
 27.4 %% copy this file into a directory searched by TeX, preferably a
 27.5 %% personal one on multi-user systems, and customize it as you like.
 27.6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 27.7 %% WARNING: If you exchange your documents with colleagues using
 27.8 %% a different TeX installation, it is best NOT TO HAVE a frenchb.cfg
 27.9 %% file, and add instead the customization commands to the preamble
27.10 %% of your documents after babel and frenchb have been loaded.
27.11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

27.12 %%

27.13 %% Uncomment the following line if you dislike frenchb automatically
27.14 %% adding a space before French double punctuation (see frenchb.dtx
27.15 %% for more information).

27.16 %%

27.17 %%\NoAutoSpaceBeforeFDP

27.18 %%

27.19 %% Uncomment the following line to force lasy font emulation for
27.20 %% French guillemets; Cyrillic guillemets are FAR BETTER LOOKING,
27.21 %% you should normally leave this line commented out.

27.22 %%

27.23 %%\LasyGuillemets

27.24 %%

27.25 %% If you dislike Cyrillic guillemets in OT1-encoding and prefer,
27.26 %% those from the Palatino font or Polish guillemets, you can comment
27.27 %% out one of the following lines.
27.28 %% The four arguments are: encoding, font name, character codes of
27.29 %% the opening and closing guillemets in the selected font.

27.30 %%

27.31 %%\FrenchGuillemetsFrom{T1}{ppl}{19}{20}
27.32 %%\FrenchGuillemetsFrom{OT4}{cmr}{174}{175}

27.33 %%

27.34 %% Vertical spacing in itemize lists has been changed in version 1.3.
27.35 %% Uncomment the following line if you want to have the same settings
27.36 %% as in version 1.2 (to process older documents for instance).

27.37 %%

27.38 %%\FrenchItemizeSpacingfalse

27.39 %%

27.40 %% frenchb tunes vertical spaces in all lists (at \list level),
27.41 %% uncomment the following line if you prefer LaTeX standard settings
27.42 %% (this flag is new in version 1.3). When \ifFrenchItemizeSpacing is
27.43 %% `true' (default setting), this flag has no effect on itemize lists.

27.44 %%

27.45 %%\FrenchListSpacingfalse

27.46 %%

27.47 %% The command \FrenchLabelItem can be used to set the `labelitems'

27.48 %% for all levels in French. For instance, to get long dashes, use:

27.49 %%

27.50 %%\renewcommand{\FrenchLabelItem}{\textemdash}

27.51 %%

27.52 %% You can also have different `labelitems' for each level in French:

27.53 %%

27.54 %%\renewcommand{\Frlabelitemi}{\textemdash}
27.55 %%\renewcommand{\Frlabelitemii}{\bfseries\textendash}
27.56 %%\renewcommand{\Frlabelitemiii}{\textbullet}
27.57 %%\renewcommand{\Frlabelitemiv}{}

27.58 %%

27.59 %% Uncomment the following line if you want the command \nombre to
27.60 %% insert thin spaces (1/6em) instead of normal spaces (0.3em)
27.61 %% between slices of 3 digits when typesetting numbers in French.

27.62 %%

27.63 %%\ThinSpaceInFrenchNumbers

27.64 %%

27.65 %% If you are bored to type {,} every time you want a decimal comma in
27.66 %% math-mode, uncomment the following line (and don't forget to add a
27.67 %% forced space after the comma in lists and intervals: $(x,\ y)$ and
27.68 %% $[0,\ 1]$). I suggest NOT TO UNCOMMENT the following line,
27.69 %% and to switch between the decimal comma and the standard comma
27.70 %% using \DecimalMathComma and \StandardMathComma inside the document.

27.71 %%

27.72 %%\DecimalMathComma

27.73 %%

27.74 %% If you do not want the appearance of lists to depend on the current
27.75 %% language, add ONE of these two commands: \FrenchLayout (for a
27.76 %% document mainly in French) or \StandardLayout (for a document
27.77 %% mainly in English).

27.78 %%

27.79 %%\FrenchLayout
27.80 %%\StandardLayout

27.81 %%

27.82 %% With the standard LaTeX classes (article.cls, report.cls, book.cls)
27.83 %% you can change the separator used in figure and table captions in
27.84 %% French with \CaptionSeparator , for instance (the default value of
27.85 %% \CaptionSeparator in French is '\space\textendash\space'):

27.86 %%

27.87 %%\addto\captionsfrench{\def\CaptionSeparator{\space\textemdash\space}}

27.88 %%

27.89 %% You might want to change some of the translations of caption names,
27.90 %% you can do it this way, for instance:

27.91 %%

27.92 %%\addto\captionsfrench{\def\figurename{{\scshape Figure}}}
27.93 %%\addto\captionsfrench{\def\tablename{{\scshape Table}}}
27.94 %%\addto\captionsfrench{\def\proofname{Preuve}}

27.95 %%

27.96 %% If French guillemets are available on your keyboard, you can use
27.97 %% them instead of the commands \og and \fg: REPLACE << and >> in
27.98 %% the following code by your ready-made guillemets (2 occurrences
27.99 %% for each) AND uncomment the resulting code.
27.100 %% WARNINGS:
27.101 %% 1) This will reduce the portability of your source files!

27.102 %% 2) This adds two active characters.
27.103 %% 3) If you add this stuff to the preamble of a document, you'll
27.104 %%    need to wrap it in \makeatletter ... \makeatother.

27.105 %%

27.106 %% \ifx\mule@def\undefined
27.107 %%   \initiate@active@char{<<}
27.108 %%   \initiate@active@char{>>}
27.109 %%   \AtBeginDocument{%
27.110 %%     \def<<{\og\ignorespaces}%
27.111 %%     \def>>{{\fg}}%

27.112 %% }%

27.113 %% \else %%% For the CJK package, see MULEenc.sty.
27.114 %%   \mule@def{11}{\og\ignorespaces}
27.115 %%   \mule@def{27}{{\fg}}

27.116 %% \fi 27.117 %%

27.118 %% The rest is for compatibility with Bernard Gaulle's french.sty:
27.119 %% if you want to typeset with babel/frenchb files originally written
27.120 %% for french.sty, you will probably want to uncomment these lines.

27.121 %%

27.122 %% Uncomment these lines if you want the aliases \numero and \Numero
27.123 %% (as in french.sty) for \no and \No.

27.124 %%

27.125 %%\let\numero=\no
27.126 %%\let\Numero=\No

27.127 %%

27.128 %% Uncomment the following lines if you want to substitute `\bsc' to
27.129 %% either (or both) of french.sty macros `\fsc' and `\lsc'.

27.130 %%

27.131 %%\let\fsc=\bsc
27.132 %%\let\lsc=\bsc

27.133 %%

27.134 %% Uncomment the following line if you want to substitute `\up' to
27.135 %% french.sty macro `\fup'.

27.136 %%

27.137 %%\let\fup=\up

27.138 %%

27.139 %% Uncomment the following lines if you intend to use  commands \french
27.140 %% and \english to switch between languages, as in french.sty.

27.141 %%

27.142 %%\def\french{\leavevmode\selectlanguage{french}}
27.143 %%\def\english{\leavevmode\selectlanguage{english}}

27.144 %%

27.145 %% Uncomment the following lines if you intend to use the command
27.146 %% \AllTeX to refer to all flavours of TeX, (this command has been
27.147 %% made popular by french.sty).

27.148 %%

27.149 %%\newcommand*{\AllTeX}{%
27.150 %%                (L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)%
27.151 %%                   T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}

27.152 ⟨/cfg⟩

28 TEXnical details

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

28.1 ⟨∗code⟩ 28.2 %%

28.3 \LdfInit\CurrentOption\NoAutoSpaceBeforeFDP

\ifLaTeX \ifLaTeXe To check the format in use (plain, L^{A}TEX or L^{A}TEX 2ε), we’ll need two new ‘if’.

28.4 \newif\ifLaTeX
28.5 \ifx\magnification\@undefined\LaTeXtrue\fi
28.6 \newif\ifLaTeXe
28.7 \ifx\@compatibilitytrue\@undefined\else\LaTeXetrue\fi

\if@Two@E We will need another ‘if’ : \if@Two@E is true if and only if L^{A}TEX 2ε is running not in compatibility mode. It is used in the definitions of the command \nombre and \up. The definition is somewhat complicated, due to the fact that \if@compatibility is not recognized as a \if in L^{A}TEX-2.09 based formats.

28.8 \newif\if@Two@E \@Two@Etrue
28.9 \def\@FI@{\fi}
28.10 \ifx\@compatibilitytrue\@undefined
28.11 \@Two@Efalse \def\@FI@{\relax}
28.12 \else
28.13 \if@compatibility \@Two@Efalse \fi
28.14 \@FI@

Check if hyphenation patterns for the French language have been loaded in language.dat; we allow for the names ‘french’, ‘francais’, ‘canadien’ or ‘acadian’. The latter two are both names used in Canada for variants of French that are in use in that country.

28.15 \ifx\l@french\@undefined
28.16 \ifx\l@francais\@undefined
28.17  \ifx\l@canadien\@undefined
28.18  \ifx\l@acadian\@undefined
28.19  \@nopatterns{French}
28.20  \adddialect\l@french0
28.21  \else
28.22  \let\l@french\l@acadian

28.23 \fi

28.24  \else
28.25  \let\l@french\l@canadien

28.26 \fi

28.27 \else
28.28  \let\l@french\l@francais

28.29 \fi 28.30 \fi

After the statement above \l@french is sure to always be defined.

The internal name for the French language will be ‘french’; ‘francais’ and ‘frenchb’ will be synonymous for ‘french’: first let both names use the same hyphenation patterns. Later we will have to set aliases for \captionsfrench,

  \datefrench, \extrasfrench and \noextrasfrench. As French uses the stand-

ard values of \lefthyphenmin (2) and \righthyphenmin (3), no special setting is required here.

28.31 \def\CurrentOption{french}
28.32 \ifx\l@francais\@undefined
28.33 \let\l@francais\l@french

28.34 \fi

28.35 \ifx\l@frenchb\@undefined
28.36 \let\l@frenchb\l@french

28.37 \fi

When this language definition file was loaded for one of the Canadian versions of French we need to make sure that a suitable hyphenation pattern register will be found by TEX.

28.38 \ifx\l@canadien\@undefined
28.39 \let\l@canadien\l@french

28.40 \fi

28.41 \ifx\l@acadian\@undefined
28.42 \let\l@acadian\l@french

28.43 \fi

This language definition can be loaded for different variants of the French language. The ‘key’ babel macros are only defined once, using ‘french’ as the language name, but frenchb and francais are synonymous. As some users who choose frenchb or francais as option of babel, might customize \captionsfrenchb or \captionsfrancais, a warning is issued when they do so (only in L^{A}TEX 2ε). The other three commands for \date, \extras, and \noextras are not likely to be modified by users. The other variants of languages are defined by checking if the relevant option was used and then adding one extra level of expansion.

28.44 \def\datefrancais{\datefrench}
28.45 \def\extrasfrancais{\extrasfrench}
28.46 \def\noextrasfrancais{\noextrasfrench}
28.47 \def\datefrenchb{\datefrench}
28.48 \def\extrasfrenchb{\extrasfrench}
28.49 \def\noextrasfrenchb{\noextrasfrench}
28.50 \ifLaTeXe
28.51 \AtBeginDocument{\ifx\captionsfrancais\@undefined
28.52  \else
28.53  \PackageWarning{frenchb.ldf}%
28.54  {*** \protect\captionsfrancais\space
28.55  is no longer defined, please\MessageBreak
28.56  use \protect\captionsfrench\space instead.}%

28.57 \fi

28.58  \def\captionsfrancais{\captionsfrench}%
28.59  \ifx\captionsfrenchb\@undefined
28.60  \else
28.61  \PackageWarning{frenchb.ldf}%
28.62  {*** \protect\captionsfrenchb\space
28.63  is no longer defined, please\MessageBreak
28.64  use \protect\captionsfrench\space instead.}%

28.65 \fi

28.66  \def\captionsfrenchb{\captionsfrench}%

28.67 }

28.68 \else
28.69 \def\captionsfrancais{\captionsfrench}
28.70 \def\captionsfrenchb{\captionsfrench}

28.71 \fi

28.72 \@ifpackagewith{babel}{canadien}{%
28.73 \def\captionscanadien{\captionsfrench}%
28.74 \def\datecanadien{\datefrench}%
28.75 \def\extrascanadien{\extrasfrench}%
28.76 \def\noextrascanadien{\noextrasfrench}%

28.77 }{}

28.78 \@ifpackagewith{babel}{acadian}{%
28.79 \def\captionsacadian{\captionsfrench}%
28.80 \def\dateacadian{\datefrench}%
28.81 \def\extrasacadian{\extrasfrench}%
28.82 \def\noextrasacadian{\noextrasfrench}%

28.83 }{}

\extrasfrench \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 “apostrophe” is used in hyphenation in expressions like l'ambulance (French 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 to be reset to null when exiting French.

28.84 \@namedef{extras\CurrentOption}{\lccode`\'=`\'}
28.85 \@namedef{noextras\CurrentOption}{\lccode`\'=0}

It is best to use L^{A}TEX 2ε’s font changing commands, and to emulated those we need when they are not available, as in PlainTEX or L^{A}TEX-2.09. Be aware that old commands \sc, \it, etc. exist in L^{A}TEX 2ε, but they behave like they did in L^{A}TEX-2.09 (i. e., they switch back to \normalfont instead of keeping the other font attributes unchanged).

28.86 \ifx\scshape\@undefined
28.87 \ifx\sc\@undefined
28.88  \let\scshape\relax
28.89 \else
28.90  \let\scshape\sc

28.91 \fi 28.92 \fi

28.93 \ifx\emph\@undefined
28.94 \ifx\em\@undefined
28.95  \let\emph\relax
28.96 \else
28.97  \def\emph#1{\em #1}

28.98 \fi 28.99 \fi

28.1 Caption names

The next step consists of defining the French equivalents for the L^{A}TEX caption names.

In French, captions in figures and tables should be printed with endash (‘– ’) instead of the standard ‘:’. If another separator is preferred, see in the example configuration file above (section 27) how to change the default value of

   \CaptionSeparator.

We first store the standard definition of \@makecaption (e.g., the one provided in article.cls, report.cls, book.cls which is frozen for L^{A}TEX 2ε according to Frank Mittelbach), in \STD@makecaption. ‘ATBeginDocument’ we compare it to its current definition (some classes like koma-script classes, AMS classes, uathesis.cls… change it). If they are identical, frenchb just adds a hook called

   \CaptionSeparator to \@makecaption, \CaptionSeparator defaults to ’: ’ as

in the standard \@makecaption, and will be changed to ’ – ’ in French. If the definitions differ, frenchb doesn’t overwrite the changes, but prints a message in the .log file.

28.100 \ifLaTeXe
28.101 \long\def\STD@makecaption#1#2{%
28.102  \vskip\abovecaptionskip
28.103  \sbox\@tempboxa{#1: #2}%
28.104  \ifdim \wd\@tempboxa >\hsize
28.105  #1: #2\par

28.106 \else

28.107  \global \@minipagefalse
28.108  \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%

28.109 \fi

28.110  \vskip\belowcaptionskip}
28.111 \def\CaptionSeparator{\string:\space}
28.112 \long\def\FB@makecaption#1#2{%
28.113  \vskip\abovecaptionskip
28.114  \sbox\@tempboxa{#1\CaptionSeparator #2}%
28.115  \ifdim \wd\@tempboxa >\hsize
28.116  #1\CaptionSeparator #2\par

28.117 \else

28.118  \global \@minipagefalse
28.119  \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%

28.120 \fi

28.121  \vskip\belowcaptionskip}
28.122 \AtBeginDocument{%
28.123 \ifx\@makecaption\STD@makecaption
28.124  \let\@makecaption\FB@makecaption

28.125 \else

28.126  \ifx\@makecaption\@undefined\else
28.127  \PackageWarning{frenchb.ldf}%
28.128  {The definition of \protect\@makecaption\space
28.129  has been changed,\MessageBreak
28.130  frenchb will NOT customize it.}

28.131 \fi 28.132 \fi

28.133 \let\FB@makecaption\relax
28.134 \let\STD@makecaption\relax}
28.135 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.136  \def\CaptionSeparator{\string:\space}}

28.137 \fi

\captionsfrench The macro \captionsfrench defines all strings used in the four standard document classes provided with L^{A}TEX. Some authors do not like some of these names; it is easy to change them in the preamble after loading frenchb (or in your file

   frenchb.cfg), e.g \addto\captionsfrench{\def\figurename{Figure}} will

print ‘Figure’ in Roman instead of ‘Fig.’.

28.138 \ifLaTeX
28.139 \@namedef{captions\CurrentOption}{%
28.140 \def\refname{R\'ef\'erences}%
28.141 \def\abstractname{R\'esum\'e}%
28.142 \def\bibname{Bibliographie}%
28.143 \def\prefacename{Pr\'eface}%
28.144 \def\chaptername{Chapitre}%
28.145 \def\appendixname{Annexe}%
28.146 \def\contentsname{Table des mati\`eres}%
28.147 \def\listfigurename{Table des figures}%
28.148 \def\listtablename{Liste des tableaux}%
28.149 \def\indexname{Index}%
28.150 \def\figurename{{\scshape Fig.}}%
28.151 \def\tablename{{\scshape Tab.}}%
28.152 \def\CaptionSeparator{\space\textendash\space}%

“Première partie” instead of “Part I”

28.153 \def\partname{\protect\@Fpt partie}%
28.154 \def\@Fpt{{\ifcase\value{part}\or Premi\`ere\or Deuxi\`eme\or
28.155 Troisi\`eme\or Quatri\`eme\or Cinqui\`eme\or Sixi\`eme\or
28.156 Septi\`eme\or Huiti\`eme\or Neuvi\`eme\or Dixi\`eme\or Onzi\`eme\or
28.157 Douzi\`eme\or Treizi\`eme\or Quatorzi\`eme\or Quinzi\`eme\or
28.158 Seizi\`eme\or Dix-septi\`eme\or Dix-huiti\`eme\or Dix-neuvi\`eme\or
28.159 Vingti\`eme\fi}\space\def\thepart{}}%
28.160 \def\pagename{page}%
28.161 \def\seename{{\emph{voir}}}%
28.162 \def\alsoname{{\emph{voir aussi}}}%
28.163 \def\enclname{P.~J. }%
28.164 \def\ccname{Copie \`a }%
28.165 \def\headtoname{}%
28.166 \def\proofname{D\'emonstration}% for AMS-\LaTeX
28.167 \def\glossaryname{Glossaire}%

28.168 } 28.169 \fi

28.2 Punctuation

The ‘double punctuation’ characters (; ! ? and :) have to be made \active for an automatic control of the amount of space to insert before them.

28.170 \initiate@active@char{:}
28.171 \initiate@active@char{;}
28.172 \initiate@active@char{!}
28.173 \initiate@active@char{?}

We specify that the French group of shorthands should be used.

28.174 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.175 \languageshorthands{french}}

These characters are ‘turned on’ once, later their definition may vary.

28.176 \expandafter\addto\csname extras\CurrentOption\endcsname{%

28.177 \bbl@activate{:}\bbl@activate{;}%
28.178 \bbl@activate{!}\bbl@activate{?}}
28.179 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.180 \bbl@deactivate{:}\bbl@deactivate{;}%
28.181 \bbl@deactivate{!}\bbl@deactivate{?}}

One more thing \extrasfrench needs to do is to make sure that \frenchspacing is in effect. If this is not the case the execution of \noextrasfrench will switch it off again.

28.182 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.183 \bbl@frenchspacing}
28.184 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.185 \bbl@nonfrenchspacing}

\french@sh@;@ We have to tune the amount of white space before ; ! ? and :. 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 an unbreakable \thinspace instead. If no space has been typed, we add \FDP@thinspace which will be defined, up to the user’s wishes, as an automatic added thin space, or as \@empty.

28.186 \declare@shorthand{french}{;}{%
28.187  \ifhmode
28.188  \ifdim\lastskip>\z@
28.189  \unskip\penalty\@M\thinspace

28.190 \else

28.191  \FDP@thinspace

28.192 \fi 28.193 \fi

Now we can insert a ; character.

28.194  \string;}

\french@sh@!@ \french@sh@?@ Because these definitions are very similar only one is displayed in a way that the definition can be easily checked.

28.195 \declare@shorthand{french}{!}{%
28.196  \ifhmode
28.197  \ifdim\lastskip>\z@
28.198  \unskip\penalty\@M\thinspace

28.199 \else

28.200  \FDP@thinspace

28.201 \fi 28.202 \fi

28.203  \string!}
28.204 \declare@shorthand{french}{?}{%
28.205  \ifhmode
28.206  \ifdim\lastskip>\z@
28.207  \unskip\penalty\@M\thinspace

28.208 \else

28.209  \FDP@thinspace

28.210 \fi 28.211 \fi

28.212  \string?}

\french@sh@:@ The ‘:’ requires a normal space before it, instead of a \thinspace.

28.213 \declare@shorthand{french}{:}{%
28.214  \ifhmode
28.215  \ifdim\lastskip>\z@
28.216  \unskip\penalty\@M\

28.217 \else

28.218  \FDP@space

28.219 \fi 28.220 \fi

28.221  \string:}

\AutoSpaceBeforeFDP \NoAutoSpaceBeforeFDP  \FDP@thinspace and \FDP@space are defined as unbreakable spaces by
   \AutoSpaceBeforeFDP or as \@empty by \NoAutoSpaceBeforeFDP.
   Default is \AutoSpaceBeforeFDP.
28.222 \def\AutoSpaceBeforeFDP{%
28.223  \def\FDP@thinspace{\penalty\@M\thinspace}%
28.224  \def\FDP@space{\penalty\@M\ }}
28.225 \def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty
28.226  \let\FDP@space\@empty}
28.227 \AutoSpaceBeforeFDP

\system@sh@:@ \system@sh@!@ \system@sh@?@ \system@sh@;@ 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.

28.228 \declare@shorthand{system}{:}{\string:}
28.229 \declare@shorthand{system}{!}{\string!}
28.230 \declare@shorthand{system}{?}{\string?}
28.231 \declare@shorthand{system}{;}{\string;}

28.3 French quotation marks

Several shapes of French quotation marks are provided for use with CM or EC fonts, or PostScript fonts. CM fonts have no quotation marks built-in, so we have to emulate them:

• if a file ‘ot2wncyr.fd’ is found, we expect AMS Cyrillic fonts ‘wncy*’ to be present on the system, so we use them;

• otherwise we use math symbols, either L^{A}TEX’s ‘lasy’ font if available, or TEX symbols \ll and \gg otherwise;

• as incomplete L^{A}TEX installations might include a file ‘ot2wncyr.fd’, but no ‘wncy*.mf’ or ‘wncy*.tfm’ files, a command \LasyGuillemets is provided to force usage of L^{A}TEX’s ‘lasy’ symbols to emulate French quotation marks.

EC fonts and PostScript fonts have built-in quotation marks.

The standard names for French quotation marks are \guillemotleft and \guillemotright, these commands are defined in t1enc.def for T1-encoding. In L^{A}TEX 2ε formats, we first define these commands for OT1-encoding (for CM fonts), using either AMS Cyrillic ‘wncy*’ or L^{A}TEX’s ‘lasy’ fonts. Other local text encodings should define them too, but if they don’t, the OT1 definitions will be used. PostScript fonts should always be used together with T1-encoding (not OT1), for proper hyphenation and built-in (better looking) French quotation marks.

The next step is to provide correct spacing after \guillemotleft and before \guillemotright : a space precedes and follows quotation marks but no line break is allowed neither after the opening one, nor before the closing one. \guill@spacing which does the spacing, has been fine tuned by Thierry Bouche.

The top macros for quotation marks will be called \og (“\underline{o}uvrez \underline{g}uillemets”) and \fg (“\underline{f}ermez \underline{g}uillemets”).

The top level definitions for French 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.

      As \DeclareTextCommand cannot be used after the \begin{document} we in-

troduce internal definitions \begin@guill and \end@guill.

We’ll try to be smart to users of D. Carlisle’s xspace package: if this package is loaded there will be no need for {} or \ to get a space after \fg.

\guillemotleft \guillemotright \og \fg \FrenchGuillemetsFrom \CyrillicGuillemets \LasyGuillemets \bbl@frenchguillemets \bbl@nonfrenchguillemets In L^{A}TEX 2ε we provide a dummy definition for \og and \fg, just to display an

error message in case \og or \fg have been defined elsewhere.

28.232 \ifLaTeXe
28.233 \def\FrenchGuillemetsFrom#1#2#3#4{%
28.234  \DeclareFontEncoding{#1}{}{}%
28.235  \DeclareFontSubstitution{#1}{#2}{m}{n}%
28.236  \DeclareTextCommand{\guillemotleft}{OT1}{%
28.237  {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3}}%
28.238  \DeclareTextCommand{\guillemotright}{OT1}{%
28.239  {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
28.240 \def\CyrillicGuillemets{\FrenchGuillemetsFrom{OT2}{wncyr}{60}{62}}
28.241 \def\LasyGuillemets{%
28.242  \DeclareTextCommand{\guillemotleft}{OT1}{\hbox{%
28.243  \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}}%
28.244  \DeclareTextCommand{\guillemotright}{OT1}{\hbox{%
28.245  \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}}
28.246 \IfFileExists{ot2wncyr.fd}{\CyrillicGuillemets}{\LasyGuillemets}
28.247 \DeclareTextSymbolDefault{\guillemotleft}{OT1}
28.248 \DeclareTextSymbolDefault{\guillemotright}{OT1}
28.249 \def\guill@spacing{\penalty\@M\hskip.8\fontdimen2\font
28.250  plus.3\fontdimen3\font
28.251  minus.8\fontdimen4\font}
28.252 \newcommand{\og}{\@empty}
28.253 \newcommand{\fg}{\@empty}
28.254 \DeclareRobustCommand*{\begin@guill}{\leavevmode
28.255  \guillemotleft\penalty\@M\guill@spacing}
28.256 \DeclareRobustCommand*{\end@guill}{\ifdim\lastskip>\z@\unskip\fi
28.257  \penalty\@M\guill@spacing\guillemotright\xspace}
28.258 \AtBeginDocument{\ifx\xspace\@undefined\let\xspace\relax\fi}

For PlainTEX, and L^{A}TEX-2.09 we define \begin@guill and \end@guill using math symbols \ll and \gg.

28.259 \else

28.260 \def\begin@guill{\leavevmode\raise0.25ex%
28.261  \hbox{$\scriptscriptstyle\ll$}%
28.262  \penalty\@M\hskip.8\fontdimen2\font

28.263  plus.3\fontdimen3\font
28.264  minus.3\fontdimen4\font}
28.265 \def\end@guill{\ifdim\lastskip>\z@\unskip\penalty\@M\fi
28.266  \penalty\@M\hskip.8\fontdimen2\font
28.267  plus.3\fontdimen3\font minus.3\fontdimen4\font
28.268  \raise0.25ex\hbox{$\scriptscriptstyle\gg$}}
28.269 \let\xspace\relax

28.270 \fi

28.271 \def\bbl@frenchguillemets{\let\og\begin@guill
28.272  \let\fg\end@guill}
28.273 \def\bbl@nonfrenchguillemets{\def\og{``}%
28.274  \def\fg{\ifdim\lastskip>\z@\unskip\fi ''}}
28.275 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.276 \bbl@frenchguillemets}
28.277 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.278 \bbl@nonfrenchguillemets}

28.4 French lists

\bbl@frenchlistspacing \bbl@nonfrenchlistspacing Vertical spacing in general lists should be shorter in French texts than the defaults provided by L^{A}TEX. 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; as most lists are based on \list we will redefine \list (up to version 1.4, the more internal command \@trivlist was redefined, this ensured that all lists would have common settings, but didn’t allow the users to provide their own settings, as pointed out by P. Pichaureau). If standard LaTeX settings are preferred, it is easy to issue the command \FrenchListSpacingfalse in the preamble or in frenchb.cfg. Please note that changing the flag \FrenchListSpacing will not take effect immediately, but next time language French is switched on.

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 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 not null.

Of course, this code is only for L^{A}TEX.

28.279 \newif\ifFrenchListSpacing \FrenchListSpacingtrue
28.280 \newif\ifFrenchOldTrivlist
28.281 \ifLaTeX
28.282 \let\listORI\list

\endlist is not redefined, but \endlistORI is provided for the users who prefer to define their own lists from the original command, they can code:

\begin{listORI}{}{} \end{listORI}.
28.283 \let\endlistORI\endlist
28.284 \def\FR@listsettings{%
28.285  \setlength{\itemsep}{0.4ex plus 0.2ex minus 0.2ex}%
28.286  \setlength{\parsep}{0.4ex plus 0.2ex minus 0.2ex}%
28.287  \setlength{\topsep}{0.8ex plus 0.4ex minus 0.4ex}%
28.288  \setlength{\partopsep}{0.4ex plus 0.2ex minus 0.2ex}%
28.289  \addtolength{\topsep}{-\parskip}%
28.290  \addtolength{\partopsep}{\parskip}}

28.291 \def\listFR#1#2{\listORI{#1}{\FR@listsettings #2}}%

Keep the \@trivlist redefinition from version 1.4 (only for compatibility reasons). The flag \ifFrenchOldTrivlist could happen to be useful to process older documents.

28.292 \let\@trivlistORI\@trivlist
28.293 \def\@trivlistFR{\FR@listsettings\@trivlistORI}
28.294 \def\bbl@frenchlistspacing{\ifFrenchListSpacing\let\list\listFR\fi
28.295  \ifFrenchOldTrivlist\let\@trivlist\@trivlistFR
28.296  \let\list\listORI\fi}
28.297 \def\bbl@nonfrenchlistspacing{\let\list\listORI
28.298  \let\@trivlist\@trivlistORI}
28.299 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.300  \bbl@frenchlistspacing}
28.301 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.302  \bbl@nonfrenchlistspacing}

28.303 \fi

\bbl@frenchitemize \bbl@nonfrenchitemize The layout of French itemize-lists has changed between version 1.2 and 1.3. Jacques André and Thierry Bouche pointed out to me that vertical spacing between items, before and after the list, should null with no glue added. Moreover horizontal spacing was not correct either: the item labels of a first level list should be vertically aligned on the paragraph’s first character (at \parindent from the left margin). Checking the book “Lexique des règles typographiques en usage à l’Imprimerie nationale” confirmed their points, so the itemize environment has been totally redefined for French in version 1.3.

Several people pointed out to me that the layout of lists can either be set by the current language or be tuned independently of the language as part of the layout of the document. So hooks should be provided to switch off the special settings

made in frenchb. Setting \FrenchItemizeSpacingfalse after loading frenchb

in the preamble switches back to settings of version 1.2 (this can be useful to process old documents). If you want all list spacings to be exactly what they are in standard L^{A}TEX 2ε, then add also \FrenchListSpacingfalse in the preamble after loading frenchb. Both switches can also be set in frenchb.cfg. Please note

that changing the flags \FrenchItemizeSpacing and \FrenchListSpacing will

not take effect immediately, but next time language French is switched on.

The • is never used in French itemize-lists, a long dash ‘–’ is preferred for all levels. The item label used in French is stored in \FrenchLabelItem}, it defaults to ’–’ and can be changed using \renewcommand (see the example configuration file above).

28.304 \newif\ifFrenchItemizeSpacing \FrenchItemizeSpacingtrue
28.305 \ifLaTeX
28.306 \newcommand{\FrenchLabelItem}{\textendash}
28.307 \newcommand{\Frlabelitemi}{\FrenchLabelItem}
28.308 \newcommand{\Frlabelitemii}{\FrenchLabelItem}
28.309 \newcommand{\Frlabelitemiii}{\FrenchLabelItem}
28.310 \newcommand{\Frlabelitemiv}{\FrenchLabelItem}
28.311 \def\bbl@frenchitemize{%
28.312  \let\@ltiORI\labelitemi
28.313  \let\@ltiiORI\labelitemii
28.314  \let\@ltiiiORI\labelitemiii
28.315  \let\@ltivORI\labelitemiv

28.316  \let\itemizeORI\itemize
28.317  \let\labelitemi\Frlabelitemi
28.318  \let\labelitemii\Frlabelitemii
28.319  \let\labelitemiii\Frlabelitemiii
28.320  \let\labelitemiv\Frlabelitemiv
28.321  \ifFrenchItemizeSpacing
   Make sure \itemize uses \@trivlistORI even with \FrenchOldTrivlisttrue.
28.322  \def\itemize{\let\@trivlist\@trivlistORI
28.323  \ifnum \@itemdepth >\thr@@\@toodeep\else
28.324  \advance\@itemdepth\@ne
28.325  \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
28.326  \expandafter
28.327  \listORI
28.328  \csname\@itemitem\endcsname
28.329  {\settowidth{\labelwidth}{\csname\@itemitem\endcsname}%
28.330  \setlength{\leftmargin}{\labelwidth}%
28.331  \addtolength{\leftmargin}{\labelsep}%
28.332  \ifnum\@listdepth=0
28.333  \setlength{\itemindent}{\parindent}%

28.334 \else

28.335  \addtolength{\leftmargin}{\parindent}%

28.336 \fi

28.337  \setlength{\itemsep}{\z@}%
28.338  \setlength{\parsep}{\z@}%
28.339  \setlength{\topsep}{\z@}%
28.340  \setlength{\partopsep}{\z@}%
28.341  \addtolength{\topsep}{-\parskip}%
28.342  \addtolength{\partopsep}{\parskip}}%

28.343 \fi}% 28.344 \fi}

The user’s changes in labelitems are saved when leaving French for further use when switching back to French.

28.345 \def\bbl@nonfrenchitemize{\let\Frlabelitemi\labelitemi
28.346  \let\Frlabelitemii\labelitemii
28.347  \let\Frlabelitemiii\labelitemiii
28.348  \let\Frlabelitemiv\labelitemiv
28.349  \let\labelitemi\@ltiORI
28.350  \let\labelitemii\@ltiiORI
28.351  \let\labelitemiii\@ltiiiORI
28.352  \let\labelitemiv\@ltivORI
28.353  \let\itemize\itemizeORI}
28.354 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.355  \bbl@frenchitemize}
28.356 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.357  \bbl@nonfrenchitemize}

28.358 \fi

28.5 French indentation of sections

\bbl@frenchindent \bbl@nonfrenchindent In French the first paragraph of each section should be indented, this is another difference with US-English. Add this code only in L^{A}TEX.

28.359 \ifLaTeX

28.360 \let\@aifORI\@afterindentfalse
28.361 \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
28.362  \@afterindenttrue}
28.363 \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
28.364  \@afterindentfalse}
28.365 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.366  \bbl@frenchindent}
28.367 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.368  \bbl@nonfrenchindent}

28.369 \fi

28.6 Formatting numbers

\DecimalMathComma \StandardMathComma As mentioned in the TEXbook p. 134, the comma is of type \mathpunct in math-mode: it is automatically followed by a 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 only (no space added); \StandardMathComma switches back to the standard behaviour of the comma.

28.370 \newcommand{\DecimalMathComma}{\iflanguage{french}%
28.371  {\mathcode`\,="013B}{}%
28.372  \addto\extrasfrench{\mathcode`\,="013B}}
28.373 \newcommand{\StandardMathComma}{\mathcode`\,="613B%
28.374  \addto\extrasfrench{\mathcode`\,="613B}}
28.375 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.376 \mathcode`\,="613B}

In English the decimal part starts with a point and thousands should be separated by a comma: an approximation of 1000π should be inputed as

$3{,}141.592{,}653$ in math-mode and as 3,141.592,653 in text.

In French the decimal part starts with a comma and thousands should be separated by a space; the same approximation of 1000π should be inputed as

$3\;141{,}592\;653$ in math-mode and as something like 3~141,592~653 in

text: in math-mode, 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 (French or non-French).

\nombre accepts an optional argument which happens to be useful with the package ‘dcolumn’, it specifies the decimal separator used in the source code:

\newcolumntype{d}{D{,}{\decimalsep}{-1}}
   \begin{tabular}{d}\hline
     3,14 \\
     \nombre[,]{123,4567} \\
     \nombre[,]{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.

\decimalsep \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 French (\f@thousandsep).

The commands \decimalsep and \thousandsep get default definitions (for the English language) when frenchb is loaded; these definitions will be updated when the current language is switched to or from French.

28.377 %    \begin{macrocode}
28.378 \mathchardef\m@comma="013B
28.379 \def\@comma@{\ifmmode\m@comma\else,\fi}
28.380 \def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
28.381 \def\ThinSpaceInFrenchNumbers{\def\f@thousandsep{%
28.382  \ifmmode\mskip3mu\else\penalty\@M\kern.16667em\fi}}
28.383 \newcommand{\decimalsep}{.}
28.384 \newcommand{\thousandsep}{\@comma@}
28.385 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.386  \def\decimalsep{\@comma@}%
28.387  \def\thousandsep{\f@thousandsep}}
28.388 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.389  \def\decimalsep{.}%
28.390  \def\thousandsep{\@comma@}}

Signs can now be entered inside \nombre. When \nombre is used in text-mode, signs should be text symbols to get the series, shape... from the current text-font. When signs are not available in text-mode, we provide some defaults.

28.391 \providecommand{\textminus}{\textendash}%
28.392 \providecommand{\textplusminus}{\ensuremath{\pm}}
28.393 \providecommand{\textminusplus}{\ensuremath{\mp}}
28.394 \def\fb@minus{\ifmmode-\else\textminus\fi}
28.395 \def\fb@plusminus{\ifmmode\pm\else\textplusminus\fi}
28.396 \def\fb@minusplus{\ifmmode\mp\else\textminusplus\fi}

\nombre The decimal separator used when inputing a number with \nombre has to be a comma. \nombre splits the inputed number into two parts: what comes before the first comma will be formatted by \@integerpart while the rest (if not empty) will be formatted by \@decimalpart. Both parts, once formatted separately will be merged together with between them, either the decimal separator \decimalsep or (in L^{A}TEX 2ε only) the optional argument of \nombre.

28.397 \if@Two@E
28.398 \newcommand{\nombre}[2][\decimalsep]{\def\@decimalsep{#1}%
28.399  \@@nombre#2\@empty,\@empty,\@nil}

28.400 \else

28.401 \def\@decimalsep{\decimalsep}
28.402 \newcommand{\nombre}[1]{\@nombre#1\@empty,\@empty,\@nil}

28.403 \fi

28.404 \def\@firstofmany#1#2,{#1}
28.405 \def\@@nombre#1,#2,#3\@nil{%
28.406  \def\nb@sign{}%
28.407  \edef\nb@first{\@firstofmany #1\@empty,}%

28.408  \edef\nb@suite{\@secondoftwo #1\@empty,}%
28.409  \if+\nb@first   \def\nb@sign{+}\fi
28.410  \if-\nb@first   \def\nb@sign{\fb@minus}\fi
28.411  \expandafter\ifx\nb@first\pm \def\nb@sign{\fb@plusminus}\fi
28.412  \expandafter\ifx\nb@first\mp \def\nb@sign{\fb@minusplus}\fi
28.413  \ifx\@empty\nb@sign
28.414  \let\@tmp\nb@suite\edef\nb@suite{\nb@first\@tmp}%

28.415 \fi

28.416  \nb@sign\expandafter\@nombre\nb@suite#2,#3\@nil}
28.417 \def\@nombre#1,#2,#3\@nil{%
28.418  \ifx\@empty#2%
28.419  \@integerpart{#1}%

28.420 \else

28.421  \@integerpart{#1}\@decimalsep\@decimalpart{#2}%

28.422 \fi}

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.

28.423 \def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
28.424 \def\@@decimalpart#1#2#3#4{#1#2#3%
28.425 \ifx\@empty#4%

28.426 \else

28.427  \thousandsep\expandafter\@@decimalpart\expandafter#4%

28.428 \fi}

Formatting the integer part is more difficult because the slices of 3 digits start from the bottom while the number is read from the top! This (tricky) code is borrowed from David Carlisle’s comma.sty.

28.429 \def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
28.430 \def\@@integerpart#1#2#3#4{%
28.431 \ifx\@empty#2%
28.432  \@addthousandsep#1\relax

28.433 \else

28.434  \ifx\@empty#3%
28.435  \@addthousandsep\@empty\@empty#1#2\relax

28.436 \else

28.437  \ifx\@empty#4%
28.438  \@addthousandsep\@empty#1#2#3\relax

28.439 \else

28.440  \@@integerpartafterfi{#1#2#3#4}%

28.441 \fi 28.442 \fi 28.443 \fi}

28.444 \def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
28.445 \def\@addthousandsep#1#2#3#4{#1#2#3%
28.446 \if#4\relax

28.447 \else

28.448  \thousandsep\expandafter\@addthousandsep\expandafter#4%

28.449 \fi}

28.7 Dots…

L^{A}TEX 2ε’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 \Frtextellipsis for French (in L^{A}TEX 2ε only).

The \if construction in the L^{A}TEX 2ε definition of \dots doesn’t allow the use of xspace (xspace is always followed by a \fi), so we use the AMS-L^{A}TEX construction of \dots; this has to be done ‘AtBeginDocument’ not to be overwritten when amsmath.sty is loaded after babel.

\Frtextellipsis
28.450 \ifLaTeXe
28.451 \DeclareTextCommandDefault{\Frtextellipsis}{%
28.452  .\kern\fontdimen3\font.\kern\fontdimen3\font.\xspace}

\Mdots@ and \Tdots@ORI hold the definitions of \dots in Math and Text mode. They default to those of amsmath-2.0, and will revert to standard L^{A}TEX definitions ‘AtBeginDocument’, if amsmath has not been loaded. \Mdots@ doesn’t change when switching from/to French, while \Tdots@ is \Frtextellipsis in French and \Tdots@ORI otherwise.

28.453 \newcommand{\Tdots@ORI}{\@xp\textellipsis}
28.454 \newcommand{\Tdots@}{\Tdots@ORI}
28.455 \newcommand{\Mdots@}{\@xp\mdots@}
28.456 \AtBeginDocument{\DeclareRobustCommand{\dots}{\relax
28.457  \csname\ifmmode M\else T\fi dots@\endcsname}%
28.458  \ifx\@xp\@undefined\let\@xp\relax\fi
28.459  \ifx\mdots@\@undefined\let\Tdots@ORI\textellipsis
28.460  \let\Mdots@\mathellipsis\fi}
28.461 \def\bbl@frenchdots{\let\Tdots@\Frtextellipsis}
28.462 \def\bbl@nonfrenchdots{\let\Tdots@\Tdots@ORI}
28.463 \expandafter\addto\csname extras\CurrentOption\endcsname{%
28.464  \bbl@frenchdots}
28.465 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
28.466  \bbl@nonfrenchdots}

28.467 \fi

28.8 Global layout

In multilingual documents, some typographic rules must depend on the current language (e.g., hyphenation, typesetting of numbers, spacing before double punctuation…), others should, IMHO, be kept global to the document: especially the layout of lists (see 28.4) and the indentation of the first paragraph of sections (see 28.5).

\FrenchLayout \StandardLayout In a multilingual document, a unified look, either the French one or the standard one, can be assigned to the whole document: adding \FrenchLayout will give a global “French look” to the document (e.g., lists, regardless the current language, will be typeset as in French) and \StandardLayout forces a global “US-English” look. Both of these commands can only be used before the \begin{document}. \StandardLayout can also be of interest for class designers who do not want frenchb to interfere with their global layout choices.

   As of version 1.4, \FrenchLayout and \StandardLayout only affect:

• the layout of lists (see 28.4),

• the indentation of the first paragraph of sections (see 28.5).

28.468 \ifLaTeXe
28.469 \newcommand{\FrenchLayout}{%
28.470  \renewcommand{\StandardLayout}{%
28.471  \PackageWarning{frenchb.ldf}%
28.472  {\protect\StandardLayout\space makes no change\MessageBreak
28.473  (\protect\FrenchLayout\space has been selected before
28.474  \MessageBreak for the whole document)}%

28.475 }%

28.476  \AtBeginDocument{\bbl@frenchitemize\bbl@frenchlistspacing
28.477  \bbl@frenchindent}%
28.478  \let\bbl@nonfrenchitemize\relax
28.479  \let\bbl@nonfrenchlistspacing\relax
28.480  \let\bbl@nonfrenchindent\relax}
28.481 \newcommand{\StandardLayout}{%
28.482  \renewcommand{\FrenchLayout}{%
28.483  \PackageWarning{frenchb.ldf}%
28.484  {\protect\FrenchLayout\space makes no change\MessageBreak
28.485  (\protect\StandardLayout\space has been selected before
28.486  \MessageBreak for the whole document)}%

28.487 }%

28.488  \let\bbl@frenchitemize\relax
28.489  \let\bbl@frenchlistspacing\relax
28.490  \let\bbl@frenchindent\relax}
28.491 \@onlypreamble\FrenchLayout
28.492 \@onlypreamble\StandardLayout

28.493 \fi

28.9 Extra utilities

All that is left to do now is to provide the French user with some extra utilities.

{\up \atop \ieme} \up eases the typesetting of superscripts like ‘1er’. \up relies on \textsuperscript when available (i. e., in L^{A}TEX 2ε).

\up@size The internal macro \up@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.

28.494 \ifx\sevenrm\@undefined
28.495 \ifx\@ptsize\@undefined
28.496  \let\up@size\small

28.497 \else

28.498  \ifx\selectfont\@undefined

In this case the format is the original L^{A}TEX-2.09:

28.499  \ifcase\@ptsize
28.500  \let\up@size\ixpt\or
28.501  \let\up@size\xpt\or
28.502  \let\up@size\xipt

28.503 \fi

When \selectfont is defined we probably have NFSS available:

28.504 \else

28.505  \ifcase\@ptsize
28.506  \def\up@size{\fontsize\@ixpt{10pt}\selectfont}\or
28.507  \def\up@size{\fontsize\@xpt{11pt}\selectfont}\or
28.508  \def\up@size{\fontsize\@xipt{12pt}\selectfont}

28.509 \fi 28.510 \fi 28.511 \fi 28.512 \else

If we end up here it must be a plain based TEX format, so:

28.513  \let\up@size\sevenrm

28.514 \fi

Now we can define \up. When L^{A}TEX 2ε runs in compatibility mode (L^{A}TEX-2.09 emulation), \textsuperscript is also defined, but does no good job, so we give two different definitions for \up using \if@Two@E.

28.515 \if@Two@E
28.516 \DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}

28.517 \else

28.518 \DeclareRobustCommand*{\up}[1]{\leavevmode\raise1ex\hbox{\up@size#1}}

28.519 \fi

\ieme is provided for compatibility with francais.sty, the other 5 for compatibility with french.sty:

28.520 \def\ieme{\up{\lowercase{e}}\xspace}
28.521 \def\iemes{\up{\lowercase{es}}\xspace}
28.522 \def\ier{\up{\lowercase{er}}\xspace}
28.523 \def\iers{\up{\lowercase{ers}}\xspace}
28.524 \def\iere{\up{\lowercase{re}}\xspace}
28.525 \def\ieres{\up{\lowercase{res}}\xspace}

\No \no \primo \fprimo) And some more macros for numbering, first two support macros.

28.526 \DeclareRobustCommand*{\FrenchEnumerate}[1]{%
28.527  #1\up{\lowercase{o}}\kern+.3em}
28.528 \DeclareRobustCommand*{\FrenchPopularEnumerate}[1]{%
28.529  #1\up{\lowercase{o}})\kern+.3em}

Typing \primo should result in ‘1^{o} ’,

28.530 \def\primo{\FrenchEnumerate1}
28.531 \def\secundo{\FrenchEnumerate2}
28.532 \def\tertio{\FrenchEnumerate3}
28.533 \def\quarto{\FrenchEnumerate4}

while typing \fprimo) gives ‘1^{o}) .

28.534 \def\fprimo){\FrenchPopularEnumerate1}
28.535 \def\fsecundo){\FrenchPopularEnumerate2}
28.536 \def\ftertio){\FrenchPopularEnumerate3}
28.537 \def\fquarto){\FrenchPopularEnumerate4}

Let’s provide two macros for the common abbreviations of “Numéro”.

28.538 \DeclareRobustCommand*{\No}{N\up{\lowercase{o}}\kern+.2em}
28.539 \DeclareRobustCommand*{\no}{n\up{\lowercase{o}}\kern+.2em}

\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; this is a simpler implementation of commands \fsc and \lsc from french.sty : no automatic uppercase/lowercase conversion is performed. Usage:

   Jean~\bsc{Duchemin}.
28.540 \DeclareRobustCommand*{\bsc}[1]{\leavevmode\hbox{\scshape #1}}

Some definitions for special characters. The first eight are mandatory for \oe etc. to work properly in moving arguments, the others just for convenience. 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 not be used in math-mode, its name in math-mode is \backslash. \degre needs a special treatment: it is \char6 in T1-encoding and \char23 in OT1-encoding, both can be accessed by the command \r{} for ring accent.

28.541 \ifLaTeXe
28.542 \DeclareTextSymbol{\ae}{T1}{230}
28.543 \DeclareTextSymbol{\ae}{OT1}{26}
28.544 \DeclareTextSymbol{\oe}{T1}{247}
28.545 \DeclareTextSymbol{\oe}{OT1}{27}
28.546 \DeclareTextSymbol{\AE}{T1}{198}
28.547 \DeclareTextSymbol{\AE}{OT1}{29}
28.548 \DeclareTextSymbol{\OE}{T1}{215}
28.549 \DeclareTextSymbol{\OE}{OT1}{30}
28.550 \DeclareTextSymbol{\at}{T1}{64}
28.551 \DeclareTextSymbol{\at}{OT1}{64}
28.552 \DeclareTextSymbol{\circonflexe}{T1}{94}
28.553 \DeclareTextSymbol{\circonflexe}{OT1}{94}
28.554 \DeclareTextSymbol{\tild}{T1}{126}
28.555 \DeclareTextSymbol{\tild}{OT1}{126}
28.556 \DeclareTextSymbolDefault{\at}{OT1}
28.557 \DeclareTextSymbolDefault{\circonflexe}{OT1}
28.558 \DeclareTextSymbolDefault{\tild}{OT1}
28.559 \DeclareRobustCommand*{\boi}{\textbackslash}
28.560 \DeclareRobustCommand*{\degre}{\r{}}

28.561 \else

28.562 \def\T@one{T1}
28.563 \ifx\f@encoding\T@one
28.564  \newcommand{\degre}{\char6}

28.565 \else

28.566  \newcommand{\degre}{\char23}

28.567 \fi

28.568 \newcommand{\at}{\char64}
28.569 \newcommand{\circonflexe}{\char94}
28.570 \newcommand{\tild}{\char126}
28.571 \newcommand{\boi}{{$\backslash$}}

28.572 \fi

\degres Macro for typesetting the abbreviation for ‘degrees’ (as in ‘degrees Celsius’). As the bounding box of the character ‘degree’ has 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).

28.573 \DeclareRobustCommand*{\degres}{%
28.574  \leavevmode\hbox to 0.3em{\hss\degre\hss}}

The following macros are used in the redefinition of \^and \" to handle the letter i: they allow users to type simply \^i and \"i instead of \^{\i} and \"{\i}.

MlTEX’s macros dealing with accents conflict with those of L^{A}TEX 2ε, so we check whether \csubinverse is defined or not. If \csubinverse is defined, we are in MlTEX.

28.575 \ifLaTeXe
28.576 \AtBeginDocument{%
28.577  \ifx\csubinverse\@undefined
28.578  \DeclareTextCompositeCommand{\^}{OT1}{i}{\^\i}%
28.579  \DeclareTextCompositeCommand{\"}{OT1}{i}{\"\i}%

28.580 \fi} 28.581 \fi

28.10 Date and clean up

\datefrench The macro \datefrench redefines the command \today to produce French dates.

28.582 \@namedef{date\CurrentOption}{%
28.583 \def\today{\number\day
28.584  \ifnum1=\day {\ier}\fi
28.585  \space \ifcase\month
28.586  \or janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
28.587  juillet\or ao\^ut\or septembre\or octobre\or novembre\or
28.588  d\'ecembre\fi
28.589  \space \number\year}}

Finally the macro-space used by some control sequences we do not need any longer, is freed.

28.590 \let\T@one\relax
28.591 \let\@FI@\relax
28.592 \let\ifLaTeX\@undefined
28.593 \let\LaTeXtrue\@undefined
28.594 \let\LaTeXfalse\@undefined
28.595 \let\ifLaTeXe\@undefined
28.596 \let\LaTeXetrue\@undefined
28.597 \let\LaTeXefalse\@undefined

The macro \ldf@quit takes care for setting the main language to be switched on at \begin{document} and resetting the category code of @ to its original value. The config file searched for has to be ‘frenchb.cfg’, and \CurrentOption has been set to ‘french’, so \ldf@finish\CurrentOption cannot be used: we first load

   ‘frenchb.cfg’, then call \ldf@quit\CurrentOption.
28.598 \loadlocalcfg{frenchb}
28.599 \ldf@quit\CurrentOption

28.600 ⟨/code⟩

29 The Italian language

The file italian.dtx^{25} defines all the language-specific macros for the Italian language.

The features of this language definition file are the following:

1. The Italian hyphenation is invoked, provided that file ithyph.tex was loaded when the L^{A}TEX 2ε format was built; in case it was not, read the information coming with your implementation of the TEX software and the babel documentation.

2. The language dependent fixed words to be inserted by such commands as

\chapter, \caption, \tableofcontents, etc. are redefined in accordance

with the Italian typographical practice.

3. 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 prohibited between the last two lines of a paragraph.

4. Some language specific shortcuts have been defined so as to allow etymological hyphenation, specifically " inserts a break point in any word boundary that the typesetter chooses, provided it is not followed by and accented letter (very unlikely in Italian, where compulsory accents fall only on the last and ending vowel of a word, but may take place with compound words that include foreign roots), and "| when the desired break point falls before an accented letter.

5. The shortcut "" introduces the raised (English) opening double quotes; this shortcut 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 Alt key while inputting the numerical code 0096; very, very annoying!

6. The shortcuts "< and "> insert the French guillemets, sometimes used 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 "> shortcuts (even with the T1 encoding) the necessary tests are performed and in case the suitable glyphs are taken from other fonts normally available with any good, modern L^{A}TEX distribution.

7. The accent internal macros used with the OT1 encoding are redefined so as to avoid elaborate input sequences such as \`{\i} that can be replaced with the much simpler and readable \`i, as it happens with the T1 encoding; the redefinition is valid far all accents.

25The file described in this section has version number v1.2o and was last revised on 2001/01/19. The original author is Maurizio Codogno, (mau@beatles.cselt.stet.it). It has been largely revised by Johannes Braams and Claudio Beccari

8. 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.

For this language a limited number of shortcuts has been defined, table 6, some of which are used to overcome certain limitations of the Italian keyboard; in section 29.3 there are other comments and hints in order to overcome some other keyboard limitations.

" 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.

"| the same as the above without the limitation on characters represented with control sequences or accented ones.

"" inserts open quotes “.
"< inserts open guillemets.
"> inserts closed guillemets.
"/ equivalent to \slash

Table 6: Shortcuts for the Italian language

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

29.1 ⟨∗code⟩

29.2 \LdfInit{italian}{captionsitalian}%

When this file is read as an option, i.e. by the \usepackage command, 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.

29.3 \ifx\l@italian\@undefined
29.4  \@nopatterns{Italian}%
29.5  \adddialect\l@italian0\fi

The next step consists of defining commands to switch to (and from) the Italian language.

\captionsitalian The macro \captionsitalian defines all strings used in the four standard document classes provided with L^{A}TEX.

29.6 \addto\captionsitalian{%
29.7 \def\prefacename{Prefazione}%
29.8 \def\refname{Riferimenti bibliografici}%
29.9 \def\abstractname{Sommario}%
29.10 \def\bibname{Bibliografia}%
29.11 \def\chaptername{Capitolo}%
29.12 \def\appendixname{Appendice}%
29.13 \def\contentsname{Indice}%
29.14 \def\listfigurename{Elenco delle figure}%

29.15 \def\listtablename{Elenco delle tabelle}%
29.16 \def\indexname{Indice analitico}%
29.17 \def\figurename{Figura}%
29.18 \def\tablename{Tabella}%
29.19 \def\partname{Parte}%
29.20 \def\enclname{Allegati}%
29.21 \def\ccname{e~p.~c.}%
29.22 \def\headtoname{Per}%
29.23 \def\pagename{Pag.}%    % in Italian the abbreviation is preferred
29.24 \def\seename{vedi}%
29.25 \def\alsoname{vedi anche}%
29.26 \def\proofname{Dimostrazione}%
29.27 \def\glossaryname{Glossario}%

29.28 }%

\dateitalian The macro \dateitalian redefines the command \today to produce Italian dates.

29.29 \def\dateitalian{%
29.30 \def\today{\number\day~\ifcase\month\or
29.31  gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
29.32  luglio\or agosto\or settembre\or ottobre\or novembre\or
29.33  dicembre\fi\space \number\year}}%

\italianhyphenmins The italian hyphenation patterns can be used with both \lefthyphenmin and

  \righthyphenmin set to 2.
29.34 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\extrasitalian \noextrasitalian Lower the chance that clubs or widows occur.

29.35 \addto\extrasitalian{%
29.36 \babel@savevariable\clubpenalty
29.37 \babel@savevariable\widowpenalty
29.38 \clubpenalty3000\widowpenalty3000}%

Never ever break a word between the last two lines of a paragraph in italian texts.

29.39 \addto\extrasitalian{%
29.40 \babel@savevariable\finalhyphendemerits
29.41 \finalhyphendemerits50000000}%

In order to enable the hyphenation of words such as “nell’altezza” we give the ' a non-zero lower case code. When we do that TEX finds the following hyphenation points nel-l'al-tez-za instead of none.

29.42 \addto\extrasitalian{%
29.43 \lccode`'=`'}%
29.44 \addto\noextrasitalian{%
29.45 \lccode`'=0}%

29.1 Support for etymological hyphenation

In his article on Italian hyphenation [1] 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 on 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 shortcut "| 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 ec fonts with the double Cork encoding (thus formerly called the 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 cm fonts; with the latter fonts the primitive command \accent is such that hyphenation becomes almost impossible, in any case strongly impeached.

The ec fonts contain a special character, named “compound word mark”, that occupies position 23 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 the typesetting of languages rich of compound words; also it has never been inserted in the hyphenation pattern files of any language. Beccari modified his pattern 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 shortcut 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!). In Italian such etymological hyphenation is desirable with technical terms, chemical names, and the like.

Even this solution proved to be inconvenient so Beccari resorted to another approach that uses the babel active character " and relies on the category code of the character that follows ".

29.46 \initiate@active@char{"}%
29.47 \addto\extrasitalian{\bbl@activate{"}\languageshorthands{italian}}%

\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.

29.48 \declare@shorthand{italian}{"}{%
29.49 \ifmmode
29.50  \def\it@next{''}%
29.51 \else
29.52  \def\it@next{\futurelet\it@temp\it@cwm}%

29.53 \fi

29.54 \it@next

29.55 }%

\it@cwm The \it@next service control sequence is such that upon its execution a temporary variable \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 \it@cwm and if it is found to be a letter token, then it introduces a compound word separator control sequence \it@allowhyphens whose expansion introduces a discretionary hyphen and an unbreakable space; in case the token is not a letter, then it is tested against |_{12}: if so a compound word separator is inserted and the | token is removed, otherwise another test is performed so as to see if another double quote sign follows: in this case a double open quote mark is inserted, otherwise two other tests are performed so as to see if guillemets have to be inserted, otherwise nothing is done. The double quote shortcut for inserting a double open quote sign is useful for people who are inputting Italian text by means of an Italian keyboard that unfortunately misses the grave or backtick key. By this shortcut "" becomes equivalent to ``.

29.56 \def\it@@cwm{\nobreak\discretionary{-}{}{}\hskip\z@skip}%
29.57 \DeclareRobustCommand*{\it@cwm}{\let\it@@next\relax
29.58 \ifcat\noexpand\it@temp a%
29.59  \def\it@@next{\it@@cwm}%
29.60 \else
29.61  \if\noexpand\it@temp \string|%
29.62  \def\it@@next{\it@@cwm\@gobble}%
29.63  \else
29.64  \if\noexpand\it@temp \string<%
29.65  \def\it@@next{\it@ocap\@gobble}%
29.66  \else
29.67  \if\noexpand\it@temp \string>%
29.68  \def\it@@next{\it@ccap\@gobble}%
29.69  \else
29.70  \if\noexpand\it@temp\string/%
29.71  \def\it@next{\slash\@gobble}%
29.72  \else
29.73  \ifx\it@temp"%
29.74  \def\it@@next{``\@gobble}%%^^A''

29.75 \fi 29.76 \fi 29.77 \fi 29.78 \fi 29.79 \fi 29.80 \fi

29.81 \it@@next}%

By this definition of " if one types macro"istruzione the possible break points become ma-cro-istru-zio-ne, while without the " mark they would be 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 des"clor"fenir"amina"cloridrato is breakable as des-clor-fe-nir-ami-na-clo-ri-dra-to instead of de-sclor-fe-ni-ra-mi-na-...

In other language description files a shortcut is defined so as to allow a break point without actually inserting any hyphen sign; examples are given such as entrada/salida; actually if one wants to allow a breakpoint after the slash, it is much clearer to type \slash instead of / and L^{A}TEX does everything by itself; here the shortcut "/ was introduced to stand for \slash so that one can type input"/output and allow a line break after the slash. This shortcut works only for the slash, since in Italian such constructs are extremely rare.

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 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 were 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 "| may be used that performs exactly as " normally does, except that the | sign is removed from the token input list: kilo"|{\"o}rsted gets hyphenated as ki-lo-ör-sted.

29.2 Facilities required by the ISO 31/XI regulations

The ISO 31/XI regulations require that units of measure are typeset in upright font in any circumstance, math or text, and that in text mode they are separated from the numerical indication of the measure with an unbreakable (thin) space.

The same regulations require also that super and subscripts (apices and pedices) are in upright font, not in math italics, when they represent “adjectives” or appositions to mathematical or physical variables that do not represent countable or measurable entities such as, for example, V_{max} or V_{rms} for a maximum 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 [2] 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 A^{T} to denote the transpose of matrix A; text superscripts are useful also as ordinals or in old fashioned abbreviations in text mode; for example the feminine ordinal 1^{a} or the old fashioned obsolete abbreviation F^{lli} for Fratelli in company names (compare with “Bros.” for \underline{bro}ther\underline{s} in American English); text subscripts are mostly used in logos.

\unit \ap \ped First we define the new (internal) commands \bbl@unit, \bbl@ap, and \bbl@ped

as robust ones.

29.82 \DeclareRobustCommand*{\bbl@unit}[1]{%
29.83 \textormath{\,\mbox{#1}}{\,\mathrm{#1}}}%
29.84 \DeclareRobustCommand*{\bbl@ap}[1]{%
29.85 \textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
29.86 \DeclareRobustCommand*{\bbl@ped}[1]{%
29.87 \textormath{$_{\mbox{\fontsize\sf@size\z@
29.88  \selectfont#1}}$}{_\mathrm{#1}}}%

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 memorize their meaning so as to restore them on exit.

29.89 \addto\extrasitalian{%
29.90 \babel@save\unit\let\unit\bbl@unit
29.91 \babel@save\ap\let\ap\bbl@ap
29.92 \babel@save\ped\let\ped\bbl@ped

29.93 }%

29.3 Accents

Most of the other language description files introduce a number of shortcuts 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, this device exhibits such limitations that up to now no convenient shortcuts 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 except the ‘e’, but, on the opposite, it carries the keys with all the accented lowercase vowels; 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 shortcut definitions such that, for example, by striking "( one gets directly { on the screen and the same sign is saved into the .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 .tex file from disk to memory. Such smart editors do exist and can be downloaded from the ctan archives.

This file, though, extends the OT1 accent commands so as to make them more similar to the T1 ones; in facts with the latter encoding it is legal to input in the input .tex file the accented ‘i’ as \`i while with the OT1 encoding it is necessary to use the full lengthy sequence \`{\i} or {\`\i}. There is no reason why with the OT1 encoding the former sequence should not be used; therefore, in order to achieve this goal the following redefinition of an internal L^{A}TEX command is required:

29.94 \renewcommand*{\add@accent}[2]{%
29.95 {\ifx#2i\let\bbl@tempa\i\else\let\bbl@tempa#2\fi
29.96  \setbox\@tempboxa\hbox{\bbl@tempa%
29.97  \global\mathchardef\accent@spacefactor\spacefactor}%
29.98  \accent#1\bbl@tempa}\spacefactor\accent@spacefactor}%

This internal command affects all the “upper” accents when the OT1 encoding is in force, but with babel it is not used for the diaeresis because of the many redefinitions of all commands that involve the " character, and for the necessities of the “umlaut” in German and other languages; the sequence \"i is already defined by default as an umlauted ‘i’ followed by a soft discretionary break; since this behavior is acceptable also in Italian, we leave the internal babel definitions as they are.

Please take notice that the above redefinitions are intended to affect only accents in the OT1 encoding; some combinations of accent and the letter ‘i’ were assumed impossible by the authors of the definitions related to the T1 encoding, so that possibly what has been done in this file goes farther than expected, but it seems to be harmless; in any case some experiments performed with both encodings show that they achieve the expected results with either one. For what concerns the missing backtick key, which is used also for inputting the open quotes, it must be noticed that the shortcut "" described above completely solves the problem for double raised open quotes; according to the traditions of particular publishing houses, since there are no compulsory regulations on the matter, the French guillemets may be used; in this case the T1 fontencoding solves the problem by means of its built in ligatures << and >>. But…

29.4 Caporali or French double quotes

Although the T1 fontencoding ligatures solve the problem, there are some circumstances where even the T1 fontencoding cannot be used, either because the author/typesetter wants to use the OT1 encoding, or because he/she uses a font set that does not comply completely with the T1 fontencoding; some virtual fonts, for example, are supposed to implement the double Cork fontencoding but actually miss some glyphs; one such virtual font set is given by the ae virtual fonts, because they are supposed to implement such double fontencoding simply using the cm fonts, of which the type 1 PostScript version exist and is freely available. Since guillemets (in Italian caporali) do not exist in any cm latin font, their glyphs must be substituted with something else that approaches them.

Since in French typesetting guillemets are compulsory, the French language definition file resorts to a clever font substitution; such file exploits the L^{A}TEX 2ε font selection machinery so as to get the guillemets from the Cyrillic fonts, because it suffices to locally change the default encoding. There are several sets of Cyrillic fonts, but the ones that obey the OT2 fontencoding are generally distributed with all recent implementations of the TEX software; they are part of the American Mathematical Society fonts and come both as METAFONT source files and Type 1 PostScript .pfb files. The availability of such fonts should be guaranteed by the presence of the OT2cmr.fd font description file. Actually the presence of this file does not guarantee the completeness of your TEX implementation; should L^{A}TEX complain about a missing Cyrillic .tfm file (that kind of file that contains the font metric parameters) and/or about missing Cyrillic (.mf) files, then your TEX system is incomplete and you should download such fonts from the ctan archives. Temporarily you may issue the command \LtxSymbCaporali so as to approximate the missing glyphs with the L^{A}TEX symbol fonts. In some case warning messages are issued so as to inform the typesetter about the necessity of resorting to some poor man solution.

\LtxSymbCaporali \it@ocap \it@ccap The “safety” macro \LtxSymbCaporali, to be issued by the typesetter when he/ she lacks the proper fonts, is very similar to the corresponding French one except that is not tied to any particular font encoding:

29.99 \def\LtxSymbCaporali{%
29.100  \DeclareRobustCommand*{\it@ocap}{\mbox{%
29.101  \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}%
29.102  \ignorespaces}%
29.103  \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi
29.104  \mbox{%
29.105  \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}%

29.106 }%

Actually the above macro simply defines the aliases for the shortcuts "< and "> so as to avoid all the warning messages that are being issued if the T1 encoded fonts in use lack the guillemets or if the Cyrillic font encoding OT2 settings can’t be defined. Beware, though, that if you are using some T1 encoded fonts, and you don’t know if they are complete as the ec fonts are, and you type directly << or >>, you miss all the testing and the warning messages that Italian shortcuts "< and "> offer and you might end up with little squares in place of the missing guillemets.

The other two macros \it@ocap and \it@ccap differ from the corresponding French ones in the sense that in Italian typography no space must be inserted between the caporali quotes and the text they enclose; if any space is incorrectly inserted by the typesetter after the open guillemets or before the closed ones, the macros for Italian remove this erroneous space; furthermore the Italian babel option is supposed to work only with L^{A}TEX 2ε, therefore it is not necessary to test the TEX format name.

We start with some operations that can be done once for all; we define a new boolean @CyrEncKnown in order to know if we can resort to the Cyrillic fonts

29.107 \newif\if@CyrEncKnown
29.108 \IfFileExists{ot2cmr.fd}%
29.109  {\@CyrEncKnowntrue\DeclareFontEncoding{OT2}{}{}}%
29.110  {\@CyrEncKnownfalse}%

Then we define an option warning so as to inform the typesetter on the “poor man” substitution we make

29.111 \DeclareRobustCommand*{\ItalianWarning}{%
29.112  \GenericWarning{(Italian Option)\space\space}%
29.113  {Italian Option Warning: No Cyrillic fonts available\MessageBreak
29.114  LaTeX Symbol approximation will be used for caporali}}%

Now we need the actual commands for the substituted caporali

29.115 \DeclareRobustCommand*{\CapAperti}{%
29.116 \if@CyrEncKnown
29.117  {\fontencoding{OT2}\fontfamily{wncyr}\selectfont\char60}%

29.118 \else

29.119  \ItalianWarning
29.120  {\fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}%

29.121 \fi 29.122 }%

29.123 \DeclareRobustCommand*{\CapChiusi}{%
29.124 \if@CyrEncKnown
29.125  {\fontencoding{OT2}\fontfamily{wncyr}\selectfont\char62}%

29.126 \else

29.127  \ItalianWarning
29.128  {\fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}%

29.129 \fi 29.130 }%

Finally we define the alias commands for the Italian shortcuts "< and ">. Before we need some device to spot if the assumed T1 complying font really contains the guillemets; unfortunately virtual fonts have black boxes in place of the missing characters, for which, in any case the corresponding TEX metrics are given; therefore we cannot test if the font misses the guillemets by “measuring” their width. Up to now the only fonts I (CB) know that claims to comply to the T1 encoding, but misses the guillemets is the group of ae font families and shapes, that are a virtualized 256 glyph strict version of the cm fonts; since the latter do not contain the guillemets, neither do the former. I decided then to examine the first two characters of the font family; if they are ‘ae’, then we are working with such incomplete font set; otherwise we assume the guillemets are present.

29.131 \newif\ifT@one@noCap
29.132 \def\get@ae#1#2#3!{\def\bbl@ae{#1#2}}%
29.133 \def\set@T@one@noCap{\expandafter\get@ae\f@family!%

29.134 \def\bbl@temp{ae}\ifx\bbl@ae\bbl@temp\T@one@noCaptrue\else
29.135  \T@one@noCapfalse\fi}%

Now we are ready to define the real code:

29.136 \DeclareRobustCommand*{\it@ocap}{%
29.137 \leavevmode
29.138 \ifx\cf@encoding\bbl@t@one
29.139  {\set@T@one@noCap
29.140  \ifT@one@noCap
29.141  \CapAperti

29.142 \else 29.143 <<% 29.144 \fi}% 29.145 \else

29.146  \CapAperti
29.147 \fi\ignorespaces}%
29.148 \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi%
29.149 \ifx\cf@encoding\bbl@t@one
29.150  {\set@T@one@noCap
29.151  \ifT@one@noCap
29.152  \CapChiusi

29.153 \else 29.154 >>% 29.155 \fi}% 29.156 \else

29.157  \CapChiusi

29.158 \fi}%

29.5 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 @ to its original value.

29.159 \ldf@finish{italian}%

29.160 ⟨/code⟩

References

[1] Beccari C., “Computer Aided Hyphenation for Italian and Modern Latin”, TUGboat vol. 13, n. 1, pp. 23-33 (1992).

[2] Beccari C., “Typesetting mathematics for science and technology according to ISO 31/XI”, TUGboat vol. 18, n. 1, pp. 39-48 (1997).

30 The Latin language

The file latin.dtx^{26} defines all the language-specific macros for the Latin language both in modern and medieval spelling.

For this language the \clubpenalty, \widowpenalty are set to rather high values and \finalhyphendemerits is set to such a high value that hyphenation is prohibited between the last two lines of a paragraph.

For this language two “styles” of typesetting are implemented: “regular” or modern-spelling Latin, and medieval Latin. The medieval Latin specific commands can be activated by means of the language attribute medieval; the medieval spelling differs from the modern one by the systematic use of the lower case ‘u’ also where in modern spelling the letter ‘v’ is used; when typesetting with capital letters, on the opposite, the letter ’V’ is used also in place of ’U’. Medieval spelling also includes the ligatures \ae (æ), \oe (œ), \AE (Æ), and \OE (Œ) that are not used in modern spelling, nor were used in the classical times.

For what concerns babel and typesetting with L^{A}TEX, the differences between the two styles of spelling reveal themselves in the strings used to name for example the “Preface” that becomes “Praefatio” or “Præfatio” respectively. Hyphenation rules are also different, but the hyphenation pattern file lahyph.tex takes care of both versions of the language. Needless to say that such patterns must be loaded in the L^{A}TEX format by by running initex (or whatever the name if the initializer)

on latex.ltx.

The name strings for chapters, figures, tables, etcetera, are suggested by prof. Raffaella Tabacco, a classicist of the University of Turin, Italy, to whom we address our warmest thanks. The names suggested by Krzysztof Konrad Żelechowski, 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 shortcuts are defined according to table 7; all of them are supposed to work with both spelling styles, except where the opposite is explicitly stated.

^i inserts the breve accent as ĭ; valid also for the other lowercase vowels, but it does not operate on the medieval ligatures æ and œ.

=a inserts the macron accent as ā; valid also for the other lowercase vowels, but it does not operate on the medieval ligatures æ and œ.

" inserts a compound word mark where hyphenation is legal; the next character must not be a medieval ligature æ or œ, nor an accented letter (foreign names). "| same as above, but operates also when the next character is a medieval ligature or an accented letter.

Table 7: Shortcuts defined for the Latin language

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

26The file described in this section has version number v2.0c and was last revised on 2001/02/19. The original author is Claudio Beccari with contributions by Krzysztof Konrad Żelechowski, (kkz@alfa.mimuw.edu.pl)

30.1 ⟨∗code⟩

 30.2 \LdfInit{latin}{captionslatin}

When this file is read as an option, i.e. by the \usepackage command, latin will be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@latin to see whether we have to do something here.

 30.3 \ifx\l@latin\@undefined
 30.4  \@nopatterns{Latin}
 30.5  \adddialect\l@latin0\fi

Now we declare the medieval language attribute.

 30.6 \bbl@declare@ttribute{latin}{medieval}{%
 30.7 \addto\captionslatin{\def\prefacename{Pr{\ae}fatio}}%
 30.8 \def\november{Nouembris}%
 30.9 \expandafter\addto\expandafter\extraslatin
30.10 \expandafter{\extrasmedievallatin}%

30.11 }

The next step consists of defining commands to switch to (and from) the Latin language^{27}.

\captionslatin The macro \captionslatin defines all strings used in the four standard document

classes provided with L^{A}TEX.

30.12 \@namedef{captionslatin}{%
30.13 \def\prefacename{Praefatio}%
30.14 \def\refname{Conspectus librorum}%
30.15 \def\abstractname{Summarium}%
30.16 \def\bibname{Conspectus librorum}%
30.17 \def\chaptername{Caput}%
30.18 \def\appendixname{Additamentum}%
30.19 \def\contentsname{Index}%
30.20 \def\listfigurename{Conspectus descriptionum}%
30.21 \def\listtablename{Conspectus tabularum}%
30.22 \def\indexname{Index rerum notabilium}%
30.23 \def\figurename{Descriptio}%
30.24 \def\tablename{Tabula}%
30.25 \def\partname{Pars}%
30.26 \def\enclname{Adduntur}%   Or " Additur" ? Or simply Add.?
30.27 \def\ccname{Exemplar}%     Use the recipient's dative
30.28 \def\headtoname{\ignorespaces}% Use the recipient's dative
30.29 \def\pagename{Charta}%
30.30 \def\seename{cfr.}%
30.31 \def\alsoname{cfr.}% R.Tabacco never saw "cfr. atque" or similar forms
30.32 \def\proofname{Demonstratio}%
30.33 \def\glossaryname{Glossarium}%

30.34 }

In the above definitions there are some points that might change in the future or that require a minimum of attention from the typesetter.

1. the \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?

27Most of these names were kindly suggested by Raffaella Tabacco.

2. The \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 an 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.

3. The same holds true for the copy recipient’s name in the “Cc” field of

     \ccname.

\datelatin The macro \datelatin redefines the command \today to produce Latin dates; the choice of faked small caps Latin numerals is arbitrary and may be changed in the future. For medieval latin the spelling of ‘Novembris’ should be Nouembris. This is taken care of by using a control sequence which can be redefined when the attribute ‘medieval’ is selected.

30.35 \def\datelatin{%
30.36 \def\november{Novembris}
30.37 \def\today{%
30.38  {\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont
30.39  \uppercase\expandafter{\romannumeral\day}}~\ifcase\month\or
30.40  Ianuarii\or Februarii\or Martii\or Aprilis\or Maii\or Iunii\or
30.41  Iulii\or Augusti\or Septembris\or Octobris\or \november\or
30.42  Decembris\fi
30.43  \space{\uppercase\expandafter{\romannumeral\year}}}}

\romandate Thomas Martin Widmann (viralbus@daimi.au.dk) developed a macro originally named \latindate (but to be renamed \romandate so as not to conflict with the standard babel conventions) that should compute and translate the current date into a date ab urbe condita with days numbered according to the kalendae and idus; for the moment this is a placeholder for Thomas’ macro, waiting for a self standing one that keeps local all the intermediate data, counters, etc. If he succeeds, here is the place to add his macro.

\latinhyphenmins The Latin hyphenation patterns can be used with both \lefthyphenmin and

\righthyphenmin set to 2.
30.44 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\extraslatin \noextraslatin Lower the chance that clubs or widows occur.

30.45 \addto\extraslatin{%
30.46 \babel@savevariable\clubpenalty
30.47 \babel@savevariable\widowpenalty
30.48 \clubpenalty3000\widowpenalty3000}

Never ever break a word between the last two lines of a paragraph in latin texts.

30.49 \addto\extraslatin{%
30.50 \babel@savevariable\finalhyphendemerits
30.51 \finalhyphendemerits50000000}

With medieval 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.

30.52 \addto\extrasmedievallatin{%
30.53 \babel@savevariable{\lccode`\V}%
30.54 \babel@savevariable{\uccode`\u}%
30.55 \lccode`\V=`\u \uccode`\u=`\V}

\SetLatinLigatures We need also the lccodes for æ and œ; 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 æ and œ 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… 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.

30.56 \addto\extraslatin{%
30.57 \babel@savevariable{\lccode`\^^e6}% T1
30.58 \babel@savevariable{\uccode`\^^e6}% T1
30.59 \babel@savevariable{\lccode`\^^c6}% T1
30.60 \babel@savevariable{\lccode`\^^f7}% T1
30.61 \babel@savevariable{\uccode`\^^d7}% T1
30.62 \babel@savevariable{\lccode`\^^d7}% T1
30.63 \babel@savevariable{\lccode`\^^1a}% OT1
30.64 \babel@savevariable{\uccode`\^^1a}% OT1
30.65 \babel@savevariable{\lccode`\^^1d}% OT1
30.66 \babel@savevariable{\lccode`\^^1b}% OT1
30.67 \babel@savevariable{\uccode`\^^1b}% OT1
30.68 \babel@savevariable{\lccode`\^^1e}% OT1
30.69 \SetLatinLigatures}
30.70 \providecommand\SetLatinLigatures{%
30.71 \def\@tempA{T1}\ifx\@tempA\f@encoding
30.72  \catcode`\^^e6=11 \lccode`\^^e6=`\^^e6 \uccode`\^^e6=`\^^c6 % \ae
30.73  \catcode`\^^c6=11 \lccode`\^^c6=`\^^e6 % \AE
30.74  \catcode`\^^f7=11 \lccode`\^^f7=`\^^f7 \uccode`\^^f7=`\^^d7 % \oe
30.75  \catcode`\^^d7=11 \lccode`\^^d7=`\^^f7 % \OE
30.76 \else
30.77  \catcode`\^^1a=11 \lccode`\^^1a=`\^^1a \uccode`\^^1a=`\^^1d % \ae
30.78  \catcode`\^^1d=11 \lccode`\^^1d=`\^^1a % \AE (^^])
30.79  \catcode`\^^1b=11 \lccode`\^^1b=`\^^1b \uccode`\^^1b=`\^^1e % \oe
30.80  \catcode`\^^1e=11 \lccode`\^^1e=`\^^1b % \OE (^^^)

30.81 \fi

30.82 \let\@tempA\@undefined

30.83 }

With the above definitions we are sure that \MakeUppercase works properly and \MakeUppercase{C{\ae}sar} correctly ‘yields ‘CÆSAR”; correspondingly \MakeUppercase{Heluetia} correctly yields “HELVETIA”.

For writing dictionaries or didactic texts (in modern spelling only) a couple of other active characters are defined: ^for marking a vowel with the breve sign, and = for marking a vowel with the macro sign. Please take notice that neither the OT1 fontencoding, 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.

30.84 \initiate@active@char{^}
30.85 \initiate@active@char{=}
30.86 \addto\extraslatin{\languageshorthands{latin}}
30.87 \addto\extraslatin{\bbl@activate{^}}
30.88 \addto\extraslatin{\bbl@activate{=}}
30.89 \addto\noextraslatin{\bbl@deactivate{^}}
30.90 \addto\noextraslatin{\bbl@deactivate{=}}

Now we define the shorthands only for Latin and only for lower case vowels.

30.91 \declare@shorthand{latin}{^a}{%
30.92  \textormath{\u{a}\allowhyphens}{\hat{a}}}
30.93 \declare@shorthand{latin}{^e}{%
30.94  \textormath{\u{e}\nobreak\hskip\z@skip}{\hat{e}}}
30.95 \declare@shorthand{latin}{^i}{%
30.96  \textormath{\u{\i}\nobreak\hskip\z@skip}{\hat{\imath}}}
30.97 \declare@shorthand{latin}{^o}{%
30.98  \textormath{\u{o}\nobreak\hskip\z@skip}{\hat{o}}}
30.99 \declare@shorthand{latin}{^u}{%
30.100  \textormath{\u{u}\nobreak\hskip\z@skip}{\hat{u}}}

30.101 %

30.102 \declare@shorthand{latin}{=a}{%
30.103  \textormath{\={a}\nobreak\hskip\z@skip}{\bar{a}}}
30.104 \declare@shorthand{latin}{=e}{%
30.105  \textormath{\={e}\nobreak\hskip\z@skip}{\bar{e}}}
30.106 \declare@shorthand{latin}{=i}{%
30.107  \textormath{\={\i}\nobreak\hskip\z@skip}{\bar{\imath}}}
30.108 \declare@shorthand{latin}{=o}{%
30.109  \textormath{\={o}\nobreak\hskip\z@skip}{\bar{o}}}
30.110 \declare@shorthand{latin}{=u}{%
30.111  \textormath{\={u}\nobreak\hskip\z@skip}{\bar{u}}}

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

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. 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.

30.112 \initiate@active@char{"}%

30.113 \addto\extraslatin{%
30.114 \bbl@activate{"}%

30.115 }

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.

30.116 \declare@shorthand{latin}{"}{%
30.117 \ifmmode
30.118  \def\lt@@next{''}%

30.119 \else

30.120  \def\lt@@next{\futurelet\lt@temp\lt@cwm}%

30.121 \fi

30.122 \lt@@next

30.123 }

In text mode the \lt@next control sequence is such that upon its execution a temporary variable \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 \lt@cwm and if it is found to be a letter token, then it introduces a compound word separator control sequence \lt@allowhyphens whose expansion introduces a discretionary hyphen and an unbreakable space; in case the token is not a letter, the token is tested again to find if it is the character |, in which case it is gobbled and a discretionary break is introduced.

30.124 \def\lt@allowhyphens{\nobreak\discretionary{-}{}{}\hskip\z@skip}
30.125 \newcommand*{\lt@cwm}{%
30.126 \let\lt@n@xt\relax
30.127 \ifcat\noexpand\lt@temp a%
30.128  \let\lt@n@xt\lt@allowhyphens

30.129 \else

30.130  \if\noexpand\lt@temp\string|%
30.131  \def\lt@n@xt{\lt@allowhyphens\@gobble}%

30.132 \fi

30.133 \fi\lt@n@xt}%

Attention: the category code comparison does not work if the temporary control sequence \lt@temp has been let equal to an implicit character, such as \ae; therefore this etymological hyphenation facility does not work with medieval Latin spelling when " immediately precedes a ligature. In order to overcome this drawback the shorthand "| may be used in such cases; it behaves exactly as ", but it does not test the implicit character control sequence. An input

such as super"|{\ae}quitas^{28} gets hyphenated as su-per-æqui-tas instead of
su-pe-ræ-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 @ to its original value.

30.134 \ldf@finish{latin}

30.135 ⟨/code⟩

28This word does not exist in “regular” Latin, and it is used just as an example.

31 The Portuguese language

The file portuges.dtx^{29} 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 8 an overview is given of its purpose.

"| disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word. "" like "-, 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.

Table 8: The extra definitions made by portuges.ldf

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

31.1 ⟨∗code⟩

31.2 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e. by the \usepackage command, 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: portuges, portuguese, brazil and 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.

31.3 \ifx\l@portuges\@undefined
31.4 \ifx\l@portuguese\@undefined
31.5  \ifx\l@brazil\@undefined
31.6  \ifx\l@brazilian\@undefined
31.7  \@nopatterns{Portuguese}
31.8  \adddialect\l@portuges0
31.9  \else
31.10  \let\l@portuges\l@brazilian

31.11 \fi

31.12  \else
31.13  \let\l@portuges\l@brazil

31.14 \fi

31.15 \else
31.16  \let\l@portuges\l@portuguese

31.17 \fi 31.18 \fi

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.

29The file described in this section has version number v1.2o and was last revised on 2001/02/16. Contributions were made by Jose Pedro Ramalhete (JRAMALHE@CERNVM or Jose-Pedro_Ramalhete@MACMAIL) and Arnaldo Viegas de Lima arnaldo@VNET.IBM.COM.

31.19 \expandafter\ifx\csname l@\CurrentOption\endcsname\relax
31.20 \expandafter\let\csname l@\CurrentOption\endcsname\l@portuges

31.21 \fi

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.
31.22 \def\bbl@tempa{portuguese}
31.23 \ifx\CurrentOption\bbl@tempa
31.24 \let\bbl@tempb\@empty
31.25 \else
31.26 \def\bbl@tempa{portuges}
31.27 \ifx\CurrentOption\bbl@tempa
31.28  \let\bbl@tempb\@empty
31.29 \else
31.30  \def\bbl@tempb{brazil}

31.31 \fi 31.32 \fi

31.33 \ifx\bbl@tempb\@empty

The next step consists of defining commands to switch to (and from) the Portuguese language.

\captionsportuges The macro \captionsportuges defines all strings used in the four standard doc-

umentclasses provided with L^{A}TEX.

31.34 \@namedef{captions\CurrentOption}{%
31.35  \def\prefacename{Pref\'acio}%
31.36  \def\refname{Refer\^encias}%
31.37  \def\abstractname{Resumo}%
31.38  \def\bibname{Bibliografia}%
31.39  \def\chaptername{Cap\'{\i}tulo}%
31.40  \def\appendixname{Ap\^endice}%

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:

The whole issue is that some books without a real index at the end misused the term ‘Índice’ as table of contents. Then, what happens is that some books apeared with ‘Índice’ at the begining and a ‘Índice 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ário’ and ‘Índice Remissivo’. In Portugal this seems not to be very common, therefore we chose ‘Índice’ instead of ‘Índice Remissivo’.

31.41  \def\contentsname{Conte\'udo}%
31.42  \def\listfigurename{Lista de Figuras}%
31.43  \def\listtablename{Lista de Tabelas}%
31.44  \def\indexname{\'Indice}%
31.45  \def\figurename{Figura}%
31.46  \def\tablename{Tabela}%
31.47  \def\partname{Parte}%
31.48  \def\enclname{Anexo}%

31.49  \def\ccname{Com c\'opia a}%
31.50  \def\headtoname{Para}%
31.51  \def\pagename{P\'agina}%
31.52  \def\seename{ver}%
31.53  \def\alsoname{ver tamb\'em}%

An alternate term for ‘Proof’ could be ‘Prova’.

31.54  \def\proofname{Demonstra\c{c}\~ao}%
31.55  \def\glossaryname{Glossary}% <-- Needs translation

31.56 }

\dateportuges The macro \dateportuges redefines the command \today to produce Portuguese

dates.

31.57 \@namedef{date\CurrentOption}{%
31.58  \def\today{\number\day\space de\space\ifcase\month\or
31.59  Janeiro\or Fevereiro\or Mar\c{c}o\or Abril\or Maio\or Junho\or
31.60  Julho\or Agosto\or Setembro\or Outubro\or Novembro\or Dezembro%

31.61 \fi

31.62  \space de\space\number\year}}
31.63 \else

For the Brasilian version of these definitions we just add a “dialect”.

31.64 \expandafter
31.65  \adddialect\csname l@\CurrentOption\endcsname\l@portuges

\captionsbrazil The “captions” are different for both versions of the language, so we define the

  macro \captionsbrazil here.
31.66 \@namedef{captions\CurrentOption}{%
31.67  \def\prefacename{Pref\'acio}%
31.68  \def\refname{Refer\^encias}%
31.69  \def\abstractname{Resumo}%
31.70  \def\bibname{Refer\^encias Bibliogr\'aficas}%
31.71  \def\chaptername{Cap\'{\i}tulo}%
31.72  \def\appendixname{Ap\^endice}%
31.73  \def\contentsname{Sum\'ario}%
31.74  \def\listfigurename{Lista de Figuras}%
31.75  \def\listtablename{Lista de Tabelas}%
31.76  \def\indexname{\'Indice Remissivo}%
31.77  \def\figurename{Figura}%
31.78  \def\tablename{Tabela}%
31.79  \def\partname{Parte}%
31.80  \def\enclname{Anexo}%
31.81  \def\ccname{C\'opia para}%
31.82  \def\headtoname{Para}%
31.83  \def\pagename{P\'agina}%
31.84  \def\seename{veja}%
31.85  \def\alsoname{veja tamb\'em}%
31.86  \def\proofname{Demonstra\c{c}\~ao}%
31.87  \def\glossaryname{Glossary}% <-- Needs translation

31.88 }

\datebrazil The macro \datebrazil redefines the command \today to produce Brasilian dates, for which the names of the months are not capitalized.

 31.89 \@namedef{date\CurrentOption}{%
 31.90  \def\today{\number\day\space de\space\ifcase\month\or
 31.91  janeiro\or fevereiro\or mar\c{c}o\or abril\or maio\or junho\or
 31.92  julho\or agosto\or setembro\or outubro\or novembro\or dezembro%

31.93 \fi

 31.94  \space de\space\number\year}}

31.95 \fi

\portugeshyphenmins Set correct values for \lefthyphenmin and \righthyphenmin.
 31.96 \providehyphenmins{\CurrentOption}{\tw@\thr@@}

\extrasportuges \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 " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the portuguese group of shorthands should be used.

 31.97 \initiate@active@char{"}
 31.98 \@namedef{extras\CurrentOption}{\languageshorthands{portuges}}
 31.99 \expandafter\addto\csname extras\CurrentOption\endcsname{%
31.100 \bbl@activate{"}}

Don’t forget to turn the shorthands off again.

31.101 \addto\noextrasportuges{\bbl@deactivate{"}}

First we define access to the guillemets for quotations,

31.102 \declare@shorthand{portuges}{"<}{%
31.103 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
31.104 \declare@shorthand{portuges}{">}{%
31.105 \textormath{\guillemotright}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behave a little different from \-.

31.106 \declare@shorthand{portuges}{"-}{\nobreak-\bbl@allowhyphens}
31.107 \declare@shorthand{portuges}{""}{\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

31.108 \declare@shorthand{portuges}{"|}{%
31.109 \textormath{\discretionary{-}{}{\kern.03em}}{}}

\- 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.

31.110 \expandafter\addto\csname extras\CurrentOption\endcsname{%
31.111 \babel@save\-}
31.112 \expandafter\addto\csname extras\CurrentOption\endcsname{%
31.113 \def\-{\allowhyphens\discretionary{-}{}{}\allowhyphens}}

\ord \ro \orda \ra We also provide an easy way to typeset ordinals, both in the male (\ord or \ro)

and the female (orda or \ra) form.

31.114 \def\ord{$^{\rm o}$}
31.115 \def\orda{$^{\rm a}$}
31.116 \let\ro\ord\let\ra\orda

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.

31.117 \ldf@finish\CurrentOption

31.118 ⟨/code⟩

32 The Spanish language

The file spanish.dtx^{30} defines all the language-specific macros for the Spanish language.

Custumization is made following mainly the books on the subject by José Martínez de Sousa. By typesetting spanish.dtx directly you will get the full documentation (regrettably is in Spanish only, but it is pretty long). References in this part refers to that document. There are several aditional features documented in the Spanish version only.

This style provides:

• Translations following the International L^{A}TEX conventions, as well as

\today.

• Shorthands listed in Table 9. Examples in subsection 3.4 are illustrative. Note that "~ has a special meaning in spanish different to other languages, and is used mainly in linguistic contexts.

'a acute accented a. Also for: e, i, o, u (both lowercase

and uppercase).

'n ñ (also uppercase).
~n ñ (also uppercase).
"u ü (also uppercase).
"a Ordinal numbers (also "A, "o, "O).
"c ç (also uppercase).
"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.
"| disable ligatures at this point.
"< Left guillemets.
"> Right guillemets.

<<   \begin{quoting}. (See text.)
>>   \end{quoting}. (See text.)

Table 9: Extra definitions made by file spanish.ldf

• \deactivatetilden deactivates the ~n and ~N shorthands.

• In math mode a dot followed by a digit is replaced by a decimal comma.

30The file described in this section has version number v4.1c and was last revised on 2001/01/30. The original author from v4.0 on is Javier Bezos. Previous versions were by Julio Sánchez, whose hyphenation patterns are still strongly recommended.

• Spanish ordinals and abbeviations with \sptext as, for instance, 1\sptext{er}. The preceptive dot is included.

• Accented functions: lím, máx, mín, mód. 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.

• A quoting environment and a related pair of shorthands << and >>. See subsection 3.7 for examples. The command \deactivatequoting deactivates these shorthand in case you want to use < and > in some AMS commands and numerical comparisons.

• The command \selectspanish selects the spanish language and its shorthands. (Intended for the preamble.)

• \frenchspacing is used.

• Ellipsis are best typed ... or, within a sentence, \...

• There is a small space before \%.

• \lsc provides lowercase small caps. (See subsection 3.10.)

Just in case spanish is the main language, the group \layoutspanish is activated, which modifies the standard classes through the whole document (it cannot be deactivated) in the following way (see section 4):

• Both enumerate and itemize are adapted to Spanish rules.

• Both \alph and \Alph include ñ after n.

• Symbol footmarks are one, two, three, etc., asteriscs.

• OT1 guillemets are generated with two lasy symbols instead of small \ll and \gg.

• \roman is redefined to write small caps roman numerals, since lowercase roman numerals are not allowed. However, 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.

• There is a dot after section numbers in titles and toc.

This group is ignored if you write \selectspanish* in the preamble. Some additional commands are provided to be used in the spanish.cfg file:

• With \es@activeacute acute accents are always active, overriding the default babel behaviour.

• \es@enumerate sets the labels to be used by enumerate. The same applies

  to \es@itemize and itemize.

• \es@operators stores the operator commands (subsection 3.6). All of them are canceled with

   \let\es@operators\relax

The commands \deactivatequoting, \deactivatetilden and \selectspanish

may be used in this file, too.

A subset of these commands is provided for use in Plain TEX (with \input spanish.sty).

32.1 The Code

This file provides definition for both L^{A}TEX 2ε and non L^{A}TEX 2ε formats.

Identify the ldf file.

32.1 ⟨∗code⟩

32.2 \ProvidesLanguage{spanish.ldf}
32.3  [2001/01/30 v4.1c Spanish support from the babel system]

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc. When this file is read as an option, i.e. by the \usepackage command, spanish will be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@spanish to see whether we have to do something here.

32.4 \LdfInit{spanish}\captionsspanish
32.5 \ifx\undefined\l@spanish
32.6 \@nopatterns{Spanish}
32.7 \adddialect\l@spanish0

32.8 \fi

We define some tools which will be used in that style file: (1) we make sure that ~ is active, (2) \es@delayed delays the expansion of the code in conditionals (in fact, quite similar to \bbl@afterfi).

32.9 \edef\es@savedcatcodes{%
32.10 \catcode`\noexpand\~=\the\catcode`\~
32.11 \catcode`\noexpand\"=\the\catcode`\"}
32.12 \catcode`\~=\active
32.13 \catcode`\"=12
32.14 \long\def\es@delayed#1\then#2\else#3\fi{%

32.15 #1%

32.16  \expandafter\@firstoftwo
32.17 \else
32.18  \expandafter\@secondoftwo

32.19 \fi

32.20 {#2}{#3}}

Two tests are introduced. The first one tells us if the format is L^{A}TEX 2ε, and the second one if the format is plain or any other. If both are false, the format is L^{A}TEX2.09.

32.21 \es@delayed
32.22 \expandafter\ifx\csname documentclass\endcsname\relax\then
32.23 \let\ifes@LaTeXe\iffalse
32.24 \else
32.25 \let\ifes@LaTeXe\iftrue

32.26 \fi

32.27 \es@delayed
32.28 \expandafter\ifx\csname newenvironment\endcsname\relax\then
32.29 \let\ifes@plain\iftrue
32.30 \else
32.31 \let\ifes@plain\iffalse

32.32 \fi

Translations for captions.

32.33 \addto\captionsspanish{%
32.34 \def\prefacename{Prefacio}%
32.35 \def\refname{Referencias}%
32.36 \def\abstractname{Resumen}%
32.37 \def\bibname{Bibliograf\'{\i}a}%
32.38 \def\chaptername{Cap\'{\i}tulo}%
32.39 \def\appendixname{Ap\'endice}%
32.40 \def\listfigurename{\'Indice de figuras}%
32.41 \def\listtablename{\'Indice de cuadros}%
32.42 \def\indexname{\'Indice alfab\'etico}%
32.43 \def\figurename{Figura}%
32.44 \def\tablename{Cuadro}%
32.45 \def\partname{Parte}%
32.46 \def\enclname{Adjunto}%
32.47 \def\ccname{Copia a}%
32.48 \def\headtoname{A}%
32.49 \def\pagename{P\'agina}%
32.50 \def\seename{v\'ease}%
32.51 \def\alsoname{v\'ease tambi\'en}%
32.52 \def\proofname{Demostraci\'on}%
32.53 \def\glossaryname{Glosario}}

32.54

32.55 \expandafter\ifx\csname chapter\endcsname\relax
32.56 \addto\captionsspanish{\def\contentsname{\'Indice}}
32.57 \else
32.58 \addto\captionsspanish{\def\contentsname{\'Indice general}}

32.59 \fi

And the date.

32.60 \def\datespanish{%
32.61 \def\today{\the\day~de \ifcase\month\or enero\or febrero\or
32.62  marzo\or abril\or mayo\or junio\or julio\or agosto\or septiembre\or
32.63  octubre\or noviembre\or diciembre\fi\ de~\the\year}}

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.

32.64 \def\selectspanish{%
32.65 \def\selectspanish{%
32.66  \def\selectspanish{%
32.67  \PackageWarning{spanish}{Extra \string\selectspanish ignored}}%
32.68  \es@select}}

32.69

32.70 \@onlypreamble\selectspanish

32.71

32.72 \def\es@select{%
32.73 \let\es@select\@undefined
32.74 \selectlanguage{spanish}%
32.75 \catcode`\"\active\catcode`\~=\active
32.76 \catcode`\<\active\catcode`\>=\active
32.77 \es@quoting}

Instead of joining all the extras directly in \extrasspanish, we subdivide them in three further groups.

 32.78 \def\extrasspanish{%
 32.79 \textspanish
 32.80 \mathspanish
 32.81 \ifx\shorthandsspanish\@empty
 32.82  \spanishdeactivate{"'~<>}%
 32.83  \languageshorthands{none}%
 32.84 \else
 32.85  \shorthandsspanish

32.86 \fi}

 32.87 \def\noextrasspanish{%
 32.88 \ifx\textspanish\@empty\else
 32.89  \notextspanish

32.90 \fi

 32.91 \ifx\mathspanish\@empty\else
 32.92  \nomathspanish

32.93 \fi

 32.94 \ifx\shorthandsspanish\@empty\else
 32.95  \noshorthandsspanish

32.96 \fi

 32.97 \es@reviveshorthands}

And the first of these sub-groups is defined.

 32.98 \addto\textspanish{%
 32.99 \babel@save\sptext
32.100 \def\sptext{\protect\es@sptext}}

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.

32.101 \ifes@LaTeXe   %<<<<<<
32.102 \newcommand\es@sptext[1]{%
32.103  {.\setbox\z@\hbox{8}\dimen@\ht\z@
32.104  \csname S@\f@size\endcsname
32.105  \edef\@tempa{\def\noexpand\@tempc{#1}%
32.106  \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
32.107  \ifx\@tempb\@tempc
32.108  \fontsize\sf@size\z@
32.109  \selectfont
32.110  \advance\dimen@-1.15ex

32.111 \else

32.112  \fontsize\ssf@size\z@
32.113  \selectfont
32.114  \advance\dimen@-1.5ex

32.115 \fi

32.116  \math@fontsfalse\raise\dimen@\hbox{#1}}}
32.117 \else          %<<<<<<
32.118 \let\sptextfont\rm
32.119 \newcommand\es@sptext[1]{%
32.120  {.\setbox\z@\hbox{8}\dimen@\ht\z@
32.121  \edef\@tempa{\def\noexpand\@tempc{#1}%
32.122  \lowercase{\def\noexpand\@tempb{#1}}}\@tempa
32.123  \ifx\@tempb\@tempc
32.124  \advance\dimen@-0.75ex
32.125  \raise\dimen@\hbox{$\scriptstyle\sptextfont#1$}%

32.126 \else

32.127  \advance\dimen@-0.8ex
32.128  \raise\dimen@\hbox{$\scriptscriptstyle\sptextfont#1$}%

32.129 \fi}}

32.130 \fi            %<<<<<<

Now, lowercase small caps. First, we test if there are actual small caps for the current font. If not, faked small caps are used. The \selectfont in \es@lsc could seem redundant, but it’s not.

32.131 \ifes@LaTeXe   %<<<<<<
32.132 \addto\textspanish{%
32.133  \babel@save\lsc
32.134  \def\lsc{\protect\es@lsc}}

32.135

32.136 \def\es@lsc#1{%
32.137  \leavevmode
32.138  \hbox{\scshape\selectfont
32.139  \expandafter\ifx\csname\f@encoding/\f@family/\f@series
32.140  /n/\f@size\expandafter\endcsname
32.141  \csname\curr@fontshape/\f@size\endcsname
32.142  \csname S@\f@size\endcsname
32.143  \fontsize\sf@size\z@\selectfont
32.144  \PackageInfo{spanish}{Replacing undefined sc font\MessageBreak
32.145  shape by faked small caps}%
32.146  \MakeUppercase{#1}%

32.147 \else

32.148  \MakeLowercase{#1}%

32.149 \fi}}

32.150 \fi            %<<<<<<

The quoting environment. This part is not available in Plain, hence the test. Overriding the default \everypar is a bit tricky.

32.151 \newif\ifes@listquot

32.152

32.153 \ifes@plain\else %<<<<<<
32.154 \csname newtoks\endcsname\es@quottoks
32.155 \csname newcount\endcsname\es@quotdepth

32.156

32.157 \newenvironment{quoting}
32.158 {\leavevmode
32.159  \advance\es@quotdepth1
32.160  \csname lquot\romannumeral\es@quotdepth\endcsname%
32.161  \ifnum\es@quotdepth=\@ne
32.162  \es@listquotfalse
32.163  \let\es@quotpar\everypar
32.164  \let\everypar\es@quottoks
32.165  \everypar\expandafter{\the\es@quotpar}%
32.166  \es@quotpar{\the\everypar
32.167  \ifes@listquot\global\es@listquotfalse\else\es@quotcont\fi}%

32.168 \fi

32.169  \toks@\expandafter{\es@quotcont}%
32.170  \edef\es@quotcont{\the\toks@
32.171  \expandafter\noexpand
32.172  \csname rquot\romannumeral\es@quotdepth\endcsname}}
32.173 {\csname rquot\romannumeral\es@quotdepth\endcsname}

32.174

32.175 \def\lquoti{\guillemotleft{}}
32.176 \def\rquoti{\guillemotright{}}
32.177 \def\lquotii{``}
32.178 \def\rquotii{''}
32.179 \def\lquotiii{`}
32.180 \def\rquotiii{'}

32.181

32.182 \let\es@quotcont\@empty

If there is a margin par 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.

32.183 \addto\@marginparreset{\let\es@quotcont\@empty}

32.184

32.185 \def\es@listquot{%
32.186  \csname rquot\romannumeral\es@quotdepth\endcsname
32.187  \global\es@listquottrue}
32.188 \fi            %<<<<<<

Now, the \frenchspacing, followed by \... and \%

32.189 \addto\textspanish{\bbl@frenchspacing}
32.190 \addto\notextspanish{\bbl@nonfrenchspacing}

32.191

32.192 \addto\textspanish{%
32.193 \let\es@save@dot\.%
32.194 \babel@save\.%
32.195 \def\.{\@ifnextchar.{\es@dots}{\es@save@dot}}}

32.196

32.197 \def\es@dots..{\leavevmode\hbox{...}\spacefactor\@M}

32.198

32.199 \addto\textspanish{%
32.200 \let\percentsign\%%
32.201 \babel@save\%%
32.202 \def\%{\unskip\,\percentsign{}}}

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 L^{A}TEX 2ε. There are two versions, depending on the format.

32.203 \addto\mathspanish{%
32.204 \babel@save\dotlessi
32.205 \def\dotlessi{\protect\es@dotlessi}}

32.206

32.207 \let\nomathspanish\relax %% Unused, but called

32.208

32.209 \ifes@LaTeXe   %<<<<<<
32.210 \addto\@uclclist{\dotlessi\i}
32.211 \fi            %<<<<<<

32.212

32.213 \ifes@LaTeXe   %<<<<<<
32.214 \def\es@dotlessi{%
32.215  \ifmmode
32.216  {\ifnum\mathgroup=\m@ne
32.217  \imath

32.218 \else

32.219  \count@\escapechar \escapechar=\m@ne
32.220  \expandafter\expandafter\expandafter
32.221  \split@name\expandafter\string\the\textfont\mathgroup\@nil
32.222  \escapechar=\count@
32.223  \@ifundefined{\f@encoding\string\i}%
32.224  {\edef\f@encoding{\string?}}{}%
32.225  \expandafter\count@\the\csname\f@encoding\string\i\endcsname
32.226  \advance\count@"7000
32.227  \mathchar\count@

32.228 \fi}% 32.229 \else 32.230 \i 32.231 \fi}

32.232 \else          %<<<<<<
32.233 \def\es@dotlessi{%
32.234  \ifmmode
32.235  \mathchar"7010

32.236 \else 32.237 \i 32.238 \fi}

32.239 \fi            %<<<<<<

The switches for accents and spaces in math.

32.240 \def\accentedoperators{%
32.241 \def\es@op@ac##1{\acute{##1}}%
32.242 \def\es@op@i{\acute{\dotlessi}}}
32.243 \def\unaccentedoperators{%
32.244 \def\es@op@ac##1{##1}%
32.245 \def\es@op@i{i}}
32.246 \accentedoperators

32.247

32.248 \def\spacedoperators{\let\es@op@sp\,}
32.249 \def\unspacedoperators{\let\es@op@sp\@empty}
32.250 \spacedoperators

The operators are stored in \es@operators, which in turn is included in the math group. Since \operator@font is defined in L^{A}TEX 2ε only, we defined in the plain variant.

32.251 \addto\mathspanish{\es@operators}

32.252

32.253 \ifes@LaTeXe\else %<<<<<<
32.254 \let\operator@font\rm
32.255 \def\@empty{}
32.256 \fi            %<<<<<<

32.257

32.258 \def\es@operators{%
32.259 \babel@save\lim
32.260 \def\lim{\mathop{\operator@font l\protect\es@op@i m}}%
32.261 \babel@save\limsup
32.262 \def\limsup{\mathop{\operator@font l\es@op@i m\,sup}}%
32.263 \babel@save\liminf
32.264 \def\liminf{\mathop{\operator@font l\es@op@i m\,inf}}%
32.265 \babel@save\max
32.266 \def\max{\mathop{\operator@font m\es@op@ac ax}}%

32.267 \babel@save\min
32.268 \def\min{\mathop{\operator@font m\protect\es@op@i n}}%
32.269 \babel@save\bmod
32.270 \def\bmod{%
32.271  \nonscript\mskip-\medmuskip\mkern5mu%
32.272  \mathbin{\operator@font m\es@op@ac od}\penalty900\mkern5mu%
32.273  \nonscript\mskip-\medmuskip}%
32.274 \babel@save\pmod
32.275 \def\pmod##1{%
32.276  \allowbreak\mkern18mu({\operator@font m\es@op@ac od}\,\,##1)}%
32.277 \def\es@a##1 {%
32.278  \es@delayed
32.279  \if^##1^\then  %  is it empty? do nothing and continue

32.280 \es@a 32.281 \else

32.282  \es@delayed
32.283  \if&##1\then % is it &? do nothing and finish

32.284 \else

32.285  \begingroup
32.286  \let\,\@empty % \, is ignored when def'ing the macro name
32.287  \edef\es@b{\expandafter\noexpand\csname##1\endcsname}%
32.288  \def\,{\noexpand\es@op@sp}%
32.289  \edef\es@a{\endgroup
32.290  \noexpand\babel@save\expandafter\noexpand\es@b
32.291  \def\expandafter\noexpand\es@b{%
32.292  \mathop{\noexpand\operator@font##1}\nolimits}}%
32.293  \es@a % It restores itself
32.294 %       \endgroup implicit

32.295 \es@a 32.296 \fi 32.297 \fi}%

32.298 \let\es@b\spanishoperators
32.299 \addto\es@b{ }%
32.300 \expandafter\es@a\es@b sen tg arc\,sen arc\,cos arc\,tg & }

32.301

32.302 \def\spanishoperators{cotg cosec senh tgh}

Now comes the text shorthands. They are grouped in \shorthandsspanish 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.

32.303 \DeclareTextCompositeCommand{\'}{OT1}{i}{\@tabacckludge'{\i}}

32.304

32.305 \def\es@set@shorthand#1{%
32.306 \expandafter\edef\csname es@savecat\string#1\endcsname
32.307  {\the\catcode`#1}%
32.308 \initiate@active@char{#1}%
32.309 \catcode`#1=\csname es@savecat\string#1\endcsname\relax
32.310 \expandafter\let\csname es@math\string#1\expandafter\endcsname
32.311  \csname normal@char\string#1\endcsname}

32.312

32.313 \def\es@use@shorthand{%
32.314 \es@delayed

32.315 \ifx\thepage\relax\then
32.316  \string
32.317 \else{%
32.318  \es@delayed
32.319  \ifx\protect\@unexpandable@protect\then
32.320  \noexpand

32.321 \else

32.322  \es@use@sh

32.323 \fi}% 32.324 \fi}

32.325

32.326 \def\es@text@sh#1{\csname active@char\string#1\endcsname}
32.327 \def\es@math@sh#1{\csname es@math\string#1\endcsname}

32.328

32.329 \def\es@use@sh{%
32.330 \es@delayed
32.331 \if@safe@actives\then
32.332  \string
32.333 \else{%
32.334  \es@delayed
32.335  \ifmmode\then
32.336  \es@math@sh

32.337 \else

32.338  \es@text@sh

32.339 \fi}% 32.340 \fi}

32.341

32.342 \gdef\es@activate#1{%
32.343 \begingroup
32.344  \lccode`\~=`#1
32.345  \lowercase{%
32.346 \endgroup
32.347 \def~{\es@use@shorthand~}}}

32.348

32.349 \def\spanishdeactivate#1{%
32.350 \@tfor\@tempa:=#1\do{\expandafter\es@spdeactivate\@tempa}}

32.351

32.352 \def\es@spdeactivate#1{%
32.353 \begingroup
32.354  \lccode`\~=`#1
32.355  \lowercase{%
32.356  \endgroup
32.357 \expandafter\let\expandafter~%
32.358  \csname normal@char\string#1\endcsname}%}%
32.359 \catcode`#1\csname es@savecat\string#1\endcsname\relax}

32.360

32.361 \def\es@reviveshorthands{%
32.362 \es@restore{"}\es@restore{~}%
32.363 \es@restore{<}\es@restore{>}%
32.364 \es@quoting}

32.365

32.366 \def\es@restore#1{%
32.367 \catcode`#1=\active
32.368 \begingroup

32.369  \lccode`\~=`#1
32.370  \lowercase{%
32.371 \endgroup
32.372 \bbl@deactivate{~}}}

But spanish allows two category codes for ', so both should be taken into

   account in \bbl@pr@m@s.
32.373 \begingroup
32.374 \catcode`\'=12
32.375 \lccode`~=`' \lccode`'=`'
32.376 \lowercase{%
32.377 \gdef\bbl@pr@m@s{%
32.378 \es@delayed
32.379 \ifx~\@let@token\then
32.380  \pr@@@s

32.381 \else

32.382  {\es@delayed
32.383  \ifx'\@let@token\then
32.384  \pr@@@s

32.385 \else

32.386  {\es@delayed
32.387  \ifx^\@let@token\then
32.388  \pr@@@t

32.389 \else

32.390  \egroup

32.391 \fi}% 32.392 \fi}% 32.393 \fi}}

32.394 \endgroup
32.395 \expandafter\ifx\csname @tabacckludge\endcsname\relax
32.396 \let\es@tak\a

32.397 \else

32.398 \let\es@tak\@tabacckludge

32.399 \fi

32.400

32.401 \ifes@LaTeXe   %<<<<<<
32.402 \def\@tabacckludge#1{\expandafter\es@tak\string#1}
32.403 \let\a\@tabacckludge
32.404 \else\ifes@plain %<<<<<<
32.405 \def\@tabacckludge#1{\csname\string#1\endcsname}
32.406 \else          %<<<<<<
32.407 \def\@tabacckludge#1{\csname a\string#1\endcsname}
32.408 \fi\fi         %<<<<<<

32.409

32.410 \expandafter\ifx\csname add@accent\endcsname\relax
32.411 \def\add@accent#1#2{\accent#1 #2}

32.412 \fi

Instead of redefining \', we redefine the internal macro for the OT1 encoding.

32.413 \ifes@LaTeXe   %<<<<<<
32.414 \def\es@accent#1#2#3{%
32.415  \expandafter\@text@composite
32.416  \csname OT1\string#1\endcsname#3\@empty\@text@composite
32.417  {\bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
32.418  \spacefactor\sfcode`#3 }}

32.419 \else          %<<<<<<
32.420 \def\es@accent#1#2#3{%
32.421  \bbl@allowhyphens\add@accent{#2}{#3}\bbl@allowhyphens
32.422  \spacefactor\sfcode`#3 }
32.423 \fi            %<<<<<<

The shorthands are activated in the aux file. Now, we begin the shorthands group.

32.424 \addto\shorthandsspanish{\languageshorthands{spanish}}
32.425 \let\noshorthandsspanish\relax

First, decimal comma.

32.426 \def\spanishdecimal#1{\def\es@decimal{{#1}}}
32.427 \def\decimalcomma{\spanishdecimal{,}}
32.428 \def\decimalpoint{\spanishdecimal{.}}
32.429 \decimalcomma

32.430

32.431 \es@set@shorthand{.}

32.432

32.433 \@namedef{es@math\string.}{%
32.434 \@ifnextchar\egroup
32.435  {\mathchar\es@period@code\relax}%
32.436  {\es@text@sh.}}

32.437

32.438 \declare@shorthand{system}{.}{\mathchar\es@period@code\relax}
32.439 \addto\shorthandsspanish{%
32.440 \mathchardef\es@period@code\the\mathcode`\.%
32.441 \babel@savevariable{\mathcode`\.}%
32.442 \mathcode`\.="8000 %
32.443 \es@activate{.}}

32.444

32.445 \AtBeginDocument{%
32.446 \catcode`\.=12
32.447 \if@filesw
32.448  \immediate\write\@mainaux{%
32.449  \string\catcode`\string\.=12}%

32.450 \fi}

32.451

32.452 \declare@shorthand{spanish}{.1}{\es@decimal1}
32.453 \declare@shorthand{spanish}{.2}{\es@decimal2}
32.454 \declare@shorthand{spanish}{.3}{\es@decimal3}
32.455 \declare@shorthand{spanish}{.4}{\es@decimal4}
32.456 \declare@shorthand{spanish}{.5}{\es@decimal5}
32.457 \declare@shorthand{spanish}{.6}{\es@decimal6}
32.458 \declare@shorthand{spanish}{.7}{\es@decimal7}
32.459 \declare@shorthand{spanish}{.8}{\es@decimal8}
32.460 \declare@shorthand{spanish}{.9}{\es@decimal9}
32.461 \declare@shorthand{spanish}{.0}{\es@decimal0}

Now accents and tools

32.462 \es@set@shorthand{"}
32.463 \def\es@umlaut#1{%
32.464 \bbl@allowhyphens\add@accent{127}#1\bbl@allowhyphens
32.465 \spacefactor\sfcode`#1 }

We override the default " of babel, intended for german.

32.466 \ifes@LaTeXe   %<<<<<<
32.467 \addto\shorthandsspanish{%
32.468  \es@activate{"}%
32.469  \es@activate{~}%
32.470  \babel@save\bbl@umlauta
32.471  \let\bbl@umlauta\es@umlaut
32.472  \expandafter\babel@save\csname OT1\string\~\endcsname
32.473  \expandafter\def\csname OT1\string\~\endcsname{\es@accent\~{126}}%
32.474  \expandafter\babel@save\csname OT1\string\'\endcsname
32.475  \expandafter\def\csname OT1\string\'\endcsname{\es@accent\'{19}}}
32.476 \else          %<<<<<<
32.477 \addto\shorthandsspanish{%
32.478  \es@activate{"}%
32.479  \es@activate{~}%
32.480  \babel@save\bbl@umlauta
32.481  \let\bbl@umlauta\es@umlaut
32.482  \babel@save\~%
32.483  \def\~{\es@accent\~{126}}%
32.484  \babel@save\'%
32.485  \def\'#1{\if#1i\es@accent\'{19}\i\else\es@accent\'{19}{#1}\fi}}
32.486 \fi            %<<<<<<
32.487 \declare@shorthand{spanish}{"a}{\protect\es@sptext{a}}
32.488 \declare@shorthand{spanish}{"A}{\protect\es@sptext{A}}
32.489 \declare@shorthand{spanish}{"o}{\protect\es@sptext{o}}
32.490 \declare@shorthand{spanish}{"O}{\protect\es@sptext{O}}

32.491

32.492 \declare@shorthand{spanish}{"u}{\"u}
32.493 \declare@shorthand{spanish}{"U}{\"U}

32.494

32.495 \declare@shorthand{spanish}{"c}{\c{c}}
32.496 \declare@shorthand{spanish}{"C}{\c{C}}

32.497

32.498 \declare@shorthand{spanish}{"<}{\guillemotleft{}}
32.499 \declare@shorthand{spanish}{">}{\guillemotright{}}
32.500 \declare@shorthand{spanish}{"-}{\bbl@allowhyphens\-\bbl@allowhyphens}
32.501 \declare@shorthand{spanish}{"=}%
32.502 {\bbl@allowhyphens\char\hyphenchar\font\hskip\z@skip}
32.503 \declare@shorthand{spanish}{"~}
32.504 {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
32.505  {\char\hyphenchar\font}{\char\hyphenchar\font}\bbl@allowhyphens}
32.506 \declare@shorthand{spanish}{"r}
32.507 {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
32.508  {}{r}\bbl@allowhyphens}
32.509 \declare@shorthand{spanish}{"R}
32.510 {\bbl@allowhyphens\discretionary{\char\hyphenchar\font}%
32.511  {}{R}\bbl@allowhyphens}
32.512 \declare@shorthand{spanish}{"y}
32.513 {\@ifundefined{scalebox}%
32.514  {\ensuremath{\tau}}%
32.515  {\raisebox{1ex}{\scalebox{-1}{\resizebox{.45em}{1ex}{2}}}}}
32.516 \declare@shorthand{spanish}{""}{\hskip\z@skip}
32.517 \declare@shorthand{spanish}{"/}
32.518 {\setbox\z@\hbox{/}%
32.519 \dimen@\ht\z@

32.520 \advance\dimen@-1ex
32.521 \advance\dimen@\dp\z@
32.522 \dimen@.31\dimen@
32.523 \advance\dimen@-\dp\z@
32.524 \ifdim\dimen@>0pt
32.525  \kern.01em\lower\dimen@\box\z@\kern.03em

32.526 \else

32.527  \box\z@

32.528 \fi}

32.529

32.530 \es@set@shorthand{~}
32.531 \declare@shorthand{spanish}{~n}{\~n}
32.532 \declare@shorthand{spanish}{~N}{\~N}
32.533 \declare@shorthand{spanish}{~-}{%
32.534 \leavevmode
32.535 \bgroup
32.536 \let\@sptoken\es@dashes  % This assignation changes the
32.537 \@ifnextchar-%             \@ifnextchar behaviour
32.538  {\es@dashes}%
32.539  {\hbox{\char\hyphenchar\font}\egroup}}
32.540 \def\es@dashes-{%
32.541 \@ifnextchar-%
32.542  {\bbl@allowhyphens\hbox{---}\bbl@allowhyphens\egroup\@gobble}%
32.543  {\bbl@allowhyphens\hbox{--}\bbl@allowhyphens\egroup}}

32.544

32.545 \def\deactivatetilden{%
32.546 \expandafter\let\csname spanish@sh@\string~@n@\endcsname\relax
32.547 \expandafter\let\csname spanish@sh@\string~@N@\endcsname\relax}

The shorthands for quoting.

32.548 \es@set@shorthand{<}
32.549 \es@set@shorthand{>}

32.550

32.551 \declare@shorthand{system}{<}{\csname normal@char\string<\endcsname}
32.552 \declare@shorthand{system}{>}{\csname normal@char\string>\endcsname}

32.553

32.554 \addto\shorthandsspanish{%
32.555 \es@activate{<}%
32.556 \es@activate{>}}
32.557 \ifes@LaTeXe   %<<<<<<
32.558 \AtBeginDocument{%
32.559  \es@quoting
32.560  \if@filesw
32.561  \immediate\write\@mainaux{\string\es@quoting}%

32.562 \fi}%

32.563 \fi            %<<<<<<

32.564

32.565 \def\activatequoting{%
32.566 \catcode`>=\active \catcode`<=\active
32.567 \let\es@quoting\activatequoting}
32.568 \def\deactivatequoting{%
32.569 \catcode`>=12 \catcode`<=12
32.570 \let\es@quoting\deactivatequoting}

32.571

32.572 \let\es@quoting\relax

32.573

32.574 \declare@shorthand{spanish}{<<}{\begin{quoting}}
32.575 \declare@shorthand{spanish}{>>}{\end{quoting}}

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 L^{A}TEX 2ε formats is always executed.

32.576 \def\es@activeacute{%
32.577 \es@set@shorthand{'}%
32.578 \addto\shorthandsspanish{\es@activate{'}}%
32.579 \addto\es@reviveshorthands{\es@restore{'}}%
32.580 \addto\es@select{\catcode`'=\active}%
32.581 \declare@shorthand{spanish}{'a}{\@tabacckludge'a}%
32.582 \declare@shorthand{spanish}{'A}{\@tabacckludge'A}%
32.583 \declare@shorthand{spanish}{'e}{\@tabacckludge'e}%
32.584 \declare@shorthand{spanish}{'E}{\@tabacckludge'E}%
32.585 \declare@shorthand{spanish}{'i}{\@tabacckludge'i}%
32.586 \declare@shorthand{spanish}{'I}{\@tabacckludge'I}%
32.587 \declare@shorthand{spanish}{'o}{\@tabacckludge'o}%
32.588 \declare@shorthand{spanish}{'O}{\@tabacckludge'O}%
32.589 \declare@shorthand{spanish}{'u}{\@tabacckludge'u}%
32.590 \declare@shorthand{spanish}{'U}{\@tabacckludge'U}%
32.591 \declare@shorthand{spanish}{'n}{\~n}%
32.592 \declare@shorthand{spanish}{'N}{\~N}%
32.593 \declare@shorthand{spanish}{''}{\textquotedblright}%
32.594 \let\es@activeacute\relax}

32.595

32.596 \ifes@LaTeXe   %<<<<<<
32.597 \@ifpackagewith{babel}{activeacute}{\es@activeacute}{}
32.598 \else          %<<<<<<
32.599 \es@activeacute
32.600 \fi            %<<<<<<%

And the customization. By default these macros only store the values and do nothing.

32.601 \def\es@enumerate#1#2#3#4{%
32.602 \def\es@enum{{#1}{#2}{#3}{#4}}}

32.603

32.604 \def\es@itemize#1#2#3#4{%
32.605 \def\es@item{{#1}{#2}{#3}{#4}}}

The part formerly in the .lld file comes here. It performs layout adaptation of L^{A}TEX to “orthodox” Spanish rules.

32.606 \ifes@LaTeXe   %<<<<<<

32.607

32.608 \es@enumerate{1.}{a)}{1)}{a$'$}
32.609 \def\spanishdashitems{\es@itemize{---}{---}{---}{---}}
32.610 \def\spanishsymbitems{%
32.611 \es@itemize
32.612  {\leavevmode\hbox to 1.2ex
32.613  {\hss\vrule height .9ex width .7ex depth -.2ex\hss}}%
32.614  {\textbullet}%
32.615  {$\m@th\circ$}%
32.616  {$\m@th\diamond$}}

32.617 \spanishsymbitems

32.618

32.619 \def\es@enumdef#1#2#3\@@{%
32.620 \if#21%
32.621  \@namedef{theenum#1}{\arabic{enum#1}}%
32.622 \else\if#2a%
32.623  \@namedef{theenum#1}{\emph{\alph{enum#1}}}%
32.624 \else\if#2A%
32.625  \@namedef{theenum#1}{\Alph{enum#1}}%
32.626 \else\if#2i%
32.627  \@namedef{theenum#1}{\roman{enum#1}}%
32.628 \else\if#2I%
32.629  \@namedef{theenum#1}{\Roman{enum#1}}%
32.630 \else\if#2o%
32.631  \@namedef{theenum#1}{\arabic{enum#1}\protect\es@sptext{o}}%
32.632 \fi\fi\fi\fi\fi\fi
32.633 \toks@\expandafter{\csname theenum#1\endcsname}
32.634 \expandafter\edef\csname labelenum#1\endcsname
32.635  {\noexpand\es@listquot\the\toks@#3\enspace}}

32.636

32.637 \def\es@enumerate#1#2#3#4{%
32.638 \es@enumdef{i}#1\@empty\@empty\@@
32.639 \es@enumdef{ii}#2\@empty\@empty\@@
32.640 \es@enumdef{iii}#3\@empty\@empty\@@
32.641 \es@enumdef{iv}#4\@empty\@empty\@@}

32.642

32.643 \def\es@itemize#1#2#3#4{%
32.644 \def\labelitemi{\es@listquot#1}%
32.645 \def\labelitemii{\es@listquot#2}%
32.646 \def\labelitemiii{\es@listquot#3}%
32.647 \def\labelitemiv{\es@listquot#4}}

32.648

32.649 \addto\layoutspanish{%
32.650 \def\p@enumii{\theenumi}%
32.651 \def\p@enumiii{\theenumi\theenumii}%
32.652 \def\p@enumiv{\p@enumiii\theenumiii}%
32.653 \expandafter\es@enumerate\es@enum
32.654 \expandafter\es@itemize\es@item
32.655 \DeclareTextCommand{\guillemotleft}{OT1}{%
32.656  \ifmmode\ll

32.657 \else

32.658  \save@sf@q{\penalty\@M
32.659  \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
32.660  \char40 \kern-0.19em\char40 }}%

32.661 \fi}%

32.662 \DeclareTextCommand{\guillemotright}{OT1}{%
32.663  \ifmmode\gg

32.664 \else

32.665  \save@sf@q{\penalty\@M
32.666  \leavevmode\hbox{\usefont{U}{lasy}{m}{n}%
32.667  \char41 \kern-0.19em\char41 }}%

32.668 \fi}%

32.669 \def\@fnsymbol##1%
32.670  {\ifcase##1\or*\or**\or***\or****\or

32.671  *****\or******\else\@ctrerr\fi}%
32.672 \def\@alph##1%
32.673  {\ifcase##1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
32.674  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
32.675  w\or x\or y\or z\else\@ctrerr\fi}%
32.676 \def\@Alph##1%
32.677  {\ifcase##1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
32.678  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
32.679  W\or X\or Y\or Z\else\@ctrerr\fi}%
32.680 \let\@afterindentfalse\@afterindenttrue
32.681 \@afterindenttrue
32.682 \def\@seccntformat##1{\csname the##1\endcsname.\quad}%
32.683 \def\numberline##1{\hb@xt@\@tempdima{##1.\hfil}}%
32.684 \def\@roman##1{\protect\es@roman{\number##1}}%
32.685 \def\es@roman##1{\protect\es@lsc{\romannumeral##1}}%
32.686 \def\esromanindex##1##2{##1{\protect\es@lsc{##2}}}}

We need to execute the following code when babel has been run, in order to see if spanish is the main language.

32.687 \AtEndOfPackage{%
32.688 \let\es@activeacute\@undefined
32.689 \def\bbl@tempa{spanish}%
32.690 \ifx\bbl@main@language\bbl@tempa
32.691  \AtBeginDocument{\layoutspanish}%
32.692  \addto\es@select{%
32.693  \@ifstar{\let\layoutspanish\relax}%
32.694  {\layoutspanish\let\layoutspanish\relax}}%

32.695 \fi

32.696 \selectspanish}

32.697

32.698 \fi            %<<<<<<

After restoring the catcode of ~ and setting the minimal values for hyphenation, the .ldf is finished.

32.699 \es@savedcatcodes

32.700

32.701 \providehyphenmins{\CurrentOption}{\tw@\tw@}

32.702

32.703 \ifes@LaTeXe   %<<<<<<
32.704 \ldf@finish{spanish}
32.705 \else          %<<<<<<
32.706 \es@select
32.707 \ldf@finish{spanish}
32.708 \csname activatequoting\endcsname
32.709 \fi            %<<<<<<

32.710

32.711 \endinput

32.712 ⟨/code⟩

That’s all in the main file. Now the file with custom-bib macros.

32.713 ⟨∗bblbst⟩

32.714 \def\bbland{y}
32.715 \def\bbleditors{directores}     \def\bbleds{dirs.\@}
32.716 \def\bbleditor{director}        \def\bbled{dir.\@}
32.717 \def\bbledby{dirigido por}
32.718 \def\bbledition{edici\'on}      \def\bbledn{ed.\@}

32.719 \def\bbletal{y otros}
32.720 \def\bblvolume{vol\'umen}       \def\bblvol{vol.\@}
32.721 \def\bblof{de}
32.722 \def\bblnumber{n\'umero}        \def\bblno{n\sptext{o}}
32.723 \def\bblin{en}
32.724 \def\bblpages{p\'aginas}        \def\bblpp{p\'ags.\@}
32.725 \def\bblpage{p\'gina}           \def\bblp{p\'ag.\@}
32.726 \def\bblchapter{cap\'itulo}     \def\bblchap{cap.\@}
32.727 \def\bbltechreport{informe t\'ecnico}
32.728 \def\bbltechrep{inf.\@ t\'ec.\@}
32.729 \def\bblmthesis{proyecto de fin de carrera}
32.730 \def\bblphdthesis{tesis doctoral}
32.731 \def\bblfirst {primera}         \def\bblfirsto {1\sptext{a}}
32.732 \def\bblsecond{segunda}         \def\bblsecondo{2\sptext{a}}
32.733 \def\bblthird {tercera}         \def\bblthirdo {3\sptext{a}}
32.734 \def\bblfourth{cuarta}          \def\bblfourtho{4\sptext{a}}
32.735 \def\bblfifth {quinta}          \def\bblfiftho {5\sptext{a}}
32.736 \def\bblth{\sptext{a}}
32.737 \let\bblst\bblth   \let\bblnd\bblth   \let\bblrd\bblth
32.738 \def\bbljan{enero}  \def\bblfeb{febrero}  \def\bblmar{marzo}
32.739 \def\bblapr{abril}  \def\bblmay{mayo}     \def\bbljun{junio}
32.740 \def\bbljul{julio}  \def\bblaug{agosto}   \def\bblsep{septiembre}
32.741 \def\bbloct{octubre}\def\bblnov{noviembre}\def\bbldec{diciembre}

32.742 ⟨/bblbst⟩

The spanish option writes a macro in the page field of MakeIndex in entries with small caps number, and they are rejected. This program is a preprocessor which moves this macro to the entry field.

32.743 ⟨∗indexes⟩

32.744 \makeatletter

32.745

32.746 \newcount\es@converted
32.747 \newcount\es@processed

32.748

32.749 \def\es@encap{`\|}
32.750 \def\es@openrange{`\(}
32.751 \def\es@closerange{`\)}

32.752

32.753 \def\es@split@file#1.#2\@@{#1}
32.754 \def\es@split@ext#1.#2\@@{#2}

32.755

32.756 \typein[\answer]{^^JArchivo que convertir^^J%
32.757 (extension por omision .idx):}

32.758

32.759 \@expandtwoargs\in@{.}{\answer}
32.760 \ifin@
32.761 \edef\es@input@file{\expandafter\es@split@file\answer\@@}
32.762 \edef\es@input@ext{\expandafter\es@split@ext\answer\@@}

32.763 \else

32.764 \edef\es@input@file{\answer}
32.765 \def\es@input@ext{idx}

32.766 \fi

32.767

32.768 \typein[\answer]{^^JArchivo de destino^^J%

32.769 (archivo por omision: \es@input@file.eix,^^J%
32.770  extension por omision .eix):}
32.771 \ifx\answer\@empty
32.772 \edef\es@output{\es@input@file.eix}

32.773 \else

32.774 \@expandtwoargs\in@{.}{\answer}
32.775 \ifin@
32.776  \edef\es@output{\answer}

32.777 \else

32.778  \edef\es@output{\answer.eix}

32.779 \fi 32.780 \fi

32.781

32.782 \typein[\answer]{%
32.783 ^^J?Se ha usado algun esquema especial de controles^^J%
32.784 de MakeIndex para encap, open_range o close_range?^^J%
32.785 [s/n] (n por omision)}

32.786

32.787 \if s\answer
32.788 \typein[\answer]{^^JCaracter para 'encap'^^J%
32.789  (\string| por omision)}
32.790 \ifx\answer\@empty\else
32.791  \edef\es@encap{%
32.792  `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}

32.793 \fi

32.794 \typein[\answer]{^^JCaracter para 'open_range'^^J%
32.795  (\string( por omision)}
32.796 \ifx\answer\@empty\else
32.797  \edef\es@openrange{%
32.798  `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}

32.799 \fi

32.800 \typein[\answer]{^^JCaracter para 'close_range'^^J%
32.801  (\string) por omision)}
32.802 \ifx\answer\@empty\else
32.803  \edef\es@closerange{%
32.804  `\expandafter\noexpand\csname\expandafter\string\answer\endcsname}

32.805 \fi 32.806 \fi

32.807

32.808 \newwrite\es@indexfile
32.809 \immediate\openout\es@indexfile=\es@output

32.810

32.811 \newif\ifes@encapsulated

32.812

32.813 \def\es@roman#1{\romannumeral#1 }
32.814 \edef\es@slash{\expandafter\@gobble\string\\}

32.815

32.816 \def\indexentry{%
32.817 \begingroup
32.818 \@sanitize
32.819 \es@indexentry}

32.820

32.821 \begingroup

32.822

32.823 \catcode`\|=12 \lccode`\|=\es@encap\relax
32.824 \catcode`\(=12 \lccode`\(=\es@openrange\relax
32.825 \catcode`\)=12 \lccode`\)=\es@closerange\relax

32.826

32.827 \lowercase{
32.828 \gdef\es@indexentry#1{%
32.829 \endgroup
32.830 \advance\es@processed\@ne
32.831 \es@encapsulatedfalse
32.832 \es@bar@idx#1|\@@
32.833 \es@idxentry}%

32.834 }

32.835

32.836 \lowercase{
32.837 \gdef\es@idxentry#1{%
32.838 \in@{\es@roman}{#1}%
32.839 \ifin@
32.840  \advance\es@converted\@ne
32.841  \immediate\write\es@indexfile{%
32.842  \string\indexentry{\es@b|\ifes@encapsulated\es@p\fi esromanindex%
32.843  {\ifx\es@a\@empty\else\es@slash\es@a\fi}}{#1}}%

32.844 \else

32.845  \immediate\write\es@indexfile{%
32.846  \string\indexentry{\es@b\ifes@encapsulated|\es@p\es@a\fi}{#1}}%

32.847 \fi} 32.848 }

32.849

32.850 \lowercase{
32.851 \gdef\es@bar@idx#1|#2\@@{%
32.852 \def\es@b{#1}\def\es@a{#2}%
32.853 \ifx\es@a\@empty\else\es@encapsulatedtrue\es@bar@eat#2\fi}

32.854 }

32.855

32.856 \lowercase{
32.857 \gdef\es@bar@eat#1#2|{\def\es@p{#1}\def\es@a{#2}%
32.858 \edef\es@t{(}\ifx\es@t\es@p
32.859 \else\edef\es@t{)}\ifx\es@t\es@p

32.860 \else

32.861  \edef\es@a{\es@p\es@a}\let\es@p\@empty%
32.862 \fi\fi}

32.863 }

32.864

32.865 \endgroup

32.866

32.867 \input \es@input@file.\es@input@ext

32.868

32.869 \immediate\closeout\es@indexfile

32.870

32.871 \typeout{*****************}
32.872 \typeout{Se ha procesado: \es@input@file.\es@input@ext }
32.873 \typeout{Lineas leidas: \the\es@processed}
32.874 \typeout{Lineas convertidas: \the\es@converted}
32.875 \typeout{Resultado en: \es@output}
32.876 \ifnum\es@converted>\z@

32.877 \typeout{Genere el indice a partir de ese archivo}

32.878 \else

32.879 \typeout{No se ha realizado ningun tipo de conversion}
32.880 \typeout{Se puede generar el archivo directamente^^J%
32.881  de \es@input@file.\es@input@ext}

32.882 \fi

32.883 \typeout{*****************}
32.884 \@@end

32.885 ⟨/indexes⟩

33 The Catalan language

The file catalan.dtx^{31} 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 10 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 activeacute and activegrave options. In that case, the definitions shown in table 11 also become available^{32}.

\l.l geminated-l digraph (similar to l·l). \L.L produces

the uppercase version. \lgem geminated-l digraph (similar to l·l). \Lgem produces

the uppercase version. \up Macro to help typing raised ordinals, like 1er. 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 (ç). Valid for both uppercase and lowercase

c. "l geminated-l digraph (similar to l·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.

"|  disable ligature at this position.

Table 10: Extra definitions made by file catalan.ldf (activated by default)

'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).

Table 11: Extra definitions made by file catalan.ldf (activated only when using the options activeacute and activegrave)

These active accents characters behave according to their original definitions if not followed by one of the characters indicated in that table.

31The file described in this section has version number v2.2n and was last revised on 2001/02/19.

32Please 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 l'{}estri instead of l'estri.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

33.1 ⟨∗code⟩

 33.2 \LdfInit{catalan}\captionscatalan

When this file is read as an option, i.e. by the \usepackage command, 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.

 33.3 \ifx\l@catalan\@undefined
 33.4 \@nopatterns{Catalan}
 33.5 \adddialect\l@catalan0

33.6 \fi

The next step consists of defining commands to switch to (and from) the Catalan language.

\catalanhyphenmins This macro is used to store the correct values of the hyphenation parameters

  \lefthyphenmin and \righthyphenmin.
 33.7 \providehyphenmins{catalan}{\tw@\tw@}

\captionscatalan The macro \captionscatalan defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 33.8 \addto\captionscatalan{%
 33.9 \def\prefacename{Pr\`oleg}%
33.10 \def\refname{Refer\`encies}%
33.11 \def\abstractname{Resum}%
33.12 \def\bibname{Bibliografia}%
33.13 \def\chaptername{Cap\'{\i}tol}%
33.14 \def\appendixname{Ap\`endix}%
33.15 \def\contentsname{\'Index}%
33.16 \def\listfigurename{\'Index de figures}%
33.17 \def\listtablename{\'Index de taules}%
33.18 \def\indexname{\'Index alfab\`etic}%
33.19 \def\figurename{Figura}%
33.20 \def\tablename{Taula}%
33.21 \def\partname{Part}%
33.22 \def\enclname{Adjunt}%
33.23 \def\ccname{C\`opies a}%
33.24 \def\headtoname{A}%
33.25 \def\pagename{P\`agina}%
33.26 \def\seename{Vegeu}%
33.27 \def\alsoname{Vegeu tamb\'e}%
33.28 \def\proofname{Demostraci\'o}%
33.29 \def\glossaryname{Glossary}% <-- Needs translation

33.30 }

\datecatalan The macro \datecatalan redefines the command \today to produce Catalan

dates. Months are written in lowercase^{33}.

33.31 \def\datecatalan{%

33This seems to be the common practice. See for example: E. Coromina, El 9 Nou: Manual

de redacció i estil, Ed. Eumo, Vic, 1993

33.32 \def\today{\number\day~\ifcase\month\or
33.33  de gener\or de febrer\or de mar\c{c}\or d'abril\or de maig\or
33.34  de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
33.35  de novembre\or de desembre\fi
33.36  \space de~\number\year}}

\extrascatalan \noextrascatalan 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.

To improve hyphenation we give the grave character (') a non-zero lower case code; when we do that TEX will find more breakpoints in words that contain this character in its rôle as apostrophe.

33.37 \addto\extrascatalan{%
33.38 \lccode`'=`'}
33.39 \addto\noextrascatalan{%
33.40 \lccode`'=0}

For Catalan, some characters are made active or are redefined. In particular, the " character receives a new meaning; this can also happen for the ' character and the ` character when the options activegrave and/or activeacute are specified.

33.41 \addto\extrascatalan{\languageshorthands{catalan}}
33.42 \initiate@active@char{"}
33.43 \addto\extrascatalan{\bbl@activate{"}}

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.

33.44 \@ifpackagewith{babel}{activegrave}{%
33.45 \AtBeginDocument{%
33.46  \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
33.47 \initiate@active@char{`}%

33.48 }{}

33.49 \@ifpackagewith{babel}{activegrave}{%
33.50 \addto\extrascatalan{\bbl@activate{`}}%

33.51 }{}

33.52 \@ifpackagewith{babel}{activeacute}{%
33.53 \initiate@active@char{'}%

33.54 }{}

33.55 \@ifpackagewith{babel}{activeacute}{%
33.56 \addto\extrascatalan{\bbl@activate{'}}%

33.57 }{}

Now make sure that the characters that have been turned into shorthanfd characters expand to ‘normal’ characters outside the catalan environment.

33.58 \addto\noextrascatalan{\bbl@deactivate{"}}
33.59 \@ifpackagewith{babel}{activegrave}{%
33.60 \addto\noextrascatalan{\bbl@deactivate{`}}}{}
33.61 \@ifpackagewith{babel}{activeacute}{%
33.62 \addto\noextrascatalan{\bbl@deactivate{'}}}{}

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 activegrave or activeacute were specified.

33.63 \addto\extrascatalan{%
33.64 \babel@save\"%
33.65 \def\"{\protect\@umlaut}}%
33.66 \@ifpackagewith{babel}{activegrave}{%
33.67 \babel@save\`%
33.68 \addto\extrascatalan{\def\`{\protect\@grave}}

33.69 }{}

33.70 \@ifpackagewith{babel}{activeacute}{%
33.71 \babel@save\'%
33.72 \addto\extrascatalan{\def\'{\protect\@acute}}

33.73 }{}

All the code above is necessary because we need a few extra active characters. These characters are then used as indicated in tables 10 and 11.

\dieresis \textacute \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 PostScript fonts with the Adobe font encoding the " 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 \'.

33.74 \let\dieresis\"
33.75 \@ifpackagewith{babel}{activegrave}{\let\textgrave\`}{}
33.76 \@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}

\@umlaut \@acute \@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.

33.77 \ifx\DeclareFontShape\@undefined
33.78 \wlog{Warning: You are using an old LaTeX}
33.79 \wlog{Some word breaks will not be found.}
33.80 \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
33.81 \@ifpackagewith{babel}{activeacute}{%
33.82  \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
33.83 \@ifpackagewith{babel}{activegrave}{%
33.84  \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
33.85 \else
33.86 \ifx\f@encoding\bbl@t@one
33.87  \let\@umlaut\dieresis
33.88  \@ifpackagewith{babel}{activeacute}{%

 33.89  \let\@acute\textacute}{}
 33.90  \@ifpackagewith{babel}{activegrave}{%
 33.91  \let\@grave\textgrave}{}
 33.92 \else
 33.93  \wlog{Warning: You are using encoding \f@encoding\space
 33.94  instead of T1.}
 33.95  \wlog{Some word breaks will not be found.}
 33.96  \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
 33.97  \@ifpackagewith{babel}{activeacute}{%
 33.98  \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
 33.99  \@ifpackagewith{babel}{activegrave}{%
33.100  \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}

33.101 \fi 33.102 \fi

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.^{34}

Now we can define our shorthands: the diaeresis and “ela geminada” support,

33.103 \declare@shorthand{catalan}{"i}{\textormath{\@umlaut\i}{\ddot\imath}}
33.104 \declare@shorthand{catalan}{"l}{\lgem{}}
33.105 \declare@shorthand{catalan}{"u}{\textormath{\@umlaut u}{\ddot u}}
33.106 \declare@shorthand{catalan}{"I}{\textormath{\@umlaut I}{\ddot I}}
33.107 \declare@shorthand{catalan}{"L}{\Lgem{}}
33.108 \declare@shorthand{catalan}{"U}{\textormath{\@umlaut U}{\ddot U}}

cedille,

33.109 \declare@shorthand{catalan}{"c}{\textormath{\c c}{^{\prime} c}}
33.110 \declare@shorthand{catalan}{"C}{\textormath{\c C}{^{\prime} C}}

‘french’ quote characters,

33.111 \declare@shorthand{catalan}{"<}{%
33.112 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
33.113 \declare@shorthand{catalan}{">}{%
33.114 \textormath{\guillemotright}{\mbox{\guillemotright}}}

grave accents,

33.115 \@ifpackagewith{babel}{activegrave}{%
33.116 \declare@shorthand{catalan}{`a}{\textormath{\@grave a}{\grave a}}
33.117 \declare@shorthand{catalan}{`e}{\textormath{\@grave e}{\grave e}}
33.118 \declare@shorthand{catalan}{`o}{\textormath{\@grave o}{\grave o}}

34A 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 french.sty would adopt this scheme

too. In that case, '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.

33.119 \declare@shorthand{catalan}{`A}{\textormath{\@grave A}{\grave A}}
33.120 \declare@shorthand{catalan}{`E}{\textormath{\@grave E}{\grave E}}
33.121 \declare@shorthand{catalan}{`O}{\textormath{\@grave O}{\grave O}}
33.122 \declare@shorthand{catalan}{``}{\textquotedblleft}%''

33.123 }{}

acute accents,

33.124 \@ifpackagewith{babel}{activeacute}{%
33.125 \declare@shorthand{catalan}{'a}{\textormath{\@acute a}{^{\prime} a}}
33.126 \declare@shorthand{catalan}{'e}{\textormath{\@acute e}{^{\prime} e}}
33.127 \declare@shorthand{catalan}{'i}{\textormath{\@acute\i{}}{^{\prime} i}}
33.128 \declare@shorthand{catalan}{'o}{\textormath{\@acute o}{^{\prime} o}}
33.129 \declare@shorthand{catalan}{'u}{\textormath{\@acute u}{^{\prime} u}}
33.130 \declare@shorthand{catalan}{'A}{\textormath{\@acute A}{^{\prime} A}}
33.131 \declare@shorthand{catalan}{'E}{\textormath{\@acute E}{^{\prime} E}}
33.132 \declare@shorthand{catalan}{'I}{\textormath{\@acute I}{^{\prime} I}}
33.133 \declare@shorthand{catalan}{'O}{\textormath{\@acute O}{^{\prime} O}}
33.134 \declare@shorthand{catalan}{'U}{\textormath{\@acute U}{^{\prime} U}}
33.135 \declare@shorthand{catalan}{'|}{%
33.136  \textormath{\csname normal@char\string'\endcsname}{^{\prime}}}

the acute accent,

33.137 \declare@shorthand{catalan}{''}{%
33.138  \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}

33.139 }{}

and finally, some support definitions

33.140 \declare@shorthand{catalan}{"-}{\nobreak-\bbl@allowhyphens}
33.141 \declare@shorthand{catalan}{"|}{%
33.142 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
33.143  \allowhyphens}{}}

\- 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.

33.144 \addto\extrascatalan{%
33.145 \babel@save{\-}%
33.146 \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}

\lgem \Lgem 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^{35}.

The code used in the actual macro used is a combination of the one proposed by Feruglio and Fuster^{36} and the proposal^{37} 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.

35The macro names \ll and \LL were not taken because of the fact that \ll is already used

in mathematical mode.

36G. Valiente and R. Fuster, Typesetting Catalan Texts with TEX, TUGboat 14(3), 1993.

37G. Valiente, Modern Catalan Typographical Conventions, TUGboat 16(3), 1995.

33.147 \newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
33.148 \def\lgem{%
33.149 \ifmmode
33.150  \csname normal@char\string"\endcsname l%

33.151 \else

33.152  \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
33.153  \setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
33.154  \advance\raiselldim by \the\fontdimen5\the\font
33.155  \advance\raiselldim by -\ht2%
33.156  \leftllkern=-.25\wd0%
33.157  \advance\leftllkern by \wd1%
33.158  \advance\leftllkern by -\wd0%
33.159  \rightllkern=-.25\wd0%
33.160  \advance\rightllkern by -\wd1%
33.161  \advance\rightllkern by \wd0%
33.162  \allowhyphens\discretionary{l-}{l}%
33.163  {\hbox{l}\kern\leftllkern\raise\raiselldim\hbox{.}%
33.164  \kern\rightllkern\hbox{l}}\allowhyphens

33.165 \fi 33.166 }

33.167 \def\Lgem{%
33.168 \ifmmode
33.169  \csname normal@char\string"\endcsname L%

33.170 \else

33.171  \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
33.172  \setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
33.173  \advance\raiselldim by .5\ht0%
33.174  \advance\raiselldim by -.5\ht2%
33.175  \leftllkern=-.125\wd0%
33.176  \advance\leftllkern by \wd1%
33.177  \advance\leftllkern by -\wd0%
33.178  \rightllkern=-\wd0%
33.179  \divide\rightllkern by 6%
33.180  \advance\rightllkern by -\wd1%
33.181  \advance\rightllkern by \wd0%
33.182  \allowhyphens\discretionary{L-}{L}%
33.183  {\hbox{L}\kern\leftllkern\raise\raiselldim\hbox{.}%
33.184  \kern\rightllkern\hbox{L}}\allowhyphens

33.185 \fi 33.186 }

{\l.l \atop \L.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’.

33.187 \let\lslash\l
33.188 \let\Lslash\L
33.189 \DeclareRobustCommand\l{\@ifnextchar.\bbl@l\lslash}
33.190 \DeclareRobustCommand\L{\@ifnextchar.\bbl@L\Lslash}
33.191 \def\bbl@l#1#2{\lgem}

33.192 \def\bbl@L#1#2{\Lgem}

\up A macro for typesetting things like 1er as proposed by Raymon Seroul^{38}.

33.193 \DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}

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.

33.194 \ldf@finish{catalan}

33.195 ⟨/code⟩

38This macro has been borrowed from francais.dtx

34 The Galician language

The file galician.dtx^{39} defines all the language definition macros for the Galician language.

For this language the characters ' ~ and " are made active. In table 12 an overview is given of their purpose. These active accents character behave according

"| 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. 'a an accent that allows hyphenation. Valid for all vow-

els uppercase and lowercase. 'n a n with a tilde. This is included to improve compatibility with FTC. Works for uppercase too.

"u a u with dieresis allowing hyphenation.
"a feminine ordinal as in 1^{\underline{a}}.
"o masculine ordinal as in 1^{\underline{o}}.
~n a n with tilde. Works for uppercase too.

Table 12: The extra definitions made by galician.ldf

to their original definitions if not followed by one of the characters indicated in that table.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

34.1 ⟨∗code⟩

34.2 \LdfInit{galician}\captionsgalician

When this file is read as an option, i.e. by the \usepackage command, galician could 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.

34.3 \ifx\l@galician\@undefined
34.4 \@nopatterns{Galician}
34.5 \adddialect\l@galician0\fi

The next step consists of defining commands to switch to (and from) the Galician language.

\captionsgalician The macro \captionsgalician defines all strings used in the four standard documentclasses provided with L^{A}TEX.

34.6 \addto\captionsgalician{%
34.7 \def\prefacename{Prefacio}%
34.8 \def\refname{Referencias}%
34.9 \def\abstractname{Resumo}%
34.10 \def\bibname{Bibliograf\'{\i}a}%
34.11 \def\chaptername{Cap\'{\i}tulo}%
34.12 \def\appendixname{Ap\'endice}%

39The file described in this section has version number v1.2k and was last revised on 2001/02/20.

34.13 \def\contentsname{\'Indice Xeral}%
34.14 \def\listfigurename{\'Indice de Figuras}%
34.15 \def\listtablename{\'Indice de T\'aboas}%
34.16 \def\indexname{\'Indice de Materias}%
34.17 \def\figurename{Figura}%
34.18 \def\tablename{T\'aboa}%
34.19 \def\partname{Parte}%
34.20 \def\enclname{Adxunto}%
34.21 \def\ccname{Copia a}%
34.22 \def\headtoname{A}%
34.23 \def\pagename{P\'axina}%
34.24 \def\seename{v\'exase}%
34.25 \def\alsoname{v\'exase tam\'en}%
34.26 \def\proofname{Demostraci\'on}%
34.27 \def\glossaryname{Glossary}% <-- Needs translation

34.28 }

\dategalician The macro \dategalician redefines the command \today to produce Galician

dates.

34.29 \def\dategalician{%
34.30 \def\today{\number\day~de\space\ifcase\month\or
34.31  xaneiro\or febreiro\or marzo\or abril\or maio\or xu\~no\or
34.32  xullo\or agosto\or setembro\or outubro\or novembro\or decembro\fi
34.33  \space de~\number\year}}

\extrasgalician \noextrasgalician The macro \extrasgalician will perform all the extra definitions needed for the Galician language. The macro \noextrasgalician is used to cancel the actions

  of \extrasgalician.

For Galician, some characters are made active or are redefined. In particular, the " character and the ~ character receive new meanings this can also happen for the ' character when the option activeacute is specified.

34.34 \addto\extrasgalician{\languageshorthands{galician}}
34.35 \initiate@active@char{"}
34.36 \initiate@active@char{~}
34.37 \addto\extrasgalician{%
34.38 \bbl@activate{"}\bbl@activate{~}}
34.39 \@ifpackagewith{babel}{activeacute}{%
34.40 \initiate@active@char{'}}{}
34.41 \@ifpackagewith{babel}{activeacute}{%
34.42 \addto\extrasgalician{\bbl@activate{'}}}{}

Now make sure that the characters that have been turned into shorthanfd characters expand to ‘normal’ characters outside the catalan environment.

34.43 \addto\noextrasgalician{%
34.44 \bbl@deactivate{"}\bbl@deactivate{~}}
34.45 \@ifpackagewith{babel}{activeacute}{%
34.46 \addto\noextrascatalan{\bbl@deactivate{'}}}{}

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.

34.47 \addto\extrasgalician{%
34.48 \babel@save\"\babel@save\~%
34.49 \def\"{\protect\@umlaut}%

34.50 \def\~{\protect\@tilde}}
34.51 \@ifpackagewith{babel}{activeacute}{%
34.52 \babel@save\'%
34.53 \addto\extrasgalician{\def\'{\protect\@acute}}

34.54 }{}

All the code above is necessary because we need a few extra active characters. These characters are then used as indicated in table 12.

This option includes some support for working with extended, 8-bit fonts, if available. This assumes that the user has some macros predefined. For instance, if the user has a \@ac@a macro defined, the sequence \'a or 'a will both expand to whatever \@ac@a is defined to expand, presumably á. The names of these macros are the same as those in Ferguson’s ML-TEX compatibility package on purpose. Using this method, and provided that adequate hyphenation patterns exist, it is possible to get better hyphenation for Galician than before. If the user has a terminal able to produce these codes directly, it is possible to do so. If the need arises to send the document to someone who does not have such support, it is possible to mechanically translate the document so that the receiver can make use of it.

To be able to define the function of the new accents, we first define a couple of ‘support’ macros.

\dieresis \textacute \texttilde The original definition of \" is stored as \dieresis, because the definition of \" might not be the default plain TEX one. If the user uses PostScript fonts with the Adobe font encoding the " 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 \~.

34.55 \let\dieresis\"
34.56 \let\texttilde\~
34.57 \@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}

\@umlaut \@acute \@tilde 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.^{40}

34.58 \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
34.59 \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}

40A 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 french.sty would adopt this scheme too. In that case, '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.

34.60 \@ifpackagewith{babel}{activeacute}{%
34.61 \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}

Now we can define our shorthands: the umlauts,

34.62 \declare@shorthand{galician}{"-}{\nobreak-\bbl@allowhyphens}
34.63 \declare@shorthand{galician}{"|}{\discretionary{-}{}{\kern.03em}}
34.64 \declare@shorthand{galician}{"u}{\@umlaut{u}}
34.65 \declare@shorthand{galician}{"U}{\@umlaut{U}}

ordinals^{41},

34.66 \declare@shorthand{galician}{"o}{%
34.67 \leavevmode\raise1ex\hbox{\underbar{\scriptsize o}}}
34.68 \declare@shorthand{galician}{"a}{%
34.69 \leavevmode\raise1ex\hbox{\underbar{\scriptsize a}}}

acute accents,

34.70 \@ifpackagewith{babel}{activeacute}{%
34.71 \declare@shorthand{galician}{'a}{\textormath{\@acute a}{^{\prime} a}}
34.72 \declare@shorthand{galician}{'e}{\textormath{\@acute e}{^{\prime} e}}
34.73 \declare@shorthand{galician}{'i}{\textormath{\@acute\i{}}{^{\prime}i}}
34.74 \declare@shorthand{galician}{'o}{\textormath{\@acute o}{^{\prime} o}}
34.75 \declare@shorthand{galician}{'u}{\textormath{\@acute u}{^{\prime} u}}
34.76 \declare@shorthand{galician}{'A}{\textormath{\@acute A}{^{\prime} A}}
34.77 \declare@shorthand{galician}{'E}{\textormath{\@acute E}{^{\prime} E}}
34.78 \declare@shorthand{galician}{'I}{\textormath{\@acute I}{^{\prime} I}}
34.79 \declare@shorthand{galician}{'O}{\textormath{\@acute O}{^{\prime} O}}
34.80 \declare@shorthand{galician}{'U}{\textormath{\@acute U}{^{\prime} U}}

tildes,

34.81 \declare@shorthand{galician}{'n}{\textormath{\~n}{^{\prime} n}}
34.82 \declare@shorthand{galician}{'N}{\textormath{\~N}{^{\prime} N}}

the acute accent,

34.83 \declare@shorthand{galician}{''}{%
34.84  \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}

34.85 }{}

34.86 \declare@shorthand{galician}{~n}{\textormath{\~n}{\@tilde n}}
34.87 \declare@shorthand{galician}{~N}{\textormath{\~N}{\@tilde N}}

\- 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 Galician 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 Galician makes this desirable and so it is kept here.

34.88 \addto\extrasgalician{%
34.89 \babel@save{\-}%
34.90 \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}

41The code for the ordinals was taken from the answer provided by Raymond Chen

(raymond@math.berkeley.edu) to a question by Joseph Gil (yogi@cs.ubc.ca) in comp.text.tex.

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.

34.91 \ldf@finish{galician}

34.92 ⟨/code⟩

35 The Basque language

The file basque.dtx^{42} defines all the language definition macro’s for the Basque language.

For this language the characters ~ and " are made active. In table 13 an overview is given of their purpose. These active accent characters behave according

"| 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.

Table 13: The extra definitions made by basque.ldf

to their original definitions if not followed by one of the characters indicated in that table.

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 L^{A}TEX 2ε or NFSS2. If T1 encoding is chosen, and provided that adequate hyphenation patterns^{43} are available. The easiest way to use the new encoding with L^{A}TEX 2ε is to load the package t1enc with \usepackage. This must be done before loading babel.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

35.1 ⟨∗code⟩

35.2 \LdfInit{basque}\captionsbasque

When this file is read as an option, i.e. by the \usepackage command, 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.

35.3 \ifx\l@basque\@undefined
35.4 \@nopatterns{Basque}
35.5 \adddialect\l@basque0

35.6 \fi

The next step consists of defining commands to switch to (and from) the Basque language.

\captionsbasque The macro \captionsbasque defines all strings used in the four standard documentclasses provided with L^{A}TEX.

35.7 \addto\captionsbasque{%
35.8 \def\prefacename{Hitzaurrea}%
35.9 \def\refname{Erreferentziak}%

42The file described in this section has version number v1.0e and was last revised on 2001/01/30. The original author is Juan M. Aguirregabiria, (wtpagagj@lg.ehu.es) and is based on the Spanish file by Julio Sánchez, (jsanchez@gmv.es).

43One source for such patterns is the archive at lcpx07.lc.ehu.es that can be accessed by anonymous FTP or in http://lcpx07.lc.ehu.es/Basque.html

35.10 \def\abstractname{Laburpena}%
35.11 \def\bibname{Bibliografia}%
35.12 \def\chaptername{Kapitulua}%
35.13 \def\appendixname{Eranskina}%
35.14 \def\contentsname{Gaien Aurkibidea}%
35.15 \def\listfigurename{Irudien Zerrenda}%
35.16 \def\listtablename{Taulen Zerrenda}%
35.17 \def\indexname{Kontzeptuen Aurkibidea}%
35.18 \def\figurename{Irudia}%
35.19 \def\tablename{Taula}%
35.20 \def\partname{Atala}%
35.21 \def\enclname{Erantsia}%
35.22 \def\ccname{Kopia}%
35.23 \def\headtoname{Nori}%
35.24 \def\pagename{Orria}%
35.25 \def\seename{Ikusi}%
35.26 \def\alsoname{Ikusi, halaber}%
35.27 \def\proofname{Frogapena}%
35.28 \def\glossaryname{Glossary}% <-- Needs translation

35.29 }%

\datebasque The macro \datebasque redefines the command \today to produce Basque

35.30 \def\datebasque{%
35.31 \def\today{\number\year.eko\space\ifcase\month\or
35.32  urtarrilaren\or otsailaren\or martxoaren\or apirilaren\or
35.33  maiatzaren\or ekainaren\or uztailaren\or abuztuaren\or
35.34  irailaren\or urriaren\or azaroaren\or
35.35  abenduaren\fi~\number\day}}

\extrasbasque \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 " character and the ~ character receive new meanings. Therefore these characters have to be treated as ‘special’ characters.

35.36 \addto\extrasbasque{\languageshorthands{basque}}
35.37 \initiate@active@char{"}
35.38 \initiate@active@char{~}
35.39 \addto\extrasbasque{%
35.40 \bbl@activate{"}%
35.41 \bbl@activate{~}}

Don’t forget to turn the shorthands off again.

35.42 \addto\noextrasbasque{
35.43 \bbl@deactivate{"}\bbl@deactivate{~}}

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.

35.44 \addto\extrasbasque{%
35.45 \babel@save\"%
35.46 \babel@save\~%
35.47 \def\"{\protect\@umlaut}%
35.48 \def\~{\protect\@tilde}}
\basquehyphenmins Basque hyphenation uses \lefthyphenmin and \righthyphenmin both set to 2.
35.49 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\dieresia \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.
35.50 \let\dieresia\"
35.51 \let\texttilde\~

\@umlaut \@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.

35.52 \ifx\DeclareFontShape\@undefined
35.53 \wlog{Warning: You are using an old LaTeX}
35.54 \wlog{Some word breaks will not be found.}
35.55 \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
35.56 \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
35.57 \else
35.58 \edef\bbl@next{T1}
35.59 \ifx\f@encoding\bbl@next
35.60  \let\@umlaut\dieresia
35.61  \let\@tilde\texttilde
35.62 \else
35.63  \wlog{Warning: You are using encoding \f@encoding\space
35.64  instead of T1.}
35.65  \wlog{Some word breaks will not be found.}
35.66  \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
35.67  \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}

35.68 \fi 35.69 \fi

Now we can define our shorthands: the french quotes,

35.70 \declare@shorthand{basque}{"<}{%
35.71 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
35.72 \declare@shorthand{basque}{">}{%
35.73 \textormath{\guillemotright}{\mbox{\guillemotright}}}

ordinals^{44},

35.74 \declare@shorthand{basque}{''}{%
35.75  \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}

44The code for the ordinals was taken from the answer provided by Raymond Chen (raymond@math.berkeley.edu) to a question by Joseph Gil (yogi@cs.ubc.ca) in comp.text.tex.

tildes,

35.76 \declare@shorthand{basque}{~n}{\textormath{\~n}{\@tilde n}}
35.77 \declare@shorthand{basque}{~N}{\textormath{\~N}{\@tilde N}}

and some additional commands:

35.78 \declare@shorthand{basque}{"-}{\nobreak-\bbl@allowhyphens}
35.79 \declare@shorthand{basque}{"|}{%
35.80 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
35.81  \allowhyphens}{}}

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.

35.82 \ldf@finish{basque}

35.83 ⟨/code⟩

36 The Romanian language

The file romanian.dtx^{45} defines all the language-specific macros for the Romanian language.

For this language currently no special definitions are needed or available. The macro \LdfInit takes care of preventing that this file is loaded more than

once, checking the category code of the @ sign, etc.

36.1 ⟨∗code⟩

 36.2 \LdfInit{romanian}\captionsromanian

When this file is read as an option, i.e. by the \usepackage command, 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.

 36.3 \ifx\l@romanian\@undefined
 36.4  \@nopatterns{Romanian}
 36.5  \adddialect\l@romanian0\fi

The next step consists of defining commands to switch to (and from) the Romanian language.

\captionsromanian The macro \captionsromanian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 36.6 \addto\captionsromanian{%
 36.7 \def\prefacename{Prefa\c{t}\u{a}}%
 36.8 \def\refname{Bibliografie}%
 36.9 \def\abstractname{Rezumat}%
36.10 \def\bibname{Bibliografie}%
36.11 \def\chaptername{Capitolul}%
36.12 \def\appendixname{Anexa}%
36.13 \def\contentsname{Cuprins}%
36.14 \def\listfigurename{List\u{a} de figuri}%
36.15 \def\listtablename{List\u{a} de tabele}%
36.16 \def\indexname{Glosar}%
36.17 \def\figurename{Figura}%    % sau Plan\c{s}a
36.18 \def\tablename{Tabela}%
36.19 \def\partname{Partea}%
36.20 \def\enclname{Anex\u{a}}%   % sau Anexe
36.21 \def\ccname{Copie}%
36.22 \def\headtoname{Pentru}%
36.23 \def\pagename{Pagina}%
36.24 \def\seename{Vezi}%
36.25 \def\alsoname{Vezi de asemenea}%
36.26 \def\proofname{Demonstra\c{t}ie} %
36.27 \def\glossaryname{Glossary}% <-- Needs translation

36.28 }%

\dateromanian The macro \dateromanian redefines the command \today to produce Romanian

dates.

36.29 \def\dateromanian{%
36.30 \def\today{\number\day~\ifcase\month\or

45The file described in this section has version number v1.2k and was last revised on

2001/01/30. A contribution was made by Umstatter Horst (hhu@cernvm.cern.ch).

36.31  ianuarie\or februarie\or martie\or aprilie\or mai\or
36.32  iunie\or iulie\or august\or septembrie\or octombrie\or
36.33  noiembrie\or decembrie\fi
36.34  \space \number\year}}

\extrasromanian \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.

36.35 \addto\extrasromanian{}
36.36 \addto\noextrasromanian{}

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.

36.37 \ldf@finish{romanian}

36.38 ⟨/code⟩

37 The Danish language

The file danish.dtx^{46} defines all the language definition macros for the Danish language.

For this language the character " is made active. In table 14 an overview is given of its purpose.

"| disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word. "" like "-, 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 >>).

Table 14: The extra definitions made by danish.ldf

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

37.1 ⟨∗code⟩

37.2 \LdfInit{danish}\captionsdanish

When this file is read as an option, i.e. by the \usepackage command, 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.

37.3 \ifx\l@danish\@undefined
37.4  \@nopatterns{Danish}
37.5  \adddialect\l@danish0\fi

The next step consists of defining commands to switch to (and from) the Danish language.

\captionsdanish The macro \captionsdanish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

37.6 \addto\captionsdanish{%
37.7 \def\prefacename{Forord}%
37.8 \def\refname{Litteratur}%
37.9 \def\abstractname{Resum\'e}%
37.10 \def\bibname{Litteratur}%
37.11 \def\chaptername{Kapitel}%
37.12 \def\appendixname{Bilag}%
37.13 \def\contentsname{Indhold}%
37.14 \def\listfigurename{Figurer}%
37.15 \def\listtablename{Tabeller}%
37.16 \def\indexname{Indeks}%
37.17 \def\figurename{Figur}%
37.18 \def\tablename{Tabel}%
37.19 \def\partname{Del}%

46The file described in this section has version number v1.3n and was last revised on 2001/01/30. A contribution was made by Henning Larsen (larsen@cernvm.cern.ch)

37.20 \def\enclname{Vedlagt}%
37.21 \def\ccname{Kopi til}%   or    Kopi sendt til
37.22 \def\headtoname{Til}% in letter
37.23 \def\pagename{Side}%
37.24 \def\seename{Se}%
37.25 \def\alsoname{Se ogs{\aa}}%
37.26 \def\proofname{Bevis}%
37.27 \def\glossaryname{Glossary}% <-- Needs translation

37.28 }%

\datedanish The macro \datedanish redefines the command \today to produce Danish dates.

37.29 \def\datedanish{%
37.30 \def\today{\number\day.~\ifcase\month\or
37.31  januar\or februar\or marts\or april\or maj\or juni\or
37.32  juli\or august\or september\or oktober\or november\or december\fi
37.33  \space\number\year}}

\extrasdanish \noextrasdanish 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 \frencspacing to be in effect.

37.34 \addto\extrasdanish{\bbl@frenchspacing}
37.35 \addto\noextrasdanish{\bbl@nonfrenchspacing}

For Danish the " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the danish group of shorthands should be used.

37.36 \initiate@active@char{"}
37.37 \addto\extrasdanish{\languageshorthands{danish}}
37.38 \addto\extrasdanish{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

37.39 \addto\noextrasdanish{\bbl@deactivate{"}}

First we define access to the low opening double quote and guillemets for quotations,

37.40 \declare@shorthand{danish}{"`}{%
37.41 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
37.42 \declare@shorthand{danish}{"'}{%
37.43 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
37.44 \declare@shorthand{danish}{"<}{%
37.45 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
37.46 \declare@shorthand{danish}{">}{%
37.47 \textormath{\guillemotright}{\mbox{\guillemotright}}}

then we define to be able to specify hyphenation breakpoints that behave a little different from \-.

37.48 \declare@shorthand{danish}{"-}{\nobreak-\bbl@allowhyphens}
37.49 \declare@shorthand{danish}{""}{\hskip\z@skip}
37.50 \declare@shorthand{danish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
37.51 \declare@shorthand{danish}{"=}{\nobreak-\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

37.52 \declare@shorthand{danish}{"|}{%
37.53 \textormath{\discretionary{-}{}{\kern.03em}}{}}

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.

37.54 \ldf@finish{danish}

37.55 ⟨/code⟩

38 The Icelandic language

38.1 Overview

The file iceland.dtx^{47} defines all the language definition macros for the Icelandic language

Customization for the Icelandic language was made following several official and semiofficial publications [2, 3, 1, 6, 5]. These publications do not always agree and we indicate those instances.

For this language the character " is made active. In table 15 an overview is given of its purpose. The shorthands in table 15 can also be typeset by using the

"|  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, allow-

ing 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  for old Icelandic Ǫ
"ó  for old Icelandic ǫ́
"Ó  for old Icelandic Ǫ́
"e  for old Icelandic ę
"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˚ C
\upp  for textsuperscript

Table 15: The shorthands and extra definitions made by icelandic.ldf

commands in table 16.

References

[1] Alþingi. Reglur um frágang þingskjala og prentun umræðna, 1988.

[2] Auglýsing um greinarmerkjasetningu. Stj.tíð B, nr. 133/1974, 1974.

47The file described in this section has version number ? and was last revised on ?.

\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 ǫ
\Oob  for old Icelandic Ǫ
\ooob for old Icelandic ǫ́
\OOob for old Icelandic Ǫ́
\eob  for old Icelandic ę
\Eob  for old Icelandic ˛E
\eeob for old Icelandic ę́
\EEob for old Icelandic ˛É

Table 16: Commands which produce quotes and old Icelandic diacritics, defined

by icelandic.ldf

[3] Auglýsing um breyting auglýsingu nr. 132/1974 um íslenska stafsetningu. Stj.tíð B, nr. 261/1977, 1977.

[4] Einar Haugen, editor. First Grammatical Treatise. Longman, London, 2 edition, 1972.

[5] Staðlaráð Íslands og Fagráð í upplýsingatækni, Reykjavík. Forstaðall FS 130:1997, 1997.

[6] STRÍ Staðlaráð Íslands. SI - kerfið, 2 edition, 1994.

38.2 TEXnical details

When this file was read through the option icelandic we make it behave as if icelandic was specified.

38.1 \def\bbl@tempa{icelandic}
38.2 \ifx\CurrentOption\bbl@tempa
38.3 \def\CurrentOption{icelandic}

38.4 \fi

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

38.5 ⟨∗code⟩

38.6 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e., by the \usepackage command, 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.

38.7 \ifx\l@icelandic\@undefined
38.8 \@nopatterns{Icelandic}
38.9 \adddialect\l@icelandic0

38.10 \fi

\if@Two@E We will need a new ‘if’ : \if@Two@E is true if and only if L^{A}TEX 2ε is running 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 L^{A}TEX-2.09 based formats.

38.11 \newif\if@Two@E \@Two@Etrue
38.12 \def\@FI@{\fi}
38.13 \ifx\@compatibilitytrue\@undefined
38.14 \@Two@Efalse \def\@FI@{\relax}
38.15 \else
38.16 \if@compatibility \@Two@Efalse \fi
38.17 \@FI@

\extrasicelandic \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 " character is made active. This is done once, later on its definition may vary.

38.18 \initiate@active@char{"}
38.19 \@namedef{extras\CurrentOption}{%
38.20 \languageshorthands{icelandic}}
38.21 \expandafter\addto\csname extras\CurrentOption\endcsname{%
38.22 \bbl@activate{"}}

Don’t forget to turn the shorthands off again.

38.23 \addto\noextrasicelandic{\bbl@deactivate{"}}

The icelandic hyphenation patterns can be used with \lefthyphenmin and

\righthyphenmin set to 2.
38.24 \providehyphenmins{\CurrentOption}{\tw@\tw@}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 16.

To be able to define the function of ", we first define a couple of ‘support’ macros.

38.3 Captionnames and date

The next step consists of defining the Icelandic equivalents for the L^{A}TEX captionnames.

\captionsicelandic The macro \captionsicelandic will define all strings used used in the four stand-

ard document classes provided with L^{A}TEX.

38.25 \@namedef{captions\CurrentOption}{%
38.26 \def\prefacename{Formáli}%
38.27 \def\refname{Heimildir}%
38.28 \def\abstractname{Útdráttur}%

38.29 \def\bibname{Heimildir}%
38.30 \def\chaptername{Kafli}%
38.31 \def\appendixname{Viðauki}%
38.32 \def\contentsname{Efnisyfirlit}%
38.33 \def\listfigurename{Myndaskrá}%
38.34 \def\listtablename{Töfluskrá}%
38.35 \def\indexname{Atriðisorðaskrá}%
38.36 \def\figurename{Mynd}%
38.37 \def\tablename{Tafla}%
38.38 \def\partname{Hluti}%
38.39 \def\enclname{Hjálagt}%
38.40 \def\ccname{Samrit}%
38.41 \def\headtoname{Til:}% in letter
38.42 \def\pagename{Blaðsíða}%
38.43 \def\seename{Sjá}%
38.44 \def\alsoname{Sjá einnig}%
38.45 \def\proofname{Sönnun}%
38.46 \def\glossaryname{Glossary}% <-- Needs translation

38.47 }

\dateicelandic The macro \dateicelandic redefines the command \today to produce Icelandic

dates.

38.48 \def\dateicelandic{%
38.49 \def\today{\number\day.~\ifcase\month\or
38.50  janúar\or febrúar\or mars\or apríl\or maí\or júní\or
38.51  júlí\or ágúst\or september\or október\or nóvember\or desember\fi
38.52  \space\number\year}}

38.4 Icelandic quotation marks

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

38.53 \begingroup \catcode`\"12
38.54 \def\x{\endgroup
38.55 \def\@SS{\mathchar"7019 }
38.56 \def\dq{"}}

38.57 \x

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.

38.58 \let\ilq\grq
38.59 \let\irq\grq
38.60 \let\iflq\frq
38.61 \let\ifrq\flq
38.62 \let\ilqq\glqq
38.63 \let\irqq\grqq
38.64 \let\iflqq\frqq
38.65 \let\ifrqq\flqq
38.66 \declare@shorthand{icelandic}{"`}{\glqq}
38.67 \declare@shorthand{icelandic}{"'}{\grqq}

38.68 \declare@shorthand{icelandic}{">}{\frqq}
38.69 \declare@shorthand{icelandic}{"<}{\flqq}

and some additional commands:

38.70 \declare@shorthand{icelandic}{"-}{\nobreak\-\bbl@allowhyphens}
38.71 \declare@shorthand{icelandic}{"|}{%
38.72 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
38.73  \bbl@allowhyphens}{}}
38.74 \declare@shorthand{icelandic}{""}{\hskip\z@skip}
38.75 \declare@shorthand{icelandic}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
38.76 \declare@shorthand{icelandic}{"=}{\nobreak-\hskip\z@skip}

38.5 Old Icelandic

In old Icelandic some letters have special diacritical marks, described for example in First Grammatical Treatise [4, 5]. We provide these in the T1 encoding with the ‘ogonek’. 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 polish.dtx is designed to position the diacritics correctly for every font in every size. These macros need a few extra dimension variables.

38.77 \newdimen\pl@left
38.78 \newdimen\pl@down
38.79 \newdimen\pl@right
38.80 \newdimen\pl@temp

\sob The macro \sob is used to put the ‘ogonek’ in the right place.

38.81 \def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
38.82 \setbox0\hbox{#1}\setbox1\hbox{\k{}}\setbox2\hbox{p}%
38.83 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
38.84 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
38.85 \pl@left=\pl@right \advance\pl@left by\wd1
38.86 \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
38.87 \leavevmode
38.88 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
\oob
\Oob
\ooob
\OOob
\eob
\Eob
\eeob
\EEob

38.89 \DeclareTextCommand{\oob}{T1}{\sob {o}{.85}{0}{.04}{0}}
38.90 \DeclareTextCommand{\Oob}{T1}{\sob {O}{.7}{0}{0}{0}}
38.91 \DeclareTextCommand{\ooob}{T1}{\sob {ó}{.85}{0}{.04}{0}}
38.92 \DeclareTextCommand{\OOob}{T1}{\sob {Ó}{.7}{0}{0}{0}}
38.93 \DeclareTextCommand{\eob}{T1}{\sob {e}{1}{0}{.04}{0}}
38.94 \DeclareTextCommand{\Eob}{T1}{\sob {E}{1}{0}{.04}{0}}
38.95 \DeclareTextCommand{\eeob}{T1}{\sob {é}{1}{0}{.04}{0}}
38.96 \DeclareTextCommand{\EEob}{T1}{\sob {É}{1}{0}{.04}{0}}
38.97 \declare@shorthand{icelandic}{"o}{\oob}
38.98 \declare@shorthand{icelandic}{"O}{\Oob}
38.99 \declare@shorthand{icelandic}{"ó}{\ooob}
38.100 \declare@shorthand{icelandic}{"Ó}{\OOob}
38.101 \declare@shorthand{icelandic}{"e}{\eob}
38.102 \declare@shorthand{icelandic}{"E}{\Eob}
38.103 \declare@shorthand{icelandic}{"é}{\eeob}
38.104 \declare@shorthand{icelandic}{"É}{\EEob}

38.6 Formatting numbers

This section is lifted from 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π should be inputed as $3{,}141.592{,}653$ in mathmode and as 3,141.592,653 in text.

In Icelandic the decimal part starts with a comma and thousands should be separated by a space [1] or by a period [5]; we have the space. The above approximation of 1000π 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 TEXbook 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 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.

\decimalsep \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.

38.105 \mathchardef\m@comma="013B \def\@comma@{\ifmmode\m@comma\else,\fi}
38.106 \def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi}
38.107 \newcommand{\decimalsep}{.}  \newcommand{\thousandsep}{\@comma@}
38.108 \expandafter\addto\csname extras\CurrentOption\endcsname{%
38.109  \def\decimalsep{\@comma@}%
38.110  \def\thousandsep{\f@thousandsep}}
38.111 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
38.112  \def\decimalsep{.}%
38.113  \def\thousandsep{\@comma@}}

\tala The decimal separator used when inputing a number with \tala has to be a comma. \tala splits the inputed number into two parts: what comes before the first comma will be formatted by \@integerpart while the rest (if not empty) will be formatted by \@decimalpart. Both parts, once formatted separately will be merged together with between them, either the decimal separator \decimalsep or (in L^{A}TEX 2ε only) the optional argument of \tala.

38.114 \if@Two@E
38.115 \newcommand{\tala}[2][\decimalsep]{%
38.116  \def\@decimalsep{#1}\@tala#2\@empty,\@empty,\@nil}

38.117 \else

38.118 \newcommand{\tala}[1]{%
38.119  \def\@decimalsep{\decimalsep}\@tala#1\@empty,\@empty,\@nil}

38.120 \fi

38.121 \def\@tala#1,#2,#3\@nil{%
38.122  \ifx\@empty#2%
38.123  \@integerpart{#1}%

38.124 \else

38.125  \@integerpart{#1}\@decimalsep\@decimalpart{#2}%

38.126 \fi}

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.

38.127 \def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty}
38.128 \def\@@decimalpart#1#2#3#4{#1#2#3%
38.129 \ifx\@empty#4%

38.130 \else

38.131  \thousandsep\expandafter\@@decimalpart\expandafter#4%

38.132 \fi}

Formatting the integer part is more difficult because the slices of 3 digits start from the bottom while the number is read from the top! This (tricky) code is borrowed from David Carlisle’s comma.sty.

38.133 \def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty}
38.134 \def\@@integerpart#1#2#3#4{%
38.135 \ifx\@empty#2%
38.136  \@addthousandsep#1\relax

38.137 \else

38.138  \ifx\@empty#3%
38.139  \@addthousandsep\@empty\@empty#1#2\relax

38.140 \else

38.141  \ifx\@empty#4%
38.142  \@addthousandsep\@empty#1#2#3\relax

38.143 \else

38.144  \@@integerpartafterfi{#1#2#3#4}%

38.145 \fi 38.146 \fi 38.147 \fi}

38.148 \def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}}
38.149 \def\@addthousandsep#1#2#3#4{#1#2#3%
38.150 \if#4\relax

38.151 \else

38.152  \thousandsep\expandafter\@addthousandsep\expandafter#4%

38.153 \fi}

38.7 Extra utilities

We now provide the Icelandic user with some extra utilities.

\upp \upp is for typesetting superscripts. \upp relies on

\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.

38.154 \ifx\sevenrm\@undefined
38.155 \ifx\@ptsize\@undefined
38.156  \let\upp@size\small

38.157 \else

38.158  \ifx\selectfont\@undefined

In this case the format is the original L^{A}TEX-2.09:

38.159  \ifcase\@ptsize
38.160  \let\upp@size\ixpt\or
38.161  \let\upp@size\xpt\or
38.162  \let\upp@size\xipt

38.163 \fi

When \selectfont is defined we probably have NFSS available:

38.164 \else

38.165  \ifcase\@ptsize
38.166  \def\upp@size{\fontsize\@ixpt{10pt}\selectfont}\or
38.167  \def\upp@size{\fontsize\@xpt{11pt}\selectfont}\or
38.168  \def\upp@size{\fontsize\@xipt{12pt}\selectfont}

38.169 \fi 38.170 \fi 38.171 \fi 38.172 \else

If we end up here it must be a plain based TEX format, so:

38.173  \let\upp@size\sevenrm

38.174 \fi

Now we can define \upp. When L^{A}TEX 2ε runs in compatibility mode (L^{A}TEX-2.09 emulation), \textsuperscript is also defined, but does no good job, so we give two different definitions for \upp using \if@Two@E.

38.175 \if@Two@E
38.176 \DeclareRobustCommand*{\upp}[1]{\textsuperscript{#1}}

38.177 \else

38.178 \DeclareRobustCommand*{\upp}[1]{%
38.179  \leavevmode\raise1ex\hbox{\upp@size#1}}

38.180 \fi

Some definitions for special characters. \grada needs a special treatment: it is \char6 in T1-encoding and \char23 in OT1-encoding.

38.181 \ifx\fmtname\LaTeXeFmtName
38.182 \DeclareTextSymbol{\grada}{T1}{6}
38.183 \DeclareTextSymbol{\grada}{OT1}{23}

38.184 \else

38.185 \def\T@one{T1}
38.186 \ifx\f@encoding\T@one

38.187  \newcommand{\grada}{\char6}

38.188 \else

38.189  \newcommand{\grada}{\char23}

38.190 \fi 38.191 \fi

\gradur Macro for typesetting the abbreviation for ‘degrees’ (as in ‘degrees Celsius’). As the bounding box of the character ‘degree’ has 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).

38.192 \DeclareRobustCommand*{\gradur}{%
38.193  \leavevmode\hbox to 0.3em{\hss\grada\hss}}

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.

38.194 \ldf@finish\CurrentOption

38.195 ⟨/code⟩

39 The Norwegian language

The file norsk.dtx^{48} 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 17 an overview is given of its purpose.

"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)

"| Like "-, but inserts 0.03em space. Use it if the compound point is spanned by a ligature. (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 >>).

Table 17: The extra definitions made by norsk.sty

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’.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

39.1 ⟨∗code⟩

39.2 \LdfInit\CurrentOption{captions\CurrentOption}

When this file is read as an option, i.e. by the \usepackage command, 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.

39.3 \ifx\l@norsk\@undefined
39.4  \@nopatterns{Norsk}
39.5  \adddialect\l@norsk0\fi

\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.

39.6 \providehyphenmins{\CurrentOption}{\tw@\tw@}

48The file described in this section has version number v2.0h and was last revised on 2001/01/12. 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); the shorthand definitions were provided by Rune Kleveland (runekl@math.uio.no).

Now we have to decide which version of the captions should be made available. This can be done by checking the contents of \CurrentOption.

 39.7 \def\bbl@tempa{norsk}
 39.8 \ifx\CurrentOption\bbl@tempa

The next step consists of defining commands to switch to (and from) the Norwegian language.

\captionsnorsk The macro \captionsnorsk defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 39.9 \def\captionsnorsk{%
39.10  \def\prefacename{Forord}%
39.11  \def\refname{Referanser}%
39.12  \def\abstractname{Sammendrag}%
39.13  \def\bibname{Bibliografi}%     or Litteraturoversikt
39.14  %                              or Litteratur or Referanser
39.15  \def\chaptername{Kapittel}%
39.16  \def\appendixname{Tillegg}%    or Appendiks
39.17  \def\contentsname{Innhold}%
39.18  \def\listfigurename{Figurer}%  or Figurliste
39.19  \def\listtablename{Tabeller}%  or Tabelliste
39.20  \def\indexname{Register}%
39.21  \def\figurename{Figur}%
39.22  \def\tablename{Tabell}%
39.23  \def\partname{Del}%
39.24  \def\enclname{Vedlegg}%
39.25  \def\ccname{Kopi sendt}%
39.26  \def\headtoname{Til}% in letter
39.27  \def\pagename{Side}%
39.28  \def\seename{Se}%
39.29  \def\alsoname{Se ogs\aa{}}%
39.30  \def\proofname{Bevis}%
39.31  \def\glossaryname{Ordliste}%

39.32 }

39.33 \else

For the ‘nynorsk’ version of these definitions we just add a “dialect”.

39.34 \adddialect\l@nynorsk\l@norsk

\captionsnynorsk The macro \captionsnynorsk defines all strings used in the four standard documentclasses provided with L^{A}TEX, but using a different spelling than in the com-

  mand \captionsnorsk.
39.35 \def\captionsnynorsk{%
39.36  \def\prefacename{Forord}%
39.37  \def\refname{Referansar}%
39.38  \def\abstractname{Samandrag}%
39.39  \def\bibname{Litteratur}%     or Litteraturoversyn
39.40  %                             or Referansar
39.41  \def\chaptername{Kapittel}%
39.42  \def\appendixname{Tillegg}%   or Appendiks
39.43  \def\contentsname{Innhald}%
39.44  \def\listfigurename{Figurar}% or Figurliste
39.45  \def\listtablename{Tabellar}% or Tabelliste
39.46  \def\indexname{Register}%

39.47  \def\figurename{Figur}%
39.48  \def\tablename{Tabell}%
39.49  \def\partname{Del}%
39.50  \def\enclname{Vedlegg}%
39.51  \def\ccname{Kopi til}%
39.52  \def\headtoname{Til}% in letter
39.53  \def\pagename{Side}%
39.54  \def\seename{Sj\aa{}}%
39.55  \def\alsoname{Sj\aa{} \`{o}g}%
39.56  \def\proofname{Bevis}%
39.57  \def\glossaryname{Ordliste}%

39.58 } 39.59 \fi

\datenorsk The macro \datenorsk redefines the command \today to produce Norwegian

dates.

39.60 \@namedef{date\CurrentOption}{%
39.61 \def\today{\number\day.~\ifcase\month\or
39.62  januar\or februar\or mars\or april\or mai\or juni\or
39.63  juli\or august\or september\or oktober\or november\or desember

39.64 \fi

39.65  \space\number\year}}

\extrasnorsk \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.

39.66 \@namedef{extras\CurrentOption}{\bbl@frenchspacing}
39.67 \@namedef{noextras\CurrentOption}{\bbl@nonfrenchspacing}

For Norsk the " character is made active. This is done once, later on its definition may vary.

39.68 \initiate@active@char{"}
39.69 \expandafter\addto\csname extras\CurrentOption\endcsname{%
39.70 \languageshorthands{norsk}}
39.71 \expandafter\addto\csname extras\CurrentOption\endcsname{%
39.72 \bbl@activate{"}}

Don’t forget to turn the shorthands off again.

39.73 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
39.74 \bbl@deactivate{"}}

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 17.

To be able to define the function of ", we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

39.75 \begingroup \catcode`\"12
39.76 \def\x{\endgroup
39.77 \def\@SS{\mathchar"7019 }
39.78 \def\dq{"}}

39.79 \x

Now we can define the discretionary shorthand commands. The number of words where such hyphenation is required is for each character

b d f g k l n p r s t
4 4 15 3 43 30 8 12 1 33 35

taken from a list of 83000 ispell-roots.

39.80 \declare@shorthand{norsk}{"b}{\textormath{\bbl@disc b{bb}}{b}}
39.81 \declare@shorthand{norsk}{"B}{\textormath{\bbl@disc B{BB}}{B}}
39.82 \declare@shorthand{norsk}{"d}{\textormath{\bbl@disc d{dd}}{d}}
39.83 \declare@shorthand{norsk}{"D}{\textormath{\bbl@disc D{DD}}{D}}
39.84 \declare@shorthand{norsk}{"e}{\textormath{\bbl@disc e{\'e}}{}}
39.85 \declare@shorthand{norsk}{"E}{\textormath{\bbl@disc E{\'E}}{}}
39.86 \declare@shorthand{norsk}{"F}{\textormath{\bbl@disc F{FF}}{F}}
39.87 \declare@shorthand{norsk}{"g}{\textormath{\bbl@disc g{gg}}{g}}
39.88 \declare@shorthand{norsk}{"G}{\textormath{\bbl@disc G{GG}}{G}}
39.89 \declare@shorthand{norsk}{"k}{\textormath{\bbl@disc k{kk}}{k}}
39.90 \declare@shorthand{norsk}{"K}{\textormath{\bbl@disc K{KK}}{K}}
39.91 \declare@shorthand{norsk}{"l}{\textormath{\bbl@disc l{ll}}{l}}
39.92 \declare@shorthand{norsk}{"L}{\textormath{\bbl@disc L{LL}}{L}}
39.93 \declare@shorthand{norsk}{"n}{\textormath{\bbl@disc n{nn}}{n}}
39.94 \declare@shorthand{norsk}{"N}{\textormath{\bbl@disc N{NN}}{N}}
39.95 \declare@shorthand{norsk}{"p}{\textormath{\bbl@disc p{pp}}{p}}
39.96 \declare@shorthand{norsk}{"P}{\textormath{\bbl@disc P{PP}}{P}}
39.97 \declare@shorthand{norsk}{"r}{\textormath{\bbl@disc r{rr}}{r}}
39.98 \declare@shorthand{norsk}{"R}{\textormath{\bbl@disc R{RR}}{R}}
39.99 \declare@shorthand{norsk}{"s}{\textormath{\bbl@disc s{ss}}{s}}
39.100 \declare@shorthand{norsk}{"S}{\textormath{\bbl@disc S{SS}}{S}}
39.101 \declare@shorthand{norsk}{"t}{\textormath{\bbl@disc t{tt}}{t}}
39.102 \declare@shorthand{norsk}{"T}{\textormath{\bbl@disc T{TT}}{T}}

We need to treat "f a bit differently in order to preserve the ff-ligature.

39.103 \declare@shorthand{norsk}{"f}{\textormath{\bbl@discff}{f}}
39.104 \def\bbl@discff{\penalty\@M
39.105 \afterassignment\bbl@insertff \let\bbl@nextff= }
39.106 \def\bbl@insertff{%
39.107 \if f\bbl@nextff
39.108  \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
39.109 {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
39.110 \let\bbl@nextff=f

We now define the French double quotes and some commands concerning hyphenation:

39.111 \declare@shorthand{norsk}{"<}{\flqq}
39.112 \declare@shorthand{norsk}{">}{\frqq}
39.113 \declare@shorthand{norsk}{"-}{\penalty\@M\-\bbl@allowhyphens}
39.114 \declare@shorthand{norsk}{"|}{%
39.115 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
39.116  \allowhyphens}{}}
39.117 \declare@shorthand{norsk}{""}{\hskip\z@skip}
39.118 \declare@shorthand{norsk}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
39.119 \declare@shorthand{norsk}{"=}{\penalty\@M-\hskip\z@skip}

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.

39.120 \ldf@finish\CurrentOption

39.121 ⟨/code⟩

40 The Swedish language

The file swedish.dtx^{49} 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 18 an overview is given of its purpose. The vertical placement of the "umlaut" in some letters can be controlled this way.

"a  Gives ä, also implemented for "A, "o and "O.
"w, "W gives å and Å.

"ff for ff to be hyphenated as ff-f. Used for compound words, such as stra"ffånge, which should be hyphenated as straff-fånge. This is also implemented for b, d, f, g, l, m, n, p, r, s, and t.

"| disable ligature at this position. This should be used for compound words, such as “stra"ffinrättning”, 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 och/""eller). "~ for an explicit hyphen without a breakpoint; use-

ful 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 -lån”.

\- like the old \-, but allowing hyphenation in the rest of the word.

Table 18: The extra definitions made by swedish.sty

Two variations for formatting of dates are added. \datesymd makes \today output dates formatted as YYYY-MM-DD, which is commonly used in Sweden today. \datesdmy formats the date as D/M YYYY, which is also very common in Sweden. These commands should be issued after \begindocument.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

40.1 ⟨∗code⟩

40.2 \LdfInit{swedish}\captionsswedish

When this file is read as an option, i.e. by the \usepackage command, 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.

40.3 \ifx\l@swedish\@undefined
40.4  \@nopatterns{Swedish}

49The file described in this section has version number v2.3b and was last revised on 2001/01/31. Contributions were made by Sten Hellman (HELLMAN@CERNVM.CERN.CH) and Erik Östhols (erik_osthols@yahoo.com).

 40.5  \adddialect\l@swedish0\fi

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.

\captionsswedish The macro \captionsswedish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 40.6 \addto\captionsswedish{%
 40.7 \def\prefacename{F\"orord}%
 40.8 \def\refname{Referenser}%
 40.9 \def\abstractname{Sammanfattning}%
40.10 \def\bibname{Litteraturf\"orteckning}%
40.11 \def\chaptername{Kapitel}%
40.12 \def\appendixname{Bilaga}%
40.13 \def\contentsname{Inneh\csname aa\endcsname ll}%
40.14 \def\listfigurename{Figurer}%
40.15 \def\listtablename{Tabeller}%
40.16 \def\indexname{Sakregister}%
40.17 \def\figurename{Figur}%
40.18 \def\tablename{Tabell}%
40.19 \def\partname{Del}%
40.20 \def\enclname{Bil.}%
40.21 \def\ccname{Kopia f\"or k\"annedom}%
40.22 \def\headtoname{Till}% in letter
40.23 \def\pagename{Sida}%
40.24 \def\seename{se}%
40.25 \def\alsoname{se \"aven}%
40.26 \def\proofname{Bevis}%
40.27 \def\glossaryname{Glossary}% <-- Needs translation

40.28 }%

\dateswedish The macro \dateswedish redefines the command \today to produce Swedish

dates.

40.29 \def\dateswedish{%
40.30 \def\today{%
40.31  \number\day~\ifcase\month\or
40.32  januari\or februari\or mars\or april\or maj\or juni\or
40.33  juli\or augusti\or september\or oktober\or november\or
40.34  december\fi
40.35  \space\number\year}}

\datesymd The macro \datesymd redefines the command \today to produce dates in the

format YYYY-MM-DD, common in Sweden.

40.36 \def\datesymd{%
40.37 \def\today{\number\year-\two@digits\month-\two@digits\day}%

40.38 }

\datesdmy The macro \datesdmy redefines the command \today to produce Swedish dates

in the format DD/MM YYYY, also common in Sweden.

40.39 \def\datesdmy{%
40.40 \def\today{\number\day/\number\month\space\number\year}%

40.41 }

\swedishhyphenmins The swedish hyphenation patterns can be used with \lefthyphenmin set to 2 and

  \righthyphenmin set to 2.
40.42 \providehyphenmins{swedish}{\tw@\tw@}

\extrasswedish \noextrasswedish 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.

40.43 \addto\extrasswedish{\bbl@frenchspacing}
40.44 \addto\noextrasswedish{\bbl@nonfrenchspacing}

For Swedish the " character is made active. This is done once, later on its definition may vary.

40.45 \initiate@active@char{"}
40.46 \addto\extrasswedish{\languageshorthands{swedish}}
40.47 \addto\extrasswedish{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

40.48 \addto\noextrasswedish{\bbl@deactivate{"}}

The “umlaut” accent macro \" is changed to lower the “umlaut” dots. The redefinition is done with the help of \umlautlow.

40.49 \addto\extrasswedish{\babel@save\"\umlautlow}
40.50 \addto\noextrasswedish{\umlauthigh}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 18.

To be able to define the function of ", we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

40.51 \begingroup \catcode`\"12
40.52 \def\x{\endgroup
40.53 \def\@SS{\mathchar"7019 }
40.54 \def\dq{"}}

40.55 \x

Now we can define the doublequote macros: the umlauts and å.

40.56 \declare@shorthand{swedish}{"w}{\textormath{{\aa}\allowhyphens}{\ddot w}}
40.57 \declare@shorthand{swedish}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
40.58 \declare@shorthand{swedish}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}
40.59 \declare@shorthand{swedish}{"W}{\textormath{{\AA}\allowhyphens}{\ddot W}}
40.60 \declare@shorthand{swedish}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
40.61 \declare@shorthand{swedish}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}

discretionary commands

40.62 \declare@shorthand{swedish}{"b}{\textormath{\bbl@disc b{bb}}{b}}
40.63 \declare@shorthand{swedish}{"B}{\textormath{\bbl@disc B{BB}}{B}}
40.64 \declare@shorthand{swedish}{"d}{\textormath{\bbl@disc d{dd}}{d}}
40.65 \declare@shorthand{swedish}{"D}{\textormath{\bbl@disc D{DD}}{D}}
40.66 \declare@shorthand{swedish}{"f}{\textormath{\bbl@disc f{ff}}{f}}

40.67 \declare@shorthand{swedish}{"F}{\textormath{\bbl@disc F{FF}}{F}}
40.68 \declare@shorthand{swedish}{"g}{\textormath{\bbl@disc g{gg}}{g}}
40.69 \declare@shorthand{swedish}{"G}{\textormath{\bbl@disc G{GG}}{G}}
40.70 \declare@shorthand{swedish}{"l}{\textormath{\bbl@disc l{ll}}{l}}
40.71 \declare@shorthand{swedish}{"L}{\textormath{\bbl@disc L{LL}}{L}}
40.72 \declare@shorthand{swedish}{"m}{\textormath{\bbl@disc m{mm}}{m}}
40.73 \declare@shorthand{swedish}{"M}{\textormath{\bbl@disc M{MM}}{M}}
40.74 \declare@shorthand{swedish}{"n}{\textormath{\bbl@disc n{nn}}{n}}
40.75 \declare@shorthand{swedish}{"N}{\textormath{\bbl@disc N{NN}}{N}}
40.76 \declare@shorthand{swedish}{"p}{\textormath{\bbl@disc p{pp}}{p}}
40.77 \declare@shorthand{swedish}{"P}{\textormath{\bbl@disc P{PP}}{P}}
40.78 \declare@shorthand{swedish}{"r}{\textormath{\bbl@disc r{rr}}{r}}
40.79 \declare@shorthand{swedish}{"R}{\textormath{\bbl@disc R{RR}}{R}}
40.80 \declare@shorthand{swedish}{"s}{\textormath{\bbl@disc s{ss}}{s}}
40.81 \declare@shorthand{swedish}{"S}{\textormath{\bbl@disc S{SS}}{S}}
40.82 \declare@shorthand{swedish}{"t}{\textormath{\bbl@disc t{tt}}{t}}
40.83 \declare@shorthand{swedish}{"T}{\textormath{\bbl@disc T{TT}}{T}}

and some additional commands:

40.84 \declare@shorthand{swedish}{"-}{\nobreak-\bbl@allowhyphens}
40.85 \declare@shorthand{swedish}{"|}{%
40.86 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
40.87  \bbl@allowhyphens}{}}
40.88 \declare@shorthand{swedish}{""}{\hskip\z@skip}
40.89 \declare@shorthand{swedish}{"~}{%
40.90 \textormath{\leavevmode\hbox{-}\bbl@allowhyphens}{-}}
40.91 \declare@shorthand{swedish}{"=}{\hbox{-}\allowhyphens}

\- 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.

40.92 \addto\extrasswedish{\babel@save\-}
40.93 \addto\extrasswedish{\def\-{\allowhyphens
40.94  \discretionary{-}{}{}\allowhyphens}}

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.

40.95 \ldf@finish{swedish}

40.96 ⟨/code⟩

41 The North Sami language

The file samin.dtx^{50} 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 .dtx files for e.g. Lule and South Sami. Hence the name samin.dtx (and not 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 (fi8hyph.tex), Norwegian (nohyph.tex) or Swedish (sehyph.tex). Add a line for the samin language to the language.dat file, and rebuild the L^{A}TEX format file. See the documentation for your L^{A}TEX distribution.

A note on writing North Sami in L^{A}TEX: 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.

41.1 The code of samin.dtx

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

41.1 ⟨∗code⟩

41.2 \LdfInit{samin}{captionssamin}

When this file is read as an option, i.e. by the \usepackage command, 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.

41.3 \ifx\undefined\l@samin
41.4 \@nopatterns{Samin}
41.5 \adddialect\l@samin0\fi

The next step consists of defining commands to switch to (and from) the North Sami language.

\saminhyphenmins This macro is used to store the correct values of the hyphenation parameters

\lefthyphenmin and \righthyphenmin.
41.6 \providehyphenmins{samin}{\tw@\tw@}

\captionssamin The macro \captionssamin defines all strings used in the four standard documentclasses provided with L^{A}TEX.

41.7 \def\captionssamin{%
41.8 \def\prefacename{Ovdas\'atni}%
41.9 \def\refname{\v Cujuhusat}%
41.10 \def\abstractname{\v Coahkk\'aigeassu}%

50The file described in this section has version number v1.0c and was last revised on 2000/10/04. It was written by Regnor Jernsletten, (Regnor.Jernsletten@sami.uit.no) or (Regnor.Jernsletten@eunet.no).

41.11 \def\bibname{Girjj\'ala\v svuohta}%
41.12 \def\chaptername{Kapihttal}%
41.13 \def\appendixname{\v Cuovus}%
41.14 \def\contentsname{Sisdoallu}%
41.15 \def\listfigurename{Govvosat}%
41.16 \def\listtablename{Tabeallat}%
41.17 \def\indexname{Registtar}%
41.18 \def\figurename{Govus}%
41.19 \def\tablename{Tabealla}%
41.20 \def\partname{Oassi}%
41.21 \def\enclname{Mielddus}%
41.22 \def\ccname{Kopia s\'addejuvvon}%
41.23 \def\headtoname{Vuost\'aiv\'aldi}%
41.24 \def\pagename{Siidu}%
41.25 \def\seename{geah\v ca}%
41.26 \def\alsoname{geah\v ca maidd\'ai}%
41.27 \def\proofname{Duo\dj{}a\v stus}%
41.28 \def\glossaryname{S\'atnelistu}%

41.29 }%

\datesamin The macro \datesamin redefines the command \today to produce North Sami

dates.

41.30 \def\datesamin{%
41.31 \def\today{\ifcase\month\or
41.32  o\dj{}\dj{}ajagem\'anu\or
41.33  guovvam\'anu\or
41.34  njuk\v cam\'anu\or
41.35  cuo\ng{}om\'anu\or
41.36  miessem\'anu\or
41.37  geassem\'anu\or
41.38  suoidnem\'anu\or
41.39  borgem\'anu\or
41.40  \v cak\v cam\'anu\or
41.41  golggotm\'anu\or
41.42  sk\'abmam\'anu\or
41.43  juovlam\'anu\fi
41.44  \space\number\day.~b.\space\number\year}%

41.45 }%

\extrassamin \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.

41.46 \addto\extrassamin{}
41.47 \addto\noextrassamin{}

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.

41.48 \ldf@finish{samin}

41.49 ⟨/code⟩

42 The Finnish language

The file finnish.dtx^{51} defines all the language definition macros for the Finnish language.

For this language the character " is made active. In table 19 an overview is given of its purpose.

"| 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 "-, 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.

Table 19: The extra definitions made by finnish.ldf

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

42.1 ⟨∗code⟩

42.2 \LdfInit{finnish}\captionsfinnish

When this file is read as an option, i.e. by the \usepackage command, 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.

42.3 \ifx\l@finnish\@undefined
42.4  \@nopatterns{Finnish}
42.5  \adddialect\l@finnish0\fi

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.

\captionsfinnish The macro \captionsfinnish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

42.6 \addto\captionsfinnish{%
42.7 \def\prefacename{Esipuhe}%
42.8 \def\refname{Viitteet}%
42.9 \def\abstractname{Tiivistelm\"a}
42.10 \def\bibname{Kirjallisuutta}%
42.11 \def\chaptername{Luku}%
42.12 \def\appendixname{Liite}%

51The file described in this section has version number v1.3n and was last revised on 2001/01/30. A contribution was made by Mikko KANERVA (KANERVA@CERNVM) and Keranen Reino (KERANEN@CERNVM).

42.13 \def\contentsname{Sis\"alt\"o}%   /* Could be "Sis\"allys" as well */
42.14 \def\listfigurename{Kuvat}%
42.15 \def\listtablename{Taulukot}%
42.16 \def\indexname{Hakemisto}%
42.17 \def\figurename{Kuva}%
42.18 \def\tablename{Taulukko}%
42.19 \def\partname{Osa}%
42.20 \def\enclname{Liitteet}%
42.21 \def\ccname{Jakelu}%
42.22 \def\headtoname{Vastaanottaja}%
42.23 \def\pagename{Sivu}%
42.24 \def\seename{katso}%
42.25 \def\alsoname{katso my\"os}%
42.26 \def\proofname{Todistus}%
42.27 \def\glossaryname{Glossary}% <-- Needs translation

42.28 }%

\datefinnish The macro \datefinnish redefines the command \today to produce Finnish

dates.

42.29 \def\datefinnish{%
42.30 \def\today{\number\day.~\ifcase\month\or
42.31  tammikuuta\or helmikuuta\or maaliskuuta\or huhtikuuta\or
42.32  toukokuuta\or kes\"akuuta\or hein\"akuuta\or elokuuta\or
42.33  syyskuuta\or lokakuuta\or marraskuuta\or joulukuuta\fi
42.34  \space\number\year}}

\extrasfinnish \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 finnish.ldf is appropriate, as the looseness of the font (and the line width) affect the correct choice of these parameters.

42.35 \addto\extrasfinnish{%
42.36 \babel@savevariable\hyphenpenalty\hyphenpenalty=30%
42.37 \babel@savevariable\exhyphenpenalty\exhyphenpenalty=30%
42.38 \babel@savevariable\doublehyphendemerits\doublehyphendemerits=5000%
42.39 \babel@savevariable\finalhyphendemerits\finalhyphendemerits=5000%

42.40 }

42.41 \addto\noextrasfinnish{}

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.

42.42 \addto\extrasfinnish{\bbl@frenchspacing}
42.43 \addto\noextrasfinnish{\bbl@nonfrenchspacing}

For Finnish the " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the finnish group of shorthands should be used.

42.44 \initiate@active@char{"}
42.45 \addto\extrasfinnish{\languageshorthands{finnish}}

Don’t forget to turn the shorthands off again.

42.46 \addto\extrasfinnish{\bbl@activate{"}}
42.47 \addto\noextrasfinnish{\bbl@deactivate{"}}

The ‘umlaut’ character should be positioned lower on all vowels in Finnish texts.

42.48 \addto\extrasfinnish{\umlautlow\umlautelow}
42.49 \addto\noextrasfinnish{\umlauthigh}

First we define access to the low opening double quote and guillemets for quotations,

42.50 \declare@shorthand{finnish}{"`}{%
42.51 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
42.52 \declare@shorthand{finnish}{"'}{%
42.53 \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
42.54 \declare@shorthand{finnish}{"<}{%
42.55 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
42.56 \declare@shorthand{finnish}{">}{%
42.57 \textormath{\guillemotright}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behavew a little different from \-.

42.58 \declare@shorthand{finnish}{"-}{\nobreak-\bbl@allowhyphens}
42.59 \declare@shorthand{finnish}{""}{\hskip\z@skip}
42.60 \declare@shorthand{finnish}{"=}{\hbox{-}\allowhyphens}

And we want to have a shorthand for disabling a ligature.

42.61 \declare@shorthand{finnish}{"|}{%
42.62 \textormath{\discretionary{-}{}{\kern.03em}}{}}

\- 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.

42.63 \addto\extrasfinnish{\babel@save\-}
42.64 \addto\extrasfinnish{\def\-{\bbl@allowhyphens
42.65  \discretionary{-}{}{}\bbl@allowhyphens}}

\finishhyphenmins The finnish hyphenation patterns can be used with \lefthyphenmin set to 2 and

  \righthyphenmin set to 2.
42.66 \providehyphenmins{\CurrentOption}{\tw@\tw@}

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.

42.67 \ldf@finish{finnish}

42.68 ⟨/code⟩

43 The Hungarian language

The file option magyar.dtx defines all the language definition macros for the Hungarian language.

The babel support for the Hungarian language until file version 1.3i was essentially changing the English document elements to Hungarian ones, but because of the differences between these too languages this was actually unusable (‘Part I’ was transferred to ‘Rész I’ which is not usable instead of ‘I. rész’). To enhance the typesetting facilities for Hungarian the following should be considered:

• In Hungarian documents there is a period after the part, section, subsection etc. numbers.

• In the part, chapter, appendix name the number (or letter) goes before the name, so ‘Part I’ translates to ‘I. rész’.

• The same is true with captions (‘Table 2.1’ goes to ‘2.1. táblázat’).

• There is a period after the caption name instead of a colon. (‘Table 2.1:’ goes to ‘2.1. táblázat.’)

• There is a period at the end of the title in a run-in head (when afterskip<0

     in \@startsection).

• Special hyphenation rules must be applied for the so-called long double consonants (ccs, ssz,…).

• The opening quotation mark is like the German one (the closing is the same as in English).

• In Hungarian figure, table, etc. referencing a definite article is also incorporated. The Hungarian definite articles behave like the English indefinite ones (‘a/an’). ‘a’ is used for words beginning with a consonant and ‘az’ goes for a vowel. Since some numbers begin with a vowel some others with a consonant some commands should be provided for automatic definite article generation.

Until file version 1.3i^{52} the special typesetting rules of the Hungarian language mentioned above were not taken into consideration. This version (v1.4b)^{53} enables babel to typeset ‘good-looking’ Hungarian texts.

\ontoday The \ontoday command works like \today but produces a slightly different

date format used in expressions such as ‘on February 10th’. \Az The commands \Az#1 and \az#1 write the correct definite article for the ar-

gument and the argument itself (separated with a ~). The star-forms (\Az* and \az*) produce the article only.

\Azr \Azr#1 and \azr#1 treat the argument as a label so expand it then write the definite article for \r@#1, a non-breakable space then the label expansion. The star-forms do not print the label expansion. \Azr(#1 and \azr(#1 are used for equation referencing with the syntax \azr(label).

\Aref There are two aliases \Aref and \aref for \Azr and \azr, respectively.

52That file was last revised on 1996/12/23 with a contribution by the next authors: Attila Koppányi (attila@cernvm.cern.ch), Árpád Bíró (JZP1104@HUSZEG11.bitnet), István Hamecz (hami@ursus.bke.hu) and Dezső Horváth (horvath@pisa.infn.it).

53It was written by József Bérces (jozsi@docs4.mht.bme.hu) with some help from Ferenc Wettl (wettl@math.bme.hu) and an idea from David Carlisle (david@dcarlisle.demon.co.uk).

shortcut explanation  example

`` same as \glqq in babel, or

            \quotedblbase in T1 (open-

ing quotation mark, like „)

                                       ``id\'ezet''⟶„idézet’’

`c, `C  ccs is hyphenated as cs-cs  lo`ccsan⟶locs-csan
`d, `D  ddz is hyphenated as dz-dz  e`ddz\"unk⟶edz-dzünk
`g, `G  ggy is hyphenated as gy-gy  po`ggy\'asz⟶pogy-gyász
`l, `L  lly is hyphenated as ly-ly  Kod\'a`llyal⟶Kodály-lyal
`n, `N  nny is hyphenated as ny-ny me`nnyei⟶meny-nyei
`s, `S  ssz is hyphenated as sz-sz  vi`ssza⟶visz-sza
`t, `T  tty is hyphenated as ty-ty  po`ttyan⟶poty-tyan
`z, `Z  zzs is hyphenated as zs-zs  ri`zzsel⟶rizs-zsel

Table 20: The shortcuts defined in magyar.ldf

During the preparation of a document it is not known in general, if the code ‘a~\ref{label}’ or the code ‘az~\ref{label}’ is the grammatically correct one. Writing ‘\aref{label}’ instead of the previous ones solves the problem.

\Azp \Azp#1 and \azp#1 also treat the argument as a label but use the label’s page for definite article determination. There are star-forms giving only the definite article without the page number.

\Apageref  There are aliases \Apageref and \apageref for \Azp and \azp, respect-

ively. The code \apageref{label} is equivalent either to a~\pageref{label} or

to az~\pageref{label}.

\Azc \Azc and \azc work like the \cite command but (of course) they insert the definite article. There can be several comma separated cite labels and in that case the definite article is given for the first one. They accept \cite’s optional argument. There are star-forms giving the definite article only.

\Acite There are aliases \Acite and \acite for \Azc and \azc, respectively.

For this language the character ` is made active. Table 20 shows the shortcuts. The main reason for the activation of the ` character is to handle the special hyphenation of the long double consonants.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

43.1 ⟨∗code⟩

43.2 \LdfInit{magyar}{caption\CurrentOption}

When this file is read as an option, i.e. by the \usepackage command, magyar will be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@magyar or \l@hungarian to see whether we have to do something here.

43.3 \ifx\l@magyar\@undefined
43.4 \ifx\l@hungarian\@undefined
43.5  \@nopatterns{Magyar}
43.6  \adddialect\l@magyar0

43.7 \fi 43.8 \fi

43.9 \let\l@hungarian\l@magyar

The next step consists of defining commands to switch to (and from) the Hungarian language.

\captionsmagyar The macro \captionsmagyar defines all strings used in the four standard docu-

ment classes provided with L^{A}TEX.

43.10 \@namedef{captions\CurrentOption}{%
43.11 \def\prefacename{El\H osz\'o}%

For the list of references at the end of an article we have a choice between two words, ‘Referenciák’ (a Hungarian version of the English word) and ‘Hivatkozások’. The latter seems to be in more widespread use.

43.12 \def\refname{Hivatkoz\'asok}%

If you have a document with a summary instead of an abstract you might want to replace the word ‘Kivonat’ with ‘Összefoglaló’.

43.13 \def\abstractname{Kivonat}%

The Hungarian version of ‘Bibliography’ is ‘Bibliográfia’, but a more natural word to use is ‘Irodalomjegyzék’.

43.14 \def\bibname{Irodalomjegyz\'ek}%
43.15 \def\chaptername{fejezet}%
43.16 \def\appendixname{F\"uggel\'ek}%
43.17 \def\contentsname{Tartalomjegyz\'ek}%
43.18 \def\listfigurename{\'Abr\'ak jegyz\'eke}%
43.19 \def\listtablename{T\'abl\'azatok jegyz\'eke}%
43.20 \def\indexname{T\'argymutat\'o}%
43.21 \def\figurename{\'abra}%
43.22 \def\tablename{t\'abl\'azat}%
43.23 \def\partname{r\'esz}%
43.24 \def\enclname{Mell\'eklet}%
43.25 \def\ccname{K\"orlev\'el--c\'\i mzettek}%
43.26 \def\headtoname{C\'\i mzett}%
43.27 \def\pagename{oldal}%
43.28 \def\seename{l\'asd}%
43.29 \def\alsoname{l\'asd m\'eg}%

Besides the Hungarian word for Proof, ‘Bizonyítás’ we can also name Corollary (Következmény), Theorem (Tétel) and Lemma (Lemma).

43.30 \def\proofname{Bizony\'\i t\'as}%
43.31 \def\glossaryname{Glossary}% <-- Needs translation

43.32 }%

\datemagyar The macro \datemagyar redefines the command \today to produce Hungarian

dates.

43.33 \@namedef{date\CurrentOption}{%
43.34 \def\today{%
43.35  \number\year.~\ifcase\month\or
43.36  janu\'ar\or febru\'ar\or m\'arcius\or
43.37  \'aprilis\or m\'ajus\or j\'unius\or
43.38  j\'ulius\or augusztus\or szeptember\or
43.39  okt\'ober\or november\or december\fi
43.40  \space\number\day.}}

\ondatemagyar The macro \ondatemagyar produces Hungarian dates which have the meaning ‘on this day’. It does not redefine the command \today.

43.41 \@namedef{ondate\CurrentOption}{%
43.42 \number\year.~\ifcase\month\or
43.43 janu\'ar\or febru\'ar\or m\'arcius\or
43.44 \'aprilis\or m\'ajus\or j\'unius\or
43.45 j\'ulius\or augusztus\or szeptember\or
43.46 okt\'ober\or november\or december\fi
43.47  \space\ifcase\day\or
43.48  1-j\'en\or  2-\'an\or  3-\'an\or  4-\'en\or  5-\'en\or
43.49  6-\'an\or  7-\'en\or  8-\'an\or  9-\'en\or 10-\'en\or
43.50 11-\'en\or 12-\'en\or 13-\'an\or 14-\'en\or 15-\'en\or
43.51 16-\'an\or 17-\'en\or 18-\'an\or 19-\'en\or 20-\'an\or
43.52 21-\'en\or 22-\'en\or 23-\'an\or 24-\'en\or 25-\'en\or
43.53 26-\'an\or 27-\'en\or 28-\'an\or 29-\'en\or 30-\'an\or
43.54 31-\'en\fi}

\extrasmagyar \noextrasmagyar The macro \extrasmagyar will perform all the extra definitions needed for the Hungarian language. The macro \noextrasmagyar is used to cancel the actions

  of \extrasmagyar.
43.55 \@namedef{extras\CurrentOption}{%
43.56 \expandafter\let\expandafter\ontoday
43.57  \csname ondate\CurrentOption\endcsname}
43.58 \@namedef{noextras\CurrentOption}{\let\ontoday\@undefined}

Now we redefine some commands included into latex.ltx. The original form of a command is always saved with \babel@save and the changes are added to \extrasmagyar. This ensures that the Hungarian version of a macro is alive only if the Hungarian language is active.

\fnum@figure \fnum@table In figure and table captions the order of the figure/table number and \figurename

  /\tablename must be changed. To achieve this \fnum@figure and \fnum@table

are redefined and added to \extrasmagyar.

43.59 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.60 \babel@save\fnum@figure
43.61 \def\fnum@figure{\thefigure.~\figurename}}
43.62 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.63 \babel@save\fnum@table
43.64 \def\fnum@table{\thetable.~\tablename}}

\@makecaption The colon in a figure/table caption must be replaced by a dot by redefining

  \@makecaption.
43.65 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.66 \babel@save\@makecaption
43.67 \def\@makecaption#1#2{%
43.68  \vskip\abovecaptionskip
43.69  \sbox\@tempboxa{#1. #2}%
43.70  \ifdim \wd\@tempboxa >\hsize
43.71  {#1. #2\csname par\endcsname}
43.72  \else
43.73  \global \@minipagefalse
43.74  \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%

43.75 \fi

43.76  \vskip\belowcaptionskip}}

\@caption There should be a dot after the figure/table number in lof/lot, so \@caption is

redefined.

 43.77 \expandafter\addto\csname extras\CurrentOption\endcsname{%
 43.78 \babel@save\@caption
 43.79 \long\def\@caption#1[#2]#3{%
 43.80  \csname par\endcsname
 43.81  \addcontentsline{\csname ext@#1\endcsname}{#1}%
 43.82  {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
 43.83  \begingroup
 43.84  \@parboxrestore
 43.85  \if@minipage
 43.86  \@setminipage

43.87 \fi

 43.88  \normalsize
 43.89  \@makecaption{\csname fnum@#1\endcsname}%
 43.90  {\ignorespaces #3}\csname par\endcsname
 43.91  \endgroup}}

\@seccntformat In order to have a dot after the section number \@seccntformat is redefined.

 43.92 \expandafter\addto\csname extras\CurrentOption\endcsname{%
 43.93 \babel@save\@seccntformat
 43.94 \def\@seccntformat#1{\csname the#1\endcsname.\quad}}

\@sect 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.

 43.95 \expandafter\addto\csname extras\CurrentOption\endcsname{%
 43.96 \babel@save\@sect
 43.97 \def\@sect#1#2#3#4#5#6[#7]#8{%
 43.98  \ifnum #2>\c@secnumdepth
 43.99  \let\@svsec\@empty

43.100 \else

43.101  \refstepcounter{#1}%
43.102  \protected@edef\@svsec{\@seccntformat{#1}\relax}%

43.103 \fi

43.104  \@tempskipa #5\relax
43.105  \ifdim \@tempskipa>\z@
43.106  \begingroup

43.107 #6{%

43.108  \@hangfrom{\hskip #3\relax\@svsec}%
43.109  \interlinepenalty \@M #8\@@par}%
43.110  \endgroup
43.111  \csname #1mark\endcsname{#7}%
43.112  \addcontentsline{toc}{#1}{%
43.113  \ifnum #2>\c@secnumdepth \else
43.114  \protect\numberline{\csname the#1\endcsname.}%

43.115 \fi 43.116 #7}% 43.117 \else

43.118  \def\@svsechd{%
43.119  #6{\hskip #3\relax
43.120  \@svsec #8.}%
43.121  \csname #1mark\endcsname{#7}%
43.122  \addcontentsline{toc}{#1}{%
43.123  \ifnum #2>\c@secnumdepth \else

43.124  \protect\numberline{\csname the#1\endcsname.}%

43.125 \fi 43.126 #7}}% 43.127 \fi

43.128  \@xsect{#5}}}

\@ssect 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.

43.129 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.130 \babel@save\@ssect
43.131 \def\@ssect#1#2#3#4#5{%
43.132  \@tempskipa #3\relax
43.133  \ifdim \@tempskipa>\z@
43.134  \begingroup

43.135 #4{%

43.136  \@hangfrom{\hskip #1}%
43.137  \interlinepenalty \@M #5\@@par}%
43.138  \endgroup

43.139 \else

43.140  \def\@svsechd{#4{\hskip #1\relax #5.}}%

43.141 \fi

43.142  \@xsect{#3}}}

\@begintheorem \@opargbegintheorem Order changing and dot insertion in theorem by redefining \@begintheorem and

   \@opargbegintheorem.
43.143 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.144 \babel@save\@begintheorem
43.145 \def\@begintheorem#1#2{\trivlist
43.146  \item[\hskip \labelsep{\bfseries #2.\ #1.}]\itshape}
43.147 \babel@save\@opargbegintheorem
43.148 \def\@opargbegintheorem#1#2#3{\trivlist
43.149  \item[\hskip \labelsep{\bfseries #2.\ #1\ (#3).}]\itshape}}

The next step is to redefine some macros included into the class files. It is determined which class file is loaded then the original form of the macro is saved and the changes are added to \extrasmagyar.

First we check if the book.cls is loaded.

43.150 \@ifclassloaded{book}{%

\ps@headings The look of the headings is changed: we have to insert some dots and change the

order of chapter number and \chaptername.

43.151 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.152  \babel@save\ps@headings}
43.153 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.154  \if@twoside
43.155  \def\ps@headings{%
43.156  \let\@oddfoot\@empty\let\@evenfoot\@empty
43.157  \def\@evenhead{\thepage\hfil\slshape\leftmark}%
43.158  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
43.159  \let\@mkboth\markboth
43.160  \def\chaptermark##1{%
43.161  \markboth {\MakeUppercase{%
43.162  \ifnum \c@secnumdepth >\m@ne

43.163  \if@mainmatter
43.164  \thechapter. \@chapapp. \ %

43.165 \fi 43.166 \fi

43.167  ##1}}{}}%
43.168  \def\sectionmark##1{%
43.169  \markright {\MakeUppercase{%
43.170  \ifnum \c@secnumdepth >\z@
43.171  \thesection. \ %

43.172 \fi

43.173  ##1}}}}

43.174 \else

43.175  \def\ps@headings{%
43.176  \let\@oddfoot\@empty
43.177  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
43.178  \let\@mkboth\markboth
43.179  \def\chaptermark##1{%
43.180  \markright {\MakeUppercase{%
43.181  \ifnum \c@secnumdepth >\m@ne
43.182  \if@mainmatter
43.183  \thechapter. \@chapapp. \ %

43.184 \fi 43.185 \fi

43.186  ##1}}}}

43.187 \fi}

\@part At the beginning of a part we need eg. ‘I. rész’ instead of ‘Part I’ (in toc too). To

achieve this \@part is redefined.

43.188 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.189  \babel@save\@part
43.190  \def\@part[#1]#2{%
43.191  \ifnum \c@secnumdepth >-2\relax
43.192  \refstepcounter{part}%
43.193  \addcontentsline{toc}{part}{\thepart.\hspace{1em}#1}%

43.194 \else

43.195  \addcontentsline{toc}{part}{#1}%

43.196 \fi

43.197  \markboth{}{}%
43.198  {\centering
43.199  \interlinepenalty \@M
43.200  \normalfont
43.201  \ifnum \c@secnumdepth >-2\relax
43.202  \huge\bfseries \thepart.~\partname
43.203  \csname par\endcsname
43.204  \vskip 20\p@

43.205 \fi

43.206  \Huge \bfseries #2\csname par\endcsname}%
43.207  \@endpart}}

\@chapter The same changes are made to chapter. First the screen typeout and the toc are

changed by redefining \@chapter.

43.208 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.209  \babel@save\@chapter
43.210  \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne

43.211  \if@mainmatter
43.212  \refstepcounter{chapter}%
43.213  \typeout{\thechapter.\space\@chapapp.}%
43.214  \addcontentsline{toc}{chapter}%
43.215  {\protect\numberline{\thechapter.}#1}%

43.216 \else

43.217  \addcontentsline{toc}{chapter}{#1}%

43.218 \fi 43.219 \else

43.220  \addcontentsline{toc}{chapter}{#1}%

43.221 \fi

43.222  \chaptermark{#1}%
43.223  \addtocontents{lof}{\protect\addvspace{10\p@}}%
43.224  \addtocontents{lot}{\protect\addvspace{10\p@}}%
43.225  \if@twocolumn
43.226  \@topnewpage[\@makechapterhead{#2}]%

43.227 \else

43.228  \@makechapterhead{#2}%
43.229  \@afterheading

43.230 \fi}}

\@makechapterhead Then the look of the chapter-start is modified by redefining \@makechapterhead.

43.231 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.232  \babel@save\@makechapterhead
43.233  \def\@makechapterhead#1{%
43.234  \vspace*{50\p@}%
43.235  {\parindent \z@ \raggedright \normalfont
43.236  \ifnum \c@secnumdepth >\m@ne
43.237  \if@mainmatter
43.238  \huge\bfseries \thechapter.~\@chapapp{}
43.239  \csname par\endcsname\nobreak
43.240  \vskip 20\p@

43.241 \fi 43.242 \fi

43.243  \interlinepenalty\@M
43.244  \Huge \bfseries #1\csname par\endcsname\nobreak
43.245  \vskip 40\p@

43.246 }}}%

This the end of the book class modification.

43.247 }{}

Now we check if report.cls is loaded.

43.248 \@ifclassloaded{report}{%

\ps@headings First the headings are modified just in case of the book class.

43.249 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.250  \babel@save\ps@headings}
43.251 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.252  \if@twoside
43.253  \def\ps@headings{%
43.254  \let\@oddfoot\@empty\let\@evenfoot\@empty
43.255  \def\@evenhead{\thepage\hfil\slshape\leftmark}%
43.256  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%

43.257  \let\@mkboth\markboth
43.258  \def\chaptermark##1{%
43.259  \markboth {\MakeUppercase{%
43.260  \ifnum \c@secnumdepth >\m@ne
43.261  \thechapter. \@chapapp. \ %

43.262 \fi

43.263  ##1}}{}}%
43.264  \def\sectionmark##1{%
43.265  \markright {\MakeUppercase{%
43.266  \ifnum \c@secnumdepth >\z@
43.267  \thesection. \ %

43.268 \fi

43.269  ##1}}}}

43.270 \else

43.271  \def\ps@headings{%
43.272  \let\@oddfoot\@empty
43.273  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
43.274  \let\@mkboth\markboth
43.275  \def\chaptermark##1{%
43.276  \markright {\MakeUppercase{%
43.277  \ifnum \c@secnumdepth >\m@ne
43.278  \thechapter. \@chapapp. \ %

43.279 \fi

43.280  ##1}}}}

43.281 \fi}

\@chapter Chapter-start modification with \@chapter

43.282 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.283  \babel@save\@chapter
43.284  \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
43.285  \refstepcounter{chapter}%
43.286  \typeout{\thechapter.\space\@chapapp.}%
43.287  \addcontentsline{toc}{chapter}%
43.288  {\protect\numberline{\thechapter.}#1}%

43.289 \else

43.290  \addcontentsline{toc}{chapter}{#1}%

43.291 \fi

43.292  \chaptermark{#1}%
43.293  \addtocontents{lof}{\protect\addvspace{10\p@}}%
43.294  \addtocontents{lot}{\protect\addvspace{10\p@}}%
43.295  \if@twocolumn
43.296  \@topnewpage[\@makechapterhead{#2}]%

43.297 \else

43.298  \@makechapterhead{#2}%
43.299  \@afterheading

43.300 \fi}}

\@makechapterhead and \@makechapterhead.
43.301 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.302  \babel@save\@makechapterhead
43.303  \def\@makechapterhead#1{%
43.304  \vspace*{50\p@}%
43.305  {\parindent \z@ \raggedright \normalfont
43.306  \ifnum \c@secnumdepth >\m@ne

43.307  \huge\bfseries \thechapter.~\@chapapp{}
43.308  \csname par\endcsname\nobreak
43.309  \vskip 20\p@

43.310 \fi

43.311  \interlinepenalty\@M
43.312  \Huge \bfseries #1\csname par\endcsname\nobreak
43.313  \vskip 40\p@

43.314 }}}%

End of report class modification.

43.315 }{}

Checking if article.cls is loaded.

43.316 \@ifclassloaded{article}{%

\ps@headings Changing headings by redefining \ps@headings.

43.317 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.318  \babel@save\ps@headings}
43.319 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.320  \if@twoside
43.321  \def\ps@headings{%
43.322  \let\@oddfoot\@empty\let\@evenfoot\@empty
43.323  \def\@evenhead{\thepage\hfil\slshape\leftmark}%
43.324  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
43.325  \let\@mkboth\markboth
43.326  \def\sectionmark##1{%
43.327  \markboth {\MakeUppercase{%
43.328  \ifnum \c@secnumdepth >\z@
43.329  \thesection.\quad

43.330 \fi

43.331  ##1}}{}}%
43.332  \def\subsectionmark##1{%
43.333  \markright {%
43.334  \ifnum \c@secnumdepth >\@ne
43.335  \thesubsection.\quad

43.336 \fi

43.337  ##1}}}

43.338 \else

43.339  \def\ps@headings{%
43.340  \let\@oddfoot\@empty
43.341  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
43.342  \let\@mkboth\markboth
43.343  \def\sectionmark##1{%
43.344  \markright {\MakeUppercase{%
43.345  \ifnum \c@secnumdepth >\m@ne
43.346  \thesection.\quad

43.347 \fi

43.348  ##1}}}}

43.349 \fi}%

No more necessary changes specific to the article class.

43.350 }{}

And now this is the turn of letter.cls.

43.351 \@ifclassloaded{letter}{%

\ps@headings In the headings the page number must be followed by a dot and then \pagename.

43.352 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.353  \babel@save\ps@headings}
43.354 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.355  \if@twoside
43.356  \def\ps@headings{%
43.357  \let\@oddfoot\@empty\let\@evenfoot\@empty
43.358  \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
43.359  \hfil \@date
43.360  \hfil \thepage.~\pagename}%
43.361  \let\@evenhead\@oddhead}

43.362 \else

43.363  \def\ps@headings{%
43.364  \let\@oddfoot\@empty
43.365  \def\@oddhead{\slshape\headtoname{:} \ignorespaces\toname
43.366  \hfil \@date
43.367  \hfil \thepage.~\pagename}}

43.368 \fi}%

End of letter class.

43.369 }{}

After making the changes to the L^{A}TEX macros we define some new ones to handle the problem with definite articles.

\az \az is a user-level command which decides if the next character is a star. \@az is

called for \az* and \az@ for \az.

43.370 \def\az{a\@ifstar{\@az}{\az@}}

\Az \Az is used at the beginning of a sentence. Otherwise it behaves the same as \az.

43.371 \def\Az{A\@ifstar{\@az}{\az@}}

\az@ \az@ is called if there is no star after \az or \Az. It calls \@az and writes #1

separating with a non-breakable space.

43.372 \def\az@#1{\@az{#1}~#1}

\@az This macro calls \hun@tempadef to remove the accents from the argument then calls \@@az that determines if a ‘z’ should be written after a/A (written by

\az/\Az).
43.373 \def\@az#1{%
43.374 \hun@tempadef{relax}{relax}{#1}%
43.375 \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
43.376 \@tempb}
\hun@tempadef The macro \hun@tempadef has three tasks:

• Accent removal. Accented letters confuse \@@az, the main definite article determinator macro, so they must be changed to their non-accented counterparts. Special letters must also be changed, eg. œ → o.

• Labels must be expanded.

• To handle Roman numerals correctly, commands starting with \hun@ are defined for labels containing Roman numbers with the Roman numerals replaced by their Arabic representation. This macro can check if there is a \hun@ command.

There are three arguments:

1. The primary command that should be expanded if it exists. This is usually the \hun@ command for a label.

2. The secondary command which is used if the first one is \relax. This is usually the original L^{A}TEX command for a label.

3. This is used if the first two is \relax. For this one no expansion is carried out but the accents are still removed and special letters are changed.

43.377 \def\hun@tempadef#1#2#3{%
43.378 \begingroup
43.379  \def\setbox ##1{}% to get rid of accents and special letters
43.380  \def\hbox ##1{}%
43.381  \def\accent ##1 ##2{##2}%
43.382  \def\add@accent ##1##2{##2}%
43.383  \def\@text@composite@x ##1##2{##2}%
43.384  \def\i{i}\def\j{j}%
43.385  \def\ae{a}\def\AE{A}\def\oe{o}\def\OE{O}%
43.386  \def\ss{s}\def\L{L}%
43.387  \def\d{}\def\b{}\def\c{}\def\t{}%
43.388  \expandafter\ifx\csname #1\endcsname\relax
43.389  \expandafter\ifx\csname #2\endcsname\relax
43.390  \xdef\@tempa{#3}%

43.391 \else

43.392  \xdef\@tempa{\csname #2\endcsname}%

43.393 \fi 43.394 \else

43.395  \xdef\@tempa{\csname #1\endcsname}%

43.396 \fi

43.397 \endgroup}

The following macros are used to determine the definite article for a label’s expansion.

\aref  \aref is an alias for \azr.
43.398 \def\aref{\azr}
\Aref  \Aref is an alias for \Azr.
43.399 \def\Aref{\Azr}

\azr \azr calls \@azr if the next character is a star, otherwise it calls \azr@.

43.400 \def\azr{a\@ifstar{\@azr}{\azr@}}

\Azr \Azr is the same as \azr except that it writes ‘A’ instead of ‘a’.

43.401 \def\Azr{A\@ifstar{\@azr}{\azr@}}

\azr@ \azr@ decides if the next character is ( and in that case it calls \azr@@@ which

writes an extra ( for equation referencing. Otherwise \azr@@ is called.

43.402 \def\azr@{\@ifnextchar ({\azr@@@}{\azr@@}}

\azr@@ Calls \@azr then writes the label’s expansion preceded by a non-breakable space.

43.403 \def\azr@@#1{\@azr{#1}~\ref{#1}}

\azr@@@ Same as \azr@@ but inserts a ( between the non-breakable space and the label

expansion.

43.404 \def\azr@@@(#1{\@azr{#1}~(\ref{#1}}

\@azr Calls \hun@tempadef to choose between the label’s \hun@ or original L^{A}TEX command and to expand it with accent removal and special letter substitution. Then calls \@@az, the core macro of definite article handling.

43.405 \def\@azr#1{%
43.406 \hun@tempadef{hun@r@#1}{r@#1}{}%
43.407 \ifx\@tempa\empty

43.408 \else

43.409  \edef\@tempb{\noexpand\@@az\expandafter\@firstoftwo\@tempa\hbox!}%
43.410  \@tempb

43.411 \fi 43.412 }

The following commands are used to generate the definite article for the page number of a label.

\apageref  \apageref is an alias for \azp.
43.413 \def\apageref{\azp}
\Apageref  \Apageref is an alias for \Azp.
43.414 \def\Apageref{\Azp}

\azp Checks if the next character is * and calls \@azp or \azp@.

43.415 \def\azp{a\@ifstar{\@azp}{\azp@}}

\Azp Same as \azp except that it writes ‘A’ instead of ‘a’.

43.416 \def\Azp{A\@ifstar{\@azp}{\azp@}}

\azp@ Calls \@azp then writes the label’s page preceded by a non-breakable space.

43.417 \def\azp@#1{\@azp{#1}~\pageref{#1}}

\@azp Calls \hun@tempadef then takes the label’s page and passes it to \@@az.

43.418 \def\@azp#1{%
43.419 \hun@tempadef{hun@r@#1}{r@#1}{}%
43.420 \ifx\@tempa\empty

43.421 \else

43.422  \edef\@tempb{\noexpand\@@az\expandafter\@secondoftwo\@tempa\hbox!}%
43.423  \@tempb

43.424 \fi 43.425 }

The following macros are used to give the definite article to citations.

\acite This is an alias for \azc.

43.426 \def\acite{\azc}

\Acite This is an alias for \Azc.

43.427 \def\Acite{\Azc}

\azc Checks if the next character is a star and calls \@azc or \azc@.

43.428 \def\azc{a\@ifstar{\@azc}{\azc@}}

\Azc Same as \azc but used at the beginning of sentences.

43.429 \def\Azc{A\@ifstar{\@azc}{\azc@}}

\azc@ If there is no star we accept an optional argument, just like the \cite command.

43.430 \def\azc@{\@ifnextchar [{\azc@@}{\azc@@[]}}
\azc@@ First calls \@azc then \cite.
43.431 \def\azc@@[#1]#2{%
43.432 \@azc{#2}~\def\@tempa{#1}%
43.433  \ifx\@tempa\@empty\cite{#2}\else\cite[#1]{#2}\fi}

\@azc This is an auxiliary macro to get the first cite label from a comma-separated list.

43.434 \def\@azc#1{\@@azc#1,\hbox!}

\@@azc This one uses only the first argument, that is the first element of the commaseparated list of cite labels. Calls \hun@tempadef to expand the cite label with accent removal and special letter replacement. Then \@@az, the core macro, is called.

43.435 \def\@@azc#1,#2\hbox#3!{%
43.436 \hun@tempadef{hun@b@#1}{b@#1}{}%
43.437 \ifx\@tempa\empty

43.438 \else

43.439  \edef\@tempb{\noexpand\@@az\@tempa\hbox!}%
43.440  \@tempb

43.441 \fi}

\hun@number@lehgth This macro is used to count the number of digits in its argument until a non-digit character is found or the end of the argument is reached. It must be called as

\hun@number@lehgtharg\hbox\hbox! and \count@ must be zeroed. It is called
by \@@az.
43.442 \def\hun@number@lehgth#1#2\hbox#3!{%
43.443 \ifcat\noexpand#11%
43.444  \ifnum\expandafter`\csname#1\endcsname>47
43.445  \ifnum\expandafter`\csname#1\endcsname<58
43.446  \advance\count@ by \@ne
43.447  \hun@number@lehgth#2\hbox\hbox!\fi\fi\fi}

\hun@alph@lehgth This is used to count the number of letters until a non-letter is found or the end of the argument is reached. It must be called as \hun@alph@lehgtharg\hbox\hbox! and \count@ must be set to zero. It is called by \@@az@string.

43.448 \def\hun@alph@lehgth#1#2\hbox#3!{%
43.449 \ifcat\noexpand#1A%
43.450  \advance\count@ by \@ne
43.451  \hun@alph@lehgth#2\hbox\hbox!\fi}

\@@az@string This macro is called by \@@az if the argument begins with a letter. The task of \@@az@string is to determine if the argument starts with a vowel and in that case \let\@tempa\@tempb. After checking if the first letter is A, E, I, O, or U, \hun@alph@lehgth is called to determine the length of the argument. If it gives 1 (that is the argument is a single-letter one or the second character is not letter) then the letters L, M, N, R, S, X, and Y are also considered as a vowel since their Hungarian pronounced name starts with a vowel.

43.452 \def\@@az@string#1#2{%
43.453 \ifx#1A%
43.454  \let\@tempa\@tempb
43.455 \else\ifx#1E%
43.456  \let\@tempa\@tempb
43.457 \else\ifx#1I%
43.458  \let\@tempa\@tempb
43.459 \else\ifx#1O%
43.460  \let\@tempa\@tempb
43.461 \else\ifx#1U%
43.462  \let\@tempa\@tempb
43.463 \fi\fi\fi\fi\fi
43.464 \ifx\@tempa\@tempb

43.465 \else

43.466  \count@\z@
43.467  \hun@alph@lehgth#1#2\hbox\hbox!%
43.468  \ifnum\count@=\@ne
43.469  \ifx#1F%
43.470  \let\@tempa\@tempb
43.471  \else\ifx#1L%
43.472  \let\@tempa\@tempb
43.473  \else\ifx#1M%
43.474  \let\@tempa\@tempb
43.475  \else\ifx#1N%
43.476  \let\@tempa\@tempb
43.477  \else\ifx#1R%
43.478  \let\@tempa\@tempb
43.479  \else\ifx#1S%
43.480  \let\@tempa\@tempb
43.481  \else\ifx#1X%
43.482  \let\@tempa\@tempb
43.483  \else\ifx#1Y%
43.484  \let\@tempa\@tempb
43.485  \fi\fi\fi\fi\fi\fi\fi\fi

43.486 \fi 43.487 \fi}

\@@az This macro is the core of definite article handling. It determines if the argument needs ‘az’ or ‘a’ definite article by setting \@tempa to ‘z’ or \@empty. It sets

\@tempa to ‘z’ if

• the first character of the argument is 5; or

• the first character of the argument is 1 and the length of the number (mod 3) = 1 (one–egy, thousand–ezer, million–egymillió,…); or

• the first character of the argument is a, A, e, E, i, I, o, O, u, or U; or • the first character of the argument is l, L, m, M, n, N, r, R, s, S, x, X, y, or Y and the length of the argument is 1 or the second character is a non-letter.

At the end it calls \@tempa, that is, it either typesets a ‘z’ or nothing.

43.488 \def\@@az#1#2\hbox#3!{%
43.489 \let\@tempa\@empty
43.490 \def\@tempb{z}%
43.491 \uppercase{%
43.492  \ifx5#1%
43.493  \let\@tempa\@tempb
43.494  \else\ifx1#1%
43.495  \count@\@ne
43.496  \hun@number@lehgth#2\hbox\hbox!%

43.497 \loop

43.498  \ifnum\count@>\thr@@
43.499  \advance\count@-\thr@@
43.500  \repeat
43.501  \ifnum\count@=\@ne
43.502  \let\@tempa\@tempb

43.503 \fi 43.504 \else

43.505  \@@az@string{#1}{#2}%
43.506  \fi\fi

43.507 }%

43.508 \@tempa}
\refstepcounter  \refstepcounter must be redefined in order to keep \@currentlabel unexpan-

ded. This is necessary to enable the \label command to write a \hunnewlabel command to the aux file with the Roman numerals substituted by their Arabic representations. Of course, the original definition of \refstepcounter is saved and restored if the Hungarian language is switched off.

43.509 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.510 \babel@save\refstepcounter
43.511 \def\refstepcounter#1{\stepcounter{#1}%
43.512  \def\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}}%

43.513 }

\label \label is redefined to write another line into the aux file: \hunnewlabel{ }{ } where the Roman numerals are replaced their Arabic representations. The original definition of \label is saved into \old@label and it is also called by \label. On leaving the Hungarian typesetting mode \label’s original is restored since it is

   added to \noextrasmagyar.
43.514 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.515 \let\old@label\label
43.516 \def\label#1{\@bsphack
43.517  \old@label{#1}%
43.518  \begingroup
43.519  \let\romannumeral\number
43.520  \def\@roman##1{\number ##1}%
43.521  \def\@Roman##1{\number ##1}%
43.522  {\toks0={\noexpand\noexpand\noexpand\number}%
43.523  \def\number##1{\the\toks0 ##1}\xdef\tempb@{\thepage}}%
43.524  \edef\@tempa##1{\noexpand\protected@write\@auxout{}%

43.525  {\noexpand\string\noexpand\hunnewlabel
43.526  {##1}{{\@currentlabel}{\tempb@}}}}%
43.527  \@tempa{#1}%
43.528  \endgroup
43.529 \@esphack}%

43.530 }

43.531 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
43.532 \let\label\old@label

43.533 }

\hunnewlabel Finally, \hunnewlabel is defined. It checks if the label’s expansion (#2) differs from that one given in the \newlabel command. If yes (that is, the label contains some Roman numerals), it defines the macro \hun@r@label, otherwise it does nothing.

43.534 \def\hunnewlabel#1#2{%
43.535 \def\@tempa{#2}%
43.536 \expandafter\ifx\csname r@#1\endcsname\@tempa
43.537  \relax% \message{No need for def: #1}%

43.538 \else

43.539  \global\expandafter\let\csname hun@r@#1\endcsname\@tempa%

43.540 \fi 43.541 }

For Hungarian the ` character is made active.

43.542 \initiate@active@char{`}
43.543 \expandafter\addto\csname extras\CurrentOption\endcsname{%
43.544 \languageshorthands{magyar}%
43.545 \bbl@activate{`}}
43.546 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
43.547 \bbl@deactivate{`}}

The character sequence `` is declared as a shorthand in order to produce the opening quotation sign appropriate for Hungarian.

43.548 \declare@shorthand{magyar}{``}{\glqq}

In Hungarian there are some long double consonants which must be hyphenated specially. For all these long double consonants (except dzzs, that is extremely very-very rare) a shortcut is defined.

43.549 \declare@shorthand{magyar}{`c}{\textormath{\bbl@disc{c}{cs}}{c}}
43.550 \declare@shorthand{magyar}{`C}{\textormath{\bbl@disc{C}{CS}}{C}}
43.551 \declare@shorthand{magyar}{`d}{\textormath{\bbl@disc{d}{dz}}{d}}
43.552 \declare@shorthand{magyar}{`D}{\textormath{\bbl@disc{D}{DZ}}{D}}
43.553 \declare@shorthand{magyar}{`g}{\textormath{\bbl@disc{g}{gy}}{g}}
43.554 \declare@shorthand{magyar}{`G}{\textormath{\bbl@disc{G}{GY}}{G}}
43.555 \declare@shorthand{magyar}{`l}{\textormath{\bbl@disc{l}{ly}}{l}}
43.556 \declare@shorthand{magyar}{`L}{\textormath{\bbl@disc{L}{LY}}{L}}
43.557 \declare@shorthand{magyar}{`n}{\textormath{\bbl@disc{n}{ny}}{n}}
43.558 \declare@shorthand{magyar}{`N}{\textormath{\bbl@disc{N}{NY}}{N}}
43.559 \declare@shorthand{magyar}{`s}{\textormath{\bbl@disc{s}{sz}}{s}}
43.560 \declare@shorthand{magyar}{`S}{\textormath{\bbl@disc{S}{SZ}}{S}}
43.561 \declare@shorthand{magyar}{`t}{\textormath{\bbl@disc{t}{ty}}{t}}
43.562 \declare@shorthand{magyar}{`T}{\textormath{\bbl@disc{T}{TY}}{T}}
43.563 \declare@shorthand{magyar}{`z}{\textormath{\bbl@disc{z}{zs}}{z}}
43.564 \declare@shorthand{magyar}{`Z}{\textormath{\bbl@disc{Z}{ZS}}{Z}}

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.

43.565 \ldf@finish\CurrentOption

43.566 ⟨/code⟩

44 The Estonian language

The file estonian.dtx^{54} 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 germanb.ldf and spanish.ldf.

Estonian has the same umlauts as German (ä, ö, ü), but in addition to this, we have also õ, and two recent characters š and ž, 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 21. These active accent

~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);
"| 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 Estonian low left double quotes (same as Ger-

man);

"' for Estonian right double quotes;
"< for French left double quotes (also rather popular)
"> for French right double quotes.

Table 21: The extra definitions made by estonian.ldf

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.

We support also the T1 output encoding (and Cork-encoded text input). You can choose the T1 encoding by the command \usepackage[T1]{fontenc}. This package must be loaded before babel. As the standard Estonian hyphenation file eehyph.tex is in the Cork encoding, choosing this encoding will give you better hyphenation.

As mentioned in the Spanish style file, it may happen that some packages fail (usually in a \message). In this case you should change the order of the \usepackage declarations or the order of the style options in \documentclass.

44.1 Implementation

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

44.1 ⟨∗code⟩

54The file described in this section has version number v1.0h and was last revised on 2001/01/30. The original author is Enn Saar, (saar@aai.ee).

 44.2 \LdfInit{estonian}\captionsestonian

If Estonian is not included in the format file (does not have hyphenation patterns), we shall use English hyphenation.

 44.3 \ifx\l@estonian\@undefined
 44.4 \@nopatterns{Estonian}
 44.5 \adddialect\l@estonian0

44.6 \fi

Now come the commands to switch to (and from) Estonian.

\captionsestonian The macro \captionsestonian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 44.7 \addto\captionsestonian{%
 44.8 \def\prefacename{Sissejuhatus}%
 44.9 \def\refname{Viited}%
44.10 \def\bibname{Kirjandus}%
44.11 \def\appendixname{Lisa}%
44.12 \def\contentsname{Sisukord}%
44.13 \def\listfigurename{Joonised}%
44.14 \def\listtablename{Tabelid}%
44.15 \def\indexname{Indeks}%
44.16 \def\figurename{Joonis}%
44.17 \def\tablename{Tabel}%
44.18 \def\partname{Osa}%
44.19 \def\enclname{Lisa(d)}%
44.20 \def\ccname{Koopia(d)}%
44.21 \def\headtoname{}%
44.22 \def\pagename{Lk.}%
44.23 \def\seename{vt.}%
44.24 \def\alsoname{vt. ka}%
44.25 \def\proofname{Korrektuur}%
44.26 \def\glossaryname{Glossary}% <-- Needs translation

44.27 }

These captions contain accented characters.

44.28 \begingroup \catcode`\"\active
44.29 \def\x{\endgroup
44.30 \addto\captionsestonian{%
44.31 \def\abstractname{Kokkuv~ote}%
44.32 \def\chaptername{Peat"ukk}}}

44.33 \x

\dateestonian The macro \dateestonian redefines the command \today to produce Estonian

dates.

44.34 \begingroup \catcode`\"\active
44.35 \def\x{\endgroup
44.36 \def\month@estonian{\ifcase\month\or
44.37  jaanuar\or veebruar\or m"arts\or aprill\or mai\or juuni\or
44.38  juuli\or august\or september\or oktoober\or november\or
44.39  detsember\fi}}

44.40 \x

44.41 \def\dateestonian{%
44.42 \def\today{\number\day.\space\month@estonian
44.43  \space\number\year.\space a.}}

\extrasestonian \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).

44.44 \initiate@active@char{"}
44.45 \initiate@active@char{~}
44.46 \addto\extrasestonian{\languageshorthands{estonian}}
44.47 \addto\extrasestonian{\bbl@activate{"}\bbl@activate{~}}

Store the original macros, and redefine accents.

44.48 \addto\extrasestonian{\babel@save\"\umlautlow\babel@save\~\tildelow}

Estonian does not use extra spaces after sentences.

44.49 \addto\extrasestonian{\bbl@frenchspacing}
44.50 \addto\noextrasestonian{\bbl@nonfrenchspacing}
\estonianhyphenmins For Estonian, \lefthyphenmin and \righthyphenmin are both 2.
44.51 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\tildelow \gentilde \newtilde \newcheck The standard TEX accents are too high for Estonian typography, we have to lower them (following the babel German style). For a detailed explanation see the file

  glyphs.dtx.
44.52 \def\tildelow{\def\~{\protect\gentilde}}
44.53 \def\gentilde#1{\if#1o\newtilde{#1}\else\if#1O\newtilde{#1}%
44.54  \else\newcheck{#1}%
44.55  \fi\fi}
44.56 \def\newtilde#1{\leavevmode\allowhyphens
44.57 {\U@D 1ex%
44.58 {\setbox\z@\hbox{\char126}\dimen@ -.45ex\advance\dimen@\ht\z@
44.59 \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
44.60 \accent126\fontdimen5\font\U@D #1}\allowhyphens}
44.61 \def\newcheck#1{\leavevmode\allowhyphens
44.62 {\U@D 1ex%
44.63 {\setbox\z@\hbox{\char20}\dimen@ -.45ex\advance\dimen@\ht\z@
44.64 \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
44.65 \accent20\fontdimen5\font\U@D #1}\allowhyphens}

We save the double quote character in \dq, and tilde in \til, and store the original definitions of \" and ~ as \dieresis and \texttilde.

44.66 \begingroup \catcode`\"12
44.67 \edef\x{\endgroup
44.68 \def\noexpand\dq{"}
44.69 \def\noexpand\til{~}}

44.70 \x

44.71 \let\dieresis\"
44.72 \let\texttilde\~

This part follows closely spanish.ldf. We check the encoding and if it is T1, we have to tell TEX about our redefined accents.

44.73 \ifx\f@encoding\bbl@t@one
44.74 \let\@umlaut\dieresis
44.75 \let\@tilde\texttilde

44.76 \DeclareTextComposite{\~}{T1}{s}{178}
44.77 \DeclareTextComposite{\~}{T1}{S}{146}
44.78 \DeclareTextComposite{\~}{T1}{z}{186}
44.79 \DeclareTextComposite{\~}{T1}{Z}{154}
44.80 \DeclareTextComposite{\"}{T1}{'}{17}
44.81 \DeclareTextComposite{\"}{T1}{`}{18}
44.82 \DeclareTextComposite{\"}{T1}{<}{19}
44.83 \DeclareTextComposite{\"}{T1}{>}{20}

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.

44.84 \else
44.85 \wlog{Warning: Hyphenation would work better for the T1 encoding.}
44.86 \let\@umlaut\newumlaut
44.87 \let\@tilde\gentilde

44.88 \fi

Now we define the shorthands.

44.89 \declare@shorthand{estonian}{"a}{\textormath{\"{a}}{\ddot a}}
44.90 \declare@shorthand{estonian}{"A}{\textormath{\"{A}}{\ddot A}}
44.91 \declare@shorthand{estonian}{"o}{\textormath{\"{o}}{\ddot o}}
44.92 \declare@shorthand{estonian}{"O}{\textormath{\"{O}}{\ddot O}}
44.93 \declare@shorthand{estonian}{"u}{\textormath{\"{u}}{\ddot u}}
44.94 \declare@shorthand{estonian}{"U}{\textormath{\"{U}}{\ddot U}}

german and french quotes,

44.95 \declare@shorthand{estonian}{"`}{%
44.96 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
44.97 \declare@shorthand{estonian}{"'}{%
44.98 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
44.99 \declare@shorthand{estonian}{"<}{%
44.100 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
44.101 \declare@shorthand{estonian}{">}{%
44.102 \textormath{\guillemotright}{\mbox{\guillemotright}}}
44.103 \declare@shorthand{estonian}{~o}{\textormath{\@tilde o}{\tilde o}}
44.104 \declare@shorthand{estonian}{~O}{\textormath{\@tilde O}{\tilde O}}
44.105 \declare@shorthand{estonian}{~s}{\textormath{\@tilde s}{\check s}}
44.106 \declare@shorthand{estonian}{~S}{\textormath{\@tilde S}{\check S}}
44.107 \declare@shorthand{estonian}{~z}{\textormath{\@tilde z}{\check z}}
44.108 \declare@shorthand{estonian}{~Z}{\textormath{\@tilde Z}{\check Z}}

and some additional commands:

44.109 \declare@shorthand{estonian}{"-}{\nobreak\-\bbl@allowhyphens}
44.110 \declare@shorthand{estonian}{"|}{%
44.111 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
44.112  \allowhyphens}{}}
44.113 \declare@shorthand{estonian}{""}{\dq}
44.114 \declare@shorthand{estonian}{~~}{\til}

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.

44.115 \ldf@finish{estonian}

44.116 ⟨/code⟩

45 The Croatian language

The file croatian.dtx^{55} defines all the language definition macros for the Croatian language.

For this language currently no special definitions are needed or available. The macro \LdfInit takes care of preventing that this file is loaded more than

once, checking the category code of the @ sign, etc.

45.1 ⟨∗code⟩

 45.2 \LdfInit{croatian}\captionscroatian

When this file is read as an option, i.e. by the \usepackage command, 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.

 45.3 \ifx\l@croatian\@undefined
 45.4  \@nopatterns{Croatian}
 45.5  \adddialect\l@croatian0\fi

The next step consists of defining commands to switch to (and from) the Croatian language.

\captionscroatian The macro \captionscroatian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 45.6 \addto\captionscroatian{%
 45.7 \def\prefacename{Predgovor}%
 45.8 \def\refname{Literatura}%
 45.9 \def\abstractname{Sa\v{z}etak}%
45.10 \def\bibname{Bibliografija}%
45.11 \def\chaptername{Poglavlje}%
45.12 \def\appendixname{Dodatak}%
45.13 \def\contentsname{Sadr\v{z}aj}%
45.14 \def\listfigurename{Popis slika}%
45.15 \def\listtablename{Popis tablica}%
45.16 \def\indexname{Indeks}%
45.17 \def\figurename{Slika}%
45.18 \def\tablename{Tablica}%
45.19 \def\partname{Dio}%
45.20 \def\enclname{Prilozi}%
45.21 \def\ccname{Kopije}%
45.22 \def\headtoname{Prima}%
45.23 \def\pagename{Stranica}%
45.24 \def\seename{Vidjeti}%
45.25 \def\alsoname{Vidjeti i}%
45.26 \def\proofname{Dokaz}%
45.27 \def\glossaryname{Glossary}% <-- Needs translation

45.28 }%

\datecroatian The macro \datecroatian redefines the command \today to produce Croatian

dates.

45.29 \def\datecroatian{%
45.30 \def\today{\number\day.~\ifcase\month\or

55The file described in this section has version number v1.3k and was last revised on

2001/01/30. A contribution was made by Alan Paić (paica@cernvm.cern.ch).

45.31  sije\v{c}nja\or velja\v{c}e\or o\v{z}ujka\or travnja\or svibnja\or
45.32  lipnja\or srpnja\or kolovoza\or rujna\or listopada\or studenog\or
45.33  prosinca\fi \space \number\year.}}

\extrascroatian \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.

45.34 \addto\extrascroatian{}
45.35 \addto\noextrascroatian{}

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.

45.36 \ldf@finish{croatian}

45.37 ⟨/code⟩

46 The Czech language

The file czech.dtx^{56} defines all the language definition macros for the Czech language.

For this language \frenchspacing is set and two macros \q and \w for easy access to two accents are defined.

The command \q is used with the letters (t, d, l, and L) and adds a ' to them to simulate a ‘hook’ that should be there. The result looks like t’. The command \w is used to put the ring-accent which appears in ångstrøm over the letters u and

  U.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

46.1 ⟨∗code⟩

 46.2 \LdfInit{czech}\captionsczech

When this file is read as an option, i.e. by the \usepackage command, czech will 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.

 46.3 \ifx\l@czech\@undefined
 46.4  \@nopatterns{Czech}
 46.5  \adddialect\l@czech0\fi

The next step consists of defining commands to switch to (and from) the Czech language.

\captionsczech The macro \captionsczech defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 46.6 \addto\captionsczech{%
 46.7 \def\prefacename{P\v redmluva}%
 46.8 \def\refname{Reference}%
 46.9 \def\abstractname{Abstrakt}%
46.10 \def\bibname{Literatura}%
46.11 \def\chaptername{Kapitola}%
46.12 \def\appendixname{Dodatek}%
46.13 \def\contentsname{Obsah}%
46.14 \def\listfigurename{Seznam obr\'azk\r{u}}%
46.15 \def\listtablename{Seznam tabulek}%
46.16 \def\indexname{Index}%
46.17 \def\figurename{Obr\'azek}%
46.18 \def\tablename{Tabulka}%
46.19 \def\partname{\v{C}\'ast}%
46.20 \def\enclname{P\v{r}\'{\i}loha}%
46.21 \def\ccname{Na v\v{e}dom\'{\i}:}%
46.22 \def\headtoname{Komu}%
46.23 \def\pagename{Strana}%
46.24 \def\seename{viz}%
46.25 \def\alsoname{viz tak\'e}%
46.26 \def\proofname{D\r{u}kaz}%
46.27 \def\glossaryname{Glossary}% <-- Needs translation

46.28 }%

56The file described in this section has version number v1.3j and was last revised on 2001/01/30.

Contributions were made by Milos Lokajicek (LOKAJICK@CERNVM).

\dateczech The macro \dateczech redefines the command \today to produce Czech dates.

46.29 \def\dateczech{%
46.30 \def\today{\number\day.~\ifcase\month\or
46.31  ledna\or \'unora\or b\v{r}ezna\or dubna\or kv\v{e}tna\or
46.32  \v{c}ervna\or \v{c}ervence\or srpna\or z\'a\v{r}\'{\i}\or
46.33  \v{r}\'{\i}jna\or listopadu\or prosince\fi
46.34  \space \number\year}}

\extrasczech \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.

46.35 \addto\extrasczech{\babel@save\q\let\q\v}
46.36 \addto\extrasczech{\babel@save\w\let\w\r}

For Czech texts \frenchspacing should be in effect. We make sure this is the case and reset it if necessary.

46.37 \addto\extrasczech{\bbl@frenchspacing}
46.38 \addto\noextrasczech{\bbl@nonfrenchspacing}

\v L^{A}TEX’s normal \v accent places a caron over the letter that follows it (ǒ). 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.

46.39 \AtBeginDocument{%
46.40 \DeclareTextCompositeCommand{\v}{OT1}{t}{%
46.41  t\kern-.23em\raise.24ex\hbox{'}}
46.42 \DeclareTextCompositeCommand{\v}{OT1}{d}{%
46.43  d\kern-.13em\raise.24ex\hbox{'}}
46.44 \DeclareTextCompositeCommand{\v}{OT1}{l}{\lcaron{}}
46.45 \DeclareTextCompositeCommand{\v}{OT1}{L}{\Lcaron{}}}

\lcaron \Lcaron Fot the letters l and L we want to disinguish between normal fonts and monospaced

fonts.

46.46 \def\lcaron{%
46.47 \setbox0\hbox{M}\setbox\tw@\hbox{i}%
46.48 \ifdim\wd0>\wd\tw@\relax
46.49  l\kern-.13em\raise.24ex\hbox{'}\kern-.11em%
46.50 \else
46.51  l\raise.45ex\hbox to\z@{\kern-.35em '\hss}%

46.52 \fi}

46.53 \def\Lcaron{%
46.54 \setbox0\hbox{M}\setbox\tw@\hbox{i}%
46.55 \ifdim\wd0>\wd\tw@\relax
46.56  L\raise.24ex\hbox to\z@{\kern-.28em'\hss}%
46.57 \else
46.58  L\raise.45ex\hbox to\z@{\kern-.40em '\hss}%

46.59 \fi}

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.

46.60 \ldf@finish{czech}

46.61 ⟨/code⟩

47 The Polish language

The file polish.dtx^{57} defines all the language-specific macros for the Polish language.

For this language the character " is made active. In table 22 an overview is given of its purpose.

"a or \aob, for tailed-a (like a̧)
"A or \Aob, for tailed-A (like A̧)
"e or \eob, for tailed-e (like ȩ)
"E or \Eob, for tailed-E (like Ȩ)

"c or \'c, for accented c (like ć), same with uppercase

letters and n,o,s

"l or \lpb{}, for l with stroke (like ł)
"L or \Lpb{}, for L with stroke (like Ł)
"r or \zkb{}, for pointed z (like ż), cf. pronounciation
"R or \Zkb{}, for pointed Z (like Ż)
"z or \'z, for accented z
"Z or \'Z, for accented Z
"| 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 >>).

Table 22: The extra definitions made by polish.sty

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

47.1 ⟨∗code⟩

47.2 \LdfInit{polish}\captionspolish

When this file is read as an option, i.e. by the \usepackage command, 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.

47.3 \ifx\l@polish\@undefined
47.4 \@nopatterns{Polish}
47.5 \adddialect\l@polish0\fi

The next step consists of defining commands to switch to (and from) the Polish language.

\captionspolish The macro \captionspolish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

47.6 \addto\captionspolish{%

57The file described in this section has version number v1.2j and was last revised on 2001/01/30.

 47.7 \def\prefacename{Przedmowa}%
 47.8 \def\refname{Literatura}%
 47.9 \def\abstractname{Streszczenie}%
47.10 \def\bibname{Bibliografia}%
47.11 \def\chaptername{Rozdzia\l}%
47.12 \def\appendixname{Dodatek}%
47.13 \def\contentsname{Spis tre\'sci}%
47.14 \def\listfigurename{Spis rysunk\'ow}%
47.15 \def\listtablename{Spis tablic}%
47.16 \def\indexname{Indeks}%
47.17 \def\figurename{Rysunek}%
47.18 \def\tablename{Tablica}%
47.19 \def\partname{Cz\eob{}\'s\'c}%
47.20 \def\enclname{Za\l\aob{}cznik}%
47.21 \def\ccname{Kopie:}%
47.22 \def\headtoname{Do}%
47.23 \def\pagename{Strona}%
47.24 \def\seename{Por\'ownaj}%
47.25 \def\alsoname{Por\'ownaj tak\.ze}%
47.26 \def\proofname{Dow\'od}%
47.27 \def\glossaryname{Glossary}% <-- Needs translation

47.28 }

\datepolish The macro \datepolish redefines the command \today to produce Polish dates.

47.29 \def\datepolish{%
47.30 \def\today{\number\day~\ifcase\month\or
47.31 stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or lipca\or
47.32 sierpnia\or wrze\'snia\or pa\'zdziernika\or listopada\or grudnia\fi
47.33 \space\number\year}%

47.34 }

\extraspolish \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 " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the polish group of shorthands should be used.

47.35 \initiate@active@char{"}
47.36 \addto\extraspolish{\languageshorthands{polish}}
47.37 \addto\extraspolish{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

47.38 \addto\noextraspolish{\bbl@deactivate{"}}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 22.

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.

47.39 \newdimen\pl@left
47.40 \newdimen\pl@down
47.41 \newdimen\pl@right
47.42 \newdimen\pl@temp

\sob The macro \sob is used to put the ‘ogonek’ in the right place.

47.43 \def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
47.44 \setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
47.45 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
47.46 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
47.47 \pl@left=\pl@right \advance\pl@left by\wd1
47.48 \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
47.49 \leavevmode
47.50 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\aob \Aob \eob \Eob The ogonek is placed with the letters ‘a’, ‘A’, ‘e’, and ‘E’.

47.51 \DeclareTextCommand{\aob}{OT1}{\sob a{.66}{.20}{0}{.90}}
47.52 \DeclareTextCommand{\Aob}{OT1}{\sob A{.80}{.50}{0}{.90}}
47.53 \DeclareTextCommand{\eob}{OT1}{\sob e{.50}{.35}{0}{.93}}
47.54 \DeclareTextCommand{\Eob}{OT1}{\sob E{.60}{.35}{0}{.90}}

For the ’new’ T1 encoding we can provide simpler definitions.

47.55 \DeclareTextCommand{\aob}{T1}{\k a}
47.56 \DeclareTextCommand{\Aob}{T1}{\k A}
47.57 \DeclareTextCommand{\eob}{T1}{\k e}
47.58 \DeclareTextCommand{\Eob}{T1}{\k E}

Construct the characters by default from the OT1 encoding.

47.59 \ProvideTextCommandDefault{\aob}{\UseTextSymbol{OT1}{\aob}}
47.60 \ProvideTextCommandDefault{\Aob}{\UseTextSymbol{OT1}{\Aob}}
47.61 \ProvideTextCommandDefault{\eob}{\UseTextSymbol{OT1}{\eob}}
47.62 \ProvideTextCommandDefault{\Eob}{\UseTextSymbol{OT1}{\Eob}}

\spb The macro \spb is used to put the ‘poprzeczka’ in the right place.

47.63 \def\spb#1#2#3#4#5{%
47.64 \setbox0\hbox{#1}\setbox1\hbox{\char'023}%
47.65 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
47.66 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
47.67 \pl@left=\pl@right \advance\pl@left by\wd1
47.68 \ht1=\pl@down \dp1=-\pl@down
47.69 \leavevmode
47.70 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\skb The macro \skb is used to put the ‘kropka’ in the right place.

47.71 \def\skb#1#2#3#4#5{%
47.72 \setbox0\hbox{#1}\setbox1\hbox{\char'056}%
47.73 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
47.74 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
47.75 \pl@left=\pl@right \advance\pl@left by\wd1
47.76 \leavevmode
47.77 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\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.

47.78 \def\textpl{%
47.79 \def\lpb{\plll}%
47.80 \def\Lpb{\pLLL}%
47.81 \def\zkb{\.z}%
47.82 \def\Zkb{\.Z}}

Initially we assume that typesetting is done with text fonts.

47.83 \textpl
47.84 \let\lll=\l \let\LLL=\L
47.85 \def\plll{\lll}
47.86 \def\pLLL{\LLL}

\telepl But for the ‘teletype’ font in ‘OT1’ encoding we have to take some special actions, involving the macros defined above.

47.87 \def\telepl{%
47.88 \def\lpb{\spb l{.45}{.5}{.4}{.8}}%
47.89 \def\Lpb{\spb L{.23}{.5}{.4}{.8}}%
47.90 \def\zkb{\skb z{.5}{.5}{1.2}{0}}%
47.91 \def\Zkb{\skb Z{.5}{.5}{1.1}{0}}}

To activate these codes the font changing commands as they are defined in L^{A}TEX 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 L^{A}TEX 2.09.

47.92 \ifx\selectfont\@undefined
47.93 \ifx\prm\@undefined \addto\rm{\textpl}\else \addto\prm{\textpl}\fi
47.94 \ifx\pit\@undefined \addto\it{\textpl}\else \addto\pit{\textpl}\fi
47.95 \ifx\pbf\@undefined \addto\bf{\textpl}\else \addto\pbf{\textpl}\fi
47.96 \ifx\psl\@undefined \addto\sl{\textpl}\else \addto\psl{\textpl}\fi
47.97 \ifx\psf\@undefined                   \else \addto\psf{\textpl}\fi
47.98 \ifx\psc\@undefined                   \else \addto\psc{\textpl}\fi
47.99 \ifx\ptt\@undefined \addto\tt{\telepl}\else \addto\ptt{\telepl}\fi

47.100 \else

When \selectfont exists we assume L^{A}TEX 2ε.

47.101 \expandafter\addto\csname selectfont \endcsname{%
47.102  \csname\f@encoding @pl\endcsname}

47.103 \fi

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.

47.104 \expandafter\let\csname T1@pl\endcsname\textpl

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.
47.105 \expandafter\def\csname OT1@pl\endcsname{%
47.106 \long\edef\curr@family{\f@family}%
47.107 \ifx\curr@family\ttdefault
47.108  \telepl

47.109 \else

47.110  \textpl

47.111 \fi}

\dq We save the original double quote character in \dq to keep it available, the math

accent \" can now be typed as ".

47.112 \begingroup \catcode`\"12
47.113 \def\x{\endgroup
47.114 \def\dq{"}}

47.115 \x

Now we can define the doublequote macros for diacritics,

47.116 \declare@shorthand{polish}{"a}{\textormath{\aob}{\ddot a}}
47.117 \declare@shorthand{polish}{"A}{\textormath{\Aob}{\ddot A}}
47.118 \declare@shorthand{polish}{"c}{\textormath{\'c}{\acute c}}
47.119 \declare@shorthand{polish}{"C}{\textormath{\'C}{\acute C}}
47.120 \declare@shorthand{polish}{"e}{\textormath{\eob}{\ddot e}}
47.121 \declare@shorthand{polish}{"E}{\textormath{\Eob}{\ddot E}}
47.122 \declare@shorthand{polish}{"l}{\textormath{\lpb}{\ddot l}}
47.123 \declare@shorthand{polish}{"L}{\textormath{\Lpb}{\ddot L}}
47.124 \declare@shorthand{polish}{"n}{\textormath{\'n}{\acute n}}
47.125 \declare@shorthand{polish}{"N}{\textormath{\'N}{\acute N}}
47.126 \declare@shorthand{polish}{"o}{\textormath{\'o}{\acute o}}
47.127 \declare@shorthand{polish}{"O}{\textormath{\'O}{\acute O}}
47.128 \declare@shorthand{polish}{"s}{\textormath{\'s}{\acute s}}
47.129 \declare@shorthand{polish}{"S}{\textormath{\'S}{\acute S}}

\polishrz \polishzx 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.

47.130 \newcommand*{\polishrz}{%
47.131 \declare@shorthand{polish}{"r}{\textormath{\zkb}{\ddot r}}%
47.132 \declare@shorthand{polish}{"R}{\textormath{\Zkb}{\ddot R}}%
47.133 \declare@shorthand{polish}{"z}{\textormath{\'z}{\acute z}}%
47.134 \declare@shorthand{polish}{"Z}{\textormath{\'Z}{\acute Z}}%
47.135 \declare@shorthand{polish}{"x}{\dq x}%
47.136 \declare@shorthand{polish}{"X}{\dq X}%

47.137 }

47.138 \polishrz

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..

47.139 \newcommand*{\polishzx}{%
47.140 \declare@shorthand{polish}{"z}{\textormath{\zkb}{\ddot z}}%
47.141 \declare@shorthand{polish}{"Z}{\textormath{\Zkb}{\ddot R}}%
47.142 \declare@shorthand{polish}{"x}{\textormath{\'z}{\acute x}}%
47.143 \declare@shorthand{polish}{"X}{\textormath{\'Z}{\acute X}}%
47.144 \declare@shorthand{polish}{"r}{\dq r}%
47.145 \declare@shorthand{polish}{"R}{\dq R}%

47.146 }

Then we define access to two forms of quotation marks, similar to the german and french quotation marks.

47.147 \declare@shorthand{polish}{"`}{%
47.148 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
47.149 \declare@shorthand{polish}{"'}{%

47.150 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
47.151 \declare@shorthand{polish}{"<}{%
47.152 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
47.153 \declare@shorthand{polish}{">}{%
47.154 \textormath{\guillemotright}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behavew a little different from \-.

47.155 \declare@shorthand{polish}{"-}{\nobreak-\bbl@allowhyphens}
47.156 \declare@shorthand{polish}{""}{\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

47.157 \declare@shorthand{polish}{"|}{%
47.158 \textormath{\discretionary{-}{}{\kern.03em}}{}}

\mdqon \mdqoff All that’s left to do now is to define a couple of commands for reasons of compat-

ibility with polish.tex.

47.159 \def\mdqon{\shorthandon{"}}
47.160 \def\mdqoff{\shorthandoff{"}}

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.

47.161 \ldf@finish{polish}

47.162 ⟨/code⟩

48 The Serbocroatian language

The file serbian.dtx^{58} defines all the language definition macros for the Serbian language, typeset in a latin script. In a future version support for typesetting in a cyrillic script may be added.

For this language the character " is made active. In table 23 an overview is given of its purpose. One of the reasons for this is that in the Serbian language some special characters are used.

"c \"c, also implemented for the lowercase and upper-

case s and z.

"d  \dj, also implemented for "D

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word.

"| disable ligature at this position

"" like "-, but producing no hyphen sign (for compund

words with hyphen, e.g. x-""y).

"` for Serbian left double quotes (looks like „).
"' for Serbian right double quotes.
"< for French left double quotes (similar to <<).
"> for French right double quotes (similar to >>).

Table 23: The extra definitions made by serbian.ldf

Apart from defining shorthands we need to make sure taht 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).

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

48.1 ⟨∗code⟩

48.2 \LdfInit{serbian}\captionsserbian

When this file is read as an option, i.e. by the \usepackage command, serbian will be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@serbian to see whether we have to do something here.

48.3 \ifx\l@serbian\@undefined
48.4  \@nopatterns{Serbian}
48.5  \adddialect\l@serbian0\fi

The next step consists of defining commands to switch to (and from) the Serbocroatian language.

\captionsserbian The macro \captionsserbian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

48.6 \addto\captionsserbian{%
48.7 \def\prefacename{Predgovor}%
48.8 \def\refname{Literatura}%

58The file described in this section has version number v1.0d and was last revised on 2001/01/30. A contribution was made by Dejan Muhamedagić (dejan@yunix.com).

 48.9 \def\abstractname{Sa\v{z}etak}%
48.10 \def\bibname{Bibliografija}%
48.11 \def\chaptername{Glava}%
48.12 \def\appendixname{Dodatak}%
48.13 \def\contentsname{Sadr\v{z}aj}%
48.14 \def\listfigurename{Slike}%
48.15 \def\listtablename{Tabele}%
48.16 \def\indexname{Indeks}%
48.17 \def\figurename{Slika}%
48.18 \def\tablename{Tabela}%
48.19 \def\partname{Deo}%
48.20 \def\enclname{Prilozi}%
48.21 \def\ccname{Kopije}%
48.22 \def\headtoname{Prima}%
48.23 \def\pagename{Strana}%
48.24 \def\seename{Vidi}%
48.25 \def\alsoname{Vidi tako\dj e}%
48.26 \def\proofname{Dokaz}%
48.27 \def\glossaryname{Glossary}% <-- Needs translation

48.28 }%

\dateserbian The macro \dateserbian redefines the command \today to produce Serbocroa-

tian dates.

48.29 \def\dateserbian{%
48.30 \def\today{\number\day .~\ifcase\month\or
48.31  januar\or februar\or mart\or april\or maj\or
48.32  juni\or juli\or avgust\or septembar\or oktobar\or novembar\or
48.33  decembar\fi \space \number\year}}

\extrasserbian \noextrasserbian The macro \extrasserbian will perform all the extra definitions needed for the Serbocroatian language. The macro \noextrasserbian is used to cancel the ac-

  tions of \extrasserbian.

For Serbian the " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the serbian group of shorthands should be used.

48.34 \initiate@active@char{"}
48.35 \addto\extrasserbian{\languageshorthands{serbian}}
48.36 \addto\extrasserbian{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

48.37 \addto\noextrasserbian{\bbl@deactivate{"}}

First we define shorthands to facilitate the occurence of letters such as č.

48.38 \declare@shorthand{serbian}{"c}{\textormath{\v c}{\check c}}
48.39 \declare@shorthand{serbian}{"d}{\textormath{\dj}{\dj}}%%
48.40 \declare@shorthand{serbian}{"s}{\textormath{\v s}{\check s}}
48.41 \declare@shorthand{serbian}{"z}{\textormath{\v z}{\check z}}
48.42 \declare@shorthand{serbian}{"C}{\textormath{\v C}{\check C}}
48.43 \declare@shorthand{serbian}{"D}{\textormath{\DJ}{\DJ}}%%
48.44 \declare@shorthand{serbian}{"S}{\textormath{\v S}{\check S}}
48.45 \declare@shorthand{serbian}{"Z}{\textormath{\v Z}{\check Z}}

Then we define access to two forms of quotation marks, similar to the german and french quotation marks.

48.46 \declare@shorthand{serbian}{"`}{%
48.47 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
48.48 \declare@shorthand{serbian}{"'}{%
48.49 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
48.50 \declare@shorthand{serbian}{"<}{%
48.51 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
48.52 \declare@shorthand{serbian}{">}{%
48.53 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behave a little different from \-.

48.54 \declare@shorthand{serbian}{"-}{\nobreak-\bbl@allowhyphens}
48.55 \declare@shorthand{serbian}{""}{\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

48.56 \declare@shorthand{serbian}{"|}{%
48.57 \textormath{\discretionary{-}{}{\kern.03em}}{}}

\bbl@frenchindent \bbl@nonfrenchindent In Serbian the first paragraph of each section should be indented. Add this code

only in L^{A}TEX.

48.58 \ifx\fmtname plain \else
48.59 \let\@aifORI\@afterindentfalse
48.60 \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
48.61  \@afterindenttrue}
48.62 \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
48.63  \@afterindentfalse}
48.64 \addto\extrasserbian{\bbl@frenchindent}
48.65 \addto\noextrasserbian{\bbl@nonfrenchindent}

48.66 \fi

\mathserbian 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.

48.67 \def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh
48.68 \def\ch{\mathop{\operator@font ch}\nolimits} % same as \cosh
48.69 \def\th{\mathop{\operator@font th}\nolimits} % same as \tanh
48.70 \def\cth{\mathop{\operator@font cth}\nolimits} % same as \coth
48.71 \def\arsh{\mathop{\operator@font arsh}\nolimits}
48.72 \def\arch{\mathop{\operator@font arch}\nolimits}
48.73 \def\arth{\mathop{\operator@font arth}\nolimits}
48.74 \def\arcth{\mathop{\operator@font arcth}\nolimits}
48.75 \def\tg{\mathop{\operator@font tg}\nolimits} % same as \tan
48.76 \def\ctg{\mathop{\operator@font ctg}\nolimits} % same as \cot
48.77 \def\arctg{\mathop{\operator@font arctg}\nolimits} % same as \arctan
48.78 \def\arcctg{\mathop{\operator@font arcctg}\nolimits}
48.79 \def\Prob{\mathop{\mathsf P\hskip0pt}\nolimits}
48.80 \def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits}
48.81 \def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits}

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.

48.82 \ldf@finish{serbian}

48.83 ⟨/code⟩

49 The Slovak language

The file slovak.dtx^{59} defines all the language-specific macros for the Slovak language.

For this language the macro \q is defined. It is used with the letters (t, d, l, and L) and adds a ' to them to simulate a ‘hook’ that should be there. The result looks like t’.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

49.1 ⟨∗code⟩

 49.2 \LdfInit{slovak}\captionsslovak

When this file is read as an option, i.e. by the \usepackage command, 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.

 49.3 \ifx\l@slovak\@undefined
 49.4  \@nopatterns{Slovak}
 49.5  \adddialect\l@slovak0\fi

The next step consists of defining commands to switch to (and from) the Slovak language.

\captionsslovak The macro \captionsslovak defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 49.6 \addto\captionsslovak{%
 49.7 \def\prefacename{\'Uvod}%
 49.8 \def\refname{Referencie}%
 49.9 \def\abstractname{Abstrakt}%
49.10 \def\bibname{Literat\'ura}%
49.11 \def\chaptername{Kapitola}%
49.12 \def\appendixname{Dodatok}%
49.13 \def\contentsname{Obsah}%
49.14 \def\listfigurename{Zoznam obr\'azkov}%
49.15 \def\listtablename{Zoznam tabuliek}%
49.16 \def\indexname{Index}%
49.17 \def\figurename{Obr\'azok}%
49.18 \def\tablename{Tabu\q lka}%%% special letter l with hook
49.19 \def\partname{\v{C}as\q t}%%% special letter t with hook
49.20 \def\enclname{Pr\'{\i}lohy}%
49.21 \def\ccname{CC}%
49.22 \def\headtoname{Komu}%
49.23 \def\pagename{Strana}%
49.24 \def\seename{vi\q d}%%%  Special letter d with hook
49.25 \def\alsoname{vi\q d tie\v z}%%%  Special letter d with hook
49.26 \def\proofname{D\^okaz}%
49.27 \def\glossaryname{Glossary}% <-- Needs translation

49.28 }

\dateslovak The macro \dateslovak redefines the command \today to produce Slovak dates.

49.29 \def\dateslovak{%

59The file described in this section has version number v1.2l and was last revised on 2001/01/30.

It was written by Jana Chlebikova (chlebik@euromath.dk).

49.30 \def\today{\number\day.~\ifcase\month\or
49.31  janu\'ara\or febru\'ara\or marca\or apr\'{\i}la\or m\'aja\or
49.32  j\'una\or j\'ula\or augusta\or septembra\or okt\'obra\or
49.33  novembra\or decembra\fi
49.34  \space \number\year}}

\extrasslovak \noextrasslovak The macro \extrasslovak will perform all the extra definitions needed for the Slovak language. The macro \noextrasslovak is used to cancel the actions of \extrasslovak. This currently means saving the meaning of one one-letter control sequence before defining it.

49.35 \addto\extrasslovak{\babel@save\q\let\q\v}

The slovak hyphenation patterns should be used with \lefthyphenmin set to 2

and \righthyphenmin set to 2.
49.36 \providehyphenmins{\CurrentOption}{\tw@\tw@}

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.

49.37 \ldf@finish{slovak}

49.38 ⟨/code⟩

50 The Slovenian language

The file slovene.dtx^{60} defines all the language-specific macros for the Slovenian language.

For this language the character " is made active. In table 24 an overview is given of its purpose. One of the reasons for this is that in the Slovene language some special characters are used.

"c \"c, also implemented for the lowercase and upper-

case 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 >>).

Table 24: The extra definitions made by slovene.ldf

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

50.1 ⟨∗code⟩

50.2 \LdfInit{slovene}\captionsslovene

When this file is read as an option, i.e. by the \usepackage command, 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.

50.3 \ifx\l@slovene\@undefined
50.4  \@nopatterns{Slovene}
50.5  \adddialect\l@slovene0\fi

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.

\captionsslovene The macro \captionsslovene defines all strings used in the four standard documentclasses provided with L^{A}TEX.

50.6 \addto\captionsslovene{%
50.7 \def\prefacename{Predgovor}%
50.8 \def\refname{Literatura}%
50.9 \def\abstractname{Povzetek}%
50.10 \def\bibname{Literatura}%
50.11 \def\chaptername{Poglavje}%
50.12 \def\appendixname{Dodatek}%
50.13 \def\contentsname{Kazalo}%

60The file described in this section has version number v1.2m and was last revised on 2001/01/30. Contributions were made by Danilo Zavrtanik, University of Ljubljana (YU) and Leon Žlajpah (leon.zlajpah@ijs.si).

50.14 \def\listfigurename{Slike}%
50.15 \def\listtablename{Tabele}%
50.16 \def\indexname{Stvarno kazalo}% used to be Indeks
50.17 \def\figurename{Slika}%
50.18 \def\tablename{Tabela}%
50.19 \def\partname{Del}%
50.20 \def\enclname{Priloge}%
50.21 \def\ccname{Kopije}%
50.22 \def\headtoname{Prejme}%
50.23 \def\pagename{Stran}%
50.24 \def\seename{glej}%
50.25 \def\alsoname{glej tudi}%
50.26 \def\proofname{Dokaz}%
50.27 \def\glossaryname{Glossary}% <-- Needs translation

50.28 }%

\dateslovene The macro \dateslovene redefines the command \today to produce Slovenian

dates.

50.29 \def\dateslovene{%
50.30 \def\today{\number\day.~\ifcase\month\or
50.31  januar\or februar\or marec\or april\or maj\or junij\or
50.32  julij\or avgust\or september\or oktober\or november\or december\fi
50.33  \space \number\year}}

\extrasslovene \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 " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the slovenian group of shorthands should be used.

50.34 \initiate@active@char{"}
50.35 \addto\extrasslovene{\languageshorthands{slovene}}
50.36 \addto\extrasslovene{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

50.37 \addto\noextrasslovene{\bbl@deactivate{"}}

First we define shorthands to facilitate the occurence of letters such as č.

50.38 \declare@shorthand{slovene}{"c}{\textormath{\v c}{\check c}}
50.39 \declare@shorthand{slovene}{"s}{\textormath{\v s}{\check s}}
50.40 \declare@shorthand{slovene}{"z}{\textormath{\v z}{\check z}}
50.41 \declare@shorthand{slovene}{"C}{\textormath{\v C}{\check C}}
50.42 \declare@shorthand{slovene}{"S}{\textormath{\v S}{\check S}}
50.43 \declare@shorthand{slovene}{"Z}{\textormath{\v Z}{\check Z}}

Then we define access to two forms of quotation marks, similar to the german and french quotation marks.

50.44 \declare@shorthand{slovene}{"`}{%
50.45 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
50.46 \declare@shorthand{slovene}{"'}{%
50.47 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
50.48 \declare@shorthand{slovene}{"<}{%
50.49 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}

50.50 \declare@shorthand{slovene}{">}{%
50.51 \textormath{\guillemotright}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behavew a little different from \-.

50.52 \declare@shorthand{slovene}{"-}{\nobreak-\bbl@allowhyphens}
50.53 \declare@shorthand{slovene}{""}{\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

50.54 \declare@shorthand{slovene}{"|}{%
50.55 \textormath{\discretionary{-}{}{\kern.03em}}{}}

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.

50.56 \ldf@finish{slovene}

50.57 ⟨/code⟩

51 The Russian language

The file russianb.dtx^{61} defines all the language-specific macros for the Russian language. It needs the file cyrcod for success documentation with Russian encodings (see below).

For this language the character " is made active. In table 25 an overview is given of its purpose.

"|  disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word.

"--- Cyrillic emdash in plain text.
"--~ Cyrillic emdash in compound names (surnames).
"--* Cyrillic emdash for denoting direct speech.

"" like "-, but producing no hyphen sign (for compund 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, allow-

ing hyphenation in the composing words. ", thinspace for initials with a breakpoint in following

surname.

"`  for German left double quotes (looks like ,,).
"'  for German right double quotes (looks like “).
” "< for French left double quotes (looks like <<).
">  for French right double quotes (looks like >>).

Table 25: The extra definitions made by russianb

The quotes in table 25 can also be typeset by using the commands in table 26.

\cdash--- Cyrillic emdash in plain text.
\cdash--~ Cyrillic emdash in compound names (surnames).
\cdash--* Cyrillic emdash for denoting direct speech.
\glqq  for German left double quotes (looks like ,,).
\grqq  for German right double quotes (looks like “).
” \flqq  for French left double quotes (looks like <<).
\frqq  for French right double quotes (looks like >>).
\dq  the original quotes character (").

Table 26: More commands which produce quotes, defined by babel

The French quotes are also available as ligatures ‘<<’ and ‘>>’ in 8-bit Cyrillic font encodings (LCY, X2, T2*) and as ‘<’ and ‘>’ characters in 7-bit Cyrillic font encodings (OT2 and LWN).

61The file described in this section has version number ? and was last revised on ?. This file was initially derived from the original version of german.sty, which has some definitions for Russian.

Later the definitions from russian.sty version 1.0b (for L^{A}TEX 2.09), russian.sty version v2.5c (for L^{A}TEX 2ε) and francais.sty version 4.5c and germanb.sty version 2.5c were added.

The quotation marks traditionally used in Russian were borrowed from other languages (e.g., French and German) so they keep their original names.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

51.1 ⟨∗code⟩

51.2 \LdfInit{russian}{captionsrussian}

When this file is read as an option, i.e., by the \usepackage command, russianb will be an ‘unknown’ language, in which case we have to make it known. So we check for the existence of \l@russian to see whether we have to do something here.

51.3 \ifx\l@russian\@undefined
51.4 \@nopatterns{Russian}
51.5 \adddialect\l@russian0

51.6 \fi

\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 fontenc package is loaded later, then… too bad!

51.7 \let\latinencoding\cf@encoding

The user may choose between different available Cyrillic encodings—e.g., X2, LCY, or LWN. Hopefully, X2 will eventually replace the two latter encodings (LCY and LWN). If the user wants to use another font encoding than the default (T2A), he has to load the corresponding file before russianb.sty. This may be done in the following way:

      % override the default X2 encoding used in Babel
      \usepackage[LCY,OT1]{fontenc}
      \usepackage[english,russian]{babel}

Note: for the Russian language, the T2A encoding is better than X2, because 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 the encodings known to L^{A}TEX in the order they were loaded. We set the \cyrillicencoding to the last loaded encoding in the list of supported Cyrillic encodings: OT2, LWN, LCY, X2, T2C, T2B, T2A, if any.

51.8 \def\reserved@a#1#2{%
51.9 \edef\reserved@b{#1}%
51.10 \edef\reserved@c{#2}%
51.11 \ifx\reserved@b\reserved@c
51.12  \let\cyrillicencoding\reserved@c

51.13 \fi}

51.14 \def\cdp@elt#1#2#3#4{%
51.15 \reserved@a{#1}{OT2}%
51.16 \reserved@a{#1}{LWN}%
51.17 \reserved@a{#1}{LCY}%
51.18 \reserved@a{#1}{X2}%
51.19 \reserved@a{#1}{T2C}%
51.20 \reserved@a{#1}{T2B}%
51.21 \reserved@a{#1}{T2A}}
51.22 \cdp@list

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.,

  lcyenc.def instead of LCYenc.def).
51.23 \ifx\cyrillicencoding\undefined
51.24 \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
51.25 \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
51.26 \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
51.27 \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
51.28 \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
51.29 \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
51.30 \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax

If \cyrillicencoding is still undefined, then the user seems not to have a properly installed distribution. A fatal error.

51.31 \ifx\cyrillicencoding\undefined
51.32  \PackageError{babel}%
51.33  {No Cyrillic encoding definition files were found}%
51.34  {Your installation is incomplete.\MessageBreak
51.35  You need at least one of the following files:\MessageBreak
51.36  \space\space
51.37  x2enc.def, t2aenc.def, t2benc.def, t2cenc.def,\MessageBreak
51.38  \space\space
51.39  lcyenc.def, lwnenc.def, ot2enc.def.}%
51.40 \else
     We avoid \usepackage[\cyrillicencoding]{fontenc} because we don’t

want to force the switch of \encodingdefault.

51.41  \lowercase
51.42  \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%

51.43 \fi 51.44 \fi

        \PackageInfo{babel}
          {Using `\cyrillicencoding' as a default Cyrillic encoding}%
51.45 \DeclareRobustCommand{\Russian}{%
51.46 \fontencoding\cyrillicencoding\selectfont
51.47 \let\encodingdefault\cyrillicencoding
51.48 \expandafter\set@hyphenmins\russianhyphenmins
51.49 \language\l@russian}%
51.50 \DeclareRobustCommand{\English}{%
51.51 \fontencoding\latinencoding\selectfont
51.52 \let\encodingdefault\latinencoding
51.53 \expandafter\set@hyphenmins\englishhyphenmins
51.54 \language\l@english}%
51.55 \let\Rus\Russian
51.56 \let\Eng\English
51.57 \let\cyrillictext\Russian
51.58 \let\cyr\Russian

Since the X2 encoding does not contain Latin letters, we should make some redefinitions of L^{A}TEX macros which implicitly produce Latin letters.

51.59 \expandafter\ifx\csname T@X2\endcsname\relax\else

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).
51.60 \def\@alph#1{{\fontencoding{\latinencoding}\selectfont
51.61  \ifcase#1\or
51.62  a\or b\or c\or d\or e\or f\or g\or h\or
51.63  i\or j\or k\or l\or m\or n\or o\or p\or
51.64  q\or r\or s\or t\or u\or v\or w\or x\or
51.65  y\or z\else\@ctrerr\fi}}%
51.66 \def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
51.67  \ifcase#1\or
51.68  A\or B\or C\or D\or E\or F\or G\or H\or
51.69  I\or J\or K\or L\or M\or N\or O\or P\or
51.70  Q\or R\or S\or T\or U\or V\or W\or X\or
51.71  Y\or Z\else\@ctrerr\fi}}%

Unfortunately, the commands \AA and \aa are not encoding dependent in L^{A}TEX (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 X2).

51.72 \DeclareTextSymbolDefault{\AA}{OT1}
51.73 \DeclareTextSymbolDefault{\aa}{OT1}
51.74 \DeclareTextCommand{\aa}{OT1}{\r a}
51.75 \DeclareTextCommand{\AA}{OT1}{\r A}

51.76 \fi

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.

51.77 % \begingroup\catcode`\"=12
51.78 % % uppercase greek letters:
51.79 % \def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
51.80 %   "0000\@nil#1}
51.81 % \def\@tempb#1"#2#3#4#5#6\@nil#7{%
51.82 %   \ifnum"#2=7 \count@"1#3#4#5\relax
51.83 %     \ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
51.84 %   \fi}
51.85 % \@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
51.86 % \@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
51.87 % \@tempa\Omega
51.88 % % some accents:
51.89 % \def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
51.90 % \expandafter\@tempa\hat\relax\relax\@nil
51.91 % \ifx\@tempb\@tempc
51.92 %   \def\@tempa#1\@nil{#1}%
51.93 %   \def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
51.94 %   \def\do#1"#2{}
51.95 %   \def\@tempd#1{\expandafter\@tempb#1\@nil
51.96 %     \ifnum\@tempc>"FFF
51.97 %       \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%

51.98 %     \fi}
51.99 %   \@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
51.100 %   \@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar

51.101 % \fi

51.102 % \endgroup

The user should use the 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 inputenc package

by \usepackage{inputenc}. We also removed \AtBeginDocument, so inputenc

should be used before babel.

51.103 \@ifpackageloaded{inputenc}{}{%
51.104 \def\reserved@a{LWN}%
51.105 \ifx\reserved@a\cyrillicencoding\else
51.106  \def\reserved@a{OT2}%
51.107  \ifx\reserved@a\cyrillicencoding\else
51.108  \PackageWarning{babel}%
51.109  {No input encoding specified for Russian language}
51.110 \fi\fi}

Now we define two commands that offer the possibility to switch between Cyrillic and Roman encodings.

\cyrillictext \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 declarations, for shorter peaces of text the commands \textlatin and \textcyrillic can be used.

51.111 \DeclareRobustCommand{\latintext}{%
51.112 \fontencoding{\latinencoding}\selectfont
51.113 \def\encodingdefault{\latinencoding}}
51.114 \let\lat\latintext

\textcyrillic \textlatin These commands take an argument which is then typeset using the requested font

encoding.

51.115 \DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
51.116 \DeclareTextFontCommand{\textlatin}{\latintext}

We make the TEX

51.117 \ifx\ltxTeX\undefined\let\ltxTeX\TeX\fi
51.118 \ProvideTextCommandDefault{\TeX}{\textlatin{\ltxTeX}}

and L^{A}TEX logos encoding independent.

51.119 \ifx\ltxLaTeX\undefined\let\ltxLaTeX\LaTeX\fi
51.120 \ProvideTextCommandDefault{\LaTeX}{\textlatin{\ltxLaTeX}}

The next step consists of defining commands to switch to (and from) the Russian language.

\captionsrussian The macro \captionsrussian defines all strings used in the four standard document classes provided with L^{A}TEX. The two commands \cyr and \lat activate Cyrillic resp. Latin encoding.

51.121 \addto\captionsrussian{%
51.122 %   FIXME: Where is the \prefacename used?

51.123 \def\prefacename{%
51.124  {\cyr\CYRP\cyrr\cyre\cyrd\cyri\cyrs\cyrl\cyro\cyrv\cyri\cyre}}%
51.125 %   {\cyr\CYRV\cyrv\cyre\cyrd\cyre\cyrn\cyri\cyre}}%
51.126 \def\refname{%
51.127  {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
51.128  \ \cyrl\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyrery}}%
51.129 % \def\refname{%
51.130 %   {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
51.131 \def\abstractname{%
51.132  {\cyr\CYRA\cyrn\cyrn\cyro\cyrt\cyra\cyrc\cyri\cyrya}}%
51.133 \def\bibname{%
51.134  {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
51.135 % \def\bibname{%
51.136 %   {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro
51.137 %    \cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
51.138 % for reports according to GOST:
51.139 % \def\bibname{%
51.140 %   {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
51.141 %     \ \cyri\cyrs\cyrp\cyro\cyrl\cyrsftsn\cyrz\cyro\cyrv\cyra\cyrn
51.142 %     \cyrn\cyrery\cyrh\ \cyri\cyrs\cyrt\cyro\cyrch\cyrn\cyri
51.143 %     \cyrk\cyro\cyrv}}%
51.144 \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
51.145 % \@ifundefined{chapter}{}{%
51.146 %   \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}}%
51.147 \def\appendixname{%
51.148  {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%

There are two names for the Table of Contents that are used in Russian publications. For books (and reports) the second variant is appropriate, but for proceedings the first variant is preferred:

51.149 \@ifundefined{thechapter}%
51.150  {\def\contentsname{%
51.151  {\cyr\CYRS\cyro\cyrd\cyre\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}}%
51.152  {\def\contentsname{%
51.153  {\cyr\CYRO\cyrg\cyrl\cyra\cyrv\cyrl\cyre\cyrn\cyri\cyre}}}%
51.154 \def\listfigurename{%
51.155  {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
51.156  \ \cyri\cyrl\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyri\cyrishrt}}%
51.157 % \def\listfigurename{%
51.158 %   {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
51.159 %     \ \cyrr\cyri\cyrs\cyru\cyrn\cyrk\cyro\cyrv}}%
51.160 \def\listtablename{%
51.161  {\cyr\CYRS\cyrp\cyri\cyrs\cyro\cyrk
51.162  \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc}}%
51.163 \def\indexname{%
51.164  {\cyr\CYRP\cyrr\cyre\cyrd\cyrm\cyre\cyrt\cyrn\cyrery\cyrishrt
51.165  \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
51.166 \def\authorname{%
51.167  {\cyr\CYRI\cyrm\cyre\cyrn\cyrn\cyro\cyrishrt
51.168  \ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl\cyrsftsn}}%
51.169 \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
51.170 \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
51.171 \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyrsftsn}}%
51.172 \def\enclname{{\cyr\cyrv\cyrk\cyrl.}}%

51.173 \def\ccname{{\cyr\cyri\cyrs\cyrh.}}%
51.174 % \def\ccname{{\cyr\cyri\cyrz}}%
51.175 \def\headtoname{{\cyr\cyrv\cyrh.}}%
51.176 % \def\headtoname{{\cyr\cyrv}}%
51.177 \def\pagename{{\cyr\cyrs.}}%
51.178 % \def\pagename{{\cyr\cyrs\cyrt\cyrr.}}%
51.179 \def\seename{{\cyr\cyrs\cyrm.}}%
51.180 \def\alsoname{{\cyr\cyrs\cyrm.\ \cyrt\cyra\cyrk\cyrzh\cyre}}%
51.181 \def\proofname{{\cyr\CYRD\cyro\cyrk\cyra\cyrz\cyra\cyrt
51.182  \cyre\cyrl\cyrsftsn\cyrs\cyrt\cyrv\cyro}}%
51.183 \def\glossaryname{Glossary}% <-- Needs translation

51.184 }

\daterussian The macro \daterussian redefines the command \today to produce Russian dates.

51.185 \def\daterussian{%
51.186 \def\today{\number\day~\ifcase\month\or
51.187  \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or
51.188  \cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or
51.189  \cyrm\cyra\cyrr\cyrt\cyra\or
51.190  \cyra\cyrp\cyrr\cyre\cyrl\cyrya\or
51.191  \cyrm\cyra\cyrya\or
51.192  \cyri\cyryu\cyrn\cyrya\or
51.193  \cyri\cyryu\cyrl\cyrya\or
51.194  \cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or
51.195  \cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or
51.196  \cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or
51.197  \cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or
51.198  \cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya\fi
51.199  \ \number\year~\cyrg.}}

\extrasrussian The macro \extrasrussian will perform all the extra definitions needed for the Russian language. The macro \noextrasrussian is used to cancel the actions of

   \extrasrussian.

The first action we define is to switch on the selected Cyrillic encoding whenever we enter ‘russian’.

51.200 \addto\extrasrussian{\cyrillictext}

When the encoding definition file was processed by L^{A}TEX the current font encoding is stored in \latinencoding, assuming that L^{A}TEX uses T1 or OT1 as default. Therefore we switch back to \latinencoding whenever the Russian language is no longer ‘active’.

51.201 \addto\noextrasrussian{\latintext}

\verbatim@font In order to get both Latin and Cyrillic letters in verbatim text we need to change the definition of an internal L^{A}TEX command somewhat:

51.202 %\def\verbatim@font{%
51.203 %  \let\encodingdefault\latinencoding
51.204 %  \normalfont\ttfamily
51.205 %  \expandafter\def\csname\cyrillicencoding-cmd\endcsname##1##2{%
51.206 %    \ifx\protect\@typeset@protect
51.207 %      \begingroup\UseTextSymbol\cyrillicencoding##1\endgroup
51.208 %    \else\noexpand##1\fi}}

The category code of the characters ‘:’, ‘;’, ‘!’, and ‘?’ is made \active to insert a little white space.

For Russian (as well as for German) the " character also is made active.

Note: It is very questionable whether the Russian typesetting tradition requires additional spacing before those punctuation signs. Therefore, we make the corresponding code optional. If you need it, then define the frenchpunct docstrip

option in babel.ins.

Borrowed from french. Some users dislike automatic insertion of a space before ‘double punctuation’, and prefer to decide themselves whether a space should be added or not; so a hook \NoAutoSpaceBeforeFDP is provided: if this command is added (in file russianb.cfg, or anywhere in a document) russianb will respect your typing, and introduce a suitable space before ‘double punctuation’ if and only if a space is typed in the source file before those signs.

The command \AutoSpaceBeforeFDP switches back to the default behavior of

russianb.

51.209 ⟨∗frenchpunct⟩

51.210 \initiate@active@char{:}
51.211 \initiate@active@char{;}

51.212 ⟨/frenchpunct⟩ 51.213 ⟨∗frenchpunct | spanishligs⟩

51.214 \initiate@active@char{!}
51.215 \initiate@active@char{?}

51.216 ⟨/frenchpunct | spanishligs⟩

51.217 \initiate@active@char{"}

The code above is necessary because we need extra active characters. The character " is used as indicated in table 25.

We specify that the Russian group of shorthands should be used.

51.218 \addto\extrasrussian{\languageshorthands{russian}}

These characters are ‘turned on’ once, later their definition may vary.

51.219 \addto\extrasrussian{%
51.220 ⟨frenchpunct⟩ \bbl@activate{:}\bbl@activate{;}%
51.221 ⟨frenchpunct | spanishligs⟩ \bbl@activate{!}\bbl@activate{?}%
51.222 \bbl@activate{"}}
51.223 \addto\noextrasrussian{%
51.224 ⟨frenchpunct⟩ \bbl@deactivate{:}\bbl@deactivate{;}%
51.225 ⟨frenchpunct | spanishligs⟩ \bbl@deactivate{!}\bbl@deactivate{?}%
51.226 \bbl@deactivate{"}}
   The X2 and 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 OT1) because the user may choose T2A to be the primary encoding, but it does not contain these characters.

51.227 ⟨∗spanishligs⟩

51.228 \declare@shorthand{russian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
51.229 \declare@shorthand{russian}{!`}{\UseTextSymbol{OT1}\textexclamdown}

51.230 ⟨/spanishligs⟩

\russian@sh@;@ \russian@sh@:@ \russian@sh@!@ \russian@sh@?@ We have to reduce the amount of white space before ;, : and !. This should only happen in horizontal mode, hence the test with \ifhmode.

51.231 ⟨∗frenchpunct⟩

51.232 \declare@shorthand{russian}{;}{%
51.233 \ifhmode

In horizontal mode we check for the presence of a ‘space’, ‘unskip’ if it exists and place a 0.1em kerning.

51.234  \ifdim\lastskip>\z@
51.235  \unskip\nobreak\kern.1em

51.236 \else

If no space has been typed, we add \FDP@thinspace which will be defined, up to the user’s wishes, as an automatic added thinspace, or as \@empty.

51.237  \FDP@thinspace

51.238 \fi 51.239 \fi

Now we can insert a ‘;’ character.

51.240 \string;}

The other definitions are very similar.

51.241 \declare@shorthand{russian}{:}{%
51.242 \ifhmode
51.243  \ifdim\lastskip>\z@
51.244  \unskip\nobreak\kern.1em

51.245 \else

51.246  \FDP@thinspace

51.247 \fi 51.248 \fi

51.249 \string:}
51.250 \declare@shorthand{russian}{!}{%
51.251 \ifhmode
51.252  \ifdim\lastskip>\z@
51.253  \unskip\nobreak\kern.1em

51.254 \else

51.255  \FDP@thinspace

51.256 \fi 51.257 \fi

51.258 \string!}
51.259 \declare@shorthand{russian}{?}{%
51.260 \ifhmode
51.261  \ifdim\lastskip>\z@
51.262  \unskip\nobreak\kern.1em

51.263 \else

51.264  \FDP@thinspace

51.265 \fi 51.266 \fi

51.267 \string?}

\AutoSpaceBeforeFDP \NoAutoSpaceBeforeFDP \FDP@thinspace  \FDP@thinspace is defined as unbreakable spaces if \AutoSpaceBeforeFDP is

activated or as \@empty if \NoAutoSpaceBeforeFDP is in use. The default is

   \AutoSpaceBeforeFDP.
51.268 \def\AutoSpaceBeforeFDP{%
51.269  \def\FDP@thinspace{\nobreak\kern.1em}}
51.270 \def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty}
51.271 \AutoSpaceBeforeFDP

\FDPon \FDPoff The next macros allow to switch on/off activeness of double punctuation signs.

51.272 \def\FDPon{\bbl@activate{:}%
51.273  \bbl@activate{;}%
51.274  \bbl@activate{?}%
51.275  \bbl@activate{!}}
51.276 \def\FDPoff{\bbl@deactivate{:}%
51.277  \bbl@deactivate{;}%
51.278  \bbl@deactivate{?}%
51.279  \bbl@deactivate{!}}

\system@sh@:@ \system@sh@!@ \system@sh@?@ \system@sh@;@ When the active characters appear in an environment where their Russian behaviour is not wanted they should give an ‘expected’ result. Therefore we define shorthands at system level as well.

51.280 \declare@shorthand{system}{:}{\string:}
51.281 \declare@shorthand{system}{;}{\string;}

51.282 ⟨/frenchpunct⟩ 51.283 ⟨∗frenchpunct&!spanishligs⟩

51.284 \declare@shorthand{system}{!}{\string!}
51.285 \declare@shorthand{system}{?}{\string?}

51.286 ⟨/frenchpunct&!spanishligs⟩

To be able to define the function of ‘"’, we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math accent \" can now be typed as ‘"’.

51.287 \begingroup \catcode`\"12
51.288 \def\reserved@a{\endgroup
51.289 \def\@SS{\mathchar"7019 }
51.290 \def\dq{"}}
51.291 \reserved@a

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 T2* encodings.

51.292 \declare@shorthand{russian}{"`}{\glqq}
51.293 \declare@shorthand{russian}{"'}{\grqq}
51.294 \declare@shorthand{russian}{"<}{\flqq}
51.295 \declare@shorthand{russian}{">}{\frqq}

Some additional commands:

51.296 \declare@shorthand{russian}{""}{\hskip\z@skip}
51.297 \declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
51.298 \declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}

51.299 \declare@shorthand{russian}{"|}{%
51.300 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
51.301  \allowhyphens}{}}

The next two macros for "- and "--- are somewhat different. We must check whether the second token is a hyphen character:

51.302 \declare@shorthand{russian}{"-}{%

If the next token is ‘-’, we typeset an emdash, otherwise a hyphen sign:

51.303 \def\russian@sh@tmp{%
51.304  \if\russian@sh@next-\expandafter\russian@sh@emdash
51.305  \else\expandafter\russian@sh@hyphen\fi

51.306 }%

TEX looks for the next token after the first ‘-’: the meaning of this token is

written to \russian@sh@next and \russian@sh@tmp is called.
51.307 \futurelet\russian@sh@next\russian@sh@tmp}

Here are the definitions of hyphen and emdash. First the hyphen:

51.308 \def\russian@sh@hyphen{%
51.309 \nobreak\-\bbl@allowhyphens}

For the emdash definition, there are the two parameters: we must ‘eat’ two last hyphen signs of our emdash…:

51.310 \def\russian@sh@emdash#1#2{\cdash-#1#2}

\cdash … these two parameters are useful for another macro: \cdash:

51.311 %\ifx\cdash\undefined % should be defined earlier
51.312 \def\cdash#1#2#3{\def\tempx@{#3}%
51.313 \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
51.314 \ifx\tempx@\tempa@\@Acdash\else
51.315 \ifx\tempx@\tempb@\@Bcdash\else
51.316 \ifx\tempx@\tempc@\@Ccdash\else
51.317  \errmessage{Wrong usage of cdash}\fi\fi\fi}

second parameter (or third for \cdash) shows what kind of emdash to create in next step

"---

ordinary (plain) Cyrillic emdash inside text: an unbreakable thinspace will be inserted before only in case of a 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;

51.318 % What is more grammatically: .2em or .2\fontdimen6\font ?
51.319 \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
51.320 \cyrdash\hskip.2em\ignorespaces}%
"--~

emdash in compound names or surnames (like Mendeleev–Klapeiron); this dash has no space characters around; after the dash some space is added

\exhyphenalty

51.321 \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
51.322 \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%

"--* for denoting direct speech (a space like \enskip must follow the emdash);

51.323 \def\@Ccdash{\leavevmode
51.324 \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%

51.325 %\fi

\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 ---.

51.326 % Is there an IF necessary?
51.327 \ifx\cyrdash\undefined
51.328 \def\cyrdash{\hbox to.8em{--\hss--}}

51.329 \fi

Here a really new macro—to place thinspace between initials. This macro used instead of \, allows hyphenation in the following surname.

51.330 %\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}

\mdqon \mdqoff All that’s left to do now is to define a couple of commands for ".

51.331 \def\mdqon{\bbl@activate{"}}
51.332 \def\mdqoff{\bbl@deactivate{"}}

The Russian hyphenation patterns can be used with \lefthyphenmin and

   \righthyphenmin set to 2.
51.333 \providehyphenmins{\CurrentOption}{\tw@\tw@}
51.334 % temporary hack:
51.335 \ifx\englishhyphenmins\undefined
51.336 \def\englishhyphenmins{\tw@\thr@@}

51.337 \fi

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.

51.338 \addto\extrasrussian{\bbl@frenchspacing}
51.339 \addto\noextrasrussian{\bbl@nonfrenchspacing}

Next we add a new enumeration style for Russian manuscripts with Cyrillic letters, and later on we define some math operator names in accordance with Russian typesetting traditions.

\Asbuk We begin by defining \Asbuk which works like \Alph, but produces (uppercase) Cyrillic letters intead of Latin ones. The letters YO, ISHRT, HRDSN, ERY, and SFTSN are skipped, as usual for such enumeration.

51.340 \def\Asbuk#1{\expandafter\@Asbuk\csname c@#1\endcsname}
51.341 \def\@Asbuk#1{\ifcase#1\or
51.342 \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRZH\or
51.343 \CYRZ\or\CYRI\or\CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or
51.344 \CYRP\or\CYRR\or\CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or
51.345 \CYRC\or\CYRCH\or\CYRSH\or\CYRSHCH\or\CYREREV\or\CYRYU\or
51.346 \CYRYA\else\@ctrerr\fi}

\asbuk The macro \asbuk is similar to \alph; it produces lowercase Russian letters.

51.347 \def\asbuk#1{\expandafter\@asbuk\csname c@#1\endcsname}
51.348 \def\@asbuk#1{\ifcase#1\or
51.349 \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrzh\or
51.350 \cyrz\or\cyri\or\cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or
51.351 \cyrp\or\cyrr\or\cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or
51.352 \cyrc\or\cyrch\or\cyrsh\or\cyrshch\or\cyrerev\or\cyryu\or
51.353 \cyrya\else\@ctrerr\fi}

Set up default Cyrillic math alphabets. To use Cyrillic letters in math mode user should load the textmath package before loading fontenc package (or babel). Note, that by default Cyrillic letters are taken from upright font in math mode (unlike Latin letters).

51.354 %\RequirePackage{textmath}
51.355 \@ifundefined{sym\cyrillicencoding letters}{}{%
51.356 \SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
51.357 \rmdefault\bfdefault\updefault
51.358 \DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}

And we need a few commands to be able to switch to different variants.

51.359 \DeclareMathAlphabet\cyrmathbf\cyrillicencoding
51.360 \rmdefault\bfdefault\updefault
51.361 \DeclareMathAlphabet\cyrmathsf\cyrillicencoding
51.362 \sfdefault\mddefault\updefault
51.363 \DeclareMathAlphabet\cyrmathit\cyrillicencoding
51.364 \rmdefault\mddefault\itdefault
51.365 \DeclareMathAlphabet\cyrmathtt\cyrillicencoding
51.366 \ttdefault\mddefault\updefault

51.367 %

51.368 \SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
51.369 \sfdefault\bfdefault\updefault
51.370 \SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
51.371 \rmdefault\bfdefault\itdefault

51.372 }

Some math functions in Russian math books have other names: e.g., sinh in Russian is written as sh etc. So we define a number of new math operators.

      \sinh:
51.373 \def\sh{\mathop{\operator@font sh}\nolimits}
   \cosh:
51.374 \def\ch{\mathop{\operator@font ch}\nolimits}
   \tan:
51.375 \def\tg{\mathop{\operator@font tg}\nolimits}
   \arctan:
51.376 \def\arctg{\mathop{\operator@font arctg}\nolimits}

arcctg:

51.377 \def\arcctg{\mathop{\operator@font arcctg}\nolimits}

The following macro conflicts with \th defined in Latin 1 encoding:

      \tanh:
51.378 \def\th{\mathop{\operator@font th}\nolimits}

   \cot:
51.379 \def\ctg{\mathop{\operator@font ctg}\nolimits}
   \coth:
51.380 \def\cth{\mathop{\operator@font cth}\nolimits}
   \csc:
51.381 \def\cosec{\mathop{\operator@font cosec}\nolimits}

And finally some other Russian mathematical symbols:

51.382 \def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
51.383 \def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
51.384 \def\nod{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrd.}}\nolimits}
51.385 \def\nok{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrk.}}\nolimits}
51.386 \def\NOD{\mathop{\cyrmathrm{\CYRN\CYRO\CYRD}}\nolimits}
51.387 \def\NOK{\mathop{\cyrmathrm{\CYRN\CYRO\CYRK}}\nolimits}
51.388 \def\Proj{\mathop{\cyrmathrm{\CYRP\cyrr}}\nolimits}

This is for compatibility with older Russian packages.

51.389 \DeclareRobustCommand{\No}{%
51.390 \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}

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.

51.391 \ldf@finish{russian}

51.392 ⟨/code⟩

52 The Bulgarian language

The file bulgarian.dtx^{62} provides the language-specific macros for the Bulgarian language.

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.

For this language the character " is made active. In table 27 an overview is given of its purpose.

"|  disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word.

"--- Cyrillic emdash in plain text.
"--~ Cyrillic emdash in compound names (surnames).
"--* Cyrillic emdash for denoting direct speech.

"" 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.

"`  for German left double quotes (looks like ,,).
"'  for German right double quotes (looks like “).
” "< for French left double quotes (looks like <<).
">  for French right double quotes (looks like >>).

Table 27: The extra definitions made bybulgarian

The quotes in table 27 can also be typeset by using the commands in table 28. The French quotes are also available as ligatures ‘<<’ and ‘>>’ in 8-bit Cyrillic

font encodings (LCY, X2, T2*) and as ‘<’ and ‘>’ characters in 7-bit Cyrillic font encodings (OT2 and LWN).

The quotation marks traditionally used in Bulgarian were borrowed from German o they keep their original names. French quotation marks may be seen as well in older books.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

52.1 ⟨∗code⟩

52.2 \LdfInit{bulgarian}{captionsbulgarian}

62The file described in this section has version number ? and was last revised on ?. This file was initially derived from the August-1998 version of russianb.dtx.

It is (reasonably) backward compatible with the 1994/1996 (non-babel) bulgarian style (bulgaria.sty) by Georgi Boshnakov—files prepared for that style should compile successfully (with vastly improved appearance due to usage of standard fonts).

\cdash--- Cyrillic emdash in plain text.
\cdash--~ Cyrillic emdash in compound names (surnames).
\cdash--* Cyrillic emdash for denoting direct speech.
\glqq  for German left double quotes (looks like,,).
\grqq  for German right double quotes (looks like “).
” \flqq  for French left double quotes (looks like <<).
\frqq  for French right double quotes (looks like >>).
\dq  the original quotes character (").

Table 28: More commands which produce quotes, defined by babel

When this file is read as an option, i.e., by the \usepackage command, 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.

52.3 \ifx\l@bulgarian\@undefined
52.4 \@nopatterns{Bulgarian}
52.5 \adddialect\l@bulgarian0

52.6 \fi

\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 fontenc package is loaded later, then … too bad!

52.7 \let\latinencoding\cf@encoding

The user may choose between different available Cyrillic encodings—e.g., X2, LCY, or LWN. If the user wants to use a font encoding other than the default (T2A), he has to load the corresponding file before bulgarian.sty. This may be done in the following way:

      \usepackage[LCY,OT1]{fontenc}     %overwrite the default encoding;
      \usepackage[english,bulgarian]{babel}

Note: most people would prefer the T2A to X2, because 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. 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 Bulgarian 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 L^{A}TEX in the order they were loaded. We set the \cyrillicencoding to the last loaded encoding in the list of supported Cyrillic encodings: OT2, LWN, LCY, X2, T2C, T2B, T2A, if any.

52.8 \def\reserved@a#1#2{%
52.9 \edef\reserved@b{#1}%
52.10 \edef\reserved@c{#2}%
52.11 \ifx\reserved@b\reserved@c
52.12  \let\cyrillicencoding\reserved@c

52.13 \fi}

52.14 \def\cdp@elt#1#2#3#4{%
52.15 \reserved@a{#1}{OT2}%
52.16 \reserved@a{#1}{LWN}%
52.17 \reserved@a{#1}{LCY}%
52.18 \reserved@a{#1}{X2}%
52.19 \reserved@a{#1}{T2C}%
52.20 \reserved@a{#1}{T2B}%
52.21 \reserved@a{#1}{T2A}}
52.22 \cdp@list

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.,

  lcyenc.def instead of LCYenc.def).
52.23 \ifx\cyrillicencoding\undefined
52.24 \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
52.25 \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
52.26 \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
52.27 \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
52.28 \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
52.29 \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
52.30 \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax

If \cyrillicencoding is still undefined, then the user seems not to have a properly installed distribution. A fatal error.

52.31 \ifx\cyrillicencoding\undefined
52.32  \PackageError{babel}%
52.33  {No Cyrillic encoding definition files were found}%
52.34  {Your installation is incomplete. \MessageBreak
52.35  You need at least one of the following files: \MessageBreak
52.36  \space\space
52.37  x2enc.def, t2aenc.def, t2benc.def, t2cenc.def, \MessageBreak
52.38  \space\space
52.39  lcyenc.def, lwnenc.def, ot2enc.def.}%
52.40 \else
     We avoid \usepackage[\cyrillicencoding]{fontenc} because we don’t

want to force the switch of \encodingdefault.

52.41  \lowercase
52.42  \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%

52.43 \fi 52.44 \fi

        \PackageInfo{babel}
          {Using `\cyrillicencoding' as a default Cyrillic encoding}%
52.45 \DeclareRobustCommand{\Bulgarian}{%
52.46 \fontencoding\cyrillicencoding\selectfont
52.47 \let\encodingdefault\cyrillicencoding
52.48 \expandafter\set@hyphenmins\bulgarianhyphenmins
52.49 \language\l@bulgarian}
52.50 \DeclareRobustCommand{\English}{%

52.51 \fontencoding\latinencoding\selectfont
52.52 \let\encodingdefault\latinencoding
52.53 \expandafter\set@hyphenmins\englishhyphenmins
52.54 \language\l@english}
52.55 \let\Bul\Bulgarian
52.56 \let\Bg\Bulgarian
52.57 \let\cyrillictext\Bulgarian
52.58 \let\cyr\Bulgarian
52.59 \let\Eng\English
52.60 \def\selectenglanguage{\selectlanguage{english}}
52.61 \def\selectbglanguage{\selectlanguage{bulgarian}}

Since the X2 encoding does not contain Latin letters,we should make some redefinitions of L^{A}TEX macros which implicitly produce Latin letters.

52.62 \expandafter\ifx\csname T@X2\endcsname\relax\else

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).
52.63 \def\@Alph@eng#1{{\fontencoding{\latinencoding}\selectfont
52.64  \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
52.65  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
52.66  X\or Y\or Z\else \@ctrerr\fi}}%
52.67 \def\@alph@eng#1{{\fontencoding{\latinencoding}\selectfont
52.68  \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
52.69  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
52.70  x\or y\or z\else \@ctrerr\fi}
52.71 \let\@Alph\@Alph@eng
52.72 \let\@alph\@alph@eng

Unfortunately, the commands \AA and \aa are not encoding dependent in L^{A}TEX (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 X2).

52.73 \DeclareTextSymbolDefault{\AA}{OT1}
52.74 \DeclareTextSymbolDefault{\aa}{OT1}
52.75 \DeclareTextCommand{\AA}{OT1}{\r A}
52.76 \DeclareTextCommand{\aa}{OT1}{\r a}

52.77 \fi

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.

52.78 \begingroup\catcode`\"=12
52.79 % uppercase greek letters:
52.80 \def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
52.81 "0000\@nil#1}
52.82 \def\@tempb#1"#2#3#4#5#6\@nil#7{%
52.83 \ifnum"#2=7 \count@"1#3#4#5\relax
52.84 \ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi

52.85 \fi}

 52.86 \@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
 52.87 \@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
 52.88 \@tempa\Omega
 52.89 % some accents:
 52.90 \def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
 52.91 \expandafter\@tempa\hat\relax\relax\@nil
 52.92 \ifx\@tempb\@tempc
 52.93 \def\@tempa#1\@nil{#1}%
 52.94 \def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
 52.95 \def\do#1"#2{}
 52.96 \def\@tempd#1{\expandafter\@tempb#1\@nil
 52.97 \ifnum\@tempc>"FFF
 52.98 \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%

52.99 \fi}

52.100 \@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
52.101 \@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar

52.102 \fi

52.103 \endgroup

The user should use the 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 inputenc package

   by \usepackage{inputenc}. We also removed \AtBeginDocument, so inputenc

should be used before babel.

52.104 \@ifpackageloaded{inputenc}{}{%
52.105 \def\reserved@a{LWN}%
52.106 \ifx\reserved@a\cyrillicencoding\else
52.107 \def\reserved@a{OT2}%
52.108 \ifx\reserved@a\cyrillicencoding\else
52.109 \PackageWarning{babel}%
52.110 {No input encoding specified for Bulgarian language}\fi\fi}

Now we define two commands that offer the possibility to switch between Cyrillic and Roman encodings.

\cyrillictext \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 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.

52.111 % \DeclareRobustCommand{\latintext}{%
52.112 % \fontencoding{\latinencoding}\selectfont
52.113 %   \def\encodingdefault{\latinencoding}}
52.114 \let\lat\latintext

\textcyrillic \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.)

52.115 \DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
52.116 % \DeclareTextFontCommand{\textlatin}{\latintext}

The next step consists of defining commands to switch to (and from) the Bulgarian language.

\captionsbulgarian The macro \captionsbulgarian defines all strings used in the four standard document classes provided with L^{A}TEX. The two commands \cyr and \lat activate Cyrillic resp. Latin encoding.

52.117 \addto\captionsbulgarian{%
52.118 \def\prefacename{%
52.119  {\cyr\CYRP\cyrr\cyre\cyrd\cyrg\cyro\cyrv\cyro\cyrr}}%
52.120 \def\refname{%
52.121  {\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
52.122 \def\abstractname{%
52.123  {\cyr\CYRA\cyrb\cyrs\cyrt\cyrr\cyra\cyrk\cyrt}}%
52.124 \def\bibname{%
52.125  {\cyr\CYRB\cyri\cyrb\cyrl\cyri\cyro\cyrg\cyrr\cyra\cyrf\cyri\cyrya}}%
52.126 \def\chaptername{%
52.127  {\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
52.128 \def\appendixname{%
52.129  {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyre}}%
52.130 \def\contentsname{%
52.131  {\cyr\CYRS\cyrhrdsn\cyrd\cyrhrdsn\cyrr\cyrzh\cyra\cyrn\cyri\cyre}}%
52.132 \def\listfigurename{%
52.133  {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\ \cyrf\cyri\cyrg\cyru\cyrr\cyri\cyrt\cyre}}%
52.134 \def\listtablename{%
52.135  {\cyr\CYRS\cyrp\cyri\cyrs\cyrhrdsn\cyrk\ \cyrn\cyra\ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyri\cyrt\cyre}}%
52.136 \def\indexname{%
52.137  {\cyr\CYRA\cyrz\cyrb\cyru\cyrch\cyre\cyrn\ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
52.138 \def\authorname{%
52.139  {\cyr\CYRI\cyrm\cyre\cyrn\cyre\cyrn\ \cyru\cyrk\cyra\cyrz\cyra\cyrt\cyre\cyrl}}%
52.140 \def\figurename{%
52.141  {\cyr\CYRF\cyri\cyrg\cyru\cyrr\cyra}}%
52.142 \def\tablename{%
52.143  {\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyra}}%
52.144 \def\partname{%
52.145  {\cyr\CYRCH\cyra\cyrs\cyrt}}%
52.146 \def\enclname{%
52.147  {\cyr\CYRP\cyrr\cyri\cyrl\cyro\cyrzh\cyre\cyrn\cyri\cyrya}}%
52.148 \def\ccname{%
52.149  {\cyr\cyrk\cyro\cyrp\cyri\cyrya}}%
52.150 \def\headtoname{%
52.151  {\cyr\CYRZ\cyra}}%
52.152 \def\pagename{%
52.153  {\cyr\CYRS\cyrt\cyrr.}}%
52.154 \def\seename{%
52.155  {\cyr\cyrv\cyrzh.}}%
52.156 \def\alsoname{%
52.157  {\cyr\cyrv\cyrzh.\ \cyrs\cyrhrdsn\cyrshch\cyro\ \cyri}}%
52.158 \def\proofname{Proof}% <-- Needs translation
52.159 \def\glossaryname{Glossary}% <-- Needs translation

52.160 }

\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.

52.161 \def\datebulgarian{%
52.162 \def\month@bulgarian{\ifcase\month\or
52.163  \cyrya\cyrn\cyru\cyra\cyrr\cyri\or
52.164  \cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or
52.165  \cyrm\cyra\cyrr\cyrt\or
52.166  \cyra\cyrp\cyrr\cyri\cyrl\or
52.167  \cyrm\cyra\cyrishrt\or
52.168  \cyryu\cyrn\cyri\or
52.169  \cyryu\cyrl\cyri\or
52.170  \cyra\cyrv\cyrg\cyru\cyrs\cyrt\or
52.171  \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or
52.172  \cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or
52.173  \cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or
52.174  \cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri\fi}%
52.175 \def\month@Roman{\expandafter\@Roman\month}%
52.176 \def\today{\number\day~\month@bulgarian\ \number\year~\cyrg.}%
52.177 \def\todayRoman{\number\day.\,\month@Roman.\,\number\year~\cyrg.}%

52.178 }

\todayRoman The month is often written with roman numbers in Bulgarian dates. Here we define date in this format:

52.179 \def\Romannumeral#1{\uppercase\expandafter{\romannumeral #1}}
52.180 \def\todayRoman{\number\day.\Romannumeral{\month}.\number\year~\cyrg.}

\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’.

52.181 \addto\extrasbulgarian{\cyrillictext}

When the encoding definition file was processed by L^{A}TEX the current font encoding is stored in \latinencoding, assuming that L^{A}TEX uses T1 or OT1 as default. Therefore we switch back to \latinencoding whenever the Bulgarian language is no longer ‘active’.

52.182 \addto\noextrasbulgarian{\latintext}

For Bulgarian the " character also is made active.

52.183 \initiate@active@char{"}

The code above is necessary because we need extra active characters. The character " is used as indicated in table 27. We specify that the Bulgarian group of shorthands should be used.

52.184 \addto\extrasbulgarian{\languageshorthands{bulgarian}}

These characters are ‘turned on’ once, later their definition may vary.

52.185 \addto\extrasbulgarian{%
52.186 \bbl@activate{"}}
52.187 \addto\noextrasbulgarian{%
52.188 \bbl@deactivate{"}}

      The X2 and 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 OT1) because the user may choose T2A to be the primary encoding, but it does not contain these characters.

52.189 ⟨∗spanishligs⟩

52.190 \declare@shorthand{bulgarian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
52.191 \declare@shorthand{bulgarian}{!`}{\UseTextSymbol{OT1}\textexclamdown}

52.192 ⟨/spanishligs⟩

To be able to define the function of ‘"’, we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math accent \"can now be typed as ‘"’.

52.193 \begingroup \catcode`\"12
52.194 \def\reserved@a{\endgroup
52.195 \defœÂSS{\mathchar"7019}
52.196 \def\dq{"}}
52.197 \reserved@a

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 T2* encodings.

52.198 \declare@shorthand{bulgarian}{"`}{\glqq}
52.199 \declare@shorthand{bulgarian}{"'}{\grqq}
52.200 \declare@shorthand{bulgarian}{"<}{\flqq}
52.201 \declare@shorthand{bulgarian}{">}{\frqq}

Some additional commands:

52.202 \declare@shorthand{bulgarian}{""}{\hskip\z@skip}
52.203 \declare@shorthand{bulgarian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
52.204 \declare@shorthand{bulgarian}{"=}{\nobreak-\hskip\z@skip}
52.205 \declare@shorthand{bulgarian}{"|}{%
52.206 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
52.207 \allowhyphens}{}}

The next two macros for "- and "--- are somewhat different. We must check whether the second token is a hyphen character:

52.208 \declare@shorthand{bulgarian}{"-}{%

If the next token is ‘-’, we typeset an emdash, otherwise a hyphen sign:

52.209 \def\bulgarian@sh@tmp{%
52.210  \if\bulgarian@sh@next-\expandafter\bulgarian@sh@emdash
52.211  \else\expandafter\bulgarian@sh@hyphen\fi

52.212 }%

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.
52.213 \futurelet\bulgarian@sh@next\bulgarian@sh@tmp}

Here are the definitions of hyphen and emdash. First the hyphen:

52.214 \def\bulgarian@sh@hyphen{\nobreak\-\bbl@allowhyphens}

For the emdash definition, there are the two parameters: we must ‘eat’ two last hyphen signs of our emdash …:

52.215 \def\bulgarian@sh@emdash#1#2{\cdash-#1#2}

\cdash … these two parameters are useful for another macro: \cdash:

52.216 \ifx\cdash\undefined % should be defined earlier
52.217 \def\cdash#1#2#3{\def\tempx@{#3}%
52.218 \def\tempa@{-}\def      empb@{~}\def    empc@{*}%
52.219 \ifx\tempx@\tempa@\@Acdash\else
52.220 \ifx\tempx@\tempb@\@Bcdash\else
52.221 \ifx\tempx@\tempc@\@Ccdash\else
52.222  \errmessage{Wrong usage of cdash}\fi\fi\fi}

second parameter (or third for \cdash) shows what kind of emdash to create in next step

"---

ordinary (plain) Cyrillic emdash inside text: an unbreakable thinspace will be inserted before only in case of a 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;

52.223 % What is more grammatically: .2em or .2\fontdimen6\font?
52.224 \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
52.225 \cyrdash\hskip.2em\ignorespaces}%
"--~

emdash in compound names or surnames (like Mendeleev–Klapeiron); this dash has no space characters around; after the dash some space is added

\exhyphenalty
52.226 \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
52.227 \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%

"--* for denoting direct speech (a space like \enskip must follow the emdash);

52.228 \def\@Ccdash{\leavevmode
52.229 \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%

52.230 %\fi

\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 ---.

52.231 % Is there an IF necessary?
52.232 \ifx\cyrdash\undefined
52.233 \def\cyrdash{\hbox to.8em{--\hss--}}

52.234 \fi

Here a really new macro—to place thinspace between initials. This macro used instead of \, allows hyphenation in the following surname.

52.235 \declare@shorthand{bulgarian}{",}{\nobreak\hskip.2em\ignorespaces}

The Bulgarian hyphenation patterns can be used with \lefthyphenmin and

   \righthyphenmin set to 2.
52.236 \providehyphenmins{\CurrentOption}{\tw@\tw@}

52.237 \fi

Now the action \extrasbulgarian has to execute is to make sure that the command \frenchspacing is in effect. If this is not the case the execution of \noextrasbulgarian will switch it off again.

52.238 \addto\extrasbulgarian{\bbl@frenchspacing}
52.239 \addto\noextrasbulgarian{\bbl@nonfrenchspacing}

Make the double quotes produce the traditional quotes used in Bulgarian texts (these are the German quotes).

52.240 % \initiate@active@char{`}
52.241 %  \initiate@active@char{'}
52.242 % \addto\extrasbulgarian{%
52.243 %   \bbl@activate{`}}
52.244 % \addto\extrasbulgarian{%
52.245 %   \bbl@activate{'}}
52.246 % \addto\noextrasbulgarian{%
52.247 %   \bbl@deactivate{`}}
52.248 % \addto\noextrasbulgarian{%
52.249 %   \bbl@deactivate{'}}
52.250 % \def\mlron{\bbl@activate{`}\bbl@activate{'}}
52.251 % \def\mlroff{\bbl@deactivate{`}\bbl@deactivate{'}}
52.252 % \declare@shorthand{bulgarian}{``}{\glqq}
52.253 % \declare@shorthand{bulgarian}{''}{\grqq}

Next we add a new enumeration style for Bulgarian manuscripts with Cyrillic letters,and later on we define some math operator names in accordance with Bulgarian typesetting traditions.

\@Alph@bul We begin by defining \@Alph@bul which works like \@Alph, but produces (uppercase) Cyrillic letters intead of Latin ones. The letters ISHRT, HRDSN and SFTSN are skipped, as usual for such enumeration.

52.254 \def\enumBul{\let\@Alph\@Alph@bul \let\@alph\@alph@bul}
52.255 \def\enumEng{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
52.256 \def\enumLat{\let\@Alph\@Alph@eng \let\@alph\@alph@eng}
52.257 \addto\extrasbulgarian{\enumBul}
52.258 \addto\noextrasbulgarian{\enumLat}
52.259 \def\@Alph@bul#1{%
52.260 \ifcase#1\or
52.261 \CYRA\or \CYRB\or \CYRV\or \CYRG\or \CYRD\or \CYRE\or \CYRZH\or
52.262 \CYRZ\or \CYRI\or \CYRK\or \CYRL\or \CYRM\or \CYRN\or \CYRO\or
52.263 \CYRP\or \CYRR\or \CYRS\or \CYRT\or \CYRU\or \CYRF\or \CYRH\or
52.264 \CYRC\or \CYRCH\or \CYRSH\or \CYRSHCH\or \CYRYU\or \CYRYA\else
52.265 \@ctrerr\fi

52.266 }

52.267 \def\@Alph@eng#1{%

52.268 \ifcase#1\or
52.269 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
52.270 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
52.271 \@ctrerr\fi

52.272 }

\@alph@bul The macro \@alph@bul is similar to \@Alph@bul; it produces lowercase Bulgarian letters.

52.273 \def\@alph@bul#1{%
52.274 \ifcase#1\or
52.275 \cyra\or \cyrb\or \cyrv\or \cyrg\or \cyrd\or \cyre\or \cyrzh\or
52.276 \cyrz\or \cyri\or \cyrk\or \cyrl\or \cyrm\or \cyrn\or \cyro\or
52.277 \cyrp\or \cyrr\or \cyrs\or \cyrt\or \cyru\or \cyrf\or \cyrh\or
52.278 \cyrc\or \cyrch\or \cyrsh\or \cyrshch\or \cyryu\or \cyrya\else
52.279 \@ctrerr\fi

52.280 }

52.281 \def\@alph@eng#1{%
52.282 \ifcase#1\or
52.283 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
52.284 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
52.285 \@ctrerr\fi

52.286 }

Set up default Cyrillic math alphabets. To use Cyrillic letters in math mode user should load the textmath package before loading fontenc package (or babel). Note,that by default Cyrillic letters are taken from upright font in math mode (unlike Latin letters).

52.287 %\RequirePackage{textmath}
52.288 \@ifundefined{sym\cyrillicencoding letters}{}{%
52.289 \SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
52.290 \rmdefault\bfdefault\updefault
52.291 \DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}

And we need a few commands to be able to switch to different variants.

52.292 \DeclareMathAlphabet\cyrmathbf\cyrillicencoding
52.293 \rmdefault\bfdefault\updefault
52.294 \DeclareMathAlphabet\cyrmathsf\cyrillicencoding
52.295 \sfdefault\mddefault\updefault
52.296 \DeclareMathAlphabet\cyrmathit\cyrillicencoding
52.297 \rmdefault\mddefault\itdefault
52.298 \DeclareMathAlphabet\cyrmathtt\cyrillicencoding
52.299 \ttdefault\mddefault\updefault
52.300 \SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
52.301 \sfdefault\bfdefault\updefault
52.302 \SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
52.303 \rmdefault\bfdefault\itdefault

52.304 }

Some math functions in Bulgarian math books have other names: e.g., sinh in Bulgarian is written as sh etc. So we define a number of new math operators.

      \sinh:
52.305 \def\sh{\mathop{\operator@font sh}\nolimits}

      \cosh:
52.306 \def\ch{\mathop{\operator@font ch}\nolimits}
      \tan:
52.307 \def\tg{\mathop{\operator@font tg}\nolimits}
      \arctan:
52.308 \def\arctg{\mathop{\operator@font arctg}\nolimits}
      \arccot:
52.309 \def\arcctg{\mathop{\operator@font arcctg}\nolimits}

The following macro conflicts with \th defined in Latin 1 encoding: \tanh:

52.310 \def\th{\mathop{\operator@font th}\nolimits}
      \cot:
52.311 \def\ctg{\mathop{\operator@font ctg}\nolimits}
      \coth:
52.312 \def\cth{\mathop{\operator@font cth}\nolimits}
      \csc:
52.313 \def\cosec{\mathop{\operator@font cosec}\nolimits}

This is for compatibility with older Bulgarian packages.

52.314 \DeclareRobustCommand{\No}{%
52.315  \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}

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.

52.316 \ldf@finish{bulgarian}

52.317 ⟨/code⟩

53 The Ukrainian language

The file ukraineb.dtx^{63} defines all the language-specific macros for the Ukrainian language. It needs the file cyrcod for success documentation with Ukrainian encodings (see below).

For this language the character " is made active. In table 29 an overview is given of its purpose.

"|  disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word.

"--- Cyrillic emdash in plain text.
"--~ Cyrillic emdash in compound names (surnames).
"--* Cyrillic emdash for denoting direct speech.

"" like "-, but producing no hyphen sign (for compund 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, allow-

ing hyphenation in the composing words. ", thinspace for initials with a breakpoint in following

surname.

"`  for German left double quotes (looks like ,,).
"'  for German right double quotes (looks like “).
” "< for French left double quotes (looks like <<).
">  for French right double quotes (looks like >>).

Table 29: The extra definitions made by ukraineb

The quotes in table 29 (see, also table 25) can also be typeset by using the commands in table 30 (see, also table 26).

\cdash--- Cyrillic emdash in plain text.
\cdash--~ Cyrillic emdash in compound names (surnames).
\cdash--* Cyrillic emdash for denoting direct speech.
\glqq  for German left double quotes (looks like ,,).
\grqq  for German right double quotes (looks like “).
” \flqq  for French left double quotes (looks like <<).
\frqq  for French right double quotes (looks like >>).
\dq  the original quotes character (").

Table 30: More commands which produce quotes, defined by babel

The French quotes are also available as ligatures ‘<<’ and ‘>>’ in 8-bit Cyrillic font encodings (LCY, X2, T2*) and as ‘<’ and ‘>’ characters in 7-bit Cyrillic font encodings (OT2 and LWN).

63The file described in this section has version number ?. This file was derived from the russianb.dtx version 1.1g.

The quotation marks traditionally used in Ukrainian and Russian languages were borrowed from other languages (e.g. French and German) so they keep their original names.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

53.1 ⟨∗code⟩

53.2 \LdfInit{ukrainian}{captionsukrainian}

When this file is read as an option, i.e., by the \usepackage command, ukraineb will be an ‘unknown’ language, in which case we have to make it known. So we check for the existence of \l@ukrainian to see whether we have to do something here.

53.3 \ifx\l@ukrainian\@undefined
53.4 \@nopatterns{Ukrainian}
53.5 \adddialect\l@ukrainian0

53.6 \fi

\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 fontenc package is loaded later, then… too bad!

53.7 \let\latinencoding\cf@encoding

The user may choose between different available Cyrillic encodings—e.g., X2, LCY, or LWN. Hopefully, X2 will eventually replace the two latter encodings (LCY and LWN). If the user wants to use another font encoding than the default (T2A), he has to load the corresponding file before ukraineb.sty. This may be done in the following way:

      % override the default X2 encoding used in Babel
      \usepackage[LCY,OT1]{fontenc}
      \usepackage[english,ukrainian]{babel}

Note: for the Ukrainian language, the T2A encoding is better than X2, because 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 the encodings known to L^{A}TEX in the order they were loaded. We set the \cyrillicencoding to the last loaded encoding in the list of supported Cyrillic encodings: OT2, LWN, LCY, X2, T2C, T2B, T2A, if any.

53.8 \def\reserved@a#1#2{%
53.9 \edef\reserved@b{#1}%
53.10 \edef\reserved@c{#2}%
53.11 \ifx\reserved@b\reserved@c
53.12  \let\cyrillicencoding\reserved@c

53.13 \fi}

53.14 \def\cdp@elt#1#2#3#4{%
53.15 \reserved@a{#1}{OT2}%
53.16 \reserved@a{#1}{LWN}%
53.17 \reserved@a{#1}{LCY}%
53.18 \reserved@a{#1}{X2}%
53.19 \reserved@a{#1}{T2C}%
53.20 \reserved@a{#1}{T2B}%

53.21 \reserved@a{#1}{T2A}}
53.22 \cdp@list

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.,

  lcyenc.def instead of LCYenc.def).
53.23 \ifx\cyrillicencoding\undefined
53.24 \IfFileExists{ot2enc.def}{\def\cyrillicencoding{OT2}}\relax
53.25 \IfFileExists{lwnenc.def}{\def\cyrillicencoding{LWN}}\relax
53.26 \IfFileExists{lcyenc.def}{\def\cyrillicencoding{LCY}}\relax
53.27 \IfFileExists{x2enc.def}{\def\cyrillicencoding{X2}}\relax
53.28 \IfFileExists{t2cenc.def}{\def\cyrillicencoding{T2C}}\relax
53.29 \IfFileExists{t2benc.def}{\def\cyrillicencoding{T2B}}\relax
53.30 \IfFileExists{t2aenc.def}{\def\cyrillicencoding{T2A}}\relax

If \cyrillicencoding is still undefined, then the user seems not to have a properly installed distribution. A fatal error.

53.31 \ifx\cyrillicencoding\undefined
53.32  \PackageError{babel}%
53.33  {No Cyrillic encoding definition files were found}%
53.34  {Your installation is incomplete.\MessageBreak
53.35  You need at least one of the following files:\MessageBreak
53.36  \space\space
53.37  x2enc.def, t2aenc.def, t2benc.def, t2cenc.def,\MessageBreak
53.38  \space\space
53.39  lcyenc.def, lwnenc.def, ot2enc.def.}%
53.40 \else
     We avoid \usepackage[\cyrillicencoding]{fontenc} because we don’t

want to force the switch of \encodingdefault.

53.41  \lowercase
53.42  \expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%

53.43 \fi 53.44 \fi

        \PackageInfo{babel}
          {Using `\cyrillicencoding' as a default Cyrillic encoding}%
53.45 \DeclareRobustCommand{\Ukrainian}{%
53.46 \fontencoding\cyrillicencoding\selectfont
53.47 \let\encodingdefault\cyrillicencoding
53.48 \expandafter\set@hyphenmins\ukrainianhyphenmins
53.49 \language\l@ukrainian}%
53.50 \DeclareRobustCommand{\English}{%
53.51 \fontencoding\latinencoding\selectfont
53.52 \let\encodingdefault\latinencoding
53.53 \expandafter\set@hyphenmins\englishhyphenmins
53.54 \language\l@english}%
53.55 \let\Ukr\Ukrainian
53.56 \let\Eng\English
53.57 \let\cyrillictext\Ukrainian
53.58 \let\cyr\Ukrainian

Since the X2 encoding does not contain Latin letters, we should make some redefinitions of L^{A}TEX macros which implicitly produce Latin letters.

53.59 \expandafter\ifx\csname T@X2\endcsname\relax\else

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).
53.60 \def\@alph#1{{\fontencoding{\latinencoding}\selectfont
53.61  \ifcase#1\or
53.62  a\or b\or c\or d\or e\or f\or g\or h\or
53.63  i\or j\or k\or l\or m\or n\or o\or p\or
53.64  q\or r\or s\or t\or u\or v\or w\or x\or
53.65  y\or z\else\@ctrerr\fi}}%
53.66 \def\@Alph#1{{\fontencoding{\latinencoding}\selectfont
53.67  \ifcase#1\or
53.68  A\or B\or C\or D\or E\or F\or G\or H\or
53.69  I\or J\or K\or L\or M\or N\or O\or P\or
53.70  Q\or R\or S\or T\or U\or V\or W\or X\or
53.71  Y\or Z\else\@ctrerr\fi}}%

Unfortunately, the commands \AA and \aa are not encoding dependent in L^{A}TEX (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 X2).

53.72 \DeclareTextSymbolDefault{\AA}{OT1}
53.73 \DeclareTextSymbolDefault{\aa}{OT1}
53.74 \DeclareTextCommand{\aa}{OT1}{\r a}
53.75 \DeclareTextCommand{\AA}{OT1}{\r A}

53.76 \fi

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.

53.77 % \begingroup\catcode`\"=12
53.78 % % uppercase greek letters:
53.79 % \def\@tempa#1{\expandafter\@tempb\meaning#1\relax\relax\relax\relax
53.80 %   "0000\@nil#1}
53.81 % \def\@tempb#1"#2#3#4#5#6\@nil#7{%
53.82 %   \ifnum"#2=7 \count@"1#3#4#5\relax
53.83 %     \ifnum\count@<"1000 \else \global\mathchardef#7="0#3#4#5\relax \fi
53.84 %   \fi}
53.85 % \@tempa\Gamma\@tempa\Delta\@tempa\Theta\@tempa\Lambda\@tempa\Xi
53.86 % \@tempa\Pi\@tempa\Sigma\@tempa\Upsilon\@tempa\Phi\@tempa\Psi
53.87 % \@tempa\Omega
53.88 % % some accents:
53.89 % \def\@tempa#1#2\@nil{\def\@tempc{#1}}\def\@tempb{\mathaccent}
53.90 % \expandafter\@tempa\hat\relax\relax\@nil
53.91 % \ifx\@tempb\@tempc
53.92 %   \def\@tempa#1\@nil{#1}%
53.93 %   \def\@tempb#1{\afterassignment\@tempa\mathchardef\@tempc=}%
53.94 %   \def\do#1"#2{}

 53.95 %   \def\@tempd#1{\expandafter\@tempb#1\@nil
 53.96 %     \ifnum\@tempc>"FFF
 53.97 %       \xdef#1{\mathaccent"\expandafter\do\meaning\@tempc\space}%
 53.98 %     \fi}
 53.99 %   \@tempd\hat\@tempd\check\@tempd\tilde\@tempd\acute\@tempd\grave
53.100 %   \@tempd\dot\@tempd\ddot\@tempd\breve\@tempd\bar

53.101 % \fi

53.102 % \endgroup

The user must use the 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 inputenc package

   by \usepackage{inputenc}. We also removed \AtBeginDocument, so inputenc

should be used before babel.

53.103 \@ifpackageloaded{inputenc}{}{%
53.104 \def\reserved@a{LWN}%
53.105 \ifx\reserved@a\cyrillicencoding\else
53.106  \def\reserved@a{OT2}%
53.107  \ifx\reserved@a\cyrillicencoding\else
53.108  \PackageWarning{babel}%
53.109  {No input encoding specified for Ukrainian language}
53.110 \fi\fi}

Now we define two commands that offer the possibility to switch between Cyrillic and Roman encodings.

\cyrillictext \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 declarations, for shorter peaces of text the commands \textlatin and \textcyrillic can be used.

53.111 \DeclareRobustCommand{\latintext}{%
53.112 \fontencoding{\latinencoding}\selectfont
53.113 \def\encodingdefault{\latinencoding}}
53.114 \let\lat\latintext

\textcyrillic \textlatin These commands take an argument which is then typeset using the requested font

encoding.

53.115 \DeclareTextFontCommand{\textcyrillic}{\cyrillictext}
53.116 \DeclareTextFontCommand{\textlatin}{\latintext}

We make the TEX

53.117 \ifx\ltxTeX\undefined\let\ltxTeX\TeX\fi
53.118 \ProvideTextCommandDefault{\TeX}{\textlatin{\ltxTeX}}

and L^{A}TEX logos encoding independent.

53.119 \ifx\ltxLaTeX\undefined\let\ltxLaTeX\LaTeX\fi
53.120 \ProvideTextCommandDefault{\LaTeX}{\textlatin{\ltxLaTeX}}

The next step consists of defining commands to switch to (and from) the Ukrainian language.

\captionsukrainian The macro \captionsukrainian defines all strings used in the four standard document classes provided with L^{A}TEX. The two commands \cyr and \lat activate Cyrillic resp. Latin encoding.

53.121 \addto\captionsukrainian{%
53.122 \def\prefacename{{\cyr\CYRV\cyrs\cyrt\cyru\cyrp}}%
53.123 % \def\prefacename{{\cyr\CYRP\cyre\cyrr\cyre\cyrd\cyrm\cyro\cyrv\cyra}}%
53.124 \def\refname{%
53.125  {\cyr\CYRL\cyrii\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
53.126 %  \def\refname{%
53.127 %    {\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
53.128 %         \ \cyrp\cyro\cyrs\cyri\cyrl\cyra\cyrn\cyrsftsn}}%
53.129 \def\abstractname{%
53.130  {\cyr\CYRA\cyrn\cyro\cyrt\cyra\cyrc\cyrii\cyrya}}%
53.131 %  \def\abstractname{{\cyr\CYRR\cyre\cyrf\cyre\cyrr\cyra\cyrt}}%
53.132 \def\bibname{%
53.133  {\cyr\CYRB\cyrii\cyrb\cyrl\cyrii\cyro\cyrgup\cyrr\cyra\cyrf\cyrii\cyrya}}%
53.134 % \def\bibname{{\cyr\CYRL\cyrii\cyrt\cyre\cyrr\cyra\cyrt\cyru\cyrr\cyra}}%
53.135 \def\chaptername{{\cyr\CYRR\cyro\cyrz\cyrd\cyrii\cyrl}}%
53.136 %  \def\chaptername{{\cyr\CYRG\cyrl\cyra\cyrv\cyra}}%
53.137 \def\appendixname{{\cyr\CYRD\cyro\cyrd\cyra\cyrt\cyro\cyrk}}%
53.138 \def\contentsname{{\cyr\CYRZ\cyrm\cyrii\cyrs\cyrt}}%
53.139 \def\listfigurename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
53.140  \ \cyrii\cyrl\cyryu\cyrs\cyrt\cyrr\cyra\cyrc\cyrii\cyrishrt}}%
53.141 \def\listtablename{{\cyr\CYRP\cyre\cyrr\cyre\cyrl\cyrii\cyrk
53.142  \ \cyrt\cyra\cyrb\cyrl\cyri\cyrc\cyrsftsn}}%
53.143 \def\indexname{{\cyr\CYRP\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
53.144 \def\authorname{{\cyr\CYRII\cyrm\cyre\cyrn\cyrn\cyri\cyrishrt
53.145  \ \cyrp\cyro\cyrk\cyra\cyrzh\cyrch\cyri\cyrk}}%
53.146 \def\figurename{{\cyr\CYRR\cyri\cyrs.}}%
53.147 %  \def\figurename{\cyr\CYRR\cyri\cyrs\cyru\cyrn\cyro\cyrk}}%
53.148 \def\tablename{{\cyr\CYRT\cyra\cyrb\cyrl.}}%
53.149 %  \def\tablename{\cyr\CYRT\cyra\cyrb\cyrl\cyri\cyrc\cyrya}}%
53.150 \def\partname{{\cyr\CYRCH\cyra\cyrs\cyrt\cyri\cyrn\cyra}}%
53.151 \def\enclname{{\cyr\cyrv\cyrk\cyrl\cyra\cyrd\cyrk\cyra}}%
53.152 \def\ccname{{\cyr\cyrk\cyro\cyrp\cyrii\cyrya}}%
53.153 \def\headtoname{{\cyr\CYRD\cyro}}%
53.154 \def\pagename{{\cyr\cyrs.}}%
53.155 %  \def\pagename{{\cyr\cyrs\cyrt\cyro\cyrr\cyrii\cyrn\cyrk\cyra}}%
53.156 \def\seename{{\cyr\cyrd\cyri\cyrv.}}%
53.157 \def\alsoname{{\cyr\cyrd\cyri\cyrv.\ \cyrt\cyra\cyrk\cyro\cyrzh}}
53.158 \def\proofname{{\cyr\CYRD\cyro\cyrv\cyre\cyrd\cyre\cyrn\cyrn\cyrya}}%
53.159 \def\glossaryname{{\cyr\CYRS\cyrl\cyro\cyrv\cyrn\cyri\cyrk\ %
53.160  \cyrt\cyre\cyrr\cyrm\cyrii\cyrn\cyrii\cyrv}}%

53.161 }

\dateukrainian The macro \dateukrainian redefines the command \today to produce Ukrainian dates.

53.162 \def\dateukrainian{%
53.163 \def\today{\number\day~\ifcase\month\or
53.164  \cyrs\cyrii\cyrch\cyrn\cyrya\or
53.165  \cyrl\cyryu\cyrt\cyro\cyrg\cyro\or
53.166  \cyrb\cyre\cyrr\cyre\cyrz\cyrn\cyrya\or
53.167  \cyrk\cyrv\cyrii\cyrt\cyrn\cyrya\or
53.168  \cyrt\cyrr\cyra\cyrv\cyrn\cyrya\or
53.169  \cyrch\cyre\cyrr\cyrv\cyrn\cyrya\or
53.170  \cyrl\cyri\cyrp\cyrn\cyrya\or
53.171  \cyrs\cyre\cyrr\cyrp\cyrn\cyrya\or

53.172  \cyrv\cyre\cyrr\cyre\cyrs\cyrn\cyrya\or
53.173  \cyrzh\cyro\cyrv\cyrt\cyrn\cyrya\or
53.174  \cyrl\cyri\cyrs\cyrt\cyro\cyrp\cyra\cyrd\cyra\or
53.175  \cyrg\cyrr\cyru\cyrd\cyrn\cyrya\fi
53.176  \space\number\year~\cyrr.}}

\extrasukrainian The macro \extrasukrainian will perform all the extra definitions needed for the Ukrainian language. The macro \noextrasukrainian is used to cancel the

actions of \extrasukrainian.

The first action we define is to switch on the selected Cyrillic encoding whenever we enter ‘ukrainian’.

53.177 \addto\extrasukrainian{\cyrillictext}

When the encoding definition file was processed by L^{A}TEX the current font encoding is stored in \latinencoding, assuming that L^{A}TEX uses T1 or OT1 as default. Therefore we switch back to \latinencoding whenever the Ukrainian language is no longer ‘active’.

53.178 \addto\noextrasukrainian{\latintext}

Next we must allow hyphenation in the Ukrainian words with apostrophe whenever we enter ‘ukrainian’. This solution was proposed by Vladimir Volovich <vvv@vvv.vsu.ru>

53.179 \addto\extrasukrainian{\lccode`\'=`\'}
53.180 \addto\noextrasukrainian{\lccode`\'=0}

\verbatim@font In order to get both Latin and Cyrillic letters in verbatim text we need to change the definition of an internal L^{A}TEX command somewhat:

53.181 %\def\verbatim@font{%
53.182 %  \let\encodingdefault\latinencoding
53.183 %  \normalfont\ttfamily
53.184 %  \expandafter\def\csname\cyrillicencoding-cmd\endcsname##1##2{%
53.185 %    \ifx\protect\@typeset@protect
53.186 %      \begingroup\UseTextSymbol\cyrillicencoding##1\endgroup
53.187 %    \else\noexpand##1\fi}}

The category code of the characters ‘:’, ‘;’, ‘!’, and ‘?’ is made \active to insert a little white space.

For Ukrainian (as well as for Russian and German) the " character also is made active.

Note: It is very questionable whether the Russian typesetting tradition requires additional spacing before those punctuation signs. Therefore, we make the corresponding code optional. If you need it, then define the frenchpunct docstrip

option in babel.ins.

Borrowed from french. Some users dislike automatic insertion of a space before ‘double punctuation’, and prefer to decide themselves whether a space should be added or not; so a hook \NoAutoSpaceBeforeFDP is provided: if this command is added (in file ukraineb.cfg, or anywhere in a document) ukraineb will respect your typing, and introduce a suitable space before ‘double punctuation’ if and only if a space is typed in the source file before those signs.

The command \AutoSpaceBeforeFDP switches back to the default behavior of

ukraineb.

53.188 ⟨∗frenchpunct⟩

53.189 \initiate@active@char{:}
53.190 \initiate@active@char{;}

53.191 ⟨/frenchpunct⟩ 53.192 ⟨∗frenchpunct | spanishligs⟩

53.193 \initiate@active@char{!}
53.194 \initiate@active@char{?}

53.195 ⟨/frenchpunct | spanishligs⟩

53.196 \initiate@active@char{"}

The code above is necessary because we need extra active characters. The character " is used as indicated in table 29.

We specify that the Ukrainian group of shorthands should be used.

53.197 \addto\extrasukrainian{\languageshorthands{ukrainian}}

These characters are ‘turned on’ once, later their definition may vary.

53.198 \addto\extrasukrainian{%
53.199 ⟨frenchpunct⟩ \bbl@activate{:}\bbl@activate{;}%
53.200 ⟨frenchpunct | spanishligs⟩ \bbl@activate{!}\bbl@activate{?}%
53.201 \bbl@activate{"}}
53.202 \addto\noextrasukrainian{%
53.203 ⟨frenchpunct⟩ \bbl@deactivate{:}\bbl@deactivate{;}%
53.204 ⟨frenchpunct | spanishligs⟩ \bbl@deactivate{!}\bbl@deactivate{?}%
53.205 \bbl@deactivate{"}}
      The X2 and 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 OT1) because the user may choose T2A to be the primary encoding, but it does not contain these characters.

53.206 ⟨∗spanishligs⟩

53.207 \declare@shorthand{ukrainian}{?`}{\UseTextSymbol{OT1}\textquestiondown}
53.208 \declare@shorthand{ukrainian}{!`}{\UseTextSymbol{OT1}\textexclamdown}

53.209 ⟨/spanishligs⟩

\ukrainian@sh@;@ \ukrainian@sh@:@ \ukrainian@sh@!@ \ukrainian@sh@?@ We have to reduce the amount of white space before ;, : and !. This should only

happen in horizontal mode, hence the test with \ifhmode.

53.210 ⟨∗frenchpunct⟩

53.211 \declare@shorthand{ukrainian}{;}{%
53.212 \ifhmode

In horizontal mode we check for the presence of a ‘space’, ‘unskip’ if it exists and place a 0.1em kerning.

53.213  \ifdim\lastskip>\z@
53.214  \unskip\nobreak\kern.1em

53.215 \else

If no space has been typed, we add \FDP@thinspace which will be defined, up to the user’s wishes, as an automatic added thinspace, or as \@empty.

53.216  \FDP@thinspace

53.217 \fi 53.218 \fi

Now we can insert a ‘;’ character.

53.219 \string;}

The other definitions are very similar.

53.220 \declare@shorthand{ukrainian}{:}{%
53.221 \ifhmode
53.222  \ifdim\lastskip>\z@
53.223  \unskip\nobreak\kern.1em

53.224 \else

53.225  \FDP@thinspace

53.226 \fi 53.227 \fi

53.228 \string:}
53.229 \declare@shorthand{ukrainian}{!}{%
53.230 \ifhmode
53.231  \ifdim\lastskip>\z@
53.232  \unskip\nobreak\kern.1em

53.233 \else

53.234  \FDP@thinspace

53.235 \fi 53.236 \fi

53.237 \string!}
53.238 \declare@shorthand{ukrainian}{?}{%
53.239 \ifhmode
53.240  \ifdim\lastskip>\z@
53.241  \unskip\nobreak\kern.1em

53.242 \else

53.243  \FDP@thinspace

53.244 \fi 53.245 \fi

53.246 \string?}
\AutoSpaceBeforeFDP \NoAutoSpaceBeforeFDP \FDP@thinspace  \FDP@thinspace is defined as unbreakable spaces if \AutoSpaceBeforeFDP is

activated or as \@empty if \NoAutoSpaceBeforeFDP is in use. The default is

   \AutoSpaceBeforeFDP.
53.247 \def\AutoSpaceBeforeFDP{%
53.248  \def\FDP@thinspace{\nobreak\kern.1em}}
53.249 \def\NoAutoSpaceBeforeFDP{\let\FDP@thinspace\@empty}
53.250 \AutoSpaceBeforeFDP

\FDPon \FDPoff The next macros allow to switch on/off activeness of double punctuation signs.

53.251 \def\FDPon{\bbl@activate{:}%
53.252  \bbl@activate{;}%
53.253  \bbl@activate{?}%
53.254  \bbl@activate{!}}
53.255 \def\FDPoff{\bbl@deactivate{:}%
53.256  \bbl@deactivate{;}%
53.257  \bbl@deactivate{?}%
53.258  \bbl@deactivate{!}}

\system@sh@:@ \system@sh@!@ \system@sh@?@ \system@sh@;@ When the active characters appear in an environment where their Ukrainian behaviour is not wanted they should give an ‘expected’ result. Therefore we define shorthands at system level as well.

53.259 \declare@shorthand{system}{:}{\string:}
53.260 \declare@shorthand{system}{;}{\string;}

53.261 ⟨/frenchpunct⟩ 53.262 ⟨∗frenchpunct&!spanishligs⟩

53.263 \declare@shorthand{system}{!}{\string!}
53.264 \declare@shorthand{system}{?}{\string?}

53.265 ⟨/frenchpunct&!spanishligs⟩

To be able to define the function of ‘"’, we first define a couple of ‘support’ macros.

\dq We save the original double quote character in \dq to keep it available, the math accent \" can now be typed as ‘"’.

53.266 \begingroup \catcode`\"12
53.267 \def\reserved@a{\endgroup
53.268 \def\@SS{\mathchar"7019 }
53.269 \def\dq{"}}
53.270 \reserved@a

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 T2* encodings.

53.271 \declare@shorthand{ukrainian}{"`}{\glqq}
53.272 \declare@shorthand{ukrainian}{"'}{\grqq}
53.273 \declare@shorthand{ukrainian}{"<}{\flqq}
53.274 \declare@shorthand{ukrainian}{">}{\frqq}

Some additional commands:

53.275 \declare@shorthand{ukrainian}{""}{\hskip\z@skip}
53.276 \declare@shorthand{ukrainian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
53.277 \declare@shorthand{ukrainian}{"=}{\nobreak-\hskip\z@skip}
53.278 \declare@shorthand{ukrainian}{"|}{%
53.279 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
53.280  \allowhyphens}{}}

The next two macros for "- and "--- are somewhat different. We must check whether the second token is a hyphen character:

53.281 \declare@shorthand{ukrainian}{"-}{%

If the next token is ‘-’, we typeset an emdash, otherwise a hyphen sign:

53.282 \def\ukrainian@sh@tmp{%
53.283  \if\ukrainian@sh@next-\expandafter\ukrainian@sh@emdash
53.284  \else\expandafter\ukrainian@sh@hyphen\fi

53.285 }%

TEX looks for the next token after the first ‘-’: the meaning of this token is

   written to \ukrainian@sh@next and \ukrainian@sh@tmp is called.
53.286 \futurelet\ukrainian@sh@next\ukrainian@sh@tmp}

Here are the definitions of hyphen and emdash. First the hyphen:

53.287 \def\ukrainian@sh@hyphen{%
53.288 \nobreak\-\bbl@allowhyphens}

For the emdash definition, there are the two parameters: we must ‘eat’ two last hyphen signs of our emdash…:

53.289 \def\ukrainian@sh@emdash#1#2{\cdash-#1#2}

\cdash … these two parameters are useful for another macro: \cdash:

53.290 %\ifx\cdash\undefined % should be defined earlier
53.291 \def\cdash#1#2#3{\def\tempx@{#3}%
53.292 \def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
53.293 \ifx\tempx@\tempa@\@Acdash\else
53.294 \ifx\tempx@\tempb@\@Bcdash\else
53.295 \ifx\tempx@\tempc@\@Ccdash\else
53.296  \errmessage{Wrong usage of cdash}\fi\fi\fi}

second parameter (or third for \cdash) shows what kind of emdash to create in next step

"---

ordinary (plain) Cyrillic emdash inside text: an unbreakable thinspace will be inserted before only in case of a 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;

53.297 % What is more grammatically: .2em or .2\fontdimen6\font ?
53.298 \def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
53.299 \cyrdash\hskip.2em\ignorespaces}%
"--~

emdash in compound names or surnames (like Mendeleev–Klapeiron); this dash has no space characters around; after the dash some space is added

\exhyphenalty
53.300 \def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
53.301 \nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%

"--* for denoting direct speech (a space like \enskip must follow the emdash);

53.302 \def\@Ccdash{\leavevmode
53.303 \nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%

53.304 %\fi

\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 ---.

53.305 % Is there an IF necessary?
53.306 \ifx\cyrdash\undefined
53.307 \def\cyrdash{\hbox to.8em{--\hss--}}

53.308 \fi

Here a really new macro—to place thinspace between initials. This macro used instead of \, allows hyphenation in the following surname.

53.309 %\declare@shorthand{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}

\mdqon \mdqoff All that’s left to do now is to define a couple of commands for ".

53.310 \def\mdqon{\bbl@activate{"}}
53.311 \def\mdqoff{\bbl@deactivate{"}}

The Ukrainian hyphenation patterns can be used with \lefthyphenmin and

   \righthyphenmin set to 2.
53.312 \providehyphenmins{\CurrentOption}{\tw@\tw@}
53.313 % temporary hack:
53.314 \ifx\englishhyphenmins\undefined
53.315 \def\englishhyphenmins{\tw@\thr@@}

53.316 \fi

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.

53.317 \addto\extrasukrainian{\bbl@frenchspacing}
53.318 \addto\noextrasukrainian{\bbl@nonfrenchspacing}

Next we add a new enumeration style for Ukrainian manuscripts with Cyrillic letters, and later on we define some math operator names in accordance with Ukrainian and Russian typesetting traditions.

\Asbuk We begin by defining \Asbuk which works like \Alph, but produces (uppercase) Cyrillic letters intead of Latin ones. The letters CYRGUP, and SFTSN are skipped, as usual for such enumeration.

53.319 \def\Asbuk#1{\expandafter\@Asbuk\csname c@#1\endcsname}
53.320 \def\@Asbuk#1{\ifcase#1\or
53.321 \CYRA\or\CYRB\or\CYRV\or\CYRG\or\CYRD\or\CYRE\or\CYRIE\or
53.322 \CYRZH\or\CYRZ\or\CYRI\or\CYRII\or\CYRYI\or\CYRISHRT\or
53.323 \CYRK\or\CYRL\or\CYRM\or\CYRN\or\CYRO\or\CYRP\or\CYRR\or
53.324 \CYRS\or\CYRT\or\CYRU\or\CYRF\or\CYRH\or\CYRC\or\CYRCH\or
53.325 \CYRSH\or\CYRSHCH\or\CYRYU\or\CYRYA\else\@ctrerr\fi}

\asbuk The macro \asbuk is similar to \alph; it produces lowercase Ukrainian letters.

53.326 \def\asbuk#1{\expandafter\@asbuk\csname c@#1\endcsname}
53.327 \def\@asbuk#1{\ifcase#1\or
53.328 \cyra\or\cyrb\or\cyrv\or\cyrg\or\cyrd\or\cyre\or\cyrie\or
53.329 \cyrzh\or\cyrz\or\cyri\or\cyrii\or\cyryi\or\cyrishrt\or
53.330 \cyrk\or\cyrl\or\cyrm\or\cyrn\or\cyro\or\cyrp\or\cyrr\or
53.331 \cyrs\or\cyrt\or\cyru\or\cyrf\or\cyrh\or\cyrc\or\cyrch\or
53.332 \cyrsh\or\cyrshch\or\cyryu\or\cyrya\else\@ctrerr\fi}

Set up default Cyrillic math alphabets. The math groups for cyrillic letters are defined in the encoding definition files. First, declare a new alphabet for symbols, \cyrmathrm, based on the symbol font for Cyrillic letters defined in the encoding definition file. Note, that by default Cyrillic letters are taken from upright font in math mode (unlike Latin letters).

53.333 %\RequirePackage{textmath}
53.334 \@ifundefined{sym\cyrillicencoding letters}{}{%
53.335 \SetSymbolFont{\cyrillicencoding letters}{bold}\cyrillicencoding
53.336 \rmdefault\bfdefault\updefault
53.337 \DeclareSymbolFontAlphabet\cyrmathrm{\cyrillicencoding letters}

And we need a few commands to be able to switch to different variants.

53.338 \DeclareMathAlphabet\cyrmathbf\cyrillicencoding
53.339 \rmdefault\bfdefault\updefault
53.340 \DeclareMathAlphabet\cyrmathsf\cyrillicencoding
53.341 \sfdefault\mddefault\updefault
53.342 \DeclareMathAlphabet\cyrmathit\cyrillicencoding
53.343 \rmdefault\mddefault\itdefault
53.344 \DeclareMathAlphabet\cyrmathtt\cyrillicencoding
53.345 \ttdefault\mddefault\updefault

53.346 %

53.347 \SetMathAlphabet\cyrmathsf{bold}\cyrillicencoding
53.348 \sfdefault\bfdefault\updefault
53.349 \SetMathAlphabet\cyrmathit{bold}\cyrillicencoding
53.350 \rmdefault\bfdefault\itdefault

53.351 }

Some math functions in Ukrainian and Russian math books have other names: e.g., sinh in Russian is written as sh etc. So we define a number of new math operators.

      \sinh:
53.352 \def\sh{\mathop{\operator@font sh}\nolimits}
   \cosh:
53.353 \def\ch{\mathop{\operator@font ch}\nolimits}
   \tan:
53.354 \def\tg{\mathop{\operator@font tg}\nolimits}
   \arctan:
53.355 \def\arctg{\mathop{\operator@font arctg}\nolimits}

arcctg:

53.356 \def\arcctg{\mathop{\operator@font arcctg}\nolimits}

The following macro conflicts with \th defined in Latin 1 encoding:

      \tanh:
53.357 \def\th{\mathop{\operator@font th}\nolimits}
   \cot:
53.358 \def\ctg{\mathop{\operator@font ctg}\nolimits}
   \coth:
53.359 \def\cth{\mathop{\operator@font cth}\nolimits}
   \csc:
53.360 \def\cosec{\mathop{\operator@font cosec}\nolimits}

And finally some other Ukrainian and Russian mathematical symbols:

53.361 \def\Prob{\mathop{\kern\z@\mathsf{P}}\nolimits}
53.362 \def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
53.363 \def\nsd{\mathop{\cyrmathrm{\cyrn.\cyrs.\cyrd.}}\nolimits}
53.364 \def\nsk{\mathop{\cyrmathrm{\cyrn.\cyrs.\cyrk.}}\nolimits}
53.365 \def\NSD{\mathop{\cyrmathrm{\CYRN\CYRS\CYRD}}\nolimits}
53.366 \def\NSK{\mathop{\cyrmathrm{\CYRN\CYRS\CYRK}}\nolimits}
53.367 \def\nod{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrd.}}\nolimits}    % ??????
53.368 \def\nok{\mathop{\cyrmathrm{\cyrn.\cyro.\cyrk.}}\nolimits}    % ??????
53.369 \def\NOD{\mathop{\cyrmathrm{\CYRN\CYRO\CYRD}}\nolimits}       % ??????

53.370 \def\NOK{\mathop{\cyrmathrm{\CYRN\CYRO\CYRK}}\nolimits}       % ??????
53.371 \def\Proj{\mathop{\cyrmathrm{\CYRP\cyrr}}\nolimits}

This is for compatibility with older Ukrainian packages.

53.372 \DeclareRobustCommand{\No}{%
53.373 \ifmmode{\nfss@text{\textnumero}}\else\textnumero\fi}

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.

53.374 \ldf@finish{ukrainian}

53.375 ⟨/code⟩

54 The Lower Sorbian language

The file lsorbian.dtx^{64} It defines all the language-specific macros for Lower Sorbian.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

54.1 ⟨∗code⟩

 54.2 \LdfInit{lsorbian}\captionslsorbian

When this file is read as an option, i.e. by the \usepackage command, lsorbian will be an ‘unknown’ languagein 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.

 54.3 \ifx\l@lsorbian\@undefined
 54.4 \@nopatterns{Lsorbian}
 54.5 \adddialect\l@lsorbian\l@usorbian\fi

The next step consists of defining commands to switch to (and from) the Lower Sorbian language.

\captionslsorbian The macro \captionslsorbian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 54.6 \addto\captionslsorbian{%
 54.7 \def\prefacename{Zawod}%
 54.8 \def\refname{Referency}%
 54.9 \def\abstractname{Abstrakt}%
54.10 \def\bibname{Literatura}%
54.11 \def\chaptername{Kapitl}%
54.12 \def\appendixname{Dodawki}%
54.13 \def\contentsname{Wop\'simje\'se}%
54.14 \def\listfigurename{Zapis wobrazow}%
54.15 \def\listtablename{Zapis tabulkow}%
54.16 \def\indexname{Indeks}%
54.17 \def\figurename{Wobraz}%
54.18 \def\tablename{Tabulka}%
54.19 \def\partname{\'Z\v el}%
54.20 \def\enclname{P\'si\l oga}%
54.21 \def\ccname{CC}%
54.22 \def\headtoname{Komu}%
54.23 \def\pagename{Strona}%
54.24 \def\seename{gl.}%
54.25 \def\alsoname{gl.~teke}%
54.26 \def\proofname{Proof}%  <-- needs translation
54.27 \def\glossaryname{Glossary}% <-- Needs translation

54.28 }%

\newdatelsorbian The macro \newdatelsorbian redefines the command \today to produce Lower

Sorbian dates.

54.29 \def\newdatelsorbian{%
54.30 \def\today{\number\day.~\ifcase\month\or
54.31  januara\or februara\or m\v erca\or apryla\or maja\or

64The file described in this section has version number v1.0f and was last revised on 2001/01/30.

It was written by Eduard Werner (edi@kaihh.hanse.de).

54.32  junija\or julija\or awgusta\or septembra\or oktobra\or
54.33  nowembra\or decembra\fi
54.34  \space \number\year}}

\olddatelsorbian The macro \olddatelsorbian redefines the command \today to produce old-style

Lower Sorbian dates.

54.35 \def\olddatelsorbian{%
54.36 \def\today{\number\day.~\ifcase\month\or
54.37  wjelikego ro\v zka\or
54.38  ma\l ego ro\v zka\or
54.39  nal\v etnika\or
54.40  jat\v sownika\or
54.41  ro\v zownika\or
54.42  sma\v znika\or
54.43  pra\v znika\or
54.44  \v znje\'nca\or
54.45  po\v znje\'nca\or
54.46  winowca\or
54.47  nazymnika\or
54.48  godownika\fi \space \number\year}}

The default will be the new-style dates.

54.49 \let\datelsorbian\newdatelsorbian

\extraslsorbian \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.

54.50 \addto\extraslsorbian{}
54.51 \addto\noextraslsorbian{}

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.

54.52 \ldf@finish{lsorbian}

54.53 ⟨/code⟩

55 The Upper Sorbian language

The file usorbian.dtx^{65} It defines all the language-specific macros for Upper Sorbian.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

55.1 ⟨∗code⟩

 55.2 \LdfInit{usorbian}\captionsusorbian

When this file is read as an option, i.e. by the \usepackage command, usorbian will be an ‘unknown’ languagein 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.

 55.3 \ifx\l@usorbian\@undefined
 55.4  \@nopatterns{Usorbian}
 55.5  \adddialect\l@usorbian0\fi

The next step consists of defining commands to switch to (and from) the Upper Sorbian language.

\captionsusorbian The macro \captionsusorbian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 55.6 \addto\captionsusorbian{%
 55.7 \def\prefacename{Zawod}%
 55.8 \def\refname{Referency}%
 55.9 \def\abstractname{Abstrakt}%
55.10 \def\bibname{Literatura}%
55.11 \def\chaptername{Kapitl}%
55.12 \def\appendixname{Dodawki}%
55.13 \def\contentsname{Wobsah}%
55.14 \def\listfigurename{Zapis wobrazow}%
55.15 \def\listtablename{Zapis tabulkow}%
55.16 \def\indexname{Indeks}%
55.17 \def\figurename{Wobraz}%
55.18 \def\tablename{Tabulka}%
55.19 \def\partname{D\'z\v el}%
55.20 \def\enclname{P\v r\l oha}%
55.21 \def\ccname{CC}%
55.22 \def\headtoname{Komu}%
55.23 \def\pagename{Strona}%
55.24 \def\seename{hl.}%
55.25 \def\alsoname{hl.~te\v z}
55.26 \def\proofname{Proof}%  <-- needs translation
55.27 \def\glossaryname{Glossary}% <-- Needs translation

55.28 }%

\newdateusorbian The macro \newdateusorbian redefines the command \today to produce Upper

Sorbian dates.

55.29 \def\newdateusorbian{%
55.30 \def\today{\number\day.~\ifcase\month\or
55.31  januara\or februara\or m\v erca\or apryla\or meje\or junija\or

65The file described in this section has version number v1.0i and was last revised on 2001/01/30.

It was written by Eduard Werner (edi@kaihh.hanse.de).

55.32  julija\or awgusta\or septembra\or oktobra\or
55.33  nowembra\or decembra\fi
55.34  \space \number\year}}

\olddateusorbian The macro \olddateusorbian redefines the command \today to produce old-style

Upper Sorbian dates.

55.35 \def\olddateusorbian{%
55.36 \def\today{\number\day.~\ifcase\month\or
55.37  wulkeho r\'o\v zka\or ma\l eho r\'o\v zka\or nal\v etnika\or
55.38  jutrownika\or r\'o\v zownika\or  sma\v znika\or pra\v znika\or
55.39  \v znjenca\or po\v znjenca\or winowca\or nazymnika\or
55.40  hodownika\fi \space \number\year}}

The default will be the new-style dates.

55.41 \let\dateusorbian\newdateusorbian

\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 " character is made active. This is done once, later on its definition may vary.

55.42 \initiate@active@char{"}
55.43 \addto\extrasusorbian{\languageshorthands{usorbian}}
55.44 \addto\extrasusorbian{\bbl@activate{"}}

Don’t forget to turn the shorthands off again.

55.45 \addto\noextrasusorbian{\bbl@deactivate{"}}

In order for TEX to be able to hyphenate German Upper Sorbian words which contain ‘ß’ we have to give the character a nonzero \lccode (see Appendix H, the TEXbook).

55.46 \addto\extrasusorbian{\babel@savevariable{\lccode`\^^Y}%
55.47 \lccode`\^^Y`\^^Y}

The umlaut accent macro \" is changed to lower the umlaut dots. The redefinition is done with the help of \umlautlow.

55.48 \addto\extrasusorbian{\babel@save\"\umlautlow}
55.49 \addto\noextrasusorbian{\umlauthigh}

The Upper Sorbian hyphenation patterns can be used with \lefthyphenmin and

\righthyphenmin set to 2.
55.50 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\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.

55.51 \begingroup \catcode`\"12
55.52 \def\x{\endgroup
55.53 \def\@SS{\mathchar"7019 }
55.54 \def\dq{"}}

55.55 \x

Now we can define the doublequote macros: the umlauts,

55.56 \declare@shorthand{usorbian}{"a}{\textormath{\"{a}}{\ddot a}}
55.57 \declare@shorthand{usorbian}{"o}{\textormath{\"{o}}{\ddot o}}
55.58 \declare@shorthand{usorbian}{"u}{\textormath{\"{u}}{\ddot u}}
55.59 \declare@shorthand{usorbian}{"A}{\textormath{\"{A}}{\ddot A}}
55.60 \declare@shorthand{usorbian}{"O}{\textormath{\"{O}}{\ddot O}}
55.61 \declare@shorthand{usorbian}{"U}{\textormath{\"{U}}{\ddot U}}

tremas,

55.62 \declare@shorthand{usorbian}{"e}{\textormath{\"{e}}{\ddot e}}
55.63 \declare@shorthand{usorbian}{"E}{\textormath{\"{E}}{\ddot E}}
55.64 \declare@shorthand{usorbian}{"i}{\textormath{\"{\i}}{\ddot\imath}}
55.65 \declare@shorthand{usorbian}{"I}{\textormath{\"{I}}{\ddot I}}

usorbian es-zet (sharp s),

55.66 \declare@shorthand{usorbian}{"s}{\textormath{\ss{}}{\@SS{}}}
55.67 \declare@shorthand{usorbian}{"S}{SS}

german and french quotes,

55.68 \declare@shorthand{usorbian}{"`}{%
55.69 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
55.70 \declare@shorthand{usorbian}{"'}{%
55.71 \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
55.72 \declare@shorthand{usorbian}{"<}{%
55.73 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
55.74 \declare@shorthand{usorbian}{">}{%
55.75 \textormath{\guillemotright}{\mbox{\guillemotright}}}

discretionary commands

55.76 \declare@shorthand{usorbian}{"c}{\textormath{\bbl@disc ck}{c}}
55.77 \declare@shorthand{usorbian}{"C}{\textormath{\bbl@disc CK}{C}}
55.78 \declare@shorthand{usorbian}{"f}{\textormath{\bbl@disc f{ff}}{f}}
55.79 \declare@shorthand{usorbian}{"F}{\textormath{\bbl@disc F{FF}}{F}}
55.80 \declare@shorthand{usorbian}{"l}{\textormath{\bbl@disc l{ll}}{l}}
55.81 \declare@shorthand{usorbian}{"L}{\textormath{\bbl@disc L{LL}}{L}}
55.82 \declare@shorthand{usorbian}{"m}{\textormath{\bbl@disc m{mm}}{m}}
55.83 \declare@shorthand{usorbian}{"M}{\textormath{\bbl@disc M{MM}}{M}}
55.84 \declare@shorthand{usorbian}{"n}{\textormath{\bbl@disc n{nn}}{n}}
55.85 \declare@shorthand{usorbian}{"N}{\textormath{\bbl@disc N{NN}}{N}}
55.86 \declare@shorthand{usorbian}{"p}{\textormath{\bbl@disc p{pp}}{p}}
55.87 \declare@shorthand{usorbian}{"P}{\textormath{\bbl@disc P{PP}}{P}}
55.88 \declare@shorthand{usorbian}{"t}{\textormath{\bbl@disc t{tt}}{t}}
55.89 \declare@shorthand{usorbian}{"T}{\textormath{\bbl@disc T{TT}}{T}}

and some additional commands:

55.90 \declare@shorthand{usorbian}{"-}{\nobreak\-\bbl@allowhyphens}
55.91 \declare@shorthand{usorbian}{"|}{%
55.92 \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
55.93  \allowhyphens}{}}
55.94 \declare@shorthand{usorbian}{""}{\hskip\z@skip}

\mdqon \mdqoff \ck All that’s left to do now is to define a couple of commands for reasons of compat-

ibility with german.sty.

55.95 \def\mdqon{\shorthandon{"}}
55.96 \def\mdqoff{\shorthandoff{"}}
55.97 \def\ck{\allowhyphens\discretionary{k-}{k}{ck}\allowhyphens}

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.

55.98 \ldf@finish{usorbian}

55.99 ⟨/code⟩

56 The Turkish language

The file turkish.dtx^{66} defines all the language definition macros for the Turkish language^{67}.

Turkish typographic rules specify that a little ‘white space’ should be added before the characters ‘:’, ‘!’ and ‘=’. In order to insert this white space automatically these characters are made ‘active’. Also \frenhspacing is set.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

56.1 ⟨∗code⟩

 56.2 \LdfInit{turkish}\captionsturkish

When this file is read as an option, i.e. by the \usepackage command, 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.

 56.3 \ifx\l@turkish\@undefined
 56.4 \@nopatterns{Turkish}
 56.5 \adddialect\l@turkish0\fi

The next step consists of defining commands to switch to (and from) the Turkish language.

\captionsturkish The macro \captionsturkish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 56.6 \addto\captionsturkish{%
 56.7 \def\prefacename{\"Ons\"oz}%
 56.8 \def\refname{Kaynaklar}%
 56.9 \def\abstractname{\"Ozet}%
56.10 \def\bibname{Kaynak\c ca}%
56.11 \def\chaptername{B\"ol\"um}%
56.12 \def\appendixname{Ek}%
56.13 \def\contentsname{\.I\c cindekiler}%
56.14 \def\listfigurename{\c Sekil Listesi}%
56.15 \def\listtablename{Tablo Listesi}%
56.16 \def\indexname{Dizin}%
56.17 \def\figurename{\c Sekil}%
56.18 \def\tablename{Tablo}%
56.19 \def\partname{K\i s\i m}%
56.20 \def\enclname{\.Ili\c sik}%
56.21 \def\ccname{Di\u ger Al\i c\i lar}%
56.22 \def\headtoname{Al\i c\i}%
56.23 \def\pagename{Sayfa}%
56.24 \def\subjectname{\.Ilgili}%
56.25 \def\seename{bkz.}%
56.26 \def\alsoname{ayr\i ca bkz.}%
56.27 \def\proofname{Kan\i t}%
56.28 \def\glossaryname{Glossary}% <-- Needs translation

56.29 }%

66The file described in this section has version number v1.2m and was last revised on

2001/02/19.

67Mustafa Burc, z6001@rziris01.rrz.uni-hamburg.de provided the code for this file. It is

based on the work by Pierre Mackay; Turgut Uyar, uyar@cs.itu.edu.tr supplied additional

translations in version 1.2j and later

\dateturkish The macro \dateturkish redefines the command \today to produce Turkish

dates.

56.30 \def\dateturkish{%
56.31 \def\today{\number\day~\ifcase\month\or
56.32  Ocak\or \c Subat\or Mart\or Nisan\or May\i{}s\or Haziran\or
56.33  Temmuz\or A\u gustos\or Eyl\"ul\or Ekim\or Kas\i{}m\or
56.34  Aral\i{}k\fi
56.35  \space\number\year}}

\extrasturkish \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 ‘:’, ‘!’ and ‘=’. In order to insert this white space automatically these characters are made \active, so they have to be treated in a special way.

56.36 \initiate@active@char{:}
56.37 \initiate@active@char{!}
56.38 \initiate@active@char{=}

We specify that the turkish group of shorthands should be used.

56.39 \addto\extrasturkish{\languageshorthands{turkish}}

These characters are ‘turned on’ once, later their definition may vary.

56.40 \addto\extrasturkish{%
56.41 \bbl@activate{:}\bbl@activate{!}\bbl@activate{=}}

For Turkish texts \frenchspacing should be in effect. We make sure this is the case and reset it if necessary.

56.42 \addto\extrasturkish{\bbl@frenchspacing}
56.43 \addto\noextrasturkish{\bbl@nonfrenchspacing}

\turkish@sh@!@ \turkish@sh@=@ \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.

56.44 \declare@shorthand{turkish}{:}{%
56.45 \ifmmode
56.46  \string:%
56.47 \else\relax
56.48  \ifhmode
56.49  \ifdim\lastskip>\z@
56.50  \unskip\penalty\@M\thinspace

56.51 \fi 56.52 \fi

56.53  \string:%

56.54 \fi}

56.55 \declare@shorthand{turkish}{!}{%
56.56 \ifmmode
56.57  \string!%
56.58 \else\relax
56.59  \ifhmode
56.60  \ifdim\lastskip>\z@
56.61  \unskip\penalty\@M\thinspace

56.62 \fi 56.63 \fi

56.64  \string!%

56.65 \fi}

56.66 \declare@shorthand{turkish}{=}{%
56.67 \ifmmode
56.68  \string=%
56.69 \else\relax
56.70  \ifhmode
56.71  \ifdim\lastskip>\z@
56.72  \unskip\kern\fontdimen2\font
56.73  \kern-1.4\fontdimen3\font

56.74 \fi 56.75 \fi

56.76  \string=%

56.77 \fi}

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.

56.78 \ldf@finish{turkish}

56.79 ⟨/code⟩

57 The Hebrew language

The file hebrew.dtx^{68} provides the following packages and files for Hebrew language support:

hebrew.ldf file defines all the language-specific macros for the Hebrew language.

rlbabel.def file is used by hebrew.ldf for bidirectional versions of the major L^{A}TEX commands and environments. It is designed to be used with other right-to-left languages, not only with Hebrew.

hebcal.sty package defines a set of macros for computing Hebrew date from Gregorian one.

Additional Hebrew input and font encoding definition files that should be included and used with hebrew.ldf are:

hebinp.dtx provides Hebrew input encodings, such as ISO 8859-8, MS Windows codepage 1255 or IBM PC codepage 862 (see Section 58 on page 353).

hebrew.fdd contains Hebrew font encodings, related font definition files and hebfont package that provides Hebrew font switching commands (see Section 59 on page 359 for further details).

L^{A}TEX 2.09 compatibility files are included with heb209.dtx and gives possibility to compile existing L^{A}TEX 2.09 Hebrew documents with small (if any) changes (see Section 60 on page 369 for details).

Finally, optional document class 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. See more details in Section 61 on page 371.

57.1 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.

68The Hebrew language support files described in this section have version number v2.0c and were last revised on 2001/02/16.

57.2 The docstrip modules

The following modules are used in the implementation to direct docstrip in generating external files:

driver  produce a documentation driver file
hebrew produce Hebrew language support file
rightleft create right-to-left support file
calendar create Hebrew calendar package

A typical docstrip command file would then have entries like:

     \generateFile{hebrew.ldf}{t}{\from{hebrew.dtx}{hebrew}}

57.3 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.

57.1 ⟨∗hebrew⟩

57.2 \LdfInit{hebrew}{captionshebrew}

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.

57.3 \ifx\l@hebrew\@undefined
57.4 \@nopatterns{Hebrew}%
57.5 \adddialect\l@hebrew0

57.6 \fi

\hebrewencoding 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.

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 before the hebrew package. This may be done in the following way:

     \usepackage[LHE,T2,T1]{fontenc}
     \usepackage[hebrew,russian,english]{babel}

We make sure that the LHE encoding is known to L^{A}TEX at end of this package.

57.7 \AtEndOfPackage{%
57.8 \@ifpackageloaded{fontenc}{%
57.9  \@ifl@aded{def}{lheenc}{\def\hebrewencoding{LHE}}{}%

57.10 }{%

57.11  \input{lheenc.def}%
57.12  \def\hebrewencoding{LHE}%

57.13 }}

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 before the hebrew package too. This may be done in the following way:

       \usepackage[cp1255,cp866]{inputenc}
       \usepackage[hebrew,russian,english]{babel}

An user can switch input encodings in the document using the command \inputencoding, for example, to use the cp1255:

       \inputencoding{cp1255}
57.14 \AtEndOfPackage{%
57.15 \@ifpackageloaded{inputenc}{}{\RequirePackage[8859-8]{inputenc}}}

The next step consists of defining commands to switch to (and from) the Hebrew language.

\hebrewhyphenmins This macro is used to store the correct values of the hyphenation parameters

  \lefthyphenmin and \righthyphenmin. They are set to 2.
57.16 \providehyphenmins{\CurrentOption}{\tw@\tw@}

\captionshebrew The macro \captionshebrew replaces all captions used in the four standard doc-

ument classes provided with L^{A}TEX 2εwith their Hebrew equivalents.

57.17 \addto\captionshebrew{%
57.18 \def\prefacename{\mem\bet\vav\alef}%
57.19 \def\refname{\resh\shin\yod\mem\tav\ \mem\qof\vav\resh\vav\tav}%
57.20 \def\abstractname{\tav\qof\tsadi\yod\resh}%
57.21 \def\bibname{\bet\yod\bet\lamed\yod\vav\gimel\resh\pe\yod\he}%
57.22 \def\chaptername{\pe\resh\qof}%
57.23 \def\appendixname{\nun\samekh\pe\het}%
57.24 \def\contentsname{\tav\vav\kaf\finalnun\
57.25  \ayin\nun\yod\nun\yod\finalmem}%
57.26 \def\listfigurename{\resh\shin\yod\mem\tav\
57.27  \alef\yod\vav\resh\yod\finalmem}%
57.28 \def\listtablename{\resh\shin\yod\mem\tav\
57.29  \tet\bet\lamed\alef\vav\tav}%
57.30 \def\indexname{\mem\pe\tav\het}%
57.31 \def\figurename{\alef\yod\vav\resh}%
57.32 \def\tablename{\tet\bet\lamed\he}%
57.33 \def\partname{\het\lamed\qof}%
57.34 \def\enclname{\resh\tsadi"\bet}%
57.35 \def\ccname{\he\ayin\tav\qof\yod\finalmem}%
57.36 \def\headtoname{\alef\lamed}%
57.37 \def\pagename{\ayin\mem\vav\dalet}%
57.38 \def\psname{\nun.\bet.}%
57.39 \def\seename{\resh\alef\he}%
57.40 \def\alsoname{\resh\alef\he \gimel\memesof}%
57.41 \def\proofname{\he\vav\kaf\het\he}
57.42 \def\glossaryname{Glossary}% <-- Needs translation

57.43 }

Here we provide an user with translation of Gregorian dates to Hebrew. In addition, the hebcal package can be used to create Hebrew calendar dates.

\hebmonth The macro \hebmonth{month} produces month names in Hebrew.

57.44 \def\hebmonth#1{%
57.45 \ifcase#1\or \yod\nun\vav\alef\resh\or
57.46  \pe\bet\resh\vav\alef\resh\or \mem\resh\finaltsadi\or
57.47  \alef\pe\resh\yod\lamed\or \mem\alef\yod\or \yod\vav\nun\yod\or
57.48  \yod\vav\lamed\yod\or \alef\vav\gimel\vav\samekh\tet\or
57.49  \samekh\pe\tet\mem\bet\resh\or \alef\vav\qof\tet\vav\bet\resh\or
57.50  \nun\vav\bet\mem\bet\resh\or \dalet\tsadi\mem\bet\resh\fi}

\hebdate The macro \hebdate{day}{month}{year} translates a given Gregorian date to

Hebrew.

57.51 \def\hebdate#1#2#3{%
57.52 \beginR\beginL\number#1\endL\ \bet\hebmonth{#2}
57.53  \beginL\number#3\endL\endR}

\hebday The macro \hebday will replace \today command when in Hebrew mode.

57.54 \def\hebday{\hebdate{\day}{\month}{\year}}

\datehebrew The macro \datehebrew redefines the command \today to produce Gregorian

dates in Hebrew. It uses the macro \hebday.

57.55 \def\datehebrew{\let\today=\hebday}

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.

\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 unbalanced \beginR or \beginL primitives. Instead, in TEX’s restricted horizontal mode, the \L{latin text} and \R{hebrew text}, or \embox{latin text} and \hmbox{hebrew text} should be used.

Hence, we use \beginR and \beginL switching commands only when not in restricted horizontal mode.

57.56 \addto\extrashebrew{%
57.57 \tohebrew%
57.58 \ifhmode\ifinner\else\beginR\fi\fi}
\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.

57.59 \addto\noextrashebrew{%
57.60 \fromhebrew%
57.61 \ifhmode\ifinner\else\beginL\fi\fi}

Generally, we can switch to- and from- Hebrew by means of standard babeldefined commands, for example,

     \selectlanguage{hebrew}

or

     \begin{otherlanguage}{hebrew}

some Hebrew text

     \end{otherlanguage}

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 hebrew.sty.

\sethebrew \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{ r2l language name} and \unsetrllanguage{r2l language name}, that defined in

the rlbabel.def file.
57.62 \def\sethebrew{\setrllanguage{hebrew}}
57.63 \def\unsethebrew{\unsetrllanguage{hebrew}}

\hebrewtext \nohebrewtext The following two commands are obsolete and work only in L^{A}TEX2.09 compatib-

ility mode. They are synonyms of \sethebrew and \unsethebrew defined above.

57.64 \if@compatibility
57.65 \let\hebrewtext=\sethebrew
57.66 \let\nohebrewtext=\unsethebrew

57.67 \fi

\tohebrew \fromhebrew These two commands change only the current font encoding to- and from- Hebrew encoding. Their implementation uses \@torl{language name} and \@fromrl macros defined in rlbabel.def file. Both commands may be useful only for package and class writers, not for regular users.

57.68 \def\tohebrew{\@torl{hebrew}}%
57.69 \def\fromhebrew{\@fromrl}

\@hebrew Sometimes we need to preserve Hebrew mode without knowing in which environment we are located now. For these cases, the \@hebrew{hebrew text} macro will be useful. Not that this macro is similar to the \@number and \@latin macros defined in rlbabel.def file.

57.70 \def\@@hebrew#1{\beginR{{\tohebrew#1}}\endR}
57.71 \def\@hebrew{\protect\@@hebrew}

Here we define the two Hebrew counter types — \hebr, which counts in Hebrew letters, and \gim, which is Gimatria. Both counters can be used in any place, so we should ensure Hebrew mode by using the \@hebrew macro.

\hebr We begin by defining \hebr which produces Hebrew numerals represented by

Hebrew letters.

57.72 \def\@@hebr#1{%
57.73 \ifcase#1\or \alef\or \bet\or \gimel\or \dalet\or \he\or \vav\or
57.74  \zayin\or \het\or \tet\or \yod\or \kaf\or \lamed\or \mem\or
57.75  \nun\or \samekh\or \ayin\or \pe\or \tsadi\or \qof\or \resh\or
57.76  \shin\or \tav\else\@ctrerr\fi}
57.77 \def\@hebr#1{\@hebrew{\@@hebr#1}}
57.78 \def\hebr#1{\@hebr{\@nameuse{c@#1}}}

\gim The macro \gim is similar to \hebr, but produces Hebrew numbers in Gimatria.

57.79 \def\@@gim#1{\@tempcnta=#1\divide\@tempcnta\@m
57.80 \@@hebr\@tempcnta
57.81 \multiply\@tempcnta\@m\@tempcntb=#1\advance\@tempcntb-\@tempcnta
57.82 \ifnum\@tempcntb>799 \tav\tav \advance\@tempcntb-800\fi
57.83 \ifnum\@tempcntb>399 \tav \advance\@tempcntb-400\fi
57.84 \ifnum\@tempcntb>299 \shin \advance\@tempcntb-300\fi
57.85 \ifnum\@tempcntb>199 \resh\advance\@tempcntb-200\fi
57.86 \ifnum\@tempcntb>99 \qof\advance\@tempcntb-100\fi
57.87 \ifnum\@tempcntb>0 %
57.88  \ifnum\@tempcntb=16 \tet\zayin%
57.89  \else\ifnum\@tempcntb=15 \tet\vav%
57.90  \else\@tempcnta\@tempcntb \divide\@tempcntb 10
57.91  \ifnum\@tempcntb>0 %
57.92  \advance\@tempcntb 9
57.93  \@@hebr\@tempcntb\advance\@tempcntb-9 \fi
57.94  \multiply\@tempcntb 10\advance\@tempcnta-\@tempcntb
57.95  \ifnum\@tempcnta>0 \@@hebr\@tempcnta\fi

57.96 \fi}

57.97 \def\@gim#1{\@hebrew{\@@gim#1}}
57.98 \def\gim#1{\@gim{\@nameuse{c@#1}}}

\extrashebrew When switching to Hebrew, we ‘save’ the current meaning of the internal L^{A}TEX

commands \@alph and \@Alph and set them to use Hebrew alphabet.

57.99 \addto\extrashebrew{%
57.100 \let\saved@alph=\@alph%
57.101 \let\saved@Alph=\@Alph%
57.102 \def\@alph#1{\@hebrew{\@@hebr#1}}%
57.103 \def\@Alph#1{\@latin{\@@Alph#1}}}
\noextrashebrew In the macro \noextrashebrew we ‘restore’ the \@alph and \@Alph commands to

their values saved in \extrashebrew above.

57.104 \addto\noextrashebrew{%
57.105 \let\@alph=\saved@alph%
57.106 \let\@Alph=\saved@Alph}

\appendix It is usual in Hebrew documents to use Hebrew numerals instead of default uppercase Latin letters in the numbers of appendices. We save the current \appendix definition and simply change the definitions of \thesection (for article) and of \thechapter (for report and book) to use our \@hebr counter.

57.107 \@ifclassloaded{letter}{}{%
57.108 \let\@@appendix=\appendix%
57.109 \@ifclassloaded{article}{%
57.110  \renewcommand\appendix{\@@appendix%
57.111  \renewcommand\thesection{\protect\if@rl\@hebr\c@section%
57.112  \protect\else\@Alph\c@section\protect\fi}}}%
57.113 {\renewcommand\appendix{\@@appendix%
57.114  \renewcommand\thechapter{\protect\if@rl\@hebr\c@chapter%
57.115  \protect\else\@Alph\c@chapter\protect\fi}}}}

For backward compatibility with ‘older’ hebrew.sty packages, we define Hebrew equivalents of some useful L^{A}TEX commands. Note, however, that 8-bit macros defined in Hebrew are no longer supported.

57.116 \def\hebcopy{\protect\R{\he\ayin\tav\qof}}
57.117 \def\hebincl{\protect\R{\resh\tsadi"\bet}}
57.118 \def\hebpage{\protect\R{\ayin\mem\vav\dalet}}
57.119 \def\hebto{\protect\R{\ayin\dalet}}

\hadgesh produce “poor man’s bold” (heavy printout), when used with normal font glyphs. It is advisable to use bold font (for example, Dead Sea) instead of this macro.

57.120 \def\hadgesh#1{\leavevmode\setbox0=\hbox{#1}%
57.121 \kern-.025em\copy0\kern-\wd0
57.122 \kern.05em\copy0\kern-\wd0
57.123 \kern-.025em\raise.0433em\box0 }

\piska and \piskapiska sometimes used in ‘older’ hebrew sources, and should not be used in L^{A}TEX 2ε.

57.124 \if@compatibility
57.125 \def\piska#1{\item{#1}\hangindent=-\hangindent}
57.126 \def\piskapiska#1{\itemitem{#1}\hangindent=-\hangindent}

57.127 \fi

The following commands are simply synonyms for the standard ones, provided with L^{A}TEX 2ε.

57.128 \let\makafgadol=\textendash
57.129 \let\makafanak=\textemdash
57.130 \let\geresh=\textquoteright
57.131 \let\opengeresh=\textquoteright
57.132 \let\closegeresh=\textquoteleft
57.133 \let\openquote=\textquotedblright
57.134 \let\closequote=\textquotedblleft
57.135 \let\leftquotation=\textquotedblright
57.136 \let\rightquotation=\textquotedblleft

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:

     \usepackage[russian,hebrew,arabic,greek,english]{babel}

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{language name} command.

57.137 \AtBeginDocument{\def\@rllanguagename{hebrew}}

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.

57.138 \ldf@finish{hebrew}

57.139 ⟨/hebrew⟩

57.4 Right to left support

This file rlbabel.def defines necessary bidirectional macro support for L^{A}TEX 2ε. 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 ε-TEX and in TEX--XET.

If ε-TEX is used, we should switch it to the enhanced mode:

57.140 ⟨∗rightleft⟩

57.141 \ifx\TeXXeTstate\undefined\else%
57.142 \TeXXeTstate=1

57.143 \fi

Note, that ε-TEX’s format file should be created for extended mode. Mode can be checked by running ε-TEX on some TEX file, for example:

     This is e-TeX, Version 3.14159-1.1 (Web2c 7.0)
     entering extended mode

The second line should be entering extended mode.

We check if user uses Right-to-Left enabled engine instead of regular Knuth’s TEX:

57.144 \ifx\beginL\@undefined%
57.145 \newlinechar`\^^J
57.146 \typeout{^^JTo avoid this error message,^^J%
57.147  run TeX--XeT or e-TeX engine instead of regular TeX.^^J}
57.148 \errmessage{Right-to-Left Support Error: use TeX--XeT or e-TeX
57.149  engine}%

57.150 \fi

57.4.1 Switching from LR to RL mode and back

\@torl and \@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 \if@rl). They should not normally be called by users: user-level macros, such as \sethebrew and \unsethebrew, as well as babel’s \selectlanguage are defined in languagedefinition 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.

\if@rl rltrue means that the main mode is currently Right-to-Left.

rlfalse means that the main mode is currently Left-to-Right.

57.151 \newif\if@rl

\@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 encoding, for example, for Hebrew it will be \hebrewencoding.

57.152 \DeclareRobustCommand{\@torl}[1]{%
57.153 \if@rl\else%
57.154  \let\lr@encodingdefault=\encodingdefault%

57.155 \fi%

57.156 \def\@rllanguagename{#1}%
57.157 \def\encodingdefault{\csname#1encoding\endcsname}%
57.158 \fontencoding{\encodingdefault}%
57.159 \selectfont%
57.160 \@rltrue}

\@fromrl Opposite to \@torl, switches current direction to Left-to-Right: restores saved

Left-to-Right encoding (\lr@encodingdefault) and changes direction.

57.161 \DeclareRobustCommand{\@fromrl}{%
57.162 \if@rl%
57.163  \let\encodingdefault=\lr@encodingdefault%

57.164 \fi%

57.165 \fontencoding{\encodingdefault}%
57.166 \selectfont%
57.167 \@rlfalse}

\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.
57.168 \expandafter\def\csname selectlanguage \endcsname#1{%
57.169 \edef\languagename{%
57.170  \ifnum\escapechar=\expandafter`\string#1\@empty
57.171  \else \string#1\@empty\fi}%
57.172 \@@selectlanguage{\languagename}}

\@@selectlanguage This new internal macro redefines a final part of the standard babel’s \select-

language implementation.

Standard L^{A}TEX 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).

57.173 \def\@@selectlanguage#1{%
57.174 \select@language{#1}%
57.175 \if@filesw
57.176  \protected@write\@auxout{}{\string\select@language{#1}}%
57.177  \if@rl%
57.178  \addtocontents{cot}{\xstring\select@language{#1}}%
57.179  \addtocontents{fol}{\xstring\select@language{#1}}%
57.180  \addtocontents{tol}{\xstring\select@language{#1}}%
57.181  \else%
57.182  \addtocontents{toc}{\xstring\select@language{#1}}%
57.183  \addtocontents{lof}{\xstring\select@language{#1}}%

57.184  \addtocontents{lot}{\xstring\select@language{#1}}%

57.185 \fi% 57.186 \fi}

\setrllanguage \unsetrllanguage The \setrllanguage and \unsetrllanguage pair of macros is proved to very

useful in bilingual texts, for example, in Hebrew-English texts. The languagespecific 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.

57.187 \let\other@languagename=\languagename
57.188 \DeclareRobustCommand{\setrllanguage}[1]{%
57.189 \if@rl\else%
57.190  \let\other@languagename=\languagename%

57.191 \fi%

57.192  \def\languagename{#1}%
57.193  \@@selectlanguage{\languagename}}
57.194 \DeclareRobustCommand{\unsetrllanguage}[1]{%
57.195 \if@rl%
57.196  \let\languagename=\other@languagename%

57.197 \fi

57.198 \@@selectlanguage{\languagename}}

{\L \atop \R} Macros for changing direction, originally taken from TUGboat. Usage: \L\{Left to Right text} and \R{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 \tolanguagename and \fromlanguagename macros in language definition file, for example, for Hebrew: \tohebrew and \fromhebrew macros in

hebrew.ldf file.

Added ‘protect’ to \L and \R to make them robust and allow use, for example, in tables (by Alon Ziv).

57.199 \let\next=\
57.200 \def\L{\protect\pL}
57.201 \def\pL{\protect\afterassignment\moreL \let\next= }
57.202 \def\moreL{\bracetext \aftergroup\endL \beginL\csname
57.203 from\@rllanguagename\endcsname}
57.204 \def\R{\protect\pR}
57.205 \def\pR{\protect\afterassignment\moreR \let\next= }
57.206 \def\moreR{\bracetext \aftergroup\endR \beginR\csname
57.207 to\@rllanguagename\endcsname}
57.208 \def\bracetext{\ifcat\next{\else\ifcat\next}\fi
57.209 \errmessage{Missing left brace has been substituted}\fi \bgroup}
57.210 \everydisplay{\if@rl\aftergroup\beginR\fi }

Take care of Right-to-Left indentation in every paragraph. Originally, \noindent was redefined for right-to-left by Yaniv Bargury, then the implementation was rewritten by Alon Ziv using an idea by Chris Rowley: \noindent now works unmodified.

57.211 \def\rl@everypar{\if@rl{\setbox\z@\lastbox\beginR\usebox\z@}\fi}
57.212 \let\o@everypar=\everypar
57.213 \def\everypar#1{\o@everypar{\rl@everypar#1}}

\hmbox \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).

57.214 \newcommand{\hmbox}[1]{\mbox{\R{#1}}}
57.215 \newcommand{\embox}[1]{\mbox{\L{#1}}}

\@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.

57.216 \def\@brackets#1#2#3{\protect\if@rl #3#2#1\protect\else
57.217 #1#2#3\protect\fi}

\@number \@latin \@number preserves numbers direction from Left to Right. \@latin in addition

switches current encoding to the latin.

57.218 \def\@@number#1{\ifmmode\else\beginL\fi#1\ifmmode\else\endL\fi}
57.219 \def\@@latin#1{\@@number{{\@fromrl#1}}}
57.220 \def\@number{\protect\@@number}
57.221 \def\@latin{\protect\@@latin}

57.4.2 Counters

To make counter references work in Right to Left text, we need to surround their original definitions with an \@number{… } or \@latin{… }. Note, that languagespecific counters, such as \hebr or \gim are provided with language definition file.

We start with saving the original definitions:

57.222 \let\@@arabic=\@arabic
57.223 \let\@@roman=\@roman
57.224 \let\@@Roman=\@Roman
57.225 \let\@@alph=\@alph
57.226 \let\@@Alph=\@Alph

\@arabic \@roman \@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.

57.227 \def\@arabic#1{\@number{\@@arabic#1}}
57.228 \def\@roman#1{\@latin{\@@roman#1}}
57.229 \def\@Roman#1{\@latin{\@@Roman#1}}

\make@lr In Right to Left documents all counters defined in the standard document classes article, report and book provided with L^{A}TEX 2ε, such as \thesection, \thefigure, \theequation should be typed as numbers from left to right. To ensure direction, we use the following \make@lr{counter} macro:

57.230 \def\make@lr#1{\begingroup
57.231  \toks@=\expandafter{#1}%
57.232  \edef\x{\endgroup
57.233 \def\noexpand#1{\noexpand\@number{\the\toks@}}}%

57.234 \x}

57.235 \@ifclassloaded{letter}{}{%
57.236 \make@lr\thesection
57.237 \make@lr\thesubsection
57.238 \make@lr\thesubsubsection
57.239 \make@lr\theparagraph
57.240 \make@lr\thesubparagraph
57.241 \make@lr\thefigure
57.242 \make@lr\thetable
57.243 \make@lr\theequation}

57.4.3 Preserving logos

Preserve TEX, L^{A}TEX and L^{A}TEX 2ε logos.

\TeX
57.244 \let\@@TeX\TeX
57.245 \def\TeX{\@latin{\@@TeX}}
\LaTeX
57.246 \let\@@LaTeX\LaTeX
57.247 \def\LaTeX{\@latin{\@@LaTeX}}
\LaTeXe
57.248 \let\@@LaTeXe\LaTeXe
57.249 \def\LaTeXe{\@latin{\@@LaTeXe}}

57.4.4 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. L^{A}TEX keeps track on the indentation with the \leftmargin and \rightmargin values. The changes below are mostly to exchange these values in Right-to-Left mode.

description
57.250 \providecommand\descriptionlabel[1]{\hspace\labelsep
57.251  \normalfont\bfseries #1}
57.252 \renewenvironment{description}
57.253  {\list{}{\labelwidth\z@ \itemindent-%
57.254  \if@rl\rightmargin\else\leftmargin\fi
57.255  \let\makelabel\descriptionlabel}}
57.256  {\endlist}
verse
57.257 \renewenvironment{verse}
57.258 {\let\\\@centercr
57.259 \if@rl
57.260  \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
57.261  \leftmargin\rightmargin\advance\rightmargin 1.5em}

57.262 \else

57.263  \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent
57.264  \rightmargin\leftmargin\advance\leftmargin 1.5em}

57.265 \fi

57.266 \item\relax}
57.267 {\endlist}
quotation
57.268 \renewenvironment{quotation}
57.269 {\list{}{\listparindent 1.5em
57.270  \itemindent\listparindent
57.271  \if@rl
57.272  \leftmargin\rightmargin

57.273 \else

57.274  \rightmargin\leftmargin

57.275 \fi

57.276  \parsep \z@ \@plus\p@}\item\relax}
57.277 {\endlist}
quote
57.278 \renewenvironment{quote}
57.279 {\list{}{\if@rl
57.280  \leftmargin\rightmargin

57.281 \else

57.282  \rightmargin\leftmargin

57.283 \fi}%

57.284 \item\relax}
57.285 {\endlist}

Changes in indentation of lists (all levels from 1 to 6).

\@listi \@listI
57.286 \let\@@listi=\@listi
57.287 \def\@listi{\@@listi\if@rl\rightmargin\leftmargini%
57.288  \leftmargin=0pt\fi}
57.289 \let\@listI\@listi
\@listii
57.290 \let\@@listii=\@listii
57.291 \def\@listii{\@@listii\if@rl\rightmargin\leftmarginii%
57.292  \leftmargin=0pt\fi}
\@listiii
57.293 \let\@@listiii=\@listiii
57.294 \def\@listiii{\@@listiii\if@rl\rightmargin\leftmarginiii%
57.295  \leftmargin=0pt\fi}
\@listiv
57.296 \let\@@listiv=\@listiv
57.297 \def\@listiv{\@@listiv\if@rl\rightmargin\leftmarginiv%
57.298  \leftmargin=0pt\fi}
\@listv
57.299 \let\@@listv=\@listv
57.300 \def\@listv{\@@listv\if@rl\rightmargin\leftmarginv%
57.301  \leftmargin=0pt\fi}

\@listvi
57.302 \let\@@listvi=\@listvi
57.303 \def\@listvi{\@@listvi\if@rl\rightmargin\leftmarginvi%
57.304  \leftmargin=0pt\fi}
\labelenumii \p@enumiii The \labelenumii and \p@enumiii commands use parentheses. They are revised

to work Right-to-Left with the help of \@brackets macro defined above.

57.305 \def\labelenumii{\@brackets(\theenumii)}
57.306 \def\p@enumiii{\p@enumii\@brackets(\theenumii)}

57.4.5 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 L^{A}TEX 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.

\@tableofcontents \@listoffigures \@listoftables We define 3 new macros similar to the standard L^{A}TEX tables, but with one parameter — table file extension. These macros will help us to define our additional tables below.

57.307 \@ifclassloaded{letter}{}{% other
57.308 \@ifclassloaded{article}{% article
57.309  \newcommand\@tableofcontents[1]{%
57.310  \section*{\contentsname\@mkboth%
57.311  {\MakeUppercase\contentsname}%
57.312  {\MakeUppercase\contentsname}}%
57.313  \@starttoc{#1}}
57.314  \newcommand\@listoffigures[1]{%
57.315  \section*{\listfigurename\@mkboth%
57.316  {\MakeUppercase\listfigurename}%
57.317  {\MakeUppercase\listfigurename}}%
57.318  \@starttoc{#1}}
57.319  \newcommand\@listoftables[1]{%
57.320  \section*{\listtablename\@mkboth%
57.321  {\MakeUppercase\listtablename}%
57.322  {\MakeUppercase\listtablename}}%
57.323  \@starttoc{#1}}}%
57.324 {% else report or book
57.325  \newcommand\@tableofcontents[1]{%
57.326  \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
57.327  \fi\chapter*{\contentsname\@mkboth%
57.328  {\MakeUppercase\contentsname}%
57.329  {\MakeUppercase\contentsname}}%
57.330  \@starttoc{#1}\if@restonecol\twocolumn\fi}
57.331  \newcommand\@listoffigures[1]{%
57.332  \@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn%
57.333  \fi\chapter*{\listfigurename\@mkboth%
57.334  {\MakeUppercase\listfigurename}%
57.335  {\MakeUppercase\listfigurename}}%
57.336  \@starttoc{#1}\if@restonecol\twocolumn\fi}
57.337  \newcommand\@listoftables[1]{%

57.338  \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi%
57.339  \chapter*{\listtablename\@mkboth%
57.340  {\MakeUppercase\listtablename}%
57.341  {\MakeUppercase\listtablename}}%
57.342  \@starttoc{#1}\if@restonecol\twocolumn\fi}}%

\lrtableofcontents \lrlistoffigures \lrlistoftables Left-to-Right tables are called now \lrxxx and defined with the aid of three macros

defined above (extensions toc, lof, and lot).

57.343 \newcommand\lrtableofcontents{\@tableofcontents{toc}}%
57.344 \newcommand\lrlistoffigures{\@listoffigures{lof}}%
57.345 \newcommand\lrlistoftables{\@listoftables{lot}}%

\rltableofcontents \rllistoffigures \rllistoftables Right-to-Left tables will be called \rlxxx and defined with the aid of three macros

defined above (extensions cot, fol, and tol).

57.346 \newcommand\rltableofcontents{\@tableofcontents{cot}}%
57.347 \newcommand\rllistoffigures{\@listoffigures{fol}}%
57.348 \newcommand\rllistoftables{\@listoftables{tol}}%

\tableofcontents \listoffigures \listoftables Let \xxx be \rlxxx if the current direction is Right-to-Left and \lrxxx if it is

Left-to-Right.

57.349 \renewcommand\tableofcontents{\if@rl\rltableofcontents%
57.350  \else\lrtableofcontents\fi}
57.351 \renewcommand\listoffigures{\if@rl\rllistoffigures%
57.352  \else\lrlistoffigures\fi}
57.353 \renewcommand\listoftables{\if@rl\rllistoftables%
57.354  \else\lrlistoftables\fi}}

\@dottedtocline The following makes problems when making a Right-to-Left tables, since it uses

\leftskip and \rightskip which are both mode dependent.

57.355 \def\@dottedtocline#1#2#3#4#5{%
57.356 \ifnum #1>\c@tocdepth \else
57.357  \vskip \z@ \@plus.2\p@
57.358  {\if@rl\rightskip\else\leftskip\fi #2\relax
57.359  \if@rl\leftskip\else\rightskip\fi \@tocrmarg \parfillskip
57.360  -\if@rl\leftskip\else\rightskip\fi
57.361  \parindent #2\relax\@afterindenttrue
57.362  \interlinepenalty\@M
57.363  \leavevmode
57.364  \@tempdima #3\relax
57.365  \advance\if@rl\rightskip\else\leftskip\fi \@tempdima
57.366  \null\nobreak\hskip -\if@rl\rightskip\else\leftskip\fi
57.367  {#4}\nobreak
57.368  \leaders\hbox{$\m@th
57.369  \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
57.370  mu$}\hfill
57.371  \nobreak
57.372  \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor \beginL#5\endL}%
57.373  \par}%

57.374 \fi}

\l@part This standard macro was redefined for table of contents since it uses \rightskip

which is mode dependent.

57.375 \@ifclassloaded{letter}{}{% other

57.376 \renewcommand*\l@part[2]{%
57.377 \ifnum \c@tocdepth >-2\relax
57.378  \addpenalty{-\@highpenalty}%
57.379  \addvspace{2.25em \@plus\p@}%
57.380  \begingroup
57.381  \setlength\@tempdima{3em}%
57.382  \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
57.383  \parfillskip -\@pnumwidth
57.384  {\leavevmode
57.385  \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss#2}}\par
57.386  \nobreak
57.387  \global\@nobreaktrue
57.388  \everypar{\global\@nobreakfalse\everypar{}}%
57.389  \endgroup

57.390 \fi}}

\@part Part is redefined to support new Right-to-Left table of contents (cot) as well as

the Left-to-Right one (toc).

57.391 \@ifclassloaded{article}{% article class
57.392 \def\@part[#1]#2{%
57.393  \ifnum \c@secnumdepth >\m@ne
57.394  \refstepcounter{part}%
57.395  \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
57.396  \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%

57.397 \else

57.398  \addcontentsline{toc}{part}{#1}%
57.399  \addcontentsline{cot}{part}{#1}%

57.400 \fi

57.401  {\parindent \z@ \raggedright
57.402  \interlinepenalty \@M
57.403  \normalfont
57.404  \ifnum \c@secnumdepth >\m@ne
57.405  \Large\bfseries \partname~\thepart
57.406  \par\nobreak

57.407 \fi

57.408  \huge \bfseries #2%
57.409  \markboth{}{}\par}%
57.410  \nobreak
57.411  \vskip 3ex
57.412  \@afterheading}%
57.413 }{% report and book classes
57.414 \def\@part[#1]#2{%
57.415  \ifnum \c@secnumdepth >-2\relax
57.416  \refstepcounter{part}%
57.417  \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
57.418  \addcontentsline{cot}{part}{\thepart\hspace{1em}#1}%

57.419 \else

57.420  \addcontentsline{toc}{part}{#1}%
57.421  \addcontentsline{cot}{part}{#1}%

57.422 \fi

57.423  \markboth{}{}%
57.424  {\centering
57.425  \interlinepenalty \@M
57.426  \normalfont

57.427  \ifnum \c@secnumdepth >-2\relax
57.428  \huge\bfseries \partname~\thepart

57.429 \par

57.430  \vskip 20\p@

57.431 \fi

57.432  \Huge \bfseries #2\par}%
57.433  \@endpart}}

\@sect Section was redefined from the latex.ltx file. It is changed to support both

Left-to-Right (toc) and Right-to-Left (cot) table of contents simultaneously.

57.434 \def\@sect#1#2#3#4#5#6[#7]#8{%
57.435 \ifnum #2>\c@secnumdepth
57.436  \let\@svsec\@empty

57.437 \else

57.438  \refstepcounter{#1}%
57.439  \protected@edef\@svsec{\@seccntformat{#1}\relax}%

57.440 \fi

57.441 \@tempskipa #5\relax
57.442 \ifdim \@tempskipa>\z@
57.443  \begingroup

57.444 #6{%

57.445  \@hangfrom{\hskip #3\relax\@svsec}%
57.446  \interlinepenalty \@M #8\@@par}%
57.447  \endgroup
57.448  \csname #1mark\endcsname{#7}%
57.449  \addcontentsline{toc}{#1}{%
57.450  \ifnum #2>\c@secnumdepth \else
57.451  \protect\numberline{\csname the#1\endcsname}%

57.452 \fi 57.453 #7}%

57.454  \addcontentsline{cot}{#1}{%
57.455  \ifnum #2>\c@secnumdepth \else
57.456  \protect\numberline{\csname the#1\endcsname}%

57.457 \fi 57.458 #7}% 57.459 \else

57.460  \def\@svsechd{%
57.461  #6{\hskip #3\relax
57.462  \@svsec #8}%
57.463  \csname #1mark\endcsname{#7}%
57.464  \addcontentsline{toc}{#1}{%
57.465  \ifnum #2>\c@secnumdepth \else
57.466  \protect\numberline{\csname the#1\endcsname}%

57.467 \fi 57.468 #7}%

57.469  \addcontentsline{cot}{#1}{%
57.470  \ifnum #2>\c@secnumdepth \else
57.471  \protect\numberline{\csname the#1\endcsname}%

57.472 \fi 57.473 #7}}% 57.474 \fi

57.475 \@xsect{#5}}

\@caption Caption was redefined from the 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.

57.476 \long\def\@caption#1[#2]#3{%

57.477 \par

57.478 \addcontentsline{\csname ext@#1\endcsname}{#1}%
57.479  {\protect\numberline{\csname the#1\endcsname}%
57.480  {\ignorespaces #2}}%
57.481 \def\@fignm{figure}
57.482 \ifx#1\@fignm\addcontentsline{fol}{#1}%
57.483  {\protect\numberline{\csname the#1\endcsname}%
57.484  {\ignorespaces #2}}\fi%
57.485 \def\@tblnm{table}
57.486 \ifx#1\@tblnm\addcontentsline{tol}{#1}%
57.487  {\protect\numberline{\csname the#1\endcsname}%
57.488  {\ignorespaces #2}}\fi%
57.489 \begingroup
57.490  \@parboxrestore
57.491  \if@minipage
57.492  \@setminipage

57.493 \fi

57.494  \normalsize
57.495  \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
57.496 \endgroup}

\l@chapter This standard macro was redefined for table of contents since it uses \rightskip

which is mode dependent.

57.497 \@ifclassloaded{letter}{}{%
57.498 \@ifclassloaded{article}{}{%
57.499  \renewcommand*\l@chapter[2]{%
57.500  \ifnum \c@tocdepth >\m@ne
57.501  \addpenalty{-\@highpenalty}%
57.502  \vskip 1.0em \@plus\p@
57.503  \setlength\@tempdima{1.5em}%
57.504  \begingroup
57.505  \parindent \z@ \if@rl\leftskip\else\rightskip\fi \@pnumwidth
57.506  \parfillskip -\@pnumwidth
57.507  \leavevmode \bfseries
57.508  \advance\if@rl\rightskip\else\leftskip\fi\@tempdima
57.509  \hskip -\if@rl\rightskip\else\leftskip\fi
57.510  #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss#2}\par
57.511  \penalty\@highpenalty
57.512  \endgroup
57.513  \fi}}}

\l@section \l@subsection \l@subsubsection \l@paragraph \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 report.sty (by Yaniv Bargury) and was updated later for all kinds of sections (by Boris Lavva).

57.514 \@ifclassloaded{article}{%
57.515 \renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
57.516 \renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
57.517 \renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
57.518 \renewcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
57.519 \renewcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}}{}

57.4.6 Two-column mode

This is the support of twocolumn option for the standard L^{A}TEX 2ε classes. The following code was originally borrowed from the ArabTEX package, file latexext.sty, copyright by Klaus Lagally, Institut fuer Informatik, Universitaet Stuttgart. It was updated for this package by Boris Lavva.

\@outputdblcol \set@outputdblcol rl@outputdblcol First column is \@leftcolumn will be shown at the right side, Second column is

\@outputbox will be shown at the left side.

57.520 \let\@@outputdblcol\@outputdblcol
57.521 \def\set@outputdblcol{%
57.522 \if@rl\renewcommand{\@outputdblcol}{\rl@outputdblcol}%
57.523 \else\renewcommand{\@outputdblcol}{\@@outputdblcol}\fi}
57.524 \newcommand{\rl@outputdblcol}{%
57.525 \if@firstcolumn
57.526  \global \@firstcolumnfalse
57.527  \global \setbox\@leftcolumn \box\@outputbox

57.528 \else

57.529  \global \@firstcolumntrue
57.530  \setbox\@outputbox \vbox {\hb@xt@\textwidth {%
57.531  \hskip\columnwidth%
57.532  \hfil\vrule\@width\columnseprule\hfil
57.533  \hb@xt@\columnwidth {%
57.534  \box\@leftcolumn \hss}%
57.535  \hb@xt@\columnwidth {%
57.536  \hskip-\textwidth%
57.537  \box\@outputbox \hss}%
57.538  \hskip\columnsep%
57.539  \hskip\columnwidth}}%
57.540  \@combinedblfloats
57.541  \@outputpage
57.542  \begingroup
57.543  \@dblfloatplacement
57.544  \@startdblcolumn
57.545  \@whilesw\if@fcolmade \fi
57.546  {\@outputpage
57.547  \@startdblcolumn}%
57.548  \endgroup

57.549 \fi}

57.4.7 Footnotes

\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.

57.550 \let\@@footnoterule=\footnoterule
57.551 \def\footnoterule{\if@rl\hb@xt@\hsize{\hss\vbox{\@@footnoterule}}%
57.552  \else\@@footnoterule\fi}

57.4.8 Headings and two-side support

When using headings or 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 \headlanguage when starting new chapter/part.

In addition, when selecting the twoside option (default in 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.

ps@headings ps@myheadings headeven headodd First, we will support the standard letter class:
57.553 \@ifclassloaded{letter}{%
57.554 \def\headodd{\protect\if@rl\beginR\fi\headtoname{}
57.555  \ignorespaces\toname
57.556  \hfil \@date
57.557  \hfil \pagename{} \thepage\protect\if@rl\endR\fi}
57.558 \if@twoside
57.559  \def\ps@headings{%
57.560  \let\@oddfoot\@empty\let\@evenfoot\@empty
57.561  \def\@oddhead{\select@language{\headlanguage}\headodd}
57.562  \let\@evenhead\@oddhead}

57.563 \else

57.564  \def\ps@headings{%
57.565  \let\@oddfoot\@empty
57.566  \def\@oddhead{\select@language{\headlanguage}\headodd}}

57.567 \fi

57.568 \def\headfirst{\protect\if@rl\beginR\fi\fromlocation \hfill %
57.569  \telephonenum\protect\if@rl\endR\fi}
57.570 \def\ps@firstpage{%
57.571  \let\@oddhead\@empty
57.572  \def\@oddfoot{\raisebox{-45\p@}[\z@]{%
57.573  \hb@xt@\textwidth{\hspace*{100\p@}%
57.574  \ifcase \@ptsize\relax
57.575  \normalsize

57.576 \or

57.577  \small

57.578 \or

57.579  \footnotesize

57.580 \fi

57.581  \select@language{\headlanguage}\headfirst}}\hss}}

57.582 %

57.583 \renewcommand{\opening}[1]{%
57.584  \let\headlanguage=\languagename%
57.585  \ifx\@empty\fromaddress%
57.586  \thispagestyle{firstpage}%
57.587  {\raggedleft\@date\par}%
57.588  \else  % home address
57.589  \thispagestyle{empty}%
57.590  {\raggedleft
57.591  \if@rl\begin{tabular}{r}\ignorespaces
57.592  \fromaddress \\*[2\parskip]%
57.593  \@date \end{tabular}\par%
57.594  \else\begin{tabular}{l}\ignorespaces
57.595  \fromaddress \\*[2\parskip]%
57.596  \@date \end{tabular}\par%

57.597 \fi}% 57.598 \fi

57.599  \vspace{2\parskip}%

57.600  {\raggedright \toname \\ \toaddress \par}%
57.601  \vspace{2\parskip}%
57.602  #1\par\nobreak}

57.603 }

Then, the article, report and book document classes are supported. Note, that in one-sided mode \markright was changed to \markboth.

57.604 {% article, report, book
57.605 \def\headeven{\protect\if@rl\beginR\thepage\hfil\rightmark\endR
57.606  \protect\else\thepage\hfil{\slshape\leftmark}
57.607  \protect\fi}
57.608 \def\headodd{\protect\if@rl\beginR\leftmark\hfil\thepage\endR
57.609  \protect\else{\slshape\rightmark}\hfil\thepage
57.610  \protect\fi}
57.611 \@ifclassloaded{article}{% article
57.612  \if@twoside   % two-sided
57.613  \def\ps@headings{%
57.614  \let\@oddfoot\@empty\let\@evenfoot\@empty
57.615  \def\@evenhead{\select@language{\headlanguage}\headeven}%
57.616  \def\@oddhead{\select@language{\headlanguage}\headodd}%
57.617  \let\@mkboth\markboth
57.618  \def\sectionmark##1{%
57.619  \markboth {\MakeUppercase{%
57.620  \ifnum \c@secnumdepth >\z@
57.621  \thesection\quad

57.622 \fi

57.623  ##1}}{}}%
57.624  \def\subsectionmark##1{%
57.625  \markright{%
57.626  \ifnum \c@secnumdepth >\@ne
57.627  \thesubsection\quad

57.628 \fi

57.629  ##1}}}
57.630  \else          % one-sided
57.631  \def\ps@headings{%
57.632  \let\@oddfoot\@empty
57.633  \def\@oddhead{\headodd}%
57.634  \let\@mkboth\markboth
57.635  \def\sectionmark##1{%
57.636  \markboth{\MakeUppercase{%
57.637  \ifnum \c@secnumdepth >\m@ne
57.638  \thesection\quad

57.639 \fi

57.640  ##1}}{\MakeUppercase{%
57.641  \ifnum \c@secnumdepth >\m@ne
57.642  \thesection\quad

57.643 \fi

57.644  ##1}}}}

57.645 \fi 57.646 %

57.647  \def\ps@myheadings{%
57.648  \let\@oddfoot\@empty\let\@evenfoot\@empty
57.649  \def\@evenhead{\select@language{\headlanguage}\headeven}%
57.650  \def\@oddhead{\select@language{\headlanguage}\headodd}%

57.651  \let\@mkboth\@gobbletwo
57.652  \let\sectionmark\@gobble
57.653  \let\subsectionmark\@gobble
57.654 }}{% report and book
57.655  \if@twoside  % two-sided
57.656  \def\ps@headings{%
57.657  \let\@oddfoot\@empty\let\@evenfoot\@empty
57.658  \def\@evenhead{\select@language{\headlanguage}\headeven}
57.659  \def\@oddhead{\select@language{\headlanguage}\headodd}
57.660  \let\@mkboth\markboth
57.661  \def\chaptermark##1{%
57.662  \markboth{\MakeUppercase{%
57.663  \ifnum \c@secnumdepth >\m@ne
57.664  \@chapapp\ \thechapter. \ %

57.665 \fi

57.666  ##1}}{}}%
57.667  \def\sectionmark##1{%
57.668  \markright {\MakeUppercase{%
57.669  \ifnum \c@secnumdepth >\z@
57.670  \thesection. \ %

57.671 \fi

57.672  ##1}}}}
57.673  \else  % one-sided
57.674  \def\ps@headings{%
57.675  \let\@oddfoot\@empty
57.676  \def\@oddhead{\select@language{\headlanguage}\headodd}
57.677  \let\@mkboth\markboth
57.678  \def\chaptermark##1{%
57.679  \markboth{\MakeUppercase{%
57.680  \ifnum \c@secnumdepth >\m@ne
57.681  \@chapapp\ \thechapter. \ %

57.682 \fi

57.683  ##1}}{\MakeUppercase{%
57.684  \ifnum \c@secnumdepth >\m@ne
57.685  \@chapapp\ \thechapter. \ %

57.686 \fi

57.687  ##1}}}}

57.688 \fi

57.689  \def\ps@myheadings{%
57.690  \let\@oddfoot\@empty\let\@evenfoot\@empty
57.691  \def\@evenhead{\select@language{\headlanguage}\headeven}%
57.692  \def\@oddhead{\select@language{\headlanguage}\headodd}%
57.693  \let\@mkboth\@gobbletwo
57.694  \let\chaptermark\@gobble
57.695  \let\sectionmark\@gobble

57.696 }}}

57.4.9 Miscellaneous internal L^{A}TEX macros

\raggedright \raggedleft  \raggedright was changed from latex.ltx file to support Right-to-Left mode,

because of the bug in its implementation.

57.697 \def\raggedright{%
57.698 \let\\\@centercr
57.699 \leftskip\z@skip\rightskip\@flushglue

57.700 \parindent\z@\parfillskip\z@skip}

Swap meanings of \raggedright and \raggedleft in Right-to-Left mode.

57.701 \let\@@raggedleft=\raggedleft
57.702 \let\@@raggedright=\raggedright
57.703 \renewcommand\raggedleft{\if@rl\@@raggedright%
57.704  \else\@@raggedleft\fi}
57.705 \renewcommand\raggedright{\if@rl\@@raggedleft%
57.706  \else\@@raggedright\fi}

\author \author is inserted with 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.

57.707 \let\@@author=\author
57.708 \renewcommand{\author}[1]{\@@author{\if@rl\beginR #1\endR\else #1\fi}}

\MakeUppercase \MakeLowercase There are no uppercase and lowercase letters in most Right-to-Left languages, therefore we should redefine \MakeUppercase and \MakeLowercase L^{A}TEX 2ε commands.

57.709 \let\@@MakeUppercase=\MakeUppercase
57.710 \def\MakeUppercase#1{\if@rl#1\else\@@MakeUppercase{#1}\fi}
57.711 \let\@@MakeLowercase=\MakeLowercase
57.712 \def\MakeLowercase#1{\if@rl#1\else\@@MakeLowercase{#1}\fi}

\underline We should explicitly use \L and \R commands in \underlined text.

57.713 % \changes{hebrew-2.0c}{2001/02/16}{Adde \cs{ifmmode} check to prevent
57.714 %    problems in equations inside hebrew sections}
57.715 \let\@@@underline=\underline
57.716 \def\underline#1{\@@@underline{%
57.717  \ifmmode#1\else\if@rl\R{#1}\else #1\fi\fi}}

\undertext was added for L^{A}TEX2.09 compatibility mode.

57.718 \if@compatibility
57.719 \let\undertext=\underline

57.720 \fi

\@xnthm \@opargbegintheorem The following has been inserted to correct the appearance of the number in \newtheorem to reorder theorem number components. A similar correction in the definition of \@opargbegintheorem was added too.

57.721 \def\@xnthm#1#2[#3]{%
57.722 \expandafter\@ifdefinable\csname #1\endcsname
57.723 {\@definecounter{#1}\@addtoreset{#1}{#3}%
57.724  \expandafter\xdef\csname the#1\endcsname{\noexpand\@number
57.725  {\expandafter\noexpand\csname the#3\endcsname \@thmcountersep
57.726  \@thmcounter{#1}}}%
57.727  \global\@namedef{#1}{\@thm{#1}{#2}}%
57.728  \global\@namedef{end#1}{\@endtheorem}}}

57.729 %

57.730 \def\@opargbegintheorem#1#2#3{%
57.731 \trivlist
57.732  \item[\hskip \labelsep{\bfseries #1\ #2\
57.733  \@brackets({#3})}]\itshape}

\@chapter \@schapter The following was added for pretty printing of the chapter numbers, for supporting Right-to-Left tables (cot, fol, and tol), to save \headlanguage for use in running headers, and to start two-column mode depending on chapter’s main language.

57.734 \@ifclassloaded{article}{}{%
57.735 % For pretty priniting
57.736 \def\@@chapapp{Chapter}
57.737 \def\@@thechapter{\@@arabic\c@chapter}
57.738 \def\@chapter[#1]#2{%
57.739  \let\headlanguage=\languagename%
57.740  \set@outputdblcol%
57.741  \ifnum \c@secnumdepth >\m@ne
57.742  \refstepcounter{chapter}%
57.743  \typeout{\@@chapapp\space\@@thechapter.}%
57.744  \addcontentsline{toc}{chapter}%
57.745  {\protect\numberline{\thechapter}#1}
57.746  \addcontentsline{cot}{chapter}%
57.747  {\protect\numberline{\thechapter}#1}

57.748 \else

57.749  \addcontentsline{toc}{chapter}{#1}%
57.750  \addcontentsline{cot}{chapter}{#1}%

57.751 \fi

57.752  \chaptermark{#1}
57.753  \addtocontents{lof}{\protect\addvspace{10\p@}}%
57.754  \addtocontents{fol}{\protect\addvspace{10\p@}}%
57.755  \addtocontents{lot}{\protect\addvspace{10\p@}}%
57.756  \addtocontents{tol}{\protect\addvspace{10\p@}}%
57.757  \if@twocolumn
57.758  \@topnewpage[\@makechapterhead{#2}]%

57.759 \else

57.760  \@makechapterhead{#2}%
57.761  \@afterheading

57.762 \fi} 57.763 %

57.764 \def\@schapter#1{%
57.765  \let\headlanguage=\languagename%
57.766  \set@outputdblcol%
57.767  \if@twocolumn
57.768  \@topnewpage[\@makeschapterhead{#1}]%

57.769 \else

57.770  \@makeschapterhead{#1}%
57.771  \@afterheading

57.772 \fi}}

\appendix Changed mainly for pretty printing of appendix numbers, and to start two-column

mode with the right language (if needed).

57.773 \@ifclassloaded{letter}{}{% other
57.774 \@ifclassloaded{article}{% article
57.775  \renewcommand\appendix{\par
57.776  \setcounter{section}{0}%
57.777  \setcounter{subsection}{0}%
57.778  \renewcommand\thesection{\@Alph\c@section}}
57.779 }{% report and book
57.780  \renewcommand\appendix{\par
57.781  \set@outputdblcol%

57.782  \setcounter{chapter}{0}%
57.783  \setcounter{section}{0}%
57.784  \renewcommand\@chapapp{\appendixname}%
57.785  % For pretty priniting
57.786  \def\@@chapapp{Appendix}%
57.787  \def\@@thechapter{\@@Alph\c@chapter}
57.788  \renewcommand\thechapter{\@Alph\c@chapter}}}}

57.4.10 Bibliography and citations

\@cite \@biblabel \@lbibitem Citations are produced by the macro \@cite{LABEL}{NOTE}. Both the citation label and the note is typeset in the current direction. We have to use \@brackets macro in \@cite and \@biblabel macros. In addition, when using alpha or similar bibliography style, the \@lbibitem is used and have to be update to support bot Right-to-Left and Left-to-Right citations.

57.789 \def\@cite#1#2{\@brackets[{#1\if@tempswa , #2\fi}]}
57.790 \def\@biblabel#1{\@brackets[{#1}]}
57.791 \def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
57.792  {\let\protect\noexpand
57.793  \immediate
57.794  \if@rl\write\@auxout{\string\bibcite{#2}{\R{#1}}}%
57.795  \else\write\@auxout{\string\bibcite{#2}{\L{#1}}}\fi%
57.796  }\fi\ignorespaces}
thebibliography Use \rightmargin instead of \leftmargin when in RL mode.
57.797 \@ifclassloaded{letter}{}{% other
57.798 \@ifclassloaded{article}{%
57.799 \renewenvironment{thebibliography}[1]
57.800 {\section*{\refname\@mkboth%
57.801  {\MakeUppercase\refname}%
57.802  {\MakeUppercase\refname}}%
57.803  \list{\@biblabel{\@arabic\c@enumiv}}%
57.804  {\settowidth\labelwidth{\@biblabel{#1}}%
57.805  \if@rl\leftmargin\else\rightmargin\fi\labelwidth
57.806  \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
57.807  \@openbib@code
57.808  \usecounter{enumiv}%
57.809  \let\p@enumiv\@empty
57.810  \renewcommand\theenumiv{\@arabic\c@enumiv}}%
57.811  \sloppy
57.812  \clubpenalty4000
57.813  \@clubpenalty \clubpenalty
57.814  \widowpenalty4000%
57.815  \sfcode`\.\@m}
57.816 {\def\@noitemerr
57.817  {\@latex@warning{Empty `thebibliography' environment}}%
57.818  \endlist}}%
57.819 {\renewenvironment{thebibliography}[1]{%
57.820  \chapter*{\bibname\@mkboth%
57.821  {\MakeUppercase\bibname}%
57.822  {\MakeUppercase\bibname}}%
57.823  \list{\@biblabel{\@arabic\c@enumiv}}%
57.824  {\settowidth\labelwidth{\@biblabel{#1}}%

57.825  \if@rl\leftmargin\else\rightmargin\fi\labelwidth
57.826  \advance\if@rl\leftmargin\else\rightmargin\fi\labelsep
57.827  \@openbib@code
57.828  \usecounter{enumiv}%
57.829  \let\p@enumiv\@empty
57.830  \renewcommand\theenumiv{\@arabic\c@enumiv}}%
57.831  \sloppy
57.832  \clubpenalty4000
57.833  \@clubpenalty \clubpenalty
57.834  \widowpenalty4000%
57.835  \sfcode`\.\@m}
57.836 {\def\@noitemerr
57.837  {\@latex@warning{Empty `thebibliography' environment}}%
57.838  \endlist}}}
\@verbatim All kinds of verbs (\verb,\verb*,verbatim and verbatim*) now can be used in

Right-to-Left mode. Errors in latin mode solved too.

57.839 \def\@verbatim{%
57.840 \let\do\@makeother \dospecials%
57.841 \obeylines \verbatim@font \@noligs}

\@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:

Right to left caption here (RLtext) Left to right caption here (LRtext)

See also \bcaption command below.

57.842 \long\def\@makecaption#1#2{%
57.843 \vskip\abovecaptionskip%
57.844 \begin{center}%
57.845  #1: #2%
57.846 \end{center} \par%
57.847 \vskip\belowcaptionskip}

57.4.11 Additional bidirectional commands

• Section headings are typeset with the default global direction.

• Text in section headings in the reverse language do not have to be protected for the reflection command, as in: \protect\L{Latin Text}, because \L and \R are robust now.

• Table of contents, list of figures and list of tables should be typeset with

  the \tableofcontents, \listoffigures and \listoftables commands

respectively.

• The above tables will be typeset in the main direction (and language) in effect where the above commands are placed.

• Only 2 tables of each kind are supported: one for Right-to-Left and another for Left-to-Right directions.

How to include line to both tables? One has to use bidirectional sectioning commands as following:

1. Use the \bxxx version of the sectioning commands in the text instead of

       the \xxx version (xxx is one of: part, chapter, section, subsection,
       subsubsection, caption).

2. Syntax of the \bxxx command is \bxxx{RL text}{LR text}. Both arguments are typeset in proper direction by default (no need to change direction for the text inside).

3. The section header inside the document will be typeset in the global direction in effect at the time. i.e. The {RL text} will be typeset if Right-to-Left mode is in effect and {LR text} otherwise.

\bpart
57.848 \newcommand{\bpart}[2]{\part{\protect\if@rl%
57.849  #1 \protect\else #2 \protect\fi}}
\bchapter
57.850 \newcommand{\bchapter}[2]{\chapter{\protect\if@rl%
57.851  #1 \protect\else #2 \protect\fi}}
\bsection
57.852 \newcommand{\bsection}[2]{\section{\protect\if@rl%
57.853  #1 \protect\else #2 \protect\fi}}
\bsubsection
57.854 \newcommand{\bsubsection}[2]{\subsection{\protect\if@rl%
57.855  #1 \protect\else #2 \protect\fi}}
\bsubsubsection
57.856 \newcommand{\bsubsubsection}[2]{\subsubsection{\protect\if@rl%
57.857  #1 \protect\else #2 \protect\fi}}
\bcaption
57.858 \newcommand{\bcaption}[2]{%
57.859 \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
57.860  \if@rl\R{#1}\protect\\ \L{#2}
57.861  \else\L{#2}\protect\\ \R{#1}\fi}}

The following definition is a modified version of \bchapter, meant as a bilingual twin for \chapter* and \section* (added by Irina Abramovici).

\bchapternn
57.862 \newcommand{\bchapternn}[2]{\chapter*{\protect\if@rl%
57.863  #1 \protect\else #2 \protect\fi}}
\bsectionnn
57.864 \newcommand{\bsectionnn}[2]{\section*{\protect\if@rl%
57.865  #1 \protect\else #2 \protect\fi}}

Finally, at end of babel package, the \headlanguage and two-column mode will be initialized according to the current language.

57.866 \AtEndOfPackage{\let\headlanguage=\languagename%
57.867  \set@outputdblcol}

57.868 ⟨/rightleft⟩

57.5 Hebrew calendar

The original version of the package hebcal.sty^{69} for TEX and L^{A}TEX2.09, entitled “TEX & L^{A}TEX macros for computing Hebrew date from Gregorian one” was created

by Michail Rozman, misha@iop.tartu.ew.su^{70}

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)

The package was adjusted for babel and L^{A}TEX 2ε by Boris Lavva.

This package should be included after the babel with hebrew option, as following:

     \documentclass[. . . ]{. . . }
     \usepackage[hebrew,. . . ,other languages, . . . ]{babel}
     \usepackage{hebcal}

Two main user-level commands are provided by this package:

\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).

\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:

     \newcount\hd \newcount\hm \newcount\hy
     \hd=10 \hm=3 \hy=1992
     \Hebrewdate{\hd}{\hm}{\hy}

57.5.1 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:

Nachum Dershowitz and Edward M. Reingold, “Calendarical Calculations”, Software–Pract.Exper., vol. 20 (9), pp.899–928 (September 1990).

C translation of LISP programs from the above article available from Mr. Wayne

Geiser, geiser%pictel@uunet.uu.net.

The 4^{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.

69The following description of hebcal package is based on the comments included with original source by the author, Michail Rozman.

70Please direct any comments, bug reports, questions, etc. about the package to this address.

57.5.2 Registers, Commands, Formatting Macros

The command \Hebrewtoday produces today’s date for Hebrew calendar. It is similar to the standard L^{A}TEX 2ε 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{Gday}{Gmonth}{Gyear} produces Hebrew calendar date corresponding to Gregorian date Gday.Gmonth.Gyear. Three numer-

ical 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:

 \HebrewFromGregorian{Gday}{Gmonth}{ Gyear}{Hday}{Hmonth}{Hyear}

can be used.

57.869 ⟨∗calendar⟩

57.870 \newcount\Hebrewday  \newcount\Hebrewmonth   \newcount\Hebrewyear

\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.

57.871 \def\Hebrewdate#1#2#3{%
57.872  \HebrewFromGregorian{#1}{#2}{#3}
57.873  {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
57.874  \ifundefined{if@rl}%
57.875  \FormatForEnglish{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
57.876  \else%
57.877  \FormatDate{\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%

57.878 \fi}

\Hebrewtoday Today’s date in Hebrew calendar.

57.879 \def\Hebrewtoday{\Hebrewdate{\day}{\month}{\year}}
57.880 \let\hebrewtoday=\Hebrewtoday

\Hebrewsetreg Set registers: today’s date in hebrew calendar.

57.881 \def\Hebrewsetreg{%
57.882  \HebrewFromGregorian{\day}{\month}{\year}
57.883  {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}}
\FormatDate Prints a Hebrew calendar date Hebrewday.Hebrewmonth.Hebrewyear.
57.884 \def\FormatDate#1#2#3{%
57.885  \if@rl%
57.886  \FormatForHebrew{#1}{#2}{#3}%
57.887  \else%
57.888  \FormatForEnglish{#1}{#2}{#3}

57.889 \fi}

To prepare another language version of Hebrew calendar commands, one should change or add commands here.

We start with Hebrew language macros.

\HebrewYearChar Separates elements of Hebrew year presented in Hebrew numerals (gimatria).

57.890 \def\HebrewYearChar{'}

\ShortHYName Translates Hebrew year (modulo 1000) to a string of Hebrew letters (gimatria).

57.891 \def\ShortHYName#1{{%
57.892  \count2 = #1%
57.893  \Remainder{\count2}{1000}{#1}% E.g., for  5752: #1 = 752
57.894  \def\HY{}% the string of hundreds, tens and ones
57.895  \ifnum #1 > 799 \strcat{\HY}{\tav\tav}\advance#1 by -800 \fi%
57.896  \ifnum #1 > 399 \strcat{\HY}{\tav}\advance#1  by -400 \fi%
57.897  \ifnum #1 > 299 \strcat{\HY}{\shin}\advance#1  by -300 \fi%
57.898  \ifnum #1 > 199 \strcat{\HY}{\resh}\advance#1  by -200 \fi%
57.899  \ifnum #1 > 99  \strcat{\HY}{\qof}\advance#1  by -100 \fi%
57.900  \ifnum #1 > 0

15 and 16 are special exceptions:

57.901  \ifnum #1 = 16 %
57.902  \strcat{\HY}{\tet\zayin}%
57.903  \else%
57.904  \ifnum #1 = 15 %
57.905  \strcat{\HY}{\tet\vav}%
57.906  \else%
57.907  \Remainder{#1}{10}{\count0 }%
57.908  \divide #1 by 10 %
57.909  \ifnum\count0 = 0%
57.910  \strcat{\HY}{\TensInHebrewEnd{#1}}%
57.911  \else%
57.912  \strcat{\HY}{\TensInHebrew{#1}}%
57.913  \strcat{\HY}{\DigitInHebrew{\count0 }}%

57.914 \fi% 57.915 \fi% 57.916 \fi% 57.917 \fi%

57.918  \countdef\HYLength=0  % \HYLength==\count0 = strlen(\HY)
57.919  \HYLength =0 \expandafter\getlength\HY\end%
57.920  \ifnum\HYLength > 0 %
57.921  \ifnum\HYLength = 1 %
57.922  \HY\HebrewYearChar%
57.923  \else%
57.924  \expandafter\Insert\HY%

57.925 \fi%

57.926  \else%
57.927  \relax%

57.928 \fi}}

\HebrewYearName Translates Hebrew year to a string of Hebrew letters (gimatria), when the year is

0 < year < 10000.

57.929 \def\HebrewYearName#1{{%
57.930  \count2 = #1%
57.931  \Remainder{\count2}{10000}{#1}% macro only for year <= 9999
57.932  \count2 = #1%
57.933  \Remainder{\count2}{1000}{#1}% E.g., for  5752: #1 = 752
57.934  \divide \count2 by 1000 %      E.g., for  5752: \count2 = 5
57.935  \countdef\thousand=2 %               \thousand==\count2
57.936  \def\Thousands{}% the string of thousands
57.937  \strcat{\Thousands}{\DigitInHebrew{\thousand }}% output 1000'
57.938  \ifnum\thousand = 5 % Change it in the next Hebrew Millennium..

57.939  \ifnum#1 > 0 % if 5000 < year < 6000
57.940  \def\Thousands{}% don't mention thousands

57.941 \fi% 57.942 \fi%

57.943  \countdef\ThousandsLength=0 %
57.944  % \ThousandsLength==\count0 = strlen(\Thousands)
57.945  \ThousandsLength =0 \expandafter\getlength\Thousands\end%
57.946  % if the letter of thousands is not empty
57.947  \ifnum\ThousandsLength > 0
57.948  \strcat{\Thousands}{'}% add '

57.949 \fi%

57.950  \def\HY{\ShortHYName{#1}}% the string of hundreds, tens and ones
57.951  \def\PratGadol{}% An additional string to date. Default: empty
57.952  \ifnum\thousand < 1%
57.953  \def\PratGadol{\ )\lamed\pe"\gimel(}%

57.954 \fi%

57.955  \ifnum #1 = 0%
57.956  \def\PratGadol{\ )\lamed\pe"\gimel(}%

57.957 \fi%

57.958  \Thousands\HY\PratGadol}}

\HebrewMonthName The macro \HebrewMonthName{month}{year} returns the name of month in the

‘year’.

57.959 \def\HebrewMonthName#1#2{%
57.960  \ifnum #1 = 7 %
57.961  \CheckLeapHebrewYear{#2}%
57.962  \if@HebrewLeap \alef\dalet\resh\ \bet'%
57.963  \else \alef\dalet\resh%

57.964 \fi%

57.965  \else%
57.966  \ifcase#1%
57.967  % nothing for 0
57.968  \or\tav\shin\resh\yod%
57.969  \or\het\shin\vav\finalnun%
57.970  \or\kaf\samekh\lamed\vav%
57.971  \or\tet\bet\tav%
57.972  \or\shin\bet\tet%
57.973  \or\alef\dalet\resh\ \alef'%
57.974  \or\alef\dalet\resh\ \bet'%
57.975  \or\nun\yod\samekh\finalnun%
57.976  \or\alef\yod\yod\resh%
57.977  \or\samekh\yod\vav\finalnun%
57.978  \or\tav\mem\vav\zayin%
57.979  \or\alef\bet%
57.980  \or\alef\lamed\vav\lamed%

57.981 \fi% 57.982 \fi}

\HebrewDayName Name of day in Hebrew letters (gimatria).

57.983 \def\HebrewDayName#1{%
57.984 \ifcase#1%
57.985  % nothing for 0
57.986  \or\alef'%
57.987  \or\bet'%

 57.988  \or\gimel'%
 57.989  \or\dalet'%
 57.990  \or\he'%
 57.991  \or\vav'%
 57.992  \or\zayin'%
 57.993  \or\het'%
 57.994  \or\tet'%
 57.995  \or\yod'%
 57.996  \or\yod''\alef%
 57.997  \or\yod''\bet%
 57.998  \or\yod''\gimel%
 57.999  \or\yod''\dalet%
57.1000  \or\tet''\vav%
57.1001  \or\tet''\zayin%
57.1002  \or\yod''\zayin%
57.1003  \or\yod''\het%
57.1004  \or\yod''\tet%
57.1005  \or\kaf'%
57.1006  \or\kaf''\alef%
57.1007  \or\kaf''\bet%
57.1008  \or\kaf''\gimel%
57.1009  \or\kaf''\dalet%
57.1010  \or\kaf''\he%
57.1011  \or\kaf''\vav%
57.1012  \or\kaf''\zayin%
57.1013  \or\kaf''\het%
57.1014  \or\kaf''\tet%
57.1015  \or\lamed'%
57.1016  \or\lamed''\alef%

57.1017 \fi}

\DigitInHebrew Single digit 1 ≤ n ≤ 9 as Hebrew letter. The following shorter macro is also possible:

        \def\DigitInHebrew #1{%
           {\ifnum#1>0 \ifnum#1<10 \advance#1 by `\_\char#1 \fi\fi}}

57.1018 \def\DigitInHebrew#1{%
57.1019  \ifcase#1%
57.1020  %  nothing for 0
57.1021  \or\alef%  1
57.1022  \or\bet%   2
57.1023  \or\gimel% 3
57.1024  \or\dalet% 4
57.1025  \or\he%    5
57.1026  \or\vav%   6
57.1027  \or\zayin% 7
57.1028  \or\het%   8
57.1029  \or\tet%   9

57.1030 \fi}

\TensInHebrew Convert 10 × n (1 ≤ n ≤ 9) into single Hebrew letter (gimatria).

57.1031 \def\TensInHebrew#1{%
57.1032  \ifcase #1%

57.1033  % nothing for 0
57.1034  \or\yod%    10
57.1035  \or\kaf%    20
57.1036  \or\lamed%  30
57.1037  \or\mem%    40
57.1038  \or\nun%    50
57.1039  \or\samekh% 60
57.1040  \or\ayin%   70
57.1041  \or\pe%     80
57.1042  \or\tsadi%  90

57.1043 \fi}

\TensInHebrewEnd Convert 10 × n (1 ≤ n ≤ 9) into single Hebrew letter. This letter is a final letter

version (“oth sofith”) if it exists.

57.1044 \def\TensInHebrewEnd#1{%
57.1045  \ifcase #1%
57.1046  %    nothing for 0
57.1047  \or\yod%        10
57.1048  \or\finalkaf%   20
57.1049  \or\lamed%      30
57.1050  \or\finalmem%   40
57.1051  \or\finalnun%   50
57.1052  \or\samekh%     60
57.1053  \or\ayin%       70
57.1054  \or\finalpe%    80
57.1055  \or\finaltsadi% 90

57.1056 \fi}

\FormatForHebrew The macro \FormatForHebrew{hday}{hmonth }{hyear} returns the formatted

Hebrew date in Hebrew language.

57.1057 \def\FormatForHebrew#1#2#3{%
57.1058 \HebrewDayName{#1}~\bet\HebrewMonthName{#2}{#3},~\HebrewYearName{#3}}

We continue with two English language macros for Hebrew calendar.

\HebrewMonthNameInEnglish The macro \HebrewMonthNameInEnglish{month}{ year} is similar to \Hebrew-

MonthName described above. It returns the name of month in the Hebrew ‘year’ in English.

57.1059 \def\HebrewMonthNameInEnglish#1#2{%
57.1060  \ifnum #1 = 7%
57.1061  \CheckLeapHebrewYear{#2}%
57.1062  \if@HebrewLeap Adar II\else Adar\fi%

57.1063 \else%

57.1064  \ifcase #1%
57.1065  % nothing for 0
57.1066  \or Tishrei%
57.1067  \or Heshvan%
57.1068  \or Kislev%
57.1069  \or Tebeth%
57.1070  \or Shebat%
57.1071  \or Adar I%
57.1072  \or Adar II%
57.1073  \or Nisan%
57.1074  \or Iyar%

57.1075  \or Sivan%
57.1076  \or Tammuz%

57.1077 \or Av%

57.1078  \or Elul%

57.1079 \fi 57.1080 \fi}

\FormatForEnglish The macro \FormatForEnglish{hday}{hmonth }{hyear} is similar to \Format-

ForHebrew macro described above and returns the formatted Hebrew date in English.

57.1081 \def\FormatForEnglish#1#2#3{%
57.1082  \HebrewMonthNameInEnglish{#2}{#3} \number#1,\ \number#3}

57.5.3 Auxiliary Macros

57.1083 \newcount\@common
\Remainder  \Remainder\{a\}\{b\}\{c\} calculates c = a%b == a − b × \frac{a}{b}
57.1084 \def\Remainder#1#2#3{%
57.1085  #3 = #1%                   %  c = a
57.1086  \divide #3 by #2%          %  c = a/b
57.1087  \multiply #3 by -#2%       %  c = -b(a/b)
57.1088  \advance #3 by #1}%        %  c = a - b(a/b)
57.1089 \newif\if@Divisible
\CheckIfDivisible  \CheckIfDivisible{a}{b} sets \@Divisibletrue if a%b == 0
57.1090 \def\CheckIfDivisible#1#2{%

57.1091 {%

57.1092  \countdef\tmp = 0% \tmp == \count0 - temporary variable
57.1093  \Remainder{#1}{#2}{\tmp}%
57.1094  \ifnum \tmp = 0%
57.1095  \global\@Divisibletrue%

57.1096 \else%

57.1097  \global\@Divisiblefalse%

57.1098 \fi}}

\strcat \strcat{str1 }{str2 } appends str2 to the end of macro str1.

57.1099 \def\strcat#1#2{\edef#1{#1#2}}

\getlength \getlength{string} returns the number of non-blank tokens. This macro is called

   if \count0==strlen(`string')≥ 2.
      Usage: {{\count0=0 \expandafter\getlength#1\end \number\count0}}
57.1100 \def\getlength#1{%
57.1101  \ifx#1\end%
57.1102  \let\next=\relax%

57.1103 \else%

57.1104  \advance\count0 by 1%
57.1105  \let\next=\getlength%

57.1106 \fi% 57.1107 \next}

\Insert Insert char " before the last char and output ‘string’.

      Usage: {\def\abc{abc} \count0=0 \expandafter\getlength\abc\end
      \expandafter\Insert\abc}
57.1108 \def\Insert#1{%
57.1109  \ifnum\count0 = 1%

57.1110 #1%

57.1111  \let\next=\relax%

57.1112 \else% 57.1113 #1%

57.1114  \ifnum\count0 = 2%

57.1115 "% 57.1116 \fi

57.1117  \advance\count0 by -1%
57.1118  \let\next=\Insert%

57.1119 \fi% 57.1120 \next}

\ifundefined From the TEXbook, ex. 7.7:

        \ifundefined{command}<true text>\else<false text>\fi
57.1121 \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}

57.5.4 Gregorian Part

57.1122 \newif\if@GregorianLeap

\IfGregorianLeap Conditional which is true if Gregorian ‘year’ is a leap year: ((year%4 == 0) ∧

(year%100 ≠ 0)) ∨ (year%400 == 0)

57.1123 \def\IfGregorianLeap#1{%
57.1124  \CheckIfDivisible{#1}{4}%
57.1125  \if@Divisible%
57.1126  \CheckIfDivisible{#1}{100}%
57.1127  \if@Divisible%
57.1128  \CheckIfDivisible{#1}{400}%
57.1129  \if@Divisible%
57.1130  \@GregorianLeaptrue%

57.1131 \else%

57.1132  \@GregorianLeapfalse%

57.1133 \fi% 57.1134 \else%

57.1135  \@GregorianLeaptrue%

57.1136 \fi% 57.1137 \else%

57.1138  \@GregorianLeapfalse%

57.1139 \fi%

57.1140  \if@GregorianLeap}
\GregorianDaysInPriorMonths The macro \GregorianDaysInPriorMonths{month}{year}{days} calculates the

number of days in months prior to ‘month’ in the ‘year’.

57.1141 \def\GregorianDaysInPriorMonths#1#2#3{%

57.1142 {%

57.1143  #3 = \ifcase #1%
57.1144  0 \or%             % no month number 0

57.1145 0 \or% 57.1146 31 \or% 57.1147 59 \or% 57.1148 90 \or%

57.1149  120 \or%
57.1150  151 \or%
57.1151  181 \or%
57.1152  212 \or%
57.1153  243 \or%
57.1154  273 \or%
57.1155  304 \or%

57.1156 334% 57.1157 \fi%

57.1158  \IfGregorianLeap{#2}%
57.1159  \ifnum #1 > 2%        % if month after February
57.1160  \advance #3 by 1% % add leap day

57.1161 \fi% 57.1162 \fi%

57.1163  \global\@common = #3}
57.1164  #3 = \@common}
\GregorianDaysInPriorYears The macro \GregorianDaysInPriorYears{year}{days} calculates the number of

days in years prior to the ‘year’.

57.1165 \def\GregorianDaysInPriorYears#1#2{%

57.1166 {%

57.1167  \countdef\tmpc = 4%      % \tmpc==\count4
57.1168  \countdef\tmpb = 2%      % \tmpb==\count2
57.1169  \tmpb = #1%              %
57.1170  \advance \tmpb by -1%    %
57.1171  \tmpc = \tmpb%           % \tmpc = \tmpb = year-1
57.1172  \multiply \tmpc by 365%  % Days in prior years =
57.1173  #2 = \tmpc%              % = 365*(year-1) ...
57.1174  \tmpc = \tmpb%           %
57.1175  \divide \tmpc by 4%      % \tmpc = (year-1)/4
57.1176  \advance #2 by \tmpc%    % ... plus Julian leap days ...
57.1177  \tmpc = \tmpb%           %
57.1178  \divide \tmpc by 100%    % \tmpc = (year-1)/100
57.1179  \advance #2 by -\tmpc%   % ... minus century years ...
57.1180  \tmpc = \tmpb%           %
57.1181  \divide \tmpc by 400%    % \tmpc = (year-1)/400
57.1182  \advance #2 by \tmpc%    % ... plus 4-century years.
57.1183  \global\@common = #2}
57.1184  #2 = \@common}
\AbsoluteFromGregorian The macro \AbsoluteFromGregorian{day}{month}{year}{absdate} calculates

the absolute date (days since 01.01.0001) from Gregorian date day.month.year.

57.1185 \def\AbsoluteFromGregorian#1#2#3#4{%

57.1186 {%

57.1187  \countdef\tmpd = 0%       % \tmpd==\count0
57.1188  #4 = #1%                  % days so far this month
57.1189  \GregorianDaysInPriorMonths{#2}{#3}{\tmpd}%
57.1190  \advance #4 by \tmpd%     % add days in prior months
57.1191  \GregorianDaysInPriorYears{#3}{\tmpd}%
57.1192  \advance #4 by \tmpd%     % add days in prior years

57.1193  \global\@common = #4}
57.1194  #4 = \@common}

57.5.5 Hebrew Part

57.1195 \newif\if@HebrewLeap

\CheckLeapHebrewYear Set \@HebrewLeaptrue if Hebrew ‘year’ is a leap year, i.e. if (1+7×year)%19 < 7

then true else false

57.1196 \def\CheckLeapHebrewYear#1{%

57.1197 {%

57.1198  \countdef\tmpa = 0%       % \tmpa==\count0
57.1199  \countdef\tmpb = 1%       % \tmpb==\count1

57.1200 %

57.1201  \tmpa = #1%
57.1202  \multiply \tmpa by 7%
57.1203  \advance \tmpa by 1%
57.1204  \Remainder{\tmpa}{19}{\tmpb}%
57.1205  \ifnum \tmpb < 7%         % \tmpb = (7*year+1)%19
57.1206  \global\@HebrewLeaptrue%

57.1207 \else%

57.1208  \global\@HebrewLeapfalse%

57.1209 \fi}}

\HebrewElapsedMonths The macro \HebrewElapsedMonths{year}{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’.

57.1210 \def\HebrewElapsedMonths#1#2{%

57.1211 {%

57.1212  \countdef\tmpa = 0%       % \tmpa==\count0
57.1213  \countdef\tmpb = 1%       % \tmpb==\count1
57.1214  \countdef\tmpc = 2%       % \tmpc==\count2

57.1215 %

57.1216  \tmpa = #1%               %
57.1217  \advance \tmpa by -1%     %
57.1218  #2 = \tmpa%               % #2 = \tmpa = year-1
57.1219  \divide #2 by 19%         % Number of complete Meton cycles
57.1220  \multiply #2 by 235%      % #2 = 235*((year-1)/19)

57.1221 %

57.1222  \Remainder{\tmpa}{19}{\tmpb}% \tmpa = years%19-years this cycle
57.1223  \tmpc = \tmpb%            %
57.1224  \multiply \tmpb by 12%    %
57.1225  \advance #2 by \tmpb%     % add regular months this cycle

57.1226 %

57.1227  \multiply \tmpc by 7%     %
57.1228  \advance \tmpc by 1%      %
57.1229  \divide \tmpc by 19%      % \tmpc = (1+7*((year-1)%19))/19 -
57.1230 %                                 %  number of leap months this cycle
57.1231  \advance #2 by \tmpc%     %  add leap months

57.1232 %

57.1233  \global\@common = #2}
57.1234  #2 = \@common}

\HebrewElapsedDays The macro \HebrewElapsedDays{year}{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’.

57.1235 \def\HebrewElapsedDays#1#2{%

57.1236 {%

57.1237  \countdef\tmpa = 0%       % \tmpa==\count0
57.1238  \countdef\tmpb = 1%       % \tmpb==\count1
57.1239  \countdef\tmpc = 2%       % \tmpc==\count2

57.1240 %

57.1241  \HebrewElapsedMonths{#1}{#2}%
57.1242  \tmpa = #2%               %
57.1243  \multiply \tmpa by 13753% %
57.1244  \advance \tmpa by 5604%   % \tmpa=MonthsElapsed*13758 + 5604
57.1245  \Remainder{\tmpa}{25920}{\tmpc}% \tmpc == ConjunctionParts
57.1246  \divide \tmpa by 25920%

57.1247 %

57.1248  \multiply #2 by 29%
57.1249  \advance #2 by 1%
57.1250  \advance #2 by \tmpa%     %  #2 = 1 + MonthsElapsed*29 +
57.1251 %                                 %          PartsElapsed/25920
57.1252  \Remainder{#2}{7}{\tmpa}% %  \tmpa == DayOfWeek
57.1253  \ifnum \tmpc < 19440%
57.1254  \ifnum \tmpc < 9924%
57.1255  \else%                % New moon at 9 h. 204 p. or later
57.1256  \ifnum \tmpa = 2% % on Tuesday ...
57.1257  \CheckLeapHebrewYear{#1}% of a common year
57.1258  \if@HebrewLeap%

57.1259 \else%

57.1260  \advance #2 by 1%

57.1261 \fi% 57.1262 \fi% 57.1263 \fi%

57.1264  \ifnum \tmpc < 16789%
57.1265  \else%                 % New moon at 15 h. 589 p. or later
57.1266  \ifnum \tmpa = 1%  % on Monday ...
57.1267  \advance #1 by -1%
57.1268  \CheckLeapHebrewYear{#1}% at the end of leap year
57.1269  \if@HebrewLeap%
57.1270  \advance #2 by 1%

57.1271 \fi% 57.1272 \fi% 57.1273 \fi% 57.1274 \else%

57.1275  \advance #2 by 1%      %  new moon at or after midday

57.1276 \fi% 57.1277 %

57.1278  \Remainder{#2}{7}{\tmpa}%  %  \tmpa == DayOfWeek
57.1279  \ifnum \tmpa = 0%          %  if Sunday ...
57.1280  \advance #2 by 1%
57.1281  \else%                     %
57.1282  \ifnum \tmpa = 3%      %  Wednesday ...
57.1283  \advance #2 by 1%

57.1284 \else%

57.1285  \ifnum \tmpa = 5%  %  or Friday
57.1286  \advance #2 by 1%

57.1287 \fi% 57.1288 \fi% 57.1289 \fi%

57.1290  \global\@common = #2}
57.1291  #2 = \@common}

\DaysInHebrewYear The macro \DaysInHebrewYear{year}{days} calculates the number of days in

Hebrew ‘year’.

57.1292 \def\DaysInHebrewYear#1#2{%

57.1293 {%

57.1294  \countdef\tmpe = 12%   % \tmpe==\count12

57.1295 %

57.1296  \HebrewElapsedDays{#1}{\tmpe}%
57.1297  \advance #1 by 1%
57.1298  \HebrewElapsedDays{#1}{#2}%
57.1299  \advance #2 by -\tmpe%
57.1300  \global\@common = #2}
57.1301  #2 = \@common}
\HebrewDaysInPriorMonths The macro \HebrewDaysInPriorMonths{month}{year}{days} calculates the nu-

mber of days in months prior to ‘month’ in the ‘year’.

57.1302 \def\HebrewDaysInPriorMonths#1#2#3{%

57.1303 {%

57.1304  \countdef\tmpf= 14%    % \tmpf==\count14

57.1305 %

57.1306  #3 = \ifcase #1%       % Days in prior month of regular year
57.1307  0 \or%          % no month number 0
57.1308  0 \or%          % Tishri
57.1309  30 \or%          % Heshvan
57.1310  59 \or%          % Kislev
57.1311  89 \or%          % Tebeth
57.1312  118 \or%          % Shebat
57.1313  148 \or%          % Adar I
57.1314  148 \or%          % Adar II
57.1315  177 \or%          % Nisan
57.1316  207 \or%          % Iyar
57.1317  236 \or%          % Sivan
57.1318  266 \or%          % Tammuz
57.1319  295 \or%          % Av
57.1320  325 \or%          % Elul
57.1321  400%              % Dummy

57.1322 \fi%

57.1323  \CheckLeapHebrewYear{#2}%
57.1324  \if@HebrewLeap%            % in leap year
57.1325  \ifnum #1 > 6%         % if month after Adar I
57.1326  \advance #3 by 30% % add  30 days

57.1327 \fi% 57.1328 \fi%

57.1329  \DaysInHebrewYear{#2}{\tmpf}%
57.1330  \ifnum #1 > 3%
57.1331  \ifnum \tmpf = 353%    %
57.1332  \advance #3 by -1% %
57.1333  \fi%                   %  Short Kislev
57.1334  \ifnum \tmpf = 383%    %

57.1335  \advance #3 by -1% %

57.1336 \fi% % 57.1337 \fi% 57.1338 %

57.1339  \ifnum #1 > 2%
57.1340  \ifnum \tmpf = 355%    %
57.1341  \advance #3 by 1%  %
57.1342  \fi%                   %  Long Heshvan
57.1343  \ifnum \tmpf = 385%    %
57.1344  \advance #3 by 1%  %

57.1345 \fi% % 57.1346 \fi%

57.1347  \global\@common = #3}
57.1348  #3 = \@common}
\AbsoluteFromHebrew The macro \AbsoluteFromHebrew{day}{month}{year}{absdate} calculates the

absolute date of Hebrew date day.month.year.

57.1349 \def\AbsoluteFromHebrew#1#2#3#4{%

57.1350 {% 57.1351 #4 = #1%

57.1352  \HebrewDaysInPriorMonths{#2}{#3}{#1}%
57.1353  \advance #4 by #1%         % Add days in prior months this year
57.1354  \HebrewElapsedDays{#3}{#1}%
57.1355  \advance #4 by #1%         % Add days in prior years
57.1356  \advance #4 by -1373429%   % Subtract days before Gregorian
57.1357  \global\@common = #4}      %   01.01.0001
57.1358  #4 = \@common}
\HebrewFromGregorian The macro \HebrewFromGregorian{Gday}{Gmonth}{Gyear}{Hday}{Hmonth}-

{Hyear} evaluates Hebrew date Hday, Hmonth, Hyear from Gregorian date Gday,

   Gmonth, Gyear.
57.1359 \def\HebrewFromGregorian#1#2#3#4#5#6{%

57.1360 {%

57.1361  \countdef\tmpx= 17%        % \tmpx==\count17
57.1362  \countdef\tmpy= 18%        % \tmpy==\count18
57.1363  \countdef\tmpz= 19%        % \tmpz==\count19

57.1364 %

57.1365  #6 = #3%                   %
57.1366  \global\advance #6 by 3761%  approximation from above
57.1367  \AbsoluteFromGregorian{#1}{#2}{#3}{#4}%
57.1368  \tmpz = 1  \tmpy = 1%
57.1369  \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%
57.1370  \ifnum \tmpx > #4%              %
57.1371  \global\advance #6 by -1% Hyear = Gyear + 3760
57.1372  \AbsoluteFromHebrew{\tmpz}{\tmpy}{#6}{\tmpx}%

57.1373 \fi% %

57.1374  \advance #4 by -\tmpx%     % Days in this year
57.1375  \advance #4 by 1%          %
57.1376  #5 = #4%                   %
57.1377  \divide #5 by 30%          % Approximation for month from below
57.1378  \loop%                     % Search for month
57.1379  \HebrewDaysInPriorMonths{#5}{#6}{\tmpx}%
57.1380  \ifnum \tmpx < #4%
57.1381  \advance #5 by 1%

57.1382  \tmpy = \tmpx%
57.1383  \repeat%
57.1384  \global\advance #5 by -1%
57.1385  \global\advance #4 by -\tmpy}}

57.1386 ⟨/calendar⟩

58 Hebrew input encodings

Hebrew input encodings defined in file hebinp.dtx^{71} should be used with inputenc L^{A}TEX 2ε 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:

     \usepackage[encoding name]{inputenc}

The encoding can also be selected in the document with:

     \inputencoding{encoding name}

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:

• si960 7-bit Hebrew encoding for the range 32–127. This encoding also known as “old-code” and defined by Israeli Standard SI-960.

• 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.

• 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.

• 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).

Each encoding has an associated .def file, for example 8859-8.def which defines the behaviour of each input character, using the commands:

     \DeclareInputText{slot}{text}
     \DeclareInputMath{slot}{math}

This defines the input character slot to be the text material or math material respectively. For example, 8859-8.def defines slots "EA (letter alef) and "B5 (μ) by saying:

    \DeclareInputText{224}{\alef}
    \DeclareInputMath{181}{\mu}

71The files described in this section have version number v1.0a and were last revised on 2000/09/26.

Note that the commands should be robust, and should not be dependent on the output encoding. The same 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:

    \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}
    \DeclareInputText{188}{\textonequarter}

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.

58.1 Default definitions for characters

First, we insert a \makeatletter at the beginning of all .def files to use @ symbol in the macros’ names.

58.1 ⟨−driver⟩\makeatletter

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.

58.2 ⟨∗8859 − 8 | cp862 | cp1255⟩

58.3 \ProvideTextCommandDefault{\textdegree}{\ensuremath{{^\circ}}}
58.4 \ProvideTextCommandDefault{\textonehalf}{\ensuremath{\frac12}}
58.5 \ProvideTextCommandDefault{\textonequarter}{\ensuremath{\frac14}}

58.6 ⟨/8859 − 8 | cp862 | cp1255⟩ 58.7 ⟨∗8859 − 8 | cp1255⟩

58.8 \ProvideTextCommandDefault{\textthreequarters}{\ensuremath{\frac34}}

58.9 ⟨/8859 − 8 | cp1255⟩ 58.10 ⟨∗cp862 | cp1255⟩

58.11 \ProvideTextCommandDefault{\textflorin}{\textit{f}}

58.12 ⟨/cp862 | cp1255⟩ 58.13 ⟨∗cp862⟩

58.14 \ProvideTextCommandDefault{\textpeseta}{Pt}

58.15 ⟨/cp862⟩

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.

58.16 ⟨∗cp862⟩

58.17 \ProvideTextCommandDefault{\textblacksquare}
58.18 {\vrule \@width .3em \@height .4em \@depth -.1em\relax}

58.19 ⟨/cp862⟩

Some commands can’t be faked, so we have them generate an error message.

58.20 ⟨∗8859 − 8 | cp862 | cp1255⟩

58.21 \ProvideTextCommandDefault{\textcent}
58.22 {\TextSymbolUnavailable\textcent}
58.23 \ProvideTextCommandDefault{\textyen}
58.24 {\TextSymbolUnavailable\textyen}

58.25 ⟨/8859 − 8 | cp862 | cp1255⟩ 58.26 ⟨∗8859 − 8⟩

58.27 \ProvideTextCommandDefault{\textcurrency}
58.28 {\TextSymbolUnavailable\textcurrency}

58.29 ⟨/8859 − 8⟩ 58.30 ⟨∗cp1255⟩

58.31 \ProvideTextCommandDefault{\newsheqel}
58.32 {\TextSymbolUnavailable\newsheqel}

58.33 ⟨/cp1255⟩ 58.34 ⟨∗8859 − 8 | cp1255⟩

58.35 \ProvideTextCommandDefault{\textbrokenbar}
58.36 {\TextSymbolUnavailable\textbrokenbar}

58.37 ⟨/8859 − 8 | cp1255⟩ 58.38 ⟨∗cp1255⟩

58.39 \ProvideTextCommandDefault{\textperthousand}
58.40 {\TextSymbolUnavailable\textperthousand}

58.41 ⟨/cp1255⟩

Characters that are supposed to be used only in math will be defined by \providecommand because L^{A}TEX 2ε assumes that the font encoding for math fonts is static.

58.42 ⟨∗8859 − 8 | cp1255⟩

58.43 \providecommand{\mathonesuperior}{{^1}}
58.44 \providecommand{\maththreesuperior}{{^3}}

58.45 ⟨/8859 − 8 | cp1255⟩ 58.46 ⟨∗8859 − 8 | cp862 | cp1255⟩

58.47 \providecommand{\mathtwosuperior}{{^2}}

58.48 ⟨/8859 − 8 | cp862 | cp1255⟩ 58.49 ⟨∗cp862⟩

58.50 \providecommand{\mathordmasculine}{{^o}}
58.51 \providecommand{\mathordfeminine}{{^a}}

58.52 ⟨/cp862⟩

58.2 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.

58.3 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.

58.53 ⟨∗cp1255⟩

58.54 \DeclareInputText{130}{\quotesinglbase}

58.55 \DeclareInputText{131}{\textflorin}
58.56 \DeclareInputText{132}{\quotedblbase}
58.57 \DeclareInputText{133}{\dots}
58.58 \DeclareInputText{134}{\dag}
58.59 \DeclareInputText{135}{\ddag}
58.60 \DeclareInputText{136}{\^{}}
58.61 \DeclareInputText{137}{\textperthousand}
58.62 \DeclareInputText{139}{\guilsinglleft}
58.63 \DeclareInputText{145}{\textquoteleft}
58.64 \DeclareInputText{146}{\textquoteright}
58.65 \DeclareInputText{147}{\textquotedblleft}
58.66 \DeclareInputText{148}{\textquotedblright}
58.67 \DeclareInputText{149}{\textbullet}
58.68 \DeclareInputText{150}{\textendash}
58.69 \DeclareInputText{151}{\textemdash}
58.70 \DeclareInputText{152}{\~{}}
58.71 \DeclareInputText{153}{\texttrademark}
58.72 \DeclareInputText{155}{\guilsinglright}

58.73 ⟨/cp1255⟩

58.74 ⟨∗8859 − 8 | cp1255⟩

58.75 \DeclareInputText{160}{\nobreakspace}
58.76 \DeclareInputText{162}{\textcent}
58.77 \DeclareInputText{163}{\pounds}
58.78 ⟨+8859 − 8⟩\DeclareInputText{164}{\textcurrency}
58.79 ⟨+cp1255⟩\DeclareInputText{164}{\newsheqel}
58.80 \DeclareInputText{165}{\textyen}
58.81 \DeclareInputText{166}{\textbrokenbar}
58.82 \DeclareInputText{167}{\S}
58.83 \DeclareInputText{168}{\"{}}
58.84 \DeclareInputText{169}{\textcopyright}
58.85 ⟨+8859 − 8⟩\DeclareInputMath{170}{\times}
58.86 \DeclareInputText{171}{\guillemotleft}
58.87 \DeclareInputMath{172}{\lnot}
58.88 \DeclareInputText{173}{\-}
58.89 \DeclareInputText{174}{\textregistered}
58.90 \DeclareInputText{175}{\@tabacckludge={}}
58.91 \DeclareInputText{176}{\textdegree}
58.92 \DeclareInputMath{177}{\pm}
58.93 \DeclareInputMath{178}{\mathtwosuperior}
58.94 \DeclareInputMath{179}{\maththreesuperior}
58.95 \DeclareInputText{180}{\@tabacckludge'{}}
58.96 \DeclareInputMath{181}{\mu}
58.97 \DeclareInputText{182}{\P}
58.98 \DeclareInputText{183}{\textperiodcentered}
58.99 ⟨+8859 − 8⟩\DeclareInputText{184}{\c\ }
58.100 \DeclareInputMath{185}{\mathonesuperior}
58.101 ⟨+8859 − 8⟩\DeclareInputMath{186}{\div}
58.102 \DeclareInputText{187}{\guillemotright}
58.103 \DeclareInputText{188}{\textonequarter}
58.104 \DeclareInputText{189}{\textonehalf}
58.105 \DeclareInputText{190}{\textthreequarters}

58.106 ⟨/8859 − 8 | cp1255⟩

Hebrew vowels and dots (nikud) are included only to MS Windows cp1255

page and start from the position 192.

58.107 ⟨∗cp1255⟩

58.108 \DeclareInputText{192}{\sheva}
58.109 \DeclareInputText{193}{\hatafsegol}
58.110 \DeclareInputText{194}{\hatafpatah}
58.111 \DeclareInputText{195}{\hatafqamats}
58.112 \DeclareInputText{196}{\hiriq}
58.113 \DeclareInputText{197}{\tsere}
58.114 \DeclareInputText{198}{\segol}
58.115 \DeclareInputText{199}{\patah}
58.116 \DeclareInputText{200}{\qamats}
58.117 \DeclareInputText{201}{\holam}
58.118 \DeclareInputText{203}{\qubuts}
58.119 \DeclareInputText{204}{\dagesh}
58.120 \DeclareInputText{205}{\meteg}
58.121 \DeclareInputText{206}{\maqaf}
58.122 \DeclareInputText{207}{\rafe}
58.123 \DeclareInputText{208}{\paseq}
58.124 \DeclareInputText{209}{\shindot}
58.125 \DeclareInputText{210}{\sindot}
58.126 \DeclareInputText{211}{\sofpasuq}
58.127 \DeclareInputText{212}{\doublevav}
58.128 \DeclareInputText{213}{\vavyod}
58.129 \DeclareInputText{214}{\doubleyod}

58.130 ⟨/cp1255⟩

Hebrew letters start from the position 224 in both encodings.

58.131 ⟨∗8859 − 8 | cp1255⟩

58.132 \DeclareInputText{224}{\alef}
58.133 \DeclareInputText{225}{\bet}
58.134 \DeclareInputText{226}{\gimel}
58.135 \DeclareInputText{227}{\dalet}
58.136 \DeclareInputText{228}{\he}
58.137 \DeclareInputText{229}{\vav}
58.138 \DeclareInputText{230}{\zayin}
58.139 \DeclareInputText{231}{\het}
58.140 \DeclareInputText{232}{\tet}
58.141 \DeclareInputText{233}{\yod}
58.142 \DeclareInputText{234}{\finalkaf}
58.143 \DeclareInputText{235}{\kaf}
58.144 \DeclareInputText{236}{\lamed}
58.145 \DeclareInputText{237}{\finalmem}
58.146 \DeclareInputText{238}{\mem}
58.147 \DeclareInputText{239}{\finalnun}
58.148 \DeclareInputText{240}{\nun}
58.149 \DeclareInputText{241}{\samekh}
58.150 \DeclareInputText{242}{\ayin}
58.151 \DeclareInputText{243}{\finalpe}
58.152 \DeclareInputText{244}{\pe}
58.153 \DeclareInputText{245}{\finaltsadi}
58.154 \DeclareInputText{246}{\tsadi}
58.155 \DeclareInputText{247}{\qof}
58.156 \DeclareInputText{248}{\resh}
58.157 \DeclareInputText{249}{\shin}

58.158 \DeclareInputText{250}{\tav}

58.159 ⟨/8859 − 8 | cp1255⟩

Special symbols which define the direction of symbols explicitly. Currently, they are not used in L^{A}TEX.

58.160 ⟨∗cp1255⟩

58.161 \DeclareInputText{253}{\lefttorightmark}
58.162 \DeclareInputText{254}{\righttoleftmark}

58.163 ⟨/cp1255⟩

58.4 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.

58.164 ⟨∗cp862⟩

58.165 \DeclareInputText{128}{\alef}
58.166 \DeclareInputText{129}{\bet}
58.167 \DeclareInputText{130}{\gimel}
58.168 \DeclareInputText{131}{\dalet}
58.169 \DeclareInputText{132}{\he}
58.170 \DeclareInputText{133}{\vav}
58.171 \DeclareInputText{134}{\zayin}
58.172 \DeclareInputText{135}{\het}
58.173 \DeclareInputText{136}{\tet}
58.174 \DeclareInputText{137}{\yod}
58.175 \DeclareInputText{138}{\finalkaf}
58.176 \DeclareInputText{139}{\kaf}
58.177 \DeclareInputText{140}{\lamed}
58.178 \DeclareInputText{141}{\finalmem}
58.179 \DeclareInputText{142}{\mem}
58.180 \DeclareInputText{143}{\finalnun}
58.181 \DeclareInputText{144}{\nun}
58.182 \DeclareInputText{145}{\samekh}
58.183 \DeclareInputText{146}{\ayin}
58.184 \DeclareInputText{147}{\finalpe}
58.185 \DeclareInputText{148}{\pe}
58.186 \DeclareInputText{149}{\finaltsadi}
58.187 \DeclareInputText{150}{\tsadi}
58.188 \DeclareInputText{151}{\qof}
58.189 \DeclareInputText{152}{\resh}
58.190 \DeclareInputText{153}{\shin}
58.191 \DeclareInputText{154}{\tav}
58.192 \DeclareInputText{155}{\textcent}
58.193 \DeclareInputText{156}{\pounds}
58.194 \DeclareInputText{157}{\textyen}
58.195 \DeclareInputText{158}{\textpeseta}
58.196 \DeclareInputText{159}{\textflorin}
58.197 \DeclareInputText{160}{\@tabacckludge'a}
58.198 \DeclareInputText{161}{\@tabacckludge'\i}
58.199 \DeclareInputText{162}{\@tabacckludge'o}
58.200 \DeclareInputText{163}{\@tabacckludge'u}

58.201 \DeclareInputText{164}{\~n}
58.202 \DeclareInputText{165}{\~N}
58.203 \DeclareInputMath{166}{\mathordfeminine}
58.204 \DeclareInputMath{167}{\mathordmasculine}
58.205 \DeclareInputText{168}{\textquestiondown}
58.206 \DeclareInputMath{170}{\lnot}
58.207 \DeclareInputText{171}{\textonehalf}
58.208 \DeclareInputText{172}{\textonequarter}
58.209 \DeclareInputText{173}{\textexclamdown}
58.210 \DeclareInputText{174}{\guillemotleft}
58.211 \DeclareInputText{175}{\guillemotright}
58.212 \DeclareInputMath{224}{\alpha}
58.213 \DeclareInputText{225}{\ss}
58.214 \DeclareInputMath{226}{\Gamma}
58.215 \DeclareInputMath{227}{\pi}
58.216 \DeclareInputMath{228}{\Sigma}
58.217 \DeclareInputMath{229}{\sigma}
58.218 \DeclareInputMath{230}{\mu}
58.219 \DeclareInputMath{231}{\tau}
58.220 \DeclareInputMath{232}{\Phi}
58.221 \DeclareInputMath{233}{\Theta}
58.222 \DeclareInputMath{234}{\Omega}
58.223 \DeclareInputMath{235}{\delta}
58.224 \DeclareInputMath{236}{\infty}
58.225 \DeclareInputMath{237}{\phi}
58.226 \DeclareInputMath{238}{\varepsilon}
58.227 \DeclareInputMath{239}{\cap}
58.228 \DeclareInputMath{240}{\equiv}
58.229 \DeclareInputMath{241}{\pm}
58.230 \DeclareInputMath{242}{\ge}
58.231 \DeclareInputMath{243}{\le}
58.232 \DeclareInputMath{246}{\div}
58.233 \DeclareInputMath{247}{\approx}
58.234 \DeclareInputText{248}{\textdegree}
58.235 \DeclareInputText{249}{\textperiodcentered}
58.236 \DeclareInputText{250}{\textbullet}
58.237 \DeclareInputMath{251}{\surd}
58.238 \DeclareInputMath{252}{\mathnsuperior}
58.239 \DeclareInputMath{253}{\mathtwosuperior}
58.240 \DeclareInputText{254}{\textblacksquare}
58.241 \DeclareInputText{255}{\nobreakspace}

58.242 ⟨/cp862⟩

Finally, we reset the category code of the @ sign at the end of all .def files.

58.243 ⟨−driver⟩\makeatother

59 Hebrew font encodings

The file hebrew.fdd^{72} contains the Local Hebrew Encoding (LHE) definition, the external font information needed to use the Hebrew 7-bit fonts (old code fonts) and hebfont package that provides Hebrew font switching commands.

72The files described in this section have version number v1.0b and were last revised on

2001/02/16.

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:

1. There are many 7-bit encoded Hebrew fonts available, more then for any other encoding.

2. Available TEX Hebrew fonts do not include latin alphabet, and we can safely map Hebrew glyphs to the ASCII positions (0 – 127).

Current definition of the LHE encoding supports only Hebrew letters (\alef– \tav), but not Hebrew points, such as \dagesh, \qamats, \patah, \shindot, etc. We are working now on such addition.

59.1 The docstrip modules

The following modules are used in the implementation to direct docstrip in generating external files:

driver  produce a documentation driver file
LHEenc  produce the encoding definition for Local Hebrew Encoding (LHE)
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
nowarn  option for font definition files, that used

to produce “silent” font substitutions without giving warnings

hebfont  create Hebrew font switching commands package

A typical docstrip command file would then have entries like:

\generateFile{lhecmr.fd}{t}{\from{hebrew.fdd}{LHEcmr,nowarn}}

59.2 The 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.

59.1 ⟨∗LHEenc⟩

59.2 \DeclareFontEncoding{LHE}{}{}

 59.3 \DeclareFontSubstitution{LHE}{cmr}{m}{n}
 59.4 \DeclareErrorFont{LHE}{cmr}{m}{n}{10}

59.5 ⟨/LHEenc⟩

Then we define a few commands in the LHE encoding.

59.6 ⟨∗LHEenc⟩

 59.7 \ProvideTextCommand{\textcopyright}{LHE}{\textcircled{\@latin{c}}}
 59.8 \ProvideTextCommand{\textregistered}{LHE}{\textcircled{\scshape%
 59.9  \@latin{r}}}
59.10 \ProvideTextCommand{\texttrademark}{LHE}{\textsuperscript{\@latin{TM}}}

59.11 ⟨/LHEenc⟩

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 L^{A}TEX 2ε 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 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 Alef, so we need to define its lccode to allow hyphenation. All other letters retain the same lccodes as their latin counterparts.

59.12 ⟨+LHEenc⟩\lccode``=`` %^^A ''

Hebrew letters occupy the positions 96–122 in LHE encoding:

59.13 ⟨∗LHEenc⟩

59.14 \DeclareTextSymbol{\alef}{LHE}{96}
59.15 \DeclareTextSymbol{\bet}{LHE}{97}
59.16 \DeclareTextSymbol{\gimel}{LHE}{98}
59.17 \DeclareTextSymbol{\dalet}{LHE}{99}
59.18 \DeclareTextSymbol{\he}{LHE}{100}
59.19 \DeclareTextSymbol{\vav}{LHE}{101}
59.20 \DeclareTextSymbol{\zayin}{LHE}{102}
59.21 \DeclareTextSymbol{\het}{LHE}{103}
59.22 \DeclareTextSymbol{\tet}{LHE}{104}
59.23 \DeclareTextSymbol{\yod}{LHE}{105}
59.24 \DeclareTextSymbol{\finalkaf}{LHE}{106}
59.25 \DeclareTextSymbol{\kaf}{LHE}{107}
59.26 \DeclareTextSymbol{\lamed}{LHE}{108}
59.27 \DeclareTextSymbol{\finalmem}{LHE}{109}
59.28 \DeclareTextSymbol{\mem}{LHE}{110}
59.29 \DeclareTextSymbol{\finalnun}{LHE}{111}
59.30 \DeclareTextSymbol{\nun}{LHE}{112}
59.31 \DeclareTextSymbol{\samekh}{LHE}{113}
59.32 \DeclareTextSymbol{\ayin}{LHE}{114}
59.33 \DeclareTextSymbol{\finalpe}{LHE}{115}
59.34 \DeclareTextSymbol{\pe}{LHE}{116}
59.35 \DeclareTextSymbol{\finaltsadi}{LHE}{117}
59.36 \DeclareTextSymbol{\tsadi}{LHE}{118}
59.37 \DeclareTextSymbol{\qof}{LHE}{119}

59.38 \DeclareTextSymbol{\resh}{LHE}{120}
59.39 \DeclareTextSymbol{\shin}{LHE}{121}
59.40 \DeclareTextSymbol{\tav}{LHE}{122}

59.41 ⟨/LHEenc⟩

Letter \sin is defined as a synonym of \shin unless in math mode were \sin produces a sin:

59.42 ⟨∗LHEenc⟩

59.43 \let\org@sin=\sin
59.44 \def\sin{\ifmmode\org@sin\else\shin\fi}
59.45 $</LHEenc>

59.3 The font definition files (in LHE encoding)

59.3.1 Hebrew default font

It uses Jerusalem font for regular font, Old Jaffa font for italic shape and Dead Sea font for bold face. Note:

• oldjaf10.mf This font, used for \emph was not identifies as slanted. As a result, a nested \emph had no effect (L^{A}TEXchecks if the current font is slanted or not, and toggles normal and slanted font) A font_slant parameter should be added to oldjaf10.mf, it should look like:

             font_quad             1em#;
             font_slant            0.001pt#; %%#TK added to identify as slanted
             font_normal_space     3.30033pt#;
             font_normal_stretch   0.15em#;
             font_normal_shrink    0.1em#;
             font_x_height         3.30033pt#;

The slant value is very small to ensure no influence on appearance.

59.46 ⟨∗LHEcmr⟩

59.47 \DeclareFontFamily{LHE}{cmr}{\hyphenchar\font45}
59.48 \DeclareFontShape{LHE}{cmr}{m}{n}
59.49  {<-> jerus10 }{}
59.50 %%%%%%% Font/shape undefined, therefore substituted
59.51 \DeclareFontShape{LHE}{cmr}{m}{sc}
59.52 ⟨−nowarn⟩ {<->sub * cmr/m/n}{}
59.53 ⟨+nowarn⟩ {<->ssub * cmr/m/n}{}
59.54 %%%%%%% Italicized shape
59.55 \DeclareFontShape{LHE}{cmr}{m}{it}
59.56  {<-> oldjaf10 }{}
59.57 %%%%%%% Font/shape undefined, therefore substituted
59.58 \DeclareFontShape{LHE}{cmr}{m}{sl}
59.59 ⟨−nowarn⟩ {<->sub * cmr/m/sl}{}
59.60 ⟨+nowarn⟩ {<->ssub * cmr/m/sl}{}
59.61 %%%%%%% Bold extended series
59.62 \DeclareFontShape{LHE}{cmr}{bx}{n}
59.63  {<-> deads10 }{}
59.64 %%%%%%% Font/shape undefined, therefore substituted
59.65 \DeclareFontShape{LHE}{cmr}{b}{n}
59.66 ⟨−nowarn⟩ {<->sub * cmr/bx/n}{}

59.67 ⟨+nowarn⟩ {<->ssub * cmr/bx/n}{}
59.68 %%%%%%% Font/shape undefined, therefore substituted
59.69 \DeclareFontShape{LHE}{cmr}{bx}{sl}
59.70 ⟨−nowarn⟩ {<->sub * cmr/bx/n}{}
59.71 ⟨+nowarn⟩ {<->ssub * cmr/bx/n}{}
59.72 %%%%%%% Font/shape undefined, therefore substituted
59.73 \DeclareFontShape{LHE}{cmr}{bx}{it}
59.74 ⟨−nowarn⟩ {<->sub * cmr/bx/n}{}
59.75 ⟨+nowarn⟩ {<->ssub * cmr/bx/n}{}

59.76 ⟨/LHEcmr⟩

59.3.2 Hebrew sans-serif font

We use Tel Aviv font for the Sans family. Old Jaffa font is used for italic shape and Dead Sea used for bold face.

59.77 ⟨∗LHEcmss⟩

59.78 \DeclareFontFamily{LHE}{cmss}{\hyphenchar\font45}
59.79 \DeclareFontShape{LHE}{cmss}{m}{n}
59.80  {<-> telav10 }{}
59.81 %%%%%%% Font/shape undefined, therefore substituted
59.82 \DeclareFontShape{LHE}{cmss}{m}{sc}
59.83 ⟨−nowarn⟩ {<->sub * cmss/m/n}{}
59.84 ⟨+nowarn⟩ {<->ssub * cmss/m/n}{}
59.85 %%%%%%% Italicized shape
59.86 \DeclareFontShape{LHE}{cmss}{m}{it}
59.87  {<-> oldjaf10 }{}
59.88 %%%%%%% Font/shape undefined, therefore substituted
59.89 \DeclareFontShape{LHE}{cmss}{m}{sl}
59.90 ⟨−nowarn⟩ {<->sub * cmss/m/it}{}
59.91 ⟨+nowarn⟩ {<->ssub * cmss/m/it}{}
59.92 %%%%%%% Bold extended series
59.93 \DeclareFontShape{LHE}{cmss}{bx}{n}
59.94  {<-> deads10 }{}
59.95 %%%%%%% Font/shape undefined, therefore substituted
59.96 \DeclareFontShape{LHE}{cmss}{b}{n}
59.97 ⟨−nowarn⟩ {<->sub * cmss/bx/n}{}
59.98 ⟨+nowarn⟩ {<->ssub * cmss/bx/n}{}
59.99 %%%%%%% Font/shape undefined, therefore substituted
59.100 \DeclareFontShape{LHE}{cmss}{bx}{sl}
59.101 ⟨−nowarn⟩ {<->sub * cmss/bx/n}{}
59.102 ⟨+nowarn⟩ {<->ssub * cmss/bx/n}{}
59.103 %%%%%%% Font/shape undefined, therefore substituted
59.104 \DeclareFontShape{LHE}{cmss}{bx}{it}
59.105 ⟨−nowarn⟩ {<->sub * cmss/bx/n}{}
59.106 ⟨+nowarn⟩ {<->ssub * cmss/bx/n}{}

59.107 ⟨/LHEcmss⟩

59.3.3 Hebrew typewriter font

We use Tel Aviv font as the typewriter font. Old Jaffa font is used for italic shape and Dead Sea used for bold face.

59.108 ⟨∗LHEcmtt⟩

59.109 \DeclareFontFamily{LHE}{cmtt}{\hyphenchar \font\m@ne}

59.110 \DeclareFontShape{LHE}{cmtt}{m}{n}
59.111  {<-> telav10 }{}
59.112 %%%%%%% Font/shape undefined, therefore substituted
59.113 \DeclareFontShape{LHE}{cmtt}{m}{sc}
59.114 ⟨−nowarn⟩ {<->sub * cmtt/m/n}{}
59.115 ⟨+nowarn⟩ {<->ssub * cmtt/m/n}{}
59.116 %%%%%%% Italicized shape
59.117 \DeclareFontShape{LHE}{cmtt}{m}{it}
59.118  {<-> oldjaf10 }{}
59.119 %%%%%%% Font/shape undefined, therefore substituted
59.120 \DeclareFontShape{LHE}{cmtt}{m}{sl}
59.121 ⟨−nowarn⟩ {<->sub * cmtt/m/it}{}
59.122 ⟨+nowarn⟩ {<->ssub * cmtt/m/it}{}
59.123 %%%%%%% Bold extended series
59.124 \DeclareFontShape{LHE}{cmtt}{bx}{n}
59.125  {<-> deads10 }{}
59.126 %%%%%%% Font/shape undefined, therefore substituted
59.127 \DeclareFontShape{LHE}{cmtt}{bx}{it}
59.128 ⟨−nowarn⟩ {<->sub * cmtt/bx/n}{}
59.129 ⟨+nowarn⟩ {<->ssub * cmtt/bx/n}{}

59.130 ⟨/LHEcmtt⟩

59.3.4 Hebrew classic font

Hclassic and 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 alef-lamed and two versions of the letter ayin for use with and without vowels. Hclassic also contains all of the vowels found in Hebrew, a symbol for meteg, and dots for use as a dagesh and for differentiating shin and sin letters.

Currently, only the Hebrew consonants (alef – tav) from these fonts are supported by L^{A}TEX 2ε, however one can use vowels and dots directly with Plain TEX macros. We are working on generic vowels and dots support for L^{A}TEX 2ε.

59.131 ⟨∗LHEclas⟩

59.132 \DeclareFontFamily{LHE}{clas}{}
59.133 \DeclareFontShape{LHE}{clas}{m}{n}
59.134  {<-> s * [0.83345] hclassic }{}
59.135 %%%%%%% Font/shape undefined, therefore substituted
59.136 \DeclareFontShape{LHE}{clas}{m}{sc}
59.137 ⟨−nowarn⟩ {<->sub * clas/m/n}{}
59.138 ⟨+nowarn⟩ {<->ssub * clas/m/n}{}
59.139 %%%%%%% Slanted shape
59.140 \DeclareFontShape{LHE}{clas}{m}{sl}
59.141  {<-> s * [0.69389] hcaption }{}
59.142 %%%%%%% Font/shape undefined, therefore substituted
59.143 \DeclareFontShape{LHE}{clas}{m}{it}
59.144 ⟨−nowarn⟩ {<->sub * clas/m/sl}{}
59.145 ⟨+nowarn⟩ {<->ssub * clas/m/sl}{}

59.146 ⟨/LHEclas⟩

59.3.5 Hebrew shalom fonts

All three shalom fonts (ShalomScript10, ShalomStick10 and 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 PostScript via Fontographer on a Mac. The fonts have been converted to 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

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 , letters and symbols within the fonts have been arranged so as to get a usable font for writing Hebrew documents in TEX or L^{A}TEX, with as well as without vowels.

Currently, only the Hebrew consonants (alef – tav) from these fonts are supported by L^{A}TEX 2ε, however one can use vowels and dots directly with Plain TEX macros. We are working on generic vowels and dots support for L^{A}TEX 2ε.

59.147 ⟨∗LHEshold⟩

59.148 \DeclareFontFamily{LHE}{shold}{}
59.149 \DeclareFontShape{LHE}{shold}{m}{n}
59.150  {<-> shold10 }{}

59.151 ⟨/LHEshold⟩ 59.152 ⟨∗LHEshscr⟩

59.153 \DeclareFontFamily{LHE}{shscr}{}
59.154 \DeclareFontShape{LHE}{shscr}{m}{n}
59.155  {<-> shscr10 }{}

59.156 ⟨/LHEshscr⟩ 59.157 ⟨∗LHEshstk⟩

59.158 \DeclareFontFamily{LHE}{shstk}{}
59.159 \DeclareFontShape{LHE}{shstk}{m}{n}
59.160  {<-> shstk10 }{}

59.161 ⟨/LHEshstk⟩

59.3.6 Hebrew frank-ruehl font

Frank Ruehl font was written in and includes three shapes: regular, bold extaneded and slanted.

59.162 ⟨∗LHEfr⟩

59.163 \DeclareFontFamily{LHE}{fr}{}
59.164 \DeclareFontShape{LHE}{fr}{m}{n}
59.165  {<-> fr }{}
59.166 %%%%%%% Font/shape undefined, therefore substituted
59.167 \DeclareFontShape{LHE}{fr}{m}{sc}
59.168 ⟨−nowarn⟩ {<->sub * fr/m/n}{}
59.169 ⟨+nowarn⟩ {<->ssub * fr/m/n}{}
59.170 %%%%%%% Slanted shape
59.171 \DeclareFontShape{LHE}{fr}{m}{sl}
59.172  {<-> frsl }{}
59.173 %%%%%%% Font/shape undefined, therefore substituted

59.174 \DeclareFontShape{LHE}{fr}{m}{it}
59.175 ⟨−nowarn⟩ {<->sub * fr/m/sl}{}
59.176 ⟨+nowarn⟩ {<->ssub * fr/m/sl}{}
59.177 %%%%%%% Bold extended series
59.178 \DeclareFontShape{LHE}{fr}{bx}{n}
59.179  {<-> frbx }{}
59.180 %%%%%%% Font/shape undefined, therefore substituted
59.181 \DeclareFontShape{LHE}{fr}{b}{n}
59.182 ⟨−nowarn⟩ {<->sub * fr/bx/n}{}
59.183 ⟨+nowarn⟩ {<->ssub * fr/bx/n}{}
59.184 %%%%%%% Font/shape undefined, therefore substituted
59.185 \DeclareFontShape{LHE}{fr}{bx}{sl}
59.186 ⟨−nowarn⟩ {<->sub * fr/bx/n}{}
59.187 ⟨+nowarn⟩ {<->ssub * fr/bx/n}{}
59.188 %%%%%%% Font/shape undefined, therefore substituted
59.189 \DeclareFontShape{LHE}{fr}{bx}{it}
59.190 ⟨−nowarn⟩ {<->sub * fr/bx/n}{}
59.191 ⟨+nowarn⟩ {<->ssub * fr/bx/n}{}

59.192 ⟨/LHEfr⟩

59.3.7 Hebrew carmel font

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.

59.193 ⟨∗LHEcrml⟩

59.194 \DeclareFontFamily{LHE}{crml}{}
59.195 \DeclareFontShape{LHE}{crml}{m}{n}
59.196  {<-> crml10 }{}
59.197 %%%%%%% Font/shape undefined, therefore substituted
59.198 \DeclareFontShape{LHE}{crml}{m}{sc}
59.199 ⟨−nowarn⟩ {<->sub * crml/m/n}{}
59.200 ⟨+nowarn⟩ {<->ssub * crml/m/n}{}
59.201 %%%%%%% Slanted shape
59.202 \DeclareFontShape{LHE}{crml}{m}{sl}
59.203  {<-> crmlsl10 }{}
59.204 %%%%%%% Font/shape undefined, therefore substituted
59.205 \DeclareFontShape{LHE}{crml}{m}{it}
59.206 ⟨−nowarn⟩ {<->sub * crml/m/sl}{}
59.207 ⟨+nowarn⟩ {<->ssub * crml/m/sl}{}

59.208 ⟨/LHEcrml⟩

59.3.8 Hebrew redis font

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.

59.209 ⟨∗LHEredis⟩

59.210 \DeclareFontFamily{LHE}{redis}{}
59.211 \DeclareFontShape{LHE}{redis}{m}{n}{%
59.212 <5> <6> redis7
59.213 <7> <8> <9> <10> <12> gen * redis

59.214 <10.95> redis10
59.215 <14.4> redis12
59.216 <17.28> <20.74> <24.88> redis17}{}
59.217 %%%%%%% Font/shape undefined, therefore substituted
59.218 \DeclareFontShape{LHE}{redis}{m}{sc}
59.219 ⟨−nowarn⟩ {<->sub * redis/m/n}{}
59.220 ⟨+nowarn⟩ {<->ssub * redis/m/n}{}
59.221 %%%%%%% Slanted shape
59.222 \DeclareFontShape{LHE}{redis}{m}{sl}{%
59.223 <5> <6> <7> rediss8
59.224 <8> <9> <10> <12> gen * rediss
59.225 <10.95> rediss10
59.226 <14.4> <17.28> <20.74> <24.88> rediss12}{}
59.227 %%%%%%% Font/shape undefined, therefore substituted
59.228 \DeclareFontShape{LHE}{redis}{m}{it}
59.229 ⟨−nowarn⟩ {<->sub * redis/m/sl}{}
59.230 ⟨+nowarn⟩ {<->ssub * redis/m/sl}{}
59.231 %%%%%%% Bold extended series
59.232 \DeclareFontShape{LHE}{redis}{bx}{n}{%
59.233 <5> <6> <7> <8> <9> <10> <10.95> <12>
59.234 <14.4> <17.28> <20.74> <24.88> redisb10}{}
59.235 %%%%%%% Font/shape undefined, therefore substituted
59.236 \DeclareFontShape{LHE}{redis}{b}{n}
59.237 ⟨−nowarn⟩ {<->sub * redis/bx/n}{}
59.238 ⟨+nowarn⟩ {<->ssub * redis/bx/n}{}
59.239 %%%%%%% Font/shape undefined, therefore substituted
59.240 \DeclareFontShape{LHE}{redis}{bx}{sl}
59.241 ⟨−nowarn⟩ {<->sub * redis/bx/n}{}
59.242 ⟨+nowarn⟩ {<->ssub * redis/bx/n}{}
59.243 %%%%%%% Font/shape undefined, therefore substituted
59.244 \DeclareFontShape{LHE}{redis}{bx}{it}
59.245 ⟨−nowarn⟩ {<->sub * redis/bx/n}{}
59.246 ⟨+nowarn⟩ {<->ssub * redis/bx/n}{}

59.247 ⟨/LHEredis⟩

59.3.9 Hebrew font switching commands

The hebfont package defines a number of high-level commands (all starting with \text.. similar to the standard L^{A}TEX 2ε 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 L^{A}TEX 2ε document:

       \sethebrew
       \textclas{Hebrew text printed with Classic fonts}

or to use Hebrew with Classic fonts locally:

       \R{\textclas{Hebrew text printed with Classic fonts}}

We declare L^{A}TEX 2ε font commands, e.g. \textjm{… } for all available fonts. Table 31 shows the meanings of all these new high-level commands.

Command  Corresponds to  Font family

\textjm{..}     \rmfamily  Jerusalem font
\textds{..}     \bfseries  Dead Sea font
\textoj{..}     \itshape  Old Jaffa font

                \slshape
                \emph

\textta{..}     \sffamily  Tel-Aviv font

                \ttfamily

\textcrml{..}   \fontfamily{crml} Carmel fonts
\textfr{..}     \fontfamily{fr}  Frank-Ruehl fonts
\textredis{..}  \fontfamily{redis} Redis fonts
\textclas{..}   \fontfamily{redis} Classic fonts
\textshold{..}  \fontfamily{shold} Shalom Old Style font
\textshscr{..}  \fontfamily{shscr} Shalom Script font
\textshstk{..}  \fontfamily{shstk} Shalom Stick font

Table 31: Hebrew font-change commands with arguments

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.

\textjm Switches to Jerusalem font which is default regular Hebrew font (“roman” family).

Commands \textrm{… } and old-style {\rm … } will produce the same result.

59.248 ⟨∗hebfont⟩

59.249 \DeclareTextFontCommand{\textjm}{\rmfamily\selectfont}

\textds Switches to Dead Sea font which is default bold font in Hebrew. Commands

\textbf{… } and old-style {\bf … } will produce the same result.

59.250 \DeclareTextFontCommand{\textds}{\bfseries\selectfont}

\textoj Switches to Old Jaffa font which is default italic font in Hebrew. Commands

\textit{. . . }, \textsl{. . . }, \emph{. . . } and old-style {\it . . . } or {\em . . . }

will produce the same result.

59.251 \DeclareTextFontCommand{\textoj}{\itshape\selectfont}

\textta Switches to Tel-Aviv font which is default sans-serif font in Hebrew. Commands \textsf{… }, \texttt{… } and old-style {\sf … } or {\tt … } will produce the same result (because sans-serif is used as typewriter font when in Hebrew mode).

59.252 \DeclareTextFontCommand{\textta}{\sffamily\selectfont}

\textcrml Switches to Carmel font. Regular and slanted variants of carmel font will be used..

59.253 \DeclareTextFontCommand{\textcrml}{\fontfamily{crml}\selectfont}

\textfr Switches to Frank-Ruehl font family. Regular, bold and slanted frank ruehl fonts

will be used.

59.254 \DeclareTextFontCommand{\textfr}{\fontfamily{fr}\selectfont}

Old font command Font name Comment
{\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

Table 32: Hebrew old font-change commands for compatibility mode

\textredis Switches to Redis font family. Regular, bold and slanted redis fonts of various

sizes will be used.

59.255 \DeclareTextFontCommand{\textredis}{\fontfamily{redis}\selectfont}

\textclas Switches to Classic font family. The normal font will be hclassic and slanted —

hcaption.

59.256 \DeclareTextFontCommand{\textclas}{\fontfamily{clas}\selectfont}

\textshold Switches to Shalom Old Style font.

59.257 \DeclareTextFontCommand{\textshold}{\fontfamily{shold}\selectfont}

\textshscr Switches to Shalom Script font.

59.258 \DeclareTextFontCommand{\textshscr}{\fontfamily{shscr}\selectfont}

\textshstk Switches to Shalom Stick font.

59.259 \DeclareTextFontCommand{\textshstk}{\fontfamily{shstk}\selectfont}

Finally, for backward compatibility with L^{A}TEX2.09. four old font commands, e.g. {\jm … } are defined too (see Table 32).

59.260 \if@compatibility
59.261 \DeclareOldFontCommand{\jm}{\normalfont\rmfamily\selectfont}%
59.262  {\@nomath\jm}
59.263 \DeclareOldFontCommand{\ds}{\normalfont\bfseries\selectfont}%
59.264  {\@nomath\ds}
59.265 \DeclareOldFontCommand{\oj}{\normalfont\itshape\selectfont}%
59.266  {\@nomath\oj}
59.267 \DeclareOldFontCommand{\ta}{\normalfont\sffamily\selectfont}%
59.268  {\@nomath\ta}

59.269 \fi 59.270 ⟨/hebfont⟩

60 Hebrew in L^{A}TEX 2.09 compatibility mode

\documentstyle command in the preamble of L^{A}TEX document indicates that it is a L^{A}TEX 2.09 document, and should be processed in compatibility mode. In such documents, one of the following three Hebrew style options can be included:

1. hebrew_newcode indicates that document will use UNIX ISO 8859-8 or Windows cp1255 input encoding, i.e. Alef letter will be represented as 224.

2. hebrew_p indicates that document is encoded with IBM PC cp862 encoding, i.e. Alef letter will be represented as 128.

3. hebrew_oldcode indicates that document uses old 7-bit encoding, as defined in Israeli Standard 960, i.e. Alef is character number 96.

Note, that other hebrew-related styles, such as hebcal can be included after the abovenamed Hebrew style option, for example:

     \documentstyle[12pt,hebrew_p,hebcal]{report}.

Any Hebrew document which compiled under L^{A}TEX 2.09 should compile under compatibility mode, unless it uses low-level commands such as \tenrm.

60.1 The docstrip modules

The following modules are used in the implementation to direct docstrip in generating the external files:

                 newcode produce hebrew_newcode.sty

pccode produce hebrew_p.sty

                 oldcode produce hebrew_oldcode.sty

60.2 Obsolete style files

For each of the Hebrew L^{A}TEX 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[. . . hebrew_newcode. . . ]{. . . } should still work.

60.1 ⟨∗newcode | pccode | oldcode⟩

60.2 \NeedsTeXFormat{LaTeX2e}

60.3 ⟨/newcode | pccode | oldcode⟩

60.4 ⟨∗newcode⟩

60.5 \@obsoletefile{hebrew.sty}{hebrew_newcode.sty}
60.6 \RequirePackage[8859-8]{inputenc}

60.7 ⟨/newcode⟩ 60.8 ⟨∗pccode⟩

60.9 \@obsoletefile{hebrew.sty}{hebrew_p.sty}
60.10 \RequirePackage[cp862]{inputenc}

60.11 ⟨/pccode⟩ 60.12 ⟨∗oldcode⟩

60.13 \@obsoletefile{hebrew.sty}{hebrew_oldcode.sty}
60.14 \RequirePackage[si960]{inputenc}

60.15 ⟨/oldcode⟩

60.16 ⟨∗newcode | pccode | oldcode⟩

60.17 \RequirePackage[english,hebrew]{babel}

60.18 ⟨/newcode | pccode | oldcode⟩

61 Writing Hebrew/English thesis with L^{A}TEX 2ε

The file hebtech.dtx^{73} can be useful for writing a thesis or dissertation in both Hebrew and English languages, at the Technion — Israel Institute of Technology. This package is an experimental meant to answer to the demands of the Graduate School of the Technion, but can be easily adjusted (I hope) for writing theses at other academic institutions at Israel.

Original version of this style (called hebtech.sty) for L^{A}TEX2.09 was written in April 1994 by Irina Abramovici from the Taub Computer Center, Technion and was updated for L^{A}TEX 2ε with babel support by Boris Lavva. The thesis class can be used for English documents with a number of Hebrew parts, and for Hebrew documents with a number of English parts. In addition, any other languages supported by babel can be used freely in thesis.

61.1 Common definitions

We use standard L^{A}TEX 2ε report class as the base of our hebtech class. A thesis should be printed in A4 paper, using 12pt fonts, one-sided.

61.1 ⟨∗hebtech⟩

61.2 \ExecuteOptions{a4paper,12pt,oneside,onecolumn,final,openany}

Sometimes, during thesis writing, one want to print a draft version. So, the draft option is provided:

61.3 \DeclareOption{draft}{%
61.4 \PassOptionsToPackage{all,light}{draftcopy}
61.5 \PassOptionsToClass{draft}{report}
61.6 \AtEndOfClass{\RequirePackage{draftcopy}}}

We pass all options to the report class and load it.

61.7 \DeclareOption*{%
61.8 \PassOptionsToClass{\CurrentOption}{report}}
61.9 \ProcessOptions
61.10 \LoadClass{report}

Double spacing is required by the Graduate School, so we include setspace package. This is supported L^{A}TEX 2ε package and can be found on CTAN.

61.11 \RequirePackage{setspace}
61.12 \AtBeginDocument{\doublespacing}

Thesis should be bilingual and use Hebrew and English by default. If you want to add other languages, pass them as options to class, for example:

     \documentclass[russian,spanish,greek]{hebtech}

Note, that hebrew is the last language in \RequirePackage line, and will be used by default at the beginning of document.

61.13 \RequirePackage[english,hebrew]{babel}

We have to print Jewish date in addition to Gregorian one. Hence, the hebcal package will be used.

61.14 \RequirePackage{hebcal}

73The Hebrew/English thesis class for L^{A}TEX 2ε described in this section have version number v.1.0a and were last revised on 1997/12/09.

\Hebrewdate \FormatForEnglish \FormatForHebrew \HebrewMonthNameInEnglish  \HebrewDate{day}{month}{year} macro and two additional macros \FormatFor-

English and \FormatForHebrew from the hebcal package should be redefined to print “short” date (without day).

We found that \MakeUppercase command for L^{A}TEX 2εdoes not work with

  hebcal macros, so we have to redefine \HebrewMonthNameInEnglish to print

Hebrew months in uppercase.

61.15 \renewcommand{\Hebrewdate}[3]{%
61.16 \HebrewFromGregorian{#1}{#2}{#3}
61.17  {\Hebrewday}{\Hebrewmonth}{\Hebrewyear}%
61.18 \if@rl%           Hebrew (right-to-left) mode
61.19  \FormatForHebrew{\Hebrewmonth}{\Hebrewyear}%
61.20 \else%            English mode
61.21  \FormatForEnglish{\Hebrewmonth}{\Hebrewyear}%

61.22 \fi}

61.23 \renewcommand{\FormatForEnglish}[2]{%
61.24 \HebrewMonthNameInEnglish{#1}{#2}, \space\number#2}
61.25 \renewcommand{\FormatForHebrew}[2]{%
61.26 \HebrewMonthName{#1}{#2} \space\HebrewYearName{#2}}
61.27 \renewcommand{\HebrewMonthNameInEnglish}[2]{%
61.28 \ifnum #1 = 7%
61.29  \CheckLeapHebrewYear{#2}%
61.30  \if@HebrewLeap ADAR II\else ADAR\fi%
61.31 \else%
61.32  \ifcase #1%
61.33  % nothing for 0
61.34  \or TISHREI%
61.35  \or HESHVAN%
61.36  \or KISLEV%
61.37  \or TEBETH%
61.38  \or SHEBAT%
61.39  \or ADAR I%
61.40  \or ADAR II%
61.41  \or NISAN%
61.42  \or IYAR%
61.43  \or SIVAN%
61.44  \or TAMMUZ%
61.45  \or AV%
61.46  \or ELUL%

61.47 \fi 61.48 \fi}

\engmonth \Gregoriandate Gregorian date will be printed with the aid of new macro \Gregoriandate{day} {month}{year} which is similar to \Hebrewdate defined above. The name of Gregorian month in English is created by engmonth macro, defined below, and in Hebrew – by hebmonth macro, defined in the hebrew.ldf Hebrew language definition file.

61.49 \newcommand\engmonth[1]{%
61.50 \ifcase#1\or January\or February\or March\or April\or May\or June\or
61.51 July\or August\or September\or October\or November\or December\fi}
61.52 \newcommand{\Gregoriandate}[3]{%
61.53 \if@rl%
61.54  \hebmonth{#2} \space{\beginL\number#3\endL}%
61.55 \else%

61.56  \engmonth{#2}, \space{\number#3}%

61.57 \fi}

\date To provide the automatic calculation of Gregorian and Hebrew dates, we define 3 new counts: \dd for ‘day’, \mm for ‘month’, and \yy for ‘year’. Their initial value will be \today’s day, month and year. An user can provide his/her own date with changed command \date{day}{month}{year}.

61.58 \newcount\dd \newcount\mm \newcount\yy
61.59 \dd=\number\day \mm=\number\month \yy=\number\year
61.60 \renewcommand{\date}[3]{\dd=#1 \mm=#2 \yy=#3}

\captionsenglish \captionshebrew Here we provide the default acknowledgment name in English and Hebrew for use in thesis acknowledgment pages, change the default bibliography name to “References” and add a number of useful captions in English and Hebrew for use in mathematical manuscripts with L^{A}TEX and AMS-TEX.

61.61 \addto\captionsenglish{%
61.62 \def\acknowledgmentname{Acknowledgment}%
61.63 \def\bibname{References}%
61.64 \def\continuedname{Cont'd}%
61.65 \def\definitionname{Definition}%
61.66 \def\theoremname{Theorem}%
61.67 \def\lemmaname{Lemma}%
61.68 \def\claimname{Claim}%
61.69 \def\corollaryname{Corollary}%
61.70 \def\axiomname{Axiom}%
61.71 \def\assumptionname{Assumption}%
61.72 \def\examplename{Example}%
61.73 \def\propertyname{Property}%
61.74 \def\remarkname{Remark}%
61.75 \def\problemname{Problem}%
61.76 \def\algorithmname{Algorithm}%

61.77 }

61.78 \addto\captionshebrew{%
61.79 \def\acknowledgmentname{\he\kaf\resh\tav\ \tav\vav\dalet\he}%
61.80 \def\bibname{\resh\shin\yod\mem\tav\ \mem\qof\vav\resh\vav\tav}%
61.81 \def\continuedname{\he\mem\shin\finalkaf}%
61.82 \def\definitionname{\he\gimel\dalet\resh\he}%
61.83 \def\theoremname{\mem\shin\pe\tet}%
61.84 \def\lemmaname{\lamed\mem\he}%
61.85 \def\claimname{\tet\ayin\nun\he}%
61.86 \def\corollaryname{\mem\samekh\qof\nun\he}%
61.87 \def\axiomname{\alef\qof\samekh\yod\vav\mem\he}%
61.88 \def\assumptionname{\he\nun\het\he}%
61.89 \def\examplename{\dalet\vav\gimel\mem\he}%
61.90 \def\propertyname{\tav\kaf\vav\nun\he}%
61.91 \def\remarkname{\he\ayin\resh\he}%
61.92 \def\problemname{\bet\ayin\yod\he}%
61.93 \def\algorithmname{\alef\lamed\gimel\vav\resh\yod\tav\finalmem}%

61.94 }

\@makeschapterhead Let unnumbered \chapter*’s header be centered.

61.95 \def\@makeschapterhead#1{%   % Heading for \chapter* command
61.96 \vspace*{50\p@}%           % Space at top of text page.

 61.97 {\parindent \z@ \centering % Center the header
 61.98  \normalfont
 61.99  \interlinepenalty\@M
61.100  \huge \bfseries #1\par   % Title.
61.101  \nobreak                 % TeX penalty to prevent page break.
61.102  \vskip 40\p@             % Space between title and text.

61.103 }}

\bchapternn For writer’s convenience: unnumbered \chapter* will write to English (.toc) and

Hebrew (.cot) table of contents.

61.104 \renewcommand{\bchapternn}[2]{\chapter*{%
61.105  \protect\if@rl #1\protect\else #2\protect\fi%
61.106  \@mkboth{\MakeUppercase{\protect\if@rl #1\protect\else
61.107  #2\protect\fi}}%
61.108  {\MakeUppercase{\protect\if@rl #1\protect\else
61.109  #2\protect\fi}}}
61.110 \addcontentsline{toc}{chapter}{%
61.111  \protect\hspace{-1.5em}\protect\numberline{}%
61.112  \protect\if@rl #1\protect\else #2\protect\fi}
61.113 \addcontentsline{cot}{chapter}{%
61.114  \protect\hspace{-1.5em}\protect\numberline{}%
61.115  \protect\if@rl #1\protect\else #2\protect\fi}}

\thebibliography For writer’s convenience too: bibliography chapter will write to English (.toc)

and Hebrew (.cot) table of contents.

61.116 \let\@@thebibliography\thebibliography
61.117 \def\thebibliography{%
61.118 \addcontentsline{toc}{chapter}{\protect\hspace{-1.5em}\protect{%
61.119  \bfseries\protect\numberline{}\protect\bibname}}
61.120 \addcontentsline{cot}{chapter}{\protect\hspace{-1.5em}\protect{%
61.121  \bfseries\protect\numberline{}\protect\bibname}}
61.122 \@@thebibliography}

\bcaptionf We define a bilingual Hebrew and English caption for figures.

Usage: \bcaptionf{Heb caption}{Eng caption}.

61.123 \newcommand{\bcaptionf}[2]{%
61.124 \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
61.125  \if@rl\R{#1} \protect\\ \L{Figure~\thefigure: #2}
61.126  \else\L{#2} \protect\\ \R{\alef\yod\vav\resh~\thefigure: #1}

61.127 \fi}}

\bcaptionff Extended bilingual Hebrew and English caption for figures.

Usage: \bcaptionff{to Heb LOF }{to Eng LOF }{Heb caption}{Eng caption}.

61.128 \newcommand{\bcaptionff}[4]{%
61.129 \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
61.130  \if@rl\R{#3}\protect\\ \L{Figure~\thefigure: #4}
61.131  \else\L{#4}\protect\\ \R{\alef\yod\vav\resh~\thefigure: #3}

61.132 \fi}}

\bcaptiont Bilingual Hebrew and English caption for tables (short variant).

Usage: \bcaptiont{Heb caption}{Eng caption}.

61.133 \newcommand{\bcaptiont}[2]{%

61.134 \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
61.135  \if@rl\R{#1} \protect\\ \L{Table~\thetable: #2}
61.136  \else\L{#2} \protect\\ \R{\tet\bet\lamed\he~\thetable: #1}

61.137 \fi}}

\bcaptiontt Extended bilingual Hebrew and English caption for tables.

Usage: \bcaptiontt{to Heb LOT }{to Eng LOT }{Heb caption}{Eng caption}.

61.138 \newcommand{\bcaptiontt}[4]{%
61.139 \caption[\protect\if@rl \R{#1}\protect\else \L{#2}\protect\fi]{%
61.140  \if@rl\R{#3} \protect\\ \L{Table~\thetable: #4}
61.141  \else\L{#4} \protect\\ \R{\tet\bet\lamed\he~\thetable: #3}

61.142 \fi}}

thestype The meaning of thestype counter is: 1 for a research thesis, 2 for a project thesis, 3 for a final paper.

61.143 \newcounter{thestype}

grade The meaning of grade counter is:

1 for master of science,

2 for master,

3 for master of technology,

4 for doctor of science.

61.144 \newcounter{grade}

61.2 Parameters for title pages

All following macros are defined with 2 obligatory parameters: first is the Hebrew version and second is the English one. For example, for \title macro:

       \title{Hebrew title}{English title}

\title Thesis or dissertation’s title.

61.145 \def\title#1#2{\gdef\@@titleh{#1}\gdef\@@title{#2}}

\author The author(s) of thesis or dissertation.

61.146 \def\author#1#2{\gdef\@@authorh{#1}\gdef\@@author{#2}}

\dept The name of faculty, for example, “Electrical Engineering Department”.

61.147 \def\dept#1#2{\gdef\@@depth{#1}\gdef\@@dept{#2}}

\dom The domain of research, for example, “Computer Engineering”.

61.148 \def\dom#1#2{\gdef\@@domh{#1}\gdef\@@dom{#2}}

\advisori The name of advisor (or the main advisor if there are two).

61.149 \def\advisori#1#2{\gdef\@@advisorih{#1}\gdef\@@advisori{#2}}

\advisorii The name of the second advisor, if exists.

61.150 \def\advisorii#1#2{\gdef\@@advisoriih{#1}\gdef\@@advisorii{#2}}

\donori The name of the person or institution which granted help in the form of scholarship,

if any.

61.151 \def\donori#1#2{\gdef\@@donorih{#1}\gdef\@@donori{#2}}

\donorii The name of the second person or institution which granted help in the form of

scholarship, if any.

61.152 \def\donorii#1#2{\gdef\@@donoriih{#1}\gdef\@@donorii{#2}}

\donor User-defined line to replace the default one: “The generous financial help of … is gratefully acknowledged”. If no scholarship or other financial help need to be acknowledged, this macro should be included and empty, i.e. \donor{}{}.

61.153 \def\donor#1#2{\gdef\@donorh{#1}\gdef\@donor{#2}}

61.3 English part

Here we define all internal macros that will be needed for cover, title, and acknowledgment pages in the English language version. The \@line…, \@thestype and \@donor macros are very Technion-related and should be redefined when adjusting this class for another academic institution.

61.154 \def\@@title{}
61.155 \def\@@author{}
61.156 \def\@@dom{}
61.157 \def\@@advisori{}
61.158 \def\@@advisorii{}
61.159 \def\@@donori{}
61.160 \def\@@donorii{}
61.161 \def\@donor{}
61.162 \def\@thestype{%
61.163 \ifcase\value{thestype}%
61.164 \or \MakeUppercase{Research Thesis}%
61.165 \or \MakeUppercase{Project Thesis}%
61.166 \or \MakeUppercase{Final Paper} \else {}\fi}
61.167 \def\@linei{%
61.168 \MakeUppercase{Submitted in Partial Fulfillment
61.169  of the Requirements}}
61.170 \def\@lineii{%
61.171 \ifcase\value{grade}%
61.172  \or \MakeUppercase{For the Degree of Master of Science}
61.173  \or \MakeUppercase{For the Degree of Master}
61.174  \or \MakeUppercase{For the Degree of Master of Technology}
61.175  \or \MakeUppercase{For the Degree of Doctor of Science}
61.176  \else {}\fi}
61.177 \def\@lineiii{%
61.178 \if\@@dom\else%
61.179  \ifcase\value{grade}%
61.180  \or \MakeUppercase{in} \MakeUppercase{\@@dom}%
61.181  \or \MakeUppercase{in} \MakeUppercase{\@@dom}%
61.182  \or \MakeUppercase{in} \MakeUppercase{\@@dom}%

61.183  \else{}\fi%

61.184 \fi}

61.185 \def\@lineiv{\mbox{\hspace{-.2in}\footnotesize\MakeUppercase{%
61.186  Submitted to the Senate of the Technion --- %
61.187  Israel Institute of Technology}}}
61.188 \def\@linev{\footnotesize{\Hebrewdate{\dd}{\mm}{\yy}%
61.189  \hfill\MakeUppercase{Haifa}\hfill%
61.190  \MakeUppercase{\Gregoriandate{\dd}{\mm}{\yy}}}}
61.191 \def\@linevi{\MakeUppercase{This}\
61.192  \@thestype\
61.193  \MakeUppercase{was supervised by}}
61.194 \def\@linevii{\MakeUppercase{under the auspices of the}}
61.195 \def\@donor{%
61.196 \MakeUppercase{The generous financial help of}\ %
61.197 \MakeUppercase{\@@donori}\ %
61.198 \ifx\empty\@@donorii\else\MakeUppercase{and \@@donorii{} }\fi%
61.199 \MakeUppercase{is gratefully acknowledged}}

61.4 Hebrew part

Here we define all internal macros that will be needed for cover, title, and acknowledgment pages in the Hebrew language version. The \@line… h, \@thestypeh and \@donorh macros are very Technion-related and should be redefined when rewriting this class for another academic institution.

61.200 \def\@@titleh{}
61.201 \def\@@authorh{}
61.202 \def\@@depth{}
61.203 \def\@@domh{}
61.204 \def\@@advisorih{}
61.205 \def\@@advisoriih{}
61.206 \def\@@donorih{}
61.207 \def\@@donoriih{}
61.208 \def\@donorh{}
61.209 \def\@thestypeh{%
61.210 \ifcase\value{thestype}%
61.211 \or \het\yod\bet\vav\resh\ \ayin\lamed\ \mem\het\qof\resh%
61.212 \or \het\yod\bet\vav\resh\ \ayin\lamed\ \pe\resh\vav\yod\qof\tet%
61.213 \or \ayin\bet\vav\dalet\tav\ \gimel\mem\resh \else {}\fi}
61.214 \def\@lineih{%
61.215 \lamed\shin\finalmem\ \mem\yod\lamed\vav\yod\ \het\lamed\qof\yod\ %
61.216 \shin\lamed\ \he\dalet\resh\yod\shin\vav\tav\ %
61.217 \lamed\qof\bet\lamed\tav\ \tav\vav\alef\resh{}}
61.218 \def\@lineiih{%
61.219 \ifcase\value{grade}%
61.220  \or \mem\gimel\yod\samekh\tet\resh\ %
61.221  \lamed\mem\dalet\ayin\yod\finalmem%
61.222  \or \mem\gimel\yod\samekh\tet\resh%
61.223  \or \mem\gimel\yod\samekh\tet\resh\ %
61.224  \bet\tet\kaf\nun\vav\lamed\vav\gimel\yod\he%
61.225  \or \dalet\qof\tet\vav\resh\ %

61.226  \lamed\mem\dalet\ayin\yod\finalmem%
61.227  \else {}\fi}
61.228 \def\@lineiiih{%
61.229 \ifcase\value{grade}%
61.230  \or \@@domh%
61.231  \or \@@domh%
61.232  \or \@@domh%
61.233  \else{}\fi}
61.234 \def\@lineivh{\he\vav\gimel\shin\ \lamed\samekh\nun\tet\ %
61.235  \he\tet\kaf\nun\yod\vav\finalnun\ \textemdash\ %
61.236  \mem\kaf\vav\finalnun\ %
61.237  \tet\kaf\nun\vav\lamed\vav\gimel\yod\ %
61.238  \lamed\yod\shin\resh\alef\lamed}
61.239 \def\@linevh{\Hebrewdate{\dd}{\mm}{\yy}%
61.240  \hfill\het\yod\pe\he\hfill%
61.241  \Gregoriandate{\dd}{\mm}{\yy}}
61.242 \def\@linevih{%
61.243 \ifcase\value{thestype}%
61.244 \or \@thestypeh{} \nun\ayin\shin\he%
61.245 \or \@thestypeh{} \nun\ayin\shin\he%
61.246 \or \@thestypeh{} \nun\ayin\shin\tav\he\else{}\fi}
61.247 \def\@lineviih{\bet\he\dalet\resh\kaf\tav{}}
61.248 \def\@donorh{\alef\nun\yod\ \mem\vav\dalet\he{}
61.249 \lamed\@@donorih{}
61.250 \ifx\empty\@@donoriih\else\vav\lamed\@@donoriih{} \fi
61.251 \ayin\lamed\ \he\tav\mem\yod\kaf\he\ \he\kaf\samekh\pe\yod\tav\ %
61.252 \he\nun\dalet\yod\bet\he\ \bet\he\shin\tav\lamed\mem\vav\tav\yod}%

61.5 User-level commands and macros

   The following 3 macros: \frontmatter, \mainmatter and \backmatter should

be used to divide a thesis to 3 parts:

1. Hebrew cover, title, acknowledgment, TOC, LOF, LOT when the main language of the document will be Hebrew OR English cover, etc. when the main language of the document will be English. This part will be with hebrew page numbering if in Hebrew and with roman page numbering if in English.

2. The main part (in Hebrew or in English) will be with arabic page numbering.

3. The opposite to the first part:

English cover, title, acknowledgment, TOC, LOF, LOT when the main language of the document was Hebrew OR Hebrew cover, etc. when the main language of the document was English. This part will be with roman page numbering if in English and with hebrew page numbering if in Hebrew.

\frontmatter Should be used at the beginning of the first part (for example, after the Hebrew

   \makecover).
61.253 \newcommand\frontmatter{%
61.254 \if@openright\cleardoublepage\else\clearpage\fi%
61.255 \if@rl\pagenumbering{alph}\else\pagenumbering{roman}\fi}

\mainmatter Should be used at the beginning of the second part (for example, after the Hebrew

abstract).

61.256 \newcommand\mainmatter{%
61.257 \if@openright\cleardoublepage\else\clearpage\fi%
61.258 \pagenumbering{arabic}}

\backmatter Should be used at the beginning of the third part (for example, after the English

   \makecover).
61.259 \let\backmatter\frontmatter

\makecover This command is similar to \maketitle and builds a standard thesis cover with title and author. The cover will be in Hebrew when in Hebrew mode, and in English when in English mode.

61.260 \newcommand{\makecover}{%
61.261 \begin{titlepage}
61.262  \thispagestyle{empty}
61.263  \null\vskip.8truein
61.264  \begin{doublespace}
61.265  \begin{center}
61.266  \bfseries\if@rl\Huge\@@titleh
61.267  \else\LARGE\MakeUppercase{\@@title}\fi
61.268  \vskip2.7truein
61.269  \if@rl\huge\@@authorh
61.270  \else\LARGE\MakeUppercase{\@@author}\fi
61.271  \end{center}
61.272  \end{doublespace}
61.273  \vfill\null
61.274 \end{titlepage}
61.275 \thispagestyle{empty}}

\maketitle This updated command builds a standard thesis title page. It will be in Hebrew

when in Hebrew mode, and in English when in English mode.

61.276 \renewcommand{\maketitle}{%
61.277 \if@openright\cleardoublepage\else\clearpage\fi
61.278 \thispagestyle{empty}
61.279 \begin{doublespace}
61.280  \begin{center}
61.281  \bfseries\if@rl\huge\@@titleh
61.282  \else\Large\MakeUppercase{\@@title}\fi
61.283  \end{center}
61.284  \vfill
61.285  \begin{center}
61.286  \if@rl\Large\@thestypeh\else\large\@thestype\fi
61.287  \end{center}
61.288  \vfill
61.289  \begin{center}
61.290  \if@rl\large
61.291  \@lineih\\
61.292  \@lineiih\\
61.293  \@lineiiih
61.294  \else\large
61.295  \@linei\\
61.296  \@lineii\\

61.297  \@lineiii\fi
61.298  \end{center}
61.299  \vfill%
61.300  \begin{center}
61.301  \bfseries\if@rl\LARGE\@@authorh
61.302  \else\Large\MakeUppercase{\@@author}\fi
61.303  \end{center}
61.304  \vfill
61.305  \begin{center}
61.306  \if@rl\large
61.307  \@lineivh\\
61.308  \@linevh

61.309 \else

61.310  \@lineiv\\
61.311  \@linev\fi
61.312  \end{center}
61.313 \end{doublespace}
61.314 \newpage\thispagestyle{empty}}

acknowledgment The acknowledgment environment is defined to help a writer to add his/her customized acknowledgment to the third page (after the cover and title pages). The acknowledgment will be in Hebrew when in Hebrew mode, and in English when in English mode.

For example:

          \begin{acknowledgment}
             I want to ``thank'' my committee,\\
             without whose ridiculous demands,\\
             I would have graduated so, so, very much faster.
          \end{acknowledgment}

61.315 \newenvironment{acknowledgment}{%
61.316 \if@openright\cleardoublepage\else\clearpage\fi
61.317 \thispagestyle{empty}%
61.318 \begin{center}
61.319  \if@rl\large
61.320  \@linevih{}
61.321  \@lineviih{}
61.322  \@@advisorih{}
61.323  \ifx\empty\@@advisoriih\else\vav\@@advisoriih{} \fi\\
61.324  \@@depth

61.325 \else

61.326  \@linevi{}
61.327  \MakeUppercase{\@@advisori}\ %
61.328  \ifx\empty\@@advisorii\else\MakeUppercase{and \@@advisorii{} }\fi
61.329  \@linevii{}
61.330  \MakeUppercase{\@@dept}

61.331 \fi

61.332 \end{center}
61.333 \vfill
61.334 \begin{center}%
61.335  \if@rl\LARGE\acknowledgmentname%
61.336  \else\Large\MakeUppercase{\acknowledgmentname}\fi
61.337 \end{center}

61.338 \vspace{2\baselineskip}
61.339 \begingroup\large}
61.340 {\endgroup\vfill
61.341 \begin{center}
61.342  \if@rl\large\@donorh\else\@donor\fi
61.343 \end{center}
61.344 \newpage\normalsize\thispagestyle{empty}}

dedication The dedication environment is similar to the previous one and defined to help a writer to add his/her dedication page (fourth page – after the cover, title and acknowledgment pages). The dedication will be in Hebrew when in Hebrew mode, and in English when in English mode.

For example:

          \begin{dedication}
             To myself,\\
             John W. Smith,\\
             the only person worthy of my company.
          \end{dedication}

61.345 \newenvironment{dedication}{%
61.346 \thispagestyle{empty}%
61.347 \vspace*{2\baselineskip}
61.348 \begin{center}\large}
61.349 {\end{center}
61.350 \newpage\normalsize\thispagestyle{empty}}

abstract Builds standard abstract and adds title in Hebrew when in Hebrew mode, and in

English when in English mode.

61.351 \renewenvironment{abstract}{%
61.352 \if@openright\cleardoublepage\else\clearpage\fi%
61.353 \if@rl\bchapternn{\abstractname}{Hebrew Abstract}
61.354 \else\bchapternn{\tav\qof\tsadi\yod\resh\ %
61.355  \bet\alef\nun\gimel\lamed\yod\tav}
61.356  {\abstractname}\fi%
61.357 \begingroup}{%
61.358 \newpage\endgroup}

\ps@thesis Define the “thesis” page style which is based on the standard \ps@headings, but adds a thick horisontal rule to running headings. The following line should be added to the document’s preamble:

       \pagestyle{thesis}
61.359 \def\ps@thesis{%
61.360 \def\headeven{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth%
61.361  \protect\if@rl\beginR\thepage\hfil{%
61.362  \bfseries\rightmark}\endR%
61.363  \protect\else\thepage\hfil{%
61.364  \bfseries\leftmark}\protect\fi}
61.365 \def\headodd{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth%
61.366  \protect\if@rl\beginR{\bfseries\leftmark}%
61.367  \hfil\thepage\endR%
61.368  \protect\else{\bfseries\rightmark}%

61.369  \hfil\thepage\protect\fi}
61.370 \ps@headings}

Set up page layout.

\textheight \textwidth Height and width of the main body of the text.

61.371 \setlength{\textheight}{8.25in}
61.372 \setlength{\textwidth}{6.0in}

\topmargin Margin on top of page.

61.373 \setlength{\topmargin}{0pt}

\headsep Space between header and top of body (for more details, see “The L^{A}TEX Compan-

ion” book, p. 85).

61.374 \setlength{\headsep}{.5in}
61.375 \addtolength{\headsep}{-\headheight}

\oddsidemargin \evensidemargin Margins on the left for odd pages and on the right for even pages.

61.376 \setlength{\oddsidemargin}{.25in}
61.377 \setlength{\evensidemargin}{.25in}

\marginparwidth \marginparsep Parameters for marginal notes: width of marginal notes and space between mar-

ginal notes and text.

61.378 \setlength{\marginparwidth}{40pt}
61.379 \setlength{\marginparsep}{10pt}
61.380 \brokenpenalty=10000

61.381 ⟨/hebtech⟩

62 The Bahasa language

The file bahasa.dtx^{74} defines all the language definition macros for the bahasa indonesia / bahasa melayu language. Bahasa just means ‘language’ in bahasa indonesia / bahasa melayu. Since both national versions of the language use the same writing, although differing in pronounciation, this file can be used for both languages.

For this language currently no special definitions are needed or available. The macro \LdfInit takes care of preventing that this file is loaded more than

once, checking the category code of the @ sign, etc.

62.1 ⟨∗code⟩

 62.2 \LdfInit{bahasa}\captionsbahasa

When this file is read as an option, i.e. by the \usepackage command, 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.

 62.3 \ifx\l@bahasa\@undefined
 62.4 \@nopatterns{Bahasa}
 62.5 \adddialect\l@bahasa0\fi

The next step consists of defining commands to switch to (and from) the Bahasa language.

\captionsbahasa The macro \captionsbahasa defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 62.6 \addto\captionsbahasa{%
 62.7 \def\prefacename{Pendahuluan}%
 62.8 \def\refname{Pustaka}%
 62.9 \def\abstractname{Ringkasan}% (sometime it's called 'intisari'
62.10  %  or 'ikhtisar')
62.11 \def\bibname{Bibliografi}%
62.12 \def\chaptername{Bab}%
62.13 \def\appendixname{Lampiran}%
62.14 \def\contentsname{Daftar Isi}%
62.15 \def\listfigurename{Daftar Gambar}%
62.16 \def\listtablename{Daftar Tabel}%
62.17 % Glossary: Daftar Istilah
62.18 \def\indexname{Indeks}%
62.19 \def\figurename{Gambar}%
62.20 \def\tablename{Tabel}%
62.21 \def\partname{Bagian}%
62.22 %  Subject:  Subyek
62.23 %  From:  Dari
62.24 \def\enclname{Lampiran}%
62.25 \def\ccname{cc}%
62.26 \def\headtoname{Kepada}%
62.27 \def\pagename{Halaman}%
62.28 %  Notes (Endnotes): Catatan
62.29 \def\seename{lihat}%
62.30 \def\alsoname{lihat juga}%
62.31 \def\proofname{Bukti}%

74The file described in this section has version number v1.0h and was last revised on

2001/01/30.

62.32 \def\glossaryname{Glossary}% <-- Needs translation

62.33 }

\datebahasa The macro \datebahasa redefines the command \today to produce Bahasa dates.

62.34 \def\datebahasa{%
62.35 \def\today{\number\day~\ifcase\month\or
62.36  Januari\or Pebruari\or Maret\or April\or Mei\or Juni\or
62.37  Juli\or Agustus\or September\or Oktober\or Nopember\or Desember\fi
62.38  \space \number\year}}

\extrasbahasa \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.

62.39 \addto\extrasbahasa{}
62.40 \addto\noextrasbahasa{}

\bahasahyphenmins The bahasa hyphenation patterns should be used with \lefthyphenmin set to 2

and \righthyphenmin set to 2.
62.41 \providehyphenmins{\CurrentOption}{\tw@\tw@}

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.

62.42 \ldf@finish{bahasa}

62.43 ⟨/code⟩

63 Not renaming hyphen.tex

As Don Knuth has declared that the filename hyphen.tex may only be used to designate his version of the american English hyphenation patterns, a new solution has to be found in order to be able to load hyphenation patterns for other languages in a plain-based TEX-format. When asked he responded:

That file name is "sacred", and if anybody changes it they will cause severe upward/downward compatibility headaches.

People can have a file localhyphen.tex or whatever they like, but they mustn’t diddle with hyphen.tex (or plain.tex except to preload additional fonts).

The files bplain.tex and blplain.tex can be used as replacement wrappers around plain.tex and lplain.tex to acheive the desired effect, based on the babel package. If you load each of them with iniTEX, you will get a file called either bplain.fmt or blplain.fmt, which you can use as replacements for plain.fmt

and lplain.fmt.

As these files are going to be read as the first thing iniTEX sees, we need to set some category codes just to be able to change the definition of \input

63.1 ⟨∗bplain | blplain⟩

63.2 \catcode`\{=1 % left brace is begin-group character
63.3 \catcode`\}=2 % right brace is end-group character
63.4 \catcode`\#=6 % hash mark is macro parameter character

Now let’s see if a file called hyphen.cfg can be found somewhere on TEX’s input path by trying to open it for reading...

63.5 \openin 0 hyphen.cfg

If the file wasn’t found the following test turns out true.

63.6 \ifeof0
63.7 \else

When hyphen.cfg could be opened we make sure that it will be read instead of the file hyphen.tex which should (according to Don Knuth’s ruling) contain the american English hyphenation patterns and nothing else.

We do this by first saving the original meaning of \input (and I use a one letter control sequence for that so as not to waste multi-letter control sequence on this in the format).

63.8 \let\a\input

Then \input is defined to forget about its argument and load hyphen.cfg instead.

63.9 \def\input #1 {%
63.10  \let\input\a
63.11  \a hyphen.cfg

Once that’s done the original meaning of \input can be restored and the definition of \a can be forgotten.

63.12  \let\a\undefined

63.13 } 63.14 \fi 63.15 ⟨/bplain | blplain⟩

Now that we have made sure that hyphen.cfg will be loaded at the right moment it is time to load plain.tex.

63.16 ⟨bplain⟩\a plain.tex 63.17 ⟨blplain⟩\a lplain.tex

Finally we change the contents of \fmtname to indicate that this is not the plain format, but a format based on plain with the babel package preloaded.

63.18 ⟨bplain⟩\def\fmtname{babel-plain}
63.19 ⟨blplain⟩\def\fmtname{babel-lplain}

When you are using a different format, based on plain.tex you can make a copy of blplain.tex, rename it and replace plain.tex with the name of your format file.

64 Support for formats based on plainTEX

The following code duplicates or emulates parts of L^{A}TEX 2ε that are needed for babel.

64.1 ⟨∗code⟩

64.2 \ifx\adddialect\@undefined

When \adddialect is still undefined we are making a format. In that case only the first part of this file is needed.

64.3 \def\@empty{}

We need to define \loadlocalcfg for plain users as the L^{A}TEX definition uses

\InputIfFileExists.
64.4 \def\loadlocalcfg#1{%
64.5  \openin0#1.cfg
64.6  \ifeof0
64.7  \closein0
64.8  \else
64.9  \closein0
64.10  {\immediate\write16{*************************************}%
64.11  \immediate\write16{* Local config file #1.cfg used}%
64.12  \immediate\write16{*}%

64.13 }

64.14  \input #1.cfg\relax

64.15 \fi

We have to execute \@endofldf in this case

64.16  \@endofldf

64.17 }

We want to add a message to the message L^{A}TEX 2.09 puts in the \everyjob register. This could be done by the following code:

    \let\orgeveryjob\everyjob
    \def\everyjob#1{%
      \orgeveryjob{#1}%
      \orgeveryjob\expandafter{\the\orgeveryjob\immediate\write16{%
          hyphenation patterns for \the\loaded@patterns loaded.}}%
      \let\everyjob\orgeveryjob\let\orgeveryjob\@undefined}

The code above redefines the control sequence \everyjob in order to be able to add something to the current contents of the register. This is necessary because the processing of hyphenation patterns happens long before L^{A}TEX fills the register.

There are some problems with this approach though.

• When someone wants to use several hyphenation patterns with SLiTEX the above scheme won’t work. The reason is that SLiTEX overwrites the contents of the \everyjob register with its own message.

• Plain TEX does not use the \everyjob register so the message would not be displayed.

To circumvent this a ‘dirty trick’ can be used. As this code is only processed when creating a new format file there is one command that is sure to be used, \dump. Therefore the original \dump is saved in \org@dump and a new definition is supplied.

64.18 \let\orig@dump=\dump
64.19 \def\dump{%

To make sure that L^{A}TEX 2.09 executes the \@begindocumenthook we would want to alter \begin{document}, but as this done too often already, we add the new code at the front of \@preamblecmds. But we can only do that after it has been defined, so we add this piece of code to \dump.

64.20  \ifx\@ztryfc\@undefined
64.21  \else
64.22  \toks0=\expandafter{\@preamblecmds}
64.23  \edef\@preamblecmds{\noexpand\@begindocumenthook\the\toks0}
64.24  \def\@begindocumenthook{}

64.25 \fi

This new definition starts by adding an instruction to write a message on the terminal and in the transcript file to inform the user of the preloaded hyphenation patterns.

64.26  \everyjob\expandafter{\the\everyjob%
64.27  \immediate\write16{\the\toks8 loaded.}}%

Then everything is restored to the old situation and the format is dumped.

64.28  \let\dump\orig@dump\let\orig@dump\@undefined\dump}
64.29 \expandafter\endinput

64.30 \fi

The rest of this file is not processed by iniTEX but during the normal document run. A number of L^{A}TEX macro’s that are needed later on.

64.31 \long\def\@firstofone#1{#1}
64.32 \long\def\@firstoftwo#1#2{#1}
64.33 \long\def\@secondoftwo#1#2{#2}
64.34 \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
64.35 \def\@star@or@long#1{%
64.36 \@ifstar
64.37 {\let\l@ngrel@x\relax#1}%
64.38 {\let\l@ngrel@x\long#1}}
64.39 \let\l@ngrel@x\relax
64.40 \def\@car#1#2\@nil{#1}
64.41 \def\@cdr#1#2\@nil{#2}
64.42 \let\@typeset@protect\relax

64.43 \long\def\@gobble#1{}
64.44 \edef\@backslashchar{\expandafter\@gobble\string\\}
64.45 \def\strip@prefix#1>{}
64.46 \def\g@addto@macro#1#2{{%
64.47  \toks@\expandafter{#1#2}%
64.48  \xdef#1{\the\toks@}}}
64.49 \def\@namedef#1{\expandafter\def\csname #1\endcsname}
64.50 \def\@ifundefined#1{%
64.51 \expandafter\ifx\csname#1\endcsname\relax
64.52  \expandafter\@firstoftwo
64.53 \else
64.54  \expandafter\@secondoftwo

64.55 \fi}

L^{A}TEX 2ε has the command \@onlypreamble which adds commands to a list of commands that are no longer needed after \begin{document}.

64.56 \ifx\@preamblecmds\@undefined
64.57 \def\@preamblecmds{}

64.58 \fi

64.59 \def\@onlypreamble#1{%
64.60 \expandafter\gdef\expandafter\@preamblecmds\expandafter{%
64.61  \@preamblecmds\do#1}}
64.62 \@onlypreamble\@onlypreamble

Mimick L^{A}TEX’s \AtBeginDocument; for this to work the user needs to add

  \begindocument to his file.
64.63 \def\begindocument{%
64.64 \@begindocumenthook
64.65 \global\let\@begindocumenthook\@undefined
64.66 \def\do##1{\global\let ##1\@undefined}%
64.67 \@preamblecmds
64.68 \global\let\do\noexpand

64.69 }

64.70 \ifx\@begindocumenthook\@undefined
64.71 \def\@begindocumenthook{}

64.72 \fi

64.73 \@onlypreamble\@begindocumenthook
64.74 \def\AtBeginDocument{\g@addto@macro\@begindocumenthook}

We also have to mimick L^{A}TEX’s \AtEndOfPackage. Our replacement macro is much simpler; it stores its argument in \@endofldf.

64.75 \def\AtEndOfPackage#1{\g@addto@macro\@endofldf{#1}}
64.76 \@onlypreamble\AtEndOfPackage
64.77 \def\@endofldf{}
64.78 \@onlypreamble\@endofldf

L^{A}TEX needs to be able to switch off writing to its auxiliary files; plain doesn’t have them by default.

64.79 \ifx\if@filesw\@undefined
64.80 \expandafter\let\csname if@filesw\expandafter\endcsname
64.81  \csname iffalse\endcsname

64.82 \fi

Mimick L^{A}TEX’s commands to define control sequences.

64.83 \def\newcommand{\@star@or@long\new@command}

 64.84 \def\new@command#1{%
 64.85 \@testopt{\@newcommand#1}0}
 64.86 \def\@newcommand#1[#2]{%
 64.87 \@ifnextchar [{\@xargdef#1[#2]}%
 64.88  {\@argdef#1[#2]}}
 64.89 \long\def\@argdef#1[#2]#3{%
 64.90 \@yargdef#1\@ne{#2}{#3}}
 64.91 \long\def\@xargdef#1[#2][#3]#4{%
 64.92 \expandafter\def\expandafter#1\expandafter{%
 64.93  \expandafter\@protected@testopt\expandafter #1%
 64.94  \csname\string#1\expandafter\endcsname{#3}}%
 64.95 \expandafter\@yargdef \csname\string#1\endcsname
 64.96 \tw@{#2}{#4}}
 64.97 \long\def\@yargdef#1#2#3{%
 64.98 \@tempcnta#3\relax
 64.99 \advance \@tempcnta \@ne
64.100 \let\@hash@\relax
64.101 \edef\reserved@a{\ifx#2\tw@ [\@hash@1]\fi}%
64.102 \@tempcntb #2%
64.103 \@whilenum\@tempcntb <\@tempcnta

64.104 \do{%

64.105  \edef\reserved@a{\reserved@a\@hash@\the\@tempcntb}%
64.106  \advance\@tempcntb \@ne}%
64.107 \let\@hash@##%
64.108 \l@ngrel@x\expandafter\def\expandafter#1\reserved@a}
64.109 \let\providecommand\newcommand
64.110 \def\DeclareRobustCommand{\@star@or@long\declare@robustcommand}
64.111 \def\declare@robustcommand#1{%
64.112 \edef\reserved@a{\string#1}%
64.113 \def\reserved@b{#1}%
64.114 \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}%
64.115 \edef#1{%
64.116  \ifx\reserved@a\reserved@b
64.117  \noexpand\x@protect
64.118  \noexpand#1%

64.119 \fi

64.120  \noexpand\protect
64.121  \expandafter\noexpand\csname
64.122  \expandafter\@gobble\string#1 \endcsname

64.123 }%

64.124 \expandafter\new@command\csname
64.125  \expandafter\@gobble\string#1 \endcsname

64.126 }

64.127 \def\x@protect#1{%
64.128 \ifx\protect\@typeset@protect\else
64.129  \@x@protect#1%

64.130 \fi 64.131 }

64.132 \def\@x@protect#1\fi#2#3{%
64.133 \fi\protect#1%

64.134 }

The following little macro \in@ is taken from latex.ltx; it checks whether its first argument is part of its second argument. It uses the boolean \in@; allocating a new boolean inside conditionally executed code is not possible, hence the construct with the temporary definition of \bbl@tempa.

64.135 \def\bbl@tmpa{\csname newif\endcsname\ifin@}
64.136 \ifx\in@\@undefined
64.137 \def\in@#1#2{%
64.138  \def\in@@##1#1##2##3\in@@{%
64.139  \ifx\in@##2\in@false\else\in@true\fi}%
64.140  \in@@#2#1\in@\in@@}

64.141 \else

64.142 \let\bbl@tmpa\@empty

64.143 \fi

64.144 \bbl@tmpa

L^{A}TEX has a macro to check whether a certain package was loaded with specific options. The command has two extra arguments which are code to be executed in either the true or false case. This is used to detect whether the document needs one of the accents to be activated (activegrave and activeacute). For plain TEX we assume that the user wants them to be active by default. Therefore the only thing we do is execute the third argument (the code for the true case).

64.145 \def\@ifpackagewith#1#2#3#4{%

64.146 #3}

The L^{A}TEX macro \@ifl@aded checks whether a file was loaded. This functionality is not needed for plain TEX but we need the macro to be defined as a no-op.

64.147 \def\@ifl@aded#1#2#3#4{}

For the following code we need to make sure that the commands \newcommand and \providecommand exist with some sensible definition. They are not fully equivalent to their L^{A}TEX 2ε versions; just enough to make things work in plain TEXenvironments.

64.148 \ifx\@tempcnta\@undefined
64.149 \csname newcount\endcsname\@tempcnta\relax

64.150 \fi

64.151 \ifx\@tempcntb\@undefined
64.152 \csname newcount\endcsname\@tempcntb\relax

64.153 \fi

To prevent wasting two counters in L^{A}TEX 2.09 (because counters with the same name are allocated later by it) we reset the counter that holds the next free counter

(\count10).
64.154 \ifx\bye\@undefined
64.155 \advance\count10 by -2\relax

64.156 \fi

64.157 \ifx\@ifnextchar\@undefined
64.158 \def\@ifnextchar#1#2#3{%
64.159  \let\reserved@d=#1%
64.160  \def\reserved@a{#2}\def\reserved@b{#3}%
64.161  \futurelet\@let@token\@ifnch}
64.162 \def\@ifnch{%
64.163  \ifx\@let@token\@sptoken
64.164  \let\reserved@c\@xifnch

64.165 \else

64.166  \ifx\@let@token\reserved@d
64.167  \let\reserved@c\reserved@a

64.168 \else

64.169  \let\reserved@c\reserved@b

64.170 \fi 64.171 \fi

64.172  \reserved@c}
64.173 \def\:{\let\@sptoken= } \:  % this makes \@sptoken a space token
64.174 \def\:{\@xifnch} \expandafter\def\: {\futurelet\@let@token\@ifnch}

64.175 \fi

64.176 \def\@testopt#1#2{%
64.177 \@ifnextchar[{#1}{#1[#2]}}
64.178 \def\@protected@testopt#1{%%
64.179 \ifx\protect\@typeset@protect
64.180  \expandafter\@testopt

64.181 \else

64.182  \@x@protect#1%

64.183 \fi}

64.184 \long\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
64.185  #2\relax}\fi}
64.186 \long\def\@iwhilenum#1{\ifnum #1\expandafter\@iwhilenum
64.187  \else\expandafter\@gobble\fi{#1}}

Code from ltoutenc.dtx, adapted for use in the plain TEX environment.

64.188 \def\DeclareTextCommand{%
64.189 \@dec@text@cmd\providecommand

64.190 }

64.191 \def\ProvideTextCommand{%
64.192 \@dec@text@cmd\providecommand

64.193 }

64.194 \def\DeclareTextSymbol#1#2#3{%
64.195 \@dec@text@cmd\chardef#1{#2}#3\relax

64.196 }

64.197 \def\@dec@text@cmd#1#2#3{%
64.198 \expandafter\def\expandafter#2%
64.199  \expandafter{%
64.200  \csname#3-cmd\expandafter\endcsname
64.201  \expandafter#2%
64.202  \csname#3\string#2\endcsname

64.203 }%

64.204 %   \let\@ifdefinable\@rc@ifdefinable
64.205 \expandafter#1\csname#3\string#2\endcsname

64.206 }

64.207 \def\@current@cmd#1{%
64.208 \ifx\protect\@typeset@protect\else
64.209  \noexpand#1\expandafter\@gobble

64.210 \fi 64.211 }

64.212 \def\@changed@cmd#1#2{%
64.213 \ifx\protect\@typeset@protect
64.214  \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax
64.215  \expandafter\ifx\csname ?\string#1\endcsname\relax
64.216  \expandafter\def\csname ?\string#1\endcsname{%
64.217  \@changed@x@err{#1}%

64.218 }% 64.219 \fi

64.220  \global\expandafter\let

64.221  \csname\cf@encoding \string#1\expandafter\endcsname
64.222  \csname ?\string#1\endcsname

64.223 \fi

64.224  \csname\cf@encoding\string#1%
64.225  \expandafter\endcsname

64.226 \else

64.227  \noexpand#1%

64.228 \fi 64.229 }

64.230 \def\@changed@x@err#1{%
64.231  \errhelp{Your command will be ignored, type <return> to proceed}%
64.232  \errmessage{Command \protect#1 undefined in encoding \cf@encoding}}
64.233 \def\DeclareTextCommandDefault#1{%
64.234 \DeclareTextCommand#1?%

64.235 }

64.236 \def\ProvideTextCommandDefault#1{%
64.237 \ProvideTextCommand#1?%

64.238 }

64.239 \expandafter\let\csname OT1-cmd\endcsname\@current@cmd
64.240 \expandafter\let\csname?-cmd\endcsname\@changed@cmd
64.241 \def\DeclareTextAccent#1#2#3{%
64.242 \DeclareTextCommand#1{#2}[1]{\accent#3 ##1}

64.243 }

64.244 \def\DeclareTextCompositeCommand#1#2#3#4{%
64.245 \expandafter\let\expandafter\reserved@a\csname#2\string#1\endcsname
64.246 \edef\reserved@b{\string##1}%
64.247 \edef\reserved@c{%
64.248  \expandafter\@strip@args\meaning\reserved@a:-\@strip@args}%
64.249 \ifx\reserved@b\reserved@c
64.250  \expandafter\expandafter\expandafter\ifx
64.251  \expandafter\@car\reserved@a\relax\relax\@nil
64.252  \@text@composite

64.253 \else

64.254  \edef\reserved@b##1{%
64.255  \def\expandafter\noexpand
64.256  \csname#2\string#1\endcsname####1{%
64.257  \noexpand\@text@composite
64.258  \expandafter\noexpand\csname#2\string#1\endcsname
64.259  ####1\noexpand\@empty\noexpand\@text@composite
64.260  {##1}%

64.261 }% 64.262 }%

64.263  \expandafter\reserved@b\expandafter{\reserved@a{##1}}%

64.264 \fi

64.265  \expandafter\def\csname\expandafter\string\csname
64.266  #2\endcsname\string#1-\string#3\endcsname{#4}

64.267 \else

64.268  \errhelp{Your command will be ignored, type <return> to proceed}%
64.269  \errmessage{\string\DeclareTextCompositeCommand\space used on
64.270  inappropriate command \protect#1}

64.271 \fi 64.272 }

64.273 \def\@text@composite#1#2#3\@text@composite{%
64.274 \expandafter\@text@composite@x

64.275  \csname\string#1-\string#2\endcsname

64.276 }

64.277 \def\@text@composite@x#1#2{%
64.278 \ifx#1\relax

64.279 #2% 64.280 \else 64.281 #1% 64.282 \fi 64.283 } 64.284 %

64.285 \def\@strip@args#1:#2-#3\@strip@args{#2}
64.286 \def\DeclareTextComposite#1#2#3#4{%
64.287 \def\reserved@a{\DeclareTextCompositeCommand#1{#2}{#3}}%
64.288 \bgroup
64.289  \lccode`\@=#4%
64.290  \lowercase{%
64.291 \egroup
64.292  \reserved@a @%

64.293 }% 64.294 } 64.295 %

64.296 \def\UseTextSymbol#1#2{%
64.297 %   \let\@curr@enc\cf@encoding
64.298 %   \@use@text@encoding{#1}%

64.299 #2%

64.300 %   \@use@text@encoding\@curr@enc

64.301 }

64.302 \def\UseTextAccent#1#2#3{%
64.303 %   \let\@curr@enc\cf@encoding
64.304 %   \@use@text@encoding{#1}%
64.305 %   #2{\@use@text@encoding\@curr@enc\selectfont#3}%
64.306 %   \@use@text@encoding\@curr@enc

64.307 }

64.308 \def\@use@text@encoding#1{%
64.309 %   \edef\f@encoding{#1}%
64.310 %   \xdef\font@name{%
64.311 %      \csname\curr@fontshape/\f@size\endcsname

64.312 % }%

64.313 %   \pickup@font
64.314 %   \font@name
64.315 %   \@@enc@update

64.316 }

64.317 \def\DeclareTextSymbolDefault#1#2{%
64.318 \DeclareTextCommandDefault#1{\UseTextSymbol{#2}#1}%

64.319 }

64.320 \def\DeclareTextAccentDefault#1#2{%
64.321 \DeclareTextCommandDefault#1{\UseTextAccent{#2}#1}%

64.322 }

64.323 \def\cf@encoding{OT1}

Currently we only use the L^{A}TEX 2ε method for accents for those that are known to be made active in some language definition file.

64.324 \DeclareTextAccent{\"}{OT1}{127}
64.325 \DeclareTextAccent{\'}{OT1}{19}

64.326 \DeclareTextAccent{\^}{OT1}{94}
64.327 \DeclareTextAccent{\`}{OT1}{18}
64.328 \DeclareTextAccent{\~}{OT1}{126}

The following control sequences are used in babel.def but are not defined for plain TEX.

64.329 \DeclareTextSymbol{\textquotedblleft}{OT1}{92}
64.330 \DeclareTextSymbol{\textquotedblright}{OT1}{`\"}
64.331 \DeclareTextSymbol{\textquoteleft}{OT1}{`\`}
64.332 \DeclareTextSymbol{\textquoteright}{OT1}{`\'}
64.333 \DeclareTextSymbol{\i}{OT1}{16}
64.334 \DeclareTextSymbol{\ss}{OT1}{25}

For a couple of languages we need the L^{A}TEX-control sequence \scriptsize to be available. Because plain TEX doesn’t have such a sofisticated font mechanism as L^{A}TEX has, we just \let it to \sevenrm.

64.335 \ifx\scriptsize\@undefined
64.336 \let\scriptsize\sevenrm

64.337 \fi 64.338 ⟨/code⟩

Index

Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

\- . . . . . . . . \underline{18.123}, \underline{31.110}, \underline{33.144},

\underline{34.88}, \underline{40.92}, \underline{42.63}

\@@az . . . . . . . . . \underline{43.488}

\@@az@string . . . \underline{43.452}

\@@azc . . . . . . . . \underline{43.435}

\@@selectlanguage \underline{57.173}
\@@vpageref . . . . \underline{12.1223}
\@Alph@bul . . . . \underline{52.254}

\@Roman . . . . . . . \underline{57.227} \@acute … \underline{33.77}, \underline{34.58}

\@alph@bul . . . . \underline{52.273}

\@arabic . . . . . . \underline{57.227} \@az . . . . . . . . . . \underline{43.373} \@azc . . . . . . . . . \underline{43.434} \@azp . . . . . . . . . \underline{43.418} \@azr . . . . . . . . . \underline{43.405}

\@begintheorem . \underline{43.143}

\@bibitem . . . . . \underline{12.1184}

\@biblabel . . . . \underline{57.789}
\@brackets . . . . \underline{57.216}

\@caption . \underline{43.77}, \underline{57.476}

\@chapter . . \underline{43.208},

\underline{43.282}, \underline{57.734} \@cite . . . . . . . . \underline{57.789} \@citex . . . . . . . \underline{12.1156}

\@dottedtocline   \underline{57.355}

\@fromrl . . . . . . \underline{57.161} \@grave . . . . . . . . \underline{33.77} \@hebrew . . . . . . . \underline{57.70} \@latin . . . . . . . \underline{57.218}

\@lbibitem . . . . \underline{57.789}

\@listI . . . . . . . \underline{57.286} \@listi . . . . . . . \underline{57.286} \@listii . . . . . . \underline{57.290} \@listiii . . . . . \underline{57.293} \@listiv . . . . . . \underline{57.296}

\@listoffigures   \underline{57.307}
\@listoftables . \underline{57.307}

\@listv . . . . . . . \underline{57.299} \@listvi . . . . . . \underline{57.302}

\@makecaption . . . . .

…. \underline{43.65}, \underline{57.842}

\@makechapterhead .

… \underline{43.231}, \underline{43.301}

\@makeschapterhead \underline{61.95}

\@newl@bel …. \underline{12.1119}

                          \@nolanerr . . . . \underline{12.228}
                          \@nopatterns . . . \underline{12.228}

\@number . . . . . . \underline{57.218}

                          \@opargbegintheorem

… \underline{43.143}, \underline{57.721}

                          \@outputdblcol . \underline{57.520}

\@part … \underline{43.188}, \underline{57.391} \@roman . . . . . . . \underline{57.227}

                          \@schapter . . . . \underline{57.734}
                          \@seccntformat . . \underline{43.92}

\@sect …. \underline{43.95}, \underline{57.434} \@ssect . . . . . . . \underline{43.129}

                          \@tableofcontents \underline{57.307}

\@testdef . . . . . \underline{12.1132} \@tilde … \underline{34.58}, \underline{35.52} \@torl . . . . . . . . \underline{57.152} \@trema . . . . . . . \underline{18.102} \@umlaut . . . . . . . . .

\underline{33.77}, \underline{34.58}, \underline{35.52}

                          \@verbatim . . . . \underline{57.839}

\@xnthm . . . . . . . \underline{57.721}

A

                          \AbsoluteFromGregorian

. . . . . . . . \underline{57.1185}

                          \AbsoluteFromHebrew

. . . . . . . . \underline{57.1349}

abstract (environ-

ment) …. \underline{61.351} \Acite . . . . . \underline{43.427}, 225 \acite . . . . . . . . \underline{43.426}

                          acknowledgment (envir-

onment) . . \underline{61.315}

                          \active@prefix . \underline{12.536}
                          \adddialect . . . 10, \underline{12.53}
                          \addlanguage . . 10, \underline{12.41}

\addto . . . . . . 12, \underline{12.752} \advisori . . . . . \underline{61.149}

                          \advisorii . . . . \underline{61.150}
                          \afrikaanshyphenmins

. . . . . . . . . \underline{18.101}

                          \aliasshorthand 5, \underline{12.582}
                          \allowhyphens  \underline{12.764}, 13
                          \anw@false . . . . . \underline{26.84}
                          \anw@print . . . . . \underline{26.84}

\anw@true . . . . . . \underline{26.84} \Aob . . . . . . . . . . . \underline{47.51} \aob . . . . . . . . . . . \underline{47.51} \ap . . . . . . . . . . . \underline{29.82} \Apageref . . \underline{43.414}, 225 \apageref . . . . . \underline{43.413} \appendix \underline{57.107}, \underline{57.773} \Aref . . . . . . \underline{43.399}, 224 \aref . . . . . . . . . \underline{43.398} \Asbuk … \underline{51.340}, \underline{53.319} \asbuk … \underline{51.347}, \underline{53.326} \author . . \underline{57.707}, \underline{61.146}

                                                   \AutoSpaceBeforeFDP

. . . . . . \underline{28.222}, \underline{51.268}, \underline{53.247}

\Az . . . . . . . \underline{43.371}, 224 \az . . . . . . . . . . \underline{43.370} \az@ . . . . . . . . . . \underline{43.372} \Azc . . . . . . . \underline{43.429}, 225 \azc . . . . . . . . . . \underline{43.428} \azc@ . . . . . . . . . \underline{43.430} \azc@@ . . . . . . . . \underline{43.431} \Azp . . . . . . . \underline{43.416}, 225 \azp . . . . . . . . . . \underline{43.415} \azp@ . . . . . . . . . \underline{43.417} \Azr . . . . . . . \underline{43.401}, 224 \azr . . . . . . . . . . \underline{43.400} \azr@ . . . . . . . . . \underline{43.402} \azr@@ . . . . . . . . \underline{43.403} \azr@@@ . . . . . . . \underline{43.404}

B

                                                   \babel@beginsave  \underline{12.727}
                                                   \babel@save . . 12, \underline{12.730}
                                                   \babel@savecnt . \underline{12.727}
                                                   \babel@savevariable

. . . . . . 12, \underline{12.739}

                                                   \backmatter . . . . \underline{61.259}
                                                   \bahasahyphenmins  \underline{62.41}
                                                   \basquehyphenmins  \underline{35.49}
                                                   \bbl@activate 12, \underline{12.543}
                                                   \bbl@add@list . . \underline{12.695}
                                                   \bbl@add@special . .

. . . . . . 12, \underline{12.361}

                                                   \bbl@afterelse . \underline{12.382}
                                                   \bbl@afterfi . . . \underline{12.382}
                                                   \bbl@bibcite . . . \underline{12.1175}
                                                   \bbl@cite@choice \underline{12.1177}
                                                   \bbl@clear@ttribs \underline{12.716}
                                                   \bbl@deactivate . . .

. . . . . . 12, \underline{12.549}

\bbl@declare@ttribute

. . . . . . 11, \underline{12.677} \bbl@disc . . . . . \underline{12.776}

\bbl@firstcs . . . \underline{12.555}
\bbl@frenchguillemets

. . . . . . . . . \underline{28.232}

\bbl@frenchindent .

…. \underline{28.359}, \underline{48.58}

\bbl@frenchitemize .

. . . . . . . . . \underline{28.304}

\bbl@frenchlistspacing

. . . . . . . . . \underline{28.279}

\bbl@frenchspacing .

. . . . . . \underline{12.744}, 13

\bbl@get@enc . . . \underline{12.315}
\bbl@hyph@enc . . \underline{12.315}
\bbl@ifattributeset

. . . . . . . . . \underline{12.681}

\bbl@ifknown@ttrib .

. . . . . . . . . \underline{12.706}

\bbl@main@language .

. . . . . . . . . \underline{12.213}

\bbl@nonfrenchguillemets

. . . . . . . . . \underline{28.232}

\bbl@nonfrenchindent

…. \underline{28.359}, \underline{48.58}

\bbl@nonfrenchitemize

. . . . . . . . . \underline{28.304}

\bbl@nonfrenchlistspacing

. . . . . . . . . \underline{28.279}

\bbl@nonfrenchspacing

. . . . . . \underline{12.744}, 13

\bbl@pop@language  \underline{12.76}
\bbl@pr@m@s . . . . \underline{12.618}
\bbl@prim@s . . . . \underline{12.618}
\bbl@redefine . . \underline{12.1094}
\bbl@redefine@long .

. . . . . . . . \underline{12.1100}

\bbl@redefinerobust

. . . . . . . . \underline{12.1105}

\bbl@remove@special

. . . . . . 12, \underline{12.371}

\bbl@scndcs . . . . \underline{12.555}
\bbl@set@language  \underline{12.82}
\bbl@switch@sh . \underline{12.589}
\bbl@switch@sh@off .

. . . . . . . . . \underline{12.600}

\bbl@switch@sh@on \underline{12.601}
\bbl@test@token   \underline{12.389}

\bcaption . . . . . \underline{57.858}

\bcaptionf . . . . \underline{61.123}
\bcaptionff . . . . \underline{61.128}
\bcaptiont . . . . \underline{61.133}
\bcaptiontt . . . . \underline{61.138}

\bchapter . . . . . \underline{57.850}

\bchapternn . . . . . . .

… \underline{57.862}, \underline{61.104} \bibcite . . . . . . \underline{12.1172} \bpart . . . . . . . . \underline{57.848}

\breton@sh@:@ . . . \underline{22.59}
\breton@sh@;@ . . . \underline{22.48}
\breton@sh@?@ . . . \underline{22.75}
\breton@sh@@ . . . . \underline{22.59}

\bsc . . . . . . . . . . \underline{28.540} \bsection . . . . . \underline{57.852}

\bsectionnn . . . . \underline{57.864}
\bsubsection . . . \underline{57.854}
\bsubsubsection   \underline{57.856}

C

\captionsafrikaans \underline{18.64}
\captionsaustrian  \underline{20.12}
\captionsbahasa . . \underline{62.6}
\captionsbasque . . \underline{35.7}
\captionsbrazil . \underline{31.66}
\captionsbreton . . \underline{22.6}
\captionsbulgarian .

. . . . . . . . . \underline{52.117}

\captionscatalan . \underline{33.8}
\captionscroatian   \underline{45.6}
\captionsczech . . . \underline{46.6}
\captionsdanish . . \underline{37.6}
\captionsdutch . . \underline{18.22}
\captionsenglish . .

. . . . . \underline{19.47}, \underline{61.61}

\captionsesperanto  \underline{17.6}
\captionsestonian   \underline{44.7}
\captionsfinnish . \underline{42.6}
\captionsfrench   \underline{28.138}
\captionsgalician   \underline{34.6}
\captionsgerman . \underline{20.12}
\captionsgreek . . \underline{26.32}
\captionshebrew . . .

. . . . . \underline{57.17}, \underline{61.61}

\captionsicelandic \underline{38.25}
\captionsirish . . . \underline{24.7}
\captionsitalian . \underline{29.6}
\captionslang . . . . . 11
\captionslatin . . \underline{30.12}
\captionslsorbian   \underline{54.6}
\captionsmagyar . \underline{43.10}
\captionsnaustrian \underline{21.12}
\captionsngerman   \underline{21.12}
\captionsnorsk . . . \underline{39.9}
\captionsnynorsk   \underline{39.35}
\captionspolish . . \underline{47.6}
\captionspolutonikogreek

. . . . . . . . . . \underline{26.55}

                          \captionsportuges  \underline{31.34}
                          \captionsromanian   \underline{36.6}
                          \captionsrussian  \underline{51.121}
                          \captionssamin . . . \underline{41.7}
                          \captionsscottish   \underline{25.6}
                          \captionsserbian . \underline{48.6}
                          \captionsslovak . . \underline{49.6}
                          \captionsslovene . \underline{50.6}
                          \captionsswedish . \underline{40.6}
                          \captionsturkish . \underline{56.6}
                          \captionsukrainian .

. . . . . . . . . \underline{53.121}

                          \captionsusorbian   \underline{55.6}
                          \captionswelsh . . . \underline{23.7}
                          \catalanhyphenmins  \underline{33.7}

\cdash . . . . . \underline{51.311},

\underline{52.216}, \underline{53.290}

                          \CheckIfDivisible .

. . . . . . . . \underline{57.1090}

                          \CheckLeapHebrewYear

. . . . . . . . \underline{57.1196}

\ck . . . . . . \underline{20.113}, \underline{55.95} \cyrdash … \underline{51.326},

\underline{52.231}, \underline{53.305}

                          \CyrillicGuillemets

. . . . . . . . . \underline{28.232}

                          \cyrillictext \underline{51.111},

\underline{52.111}, \underline{53.111}

D \date . . . . . . . . . . \underline{61.58}

                          \dateafrikaans . . \underline{18.86}
                          \dateamerican . . . \underline{19.89}
                          \dateanustrian . . \underline{21.40}
                          \dateaustrian . . . \underline{20.40}
                          \datebahasa . . . . . \underline{62.34}
                          \datebasque . . . . . \underline{35.30}
                          \datebrazil . . . . . \underline{31.89}
                          \datebreton . . . . . \underline{22.29}
                          \datebulgarian . \underline{52.161}
                          \datecatalan . . . . \underline{33.31}
                          \datecroatian . . . \underline{45.29}
                          \dateczech . . . . . \underline{46.29}
                          \datedanish . . . . . \underline{37.29}
                          \datedutch . . . . . \underline{18.49}
                          \dateenglish . . . . \underline{19.70}
                          \dateesperanto . . \underline{17.30}
                          \dateestonian . . . \underline{44.34}
                          \datefinnish . . . . \underline{42.29}
                          \datefrench . . . . \underline{28.582}
                          \dategalician . . . \underline{34.29}
                          \dategerman . . . . . \underline{20.35}
                          \dategreek . . . . . \underline{26.64}
                          \datehebrew . . . . . \underline{57.55}

\dateicelandic . . \underline{38.48}
\dateirish . . . . . \underline{24.30}
\dateitalian . . . . \underline{29.29}

\datelang . . . . . . . . 11

\datelatin . . . . . \underline{30.35}
\datemagyar . . . . . \underline{43.33}
\datengerman . . . . \underline{21.35}
\datenorsk . . . . . \underline{39.60}
\datepolish . . . . . \underline{47.29}
\dateportuges . . . \underline{31.57}
\dateromanian . . . \underline{36.29}
\daterussian . . . \underline{51.185}
\datesamin . . . . . \underline{41.30}
\datescottish . . . \underline{25.29}

\datesdmy . . . . . . \underline{40.39}

\dateserbian . . . . \underline{48.29}
\dateslovak . . . . . \underline{49.29}
\dateslovene . . . . \underline{50.29}
\dateswedish . . . . \underline{40.29}

\datesymd . . . . . . \underline{40.36}

\dateturkish . . . . \underline{56.30}
\dateukrainian . \underline{53.162}
\datewelsh . . . . . \underline{23.31}
\DaysInHebrewYear .

. . . . . . . . \underline{57.1292}

\DecimalMathComma \underline{28.370}
\decimalsep . . . . . . .

… \underline{28.377}, \underline{38.105}

\declare@shorthand .

. . . . . . 12, \underline{12.557}

dedication (environ-

ment) …. \underline{61.345}

\defineshorthand . .

. . . . . . . 5, \underline{12.580} \degres . . . . . . . \underline{28.573} \dept . . . . . . . . . \underline{61.147}

description (environ-

ment) …. \underline{57.250} \dieresia . . . . . . \underline{35.50} \dieresis . \underline{33.74}, \underline{34.55}

\DigitInHebrew . \underline{57.1018}

\DJ . . . . . . . . . . \underline{12.834} \dj . . . . . . . . . . \underline{12.834}

\doc@style . . . . \underline{12.930}

\dom . . . . . . . . . . \underline{61.148} \donor . . . . . . . . \underline{61.153} \donori . . . . . . . \underline{61.151} \donorii . . . . . . \underline{61.152} \dq … \underline{20.59}, \underline{21.59},

\underline{38.53}, \underline{39.75}, \underline{40.51}, \underline{47.112}, \underline{51.287}, \underline{52.193}, \underline{53.266}, \underline{55.51}

\dutchhyphenmins  \underline{18.101}

E

\EEob . . . . . . . . . . \underline{38.89} \eeob . . . . . . . . . . \underline{38.89} \embox . . . . . . . . \underline{57.214} \engmonth . . . . . . \underline{61.49} environments:

abstract … \underline{61.351}

acknowledgment \underline{61.315}
dedication . . \underline{61.345}
description . \underline{57.250}
hyphenrules 4, \underline{12.156}
otherlanguage* .

. . . . . . . 4, \underline{12.125}

otherlanguage . .

. . . . . . . 4, \underline{12.116}

quotation . . . \underline{57.268}

quote . . . . . . \underline{57.278}

thebibliography

. . . . . . . . . \underline{57.797}

verse . . . . . . \underline{57.257} \Eob . . . . . . \underline{38.89}, \underline{47.51} \eob . . . . . . \underline{38.89}, \underline{47.51} \Esper . . . . . . . . . \underline{17.53} \esper . . . . . . . . . \underline{17.53}

\estonianhyphenmins

. . . . . . . . . . \underline{44.51}

\evensidemargin   \underline{61.376}
\extrasafrikaans   \underline{18.93}
\extrasaustrian . \underline{20.42}
\extrasbahasa . . . \underline{62.39}
\extrasbasque . . . \underline{35.36}
\extrasbreton . . . \underline{22.35}
\extrasbulgarian  \underline{52.181}
\extrascatalan . . \underline{33.37}
\extrascroatian . \underline{45.34}
\extrasczech . . . . \underline{46.35}
\extrasdanish . . . \underline{37.34}
\extrasdutch . . . . \underline{18.93}
\extrasenglish . . \underline{19.96}
\extrasesperanto   \underline{17.35}
\extrasestonian . \underline{44.44}
\extrasfinnish . . \underline{42.35}
\extrasfrench . . . \underline{28.84}
\extrasgalician . \underline{34.34}
\extrasgerman . . . \underline{20.42}
\extrasgreek . . . . \underline{26.80}
\extrashebrew . . . . .

. . . . . \underline{57.56}, \underline{57.99}

\extrasicelandic   \underline{38.18}
\extrasirish . . . . \underline{24.38}
\extrasitalian . . \underline{29.35}
\extraslang . . . . . . . 11
\extraslatin . . . . \underline{30.45}
\extraslsorbian . \underline{54.50}

\extrasmagyar . . . \underline{43.55}
\extrasnaustrian   \underline{21.42}
\extrasngerman . . \underline{21.42}
\extrasnorsk . . . . \underline{39.66}
\extrasnynorsk . . \underline{39.66}
\extraspolish . . . \underline{47.35}
\extrasportuges . \underline{31.97}
\extrasromanian . \underline{36.35}
\extrasrussian . \underline{51.200}
\extrassamin . . . . \underline{41.46}
\extrasscottish . \underline{25.37}
\extrasserbian . . \underline{48.34}
\extrasslovak . . . \underline{49.35}
\extrasslovene . . \underline{50.34}
\extrasswedish . . \underline{40.43}
\extrasturkish . . \underline{56.36}
\extrasukrainian  \underline{53.177}
\extrasusorbian . \underline{55.42}
\extraswelsh . . . . \underline{23.38}

F

\FDP@thinspace . . . .

… \underline{51.268}, \underline{53.247} \FDPoff . . \underline{51.272}, \underline{53.251} \FDPon … \underline{51.272}, \underline{53.251} \fg . . . . . . . . . . \underline{28.232}

\finishhyphenmins  \underline{42.66}

\flq . . . . . . . . . . \underline{12.878} \flqq . . . . . . . . . \underline{12.882}

\fnum@figure . . . . \underline{43.59}
\fnum@table . . . . . \underline{43.59}
\footnoterule . . \underline{57.550}
\foreign@language \underline{12.140}
\foreignlanguage . .

. . . . . . . 4, \underline{12.131}

\FormatDate . . . . \underline{57.884}
\FormatForEnglish .

… \underline{57.1081}, \underline{61.15}

\FormatForHebrew . .

… \underline{57.1057}, \underline{61.15} \fprimo) . . . . . . \underline{28.526}

\french@sh@:@ . . \underline{28.213}
\french@sh@;@ . . \underline{28.186}
\french@sh@?@ . . \underline{28.195}
\french@sh@@ . . . \underline{28.195}
\FrenchGuillemetsFrom

. . . . . . . . . \underline{28.232}

\FrenchLayout . . \underline{28.468}
\fromhebrew . . . . . \underline{57.68}
\frontmatter . . . \underline{61.253}

\frq . . . . . . . . . . \underline{12.878} \frqq . . . . . . . . . \underline{12.882}

\Frtextellipsis   \underline{28.450}

G

\gentilde . . . . . . \underline{44.52} \getlength …. \underline{57.1100} \gim . . . . . . . . . . . \underline{57.79} \glq . . . . . . . . . . \underline{12.860} \glqq . . . . . . . . . \underline{12.869}

\gr@c@greek . . . . . \underline{26.71}
\gr@ill@value . . . \underline{26.82}

\gr@month . . . . . . \underline{26.64} \gr@num@i . . . . . \underline{26.139}

\gr@num@ii . . . . \underline{26.139}
\gr@num@iii . . . . \underline{26.139}
\gr@num@iv . . . . \underline{26.148}

\gr@num@v . . . . . \underline{26.148}

\gr@num@vi . . . . \underline{26.148}

\grade . . . . . . . . \underline{61.144} \gradur . . . . . . . \underline{38.192}

\greek@Alph . . . . \underline{26.115}
\greek@alph . . . . \underline{26.115}
\greek@amp . . . . \underline{26.135}
\greek@Roman . . . \underline{26.125}
\greek@roman . . . \underline{26.125}
\greek@tilde . . . \underline{26.160}
\greekhyphenmins   \underline{26.30}
\Greeknumeral \underline{26.113}, 102
\greeknumeral  \underline{26.89}, 102
\greektext . \underline{26.24}, 101
\Gregoriandate . . \underline{61.49}
\GregorianDaysInPriorMonths

. . . . . . . . \underline{57.1141}

\GregorianDaysInPriorYears

. . . . . . . . \underline{57.1165}

\grq . . . . . . . . . . \underline{12.860} \grqq . . . . . . . . . \underline{12.869} \Grtoday . . . . . . . \underline{26.76}

\guillemotleft . . . .

… \underline{12.788}, \underline{28.232}

\guillemotright . . .

… \underline{12.788}, \underline{28.232}

\guilsinglleft . \underline{12.806}
\guilsinglright   \underline{12.806}

H

\headeven . . . . . \underline{57.553} \headodd . . . . . . \underline{57.553} \headsep . . . . . . \underline{61.374} \hebdate . . . . . . . \underline{57.51} \hebday . . . . . . . . \underline{57.54} \hebmonth . . . . . . \underline{57.44} \hebr . . . . . . . . . . \underline{57.72}

\Hebrewdate . . . . . . .

\underline{57.871}, \underline{61.15}, 340

\HebrewDayName . \underline{57.983}

\HebrewDaysInPriorMonths

. . . . . . . . \underline{57.1302}

\HebrewElapsedDays .

. . . . . . . . \underline{57.1235}

\HebrewElapsedMonths

. . . . . . . . \underline{57.1210}

\hebrewencoding . . \underline{57.7}
\HebrewFromGregorian

. . . . . . . . \underline{57.1359}

\hebrewhyphenmins  \underline{57.16}
\HebrewMonthName  \underline{57.959}
\HebrewMonthNameInEnglish

… \underline{57.1059}, \underline{61.15}

\Hebrewsetreg . . \underline{57.881}
\hebrewtext . . . . . \underline{57.64}
\Hebrewtoday  \underline{57.879}, 340
\HebrewYearChar   \underline{57.890}
\HebrewYearName   \underline{57.929}

\hhline . . . . . . . \underline{12.1231} \hmbox . . . . . . . . \underline{57.214} \hodiau . . . . . . . . \underline{17.63} \hodiaun . . . . . . . \underline{17.63}

\hun@alph@lehgth  \underline{43.448}
\hun@number@lehgth .

. . . . . . . . . \underline{43.442}

\hun@tempadef . . \underline{43.377}
\hunnewlabel . . . \underline{43.534}
hyphenrules (environ-

ment) . . 4, \underline{12.156}

I

\ieme . . . . . . . . . \underline{28.494} \if@rl . . . . . . . . \underline{57.151}

\if@safe@actives  \underline{12.541}

\if@Two@E . . \underline{28.8}, \underline{38.11}

\IfGregorianLeap \underline{57.1123}
\iflanguage . . . 5, \underline{12.56}

\ifLaTeX . . . . . . . . \underline{28.4} \ifLaTeXe . . . . . . . \underline{28.4}

\ifthenelse . . . . \underline{12.1206}
\ifundefined . . . \underline{57.1121}

\IJ . . . . . . . . . . \underline{12.824} \ij . . . . . . . . . . \underline{12.824}

\initiate@active@char

. . . . . . 12, \underline{12.382} \Insert . . . . . . . \underline{57.1108}

\irishhyphenmins . \underline{24.6}

\it@ccap . . . . . . . \underline{29.99} \it@cwm … \underline{29.48}, \underline{29.56} \it@ocap . . . . . . . \underline{29.99}

\italianhyphenmins \underline{29.34}

L

\L . . . . . . . . . . . \underline{57.199} \L.L . . . . . . . . . . \underline{33.187} \l.l . . . . . . . . . . \underline{33.187}

\l@chapter . . . . \underline{57.497}
\l@paragraph . . . \underline{57.514}

\l@part . . . . . . . \underline{57.375}

\l@section . . . . \underline{57.514}
\l@subparagraph   \underline{57.514}
\l@subsection . . \underline{57.514}
\l@subsubsection  \underline{57.514}

\label . . . . . . . . \underline{43.514}

\labelenumii . . . \underline{57.305}
\langhyphenmins . . . 11

\language . . . . . . \underline{12.33}

\language@group   \underline{12.573}
\languageattribute .

. . . . . . . 5, \underline{12.645}

\languagename . . . . . . 4
\languageshorthands

. . . . . . . 5, \underline{12.581}

\last@language . . \underline{12.36}
\LasyGuillemets   \underline{28.232}

\LaTeX . . \underline{12.1202}, \underline{57.246} \LaTeXe . . . . . . . \underline{57.248}

\latinencoding \underline{12.12},

\underline{51.7}, \underline{52.7}, \underline{53.7}

\latinhyphenmins   \underline{30.44}
\latintext . . . . . . .

. \underline{12.22}, \underline{51.111}, \underline{52.111}, \underline{53.111}, 101

\Lcaron . . . . . . . . \underline{46.46} \lcaron . . . . . . . . \underline{46.46}

\ldf@finish . . 11, \underline{12.205}

\ldf@quit … 11, \underline{12.200} \LdfInit …. 11, \underline{12.170} \Lgem . . . . . . . . . \underline{33.147} \lgem . . . . . . . . . \underline{33.147}

\listoffigures . \underline{57.349}
\listoftables . . \underline{57.349}
\loadlocalcfg . 11, \underline{13.1}
\lower@umlaut . . \underline{12.896}
\lrlistoffigures  \underline{57.343}
\lrlistoftables   \underline{57.343}
\lrtableofcontents .

. . . . . . . . . \underline{57.343}

\ltx@amp . . . . . . \underline{26.135}

\LtxSymbCaporali   \underline{29.99}

M

\main@language 11, \underline{12.213}
\mainmatter . . . . \underline{61.256}

\make@lr . . . . . . \underline{57.230}

\makecover . . . . \underline{61.260}
\MakeLowercase . \underline{57.709}
\maketitle . . . . \underline{61.276}

\MakeUppercase . \underline{57.709}
\marginparsep . . \underline{61.378}
\marginparwidth   \underline{61.378}

\markboth . . . . . \underline{12.1186} \markright …. \underline{12.1186}

\mathserbian . . . . \underline{48.67}

\mdqoff \underline{20.113}, \underline{21.90}, \underline{47.159}, \underline{51.331}, \underline{53.310}, \underline{55.95}

\mdqon \underline{20.113}, \underline{21.90}, \underline{47.159}, \underline{51.331}, \underline{53.310}, \underline{55.95}

N

\newcheck . . . . . . \underline{44.52}

\newdatelsorbian   \underline{54.29}
\newdateusorbian   \underline{55.29}

\newlabel . . . . . \underline{12.1117} \newtilde . . . . . . \underline{44.52}

\nfss@catcodes . \underline{12.1244}

\No . . . . . . . . . . \underline{28.526} \no . . . . . . . . . . \underline{28.526}

\NoAutoSpaceBeforeFDP

. . . . . . \underline{28.222}, \underline{51.268}, \underline{53.247}

\nocite . . . . . . . \underline{12.1170}

\noextrasafrikaans \underline{18.93}
\noextrasaustrian  \underline{20.42}
\noextrasbahasa . \underline{62.39}
\noextrasbasque . \underline{35.36}
\noextrasbreton . \underline{22.35}
\noextrascatalan   \underline{33.37}
\noextrascroatian  \underline{45.34}
\noextrasczech . . \underline{46.35}
\noextrasdanish . \underline{37.34}
\noextrasdutch . . \underline{18.93}
\noextrasenglish   \underline{19.96}
\noextrasesperanto \underline{17.35}
\noextrasestonian  \underline{44.44}
\noextrasfinnish   \underline{42.35}
\noextrasfrench . \underline{28.84}
\noextrasgalician  \underline{34.34}
\noextrasgerman . \underline{20.42}
\noextrasgreek . . \underline{26.80}
\noextrashebrew . . .

…. \underline{57.59}, \underline{57.104}

\noextrasicelandic \underline{38.18}
\noextrasirish . . \underline{24.38}
\noextrasitalian   \underline{29.35}
\noextraslang . . . . . 11
\noextraslatin . . \underline{30.45}
\noextraslsorbian  \underline{54.50}
\noextrasmagyar . \underline{43.55}
\noextrasnaustrian \underline{21.42}

                          \noextrasngerman   \underline{21.42}
                          \noextraspolish . \underline{47.35}
                          \noextrasportuges  \underline{31.97}
                          \noextrasromanian  \underline{36.35}
                          \noextrassamin . . \underline{41.46}
                          \noextrasscottish  \underline{25.37}
                          \noextrasserbian   \underline{48.34}
                          \noextrasslovak . \underline{49.35}
                          \noextrasslovene   \underline{50.34}
                          \noextrasswedish   \underline{40.43}
                          \noextrasturkish   \underline{56.36}
                          \noextraswelsh . . \underline{23.38}
                          \nohebrewtext . . . \underline{57.64}

\nombre . . . . . . . \underline{28.397}

                          \norskhyphenmins . \underline{39.6}

O

                          \oddsidemargin . \underline{61.376}

\og . . . . . . . . . . \underline{28.232}

                          \olddatelsorbian   \underline{54.35}
                          \olddateusorbian   \underline{55.35}
                          \ondatemagyar . . . \underline{43.41}

\ontoday . . . . . . . . 224 \Oob . . . . . . . . . . . \underline{38.89} \oob . . . . . . . . . . . \underline{38.89} \OOob . . . . . . . . . . \underline{38.89} \ooob . . . . . . . . . . \underline{38.89} \ord . . . . . . . . . . \underline{31.114} \orda . . . . . . . . . \underline{31.114}

                          \originalTeX . . . \underline{12.225}

\OT1dqpos . . . . . \underline{12.640}

                          otherlanguage (envir-

onment) 4, \underline{12.116}

                          otherlanguage* (envir-

onment) 4, \underline{12.125}

P

                          \p@enumiii . . . . \underline{57.305}

\pageref . . . . . . \underline{12.1152} \ped . . . . . . . . . . . \underline{29.82}

                          \peek@token . . . . \underline{12.384}

\polishrz . . . . . \underline{47.130} \polishzx . . . . . \underline{47.130}

                          \portugeshyphenmins

. . . . . . . . . . \underline{31.96}

\primo . . . . . . . . \underline{28.526}

                          \process@language \underline{12.277}
                          \process@line . . \underline{12.255}
                          \process@synonym  \underline{12.262}
                          \providehyphenmins .

. . . . . . 11, \underline{12.165}

                          \ProvidesLanguage .

. . . . . . . . \underline{10.1}, 11

                                                   \ps@headings  \underline{43.151},

\underline{43.249}, \underline{43.317},
\underline{43.352}, \underline{57.553}

                                                   \ps@myheadings . \underline{57.553}
                                                   \ps@thesis . . . . \underline{61.359}

Q

                                                   quotation (environ-

ment) …. \underline{57.268} quote (environment) .

. . . . . . . . . \underline{57.278}

                                                   \quotedblbase . . \underline{12.778}
                                                   \quotesinglbase   \underline{12.783}

R \R . . . . . . . . . . . \underline{57.199} \ra . . . . . . . . . . \underline{31.114}

                                                   \raggedleft . . . . \underline{57.697}
                                                   \raggedright . . . \underline{57.697}
                                                   \readconfigfile   \underline{12.324}

\ref . . . . . . . . . . \underline{12.1152}

                                                   \refstepcounter   \underline{43.509}

\Remainder …. \underline{57.1084}

                                                   \rl@outputdblcol  \underline{57.520}
                                                   \rllistoffigures  \underline{57.346}
                                                   \rllistoftables   \underline{57.346}
                                                   \rltableofcontents .

. . . . . . . . . \underline{57.346}

\ro . . . . . . . . . . \underline{31.114}

                                                   \romandate . . . . . \underline{30.44}
                                                   \russian@sh@:@ . \underline{51.231}
                                                   \russian@sh@;@ . \underline{51.231}
                                                   \russian@sh@?@ . \underline{51.231}
                                                   \russian@sh@@ . . \underline{51.231}

S

                                                   \saminhyphenmins . \underline{41.6}

\save@sf@q . . \underline{12.771}, 13

                                                   \selectlanguage . . .

. . 4, \underline{12.66}, \underline{57.168}

                                                   \set@hyphenmins   \underline{12.169}
                                                   \set@low@box . \underline{12.768}, 13
                                                   \set@outputdblcol \underline{57.520}
                                                   \sethebrew . . . . . \underline{57.62}
                                                   \SetLatinLigatures \underline{30.56}
                                                   \setrllanguage . \underline{57.187}
                                                   \shorthandoff . 5, \underline{12.587}
                                                   \shorthandon . . 5, \underline{12.587}
                                                   \ShortHYName . . . \underline{57.891}

\skb . . . . . . . . . . . \underline{47.71} \sob . . . . . . \underline{38.81}, \underline{47.43} \spb . . . . . . . . . . . \underline{47.63} \SS . . . . . . . . . . \underline{12.858}

                                                   \StandardLayout   \underline{28.468}

\StandardMathComma .

. . . . . . . . . \underline{28.370}

\strcat . . . . . . . \underline{57.1099}

\subsitutefontfamily 11
\substitutefontfamily

. . . . . . . . . \underline{11.100}

\swedishhyphenmins \underline{40.42}
\system@group . . \underline{12.573}
\system@sh@:@ \underline{28.228},

\underline{51.280}, \underline{53.259}

\system@sh@;@ \underline{28.228},

\underline{51.280}, \underline{53.259}

\system@sh@?@ \underline{28.228},

\underline{51.280}, \underline{53.259}

\system@sh@@  \underline{28.228},

\underline{51.280}, \underline{53.259}

T

\T1dqpos . . . . . . \underline{12.640}

\tableofcontents  \underline{57.349}

\tala . . . . . . . . . \underline{38.114} \telepl . . . . . . . . \underline{47.87}

\TensInHebrew . . \underline{57.1031}
\TensInHebrewEnd \underline{57.1044}

\TeX …. \underline{12.1202}, \underline{57.244} \textacute \underline{33.74}, \underline{34.55} \textclas . . . . . \underline{59.256} \textcrml . . . . . \underline{59.253}

\textcyrillic \underline{51.115},

\underline{52.115}, \underline{53.115} \textds . . . . . . . \underline{59.250} \textfr . . . . . . . \underline{59.254}

\textgrave . . . . . \underline{33.74}
\textgreek . \underline{26.27}, 101
\textheight . . . . \underline{61.371}

\textjm . . . . . . . \underline{59.248}

\textlatin . . . . . . .

. \underline{12.25}, \underline{51.115}, \underline{52.115}, \underline{53.115}, 101

\textoj . . . . . . . \underline{59.251} \textol …. \underline{26.28}, 101

\textormath . . . . \underline{12.567}

\textpl . . . . . . . . \underline{47.78}

\textredis . . . . \underline{59.255}
\textshold . . . . \underline{59.257}
\textshscr . . . . \underline{59.258}
\textshstk . . . . \underline{59.259}

\textta . . . . . . . \underline{59.252} \texttilde \underline{34.55}, \underline{35.50}

\textwidth . . . . \underline{61.371}
\thebibliography  \underline{61.116}
thebibliography (en-

vironment) \underline{57.797} \thestype . . . . . \underline{61.143}

\thousandsep . . . . . .

… \underline{28.377}, \underline{38.105} \tildelow . . . . . . \underline{44.52} \title . . . . . . . . \underline{61.145}

\todayRoman . . . . \underline{52.179}

\tohebrew . . . . . . \underline{57.68}

                          \topmargin . . . . \underline{61.373}
                          \turkish@sh@:@ . . \underline{56.44}
                          \turkish@sh@@ . . . \underline{56.44}

U

                          \ukrainian@sh@:@  \underline{53.210}
                          \ukrainian@sh@;@  \underline{53.210}
                          \ukrainian@sh@?@  \underline{53.210}
                          \ukrainian@sh@@   \underline{53.210}
                          \umlauthigh . . . . \underline{12.886}
                          \umlautlow . . . . \underline{12.886}
                          \underline . . . . \underline{57.713}

\unit . . . . . . . . . . \underline{29.82}

                          \unsethebrew . . . . \underline{57.62}
                          \unsetrllanguage  \underline{57.187}

\up . . . . . \underline{28.494}, \underline{33.193} \up@size . . . . . . \underline{28.494} \upp . . . . . . . . . . \underline{38.154} \upp@size . . . . . \underline{38.154}

                          \user@group . . . . \underline{12.573}
                          \useshorthands 5, \underline{12.576}

V \v . . . . . . . . . . . . \underline{46.39}

                          \verbatim@font . . . .

… \underline{51.202}, \underline{53.181} verse (environment) .

. . . . . . . . . \underline{57.257}

W

                          \welshhyphenmins . \underline{23.6}

Change History

babel-1.5b

General: Added support for canadien and acadian . . . . . . . . . . . . . . . . . . . . 119 babel 2.0a

General: Added text about german.sty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 babel 2.0b

General: Changed order of code to prevent plain TEXfrom seeing all of it . . . . . 1 babel 2.1

General: Modified user interface, \langTeX no longer necessary . . . . . . . . . . . . 1 babel 2.1a

General: Incorporated Nico’s comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 babel 2.1b

General: rename \language to \current@language . . . . . . . . . . . . . . . . . . . . . 1 babel 2.1c

General: abstract for report fixed, missing }, found by Nicolas Brouard . . . . . . 1 babel 2.1d

General: Missing right brace in definition of abstract environment, found by Wer-

enfried Spit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 babel 2.1e

General: Incorporated more comments from Nico . . . . . . . . . . . . . . . . . . . . . . 1 babel 2.2

General: Renamed \newlanguage to \addlanguage . . . . . . . . . . . . . . . . . . . . . 1 babel 2.2a

General: Modified the documentation somewhat . . . . . . . . . . . . . . . . . . . . . . . 1 babel 3.0

General: Moved part of the code to hyphen.doc in preparation for TEX 3.0 …. 1 babel 3.0a

General: Updated comments in various places . . . . . . . . . . . . . . . . . . . . . . . . . 1 \iflanguage: Added \@bsphack and \@esphack . . . . . . . . . . . . . . . . . . . . . . 21

\selectlanguage: Added \@bsphack and \@esphack . . . . . . . . . . . . . . . . . . . 23

Replaced \gdef with \def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 babel 3.0b

General: Removed some problems in change log . . . . . . . . . . . . . . . . . . . . . . . 1 babel 3.0c

General: Renamed babel.sty and latexhax.sty to .com . . . . . . . . . . . . . . . . . 1 \iflanguage: Added comment character after #2 . . . . . . . . . . . . . . . . . . . . . 21 \selectlanguage: Made \selectlanguage robust . . . . . . . . . . . . . . . . . . . . . 22

babel 3.0d \@nopatterns: Added a percent sign to remove unwanted white space . . . . . . 28 General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 \doc@style: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . 53 \iflanguage: Removed space hacks and use of \@ifundefined . . . . . . . . . . . 21

Removed superfluous \expandafter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 \process@language: Added the collection of pattern names. . . . . . . . . . . . . . 30

Reinserted \expandafter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Removed superfluous \expandafter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

\selectlanguage: Removed space hacks and use of \@ifundefined . . . . . . . . 23

Removed superfluous \expandafter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 babel 3.1

General: Added the support for active characters and for extending a macro … 1 Removed definition of \if@restonecol . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Removed the need for latexhax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

\addto: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 \readconfigfile: Removed the extra if control sequence . . . . . . . . . . . . . . . 32

Removed use of \toks0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 \selectlanguage: \originalTeX should only be executed once . . . . . . . . . . . 23

babel 3.2 General: Some Changes by br . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 \adddialect: Added \relax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 \addlanguage: Added a %, removed by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 \babel@beginsave: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 \babel@save: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 \babel@savecnt: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 \babel@savevariable: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 \bbl@add@special: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 \bbl@remove@special: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 \iflanguage: Refrased \ifnum test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 \selectlanguage: Modified to allow arguments that start with an escape char-

acter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 babel 3.2a

General: Fixups of the code and documentation . . . . . . . . . . . . . . . . . . . . . . . 1 \originalTeX: Set \originalTeX to \empty, because it should be expandable. 28 \readconfigfile: Free macro space for \process@language . . . . . . . . . . . . . 32 \selectlanguage: Added \relax as first command to stop an expansion if

\protect is empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Added three \expandafters to save macro space for \originalTeX . . . . . . . 23 Moved definition of \originalTeX before \extras⟨lang⟩ . . . . . . . . . . . . . . 23 Set \originalTeX to \empty, because it should be expandable. . . . . . . . . . . 23 Simplified the modification to allow the use in a \write command . . . . . . . 22

babel 3.2b \allowhyphens: Moved macro from language definition files . . . . . . . . . . . . . . 47 \save@sf@q: Moved macro from language definition files . . . . . . . . . . . . . . . . 47 \set@low@box: Moved macro from language definition files . . . . . . . . . . . . . . . 47

babel 3.2c

\babel@save: missing backslash led to errors when executing \originalTeX . . 46 babel 3.2d

\babel@save: saving in \babel@i and restoring from \@babel@i doesn’t work

very well... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 babel 3.2e

General: Added slovak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 babel 3.3

General: \headpagename should be \pagename . . . . . . . . . . . . . . . . . . . . . . . . 57 Added catalan and galician . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added turkish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Included driver file, and prepared for dsitribution . . . . . . . . . . . . . . . . . . . . 1

babel 3.4

General: Added bahasa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added language definition file for bahasa . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Updated for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

\addto: Changed to use toks register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 babel 3.4b

General: Added a small driver to be able to process just this file . . . . . . . . . . . 1

Use the ltxdoc class instead of article . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 babel 3.4c

General: lhyphen.cfg has become lthyphen.cfg . . . . . . . . . . . . . . . . . . . . . . . . 15 babel 3.4e

\@nolanerr: Use \PackageError in L^{A}TEX 2ε mode . . . . . . . . . . . . . . . . . . . . 28 \@nopatterns: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 \process@language: Added code to detect assignments to left- and righthyphen-

min in the patternfile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 \ProvidesLanguage: Redid the identification code, provided dummy definition of

\ProvidesFile for plain TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 babel 3.4g

\@testdef: Moved the \def inside the macrocode environment . . . . . . . . . . . 59 babel 3.5a

\@nopatterns: Added \@activated to log active characters . . . . . . . . . . . . . . 28 General: Added a system shorthand for the right quote . . . . . . . . . . . . . . . . . 42

Added breton, irish, scottish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Changed extension of language definition files to ldf . . . . . . . . . . . . . . . . . 15 Provided common code to handle the active double quote . . . . . . . . . . . . . . 1 Replaced 16 system shorthands to deal with hex numbers by one . . . . . . . . 42

\bbl@activate: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 \bbl@deactivate: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 \bbl@main@language: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 \bbl@pr@m@s: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 \bbl@set@language: write the language change to the auxiliary files . . . . . . . . 23 \initiate@active@char: Added a check for right quote and adapt \pr@m@s if

necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

\main@language: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 babel 3.5b

General: Added brazilian as alternative for brazil . . . . . . . . . . . . . . . . . . . . . . 15 Added lsorbian, usorbian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added the estonian option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 lthyphen.cfg has become hyphen.cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

\initiate@active@char: Renamed macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 \pageref: Made \ref and \pageref robust (PR1353) . . . . . . . . . . . . . . . . . . 60 \process@language: Added optional reading of file with hyphenation exceptions 31 \process@line: added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 \process@synonym: added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 \readconfigfile: Now add a \space and a / character . . . . . . . . . . . . . . . . . 32 \selectlanguage: Added an extra level of expansion to separate the switching

mechanism from writing to aux files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Addedd default setting of hyphenmin parameters . . . . . . . . . . . . . . . . . . . . 24 Changed the name of the internal macro to \selectlanguage . . . . . . . . . . 22 Seperated the setting of the hyphenmin values . . . . . . . . . . . . . . . . . . . . . . 24 Store the name of the current language in a control sequence instead of passing the whole macro construct to strip the escape character in the argument of \selectlanguage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

babel 3.5c \@nopatterns: Added missing closing brace . . . . . . . . . . . . . . . . . . . . . . . . . 28 General: Changed the order of including the language files somwhat (PR1652) 68

corrected a few typos (PR1652) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Repaired a typo (itlaic, PR1652) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

babel 3.5d

General: Added british as an alternative for english with a preference for british hyphenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Added options to influence behaviour of active acute and grave accents …. 17 Load french.ldf when it is found instead of frenchb.ldf . . . . . . . . . . . . . 16 Load language definition files after the check for the hyphenation patterns . 15 Merged glyphs.dtx into this file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

\active@prefix: \@protected@cmd has vanished from ltoutenc.dtx . . . . . . . 39

\declare@shorthand: Make a ‘note’ when a shorthand with an argument is

defined. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 \foreignlanguage: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 \initiate@active@char: Skip the language-level active char with argument if no

shorthands with arguments were defined . . . . . . . . . . . . . . . . . . . . . . . . . 38 Skip the user-level active char with argument if no shorthands with arguments were defined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

\loadlocalcfg: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 \pageref: use a different control sequence while making \ref and \pageref ro-

bust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 otherlanguage: environment added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

babel 3.5e

otherlanguage: changed name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 babel 3.5f

\@bibitem: Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 \@citex: Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 \@testdef: Complete rewrite of this macro as the same character ended up with

different category codes in the labels that are being compared. Now use \meaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Use \strip@prefix only on \bbl@tempa when it is not \relax . . . . . . . . . . 59

General: Added a system shorthand for the left quote . . . . . . . . . . . . . . . . . . 42 Added the greek option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 No need to reset the category code of the tilde as \initiate@active@char now correclty deals with active characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Now use the file frenchb.ldf from Daniel Flipo for french support . . . . . . . 16 repaired a typo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

  replaced \tmp, \bbl@tmp and \bbl@temp with \bbl@tempa . . . . . . . . . . . . . . 1

\aliasshorthand: New command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 \bbl@disc: Macro moved from language definition files . . . . . . . . . . . . . . . . . 47 \bbl@redefine: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 \bbl@redefinerobust: Define \*foo instead of \foo . . . . . . . . . . . . . . . . . . . 58

Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 \bbl@set@language: Now also define \languagename at this level . . . . . . . . . . 23 \bbl@test@token: macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 \bibcite: Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 \DJ: New definition of \dj, see PR 2058 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 \frq: corrected spelling of \quilsingl... . . . . . . . . . . . . . . . . . . . . . . . . . . 51

now use \textormath in these definitions . . . . . . . . . . . . . . . . . . . . . . . . . 51 \frqq: corrected spelling of \quillemot... . . . . . . . . . . . . . . . . . . . . . . . . . . 51

now use \textormath in these definitions . . . . . . . . . . . . . . . . . . . . . . . . . 51 \initiate@active@char: Deal correctly with already active characters, provide

top level expansion and define all lower level expansion macro’s outside of the \else branch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 restore the \lccode of the tie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Restore the category code of a shorthand char at end of package . . . . . . . . 36 store the \lccode of the tie before changing it . . . . . . . . . . . . . . . . . . . . . . 36 use \peek@token to check wheter it is safe to proceed . . . . . . . . . . . . . . 37, 38

\lower@umlaut: Added a \allowhyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

removed \allowhyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 \newlabel: Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 \nocite: Now use \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 \pageref: Now use \bbl@redefinerobust . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 redefine \*ref if it exists instead of \def . . . . . . . . . . . . . . . . . . . . . . . . . . 60 redefine \setref instead of \ref and \pageref in L^{A}TEX 2ε. . . . . . . . . . . . . 60 Reverse the previous change as it inhibits the use of active characters in labels 60

\peek@token: macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 \process@language: Use \empty instead of \@empty as the latter is unknown in

plain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 \ProvidesLanguage: Need to temporarily change the definition of \ProvidesFile

for december 1995 release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Store version in \fileversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

\readconfigfile: Moved the fiddling with \dump to bbplain.dtx as it is no

longer needed for L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 \selectlanguage: Added a missing percent character . . . . . . . . . . . . . . . . . . 22

Moved check for escape character one level down in the expansion . . . . . . . 22 otherlanguage*: environment added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

babel 3.5g

General: Added definition of \Babel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Added greek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added option afrikaans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Removed the use of \patterns@loaded altogether . . . . . . . . . . . . . . . . . . . 29 replaced \undefined with \@undefined to be consistent with L^{A}TEX . . . . . . . 1

\ifthenelse: Redefinition of \ifthenelse added to circumvent problems with

\pageref in the argument of \isodd . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

\initiate@active@char: Top level expansion of \normal@char char where char

is already active, should be the expansion of the active character, not the active character itself as this causes an endless loop . . . . . . . . . . . . . . . . . 35

\nfss@catcodes: Need to add the double quote and acute characters to \nfss@catcodes

to prevent problems when reading in .fd files . . . . . . . . . . . . . . . . . . . . . . 64 \process@line: Simplified code, removing \bbl@eq@ . . . . . . . . . . . . . . . . . . . 29

\ProvidesLanguage: Save a few csnames; use \bbl@tempa instead of \ProvidesFile

and store message in \toks8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 babel 3.6a

\@@vpageref: Redefinition of \@@vpageref added to circumvent problems with

active : in the argument of \vref when varioref is used . . . . . . . . . . . . . 63 General: Added welsh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Removed \babel@core@loaded, no longer needed whith the advent of \LdfInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

\ldf@finish: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 \ldf@quit: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 \LdfInit: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

\main@language: \main@language now also sets \languagename and \l@languagename

for use by other packages in the preamble of a document . . . . . . . . . . . . . . 28 \selectlanguage: Check for the existence of \date... instead of \l@... . . . 23

babel 3.6b

\addto: Also check if control sequence expands to \relax . . . . . . . . . . . . . . . 47 babel 3.6c

General: When \LdfInit is undefined we need to load babel.def from babel.sty 15

\bbl@main@language: When hyphen.cfg is not loaded in the format \l@english

might not be defined; assume english is language 0 . . . . . . . . . . . . . . . . . . 28 babel 3.6d

\foreign@language: Added \relax to prevent disapearance of the first token after this command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 New macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 set the language shorthands to ‘none’ before switching on the extras . . . . . . 25

\foreignlanguage: Introduced \foreign@language . . . . . . . . . . . . . . . . . . . . 25

\selectlanguage: set the language shorthands to ‘none’ before switching on the

extras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 otherlanguage*: Introduced \foreign@language . . . . . . . . . . . . . . . . . . . . . 24

babel 3.6e

General: Added option frenchb an alias for francais . . . . . . . . . . . . . . . . . . . . 16

Added options UKenglish and USenglish . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 babel 3.6f

General: Added option KeepShorthandsActive . . . . . . . . . . . . . . . . . . . . . . . . . 17 \bbl@redefine@long: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 \ifthenelse: \ifthenelse needs to be long . . . . . . . . . . . . . . . . . . . . . . . . . 62 \initiate@active@char: Made restoring of the category code of shorthand char-

acters optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 babel 3.6h

\readconfigfile: Added a couple of \expandafters to copy the contents of

\toks8 into \everyjob instead of the reference . . . . . . . . . . . . . . . . . . . . . 33 babel 3.6i

\@newl@bel: Now redefine \@newl@bel instead of \@lbibitem and \newlabel . 58

\@testdef: \@safe@activesfalse is now part of the label definition . . . . . . . 59

Make sure that shorthands don’t get expanded at the wrong moment. . . . . 59 General: Added basque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Added default option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Added the Basque option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Added the ukrainian option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Added the possibility to have a bblopts.cfg file with option declarations. . 17

\bbl@afterfi: Made \bbl@afterelse and \bbl@afterfi \long . . . . . . . . . . . 34
\bbl@test@token: renamed \bbl@token to \bbl@test@token to prevent a clash

with ArabTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 \declare@shorthand: Make it possible to distinguish the constructed control se-

quences for the case with argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 \ifthenelse: Now reset the @safe@actives switch inside the 2nd and 3rd argu-

ments of \ifthenelse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 \initiate@active@char: Make shorthands active during .aux file processing . 36

Remove the use of \peek@token again . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Remove the use of \peek@token again and make the \...active@arg... commmands \long . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

\latinencoding: Macro added, moved from .ldf files . . . . . . . . . . . . . . . . . . 19 \latintext: Macro added, moved from .ldf files . . . . . . . . . . . . . . . . . . . . . 19 \markboth: Added redefinition of \mark... commands . . . . . . . . . . . . . . . . . 61

\peek@token: Renamed \test@token to \bbl@test@token to prevent a clash with

ArabTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 \system@group: Have a user group called ‘user’ by default . . . . . . . . . . . . . . . 40 \textlatin: Macro added, moved from .ldf files . . . . . . . . . . . . . . . . . . . . . 19

babel 3.6k

\latinencoding: Use T1 encoding when it is a known encoding . . . . . . . . . . . 19 babel 3.6l

General: Don’t load babel.def now, but rather define \LdfInit temporarily in order to load babel.def at the right time, preventing problems with the temporary definition of \bbl@redefine . . . . . . . . . . . . . . . . . . . . . . . . . . 15

babel 3.6m

\latinencoding: Can’t use \@ifpackageloaded need to parse \@filelist . . . 19

babel 3.6n

\latinencoding: Added a check for ‘manual’ selection of T1 encoding, without loading fontenc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 moved checking for fontenc right to the top of babel.sty . . . . . . . . . . . . . . 19 babel 3.6o

General: Moved the rest of the font encoding related definitions to their original

place . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 babel 3.6p

General: Added the ngerman and naustrian options . . . . . . . . . . . . . . . . . . . . 16 babel 3.6q

\latinencoding: Better solution then parsing \@filelist, use \@ifl@aded . . 19

babel 3.6r

General: We do need to load babel.def right now as \ProvidesLanguage needs to be defined before the .ldf files are read and the reason for for 3.6l has been removed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

babel 3.6s

\bibcite: Need to determine ‘online’ which definition of \bibcite is needed . 61 babel 3.6u

\latinencoding: Moved this code to babel.def . . . . . . . . . . . . . . . . . . . . . . 19 babel 3.6v

\bbl@bibcite: Macro \bbl@bibcitee added . . . . . . . . . . . . . . . . . . . . . . . . . 61

\bbl@cite@choice: Macro \bbl@cite@choice added . . . . . . . . . . . . . . . . . . . 61

\bibcite: Also check for cite it can’t handle \@safe@activesfalse in it’s second

argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 babel 3.7a

\@newl@bel: Call \@safe@activestrue directly . . . . . . . . . . . . . . . . . . . . . . . 59 \@testdef: Removed \@safe@activesfalse from the label definition . . . . . . . 59 General: Added icelandic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Added the hebrew option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Added the icelandic option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Added the polutonikogreek option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 No longer define the control sequence \KeepShorthandsActive . . . . . . . . . . 17 Now need packages t1enc and supertabular to be loaded; the documentation for icelandic needs its .ldf file to be present . . . . . . . . . . . . . . . . . . . . . . 66

\allowhyphens: Make \allowhyphens a no-op for T1 fontencoding . . . . . . . . . 47 \bbl@switch@sh: Added command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 \foreignlanguage: Added executing \originalTeX . . . . . . . . . . . . . . . . . . . . 25 \grq: Make the definition of \grq dependent on the font encoding . . . . . . . . . 50 \grqq: Make the definition of \grqq dependent on the font encoding . . . . . . . 50 \iflanguage: Now evaluate the \ifnum test after the \fi from the \ifx test and

use \@firstoftwo and \@secondoftwo . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 \initiate@active@char: Commented out p̧eek@token and \test@token as short-

hands are made expandable again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Use \@ifpackagewith to determine whether shorthand characters need to remain active . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

\LaTeX: Make TEX and L^{A}TEX logo’s encoding independant . . . . . . . . . . . . . . 62 \process@language: Read pattern files in a group . . . . . . . . . . . . . . . . . . . . . 30 \ProvidesLanguage: Added macro to prevent problems with unexpected \ProvidesFile

in plain formats because of babel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Removed superfluous braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

\shorthandoff: Added command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 \shorthandon: Added command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

babel 3.7b

General: Added Latin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Added the latin option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 \iflanguage: Slight enhancement: added braces around first argument of

\bbl@afterfi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 babel 3.7c

General: Added an error message for when no language option was specified . . 17 Added hebrew and serbian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added support for language attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Added ukrainian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 define \adddialect before loading plain.def here . . . . . . . . . . . . . . . . . . . 19 No longer us a redefinition of an internal macro, just check \bbl@main@language and load babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Removed redefinition of \@roman and \@Roman . . . . . . . . . . . . . . . . . . . . . . 62 set the correct language attribute for polutoniko greek . . . . . . . . . . . . . . . . 16

\initiate@active@char: Only execute \initiate@active@char for each charac-

ter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 \markboth: Avoid expanding the arguments by storing them in token registers 61

Removed the use of \head@lang (PR 2990) . . . . . . . . . . . . . . . . . . . . . . . . 61 \process@language: Added the execution of the contents of \toks@ . . . . . . . . 31

Also store \languagename for possible later use in \process@synonym . . . . . 30 need to set hyphenmin values globally . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Only set hyphenmin values when the pattern file changed them . . . . . . . . . 30 Set \lefthyphenmin to \m@ne inside the group; explicitely set the hyphenmin parameters for language 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

\process@line: added an extra argument in order to prevent a trailing space from becoming part of the control sequence when defining a synonym (PR 2851) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

\process@synonym: Now also store hyphenmin paramters for language synonyms 29 Use a token register to temporary store a command to set hyphenmin parameters for the synonym which is defined before the first pattern file is processed 29

babel 3.7d

General: Fixed a few typos in \changes entries which made typesetting the code

impossible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 \initiate@active@char: Make sure the active character doesn’t get expanded

   more then once by the \edef by adding \expandafter\strip@prefix\meaning

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 babel 3.7e

General: Added missing hebrew files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 \bbl@clear@ttribs: When \bbl@attributes is undefined this should be a no-op 45 \initiate@active@char: pass the argument on with braces in order to prevent

it from breaking up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 38 previous change was rubbish; use \let instead of \edef . . . . . . . . . . . . . . . 35

hyphenrules: Added environment hyphenrules . . . . . . . . . . . . . . . . . . . . . . . 25 babel 3.7f

General: Added bulgarian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added samin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Added the bulgarian option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Added to samin option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

\bbl@get@enc: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 \bbl@ifattributeset: macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 \bbl@prim@s: Need to redefine \prim@s as well as plain TEX’s definition uses

\next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

\bbl@set@language: Macro \bbl@set@language introduced . . . . . . . . . . . . . . 23

\ifthenelse: \pageref needs to have its babel definition reinstated in the second

and third arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 \initiate@active@char: Added an extra shorthand combination on user level to

catch an interfering \protect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Insert a check for math mode in the definition of \normal@char' . . . . . . . . 36 Introduced an extra level of expansion in the definition of an active caret . . 36 Make an exception for the active caret which needs an extra level of expansion 37 remove the braces again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 38 The redefinition needs to take place on level higher, \prim@s needs to be redefined. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

\process@language: Allow for the encoding to be used as part of the language

name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 \providehyphenmins: added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 \save@sf@q: PR3119, don’t start a paragraph in a local group . . . . . . . . . . . . 47 \selectlanguage: Use \aftergroup to keep the language grouping correct in

auxiliary files PR3091 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 babel 3.7g

\@citex: The shorthands need to be deactivated for the second argument of

\@citex only. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 General: Added option acadian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Added option canadian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Added option canadien . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

\initiate@active@char: use \textormath to get rid of the \fi (PR 3266) . . . 36

bahasa-0.9c

General: Now use \@patterns to produce the warning . . . . . . . . . . . . . . . . . 383 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

bahasa-1.0b

\captionsbahasa: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . 383 bahasa-1.0d

General: Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 \captionsbahasa: Replaced ‘Proof’ by ‘Bukti’ (PR2214) . . . . . . . . . . . . . . . 383

bahasa-1.0e

General: Moved the definition of \atcatcode right to the beginning. . . . . . . 383 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 383

\bahasahyphenmins: use \bahasahyphenmins to store the correct values . . . . 384

bahasa-1.0f

\datebahasa: Use \edef to define \today . . . . . . . . . . . . . . . . . . . . . . . . . . 384 bahasa-1.0g

\datebahasa: Februari should be spelled as Pebruari . . . . . . . . . . . . . . . . . . 384 bahasa-1.0h

\bahasahyphenmins: Now use \providehyphenmins to provide a default value 384

\captionsbahasa: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . 383 bahasa 1.0f

\datebahasa: use \def instead of \edef to save memory . . . . . . . . . . . . . . . 384 basque-1.0b

General: Removed empty groups after guillemot characters . . . . . . . . . . . . . 194 \datebasque: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 193 basque-1.0c

\datebasque: fixed typo in April’s name . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 basque-1.0d

\noextrasbasque: Deactivate shorthands ouside of Basque . . . . . . . . . . . . . 193 basque-1.0e

\basquehyphenmins: Now use \providehyphenmins to provide a default value 193

\captionsbasque: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . 192 bbplain-0.1

General: Added redefinition of \dump to add a message to \everyjob . . . . . . 386 bbplain-1.0c

General: Add execution of \@begindocumenthook to \@preamblecmds . . . . . . 387

Added definition of \loadlocalcfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 Moved the \dump code here from babel.dtx . . . . . . . . . . . . . . . . . . . . . . 386

bbplain-1.0d

General: Also reset category codes after loading the configuration file as \AtEndOfPackage

is undefined in this case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 bbplain-1.0e

General: Added the \newcommand code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 Provide a more complete emulation of \DeclareRobustCommand and \newcommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388

bbplain-1.0f

General: added \@empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386

  Added \textquotedblright and \textquoteright . . . . . . . . . . . . . . . . . 394

Added definition of \scriptsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 Consistently use \@undefined instead of \undefined . . . . . . . . . . . . . . . . 386 Use \toks8 instead of \patterns@loaded . . . . . . . . . . . . . . . . . . . . . . . . 387

bbplain-1.0g

General: Added \ss and \i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 bbplain-1.0h

General: Only load the necessary parts into the format, let this file be read agian

by babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 bbplain-1.0i

General: \document is not a L^{A}TEX2.09-only command; AMSTEXdefines it too;

now use \@ztryfc to detect L^{A}TEX2.09 . . . . . . . . . . . . . . . . . . . . . . . . . . 387 bbplain-1.0j

General: \@begindocumenthook might already be defined . . . . . . . . . . . . . . . 388

Add the definition of \@begindocumenthook to the L^{A}TEX2.09 format …. 387 bbplain-1.0k

General: \newcount is an \outer command, can’t use it inside an \if construct 390

missing \@undefined added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 bbplain-1.0l

General: Mixed up the definition of \@tempcntb . . . . . . . . . . . . . . . . . . . . . 390 bbplain-1.0m

General: Set \if@filesw to \iffalse only for plain TEX . . . . . . . . . . . . . . . 388 bbplain-1.0n

General: Added \@secondoftwo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Added the source for the format wrapper files . . . . . . . . . . . . . . . . . . . . . 385 Repaired typo and added missing \endcsname . . . . . . . . . . . . . . . . . . . . . 388

bbplain-1.0o

General: Added definition of \in@ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 bbplain-1.0p

General: Added \@ifl@aded as a no-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 bbplain-1.0q

General: Added \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 bbplain-1.0r

General: Added \textquotedblleft and \textquoteleft . . . . . . . . . . . . . . 394 breton-1.0

General: First release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 breton-1.0b

\captionsbreton: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . . 91 \noextrasbreton: Use the new mechanism for dealing with active chars . . . . . 92 breton-1.0c

General: Postpone the \DeclareTextCompositeCommands untill \AtBeginDocument

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 breton-1.0e

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . . 91

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 91 breton-1.0f

\datebreton: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 92 breton-1.0g

\noextrasbreton: Deactivate shorthands ouside of Breton . . . . . . . . . . . . . . . 92 breton-1.0h

\captionsbreton: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 bulgarian-0.99

General: This is a prerelease version of this file. Features needing further testing

are removed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 bulgarian-1.0b

\extrasbulgarian: Now use \providehyphenmins to provide a default value 287

catalan-1.1

\captionscatalan: \headpagename should be \pagename . . . . . . . . . . . . . . . 180

catalan-2.0 General: Removed code to load latexhax.com . . . . . . . . . . . . . . . . . . . . . . . 180 \captionscatalan: Added some names . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 \extrascatalan: Macro completely rewritten . . . . . . . . . . . . . . . . . . . . . . . 181 \noextrascatalan: Macro completely rewritten . . . . . . . . . . . . . . . . . . . . . 181

catalan-2.0b

General: Incorporated the changes from spanish.sty . . . . . . . . . . . . . . . . . 179 catalan-2.1

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 catalan-2.1d

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . 180 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

\captionscatalan: Added a few missing translations . . . . . . . . . . . . . . . . . 180 \textacute: Renamed from \acute as that is a \mathaccent . . . . . . . . . . . . 182

catalan-2.2a General: All the code to deal with active characters is now in babel.def … 183 \extrascatalan: Handling of active characters completely rewritten . . . . . . 181 \noextrascatalan: All the code for handling active characters is now moved to

babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 catalan-2.2b

General: Changed mathmode definition of acute shorthands to expand to a single prime followed by the next character in the input . . . . . . . . . . . . . . . . . . 184 Made the activation of the grave and acute accents optional . . . . . . . . . . . 179

\captionscatalan: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . 180 \datecatalan: Month names in lowercase . . . . . . . . . . . . . . . . . . . . . . . . . . 180 \Lgem: Added support for typing the catalan “ela geminada” with the macros

\lgem and \Lgem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 \noextrascatalan: Make activating the accent characters optional . . . . . . . . 181 \up: Added definition of macro \up, which can be used to type ordinals …. 186 catalan-2.2c

General: Added ’’ as an axtra shorthand, removed ’n as a shorthand . . . . . . 184 Added shorthands for guillemets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 cedile now produced by double quote shorthand . . . . . . . . . . . . . . . . . . . 183 Removed the use of the tilde for catalan . . . . . . . . . . . . . . . . . . . . . . . . . 179

catalan-2.2d

\captionscatalan: added translation of Proof . . . . . . . . . . . . . . . . . . . . . . 180

Translations revised . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 catalan-2.2e

General: Added ‘‘ as an axtra shorthand . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

Added vertical bar as argument to active acute . . . . . . . . . . . . . . . . . . . . 184 \L.L: Added redefinition of \l and \L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 \noextrascatalan: Need to split up the \@ifpackagewith statements . . . . . 181

Now give the apostrophe a lowercase code . . . . . . . . . . . . . . . . . . . . . . . . 181 \up: Now use \textsuperscript and make \up robust . . . . . . . . . . . . . . . . 186

catalan-2.2f

General: Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 \Lgem: Added a check for math mode as the use of \lgem and \Lgem in math

mode is not sensible. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 catalan-2.2g

General: Moved the definition of \atcatcode right to the beginning. . . . . . . 179 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 180

catalan-2.2h

\noextrascatalan: Added some comment signs to prevent unwanted spaces in

the output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 catalan-2.2i

General: Removed empty groups after guillemot characters . . . . . . . . . . . . . 183 \datecatalan: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . 180

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 180 catalan-2.2k

General: A wrong \changes entry made typesetting impossible . . . . . . . . . . 179 catalan-2.2l

\noextrascatalan: Don’t forget do deactivate the shorthands . . . . . . . . . . . 181

Make sure that the grave accent has catcode 12 before it is made \active . 181 catalan-2.2m

\captionscatalan: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . 180 catalan-2.2n

\catalanhyphenmins: Set the hyphenation parameters both to two as required

by cahyph.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 croatian-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.0c

General: Removed some typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . 246

Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

\captionscroatian: Added \seename, \alsoname and \prefacename . . . . . . 246

croatian-1.2

\captionscroatian: \headpagename should be \pagename . . . . . . . . . . . . . . 246

croatian-1.3

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3d

\captionscroatian: Added a few translations . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3e

\captionscroatian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . 246 croatian-1.3f

\captionscroatian: Added translation of Proof . . . . . . . . . . . . . . . . . . . . . 246 \datecroatian: in croatian language, the genitive for the name of the month has

to be used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3g

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 247 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 246

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 246 croatian-1.3h

\datecroatian: sijev{c}nja should be seij\v{c}nja and there should be a

period after the year . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3i

\captionscroatian: Replaced some of the translations with ‘better’ words . . 246 \datecroatian: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . 246

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3j

\datecroatian: changed \od into \or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 croatian-1.3k

\captionscroatian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . 246 czech-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . . . 248 czech-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . 248 czech-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . 248

Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

\captionsczech: Added \seename, \alsoname and \prefacename . . . . . . . . . 248

czech-1.1a

\noextrasczech: Removed typo, \q was restored twice, once too many. . . . . 249 czech-1.2

General: Included some features from Kasal’s czech.sty . . . . . . . . . . . . . . . . 248 czech-1.3

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 czech-1.3d

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . 248 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

czech-1.3e

\noextrasczech: now use \bbl@frenchspacing and \bbl@nonfrenchspacing 249

Use L^{A}TEX’s \v and \r accent commands . . . . . . . . . . . . . . . . . . . . . . . . . 249 czech-1.3f

\captionsczech: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . . 248 czech-1.3g

\captionsczech: Fixed two errors and provided translation for ‘proof’ . . . . . 248 czech-1.3h

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 249 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 248

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 248 czech-1.3i

\dateczech: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 249 czech-1.3j

\captionsczech: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

danish-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . 198

Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

\captionsdanish: Added \seename, \alsoname and \prefacename . . . . . . . . 198

danish-1.2

\captionsdanish: \headpagename should be \pagename . . . . . . . . . . . . . . . . 198

danish-1.2b

\captionsdanish: Added a few translations . . . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.3

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.3a

\datedanish: Added ‘.’ to definition of \today . . . . . . . . . . . . . . . . . . . . . . 199 danish-1.3c

\captionsdanish: Included some revisions from Peter Busk Larsen . . . . . . . 198 danish-1.3f

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . 198 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

danish-1.3g

General: Added the active double quote character as suggested by Peter Busk

Laursen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.3h

\captionsdanish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . 198 \extrasdanish: Added \bbl@frenchspacing . . . . . . . . . . . . . . . . . . . . . . . . 199

\noextrasdanish: Added \bbl@nonfrenchspacing . . . . . . . . . . . . . . . . . . . 199

danish-1.3i

\captionsdanish: Added translation of ‘Proof’ . . . . . . . . . . . . . . . . . . . . . . 198 danish-1.3j

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 200 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 198

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 198 \extrasdanish: Added definition of "~ and "= . . . . . . . . . . . . . . . . . . . . . . 199

Changed definition of "' to print “ instead of ” . . . . . . . . . . . . . . . . . . . . 199 danish-1.3k

\datedanish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 199 \extrasdanish: Removed empty groups after double quote and guillemot char-

acters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 danish-1.3m

\extrasdanish: Deactivate shorthands ouside of Danish . . . . . . . . . . . . . . . 199 danish-1.3n

\captionsdanish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . 198 dutch-2.0a

General: Added checking of format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.0b

General: Added extrasdutch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.0c

General: Added grqq macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.1

General: reflect change to version 2.1 in babel and changes in german v2.3 … 74 dutch-2.1a

General: Incorporated Nico’s comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.1b

General: Incorporated more comments by Nico . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.1c

General: Fixed some typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-2.2

General: Fixed problem with the use of " in moving arguments while " is active 74 dutch-2.3

\@trema: \dieresis instead of \accent127 . . . . . . . . . . . . . . . . . . . . . . . . . . 77 General: \dieresis instead of \accent127 . . . . . . . . . . . . . . . . . . . . . . . . . . 77

When using PostScript fonts with the Adobe font-encoding, the dieresis-accent is located elsewhere, modified code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

\noextrasafrikaans: Added \dieresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 dutch-2.3a

General: Modified the documentation somewhat . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.0

General: Modified for babel 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Now use \adddialect if language undefined . . . . . . . . . . . . . . . . . . . . . . . 75 dutch-3.0a

General: Removed some problems in change log . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.0b

\extrasafrikaans: added some comment chars to prevent white space . . . . . . 76 \noextrasafrikaans: added some comment chars to prevent white space …. 76

dutch-3.1

General: Removed bug found by van der Meer . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.1a

\captionsdutch: \pagename should be \headpagename . . . . . . . . . . . . . . . . . 75

Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 \datedutch: Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 75 \extrasafrikaans: Removed \global definitions . . . . . . . . . . . . . . . . . . . . . 76 \noextrasafrikaans: Removed \global definitions . . . . . . . . . . . . . . . . . . . . 76

dutch-3.2 General: added case for "y and "Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 \extrasafrikaans: Save all redefined macros . . . . . . . . . . . . . . . . . . . . . . . . 76 \noextrasafrikaans: Try to restore everything to its former state . . . . . . . . . 76

dutch-3.2a

General: Added reset of catcode of @ before \endinput. . . . . . . . . . . . . . . . . 74

Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.2b

General: removed typo (allowhpyhens) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 dutch-3.2c

General: Removed code to load latexhax.com . . . . . . . . . . . . . . . . . . . . . . . . 74 removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74, 75 dutch-3.3

General: Rewritten parts of the code to use the new features of babel version 3.1 74 \extrasafrikaans: Macro complete rewritten . . . . . . . . . . . . . . . . . . . . . . . . 76 \noextrasafrikaans: Macro complete rewritten . . . . . . . . . . . . . . . . . . . . . . 76

dutch-3.3a \@trema: renamed \@umlaut to \@trema . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 General: Added \save@sf@q macro from germanb and rewrote all quote macros

to use it . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Moved code to the beginning of the file and added \selectlanguage call . . 74

\captionsdutch: added \seename and \alsoname . . . . . . . . . . . . . . . . . . . . . 75 dutch-3.3b

General: Added warning, if no dutch patterns loaded . . . . . . . . . . . . . . . . . . . 75 \captionsdutch: added \prefacename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

\extrasafrikaans: modified handling of \dospecials and \@sanitize . . . . . 76
\noextrasafrikaans: modified handling of \dospecials and \@sanitize . . . . 76

dutch-3.4b

General: moved definition of \allowhyphens, \set@low@box and \save@sf@q to

babel.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 dutch-3.5

\captionsdutch: \headpagename should be \pagename . . . . . . . . . . . . . . . . . 75

dutch-3.6

General: Update or LaTeX2e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.6c

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . . 75 Removed the use of \filedate, moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

dutch-3.7a

General: Moved identification code to the top of the file . . . . . . . . . . . . . . . . . 74 Moved the definition of \ij and \IJ to glyphs.def . . . . . . . . . . . . . . . . . . 77 moved the definition of the double quote character at the baseline to glyhps.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Now use \Declaredqdutch to define the functions of the active double quote 77

  Removed \dlqq, \@dlqq, \drqq, \@drqq and \dieresis . . . . . . . . . . . . . . . 77

Rewrote the code with respect to the active double quote character . . . . . . 74 The support macros for the active double quote have been moved to babel.def 77 Use \ddot instead of \@MATHUMLAUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Use more general mechanism of \declare@shorthand . . . . . . . . . . . . . . . . 77

\afrikaanshyphenmins: use \dutchhyphenmins to store the correct values . . . 77

\IJ: Changed the kerning in the faked ij to match the dc-version of it . . . . . . 49 dutch-3.7b

General: Added "" shorthand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 dutch-3.7c

\captionsdutch: We need the " to be active while defining \captionsdutch . . 75 dutch-3.7d

\captionsdutch: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . . . 75 dutch-3.7f

General: Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 dutch-3.8a

General: Merged in the definitions for ‘afrikaans’ . . . . . . . . . . . . . . . . . . . . . . 74 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 this needs a more complicated check as ‘afrikaans’ may or may not have its own hyphenation patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

\noextrasafrikaans: Made all definitions dependant on \CurrentOption …. 76 dutch-3.8b

\captionsdutch: Use Bew"ys instead of Bewijs . . . . . . . . . . . . . . . . . . . . . . . 75 dutch-3.8c

General: Added the "˜ shorthand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 dutch-3.8e

General: Added a shorthand with the slash character . . . . . . . . . . . . . . . . . . . 78 Forgot to replace ‘german’ by ‘dutch’ when copying definition for "˜ . . . . . . 77 Removed empty groups after double quote characters . . . . . . . . . . . . . . . . 77

\dateafrikaans: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . 76

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 76 \datedutch: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 75 dutch-3.8h

\afrikaanshyphenmins: Now use \providehyphenmins to provide a default value 77

\captionsdutch: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

english-2.0a

General: Added checking of format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-2.1

General: Reflect changes in babel 2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-2.1a

General: Incorporated Nico’s comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-2.1b

General: merged USenglish.sty into this file . . . . . . . . . . . . . . . . . . . . . . . . 79 english-2.1c

General: fixed typo in definition for american language found by Werenfried Spit

(nspit@fys.ruu.nl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-2.1d

General: Fixed some typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-3.0

General: Modified for babel 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Now use \adddialect for american . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Now use \adddialect if language undefined . . . . . . . . . . . . . . . . . . . . . . . 79

english-3.0a

General: Removed bug found by van der Meer . . . . . . . . . . . . . . . . . . . . . . . 79 english-3.0b

General: Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

\captionsenglish: \pagename should be \headpagename . . . . . . . . . . . . . . . . 80

Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 \dateamerican: Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . 81 \dateenglish: Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . 81

english-3.0c

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-3.0d

General: removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-3.1

General: Rewrote parts of the code to use the new features of babel version 3.1 79 english-3.1a

\captionsenglish: added \seename and \alsoname . . . . . . . . . . . . . . . . . . . 80

english-3.1b

\captionsenglish: added \prefacename . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 english-3.2

\captionsenglish: \headpagename should be \pagename . . . . . . . . . . . . . . . . 80

english-3.3

General: Update or L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 english-3.3c

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . . 79 Removed the use of \filedate and moved the identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

english-3.3d

General: Only define american as a dialect when no separate patterns have been

loaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 english-3.3e

\captionsenglish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . . 80 english-3.3g

General: Allow british as the name of the UK patterns . . . . . . . . . . . . . . . . . 79 Allow USenglish as the name of the american patterns . . . . . . . . . . . . . . . . 80

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 \captionsenglish: Construct control sequence on the fly . . . . . . . . . . . . . . . 80 \dateenglish: Construct control sequence on the fly . . . . . . . . . . . . . . . . . . . 81 \noextrasenglish: Construct control sequences on the fly . . . . . . . . . . . . . . . 81

english-3.3h

General: Moved the definition of \atcatcode right to the beginning. . . . . . . . 79 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . . 79

english-3.3i

\dateamerican: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 81 \dateenglish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 81 english-3.3j

General: Also allow american english hyphenation patterns to be used for ‘english’ 79

Ensure that \l@USenglish is alway defined . . . . . . . . . . . . . . . . . . . . . . . . 80 \captionsenglish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . 80 \dateenglish: Make sure that the value of \today is correct for both options

‘american’ and ‘USenglish’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 english-3.3k

General: Added support for canadian . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79, 80 esperant0-1.4o

\noextrasesperanto: Moved the check for math to babel.def . . . . . . . . . . . . . 72 esperanto-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . . 71 esperanto-1.0b

General: Removed use of \makeatletter . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 esperanto-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . 71

Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

\captionsesperanto: Added \seename, \alsoname and \prefacename . . . . . . 71

esperanto-1.2

General: Included code from esperant.sty . . . . . . . . . . . . . . . . . . . . . . . . . . 71 esperanto-1.3

\captionsesperanto: \headpagename should be \pagename . . . . . . . . . . . . . . 71

Repaired a number of mistakes, indicated by D. Ederveen . . . . . . . . . . . . . 71 \dateesperanto: Removed the capitals from \today . . . . . . . . . . . . . . . . . . . 72

esperanto-1.4a General: Updated for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

\captionsesperanto: added missing closing brace . . . . . . . . . . . . . . . . . . . . . 71 esperanto-1.4d

General: Removed the use of \filedate, moved Identification after loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Use \@nopatterns for the warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

esperanto-1.4e

General: Moved identification code to the top of the file . . . . . . . . . . . . . . . . . 71 esperanto-1.4f

General: Corrected typos (PR1652) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 esperanto-1.4g

\captionsesperanto: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . 71 esperanto-1.4h

General: Added a few shorthands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 esperanto-1.4i

General: Moved the definition of \atcatcode right to the beginning. . . . . . . . 71 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . . 71

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 \captionsesperanto: Replaced ‘Proof’ by ‘Pruvo’ PR 2207 . . . . . . . . . . . . . . 71

esperanto-1.4j

General: fixed typo in table caption (funtion instead of function) . . . . . . . . . . 71 esperanto-1.4k

\dateesperanto: Removed Rthe use of \edef again . . . . . . . . . . . . . . . . . . . 72

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 72 esperanto-1.4l

General: Added a shorthand definition on system level . . . . . . . . . . . . . . . . . . 72 esperanto-1.4n

\noextrasesperanto: Added a check for math mode to the definition of the short-

hand character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 esperanto-1.4p

\captionsesperanto: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . 71 estonian-1.0b

General: corrected typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 estonian-1.0c

\captionsestonian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . 243 estonian-1.0d

General: The second argument was missing in the definition of some of the double-

quote shorthands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 \captionsestonian: Added translation of ‘Proof’ . . . . . . . . . . . . . . . . . . . . 243 \noextrasestonian: Removed the code that changes category, lower case, uper

case and space factor codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 estonian-1.0e

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 245 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 242

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 242 estonian-1.0f

General: Removed empty groups after double quote and guillemot characters 245 \dateestonian: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . 243

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 243 estonian-1.0g

General: use \bbl@t@one instead of \bbl@next . . . . . . . . . . . . . . . . . . . . . . 244 estonian-1.0h

\captionsestonian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . 243

\estonianhyphenmins: Now use \providehyphenmins to provide a default value 244

finnish-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . 221 finnish-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . 221 finnish-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . 221

Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

\captionsfinnish: \headpagename should be \pagename . . . . . . . . . . . . . . . 221

Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . . . . . 221 finnish-1.1.2

\captionsfinnish: Added translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 finnish-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 finnish-1.3c

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . 221 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

finnish-1.3d

General: Removed a few references to babel.com . . . . . . . . . . . . . . . . . . . . . 221 finnish-1.3e

\datefinnish: Added a‘.’ after the number of the day . . . . . . . . . . . . . . . . . 222 finnish-1.3f

\finishhyphenmins: use \finnishhyphenmins to store the correct values . . . 223

\noextrasfinnish: Added the setting of \frenchspacing . . . . . . . . . . . . . . 222

Added the setting of more hyphenation parameters, according to PR1027 . 222 finnish-1.3g

\-: Added change of \- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 \captionsfinnish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . 221 \noextrasfinnish: Added the active double quote . . . . . . . . . . . . . . . . . . . 222

finnish-1.3h

\captionsfinnish: Added finnish word for ‘Proof’ . . . . . . . . . . . . . . . . . . . 221 finnish-1.3i

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 223 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 221

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 221 finnish-1.3k

\datefinnish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . 222

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 222 \noextrasfinnish: Removed empty groups after double quote and guillemot

characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 finnish-1.3m

\noextrasfinnish: Added misisng closing brace . . . . . . . . . . . . . . . . . . . . . 223 finnish-1.3n

\-: \allowhyphens should have been \bbl@allowhyphens . . . . . . . . . . . . . . 223

\captionsfinnish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . 221

\finishhyphenmins: Now use \providehyphenmins to provide a default value 223

\noextrasfinnish: Deactive shorthands ouside of Finnish . . . . . . . . . . . . . . 223 frenchb-1.1

General: Add some font changing definitions. . . . . . . . . . . . . . . . . . . . . . . . 120 Added \AllTeX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Added \leavevmode in \bsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Added a hook to insert space or not before ‘double punctuation’. . . . . 110, 124 Added command \bsc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Added T1-encodings for œ, Œ, æ, Æ. Do not re-define these symbols outside L^{A}TEX 2ε. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Corrected definitions of \boi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Do not redefine \^and \" in MlTEX, because it would break hyphenation. The correct place to redefine \^i and \"i is in the format itself, see MLTeX.cfg. 136 Do not use commands related to encodings outside L^{A}TEX 2ε. . . . . . . . . . . 135 Do this only in L^{A}TEX 2ε. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Special care has to be taken with MlTEX. . . . . . . . . . . . . . . . . . . . . . . . . 136

\bbl@nonfrenchguillemets: A warning is now issued if \og or \fg have been

defined elsewhere in a L^{A}TEX 2ε document (suggested by Vincent Jalby). . 125 \bbl@nonfrenchitemize: Save original definitions of label items, instead of hard

coding them in \bbl@nonfrenchitems (suggested by Vincent Jalby). . . . . 127 Tune vertical spacing in French lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

\captionsfrench: This code is useless in PlainTEX, check the format before load-

ing it. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 \degres: Added \leavevmode in the \degres’s definition . . . . . . . . . . . . . . . 135

Fixed width bounding box for correct spacing with both CM, EC and Post-Script fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

\fprimo): Avoid using math superscripts in text mode (suggested by V. Jalby), use \up instead. The symbol ‘degree’ has nothing to do in \FrenchPopularEnumerate, replace it by a small ‘o’. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

\french@sh@;@: Added a hook to insert space or not before ‘double punctuation’. 123 \ieme: \@ptsize may not be undefined, i. e. in slides.cls. . . . . . . . . . . . . . . . 133

Added 5 macros from french.sty and missing \lowercase. . . . . . . . . . . . . 134 Internal macro \up@size introduced by Johannes Braams to replace \small, too fragile in 2.09). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Use \textsuperscript in L^{A}TEX 2ε, as suggested by Vincent Jalby. . . . . . . 133

\if@Two@E: New test \if@Two@E. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 \ifLaTeXe: Use \fmtname to check the format instead of \newcommand; define

\PlainFmtName and \LaTeXeFmtName. . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 frenchb-1.1b

General: Moved the definition of \atcatcode right to the beginning. . . . . . . 110 Now use \ldf@finish to wrap up. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 118 Removed test for \l@english . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 frenchb-1.2

General: ‘french’ ‘frenchb’ and ‘francais’ are synonymous regardless of \CurrentOption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Check for hyphenation patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

New macros \nombre \decimalsep and \thousandsep added to format num-

bers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Removed \AllTeX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 The config file searched for is ‘frenchb.cfg’ regardless \CurrentOption. … 136

\bbl@nonfrenchindent: Corrected typo \bbl@nonfrenchident. . . . . . . . . . . 128
\captionsfrench: Added aliases \captionsfrenchb and \captionsfrancais. 122
\datefrench: Added aliases \datefrenchb and \datefrancais. Use \ier instead

of \up. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 \noextrasfrench: ‘french’ ‘frenchb’ and ‘francais’ are synonymous regardless of

\CurrentOption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 frenchb-1.2b

General: Spacing after opening and before closing guillemets slightly enlarged and some glue added, as suggested by Th. Bouche. Unlike \kern, \hskip doesn’t inhibit hyphenation, nothing like \allowhyphens is required. . . . . . . . . . . 125

\bbl@nonfrenchguillemets: Define \xspace as if it is not defined by D. Carlisle

‘xspace.sty’. Will be used in \fg, and \ieme ... \ieres (new for this release). 125 \ieme: Use \xspace to control spacing after \ieme ... \ieres. . . . . . . . . . . . 134 \thousandsep: Definition of \nombre changed to correct a bug with moving ar-

guments in L^{A}TEX-2.09. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Extra care taken to handle signs properly inside \nombre in L^{A}TEX 2ε. . . . . 130

frenchb-1.3

General: Added this section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Avoid mixing text- and math-mode whenever possible: check if \textminus and co. are available. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 New implementation of guillemets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Use \r to access the character ‘degree’, as suggested by V. Jalby. . . . . . . . 135 Use \textbackslash to define \boi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

\bbl@nonfrenchitemize: Change -- to \textendash, completely redesign the itemize environment in French and add a hook to switch back to \LaTeXe standard itemize lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

\bbl@nonfrenchlistspacing: Add a switch to allow \LaTeXe standard settings. 126

\nombre: Added \@empty to the definitions of \nb@first and \nb@suite, as

suggested by V. Jalby, to cope with possibly empty integer part as in \nombre,123. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

frenchb-1.3b

\datefrench: Use \edef to define \today to save memory . . . . . . . . . . . . . . 136 frenchb-1.3c

General: changed \@makecaption definition to add a hook \CaptionSeparator. 120

\captionsfrench: Added \CaptionSeparator. . . . . . . . . . . . . . . . . . . . . . . 122

\fprimo): Typos corrected: quatro, fquatro . . . . . . . . . . . . . . . . . . . . . . . . 134 frenchb-1.3d

General: Spacing after opening and before closing guillemets changed again: nor-

mal space with little glue (suggested by Th. Bouche). . . . . . . . . . . . . . . . 125 \datefrench: Move this code to the end of file, until \ier is defined (due to use

of \edef); expansion of \ier has to be stopped anyway. . . . . . . . . . . . . . 136 frenchb-1.3e

General: Try to use AMS Cyrillic fonts to provide better looking guillemets in

OT1 encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 frenchb-1.3f

General: Deleted sectioning command \section{About French Typography}. 110 \ifLaTeXe: Use \magnification to check if the format is plain (i.e not L^{A}TEX).

Checking the format’s name was not reliable: plain-like formats may not be called just ‘plain’ but ‘babel-plain’. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

frenchb-1.3g

\datefrench: Replaced \edef with \def to prevent problems with unexpandable

accent commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 frenchb-1.4

General: Add a hook to let the comma be in math-mode of type \mathord in French, as a decimal separator should be. . . . . . . . . . . . . . . . . . . . . . . . . 129 Add a hook to pick French guillemets from any font (suggested by Michel Bovani). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Add definitions for \at, \circonflexe and \tild in other encodings (mlTeX’s LO1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Added this section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

\bbl@nonfrenchitemize: \newif only in LaTeX. . . . . . . . . . . . . . . . . . . . . . 127 Add a hook \FrenchLabelItem which defaults to \textendash, this was suggested by Michel Bovani to allow some customization of label items. . . . . 127

frenchb-1.4a

General: frenchb-1.3 silently redefined \@makecaption, overwriting changes made by some classes like koma-script, ua-thesis… (pointed out by Werner Lemberg). New implementation suggested by Vincent Jalby. . . . . . . . . . . . . . 121

\captionsfrench: Changed ‘–’ to \textendash in \CaptionSeparator in case the

ligature doesn’t exist (tt-fonts). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 frenchb-1.4c

General: Bug correction: \xspace didn’t work in \dots without amsmath.sty. 132 frenchb-1.4d

General: AMS-LaTeX 2.0 provides a much better spacing for \dots than 1.2, so let’s take advantage of it when amsmath (up to 1.2 or newer) is loaded… 132 Do NOT set catcodes of French quotes to 12 before launching \initiate@active@char in frenchb.cfg, (problem on Mac reported by M.Bovani). . . . . . . . . . . . . . 115

\datefrench: Changed \noexpand\ier to \ier, as a result of the replacement of \edef by \def, see previous change. Also add braces around \ier for xspace.sty. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

frenchb-1.4e

General: Captions print twice with AMS classes (amsart, amsbook). Bug reported by Jean-François Mertens. Revert to implementation of version 1.4, which is safer as makecaption can be changed unpredictably. . . . . . . . . . . . . . . . . 121

frenchb-1.4f General: Only issue a warning if \@makecaption exists . . . . . . . . . . . . . . . . 121 \captionsfrench: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . 122

frenchb-1.4g

\thousandsep: Added a new hook \ThinSpaceInFrenchNumbers to have thin

spaces instead of normal spaces (the default) when formatting French numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

frenchb-1.5a

\bbl@nonfrenchitemize: Redesign \itemize to allow users to change the markers

of any level in itemize lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

\bbl@nonfrenchlistspacing: Redefine \list instead of \@trivlist to provide

more freedom to the user, but still allow the former way with \ifFrenchOldTrivlist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

frenchb-1.5b

General: Added support for canadien and acadian . . . . . . . . . . . . . . . . . . . . 118 frenchb-1.5d

General: Load frenchb.cfg first and change \ldf@finish to \ldf@quit. . . . . . 136 The internal name for the French language is changed from ‘frenchb’ to ‘french’. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

galician-1.1

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 galician-1.1c

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . 187 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

\textacute: Renamed from \acute as that is a \mathaccent . . . . . . . . . . . . 189 \texttilde: Renamed from \tilde as that is a \mathaccent . . . . . . . . . . . . 189 galician-1.1d

\captionsgalician: Added a few missing translations . . . . . . . . . . . . . . . . . 187 \dategalician: Corrected the name of the month marzo from marzal . . . . . 188

galician-1.2a \extrasgalician: Handling of active characters completely rewritten . . . . . . 188 \noextrasgalician: All the code for handling active characters is now moved to

babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 galician-1.2b

General: Changed mathmode definition of acute shorthands to expand to a single

prime followed by the next character in the input . . . . . . . . . . . . . . . . . . 190 \captionsgalician: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . 187

galician-1.2c

\noextrasgalician: Make active accent optional . . . . . . . . . . . . . . . . . . . . 188 galician-1.2d

General: Added ’’ as an axtra shorthand . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 \noextrasgalician: Need to split up the \@ifpackagewith statement . . . . . 188

galician-1.2e

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 191 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 187

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. 187 galician-1.2f

General: Added \leavevmode to definitions of "a and "o . . . . . . . . . . . . . . . 190 \noextrasgalician: Added some comment signs to prevent unwanted spaces in

the output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 galician-1.2h

\dategalician: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . 188

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . 188 galician-1.2i

\noextrasgalician: Don’t forget do deactivate the shorthands . . . . . . . . . . 188 galician-1.2j

\captionsgalician: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . 187 galician-1.2k

\captionsgalician: Translated Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 germanb-1.0a

General: Incorporated Nico’s comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-1.0b

General: fixed typo in definition for austrian language found by Werenfried Spit

nspit@fys.ruu.nl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-1.0c

General: Fixed some typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-1.1

General: When using PostScript fonts with the Adobe fontencoding, the dieresis-

accent is located elsewhere, modified code . . . . . . . . . . . . . . . . . . . . . . . . 82 \noextrasaustrian: Added \dieresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

germanb-1.1a

General: Modified the documentation somewhat . . . . . . . . . . . . . . . . . . . . . . 82 germanb-2.0

General: Modified for babel 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Now use \adddialect for austrian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Now use \adddialect if language undefined . . . . . . . . . . . . . . . . . . . . . . . 83

germanb-2.0a General: Removed some problems in change log . . . . . . . . . . . . . . . . . . . . . . 82 germanb-2.0b

\extrasaustrian: added some comment chars to prevent white space . . . . . . 84 \noextrasaustrian: added some comment chars to prevent white space . . . . . 84

germanb-2.1

General: Removed bug found by van der Meer . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-2.2

General: Removed global assignments, brought uptodate with german.tex v2.3d 82

\captionsaustrian: \pagename should be \headpagename . . . . . . . . . . . . . . . 83

Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 \extrasaustrian: Save all redefined macros . . . . . . . . . . . . . . . . . . . . . . . . . 84 \noextrasaustrian: Try to restore everything to its former state . . . . . . . . . . 84

germanb-2.2a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-2.2d

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 germanb-2.3

General: Rewritten parts of the code to use the new features of babel version 3.1 82 germanb-2.3e

General: Added \save@sf@q macro and rewrote all quote macros to use it … 84 Added warning, if no german patterns loaded . . . . . . . . . . . . . . . . . . . . . . 83 Brought up-to-date with german.tex v2.3e (plus some bug fixes) [br] . . . . . 82

\captionsaustrian: Added \prefacename, \seename and \alsoname . . . . . . . 83

\dategerman: Added \month@german . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 germanb-2.3h

General: moved definition of \allowhyphens, \set@low@box and \save@sf@q to

babel.com . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 germanb-2.4

\captionsaustrian: \headpagename should be \pagename . . . . . . . . . . . . . . . 83

germanb-2.5

General: Update or L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 germanb-2.5c

General: Now use \@nopatterns to produce the warning . . . . . . . . . . . . . . . . 83 Removed the use of \filedate and moved the identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

germanb-2.6a

General: \umlautlow and \umlauthigh moved to glyphs.dtx, as well as \newumlaut

(now \lower@umlaut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Moved all quotation characters to glyphs.dtx . . . . . . . . . . . . . . . . . . . . . . 84 Moved the identification to the top of the file . . . . . . . . . . . . . . . . . . . . . . 82 Rewrote the code that handles the active double quote character . . . . . . . . 82 Use \ddot instead of \@MATHUMLAUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

\noextrasaustrian: All the code to handle the active double quote has been moved to babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Removeed \3 as it is no longer in german.ldf . . . . . . . . . . . . . . . . . . . . . . 84 use \germanhyphenmins to store the correct values . . . . . . . . . . . . . . . . . . . 84

germanb-2.6b

\captionsaustrian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . . 83 germanb-2.6c

General: added the \allowhyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

Moved \german@dq@disc to babel.def, calling it \bbl@disc . . . . . . . . . . . . . 85 \noextrasaustrian: Use decimal number instead of hat-notation as the hat may

be activated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 germanb-2.6d

General: Moved the definition of \atcatcode right to the beginning. . . . . . . . 82 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . . 82

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 \captionsaustrian: Construct control sequence on the fly . . . . . . . . . . . . . . 83

\noextrasaustrian: Construct control sequence \extrasgerman or \extrasaustrian

on the fly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 germanb-2.6f

General: Copied the coding for "f from german.dtx version 2.5d . . . . . . . . . . 85

use \SS instead of SS, removed braces after \ss . . . . . . . . . . . . . . . . . . . . . 85 \ck: Now use \shorthandon and \shorthandoff . . . . . . . . . . . . . . . . . . . . . . 86 \dateaustrian: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . 84

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 84 \dategerman: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . . . . . . 83 germanb-2.6i

\noextrasaustrian: Deactivate shorthands ouside of German . . . . . . . . . . . . 84 germanb-2.6j

\captionsaustrian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . 83

\noextrasaustrian: Now use \providehyphenmins to provide a default value 84

germanb-2.6k

\noextrasaustrian: Turn frenchspacing on, as in german.sty . . . . . . . . . . . . 84 greek-1.0b

General: Moved the definition of \atcatcode right to the beginning . . . . . . . 101 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . . . . . . . 102

  Replaced \undefined with \@undefined and \empty with \@empty for consist-

ency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 \textgreek: Added a level of braces to keep encoding change local . . . . . . . . 103

greek-1.0c

\greek@tilde: Added command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 greek-1.1

\Grtoday: Added macro \Grtoday . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 greek-1.1a

\dategreek: Fixed typo, Oktwbr'iou instead of Oktobr'iou . . . . . . . . . . . . 104 \greek@Alph: removed two superfluous @’s which made \@alph undefined . . 106

greek-1.1b

\noextrasgreek: Added setting of \uccodes (after kdgreek.sty) . . . . . . . . . 108 Added shorthand for \char255 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Made tilde expand to a tilde with \catcode 12 . . . . . . . . . . . . . . . . . . . . 109

greek-1.1c General: Added a couple of symbols, needed for \greeknumeral . . . . . . . . . . 109 \noextrasgreek: fixed two typos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

greek-1.1d

\dategreek: Macro \gr@month now produces the name of the month . . . . . . 104 greek-1.1e

General: Added caption name for proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

Most symbols are removed and are now defined in package grsymb . . . . . . 109 \gr@month: Macro added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 \noextrasgreek: Added lowercase code for v . . . . . . . . . . . . . . . . . . . . . . . 108

Added uppercase code for special letter “v”. Uppercase code for accents is now 9f, instead of ff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Shorthand is changed. Active character is now \char159 . . . . . . . . . . . . . 108 greek-1.2

General: Added caption names for \polutonikogreek . . . . . . . . . . . . . . . . . 104

Classical Greek is now a dialect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 \gr@c@greek: Added macro \datepolutonikogreek . . . . . . . . . . . . . . . . . . . 104

Added macro \gr@cl@month . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 \noextrasgreek: Added lowercase codes for “modern” greek . . . . . . . . . . . . 108

Added uppercase codes for “modern” Greek. The old codes are now for “Polutoniko” Greek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Definitions for “modern” Greek are now the definitions of “Polutoniko” Greek 108

greek-1.2a General: filename lgrenc.def now lowercase . . . . . . . . . . . . . . . . . . . . . . . . 103 \dategreek: Use \edef to define \today . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 \noextrasgreek: Need shorthand to exist for “monotoniko” Greek, not “polutoniko”

Greek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 greek-1.2b

General: Classical Greek is now called “Polutoniko” Greek. The previous name

was at least misleading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 \dategreek: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 \gr@num@iii: No longer use \ in the expansion of the \gr@num@x macros as they

ned to be expandable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 greek-1.2c

General: 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 This version conforms to version 2.0 of the CB fonts and consequently we added a few new symbol-producing commands . . . . . . . . . . . . . . . . . . . . . . . . . 101

greek-1.2e

\greek@Roman: Moved redefinition of \@roman back to the language specific file 106 greek-1.2f

\ltx@amp: Now switch the definition of \& from \extrasgreek . . . . . . . . . . . 107 greek-1.3a

General: polutoniko is now an attribute to Greek, no longer a ‘dialect’ . . . . . 101 \gr@c@greek: removed macro \datepolutonikogreek . . . . . . . . . . . . . . . . . 104

greek-1.3b

\greeknumeral: Added \expandafter and \number (PR3000) in order to make a

counter an acceptable argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 greek-1.3c

\ltx@amp: Added a missing opening brace . . . . . . . . . . . . . . . . . . . . . . . . . . 107 greek-1.3d

General: Fixed typo, bl'epe ep'ishc instead of bl'pe ep'ishc . . . . . . . . . 103

Fixed typo, bl'epe >ep'ishc instead of bl'pe >ep'ishc . . . . . . . . . . . . 104

\greek@Roman: \@roman and \@Roman need to be added to \extraspolutonikogreek

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 greek-1.3e

\greek@Roman: \@roman and \@Roman need not be in \extraspolutonikogreek

when they are already in \extrasgreek . . . . . . . . . . . . . . . . . . . . . . . . . 106

\noextrasgreek: \extrasgreek and \extraspolutonikogreek should be com-

plementary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 greek-1.3f

General: Added some code to make older documents work . . . . . . . . . . . . . . 102 greek-1.3g

General: \noextraspolutonikogreek was missing . . . . . . . . . . . . . . . . . . . . 102 \noextrasgreek: uc code of \| is now just \| to reflect recent changes in the cb

fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 greek-1.3h

\captionsgreek: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

\greekhyphenmins: Now use \providehyphenmins to provide a default value 103

greek-1.3i \captionsgreek: The final sigma in all names appears as ‘s’ instead of ‘c’… 103 \noextrasgreek: uc code of ‘v’ is switched to V so that mixed text appears

correctly in headers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 greek-1.3j

\noextrasgreek: Because other languages might make the caret active, we can’t use the double caret notation here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Ues the tilde as an alias for character 159 . . . . . . . . . . . . . . . . . . . . . . . . 108

heb209 1.0a

General: Initial version. Provides hebrew_newcode, hebrew_oldcode and hebrew_p

style files for L^{A}TEX 2.09 (by Boris Lavva) . . . . . . . . . . . . . . . . . . . . . . . . 369 hebfdd-1.0b

General: let sin in mathmode produce what it is expected to produce... 362 hebfdd 1.0a

General: Initial version. Supports only 7-bit LHE font encoding and

all available Hebrew TEX fonts (by Boris Lavva) . . . . . . . . . . 359 hebinp 1.0a

General: Initial version. Provides 8859-8, cp862, cp1255, and old 7-

bit input encodings (by Boris Lavva) . . . . . . . . . . . . . . . . . . . . 353 hebrew-2.0b

\captionshebrew: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 315 hebrew 0.1

General: Preliminary L^{A}TEX Hebrew option (by Sergio Fogel) … 313 hebrew 0.2

General: Corrections and additions (by Rama Porrat) . . . . . . . . 313 hebrew 0.6

General: Additions (by Yael Dubinsky) . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.2

General: Bilingual tables, penalties, documentation and more changes

(by Yaniv Bargury) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.30

General: Font selection, various (by Alon Ziv) . . . . . . . . . . . . . . 313 hebrew 1.31

General: Bug fixes (by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.32

General: Made font-change command for numbers ‘\protect’ed (by

Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.33

General: Made \refstepcounter work using \@ltor (by Alon Ziv) . . 313 hebrew 1.34

General: Moved font loading to another file. Added \mainsec. Made all text strings be produced by control codes (similar to L^{A}TEX2.09 Mar ’92). Fixed \noindent (by Alon Ziv) . . . . . . . . . . 313

hebrew 1.35

General: Moved the texts to a file selected by the current encoding

(by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.36

General: Use TEX tricks to redefine \theXXXX without keeping old definitions. Use only \@eng for direction/font change (removed \@ltor). Switched from use of \mainsec to code taken from babel system (by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

hebrew 1.37

General: Use \add@around in defining font size commands. Small bug

fixes (by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.38

General: \everypar changed so that \noindent works unmodified (by

Alon Ziv, thanks to Chris Rowley) . . . . . . . . . . . . . . . . . . . . . 313 hebrew 1.39

General: Redefined primitive sectioning commands. Changed \include so it finds .h, .xet, and .ltx files (no extension needed). Reinstated use of \@ltor (by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . 313

hebrew 1.40

General: Added the \@brackets hack (by Alon Ziv) . . . . . . . . . . . . 313 hebrew 1.41

General: Reworked towards using NFSS2. Changed some macro names to be more logical: renamed \@ltor to \@number, \@eng to \@latin, and (in hebrew.ldf) \@heb to \@hebrew (by Alon Ziv) . . . . . . . . . 313

hebrew 1.42

General: Made list environments work better. Fixed thebiblio-

graphy environment (by Alon Ziv) . . . . . . . . . . . . . . . . . . . . . . 313 hebrew 2.0a

General: Completely rewritten for L^{A}TEX 2ε and babel support. Various input and font encodings (with NFSS2) are supported too. The original 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 .dtx and .fdd files, and L^{A}TEX-driven installation with hebrew.ins (by Boris Lavva) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

hebrew 2.0b

\hebrewhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 hebtech 0.1

General: Initial version. Provides hebtech.sty style file for L^{A}TEX2.09 with support for old 7-bit encoding only. Only English language thesis with Hebrew cover, title and abstract pages is supported (by Irina Abramovici) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

hebtech 1.0a

General: L^{A}TEX 2ε changes and updates. Now it is hebtech.cls L^{A}TEX 2ε document class, which supports all available input and font encodings and thesis written both in Hebrew and English (by Boris Lavva) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

icelandic-1.1

General: Added definitions for old icelandic. . . . . . . . . . . . . . . . 205 icelandic-1.1a

General: Added definitions for formatting numbers in Icelandic and

some extra utilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 icelandic-1.1b

General: Added references to various publications used . . . . . . . 206 icelandic-1.1c

General: Removed code already present in babel.def . . . . . . . . . . 201 \dateicelandic: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . 204

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 204 icelandic-1.1e

\noextrasicelandic: Deactivate shorthands ouside of Icelandic … 203 icelandic-1.1f

\captionsicelandic: Added \glossaryname . . . . . . . . . . . . . . . . . . . . 203
\noextrasicelandic: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 irish-1.0b

General: Corrected typo (PR1652) . . . . . . . . . . . . . . . . . . . . . . . . 97 irish-1.0c

\captionsirish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . . 97 irish-1.0e

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . 98 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . 97

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

irish-1.0f \captionsirish: Added missing translations provided in PR 2719 … 97 \dateirish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . 98

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . 98 \irishhyphenmins: Added definition of \hyphenmins . . . . . . . . . . . . . . 97

irish-1.0h \captionsirish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . 97

\irishhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 italian-0.99

General: First version, from english.doc . . . . . . . . . . . . . . . . . . . 137 italian-1.0

General: Modified for babel 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . 137

Now use \adddialect if language undefined . . . . . . . . . . . . . . . . 138 italian-1.0a

General: removed typo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 italian-1.0b

General: Removed bug found by van der Meer . . . . . . . . . . . . . . . 137 italian-1.0c

\captionsitalian: \pagename should be \headpagename . . . . . . . . . . . . 138

Removed \global definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 \dateitalian: Removed \global definitions . . . . . . . . . . . . . . . . . . . 139

italian-1.0d

\captionsitalian: ‘contiene’ substitued by ‘Allegati’ as suggested by

Marco Bozzo (BOZZO@CERNVM). . . . . . . . . . . . . . . . . . . . . . . . . . . 138 italian-1.0e

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . 137 italian-1.0h

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 138 italian-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 137

\captionsitalian: \headpagename should be \pagename . . . . . . . . . . . . 138
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 138

italian-1.2 General: Update for LaTeXe . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 italian-1.2b

\captionsitalian: Changed some of the words following suggestions

from Claudio Beccari . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 \italianhyphenmins: Added setting of left and righthyphenmin ac-

cording to Claudio Beccari’s suggestion . . . . . . . . . . . . . . . . . 139 \noextrasitalian: Added setting of club- and widowpenalty . . . . . 139

Added setting of finalhyphendemerits . . . . . . . . . . . . . . . . . . . . 139 italian-1.2e

General: Now use \@nopatterns to produce the warning . . . . . . . . 138 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

italian-1.2f

General: Updated for babel 3.5 . . . . . . . . . . . . . . . . . . . . . . . . . . 137 italian-1.2g

\captionsitalian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . 138 italian-1.2h

\captionsitalian: Added translation of ‘Proof’ . . . . . . . . . . . . . . . 138 \noextrasitalian: Now give the apostrophe a lowercase code …. 139

italian-1.2i

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 146 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 138

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

italian-1.2j

General: Added braces around second arg of \LdfInit . . . . . . . . . 138 italian-1.2l

General: Added \unit, \ap, and \ped macros . . . . . . . . . . . . . . . . . 137

Added useful macros for fulfilling ISO 31/XI regulations …. 142 \noextrasitalian: Changed example “begl’italiani” (obsolete spelling)

with another, “nell’altezza”, that behaves the same way . . . . . 139 italian-1.2m

General: Added support for etymological hyphenation . . . . . . . . 137

Support for etymological hyphenation . . . . . . . . . . . . . . . . . . . 139

\italianhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 italian-1.2n

General: Added several commands for the caporali double quotes and for simplifying the accented vowel input . . . . . . . . . . . . . 137 Completely modified etymological hyphenation facility . . . . . . 137 Completely new etymological hyphenation facility . . . . . . . . . . 140

italian-1.2o General: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

latin-0.99

General: Added shortcuts for breve, macron, and etymological hyphenation (CB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 First version, from italian.dtx (CB) . . . . . . . . . . . . . . . . . . . . . 147

latin-1.2

General: Added suggestions from Krzysztof Konrad Żelechowski

(CB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 latin-2.0

General: Completely new etymological hyphenation (CB) . . . . . . 147 latin-2.0a

General: Revised by JB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

\latinhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 latin-2.0b

General: Simplified shortcuts for etymological hyphenation; modified breve and macro shortcuts; language attribute medieval declared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

lsorbian-0.1

General: First version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 lsorbian-1.0b

\captionslsorbian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . 304 lsorbian-1.0d

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 305 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 304

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

lsorbian-1.0e

\newdatelsorbian: use \def instead of \edef . . . . . . . . . . . . . . . . . . 304

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 304 lsorbian-1.0f

\captionslsorbian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . 304

magyar-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . 224 magyar-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 225 magyar-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 224

\captionsmagyar: \headpagename should be \pagename . . . . . . . . . . . . . 226
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 226

magyar-1.1c \captionsmagyar: Added translations, fixed typos . . . . . . . . . . . . . 226 \ondatemagyar: The date number should not be followed by a dot. 226

magyar-1.1d General: Further spelling corrections . . . . . . . . . . . . . . . . . . . . . 224 \datemagyar: Rewritten to produce the correct date format …. 226 \ondatemagyar: Renamed from \datemagyar; nolonger redefines \today. 226

magyar-1.1e

General: Still more spelling corrections . . . . . . . . . . . . . . . . . . . 224 magyar-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 magyar-1.3c

General: Now use \@nopatterns to produce the warning . . . . . . . . 225 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

magyar-1.3e

\captionsmagyar: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . 226 magyar-1.3f

\captionsmagyar: translated Proof and replaced some translations 226 magyar-1.3g

General: Replaced \undefined with \@undefined and \empty with \@empty

for consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 magyar-1.3h

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 241

Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 225 magyar-1.4a

General: order inverting in headings/titles/captions; definite art-

icle handling; active char for special hyphenation . . . . . . . . . 224 \captionsmagyar: the initial letter of fejezet, táblázat, rész, lásd

changed to lowercase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 \datemagyar: Use \number\day instead of \ifcase construct . . . . . . . 226

magyar-1.4b \captionsmagyar: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 226

ngermanb-2.6f

General: Renamed from germanb.ldf; language names changed from

   german and austrian to ngerman and naustrian. . . . . . . . . . . . . . . . 87

ngermanb-2.6j

\noextrasnaustrian: Deactivate shorthands ouside of German . . . . . 88 ngermanb-2.6k

\captionsnaustrian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . 87
\noextrasnaustrian: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 ngermanb-2.6m

\noextrasnaustrian: Turn frenchspacing on, as in german.sty . . . . . . . 89 norks-2.0h

\captionsnynorsk: Changed \ccname and \alsoname . . . . . . . . . . . . . . 211

norsk-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . 210 norsk-1.0c

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 210 norsk-1.1a

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 210

\captionsnorsk: Added \seename, \alsoname and \prefacename . . . . . . 211
\captionsnynorsk: Added \seename, \alsoname and \prefacename . . . . . 211

norsk-1.1b

\captionsnorsk: \headpagename should be \pagename . . . . . . . . . . . . . 211
\captionsnynorsk: \headpagename should be \pagename . . . . . . . . . . . . 211

norsk-1.1c

General: Added a couple of translations (from Per Norman Oma,

TeX@itk.unit.no) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 norsk-1.2a

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 norsk-1.2d

General: Now use \@nopatterns to produce the warning . . . . . . . . 210 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

norsk-1.2f \captionsnorsk: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . . 211 \norskhyphenmins: Added setting of hyphenmin parameters . . . . . . . 210 norsk-1.2g

\captionsnorsk: Replaced ‘Proof’ by its translation . . . . . . . . . . . 211 \captionsnynorsk: Replaced ‘Proof’ by its translation . . . . . . . . . . 211

norsk-1.2h

General: Moved the definition of \atcatcode right to the beginning. 210 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 213 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 210

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 norsk-1.2i

\datenorsk: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . 212

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 212 norsk-2.0a

General: Describe the use of double quote as active character . 210

Made double quote character active . . . . . . . . . . . . . . . . . . . . 212 \norskhyphenmins: Changed setting of hyphenmin parameters to 2 2 210

norsk-2.0b

General: added the french double quotes . . . . . . . . . . . . . . . . . . 213

Copied the coding for "f from germanb.dtx version 2.6g . . . . . . 213 norsk-2.0c

General: Deactivate shorthands ouside of Norsk . . . . . . . . . . . . . 212 norsk-2.0d

General: Shorthands are the same for both spelling variants, no need to use \CurrentOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Use \bbl@allowhyphens in "- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

norsk-2.0e \captionsnorsk: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 211 \captionsnynorsk: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 211

\norskhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 norsk-2.0g

\captionsnorsk: Replaced ‘Glossary’ by its translation . . . . . . . . . 211 \captionsnynorsk: Replaced ‘Glossary’ by its translation . . . . . . . 211

polish-1.0a

\textpl: Initially execute ‘textpl . . . . . . . . . . . . . . . . . . . . . . . . . 253 polish-1.1c

General: Now use \@nopatterns to produce the warning . . . . . . . . 250 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

polish-1.1d

General: The dqmacro for C used \'c . . . . . . . . . . . . . . . . . . . . . . 254 polish-1.2a

General: Don’t modify \rm and friends for L^{A}TEX 2ε, take \selectfont

instead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 polish-1.2b

\captionspolish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . 250 polish-1.2d

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 255 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 250

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 \Eob: Use the constructed version of the characters only in OT1;

use proper characters in T1. . . . . . . . . . . . . . . . . . . . . . . . . . . 252 \skb: \skb is meant to be used in horizontal mode; so leave vertical

mode if necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 \sob: This macro is meant to be used in horizontal mode; so leave

vertical mode if necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 \spb: \spb is meant to be used in horizontal mode; so leave vertical

mode if necessary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 polish-1.2e

General: Removed empty groups after double quote and guillemot

characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 polish-1.2f

\captionspolish: Added translation for Proof and changed transla-

tion of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 \datepolish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . 251

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 251

\mdqoff: Now use \shorthandon and \shorthandoff . . . . . . . . . . . . . . 255

polish-1.2h

\noextraspolish: Deactivate shorthands ouside of Polish . . . . . . . . 251 polish-1.2i

\captionspolish: \bibname and \refname were swapped . . . . . . . . . . . 250

Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 \datepolish: A missing comment character caused an unwanted space

character in the output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 polish-1.2j

\polishzx: Added support for two notationstyles for kropka and ac-

cented z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 portuges-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . 153 portuges-1.0b

General: Removed use of cs@ifundefined . . . . . . . . . . . . . . . . . . . 153 portuges-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 153

\captionsportuges: \headpagename should be \pagename . . . . . . . . . . . 154
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 154

portuges-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 portuges-1.2d

General: Now use \@nopatterns to produce the warning . . . . . . . . 153 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

portuges-1.2e

\captionsportuges: Added a few missing translations . . . . . . . . . . . 154 portuges-1.2g

General: Enhanced support for brasilian . . . . . . . . . . . . . . . . . . . 153 \captionsbrazil: The captions for brasilian and portuguese are dif-

ferent now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 \extrasportuges: Added the definition of some " shorthands . . . . . 156 \ord: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 \orda: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 \portugeshyphenmins: Added setting of hyphenmin values . . . . . . . . 156 \ra: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

\ro: Added macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 portuges-1.2h

\captionsportuges: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . 154 portuges-1.2i

\captionsbrazil: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . 155 \captionsportuges: Substituted ‘Prova’ for ‘Proof’ . . . . . . . . . . . . 154

portuges-1.2j

General: Moved the definition of \atcatcode right to the beginning. 153 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 153 ow use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . . 157

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 portuges-1.2k

\datebrazil: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . 155

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 155 \dateportuges: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . 155

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 155 \noextrasportuges: Removed empty groups after guillemot charac-

ters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 portuges-1.2m

\captionsbrazil: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 155

\captionsportuges: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . 155

\noextrasportuges: Deactivate shorthands ouside of Basque . . . . . . 156

\portugeshyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 portuges-1.2n

\datebrazil: Removed spurious space after dezembro . . . . . . . . . . . 155 \dateportuges: Removed spurious space after Dezembro . . . . . . . . . 155

portuges-1.2o

\portugeshyphenmins: Set \righthyphenmin to 3 if not provided by the

pattern file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

romanian-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . 196 romanian-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 196 romanian-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 196

\captionsromanian: \headpagename should be \pagename . . . . . . . . . . . 196
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 196

Translation errors found by Robert Juhasz fixed . . . . . . . . . . . 196 \dateromanian: Translation errors found by Robert Juhasz fixed . 196

romanian-1.2

General: Update for LaTeX2e . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 romanian-1.2d

General: Now use \@nopatterns to produce the warning . . . . . . . . 196 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

romanian-1.2e

General: Updated for babel release 3.5 . . . . . . . . . . . . . . . . . . . . 196 romanian-1.2f

\captionsromanian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . 196 romanian-1.2g

\captionsromanian: Added translation of ‘Proof’ . . . . . . . . . . . . . . 196 romanian-1.2h

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 197 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 196

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

romanian-1.2i

\dateromanian: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . 196

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 196 romanian-1.2k

\captionsromanian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . 196

russianb-1.1a

\extrasrussian: Use \ddot instead of \@MATHUMLAUT . . . . . . . . . . . . . . 273

use \russianhyphenmins to store the correct values . . . . . . . . . . 275 Use the new mechanism for dealing with active characters … 271

\russian@sh@?@: Use new \DefineActiveNoArg . . . . . . . . . . . . . . . . . . 272

Use the more general mechanism of \declare@shorthand . . . . . . . 272 \system@sh@;@: Added system level shorthands . . . . . . . . . . . . . . . . 273

russianb-1.1b \extrasrussian: Added switch to LWN encoding . . . . . . . . . . . . . . . . 270 \russian@sh@?@: Updated to reflect the latest french definitions . 272 \verbatim@font: Added changing of \verbatim@font . . . . . . . . . . . . . 270

russianb-1.1c

General: Replaced \undefined with \@undefined and \empty with \@empty

for consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 russianb-1.1d

General: Moved the definition of \atcatcode right to the beginning. 264 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 277 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 265

russianb-1.1e

General: Added closing brace to second argument of \LdfInit . . 265 russianb-1.1f

General: Added definitions of Cyrillic emdash stuff and thinspace 264 \extrasrussian: Add commands for switch on/off doublequote active-

ness. Borrowed from german. . . . . . . . . . . . . . . . . . . . . . . . . . 275 Add macro for thinspace between initials . . . . . . . . . . . . . . . . . 275 Added a hook to insert space or not before ‘double punctuation’ (from frenchb). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271, 272 Rearranging of cyrillic emdash stuff . . . . . . . . . . . . . . . . . . . . 274

\FDPoff: One more chance to avoid spaces before double punctuation 273 \russian@sh@?@: changed to kern.1em (space bit thinner) . . . . . . . . 272

Added a hook to insert space or not before ‘double punctuation’ (from frenchb). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

russianb-1.1k

General: replaced all \penalty\@M with \nobreak . . . . . . . . . . . . . . 264 russianb-1.1l

General: Made not using inputenc a warning instead of an error 268 russianb-1.1m

\captionsrussian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 270

\extrasrussian: Now use \providehyphenmins to provide a default value

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 russianb-1.1n

General: As this code generates a textfont 7 error it is commented out for now. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267

samin-1.0b \captionssamin: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 219

\saminhyphenmins: use \providehyphenmins . . . . . . . . . . . . . . . . . . . . . 219

samin-1.0c

\captionssamin: Provided the translation for glossary . . . . . . . . . 219 scottish-1.0b

General: Corrected typos (PR1652) . . . . . . . . . . . . . . . . . . . . . . . . 99 scottish-1.0c

\captionsscottish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . 99 scottish-1.0d

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 100 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . 99

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

scottish-1.0e

\datescottish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . 99

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . 99 scottish-1.0g

\captionsscottish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 99

serbian-1.0b

General: Added suggestions for shorthands and so on from Jankovic

Slobodan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 \noextrasserbian: Introduced the active " . . . . . . . . . . . . . . . . . . . 257

serbian-1.0c

\noextrasserbian: Deactivate shorthands ouside of Serbian . . . . . . 257 serbian-1.0d

\captionsserbian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 256 \noextrasserbian: Changed definition of "- to be the same as for other

languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 slovak-1.0

General: First version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 slovak-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 slovak-1.2b

\noextrasslovak: Added setting of left- and righthyphenmin . . . . . 260 slovak-1.2d

General: Now use \@nopatterns to produce the warning . . . . . . . . 259 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

slovak-1.2e

\noextrasslovak: Now use \slovakhyphenmins . . . . . . . . . . . . . . . . . . 260

Use L^{A}TEX’s \v accent command . . . . . . . . . . . . . . . . . . . . . . . . . 260 slovak-1.2g

\captionsslovak: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . . 259 slovak-1.2i

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 260 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 259

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

slovak-1.2j

\dateslovak: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . 259

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 259 slovak-1.2k

\captionsslovak: Repaired a few spelling mistakes . . . . . . . . . . . . . 259 \dateslovak: Repaired a spelling mistake . . . . . . . . . . . . . . . . . . . . 259

slovak-1.2l \captionsslovak: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . 259

\noextrasslovak: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 slovene-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . 261 slovene-1.0b

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 261 slovene-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 261

\captionsslovene: \headpagename should be \pagename . . . . . . . . . . . . 261
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 261

slovene-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 slovene-1.2b

\captionsslovene: Added extra translations from Josef Leydold,

   leydold@statrix2.wu-wien.ac.at . . . . . . . . . . . . . . . . . . . . . . . . . 261

slovene-1.2d

General: Now use \@nopatterns to produce the warning . . . . . . . . 261 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

slovene-1.2f

\noextrasslovene: Introduced the active " . . . . . . . . . . . . . . . . . . . 262 slovene-1.2g

\captionsslovene: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . 261 slovene-1.2h

\captionsslovene: Added translation of ‘Proof’ . . . . . . . . . . . . . . . 261 slovene-1.2i

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 263 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 261

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Replaced ‘Slovanian’ with correct ‘Slovenian’ . . . . . . . . . . . . . 261

\noextrasslovene: removed shorthand for "L as it is not needed for

slovenian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 slovene-1.2j

\dateslovene: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . 262

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 262 \noextrasslovene: Removed empty groups after double quote and

guillemot characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 slovene-1.2l

\noextrasslovene: Deactivate shorthands ouside of Slovene . . . . . . 262 slovene-1.2m

\captionsslovene: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 261 spanishb 1.1

General: \es@lsc rewritten to incorporate the procedure so far available in \roman only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Again rewriten in full. Now that character is accesible as \dotlessi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 dotless math i handling rewritten . . . . . . . . . . . . . . . . . . . . . . . 164 Rewritten part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

spanish 4.0a

General: After the . is activated, it is redefined to avoid errors if followed by a closing brace. Changed \edef by \mathchardef. Use

\babel@savevariableinstead of \noextrasspanish. . . . . . . . . . . . . 169

All files renamed from spanishb to spanish as requested by the Spanish TeX list, since this style should replace the current Spanish option. Julio Sanchez gave up supporting his files and he has withdrawn from his TeX activities. The last distributed version as spanishb was 1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Introduced \ldf@finish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Introduced \LdfInit setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

Moved \let\es@activeacute\@undefined to \AtEndOfPackage . . . . . . 174

Test for 209 moved from sty . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 The extras subdivided into three further groups. . . . . . . . . . . . 161

spanish 4.0b

General: Added missing \nolimits . . . . . . . . . . . . . . . . . . . . . . . . . 165 Added support for custom-bib . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Introduced \es@umlaut to allow further division in words containing gü . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

spanish 4.0c

General: Added missing space at the end of \es@umlaut . . . . . . . . . 169 Merged \es@op@i and \es@op@a into a single command. The (re)defided commands have been changed as suggested by JoseRa Portillo and Juan Luis Varona. Now it conforms the UNE 5010 norm. Code is no longer duplicated–\operator@font is defined for lplain instead 165 Moved from its original place below. Decimal values replaced by hex ones. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Optimized a bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Removed the explicit trigonometric declaration. While some functions are preceptive (sen, tg) some other are optional and defined in \spanishoperators. This is because there is no norm in Spanish and there is quite a chaos in their form. Restored the forms of v 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Subtituted \char\hyphenchar\font for some instances of - . . . . . . 170

spanish 4.0d

General: Changed some parts for babel.ins to generate the files . 160 Removed the tilde settings because they are included in babel.def 169 Restored the test for \LdfInit. It is redundant for LaTeX209 but not for plain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 With a shoddy piece of work, the plain variant works (at last). Instead of inputting babel.def we input switch.def. To be changed, I think, since now plain.def is read twice . . . . . . . . . . . . . . . . 160

spanish 4.0e General: \es@quoting is written to the aux file, too . . . . . . . . . . 171 Adapted to 3.6k with some minor changes, since most of features intended for 3.7 are included now . . . . . . . . . . . . . . . . . . . . . . 160 Added \leavevmode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Added ignorespaces to \es@dots . . . . . . . . . . . . . . . . . . . . . . . . . 164 Removed duplicated \loadlocalcfg . . . . . . . . . . . . . . . . . . . . . . . 174 Replaced all instances of allowhyphens by \bbl@allowhyphens . . 160 The catcode is restored in the aux file, too . . . . . . . . . . . . . . . 169

spanish 4.0f

General: Beginning of changes to follow the doc conventions . . 160 spanish 4.0g

General: Replaced \ProvidesFile by \ProvidesLanguage . . . . . . . . . . 160 Restored the assignment of \operator@font which was misteriously missing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 The code introduced the 99/03/29 (see above) has been removed 160

spanish 4.0h

General: Added \deactivatetilden . . . . . . . . . . . . . . . . . . . . . . . . . 170 spanish 4.0i

General: Added \bbletal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Replaced wrong \spanishoperators by \es@b . . . . . . . . . . . . . . . . 165 the mthesis and phdthesis text were reverted. Fixed . . . . . . . . 174

spanish 4.0j

General: Added shorthands for \protect following active chars. This way, they work in headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Removed an extra line in the lplain option . . . . . . . . . . . . . . . . 165 Renamed spanish.tex as spanish.lpf . . . . . . . . . . . . . . . . . . . . . . . 160

spanish 4.0k

General: Minor improvementes in \es@dotlessi. Now it behaves like the dotlessi.sty package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Restored the \es@op@i command, because we have to discriminate \dotlessi and i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

spanish 4.0l

General: Added the \es@activate command, which makes the shorthands more robust in math mode. In paticular, any of them may be followed by a closing brace . . . . . . . . . . . . . . . . . . . . . . . . . . 169 We make a preevaluation of acute; in math mode, the shorthand mechanism is bypassed. That’s done *after* the test of the protection status. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

spanish 4.1a

General: \sptext protected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Added \spanishdecimal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Added basic code for spanish shorthands. . . . . . . . . . . . . . . . . . 166 Debugged and added support for the babel groups. . . . . . . . . . . 166 Introduced the \es@delayed mechanism for “conflictive” conditionals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Modified \@marginparreset in order to kill the continuing guillemets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

spanish 4.1b

General: Added the Spanish et sign. . . . . . . . . . . . . . . . . . . . . . . . 160 spanish 4.1c

General: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Added support for primes which are either ‘active’ or ‘other’ . 168 Removed an unnecessary macro. . . . . . . . . . . . . . . . . . . . . . . . . . 169 Revised so that it now uses the babel shorthands . . . . . . . . . . . 166 The box used in itemize made slightly smaller (.1ex). . . . . . . . . 172 swedish-1.0a

General: Renamed babel.sty in babel.com . . . . . . . . . . . . . . . . . . . . 215 swedish-1.0b

\captionsswedish: added definition for \enclname . . . . . . . . . . . . . . 216 made definition of \refname pluralis . . . . . . . . . . . . . . . . . . . . . 216 removed type in definition of \contentsname . . . . . . . . . . . . . . . . 216

swedish-1.0c

General: Removed use of \@ifundefined . . . . . . . . . . . . . . . . . . . . . 215 swedish-1.1

General: Added a warning when no hyphenation patterns were loaded. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Brought up-to-date with babel 3.2a . . . . . . . . . . . . . . . . . . . . . 215

\captionsswedish: \headpagename should be \pagename . . . . . . . . . . . . 216
  Added \seename, \alsoname and \prefacename . . . . . . . . . . . . . . . . 216

swedish-1.1b

\captionsswedish: Added translations . . . . . . . . . . . . . . . . . . . . . . 216 swedish-1.2

General: Update for LaTeX2e . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 swedish-1.3d

General: Now use \@nopatterns to producew the warning . . . . . . . 215 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

\captionsswedish: Changed \aa to \csname aa\endcsname, to make \uppercase

do the right thing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 swedish-1.3e

General: Update for release 3.5 . . . . . . . . . . . . . . . . . . . . . . . . . . 215

\captionsswedish: Changed \alsoname from ‘se också’ . . . . . . . . . . . 216
\extrasswedish: Added \bbl@frenchspacing . . . . . . . . . . . . . . . . . . . . 217
\noextrasswedish: Added \bbl@nonfrenchspacing . . . . . . . . . . . . . . . . 217
\swedishhyphenmins: use \swedishhyphenmins to store the correct val-

ues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 swedish-1.3f

\captionsswedish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . 216 swedish-1.3g

\captionsswedish: Replaced ‘Proof’ by its translation . . . . . . . . . . 216 swedish-2.0

General: Introduced active double quote . . . . . . . . . . . . . . . . . . 215 \noextrasswedish: Added active double quote character . . . . . . . . 217

swedish-2.1

General: Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . 218 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 215

  Replaced \undefined with \@undefined and \empty with \@empty for

consistency with L^{A}TEX, moved the definition of \atcatcode right to the beginning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

swedish-2.2

\dateswedish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . 216

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 216 swedish-2.2b

\noextrasswedish: Deactivate shorthands ouside of Swedish . . . . . . 217 swedish-2.3a

General: added \allowhyphens . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

changed definition of "=, \- and =" = . . . . . . . . . . . . . . . . . . . . 218 \captionsswedish: Added full stop after “Bil” . . . . . . . . . . . . . . . . 216 \datesdmy: Command added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

\datesymd: Command added . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 swedish-2.3b

\captionsswedish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 216

turkish-1.1

\captionsturkish: \headpagename should be \pagename . . . . . . . . . . . . 310

turkish-1.2

General: Update for L^{A}TEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 turkish-1.2b

\captionsturkish: Added braces behind \i in strings . . . . . . . . . . . . 310 \dateturkish: Added braces behind \i in strings . . . . . . . . . . . . . . . 311

turkish-1.2c

General: Now use \@nopatterns to produce the warning . . . . . . . . 310 Removed the use of \filedate and moved identification after the loading of babel.def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

turkish-1.2d \dateturkish: removed extra closing brace, \mont should be \month 311 \turkish@sh@:@: Added missing \def . . . . . . . . . . . . . . . . . . . . . . . . . 311

turkish-1.2e \extrasturkish: Completely rewrote macro . . . . . . . . . . . . . . . . . . 311

\noextrasturkish: now use \bbl@frenchspacing and \bbl@nonfrenchspacing

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

\turkish@sh@:@: Use the new mechanism of \declare@shorthand . . . . 311

turkish-1.2f

\captionsturkish: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . . 310 turkish-1.2h

General: Replaced \undefined with \@undefined and \empty with \@empty

for consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 turkish-1.2i

General: Moved the definition of \atcatcode right to the beginning. 310 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 312 ow use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . . 310

turkish-1.2j \captionsturkish: Added and modified translations . . . . . . . . . . . . 310 \dateturkish: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . 311

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 311 turkish-1.2k

\captionsturkish: Incorporated some more corrections . . . . . . . . . 310 turkish-1.2l

\dateturkish: removed dot from the date format . . . . . . . . . . . . . . 311 turkish-1.2m

\captionsturkish: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . 310

ukraineb-1.1d

\captionsukrainian: replace \CYRUKRI with \CYRII in \authorname . . . 294

ukraineb-1.1e

General: replaced all \penalty\@M with \nobreak . . . . . . . . . . . . . . 290 ukraineb-1.1f

General: Made not using inputenc a warning instead of an error 294 ukraineb-1.1g

\captionsukrainian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . 294
\extrasukrainian: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 ukraineb-1.1h

\captionsukrainian: Added translation for ‘Glossary’ . . . . . . . . . . 294 ukraineb-1.1i

General: As this code generates a textfont 7 error it is commented

out for now. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 usorbian-0.1

General: First version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 usorbian-0.1b

General: Made it possible to run through L^{A}TEX; added \MF and re-

moved extra \endmacro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 usorbian-0.1c

\captionsusorbian: Removed two typos (Kapitel and Dodatki) …. 306 usorbian-1.0a

General: Removed stuff that has been moved to babel.def . . . . . . 307 usorbian-1.0b

\captionsusorbian: Added \proofname for AMS-L^{A}TEX . . . . . . . . . . . 306 usorbian-1.0c

General: Now use \bbl@disc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 usorbian-1.0d

General: Replaced \undefined with \@undefined and \empty with \@empty

for consistency with L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 usorbian-1.0e

General: Moved the definition of \atcatcode right to the beginning. 306 Now use \ldf@finish to wrap up . . . . . . . . . . . . . . . . . . . . . . . . . 309 Now use \LdfInit to perform initial checks . . . . . . . . . . . . . . . . 306

usorbian-1.0f

General: Removed empty groups after double quote and guillemot

characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 usorbian-1.0g

\ck: Now use \shorthandon and \shorthandoff . . . . . . . . . . . . . . . . . 308 \newdateusorbian: use \def instead of \edef . . . . . . . . . . . . . . . . . . 306

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 306 \olddateusorbian: use \def instead of \edef . . . . . . . . . . . . . . . . . . 307

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . 307 usorbian-1.0h

\extrasusorbian: Deactivate shorthands ouside of Upper Sorbian . . 307 usorbian-1.0i

\captionsusorbian: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . 306
\extrasusorbian: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307

welsh-1.0b

\datewelsh: use \def instead of \edef . . . . . . . . . . . . . . . . . . . . . . . . 96

Use \edef to define \today to save memory . . . . . . . . . . . . . . . . . . 96 welsh-1.0c

\captionswelsh: Added \glossaryname . . . . . . . . . . . . . . . . . . . . . . . . 95

\welshhyphenmins: Now use \providehyphenmins to provide a default

value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95