summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/babel/babel.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-10 21:37:22 +0000
committerKarl Berry <karl@freefriends.org>2018-05-10 21:37:22 +0000
commite019f4d7549ebc1de8ac89fc1e8d48f54dd12fd2 (patch)
treec28f1ecb5fbf898502bd5757f39867ee51f261e5 /Master/texmf-dist/source/latex/babel/babel.dtx
parentd404f60db070829b863601a0c3380fede121558b (diff)
babel (10may18)
git-svn-id: svn://tug.org/texlive/trunk@47664 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/babel/babel.dtx')
-rw-r--r--Master/texmf-dist/source/latex/babel/babel.dtx133
1 files changed, 70 insertions, 63 deletions
diff --git a/Master/texmf-dist/source/latex/babel/babel.dtx b/Master/texmf-dist/source/latex/babel/babel.dtx
index 16acec62d46..dd085dd4cfd 100644
--- a/Master/texmf-dist/source/latex/babel/babel.dtx
+++ b/Master/texmf-dist/source/latex/babel/babel.dtx
@@ -31,7 +31,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2018/05/02 v3.20 The Babel package]
+\ProvidesFile{babel.dtx}[2018/05/10 v3.21 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -279,7 +279,8 @@ Plus ça change, plus c'est la même chose!
\end{verbatim}
\end{example}
\begin{troubleshooting}
-\trouble{Paragraph ended before \textbackslash UTFviii@three@octets was complete}
+\trouble{Paragraph ended before \textbackslash UTFviii@three@octets
+was complete}
A common source of trouble is a wrong setting of the input encoding.
Very often you will get the following somewhat cryptic error:
\begin{verbatim}
@@ -495,10 +496,11 @@ _\usepackage[russian]{babel}_
loaded the language LANG yet''.}
\trouble{Unknown language `LANG'}
\begin{verbatim}
-! Package babel Error: Unknown language `LANG'. Either you have misspelled
-(babel) its name, it has not been installed, or you requested
-(babel) it in a previous run. Fix its name, install it or just
-(babel) rerun the file, respectively
+! Package babel Error: Unknown language `#1'. Either you have
+(babel) misspelled its name, it has not been installed,
+(babel) or you requested it in a previous run. Fix its name,
+(babel) install it or just rerun the file, respectively. In
+(babel) some cases, you may need to remove the aux file
\end{verbatim}
The most frequent reason is, by far, the latest (for example, you
included |spanish|, but you realized this language is not used after
@@ -664,8 +666,8 @@ text
\end{note}
\begin{note}
- Actually, there may be another advantage in the ‘short’ syntax |\text|\m{tag},
- namely, it is not affected by |\MakeUppercase| (while
+ Actually, there may be another advantage in the ‘short’ syntax
+ |\text|\m{tag}, namely, it is not affected by |\MakeUppercase| (while
|\foreignlanguage| is).
\end{note}
@@ -844,7 +846,7 @@ system shorthands. Language-dependent user shorthands (new in
is that expected in each context.
\end{example}
-\Describe\aliasshorthand{\marg{original}\marg{alias}}
+\Describe{\aliasshorthand}{\marg{original}\marg{alias}}
The command |\aliasshorthand| can be used to let another
character perform the same functions as the default shorthand
@@ -874,7 +876,7 @@ over |"| in typing Polish texts, this can be achieved by entering
|^| with |\defineshorthand| nothing happens.
\end{warning}
-\Describe\languageshorthands{\marg{language}} The command
+\Describe{\languageshorthands}{\marg{language}} The command
|\languageshorthands| can be used to switch the shorthands on the
language level. It takes one argument, the name of a language or
|none| (the latter does what its name suggests).\footnote{Actually,
@@ -897,7 +899,7 @@ to easy typing phonetic characters with \textsf{tipa}:
\newcommand{\myipa}[1]{{\languageshorthands{none}\tipaencoding#1}}
\end{verbatim}
-\Describe\babelshorthand{\marg{shorthand}}
+\Describe{\babelshorthand}{\marg{shorthand}}
With this command you can use a shorthand even if (1) not activated in
\texttt{shorthands} (in this case only shorthands for the current
language are taken into account, ie, not user shorthands), (2) turned
@@ -1131,15 +1133,13 @@ on package options, in under development.
\begin{example}
Although Georgian has its own \texttt{ldf} file, here is how to
- declare this language with an |ini| file in Unicode engines. The
- |nil| language is required, because currently \babel{} raises an
- error if there is no language.
+ declare this language with an |ini| file in Unicode engines.
\begingroup
\setmonofont[Scale=.87,Script=Georgian]{DejaVu Sans Mono}
\begin{verbatim}
\documentclass{book}
-\usepackage[nil]{babel}
+\usepackage{babel}
\babelprovide[import=ka, main]{georgian}
\babelfont{rm}{DejaVu Sans}
@@ -1175,6 +1175,9 @@ captions):
\tag{ak} Akan
\tag{am} Amharic\hascapu\hascapl
\tag{ar} Arabic\hascapu\hascapl
+\tag{ar-DZ} Arabic\hascapu\hascapl
+\tag{ar-MA} Arabic\hascapu\hascapl
+\tag{ar-SY} Arabic\hascapu\hascapl
\tag{as} Assamese
\tag{asa} Asu
\tag{ast} Asturian\hascapu\hascapl
@@ -1434,6 +1437,12 @@ albanian\\
american\\
amharic\\
arabic\\
+arabic-algeria\\
+arabic-DZ\\
+arabic-morocco\\
+arabic-MA\\
+arabic-syria\\
+arabic-SY\\
armenian\\
assamese\\
asturian\\
@@ -2272,7 +2281,7 @@ directionality.)
\begin{verbatim}
\documentclass{article}
-\usepackage[nil, _bidi=basic-r_]{babel}
+\usepackage[_bidi=basic-r_]{babel}
_\babelprovide[import=ar, main]{arabic}_
@@ -2519,7 +2528,8 @@ ones, they only have a single hook and replace a default definition.
\renewcommand\makelabel[1]{%
\hspace\labelsep\normalfont\ttfamily\color{thered}#1}
\itemsep=-\parskip
-\item[everylanguage] (language) Executed before every language patterns are loaded.
+\item[everylanguage] (language) Executed before every language patterns
+ are loaded.
\item[loadkernel] (file) By default loads |switch.def|. It can be used
to load a different version of this files or to load nothing.
\item[loadpatterns] (patterns file) Loads the patterns file. Used by
@@ -2689,6 +2699,9 @@ 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.
+\item[ucharclasses] (\xetex) Switches fonts when you switch from one
+ Unicode block to another.
+\item[zhspacing] Spacing for CJK documents in \xetex.
\end{description}
\subsection{Current and future work}
@@ -2715,7 +2728,7 @@ discretionary by the equivalent to ZWJ.
\begin{verbatim}
\documentclass{article}
-\usepackage[nil]{babel}
+\usepackage{babel}
\babelprovide[import=th, main]{thai}
@@ -3036,8 +3049,9 @@ but if you want to do it, here are a few guidelines.
maintainer(s) as authors if they have not contributed significantly
to your language files.
\item Fonts are not strictly part of a language, so they are best placed
- in the corresponding TeX tree. This includes not only \texttt{tfm}, \texttt{vf}, \texttt{ps1},
- \texttt{otf}, \texttt{mf} files and the like, but also \texttt{fd} ones.
+ in the corresponding TeX tree. This includes not only \texttt{tfm},
+ \texttt{vf}, \texttt{ps1}, \texttt{otf}, \texttt{mf} files and the
+ like, but also \texttt{fd} ones.
\item Font and input encodings are usually best placed in the
corresponding tree, too, but sometimes they belong more naturally to
the babel style. Note you may also need to define a LICR.
@@ -3482,13 +3496,14 @@ appropiate.\footnote{This replaces in 3.9g a short-lived
\texttt{\string\UseStrings} which has been removed because it did
not work.}
-\Describe\EndBabelCommands{}
+\Describe{\EndBabelCommands}{}
Marks the end of the series of blocks.
-\Describe\AfterBabelCommands{\marg{code}}
-The code is delayed and executed at the global scope just after |\EndBabelCommands|.
+\Describe{\AfterBabelCommands}{\marg{code}}
+The code is delayed and executed at the global scope just after
+|\EndBabelCommands|.
-\Describe\SetString{\marg{macro-name}\marg{string}}
+\Describe{\SetString}{\marg{macro-name}\marg{string}}
Adds \meta{macro-name} to the current category, and defines globally
\meta{lang-macro-name} to \meta{code} (after applying the
transformation corresponding to the current charset or defined with
@@ -3498,7 +3513,7 @@ Use this command to define strings, without including any ``logic'' if
possible, which should be a separated macro. See the example above for
the date.
-\Describe\SetStringLoop{\marg{macro-name}\marg{string-list}}
+\Describe{\SetStringLoop}{\marg{macro-name}\marg{string-list}}
A convenient way to define several ordered names at once. For example,
to define |\abmoniname|, |\abmoniiname|, etc. (and similarly with
|abday|):
@@ -3763,8 +3778,8 @@ help from Bernd Raichle, for which I am grateful.
% little bit of literate programming.
%
% \begin{macrocode}
-%<<version=3.20>>
-%<<date=2018/05/02>>
+%<<version=3.21>>
+%<<date=2018/05/10>>
% \end{macrocode}
%
% \section{Tools}
@@ -4712,15 +4727,15 @@ help from Bernd Raichle, for which I am grateful.
%
% \changes{babel~3.9a}{2012/06/24}{Now babel is not loaded to prevent
% the document from raising errors after fixing it}
+% \changes{babel~3.21}{2018/05/09}{Requesting a language is no required
+% any more, in case you only need \cs{babelprovide}.}
%
% \begin{macrocode}
\ifx\bbl@main@language\@undefined
- \bbl@error{%
- You haven't specified a language option}{%
- You need to specify a language, either as a global option\\%
- or as an optional argument to the \string\usepackage\space
- command;\\%
- You shouldn't try to proceed from here, type x to quit.}
+ \bbl@info{%
+ You haven't specified a language. I'll use 'nil'\\%
+ as the main language. Reported}
+ \bbl@load@language{nil}
\fi
%</package>
%<*core>
@@ -6201,7 +6216,7 @@ help from Bernd Raichle, for which I am grateful.
\ifin@
\bbl@warning{%
You have more than once selected the attribute '##1'\\%
- for language #1}%
+ for language #1. Reported}%
\else
% \end{macrocode}
%
@@ -8513,7 +8528,8 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\bbl@redefine\markboth#1#2{%
\protected@edef\bbl@tempb##1{%
- \protect\foreignlanguage{\languagename}{\protect\bbl@restore@actives##1}}%
+ \protect\foreignlanguage
+ {\languagename}{\protect\bbl@restore@actives##1}}%
\bbl@ifblank{#1}%
{\toks@{}}%
{\toks@\expandafter{\bbl@tempb{#1}}}%
@@ -9335,9 +9351,9 @@ help from Bernd Raichle, for which I am grateful.
\xdef\bbl@language@stack{\languagename+\bbl@language@stack}}
% \end{macrocode}
%
-% Retrieving information from the stack is a little bit less simple,
-% as we need to remove the element from the stack while storing it
-% in the macro |\languagename|. For this we first define a helper function.
+% Retrieving information from the stack is a little bit less simple, as
+% we need to remove the element from the stack while storing it in the
+% macro |\languagename|. For this we first define a helper function.
% \begin{macro}{\bbl@pop@lang}
% This macro stores its first element (which is delimited by the
% `+'-sign) in |\languagename| and stores the rest of the string
@@ -10131,15 +10147,15 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@languages{}
% \end{macrocode}
%
-% When no languages have been loaded yet, the name following the
-% \texttt{=} will be a synonym for hyphenation register 0. So, it is stored
-% in a token register and executed when the first pattern file has
-% been processed. (The |\relax| just helps to the |\if| below
-% catching synonyms without a language.)
+% When no languages have been loaded yet, the name following the
+% \texttt{=} will be a synonym for hyphenation register 0. So, it is
+% stored in a token register and executed when the first pattern file
+% has been processed. (The |\relax| just helps to the |\if| below
+% catching synonyms without a language.)
%
-% Otherwise the name will be a synonym for the language loaded last.
+% Otherwise the name will be a synonym for the language loaded last.
%
-% We also need to copy the hyphenmin parameters for the synonym.
+% We also need to copy the hyphenmin parameters for the synonym.
%
% \changes{babel~3.9a}{2012/06/25}{Added \cs{bbl@languages}}
%
@@ -10408,24 +10424,13 @@ help from Bernd Raichle, for which I am grateful.
% now \cs{toks}8 is expanded here.}
% \changes{babel~3.9o}{2016/01/25}{The number of languages loaded was
% off by 1.}
+% \changes{babel~3.21}{2018/05/09}{The message is not printed any more.}
%
% \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
- \ifx\typeout\@undefined
- \immediate\write16%
- \else
- \noexpand\typeout
- \fi
- {\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
@@ -11207,7 +11212,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@languages
\@ifundefined{bbl@hyphendata@\the\language}%
{\bbl@info{No hyphenation patterns were set for\\%
- language ‘\bbl@tempa’. Reported}}%
+ language '\bbl@tempa'. Reported}}%
{\expandafter\expandafter\expandafter\bbl@luapatterns
\csname bbl@hyphendata@\the\language\endcsname}}{}}
\endinput\fi
@@ -11290,7 +11295,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@languages
\@ifundefined{bbl@hyphendata@\the\language}%
{\bbl@info{No hyphenation patterns were set for\\%
- language ‘#2’. Reported}}%
+ language '#2'. Reported}}%
{\expandafter\expandafter\expandafter\bbl@luapatterns
\csname bbl@hyphendata@\the\language\endcsname}}{}%
\@ifundefined{bbl@patterns@}{}{%
@@ -11394,13 +11399,16 @@ help from Bernd Raichle, for which I am grateful.
% \cs{nextfakemath} in Omega}
% \changes{3.19}{2018/04/23}{Patch \cs{@eqnnum}, somewhat ad hoc. To be
% improved.}
+% \changes{3.21}{2018/05/09}{The ad hoc \cs{@eqnnum} was buggy. Fixed.}
%
% \begin{macrocode}
\bbl@trace{Redefinitions for bidi layout}
\ifx\@eqnnum\@undefined\else
- \edef\@eqnnum{{%
- \unexpanded{\ifcase\bbl@attr@dir\else\bbl@textdir\@ne\fi}%
- \unexpanded\expandafter{\@eqnnum}}}
+ \ifx\bbl@attr@dir\@undefined\else
+ \edef\@eqnnum{{%
+ \unexpanded{\ifcase\bbl@attr@dir\else\bbl@textdir\@ne\fi}%
+ \unexpanded\expandafter{\@eqnnum}}}
+ \fi
\fi
\ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout
\ifx\bbl@beforeforeign\leavevmode % A poor test for bidi=
@@ -18339,7 +18347,6 @@ end
%</nil>
% \end{macrocode}
%
-%
% \section{Support for Plain \TeX\ (\texttt{plain.def})}
%
% \subsection{Not renaming \file{hyphen.tex}}