summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/babel-contrib/azerbaijani/azerbaijani.dtx
blob: d7d62721049d57681ac83c022845d94327380ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
% \iffalse meta-comment
%
% Copyright 2014-2017 Namig J. Guliyev and any individual authors
% listed elsewhere in this file.  All rights reserved.
% 
% This file is part of the Babel system.
% --------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainers of this work are Namig J. Guliyev
%                                      and Javier Bezos
%
% To report error: http://www.texnia.com/contact.html
% 
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
% \iffalse
%    Tell the \LaTeX\ system who we are and write an entry on the
%    transcript.
%<*dtx>
\ProvidesFile{azerbaijani.dtx}
%</dtx>
%<code>\ProvidesLanguage{azerbaijani}
%\fi
%\ProvidesFile{azerbaijani.dtx}
        [2017/05/03 v1.0a Azerbaijani support from the babel system] %^^A
%\iffalse
%% File `azerbaijani.dtx'
%
%% Azerbaijani Language Definition File
%% Copyright (C) 2014-2017
%%           by Namig J. Guliyev
%
%    This file is part of the babel system, it provides the source
%    code for the Azerbaijani language definition file.
%<*filedriver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
\usepackage[T2A,T1]{fontenc}
\title{The Azerbaijani style for babel}
\author{Namig J. Guliyev, Javier Bezos} 
\newcommand*\TeXhax{\TeX hax}
\newcommand*\babel{\textsf{babel}}
\newcommand*\langvar{$\langle \it lang \rangle$}
\newcommand*\note[1]{}
\newcommand*\Lopt[1]{\textsf{#1}}
\newcommand*\file[1]{\texttt{#1}}
\DeclareUnicodeCharacter{018F}{\Azerbaijanischwa}
\DeclareUnicodeCharacter{0259}{\azerbaijanischwa}
\DeclareTextCommand{\Azerbaijanischwa}{T1}{%
  \UseTextSymbol{T2A}{\char154}}
\DeclareTextCommand{\azerbaijanischwa}{T1}{%
  \UseTextSymbol{T2A}{\char186}}
\begin{document}
 \maketitle
 \DocInput{azerbaijani.dtx}
\end{document}
%</filedriver>
%\fi
% \GetFileInfo{azerbaijani.dtx}
%
%  \section{The Azerbaijani language}
%
%    The file \file{\filename}\footnote{The file described in this
%    section has version number \fileversion\ and was last revised on
%    \filedate.} defines all the language definition macros for the
%    Azerbaijani language.
%
%    Typical usage with pdf\TeX{} is:
%\begin{verbatim}
%\usepackage[T2A,T1]{fontenc}
%\usepackage[utf8]{inputenc}
%\usepackage[azerbaijani]{babel}
%\end{verbatim}
%
%    Note you must load two encondings: |T1| as the main one for most
%    characters, and |T2A| for the schwa, which is not provided by any
%    Latin encoding. This mixture of encodings means hyphenation in
%    traditional engines will be only partial -- words containing the
%    schwa will not be hyphenated if the point comes near this letter.
%
%    Thus, if proper handling of hyphenation is required, you must
%    switch to a Unicode engine, like Xe\TeX{} or Lua\TeX.
%
%    This style doesn't handle the \textit{fi} ligature (yet). You can
%    break it by hand with |f{}i| or |f{\kern0pt}i|, but this can be
%    done automatically, too. With pdf\TeX{} and monolingual
%    documents, use \textsf{microtype}, as for example:
%\begin{verbatim}
%\usepackage{microtype}
%\DisableLigatures[f]{encoding = *, family = *}
%\end{verbatim}
%
%    With Xe\TeX, ligatures are handled internally by the font, provided the
%    corresponding feature has been implemented (not all fonts do); e.~g.:
%\begin{verbatim}
%\usepackage{fontspec}
%\setmainfont[Language=Azerbaijani]{Iwona}
%\end{verbatim}
%
%    With Lua\TeX{} you can use either method (remember with
%    \textsf{microtype} you may need also set |Renderer=Basic| when
%    defining a font with \textsf{fontspec}, at least at the time of
%    this writing). Alternative approachs with Lua\TeX{} are the
%    \textsf{setnolig} package and
%    \verb|fonts.handlers.otf.addfeature| from \textsf{luaotfload}
%    (not done here).
%
% \StopEventually{}
%
%  \subsection*{The code}
%
%    The macro |\LdfInit| takes care of preventing that this file is
%    loaded more than once, checking the category code of the
%    \texttt{@} sign, etc.
%    \begin{macrocode}
%<*code>
\LdfInit{azerbaijani}\captionsazerbaijani
%    \end{macrocode}
%
%    When this file is read as an option, i.e. by the |\usepackage|
%    command, \texttt{azerbaijani} could be an `unknown' language in which
%    case we have to make it known. So we check for the existence of
%    |\l@azerbaijani| to see whether we have to do something here.
%
% \changes{azerbaijani-1.2c}{1994/06/26}{Now use \cs{@nopatterns} to
%    produce the warning}
%    \begin{macrocode}
\ifx\l@azerbaijani\@undefined
  \@nopatterns{Azerbaijani}
  \adddialect\l@azerbaijani0\fi
