1 The Italian language

The file italian.dtx^{1} It defines all the language-specific macros for the Italian language.

   For this language the \clubpenalty, \widowpenalty and \finalhyphendemerits

are set to rather high values.

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

1 ⟨∗code⟩

 2 \LdfInit{italian}{captionsitalian}

When this file is read as an option, i.e. by the \usepackage command, italian will be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@italian to see whether we have to do something here.

 3 \ifx\l@italian\@undefined
 4  \@nopatterns{Italian}
 5  \adddialect\l@italian0\fi

The next step consists of defining commands to switch to (and from) the Italian language.

\captionsitalian The macro \captionsitalian defines all strings used in the four standard documentclasses provided with L^{A}TEX.

 6 \addto\captionsitalian{%
 7 \def\prefacename{Prefazione}%
 8 \def\refname{Riferimenti bibliografici}%
 9 \def\abstractname{Sommario}%
10 \def\bibname{Bibliografia}%
11 \def\chaptername{Capitolo}%
12 \def\appendixname{Appendice}%
13 \def\contentsname{Indice}%
14 \def\listfigurename{Elenco delle figure}%
15 \def\listtablename{Elenco delle tabelle}%
16 \def\indexname{Indice analitico}%
17 \def\figurename{Figura}%
18 \def\tablename{Tabella}%
19 \def\partname{Parte}%
20 \def\enclname{Allegati}%
21 \def\ccname{e~p.~c.}%
22 \def\headtoname{Per}%
23 \def\pagename{Pag.}%    % in Italian abbreviation is preferred
24 \def\seename{vedi}%
25 \def\alsoname{vedi anche}%
26 \def\proofname{Dimostrazione}%

27 }

\dateitalian The macro \dateitalian redefines the command \today to produce Italian dates.

28 \def\dateitalian{%
29 \def\today{\number\day~\ifcase\month\or
30 gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or

1The file described in this section has version number v1.2j and was last revised on 1996/12/29.

The original author is Maurizio Codogno, (mau@beatles.cselt.stet.it).

31 luglio\or agosto\or settembre\or ottobre\or novembre\or dicembre\fi
32 \space \number\year}}

\italianhyphenmins The italian hyphenation patterns can be used with both \lefthyphenmin and

\righthyphenmin set to 2.
33 \def\italianhyphenmins{\tw@\tw@}

\extrasitalian \noextrasitalian Lower the chance that clubs or widows occur.

34 \addto\extrasitalian{%
35 \babel@savevariable\clubpenalty
36 \babel@savevariable\widowpenalty
37 \clubpenalty3000\widowpenalty3000}

Never ever break a word between the last two lines of a paragraph in italian texts.

38 \addto\extrasitalian{%
39 \babel@savevariable\finalhyphendemerits
40 \finalhyphendemerits50000000}

In order to enable the hyphenation of words such as “begl’italiani” we give the ' a non-zero lower case code. When we do that TEX finds the following hyphenation points be-gl'i-ta-lia-ni instead of none.

41 \addto\extrasitalian{%
42 \lccode`'=`'}
43 \addto\noextrasitalian{%
44 \lccode`'=0}

The macro \ldf@finish takes care of looking for a configuration file, setting the main language to be switched on at \begin{document} and resetting the category code of @ to its original value.

45 \ldf@finish{italian}

46 ⟨/code⟩