Typo
[latex2e.git] / latex2e-20150101 / required / babel / catalan.dtx
blobb8185af4df881451d608e62f42d329a53a641981
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{517}
31 % \iffalse
32 %    Tell the \LaTeX\ system who we are and write an entry on the
33 %    transcript.
34 %<*dtx>
35 \ProvidesFile{catalan.dtx}
36 %</dtx>
37 %<code>\ProvidesLanguage{catalan}
38 %\fi
39 %\ProvidesFile{catalan.dtx}
40         [2005/03/29 v2.2p Catalan support from the babel system]
41 %\iffalse
42 %% File `catalan.dtx'
43 %% Babel package for LaTeX version 2e
44 %% Copyright (C) 1989 - 2005
45 %%           by Johannes Braams, TeXniek
47 %% Catalan Language Definition File
48 %% Copyright (C) 1991 - 2005
49 %%           by Goncal Badenes <badenes at imec.be>
50 %%              Johannes Braams, TeXniek
52 %% Please report errors to: J.L. Braams babel at braams.cistron.nl
54 %    This file is part of the babel system, it provides the source
55 %    code for the Catalan language definition file.
56 %    This file was developped out of spanish.sty and suggestions by
57 %    Goncal Badenes <badenes at imec.be> and Joerg Knappen
58 %    <knappen at vkpmzd.kph.uni-mainz.de>.
60 %    The file spanish.sty was written by Julio Sanchez,
61 %    (jsanchez@gmv.es) The code for the catalan language has been
62 %    removed and now is in this file.
63 %<*filedriver>
64 \documentclass{ltxdoc}
65 \newcommand*\TeXhax{\TeX hax}
66 \newcommand*\babel{\textsf{babel}}
67 \newcommand*\langvar{$\langle \it lang \rangle$}
68 \newcommand*\note[1]{}
69 \newcommand*\Lopt[1]{\textsf{#1}}
70 \newcommand*\file[1]{\texttt{#1}}
71 \begin{document}
72  \DocInput{catalan.dtx}
73 \end{document}
74 %</filedriver>
75 %\fi
77 % \GetFileInfo{catalan.dtx}
79 % \changes{catalan-2.0b}{1993/09/23}{Incorporated the changes from
80 %    \file{spanish.sty}}
81 % \changes{catalan-2.1}{1994/02/27}{Update for \LaTeXe}
82 % \changes{catalan-2.1d}{1994/06/26}{Removed the use of \cs{filedate}
83 %    and moved identification after the loading of \file{babel.def}}
84 % \changes{catalan-2.2b}{1995/07/04}{Made the activation of the grave
85 %    and acute accents optional}
86 % \changes{catalan-2.2c}{1995/07/08}{Removed the use of the tilde for
87 %    catalan}
88 % \changes{catalan-2.2f}{1996/07/13}{Replaced \cs{undefined} with
89 %    \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
90 %    with \LaTeX}
91 % \changes{catalan-2.2g}{1996/10/10}{Moved the definition of
92 %    \cs{atcatcode} right to the beginning.}
93 % \changes{catalan-2.2k}{1999/05/05}{A wrong \cs{changes} entry made
94 %    typesetting impossible}
96 %  \section{The Catalan language}
98 %    The file \file{\filename}\footnote{The file described in this
99 %    section has version number \fileversion\ and was last revised on
100 %    \filedate.}  defines all the language-specific macro's for the
101 %    Catalan language.
103 %    For this language only the double quote character (|"|) is made
104 %    active by default. In table~\ref{tab:catalan-quote-def} an
105 %    overview is given of the new macros defined and the new meanings
106 %    of |"|. Additionally to that, the user can explicitly activate
107 %    the acute accent or apostrophe (|'|) and/or the grave accent
108 %    (|`|) characters by using the \Lopt{activeacute} and
109 %    \Lopt{activegrave} options. In that case, the definitions shown
110 %    in table~\ref{tab:catalan-quote-opt} also become
111 %    available\footnote{Please note that if the acute accent character
112 %    is active, it is necessary to take special care of coding
113 %    apostrophes in a way which cannot be confounded with
114 %    accents. Therefore, it is necessary to type \texttt{l'\{\}estri}
115 %    instead of \texttt{l'estri}.}.
117 %    \begin{table}[htb]
118 %     \centering
119 %     \begin{tabular}{lp{8cm}}
120 %      |\l.l|   & geminated-l digraph (similar to
121 %               l$\cdot$l). |\L.L| produces the uppercase version.\\
122 %      |\lgem|  & geminated-l digraph (similar to
123 %               l$\cdot$l). |\Lgem| produces the uppercase version.\\
124 %      |\up| & Macro to help typing raised ordinals, like {1\raise
125 %               1ex\hbox{\small er}}. Takes one argument.\\
126 %      |\-| & like the old |\-|, but allowing hyphenation
127 %               in the rest of the word. \\
128 %      |"i| & i with diaeresis, allowing hyphenation
129 %             in the rest of the word. Valid for the following vowels:
130 %               i, u (both lowercase and uppercase).\\
131 %      |"c| & c-cedilla (\c{c}). Valid for both uppercase and
132 %               lowercase c.\\
133 %      |"l| & geminated-l digraph (similar to
134 %               l$\cdot$l). Valid for both uppercase and lowercase l.\\
135 %      |"<| & French left double quotes (similar to $<<$).\\
136 %      |">| & French right double quotes (similar to $>>$).\\
137 %      |"-| & explicit hyphen sign, allowing hyphenation
138 %               in the rest of the word.\\
139 %      \verb="|= & disable ligature at this position.
140 %     \end{tabular}
141 %     \caption{Extra definitions made by file \file{catalan.ldf}
142 %       (activated by default)}
143 %     \label{tab:catalan-quote-def}
144 %    \end{table}
146 %    \begin{table}[htb]
147 %     \centering
148 %     \begin{tabular}{lp{8cm}}
149 %      |'e| & acute accented a, allowing hyphenation
150 %             in the rest of the word. Valid for the following
151 %             vowels: e, i, o, u (both lowercase and uppercase).\\
152 %      |`a| & grave accented a, allowing hyphenation
153 %             in the rest of the word. Valid for the following
154 %             vowels: a, e, o (both lowercase and uppercase).
155 %     \end{tabular}
156 %     \caption{Extra definitions made by file \file{catalan.ldf}
157 %       (activated only when using the options \Lopt{activeacute} and
158 %       \Lopt{activegrave})}
159 %     \label{tab:catalan-quote-opt}
160 %    \end{table}
161 %    These active accents characters behave according to their original
162 %    definitions if not followed by one of the characters indicated in
163 %    that table.
165 % \StopEventually{}
167 % \changes{catalan-2.0}{1993/07/11}{Removed code to load
168 %    \file{latexhax.com}}
170 %    The macro |\LdfInit| takes care of preventing that this file is
171 %    loaded more than once, checking the category code of the
172 %    \texttt{@} sign, etc.
173 % \changes{catalan-2.2g}{1996/11/02}{Now use \cs{LdfInit} to perform
174 %    initial checks} 
175 %    \begin{macrocode}
176 %<*code>
177 \LdfInit{catalan}\captionscatalan
178 %    \end{macrocode}
180 %    When this file is read as an option, i.e. by the |\usepackage|
181 %    command, \texttt{catalan} could be an `unknown' language in which
182 %    case we have to make it known.  So we check for the existence of
183 %    |\l@catalan| to see whether we have to do something here.
185 % \changes{catalan-2.1d}{1994/06/26}{Now use \cs{@nopatterns} to
186 %    produce the warning}
187 %    \begin{macrocode}
188 \ifx\l@catalan\@undefined
189   \@nopatterns{Catalan}
190   \adddialect\l@catalan0
192 %    \end{macrocode}
194 %    The next step consists of defining commands to switch to (and
195 %    from) the Catalan language.
197 %  \begin{macro}{\catalanhyphenmins}
198 %    This macro is used to store the correct values of the hyphenation
199 %    parameters |\lefthyphenmin| and |\righthyphenmin|.
200 % \changes{catalan-2.2n}{2001/02/19}{Set the hyphenation parameters
201 %    both to two as required by \texttt{cahyph.tex}}
202 %    \begin{macrocode}
203 \providehyphenmins{catalan}{\tw@\tw@}
204 %    \end{macrocode}
205 %  \end{macro}
207 % \begin{macro}{\captionscatalan}
208 %    The macro |\captionscatalan| defines all strings used
209 %    in the four standard documentclasses provided with \LaTeX.
210 % \changes{catalan-1.1}{1993/07/11}{\cs{headpagename} should be
211 %    \cs{pagename}}
212 % \changes{catalan-2.0}{1993/07/11}{Added some names}
213 % \changes{catalan-2.1d}{1994/11/09}{Added a few missing translations}
214 % \changes{catalan-2.2b}{1995/07/03}{Added \cs{proofname} for
215 %    AMS-\LaTeX}
216 % \changes{catalan-2.2d}{1995/07/10}{added translation of Proof}
217 % \changes{catalan-2.2d}{1995/11/15}{Translations revised}
218 % \changes{catalan-2.2m}{2000/09/19}{Added \cs{glossaryname}}
219 % \changes{catalan-2.2p}{2003/11/17}{Inserted translation for
220 %    Glossary}
221 %    \begin{macrocode}
222 \addto\captionscatalan{%
223   \def\prefacename{Pr\`oleg}%
224   \def\refname{Refer\`encies}%
225   \def\abstractname{Resum}%
226   \def\bibname{Bibliografia}%
227   \def\chaptername{Cap\'{\i}tol}%
228   \def\appendixname{Ap\`endix}%
229   \def\contentsname{\'Index}%
230   \def\listfigurename{\'Index de figures}%
231   \def\listtablename{\'Index de taules}%
232   \def\indexname{\'Index alfab\`etic}%
233   \def\figurename{Figura}%
234   \def\tablename{Taula}%
235   \def\partname{Part}%
236   \def\enclname{Adjunt}%
237   \def\ccname{C\`opies a}%
238   \def\headtoname{A}%
239   \def\pagename{P\`agina}%
240   \def\seename{Vegeu}%
241   \def\alsoname{Vegeu tamb\'e}%
242   \def\proofname{Demostraci\'o}%
243   \def\glossaryname{Glossari}%
245 %    \end{macrocode}
246 % \end{macro}
248 % \begin{macro}{\datecatalan}
249 %    The macro |\datecatalan| redefines the command |\today| to
250 %    produce Catalan dates. Months are written in
251 %    lowercase\footnote{This seems to be the common practice. See for
252 %    example: E.~Coromina, \emph{El 9 Nou: Manual de redacci\'o i
253 %    estil}, Ed.~Eumo, Vic, 1993}.
254 % \changes{catalan-2.2b}{1995/06/18}{Month names in lowercase}
255 % \changes{catalan-2.2i}{1997/10/01}{Use \cs{edef} to define \cs{today}
256 %    to save memory}
257 % \changes{catalan-2.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
258 %    \begin{macrocode}
259 \def\datecatalan{%
260   \def\today{\number\day~\ifcase\month\or
261     de gener\or de febrer\or de mar\c{c}\or d'abril\or de maig\or
262     de juny\or de juliol\or d'agost\or de setembre\or d'octubre\or
263     de novembre\or de desembre\fi
264     \space de~\number\year}}
265 %    \end{macrocode}
266 % \end{macro}
268 % \begin{macro}{\extrascatalan}
269 % \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
270 % \changes{catalan-2.2a}{1995/03/11}{Handling of active characters
271 %    completely rewritten}
273 % \begin{macro}{\noextrascatalan}
274 % \changes{catalan-2.0}{1993/07/11}{Macro completely rewritten}
276 %    The macro |\extrascatalan| will perform all the extra definitions
277 %    needed for the Catalan language.  The macro |\noextrascatalan| is
278 %    used to cancel the actions of |\extrascatalan|.
280 % \changes{catalan-2.2e}{1995/11/10}{Now give the apostrophe a
281 %    lowercase code}
282 %    To improve hyphenation we give the grave character (\texttt{'}) a
283 %    non-zero lower case code; when we do that \TeX\ will find more
284 %    breakpoints in words that contain this character in its r\^ole as
285 %    apostrophe. 
286 %    \begin{macrocode}
287 \addto\extrascatalan{%
288   \lccode`'=`'}
289 \addto\noextrascatalan{%
290   \lccode`'=0}
291 %    \end{macrocode}
293 %    For Catalan, some characters are made active or are redefined. In
294 %    particular, the \texttt{"} character receives a new meaning; this
295 %    can also happen for the \texttt{'} character and the \texttt{`}
296 %    character when the options \Lopt{activegrave} and/or
297 %    \Lopt{activeacute} are specified.
299 % \changes{catalan-2.2b}{1995/07/07}{Make activating the accent
300 %    characters optional}
301 % \changes{catalan-2.2e}{1995/08/17}{Need to split up the
302 %    \cs{@ifpackagewith} statements}
303 %    \begin{macrocode}
304 \addto\extrascatalan{\languageshorthands{catalan}}
305 \initiate@active@char{"}
306 \addto\extrascatalan{\bbl@activate{"}}
307 %    \end{macrocode}
308 %    Because the grave character is being used in constructs such as
309 %    |\catcode``=\active| it needs to have it's original category code%''
310 %    when the auxiliary file is being read. Note that this file is
311 %    read twice, once at the beginning of the document; then there is
312 %    no problem; but the second time it is read at the end of the
313 %    document to check whether any labels changes. It's this second
314 %    time round that the actived grave character leads to error
315 %    messages.
316 % \changes{catalan-2.2l}{1999/11/29}{Make sure that the grave accent
317 %    has catcode 12 \emph{before} it is made \cs{active}}
318 %    \begin{macrocode}
319 \@ifpackagewith{babel}{activegrave}{%
320   \AtBeginDocument{%
321     \if@filesw\immediate\write\@auxout{\catcode096=12}\fi}
322   \initiate@active@char{`}%
323   }{}
324 \@ifpackagewith{babel}{activegrave}{%
325   \addto\extrascatalan{\bbl@activate{`}}%
326   }{}
327 \@ifpackagewith{babel}{activeacute}{%
328   \initiate@active@char{'}%
329   }{}
330 \@ifpackagewith{babel}{activeacute}{%
331   \addto\extrascatalan{\bbl@activate{'}}%
332   }{}
333 %    \end{macrocode}
334 %    Now make sure that the characters that have been turned into
335 %    shorthanfd characters expand to `normal' characters outside the
336 %    catalan environment.
337 % \changes{catalan-2.2l}{1999/12/16}{Don't forget do deactivate the
338 %    shorthands}
339 %    \begin{macrocode}
340 \addto\noextrascatalan{\bbl@deactivate{"}}
341 \@ifpackagewith{babel}{activegrave}{%
342   \addto\noextrascatalan{\bbl@deactivate{`}}}{}
343 \@ifpackagewith{babel}{activeacute}{%
344   \addto\noextrascatalan{\bbl@deactivate{'}}}{}
345 %    \end{macrocode}
347 % \changes{catalan-2.2a}{1995/03/11}{All the code for handling active
348 %    characters is now moved to \file{babel.def}}
350 %    Apart from the active characters some other macros get a new
351 %    definition. Therefore we store the current ones to be able
352 %    to restore them later.
353 %    When their current meanings are saved, we can safely redefine
354 %    them.
356 %    We provide new definitions for the accent macros when one or
357 %    both of the options \Lopt{activegrave} or \Lopt{activeacute}
358 %    were specified.
360 % \changes{catalan-2.2h}{1997/01/08}{Added some comment signs to
361 %    prevent unwanted spaces in the output} 
362 %    \begin{macrocode}
363 \addto\extrascatalan{%
364   \babel@save\"%
365   \def\"{\protect\@umlaut}}%
366 \@ifpackagewith{babel}{activegrave}{%
367   \babel@save\`%
368   \addto\extrascatalan{\def\`{\protect\@grave}}
369   }{}
370 \@ifpackagewith{babel}{activeacute}{%
371   \babel@save\'%
372   \addto\extrascatalan{\def\'{\protect\@acute}}
373   }{}
374 %    \end{macrocode}
375 % \end{macro}
376 % \end{macro}
378 %    All the code above is necessary because we need a few extra
379 %    active characters. These characters are then used as indicated in
380 %    tables~\ref{tab:catalan-quote-def}
381 %    and~\ref{tab:catalan-quote-opt}.
383 %  \begin{macro}{\dieresis}
384 %  \begin{macro}{\textacute}
385 % \changes{catalan-2.1d}{1994/06/26}{Renamed from \cs{acute} as that
386 %    is a \cs{mathaccent}}
387 %  \begin{macro}{\textgrave}
389 %    The original definition of |\"| is stored as |\dieresis|, because
390 %    the definition of |\"| might not be the default plain \TeX\
391 %    one. If the user uses \textsc{PostScript} fonts with the Adobe
392 %    font encoding the \texttt{"} character is not in the same
393 %    position as in Knuth's font encoding. In this case |\"| will not
394 %    be defined as |\accent"7F 1|, but as |\accent'310 #1|. Something
395 %    similar happens when using fonts that follow the Cork
396 %    encoding. For this reason we save the definition of |\"| and use
397 %    that in the definition of other macros. We do likewise for |\`|,
398 %    and |\'|.
399 %    \begin{macrocode}
400 \let\dieresis\"
401 \@ifpackagewith{babel}{activegrave}{\let\textgrave\`}{}
402 \@ifpackagewith{babel}{activeacute}{\let\textacute\'}{}
403 %    \end{macrocode}
404 %  \end{macro}
405 %  \end{macro}
406 %  \end{macro}
408 %  \begin{macro}{\@umlaut}
409 %  \begin{macro}{\@acute}
410 %  \begin{macro}{\@grave}
411 %    We check the encoding and if not using T1, we make the accents
412 %    expand but enabling hyphenation beyond the accent. If this is the
413 %    case, not all break positions will be found in words that contain
414 %    accents, but this is a limitation in \TeX. An unsolved problem
415 %    here is that the encoding can change at any time. The definitions
416 %    below are made in such a way that a change between two 256-char
417 %    encodings are supported, but changes between a 128-char and a
418 %    256-char encoding are not properly supported. We check if T1 is
419 %    in use. If not, we will give a warning and proceed redefining the
420 %    accent macros so that \TeX{} at least finds the breaks that are
421 %    not too close to the accent. The warning will only be printed to
422 %    the log file.
424 %    \begin{macrocode}
425 \ifx\DeclareFontShape\@undefined
426   \wlog{Warning: You are using an old LaTeX}
427   \wlog{Some word breaks will not be found.}
428   \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
429   \@ifpackagewith{babel}{activeacute}{%
430     \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
431   \@ifpackagewith{babel}{activegrave}{%
432     \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
433 \else
434   \ifx\f@encoding\bbl@t@one
435     \let\@umlaut\dieresis
436     \@ifpackagewith{babel}{activeacute}{%
437       \let\@acute\textacute}{}
438     \@ifpackagewith{babel}{activegrave}{%
439       \let\@grave\textgrave}{}
440   \else
441     \wlog{Warning: You are using encoding \f@encoding\space
442       instead of T1.}
443     \wlog{Some word breaks will not be found.}
444     \def\@umlaut#1{\allowhyphens\dieresis{#1}\allowhyphens}
445     \@ifpackagewith{babel}{activeacute}{%
446       \def\@acute#1{\allowhyphens\textacute{#1}\allowhyphens}}{}
447     \@ifpackagewith{babel}{activegrave}{%
448       \def\@grave#1{\allowhyphens\textgrave{#1}\allowhyphens}}{}
449   \fi
451 %    \end{macrocode}
452 %    If the user setup has extended fonts, the Ferguson macros are
453 %    required to be defined. We check for their existance and, if
454 %    defined, expand to whatever they are defined to. For instance,
455 %    |\'a| would check for the existance of a |\@ac@a| macro. It is
456 %    assumed to expand to the code of the accented letter.  If it is
457 %    not defined, we assume that no extended codes are available and
458 %    expand to the original definition but enabling hyphenation beyond
459 %    the accent. This is as best as we can do. It is better if you
460 %    have extended fonts or ML-\TeX{} because the hyphenation
461 %    algorithm can work on the whole word. The following macros are
462 %    directly derived from ML-\TeX{}.\footnote{A problem is perceived
463 %    here with these macros when used in a multilingual environment
464 %    where extended hyphenation patterns are available for some but
465 %    not all languages. Assume that no extended patterns exist at some
466 %    site for French and that \file{french.sty} would adopt this
467 %    scheme too. In that case, \mbox{\texttt{'e}} in French would
468 %    produce the combined accented letter, but hyphenation around it
469 %    would be suppressed. Both language options would need an
470 %    independent method to know whether they have extended patterns
471 %    available. The precise impact of this problem and the possible
472 %    solutions are under study.}
473 %  \end{macro}
474 %  \end{macro}
475 %  \end{macro}
477 % \changes{catalan-2.2a}{1995/03/14}{All the code to deal with active
478 %    characters is now in \file{babel.def}} 
480 %    Now we can define our shorthands: the diaeresis and ``ela
481 %    geminada'' support,
482 %    \begin{macrocode}
483 \declare@shorthand{catalan}{"i}{\textormath{\@umlaut\i}{\ddot\imath}}
484 \declare@shorthand{catalan}{"l}{\lgem{}}
485 \declare@shorthand{catalan}{"u}{\textormath{\@umlaut u}{\ddot u}}
486 \declare@shorthand{catalan}{"I}{\textormath{\@umlaut I}{\ddot I}}
487 \declare@shorthand{catalan}{"L}{\Lgem{}}
488 \declare@shorthand{catalan}{"U}{\textormath{\@umlaut U}{\ddot U}}
489 %    \end{macrocode}
490 %    cedille,
491 % \changes{catalan-2.2c}{1995/07/08}{cedile now produced by double
492 %    quote shorthand}
493 %    \begin{macrocode}
494 \declare@shorthand{catalan}{"c}{\textormath{\c c}{^{\prime} c}}
495 \declare@shorthand{catalan}{"C}{\textormath{\c C}{^{\prime} C}}
496 %    \end{macrocode}
497 %    `french' quote characters,
498 % \changes{catalan-2.2c}{1995/07/08}{Added shorthands for guillemets}
499 % \changes{catalan-2.2i}{1997/04/03}{Removed empty groups after
500 %    guillemot characters} 
501 %    \begin{macrocode}
502 \declare@shorthand{catalan}{"<}{%
503   \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
504 \declare@shorthand{catalan}{">}{%
505   \textormath{\guillemotright}{\mbox{\guillemotright}}}
506 %    \end{macrocode}
507 %     grave accents,
508 % \changes{catalan-2.2e}{1996/03/05}{Added `{}` as an axtra shorthand}
509 %    \begin{macrocode}
510 \@ifpackagewith{babel}{activegrave}{%
511   \declare@shorthand{catalan}{`a}{\textormath{\@grave a}{\grave a}}
512   \declare@shorthand{catalan}{`e}{\textormath{\@grave e}{\grave e}}
513   \declare@shorthand{catalan}{`o}{\textormath{\@grave o}{\grave o}}
514   \declare@shorthand{catalan}{`A}{\textormath{\@grave A}{\grave A}}
515   \declare@shorthand{catalan}{`E}{\textormath{\@grave E}{\grave E}}
516   \declare@shorthand{catalan}{`O}{\textormath{\@grave O}{\grave O}}
517   \declare@shorthand{catalan}{``}{\textquotedblleft}%''
518   }{}
519 %    \end{macrocode}
520 %     acute accents,
521 % \changes{catalan-2.2b}{1995/07/03}{Changed mathmode definition of
522 %    acute shorthands to expand to a single prime followed by the next
523 %    character in the input}
524 % \changes{catalan-2.2e}{1995/09/05}{Added vertical bar as argument to
525 %    active acute}
526 %    \begin{macrocode}
527 \@ifpackagewith{babel}{activeacute}{%
528   \declare@shorthand{catalan}{'a}{\textormath{\@acute a}{^{\prime} a}}
529   \declare@shorthand{catalan}{'e}{\textormath{\@acute e}{^{\prime} e}}
530   \declare@shorthand{catalan}{'i}{\textormath{\@acute\i{}}{^{\prime} i}}
531   \declare@shorthand{catalan}{'o}{\textormath{\@acute o}{^{\prime} o}}
532   \declare@shorthand{catalan}{'u}{\textormath{\@acute u}{^{\prime} u}}
533   \declare@shorthand{catalan}{'A}{\textormath{\@acute A}{^{\prime} A}}
534   \declare@shorthand{catalan}{'E}{\textormath{\@acute E}{^{\prime} E}}
535   \declare@shorthand{catalan}{'I}{\textormath{\@acute I}{^{\prime} I}}
536   \declare@shorthand{catalan}{'O}{\textormath{\@acute O}{^{\prime} O}}
537   \declare@shorthand{catalan}{'U}{\textormath{\@acute U}{^{\prime} U}}
538   \declare@shorthand{catalan}{'|}{%
539     \textormath{\csname normal@char\string'\endcsname}{^{\prime}}}
540 %    \end{macrocode}
541 %         the acute accent,
542 % \changes{catalan-2.2c}{1995/07/08}{Added '{}' as an axtra shorthand,
543 %    removed 'n as a shorthand}
544 %    \begin{macrocode}
545   \declare@shorthand{catalan}{''}{%
546     \textormath{\textquotedblright}{\sp\bgroup\prim@s'}}
547   }{}
548 %    \end{macrocode}
549 %    and finally, some support definitions
550 %    \begin{macrocode}
551 \declare@shorthand{catalan}{"-}{\nobreak-\bbl@allowhyphens}
552 \declare@shorthand{catalan}{"|}{%
553   \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
554               \allowhyphens}{}}
555 %    \end{macrocode}
557 %  \begin{macro}{\-}
559 %    All that is left now is the redefinition of |\-|. The new version
560 %    of |\-| should indicate an extra hyphenation position, while
561 %    allowing other hyphenation positions to be generated
562 %    automatically. The standard behaviour of \TeX\ in this respect is
563 %    unfortunate for Catalan but not as much as for Dutch or German,
564 %    where long compound words are quite normal and all one needs is a
565 %    means to indicate an extra hyphenation position on top of the
566 %    ones that \TeX\ can generate from the hyphenation
567 %    patterns. However, the average length of words in Catalan makes
568 %    this desirable and so it is kept here.
570 %    \begin{macrocode}
571 \addto\extrascatalan{%
572   \babel@save{\-}%
573   \def\-{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}}
574 %    \end{macrocode}
575 %  \end{macro}
577 %  \begin{macro}{\lgem}
578 %  \begin{macro}{\Lgem}
579 % \changes{catalan-2.2b}{1995/06/18}{Added support for typing the
580 %    catalan ``ela geminada'' with the macros \cs{lgem} and \cs{Lgem}}
581 % \changes{catalan-2.2f}{1996/09/20}{Added a check for math mode as
582 %    the use of \cs{lgem} and \cs{Lgem} in math mode is not sensible.}
584 %    Here we define a macro for typing the catalan ``ela geminada''
585 %    (geminated l). The macros |\lgem| and |\Lgem| have been chosen
586 %    for its lowercase and uppercase representation,
587 %    respectively\footnote{The macro names \cs{ll} and \cs{LL} were
588 %    not taken because of the fact that \cs{ll} is already used in
589 %    mathematical mode.}.
591 %    The code used in the actual macro used is a combination of the
592 %    one proposed by Feruglio and Fuster\footnote{G.~Valiente and
593 %    R.~Fuster, Typesetting Catalan Texts with \TeX, \emph{TUGboat}
594 %    \textbf{14}(3), 1993.} and the proposal\footnote{G. Valiente,
595 %    Modern Catalan Typographical Conventions, \emph{TUGboat}
596 %    \textbf{16}(3), 1995.} from Valiente presented at the \TeX\ Users
597 %    Group Annual Meeting in 1995. This last proposal has not been
598 %    fully implemented due to its limitation to CM fonts.
599 %    \begin{macrocode}
600 \newdimen\leftllkern \newdimen\rightllkern \newdimen\raiselldim
601 \def\lgem{%
602   \ifmmode
603     \csname normal@char\string"\endcsname l%
604   \else
605     \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
606     \setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
607     \advance\raiselldim by \the\fontdimen5\the\font
608     \advance\raiselldim by -\ht2%
609     \leftllkern=-.25\wd0%
610     \advance\leftllkern by \wd1%
611     \advance\leftllkern by -\wd0%
612     \rightllkern=-.25\wd0%
613     \advance\rightllkern by -\wd1%
614     \advance\rightllkern by \wd0%
615     \allowhyphens\discretionary{l-}{l}%
616     {\hbox{l}\kern\leftllkern\raise\raiselldim\hbox{.}%
617       \kern\rightllkern\hbox{l}}\allowhyphens
618   \fi
619   }
620 \def\Lgem{%
621   \ifmmode
622     \csname normal@char\string"\endcsname L%
623   \else
624     \leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
625     \setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
626     \advance\raiselldim by .5\ht0%
627     \advance\raiselldim by -.5\ht2%
628     \leftllkern=-.125\wd0%
629     \advance\leftllkern by \wd1%
630     \advance\leftllkern by -\wd0%
631     \rightllkern=-\wd0%
632     \divide\rightllkern by 6%
633     \advance\rightllkern by -\wd1%
634     \advance\rightllkern by \wd0%
635     \allowhyphens\discretionary{L-}{L}%
636     {\hbox{L}\kern\leftllkern\raise\raiselldim\hbox{.}%
637       \kern\rightllkern\hbox{L}}\allowhyphens
638   \fi
639   }
640 %    \end{macrocode}
641 %  \end{macro}
642 %  \end{macro}
644 %  \begin{macro}{\l.l}
645 %  \begin{macro}{\L.L}
646 % \changes{catalan-2.2e}{1996/06/26}{Added redefinition of \cs{l} and
647 %    \cs{L}}
648 %    It seems to be the most natural way of entering the ``ela
649 %    geminda'' to use the sequences |\l.l| and |\L.L|. These are not
650 %    really macro's by themselves but the macros |\l| and |\L| with
651 %    delimited arguments. Therefor we define two macros that check if
652 %    the next character is a period. If not the ``polish l'' will be
653 %    typeset, otherwise a ``ela geminada'' will be typeset and the
654 %    next two tokens will be `eaten'.
655 % \changes{catalan-2.2o}{2003/09/19}{Postpone the redefinition of
656 %    \cs{l} and \cs{L} until begin document to prevent overwriting by
657 %    fontenc}
658 %    \begin{macrocode}
659 \AtBeginDocument{%
660   \let\lslash\l
661   \let\Lslash\L
662   \DeclareRobustCommand\l{\@ifnextchar.\bbl@l\lslash}
663   \DeclareRobustCommand\L{\@ifnextchar.\bbl@L\Lslash}}
664 \def\bbl@l#1#2{\lgem}
665 \def\bbl@L#1#2{\Lgem}
666 %    \end{macrocode}
667 %  \end{macro}
668 %  \end{macro}
670 %  \begin{macro}{\up}
672 %    A macro for typesetting things like 1\raise1ex\hbox{\small er} as
673 %    proposed by Raymon Seroul\footnote{This macro has been borrowed
674 %    from francais.dtx}.
675 % \changes{catalan-2.2b}{1995/06/18}{Added definition of macro
676 %    \cs{up}, which can be used to type ordinals}
677 % \changes{catalan-2.2e}{1996/02/29}{Now use \cs{textsuperscript} and
678 %    make \cs{up} robust}
679 %    \begin{macrocode}
680 \DeclareRobustCommand*{\up}[1]{\textsuperscript{#1}}
681 %    \end{macrocode}
682 %  \end{macro}
684 %    The macro |\ldf@finish| takes care of looking for a
685 %    configuration file, setting the main language to be switched on
686 %    at |\begin{document}| and resetting the category code of
687 %    \texttt{@} to its original value.
688 % \changes{catalan-2.2g}{1996/11/02}{Now use \cs{ldf@finish} to wrap
689 %    up} 
690 %    \begin{macrocode}
691 \ldf@finish{catalan}
692 %</code>
693 %    \end{macrocode}
695 % \Finale
696 %% \CharacterTable
697 %%  {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
698 %%   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
699 %%   Digits        \0\1\2\3\4\5\6\7\8\9
700 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
701 %%   Dollar        \$     Percent       \%     Ampersand     \&
702 %%   Acute accent  \'     Left paren    \(     Right paren   \)
703 %%   Asterisk      \*     Plus          \+     Comma         \,
704 %%   Minus         \-     Point         \.     Solidus       \/
705 %%   Colon         \:     Semicolon     \;     Less than     \<
706 %%   Equals        \=     Greater than  \>     Question mark \?
707 %%   Commercial at \@     Left bracket  \[     Backslash     \\
708 %%   Right bracket \]     Circumflex    \^     Underscore    \_
709 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
710 %%   Right brace   \}     Tilde         \~}
712 \endinput