%    \end{macrocode}
%
%    The next step consists of defining commands to switch to (and
%    from) the Azerbaijani language.
%
% \begin{macro}{\captionsazerbaijani}
% \begin{macro}{\dateazerbaijani}
%    The macro |\captionsazerbaijani| defines all strings used in the four
%    standard documentclasses provided with \LaTeX. 
%
%    \begin{macrocode}
\AtBeginDocument{%
  \@ifpackagewith{inputenc}{utf8}{%
    \DeclareUnicodeCharacter{018F}{\Azerbaijanischwa}%
    \DeclareUnicodeCharacter{0259}{\azerbaijanischwa}}%
  {\@ifpackagewith{inputenc}{utf8x}{%
     \DeclareUnicodeCharacter{399}{\Azerbaijanischwa}%
     \DeclareUnicodeCharacter{601}{\azerbaijanischwa}}{}}}
\StartBabelCommands*{azerbaijani}{captions}
    [unicode, charset=utf8, fontenc=EU1 EU2 TU]
  \SetString\prefacename{Ön söz}
  \SetString\refname{Ədəbiyyat}
  \SetString\abstractname{Annotasiya}
  \SetString\bibname{Ədəbiyyat}
  \SetString\chaptername{Fəsil}
  \SetString\appendixname{Əlavə}
  \SetString\contentsname{Mündəricat}
  \SetString\listfigurename{Şəkillərin siyahısı}
  \SetString\listtablename{Cədvəllərin siyahısı}
  \SetString\indexname{Mövzu göstəricisi}
  \SetString\figurename{Şəkil}
  \SetString\tablename{Cədvəl}
  \SetString\partname{Hissə}
  \SetString\enclname{encl}
  \SetString\ccname{cc}
  \SetString\headtoname{To}
  \SetString\pagename{səh.}
  \SetString\seename{baxın}
  \SetString\alsoname{həmçinin baxın}
  \SetString\proofname{İsbatı}
  \SetString\glossaryname{Terminlər lüğəti}
  \SetCase[\azerbaijanischwa\Azerbaijanischwa]
    {\uccode`i=`İ\relax
     \uccode`ı=`I\relax}
    {\lccode`İ=`i\relax
     \lccode`I=`ı\relax}
  \SetHyphenMap{%
    \BabelLower{`İ}{`i}%
    \BabelLower{`I}{`ı}}
  \AfterBabelCommands{%
    \DeclareTextCommandDefault{\Azerbaijanischwa}{Ə}%
    \DeclareTextCommandDefault{\azerbaijanischwa}{ə}}
\StartBabelCommands*{azerbaijani}{}[generic, fontenc=T1]
  \AfterBabelCommands{%
    \@ifundefined{T@T1}%
    {\PackageWarning{azerbaijani}%
       {The font encoding T1 has not been loaded. Expect errors\MessageBreak
        and wrong hyphenations}}
    {\@ifundefined{T@T2C}{}{\gdef\aze@cyrenc{T2C}}%
     \@ifundefined{T@T2B}{}{\gdef\aze@cyrenc{T2B}}%
     \@ifundefined{T@T2A}{}{\gdef\aze@cyrenc{T2A}}%
     \@ifundefined{T@X2}{}{\gdef\aze@cyrenc{X2}}%
     \ifx\aze@cyrenc\@undefined
       \PackageError{azerbaijani}%
         {No font containing the schwa has been detected.\MessageBreak
          Please, load a Cyrillic encoding (T2A, T2B, T2C, X2)}%
         {See the manual for further details.}%
     \else
       \AtBeginDocument{%
         \DeclareTextCommand{\Azerbaijanischwa}{T1}{%
           \UseTextSymbol{\aze@cyrenc}{\char154}\bbl@allowhyphens}
         \DeclareTextCommand{\azerbaijanischwa}{T1}{%
           \UseTextSymbol{\aze@cyrenc}{\char186}\bbl@allowhyphens}}%
     \fi}}
