diff options
author | Norbert Preining <norbert@preining.info> | 2024-09-19 03:02:32 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-09-19 03:02:32 +0000 |
commit | fb76ceb75f54b0730900eac50fb23bbdc5243010 (patch) | |
tree | 5f7909a870c185b4b83096e41a8902c2b1959c4e /macros/latex | |
parent | 73cf6f1d6adcda573c712d2b05d7fa9536c63d84 (diff) |
CTAN sync 202409190302
Diffstat (limited to 'macros/latex')
18 files changed, 493 insertions, 325 deletions
diff --git a/macros/latex/contrib/se2thesis/CHANGELOG.md b/macros/latex/contrib/se2thesis/CHANGELOG.md index 2d81b57f6f..9789573597 100644 --- a/macros/latex/contrib/se2thesis/CHANGELOG.md +++ b/macros/latex/contrib/se2thesis/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to ## [Unreleased] +## [v4.3.3] – 2024–09–18 + +### Added + +- Load the `mismath` package before the `unicode-math` package, which is + recommended according to `mismath`'s documentation. + ## [v4.3.2] – 2024–08–12 ### Fixed @@ -267,7 +274,8 @@ These changes might be breaking changes! ### Added - First official release -[Unreleased]: https://github.com/se2p/se2thesis/compare/v4.3.2...HEAD +[Unreleased]: https://github.com/se2p/se2thesis/compare/v4.3.3...HEAD +[v4.3.3]: https://github.com/se2p/se2thesis/compare/v4.3.3...v4.3.2 [v4.3.2]: https://github.com/se2p/se2thesis/compare/v4.3.2...v4.3.1 [v4.3.1]: https://github.com/se2p/se2thesis/compare/v4.3.1...v4.3.0 [v4.3.0]: https://github.com/se2p/se2thesis/compare/v4.3.0...v4.2.0 diff --git a/macros/latex/contrib/se2thesis/se2colors.dtx b/macros/latex/contrib/se2thesis/se2colors.dtx index 7b0b5d81f7..9b2648c9ac 100644 --- a/macros/latex/contrib/se2thesis/se2colors.dtx +++ b/macros/latex/contrib/se2thesis/se2colors.dtx @@ -231,7 +231,7 @@ % % Identify the package and give the overall version information. % \begin{macrocode} -\ProvidesExplPackage {se2colors} {2024-08-12} {4.3.2} +\ProvidesExplPackage {se2colors} {2024-09-18} {4.3.3} {A colour support package for the se2thesis bundle} % \end{macrocode} % diff --git a/macros/latex/contrib/se2thesis/se2fonts.dtx b/macros/latex/contrib/se2thesis/se2fonts.dtx index 5ede585b75..98e044057c 100644 --- a/macros/latex/contrib/se2thesis/se2fonts.dtx +++ b/macros/latex/contrib/se2thesis/se2fonts.dtx @@ -151,7 +151,7 @@ % % Identify the package and give the overall version information. % \begin{macrocode} -\ProvidesExplPackage {se2fonts} {2024-08-12} {4.3.2} +\ProvidesExplPackage {se2fonts} {2024-09-18} {4.3.3} {A font-selection support package for the se2thesis bundle} % \end{macrocode} % @@ -214,6 +214,12 @@ % % \subsection{Font loading} % +% Load the \pkg{mismath} package, which itself loads \pkg{mathtools} and +% transitively \pkg{amsmath} \emph{before} \pkg{unicode-math}. +% \begin{macrocode} +\RequirePackage{mismath} +% \end{macrocode} +% % Depending on the engine used by the user, % we can use \pkg{fontspec} for loading fonts. % \begin{macrocode} diff --git a/macros/latex/contrib/se2thesis/se2packages.dtx b/macros/latex/contrib/se2thesis/se2packages.dtx index 3ad8d99b0a..43f9ef8830 100644 --- a/macros/latex/contrib/se2thesis/se2packages.dtx +++ b/macros/latex/contrib/se2thesis/se2packages.dtx @@ -472,7 +472,7 @@ % % Identify the package and give the overall version information. % \begin{macrocode} -\ProvidesExplPackage {se2packages} {2024-08-12} {4.3.2} +\ProvidesExplPackage {se2packages} {2024-09-18} {4.3.3} {Supporting packages for the se2thesis bundle} % \end{macrocode} % diff --git a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf Binary files differindex 4d224fe981..2f1ec86666 100644 --- a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf +++ b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf diff --git a/macros/latex/contrib/se2thesis/se2thesis.dtx b/macros/latex/contrib/se2thesis/se2thesis.dtx index 6d29f97482..c881bb7ae0 100644 --- a/macros/latex/contrib/se2thesis/se2thesis.dtx +++ b/macros/latex/contrib/se2thesis/se2thesis.dtx @@ -654,7 +654,7 @@ % % Identify the class and give the overall version number. % \begin{macrocode} -\ProvidesExplClass {se2thesis} {2024-08-12} {4.3.2} +\ProvidesExplClass {se2thesis} {2024-09-18} {4.3.3} {A thesis class for the Chair of Software Engineering II} % \end{macrocode} % @@ -1731,7 +1731,7 @@ % We provide the following English translations. % % \begin{macrocode} -\ProvideDictionaryFor{English}{se2translations}[2024/08/12] +\ProvideDictionaryFor{English}{se2translations}[2024/09/18] \ProvideDictTranslation{abstract}{abstract} \ProvideDictTranslation{Abstract}{Abstract} \ProvideDictTranslation{acknowledgement}{acknowledgement} @@ -1782,7 +1782,7 @@ % We provide the following German translations. % % \begin{macrocode} -\ProvideDictionaryFor{German}{se2translations}[2024/08/12] +\ProvideDictionaryFor{German}{se2translations}[2024/09/18] \ProvideDictTranslation{abstract}{Zusammenfassung} \ProvideDictTranslation{Abstract}{Zusammenfassung} \ProvideDictTranslation{acknowledgement}{Danksagung} diff --git a/macros/latex/contrib/se2thesis/se2thesis.pdf b/macros/latex/contrib/se2thesis/se2thesis.pdf Binary files differindex e37c07abf4..3920cf1b96 100644 --- a/macros/latex/contrib/se2thesis/se2thesis.pdf +++ b/macros/latex/contrib/se2thesis/se2thesis.pdf diff --git a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.pdf b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.pdf Binary files differindex 530ec3542d..08308e36fa 100644 --- a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.pdf +++ b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.pdf diff --git a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.tex b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.tex index 9793f8c7e1..99de5525b2 100644 --- a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.tex +++ b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc-fr.tex @@ -23,8 +23,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{14/11/2023} +\def\TPversion{0.1.2} +\def\TPdate{18/09/2024} \usepackage{soul} \sethlcolor{lightgray!25} \NewDocumentCommand\MontreCode{ m }{% @@ -147,6 +147,7 @@ Les packages utiles, et chargés sont : \begin{quote} \begin{verbatim} +0.1.2 : Visionneuse 'like' de scripts 0.1.1 : Ajout des commandes en [fr] 0.1.0 : Version initiale \end{verbatim} @@ -320,13 +321,18 @@ Pour créer une \og fausse\fg{} visionneuse, les environnements sont : \begin{VisionnIMG}[clés]{options tcbox} .... \end{VisionnIMG} + +%----Visionneuse de script python +\begin{VisionnPY}[clés]{options tcbox} + .... +\end{VisionnPY} \end{verbatim} \end{quote} Les \textsf{clés}, optionnelles et entre \MontreCode{[...]}, sont : \begin{itemize} - \item \MontreCode{Titre} := titre du terminal (\MontreCode{Terminal Win/UNiX/Mac} par défaut) ; + \item \MontreCode{Titre} := titre de la visionneuse par défaut ; \item \MontreCode{Align} := alignement horizontal (paragraphe) de la visionneuse (\MontreCode{center} par défaut) ; \item \MontreCode{AlignH} := alignement horizontal (du contenu) de la visionneuse (\MontreCode{center} par défaut) ; \item \MontreCode{Largeur} := largeur de la visionneuse (\MontreCode{\textbackslash linewidth} par défaut) ; @@ -362,4 +368,34 @@ L'argument obligatoire, entre \MontreCode{\{...\}}, correspond à des options sp \end{VisionnIMG} \end{tcblisting} +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +%avec un environnement de présentation de codes si nécessaire +\begin{VisionnPY}[Largeur=12cm]{} +\begin{lstlisting}% + [ + language=python,basicstyle=\ttfamily\small, + keywordstyle=\color{green!50!black},tabsize=4, + keywordstyle={[2]\color{magenta}}, + numbers=left,numbersep=3mm,xleftmargin=5mm, + aboveskip=0pt,belowskip=0pt, + numberstyle=\footnotesize\ttfamily\color{gray} + ] +nterms = int(input("Entrez un nombre: ")) + +n1 = 0 +n2 = 1 + +print("\n la suite Fibonacci est : ") +print(n1, ",", n2, end=", ") + +for i in range(2, nterms): + suivant = n1 + n2 + print(suivant, end=", ") + +n1 = n2 +n2 = suivant +\end{lstlisting} +\end{VisionnPY} +\end{tcblisting} + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.pdf b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.pdf Binary files differindex 6550a4c0d5..1c559c0231 100644 --- a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.pdf +++ b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.pdf diff --git a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.tex b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.tex index 229d363700..bc18f86b6d 100644 --- a/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.tex +++ b/macros/latex/contrib/sim-os-menus/doc/sim-os-menus-doc.tex @@ -23,8 +23,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{14/11/2023} +\def\TPversion{0.1.2} +\def\TPdate{18/09/2024} \usepackage{soul} \sethlcolor{lightgray!25} \NewDocumentCommand\MontreCode{ m }{% @@ -146,6 +146,7 @@ The package loads the packages : \begin{quote} \begin{verbatim} +0.1.2 : Script editor viewer 'like' 0.1.1 : French version of the commands 0.1.0 : Initial version \end{verbatim} @@ -318,13 +319,18 @@ In order to create a 'fake' viewer (for \textsf{pdf} or \textsf{img}), environme \begin{IMGViewer}[keys]{tcbox options} .... \end{IMGViewer} + +%----Script editor like +\begin{PYViewer}[keys]{tcbox options} + .... +\end{PYViewer} \end{verbatim} \end{quote} Optional keys, between \MontreCode{[...]} are : \begin{itemize} - \item \MontreCode{Title} := title of the terminal (\MontreCode{Terminal Windows} by default) ; + \item \MontreCode{Title} := title of the viewer ; \item \MontreCode{Align} := horizontal alignment of the box (\MontreCode{center} by default) ; \item \MontreCode{Width} := width of the box (\MontreCode{\textbackslash linewidth} by default) ; \item \MontreCode{Halign} := horizontal alignment fot the content (\MontreCode{left} by default) ; @@ -360,4 +366,35 @@ The mandatory argument, between \MontreCode{\{...\}}, are options to give to the \end{IMGViewer} \end{tcblisting} +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +%with listings, or piton, for example +\begin{PYViewer}[width=12cm]{} +\begin{lstlisting}% + [ + language=python,basicstyle=\ttfamily\small, + keywordstyle=\color{green!50!black},tabsize=4, + keywordstyle={[2]\color{magenta}}, + numbers=left,numbersep=3mm,xleftmargin=5mm, + aboveskip=0pt,belowskip=0pt, + numberstyle=\footnotesize\ttfamily\color{gray} + ] +nterms = int(input("Entrez un nombre: ")) + +n1 = 0 +n2 = 1 + +print("\n la suite Fibonacci est : ") +print(n1, ",", n2, end=", ") + +for i in range(2, nterms): + suivant = n1 + n2 + print(suivant, end=", ") + +n1 = n2 +n2 = suivant +\end{lstlisting} +\end{PYViewer} +\end{tcblisting} + + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/sim-os-menus/tex/sim-os-menus.sty b/macros/latex/contrib/sim-os-menus/tex/sim-os-menus.sty index 01da065abb..9055c58c06 100644 --- a/macros/latex/contrib/sim-os-menus/tex/sim-os-menus.sty +++ b/macros/latex/contrib/sim-os-menus/tex/sim-os-menus.sty @@ -2,7 +2,8 @@ % licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{sim-os-menus}[2023/11/14 0.1.1 Present 'context menu'/'terminal'/'windows', with TikZ or tcolorbox (en of fr commands)] +\ProvidesPackage{sim-os-menus}[2024/09/18 0.1.2 Present 'context menu'/'terminal'/'windows', with TikZ or tcolorbox (en or fr commands)] +% 0.1.2 Ajout d'une visionneuse type python % 0.1.1 French version of the commands % 0.1.0 Initial version @@ -794,4 +795,65 @@ \endtcolorbox% } +%====PYVIEWER (OK) 0.1.2 +\tcbset{StylePYViewer/.style={% + enhanced,boxrule=1pt,arc=3pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=gray,colback=lightgray!5,colbacktitle=lightgray!15,colupper=black,coltitle=black,titlerule=0.4pt,left=3pt,top=2pt,bottom=2pt,right=2pt,middle=0pt,fonttitle=\bfseries\small\sffamily + } +} + +\setKVdefault[PYVisionn]{Titre={Éditeur Python},Align={center},Largeur={\linewidth},AlignH={flush left},Icones=true} + +\NewDocumentCommand\PYVIewerTitre{ s }{% + \IfBooleanTF{#1}% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PYVisionn]{Titre} && \faPython \\ + \end{tblr} + }% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]l|[1pt]l|[1pt]l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PYVisionn]{Titre} & \faFile*[regular]~~\faIcon[regular] + {file-code}~~\faSave&\faPlay~~\faStop&\faBug&& \faPython \\ + \end{tblr} + }% +} + +\NewDocumentEnvironment{VisionnPY}{ O{} m } +{% + \restoreKV[PYVisionn]% + \setKV[PYVisionn]{#1}% + \tcolorbox[StylePYViewer,{\useKV[PYVisionn]{Align}},title={\ifboolKV[PYVisionn]{Icones}{\PYVIewerTitre}{\PYVIewerTitre*}},width={\useKV[PYVisionn]{Largeur}},halign={\useKV[PYVisionn]{AlignH}},#2] +}% +{% + \endtcolorbox% +} + +\setKVdefault[PYViewer]{title={Python editor},align={center},width={\linewidth},halign={flush left},icons=true} + +\NewDocumentCommand\PYVIewerTitle{ s }{% + \IfBooleanTF{#1}% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PYViewer]{title} && \faPython \\ + \end{tblr} + }% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]l|[1pt]l|[1pt]l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PYViewer]{title} & \faFile*[regular]~~\faIcon[regular] + {file-code}~~\faSave&\faPlay~~\faStop&\faBug&& \faPython \\ + \end{tblr} + }% +} + +\NewDocumentEnvironment{PYViewer}{ O{} m } +{% + \restoreKV[PYViewer]% + \setKV[PYViewer]{#1}% + \tcolorbox[StylePYViewer,{\useKV[PYViewer]{align}},title={\ifboolKV[PYViewer]{icons}{\PYVIewerTitle}{\PYVIewerTitle*}},width={\useKV[PYViewer]{width}},halign={\useKV[PYViewer]{halign}},#2] +}% +{% + \endtcolorbox% +} + \endinput
\ No newline at end of file diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index b782b31a07..8d36def78a 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,6 +1,6 @@ -## Babel 24.9 +## Babel 24.10 -2024-08-29 +2024-09-18 `babel` is the multilingual framework for localizing documents in LaTeX, LuaLaTeX, XeLaTeX. It manages culturally-determined @@ -10,9 +10,9 @@ languages even work with Plain formats. The latest stable version is available on <https://ctan.org/pkg/babel>. -Changes in version 24.9 are described in: +Changes in version 24.10 are described in: -https://latex3.github.io/babel/news/whats-new-in-babel-24.9.html +https://latex3.github.io/babel/news/whats-new-in-babel-24.10.html Apart from the manual, you can find information on some aspects of babel at: @@ -48,9 +48,11 @@ respective authors. ### Summary of latest changes ``` -24.9 2024-08-29 - * New transform 'digits.native' (alternative to `mapdigits'). - * Tentative transforms for CJK spacing and line breaking. +24.10 2024-09-18 + * \localename replaces the buggy \languagename. Added + \mainlocalename. + * \babelhyphenmins for better control of those parameters and, + in lualatex, \hyphenationmin. ``` ### Previous changes diff --git a/macros/latex/required/babel/base/babel-code.pdf b/macros/latex/required/babel/base/babel-code.pdf Binary files differindex 8281aac0f5..4d2c31ffb5 100644 --- a/macros/latex/required/babel/base/babel-code.pdf +++ b/macros/latex/required/babel/base/babel-code.pdf diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index 11cb47c561..9c41d0ed27 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}[2024/08/29 v24.9 The Babel package] +\ProvidesFile{babel.dtx}[2024/09/18 v24.10 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -168,7 +168,10 @@ \def\args#1{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\@empty\else#1\vskip1ex\fi\ignorespaces} -\begingroup % Changes to ltxdoc (add <<...>> syntax) +% Changes to doc.sty (add <<...>> syntax) +\def\Module#1{% + \mod@math@codes$\langle${\color{thered}$\mathsf{#1}$}$\rangle$} +\begingroup \catcode`\<\active \catcode`\>\active \gdef\check@plus@etc{% @@ -182,8 +185,8 @@ \fi\fi\fi \bbl@next} \gdef\var@module#1#2#3>>{% - $\langle$\pm@module#2#3>$\rangle$% - \ifx*#2\ $\equiv$\fi} + $\langle$\pm@module#2#3>$\rangle$% + \ifx*#2\ $\equiv$\fi} \endgroup \renewcommand*\l@section[2]{% \ifnum \c@tocdepth >\z@ @@ -281,6 +284,19 @@ guide focuses on internationalization and localization with \LaTeX{} and \pdftex, \xetex{} and \luatex{} with the \babel{} package. There are also some notes on its use with e-Plain and pdf-Plain \TeX. +\item[\sffamily\color{messages}I only need learn the most basic +features.] The first subsections (1.1-1.3) describe the traditional way +of loading a language (with |ldf| files), which is usually all you need. +The alternative way based on |ini| files, which complements the +previous one (it does \textit{not} replace it, although it is still +necessary in some languages), is described below; go to \ref{inifiles}. + +\item[\sffamily\color{messages}I don’t like manuals. I prefer sample + files.] This manual contains lots of examples and tips, but in GitHub + there are many + \href{https://github.com/latex3/babel/tree/master/samples}{sample + files}. + \item[\sffamily\color{messages}What if I’m interested only in the latest changes?] Changes and new features with relation to version 3.8 are highlighted with \New{X.XX}\hspace{-.5em} @@ -312,19 +328,6 @@ maintained separately \item[\sffamily\color{messages}How can I contribute a new language?] See section \ref{contribute} for contributing a language. -\item[\sffamily\color{messages}I only need learn the most basic -features.] The first subsections (1.1-1.3) describe the traditional way -of loading a language (with |ldf| files), which is usually all you need. -The alternative way based on |ini| files, which complements the -previous one (it does \textit{not} replace it, although it is still -necessary in some languages), is described below; go to \ref{inifiles}. - -\item[\sffamily\color{messages}I don’t like manuals. I prefer sample - files.] This manual contains lots of examples and tips, but in GitHub - there are many - \href{https://github.com/latex3/babel/tree/master/samples}{sample - files}. - \item[\sffamily\color{messages}Where is the code?] Run |lualatex --jobname=babel-code \let\babelcode\relax\input{babel.dtx}|. \end{description} @@ -657,6 +660,100 @@ _\foreignlanguage{spanish}{Español}_. for |lubakatanga|). See section \ref{bcp47} for further details. \end{note} +\subsection{Languages supported by \babel{} with \textsf{ldf} files} + +(To be updated.) In the following table most of the languages supported +by \babel{} with and |.ldf| file are listed, together with the names of +the option which you can load \babel\ with for each language. Note this +list is open and the current options may be different. It does not +include |ini| files (see below). Except in a few cases (eg, |ngerman|, +|serbianc|, |acadian|) names are those of the Unicode CLDR (or based on +them). + +\begin{description} +\itemsep=-\parskip +\sffamily +\item[Afrikaans] afrikaans +\item[Azerbaijani] azerbaijani +\item[Basque] basque +\item[Breton] breton +\item[Bulgarian] bulgarian +\item[Catalan] catalan +\item[Croatian] croatian +\item[Czech] czech +\item[Danish] danish +\item[Dutch] dutch +\item[English] english, american (\textit{preferred to} USenglish), british (\textit{preferred to} + UKenglish), canadian, australian, newzealand +\item[Esperanto] esperanto +\item[Estonian] estonian +\item[Finnish] finnish +\item[French] french, acadian +\item[Galician] galician +\item[German] ngerman, naustrian, german, austrian +\item[Greek] greek, polutonikogreek +\item[Hebrew] hebrew +\item[Icelandic] icelandic +\item[Indonesian] indonesian +\item[Interlingua] interlingua +\item[Irish Gaelic] irish +\item[Italian] italian +\item[Latin] latin +\item[Lower Sorbian] lowersorbian +\item[Malay] malay (\textit{preferred to} melayu) +\item[Northern Sami] northernsami +\item[Norwegian] norsk, nynorsk +\item[Polish] polish +\item[Portuguese] portuguese, brazilian +\item[Romanian] romanian +\item[Russian] russian +\item[Scottish Gaelic] scottishgaelic (\textit{preferred to} scottish) +\item[Spanish] spanish +\item[Slovakian] slovak +\item[Slovenian] slovene +\item[Swedish] swedish +\item[Serbian] serbian +\item[Turkish] turkish +\item[Ukrainian] ukrainian +\item[Upper Sorbian] uppersorbian +\item[Welsh] welsh +\end{description} + +There are more languages not listed above, including \textsf{hindi, +thai, thaicjk, latvian, turkmen, magyar, mongolian, romansh, +lithuanian, spanglish, vietnamese, japanese, pinyin, arabic, farsi, +ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}. + +\begin{note} + There are also some deprecated names (a few has been even removed): + \textsf{frenchb} or \textsf{francais}, as well as \textsf{canadien} + (\textsf{french}), \textsf{germanb} (\textsf{german}), + \textsf{bahasa}, \textsf{indon} or \textsf{bahasai} + (\textsf{indonesian}), \textsf{lsorbian} (\textsf{lowersorbian}), + \textsf{bahasam} (\textsf{malay}), \textsf{portuges} + (\textsf{portuguese}), \textsf{brazil} (\textsf{brazilian}), + \textsf{russianb} (\textsf{russian}), \textsf{usorbian} + (\textsf{uppersorbian}), \textsf{vietnam} (\textsf{vietnamese}), + \textsf{samin} (\textsf{northernsami}), \textsf{ukraineb} + (\textsf{ukrainian}). Deprecated names come in many cases from the + times when they had to be shortened to 8 characters. +\end{note} + +Most of them work out of the box, but some may require extra fonts, +encoding files, a preprocessor or even a complete framework (like +\textsf{CJK} or \textsf{luatexja}). For example, if you have got the +\textsf{velthuis/devnag} package, you can create a file with extension +|.dn|: +\begin{verbatim} +\documentclass{article} +\usepackage[hindi]{babel} +\begin{document} +{\dn devaanaa.m priya.h} +\end{document} +\end{verbatim} +Then you preprocess it with |devnag| \m{file}, which creates +\m{file}|.tex|; you can then typeset the latter with \LaTeX. + \subsection{Modifiers} \New{3.9c} The basic behavior of some languages can be modified when @@ -3069,26 +3166,28 @@ page on the news for 3.76 in the \babel{} site for further details. \subsection{Accessing language info} -\Describe{\languagename}{} -The control sequence |\languagename| contains the name of the -current language. +\Describe{\localename}{} +\DescribeOther{\mainlocalename} +\DescribeOther{\languagename} +\New{29.10} The control sequence |\localename| contains the name of the current +locale. This is now the recommended way to retrieve the current +language. In addtion, |\mainlocalename| contains the main language. + +|\languagename| is still used internally, but it is now discouraged at +the user level. \begin{warning} - Due to some internal inconsistencies in catcodes, it should - \textit{not} be used to test its value. Use \textsf{iflang}, by - Heiko Oberdiek. + Due to a bug, which lead to some internal inconsistencies in + catcodes, |\languagename| should \textit{not} be used to test which + is the current language. Rely on |\localename| or, if you still need + |\languagename| for some reason, on \textsf{iflang}, by Heiko Oberdiek. \end{warning} \Describe{\iflanguage}{\marg{language}\marg{true}\marg{false}} -If more than one language is used, it might be necessary to know which -language is active at a specific time. This can be checked by a call -to |\iflanguage|, but note here ``language'' is used in the \TeX{} -sense, as a set of hyphenation patterns, and \textit{not} as its -\textsf{babel} name. This macro takes three arguments. The first -argument is the name of a language; the second and third arguments are -the actions to take if the result of the test is true or false -respectively. +Here ``language'' is used in the \TeX{} sense, as a set of hyphenation +patterns, and \textit{not} as its \textsf{babel} name. The first +argument is the name of a language. \Describe{\localeinfo}{% \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}{\marg{field}}} @@ -3099,8 +3198,6 @@ expandable, and the available fields are: \begin{description} \itemsep=-\parskip \item[|name.english|] as provided by the Unicode CLDR. -%%% \item[|name.locale|] is the equivalent of |\languagename|. Not yet -%%% activated because the bug in \languagename is far from trivial. \item[|tag.ini|] is the tag of the |ini| file (the way this file is identified in its name). \item[|tag.bcp47|] is the full BCP 47 tag (see the warning below). This @@ -3297,8 +3394,16 @@ font encodings are the same, like in Unicode based engines. \begin{note} Using |\babelhyphenation| with Southeast Asian scripts is mostly pointless. But with |\babelpatterns| (below) you may fine-tune line - breaking (only \luatex). Even if there are no patterns for the - language, you can add at least some typical cases. + breaking (only \luatex). For example: +\begingroup +\catcode`@=13 +\def@#1@{{\fontspec{Loma}#1}} +\begin{verbatim} +\babelpatterns[thai]{@ศึก@2@ษา@} +\end{verbatim} +\endgroup + Even if there are no patterns for the language, you can add at least + some typical cases. \end{note} \begin{note} @@ -3308,21 +3413,6 @@ font encodings are the same, like in Unicode based engines. fully set up and an error can be raised. \end{note} -\Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}} - -The environment \Lenv{hyphenrules} can be used to select \emph{only} the -hyphenation rules to be used (it can be used as command, too). This can -for instance be used to select ‘nohyphenation’, provided that in -\file{language.dat} the ‘language’ \textsf{nohyphenation} is defined by -loading \file{zerohyph.tex}. It deactivates language shorthands, too -(but not user shorthands). - -Except for these simple uses, |hyphenrules| is deprecated and -|otherlanguage*| (the starred version) is preferred, because the former -does not take into account possible changes in encodings of characters -like, say, |'| done by some languages (eg, \textsf{italian}, -\textsf{french}, \textsf{ukrainian}). - \Describe{\babelpatterns}{\texttt{[}\langlist\texttt{]}% \marg{patterns}} @@ -3374,6 +3464,46 @@ range |U+0300|--|U+0367| (which contains combining chars)’. An alternative to a transform is |\babelpatterns|. \end{note} +\Describe{\babelhyphenmins}{% + \colorbox{thegrey}{\ttfamily\hskip-.2em*\hskip-.2em}% + \texttt{[}\langlist\texttt{]}% + \marg{left}\marg{right}\oarg{hyphenationmin}} + +\New{24.10} See the news page for the rationale for this commands. It +sets the corresponding values for the given languages (all languages +without the optional argument). With the star, the values are also +applied immediately (the optional argument and the star are currently +incompatible). The optional argument is available only in \luatex. +\begin{example} +You are typesetting a book with wide lines and want to limit the +number of hyphens in all languages: +\begin{verbatim} + \babelhyphenmins{3}{4} +\end{verbatim} +But there are also some 3-column text and you want to be more flexible: +\begin{verbatim} + \begin{multicols}{3} + \babelhyphenmins*{2}{3} + ... + \end{multicols} +\end{verbatim} +\end{example} + +\Describe{\begin\menv{hyphenrules}}{\marg{language}\Eenv{hyphenrules}} + +The environment \Lenv{hyphenrules} can be used to select \emph{only} the +hyphenation rules to be used (it can be used as command, too). This can +for instance be used to select ‘nohyphenation’, provided that in +\file{language.dat} the ‘language’ \textsf{nohyphenation} is defined by +loading \file{zerohyph.tex}. It deactivates language shorthands, too +(but not user shorthands). + +Except for these simple uses, |hyphenrules| is deprecated and +|otherlanguage*| (the starred version) is preferred, because the former +does not take into account possible changes in encodings of characters +like, say, |'| done by some languages (eg, \textsf{italian}, +\textsf{french}, \textsf{ukrainian}). + \subsection{Transforms} \label{transforms} @@ -4385,99 +4515,6 @@ requiring a command to switch the language. Its default value is |toc,lof,lot|, but you may redefine it with |\renewcommand| (it's up to you to make sure no toc type is duplicated). -\subsection{Languages supported by \babel{} with \textsf{ldf} files} - -In the following table most of the languages supported by \babel{} with -and |.ldf| file are listed, together with the names of the option which -you can load \babel\ with for each language. Note this list is open and -the current options may be different. It does not include |ini| files -(see below). Except in a few cases (eg, |ngerman|, |serbianc|, -|acadian|) names are those of the Unicode CLDR (or based on them). - -\begin{description} -\itemsep=-\parskip -\sffamily -\item[Afrikaans] afrikaans -\item[Azerbaijani] azerbaijani -\item[Basque] basque -\item[Breton] breton -\item[Bulgarian] bulgarian -\item[Catalan] catalan -\item[Croatian] croatian -\item[Czech] czech -\item[Danish] danish -\item[Dutch] dutch -\item[English] english, american (\textit{preferred to} USenglish), british (\textit{preferred to} - UKenglish), canadian, australian, newzealand -\item[Esperanto] esperanto -\item[Estonian] estonian -\item[Finnish] finnish -\item[French] french, acadian -\item[Galician] galician -\item[German] ngerman, naustrian, german, austrian -\item[Greek] greek, polutonikogreek -\item[Hebrew] hebrew -\item[Icelandic] icelandic -\item[Indonesian] indonesian -\item[Interlingua] interlingua -\item[Irish Gaelic] irish -\item[Italian] italian -\item[Latin] latin -\item[Lower Sorbian] lowersorbian -\item[Malay] malay (\textit{preferred to} melayu) -\item[Northern Sami] northernsami -\item[Norwegian] norsk, nynorsk -\item[Polish] polish -\item[Portuguese] portuguese, brazilian -\item[Romanian] romanian -\item[Russian] russian -\item[Scottish Gaelic] scottishgaelic (\textit{preferred to} scottish) -\item[Spanish] spanish -\item[Slovakian] slovak -\item[Slovenian] slovene -\item[Swedish] swedish -\item[Serbian] serbian -\item[Turkish] turkish -\item[Ukrainian] ukrainian -\item[Upper Sorbian] uppersorbian -\item[Welsh] welsh -\end{description} - -There are more languages not listed above, including \textsf{hindi, -thai, thaicjk, latvian, turkmen, magyar, mongolian, romansh, -lithuanian, spanglish, vietnamese, japanese, pinyin, arabic, farsi, -ibygreek, bgreek, serbianc, frenchle, ethiop} and \textsf{friulan}. - -\begin{note} - There are also some deprecated names (a few has been even removed): - \textsf{frenchb} or \textsf{francais}, as well as \textsf{canadien} - (\textsf{french}), \textsf{germanb} (\textsf{german}), - \textsf{bahasa}, \textsf{indon} or \textsf{bahasai} - (\textsf{indonesian}), \textsf{lsorbian} (\textsf{lowersorbian}), - \textsf{bahasam} (\textsf{malay}), \textsf{portuges} - (\textsf{portuguese}), \textsf{brazil} (\textsf{brazilian}), - \textsf{russianb} (\textsf{russian}), \textsf{usorbian} - (\textsf{uppersorbian}), \textsf{vietnam} (\textsf{vietnamese}), - \textsf{samin} (\textsf{northernsami}), \textsf{ukraineb} - (\textsf{ukrainian}). Deprecated names come in many cases from the - times when they had to be shortened to 8 characters. -\end{note} - -Most of them work out of the box, but some may require extra fonts, -encoding files, a preprocessor or even a complete framework (like -\textsf{CJK} or \textsf{luatexja}). For example, if you have got the -\textsf{velthuis/devnag} package, you can create a file with extension -|.dn|: -\begin{verbatim} -\documentclass{article} -\usepackage[hindi]{babel} -\begin{document} -{\dn devaanaa.m priya.h} -\end{document} -\end{verbatim} -Then you preprocess it with |devnag| \m{file}, which creates -\m{file}|.tex|; you can then typeset the latter with \LaTeX. - \subsection{Unicode character properties in \luatex} \New{3.32} Part of the \babel{} job is to apply Unicode rules to some @@ -4616,38 +4653,6 @@ some languages (kerning and spacing). Ligatures can be disabled. \item[zhspacing] Spacing for CJK documents in \xetex. \end{description} -\subsection{Current and future work} - -The current work is focused on the so-called complex scripts in \luatex{}. -In 8-bit engines, \babel{} provided a basic support for bidi text as -part of the style for Hebrew, but it is somewhat unsatisfactory and -internally replaces some hardwired commands by other hardwired commands -(generic changes would be much better). - -Useful additions would be, for example, time, currency, addresses and -personal names.\footnote{See for example POSIX, ISO 14652 and the -Unicode Common Locale Data Repository (CLDR). Those systems, however, -have limited application to \TeX\ because their aim is just to display -information and not fine typesetting.}. But that is the easy -part, because they don't require modifying the \LaTeX{} internals. -Calendars (Arabic, Persian, Indic, etc.) are under study. - -Also interesting are differences in the sentence structure or related -to it. For example, in Basque the number precedes the name (including -chapters), in Hungarian ``from (1)'' is ``(1)-b\H{o}l'', but ``from -(3)'' is ``(3)-b\'{o}l'', in Spanish an item labelled -``3.$^{\textrm{\scriptsize o}}$'' may be referred to as either -``\'{\i}tem 3.$^{\textrm{\scriptsize o}}$'' or -``3.$^{\textrm{\scriptsize er}}$ \'{\i}tem'', and so on. - -An option to manage bidirectional document layout in \luatex{} (lists, -footnotes, etc.) is almost finished, but \xetex{} required more work. -Unfortunately, proper support for \xetex{} requires patching somehow -lots of macros and packages (and some issues related to |\special|s -remain, like color and hyperlinks), so \babel{} resorts to the -\textsf{bidi} package (by Vafa Khalighi). See the \babel{} repository -for a small example (|xe-bidi|). - \subsection{Tentative and experimental code} See the code section for |\foreignlanguage*| (a new starred @@ -5507,8 +5512,8 @@ wouldn’t exist. % \section{Tools} % % \begin{macrocode} -%<<version=24.9>> -%<<date=2024/08/29>> +%<<version=24.10>> +%<<date=2024/09/18>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -6070,7 +6075,7 @@ wouldn’t exist. #1\ifx\@empty#2\else,\bbl@afterfi\bbl@tempb#2\fi}% \def\bbl@tempe#1=#2\@@{% \bbl@csarg\edef{mod@#1}{\bbl@tempb#2}} -\def\bbl@tempd#1.#2\@nnil{% TODO. Refactor lists? +\def\bbl@tempd#1.#2\@nnil{% \ifx\@empty#2% \edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1}% \else @@ -6079,7 +6084,7 @@ wouldn’t exist. \edef\bbl@tempc{% \ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.\bbl@tempb#2}% \else - \in@{$modifiers$}{$#1$}% TODO. Allow spaces. + \in@{$modifiers$}{$#1$}% \ifin@ \bbl@tempe#2\@@ \else @@ -6316,7 +6321,7 @@ wouldn’t exist. \endinput\fi % Same line! <@Make sure ProvidesFile is defined@> \ProvidesFile{babel.def}[<@date@> v<@version@> Babel common definitions] -\ifx\AtBeginDocument\@undefined % TODO. change test. +\ifx\AtBeginDocument\@undefined <@Emulate LaTeX@> \fi <@Basic macros@> @@ -6454,12 +6459,13 @@ wouldn’t exist. \fi \fi\fi} \let\bbl@initoload\relax -%<-core> +%</package|core> +%<*package> \def\bbl@provide@locale{% \ifx\babelprovide\@undefined \bbl@error{base-on-the-fly}{}{}{}% \fi - \let\bbl@auxname\languagename % Still necessary. TODO + \let\bbl@auxname\languagename % Still necessary. \bbl@ifunset{bbl@bcp@map@\languagename}{}% Move uplevel?? {\edef\languagename{\@nameuse{bbl@bcp@map@\languagename}}}% \ifbbl@bcpallowed @@ -6483,7 +6489,8 @@ wouldn’t exist. {\bbl@exp{\\\babelprovide[\bbl@autoload@options]{\languagename}}}% {}% \fi} -%<+core> +%</package> +%<*package|core> % \end{macrocode} % % \begin{macro}{\iflanguage} @@ -6700,30 +6707,8 @@ wouldn’t exist. % \begin{macrocode} \def\BabelContentsFiles{toc,lof,lot} \def\bbl@set@language#1{% from selectlanguage, pop@ - % The old buggy way. Preserved for compatibility. - \edef\languagename{% - \ifnum\escapechar=\expandafter`\string#1\@empty - \else\string#1\@empty\fi}% - \ifcat\relax\noexpand#1% - \expandafter\ifx\csname date\languagename\endcsname\relax - \edef\languagename{#1}% - \let\localename\languagename - \else - \bbl@info{Using '\string\language' instead of 'language' is\\% - deprecated. If what you want is to use a\\% - macro containing the actual locale, make\\% - sure it does not not match any language.\\% - Reported}% - \ifx\scantokens\@undefined - \def\localename{??}% - \else - \scantokens\expandafter{\expandafter - \def\expandafter\localename\expandafter{\languagename}}% - \fi - \fi - \else - \def\localename{#1}% This one has the correct catcodes - \fi + % The old buggy way. Preserved for compatibility, but simplified + \edef\languagename{\expandafter\string#1\@empty}% \select@language{\languagename}% % write to auxs \expandafter\ifx\csname date\languagename\endcsname\relax\else @@ -6742,16 +6727,22 @@ wouldn’t exist. % \newif\ifbbl@bcpallowed \bbl@bcpallowedfalse -\def\select@language#1{% from set@, babel@aux +% +\def\select@language#1{% from set@, babel@aux, babel@toc \ifx\bbl@selectorname\@empty \def\bbl@selectorname{select}% - % set hymap \fi + % set hymap \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi - % set name + % set name (when coming from babel@aux) \edef\languagename{#1}% \bbl@fixname\languagename - % TODO. name@map must be here? + % define \localename when coming from set@, with a trick + \ifx\scantokens\@undefined + \def\localename{??}% + \else + \bbl@exp{\\\scantokens{\def\\\localename{\languagename}\\\noexpand}\relax}% + \fi \bbl@provide@locale \bbl@iflanguage\languagename{% \let\bbl@select@type\z@ @@ -6759,7 +6750,7 @@ wouldn’t exist. \def\babel@aux#1#2{% \select@language{#1}% \bbl@foreach\BabelContentsFiles{% \relax -> don't assume vertical mode - \@writefile{##1}{\babel@toc{#1}{#2}\relax}}}% TODO - plain? + \@writefile{##1}{\babel@toc{#1}{#2}\relax}}}% \def\babel@toc#1#2{% \select@language{#1}} % \end{macrocode} @@ -6862,6 +6853,12 @@ wouldn’t exist. \ifin@\else\bbl@xin@{/k}{/\bbl@tempa}\fi % only kashida \ifin@\else\bbl@xin@{/p}{/\bbl@tempa}\fi % padding (eg, Tibetan) \ifin@\else\bbl@xin@{/v}{/\bbl@tempa}\fi % variable font + % hyphenation - save mins + \babel@savevariable\lefthyphenmin + \babel@savevariable\righthyphenmin + \ifnum\bbl@engine=\@ne + \babel@savevariable\hyphenationmin + \fi \ifin@ % unhyphenated/kashida/elongated/padding = allow stretching \language\l@unhyphenated @@ -6873,16 +6870,18 @@ wouldn’t exist. % other = select patterns \bbl@patterns{#1}% \fi - % hyphenation - mins - \babel@savevariable\lefthyphenmin - \babel@savevariable\righthyphenmin + % hyphenation - set mins \expandafter\ifx\csname #1hyphenmins\endcsname\relax \set@hyphenmins\tw@\thr@@\relax + \@nameuse{bbl@hyphenmins@}% \else \expandafter\expandafter\expandafter\set@hyphenmins \csname #1hyphenmins\endcsname\relax \fi - % reset selector name + \@nameuse{bbl@hyphenmins@}% + \@nameuse{bbl@hyphenmins@\languagename}% + \@nameuse{bbl@hyphenatmin@}% + \@nameuse{bbl@hyphenatmin@\languagename}% \let\bbl@selectorname\@empty} % \end{macrocode} % @@ -7026,6 +7025,7 @@ wouldn’t exist. \bbl@usedategroupfalse \fi \bbl@fixname\languagename + \let\localename\languagename % TODO. name@map here? \bbl@provide@locale \bbl@iflanguage\languagename{% @@ -7634,7 +7634,7 @@ wouldn’t exist. % code of the @-sign. % % \begin{macrocode} -\def\bbl@afterldf#1{% TODO. Merge into the next macro? Unused elsewhere +\def\bbl@afterldf#1{% \bbl@afterlang \let\bbl@afterlang\relax \let\BabelModifiers\relax @@ -7668,7 +7668,9 @@ wouldn’t exist. % \begin{macrocode} \def\main@language#1{% \def\bbl@main@language{#1}% - \let\languagename\bbl@main@language % TODO. Set localename + \let\languagename\bbl@main@language + \let\localename\bbl@main@language + \let\mainlocalename\bbl@main@language \bbl@id@assign \bbl@patterns{\languagename}} % \end{macrocode} @@ -7677,8 +7679,7 @@ wouldn’t exist. % beginning of the document, either when the |aux| file is read or, if % it does not exist, when the |\AtBeginDocument| is executed. Languages % do not set |\pagedir|, so we set here for the whole document to the -% main |\bodydir|. TODO. Handle correctly the 'nil' language, to avoid -% errors in toc files if there was a typo in a name. +% main |\bodydir|. % % The code written to the |aux| file attempts to avoid errors if % \babel\ is removed from the document. @@ -7699,7 +7700,8 @@ wouldn’t exist. \immediate\write\@mainaux{\string\@nameuse{bbl@beforestart}}% \fi \expandafter\selectlanguage\expandafter{\bbl@main@language}% -%<-core> +%</package|core> +%<*package> \ifx\bbl@normalsf\@empty \ifnum\sfcode`\.=\@m \let\normalsfcodes\frenchspacing @@ -7709,19 +7711,22 @@ wouldn’t exist. \else \let\normalsfcodes\bbl@normalsf \fi -%<+core> +%</package> +%<*package|core> \ifbbl@single % must go after the line above. \renewcommand\selectlanguage[1]{}% \renewcommand\foreignlanguage[2]{#2}% \global\let\babel@aux\@gobbletwo % Also as flag \fi} -%<-core> +%</package|core> +%<*package> \AddToHook{begindocument/before}{% \let\bbl@normalsf\normalsfcodes \let\normalsfcodes\relax} % Hack, to delay the setting -%<+core> +%</package>% +%<*package|core> \ifcase\bbl@engine\or - \AtBeginDocument{\pagedir\bodydir} % TODO - a better place + \AtBeginDocument{\pagedir\bodydir} \fi % \end{macrocode} % @@ -8079,7 +8084,7 @@ wouldn’t exist. % % \begin{macrocode} \begingroup -\bbl@ifunset{ifincsname}% TODO. Ugly. Correct? Only Plain? +\bbl@ifunset{ifincsname}% {\gdef\active@prefix#1{% \ifx\protect\@typeset@protect \else @@ -8262,7 +8267,7 @@ wouldn’t exist. % % \begin{macrocode} \def\user@group{user} -\def\language@group{english} % TODO. I don't like defaults +\def\language@group{english} \def\system@group{system} % \end{macrocode} % @@ -8337,7 +8342,6 @@ wouldn’t exist. % used. Unfortunately, \babel{} currently does not keep track of % defined groups, and therefore there is no way to catch a possible % change in casing to fix it in the same way languages names are fixed. -% [TODO]. % % \begin{macrocode} \def\languageshorthands#1{\def\language@group{#1}} @@ -8897,6 +8901,32 @@ wouldn’t exist. % % \end{macro} % +% \begin{macro}{\babelhyphenmins} +% +% Only \LaTeX (basically because it’s defined with a \LaTeX{} tool). +% +% \begin{macrocode} +\ifx\NewDocumentCommand\@undefined\else + \NewDocumentCommand\babelhyphenmins{sommo}{% + \IfNoValueTF{#2}% + {\protected@edef\bbl@hyphenmins@{\set@hyphenmins{#3}{#4}}% + \IfValueT{#5}{% + \protected@edef\bbl@hyphenatmin@{\hyphenationmin=#5\relax}}% + \IfBooleanT{#1}{% + \lefthyphenmin=#3\relax + \righthyphenmin=#4\relax + \IfValueT{#5}{\hyphenationmin=#5\relax}}}% + {\edef\bbl@tempb{\zap@space#2 \@empty}% + \bbl@for\bbl@tempa\bbl@tempb{% + \@namedef{bbl@hyphenmins@\bbl@tempa}{\set@hyphenmins{#3}{#4}}% + \IfValueT{#5}{% + \@namedef{bbl@hyphenatmin@\bbl@tempa}{\hyphenationmin=#5\relax}}}% + \IfBooleanT{#1}{\bbl@error{hyphenmins-args}{}{}{}}}} +\fi +% \end{macrocode} +% +% \end{macro} +% % \begin{macro}{\bbl@allowhyphens} % % This macro makes hyphenation possible. Basically its definition @@ -9228,7 +9258,7 @@ wouldn’t exist. \csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}} % \end{macrocode} % -% A little auxiliary command sets the string. TODO: Formerly used with +% A little auxiliary command sets the string. Formerly used with % casing. Very likely no longer necessary, although it’s used in % |\setlocalecaption|. % @@ -9362,7 +9392,7 @@ wouldn’t exist. % separates these two steps. % % \begin{macrocode} -\newcommand\setlocalecaption{% TODO. Catch typos. +\newcommand\setlocalecaption{% \@ifstar\bbl@setcaption@s\bbl@setcaption@x} \def\bbl@setcaption@x#1#2#3{% language caption-name string \bbl@trim@def\bbl@tempa{#2}% @@ -9416,7 +9446,6 @@ wouldn’t exist. \bbl@toglobal\bbl@captionslist \fi \fi} -% \def\bbl@setcaption@s#1#2#3{} % TODO. Not yet implemented (w/o 'name') % \end{macrocode} % % \subsection{Macros common to a number of languages} @@ -9889,7 +9918,8 @@ wouldn’t exist. % \begin{macrocode} \bbl@trace{Bidi layout} \providecommand\IfBabelLayout[3]{#3}% -%<-core> +%</package|core> +%<*package> \newcommand\BabelPatchSection[1]{% \@ifundefined{#1}{}{% \bbl@exp{\let\<bbl@ss@#1>\<#1>}% @@ -9923,7 +9953,8 @@ wouldn’t exist. \select@language@x{\bbl@main@language}}}{} \IfBabelLayout{captions}% {\BabelPatchSection{caption}}{} -%<+core> +%</package> +%<*package|core> % \end{macrocode} % % \subsection{Load engine specific macros} @@ -10028,7 +10059,7 @@ wouldn’t exist. {}% \let\bbl@KVP@date\@empty \fi - \let\bbl@KVP@captions@@\bbl@KVP@captions % TODO. A dirty hack + \let\bbl@KVP@captions@@\bbl@KVP@captions \ifx\bbl@KVP@captions\@nnil \let\bbl@KVP@captions\bbl@KVP@import \fi @@ -10123,7 +10154,6 @@ wouldn’t exist. \fi \bbl@exp{\\\bbl@add\\\bbl@starthyphens {\\\bbl@patterns@lua{\languagename}}}% - % TODO - error/warning if no script \directlua{ if Babel.script_blocks['\bbl@cl{sbcp}'] then Babel.loc_to_scr[\the\localeid] = Babel.script_blocks['\bbl@cl{sbcp}'] @@ -10194,7 +10224,7 @@ wouldn’t exist. \bbl@csarg\edef{intsp@#2}{\bbl@KVP@intraspace}% \fi \bbl@provide@intraspace - % == Line breaking: CJK quotes == TODO -> @extras + % == Line breaking: CJK quotes == \ifcase\bbl@engine\or \bbl@xin@{/c}{/\bbl@cl{lnbrk}}% \ifin@ @@ -10430,7 +10460,7 @@ wouldn’t exist. % Load the basic parameters (ids, typography, counters, and a few % more), while captions and dates are left out. But it may happen some % data has been loaded before automatically, so we first discard the -% saved values. (TODO. But preserving previous values would be useful.) +% saved values. % % \begin{macrocode} \def\bbl@load@basic#1{% @@ -12427,23 +12457,30 @@ wouldn’t exist. % \end{macrocode} % % Now come the macros used to set the direction when a language is -% switched. First the (mostly) common macros. +% switched. Testing are based on script names, because it’s the user +% interface (including |language| and |script| in |\babelprovide|. +% First the (mostly) common macros. % % \begin{macrocode} \bbl@trace{Macros to switch the text direction} +\def\bbl@alscripts{,Arabic,Syriac,Thaana,} +\def\bbl@rscripts{% + ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,% + Old Hungarian,Lydian,Mandaean,Manichaean,% + Meroitic Cursive,Meroitic,Old North Arabian,% + Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,% + Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,% + Old South Arabian,}% \def\bbl@provide@dirs#1{% - \bbl@xin@{\csname bbl@sbcp@#1\endcsname}{,Arab,Syrc,Thaa,}% + \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}% \ifin@ - \global\bbl@csarg\chardef{wdir@#1}\tw@ - \else - \bbl@xin@{\csname bbl@sbcp@#1\endcsname}{% - ,Armi,Avst,Cprt,Hatr,Hebr,Hung,Lydi,Mand,Mani,Merc,Mero,% - Narb,Nbat,Nkoo,Orkh,Palm,Phli,Phlp,Phnx,Prti,Samr,Sarb,}% + \global\bbl@csarg\chardef{wdir@#1}\@ne + \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts}% \ifin@ - \global\bbl@csarg\chardef{wdir@#1}\@ne - \else - \global\bbl@csarg\chardef{wdir@#1}\z@ + \global\bbl@csarg\chardef{wdir@#1}\tw@ \fi + \else + \global\bbl@csarg\chardef{wdir@#1}\z@ \fi \ifodd\bbl@engine \bbl@csarg\ifcase{wdir@#1}% @@ -12954,19 +12991,19 @@ wouldn’t exist. {This macro is available only in LuaLaTeX and XeLaTeX.}% {Consider switching to these engines.} \bbl@errmessage{only-lua} - {This macro is available only in LuaLaTeX.}% + {This macro is available only in LuaLaTeX}% {Consider switching to that engine.} \bbl@errmessage{unknown-provide-key} {Unknown key '#1' in \string\babelprovide}% {See the manual for valid keys}% \bbl@errmessage{unknown-mapfont} {Option '\bbl@KVP@mapfont' unknown for\\% - mapfont. Use 'direction'.}% + mapfont. Use 'direction'}% {See the manual for details.} \bbl@errmessage{no-ini-file} {There is no ini file for the requested language\\% (#1: \languagename). Perhaps you misspelled it or your\\% - installation is not complete.}% + installation is not complete}% {Fix the name or reinstall babel.} \bbl@errmessage{digits-is-reserved} {The counter name 'digits' is reserved for mapping\\% @@ -12974,7 +13011,7 @@ wouldn’t exist. {Use another name.} \bbl@errmessage{limit-two-digits} {Currently two-digit years are restricted to the\\ - range 0-9999.}% + range 0-9999}% {There is little you can do. Sorry.} \bbl@errmessage{alphabetic-too-large} {Alphabetic numeral too large (#1)}% @@ -12986,20 +13023,20 @@ wouldn’t exist. {See the manual for details.} \bbl@errmessage{unknown-ini-field} {Unknown field '#1' in \string\BCPdata.\\% - Perhaps you misspelled it.}% + Perhaps you misspelled it}% {See the manual for details.} \bbl@errmessage{unknown-locale-key} {Unknown key for locale '#2':\\% #3\\% - \string#1 will be set to \relax}% + \string#1 will be set to \string\relax}% {Perhaps you misspelled it.}% \bbl@errmessage{adjust-only-vertical} {Currently, #1 related features can be adjusted only\\% - in the main vertical list.}% + in the main vertical list}% {Maybe things change in the future, but this is what it is.} \bbl@errmessage{layout-only-vertical} {Currently, layout related features can be adjusted only\\% - in vertical mode.}% + in vertical mode}% {Maybe things change in the future, but this is what it is.} \bbl@errmessage{bidi-only-lua} {The bidi method 'basic' is available only in\\% @@ -13029,11 +13066,11 @@ wouldn’t exist. {See the manual for further info} \bbl@errmessage{unknown-interchar} {'#1' for '\languagename' cannot be enabled.\\% - Maybe there is a typo.}% + Maybe there is a typo}% {See the manual for further details.} \bbl@errmessage{unknown-interchar-b} {'#1' for '\languagename' cannot be disabled.\\% - Maybe there is a typo.}% + Maybe there is a typo}% {See the manual for further details.} \bbl@errmessage{charproperty-only-vertical} {\string\babelcharproperty\space can be used only in\\% @@ -13068,7 +13105,11 @@ wouldn’t exist. {The '#1' ldf style doesn't work with #2,\\% but you can use the ini locale instead.\\% Try adding 'provide=*' to the option list. You may\\% - also want to set 'bidi=' to some value.}% + also want to set 'bidi=' to some value}% + {See the manual for further details.} +\bbl@errmessage{hyphenmins-args} + {\string\babelhyphenmins\ accepts either the optional\\% + argument or the star, but not both at the same time}% {See the manual for further details.} %</errors> %<*patterns> diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index ed0700bf08..e9ab76ac2f 100644 --- a/macros/latex/required/babel/base/babel.ins +++ b/macros/latex/required/babel/base/babel.ins @@ -26,7 +26,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %% -\def\filedate{2024/08/29} +\def\filedate{2024/09/18} \def\batchfile{babel.ins} \input docstrip.tex @@ -105,32 +105,6 @@ \expandafter\gdef\csname #1Var\endcsname{#2}% \fi} -% The following is somewhat hackish, but it does the job for babel, and -% must be used in the following way: <-name> starts a block to be -% ignored if 'name' is active, and <+name> ends the block (in this -% order). Used to exclude some parts from babel.def. With the original -% definitions, some code goes 'visually' in comments/documentation, but -% with this change they are in the real code. However, it must be -% considered temporal, because the solution must be to reorganize the -% code. - -\let\bblMinus\minusOption -\def\minusOption-#1>#2\endLine{% - \global\let\bblactivefiles\activefiles - \def\tempa{}% - \def\do##1##2##3{% - \def\tempb{#1}\def\tempc{##2}% - \ifx\tempb\tempc\else - \expandafter\def\expandafter\tempa\expandafter{% - \tempa\do##1{##2}##3}% - \fi}% - \activefiles - \let\activefiles\tempa} - -\let\bblPlus\plusOption -\def\plusOption+#1>#2\endLine{% - \let\activefiles\bblactivefiles} - % Preambles \declarepreamble\mainpreamble @@ -179,11 +153,30 @@ \file{bplain.tex}{\from{babel.dtx}{bplain}} \file{blplain.tex}{\from{babel.dtx}{blplain}} } + +% MakeIndex style files + +\usedir{makeindex/babel} + +\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}} + \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}} + +% lua code + +\def\MetaPrefix{--} +\usepreamble\luapreamble +\nopostamble +\generate{\file{babel-transforms.lua}{\from{babel.dtx}{transforms}}} +\generate{\file{babel-data-bidi.lua}{\from{babel.dtx}{bididata}}} +\generate{\file{babel-data-cjk.lua}{\from{babel.dtx}{cjkdata}}} +\generate{\file{babel-bidi-basic-r.lua}{\from{babel.dtx}{basic-r}}} +\generate{\file{babel-bidi-basic.lua}{\from{babel.dtx}{basic}}} -% compatibility files +% Compatibility files \let\minusOption\bblMinus \let\plusOption\bblPlus + \def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{styfile,#1}}} \generate{% @@ -246,23 +239,6 @@ \compatfile{bahasam} } -% MakeIndex style files - -\usedir{makeindex/babel} - -\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}} - \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}} - -% lua code - -\def\MetaPrefix{--} -\usepreamble\luapreamble -\nopostamble -\generate{\file{babel-transforms.lua}{\from{babel.dtx}{transforms}}} -\generate{\file{babel-data-bidi.lua}{\from{babel.dtx}{bididata}}} -\generate{\file{babel-data-cjk.lua}{\from{babel.dtx}{cjkdata}}} -\generate{\file{babel-bidi-basic-r.lua}{\from{babel.dtx}{basic-r}}} -\generate{\file{babel-bidi-basic.lua}{\from{babel.dtx}{basic}}} \Msg{***********************************************************} \Msg{*} diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf Binary files differindex 697e810aa5..6998a9a393 100644 --- a/macros/latex/required/babel/base/babel.pdf +++ b/macros/latex/required/babel/base/babel.pdf diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx index deca42e038..c7323d52c9 100644 --- a/macros/latex/required/babel/base/bbcompat.dtx +++ b/macros/latex/required/babel/base/bbcompat.dtx @@ -30,7 +30,7 @@ % % \iffalse %<*dtx> -\ProvidesFile{bbcompat.dtx}[2024/08/29 v24.] +\ProvidesFile{bbcompat.dtx}[2024/09/18 v24.] %</dtx> % %% File 'bbcompat.dtx' |