summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-29 03:01:11 +0000
committerNorbert Preining <norbert@preining.info>2021-06-29 03:01:11 +0000
commitbdafc07360a98b693982369cce21a73afef5e3d7 (patch)
tree5965c3d688be3d5848f3b12bf4993dd09f61cc5f /macros/latex
parent36c481b02c4fdfaf33325b9f18834c2357b8eec5 (diff)
CTAN sync 202106290301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/babel-contrib/latin/README11
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.dtx2846
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.ins120
-rw-r--r--macros/latex/contrib/babel-contrib/latin/latin.pdfbin155817 -> 186613 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx102
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin538360 -> 539605 bytes
-rw-r--r--macros/latex/contrib/projlib/ProjLib-doc-cn.pdfbin265887 -> 267673 bytes
-rw-r--r--macros/latex/contrib/projlib/ProjLib-doc-cn.tex3
-rw-r--r--macros/latex/contrib/projlib/ProjLib-doc-en.pdfbin178888 -> 179576 bytes
-rw-r--r--macros/latex/contrib/projlib/ProjLib-doc-en.tex3
-rw-r--r--macros/latex/contrib/projlib/ProjLib.dtx102
-rw-r--r--macros/latex/contrib/projlib/README.md11
-rw-r--r--macros/latex/contrib/spbmark/spbmark.dtx88
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin66589 -> 67418 bytes
-rw-r--r--macros/latex/required/babel/base/README.md27
-rw-r--r--macros/latex/required/babel/base/babel.dtx374
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin843759 -> 846875 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
-rw-r--r--macros/latex/required/latexbug/changes.txt5
-rw-r--r--macros/latex/required/latexbug/latexbug.dtx85
-rw-r--r--macros/latex/required/latexbug/latexbug.pdfbin187013 -> 200887 bytes
22 files changed, 2673 insertions, 1108 deletions
diff --git a/macros/latex/contrib/babel-contrib/latin/README b/macros/latex/contrib/babel-contrib/latin/README
new file mode 100644
index 0000000000..444ae8be1c
--- /dev/null
+++ b/macros/latex/contrib/babel-contrib/latin/README
@@ -0,0 +1,11 @@
+The babel-latin package provides the babel languages latin, classiclatin,
+medievallatin and ecclesiasticlatin.
+
+Package author: C. Beccari
+Current maintainer: K. Wehr
+Version: 4.0
+Date: 27th June 2021
+Bug tracker: https://github.com/wehro/babel-latin/issues
+
+The babel-latin package is subject to the LaTeX Project Public License,
+version 1.3 or later.
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.dtx b/macros/latex/contrib/babel-contrib/latin/latin.dtx
index 5c69e291b1..1396bd1b2c 100644
--- a/macros/latex/contrib/babel-contrib/latin/latin.dtx
+++ b/macros/latex/contrib/babel-contrib/latin/latin.dtx
@@ -1,828 +1,2150 @@
-% \CheckSum{510}
+% \iffalse meta-comment
+%
+% This file is part of the babel-latin package. It provides the source code
+% for the Latin language definition file. The original version of this file
+% was written by Claudio Beccari and includes contributions by Krzysztof
+% Konrad Żelechowski. It was modified and made compatible with the babel
+% system by J.L. Braams.
+%
+% Copyright (C) 1989-2008 by Johannes L. Braams
+% Copyright (C) 2009-2020 by Claudio Beccari
+% Copyright (C) 2021 by Keno Wehr
+% All rights reserved.
+%
+% This file is part of the babel-latin package.
+% ---------------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work is Keno Wehr.
+%
+% \fi
+% \CheckSum{1023}
% \iffalse
-% Tell the \LaTeX\ system who we are and write an entry on the
-% transcript.
+% Tell the LaTeX system who we are and write an entry on the transcript.
%<*driver>
\ProvidesFile{latin.dtx}
-%</driver>
-%<code>\ProvidesLanguage{latin}
-%<*code>
- [2015/08/20 v.3.5 Latin support from the babel system]
-%</code>
-%% File `babel-latin.dtx'
-%% Babel package for LaTeX2e
-%% Copyright (C) 1989 - 2008 by Johannes Braams, TeXniek
-%% Copyright (C) 2009 - 2015 by Claudio Beccari
-%
-%% Please report errors to: Claudio Beccari
-%% claudio.beccari at gmail.com
-%
-% This file is part of the babel system, it provides the source
-% code for the Latin language description file.
-% The original version of this file was written by
-% Claudio Beccari, (claudio.beccari at gmail.com) and includes contributions
-% by Krzysztof Konrad \.Zelechowski, (\texttt{kkz@alfa.mimuw.edu.pl}). It was
-% modified and made compatible with the babel system by J.L. Braams
-%<*driver>
\documentclass{ltxdoc}
-\newcommand*\TeXhax{\TeX hax}
-\newcommand*\babel{\textsf{babel}}
-\newcommand*\langvar{$\langle \it lang \rangle$}
-\newcommand*\note[1]{}
-\newcommand*\Lopt[1]{\textsf{#1}}
+\usepackage[british]{babel}
+\usepackage{fontspec}
+\usepackage{booktabs}
+\usepackage{metalogo}
+\usepackage[colorlinks=true,
+ allcolors=black,
+ bookmarksnumbered=true,
+ pdfencoding=auto,
+ pdftitle={The babel-latin package},
+ pdfsubject={Manual of the babel-latin package},
+ pdfkeywords={latex babel latin},
+ pdfauthor={K. Wehr}]{hyperref}
+\newcommand*\package[1]{\textsf{#1}}
+\newcommand*\babel{\package{babel}}
+\newcommand*\babellatin{\package{babel-latin}}
+\newcommand*\lang[1]{\texttt{#1}}
+\newcommand*\hyphpat[1]{\texttt{#1}}
+\newcommand*\modifier[1]{\texttt{#1}}
\newcommand*\file[1]{\texttt{#1}}
-\providecommand*\pkg[1]{\textsf{#1}}
+\newcommand*\unicode[1]{\texttt{U+#1}}
+\newenvironment{shorthands}{%
+ \begin{list}{}{%
+ \settowidth\labelwidth{MM}%
+ \setlength\leftmargin{\labelwidth}%
+ \addtolength\leftmargin{\labelsep}%
+ \addtolength\leftmargin{1em}%
+ \renewcommand*\makelabel[1]{##1\hfil}%
+ }%
+}{%
+ \end{list}%
+}
+\setmainfont{Libertinus Serif}
+\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase]
+\setlogokern{La}{-0,25em}
+\setlogokern{aT}{-0,07em}
+\setlogokern{eL}{-0,05em}
+\title{Babel support for the Latin language}
+\author{Claudio Beccari\and Keno Wehr\thanks{Current maintainer. Please report
+errors to \url{https://github.com/wehro/babel-latin/issues}.}}
+\date{v.\,4.0\quad\today}
\begin{document}
\DocInput{latin.dtx}
\end{document}
%</driver>
-%\fi
+% \fi
% \GetFileInfo{latin.dtx}
+% \RecordChanges
%
-% \changes{latin-0.99}{1999/12/06}{First version, from italian.dtx (CB)}
-% \changes{latin-0.99}{1999/12/06}{Added shorthands for breve, macron,
-% and etymological hyphenation (CB)}
-% \changes{latin-1.2}{2000/01/31}{Added suggestions from Krzysztof
+% \changes{0.99}{1999/12/06}{First version, from italian.dtx (CB)}
+% \changes{1.2}{2000/01/31}{Added suggestions from Krzysztof
% Konrad \.Zelechowski (CB)}
-% \changes{latin-2.0}{2000/02/10}{Completely new etymological
-% hyphenation (CB)}
-% \changes{latin-2.0a}{2000/10/15}{Revised by JB}
-% \changes{latin-2.0b}{2000/12/13}{Simplified shorthands for
-% etymological hyphenation; modified breve and macro shorthands;
-% language attribute medieval declared}
-% \changes{latin-2.0c}{2001/06/04}{Restored caret and equals sign
-% category codes before exiting}
-% \changes{latin-2.0d}{2001/06/04}{Restored caret and equals sign
-% category codes before exiting}
-% \changes{latin-2.0e}{2003/04/11}{Introduced the language attribute
+% \changes{2.0a}{2000/10/15}{Revised by JB}
+% \changes{4.0}{2021/06/27}{Complete revision by KW}
+% \changes{4.0}{2021/06/27}{Make ecclesiastic Latin work with \XeLaTeX{} and
+% \LuaLaTeX}
+%
+% \maketitle
+% \begin{abstract}
+% \noindent This manual documents the \babellatin{} package, which defines
+% all language-specific macros for the \babel{} languages \lang{latin},
+% \lang{classiclatin}, \lang{medievallatin}, and \lang{ecclesiasticlatin}.
+% These languages are usable with pdf\LaTeX, \XeLaTeX, and \LuaLaTeX. The
+% \lang{latin} language is even usable with plain \TeX{} (with some
+% restrictions).
+% \end{abstract}
+% \begin{center}
+% \fbox{\parbox{8,4cm}{See section \ref{legacymodifiers} on how to update
+% from outdated modifiers and the \package{ecclesiastic} package.}}
+% \end{center}
+% \tableofcontents
+% \section{Language variants}
+% \changes{4.0}{2021/06/27}{New \babel{} languages \lang{classiclatin},
+% \lang{medievallatin}, and \lang{ecclesiasticlatin}, replacing the
+% respective modifiers}
+% Latin has been the most important language of European intellectual life
+% for a long time. Throughout the centuries, many different styles of Latin
+% have been in use concerning wording, spelling, punctuation, and
+% hyphenation. The typographical conventions of an edition of a Latin
+% classic are quite different from those of a liturgical book, even if both
+% have been printed in the 20th century. And even the same Latin text may
+% look quite differently depending on the preferences of the editor and the
+% typographical customs of his country. Latin is supranational, but its
+% typography is not.
+%
+% To fit all needs, the \babellatin{} package defines four different language
+% variants of Latin, i.\,e., four different \babel{} languages.
+% Table \ref{tab:latin-spelling} shows some differences between the language
+% variants.
+% \begin{table}
+% \centering
+% \begin{tabular}{llll}
+% \toprule
+% \lang{latin} & \lang{classiclatin} & \lang{medievallatin} &
+% \lang{ecclesiasticlatin} \\
+% \midrule
+% Novembris & Nouembris & Nouembris & Novembris \\
+% Praefatio & Praefatio & Præfatio & Præfatio \\
+% \addlinespace\multicolumn{4}{@{}l}{\cmd{\MakeUppercase\{Iulius\}}
+% yields:} \\
+% IULIUS & IVLIVS & IVLIVS & IULIUS \\
+% \bottomrule
+% \end{tabular}
+% \caption{\label{tab:latin-spelling}Spelling differences between the
+% Latin language variants}
+% \end{table}
+% It is no problem to use different variants of Latin within the same
+% document. If you need classical and modern Latin, just say
+% \begin{quote}
+% |\usepackage[classiclatin,latin]{babel}|
+% \end{quote}
+% and switch the language using the commands described in the \babel{}
+% manual.
+% \paragraph{The \lang{latin} language -- modern Latin}
+% This language variant is intended for the modern usage of Latin; with this
+% we mean the kind of Latin that is used as an official language in the
+% State of Vatican City and in the teaching of Latin in modern schools.
+% Typically, the following alphabet is used:
+% \begin{center}
+% \setlength\tabcolsep{2pt}
+% \begin{tabular}{*{24}c}
+% a&b&c&d&e&f&g&h&i&k&l&m&n&o&p&q&r&s&t&u&v&x&y&z\\
+% A&B&C&D&E&F&G&H&I&K&L&M&N&O&P&Q&R&S&T&U&V&X&Y&Z
+% \end{tabular}
+% \end{center}
+% \paragraph{The \lang{classiclatin} language -- classical Latin}
+% This language variant is intended for typesetting Latin texts more or less
+% according to the ancient usage of Latin. However, the use of lower-case
+% letters, which are not of ancient origin, is not excluded. The following
+% alphabet is used:
+% \begin{center}
+% \setlength\tabcolsep{2pt}
+% \begin{tabular}{*{23}c}
+% a&b&c&d&e&f&g&h&i&k&l&m&n&o&p&q&r&s&t&u&x&y&z\\
+% A&B&C&D&E&F&G&H&I&K&L&M&N&O&P&Q&R&S&T&V&X&Y&Z
+% \end{tabular}
+% \end{center}
+% Note that `V' corresponds to `u' in lower case. This habit came up in the
+% Middle Ages and is still in use in many text editions. It must be noted
+% that \babellatin{} does not make any spelling correction in order to use
+% only `u' in lower case and only `V' in upper case: if the input text is
+% wrongly typed in, it remains as such; this means it's the typesetter's
+% responsibility to correctly input the source text to be typeset; in spite
+% of this, when the transformation from lower to upper case is performed
+% (such as, for example, while typesetting headers with some document
+% classes) the correct capitalization is performed and `u' is capitalized to
+% `V'; the reverse takes place when transforming to lower case.
+% \paragraph{The \lang{medievallatin} language -- medieval/humanist Latin}
+% The spelling is similar to the classical one, but the ligatures \ae, \AE,
+% \oe, and \OE{} are used for the respective (former) diphthongs. Again, it
+% is the typesetter's responsibility to input the text to be typeset in a
+% correct way. The following alphabet is used:
+% \begin{center}
+% \setlength\tabcolsep{2pt}
+% \begin{tabular}{*{25}c}
+% a&\ae&b&c&d&e&f&g&h&i&k&l&m&n&o&\oe&p&q&r&s&t&u&x&y&z\\
+% A&\AE&B&C&D&E&F&G&H&I&K&L&M&N&O&\OE&P&Q&R&S&T&V&X&Y&Z
+% \end{tabular}
+% \end{center}
+% As far as the current maintainer can judge it, the consequent use of `\ae'
+% and `\oe' ligatures came up in 15th century manuscripts in Italy. So this
+% language variant rather reflects the Latin of the humanist/Renaissance
+% period than that of the Middle Ages. However, we stick to the
+% \emph{medieval} name chosen in earlier versions of \babellatin.
+% \paragraph{The \lang{ecclesiasticlatin} language -- ecclesiastic Latin}
+% Ecclesiastic Latin is a spelling variety of modern Latin, which is used
+% above all in liturgical books of the Roman Catholic Church, where the
+% ligatures \ae{} and \oe{} are widely used and where acute accents are used
+% in order to mark the tonic vowel of words with more than two syllables to
+% make sure the correct stress. The following alphabet is used:
+% \begin{center}
+% \setlength\tabcolsep{2pt}
+% \begin{tabular}{*{26}c}
+% a&\ae&b&c&d&e&f&g&h&i&k&l&m&n&o&\oe&p&q&r&s&t&u&v&x&y&z\\
+% A&\AE&B&C&D&E&F&G&H&I&K&L&M&N&O&\OE&P&Q&R&S&T&U&V&X&Y&Z
+% \end{tabular}
+% \end{center}
+% This language variant also contains a certain degree of ``Frenchization''
+% of spaces around some punctuation marks and guillemets: 1/12 of a quad is
+% inserted before `!', `?', `:', `;', `»', and `›' as well as after `«' and
+% `‹'. The spacing of guillemets does not work with pdf\TeX{} except when
+% using the shorthands |"<| and |">| (see section \ref{shorthands}).
+%
+% \vspace{1.5\bigskipamount}
+% \noindent For what concerns \babel\ and typesetting with \TeX, the
+% differences between the language variants reveal themselves in the strings
+% used to name, for example, the ``Preface'', that becomes ``Praefatio'' or
+% ``Pr\ae fatio'', respectively. Hyphenation rules are also different, cf.
+% section \ref{hyphenation}.
+%
+% The name strings for chapters, figures, tables, et cetera, have been
+% suggested by prof. Raffaella Tabacco, a latinist of the University of
+% Vercelli, Italy, to whom we address our warmest thanks. The names
+% suggested by Krzysztof Konrad \.Zelechowski, when different, are used as
+% the names for the medieval variety, since he made a word and spelling
+% choice more suited for this variety.
+%
+% \section{Modifiers}
+% \changes{4.0}{2021/06/27}{New modifiers \modifier{usej},
+% \modifier{lowercasemonth}, and \modifier{ecclesiasticfootnotes}}
+% The four language variants described above do not cover all variations of
+% Latin typography. Additionally there are several \emph{modifiers}:
+% \modifier{usej}, \modifier{lowercasemonth}, \modifier{withprosodicmarks},
+% and \modifier{ecclesiasticfootnotes}. The meaning of these modifiers is
+% explained below.
+%
+% To apply a modifier you have to append it (prefixed with a dot) to the
+% language name when loading \babel:
+% \begin{quote}
+% |\usepackage[ecclesiasticlatin.lowercasemonth]{babel}|
+% \end{quote}
+% If you need two modifiers or more, just concatenate them in arbitrary
+% order:
+% \begin{quote}
+% |\usepackage[latin.usej.withprosodicmarks]{babel}|
+% \end{quote}
+%
+% \subsection{The letter \emph{j}}
+% The letter \emph{j} is not of ancient origin. In early modern times, it
+% was used to distinguish the consonantic \emph{i} from the vocalic
+% \emph{i}. In liturgical books \emph{j} was in use until the 1960s.
+% Nowadays, the use of \emph{j} has disappeared from most Latin
+% publications. This is why \babellatin{} does not use \emph{j} in
+% predefined terms by default. Use the \modifier{usej} modifier if you
+% prefer \emph{Januarii} and \emph{Maji} to \emph{Ianuarii} and
+% \emph{Maii}.
+%
+% \subsection{Case of month names}
+% Traditionally, Latin month names are capitalized: \emph{Ianuarii,
+% Februarii, Martii, \ldots} (We state the genitive forms here as this is
+% what we need for Latin dates.) So \babellatin{} capitalizes the month
+% names for all four language variants. However, in recent liturgical books
+% month names are written in lower case (as in Romance languages). Use the
+% \modifier{lowercasemonth} modifier if you prefer not to capitalize the
+% month names printed by the \cs{today} command: \emph{ianuarii, februarii,
+% martii, \ldots}
+%
+% \subsection{Shorthands for prosodic marks\label{prosodic}}
+% \changes{0.99}{1999/12/06}{Added shorthands for breve and macron}
+% \changes{2.0b}{2000/12/13}{Modified breve and macro shorthands}
+% \changes{2.0e}{2003/04/11}{Introduced the language attribute
% `withprosodicmarks'; modified use of breve and macron shorthands
% in order to avoid possible conflicts with other packages}
-% \changes{latin-2.0i}{2008/02/17}{Corrected the \cs{@clubpenalty} problem}
-% \changes{latin-2.0j}{2010/01/03}{Corrected sectioning}
-% \changes{latin-2.0k}{2014/02/18}{subsections turned into subsections*}
-%^^A --------------------------------
-% \changes{latin-3.0}{2014/06/01}{Added modifier for classical spelling
+% \changes{4.0}{2021/06/27}{New shorthands for diphthongs with macron}
+% Textbooks, grammars, and dictionaries often use letters with prosodic
+% marks (macrons and breves) like ‘\=a’ and ‘\u{a}’ to mark long
+% and short vowels. On modern systems, the required characters can be input
+% directly thanks to Unicode. For backwards compatibility and as an perhaps
+% more comfortable alternative even today, \babellatin{} provides shorthands
+% for prosodic marks if you load the language with the
+% \modifier{withprosodicmarks} modifier.
+%
+% Note that these shorthands may interfere with other packages. The active
+% |=| character used for macrons will cause problems with commands using
+% |key=value| interfaces, such as the command
+% |\includegraphics[scale=2]{...}|. Therefore, the shorthands are disabled
+% by default. You have to use dedicated commands to turn them on and off.
+% Use \cs{ProsodicMarksOn} to enable them an \cs{ProsodicMarksOff} to
+% disable them again. To get “G\u{a}ll\u{i}\u{a} \u{e}st \u{o}mn\u{i}s
+% d\=iv\=is\u{a} \u{i}n p\u{a}rt\=es tr\=es”, type:
+% \begin{quote}
+% \cs{ProsodicMarksOn}\\
+% |G^all^i^a ^est ^omn^is d=iv=is^a ^in p^art=es tr=es|\\
+% \cs{ProsodicMarksOff}
+% \end{quote}
+%
+% The following shorthands are available:
+% \begin{shorthands}
+% \item[|=a|] for \=a (a with macron), also available for \=e, \=i, \=o,
+% \=u, and \=y
+% \item[|=A|] for \=A (A with macron), also available for \=E, \=I, \=O,
+% \=U, \=V, and \=Y. Note that a macron above the letter V is only
+% displayed if your font supports the Unicode character \unicode{0304}
+% (\emph{combining macron}).
+% \item[|=ae|] for a͞e (ae diphthong with macron, for \lang{latin} and
+% \lang{classiclatin}) or \={\ae} (ae ligature with macron, for
+% \lang{medievallatin} and \lang{ecclesiasticlatin}), respectively; also
+% available for a͞u, e͞u, and o͞e/\=\oe. Note that macrons above diphthongs
+% are only displayed if your font supports the Unicode character
+% \unicode{035E} (\emph{combining double macron}), which always requires
+% \XeLaTeX{} or \LuaLaTeX.\footnote{A good choice for a font supporting
+% the combining double macron might be \emph{Libertinus Serif}, the font
+% of this manual.}
+% \item[|=Ae|] for A͞e (Ae diphthong with macron, for \lang{latin} and
+% \lang{classiclatin}) or \={\AE} (AE ligature with macron, for
+% \lang{medievallatin} and \lang{ecclesiasticlatin}), respectively; also
+% available for A͞u, E͞u, and O͞e/\=\OE.
+% \item[|=AE|] for A͞E (AE diphthong with macron, for \lang{latin} and
+% \lang{classiclatin}) or \={\AE} (AE ligature with macron, for
+% \lang{medievallatin} and \lang{ecclesiasticlatin}), respectively; also
+% available for A͞U, E͞U, and O͞E/\=\OE.
+% \item[|\textasciicircum a|] for ă (a with breve), also available for
+% ĕ, ĭ, ŏ, ŭ, and y̆. Note that a breve above the letter y is only
+% displayed if your font supports the Unicode character \unicode{0306}
+% (\emph{combining breve}).
+% \item[|\textasciicircum A|] Ă (A with breve), also available for Ĕ, Ĭ,
+% Ŏ, Ŭ, V̆, and Y̆. Note that breves above the letters V and Y are only
+% displayed if your font supports the Unicode character \unicode{0306}
+% (\emph{combining breve}).
+% \end{shorthands}
+% Note the incompatibilities described in section \ref{incompatibilities}.
+%
+% \subsection{Ecclesiastic footnotes}
+% The \package{ecclesiastic} package, an outdated extension of former
+% versions of \babellatin, typeset footnotes with ordinary instead of
+% superior numbers and without indentation.
+%
+% As many ecclesiastic documents and liturgical books use footnotes that are
+% very similar to the ordinary \LaTeX{} ones, we do not use this footnote
+% style as default even for the \lang{ecclesiasticlatin} language variant.
+% But you may use the \modifier{ecclesiasticfootnotes} modifier (with any
+% variant of Latin) if you prefer that footnote style.
+%
+% Note that this modifier affects the entire document. It can only be
+% applied to the document's main language.
+%
+% \subsection{Legacy modifiers\label{legacymodifiers}}
+% \changes{2.0b}{2000/12/13}{Language attribute medieval declared}
+% \changes{3.0}{2014/06/01}{Added modifier for classical spelling
% and hyphenation}
-% \changes{latin-3.0}{2014/06/01}{Restored the subsection numbering}
-% \changes{latin-3.5}{2015/08/17}{Added the modifier for the ecclesiastic
+% \changes{3.5}{2015/08/17}{Added the modifier for the ecclesiastic
% Latin variety}
+% \changes{4.0}{2021/06/27}{Deprecate the \modifier{classic},
+% \modifier{medieval}, and \modifier{ecclesiastic} modifiers}
+% \babellatin{} defined only one single \babel{} language up to v.\,3.5.
+% Language variants used to be accessible via modifiers. This approach has
+% proved to be disadvantageous concerning compatibility with other
+% language-specific packages like \package{biblatex}. That's why v.\,4.0
+% introduced the \lang{classiclatin}, \lang{medievallatin}, and
+% \lang{ecclesiasticlatin} languages.
+%
+% The legacy modifiers \modifier{classic}, \modifier{medieval}, and
+% \modifier{ecclesiastic} are still available and backwards compatibility is
+% made sure. However, a warning is issued if you use one of these modifiers.
+% They may be dropped from \babellatin{} in a future version.
%
-% \section{The Latin language}
-%
-% The file \file{\filename}\footnote{The file described in this
-% section has version number \fileversion\ and was last revised on
-% \filedate. The original author is Claudio Beccari.} defines all the
-% language-specific macros for the Latin language including the classical
-% spelling and hyphenation and the special ecclesiastic spelling.
-%
-% Without modifiers or attributes, this file describes the modern usage
-% of Latin; with this we mean the kind of Latin that is used as an official
-% language in the State of Vatican City, and in the teaching of Latin in
-% modern schools. This file description language accepts several modifiers,
-% in order to be adapted to other situations.
-%\begin{enumerate}\csname c@enumi\endcsname=-1
-%^^A
-%\item Modern spelling and hyphenation; this is the default setting.
-%^^A
-%\item Medieval spelling and hyphenation: in this spelling the lower and
-% upper case alphabets become the following:\\
-%\makebox[\linewidth]{\tabcolsep=2pt
-%\begin{tabular}{*{26}c}
-% a&\ae&b&c&d&e&f&g&h&i&k&l&m&n&o&\oe&p&q&r&s&t&u&x&y&z \\
-% A&\AE&B&C&D&E&F&G&H&I&K&L&M&N&O&\OE&P&Q&R&S&T&V&X&Y&Z
-%\end{tabular}}
-% It must be noted that this file description language does not make
-% any spelling correction in order to use only `u' in lower case and only
-% `V' in upper case: if the input text is wrongly typed in, it remains as
-% such; this means it's the typesetter's responsibility to correctly input
-% the source text to be typeset; in spite of this, when the transformation
-% from lower to upper case is performed (such as, for example, while
-% typesetting headers with some classes) the correct capitalisation is
-% performed and `u' is capitalised to `V'; the reverse takes place when
-% transforming to lowercase.
-%^^A
-%\item Classical Latin and classical hyphenation; the spelling is similar
-% to the medieval one, except for the ligatures \ae, \AE, \oe\ and \OE\
-% that are missing; again it is the typesetter's responsibility to input the
-% text to be typeset in a correct way; while the hyphenation patterns for
-% modern and medieval Latin form a non contrasting set of patterns, this
-% is impossible with classical Latin and a different pattern set has been
-% prepared as explained below.
-%^^A
-%\item Modern spelling with prosodic marks: this is to be used mainly
-% in modern grammars and dictionaries. Its settings can be turned on and
-% off according to the user needs.
-%^^A
-% \item Ecclesiastic Latin is a spelling variety of modern Latin; it is
-% taken care by the external module |ecclesiastic.sty|, that is being loaded
-% by this language description file at the right moment, that is when \babel\
-% has been completely read together with all the options and modifiers.
-% This special spelling of modern Latin is used in theological
-% and devotional books of the Roman Catholic clergy where ligatures \ae\
-% and \oe\ are widely used and where acute accents are used in order to
-% mark the tonic vowel of many words so as to allows clergy with different
-% backgrounds and mother languages to recite their community prayers with
-% the same rhythmic scheme.
-% This ecclesiastic Latin spelling contains also other differences, including
-% a certain degree of ``frenchisation'' of spaces around some punctuation
-% marks and guillemots, and the typesetting style of footnotes.
-% When this spelling is chosen, its features are
-% irrevocable, especially those that concern spacing. And this is the main
-% reason why we decided not to include the ecclesiastic style modifications
-% into the language description file, thus avoiding to mess up any setting
-% for the other Latin typesetting styles.
-%^^A
-%\end{enumerate}
-%
-% Package \babel\ is not directly concerned with hyphenation; nevertheless
-% in this case it is necessary to switch the hyphenation rules to those
-% of another language, |classiclatin|, that must be available
-% while creating the format files so that this language description
-% file can chose between the modern and medieval hyphenation rules or
-% the classical ones.
-%
-% In summary modern and medieval Latin hyphenation rules are similar
-% to those of current Italian, except that the patterns must include
-% also some consonant groups that do not exist in Italian; furthermore
-% with medieval spelling there are many more vocalic groups than in
-% Italian, because of the widespread use of the letter `u' that often
-% actually plays the r\^ole of a consonant.
-%
-% The rules for classical Latin are taken from Raffaello Farina and Nino
-% Marinone's guide \emph{Metodologia} published by Societ\`a Editrice
-% Internazionale, Torino, 1979.
-% In spite of the publication date of this guide the
-% hyphenation rules did not change in the meanwhile, since the Classical
-% Latin Language is sort of frozen during the past, say, twenty
-% centuries. Yes, it is true that the original writings in Classical
-% Latin were not hyphenated, and the hyphenation rules were established
-% at the beginning of the Renaissance, when mechanical typography
-% required suitable justification. Therefore such rules are sort of a
-% compromise between the procedures used by the various proto-typographers
-% and the scholars' of these disciplines. Nevertheless the rules given
-% by Farina and Marinone are generally shared among modern
-% scholars and are sort of official at both universities of Torino
-% and Vercelli; in the latter University they are adopted by the working
-% group that founded the DigilibLT laboratory; I acknowledge their
-% contribution in letting me become aware of the problem, and therefore
-% to create this update by adding the classical Latin support for the
-% \pkg{babel} package, with its special hyphenation rules.
-%
-% In order to implement the above described styles of typesetting,
-% four modifiers/attributes have to be defined: |medieval|, |withprosodicmarks|,
-% |classic|, and |ecclesiastic|. They can be used in any order so that
-% several combinations are possible, although, generally speaking, just
-% the isolated four described ones have a real meaning.
-%
-% Among these modifiers only |withprosodicmarks| can be turned on and off;
-% the others are sort of global; for example, once |classic| is specified,
-% there is no easy way to revert to modern spelling and hypehenation; the
-% same holds true for the other modifiers, except |withprosodicmarks|.
-%
-% The typesetting style |withprosodicmarks| is
-% defined in order to use special shorthands for inserting breves
-% and macrons while typesetting grammars, dictionaries, teaching
-% texts, and the like, where prosodic marks are important for the
-% complete information on the words or the verses. The shorthands,
-% listed in table~\ref{t:lashrtct} and described in
-% subsection~\ref{s:shrtcts}, may interfere with other packages;
-% therefore by default this style is turned off and no interference
-% is introduced. If this style is used and interference is
-% experienced, there are special commands for turning on and off
-% its specific shorthand commands.
-%
-% For what concerns \babel\ and typesetting with \LaTeX, the
-% differences between the spelling styles reveal themselves
-% in the strings used to name, for example, the ``Preface'' that
-% becomes ``Praefatio'' or ``Pr\ae fatio'' respectively.
-% Hyphenation rules are also different, but the hyphenation pattern
-% file \file{hyph-la.tex} takes care of the modern and medieval versions
-% of the language, while \file{hyph-la-x-classic.tex} takes care of the
-% classical hyphenation. The user should not attempt to modify these files,
-% because they are not dealt with by \babel\ they are used only during the
-% creation of format files. If some errors or modifications are required
-% or suggested, it is necessary to ask their maintainer.
-%
-% The name strings for chapters, figures, tables, et cetera, have been
-% suggested by prof. Raffaella Tabacco, a latinist of the
-% University of Vercelli, Italy, to whom we address our warmest
-% thanks. The names suggested by Krzysztof Konrad \.Zelechowski,
-% when different, are used as the names for the medieval variety,
-% since he made a word and spelling choice more suited for this
-% variety.
-%
-% For this language some shorthands are defined according to
-% table~\ref{t:lashrtct}; all of them are supposed to work with
-% all spelling styles, except where the opposite is explicitly
-% stated.
-% \begin{table}[htb]\centering
-% \begin{tabular}{cp{80mm}}
-% |^i| & inserts the breve accent as \u{\i}; valid also for the
-% other lowercase vowels, but it does not operate on the
-% medieval ligatures \ae\ and \oe\ because they are naturally long.\\
-% |=a| & inserts the macron accent as \=a; valid also for the
-% other lowercase vowels, but it does not operate on the
-% medieval ligatures \ae\ and \oe\ because they are naturally long.\\
-% |"| & inserts a compound word mark where hyphenation is legal;
-% the next character must not be either a non-letter token
-% or an accented letter (for foreign names). With the ecclesiastic
-% spelling it eases the insertion of the ligatures \ae\ and \oe\
-% by simply typing \texttt{\string"ae} and \texttt{\string"oe}
-% without the need of curly brackets or spaces after the character
-% macros |\ae| and |\oe|.\\
-% \texttt{\string"\string|}
-% & inserts a compound word mark, but operates also when the next token
-% is not a letter or it is an accented character.
-% \end{tabular}
-% \caption[]{Shorthands defined for the Latin language. The
-% characters \texttt{\string^} and \texttt{\string=} are
-% active only when the language attribute
-% \texttt{withprosodicmarks} has been declared,
-% otherwise they are disabled; see
-% subsection~\ref{s:shrtcts} at page~\pageref{s:shrtcts}
-% for more details.}%
-% \label{t:lashrtct}
+% For maximum compatibility, replace
+% \begin{itemize}
+% \item |\usepackage[latin.classic]{babel}| by
+% |\usepackage[classiclatin]{babel}|,
+% \item |\usepackage[latin.medieval]{babel}| by
+% |\usepackage[medievallatin]{babel}|,
+% \item |\usepackage[latin.ecclesiastic]{babel}| by\\
+% |\usepackage[ecclesiasticlatin.ecclesiasticfootnotes,activeacute]{babel}|.
+% \end{itemize}
+%
+% The last replacement is also recommended if you have been loading the
+% \package{ecclesiastic} package so far. This package is no longer necessary
+% as its functionality is provided by \babellatin{} now.
+%
+% \section{Hyphenation\label{hyphenation}}
+% \changes{4.0}{2021/06/27}{Document activation of the
+% \hyphpat{liturgicallatin} hyphenation patterns}
+% There are three different sets of hyphenation patterns for Latin,
+% reflecting three different styles of hyphenation: \emph{classical},
+% \emph{modern}, and \emph{liturgical}. Separate documention for these
+% hyphenation styles is available on the
+% Internet.\footnote{\url{https://github.com/gregorio-project/hyphen-la/blob/master/doc/README.md\#hyphenation-styles}}
+% Each of the four Latin language variants has its default hyphenation style
+% as indicated by table \ref{tab:latin-hyphenation}. Use the
+% \cs{babelprovide} command with the |hyphenrules| option if the default
+% style does not fit your needs.
+% \begin{table}
+% \centering
+% \begin{tabular}{lll}
+% \toprule
+% \emph{Language variant} & \emph{Hyphenation style} &
+% \emph{Name of patterns} \\
+% \midrule
+% \lang{latin} & modern & \hyphpat{latin} \\
+% \lang{classiclatin} & classical & \hyphpat{classiclatin} \\
+% \lang{medievallatin} & modern & \hyphpat{latin} \\
+% \lang{ecclesiasticlatin} & modern & \hyphpat{latin} \\
+% -- & liturgical & \hyphpat{liturgicallatin} \\
+% \bottomrule
+% \end{tabular}
+% \caption{\label{tab:latin-hyphenation}Latin hyphenation styles}
% \end{table}
%
-% The user should attentively remember that this file describes an option
-% for the \pkg{babel} package; it works as expected when a document containing
-% a text in part or completely in Latin is being processed with |pdfLaTeX|
-% and 8-bit encoded fonts that contain at most 256 glyphs. \babel\ can be
-% used also with |XeLaTeX| and possibly by |LuaLaTeX|, may be with reduced
-% functionalities; expect anomalous results if you typeset your document
-% with this language option and |XeLaTeX|. If you need the functionalities
-% provided by |XeLaTeX| or |LuaLaTeX|, then use |polyglossia| in place of
-% \babel\ and set the Latin desired functionalities with suitable values to
-% the |variant| keyword to the Latin language specifications; The valid values
-% have the same names as this \babel\ module modifiers, i.e.\ |medieval|,
-% |classic|, |ecclesiastic|; with |XeLaTeX| and |LuaLaTeX| that use OpenType
-% fonts, the |withprosodicmaks| functionality is not required as the required
-% glyphs can be directly input with a UNICODE input encoding. Actually with
-% such an encoding this modifier is not necessary even with |pdfLaTeX|, but
-% it eases input when one is using a vintage computer or operating system; backwards compatibility is therefore maintained.
-% \StopEventually{}
+% To typeset a liturgical book in the recent “Solesmes style” say
+% \begin{quote}
+% |\usepackage[ecclesiasticlatin.lowercasemonth]{babel}| \\
+% |\babelprovide[hyphenrules=liturgicallatin]{ecclesiasticlatin}|
+% \end{quote}
+% The typical commands for a Latin text edition in the German-speaking
+% world will be
+% \begin{quote}
+% |\usepackage[latin]{babel}| \\
+% |\babelprovide[hyphenrules=classiclatin]{latin}|
+% \end{quote}
+% Note that the liturgical hyphenation patterns are the default of none of
+% the language variants. To use them, you have to load them explicitly in
+% any case.
%
-% \section{The code}
+% \section{Shorthands\label{shorthands}}
+% \changes{0.99}{1999/12/06}{Added shorthands for etymological hyphenation}
+% \changes{2.0b}{2000/12/13}{Simplified shorthands for
+% etymological hyphenation}
+% \changes{4.0}{2021/06/27}{Additional shorthands for guillemets and accented
+% letters for all language variants; additional shorthands for ligatures
+% for medieval and ecclesiastic Latin}
+% The following shorthands are available for all variants of Latin. Note
+% that shorthands beginning with |'| are only available if you load \babel{}
+% with the \modifier{activeacute} option.
+% \begin{shorthands}
+% \item[|"<|] for « (left guillemet)
+% \item[|">|] for » (right guillemet)
+% \item[|"|] If no other shorthand applies, |"| before any letter
+% character defines an optional break point allowing further break
+% points within the same word (as opposed to the |\-| command).
+% \item[\texttt{"\string|}] the same as |"|, but also possible before
+% non-letter characters
+% \item[|'a|] for á (a with acute), also available for é, í, ó, ú, ý, ǽ,
+% and \'œ
+% \item[|'A|] for Á (A with acute), also available for É, Í, Ó, Ú, \'V, Ý,
+% Ǽ, and \'Œ
+% \end{shorthands}
+% The following shorthands are only available for the \lang{medievallatin}
+% and the \lang{ecclesiasticlatin} languages. Again, the shorthands
+% beginning with |'| only work with \babel's \modifier{activeacute} option.
+% \begin{shorthands}
+% \item[|"ae|] for æ (ae ligature), also available for œ
+% \item[|"Ae|] for Æ (AE ligature), also available for Œ
+% \item[|"AE|] for Æ (AE ligature), also available for Œ
+% \item[|'ae|] for ǽ (ae ligature with acute), also available for \'œ
+% \item[|'Ae|] for Ǽ (AE ligature with acute), also available for \'Œ
+% \item[|'AE|] for Ǽ (AE ligature with acute), also available for \'Œ
+% \end{shorthands}
+% Furthermore, there are shorthands for prosodic marks; see section
+% \ref{prosodic}.
+% Note the incompatibilities described in section \ref{incompatibilities}.
+%
+% \section{Incompatibilities with other packages\label{incompatibilities}}
+% \changes{4.0}{2021/06/27}{Document incompatibilities with other packages}
+% \subsection{\package{unicode-math}}
+% Loading the Latin language together with the \modifier{activeacute}
+% \babel{} option may cause error messages if the \package{unicode-math}
+% package is loaded. Do not use \modifier{activeacute} if you need
+% \package{unicode-math}, even if Latin is only a secondary language of your
+% document.\footnote{See
+% \url{https://github.com/wspr/unicode-math/issues/462} and
+% \url{https://github.com/reutenauer/polyglossia/issues/394} for related
+% discussions.}
%
+% \subsection{\LuaTeX}
+% The |"| character is made active by \babellatin; its use within the
+% \cs{directlua} command will lead to problems (except in the preamble).
+% Switch the shorthand off for such commands:
+% \begin{quote}
+% |\shorthandoff{"}|\\
+% |\directlua{tex.print("Salve")}|\\
+% |\shorthandon{"}|
+% \end{quote}
+% You may avoid the shorthand switching by using single instead of double
+% quotes. However, note that this will not work if the
+% \modifier{activeacute} option is used, as |'| is active in this case as
+% well.
+%
+% Furthermore, beware of using \cs{directlua} commands containing the |=|
+% character between \cs{ProsodicMarksOn} and \cs{ProsodicMarksOff} if you
+% load the Latin language with the \modifier{withprosodicmarks} modifier.
+%
+% \subsection{\package{babel-turkish}}
+% Both Turkish and Latin (when loaded with the \modifier{withprosodicmarks}
+% modifier) make the |=| character active. However, \babellatin{} takes care
+% the active behaviour of this character is only enabled between
+% \cs{ProsodicMarksOn} and \cs{ProsodicMarksOff} to avoid conflicts with
+% packages using |key=value| interfaces.
+%
+% If you need Latin with prosodic shorthands and Turkish with active |=|
+% character in one document, you have to say |\shorthandon{=}| before the
+% first occurence of |=| in each Turkish text part.
+%
+% \subsection{\package{babel-esperanto}, \package{babel-kurmanji}, and
+% \package{babel-slovak}}
+% Esperanto, Kurmanji, Slovak, and Latin (when loaded with the
+% \modifier{withprosodicmarks} modifier) make the |^| character active.
+% However, \babellatin{} takes care the active behaviour of this character
+% is only enabled between \cs{ProsodicMarksOn} and \cs{ProsodicMarksOff} to
+% avoid conflicts with \TeX's |^^xx| convention.
+%
+% If you need Latin with prosodic shorthands and Esperanto/Kurmanji/Slovak
+% with active |^| character in one document, you have to say
+% |\shorthandon{^}| before the first occurence of |^| in each
+% Esperanto/Kurmanji/Slovak text part.
+%
+% \section{Plain \TeX}
+% \changes{4.0}{2021/06/27}{Basic support for plain \TeX}
+% According to the \babel{} manual, the recommended way to load the Latin
+% language in plain \TeX{} is:
+% \begin{quote}
+% |\input latin.sty|\\
+% |\begindocument|
+% \end{quote}
+% The modifiers \modifier{usej} and \modifier{lowercasemonth} may be
+% accessed by means of the \cs{languageattribute} command:
+% \begin{quote}
+% |\input latin.sty|\\
+% |\languageattribute{latin}{usej,lowercasemonth}|\\
+% |\begindocument|
+% \end{quote}
+%
+% \babel{} does not provide |sty| files for \lang{classiclatin},
+% \lang{medievallatin}, and \lang{ecclesiasticlatin}. It should be possible
+% to create them locally if needed.
+%
+% Note that no Latin shorthands are available in plain \TeX.
+% \StopEventually{}
+% \iffalse
+%<*latin>
+% \fi
+% \section{The code}
+% \changes{4.0}{2021/06/27}{Keep the default values of \cs{clubpenalty},
+% \cs{@clubpenalty}, \cs{widowpenalty}, and \cs{finalhyphendemerits}
+% for Latin}
+% \changes{4.0}{2021/06/27}{Remove commands \cs{LatinMarksOn} and
+% \cs{LatinMarksOff}}
+% We identify the language definition file.
+% \begin{macrocode}
+\ProvidesLanguage{latin}[2021-06-27 v4.0 Latin support from the babel system]
+% \end{macrocode}
% The macro |\LdfInit| takes care of preventing that this file is
-% loaded more than once, checking the category code of the
-% \texttt{@} sign, etc.
-%\iffalse
-%<*code>
-%\fi
+% loaded more than once with the same option, checking the category
+% code of the \texttt{@} sign, etc.
+% \cs{CurrentOption} is the language requested by the user, i.\,e.,
+% \lang{latin}, \lang{classiclatin}, \lang{medievallatin}, or
+% \lang{ecclesiasticlatin}.
% \begin{macrocode}
-\LdfInit{latin}{captionslatin}
+\LdfInit\CurrentOption{captions\CurrentOption}
% \end{macrocode}
-%
-% Never load this file as if it was a |.sty| file by means of the
-% |\usepackage| command; this practice is deprecated. We check for
-% the existence of |\l@latin| to see whether we have to do something here.
-%
+% For tests, we need variables containing three possible values of the
+% language name.
% \begin{macrocode}
-\ifx\undefined\l@latin
- \@nopatterns{Latin}
- \adddialect\l@latin0\fi
+\def\babellatin@classic{classiclatin}
+\def\babellatin@medieval{medievallatin}
+\def\babellatin@ecclesiastic{ecclesiasticlatin}
% \end{macrocode}
-%
-%
-% Now we declare the |medieval| language attribute.
+% \subsection{Hyphenation patterns}
+% The Latin hyphenation patterns can be used with |\lefthyphenmin|
+% and |\righthyphenmin| set to~2.
% \begin{macrocode}
-\bbl@declare@ttribute{latin}{medieval}{%
- \addto\captionslatin{\def\prefacename{Pr{\ae}fatio}}%
- \expandafter\addto\expandafter\extraslatin
- \expandafter{\extrasmedievallatin}%
- }
+\providehyphenmins{\CurrentOption}{\tw@\tw@}
% \end{macrocode}
-%
-% The typesetting style |withprosodicmarks| is defined here:
+% We define macros for testing if the required hyphenation patterns are
+% available.
% \begin{macrocode}
-\bbl@declare@ttribute{latin}{withprosodicmarks}{%
- \expandafter\addto\expandafter\extraslatin
- \expandafter{\extraswithprosodicmarks}%
- }
+\def\babellatin@test@modern@patterns{%
+ \ifx\l@latin\undefined
+ \@nopatterns{latin}%
+ \adddialect\l@latin0
+ \fi}%
+\def\babellatin@test@classic@patterns{%
+ \ifx\l@classiclatin\undefined
+ \PackageWarningNoLine{babel-latin}{%
+ No hyphenation patterns were found for the\MessageBreak
+ classiclatin language. Now I will use the\MessageBreak
+ patterns for modern Latin instead}%
+ \babellatin@test@modern@patterns
+ \adddialect\l@classiclatin\l@latin
+ \fi}%
% \end{macrocode}
-%
-% The `classic' typesetting style is described here: notice that the general
-% typesetting rules are identical with those of modern Latin, the default
-% one, but the hyphenation rules are different; therefore we just change
-% the meaning of counter |\l@latin| so that it points to the language
-% counter of classical Latin. In order to avoid a fatal error we test if
-% language |classiclatin| has its patterns already loaded, otherwise we issue
-% a warning and keep going with the default modern hyphenation
+% We use the \lang{classiclatin} hyphenation patterns for classical Latin
+% and the (modern) \lang{latin} hyphenation patterns for all other varieties
+% of Latin.
% \begin{macrocode}
-\bbl@declare@ttribute{latin}{classic}{%
- \expandafter\addto\expandafter\extraslatin
- \expandafter{\extrasclassic}%
- }
-\ifx\l@classiclatin\undefined
- \let\l@classiclatin\l@latin
- \PackageWarningNoLine{babel}{%
- Attention: hyphenation patterns for language\MessageBreak
- classiclatin have not been loaded.\MessageBreak
- I go on using the modern Latin hyphenation patterns.\MessageBreak
- Please, load the suitable patterns or upgrade your TeX distribution}
+\ifx\CurrentOption\babellatin@classic
+ \babellatin@test@classic@patterns
+\else
+ \ifx\CurrentOption\babellatin@ecclesiastic
+ \babellatin@test@modern@patterns
+ \adddialect\l@ecclesiasticlatin\l@latin
+ \else
+ \ifx\CurrentOption\babellatin@medieval
+ \babellatin@test@modern@patterns
+ \adddialect\l@medievallatin\l@latin
+ \else
+ \babellatin@test@modern@patterns
+ \fi
+ \fi
\fi
-\addto\extrasclassic{\let\l@latin\l@classiclatin}
-% \end{macrocode}
-% It must be remembered that the |medieval| and the |withprosodicmarks|
-% styles might be used together. They are also compatible with
-% the |classic| attribute, but it would be unusual to typeset classical
-% Latin with some medieval features and/or with the prosodic marks that were
-% unknown twenty centuries ago.
-%
-% The next step consists in defining commands to switch to (and
-% from) the Latin language\footnote{Most of these names were
-% kindly suggested by Raffaella Tabacco.}.
-%
-% \begin{macro}{\captionslatin}
-% The macro |\captionslatin| defines all strings used
-% in the four standard document classes provided with \LaTeX.
-% \begin{macrocode}
-\@namedef{captionslatin}{%
- \def\prefacename{Praefatio}%
- \def\refname{Conspectus librorum}%
- \def\abstractname{Summarium}%
- \def\bibname{Conspectus librorum}%
- \def\chaptername{Caput}%
- \def\appendixname{Additamentum}%
- \def\contentsname{Index}%
- \def\listfigurename{Conspectus descriptionum}%
- \def\listtablename{Conspectus tabularum}%
- \def\indexname{Index rerum notabilium}%
- \def\figurename{Descriptio}%
- \def\tablename{Tabula}%
- \def\partname{Pars}%
- \def\enclname{Adduntur}% Or " Additur" ? Or simply Add.?
- \def\ccname{Exemplar}% Use the recipient's dative
- \def\headtoname{\ignorespaces}% Use the recipient's dative
- \def\pagename{Charta}%
- \def\seename{cfr.}%
- \def\alsoname{cfr.}% Tabacco never saw "cfr" + `atque' or similar forms
- \def\proofname{Demonstratio}%
- \def\glossaryname{Glossarium}%
- }
-% \end{macrocode}
-% \end{macro}
-% In the above definitions there are some points that might change
+% \end{macrocode}
+% \subsection{Latin captions}
+% We need a conditional governing the spelling of the captions. Medieval
+% and ecclesiastic Latin use the ligatures \ae{} and \oe, classical and
+% modern Latin do not.
+% \begin{macrocode}
+\newif\ifbabellatin@useligatures
+\addto\extrasmedievallatin{\babellatin@useligaturestrue}%
+\addto\noextrasmedievallatin{\babellatin@useligaturesfalse}%
+\addto\extrasecclesiasticlatin{\babellatin@useligaturestrue}%
+\addto\noextrasecclesiasticlatin{\babellatin@useligaturesfalse}%
+% \end{macrocode}
+% We define the Latin captions using the commands recommended by the
+% \babel{} manual.\footnote{Most of these names were kindly suggested by
+% Raffaella Tabacco.}
+% \begin{macrocode}
+\StartBabelCommands*{\CurrentOption}{captions}
+ \SetString\prefacename{\ifbabellatin@useligatures Pr\ae fatio\else Praefatio\fi}
+ \SetString\refname{Conspectus librorum}
+ \SetString\abstractname{Summarium}
+ \SetString\bibname{Conspectus librorum}
+ \SetString\chaptername{Caput}
+ \SetString\appendixname{Additamentum}
+ \SetString\contentsname{Index}
+ \SetString\listfigurename{Conspectus descriptionum}
+ \SetString\listtablename{Conspectus tabularum}
+ \SetString\indexname{Index rerum notabilium}
+ \SetString\figurename{Descriptio}
+ \SetString\tablename{Tabula}
+ \SetString\partname{Pars}
+ \SetString\enclname{Adduntur}% Or "Additur"? Or simply Add.?
+ \SetString\ccname{Exemplar}% Use the recipient's dative
+ \SetString\headtoname{\ignorespaces}% Use the recipient's dative
+ \SetString\pagename{Charta}
+ \SetString\seename{cfr.}
+ \SetString\alsoname{cfr.}% Tabacco never saw "cfr" + "atque" or similar forms
+ \SetString\proofname{Demonstratio}
+ \SetString\glossaryname{Glossarium}
+% \end{macrocode}
+% In the above definitions there are some points that might change
% in the future or that require a minimum of attention from the
% typesetter.
% \begin{enumerate}
-% \item the \cs{enclname} is translated by a passive verb, that
-% literally means ``(they) are being added''; if just one
-% enclosure is joined to the document, the plural passive is not
-% suited any more; nevertheless a generic plural passive might be
-% incorrect but suited for most circumstances. On the opposite
-% ``Additur'', the corresponding singular passive, might be more
-% correct with one enclosure and less suited in general: what
+% \item The \cs{enclname} is translated by a passive verb, that
+% literally means ``(they) are being added''; if just one
+% enclosure is joined to the document, the plural passive is not
+% suited any more; nevertheless a generic plural passive might be
+% incorrect but suited for most circumstances. On the opposite
+% ``Additur'', the corresponding singular passive, might be more
+% correct with one enclosure and less suited in general: what
% about the abbreviation ``Add.'' that works in both cases, but
% certainly is less elegant?
-% \item The \cs{headtoname} is empty and gobbles the possible
-% following space; in practice the typesetter should use the
-% dative of the recipient's name; since nowadays not all such
-% names can be translated into Latin, they might result
-% indeclinable. The clever use of a dative appellative by the
-% typesetter such as ``Domino'' or ``Dominae'' might solve the
-% problem, but the header might get too impressive. The typesetter
+% \item The \cs{headtoname} is empty and gobbles the possible
+% following space; in practice the typesetter should use the
+% dative of the recipient's name; since nowadays not all such
+% names can be translated into Latin, they might result
+% indeclinable. The clever use of a dative appellative by the
+% typesetter such as ``Domino'' or ``Dominae'' might solve the
+% problem, but the header might get too impressive. The typesetter
% must make a decision on his own.
-% \item The same holds true for the copy recipient's name in the
+% \item The same holds true for the copy recipient's name in the
% ``Cc'' field of \cs{ccname}.
% \end{enumerate}
+% \subsection{Mapping between upper and lower case}
+% For classical and medieval Latin we need the suitable correspondence
+% between upper-case V and lower-case u since in that spelling there is
+% only one letter for the vowel and the consonant, and the u shape is an
+% (uncial) variant of the capital V.
%
-% \begin{macro}{\datelatin}
-% The macro |\datelatin| redefines the command |\today| to produce
-% Latin dates; the choice of small caps Latin numerals for the day number is
-% arbitrary and may be changed in the future. For medieval and classic Latin
-% the spelling of `Novembris' should be \textit{Nouembris}. This is
-% taken care of by using a control sequence which can be redefined
-% when the attribute `medieval' and/or `classic' is selected.
-% \changes{latin-2.0f}{2005/03/30}{Added a comment character to
-% prevent unwanted space}
-% \changes{latin-2.0k}{2011/02/06}{Inserted the various `November' Latin
-% spellings to the proper `extras' macros}
-% \begin{macrocode}
-\addto\extraslatin{\def\november{Novembris}}
-\addto\extrasmedievallatin{\def\november{Nouembris}}
-\addto\extrasclassiclatin{\def\november{Nouembris}}
-%
-\def\datelatin{%
+% We use the commands recommended by the \babel{} manual.
+% \begin{macrocode}
+\StartBabelCommands*{classiclatin,medievallatin}{}
+% \end{macrocode}
+% The following command takes care for the correct behaviour of the
+% \cs{MakeUppercase} and the \cs{MakeLowercase} command. It makes sure that
+% |\MakeUppercase{Heluetia}| yields ``HELVETIA'' and that
+% |\MakeLowercase{LVDVS}| yields ``ludus''.
+% \begin{macrocode}
+ \SetCase{\uccode`u=`V}{\lccode`V=`u}
+% \end{macrocode}
+% The following command takes care for the correct hyphenation of words
+% written in capital letters. It makes sure that “LVDVS” is hyphenated the
+% same way as “ludus”.
+% \begin{macrocode}
+ \SetHyphenMap{\BabelLower{`V}{`u}}
+% \end{macrocode}
+% For Unicode-based engines, we also have to take into account characters
+% with diacritics. We map ú, ū, and ŭ to V because Unicode does not define a
+% single-character V with the respective diacritic.
+% \begin{macrocode}
+\StartBabelCommands{classiclatin,medievallatin}{}[unicode,fontenc=TU,charset=utf8]
+ \SetCase{\uccode`u=`V \uccode`ú=`V \uccode`ū=`V \uccode`ŭ=`V}{\lccode`V=`u}
+% \end{macrocode}
+% According to the \babel{} manual, the last \cs{StartBabelCommands} block
+% has to be finished by the following command.
+% \begin{macrocode}
+\EndBabelCommands
+% \end{macrocode}
+% \subsection{The Latin date}
+% \changes{2.0k}{2011/02/06}{Inserted the various `November' Latin
+% spellings to the proper `extras' macros}
+% \changes{4.0}{2021/06/27}{Do not use small caps for the day of month}
+% We need three conditionals governing the spelling of the month names.
+% Ecclesiastic and modern Latin use the character v, classical and medieval
+% Latin use only u. This affects the month of November. The user may demand
+% to use the letter j where suitable or to lowercase month names using the
+% respective modifiers.
+% \begin{macrocode}
+\newif\ifbabellatin@usev
+\newif\ifbabellatin@usej
+\newif\ifbabellatin@lowercasemonth
+\babellatin@usevtrue
+\addto\extrasclassiclatin{\babellatin@usevfalse}%
+\addto\noextrasclassiclatin{\babellatin@usevtrue}%
+\addto\extrasmedievallatin{\babellatin@usevfalse}%
+\addto\noextrasmedievallatin{\babellatin@usevtrue}%
+% \end{macrocode}
+% The Latin month names are needed in the genitive case.
+% \begin{macrocode}
+\def\babellatin@monthname{%
+ \ifcase\month\or\ifbabellatin@usej Januarii\else Ianuarii\fi
+ \or Februarii%
+ \or Martii%
+ \or Aprilis%
+ \or\ifbabellatin@usej Maji\else Maii\fi
+ \or\ifbabellatin@usej Junii\else Iunii\fi
+ \or\ifbabellatin@usej Julii\else Iulii\fi
+ \or Augusti%
+ \or Septembris%
+ \or Octobris%
+ \or\ifbabellatin@usev Novembris\else Nouembris\fi
+ \or Decembris%
+ \fi}%
+% \end{macrocode}
+% Depending on the chosen language, we have to define a \cs{latindate},
+% \cs{classiclatindate}, \cs{medievallatindate}, or
+% \cs{ecclesiasticlatindate} command. The date format is “XXXI Decembris
+% MMXXI”.
+% \begin{macrocode}
+\expandafter\def\csname date\CurrentOption\endcsname{%
\def\today{%
- {\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont
- \uppercase\expandafter{\romannumeral\day}}~\ifcase\month\or
- Ianuarii\or Februarii\or Martii\or Aprilis\or Maii\or Iunii\or
- Iulii\or Augusti\or Septembris\or Octobris\or \november\or
- Decembris\fi
- \space{\uppercase\expandafter{\romannumeral\year}}}}
+ \uppercase\expandafter{\romannumeral\day}~%
+ \ifbabellatin@lowercasemonth
+ \lowercase\expandafter{\babellatin@monthname}%
+ \else
+ \babellatin@monthname
+ \fi
+ \space
+ \uppercase\expandafter{\romannumeral\year}%
+ }%
+}%
% \end{macrocode}
-% \end{macro}
+% \subsection{Shorthands}
+% We define shorthands only if the \LaTeX{} format is used because we need
+% commands for them that are not available in plain \TeX.
+% \begin{macrocode}
+\def\babellatin@latex{LaTeX2e}%
+\ifx\fmtname\babellatin@latex
+% \end{macrocode}
+% Every shorthand character needs an \cs{initiate@active@char} command,
+% which makes the respective character active, but expanding to itself as
+% long as no further definitions occur. The apostrophe (acute) is only made
+% active if \babel{} has been called with the \modifier{activeacute} option.
+% \begin{macrocode}
+ \initiate@active@char{"}%
+ \@ifpackagewith{babel}{activeacute}{\initiate@active@char{'}}{}%
+% \end{macrocode}
+% The following command is defined by the \package{hyperref} package. We use
+% a dummy definition if this package is not loaded.
+% \begin{macrocode}
+ \providecommand\texorpdfstring[2]{#1}%
+% \end{macrocode}
+% A peculiarity of the \babellatin{} package are shorthands of different
+% lengths. |"| before a letter character defines an additional hyphenation
+% point, but |"ae| is a shorthand for the ligature `æ' in medieval and
+% ecclesiastic Latin. So the shorthands definitions are rather complex and
+% we need expl3 syntax for them.
+% \begin{macrocode}
+ \ExplSyntaxOn
+% \end{macrocode}
+% The character |"| is used as a shorthand unconditionally. In math mode it
+% expands to itself. In text mode it is defined as a macro with one
+% parameter. This makes it possible to read the following token, on which
+% the actual meaning of the shorthand depends.
+% \begin{macrocode}
+ \declare@shorthand {latin} {"}
+ {
+ \mode_if_math:TF { \token_to_str:N " }
+ {
+ \texorpdfstring { \babellatin_apply_quotemark:N } { }
+ }
+ }
+% \end{macrocode}
+% The character |'| is used as a shorthand if the \modifier{activeacute}
+% option is used. So we have to use a macro for the declaration, which can
+% be called if necessary. In math mode the shorthand expands to
+% \cs{active@math@prime} as defined in \file{latex.ltx}. In text mode it is
+% a macro with one argument to read the following token.
+% \begin{macrocode}
+ \cs_set_protected:Npn \babellatin@declare@apostrophe@shorthands
+ {
+ \declare@shorthand {latin} {'}
+ {
+ \mode_if_math:TF { \active@math@prime }
+ {
+ \texorpdfstring { \babellatin_put_acute:N } { \' }
+ }
+ }
+ }
+% \end{macrocode}
+% The characters |=| and |^| are only used as shorthands if the
+% \modifier{withprosodicmarks} modifier is used. So we have to use a macro
+% for the declaration, which can be called if necessary. In math mode both
+% shorthands expand to themselves. In text mode they are macros with one
+% argument to read the following token.
+% \begin{macrocode}
+ \cs_set_protected:Npn \babellatin@declare@prosodic@shorthands
+ {
+ \declare@shorthand {latin} {=}
+ {
+ \mode_if_math:TF { \token_to_str:N = }
+ {
+ \texorpdfstring { \babellatin_put_macron:N } { \= }
+ }
+ }
+ \declare@shorthand {latin} {^}
+ {
+ \mode_if_math:TF { \token_to_str:N ^ } { \babellatin_put_breve:N }
+ }
+ }
+% \end{macrocode}
+% The following macro defines the behaviour of the active |"| character.
+% The shorthands |"AE|, |"Ae|, |"ae|, |"OE|, |"Oe|, and |"oe| are used for
+% ligatures if the current variety of Latin uses them. In other cases |"|
+% before any letter character or before |\AE|, |\ae|, |\OE|, and |\oe|
+% defines an additional hyphenation point. \verb:"|: defines an additional
+% hyphenation point as well. The shorthands |"<| and |">| are used for
+% guillemets. In other cases the active |"| character expands to itself and
+% the token read as argument is reinserted.
%
-% \begin{macro}{\latinhyphenmins}
-% The Latin hyphenation patterns can be used with both
-% |\lefthyphenmin| and |\righthyphenmin| set to~2.
-% \changes{latin-2.0a}{2000/10/15}{Now use \cs{providehyphenmins} to
-% provide a default value}
+% If the argument is a braced group (e.\,g.\@ if the user has typed
+% |"{ab}|), unexpected behaviour may occur as the conditionals
+% |\token_if_letter:NTF| and |\babellatin_if_ligature_command:NTF| expect a
+% single token as first argument. Therefore we need to check if the
+% argument is a single token using the |\tl_if_single_token:nTF| command
+% before using those conditionals.
% \begin{macrocode}
-\providehyphenmins{\CurrentOption}{\tw@\tw@}
+ \cs_set_protected:Npn \babellatin_apply_quotemark:N #1
+ {
+ \str_case:nnF {#1}
+ {
+ {A} { \babellatin_ligature_shorthand:Nnn E { \AE }
+ {
+ \babellatin_ligature_shorthand:Nnn e { \AE }
+ {
+ \babellatin_allowhyphens: A
+ }
+ }
+ }
+ {a} { \babellatin_ligature_shorthand:Nnn e { \ae }
+ {
+ \babellatin_allowhyphens: a
+ }
+ }
+ {O} { \babellatin_ligature_shorthand:Nnn E { \OE }
+ {
+ \babellatin_ligature_shorthand:Nnn e { \OE }
+ {
+ \babellatin_allowhyphens: O
+ }
+ }
+ }
+ {o} { \babellatin_ligature_shorthand:Nnn e { \oe }
+ {
+ \babellatin_allowhyphens: o
+ }
+ }
+ {|} { \babellatin_allowhyphens: }
+ {<} { \babellatin@guillemetleft }
+ {>} { \babellatin@guillemetright }
+ }
+ {
+ \tl_if_single_token:nTF {#1}
+ {
+ \token_if_letter:NTF #1 { \babellatin_allowhyphens: }
+ {
+ \babellatin_if_ligature_command:NTF #1 { \babellatin_allowhyphens: }
+ {
+ \token_to_str:N "
+ }
+ }
+ }
+ {
+ \token_to_str:N "
+ }
+ #1
+ }
+ }
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\extraslatin}
-% \begin{macro}{\noextraslatin}
-% For Latin the |\clubpenalty|, |\widowpenalty| are set to
-% rather high values and |\finalhyphendemerits| is set to such a
-% high value that hyphenation is almost prohibited between the last two
-% lines of a paragraph.
-%
-% \begin{macrocode}
-\addto\extraslatin{%
- \babel@savevariable\clubpenalty
- \babel@savevariable\@clubpenalty
- \babel@savevariable\widowpenalty
- \clubpenalty3000\@clubpenalty3000\widowpenalty3000}
-% \end{macrocode}
-% Hopefully never ever break a word between the last two lines of
-% a paragraph in Latin texts.
-% \begin{macrocode}
-\addto\extraslatin{%
- \babel@savevariable\finalhyphendemerits
- \finalhyphendemerits50000000}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% With medieval and classic Latin we need the suitable correspondence between
-% upper case V and lower case u, since in that spelling there is
-% only one sign, and the u shape is the (uncial) version of the
-% capital V. Everything else is identical with Latin.
-% \begin{macrocode}
-\addto\extrasmedievallatin{%
-\babel@savevariable{\lccode`\V}%
-\babel@savevariable{\uccode`\u}%
-\lccode`\V=`\u \uccode`\u=`\V}
-\addto\extrasclassiclatin{%
-\babel@savevariable{\lccode`\V}%
-\babel@savevariable{\uccode`\u}%
-\lccode`\V=`\u \uccode`\u=`\V}
-% \end{macrocode}
-%
-% \begin{macro}{\SetLatinLigatures}
-% We need also the lccodes for \ae\ and \oe; since they occupy
-% different positions in the OT1 \TeX-fontencoding compared to the
-% T1 one, we must save the lc- and the uccodes for both encodings,
-% but we specify the new lc- and uccodes separately as it appears
-% natural not to change encoding while typesetting the same
-% language. The encoding is assumed to be set before starting to
-% use the Latin language, so that if Latin is the default language,
-% the font encoding must be chosen before requiring the \babel\
-% package with the |latin| option, in any case before any
-% |\selectlanguage| or |\foreignlanguage| command.
-%
-% All this fuss is made in order to allow the use of the medieval
-% ligatures \ae\ and \oe\ while typesetting with the medieval
-% spelling; I have my doubts that the medieval spelling should be
-% used at all in modern books, reports, and the like; the uncial
-% `u' shape of the lower case `v' and the above ligatures were
-% fancy styles of the copyists who were able to write faster with
-% those rounded glyphs; with typesetting there is no question of
-% handling a quill penn\dots\ Moreover in medieval times it was very
-% frequent to close such ligatures to the corresponding sound,
-% therefore instead of writing \ae\ or \oe\ they would often simply
-% write `e'. Since my (CB) opinion may be wrong, I managed to set
-% up the instruments and it is up to the typesetter to use them or not.
-%
-% \begin{macrocode}
-\addto\extrasmedievallatin{%
- \babel@savevariable{\lccode`\^^e6}% T1 \ae
- \babel@savevariable{\uccode`\^^e6}% T1 \ae
- \babel@savevariable{\lccode`\^^c6}% T1 \AE
- \babel@savevariable{\lccode`\^^f7}% T1 \oe
- \babel@savevariable{\uccode`\^^f7}% T1 \OE
- \babel@savevariable{\lccode`\^^d7}% T1 \OE
- \babel@savevariable{\lccode`\^^1a}% OT1 \ae
- \babel@savevariable{\uccode`\^^1a}% OT1 \ae
- \babel@savevariable{\lccode`\^^1d}% OT1 \AE
- \babel@savevariable{\lccode`\^^1b}% OT1 \oe
- \babel@savevariable{\uccode`\^^1b}% OT1 \OE
- \babel@savevariable{\lccode`\^^1e}% OT1 \OE
- \SetLatinLigatures}
-
-\providecommand\SetLatinLigatures{%
- \def\@tempA{T1}\ifx\@tempA\f@encoding
- \catcode`\^^e6=11 \lccode`\^^e6=`\^^e6 \uccode`\^^e6=`\^^c6 % \ae
- \catcode`\^^c6=11 \lccode`\^^c6=`\^^e6 % \AE
- \catcode`\^^f7=11 \lccode`\^^f7=`\^^f7 \uccode`\^^f7=`\^^d7 % \oe
- \catcode`\^^d7=11 \lccode`\^^d7=`\^^f7 % \OE
- \else
- \catcode`\^^1a=11 \lccode`\^^1a=`\^^1a \uccode`\^^1a=`\^^1d % \ae
- \catcode`\^^1d=11 \lccode`\^^1d=`\^^1a % \AE
- \catcode`\^^1b=11 \lccode`\^^1b=`\^^1b \uccode`\^^1b=`\^^1e % \oe
- \catcode`\^^1e=11 \lccode`\^^1e=`\^^1b % \OE
- \fi
- \let\@tempA\@undefined
- }
-% \end{macrocode}
-% With the above definitions we are sure that |\MakeUppercase|
-% works properly and |\MakeUppercase{C{\ae}sar}| correctly yields
-% ``C{\AE}SAR''; correspondingly |\MakeUppercase{Heluetia}|
-% correctly yields ``HELVETIA''.
-% \end{macro}
-%
-% \changes{latin-2.0j}{20104/02/18}{Renamed this section to subsection}
-% \subsection{Latin shorthands}\label{s:shrtcts}
-% For writing dictionaries or school texts (in modern spelling
-% only) we defined a language attribute or
-% typesetting style, such that a couple of other active characters are
-% defined: |^| for marking a vowel with the breve sign, and |=| for
-% marking a vowel with the macron sign. Please take notice that
-% neither the OT1 font encoding, nor the T1 one for most vowels,
-% contain directly the marked vowels, therefore hyphenation of
-% words containing these ``accents'' may become problematic; for
-% this reason the above active characters not only introduce the
-% required accent, but also an unbreakable zero skip that in
-% practice does not introduce a discretionary break, but allows
-% breaks in the rest of the word.
-%
-% It must be remarked that the active characters |^| and |=| may
-% have other meanings in other contexts. For example, besides math,
-% the equals sign is used by the graphic extensions for specifying
-% keyword options for handling the graphic elements to be included
-% in the document. At the same time, as mentioned in the previous
-% paragraph, diacritical marking in Latin is used only for
-% typesetting certain kinds of document, such as grammars and
-% dictionaries. It is reasonable that the breve and macron active
-% characters are turned on and off at will; by default
-% they are off if the attribute |withprosodicmarks|
-% has not been set.
-%
-% \begin{macro}{\ProsodicMarksOn}
-% \begin{macro}{\ProsodicMarksOff}
-% We begin by adding to the normal typesetting style the
-% definitions of the new commands |\ProsodicMarksOn| and
-% |\ProsodicMarksOff| that should produce error messages when
-% this style is not declared:
-% \begin{macrocode}
-\addto\extraslatin{\def\ProsodicMarksOn{%
-\GenericError{(latin)\@spaces\@spaces\@spaces\@spaces}%
- {Latin language error: \string\ProsodicMarksOn\space
- is defined by setting the\MessageBreak
- language attribute to `withprosodicmarks'\MessageBreak
- If you continue you are likely to encounter\MessageBreak
- fatal errors that I can't recover}%
- {See the Latin language description in the babel
- documentation for explanation}{\@ehd}}}
-\addto\extraslatin{\let\ProsodicMarksOff\relax}
-% \end{macrocode}
-%
-% Next we temporarily set the caret and the equals sign to active
-% characters so that they can receive their definitions:
-% \begin{macrocode}
-\catcode`\= \active
-\catcode`\^ \active
-% \end{macrocode}
-% and we add the necessary declarations to the macros that are
-% being activated when the Latin language and its typesetting
-% styles are declared:
-% \begin{macrocode}
-\addto\extraslatin{\languageshorthands{latin}}%
-\addto\extraswithprosodicmarks{\bbl@activate{^}}%
-\addto\extraswithprosodicmarks{\bbl@activate{=}}%
-\addto\noextraswithprosodicmarks{\bbl@deactivate{^}}%
-\addto\noextraswithprosodicmarks{\bbl@deactivate{=}}%
-\addto\extraswithprosodicmarks{\ProsodicMarks}
-% \end{macrocode}
-%
-% \begin{macro}{\ProsodicMarks}
-% Next we define the macros for the active characters
-% \begin{macrocode}
-\def\ProsodicMarks{%
-\def\ProsodicMarksOn{\catcode`\^ 13\catcode`\= 13\relax}%
-\def\ProsodicMarksOff{\catcode`\^ 7\catcode`\= 12\relax}%
-}
+% The following macro defines the behaviour of the active |'| character.
+% The shorthands |'AE|, |'Ae|, |'ae|, |'OE|, |'Oe|, and |'oe| are used for
+% accented ligatures if the current variety of Latin uses them. In other
+% cases |'| before any vowel or before |\AE|, |\ae|, |\OE|, and |\oe|
+% defines an accented character. The character V is treated as a vowel here
+% as it may represent the vowel U, but v is not, as it is never used for a
+% vowel. In other cases the active |'| character expands to itself and the
+% token read as argument is reinserted.
+% \begin{macrocode}
+ \cs_set_protected:Npn \babellatin_put_acute:N #1
+ {
+ \str_case:nnF {#1}
+ {
+ {A} { \babellatin_ligature_shorthand:Nnn E { \'\AE }
+ {
+ \babellatin_ligature_shorthand:Nnn e { \'\AE } { Á }
+ }
+ }
+ {a} { \babellatin_ligature_shorthand:Nnn e { \'\ae } { á } }
+ {E} { É }
+ {e} { é }
+ {I} { Í }
+ {i} { í }
+ {O} { \babellatin_ligature_shorthand:Nnn E { \'\OE }
+ {
+ \babellatin_ligature_shorthand:Nnn e { \'\OE } { Ó }
+ }
+ }
+ {o} { \babellatin_ligature_shorthand:Nnn e { \'\oe } { ó } }
+ {U} { Ú }
+ {u} { ú }
+ {V} { \'V }
+ {Y} { \'Y }
+ {y} { \'y }
+ {Æ} { \'\AE }
+ {æ} { \'\ae }
+ {Œ} { \'\OE }
+ {œ} { \'\oe }
+ }
+ {
+ \tl_if_single_token:nTF {#1}
+ {
+ \babellatin_if_ligature_command:NTF #1 { \' }
+ {
+ \token_to_str:N '
+ }
+ }
+ {
+ \token_to_str:N '
+ }
+ #1
+ }
+ }
% \end{macrocode}
-% Notice that with the above redefinitions of the commands
-% |\ProsodicMarksOn| and |\ProsodicMarksOff|, the operation of the
-% newly defined shorthands may be switched on and off at will, so
-% that even if a picture has to be inserted in the document by
-% means of the commands and keyword options of the \pkg{graphicx}
-% package, it suffices to switch them off before invoking the
-% picture including command, and switched on again afterwards; or,
-% even better, since the picture very likely is being inserted
-% within a |figure| environment, it suffices to switch them off
-% within the environment, being conscious that their deactivation
-% remains local to the environment.
-% \changes{latin-2.0g}{2005/11/17}{changed \cs{allowhyphens} to
-% \cs{bbl@allowhyphens}}
-% \begin{macrocode}
-\initiate@active@char{^}%
-\initiate@active@char{=}%
-\declare@shorthand{latin}{^a}{%
- \textormath{\u{a}\bbl@allowhyphens}{\hat{a}}}%
-\declare@shorthand{latin}{^e}{%
- \textormath{\u{e}\bbl@allowhyphens}{\hat{e}}}%
-\declare@shorthand{latin}{^i}{%
- \textormath{\u{\i}\bbl@allowhyphens}{\hat{\imath}}}%
-\declare@shorthand{latin}{^o}{%
- \textormath{\u{o}\bbl@allowhyphens}{\hat{o}}}%
-\declare@shorthand{latin}{^u}{%
- \textormath{\u{u}\bbl@allowhyphens}{\hat{u}}}%
-%
-\declare@shorthand{latin}{=a}{%
- \textormath{\={a}\bbl@allowhyphens}{\bar{a}}}%
-\declare@shorthand{latin}{=e}{%
- \textormath{\={e}\bbl@allowhyphens}{\bar{e}}}%
-\declare@shorthand{latin}{=i}{%
- \textormath{\={\i}\bbl@allowhyphens}{\bar{\imath}}}%
-\declare@shorthand{latin}{=o}{%
- \textormath{\={o}\bbl@allowhyphens}{\bar{o}}}%
-\declare@shorthand{latin}{=u}{%
- \textormath{\={u}\bbl@allowhyphens}{\bar{u}}}%
-% \end{macrocode}
-% Notice that the short hand definitions are given only for lower
-% case letters; it would not be difficult to extend the set of
-% definitions to upper case letters, but it appears of very little
-% use in view of the kinds of document where prosodic marks are
-% supposed to be used. Nevertheless in those rare cases when it's
-% required to set some uppercase letters with their prosodic
-% marks, it is always possible to use the standard \LaTeX\ commands
-% such as |\u{I}| for typesetting \u{I}, or |\={A}| (or |\=A|) for
-% typesetting~\=A.
-%
-% Finally we restore the caret and equals sign initial default
-% category codes
-% \begin{macrocode}
-\catcode`\= 12\relax
-\catcode`\^ 7\relax
-% \end{macrocode}
-% so as to avoid conflicts with other packages or other \babel\
-% options.
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\LatinMarksOn}
-% \begin{macro}{\LatinMarksOff}
-% \changes{latin-2.0g}{2005/11/17}{Added two commands}
-% \changes{latin-2.0h}{2007/10/19}{Added missing backslash}
-% The following commands remain defined for backwards compatibility,
-% but they are obsolete and should not be used.
-% \changes{latin-2.0h}{2007/10/20}{Removed the setting of
-% \cs{LatinMarksOff} from \cs{extraslatin}}
-% \begin{macrocode}
-\addto\extraslatin{\def\LatinMarksOn{\shorthandon{^}\shorthandon{=}}}
-\addto\extraslatin{\def\LatinMarksOff{\shorthandoff{^}\shorthandoff{=}}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% It must be understood that by using the above prosodic marks,
-% line breaking is somewhat impeached; since such prosodic marks
-% are used almost exclusively in dictionaries, grammars, and poems
-% (only in school textbooks), this shouldn't be of any importance
-% for what concerns the quality of typesetting.
-%
-%\changes{latin-3.5}{2015/08/20}{New subsection}
-% \subsection{Ecclesiastic Latin style}
-% We declare the |ecclesiastic| attribute; its purpose is to load the
-% \pkg{ecclesiastic.sty} package, deferring this action to the moment when
-% \babel\ finishes executing; actually it sends \babel\ the information to act;
-% then \babel\ defers the package loading to the |\begin{document}| execution.
-% This implies the availability of the |\AtEndOfPackage| and |\AtBeginDocument|
-% macros which are contained in the \LaTeX\ kernel. Since
-% this file is read by \babel\ the current package at the end of which
-% the code is deferred is \babel\ itself, not simply this language description
-% file.
-%
-% Differently from other attribute settings we do not declare anything
-% in a possible |\extrasecclesiasticlatin| macro, because once the package
-% has been read, it is impossible to pretend to delete all what the package
-% defined. Actually this |ecclesiastic| attribute simply mimics the actual
-% loading of a package by means of a |\usepackage| or |\RequirePackage| command;
-% if loading was done with one of these commands, it would be impossible to
-% unload the loaded package.
+% The following macro defines the behaviour of the active |=| character.
+% The shorthands |=AE|, |=Ae|, |=ae|, |=AU|, |=Au|, |=au|, |=EU|, |=Eu|,
+% |=eu|, |=OE|, |=Oe|, and |=oe| are used for diphthongs with a combining
+% double macron (\unicode{035E}) or ligatures with a macron if the current
+% variety of Latin uses them. In other cases |=| before any vowel puts a
+% macron above the vowel. The character V is treated as a vowel here as it
+% may represent the vowel U, but v is not, as it is never used for a vowel.
+% In other cases the active |=| character expands to itself and the token
+% read as argument is reinserted.
% \begin{macrocode}
-\bbl@declare@ttribute{latin}{ecclesiastic}{%
-\AtEndOfPackage{%
- \AtBeginDocument{\RequirePackage{ecclesiastic}[2015/08/20]}%
+ \cs_set_protected:Npn \babellatin_put_macron:N #1
+ {
+ \str_case:nnF {#1}
+ {
+ {A} { \babellatin_ligature_macron:NNnn AE { \=\AE }
+ {
+ \babellatin_ligature_macron:NNnn Ae { \=\AE }
+ {
+ \babellatin_diphthong_macron:NNn AU
+ {
+ \babellatin_diphthong_macron:NNn Au { \=A }
+ }
+ }
+ }
+ }
+ {a} { \babellatin_ligature_macron:NNnn ae { \=\ae }
+ {
+ \babellatin_diphthong_macron:NNn au { \=a }
+ }
+ }
+ {E} { \babellatin_diphthong_macron:NNn EU
+ {
+ \babellatin_diphthong_macron:NNn Eu { \=E }
+ }
+ }
+ {e} { \babellatin_diphthong_macron:NNn eu { \=e } }
+ {I} { \=I }
+ {i} { \=\i }
+ {O} { \babellatin_ligature_macron:NNnn OE { \=\OE }
+ {
+ \babellatin_ligature_macron:NNnn Oe { \=\OE } { \=O }
+ }
+ }
+ {o} { \babellatin_ligature_macron:NNnn oe { \=\oe } { \=o } }
+ {U} { \=U }
+ {u} { \=u }
+ {V} { \=V }
+ {Y} { \=Y }
+ {y} { \=y }
+ }
+ {
+ \tl_if_single_token:nTF {#1}
+ {
+ \babellatin_if_ligature_command:NTF #1 { \= }
+ {
+ \token_to_str:N =
+ }
+ }
+ {
+ \token_to_str:N =
+ }
+ #1
+ }
+ }
+% \end{macrocode}
+% The following macro defines the behaviour of the active |^| character.
+% |^| before any vowel puts a breve above the vowel. The character V is
+% treated as a vowel here as it may represent the vowel U, but v is not, as
+% it is never used for a vowel. In other cases the active |^| character
+% expands to itself and the token read as argument is reinserted.
+% \begin{macrocode}
+ \cs_set:Npn \babellatin_put_breve:N #1
+ {
+ \str_case:nnF {#1}
+ {
+ {A} { \u{A} }
+ {a} { \u{a} }
+ {E} { \u{E} }
+ {e} { \u{e} }
+ {I} { \u{I} }
+ {i} { \u{\i} }
+ {O} { \u{O} }
+ {o} { \u{o} }
+ {U} { \u{U} }
+ {u} { \u{u} }
+ {V} { \u{V} }
+ {Y} { \u{Y} }
+ {y} { \u{y} }
+ }
+ {
+ \token_to_str:N ^
+ #1
+ }
+ }
+% \end{macrocode}
+% We define a macro for an additional hyphenation point that does not
+% suppress other hyphenation points within the word. This macro is used by
+% the |"| and the \verb:"|: shorthand.
+% \begin{macrocode}
+ \cs_set:Npn \babellatin_allowhyphens:
+ {
+ \bbl@allowhyphens
+ \discretionary {-} {} {}
+ \bbl@allowhyphens
+ }
+% \end{macrocode}
+% The conditional \cs{ifbabellatin@useligatures} cannot be used within a
+% expl3 context. So we have to define a macro testing if ligatures are
+% enabled outside the expl3 code part. The result is stored in the variable
+% \cs{babellatin@useligatures@bool}. We define this variable analogously to
+% expl3's |\c_true_bool| and |\c_false_bool|.
+% \begin{macrocode}
+ \ExplSyntaxOff
+ \def\babellatin@test@for@ligatures{%
+ \ifbabellatin@useligatures
+ \chardef\babellatin@useligatures@bool=1
+ \else
+ \chardef\babellatin@useligatures@bool=0
+ \fi
}%
-}
+ \ExplSyntaxOn
% \end{macrocode}
-%
-% \changes{latin-2.0j}{2014/02/18}{Renamed this section to subsection}
-% \subsection{Etymological hyphenation}
-% In order to deal in a clean way with prefixes and compound words
-% to be divided etymologically, the active character |"| is given
-% a special definition so as to behave as a discretionary break
-% with hyphenation allowed after it. You may consider this sign as a
-% substitute for a ``compound word mark''.
-%
-% This is particularly useful with classical Latin because this
-% language requires etymological hyphenation; patterns were created
-% with etymological hyphenation in mind, but even if for certain
-% prefixes or suffixes it works pretty well, it does not for certain
-% other ones. For example the word `redire' should be hyphenated as
-% `red-i-re'; but there are plenty of other words starting with the
-% string `red' that does not play the role of a prefix; therefore
-% it should be necessary to extract all the Latin words where `red'
-% is a prefix, and enter the suitable patterns to hyphenate correctly
-% only those words; in the simple case of the verb `redire' it would
-% be necessary to enter all the words that belong to the conjugation
-% of this verb and the declination of the present, future and past
-% participles and gerundive in masculine, feminine and neutral forms;
-% the same problem takes place with prefix `trans' where sometimes it is
-% a real prefix, such as in `transire' (hyphenation trans-i-re), and
-% sometimes is modified with the absorption of an initial `s' of the
-% suffix, such as in `transubstantialis' (classical hyphenation:
-% tran-subs-tan-tia-lis).
-
-% Obviously this task would render the pattern file enormous, and mostly
-% useless. The active character |"| solves the problem for isolated instances,
-% while the hyphenations exception lists of the only forms actually used
-% in a specific document, would do the rest.
-%
-% Most of the code for dealing with the active |"| is already
-% contained in the core of \babel, but we are going to use it as a
-% single character shorthand for Latin.
-% \begin{macrocode}
-\initiate@active@char{"}%
-\addto\extraslatin{\bbl@activate{"}%
-}
+% The following macro is intended for defining a shorthand for a ligature
+% where useful. The first argument is the expected second character after
+% |"| (e.\,g.\@ |e| if |"a| has been read). The second argument is the true
+% code, that applies if this character is found (the ligature command). The
+% third argument is the false code (some other command).
+% \begin{macrocode}
+ \cs_set_protected:Npn \babellatin_ligature_shorthand:Nnn #1#2#3
+ {
+ \babellatin@test@for@ligatures
+ \bool_if:NTF \babellatin@useligatures@bool
+ {
+ \peek_meaning_remove:NTF #1 {#2} {#3}
+ }
+ {
+ #3
+ }
+ }
% \end{macrocode}
+% The following macro is intended for defining a shorthand for a diphthong
+% with a combining double macron (\unicode{035E}). The first argument is the
+% first character of the diphthong, which has already been read. The second
+% argument is the second character of the diphthong, which is expected to be
+% read. The third argument is the false code, that applies if the second
+% character is not found as expected.
%
-% A temporary macro is defined so as to take different actions in math
-% mode and text mode: specifically in the former case the macro inserts a
-% double quote as it should in math mode, otherwise another delayed macro
-% comes into action.
+% For pdf\LaTeX{} a warning is issued if the diphthong is found as this
+% engine does not support the combining double macron.
% \begin{macrocode}
-\declare@shorthand{latin}{"}{%
- \textormath{\def\lt@@next{\futurelet\lt@temp\lt@cwm}}%
- {\def\lt@@next{''}}%
- \lt@@next
-}%
+ \cs_set_protected:Npn \babellatin_diphthong_macron:NNn #1#2#3
+ {
+ \peek_meaning:NTF #2
+ {
+ #1
+ \bool_lazy_or:nnTF { \sys_if_engine_xetex_p: } { \sys_if_engine_luatex_p: }
+ {
+ \iffontchar \font "35E \relax
+ \char "35E \relax
+ \else
+ \msg_warning:nn {babel-latin} {no-double-macron-font}
+ \fi
+ }
+ {
+ \msg_warning:nn {babel-latin} {no-double-macron-engine}
+ }
+ }
+ {
+ #3
+ }
+ }
+ \msg_set:nnn {babel-latin} {no-double-macron-font}
+ {
+ The~combining~double~macron~(U+035E)~is~not~available~in~the~current~
+ font.~The~diphthong~is~typeset~without~macron~ \msg_line_context: .
+ }
+ \msg_set:nnn {babel-latin} {no-double-macron-engine}
+ {
+ The~combining~double~macron~(U+035E)~is~not~available~with~
+ \c_sys_engine_str . ~ The~diphthong~is~typeset~without~macron~
+ \msg_line_context: .
+ }
+% \end{macrocode}
+% The following macro is intended for defining a shorthand for a ligature
+% with a macron where useful. The first argument is the first character of
+% the diphthong, which has already been read. The second argument is the
+% expected second character of the diphthong. The third argument is the code
+% for the ligature with the macron. The fourth argument is the false code
+% that applies if the second character is not found.
+% \begin{macrocode}
+ \cs_set_protected:Npn \babellatin_ligature_macron:NNnn #1#2#3#4
+ {
+ \babellatin_ligature_shorthand:Nnn #2 {#3}
+ {
+ \babellatin_diphthong_macron:NNn #1 #2 {#4}
+ }
+ }
% \end{macrocode}
-% In text mode the \cs{lt@@next} control sequence is such that upon
-% its execution a temporary variable \cs{lt@temp} is made
-% equivalent to the next token in the input list without actually
-% removing it. Such temporary token is then tested by the macro
-% \cs{lt@cwm} and if it is found to be a letter token, then it
-% introduces a compound word separator control sequence
-% \cs{lt@allowhyphens} whose expansion introduces a discretionary
-% hyphen and an unbreakable space; in case the token is not a
-% letter, it is tested against the definitions of |\ae| and |\oe|,
-% and if the test is true than such definitions are treated as
-% letters (as they actually are), otherwise the token is tested
-% again to find if it is the character \texttt{\string|}, in which
-% case it is gobbled and a discretionary break is introduced.
-% \changes{latin-2.0g}{2005/11/17}{Added a \cs{nobreak}}
-% \changes{latin-3.0}{2014/06/01}{\cs{lt@allowhyphens} rewritten so as
-% to use the babel core command \cs{bbl@allowhyphens}}
-% \changes{latin-3.0}{2014/06/01}{Introduced the tests for the ligatures
-% \cs{ae} and \cs{oe}}
-% \begin{macrocode}
-\def\lt@allowhyphens{\bbl@allowhyphens\discretionary{-}{}{}\bbl@allowhyphens}
-
-\newcommand*{\lt@cwm}{\let\lt@n@xt\relax
- \ifcat\noexpand\lt@temp a%
- \let\lt@n@xt\lt@allowhyphens
+% The following conditional tests if the argument is a ligature command
+% (\cs{AE}, \cs{ae}, \cs{OE}, or \cs{oe}).
+% \begin{macrocode}
+ \prg_set_conditional:Npnn \babellatin_if_ligature_command:N #1 {TF}
+ {
+ \token_if_eq_meaning:NNTF #1 \AE { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \ae { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \OE { \prg_return_true: }
+ {
+ \token_if_eq_meaning:NNTF #1 \oe { \prg_return_true: }
+ {
+ \prg_return_false:
+ }
+ }
+ }
+ }
+ }
+ \ExplSyntaxOff
+% \end{macrocode}
+% For the |"<| and the |">| shorthands we have to define the meaning of the
+% macros used for their definition. The commands \cs{guillemetleft} and
+% \cs{guillemetright} are provided by \babel. We will have to change this
+% definition later on for \lang{ecclesiasticlatin} if pdf\TeX{} is used.
+% \begin{macrocode}
+ \let\babellatin@guillemetleft\guillemetleft
+ \let\babellatin@guillemetright\guillemetright
+% \end{macrocode}
+% Finally, we have to add the shorthand definitions to the extras of the
+% current language.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{"}%
+ \languageshorthands{latin}%
+ }%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{"}%
+ }%
+ \@ifpackagewith{babel}{activeacute}{%
+ \babellatin@declare@apostrophe@shorthands
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{'}%
+ }%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{'}%
+ }%
+ }{}%
+\fi
+% \end{macrocode}
+% \subsection{Ecclesiastic punctuation spacing}
+% We define some conditionals concerning the engine used.
+% \begin{macrocode}
+\newif\ifbabellatin@luatex
+\newif\ifbabellatin@xetex
+\ifnum\bbl@engine=1
+ \babellatin@luatextrue
+\else
+ \ifnum\bbl@engine=2
+ \babellatin@xetextrue
+ \fi
+\fi
+% \end{macrocode}
+% The following command defines the preparations needed for punctuation
+% spacing in the preamble.
+% \begin{macrocode}
+\def\babellatin@prepare@punctuation@spacing{%
+% \end{macrocode}
+% For \LuaTeX{} we load an additional file containing some Lua code. This
+% file is documented in section \ref{luamodule}.
+% \begin{macrocode}
+ \ifbabellatin@luatex
+ \directlua{require('ecclesiasticlatin')}%
\else
- \ifx\lt@temp\ae
- \let\lt@n@xt\lt@allowhyphens
+% \end{macrocode}
+% The following command inserts a kern of 1/12 of a quad. This is the only
+% amount of space used for punctuation within this package.
+% \begin{macrocode}
+ \def\babellatin@insert@punctuation@space{%
+ \kern0.08333\fontdimen6\font
+ }%
+% \end{macrocode}
+% The following command inserts the same kern, removing any positive amount
+% of space that precedes. This is needed if a closing guillemet is preceded
+% by a space character erroneously input by the user.
+% \begin{macrocode}
+ \def\babellatin@replace@preceding@space{%
+ \ifdim\lastskip>\z@\unskip\fi
+ \babellatin@insert@punctuation@space
+ }%
+% \end{macrocode}
+% The following command inserts the same kern, removing any following space
+% character. This is needed if an opening guillemet is followed by a space
+% character erroneously input by the user.
+% \begin{macrocode}
+ \def\babellatin@replace@following@space{%
+ \babellatin@insert@punctuation@space
+ \ignorespaces
+ }%
+% \end{macrocode}
+% For \XeTeX{} the punctuation spacing will be defined based on five
+% different character classes: one for question and exclamation marks, one
+% for colons and semicolons, one for opening and closing guillemets,
+% respectiveley, and one for opening brackets. Concerning spacing, brackets
+% are treated the same way as letter characters in most cases. However, in
+% strings like “(?)” no spacing is desired before the question mark. So we
+% need a dedicated character class for opening brackets.
+% \begin{macrocode}
+ \ifbabellatin@xetex
+ \newXeTeXintercharclass\babellatin@qmark@class
+ \newXeTeXintercharclass\babellatin@colon@class
+ \newXeTeXintercharclass\babellatin@oguill@class
+ \newXeTeXintercharclass\babellatin@cguill@class
+ \newXeTeXintercharclass\babellatin@obracket@class
+% \end{macrocode}
+% Furthermore, we need a class representing the word boundary. This class
+% has a fixed number defined in \file{latex.ltx}.
+% \begin{macrocode}
+ \let\babellatin@boundary@class\e@alloc@intercharclass@top
+% \end{macrocode}
+% A space is inserted between a question or exclamation mark and a closing
+% guillemet.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@qmark@class\babellatin@cguill@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between a question or exclamation mark and a colon or
+% semicolon.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@qmark@class\babellatin@colon@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between a colon or semicolon and a closing guillemet.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@colon@class\babellatin@cguill@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space character after an opening guillemet is replaced by the correct
+% amount of space.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@oguill@class\babellatin@boundary@class={%
+ \babellatin@replace@following@space}%
+% \end{macrocode}
+% A space is inserted between two opening guillemets.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@oguill@class\babellatin@oguill@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between an opening guillemet and any ordinary
+% character.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@oguill@class\z@={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between two closing guillemets.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@cguill@class\babellatin@cguill@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between a closing guillemet and a question or
+% exclamation mark.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@cguill@class\babellatin@qmark@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between a closing guillemet and a colon or semicolon.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@cguill@class\babellatin@colon@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space character before a question or exclamation mark is replaced by the
+% correct amount of space.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@boundary@class\babellatin@qmark@class={%
+ \babellatin@replace@preceding@space}%
+% \end{macrocode}
+% A space character before a colon or semicolon is replaced by the correct
+% amount of space.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@boundary@class\babellatin@colon@class={%
+ \babellatin@replace@preceding@space}%
+% \end{macrocode}
+% A space character before a closing guillemet is replaced by the correct
+% amount of space.
+% \begin{macrocode}
+ \XeTeXinterchartoks\babellatin@boundary@class\babellatin@cguill@class={%
+ \babellatin@replace@preceding@space}%
+% \end{macrocode}
+% A space is inserted between any ordinary character and a question or
+% exclamation mark.
+% \begin{macrocode}
+ \XeTeXinterchartoks\z@\babellatin@qmark@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between any ordinary character and a colon or
+% semicolon.
+% \begin{macrocode}
+ \XeTeXinterchartoks\z@\babellatin@colon@class={%
+ \babellatin@insert@punctuation@space}%
+% \end{macrocode}
+% A space is inserted between any ordinary character and a closing
+% guillemet.
+% \begin{macrocode}
+ \XeTeXinterchartoks\z@\babellatin@cguill@class={%
+ \babellatin@insert@punctuation@space}%
\else
- \ifx\lt@temp\oe
- \let\lt@n@xt\lt@allowhyphens
+% \end{macrocode}
+% In pdf\TeX{} active characters are needed for punctuation spacing.
+% \begin{macrocode}
+ \initiate@active@char{;}%
+ \initiate@active@char{:}%
+ \initiate@active@char{!}%
+ \initiate@active@char{?}%
+ \declare@shorthand{latin}{;}{%
+ \ifhmode
+ \babellatin@replace@preceding@space
+ \string;%
+ \else
+ \string;%
+ \fi
+ }%
+ \declare@shorthand{latin}{:}{%
+ \ifhmode
+ \babellatin@replace@preceding@space
+ \string:%
+ \else
+ \string:%
+ \fi
+ }%
+ \declare@shorthand{latin}{!}{%
+ \ifhmode
+ \babellatin@replace@preceding@space
+ \string!%
+ \else
+ \string!%
+ \fi
+ }%
+ \declare@shorthand{latin}{?}{%
+ \ifhmode
+ \babellatin@replace@preceding@space
+ \string?%
\else
- \if\noexpand\lt@temp\string|%
- \def\lt@n@xt{\lt@allowhyphens\@gobble}%
- \fi
+ \string?%
\fi
+ }%
\fi
\fi
- \lt@n@xt}%
+}%
% \end{macrocode}
-%
-% Attention: the ligature commands |\ae| and |\oe| are detected correctly
-% if they are not included within a group. In facts an input such as
-% |super"{\ae}quitas|\footnote{This word does not exist in
-% ``regular'' Latin, and it is used just as an example.} gets wrongly
-% hyphenated as \texttt{su-pe-r\ae-qui-tas} while |super"\ae{}quitas|,
-% that uses an empty group to terminate the |\ae| control sequence, gets
-% correctly hyphenated as \texttt{su-per-\ae-qui-tas}. If one prefers to
-% close the |\ae| or |\oe| ligature commands within a group, then it is
-% necessary to use the alternate etymological hyphenation command \verb+"|+
-% as in \verb!super"|{\ae}quitas! in order to get
-% \texttt{su-per-{\ae}-qui-tas}.
-% .
-%
-% The macro |\ldf@finish| takes care of looking for a
-% configuration file, setting the main language to be switched on
-% at |\begin{document}| and resetting the category code of
-% \texttt{@} to its original value.
+% We call the previously defined command for ecclesiastic Latin.
+% \begin{macrocode}
+\ifx\CurrentOption\babellatin@ecclesiastic
+ \babellatin@prepare@punctuation@spacing
+\fi
+% \end{macrocode}
+% The following function actually enables the spacing of punctuation.
+% \begin{macrocode}
+\def\babellatin@punctuation@spacing{%
+% \end{macrocode}
+% For \LuaTeX{} we just have to call a function of the Lua module.
+% \begin{macrocode}
+ \ifbabellatin@luatex
+ \directlua{ecclesiasticlatin.activate_spacing()}%
+ \else
+% \end{macrocode}
+% For \XeTeX{} we have to enable the character classes functionality and
+% assign the punctuation characters to the character classes.
+% \begin{macrocode}
+ \ifbabellatin@xetex
+ \XeTeXinterchartokenstate = 1
+ \XeTeXcharclass `\! \babellatin@qmark@class
+ \XeTeXcharclass `\? \babellatin@qmark@class
+ \XeTeXcharclass `\‼ \babellatin@qmark@class
+ \XeTeXcharclass `\⁇ \babellatin@qmark@class
+ \XeTeXcharclass `\⁈ \babellatin@qmark@class
+ \XeTeXcharclass `\⁉ \babellatin@qmark@class
+ \XeTeXcharclass `\‽ \babellatin@qmark@class
+ \XeTeXcharclass `\; \babellatin@colon@class
+ \XeTeXcharclass `\: \babellatin@colon@class
+ \XeTeXcharclass `\« \babellatin@oguill@class
+ \XeTeXcharclass `\» \babellatin@cguill@class
+ \XeTeXcharclass `\‹ \babellatin@oguill@class
+ \XeTeXcharclass `\› \babellatin@cguill@class
+ \XeTeXcharclass `\( \babellatin@obracket@class
+ \XeTeXcharclass `\[ \babellatin@obracket@class
+ \XeTeXcharclass `\{ \babellatin@obracket@class
+ \XeTeXcharclass `\⟨ \babellatin@obracket@class
+ \else
+% \end{macrocode}
+% For pdf\TeX{} we activate the shorthands.
+% \begin{macrocode}
+ \bbl@activate{;}%
+ \bbl@activate{:}%
+ \bbl@activate{!}%
+ \bbl@activate{?}%
+% \end{macrocode}
+% We also redefine the guillemet commands.
+% \begin{macrocode}
+ \def\babellatin@guillemetleft{%
+ \guillemetleft
+ \babellatin@replace@following@space
+ }%
+ \def\babellatin@guillemetright{%
+ \babellatin@replace@preceding@space
+ \guillemetright
+ }%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% The following function disables the spacing of punctuation.
+% \begin{macrocode}
+\def\babellatin@no@punctuation@spacing{%
+ \ifbabellatin@luatex
+ \directlua{ecclesiasticlatin.deactivate_spacing()}%
+ \else
+ \ifbabellatin@xetex
+ \XeTeXcharclass `\! \z@
+ \XeTeXcharclass `\? \z@
+ \XeTeXcharclass `\‼ \z@
+ \XeTeXcharclass `\⁇ \z@
+ \XeTeXcharclass `\⁈ \z@
+ \XeTeXcharclass `\⁉ \z@
+ \XeTeXcharclass `\‽ \z@
+ \XeTeXcharclass `\; \z@
+ \XeTeXcharclass `\: \z@
+ \XeTeXcharclass `\« \z@
+ \XeTeXcharclass `\» \z@
+ \XeTeXcharclass `\‹ \z@
+ \XeTeXcharclass `\› \z@
+ \XeTeXcharclass `\( \z@
+ \XeTeXcharclass `\[ \z@
+ \XeTeXcharclass `\{ \z@
+ \XeTeXcharclass `\⟨ \z@
+ \XeTeXinterchartokenstate = 0
+ \else
+ \bbl@deactivate{;}%
+ \bbl@deactivate{:}%
+ \bbl@deactivate{!}%
+ \bbl@deactivate{?}%
+ \let\babellatin@guillemetleft\guillemetleft
+ \let\babellatin@guillemetright\guillemetright
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% Punctuation is spaced in ecclesiastic Latin only.
+% \begin{macrocode}
+\addto\extrasecclesiasticlatin{\babellatin@punctuation@spacing}%
+\addto\noextrasecclesiasticlatin{\babellatin@no@punctuation@spacing}%
+% \end{macrocode}
+% \subsection{Modifiers}
+% We define some language options accessible via modifiers.
+% \subsubsection{Using the letter \emph{j}}
+% The \modifier{usej} option sets the conditional \cs{ifbabellatin@usej} to
+% true.
+% \begin{macrocode}
+\bbl@declare@ttribute\CurrentOption{usej}{%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babellatin@usejtrue}%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \babellatin@usejfalse}%
+}%
+% \end{macrocode}
+% \subsubsection{Typesetting months in lower case}
+% The \modifier{lowercasemonth} option sets the conditional
+% \cs{ifbabellatin@lowercasemonth} to true.
+% \begin{macrocode}
+\bbl@declare@ttribute\CurrentOption{lowercasemonth}{%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babellatin@lowercasemonthtrue}%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \babellatin@lowercasemonthfalse}%
+}%
+% \end{macrocode}
+% \subsubsection{Shorthands for prosodic marks}
+% The \modifier{withprosodicmarks} option makes it possible to use
+% shorthands like |=a| or |^a| for vowels with macrons and breves. We define
+% it for all four language variants of Latin, but only if the \LaTeX{}
+% format is used.
+% \begin{macrocode}
+\ifx\fmtname\babellatin@latex
+ \bbl@declare@ttribute\CurrentOption{withprosodicmarks}{%
+% \end{macrocode}
+% Every shorthand character needs an \cs{initiate@active@char} command,
+% which makes the respective character active, but expanding to itself as
+% long as no further definitions occur. Both active characters needs to be
+% switched off at the beginning of the document to avoid problems with
+% commands using |key=value| interfaces (e.\,g.\@ \cs{includegraphics}) and
+% \TeX's |^^xx| convention.
+% \begin{macrocode}
+ \initiate@active@char{=}%
+ \initiate@active@char{^}%
+ \AtBeginDocument{%
+% \end{macrocode}
+% We do not use |\shorthandoff{=}| and |\shorthandoff*{^}| in the following
+% lines because \package{babel-french} redefines the \cs{shorthandoff}
+% command for \XeLaTeX{} and \LuaLaTeX. Instead, we use \babel's internal
+% definition of this command.
+% \begin{macrocode}
+ \bbl@shorthandoff\z@{=}%
+% \end{macrocode}
+% The following line is currently uncommented because switching |^| off and
+% on does not work as expected.\footnote{See
+% \url{https://github.com/latex3/babel/issues/126}.}
% \begin{macrocode}
-\ldf@finish{latin}
+ \bbl@shorthandoff\tw@{^}%
+ }%
+ \babellatin@declare@prosodic@shorthands
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \bbl@activate{=}%
+ \bbl@activate{^}%
+% \end{macrocode}
+% The active |=| and |^| are normally turned off to avoid problems with
+% commands using |key=value| interfaces and \TeX's |^^xx| convention. We
+% define the commands \cs{ProsodicMarksOn} and \cs{ProsodicMarksOff} for
+% turning them on and off within the document. We use the starred form of
+% \cs{shorthandoff} when turning off |^| to keep it working within math
+% formulas.
+% \begin{macrocode}
+ \def\ProsodicMarksOn{%
+ \shorthandon{=}%
+% \end{macrocode}
+% The following line is currently uncommented because switching |^| off and
+% on does not work as expected.
+% \begin{macrocode}
+ \shorthandon{^}%
+ }%
+ \def\ProsodicMarksOff{%
+ \shorthandoff{=}%
+% \end{macrocode}
+% The following line is currently uncommented because switching |^| off and
+% on does not work as expected.
+% \begin{macrocode}
+ \shorthandoff*{^}%
+ }%
+ }%
+ \expandafter\addto\csname noextras\CurrentOption\endcsname{%
+ \bbl@deactivate{=}%
+ \bbl@deactivate{^}%
+ }%
+ }%
+% \end{macrocode}
+% The \cs{ProsodicMarksOn} and \cs{ProsodicMarksOff} commands are useless
+% without the \modifier{withprosodicmarks} modifier. They only issue
+% warnings in this case.
+% \begin{macrocode}
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \def\ProsodicMarksOn{%
+ \PackageWarning{babel-latin}{%
+ The \protect\ProsodicMarksOn\space command is only\MessageBreak
+ available using the withprosodicmarks\MessageBreak
+ modifier}%
+ }%
+ \def\ProsodicMarksOff{%
+ \PackageWarning{babel-latin}{%
+ The \protect\ProsodicMarksOff\space command is only\MessageBreak
+ available using the withprosodicmarks\MessageBreak
+ modifier}%
+ }%
+ }%
+\fi
% \end{macrocode}
-%\iffalse
-%</code>
-%\fi
+% \subsubsection{Ecclesiastic footnotes}
+% The \modifier{ecclesiasticfootnotes} option sets the footnotes globally to
+% the style defined by the (now outdated) \package{ecclesiastic} package.
+% The definition takes place at the end of the package to be able to check
+% \babel's main language. However, the \cs{CurrentOption} has lost its value
+% at this moment, so we have to store it.
+% \begin{macrocode}
+\bbl@declare@ttribute\CurrentOption{ecclesiasticfootnotes}{%
+ \let\babellatin@footnote@lang\CurrentOption
+ \AtEndOfPackage{%
+ \ifx\bbl@main@language\babellatin@footnote@lang
+ \let\@makefntext\babellatin@variant@footnote
+ \else
+ \PackageWarningNoLine{babel-latin}{%
+ \babellatin@footnote@lang\space is not the main language.\MessageBreak
+ The `ecclesiasticfootnotes' modifier\MessageBreak
+ is ineffective}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+% This is the footnote style as defined by the \package{ecclesiastic}
+% package.
+% \begin{macrocode}
+\def\babellatin@variant@footnote#1{%
+ \parindent 1em%
+ \noindent
+ \hbox{\normalfont\@thefnmark.}%
+ \enspace #1%
+}%
+% \end{macrocode}
+% \subsection{Legacy modifiers and commands}
+% \changes{4.0}{2021/06/27}{Do not load the \package{ecclesiastic} package for
+% the \modifier{ecclesiastic} modifier, use an internal implementation
+% instead}
+% We keep the modifiers \modifier{classic}, \modifier{medieval}, and
+% \modifier{ecclesiastic} for backwards compatibility. We issue a warning if
+% they are used.
+% \begin{macrocode}
+\def\babellatin@outdated@modifier#1{%
+ \PackageWarningNoLine{babel-latin}{%
+ The `#1' modifier is outdated. Please\MessageBreak
+ consult the babel-latin manual and consider\MessageBreak
+ to load the language `#1latin' instead\MessageBreak
+ of `latin.#1'}%
+}%
+\bbl@declare@ttribute{latin}{classic}{%
+ \babellatin@outdated@modifier{classic}%
+ \addto\extraslatin{\babellatin@usevfalse}%
+ \addto\noextraslatin{\babellatin@usevtrue}%
+ \babellatin@test@classic@patterns
+ \let\l@latin\l@classiclatin
+ \StartBabelCommands*{latin}{}%
+ \SetCase{\uccode `u=`V}{\lccode `V=`u}%
+ \EndBabelCommands
+}%
+\bbl@declare@ttribute{latin}{medieval}{%
+ \babellatin@outdated@modifier{medieval}%
+ \addto\extraslatin{%
+ \babellatin@usevfalse
+ \def\prefacename{Pr\ae fatio}%
+ }%
+ \addto\noextraslatin{%
+ \babellatin@usevtrue
+ }%
+ \StartBabelCommands*{latin}{}%
+ \SetCase{\uccode `u=`V}{\lccode `V=`u}%
+ \EndBabelCommands%
+}%
+\bbl@declare@ttribute{latin}{ecclesiastic}{%
+ \babellatin@outdated@modifier{ecclesiastic}%
+ \babellatin@prepare@punctuation@spacing
+ \babellatin@ecclesiastic@outdated@commands
+% \end{macrocode}
+% The apostrophe character becomes active, even without \babel's
+% \modifier{activeacute} option.
+% \begin{macrocode}
+ \initiate@active@char{'}%
+ \babellatin@declare@apostrophe@shorthands
+ \addto\extraslatin{%
+ \bbl@activate{'}%
+ \babellatin@punctuation@spacing
+ \babellatin@useligaturestrue
+ }%
+ \addto\noextraslatin{%
+ \bbl@deactivate{'}%
+ \babellatin@no@punctuation@spacing
+ \babellatin@useligaturesfalse
+ }%
+% \end{macrocode}
+% We set up the footnotes like the \package{ecclesiastic} package did.
+% \begin{macrocode}
+ \addto\extraslatin{%
+ \babel@save\@makefntext
+ \let\@makefntext\babellatin@variant@footnote
+ }%
+}%
+% \end{macrocode}
+% In earlier versions of \babellatin{} (up to v.\,3.5) a
+% \cs{SetLatinLigatures} command and a \cs{ProsodicMarks} command have been
+% defined. We retain them for backwards compatiblity, but they do nothing
+% except issuing a warning.
+% \changes{4.0}{2021/06/27}{Declare \cs{SetLatinLigatures} and
+% \cs{ProsodicMarks} obsolete}
+% \begin{macrocode}
+\providecommand\SetLatinLigatures{%
+ \PackageWarning{babel-latin}{%
+ The \protect\SetLatinLigatures\space command is obsolete.\MessageBreak
+ Please remove it}}%
+\providecommand\ProsodicMarks{%
+ \PackageWarning{babel-latin}{%
+ The \protect\ProsodicMarks\space command is obsolete.\MessageBreak
+ Please remove it}}%
+% \end{macrocode}
+% We retain some legacy commands concerning guillemets from the
+% \package{ecclesiastic} package, which is now outdated, but we deprecate
+% them.
+% \changes{4.0}{2021/06/27}{Declare \cs{FrenchGuillemetsFrom},
+% \cs{ToneGuillemets}, \cs{og}, and \cs{fg} (defined by the
+% \package{ecclesiastic} package) obsolete}%
+% \begin{macrocode}
+\def\babellatin@ecclesiastic@outdated@commands{%
+ \providecommand*\FrenchGuillemetsFrom[4]{%
+ \PackageWarning{babel-latin}{%
+ The \protect\FrenchGuillemetsFrom\space command is obsolete.\MessageBreak
+ Please remove it and use \protect\usepackage[T1]{fontenc}\MessageBreak
+ if compiling with pdfLaTeX}}%
+ \let\FrenchGuillemotsFrom\FrenchGuillemetsFrom
+ \providecommand\ToneGuillemets{%
+ \PackageWarning{babel-latin}{%
+ The \protect\ToneGuillemets\space command is obsolete.\MessageBreak
+ Please remove it and use \protect\usepackage[T1]{fontenc}\MessageBreak
+ if compiling with pdfLaTeX}}%
+ \expandafter\addto\csname extras\CurrentOption\endcsname{%
+ \babel@save\og
+ \babel@save\fg
+ \DeclareRobustCommand\og{%
+ \babellatin@guillemetleft
+ \PackageWarning{babel-latin}{%
+ The \protect\og\space command is obsolete.\MessageBreak
+ Please replace it by "<}}%
+ \DeclareRobustCommand\fg{%
+ \babellatin@guillemetright
+ \PackageWarning{babel-latin}{%
+ The \protect\fg\space command is obsolete.\MessageBreak
+ Please replace it by ">}}%
+ }%
+}%
+\ifx\CurrentOption\babellatin@ecclesiastic
+ \babellatin@ecclesiastic@outdated@commands
+\fi
+% \end{macrocode}
+% The macro |\ldf@finish| takes care of looking for a configuration file,
+% setting the main language to be switched on at |\begin{document}| and
+% resetting the category code of \texttt{@} to its original value.
+% \begin{macrocode}
+\ldf@finish\CurrentOption
+% \end{macrocode}
+% \iffalse
+%</latin>
+% \fi
+% \babel{} expects \file{ldf} files for \lang{classiclatin},
+% \lang{medievallatin} and \lang{ecclesiasticlatin}. These files themselves
+% only load \file{latin.ldf}, which does the real work:
+% \begin{macrocode}
+%<classic>\ProvidesLanguage{classiclatin}
+%<ecclesiastic>\ProvidesLanguage{ecclesiasticlatin}
+%<medieval>\ProvidesLanguage{medievallatin}
+% \end{macrocode}
+% \iffalse
+%<*classic|ecclesiastic|medieval>
+% \fi
+% \begin{macrocode}
+\input latin.ldf\relax
+% \end{macrocode}
+% \iffalse
+%</classic|ecclesiastic|medieval>
+% \fi
+% \subsection{The Lua module\label{luamodule}}
+% In case \LuaTeX{} is used for compilation, the spacing of punctuation for
+% ecclesiastic Latin requires some Lua code, which is stored in
+% \file{ecclesiasticlatin.lua}. The original version of this code has been
+% written for the \package{polyglossia} package by É. Roux and others.
%
+% \iffalse
+%<*lua>
+% \fi
+% The Lua module identifies itself using the command provided by
+% \package{ltluatex}.
+% \begin{macrocode}
+luatexbase.provides_module({
+ name = "ecclesiasticlatin",
+ date = "2021-06-27",
+ version = "4.0",
+ description = "babel-latin punctuation spacing for ecclesiastic Latin"
+})
+local add_to_callback = luatexbase.add_to_callback
+local in_callback = luatexbase.in_callback
+local new_attribute = luatexbase.new_attribute
+local node = node
+local insert_node_before = node.insert_before
+local insert_node_after = node.insert_after
+local remove_node = node.remove
+local has_attribute = node.has_attribute
+local node_copy = node.copy
+local new_node = node.new
+local end_of_math = node.end_of_math
+local get_next = node.getnext
+local get_prev = node.getprev
+local get_property = node.getproperty
+% \end{macrocode}
+% Node types according to |node.types()|:
+% \begin{macrocode}
+local glue_code = node.id"glue"
+local glyph_code = node.id"glyph"
+local penalty_code = node.id"penalty"
+local kern_code = node.id"kern"
+local math_code = node.id"math"
+% \end{macrocode}
+% We need some node subtypes:
+% \begin{macrocode}
+local userkern = 1
+local removable_skip = {
+ [0] = true, -- userskip
+ [13] = true, -- spaceskip
+ [14] = true -- xspaceskip
+}
+% \end{macrocode}
+% We make a new node, so that we can copy it later on:
+% \begin{macrocode}
+local kern_node = new_node(kern_code)
+kern_node.subtype = userkern
+local function get_kern_node(dim)
+ local n = node_copy(kern_node)
+ n.kern = dim
+ return n
+end
+% \end{macrocode}
+% All possible space characters according to section 6.2 of the Unicode
+% Standard (\url{https://www.unicode.org/versions/Unicode12.0.0/ch06.pdf}):
+% \begin{macrocode}
+local space_chars = {
+ [0x20] = true, -- space
+ [0xA0] = true, -- no-break space
+ [0x1680] = true, -- ogham space mark
+ [0x2000] = true, -- en quad
+ [0x2001] = true, -- em quad
+ [0x2002] = true, -- en space
+ [0x2003] = true, -- em space
+ [0x2004] = true, -- three-per-em-space
+ [0x2005] = true, -- four-per-em space
+ [0x2006] = true, -- six-per-em space
+ [0x2007] = true, -- figure space
+ [0x2008] = true, -- punctuation space
+ [0x2009] = true, -- thin space
+ [0x200A] = true, -- hair space
+ [0x202F] = true, -- narrow no-break space
+ [0x205F] = true, -- medium mathematical space
+ [0x3000] = true -- ideographic space
+}
+% \end{macrocode}
+% All left bracket characters, referenced by their Unicode slot:
+% \begin{macrocode}
+local left_bracket_chars = {
+ [0x28] = true, -- left parenthesis
+ [0x5B] = true, -- left square bracket
+ [0x7B] = true, -- left curly bracket
+ [0x27E8] = true -- mathematical left angle bracket
+}
+% \end{macrocode}
+% All right bracket characters, referenced by their Unicode slot:
+% \begin{macrocode}
+local right_bracket_chars = {
+ [0x29] = true, -- right parenthesis
+ [0x5D] = true, -- right square bracket
+ [0x7D] = true, -- right curly bracket
+ [0x27E9] = true -- mathematical right angle bracket
+}
+% \end{macrocode}
+% Question and exclamation marks, referenced by their Unicode slot:
+% \begin{macrocode}
+local question_exclamation_chars = {
+ [0x21] = true, -- exclamation mark !
+ [0x3F] = true, -- question mark ?
+ [0x203C] = true, -- double exclamation mark ‼
+ [0x203D] = true, -- interrobang ‽
+ [0x2047] = true, -- double question mark ⁇
+ [0x2048] = true, -- question exclamation mark ⁈
+ [0x2049] = true -- exclamation question mark ⁉
+}
+% \end{macrocode}
+% Test for a horizontal space node to be removed:
+% \begin{macrocode}
+local function somespace(n)
+ if n then
+ local id, subtype = n.id, n.subtype
+ if id == glue_code then
+% \end{macrocode}
+% It is dangerous to remove all type of glue.
+% \begin{macrocode}
+ return removable_skip[subtype]
+ elseif id == kern_code then
+% \end{macrocode}
+% We only remove user's kern.
+% \begin{macrocode}
+ return subtype == userkern
+ elseif id == glyph_code then
+ return space_chars[n.char]
+ end
+ end
+end
+% \end{macrocode}
+% Test for a left bracket:
+% \begin{macrocode}
+local function someleftbracket(n)
+ if n then
+ local id = n.id
+ if id == glyph_code then
+ return left_bracket_chars[n.char]
+ end
+ end
+end
+% \end{macrocode}
+% Test for a right bracket:
+% \begin{macrocode}
+local function somerightbracket(n)
+ if n then
+ local id = n.id
+ if id == glyph_code then
+ return right_bracket_chars[n.char]
+ end
+ end
+end
+% \end{macrocode}
+% Test for two question or exclamation marks:
+% \begin{macrocode}
+local function question_exclamation_sequence(n1, n2)
+ if n1 and n2 then
+ local id1 = n1.id
+ local id2 = n2.id
+ if id1 == glyph_code and id2 == glyph_code then
+ return question_exclamation_chars[n1.char] and question_exclamation_chars[n2.char]
+ end
+ end
+end
+% \end{macrocode}
+% Test for a penalty node:
+% \begin{macrocode}
+local function somepenalty(n, value)
+ if n then
+ local id = n.id
+ if id == penalty_code then
+ if value then
+ return n.penalty == value
+ else
+ return true
+ end
+ end
+ end
+end
+% \end{macrocode}
+% \LuaTeX{} attribute determining whether to space punctuation or not:
+% \begin{macrocode}
+local punct_attr = new_attribute("ecclesiasticlatin_punct")
+% \end{macrocode}
+% Tables containing the left and right space amount (in units of a quad) of
+% every character:
+% \begin{macrocode}
+local left_space = {}
+local right_space = {}
+% \end{macrocode}
+% Insertion of the necessary spaces to the node list:
+% \begin{macrocode}
+local function process(head)
+ local current = head
+ while current do
+ local id = current.id
+ if id == glyph_code then
+ if has_attribute(current, punct_attr) then
+% \end{macrocode}
+% We try to obtain the character of the current node from its property
+% table, which is the most reliable way as the same character may be
+% rendered by different glyphs with different code numbers.
+% \begin{macrocode}
+ local char = get_property(current) and get_property(current).glyph_info
+% \end{macrocode}
+% If the |glyph_info| property is not available, we use the node's |char|
+% field to obtain the character, which is however only possible for numbers
+% up to 10FFFF\textsubscript{16}.
+% \begin{macrocode}
+ if not char and current.char <= 0x10FFFF then
+ char = utf8.char(current.char)
+ end
+ local leftspace, rightspace
+ if char then
+ leftspace = left_space[char]
+ rightspace = right_space[char]
+ end
+ if leftspace or rightspace then
+ local fontparameters = fonts.hashes.parameters[current.font]
+ local spacing_node
+ if leftspace and fontparameters then
+ local prev = get_prev(current)
+ local space_exception = false
+ if prev then
+% \end{macrocode}
+% We do not add space after left (opening) brackets and between question/exclamation marks:
+% \begin{macrocode}
+ space_exception = someleftbracket(prev)
+ or question_exclamation_sequence(prev, current)
+ while somespace(prev) do
+ head = remove_node(head, prev)
+ prev = get_prev(current)
+ end
+ if somepenalty(prev, 10000) then
+ head = remove_node(head, prev)
+ end
+ end
+ spacing_node = get_kern_node(leftspace * fontparameters.quad)
+ if not space_exception then
+ head = insert_node_before(head, current, spacing_node)
+ end
+ end
+ if rightspace and fontparameters then
+ local next = get_next(current)
+ local space_exception = false
+ if next then
+% \end{macrocode}
+% We do not add space before right (closing) brackets:
+% \begin{macrocode}
+ space_exception = somerightbracket(next)
+ local nextnext = get_next(next)
+ if somepenalty(next, 10000) and somespace(nextnext) then
+ head, next = remove_node(head, next)
+ end
+ while somespace(next) do
+ head, next = remove_node(head, next)
+ end
+ end
+ spacing_node = get_kern_node(rightspace * fontparameters.quad)
+ if not space_exception then
+ head, current = insert_node_after(head, current, spacing_node)
+ end
+ end
+ end
+ end
+ elseif id == math_code then
+ current = end_of_math(current)
+ end
+% \end{macrocode}
+% The following line does not cause an error even if |current| is |nil|.
+% \begin{macrocode}
+ current = get_next(current)
+ end
+ return head
+end
+% \end{macrocode}
+% Now we define the actual amount of space for the relevant punctuation
+% characters. For ecclesiastic Latin (and sometimes for Italian) a very
+% small space is used for the punctuation. The ecclesiastic package, a
+% predecessor of the current \babellatin{}, used a space of
+% 0.3|\fontdimen2|, where |\fontdimen2| is an interword space, which is
+% typically between 1/4 and 1/3 of a quad. We choose a half of a
+% |\thinspace| here, i.\,e., 1/12 of a quad.
+% \begin{macrocode}
+local hairspace = 0.08333 -- 1/12
+local function space_left(char)
+ left_space[char] = hairspace
+end
+local function space_right(char, kern)
+ right_space[char] = hairspace
+end
+space_left('!')
+space_left('?')
+space_left('‼')
+space_left('⁇')
+space_left('⁈')
+space_left('⁉')
+space_left('‽') -- U+203D (interrobang)
+space_left(':')
+space_left(';')
+space_left('»')
+space_left('›')
+space_right('«')
+space_right('‹')
+% \end{macrocode}
+% The following functions activate and deactivate the punctuation spacing.
+% \begin{macrocode}
+local function activate()
+ tex.setattribute(punct_attr, 1)
+ for _, callback_name in ipairs{ "pre_linebreak_filter", "hpack_filter" } do
+ if not in_callback(callback_name, "ecclesiasticlatin-punct.process") then
+ add_to_callback(callback_name, process, "ecclesiasticlatin-punct.process", 1)
+ end
+ end
+end
+local function deactivate()
+% \end{macrocode}
+% Though it would make compilation slightly faster, it is not possible to
+% safely remove the process from the callback here. Imagine the following
+% case: you start a paragraph by some spaced punctuation text, then, in the
+% same paragraph, you change the language to something else, and thus call
+% this function. This means that, at the end of the paragraph, the function
+% won't be in the callback, so the beginning of the paragraph won't be
+% processed by it. So we just unset the attribute.
+% \begin{macrocode}
+ tex.setattribute(punct_attr, -0x7FFFFFFF) -- this value means "unset"
+end
+% \end{macrocode}
+% For external access to the activation and deactivation of the punctuation
+% spacing, we define two functions with the prefix |ecclesiasticlatin|.
+% \begin{macrocode}
+ecclesiasticlatin = ecclesiasticlatin or {}
+ecclesiasticlatin.activate_spacing = activate
+ecclesiasticlatin.deactivate_spacing = deactivate
+% \end{macrocode}
+% \iffalse
+%</lua>
+% \fi
+% \PrintChanges
% \Finale
-%
\endinput
-
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.ins b/macros/latex/contrib/babel-contrib/latin/latin.ins
index b7b8bac612..d49e6d3f58 100644
--- a/macros/latex/contrib/babel-contrib/latin/latin.ins
+++ b/macros/latex/contrib/babel-contrib/latin/latin.ins
@@ -3,19 +3,29 @@
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
-%% Copyright 1989-2000 Johannes L. Braams and any individual authors
-%% listed elsewhere in this file. All rights reserved.
-%%
-%% This file is part of the Babel system, release 3.7.
+%% Copyright (C) 1989-2008 by Johannes L. Braams
+%% Copyright (C) 2009-2020 by Claudio Beccari
+%% Copyright (C) 2021 by Keno Wehr
+%% All rights reserved.
+%%
+%% This file is part of the babel-latin package.
%% ---------------------------------------------------
-%%
-%% It may be distributed under the terms of the LaTeX Project Public
-%% License, as described in lppl.txt in the base LaTeX distribution.
-%% Either version 1.1 or, at your option, any later version.
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Keno Wehr.
%%
%% --------------- start of docstrip commands ------------------
%%
-\def\filedate{2014/05/27}
+\def\filedate{2021/05/02}
\def\batchfile{latin.ins}
\input docstrip.tex
@@ -36,46 +46,75 @@
\declarepreamble\mainpreamble
-This is a generated file.
+Copyright (C) 1989-2008 by Johannes L. Braams
+Copyright (C) 2009-2020 by Claudio Beccari
+Copyright (C) 2021 by Keno Wehr
+All rights reserved.
+
+This file is part of the babel-latin package.
+----------------------------------------------
-Copyright 1989-2000 Johannes L. Braams and any individual authors
-listed elsewhere in this file. All rights reserved.
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
-This file is part of the Babel system release 3.7.
---------------------------------------------------
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Keno Wehr.
+
+Please report errors to: https://github.com/wehro/babel-latin/issues
-It may be distributed under the terms of the LaTeX Project Public
-License, as described in lppl.txt in the base LaTeX distribution.
-Either version 1.1 or, at your option, any later version.
\endpreamble
-\declarepreamble\fdpreamble
-This is a generated file.
+\keepsilent
+
+\usedir{tex/generic/babel-latin}
+\usepreamble\mainpreamble
+
+\generate{\file{classiclatin.ldf}{\from{latin.dtx}{classic}}
+ \file{ecclesiasticlatin.ldf}{\from{latin.dtx}{ecclesiastic}}
+ \file{latin.ldf}{\from{latin.dtx}{latin}}
+ \file{medievallatin.ldf}{\from{latin.dtx}{medieval}}
+ }
+
+\def\MetaPrefix{--}
+
+\declarepreamble\luapreamble
+
+The original version of the following Lua code has been written for the
+polyglossia package by É. Roux and others. The code has been adapted for
+the babel-latin package by K. Wehr.
-Copyright 2000 Johannes L. Braams and any individual authors
-listed elsewhere in this file. All rights reserved.
+Copyright (C) 2021 by Keno Wehr
+All rights reserved.
-This file is part of the Babel system, release 3.7.
----------------------------------------------------
+This file is part of the babel-latin package.
+----------------------------------------------
-It may be distributed under the terms of the LaTeX Project Public
-License, as described in lppl.txt in the base LaTeX distribution.
-Either version 1.1 or, at your option, any later version.
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2003/12/01 or later.
-In particular, permission is granted to customize the declarations in
-this file to serve the needs of your installation.
+This work has the LPPL maintenance status "maintained".
-However, NO PERMISSION is granted to distribute a modified version
-of this file under its original name.
+The Current Maintainer of this work is Keno Wehr.
+
+Please report errors to: https://github.com/wehro/babel-latin/issues
\endpreamble
-\keepsilent
+\usepreamble\luapreamble
+\nopostamble
-\usepreamble\mainpreamble
-\generate{\file{latin.ldf}{\from{latin.dtx}{code}}
- }
-\usepreamble\fdpreamble
+\generate{\file{ecclesiasticlatin.lua}{\from{latin.dtx}{lua}}}
\ifToplevel{
\Msg{***********************************************************}
@@ -83,13 +122,14 @@ of this file under its original name.
\Msg{* To finish the installation you have to move the following}
\Msg{* files into a directory searched by TeX:}
\Msg{*}
-\Msg{* \space\space All *.def, *.fd, *.ldf, *.sty}
+\Msg{* \space\space classiclatin.ldf, ecclesiasticlatin.ldf,}
+\Msg{* \space\space ecclesiasticlatin.lua, latin.ldf, medievallatin.ldf}
\Msg{*}
-\Msg{* To produce the documentation run the files ending with}
-\Msg{* '.dtx' and `.fdd' through LaTeX.}
+\Msg{* To produce the documentation run the file latin.dtx}
+\Msg{* through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing}
\Msg{***********************************************************}
}
-
-\endinput
+
+\endbatchfile
diff --git a/macros/latex/contrib/babel-contrib/latin/latin.pdf b/macros/latex/contrib/babel-contrib/latin/latin.pdf
index 592b907926..0c2c5c0e1f 100644
--- a/macros/latex/contrib/babel-contrib/latin/latin.pdf
+++ b/macros/latex/contrib/babel-contrib/latin/latin.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index ee03bbced6..0d8603b04b 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -28,7 +28,7 @@
%
% \title{\sffamily easybook 文档类手册}
% \author{瞿毅}
-% \date{2021/06/26\hskip\ccwd\relax v1.26l\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/06/28\hskip\ccwd\relax v1.26m\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -157,7 +157,7 @@
% floatpage = <true|(false)>
% \end{syntax}
% 开启这个选项后浮动环境 \env{table} 和 \env{figure} 的比例参数会使用默认值,关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。
-% \changes{v1.26l}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。}
+% \changes{v1.26m}{2021/06/15}{增加浮动环境比例参数选项 \opt{floatpage}。}
% \end{function}
%
% \subsection{article 模式}
@@ -191,7 +191,7 @@
% \tn{listoftables*+}\oarg{键值列表}
% \tn{listoflstlistings*+}\oarg{键值列表}
% \end{syntax}
-% \tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflstlistings} 输出代码目录。带有星号的目录命令不将标题添加进主文档目录,带有+号的目录命令可以使当前标题编号。\tn{tableofcontents+} 与其它命令不同是用于输出双语目录,需要与双语目录标题命令 \tn{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令。可选参数的键值列表如下:
+% \tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflstlistings} 输出代码目录。带有星号的目录命令不将标题添加进主文档目录,带有+号的目录命令可以使当前标题编号。\tn{tableofcontents+} 的+号含义则是输出双语目录,需要与双语目录标题命令 \tn{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令。可选参数的 \meta{键值列表} 如下:
% \changes{v1.25}{2021/05/05}{命令 \tn{tableofcontents} 可以输出双语目录。}
% \end{function}
%
@@ -239,7 +239,7 @@
% \tn{EBeforeAddBitoc*}\marg{加入目录英文标题前的代码}
% \end{syntax}
% \tn{appendix} 命令后的章节标题变为附录形式。英文目录中附录标题的格式用可选参数修改,英文附录目录前名字默认为 Appendix\tn{space},后名字默认为空,名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。英文附录目录数字输出命令默认为 \tn{Alph}\{chapter\}。
-% \changes{v1.26l}{2021/06/13}{增加调整英文目录格式的钩子 \tn{EBeforeAddBitoc}。}
+% \changes{v1.26m}{2021/06/13}{增加调整英文目录格式的钩子 \tn{EBeforeAddBitoc}。}
% \end{function}
%
% \tn{EBeforeAddBitoc} 是一个作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \tn{bichapter} 等命令前生效。
@@ -247,16 +247,17 @@
% \subsection{上标和下标}
% \begin{function}[added = 2021-06-26]{\super,\sub,\supersub,\textsuperscript,\textsubscript}
% \begin{syntax}
-% \tn{super*}\oarg{垂直偏移}\parg{格式代码}\marg{内容}\oarg{水平偏移}
-% \tn{sub*}\oarg{垂直偏移}\parg{格式代码}\marg{内容}\oarg{水平偏移}
-% \tn{supersub*}\oarg{script sep}\oarg{对齐方式}\parg{上标代码}
+% \tn{super*}\oarg{垂直偏移}[<高度>,<深度>]\parg{格式代码}\marg{内容}\oarg{水平偏移}
+% \tn{sub*}\oarg{垂直偏移}[<高度>,<深度>]\parg{格式代码}\marg{内容}\oarg{水平偏移}
+% \tn{supersub*}\oarg{上下标间距}\oarg{对齐方式}\parg{上标代码}
% \ \marg{上标内容}\marg{下标内容}
% \ \oarg{水平偏移}\parg{下标代码}
% \end{syntax}
% 上标和下标的功能来自 \pkg{spbmark} 宏包,\tn{super}、\tn{sub} 和 \tn{supersub} 三个命令可以用于输出上标和下标。它们根据当前处于文本模式还是数学模式来匹配相应的模式,或者可以使用它们的星号变体命令来强制使用数学模式。也可以使用键值列表对偏移量进行全局设置,详情见小节 \ref{subsec:style}。
+% \changes{v1.26m}{2021/06/28}{增加可以调整相对位置和格式的上标和下标命令 \tn{super}、\tn{sub} 和 \tn{supersub}。}
% \end{function}
%
-% 垂直和水平偏移默认值都是0pt,\meta{对齐方式} 的参数与 \opt{supersubalign} 相同。\meta{格式代码} 用于格式化上标和下标,可以插入字体或颜色等命令。代码中的最后一个命令可以接受一个为上标或下标的参数。\tn{textsuperscript} 和 \tn{textsubscript} 命令已被重新定义并且分别等价于 \tn{super} 和 \tn{sub},如果您需要使用它们的原始定义创建新命令,则可以使用 \tn{spb@textsuperscript@save} 和 \tn{spb@textsubscript@save} 命令。
+% 垂直和水平偏移默认值都是0 pt,\meta{对齐方式} 的参数与 \opt{supersubalign} 相同。\meta{格式代码} 用于格式化上标和下标,可以插入字体或颜色等命令。代码中的最后一个命令可以接受一个为上标或下标的参数。\tn{textsuperscript} 和 \tn{textsubscript} 命令已被重新定义并且分别等价于 \tn{super} 和 \tn{sub},如果您需要使用它们的原始定义创建新命令,则可以使用 \tn{spb@textsuperscript@save} 和 \tn{spb@textsubscript@save} 命令。
%
% \section{接口选项}
% \label{sec:interface options}
@@ -509,7 +510,7 @@
% 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令,由 \pkg{thmtools} 提供支持,用法与它的同名命令一致。
% \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EBNewTheorem}。}
-% \changes{v1.26l}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。}
+% \changes{v1.26m}{2021/06/15}{定义新定理环境的命令调整为 \tn{declaretheorem}。}
% \end{function}
%
% \begin{optdesc}
@@ -615,7 +616,7 @@
% \tn{markrule}\oarg{长度|(\tn{textwidth})}\parg{颜色名}\marg{线宽|(0.75pt)}[<上间距>+<下间距>]
% \end{syntax}
% 命令 \tn{easyhead} 和 \tn{easyfoot} 的使用方法与 \tn{fancyhead} 和 \tn{fancyfoot} 完全相同,它们需要在 \opt{head-foot} 选项中使用,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
-% \changes{v1.26l}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。}
+% \changes{v1.26m}{2021/06/14}{增加页眉页脚的横线绘制命令 \tn{markrule}。}
% \end{function}
%
% 命令 \tn{markrule} 用于绘制页眉页脚横线,长度默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用+号分开,若只有一部分则表示上间距,这个命令也可以在正文中绘制横线。下面举一个设置页眉内容的例子:
@@ -1108,7 +1109,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/06/26}{1.26l}{beta}
+\ProvidesExplClass{easybook}{2021/06/28}{1.26m}{beta}
\bool_set_false:N \l__eb_compile_draft_bool
\bool_set_false:N \l__eb_title_newline_bool
@@ -1355,7 +1356,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{etoolbox}
-\ProvidesExplPackage{easybase}{2021/06/26}{1.26l}{beta}
+\ProvidesExplPackage{easybase}{2021/06/28}{1.26m}{beta}
\cs_generate_variant:Nn \eb_ctex_define:nn { nx }
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -1659,6 +1660,26 @@
\tl_if_novalue:nF {#5} { \vspace*{#5} }
\group_end:
}
+\cs_new:Npn \eb_fnmark_counter_pifont:N #1
+ { \ding{\int_eval:n { 171 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1
+ { \ding{\int_eval:n { 181 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1
+ { \ding{\int_eval:n { 191 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1
+ { \ding{\int_eval:n { 201 + #1 }} }
+\cs_new:Npn \eb_footnote_counter:N #1
+ {
+ \str_case:VnF \l__eb_fnmark_number_choice_tl
+ {
+ { plain } { \int_use:N #1 }
+ { pifont } { \eb_fnmark_counter_pifont:N #1 }
+ { pifont* } { \eb_fnmark_counter_pifont_neg:N #1 }
+ { pifont-sans } { \eb_fnmark_counter_pifont_sans:N #1 }
+ { pifont-sans* } { \eb_fnmark_counter_pifont_sans_neg:N #1 }
+ }
+ { \int_use:N #1 }
+ }
\eb_ctex_define:nn { hdrset }
{
head-foot .tl_set:N = \l__eb_fancyhf_content_tl,
@@ -1786,18 +1807,19 @@
\dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
\bool_if:NT \l__eb_chap_counter_withpart_bool
{ \counterwithin*{chapter}{part} }
- \str_case:Vn \l__eb_foot_counter_parent_choice_tl
- {
- { part }
- {
- \counterwithout*{footnote}{chapter}
- \counterwithin*{footnote}{part}
- }
- { page }
- {
- \counterwithout*{footnote}{chapter}
- \counterwithin*{footnote}{page}
- }
+ \str_case:VnF \l__eb_foot_counter_parent_choice_tl
+ {
+ { part } { \use_i:nn }
+ { page } { \use_ii:nn }
+ }
+ { \use_none:nn }
+ {
+ \counterwithout*{footnote}{chapter}
+ \counterwithin*{footnote}{part}
+ }
+ {
+ \counterwithout*{footnote}{chapter}
+ \counterwithin*{footnote}{page}
}
\bool_if:NTF \l__eb_footnote_hang_bool
{ \booltrue{FN@hangfoot} }
@@ -1841,38 +1863,6 @@
\cs_set:Npn \thefootnote { \eb_footnote_counter:N \c@footnote }
\cs_set:Npn \thempfootnote { \eb_alph:n { mpfootnote } }
-\cs_new_protected:Npn \eb_fnmark_number_set:nn #1#2
- { \tl_const:cn { c__eb_fnmark_number_#1_tl } {#2} }
-\clist_map_inline:nn
- {
- { plain } { plain },
- { pifont } { pifont },
- { pifont_neg } { pifont* },
- { pifont_sans } { pifont-sans },
- { pifont_sans_neg } { pifont-sans* }
- }
- { \eb_fnmark_number_set:nn #1 }
-\cs_new:Npn \eb_fnmark_counter_pifont:N #1
- { \ding{\int_eval:n { 171 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1
- { \ding{\int_eval:n { 181 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1
- { \ding{\int_eval:n { 191 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1
- { \ding{\int_eval:n { 201 + #1 }} }
-\cs_new:Npn \eb_footnote_counter:N #1
- {
- \str_case:VnF \l__eb_fnmark_number_choice_tl
- {
- { plain } { \int_use:N #1 }
- { pifont } { \eb_fnmark_counter_pifont:N #1 }
- { pifont* } { \eb_fnmark_counter_pifont_neg:N #1 }
- { pifont-sans } { \eb_fnmark_counter_pifont_sans:N #1 }
- { pifont-sans* } { \eb_fnmark_counter_pifont_sans_neg:N #1 }
- }
- { \int_use:N #1 }
- }
-
\contentsuse{lstlisting}{lol}
\seq_const_from_clist:Nn \c__eb_toc_heading_level_seq
{ part,chapter,section,subsection,figure,table,lstlisting }
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index cd746dcd3e..90f867a097 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf b/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf
index f42fbd6e6a..84ce6d7fb5 100644
--- a/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf
+++ b/macros/latex/contrib/projlib/ProjLib-doc-cn.pdf
Binary files differ
diff --git a/macros/latex/contrib/projlib/ProjLib-doc-cn.tex b/macros/latex/contrib/projlib/ProjLib-doc-cn.tex
index 7ee72fbbab..223b832807 100644
--- a/macros/latex/contrib/projlib/ProjLib-doc-cn.tex
+++ b/macros/latex/contrib/projlib/ProjLib-doc-cn.tex
@@ -81,7 +81,7 @@
\title{\ProjLib{} 工具集\\[.3\baselineskip]\normalsize 使用指南}
\author{许锦文}
-\thanks{对应版本.~~\texttt{\ProjLib{}~2021/06/19}}
+\thanks{对应版本.~~\texttt{\ProjLib{}~2021/06/28}}
\date{2021年6月,北京}
\maketitle
@@ -443,6 +443,7 @@
\begin{itemize}[itemsep=.6em]
\item \PJLauthor{} 仍然处于初步阶段,在很多方面还远远比不上相对成熟的 \textsf{authblk}。
\item \PJLlang{}:针对 \textsf{polyglossia} 的设置仍然存在许多问题,因此现在主要功能都是通过 \textsf{babel} 实现的。
+ \item \PJLlang{}:语言选项的设定存在问题,如 \texttt{chinese} 会导致 \textsf{babel} 报错,并且不同选项间还可能产生冲突。
\item \PJLpaper{} 的 \texttt{preview} 功能主要是通过 \textsf{geometry} 宏包实现的,因此在 \textsc{\textsf{Koma}} 文档类中效果不好。
\item \PJLthm{} 对于定理类环境的编号与样式设定目前还无法由用户更改。
\item \PJLthm{}:智能引用针对所有 \PJLlang{} 已支持语言的本地化尚不完整,主要是中文、日文与俄文。
diff --git a/macros/latex/contrib/projlib/ProjLib-doc-en.pdf b/macros/latex/contrib/projlib/ProjLib-doc-en.pdf
index b3ffa5dc5e..7fccf5e976 100644
--- a/macros/latex/contrib/projlib/ProjLib-doc-en.pdf
+++ b/macros/latex/contrib/projlib/ProjLib-doc-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/projlib/ProjLib-doc-en.tex b/macros/latex/contrib/projlib/ProjLib-doc-en.tex
index 1f232fe5e6..e55aa8c095 100644
--- a/macros/latex/contrib/projlib/ProjLib-doc-en.tex
+++ b/macros/latex/contrib/projlib/ProjLib-doc-en.tex
@@ -79,7 +79,7 @@
\title{\ProjLib{}~\,Toolkit\\[.3\baselineskip]\normalsize User Manual}
\author{Jinwen Xu}
-\thanks{Corresponding to: \texttt{\ProjLib{}~2021/06/19}}
+\thanks{Corresponding to: \texttt{\ProjLib{}~2021/06/28}}
\date{June 2021, Beijing}
\maketitle
@@ -424,6 +424,7 @@ defines an unnumbered environment \lstinline|proofidea*| and a numbered environm
\begin{itemize}[itemsep=.6em]
\item \PJLauthor{} is still in its preliminary stage, its effect is not as good as the relatively mature \textsf{authblk}.
\item \PJLlang{}: It is still quite problematic with the configuration of \textsf{polyglossia}, so main features are implemented through \textsf{babel} for now.
+ \item \PJLlang{}: There are some problems with the language options. For example, \texttt{chinese} will cause errors with \textsf{babel}. Also, conflicts among multiple options may occur.
\item \PJLpaper{}: the \texttt{preview} option is mainly implemented with the help of package \textsf{geometry}, so it does not work quite as well in the \textsc{\textsf{Koma}} document classes.
\item \PJLthm{}: The numbering and theorem-style settings of the theorem-like environments cannot be accessed by the user at present.
\item \PJLthm{}: The localization of \textsf{cleveref} is not yet complete for all supported languages of \PJLlang{}, especially for Chinese, Japanese and Russian.
diff --git a/macros/latex/contrib/projlib/ProjLib.dtx b/macros/latex/contrib/projlib/ProjLib.dtx
index 84b8e15894..33c97fd57f 100644
--- a/macros/latex/contrib/projlib/ProjLib.dtx
+++ b/macros/latex/contrib/projlib/ProjLib.dtx
@@ -18,57 +18,57 @@
%
%<*ProjLib>
\ProvidesPackage{ProjLib}
- [2021/06/19 The collective interface of ProjLib toolkit]
+ [2021/06/28 The collective interface of ProjLib toolkit]
%</ProjLib>
%
%<*PJLamssim>
\ProvidesPackage{PJLamssim}
- [2021/06/19 Simulate some features of amsart]
+ [2021/06/28 Simulate some features of amsart]
%</PJLamssim>
%
%<*PJLauthor>
\ProvidesPackage{PJLauthor}
- [2021/06/19 Enhanced author information block]
+ [2021/06/28 Enhanced author information block]
%</PJLauthor>
%
%<*PJLdate>
\ProvidesPackage{PJLdate}
- [2021/06/19 Convert yyyy-mm-dd to normal datetime format]
+ [2021/06/28 Convert yyyy-mm-dd to normal datetime format]
%</PJLdate>
%
%<*PJLdraft>
\ProvidesPackage{PJLdraft}
- [2021/06/19 Some useful macros for the draft stage]
+ [2021/06/28 Some useful macros for the draft stage]
%</PJLdraft>
%
%<*PJLlang>
\ProvidesPackage{PJLlang}
- [2021/06/19 Multi-language configuration]
+ [2021/06/28 Multi-language configuration]
%</PJLlang>
%
%<*PJLlogo>
\ProvidesPackage{PJLlogo}
- [2021/06/19 The ProjLib logo]
+ [2021/06/28 The ProjLib logo]
%</PJLlogo>
%
%<*PJLmath>
\ProvidesPackage{PJLmath}
- [2021/06/19 Useful math macros and shortcuts]
+ [2021/06/28 Useful math macros and shortcuts]
%</PJLmath>
%
%<*PJLpaper>
\ProvidesPackage{PJLpaper}
- [2021/06/19 Paper style configuration]
+ [2021/06/28 Paper style configuration]
%</PJLpaper>
%
%<*PJLthm>
\ProvidesPackage{PJLthm}
- [2021/06/19 Theorem setup and configuration]
+ [2021/06/28 Theorem setup and configuration]
%</PJLthm>
%
%<*PJLtoolkit>
\ProvidesPackage{PJLtoolkit}
- [2021/06/19 Collective interface of ProjLib Toolkit]
+ [2021/06/28 Collective interface of ProjLib Toolkit]
%</PJLtoolkit>
%
\RequirePackage{kvoptions}
@@ -471,28 +471,29 @@
\newif\if@PJLlang@enable@TC\@PJLlang@enable@TCfalse
\newif\if@PJLlang@enable@JP\@PJLlang@enable@JPfalse
\newif\if@PJLlang@enable@RU\@PJLlang@enable@RUfalse
-\DeclareVoidOption{EN}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}}
-\DeclareVoidOption{english}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}}
-\DeclareVoidOption{English}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}}
-\DeclareVoidOption{FR}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}}
-\DeclareVoidOption{french}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}}
-\DeclareVoidOption{French}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}}
-\DeclareVoidOption{DE}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}}
-\DeclareVoidOption{german}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}}
-\DeclareVoidOption{ngerman}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}}
-\DeclareVoidOption{German}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}}
-\DeclareVoidOption{IT}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}}
-\DeclareVoidOption{italian}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}}
-\DeclareVoidOption{Italian}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}}
-\DeclareVoidOption{PT}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}}
-\DeclareVoidOption{portuguese}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}}
-\DeclareVoidOption{Portuguese}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}}
-\DeclareVoidOption{BR}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}}
-\DeclareVoidOption{brazilian}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}}
-\DeclareVoidOption{Brazilian}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}}
-\DeclareVoidOption{ES}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}}
-\DeclareVoidOption{spanish}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}}
-\DeclareVoidOption{Spanish}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}}
+\def\PJLlang@babeloptions{}
+\DeclareVoidOption{EN}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}\gpreto{\PJLlang@babeloptions}{,english}}
+\DeclareVoidOption{english}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}\gpreto{\PJLlang@babeloptions}{,english}}
+\DeclareVoidOption{English}{\@PJLlang@enable@allfalse\@PJLlang@enable@ENtrue\providecommand{\PJLlang@mainlang}{EN}\gpreto{\PJLlang@babeloptions}{,english}}
+\DeclareVoidOption{FR}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}\gpreto{\PJLlang@babeloptions}{,french}}
+\DeclareVoidOption{french}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}\gpreto{\PJLlang@babeloptions}{,french}}
+\DeclareVoidOption{French}{\@PJLlang@enable@allfalse\@PJLlang@enable@FRtrue\providecommand{\PJLlang@mainlang}{FR}\gpreto{\PJLlang@babeloptions}{,french}}
+\DeclareVoidOption{DE}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}\gpreto{\PJLlang@babeloptions}{,ngerman}}
+\DeclareVoidOption{german}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}\gpreto{\PJLlang@babeloptions}{,ngerman}}
+\DeclareVoidOption{ngerman}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}\gpreto{\PJLlang@babeloptions}{,ngerman}}
+\DeclareVoidOption{German}{\@PJLlang@enable@allfalse\@PJLlang@enable@DEtrue\providecommand{\PJLlang@mainlang}{DE}\gpreto{\PJLlang@babeloptions}{,ngerman}}
+\DeclareVoidOption{IT}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}\gpreto{\PJLlang@babeloptions}{,italian}}
+\DeclareVoidOption{italian}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}\gpreto{\PJLlang@babeloptions}{,italian}}
+\DeclareVoidOption{Italian}{\@PJLlang@enable@allfalse\@PJLlang@enable@ITtrue\providecommand{\PJLlang@mainlang}{IT}\gpreto{\PJLlang@babeloptions}{,italian}}
+\DeclareVoidOption{PT}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}\gpreto{\PJLlang@babeloptions}{,portuguese}}
+\DeclareVoidOption{portuguese}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}\gpreto{\PJLlang@babeloptions}{,portuguese}}
+\DeclareVoidOption{Portuguese}{\@PJLlang@enable@allfalse\@PJLlang@enable@PTtrue\providecommand{\PJLlang@mainlang}{PT}\gpreto{\PJLlang@babeloptions}{,portuguese}}
+\DeclareVoidOption{BR}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}\gpreto{\PJLlang@babeloptions}{,brazilian}}
+\DeclareVoidOption{brazilian}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}\gpreto{\PJLlang@babeloptions}{,brazilian}}
+\DeclareVoidOption{Brazilian}{\@PJLlang@enable@allfalse\@PJLlang@enable@BRtrue\providecommand{\PJLlang@mainlang}{BR}\gpreto{\PJLlang@babeloptions}{,brazilian}}
+\DeclareVoidOption{ES}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}\gpreto{\PJLlang@babeloptions}{,spanish}}
+\DeclareVoidOption{spanish}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}\gpreto{\PJLlang@babeloptions}{,spanish}}
+\DeclareVoidOption{Spanish}{\@PJLlang@enable@allfalse\@PJLlang@enable@EStrue\providecommand{\PJLlang@mainlang}{ES}\gpreto{\PJLlang@babeloptions}{,spanish}}
\DeclareVoidOption{CN}{\@PJLlang@enable@allfalse\@PJLlang@enable@CNtrue\providecommand{\PJLlang@mainlang}{CN}}
\DeclareVoidOption{chinese}{\@PJLlang@enable@allfalse\@PJLlang@enable@CNtrue\providecommand{\PJLlang@mainlang}{CN}}
\DeclareVoidOption{Chinese}{\@PJLlang@enable@allfalse\@PJLlang@enable@CNtrue\providecommand{\PJLlang@mainlang}{CN}}
@@ -505,12 +506,12 @@
\DeclareVoidOption{TChinese}{\@PJLlang@enable@allfalse\@PJLlang@enable@TCtrue\providecommand{\PJLlang@mainlang}{TC}}
\DeclareVoidOption{traditionalchinese}{\@PJLlang@enable@allfalse\@PJLlang@enable@TCtrue\providecommand{\PJLlang@mainlang}{TC}}
\DeclareVoidOption{TraditionalChinese}{\@PJLlang@enable@allfalse\@PJLlang@enable@TCtrue\providecommand{\PJLlang@mainlang}{TC}}
-\DeclareVoidOption{JP}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}}
-\DeclareVoidOption{japanese}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}}
-\DeclareVoidOption{Japanese}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}}
-\DeclareVoidOption{RU}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}}
-\DeclareVoidOption{russian}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}}
-\DeclareVoidOption{Russian}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}}
+\DeclareVoidOption{JP}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}\gpreto{\PJLlang@babeloptions}{,japanese}}
+\DeclareVoidOption{japanese}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}\gpreto{\PJLlang@babeloptions}{,japanese}}
+\DeclareVoidOption{Japanese}{\@PJLlang@enable@allfalse\@PJLlang@enable@JPtrue\providecommand{\PJLlang@mainlang}{JP}\gpreto{\PJLlang@babeloptions}{,japanese}}
+\DeclareVoidOption{RU}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}\gpreto{\PJLlang@babeloptions}{,russian}}
+\DeclareVoidOption{russian}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}\gpreto{\PJLlang@babeloptions}{,russian}}
+\DeclareVoidOption{Russian}{\@PJLlang@enable@allfalse\@PJLlang@enable@RUtrue\providecommand{\PJLlang@mainlang}{RU}\gpreto{\PJLlang@babeloptions}{,russian}}
\ProcessKeyvalOptions*\relax
\providecommand{\PJLlang@mainlang}{EN}
@@ -563,13 +564,19 @@
\WarningFilter{polyglossia}{Asking to add empty feature to latin font(Script="CJK" to scripttag "")}
\fi
\else
- \ifPDFTeX\else
- \PassOptionsToPackage{japanese,russian}{babel}
+ \if@PJLlang@enable@all
+ \ifPDFTeX\else
+ \PassOptionsToPackage{japanese,russian}{babel}
+ \fi
+ \PassOptionsToPackage{italian,portuguese,brazilian,spanish,es-notilde,es-noquoting,ngerman,french,english,shorthands=off}{babel}
+ \else
+ \PassOptionsToPackage{\PJLlang@babeloptions}{babel}
\fi
- \PassOptionsToPackage{italian,portuguese,brazilian,spanish,es-notilde,es-noquoting,ngerman,french,english,shorthands=off}{babel}
\PassOptionsToPackage{italian,brazilian,spanish,ngerman,french,english}{cleveref}
\RequirePackage{babel}
- \frenchsetup{PartNameFull=false}
+ \if@PJLlang@enable@FR
+ \frenchsetup{PartNameFull=false}
+ \fi
\fi
%
\let\today@PJLoriginal\today
@@ -1093,6 +1100,13 @@
\def\scrZ{\ensuremath{\mathscr{Z}}}
%%================================
+%% General symbols
+%%================================
+\providecommand*{\injection}{\ensuremath{\hookrightarrow}}
+\providecommand*{\surjection}{\ensuremath{\twoheadrightarrow}}
+\providecommand*{\bijection}{\ensuremath{\xrightarrow{\sim}}}
+
+%%================================
%% Symbols for number theory
%%================================
\ifdefined\@@pmod\else
@@ -1965,7 +1979,7 @@
\RequirePackage{mathpazo}
\PassOptionsToPackage{defaultsups}{newpxtext}
\RequirePackage{newpxtext}
- \RequirePackage{newpxmath}
+ % \RequirePackage{newpxmath}
\let\openbox\relax
\PJLsetlinespacing{\setstretch{1.07}}
\if@PJLtoolkit@useosf\useosf\fi
diff --git a/macros/latex/contrib/projlib/README.md b/macros/latex/contrib/projlib/README.md
index d2c257b43b..35fe121524 100644
--- a/macros/latex/contrib/projlib/README.md
+++ b/macros/latex/contrib/projlib/README.md
@@ -2,13 +2,20 @@
# ProjLib Toolkit
-> **ProjLib** can be interpreted as "***Proj**ect **Lib**rary*" in English, but I prefer the French interpretation "***Proj**et **Lib**re*".
+> **ProjLib** can be interpreted as "***Proj**ect **Lib**rary*" (in English), or "***Proj**et **Lib**re*" (in French). Personally, I prefer the French interpretation.
## Introduction
`ProjLib` is a collection of tools that help you write LaTeX document. With package `ProjLib` loaded (note that it is case-sensitive), you no longer need to set up the theorem-like environments nor to manually configure the appropriate multilingual settings. In addition, a series of auxiliary functionalities are introduced.
-The collection includes:
+To get started, simply put this line in your preamble:
+```latex
+\usepackage{ProjLib}
+```
+> For the options and detailed usage, please refer to the documentation.
+
+## The components
+The components include:
1. `PJLamssim.sty`
- Simulate some features of `amsart` in the standard classes
1. `PJLauthor.sty`
diff --git a/macros/latex/contrib/spbmark/spbmark.dtx b/macros/latex/contrib/spbmark/spbmark.dtx
index 23e13e57b4..754bcfa0c4 100644
--- a/macros/latex/contrib/spbmark/spbmark.dtx
+++ b/macros/latex/contrib/spbmark/spbmark.dtx
@@ -11,7 +11,8 @@
% \iffalse
%<*driver>
\documentclass{l3doc}
-\usepackage{spbmark}
+\usepackage{spbmark,siunitx}
+\usepackage[noto]{newtxmath}
\OnlyDescription
\begin{document}
\DocInput{\jobname.dtx}
@@ -22,7 +23,7 @@
%
% \title{\pkg{spbmark} -- Superscript and subscript of text}
% \author{Qu Yi}
-% \date{2021/06/26\hskip 1em\relax v1.00\thanks{\url{https://github.com/texl3/spbmark}}}
+% \date{2021/06/28\hskip 1em\relax v1.00a\thanks{\url{https://github.com/texl3/spbmark}}}
%
% \maketitle
% \begin{abstract}
@@ -36,10 +37,10 @@
% \end{function}
%
% \section{User commands}
-% \begin{function}[added = 2021-06-26]{\super,\sub,\supersub,\textsuperscript,\textsubscript}
+% \begin{function}[added = 2021-06-26,updated = 2021-06-28]{\super,\sub,\supersub,\textsuperscript,\textsubscript}
% \begin{syntax}
-% \tn{super*}\oarg{vertical shift}\parg{format code}\marg{content}\oarg{horizontal shift}
-% \tn{sub*}\oarg{vertical shift}\parg{format code}\marg{content}\oarg{horizontal shift}
+% \tn{super*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
+% \tn{sub*}\oarg{vshift}[<height>,<depth>]\parg{code}\marg{content}\oarg{hshift}
% \tn{supersub*}\oarg{script sep}\oarg{script align}\parg{super format code}
% \ \marg{super content}\marg{sub content}
% \ \oarg{horizontal shift}\parg{sub format code}
@@ -47,9 +48,11 @@
% \tn{super} command is used to output superscripts, \tn{sub} command is used to output subscripts, \tn{supersub} command is used to output both superscripts and subscripts.
% \end{function}
%
-% They match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. The vertical shift and horizontal shift are both 0pt, and the parameters of \meta{script align} are the same as the \texttt{supersubalign}.
+% They match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. The \meta{vshift} and \meta{hshift} represent respectively vertical and horizontal offsets of superscript or subscript, their default value is 0 pt, and the parameters of \meta{script align} are the same as the \texttt{supersubalign}.
%
-% The \meta{format code} is used to format superscripts and subscripts, and can insert commands such as fonts or colors. The last command in the code can take an argument, which is either a superscript or a subscript.
+% The second optional parameter generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the height of the superscript or subscript, and only the back part indicates the depth.
+%
+% The \meta{code} is used to format superscripts and subscripts, and can insert commands such as fonts or colors. The last command in the code can take an argument, which is either a superscript or a subscript.
%
% The \tn{textsuperscript} and \tn{textsubscript} commands have been redefined to be equivalent to \tn{super} and \tn{sub} respectively, if you need to use their original definitions, then \tn{spb@textsuperscript@save} and \tn{spb@textsubscript@save} will be available.
%
@@ -77,7 +80,7 @@
% \DescribeOption{super-hshift} Extra horizontal shift of the superscripts. \\
% \DescribeOption{sub-vshift} Extra vertical shift of the subscripts. \\
% \DescribeOption{sub-hshift} Extra horizontal shift of the subscripts. \\
-% \DescribeOption{supersubsep} The distance between superscript and subscript when using \tn{supersub}, its default value is 0.3ex. \\
+% \DescribeOption{supersubsep} The distance between superscript and subscript when using \tn{supersub}, its default value is 0.3 ex. \\
% \DescribeOption{supersubalign} The alignment of superscript and subscript when using \tn{supersub}, which contains l, c, and r parameters respectively for left, center, and right alignment. \\
%
% \section{Examples of use}
@@ -86,16 +89,27 @@
% \noindent
% |A\super[0.2ex](\color{red}){exam}[0.2em]B| \\
% |$A\sub(\mathsf){exam}B$| \\
-% |A\supersub[0.3ex][c]{examsuper}{examsub}B| \\
+% |A\supersub[0.3ex][c]{examsuper}{sub}B| \\
% A\super[0.2ex](\color{red}){exam}[0.2em]B \\
% $A\sub(\mathsf){exam}B$ \\
-% A\supersub[0.3ex][c]{examsuper}{examsub}B
+% A\supersub[0.3ex][c]{examsuper}{sub}B
+% \end{quotation}
+%
+% It can also be used with the \pkg{siunitx} package to output superscripts and subscripts in the unit:
+% \begin{quotation}
+% \noindent
+% |\unit[mode = math]{kg.m/s\super*[-1pt]{2}}| \\
+% |\qty[mode = text]{30}{A\supersub(\color{red}){b}{c}[1pt]}| \\
+% |\spbset{sub-hshift = 2pt}\unit[mode = text]{A_b}| \\
+% \unit[mode = math]{kg.m/s\super*[-1pt]{2}} \\
+% \qty[mode = text]{30}{A\supersub(\color{red}){b}{c}[1pt]} \\
+% \spbset{sub-hshift = 2pt}\unit[mode = text]{A_b}
% \end{quotation}
%
-% \pkg{spbmark} also patches the standard document class and the footer markers for \cls{KOMA-Script}. You can format the footer markers by redefining the \tn{fnmarkfont} command. Note that extra horizontal shift does not work with footnote markers.
+% \pkg{spbmark} also patches the footer markers for standard document class and \cls{KOMA-Script}. You can format the footer markers by redefining the \tn{fnmarkfont} command. Note that extra horizontal shift does not work with footnote markers.
%
% \section{Known issues}
-% At present, the vertical and horizontal offsets are effective for the unit commands in the text mode of the \pkg{siunitx} macro package. \tn{super} and \tn{sub} can also be used normally in its unit commands, but when the unit is output in the math mode, \tn{supersub} command cannot be used.
+% At present, the vertical and horizontal offsets are effective for the unit commands in the \pkg{siunitx} macro package. However, due to the special mechanism that the decimal point is not recognized correctly because it is converted to a space in the \tn{unit} command, it is recommended to use \texttt{pt} as the unit of offset.
%
% \newcommand\urlprefix{\newline\hspace*{\fill}}
% \let\OldUrl\url
@@ -113,7 +127,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/06/26}{1.00}{beta}
+\ProvidesExplPackage{spbmark}{2021/06/28}{1.00a}{beta}
\cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } }
\cs_new_protected:Npn \spbset { \keys_set:nn { spbmark } }
@@ -143,10 +157,13 @@
supersubalign .tl_set:N = \l__spb_supersub_script_align_tl,
supersubalign .initial:n = l
}
+
\tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box }
\tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
\cs_new:Npn \spb_tmp_boxa_use: { \box_use:N \l_tmpa_box }
\cs_new:Npn \spb_tmp_boxb_use: { \box_use:N \l_tmpb_box }
+\cs_new:Npn \spb_tmp_hboxa_set:n #1 { \hbox_set:Nn \l_tmpa_box {#1} }
+\cs_new:Npn \spb_tmp_hboxb_set:n #1 { \hbox_set:Nn \l_tmpb_box {#1} }
\cs_new:Npn \spb_box_max_dim_horizontal:
{
\skip_horizontal:n
@@ -174,27 +191,34 @@
{ sub } { \sb }
}
}
+\cs_new_protected:Npn \spb_box_dp_ht_assign:nn #1#2
+ {
+ \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} }
+ \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} }
+ }
\clist_map_inline:nn
{ super,sub }
{
\exp_args:Nc \NewDocumentCommand {#1}
{
- sO{\dim_use:c { l__spb_#1_script_vshift_dim }}D(){}m
- O{\dim_use:c { l__spb_#1_script_hshift_dim }}
+ sO{\dim_use:c { l__spb_#1_script_vshift_dim }}
+ >{\SplitArgument{1}{,}}O{}D(){}
+ mO{\dim_use:c { l__spb_#1_script_hshift_dim }}
}
{
\IfBooleanTF{##1}
- {\hbox_set:Nn \l_tmpa_box { $##3{\spb_math:nn {#1} {##4}}$ }}
+ {\spb_tmp_hboxa_set:n { $##4{\spb_math:nn {#1} {##5}}$ }}
{
\mode_if_math:TF
- { \hbox_set:Nn \l_tmpa_box { $##3{\spb_math:nn {#1} {##4}}$ } }
+ { \spb_tmp_hboxa_set:n { $##4{\spb_math:nn {#1} {##5}}$ } }
{
- \hbox_set:Nn \l_tmpa_box
- { ##3{\use:c { spb@text#1script@save }{##4}} }
+ \spb_tmp_hboxa_set:n
+ { ##4{\use:c { spb@text#1script@save }{##5}} }
}
}
- \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##5 }
+ \hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxa_wd_tl + ##6 }
{ \hss\box_move_up:nn {##2} { \spb_tmp_boxa_use: } }
+ \spb_box_dp_ht_assign:nn ##3
\spb_tmp_boxb_use:
}
}
@@ -206,30 +230,33 @@
{
\IfBooleanTF{#1}
{
- \hbox_set:Nn \l_tmpa_box { $#4{\sp{#5}}$ }
- \hbox_set:Nn \l_tmpb_box { $#8{\sb{#6}}$ }
+ \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
+ \spb_tmp_hboxb_set:n { $#8{\sb{#6}}$ }
}{
\mode_if_math:TF
{
- \hbox_set:Nn \l_tmpa_box { $#4{\sp{#5}}$ }
- \hbox_set:Nn \l_tmpb_box { $#8{\sb{#6}}$ }
+ \spb_tmp_hboxa_set:n { $#4{\sp{#5}}$ }
+ \spb_tmp_hboxb_set:n { $#8{\sb{#6}}$ }
}
{
- \hbox_set:Nn \l_tmpa_box { #4{\spb@textsuperscript@save{#5}} }
- \hbox_set:Nn \l_tmpb_box { #8{\spb@textsubscript@save{#6}} }
+ \spb_tmp_hboxa_set:n { #4{\spb@textsuperscript@save{#5}} }
+ \spb_tmp_hboxb_set:n { #8{\spb@textsubscript@save{#6}} }
}
}
\hbox_set_to_wd:Nnn \l_tmpa_box { \l__spb_boxa_wd_tl + #7 }
{ \hss\box_move_up:nn {#2} { \spb_tmp_boxa_use: } }
\hbox_set_to_wd:Nnn \l_tmpb_box { \l__spb_boxb_wd_tl + #7 }
{ \hss\box_move_down:nn {#2} { \spb_tmp_boxb_use: } }
- \str_case:nnF {#3}
+ \str_case:onF {#3}
{
{ l } { \use_i:nnn }
{ c } { \use_ii:nnn }
{ r } { \use_iii:nnn }
}
- { \use_i:nnn }
+ {
+ \msg_warning:nn { spbmark } { unsupported-align }
+ \use_i:nnn
+ }
{
\hbox_overlap_right:n { \spb_tmp_boxa_use: }
\hbox_overlap_right:n { \spb_tmp_boxb_use: }
@@ -246,6 +273,11 @@
\hbox_overlap_left:n { \spb_tmp_boxb_use: }
}
}
+\msg_new:nnn { spbmark } { unsupported-align }
+ {
+ Alignment~only~supports~l,~c,~and~r. \\
+ The~l~parameter~will~be~used~by~default.
+ }
\cs_set_eq:NN \textsuperscript \super
\cs_set_eq:NN \textsubscript \sub
\cs_set:Npn \@makefnmark
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index fa2f4d1909..32f841bedf 100644
--- a/macros/latex/contrib/spbmark/spbmark.pdf
+++ b/macros/latex/contrib/spbmark/spbmark.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index f901605218..0d63b0df47 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,4 +1,4 @@
-## Babel 3.60
+## Babel 3.61
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -8,13 +8,13 @@ is a set of ini files for about 250 languages.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.60 are described in:
+Changes in version 3.61 are described in:
-https://github.com/latex3/babel/blob/master/news-guides/news/whats-new-in-babel-3.60.md
+https://latex3.github.io/babel/news/whats-new-in-babel-3.61.html
Apart from the manual, you can find information on some aspects of babel at:
-https://github.com/latex3/babel/tree/master/news-guides
+https://latex3.github.io/babel/
The best way to install and/or update it is with the help of package
managers.
@@ -46,15 +46,18 @@ respective authors.
### Summary of Latest changes
```
-3.60 2021-06-02
- * A major fix for a bug with the latest LaTeX releases: class
- options were messed up.
- * Improved justification=kashida/elongated: lists, vowelized texts.
- * Fix: Underfull \hbox with amsmath (#133).
- * Improved the ini file for Basque (captions).
+3.61 2021-06-28
+ * Improved justification=kashida/elongated: hboxes (lua).
+ * Transform danda.nobreak for several Indic scripts (lua):
+ Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam,
+ Marathi, Oriya, Tamil, Telugu.
+ * Improved \babelprovide when used to reconfigure a language.
+ * Fixes:
+ - Partial fix for #114 (bad breaks and spacing with
+ \selectlanguage).
+ - \shorthandoff*{^} caused error for \section command (#129).
```
### Previous changes
-See https://github.com/latex3/babel/blob/master/news-guides/README.md#whats-new
-
+See https://latex3.github.io/babel/
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index 257ecd3851..b6aea49d74 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -6,6 +6,7 @@
%% any individual authors listed elsewhere in this file.
%% All rights reserved.
%%
+%%
%% This file is part of the Babel system.
%% --------------------------------------
%%
@@ -20,7 +21,6 @@
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Javier Bezos.
-
%%
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2021/06/02 v3.60 The Babel package]
+\ProvidesFile{babel.dtx}[2021/06/28 v3.61 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -255,8 +255,8 @@ describes the code, and usually it can be ignored.
latest changes?] Changes and new features with relation to version 3.8
are highlighted with \New{X.XX}\hspace{-.5em}, and there are some notes
for the latest versions in
-\href{https://github.com/latex3/babel/tree/master/news-guides}{the
-\babel{} repository}. The most recent features can be still unstable.
+\href{https://latex3.github.io/babel/}{the
+\babel{} site}. The most recent features can be still unstable.
\item[\sffamily\color{messages}Can I help?] Sure! If you are interested
in the \TeX{} multilingual support, please join the
@@ -650,9 +650,8 @@ In e-Plain and pdf-Plain, load languages styles with |\input| and then use
\begin{warning}
Not all languages provide a |sty| file and some of them are not
compatible with those formats. Please, refer to
- \href{https://github.com/latex3/babel/blob/%
- master/news-guides/guides/using-babel-with-plain.md}{Using babel with
- Plain} for further details.
+ \href{https://latex3.github.io/babel/guides/using-babel-with-plain.html}%
+ {Using babel with Plain} for further details.
\end{warning}
\subsection{Basic language selectors}
@@ -711,7 +710,8 @@ the surrounding language is still in force), and (3) it works even if
the language has not been set as package option (but in such a case it
only sets the hyphenation patterns and a warning is shown). With the
|bidi| option, it also enters in horizontal mode (this is not done
-always for backwards compatibility).
+always for backwards compatibility), and since it is meant for phrases
+only the text direction (and not the paragraph one) is set.
\New{3.44} As already said, captions and dates are not switched.
However, with the optional argument you can switch them, too. So, you
@@ -2586,8 +2586,9 @@ Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
script. It sets the linebreaking and justification method, which can be
based on the the \textsc{arabic tatweel} character or in the
‘justification alternatives’ OpenType table (\texttt{jalt}). For an
-explanation see the \href{https://github.com/latex3/babel/blob/master/%
-news-guides/news/whats-new-in-babel-3.59.md}{\babel\ site}.
+explanation see the
+\href{https://latex3.github.io/babel/news/whats-new-in-babel-3.59.html}%
+ {\babel\ site}.
\Describe{linebreaking=}{}
\New{3.59} Just a synonymous for \texttt{justification}.
@@ -3087,8 +3088,7 @@ Spanish}{hyphen.repeat}{Explicit hyphens behave like
a non-syllabic preposition or conjunction into a non-breaking space.}
\trans{Greek}{diaeresis.hyphen}{Removes the diaeresis above iota and
-upsilon if hyphenated just before. It works with the
-three variants.}
+upsilon if hyphenated just before. It works with the three variants.}
\trans{Hindi, Sanskrit}{transliteration.hk}{The Harvard-Kyoto system to
romanize Devanagari.}
@@ -3101,6 +3101,10 @@ four characters: \textit{!?:;}\,.}
\textit{ssz}, \textit{tty} and \textit{zzs} as \textit{cs-cs},
\textit{dz-dz}, etc.}
+\trans{Indic scripts}{danda.nobreak}{Prevents a line break before a
+danda or double danda if there is a space. For Assamese, Bengali,
+Gujarati, Hindi, Kannada, Malayalam, Marathi, Oriya, Tamil, Telugu.}
+
\trans{Arabic, Persian}{kashida.plain}{Experimental. A very simple and
basic transform for ‘plain’ Arabic fonts, which attempts to distribute
the tatwil as evenly as possible (starting at the end of the line). See
@@ -3140,9 +3144,10 @@ This feature is activated with the first |\babelposthyphenation| or
|\babelprehyphenation|.
See the
-\href{https://github.com/latex3/babel/blob/master/news-guides/guides/non-standard-hyphenation-with-luatex.md}{\babel\
-site} for a more detailed description and some examples. It also
-describes a few additional replacement types (|string|, |penalty|).
+\href{https://latex3.github.io/babel/guides/%
+ non-standard-hyphenation-with-luatex.html}{\babel\ site} for a more
+detailed description and some examples. It also describes a few
+additional replacement types (|string|, |penalty|).
Although the main purpose of this command is non-standard hyphenation,
it may actually be used for other transformations (after hyphenation is
@@ -4226,7 +4231,7 @@ but if you want to do it, here are a few guidelines.
The following page provides a starting point for \texttt{ldf} files:
\texttt{http://www.texnia.com/incubator.html}. See also
-\texttt{https://github.com/latex3/babel/blob/master/news-guides/guides/list-of-locale-templates.md}.
+\texttt{https://latex3.github.io/babel/guides/list-of-locale-templates.html}.
If you need further assistance and technical advice in the
development of language styles, I am willing to help you. And of
@@ -4968,8 +4973,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.60>>
-%<<date=2021/06/02>>
+%<<version=3.61>>
+%<<date=2021/06/28>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5286,6 +5291,23 @@ help from Bernd Raichle, for which I am grateful.
\else
\expandafter\@firstofone
\fi}
+% \end{macrocode}
+%
+% The following adds some code to |\extras...| both before and after,
+% while avoiding doing it twice. It's somewhat convoluted, to deal with
+% |#|'s.
+%
+% \begin{macrocode}
+\def\bbl@extras@wrap#1#2#3{% 1:in-test, 2:before, 3:after
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname extras\languagename\endcsname}%
+ \bbl@exp{\\\in@{#1}{\the\toks@}}%
+ \ifin@\else
+ \@temptokena{#2}%
+ \edef\bbl@tempc{\the\@temptokena\the\toks@}%
+ \toks@\expandafter{\bbl@tempc#3}%
+ \expandafter\edef\csname extras\languagename\endcsname{\the\toks@}%
+ \fi}
%<</Basic macros>>
% \end{macrocode}
%
@@ -5536,7 +5558,7 @@ help from Bernd Raichle, for which I am grateful.
\ifx\@empty#2%
\edef\bbl@tempc{\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1}%
\else
- \in@{,provide,}{,#1,}%
+ \in@{,provide=}{,#1}%
\ifin@
\edef\bbl@tempc{%
\ifx\bbl@tempc\@empty\else\bbl@tempc,\fi#1.\bbl@tempb#2}%
@@ -5569,7 +5591,7 @@ help from Bernd Raichle, for which I am grateful.
\DeclareOption{noconfigs}{}
\DeclareOption{showlanguages}{}
\DeclareOption{silent}{}
-\DeclareOption{mono}{}
+% \DeclareOption{mono}{}
\DeclareOption{shorthands=off}{\bbl@tempa shorthands=\bbl@tempa}
\chardef\bbl@iniflag\z@
\DeclareOption{provide=*}{\chardef\bbl@iniflag\@ne} % main -> +1
@@ -5597,6 +5619,7 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@opt@main\@nnil
\let\bbl@opt@headfoot\@nnil
\let\bbl@opt@layout\@nnil
+\let\bbl@opt@provide\@nnil
% \end{macrocode}
%
% The following tool is defined temporarily to store the values of
@@ -5639,6 +5662,16 @@ help from Bernd Raichle, for which I am grateful.
\ProcessOptions*
% \end{macrocode}
%
+% \begin{macrocode}
+\ifx\bbl@opt@provide\@nnil\else % Tests. Ignore.
+ \chardef\bbl@iniflag\@ne
+ \bbl@replace\bbl@opt@provide{;}{,}
+ \bbl@add\bbl@opt@provide{,import}
+ \show\bbl@opt@provide
+\fi
+%
+% \end{macrocode}
+%
% \subsection{Conditional loading of shorthands}
%
% If there is no |shorthands=<chars>|, the original \textsf{babel}
@@ -6798,23 +6831,6 @@ help from Bernd Raichle, for which I am grateful.
% \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
@@ -7036,7 +7052,11 @@ help from Bernd Raichle, for which I am grateful.
\ifodd\bbl@iniflag % case 1,3
\bbl@ldfinit
\let\CurrentOption\bbl@opt@main
- \bbl@exp{\\\babelprovide[import,main]{\bbl@opt@main}}
+ \ifx\bbl@opt@provide\@nnil
+ \bbl@exp{\\\babelprovide[import,main]{\bbl@opt@main}}
+ \else
+ \bbl@exp{\\\babelprovide[\bbl@opt@provide,main]{\bbl@opt@main}}%
+ \fi
\bbl@afterldf{}%
\else % case 0,2
\chardef\bbl@iniflag\z@ % Force ldf
@@ -7498,6 +7518,13 @@ help from Bernd Raichle, for which I am grateful.
% We also write a command to change the current language in the
% auxiliary files.
%
+% |\bbl@savelastskip| is used to deal with skips before the write
+% whatsit (as suggested by U Fischer). Adapted from \textsf{hyperref},
+% but it might fail, so I'll consider it a temporary hack, while I
+% study other options (the ideal, but very likely unfeasible except
+% perhaps in \luatex, is to avoid the |\write| altogether when not
+% needed).
+%
% \begin{macrocode}
\def\BabelContentsFiles{toc,lof,lot}
\def\bbl@set@language#1{% from selectlanguage, pop@
@@ -7515,9 +7542,6 @@ help from Bernd Raichle, for which I am grateful.
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
@@ -7533,16 +7557,15 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\ifx\csname date\languagename\endcsname\relax\else
\if@filesw
\ifx\babel@aux\@gobbletwo\else % Set if single in the first, redundant
- % \bbl@savelastskip
+ \bbl@savelastskip
\protected@write\@auxout{}{\string\babel@aux{\bbl@auxname}{}}%
- % \bbl@restorelastskip
+ \bbl@restorelastskip
\fi
\bbl@usehooks{write}{}%
\fi
\fi}
-% The following is used above to deal with skips before the write
-% whatsit. Adapted from hyperref, but it might fail, so for the moment
-% it's not activated. TODO.
+%
+\let\bbl@restorelastskip\relax
\def\bbl@savelastskip{%
\let\bbl@restorelastskip\relax
\ifvmode
@@ -7555,6 +7578,7 @@ help from Bernd Raichle, for which I am grateful.
\\\nobreak \vskip-\skip@ \vskip\skip@}}%
\fi
\fi}
+%
\newif\ifbbl@bcpallowed
\bbl@bcpallowedfalse
\def\select@language#1{% from set@, babel@aux
@@ -8681,13 +8705,13 @@ help from Bernd Raichle, for which I am grateful.
% The very first thing to do is saving the original catcode and the
% original definition, even if not active, which is possible
% (undefined characters require a special treatement to avoid
-% making them |\relax|).
+% making them |\relax| and preserving some degree of protection).
%
% \begin{macrocode}
\def\@initiate@active@char#1#2#3{%
\bbl@csarg\edef{oricat@#2}{\catcode`#2=\the\catcode`#2\relax}%
\ifx#1\@undefined
- \bbl@csarg\edef{oridef@#2}{\let\noexpand#1\noexpand\@undefined}%
+ \bbl@csarg\def{oridef@#2}{\def#1{\active@prefix#1\@undefined}}%
\else
\bbl@csarg\let{oridef@@#2}#1%
\bbl@csarg\edef{oridef@#2}{%
@@ -9104,8 +9128,8 @@ help from Bernd Raichle, for which I am grateful.
#1%
\bbl@activate{#2}}%
{\bbl@error
- {Cannot declare a shorthand turned off (\string#2)}
- {Sorry, but you cannot use shorthands which have been\\%
+ {I can't declare a shorthand turned off (\string#2)}
+ {Sorry, but you can't use shorthands which have been\\%
turned off in the package options}}}
% \end{macrocode}
%
@@ -9624,6 +9648,29 @@ help from Bernd Raichle, for which I am grateful.
\bbl@elt{\string.}\@m{3000}\bbl@elt{\string?}\@m{3000}%
\bbl@elt{\string!}\@m{3000}\bbl@elt{\string:}\@m{2000}%
\bbl@elt{\string;}\@m{1500}\bbl@elt{\string,}\@m{1250}}
+\def\bbl@pre@fs{%
+ \def\bbl@elt##1##2##3{\sfcode`##1=\the\sfcode`##1\relax}%
+ \edef\bbl@save@sfcodes{\bbl@fs@chars}}%
+\def\bbl@post@fs{%
+ \bbl@save@sfcodes
+ \edef\bbl@tempa{\bbl@cl{frspc}}%
+ \edef\bbl@tempa{\expandafter\@car\bbl@tempa\@nil}%
+ \if u\bbl@tempa % do nothing
+ \else\if n\bbl@tempa % non french
+ \def\bbl@elt##1##2##3{%
+ \ifnum\sfcode`##1=##2\relax
+ \babel@savevariable{\sfcode`##1}%
+ \sfcode`##1=##3\relax
+ \fi}%
+ \bbl@fs@chars
+ \else\if y\bbl@tempa % french
+ \def\bbl@elt##1##2##3{%
+ \ifnum\sfcode`##1=##3\relax
+ \babel@savevariable{\sfcode`##1}%
+ \sfcode`##1=##2\relax
+ \fi}%
+ \bbl@fs@chars
+ \fi\fi\fi}
% \end{macrocode}
%
% \end{macro}
@@ -10799,13 +10846,14 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\bbl@trace{Creating languages and reading ini files}
+\let\bbl@extend@ini\@gobble
\newcommand\babelprovide[2][]{%
\let\bbl@savelangname\languagename
\edef\bbl@savelocaleid{\the\localeid}%
% Set name and locale id
\edef\languagename{#2}%
- % \global\@namedef{bbl@lcname@#2}{#2}%
\bbl@id@assign
+ % Initialize keys
\let\bbl@KVP@captions\@nil
\let\bbl@KVP@date\@nil
\let\bbl@KVP@import\@nil
@@ -10828,27 +10876,34 @@ help from Bernd Raichle, for which I am grateful.
\let\bbl@KVP@labels\@nil
\bbl@csarg\let{KVP@labels*}\@nil
\global\let\bbl@inidata\@empty
+ \global\let\bbl@extend@ini\@gobble
+ \gdef\bbl@key@list{;}%
\bbl@forkv{#1}{% TODO - error handling
\in@{/}{##1}%
\ifin@
+ \global\let\bbl@extend@ini\bbl@extend@ini@aux
\bbl@renewinikey##1\@@{##2}%
\else
\bbl@csarg\def{KVP@##1}{##2}%
\fi}%
+ \chardef\bbl@howloaded=% 0:none; 1:ldf without ini; 2:ini
+ \bbl@ifunset{date#2}\z@{\bbl@ifunset{bbl@llevel@#2}\@ne\tw@}%
% == init ==
\ifx\bbl@screset\@undefined
\bbl@ldfinit
\fi
% ==
\let\bbl@lbkflag\relax % \@empty = do setup linebreak
- \bbl@ifunset{date#2}%
- {\let\bbl@lbkflag\@empty}% new
- {\ifx\bbl@KVP@hyphenrules\@nil\else
- \let\bbl@lbkflag\@empty
- \fi
- \ifx\bbl@KVP@import\@nil\else
+ \ifcase\bbl@howloaded
+ \let\bbl@lbkflag\@empty % new
+ \else
+ \ifx\bbl@KVP@hyphenrules\@nil\else
\let\bbl@lbkflag\@empty
- \fi}%
+ \fi
+ \ifx\bbl@KVP@import\@nil\else
+ \let\bbl@lbkflag\@empty
+ \fi
+ \fi
% == import, captions ==
\ifx\bbl@KVP@import\@nil\else
\bbl@exp{\\\bbl@ifblank{\bbl@KVP@import}}%
@@ -10870,13 +10925,19 @@ help from Bernd Raichle, for which I am grateful.
\bbl@replace\bbl@KVP@transforms{ }{,}%
\fi
% Load ini
- \bbl@ifunset{date#2}%
- {\bbl@provide@new{#2}}%
- {\bbl@ifblank{#1}%
+ \ifcase\bbl@howloaded
+ \bbl@provide@new{#2}%
+ \else
+ \bbl@ifblank{#1}%
{}% With \bbl@load@basic below
- {\bbl@provide@renew{#2}}}%
+ {\bbl@provide@renew{#2}}%
+ \fi
% Post tasks
% ----------
+ % == subsequent calls after the first provide for a locale ==
+ \ifx\bbl@inidata\@empty\else
+ \bbl@extend@ini{#2}%
+ \fi
% == ensure captions ==
\ifx\bbl@KVP@captions\@nil\else
\bbl@ifunset{bbl@extracaps@#2}%
@@ -10995,7 +11056,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@csarg\edef{intsp@#2}{\bbl@KVP@intraspace}%
\fi
\bbl@provide@intraspace
- %
+ % == Line breaking: justification ==
\ifx\bbl@KVP@justification\@nil\else
\let\bbl@KVP@linebreaking\bbl@KVP@justification
\fi
@@ -11009,7 +11070,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@xin@{/e}{/\bbl@cl{lnbrk}}%
\ifin@\else\bbl@xin@{/k}{/\bbl@cl{lnbrk}}\fi
\ifin@\bbl@arabicjust\fi
- % == Line breaking: hyphenate.other.locale/.script==
+ % == Line breaking: hyphenate.other.(locale|script) ==
\ifx\bbl@lbkflag\@empty
\bbl@ifunset{bbl@hyotl@\languagename}{}%
{\bbl@csarg\bbl@replace{hyotl@\languagename}{ }{,}%
@@ -11094,25 +11155,21 @@ help from Bernd Raichle, for which I am grateful.
% restored correctly when exiting the language, so we ignore
% this change with the \bbl@alph@saved trick.
\ifx\bbl@KVP@alph\@nil\else
- \toks@\expandafter\expandafter\expandafter{%
- \csname extras\languagename\endcsname}%
+ \bbl@extras@wrap{\\\bbl@alph@saved}%
+ {\let\bbl@alph@saved\@alph}%
+ {\let\@alph\bbl@alph@saved
+ \babel@save\@alph}%
\bbl@exp{%
- \def\<extras\languagename>{%
- \let\\\bbl@alph@saved\\\@alph
- \the\toks@
- \let\\\@alph\\\bbl@alph@saved
- \\\babel@save\\\@alph
+ \\\bbl@add\<extras\languagename>{%
\let\\\@alph\<bbl@cntr@\bbl@KVP@alph @\languagename>}}%
\fi
\ifx\bbl@KVP@Alph\@nil\else
- \toks@\expandafter\expandafter\expandafter{%
- \csname extras\languagename\endcsname}%
+ \bbl@extras@wrap{\\\bbl@Alph@saved}%
+ {\let\bbl@Alph@saved\@Alph}%
+ {\let\@Alph\bbl@Alph@saved
+ \babel@save\@Alph}%
\bbl@exp{%
- \def\<extras\languagename>{%
- \let\\\bbl@Alph@saved\\\@Alph
- \the\toks@
- \let\\\@Alph\\\bbl@Alph@saved
- \\\babel@save\\\@Alph
+ \\\bbl@add\<extras\languagename>{%
\let\\\@Alph\<bbl@cntr@\bbl@KVP@Alph @\languagename>}}%
\fi
% == require.babel in ini ==
@@ -11126,8 +11183,17 @@ help from Bernd Raichle, for which I am grateful.
\bbl@input@texini{\bbl@cs{rqtex@\languagename}}%
\catcode`\@=\atcatcode
\let\atcatcode\relax
+ \global\bbl@csarg\let{rqtex@\languagename}\relax
\fi}%
\fi
+ % == frenchspacing ==
+ \ifcase\bbl@howloaded\in@true\else\in@false\fi
+ \ifin@\else\bbl@xin@{typography/frenchspacing}{\bbl@key@list}\fi
+ \ifin@
+ \bbl@extras@wrap{\\\bbl@pre@fs}%
+ {\bbl@pre@fs}%
+ {\bbl@post@fs}%
+ \fi
% == Release saved transforms ==
\bbl@release@transforms\relax % \relax closes the last item.
% == main ==
@@ -11137,7 +11203,9 @@ help from Bernd Raichle, for which I am grateful.
\fi}
% \end{macrocode}
%
-% Depending on whether or not the language exists, we define two macros.
+% Depending on whether or not the language exists (based on
+% |\date<language>|), we define two macros. Remember
+% |\bbl@startcommands| opens a group.
%
% \begin{macrocode}
\def\bbl@provide@new#1{%
@@ -11176,37 +11244,11 @@ help from Bernd Raichle, for which I am grateful.
\gdef\<#1hyphenmins>{%
{\bbl@ifunset{bbl@lfthm@#1}{2}{\bbl@cs{lfthm@#1}}}%
{\bbl@ifunset{bbl@rgthm@#1}{3}{\bbl@cs{rgthm@#1}}}}}%
- % == hyphenrules ==
+ % == hyphenrules (also in renew) ==
\bbl@provide@hyphens{#1}%
- % == frenchspacing == (only if new)
- \bbl@ifunset{bbl@frspc@#1}{}%
- {\edef\bbl@tempa{\bbl@cl{frspc}}%
- \edef\bbl@tempa{\expandafter\@car\bbl@tempa\@nil}%
- \if u\bbl@tempa % do nothing
- \else\if n\bbl@tempa % non french
- \expandafter\bbl@add\csname extras#1\endcsname{%
- \let\bbl@elt\bbl@fs@elt@i
- \bbl@fs@chars}%
- \else\if y\bbl@tempa % french
- \expandafter\bbl@add\csname extras#1\endcsname{%
- \let\bbl@elt\bbl@fs@elt@ii
- \bbl@fs@chars}%
- \fi\fi\fi}%
- %
\ifx\bbl@KVP@main\@nil\else
\expandafter\main@language\expandafter{#1}%
\fi}
-% A couple of macros used above, to avoid hashes #######...
-\def\bbl@fs@elt@i#1#2#3{%
- \ifnum\sfcode`#1=#2\relax
- \babel@savevariable{\sfcode`#1}%
- \sfcode`#1=#3\relax
- \fi}%
-\def\bbl@fs@elt@ii#1#2#3{%
- \ifnum\sfcode`#1=#3\relax
- \babel@savevariable{\sfcode`#1}%
- \sfcode`#1=#2\relax
- \fi}%
%
\def\bbl@provide@renew#1{%
\ifx\bbl@KVP@captions\@nil\else
@@ -11220,7 +11262,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@savedate
\EndBabelCommands
\fi
- % == hyphenrules ==
+ % == hyphenrules (also in new) ==
\ifx\bbl@lbkflag\@empty
\bbl@provide@hyphens{#1}%
\fi}
@@ -11233,11 +11275,11 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\def\bbl@load@basic#1{%
- \bbl@ifunset{bbl@inidata@\languagename}{}%
- {\getlocaleproperty\bbl@tempa{\languagename}{identification/load.level}%
- \ifcase\bbl@tempa
- \bbl@csarg\let{lname@\languagename}\relax
- \fi}%
+ \ifcase\bbl@howloaded\or\or
+ \ifcase\csname bbl@llevel@\languagename\endcsname
+ \bbl@csarg\let{lname@\languagename}\relax
+ \fi
+ \fi
\bbl@ifunset{bbl@lname@#1}%
{\def\BabelBeforeIni##1##2{%
\begingroup
@@ -11320,16 +11362,17 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\def\bbl@iniline#1\bbl@iniline{%
\@ifnextchar[\bbl@inisect{\@ifnextchar;\bbl@iniskip\bbl@inistore}#1\@@}% ]
-\def\bbl@inisect[#1]#2\@@{\def\bbl@section{#1}}%
+\def\bbl@inisect[#1]#2\@@{\def\bbl@section{#1}}
\def\bbl@iniskip#1\@@{}% if starts with ;
\def\bbl@inistore#1=#2\@@{% full (default)
\bbl@trim@def\bbl@tempa{#1}%
\bbl@trim\toks@{#2}%
- \bbl@ifunset{bbl@KVP@\bbl@section/\bbl@tempa}%
- {\bbl@exp{%
+ \bbl@xin@{;\bbl@section/\bbl@tempa;}{\bbl@key@list}%
+ \ifin@\else
+ \bbl@exp{%
\\\g@addto@macro\\\bbl@inidata{%
- \\\bbl@elt{\bbl@section}{\bbl@tempa}{\the\toks@}}}}%
- {}}%
+ \\\bbl@elt{\bbl@section}{\bbl@tempa}{\the\toks@}}}%
+ \fi}
\def\bbl@inistore@min#1=#2\@@{% minimal (maybe set in \bbl@read@ini)
\bbl@trim@def\bbl@tempa{#1}%
\bbl@trim\toks@{#2}%
@@ -11337,7 +11380,7 @@ help from Bernd Raichle, for which I am grateful.
\ifin@
\bbl@exp{\\\g@addto@macro\\\bbl@inidata{%
\\\bbl@elt{identification}{\bbl@tempa}{\the\toks@}}}%
- \fi}%
+ \fi}
% \end{macrocode}
%
% Now, the ‘main loop’, which \textbf{**must be executed inside a
@@ -11355,6 +11398,7 @@ help from Bernd Raichle, for which I am grateful.
\csname newread\endcsname\bbl@readstream
\fi
\def\bbl@read@ini#1#2{%
+ \global\let\bbl@extend@ini\@gobble
\openin\bbl@readstream=babel-#1.ini
\ifeof\bbl@readstream
\bbl@error
@@ -11363,7 +11407,7 @@ help from Bernd Raichle, for which I am grateful.
is not complete.}%
{Fix the name or reinstall babel.}%
\else
- % Store ini data in \bbl@inidata
+ % == Store ini data in \bbl@inidata ==
\catcode`\[=12 \catcode`\]=12 \catcode`\==12 \catcode`\&=12
\catcode`\;=12 \catcode`\|=12 \catcode`\%=14 \catcode`\-=12
\bbl@info{Importing
@@ -11386,28 +11430,62 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\bbl@iniline\bbl@line\bbl@iniline
\fi
\repeat
- % Process stored data
+ % == Process stored data ==
\bbl@csarg\xdef{lini@\languagename}{#1}%
- \let\bbl@savestrings\@empty
- \let\bbl@savetoday\@empty
- \let\bbl@savedate\@empty
- \def\bbl@elt##1##2##3{%
- \def\bbl@section{##1}%
- \in@{=date.}{=##1}% Find a better place
- \ifin@
- \bbl@ini@calendar{##1}%
- \fi
- \global\bbl@csarg\let{bbl@KVP@##1/##2}\relax
- \bbl@ifunset{bbl@inikv@##1}{}%
- {\csname bbl@inikv@##1\endcsname{##2}{##3}}}%
- \bbl@inidata
- % 'Export' data
+ \bbl@read@ini@aux
+ % == 'Export' data ==
\bbl@ini@exports{#2}%
\global\bbl@csarg\let{inidata@\languagename}\bbl@inidata
\global\let\bbl@inidata\@empty
\bbl@exp{\\\bbl@add@list\\\bbl@ini@loaded{\languagename}}%
\bbl@toglobal\bbl@ini@loaded
\fi}
+\def\bbl@read@ini@aux{%
+ \let\bbl@savestrings\@empty
+ \let\bbl@savetoday\@empty
+ \let\bbl@savedate\@empty
+ \def\bbl@elt##1##2##3{%
+ \def\bbl@section{##1}%
+ \in@{=date.}{=##1}% Find a better place
+ \ifin@
+ \bbl@ini@calendar{##1}%
+ \fi
+ \bbl@ifunset{bbl@inikv@##1}{}%
+ {\csname bbl@inikv@##1\endcsname{##2}{##3}}}%
+ \bbl@inidata}
+% \end{macrocode}
+%
+% A variant to be used when the ini file has been already loaded,
+% because it's not the first |\babelprovide| for this language.
+%
+% \begin{macrocode}
+\def\bbl@extend@ini@aux#1{%
+ \bbl@startcommands*{#1}{captions}%
+ % Activate captions/... and modify exports
+ \bbl@csarg\def{inikv@captions.licr}##1##2{%
+ \setlocalecaption{#1}{##1}{##2}}%
+ \def\bbl@inikv@captions##1##2{%
+ \bbl@ini@captions@aux{##1}{##2}}%
+ \def\bbl@stringdef##1##2{\gdef##1{##2}}%
+ \def\bbl@exportkey##1##2##3{%
+ \bbl@ifunset{bbl@@kv@##2}{}%
+ {\expandafter\ifx\csname bbl@@kv@##2\endcsname\@empty\else
+ \bbl@exp{\global\let\<bbl@##1@\languagename>\<bbl@@kv@##2>}%
+ \fi}}%
+ % As with \bbl@read@ini, but with some changes
+ \bbl@read@ini@aux
+ \bbl@ini@exports\tw@
+ % Update inidata@lang by pretending the ini is read.
+ \def\bbl@elt##1##2##3{%
+ \def\bbl@section{##1}%
+ \bbl@iniline##2=##3\bbl@iniline}%
+ \csname bbl@inidata@#1\endcsname
+ \global\bbl@csarg\let{inidata@#1}\bbl@inidata
+ \StartBabelCommands*{#1}{date}% And from the import stuff
+ \def\bbl@stringdef##1##2{\gdef##1{##2}}%
+ \bbl@savetoday
+ \bbl@savedate
+ \bbl@endcommands}
% \end{macrocode}
%
% A somewhat hackish tool to handle calendar sections. To be improved.
@@ -11447,7 +11525,7 @@ help from Bernd Raichle, for which I am grateful.
\edef\bbl@tempb{\zap@space #2 \@empty}% key
\bbl@trim\toks@{#3}% value
\bbl@exp{%
- \global\let\<bbl@KVP@\bbl@tempa/\bbl@tempb>\\\@empty % just a flag
+ \edef\\\bbl@key@list{\bbl@key@list \bbl@tempa/\bbl@tempb;}%
\\\g@addto@macro\\\bbl@inidata{%
\\\bbl@elt{\bbl@tempa}{\bbl@tempb}{\the\toks@}}}}%
% \end{macrocode}
@@ -11492,6 +11570,7 @@ help from Bernd Raichle, for which I am grateful.
\or
\bbl@iniwarning{.xelatex}%
\fi%
+ \bbl@exportkey{llevel}{identification.load.level}{}%
\bbl@exportkey{elname}{identification.name.english}{}%
\bbl@exp{\\\bbl@exportkey{lname}{identification.name.opentype}%
{\csname bbl@elname@\languagename\endcsname}}%
@@ -11517,9 +11596,9 @@ help from Bernd Raichle, for which I am grateful.
\bbl@exportkey{hyotl}{typography.hyphenate.other.locale}{}%
\bbl@exportkey{hyots}{typography.hyphenate.other.script}{}%
\bbl@exportkey{intsp}{typography.intraspace}{}%
+ \bbl@exportkey{frspc}{typography.frenchspacing}{u}%
\bbl@exportkey{chrng}{characters.ranges}{}%
\bbl@exportkey{dgnat}{numbers.digits.native}{}%
- \bbl@exportkey{frspc}{typography.frenchspacing}{u}%
\ifnum#1=\tw@ % only (re)new
\bbl@exportkey{rqtex}{identification.require.babel}{}%
\bbl@toglobal\bbl@savetoday
@@ -11692,6 +11771,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@replace\bbl@toreplace{[}{\csname the}%
\bbl@replace\bbl@toreplace{]}{\endcsname{}}%
\toks@\expandafter{\bbl@toreplace}%
+ % TODO. Execute only once:
\bbl@exp{%
\\\bbl@add\<extras\languagename>{%
\\\babel@save\<labelenum\romannumeral\bbl@tempa>%
@@ -11794,9 +11874,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@trim@def\bbl@toreplace{#5}%
\bbl@TG@@date
\bbl@ifunset{bbl@date@\languagename @}%
- {\global\bbl@csarg\let{date@\languagename @}\bbl@toreplace
- % TODO. Move to a better place.
- \bbl@exp{%
+ {\bbl@exp{% TODO. Move to a better place.
\gdef\<\languagename date>{\\\protect\<\languagename date >}%
\gdef\<\languagename date >####1####2####3{%
\\\bbl@usedategrouptrue
@@ -11804,9 +11882,10 @@ help from Bernd Raichle, for which I am grateful.
\\\localedate{####1}{####2}{####3}}}%
\\\bbl@add\\\bbl@savetoday{%
\\\SetString\\\today{%
- \<\languagename date>%
+ \<\languagename date>%
{\\\the\year}{\\\the\month}{\\\the\day}}}}}%
- {}%
+ {}%
+ \global\bbl@csarg\let{date@\languagename @}\bbl@toreplace
\ifx\bbl@tempb\@empty\else
\global\bbl@csarg\let{date@\languagename @\bbl@tempb}\bbl@toreplace
\fi}%
@@ -13024,6 +13103,7 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@
\fi
\bbl@exp{%
+ % TODO. Execute only once (but redundant):
\\\bbl@add\<extras\languagename>{%
\XeTeXlinebreaklocale "\bbl@cl{tbcp}"%
\<bbl@xeisp@\languagename>%
@@ -13783,8 +13863,8 @@ help from Bernd Raichle, for which I am grateful.
Babel.arabic.elong_map[\the\localeid] = {}
luatexbase.add_to_callback('post_linebreak_filter',
Babel.arabic.justify, 'Babel.arabic.justify')
-% luatexbase.add_to_callback('hpack_filter',
-% Babel.arabic.justify_hbox, 'Babel.arabic.justify_hbox')
+ luatexbase.add_to_callback('hpack_filter',
+ Babel.arabic.justify_hbox, 'Babel.arabic.justify_hbox')
}}%
% Save both node lists to make replacement. TODO. Save also widths to
% make computations
@@ -13862,8 +13942,14 @@ function Babel.arabic.justify(head)
end
function Babel.arabic.justify_hbox(head, gc, size, pack)
+ local has_inf = false
if Babel.arabic.justify_enabled and pack == 'exactly' then
- Babel.arabic.justify_hlist(head, nil, gc, size, pack)
+ for n in node.traverse_id(12, head) do
+ if n.stretch_order > 0 then has_inf = true end
+ end
+ if not has_inf then
+ Babel.arabic.justify_hlist(head, nil, gc, size, pack)
+ end
end
return head
end
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index 448f711c9e..feea6e0da7 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{2021/06/02}
+\def\filedate{2021/06/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 a184df48a2..8e3aefc944 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 601f524b83..7500615da1 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}[2021/06/02 v3.60]
+\ProvidesFile{bbcompat.dtx}[2021/06/28 v3.61]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/macros/latex/required/latexbug/changes.txt b/macros/latex/required/latexbug/changes.txt
index b587a8ef68..0d3a018f4a 100644
--- a/macros/latex/required/latexbug/changes.txt
+++ b/macros/latex/required/latexbug/changes.txt
@@ -1,3 +1,8 @@
+2021-06-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * latexbug.dtx:
+ added a lot of new files as supported ...
+
2021-03-05 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
* latexbug.dtx
diff --git a/macros/latex/required/latexbug/latexbug.dtx b/macros/latex/required/latexbug/latexbug.dtx
index 34bef5c6db..2053930a10 100644
--- a/macros/latex/required/latexbug/latexbug.dtx
+++ b/macros/latex/required/latexbug/latexbug.dtx
@@ -231,7 +231,7 @@
% \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{latexbug}[2021/03/05 v1.0j Bug-classification]
+\ProvidesPackage{latexbug}[2021/06/28 v1.0k Bug-classification]
% \end{macrocode}
%
% \begin{macro}{\latexbug@empty}
@@ -306,6 +306,8 @@ applemac.def = us ,
article.cls = us ,
article.sty = us ,
ascii.def = us ,
+atbegshi-ltx.sty = us ,
+atveryend-ltx.sty = us ,
bezier.sty = us ,
bk10.clo = us ,
bk11.clo = us ,
@@ -322,6 +324,7 @@ cp852.def = us ,
cp858.def = us ,
cp865.def = us ,
decmulti.def = us ,
+doc-v3beta.sty = us ,
doc.sty = us ,
docstrip.tex = us ,
exscale.sty = us ,
@@ -344,7 +347,6 @@ inputenc.sty = us ,
lablst.tex = us ,
latex.ltx = us ,
latex209.def = us ,
-latexbug.tex = us ,
latexrelease.sty = us ,
latexsym.sty = us ,
latin1.def = us ,
@@ -361,6 +363,8 @@ letter.cls = us ,
letter.sty = us ,
lppl.tex = us ,
ltluatex.lua = us ,
+ltluatex.lua = us ,
+ltluatex.tex = us ,
ltluatex.tex = us ,
ltnews.cls = us ,
ltxcheck.tex = us ,
@@ -417,6 +421,8 @@ slides.def = us ,
slides.sty = us ,
small2e.tex = us ,
source2e.tex = us ,
+source2edoc.cls = us ,
+structuredlog.sty = us ,
syntonly.sty = us ,
t1cmdh.fd = us ,
t1cmfib.fd = us ,
@@ -435,6 +441,7 @@ t2benc.dfu = us ,
t2cenc.dfu = us ,
testpage.tex = us ,
texsys.cfg = us ,
+textcomp-2018-08-11.sty = us ,
textcomp.sty = us ,
tracefnt.sty = us ,
ts1cmr.fd = us ,
@@ -443,18 +450,26 @@ ts1cmtt.fd = us ,
ts1cmvtt.fd = us ,
ts1enc.def = us ,
ts1enc.dfu = us ,
+tuenc.def = us ,
+tulmdh.fd = us ,
+tulmr.fd = us ,
+tulmss.fd = us ,
+tulmssq.fd = us ,
+tulmtt.fd = us ,
+tulmvtt.fd = us ,
ucmr.fd = us ,
ucmss.fd = us ,
ucmtt.fd = us ,
ulasy.fd = us ,
ullasy.fd = us ,
-utf8-test.tex = us ,
+utf8-2018.def = us ,
utf8.def = us ,
utf8enc.dfu = us ,
-utf8test.tex = us ,
x2enc.dfu = us ,
%--------------------------------- tools
afterpage.sty = us ,
+array-2016-10-06.sty = us ,
+array-2020-02-10.sty = us ,
array.sty = us ,
bm.sty = us ,
calc.sty = us ,
@@ -469,12 +484,15 @@ h.tex = us ,
hhline.sty = us ,
indentfirst.sty = us ,
layout.sty = us ,
+longtable-2020-01-07.sty = us ,
longtable.sty = us ,
+multicol-2017-04-11.sty = us ,
multicol.sty = us ,
q.tex = us ,
r.tex = us ,
rawfonts.sty = us ,
s.tex = us ,
+shellesc.sty = us ,
showkeys.sty = us ,
somedefs.sty = us ,
tabularx.sty = us ,
@@ -486,6 +504,7 @@ thm.sty = us ,
thmb.sty = us ,
thp.sty = us ,
trace.sty = us ,
+varioref-2016-02-16.sty = us ,
varioref.sty = us ,
verbatim.sty = us ,
verbtest.tex = us ,
@@ -554,7 +573,7 @@ ukraineb.sty = us ,
usorbian.sty = us ,
welsh.sty = us ,
xebabel.def = us ,
-%--------------------------------- graphics
+%--------------------------------- graphics + graphics-def
color.cfg = us ,
color.sty = us ,
dvipdf.def = us ,
@@ -562,9 +581,11 @@ dvipdfmx.def = us ,
dvips.def = us ,
dvipsnam.def = us ,
dvipsone.def = us ,
+dvisvgm.def = us ,
dviwin.def = us ,
emtex.def = us ,
epsfig.sty = us ,
+graphics-2017-06-25.sty = us ,
graphics.cfg = us ,
graphics.sty = us ,
graphicx.sty = us ,
@@ -576,7 +597,7 @@ pctexhp.def = us ,
pctexps.def = us ,
pctexwin.def = us ,
pdftex.def = us ,
-pdftex.def = us ,
+rotating.sty = us ,
rotating.sty = us ,
tcidvi.def = us ,
trig.sty = us ,
@@ -591,10 +612,14 @@ uyfrak.fd = us ,
uygoth.fd = us ,
uyinit.fd = us ,
uyswab.fd = us ,
+%--------------------------------- firstaid
+everysel-ltx.sty = us ,
+filehook-ltx.sty = us ,
%--------------------------------- amsmath
amsbsy.sty = us ,
amscd.sty = us ,
amsgen.sty = us ,
+amsmath-2018-12-01.sty = us ,
amsmath.sty = us ,
amsopn.sty = us ,
amstex.sty = us ,
@@ -725,26 +750,54 @@ ufplmbb.fd = us ,
upsy.fd = us ,
upzd.fd = us ,
utopia.sty = us ,
-%--------------------------------- expl3
+%--------------------------------- l3experimental
+l3benchmark.sty = us* ,
+l3bitset.sty = us* ,
+l3draw.sty = us* ,
+l3graphics.sty = us* ,
+l3sys-shell.sty = us* ,
+%--------------------------------- l3packages
+xparse-2018-04-12.sty = us* ,
+xparse-2020-10-01.sty = us* ,
+xparse-generic.tex = us* ,
+xparse.ltx = us* ,
+xfp.sty = us* ,
+%--------------------------------- l3kernel / expl3
expl3-code.tex = ignore ,
+expl3.ltx = us* ,
+expl3.ltx = us* ,
+expl3.lua = us* ,
expl3.sty = us* ,
l3backend-dvipdfmx.def = ignore ,
l3backend-dvips.def = ignore ,
l3backend-dvisvgm.def = ignore ,
l3backend-luatex.def = ignore ,
-l3backend-pdfmode.def = ignore ,
+l3backend-pdfmode.def = ignore , % -- old
l3backend-pdftex.def = ignore ,
-l3backend-xdvipdfmx.def = ignore ,
+l3backend-xdvipdfmx.def = ignore , % -- old
l3backend-xetex.def = ignore ,
l3debug.def = us* ,
l3deprecation.def = ignore ,
+l3doc.cls = us* ,
+l3docstrip.tex = us ,
l3keys2e.sty = us* ,
-l3regex.sty = us* ,
-l3sort.sty = us* ,
-l3tl-analysis.sty = us* ,
+l3str-enc-iso88591.def = us* ,
+l3str-enc-iso885910.def = us* ,
+l3str-enc-iso885911.def = us* ,
+l3str-enc-iso885913.def = us* ,
+l3str-enc-iso885914.def = us* ,
+l3str-enc-iso885915.def = us* ,
+l3str-enc-iso885916.def = us* ,
+l3str-enc-iso88592.def = us* ,
+l3str-enc-iso88593.def = us* ,
+l3str-enc-iso88594.def = us* ,
+l3str-enc-iso88595.def = us* ,
+l3str-enc-iso88596.def = us* ,
+l3str-enc-iso88597.def = us* ,
+l3str-enc-iso88598.def = us* ,
+l3str-enc-iso88599.def = us* ,
xcoffins.sty = us* ,
xfrac.sty = us* ,
-xfrac.sty = us* ,
xgalley.sty = us* ,
xparse.sty = us* ,
xtemplate.sty = us* ,
@@ -832,17 +885,17 @@ pinyin.ldf = Werner Lemberg
romansh.ldf = Claudio Beccari
\Contact <claudio [dot] beccari [at] gmail [dot] com> ,
russain.ldf = Igor A [dot] Kotelnikov
- \Contact <kia999 [at] mail [dot] ru> ,
+ \Contact <kia999 [at] mail [dot] ru> , % -- old?
serbianc.ldf = Filip Brcic
\Contact <brcha [at] users [dot] sourceforge [dot] net> ,
spanglish.ldf = J [dot] Luis Rivera
- \Contact <jlrn77 [at] gmail [dot] com> ,
+ \Contact <jlrn77 [at] gmail [dot] com> , % -- old?
spanish.ldf = Javier Bezos
\Contact <http://www.texnia.com/contact.html> ,
thaicjk.ldf = Werner Lemberg
\Contact <wl [at] gnu [dot] org> ,
ukraineb.ldf = Sergiy Ponomarenko
- \Contact <sergiy [dot] pono­marenko [at] gmail [dot] com> ,
+ \Contact <sergiy [dot] ponomarenko [at] gmail [dot] com> ,
vietnamese.ldf = Werner Lemberg
\Contact <wl [at] gnu [dot] org> ,
%--------------------------------- LAST LINE
diff --git a/macros/latex/required/latexbug/latexbug.pdf b/macros/latex/required/latexbug/latexbug.pdf
index c00d00916a..84009fde49 100644
--- a/macros/latex/required/latexbug/latexbug.pdf
+++ b/macros/latex/required/latexbug/latexbug.pdf
Binary files differ