Typo
[latex2e.git] / latex2e-20150101 / required / babel / italian.dtx
blobd054726438b15b23c373aaaf2116a6bc642c338e
1 % \iffalse meta-comment
3 % Copyright 1989-2008 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{424}
30 % \iffalse
31 %    Tell the \LaTeX\ system who we are and write an entry on the
32 %    transcript.
33 %<*dtx>
34 \ProvidesFile{italian.dtx}
35 %</dtx>
36 %<code>\ProvidesLanguage{italian}
37 %\fi
38 %\ProvidesFile{italian.dtx}
39         [2008/03/14 v1.2t Italian support from the babel system]
40 %\iffalse
41 %% File `italian.dtx'
42 %% Babel package for LaTeX version 2e
43 %% Copyright (C) 1989 - 2008
44 %%           by Johannes Braams, TeXniek
46 %% Please report errors to: J.L. Braams
47 %%                          babel at braams.xs4all.nl
48 %%                          Claudio Beccari 
49 %%                          claudio.beccari at gmail.it
51 %    This file is part of the babel system, it provides the source
52 %    code for the Italian language definition file.
53 %    The original version of this file was written by Maurizio
54 %    Codogno, (mau@beatles.cselt.stet.it). Several features were added
55 %    by Claudio Beccari, (beccari@polito.it).
56 %<*filedriver>
57 \documentclass{ltxdoc}
58 \newcommand*\TeXhax{\TeX hax}
59 \newcommand*\babel{\textsf{babel}}
60 \newcommand*\langvar{$\langle \it lang \rangle$}
61 \newcommand*\note[1]{}
62 \newcommand*\Lopt[1]{\textsf{#1}}
63 \newcommand*\file[1]{\texttt{#1}}
64 \begin{document}
65  \DocInput{italian.dtx}
66 \end{document}
67 %</filedriver>
68 %\fi
69 % \GetFileInfo{italian.dtx}
71 % \changes{italian-0.99}{1990/07/11}{First version, from english.doc}
72 % \changes{italian-1.0}{1991/04/23}{Modified for babel 3.0}
73 % \changes{italian-1.0a}{1991/05/23}{removed typo}
74 % \changes{italian-1.0b}{1991/05/29}{Removed bug found by van der Meer}
75 % \changes{italian-1.0e}{1991/07/15}{Renamed \file{babel.sty} in
76 %    \file{babel.com}}
77 % \changes{italian-1.1}{1992/02/16}{Brought up-to-date with babel 3.2a}
78 % \changes{italian-1.2}{1994/02/09}{Update for\ LaTeXe}
79 % \changes{italian-1.2e}{1994/06/26}{Removed the use of \cs{filedate}
80 %    and moved identification after the loading of \file{babel.def}}
81 % \changes{italian-1.2f}{1995/05/28}{Updated for babel 3.5}
82 % \changes{italian-1.2i}{1996/10/10}{Replaced \cs{undefined} with
83 %    \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
84 %    with \LaTeX, moved the definition of \cs{atcatcode} right to the
85 %    beginning.}
86 % \changes{italian-1.2l}{1999/04/24}{Added \cs{unit}, \cs{ap}, and
87 %    \cs{ped} macros}
88 % \changes{italian-1.2m}{2000/01/05}{Added support for etymological
89 %    hyphenation}
90 % \changes{italian-1.2n}{2000/02/02}{Completely modified etymological
91 %    hyphenation facility}
92 % \changes{italian-1.2n}{2000/05/28}{Added several commands for the
93 %   caporali double quotes and for simplifying the accented vowel input}
94 % \changes{italian-1.2o}{2000/12/12}{Added \cs{glossaryname}}
95 % \changes{italian-1.2p}{2002/07/10}{Removed redefinition of
96 %    \cs{add@acc} since its functionality has been introduced into the
97 %    kernel of LaTeX 2001/06/01}
98 % \changes{italian-1.2q}{2005/02/05}{Added test for avoiding conflict
99 %    with package units.sty; adjusted caporali functionality, since
100 %    the previous one did not work with the standard (although obsolete)
101 %    slides class file}
102 % \changes{italian-1.2s}{2007/01/12}{Corrected email of CB}
103 %  \section{The Italian language}
105 %    The file \file{\filename}\footnote{The file described in this
106 %    section has version number \fileversion\ and was last revised on
107 %    \filedate. The original author is Maurizio Codogno,
108 %    (\texttt{mau@beatles.cselt.stet.it}). It has been largely revised
109 %    by Johannes Braams and Claudio Beccari} defines all the
110 %    language-specific macros for the Italian language.
112 %    The features of this language definition file are the following:
113 %    \begin{enumerate}
114 %    \item The Italian hyphenation is invoked, provided that file
115 %      \texttt{ithyph.tex} was loaded when the \LaTeXe\ format was
116 %      built; in case it was not, read the information coming with your
117 %      distribution of the \TeX\ software, and the \babel\
118 %      documentation.
119 %    \item The language dependent fixed words to be inserted by such
120 %      commands as |\chapter|, |\caption|, |\tableofcontents|,
121 %      etc. are redefined in accordance with the Italian
122 %      typographical practice.
123 %    \item Since Italian can be easily hyphenated and Italian practice
124 %      allows to break a word before the last two letters, hyphenation
125 %      parameters have been set accordingly, but a very high demerit
126 %      value has been set in order to avoid word breaks in the
127 %      penultimate line of a paragraph. Specifically the |\clubpenalty|,
128 %      and the |\widowpenalty| are set to rather high values and
129 %      |\finalhyphendemerits| is set to such a high value that
130 %      hyphenation is prohibited between the last two lines of a
131 %      paragraph. In orer to make it consistent, also |\@clubpenalty|
132 %      is set to the same value; actualy the latter value is the
133 %      reset value after every sectioning command, so that after the
134 %      first section, |\clubpenalty| is reset to the low default value.
135 %      Thanks to Enrico Gregorio for spotting this serious bug.
136 %    \item Some language specific shortcuts have been defined so as to
137 %      allow etymological hyphenation, specifically |"| inserts a
138 %      break point in any word boundary that the typesetter chooses,
139 %      provided it is not followed by and accented letter (very unlikely
140 %      in Italian, where compulsory accents fall only on the last and
141 %      ending vowel of a word, but may take place with compound words
142 %      that include foreign roots), and \verb="|= when the desired break
143 %      point falls before an accented letter.
144 %    \item The shortcut |""| introduces the raised (English) opening
145 %      double quotes; this shortcut proves its usefulness when one
146 %      reminds that the Italian keyboard misses the backtick key, and
147 %      the backtick on a Windows based platform may be obtained only by
148 %      pressing the \texttt{Alt} key while inputting the numerical code
149 %      0096; very, very annoying!
150 %    \item The shortcuts |"<| and |">| insert the French guillemots,
151 %      sometimes used in Italian typography; with the T1 font encoding
152 %      the ligatures |<<| and |>>| should insert such signs directly,
153 %      but not all the  virtual fonts that claim to follow the T1 font
154 %      encoding actually contain the guillemots; with the OT1 encoding
155 %      the guillemots are not available and must be faked in some
156 %      way. By using the |"<| and |">| shortcuts (even with the T1
157 %      encoding) the necessary tests are performed and in case the
158 %      suitable glyphs are taken from other fonts normally available
159 %      with any good, modern \LaTeX\ distribution.
160 %    \item Three new specific commands |\unit|, |\ped|, and |\ap| are
161 %      introduced so as to  enable the correct composition of technical
162 %      mathematics according to the ISO~31/XI recommendations. |\unit|
163 %      does not get redefined if the \babel\ package is loaded \emph{after}
164 %      the package \texttt{units.sty} whose homonymous command plays
165 %      a different role and follows a different syntax.
166 %    \end{enumerate}
168 %    For this language a limited number of shortcuts has been defined,
169 %    table~\ref{t:itshrtct}, some of which are used to overcome
170 %    certain limitations of the Italian keyboard; in
171 %    section~\ref{s:itkbd} there are other comments and hints in order
172 %    to overcome some other keyboard limitations.
174 %    \begin{table}[htb]\centering
175 %    \begin{tabular}{cp{80mm}}
176 %    |"|    & inserts a compound word mark where hyphenation is legal;
177 %             it allows etymological hyphenation which is recommended
178 %             for technical terms, chemical names and the like; it
179 %             does not work if the next character is represented with
180 %             a control sequence or is an accented character.\\
181 %    \texttt{\string"\string|}
182 %           & the same as the above without the limitation on
183 %            characters represented with control sequences or accented
184 %            ones.\\
185 %    |""|   & inserts open quotes ``.\\ %^^A'' emacs matching
186 %    |"<|   & inserts open guillemots.\\
187 %    |">|   & inserts closed guillemots.\\
188 %    |"/|   & equivalent to |\slash|
189 %    \end{tabular}
190 %    \caption{Shortcuts for the Italian language}\label{t:itshrtct}
191 %    \end{table}
193 % \StopEventually{%
194 %    \begin{thebibliography}{1}
195 %    \bibitem{CBec} Beccari C., ``Computer Aided Hyphenation for
196 %    Italian and Modern Latin'', \textsf{TUGboat} vol.~13, n.~1,
197 %    pp.~23-33 (1992).
198 %    \bibitem{Becc2} Beccari C., ``Typesetting mathematics for science
199 %    and technology according to ISO\,31/XI'', \textsf{TUGboat}
200 %    vol.~18, n.~1, pp.~39-48 (1997).
201 %    \end{thebibliography}}
203 %    The macro |\LdfInit| takes care of preventing that this file is
204 %    loaded more than once, checking the category code of the
205 %    \texttt{@} sign, etc.
206 % \changes{italian-1.2i}{1996/11/03}{Now use \cs{LdfInit} to perform
207 %    initial checks}
208 % \changes{italian-1.2j}{1996/12/29}{Added braces around second arg of
209 %    \cs{LdfInit}}
210 %    \begin{macrocode}
211 %<*code>
212 \LdfInit{italian}{captionsitalian}%
213 %    \end{macrocode}
215 %    When this file is read as an option, i.e. by the |\usepackage|
216 %    command, \texttt{italian} will be an `unknown' language in which
217 %    case we have to make it known.  So we check for the existence of
218 %    |\l@italian| to see whether we have to do something here.
220 % \changes{italian-1.0}{1991/04/23}{Now use \cs{adddialect} if
221 %    language undefined}
222 % \changes{italian-1.0h}{1991/10/08}{Removed use of \cs{@ifundefined}}
223 % \changes{italian-1.1}{1992/02/16}{Added a warning when no
224 %    hyphenation patterns were loaded.}
225 % \changes{italian-1.2e}{1994/06/26}{Now use \cs{@nopatterns} to
226 %    produce the warning}
227 %    \begin{macrocode}
228 \ifx\l@italian\@undefined
229     \@nopatterns{Italian}%
230     \adddialect\l@italian0\fi
231 %    \end{macrocode}
233 %    The next step consists of defining commands to switch to (and
234 %    from) the Italian language.
236 % \begin{macro}{\captionsitalian}
237 %    The macro |\captionsitalian| defines all strings used
238 %    in the four standard document classes provided with \LaTeX.
239 % \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
240 % \changes{italian-1.0c}{1991/06/06}{\cs{pagename} should be
241 %    \cs{headpagename}}
242 % \changes{italian-1.0d}{1991/07/01}{`contiene' substitued by `Allegati'
243 %    as suggested by Marco Bozzo (\texttt{BOZZO@CERNVM}).}
244 % \changes{italian-1.1}{1992/02/16}{Added \cs{seename}, \cs{alsoname}
245 %    and \cs{prefacename}}
246 % \changes{italian-1.1}{1993/07/15}{\cs{headpagename} should be
247 %    \cs{pagename}}
248 % \changes{italian-1.2b}{1994/05/19}{Changed some of the words
249 %    following suggestions from Claudio Beccari}
250 % \changes{italian-1.2g}{1995/07/04}{Added \cs{proofname} for
251 %    AMS-\LaTeX}
252 % \changes{italian-1.2h}{1995/07/27}{Added translation of `Proof'}
253 %    \begin{macrocode}
254 \addto\captionsitalian{%
255   \def\prefacename{Prefazione}%
256   \def\refname{Riferimenti bibliografici}%
257   \def\abstractname{Sommario}%
258   \def\bibname{Bibliografia}%
259   \def\chaptername{Capitolo}%
260   \def\appendixname{Appendice}%
261   \def\contentsname{Indice}%
262   \def\listfigurename{Elenco delle figure}%
263   \def\listtablename{Elenco delle tabelle}%
264   \def\indexname{Indice analitico}%
265   \def\figurename{Figura}%
266   \def\tablename{Tabella}%
267   \def\partname{Parte}%
268   \def\enclname{Allegati}%
269   \def\ccname{e~p.~c.}%
270   \def\headtoname{Per}%
271   \def\pagename{Pag.}%    % in Italian the abbreviation is preferred
272   \def\seename{vedi}%
273   \def\alsoname{vedi anche}%
274   \def\proofname{Dimostrazione}%
275   \def\glossaryname{Glossario}%
276   }%
277 %    \end{macrocode}
278 % \end{macro}
280 % \begin{macro}{\dateitalian}
281 %    The macro |\dateitalian| redefines the command
282 %    |\today| to produce Italian dates.
283 % \changes{italian-1.0c}{1991/06/06}{Removed \cs{global} definitions}
284 %    \begin{macrocode}
285 \def\dateitalian{%
286   \def\today{\number\day~\ifcase\month\or
287     gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
288     luglio\or agosto\or settembre\or ottobre\or novembre\or
289     dicembre\fi\space \number\year}}%
290 %    \end{macrocode}
291 % \end{macro}
293 % \begin{macro}{\italianhyphenmins}
294 % \changes{italian-1.2b}{1994/05/19}{Added setting of left and
295 %    righthyphenmin according to Claudio Beccari's suggestion}
297 %    The italian hyphenation patterns can be used with both
298 %    |\lefthyphenmin| and |\righthyphenmin| set to~2.
299 % \changes{italian-1.2m}{2000/09/22}{Now use \cs{providehyphenmins} to
300 %    provide a default value}
301 %    \begin{macrocode}
302 \providehyphenmins{\CurrentOption}{\tw@\tw@}
303 %    \end{macrocode}
304 % \end{macro}
306 % \begin{macro}{\extrasitalian}
307 % \begin{macro}{\noextrasitalian}
309 % \changes{italian-1.2b}{1994/05/19}{Added setting of club- and
310 %    widowpenalty}
311 %    Lower the chance that clubs or widows occur.
312 % \changes{italian-1.2t}{2007/12/10}{Added \cs{@clubpenalty} to the
313 %    italian specific settings, otherwise any sectioning command restores
314 %    it to the default value valid for english and most other languages}
315 %    \begin{macrocode}
316 \addto\extrasitalian{%
317   \babel@savevariable\clubpenalty
318   \babel@savevariable\widowpenalty
319   \babel@savevariable\@clubpenalty
320   \clubpenalty3000\widowpenalty3000\@clubpenalty\clubpenalty}%
321 %    \end{macrocode}
323 % \changes{italian-1.2b}{1994/05/19}{Added setting of
324 %    finalhyphendemerits}
326 %    Never ever break a word between the last two lines of a paragraph
327 %    in italian texts.
328 %    \begin{macrocode}
329 \addto\extrasitalian{%
330   \babel@savevariable\finalhyphendemerits
331   \finalhyphendemerits50000000}%
332 %    \end{macrocode}
334 % \changes{italian-1.2h}{1995/11/10}{Now give the apostrophe a
335 %    lowercase code}
336 % \changes{italian-1.2l}{1999/04/5}{Changed example ``begl'italiani''
337 %    (obsolete spelling) with another, ``nell'altezza'', that behaves
338 %    the same way}
339 %    In order to enable the hyphenation of words such as
340 %    ``nell'altezza'' we give the \texttt{'} a non-zero lower case
341 %    code. When we do that \TeX\ finds the following hyphenation
342 %    points |nel-l'al-tez-za| instead of none.
343 %    \begin{macrocode}
344 \addto\extrasitalian{%
345   \lccode`'=`'}%
346 \addto\noextrasitalian{%
347   \lccode`'=0}%
348 %    \end{macrocode}
349 % \end{macro}
350 % \end{macro}
352 % \changes{italian-1.2m}{2000/01/05}{Support for etymological
353 %    hyphenation}
355 %   \subsection{Support for etymological hyphenation}
357 %    In his article on Italian hyphenation \cite{CBec} Beccari pointed
358 %    out that the Italian language gets hyphenated on a phonetic
359 %    basis, although etymological hyphenation is allowed; this is in
360 %    contrast with what happens in Latin, for example, where
361 %    etymological hyphenation is always used. Since the patterns for
362 %    both languages would become too complicated in order to cope with
363 %    etymological hyphenation, in his paper Beccari proposed the
364 %    definition of an active character `|_|' such that it could insert
365 %    a ``soft'' discretionary hyphen at the compound word
366 %    boundary. For several reasons that idea and the specific active
367 %    character proved to be unpractical and was abandoned.
369 %    This problem is so important with the majority of the European
370 %    languages, that \babel\ from the very beginning developed
371 %    the tradition of making the |"| character active so as to perform
372 %    several actions that turned useful with every language.
373 %    One of these actions consisted in defining the shortcut \verb="|=
374 %    that was extensively used in German and in many other languages
375 %    in order to insert a discretionary hyphen such that hyphenation
376 %    would not be precluded in the rest of the word as it happens with
377 %    the standard \TeX\ command |\-|.
379 %    Meanwhile the \texttt{ec} fonts with the double Cork encoding
380 %    (thus formerly called the \texttt{dc} fonts) have become more or
381 %    less standard and are widely used by virtually all Europeans that
382 %    write languages with many special national characters; by so
383 %    doing they avoid the use of the |\accent| primitive which would
384 %    be required with the standard \texttt{cm} fonts; with the latter
385 %    fonts the primitive command |\accent| is such that hyphenation
386 %    becomes almost impossible, in any case strongly impeached.
388 %    The \texttt{ec} fonts contain a special character, named
389 %    ``compound word mark'', that occupies position 23 in the font
390 %    scheme and may be input with the sequence |^^W|. Up to now,
391 %    apparently, this special character has never been used in a
392 %    practical way for the typesetting of languages rich of compound
393 %    words; also it has never been inserted in the hyphenation pattern
394 %    files of any language. Beccari modified his pattern file
395 %    \file{ithyph.tex v4.8b} for Italian so as to contain five new
396 %    patterns that involve |^^W|, and he tried to give the
397 %    \babel\ active character |"|  a new shortcut definition,
398 %    so as to allow the insertion of the ``compound word mark'' in the
399 %    proper place within any word where two semantic fragments join
400 %    up. With such facility for marking the compound word boundaries,
401 %    etymological hyphenation becomes possible even if the patterns
402 %    know nothing about etymology (but the typesetter hopefully
403 %    does!).
404 %    In Italian such etymological hyphenation is desirable with
405 %    technical terms, chemical names, and the like.
407 %    Even this solution proved to be inconvenient on certain UN*X
408 %    platforms, so Beccari resorted to another approach that uses the
409 %    \babel\ active character |"| and relies on the category
410 %    code of the character that follows |"|.
412 %    \changes{italian-1.2n}{2000/02/02}{Completely new etymological
413 %    hyphenation facility}
415 %    \begin{macrocode}
416 \initiate@active@char{"}%
417 \addto\extrasitalian{\bbl@activate{"}\languageshorthands{italian}}%
418 %    \end{macrocode}
419 %    \begin{macro}{\it@cwm}
420 %    The active character |"| is now defined for language |italian| so
421 %    as to perform different actions in math mode compared to text
422 %    mode; specifically in math mode a double quote is inserted so as
423 %    to produce a double prime sign, while in text mode the temporary
424 %    macro |\it@next| is defined so as to defer any further action
425 %    until the next token category code has been tested.
426 %    \begin{macrocode}
427 \declare@shorthand{italian}{"}{%
428 \ifmmode
429     \def\it@next{''}%
430 \else
431     \def\it@next{\futurelet\it@temp\it@cwm}%
433 \it@next
435 %    \end{macrocode}
436 %    \begin{macro}{\it@cwm}
437 %    The \cs{it@next} service control sequence is such that upon its
438 %    execution a temporary variable \cs{it@temp} is made equivalent to
439 %    the next token in the input list without actually removing
440 %    it. Such temporary token is then tested by the macro \cs{it@cwm}
441 %    and if it is found to be a letter token, then it introduces a
442 %    compound word separator control sequence \cs{it@allowhyphens}
443 %    whose expansion introduces a discretionary hyphen and an
444 %    unbreakable space; in case the token is not a letter, then it is
445 %    tested against \verb=|=$_{12}$: if so a compound word separator
446 %    is inserted and the \verb=|= token is removed, otherwise another
447 %    test is performed so as to see if another double quote sign
448 %    follows: in this case a double open quote mark is inserted,
449 %    otherwise two other tests are performed so as to see if
450 %    guillemets have to be inserted, otherwise nothing is done.
451 %    The double quote shortcut for inserting a double open quote sign
452 %    is useful for people who are inputting Italian text by means of
453 %    an Italian keyboard that unfortunately misses the grave or
454 %    backtick key.
455 %    By this shortcut |""| becomes equivalent to |``| for inserting
456 %    raised open high double quotes.
457 % \changes{italian-1.2r}{2005/11/17}{Added \cs{nobreak} to
458 %    \cs{it@@cwm} and corrected \cs{it@next}}
459 %    \begin{macrocode}
460 \def\it@@cwm{\nobreak\discretionary{-}{}{}\nobreak\hskip\z@skip}%
461 \def\it@@ocap#1{\it@ocap}\def\it@@ccap#1{\it@ccap}%
462 \DeclareRobustCommand*{\it@cwm}{\let\it@@next\relax
463 \ifcat\noexpand\it@temp a%
464     \def\it@@next{\it@@cwm}%
465 \else
466     \if\noexpand\it@temp \string|%
467         \def\it@@next{\it@@cwm\@gobble}%
468     \else
469         \if\noexpand\it@temp \string<%
470             \def\it@@next{\it@@ocap}%
471         \else
472             \if\noexpand\it@temp \string>%
473                 \def\it@@next{\it@@ccap}%
474             \else
475                 \if\noexpand\it@temp\string/%
476                     \def\it@@next{\slash\@gobble}%
477                 \else
478                     \ifx\it@temp"%
479                         \def\it@@next{``\@gobble}%
480                     \fi
481                 \fi
482             \fi
483         \fi
484     \fi
486 \it@@next}%
487 %    \end{macrocode}
488 %    \end{macro}
489 %    \end{macro}
492 %   \begin{sloppypar}
493 %    By this definition of |"| if one types |macro"istruzione| the
494 %    possible break points become \textsf{ma-cro-istru-zio-ne}, while
495 %    without  the |"| mark they would be \textsf{ma-croi-stru-zio-ne},
496 %    according to the phonetic rules such that the |macro| prefix is
497 %    not taken as a unit.
498 %    A chemical name such as \texttt{des"clor"fenir"amina"cloridrato}
499 %    is breakable as \textsf{des-clor-fe-nir-ami-na-clo-ri-dra-to}
500 %    instead of \textsf{de-sclor-fe-ni-ra-mi-na-...}
502 %    In other language description files a shortcut is defined so as
503 %    to allow a break point without actually inserting any hyphen
504 %    sign; examples are given such as \mbox{entrada/salida}; actually
505 %    if one wants to allow a breakpoint after the slash, it is much
506 %    clearer to type |\slash| instead of |/| and \LaTeX\ does
507 %    everything by itself; here the shortcut |"/| was introduced to
508 %    stand for |\slash| so that one can type |input"/output| and allow
509 %    a line break after the slash.
510 %    This shortcut works only for the slash, since in Italian such
511 %    constructs are extremely rare.
512 %   \end{sloppypar}
514 %    Attention: the expansion of |"| takes place before the actual
515 %    expansion of OT1 or T1 accented sequences such as |\`{a}|;
516 %    therefore this etymological hyphenation facility works as it
517 %    should only when the semantic word fragments \textit{do not
518 %    start} with an accented letter; this in Italian is always
519 %    avoidable, because compulsory accents fall only on the last
520 %    vowel, but it may be necessary to mark a compound word where one
521 %    or more components come from a foreign language and contain
522 %    diacritical marks according to the spelling rules of that
523 %    language. In this case the special shorthand \verb!"|! may be
524 %    used that performs exactly as |"| normally does, except that the
525 %    \verb!|! sign is removed from the token input list:
526 %    \verb!kilo"|{\"o}rsted! gets hyphenated as
527 %    \texttt{ki-lo-\"or-sted}.
529 %    \changes{italian-1.2l}{1999/04/05}{Added useful macros for
530 %    fulfilling ISO 31/XI regulations}
532 %   \subsection{Facilities required by the ISO 31/XI regulations}
533 %    The ISO 31/XI regulations require that units of measure are
534 %    typeset in upright font in any circumstance, math or text, and
535 %    that in text mode they are separated from the  numerical
536 %    indication of the measure with an unbreakable (thin) space.
537 %    The command |\unit| that was defined for achieving this
538 %    goal happened to conflict with the homonymous command defined by
539 %    the package \texttt{units.sty}; we therefore need to test if that
540 %    package has already been loaded so as to avoid conflicts; we assume
541 %    that if the user loads that package, s/he wants to use that package
542 %    facilities and command syntax.
544 %    The same regulations require also that super and subscripts
545 %    (apices and pedices) are in upright font, \emph{not in math
546 %    italics}, when they represent ``adjectives'' or appositions to
547 %    mathematical or physical variables that do not represent
548 %    countable or measurable entities such as, for example,
549 %    $V_{\mathrm{max}}$ or $V_{\mathrm{rms}}$ for a maximum or a root
550 %    mean square voltage, compared to $V_i$  or $V_T$ as the $i$-th
551 %    voltage in a set, or a voltage that depends on the thermodynamic
552 %    temperature $T$. See \cite{Becc2} for a complete description of
553 %    the ISO regulations in connection with typesetting.
555 %    More rarely it happens to use superscripts that are not
556 %    mathematical variables, such as the notation
557 %    $\mathbf{A}^{\!\mathrm{T}}$ to denote the transpose of matrix
558 %    $\mathbf{A}$; text superscripts are useful also as ordinals or
559 %    in old fashioned abbreviations in text mode; for example the
560 %    feminine ordinal $1^{\mathrm{a}}$ or the  old fashioned obsolete
561 %    abbreviation F$^{\mathrm{lli}}$ for \mbox{Fratelli} in company
562 %    names (compare with ``Bros.'' for \underline{bro}ther\underline{s}
563 %    in American English); text subscripts are mostly used in logos.
565 %    \begin{macro}{\unit}
566 %    \begin{macro}{\ap}
567 %    \begin{macro}{\ped}
568 %    First we define the new (internal) commands |\bbl@unit|, |\bbl@ap|,
569 %    and |\bbl@ped| as robust ones.
570 % \changes{italian-1.2q}{2005/02/05}{Added testing for avoiding conflicts
571 %     with the units.sty package}
572 %    \begin{macrocode}
573 \@ifpackageloaded{units}{}{%
574   \DeclareRobustCommand*{\bbl@unit}[1]{%
575     \textormath{\,\mbox{#1}}{\,\mathrm{#1}}}%
576   }%
577 \DeclareRobustCommand*{\bbl@ap}[1]{%
578   \textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
579 \DeclareRobustCommand*{\bbl@ped}[1]{%
580   \textormath{$_{\mbox{\fontsize\sf@size\z@
581         \selectfont#1}}$}{_\mathrm{#1}}}%
582 %    \end{macrocode}
583 %    Then we can use |\let| to define the user level commands, but in
584 %    case the macros already have a different meaning before entering
585 %    in Italian mode typesetting, we first memorize their meaning so
586 %    as to restore them on exit.
587 %    \begin{macrocode}
588 \@ifpackageloaded{units}{}{%
589   \addto\extrasitalian{%
590     \babel@save\unit\let\unit\bbl@unit}%
591   }%
592 \addto\extrasitalian{%
593   \babel@save\ap\let\ap\bbl@ap
594   \babel@save\ped\let\ped\bbl@ped
595   }%
596 %    \end{macrocode}
597 %    \end{macro}
598 %    \end{macro}
599 %    \end{macro}
601 % \subsection{Accents}\label{s:itkbd}
602 %    Most of the other language description files introduce a number
603 %    of shortcuts for inserting accents and other language specific
604 %    diacritical marks in a more comfortable way compared with the
605 %    lengthy standard \TeX\ conventions. When an Italian keyboard is
606 %    being used on a Windows based platform, it exhibits such
607 %    limitations that up to now no convenient shortcuts have been
608 %    developed; the reason lies in the fact that the Italian keyboard
609 %    lacks the grave accent (also known as ``backtick''), which is
610 %    compulsory on all accented vowels except the `e',  but, on the
611 %    opposite, it carries the keys with all the accented lowercase
612 %    vowels; the keyboard lacks also the tie |~| (tilde) key, while
613 %    the curly braces require pressing three keys simultaneously.
615 %    The best solution Italians have found so far is to use a smart
616 %    editor that accepts shortcut definitions such that, for example,
617 %    by striking |"(| one gets directly |{| on the screen and the same
618 %    sign is saved into the \file{.tex} file; the same smart editor
619 %    should be capable of translating the accented characters into the
620 %    standard \TeX\ sequences when writing a file to disk (for the
621 %    sake of file portability), and to transform the standard \TeX\
622 %    sequences into the corresponding signs when loading a \file{.tex}
623 %    file from disk to memory. Such smart editors do exist and can be
624 %    downloaded from the \textsc{ctan} archives.
626 % \changes{italian-1.2p}{2002/07/10}{Removed redefinition of \cs{add@acc} since its
627 %    functionality has been introduced into the kernel of LaTeX 2001/06/01}
629 %    For what concerns the missing backtick key,
630 %    which is used also for inputting the open quotes, it must be
631 %    noticed that the shortcut |""| described above completely solves
632 %    the problem for \textit{double} raised open quotes; according to
633 %    the traditions of particular publishing houses, since there are
634 %    no  compulsory regulations on the matter, the French guillemets
635 %    may be used; in this case the T1 font encoding solves the problem
636 %    by means of its built in ligatures |<<| and |>>|. But\dots
638 %    \subsection{\emph{Caporali} or French double quotes}
639 %    Although the T1 font encoding ligatures solve the problem, there
640 %    are some circumstances where even the T1 font encoding cannot be
641 %    used, either because the author\slash typesetter wants to use the
642 %    OT1 encoding, or because s/he uses a font set that does
643 %    not comply completely with the T1 font encoding; some virtual
644 %    fonts, for example, are supposed to implement the double Cork
645 %    font encoding  but actually miss some glyphs; one such virtual
646 %    font set is given by the \texttt{ae} virtual fonts, because they
647 %    are supposed to implement such double font encoding simply using
648 %    the \texttt{cm} fonts, of which the type~1 PostScript version
649 %    exists  and is freely available. Since guillemets (in Italian
650 %    \emph{caporali}) do not exist in any \texttt{cm} latin font,
651 %    their glyphs must be substituted with something else that
652 %    approaches them.
654 % \changes{italian-1.2q}{2005/02/05}{Redefined the caporali machinery
655 %     so as to avoid incompatibilities with the slides class, as there
656 %     are no Cyrillic slides fonts as there are for Latins script}
658 %    Since in French typesetting guillemets are compulsory, the French
659 %    language definition file resorts to a clever font substitution;
660 %    such file exploits the \LaTeXe\ font selection machinery so as to
661 %    get the guillemets from the Cyrillic fonts, because it suffices
662 %    to locally change the default encoding. There are several sets of
663 %    Cyrillic fonts, but the ones that obey the OT2 font encoding are
664 %    generally distributed with  all recent implementations of the
665 %    \TeX\ software; they are part of the American Mathematical
666 %    Society fonts and come both as \textsf{METAFONT} source files and
667 %    Type~1 PostScript \texttt{.pfb} files. The availability of such
668 %    fonts should be guaranteed by the presence of the
669 %    \texttt{OT2cmr.fd} font description file. Actually the presence
670 %    of this file does not guarantee the completeness of your \TeX\
671 %    implementation; should \LaTeX\ complain about a missing Cyrillic
672 %    \texttt{.tfm} file (that kind of file that contains the font
673 %    metric parameters) and/or about missing Cyrillic \texttt(.mf)
674 %    files, then your \TeX\ system is \emph{incomplete} and you should
675 %    download such fonts from the \textsc{ctan} archives. Temporarily
676 %    you may issue the command |\LtxSymbCaporali| so as to approximate
677 %    the missing glyphs with the \LaTeX\ symbol fonts. In some case
678 %    warning messages are issued so as to inform the typesetter about
679 %    the necessity of resorting to some \emph{poor man} solution.
681 %     In spite of these alternate fonts, we must avoid invoking unusual
682 %     fonts if the available encoding allows to use built in caporali.
683 %     As far as I know (CB) the only T1-encoded font families that miss
684 %     the guillemets are the AE ones; we therefore first test if the
685 %     default encoding id the T1 one and in this case if the AE families
686 %     are the default ones; in order for this to work properly it is
687 %     necessary to load these optional packages \emph{before} \babel.
688 %     If the T1 encoding is not the default one when the Italian language
689 %     is specified, then some substitutions must be done.
691 %    \begin{macro}{\LtxSymbCaporali}
692 %    \begin{macro}{\it@ocap}
693 %    \begin{macro}{\it@ccap}
694 %     We define some macros for substituting the default guillemets; first the
695 %     emulation by means of the \LaTeX\ symbols; each one of these macro sets
696 %     actually redefines the control sequences |\it@ocap| and |\it@ccap| that
697 %     are the ones effectively activated by the shortcuts |"<| and |">|.
698 %    \begin{macrocode}
699 \def\LtxSymbCaporali{%
700      \DeclareRobustCommand*{\it@ocap}{\mbox{%
701         \fontencoding{U}\fontfamily{lasy}\selectfont(\kern-0.20em(}%
702         \ignorespaces}%
703      \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi
704      \mbox{%
705         \fontencoding{U}\fontfamily{lasy}\selectfont)\kern-0.20em)}}%
707 %    \end{macrocode}
708 %    Then the substitution with any specific font that contains such
709 %    glyphs; it might be the CBgreek fonts, the Cyrillic one, the
710 %    super-cm ones, the lm ones, or any other the user might prefer
711 %    (the code is adapted from the one that appears in the
712 %    \texttt{frenchb.ld} file; thanks to Daniel Flipo). 
713 %    By default if the user did not select the T1 encoding, the
714 %    existence of the CBgreek fonts is tested; if they exist the
715 %    guillemets are taken from this font, and since its families are a
716 %    superset of the default CM ones and they apply also to typeset
717 %    slides with the standard class \texttt{slides}. If the CBgreek
718 %    fonts are not found, then the existence of the Cyrillic ones is
719 %    tested, although this choice is not suited for typesetting
720 %    slides; otherwise the poor man solution of the \LaTeX\ special
721 %    symbols is used. In any case the user can force the use of the
722 %    Cyrillic guillemets substitution by issuing the declaration
723 %    |\CyrillicCaporali| just before the |\begin{document}| statement;
724 %    in alternative the user can specify with
725 %    \begin{flushleft}
726 %    |\CaporaliFrom|\marg{encoding}\marg{family}\marg{opening number}\marg{closing number}
727 %    \end{flushleft}
728 %    the encoding and family of the font s/he prefers, and the slot
729 %    numbers of the opening and closing guillemets respectively. For
730 %    example if the T1-encoded Latin Modern fonts are desired the
731 %    specific command should be 
732 %    \begin {flushleft}
733 %    |\CaporaliFrom{T1}{lmr}{19}{20}|
734 %    \end{flushleft}
735 %    These user choices might be necessary for assuring the correct
736 %    typesetting with fonts that contain the required glyphs and are
737 %    available also in PostScript form so as to use them directly with
738 %    \texttt{pdflatex}, for example. 
739 %    \begin{macrocode}
740 \def\CaporaliFrom#1#2#3#4{%
741   \DeclareFontEncoding{#1}{}{}%
742   \DeclareTextCommand{\it@ocap}{T1}{%
743     {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
744   \DeclareTextCommand{\it@ccap}{T1}{\ifdim\lastskip>\z@\unskip\fi%
745     {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}%
746   \DeclareTextCommand{\it@ocap}{OT1}{%
747     {\fontencoding{#1}\fontfamily{#2}\selectfont\char#3\ignorespaces}}%
748   \DeclareTextCommand{\it@ccap}{OT1}{\ifdim\lastskip>\z@\unskip\fi%
749     {\fontencoding{#1}\fontfamily{#2}\selectfont\char#4}}}
750 %    \end{macrocode}
751 %    Then we set a boolean variable and test the default family;
752 %    if such family has a name that starts with the letters ``ae''
753 %    then we have no built in guillemets; of course if the AE font
754 %    family is chosen after the \babel\ package is loaded, the test
755 %    does not perform as required. 
756 %    \begin{macrocode}
757 \def\get@ae#1#2#3!{\def\bbl@ae{#1#2}}%
758 \def\@ifT@one@noCap{\expandafter\get@ae\f@family!%
759 \def\bbl@temp{ae}\ifx\bbl@ae\bbl@temp\expandafter\@firstoftwo\else
760     \expandafter\@secondoftwo\fi}%
761 %    \end{macrocode}
762 %    We set another couple of boolean variables for testing the
763 %    existence of the CBgreek or the Cyrillic fonts
764 %    \begin{macrocode}
765 \newif\if@CBgreekEncKnown
766 \IfFileExists{lgrcmr.fd}%
767       {\@CBgreekEncKnowntrue}{\@CBgreekEncKnownfalse}
768 \newif\if@CyrEncKnown
769 \IfFileExists{ot2cmr.fd}%
770     {\@CyrEncKnowntrue}{\@CyrEncKnownfalse}%
771 %    \end{macrocode}
772 %    \begin {macro}{\CBgreekCaporali}
773 %    \begin {macro}{\CyrillicCaporali}
774 %    \begin {macro}{\T@unoCaporali}
775 %    Next we define the macros |\CBgreekCaporali|, |\T@unoCaporali|,
776 %    and |\CyrillicCaporali|; with the latter one we test the loaded
777 %    class, and if it's \texttt{slides} nothing gets done. In any case
778 %    each one of these declarations, if used, must be specified in the
779 %    preamble.
780 %    \begin{macrocode}
781 \def\CBgreekCaporali{\@ifclassloaded{slides}{%
782       \IfFileExists{lgrlcmss.fd}{\DeclareFontEncoding{LGR}{}{}%
783             \DeclareRobustCommand*{\it@ccap}%
784                   {\ifdim\lastskip>\z@\unskip\fi
785                         {\fontencoding{LGR}\selectfont))}}%
786             \DeclareRobustCommand*{\it@ocap}%
787                   {{\fontencoding{LGR}\selectfont((}\ignorespaces}}%
788             {\LtxSymbCaporali}}%
789       {\DeclareFontEncoding{LGR}{}{}%
790       \DeclareRobustCommand*{\it@ccap}%
791             {\ifdim\lastskip>\z@\unskip
792             \fi{\fontencoding{LGR}\selectfont))}}%
793       \DeclareRobustCommand*{\it@ocap}%
794             {{\fontencoding{LGR}\selectfont((}\ignorespaces}}%
795       }%
796 \def\CyrillicCaporali{\@ifclassloaded{slides}{\relax}%
797       {\DeclareFontEncoding{OT2}{}{}%
798       \DeclareRobustCommand*{\it@ccap}%
799             {\ifdim\lastskip>\z@\unskip\fi
800             {\fontencoding{OT2}\selectfont\char62\relax}}%
801       \DeclareRobustCommand*{\it@ocap}%
802             {{\fontencoding{OT2}\selectfont\char60\relax}\ignorespaces}}}%
803 \@onlypreamble{\CBgreekCaporali}\@onlypreamble{\CyrillicCaporali}%
804 \def\T@unoCaporali{\DeclareRobustCommand*{\it@ocap}{<<\ignorespaces}%
805      \DeclareRobustCommand*{\it@ccap}{\ifdim\lastskip>\z@\unskip\fi>>}}%
806 %    \end{macrocode}
807 %    \end{macro}
808 %    \end{macro}
809 %    \end{macro}
810 %    Now we can do some real setting; first we start testing the encoding;
811 %    if the encoding is T1 we test if the font family is the AE one; if so,
812 %    we further test for other possibilities
813 %    \begin{macrocode}
814 \ifx\cf@encoding\bbl@t@one
815   \@ifT@one@noCap{%
816      \if@CBgreekEncKnown
817         \CBgreekCaporali
818      \else
819         \if@CyrEncKnown
820            \CyrilicCaporali
821         \else
822            \LtxSymbCaporali
823         \fi
824      \fi}%
825      {\T@unoCaporali}%
826 %    \end{macrocode}
827 %     But if the default encoding is not the T1 one, then the
828 %     substitutions must be performed.
829 %    \begin{macrocode}
830 \else
831      \if@CBgreekEncKnown
832         \CBgreekCaporali
833      \else
834         \if@CyrEncKnown
835            \CyrilicCaporali
836         \else
837            \LtxSymbCaporali
838         \fi
839      \fi
841 %    \end{macrocode}
842 %    \end{macro}
843 %    \end{macro}
844 %    \end{macro}
846 %    \subsection{Finishing commands}
847 %    The macro |\ldf@finish| takes care of looking for a
848 %    configuration file, setting the main language to be switched on
849 %    at |\begin{document}| and resetting the category code of
850 %    \texttt{@} to its original value.
851 % \changes{italian-1.2i}{1996/11/03}{Now use \cs{ldf@finish} to wrap
852 %    up}
853 %    \begin{macrocode}
854 \ldf@finish{italian}%
855 %</code>
856 %    \end{macrocode}
858 % \Finale
860 %% \CharacterTable
861 %%  {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
862 %%   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
863 %%   Digits        \0\1\2\3\4\5\6\7\8\9
864 %%   Exclamation   \!     Double quote  \"     Hash (number) \#
865 %%   Dollar        \$     Percent       \%     Ampersand     \&
866 %%   Acute accent  \'     Left paren    \(     Right paren   \)
867 %%   Asterisk      \*     Plus          \+     Comma         \,
868 %%   Minus         \-     Point         \.     Solidus       \/
869 %%   Colon         \:     Semicolon     \;     Less than     \<
870 %%   Equals        \=     Greater than  \>     Question mark \?
871 %%   Commercial at \@     Left bracket  \[     Backslash     \\
872 %%   Right bracket \]     Circumflex    \^     Underscore    \_
873 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
874 %%   Right brace   \}     Tilde         \~}
876 \endinput