1 The Upper Sorbian language

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

1 ⟨∗code⟩

 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.

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

 6 \addto\captionsusorbian{%
 7 \def\prefacename{Zawod}%
 8 \def\refname{Referency}%
 9 \def\abstractname{Abstrakt}%
10 \def\bibname{Literatura}%
11 \def\chaptername{Kapitl}%
12 \def\appendixname{Dodawki}%
13 \def\contentsname{Wobsah}%
14 \def\listfigurename{Zapis wobrazow}%
15 \def\listtablename{Zapis tabulkow}%
16 \def\indexname{Indeks}%
17 \def\figurename{Wobraz}%
18 \def\tablename{Tabulka}%
19 \def\partname{D\'z\v el}%
20 \def\enclname{P\v r\l oha}%
21 \def\ccname{CC}%
22 \def\headtoname{Komu}%
23 \def\pagename{Strona}%
24 \def\seename{hl.}%
25 \def\alsoname{hl.~te\v z}
26 \def\proofname{Proof}%  <-- needs translation
27 }%

\newdateusorbian The macro \newdateusorbian redefines the command \today to produce Upper Sorbian dates.

28 \def\newdateusorbian{%
29 \def\today{\number\day.~\ifcase\month\or
30 januara\or februara\or m\v erca\or apryla\or meje\or junija\or
31 julija\or awgusta\or septembra\or oktobra\or

1The file described in this section has version number v1.0e and was last revised on 1996/12/23. It was written by Eduard Werner (edi@kaihh.hanse.de).

32 nowembra\or decembra\fi
33  \space \number\year}}

\olddateusorbian The macro \olddateusorbian redefines the command \today to produce old-style Upper Sorbian dates.

34 \def\olddateusorbian{%
35 \def\today{\number\day.~\ifcase\month\or
36 wulkeho r\'o\v zka\or ma\l eho r\'o\v zka\or nal\v etnika\or
37 jutrownika\or r\'o\v zownika\or  sma\v znika\or pra\v znika\or
38 \v znjenca\or po\v znjenca\or winowca\or nazymnika\or
39 hodownika\fi \space \number\year}}

The default will be the new-style dates.

40 \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.

41 \initiate@active@char{"}
42 \addto\extrasusorbian{\languageshorthands{usorbian}}
43 \addto\extrasusorbian{\bbl@activate{"}}
44 %\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).

45 \addto\extrasusorbian{\babel@savevariable{\lccode`\^^Y}%
46 \lccode`\^^Y`\^^Y}

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

47 \addto\extrasusorbian{\babel@save\"\umlautlow}
48 \addto\noextrasusorbian{\umlauthigh}

The Upper Sorbian hyphenation patterns can be used with \lefthyphenmin and

\righthyphenmin set to 2.
49 \def\usorbianhyphenmins{\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.

50 \begingroup \catcode`\"12
51 \def\x{\endgroup
52 \def\@SS{\mathchar"7019 }
53 \def\dq{"}}
54 \x

Now we can define the doublequote macros: the umlauts,

55 \declare@shorthand{usorbian}{"a}{\textormath{\"{a}}{\ddot a}}
56 \declare@shorthand{usorbian}{"o}{\textormath{\"{o}}{\ddot o}}
57 \declare@shorthand{usorbian}{"u}{\textormath{\"{u}}{\ddot u}}
58 \declare@shorthand{usorbian}{"A}{\textormath{\"{A}}{\ddot A}}

59 \declare@shorthand{usorbian}{"O}{\textormath{\"{O}}{\ddot O}}
60 \declare@shorthand{usorbian}{"U}{\textormath{\"{U}}{\ddot U}}

tremas,

61 \declare@shorthand{usorbian}{"e}{\textormath{\"{e}}{\ddot e}}
62 \declare@shorthand{usorbian}{"E}{\textormath{\"{E}}{\ddot E}}
63 \declare@shorthand{usorbian}{"i}{\textormath{\"{\i}}{\ddot\imath}}
64 \declare@shorthand{usorbian}{"I}{\textormath{\"{I}}{\ddot I}}

usorbian es-zet (sharp s),

65 \declare@shorthand{usorbian}{"s}{\textormath{\ss{}}{\@SS{}}}
66 \declare@shorthand{usorbian}{"S}{SS}

german and french quotes,

67 \declare@shorthandusorbian{}{"`}{%
68 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
69 \declare@shorthand{usorbian}{"'}{%
70 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
71 \declare@shorthand{usorbian}{"<}{%
72 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
73 \declare@shorthand{usorbian}{">}{%
74 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}

discretionary commands

75 \declare@shorthand{usorbian}{"c}{\textormath{\bbl@disc ck}{c}}
76 \declare@shorthand{usorbian}{"C}{\textormath{\bbl@disc CK}{C}}
77 \declare@shorthand{usorbian}{"f}{\textormath{\bbl@disc f{ff}}{f}}
78 \declare@shorthand{usorbian}{"F}{\textormath{\bbl@disc F{FF}}{F}}
79 \declare@shorthand{usorbian}{"l}{\textormath{\bbl@disc l{ll}}{l}}
80 \declare@shorthand{usorbian}{"L}{\textormath{\bbl@disc L{LL}}{L}}
81 \declare@shorthand{usorbian}{"m}{\textormath{\bbl@disc m{mm}}{m}}
82 \declare@shorthand{usorbian}{"M}{\textormath{\bbl@disc M{MM}}{M}}
83 \declare@shorthand{usorbian}{"n}{\textormath{\bbl@disc n{nn}}{n}}
84 \declare@shorthand{usorbian}{"N}{\textormath{\bbl@disc N{NN}}{N}}
85 \declare@shorthand{usorbian}{"p}{\textormath{\bbl@disc p{pp}}{p}}
86 \declare@shorthand{usorbian}{"P}{\textormath{\bbl@disc P{PP}}{P}}
87 \declare@shorthand{usorbian}{"t}{\textormath{\bbl@disc t{tt}}{t}}
88 \declare@shorthand{usorbian}{"T}{\textormath{\bbl@disc T{TT}}{T}}

and some additional commands:

89 \declare@shorthand{usorbian}{"-}{\penalty\@M\-\allowhyphens}
90 \declare@shorthand{usorbian}{"|}{%
91 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
92  \allowhyphens}{}}
93 \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 compatibility with german.sty.

94 \def\mdqon{\bbl@activate{"}}
95 \def\mdqoff{\bbl@deactivate{"}}
96 \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.

97 \ldf@finish{usorbian}

98 ⟨/code⟩