diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-06 22:17:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-06 22:17:47 +0000 |
commit | 97be36944506368e0d4ceba9aac964bdb09df0ab (patch) | |
tree | 7f237115f9857f5690a59db4854af8388998356d /Master/texmf-dist/tex/generic/babel/babel.def | |
parent | 9c014b016ad2023abb6061e05ab16b2c4c3e4a3c (diff) |
babel 3.9a (at long last)
git-svn-id: svn://tug.org/texlive/trunk@30253 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 1201 |
1 files changed, 781 insertions, 420 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 6ba9f816321..840bebbc8a9 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -7,6 +7,7 @@ %% babel.dtx (with options: `core') %% This is a generated file. %% +%% Copyright 2012-2013 Javier Bezos and Johannes L. Braams. %% Copyright 1989-2008 Johannes L. Braams and any individual authors %% listed elsewhere in this file. All rights reserved. %% @@ -23,7 +24,7 @@ %% %% This work has the LPPL maintenance status "maintained". %% -%% The Current Maintainer of this work is Johannes Braams. +%% The Current Maintainer of this work is Javier Bezos. %% %% This file may only be distributed together with a copy of the Babel %% system. You may however distribute the Babel system without @@ -36,18 +37,19 @@ %% The list of derived (unpacked) files belonging to the distribution %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. -%% %% File 'babel.dtx' -%%\ProvidesFile{babel.dtx}[2008/07/08 v3.8m The Babel package] +%%\ProvidesFile{babel.dtx}[2013/04/15 v3.9e The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989 -- 2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Please report errors to: J.L. Braams -%% babel at braams.xs4all.nl -\ifx\bbl@afterfi\@undefined +%% Copyright (C) 2013 by Johannes Braams +%% TeXniek +%% by Javier Bezos +%% all rights reserved. +\ifx\ldf@quit\@undefined \else - \bbl@afterfi\endinput + \expandafter\endinput \fi \ifx\ProvidesFile\@undefined \def\ProvidesFile#1[#2 #3 #4]{% @@ -56,14 +58,60 @@ } \fi \ProvidesFile{babel.def} - [2008/07/08 v3.8m % - Babel common definitions] + [2013/04/15 v3.9e % + Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi -\ifx\iflanguage\@undefined +\def\bbl@tempa{3.9e} +\ifx\bbl@version\bbl@tempa\else \input switch.def\relax \fi +\def\bbl@for#1#2#3{\@for#1:=#2\do{\ifx#1\@empty\else#3\fi}} +\def\bbl@add#1#2{% + \@ifundefined{\expandafter\@gobble\string#1}% + {\def#1{#2}}% + {\expandafter\def\expandafter#1\expandafter{#1#2}}} +\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% +\long\def\bbl@afterelse#1\else#2\fi{\fi#1} +\long\def\bbl@afterfi#1\fi{\fi#1} +\ifx\bbl@opt@strings\@undefined + \def\bbl@opt@safe{BR} + \let\bbl@opt@strings\@nnil + \let\bbl@opt@shorthands\@nnil +\fi +\ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi +\ifx\bbl@afterlang\@undefined\let\bbl@afterlang\relax\fi +\providecommand\AfterBabelLanguage[2]{} +\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% +\long\def\bbl@afterelse#1\else#2\fi{\fi#1} +\long\def\bbl@afterfi#1\fi{\fi#1} +\def\bbl@withactive#1#2{% + \begingroup + \lccode`~=`#2\relax + \lowercase{\endgroup#1~}} +\def\bbl@redefine#1{% + \edef\bbl@tempa{\expandafter\@gobble\string#1}% + \expandafter\let\csname org@\bbl@tempa\endcsname#1% + \expandafter\def\csname\bbl@tempa\endcsname} +\@onlypreamble\bbl@redefine +\def\bbl@redefine@long#1{% + \edef\bbl@tempa{\expandafter\@gobble\string#1}% + \expandafter\let\csname org@\bbl@tempa\endcsname#1% + \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname} +\@onlypreamble\bbl@redefine@long +\def\bbl@redefinerobust#1{% + \edef\bbl@tempa{\expandafter\@gobble\string#1}% + \expandafter\ifx\csname\bbl@tempa\space\endcsname\relax + \expandafter\let\csname org@\bbl@tempa\endcsname#1% + \expandafter\edef\csname\bbl@tempa\endcsname{\noexpand\protect + \expandafter\noexpand\csname\bbl@tempa\space\endcsname}% + \else + \expandafter\let\csname org@\bbl@tempa\expandafter\endcsname + \csname\bbl@tempa\space\endcsname + \fi + \expandafter\def\csname\bbl@tempa\space\endcsname} +\@onlypreamble\bbl@redefinerobust \AtEndOfPackage{\edef\latinencoding{\cf@encoding}} \AtBeginDocument{% \gdef\latinencoding{OT1}% @@ -86,20 +134,17 @@ \catcode`\@=11\relax \chardef\eqcatcode=\catcode`\= \catcode`\==12\relax - \let\bbl@tempa\relax \expandafter\if\expandafter\@backslashchar \expandafter\@car\string#2\@nil - \ifx#2\@undefined - \else - \def\bbl@tempa{\ldf@quit{#1}} + \ifx#2\@undefined\else + \ldf@quit{#1}% \fi \else - \expandafter\ifx\csname#2\endcsname\relax - \else - \def\bbl@tempa{\ldf@quit{#1}} + \expandafter\ifx\csname#2\endcsname\relax\else + \ldf@quit{#1}% \fi \fi - \bbl@tempa + \let\bbl@screset\@empty \ifx\originalTeX\@undefined \let\originalTeX\@empty \else @@ -109,215 +154,166 @@ \expandafter\main@language\expandafter{#1}% \catcode`\@=\atcatcode \let\atcatcode\relax \catcode`\==\eqcatcode \let\eqcatcode\relax - \endinput -} + \endinput} \def\ldf@finish#1{% \loadlocalcfg{#1}% + \bbl@afterlang + \let\bbl@afterlang\relax + \let\BabelModifiers\relax + \let\bbl@screset\relax \expandafter\main@language\expandafter{#1}% \catcode`\@=\atcatcode \let\atcatcode\relax - \catcode`\==\eqcatcode \let\eqcatcode\relax - } + \catcode`\==\eqcatcode \let\eqcatcode\relax} \@onlypreamble\LdfInit \@onlypreamble\ldf@quit \@onlypreamble\ldf@finish \def\main@language#1{% \def\bbl@main@language{#1}% \let\languagename\bbl@main@language - \bbl@patterns{\languagename}% - } -\ifx\l@english\@undefined - \let\l@english\z@ -\fi -\main@language{english} + \bbl@patterns{\languagename}} \AtBeginDocument{% \expandafter\selectlanguage\expandafter{\bbl@main@language}} -\def\bbl@add@special#1{\begingroup +\def\bbl@add@special#1{% + \begingroup \def\do{\noexpand\do\noexpand}% \def\@makeother{\noexpand\@makeother\noexpand}% - \edef\x{\endgroup - \def\noexpand\dospecials{\dospecials\do#1}% - \expandafter\ifx\csname @sanitize\endcsname\relax \else - \def\noexpand\@sanitize{\@sanitize\@makeother#1}% - \fi}% + \edef\x{\endgroup + \def\noexpand\dospecials{\dospecials\do#1}% + \expandafter\ifx\csname @sanitize\endcsname\relax \else + \def\noexpand\@sanitize{\@sanitize\@makeother#1}% + \fi}% \x} -\def\bbl@remove@special#1{\begingroup +\def\bbl@remove@special#1{% + \begingroup \def\x##1##2{\ifnum`#1=`##2\noexpand\@empty \else\noexpand##1\noexpand##2\fi}% \def\do{\x\do}% \def\@makeother{\x\@makeother}% - \edef\x{\endgroup - \def\noexpand\dospecials{\dospecials}% - \expandafter\ifx\csname @sanitize\endcsname\relax \else - \def\noexpand\@sanitize{\@sanitize}% - \fi}% + \edef\x{\endgroup + \def\noexpand\dospecials{\dospecials}% + \expandafter\ifx\csname @sanitize\endcsname\relax \else + \def\noexpand\@sanitize{\@sanitize}% + \fi}% \x} -\long\def\bbl@afterelse#1\else#2\fi{\fi#1} -\long\def\bbl@afterfi#1\fi{\fi#1} +\def\bbl@active@def#1#2#3#4{% + \@namedef{#3#1}{% + \expandafter\ifx\csname#2@sh@#1@\endcsname\relax + \bbl@afterelse\bbl@sh@select#2#1{#3@arg#1}{#4#1}% + \else + \bbl@afterfi\csname#2@sh@#1@\endcsname + \fi}% + \long\@namedef{#3@arg#1}##1{% + \expandafter\ifx\csname#2@sh@#1@\string##1@\endcsname\relax + \bbl@afterelse\csname#4#1\endcsname##1% + \else + \bbl@afterfi\csname#2@sh@#1@\string##1@\endcsname + \fi}}% \def\initiate@active@char#1{% - \expandafter\ifx\csname active@char\string##1\endcsname\relax - \bbl@afterfi{\@initiate@active@char{#1}}% + \expandafter\ifx\csname active@char\string#1\endcsname\relax + \bbl@withactive + {\expandafter\@initiate@active@char\expandafter}#1\string#1#1% \fi} -\begingroup - \catcode`\~\active - \def\x{\endgroup - \def\@initiate@active@char##1{% - \ifcat\noexpand##1\noexpand~\relax - \@ifundefined{normal@char\string##1}{% - \expandafter\let\csname normal@char\string##1\endcsname##1% - \expandafter\gdef - \expandafter##1% - \expandafter{% - \expandafter\active@prefix\expandafter##1% - \csname normal@char\string##1\endcsname}}{}% - \else - \@activated{##1}% - \@namedef{normal@char\string##1}{##1}% - \ifx##1'% - \let\prim@s\bbl@prim@s - \@namedef{normal@char\string##1}{% - \textormath{##1}{^\bgroup\prim@s}}% - \fi - \ifx##1^% - \gdef\bbl@act@caret{% - \ifmmode - \csname normal@char\string^\endcsname - \else - \bbl@afterfi - {\if@safe@actives - \bbl@afterelse\csname normal@char\string##1\endcsname - \else - \bbl@afterfi\csname user@active\string##1\endcsname - \fi}% - \fi} - \fi - \@ifpackagewith{babel}{KeepShorthandsActive}{}{% - \edef\bbl@tempa{\catcode`\noexpand##1\the\catcode`##1}% - \expandafter\AtEndOfPackage\expandafter{\bbl@tempa}}% - \@tempcnta=\lccode`\~ - \lccode`~=`##1% - \lowercase{% - \catcode`~\active - \expandafter\bbl@add@special - \csname \string##1\endcsname - \AtBeginDocument{% - \catcode`##1\active - \if@filesw - \immediate\write\@mainaux{% - \string\catcode`##1\string\active}% - \fi}% - \expandafter\gdef - \expandafter~% - \expandafter{% - \expandafter\active@prefix\expandafter##1% - \csname normal@char\string##1\endcsname}}% - \lccode`\~\@tempcnta - \fi - \ifx##1^% - \@namedef{active@char\string##1}{\bbl@act@caret}% - \else - \@namedef{active@char\string##1}{% - \if@safe@actives - \bbl@afterelse\csname normal@char\string##1\endcsname - \else - \bbl@afterfi\csname user@active\string##1\endcsname - \fi}% - \fi - \@namedef{user@active\string##1}{% - \expandafter\ifx - \csname \user@group @sh@\string##1@\endcsname - \relax - \bbl@afterelse\bbl@sh@select\user@group##1% - {user@active@arg\string##1}{language@active\string##1}% - \else - \bbl@afterfi\csname \user@group @sh@\string##1@\endcsname - \fi}% - \long\@namedef{user@active@arg\string##1}####1{% - \expandafter\ifx - \csname \user@group @sh@\string##1@\string####1@\endcsname - \relax - \bbl@afterelse - \csname language@active\string##1\endcsname####1% - \else - \bbl@afterfi - \csname \user@group @sh@\string##1@\string####1@% - \endcsname - \fi}% - \@namedef{\user@group @sh@\string##1@@}{% - \csname normal@char\string##1\endcsname} - \@namedef{language@active\string##1}{% - \expandafter\ifx - \csname \language@group @sh@\string##1@\endcsname - \relax - \bbl@afterelse\bbl@sh@select\language@group##1% - {language@active@arg\string##1}{system@active\string##1}% - \else - \bbl@afterfi - \csname \language@group @sh@\string##1@\endcsname - \fi}% - \long\@namedef{language@active@arg\string##1}####1{% - \expandafter\ifx - \csname \language@group @sh@\string##1@\string####1@\endcsname - \relax - \bbl@afterelse - \csname system@active\string##1\endcsname####1% - \else - \bbl@afterfi - \csname \language@group @sh@\string##1@\string####1@% - \endcsname - \fi}% - \@namedef{system@active\string##1}{% - \expandafter\ifx - \csname \system@group @sh@\string##1@\endcsname - \relax - \bbl@afterelse\bbl@sh@select\system@group##1% - {system@active@arg\string##1}{normal@char\string##1}% - \else - \bbl@afterfi\csname \system@group @sh@\string##1@\endcsname - \fi}% - \long\@namedef{system@active@arg\string##1}####1{% - \expandafter\ifx - \csname \system@group @sh@\string##1@\string####1@\endcsname - \relax - \bbl@afterelse\csname normal@char\string##1\endcsname####1% - \else - \bbl@afterfi - \csname \system@group @sh@\string##1@\string####1@\endcsname - \fi}% - \@namedef{user@sh@\string##1@\string\protect@}{% - \csname user@active\string##1\endcsname}% - }% - }\x +\def\@initiate@active@char#1#2#3{% + \expandafter\edef\csname bbl@oricat@#2\endcsname{% + \catcode`#2=\the\catcode`#2\relax}% + \ifx#1\@undefined + \expandafter\edef\csname bbl@oridef@#2\endcsname{% + \let\noexpand#1\noexpand\@undefined}% + \else + \expandafter\let\csname bbl@oridef@@#2\endcsname#1% + \expandafter\edef\csname bbl@oridef@#2\endcsname{% + \let\noexpand#1% + \expandafter\noexpand\csname bbl@oridef@@#2\endcsname}% + \fi + \ifx#1#3\relax + \expandafter\let\csname normal@char#2\endcsname#3% + \else + \bbl@info{Making #2 an active character}% + \ifnum\mathcode`#2="8000 + \@namedef{normal@char#2}{% + \textormath{#3}{\csname bbl@oridef@@#2\endcsname}}% + \else + \@namedef{normal@char#2}{#3}% + \fi + \bbl@restoreactive{#2}% + \AtBeginDocument{% + \catcode`#2\active + \if@filesw + \immediate\write\@mainaux{\catcode`\string#2\active}% + \fi}% + \expandafter\bbl@add@special\csname#2\endcsname + \catcode`#2\active + \fi + \let\bbl@tempa\@firstoftwo + \if\string^#2% + \def\bbl@tempa{\noexpand\textormath}% + \else + \ifx\bbl@mathnormal\@undefined\else + \let\bbl@tempa\bbl@mathnormal + \fi + \fi + \expandafter\edef\csname active@char#2\endcsname{% + \bbl@tempa + {\noexpand\if@safe@actives + \noexpand\expandafter + \expandafter\noexpand\csname normal@char#2\endcsname + \noexpand\else + \noexpand\expandafter + \expandafter\noexpand\csname user@active#2\endcsname + \noexpand\fi}% + {\expandafter\noexpand\csname normal@char#2\endcsname}}% + \bbl@csarg\edef{active@#2}{% + \noexpand\active@prefix\noexpand#1% + \expandafter\noexpand\csname active@char#2\endcsname}% + \bbl@csarg\edef{normal@#2}{% + \noexpand\active@prefix\noexpand#1% + \expandafter\noexpand\csname normal@char#2\endcsname}% + \expandafter\let\expandafter#1\csname bbl@normal@#2\endcsname + \bbl@active@def#2\user@group{user@active}{language@active}% + \bbl@active@def#2\language@group{language@active}{system@active}% + \bbl@active@def#2\system@group{system@active}{normal@char}% + \expandafter\edef\csname\user@group @sh@#2@@\endcsname + {\expandafter\noexpand\csname normal@char#2\endcsname}% + \expandafter\edef\csname\user@group @sh@#2@\string\protect@\endcsname + {\expandafter\noexpand\csname user@active#2\endcsname}% + \if\string'#2% + \let\prim@s\bbl@prim@s + \let\active@math@prime#1% + \fi} +\@ifpackagewith{babel}{KeepShorthandsActive}% + {\let\bbl@restoreactive\@gobble}% + {\def\bbl@restoreactive#1{% + \edef\bbl@tempa{% + \noexpand\AfterBabelLanguage\noexpand\CurrentOption + {\catcode`#1=\the\catcode`#1\relax}% + \noexpand\AtEndOfPackage{\catcode`#1=\the\catcode`#1\relax}}% + \bbl@tempa}% + \AtEndOfPackage{\let\bbl@restoreactive\@gobble}} \def\bbl@sh@select#1#2{% - \expandafter\ifx\csname#1@sh@\string#2@sel\endcsname\relax + \expandafter\ifx\csname#1@sh@#2@sel\endcsname\relax \bbl@afterelse\bbl@scndcs \else - \bbl@afterfi\csname#1@sh@\string#2@sel\endcsname - \fi -} + \bbl@afterfi\csname#1@sh@#2@sel\endcsname + \fi} \def\active@prefix#1{% \ifx\protect\@typeset@protect \else \ifx\protect\@unexpandable@protect - \bbl@afterelse\bbl@afterfi\noexpand#1\@gobble + \noexpand#1% \else - \bbl@afterfi\bbl@afterfi\protect#1\@gobble + \protect#1% \fi + \expandafter\@gobble \fi} \newif\if@safe@actives \@safe@activesfalse \def\bbl@restore@actives{\if@safe@actives\@safe@activesfalse\fi} \def\bbl@activate#1{% - \expandafter\def - \expandafter#1\expandafter{% - \expandafter\active@prefix - \expandafter#1\csname active@char\string#1\endcsname}% -} + \bbl@withactive{\expandafter\let\expandafter}#1% + \csname bbl@active@\string#1\endcsname} \def\bbl@deactivate#1{% - \expandafter\def - \expandafter#1\expandafter{% - \expandafter\active@prefix - \expandafter#1\csname normal@char\string#1\endcsname}% -} + \bbl@withactive{\expandafter\let\expandafter}#1% + \csname bbl@normal@\string#1\endcsname} \def\bbl@firstcs#1#2{\csname#1\endcsname} \def\bbl@scndcs#1#2{\csname#2\endcsname} \def\declare@shorthand#1#2{\@decl@short{#1}#2\@nil} @@ -325,98 +321,161 @@ \def\bbl@tempa{#3}% \ifx\bbl@tempa\@empty \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@scndcs + \@ifundefined{#1@sh@\string#2@}{}% + {\def\bbl@tempa{#4}% + \expandafter\ifx\csname#1@sh@\string#2@\endcsname\bbl@tempa + \else + \bbl@info + {Redefining #1 shorthand \string#2\\% + in language \CurrentOption}% + \fi}% \@namedef{#1@sh@\string#2@}{#4}% \else \expandafter\let\csname #1@sh@\string#2@sel\endcsname\bbl@firstcs + \@ifundefined{#1@sh@\string#2@\string#3@}{}% + {\def\bbl@tempa{#4}% + \expandafter\ifx\csname#1@sh@\string#2@\string#3@\endcsname\bbl@tempa + \else + \bbl@info + {Redefining #1 shorthand \string#2\string#3\\% + in language \CurrentOption}% + \fi}% \@namedef{#1@sh@\string#2@\string#3@}{#4}% \fi} -\def\textormath#1#2{% +\def\textormath{% \ifmmode - \bbl@afterelse#2% + \expandafter\@secondoftwo \else - \bbl@afterfi#1% + \expandafter\@firstoftwo \fi} \def\user@group{user} \def\language@group{english} \def\system@group{system} -\def\useshorthands#1{% - \def\user@group{user}% - \initiate@active@char{#1}% - \@tempcnta\lccode`\~ - \lccode`~=`#1% - \lowercase{\catcode`~\active\bbl@activate{~}}% - \lccode`\~\@tempcnta} -\def\defineshorthand{\declare@shorthand{user}} +\def\useshorthands{% + \@ifstar\bbl@usesh@s{\bbl@usesh@x{}}} +\def\bbl@usesh@s#1{% + \bbl@usesh@x + {\AddBabelHook{babel-sh-\string#1}{afterextras}{\bbl@activate{#1}}}% + {#1}} +\def\bbl@usesh@x#1#2{% + \bbl@ifshorthand{#2}% + {\def\user@group{user}% + \initiate@active@char{#2}% + #1% + \bbl@activate{#2}}% + {\bbl@error + {Cannot declare a shorthand turned off (\string#2)} + {Sorry, but you cannot use shorthands which have been\\% + turned off in the package options}}} +\def\user@language@group{user@\language@group} +\def\bbl@set@user@generic#1#2{% + \@ifundefined{user@generic@active#1}% + {\bbl@active@def#1\user@language@group{user@active}{user@generic@active}% + \bbl@active@def#1\user@group{user@generic@active}{language@active}% + \expandafter\edef\csname#2@sh@#1@@\endcsname{% + \expandafter\noexpand\csname normal@char#1\endcsname}% + \expandafter\edef\csname#2@sh@#1@\string\protect@\endcsname{% + \expandafter\noexpand\csname user@active#1\endcsname}}% + \@empty} +\newcommand\defineshorthand[3][user]{% + \edef\bbl@tempa{\zap@space#1 \@empty}% + \bbl@for\bbl@tempb\bbl@tempa{% + \if*\expandafter\@car\bbl@tempb\@nil + \edef\bbl@tempb{user@\expandafter\@gobble\bbl@tempb}% + \@expandtwoargs + \bbl@set@user@generic{\expandafter\string\@car#2\@nil}\bbl@tempb + \fi + \declare@shorthand{\bbl@tempb}{#2}{#3}}} \def\languageshorthands#1{\def\language@group{#1}} \def\aliasshorthand#1#2{% - \expandafter\ifx\csname active@char\string#2\endcsname\relax - \ifx\document\@notprerr - \@notshorthand{#2} - \else - \initiate@active@char{#2}% - \@tempcnta\lccode`\~ - \lccode`~=`#2% - \lowercase{\let~#1}% - \lccode`\~\@tempcnta - \fi - \fi -} + \bbl@ifshorthand{#2}% + {\expandafter\ifx\csname active@char\string#2\endcsname\relax + \ifx\document\@notprerr + \@notshorthand{#2}% + \else + \initiate@active@char{#2}% + \expandafter\let\csname active@char\string#2\expandafter\endcsname + \csname active@char\string#1\endcsname + \expandafter\let\csname normal@char\string#2\expandafter\endcsname + \csname normal@char\string#1\endcsname + \bbl@activate{#2}% + \fi + \fi}% + {\bbl@error + {Cannot declare a shorthand turned off (\string#2)} + {Sorry, but you cannot use shorthands which have been\\% + turned off in the package options}}} \def\@notshorthand#1{% - \PackageError{babel}{% - The character `\string #1' should be made - a shorthand character;\MessageBreak - add the command \string\useshorthands\string{#1\string} to - the preamble.\MessageBreak - I will ignore your instruction}{}% - } -\newcommand*\shorthandon[1]{\bbl@switch@sh{on}#1\@nil} -\newcommand*\shorthandoff[1]{\bbl@switch@sh{off}#1\@nil} -\def\bbl@switch@sh#1#2#3\@nil{% - \@ifundefined{active@char\string#2}{% - \PackageError{babel}{% - The character '\string #2' is not a shorthand character - in \languagename}{% - Maybe you made a typing mistake?\MessageBreak - I will ignore your instruction}}{% - \csname bbl@switch@sh@#1\endcsname#2}% - \ifx#3\@empty\else - \bbl@afterfi\bbl@switch@sh{#1}#3\@nil + \bbl@error{% + The character `\string #1' should be made a shorthand character;\\% + add the command \string\useshorthands\string{#1\string} to + the preamble.\\% + I will ignore your instruction}{}} +\newcommand*\shorthandon[1]{\bbl@switch@sh\@ne#1\@nnil} +\DeclareRobustCommand*\shorthandoff{% + \@ifstar{\bbl@shorthandoff\tw@}{\bbl@shorthandoff\z@}} +\def\bbl@shorthandoff#1#2{\bbl@switch@sh#1#2\@nnil} +\def\bbl@switch@sh#1#2{% + \ifx#2\@nnil\else + \@ifundefined{bbl@active@\string#2}% + {\bbl@error + {I cannot switch `\string#2' on or off--not a shorthand}% + {This character is not a shorthand. Maybe you made\\% + a typing mistake? I will ignore your instruction}}% + {\ifcase#1% + \catcode`#212\relax + \or + \catcode`#2\active + \or + \csname bbl@oricat@\string#2\endcsname + \csname bbl@oridef@\string#2\endcsname + \fi}% + \bbl@afterfi\bbl@switch@sh#1% \fi} -\def\bbl@switch@sh@off#1{\catcode`#112\relax} -\begingroup - \catcode`\~\active - \def\x{\endgroup - \def\bbl@switch@sh@on##1{% - \begingroup - \lccode`~=`##1% - \lowercase{\endgroup - \catcode`~\active - }% - }% - } -\x -\declare@shorthand{system}{"}{\csname normal@char\string"\endcsname} -\declare@shorthand{system}{'}{% - \textormath{\csname normal@char\string'\endcsname}% - {\sp\bgroup\prim@s}} -\declare@shorthand{system}{`}{\csname normal@char\string`\endcsname} +\def\babelshorthand{\active@prefix\babelshorthand\bbl@putsh} +\def\bbl@putsh#1{% + \@ifundefined{bbl@active@\string#1}% + {\bbl@putsh@i#1\@empty\@nnil}% + {\csname bbl@active@\string#1\endcsname}} +\def\bbl@putsh@i#1#2\@nnil{% + \csname\languagename @sh@\string#1@% + \ifx\@empty#2\else\string#2@\fi\endcsname} +\ifx\bbl@opt@shorthands\@nnil\else + \let\bbl@s@initiate@active@char\initiate@active@char + \def\initiate@active@char#1{% + \bbl@ifshorthand{#1}{\bbl@s@initiate@active@char{#1}}{}} + \let\bbl@s@switch@sh\bbl@switch@sh + \def\bbl@switch@sh#1#2{% + \ifx#2\@nnil\else + \bbl@afterfi + \bbl@ifshorthand{#2}{\bbl@s@switch@sh#1{#2}}{\bbl@switch@sh#1}% + \fi} + \let\bbl@s@activate\bbl@activate + \def\bbl@activate#1{% + \bbl@ifshorthand{#1}{\bbl@s@activate{#1}}{}} + \let\bbl@s@deactivate\bbl@deactivate + \def\bbl@deactivate#1{% + \bbl@ifshorthand{#1}{\bbl@s@deactivate{#1}}{}} +\fi \def\bbl@prim@s{% \prime\futurelet\@let@token\bbl@pr@m@s} +\def\bbl@if@primes#1#2{% + \ifx#1\@let@token + \expandafter\@firstoftwo + \else\ifx#2\@let@token + \bbl@afterelse\expandafter\@firstoftwo + \else + \bbl@afterfi\expandafter\@secondoftwo + \fi\fi} \begingroup - \catcode`\'\active\let'\relax - \def\x{\endgroup - \def\bbl@pr@m@s{% - \ifx'\@let@token - \expandafter\pr@@@s - \else - \ifx^\@let@token - \expandafter\expandafter\expandafter\pr@@@t - \else - \egroup - \fi - \fi}% - } -\x + \catcode`\^=7 \catcode`\*=\active \lccode`\*=`\^ + \catcode`\'=12 \catcode`\"=\active \lccode`\"=`\' + \lowercase{% + \gdef\bbl@pr@m@s{% + \bbl@if@primes"'% + \pr@@@s + {\bbl@if@primes*^\pr@@@t\egroup}}} +\endgroup \initiate@active@char{~} \declare@shorthand{system}{~}{\leavevmode\nobreak\ } \bbl@activate{~} @@ -426,48 +485,46 @@ \def\f@encoding{OT1} \fi \newcommand\languageattribute[2]{% - \expandafter\ifx\csname l@#1\endcsname\relax - \@nolanerr{#1}% - \else + \def\bbl@tempc{#1}% + \bbl@fixname\bbl@tempc + \bbl@iflanguage\bbl@tempc{% \@for\bbl@attr:=#2\do{% \ifx\bbl@known@attribs\@undefined \in@false \else - \edef\bbl@tempa{\noexpand\in@{,#1-\bbl@attr,}% - {,\bbl@known@attribs,}}% - \bbl@tempa + \@expandtwoargs\in@{,\bbl@tempc-\bbl@attr,}{,\bbl@known@attribs,}% \fi \ifin@ - \PackageWarning{Babel}{% - You have more than once selected the attribute - '\bbl@attr'\MessageBreak for language #1}% + \bbl@warning{% + You have more than once selected the attribute '\bbl@attr'\\% + for language #1}% \else \edef\bbl@tempa{% - \noexpand\bbl@add@list\noexpand\bbl@known@attribs{#1-\bbl@attr}}% + \noexpand\bbl@add@list + \noexpand\bbl@known@attribs{\bbl@tempc-\bbl@attr}}% \bbl@tempa - \edef\bbl@tempa{#1-\bbl@attr}% + \edef\bbl@tempa{\bbl@tempc-\bbl@attr}% \expandafter\bbl@ifknown@ttrib\expandafter{\bbl@tempa}\bbl@attributes% - {\csname#1@attr@\bbl@attr\endcsname}% - {\@attrerr{#1}{\bbl@attr}}% - \fi - } - \fi} + {\csname\bbl@tempc @attr@\bbl@attr\endcsname}% + {\@attrerr{\bbl@tempc}{\bbl@attr}}% + \fi}}} \@onlypreamble\languageattribute - \newcommand*{\@attrerr}[2]{% - \PackageError{babel}% - {The attribute #2 is unknown for language #1.}% - {Your command will be ignored, type <return> to proceed}} +\newcommand*{\@attrerr}[2]{% + \bbl@error + {The attribute #2 is unknown for language #1.}% + {Your command will be ignored, type <return> to proceed}} \def\bbl@declare@ttribute#1#2#3{% + \@expandtwoargs\in@{,#2,}{,\BabelModifiers,}% + \ifin@ + \AfterBabelLanguage{#1}{\languageattribute{#1}{#2}}% + \fi \bbl@add@list\bbl@attributes{#1-#2}% - \expandafter\def\csname#1@attr@#2\endcsname{#3}% - } + \expandafter\def\csname#1@attr@#2\endcsname{#3}} \def\bbl@ifattributeset#1#2#3#4{% \ifx\bbl@known@attribs\@undefined \in@false \else - \edef\bbl@tempa{\noexpand\in@{,#1-#2,}% - {,\bbl@known@attribs,}}% - \bbl@tempa + \@expandtwoargs\in@{,#1-#2,}{,\bbl@known@attribs,}% \fi \ifin@ \bbl@afterelse#3% @@ -511,9 +568,9 @@ \newcount\babel@savecnt \babel@beginsave \def\babel@save#1{% - \expandafter\let\csname babel@\number\babel@savecnt\endcsname #1\relax + \expandafter\let\csname babel@\number\babel@savecnt\endcsname#1\relax \begingroup - \toks@\expandafter{\originalTeX \let#1=}% + \toks@\expandafter{\originalTeX\let#1=}% \edef\x{\endgroup \def\noexpand\originalTeX{\the\toks@ \expandafter\noexpand \csname babel@\number\babel@savecnt\endcsname\relax}}% @@ -540,32 +597,88 @@ \def#1{#2}% \else {\toks@\expandafter{#1#2}% - \xdef#1{\the\toks@}}% + \xdef#1{\the\toks@}}% \fi - \fi -} -\def\bbl@t@one{T1} -\def\allowhyphens{% - \ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi} + \fi} +\@onlypreamble\babelhyphenation +\AtEndOfPackage{% + \newcommand\babelhyphenation[2][\@empty]{% + \ifx\bbl@hyphenation@\relax + \let\bbl@hyphenation@\@empty + \fi + \ifx\bbl@hyphlist\@empty\else + \bbl@warning{% + You must not intermingle \string\selectlanguage\space and\\% + \string\babelhyphenation\space or some exception will not\\% + be taken into account. Reported}% + \fi + \ifx\@empty#1% + \protected@edef\bbl@hyphenation@{\bbl@hyphenation@\space#2}% + \else + \edef\bbl@tempb{\zap@space#1 \@empty}% + \bbl@for\bbl@tempa\bbl@tempb{% + \bbl@fixname\bbl@tempa + \bbl@iflanguage\bbl@tempa{% + \bbl@csarg\protected@edef{hyphenation@\bbl@tempa}{% + \@ifundefined{bbl@hyphenation@\bbl@tempa}% + \@empty + {\csname bbl@hyphenation@\bbl@tempa\endcsname\space}% + #2}}}% + \fi}} \def\bbl@allowhyphens{\nobreak\hskip\z@skip} +\def\bbl@t@one{T1} +\def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi} +\newcommand\babelnullhyphen{\char\hyphenchar\font} +\def\babelhyphen{\active@prefix\babelhyphen\bbl@hyphen} +\def\bbl@hyphen{% + \@ifstar{\bbl@hyphen@i @}{\bbl@hyphen@i\@empty}} +\def\bbl@hyphen@i#1#2{% + \@ifundefined{bbl@hy@#1#2\@empty}% + {\csname bbl@#1usehyphen\endcsname{\discretionary{#2}{}{#2}}}% + {\csname bbl@hy@#1#2\@empty\endcsname}} +\def\bbl@usehyphen#1{% + \leavevmode + \ifdim\lastskip>\z@\mbox{#1}\nobreak\else\nobreak#1\fi + \hskip\z@skip} +\def\bbl@@usehyphen#1{% + \leavevmode\ifdim\lastskip>\z@\mbox{#1}\else#1\fi} +\def\bbl@hyphenchar{% + \ifnum\hyphenchar\font=\m@ne + \babelnullhyphen + \else + \char\hyphenchar\font + \fi} +\def\bbl@hy@soft{\bbl@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}} +\def\bbl@hy@@soft{\bbl@@usehyphen{\discretionary{\bbl@hyphenchar}{}{}}} +\def\bbl@hy@hard{\bbl@usehyphen\bbl@hyphenchar} +\def\bbl@hy@@hard{\bbl@@usehyphen\bbl@hyphenchar} +\def\bbl@hy@nobreak{\bbl@usehyphen{\mbox{\bbl@hyphenchar}\nobreak}} +\def\bbl@hy@@nobreak{\mbox{\bbl@hyphenchar}} +\def\bbl@hy@repeat{% + \bbl@usehyphen{% + \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}% + \nobreak}} +\def\bbl@hy@@repeat{% + \bbl@@usehyphen{% + \discretionary{\bbl@hyphenchar}{\bbl@hyphenchar}{\bbl@hyphenchar}}} +\def\bbl@hy@empty{\hskip\z@skip} +\def\bbl@hy@@empty{\discretionary{}{}{}} +\def\bbl@disc#1#2{\nobreak\discretionary{#2-}{}{#1}\bbl@allowhyphens} \def\set@low@box#1{\setbox\tw@\hbox{,}\setbox\z@\hbox{#1}% \dimen\z@\ht\z@ \advance\dimen\z@ -\ht\tw@% \setbox\z@\hbox{\lower\dimen\z@ \box\z@}\ht\z@\ht\tw@ \dp\z@\dp\tw@} -\def\save@sf@q #1{\leavevmode - \begingroup - \edef\@SF{\spacefactor \the\spacefactor}#1\@SF - \endgroup -} -\def\bbl@disc#1#2{% - \nobreak\discretionary{#2-}{}{#1}\allowhyphens} +\def\save@sf@q#1{\leavevmode + \begingroup + \edef\@SF{\spacefactor\the\spacefactor}#1\@SF + \endgroup} \ProvideTextCommand{\quotedblbase}{OT1}{% \save@sf@q{\set@low@box{\textquotedblright\/}% - \box\z@\kern-.04em\allowhyphens}} + \box\z@\kern-.04em\bbl@allowhyphens}} \ProvideTextCommandDefault{\quotedblbase}{% \UseTextSymbol{OT1}{\quotedblbase}} \ProvideTextCommand{\quotesinglbase}{OT1}{% \save@sf@q{\set@low@box{\textquoteright\/}% - \box\z@\kern-.04em\allowhyphens}} + \box\z@\kern-.04em\bbl@allowhyphens}} \ProvideTextCommandDefault{\quotesinglbase}{% \UseTextSymbol{OT1}{\quotesinglbase}} \ProvideTextCommand{\guillemotleft}{OT1}{% @@ -573,14 +686,14 @@ \ll \else \save@sf@q{\nobreak - \raise.2ex\hbox{$\scriptscriptstyle\ll$}\allowhyphens}% + \raise.2ex\hbox{$\scriptscriptstyle\ll$}\bbl@allowhyphens}% \fi} \ProvideTextCommand{\guillemotright}{OT1}{% \ifmmode \gg \else \save@sf@q{\nobreak - \raise.2ex\hbox{$\scriptscriptstyle\gg$}\allowhyphens}% + \raise.2ex\hbox{$\scriptscriptstyle\gg$}\bbl@allowhyphens}% \fi} \ProvideTextCommandDefault{\guillemotleft}{% \UseTextSymbol{OT1}{\guillemotleft}} @@ -591,23 +704,23 @@ <% \else \save@sf@q{\nobreak - \raise.2ex\hbox{$\scriptscriptstyle<$}\allowhyphens}% + \raise.2ex\hbox{$\scriptscriptstyle<$}\bbl@allowhyphens}% \fi} \ProvideTextCommand{\guilsinglright}{OT1}{% \ifmmode >% \else \save@sf@q{\nobreak - \raise.2ex\hbox{$\scriptscriptstyle>$}\allowhyphens}% + \raise.2ex\hbox{$\scriptscriptstyle>$}\bbl@allowhyphens}% \fi} \ProvideTextCommandDefault{\guilsinglleft}{% \UseTextSymbol{OT1}{\guilsinglleft}} \ProvideTextCommandDefault{\guilsinglright}{% \UseTextSymbol{OT1}{\guilsinglright}} \DeclareTextCommand{\ij}{OT1}{% - \allowhyphens i\kern-0.02em j\allowhyphens} + i\kern-0.02em\bbl@allowhyphens j} \DeclareTextCommand{\IJ}{OT1}{% - \allowhyphens I\kern-0.02em J\allowhyphens} + I\kern-0.02em\bbl@allowhyphens J} \DeclareTextCommand{\ij}{T1}{\char188} \DeclareTextCommand{\IJ}{T1}{\char156} \ProvideTextCommandDefault{\ij}{% @@ -685,7 +798,7 @@ \def\umlauthigh{% \def\bbl@umlauta##1{\leavevmode\bgroup% \expandafter\accent\csname\f@encoding dqpos\endcsname - ##1\allowhyphens\egroup}% + ##1\bbl@allowhyphens\egroup}% \let\bbl@umlaute\bbl@umlauta} \def\umlautlow{% \def\bbl@umlauta{\protect\lower@umlaut}} @@ -718,6 +831,192 @@ \DeclareTextCompositeCommand{\"}{OT1}{O}{\bbl@umlauta{O}}% \DeclareTextCompositeCommand{\"}{OT1}{U}{\bbl@umlauta{U}}% } +\def\bbl@recatcode#1{% + \@tempcnta="7F + \def\bbl@tempa{% + \ifnum\@tempcnta>"FF\else + \catcode\@tempcnta=#1\relax + \advance\@tempcnta\@ne + \expandafter\bbl@tempa + \fi}% + \bbl@tempa} +\@onlypreamble\StartBabelCommands +\def\StartBabelCommands{% + \begingroup + \bbl@recatcode{11}% + \def\bbl@scuse{% + \ifx\bbl@opt@strings\@nnil\def\bbl@opt@strings{generic}\fi}% + \def\UseStrings{\bbl@scuse\aftergroup\bbl@scuse}% + \def\SetStringLoop{\afterassignment\bbl@sclp\def\bbl@templ####1}% + \def\bbl@sclp##1{% + \count@\z@ % dangerous if a hook is used + \@for\bbl@tempm:=##1\do{% + \advance\count@\@ne + \toks@\expandafter{\bbl@tempm}% + \edef\bbl@tempn{% + \expandafter\noexpand + \csname\bbl@templ{\romannumeral\count@}\endcsname% + {\the\toks@}}% + \expandafter\SetString\bbl@tempn}}% + \def\SetCase{% + \@ifundefined{bbl@tolower}{% + \g@addto@macro\@uclclist{% + \reserved@b{\reserved@b\@gobble}% stops processing the list + \@ifundefined{\languagename @bbl@uclc}% and resumes it + {\reserved@a}% + {\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}}{}% + \let\SetCase\bbl@setcase + \SetCase}% + \def\bbl@provstring##1{% + \@ifundefined{\expandafter\@gobble\string##1}{\gdef##1}\@gobble}% + \def\bbl@dftstring##1##2{% + \@dec@text@cmd\gdef##1?{##2}% + \global\let##1##1}% + \def\bbl@encstring##1##2{% + \bbl@for\bbl@tempc\bbl@sc@fontenc{% + \@ifundefined{T@\bbl@tempc}% + \@empty + {\@dec@text@cmd\gdef##1\bbl@tempc{##2}% + \global\let##1##1}}}% + \let\StartBabelCommands\bbl@startcmds + \begingroup + \let\bbl@screset\@nnil % local flag - disable 1st stopcommands + \StartBabelCommands} +\def\bbl@startcmds#1#2{% + \ifx\bbl@screset\@nnil\else + \bbl@usehooks{stopcommands}{}% + \fi + \endgroup + \begingroup + \edef\bbl@L{\zap@space#1 \@empty}% + \edef\bbl@G{\zap@space#2 \@empty}% + \let\bbl@sc@charset\space + \let\bbl@sc@fontenc\space + \let\SetString\@gobbletwo + \let\bbl@stringdef\@gobbletwo + \bbl@startcmds@i} +\newcommand\bbl@startcmds@i[1][\@empty]{% + \ifx\@empty#1% + \def\bbl@sc@label{generic}% + \bbl@scswitch{% + \ifx\bbl@opt@strings\@nnil + \let\bbl@stringdef\bbl@dftstring + \else\ifx\bbl@opt@strings\relax + \let\SetString\bbl@setstring + \let\bbl@stringdef\bbl@dftstring + \else + \let\SetString\bbl@setstring + \let\bbl@stringdef\bbl@provstring + \fi\fi}% + \@expandtwoargs + \bbl@usehooks{defaultcommands}{}% + \else + \def\bbl@tempa##1=##2\@nil{% + \bbl@csarg\edef{sc@\zap@space##1 \@empty}{##2 }}% + \bbl@for\bbl@tempb{label=#1}{\expandafter\bbl@tempa\bbl@tempb\@nil}% + \def\bbl@tempa##1 ##2{% + ##1% + \ifx\@empty##2\else\ifx,##1,\else,\fi\bbl@afterfi\bbl@tempa##2\fi}% + \edef\bbl@sc@fontenc{\expandafter\bbl@tempa\bbl@sc@fontenc\@empty}% + \edef\bbl@sc@label{\expandafter\zap@space\bbl@sc@label\@empty}% + \edef\bbl@sc@charset{\expandafter\zap@space\bbl@sc@charset\@empty}% + \bbl@scswitch{% + \ifx\bbl@opt@strings\@nnil + \let\bbl@stringdef\bbl@encstring + \else\ifx\bbl@opt@strings\relax + \let\SetString\bbl@setstring + \let\bbl@stringdef\bbl@encstring + \else + \@expandtwoargs + \in@{,\bbl@opt@strings,}{,\bbl@sc@label,\bbl@sc@fontenc,}% + \ifin@ + \let\SetString\bbl@setstring + \let\bbl@stringdef\bbl@provstring + \fi\fi\fi}% + \@expandtwoargs + \bbl@usehooks{encodedcommands}{{\bbl@sc@charset}{\bbl@sc@fontenc}}% + \fi} +\def\bbl@scswitch#1{% + \@expandtwoargs\in@{,\CurrentOption,}{,\bbl@L,}% + \ifin@ + \let\bbl@L\CurrentOption + #1\relax + \bbl@scswitch@i + \ifx\bbl@G\@empty\else + \ifx\SetString\@gobbletwo\else + \edef\bbl@GL{\bbl@G\bbl@L}% + \@expandtwoargs\in@{,\bbl@GL,}{,\bbl@screset,}% + \ifin@\else + \global\expandafter\let\csname\bbl@GL\endcsname\@undefined + \xdef\bbl@screset{\bbl@screset,\bbl@GL}% + \fi + \fi + \fi + \fi} +\def\bbl@scswitch@i{% + \ifx\bbl@G\@empty + \def\SetString##1##2{% + \bbl@error{Missing group for string \string##1}% + {You must assign strings to some category, typically\\% + captions or extras, but you set none}}% + \fi} +\AtEndOfPackage{\def\bbl@scswitch#1{#1\relax\bbl@scswitch@i}} +\@onlypreamble\EndBabelCommands +\def\EndBabelCommands{% + \bbl@usehooks{stopcommands}{}% + \endgroup + \endgroup} +\def\bbl@scset#1#2{\def#1{#2}} +\def\bbl@setstring#1#2{% + \bbl@for\bbl@tempa\bbl@L{% + \edef\bbl@LC{\bbl@tempa\expandafter\@gobble\string#1}% + \@ifundefined{\bbl@LC}% eg, \germanchaptername + {\global\expandafter + \bbl@add\csname\bbl@G\bbl@tempa\expandafter\endcsname\expandafter + {\expandafter\bbl@scset\expandafter#1\csname\bbl@LC\endcsname}}% + {}% + \def\BabelString{#2}% + \bbl@usehooks{stringprocess}{}% + \expandafter\bbl@stringdef + \csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}} +\newcommand\bbl@setcase[3][]{% + \bbl@for\bbl@tempa\bbl@L{% + \expandafter\bbl@stringdef + \csname\bbl@tempa @bbl@uclc\endcsname{\reserved@a#1}% + \expandafter\bbl@stringdef + \csname\bbl@tempa @bbl@uc\endcsname{#2}% + \expandafter\bbl@stringdef + \csname\bbl@tempa @bbl@lc\endcsname{#3}}} +\def\AddBabelHook#1#2{% + \@ifundefined{bbl@hk@#1}{\EnableBabelHook{#1}}{}% + \def\bbl@tempa##1,#2=##2,##3\@empty{\def\bbl@tempb{##2}}% + \expandafter\bbl@tempa\bbl@evargs,#2=,\@empty + \@ifundefined{bbl@ev@#1@#2}% + {\bbl@csarg\bbl@add{ev@#2}{\bbl@elt{#1}}% + \bbl@csarg\newcommand}% + {\bbl@csarg\renewcommand}% + {ev@#1@#2}[\bbl@tempb]} +\def\EnableBabelHook#1{\bbl@csarg\let{hk@#1}\@firstofone} +\def\DisableBabelHook#1{\bbl@csarg\let{hk@#1}\@gobble} +\def\bbl@usehooks#1#2{% + \def\bbl@elt##1{% + \@nameuse{bbl@hk@##1}{\@nameuse{bbl@ev@##1@#1}#2}}% + \@nameuse{bbl@ev@#1}} +\def\bbl@evargs{,% don't delete the comma + everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,% + adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,% + beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,% + hyphenation=2} +\ifx\directlua\@undefined + \ifx\XeTeXinputencoding\@undefined\else + \input xebabel.def + \fi +\else + \input luababel.def +\fi {\def\format{lplain} \ifx\fmtname\format \else @@ -727,95 +1026,83 @@ \aftergroup\endinput \fi \fi} -\def\bbl@redefine#1{% - \edef\bbl@tempa{\expandafter\@gobble\string#1}% - \expandafter\let\csname org@\bbl@tempa\endcsname#1 - \expandafter\def\csname\bbl@tempa\endcsname} -\@onlypreamble\bbl@redefine -\def\bbl@redefine@long#1{% - \edef\bbl@tempa{\expandafter\@gobble\string#1}% - \expandafter\let\csname org@\bbl@tempa\endcsname#1 - \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname} -\@onlypreamble\bbl@redefine@long -\def\bbl@redefinerobust#1{% - \edef\bbl@tempa{\expandafter\@gobble\string#1}% - \expandafter\ifx\csname \bbl@tempa\space\endcsname\relax - \expandafter\let\csname org@\bbl@tempa\endcsname#1 - \expandafter\edef\csname\bbl@tempa\endcsname{\noexpand\protect - \expandafter\noexpand\csname\bbl@tempa\space\endcsname}% - \else - \expandafter\let\csname org@\bbl@tempa\expandafter\endcsname - \csname\bbl@tempa\space\endcsname - \fi - \expandafter\def\csname\bbl@tempa\space\endcsname} -\@onlypreamble\bbl@redefinerobust -\def\@newl@bel#1#2#3{% - {% - \@safe@activestrue +\ifx\bbl@opt@safe\@empty\else + \def\@newl@bel#1#2#3{% + {\@safe@activestrue \@ifundefined{#1@#2}% - \relax - {% - \gdef \@multiplelabels {% + \relax + {\gdef\@multiplelabels{% \@latex@warning@no@line{There were multiply-defined labels}}% - \@latex@warning@no@line{Label `#2' multiply defined}% - }% - \global\@namedef{#1@#2}{#3}% - }% - } -\CheckCommand*\@testdef[3]{% - \def\reserved@a{#3}% - \expandafter \ifx \csname #1@#2\endcsname \reserved@a - \else - \@tempswatrue - \fi} -\def\@testdef #1#2#3{% - \@safe@activestrue - \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname - \def\bbl@tempb{#3}% - \@safe@activesfalse - \ifx\bbl@tempa\relax - \else - \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}% - \fi - \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}% - \ifx \bbl@tempa \bbl@tempb - \else - \@tempswatrue - \fi} -\bbl@redefinerobust\ref#1{% - \@safe@activestrue\org@ref{#1}\@safe@activesfalse} -\bbl@redefinerobust\pageref#1{% - \@safe@activestrue\org@pageref{#1}\@safe@activesfalse} -\bbl@redefine\@citex[#1]#2{% - \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse - \org@@citex[#1]{\@tempa}} -\AtBeginDocument{% - \@ifpackageloaded{natbib}{% + \@latex@warning@no@line{Label `#2' multiply defined}}% + \global\@namedef{#1@#2}{#3}}} + \CheckCommand*\@testdef[3]{% + \def\reserved@a{#3}% + \expandafter\ifx\csname#1@#2\endcsname\reserved@a + \else + \@tempswatrue + \fi} + \def\@testdef#1#2#3{% + \@safe@activestrue + \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname + \def\bbl@tempb{#3}% + \@safe@activesfalse + \ifx\bbl@tempa\relax + \else + \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}% + \fi + \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}% + \ifx\bbl@tempa\bbl@tempb + \else + \@tempswatrue + \fi} +\fi +\@expandtwoargs\in@{R}\bbl@opt@safe +\ifin@ + \bbl@redefinerobust\ref#1{% + \@safe@activestrue\org@ref{#1}\@safe@activesfalse} + \bbl@redefinerobust\pageref#1{% + \@safe@activestrue\org@pageref{#1}\@safe@activesfalse} +\else + \let\org@ref\ref + \let\org@pageref\pageref +\fi +\@expandtwoargs\in@{B}\bbl@opt@safe +\ifin@ + \bbl@redefine\@citex[#1]#2{% + \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse + \org@@citex[#1]{\@tempa}} + \AtBeginDocument{% + \@ifpackageloaded{natbib}{% \def\@citex[#1][#2]#3{% \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse \org@@citex[#1][#2]{\@tempa}}% }{}} -\AtBeginDocument{% - \@ifpackageloaded{cite}{% - \def\@citex[#1]#2{% - \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}% - }{}} -\bbl@redefine\nocite#1{% - \@safe@activestrue\org@nocite{#1}\@safe@activesfalse} -\bbl@redefine\bibcite{% - \bbl@cite@choice - \bibcite} -\def\bbl@bibcite#1#2{% - \org@bibcite{#1}{\@safe@activesfalse#2}} -\def\bbl@cite@choice{% - \global\let\bibcite\bbl@bibcite - \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}% - \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}% - \global\let\bbl@cite@choice\relax - } -\AtBeginDocument{\bbl@cite@choice} -\bbl@redefine\@bibitem#1{% - \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse} + \AtBeginDocument{% + \@ifpackageloaded{cite}{% + \def\@citex[#1]#2{% + \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}% + }{}} + \bbl@redefine\nocite#1{% + \@safe@activestrue\org@nocite{#1}\@safe@activesfalse} + \bbl@redefine\bibcite{% + \bbl@cite@choice + \bibcite} + \def\bbl@bibcite#1#2{% + \org@bibcite{#1}{\@safe@activesfalse#2}} + \def\bbl@cite@choice{% + \global\let\bibcite\bbl@bibcite + \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}% + \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}% + \global\let\bbl@cite@choice\relax} + \AtBeginDocument{\bbl@cite@choice} + \bbl@redefine\@bibitem#1{% + \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse} +\else + \let\org@nocite\nocite + \let\org@@citex\@citex + \let\org@bibcite\bibcite + \let\org@@bibitem\@bibitem +\fi \bbl@redefine\markright#1{% \edef\bbl@tempb{\noexpand\protect \noexpand\foreignlanguage{\languagename}}% @@ -857,37 +1144,111 @@ \bbl@tempa } \bbl@tempc -\bbl@redefine\TeX{\textlatin{\org@TeX}} -\bbl@redefine\LaTeX{\textlatin{\org@LaTeX}} -\ifx\nfss@catcodes\@undefined -\else - \addto\nfss@catcodes{% - \@makeother\'% - \@makeother\"% +\@expandtwoargs\in@{R}\bbl@opt@safe +\ifin@ + \AtBeginDocument{% + \@ifpackageloaded{ifthen}{% + \bbl@redefine@long\ifthenelse#1#2#3{% + \let\bbl@tempa\pageref + \let\pageref\org@pageref + \let\bbl@tempb\ref + \let\ref\org@ref + \@safe@activestrue + \org@ifthenelse{#1}{% + \let\pageref\bbl@tempa + \let\ref\bbl@tempb + \@safe@activesfalse + #2}{% + \let\pageref\bbl@tempa + \let\ref\bbl@tempb + \@safe@activesfalse + #3}% + }% + }{}% + } + \AtBeginDocument{% + \@ifpackageloaded{varioref}{% + \bbl@redefine\@@vpageref#1[#2]#3{% + \@safe@activestrue + \org@@@vpageref{#1}[#2]{#3}% + \@safe@activesfalse}% + \bbl@redefine\vrefpagenum#1#2{% + \@safe@activestrue + \org@vrefpagenum{#1}{#2}% + \@safe@activesfalse}% + \expandafter\def\csname Ref \endcsname#1{% + \protected@edef\@tempa{\org@ref{#1}}\expandafter\MakeUppercase\@tempa} + }{}% } \fi +\AtEndOfPackage{% + \AtBeginDocument{% + \@ifpackageloaded{hhline}% + {\expandafter\ifx\csname normal@char\string:\endcsname\relax + \else + \makeatletter + \def\@currname{hhline}\input{hhline.sty}\makeatother + \fi}% + {}}} +\AtBeginDocument{% + \@ifundefined{pdfstringdefDisableCommands}% + {}% + {\pdfstringdefDisableCommands{% + \languageshorthands{system}}% + }% +} +\DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{% + \lowercase{\foreignlanguage{#1}}} +\def\substitutefontfamily#1#2#3{% + \lowercase{\immediate\openout15=#1#2.fd\relax}% + \immediate\write15{% + \string\ProvidesFile{#1#2.fd}% + [\the\year/\two@digits{\the\month}/\two@digits{\the\day} + \space generated font description file]^^J + \string\DeclareFontFamily{#1}{#2}{}^^J + \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J + \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J + \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J + \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J + \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J + \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J + \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J + \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J + }% + \closeout15 + } +\@onlypreamble\substitutefontfamily +\bbl@redefine\TeX{\textlatin{\org@TeX}} +\bbl@redefine\LaTeX{\textlatin{\org@LaTeX}} +\bbl@add\nfss@catcodes{% + \@makeother\'% + \@makeother\"} \ifx\loadlocalcfg\@undefined - \def\loadlocalcfg#1{% - \InputIfFileExists{#1.cfg} - {\typeout{*************************************^^J% - * Local config file #1.cfg used^^J% - *}% - } - {}} + \@ifpackagewith{babel}{noconfigs}% + {\let\loadlocalcfg\@gobble}% + {\def\loadlocalcfg#1{% + \InputIfFileExists{#1.cfg}% + {\typeout{*************************************^^J% + * Local config file #1.cfg used^^J% + *}}% + \@empty}} \fi \ifx\@unexpandable@protect\@undefined \def\@unexpandable@protect{\noexpand\protect\noexpand} - \long\def \protected@write#1#2#3{% - \begingroup - \let\thepage\relax - #2% - \let\protect\@unexpandable@protect - \edef\reserved@a{\write#1{#3}}% - \reserved@a - \endgroup - \if@nobreak\ifvmode\nobreak\fi\fi - } + \long\def\protected@write#1#2#3{% + \begingroup + \let\thepage\relax + #2% + \let\protect\@unexpandable@protect + \edef\reserved@a{\write#1{#3}}% + \reserved@a + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} \fi +\ifx\l@english\@undefined + \chardef\l@english\z@ +\fi +\main@language{english} %% %% \CharacterTable %% {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 |