summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-29 03:03:01 +0000
committerNorbert Preining <norbert@preining.info>2020-04-29 03:03:01 +0000
commit817ecb96eab4ed6494ddb6b8d0f17c2947a91196 (patch)
treee224845d8908ce3e353eee67b768525a2f65097a /macros
parent7f8fffa1c8b5b30f8e2a9fd4b76778147dbb9128 (diff)
CTAN sync 202004290303
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/abnt/README.md2
-rw-r--r--macros/latex/contrib/abnt/abnt-doc.pdfbin116620 -> 119879 bytes
-rw-r--r--macros/latex/contrib/abnt/abnt-doc.tex36
-rw-r--r--macros/latex/contrib/abnt/abnt.sty113
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/README.md5
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.dtx64
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.pdfbin570495 -> 307158 bytes
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.jpgbin142066 -> 0 bytes
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.pdfbin0 -> 37045 bytes
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/img/texografie-logo.pdfbin0 -> 14903 bytes
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/img/texografie.pngbin85677 -> 0 bytes
-rw-r--r--macros/latex/contrib/hu-berlin-bundle/makefile4
-rw-r--r--macros/latex/contrib/tcolorbox/CHANGES34
-rw-r--r--macros/latex/contrib/tcolorbox/README4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbbreakable.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex659
-rw-r--r--macros/latex/contrib/tcolorbox/tcbexternal.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbfitting.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbhooks.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistings.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistingscore.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex19
-rw-r--r--macros/latex/contrib/tcolorbox/tcbmagazine.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbminted.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbposter.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbprocessing.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbraster.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbskins.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbtheorems.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbvignette.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbxparse.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdfbin273844 -> 273848 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example.pdfbin457482 -> 457493 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example.tex7
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdfbin442454 -> 442583 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.abstract.tex3
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.beamer.tex1
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.bib118
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.breakable.tex8
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex13
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.documentation.tex1111
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.filling.tex48
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.fitting.tex51
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.hooks.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.initoptions.tex3
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.intro.tex21
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex35
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex18
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty65
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.skins.tex18
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.vignette.tex9
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.pdfbin7054767 -> 7151414 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.sty29
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.tex22
-rw-r--r--macros/latex/contrib/translations/README2
-rw-r--r--macros/latex/contrib/translations/translations.sty27
-rw-r--r--macros/latex/contrib/translations/translations_en.pdfbin500141 -> 500132 bytes
-rw-r--r--macros/latex/contrib/translations/translations_en.tex2
-rw-r--r--macros/latex/required/babel/base/README.md43
-rw-r--r--macros/latex/required/babel/base/babel.dtx5393
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin768198 -> 773032 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
66 files changed, 4608 insertions, 3489 deletions
diff --git a/macros/latex/contrib/abnt/README.md b/macros/latex/contrib/abnt/README.md
index 9903f258c1..28a27ccf94 100644
--- a/macros/latex/contrib/abnt/README.md
+++ b/macros/latex/contrib/abnt/README.md
@@ -2,7 +2,7 @@
This package implements rules to typeset Brazilian academic texts.
-Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2019
+Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2020.
This file is part of the abnt LaTeX2e package.
This work may be distributed and/or modified under the conditions of
diff --git a/macros/latex/contrib/abnt/abnt-doc.pdf b/macros/latex/contrib/abnt/abnt-doc.pdf
index 4a46b94fb2..3b82b51321 100644
--- a/macros/latex/contrib/abnt/abnt-doc.pdf
+++ b/macros/latex/contrib/abnt/abnt-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/abnt/abnt-doc.tex b/macros/latex/contrib/abnt/abnt-doc.tex
index 4b19c0e001..389bd6c5ea 100644
--- a/macros/latex/contrib/abnt/abnt-doc.tex
+++ b/macros/latex/contrib/abnt/abnt-doc.tex
@@ -28,7 +28,7 @@
\title{\tikz \node[inner sep=0pt,remember picture,overlay] at (0,1){\includegraphics[height=3cm,width=0.4\textwidth,keepaspectratio]{icone}};\\O pacote <<\texttt{abnt}>>}
\author{Youssef Cherem}
-\date{2019}
+\date{2020}
\begin{document}
\frenchspacing
@@ -107,12 +107,31 @@ within=none]{escultura}
Aqui, definimos um novo ambiente “escultura”, com um arquivo de lista de extensão \texttt{loe} e nome “Lista de Figuras”, cujo contador não recomeça em todos os capítulos (\texttt{within=none}). \verb|\l@escultura| serve para redefinir os espaços na lista. Para alternativas de formatação, referir-se à documentação dos pacotes \texttt{newfloat} e \texttt{caption}.
+Uma alternativa simplificada para essas definições está disponível ao utilizar uma das classes \tcboxverb[blank,fuzzy halo=.5mm with red]{KOMA-Script} (\texttt{scrbook}, \texttt{scrartcl} e \texttt{scrreport}):
+
+\begin{codigo}{}
+\DeclareNewTOC[%
+type=exercicio,%
+types=exercicios,%
+float,% define a floating environment
+floattype=4,%
+name=Exercício,%
+%counterwithin=chapter,
+listname={Lista de Exercícios},
+%tocentryindent=0pt,% <- added
+tocentrydynnumwidth,% <- added
+tocentrynumsep=0pt% <- added
+]{loe}
+\setuptoc{loe}{chapteratlist}
+
+\BeforeStartingTOC[loe]{\def\autodot{\hfill~--~\hfill}}
+\end{codigo}
+
+
Todos os outros comandos são os usuais das classes padrão. Recomenda-se o uso do pacote \texttt{biblatex-abnt} para as normas de citação e referências bibliográficas segundo a ABNT.
-Se o usuário necessitar alterações, uma das formas mais simples é usar os comandos das classes
-\tcboxverb[blank,fuzzy halo=.5mm with red]{KOMA-Script}:
- \begin{codigo}{}
+ \begin{codigo}{Exemplo com a classe scrbook}
\documentclass[footsepline=true,headsepline=true]{scrbook}
\usepackage{abnt}
\usepackage{xcolor,xcolor-material}
@@ -132,17 +151,20 @@ Se o usuário necessitar alterações, uma das formas mais simples é usar os co
\setkomafont{headsepline}{\color{teal!50!yellow}}
\setkomafont{pagenumber}{\normalfont\bfseries\sffamily\color{red}}
-\renewcommand*{\chapterpagestyle}{scrheadings} %not needed
+%\renewcommand*{\chapterpagestyle}{scrheadings} %não necessário - já implementado
+%todos esses elementos iguais
\RedeclareSectionCommands
[beforeskip=\baselineskip, afterskip=\baselineskip,font=\normalsize\bfseries]
{part,chapter,
-section,subsection,paragraph,subparagraph}
+section,subsection,subsubsection}
+
\setkomafont{chapter}{\color{orange}} \setkomafont{section}{\color{teal}}
\setkomafont{subsection}{\color{green!50!black}}
- %\setkomafont{disposition}{\normalsize} %doesn't work
+ %\setkomafont{disposition}{\normalsize} % não funciona, redefinição com
+ %\RedeclareSectionCommand ou \RedeclareSectionCommands
\KOMAoptions{headsepline=2pt:\textwidth,footsepline=2pt:\textwidth}
diff --git a/macros/latex/contrib/abnt/abnt.sty b/macros/latex/contrib/abnt/abnt.sty
index d3cdd42b4b..a29009e1ad 100644
--- a/macros/latex/contrib/abnt/abnt.sty
+++ b/macros/latex/contrib/abnt/abnt.sty
@@ -1,5 +1,5 @@
%% abnt.sty
-%% Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2019
+%% Copyright (c) Youssef Cherem <ycherem(at)gmail.com>, 2020
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -9,12 +9,12 @@
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
-% This work has the LPPL maintenance status `maintained'.
+% This work has the LPPL maintenance status `author-maintained'.
%
% The Current Maintainer of this work is Youssef Cherem.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{abnt}[2019/12/14]
+\ProvidesPackage{abnt}[2020/04/14]
\RequirePackage[left=3cm,top=3cm,right=2cm,bottom=2cm]{geometry}
\RequirePackage{setspace}
\RequirePackage[automark,markcase=used]{scrlayer-scrpage}
@@ -55,42 +55,13 @@
}}
-
-
-\RequirePackage{newfloat}
-\DeclareFloatingEnvironment[fileext=lom,listname={Lista de mapas},within=none]{mapa}
-\DeclareFloatingEnvironment[fileext=loq,listname={Lista de quadros},within=none]{quadro}
-
-\RequirePackage{caption}
-
-%\DeclareCaptionListFormat{list}{#1#2~--}
-%\DeclareCaptionListFormat{list}{#1#2~--}
-\DeclareCaptionListFormat{listafigura}{\figurename\ #1#2\hfill--\hfill}%\hfill--\hfill
-\DeclareCaptionListFormat{listamapa}{\mapaname\ #1#2\hfill--\hfill}
-\DeclareCaptionListFormat{listaquadro}{\quadroname\ #1#2\hfill--\hfill}
-\DeclareCaptionListFormat{listatabela}{\tablename\ #1#2\hfill--\hfill}
-\captionsetup[figure]{listformat=listafigura}
-\captionsetup[mapa]{listformat=listamapa}
-\captionsetup[quadro]{listformat=listaquadro}
-\captionsetup[table]{listformat=listatabela}
-\captionsetup{labelsep=endash}
-
\RequirePackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
-
-\renewcommand*{\l@figure}{\@dottedtocline{1}{1.5em}{5.5em}}
-\renewcommand*{\l@table}{\@dottedtocline{1}{1.5em}{5.5em}}
-\renewcommand*{\l@mapa}{\@dottedtocline{1}{1.5em}{5.5em}}
-\renewcommand*{\l@quadro}{\@dottedtocline{1}{1.5em}{6em}}
-%\renewcommand{\p@table}{\tablename~}
-%\renewcommand*{\p@figure}{\figurename~} %=\DeclareCaptionListFormat{listafigura}{\figurename\#1#2~--}
-%\renewcommand*{\p@mapa}{\mapaname~}
-%\renewcommand*{\p@quadro}{\quadroname~}
-
+
+%all with dots, even for non-koma classes
\usepackage{tocbasic}
-
\DeclareTOCStyleEntry[
linefill=\TOCLineLeaderFill,
%entryformat=%\large\textbf,
@@ -142,6 +113,35 @@ linefill=\TOCLineLeaderFill,
\newcommand*{\authorfont}[1]{\gdef\@authorfont{#1}}
\newcommand*{\@datefont}{\normalfont}
\newcommand*{\datefont}[1]{\gdef\@datefont{#1}}
+
+
+%% floating environments
+\RequirePackage{newfloat}
+\DeclareFloatingEnvironment[fileext=lom,listname={Lista de mapas},within=none]{mapa}
+\DeclareFloatingEnvironment[fileext=loq,listname={Lista de quadros},within=none]{quadro}
+
+\RequirePackage{caption}
+
+%\DeclareCaptionListFormat{list}{#1#2~--}
+%\DeclareCaptionListFormat{list}{#1#2~--}
+\DeclareCaptionListFormat{listafigura}{\figurename\ #1#2\hfill--\hfill}%\hfill--\hfill
+\DeclareCaptionListFormat{listamapa}{\mapaname\ #1#2\hfill--\hfill}
+\DeclareCaptionListFormat{listaquadro}{\quadroname\ #1#2\hfill--\hfill}
+\DeclareCaptionListFormat{listatabela}{\tablename\ #1#2\hfill--\hfill}
+\captionsetup[figure]{listformat=listafigura}
+\captionsetup[mapa]{listformat=listamapa}
+\captionsetup[quadro]{listformat=listaquadro}
+\captionsetup[table]{listformat=listatabela}
+\captionsetup{labelsep=endash}
+
+%%% commented on 29/12/19
+%%% for new lists with koma with \DeclareNewTOC, none of this is needed
+\renewcommand*{\l@figure}{\@dottedtocline{1}{1.5em}{5.5em}}
+\renewcommand*{\l@table}{\@dottedtocline{1}{1.5em}{5.5em}}
+\renewcommand*{\l@mapa}{\@dottedtocline{1}{1.5em}{5.5em}}
+\renewcommand*{\l@quadro}{\@dottedtocline{1}{1.5em}{6em}}
+
+
}
{% if koma
\typeout{Usando KOMA-Sript.}
@@ -152,6 +152,49 @@ linefill=\TOCLineLeaderFill,
\newcommand*{\authorfont}[1]{\gdef\@authorfont{#1}}
\renewcommand*{\@datefont}{\normalfont}
\newcommand*{\datefont}[1]{\gdef\@datefont{#1}}
+
+
+%%% floating environments, easier with koma
+
+\DeclareNewTOC[%
+type=mapa,%
+types=mapas,%
+float,% define a floating environment
+floattype=4,%
+name=Mapa,%
+%counterwithin=chapter,
+listname={Lista de Mapas},
+%tocentryindent=0pt,% <- added
+tocentrydynnumwidth,% <- added
+tocentrynumsep=0pt% <- added
+]{lom}
+\setuptoc{lom}{chapteratlist}
+
+\DeclareNewTOC[%
+type=quadro,%
+types=quadros,%
+float,% define a floating environment
+floattype=4,%
+name=Quadro,%
+%counterwithin=chapter,
+listname={Lista de Quadros},
+%tocentryindent=0pt,% <- added
+tocentrydynnumwidth,% <- added
+tocentrynumsep=0pt% <- added
+]{loq}
+\setuptoc{loq}{chapteratlist}
+
+
+%prepagenumber ?
+
+\BeforeStartingTOC[lof]{\def\autodot{\hfill~--~\hfill}}
+\BeforeStartingTOC[lot]{\def\autodot{\hfill~--~\hfill}}
+\BeforeStartingTOC[lom]{\def\autodot{\hfill~--~\hfill}}
+\BeforeStartingTOC[loq]{\def\autodot{\hfill~--~\hfill}}
+
+\KOMAoptions{listof=entryprefix}
+\renewcommand*{\captionformat}{~--~}
+
}
@@ -219,4 +262,4 @@ linefill=\TOCLineLeaderFill,
-\endinput \ No newline at end of file
+\endinput
diff --git a/macros/latex/contrib/hu-berlin-bundle/README.md b/macros/latex/contrib/hu-berlin-bundle/README.md
index 92d36a4a58..b803882b22 100644
--- a/macros/latex/contrib/hu-berlin-bundle/README.md
+++ b/macros/latex/contrib/hu-berlin-bundle/README.md
@@ -67,6 +67,11 @@ All notable changes to this project will be documented in the [README.md](https:
This project **does not** adhere to [Semantic Versioning](http://semver.org/).
The markdown syntax is inspired by the conventions proposed by [keepachangelog.com](http://keepachangelog.com/).
+### v1.0.5 (2020-04-28)
+* (general) Changed logo format to `.pdf`
+* (letter) Changed `\ifkomavarempty` to `\ifkomavarempty`, fixes
+ [github-issue nr. 1](https://github.com/LukasCBossert/hu-berlin-bundle/issues/1)
+
### v1.0.4 (2019-12-19)
* Added `hu-berlin-base.sty` as a package which contains all relevant code for documents and documentclasses of the bundle.
diff --git a/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.dtx b/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.dtx
index 4b064957d1..497c7fedbf 100644
--- a/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.dtx
+++ b/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.dtx
@@ -1,6 +1,6 @@
% \iffalse
%<*internal|cls|sty>
-\def\Version{2019/12/19 v1.0.4}
+\def\Version{2020/04/28 v1.0.5}
%</internal|cls|sty>
%<*internal>
\iffalse
@@ -304,6 +304,12 @@ All notable changes to this project will be documented in the [README.md](https:
This project **does not** adhere to [Semantic Versioning](http://semver.org/).
The markdown syntax is inspired by the conventions proposed by [keepachangelog.com](http://keepachangelog.com/).
+### v1.0.5 (2020-04-28)
+* (general) Changed logo format to `.pdf`
+* (letter) Changed `\ifkomavarempty` to `\ifkomavarempty`, fixes
+ [github-issue nr. 1](https://github.com/LukasCBossert/hu-berlin-bundle/issues/1)
+
+
### v1.0.4 (2019-12-19)
* Added `hu-berlin-base.sty` as a package which contains all relevant code for documents and documentclasses of the bundle.
@@ -388,8 +394,8 @@ You can easily pick up the basic file structure from \cref{hu-berlin:bundle-stru
.2 hu-berlin-letter-example-markdown.md \DTcomment{example markdown file }.
.2 hu-berlin-letter-template.latex \DTcomment{template for conversion}.
.2 \huberlinFolder img\DTcomment{folder for images}.
-.3 texografie-logo.png\DTcomment{logo of maintainer}.
-.3 hu-berlin-logo.jpg\DTcomment{logo of HU}.
+.3 texografie-logo.pdf\DTcomment{logo of maintainer}.
+.3 hu-berlin-logo.pdf\DTcomment{logo of HU}.
.2 makefile\DTcomment{makefile to generate all required files}.
.2 README.md\DTcomment{README file with information on installation}.
}
@@ -581,7 +587,7 @@ Philosophische Fakultät
% \end{macrocode}
% Now following the reference information
% \begin{macrocode}
-\setkomavar{myref}{}
+\setkomavar{myref}{}
% \end{macrocode}
% \begin{macrocode}
\setkomavar{yourref}{}
@@ -963,13 +969,13 @@ Thank you very much for your letter.
% \end{macrocode}
% Now anything else regarding the institute.
% \begin{macrocode}
-\ifkomavarempty{institute.additional}
+\Ifkomavarempty{institute.additional}
{}
{\usekomavar{institute.additional}\\[1\baselineskip]}
% \end{macrocode}
% What follows is the head of institute and its position name.
% \begin{macrocode}
-\ifkomavarempty{institute.head}
+\Ifkomavarempty{institute.head}
{}
{{\usekomafont{institute.head}%
\usekomavar{institute.head}}\\%
@@ -988,39 +994,39 @@ Thank you very much for your letter.
% \end{macrocode}
% and the sender of the letter.
% \begin{macrocode}
-\ifkomavarempty{fromname}
+\Ifkomavarempty{fromname}
{}
{\textbf{\usekomavar*{fromname}}\\
\usekomavar{fromname}\par}
% \end{macrocode}
% And the reference of correspondence.
% \begin{macrocode}
-\ifkomavarempty{myref}
+\Ifkomavarempty{myref}
{}
{\textbf{\usekomavar*{myref}}\\
\usekomavar{myref}\par}
% \end{macrocode}
% To complete this template we provide the possibility to name further reference fields.
% \begin{macrocode}
-\ifkomavarempty{yourref}
+\Ifkomavarempty{yourref}
{}
{\textbf{\usekomavar*{yourref}}\\
\usekomavar{yourref}\par}
% \end{macrocode}
% \begin{macrocode}
-\ifkomavarempty{yourmail}
+\Ifkomavarempty{yourmail}
{}
{\textbf{\usekomavar*{yourmail}}\\
\usekomavar{yourmail}\par}
% \end{macrocode}
% \begin{macrocode}
-\ifkomavarempty{customer}
+\Ifkomavarempty{customer}
{}
{\textbf{\usekomavar*{customer}}\\
\usekomavar{customer}\par}
% \end{macrocode}
% \begin{macrocode}
-\ifkomavarempty{invoice}
+\Ifkomavarempty{invoice}
{}
{\textbf{\usekomavar*{invoice}}\\
\usekomavar{invoice}\par}
@@ -1028,45 +1034,45 @@ Thank you very much for your letter.
% \begin{macrocode}
\textbf{\usekomavar*{fromaddress}}\\
\usekomavar{fromaddress}
- \ifkomavarempty{fromphone}
+ \Ifkomavarempty{fromphone}
{\par}
{\\\usekomavar*{fromphone}\usekomavar{fromphone}
- \ifkomavarempty{fromfax}
+ \Ifkomavarempty{fromfax}
{\par}
{\\}}
- \ifkomavarempty{fromfax}
+ \Ifkomavarempty{fromfax}
{}
{\usekomavar*{fromfax}\usekomavar{fromfax}\par}
% \end{macrocode}
% Next, emails and url:
% \begin{macrocode}
-\ifkomavarempty{institute.head.mail}
+\Ifkomavarempty{institute.head.mail}
{}
{\usekomavar{institute.head.mail}
- \ifkomavarempty{fromemail}
- {\ifkomavarempty{fromurl}
+ \Ifkomavarempty{fromemail}
+ {\Ifkomavarempty{fromurl}
{\par}
{\\}}
{\\}}
% \end{macrocode}
%
% \begin{macrocode}
-\ifkomavarempty{fromemail}
+\Ifkomavarempty{fromemail}
{}
{\usekomavar{fromemail}
- \ifkomavarempty{fromurl}
+ \Ifkomavarempty{fromurl}
{\par}
{\\}}
% \end{macrocode}
%
% \begin{macrocode}
-\ifkomavarempty{fromurl}
+\Ifkomavarempty{fromurl}
{}
{\usekomavar{fromurl}\par}
% \end{macrocode}
% Now the actual location of the sender
% \begin{macrocode}
-\ifkomavarempty{local}
+\Ifkomavarempty{local}
{}
{\textbf{\usekomavar*{local}}\\
\usekomavar{local}\par}
@@ -1077,27 +1083,27 @@ Thank you very much for your letter.
% \end{macrocode}
% Inform your addressee about the connection possibilities.
% \begin{macrocode}
-\ifkomavarempty{connections}
+\Ifkomavarempty{connections}
{}
{\textbf{\usekomavar*{connections}}\\
\usekomavar{connections}\par}
% \end{macrocode}
% \begin{macrocode}
-\ifkomavarempty{officehours}
+\Ifkomavarempty{officehours}
{}
{\textbf{\usekomavar*{officehours}}\\
\usekomavar{officehours}\par}
% \end{macrocode}
% If there is a barrier free entrance, tell it.
% \begin{macrocode}
-\ifkomavarempty{accessibility}
+\Ifkomavarempty{accessibility}
{}
{\textbf{\usekomavar*{accessibility}}\\
\usekomavar{accessibility}\par}
% \end{macrocode}
% And last the bank connection
% \begin{macrocode}
-\ifkomavarempty{bank}
+\Ifkomavarempty{bank}
{}
{\textbf{\usekomavar*{bank}}\\
\usekomavar{bank}\\
@@ -1274,7 +1280,7 @@ $endif$
\begin{document}
\begin{letter}{%
$for(addressee)$
-$addressee$$sep$\par
+$addressee$$sep$\\
$endfor$
}
$for(include-before)$
@@ -1478,7 +1484,7 @@ $for(include-after)$$include-after$$endfor$
of writing.}
\null\vfill
{\usekomafont{subtitle}{\@date \hfill
- \includegraphics[width=4cm]{texografie}\\}}%
+ \includegraphics[width=4cm]{img/texografie-logo.pdf}\\}}%
\par
\vskip 0em
\restoregeometry
@@ -1644,7 +1650,7 @@ $for(include-after)$$include-after$$endfor$
%---- newcommands
\newcommand{\TeXografie}{Lukas C. Bossert
- (www.TeXografie.de)}
+ (www.texografie.de)}
\newcommand\huberlin{\huberlintitle\xspace}
diff --git a/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.pdf b/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.pdf
index 8c86d29736..f801de6173 100644
--- a/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.pdf
+++ b/macros/latex/contrib/hu-berlin-bundle/hu-berlin-bundle.pdf
Binary files differ
diff --git a/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.jpg b/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.jpg
deleted file mode 100644
index e669ea61ed..0000000000
--- a/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.jpg
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.pdf b/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.pdf
new file mode 100644
index 0000000000..2549d79a0c
--- /dev/null
+++ b/macros/latex/contrib/hu-berlin-bundle/img/hu-berlin-logo.pdf
Binary files differ
diff --git a/macros/latex/contrib/hu-berlin-bundle/img/texografie-logo.pdf b/macros/latex/contrib/hu-berlin-bundle/img/texografie-logo.pdf
new file mode 100644
index 0000000000..5609d8aee5
--- /dev/null
+++ b/macros/latex/contrib/hu-berlin-bundle/img/texografie-logo.pdf
Binary files differ
diff --git a/macros/latex/contrib/hu-berlin-bundle/img/texografie.png b/macros/latex/contrib/hu-berlin-bundle/img/texografie.png
deleted file mode 100644
index d79462cc23..0000000000
--- a/macros/latex/contrib/hu-berlin-bundle/img/texografie.png
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/hu-berlin-bundle/makefile b/macros/latex/contrib/hu-berlin-bundle/makefile
index 19382036d3..85956df80d 100644
--- a/macros/latex/contrib/hu-berlin-bundle/makefile
+++ b/macros/latex/contrib/hu-berlin-bundle/makefile
@@ -34,7 +34,7 @@ md2pdf-letter: files
pandoc --pdf-engine=lualatex --template hu-berlin-letter-template.latex -o hu-berlin-letter-example-markdown.pdf hu-berlin-letter-example-markdown.md
letter: files
- latexmk -lualatex -interaction=nonstopmode hu-berlin-letter-example-lualatex.tex
+ latexmk -lualatex -gg -interaction=nonstopmode hu-berlin-letter-example-lualatex.tex
# How to get information from CTAN
CTAN: $(PROJECT).pkglist
@@ -89,7 +89,7 @@ ctan: $(PROJECT).dtx
@-mkdir archive
@rm -f archive/$(PROJECT)-$(DATE)*.zip
@mkdir $(TDIR)
- @cp $(PROJECT).{dtx,pdf,ins} README.md makefile $(TDIR)
+ @cp $(PROJECT).{dtx,pdf} README.md makefile $(TDIR)
-@rm -f img/.DS_Store
@cp -R img $(TDIR)
@cd $(TEMP); \
diff --git a/macros/latex/contrib/tcolorbox/CHANGES b/macros/latex/contrib/tcolorbox/CHANGES
index 2a1b6dfb15..0d3fa0e696 100644
--- a/macros/latex/contrib/tcolorbox/CHANGES
+++ b/macros/latex/contrib/tcolorbox/CHANGES
@@ -1,7 +1,7 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -1114,3 +1114,33 @@ version 4.22 (2019/11/15)
'raster before skip' and 'raster after skip' did not accept glue anymore.
- new initialization option (#80): 'reset counter on overlays'
+version 4.30 (2020/04/28)
+- bug fix (#88): 'parskip' and 'noparskip' had side-effects for the box content
+ in combination with 'height fill' and 'parbox=false'
+- bug fix (#90) in library 'documentation':
+ initialize 'doc description' for every docXXX to be empty
+- Internal box counter renamed to remove warnings when using \includeonly
+- library 'documentation':
+ * major code overhaul to support simultaneous documentation of
+ similar commands, environments, keys, path operations (#89).
+ * Note that the new code reserves a small additional amount of vertical space
+ for documented macros which may result in changed page breaks.
+ * Note that documentation heads are now embedded inside a 'raster'
+ which requires other customizations for vertical space (if needed)
+ * new macros and environments: 'docCommands', 'docEnvironments',
+ 'docKeys', '\tcbmakedocSubKeys', 'docPathOperations'
+ * new options: 'doc index' (#91), 'doc name', 'doc parameter',
+ 'doc keypath', 'doc sort index', 'doc no index',
+ 'doc raster command', 'doc raster environment', 'doc raster key',
+ 'doc raster path', 'doc raster'
+ * additional option setting for: '\docAuxCommand', '\docAuxEnvironment',
+ '\docAuxKey', '\docValue', '\docColor', '\docCounter', '\docLength'
+ * superfluous and undocumented opton 'color frame' removed (#94)
+ * '\refAux' and '\refAuxcs' are not longer colored, if colorlinks=false (#95)
+- library 'listingsutf8':
+ safeguard against compiling with other engines than pdf(la)tex (#92)
+- library 'fitting':
+ '\tcbfitdim' is described in more detail (#96)
+- library 'poster':
+ poster width and height caveats described in more detail (#98)
+
diff --git a/macros/latex/contrib/tcolorbox/README b/macros/latex/contrib/tcolorbox/README
index a16ef87400..bf06996dfa 100644
--- a/macros/latex/contrib/tcolorbox/README
+++ b/macros/latex/contrib/tcolorbox/README
@@ -1,7 +1,7 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
diff --git a/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex b/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
index f32bef367e..0a3145d215 100644
--- a/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbbreakable.code.tex: Code for breakable colorboxes
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\let\tcb@parboxrestore@true=\tcb@parboxrestore
\let\tcb@parboxrestore@false\tcb@parbox@false@settings
diff --git a/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex b/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
index 79f32da93e..49c70baefb 100644
--- a/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbdocumentation.code.tex: Code for LaTeX documentations
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,9 +17,9 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
-\tcbuselibrary{listings,skins,xparse,external}
+\tcbuselibrary{listings,skins,xparse,external,raster}
\RequirePackage{pifont}[2005/04/12]
\RequirePackage{marvosym}[2011/07/20]
@@ -83,9 +83,7 @@
{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
\def\oarg#1{%
\colOpt{{\ttfamily[}\meta{#1}{\ttfamily]}}}
-
-\newrobustcmd\tcb@cs[1]{{\catcode`\_=12\relax\catcode`\@11\relax\ttfamily\char`\\\scantokens{#1}\unskip}}
-\newrobustcmd\tcb@scantokens[1]{{\catcode`\_=12\relax\catcode`\@11\relax\ttfamily\scantokens{#1}\unskip}}
+\def\brackets#1{{\ttfamily\char`\{}#1{\ttfamily\char`\}}}
\newif\iftcb@doc@toindex
\newif\iftcb@doc@colorize
@@ -135,7 +133,6 @@
color value={#1},color color={#1},color counter={#1},color length={#1}, color path={#1}},
color option/.store in=\kvtcb@col@opt,
color hyperlink/.store in=\kvtcb@colhyper,
- color frame/.store in=\kvtcb@colhyper,
index actual/.store in=\idx@actual,
index quote/.store in=\idx@quote,
index level/.store in=\idx@level,
@@ -154,7 +151,21 @@
doc head path/.style={doc@head@path/.style={#1}},
doc head/.style={doc head command={#1},doc head environment={#1},doc head key={#1},
doc head path={#1}},
+ doc raster command/.style={doc@raster@command/.style={#1}},
+ doc raster environment/.style={doc@raster@environment/.style={#1}},
+ doc raster key/.style={doc@raster@key/.style={#1}},
+ doc raster path/.style={doc@raster@path/.style={#1}},
+ doc raster/.style={doc raster command={#1},doc raster environment={#1},doc raster key={#1},
+ doc raster path={#1}},
doc label/.store in=\kvtcb@doc@label,
+ doc index/.store in=\kvtcb@doc@index,
+ doc sort index/.store in=\kvtcb@doc@sortindex,
+ doc@name/.store in=\kvtcb@doc@name,
+ doc parameter/.store in=\kvtcb@doc@parameter,
+ doc name/.style={doc@name={#1},doc label={#1},doc index={#1},doc sort index={#1}},
+ doc keypath/.store in=\kvtcb@doc@keypath,
+ doc@sub@keypath/.style={doc keypath/.code={
+ \ifblank{##1}{\def\kvtcb@doc@keypath{#1}}{\def\kvtcb@doc@keypath{#1/##1}}}},
before doc body command/.store in=\kvtcb@doc@body@command@before,
after doc body command/.store in=\kvtcb@doc@body@command@after,
before doc body environment/.store in=\kvtcb@doc@body@environment@before,
@@ -169,6 +180,7 @@
,after doc body key={#1},after doc body path={#1}},
doc description/.store in=\kvtcb@doc@description,%
doc into index/.is if=tcb@doc@toindex,%
+ doc no index/.style={doc into index=false},
doc updated/.style={before upper={\tcbdocmarginnote{\tcbdocupdated{#1}}}},
doc new/.style={before upper={\tcbdocmarginnote{\tcbdocnew{#1}}}},
doc new and updated/.style 2 args={before upper={\tcbdocmarginnote{\tcbdocnew{#1}\\\tcbdocupdated{#2}}}},
@@ -263,47 +275,28 @@
}
\newrobustcmd{\tcbIndexPrintComC}[1]{\tcb@Index@Print@ComC{#1}{\kvtcb@col@command}}
-\def\tcb@Print@Com#1{\textcolor{\kvtcb@col@command}{\tcb@doc@bfseries\tcb@cs{#1}}}
\newrobustcmd{\tcbIndexPrintEnvCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@environment}{\kvtcb@text@env}}
\newrobustcmd{\tcbIndexPrintEnvC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@environment}}
-\def\tcb@Print@Env#1{\textcolor{\kvtcb@col@environment}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintKeyCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@key}{\kvtcb@text@key}}
\newrobustcmd{\tcbIndexPrintKeyC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@key}}
-\def\tcb@Print@Key#1{\textcolor{\kvtcb@col@key}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintPathCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@path}{\kvtcb@text@path}}
\newrobustcmd{\tcbIndexPrintPathC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@path}}
-\def\tcb@Print@Path#1{\textcolor{\kvtcb@col@path}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintValCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@value}{\kvtcb@text@value}}
\newrobustcmd{\tcbIndexPrintValC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@value}}
-\def\tcb@Print@Val#1{\textcolor{\kvtcb@col@value}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintColCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@color}{\kvtcb@text@color}}
\newrobustcmd{\tcbIndexPrintColC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@color}}
-\def\tcb@Print@Col#1{\textcolor{\kvtcb@col@color}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintCountCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@counter}{\kvtcb@text@counter}}
\newrobustcmd{\tcbIndexPrintCountC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@counter}}
-\def\tcb@Print@Count#1{\textcolor{\kvtcb@col@counter}{\tcb@doc@bfseries\tcb@scantokens{#1}}}
\newrobustcmd{\tcbIndexPrintLenCA}[1]{\tcb@Index@Print@ComCA{#1}{\kvtcb@col@length}{\kvtcb@text@length}}
\newrobustcmd{\tcbIndexPrintLenC}[1]{\tcb@Index@Print@ComC{#1}{\kvtcb@col@length}}
-\def\tcb@Print@Len#1{\textcolor{\kvtcb@col@length}{\tcb@doc@bfseries\tcb@cs{#1}}}
-
-\def\tcb@index@Com#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintComC{#1}}\fi}
-\def\tcb@index@Env#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintEnvCA{#1}}\kvtcb@index@command{\kvtcb@text@envs\idx@level#1\idx@actual\tcbIndexPrintEnvC{#1}}\fi}
-\def\tcb@index@Key#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintKeyCA{#1}}\kvtcb@index@command{\kvtcb@text@keys\idx@level#1\idx@actual\tcbIndexPrintKeyC{#1}}\fi}%
-\def\tcb@index@KeyPath#1#2{\iftcb@doc@toindex\kvtcb@index@command{#2\idx@actual\tcbIndexPrintKeyCA{#2}}\kvtcb@index@command{\kvtcb@text@keys\idx@level#1\idx@actual\tcbIndexPrintKeyC{/#1/}\idx@level#2\idx@actual\tcbIndexPrintKeyC{#2}}\fi}%
-\def\tcb@index@Path#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintPathCA{#1}}\kvtcb@index@command{\kvtcb@text@paths\idx@level#1\idx@actual\tcbIndexPrintPathC{#1}}\fi}
-\def\tcb@index@Val#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintValCA{#1}}\kvtcb@index@command{\kvtcb@text@values\idx@level#1\idx@actual\tcbIndexPrintValC{#1}}\fi}
-\def\tcb@index@Col#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintColCA{#1}}\kvtcb@index@command{\kvtcb@text@colors\idx@level#1\idx@actual\tcbIndexPrintColC{#1}}\fi}
-\def\tcb@index@Count#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintCountCA{#1}}\kvtcb@index@command{\kvtcb@text@counters\idx@level#1\idx@actual\tcbIndexPrintCountC{#1}}\fi}
-\def\tcb@index@Len#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintLenCA{#1}}\kvtcb@index@command{\kvtcb@text@lengths\idx@level#1\idx@actual\tcbIndexPrintLenC{#1}}\fi}
-\def\brackets#1{{\ttfamily\char`\{}#1{\ttfamily\char`\}}}
\newenvironment{tcb@manual@entry}{\begin{list}{}{%
\setlength{\leftmargin}{\kvtcb@doc@left}%
@@ -313,121 +306,506 @@
\setlength{\rightmargin}{\kvtcb@doc@right}%
}\item}{\end{list}}
-\def\tcb@manual@top#1{\itemsep=0pt\parskip=0pt\item\strut{#1}\par\topsep=0pt}
-
\def\tcb@doc@do@description{%
- \ifx\kvtcb@doc@description\@empty\else\tcblower\raggedleft(\kvtcb@doc@description)\fi%
+ \ifx\kvtcb@doc@description\@empty\else\tcblower\raggedleft\strut(\kvtcb@doc@description)\strut\fi%
}
\newtcolorbox{tcb@doc@head}[1]{blank,colback=white,colframe=white,
code={\tcbdimto\tcb@temp@grow@left{-\kvtcb@doc@indentleft}%
\tcbdimto\tcb@temp@grow@right{-\kvtcb@doc@indentright}},
- grow to left by=\tcb@temp@grow@left,%
+ grow to left by=\tcb@temp@grow@left,
grow to right by=\tcb@temp@grow@right,
sidebyside,sidebyside align=top,
sidebyside gap=-\tcb@w@upper@real,
- phantom=\phantomsection,%
- enlarge bottom by=-0.2\baselineskip,#1}
+ phantom=\phantomsection,#1}
-% main documentation environments
-\newenvironment{docCommand}[3][]{\tcbset{doc label={#2},#1}%
- \begin{tcb@manual@entry}%
- \begin{tcb@doc@head}{doc@head@command}%
- \tcb@Print@Com{#2}\tcb@index@Com{#2}\protected@edef\@currentlabel{\noexpand\tcb@cs{#2}}\label{com:\kvtcb@doc@label}{\ttfamily #3}%
- \tcb@doc@do@description%
- \end{tcb@doc@head}\nobreak\tcbset{before upper=}\kvtcb@doc@body@command@before\ignorespaces}%
- {\ifvmode\else\unskip\fi\kvtcb@doc@body@command@after\end{tcb@manual@entry}}
-
-\newenvironment{docCommand*}{\bgroup\tcb@doc@toindexfalse\begin{docCommand}}{\end{docCommand}\egroup}
-
-\newenvironment{docEnvironment}[3][]{\tcbset{doc label={#2},#1}%
- \begin{tcb@manual@entry}%
- \begin{tcb@doc@head}{doc@head@environment}%
- \strut\cs{begin}\brackets{\tcb@Print@Env{#2}}\tcb@index@Env{#2}\protected@edef\@currentlabel{#2}\label{env:\kvtcb@doc@label}{\ttfamily #3}\par%
- \strut~~\meta{\kvtcb@text@envcontent}\par%
- \strut\cs{end}\brackets{\tcb@Print@Env{#2}}%
- \tcb@doc@do@description%
- \end{tcb@doc@head}\nobreak\tcbset{before upper=}\kvtcb@doc@body@environment@before\ignorespaces}%
- {\ifvmode\else\unskip\fi\kvtcb@doc@body@environment@after\end{tcb@manual@entry}}
-
-\newenvironment{docEnvironment*}{\bgroup\tcb@doc@toindexfalse\begin{docEnvironment}}{\end{docEnvironment}\egroup}
-
-\NewDocumentEnvironment{docKey}{ O{} +O{} m m +m }{\tcbset{doc label={#3},#2,doc description={#5}}%
- \begin{tcb@manual@entry}%
- \begin{tcb@doc@head}{doc@head@key}%
- \ifblank{#1}{%
- \tcb@Print@Key{#3}\tcb@index@Key{#3}\protected@edef\@currentlabel{#3}\label{key:\kvtcb@doc@label}{\ttfamily #4}%
- }{%
- \tcb@Print@Key{/#1/#3}%
- \tcb@index@KeyPath{#1}{#3}\protected@edef\@currentlabel{/#1/#3}\label{key:/#1/\kvtcb@doc@label}{\ttfamily #4}%
- }%
- \tcb@doc@do@description%
- \end{tcb@doc@head}\nobreak\tcbset{before upper=}\kvtcb@doc@body@key@before\ignorespaces}%
- {\ifvmode\else\unskip\fi\kvtcb@doc@body@key@after\end{tcb@manual@entry}}
-
-\newenvironment{docKey*}{\bgroup\tcb@doc@toindexfalse\begin{docKey}}{\end{docKey}\egroup}
-
-\def\tcbmakedocSubKey#1#2{%
- \NewDocumentEnvironment{#1}{ O{} +O{} m m +m }{%
- \ifblank{##1}{\def\tcb@key@path{#2}}{\def\tcb@key@path{#2/##1}}%
- \begin{docKey}[\tcb@key@path][##2]{##3}{##4}{##5}}%
- {\end{docKey}}%
- \newenvironment{#1*}{\bgroup\tcb@doc@toindexfalse\begin{#1}}{\end{#1}\egroup}%
-}
-\newenvironment{docPathOperation}[3][]{\tcbset{doc label={#2},#1}%
- \begin{tcb@manual@entry}%
- \begin{tcb@doc@head}{doc@head@path}%
- \colFade{\tcb@cs{path ...}}\
- \tcb@Print@Path{#2}\tcb@index@Path{#2}\protected@edef\@currentlabel{#2}\label{path:\kvtcb@doc@label}{\ttfamily #3}%
- \ \colFade{\tcb@scantokens{...;}}
- \tcb@doc@do@description%
- \end{tcb@doc@head}\nobreak\tcbset{before upper=}\kvtcb@doc@body@path@before\ignorespaces}%
- {\ifvmode\else\unskip\fi\kvtcb@doc@body@path@after\end{tcb@manual@entry}}
-
-\newenvironment{docPathOperation*}{\bgroup\tcb@doc@toindexfalse\begin{docPathOperation}}{\end{docPathOperation}\egroup}
-
-\DeclareDocumentCommand\docAuxCommand{sm}{%
- \tcb@Print@Com{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Com{#2}}%
-}
+\ExplSyntaxOn
-\DeclareDocumentCommand\docAuxEnvironment{sm}{%
- \tcb@Print@Env{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Env{#2}}%
-}
-\DeclareDocumentCommand\docAuxKey{sO{}m}{%
- \ifblank{#2}{%
- \tcb@Print@Key{#3}%
- \IfBooleanTF{#1}{}{\tcb@index@Key{#3}}%
- }{%
- \tcb@Print@Key{/#2/#3}%
- \IfBooleanTF{#1}{}{\tcb@index@KeyPath{#2}{#3}}%
-}}
+\cs_new_nopar:Npn \__tcobox_sanitize_tl:n #1
+ {
+ \group_begin:
+ \tl_rescan:nn
+ {
+ \char_set_catcode_letter:N \_
+ \char_set_catcode_letter:N \@
+ }
+ {
+ #1
+ }
+ \group_end:
+ }
+\cs_generate_variant:Nn \__tcobox_sanitize_tl:n { V }
-\DeclareDocumentCommand\docColor{sm}{%
- \tcb@Print@Col{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Col{#2}}%
-}
-\DeclareDocumentCommand\docCounter{sm}{%
- \tcb@Print@Count{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Count{#2}}%
-}
+\cs_new_nopar:Npn \__tcobox_print_docname:
+ {
+ \texttt{\tcb@doc@bfseries\__tcobox_sanitize_tl:V\kvtcb@doc@name}
+ }
-\DeclareDocumentCommand\docLength{sm}{%
- \tcb@Print@Len{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Len{#2}}%
-}
+\cs_new_nopar:Npn \__tcobox_print_cs_docname:
+ {
+ \texttt{\tcb@doc@bfseries\c_backslash_str\__tcobox_sanitize_tl:V\kvtcb@doc@name}
+ }
+
+
+\NewDocumentCommand \tcb@scantokens { m }
+ {
+ \texttt{\__tcobox_sanitize_tl:n{#1}}
+ }
+
+\NewDocumentCommand \tcb@cs { m }
+ {
+ \texttt{\c_backslash_str\__tcobox_sanitize_tl:n{#1}}
+ }
+
+
+% main documentation environments
+
+\seq_new:N \g__tcobox_label_seq
+
+
+\cs_new:Npn \__tcobox_doc_entry_begin:nnn #1#2#3
+ {
+ \tcbset{doc~name=, doc~parameter=, doc~description=, #1}
+ \begin{tcb@manual@entry}
+ \seq_clear:N \g__tcobox_label_seq
+ \begin{tcbraster}[raster~columns=1,raster~row~skip=0pt,
+ raster~after~skip=4.1pt,raster~force~size=false,doc@raster@#3]
+ \seq_set_from_clist:Nn \l_tmpa_seq {#2}
+ \seq_if_empty:NT \l_tmpa_seq
+ {
+ \seq_put_left:Nn \l_tmpa_seq {}
+ }
+ \seq_map_inline:Nn \l_tmpa_seq
+ {
+ \group_begin:
+ \tcbset{##1}
+ \begin{tcb@doc@head}{doc@head@#3}
+ \strut
+ \use:c { __tcobox_doc_head_#3: }
+ \strut
+ \end{tcb@doc@head}
+ \group_end:
+ }
+ \end{tcbraster}
+ \seq_clear:N \g__tcobox_label_seq
+ \nobreak
+ \tcbset{before~upper=}
+ \use:c { kvtcb@doc@body@#3@before }
+ \ignorespaces
+ }
+
+
+\cs_new:Npn \__tcobox_doc_entry_end:n #1
+ {
+ \ifvmode\else\unskip\fi
+ \use:c { kvtcb@doc@body@#1@after }
+ \end{tcb@manual@entry}
+ }
+
+
+\cs_new_nopar:Npn \__tcobox_print_command:
+ {
+ \textcolor{\kvtcb@col@command}{\__tcobox_print_cs_docname:}
+ }
+
+\cs_new_nopar:Npn \__tcobox_index_command:
+ {
+ \iftcb@doc@toindex
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintComC{\kvtcb@doc@index}}
+ \fi
+ }
+
+\cs_new:Npn \__tcobox_doc_head_command:
+ {
+ \__tcobox_print_command:
+ \__tcobox_index_command:
+ \seq_if_in:NVF \g__tcobox_label_seq \kvtcb@doc@label
+ {
+ \protected@edef\@currentlabel{\noexpand\tcb@cs{\kvtcb@doc@name}}
+ \label{com:\kvtcb@doc@label}
+ \seq_gput_left:NV \g__tcobox_label_seq \kvtcb@doc@label
+ }
+ {\ttfamily\kvtcb@doc@parameter}
+ \tcb@doc@do@description
+ }
+
+
+\NewDocumentEnvironment{docCommands}{ +O{} +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {#1}{#2}{command}
+ }
+ {
+ \__tcobox_doc_entry_end:n { command }
+ }
+
+
+\NewDocumentEnvironment{docCommand}{ +O{} m +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {doc~name={#2},doc~parameter={#3},#1}{}{command}
+ }
+ {
+ \__tcobox_doc_entry_end:n { command }
+ }
+
+
+\NewDocumentEnvironment{docCommand*}{}
+ {
+ \group_begin:
+ \tcb@doc@toindexfalse
+ \begin{docCommand}
+ }
+ {
+ \end{docCommand}
+ \group_end:
+ }
+
+
+\cs_new_nopar:Npn \__tcobox_print_environment:
+ {
+ \textcolor{\kvtcb@col@environment}{\__tcobox_print_docname:}
+ }
+
+\cs_new_nopar:Npn \__tcobox_index_environment:
+ {
+ \iftcb@doc@toindex
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintEnvCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@envs\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintEnvC{\kvtcb@doc@index}}
+ \fi
+ }
+
+\cs_new:Npn \__tcobox_doc_head_environment:
+ {
+ \strut\cs{begin}\brackets{\__tcobox_print_environment:}
+ \__tcobox_index_environment:
+ \seq_if_in:NVF \g__tcobox_label_seq \kvtcb@doc@label
+ {
+ \protected@edef\@currentlabel{\kvtcb@doc@name}
+ \label{env:\kvtcb@doc@label}
+ \seq_gput_left:NV \g__tcobox_label_seq \kvtcb@doc@label
+ }
+ {\ttfamily\kvtcb@doc@parameter}\par
+ \strut\nobreakspace\nobreakspace\meta{\kvtcb@text@envcontent}\par
+ \strut\cs{end}\brackets{\__tcobox_print_environment:}
+ \tcb@doc@do@description
+ }
+
+
+\NewDocumentEnvironment{docEnvironments}{ +O{} +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {#1}{#2}{environment}
+ }
+ {
+ \__tcobox_doc_entry_end:n { environment }
+ }
+
+
+\NewDocumentEnvironment{docEnvironment}{ +O{} m +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {doc~name={#2},doc~parameter={#3},#1}{}{environment}
+ }
+ {
+ \__tcobox_doc_entry_end:n { environment }
+ }
+
+
+\NewDocumentEnvironment{docEnvironment*}{}
+ {
+ \group_begin:
+ \tcb@doc@toindexfalse
+ \begin{docEnvironment}
+ }
+ {
+ \end{docEnvironment}
+ \group_end:
+ }
+
+
+\cs_new_nopar:Npn \__tcobox_print_key:
+ {
+ \textcolor{\kvtcb@col@key}{\tcb@doc@bfseries\ttfamily
+ \tl_if_empty:NF \kvtcb@doc@keypath
+ {
+ /\__tcobox_sanitize_tl:V\kvtcb@doc@keypath/
+ }
+ \__tcobox_sanitize_tl:V\kvtcb@doc@name}
+ }
+
+\cs_new_nopar:Npn \__tcobox_index_key:
+ {
+ \iftcb@doc@toindex
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintKeyCA{\kvtcb@doc@index}}
+ \tl_if_empty:NTF \kvtcb@doc@keypath
+ {
+ \kvtcb@index@command{\kvtcb@text@keys\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintKeyC{\kvtcb@doc@index}}
+ }
+ {
+ \kvtcb@index@command{\kvtcb@text@keys\idx@level\kvtcb@doc@keypath\idx@actual\tcbIndexPrintKeyC{/\kvtcb@doc@keypath/}
+ \idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintKeyC{\kvtcb@doc@index}}
+ }
+ \fi
+ }
+
+\cs_new:Npn \__tcobox_doc_head_key:
+ {
+ \__tcobox_print_key:
+ \__tcobox_index_key:
+ \tl_if_empty:NTF \kvtcb@doc@keypath
+ {
+ \seq_if_in:NVF \g__tcobox_label_seq \kvtcb@doc@label
+ {
+ \protected@edef\@currentlabel{\kvtcb@doc@name}
+ \label{key:\kvtcb@doc@label}
+ \seq_gput_left:NV \g__tcobox_label_seq \kvtcb@doc@label
+ }
+ }
+ {
+ \tl_set:Nx \l_tmpa_tl {/\kvtcb@doc@keypath/\kvtcb@doc@label}
+ \seq_if_in:NVF \g__tcobox_label_seq \l_tmpa_tl
+ {
+ \protected@edef\@currentlabel{/\kvtcb@doc@keypath/\kvtcb@doc@name}
+ \label{key:/\kvtcb@doc@keypath/\kvtcb@doc@label}
+ \seq_gput_left:NV \g__tcobox_label_seq \l_tmpa_tl
+ }
+ }
+ {\ttfamily\kvtcb@doc@parameter}
+ \tcb@doc@do@description
+ }
+
+
+\NewDocumentEnvironment{docKeys}{ +O{} +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {doc~keypath=,#1}{#2}{key}
+ }
+ {
+ \__tcobox_doc_entry_end:n { key }
+ }
+
+
+\NewDocumentEnvironment{docKey}{ O{} +O{} m m +m }
+ {
+ \__tcobox_doc_entry_begin:nnn
+ {
+ doc~keypath=#1,doc~name={#3},doc~parameter={#4},doc~description={#5},#2
+ }
+ {}{key}
+ }
+ {
+ \__tcobox_doc_entry_end:n { key }
+ }
+
+
+\NewDocumentEnvironment{docKey*}{}
+ {
+ \group_begin:
+ \tcb@doc@toindexfalse
+ \begin{docKey}
+ }
+ {
+ \end{docKey}
+ \group_end:
+ }
+
+
+\NewDocumentCommand \tcbmakedocSubKey { m m }
+ {
+ \NewDocumentEnvironment{#1}{ O{} +O{} m m +m }
+ {
+ \__tcobox_doc_entry_begin:nnn
+ {
+ doc@sub@keypath=#2,
+ doc~keypath=##1,
+ doc~name={##3},
+ doc~parameter={##4},
+ doc~description={##5},
+ ##2
+ }
+ {}{key}
+ }
+ {
+ \__tcobox_doc_entry_end:n { key }
+ }
+ \NewDocumentEnvironment{#1*}{}
+ {
+ \group_begin:
+ \tcb@doc@toindexfalse
+ \begin{#1}
+ }
+ {
+ \end{#1}
+ \group_end:
+ }
+ }
+
+
+\NewDocumentCommand \tcbmakedocSubKeys { m m }
+ {
+ \NewDocumentEnvironment{#1}{ +O{} +m }
+ {
+ \__tcobox_doc_entry_begin:nnn
+ {
+ doc@sub@keypath=#2,
+ doc~keypath=,
+ ##1
+ }
+ {##2}{key}
+ }
+ {
+ \__tcobox_doc_entry_end:n { key }
+ }
+ }
+
+
+\cs_new_nopar:Npn \__tcobox_print_path:
+ {
+ \textcolor{\kvtcb@col@path}{\__tcobox_print_docname:}
+ }
+
+\cs_new_nopar:Npn \__tcobox_index_path:
+ {
+ \iftcb@doc@toindex
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintPathCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@paths\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintPathC{\kvtcb@doc@index}}
+ \fi
+ }
+
+\cs_new:Npn \__tcobox_doc_head_path:
+ {
+ \colFade{\tcb@cs{path~...}}~\__tcobox_print_path:
+ \__tcobox_index_path:
+ \seq_if_in:NVF \g__tcobox_label_seq \kvtcb@doc@label
+ {
+ \protected@edef\@currentlabel{\kvtcb@doc@name}
+ \label{path:\kvtcb@doc@label}
+ \seq_gput_left:NV \g__tcobox_label_seq \kvtcb@doc@label
+ }
+ {\ttfamily\kvtcb@doc@parameter{}~\colFade{...;}}
+ \tcb@doc@do@description
+ }
+
+
+\NewDocumentEnvironment{docPathOperations}{ +O{} +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {#1}{#2}{path}
+ }
+ {
+ \__tcobox_doc_entry_end:n { path }
+ }
+
+
+\NewDocumentEnvironment{docPathOperation}{ +O{} m +m }
+ {
+ \__tcobox_doc_entry_begin:nnn {doc~name={#2},doc~parameter={#3},#1}{}{path}
+ }
+ {
+ \__tcobox_doc_entry_end:n { path }
+ }
+
+
+\NewDocumentEnvironment{docPathOperation*}{}
+ {
+ \group_begin:
+ \tcb@doc@toindexfalse
+ \begin{docPathOperation}
+ }
+ {
+ \end{docPathOperation}
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docAuxCommand { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \__tcobox_print_command:
+ \IfBooleanF{#1}{\__tcobox_index_command:}
+ \group_end:
+ }
+
+\NewDocumentCommand \docAuxEnvironment { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \__tcobox_print_environment:
+ \IfBooleanF{#1}{\__tcobox_index_environment:}
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docAuxKey { s O{} +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~keypath={#2},doc~name={#4},#3}
+ \__tcobox_print_key:
+ \IfBooleanF{#1}{\__tcobox_index_key:}
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docValue { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \textcolor{\kvtcb@col@value}{\__tcobox_print_docname:}
+ \IfBooleanF{#1}
+ {
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintValCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@values\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintValC{\kvtcb@doc@index}}
+ }
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docColor { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \textcolor{\kvtcb@col@color}{\__tcobox_print_docname:}
+ \IfBooleanF{#1}
+ {
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintColCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@colors\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintColC{\kvtcb@doc@index}}
+ }
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docCounter { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \textcolor{\kvtcb@col@counter}{\__tcobox_print_docname:}
+ \IfBooleanF{#1}
+ {
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintCountCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@counters\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintCountC{\kvtcb@doc@index}}
+ }
+ \group_end:
+ }
+
+
+\NewDocumentCommand \docLength { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \textcolor{\kvtcb@col@length}{\__tcobox_print_cs_docname:}
+ \IfBooleanF{#1}
+ {
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintLenCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{\kvtcb@text@lengths\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintLenC{\kvtcb@doc@index}}
+ }
+ \group_end:
+ }
+
+
+\ExplSyntaxOff
-\DeclareDocumentCommand\docValue{sm}{%
- \tcb@Print@Val{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Val{#2}}%
-}
\setrefcountdefault{-1}
-\DeclareDocumentCommand\tcb@ref@doc{msm}{%
+\NewDocumentCommand\tcb@ref@doc{msm}{%
\hyperref[#1:#3]{\texttt{\ref*{#1:#3}}%
\IfBooleanTF{#2}{}{%
\ifnum\getpagerefnumber{#1:#3}=\thepage%
@@ -441,8 +819,15 @@
\def\refKey{\tcb@ref@doc{key}}
\def\refPathOperation{\tcb@ref@doc{path}}
-\def\refAux#1{\textcolor{\kvtcb@colhyper}{\tcb@scantokens{#1}}}
-\def\refAuxcs#1{\textcolor{\kvtcb@colhyper}{\tcb@cs{#1}}}
+\AtBeginDocument{%
+ \ifHy@colorlinks
+ \def\refAux#1{\textcolor{\kvtcb@colhyper}{\tcb@scantokens{#1}}}%
+ \def\refAuxcs#1{\textcolor{\kvtcb@colhyper}{\tcb@cs{#1}}}%
+ \else
+ \def\refAux#1{\tcb@scantokens{#1}}%
+ \def\refAuxcs#1{\tcb@cs{#1}}%
+ \fi%
+}
\newenvironment{absquote}
{\list{}{\leftmargin2cm\rightmargin\leftmargin}%
@@ -496,8 +881,20 @@
\let\tcb@doc@index@pgf=\tcb@doc@index@pgfsection%
\def\tcb@doc@index@doc{%
- \let\tcb@index@Com=\SpecialMainIndex%%
- \let\tcb@index@Env=\SpecialMainEnvIndex%
+ \ExplSyntaxOn
+ \def \__tcobox_index_command:
+ {
+ \iftcb@doc@toindex
+ \SpecialMainIndex{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintComC{\kvtcb@doc@index}}
+ \fi
+ }
+ \def \__tcobox_index_environment:
+ {
+ \iftcb@doc@toindex
+ SpecialMainEnvIndex{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintEnvC{\kvtcb@doc@index}}
+ \fi
+ }
+ \ExplSyntaxOff
\tcbset{index german settings}%
\EnableCrossrefs%
\PageIndex%
@@ -507,19 +904,19 @@
\tcbset{%
reset@documentation/.style={%
- },
- documentation listing style=tcbdocumentation,
+ },
+ initialize@reset=reset@documentation,
doc left=2em,
doc right=0pt,
doc left indent=-2em,
doc right indent=0pt,
doc head=,
+ doc raster=,
before doc body=,
after doc body=,
- doc description=,
+ documentation listing style=tcbdocumentation,
doc into index=true,
doc marginnote=,
- initialize@reset=reset@documentation,
color option=Option,
color definition=Definition,
color hyperlink=Hyperlink,
diff --git a/macros/latex/contrib/tcolorbox/tcbexternal.code.tex b/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
index 2697820f39..ebf274f9b0 100644
--- a/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbexternal.code.tex: Code for externalization
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{pro@cessing}
diff --git a/macros/latex/contrib/tcolorbox/tcbfitting.code.tex b/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
index 5604168b28..cf641991be 100644
--- a/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbfitting.code.tex: Code for fit boxes
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\newdimen\tcbfitdim
\newdimen\tcb@lowerfitdim
diff --git a/macros/latex/contrib/tcolorbox/tcbhooks.code.tex b/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
index b549b68292..135d78236e 100644
--- a/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbhooks.code.tex: Code for adding hooks
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbset{%
before upper app/.code={\appto\kvtcb@before@upper{#1}},%
diff --git a/macros/latex/contrib/tcolorbox/tcblistings.code.tex b/macros/latex/contrib/tcolorbox/tcblistings.code.tex
index 348cf2fe35..aedb6eb143 100644
--- a/macros/latex/contrib/tcolorbox/tcblistings.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistings.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcblistings.code.tex: Code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{listings}[2007/02/22]
diff --git a/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex b/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
index 5d58c94dd1..a241e3e3c1 100644
--- a/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcblistingscode.code.tex: Auxiliary code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{pro@cessing}
diff --git a/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex b/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
index 984b402a46..fa62475ca1 100644
--- a/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcblistingsutf8.code.tex: Code for colorboxes with listings in UTF-8
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,11 +17,22 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
-\RequirePackage{listingsutf8}[2011/11/10]
\tcbuselibrary{listings}
+\RequirePackage{iftex}
+\ifpdftex
+ \let\tcb@temp\relax%
+\else
+ \tcb@info{Library `listingsutf8' is compatible with pdftex only.
+ Library `listings` is loaded instead.}%
+ \let\tcb@temp\endinput
+\fi
+\tcb@temp
+
+\RequirePackage{listingsutf8}[2011/11/10]
+
\tcbset{
listing utf8/.style={listing inputencoding=utf8/#1},
}
diff --git a/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex b/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
index de09b64411..444c3867aa 100644
--- a/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbmagazine.code.tex: Code for box sets and magazine styles
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{breakable}
diff --git a/macros/latex/contrib/tcolorbox/tcbminted.code.tex b/macros/latex/contrib/tcolorbox/tcbminted.code.tex
index 7b04019180..e5574ff669 100644
--- a/macros/latex/contrib/tcolorbox/tcbminted.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbminted.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbminted.code.tex: Code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{minted}[2011/09/17]
diff --git a/macros/latex/contrib/tcolorbox/tcbposter.code.tex b/macros/latex/contrib/tcolorbox/tcbposter.code.tex
index afab882a04..712095687b 100644
--- a/macros/latex/contrib/tcolorbox/tcbposter.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbposter.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbposter.code.tex: Code for posters
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{breakable,magazine,skins,fitting}
diff --git a/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex b/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
index c1d54c06ad..522d1469ff 100644
--- a/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbprocessing.code.tex: Code for conditional processing
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{pdftexcmds}
\RequirePackage{shellesc}
diff --git a/macros/latex/contrib/tcolorbox/tcbraster.code.tex b/macros/latex/contrib/tcolorbox/tcbraster.code.tex
index 628afd55ae..faf8c7cc31 100644
--- a/macros/latex/contrib/tcolorbox/tcbraster.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbraster.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbskinsjigsaw.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\newcounter{tcbrastercolumn}
\newcounter{tcbrasterrow}
diff --git a/macros/latex/contrib/tcolorbox/tcbskins.code.tex b/macros/latex/contrib/tcolorbox/tcbskins.code.tex
index 6b820a7e7b..cf0dc29e96 100644
--- a/macros/latex/contrib/tcolorbox/tcbskins.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbskins.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbskins.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{tikz}[2010/10/13]
diff --git a/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex b/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
index fa78d3e006..6bcd0fef7e 100644
--- a/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbskinsjigsaw.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{skins}
diff --git a/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex b/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
index 9bfcc7252c..c158bdd77b 100644
--- a/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbtheorems.code.tex: Code for theorems in colorboxes
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{amsmath}
diff --git a/macros/latex/contrib/tcolorbox/tcbvignette.code.tex b/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
index 127a24d400..dbc07bdf1e 100644
--- a/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbvignette.code.tex: Code for ornamental frames
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\tcbuselibrary{skins}
diff --git a/macros/latex/contrib/tcolorbox/tcbxparse.code.tex b/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
index 632c7a5cad..13daf19c84 100644
--- a/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcbxparse.code.tex: Code for xparse features
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.22}
+\tcb@set@library@version{4.30}
\RequirePackage{xparse}[2013/12/31]
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
index 19b53e887f..a88e74ad07 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
index 633a3fee86..5c52d044a4 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcolorbox-example-poster.tex: a poster example for tcolorbox
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
index 8164207f0c..e1de6b9fba 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example.tex b/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
index 7cf8a140ec..f1f61989b8 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
@@ -1,8 +1,8 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcolorbox-example.tex: an example for tcolorbox
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,6 +17,9 @@
%%
%% This work consists of all files listed in README
%%
+% arara: pdflatex: { }
+% arara: pdflatex: { synctex: yes }
+%
\documentclass{article}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
index 062efe05a1..f3e875a401 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
index fd1f0c51f3..aca460f293 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
@@ -1,9 +1,9 @@
% \LaTeX-Main\
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcolorbox-tutorial-poster.tex: a tutorial for poster creation with tcolorbox
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.abstract.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.abstract.tex
index ecd45a34e1..058a4c162f 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.abstract.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.abstract.tex
@@ -79,7 +79,7 @@
\footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip
-\normalsize\url{http://www.ctan.org/pkg/tcolorbox}\par
+\normalsize\url{https://www.ctan.org/pkg/tcolorbox}\par
\url{https://github.com/T-F-S/tcolorbox}}
\end{center}
\bigskip
@@ -98,6 +98,7 @@
interior style={fill overzoom image=goldshade.png,fill image opacity=0.25},
colbacktitle=red!50!yellow!75!black,
enlargepage flexible=\baselineskip,pad at break*=3mm,
+ height fixed for=first and middle,
watermark color=yellow!75!red!25!white,
watermark text={\bfseries\Large Contents},
attach boxed title to top center={yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=2mm-\tcboxedtitleheight/2},
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.beamer.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.beamer.tex
index 0fcb15e5a3..ec70fd713a 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.beamer.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.beamer.tex
@@ -91,6 +91,7 @@ This style is not intended to be used directly, but in concealed way by applying
\end{dispListing}
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}[][doc new={2019-03-01}]{alert}{=\textless\meta{overlay specification}\textgreater}{style, no default, initially unset}
Sets the \refKey{/tcb/beamer alerted} style in dependency of
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.bib b/macros/latex/contrib/tcolorbox/tcolorbox.doc.bib
index 8f1e4f7924..be37700ea1 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.bib
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.bib
@@ -1,61 +1,61 @@
-@manual{hoffmann:2018a,
+@manual{hoffmann:listings,
author = {Carsten Heinz and Brooks Moses and Jobst Hoffmann},
title = {The Listings Package},
- url = {http://mirror.ctan.org/macros/latex/contrib/listings/listings.pdf},
- version = {1.7},
- date = {2018-09-02},
+ url = {https://mirror.ctan.org/macros/latex/contrib/listings/listings.pdf},
+ version = {1.8d},
+ date = {2020-03-24},
language = {english}
}
@manual{schoepf:2001a,
author = {Rainer Sch{\"o}pf and Bernd Raichle and Chris Rowley},
title = {A New Implementation of {\LaTeX}'s verbatim and verbatim* Environments},
- url = {http://mirror.ctan.org/macros/latex/required/tools/verbatim.pdf},
+ url = {https://mirror.ctan.org/macros/latex/required/tools/verbatim.pdf},
date = {2001-03-12},
}
-@techreport{sturm:2007b,
+@techreport{sturm:mathe1,
author = {Thomas F. Sturm},
title = {Mathematik 1 (B.Eng.)},
type = {Vorlesungs-Skriptum},
institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
address = {Neubiberg},
url = {https://www.unibw.de/bw/professuren/thomas-sturm},
- year = 2007,
+ year = 2019,
language = {german}
}
-@techreport{sturm:2008b,
+@techreport{sturm:mathe2,
author = {Thomas F. Sturm},
title = {Mathematik 2 (B.Eng.)},
type = {Vorlesungs-Skriptum},
institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
address = {Neubiberg},
url = {https://www.unibw.de/bw/professuren/thomas-sturm},
- year = 2008,
+ year = 2019,
language = {german}
}
-@techreport{sturm:2010a,
+@techreport{sturm:mathe3,
author = {Thomas F. Sturm},
title = {H{\"o}here Mathematik: Fortgeschrittene mathematische Methoden (M.Eng.)},
type = {Vorlesungs-Skriptum},
institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
address = {Neubiberg},
url = {https://www.unibw.de/bw/professuren/thomas-sturm},
- year = 2010,
+ year = 2019,
language = {german}
}
-@book{sturm:2016e,
+@book{sturm:latex,
author = {Thomas F. Sturm},
title = {\LaTeX -- Einfhrung in das Textsatzsystem},
publisher = {Leibnitz Universitt Hannover IT Services (LUIS)},
address = {Hannover},
- edition = 11,
+ edition = 12,
series = {IT-Handb\"ucher},
url = {https://www.luis.uni-hannover.de/buch.html?&titel=latex},
- date = {2016-08},
+ date = {2019-07},
language = {german}
}
@@ -63,141 +63,137 @@
@manual{tantau:tikz_and_pgf,
author = {Till Tantau},
title = {The TikZ and PGF Packages},
- subtitle = {Manual for version 3.1.1},
- url = {http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf},
- date = {2019-02-02},
+ subtitle = {Manual for version 3.1.5b},
+ url = {https://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf},
+ date = {2020-01-08},
}
@manual{tantau:beamer,
author = {Till Tantau and Joseph Wright and Vedran Mileti\'{c}},
title = {The Beamer Class},
- subtitle = {User Guide for version 3.55},
- url = {http://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf},
- date = {2018-12-02},
+ subtitle = {User Guide for version 3.57},
+ url = {https://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf},
+ date = {2019-09-30},
}
-@manual{carlisle:2007a,
+@manual{carlisle:ltxdoc,
author = {David Carlisle},
title = {The file ltxdoc.dtx for use with \LaTeXe},
- url = {http://mirror.ctan.org/macros/latex/base/ltxdoc.dtx},
- date = {2007-11-11}
+ url = {https://mirror.ctan.org/macros/latex/base/ltxdoc.pdf},
+ date = {2019-09-16}
}
-@manual{carlisle:2016a,
+@manual{carlisle:tabularx,
author = {David Carlisle},
title = {The tabularx package},
- url = {http://mirror.ctan.org/macros/latex/required/tools/tabularx.pdf},
- date = {2016-02-03}
+ url = {https://mirror.ctan.org/macros/latex/required/tools/tabularx.pdf},
+ date = {2020-01-15}
}
@manual{mittelbach:2011a,
author = {Frank Mittelbach},
title = {The doc and shortvrb Packages},
- url = {http://mirror.ctan.org/macros/latex/base/doc.dtx},
+ url = {https://mirror.ctan.org/macros/latex/base/doc.dtx},
date = {2011-06-30}
}
+
+@manual{mittelbach:multicol,
+ author = {Frank Mittelbach},
+ title = {An environment for multicolumn output},
+ url = {https://mirror.ctan.org/macros/latex/required/tools/multicol.pdf},
+ date = {2020-02-02},
+}
+
+
@manual{breitenlohner:1998a,
author = {Peter Breitenlohner},
title = {The $\varepsilon$-\TeX\ manual},
version = {2},
- url = {http://mirrors.ctan.org/systems/doc/etex/etex_man.pdf},
+ url = {https://mirrors.ctan.org/systems/doc/etex/etex_man.pdf},
date = {1998-02},
}
-@manual{oberdiek:2016b,
+@manual{oberdiek:listingsutf8,
author = {Heiko Oberdiek},
title = {The listingsutf8 package},
- url = {http://mirror.ctan.org/macros/latex/contrib/oberdiek/listingsutf8.pdf},
- date = {2016-05-16},
+ url = {http://mirrors.ctan.org/macros/latex/contrib/listingsutf8/listingsutf8.pdf},
+ date = {2019-12-10},
}
+
@manual{robertson:2014a,
author = {Will Robertson},
title = {A couple of things involving environments},
- url = {http://mirror.ctan.org/macros/latex/contrib/environ/environ.pdf},
+ url = {https://mirror.ctan.org/macros/latex/contrib/environ/environ.pdf},
date = {2014-05-04},
}
-@manual{lehmann:2018a,
+@manual{lehmann:etoolbox,
author = {Philipp Lehman and Joseph Wright},
title = {The etoolbox Package},
- url = {http://mirror.ctan.org/macros/latex/contrib/etoolbox/etoolbox.pdf},
- date = {2018-08-19},
+ url = {https://mirror.ctan.org/macros/latex/contrib/etoolbox/etoolbox.pdf},
+ date = {2019-09-21},
}
@manual{cubitt:2018a,
author = {Toby Cubitt},
title = {The cleveref Package},
- url = {http://mirror.ctan.org/macros/latex/contrib/cleveref/cleveref.pdf},
+ url = {https://mirror.ctan.org/macros/latex/contrib/cleveref/cleveref.pdf},
date = {2018-03-27},
}
-@manual{rudolph:2011a,
- author = {Konrad Rudolph},
- title = {The minted package},
- subtitle = {Highlighted source code in \LaTeX},
- url = {http://mirror.ctan.org/macros/latex/contrib/minted/minted.pdf},
- date = {2011-09-17},
-}
@manual{poore:minted,
author = {Geoffrey M. Poore},
title = {The minted package},
subtitle = {Highlighted source code in \LaTeX},
- url = {http://mirror.ctan.org/macros/latex/contrib/minted/minted.pdf},
+ url = {https://mirror.ctan.org/macros/latex/contrib/minted/minted.pdf},
date = {2017-07-19},
}
@online{pygments:web,
title = {Pygments},
subtitle = {Python syntax highlighter},
- date = {2018},
- url = {http://pygments.org/},
+ date = {2019},
+ url = {https://pygments.org/},
}
@manual{latexproject:xparse,
author = {The \LaTeX3 Project},
title = {The xparse Package},
- url = {http://mirror.ctan.org/macros/latex/contrib/l3packages/xparse.pdf},
- date = {2018-10-17},
+ url = {https://mirror.ctan.org/macros/latex/contrib/l3packages/xparse.pdf},
+ date = {2020-03-06},
}
@manual{arseneau:2011a,
author = {Donald Arseneau},
title = {The varwidth package},
- url = {http://mirrors.ctan.org/macros/latex/contrib/varwidth/varwidth-doc.pdf},
+ url = {https://mirrors.ctan.org/macros/latex/contrib/varwidth/varwidth-doc.pdf},
date = {2011-09-26},
}
-@manual{mittelbach:2015a,
- author = {Frank Mittelbach},
- title = {An environment for multicolumn output},
- url = {http://mirror.ctan.org/macros/latex/required/tools/multicol.pdf},
- date = {2015-09-30},
-}
-
@manual{rahtz:hyperref,
author = {Sebastian Rahtz and Heiko Oberdiek},
title = {Hypertext marks in \LaTeX: a manual for hyperref},
- url = {http://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf},
- date = {2018-09},
+ url = {https://mirrors.ctan.org/macros/latex/contrib/hyperref/doc/manual.pdf},
+ date = {2020-01},
language = {english}
}
-@manual{oberdiek:2016a,
+@manual{oberdiek:bookmark,
author = {Heiko Oberdiek},
title = {The bookmark package},
- url = {http://mirrors.ctan.org/macros/latex/contrib/oberdiek/bookmark.pdf},
- date = {2016-05-17},
+ url = {https://mirrors.ctan.org/macros/latex/contrib/bookmark/bookmark.pdf},
+ date = {2019-12-03},
language = {english}
}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.breakable.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.breakable.tex
index ba0b05cbd8..4ebaee76d9 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.breakable.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.breakable.tex
@@ -239,6 +239,7 @@ The |break at| option can be used to insert better break points by hand.
\end{dispExample}
\end{docTcbKey}
+\enlargethispage*{1cm}
\begin{docTcbKey}{enlargepage}{=\meta{length}\colOpt{/\meta{length}/\ldots/\meta{length}}}{no default, initially |0pt|}
Inserts a |\enlargethispage|\marg{length} to the pages of the break sequence,
@@ -367,6 +368,8 @@ The |break at| option can be used to insert better break points by hand.
and \refKey{/tcb/pad after break}.
\end{docTcbKey}
+\enlargethispage*{5mm}
+
\begin{docTcbKey}{pad at break*}{=\meta{length}}{style, no default}
Sets \refKey{/tcb/pad at break} to \meta{length} and
\refKey{/tcb/enlargepage flexible} to an appropriate value such that
@@ -529,7 +532,6 @@ and \refKey{/tcb/enlarge bottom at break by}.
\refKey{/tcb/extras} overwrites this key.
\end{docTcbKey}
-\enlargethispage*{1cm}
\begin{docTcbKey}[][doc new=2015-07-16]{extras unbroken and last}{=\marg{options}}{no default, initially unset}
This is an abbreviation for setting
\refKey{/tcb/extras unbroken} and
@@ -537,6 +539,7 @@ and \refKey{/tcb/enlarge bottom at break by}.
\refKey{/tcb/extras} overwrites this key.
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}[][doc new=2015-07-16]{extras first and middle}{=\marg{options}}{no default, initially unset}
This is an abbreviation for setting
@@ -545,7 +548,6 @@ and \refKey{/tcb/enlarge bottom at break by}.
\refKey{/tcb/extras} overwrites this key.
\end{docTcbKey}
-\clearpage
\begin{docTcbKey}[][doc new=2018-07-26]{extras title after break}{=\marg{options}}{no default, initially unset}
If the box has a \refKey{/tcb/title after break}, then the \meta{options}
@@ -609,7 +611,7 @@ code which \emph{may} have to be adapted.
\begin{tcolorbox}[enhanced jigsaw,size=small,breakable,colback=yellow!10!white,
colframe=red!50!white,break at=3cm,height fixed for=all]
Unbreakable |tcolorbox|es can be used without special care inside a
-|multicols| environment from the |multicol| package \cite{mittelbach:2015a}.
+|multicols| environment from the |multicol| package \cite{mittelbach:multicol}.
Since version 3.10, a breakable |tcolorbox| detects, if it is used inside
a |multicols| environment. But choosing break points for a breakable box
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
index dfe82a456e..f053690e3f 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
@@ -6,7 +6,7 @@
For the \meta{options} in \refEnv{tcolorbox} respectively \refCom{tcbset}
the following |pgf| keys can be applied. The key tree path |/tcb/| is not to
be used inside these macros. It is easy to add your own style keys using
-the syntax for |pgf| keys, see \cite{tantau:tikz_and_pgf,sturm:2016e} or the examples
+the syntax for |pgf| keys, see \cite{tantau:tikz_and_pgf,sturm:latex} or the examples
starting from page~\pageref{sec:latextutorial}.
@@ -738,6 +738,7 @@ This is a demonstration text for showing how line breaking works.
Shortcut for setting \refKey{/tcb/halign lower} to \docValue{flush right}.
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}[][doc updated=2015-05-07]{flushleft title}{}{style, no value}
Shortcut for setting \refKey{/tcb/halign title} to \docValue{flush left}.
@@ -751,7 +752,6 @@ This is a demonstration text for showing how line breaking works.
Shortcut for setting \refKey{/tcb/halign title} to \docValue{flush right}.
\end{docTcbKey}
-\clearpage
\begin{marker}
The vertical alignment settings are only relevant for boxes which are larger
@@ -1151,6 +1151,7 @@ This is the lower part.
\end{exdispExample}
\end{docTcbKey}
+\enlargethispage*{1cm}
\begin{docTcbKey}{right}{=\meta{length}}{style, no default, initially \texttt{4mm}}
Sets the right space between all text parts and frame (additional to |boxsep|).
@@ -1165,6 +1166,7 @@ This is a \textbf{tcolorbox}.
\end{exdispExample}
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}[][doc new=2017-02-16]{right*}{=\meta{length}}{style, no default}
Sets \refKey{/tcb/right} such that \meta{length} is the distance between
@@ -2395,7 +2397,7 @@ have a lower part.
This style sets \refKey{/tcb/before upper} and \refKey{/tcb/after upper}
and several geometry keys to support a |tabularx| with the
given \meta{preamble}.
- The packages |tabularx| \cite {carlisle:2016a}, |array|, and |colortbl|
+ The packages |tabularx| \cite {carlisle:tabularx}, |array|, and |colortbl|
have to be loaded separately.
\begin{exdispExample}{tabularx_1}
% \usepackage{array,tabularx}
@@ -3046,6 +3048,7 @@ enforce the \refKey{/tcb/before} setting.
the box follows a heading.
\end{docTcbKey}
+\enlargethispage*{1cm}
\begin{docTcbKey}[][doc new=2017-02-23]{parfillskip restore}{\colOpt{=true\textbar false}}{default |true|, initially |true|}
If this option is set to be |true|, the minimum value of |\parfillskip| is
@@ -4085,7 +4088,7 @@ Click me to jump to Box B.
\begin{docTcbKey}[][doc new=2017-02-10]{bookmark}{=\meta{text}}{no default, initially unset}
- Sets a PDF bookmark with the given \meta{text}, if the package |bookmark| \cite{oberdiek:2016a}
+ Sets a PDF bookmark with the given \meta{text}, if the package |bookmark| \cite{oberdiek:bookmark}
is loaded. This bookmark is set with an automated destination (the current box)
and is set one level below the current bookmark level.
\begin{dispExample*}{sbs,lefthand ratio=0.7}
@@ -4102,7 +4105,7 @@ to see the bookmark.
\begin{docTcbKey}[][doc new=2017-02-10]{bookmark*}{=\marg{options}\marg{text}}{no default, initially unset}
Identical to \refKey{/tcb/bookmark}, but additional \meta{options}
- from the package |bookmark| \cite{oberdiek:2016a} can be given.
+ from the package |bookmark| \cite{oberdiek:bookmark} can be given.
\begin{dispExample*}{sbs,lefthand ratio=0.7}
% \usepackage{bookmark}%
\begin{tcolorbox}[colback=red!10,colframe=red!50!black,
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.documentation.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.documentation.tex
index cda39d43fa..4ba5b569bf 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.documentation.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.documentation.tex
@@ -8,14 +8,17 @@ like this one. Actually, the visual nature follows the approach from
Till Tantau's |pgf| \cite{tantau:tikz_and_pgf} documentation.
Typically, this library is assumed to be used in conjunction with the
class |ltxdoc| or alike.
+Denis Bitouz\'e, Muzimuzhi, and many others provided very valuable input for this library.
The library is loaded by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{documentation}
\end{dispListing}
-This also loads the library \mylib{listings}, see \Vref{sec:listings},
+This also loads
the library \mylib{skins}, see \Vref{sec:skins},
-the library \mylib{xparse}\tcbdocmarginnote{\tcbdocnew{2014-09-19}}, see \Vref{sec:xparse},
+the library \mylib{raster}, see \Vref{sec:raster},
+the library \mylib{listings}, see \Vref{sec:listings},
+the library \mylib{xparse}, see \Vref{sec:xparse},
and a bunch of packages, namely
|pifont|, |marvosym|, |makeidx|, |marginnote|, |refcount|, and |hyperref|.
@@ -50,9 +53,12 @@ For |minted| \cite{poore:minted} support, load:
\end{dispListing}
+%\clearpage
+%-------------------------------------------------------------------------------
\subsection{Macros of the Library}
-\enlargethispage*{15mm}
-\begin{docEnvironment}[doclang/environment content=command description]{docCommand}{\oarg{options}\marg{name}\marg{parameters}}
+
+\begin{docEnvironment}[doclang/environment content=command description,doc updated=2020-04-22]
+ {docCommand}{\oarg{options}\marg{name}\marg{parameters}}
Documents a \LaTeX\ macro with given \meta{name} where \meta{name} is
written without backslash. The given \meta{options} are set with \refCom{tcbset}.
This macro takes mandatory or optional \meta{parameters}.
@@ -74,15 +80,43 @@ For |minted| \cite{poore:minted} support, load:
\end{docEnvironment}
-\begin{docEnvironment}[doclang/environment content=command description]{docCommand*}{\oarg{options}\marg{name}\marg{parameters}}
+\begin{docEnvironment}[doclang/environment content=command description,doc updated=2020-04-22]
+ {docCommand*}{\oarg{options}\marg{name}\marg{parameters}}
Identical to \refEnv{docCommand}, but without index entry.
\end{docEnvironment}
-%\clearpage
+\begin{docEnvironment}[doclang/environment content=command description,doc new=2020-04-22]
+ {docCommands}{\oarg{options}\brackets{\marg{variant1},\marg{variant2},...}}
+ Documents several (similar) \LaTeX\ macro variants simultaneously.
+ The given \meta{options} are set with \refCom{tcbset} and are valid for
+ all variants and the documentation text.
+ Every variant is described by an option set \meta{variant1}, \meta{variant2}, and so on.
+ The most crucial options are \refKey{/tcb/doc name} and \refKey{/tcb/doc parameter}.
+\begin{dispExample}
+\begin{docCommands}[
+ doc no index, % no index entries for this example
+ doc name = newtheorem,
+ doc parameter = \marg{envname},
+ ]
+ {
+ { },
+ { doc parameter = \marg{envname}\oarg{numbered within} },
+ { doc parameter = \oarg{numbered like}\marg{envname} },
+ { doc name = newtheorem* },
+ }
+ example
+\end{docCommands}
+\end{dispExample}
+\end{docEnvironment}
+
+
+
+\clearpage
{\let\xdocEnvironment\docEnvironment
\let\endxdocEnvironment\enddocEnvironment
-\begin{xdocEnvironment}[doclang/environment content=environment description]{docEnvironment}{\oarg{options}\marg{name}\marg{parameters}}
+\begin{xdocEnvironment}[doclang/environment content=environment description,doc updated=2020-04-22]
+ {docEnvironment}{\oarg{options}\marg{name}\marg{parameters}}
Documents a \LaTeX\ environment with given \meta{name}.
The given \meta{options} are set with \refCom{tcbset}.
This environment takes mandatory or optional \meta{parameters}.
@@ -106,12 +140,56 @@ For |minted| \cite{poore:minted} support, load:
{\let\xdocEnvironment\docEnvironment
\let\endxdocEnvironment\enddocEnvironment
-\begin{xdocEnvironment}[doclang/environment content=environment description]{docEnvironment*}{\oarg{options}\marg{name}\marg{parameters}}
+\begin{xdocEnvironment}[doclang/environment content=environment description,doc updated=2020-04-22]
+ {docEnvironment*}{\oarg{options}\marg{name}\marg{parameters}}
Identical to \refEnv{docEnvironment}, but without index entry.
\end{xdocEnvironment}}
+
\clearpage
-\begin{docEnvironment}[doclang/environment content=key description,doc updated=2014-09-29]{docKey}{\oarg{key path}\oarg{options}\marg{name}\marg{parameters}\marg{description}}
+{\let\xdocEnvironment\docEnvironment
+\let\endxdocEnvironment\enddocEnvironment
+\begin{xdocEnvironment}[doclang/environment content=environment description,doc new=2020-04-22]
+ {docEnvironments}{\oarg{options}\brackets{\marg{variant1},\marg{variant2},...}}
+ Documents several (similar) \LaTeX\ environment variants simultaneously.
+ The given \meta{options} are set with \refCom{tcbset} and are valid for
+ all variants and the documentation text.
+ Every variant is described by an option set \meta{variant1}, \meta{variant2}, and so on.
+ The most crucial options are \refKey{/tcb/doc name} and \refKey{/tcb/doc parameter}.
+\begin{dispExample}
+\begin{docEnvironments}[
+ doc no index, % no index entries for this example
+ doc parameter = \oarg{options}\marg{title},
+ doclang/environment content = box content,
+ ]
+ {
+ {
+ doc name = redbox,
+ doc description = a red colored box,
+ },
+ {
+ doc name = greenbox,
+ doc description = a green colored box,
+ },
+ {
+ doc name = bluebox,
+ doc description = a blue colored box,
+ },
+ {
+ doc name = custombox,
+ doc parameter = \oarg{options}\marg{color}\marg{title},
+ doc description = a colored box,
+ },
+ }
+ example
+\end{docEnvironments}
+\end{dispExample}
+\end{xdocEnvironment}}
+
+
+\clearpage
+\begin{docEnvironment}[doclang/environment content=key description,doc updated=2020-04-22]
+ {docKey}{\oarg{key path}\oarg{options}\marg{name}\marg{parameters}\marg{description}}
Documents a key with given \meta{name} and an optional \meta{key path}.
The given \meta{options} are set with \refCom{tcbset}.
This key takes mandatory or optional \meta{parameters} as value
@@ -126,15 +204,46 @@ For |minted| \cite{poore:minted} support, load:
\end{docEnvironment}
-\begin{docEnvironment}[doclang/environment content=key description,doc updated=2014-09-29]{docKey*}{\oarg{key path}\oarg{options}\marg{name}\marg{parameters}\marg{description}}
+\begin{docEnvironment}[doclang/environment content=key description,doc updated=2020-04-22]
+ {docKey*}{\oarg{key path}\oarg{options}\marg{name}\marg{parameters}\marg{description}}
Identical to \refEnv{docKey}, but without index entry.
\end{docEnvironment}
+\begin{docEnvironment}[doclang/environment content=key description,doc new=2020-04-22]
+ {docKeys}{\oarg{options}\brackets{\marg{variant1},\marg{variant2},...}}
+ Documents several (similar) key variants simultaneously.
+ The given \meta{options} are set with \refCom{tcbset} and are valid for
+ all variants and the documentation text.
+ Every variant is described by an option set \meta{variant1}, \meta{variant2}, and so on.
+ The most crucial options are
+ \refKey{/tcb/doc keypath}, \refKey{/tcb/doc name}, \refKey{/tcb/doc parameter},
+ and \refKey{/tcb/doc description}.
+\begin{dispExample}
+\begin{docKeys}[
+ doc no index, % no index entries for this example
+ doc keypath = mykeyroot,
+ doc parameter = {=\meta{length}},
+ ]
+ {
+ {
+ doc name = width,
+ doc description = initially \texttt{10cm},
+ },
+ {
+ doc name = height,
+ doc description = initially \texttt{7cm},
+ },
+ }
+ example
+\end{docKeys}
+\end{dispExample}
+\end{docEnvironment}
+\clearpage
\begin{docEnvironment}[doclang/environment content=operation description,
- doc new=2019-09-18]{docPathOperation}{\oarg{options}\marg{name}\marg{parameters}}
+ doc new and updated={2019-09-18}{2020-04-22}]{docPathOperation}{\oarg{options}\marg{name}\marg{parameters}}
Documents a \tikzname\ path operation with given \meta{name}.
The given \meta{options} are set with \refCom{tcbset}.
This \tikzname\ path operation takes mandatory or optional \meta{parameters}.
@@ -149,113 +258,191 @@ For |minted| \cite{poore:minted} support, load:
\begin{docEnvironment}[doclang/environment content=command description,
- doc new=2019-09-17]{docPathOperation*}{\oarg{options}\marg{name}\marg{parameters}}
+ doc new and updated={2019-09-18}{2020-04-22}]{docPathOperation*}{\oarg{options}\marg{name}\marg{parameters}}
Identical to \refEnv{docPathOperation}, but without index entry.
\end{docEnvironment}
+\begin{docEnvironment}[doclang/environment content=command description,
+ doc new={2020-04-22}]{docPathOperations}{\oarg{options}\brackets{\marg{variant1},\marg{variant2},...}}
+ Documents several (similar) \tikzname\ path operation variants simultaneously.
+ The given \meta{options} are set with \refCom{tcbset} and are valid for
+ all variants and the documentation text.
+ Every variant is described by an option set \meta{variant1}, \meta{variant2}, and so on.
+ The most crucial options are \refKey{/tcb/doc name} and \refKey{/tcb/doc parameter}.
+\begin{dispExample}
+\begin{docPathOperations}[
+ doc no index, % no index entries for this example
+ ]
+ {
+ {
+ doc name = rectangle,
+ doc parameter = \meta{corner or cycle},
+ },
+ {
+ doc name = circle,
+ doc parameter = \oarg{options},
+ },
+ {
+ doc name = ellipse,
+ doc parameter = \oarg{options},
+ },
+ }
+ example
+\end{docPathOperations}
+\end{dispExample}
+\end{docEnvironment}
-
-
-
-
-
-\begin{docCommand}{docValue}{\marg{name}}
+\clearpage
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docValue,
+ doc updated=2020-04-23,
+ },
+ {
+ doc name = docValue*,
+ },
+ }
Documents a value with given \meta{name}. Typically, this is a value for a key.
- This value is automatically indexed.
+ The given \meta{options} are set with \refCom{tcbset}.
+ This value is automatically indexed for \refCom{docValue}
+ and has no index entry for \refCom{docValue*}.
\begin{dispExample}
-A feasible value for \refKey{/foo/footitle} is \docValue{foovalue}.
+A feasible value for \refKey{/foo/footitle} is \docValue*{foovalue}.
\end{dispExample}
-\end{docCommand}
-
+\end{docCommands}
-\begin{docCommand}{docValue*}{\marg{name}}
- Identical to \refCom{docValue}, but without index entry.
-\end{docCommand}
-\clearpage
-\begin{docCommand}[doc updated=2014-10-09]{docAuxCommand}{\marg{name}}
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docAuxCommand,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docAuxCommand*,
+ },
+ }
Documents an auxiliary or minor \LaTeX\ macro with given \meta{name}
where \meta{name} is written without backslash.
- This macro is automatically indexed.
+ The given \meta{options} are set with \refCom{tcbset}.
+ This macro is automatically indexed for \refCom{docAuxCommand}
+ and has no index entry for \refCom{docAuxCommand*}.
\begin{dispExample}
The macro \docAuxCommand{fooaux} holds some interesting data.
\end{dispExample}
-\end{docCommand}
+\end{docCommands}
-\begin{docCommand}[doc updated=2014-10-09]{docAuxCommand*}{\marg{name}}
- Identical to \refCom{docAuxCommand}, but without index entry.
-\end{docCommand}
-\begin{docCommand}{docAuxEnvironment}{\marg{name}}
+
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docAuxEnvironment,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docAuxEnvironment*,
+ },
+ }
Documents an auxiliary or minor \LaTeX\ environment with given \meta{name}.
- This macro is automatically indexed.
+ The given \meta{options} are set with \refCom{tcbset}.
+ This macro is automatically indexed indexed for \refCom{docAuxEnvironment}
+ and has no index entry for \refCom{docAuxEnvironment*}.
\begin{dispExample}
The environment \docAuxEnvironment{fooauxenv} holds some interesting data.
\end{dispExample}
-\end{docCommand}
-
-\begin{docCommand}{docAuxEnvironment*}{\oarg{key path}\marg{name}}
- Identical to \refCom{docAuxEnvironment}, but without index entry.
-\end{docCommand}
-
-
-
-\begin{docCommand}{docAuxKey}{\oarg{key path}\marg{name}}
+\end{docCommands}
+
+
+\begin{docCommands}[doc parameter=\oarg{key path}\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docAuxKey,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docAuxKey*,
+ },
+ }
Documents an auxiliary key with given \meta{name} and an optional \meta{key path}.
- It is automatically indexed.
+ The given \meta{options} are set with \refCom{tcbset}.
+ It is automatically indexed for \refCom{docAuxKey}
+ and has no index entry for \refCom{docAuxKey*}.
\begin{dispExample}
The key \docAuxKey[foo]{fooaux} holds some interesting data.
\end{dispExample}
-\end{docCommand}
+\end{docCommands}
-\begin{docCommand}{docAuxKey*}{\oarg{key path}\marg{name}}
- Identical to \refCom{docAuxKey}, but without index entry.
-\end{docCommand}
-
-\begin{docCommand}[doc new=2015-01-08]{docCounter}{\marg{name}}
- Documents a counter with given \meta{name}. The counter is automatically indexed.
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docCounter,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docCounter*,
+ },
+ }
+ Documents a counter with given \meta{name}.
+ The given \meta{options} are set with \refCom{tcbset}.
+ The counter is automatically indexed for \refCom{docCounter}
+ and has no index entry for \refCom{docCounter*}.
\begin{dispExample}
The counter \docCounter{foocounter} can be used for computation.
\end{dispExample}
-\end{docCommand}
+\end{docCommands}
-\begin{docCommand}[doc new=2015-01-08]{docCounter*}{\marg{name}}
- Identical to \refCom{docCounter}, but without index entry.
-\end{docCommand}
-\begin{docCommand}[doc new=2015-01-08]{docLength}{\marg{name}}
- Documents a counter with given \meta{name}. The counter is automatically indexed.
+\clearpage
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docLength,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docLength*,
+ },
+ }
+ Documents a length with given \meta{name}.
+ The given \meta{options} are set with \refCom{tcbset}.
+ The length is automatically indexed for \refCom{docLength}
+ and has no index entry for \refCom{docLength*}.
\begin{dispExample}
The length \docLength{foolength} can be used for computation.
\end{dispExample}
-\end{docCommand}
-
-\begin{docCommand}[doc new=2015-01-08]{docLength*}{\marg{name}}
- Identical to \refCom{docLength}, but without index entry.
-\end{docCommand}
-
-\clearpage
-
-\begin{docCommand}{docColor}{\marg{name}}
- Documents a color with given \meta{name}. The color is automatically indexed.
+\end{docCommands}
+
+
+\begin{docCommands}[doc parameter=\oarg{options}\marg{name}]
+ {
+ {
+ doc name = docColor,
+ doc updated = 2020-04-23,
+ },
+ {
+ doc name = docColor*,
+ },
+ }
+ Documents a color with given \meta{name}.
+ The given \meta{options} are set with \refCom{tcbset}.
+ The color is automatically indexed for \refCom{docColor}
+ and has no index entry for \refCom{docColor*}.
\begin{dispExample}
The color \docColor{foocolor} is available.
\end{dispExample}
-\end{docCommand}
-
-\begin{docCommand}{docColor*}{\marg{name}}
- Identical to \refCom{docColor}, but without index entry.
-\end{docCommand}
+\end{docCommands}
\begin{docCommand}{cs}{\marg{name}}
- Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a command word \meta{name}
+ Macro from |ltxdoc| \cite{carlisle:ltxdoc} to typeset a command word \meta{name}
where the backslash is prefixed. The library overwrites the original macro.
\begin{dispExample}
This is a \cs{foocommand}.
@@ -272,7 +459,7 @@ This is a \meta{text}.
\begin{docCommand}{marg}{\marg{text}}
- Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with
+ Macro from |ltxdoc| \cite{carlisle:ltxdoc} to typeset a \meta{text} with
curly brackets as a mandatory argument. The library overwrites the original macro.
\begin{dispExample}
This is a mandatory \marg{argument}.
@@ -280,13 +467,14 @@ This is a mandatory \marg{argument}.
\end{docCommand}
\begin{docCommand}{oarg}{\marg{text}}
- Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with
+ Macro from |ltxdoc| \cite{carlisle:ltxdoc} to typeset a \meta{text} with
square brackets as an optional argument. The library overwrites the original macro.
\begin{dispExample}
This is an optional \oarg{argument}.
\end{dispExample}
\end{docCommand}
+\clearpage
\begin{docCommand}{brackets}{\marg{text}}
Sets the given \meta{text} with curly brackets.
@@ -295,7 +483,6 @@ This is an optional \oarg{argument}.
\end{dispExample}
\end{docCommand}
-\clearpage
{\let\xdispExample\dispExample
\let\endxdispExample\enddispExample
@@ -367,9 +554,9 @@ heading line. Optionally, such a box can be split in an upper and a lower part.
\end{docEnvironment}
\clearpage
-\begin{docCommand}{tcbmakedocSubKey}{\marg{name}\marg{key path}}
+\begin{docCommand}[doc updated=2020-04-22]{tcbmakedocSubKey}{\marg{name}\marg{key path}}
Creates a new environment \meta{name} based on \refEnv{docKey} for the
- documentation of keys with the given \meta{key path} as default.
+ documentation of keys with the given \meta{key path} as root.
The new environment \meta{name} takes the same para\-meters as \refEnv{docKey} itself.
A second starred environment \meta{name} is also created, which is identical
to \meta{name} but without index entry.
@@ -387,6 +574,34 @@ Some key (not indexed).
\end{docCommand}
+\begin{docCommand}[doc new=2020-04-22]{tcbmakedocSubKeys}{\marg{name}\marg{key path}}
+ Creates a new environment \meta{name} based on \refEnv{docKeys} for the
+ documentation of keys with the given \meta{key path} as root.
+ The new environment \meta{name} takes the same para\-meters as \refEnv{docKeys} itself.
+\begin{dispExample}
+\tcbmakedocSubKeys{docFooKeys}{foo}
+
+\begin{docFooKeys}[
+ doc parameter = {=\meta{nothing}},
+ doc description = {no default, initially empty},
+ ]
+ {
+ {
+ doc name = foodummy 2,
+ },
+ {
+ doc name = foo another dummy 2,
+ doc no index,
+ }
+ }
+Some description.
+\end{docFooKeys}
+\end{dispExample}
+\end{docCommand}
+
+
+\clearpage
+
\begin{docCommand}{refCom}{\marg{name}}
References a documented \LaTeX\ macro with given \meta{name} where \meta{name} is
written without backslash. The page reference is suppressed if it links
@@ -421,7 +636,7 @@ We have created \refEnv*{foocolorbox} as an example.
\end{dispExample}
\end{docCommand}
-\clearpage
+
\begin{docCommand}{refKey}{\marg{name}}
References a documented key with given \meta{name} where \meta{name}
is the full path name of the key.
@@ -440,6 +655,7 @@ We have created \refKey*{/foo/footitle} as an example.
\end{dispExample}
\end{docCommand}
+\clearpage
\begin{docCommand}[doc new=2019-09-17]{refPathOperation}{\marg{name}}
References a documented \tikzname\ path operation with given \meta{name}.
@@ -459,24 +675,25 @@ We have created \refPathOperation*{fooop} as an example.
-\begin{docCommand}{refAux}{\marg{name}}
- References some auxiliary environment, key, value, or color. The hyperlink color is
- used, but there is no real link.
+\begin{docCommand}[doc updated=2020-02-11]{refAux}{\marg{name}}
+ References some auxiliary environment, key, value, or color.
+ The \meta{name} is colored according to \refKey{/tcb/color hyperlink},
+ if |hyperref| colorlinks are set, but there is no real link.
\begin{dispExample}
Some pages back, one can see \refAux{/foo/footitle} as an example.
\end{dispExample}
\end{docCommand}
-\begin{docCommand}{refAuxcs}{\marg{name}}
+\begin{docCommand}[doc updated=2020-02-11]{refAuxcs}{\marg{name}}
References some auxiliary macro \meta{name} where \meta{name} is
- written without backslash. The hyperlink color is
- used, but there is no real link.
+ written without backslash.
+ The \meta{name} is colored according to \refKey{/tcb/color hyperlink},
+ if |hyperref| colorlinks are set, but there is no real link.
\begin{dispExample}
Some pages back, one can see \refAuxcs{fooaux} as an example.
\end{dispExample}
\end{docCommand}
-\clearpage
\begin{docCommand}{colDef}{\marg{text}}
Sets \meta{text} with the command color, see \refKey{/tcb/color command}.
@@ -492,6 +709,7 @@ This is my \colOpt{text}.
\end{dispExample}
\end{docCommand}
+\clearpage
\begin{docCommand}[doc new=2019-09-18]{colFade}{\marg{text}}
Sets \meta{text} with the fade color, see \refKey{/tcb/color fade}.
@@ -538,7 +756,458 @@ with another note.
\clearpage
-\subsection{Option Keys of the Library}
+%-------------------------------------------------------------------------------
+\subsection{Entry Content Option Keys}
+
+
+\begin{docTcbKey}[][doc new={2020-04-22}]{doc name}{=\meta{name}}{no default, initially empty}
+ Sets the \meta{name} of the entry to document, i.e. the \meta{name} of the
+ command, environment, key, etc. For \refEnv{docCommand}, \refEnv{docEnvironment}, etc.
+ the \meta{name} is set by a mandatory parameter, but can also be set
+ by \refKey{/tcb/doc name}.
+ \refKey{/tcb/doc name} also sets \meta{name} to
+ \refKey{/tcb/doc label}, \refKey{/tcb/doc index},
+ and \refKey{/tcb/doc sort index}.
+\begin{dispExample}
+\begin{docCommands}[
+ doc no index, % no index entries for this example
+ doc name = bfseries,
+ ] {}
+ Font setting to bold face.
+\end{docCommands}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new={2020-04-22}]{doc parameter}{=\meta{parameters}}{no default, initially empty}
+ Sets the \meta{parameters} of the entry to document, i.e. the \meta{parameters} of the
+ command, environment, key, etc. For \refEnv{docCommand}, \refEnv{docEnvironment}, etc.
+ the \meta{parameters} is set by a mandatory option, but can also be set
+ by \refKey{/tcb/doc parameter}.
+\begin{dispExample}
+\begin{docCommands}[
+ doc no index, % no index entries for this example
+ doc name = textbf,
+ doc parameter = \marg{text},
+ ] {}
+ Sets \meta{text} in bold face.
+\end{docCommands}
+\end{dispExample}
+\end{docTcbKey}
+
+
+
+\begin{docTcbKey}[][doc new={2020-04-22}]{doc keypath}{=\meta{key path}}{no default, initially empty}
+ Sets the \meta{key path} of the key to document. For \refEnv{docKey}
+ and \refEnv{docKey*} the \meta{key path} is set by a specialized option,
+ but can also be set by \refKey{/tcb/doc keypath}.
+\begin{dispExample}
+\begin{docKeys}[
+ doc no index, % no index entries for this example
+ doc keypath = tikz,
+ doc name = fill,
+ doc parameter = \colOpt{=\meta{color}},
+ doc description = default is scope's color setting,
+ ] {}
+ This option causes the path to be filled.
+\end{docKeys}
+\end{dispExample}
+\end{docTcbKey}
+
+\clearpage
+
+\begin{docTcbKey}{doc description}{=\meta{description}}{no default, initially empty}
+ Sets a (short!) additional \meta{description} for
+ \refEnv{docCommand}, \refEnv{docEnvironment}, or \refEnv{docPathOperation}.
+ Such a description is
+ mandatory for \refEnv{docKey}.
+\begin{dispExample}
+\begin{docCommand*}[doc description=my description]{myCommandF}{\marg{argument}}
+ This is the documentation of \refCom{myCommandF} which takes one \meta{argument}.
+ \refCom{myCommandF} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\begin{marker}
+Note that the description \meta{text} may overlap with the text on the left
+hand side if too long. Linebreaks can be used inside the \meta{text}.
+\end{marker}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new={2019-09-18}]{doc label}{=\meta{text}}{no default, initially unset}
+ If used inside the option list of \refEnv{docCommand}, \refEnv{docEnvironment},
+ \refEnv{docKey}, etc, then \meta{text} is used
+ for labeling instead of the name of the definition.
+\begin{dispExample}
+\begin{docPathOperation*}[doc label=pathline]{-{}-}{\meta{coordinate or cycle}}
+ This is the documentation of \refPathOperation{pathline}.
+\end{docPathOperation*}
+\end{dispExample}
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new={2020-01-07}]{doc index}{=\meta{text}}{no default, initially unset}
+ If used inside the option list of \refEnv{docCommand}, \refEnv{docEnvironment},
+ \refEnv{docKey}, etc, then \meta{text} is used
+ for the index instead of the name of the definition.
+\begin{dispExample}
+\begin{docPathOperation}[doc index=foo path (horizontal then vertical),
+ doc label=pathline2]{-\textbar}{\meta{coordinate or cycle}}
+ This is the documentation of \refPathOperation{pathline2}.
+\end{docPathOperation}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new={2020-04-23}]{doc sort index}{=\meta{text}}{no default, initially unset}
+ If used inside the option list of \refEnv{docCommand}, \refEnv{docEnvironment},
+ \refEnv{docKey}, etc, then \meta{text} is used
+ for as sort key for the index instead of the name of the definition.
+\begin{dispListing}
+\begin{docCommands}[
+ doc name = l_tcobox_example_tl,
+ doc sort index = example_tl, % sorted unter e like example
+ ]{}
+\end{docCommands}
+\end{dispListing}
+\end{docTcbKey}
+
+\clearpage
+
+\begin{docTcbKey}{doc into index}{\colOpt{=true\textbar false}}{default |true|, initially |true|}
+ If set to |false|, no index entries are written for the main documentation
+ environments. The same effect is achieved by using e.\,g.\ \refEnv{docCommand*}
+ instead of \refEnv{docCommand}.
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new={2020-04-22}]{doc no index}{}{style, initially unset}
+ If set, no index entries are written for the main documentation
+ environments. This is a shortcut for using \refKey{/tcb/doc into index}|=false|.
+\end{docTcbKey}
+
+
+
+\begin{docTcbKey}[][doc new=2014-09-19]{doc marginnote}{=\meta{options}}{no default, initially empty}
+ Sets style \meta{options} for the displayed box of the \refCom{tcbdocmarginnote} command.
+\begin{dispExample}
+\tcbset{doc marginnote={colframe=blue!50!white,colback=blue!5!white}}%
+This is some text\tcbdocmarginnote{Note A}
+which is commented by a note inside the margin.
+\end{dispExample}
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new=2014-09-19]{doc new}{=\meta{date}}{style, no default}
+ Adds a a marginnote with a 'New: \meta{data}' message at the beginning of
+ the upper box part. The intended use is inside the option list of
+ \refEnv{docCommand}, \refEnv{docEnvironment}, etc.
+ \makeatletter\renewcommand*{\tcbdocnew}[1]{\kvtcb@text@new: #1}\makeatother%
+\begin{dispExample}
+\begin{docCommand}[doc new=2000-01-01]{foosomething}{\marg{text}}
+Some command for something.
+\end{docCommand}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2014-09-19]{doc updated}{=\meta{date}}{style, no default}
+ Adds a marginnote with a 'Updated: \meta{data}' message at the beginning of
+ the upper box part. See \refKey{/tcb/doc new}.
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2014-09-19]{doc new and updated}{=\marg{new date}\marg{update date}}{style, no default}
+ Adds a marginnote with 'New: \meta{new date}' and 'Updated: \meta{update data}' messages at the beginning of
+ the upper box part. See \refKey{/tcb/doc new}.
+\end{docTcbKey}
+
+
+
+\clearpage
+%-------------------------------------------------------------------------------
+\subsection{Entry Customization Option Keys}
+
+
+\begin{docTcbKey}{doc left}{=\meta{length}}{no default, initially |2em|}
+ Sets the left hand offset of the documentation texts from
+ \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
+\begin{dispExample}
+\begin{docCommand*}[doc left=2cm,doc left indent=-2cm]{myCommandA}{\marg{argument}}
+ This is the documentation of \refCom{myCommandA} which takes one \meta{argument}.
+ \refCom{myCommandA} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+\begin{docTcbKey}{doc right}{=\meta{length}}{no default, initially |0em|}
+ Sets the right hand offset of the documentation texts from
+ \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
+\begin{dispExample}
+\begin{docCommand*}[doc right=2cm]{myCommandB}{\marg{argument}}
+ This is the documentation of \refCom{myCommandB} which takes one \meta{argument}.
+ \refCom{myCommandB} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+\begin{docTcbKey}{doc left indent}{=\meta{length}}{no default, initially |-2em|}
+ Sets the left hand indent of documentation heads from
+ \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
+\begin{dispExample}
+\begin{docCommand*}[doc left indent=2cm]{myCommandC}{\marg{argument}}
+ This is the documentation of \refCom{myCommandC} which takes one \meta{argument}.
+ \refCom{myCommandC} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}{doc right indent}{=\meta{length}}{no default, initially |0pt|}
+ Sets the right hand indent of documentation heads from
+ \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
+\begin{dispExample}
+\begin{docCommand*}[doc right indent=-10mm,doc right=10mm,
+ doc description=test value]{myCommandD}{\marg{argument}}
+ This is the documentation of \refCom{myCommandD} which takes one \meta{argument}.
+ \refCom{myCommandD} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+\clearpage
+The head lines of the main documentation environments \refEnv{docCommand},
+\refEnv{docEnvironment}, \refEnv{docKey}, etc, are |tcolorbox|es inside a
+\refEnv{tcbraster}.
+Options to the surrounding |tcbraster|s and the embedded
+|tcolorbox|es can be given using the following keys.
+
+
+\begin{docTcbKeys}[
+ doc name = doc raster command,
+ doc parameter = {=\meta{options}},
+ doc description = {no default, initially empty},
+ doc new = 2020-04-24,
+]{}
+ Sets \meta{options} for the surrounding \refEnv{tcbraster} of\\
+ \refEnv{docCommand}, \refEnv{docCommand*}, and \refEnv{docCommands}.
+
+\begin{dispExample}
+\tcbset{doc raster command={raster before skip=7mm,raster after skip=0mm}}
+
+The is an example text.
+
+\begin{docCommand*}{myCommandI}{\marg{argument}}
+ This is the documentation of \refCom{myCommandI} which takes one \meta{argument}.
+ \refCom{myCommandI} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+
+\end{docTcbKeys}
+
+
+\begin{docTcbKeys}[
+ doc name = doc raster environment,
+ doc parameter = {=\meta{options}},
+ doc description = {no default, initially empty},
+ doc new = 2020-04-24,
+]{}
+ Sets \meta{options} for the surrounding \refEnv{tcbraster} of\\
+ \refEnv{docEnvironment}, \refEnv{docEnvironment*}, and \refEnv{docEnvironments}.
+\end{docTcbKeys}
+
+
+\begin{docTcbKeys}[
+ doc name = doc raster key,
+ doc parameter = {=\meta{options}},
+ doc description = {no default, initially empty},
+ doc new = 2020-04-24,
+]{}
+ Sets \meta{options} for the surrounding \refEnv{tcbraster} of\\
+ \refEnv{docKey}, \refEnv{docKey*}, and \refEnv{docKeys}.
+\end{docTcbKeys}
+
+
+\begin{docTcbKeys}[
+ doc name = doc raster path,
+ doc parameter = {=\meta{options}},
+ doc description = {no default, initially empty},
+ doc new = 2020-04-24,
+]{}
+ Sets \meta{options} for the surrounding \refEnv{tcbraster} of\\
+ \refEnv{docPathOperation}, \refEnv{docPathOperation*}, and \refEnv{docPathOperations}.
+\end{docTcbKeys}
+
+
+\begin{docTcbKeys}[
+ doc name = doc raster,
+ doc parameter = {=\meta{options}},
+ doc description = {no default, initially empty},
+ doc new = 2020-04-24,
+]{}
+ Shortcut for setting the same \meta{options} for
+ \refKey{/tcb/doc raster command}, \refKey{/tcb/doc raster environment},
+ \refKey{/tcb/doc raster key}, and \refKey{/tcb/doc raster path}.
+\end{docTcbKeys}
+
+
+\begin{docTcbKey}{doc head command}{=\meta{options}}{no default, initially empty}
+ Sets \meta{options} for the head line of
+ \refEnv{docCommand}, \refEnv{docCommand*}, and \refEnv{docCommands}.
+\begin{dispExample}
+\tcbset{doc head command={interior style={fill,left color=red!20!white,
+ right color=blue!20!white}}}
+
+\begin{docCommand*}{myCommandE}{\marg{argument}}
+ This is the documentation of \refCom{myCommandE} which takes one \meta{argument}.
+ \refCom{myCommandE} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\clearpage
+
+\begin{docTcbKey}{doc head environment}{=\meta{options}}{no default, initially empty}
+ Sets \meta{options} for the head line of
+ \refEnv{docEnvironment}, \refEnv{docEnvironment*}, and \refEnv{docEnvironments}.
+\begin{dispExample}
+\tcbset{doc head environment={beamer,boxsep=2pt,arc=2pt,colback=green!20!white}}
+
+\begin{docEnvironment*}{myEnvironment}{\marg{argument}}
+ This is the documentation of \refEnv{myEnvironment} which
+ takes one \meta{argument}.
+\end{docEnvironment*}
+\end{dispExample}
+\end{docTcbKey}
+
+\begin{docTcbKey}{doc head key}{=\meta{options}}{no default, initially empty}
+ Sets \meta{options} for the head line of
+ \refEnv{docKey}, \refEnv{docKey*}, and \refEnv{docKeys}.
+\begin{dispExample}
+\tcbset{doc head key={boxsep=4pt,arc=4pt,boxrule=0.6pt,
+ frame style=fill,interior style=fill,colframe=green!50!black}}
+
+\begin{docKey}{/foo/myKey}{}{no value}
+ This is the documentation of \refKey{/foo/myKey}.
+\end{docKey}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2019-09-18]{doc head path}{=\meta{options}}{no default, initially empty}
+ Sets \meta{options} for the head line of
+ \refEnv{docPathOperation}, \refEnv{docPathOperation*}, and \refEnv{docPathOperations}.
+\begin{dispExample}
+\tcbset{doc head command={interior style={fill,left color=red!7!white,
+ right color=blue!7!white}}}
+
+\begin{docPathOperation*}{-{}-}{\meta{coordinate or cycle}}
+ This is the documentation of \refPathOperation{-{}-}.
+\end{docPathOperation*}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc updated=2019-09-18]{doc head}{=\meta{options}}{no default, initially empty}
+ Shortcut for setting the same \meta{options} for
+ \refKey{/tcb/doc head command}, \refKey{/tcb/doc head environment},
+ \refKey{/tcb/doc head key}, and \refKey{/tcb/doc head path}.
+\end{docTcbKey}
+
+
+\clearpage
+
+The description texts of the main documentation environments \refEnv{docCommand},
+\refEnv{docEnvironment}, \refEnv{docKey}, etc, are set in a compact form without
+indention and |parskip=0pt|. This settings can overruled by using the following
+keys to insert code before (or after) the description texts.
+
+\begin{docTcbKey}[][doc new=2015-10-09]{before doc body command}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} before the description texts
+ of \refEnv{docCommand} and \refEnv{docCommand*}.
+\begin{dispExample}
+\tcbset{before doc body command={%
+ \setlength{\parindent}{2.5em}%
+ \setlength{\parskip}{1ex plus 0.75ex minus 0.25ex}%
+}}
+
+\begin{docCommand*}{myCommandG}{\marg{argument}}
+ This is the documentation of \refCom{myCommandG} which takes one \meta{argument}.
+ \refCom{myCommandG} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2015-10-09]{after doc body command}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} after the description texts
+ of \refEnv{docCommand} and \refEnv{docCommand*}.
+\begin{dispExample}
+\tcbset{after doc body command={%
+ \hfill\nolinebreak[1]\hspace*{\fill}\textcolor{red}{$\diamondsuit$}%
+}}
+
+\begin{docCommand*}{myCommandH}{\marg{argument}}
+ This is the documentation of \refCom{myCommandH} which takes one \meta{argument}.
+ \refCom{myCommandH} does some funny things with its \meta{argument}.
+\end{docCommand*}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2015-10-09]{before doc body environment}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} before the description texts
+ of \refEnv{docEnvironment} and \refEnv{docEnvironment*}.
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new=2015-10-09]{after doc body environment}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} after the description texts
+ of \refEnv{docEnvironment} and \refEnv{docEnvironment*}.
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new=2015-10-09]{before doc body key}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} before the description texts
+ of \refEnv{docKey} and \refEnv{docKey*}.
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new=2015-10-09]{after doc body key}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} after the description texts
+ of \refEnv{docKey} and \refEnv{docKey*}.
+\end{docTcbKey}
+
+\clearpage
+
+\begin{docTcbKey}[][doc new=2019-09-18]{before doc body path}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} before the description texts
+ of \refEnv{docPathOperation} and \refEnv{docPathOperation*}.
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new=2019-09-18]{after doc body path}{=\meta{code}}{no default, initially empty}
+ Executes \meta{code} after the description texts
+ of \refEnv{docPathOperation} and \refEnv{docPathOperation*}.
+\end{docTcbKey}
+
+
+\begin{docTcbKey}[][doc new and updated={2015-10-09}{2019-09-18}]{before doc body}{=\meta{options}}{no default, initially empty}
+ Shortcut for setting the same \meta{options} for
+ \refKey{/tcb/before doc body command}, \refKey{/tcb/before doc body environment},
+ \refKey{/tcb/before doc body key}, and \refKey{/tcb/before doc body path}.
+\end{docTcbKey}
+
+\begin{docTcbKey}[][doc new and updated={2015-10-09}{2019-09-18}]{after doc body}{=\meta{options}}{no default, initially empty}
+ Shortcut for setting the same \meta{options} for
+ \refKey{/tcb/after doc body command}, \refKey{/tcb/after doc body environment},
+ \refKey{/tcb/after doc body key}, and \refKey{/tcb/after doc body path}.
+\end{docTcbKey}
+
+
+
+
+
+
+
+\clearpage
+\subsection{General Customization Option Keys}
\begin{docTcbKey}[][doc updated=2015-03-16]{docexample}{}{style, no value}
Sets the style for \refEnv{dispExample} and \refEnv{dispListing}
@@ -556,7 +1225,7 @@ with another note.
\end{docTcbKey}
\begin{docTcbKey}{documentation listing options}{=\meta{key list}}{no default,\\\hspace*{\fill} initially |style=tcbdocumentation|}
- Sets the options from the package |listings| \cite{hoffmann:2018a}.
+ Sets the options from the package |listings| \cite{hoffmann:listings}.
They are used inside \refEnv{dispExample} and \refEnv{dispListing} to typeset
the listings. Note that this is not identical to the key
\refKey{/tcb/listing options} which is used for 'normal' listings.\\
@@ -566,7 +1235,7 @@ with another note.
\begin{docTcbKey}{documentation listing style}{=\meta{listing style}}{no default, initially |tcbdocumentation|}
Abbreviation for |documentation listing options={style=...}|.
This key sets a \meta{style}
- for the |listings| package, see \cite{hoffmann:2018a}.
+ for the |listings| package, see \cite{hoffmann:listings}.
Note that this is not identical to the key
\refKey{/tcb/listing style} which is used for 'normal' listings.\\
Used for \refKey{/tcb/listing engine}|=listings| only.
@@ -667,7 +1336,8 @@ instead. Also see \refKey{/tcb/docexample}.
\item\docValue{pgf}: Alias for |pgfsection|.
\item\docValue{doc}: The index is assumed to be formatted by |doc| or |ltxdoc|. The usage of |makeindex|
with |-s gind.ist| is assumed. The package |hypdoc| has to be loaded
- \emph{before} |tcolorbox|.
+ \emph{before} |tcolorbox|. Only a limited set of customizations will
+ work! This option cannot be unset when used!
\item\docValue{off}: The index is not formatted by |tcolorbox|. Use this, if
the index is formatted by other package like |imakeidx|.
\end{itemize}
@@ -771,6 +1441,9 @@ instead. Also see \refKey{/tcb/docexample}.
\clearpage
+%-------------------------------------------------------------------------------
+\subsection{Language Option Keys}
+
The following keys are provided for language specific settings.
The English language is predefined.
@@ -856,269 +1529,11 @@ The English language is predefined.
-\clearpage
-\begin{docTcbKey}{doc left}{=\meta{length}}{no default, initially |2em|}
- Sets the left hand offset of the documentation texts from
- \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
-\begin{dispExample}
-\begin{docCommand*}[doc left=2cm,doc left indent=-2cm]{myCommandA}{\marg{argument}}
- This is the documentation of \refCom{myCommandA} which takes one \meta{argument}.
- \refCom{myCommandA} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}{doc right}{=\meta{length}}{no default, initially |0em|}
- Sets the right hand offset of the documentation texts from
- \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
-\begin{dispExample}
-\begin{docCommand*}[doc right=2cm]{myCommandB}{\marg{argument}}
- This is the documentation of \refCom{myCommandB} which takes one \meta{argument}.
- \refCom{myCommandB} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}{doc left indent}{=\meta{length}}{no default, initially |-2em|}
- Sets the left hand indent of documentation heads from
- \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
-\begin{dispExample}
-\begin{docCommand*}[doc left indent=2cm]{myCommandC}{\marg{argument}}
- This is the documentation of \refCom{myCommandC} which takes one \meta{argument}.
- \refCom{myCommandC} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\enlargethispage*{10mm}
-\begin{docTcbKey}{doc right indent}{=\meta{length}}{no default, initially |0pt|}
- Sets the right hand indent of documentation heads from
- \refEnv{docCommand}, \refEnv{docEnvironment}, \refEnv{docKey}, etc, to \meta{length}.
-\begin{dispExample}
-\begin{docCommand*}[doc right indent=-10mm,doc right=10mm,
- doc description=test value]{myCommandD}{\marg{argument}}
- This is the documentation of \refCom{myCommandD} which takes one \meta{argument}.
- \refCom{myCommandD} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\clearpage
-The head lines of the main documentation environments \refEnv{docCommand},
-\refEnv{docEnvironment}, \refEnv{docKey}, etc, are set inside |tcolorbox|es.
-Options to these |tcolorbox|es can be given using the following keys.
-
-\begin{docTcbKey}{doc head command}{=\meta{options}}{no default, initially empty}
- Sets \meta{options} for the head line of \refEnv{docCommand} and \refEnv{docCommand*}.
-\begin{dispExample}
-\tcbset{doc head command={interior style={fill,left color=red!20!white,
- right color=blue!20!white}}}
-
-\begin{docCommand*}{myCommandE}{\marg{argument}}
- This is the documentation of \refCom{myCommandE} which takes one \meta{argument}.
- \refCom{myCommandE} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}{doc head environment}{=\meta{options}}{no default, initially empty}
- Sets \meta{options} for the head line of \refEnv{docEnvironment} and \refEnv{docEnvironment*}.
-\begin{dispExample}
-\tcbset{doc head environment={beamer,boxsep=2pt,arc=2pt,colback=green!20!white,
- after=\par\smallskip}}
-
-\begin{docEnvironment*}{myEnvironment}{\marg{argument}}
- This is the documentation of \refEnv{myEnvironment} which
- takes one \meta{argument}.
-\end{docEnvironment*}
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}{doc head key}{=\meta{options}}{no default, initially empty}
- Sets \meta{options} for the head line of \refEnv{docKey} and \refEnv{docKey*}.
-\begin{dispExample}
-\tcbset{doc head key={boxsep=4pt,arc=4pt,boxrule=0.6pt,
- frame style=fill,interior style=fill,colframe=green!50!black}}
-
-\begin{docKey*}{/foo/myKey}{}{no value}
- This is the documentation of \refKey{/foo/myKey}.
-\end{docKey*}
-\end{dispExample}
-\end{docTcbKey}
-
-\clearpage
-\begin{docTcbKey}[][doc new=2019-09-18]{doc head path}{=\meta{options}}{no default, initially empty}
- Sets \meta{options} for the head line of \refEnv{docPathOperation} and \refEnv{docPathOperation*}.
-\begin{dispExample}
-\tcbset{doc head command={interior style={fill,left color=red!7!white,
- right color=blue!7!white}}}
-
-\begin{docPathOperation*}{-{}-}{\meta{coordinate or cycle}}
- This is the documentation of \refPathOperation{-{}-}.
-\end{docPathOperation*}
-\end{dispExample}
-\end{docTcbKey}
-
-
-\begin{docTcbKey}[][doc updated=2019-09-18]{doc head}{=\meta{options}}{no default, initially empty}
- Shortcut for setting the same \meta{options} for
- \refKey{/tcb/doc head command}, \refKey{/tcb/doc head environment},
- \refKey{/tcb/doc head key}, and \refKey{/tcb/doc head path}.
-\end{docTcbKey}
-
-
-The description texts of the main documentation environments \refEnv{docCommand},
-\refEnv{docEnvironment}, \refEnv{docKey}, etc, are set in a compact form without
-indention and |parskip=0pt|. This settings can overruled by using the following
-keys to insert code before (or after) the description texts.
-
-\begin{docTcbKey}[][doc new=2015-10-09]{before doc body command}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} before the description texts
- of \refEnv{docCommand} and \refEnv{docCommand*}.
-\begin{dispExample}
-\tcbset{before doc body command={%
- \setlength{\parindent}{2.5em}%
- \setlength{\parskip}{1ex plus 0.75ex minus 0.25ex}%
-}}
-
-\begin{docCommand*}{myCommandG}{\marg{argument}}
- This is the documentation of \refCom{myCommandG} which takes one \meta{argument}.
- \refCom{myCommandG} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-
-\begin{docTcbKey}[][doc new=2015-10-09]{after doc body command}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} after the description texts
- of \refEnv{docCommand} and \refEnv{docCommand*}.
-\begin{dispExample}
-\tcbset{after doc body command={%
- \hfill\nolinebreak[1]\hspace*{\fill}\textcolor{red}{$\diamondsuit$}%
-}}
-
-\begin{docCommand*}{myCommandH}{\marg{argument}}
- This is the documentation of \refCom{myCommandH} which takes one \meta{argument}.
- \refCom{myCommandH} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\end{docTcbKey}
-
-\clearpage
-\begin{docTcbKey}[][doc new=2015-10-09]{before doc body environment}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} before the description texts
- of \refEnv{docEnvironment} and \refEnv{docEnvironment*}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2015-10-09]{after doc body environment}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} after the description texts
- of \refEnv{docEnvironment} and \refEnv{docEnvironment*}.
-\end{docTcbKey}
-
-
-\begin{docTcbKey}[][doc new=2015-10-09]{before doc body key}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} before the description texts
- of \refEnv{docKey} and \refEnv{docKey*}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2015-10-09]{after doc body key}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} after the description texts
- of \refEnv{docKey} and \refEnv{docKey*}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2019-09-18]{before doc body path}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} before the description texts
- of \refEnv{docPathOperation} and \refEnv{docPathOperation*}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2019-09-18]{after doc body path}{=\meta{code}}{no default, initially empty}
- Executes \meta{code} after the description texts
- of \refEnv{docPathOperation} and \refEnv{docPathOperation*}.
-\end{docTcbKey}
-
-
-\begin{docTcbKey}[][doc new and updated={2015-10-09}{2019-09-18}]{before doc body}{=\meta{options}}{no default, initially empty}
- Shortcut for setting the same \meta{options} for
- \refKey{/tcb/before doc body command}, \refKey{/tcb/before doc body environment},
- \refKey{/tcb/before doc body key}, and \refKey{/tcb/before doc body path}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new and updated={2015-10-09}{2019-09-18}]{after doc body}{=\meta{options}}{no default, initially empty}
- Shortcut for setting the same \meta{options} for
- \refKey{/tcb/after doc body command}, \refKey{/tcb/after doc body environment},
- \refKey{/tcb/after doc body key}, and \refKey{/tcb/after doc body path}.
-\end{docTcbKey}
-%\clearpage
-\begin{docTcbKey}{doc description}{=\meta{text}}{no default, initially empty}
- Sets a (short!) additional description \meta{text} for
- \refEnv{docCommand}, \refEnv{docEnvironment}, or \refEnv{docPathOperation}.
- Such a description is
- mandatory for \refEnv{docKey}.
-\begin{dispExample}
-\begin{docCommand*}[doc description=my description]{myCommandF}{\marg{argument}}
- This is the documentation of \refCom{myCommandF} which takes one \meta{argument}.
- \refCom{myCommandF} does some funny things with its \meta{argument}.
-\end{docCommand*}
-\end{dispExample}
-\begin{marker}
-Note that the description \meta{text} may overlap with the text on the left
-hand side if too long. Linebreaks can be used inside the \meta{text}.
-\end{marker}
-\end{docTcbKey}
\clearpage
-\begin{docTcbKey}[][doc new={2019-09-18}]{doc label}{=\meta{text}}{no default, initially unset}
- If used inside the option list of \refEnv{docCommand}, \refEnv{docEnvironment},
- \refEnv{docKey}, or \refEnv{docPathOperation}, then \meta{text} is used
- for labeling instead of the name of the definition.
-\begin{dispExample}
-\begin{docPathOperation*}[doc label=pathline]{-{}-}{\meta{coordinate or cycle}}
- This is the documentation of \refPathOperation{pathline}.
-\end{docPathOperation*}
-\end{dispExample}
-\end{docTcbKey}
-
-
-\begin{docTcbKey}{doc into index}{\colOpt{=true\textbar false}}{default |true|, initially |true|}
- If set to |false|, no index entries are written for the main documentation
- environments. The same effect is achieved by using e.\,g.\ \refEnv{docCommand*}
- instead of \refEnv{docCommand}.
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2014-09-19]{doc marginnote}{=\meta{options}}{no default, initially empty}
- Sets style \meta{options} for the displayed box of the \refCom{tcbdocmarginnote} command.
-\begin{dispExample}
-\tcbset{doc marginnote={colframe=blue!50!white,colback=blue!5!white}}%
-This is some text\tcbdocmarginnote{Note A}
-which is commented by a note inside the margin.
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2014-09-19]{doc new}{=\meta{date}}{style, no default}
- Adds a a marginnote with a 'New: \meta{data}' message at the beginning of
- the upper box part. The intended use is inside the option list of
- \refEnv{docCommand}, \refEnv{docEnvironment}, etc.
- \makeatletter\renewcommand*{\tcbdocnew}[1]{\kvtcb@text@new: #1}\makeatother%
-\begin{dispExample}
-\begin{docCommand}[doc new=2000-01-01]{foosomething}{\marg{text}}
-Some command for something.
-\end{docCommand}
-\end{dispExample}
-\end{docTcbKey}
-
-\begin{docTcbKey}[][doc new=2014-09-19]{doc updated}{=\meta{date}}{style, no default}
- Adds a marginnote with a 'Updated: \meta{data}' message at the beginning of
- the upper box part. See \refKey{/tcb/doc new}.
-\end{docTcbKey}
-
-
-\begin{docTcbKey}[][doc new=2014-09-19]{doc new and updated}{=\marg{new date}\marg{update date}}{style, no default}
- Adds a marginnote with 'New: \meta{new date}' and 'Updated: \meta{update data}' messages at the beginning of
- the upper box part. See \refKey{/tcb/doc new}.
-\end{docTcbKey}
\subsection{Predefined Colors of the Library}\tcbdocmarginnote{\tcbdocupdated{2019-09-18}}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.filling.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.filling.tex
index f6b20fb2e2..c91bc1bb19 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.filling.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.filling.tex
@@ -18,7 +18,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with an external image referenced by \meta{file name}.
The image is put in the center of the path, but it is not resized to fit into
the path area.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill plain image=goldshade.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -34,9 +34,10 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
The image is put in the center of the path, but it is not resized to fit into
the path area.
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
-\path[draw,fill plain image*={width=2.5cm}{goldshade.png}]
+\path[draw,
+ fill plain image*={width=2.5cm}{goldshade.png}]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
\foreach \w in {45,90,...,315}
{ -- (\w:1.5cm) } -- cycle;
@@ -49,7 +50,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with the given \meta{graphical code}.
The result is put in the center of the path, but it is not resized to fit into
the path area. Note that this is almost identical to the standard |path picture| option.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill plain picture={%
\draw[red!50!yellow,line width=2mm]
@@ -70,7 +71,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill stretch image}{=\meta{file name}}{no default, initially unset}
Fills the current path with an external image referenced by \meta{file name}.
The image is stretched to fill the path area.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill stretch image=goldshade.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -85,7 +86,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with an external image referenced by \meta{file name}.
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
The image is stretched to fill the path area.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill stretch image*=
{angle=90,origin=c}{goldshade.png}]
@@ -100,7 +101,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill stretch picture}{=\meta{graphical code}}{no default, initially unset}
Fills the current path with the given \meta{graphical code}.
The result is stretched to fill the path area.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill stretch picture={%
\draw[red!50!yellow,line width=2mm]
@@ -121,7 +122,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill overzoom image}{=\meta{file name}}{no default, initially unset}
Fills the current path with an external image referenced by \meta{file name}.
The image is zoomed such that the path area fills the image.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill overzoom image=goldshade.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -136,7 +137,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with an external image referenced by \meta{file name}.
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
The image is zoomed such that the path area fills the image.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill overzoom image*=
{angle=90,origin=c}{goldshade.png}]
@@ -151,7 +152,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill overzoom picture}{=\meta{graphical code}}{no default, initially unset}
Fills the current path with the given \meta{graphical code}.
The result is zoomed such that the path area fills the image.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill overzoom picture={%
\draw[red!50!yellow,line width=2mm]
@@ -173,7 +174,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with an external image referenced by \meta{file name}.
The image is zoomed such that it fits inside the path area.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill zoom image=goldshade.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -189,7 +190,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
The image is zoomed such that it fits inside the path area.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill zoom image*=
{angle=90,origin=c}{goldshade.png}]
@@ -205,7 +206,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
Fills the current path with the given \meta{graphical code}.
The result is zoomed such that it fits inside the path area.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill zoom picture={%
\draw[red!50!yellow,line width=2mm]
@@ -228,7 +229,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
The image is zoomed such that it fits inside the path area, but it never
gets enlarged.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill shrink image=goldshade.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -245,9 +246,10 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
The image is zoomed such that it fits inside the path area, but it never
gets enlarged.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
-\path[draw,fill shrink image*={width=1.5cm}{goldshade.png}]
+\path[draw,
+ fill shrink image*={width=1.5cm}{goldshade.png}]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
\foreach \w in {45,90,...,315}
{ -- (\w:1.5cm) } -- cycle;
@@ -261,7 +263,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
The result is zoomed such that it fits inside the path area, but it never
gets enlarged.
Typically, some parts of the path area will stay unfilled.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill shrink picture={%
\draw[red!50!yellow,line width=2mm]
@@ -281,7 +283,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\subsection{Fill Tile}
\begin{docTikzKey}{fill tile image}{=\meta{file name}}{no default, initially unset}
Fills the current path with a tile pattern using an external image referenced by \meta{file name}.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill tile image=pink_marble.png]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -295,7 +297,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill tile image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset}
Fills the current path with a tile pattern using an external image referenced by \meta{file name}.
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill tile image*={width=1cm}{pink_marble.png}]
(2.75,-0.75) -- (3,0) -- (2.75,0.75)
@@ -307,7 +309,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill tile picture}{=\meta{graphical code}}{no default, initially unset}
Fills the current path with a tile pattern using the given \meta{graphical code}.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill tile picture={%
\draw[red!50!yellow,line width=2mm]
@@ -326,7 +328,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
\begin{docTikzKey}{fill tile picture*}{=\marg{fraction}\marg{graphical code}}{no default, initially unset}
Fills the current path with a tile pattern using the given \meta{graphical code}.
The graphic is resized by \meta{fraction}.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[draw,fill tile picture*={0.25}{%
\draw[red!50!yellow,line width=2mm]
@@ -384,7 +386,7 @@ See \Vref{sec:skins} for the documentation of all other options of the \mylib{sk
for the image fill options. This can be just together with
\refKey{/tikz/fill stretch image}, \refKey{/tikz/fill overzoom image}, \refKey{/tikz/fill zoom image},
and \refKey{/tikz/fill tile image}.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\path[fill image options={width=1cm},
fill tile image=pink_marble.png]
@@ -429,7 +431,7 @@ all corners by little arcs. |\tcbpatcharcangular| is a patch which
straightens the arcs. To say it more prosaic, the little arcs are replaced
by little straight lines.
-\begin{dispExample*}{sbs,lefthand ratio=0.66}
+\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower}
\begin{tikzpicture}
\draw[thick,rounded corners=8pt]
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0)
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.fitting.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.fitting.tex
index 8ff8fa0792..20feddda9a 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.fitting.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.fitting.tex
@@ -93,14 +93,32 @@ elaborate methods to create new commands.
An existing macro is redefined.
\end{docCommand}
-\enlargethispage*{1cm}
+
+\clearpage
+
+\begin{docCommands}[
+ doc name = tcbfitdim,
+ doc description = {read-only \LaTeX\ length},
+ doc updated = 2020-04-24,
+ ]{}
+ This is a \LaTeX\ length adapted automatically by most variants of
+ \refKey{/tcb/fit algorithm}. Therefore, it never is to be
+ changed by the user, but may be applied read-only.
+ The \refCom{tcbfitdim} corresponds to the font size and may also
+ be used to calculate box margins or other distances in dependency.
+ The initial and maximum value for \refCom{tcbfitdim} is set by
+ \refKey{/tcb/fit basedim}.
+\end{docCommands}
+
+
\begin{docCommand}{tcbfontsize}{\marg{factor}}
Selects a font size inside a tcolorbox which is scaled with the given
- \meta{factor} relative to \docAuxCommand{tcbfitdim}.%
- %, see Subsection \ref{subsec:fit} from page \pageref{subsec:fit}.
+ \meta{factor} relative to \refCom{tcbfitdim}.
+ Also see \refKey{/tcb/fit fontsize macros}
\begin{dispExample*}{sbs,lefthand ratio=0.6}
-\tcbset{colback=red!5!white,colframe=red!75!black}
+\tcbset{colback=red!5!white,size=small,
+ colframe=red!75!black}
\begin{tcolorbox}[fit basedim=10pt]
{\tcbfontsize{0.25} Very tiny,}\\
{\tcbfontsize{0.5} Small,}\\
@@ -109,6 +127,18 @@ elaborate methods to create new commands.
{\tcbfontsize{4} Huge.}
\end{tcolorbox}
\end{dispExample*}
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{colback=red!5!white,size=small,
+ colframe=red!75!black}
+\begin{tcolorbox}[fit basedim=10pt,
+ fit to height=2cm]
+ {\tcbfontsize{0.25} Very tiny,}\\
+ {\tcbfontsize{0.5} Small,}\\
+ {\tcbfontsize{1} Normal,}\\
+ {\tcbfontsize{2} Large,}\\
+ {\tcbfontsize{4} Huge.}
+\end{tcolorbox}
+\end{dispExample*}
\end{docCommand}
@@ -124,6 +154,7 @@ The algorithm will fail, if a different selected font size does not change the
overall size of the box content.
The \refCom{tcboxfit} macro uses this algorithm by default.
+
\medskip
\begin{marker}
The fit control keys are only applicable to unbreakable boxes without
@@ -139,7 +170,7 @@ The \refCom{tcboxfit} macro uses this algorithm by default.
like \refCom{tcboxfit} where the given \meta{box content} is fitted to
the width and height of the box. Therefore, the box has to have a fixed height.
If no fixed height is given, a square box is constructed.
- The font dimension \docAuxCommand{tcbfitdim} can also be used to adjust
+ The font dimension \refCom{tcbfitdim} can also be used to adjust
the margins of the box since a box with a tiny font may not need large
margins. The number of constructed boxes is saved to the macro \docAuxCommand{tcbfitsteps}
for analysis.
@@ -196,6 +227,8 @@ The \refCom{tcboxfit} macro uses this algorithm by default.
\begin{docTcbKey}{fit basedim}{=\meta{length}}{no default, initially |10pt|}
Sets the starting font dimension for the font size adjustment algorithm
to \meta{length}. The algorithm never enlarges this dimension.
+ Therefore, the final \refCom{tcbfitdim} is identical to or small than
+ \meta{length}.
\begin{dispExample*}{sbs,lefthand ratio=0.6}
\tcbset{colback=red!5!white,colframe=red!75!black}
@@ -213,7 +246,7 @@ The \refCom{tcboxfit} macro uses this algorithm by default.
\begin{docTcbKey}{fit skip}{=\meta{real value}}{no default, initially |1.2|}
- Sets the skip value of the selected font to \meta{real value} times \docAuxCommand{tcbfitdim}.
+ Sets the skip value of the selected font to \meta{real value} times \refCom{tcbfitdim}.
\begin{dispExample*}{sbs,lefthand ratio=0.6}
% \usepackage{lipsum}
@@ -236,8 +269,9 @@ The \refCom{tcboxfit} macro uses this algorithm by default.
|\tiny|, |\scriptsize|, |\footnotesize|, |\small|, |\normalsize|,
|\large|, |\Large|, |\LARGE|, |\huge|, and |\Huge|,
to set font sizes relative to
- the current \docAuxCommand{tcbfitdim}. Note that the display skip values for
+ the current \refCom{tcbfitdim}. Note that the display skip values for
mathematical formulas are respected by the redefined macros.
+ Also see \refCom{tcbfontsize}.
\begin{dispExample*}{sbs,lefthand ratio=0.6}
% \usepackage{lipsum}
@@ -395,7 +429,8 @@ This is a tcolorbox. This is a tcolorbox. This is a tcolorbox.
\clearpage
\begin{docTcbKey}{fit algorithm}{=\meta{name}}{no default, initially |fontsize|}
Sets the algorithm for the fitting process \emph{after} optionally width and height
-are adapted.
+are adapted. In the following, adapting the font size means adapting
+\refCom{tcbfitdim}.
Feasible values for \meta{name} are:
\begin{itemize}
\item\docValue{fontsize} (initial):
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.hooks.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.hooks.tex
index 33782234fe..9d00380f42 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.hooks.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.hooks.tex
@@ -369,6 +369,8 @@ This example uses a public domain picture from\\
\end{dispExample}
\end{docTcbKey}
+\enlargethispage*{1cm}
+
\begin{docTcbKey}{watermark tikz app on}{=\meta{part} is \meta{graphical code}}{no default}
Appends a \refKey{/tcb/watermark tikz on} the named \meta{part} of a break sequence.
\end{docTcbKey}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.initoptions.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.initoptions.tex
index 4a41654264..ef1ebcf055 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.initoptions.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.initoptions.tex
@@ -106,6 +106,7 @@ The created boxes are not numbered. This is the default. The option may
be used to overrule a previous option.
\end{newTcbKey}
+\enlargethispage*{1cm}
\begin{newTcbKey}[][doc new=2019-10-18]{reset counter on overlays}{\colOpt{=true\textbar false}}{default |true|, initially |false|}
For |beamer| slides, this invokes the |\resetcounteronoverlays| command
@@ -218,7 +219,7 @@ Feasible values for \meta{name} are:
\item\docValue{figures}: blend into the standard |figure| environment.
\item\docValue{tables}: blend into the standard |table| environment.
\item\docValue{listings}: blend into the standard |lstlisting| environment
- of the package |listings| \cite{hoffmann:2018a}.
+ of the package |listings| \cite{hoffmann:listings}.
\begin{marker}
Note that |blend into=listings| can only be used in the document content
or, preferably, inside a |\AtBeginDocument| clause! Using it without
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.intro.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.intro.tex
index 84d9b00b05..4c8fb7683a 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.intro.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.intro.tex
@@ -4,22 +4,19 @@
\section{Introduction}%
\tcbset{external/prefix=external/intro_}%
The package originates from the first edition of my book
-\flqq{\citetitle{sturm:2016e}\frqq~\cite{sturm:2016e}
+\flqq{\citetitle{sturm:latex}\frqq~\cite{sturm:latex}
in about 2006.
For the \LaTeX\ examples and tutorials given there, I wanted to have
accentuated and colored boxes to display source code and
compiled text in combination.
Since, in my opinion, this type of boxes is also quite useful to highlight definitions
and theorems, I applied them for my lecture notes in
-mathematics \cite{sturm:2007b,sturm:2008b,sturm:2010a}
+mathematics \cite{sturm:mathe1,sturm:mathe2,sturm:mathe3}
as well.
With this package, you are invited to apply these boxes for similar projects.
-Starting with version 2.00, for all internal calculations
-$\varepsilon$-\TeX\ \cite{breitenlohner:1998a} expressions are used
-in replacement of the package |calc|.
-The breaking news for version 2.00 is the support for breakable boxes.
-This new feature allows new applications of the package without
+The breaking news for version 2.00 was the support for breakable boxes.
+This feature allows new applications of the package without
affecting the core package too much if you do not need boxes to break automatically.
With version 2.20, the often requested 'side by side' mode for listings has been added.
With version 3.00, boxed titles are introduced together with improved
@@ -52,7 +49,7 @@ for some hints. The short story is: you have to install not only
\subsection{Loading the Package}
The base package |tcolorbox| loads the packages
|pgf| \cite{tantau:tikz_and_pgf}, |verbatim| \cite{schoepf:2001a},
-|etoolbox| \cite{lehmann:2018a},
+|etoolbox| \cite{lehmann:etoolbox},
and |environ| \cite{robertson:2014a}.
|tcolorbox| itself is loaded in the usual manner in the preamble:
\begin{dispListing}
@@ -101,14 +98,14 @@ The following keys are used inside |\tcbuselibrary| respectively
\end{docTcbKey}
\begin{docTcbKey}[library]{listings}{}{\mylib{listings}}
- Loads the package |listings| \cite{hoffmann:2018a} and provides additional
+ Loads the package |listings| \cite{hoffmann:listings} and provides additional
macros for typesetting listings which are described in Section~\ref{sec:listings}
from page~\pageref{sec:listings}.
\end{docTcbKey}
\begin{docTcbKey}[library]{listingsutf8}{}{\mylib{listingsutf8}}
- Loads the packages |listings| \cite{hoffmann:2018a} and
- |listingsutf8| \cite{oberdiek:2016b} for UTF-8 support.
+ Loads the packages |listings| \cite{hoffmann:listings} and
+ |listingsutf8| \cite{oberdiek:listingsutf8} for UTF-8 support.
This is a variant of the library \mylib{listings}
and is described in Section \ref{sec:listings}
from page~\pageref{sec:listings}.
@@ -186,7 +183,7 @@ The following keys are used inside |\tcbuselibrary| respectively
\end{docTcbKey}
\begin{docTcbKey}[library]{all}{}{style, no value}
- Loads all libraries. Use this shortcut only, if you indend to use the
+ Loads all libraries. Use this shortcut only, if you intend to use the
\mylib{documentation} library.
\end{docTcbKey}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
index 2abe145bb6..0be60d6e07 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
@@ -27,12 +27,12 @@ the settings of a previous loaded library. A library is never loaded twice.
\subsubsection{Loading \mylib{listings}}
-This library uses the package |listings| \cite{hoffmann:2018a} to typeset
+This library uses the package |listings| \cite{hoffmann:listings} to typeset
listings. It is loaded by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{listings}
\end{dispListing}
-This also loads the package |listings| \cite{hoffmann:2018a}.
+This also loads the package |listings| \cite{hoffmann:listings}.
The \refKey{/tcb/listing engine} is set to |listings| by the library.
To reactivate this setting, if overwritten by other libraries, use
@@ -43,17 +43,19 @@ To reactivate this setting, if overwritten by other libraries, use
\subsubsection{Loading \mylib{listingsutf8}}
\begin{marker}
This library is not needed (and troublesome) when using Xe\LaTeX\ or Lua\LaTeX.
+Therefore, loading this library is automatically replaced by loading
+\mylib{listings} only, if pdf\LaTeX\ is \emph{not} used.
\end{marker}
To extend |listings| for UTF-8 encoded sources, you can use the support from
-the package |listingsutf8| \cite{oberdiek:2016b} by loading the library
+the package |listingsutf8| \cite{oberdiek:listingsutf8} by loading the library
variant \mylib{listingsutf8}.
\begin{dispListing}
\tcbuselibrary{listingsutf8}
\tcbset{listing utf8=latin1}% optional; 'latin1' is the default.
\end{dispListing}
This also loads the library \mylib{listings}
-and the packages |listings| \cite{hoffmann:2018a}
-and |listingsutf8| \cite{oberdiek:2016b}.
+and the packages |listings| \cite{hoffmann:listings}
+and |listingsutf8| \cite{oberdiek:listingsutf8}.
The \refKey{/tcb/listing engine} is set to |listings| by the library.
To reactivate this setting, if overwritten by other libraries, use
@@ -322,7 +324,7 @@ This is my \LaTeX\ box.
\subsection{Option Keys of the \mylib{listings} Library}\label{sec:speclistingkeys}
\begin{docTcbKey}{listing options}{=\meta{key list}}{no default, initially |style=tcblatex|}
- Sets the options from the package |listings| \cite{hoffmann:2018a}
+ Sets the options from the package |listings| \cite{hoffmann:listings}
which are used during typesetting of the listing.
For \LaTeX\ listings, there is a predefined |listings| style named |tcblatex|
which can be used.
@@ -352,7 +354,7 @@ All \textit{listings} options removed.
\begin{docTcbKey}{listing style}{=\meta{style}}{no default, initially |tcblatex|}
Abbreviation for |listing options={style=...}|. This key sets a \meta{style}
- for the |listings| package, see \cite{hoffmann:2018a}.
+ for the |listings| package, see \cite{hoffmann:listings}.
For \LaTeX, there is a predefined style named |tcblatex|.
\begin{dispExample}
\begin{tcblisting}{colback=red!5!white,colframe=red!75!black,
@@ -425,6 +427,8 @@ For an combined example of using |\lstinline| inside a |tcolorbox|, see
\subsection{Option Keys of the \mylib{listingsutf8} Library}
\begin{marker}
The \mylib{listingsutf8} library is not needed (and troublesome) when using Xe\LaTeX\ or Lua\LaTeX.
+Therefore, loading this library is automatically replaced by loading
+\mylib{listings} only, if pdf\LaTeX\ is \emph{not} used.
\end{marker}
The \mylib{listingsutf8} library is an extension of the
@@ -433,10 +437,10 @@ all options from \Vref{sec:speclistingkeys} are applicable.
\begin{docTcbKey}{listing utf8}{=\meta{one-byte-encoding}}{style, no default, initially |latin1|}
Abbreviation for using \refKey{/tcb/listing inputencoding}
- together with UTF-8 support from the package |listingsutf8| \cite{oberdiek:2016b}.
+ together with UTF-8 support from the package |listingsutf8| \cite{oberdiek:listingsutf8}.
This option is available only for the library variant \mylib{listingsutf8}.
The \meta{one-byte-encoding} is one of
- the applicable encodings from \cite{oberdiek:2016b}, e.\,g.\ |latin1|
+ the applicable encodings from \cite{oberdiek:listingsutf8}, e.\,g.\ |latin1|
which is the default.\par
Be aware that this means restriction to this specific \meta{one-byte-encoding}:
e.\,g.\ |latin1| comprises umlauts and other accented characters, but not
@@ -635,7 +639,7 @@ This is a \LaTeX\ example.
\end{dispExample}
\end{docTcbKey}
-%\enlargethispage*{1cm}
+\clearpage
\begin{docTcbKey}[][doc new=2014-11-14]{pdf comment}{\colOpt{=\meta{filename}}}{style, default listing file, initially unset}
Uses a PDF file denoted by \meta{filename} as \textit{comment} for the listing.
@@ -744,6 +748,7 @@ This is a \LaTeX\ example.
\end{dispExample}
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}{text outside listing}{}{no value}
Typesets the environment content side by side as listing in a |tcolorbox|
@@ -760,7 +765,7 @@ This is a \LaTeX\ example.
\end{docTcbKey}
-\clearpage
+
\begin{docTcbKey}{listing side comment}{}{style, no value}
Typesets the environment content side by side as listing in the left (upper)
part and a given comment in the right (lower) part.
@@ -786,8 +791,8 @@ This is a \LaTeX\ example.
\end{dispExample}
\end{docTcbKey}
+\clearpage
-\enlargethispage*{2cm}
\begin{docTcbKey}{listing outside comment}{}{no value}
Typesets the environment content side by side as listing in a |tcolorbox|
and a given comment outside the box in the right part of the page.
@@ -820,7 +825,7 @@ This is a \LaTeX\ example.
\end{docTcbKey}
-\clearpage
+
\begin{docTcbKey}{listing above text}{}{no value}
Typesets the environment content as listing in a |tcolorbox|
and as compiled text outside and below the box.
@@ -842,6 +847,7 @@ This is a \LaTeX\ example.
The distance between box and text is controlled by \refKey{/tcb/after}.
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}{text above listing}{}{no value}
Typesets the environment content as listing in a |tcolorbox|
@@ -865,7 +871,7 @@ This is a \LaTeX\ example.
\end{docTcbKey}
-\clearpage
+
\begin{docTcbKey}{listing above comment}{}{no value}
Typesets the environment content as listing in a |tcolorbox|
and a given comment outside and below the box.
@@ -888,6 +894,7 @@ This is a \LaTeX\ example.
The distance between box and comment is controlled by \refKey{/tcb/after}.
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}{comment above listing}{}{no value}
Typesets the environment content as listing in a |tcolorbox|
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
index 3be23c743a..2587521132 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
@@ -194,12 +194,17 @@ documentation:\par
\begin{posterTcbKey}[][doc new=2017-07-03]{width}{=\meta{length}}{no default, initially \cs{linewidth}}
Sets \meta{length} as width of the poster. For a typical poster, this has not
- to be set manually.
+ to be set manually. Especially, if \refKey{/tcb/posterset/coverage} is present,
+ use |coverage={width=|\meta{length}|}| instead to change the overall width.
\end{posterTcbKey}
+\enlargethispage*{1cm}
+
\begin{posterTcbKey}[][doc new=2017-07-03]{height}{=\meta{length}}{no default, initially unset}
Sets \meta{length} as height of the poster. For a typical poster, this has not
to be set manually, but is set automatically to an appropriate value.
+ If \refKey{/tcb/posterset/coverage} is present, use only one if any option
+ |coverage={height=|\meta{length}|}| or |poster={height=|\meta{length}|}|.
\end{posterTcbKey}
@@ -248,6 +253,11 @@ The \meta{option list} can contain any |tcolorbox| option.
\refKey{/tcb/top}, \refKey{/tcb/bottom}.
\item Poster background can be changed by \refKey{/tcb/colback},
\refKey{/tcb/interior style}, \refKey{/tcb/interior style image}, etc.
+\item Do not use \refKey{/tcb/poster/width} and \refKey{/tcb/poster/height}
+ in combination with a \emph{coverage}. Note that you may use
+ \refKey{/tcb/width} and \refKey{/tcb/height} inside
+ the \emph{coverage} \meta{option list}. Note that this also is not
+ necessary when \refKey{/tcb/spread} is applied.
\end{itemize}
\end{postersetTcbKey}
@@ -556,7 +566,8 @@ poster listing.
\end{exdispExample}
\end{posterlocTcbKey}
-\enlargethispage*{2cm}
+\clearpage
+
\begin{docTcbKey}[][doc new=2017-07-03]{placeholder}{}{style, no value}
If the box content of a \refKey{/tcb/posterloc/sequence} is too short
to fill all reserved box parts, the empty boxes are drawn with
@@ -578,7 +589,7 @@ poster listing.
\end{docTcbKey}
-\clearpage
+
\begin{posterlocTcbKey}[][doc new=2017-07-03]{xshift}{=\meta{length}}{no default, initially |0pt|}
Horizontal shift of a box by \meta{length}.
\begin{exdispExample}{xshift}
@@ -592,6 +603,7 @@ poster listing.
\end{exdispExample}
\end{posterlocTcbKey}
+\clearpage
\begin{posterlocTcbKey}[][doc new=2017-07-03]{yshift}{=\meta{length}}{no default, initially |0pt|}
Vertical shift of a box by \meta{length}.
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
index 18385877c0..cf10fbe2c0 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
@@ -66,6 +66,7 @@
\urlstyle{sf}
\tcbmakedocSubKey{docTcbKey}{tcb}
+\tcbmakedocSubKeys{docTcbKeys}{tcb}
\tcbmakedocSubKey{langTcbKey}{tcb/doclang}
\tcbmakedocSubKey{newTcbKey}{tcb/new}
\tcbmakedocSubKey{boxTcbKey}{tcb/boxtitle}
@@ -78,26 +79,63 @@
\def\tikzname{Ti\emph{k}Z}
+
\newrobustcmd{\tcbIndexPrintSkinCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@key}{Skin}}
\newrobustcmd{\tcbIndexPrintSkinC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@key}}
-\def\tcb@index@Skin#1{\iftcb@doc@toindex\index{#1\idx@actual\tcbIndexPrintSkinCA{#1}}\index{Skins\idx@level#1\idx@actual\tcbIndexPrintSkinC{#1}}\fi}%
-
-\newenvironment{docSkin}[2][]{\begin{tcb@manual@entry}%
- \begin{tcb@doc@head}{colback=magenta!5!white,interior style=fill,#1}%
- \hypertarget{skin:#2}{\tcb@Print@Key{/tcb/skin=}\tcb@Print@Val{#2}\tcb@index@Skin{#2}\protected@edef\@currentlabel{#2}\label{skin:#2}\hfill(skin)}%
- \end{tcb@doc@head}}%
- {\end{tcb@manual@entry}}
\def\refSkin{\tcb@ref@doc{skin}}
\newrobustcmd{\tcbIndexPrintFadCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@value}{fading}}
\newrobustcmd{\tcbIndexPrintFadC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@value}}
-\def\tcb@Print@Fad#1{\textcolor{\kvtcb@col@value}{\bfseries\tcb@scantokens{#1}}}
-\def\tcb@index@Fad#1{\iftcb@doc@toindex\kvtcb@index@command{#1\idx@actual\tcbIndexPrintFadCA{#1}}\kvtcb@index@command{Fadings\idx@level#1\idx@actual\tcbIndexPrintFadC{#1}}\fi}
-\DeclareDocumentCommand\docFading{sm}{%
- \tcb@Print@Fad{#2}%
- \IfBooleanTF{#1}{}{\tcb@index@Fad{#2}}%
-}
+
+\ExplSyntaxOn
+
+\NewDocumentEnvironment{docSkin}{ O{} m }
+ {
+ \__tcobox_doc_entry_begin:nnn
+ {
+ doc~keypath=tcb,
+ doc~name={skin},
+ doc~label={skin=#2},
+ doc~parameter={=\docValue*[nophantom]{#2}},
+ doc~description={skin},
+ #1,
+ doc~no~index,
+ doc~head~key =
+ {
+ colback=magenta!5!white,interior~style=fill,
+ phantom=
+ {
+ \protected@edef\@currentlabel{#2}
+ \label{skin:#2}
+ \index{#2\idx@actual\tcbIndexPrintSkinCA{#2}}
+ \index{Skins\idx@level#2\idx@actual\tcbIndexPrintSkinC{#2}}
+ },
+ }
+ }
+ {}{key}
+ }
+ {
+ \__tcobox_doc_entry_end:n { key }
+ }
+
+
+\NewDocumentCommand \docFading { s +O{} m }
+ {
+ \group_begin:
+ \tcbset{doc~name={#3},#2}
+ \textcolor{\kvtcb@col@value}{\__tcobox_print_docname:}
+ \IfBooleanF{#1}
+ {
+ \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintFadCA{\kvtcb@doc@index}}
+ \kvtcb@index@command{Fadings\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintFadC{\kvtcb@doc@index}}
+ }
+ \group_end:
+ }
+
+\ExplSyntaxOff
+
+
\newtcolorbox{marker}[1][]{enhanced,
before skip=2mm,after skip=3mm,
@@ -202,6 +240,7 @@
documentation listing style=mydocumentation,%
sbs/.style={sidebyside,before lower app={\tcbset{sidebyside=false}}},%
innerbox/.style={reset,documentation listing style=mydocumentation,
+ doc keypath/.store in=\kvtcb@doc@keypath,
docexample/.style={docexample original},%
},
beforeafter example/.style={
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.skins.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.skins.tex
index 8c18743cec..adfbd7f091 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.skins.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.skins.tex
@@ -2764,7 +2764,7 @@ Click me to jump to Box A.
Such, the |tcolorbox| is made a clickable button (depending on the previewer).
\begin{dispExample*}{sbs,lefthand ratio=0.7}
\begin{tcolorbox}[enhanced,colback=red!50,
- hyperurl=http://www.ctan.org/pkg/tcolorbox]
+ hyperurl=https://www.ctan.org/pkg/tcolorbox]
View CTAN with a browser.
\end{tcolorbox}
\end{dispExample*}
@@ -2813,6 +2813,8 @@ Open example file on Page~3.
\meta{options} are applied.
\end{docTcbKey}
+\enlargethispage*{1cm}
+
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl* node}{=\marg{options}\marg{url}\marg{node}}{no default, initially unset}
Identical to \refKey{/tcb/hyperurl node}, but additional |hyperref| \cite{rahtz:hyperref}
\meta{options} are applied.
@@ -2945,7 +2947,9 @@ from converting to draft mode.
\end{marker}
\end{docCommand}
-\enlargethispage*{2cm}
+
+\clearpage
+
\begin{docTcbKey}{draftmode}{\colOpt{=true\textbar false}}{default |true|, initially |false|}
If set to |true|, the \emph{draft mode} is started.
If set to |false|, the \emph{draft mode} is stopped.
@@ -3630,6 +3634,8 @@ Nevertheless, this skin can be applied independently.
\end{itemize}
\end{docSkin}
+\clearpage
+
\begin{docTcbKey}{bicolor}{}{style, no value}
This is an abbreviation for setting |skin=bicolor|.
\end{docTcbKey}
@@ -3659,6 +3665,8 @@ Nevertheless, this skin can be applied independently.
\end{tcbraster}
\end{dispExample}
+\enlargethispage*{1cm}
+
\begin{docTcbKey}{colbacklower}{=\meta{color}}{no default, initially \texttt{black!15!white}}
Sets the background \meta{color} of the lower part. It depends on the skin,
if this value is used.
@@ -4659,7 +4667,9 @@ are drawn by the codes given by
%\tcbuselibrary{skins,breakable}
\tikzset{coltria/.style={fill=red!15!white}}
-\newtcolorbox{freebox}[1][]{empty,breakable,leftrule=5mm,left=2mm,
+\newtcolorbox{freebox}[1][]{empty,
+ breakable,height fixed for=first and middle,
+ leftrule=5mm,left=2mm,
frame style={fill,top color=red!75!black,bottom color=red!75!black,middle color=red},
colback=yellow!50!white,
watermark color=red!50!yellow!75!white,
@@ -4926,6 +4936,8 @@ is used as middle part of the break sequence of \refSkin{freelance}.
See \refKey{/tcb/skin middle is subskin of} for a substitute of this key.
\end{docTcbKey}
+\enlargethispage*{1cm}
+
\begin{docTcbKey}{extend freelancelast}{=\meta{options}}{no default, initially empty}
The \meta{options} are added to the skin definition of \refSkin{freelancelast} which
is used as last part of the break sequence of \refSkin{freelance}.
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.vignette.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.vignette.tex
index c1d9d7efc0..ebf9f137d5 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.vignette.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.vignette.tex
@@ -138,6 +138,7 @@ is used internally.
\end{tikzpicture}
\end{dispExample*}
+\enlargethispage*{1cm}
\begin{vigTcbKey}[][doc new=2016-04-22]{inside node}{=\meta{name}}{style, initally unset}
Places the \refCom{tcbvignette} inside the node with the given \meta{name}.
@@ -151,6 +152,7 @@ is used internally.
\end{dispExample*}
\end{vigTcbKey}
+\clearpage
\begin{vigTcbKey}[][doc new=2016-04-22]{outside node}{=\meta{name}}{style, initally unset}
Places the \refCom{tcbvignette} outside the node with the given \meta{name}.
@@ -221,6 +223,8 @@ is used internally.
\end{dispExample*}
\end{vigTcbKey}
+\clearpage
+
\begin{vigTcbKey}[][doc new=2016-04-22]{vertical size}{=\meta{length}}{style, initially |2mm|}
Sets \refKey{/tcb/vig/north size} and \refKey{/tcb/vig/south size},
to the given \meta{length}.
@@ -280,7 +284,6 @@ be set \emph{before} \refKey{/tcb/vig/outside node} is used.
\end{dispExample*}
\end{vigTcbKey}
-\clearpage
\begin{vigTcbKey}[][doc new=2016-04-22]{east style}{=\marg{style}}{no default, initially |red!75!black|}
Sets \tikzname\ \meta{style} options for the east \emph{vignette} part.
@@ -292,6 +295,7 @@ be set \emph{before} \refKey{/tcb/vig/outside node} is used.
\end{dispExample*}
\end{vigTcbKey}
+\clearpage
\begin{vigTcbKey}[][doc new=2016-04-22]{west style}{=\marg{style}}{no default, initially |red!75!white|}
Sets \tikzname\ \meta{style} options for the west \emph{vignette} part.
@@ -363,6 +367,7 @@ be set \emph{before} \refKey{/tcb/vig/outside node} is used.
\end{vigTcbKey}
+
\begin{vigTcbKey}[][doc new=2016-04-22]{base color}{=\meta{color}}{no default}
Sets the base color for \refKey{/tcb/vig/raised color},
\refKey{/tcb/vig/lowered color}, \refKey{/tcb/finish fading vignette}.
@@ -455,6 +460,8 @@ These fadings are much \emph{weaker} than the normal fadings.
\end{tcboxedraster}
+\clearpage
+
\begin{vigTcbKey}[][doc new=2016-04-22]{fade in}{\colOpt{=\marg{style}}}{style, default |white|}
Sets the four style options
\refKey{/tcb/vig/north style},
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.pdf b/macros/latex/contrib/tcolorbox/tcolorbox.pdf
index 4b4189edeb..79654b9ebb 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.sty b/macros/latex/contrib/tcolorbox/tcolorbox.sty
index 9c34ae6be0..5a0f6214f8 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.sty
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.sty
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcolorbox.sty: Text color boxes
%%
%% -------------------------------------------------------------------------------------------
@@ -18,8 +18,8 @@
%% This work consists of all files listed in README
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tcolorbox}[2019/11/15 version 4.22 text color boxes]
-\def\tcb@version{4.22}
+\ProvidesPackage{tcolorbox}[2020/04/28 version 4.30 text color boxes]
+\def\tcb@version{4.30}
\RequirePackage{pgf}[2008/01/15]
\RequirePackage{verbatim}[2003/08/22]
@@ -50,8 +50,9 @@
\newcounter{tcbbreakpart}
\newcounter{tcblayer}
-\newcount\tcolorbox@number
+\newcounter{tcolorbox@number}
+\def\tcb@info#1{\PackageInfo{tcolorbox}{#1}}
\def\tcb@warning#1{\PackageWarning{tcolorbox}{#1}}
\def\tcb@error#1#2{\PackageError{tcolorbox}{#1}{#2}}
@@ -289,12 +290,12 @@
parskip/.style={before={\ifnum\lastnodetype=-1\relax\else\par%
\ifvmode\edef\tcb@prevdepth{\the\glueexpr\prevdepth+\lineskip+\parskip}%
\def\tcb@undo@before{\addvspace{-\glueexpr\tcb@prevdepth}}%
- \pagebreak[0]\fi\fi\parindent\z@},
+ \pagebreak[0]\fi\fi\noindent},
after={\tcb@parfillskip@check\par}},
noparskip/.style={before={\ifnum\lastnodetype=-1\relax\else\par%
\ifvmode\edef\tcb@prevdepth{\the\glueexpr\prevdepth+\lineskip}%
\def\tcb@undo@before{\addvspace{-\glueexpr\smallskipamount+\tcb@prevdepth}}%
- \pagebreak[0]\smallskip\fi\fi\parindent\z@},
+ \pagebreak[0]\smallskip\fi\fi\noindent},
after={\tcb@parfillskip@check\par\smallskip}},
nobeforeafter/.style={before=,after=},
force nobeforeafter/.code={\tcbset@late@options{nobeforeafter}},
@@ -973,14 +974,18 @@
\Collect@Body\tcbox@inner@hbox@collected%
}
+% save 'comment' from 'verbatim'
+\let\tcb@verbatim@comment\comment
+\let\tcb@verbatim@endcomment\endcomment
+
\def\tcb@@end@v@@d{%
- \endcomment%
+ \tcb@verbatim@endcomment%
\tcb@layer@dec%
}
\def\tcb@@capture@v@@d{%
\let\endtcolorbox\tcb@@end@v@@d%
- \comment%
+ \tcb@verbatim@comment%
}
\long\def\tcbox@inner@hbox@collected#1{%
@@ -989,8 +994,8 @@
}
\def\tcb@count@boxes{%
- \global\advance\tcolorbox@number by 1\relax%
- \edef\thetcolorboxnumber{\number\tcolorbox@number}%
+ \global\advance\c@tcolorbox@number by 1\relax%
+ \edef\thetcolorboxnumber{\number\c@tcolorbox@number}%
\expandafter\ifx\csname tcolorboxpage@\thetcolorboxnumber\endcsname\relax%
\edef\thetcolorboxpage{\number\c@page}%
\else%
@@ -1000,8 +1005,6 @@
\def\tcolorbox@label{\@newl@bel{tcolorboxpage}}%
-%\write\@auxout{\string\providecommand\string\tcolorbox@label[2]{}}%
-
\def\tcolorbox@savepage#1{%
\@bsphack%
\write\@auxout{\string\tcolorbox@label{#1}{\number\c@page}}%
@@ -1074,7 +1077,7 @@
\def\tcb@layer@pushup{%
\tcb@count@boxes%
- \global\advance\tcolorbox@number by -1\relax%
+ \global\advance\c@tcolorbox@number by -1\relax%
\stepcounter{tcblayer}%
\ifnum\c@tcblayer>1%
\tcbset{breakable@true/.code=}%
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.tex b/macros/latex/contrib/tcolorbox/tcolorbox.tex
index db8286bbb8..33791d4810 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.tex
@@ -1,9 +1,9 @@
% \LaTeX-Main\
-%% The LaTeX package tcolorbox - version 4.22 (2019/11/15)
+%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
%% tcolorbox.tex: Manual
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2006-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -18,10 +18,10 @@
%%
%% This work consists of all files listed in README
%%
-% arara: pdflatex: { shell: yes }
+% arara: pdflatex: { shell: yes, synctex: yes }
% arara: biber
-% arara: pdflatex: { shell: yes }
-% arara: pdflatex: { shell: yes }
+% arara: pdflatex: { shell: yes, synctex: yes }
+% arara: pdflatex: { shell: yes, synctex: yes }
% arara: pdflatex: { shell: yes, synctex: yes }
% arara: pdflatex: { shell: yes, synctex: yes }
%
@@ -43,8 +43,8 @@
\setlength{\bibitemsep}{\smallskipamount}
\addbibresource{tcolorbox.doc.bib}
-\def\version{4.22}%
-\def\datum{2019/11/15}%
+\def\version{4.30}%
+\def\datum{2020/04/28}%
\makeindex
\hypersetup{
@@ -55,10 +55,16 @@
}
\usepackage{pgfplots}
+\pgfplotsset{compat=1.17}
+\nocite{breitenlohner:1998a}
+
+%\geometry{showframe}
%\tcbset{draftmode}
\tcbset{/tcb/external/-}% for final run
-%\includeonly{tcolorbox.doc.initoptions}
+%\includeonly{tcolorbox.doc.picturecredits}
+
+%\hypersetup{colorlinks=false}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
diff --git a/macros/latex/contrib/translations/README b/macros/latex/contrib/translations/README
index d403194378..4f93dfa1da 100644
--- a/macros/latex/contrib/translations/README
+++ b/macros/latex/contrib/translations/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-the TRANSLATIONS package v1.8a - 2020/04/26
+the TRANSLATIONS package v1.8b - 2020/04/28
internationalization of LaTeX2e packages
--------------------------------------------------------------------------
diff --git a/macros/latex/contrib/translations/translations.sty b/macros/latex/contrib/translations/translations.sty
index d013842825..1749329c9b 100644
--- a/macros/latex/contrib/translations/translations.sty
+++ b/macros/latex/contrib/translations/translations.sty
@@ -25,8 +25,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\newcommand*\@trnslt@date{2020/04/26}
-\newcommand*\@trnslt@version{v1.8a}
+\newcommand*\@trnslt@date{2020/04/28}
+\newcommand*\@trnslt@version{v1.8b}
\newcommand*\@trnslt@packageinfo{internationalization of LaTeX2e packages}
\ProvidesPackage{translations}[%
@@ -546,7 +546,10 @@
% load dictionaries and check for existing ones:
% \LoadDictionary and \LoadDictionaryFor
\newrobustcmd*\LoadDictionary[1]{%
- \@trnslt@load@dictionary@for{#1}{\@trnslt@current@language}}
+ \AtEndPreamble{%
+ \@trnslt@load@dictionary@for{#1}{\@trnslt@current@language}%
+ }%
+}
\@onlypreamble\LoadDictionary
\newrobustcmd*\LoadDictionaryFor[2]{%
@@ -557,6 +560,8 @@
\@trnslt@load@dictionary@for@dialect{#2}{#1}}
\@onlypreamble\LoadDictionaryFor
+\newcommand*\@trnslt@basic@dictionary{translations-basic-dictionary}
+
\newcommand*\@trnslt@dictionaries{}
\edef\@trnslt@catcodes{%
@@ -614,9 +619,19 @@
{%
\InputIfFileExists{#1-\baselanguage{#2}.trsl}
{\@trnslt@check@dictionary{#1}{#2}}
- {\@trnslt@info{no dictionary file `#1-\baselanguage{#2}.trsl' found.}}
+ {%
+ \ifdefstring\@trnslt@basic@dictionary{#1}
+ {\@trnslt@info}
+ {\@trnslt@warning}
+ {no dictionary file `#1-\baselanguage{#2}.trsl' found.}%
+ }%
+ }%
+ {%
+ \ifdefstring\@trnslt@basic@dictionary{#1}
+ {\@trnslt@info}
+ {\@trnslt@warning}
+ {no dictionary file `#1-#2.trsl' found.}%
}%
- {\@trnslt@info{no dictionary file `#1-#2.trsl' found.}}
}%
}
@@ -1078,7 +1093,7 @@
\fi
\expanded{%
\noexpand\forcsvlist
- {\noexpand\@trnslt@load@dictionary@for{translations-basic-dictionary}}
+ {\noexpand\@trnslt@load@dictionary@for{\@trnslt@basic@dictionary}}
{\expandonce\@trnslt@loaded@languages}%
}%
\def\do#1{\@trnslt@input@dictionary#1\q@stop}
diff --git a/macros/latex/contrib/translations/translations_en.pdf b/macros/latex/contrib/translations/translations_en.pdf
index 27d71b446a..427707ca89 100644
--- a/macros/latex/contrib/translations/translations_en.pdf
+++ b/macros/latex/contrib/translations/translations_en.pdf
Binary files differ
diff --git a/macros/latex/contrib/translations/translations_en.tex b/macros/latex/contrib/translations/translations_en.tex
index 2b04600d0d..340eaafac8 100644
--- a/macros/latex/contrib/translations/translations_en.tex
+++ b/macros/latex/contrib/translations/translations_en.tex
@@ -26,8 +26,6 @@
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
-% The translations package is part of the exsheets bundle
-% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index 1274e405b3..d37c85f1d2 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,4 +1,4 @@
-## Babel 3.42
+## Babel 3.43
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -7,9 +7,9 @@ lualatex out of the box. A few even work with plain formats.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.42 are described in:
+Changes in version 3.43 are described in:
-https://github.com/latex3/babel/wiki/What's-new-in-babel-3.42
+https://github.com/latex3/babel/wiki/What's-new-in-babel-3.43
Included is a set of ini files for about 200 languages.
@@ -44,6 +44,18 @@ respective authors.
### Latest changes
```
+3.43 2020-04-28
+ - Autoloading based on the BCP47 codes, with basic lookup.
+ - Now only a few essential commands are loaded in the format.
+ - Improvements in Assamese, Luxembourgish, Marathi, Armenian,
+ Bengali, and Finnish.
+ - First steps in the removal of switch.def and plain.def.
+ - Fixes:
+ - Babel reset the \sfcode of » to 1000. It should be 0.
+ - \guillemotleft and \guillemotleft renamed to \guillemetleft
+ and \guillemetleft (#63).
+ - A couple of bugs related to autoloading.
+
3.42 2020-03-22
- \getlocaleproperty, to get the value of a field from the loaded
ini files.
@@ -60,6 +72,7 @@ respective authors.
(#52).
- Locale was not switched correctly with COMBINING characters
(#54).
+See https://github.com/latex3/babel/wiki/What's-new-in-babel-3.42
3.41 2020-02-27
- Counters and numerals added in some ini files, based on those
@@ -145,30 +158,6 @@ See https://github.com/latex3/babel/wiki/What's-new-in-babel-3.36
- Basic support for the picture environment (with pict2e) and pgf
(lua, somewhat experimental).
- Start support for harftex (just try - it may work).
-
-3.31 2019-05-04
- - Basic support for line breaking with CJK scripts (lua)
- - layout=tabular now works with the 'array' package (and some
- others; lua).
-
-3.30 2019-04-22
- - Fix - dir in boxes inside math (hopefully now it works; lua).
- - Option mapdigits for \babelprovide, which converts European
- digits to local ones (lua).
-
-3.29 2019-04-03
- - The fix for boxes inside math is incompatible with ams.
- Removed (a better fix is under study).
- - Options bidi-l and bidi-r (for the bidi package; xe).
-
-3.28 2019-04-01
- - Fixes - wrong dir after math, in math inside tabular, in weak L
- inside R inside L, and in boxes inside math.
- - \babelfont now takes into account \defaultfontfeatures. This
- is a potential source of backwards incompatibilities, but
- very likely the risks are very low, and it is, I think, the
- expected behavior.
-
```
Javier Bezos
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index 4b7e721f21..ed38c3b139 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -31,7 +31,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2020/03/22 v3.42 The Babel package]
+\ProvidesFile{babel.dtx}[2020/04/28 v3.43 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -217,10 +217,10 @@ Javier Bezos
\fontsize{35}{45}\selectfont
\setlength\parskip{3mm}\raggedright
Localization and internationalization\\[1cm]
+Unicode\\
\largetex\\
pdf\largetex\\
Lua\largetex\\
-LuaHB\largetex\\
Xe\largetex
\vspace{20cm}
\end{minipage}
@@ -245,15 +245,16 @@ Xe\largetex
most recent features could be still unstable. Please, report any
issues you find in
\href{https://github.com/latex3/babel/issues}{GitHub}, which is
- better than just complaining on an e-mail list or a web forum.
+ better than just complaining on an e-mail list or a web forum.
\item If you are interested in the \TeX{} multilingual support, please
- join the \href{http://tug.org/mailman/listinfo/kadingira}{kadingira
- mail list}. You can follow
- the development of \babel{} in
+ join the \href{http://tug.org/mailman/listinfo/kadingira}{kadingira
+ mail list}. You can follow the development of \babel{} in
\href{https://github.com/latex3/babel}{GitHub} (which provides many
\href{https://github.com/latex3/babel/tree/master/samples}{sample
- files}, too).
+ files}, too). If you are the author of a package, feel free to send
+ to me a few test files which I'll add to mine, so that possible
+ issues could be caught in the development phase.
\item See section \ref{contribute} for contributing a language.
@@ -623,8 +624,10 @@ This command can be used as environment, too.
\begin{note}
For ``historical reasons'', a macro name is converted to a language
name without the leading |\|; in other words,
- |\selectlanguage{\german}| is equivalent to |\selectlanguage{german}|.
- Using a macro instead of a ``real'' name is deprecated.
+ |\selectlanguage{\german}| is equivalent to
+ |\selectlanguage{german}|. Using a macro instead of a ``real'' name
+ is deprecated. \New{3.43} However, if the macro name does not match
+ any language, it will get expanded as expected.
\end{note}
\begin{warning}
@@ -919,7 +922,7 @@ system shorthands. Language-dependent user shorthands (new in
words are repeated at the beginning of the next line. You could then
set:
\begin{verbatim}
-\defineshorthand[*polish,*portugese]{"-}{\babelhyphen{repeat}}
+\defineshorthand[*polish,*portuguese]{"-}{\babelhyphen{repeat}}
\end{verbatim}
Here, options with |*| set a language-dependent user shorthand,
which means the generic one above only applies for the rest of
@@ -1144,7 +1147,7 @@ encodings). Other allowed values are font encoding codes (|T1|, |T2A|,
and the like (this feature misuses some internal \LaTeX\ tools, so use
it only as a last resort).
-\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{main}
+\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{first}
$\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$
\texttt{other*}}
@@ -1225,6 +1228,11 @@ be the same as the option name as set in |\usepackage|!).
\end{verbatim}
\end{example}
+\begin{warning}
+ Currently this option is not compatible with languages loaded on the
+ fly.
+\end{warning}
+
\subsection{\texttt{ini} files}
An alternative approach to define a language (or, more precisely, a
@@ -1285,25 +1293,26 @@ for auxiliary tasks.
\textsf{fontspec}/\textsf{loaotfload} is required. In \xetex{}
\babel{} resorts to the \textsf{bidi} package, which seems to work.
\item[Hebrew] Niqqud marks seem to work in both engines, but
- cantillation marks are misplaced (\xetex{} seems better, but still
- problematic).
-\item[Devanagari] In \luatex{} many fonts work, but some others do
- not, the main issue being the ‘ra’. It is advisable to set explicitly
- the script to either |deva| or |dev2|, eg:
+ cantillation marks are misplaced (\xetex{} or \luatex{} with Harfbuzz
+ seems better, but still problematic).
+\item[Devanagari] In \luatex{} and the the default renderer many fonts
+work, but some others do not, the main issue being the ‘ra’. It is
+advisable to set explicitly the script to either |deva| or |dev2|, eg:
\begin{verbatim}
\newfontscript{Devanagari}{deva}
\end{verbatim}
- Other Indic scripts are still under development in \luatex{}. On the
- other hand, \xetex{} is better. The upcoming \textsf{lualatex} will
- be based on \textsf{luahbtex}, so Indic scripts will be rendered
- correctly with the option |Renderer=Harfbuzz| in \textsc{fontspec}.
+ Other Indic scripts are still under development in the default
+ \luatex{} renderer, but should work with the option
+ |Renderer=Harfbuzz| in \textsc{fontspec}. They also work with
+ \xetex{}, although fine tuning the font behaviour is not always
+ possible.
\item[Southeast scripts] Thai works in both \luatex{} and \xetex{}, but
line breaking differs (rules can be modified in \luatex; they are
hard-coded in \xetex). Lao seems to work, too, but there are no
patterns for the latter in \luatex{}. Khemer clusters are rendered
- wrongly. The comment about Indic scripts and \textsf{lualatex} also
- applies here. Some quick patterns could help, with something similar
- to:
+ wrongly with the default renderer. The comment about Indic scripts
+ and \textsf{lualatex} also applies here. Some quick patterns could
+ help, with something similar to:
\begingroup
\setmonofont[Script=Lao,Scale=MatchLowercase]{DejaVu Sans Mono}
\begin{verbatim}
@@ -1312,8 +1321,7 @@ for auxiliary tasks.
\end{verbatim}
\endgroup
\item[East Asia scripts] Settings for either Simplified of Traditional
-should work out of the box. \luatex{} does basic line breaking, but
-currently \xetex{} does not (you may load \textsf{zhspacing}). Although
+should work out of the box, with basic line breaking. Although
for a few words and shorts texts the |ini| files should be fine, CJK
texts are best set with a dedicated framework (\textsf{CJK},
\textsf{luatexja}, \textsf{kotex}, \textsf{CTeX}, etc.). This is what
@@ -2502,7 +2510,7 @@ The styles are:
\item[Hindi] |alphabetic|
-\item[Armenian] |lower|, |upper|
+\item[Armenian] |lower.letter|, |upper.letter|
\item[Japanese] |hiragana|, |hiragana.iroha|, |katakana|,
|katakana.iroha|, |circled.katakana|, |informal|, |formal|,
@@ -2781,6 +2789,68 @@ additional replacement type with the key |string|.
|\babelprehyphenation| is on the way.)
\end{example}
+\subsection{Selection based on BCP 47 tags}
+
+\New{3.43} The recommended way to select languages is that described at
+the beginning of this document. However, BCP 47 tags are becoming
+customary, particularly in document (or parts of documents) generated
+by external sources, and therefore \babel{} will provide a set of tools
+to select the locales in different situations, adapted to the
+particular needs of each case. Currently, \babel{} provides autoloading
+of locales as described in this section. In these contexts autoloading
+is particularly important because we may not know on beforehand which
+languages will be requested.
+
+It must be activated explicitly, because it is primarily meant for
+special tasks. Mapping from BCP 47 codes to locale names are not
+hardcoded in \babel. Instead the data is taken from the \texttt{ini}
+files, which means currently about 250 tags are already recognized.
+\Babel{} performs a simple lookup in the following way: |fr-Latn-FR| $\to$
+|fr-Latn| $\to$ |fr-FR| $\to$ |fr|. Languages with the same resolved
+name are considered the same. Case is normalized before, so that
+|fr-latn-fr| $\to$ |fr-Latn-FR|. If a tag and a name overlap, the tag
+takes precedence.
+
+Here is a minimal example:
+\begin{verbatim}
+\documentclass{article}
+
+\usepackage[danish]{babel}
+
+\babeladjust{ autoload.bcp47 = on }
+
+\begin{document}
+
+\today
+
+\selectlanguage{fr-CA}
+
+\today
+
+\end{document}
+\end{verbatim}
+
+Currently the locales loaded are based on the \texttt{ini} files and
+decoupled from the main \texttt{ldf} files. This is by design, to
+ensure code generated externally produces the same result regardless of
+the languages requested in the document, but an option to use the
+\texttt{ldf} instead will be added in a future release, because both
+options make sense depending on the particular needs of each document
+(there will be some restrictions, however).
+
+The behaviour is adjusted with |\babeladjust| with the following parameters:
+\begin{description}
+\item \texttt{autoload.bcp47} with values on and off.
+\item \texttt{autoload.bcp47.options}, which are passed to
+ |\babelprovide|; empty by default, but you may add \texttt{import}
+ (features defined in the corresponding |babel-...tex| file might not
+ available).
+\item \texttt{autoload.bcp47.prefix}. Although the public name used in
+ selectors is the tag, the internal name will be different and
+ generated by prepending a prefix, which by default is
+ \texttt{bcp47-}. You may change it with this key.
+\end{description}
+
\subsection{Selecting scripts}
Currently \babel{} provides no standard interface to select
@@ -3256,8 +3326,8 @@ ones, they only have a single hook and replace a default definition.
\itemsep=-\parskip
\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 file or to load nothing.
+\item[loadkernel] (file) By default just defines a few basic commands.
+ It can be used to define different versions of them or to load a file.
\item[loadpatterns] (patterns file) Loads the patterns file. Used by
\file{luababel.def}.
\item[loadexceptions] (exceptions file) Loads the exceptions
@@ -3301,17 +3371,19 @@ the current options may be different. It does not include |ini| files.
\item[Greek] greek, polutonikogreek
\item[Hebrew] hebrew
\item[Icelandic] icelandic
-\item[Indonesian] bahasa, indonesian, indon, bahasai
+\item[Indonesian] indonesian, bahasa, indon, bahasai
\item[Interlingua] interlingua
\item[Irish Gaelic] irish
\item[Italian] italian
\item[Latin] latin
\item[Lower Sorbian] lowersorbian
-\item[Malay] bahasam, malay, melayu
+\item[Malay] malay, melayu, bahasam
\item[North Sami] samin
\item[Norwegian] norsk, nynorsk
\item[Polish] polish
-\item[Portuguese] portuges, portuguese, brazilian, brazil
+\item[Portuguese] portuguese, portuges\footnote{This name comes from
+ the times when they had to be shortened to 8 characters}, brazilian,
+ brazil
\item[Romanian] romanian
\item[Russian] russian
\item[Scottish Gaelic] scottish
@@ -4388,6 +4460,9 @@ help from Bernd Raichle, for which I am grateful.
%
% \textit{Code documentation is still under revision.}
%
+% \textbf{The following description is no longer valid, because switch
+% and plain have been merged into babel.def.}
+%
% The \babel{} package after unpacking consists of the following files:
% \begin{description}
% \itemsep=-\parskip
@@ -4399,8 +4474,7 @@ help from Bernd Raichle, for which I am grateful.
% \item[plain.def] defines some \LaTeX{} macros required by
% \file{babel.def} and provides a few tools for Plain.
% \item[hyphen.cfg] is the file to be used when generating the
-% formats to load hyphenation patterns. By default it also loads
-% \file{switch.def}.
+% formats to load hyphenation patterns.
% \end{description}
%
% The \babel{} installer extends \textsf{docstrip} with a few
@@ -4456,8 +4530,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.42>>
-%<<date=2020/03/22>>
+%<<version=3.43>>
+%<<date=2020/04/28>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4756,30 +4830,6 @@ 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 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}.
-%
-% \begin{macrocode}
-%<<*Load macros for plain if not LaTeX>>
-\ifx\AtBeginDocument\@undefined
- \input plain.def\relax
-\fi
-%<</Load macros for plain if not LaTeX>>
-% \end{macrocode}
-%
% \subsection{Multiple languages}
%
% \begin{macro}{\language}
@@ -4857,30 +4907,19 @@ help from Bernd Raichle, for which I am grateful.
% now. We cannot load |babel.def| here because we first need to
% declare and process the package options.
%
-% \section{The Package File (\LaTeX, \texttt{babel.sty})}
%
-% In order to make use of the features of \LaTeXe, the \babel\
-% system contains a package file, \file{babel.sty}. This file is
-% loaded by the |\usepackage| command and defines all the language
-% options whose name is different from that of the |.ldf| file
-% (like variant spellings). It also takes care of a number of
-% compatibility issues with other packages an defines a few
-% aditional package options.
+% \subsection{The Package File (\LaTeX, \texttt{babel.sty})}
%
-% Apart from all the language options below we also have a few options
-% that influence the behavior of language definition files.
+% This file also takes care of a number of compatibility issues with
+% other packages an defines a few aditional package options. Apart from
+% all the language options below we also have a few options that
+% influence the behavior of language definition files.
%
-% Many of the following options don't do anything themselves, they
-% are just defined in order to make it possible for babel and
-% language definition files to check if one of them was specified
-% by the user.
+% Many of the following options don't do anything themselves, they are
+% just defined in order to make it possible for babel and language
+% definition files to check if one of them was specified by the user.
%
-% \subsection{\texttt{base}}
-%
-% The first option to be processed is |base|, which set the
-% hyphenation patterns then resets |ver@babel.sty| so that
-% \LaTeX forgets about the first loading. After |switch.def| has
-% been loaded (above) and |\AfterBabelLanguage| defined, exits.
+% The first two options are for debugging.
%
% \begin{macrocode}
%<*package>
@@ -4891,19 +4930,74 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@debug\@firstofone}
{\providecommand\bbl@trace[1]{}%
\let\bbl@debug\@gobble}
-\ifx\bbl@switchflag\@undefined % Prevent double input
- \let\bbl@switchflag\relax
- \input switch.def\relax
-\fi
-<@Load patterns in luatex@>
<@Basic macros@>
+ % Temporarily repeat here the code for errors
+ \def\bbl@error#1#2{%
+ \begingroup
+ \def\\{\MessageBreak}%
+ \PackageError{babel}{#1}{#2}%
+ \endgroup}
+ \def\bbl@warning#1{%
+ \begingroup
+ \def\\{\MessageBreak}%
+ \PackageWarning{babel}{#1}%
+ \endgroup}
+ \def\bbl@infowarn#1{%
+ \begingroup
+ \def\\{\MessageBreak}%
+ \GenericWarning
+ {(babel) \@spaces\@spaces\@spaces}%
+ {Package babel Info: #1}%
+ \endgroup}
+ \def\bbl@info#1{%
+ \begingroup
+ \def\\{\MessageBreak}%
+ \PackageInfo{babel}{#1}%
+ \endgroup}
+ \def\bbl@nocaption{\protect\bbl@nocaption@i}
+\def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname
+ \global\@namedef{#2}{\textbf{?#1?}}%
+ \@nameuse{#2}%
+ \bbl@warning{%
+ \@backslashchar#2 not set. Please, define\\%
+ it in the preamble with something like:\\%
+ \string\renewcommand\@backslashchar#2{..}\\%
+ Reported}}
+\def\bbl@tentative{\protect\bbl@tentative@i}
+\def\bbl@tentative@i#1{%
+ \bbl@warning{%
+ Some functions for '#1' are tentative.\\%
+ They might not work as expected and their behavior\\%
+ could change in the future.\\%
+ Reported}}
+\def\@nolanerr#1{%
+ \bbl@error
+ {You haven't defined the language #1\space yet.\\%
+ Perhaps you misspelled it or your installation\\%
+ is not complete}%
+ {Your command will be ignored, type <return> to proceed}}
+\def\@nopatterns#1{%
+ \bbl@warning
+ {No hyphenation patterns were preloaded for\\%
+ the language `#1' into the format.\\%
+ Please, configure your TeX system to add them and\\%
+ rebuild the format. Now I will use the patterns\\%
+ preloaded for \bbl@nulllanguage\space instead}}
+ % End of errors
+\@ifpackagewith{babel}{silent}
+ {\let\bbl@info\@gobble
+ \let\bbl@infowarn\@gobble
+ \let\bbl@warning\@gobble}
+ {}
+%
\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.
+% language used. Also avaliable with |base|, because it just shows
+% info.
%
% \begin{macrocode}
\ifx\bbl@languages\@undefined\else
@@ -4923,7 +5017,48 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@elt##1##2##3##4{}%
\fi}%
\bbl@languages
-\fi
+\fi%
+% \end{macrocode}
+% \subsection{\texttt{base}}
+%
+% The first `real' option to be processed is |base|, which set the
+% hyphenation patterns then resets |ver@babel.sty| so that \LaTeX
+% forgets about the first loading. After a subset of |babel.def| has
+% been loaded (the old |switch.def|) and |\AfterBabelLanguage| defined,
+% it exits.
+%
+% 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.
+%
+% \begin{macrocode}
+\bbl@trace{Defining option 'base'}
+\@ifpackagewith{babel}{base}{%
+ \let\bbl@onlyswitch\@empty
+ \let\bbl@provide@locale\relax
+ \input babel.def
+ \let\bbl@onlyswitch\@undefined
+ \ifx\directlua\@undefined
+ \DeclareOption*{\bbl@patterns{\CurrentOption}}%
+ \else
+ \input luababel.def
+ \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
+ \global\let\@ifl@ter@@\@ifl@ter
+ \def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}%
+ \endinput}{}%
+% \end{macrocode}
+%
+% TODO. Code for lua bidi options must be moved to a logical place. The
+% problem is |\RequirePackage|, which is forbidden allowed in the options
+% section.
+%
+% \begin{macrocode}
\ifodd\bbl@engine
\def\bbl@activate@preotf{%
\let\bbl@activate@preotf\relax % only once
@@ -4981,28 +5116,6 @@ help from Bernd Raichle, for which I am grateful.
\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 old versions of \textsf{polyglossia}, too.
-%
-% \begin{macrocode}
-\bbl@trace{Defining option 'base'}
-\@ifpackagewith{babel}{base}{%
- \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
- \global\let\@ifl@ter@@\@ifl@ter
- \def\@ifl@ter#1#2#3#4#5{\global\let\@ifl@ter\@ifl@ter@@}%
- \endinput}{}%
-% \end{macrocode}
-%
% \subsection{\texttt{key=value} options and other general option}
%
% The following macros extract language modifiers, and only real
@@ -5033,7 +5146,7 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\let\csname opt@babel.sty\endcsname\bbl@tempc
% \end{macrocode}
%
-% The next option tells \babel\ to leave shorthand characters active
+% The next option tells \babel{} to leave shorthand characters active
% at the end of processing the package. This is \emph{not} the default
% as it can cause problems with other packages, but for those who want
% to use the shorthand characters in the preamble of their documents
@@ -5049,7 +5162,7 @@ help from Bernd Raichle, for which I am grateful.
\DeclareOption{silent}{}
\DeclareOption{mono}{}
\DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa}
-% Don't use. Experimental:
+% Don't use. Experimental. TODO.
\newif\ifbbl@single
\DeclareOption{selectors=off}{\bbl@singletrue}
<@More package options@>
@@ -5078,11 +5191,12 @@ help from Bernd Raichle, for which I am grateful.
\bbl@csarg\ifx{opt@#1}\@nnil
\bbl@csarg\edef{opt@#1}{#2}%
\else
- \bbl@error{%
- Bad option `#1=#2'. Either you have misspelled the\\%
- key or there is a previous setting of `#1'}{%
- Valid keys are `shorthands', `config', `strings', `main',\\%
- `headfoot', `safe', `math', among others.}
+ \bbl@error
+ {Bad option `#1=#2'. Either you have misspelled the\\%
+ key or there is a previous setting of `#1'. Valid\\%
+ keys are, among others, `shorthands', `main', `bidi',\\%
+ `strings', `config', `headfoot', `safe', `math'.}%
+ {See the manual for further details.}
\fi}
% \end{macrocode}
%
@@ -5198,7 +5312,8 @@ help from Bernd Raichle, for which I am grateful.
% \end{macrocode}
%
% For |layout| an auxiliary macro is provided, available for packages
-% and language styles.
+% and language styles. Optimization: if there is no |layout|, just do
+% nothing.
%
% \begin{macrocode}
\bbl@trace{Defining IfBabelLayout}
@@ -5215,6 +5330,933 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
+% \textbf{Common definitions.} \textit{In progress.} Still based on
+% |babel.def|, but the code should be moved here.
+%
+% \begin{macrocode}
+\input babel.def
+% \end{macrocode}
+%
+% \subsection{Cross referencing macros}
+%
+% The \LaTeX\ book states:
+% \begin{quote}
+% The \emph{key} argument is any sequence of letters, digits, and
+% punctuation symbols; upper- and lowercase letters are regarded as
+% different.
+% \end{quote}
+% When the above quote should still be true when a document is
+% typeset in a language that has active characters, special care
+% has to be taken of the category codes of these characters when
+% they appear in an argument of the cross referencing macros.
+%
+% When a cross referencing command processes its argument, all
+% tokens in this argument should be character tokens with category
+% `letter' or `other'.
+%
+% The following package options control which macros are to be
+% redefined.
+%
+% \begin{macrocode}
+%<<*More package options>>
+\DeclareOption{safe=none}{\let\bbl@opt@safe\@empty}
+\DeclareOption{safe=bib}{\def\bbl@opt@safe{B}}
+\DeclareOption{safe=ref}{\def\bbl@opt@safe{R}}
+%<</More package options>>
+% \end{macrocode}
+%
+% \begin{macro}{\@newl@bel}
+%
+% First we open a new group to keep the changed setting of
+% |\protect| local and then we set the |@safe@actives| switch to
+% true to make sure that any shorthand that appears in any of the
+% arguments immediately expands to its non-active self.
+%
+% \begin{macrocode}
+\bbl@trace{Cross referencing macros}
+\ifx\bbl@opt@safe\@empty\else
+ \def\@newl@bel#1#2#3{%
+ {\@safe@activestrue
+ \bbl@ifunset{#1@#2}%
+ \relax
+ {\gdef\@multiplelabels{%
+ \@latex@warning@no@line{There were multiply-defined labels}}%
+ \@latex@warning@no@line{Label `#2' multiply defined}}%
+ \global\@namedef{#1@#2}{#3}}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\@testdef}
+%
+% An internal \LaTeX\ macro used to test if the labels that have
+% been written on the |.aux| file have changed. It is called by
+% the |\enddocument| macro.
+%
+% \begin{macrocode}
+ \CheckCommand*\@testdef[3]{%
+ \def\reserved@a{#3}%
+ \expandafter\ifx\csname#1@#2\endcsname\reserved@a
+ \else
+ \@tempswatrue
+ \fi}
+% \end{macrocode}
+%
+% Now that we made sure that |\@testdef| still has the same definition
+% we can rewrite it. First we make the shorthands `safe'. Then we use
+% |\bbl@tempa| as an `alias' for the macro that contains the label
+% which is being checked. Then we define |\bbl@tempb| just as
+% |\@newl@bel| does it. When the label is defined we replace the
+% definition of |\bbl@tempa| by its meaning. If the label didn't
+% change, |\bbl@tempa| and |\bbl@tempb| should be identical macros.
+%
+% \begin{macrocode}
+ \def\@testdef#1#2#3{% TODO. With @samestring?
+ \@safe@activestrue
+ \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname
+ \def\bbl@tempb{#3}%
+ \@safe@activesfalse
+ \ifx\bbl@tempa\relax
+ \else
+ \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}%
+ \fi
+ \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
+ \ifx\bbl@tempa\bbl@tempb
+ \else
+ \@tempswatrue
+ \fi}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\ref}
+% \begin{macro}{\pageref}
+%
+% The same holds for the macro |\ref| that references a label and
+% |\pageref| to reference a page. We make them robust as well (if
+% they weren't already) to prevent problems if they should become
+% expanded at the wrong moment.
+%
+% \begin{macrocode}
+\bbl@xin@{R}\bbl@opt@safe
+\ifin@
+ \bbl@redefinerobust\ref#1{%
+ \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
+ \bbl@redefinerobust\pageref#1{%
+ \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
+\else
+ \let\org@ref\ref
+ \let\org@pageref\pageref
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@citex}
+% The macro used to cite from a bibliography, |\cite|, uses an
+% internal macro, |\@citex|.
+% It is this internal macro that picks up the argument(s),
+% so we redefine this internal macro and leave |\cite| alone. The
+% first argument is used for typesetting, so the shorthands need
+% only be deactivated in the second argument.
+%
+% \begin{macrocode}
+\bbl@xin@{B}\bbl@opt@safe
+\ifin@
+ \bbl@redefine\@citex[#1]#2{%
+ \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse
+ \org@@citex[#1]{\@tempa}}
+% \end{macrocode}
+%
+% Unfortunately, the packages \pkg{natbib} and \pkg{cite} need a
+% different definition of |\@citex|...
+% To begin with, \pkg{natbib} has a definition for |\@citex| with
+% \emph{three} arguments... We only know that a package is loaded
+% when |\begin{document}| is executed, so we need to postpone the
+% different redefinition.
+%
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \@ifpackageloaded{natbib}{%
+% \end{macrocode}
+%
+% Notice that we use |\def| here instead of |\bbl@redefine| because
+% |\org@@citex| is already defined and we don't want to overwrite
+% that definition (it would result in parameter stack overflow
+% because of a circular definition).
+%
+% (Recent versions of \pkg{natbib} change dynamically |\@citex|, so PR4087
+% doesn't seem fixable in a simple way. Just load \pkg{natbib} before.)
+%
+% \begin{macrocode}
+ \def\@citex[#1][#2]#3{%
+ \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
+ \org@@citex[#1][#2]{\@tempa}}%
+ }{}}
+% \end{macrocode}
+%
+% The package \pkg{cite} has a definition of |\@citex| where the
+% shorthands need to be turned off in both arguments.
+%
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \@ifpackageloaded{cite}{%
+ \def\@citex[#1]#2{%
+ \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}%
+ }{}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\nocite}
+% The macro |\nocite| which is used to instruct BiB\TeX\ to
+% extract uncited references from the database.
+%
+% \begin{macrocode}
+ \bbl@redefine\nocite#1{%
+ \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bibcite}
+% The macro that is used in the |.aux| file to
+% define citation labels. When packages such as \pkg{natbib} or
+% \pkg{cite} are not loaded its second argument is used to typeset the
+% citation label. In that case, this second argument can contain
+% active characters but is used in an environment where
+% |\@safe@activestrue| is in effect. This switch needs to be reset
+% inside the |\hbox| which contains the citation label. In order to
+% determine during \file{.aux} file processing which definition of
+% |\bibcite| is needed we define |\bibcite| in such a way that it
+% redefines itself with the proper definition. We call
+% |\bbl@cite@choice| to select the proper definition for |\bibcite|.
+% This new definition is then activated.
+%
+% \begin{macrocode}
+ \bbl@redefine\bibcite{%
+ \bbl@cite@choice
+ \bibcite}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bbl@bibcite}
+% The macro |\bbl@bibcite| holds the definition of |\bibcite|
+% needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
+%
+% \begin{macrocode}
+ \def\bbl@bibcite#1#2{%
+ \org@bibcite{#1}{\@safe@activesfalse#2}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bbl@cite@choice}
+% The macro |\bbl@cite@choice| determines which definition of
+% |\bibcite| is needed. First we give |\bibcite| its default
+% definition.
+%
+% \begin{macrocode}
+ \def\bbl@cite@choice{%
+ \global\let\bibcite\bbl@bibcite
+ \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}%
+ \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}%
+ \global\let\bbl@cite@choice\relax}
+% \end{macrocode}
+%
+% When a document is run for the first time, no \file{.aux} file is
+% available, and |\bibcite| will not yet be properly defined. In
+% this case, this has to happen before the document starts.
+%
+% \begin{macrocode}
+ \AtBeginDocument{\bbl@cite@choice}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\@bibitem}
+% One of the two internal \LaTeX\ macros called by |\bibitem|
+% that write the citation label on the |.aux| file.
+%
+% \begin{macrocode}
+ \bbl@redefine\@bibitem#1{%
+ \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse}
+\else
+ \let\org@nocite\nocite
+ \let\org@@citex\@citex
+ \let\org@bibcite\bibcite
+ \let\org@@bibitem\@bibitem
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsection{Marks}
+%
+% \begin{macro}{\markright}
+% Because the output routine is asynchronous, we must pass the
+% current language attribute to the head lines. To achieve this we
+% need to adapt the definition of |\markright| and |\markboth|
+% somewhat. However, headlines and footlines can contain text
+% outside marks; for that we must take some actions in the output
+% routine if the 'headfoot' options is used.
+%
+% We need to make some redefinitions to the output routine
+% to avoid an endless loop and to correctly handle the page number
+% in bidi documents.
+%
+% \begin{macrocode}
+\bbl@trace{Marks}
+\IfBabelLayout{sectioning}
+ {\ifx\bbl@opt@headfoot\@nnil
+ \g@addto@macro\@resetactivechars{%
+ \set@typeset@protect
+ \expandafter\select@language@x\expandafter{\bbl@main@language}%
+ \let\protect\noexpand
+ \edef\thepage{% TODO. Only with bidi. See also above
+ \noexpand\babelsublr{\unexpanded\expandafter{\thepage}}}}%
+ \fi}
+ {\ifbbl@single\else
+ \bbl@ifunset{markright }\bbl@redefine\bbl@redefinerobust
+ \markright#1{%
+ \bbl@ifblank{#1}%
+ {\org@markright{}}%
+ {\toks@{#1}%
+ \bbl@exp{%
+ \\\org@markright{\\\protect\\\foreignlanguage{\languagename}%
+ {\\\protect\\\bbl@restore@actives\the\toks@}}}}}%
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\markboth}
+% \begin{macro}{\@mkboth}
+% The definition of |\markboth| is equivalent to that of
+% |\markright|, except that we need two token registers. The
+% documentclasses \cls{report} and \cls{book} define and set the
+% headings for the page. While doing so they also store a copy of
+% |\markboth| in |\@mkboth|. Therefore we need to check whether
+% |\@mkboth| has already been set. If so we neeed to do that again
+% with the new definition of |\markboth|. (As of Oct 2019, \LaTeX{}
+% stores the definition in an intermediate macro, so it's not
+% necessary anymore, but it's preserved for older versions.)
+%
+% \begin{macrocode}
+ \ifx\@mkboth\markboth
+ \def\bbl@tempc{\let\@mkboth\markboth}
+ \else
+ \def\bbl@tempc{}
+ \fi
+ \bbl@ifunset{markboth }\bbl@redefine\bbl@redefinerobust
+ \markboth#1#2{%
+ \protected@edef\bbl@tempb##1{%
+ \protect\foreignlanguage
+ {\languagename}{\protect\bbl@restore@actives##1}}%
+ \bbl@ifblank{#1}%
+ {\toks@{}}%
+ {\toks@\expandafter{\bbl@tempb{#1}}}%
+ \bbl@ifblank{#2}%
+ {\@temptokena{}}%
+ {\@temptokena\expandafter{\bbl@tempb{#2}}}%
+ \bbl@exp{\\\org@markboth{\the\toks@}{\the\@temptokena}}}
+ \bbl@tempc
+ \fi} % end ifbbl@single, end \IfBabelLayout
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Preventing clashes with other packages}
+%
+% \subsubsection{\pkg{ifthen}}
+%
+% \begin{macro}{\ifthenelse}
+%
+% Sometimes a document writer wants to create a special effect
+% depending on the page a certain fragment of text appears on. This
+% can be achieved by the following piece of code:
+%\begin{verbatim}
+% \ifthenelse{\isodd{\pageref{some:label}}}
+% {code for odd pages}
+% {code for even pages}
+%\end{verbatim}
+% In order for this to work the argument of |\isodd| needs to be
+% fully expandable. With the above redefinition of |\pageref| it is
+% not in the case of this example. To overcome that, we add some
+% code to the definition of |\ifthenelse| to make things work.
+%
+% We want to revert the definition of |\pageref| and |\ref| to
+% their original definition for the first argument of |\ifthenelse|,
+% so we first need to store their current meanings.
+%
+% Then we can set the |\@safe@actives| switch and call the original
+% |\ifthenelse|. In order to be able to use shorthands in the
+% second and third arguments of |\ifthenelse| the resetting of the
+% switch \emph{and} the definition of |\pageref| happens inside
+% those arguments.
+%
+% \begin{macrocode}
+\bbl@trace{Preventing clashes with other packages}
+\bbl@xin@{R}\bbl@opt@safe
+\ifin@
+ \AtBeginDocument{%
+ \@ifpackageloaded{ifthen}{%
+ \bbl@redefine@long\ifthenelse#1#2#3{%
+ \let\bbl@temp@pref\pageref
+ \let\pageref\org@pageref
+ \let\bbl@temp@ref\ref
+ \let\ref\org@ref
+ \@safe@activestrue
+ \org@ifthenelse{#1}%
+ {\let\pageref\bbl@temp@pref
+ \let\ref\bbl@temp@ref
+ \@safe@activesfalse
+ #2}%
+ {\let\pageref\bbl@temp@pref
+ \let\ref\bbl@temp@ref
+ \@safe@activesfalse
+ #3}%
+ }%
+ }{}%
+ }
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsubsection{\pkg{varioref}}
+%
+% \begin{macro}{\@@vpageref}
+% \begin{macro}{\vrefpagenum}
+% \begin{macro}{\Ref}
+%
+% When the package varioref is in use we need to modify its
+% internal command |\@@vpageref| in order to prevent problems when
+% an active character ends up in the argument of |\vref|. The same
+% needs to happen for |\vrefpagenum|.
+%
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \@ifpackageloaded{varioref}{%
+ \bbl@redefine\@@vpageref#1[#2]#3{%
+ \@safe@activestrue
+ \org@@@vpageref{#1}[#2]{#3}%
+ \@safe@activesfalse}%
+ \bbl@redefine\vrefpagenum#1#2{%
+ \@safe@activestrue
+ \org@vrefpagenum{#1}{#2}%
+ \@safe@activesfalse}%
+% \end{macrocode}
+%
+% The package \pkg{varioref} defines |\Ref| to be a robust command
+% wich uppercases the first character of the reference text. In
+% order to be able to do that it needs to access the expandable form
+% of |\ref|. So we employ a little trick here. We redefine the
+% (internal) command \verb*|\Ref | to call |\org@ref| instead of
+% |\ref|. The disadvantage of this solution is that whenever the
+% definition of |\Ref| changes, this definition needs to be updated
+% as well.
+%
+% \begin{macrocode}
+ \expandafter\def\csname Ref \endcsname#1{%
+ \protected@edef\@tempa{\org@ref{#1}}\expandafter\MakeUppercase\@tempa}
+ }{}%
+ }
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{\pkg{hhline}}
+%
+% \begin{macro}{\hhline}
+% Delaying the activation of the shorthand characters has introduced
+% a problem with the \pkg{hhline} package. The reason is that it
+% uses the `:' character which is made active by the french support
+% in \babel. Therefore we need to \emph{reload} the package when
+% the `:' is an active character. Note that this happens
+% \emph{after} the category code of the @-sign has been changed to
+% other, so we need to temporarily change it to letter again.
+%
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \AtBeginDocument{%
+ \@ifpackageloaded{hhline}%
+ {\expandafter\ifx\csname normal@char\string:\endcsname\relax
+ \else
+ \makeatletter
+ \def\@currname{hhline}\input{hhline.sty}\makeatother
+ \fi}%
+ {}}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsubsection{\pkg{hyperref}}
+%
+% \begin{macro}{\pdfstringdefDisableCommands}
+%
+% A number of interworking problems between \pkg{babel} and
+% \pkg{hyperref} are tackled by \pkg{hyperref} itself. The
+% following code was introduced to prevent some annoying warnings
+% but it broke bookmarks. This was quickly fixed in \pkg{hyperref},
+% which essentially made it no-op. However, it will not removed for
+% the moment because \pkg{hyperref} is expecting it. TODO. Still
+% true?
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifx\pdfstringdefDisableCommands\@undefined\else
+ \pdfstringdefDisableCommands{\languageshorthands{system}}%
+ \fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsubsection{\pkg{fancyhdr}}
+%
+% \begin{macro}{\FOREIGNLANGUAGE}
+% The package \pkg{fancyhdr} treats the running head and fout lines
+% somewhat differently as the standard classes. A symptom of this is
+% that the command |\foreignlanguage| which \babel\ adds to the
+% marks can end up inside the argument of |\MakeUppercase|. To
+% prevent unexpected results we need to define |\FOREIGNLANGUAGE|
+% here.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
+ \lowercase{\foreignlanguage{#1}}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\substitutefontfamily}
+%
+% The command |\substitutefontfamily| creates an
+% \file{.fd} file on the fly. The first argument is an encoding
+% mnemonic, the second and third arguments are font family names.
+% This command is deprecated. Use the tools provides by \LaTeX.
+%
+% \begin{macrocode}
+\def\substitutefontfamily#1#2#3{%
+ \lowercase{\immediate\openout15=#1#2.fd\relax}%
+ \immediate\write15{%
+ \string\ProvidesFile{#1#2.fd}%
+ [\the\year/\two@digits{\the\month}/\two@digits{\the\day}
+ \space generated font description file]^^J
+ \string\DeclareFontFamily{#1}{#2}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J
+ \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J
+ \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J
+ }%
+ \closeout15
+ }
+\@onlypreamble\substitutefontfamily
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsection{Encoding and fonts}
+%
+% Because documents may use non-ASCII font encodings, we make sure
+% that the logos of \TeX\ and \LaTeX\ always come out in the right
+% encoding. There is a list of non-ASCII encodings. Unfortunately,
+% \textsf{fontenc} deletes its package options, so we must guess which
+% encodings has been loaded by traversing |\@filelist| to search for
+% \m{enc}|enc.def|. If a non-ASCII has been loaded, we define versions
+% of |\TeX| and |\LaTeX| for them using |\ensureascii|. The default
+% ASCII encoding is set, too (in reverse order): the ``main'' encoding
+% (when the document begins), the last loaded, or |OT1|.
+%
+% \begin{macro}{\ensureascii}
+%
+% \begin{macrocode}
+\bbl@trace{Encoding and fonts}
+\newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,PU,PD1}
+\newcommand\BabelNonText{TS1,T3,TS3}
+\let\org@TeX\TeX
+\let\org@LaTeX\LaTeX
+\let\ensureascii\@firstofone
+\AtBeginDocument{%
+ \in@false
+ \bbl@foreach\BabelNonASCII{% is there a text non-ascii enc?
+ \ifin@\else
+ \lowercase{\bbl@xin@{,#1enc.def,}{,\@filelist,}}%
+ \fi}%
+ \ifin@ % if a text non-ascii has been loaded
+ \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}%
+ \DeclareTextCommandDefault{\TeX}{\org@TeX}%
+ \DeclareTextCommandDefault{\LaTeX}{\org@LaTeX}%
+ \def\bbl@tempb#1\@@{\uppercase{\bbl@tempc#1}ENC.DEF\@empty\@@}%
+ \def\bbl@tempc#1ENC.DEF#2\@@{%
+ \ifx\@empty#2\else
+ \bbl@ifunset{T@#1}%
+ {}%
+ {\bbl@xin@{,#1,}{,\BabelNonASCII,\BabelNonText,}%
+ \ifin@
+ \DeclareTextCommand{\TeX}{#1}{\ensureascii{\org@TeX}}%
+ \DeclareTextCommand{\LaTeX}{#1}{\ensureascii{\org@LaTeX}}%
+ \else
+ \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}%
+ \fi}%
+ \fi}%
+ \bbl@foreach\@filelist{\bbl@tempb#1\@@}% TODO - \@@ de mas??
+ \bbl@xin@{,\cf@encoding,}{,\BabelNonASCII,\BabelNonText,}%
+ \ifin@\else
+ \edef\ensureascii#1{{%
+ \noexpand\fontencoding{\cf@encoding}\noexpand\selectfont#1}}%
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Now comes the old deprecated stuff (with a little change in 3.9l,
+% for \textsf{fontspec}). The first thing we need to do is to
+% determine, at |\begin{document}|, which latin fontencoding to use.
+%
+% \begin{macro}{\latinencoding}
+% When text is being typeset in an encoding other than `latin'
+% (\texttt{OT1} or \texttt{T1}), it would be nice to still have
+% Roman numerals come out in the Latin encoding.
+% So we first assume that the current encoding at the end
+% of processing the package is the Latin encoding.
+%
+% \begin{macrocode}
+\AtEndOfPackage{\edef\latinencoding{\cf@encoding}}
+% \end{macrocode}
+%
+% But this might be overruled with a later loading of the package
+% \pkg{fontenc}. Therefore we check at the execution of
+% |\begin{document}| whether it was loaded with the \Lopt{T1}
+% option. The normal way to do this (using |\@ifpackageloaded|) is
+% disabled for this package. Now we have to revert to parsing the
+% internal macro |\@filelist| which contains all the filenames
+% loaded.
+%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifpackageloaded{fontspec}%
+ {\xdef\latinencoding{%
+ \ifx\UTFencname\@undefined
+ EU\ifcase\bbl@engine\or2\or1\fi
+ \else
+ \UTFencname
+ \fi}}%
+ {\gdef\latinencoding{OT1}%
+ \ifx\cf@encoding\bbl@t@one
+ \xdef\latinencoding{\bbl@t@one}%
+ \else
+ \ifx\@fontenc@load@list\@undefined
+ \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
+ \else
+ \def\@elt#1{,#1,}%
+ \edef\bbl@tempa{\expandafter\@gobbletwo\@fontenc@load@list}%
+ \let\@elt\relax
+ \bbl@xin@{,T1,}\bbl@tempa
+ \ifin@
+ \xdef\latinencoding{\bbl@t@one}%
+ \fi
+ \fi
+ \fi}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\latintext}
+% Then we can define the command |\latintext| which is a
+% declarative switch to a latin font-encoding. Usage of this macro
+% is deprecated.
+%
+% \begin{macrocode}
+\DeclareRobustCommand{\latintext}{%
+ \fontencoding{\latinencoding}\selectfont
+ \def\encodingdefault{\latinencoding}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\textlatin}
+% This command takes an argument which is then typeset using the
+% requested font encoding. In order to avoid many encoding switches
+% it operates in a local scope.
+%
+% \begin{macrocode}
+\ifx\@undefined\DeclareTextFontCommand
+ \DeclareRobustCommand{\textlatin}[1]{\leavevmode{\latintext #1}}
+\else
+ \DeclareTextFontCommand{\textlatin}{\latintext}
+\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsection{Basic bidi support}
+%
+% \textbf{Work in progress.} This code is currently placed here for
+% practical reasons. It will be moved to the correct place soon, I
+% hope.
+%
+% It is loosely based on |rlbabel.def|, but most of it has been
+% developed from scratch. This \babel{} module (by Johannes Braams and
+% Boris Lavva) has served the purpose of typesetting R documents for
+% two decades, and despite its flaws I think it is still a good starting
+% point (some parts have been copied here almost verbatim), partly
+% thanks to its simplicity. I've also looked at \textsc{arabi} (by
+% Youssef Jabri), which is compatible with \babel{}.
+%
+% There are two ways of modifying macros to make them “bidi”, namely,
+% by patching the internal low-level macros (which is what I have done
+% with lists, columns, counters, tocs, much like |rlbabel| did), and
+% by introducing a “middle layer” just below the user interface
+% (sectioning, footnotes).
+%
+% \begin{itemize}
+% \item pdftex provides a minimal support for bidi text, and it
+% must be done by hand. Vertical typesetting is not possible.
+% \item \xetex{} is somewhat better, thanks to its font engine
+% (even if not always reliable) and a few additional tools. However,
+% very little is done at the paragraph level. Another challenging
+% problem is text direction does not honour \TeX{} grouping.
+% \item \luatex{} can provide the most complete solution, as we can
+% manipulate almost freely the node list, the generated lines,
+% and so on, but bidi text does not work out of the box and some
+% development is necessary. It also provides tools to properly
+% set left-to-right and right-to-left page layouts. As Lua\TeX-ja
+% shows, vertical typesetting is possible, too.
+% \end{itemize}
+%
+% \begin{macrocode}
+\bbl@trace{Basic (internal) bidi support}
+\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
+\def\bbl@rscripts{%
+ ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
+ Old Hungarian,Old Hungarian,Lydian,Mandaean,Manichaean,%
+ 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@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}%
+ \ifin@
+ \global\bbl@csarg\chardef{wdir@#1}\@ne
+ \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts}%
+ \ifin@
+ \global\bbl@csarg\chardef{wdir@#1}\tw@ % useless in xetex
+ \fi
+ \else
+ \global\bbl@csarg\chardef{wdir@#1}\z@
+ \fi
+ \ifodd\bbl@engine
+ \bbl@csarg\ifcase{wdir@#1}%
+ \directlua{ Babel.locale_props[\the\localeid].textdir = 'l' }%
+ \or
+ \directlua{ Babel.locale_props[\the\localeid].textdir = 'r' }%
+ \or
+ \directlua{ Babel.locale_props[\the\localeid].textdir = 'al' }%
+ \fi
+ \fi}
+\def\bbl@switchdir{%
+ \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}%
+ \bbl@ifunset{bbl@wdir@\languagename}{\bbl@provide@dirs{\languagename}}{}%
+ \bbl@exp{\\\bbl@setdirs\bbl@cl{wdir}}}
+\def\bbl@setdirs#1{% TODO - math
+ \ifcase\bbl@select@type % TODO - strictly, not the right test
+ \bbl@bodydir{#1}%
+ \bbl@pardir{#1}%
+ \fi
+ \bbl@textdir{#1}}
+\ifodd\bbl@engine % luatex=1
+ \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
+ \DisableBabelHook{babel-bidi}
+ \chardef\bbl@thetextdir\z@
+ \chardef\bbl@thepardir\z@
+ \def\bbl@getluadir#1{%
+ \directlua{
+ if tex.#1dir == 'TLT' then
+ tex.sprint('0')
+ elseif tex.#1dir == 'TRT' then
+ tex.sprint('1')
+ end}}
+ \def\bbl@setluadir#1#2#3{% 1=text/par.. 2=\textdir.. 3=0 lr/1 rl
+ \ifcase#3\relax
+ \ifcase\bbl@getluadir{#1}\relax\else
+ #2 TLT\relax
+ \fi
+ \else
+ \ifcase\bbl@getluadir{#1}\relax
+ #2 TRT\relax
+ \fi
+ \fi}
+ \def\bbl@textdir#1{%
+ \bbl@setluadir{text}\textdir{#1}%
+ \chardef\bbl@thetextdir#1\relax
+ \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}}
+ \def\bbl@pardir#1{%
+ \bbl@setluadir{par}\pardir{#1}%
+ \chardef\bbl@thepardir#1\relax}
+ \def\bbl@bodydir{\bbl@setluadir{body}\bodydir}
+ \def\bbl@pagedir{\bbl@setluadir{page}\pagedir}
+ \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%%
+ % Sadly, we have to deal with boxes in math with basic.
+ % Activated every math with the package option bidi=:
+ \def\bbl@mathboxdir{%
+ \ifcase\bbl@thetextdir\relax
+ \everyhbox{\textdir TLT\relax}%
+ \else
+ \everyhbox{\textdir TRT\relax}%
+ \fi}
+\else % pdftex=0, xetex=2
+ \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
+ \DisableBabelHook{babel-bidi}
+ \newcount\bbl@dirlevel
+ \chardef\bbl@thetextdir\z@
+ \chardef\bbl@thepardir\z@
+ \def\bbl@textdir#1{%
+ \ifcase#1\relax
+ \chardef\bbl@thetextdir\z@
+ \bbl@textdir@i\beginL\endL
+ \else
+ \chardef\bbl@thetextdir\@ne
+ \bbl@textdir@i\beginR\endR
+ \fi}
+ \def\bbl@textdir@i#1#2{%
+ \ifhmode
+ \ifnum\currentgrouplevel>\z@
+ \ifnum\currentgrouplevel=\bbl@dirlevel
+ \bbl@error{Multiple bidi settings inside a group}%
+ {I'll insert a new group, but expect wrong results.}%
+ \bgroup\aftergroup#2\aftergroup\egroup
+ \else
+ \ifcase\currentgrouptype\or % 0 bottom
+ \aftergroup#2% 1 simple {}
+ \or
+ \bgroup\aftergroup#2\aftergroup\egroup % 2 hbox
+ \or
+ \bgroup\aftergroup#2\aftergroup\egroup % 3 adj hbox
+ \or\or\or % vbox vtop align
+ \or
+ \bgroup\aftergroup#2\aftergroup\egroup % 7 noalign
+ \or\or\or\or\or\or % output math disc insert vcent mathchoice
+ \or
+ \aftergroup#2% 14 \begingroup
+ \else
+ \bgroup\aftergroup#2\aftergroup\egroup % 15 adj
+ \fi
+ \fi
+ \bbl@dirlevel\currentgrouplevel
+ \fi
+ #1%
+ \fi}
+ \def\bbl@pardir#1{\chardef\bbl@thepardir#1\relax}
+ \let\bbl@bodydir\@gobble
+ \let\bbl@pagedir\@gobble
+ \def\bbl@dirparastext{\chardef\bbl@thepardir\bbl@thetextdir}
+% \end{macrocode}
+%
+% The following command is executed only if there is a right-to-left
+% script (once). It activates the |\everypar| hack for \xetex, to
+% properly handle the par direction. Note text and par dirs are
+% decoupled to some extent (although not completely).
+%
+% \begin{macrocode}
+ \def\bbl@xebidipar{%
+ \let\bbl@xebidipar\relax
+ \TeXXeTstate\@ne
+ \def\bbl@xeeverypar{%
+ \ifcase\bbl@thepardir
+ \ifcase\bbl@thetextdir\else\beginR\fi
+ \else
+ {\setbox\z@\lastbox\beginR\box\z@}%
+ \fi}%
+ \let\bbl@severypar\everypar
+ \newtoks\everypar
+ \everypar=\bbl@severypar
+ \bbl@severypar{\bbl@xeeverypar\the\everypar}}
+ \def\bbl@tempb{%
+ \let\bbl@textdir@i\@gobbletwo
+ \let\bbl@xebidipar\@empty
+ \AddBabelHook{bidi}{foreign}{%
+ \def\bbl@tempa{\def\BabelText########1}%
+ \ifcase\bbl@thetextdir
+ \expandafter\bbl@tempa\expandafter{\BabelText{\LR{####1}}}%
+ \else
+ \expandafter\bbl@tempa\expandafter{\BabelText{\RL{####1}}}%
+ \fi}
+ \def\bbl@pardir##1{\ifcase##1\relax\setLR\else\setRL\fi}}
+ \@ifpackagewith{babel}{bidi=bidi}{\bbl@tempb}{}%
+ \@ifpackagewith{babel}{bidi=bidi-l}{\bbl@tempb}{}%
+ \@ifpackagewith{babel}{bidi=bidi-r}{\bbl@tempb}{}%
+\fi
+% \end{macrocode}
+%
+% A tool for weak L (mainly digits). We also disable warnings with
+% \textsf{hyperref}.
+%
+% \begin{macrocode}
+\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}}
+\AtBeginDocument{%
+ \ifx\pdfstringdefDisableCommands\@undefined\else
+ \ifx\pdfstringdefDisableCommands\relax\else
+ \pdfstringdefDisableCommands{\let\babelsublr\@firstofone}%
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% \subsection{Local Language Configuration}
+%
+% \begin{macro}{\loadlocalcfg}
+% At some sites it may be necessary to add site-specific actions to
+% a language definition file. This can be done by creating a file
+% with the same name as the language definition file, but with the
+% extension \file{.cfg}. For instance the file \file{norsk.cfg}
+% will be loaded when the language definition file \file{norsk.ldf}
+% is loaded.
+%
+% For plain-based formats we don't want to override the definition
+% of |\loadlocalcfg| from \file{plain.def}.
+%
+% \begin{macrocode}
+\bbl@trace{Local Language Configuration}
+\ifx\loadlocalcfg\@undefined
+ \@ifpackagewith{babel}{noconfigs}%
+ {\let\loadlocalcfg\@gobble}%
+ {\def\loadlocalcfg#1{%
+ \InputIfFileExists{#1.cfg}%
+ {\typeout{*************************************^^J%
+ * Local config file #1.cfg used^^J%
+ *}}%
+ \@empty}}
+\fi
+% \end{macrocode}%
+% \end{macro}
+%
+% Just to be compatible with \LaTeX$\:$2.09 we add a few more lines
+% of code. TODO. Necessary? Correct place? Used by some ldf file?
+%
+% \begin{macrocode}
+\ifx\@unexpandable@protect\@undefined
+ \def\@unexpandable@protect{\noexpand\protect\noexpand}
+ \long\def\protected@write#1#2#3{%
+ \begingroup
+ \let\thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef\reserved@a{\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak\ifvmode\nobreak\fi\fi}
+\fi
+%
% \subsection{Language options}
%
% Languages are loaded when processing the corresponding option
@@ -5363,6 +6405,7 @@ help from Bernd Raichle, for which I am grateful.
% |\AfterBabelLanguage|.
%
% \begin{macrocode}
+\bbl@trace{Option 'main'}
\ifx\bbl@opt@main\@nnil
\edef\bbl@tempa{\@classoptionslist,\bbl@language@opts}
\let\bbl@tempc\@empty
@@ -5409,18 +6452,11 @@ help from Bernd Raichle, for which I am grateful.
%
% \section{The kernel of Babel (\texttt{babel.def}, common)}
%
-% The kernel of the \babel\ system is stored in either
-% \file{hyphen.cfg} or \file{switch.def} and \file{babel.def}. The
-% file \file{babel.def} contains most of the code, while
-% \file{switch.def} defines the language-switching commands; both can
-% be read at run time. The file \file{hyphen.cfg} is a file that can
-% be loaded into the format, which is necessary when you want to be
-% able to switch hyphenation patterns (by default, it also inputs
-% \file{switch.def}, for ``historical reasons'', but it is not
-% necessary). When \file{babel.def} is loaded it checks if the current
-% version of \file{switch.def} is in the format; if not, it is
-% loaded. A further file, \file{babel.sty}, contains \LaTeX-specific
-% stuff.
+% The kernel of the \babel\ system is currently stored in
+% \file{babel.def}. The file \file{babel.def} contains most of the
+% code. The file \file{hyphen.cfg} is a file that can be loaded into
+% the format, which is necessary when you want to be able to switch
+% hyphenation patterns.
%
% Because plain \TeX\ users might want to use some of the features of
% the \babel{} system too, care has to be taken that plain \TeX\ can
@@ -5437,13 +6473,10 @@ help from Bernd Raichle, for which I am grateful.
% \subsection{Tools}
%
% \begin{macrocode}
-\ifx\ldf@quit\@undefined
-\else
- \expandafter\endinput
-\fi
+\ifx\ldf@quit\@undefined\else
+\endinput\fi % Same line!
<@Make sure ProvidesFile is defined@>
\ProvidesFile{babel.def}[<@date@> <@version@> Babel common definitions]
-<@Load macros for plain if not LaTeX@>
% \end{macrocode}
%
% The file |babel.def| expects some definitions made in the \LaTeXe{}
@@ -5456,7 +6489,9 @@ help from Bernd Raichle, for which I am grateful.
% set too (but not sure it works).
%
% \begin{macrocode}
-\ifx\bbl@ifshorthand\@undefined
+\ifx\AtBeginDocument\@undefined % TODO. change test.
+ <@Emulate LaTeX@>
+ \def\languagename{english}%
\let\bbl@opt@shorthands\@nnil
\def\bbl@ifshorthand#1#2#3{#2}%
\let\bbl@language@opts\@empty
@@ -5480,17 +6515,957 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
+% Exit immediately with 2.09. An error is raised by the sty file, but
+% also try to minimize the number of errors.
+%
+% \begin{macrocode}
+\ifx\bbl@trace\@undefined
+ \let\LdfInit\endinput
+ \def\ProvidesLanguage#1{\endinput}
+\endinput\fi % Same line!
+% \end{macrocode}
+%
% And continue.
%
+% \section{Multiple languages}
+%
+% This is not a separate file (\texttt{switch.def}) anymore.
+%
+% Plain \TeX\ version~3.0 provides the primitive |\language| that
+% is used to store the current language. When used with a pre-3.0
+% version this function has to be implemented by allocating a
+% counter.
+%
+% \begin{macrocode}
+<@Define core switching macros@>
+% \end{macrocode}
+%
+% \begin{macro}{\adddialect}
+% The macro |\adddialect| can be used to add the name of a dialect
+% or variant language, for which an already defined hyphenation
+% table can be used.
+%
+% \begin{macrocode}
+\def\bbl@version{<@version@>}
+\def\bbl@date{<@date@>}
+\def\adddialect#1#2{%
+ \global\chardef#1#2\relax
+ \bbl@usehooks{adddialect}{{#1}{#2}}%
+ \begingroup
+ \count@#1\relax
+ \def\bbl@elt##1##2##3##4{%
+ \ifnum\count@=##2\relax
+ \bbl@info{\string#1 = using hyphenrules for ##1\\%
+ (\string\language\the\count@)}%
+ \def\bbl@elt####1####2####3####4{}%
+ \fi}%
+ \bbl@cs{languages}%
+ \endgroup}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% |\bbl@iflanguage| executes code only if the language |l@|
+% exists. Otherwise raises and error.
+%
+% The argument of |\bbl@fixname| has to be a macro name, as it may get
+% ``fixed'' if casing (lc/uc) is wrong. It's intented to fix a
+% long-standing bug when |\foreignlanguage| and the like appear in
+% a |\MakeXXXcase|. However, a lowercase form is not imposed to
+% improve backward compatibility (perhaps you defined a language
+% named |MYLANG|, but unfortunately mixed case names cannot be
+% trapped). Note |l@| is encapsulated, so that its case does not
+% change.
+%
+% \begin{macrocode}
+\def\bbl@fixname#1{%
+ \begingroup
+ \def\bbl@tempe{l@}%
+ \edef\bbl@tempd{\noexpand\@ifundefined{\noexpand\bbl@tempe#1}}%
+ \bbl@tempd
+ {\lowercase\expandafter{\bbl@tempd}%
+ {\uppercase\expandafter{\bbl@tempd}%
+ \@empty
+ {\edef\bbl@tempd{\def\noexpand#1{#1}}%
+ \uppercase\expandafter{\bbl@tempd}}}%
+ {\edef\bbl@tempd{\def\noexpand#1{#1}}%
+ \lowercase\expandafter{\bbl@tempd}}}%
+ \@empty
+ \edef\bbl@tempd{\endgroup\def\noexpand#1{#1}}%
+ \bbl@tempd
+ \bbl@exp{\\\bbl@usehooks{languagename}{{\languagename}{#1}}}}
+\def\bbl@iflanguage#1{%
+ \@ifundefined{l@#1}{\@nolanerr{#1}\@gobble}\@firstofone}
+% \end{macrocode}
+%
+% After a name has been ‘fixed’, the selectors will try to load the
+% language. If even the fixed name is not defined, will load it on the
+% fly, either based on its name, or if activated, its BCP47 code.
+%
+% We first need a couple of macros for a simple BCP 47 look up. It also
+% makes sure, with |\bbl@bcpcase|, casing is the correct one, so that
+% sr-latn-ba becomes fr-Latn-BA. Note |#4| may contain some
+% |\@empty|'s, but they are eventually removed. |\bbl@bcplookup| either
+% returns the found |ini| or it is |\relax|.
+%
+% \begin{macrocode}
+\def\bbl@bcpcase#1#2#3#4\@@#5{%
+ \ifx\@empty#3%
+ \uppercase{\def#5{#1#2}}%
+ \else
+ \uppercase{\def#5{#1}}%
+ \lowercase{\edef#5{#5#2#3#4}}%
+ \fi}
+\def\bbl@bcplookup#1-#2-#3-#4\@@{%
+ \let\bbl@bcp\relax
+ \lowercase{\def\bbl@tempa{#1}}%
+ \ifx\@empty#2%
+ \IfFileExists{babel-\bbl@tempa.ini}{\let\bbl@bcp\bbl@tempa}{}%
+ \else\ifx\@empty#3%
+ \bbl@bcpcase#2\@empty\@empty\@@\bbl@tempb
+ \IfFileExists{babel-\bbl@tempa-\bbl@tempb.ini}%
+ {\edef\bbl@bcp{\bbl@tempa-\bbl@tempb}}%
+ {}%
+ \ifx\bbl@bcp\relax
+ \IfFileExists{babel-\bbl@tempa.ini}{\let\bbl@bcp\bbl@tempa}{}%
+ \fi
+ \else
+ \bbl@bcpcase#2\@empty\@empty\@@\bbl@tempb
+ \bbl@bcpcase#3\@empty\@empty\@@\bbl@tempc
+ \IfFileExists{babel-\bbl@tempa-\bbl@tempb-\bbl@tempc.ini}%
+ {\edef\bbl@bcp{\bbl@tempa-\bbl@tempb-\bbl@tempc}}%
+ {}%
+ \ifx\bbl@bcp\relax
+ \IfFileExists{babel-\bbl@tempa-\bbl@tempc.ini}%
+ {\edef\bbl@bcp{\bbl@tempa-\bbl@tempc}}%
+ {}%
+ \fi
+ \ifx\bbl@bcp\relax
+ \IfFileExists{babel-\bbl@tempa-\bbl@tempc.ini}%
+ {\edef\bbl@bcp{\bbl@tempa-\bbl@tempc}}%
+ {}%
+ \fi
+ \ifx\bbl@bcp\relax
+ \IfFileExists{babel-\bbl@tempa.ini}{\let\bbl@bcp\bbl@tempa}{}%
+ \fi
+ \fi\fi}
+\let\bbl@autoload@options\@empty
+\let\bbl@initoload\relax
+\def\bbl@provide@locale{%
+ \ifx\babelprovide\@undefined
+ \bbl@error{For a language to be defined on the fly 'base'\\%
+ is not enough, and the whole package must be\\%
+ loaded. Either delete the 'base' option or\\%
+ request the languages explicitly}%
+ {See the manual for further details.}%
+ \fi
+% TODO. Option to search if loaded, with \LocaleForEach
+ \let\bbl@auxname\languagename % Still necessary. TODO
+ \bbl@ifunset{bbl@bcp@map@\languagename}{}% Move uplevel??
+ {\edef\languagename{\@nameuse{bbl@bcp@map@\languagename}}}%
+ \ifbbl@bcpallowed
+ \expandafter\ifx\csname date\languagename\endcsname\relax
+ \expandafter
+ \bbl@bcplookup\languagename-\@empty-\@empty-\@empty\@@
+ \ifx\bbl@bcp\relax\else % Returned by \bbl@bcplookup
+ \edef\languagename{\bbl@bcp@prefix\bbl@bcp}%
+ \edef\localename{\bbl@bcp@prefix\bbl@bcp}%
+ \expandafter\ifx\csname date\languagename\endcsname\relax
+ \let\bbl@initoload\bbl@bcp
+ \bbl@exp{\\\babelprovide[\bbl@autoload@bcpoptions]{\languagename}}%
+ \let\bbl@initoload\relax
+ \fi
+ \bbl@csarg\xdef{bcp@map@\bbl@bcp}{\localename}%
+ \fi
+ \fi
+ \fi
+ \expandafter\ifx\csname date\languagename\endcsname\relax
+ \IfFileExists{babel-\languagename.tex}%
+ {\bbl@exp{\\\babelprovide[\bbl@autoload@options]{\languagename}}}%
+ {}%
+ \fi}
+% \end{macrocode}
+%
+% \begin{macro}{\iflanguage}
+% Users might want to test (in a private package for instance)
+% which language is currently active. For this we provide a test
+% macro, |\iflanguage|, that has three arguments. It checks
+% whether the first argument is a known language. If so, it
+% compares the first argument with the value of |\language|. Then,
+% depending on the result of the comparison, it executes either the
+% second or the third argument.
+%
+% \begin{macrocode}
+\def\iflanguage#1{%
+ \bbl@iflanguage{#1}{%
+ \ifnum\csname l@#1\endcsname=\language
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsection{Selecting the language}
+%
+% \begin{macro}{\selectlanguage}
+%
+% The macro |\selectlanguage| checks whether the language is
+% already defined before it performs its actual task, which is to
+% update |\language| and activate language-specific definitions.
+%
+% \begin{macrocode}
+\let\bbl@select@type\z@
+\edef\selectlanguage{%
+ \noexpand\protect
+ \expandafter\noexpand\csname selectlanguage \endcsname}
+% \end{macrocode}
+%
+% Because the command |\selectlanguage| could be used in a moving
+% argument it expands to \verb*=\protect\selectlanguage =.
+% Therefore, we have to make sure that a macro |\protect| exists.
+% If it doesn't it is |\let| to |\relax|.
+%
+% \begin{macrocode}
+\ifx\@undefined\protect\let\protect\relax\fi
+% \end{macrocode}
+%
+% The following definition is preserved for backwards compatibility. It
+% is related to a trick for 2.09.
+%
+% \begin{macrocode}
+\let\xstring\string
+% \end{macrocode}
+%
+% \end{macro}
+%
+% Since version 3.5 \babel\ writes entries to the auxiliary files in
+% order to typeset table of contents etc. in the correct language
+% environment.
+%
+% \begin{macro}{\bbl@pop@language}
+%
+% \emph{But} when the language change happens \emph{inside} a group
+% the end of the group doesn't write anything to the auxiliary
+% files. Therefore we need \TeX's |aftergroup| mechanism to help
+% us. The command |\aftergroup| stores the token immediately
+% following it to be executed when the current group is closed. So
+% we define a temporary control sequence |\bbl@pop@language| to be
+% executed at the end of the group. It calls |\bbl@set@language|
+% with the name of the current language as its argument.
+%
+% \begin{macro}{\bbl@language@stack}
+% The previous solution works for one level of nesting groups, but
+% as soon as more levels are used it is no longer adequate. For
+% that case we need to keep track of the nested languages using a
+% stack mechanism. This stack is called |\bbl@language@stack| and
+% initially empty.
+%
+% \begin{macrocode}
+\def\bbl@language@stack{}
+% \end{macrocode}
+%
+% When using a stack we need a mechanism to push an element on the
+% stack and to retrieve the information afterwards.
+%
+% \begin{macro}{\bbl@push@language}
+% \begin{macro}{\bbl@pop@language}
+% The stack is simply a list of languagenames, separated with a `+'
+% sign; the push function can be simple:
+%
+% \begin{macrocode}
+\def\bbl@push@language{%
+ \ifx\languagename\@undefined\else
+ \xdef\bbl@language@stack{\languagename+\bbl@language@stack}%
+ \fi}
+% \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.
+% \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
+% (delimited by `-') in its third argument.
+%
+% \begin{macrocode}
+\def\bbl@pop@lang#1+#2&#3{%
+ \edef\languagename{#1}\xdef#3{#2}}
+% \end{macrocode}
+%
+% \end{macro}
+% The reason for the somewhat weird arrangement of arguments to the
+% helper function is the fact it is called in the following way.
+% This means that before |\bbl@pop@lang| is executed \TeX\ first
+% \emph{expands} the stack, stored in |\bbl@language@stack|. The
+% result of that is that the argument string of |\bbl@pop@lang|
+% contains one or more language names, each followed by a `+'-sign
+% (zero language names won't occur as this macro will only be
+% called after something has been pushed on the stack) followed by
+% the `\&'-sign and finally the reference to the stack.
+%
+% \begin{macrocode}
+\let\bbl@ifrestoring\@secondoftwo
+\def\bbl@pop@language{%
+ \expandafter\bbl@pop@lang\bbl@language@stack&\bbl@language@stack
+ \let\bbl@ifrestoring\@firstoftwo
+ \expandafter\bbl@set@language\expandafter{\languagename}%
+ \let\bbl@ifrestoring\@secondoftwo}
+% \end{macrocode}
+%
+% Once the name of the previous language is retrieved from the stack,
+% it is fed to |\bbl@set@language| to do the actual work of
+% switching everything that needs switching.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% An alternative way to identify languages (in the \babel{} sense)
+% with a numerical value is introduced in 3.30. This is one of the
+% first steps for a new interface based on the concept of locale,
+% which explains the name of |\localeid|. This means |\l@...| will be
+% reserved for hyphenation patterns (so that two locales can share the
+% same rules).
+%
+% \begin{macrocode}
+\chardef\localeid\z@
+\def\bbl@id@last{0} % No real need for a new counter
+\def\bbl@id@assign{%
+ \bbl@ifunset{bbl@id@@\languagename}%
+ {\count@\bbl@id@last\relax
+ \advance\count@\@ne
+ \bbl@csarg\chardef{id@@\languagename}\count@
+ \edef\bbl@id@last{\the\count@}%
+ \ifcase\bbl@engine\or
+ \directlua{
+ Babel = Babel or {}
+ Babel.locale_props = Babel.locale_props or {}
+ Babel.locale_props[\bbl@id@last] = {}
+ Babel.locale_props[\bbl@id@last].name = '\languagename'
+ }%
+ \fi}%
+ {}%
+ \chardef\localeid\bbl@cl{id@}}
+% \end{macrocode}
+%
+% The unprotected part of |\selectlanguage|.
+%
+% \begin{macrocode}
+\expandafter\def\csname selectlanguage \endcsname#1{%
+ \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\tw@\fi
+ \bbl@push@language
+ \aftergroup\bbl@pop@language
+ \bbl@set@language{#1}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bbl@set@language}
+%
+% The macro |\bbl@set@language| takes care of switching the language
+% environment \emph{and} of writing entries on the auxiliary files.
+% For historial reasons, language names can be either |language| of
+% |\language|. To catch either form a trick is used, but
+% unfortunately as a side effect the catcodes of letters in
+% |\languagename| are messed up. This is a bug, but preserved for
+% backwards compatibility. The list of auxiliary files can be
+% extended by redefining |\BabelContentsFiles|, but make sure they
+% are loaded inside a group (as |aux|, |toc|, |lof|, and |lot| do)
+% or the last language of the document will remain active
+% afterwards.
+%
+% We also write a command to change the current language in the
+% auxiliary files.
+%
+% \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}%
+% I'll\\%
+% try to fix '\string\localename', but I cannot promise\\%
+% anything. 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
+ \select@language{\languagename}%
+ % write to auxs
+ \expandafter\ifx\csname date\languagename\endcsname\relax\else
+ \if@filesw
+ \ifx\babel@aux\@gobbletwo\else % Set if single in the first, redundant
+ \protected@write\@auxout{}{\string\babel@aux{\bbl@auxname}{}}%
+ \fi
+ \bbl@usehooks{write}{}%
+ \fi
+ \fi}
+%
+\newif\ifbbl@bcpallowed
+\bbl@bcpallowedfalse
+\def\select@language#1{% from set@, babel@aux
+ % set hymap
+ \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
+ % set name
+ \edef\languagename{#1}%
+ \bbl@fixname\languagename
+ % TODO. name@map must be here?
+ \bbl@provide@locale
+ \bbl@iflanguage\languagename{%
+ \expandafter\ifx\csname date\languagename\endcsname\relax
+ \bbl@error
+ {Unknown language `\languagename'. Either you have\\%
+ misspelled its name, it has not been installed,\\%
+ or you requested it in a previous run. Fix its name,\\%
+ install it or just rerun the file, respectively. In\\%
+ some cases, you may need to remove the aux file}%
+ {You may proceed, but expect wrong results}%
+ \else
+ % set type
+ \let\bbl@select@type\z@
+ \expandafter\bbl@switch\expandafter{\languagename}%
+ \fi}}
+\def\babel@aux#1#2{%
+ \select@language{#1}%
+ \bbl@foreach\BabelContentsFiles{%
+ \@writefile{##1}{\babel@toc{#1}{#2}}}}% %% TODO - ok in plain?
+\def\babel@toc#1#2{%
+ \select@language{#1}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% First, check if the user asks for a known language. If so,
+% update the value of |\language| and call |\originalTeX|
+% to bring \TeX\ in a certain pre-defined state.
+%
+% The name of the language is stored in the control sequence
+% |\languagename|.
+%
+% Then we have to \emph{re}define |\originalTeX| to compensate for
+% the things that have been activated. To save memory space for
+% the macro definition of |\originalTeX|, we construct the control
+% sequence name for the |\noextras|\langvar\ command at definition
+% time by expanding the |\csname| primitive.
+%
+% Now activate the language-specific definitions. This is done by
+% constructing the names of three macros by concatenating three
+% words with the argument of |\selectlanguage|, and calling these
+% macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
+% temporarily |\set@hyphenmins| and hyphenation. It can be done in
+% hooks if necessary.}
+%
+% The switching of the values of |\lefthyphenmin| and
+% |\righthyphenmin| is somewhat different. First we save their
+% current values, then we check if |\|\langvar|hyphenmins| is
+% defined. If it is not, we set default values (2 and 3), otherwise
+% the values in |\|\langvar|hyphenmins| will be used.
+%
+% \begin{macrocode}
+\newif\ifbbl@usedategroup
+\def\bbl@switch#1{% from select@, foreign@
+ % make sure there is info for the language if so requested
+ \bbl@ensureinfo{#1}%
+ % restore
+ \originalTeX
+ \expandafter\def\expandafter\originalTeX\expandafter{%
+ \csname noextras#1\endcsname
+ \let\originalTeX\@empty
+ \babel@beginsave}%
+ \bbl@usehooks{afterreset}{}%
+ \languageshorthands{none}%
+ % set the locale id
+ \bbl@id@assign
+ % switch captions, date
+ \ifcase\bbl@select@type
+ \ifhmode
+ \hskip\z@skip % trick to ignore spaces
+ \csname captions#1\endcsname\relax
+ \csname date#1\endcsname\relax
+ \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
+ \else
+ \csname captions#1\endcsname\relax
+ \csname date#1\endcsname\relax
+ \fi
+ \else
+ \ifbbl@usedategroup % if \foreign... within \<lang>date
+ \bbl@usedategroupfalse
+ \ifhmode
+ \hskip\z@skip % trick to ignore spaces
+ \csname date#1\endcsname\relax
+ \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
+ \else
+ \csname date#1\endcsname\relax
+ \fi
+ \fi
+ \fi
+ % switch extras
+ \bbl@usehooks{beforeextras}{}%
+ \csname extras#1\endcsname\relax
+ \bbl@usehooks{afterextras}{}%
+ % > babel-ensure
+ % > babel-sh-<short>
+ % > babel-bidi
+ % > babel-fontspec
+ % hyphenation - case mapping
+ \ifcase\bbl@opt@hyphenmap\or
+ \def\BabelLower##1##2{\lccode##1=##2\relax}%
+ \ifnum\bbl@hymapsel>4\else
+ \csname\languagename @bbl@hyphenmap\endcsname
+ \fi
+ \chardef\bbl@opt@hyphenmap\z@
+ \else
+ \ifnum\bbl@hymapsel>\bbl@opt@hyphenmap\else
+ \csname\languagename @bbl@hyphenmap\endcsname
+ \fi
+ \fi
+ \global\let\bbl@hymapsel\@cclv
+ % hyphenation - patterns
+ \bbl@patterns{#1}%
+ % hyphenation - mins
+ \babel@savevariable\lefthyphenmin
+ \babel@savevariable\righthyphenmin
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \set@hyphenmins\tw@\thr@@\relax
+ \else
+ \expandafter\expandafter\expandafter\set@hyphenmins
+ \csname #1hyphenmins\endcsname\relax
+ \fi}
+% \end{macrocode}
+%
+% \begin{environment}{otherlanguage}
+% The \Lenv{otherlanguage} environment can be used as an
+% alternative to using the |\selectlanguage| declarative
+% command. When you are typesetting a document which mixes
+% left-to-right and right-to-left typesetting you have to use this
+% environment in order to let things work as you expect them to.
+%
+% The |\ignorespaces| command is necessary to hide the environment
+% when it is entered in horizontal mode.
+%
+% \begin{macrocode}
+\long\def\otherlanguage#1{%
+ \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\thr@@\fi
+ \csname selectlanguage \endcsname{#1}%
+ \ignorespaces}
+% \end{macrocode}
+%
+% The |\endotherlanguage| part of the environment tries to hide
+% itself when it is called in horizontal mode.
+%
% \begin{macrocode}
-\ifx\bbl@switchflag\@undefined % Prevent double input
- \let\bbl@switchflag\relax
- \input switch.def\relax
+\long\def\endotherlanguage{%
+ \global\@ignoretrue\ignorespaces}
+% \end{macrocode}
+%
+% \end{environment}
+%
+% \begin{environment}{otherlanguage*}
+% The \Lenv{otherlanguage} environment is meant to be used when a
+% large part of text from a different language needs to be typeset,
+% but without changing the translation of words such as `figure'.
+% This environment makes use of |\foreign@language|.
+%
+% \begin{macrocode}
+\expandafter\def\csname otherlanguage*\endcsname#1{%
+ \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
+ \foreign@language{#1}}
+% \end{macrocode}
+%
+% At the end of the environment we need to switch off the extra
+% definitions. The grouping mechanism of the environment will take
+% care of resetting the correct hyphenation rules and ``extras''.
+%
+% \begin{macrocode}
+\expandafter\let\csname endotherlanguage*\endcsname\relax
+% \end{macrocode}
+%
+% \end{environment}
+%
+% \begin{macro}{\foreignlanguage}
+%
+% The |\foreignlanguage| command is another substitute for the
+% |\selectlanguage| command. This command takes two arguments, the
+% first argument is the name of the language to use for typesetting
+% the text specified in the second argument.
+%
+% Unlike |\selectlanguage| this command doesn't switch
+% \emph{everything}, it only switches the hyphenation rules and the
+% extra definitions for the language specified. It does this within
+% a group and assumes the |\extras|\langvar\ command doesn't make
+% any |\global| changes. The coding is very similar to part of
+% |\selectlanguage|.
+%
+% |\bbl@beforeforeign| is a trick to fix a bug in bidi
+% texts. |\foreignlanguage| is supposed to be a `text' command, and
+% therefore it must emit a |\leavevmode|, but it does not, and
+% therefore the indent is placed on the opposite margin. For
+% backward compatibility, however, it is done only if a
+% right-to-left script is requested; otherwise, it is no-op.
+%
+% (3.11) |\foreignlanguage*| is a temporary, experimental macro for
+% a few lines with a different script direction, while preserving
+% the paragraph format (thank the braces around |\par|, things like
+% |\hangindent| are not reset). Do not use it in production,
+% because its semantics and its syntax may change (and very likely
+% will, or even it could be removed altogether). Currently it
+% enters in vmode and then selects the language (which in turn sets the
+% paragraph direction).
+%
+% (3.11) Also experimental are the hook |foreign| and |foreign*|.
+% With them you can redefine |\BabelText| which by default does
+% nothing. Its behavior is not well defined yet. So, use it in
+% horizontal mode only if you do not want surprises.
+%
+% In other words, at the beginning of a paragraph |\foreignlanguage|
+% enters into hmode with the surrounding lang, and with
+% |\foreignlanguage*| with the new lang.
+%
+% \begin{macrocode}
+\providecommand\bbl@beforeforeign{}
+\edef\foreignlanguage{%
+ \noexpand\protect
+ \expandafter\noexpand\csname foreignlanguage \endcsname}
+\expandafter\def\csname foreignlanguage \endcsname{%
+ \@ifstar\bbl@foreign@s\bbl@foreign@x}
+\def\bbl@foreign@x#1#2{%
+ \begingroup
+ \let\BabelText\@firstofone
+ \bbl@beforeforeign
+ \foreign@language{#1}%
+ \bbl@usehooks{foreign}{}%
+ \BabelText{#2}% Now in horizontal mode!
+ \endgroup}
+\def\bbl@foreign@s#1#2{% TODO - \shapemode, \@setpar, ?\@@par
+ \begingroup
+ {\par}%
+ \let\BabelText\@firstofone
+ \foreign@language{#1}%
+ \bbl@usehooks{foreign*}{}%
+ \bbl@dirparastext
+ \BabelText{#2}% Still in vertical mode!
+ {\par}%
+ \endgroup}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\foreign@language}
+%
+% This macro does the work for |\foreignlanguage| and the
+% \Lenv{otherlanguage*} environment. First we need to store the name
+% of the language and check that it is a known language. Then it
+% just calls |bbl@switch|.
+%
+% \begin{macrocode}
+\def\foreign@language#1{%
+ % set name
+ \edef\languagename{#1}%
+ \bbl@fixname\languagename
+ % TODO. name@map here?
+ \bbl@provide@locale
+ \bbl@iflanguage\languagename{%
+ \expandafter\ifx\csname date\languagename\endcsname\relax
+ \bbl@warning % TODO - why a warning, not an error?
+ {Unknown language `#1'. Either you have\\%
+ misspelled its name, it has not been installed,\\%
+ or you requested it in a previous run. Fix its name,\\%
+ install it or just rerun the file, respectively. In\\%
+ some cases, you may need to remove the aux file.\\%
+ I'll proceed, but expect wrong results.\\%
+ Reported}%
+ \fi
+ % set type
+ \let\bbl@select@type\@ne
+ \expandafter\bbl@switch\expandafter{\languagename}}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\bbl@patterns}
+%
+% This macro selects the hyphenation patterns by changing the
+% \cs{language} register. If special hyphenation patterns
+% are available specifically for the current font encoding,
+% use them instead of the default.
+%
+% It also sets hyphenation exceptions, but only once, because they
+% are global (here language |\lccode|'s has been set, too).
+% |\bbl@hyphenation@| is set to relax until the very first
+% |\babelhyphenation|, so do nothing with this value. If the
+% exceptions for a language (by its number, not its name, so that
+% |:ENC| is taken into account) has been set, then use
+% |\hyphenation| with both global and language exceptions and empty
+% the latter to mark they must not be set again.
+%
+% \begin{macrocode}
+\let\bbl@hyphlist\@empty
+\let\bbl@hyphenation@\relax
+\let\bbl@pttnlist\@empty
+\let\bbl@patterns@\relax
+\let\bbl@hymapsel=\@cclv
+\def\bbl@patterns#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
+ \@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}%
+ % > luatex
+ \@ifundefined{bbl@hyphenation@}{}{% Can be \relax!
+ \begingroup
+ \bbl@xin@{,\number\language,}{,\bbl@hyphlist}%
+ \ifin@\else
+ \@expandtwoargs\bbl@usehooks{hyphenation}{{#1}{\bbl@tempa}}%
+ \hyphenation{%
+ \bbl@hyphenation@
+ \@ifundefined{bbl@hyphenation@#1}%
+ \@empty
+ {\space\csname bbl@hyphenation@#1\endcsname}}%
+ \xdef\bbl@hyphlist{\bbl@hyphlist\number\language,}%
+ \fi
+ \endgroup}}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{environment}{hyphenrules}
+%
+% The environment \Lenv{hyphenrules} can be used to select
+% \emph{just} the hyphenation rules. This environment does
+% \emph{not} change |\languagename| and when the hyphenation rules
+% specified were not loaded it has no effect. Note however,
+% |\lccode|'s and font encodings are not set at all, so in most
+% cases you should use |otherlanguage*|.
+%
+% \begin{macrocode}
+\def\hyphenrules#1{%
+ \edef\bbl@tempf{#1}%
+ \bbl@fixname\bbl@tempf
+ \bbl@iflanguage\bbl@tempf{%
+ \expandafter\bbl@patterns\expandafter{\bbl@tempf}%
+ \languageshorthands{none}%
+ \expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax
+ \set@hyphenmins\tw@\thr@@\relax
+ \else
+ \expandafter\expandafter\expandafter\set@hyphenmins
+ \csname\bbl@tempf hyphenmins\endcsname\relax
+ \fi}}
+\let\endhyphenrules\@empty
+% \end{macrocode}
+%
+% \end{environment}
+%
+% \begin{macro}{\providehyphenmins}
+% The macro |\providehyphenmins| should be used in the language
+% definition files to provide a \emph{default} setting for the
+% hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
+% the macro |\|\langvar|hyphenmins| is already defined this command
+% has no effect.
+%
+% \begin{macrocode}
+\def\providehyphenmins#1#2{%
+ \expandafter\ifx\csname #1hyphenmins\endcsname\relax
+ \@namedef{#1hyphenmins}{#2}%
+ \fi}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\set@hyphenmins}
+% This macro sets the values of |\lefthyphenmin| and
+% |\righthyphenmin|. It expects two values as its argument.
+%
+% \begin{macrocode}
+\def\set@hyphenmins#1#2{%
+ \lefthyphenmin#1\relax
+ \righthyphenmin#2\relax}
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\ProvidesLanguage}
+% The identification code for each file is something that was
+% introduced in \LaTeXe. When the command |\ProvidesFile| does not
+% exist, a dummy definition is provided temporarily. For use in the
+% language definition file the command |\ProvidesLanguage| is
+% defined by \babel.
+%
+% Depending on the format, ie, on if the former is defined, we use
+% a similar definition or not.
+%
+% \begin{macrocode}
+\ifx\ProvidesFile\@undefined
+ \def\ProvidesLanguage#1[#2 #3 #4]{%
+ \wlog{Language: #1 #4 #3 <#2>}%
+ }
+\else
+ \def\ProvidesLanguage#1{%
+ \begingroup
+ \catcode`\ 10 %
+ \@makeother\/%
+ \@ifnextchar[%]
+ {\@provideslanguage{#1}}{\@provideslanguage{#1}[]}}
+ \def\@provideslanguage#1[#2]{%
+ \wlog{Language: #1 #2}%
+ \expandafter\xdef\csname ver@#1.ldf\endcsname{#2}%
+ \endgroup}
\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \begin{macro}{\originalTeX}
+% The macro|\originalTeX| should be known to \TeX\ at this moment.
+% As it has to be expandable we |\let| it to |\@empty| instead of
+% |\relax|.
+%
+% \begin{macrocode}
+\ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
+% \end{macrocode}
+%
+% Because this part of the code can be included in a format, we
+% make sure that the macro which initializes the save mechanism,
+% |\babel@beginsave|, is not considered to be undefined.
+%
+% \begin{macrocode}
+\ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi
+% \end{macrocode}
+%
+% \end{macro}
+%
+% A few macro names are reserved for future releases of \babel, which
+% will use the concept of `locale':
+%
+% \begin{macrocode}
+\providecommand\setlocale{%
+ \bbl@error
+ {Not yet available}%
+ {Find an armchair, sit down and wait}}
+\let\uselocale\setlocale
+\let\locale\setlocale
+\let\selectlocale\setlocale
+\let\localename\setlocale
+\let\textlocale\setlocale
+\let\textlanguage\setlocale
+\let\languagetext\setlocale
+% \end{macrocode}
+%
+% \subsection{Errors}
+%
+% \begin{macro}{\@nolanerr}
+% \begin{macro}{\@nopatterns}
+%
+% The \babel\ package will signal an error when a documents tries
+% to select a language that hasn't been defined earlier. When a
+% user selects a language for which no hyphenation patterns were
+% loaded into the format he will be given a warning about that
+% fact. We revert to the patterns for |\language|=0 in that case.
+% In most formats that will be (US)english, but it might also be
+% empty.
+%
+% \begin{macro}{\@noopterr}
+% When the package was loaded without options not everything will
+% work as expected. An error message is issued in that case.
+%
+% When the format knows about |\PackageError| it must be \LaTeXe,
+% so we can safely use its error handling interface. Otherwise
+% we'll have to `keep it simple'.
+%
+% Infos are not written to the console, but on the other hand many
+% people think warnings are errors, so a further message type is
+% defined: an important info which is sent to the console.
+%
+% \begin{macrocode}
+\edef\bbl@nulllanguage{\string\language=0}
+\ifx\PackageError\@undefined % TODO. Move to Plain
+ \def\bbl@error#1#2{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J(babel) }%
+ \errhelp{#2}\errmessage{\\#1}%
+ \endgroup}
+ \def\bbl@warning#1{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J(babel) }%
+ \message{\\#1}%
+ \endgroup}
+ \let\bbl@infowarn\bbl@warning
+ \def\bbl@info#1{%
+ \begingroup
+ \newlinechar=`\^^J
+ \def\\{^^J}%
+ \wlog{#1}%
+ \endgroup}
+\fi
+\def\bbl@nocaption{\protect\bbl@nocaption@i}
+\def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname
+ \global\@namedef{#2}{\textbf{?#1?}}%
+ \@nameuse{#2}%
+ \bbl@warning{%
+ \@backslashchar#2 not set. Please, define\\%
+ it in the preamble with something like:\\%
+ \string\renewcommand\@backslashchar#2{..}\\%
+ Reported}}
+\def\bbl@tentative{\protect\bbl@tentative@i}
+\def\bbl@tentative@i#1{%
+ \bbl@warning{%
+ Some functions for '#1' are tentative.\\%
+ They might not work as expected and their behavior\\%
+ could change in the future.\\%
+ Reported}}
+\def\@nolanerr#1{%
+ \bbl@error
+ {You haven't defined the language #1\space yet.\\%
+ Perhaps you misspelled it or your installation\\%
+ is not complete}%
+ {Your command will be ignored, type <return> to proceed}}
+\def\@nopatterns#1{%
+ \bbl@warning
+ {No hyphenation patterns were preloaded for\\%
+ the language `#1' into the format.\\%
+ Please, configure your TeX system to add them and\\%
+ rebuild the format. Now I will use the patterns\\%
+ preloaded for \bbl@nulllanguage\space instead}}
+\let\bbl@usehooks\@gobbletwo
+\ifx\bbl@onlyswitch\@empty\endinput\fi
+ % Here ended switch.def
+% \end{macrocode}
+%
+% Here ended |switch.def|.
+%
+% \begin{macrocode}
+\ifx\directlua\@undefined\else
+ \ifx\bbl@luapatterns\@undefined
+ \input luababel.def
+ \fi
+\fi
+<@Basic macros@>
\bbl@trace{Compatibility with language.def}
\ifx\bbl@languages\@undefined
\ifx\directlua\@undefined
- \openin1 = language.def
+ \openin1 = language.def % TODO. Remove hardcoded number
\ifeof1
\closein1
\message{I couldn't find the file language.def}
@@ -5509,26 +7484,17 @@ help from Bernd Raichle, for which I am grateful.
\fi
\chardef\l@english\z@
\fi
-<@Load patterns in luatex@>
-<@Basic macros@>
% \end{macrocode}
%
% \begin{macro}{\addto}
-% For each language four control sequences have to be defined that
-% control the language-specific definitions. To be able to add
-% something to these macro once they have been defined the macro
-% |\addto| is introduced. It takes two arguments, a \meta{control
-% sequence} and \TeX-code to be added to the \meta{control
-% sequence}.
-%
-% If the \meta{control sequence} has not been defined before it is
-% defined now. The control sequence could also expand to |\relax|,
-% in which case a circular definition results. The net result is a
-% stack overflow. Otherwise the replacement text for the
-% \meta{control sequence} is expanded and stored in a token
-% register, together with the \TeX-code to be added. Finally the
-% \meta{control sequence} is \emph{re}defined, using the contents
-% of the token register.
+% It takes two arguments, a \meta{control sequence} and \TeX-code to
+% be added to the \meta{control sequence}.
+%
+% If the \meta{control sequence} has not been defined before it is
+% defined now. The control sequence could also expand to |\relax|,
+% in which case a circular definition results. The net result is a
+% stack overflow. Note there is an inconsistency, because the
+% assignment in the last branch is global.
%
% \begin{macrocode}
\def\addto#1#2{%
@@ -5546,9 +7512,11 @@ help from Bernd Raichle, for which I am grateful.
%
% \end{macro}
%
-% The macro |\initiate@active@char| takes all the necessary actions
-% to make its argument a shorthand character. The real work is
-% performed once for each character.
+% The macro |\initiate@active@char| below takes all the necessary
+% actions to make its argument a shorthand character. The real work
+% is performed once for each character. But first we define a little
+% tool. TODO. Always used with additional expansions. Move them here?
+% Move the macro to basic?
%
% \begin{macrocode}
\def\bbl@withactive#1#2{%
@@ -5558,26 +7526,19 @@ help from Bernd Raichle, for which I am grateful.
% \end{macrocode}
%
% \begin{macro}{\bbl@redefine}
-% To redefine a command, we save the old meaning of the macro.
-% Then we redefine it to call the original macro with the
-% `sanitized' argument. The reason why we do it this way is that
-% we don't want to redefine the \LaTeX\ macros completely in case
-% their definitions change (they have changed in the past).
%
-% Because we need to redefine a number of commands we define the
-% command |\bbl@redefine| which takes care of this. It creates a
-% new control sequence, |\org@...|
+% To redefine a command, we save the old meaning of the macro. Then
+% we redefine it to call the original macro with the `sanitized'
+% argument. The reason why we do it this way is that we don't want
+% to redefine the \LaTeX\ macros completely in case their
+% definitions change (they have changed in the past). A macro named
+% |\macro| will be saved new control sequences named |\org@macro|.
%
% \begin{macrocode}
\def\bbl@redefine#1{%
\edef\bbl@tempa{\bbl@stripslash#1}%
\expandafter\let\csname org@\bbl@tempa\endcsname#1%
\expandafter\def\csname\bbl@tempa\endcsname}
-% \end{macrocode}
-%
-% This command should only be used in the preamble of the document.
-%
-% \begin{macrocode}
\@onlypreamble\bbl@redefine
% \end{macrocode}
%
@@ -5597,13 +7558,13 @@ help from Bernd Raichle, for which I am grateful.
%
% \end{macro}
%
-% \begin{macro}{\bbl@redefinerobust}
-% For commands that are redefined, but which \textit{might} be
-% robust we need a slightly more intelligent macro. A robust
-% command |foo| is defined to expand to |\protect|\verb*|\foo |. So
-% it is necessary to check whether \verb*|\foo | exists. The result
-% is that the command that is being redefined is always robust
-% afterwards. Therefore all we need to do now is define \verb*|\foo |.
+% \begin{macro}{\bbl@redefinerobust}
+% For commands that are redefined, but which \textit{might} be
+% robust we need a slightly more intelligent macro. A robust
+% command |foo| is defined to expand to |\protect|\verb*|\foo |. So
+% it is necessary to check whether \verb*|\foo | exists. The result
+% is that the command that is being redefined is always robust
+% afterwards. Therefore all we need to do now is define \verb*|\foo |.
%
% \begin{macrocode}
\def\bbl@redefinerobust#1{%
@@ -5613,11 +7574,6 @@ help from Bernd Raichle, for which I am grateful.
\bbl@exp{\def\\#1{\\\protect\<\bbl@tempa\space>}}}%
{\bbl@exp{\let\<org@\bbl@tempa>\<\bbl@tempa\space>}}%
\@namedef{\bbl@tempa\space}}
-% \end{macrocode}
-%
-% This command should only be used in the preamble of the document.
-%
-% \begin{macrocode}
\@onlypreamble\bbl@redefinerobust
% \end{macrocode}
%
@@ -5625,12 +7581,10 @@ help from Bernd Raichle, for which I am grateful.
%
% \subsection{Hooks}
%
-% Note they are loaded in babel.def. switch.def only provides a
-% ``hook'' for hooks (with a default value which is a no-op,
-% below). Admittedly, the current implementation is a somewhat
-% simplistic and does vety little to catch errors, but it is intended
-% for developpers, after all. |\bbl@usehooks| is the commands used by
-% babel to execute hooks defined for an event.
+% Admittedly, the current implementation is a somewhat simplistic and
+% does very little to catch errors, but it is meant for developers,
+% after all. |\bbl@usehooks| is the commands used by \babel{} to execute
+% hooks defined for an event.
%
% \begin{macrocode}
\bbl@trace{Hooks}
@@ -5655,11 +7609,11 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% To ensure forward compatibility, arguments in hooks are set
-% implicitly. So, if a further argument is added in the future,
-% there is no need to change the existing code. Note events
-% intended for \textsf{hyphen.cfg} are also loaded (just in
-% case you need them for some reason).
+% To ensure forward compatibility, arguments in hooks are set
+% implicitly. So, if a further argument is added in the future,
+% there is no need to change the existing code. Note events
+% intended for \textsf{hyphen.cfg} are also loaded (just in
+% case you need them for some reason).
%
% \begin{macrocode}
\def\bbl@evargs{,% <- don't delete this comma
@@ -5667,7 +7621,7 @@ help from Bernd Raichle, for which I am grateful.
adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0,%
- beforestart=0,languagename=0}
+ beforestart=0,languagename=2}
% \end{macrocode}
%
% \begin{macro}{\babelensure}
@@ -5716,7 +7670,7 @@ help from Bernd Raichle, for which I am grateful.
\def\<bbl@e@#2>{\the\toks@{\bbl@ens@fontenc}}}}
\def\bbl@ensure#1#2#3{% 1: include 2: exclude 3: fontenc
\def\bbl@tempb##1{% elt for (excluding) \bbl@captionslist list
- \ifx##1\@undefined % 3.32 - Don't assume the macros exists
+ \ifx##1\@undefined % 3.32 - Don't assume the macro exists
\edef##1{\noexpand\bbl@nocaption
{\bbl@stripslash##1}{\languagename\bbl@stripslash##1}}%
\fi
@@ -5761,42 +7715,43 @@ help from Bernd Raichle, for which I am grateful.
% \subsection{Setting up language files}
%
% \begin{macro}{\LdfInit}
-% The second version of |\LdfInit| macro takes two arguments. The first
-% argument is the name of the language that will be defined in the
-% language definition file; the second argument is either a control
-% sequence or a string from which a control sequence should be
-% constructed. The existence of the control sequence indicates that
-% the file has been processed before.
%
-% At the start of processing a language definition file we always
-% check the category code of the at-sign. We make sure that it is
-% a `letter' during the processing of the file. We also save its
-% name as the last called option, even if not loaded.
+% |\LdfInit| macro takes two arguments. The first
+% argument is the name of the language that will be defined in the
+% language definition file; the second argument is either a control
+% sequence or a string from which a control sequence should be
+% constructed. The existence of the control sequence indicates that
+% the file has been processed before.
+%
+% At the start of processing a language definition file we always
+% check the category code of the at-sign. We make sure that it is
+% a `letter' during the processing of the file. We also save its
+% name as the last called option, even if not loaded.
%
-% Another character that needs to have the correct category code
-% during processing of language definition files is the equals sign,
-% `=', because it is sometimes used in constructions with the
-% |\let| primitive. Therefore we store its current catcode and
-% restore it later on.
+% Another character that needs to have the correct category code
+% during processing of language definition files is the equals sign,
+% `=', because it is sometimes used in constructions with the
+% |\let| primitive. Therefore we store its current catcode and
+% restore it later on.
%
-% Now we check whether we should perhaps stop the processing of
-% this file. To do this we first need to check whether the second
-% argument that is passed to |\LdfInit| is a control sequence. We
-% do that by looking at the first token after passing |#2| through
-% |string|. When it is equal to |\@backslashchar| we are dealing
-% with a control sequence which we can compare with |\@undefined|.
+% Now we check whether we should perhaps stop the processing of
+% this file. To do this we first need to check whether the second
+% argument that is passed to |\LdfInit| is a control sequence. We
+% do that by looking at the first token after passing |#2| through
+% |string|. When it is equal to |\@backslashchar| we are dealing
+% with a control sequence which we can compare with |\@undefined|.
%
-% If so, we call |\ldf@quit| to set the main language, restore the
-% category code of the @-sign and call |\endinput|
+% If so, we call |\ldf@quit| to set the main language, restore the
+% category code of the @-sign and call |\endinput|
%
-% When |#2| was \emph{not} a control sequence we construct one and
-% compare it with |\relax|.
+% When |#2| was \emph{not} a control sequence we construct one and
+% compare it with |\relax|.
%
-% Finally we check |\originalTeX|.
+% Finally we check |\originalTeX|.
%
% \begin{macrocode}
\bbl@trace{Macros for setting language files up}
-\def\bbl@ldfinit{%
+\def\bbl@ldfinit{% TODO. Merge into the next macro? Unused elsewhere
\let\bbl@screset\@empty
\let\BabelStrings\bbl@opt@string
\let\BabelOptions\@empty
@@ -5849,13 +7804,15 @@ help from Bernd Raichle, for which I am grateful.
% category code of the @-sign.
%
% \begin{macrocode}
-\def\bbl@afterldf#1{%
+\def\bbl@afterldf#1{% TODO. Merge into the next macro? Unused elsewhere
\bbl@afterlang
\let\bbl@afterlang\relax
\let\BabelModifiers\relax
\let\bbl@screset\relax}%
\def\ldf@finish#1{%
- \loadlocalcfg{#1}%
+ \ifx\loadlocalcfg\@undefined\else % For LaTeX 209
+ \loadlocalcfg{#1}%
+ \fi
\bbl@afterldf{#1}%
\expandafter\main@language\expandafter{#1}%
\catcode`\@=\atcatcode \let\atcatcode\relax
@@ -5884,31 +7841,33 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\def\main@language#1{%
\def\bbl@main@language{#1}%
- \let\languagename\bbl@main@language
+ \let\languagename\bbl@main@language % TODO. Set localename
\bbl@id@assign
\bbl@patterns{\languagename}}
% \end{macrocode}
%
-% We also have to make sure that some code gets executed at the
-% beginning of the document. Languages do not set |\pagedir|, so
-% we set here for the whole document to the main |\bodydir|.
+% We also have to make sure that some code gets executed at the
+% 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|.
%
% \begin{macrocode}
\def\bbl@beforestart{%
\bbl@usehooks{beforestart}{}%
\global\let\bbl@beforestart\relax}
\AtBeginDocument{%
- \bbl@cs{beforestart}%
+ \@nameuse{bbl@beforestart}%
\if@filesw
- \immediate\write\@mainaux{\string\bbl@cs{beforestart}}%
+ \immediate\write\@mainaux{\string\@nameuse{bbl@beforestart}}%
\fi
\expandafter\selectlanguage\expandafter{\bbl@main@language}%
- \ifbbl@single % must go after the line above
+ \ifbbl@single % must go after the line above.
\renewcommand\selectlanguage[1]{}%
\renewcommand\foreignlanguage[2]{#2}%
\global\let\babel@aux\@gobbletwo % Also as flag
\fi
- \ifcase\bbl@engine\or\pagedir\bodydir\fi} % TODO - a better place
+ \ifcase\bbl@engine\or\pagedir\bodydir\fi} % TODO - a better place
% \end{macrocode}
%
% \end{macro}
@@ -6269,7 +8228,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\begingroup
-\bbl@ifunset{ifincsname}%
+\bbl@ifunset{ifincsname}% TODO. Ugly. Correct?
{\gdef\active@prefix#1{%
\ifx\protect\@typeset@protect
\else
@@ -6332,8 +8291,7 @@ help from Bernd Raichle, for which I am grateful.
% Both macros take one argument, like |\initiate@active@char|. The
% macro is used to change the definition of an active character to
% expand to |\active@char|\m{char} in the case of |\bbl@activate|,
-% or |\normal@char|\m{char} in the case of
-% |\bbl@deactivate|.
+% or |\normal@char|\m{char} in the case of |\bbl@deactivate|.
%
% \begin{macrocode}
\def\bbl@activate#1{%
@@ -6349,8 +8307,8 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\bbl@firstcs}
% \begin{macro}{\bbl@scndcs}
-% These macros have two arguments. They use one of their arguments
-% to build a control sequence from.
+%
+% These macros are used only as a trick when declaring shorthands.
%
% \begin{macrocode}
\def\bbl@firstcs#1#2{\csname#1\endcsname}
@@ -6429,7 +8387,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\def\user@group{user}
-\def\language@group{english}
+\def\language@group{english} % TODO. I don't like defaults
\def\system@group{system}
% \end{macrocode}
%
@@ -6438,11 +8396,9 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
%
% \begin{macro}{\useshorthands}
-% This is the user level command to tell \LaTeX\ that user level
-% shorthands will be used in the document. It takes one argument,
-% the character that starts a shorthand. First note that this is
-% user level, and then initialize and activate the character for
-% use as a shorthand character (ie, it's active in the
+%
+% This is the user level macro. It initializes and activates the
+% character for use as a shorthand character (ie, it's active in the
% preamble). Languages can deactivate shorthands, so a starred
% version is also provided which activates them always after the
% language has been switched.
@@ -6504,10 +8460,11 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
%
% \begin{macro}{\languageshorthands}
+%
% A user level command to change the language from which shorthands
% are used. Unfortunately, \babel{} currently does not keep track
% of defined groups, and therefore there is no way to catch a
-% possible change in casing.
+% possible change in casing [TODO. Unclear].
%
% \begin{macrocode}
\def\languageshorthands#1{\def\language@group{#1}}
@@ -6516,7 +8473,11 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
%
% \begin{macro}{\aliasshorthand}
-% First the new shorthand needs to be initialized,
+% First the new shorthand needs to be initialized. Then, we define
+% the new shorthand in terms of the original one, but note with
+% |\aliasshorthands{"}{/}| is |\active@prefix /\active@char/|, so we
+% still need to let the lattest to |\active@char"|.
+%
%
% \begin{macrocode}
\def\aliasshorthand#1#2{%
@@ -6526,14 +8487,6 @@ help from Bernd Raichle, for which I am grateful.
\@notshorthand{#2}%
\else
\initiate@active@char{#2}%
-% \end{macrocode}
-%
-% Then, we define the new shorthand in terms of the original
-% one, but note with |\aliasshorthands{"}{/}| is
-% |\active@prefix /\active@char/|, so we still need to let the
-% lattest to |\active@char"|.
-%
-% \begin{macrocode}
\expandafter\let\csname active@char\string#2\expandafter\endcsname
\csname active@char\string#1\endcsname
\expandafter\let\csname normal@char\string#2\expandafter\endcsname
@@ -6579,19 +8532,18 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macro}{\bbl@switch@sh}
%
% The macro |\bbl@switch@sh| takes the list of characters apart one
-% by one and subsequently switches the category code of the
+% by one and subsequently switches the category code of the
% shorthand character according to the first argument of
% |\bbl@switch@sh|.
%
-% But before any of this switching takes place we make sure that
-% the character we are dealing with is known as a shorthand
-% character. If it is, a macro such as |\active@char"| should
-% exist.
+% But before any of this switching takes place we make sure that the
+% character we are dealing with is known as a shorthand character.
+% If it is, a macro such as |\active@char"| should exist.
%
-% Switching off and on is easy -- we just set the category
-% code to `other' (12) and |\active|. With the starred version, the
-% original catcode and the original definition, saved
-% in |@initiate@active@char|, are restored.
+% Switching off and on is easy -- we just set the category code to
+% `other' (12) and |\active|. With the starred version, the original
+% catcode and the original definition, saved in
+% |@initiate@active@char|, are restored.
%
% \begin{macrocode}
\def\bbl@switch@sh#1#2{%
@@ -6617,7 +8569,7 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
% \end{macro}
%
-% Note the value is that at the expansion time, eg, in the preample
+% Note the value is that at the expansion time; eg, in the preample
% shorhands are usually deactivated.
%
% \begin{macrocode}
@@ -6780,11 +8732,6 @@ help from Bernd Raichle, for which I am grateful.
{\csname\bbl@tempc @attr@##1\endcsname}%
{\@attrerr{\bbl@tempc}{##1}}%
\fi}}}
-% \end{macrocode}
-%
-% This command should only be used in the preamble of a document.
-%
-% \begin{macrocode}
\@onlypreamble\languageattribute
% \end{macrocode}
%
@@ -6833,31 +8780,19 @@ help from Bernd Raichle, for which I am grateful.
% attribute being checked, and the third and fourth arguments are
% the true and false clauses.
%
-% \begin{macrocode}
-\def\bbl@ifattributeset#1#2#3#4{%
-% \end{macrocode}
-%
-% First we need to find out if any attributes were set; if not
-% we're done.
+% First we need to find out if any attributes were set; if not we're
+% done. Then we need to check the list of known attributes. When
+% we're this far |\ifin@| has a value indicating if the attribute in
+% question was set or not. Just to be safe the code to be executed
+% is `thrown over the |\fi|'.
%
% \begin{macrocode}
+\def\bbl@ifattributeset#1#2#3#4{%
\ifx\bbl@known@attribs\@undefined
\in@false
\else
-% \end{macrocode}
-%
-% The we need to check the list of known attributes.
-%
-% \begin{macrocode}
\bbl@xin@{,#1-#2,}{,\bbl@known@attribs,}%
\fi
-% \end{macrocode}
-%
-% When we're this far |\ifin@| has a value indicating if the
-% attribute in question was set or not. Just to be safe the code to
-% be executed is `thrown over the |\fi|'.
-%
-% \begin{macrocode}
\ifin@
\bbl@afterelse#3%
\else
@@ -6874,36 +8809,20 @@ help from Bernd Raichle, for which I am grateful.
% attribute list, the \TeX-code to be executed when the attribute
% is known and the \TeX-code to be executed otherwise.
%
-% \begin{macrocode}
-\def\bbl@ifknown@ttrib#1#2{%
-% \end{macrocode}
-%
-% We first assume the attribute is unknown.
+% We first assume the attribute is unknown. Then we loop over the
+% list of known attributes, trying to find a match. When a match is
+% found the definition of |\bbl@tempa| is changed. Finally we
+% execute |\bbl@tempa|.
%
% \begin{macrocode}
+\def\bbl@ifknown@ttrib#1#2{%
\let\bbl@tempa\@secondoftwo
-% \end{macrocode}
-%
-% Then we loop over the list of known attributes, trying to find a
-% match.
-%
-% \begin{macrocode}
\bbl@loopx\bbl@tempb{#2}{%
\expandafter\in@\expandafter{\expandafter,\bbl@tempb,}{,#1,}%
\ifin@
-% \end{macrocode}
-%
-% When a match is found the definition of |\bbl@tempa| is changed.
-%
-% \begin{macrocode}
\let\bbl@tempa\@firstoftwo
\else
\fi}%
-% \end{macrocode}
-%
-% Finally we execute |\bbl@tempa|.
-%
-% \begin{macrocode}
\bbl@tempa
}
% \end{macrocode}
@@ -6965,15 +8884,15 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macro}{\babel@save}
% \begin{macro}{\babel@savevariable}
%
-% The macro |\babel@save|\meta{csname} saves the current meaning of
-% the control sequence \meta{csname} to
-% |\originalTeX|\footnote{\cs{originalTeX} has to be expandable,
-% i.\,e.\ you shouldn't let it to \cs{relax}.}. To do this, we let
-% the current meaning to a temporary control sequence, the restore
-% commands are appended to |\originalTeX| and the counter is
-% incremented. The macro |\babel@savevariable|\meta{variable} saves
-% the value of the variable. \meta{variable} can be anything allowed
-% after the |\the| primitive.
+% The macro |\babel@save|\meta{csname} saves the current meaning of the
+% control sequence \meta{csname} to
+% |\originalTeX|\footnote{\cs{originalTeX} has to be expandable,
+% i.\,e.\ you shouldn't let it to \cs{relax}.}. To do this, we let the
+% current meaning to a temporary control sequence, the restore commands
+% are appended to |\originalTeX| and the counter is incremented. The
+% macro |\babel@savevariable|\meta{variable} saves the value of the
+% variable. \meta{variable} can be anything allowed after the |\the|
+% primitive.
%
% \begin{macrocode}
\def\babel@save#1{%
@@ -6992,10 +8911,10 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\bbl@frenchspacing}
% \begin{macro}{\bbl@nonfrenchspacing}
-% Some languages need to have |\frenchspacing| in effect. Others
-% don't want that. The command |\bbl@frenchspacing| switches it on
-% when it isn't already in effect and |\bbl@nonfrenchspacing|
-% switches it off if necessary.
+% Some languages need to have |\frenchspacing| in effect. Others
+% don't want that. The command |\bbl@frenchspacing| switches it on
+% when it isn't already in effect and |\bbl@nonfrenchspacing|
+% switches it off if necessary.
%
% \begin{macrocode}
\def\bbl@frenchspacing{%
@@ -7043,11 +8962,11 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\babelhyphenation}
%
-% This macro saves hyphenation exceptions. Two macros are used to
-% store them: |\bbl@hyphenation@| for the global ones and
-% |\bbl@hyphenation<lang>| for language ones. See |\bbl@patterns|
-% above for further details. We make sure there is a space between
-% words when multiple commands are used.
+% This macro saves hyphenation exceptions. Two macros are used to
+% store them: |\bbl@hyphenation@| for the global ones and
+% |\bbl@hyphenation<lang>| for language ones. See |\bbl@patterns|
+% above for further details. We make sure there is a space between
+% words when multiple commands are used.
%
% \begin{macrocode}
\bbl@trace{Hyphens}
@@ -7082,10 +9001,10 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\bbl@allowhyphens}
%
-% This macro makes hyphenation possible. Basically its definition
-% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
-% 0pt}\footnote{\TeX\ begins and ends a word for hyphenation at a
-% glue node. The penalty prevents a linebreak at this glue node.}.
+% This macro makes hyphenation possible. Basically its definition
+% is nothing more than |\nobreak| |\hskip| \texttt{0pt plus
+% 0pt}\footnote{\TeX\ begins and ends a word for hyphenation at a
+% glue node. The penalty prevents a linebreak at this glue node.}.
%
% \begin{macrocode}
\def\bbl@allowhyphens{\ifvmode\else\nobreak\hskip\z@skip\fi}
@@ -7097,10 +9016,10 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\babelhyphen}
%
-% Macros to insert common hyphens. Note the space before |@| in
-% |\babelhyphen|. Instead of protecting it with
-% |\DeclareRobustCommand|, which could insert a |\relax|, we use
-% the same procedure as shorthands, with |\active@prefix|.
+% Macros to insert common hyphens. Note the space before |@| in
+% |\babelhyphen|. Instead of protecting it with
+% |\DeclareRobustCommand|, which could insert a |\relax|, we use
+% the same procedure as shorthands, with |\active@prefix|.
%
% \begin{macrocode}
\newcommand\babelnullhyphen{\char\hyphenchar\font}
@@ -7113,18 +9032,18 @@ help from Bernd Raichle, for which I am grateful.
{\csname bbl@hy@#1#2\@empty\endcsname}}
% \end{macrocode}
%
-% The following two commands are used to wrap the ``hyphen'' and
-% set the behavior of the rest of the word -- the version with a
-% single |@| is used when further hyphenation is allowed, while
-% that with |@@| if no more hyphens are allowed. In both cases, if
-% the hyphen is preceded by a positive space, breaking after the
-% hyphen is disallowed.
+% The following two commands are used to wrap the ``hyphen'' and
+% set the behavior of the rest of the word -- the version with a
+% single |@| is used when further hyphenation is allowed, while
+% that with |@@| if no more hyphens are allowed. In both cases, if
+% the hyphen is preceded by a positive space, breaking after the
+% hyphen is disallowed.
%
-% There should not be a discretionary after a hyphen at the
-% beginning of a word, so it is prevented if preceded by a
-% skip. Unfortunately, this does handle cases like ``(-suffix)''.
-% |\nobreak| is always preceded by |\leavevmode|, in case the
-% shorthand starts a paragraph.
+% There should not be a discretionary after a hyphen at the
+% beginning of a word, so it is prevented if preceded by a
+% skip. Unfortunately, this does handle cases like ``(-suffix)''.
+% |\nobreak| is always preceded by |\leavevmode|, in case the
+% shorthand starts a paragraph.
%
% \begin{macrocode}
\def\bbl@usehyphen#1{%
@@ -7184,7 +9103,7 @@ help from Bernd Raichle, for which I am grateful.
%
% The aim following commands is to provide a commom interface for
% strings in several encodings. They also contains several hooks which
-% can be ued by \luatex{} and \xetex. The code is organized here with
+% can be used by \luatex{} and \xetex. The code is organized here with
% pseudo-guards, so we start with the basic commands.
%
% \paragraph{Tools}
@@ -7195,7 +9114,7 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\bbl@trace{Multiencoding strings}
\def\bbl@toglobal#1{\global\let#1#1}
-\def\bbl@recatcode#1{%
+\def\bbl@recatcode#1{% TODO. Used only once?
\@tempcnta="7F
\def\bbl@tempa{%
\ifnum\@tempcnta>"FF\else
@@ -7255,10 +9174,10 @@ help from Bernd Raichle, for which I am grateful.
%<</More package options>>
% \end{macrocode}
%
-% \paragraph{Main command} This is the main command. With the
-% first use it is redefined to omit the basic setup in subsequent
-% blocks. We make sure strings contain actual letters in the range
-% 128-255, not active characters.
+% \paragraph{Main command} This is the main command. With the first
+% use it is redefined to omit the basic setup in subsequent blocks.
+% We make sure strings contain actual letters in the range 128-255,
+% not active characters.
%
% \begin{macrocode}
\@onlypreamble\StartBabelCommands
@@ -7296,22 +9215,22 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@startcommands\StartBabelCommands
% \end{macrocode}
%
-% Parse the encoding info to get the label, input, and font parts.
+% Parse the encoding info to get the label, input, and font parts.
%
-% Select the behavior of |\SetString|. Thre are two main cases,
-% depending of if there is an optional argument: without it and
-% |strings=encoded|, strings are defined
-% always; otherwise, they are set only if they are still undefined
-% (ie, fallback values). With labelled blocks and
-% |strings=encoded|, define the strings, but with another value,
-% define strings only if the current label or font encoding is the
-% value of |strings|; otherwise (ie, no |strings| or a block whose
-% label is not in |strings=|) do nothing.
+% Select the behavior of |\SetString|. Thre are two main cases,
+% depending of if there is an optional argument: without it and
+% |strings=encoded|, strings are defined
+% always; otherwise, they are set only if they are still undefined
+% (ie, fallback values). With labelled blocks and
+% |strings=encoded|, define the strings, but with another value,
+% define strings only if the current label or font encoding is the
+% value of |strings|; otherwise (ie, no |strings| or a block whose
+% label is not in |strings=|) do nothing.
%
-% We presume the current block is not loaded, and therefore set
-% (above) a couple of default values to gobble the arguments. Then,
-% these macros are redefined if necessary according to several
-% parameters.
+% We presume the current block is not loaded, and therefore set
+% (above) a couple of default values to gobble the arguments. Then,
+% these macros are redefined if necessary according to several
+% parameters.
%
% \begin{macrocode}
\newcommand\bbl@startcmds@ii[1][\@empty]{%
@@ -7375,18 +9294,19 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% There are two versions of |\bbl@scswitch|. The first version is
-% used when |ldf|s are read, and it makes sure
-% |\|\m{group}\m{language} is reset, but only once (|\bbl@screset|
-% is used to keep track of this). The second version is used in the
-% preamble and packages loaded after \babel{} and does nothing. The
-% macro |\bbl@forlang| loops |\bbl@L| but its body is executed only
-% if the value is in |\BabelLanguages| (inside \babel) or
-% |\date|\m{language} is defined (after \babel{} has been loaded).
-% There are also two version of |\bbl@forlang|. The first one skips
-% the current iteration if the language is not in |\BabelLanguages|
-% (used in |ldf|s), and the second one skips undefined languages
-% (after \babel{} has been loaded) .
+% There are two versions of |\bbl@scswitch|. The first version is used
+% when |ldf|s are read, and it makes sure |\|\m{group}\m{language} is
+% reset, but only once (|\bbl@screset| is used to keep track of this).
+% The second version is used in the preamble and packages loaded after
+% \babel{} and does nothing.
+%
+% The macro |\bbl@forlang| loops |\bbl@L| but its body is executed only
+% if the value is in |\BabelLanguages| (inside \babel) or
+% |\date|\m{language} is defined (after \babel{} has been loaded).
+% There are also two version of |\bbl@forlang|. The first one skips the
+% current iteration if the language is not in |\BabelLanguages| (used
+% in |ldf|s), and the second one skips undefined languages (after
+% \babel{} has been loaded) .
%
% \begin{macrocode}
\def\bbl@forlang#1#2{%
@@ -7417,17 +9337,17 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@endcommands\EndBabelCommands
% \end{macrocode}
%
-% Now we define commands to be used inside |\StartBabelCommands|.
+% Now we define commands to be used inside |\StartBabelCommands|.
%
-% \paragraph{Strings} The following macro is the actual definition
-% of |\SetString| when it is ``active''
+% \paragraph{Strings} The following macro is the actual definition
+% of |\SetString| when it is ``active''
%
-% First save the ``switcher''. Create it if undefined. Strings are
-% defined only if undefined (ie, like |\providescommmand|). With
-% the event |stringprocess| you can preprocess the string by
-% manipulating the value of |\BabelString|. If there are several
-% hooks assigned to this event, preprocessing is done in the same
-% order as defined. Finally, the string is set.
+% First save the ``switcher''. Create it if undefined. Strings are
+% defined only if undefined (ie, like |\providescommmand|). With
+% the event |stringprocess| you can preprocess the string by
+% manipulating the value of |\BabelString|. If there are several
+% hooks assigned to this event, preprocessing is done in the same
+% order as defined. Finally, the string is set.
%
% \begin{macrocode}
\def\bbl@setstring#1#2{%
@@ -7471,12 +9391,11 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
-% Define |\SetStringLoop|, which is actually set inside
-% |\StartBabelCommands|. The current definition is
-% somewhat complicated because we need a count, but |\count@| is
-% not under our control (remember |\SetString| may call hooks).
-% Instead of defining a dedicated count, we just ``pre-expand''
-% its value.
+% Define |\SetStringLoop|, which is actually set inside
+% |\StartBabelCommands|. The current definition is somewhat complicated
+% because we need a count, but |\count@| is not under our control
+% (remember |\SetString| may call hooks). Instead of defining a
+% dedicated count, we just ``pre-expand'' its value.
%
% \begin{macrocode}
%<<*Macros local to BabelCommands>>
@@ -7492,8 +9411,8 @@ help from Bernd Raichle, for which I am grateful.
%<</Macros local to BabelCommands>>
% \end{macrocode}
%
-% \paragraph{Delaying code} Now the definition of
-% |\AfterBabelCommands| when it is activated.
+% \paragraph{Delaying code} Now the definition of |\AfterBabelCommands|
+% when it is activated.
%
% \begin{macrocode}
\def\bbl@aftercmds#1{%
@@ -7565,8 +9484,8 @@ help from Bernd Raichle, for which I am grateful.
\bbl@tempa}
% \end{macrocode}
%
-% The following package options control the behavior of
-% hyphenation mapping.
+% The following package options control the behavior of
+% hyphenation mapping.
%
% \begin{macrocode}
%<<*More package options>>
@@ -7592,8 +9511,9 @@ help from Bernd Raichle, for which I am grateful.
% \subsection{Macros common to a number of languages}
%
% \begin{macro}{\set@low@box}
-% The following macro is used to lower quotes to the same level as
-% the comma. It prepares its argument in box register~0.
+%
+% The following macro is used to lower quotes to the same level as
+% the comma. It prepares its argument in box register~0.
%
% \begin{macrocode}
\bbl@trace{Macros related to glyphs}
@@ -7619,18 +9539,18 @@ help from Bernd Raichle, for which I am grateful.
%
% \subsection{Making glyphs available}
%
-% This section makes a number of glyphs available that either do not
-% exist in the \texttt{OT1} encoding and have to be `faked', or
-% that are not accessible through \file{T1enc.def}.
+% This section makes a number of glyphs available that either do not
+% exist in the \texttt{OT1} encoding and have to be `faked', or
+% that are not accessible through \file{T1enc.def}.
%
% \subsubsection{Quotation marks}
%
% \begin{macro}{\quotedblbase}
-% In the \texttt{T1} encoding the opening double quote at the
-% baseline is available as a separate character, accessible via
-% |\quotedblbase|. In the \texttt{OT1} encoding it is not
-% available, therefore we make it available by lowering the normal
-% open quote character to the baseline.
+% In the \texttt{T1} encoding the opening double quote at the
+% baseline is available as a separate character, accessible via
+% |\quotedblbase|. In the \texttt{OT1} encoding it is not
+% available, therefore we make it available by lowering the normal
+% open quote character to the baseline.
%
% \begin{macrocode}
\ProvideTextCommand{\quotedblbase}{OT1}{%
@@ -7638,8 +9558,8 @@ help from Bernd Raichle, for which I am grateful.
\box\z@\kern-.04em\bbl@allowhyphens}}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used this glyph can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used this glyph can still be typeset.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\quotedblbase}{%
@@ -7667,12 +9587,27 @@ help from Bernd Raichle, for which I am grateful.
%
% \end{macro}
%
-% \begin{macro}{\guillemotleft}
-% \begin{macro}{\guillemotright}
-% The guillemet characters are not available in \texttt{OT1}
-% encoding. They are faked.
+% \begin{macro}{\guillemetleft}
+% \begin{macro}{\guillemetright}
+% The guillemet characters are not available in \texttt{OT1}
+% encoding. They are faked. (Wrong names with o preserved for
+% compatibility.)
%
% \begin{macrocode}
+\ProvideTextCommand{\guillemetleft}{OT1}{%
+ \ifmmode
+ \ll
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle\ll$}\bbl@allowhyphens}%
+ \fi}
+\ProvideTextCommand{\guillemetright}{OT1}{%
+ \ifmmode
+ \gg
+ \else
+ \save@sf@q{\nobreak
+ \raise.2ex\hbox{$\scriptscriptstyle\gg$}\bbl@allowhyphens}%
+ \fi}
\ProvideTextCommand{\guillemotleft}{OT1}{%
\ifmmode
\ll
@@ -7689,10 +9624,14 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used these glyphs can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
%
% \begin{macrocode}
+\ProvideTextCommandDefault{\guillemetleft}{%
+ \UseTextSymbol{OT1}{\guillemetleft}}
+\ProvideTextCommandDefault{\guillemetright}{%
+ \UseTextSymbol{OT1}{\guillemetright}}
\ProvideTextCommandDefault{\guillemotleft}{%
\UseTextSymbol{OT1}{\guillemotleft}}
\ProvideTextCommandDefault{\guillemotright}{%
@@ -7724,8 +9663,8 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% Make sure that when an encoding other than \texttt{OT1} or
-% \texttt{T1} is used these glyphs can still be typeset.
+% Make sure that when an encoding other than \texttt{OT1} or
+% \texttt{T1} is used these glyphs can still be typeset.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\guilsinglleft}{%
@@ -7741,9 +9680,9 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\ij}
% \begin{macro}{\IJ}
-% The dutch language uses the letter `ij'. It is available in
-% \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
-% fonts. Therefore we fake it for the \texttt{OT1} encoding.
+% The dutch language uses the letter `ij'. It is available in
+% \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded
+% fonts. Therefore we fake it for the \texttt{OT1} encoding.
%
% \begin{macrocode}
\DeclareTextCommand{\ij}{OT1}{%
@@ -7767,15 +9706,15 @@ help from Bernd Raichle, for which I am grateful.
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\dj}
-% \begin{macro}{\DJ}
-% The croatian language needs the letters |\dj| and |\DJ|; they are
-% available in the \texttt{T1} encoding, but not in the
-% \texttt{OT1} encoding by default.
+% \begin{macro}{\dj}
+% \begin{macro}{\DJ}
+% The croatian language needs the letters |\dj| and |\DJ|; they are
+% available in the \texttt{T1} encoding, but not in the
+% \texttt{OT1} encoding by default.
%
-% Some code to construct these glyphs for the \texttt{OT1} encoding
-% was made available to me by Stipčević Mario,
-% (\texttt{stipcevic@olimp.irb.hr}).
+% Some code to construct these glyphs for the \texttt{OT1} encoding
+% was made available to me by Stipčević Mario,
+% (\texttt{stipcevic@olimp.irb.hr}).
%
% \begin{macrocode}
\def\crrtic@{\hrule height0.1ex width0.3em}
@@ -7910,9 +9849,9 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\ProvideTextCommandDefault{\flqq}{%
- \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
+ \textormath{\guillemetleft}{\mbox{\guillemetleft}}}
\ProvideTextCommandDefault{\frqq}{%
- \textormath{\guillemotright}{\mbox{\guillemotright}}}
+ \textormath{\guillemetright}{\mbox{\guillemetright}}}
% \end{macrocode}
%
% \end{macro}
@@ -8021,13 +9960,13 @@ help from Bernd Raichle, for which I am grateful.
}
% \end{macrocode}
%
-% Finally, the default is to use English as the main language.
+% Finally, make sure the default hyphenrules are defined (even if
+% empty).
%
% \begin{macrocode}
\ifx\l@english\@undefined
\chardef\l@english\z@
\fi
-\main@language{english}
% \end{macrocode}
%
% \subsection{Layout}
@@ -8088,7 +10027,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
-% \subsection{Creating languages}
+% \subsection{Creating and modifying languages}
%
% |\babelprovide| is a general purpose tool for creating and modifying
% languages. It creates the language infrastructure, and loads, if
@@ -8129,10 +10068,14 @@ help from Bernd Raichle, for which I am grateful.
% == import, captions ==
\ifx\bbl@KVP@import\@nil\else
\bbl@exp{\\\bbl@ifblank{\bbl@KVP@import}}%
- {\begingroup
- \def\BabelBeforeIni##1##2{\gdef\bbl@KVP@import{##1}\endinput}%
- \InputIfFileExists{babel-#2.tex}{}{}%
- \endgroup}%
+ {\ifx\bbl@initoload\relax
+ \begingroup
+ \def\BabelBeforeIni##1##2{\gdef\bbl@KVP@import{##1}\endinput}%
+ \InputIfFileExists{babel-#2.tex}{}{}%
+ \endgroup
+ \else
+ \xdef\bbl@KVP@import{\bbl@initoload}%
+ \fi}%
{}%
\fi
\ifx\bbl@KVP@captions\@nil
@@ -8156,11 +10099,14 @@ help from Bernd Raichle, for which I am grateful.
\\\foreignlanguage{\languagename}%
{####1}}}}%
{}%
+ \bbl@exp{%
+ \\\bbl@toglobal\<bbl@ensure@\languagename>%
+ \\\bbl@toglobal\<bbl@ensure@\languagename\space>}%
% At this point all parameters are defined if 'import'. Now we
% execute some code depending on them. But what about if nothing was
% imported? We just load the very basic parameters: ids and a few
% more.
- \bbl@ifunset{bbl@lname@#2}%
+ \bbl@ifunset{bbl@lname@#2}% TODO. Duplicated
{\def\BabelBeforeIni##1##2{%
\begingroup
\catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\;=12 %
@@ -8171,14 +10117,21 @@ help from Bernd Raichle, for which I am grateful.
\bbl@exportkey{dgnat}{numbers.digits.native}{}%
\bbl@exportkey{prehc}{typography.prehyphenchar}{}%
\bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
+ \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
+ \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
\bbl@exportkey{hyphr}{typography.hyphenrules}{}%
\bbl@exportkey{hyoth}{typography.hyphenate.other}{}%
\bbl@exportkey{intsp}{typography.intraspace}{}%
- \endinput
- \endgroup}% boxed, to avoid extra spaces:
- {\setbox\z@\hbox{\InputIfFileExists{babel-#2.tex}{}{}}}}%
+ \ifx\bbl@initoload\relax\endinput\fi
+ \endgroup}%
+ \begingroup % boxed, to avoid extra spaces:
+ \ifx\bbl@initoload\relax
+ \setbox\z@\hbox{\InputIfFileExists{babel-#2.tex}{}{}}%
+ \else
+ \setbox\z@\hbox{\BabelBeforeIni{\bbl@initoload}{}}%
+ \fi
+ \endgroup}%
{}%
- % -
% == script, language ==
% Override the values from ini or defines them
\ifx\bbl@KVP@script\@nil\else
@@ -8441,7 +10394,11 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\expandafter\bbl@tempb\bbl@captionslist\@empty
\else
- \bbl@read@ini{\bbl@KVP@captions}{data}% Here all letters cat = 11
+ \ifx\bbl@initoload\relax
+ \bbl@read@ini{\bbl@KVP@captions}{data}% Here letters cat = 11
+ \else
+ \bbl@read@ini{\bbl@initoload}{data}% Here all letters cat = 11
+ \fi
\bbl@after@ini
\bbl@savestrings
\fi
@@ -8454,8 +10411,34 @@ help from Bernd Raichle, for which I am grateful.
\bbl@savedate
\fi
\bbl@endcommands
+ \bbl@ifunset{bbl@lname@#1}% TODO. Duplicated
+ {\def\BabelBeforeIni##1##2{%
+ \begingroup
+ \catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\;=12 %
+ \let\bbl@ini@captions@aux\@gobbletwo
+ \def\bbl@inidate ####1.####2.####3.####4\relax ####5####6{}%
+ \bbl@read@ini{##1}{basic data}%
+ \bbl@exportkey{prehc}{typography.prehyphenchar}{}%
+ \bbl@exportkey{lnbrk}{typography.linebreaking}{h}%
+ \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}%
+ \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}%
+ \bbl@exportkey{hyphr}{typography.hyphenrules}{}%
+ \bbl@exportkey{hyoth}{typography.hyphenate.other}{}%
+ \bbl@exportkey{intsp}{typography.intraspace}{}%
+ \bbl@exportkey{chrng}{characters.ranges}{}%
+ \bbl@exportkey{dgnat}{numbers.digits.native}{}%
+ \ifx\bbl@initoload\relax\endinput\fi
+ \endgroup}%
+ \begingroup % boxed, to avoid extra spaces:
+ \ifx\bbl@initoload\relax
+ \setbox\z@\hbox{\InputIfFileExists{babel-#1.tex}{}{}}%
+ \else
+ \setbox\z@\hbox{\BabelBeforeIni{\bbl@initoload}{}}%
+ \fi
+ \endgroup}%
+ {}%
\bbl@exp{%
- \def\<#1hyphenmins>{%
+ \gdef\<#1hyphenmins>{%
{\bbl@ifunset{bbl@lfthm@#1}{2}{\bbl@cs{lfthm@#1}}}%
{\bbl@ifunset{bbl@rgthm@#1}{3}{\bbl@cs{rgthm@#1}}}}}%
\bbl@provide@hyphens{#1}%
@@ -8498,7 +10481,14 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\fi
\ifx\bbl@tempa\relax % if no opt or no language in opt found
- \ifx\bbl@KVP@import\@nil\else % if importing
+ \ifx\bbl@KVP@import\@nil
+ \ifx\bbl@initoload\relax\else
+ \bbl@exp{% and hyphenrules is not empty
+ \\\bbl@ifblank{\bbl@cs{hyphr@#1}}%
+ {}%
+ {\let\\\bbl@tempa\<l@\bbl@cl{hyphr}>}}%
+ \fi
+ \else % if importing
\bbl@exp{% and hyphenrules is not empty
\\\bbl@ifblank{\bbl@cs{hyphr@#1}}%
{}%
@@ -8677,13 +10667,13 @@ help from Bernd Raichle, for which I am grateful.
\in@{.1$}{#1$}%
\ifin@
\bbl@replace\bbl@tempc{.1}{}%
- \bbl@csarg\xdef{cntr@\bbl@tempc @\languagename}{%
+ \bbl@csarg\protected@xdef{cntr@\bbl@tempc @\languagename}{%
\noexpand\bbl@alphnumeral{\bbl@tempc}}%
\fi
\in@{.F.}{#1}%
\ifin@\else\in@{.S.}{#1}\fi
\ifin@
- \bbl@csarg\xdef{cntr@#1@\languagename}{\bbl@tempb*}%
+ \bbl@csarg\protected@xdef{cntr@#1@\languagename}{\bbl@tempb*}%
\else
\toks@{}% Required by \bbl@buildifcase, which returns \bbl@tempa
\expandafter\bbl@buildifcase\bbl@tempb* \\ % Space after \\
@@ -8954,10 +10944,10 @@ help from Bernd Raichle, for which I am grateful.
\fi}}
% \end{macrocode}
%
-% More general, but non-expandable, is |\getlocaleproperty|. To inspect
-% every possible loaded |ini|, we define |\LocaleForEach|, where
-% |\bbl@ini@loaded| is a comma-separated list of locales, built by
-% |\bbl@read@ini|.
+% More general, but non-expandable, is |\getlocaleproperty|. To inspect
+% every possible loaded |ini|, we define |\LocaleForEach|, where
+% |\bbl@ini@loaded| is a comma-separated list of locales, built by
+% |\bbl@read@ini|.
%
% \begin{macrocode}
\newcommand\getlocaleproperty[3]{%
@@ -8985,7 +10975,10 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\newcommand\babeladjust[1]{% TODO. Error handling.
- \bbl@forkv{#1}{\bbl@cs{ADJ@##1@##2}}}
+ \bbl@forkv{#1}{%
+ \bbl@ifunset{bbl@ADJ@##1@##2}%
+ {\bbl@cs{ADJ@##1}{##2}}%
+ {\bbl@cs{ADJ@##1@##2}}}}
%
\def\bbl@adjust@lua#1#2{%
\ifvmode
@@ -9039,1940 +11032,38 @@ help from Bernd Raichle, for which I am grateful.
\bbl@adjust@layout{\let\list\bbl@OL@list}}
\@namedef{bbl@ADJ@hyphenation.extra@on}{%
\bbl@activateposthyphen}
-% \end{macrocode}
-%
-% \section{The kernel of Babel (\texttt{babel.def} for \LaTeX only)}
-%
-% \subsection{The redefinition of the style commands}
-%
-% The rest of the code in this file can only be processed by
-% \LaTeX, so we check the current format. If it is plain \TeX,
-% processing should stop here. But, because of the need to limit
-% the scope of the definition of |\format|, a macro that is used
-% locally in the following |\if|~statement, this comparison is done
-% inside a group. To prevent \TeX\ from complaining about an
-% unclosed group, the processing of the command |\endinput| is
-% deferred until after the group is closed. This is accomplished by
-% the command |\aftergroup|.
-%
-% \begin{macrocode}
-{\def\format{lplain}
-\ifx\fmtname\format
-\else
- \def\format{LaTeX2e}
- \ifx\fmtname\format
- \else
- \aftergroup\endinput
- \fi
-\fi}
-% \end{macrocode}
-%
-% \subsection{Cross referencing macros}
-%
-% The \LaTeX\ book states:
-% \begin{quote}
-% The \emph{key} argument is any sequence of letters, digits, and
-% punctuation symbols; upper- and lowercase letters are regarded as
-% different.
-% \end{quote}
-% When the above quote should still be true when a document is
-% typeset in a language that has active characters, special care
-% has to be taken of the category codes of these characters when
-% they appear in an argument of the cross referencing macros.
-%
-% When a cross referencing command processes its argument, all
-% tokens in this argument should be character tokens with category
-% `letter' or `other'.
-%
-% The only way to accomplish this in most cases is to use the trick
-% described in the \TeX book~\cite{DEK} (Appendix~D, page~382).
-% The primitive |\meaning| applied to a token expands to the
-% current meaning of this token. For example, `|\meaning\A|' with
-% |\A| defined as `|\def\A#1{\B}|' expands to the characters
-% `|macro:#1->\B|' with all category codes set to `other' or
-% `space'.
-% \begin{macro}{\newlabel}
-% The macro |\label| writes a line with a |\newlabel| command
-% into the |.aux| file to define labels.
-%
-% \begin{macrocode}
-%\bbl@redefine\newlabel#1#2{%
-% \@safe@activestrue\org@newlabel{#1}{#2}\@safe@activesfalse}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\@newl@bel}
-% We need to change the definition of the \LaTeX-internal macro
-% |\@newl@bel|. This is needed because we need to make sure that
-% shorthand characters expand to their non-active version.
-%
-% The following package options control which macros are to be
-% redefined.
-%
-% \begin{macrocode}
-%<<*More package options>>
-\DeclareOption{safe=none}{\let\bbl@opt@safe\@empty}
-\DeclareOption{safe=bib}{\def\bbl@opt@safe{B}}
-\DeclareOption{safe=ref}{\def\bbl@opt@safe{R}}
-%<</More package options>>
-% \end{macrocode}
-%
-% First we open a new group to keep the changed setting of
-% |\protect| local and then we set the |@safe@actives| switch to
-% true to make sure that any shorthand that appears in any of the
-% arguments immediately expands to its non-active self.
-%
-% \begin{macrocode}
-\bbl@trace{Cross referencing macros}
-\ifx\bbl@opt@safe\@empty\else
- \def\@newl@bel#1#2#3{%
- {\@safe@activestrue
- \bbl@ifunset{#1@#2}%
- \relax
- {\gdef\@multiplelabels{%
- \@latex@warning@no@line{There were multiply-defined labels}}%
- \@latex@warning@no@line{Label `#2' multiply defined}}%
- \global\@namedef{#1@#2}{#3}}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\@testdef}
-% An internal \LaTeX\ macro used to test if the labels that have
-% been written on the |.aux| file have changed. It is called by
-% the |\enddocument| macro. This macro needs to be completely
-% rewritten, using |\meaning|. The reason for this is that in some
-% cases the expansion of |\#1@#2| contains the same characters as
-% the |#3|; but the character codes differ. Therefore \LaTeX\ keeps
-% reporting that the labels may have changed.
-%
-% \begin{macrocode}
- \CheckCommand*\@testdef[3]{%
- \def\reserved@a{#3}%
- \expandafter\ifx\csname#1@#2\endcsname\reserved@a
- \else
- \@tempswatrue
- \fi}
-% \end{macrocode}
-%
-% Now that we made sure that |\@testdef| still has the same
-% definition we can rewrite it. First we make the shorthands
-% `safe'.
-%
-% \begin{macrocode}
- \def\@testdef#1#2#3{%
- \@safe@activestrue
-% \end{macrocode}
-%
-% Then we use |\bbl@tempa| as an `alias' for the macro that
-% contains the label which is being checked.
-%
-% \begin{macrocode}
- \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname
-% \end{macrocode}
-%
-% Then we define |\bbl@tempb| just as |\@newl@bel| does it.
-%
-% \begin{macrocode}
- \def\bbl@tempb{#3}%
- \@safe@activesfalse
-% \end{macrocode}
-%
-% When the label is defined we replace the definition of
-% |\bbl@tempa| by its meaning.
-%
-% \begin{macrocode}
- \ifx\bbl@tempa\relax
- \else
- \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}%
- \fi
-% \end{macrocode}
-%
-% We do the same for |\bbl@tempb|.
-%
-% \begin{macrocode}
- \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}%
-% \end{macrocode}
-%
-% If the label didn't change, |\bbl@tempa| and |\bbl@tempb| should
-% be identical macros.
-%
-% \begin{macrocode}
- \ifx\bbl@tempa\bbl@tempb
- \else
- \@tempswatrue
- \fi}
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\ref}
-% \begin{macro}{\pageref}
-% The same holds for the macro |\ref| that references a label
-% and |\pageref| to reference a page. So we redefine |\ref| and
-% |\pageref|. While we change these macros, we make them robust as
-% well (if they weren't already) to prevent problems if they should
-% become expanded at the wrong moment.
-%
-% \begin{macrocode}
-\bbl@xin@{R}\bbl@opt@safe
-\ifin@
- \bbl@redefinerobust\ref#1{%
- \@safe@activestrue\org@ref{#1}\@safe@activesfalse}
- \bbl@redefinerobust\pageref#1{%
- \@safe@activestrue\org@pageref{#1}\@safe@activesfalse}
-\else
- \let\org@ref\ref
- \let\org@pageref\pageref
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@citex}
-% The macro used to cite from a bibliography, |\cite|, uses an
-% internal macro, |\@citex|.
-% It is this internal macro that picks up the argument(s),
-% so we redefine this internal macro and leave |\cite| alone. The
-% first argument is used for typesetting, so the shorthands need
-% only be deactivated in the second argument.
-%
-% \begin{macrocode}
-\bbl@xin@{B}\bbl@opt@safe
-\ifin@
- \bbl@redefine\@citex[#1]#2{%
- \@safe@activestrue\edef\@tempa{#2}\@safe@activesfalse
- \org@@citex[#1]{\@tempa}}
-% \end{macrocode}
-%
-% Unfortunately, the packages \pkg{natbib} and \pkg{cite} need a
-% different definition of |\@citex|...
-% To begin with, \pkg{natbib} has a definition for |\@citex| with
-% \emph{three} arguments... We only know that a package is loaded
-% when |\begin{document}| is executed, so we need to postpone the
-% different redefinition.
-%
-% \begin{macrocode}
- \AtBeginDocument{%
- \@ifpackageloaded{natbib}{%
-% \end{macrocode}
-%
-% Notice that we use |\def| here instead of |\bbl@redefine| because
-% |\org@@citex| is already defined and we don't want to overwrite
-% that definition (it would result in parameter stack overflow
-% because of a circular definition).
-%
-% (Recent versions of \pkg{natbib} change dynamically |\@citex|, so PR4087
-% doesn't seem fixable in a simple way. Just load \pkg{natbib} before.)
-%
-% \begin{macrocode}
- \def\@citex[#1][#2]#3{%
- \@safe@activestrue\edef\@tempa{#3}\@safe@activesfalse
- \org@@citex[#1][#2]{\@tempa}}%
- }{}}
-% \end{macrocode}
-%
-% The package \pkg{cite} has a definition of |\@citex| where the
-% shorthands need to be turned off in both arguments.
-%
-% \begin{macrocode}
- \AtBeginDocument{%
- \@ifpackageloaded{cite}{%
- \def\@citex[#1]#2{%
- \@safe@activestrue\org@@citex[#1]{#2}\@safe@activesfalse}%
- }{}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\nocite}
-% The macro |\nocite| which is used to instruct BiB\TeX\ to
-% extract uncited references from the database.
-%
-% \begin{macrocode}
- \bbl@redefine\nocite#1{%
- \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\bibcite}
-% The macro that is used in the |.aux| file to
-% define citation labels. When packages such as \pkg{natbib} or
-% \pkg{cite} are not loaded its second argument is used to typeset the
-% citation label. In that case, this second argument can contain
-% active characters but is used in an environment where
-% |\@safe@activestrue| is in effect. This switch needs to be reset
-% inside the |\hbox| which contains the citation label. In order to
-% determine during \file{.aux} file processing which definition of
-% |\bibcite| is needed we define |\bibcite| in such a way that it
-% redefines itself with the proper definition. We call
-% |\bbl@cite@choice| to select the proper definition for |\bibcite|.
-% This new definition is then activated.
-%
-% \begin{macrocode}
- \bbl@redefine\bibcite{%
- \bbl@cite@choice
- \bibcite}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\bbl@bibcite}
-% The macro |\bbl@bibcite| holds the definition of |\bibcite|
-% needed when neither \pkg{natbib} nor \pkg{cite} is loaded.
-%
-% \begin{macrocode}
- \def\bbl@bibcite#1#2{%
- \org@bibcite{#1}{\@safe@activesfalse#2}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\bbl@cite@choice}
-% The macro |\bbl@cite@choice| determines which definition of
-% |\bibcite| is needed. First we give |\bibcite| its default
-% definition.
-%
-% \begin{macrocode}
- \def\bbl@cite@choice{%
- \global\let\bibcite\bbl@bibcite
-% \end{macrocode}
-%
-% Then, when \pkg{natbib} is loaded we restore the original
-% definition of |\bibcite|. For \pkg{cite} we do the same.
-%
-% \begin{macrocode}
- \@ifpackageloaded{natbib}{\global\let\bibcite\org@bibcite}{}%
- \@ifpackageloaded{cite}{\global\let\bibcite\org@bibcite}{}%
-% \end{macrocode}
-%
-% Make sure this only happens once.
-%
-% \begin{macrocode}
- \global\let\bbl@cite@choice\relax}
-% \end{macrocode}
-%
-% When a document is run for the first time, no \file{.aux} file is
-% available, and |\bibcite| will not yet be properly defined. In
-% this case, this has to happen before the document starts.
-%
-% \begin{macrocode}
- \AtBeginDocument{\bbl@cite@choice}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\@bibitem}
-% One of the two internal \LaTeX\ macros called by |\bibitem|
-% that write the citation label on the |.aux| file.
-%
-% \begin{macrocode}
- \bbl@redefine\@bibitem#1{%
- \@safe@activestrue\org@@bibitem{#1}\@safe@activesfalse}
-\else
- \let\org@nocite\nocite
- \let\org@@citex\@citex
- \let\org@bibcite\bibcite
- \let\org@@bibitem\@bibitem
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsection{Marks}
-%
-% \begin{macro}{\markright}
-% Because the output routine is asynchronous, we must
-% pass the current language attribute to the head lines, together
-% with the text that is put into them. To achieve this we need to
-% adapt the definition of |\markright| and |\markboth| somewhat.
-%
-% We check whether the argument is empty; if it is, we just make
-% sure the scratch token register is empty. Next, we store the
-% argument to |\markright| in the scratch token register. This way
-% these commands will not be expanded later, and we make sure that
-% the text is typeset using the correct language settings. While
-% doing so, we make sure that active characters that may end up in
-% the mark are not disabled by the output routine kicking in while
-% \cs{@safe@activestrue} is in effect.
-%
-% \begin{macrocode}
-\bbl@trace{Marks}
-\IfBabelLayout{sectioning}
- {\ifx\bbl@opt@headfoot\@nnil
- \g@addto@macro\@resetactivechars{%
- \set@typeset@protect
- \expandafter\select@language@x\expandafter{\bbl@main@language}%
- \let\protect\noexpand
- \edef\thepage{%
- \noexpand\babelsublr{\unexpanded\expandafter{\thepage}}}}%
- \fi}
- {\ifbbl@single\else
- \bbl@ifunset{markright }\bbl@redefine\bbl@redefinerobust
- \markright#1{%
- \bbl@ifblank{#1}%
- {\org@markright{}}%
- {\toks@{#1}%
- \bbl@exp{%
- \\\org@markright{\\\protect\\\foreignlanguage{\languagename}%
- {\\\protect\\\bbl@restore@actives\the\toks@}}}}}%
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\markboth}
-% \begin{macro}{\@mkboth}
-% The definition of |\markboth| is equivalent to that of
-% |\markright|, except that we need two token registers. The
-% documentclasses \cls{report} and \cls{book} define and set the
-% headings for the page. While doing so they also store a copy of
-% |\markboth| in |\@mkboth|. Therefore we need to check whether
-% |\@mkboth| has already been set. If so we neeed to do that again
-% with the new definition of |\markboth|. (As of Oct 2019, \LaTeX{}
-% stores the definition in an intermediate macros, so it's not
-% necessary anymore, but it's preserved for older versions.)
-%
-% \begin{macrocode}
- \ifx\@mkboth\markboth
- \def\bbl@tempc{\let\@mkboth\markboth}
- \else
- \def\bbl@tempc{}
- \fi
- \bbl@ifunset{markboth }\bbl@redefine\bbl@redefinerobust
- \markboth#1#2{%
- \protected@edef\bbl@tempb##1{%
- \protect\foreignlanguage
- {\languagename}{\protect\bbl@restore@actives##1}}%
- \bbl@ifblank{#1}%
- {\toks@{}}%
- {\toks@\expandafter{\bbl@tempb{#1}}}%
- \bbl@ifblank{#2}%
- {\@temptokena{}}%
- {\@temptokena\expandafter{\bbl@tempb{#2}}}%
- \bbl@exp{\\\org@markboth{\the\toks@}{\the\@temptokena}}}
- \bbl@tempc
- \fi} % end ifbbl@single, end \IfBabelLayout
-% \end{macrocode}
-%
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Preventing clashes with other packages}
-%
-% \subsubsection{\pkg{ifthen}}
-%
-% \begin{macro}{\ifthenelse}
-%
-% Sometimes a document writer wants to create a special effect
-% depending on the page a certain fragment of text appears on. This
-% can be achieved by the following piece of code:
-%\begin{verbatim}
-% \ifthenelse{\isodd{\pageref{some:label}}}
-% {code for odd pages}
-% {code for even pages}
-%\end{verbatim}
-% In order for this to work the argument of |\isodd| needs to be
-% fully expandable. With the above redefinition of |\pageref| it is
-% not in the case of this example. To overcome that, we add some
-% code to the definition of |\ifthenelse| to make things work.
-%
-% The first thing we need to do is check if the package
-% \pkg{ifthen} is loaded. This should be done at |\begin{document}|
-% time.
-%
-% \begin{macrocode}
-\bbl@trace{Preventing clashes with other packages}
-\bbl@xin@{R}\bbl@opt@safe
-\ifin@
- \AtBeginDocument{%
- \@ifpackageloaded{ifthen}{%
-% \end{macrocode}
-%
-% Then we can redefine |\ifthenelse|:
-%
-% \begin{macrocode}
- \bbl@redefine@long\ifthenelse#1#2#3{%
-% \end{macrocode}
-%
-% We want to revert the definition of |\pageref| and |\ref| to
-% their original definition for the first argument of |\ifthenelse|,
-% so we first need to store their current meanings.
-%
-% \begin{macrocode}
- \let\bbl@temp@pref\pageref
- \let\pageref\org@pageref
- \let\bbl@temp@ref\ref
- \let\ref\org@ref
-% \end{macrocode}
-%
-% Then we can set the |\@safe@actives| switch and call the original
-% |\ifthenelse|. In order to be able to use shorthands in the
-% second and third arguments of |\ifthenelse| the resetting of the
-% switch \emph{and} the definition of |\pageref| happens inside
-% those arguments. When the package wasn't loaded we do nothing.
-%
-% \begin{macrocode}
- \@safe@activestrue
- \org@ifthenelse{#1}%
- {\let\pageref\bbl@temp@pref
- \let\ref\bbl@temp@ref
- \@safe@activesfalse
- #2}%
- {\let\pageref\bbl@temp@pref
- \let\ref\bbl@temp@ref
- \@safe@activesfalse
- #3}%
- }%
- }{}%
- }
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsubsection{\pkg{varioref}}
-%
-% \begin{macro}{\@@vpageref}
-% \begin{macro}{\vrefpagenum}
-% \begin{macro}{\Ref}
-%
-% When the package varioref is in use we need to modify its
-% internal command |\@@vpageref| in order to prevent problems when
-% an active character ends up in the argument of |\vref|. The same
-% needs to happen for |\vrefpagenum|.
-%
-% \begin{macrocode}
- \AtBeginDocument{%
- \@ifpackageloaded{varioref}{%
- \bbl@redefine\@@vpageref#1[#2]#3{%
- \@safe@activestrue
- \org@@@vpageref{#1}[#2]{#3}%
- \@safe@activesfalse}%
- \bbl@redefine\vrefpagenum#1#2{%
- \@safe@activestrue
- \org@vrefpagenum{#1}{#2}%
- \@safe@activesfalse}%
-% \end{macrocode}
-%
-% The package \pkg{varioref} defines |\Ref| to be a robust command
-% wich uppercases the first character of the reference text. In
-% order to be able to do that it needs to access the expandable form
-% of |\ref|. So we employ a little trick here. We redefine the
-% (internal) command \verb*|\Ref | to call |\org@ref| instead of
-% |\ref|. The disadvantage of this solution is that whenever the
-% definition of |\Ref| changes, this definition needs to be updated
-% as well.
-%
-% \begin{macrocode}
- \expandafter\def\csname Ref \endcsname#1{%
- \protected@edef\@tempa{\org@ref{#1}}\expandafter\MakeUppercase\@tempa}
- }{}%
- }
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsubsection{\pkg{hhline}}
-%
-% \begin{macro}{\hhline}
-% Delaying the activation of the shorthand characters has introduced
-% a problem with the \pkg{hhline} package. The reason is that it
-% uses the `:' character which is made active by the french support
-% in \babel. Therefore we need to \emph{reload} the package when
-% the `:' is an active character.
-%
-% So at |\begin{document}| we check whether \pkg{hhline} is loaded.
-%
-% \begin{macrocode}
-\AtEndOfPackage{%
- \AtBeginDocument{%
- \@ifpackageloaded{hhline}%
-% \end{macrocode}
-%
-% Then we check whether the expansion of |\normal@char:| is not
-% equal to |\relax|.
-%
-% \begin{macrocode}
- {\expandafter\ifx\csname normal@char\string:\endcsname\relax
- \else
-% \end{macrocode}
-%
-% In that case we simply reload the package. Note that this happens
-% \emph{after} the category code of the @-sign has been changed to
-% other, so we need to temporarily change it to letter again.
-%
-% \begin{macrocode}
- \makeatletter
- \def\@currname{hhline}\input{hhline.sty}\makeatother
- \fi}%
- {}}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsubsection{\pkg{hyperref}}
-%
-% \begin{macro}{\pdfstringdefDisableCommands}
-%
-% A number of interworking problems between \pkg{babel} and
-% \pkg{hyperref} are tackled by \pkg{hyperref} itself. The
-% following code was introduced to prevent some annoying warnings
-% but it broke bookmarks. This was quickly fixed in \pkg{hyperref},
-% which essentially made it no-op. However, it will not removed for
-% the moment because \pkg{hyperref} is expecting it.
-%
-% \begin{macrocode}
-\AtBeginDocument{%
- \ifx\pdfstringdefDisableCommands\@undefined\else
- \pdfstringdefDisableCommands{\languageshorthands{system}}%
- \fi}
-% \end{macrocode}
%
-% \end{macro}
+\@namedef{bbl@ADJ@autoload.bcp47@on}{%
+ \bbl@bcpallowedtrue}
+\@namedef{bbl@ADJ@autoload.bcp47@off}{%
+ \bbl@bcpallowedfalse}
+\@namedef{bbl@ADJ@autoload.bcp47.prefix}#1{%
+ \def\bbl@bcp@prefix{#1}}
+\def\bbl@bcp@prefix{bcp47-}
+\@namedef{bbl@ADJ@autoload.options}#1{%
+ \def\bbl@autoload@options{#1}}
+\let\bbl@autoload@bcpoptions\@empty
+\@namedef{bbl@ADJ@autoload.bcp47.options}#1{%
+ \def\bbl@autoload@bcpoptions{#1}}
+% TODO: use babel name, override
+%
+% As the final task, load the code for lua.
%
-% \subsubsection{\pkg{fancyhdr}}
-%
-% \begin{macro}{\FOREIGNLANGUAGE}
-% The package \pkg{fancyhdr} treats the running head and fout lines
-% somewhat differently as the standard classes. A symptom of this is
-% that the command |\foreignlanguage| which \babel\ adds to the
-% marks can end up inside the argument of |\MakeUppercase|. To
-% prevent unexpected results we need to define |\FOREIGNLANGUAGE|
-% here.
-%
-% \begin{macrocode}
-\DeclareRobustCommand{\FOREIGNLANGUAGE}[1]{%
- \lowercase{\foreignlanguage{#1}}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\substitutefontfamily}
-% The command |\substitutefontfamily| creates an
-% \file{.fd} file on the fly. The first argument is an encoding
-% mnemonic, the second and third arguments are font family names.
-%
-% \begin{macrocode}
-\def\substitutefontfamily#1#2#3{%
- \lowercase{\immediate\openout15=#1#2.fd\relax}%
- \immediate\write15{%
- \string\ProvidesFile{#1#2.fd}%
- [\the\year/\two@digits{\the\month}/\two@digits{\the\day}
- \space generated font description file]^^J
- \string\DeclareFontFamily{#1}{#2}{}^^J
- \string\DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}^^J
- \string\DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}^^J
- \string\DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}^^J
- \string\DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}^^J
- \string\DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/bx/n}{}^^J
- \string\DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/bx/it}{}^^J
- \string\DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/bx/sl}{}^^J
- \string\DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/bx/sc}{}^^J
- }%
- \closeout15
- }
-% \end{macrocode}
-%
-% This command should only be used in the preamble of a document.
-%
-% \begin{macrocode}
-\@onlypreamble\substitutefontfamily
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsection{Encoding and fonts}
-%
-% Because documents may use non-ASCII font encodings, we make sure
-% that the logos of \TeX\ and \LaTeX\ always come out in the right
-% encoding. There is a list of non-ASCII encodings. Unfortunately,
-% \textsf{fontenc} deletes its package options, so we must guess which
-% encodings has been loaded by traversing |\@filelist| to search for
-% \m{enc}|enc.def|. If a non-ASCII has been loaded, we define versions
-% of |\TeX| and |\LaTeX| for them using |\ensureascii|. The default
-% ASCII encoding is set, too (in reverse order): the ``main'' encoding
-% (when the document begins), the last loaded, or |OT1|.
-%
-% \begin{macro}{\ensureascii}
-%
-% \begin{macrocode}
-\bbl@trace{Encoding and fonts}
-\newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,PU,PD1}
-\newcommand\BabelNonText{TS1,T3,TS3}
-\let\org@TeX\TeX
-\let\org@LaTeX\LaTeX
-\let\ensureascii\@firstofone
-\AtBeginDocument{%
- \in@false
- \bbl@foreach\BabelNonASCII{% is there a text non-ascii enc?
- \ifin@\else
- \lowercase{\bbl@xin@{,#1enc.def,}{,\@filelist,}}%
- \fi}%
- \ifin@ % if a text non-ascii has been loaded
- \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}%
- \DeclareTextCommandDefault{\TeX}{\org@TeX}%
- \DeclareTextCommandDefault{\LaTeX}{\org@LaTeX}%
- \def\bbl@tempb#1\@@{\uppercase{\bbl@tempc#1}ENC.DEF\@empty\@@}%
- \def\bbl@tempc#1ENC.DEF#2\@@{%
- \ifx\@empty#2\else
- \bbl@ifunset{T@#1}%
- {}%
- {\bbl@xin@{,#1,}{,\BabelNonASCII,\BabelNonText,}%
- \ifin@
- \DeclareTextCommand{\TeX}{#1}{\ensureascii{\org@TeX}}%
- \DeclareTextCommand{\LaTeX}{#1}{\ensureascii{\org@LaTeX}}%
- \else
- \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}%
- \fi}%
- \fi}%
- \bbl@foreach\@filelist{\bbl@tempb#1\@@}% TODO - \@@ de mas??
- \bbl@xin@{,\cf@encoding,}{,\BabelNonASCII,\BabelNonText,}%
- \ifin@\else
- \edef\ensureascii#1{{%
- \noexpand\fontencoding{\cf@encoding}\noexpand\selectfont#1}}%
- \fi
- \fi}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% Now comes the old deprecated stuff (with a little change in 3.9l,
-% for \textsf{fontspec}). The first thing we need to do is to
-% determine, at |\begin{document}|, which latin fontencoding to use.
-%
-% \begin{macro}{\latinencoding}
-% When text is being typeset in an encoding other than `latin'
-% (\texttt{OT1} or \texttt{T1}), it would be nice to still have
-% Roman numerals come out in the Latin encoding.
-% So we first assume that the current encoding at the end
-% of processing the package is the Latin encoding.
-%
-% \begin{macrocode}
-\AtEndOfPackage{\edef\latinencoding{\cf@encoding}}
-% \end{macrocode}
-%
-% But this might be overruled with a later loading of the package
-% \pkg{fontenc}. Therefore we check at the execution of
-% |\begin{document}| whether it was loaded with the \Lopt{T1}
-% option. The normal way to do this (using |\@ifpackageloaded|) is
-% disabled for this package. Now we have to revert to parsing the
-% internal macro |\@filelist| which contains all the filenames
-% loaded.
-%
-% \begin{macrocode}
-\AtBeginDocument{%
- \@ifpackageloaded{fontspec}%
- {\xdef\latinencoding{%
- \ifx\UTFencname\@undefined
- EU\ifcase\bbl@engine\or2\or1\fi
- \else
- \UTFencname
- \fi}}%
- {\gdef\latinencoding{OT1}%
- \ifx\cf@encoding\bbl@t@one
- \xdef\latinencoding{\bbl@t@one}%
- \else
- \ifx\@fontenc@load@list\@undefined
- \@ifl@aded{def}{t1enc}{\xdef\latinencoding{\bbl@t@one}}{}%
- \else
- \def\@elt#1{,#1,}%
- \edef\bbl@tempa{\expandafter\@gobbletwo\@fontenc@load@list}%
- \let\@elt\relax
- \bbl@xin@{,T1,}\bbl@tempa
- \ifin@
- \xdef\latinencoding{\bbl@t@one}%
- \fi
- \fi
- \fi}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\latintext}
-% Then we can define the command |\latintext| which is a
-% declarative switch to a latin font-encoding. Usage of this macro
-% is deprecated.
-%
-% \begin{macrocode}
-\DeclareRobustCommand{\latintext}{%
- \fontencoding{\latinencoding}\selectfont
- \def\encodingdefault{\latinencoding}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\textlatin}
-% This command takes an argument which is then typeset using the
-% requested font encoding. In order to avoid many encoding switches
-% it operates in a local scope.
-%
-% \begin{macrocode}
-\ifx\@undefined\DeclareTextFontCommand
- \DeclareRobustCommand{\textlatin}[1]{\leavevmode{\latintext #1}}
-\else
- \DeclareTextFontCommand{\textlatin}{\latintext}
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsection{Basic bidi support}
-%
-% \textbf{Work in progress.} This code is currently placed here for
-% practical reasons.
-%
-% It is loosely based on |rlbabel.def|, but most of it has been
-% developed from scratch. This \babel{} module (by Johannes Braams and
-% Boris Lavva) has served the purpose of typesetting R documents for
-% two decades, and despite its flaws I think it is still a good starting
-% point (some parts have been copied here almost verbatim), partly
-% thanks to its simplicity. I've also looked at \textsc{arabi} (by
-% Youssef Jabri), which is compatible with \babel{}.
-%
-% There are two ways of modifying macros to make them “bidi”, namely,
-% by patching the internal low-level macros (which is what I have done
-% with lists, columns, counters, tocs, much like |rlbabel| did), and
-% by introducing a “middle layer” just below the user interface
-% (sectioning, footnotes).
-%
-% \begin{itemize}
-% \item pdftex provides a minimal support for bidi text, and it
-% must be done by hand. Vertical typesetting is not possible.
-% \item \xetex{} is somewhat better, thanks to its font engine
-% (even if not always reliable) and a few additional tools. However,
-% very little is done at the paragraph level. Another challenging
-% problem is text direction does not honour \TeX{} grouping.
-% \item \luatex{} can provide the most complete solution, as we can
-% manipulate almost freely the node list, the generated lines,
-% and so on, but bidi text does not work out of the box and some
-% development is necessary. It also provides tools to properly
-% set left-to-right and right-to-left page layouts. As Lua\TeX-ja
-% shows, vertical typesetting is possible, too.
-% \end{itemize}
-%
-% \begin{macrocode}
-\bbl@trace{Basic (internal) bidi support}
-\def\bbl@alscripts{,Arabic,Syriac,Thaana,}
-\def\bbl@rscripts{%
- ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,%
- Old Hungarian,Old Hungarian,Lydian,Mandaean,Manichaean,%
- 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@sname@#1\endcsname}{\bbl@alscripts\bbl@rscripts}%
- \ifin@
- \global\bbl@csarg\chardef{wdir@#1}\@ne
- \bbl@xin@{\csname bbl@sname@#1\endcsname}{\bbl@alscripts}%
- \ifin@
- \global\bbl@csarg\chardef{wdir@#1}\tw@ % useless in xetex
- \fi
- \else
- \global\bbl@csarg\chardef{wdir@#1}\z@
- \fi
- \ifodd\bbl@engine
- \bbl@csarg\ifcase{wdir@#1}%
- \directlua{ Babel.locale_props[\the\localeid].textdir = 'l' }%
- \or
- \directlua{ Babel.locale_props[\the\localeid].textdir = 'r' }%
- \or
- \directlua{ Babel.locale_props[\the\localeid].textdir = 'al' }%
- \fi
- \fi}
-\def\bbl@switchdir{%
- \bbl@ifunset{bbl@lsys@\languagename}{\bbl@provide@lsys{\languagename}}{}%
- \bbl@ifunset{bbl@wdir@\languagename}{\bbl@provide@dirs{\languagename}}{}%
- \bbl@exp{\\\bbl@setdirs\bbl@cl{wdir}}}
-\def\bbl@setdirs#1{% TODO - math
- \ifcase\bbl@select@type % TODO - strictly, not the right test
- \bbl@bodydir{#1}%
- \bbl@pardir{#1}%
+\ifx\directlua\@undefined\else
+ \ifx\bbl@luapatterns\@undefined
+ \input luababel.def
\fi
- \bbl@textdir{#1}}
-\ifodd\bbl@engine % luatex=1
- \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
- \DisableBabelHook{babel-bidi}
- \chardef\bbl@thetextdir\z@
- \chardef\bbl@thepardir\z@
- \def\bbl@getluadir#1{%
- \directlua{
- if tex.#1dir == 'TLT' then
- tex.sprint('0')
- elseif tex.#1dir == 'TRT' then
- tex.sprint('1')
- end}}
- \def\bbl@setluadir#1#2#3{% 1=text/par.. 2=\textdir.. 3=0 lr/1 rl
- \ifcase#3\relax
- \ifcase\bbl@getluadir{#1}\relax\else
- #2 TLT\relax
- \fi
- \else
- \ifcase\bbl@getluadir{#1}\relax
- #2 TRT\relax
- \fi
- \fi}
- \def\bbl@textdir#1{%
- \bbl@setluadir{text}\textdir{#1}%
- \chardef\bbl@thetextdir#1\relax
- \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}}
- \def\bbl@pardir#1{%
- \bbl@setluadir{par}\pardir{#1}%
- \chardef\bbl@thepardir#1\relax}
- \def\bbl@bodydir{\bbl@setluadir{body}\bodydir}
- \def\bbl@pagedir{\bbl@setluadir{page}\pagedir}
- \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%%
- % Sadly, we have to deal with boxes in math with basic.
- % Activated every math with the package option bidi=:
- \def\bbl@mathboxdir{%
- \ifcase\bbl@thetextdir\relax
- \everyhbox{\textdir TLT\relax}%
- \else
- \everyhbox{\textdir TRT\relax}%
- \fi}
-\else % pdftex=0, xetex=2
- \AddBabelHook{babel-bidi}{afterextras}{\bbl@switchdir}
- \DisableBabelHook{babel-bidi}
- \newcount\bbl@dirlevel
- \chardef\bbl@thetextdir\z@
- \chardef\bbl@thepardir\z@
- \def\bbl@textdir#1{%
- \ifcase#1\relax
- \chardef\bbl@thetextdir\z@
- \bbl@textdir@i\beginL\endL
- \else
- \chardef\bbl@thetextdir\@ne
- \bbl@textdir@i\beginR\endR
- \fi}
- \def\bbl@textdir@i#1#2{%
- \ifhmode
- \ifnum\currentgrouplevel>\z@
- \ifnum\currentgrouplevel=\bbl@dirlevel
- \bbl@error{Multiple bidi settings inside a group}%
- {I'll insert a new group, but expect wrong results.}%
- \bgroup\aftergroup#2\aftergroup\egroup
- \else
- \ifcase\currentgrouptype\or % 0 bottom
- \aftergroup#2% 1 simple {}
- \or
- \bgroup\aftergroup#2\aftergroup\egroup % 2 hbox
- \or
- \bgroup\aftergroup#2\aftergroup\egroup % 3 adj hbox
- \or\or\or % vbox vtop align
- \or
- \bgroup\aftergroup#2\aftergroup\egroup % 7 noalign
- \or\or\or\or\or\or % output math disc insert vcent mathchoice
- \or
- \aftergroup#2% 14 \begingroup
- \else
- \bgroup\aftergroup#2\aftergroup\egroup % 15 adj
- \fi
- \fi
- \bbl@dirlevel\currentgrouplevel
- \fi
- #1%
- \fi}
- \def\bbl@pardir#1{\chardef\bbl@thepardir#1\relax}
- \let\bbl@bodydir\@gobble
- \let\bbl@pagedir\@gobble
- \def\bbl@dirparastext{\chardef\bbl@thepardir\bbl@thetextdir}
-% \end{macrocode}
-%
-% The following command is executed only if there is a right-to-left
-% script (once). It activates the |\everypar| hack for \xetex, to
-% properly handle the par direction. Note text and par dirs are
-% decoupled to some extent (although not completely).
-%
-% \begin{macrocode}
- \def\bbl@xebidipar{%
- \let\bbl@xebidipar\relax
- \TeXXeTstate\@ne
- \def\bbl@xeeverypar{%
- \ifcase\bbl@thepardir
- \ifcase\bbl@thetextdir\else\beginR\fi
- \else
- {\setbox\z@\lastbox\beginR\box\z@}%
- \fi}%
- \let\bbl@severypar\everypar
- \newtoks\everypar
- \everypar=\bbl@severypar
- \bbl@severypar{\bbl@xeeverypar\the\everypar}}
- \def\bbl@tempb{%
- \let\bbl@textdir@i\@gobbletwo
- \let\bbl@xebidipar\@empty
- \AddBabelHook{bidi}{foreign}{%
- \def\bbl@tempa{\def\BabelText########1}%
- \ifcase\bbl@thetextdir
- \expandafter\bbl@tempa\expandafter{\BabelText{\LR{####1}}}%
- \else
- \expandafter\bbl@tempa\expandafter{\BabelText{\RL{####1}}}%
- \fi}
- \def\bbl@pardir##1{\ifcase##1\relax\setLR\else\setRL\fi}}
- \@ifpackagewith{babel}{bidi=bidi}{\bbl@tempb}{}%
- \@ifpackagewith{babel}{bidi=bidi-l}{\bbl@tempb}{}%
- \@ifpackagewith{babel}{bidi=bidi-r}{\bbl@tempb}{}%
-\fi
-% \end{macrocode}
-%
-% A tool for weak L (mainly digits). We also disable warnings with
-% \textsf{hyperref}.
-%
-% \begin{macrocode}
-\DeclareRobustCommand\babelsublr[1]{\leavevmode{\bbl@textdir\z@#1}}
-\AtBeginDocument{%
- \ifx\pdfstringdefDisableCommands\@undefined\else
- \ifx\pdfstringdefDisableCommands\relax\else
- \pdfstringdefDisableCommands{\let\babelsublr\@firstofone}%
- \fi
- \fi}
-% \end{macrocode}
-%
-% \subsection{Local Language Configuration}
-%
-% \begin{macro}{\loadlocalcfg}
-% At some sites it may be necessary to add site-specific actions to
-% a language definition file. This can be done by creating a file
-% with the same name as the language definition file, but with the
-% extension \file{.cfg}. For instance the file \file{norsk.cfg}
-% will be loaded when the language definition file \file{norsk.ldf}
-% is loaded.
-%
-% For plain-based formats we don't want to override the definition
-% of |\loadlocalcfg| from \file{plain.def}.
-%
-% \begin{macrocode}
-\bbl@trace{Local Language Configuration}
-\ifx\loadlocalcfg\@undefined
- \@ifpackagewith{babel}{noconfigs}%
- {\let\loadlocalcfg\@gobble}%
- {\def\loadlocalcfg#1{%
- \InputIfFileExists{#1.cfg}%
- {\typeout{*************************************^^J%
- * Local config file #1.cfg used^^J%
- *}}%
- \@empty}}
-\fi
-% \end{macrocode}
-%
-% Just to be compatible with \LaTeX$\:$2.09 we add a few more lines
-% of code:
-%
-% \begin{macrocode}
-\ifx\@unexpandable@protect\@undefined
- \def\@unexpandable@protect{\noexpand\protect\noexpand}
- \long\def\protected@write#1#2#3{%
- \begingroup
- \let\thepage\relax
- #2%
- \let\protect\@unexpandable@protect
- \edef\reserved@a{\write#1{#3}}%
- \reserved@a
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi}
\fi
%</core>
-%<*kernel>
-% \end{macrocode}%
-% \end{macro}
-%
-% \section{Multiple languages (\texttt{switch.def)}}
-%
-% Plain \TeX\ version~3.0 provides the primitive |\language| that
-% is used to store the current language. When used with a pre-3.0
-% version this function has to be implemented by allocating a
-% counter.
-%
-% \begin{macrocode}
-<@Make sure ProvidesFile is defined@>
-\ProvidesFile{switch.def}[<@date@> <@version@> Babel switching mechanism]
-<@Load macros for plain if not LaTeX@>
-<@Define core switching macros@>
-% \end{macrocode}
-%
-% \begin{macro}{\adddialect}
-% The macro |\adddialect| can be used to add the name of a dialect
-% or variant language, for which an already defined hyphenation
-% table can be used.
-%
-% \begin{macrocode}
-\def\bbl@version{<@version@>}
-\def\bbl@date{<@date@>}
-\def\adddialect#1#2{%
- \global\chardef#1#2\relax
- \bbl@usehooks{adddialect}{{#1}{#2}}%
- \begingroup
- \count@#1\relax
- \def\bbl@elt##1##2##3##4{%
- \ifnum\count@=##2\relax
- \bbl@info{\string#1 = using hyphenrules for ##1\\%
- (\string\language\the\count@)}%
- \def\bbl@elt####1####2####3####4{}%
- \fi}%
- \bbl@cs{languages}%
- \endgroup}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% |\bbl@iflanguage| executes code only if the language |l@|
-% exists. Otherwise raises and error.
-%
-% The argument of |\bbl@fixname| has to be a macro name, as it may get
-% ``fixed'' if casing (lc/uc) is wrong. It's intented to fix a
-% long-standing bug when |\foreignlanguage| and the like appear in
-% a |\MakeXXXcase|. However, a lowercase form is not imposed to
-% improve backward compatibility (perhaps you defined a language
-% named |MYLANG|, but unfortunately mixed case names cannot be
-% trapped). Note |l@| is encapsulated, so that its case does not
-% change.
-%
-% \begin{macrocode}
-\def\bbl@fixname#1{%
- \begingroup
- \def\bbl@tempe{l@}%
- \edef\bbl@tempd{\noexpand\@ifundefined{\noexpand\bbl@tempe#1}}%
- \bbl@tempd
- {\lowercase\expandafter{\bbl@tempd}%
- {\uppercase\expandafter{\bbl@tempd}%
- \@empty
- {\edef\bbl@tempd{\def\noexpand#1{#1}}%
- \uppercase\expandafter{\bbl@tempd}}}%
- {\edef\bbl@tempd{\def\noexpand#1{#1}}%
- \lowercase\expandafter{\bbl@tempd}}}%
- \@empty
- \edef\bbl@tempd{\endgroup\def\noexpand#1{#1}}%
- \bbl@tempd
- \bbl@usehooks{languagename}{}}
-\def\bbl@iflanguage#1{%
- \@ifundefined{l@#1}{\@nolanerr{#1}\@gobble}\@firstofone}
-% \end{macrocode}
-%
-% \begin{macro}{\iflanguage}
-% Users might want to test (in a private package for instance)
-% which language is currently active. For this we provide a test
-% macro, |\iflanguage|, that has three arguments. It checks
-% whether the first argument is a known language. If so, it
-% compares the first argument with the value of |\language|. Then,
-% depending on the result of the comparison, it executes either the
-% second or the third argument.
-%
-% \begin{macrocode}
-\def\iflanguage#1{%
- \bbl@iflanguage{#1}{%
- \ifnum\csname l@#1\endcsname=\language
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \subsection{Selecting the language}
-%
-% \begin{macro}{\selectlanguage}
-% The macro |\selectlanguage| checks whether the language is
-% already defined before it performs its actual task, which is to
-% update |\language| and activate language-specific definitions.
-%
-% To allow the call of |\selectlanguage| either with a control
-% sequence name or with a simple string as argument, we have to use
-% a trick to delete the optional escape character.
-%
-% To convert a control sequence to a string, we use the |\string|
-% primitive. Next we have to look at the first character of this
-% string and compare it with the escape character. Because this
-% escape character can be changed by setting the internal integer
-% |\escapechar| to a character number, we have to compare this
-% number with the character of the string. To do this we have to
-% use \TeX's backquote notation to specify the character as a
-% number.
-%
-% If the first character of the |\string|'ed argument is the
-% current escape character, the comparison has stripped this
-% character and the rest in the `then' part consists of the rest of
-% the control sequence name. Otherwise we know that either the
-% argument is not a control sequence or |\escapechar| is set to a
-% value outside of the character range~$0$--$255$.
-%
-% If the user gives an empty argument, we provide a default
-% argument for |\string|. This argument should expand to nothing.
-%
-% \begin{macrocode}
-\let\bbl@select@type\z@
-\edef\selectlanguage{%
- \noexpand\protect
- \expandafter\noexpand\csname selectlanguage \endcsname}
-% \end{macrocode}
-%
-% Because the command |\selectlanguage| could be used in a moving
-% argument it expands to \verb*=\protect\selectlanguage =.
-% Therefore, we have to make sure that a macro |\protect| exists.
-% If it doesn't it is |\let| to |\relax|.
-%
-% \begin{macrocode}
-\ifx\@undefined\protect\let\protect\relax\fi
-% \end{macrocode}
-%
-% As \LaTeX$\:$2.09 writes to files \textit{expanded} whereas
-% \LaTeXe\ takes care \textit{not} to expand the arguments of
-% |\write| statements we need to be a bit clever about the way we
-% add information to \file{.aux} files. Therefore we introduce the
-% macro |\xstring| which should expand to the right amount of
-% |\string|'s.
-%
-% \begin{macrocode}
-\ifx\documentclass\@undefined
- \def\xstring{\string\string\string}
-\else
- \let\xstring\string
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% Since version 3.5 \babel\ writes entries to the auxiliary files in
-% order to typeset table of contents etc. in the correct language
-% environment.
-% \begin{macro}{\bbl@pop@language}
-% \emph{But} when the language change happens \emph{inside} a group
-% the end of the group doesn't write anything to the auxiliary
-% files. Therefore we need \TeX's |aftergroup| mechanism to help
-% us. The command |\aftergroup| stores the token immediately
-% following it to be executed when the current group is closed. So
-% we define a temporary control sequence |\bbl@pop@language| to be
-% executed at the end of the group. It calls |\bbl@set@language|
-% with the name of the current language as its argument.
-%
-% \begin{macro}{\bbl@language@stack}
-% The previous solution works for one level of nesting groups, but
-% as soon as more levels are used it is no longer adequate. For
-% that case we need to keep track of the nested languages using a
-% stack mechanism. This stack is called |\bbl@language@stack| and
-% initially empty.
-%
-% \begin{macrocode}
-\def\bbl@language@stack{}
-% \end{macrocode}
-%
-% When using a stack we need a mechanism to push an element on the
-% stack and to retrieve the information afterwards.
-% \begin{macro}{\bbl@push@language}
-% \begin{macro}{\bbl@pop@language}
-% The stack is simply a list of languagenames, separated with a `+'
-% sign; the push function can be simple:
-%
-% \begin{macrocode}
-\def\bbl@push@language{%
- \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.
-% \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
-% (delimited by `-') in its third argument.
-%
-% \begin{macrocode}
-\def\bbl@pop@lang#1+#2-#3{%
- \edef\languagename{#1}\xdef#3{#2}}
-% \end{macrocode}
-%
-% \end{macro}
-% The reason for the somewhat weird arrangement of arguments to the
-% helper function is the fact it is called in the following way.
-% This means that before |\bbl@pop@lang| is executed \TeX\ first
-% \emph{expands} the stack, stored in |\bbl@language@stack|. The
-% result of that is that the argument string of |\bbl@pop@lang|
-% contains one or more language names, each followed by a `+'-sign
-% (zero language names won't occur as this macro will only be
-% called after something has been pushed on the stack) followed by
-% the `-'-sign and finally the reference to the stack.
-%
-% \begin{macrocode}
-\let\bbl@ifrestoring\@secondoftwo
-\def\bbl@pop@language{%
- \expandafter\bbl@pop@lang\bbl@language@stack-\bbl@language@stack
- \let\bbl@ifrestoring\@firstoftwo
- \expandafter\bbl@set@language\expandafter{\languagename}%
- \let\bbl@ifrestoring\@secondoftwo}
-% \end{macrocode}
-%
-% Once the name of the previous language is retrieved from the stack,
-% it is fed to |\bbl@set@language| to do the actual work of
-% switching everything that needs switching.
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% An alternative way to identify languages (in the \babel{} sense)
-% with a numerical value is introduced in 3.30. This is one of the
-% first steps for a new interface based on the concept of locale,
-% which explains the name of |\localeid|. This means |\l@...| will be
-% reserved for hyphenation patterns.
-%
-% \begin{macrocode}
-\chardef\localeid\z@
-\def\bbl@id@last{0} % No real need for a new counter
-\def\bbl@id@assign{%
- \bbl@ifunset{bbl@id@@\languagename}%
- {\count@\bbl@id@last\relax
- \advance\count@\@ne
- \bbl@csarg\chardef{id@@\languagename}\count@
- \edef\bbl@id@last{\the\count@}%
- \ifcase\bbl@engine\or
- \directlua{
- Babel = Babel or {}
- Babel.locale_props = Babel.locale_props or {}
- Babel.locale_props[\bbl@id@last] = {}
- Babel.locale_props[\bbl@id@last].name = '\languagename'
- }%
- \fi}%
- {}%
- \chardef\localeid\bbl@cl{id@}}
-% \end{macrocode}
-%
-% The unprotected part of |\selectlanguage|.
-%
-% \begin{macrocode}
-\expandafter\def\csname selectlanguage \endcsname#1{%
- \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\tw@\fi
- \bbl@push@language
- \aftergroup\bbl@pop@language
- \bbl@set@language{#1}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\bbl@set@language}
-%
-% The macro |\bbl@set@language| takes care of switching the language
-% environment \emph{and} of writing entries on the auxiliary files.
-% For historial reasons, language names can be either |language| of
-% |\language|. To catch either form a trick is used, but
-% unfortunately as a side effect the catcodes of letters in
-% |\languagename| are messed up. This is a bug, but preserved for
-% backwards compatibility. The list of auxiliary files can be
-% extended by redefining |\BabelContentsFiles|, but make sure they
-% are loaded inside a group (as |aux|, |toc|, |lof|, and |lot| do)
-% or the last language of the document will remain active
-% afterwards.
-%
-% We also write a command to change the current language in the
-% auxiliary files.
-%
-% \begin{macrocode}
-\def\BabelContentsFiles{toc,lof,lot}
-\def\bbl@set@language#1{% from selectlanguage, pop@
- \edef\languagename{%
- \ifnum\escapechar=\expandafter`\string#1\@empty
- \else\string#1\@empty\fi}%
- \select@language{\languagename}%
- % write to auxs
- \expandafter\ifx\csname date\languagename\endcsname\relax\else
- \if@filesw
- \ifx\babel@aux\@gobbletwo\else % Set if single in the first, redundant
- \protected@write\@auxout{}{\string\babel@aux{\languagename}{}}%
- \fi
- \bbl@usehooks{write}{}%
- \fi
- \fi}
-\def\select@language#1{% from set@, babel@aux
- % set hymap
- \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
- % set name
- \edef\languagename{#1}%
- \bbl@fixname\languagename
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \IfFileExists{babel-\languagename.tex}%
- {\babelprovide{\languagename}}%
- {}%
- \fi
- \bbl@iflanguage\languagename{%
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \bbl@error
- {Unknown language `#1'. Either you have\\%
- misspelled its name, it has not been installed,\\%
- or you requested it in a previous run. Fix its name,\\%
- install it or just rerun the file, respectively. In\\%
- some cases, you may need to remove the aux file}%
- {You may proceed, but expect wrong results}%
- \else
- % set type
- \let\bbl@select@type\z@
- \expandafter\bbl@switch\expandafter{\languagename}%
- \fi}}
-\def\babel@aux#1#2{%
- \select@language{#1}%
- \bbl@foreach\BabelContentsFiles{%
- \@writefile{##1}{\babel@toc{#1}{#2}}}}% %% TODO - ok in plain?
-\def\babel@toc#1#2{%
- \select@language{#1}}
-% \end{macrocode}
-%
-% A bit of optimization. Select in heads/foots the language only if
-% necessary. The real thing is in \texttt{babel.def}.
-%
-% \begin{macrocode}
-\let\select@language@x\select@language
-% \end{macrocode}
-%
-% \end{macro}
-%
-% First, check if the user asks for a known language. If so,
-% update the value of |\language| and call |\originalTeX|
-% to bring \TeX\ in a certain pre-defined state.
-%
-% The name of the language is stored in the control sequence
-% |\languagename|.
-%
-% Then we have to \emph{re}define |\originalTeX| to compensate for
-% the things that have been activated. To save memory space for
-% the macro definition of |\originalTeX|, we construct the control
-% sequence name for the |\noextras|\langvar\ command at definition
-% time by expanding the |\csname| primitive.
-%
-% Now activate the language-specific definitions. This is done by
-% constructing the names of three macros by concatenating three
-% words with the argument of |\selectlanguage|, and calling these
-% macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
-% temporarily |\set@hyphenmins| and hyphenation. It can be done in
-% hooks if necessary.}
-%
-% The switching of the values of |\lefthyphenmin| and
-% |\righthyphenmin| is somewhat different. First we save their
-% current values, then we check if |\|\langvar|hyphenmins| is
-% defined. If it is not, we set default values (2 and 3), otherwise
-% the values in |\|\langvar|hyphenmins| will be used.
-%
-% \begin{macrocode}
-\newif\ifbbl@usedategroup
-\def\bbl@switch#1{% from select@, foreign@
- % make sure there is info for the language if so requested
- \bbl@ensureinfo{#1}%
- % restore
- \originalTeX
- \expandafter\def\expandafter\originalTeX\expandafter{%
- \csname noextras#1\endcsname
- \let\originalTeX\@empty
- \babel@beginsave}%
- \bbl@usehooks{afterreset}{}%
- \languageshorthands{none}%
- % set the locale id
- \bbl@id@assign
- % switch captions, date
- \ifcase\bbl@select@type
- \ifhmode
- \hskip\z@skip % trick to ignore spaces
- \csname captions#1\endcsname\relax
- \csname date#1\endcsname\relax
- \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
- \else
- \csname captions#1\endcsname\relax
- \csname date#1\endcsname\relax
- \fi
- \else
- \ifbbl@usedategroup % if \foreign... within \<lang>date
- \bbl@usedategroupfalse
- \ifhmode
- \hskip\z@skip % trick to ignore spaces
- \csname date#1\endcsname\relax
- \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
- \else
- \csname date#1\endcsname\relax
- \fi
- \fi
- \fi
- % switch extras
- \bbl@usehooks{beforeextras}{}%
- \csname extras#1\endcsname\relax
- \bbl@usehooks{afterextras}{}%
- % > babel-ensure
- % > babel-sh-<short>
- % > babel-bidi
- % > babel-fontspec
- % hyphenation - case mapping
- \ifcase\bbl@opt@hyphenmap\or
- \def\BabelLower##1##2{\lccode##1=##2\relax}%
- \ifnum\bbl@hymapsel>4\else
- \csname\languagename @bbl@hyphenmap\endcsname
- \fi
- \chardef\bbl@opt@hyphenmap\z@
- \else
- \ifnum\bbl@hymapsel>\bbl@opt@hyphenmap\else
- \csname\languagename @bbl@hyphenmap\endcsname
- \fi
- \fi
- \global\let\bbl@hymapsel\@cclv
- % hyphenation - patterns
- \bbl@patterns{#1}%
- % hyphenation - mins
- \babel@savevariable\lefthyphenmin
- \babel@savevariable\righthyphenmin
- \expandafter\ifx\csname #1hyphenmins\endcsname\relax
- \set@hyphenmins\tw@\thr@@\relax
- \else
- \expandafter\expandafter\expandafter\set@hyphenmins
- \csname #1hyphenmins\endcsname\relax
- \fi}
-% \end{macrocode}
-%
-% \begin{environment}{otherlanguage}
-% The \Lenv{otherlanguage} environment can be used as an
-% alternative to using the |\selectlanguage| declarative
-% command. When you are typesetting a document which mixes
-% left-to-right and right-to-left typesetting you have to use this
-% environment in order to let things work as you expect them to.
-%
-% The |\ignorespaces| command is necessary to hide the environment
-% when it is entered in horizontal mode.
-%
-% \begin{macrocode}
-\long\def\otherlanguage#1{%
- \ifnum\bbl@hymapsel=\@cclv\let\bbl@hymapsel\thr@@\fi
- \csname selectlanguage \endcsname{#1}%
- \ignorespaces}
-% \end{macrocode}
-%
-% The |\endotherlanguage| part of the environment tries to hide
-% itself when it is called in horizontal mode.
-%
-% \begin{macrocode}
-\long\def\endotherlanguage{%
- \global\@ignoretrue\ignorespaces}
-% \end{macrocode}
-%
-% \end{environment}
-%
-% \begin{environment}{otherlanguage*}
-% The \Lenv{otherlanguage} environment is meant to be used when a
-% large part of text from a different language needs to be typeset,
-% but without changing the translation of words such as `figure'.
-% This environment makes use of |\foreign@language|.
-%
-% \begin{macrocode}
-\expandafter\def\csname otherlanguage*\endcsname#1{%
- \ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
- \foreign@language{#1}}
-% \end{macrocode}
-%
-% At the end of the environment we need to switch off the extra
-% definitions. The grouping mechanism of the environment will take
-% care of resetting the correct hyphenation rules and ``extras''.
-%
-% \begin{macrocode}
-\expandafter\let\csname endotherlanguage*\endcsname\relax
-% \end{macrocode}
-%
-% \end{environment}
-%
-% \begin{macro}{\foreignlanguage}
-% The |\foreignlanguage| command is another substitute for the
-% |\selectlanguage| command. This command takes two arguments, the
-% first argument is the name of the language to use for typesetting
-% the text specified in the second argument.
-%
-% Unlike |\selectlanguage| this command doesn't switch
-% \emph{everything}, it only switches the hyphenation rules and the
-% extra definitions for the language specified. It does this within
-% a group and assumes the |\extras|\langvar\ command doesn't make
-% any |\global| changes. The coding is very similar to part of
-% |\selectlanguage|.
-%
-% |\bbl@beforeforeign| is a trick to fix a bug in bidi
-% texts. |\foreignlanguage| is supposed to be a `text' command, and
-% therefore it must emit a |\leavevmode|, but it does not, and
-% therefore the indent is placed on the opposite margin. For
-% backward compatibility, however, it is done only if a
-% right-to-left script is requested; otherwise, it is no-op.
-%
-% (3.11) |\foreignlanguage*| is a temporary, experimental macro for
-% a few lines with a different script direction, while preserving
-% the paragraph format (thank the braces around |\par|, things like
-% |\hangindent| are not reset). Do not use it in production,
-% because its semantics and its syntax may change (and very likely
-% will, or even it could be removed altogether). Currently it
-% enters in vmode and then selects the language (which in turn sets the
-% paragraph direction).
-%
-% (3.11) Also experimental are the hook |foreign| and
-% |foreign*|. With them you can redefine |\BabelText| which by
-% default does nothing. Its
-% behavior is not well defined yet. So, use it in
-% horizontal mode only if you do not want surprises.
-%
-% In other words, at the beginning of a paragraph |\foreignlanguage|
-% enters into hmode with the surrounding lang, and with
-% |\foreignlanguage*| with the new lang.
-%
-% \begin{macrocode}
-\providecommand\bbl@beforeforeign{}
-\edef\foreignlanguage{%
- \noexpand\protect
- \expandafter\noexpand\csname foreignlanguage \endcsname}
-\expandafter\def\csname foreignlanguage \endcsname{%
- \@ifstar\bbl@foreign@s\bbl@foreign@x}
-\def\bbl@foreign@x#1#2{%
- \begingroup
- \let\BabelText\@firstofone
- \bbl@beforeforeign
- \foreign@language{#1}%
- \bbl@usehooks{foreign}{}%
- \BabelText{#2}% Now in horizontal mode!
- \endgroup}
-\def\bbl@foreign@s#1#2{% TODO - \shapemode, \@setpar, ?\@@par
- \begingroup
- {\par}%
- \let\BabelText\@firstofone
- \foreign@language{#1}%
- \bbl@usehooks{foreign*}{}%
- \bbl@dirparastext
- \BabelText{#2}% Still in vertical mode!
- {\par}%
- \endgroup}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\foreign@language}
-% This macro does the
-% work for |\foreignlanguage| and the \Lenv{otherlanguage*}
-% environment. First we need to store the name of the language and
-% check that it is a known language. Then it just calls
-% |bbl@switch|.
-%
-% \begin{macrocode}
-\def\foreign@language#1{%
- % set name
- \edef\languagename{#1}%
- \bbl@fixname\languagename
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \IfFileExists{babel-\languagename.tex}%
- {\babelprovide{\languagename}}%
- {}%
- \fi
- \bbl@iflanguage\languagename{%
- \expandafter\ifx\csname date\languagename\endcsname\relax
- \bbl@warning % TODO - why a warning, not an error?
- {Unknown language `#1'. Either you have\\%
- misspelled its name, it has not been installed,\\%
- or you requested it in a previous run. Fix its name,\\%
- install it or just rerun the file, respectively. In\\%
- some cases, you may need to remove the aux file.\\%
- I'll proceed, but expect wrong results.\\%
- Reported}%
- \fi
- % set type
- \let\bbl@select@type\@ne
- \expandafter\bbl@switch\expandafter{\languagename}}}
% \end{macrocode}
%
-% \end{macro}
-%
-% \begin{macro}{\bbl@patterns}
-%
-% This macro selects the hyphenation patterns by changing the
-% \cs{language} register. If special hyphenation patterns
-% are available specifically for the current font encoding,
-% use them instead of the default.
-%
-% It also sets hyphenation exceptions, but only once, because they
-% are global (here language |\lccode|'s has been set,
-% too). |\bbl@hyphenation@| is set to relax until the very first
-% |\babelhyphenation|, so do nothing with this value. If the
-% exceptions for a language (by its number, not its name, so that
-% |:ENC| is taken into account) has been set, then use
-% |\hyphenation| with both global and language exceptions and empty
-% the latter to mark they must not be set again.
+% A proxy file for switch.def
%
% \begin{macrocode}
-\let\bbl@hyphlist\@empty
-\let\bbl@hyphenation@\relax
-\let\bbl@pttnlist\@empty
-\let\bbl@patterns@\relax
-\let\bbl@hymapsel=\@cclv
-\def\bbl@patterns#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
- \@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}%
- % > luatex
- \@ifundefined{bbl@hyphenation@}{}{% Can be \relax!
- \begingroup
- \bbl@xin@{,\number\language,}{,\bbl@hyphlist}%
- \ifin@\else
- \@expandtwoargs\bbl@usehooks{hyphenation}{{#1}{\bbl@tempa}}%
- \hyphenation{%
- \bbl@hyphenation@
- \@ifundefined{bbl@hyphenation@#1}%
- \@empty
- {\space\csname bbl@hyphenation@#1\endcsname}}%
- \xdef\bbl@hyphlist{\bbl@hyphlist\number\language,}%
- \fi
- \endgroup}}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{environment}{hyphenrules}
-% The environment \Lenv{hyphenrules} can be used to select
-% \emph{just} the hyphenation rules. This environment does
-% \emph{not} change |\languagename| and when the hyphenation rules
-% specified were not loaded it has no effect. Note however,
-% |\lccode|'s and font encodings are not set at all, so in most
-% cases you should use |otherlanguage*|.
-%
-% \begin{macrocode}
-\def\hyphenrules#1{%
- \edef\bbl@tempf{#1}%
- \bbl@fixname\bbl@tempf
- \bbl@iflanguage\bbl@tempf{%
- \expandafter\bbl@patterns\expandafter{\bbl@tempf}%
- \languageshorthands{none}%
- \expandafter\ifx\csname\bbl@tempf hyphenmins\endcsname\relax
- \set@hyphenmins\tw@\thr@@\relax
- \else
- \expandafter\expandafter\expandafter\set@hyphenmins
- \csname\bbl@tempf hyphenmins\endcsname\relax
- \fi}}
-\let\endhyphenrules\@empty
-% \end{macrocode}
-%
-% \end{environment}
-%
-% \begin{macro}{\providehyphenmins}
-% The macro |\providehyphenmins| should be used in the language
-% definition files to provide a \emph{default} setting for the
-% hyphenation parameters |\lefthyphenmin| and |\righthyphenmin|. If
-% the macro |\|\langvar|hyphenmins| is already defined this command
-% has no effect.
-%
-% \begin{macrocode}
-\def\providehyphenmins#1#2{%
- \expandafter\ifx\csname #1hyphenmins\endcsname\relax
- \@namedef{#1hyphenmins}{#2}%
- \fi}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\set@hyphenmins}
-% This macro sets the values of |\lefthyphenmin| and
-% |\righthyphenmin|. It expects two values as its argument.
-%
-% \begin{macrocode}
-\def\set@hyphenmins#1#2{%
- \lefthyphenmin#1\relax
- \righthyphenmin#2\relax}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\ProvidesLanguage}
-% The identification code for each file is something that was
-% introduced in \LaTeXe. When the command |\ProvidesFile| does not
-% exist, a dummy definition is provided temporarily. For use in the
-% language definition file the command |\ProvidesLanguage| is
-% defined by \babel.
-%
-% Depending on the format, ie, on if the former is defined, we use
-% a similar definition or not.
-%
-% \begin{macrocode}
-\ifx\ProvidesFile\@undefined
- \def\ProvidesLanguage#1[#2 #3 #4]{%
- \wlog{Language: #1 #4 #3 <#2>}%
- }
-\else
- \def\ProvidesLanguage#1{%
- \begingroup
- \catcode`\ 10 %
- \@makeother\/%
- \@ifnextchar[%]
- {\@provideslanguage{#1}}{\@provideslanguage{#1}[]}}
- \def\@provideslanguage#1[#2]{%
- \wlog{Language: #1 #2}%
- \expandafter\xdef\csname ver@#1.ldf\endcsname{#2}%
- \endgroup}
-\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\LdfInit}
-% This macro is defined in two versions. The first version is to be
-% part of the `kernel' of \babel, ie. the part that is loaded in
-% the format; the second version is defined in \file{babel.def}.
-% The version in the format just checks the category code of the
-% ampersand and then loads \file{babel.def}.
-%
-% The category code of the ampersand is restored and the macro
-% calls itself again with the new definition from
-% \file{babel.def}
-%
-% \begin{macrocode}
-\def\LdfInit{%
- \chardef\atcatcode=\catcode`\@
- \catcode`\@=11\relax
- \input babel.def\relax
- \catcode`\@=\atcatcode \let\atcatcode\relax
- \LdfInit}
-% \end{macrocode}
-%
-% \end{macro}
-%
-% \begin{macro}{\originalTeX}
-% The macro|\originalTeX| should be known to \TeX\ at this moment.
-% As it has to be expandable we |\let| it to |\@empty| instead of
-% |\relax|.
-%
-% \begin{macrocode}
-\ifx\originalTeX\@undefined\let\originalTeX\@empty\fi
-% \end{macrocode}
-%
-% Because this part of the code can be included in a format, we
-% make sure that the macro which initialises the save mechanism,
-% |\babel@beginsave|, is not considered to be undefined.
-%
-% \begin{macrocode}
-\ifx\babel@beginsave\@undefined\let\babel@beginsave\relax\fi
-% \end{macrocode}
-%
-% \end{macro}
-%
-% A few macro names are reserved for future releases of \babel, which
-% will use the concept of `locale':
-%
-% \begin{macrocode}
-\providecommand\setlocale{%
- \bbl@error
- {Not yet available}%
- {Find an armchair, sit down and wait}}
-\let\uselocale\setlocale
-\let\locale\setlocale
-\let\selectlocale\setlocale
-\let\localename\setlocale
-\let\textlocale\setlocale
-\let\textlanguage\setlocale
-\let\languagetext\setlocale
-% \end{macrocode}
-%
-% \subsection{Errors}
-%
-% \begin{macro}{\@nolanerr}
-% \begin{macro}{\@nopatterns}
-% The \babel\ package will signal an error when a documents tries
-% to select a language that hasn't been defined earlier. When a
-% user selects a language for which no hyphenation patterns were
-% loaded into the format he will be given a warning about that
-% fact. We revert to the patterns for |\language|=0 in that case.
-% In most formats that will be (US)english, but it might also be
-% empty.
-% \begin{macro}{\@noopterr}
-% When the package was loaded without options not everything will
-% work as expected. An error message is issued in that case.
-%
-% When the format knows about |\PackageError| it must be \LaTeXe,
-% so we can safely use its error handling interface. Otherwise
-% we'll have to `keep it simple'.
-%
-% Infos are not written to the console, but on the other hand many
-% people think warnings are errors, so a further message type is
-% defined: an important info which is sent to the console.
-%
-% \begin{macrocode}
-\edef\bbl@nulllanguage{\string\language=0}
-\ifx\PackageError\@undefined
- \def\bbl@error#1#2{%
- \begingroup
- \newlinechar=`\^^J
- \def\\{^^J(babel) }%
- \errhelp{#2}\errmessage{\\#1}%
- \endgroup}
- \def\bbl@warning#1{%
- \begingroup
- \newlinechar=`\^^J
- \def\\{^^J(babel) }%
- \message{\\#1}%
- \endgroup}
- \let\bbl@infowarn\bbl@warning
- \def\bbl@info#1{%
- \begingroup
- \newlinechar=`\^^J
- \def\\{^^J}%
- \wlog{#1}%
- \endgroup}
-\else
- \def\bbl@error#1#2{%
- \begingroup
- \def\\{\MessageBreak}%
- \PackageError{babel}{#1}{#2}%
- \endgroup}
- \def\bbl@warning#1{%
- \begingroup
- \def\\{\MessageBreak}%
- \PackageWarning{babel}{#1}%
- \endgroup}
- \def\bbl@infowarn#1{%
- \begingroup
- \def\\{\MessageBreak}%
- \GenericWarning
- {(babel) \@spaces\@spaces\@spaces}%
- {Package babel Info: #1}%
- \endgroup}
- \def\bbl@info#1{%
- \begingroup
- \def\\{\MessageBreak}%
- \PackageInfo{babel}{#1}%
- \endgroup}
-\fi
-\@ifpackagewith{babel}{silent}
- {\let\bbl@info\@gobble
- \let\bbl@infowarn\@gobble
- \let\bbl@warning\@gobble}
- {}
-\def\bbl@nocaption{\protect\bbl@nocaption@i}
-\def\bbl@nocaption@i#1#2{% 1: text to be printed 2: caption macro \langXname
- \global\@namedef{#2}{\textbf{?#1?}}%
- \@nameuse{#2}%
- \bbl@warning{%
- \@backslashchar#2 not set. Please, define\\%
- it in the preamble with something like:\\%
- \string\renewcommand\@backslashchar#2{..}\\%
- Reported}}
-\def\bbl@tentative{\protect\bbl@tentative@i}
-\def\bbl@tentative@i#1{%
- \bbl@warning{%
- Some functions for '#1' are tentative.\\%
- They might not work as expected and their behavior\\%
- could change in the future.\\%
- Reported}}
-\def\@nolanerr#1{%
- \bbl@error
- {You haven't defined the language #1\space yet.\\%
- Perhaps you misspelled it or your installation\\%
- is not complete}%
- {Your command will be ignored, type <return> to proceed}}
-\def\@nopatterns#1{%
- \bbl@warning
- {No hyphenation patterns were preloaded for\\%
- the language `#1' into the format.\\%
- Please, configure your TeX system to add them and\\%
- rebuild the format. Now I will use the patterns\\%
- preloaded for \bbl@nulllanguage\space instead}}
-\let\bbl@usehooks\@gobbletwo
+%<*kernel>
+\let\bbl@onlyswitch\@empty
+\input babel.def
+\let\bbl@onlyswitch\@undefined
%</kernel>
%<*patterns>
% \end{macrocode}
@@ -10983,60 +11074,31 @@ help from Bernd Raichle, for which I am grateful.
%
% \section{Loading hyphenation patterns}
%
-% The following code is meant to be read by ini\TeX\ because it
-% should instruct \TeX\ to read hyphenation patterns. To this end the
-% \texttt{docstrip} option \texttt{patterns} can be used to include
-% this code in the file \file{hyphen.cfg}. Code is written with lower
-% level macros.
+% The following code is meant to be read by ini\TeX\ because it
+% should instruct \TeX\ to read hyphenation patterns. To this end the
+% \texttt{docstrip} option \texttt{patterns} can be used to include
+% this code in the file \file{hyphen.cfg}. Code is written with lower
+% level macros.
%
-% We want to add a message to the message \LaTeX$\:$2.09 puts in
-% the |\everyjob| register. This could be done by the following
-% code:
-%\begin{verbatim}
-% \let\orgeveryjob\everyjob
-% \def\everyjob#1{%
-% \orgeveryjob{#1}%
-% \orgeveryjob\expandafter{\the\orgeveryjob\immediate\write16{%
-% hyphenation patterns for \the\loaded@patterns loaded.}}%
-% \let\everyjob\orgeveryjob\let\orgeveryjob\@undefined}
-%\end{verbatim}
-% The code above redefines the control sequence \cs{everyjob}
-% in order to be able to add something to the current contents of
-% the register. This is necessary because the processing of
-% hyphenation patterns happens long before \LaTeX\ fills the
-% register.
-%
-% There are some problems with this approach though.
-% \begin{itemize}
-% \item When someone wants to use several hyphenation patterns with
-% \SliTeX\ the above scheme won't work. The reason is that \SliTeX\
-% overwrites the contents of the |\everyjob| register with its own
-% message.
-% \item Plain \TeX\ does not use the |\everyjob| register so the
-% message would not be displayed.
-% \end{itemize}
-% To circumvent this a `dirty trick' can be used. As this code is
-% only processed when creating a new format file there is one
-% command that is sure to be used, |\dump|. Therefore the original
-% |\dump| is saved in |\org@dump| and a new definition is supplied.
-%
-% To make sure that \LaTeX$\:$2.09 executes the
-% |\@begindocumenthook| we would want to alter |\begin{document}|,
-% but as this done too often already, we add the new code at the
-% front of |\@preamblecmds|. But we can only do that after it has
-% been defined, so we add this piece of code to |\dump|.
-%
-% This new definition starts by adding an instruction to write a
-% message on the terminal and in the transcript file to inform the
-% user of the preloaded hyphenation patterns.
-%
-% Then everything is restored to the old situation and the format
-% is dumped.
+% To make sure that \LaTeX$\:$2.09 executes the |\@begindocumenthook|
+% we would want to alter |\begin{document}|, but as this done too often
+% already, we add the new code at the front of |\@preamblecmds|. But we
+% can only do that after it has been defined, so we add this piece of
+% code to |\dump|.
+%
+% This new definition starts by adding an instruction to write a
+% message on the terminal and in the transcript file to inform the
+% user of the preloaded hyphenation patterns.
+%
+% Then everything is restored to the old situation and the format
+% is dumped.
%
% \begin{macrocode}
<@Make sure ProvidesFile is defined@>
\ProvidesFile{hyphen.cfg}[<@date@> <@version@> Babel hyphens]
\xdef\bbl@format{\jobname}
+\def\bbl@version{<@version@>}
+\def\bbl@date{<@date@>}
\ifx\AtBeginDocument\@undefined
\def\@empty{}
\let\orig@dump\dump
@@ -11074,9 +11136,9 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macro}{\process@synonym}
%
-% This macro takes care of the lines which start with an
-% \texttt{=}. It needs an empty token register to begin with.
-% |\bbl@languages| is also set to empty.
+% This macro takes care of the lines which start with an
+% \texttt{=}. It needs an empty token register to begin with.
+% |\bbl@languages| is also set to empty.
%
% \begin{macrocode}
\toks@{}
@@ -11109,55 +11171,56 @@ help from Bernd Raichle, for which I am grateful.
%
% \end{macro}
%
-% \begin{macro}{\process@language}
-% The macro |\process@language| is used to process a non-empty line
-% from the `configuration file'. It has three arguments, each
-% delimited by white space. The first argument is the `name' of a
-% language; the second is the name of the file that contains the
-% patterns. The optional third argument is the name of a file
-% containing hyphenation exceptions.
-%
-% The first thing to do is call |\addlanguage| to allocate a pattern
-% register and to make that register `active'. Then the pattern file
-% is read.
-%
-% For some hyphenation patterns it is needed to load them with a
-% specific font encoding selected. This can be specified in the
-% file \file{language.dat} by adding for instance `\texttt{:T1}' to
-% the name of the language. The macro |\bbl@get@enc| extracts the
-% font encoding from the language name and stores it in
-% |\bbl@hyph@enc|. The latter can be used in hyphenation files if
-% you need to set a behavior depending on the given encoding (it
-% is set to empty if no encoding is given).
-%
-% Pattern files may contain assignments to |\lefthyphenmin| and
-% |\righthyphenmin|. \TeX\ does not keep track of these
-% assignments. Therefore we try to detect such assignments and
-% store them in the |\|\langvar|hyphenmins| macro. When no
-% assignments were made we provide a default setting.
-%
-% Some pattern files contain changes to the |\lccode| en |\uccode|
-% arrays. Such changes should remain local to the language;
-% therefore we process the pattern file in a group; the |\patterns|
-% command acts globally so its effect will be remembered.
-%
-% Then we globally store the settings of |\lefthyphenmin| and
-% |\righthyphenmin| and close the group.
-%
-% When the hyphenation patterns have been processed we need to see
-% if a file with hyphenation exceptions needs to be read. This is
-% the case when the third argument is not empty and when it does
-% not contain a space token. (Note however there is no need to save
-% hyphenation exceptions into the format.)
-%
-% \cs{bbl@languages} saves a snapshot of the loaded languages in the
-% form \cs{bbl@elt}\marg{language-name}\marg{number}%
-% \marg{patterns-file}\marg{exceptions-file}. Note the last 2
-% arguments are empty in `dialects' defined in |language.dat| with
-% |=|. Note also the language name can have encoding info.
-%
-% Finally, if the counter |\language| is equal to zero we execute the
-% synonyms stored.
+% \begin{macro}{\process@language}
+%
+% The macro |\process@language| is used to process a non-empty line
+% from the `configuration file'. It has three arguments, each
+% delimited by white space. The first argument is the `name' of a
+% language; the second is the name of the file that contains the
+% patterns. The optional third argument is the name of a file
+% containing hyphenation exceptions.
+%
+% The first thing to do is call |\addlanguage| to allocate a pattern
+% register and to make that register `active'. Then the pattern file
+% is read.
+%
+% For some hyphenation patterns it is needed to load them with a
+% specific font encoding selected. This can be specified in the
+% file \file{language.dat} by adding for instance `\texttt{:T1}' to
+% the name of the language. The macro |\bbl@get@enc| extracts the
+% font encoding from the language name and stores it in
+% |\bbl@hyph@enc|. The latter can be used in hyphenation files if
+% you need to set a behavior depending on the given encoding (it
+% is set to empty if no encoding is given).
+%
+% Pattern files may contain assignments to |\lefthyphenmin| and
+% |\righthyphenmin|. \TeX\ does not keep track of these
+% assignments. Therefore we try to detect such assignments and
+% store them in the |\|\langvar|hyphenmins| macro. When no
+% assignments were made we provide a default setting.
+%
+% Some pattern files contain changes to the |\lccode| en |\uccode|
+% arrays. Such changes should remain local to the language;
+% therefore we process the pattern file in a group; the |\patterns|
+% command acts globally so its effect will be remembered.
+%
+% Then we globally store the settings of |\lefthyphenmin| and
+% |\righthyphenmin| and close the group.
+%
+% When the hyphenation patterns have been processed we need to see
+% if a file with hyphenation exceptions needs to be read. This is
+% the case when the third argument is not empty and when it does
+% not contain a space token. (Note however there is no need to save
+% hyphenation exceptions into the format.)
+%
+% \cs{bbl@languages} saves a snapshot of the loaded languages in the
+% form \cs{bbl@elt}\marg{language-name}\marg{number}%
+% \marg{patterns-file}\marg{exceptions-file}. Note the last 2
+% arguments are empty in `dialects' defined in |language.dat| with
+% |=|. Note also the language name can have encoding info.
+%
+% Finally, if the counter |\language| is equal to zero we execute the
+% synonyms stored.
%
% \begin{macrocode}
\def\process@language#1#2#3{%
@@ -11197,30 +11260,69 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% \begin{macro}{\bbl@get@enc}
+% \begin{macro}{\bbl@get@enc}
%
-% \begin{macro}{\bbl@hyph@enc}
-% The macro |\bbl@get@enc| extracts the font encoding from the
-% language name and stores it in |\bbl@hyph@enc|. It uses delimited
-% arguments to achieve this.
+% \begin{macro}{\bbl@hyph@enc}
+% The macro |\bbl@get@enc| extracts the font encoding from the
+% language name and stores it in |\bbl@hyph@enc|. It uses delimited
+% arguments to achieve this.
%
% \begin{macrocode}
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
% \end{macrocode}
%
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% Now, hooks are defined. For efficiency reasons, they are dealt
-% here in a special way. Besides \luatex, format-specific
-% configuration files are taken into account.
+% Now, hooks are defined. For efficiency reasons, they are dealt
+% here in a special way. Besides \luatex, format-specific
+% configuration files are taken into account. |loadkernel| currently
+% loads nothing, but define some basic macros instead.
%
% \begin{macrocode}
\def\bbl@hook@everylanguage#1{}
\def\bbl@hook@loadpatterns#1{\input #1\relax}
\let\bbl@hook@loadexceptions\bbl@hook@loadpatterns
-\let\bbl@hook@loadkernel\bbl@hook@loadpatterns
+\def\bbl@hook@loadkernel#1{%
+ \def\addlanguage{\alloc@9\language\chardef\@cclvi}%
+ \def\adddialect##1##2{%
+ \global\chardef##1##2\relax
+ \wlog{\string##1 = a dialect from \string\language##2}}%
+ \def\iflanguage##1{%
+ \expandafter\ifx\csname l@##1\endcsname\relax
+ \@nolanerr{##1}%
+ \else
+ \ifnum\csname l@##1\endcsname=\language
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \fi}%
+ \def\providehyphenmins##1##2{%
+ \expandafter\ifx\csname ##1hyphenmins\endcsname\relax
+ \@namedef{##1hyphenmins}{##2}%
+ \fi}%
+ \def\set@hyphenmins##1##2{%
+ \lefthyphenmin##1\relax
+ \righthyphenmin##2\relax}%
+ \def\selectlanguage{%
+ \errhelp{Selecting a language requires a package supporting it}%
+ \errmessage{Not loaded}}%
+ \let\foreignlanguage\selectlanguage
+ \let\otherlanguage\selectlanguage
+ \expandafter\let\csname otherlanguage*\endcsname\selectlanguage
+ \def\bbl@usehooks##1##2{}% TODO. Temporary!!
+ \def\setlocale{%
+ \errhelp{Find an armchair, sit down and wait}%
+ \errmessage{Not yet available}}%
+ \let\uselocale\setlocale
+ \let\locale\setlocale
+ \let\selectlocale\setlocale
+ \let\localename\setlocale
+ \let\textlocale\setlocale
+ \let\textlanguage\setlocale
+ \let\languagetext\setlocale}
\begingroup
\def\AddBabelHook#1#2{%
\expandafter\ifx\csname bbl@hook@#2\endcsname\relax
@@ -11266,28 +11368,24 @@ help from Bernd Raichle, for which I am grateful.
\else
% \end{macrocode}
%
-% Pattern registers are allocated using count register
-% |\last@language|. Its initial value is~0. The definition of the
-% macro |\newlanguage| is such that it first increments the count
-% register and then defines the language. In order to have the
-% first patterns loaded in pattern register number~0 we initialize
-% |\last@language| with the value~$-1$.
+% Pattern registers are allocated using count register
+% |\last@language|. Its initial value is~0. The definition of the
+% macro |\newlanguage| is such that it first increments the count
+% register and then defines the language. In order to have the
+% first patterns loaded in pattern register number~0 we initialize
+% |\last@language| with the value~$-1$.
%
% \begin{macrocode}
\last@language\m@ne
% \end{macrocode}
%
-% We now read lines from the file until the end is found
+% We now read lines from the file until the end is found. While
+% reading from the input, it is useful to switch off recognition of
+% the end-of-line character. This saves us stripping off spaces from
+% the contents of the control sequence.
%
% \begin{macrocode}
\loop
-% \end{macrocode}
-%
-% While reading from the input, it is useful to switch off
-% recognition of the end-of-line character. This saves us stripping
-% off spaces from the contents of the control sequence.
-%
-% \begin{macrocode}
\endlinechar\m@ne
\read1 to \bbl@line
\endlinechar`\^^M
@@ -11308,8 +11406,9 @@ help from Bernd Raichle, for which I am grateful.
\repeat
% \end{macrocode}
%
-% Check for the end of the file. We must reverse the test for
-% |\ifeof| without |\else|. Then reactivate the default patterns.
+% Check for the end of the file. We must reverse the test for
+% |\ifeof| without |\else|. Then reactivate the default patterns,
+% and close the configuration file.
%
% \begin{macrocode}
\begingroup
@@ -11320,17 +11419,12 @@ help from Bernd Raichle, for which I am grateful.
\bbl@languages
\endgroup
\fi
-% \end{macrocode}
-%
-% and close the configuration file.
-%
-% \begin{macrocode}
\closein1
% \end{macrocode}
%
-% We add a message about the fact that babel is loaded in the
-% format and with which language patterns to the \cs{everyjob}
-% register.
+% We add a message about the fact that babel is loaded in the
+% format and with which language patterns to the \cs{everyjob}
+% register.
%
% \begin{macrocode}
\if/\the\toks@/\else
@@ -11683,48 +11777,6 @@ help from Bernd Raichle, for which I am grateful.
% therefore it is reset always to |utf8|, which seems a sensible
% default.
%
-% \LaTeX{} sets many ``codes'' just before loading
-% \verb|hyphen.cfg|. That is not a problem in luatex, but in xetex
-% they must be reset to the proper value. Most of the work is done in
-% \textsf{xe(la)tex.ini}, so here we just ``undo'' some of the
-% changes done by \LaTeX. Anyway, for consistency Lua\TeX{} also
-% resets the catcodes.
-%
-% \begin{macrocode}
-%<<*Restore Unicode catcodes before loading patterns>>
- \begingroup
- % Reset chars "80-"C0 to category "other", no case mapping:
- \catcode`\@=11 \count@=128
- \loop\ifnum\count@<192
- \global\uccode\count@=0 \global\lccode\count@=0
- \global\catcode\count@=12 \global\sfcode\count@=1000
- \advance\count@ by 1 \repeat
- % Other:
- \def\O ##1 {%
- \global\uccode"##1=0 \global\lccode"##1=0
- \global\catcode"##1=12 \global\sfcode"##1=1000 }%
- % Letter:
- \def\L ##1 ##2 ##3 {\global\catcode"##1=11
- \global\uccode"##1="##2
- \global\lccode"##1="##3
- % Uppercase letters have sfcode=999:
- \ifnum"##1="##3 \else \global\sfcode"##1=999 \fi }%
- % Letter without case mappings:
- \def\l ##1 {\L ##1 ##1 ##1 }%
- \l 00AA
- \L 00B5 039C 00B5
- \l 00BA
- \O 00D7
- \l 00DF
- \O 00F7
- \L 00FF 0178 00FF
- \endgroup
- \input #1\relax
-%<</Restore Unicode catcodes before loading patterns>>
-% \end{macrocode}
-%
-% Some more common code.
-%
% \begin{macrocode}
%<<*Footnote changes>>
\bbl@trace{Bidi footnotes}
@@ -11838,8 +11890,6 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\bbl@toglobal\csname selectfont \endcsname}%
\fi}%
\fi}
-\AddBabelHook{xetex}{loadkernel}{%
-<@Restore Unicode catcodes before loading patterns@>}
\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts}
@@ -11953,7 +12003,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \subsection{LuaTeX}
%
-% The new loader for luatex is based solely on |language.dat|, which
+% The 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
@@ -11995,14 +12045,21 @@ help from Bernd Raichle, for which I am grateful.
%
% 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.
-%
+% \textsf{ctablestack}). FIX - This isn't true anymore. 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.
+%
+% This files is read at three places: (1) when |plain.def|, |babel.sty|
+% starts, to read the list of available languages from |language.dat|
+% (for the |base| option); (2) at hyphen.cfg, to modify some macros;
+% (3) in the middle of |plain.def| and |babel.sty|, by |babel.def|,
+% with the commands and other definitions for |luatex| (eg,
+% |\babelpatterns|).
+%
% \begin{macrocode}
%<*luatex>
-\ifx\AddBabelHook\@undefined
+\ifx\AddBabelHook\@undefined % When plain.def, babel.sty starts
\bbl@trace{Read language.dat}
\ifx\bbl@readstream\@undefined
\csname newread\endcsname\bbl@readstream
@@ -12089,29 +12146,31 @@ help from Bernd Raichle, for which I am grateful.
\endgroup
\bbl@trace{Macros for reading patterns files}
\def\bbl@get@enc#1:#2:#3\@@@{\def\bbl@hyph@enc{#2}}
-% TODO - Harcoded value:
\ifx\babelcatcodetablenum\@undefined
- \def\babelcatcodetablenum{5211}
+ \ifx\newcatcodetable\@undefined
+ \def\babelcatcodetablenum{5211}
+ \def\bbl@pattcodes{\numexpr\babelcatcodetablenum+1\relax}
+ \else
+ \newcatcodetable\babelcatcodetablenum
+ \newcatcodetable\bbl@pattcodes
+ \fi
+\else
+ \def\bbl@pattcodes{\numexpr\babelcatcodetablenum+1\relax}
\fi
\def\bbl@luapatterns#1#2{%
\bbl@get@enc#1::\@@@
\setbox\z@\hbox\bgroup
\begingroup
- \ifx\catcodetable\@undefined
- \let\savecatcodetable\luatexsavecatcodetable
- \let\initcatcodetable\luatexinitcatcodetable
- \let\catcodetable\luatexcatcodetable
- \fi
\savecatcodetable\babelcatcodetablenum\relax
- \initcatcodetable\numexpr\babelcatcodetablenum+1\relax
- \catcodetable\numexpr\babelcatcodetablenum+1\relax
- \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
+ \initcatcodetable\bbl@pattcodes\relax
+ \catcodetable\bbl@pattcodes\relax
+ \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
\catcodetable\babelcatcodetablenum\relax
\endgroup
\def\bbl@tempa{#2}%
@@ -12144,6 +12203,25 @@ help from Bernd Raichle, for which I am grateful.
{\expandafter\expandafter\expandafter\bbl@luapatterns
\csname bbl@hyphendata@\the\language\endcsname}}{}}
\endinput\fi
+ % Here ends \ifx\AddBabelHook\@undefined
+ % A few lines are only read by hyphen.cfg
+\ifx\DisableBabelHook\@undefined
+ \AddBabelHook{luatex}{everylanguage}{%
+ \def\process@language##1##2##3{%
+ \def\process@line####1####2 ####3 ####4 {}}}
+ \AddBabelHook{luatex}{loadpatterns}{%
+ \input #1\relax
+ \expandafter\gdef\csname bbl@hyphendata@\the\language\endcsname
+ {{#1}{}}}
+ \AddBabelHook{luatex}{loadexceptions}{%
+ \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}}
+\endinput\fi
+ % Here stops reading code for hyphen.cfg
+ % The following is read the 2nd time it's loaded
\begingroup
\catcode`\%=12
\catcode`\'=12
@@ -12251,19 +12329,6 @@ help from Bernd Raichle, for which I am grateful.
\bbl@ifunset{bbl@prehc@\languagename}{}%
{\\\bbl@ifblank{\bbl@cs{prehc@\languagename}}{}%
{\prehyphenchar=\bbl@cl{prehc}\relax}}}}
-\AddBabelHook{luatex}{everylanguage}{%
- \def\process@language##1##2##3{%
- \def\process@line####1####2 ####3 ####4 {}}}
-\AddBabelHook{luatex}{loadpatterns}{%
- \input #1\relax
- \expandafter\gdef\csname bbl@hyphendata@\the\language\endcsname
- {{#1}{}}}
-\AddBabelHook{luatex}{loadexceptions}{%
- \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}
@@ -12540,9 +12605,6 @@ help from Bernd Raichle, for which I am grateful.
% Common stuff.
%
% \begin{macrocode}
-\AddBabelHook{luatex}{loadkernel}{%
-<@Restore Unicode catcodes before loading patterns@>}
-\ifx\DisableBabelHook\@undefined\endinput\fi
\AddBabelHook{babel-fontspec}{afterextras}{\bbl@switchfont}
\AddBabelHook{babel-fontspec}{beforestart}{\bbl@ckeckstdfonts}
\DisableBabelHook{babel-fontspec}
@@ -12737,7 +12799,7 @@ end
% trying other patterns, and this is very likely the main bottleneck).
%
% |post_hyphenate_replace| is the callback applied after
-% |tex.hyphenate|. This means the automatic hyphenation points are
+% |lang.hyphenate|. This means the automatic hyphenation points are
% known. As empty captures return a byte position (as explained in the
% \luatex{} manual), we must convert it to a utf8 position. With
% |first|, the last byte can be the leading byte in a utf8 sequence, so
@@ -20306,32 +20368,33 @@ Babel.cjk_breaks = {
% \section{Support for Plain \TeX\ (\texttt{plain.def})}
%
% \subsection{Not renaming \file{hyphen.tex}}
-% As Don Knuth has declared that the filename \file{hyphen.tex} may
-% only be used to designate \emph{his} version of the american
-% English hyphenation patterns, a new solution has to be found in
-% order to be able to load hyphenation patterns for other languages
-% in a plain-based \TeX-format.
-% When asked he responded:
-% \begin{quote}
-% That file name is ``sacred'', and if anybody changes it they will
-% cause severe upward/downward compatibility headaches.
-%
-% People can have a file localhyphen.tex or whatever they like,
-% but they mustn't diddle with hyphen.tex (or plain.tex except to
-% preload additional fonts).
-% \end{quote}
-%
-% The files \file{bplain.tex} and \file{blplain.tex} can be used as
-% replacement wrappers around \file{plain.tex} and
-% \file{lplain.tex} to acheive the desired effect, based on the
-% \pkg{babel} package. If you load each of them with ini\TeX, you
-% will get a file called either \file{bplain.fmt} or
-% \file{blplain.fmt}, which you can use as replacements for
-% \file{plain.fmt} and \file{lplain.fmt}.
-%
-% As these files are going to be read as the first thing ini\TeX\
-% sees, we need to set some category codes just to be able to
-% change the definition of |\input|
+%
+% As Don Knuth has declared that the filename \file{hyphen.tex} may
+% only be used to designate \emph{his} version of the american
+% English hyphenation patterns, a new solution has to be found in
+% order to be able to load hyphenation patterns for other languages
+% in a plain-based \TeX-format.
+% When asked he responded:
+% \begin{quote}
+% That file name is ``sacred'', and if anybody changes it they will
+% cause severe upward/downward compatibility headaches.
+%
+% People can have a file localhyphen.tex or whatever they like,
+% but they mustn't diddle with hyphen.tex (or plain.tex except to
+% preload additional fonts).
+% \end{quote}
+%
+% The files \file{bplain.tex} and \file{blplain.tex} can be used as
+% replacement wrappers around \file{plain.tex} and
+% \file{lplain.tex} to achieve the desired effect, based on the
+% \pkg{babel} package. If you load each of them with ini\TeX, you
+% will get a file called either \file{bplain.fmt} or
+% \file{blplain.fmt}, which you can use as replacements for
+% \file{plain.fmt} and \file{lplain.fmt}.
+%
+% As these files are going to be read as the first thing ini\TeX\
+% sees, we need to set some category codes just to be able to
+% change the definition of |\input|.
%
% \begin{macrocode}
%<*bplain|blplain>
@@ -20340,81 +20403,63 @@ Babel.cjk_breaks = {
\catcode`\#=6 % hash mark is macro parameter character
% \end{macrocode}
%
-% Now let's see if a file called \file{hyphen.cfg} can be found
-% somewhere on \TeX's input path by trying to open it for
-% reading...
+% If a file called \file{hyphen.cfg} can be found, we make sure that
+% \emph{it} will be read instead of the file \file{hyphen.tex}. We
+% do this by first saving the original meaning of |\input| (and I
+% use a one letter control sequence for that so as not to waste
+% multi-letter control sequence on this in the format).
%
% \begin{macrocode}
\openin 0 hyphen.cfg
-% \end{macrocode}
-%
-% If the file wasn't found the following test turns out true.
-%
-% \begin{macrocode}
\ifeof0
\else
-% \end{macrocode}
-%
-% When \file{hyphen.cfg} could be opened we make sure that
-% \emph{it} will be read instead of the file \file{hyphen.tex}
-% which should (according to Don Knuth's ruling) contain the
-% american English hyphenation patterns and nothing else.
-%
-% We do this by first saving the original meaning of |\input| (and
-% I use a one letter control sequence for that so as not to waste
-% multi-letter control sequence on this in the format).
-%
-% \begin{macrocode}
\let\a\input
% \end{macrocode}
%
-% Then |\input| is defined to forget about its argument and load
-% \file{hyphen.cfg} instead.
+% Then |\input| is defined to forget about its argument and load
+% \file{hyphen.cfg} instead. Once that's done the original meaning
+% of |\input| can be restored and the definition of |\a| can be
+% forgotten.
%
% \begin{macrocode}
\def\input #1 {%
\let\input\a
\a hyphen.cfg
-% \end{macrocode}
-%
-% Once that's done the original meaning of |\input| can be restored
-% and the definition of |\a| can be forgotten.
-%
-% \begin{macrocode}
\let\a\undefined
}
\fi
%</bplain|blplain>
% \end{macrocode}
%
-% Now that we have made sure that \file{hyphen.cfg} will be loaded
-% at the right moment it is time to load \file{plain.tex}.
+% Now that we have made sure that \file{hyphen.cfg} will be loaded
+% at the right moment it is time to load \file{plain.tex}.
%
% \begin{macrocode}
%<bplain>\a plain.tex
%<blplain>\a lplain.tex
% \end{macrocode}
%
-% Finally we change the contents of |\fmtname| to indicate that
-% this is \emph{not} the plain format, but a format based on plain
-% with the \pkg{babel} package preloaded.
+% Finally we change the contents of |\fmtname| to indicate that
+% this is \emph{not} the plain format, but a format based on plain
+% with the \pkg{babel} package preloaded.
%
% \begin{macrocode}
%<bplain>\def\fmtname{babel-plain}
%<blplain>\def\fmtname{babel-lplain}
% \end{macrocode}
%
-% When you are using a different format, based on plain.tex you can
-% make a copy of blplain.tex, rename it and replace \file{plain.tex}
-% with the name of your format file.
+% When you are using a different format, based on plain.tex you can
+% make a copy of blplain.tex, rename it and replace \file{plain.tex}
+% with the name of your format file.
%
% \subsection{Emulating some \LaTeX{} features}
%
-% The following code duplicates or emulates parts of \LaTeXe\ that
-% are needed for \babel.
+% The following code duplicates or emulates parts of \LaTeXe\ that
+% are needed for \babel.
%
% \begin{macrocode}
-%<*plain>
+%<<*Emulate LaTeX>>
+ % == Code for plain ==
\def\@empty{}
\def\loadlocalcfg#1{%
\openin0#1.cfg
@@ -20471,6 +20516,7 @@ Babel.cjk_breaks = {
#1%
\ifx#2\@empty\else\expandafter\zap@space\fi
#2}
+\let\bbl@trace\@gobble
% \end{macrocode}
%
% \LaTeXe\ has the command |\@onlypreamble| which adds commands to
@@ -20521,13 +20567,17 @@ Babel.cjk_breaks = {
% \end{macrocode}
%
% \LaTeX\ needs to be able to switch off writing to its auxiliary
-% files; plain doesn't have them by default.
+% files; plain doesn't have them by default. There is a trick to
+% hide some conditional commands from the outer |\ifx|. The same
+% trick is applied below.
%
% \begin{macrocode}
-\ifx\if@filesw\@undefined
+\catcode`\&=\z@
+\ifx&if@filesw\@undefined
\expandafter\let\csname if@filesw\expandafter\endcsname
\csname iffalse\endcsname
\fi
+\catcode`\&=4
% \end{macrocode}
%
% Mimick \LaTeX's commands to define control sequences.
@@ -20594,9 +20644,8 @@ Babel.cjk_breaks = {
\@x@protect#1%
\fi
}
-\def\@x@protect#1\fi#2#3{%
- \fi\protect#1%
-}
+\catcode`\&=\z@ % Trick to hide conditionals
+ \def\@x@protect#1&fi#2#3{&fi\protect#1}
% \end{macrocode}
%
% The following little macro |\in@| is taken from \file{latex.ltx};
@@ -20606,7 +20655,8 @@ Babel.cjk_breaks = {
% construct with the temporary definition of |\bbl@tempa|.
%
% \begin{macrocode}
-\def\bbl@tempa{\csname newif\endcsname\ifin@}
+ \def\bbl@tempa{\csname newif\endcsname&ifin@}
+\catcode`\&=4
\ifx\in@\@undefined
\def\in@#1#2{%
\def\in@@##1#1##2##3\in@@{%
@@ -20872,8 +20922,17 @@ Babel.cjk_breaks = {
\ifx\scriptsize\@undefined
\let\scriptsize\sevenrm
\fi
+ % End of code for plain
+%<</Emulate LaTeX>>
+% \end{macrocode}
+%
+% A proxy file:
+% \begin{macrocode}
+%<*plain>
+\input babel.def
%</plain>
% \end{macrocode}
+
%
% \Finale
%
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index 194f706e24..e780e466d7 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{2020/03/22}
+\def\filedate{2020/04/28}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf
index 854f18bea2..95d4abf64a 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index 0e831a596e..e00be71de0 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}[2020/03/22 v3.42]
+\ProvidesFile{bbcompat.dtx}[2020/04/28 v3.43]
%</dtx>
%
%% File 'bbcompat.dtx'