\StartBabelCommands*{azerbaijani}{captions}
  \SetString\prefacename{\"{O}n s\"{o}z}
  \SetString\refname{{\Azerbaijanischwa}d{\azerbaijanischwa}biyyat}
  \SetString\abstractname{Annotasiya}
  \SetString\bibname{{\Azerbaijanischwa}d{\azerbaijanischwa}biyyat}
  \SetString\chaptername{F{\azerbaijanischwa}sil}
  \SetString\appendixname{{\Azerbaijanischwa}lav{\azerbaijanischwa}}
  \SetString\contentsname{M\"{u}nd{\azerbaijanischwa}ricat}
  \SetString\listfigurename{%
    \c{S}{\azerbaijanischwa}kill{\azerbaijanischwa}rin siyah{\i}s{\i}}
  \SetString\listtablename{%
    C{\azerbaijanischwa}dv{\azerbaijanischwa}ll{\azerbaijanischwa}rin
    siyah{\i}s{\i}}
  \SetString\indexname{M\"{o}vzu g\"{o}st{\azerbaijanischwa}ricisi}
  \SetString\figurename{\c{S}{\azerbaijanischwa}kil}
  \SetString\tablename{C{\azerbaijanischwa}dv{\azerbaijanischwa}l}
  \SetString\partname{Hiss{\azerbaijanischwa}}
  \SetString\enclname{encl}
  \SetString\ccname{cc}
  \SetString\headtoname{To}
  \SetString\pagename{s{\azerbaijanischwa}h.}
  \SetString\seename{bax{\i}n}
  \SetString\alsoname{h{\azerbaijanischwa}m\c{c}inin bax{\i}n}
  \SetString\proofname{\.{I}sbat{\i}}
  \SetString\glossaryname{Terminl{\azerbaijanischwa}r l\"{u}\u{g}əti}
  \SetCase[\azerbaijanischwa\Azerbaijanischwa]
    {\uccode`i="9D\relax
     \uccode"19=`I\relax}
    {\lccode"9D=`i\relax
     \lccode`I="19\relax}
  \SetHyphenMap{%
    \BabelLower{"9D}{`i}
    \BabelLower{`I}{"19}}
\StartBabelCommands*{azerbaijani}{date}
  \SetStringLoop{month#1name}{%
    yanvar,fevral,mart,aprel,may,iyun,iyul,%
    avqust,sentyabr,oktyabr,noyabr,dekabr}
  \SetString\today{%
    \number\day~\@nameuse{month\romannumeral\month name}%
    \space\number\year}
\EndBabelCommands
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\extrasazerbaijani}
% \begin{macro}{\noextrasazerbaijani}
%    The macro |\extrasazerbaijani| will perform all the extra definitions
%    needed for the Azerbaijani language. The macro |\noextrasazerbaijani| is
%    used to cancel the actions of |\extrasazerbaijani|.
%
%    We specify that the azerbaijani group of shorthands should be used.
%    These characters are `turned on' once, later their definition may
%    vary. 
%
%    \begin{macrocode}
\providehyphenmins{azerbaijani}{\tw@\tw@}
\initiate@active@char{"}
\declare@shorthand{azerbaijani}{"-}{\bbl@hy@soft}
\declare@shorthand{azerbaijani}{"=}{\bbl@hy@hard}
\addto\extrasazerbaijani{%
  \bbl@activate{"}%
  \languageshorthands{azerbaijani}%
  \bbl@frenchspacing}
\addto\noextrasazerbaijani{%
  \bbl@deactivate{"}%
  \bbl@nonfrenchspacing}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    The macro |\ldf@finish| takes care of looking for a
%    configuration file, setting the main language to be switched on
%    at |\begin{document}|.
%    \begin{macrocode}
\ldf@finish{azerbaijani}
%</code>
%    \end{macrocode}
%
% \Finale
%%
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\endinput