In the core of the Babel system, several macros are defined for use in the les denition language. The condemnation of the Les language can be read in the preamble of the document, but also in the middle of the processing of the document.
Support for active characters
This will just save the language name and the corresponding language will be activated at the beginning of the document. This includes resetting the @ character category code, preparing the language for activation at \begin{document} time, and terminating the input stream.
Support for saving macro denitions
Support for extending macros
Macros common to a number of languages
Le babel.sty3 is intended for LATEX2ε, so we make sure the format used is correct. To utilize the features of LATEX2ε, the babel system contains a le package, babel.sty.
Language options
The core of the babel system is stored in hyphen.cfg or switch.def and babel.def. Check for the presence of the \iflanguage command, if it is deprecated, read the switch.def file.
Encoding issues (part 1)
The babel.def file contains some TEX code that can be read at runtime. When babel.def is loaded, it checks that hyphen.cfg is in format; if not, the switch.def file is loaded.
Multiple languages
It is the name of the language that was denied in the denial of the language let.
Support for active characters
Since TEX inserts \relax if a corresponding \else or \fi is examined before evaluating the comparison, we provide a `stop character' that should expand to zero.
Shorthands
We also need to make sure that the shorthand is active while processing the .aux le. Therefore, here we define two macros to store the position of the character in these encodings.
Language attributes
Now we need to see if the attribute is in the list of already selected attributes. It then defines a control string to be executed when the attribute is used in a document.
Support for saving macro denitions
The command \bbl@frenchspacing will enable it if it is not already running and \bbl@nonfrenchspacing will disable it if necessary.
Support for extending macros
Macros common to a number of languages
Making glyphs available
Quotation marks
Make sure that when an encoding other than OT1 or T1 is used, these glyphs can still be typeset. Make sure that when an encoding other than OT1 or T1 is used, these glyphs can still be typeset.
Letters
Shorthands for quotation marks
Umlauts and trema's
We must be sure that these definitions override those available when the package font with the OT1 option is used.
The redenition of the style commands
The macros to be reformulated for the report and book document styles happen to be the same, so there is no need to distinguish between these two styles. The reason for this is that the document style of the article uses the term `References' in the denition of \thebibliography.
Cross referencing macros
Then we use \bbl@tempa as an `alias' for the macro that contains the label being checked. When the label is dened, we replace the denition of \bbl@tempa with its meaning.
This way, these commands will not be expanded using \edef later and ensure that the text is typed with the correct language settings. Here we make sure that active characters that can end in a tag are not disabled by an exit routine that is fired while \@safe@activestrue is in eect.
Encoding issues (part 2)
Preventing clashes with other packages
So we check for the existence of \l@english to see if we need to do anything here. So we check for the existence of \l@scottish to see if we need to do something here.
Typing conventions
Le greek.dtx22 denies all the language designation macros for the Greek language, ie. as it is used today with only one accent, and the attributeπoλυτ oνκ´o (Polutoniko) to set Greek text with all accents. This separation arose out of the need to simplify things, for very few people will be really interested in setting polytonic Greek text.
Greek numbering
In order to get the correct division, we need to set the lowercase code of a certain number of characters. For this to work, we need to see the character as ^^9f in TEX's eyes.
Basic interface
The \DecimalMathComma command makes the comma a regular French-only character (no space added); as a counterpart, if \DecimalMathComma is on, a clear space must be added to lists and ranges x,\ y)$. 28 In fact, they are active throughout the document, only their extensions die in French and outside French.
Customisation
If this option is set to false, the first paragraph of will look the same in French and English (not indented). This option tells frenchb which characters open and close French guillemets (they depend on the encoding entered), then you can type either guillemets , or guillemets (with or without spaces) to get correct French quotes.
Hyphenation checks
With some classes that change the \part{} command (AMS and SMF classes do this), you'll get Première part I, Deuxième part II instead; when this happens, this option should be set to false, part titles will then be printed as Party I, Party II. This option requires inputenc to be loaded with the correct encoding, it works with 8-bit encodings (latin1, latin9, ansnew, applemac,.
Changes
Someone who wants frenchb to leave the layout of lists and footnotes untouched, but to indent the first paragraph of sections, can choose \frenchbsetup{StandardLayout,IndentFirst}. As of version 2.2a, frenchb only changes the layout of lists, footnotes, and the indentation of the first paragraphs of sections if French is the main language (i.e. babel's last language option).
Initial setup
Check if hyphen patterns for the French language are loaded in language.dat; we allow the names `french', `francais', `canadien' or `acadian'. The internal name for the French language is French; francais and frenchb are synonyms for french: first let both names use the same hyphenation patterns.
Punctuation
We negate a new 'if' \FBpunct@active which will become false whenever a better alternative is available. FDP@thinspace which will be rejected, at the user's discretion, as an automatically added thinspace, or as \@empty.
French quotation marks
In both cases, the commands \guillemotleft and \guillemotright will print the French opening and closing quotation marks from the output font. We will check `AtBeginDocument' that the correct output encodings are in use (see end of section 29.13).
Date in French
Extra utilities
IfFileExists, \FB@up falls back to mock superscript, otherwise \FB@suffix is checked to decide whether to use fake or true superscript. FB@up@real just picks up the superscripts from the subfamily (and forces lower case).
Formatting numbers
Caption names
In French, captions in figures and tables must be printed with a dash (`') instead of the standard one. CaptionSeparator defaults to `: ' as in standard \@makecaption and will be changed to ` ' in French.
French lists
The item label used in French is stored in \FrenchLabelItem}, defaults to `' and can be changed with \frenchbsetup{} (see Section 29.13). This code should never be executed twice in a row, so we need a new ag that will set and reset \bbl@nonfrenchlabelitems and.
French indentation of sections
Formatting footnotes
The layout of footnotes is controlled by two ags \ifFBAutoSpaceFootnotes and \ifFBFrenchFootnotes, which are set by the options of \frenchbsetup{} (see Section 29.13). Note that the layout of footnotes does not depend on the current language (just think of two footnotes on the same page that look different because one was called in a French part, the other in English!).
Global layout
FBtextellipsis LATEX2ε's default definition of \dots in text mode is \textellipsis with a \core at the end; this space is not desired in some cases (eg for closing braces) and \core breaks the hyphenation of the next word. The \if construct in the LATEX2ε definition of \dots does not allow the use of xspace (xspace is always followed by a \fi), so we use the AMS-LATEX construct of \dots; this should be done `AtBeginDocument' so as not to be overwritten when amsmath.sty is loaded after babel.
Setup options: keyval stu
CompactItemize suppresses the vertical spacing between list items in French (done by changing \itemize to \itemizeFB). The layout of footnotes is handled at the \begin{document} depending on the values of ags FrenchFootnotes and AutoSpaceFootnotes (see section 29.10), nothing needs to be done here for footnotes.
Clean up and exit
For this language, a limited number of shortcuts have been denied, Table 6, some of which are used to overcome certain limitations of the Italian keyboard; in section 30.3 there are other comments and hints to overcome some other keyboard limitations. The next step is to reject commands to switch to (and from) the Italian language.
Support for etymological hyphenation
This problem is so important in most European languages that from the very beginning babel developed a tradition of activating the " character in order to perform several actions that were useful in each language. In other language descriptor files, a shortcut is marked to allow a breakpoint without actually inserting any hyphen character; examples are given such as
Facilities required by the ISO 31/XI regulations
This shortcut only works for slashes, as such constructions in Italian are extremely rare. Then we can use \let to reject the user-level commands, but in case the macros already have another meaning before entering the Italian mode, we first remember their meaning to restore them on exit.
Accents
Caporali or French double quotes
In any case, the user can force the use of Cyrillic letter substitutions with a statement. We set some more boolean variables to test for the existence of CBgreek or Cyrillic.
Finishing commands
The es-nolayout option disables layout changes in the document when Spanish is the main language. The macros \spanishcaption automatically change the value of the caption (no need to add an \addto).
The Code