1 % \iffalse meta-comment
3 % Copyright 1989-2005 Johannes L. Braams and any individual authors
4 % listed elsewhere in this file. All rights reserved.
6 % This file is part of the Babel system.
7 % --------------------------------------
9 % It may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
17 % This work has the LPPL maintenance status "maintained".
19 % The Current Maintainer of this work is Johannes Braams.
21 % The list of all files belonging to the Babel system is
22 % given in the file `manifest.bbl. See also `legal.bbl' for additional
25 % The list of derived (unpacked) files belonging to the distribution
26 % and covered by LPPL is defined by the unpacking scripts (with
27 % extension .ins) which are part of the distribution.
31 % Tell the \LaTeX\ system who we are and write an entry on the
34 \ProvidesFile{serbian.dtx}
36 %<code>\ProvidesLanguage{serbian}
38 %\ProvidesFile{serbian.dtx}
39 [2005/03/31 v1.0d Serbocroatian support from the babel system]
41 % Babel package for LaTeX version 2e
42 % Copyright (C) 1989 - 2005
43 % by Johannes Braams, TeXniek
45 % Please report errors to: J.L. Braams
46 % babel at braams.cistron.nl
48 % This file is part of the babel system, it provides the source
49 % code for the Serbocroatian language definition file. A contribution
50 % was made by Dejan Muhamedagi\'{c} (dejan@yunix.com) and Jankovic
51 % Slobodan <slobodan@archimed.filfak.ac.ni.yu>
54 \documentclass{ltxdoc}
55 \newcommand*\TeXhax{\TeX hax}
56 \newcommand*\babel{\textsf{babel}}
57 \newcommand*\langvar{$\langle \it lang \rangle$}
58 \newcommand*\note[1]{}
59 \newcommand*\Lopt[1]{\textsf{#1}}
60 \newcommand*\file[1]{\texttt{#1}}
62 \DocInput{serbian.dtx}
66 % \GetFileInfo{serbian.dtx}
67 % \changes{serbian-1.0b}{1998/06/16}{Added suggestions for shorthands
68 % and so on from Jankovic Slobodan}
70 % \section{The Serbocroatian language}
72 % The file \file{\filename}\footnote{The file described in this
73 % section has version number \fileversion\ and was last revised on
74 % \filedate. A contribution was made by Dejan Muhamedagi\'{c}
75 % (\texttt{dejan@yunix.com}).} defines all the language definition
76 % macros for the Serbian language, typeset in a latin script. In a
77 % future version support for typesetting in a cyrillic script may
80 % For this language the character |"| is made active. In
81 % table~\ref{tab:serbian-quote} an overview is given of its
82 % purpose. One of the reasons for this is that in the Serbian
83 % language some special characters are used.
87 % \begin{tabular}{lp{8cm}}
88 % |"c| & |\"c|, also implemented for the
89 % lowercase and uppercase s and z. \\
90 % |"d| & |\dj|, also implemented for |"D| \\
91 % |"-| & an explicit hyphen sign, allowing hyphenation
92 % in the rest of the word. \\
93 % \verb="|= & disable ligature at this position \\
94 % |""| & like |"-|, but producing no hyphen sign
95 % (for compund words with hyphen, e.g.\ |x-""y|). \\
96 % |"`| & for Serbian left double quotes (looks like ,,). \\
97 % |"'| & for Serbian right double quotes. \\
98 % |"<| & for French left double quotes (similar to $<<$). \\
99 % |">| & for French right double quotes (similar to $>>$). \\
101 % \caption{The extra definitions made
102 % by \file{serbian.ldf}}\label{tab:serbian-quote}
106 % Apart from defining shorthands we need to make sure taht the
107 % first paragraph of each section is intended. Furthermore the
108 % following new math operators are defined (|\tg|, |\ctg|,
109 % |\arctg|, |\arcctg|, |\sh|, |\ch|, |\th|, |\cth|, |\arsh|,
110 % |\arch|, |\arth|, |\arcth|, |\Prob|, |\Expect|, |\Variance|).
114 % The macro |\LdfInit| takes care of preventing that this file is
115 % loaded more than once, checking the category code of the
116 % \texttt{@} sign, etc.
119 \LdfInit{serbian}\captionsserbian
122 % When this file is read as an option, i.e. by the |\usepackage|
123 % command, \texttt{serbian} will be an `unknown' language in which
124 % case we have to make it known. So we check for the existence of
125 % |\l@serbian| to see whether we have to do something here.
128 \ifx\l@serbian\@undefined
129 \@nopatterns{Serbian}
130 \adddialect\l@serbian0\fi
133 % The next step consists of defining commands to switch to (and
134 % from) the Serbocroatian language.
136 % \begin{macro}{\captionsserbian}
137 % The macro |\captionsserbian| defines all strings used
138 % in the four standard documentclasses provided with \LaTeX.
139 % \changes{serbian-1.0d}{2000/09/20}{Added \cs{glossaryname}}
141 \addto\captionsserbian{%
142 \def\prefacename{Predgovor}%
143 \def\refname{Literatura}%
144 \def\abstractname{Sa\v{z}etak}%
145 \def\bibname{Bibliografija}%
146 \def\chaptername{Glava}%
147 \def\appendixname{Dodatak}%
148 \def\contentsname{Sadr\v{z}aj}%
149 \def\listfigurename{Slike}%
150 \def\listtablename{Tabele}%
151 \def\indexname{Indeks}%
152 \def\figurename{Slika}%
153 \def\tablename{Tabela}%
155 \def\enclname{Prilozi}%
157 \def\headtoname{Prima}%
158 \def\pagename{Strana}%
160 \def\alsoname{Vidi tako\dj e}%
161 \def\proofname{Dokaz}%
162 \def\glossaryname{Glossary}% <-- Needs translation
167 % \begin{macro}{\dateserbian}
168 % The macro |\dateserbian| redefines the command |\today| to
169 % produce Serbocroatian dates.
172 \def\today{\number\day .~\ifcase\month\or
173 januar\or februar\or mart\or april\or maj\or
174 juni\or juli\or avgust\or septembar\or oktobar\or novembar\or
175 decembar\fi \space \number\year}}
179 % \begin{macro}{\extrasserbian}
180 % \begin{macro}{\noextrasserbian}
181 % The macro |\extrasserbian| will perform all the extra
182 % definitions needed for the Serbocroatian language. The macro
183 % |\noextrasserbian| is used to cancel the actions of
186 % For Serbian the \texttt{"} character is made active. This is done
187 % once, later on its definition may vary. Other languages in the
188 % same document may also use the \texttt{"} character for
189 % shorthands; we specify that the serbian group of shorthands
192 % \changes{serbian-1.0b}{1998/06/16}{Introduced the active \texttt{"}}
194 \initiate@active@char{"}
195 \addto\extrasserbian{\languageshorthands{serbian}}
196 \addto\extrasserbian{\bbl@activate{"}}
198 % Don't forget to turn the shorthands off again.
199 % \changes{serbian-1.0c}{1999/12/17}{Deactivate shorthands ouside of
202 \addto\noextrasserbian{\bbl@deactivate{"}}
204 % First we define shorthands to facilitate the occurence of letters
207 \declare@shorthand{serbian}{"c}{\textormath{\v c}{\check c}}
208 \declare@shorthand{serbian}{"d}{\textormath{\dj}{\dj}}%%
209 \declare@shorthand{serbian}{"s}{\textormath{\v s}{\check s}}
210 \declare@shorthand{serbian}{"z}{\textormath{\v z}{\check z}}
211 \declare@shorthand{serbian}{"C}{\textormath{\v C}{\check C}}
212 \declare@shorthand{serbian}{"D}{\textormath{\DJ}{\DJ}}%%
213 \declare@shorthand{serbian}{"S}{\textormath{\v S}{\check S}}
214 \declare@shorthand{serbian}{"Z}{\textormath{\v Z}{\check Z}}
217 % Then we define access to two forms of quotation marks, similar
218 % to the german and french quotation marks.
220 \declare@shorthand{serbian}{"`}{%
221 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
222 \declare@shorthand{serbian}{"'}{%
223 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
224 \declare@shorthand{serbian}{"<}{%
225 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
226 \declare@shorthand{serbian}{">}{%
227 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}
229 % then we define two shorthands to be able to specify hyphenation
230 % breakpoints that behave a little different from |\-|.
231 % \changes{serbian-1.0d}{2000/09/20}{Changed definition of \texttt{"-}
232 % to be the same as for other languages}
234 \declare@shorthand{serbian}{"-}{\nobreak-\bbl@allowhyphens}
235 \declare@shorthand{serbian}{""}{\hskip\z@skip}
237 % And we want to have a shorthand for disabling a ligature.
239 \declare@shorthand{serbian}{"|}{%
240 \textormath{\discretionary{-}{}{\kern.03em}}{}}
245 % \begin{macro}{\bbl@frenchindent}
246 % \begin{macro}{\bbl@nonfrenchindent}
247 % In Serbian the first paragraph of each section should be indented.
248 % Add this code only in \LaTeX.
250 \ifx\fmtname plain \else
251 \let\@aifORI\@afterindentfalse
252 \def\bbl@frenchindent{\let\@afterindentfalse\@afterindenttrue
254 \def\bbl@nonfrenchindent{\let\@afterindentfalse\@aifORI
256 \addto\extrasserbian{\bbl@frenchindent}
257 \addto\noextrasserbian{\bbl@nonfrenchindent}
263 % \begin{macro}{\mathserbian}
264 % Some math functions in Serbian math books have other names:
265 % e.g. |sinh| in Serbian is written as |sh| etc. So we define a
266 % number of new math operators.
268 \def\sh{\mathop{\operator@font sh}\nolimits} % same as \sinh
269 \def\ch{\mathop{\operator@font ch}\nolimits} % same as \cosh
270 \def\th{\mathop{\operator@font th}\nolimits} % same as \tanh
271 \def\cth{\mathop{\operator@font cth}\nolimits} % same as \coth
272 \def\arsh{\mathop{\operator@font arsh}\nolimits}
273 \def\arch{\mathop{\operator@font arch}\nolimits}
274 \def\arth{\mathop{\operator@font arth}\nolimits}
275 \def\arcth{\mathop{\operator@font arcth}\nolimits}
276 \def\tg{\mathop{\operator@font tg}\nolimits} % same as \tan
277 \def\ctg{\mathop{\operator@font ctg}\nolimits} % same as \cot
278 \def\arctg{\mathop{\operator@font arctg}\nolimits} % same as \arctan
279 \def\arcctg{\mathop{\operator@font arcctg}\nolimits}
280 \def\Prob{\mathop{\mathsf P\hskip0pt}\nolimits}
281 \def\Expect{\mathop{\mathsf E\hskip0pt}\nolimits}
282 \def\Variance{\mathop{\mathsf D\hskip0pt}\nolimits}
286 % The macro |\ldf@finish| takes care of looking for a
287 % configuration file, setting the main language to be switched on
288 % at |\begin{document}| and resetting the category code of
289 % \texttt{@} to its original value.
297 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
298 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
299 %% Digits \0\1\2\3\4\5\6\7\8\9
300 %% Exclamation \! Double quote \" Hash (number) \#
301 %% Dollar \$ Percent \% Ampersand \&
302 %% Acute accent \' Left paren \( Right paren \)
303 %% Asterisk \* Plus \+ Comma \,
304 %% Minus \- Point \. Solidus \/
305 %% Colon \: Semicolon \; Less than \<
306 %% Equals \= Greater than \> Question mark \?
307 %% Commercial at \@ Left bracket \[ Backslash \\
308 %% Right bracket \] Circumflex \^ Underscore \_
309 %% Grave accent \` Left brace \{ Vertical bar \|
310 %% Right brace \} Tilde \~}