1 The Esperanto language

The file esperant.dtx^{1} defines all the language-specific macros for the Esperanto language.

For this language the character ^is made active. In table 1 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 1: 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.

1 ⟨∗code⟩

 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.

 3 \ifx\l@esperanto\@undefined
 4 \@nopatterns{Esperanto}
 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.

 6 \addto\captionsesperanto{%
 7 \def\prefacename{Anta\u{u}parolo}%
 8 \def\refname{Cita\^\j{}oj}%
 9 \def\abstractname{Resumo}%
10 \def\bibname{Bibliografio}%
11 \def\chaptername{{\^C}apitro}%
12 \def\appendixname{Apendico}%
13 \def\contentsname{Enhavo}%
14 \def\listfigurename{Listo de figuroj}%
15 \def\listtablename{Listo de tabeloj}%
16 \def\indexname{Indekso}%

1The file described in this section has version number v1.4j and was last revised on 1997/01/06.

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 \def\figurename{Figuro}%
18 \def\tablename{Tabelo}%
19 \def\partname{Parto}%
20 \def\enclname{Aldono(j)}%
21 \def\ccname{Kopie al}%
22 \def\headtoname{Al}%
23 \def\pagename{Pa\^go}%
24 \def\subjectname{Temo}%
25 \def\seename{vidu}%   a^u: vd.
26 \def\alsoname{vidu anka\u{u}}% a^u vd. anka\u{u}
27 \def\proofname{Pruvo}%

28 }

\dateesperanto The macro \dateesperanto redefines the command \today to produce Esperanto dates.

29 \def\dateesperanto{%
30 \def\today{\number\day{--a}~de~\ifcase\month\or
31 januaro\or februaro\or marto\or aprilo\or majo\or junio\or
32 julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
33 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.

34 \initiate@active@char{^}
35 \addto\extrasesperanto{\languageshorthands{esperanto}}
36 \addto\extrasesperanto{\bbl@activate{^}}
37 \addto\noextrasesperanto{\bbl@deactivate{^}}

And here are the uses of the active ^:

38 \declare@shorthand{esperanto}{^c}{\^{c}\allowhyphens}
39 \declare@shorthand{esperanto}{^C}{\^{C}\allowhyphens}
40 \declare@shorthand{esperanto}{^g}{\^{g}\allowhyphens}
41 \declare@shorthand{esperanto}{^G}{\^{G}\allowhyphens}
42 \declare@shorthand{esperanto}{^h}{h\llap{\^{}}\allowhyphens}
43 \declare@shorthand{esperanto}{^H}{\^{H}\allowhyphens}
44 \declare@shorthand{esperanto}{^j}{\^{\j}\allowhyphens}
45 \declare@shorthand{esperanto}{^J}{\^{J}\allowhyphens}
46 \declare@shorthand{esperanto}{^s}{\^{s}\allowhyphens}
47 \declare@shorthand{esperanto}{^S}{\^{S}\allowhyphens}
48 \declare@shorthand{esperanto}{^u}{\u u\allowhyphens}
49 \declare@shorthand{esperanto}{^U}{\u U\allowhyphens}
50 \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.

51 \def\esper#1{\@esper{\@nameuse{c@#1}}}
52 \def\Esper#1{\@Esper{\@nameuse{c@#1}}}

Then the first five occasions that are probably used the most.

53 \def\@esper#1{\ifcase#1\or a\or b\or c\or \^c\or d\else\@iesper{#1}\fi}
54 \def\@Esper#1{\ifcase#1\or A\or B\or C\or \^C\or D\else\@Iesper{#1}\fi}

And the 33 other cases.

55 \def\@iesper#1{\ifcase#1\or \or \or \or \or \or e\or f\or g\or \^g\or
56  h\or h\llap{\^{}}\or i\or j\or \^\j\or k\orl\or m\or n\or o\or
57  p\or s\or \^s\or t\or u\or \u{u}\or v\or z\else\@ctrerr\fi}
58 \def\@Iesper#1{\ifcase#1\or \or \or \or \or \or E\or F\or G\or \^G\or
59  H\or \^H\or I\or J\or \^\J\or K\or L\or M\or N\or O\or
60  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.

61 \addto\dateesperanto{\def\hodiau{la \today}}
62 \def\hodiaun{la \number\day --an~de~\ifcase\month\or
63 januaro\or februaro\or marto\or aprilo\or majo\or junio\or
64 julio\or a\u{u}gusto\or septembro\or oktobro\or novembro\or
65 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.

66 \ldf@finish{esperanto}

67 ⟨/code⟩