Typo
[latex2e.git] / latex2e-20150101 / required / babel / basque.dtx
blob33789ccdfd4199843605ee6d08d7a134b073e4ee
1 % \iffalse meta-comment
3 % Copyright 1989-2005 Johannes L. Braams and any individual authors
4 % listed elsewhere in this file.  All rights reserved.
5
6 % This file is part of the Babel system.
7 % --------------------------------------
8
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.
16
17 % This work has the LPPL maintenance status "maintained".
18
19 % The Current Maintainer of this work is Johannes Braams.
20
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
23 % information.
24
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.
28 % \fi
29 % \CheckSum{193}
30 % \iffalse
31 %    Tell the \LaTeX\ system who we are and write an entry on the
32 %    transcript.
33 %<*dtx>
34 \ProvidesFile{basque.dtx}
35 %</dtx>
36 %<code>\ProvidesLanguage{basque}
37 %\fi
38 %\ProvidesFile{basque.dtx}
39         [2005/03/29 v1.0f Basque support from the babel system]
40 %\iffalse
41 %% File `Basque.dtx'
42 %% Babel package for LaTeX version 2e
43 %% Copyright (C) 1989 - 2005
44 %%           by Johannes Braams, TeXniek
46 %% Basque Language Definition File
47 %% Copyright (C) 1997 - 2005
48 %%           by Juan M. Aguirregabiria
49 %              The University of the Basque Country
50 %              Dept. of Theoretical Physics
51 %              Apdo. 644
52 %              E-48080 Bilbao
53 %              Spain
54 %              tel: +34 946 012 593
55 %              fax: +34 944 648 500
56 %              e-mail: wtpagagj at lg.ehu.es
57 %              WWW:    http://tp.lc.ehu.es/jma.html
58 % based on the
59 % Spanish Language Definition File
60 % Copyright (C) 1991 - 1998
61 %           by Julio Sanchez
62 %              GMV, SA
63 %              c/ Isaac Newton 11
64 %              PTM - Tres Cantos
65 %              E-28760 Madrid
66 %              Spain
67 %              tel: +34 1 807 21 85
68 %              fax +34 1 807 21 99
69 %              jsanchez at gmv.es
71 % Acknowledgements: I am indebted to Zunbeltz Izaola,
72 %                   who suggested the use of \discretionary in "-
74 %% Please report errors to: Juan M. Aguirregabiria <wtpagagj at lg.ehu.es>
75 %%                          (or J.L. Braams <babel at braams.cistron.nl>)
77 %    This file is part of the babel system, it provides the source
78 %    code for the basque language definition file.
79 %<*filedriver>
80 \documentclass{ltxdoc}
81 \newcommand*\TeXhax{\TeX hax}
82 \newcommand*\babel{\textsf{babel}}
83 \newcommand*\langvar{$\langle \it lang \rangle$}
84 \newcommand*\note[1]{}
85 \newcommand*\Lopt[1]{\textsf{#1}}
86 \newcommand*\file[1]{\texttt{#1}}
87 \begin{document}
88  \DocInput{basque.dtx}
89 \end{document}
90 %</filedriver>
91 %\fi
92 % \GetFileInfo{basque.dtx}
94 %  \section{The Basque language}
96 %    The file \file{\filename}\footnote{The file described in this
97 %    section has version number \fileversion\ and was last revised on
98 %    \filedate. The original author is Juan M. Aguirregabiria,
99 %    (\texttt{wtpagagj@lg.ehu.es}) and is based on the Spanish file
100 %    by Julio S\'anchez,
101 %    (\texttt{jsanchez@gmv.es}).} defines all the language definition
102 %    macro's for the Basque language.
104 %    For this language the characters |~| and |"| are made
105 %    active. In table~\ref{tab:basque-quote} an overview is given of
106 %    their purpose.
107 %    \begin{table}[htb]
108 %     \centering
109 %     \begin{tabular}{lp{8cm}}
110 %      \verb="|= & disable ligature at this position.\\
111 %      |"-| & an explicit hyphen sign, allowing hyphenation
112 %             in the rest of the word.\\
113 %      |\-| & like the old |\-|, but allowing hyphenation
114 %             in the rest of the word. \\
115 %      |"<| & for French left double quotes (similar to $<<$).\\
116 %      |">| & for French right double quotes (similar to $>>$).\\
117 %      |~n| & a n with tilde. Works for uppercase too.
118 %     \end{tabular}
119 %     \caption{The extra definitions made by \file{basque.ldf}}
120 %     \label{tab:basque-quote}
121 %    \end{table}
122 %    These active accent characters behave according to their original
123 %    definitions if not followed by one of the characters indicated in
124 %    that table.
126 % \changes{basque-1.0f}{2002/01/07}{Changed url's for the patterns
127 %    file}
128 %    This option includes support for working with extended, 8-bit
129 %    fonts, if available. Support is based on
130 %    providing an appropriate definition for the accent macros on
131 %    entry to the Basque language. This is automatically done by
132 %    \LaTeXe\ or NFSS2. If T1 encoding is chosen, and provided that
133 %    adequate hyphenation patterns\footnote{One source for such
134 %    patterns is the archive at \texttt{tp.lc.ehu.es} that can be
135 %    accessed by anonymous FTP or in
136 %    \texttt{http://tp.lc.ehu.es/jma/basque.html}} are available. 
137 %    The easiest way to use the new encoding with \LaTeXe{} is
138 %    to load the package \texttt{t1enc} with |\usepackage|. This must
139 %    be done before loading \babel.
141 % \StopEventually{}
143 %    The macro |\LdfInit| takes care of preventing that this file is
144 %    loaded more than once, checking the category code of the
145 %    \texttt{@} sign, etc.
146 %    \begin{macrocode}
147 %<*code>
148 \LdfInit{basque}\captionsbasque
149 %    \end{macrocode}
151 %    When this file is read as an option, i.e. by the |\usepackage|
152 %    command, \texttt{basque} could be an `unknown' language in which
153 %    case we have to make it known.  So we check for the existence of
154 %    |\l@basque| to see whether we have to do something here.
156 %    \begin{macrocode}
157 \ifx\l@basque\@undefined
158   \@nopatterns{Basque}
159   \adddialect\l@basque0
161 %    \end{macrocode}
163 %    The next step consists of defining commands to switch to (and
164 %    from) the Basque language.
166 % \begin{macro}{\captionsbasque}
167 %    The macro |\captionsbasque| defines all strings used in 
168 %    the four standard documentclasses provided with \LaTeX.
169 % \changes{basque-1.0e}{2000/09/19}{Added \cs{glossaryname}}
170 % \changes{basque-1.0f}{2002/01/07}{Added translation for Glossary}
171 %    \begin{macrocode}
172 \addto\captionsbasque{%
173   \def\prefacename{Hitzaurrea}%
174   \def\refname{Erreferentziak}%
175   \def\abstractname{Laburpena}%
176   \def\bibname{Bibliografia}%
177   \def\chaptername{Kapitulua}%
178   \def\appendixname{Eranskina}%
179   \def\contentsname{Gaien Aurkibidea}%
180   \def\listfigurename{Irudien Zerrenda}%
181   \def\listtablename{Taulen Zerrenda}%
182   \def\indexname{Kontzeptuen Aurkibidea}%
183   \def\figurename{Irudia}%
184   \def\tablename{Taula}%
185   \def\partname{Atala}%
186   \def\enclname{Erantsia}%
187   \def\ccname{Kopia}%
188   \def\headtoname{Nori}%
189   \def\pagename{Orria}%
190   \def\seename{Ikusi}%
191   \def\alsoname{Ikusi, halaber}%
192   \def\proofname{Frogapena}%
193   \def\glossaryname{Glosarioa}%
194   }%
195 %    \end{macrocode}
196 % \end{macro}
198 % \begin{macro}{\datebasque}
199 %    The macro |\datebasque| redefines the command |\today| to
200 %    produce Basque
201 % \changes{basque-1.0b}{1997/10/01}{Use \cs{edef} to define \cs{today}
202 %    to save memory}
203 % \changes{basque-1.0b}{1998/03/28}{use \cs{def} instead of \cs{edef}}
204 % \changes{basque-1.0c}{1999/11/22}{fixed typo in April's name}
205 %    \begin{macrocode}
206 \def\datebasque{%
207   \def\today{\number\year.eko\space\ifcase\month\or
208     urtarrilaren\or otsailaren\or martxoaren\or apirilaren\or
209     maiatzaren\or ekainaren\or uztailaren\or abuztuaren\or
210     irailaren\or urriaren\or azaroaren\or
211     abenduaren\fi~\number\day}}
212 %    \end{macrocode}
213 % \end{macro}
215 % \begin{macro}{\extrasbasque}
216 % \begin{macro}{\noextrasbasque}
217 %    The macro |\extrasbasque| will perform all the extra definitions
218 %    needed for the Basque language. The macro |\noextrasbasque| is
219 %    used to cancel the actions of |\extrasbasque|. For Basque, some
220 %    characters are made active or are redefined. In particular, the
221 %    \texttt{"} character and the |~| character receive new
222 %    meanings. Therefore these characters have to be treated as
223 %    `special' characters. 
225 %    \begin{macrocode}
226 \addto\extrasbasque{\languageshorthands{basque}}
227 \initiate@active@char{"}
228 \initiate@active@char{~}
229 \addto\extrasbasque{%
230   \bbl@activate{"}%
231   \bbl@activate{~}}
232 %    \end{macrocode}
233 %    Don't forget to turn the shorthands off again.
234 % \changes{basque-1.0d}{1999/12/16}{Deactivate shorthands ouside of
235 %    Basque}
236 %    \begin{macrocode}
237 \addto\noextrasbasque{
238   \bbl@deactivate{"}\bbl@deactivate{~}}
239 %    \end{macrocode}
241 %    Apart from the active characters some other macros get a new
242 %    definition. Therefore we store the current one to be able to
243 %    restore them later.
244 %    \begin{macrocode}
245 \addto\extrasbasque{%
246   \babel@save\"%
247   \babel@save\~%
248   \def\"{\protect\@umlaut}%
249   \def\~{\protect\@tilde}}
250 %    \end{macrocode}
251 % \end{macro}
252 % \end{macro}
254 %  \begin{macro}{\basquehyphenmins}
255 %    Basque hyphenation uses |\lefthyphenmin| and |\righthyphenmin|
256 %    both set to~2.
257 % \changes{basque-1.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
258 %    provide a default value}
259 %    \begin{macrocode}
260 \providehyphenmins{\CurrentOption}{\tw@\tw@}
261 %    \end{macrocode}
262 % \end{macro}
264 %  \begin{macro}{\dieresia}
265 %  \begin{macro}{\texttilde}
266 %    The original definition of |\"| is stored as |\dieresia|, because
267 %    the we do not know what is its definition, since it depends on
268 %    the encoding we are using or on special macros that the user
269 %    might have loaded. The expansion of the macro might use the \TeX\
270 %    |\accent| primitive using some particular accent that the font
271 %    provides or might check if a combined accent exists in the font.
272 %    These two cases happen with respectively OT1 and T1 encodings.
273 %    For this reason we save the definition of |\"| and use that in
274 %    the definition of other macros. We do likewise for |\'| and
275 %    |\~|. The present coding of this option file is incorrect in that
276 %    it can break when the encoding changes. We do not use 
277 %    |\tilde| as the macro name because it is already defined as
278 %    |\mathaccent|.
279 %    \begin{macrocode}
280 \let\dieresia\"
281 \let\texttilde\~
282 %    \end{macrocode}
283 %  \end{macro}
284 %  \end{macro}
286 %  \begin{macro}{\@umlaut}
287 %  \begin{macro}{\@tilde}
288 %    We check the encoding and if not using T1, we make the accents
289 %    expand but enabling hyphenation beyond the accent. If this is the
290 %    case, not all break positions will be found in words that contain
291 %    accents, but this is a limitation in \TeX. An unsolved problem
292 %    here is that the encoding can change at any time. The definitions
293 %    below are made in such a way that a change between two 256-char
294 %    encodings are supported, but changes between a 128-char and a
295 %    256-char encoding are not properly supported. We check if T1 is
296 %    in use. If not, we will give a warning and proceed redefining the
297 %    accent macros so that \TeX{} at least finds the breaks that are
298 %    not too close to the accent. The warning will only be printed to
299 %    the log file.
300 %    \begin{macrocode}
301 \ifx\DeclareFontShape\@undefined
302   \wlog{Warning: You are using an old LaTeX}
303   \wlog{Some word breaks will not be found.}
304   \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
305   \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
306 \else
307   \edef\bbl@next{T1}
308   \ifx\f@encoding\bbl@next
309     \let\@umlaut\dieresia
310     \let\@tilde\texttilde
311   \else
312     \wlog{Warning: You are using encoding \f@encoding\space
313       instead of T1.}
314     \wlog{Some word breaks will not be found.}
315     \def\@umlaut#1{\allowhyphens\dieresia{#1}\allowhyphens}
316     \def\@tilde#1{\allowhyphens\texttilde{#1}\allowhyphens}
317   \fi
319 %    \end{macrocode}
320 %  \end{macro}
321 %  \end{macro}
323 %     Now we can define our shorthands: the french quotes,
324 % \changes{basque-1.0b}{1997/04/03}{Removed empty groups after
325 %    guillemot characters}  
326 %    \begin{macrocode}
327 \declare@shorthand{basque}{"<}{%
328   \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
329 \declare@shorthand{basque}{">}{%
330   \textormath{\guillemotright}{\mbox{\guillemotright}}}
331 %    \end{macrocode}
332 %    ordinals\footnote{The code for the ordinals was taken from the
333 %    answer provided by Raymond Chen
334 %    (\texttt{raymond@math.berkeley.edu}) to a question by Joseph Gil
335 %    (\texttt{yogi@cs.ubc.ca}) in \texttt{comp.text.tex}.},
336 %    \begin{macrocode}
337   \declare@shorthand{basque}{''}{%
338     \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
339 %    \end{macrocode}
340 %    tildes,
341 %    \begin{macrocode}
342 \declare@shorthand{basque}{~n}{\textormath{\~n}{\@tilde n}}
343 \declare@shorthand{basque}{~N}{\textormath{\~N}{\@tilde N}}
344 %    \end{macrocode}
345 %    and some additional commands.
347 %    The shorthand |"-| should be used in places where a word contains
348 %    an explictit hyphenation character. According to the Academy of
349 %    the Basque language, when a word break occurs at an explicit
350 %    hyphen it must appear \emph{both} at the end of the first line
351 %    \emph{and} at the beginning of the second line.
352 % \changes{changes-1.0f}{2002/01/07}{The hyphen char needs to appear
353 %    at the beginning of the line as well.}
354 %    \begin{macrocode}
355 \declare@shorthand{basque}{"-}{%
356   \nobreak\discretionary{-}{-}{-}\bbl@allowhyphens}
357 \declare@shorthand{basque}{"|}{%
358   \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
359               \allowhyphens}{}}
360 %    \end{macrocode}
362 %    The macro |\ldf@finish| takes care of looking for a
363 %    configuration file, setting the main language to be switched on
364 %    at |\begin{document}| and resetting the category code of
365 %    \texttt{@} to its original value.
366 %    \begin{macrocode}
367 \ldf@finish{basque}
368 %</code>
369 %    \end{macrocode}
371 % \Finale
374 %% \CharacterTable
375 %%  {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
376 %%   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
377 %%   Digits        \0\1\2\3\4\5\6\7\8\9
378 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
379 %%   Dollar        \$     Percent       \%     Ampersand     \&
380 %%   Acute accent  \'     Left paren    \(     Right paren   \)
381 %%   Asterisk      \*     Plus          \+     Comma         \,
382 %%   Minus         \-     Point         \.     Solidus       \/
383 %%   Colon         \:     Semicolon     \;     Less than     \<
384 %%   Equals        \=     Greater than  \>     Question mark \?
385 %%   Commercial at \@     Left bracket  \[     Backslash     \\
386 %%   Right bracket \]     Circumflex    \^     Underscore    \_
387 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
388 %%   Right brace   \}     Tilde         \~}
390 \endinput