1 The German language

The file germanb.dtx^{1} defines all the language definition macros for the German language as well as for the Austrian dialect of this language^{2}.

For this language the character " is made active. In table 1 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 1: The extra definitions made by german.ldf

in table 1 can also be typeset by using the commands in table 2.

When this file was read through the option germanb we make it behave as if german was specified.

1 \def\bbl@tempa{germanb}
2 \ifx\CurrentOption\bbl@tempa
3 \def\CurrentOption{german}
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.

5 ⟨∗code⟩

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

1The file described in this section has version number v2.6d and was last revised on 1996/12/23.

2This file is a re-implementation of Hubert Partl’s german.sty version 2.5b, see [?].

\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 2: More commands which produce quotes, defined by german.ldf

existence of \l@german to see whether we have to do something here.

 7 \ifx\l@german\@undefined
 8 \@nopatterns{German}
 9 \adddialect\l@german0
10 \fi

For the Austrian version of these definitions we just add another language.

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.

12 \@namedef{captions\CurrentOption}{%
13 \def\prefacename{Vorwort}%
14 \def\refname{Literatur}%
15 \def\abstractname{Zusammenfassung}%
16 \def\bibname{Literaturverzeichnis}%
17 \def\chaptername{Kapitel}%
18 \def\appendixname{Anhang}%
19 \def\contentsname{Inhaltsverzeichnis}%    % oder nur: Inhalt
20 \def\listfigurename{Abbildungsverzeichnis}%
21 \def\listtablename{Tabellenverzeichnis}%
22 \def\indexname{Index}%
23 \def\figurename{Abbildung}%
24 \def\tablename{Tabelle}%                  % oder: Tafel
25 \def\partname{Teil}%
26 \def\enclname{Anlage(n)}%                 % oder: Beilage(n)
27 \def\ccname{Verteiler}%                   % oder: Kopien an
28 \def\headtoname{An}%
29 \def\pagename{Seite}%
30 \def\seename{siehe}%
31 \def\alsoname{siehe auch}%
32 \def\proofname{Beweis}%

33 }

\dategerman The macro \dategerman redefines the command \today to produce German dates.

34 \def\month@german{\ifcase\month\or
35 Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or

36 Juli\or August\or September\or Oktober\or November\or Dezember\fi}
37 \def\dategerman{\def\today{\number\day.~\month@german
38 \space\number\year}}

\dateaustrian The macro \dateaustrian redefines the command \today to produce Austrian version of the German dates.

39 \def\dateaustrian{\def\today{\number\day.~\ifnum1=\month
40 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.

41 \initiate@active@char{"}
42 \@namedef{extras\CurrentOption}{%
43 \languageshorthands{german}}
44 \expandafter\addto\csname extras\CurrentOption\endcsname{%
45 \bbl@activate{"}}
46 %\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).

47 \expandafter\addto\csname extras\CurrentOption\endcsname{%
48 \babel@savevariable{\lccode25}%
49 \lccode25=25}

The umlaut accent macro \" is changed to lower the umlaut dots. The redefinition is done with the help of \umlautlow.

50 \expandafter\addto\csname extras\CurrentOption\endcsname{%
51 \babel@save\"\umlautlow}
52 \@namedef{noextras\CurrentOption}{\umlauthigh}

The german hyphenation patterns can be used with \lefthyphenmin and

\righthyphenmin set to 2.
53 \def\germanhyphenmins{\tw@\tw@}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 1.

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 ".

54 \begingroup \catcode`\"12
55 \def\x{\endgroup
56 \def\@SS{\mathchar"7019 }
57 \def\dq{"}}
58 \x

Now we can define the doublequote macros: the umlauts,

59 \declare@shorthand{german}{"a}{\textormath{\"{a}\allowhyphens}{\ddot a}}
60 \declare@shorthand{german}{"o}{\textormath{\"{o}\allowhyphens}{\ddot o}}

61 \declare@shorthand{german}{"u}{\textormath{\"{u}\allowhyphens}{\ddot u}}
62 \declare@shorthand{german}{"A}{\textormath{\"{A}\allowhyphens}{\ddot A}}
63 \declare@shorthand{german}{"O}{\textormath{\"{O}\allowhyphens}{\ddot O}}
64 \declare@shorthand{german}{"U}{\textormath{\"{U}\allowhyphens}{\ddot U}}

tremas,

65 \declare@shorthand{german}{"e}{\textormath{\"{e}}{\ddot e}}
66 \declare@shorthand{german}{"E}{\textormath{\"{E}}{\ddot E}}
67 \declare@shorthand{german}{"i}{\textormath{\"{\i}}%
68  {\ddot\imath}}
69 \declare@shorthand{german}{"I}{\textormath{\"{I}}{\ddot I}}

german es-zet (sharp s),

70 \declare@shorthand{german}{"s}{\textormath{\ss{}}{\@SS{}}}
71 \declare@shorthand{german}{"S}{SS}
72 \declare@shorthand{german}{"z}{\textormath{\ss{}}{\@SS{}}}
73 \declare@shorthand{german}{"Z}{SZ}

german and french quotes,

74 \declare@shorthand{german}{"`}{\glqq}
75 \declare@shorthand{german}{"'}{\grqq}
76 \declare@shorthand{german}{"<}{\flqq}
77 \declare@shorthand{german}{">}{\frqq}

discretionary commands

78 \declare@shorthand{german}{"c}{\textormath{\bbl@disc ck}{c}}
79 \declare@shorthand{german}{"C}{\textormath{\bbl@disc CK}{C}}
80 \declare@shorthand{german}{"f}{\textormath{\bbl@disc f{ff}}{f}}
81 \declare@shorthand{german}{"F}{\textormath{\bbl@disc F{FF}}{F}}
82 \declare@shorthand{german}{"l}{\textormath{\bbl@disc l{ll}}{l}}
83 \declare@shorthand{german}{"L}{\textormath{\bbl@disc L{LL}}{L}}
84 \declare@shorthand{german}{"m}{\textormath{\bbl@disc m{mm}}{m}}
85 \declare@shorthand{german}{"M}{\textormath{\bbl@disc M{MM}}{M}}
86 \declare@shorthand{german}{"n}{\textormath{\bbl@disc n{nn}}{n}}
87 \declare@shorthand{german}{"N}{\textormath{\bbl@disc N{NN}}{N}}
88 \declare@shorthand{german}{"p}{\textormath{\bbl@disc p{pp}}{p}}
89 \declare@shorthand{german}{"P}{\textormath{\bbl@disc P{PP}}{P}}
90 \declare@shorthand{german}{"r}{\textormath{\bbl@disc r{rr}}{r}}
91 \declare@shorthand{german}{"R}{\textormath{\bbl@disc R{RR}}{R}}
92 \declare@shorthand{german}{"t}{\textormath{\bbl@disc t{tt}}{t}}
93 \declare@shorthand{german}{"T}{\textormath{\bbl@disc T{TT}}{T}}

and some additional commands:

94 \declare@shorthand{german}{"-}{\penalty\@M\-\allowhyphens}
95 \declare@shorthand{german}{"|}{%
96 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
97  \allowhyphens}{}}
98 \declare@shorthand{german}{""}{\hskip\z@skip}
99 \declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
100 \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 compatibility with german.sty.

101 \def\mdqon{\bbl@activate{"}}
102 \def\mdqoff{\bbl@deactivate{"}}
103 \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.

104 \ldf@finish\CurrentOption

105 ⟨/code⟩