diff options
Diffstat (limited to 'macros/latex/required/babel/base/babel.dtx')
-rw-r--r-- | macros/latex/required/babel/base/babel.dtx | 106 |
1 files changed, 78 insertions, 28 deletions
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index 0444c526a7..a8d8834ab3 100644 --- a/macros/latex/required/babel/base/babel.dtx +++ b/macros/latex/required/babel/base/babel.dtx @@ -32,7 +32,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2021/10/19 v3.65 The Babel package] +\ProvidesFile{babel.dtx}[2021/11/08 v3.66 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -455,7 +455,7 @@ layout (eg, |spanish| and |french|). \end{example} You can also set the main language explicitly, but it is discouraged -except if there a real reason to do so: +except if there is a real reason to do so: \begin{verbatim} \documentclass{article} \usepackage[_main=english_,dutch]{babel} @@ -698,11 +698,25 @@ This command can be used as environment, too. \end{warning} \begin{warning} - |\selectlanguage| should not be used inside some boxed environments - (like floats or |minipage|) to switch the language if you need the - information written to the |aux| be correctly synchronized. This - rarely happens, but if it were the case, you must use |otherlanguage| - instead. + There are a couple of issues related to the way the language + information is written to the auxiliary files: +\begin{itemize} + \item |\selectlanguage| should not be used inside some boxed environments + (like floats or |minipage|) to switch the language if you need the + information written to the |aux| be correctly synchronized. This + rarely happens, but if it were the case, you must use + |otherlanguage| instead. + \item In addition, this macro inserts a |\write| in vertical mode, + which may break the vertical spacing in some cases (for example, + between lists). \New{3.64} The behavior can be adjusted with + |\babeladjust{select.write=|\m{mode}|}|, where \m{mode} is |shift| + (which shifts the skips down and adds a |\penalty|); |keep| (the + default -- with it the |\write| and the skips are kept in the order + they are written), and |omit| (which may seem a too drastic solution, + because nothing is written, but more often than not this command is + applied to more or less shorts texts with no sectioning or similar + commands and therefore no language synchronization is necessary). +\end{itemize} \end{warning} \Describe{\foreignlanguage}{\oarg{option-list}\marg{language}\marg{text}} @@ -2309,6 +2323,16 @@ to select fonts in addition to the three basic families. be aware that this may lead to some problems. \end{troubleshooting} +\begin{note} + |\babelfont| is a high level interface to \textsf{fontspec}, and + therefore in \xetex{} you can apply |Mapping|s. For example, there is + a set of + \href{https://github.com/davidmjones/brahmic-maps}{transliterations + for Brahmic scripts} by Davis M. Jones. After installing + them in you distribution, just set the map as you would do with + \textsf{fontspec}. +\end{note} + \subsection{Modifying a language} Modifying the behavior of a language (say, the chapter @@ -2789,14 +2813,14 @@ be printed with the numeral style |digits|. \subsection{Dates} -\New{3.45} When the data is taken from an |ìni| file, you may print the +\New{3.45} When the data is taken from an |ini| file, you may print the date corresponding to the Gregorian calendar and other lunisolar systems with the following command. \Describe{\localedate}{\oarg{calendar=.., variant=..}% {\marg{year}\m{month}\m{day}}} -By default the calendar is the Gregorian, but a |ini| files may define +By default the calendar is the Gregorian, but an |ini| file may define strings for other calendars (currently |ar|, |ar-|*, |he|, |fa|, |hi|.) In the latter case, the three arguments are the year, the month, and the day in those in the corresponding calendar. They are \textit{not} @@ -3062,7 +3086,8 @@ Transforms (only \luatex) provide a way to process the text on the typesetting level in several language-dependent ways, like non-standard hyphenation, special line breaking rules, script to script conversion, spacing conventions and so on.\footnote{They are similar in concept, -but not the same, as those in Unicode.} +but not the same, as those in Unicode. The main inspiration for this +feature is the Omega transformation processes.} It currently embraces |\babelprehyphenation| and |\babelposthyphenation|. @@ -3112,6 +3137,18 @@ a non-syllabic preposition or conjunction into a non-breaking space.} \trans{Greek}{diaeresis.hyphen}{Removes the diaeresis above iota and upsilon if hyphenated just before. It works with the three variants.} +\trans{Greek}{transliteration.omega}{Although he provided combinations +are not exactly the same, this transform follows the syntax of Omega: +|=| for the circumflex, |v| for digamma, and so on. For better +compatibility with Levy’s system, \texttt{\string~} (as ‘string’) is an +alternative to |=|. |'| is tonos in Monotonic Greek, but oxia in +Polytonic and Ancient Greek.} + +\trans{Greek}{sigma.final}{The transliteration system above does not +convert the sigma at the end of a word (on purpose). This transforms +does it. To prevent the conversion (an abbreviation, for example), write +|"s|.} + \trans{Hindi, Sanskrit}{transliteration.hk}{The Harvard-Kyoto system to romanize Devanagari.} @@ -5026,8 +5063,8 @@ help from Bernd Raichle, for which I am grateful. % \section{Tools} % % \begin{macrocode} -%<<version=3.65>> -%<<date=2021/10/19>> +%<<version=3.66>> +%<<date=2021/11/08>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -9694,9 +9731,11 @@ help from Bernd Raichle, for which I am grateful. {\def\languagename{##1}% \let\bbl@ifrestoring\@firstoftwo % To avoid font warning \bbl@switchfont - \directlua{ - Babel.locale_props[\the\csname bbl@id@@##1\endcsname]% - ['/\bbl@prefontid'] = \fontid\font\space}}}% + \ifnum\fontid\font>\z@ % A hack, for the pgf nullfont hack + \directlua{ + Babel.locale_props[\the\csname bbl@id@@##1\endcsname]% + ['/\bbl@prefontid'] = \fontid\font\space}% + \fi}}% \fi \bbl@exp{\\\bbl@add\\\bbl@mapselect{\\\bbl@mapdir{\languagename}}}% \fi @@ -14549,24 +14588,35 @@ end \MakeRobust\put}% \fi \AtBeginDocument - {\ifx\tikz@atbegin@node\@undefined\else - \ifx\AddToHook\@undefined\else % TODO. Still tentative. + {\ifx\pgfpicture\@undefined\else % TODO. Allow deactivate? + \ifx\AddToHook\@undefined + \bbl@sreplace\pgfpicture{\pgfpicturetrue}% + {\bbl@pictsetdir\z@\pgfpicturetrue}% + \else \AddToHook{env/pgfpicture/begin}{\bbl@pictsetdir\@ne}% - % \AddToHook{env/tikzpicture/begin}{\bbl@pictsetdir\z@}% - \bbl@add\pgfinterruptpicture{\bbl@pictresetdir}% \fi - \let\bbl@OL@pgfpicture\pgfpicture - \bbl@sreplace\pgfpicture{\pgfpicturetrue}% - {\bbl@pictsetdir\z@\pgfpicturetrue}% + \bbl@add\pgfinterruptpicture{\bbl@pictresetdir}% \bbl@add\pgfsys@beginpicture{\bbl@pictsetdir\z@}% + \fi + \ifx\tikzpicture\@undefined\else + \ifx\AddToHook\@undefined\else + \AddToHook{env/tikzpicture/begin}{\bbl@pictsetdir\z@}% + \fi \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% - \bbl@sreplace\tikz{\begingroup}% - {\begingroup\bbl@pictsetdir\tw@}% + \bbl@sreplace\tikz{\begingroup}{\begingroup\bbl@pictsetdir\tw@}% \fi \ifx\AddToHook\@undefined\else - \AddToHook{env/tcolorbox/begin}{\bbl@pictsetdir\@ne}% + \ifx\tcolorbox\@undefined\else + \AddToHook{env/tcolorbox/begin}{\bbl@pictsetdir\@ne}% + \bbl@sreplace\tcb@savebox + {\ignorespaces}{\ignorespaces\bbl@pictresetdir}% + \ifx\tikzpicture@tcb@hooked\@undefined\else + \bbl@sreplace\tikzpicture@tcb@hooked{\noexpand\tikzpicture}% + {\textdir TLT\noexpand\tikzpicture}% + \fi + \fi \fi - }} + }} {} % \end{macrocode} % @@ -14854,9 +14904,9 @@ function Babel.hyphenate_replace(head, mode) first = u.len(w:sub(1, first-1)) + 1 last = u.len(w:sub(1, last-1)) -- now last points to C - -- This loop stores in n small table the nodes + -- This loop stores in a small table the nodes -- corresponding to the pattern. Used by 'data' to provide a - -- predictable behavior with 'insert' (now w_nodes is modified on + -- predictable behavior with 'insert' (w_nodes is modified on -- the fly), and also access to 'remove'd nodes. local sc = first-1 -- Used below, too local data_nodes = {} |