summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/babel
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-09-26 20:27:50 +0000
committerKarl Berry <karl@freefriends.org>2014-09-26 20:27:50 +0000
commitbf07457f5a27ec860ad159058da5a67e3033062d (patch)
treef0a296920f6f7e83a7d61ab76b07fae1e743433d /Master/texmf-dist/source/latex/babel
parentf0f6bb195e19199b566cdbd1e8352dbae05e777c (diff)
babel (26sep14)
git-svn-id: svn://tug.org/texlive/trunk@35266 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/babel')
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx128
1 files changed, 86 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx
index 64c7ee45db9..236d513ef3c 100644
--- a/Master/texmf-dist/source/latex/babel/babel.dtx
+++ b/Master/texmf-dist/source/latex/babel/babel.dtx
@@ -36,7 +36,7 @@
%\iffalse
%% File 'babel.dtx'
%\fi
-%%\ProvidesFile{babel.dtx}[2014/03/24 v3.9k The Babel package]
+%%\ProvidesFile{babel.dtx}[2014/09/25 v3.9l The Babel package]
%\iffalse
%
% Babel DOCUMENT-STYLE option for LaTeX version 2.09 or plain TeX;
@@ -196,8 +196,8 @@
\vspace{2cm}\hspace{1.5cm}
\begin{minipage}{5cm}
\Large
-Version 3.9k\newline
-2014/03/24
+Version 3.9l\newline
+2014/09/25
\vspace{1cm}
\textit{Original author}\newline
@@ -544,7 +544,7 @@ backwards compatibility.}
\Describe{\ensureascii}{\marg{text}}
-\New{3.9i} This macro makes sure \marg{text} is typeset with a
+\New{3.9i} This macro makes sure \m{text} is typeset with a
LICR-savvy encoding in the ASCII range. It is used to redefine |\TeX|
and |\LaTeX| so that they are correctly typeset even with |LGR| or
|X2| (the complete list is stored in |\BabelNonASCII|, which by default
@@ -846,20 +846,28 @@ above, ie, this language is always loaded last. If it is not given as
package or global option, it is added to the list of requested
languages.
-\Describe{headfoot=}{\meta{language}} By default, headlines and footlines are
-not touched (only marks), and if they contain language dependent
-macros (which is not usual) there may be unexpected results. With
-this option you may set the language in heads and foots.
+\Describe{headfoot=}{\meta{language}} By default, headlines and
+footlines are not touched (only marks), and if they contain language
+dependent macros (which is not usual) there may be unexpected
+results. With this option you may set the language in heads and foots.
-\Describe{noconfigs}{} Global and
-language default config files are not loaded, so you can make sure
-your document is not spoilt by an unexpected \texttt{.cfg}
-file. However, if the key |config| is set, this file is loaded.
+\Describe{noconfigs}{} Global and language default config files are
+not loaded, so you can make sure your document is not spoilt by an
+unexpected \texttt{.cfg} file. However, if the key |config| is set,
+this file is loaded.
\Describe{showlanguages}{} Prints to the log the list of languages
loaded when the format was created: number (remember dialects can
share it), name, hyphenation file and exceptions file.
+\Describe{nocase}{} \New{3.9l} Language settings for uppercase and
+lowercase mapping (as set by |\SetCase|) is ignored. Use only if there
+are incompatibilities with other packages.
+
+\Describe{silent}{} \New{3.9l} No warnings and no \textit{infos} are
+written to the log file.\footnote{You can use alternatively the
+package \textsf{silence}.}
+
\Describe{strings=}{\texttt{generic} $\string|$ \texttt{unicode}
$\string|$ \texttt{encoded} $\string|$ \meta{label} $\string|$
\meta{font encoding}} Selects the encoding of strings in languages
@@ -1101,7 +1109,7 @@ encoding (not set in the preamble by default). Multiple
Listed words are saved expanded and therefore it relies on the
LICR. Of course, it also works without the LICR if the input and the
-font encondings are the same, like in Unicode based engines.
+font encodings are the same, like in Unicode based engines.
\subsection{Language attributes}
@@ -1588,7 +1596,7 @@ explained in in sec. \ref{s:strings} (\babel{} 3.9 and later).
\begin{verbatim}
\ProvidesLanguage{<language>}
- [2014/03/24 v0.0 <Language> support from the babel system]
+ [2014/09/25 v0.0 <Language> support from the babel system]
\LdfInit{<language>}{captions<language>}
\ifx\undefined\l@<language>
@@ -2370,8 +2378,8 @@ help from Bernd Raichle, for which I am grateful.
% little bit of literate programming.
%
% \begin{macrocode}
-%<<version=3.9k>>
-%<<date=2014/03/24>>
+%<<version=3.9l>>
+%<<date=2014/09/25>>
% \end{macrocode}
%
% We define some basic macros which just make the code cleaner.
@@ -2642,6 +2650,7 @@ help from Bernd Raichle, for which I am grateful.
% \changes{babel~3.9a}{2012/09/26}{Implemented the
% \texttt{showlanguages} option}
% \changes{babel~3.9g}{2013/08/07}{Options for hyphenmap}
+% \changes{babel~3.9l}{2014/07/29}{Option \texttt{silent}}
% \begin{macrocode}
\DeclareOption{KeepShorthandsActive}{}
\DeclareOption{activeacute}{}
@@ -2649,6 +2658,7 @@ help from Bernd Raichle, for which I am grateful.
\DeclareOption{debug}{}
\DeclareOption{noconfigs}{}
\DeclareOption{showlanguages}{}
+\DeclareOption{silent}{}
\DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa}
<@More package options@>
% \end{macrocode}
@@ -3542,7 +3552,7 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
%
% After the preamble of the document the commands |\LdfInit|,
-% |\ldf@quit| and |\ldf@finish| are no longer needed. Therefor
+% |\ldf@quit| and |\ldf@finish| are no longer needed. Therefore
% they are turned into warning messages in \LaTeX.
% \begin{macrocode}
\@onlypreamble\LdfInit
@@ -4928,21 +4938,43 @@ help from Bernd Raichle, for which I am grateful.
\bbl@tempa}
% \end{macrocode}
%
-% The second one. We need to patch |\@uclclist|, but it is done
-% once and only if |\SetCase| is used or if strings are encoded.
-% \begin{macrocode}
-\def\bbl@patchuclc{%
- \let\bbl@patchuclc\relax
- \@ifundefined{bbl@tolower}{%
- \g@addto@macro\@uclclist{%
- \reserved@b{\reserved@b\@gobble}% stops processing the list
+% The second one. We need to patch |\@uclclist|, but it is done once
+% and only if |\SetCase| is used or if strings are encoded. The code
+% is far from satisfactory for several reasons, including the fact
+% |\@uclclist| is not a list any more. Therefore a package option is
+% added to ignore it. Instead of gobbling the macro
+% getting the next two elements (usually |\reserved@a|), we pass it as
+% argument to |\bbl@uclc|. The parser is restarted inside
+% |\|\m{lang}|@bbl@uclc| because we do not know how many expansions
+% are necessary (depends on whether strings are encoded). The last
+% part is tricky -- when uppercasing, we have:
+% \begin{verbatim}
+% \let\bbl@tolower\@empty\bbl@toupper\@empty
+% \end{verbatim}
+% and starts over (and similarly when lowercasing).
+% \changes{babel~3.9l}{2014/07/29}{Now tries to catch the parsing
+% macro. Removed some redundant code. Option |nocase|.}
+% \begin{macrocode}
+\@ifpackagewith{babel}{nocase}%
+ {\let\bbl@patchuclc\relax}%
+ {\def\bbl@patchuclc{%
+ \global\let\bbl@patchuclc\relax
+ \g@addto@macro\@uclclist{\reserved@b{\reserved@b\bbl@uclc}}%
+ \gdef\bbl@uclc##1{%
\let\bbl@encoded\bbl@encoded@uclc
\@ifundefined{\languagename @bbl@uclc}% and resumes it
- {\reserved@a}%
- {\csname\languagename @bbl@uclc\endcsname}%
+ {##1}%
+ {\let\bbl@tempa##1\relax % Used by LANG@bbl@uclc
+ \csname\languagename @bbl@uclc\endcsname}%
{\bbl@tolower\@empty}{\bbl@toupper\@empty}}%
\gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}%
- \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}{}}%
+ \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<<*More package options>>
+\DeclareOption{nocase}{}
+%<</More package options>>
% \end{macrocode}
%
% The following package options control the behaviour of |\SetString|.
@@ -5218,7 +5250,8 @@ help from Bernd Raichle, for which I am grateful.
% \paragraph{Case mapping}
%
% The command |\SetCase| provides a way to change the behaviour of
-% |\MakeUppercase| and |\MakeLowercase|.
+% |\MakeUppercase| and |\MakeLowercase|. |\bbl@tempa| is set by the
+% patched |\@uclclist| to the parsing command.
%
% \changes{babel~3.9h}{2013/11/08}{Use \cs{bbl@encstrings} - they
% should be defined always, even if no `strings'}
@@ -5228,7 +5261,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@patchuclc
\bbl@forlang\bbl@tempa{%
\expandafter\bbl@encstring
- \csname\bbl@tempa @bbl@uclc\endcsname{\reserved@a##1}%
+ \csname\bbl@tempa @bbl@uclc\endcsname{\bbl@tempa##1}%
\expandafter\bbl@encstring
\csname\bbl@tempa @bbl@uc\endcsname{##2}%
\expandafter\bbl@encstring
@@ -5998,7 +6031,7 @@ help from Bernd Raichle, for which I am grateful.
\def\@citex[#1][#2]#3{%
\@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
\org@@citex[#1][#2]{\@tempa}}%
- }{}}
+ }{}}
% \end{macrocode}
% The package \pkg{cite} has a definition of |\@citex| where the
% shorthands need to be turned off in both arguments.
@@ -6516,9 +6549,9 @@ help from Bernd Raichle, for which I am grateful.
% \end{macrocode}
% \end{macro}
%
-% Now comes the old deprecated stuff. The first thing we need to do
-% is to determine, at |\begin{document}|, which latin fontencoding to
-% use.
+% Now comes the old deprecated stuff (with a little change in 3.9l,
+% for \textsf{fontspec}). The first thing we need to do is to
+% determine, at |\begin{document}|, which latin fontencoding to use.
%
% \begin{macro}{\latinencoding}
% \changes{babel~3.6i}{1997/03/15}{Macro added, moved from
@@ -6550,15 +6583,18 @@ help from Bernd Raichle, for which I am grateful.
% \cs{@filelist}, use \cs{@ifl@aded}}
% \changes{babel~3.6u}{1999/04/20}{Moved this code to
% \file{babel.def}}
+% \changes{babel~3.9l}{2014/08/02}{fontspec used to set
+% \cs{latinencoding} to EUx, but now it doesn't. So,it's done here.}
% \begin{macrocode}
\AtBeginDocument{%
- \gdef\latinencoding{OT1}%
- \ifx\cf@encoding\bbl@t@one
- \xdef\latinencoding{\bbl@t@one}%
- \else
- \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
- \fi
- }
+ \@ifpackageloaded{fontspec}%
+ {\xdef\latinencoding{EU\ifcase\bbl@engine\or2\or1\fi}}%
+ {\gdef\latinencoding{OT1}%
+ \ifx\cf@encoding\bbl@t@one
+ \xdef\latinencoding{\bbl@t@one}%
+ \else
+ \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
+ \fi}}
% \end{macrocode}
% \end{macro}
%
@@ -6642,7 +6678,7 @@ help from Bernd Raichle, for which I am grateful.
% Now that we're sure that the code is seen by \LaTeX\ only, we
% have to find out what the main (primary) document style is
% because we want to redefine some macros. This is only necessary
-% for releases of \LaTeX\ dated before December~1991. Therefor
+% for releases of \LaTeX\ dated before December~1991. Therefore
% this part of the code can optionally be included in
% \file{babel.def} by specifying the \texttt{docstrip} option
% \texttt{names}.
@@ -7747,6 +7783,10 @@ help from Bernd Raichle, for which I am grateful.
\PackageInfo{babel}{#1}%
\endgroup}
\fi
+\@ifpackagewith{babel}{silent}
+ {\let\bbl@info\@gobble
+ \let\bbl@warning\@gobble}
+ {}
\def\@nolanerr#1{%
\bbl@error
{You haven't defined the language #1\space yet}%
@@ -8918,3 +8958,7 @@ help from Bernd Raichle, for which I am grateful.
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\endinput
+%
+% Local Variables:
+% mode: doctex
+% End: \ No newline at end of file