summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/babel-italian
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-16 23:14:06 +0000
committerKarl Berry <karl@freefriends.org>2014-02-16 23:14:06 +0000
commit06cb33c105d29fb7a1a104a11c4c866ce6d6c48f (patch)
tree6dd13d8f4e302d3c60911772cd3b74051bf205b1 /Master/texmf-dist/source/generic/babel-italian
parentc0bb6850b2ead23f99d568bb84f8819f57e90757 (diff)
babel-italian
git-svn-id: svn://tug.org/texlive/trunk@32979 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/babel-italian')
-rw-r--r--Master/texmf-dist/source/generic/babel-italian/italian.dtx74
1 files changed, 60 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/generic/babel-italian/italian.dtx b/Master/texmf-dist/source/generic/babel-italian/italian.dtx
index 5336e6a9281..79527717372 100644
--- a/Master/texmf-dist/source/generic/babel-italian/italian.dtx
+++ b/Master/texmf-dist/source/generic/babel-italian/italian.dtx
@@ -22,7 +22,7 @@
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
% \fi
-% \CheckSum{677}
+% \CheckSum{723}
% \iffalse
% Tell the \LaTeX\ system who we are and write an entry on the
% transcript.
@@ -33,7 +33,7 @@
%</filedriver>
%<code>\ProvidesLanguage{italian}
%<*code>
- [2013/11/22 v1.3f Italian support from the babel system]
+ [2014/01/22 v1.3f Italian support from the babel system]
%</code>
%%
%% Please report errors to: claudio dot beccari at gmail dot com
@@ -105,6 +105,7 @@
% \changes{italian-1.3-d}{2013/11/11}{Corrected the \string" behaviour for
% etymological hyphenation}
% \changes{italian-1.3f}{2013/11/22}{Deleted extra \cs{selectlanguage}\{italian\}}
+% \changes{italian-1.3g}{2014/02/16}{Corrected "/}
% \section{The Italian language}
%
% \textbf{Important notice:} This language description file relies on
@@ -137,11 +138,14 @@
% |""| & inserts open quotes ``.\\ %^^A'' emacs matching
% |"<| & inserts open guillemets.\\
% |">| & inserts closed guillemets.\\
-% |"/| & equivalent to |\slash|\\
+% |"/| & allows hyphenation of both word before and after the slash.\\
% |"-| & allows hyphenation in both words connected with a short dash
% (\emph{trattino copulativo}, in Italian)
% \end{tabular}
-% \caption{Shortcuts for the Italian language}\label{t:itshrtct}
+% \caption{Shortcuts for the Italian language. These shortcut are
+% available only if command \texttt{\string\setactivedoublequote} is given
+% after loading \babel\ and before \texttt{\string\begin\{document\}}.}
+% \label{t:itshrtct}
% \end{table}
%
% The features of this language definition file are the following:
@@ -169,7 +173,19 @@
% in Italian, where compulsory accents fall only on the last and
% ending vowel of a word, but it may take place with compound words
% that include foreign roots), and \verb="|= when the desired break
-% point falls before an accented letter.
+% point falls before an accented letter. As you can read in
+% table~\ref{t:itshrtct}, these shortcuts are available only if
+% they get activated with command |\setactivedoublequote| after
+% loading \babel\ but before the |\end{docuemnt}| statement. This
+% is done in order to preseserve the user form package conflicts:
+% if s/he wants to use these facilities s/he must remember that
+% conflicts may arise unless active characters are deactivated;
+% this can be sono with the \babel\ command |\shorthadsoff{"}|
+% (and reactivated with |\shorthandson{"}|) when its wise to do
+% so; conflicts have been reported with package \file{xypic} and
+% with \texttt{TikZ}, but the latter has its own library to
+% deactivate all active characters, non just the double quote,
+% the only Italian language activatable character.
% \item some Italian compound words have a connecting short dash (a
% hyphen sign) between them without any space between the component
% words and the short dash; in this situation standard \LaTeX\ allows
@@ -213,7 +229,13 @@
% The definition of |\unit| takes place only at ``begin document''
% so that it is possible to verify if some other similar functionalities
% have already been defined by other packages, such as |units.sty|
-% or |siunitx.sty|.
+% or |siunitx.sty|. In particular command |\unit| is deactivated by
+% default; the user can activate it by entering the command
+% |\SetISOcompliance| after loading the \babel\ package and before the
+% |\begin{document}| statement. The above checks will enter into
+% action even if this ISO complance is set, in order to avoid conflicts
+% with the above named packages. The |\ap| and |\ped| commands remain
+% available because up to now no specific conflicts have been reported.
% \item Since in all languages different from English the decimal separator
% according to the ISO regulations \emph{must} be a comma, and since
% no language description file nor the \babel\ package itself provides
@@ -240,7 +262,7 @@
% \end{enumerate}
%
% For this language a few shortcuts have been defined,
-% table~\ref{t:itshrtct}, some of which are used to overcome
+% table~\ref{t:itshrtct}, some of which are introduced to overcome
% certain limitations of the Italian keyboard; in
% section~\ref{s:itkbd} there are other comments and hints in order
% to overcome some other keyboard limitations.
@@ -553,10 +575,22 @@
% \babel\ active character |"| and relies on the category
% code of the character that follows |"|.
%
-% \changes{italian-1.2n}{2000/02/02}{Completely new etymological
+% \changes{italian-1.2n}{2000/02/02}{Completely new etymological
% hyphenation facility}
+% \changes{italian-1.3g}{2014/01/22}{The active double straight
+% quote conflicts with other packages; set as an optional facility.}
+% Instead of a boolean switch we use a private counter so as to check
+% at |\begin{document}| if this facility ha to be activated. The fdeault
+% value is zero; anything different from zero means that the facility
+% has to be activates; this is done with a command to be issued
+% before |\begin{document}|
%
% \begin{macrocode}
+\newcount\it@doublequoteactive \it@doublequoteactive=\z@
+\def\setactivedoublequote{\it@doublequoteactive=\@ne}
+{\catcode`"=12 \global\let\it@doublequote"}
+{\catcode`"=13 \global\let\it@@dqactive"}
+\AtBeginDocument{\unless\ifnum\it@doublequoteactive=\z@
\initiate@active@char{"}%
\addto\extrasitalian{\bbl@activate{"}\languageshorthands{italian}}%
% \end{macrocode}
@@ -575,7 +609,7 @@
\def\it@next{\futurelet\it@temp\it@cwm}%
\fi
\it@next
-}%
+}\fi}%
% \end{macrocode}
% \begin{macro}{\it@cwm}
% The \cs{it@next} service control sequence is such that upon its
@@ -600,8 +634,9 @@
% raised open high double quotes.
% \begin{macrocode}
\def\it@@cwm{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}%
+\def\it@@slash{\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}%
\def\it@@ocap#1{\it@ocap}\def\it@@ccap#1{\it@ccap}%
-\DeclareRobustCommand*{\it@cwm}{\let\it@@next\relax
+\DeclareRobustCommand*{\it@cwm}{\let\it@@next\it@doublequote
\ifcat\noexpand\it@temp a%
\def\it@@next{\it@@cwm}%
\else
@@ -615,9 +650,10 @@
\def\it@@next{\it@@ccap}%
\else
\if\noexpand\it@temp\string/%
- \def\it@next{\slash\@gobble}%
+ \def\it@@next{\it@@slash\@gobble}%
\else
- \ifx\it@temp"%
+ \ifcat\noexpand\it@temp\noexpand\it@@dqactive
+ \def\it@@next{``\@gobble}%
\else
\if\noexpand\it@temp\string-%
\def\it@@next{\bbl@allowhyphens-\bbl@allowhyphens
@@ -726,20 +762,29 @@
% \begin{macro}{\unit}
% \begin{macro}{\ap}
% \begin{macro}{\ped}
+% \begin{macro}{\setISOcompliance}
% First we define the new (internal) commands |\bbl@unit|, |\bbl@ap|,
% and |\bbl@ped| as robust ones.
% \changes{italian-1.3}{2013/09/27}{Added testing to avoid conflicts
% with the units.sty and siunitx.sty packages}
+% \changes{italian-1.3g}{2014/01/22}{Besides controlling conflicts with
+% units, siunitx, this facility is deactivated by default, and activated
+% only if the user wants to}
+% This facility is deactivate by default according to the contents of
+% an internal counter and the setting of the activation command by the
+% user; commands for apices and pedixes remain available in any case.
% \begin{macrocode}
+\newcount\it@ISOcompliance \it@ISOcompliance=\z@
+\def\setISOcompliance{\it@ISOcompliance=\@ne}
+\AtBeginDocument{\unless\ifnum\it@ISOcompliance=\z@%
\def\activate@it@unit{\DeclareRobustCommand*{\bbl@it@unit}[1]{%
\textormath{\,\textup{##1}}{\,\mathrm{##1}}}}
-\AtBeginDocument{%
\@ifpackageloaded{units}{}{\@ifpackageloaded{siunitx}{}{%
\@ifpackageloaded{SIunits}{}{%
\activate@it@unit\addto\extrasitalian{%
\babel@save\unit\let\unit\bbl@it@unit}%
}}}\ifcsstring{bbl@main@language}{italian}{\selectlanguage{italian}}{}%
-}
+\fi}
\DeclareRobustCommand*{\bbl@it@ap}[1]{%
\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
\DeclareRobustCommand*{\bbl@it@ped}[1]{%
@@ -759,6 +804,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Intelligent comma}\label{ssec:comma}
%