32
32
%
33
33
% \iffalse
34
34
%<*filedriver>
35
- \ProvidesFile{babel.dtx}[2022/02/10 v3.70.2644 The Babel package]
35
+ \ProvidesFile{babel.dtx}[2022/02/13 v3.71 The Babel package]
36
36
\documentclass{ltxdoc}
37
37
\GetFileInfo{babel.dtx}
38
38
\usepackage{fontspec}
@@ -547,6 +547,7 @@ _\usepackage[vietnamese,danish]{babel}_
547
547
\end{note}
548
548
549
549
\subsection{Mostly monolingual documents}
550
+ \label{mostlymono}
550
551
551
552
\New{3.39} Very often, multilingual documents consist of a main
552
553
language with small pieces of text in another languages (words, idioms,
@@ -1291,6 +1292,11 @@ can take the following values:
1291
1292
\New{3.16} Selects which layout elements are adapted in bidi
1292
1293
documents. See sec.~\ref{bidi}.
1293
1294
1295
+ \Describe{provide=}{\texttt{*}}
1296
+ \New{3.49} An alternative to |\babelprovide| for languages passed as
1297
+ options. See section~\ref{inifiles}, which describes also the variants
1298
+ |provide+=| and |provide*=|.
1299
+
1294
1300
\subsection{The \texttt{base} option}
1295
1301
1296
1302
With this package option \babel{} just loads some basic macros (those
@@ -1327,12 +1333,12 @@ be the same as the option name as set in |\usepackage|!).
1327
1333
\end{verbatim}
1328
1334
\end{example}
1329
1335
1330
- % \begin{note}
1331
- % With a recent version of \LaTeX, an alternative method to execute
1332
- % some code just after an |ldf| file is loaded is with |\AddToHook| and
1333
- % the hook |file/after/ <language>.ldf|. \Babel{} does not predeclare
1334
- % it, and you have to do it yourself with |\NewHook| or |\ProvideHook |.
1335
- % \end{note}
1336
+ \begin{note}
1337
+ With a recent version of \LaTeX, an alternative method to execute
1338
+ some code just after an |ldf| file is loaded is with |\AddToHook| and
1339
+ the hook |file/<language>.ldf/after |. \Babel{} does not predeclare
1340
+ it, and you have to do it yourself with |\ActivateGenericHook |.
1341
+ \end{note}
1336
1342
1337
1343
\begin{warning}
1338
1344
Currently this option is not compatible with languages loaded on the
@@ -1344,8 +1350,8 @@ be the same as the option name as set in |\usepackage|!).
1344
1350
1345
1351
An alternative approach to define a language (or, more precisely, a
1346
1352
\textit{locale}) is by means of an \texttt{ini} file. Currently
1347
- \babel{} provides about 200 of these files containing the basic data
1348
- required for a locale.
1353
+ \babel{} provides about 250 of these files containing the basic data
1354
+ required for a locale, plus basic templates for 500 about locales.
1349
1355
1350
1356
|ini| files are not meant only for \babel, and they has been devised as
1351
1357
a resource for other packages. To easy interoperability between \TeX{}
@@ -1435,11 +1441,12 @@ Or also:
1435
1441
\begin{description}
1436
1442
\itemsep=-\parskip
1437
1443
\item[Arabic] Monolingual documents mostly work in \luatex, but it must
1438
- be fine tuned, particularly graphical elements like |picture|. In \xetex{}
1439
- \babel{} resorts to the \textsf{bidi} package, which seems to work.
1444
+ be fine tuned, particularly math and graphical elements like
1445
+ |picture|. In \xetex{} \babel{} resorts to the \textsf{bidi} package,
1446
+ which seems to work.
1440
1447
\item[Hebrew] Niqqud marks seem to work in both engines, but depending
1441
1448
on the font cantillation marks might be misplaced (\xetex{} or
1442
- \luatex{} with Harfbuzz seems better, but still problematic ).
1449
+ \luatex{} with Harfbuzz seems better).
1443
1450
\item[Devanagari] In \luatex{} and the the default renderer many fonts
1444
1451
work, but some others do not, the main issue being the ‘ra’. You may
1445
1452
need to set explicitly the script to either |deva| or |dev2|, eg:
@@ -1451,8 +1458,8 @@ need to set explicitly the script to either |deva| or |dev2|, eg:
1451
1458
also work with \xetex{}, although unlike with \luatex{} fine tuning
1452
1459
the font behavior is not always possible.
1453
1460
\item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but
1454
- line breaking differs (rules can be modified in \luatex; they are
1455
- hard-coded in \xetex ). Lao seems to work, too, but there are no
1461
+ line breaking differs (rules are hard-coded in \xetex, but they can
1462
+ be modified in \luatex ). Lao seems to work, too, but there are no
1456
1463
patterns for the latter in \luatex{}. Khemer clusters are rendered
1457
1464
wrongly with the default renderer. The comment about Indic scripts
1458
1465
and \textsf{lualatex} also applies here. Some quick patterns can
@@ -1479,7 +1486,7 @@ need to set explicitly the script to either |deva| or |dev2|, eg:
1479
1486
\item[Latin, Greek, Cyrillic] Combining chars with the default
1480
1487
\luatex{} font renderer might be wrong; on then other hand, with the
1481
1488
Harfbuzz renderer diacritics are stacked correctly, but many
1482
- hyphenations points are discarded (this bug seems related to kerning,
1489
+ hyphenations points are discarded (this bug is related to kerning,
1483
1490
so it depends on the font). With \xetex{} both combining characters
1484
1491
and hyphenation work as expected (not quite, but in most cases it
1485
1492
works; the problem here are font clusters).
@@ -2129,6 +2136,7 @@ zulu
2129
2136
2130
2137
\textbf{Modifying and adding values to |ini| files}
2131
2138
2139
+ \nobreak
2132
2140
\New{3.39} There is a way to modify the values of |ini| files when they
2133
2141
get loaded with |\babelprovide| and |import|. To set, say,
2134
2142
|digits.native| in the |numbers| section, use something like
@@ -2573,6 +2581,9 @@ Remerber there is an alternative syntax for the latter:
2573
2581
\begin{verbatim}
2574
2582
\usepackage[italian, polytonicgreek, provide=*]{babel}
2575
2583
\end{verbatim}
2584
+ Finally, also remember you might not need to load |italian| at all if
2585
+ there are only a few word in this language (see~\ref{mostlymono}).
2586
+
2576
2587
\end{example}
2577
2588
2578
2589
\Describe{script=}{\meta{script-name}}
@@ -2630,7 +2641,10 @@ CJK.
2630
2641
\Describe{intrapenalty=}{\meta{penalty}}
2631
2642
Sets the interword penalty for the writing system of this language.
2632
2643
Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
2633
- (which is the default value).
2644
+ (which is the default value).
2645
+
2646
+ \Describe{transforms=}{\meta{transform-list}}
2647
+ See section~\ref{transforms}.
2634
2648
2635
2649
\Describe{justification=}{\texttt{kashida} $\string|$
2636
2650
\texttt{elongated} $\string|$ \texttt{unhyphenated}}
@@ -2676,10 +2690,10 @@ well dates do not rely on |\arabic|.)
2676
2690
2677
2691
For example:
2678
2692
\begin{verbatim}
2679
- \babelprovide[import]{telugu} % Telugu better with XeTeX
2693
+ \babelprovide[import]{telugu}
2680
2694
% Or also, if you want:
2681
2695
% \babelprovide[import, maparabic]{telugu}
2682
- \babelfont{rm}{Gautami}
2696
+ \babelfont{rm}{Gautami} % With luatex, better with Harfbuzz
2683
2697
\begin{document}
2684
2698
_\telugudigits{1234}_
2685
2699
_\telugucounter{section}_
@@ -2827,7 +2841,7 @@ with the following command.
2827
2841
{\marg{year}\m{month}\m{day}}}
2828
2842
2829
2843
By default the calendar is the Gregorian, but an |ini| file may define
2830
- strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|.)
2844
+ strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|).
2831
2845
In the latter case, the three arguments are the year, the month, and
2832
2846
the day in those in the corresponding calendar. They are \textit{not}
2833
2847
the Gregorian data to be converted (which means, say, 13 is a valid
@@ -2853,7 +2867,7 @@ current language.
2853
2867
2854
2868
If more than one language is used, it might be necessary to know which
2855
2869
language is active at a specific time. This can be checked by a call
2856
- to |\iflanguage|, but note here ``language'' is used in the \TeX
2870
+ to |\iflanguage|, but note here ``language'' is used in the \TeX{}
2857
2871
sense, as a set of hyphenation patterns, and \textit{not} as its
2858
2872
\textsf{babel} name. This macro takes three arguments. The first
2859
2873
argument is the name of a language; the second and third arguments are
@@ -2940,7 +2954,9 @@ identifier, which can be retrieved with |\localeid|.
2940
2954
typically the LGC group, South East Asian, like Thai, and CJK, but
2941
2955
support depends on the engine: \textsf{pdftex} only deals with the
2942
2956
former, \xetex{} also with the second one (although in a limited way),
2943
- while \luatex{} provides basic rules for the latter, too.
2957
+ while \luatex{} provides basic rules for the latter, too. With \luatex{}
2958
+ there are also tools for non-standard hyphenation rules, explained in
2959
+ the next section.
2944
2960
2945
2961
\Describe{\babelhyphen}{%
2946
2962
\colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}\marg{type}}
@@ -3087,6 +3103,7 @@ of the previous char in \luatex, and the font size set by the last
3087
3103
|\selectfont| in \xetex).
3088
3104
3089
3105
\subsection{Transforms}
3106
+ \label{transforms}
3090
3107
3091
3108
Transforms (only \luatex) provide a way to process the text on the
3092
3109
typesetting level in several language-dependent ways, like non-standard
@@ -3193,6 +3210,9 @@ Gujarati, Hindi, Kannada, Malayalam, Marathi, Oriya, Tamil, Telugu.}
3193
3210
\trans{Latin}{letters.uv}{Replaces \textit{v}, \textit{U} with
3194
3211
\textit{u}, \textit{V}.}
3195
3212
3213
+ \trans{Sanskrit}{transliteration.iast}{The IAST system to
3214
+ romanize Devanagari.\footnote{Thanks to Maximilian Mehner}}
3215
+
3196
3216
\trans{Serbian}{transliteration.gajica}{(Note |serbian| with |ini|
3197
3217
files refers to the Cyrillic script, which is here the target.) The
3198
3218
standard system devised by Ljudevit Gaj.}
@@ -3280,7 +3300,7 @@ This feature is activated with the first |\babelposthyphenation| or
3280
3300
\babelprovide[hyphenrules=+]{russian-latin} % Create locale
3281
3301
\babelprehyphenation{russian-latin}{([sz])h} % Create rule
3282
3302
{
3283
- string = {1|sz|šž},
3303
+ string = _ {1|sz|šž}_ ,
3284
3304
remove
3285
3305
}
3286
3306
\end{verbatim}
@@ -4157,7 +4177,7 @@ for a small example (|xe-bidi|).
4157
4177
See the code section for |\foreignlanguage*| (a new starred
4158
4178
version of |\foreignlanguage|).
4159
4179
4160
- For old an deprecated functions, see the wiki .
4180
+ For old an deprecated functions, see the \babel{} site .
4161
4181
4162
4182
\medskip
4163
4183
\textbf{Options for locales loaded on the fly}
@@ -4174,7 +4194,8 @@ extended numerals in Greek).
4174
4194
\New{3.48} There is some work in progress for \babel{} to deal with
4175
4195
labels, both with the relation to captions (chapters, part), and how
4176
4196
counters are used to define them. It is still somewhat tentative
4177
- because it is far from trivial -- see the wiki for further details.
4197
+ because it is far from trivial -- see the \babel{} site for further
4198
+ details.
4178
4199
4179
4200
\section{Loading languages with \file{language.dat}}
4180
4201
@@ -4926,50 +4947,6 @@ is true with these two environment selectors.
4926
4947
4927
4948
Its natural place of use is in hooks or in |\extras|\m{language}.
4928
4949
4929
- \section{Changes}
4930
-
4931
- \subsection{Changes in \babel\ version 3.9}
4932
-
4933
- Most of the changes in version 3.9 were related to bugs, either to fix
4934
- them (there were lots), or to provide some alternatives. Even new
4935
- features like |\babelhyphen| are intended to solve a certain problem
4936
- (in this case, the lacking of a uniform syntax and behavior for
4937
- shorthands across languages). These changes, as well as the subsequent
4938
- ones ($\ge$3.10), are described in this manual in the corresponding
4939
- place. A selective list of the changes in 3.9 follows:
4940
- \begin{itemize}
4941
- \item |\select@language| did not set |\languagename|. This meant the
4942
- language in force when auxiliary files were loaded was the one used
4943
- in, for example, shorthands -- if the language was |german|, a
4944
- |\select@language{spanish}| had no effect.
4945
-
4946
- \item |\foreignlanguage| and |otherlanguage*| messed up
4947
- |\extras<language>|. Scripts, encodings and many other things were
4948
- not switched correctly.
4949
-
4950
- \item The |:ENC| mechanism for hyphenation patterns used the encoding
4951
- of the \textit{previous} language, not that of the language being
4952
- selected.
4953
-
4954
- \item |'| (with |activeacute|) had the original value when writing to an
4955
- auxiliary file, and things like an infinite loop can happen. It
4956
- worked incorrectly with |^| (if activated) and also if deactivated.
4957
-
4958
- \item Active chars where not reset at the end of language options, and
4959
- that lead to incompatibilities between languages.
4960
-
4961
- \item |\textormath| raised an error with a conditional.
4962
-
4963
- \item |\aliasshorthand| didn't work (or only in a few and very specific
4964
- cases).
4965
-
4966
- \item |\l@english| was defined incorrectly (using |\let| instead of
4967
- |\chardef|).
4968
-
4969
- \item |ldf| files not bundled with babel were not recognized when
4970
- called as global options.
4971
- \end{itemize}
4972
-
4973
4950
\DocInput{babel.dtx}
4974
4951
4975
4952
\section{Acknowledgements}
@@ -5123,8 +5100,8 @@ help from Bernd Raichle, for which I am grateful.
5123
5100
% \section{Tools}
5124
5101
%
5125
5102
% \begin{macrocode}
5126
- %<<version=3.70.2644 >>
5127
- %<<date=2022/02/10 >>
5103
+ %<<version=3.71 >>
5104
+ %<<date=2022/02/13 >>
5128
5105
% \end{macrocode}
5129
5106
%
5130
5107
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -14568,6 +14545,9 @@ end
14568
14545
\def\BabelNoAMSMath{\let\bbl@noamsmath\relax}
14569
14546
\ifnum\bbl@bidimode>\z@
14570
14547
\let\bbl@eqnodir\relax
14548
+ % \ifx\matheqdirmode\@undefined\else
14549
+ % \matheqdirmode\@ne
14550
+ % \fi
14571
14551
\AtBeginDocument{%
14572
14552
\ifx\maketag@@@\@undefined % Normal equation, eqnarray
14573
14553
\AddToHook{env/eqnarray/begin}{%
0 commit comments