summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/babel-lithuanian/babel-lithuanian.dtx
blob: 202276fe05fb84e6ea21aff15252431449200a0e (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
% \iffalse meta-comment
%
% Copyright 2023 Sigitas Tolušis, 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 Maintainer of this work is Sigitas Tolušis.
%
% 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{babel-lithuanian.dtx}
%</dtx>
%<code>
%<code>\ProvidesLanguage{lithuanian}
%<code>        [2023/03/07 v1.0 Lithuanian support from the babel system]
% \fi
% \iffalse
%<*filedriver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
\usepackage[L7x,T1]{fontenc}
\title{The Lithuanian style for babel, v1.0}
\author{Sigitas Tolušis} 
\newcommand*\babel{\textsf{babel}}
\begin{document}
 \maketitle
 \DocInput{babel-lithuanian.dtx}
\end{document}
%</filedriver>
%\fi
%
% \section{The Lithuanian Language}
%
% The file \textsf{lithuanian.ldf} defines the language definition 
% macros for the Lithuanian language.
%
% Since the |T1| encoding doesn't contain all the characters required
% for Lithuanian, you should use |L7x| instead for 8-bit fonts.
% In this case best choice is to use \textsf{tex-gyre} fonts collection.
% As alternative you can use Open Type fonts with \textsf{luatex} or
% \textsf{xetex}.
% 
% A complete example is:
%\begin{verbatim}
%\documentclass{article}
% %
% %% 8-bit fonts
%\usepackage[utf8x]{inputenc}
% %%\usepackage[utf8x]{luainputenc} %% in case using lualatex with 8-bit fonts
%\usepackage[L7x]{fontenc}
%\usepackage{tgtermes} %% or tgpagella, tgbonum, tgschola, etc.
% %
% %% Open Type fonts
% %\usepackage{fontspec}
% %\setmainfont{texgyrebonum-regular.otf}
% %%
%\usepackage[lithuanian]{babel}
%\usepackage[pdftex,unicode]{hyperref}
%
%\begin{document}
%
%\section*{Abėcėlė}
%Lietuvių kalbos abėcėlę sudaro 32 raidės:
%\par\medskip
% Aa Ąą Bb Cc Čč Dd Ee Ęę Ėė Ff Gg Hh Ii Įį Yy Jj
% Kk Ll Mm Nn Oo Pp Rr Ss Šš Tt Uu Ųų Ūū Vv Zz Žž
%
%\subsection*{Didžiosios raidės}
%\MakeUppercase{Aa Ąą Bb Cc Čč Dd Ee Ęę Ėė Ff Gg Hh Ii Įį Yy Jj
% Kk Ll Mm Nn Oo Pp Rr Ss Šš Tt Uu Ųų Ūū Vv Zz Žž}
%
%\subsection*{Mažosios raidės}
%\MakeLowercase{Aa Ąą Bb Cc Čč Dd Ee Ęę Ėė Ff Gg Hh Ii Įį Yy Jj
% Kk Ll Mm Nn Oo Pp Rr Ss Šš Tt Uu Ųų Ūū Vv Zz Žž}
%
%\end{document}
%\end{verbatim}
%
% \StopEventually{}
%
%  \subsection*{The code}
%
%    \begin{macrocode}
%<*code>
\LdfInit{lithuanian}\captionslithuanian
\ifx\undefined\l@lithuanian
  \@nopatterns{Lithuanian}
  \adddialect\l@lithuanian0
\fi
%    \end{macrocode}
%
%  \subsubsection*{Hyphenmins}
%
%    \begin{macrocode}

\providehyphenmins{lithuanian}{\tw@\tw@}
%    \end{macrocode}
%
%  \subsubsection*{Captions and date}
%
%    \begin{macrocode}

\StartBabelCommands*{lithuanian}{captions}
    [unicode, charset=utf8, fontenc=TU EU1 EU2]

  \SetString\prefacename{Pratarmė}
  \SetString\refname{Literatūra}
  \SetString\abstractname{Santrauka}
  \SetString\bibname{Literatūra}
  \SetString\chaptername{skyrius}
  \SetString\appendixname{Priedas}
  \SetString\contentsname{Turinys}
  \SetString\listfigurename{Iliustracijų sąrašas}
  \SetString\listtablename{Lentelių sąrašas}
  \SetString\indexname{Rodyklė}
  \SetString\figurename{pav.}
  \SetString\tablename{lentelė}
  \SetString\partname{Dalis}
  \SetString\enclname{Įdėta}
  \SetString\ccname{Kopijos}
  \SetString\headtoname{Kam}
  \SetString\pagename{puslapis}
  \SetString\seename{žiūrėk}%% žr.
  \SetString\alsoname{taip pat}%% ten pat, tas pat
  \SetString\proofname{Įrodymas}
  \SetString\glossaryname{Terminų žodynas}

\StartBabelCommands*{lithuanian}{captions}

  \SetString\prefacename{Pratarm\.e}
  \SetString\refname{Literat\=ura}
  \SetString\abstractname{Santrauka}
  \SetString\bibname{Literat\=ura}
  \SetString\chaptername{skyrius}
  \SetString\appendixname{Priedas}
  \SetString\contentsname{Turinys}
  \SetString\listfigurename{Iliustracij\k{u} s\k{a}ra\v{s}as}
  \SetString\listtablename{Lenteli\k{u} s\k{a}ra\v{s}as}
  \SetString\indexname{Rodykl\.e}
  \SetString\figurename{pav.}
  \SetString\tablename{lentel\.e}
  \SetString\partname{Dalis}
  \SetString\enclname{\k{I}d\.eta}
  \SetString\ccname{Kopijos}
  \SetString\headtoname{Kam}
  \SetString\pagename{puslapis}
  \SetString\seename{\v{z}i\=ur\.ek}%% \v{z}.r.
  \SetString\alsoname{taip pat}%% ten pat, tas pat
  \SetString\proofname{\k{I}rodymas}
  \SetString\glossaryname{Termin\k{u} \v{z}odynas}%

\StartBabelCommands*{lithuanian}{date}
    [unicode, charset=utf8, fontenc=TU EU1 EU2]

  \SetStringLoop{month#1lithuanian}{%
    sausio,vasario,kovo,balandžio,gegužės,birželio,%
    liepos,rugpjūčio,rugsėjo,spalio,lapkričio,gruodžio%
    }

\StartBabelCommands*{lithuanian}{date}

  \SetStringLoop{month#1lithuanian}{%
    sausio,vasario,kovo,baland\v{z}io,gegu\v{z}\.es,bir\v{z}elio,%
    liepos,rugpj\=u\v{c}io,rugs\.ejo,spalio,lapkri\v{c}io,gruod\v{z}io%
    }

\SetString\today{%
  \number\year~m.%
  ~\csname month\romannumeral\month lithuanian\endcsname
  ~\number\day~d.%
  }
%    \end{macrocode}
%
%  \subsubsection*{Extra chars cases}
%
%    \begin{macrocode}

\StartBabelCommands{lithuanian}{}[l7xenc, fontenc=L7x]

  \SetCase{%
     \uccode"E0="C0\relax % ąĄ 
     \uccode"E8="C8\relax % čČ
     \uccode"E6="C6\relax % ęĘ
     \uccode"EB="CB\relax % ėĖ
     \uccode"E1="C1\relax % įĮ
     \uccode"F0="D0\relax % šŠ
     \uccode"F8="D8\relax % ųŲ
     \uccode"FB="DB\relax % ūŪ
     \uccode"FE="DE\relax % žŽ
    }{%
     \lccode"C0="E0\relax % Ąą 
     \lccode"C8="E8\relax % Čč
     \lccode"C6="E6\relax % Ęę
     \lccode"CB="EB\relax % Ėė
     \lccode"C1="E1\relax % Įį
     \lccode"D0="F0\relax % Šš
     \lccode"D8="F8\relax % Ųų
     \lccode"DB="FB\relax % Ūū
     \lccode"DE="FE\relax % Žž
    }

\StartBabelCommands{lithuanian}{}[unicode, fontenc=TU EU1 EU2, charset=utf8]

  \SetCase{%
     \uccode`ą=`Ą\relax
     \uccode`č=`Č\relax
     \uccode`ę=`Ę\relax
     \uccode`ė=`Ė\relax
     \uccode`į=`Į\relax
     \uccode`š=`Š\relax
     \uccode`ų=`Ų\relax
     \uccode`ū=`Ū\relax
     \uccode`ž=`Ž\relax
    }{%
     \lccode`Ą=`ą\relax
     \lccode`Č=`č\relax
     \lccode`Ę=`ę\relax
     \lccode`Ė=`ė\relax
     \lccode`Į=`į\relax
     \lccode`Š=`š\relax
     \lccode`Ų=`ų\relax
     \lccode`Ū=`ū\relax
     \lccode`Ž=`ž\relax
    }

\EndBabelCommands
%    \end{macrocode}
%
%  \subsubsection*{Extras macros}
%
%    \begin{macrocode}

\addto\extraslithuanian{%
  \babel@save\fnum@figure
  \def\fnum@figure{\thefigure\nobreakspace\figurename}%
  \babel@save\fnum@table
  \def\fnum@table{\thetable\nobreakspace\tablename}%
  }
\addto\noextraslithuanian{}

\ldf@finish{lithuanian}

%</code>
%    \end{macrocode}
%
% \Finale
% \endinput
%% \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         \~}
%%