diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/babel/README | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/babel/babel.pdf | bin | 391903 -> 400435 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.dtx | 191 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/babel.ins | 32 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/babel/bbunicode.dtx | 266 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 50 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.sty | 56 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/blplain.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/bplain.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/hyphen.cfg | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/luababel.def | 185 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/nil.ldf | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/plain.def | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/switch.def | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/xebabel.def | 4 |
15 files changed, 628 insertions, 232 deletions
diff --git a/Master/texmf-dist/doc/latex/babel/README b/Master/texmf-dist/doc/latex/babel/README index 4433730d54f..7e48c02a098 100644 --- a/Master/texmf-dist/doc/latex/babel/README +++ b/Master/texmf-dist/doc/latex/babel/README @@ -1,11 +1,11 @@ -Babel 3.9n +Babel 3.9q ---------- -**** Versions 3.9o and 3.9p are deprecated. There is a severe -**** bug which will take longer than expected to fix, and -**** therefore I decide to downgrade. 2016-02-09 +This is Babel 3.9q. -This is Babel 3.9n. +*** Babel 3.9o and 3.9p are deprecated *** +*** For incompatibilities with polyglossia read the manual *** +*** You must recreate the formats if coming from an older version *** Version 3.9a fixed lots of bugs and added some new features, intended mainly to make it compatible somehow with Unicode engines. Some bugs @@ -22,11 +22,11 @@ about contributing a language. To install it, just tex babel.ins and move the generated files to the corresponding place in your TeX distribution. Unlike former releases, formats must not be recreated, but it is recommended, at least the -first time Babel is updated from 3.8 (or previous versions). +first time Babel is updated from 3.8 (or previous versions). Changes are described in babel.pdf with the label "New 3.9". The -manual has been expanded to include tips and tricks, but it will be -improved in next releases. +manual has been expanded to include some tips and tricks, but it will +be improved in next releases. Please, report bugs and suggestions to: @@ -34,7 +34,7 @@ http://latex-project.org/bugs-upload.html You may also report them to the author more informally on: -http://www.tex-tipografia.com/contact.html +http://www.texnia.com/contact.html Bugs related to specific languages are best reported to their respective authors. @@ -95,10 +95,13 @@ New Now, babel sets it if fontspec is loaded. - New package options 'nocase' (\SetCase is ignored) and 'silent' - Improved compatibility (hopefully) with babelbib. -3.9m - Fixed melayu name (from meyalu) - - A few lines for \babelpatterns (only luatex, see below) +3.9m - Fixed melayu name (from meyalu). + - A few lines for \babelpatterns (only luatex, see below). 3.9n - Just fixes a couple of minor bugs (related to 2.09 and ifthen). - +3.9o - Adapted to the forthcoming Unicode encoding. +3.9p - A little change for bbunicode 1.1b. +3.9q - base now reads patterns in lua + - Some minor changes for luatex * bbunicode.dtx 1.0b - Improvements by Elie Roux for LuaTeX. @@ -106,9 +109,12 @@ New 1.0e - \babelpatterns, which adds patterns to a language. - Use [[]] instead of \luaescapestring (the latter is not always available). -1.0f - Code for luatex assigned mistakenly to xetex +1.0f - Code for luatex assigned mistakenly to xetex. +1.1a - Revamped hyphenation loader for luatex. +1.1b - Now patterns are loaded with lua(e)tex (and a bug fixed). +1.1c - Patterns loader thorougly revised ------------ Javier Bezos -2016-01-08 +2016-02-24 diff --git a/Master/texmf-dist/doc/latex/babel/babel.pdf b/Master/texmf-dist/doc/latex/babel/babel.pdf Binary files differindex 208141d56d5..2579efe5c20 100644 --- a/Master/texmf-dist/doc/latex/babel/babel.pdf +++ b/Master/texmf-dist/doc/latex/babel/babel.pdf diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx index 4d8444ab9fe..612d5a9c08e 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %\iffalse % % Babel DOCUMENT-STYLE option for LaTeX version 2.09 or plain TeX; @@ -45,7 +45,7 @@ %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -196,8 +196,8 @@ \vspace{2cm}\hspace{1.5cm} \begin{minipage}{5cm} \Large -Version 3.9n\newline -2016/01/08 +Version 3.9q\newline +2016/02/24 \vspace{1cm} \textit{Original author}\newline @@ -1291,9 +1291,6 @@ Then you preprocess it with |devnag| \m{file}, which creates |"8000|) as a shorthand can make \TeX{} enter in an infinite loop in some rare cases. (Another issue in the `to do' list, although there is a partial solution.) -\item Plain \luatex{} does not load patterns on the fly. Since this - format is not based on \babel{} but on \file{etex.src} further - investigation is required. This is another task in the `to do' list. \end{itemize} The following packages can be useful, too (the list is still @@ -1313,6 +1310,7 @@ far from complete): some languages (kerning and spacing). Ligatures can be disabled. \item[substitutefont] Combines fonts in several encodings. \item[mkpattern] Generates hyphenation patterns. +\item[tracklang] Tracks which languages have been requested. \end{description} \subsection{Future work} @@ -1366,17 +1364,47 @@ Note you can set any feature required for the language -- not only |Language|, but also |Script| or a local |.fea|. This makes those macros a bit more verbose, but also more powerful. -\section{Preloading languages with \file{language.dat}} +\section{Loading languages with \file{language.dat}} \TeX{} and most engines based on it (pdf\TeX, \xetex, $\epsilon$-\TeX, the main exception being \luatex) require hyphenation patterns to be -loaded when a format is created (eg, \LaTeX, Xe\LaTeX, +preloaded when a format is created (eg, \LaTeX, Xe\LaTeX, pdf\LaTeX). \babel{} provides a tool which has become standand in many distributions and based on a ``configuration file'' named \file{language.dat}. The exact way this file is used depends on the distribution, so please, read the documentation for the latter (note also some distributions generate the file with some tool). +\New{3.9q} With \luatex, however, patterns are loaded on the fly when +requested by the language (except the ``0th'' language, typically +\textsf{english}, which is preloaded always).\footnote{This feature +was added to 3.9o, but it was buggy. Both 3.9o and 3.9p are +deprecated.} Until 3.9n, this task was delegated to the package +\textsf{luatex-hyphen}, by Khaled Hosny, \'Elie Roux, and Manuel +P\'egouri\'e-Gonnard, and required an extra file named +|language.dat.lua|, but now a new mechanism has been devised based +solely on |language.dat|. \textbf{You must rebuild the formats} if +upgrading from a previous version. You may want to have a local +|language.dat| for a particular project (for example, a book on +Chemistry).\footnote{The loader for lua(e)tex is slightly different as +it's not based on \babel{} but on \texttt{etex.src}. Until 3.9p it +just didn't work, but thanks to the new code it works by reloading the +data in the \babel{} way, i.e., with \texttt{language.dat}.} + +Unfortunately, the new model is intrinsically incompatible with the +previous one, which means you can experience some problems with +\textsf{polyglossia}. If using the latter, you must load the patterns +with \babel{} as shown in the following example: +\begin{verbatim} +\usepackage[base,french,dutch,spanish,english]{babel} +\usepackage{polyglossia} +\setmainlanguage{french} +\setotherlanguages{dutch,spanish,english} +\end{verbatim} +Be aware this is, very likely, a temporary solution. + +\subsection{Format} + In that file the person who maintains a \TeX\ environment has to record for which languages he has hyphenation patterns \emph{and} in which files these are stored\footnote{This is because different operating @@ -1622,7 +1650,7 @@ explained in in sec. \ref{s:strings} (\babel{} 3.9 and later). \begin{verbatim} \ProvidesLanguage{<language>} - [2016/01/08 v0.0 <Language> support from the babel system] + [2016/02/24 v0.0 <Language> support from the babel system] \LdfInit{<language>}{captions<language>} \ifx\undefined\l@<language> @@ -2405,8 +2433,8 @@ help from Bernd Raichle, for which I am grateful. % little bit of literate programming. % % \begin{macrocode} -%<<version=3.9n>> -%<<date=2016/01/08>> +%<<version=3.9q>> +%<<date=2016/02/24>> % \end{macrocode} % % We define some basic macros which just make the code cleaner. @@ -2436,9 +2464,9 @@ help from Bernd Raichle, for which I am grateful. %<</Basic macros>> % \end{macrocode} % -% Some files identify themselves with a \LaTeX{} macro. The following -% code is placed before them to define (and then undefine) if not in -% \LaTeX. +% Some files identify themselves with a \LaTeX{} macro. The following +% code is placed before them to define (and then undefine) if not in +% \LaTeX. % % \begin{macrocode} %<<*Make sure ProvidesFile is defined>> @@ -2450,9 +2478,9 @@ help from Bernd Raichle, for which I am grateful. %<</Make sure ProvidesFile is defined>> % \end{macrocode} % -% The following code is used in \file{babel.sty} and -% \file{babel.def}, and makes sure the current version of -% |switch.ldf| is used, if different from that in the format. +% The following code is used in \file{babel.sty} and \file{babel.def}, +% and makes sure the current version of |switch.ldf| is used, if +% different from that in the format. % % \begin{macrocode} %<<*Load switch if newer>> @@ -2463,6 +2491,19 @@ help from Bernd Raichle, for which I am grateful. %<</Load switch if newer>> % \end{macrocode} % +% The following code is also used in \file{babel.sty} and +% \file{babel.def}, and loads (only once) the data in |language.dat|. +% +% \begin{macrocode} +%<<*Load patterns in luatex>> +\ifx\directlua\@undefined\else + \ifx\bbl@luapatterns\@undefined + \input luababel.def + \fi +\fi +%<</Load patterns in luatex>> +% \end{macrocode} +% % The following code is used in \file{babel.def} and % \file{switch.def}. % @@ -2611,6 +2652,8 @@ help from Bernd Raichle, for which I am grateful. % December 1994} % \changes{babel~3.6k}{1999/03/18}{We need at least \LaTeX\ from % June 1998} +% \changes{babel~3.9q}{2016/02/11}{Load patterns with option base. +% To be improved. Moved showlanguages before base} % \begin{macrocode} %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] @@ -2618,12 +2661,46 @@ help from Bernd Raichle, for which I am grateful. \@ifpackagewith{babel}{debug} {\input switch.def\relax} {<@Load switch if newer@>} +<@Load patterns in luatex@> <@Basic macros@> \def\AfterBabelLanguage#1{% \global\expandafter\bbl@add\csname#1.ldf-h@@k\endcsname}% +% \end{macrocode} +% If the format created a list of loaded languages (in +% |\bbl@languages|), get the name of the 0-th to show the actual +% language used. +% \begin{macrocode} +\ifx\bbl@languages\@undefined\else + \begingroup + \catcode`\^^I=12 + \@ifpackagewith{babel}{showlanguages}{% + \begingroup + \def\bbl@elt#1#2#3#4{\wlog{#2^^I#1^^I#3^^I#4}}% + \wlog{<*languages>}% + \bbl@languages + \wlog{</languages>}% + \endgroup}{} + \endgroup + \def\bbl@elt#1#2#3#4{% + \ifnum#2=\z@ + \gdef\bbl@nulllanguage{#1}% + \def\bbl@elt##1##2##3##4{}% + \fi}% + \bbl@languages +\fi +% \end{macrocode} +% Now the \texttt{base} option. With it we can define (and load, with +% \luatex) hyphenation patterns, even if we are not interesed in the +% rest of babel. Useful for \textsf{polyglossia}, too. +% \begin{macrocode} \@ifpackagewith{babel}{base}{% - \DeclareOption*{\bbl@patterns{\CurrentOption}}% + \ifx\directlua\@undefined + \DeclareOption*{\bbl@patterns{\CurrentOption}}% + \else + \DeclareOption*{\bbl@patterns@lua{\CurrentOption}}% + \fi \DeclareOption{base}{}% + \DeclareOption{showlanguages}{}% \ProcessOptions \global\expandafter\let\csname opt@babel.sty\endcsname\relax \global\expandafter\let\csname ver@babel.sty\endcsname\relax @@ -2819,29 +2896,6 @@ help from Bernd Raichle, for which I am grateful. \bbl@opt@main} \fi % \end{macrocode} -% If the format created a list of loaded languages (in -% |\bbl@languages|), get the name of the 0-th to show the actual -% language used. -% \begin{macrocode} -\ifx\bbl@languages\@undefined\else - \begingroup - \catcode`\^^I=12 - \@ifpackagewith{babel}{showlanguages}{% - \begingroup - \def\bbl@elt#1#2#3#4{\wlog{#2^^I#1^^I#3^^I#4}}% - \wlog{<*languages>}% - \bbl@languages - \wlog{</languages>}% - \endgroup}{} - \endgroup - \def\bbl@elt#1#2#3#4{% - \ifnum#2=\z@ - \gdef\bbl@nulllanguage{#1}% - \def\bbl@elt##1##2##3##4{}% - \fi}% - \bbl@languages -\fi -% \end{macrocode} % % \subsection{Language options} % @@ -3165,6 +3219,8 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9k}{2014/03/24}{Added definition for % \cs{uselanguage}} % \changes{babel~3.9n}{2015/12/21}{Define a few macros for 2.09} +% \changes{babel~3.9p}{2016/02/05}{Added a test for lua(e)tex.} +% \changes{babel~3.9q}{2016/02/12}{Load lua patterns if not lualatex.} % % \begin{macrocode} %<*core> @@ -3180,24 +3236,27 @@ help from Bernd Raichle, for which I am grateful. \fi <@Load switch if newer@> \ifx\bbl@languages\@undefined - \openin1 = language.def - \ifeof1 - \closein1 - \message{I couldn't find the file language.def} - \else - \closein1 - \begingroup - \def\addlanguage#1#2#3#4#5{% - \expandafter\ifx\csname lang@#1\endcsname\relax\else - \global\expandafter\let\csname l@#1\expandafter\endcsname - \csname lang@#1\endcsname - \fi}% - \def\uselanguage#1{}% - \input language.def - \endgroup + \ifx\directlua\@undefined + \openin1 = language.def + \ifeof1 + \closein1 + \message{I couldn't find the file language.def} + \else + \closein1 + \begingroup + \def\addlanguage#1#2#3#4#5{% + \expandafter\ifx\csname lang@#1\endcsname\relax\else + \global\expandafter\let\csname l@#1\expandafter\endcsname + \csname lang@#1\endcsname + \fi}% + \def\uselanguage#1{}% + \input language.def + \endgroup + \fi \fi \chardef\l@english\z@ \fi +<@Load patterns in luatex@> <@Basic macros@> \def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% \chardef\bbl@engine=% @@ -6625,11 +6684,17 @@ help from Bernd Raichle, for which I am grateful. % \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.} +% \cs{latinencoding} to EUx, but now it doesn't. So, it's done +% here.} +% \changes{babel~3.9o}{2016/01/27}{With fontspec, first check if +% \cs{UTFencname} exists.} % \begin{macrocode} \AtBeginDocument{% \@ifpackageloaded{fontspec}% - {\xdef\latinencoding{EU\ifcase\bbl@engine\or2\or1\fi}}% + {\xdef\latinencoding{% + \@ifundefined{UTFencname}% + {EU\ifcase\bbl@engine\or2\or1\fi}% + {\UTFencname}}}% {\gdef\latinencoding{OT1}% \ifx\cf@encoding\bbl@t@one \xdef\latinencoding{\bbl@t@one}% @@ -8270,11 +8335,14 @@ help from Bernd Raichle, for which I am grateful. % \changes{babel~3.9g}{2013/07/28}{In non-LaTeX formats the number of % languages were not printed. Moved from \cs{dump} and cleaned up: % now \cs{toks}8 is expanded here.} +% \changes{babel~3.9o}{2016/01/25}{The number of languages loaded was +% off by 1.} % \begin{macrocode} \if/\the\toks@/\else \errhelp{language.dat loads no language, only synonyms} \errmessage{Orphan language synonym} \fi +\advance\last@language\@ne \edef\bbl@tempa{% \everyjob{% \the\everyjob @@ -8283,7 +8351,8 @@ help from Bernd Raichle, for which I am grateful. \else \noexpand\typeout \fi - {\the\toks8 \the\last@language\space languages loaded.}}} + {\the\toks8 \the\last@language\space language(s) loaded.}}} +\advance\last@language\m@ne \bbl@tempa % \end{macrocode} % Also remove some macros from memory and raise an error @@ -8759,7 +8828,7 @@ help from Bernd Raichle, for which I am grateful. \fi \def\@testopt#1#2{% \@ifnextchar[{#1}{#1[#2]}} -\def\@protected@testopt#1{%% +\def\@protected@testopt#1{% \ifx\protect\@typeset@protect \expandafter\@testopt \else diff --git a/Master/texmf-dist/source/latex/babel/babel.ins b/Master/texmf-dist/source/latex/babel/babel.ins index ad476a6fa26..4028b50ff77 100644 --- a/Master/texmf-dist/source/latex/babel/babel.ins +++ b/Master/texmf-dist/source/latex/babel/babel.ins @@ -22,10 +22,6 @@ %% %% The Current Maintainer of this work is Javier Bezos. %% -%% The list of all files belonging to the LaTeX base distribution is -%% given in the file `manifest.bbl. See also `legal.bbl' for additional -%% information. -%% %% 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. @@ -37,12 +33,8 @@ %% %% This file is part of the `babel' system. %% -%% You are allowed to distribute this file together with all files -%% mentioned in manifest.bbl. -%% -%% You are not allowed to modify its contents. %% -\def\filedate{2014/03/24} +\def\filedate{2016/02/05} \def\batchfile{babel.ins} \input docstrip.tex @@ -62,16 +54,15 @@ \fi} % Modify docstrip. A pseudo-guard is defined to set variables: -% <<name=value>>. These variables are used with <@name@> -% Two further pseudo-guards define "block" variables: <<*name>> and -% <</name>> delimite the lines to be retrived with <@name@>. Note -% the verbatim guard is overriden, which it's not used here. -% It's done in two passes: 1) with saving true, blocks are always -% read and saved; 2) with saving false, blocks are always ignored, -% but replacing <@name@>. -% While <@name@> can be used freely outside <<>>, it is only -% allowed inside <<>> if previouly defined. Deeper nesting is -% not allowed. +% <<name=value>>. These variables are used with <@name@> Two further +% pseudo-guards define "block" variables: <<*name>> and <</name>> +% delimite the lines to be retrived with <@name@>. Note the verbatim +% guard is overridden, but it's not used here. This is done in two +% passes: 1) with saving true, there is a dummy pass, generating +% nothing, but blocks are read and saved; 2) with saving false, blocks +% are always ignored, but replacing <@name@>. While <@name@> can be +% used freely outside <<>>, it's only allowed inside <<>> if +% previously defined. Deeper nesting is not allowed. \def\replaceVar#1<@#2{% #1% @@ -191,8 +182,6 @@ This file is a style file for the MakeIndex program \usedir{tex/generic/babel} -\askforoverwritefalse - \usepreamble\mainpreamble % Dummy, it just read "modules" to be used when generating @@ -228,7 +217,6 @@ This file is a style file for the MakeIndex program } % compatibility files - \def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{#1}}} \generate{% diff --git a/Master/texmf-dist/source/latex/babel/bbunicode.dtx b/Master/texmf-dist/source/latex/babel/bbunicode.dtx index 02265c3108e..f41054716d4 100644 --- a/Master/texmf-dist/source/latex/babel/bbunicode.dtx +++ b/Master/texmf-dist/source/latex/babel/bbunicode.dtx @@ -31,12 +31,12 @@ % \iffalse %<*dtx> \ProvidesFile{bbunicode.dtx} - [2016/01/05 v1.0f Babel hooks for Unicode engines] + [2016/02/24 v1.1c Babel hooks for Unicode engines] %</dtx> % %% File `bbunicode.dtx' %% Babel package for LaTeX version 2e -%% Copyright (C) 2103-2014 +%% Copyright (C) 2103-2016 %% by Javier Bezos % %<*filedriver> @@ -166,7 +166,7 @@ \ifx\bbl@tempa\@empty \XeTeXinputencoding"bytes"% \else - \XeTeXinputencoding"#1"% + \XeTeXinputencoding"#1"% \fi \def\xebbl@stop{\XeTeXinputencoding"utf8"}} \AddBabelHook{xetex}{stopcommands}{% @@ -177,32 +177,215 @@ <@Font selection@> %</xetex> % \end{macrocode} -% \subsection{LuaTeX} % -% This part relies on the |lua| stripts in \pkg{luatex-hyphen} by Khaled -% Hosny, \'{E}lie Roux, and Manuel -% P\'{e}gouri\'{e}-Gonnard. \'{E}lie also improved the code below. -% \changes{bbunicode~1.0b}{2013/04/22}{luatex-hyphen is loaded -% with require. Changes supplied by \'{E}lie Roux.} +% \subsection{LuaTeX} +% +% The new loader for luatex is based solely on |language.dat|, which +% is read on the fly. The code shouldn't be executed when the format +% is build, so we check if |\AddBabelHook| is defined. Then comes a +% modified version of the loader in |hyphen.cfg| (without the +% hyphenmins stuff, which is under the direct control of \babel). +% +% The names |\l@<language>| are defined and take some value from the +% beginning because all \texttt{ldf} files assume this for the +% corresponding language to be considered valid, but patterns are not +% loaded (except the first one). This is done later, when the language +% is first selected (which usually means when the \texttt{ldf} +% finishes). If a language has been loaded, |\bbl@hyphendata@<num>| +% exists (with the names of the files read). +% +% The default setup preloads the first language into the format. This +% is intended mainly for `english', so that it's available without +% further intervention from the user. To avoid duplicating it, the +% following rule applies: if the ``0th'' language and the first +% language in |language.dat| have the same name then just ignore the +% latter. If there are new synonymous, the are added, but note if the +% language patterns have not been preloaded they won't at run time. +% +% Other preloaded languages could be read twice, if they has been +% preloaded into the format. This is not optimal, but it shouldn't +% happen very often -- with \luatex{} patterns are best loaded when +% the document is typeset, and the ``0th'' language is preloaded just +% for backwards compatibility. +% +% As of 1.1b, lua(e)tex is taken into account. Formerly, loading of +% patterns on the fly didn't work in this format, but with the new +% loader it does. Unfortunately, the format is not based on \babel, +% and data could be duplicated, because languages are reassigned above +% those in the format (nothing serious, anyway). Note even with this +% format |language.dat| is used (under the principle of a single +% source), instead of |language.def|. +% +% Of course, there is room for improvements, like tools to read and +% reassign languages, which would require modifying the language list, +% and better error handling. +% +% We need catcode tables, but no format (targeted by \babel) provide a +% command to allocate them (although there are packages like +% \textsf{ctablestack}). For the moment, a dangerous approach is used +% -- just allocate a high random number and cross the fingers. To +% complicate things, \textsf{etex.sty} changes the way languages are +% allocated. +% +% \changes{bbunicode~1.0b}{2013/04/22}{luatex-hyphen is loaded with +% require. Changes supplied by \'{E}lie Roux.} % \changes{bbunicode~1.0c}{2014/03/10}{Defined hook for % `initiateactive', to fetch the next token and continue only if -% letter or other} +% letter or other.} % \changes{bbunicode~1.0d}{2014/03/21}{Removed the `misfeature' for -% `initiateactive'} +% `initiateactive'.} % \changes{bbunicode~1.0e}{2015/05/10}{Use brackets instead of -% \cs{luaescapestring}} -% \changes{bbunicode~1.0e}{2015/07/26}{Added function addpatterns and -% modified the patterns hook.} +% \cs{luaescapestring}.} +% \changes{bbunicode~1.0e}{2015/07/26}{Added function addpattern +% and modified the patterns hook.} +% \changes{bbunicode~1.1a}{2016/01/26}{New hyphenation loader for +% luatex.} +% \changes{bbunicode~1.1b}{2016/02/05}{Also lua(e)tex.} +% \changes{bbunicode~1.1c}{2016/02/08}{Base reading of patterns on +% number, not in name.} +% \changes{bbunicode~1.1c}{2016/02/08}{Some hacks for polyglossia. To +% be improved.} +% \changes{bbunicode~1.1c}{2016/02/23}{Thoroughly revised.} % % \begin{macrocode} %<*luatex> +\ifx\AddBabelHook\@undefined +\begingroup + \toks@{} + \count@\z@ % 0=start, 1=0th, 2=normal + \def\bbl@process@line#1#2 #3 #4 {% + \ifx=#1% + \bbl@process@synonym{#2}% + \else + \bbl@process@language{#1#2}{#3}{#4}% + \fi + \ignorespaces} + \def\bbl@manylang{% + \ifnum\bbl@last>\@ne + \bbl@info{Non-standard hyphenation setup}% + \fi + \let\bbl@manylang\relax} + \def\bbl@process@language#1#2#3{% + \ifcase\count@ + \@ifundefined{zth@#1}{\count@\tw@}{\count@\@ne}% + \or + \count@\tw@ + \fi + \ifnum\count@=\tw@ + \expandafter\addlanguage\csname l@#1\endcsname + \language\allocationnumber + \chardef\bbl@last\allocationnumber + \bbl@manylang + \let\bbl@elt\relax + \xdef\bbl@languages{% + \bbl@languages\bbl@elt{#1}{\the\language}{#2}{#3}}% + \fi + \the\toks@ + \toks@{}} + \def\bbl@process@synonym@aux#1#2{% + \global\expandafter\chardef\csname l@#1\endcsname#2\relax + \let\bbl@elt\relax + \xdef\bbl@languages{% + \bbl@languages\bbl@elt{#1}{#2}{}{}}}% + \def\bbl@process@synonym#1{% + \ifcase\count@ + \toks@\expandafter{\the\toks@\relax\bbl@process@synonym{#1}}% + \or + \@ifundefined{zth@#1}{\bbl@process@synonym@aux{#1}{0}}{}% + \else + \bbl@process@synonym@aux{#1}{\the\bbl@last}% + \fi} + \ifx\bbl@languages\@undefined % Just a (sensible?) guess + \chardef\l@english\z@ + \chardef\l@USenglish\z@ + \chardef\bbl@last\z@ + \global\@namedef{bbl@hyphendata@0}{{hyphen.tex}{}} + \gdef\bbl@languages{% + \bbl@elt{english}{0}{hyphen.tex}{}% + \bbl@elt{USenglish}{0}{}{}} + \else + \global\let\bbl@languages@format\bbl@languages + \def\bbl@elt#1#2#3#4{% Remove all except language 0 + \ifnum#2>\z@\else + \noexpand\bbl@elt{#1}{#2}{#3}{#4}% + \fi}% + \xdef\bbl@languages{\bbl@languages}% + \fi + \def\bbl@elt#1#2#3#4{\@namedef{zth@#1}{}} % Define flags + \bbl@languages + \openin1=language.dat + \ifeof1 + \bbl@warning{I couldn't find language.dat. No additional\\% + patterns loaded. Reported}% + \else + \loop + \endlinechar\m@ne + \read1 to \bbl@line + \endlinechar`\^^M + \if T\ifeof1F\fi T\relax + \ifx\bbl@line\@empty\else + \edef\bbl@line{\bbl@line\space\space\space}% + \expandafter\bbl@process@line\bbl@line\relax + \fi + \repeat + \fi +\endgroup +\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}} +\def\bbl@luapatterns#1#2{% + \bbl@get@enc#1::\@@@ + \begingroup + \ifx\catcodetable\@undefined + \let\savecatcodetable\luatexsavecatcodetable + \let\initcatcodetable\luatexinitcatcodetable + \let\catcodetable\luatexcatcodetable + \fi + \savecatcodetable5211 + \initcatcodetable5212 + \catcodetable5212 + \catcode`\#=6 \catcode`\$=3 \catcode`\&=4 \catcode`\^=7 + \catcode`\_=8 \catcode`\{=1 \catcode`\}=2 \catcode`\~=13 + \catcode`\@=11 \catcode`\^^I=10 \catcode`\^^J=12 + \catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\.=12 + \catcode`\-=12 \catcode`\/=12 \catcode`\[=12 \catcode`\]=12 + \catcode`\`=12 \catcode`\'=12 \catcode`\"=12 + \input #1\relax + \catcodetable5211 + \endgroup + \def\bbl@tempa{#2}% + \ifx\bbl@tempa\@empty\else + \input #2\relax + \fi}% +\def\bbl@patterns@lua#1{% + \language=\expandafter\ifx\csname l@#1:\f@encoding\endcsname\relax + \csname l@#1\endcsname + \edef\bbl@tempa{#1}% + \else + \csname l@#1:\f@encoding\endcsname + \edef\bbl@tempa{#1:\f@encoding}% + \fi\relax + \@namedef{lu@texhyphen@loaded@\the\language}{}% Temp + \@ifundefined{bbl@hyphendata@\the\language}% + {\def\bbl@elt##1##2##3##4{% + \ifnum##2=\csname l@\bbl@tempa\endcsname % #2=spanish, dutch:OT1... + \def\bbl@tempb{##3}% + \ifx\bbl@tempb\@empty\else % if not a synonymous + \def\bbl@tempc{{##3}{##4}}% + \fi + \bbl@csarg\edef{hyphendata@##2}{\bbl@tempc}% + \fi}% + \bbl@languages + \@ifundefined{bbl@hyphendata@\the\language}% + {\bbl@info{No hyphenation patterns were set for\\% + language ‘\bbl@tempa’. Reported}}% + {\expandafter\expandafter\expandafter\bbl@luapatterns + \csname bbl@hyphendata@\the\language\endcsname}}{}} +\endinput\fi \begingroup \catcode`\%=12 \catcode`\'=12 \catcode`\"=12 \catcode`\:=12 \directlua{ - require("luatex-hyphen") Babel = {} function Babel.bytes(line) return line:gsub("(.)", @@ -264,12 +447,21 @@ \luabbl@stop \let\luabbl@stop\relax} \AddBabelHook{luatex}{patterns}{% - \ifcsname lu@texhyphen@loaded@\the\language\endcsname \else - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \directlua{ - luatexhyphen.loadlanguage([[\string#1]], - '\the\language')}% - \fi + \@ifundefined{bbl@hyphendata@\the\language}% + {\def\bbl@elt##1##2##3##4{% + \ifnum##2=\csname l@#2\endcsname % #2=spanish, dutch:OT1... + \def\bbl@tempb{##3}% + \ifx\bbl@tempb\@empty\else % if not a synonymous + \def\bbl@tempc{{##3}{##4}}% + \fi + \bbl@csarg\edef{hyphendata@##2}{\bbl@tempc}% + \fi}% + \bbl@languages + \@ifundefined{bbl@hyphendata@\the\language}% + {\bbl@info{No hyphenation patterns were set for\\% + language ‘#2’. Reported}}% + {\expandafter\expandafter\expandafter\bbl@luapatterns + \csname bbl@hyphendata@\the\language\endcsname}}{}% \@ifundefined{bbl@patterns@}{}{% \begingroup \@expandtwoargs\in@{,\number\language,}{,\bbl@pttnlist}% @@ -286,35 +478,25 @@ \xdef\bbl@pttnlist{\bbl@pttnlist\number\language,}% \fi \endgroup}} -\AddBabelHook{luatex}{adddialect}{% - \ifx\directlua\relax\else - \directlua{ - luatexhyphen.adddialect([[\string#1]], - [[\string#2]]) - }% - \fi} \AddBabelHook{luatex}{everylanguage}{% - \directlua{ - processnow = (tex.language == 0) or - (luatexhyphen.lookupname([[\string#1]]) == nil)}% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \fi} + \def\process@language##1##2##3{% + \def\process@line####1####2 ####3 ####4 {}}} \AddBabelHook{luatex}{loadpatterns}{% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \input #1\relax - \fi} + \input #1\relax + \expandafter\gdef\csname bbl@hyphendata@\the\language\endcsname + {{#1}{}}} \AddBabelHook{luatex}{loadexceptions}{% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \input #1\relax - \fi - \directlua{processnow = nil}} + \input #1\relax + \def\bbl@tempb##1##2{{##1}{#1}}% + \expandafter\xdef\csname bbl@hyphendata@\the\language\endcsname + {\expandafter\expandafter\expandafter\bbl@tempb + \csname bbl@hyphendata@\the\language\endcsname}} % \end{macrocode} % % \begin{macro}{\babelpatterns} % % This macro adds patterns. Two macros are used to store them: -% |\bbl@patterns@| for the global ones and |\bbl@patterns<lang>| +% |\bbl@patterns@| for the global ones and |\bbl@patterns@<lang>| % for language ones. We make sure there is a space between words % when multiple commands are used. % \changes{bbunicode~1.0e}{2015/07/26}{Macro \cs{babelpatterns} added} diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 2841b87e0aa..9af228d1ae3 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -56,7 +56,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2016/01/08 3.9n Babel common definitions] +\ProvidesFile{babel.def}[2016/02/24 3.9q Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -67,29 +67,36 @@ \let\bbl@afterlang\relax \let\bbl@language@opts\@empty \fi -\def\bbl@tempa{3.9n}% +\def\bbl@tempa{3.9q}% \ifx\bbl@version\bbl@tempa\else \input switch.def\relax \fi \ifx\bbl@languages\@undefined - \openin1 = language.def - \ifeof1 - \closein1 - \message{I couldn't find the file language.def} - \else - \closein1 - \begingroup - \def\addlanguage#1#2#3#4#5{% - \expandafter\ifx\csname lang@#1\endcsname\relax\else - \global\expandafter\let\csname l@#1\expandafter\endcsname - \csname lang@#1\endcsname - \fi}% - \def\uselanguage#1{}% - \input language.def - \endgroup + \ifx\directlua\@undefined + \openin1 = language.def + \ifeof1 + \closein1 + \message{I couldn't find the file language.def} + \else + \closein1 + \begingroup +\def\addlanguage#1#2#3#4#5{% + \expandafter\ifx\csname lang@#1\endcsname\relax\else + \global\expandafter\let\csname l@#1\expandafter\endcsname + \csname lang@#1\endcsname + \fi}% +\def\uselanguage#1{}% +\input language.def + \endgroup + \fi \fi \chardef\l@english\z@ \fi +\ifx\directlua\@undefined\else + \ifx\bbl@luapatterns\@undefined + \input luababel.def + \fi +\fi \def\bbl@add#1#2{% \@ifundefined{\expandafter\@gobble\string#1}% {\def#1{#2}}% @@ -1422,7 +1429,10 @@ \AtEndOfPackage{\edef\latinencoding{\cf@encoding}} \AtBeginDocument{% \@ifpackageloaded{fontspec}% - {\xdef\latinencoding{EU\ifcase\bbl@engine\or2\or1\fi}}% + {\xdef\latinencoding{% + \@ifundefined{UTFencname}% + {EU\ifcase\bbl@engine\or2\or1\fi}% + {\UTFencname}}}% {\gdef\latinencoding{OT1}% \ifx\cf@encoding\bbl@t@one \xdef\latinencoding{\bbl@t@one}% diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index 56092628c2a..f9f6eeadf4b 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -38,23 +38,28 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2016/01/08 3.9n The Babel package] +\ProvidesPackage{babel}[2016/02/24 3.9q The Babel package] \@ifpackagewith{babel}{debug} {\input switch.def\relax} - {\def\bbl@tempa{3.9n}% + {\def\bbl@tempa{3.9q}% \ifx\bbl@version\bbl@tempa\else \input switch.def\relax \fi} +\ifx\directlua\@undefined\else + \ifx\bbl@luapatterns\@undefined + \input luababel.def + \fi +\fi \def\bbl@add#1#2{% \@ifundefined{\expandafter\@gobble\string#1}% {\def#1{#2}}% @@ -71,9 +76,32 @@ \def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}} \def\AfterBabelLanguage#1{% \global\expandafter\bbl@add\csname#1.ldf-h@@k\endcsname}% +\ifx\bbl@languages\@undefined\else + \begingroup + \catcode`\^^I=12 + \@ifpackagewith{babel}{showlanguages}{% + \begingroup + \def\bbl@elt#1#2#3#4{\wlog{#2^^I#1^^I#3^^I#4}}% + \wlog{<*languages>}% + \bbl@languages + \wlog{</languages>}% + \endgroup}{} + \endgroup + \def\bbl@elt#1#2#3#4{% + \ifnum#2=\z@ + \gdef\bbl@nulllanguage{#1}% + \def\bbl@elt##1##2##3##4{}% + \fi}% + \bbl@languages +\fi \@ifpackagewith{babel}{base}{% - \DeclareOption*{\bbl@patterns{\CurrentOption}}% + \ifx\directlua\@undefined + \DeclareOption*{\bbl@patterns{\CurrentOption}}% + \else + \DeclareOption*{\bbl@patterns@lua{\CurrentOption}}% + \fi \DeclareOption{base}{}% + \DeclareOption{showlanguages}{}% \ProcessOptions \global\expandafter\let\csname opt@babel.sty\endcsname\relax \global\expandafter\let\csname ver@babel.sty\endcsname\relax @@ -185,24 +213,6 @@ \ifx\bbl@language@opts\@empty\else\bbl@language@opts,\fi \bbl@opt@main} \fi -\ifx\bbl@languages\@undefined\else - \begingroup - \catcode`\^^I=12 - \@ifpackagewith{babel}{showlanguages}{% - \begingroup - \def\bbl@elt#1#2#3#4{\wlog{#2^^I#1^^I#3^^I#4}}% - \wlog{<*languages>}% - \bbl@languages - \wlog{</languages>}% - \endgroup}{} - \endgroup - \def\bbl@elt#1#2#3#4{% - \ifnum#2=\z@ - \gdef\bbl@nulllanguage{#1}% - \def\bbl@elt##1##2##3##4{}% - \fi}% - \bbl@languages -\fi \let\bbl@afterlang\relax \let\BabelModifiers\relax \let\bbl@loaded\@empty diff --git a/Master/texmf-dist/tex/generic/babel/blplain.tex b/Master/texmf-dist/tex/generic/babel/blplain.tex index 7e5c1506863..7f5aa952238 100644 --- a/Master/texmf-dist/tex/generic/babel/blplain.tex +++ b/Master/texmf-dist/tex/generic/babel/blplain.tex @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/bplain.tex b/Master/texmf-dist/tex/generic/babel/bplain.tex index e36555f07ef..8d26ee4d88d 100644 --- a/Master/texmf-dist/tex/generic/babel/bplain.tex +++ b/Master/texmf-dist/tex/generic/babel/bplain.tex @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 3b11277b823..df1715a099a 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -52,7 +52,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2016/01/08 3.9n Babel hyphens] +\ProvidesFile{hyphen.cfg}[2016/02/24 3.9q Babel hyphens] \xdef\bbl@format{\jobname} \ifx\AtBeginDocument\@undefined \def\@empty{} @@ -83,7 +83,7 @@ \countdef\last@language=19 \def\addlanguage{\alloc@9\language\chardef\@cclvi} \fi -\toks8{Babel <3.9n> and hyphenation patterns for }% +\toks8{Babel <3.9q> and hyphenation patterns for }% \def\process@line#1#2 #3 #4 {% \ifx=#1% \process@synonym{#2}% @@ -196,6 +196,7 @@ \errhelp{language.dat loads no language, only synonyms} \errmessage{Orphan language synonym} \fi +\advance\last@language\@ne \edef\bbl@tempa{% \everyjob{% \the\everyjob @@ -204,7 +205,8 @@ \else \noexpand\typeout \fi - {\the\toks8 \the\last@language\space languages loaded.}}} + {\the\toks8 \the\last@language\space language(s) loaded.}}} +\advance\last@language\m@ne \bbl@tempa \let\bbl@line\@undefined \let\process@line\@undefined diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 3a3519c1989..173c8c2bbaf 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -39,15 +39,145 @@ %% extension .ins) which are part of the distribution. %% File `bbunicode.dtx' %% Babel package for LaTeX version 2e -%% Copyright (C) 2103-2014 +%% Copyright (C) 2103-2016 %% by Javier Bezos +\ifx\AddBabelHook\@undefined +\begingroup + \toks@{} + \count@\z@ % 0=start, 1=0th, 2=normal + \def\bbl@process@line#1#2 #3 #4 {% + \ifx=#1% + \bbl@process@synonym{#2}% + \else + \bbl@process@language{#1#2}{#3}{#4}% + \fi + \ignorespaces} + \def\bbl@manylang{% + \ifnum\bbl@last>\@ne + \bbl@info{Non-standard hyphenation setup}% + \fi + \let\bbl@manylang\relax} + \def\bbl@process@language#1#2#3{% + \ifcase\count@ + \@ifundefined{zth@#1}{\count@\tw@}{\count@\@ne}% + \or + \count@\tw@ + \fi + \ifnum\count@=\tw@ + \expandafter\addlanguage\csname l@#1\endcsname + \language\allocationnumber + \chardef\bbl@last\allocationnumber + \bbl@manylang + \let\bbl@elt\relax + \xdef\bbl@languages{% + \bbl@languages\bbl@elt{#1}{\the\language}{#2}{#3}}% + \fi + \the\toks@ + \toks@{}} + \def\bbl@process@synonym@aux#1#2{% + \global\expandafter\chardef\csname l@#1\endcsname#2\relax + \let\bbl@elt\relax + \xdef\bbl@languages{% + \bbl@languages\bbl@elt{#1}{#2}{}{}}}% + \def\bbl@process@synonym#1{% + \ifcase\count@ + \toks@\expandafter{\the\toks@\relax\bbl@process@synonym{#1}}% + \or + \@ifundefined{zth@#1}{\bbl@process@synonym@aux{#1}{0}}{}% + \else + \bbl@process@synonym@aux{#1}{\the\bbl@last}% + \fi} + \ifx\bbl@languages\@undefined % Just a (sensible?) guess + \chardef\l@english\z@ + \chardef\l@USenglish\z@ + \chardef\bbl@last\z@ + \global\@namedef{bbl@hyphendata@0}{{hyphen.tex}{}} + \gdef\bbl@languages{% + \bbl@elt{english}{0}{hyphen.tex}{}% + \bbl@elt{USenglish}{0}{}{}} + \else + \global\let\bbl@languages@format\bbl@languages + \def\bbl@elt#1#2#3#4{% Remove all except language 0 + \ifnum#2>\z@\else + \noexpand\bbl@elt{#1}{#2}{#3}{#4}% + \fi}% + \xdef\bbl@languages{\bbl@languages}% + \fi + \def\bbl@elt#1#2#3#4{\@namedef{zth@#1}{}} % Define flags + \bbl@languages + \openin1=language.dat + \ifeof1 + \bbl@warning{I couldn't find language.dat. No additional\\% + patterns loaded. Reported}% + \else + \loop + \endlinechar\m@ne + \read1 to \bbl@line + \endlinechar`\^^M + \if T\ifeof1F\fi T\relax + \ifx\bbl@line\@empty\else + \edef\bbl@line{\bbl@line\space\space\space}% + \expandafter\bbl@process@line\bbl@line\relax + \fi + \repeat + \fi +\endgroup +\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}} +\def\bbl@luapatterns#1#2{% + \bbl@get@enc#1::\@@@ + \begingroup + \ifx\catcodetable\@undefined + \let\savecatcodetable\luatexsavecatcodetable + \let\initcatcodetable\luatexinitcatcodetable + \let\catcodetable\luatexcatcodetable + \fi + \savecatcodetable5211 + \initcatcodetable5212 + \catcodetable5212 + \catcode`\#=6 \catcode`\$=3 \catcode`\&=4 \catcode`\^=7 + \catcode`\_=8 \catcode`\{=1 \catcode`\}=2 \catcode`\~=13 + \catcode`\@=11 \catcode`\^^I=10 \catcode`\^^J=12 + \catcode`\<=12 \catcode`\>=12 \catcode`\*=12 \catcode`\.=12 + \catcode`\-=12 \catcode`\/=12 \catcode`\[=12 \catcode`\]=12 + \catcode`\`=12 \catcode`\'=12 \catcode`\"=12 + \input #1\relax + \catcodetable5211 + \endgroup + \def\bbl@tempa{#2}% + \ifx\bbl@tempa\@empty\else + \input #2\relax + \fi}% +\def\bbl@patterns@lua#1{% + \language=\expandafter\ifx\csname l@#1:\f@encoding\endcsname\relax + \csname l@#1\endcsname + \edef\bbl@tempa{#1}% + \else + \csname l@#1:\f@encoding\endcsname + \edef\bbl@tempa{#1:\f@encoding}% + \fi\relax + \@namedef{lu@texhyphen@loaded@\the\language}{}% Temp + \@ifundefined{bbl@hyphendata@\the\language}% + {\def\bbl@elt##1##2##3##4{% + \ifnum##2=\csname l@\bbl@tempa\endcsname % #2=spanish, dutch:OT1... + \def\bbl@tempb{##3}% + \ifx\bbl@tempb\@empty\else % if not a synonymous + \def\bbl@tempc{{##3}{##4}}% + \fi + \bbl@csarg\edef{hyphendata@##2}{\bbl@tempc}% + \fi}% + \bbl@languages + \@ifundefined{bbl@hyphendata@\the\language}% + {\bbl@info{No hyphenation patterns were set for\\% + language ‘\bbl@tempa’. Reported}}% + {\expandafter\expandafter\expandafter\bbl@luapatterns + \csname bbl@hyphendata@\the\language\endcsname}}{}} +\endinput\fi \begingroup \catcode`\%=12 \catcode`\'=12 \catcode`\"=12 \catcode`\:=12 \directlua{ - require("luatex-hyphen") Babel = {} function Babel.bytes(line) return line:gsub("(.)", @@ -109,12 +239,21 @@ \luabbl@stop \let\luabbl@stop\relax} \AddBabelHook{luatex}{patterns}{% - \ifcsname lu@texhyphen@loaded@\the\language\endcsname \else - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \directlua{ - luatexhyphen.loadlanguage([[\string#1]], - '\the\language')}% - \fi + \@ifundefined{bbl@hyphendata@\the\language}% + {\def\bbl@elt##1##2##3##4{% + \ifnum##2=\csname l@#2\endcsname % #2=spanish, dutch:OT1... + \def\bbl@tempb{##3}% + \ifx\bbl@tempb\@empty\else % if not a synonymous + \def\bbl@tempc{{##3}{##4}}% + \fi + \bbl@csarg\edef{hyphendata@##2}{\bbl@tempc}% + \fi}% + \bbl@languages + \@ifundefined{bbl@hyphendata@\the\language}% + {\bbl@info{No hyphenation patterns were set for\\% + language ‘#2’. Reported}}% + {\expandafter\expandafter\expandafter\bbl@luapatterns + \csname bbl@hyphendata@\the\language\endcsname}}{}% \@ifundefined{bbl@patterns@}{}{% \begingroup \@expandtwoargs\in@{,\number\language,}{,\bbl@pttnlist}% @@ -131,29 +270,19 @@ \xdef\bbl@pttnlist{\bbl@pttnlist\number\language,}% \fi \endgroup}} -\AddBabelHook{luatex}{adddialect}{% - \ifx\directlua\relax\else - \directlua{ - luatexhyphen.adddialect([[\string#1]], - [[\string#2]]) - }% - \fi} \AddBabelHook{luatex}{everylanguage}{% - \directlua{ - processnow = (tex.language == 0) or - (luatexhyphen.lookupname([[\string#1]]) == nil)}% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \global\@namedef{lu@texhyphen@loaded@\the\language}{}% - \fi} + \def\process@language##1##2##3{% + \def\process@line####1####2 ####3 ####4 {}}} \AddBabelHook{luatex}{loadpatterns}{% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \input #1\relax - \fi} + \input #1\relax + \expandafter\gdef\csname bbl@hyphendata@\the\language\endcsname + {{#1}{}}} \AddBabelHook{luatex}{loadexceptions}{% - \ifnum0=\directlua{tex.sprint(processnow and "0" or "1")}\relax - \input #1\relax - \fi - \directlua{processnow = nil}} + \input #1\relax + \def\bbl@tempb##1##2{{##1}{#1}}% + \expandafter\xdef\csname bbl@hyphendata@\the\language\endcsname + {\expandafter\expandafter\expandafter\bbl@tempb + \csname bbl@hyphendata@\the\language\endcsname}} \@onlypreamble\babelpatterns \AtEndOfPackage{% \newcommand\babelpatterns[2][\@empty]{% diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index cf3bd82b178..0f0ea0fa20f 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -38,16 +38,16 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. -\ProvidesLanguage{nil}[2016/01/08 3.9n Nil language] +\ProvidesLanguage{nil}[2016/02/24 3.9q Nil language] \LdfInit{nil}{datenil} \ifx\l@nohyphenation\@undefined \@nopatterns{nil} diff --git a/Master/texmf-dist/tex/generic/babel/plain.def b/Master/texmf-dist/tex/generic/babel/plain.def index 7c98fade2c3..d25d0c425a3 100644 --- a/Master/texmf-dist/tex/generic/babel/plain.def +++ b/Master/texmf-dist/tex/generic/babel/plain.def @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -227,7 +227,7 @@ \fi \def\@testopt#1#2{% \@ifnextchar[{#1}{#1[#2]}} -\def\@protected@testopt#1{%% +\def\@protected@testopt#1{% \ifx\protect\@typeset@protect \expandafter\@testopt \else diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def index 3f1af9a714a..e6258033a43 100644 --- a/Master/texmf-dist/tex/generic/babel/switch.def +++ b/Master/texmf-dist/tex/generic/babel/switch.def @@ -38,12 +38,12 @@ %% 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}[2016/01/08 v3.9n The Babel package] +%%\ProvidesFile{babel.dtx}[2016/02/24 v3.9q The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013-2014 by Johannes Braams +%% Copyright (C) 2013-2016 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -52,7 +52,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{switch.def}[2016/01/08 3.9n Babel switching mechanism] +\ProvidesFile{switch.def}[2016/02/24 3.9q Babel switching mechanism] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -73,8 +73,8 @@ \countdef\last@language=19 \def\addlanguage{\alloc@9\language\chardef\@cclvi} \fi -\def\bbl@version{3.9n} -\def\bbl@date{2016/01/08} +\def\bbl@version{3.9q} +\def\bbl@date{2016/02/24} \def\adddialect#1#2{% \global\chardef#1#2\relax \bbl@usehooks{adddialect}{{#1}{#2}}% diff --git a/Master/texmf-dist/tex/generic/babel/xebabel.def b/Master/texmf-dist/tex/generic/babel/xebabel.def index e15e701ac6d..96ec89ff751 100644 --- a/Master/texmf-dist/tex/generic/babel/xebabel.def +++ b/Master/texmf-dist/tex/generic/babel/xebabel.def @@ -39,7 +39,7 @@ %% extension .ins) which are part of the distribution. %% File `bbunicode.dtx' %% Babel package for LaTeX version 2e -%% Copyright (C) 2103-2014 +%% Copyright (C) 2103-2016 %% by Javier Bezos \def\BabelStringsDefault{unicode} \let\xebbl@stop\relax @@ -48,7 +48,7 @@ \ifx\bbl@tempa\@empty \XeTeXinputencoding"bytes"% \else - \XeTeXinputencoding"#1"% + \XeTeXinputencoding"#1"% \fi \def\xebbl@stop{\XeTeXinputencoding"utf8"}} \AddBabelHook{xetex}{stopcommands}{% |