Klicka här för att använda ShareLaTeX på Engelska

##  Class files

LaTeX supports many worldwide languages by means of some special packages. In this article is explained how to import and use those packages to create documents in Italian.

#  Introduction

Italian language has some accentuated words. For this reason the preamble of your document must be modified accordingly to support these characters and some other features.

documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}

\begin{document}

\tableofcontents

\begin{abstract}
Questo è un breve riassunto dei contenuti del
documento scritto in italiano.
\end{abstract}

\section{Sezione introduttiva}
Questa è la prima sezione, possiamo aggiungere
alcuni elementi aggiuntivi e tutto
digitato correttamente. Inoltre, se una parola
è troppo lunga e deve essere troncato
babel cercherà per troncare correttamente
a seconda della lingua.

\section{Teoremi Sezione}
Questa sezione è quello di vedere cosa succede con i comandi
testo definendo

$\lim x = \sin{\theta} + \max \{3.52, 4.22\}$

\end{document}

There are two packages in this document related to the encoding and the special characters. These packages will be explained in the next sections.

If your are looking for instructions on how to use more than one language in a sinlge document, for instance English and Italian, see the International language support article.

#  Input encoding

Modern computer systems allow you to input letters of national alphabets directly from the keyboard. In order to handle a variety of input encodings used for different groups of languages and/or on different computer platforms LaTeX employs the inputenc package to set up input encoding. In this case the package properly displays characters in the Italian alphabet. To use this package add the next line to the preamble of your document:

\usepackage[utf8]{inputenc}

The recommended input encoding is utf-8. You can use other encodings depending on your operating system.

#  Font encoding

To proper LaTeX document generation you must also choose a font encoding which has to support specific characters for Italian language, this is accomplished by the fontenc package:

\usepackage[T1]{fontenc}

Even though the default encoding works well in Italian, using this specific encoding will avoid glitches with some specific characters. The default LaTeX encoding is OT1.

#  Language-specific packages and commands

To extended the default LaTeX capabilities, for proper hyphenation and translating the names of the document elements, import the babel package for the Italian language.

\usepackage[italian]{babel}

As you may see in the example at the introduction, instead of "abstract" and "Contents" the Italian words "Sommario" and "Indice" are used.

#  Hyphenation

Sometimes for formatting reasons some words have to be broken up in syllables separated by a - (hyphen) to continue the word in a new line. For example, matematica could become mate-matica. The package babel, whose usage was described in the previous section, usually does a good job breaking up the words correctly, but if this is not the case you can use a couple of commands in your preamble.

 \usepackage{hyphenat}
\hyphenation{mate-mati-ca recu-perare}

The first command will import the package hyphenat and the second line is a list of space-separated words with defined hyphenation rules. On the other side, if you want a word not to be broken automatically, use the {\nobreak word} command within your document.