1 The Estonian language

The file estonian.dtx^{1} 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 1. 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 1: 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.

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

1 ⟨∗code⟩

1The file described in this section has version number v1.0e and was last revised on 1996/12/23. The original author is Enn Saar, (saar@aai.ee).

 2 \LdfInit{estonian}\captionsestonian

If Estonian is not included in the format file (does not have hyphenation patterns), we shall use English hyphenation.

 3 \ifx\l@estonian\@undefined
 4 \@nopatterns{Estonian}
 5 \adddialect\l@estonian0
 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.

 7 \addto\captionsestonian{%
 8 \def\prefacename{Sissejuhatus}%
 9 \def\refname{Viited}%
10 \def\bibname{Kirjandus}%
11 \def\appendixname{Lisa}%
12 \def\contentsname{Sisukord}%
13 \def\listfigurename{Joonised}%
14 \def\listtablename{Tabelid}%
15 \def\indexname{Indeks}%
16 \def\figurename{Joonis}%
17 \def\tablename{Tabel}%
18 \def\partname{Osa}%
19 \def\enclname{Lisa(d)}%
20 \def\ccname{Koopia(d)}%
21 \def\headtoname{}%
22 \def\pagename{Lk.}%
23 \def\seename{vt.}%
24 \def\alsoname{vt. ka}%
25 \def\proofname{Korrektuur}%

26 }

These captions contain accented characters.

27 \begingroup \catcode`\"\active
28 \def\x{\endgroup
29 \addto\captionsestonian{%
30 \def\abstractname{Kokkuv~ote}%
31 \def\chaptername{Peat"ukk}}}
32 \x

\dateestonian The macro \dateestonian redefines the command \today to produce Estonian dates.

33 \begingroup \catcode`\"\active
34 \def\x{\endgroup
35 \def\month@estonian{\ifcase\month\or
36  jaanuar\or veebruar\or m"arts\or aprill\or mai\or juuni\or
37  juuli\or august\or september\or oktoober\or november\or
38  detsember\fi}}
39 \x
40 \def\dateestonian{\def\today{\number\day.\space\month@estonian
41 \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).

42 \initiate@active@char{"}
43 \initiate@active@char{~}
44 \addto\extrasestonian{\languageshorthands{estonian}}
45 \addto\extrasestonian{\bbl@activate{"}\bbl@activate{~}}

Store the original macros, and redefine accents.

46 \addto\extrasestonian{\babel@save\"\umlautlow\babel@save\~\tildelow}

Estonian does not use extra spaces after sentences.

47 \addto\extrasestonian{\bbl@frenchspacing}
48 \addto\noextrasestonian{\bbl@nonfrenchspacing}
\estonianhyphenmins For Estonian, \lefthyphenmin and \righthyphenmin are both 2.
49 \def\estonianhyphenmins{\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.
50 \def\tildelow{\def\~{\protect\gentilde}}
51 \def\gentilde#1{\if#1o\newtilde{#1}\else\if#1O\newtilde{#1}%
52  \else\newcheck{#1}%
53  \fi\fi}
54 \def\newtilde#1{\leavevmode\allowhyphens
55 {\U@D 1ex%
56 {\setbox\z@\hbox{\char126}\dimen@ -.45ex\advance\dimen@\ht\z@
57 \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
58 \accent126\fontdimen5\font\U@D #1}\allowhyphens}
59 \def\newcheck#1{\leavevmode\allowhyphens
60 {\U@D 1ex%
61 {\setbox\z@\hbox{\char20}\dimen@ -.45ex\advance\dimen@\ht\z@
62 \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
63 \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.

64 \begingroup \catcode`\"12
65 \edef\x{\endgroup
66 \def\noexpand\dq{"}
67 \def\noexpand\til{~}}
68 \x
69 \let\dieresis\"
70 \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.

71 \edef\next{T1}
72 \ifx\f@encoding\next
73 \let\@umlaut\dieresis

74 \let\@tilde\texttilde
75 \DeclareTextComposite{\~}{T1}{s}{178}
76 \DeclareTextComposite{\~}{T1}{S}{146}
77 \DeclareTextComposite{\~}{T1}{z}{186}
78 \DeclareTextComposite{\~}{T1}{Z}{154}
79 \DeclareTextComposite{\"}{T1}{'}{17}
80 \DeclareTextComposite{\"}{T1}{`}{18}
81 \DeclareTextComposite{\"}{T1}{<}{19}
82 \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.

83 \else
84 \wlog{Warning: Hyphenation would work better for the T1 encoding.}
85 \let\@umlaut\newumlaut
86 \let\@tilde\gentilde
87 \fi

Now we define the shorthands.

88 \declare@shorthand{estonian}{"a}{\textormath{\"{a}}{\ddot a}}
89 \declare@shorthand{estonian}{"A}{\textormath{\"{A}}{\ddot A}}
90 \declare@shorthand{estonian}{"o}{\textormath{\"{o}}{\ddot o}}
91 \declare@shorthand{estonian}{"O}{\textormath{\"{O}}{\ddot O}}
92 \declare@shorthand{estonian}{"u}{\textormath{\"{u}}{\ddot u}}
93 \declare@shorthand{estonian}{"U}{\textormath{\"{U}}{\ddot U}}

german and french quotes,

94 \declare@shorthand{estonian}{"`}{%
95 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
96 \declare@shorthand{estonian}{"'}{%
97 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
98 \declare@shorthand{estonian}{"<}{%
99 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
100 \declare@shorthand{estonian}{">}{%
101 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}
102 \declare@shorthand{estonian}{~o}{\textormath{\@tilde o}{\tilde o}}
103 \declare@shorthand{estonian}{~O}{\textormath{\@tilde O}{\tilde O}}
104 \declare@shorthand{estonian}{~s}{\textormath{\@tilde s}{\check s}}
105 \declare@shorthand{estonian}{~S}{\textormath{\@tilde S}{\check S}}
106 \declare@shorthand{estonian}{~z}{\textormath{\@tilde z}{\check z}}
107 \declare@shorthand{estonian}{~Z}{\textormath{\@tilde Z}{\check Z}}

and some additional commands:

108 \declare@shorthand{estonian}{"-}{\allowhyphens\-\allowhyphens}
109 \declare@shorthand{estonian}{"|}{%
110 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
111  \allowhyphens}{}}
112 \declare@shorthand{estonian}{""}{\dq}
113 \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.

114 \ldf@finish{estonian}

115 ⟨/code⟩