summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-11 03:01:10 +0000
committerNorbert Preining <norbert@preining.info>2022-01-11 03:01:10 +0000
commit39394e7cba63ab69525546760c8e542bb98f48e0 (patch)
tree9a63254086c5722f6670adad372c9c68efcb4948 /macros/latex/contrib
parentd50bfeb7feb32d585a89393c364ef5f9e1b915d0 (diff)
CTAN sync 202201110301
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/bibarts/README.txt30
-rw-r--r--macros/latex/contrib/bibarts/ba-short.pdfbin332637 -> 332462 bytes
-rw-r--r--macros/latex/contrib/bibarts/ba-short.tex44
-rw-r--r--macros/latex/contrib/bibarts/bibarts.pdfbin1044317 -> 1044258 bytes
-rw-r--r--macros/latex/contrib/bibarts/bibarts.sty14
-rw-r--r--macros/latex/contrib/bibarts/bibarts.tex98
-rw-r--r--macros/latex/contrib/bibarts/bibsort.c120
-rw-r--r--macros/latex/contrib/dbshow/dbshow-doc.pdfbin388176 -> 373472 bytes
-rw-r--r--macros/latex/contrib/dbshow/dbshow-doc.tex1135
-rw-r--r--macros/latex/contrib/dbshow/dbshow.sty421
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx41
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin590081 -> 593760 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex96
-rw-r--r--macros/latex/contrib/keyfloat/README.txt4
-rw-r--r--macros/latex/contrib/keyfloat/keyfloat.dtx294
-rw-r--r--macros/latex/contrib/keyfloat/keyfloat.pdfbin1025675 -> 1038224 bytes
-rw-r--r--macros/latex/contrib/sillypage/README.md54
-rw-r--r--macros/latex/contrib/sillypage/sillypage-example.pdfbin0 -> 94027 bytes
-rw-r--r--macros/latex/contrib/sillypage/sillypage-example.tex9
-rw-r--r--macros/latex/contrib/sillypage/sillypage.dtx178
-rw-r--r--macros/latex/contrib/sillypage/sillypage.ins94
-rw-r--r--macros/latex/contrib/sillypage/sillypage.pdfbin0 -> 359170 bytes
-rw-r--r--macros/latex/contrib/sillypage/sillywalk-map.pngbin0 -> 6039 bytes
-rw-r--r--macros/latex/contrib/zref-clever/CHANGELOG.md28
-rw-r--r--macros/latex/contrib/zref-clever/MANIFEST.md38
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever-code.pdfbin1040673 -> 1069860 bytes
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever-code.tex2
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever.dtx1469
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever.ins15
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever.pdfbin305580 -> 306402 bytes
-rw-r--r--macros/latex/contrib/zref-clever/zref-clever.tex310
31 files changed, 3167 insertions, 1327 deletions
diff --git a/macros/latex/contrib/bibarts/README.txt b/macros/latex/contrib/bibarts/README.txt
index 2e068aa017..8fbb2c100f 100644
--- a/macros/latex/contrib/bibarts/README.txt
+++ b/macros/latex/contrib/bibarts/README.txt
@@ -7,7 +7,7 @@ it requires a program, for which source and Windows executable are provided.
===
-BibArts 2.3 is a LaTeX package to assist in making bibliographical features
+BibArts 2.4 is a LaTeX package to assist in making bibliographical features
common in the arts and humanities (history, political science, etc.).
bibarts.sty provides commands for quotation, register keywords,
abbreviations, and especially for a formatted citation of literature,
@@ -22,11 +22,11 @@ with BibTeX, and it does not use any data bank except your own LaTeX text.
The lists are created by bibsort. A file bibsort.exe is part of the package
( CTAN mirrors > BibArts > bibarts.zip ) and runs on newer Windows systems.
Other users first have to create a binary file from bibsort.c (ANSI-C) with
-their own C-compiler. BibArts 2.3 is developed and tested on Windows 10
+their own C-compiler. BibArts 2.4 is developed and tested on Windows 10
with the 2021-11-22 LaTeX 2e distribution, but it should be able to work
even with LaTeX 2.09.
- BibArts 2.3 (9 files, 8 dated 2021-12-06):
+ BibArts 2.4 (9 files, 8 dated 2022-01-10):
README.txt This file here
bibarts.sty The LaTeX style file
ba-short.pdf Short introduction (English)
@@ -64,7 +64,7 @@ see examples for the new commands \frompagesep and \ntsep in bibarts.pdf.
Changes from BibArts version 2.0 (2015) to version 2.1 (2016):
-BibArts 2.0 set \footnotesep to 2ex, whereas 2.1 to 2.3 do *not* change the
+BibArts 2.0 set \footnotesep to 2ex, whereas 2.1 to 2.4 do *not* change the
pre-set value. If you want to continue with the 2.0-distance between two
footnotes, you will have to type \setlength{\footnotesep}{2ex} in your text.
@@ -160,14 +160,14 @@ in the keyword. The active " and \= \. \b \d are not represented any more.
===
-Changes from BibArts version 2.2 (2019) to version 2.3 (now, 2021):
+Changes from BibArts version 2.2 (2019) to version 2.3 (2021):
-bibsort 2.3, the sorting program of the package, has two new options:
+There have been two new options for bibsort:
-utf8 sorts UTF8 characters as definded in utf8enc.dfu 2021/01/27 v1.2l,
except \cyr...- and \CYR...-commands, which bibsort still ignores.
- bibsort 2.3 is able to sort the accent \textcommabelow (parallel to
+ bibsort is able to sort the accent \textcommabelow (parallel to
U+0218 to U+021B). The internal representation of accents did
change (two instead of one ASCII 1 to 31). For numerous smaller
changes see /* 2.3 comments */ in bibsort.c.
@@ -191,6 +191,20 @@ bibsort 2.3, the sorting program of the package, has two new options:
===
+Changes from BibArts version 2.3 (2021) to version 2.4 (now, 2022):
+
+An error was fixed concerning "inner v-commands" on the List of Literature,
+and the List of Published Documents: In shortened "inner" references,
+BibArts 2.3 -- together with bibsort -e ... -- printed the first names of
+co-authors. Now, such shortened references only print the family names.
+
+bibsort now knows ten new utf8-characters (parallel to the changes in
+utf8enc.dfu from version 2021/01/27 v1.2l to 2021/06/21 v1.2n).
+
+
+===
+
Published under the terms of the GNU General Public License.
-BibArts 2.3 (2021) - (C) Timo Baumann, Versions 2.x (2021, 2019, 2016, 2015)
+BibArts 2.4 (2022):
+(C) Timo Baumann, Versions 2.x (2022, 2021, 2019, 2016, 2015)
diff --git a/macros/latex/contrib/bibarts/ba-short.pdf b/macros/latex/contrib/bibarts/ba-short.pdf
index 628c77026c..8ab54f3f61 100644
--- a/macros/latex/contrib/bibarts/ba-short.pdf
+++ b/macros/latex/contrib/bibarts/ba-short.pdf
Binary files differ
diff --git a/macros/latex/contrib/bibarts/ba-short.tex b/macros/latex/contrib/bibarts/ba-short.tex
index 38fe449fdc..642978d417 100644
--- a/macros/latex/contrib/bibarts/ba-short.tex
+++ b/macros/latex/contrib/bibarts/ba-short.tex
@@ -1,5 +1,5 @@
-%% BibArts 2.3 assists you to write LaTeX texts in arts and humanities.
-%% Copyright (C) 2021 Timo Baumann bibarts[at]gmx.de (2021/12/06)
+%% BibArts 2.4 assists you to write LaTeX texts in arts and humanities.
+%% Copyright (C) 2022 Timo Baumann bibarts[at]gmx.de (2022/01/10)
%%% LaTeX + "bibsort -i ba-short -m -utf8 -k -e -h" + LaTeX %%%
@@ -16,7 +16,7 @@
\title{The \LaTeX\hy Package \BibArts \\[1.25ex] {\normalsize\slshape
A package to assist in making bibliographical features \\[-1.25ex] common in the arts and humanities}}
\author{\textsc{Timo Baumann}}
- \date{\small Version 2.3 (2021). \hspace{1em}\copyright\ 2.x (2021, 2019, 2016, 2015).}
+ \date{\small Version 2.4 (2022). \hspace{1em}\copyright\ 2.x (2022, 2021, 2019, 2016, 2015).}
\setcounter{secnumdepth}{0}
%\renewcommand{\kxxemph}{\em}
@@ -60,7 +60,7 @@
\vspace{1.75ex}
\hbox{\parbox{7.7cm}{\footnotesize\noindent
-\textbf{\BibArts~2.3 (9 files, 8 dated 2021\ko/12\ko/06):} \\[.875ex]
+\textbf{\BibArts~2.4 (9 files, 8 dated 2022\ko/01\ko/10):} \\[.875ex]
\begin{tabular}{ll}%
\texttt{README.txt} & Version history since 1.3 \\[-1.75pt]
\texttt{bibarts.sty} & The \LaTeX\ style file \\[-1.75pt]
@@ -196,7 +196,7 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
\setcounter{footnote}{0}
{\footnotesize\begin{verbatim}
- <1> ...\footnote{ \vli{Niklas} {Luhmann} {\ktit{Soziale Systeme}.
+ <1> ...\footnote{ \vli{Niklas} {Luhmann} {\ktit{Soziale Systeme}.
Grundriß einer allgemeinen Theorie, Frankfurt/M. 1984}.}
<2> ...\footnote{\kli{Luhmann}{Soziale Systeme}|1|[22], and
@@ -204,7 +204,7 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
<3> ...\footnote{\kli{Luhmann}{Soziale Systeme}|1|[23]. Next sentence.}
<4> \footnote{\kli{Luhmann}{Soziale Systeme}|2|[56].}
- <5> ...\footnote{\arq{Haber to Kultusminister, 17 December 1914}
+ <5> ...\footnote{\arq{Haber to Kultusminister, 17 December 1914}
{GStAPK, HA\,1, Rep~76~Vc, Sekt~1, Tit~23,
Litt~A, Nr.\,108}|2|(223\f).}
@@ -225,20 +225,20 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
\end{verbatim}}
\noindent
- When you introduce a book,\footnote{ \vli{Niklas}{Luhmann}{\ktit{Soziale Systeme}.
+ When you introduce a book,\footnote{ \vli{Niklas} {Luhmann} {\ktit{Soziale Systeme}.
Grundriß einer allgemeinen Theorie, Frankfurt/M. 1984}.}
you are free to add a \verb+|Vol|+, or not. But if you set a \verb+|Vol|+ once,
you will have to repeat that, when you refer to the same book in the following
footnote (or say \verb|\clearbamem|).
\verb+[Pg]+ is equivalent. You may also cite one work several times in the same
- footnote.\footnote{\kli{Luhmann}{Soziale
- Systeme}|1|[22], and \kli{Luhmann}{Soziale Systeme}|1|[23].}\,%
+ footnote.\footnote{\kli{Luhmann}{Soziale Systeme}|1|[22], and
+ \kli{Luhmann}{Soziale Systeme}|1|[23].}\,%
\footnote{\kli{Luhmann}{Soziale Systeme}|1|[23]. Next sentence.}\,%
\footnote{\kli{Luhmann}{Soziale Systeme}|2|[56].}
\vspace{1ex}\noindent
- And here are examples about how to cite archive sources.\footnote{\arq{Haber to
- Kultusminister, 17 December 1914}
+ And here are examples about how to cite archive
+ sources.\footnote{\arq{Haber to Kultusminister, 17 December 1914}
{GStAPK, HA\,1, Rep~76~Vc, Sekt~1, Tit~23, Litt~A, Nr.\,108}|2|(223\f).}\,%
\footnote{\arq{Setsuro Tamaru to Clara Haber, 24 December 1914}
{GStAPK, HA\,1, Rep~76~Vc, Sekt~1, Tit~23,
@@ -273,8 +273,8 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
\\ \ \ \ \ Frankfurt/M. 1984\b{\}}[22].\}
\\[1.5ex] ... pp.\bs footnote\{ \bs notibidemize
\\ \ \ \ \%no ibidem in this footnote\%
- \\ \ \ Shortened ref.: \bs kli\{Luhmann\}
- \\ \ \ \ \ \ \ \{Soziale Systeme\}[23 \bs f].\}
+ \\ \ Shortened ref.: \bs kli\{Luhmann\}
+ \\ \ \ \ \ \ \ \{Soziale Systeme\}[23\bs f].\}
}
{\conferize ...\footnote{
Full ref.: \vli{Niklas}{Luhmann} {\ktit{Soziale Systeme}.
@@ -282,7 +282,7 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
\texttt{[u, v]} or \texttt{[w-x]} or \texttt{[y\bs f]} or
\texttt{[z\bs baplural]} are creating pp.\footnote{\notibidemize
%no ibidem in this footnote%
- Shortened ref.: \kli{Luhmann} {Soziale Systeme}[23 \f].}
+ Shortened ref.: \kli{Luhmann} {Soziale Systeme}[23\f].}
}
\noindent
@@ -298,7 +298,7 @@ In footnotes, and \texttt{minipage} footnotes, \BibArts\ is introducing
\section{The extra \texttt{*}\{\ko\textit{argument}\} of \texttt{v}- and \texttt{k}\fhy commands}
-\textit{Works by multiple authors} use \texttt{x}\fhy commands with co\hy authors in \texttt{*}\hy arguments:
+\textit{Works by multiple authors}: Use \texttt{x}\fhy commands with co\hy authors in \texttt{*}\hy arguments:
\Doppelbox
{
@@ -478,8 +478,8 @@ is not wanted, use \verb|\ntvauthor| instead of the inner \verb|\vli|:
{
\vspace{.225ex}
\bs footnote\{\bs vli\{Jost\}\{Dülffer\}
- \\[.35ex] \ \b{\{}\bs em \bs ktit\{Einleitung\}\bs em, in:
- \\[.35ex] \ \ \bs ntvauthor\{Jost\}\{Dülffer\}
+ \\[.35ex] \ \b{\{}\bs em \bs ktit\{Einleitung\}\bs em,
+ \\[.35ex] \ \ in: \bs ntvauthor\{Jost\}\{Dülffer\}
\\[.35ex] \ \ Bereit zum Krieg\b{\}}[9].\}
\\[2.25ex]
\bs footnote\{\bs kli\{Dülffer\}
@@ -488,8 +488,8 @@ is not wanted, use \verb|\ntvauthor| instead of the inner \verb|\vli|:
{
\texttt{\bs emph\{\bs ktit\{}\fabra{...}\texttt{\}\}} masks {\scriptsize cited as \fabra{...}},\vspace{-.1ex}
so use \texttt{\bs em} \abra{...}\,\texttt{\bs em} to emphasize!\footnote{\vli{Jost}{Dülffer}
- {\em \ktit{Einleitung}\em, in:
- \ntvauthor{Jost}{Dülffer} Bereit zum Krieg}[9].}
+ {\em \ktit{Einleitung}\em,
+ in: \ntvauthor{Jost}{Dülffer} Bereit zum Krieg}[9].}
\footnote{\kli{Dülffer}
{Einleitung}[9].}
}
@@ -516,12 +516,12 @@ Here, \fbox{iT} is a centrally defined inner\,k\kern -0.05em Title:
\newpage\noindent
In the case of multiple works by one author,
-you may enter \hspace{.25em} \texttt{bibsort -k }...\ \hspace{.005em} at the prompt.
+you may enter \hspace{.25em} \texttt{bibsort -k }\abra{...}\ \hspace{.005em} at the prompt.
Then, in both \texttt{v}\fhy lists, \BibArts\ inserts \hspace{.05em} $\sim$ \hspace{.005em}
instead of the repeated \textit{first name and last name}.
And \texttt{-e} prints the last names of co\hy authors first. Anyway,
-\label{appendix} \hspace{.25em}\verb|\printbibtitle| \verb|\printvli| \verb|\printvqu|
-\hspace{.3em}insert your bibliography:
+\label{appendix} \hspace{-.05em}\verb|\printbibtitle|\hspace{.05em}\verb|\printvli|\hspace{.05em}\verb|\printvqu|
+will print your bibliography:
\printbibtitle \printvli \printvqu
diff --git a/macros/latex/contrib/bibarts/bibarts.pdf b/macros/latex/contrib/bibarts/bibarts.pdf
index 92a21033af..a8d267ff8f 100644
--- a/macros/latex/contrib/bibarts/bibarts.pdf
+++ b/macros/latex/contrib/bibarts/bibarts.pdf
Binary files differ
diff --git a/macros/latex/contrib/bibarts/bibarts.sty b/macros/latex/contrib/bibarts/bibarts.sty
index c3c449f5e6..ccd48ba312 100644
--- a/macros/latex/contrib/bibarts/bibarts.sty
+++ b/macros/latex/contrib/bibarts/bibarts.sty
@@ -1,5 +1,5 @@
-%% BibArts 2.3 assists you to write LaTeX texts in arts and humanities.
-%% Copyright (C) 2021 Timo Baumann bibarts[at]gmx.de (2021/12/06)
+%% BibArts 2.4 assists you to write LaTeX texts in arts and humanities.
+%% Copyright (C) 2022 Timo Baumann bibarts[at]gmx.de (2022/01/10)
%%
%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
%% COMPATIBILITY
%% Change \DeclareRobustCommand into \def before using LaTeX 2.09.
%% Then, you still NOT have to \protect BibArts-cmds in args of v-cmds.
-%% BibArts 2.3 ONLY has an EMULATION for 1.3 texts: Keep copies of 1.x?
+%% BibArts 2.4 ONLY has an EMULATION for 1.3 texts: Keep copies of 1.x?
@@ -72,7 +72,7 @@
\def\errmessage@ba#1{{\protectchars@active\errmessage{#1.^^J \space. . . . . . . . . . . }}}
-\typeout@ba{Style Option BibArts, Version 2.3 [2021] ...}
+\typeout@ba{Style Option BibArts, Version 2.4 [2022] ...}
\def\msg@bafontsubst#1#2{\typeout@ba{{\string#1 ...} is unknown; I'll substitute {\string#2 ...}.}}
@@ -98,7 +98,7 @@
\def\baabkcorr{\bacorr}
\def\balistcorr{\bacorr}
\def\bakntsepcorr{\bacorr}
-%% Only \barefcorr is not yet unified in 2.3 %%
+%% Only \barefcorr is not yet unified in 2.4 %%
\def\setup@ba#1#2{\let\@bahdtest-{#1{%
\ifdim\fontdimen\@ne\font=\z@{\ignorespaces #2\ba@textmode\iflasthasdot@ba{\global\let\@bahdtest+}{}}\else
@@ -1099,6 +1099,8 @@
\def\onlykurz##1{##1}% %% Umgekehrt in \@herefunctions
\def\vauthor##1##2{\kauthor{##2}}% %% Vgl. \@hereFfunctions %%
\def\midvauthor##1##2{\kauthor{##2}{\nsep}\ignorespaces}%
+ \def\v@uthor##1##2{\kauthor{##1}}% %% new in 2.4 %%
+ \def\m@dvauthor##1##2{\kauthor{##1}{\nsep}\ignorespaces}%
\def\sort##1{}%
}
@@ -3958,7 +3960,7 @@
\def\addtobib{\addtoarq{}}
\newif\if@oldba\@oldbafalse
\def\makebar{\typeout@ba{ \space ***** \space That is obviously a file based on BibArts 1.x \space *****
- ^^J \space ***** \space BibArts 2.3 starts compatibility mode for 1.3 \space *****}%
+ ^^J \space ***** \space BibArts 2.4 starts compatibility mode for 1.3 \space *****}%
\def\bibarts{\BibArts}%
\def\schrift{}%
\def\barschrift{}%
diff --git a/macros/latex/contrib/bibarts/bibarts.tex b/macros/latex/contrib/bibarts/bibarts.tex
index 37183b132b..deed6c30d7 100644
--- a/macros/latex/contrib/bibarts/bibarts.tex
+++ b/macros/latex/contrib/bibarts/bibarts.tex
@@ -1,5 +1,5 @@
-%% BibArts 2.3 assists you to write LaTeX texts in arts and humanities.
-%% Copyright (C) 2021 Timo Baumann bibarts[at]gmx.de (2021/12/06)
+%% BibArts 2.4 assists you to write LaTeX texts in arts and humanities.
+%% Copyright (C) 2022 Timo Baumann bibarts[at]gmx.de (2022/01/10)
%%% LaTeX + "bibsort -i bibarts -m -utf8 -k -e -g1 -h" + LaTeX %%%
@@ -21,7 +21,7 @@
\setlength{\footnotesep}{2ex} %% ... wie in bibarts.sty 2.0; siehe README.txt. %%
- \usepackage[utf8]{inputenc} %% bibarts.tex, Vers. 2.3, enthaelt utf8-Zeichen. %%
+ \usepackage[utf8]{inputenc} %% bibarts.tex, Vers. 2.4, enthaelt utf8-Zeichen. %%
\usepackage[T1]{fontenc} %% Automatische Trennung von Worten mit Umlauten. %%
@@ -34,7 +34,7 @@
%\allprrtrue %% <= Prozent am Zeilenanfang auf Wunsch entfernen;
-%% mit \allprrtrue kommen ALLE utf8-Zeichen, die bibsort 2.3 kennt,
+%% mit \allprrtrue kommen ALLE utf8-Zeichen, die bibsort 2.4 kennt,
%% in "Das Personenregister als Beispiel f"ur das Sortieren" (Kap. 18).
@@ -44,7 +44,7 @@
\author{\scshape{Timo Baumann}}
- \date{\small Version 2.3 (2021). \hspace{.5em}\copyright\ 2.x (2021, 2019, 2016, 2015).
+ \date{\small Version 2.4 (2022). \hspace{.5em}\copyright\ 2.x (2022, 2021, 2019, 2016, 2015).
\hspace{.5em}\textbf{Inhalt S.\,\pageref{SectIn}}.}
@@ -177,7 +177,7 @@ nichts mit \textsc{Bib}\TeX\ zu tun:\pdfko{.25}
\hspace{.2em}bewirkt, dass \textit{ein} Autor (Vor- und Nachname gleich),
der mit mehreren Werken zitiert wird, ab seiner zweiten Nennung auf der
Literaturliste als $\sim$ erscheint. \verb|-utf8| \hspace{.2em}sortiert
- UTF8\hy Zeichen analog zu \verb|utf8enc.dfu| 2021/01/27 v1.2l
+ UTF8\hy Zeichen analog zu \verb|utf8enc.dfu| 2021/06/21 v1.2n
(\kern-.05em\textit{ohne} \verb|\cyr|...\ und \verb|\CYR|...\hy Zeichen).
\vspace{1ex}\noindent
@@ -610,7 +610,7 @@ auf der \hspace{-.25em}\verb|.vkc|\hy Liste nur ein Eintrag erscheint.
Beides scheitert, falls Sie \hspace{-.125em}\verb|\underline| \label{underline}
im v\fhy Befehl mit \verb|\protect| sch"utzen \baref{zrbr} und in
k\fhy Befehlen nicht immer (Stand 2021).
-%% Gilt 2021 noch, obwohl \underline nicht mehr wiklich zerbricht, aber nach
+%% Gilt noch, obwohl \underline nicht mehr wiklich zerbricht, aber nach
%% \underline und \protect\underline verschieden viele Leerzeichen stehen.
@@ -1938,7 +1938,7 @@ defaultm"a\hyss ig \verb|\bfseries| ausf"uhrt
(\textbf{fett}). Die Seiten, von denen Definitionen
herstammen, sind in der Auf"|listung von Seitenzahlen nicht
hervorgehoben. Eine Hervorhebung einzelner Seitenzahlen sieht
-auch \BibArts\ 2.3 nie vor.
+auch \BibArts\ 2.4 nie vor.
F"ur Abk"urzungen wie \printonlyabk{u.\,a.}, die Allgemeingut sind und deshalb
vielleicht nicht ins Abk"urzungsverzeichnis sollen, kann
@@ -5339,8 +5339,8 @@ Nur \verb|bibsort| in der Eingabeauf"|forderung getippt druckt auf den Bildschir
\catcode\grave@ba\|=\active\makeatother
\def|{\hspace{-.25em}\hbox to 1em{\hfill$\sim$\hfill}\hspace{-.25em}}%
\begin{verbatim}
- %%> This is bibsort 2.3 (for help: bibsort -?)
- %% bibsort 2.3 is part of BibArts 2.3 (C) Timo Baumann 2021.
+ %%> This is bibsort 2.4 (for help: bibsort -?)
+ %% bibsort 2.4 is part of BibArts 2.4 (C) Timo Baumann 2022.
%% I read a LaTeX .aux file (follow \@input), and I write my output in files
%% .vli Literature .vqu Published sources .grr Geographic index
%% .vkc Short titles .arq Unpublished sources .prr Person index
@@ -5411,30 +5411,41 @@ irref"uhrend, es sei ein\hspace{.2em} \texttt{Incomplete} \texttt{\bs ifx}~...\h
\vspace{.75ex}
Weitere Optionen wie \verb|-l|\,, \verb|-i=j| und \verb|-p| werden unten ab Seite~\pageref{plit} erkl"art.
-\vspace{1.25ex}\noindent
-Die Version 2.3 stellt f"ur \verb|bibsort| neu die Optionen \verb|-utf8| und \verb|-e| bereit:
+\vspace{1.5ex}\noindent
+Seit Version 2.3 stellt \verb|bibsort| die Optionen \verb|-utf8| und \verb|-e| bereit:
\vspace{.75ex}
-\verb|-utf8| \hspace{.1em}sorgt daf"ur, dass UTF8\hy Zeichen analog zu \verb|utf8enc.dfu| in Version v1.2l
-vom 2021/01/27 (\kern-.05em\textit{ohne} \verb|\cyr|...\ und \verb|\CYR|...\hy Zeichen) sortiert werden. Probleme mit UTF8\hy Zeichen
-berichtet \verb|bibsort| am Ende gesammelt. Falls Sie UTF8\hy Zeichen verwenden, aber \verb|-utf8| \hspace{.05em}nicht gesetzt
-haben, meldet \verb|bibsort| nur das insgesamt letzte Oktett, das nicht behandelt wurde, also etwa:\footnote{Da UTF8\hy Zeichen jenseits Nr.\,127
+\verb|-utf8| \hspace{.1em}bewirkt, dass UTF8\hy Zeichen analog zu \verb|utf8enc.dfu| (v1.2n vom 2021/06/21
+\kern-.05em\textit{ohne} \verb|\cyr|...\ und \verb|\CYR|...\hy Zeichen) sortiert werden. Seit 2.4 sind nun zus"atzlich
+ḟ \texttt{U+1E1F},
+Ḟ \texttt{U+1E1E},
+ḱ \texttt{U+1E31},
+Ḱ \texttt{U+1E30},
+Ẏ \texttt{U+1E8E},
+ẏ \texttt{U+1E8F},
+ẑ \texttt{U+1E91},
+Ẑ \texttt{U+1E90},
+ỳ \texttt{U+1EF3} und
+Ỳ \texttt{U+1EF2}
+bekannt (neu gegen"uber v1.2l).
+
+Falls Sie UTF8\hy Zeichen verwenden, aber \verb|-utf8| \hspace{.05em}nicht gesetzt
+haben, meldet \verb|bibsort| nur das letzte unbekannte Oktett aus Ihrem Text, also etwa:\footnote{Da UTF8\hy Zeichen jenseits Nr.\,127
aus mehreren Oktetten bestehen, ist die im Beispiel angegebene Nummer \texttt{165} kein eindeutiger Hinweis darauf, auf welches UTF8\hy Zeichen
die Fehlermeldung zur"uckgeht. Es k"onnte sich dabei etwa um das zweite Oktett der Dublette \texttt{195-165} f"ur å (\texttt{U+00E5}) handeln,
aber vielleicht auch \texttt{194-165} f"ur ¥ (\texttt{U+00A5}), oder sonstwas. Oder ist es ASCII 165? Dann w"are vielleicht \v{e} gemeint (siehe \texttt{-t1}).}
- \vspace{-1ex}
+ \vspace{-1.25ex}
{\scriptsize\begin{verbatim}
%%> Default encoding: Gave ASCIIs > 127 like 165 NO sorting weight.
%% Did ignore all ASCIIs > 127. Start me using -utf8 or -t1 ?
%% *******
\end{verbatim}}
-\vspace{-3ex}\noindent
-Unter \hspace{.2em}\verb|bibsort| \verb|-utf8| \hspace{.1em}\abra{...}
-\hspace{.2em}werden die ersten zwanzig unbekannten UTF8\hy Zeichen gesammelt
-und je Zeichen wird \textit{eine} Bildschirm\hy Meldung ausgegeben:
+\vspace{-3.75ex}\noindent
+Falls unter \verb|-utf8| dagegen UTF8\hy Zeichen \textit{unbekannt} sind, sammelt \verb|bibsort|
+bis zu zwanzig und gibt am Ende je Zeichen \textit{eine} Bildschirm\hy Meldung aus:
\vspace{-1ex}
{\scriptsize\begin{verbatim}
@@ -5445,17 +5456,17 @@ und je Zeichen wird \textit{eine} Bildschirm\hy Meldung ausgegeben:
%% Better replace this sequence(s) by LaTeX-cmds in your text.
\end{verbatim}}
-\vspace{-3ex}\noindent
+\vspace{-3.25ex}\noindent
Auch das aktuelle \LaTeX\ gibt bei Verwendung dieser Zeichen Fehler aus.
Falls Sie \hspace{.15em}\verb|\DeclareUnicodeCharacter{01EC}{\k{\@tabacckludge=O}}| \hspace{.2em}im Vorspann Ihrer \LaTeX\hy Datei definieren,
w"urde eine Nutzung von \verb|U+01EC| das Zeichen drucken und die \LaTeX\hy Fehlermeldung ausschalten;
-\verb|bibsort| 2.3 g"abe \verb|U+01EC| aber weiterhin kein Sortiergewicht.
+\verb|bibsort| 2.4 g"abe \verb|U+01EC| aber weiterhin kein Sortiergewicht.
Nutzung von \verb|\k{\=O}| im Text w"urde stattdessen \k{\=O} ausdrucken\footnote{In \texttt{\{tabbing\}}\hy Umgebungen w"are \texttt{\bs k\{\bs a=O\}} zu verwenden,
weil \texttt{\bs=} dort Tabs setzt.} \textit{und} von \verb|bibarts| sortiert werden k"onnen.
%%\k{\a=O}%%
\vspace{.75ex}
-\verb|-e| \hspace{.2em}ist eine weitere in Version 2.3 neue Option. Mit \hspace{.2em}\verb|\bibsort| \verb|-e| \hspace{.2em}werden die
+\verb|-e| \hspace{.2em}ist seit Version 2.3 eine weitere Option. Mit \hspace{.2em}\verb|\bibsort| \verb|-e| \hspace{.2em}werden die
Argumente von \verb|\vauthor|, \verb|\midvauthor| und \verb|\ntvautor| auf den \BibArts\hy \textit{Listen} vertauscht ausgedruckt
(\kern-.0875em\textit{e}xchange). Damit werden Koautoren in der Notation
\hspace{.1em}\textit{Nachname}\kern-.05em\verb|,| \hspace{-.1em}\textit{Vorname} \hspace{.15em}ausgedruckt, also wie der Hauptautor.
@@ -5510,8 +5521,7 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\hspace{.15em}entfernen. Nach einem Durchlauf von
\hspace{.3em}\LaTeX\,$+$\,\verb|bibsort| \verb|-utf8| \abra{...}\kern.2em$+$\kern.15em\LaTeX\
\hspace{.3em}sind u.\,a.\ alle UTF8\hy Zeichen (mit \verb|[U+|\fabra{...}\verb|]| als Kommentar) da, die
-\hspace{.15em}\verb|bibsort| \hspace{.15em}in Version 2.3 erkennt:
-
+\hspace{.15em}\verb|bibsort| \hspace{.15em}in Version 2.4 erkennt:
\newcommand{\demotext}[1]{\nosort{\protect\printdemotext{#1}}}%
@@ -5901,6 +5911,18 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\addtoprr{st\demotext{ [U+FB06]}}
\addtoprr{a\ b\demotext{ a[U+FEFF/nobreak]\bs\ b}}
%%
+%% neu in 2.4 [utf8enc.dfu 2021/06/21 v1.2n]:
+\addtoprr{Ḟ\demotext{ [U+1E1E] \% neu in 2.4}}
+\addtoprr{ḟ\demotext{ [U+1E1F] \% neu in 2.4}}
+\addtoprr{Ḱ\demotext{ [U+1E30] \% neu in 2.4}}
+\addtoprr{ḱ\demotext{ [U+1E31] \% neu in 2.4}}
+\addtoprr{Ẏ\demotext{ [U+1E8E] \% neu in 2.4}}
+\addtoprr{ẏ\demotext{ [U+1E8F] \% neu in 2.4}}
+\addtoprr{Ẑ\demotext{ [U+1E90] \% neu in 2.4}}
+\addtoprr{ẑ\demotext{ [U+1E91] \% neu in 2.4}}
+\addtoprr{Ỳ\demotext{ [U+1EF2] \% neu in 2.4}}
+\addtoprr{ỳ\demotext{ [U+1EF3] \% neu in 2.4}}
+%%
%% ... dies fuehren utf8-Zeichen aus in
%% utf8enc.dfu 2021/01/27 v1.2l OHNE \cyr.../\CYR...
\addtoprr{a\nobreakspace b}%siehe zugehoeriges \fillprr
@@ -6232,6 +6254,19 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\addtoprr{st}
\addtoprr{st}
\addtoprr{a\protect\nobreak\ b\demotext{ a\bs protect\bs nobreak\bs\ b}} %%\addtoprr{a\ifhmode\nobreak\fi\ b}%% Kommt nicht im .prr-File an. %%
+%%
+%% neu in 2.4 [utf8enc.dfu 2021/06/21 v1.2n]:
+\addtoprr{\.F}
+\addtoprr{\.f}
+\addtoprr{\@tabacckludge'K}
+\addtoprr{\@tabacckludge'k}
+\addtoprr{\.Y}
+\addtoprr{\.y}
+\addtoprr{\^Z}
+\addtoprr{\^z}
+\addtoprr{\@tabacckludge`Y}
+\addtoprr{\@tabacckludge`y}
+%%
\fi
%%%
\addtoprr{b\texttwooldstyle\demotext{ \ b\bs texttwooldstyle}}
@@ -6554,9 +6589,9 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\addtoprr{b@2}
\addtoprr{b|2\demotext{ b\protect\string|2}}
\addtoprr{b+2}
-\addtoprr{b-2}
+\addtoprr{b-2\demotext{ \ \ \ b{\protect\string-}2}}
\addtoprr{b--2\demotext{ \ b{\protect\string-}{\protect\string-}2}}
-\addtoprr{b---2\demotext{ b{\protect\string-}{\protect\string-}{\protect\string-}2}}
+%\addtoprr{b---2\demotext{ b{\protect\string-}{\protect\string-}{\protect\string-}2}}
\addtoprr{Ae}
\addtoprr{Ac}
\addtoprr{Af}
@@ -6590,6 +6625,7 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\addtoprr{$\mathring{b}$\demotext{ \$\bs mathring\{b\}\$ \ \%neu in 2.1}}
\addtoprr{\b{b}\demotext{ \bs b\{b\}}}
\addtoprr{\c{b}\demotext{ \bs c\{b\}}}
+\addtoprr{\textcommabelow{b}\demotext{ \bs textcommabelow\{b\}}}
\addtoprr{\k{b}\demotext{ \bs k\{b\}}}
\addtoprr{\d{b}\demotext{ \bs d\{b\}}}
\addtoprr{\H{b}\demotext{ \bs H\{b\}}}
@@ -6806,7 +6842,7 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\addtoprr{b \index{X} b\demotext{ \ \ b \bs index\{X\} b}}
\addtoprr{b\glossary{X}b\demotext{ \ b\bs glossary\{X\}b}}
\addtoprr{b \label{X1} b\demotext{ \ \ \protect\,b \bs label\{X1\} b}}
-\addtoprr{b \pageref{X1} b\demotext{ b \bs pageref\{X1\} b}}
+\addtoprr{b \pageref{X1} b\demotext{ \ b \bs pageref\{X1\} b}}
\addtoprr{b \baref{X2} b\demotext{ \ b \bs baref\{X2\} b}}
\addtoprr{b \balabel{X2} b\demotext{ \ \ \ b \bs balabel\{X2\} b}}
\addtoprr{b \protect\pageref{X1} b\demotext{ b \bs protect\bs pageref\{X1\} b}}
@@ -6854,7 +6890,7 @@ k"onnen Sie (f"ur eigene Tests) im Vorspann das \hspace{.1em}\verb|%|
\fillprr{\textcolonmonetary}{\demotext{ \bs textcolonmonetary}}
\addtoprr{¥\demotext{ [U+00A5]}}
\addtoprr{\textyen}
- \fillprr{\textyen}{\demotext{ \bs textyen \ \ \ \% new in 2.3}}
+ \fillprr{\textyen}{\demotext{ \bs textyen \ \ \ \% neu in 2.3}}
%\addtoprr{₦\demotext{ [U+20A6]}}
% \addtoprr{\textnaira}
% \fillprr{\textnaira}{\demotext{ \bs textnaira}}
@@ -7286,7 +7322,7 @@ Der erste Satz.\footnote{\kli{Ferguson}{Falscher Krieg}[23].\vspace{1ex}}}
\vfill
\hbox{\parbox{7.7cm}{\footnotesize\noindent
-\textbf{\BibArts~2.3 \ (9 Dateien, 8 vom 06.\,12.\,2021):} \\[.85ex]
+\textbf{\BibArts~2.4 \ (9 Dateien, 8 vom 10.\,01.\,2022):} \\[.85ex]
\begin{tabular}{ll}%
\texttt{README.txt} & Versionsgeschichte seit 1.3 \\[-1.75pt]
\texttt{bibarts.sty} & Das \LaTeX-Style-File \\[-1.75pt]
diff --git a/macros/latex/contrib/bibarts/bibsort.c b/macros/latex/contrib/bibarts/bibsort.c
index 0841620e75..cc094f10bf 100644
--- a/macros/latex/contrib/bibarts/bibsort.c
+++ b/macros/latex/contrib/bibarts/bibsort.c
@@ -1,5 +1,5 @@
-/* BibArts 2.3 assists you to write LaTeX texts in arts and humanities. */
-/* Copyright (C) 2021 Timo Baumann bibarts[at]gmx.de (2021/12/06) */
+/* BibArts 2.4 assists you to write LaTeX texts in arts and humanities. */
+/* Copyright (C) 2022 Timo Baumann bibarts[at]gmx.de (2022/01/10) */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
@@ -46,7 +46,7 @@
The C-compiled binary of this file is reading LaTeX .aux files.
It can NOT read the .bar files, which BibArts 1.x did use.
- BibArts 2.3 ONLY has an EMULATION for 1.3 texts: Keep copies of 1.x?
+ BibArts 2.4 ONLY has an EMULATION for 1.3 texts: Keep copies of 1.x?
*/
@@ -4164,8 +4164,8 @@ static char *thtwentyfive_oheightyfour[] = {
"", /* 225 184 155 e with tilde below (not v1.2l) */
"", /* 225 184 156 [\\u{\\c{E}}] (not v1.2l) */
"", /* 225 184 157 [\\u{\\c{e}}] (not v1.2l) */
- "", /* 225 184 158 \\.F (not v1.2l) */
- "", /* 225 184 159 \\.f (not v1.2l) */
+ "\\.F", /* 225 184 158 new in 2.4 */
+ "\\.f", /* 225 184 159 new in 2.4 */
"\\=G", /* 225 184 160 */
"\\=g", /* 225 184 161 */
"", /* 225 184 162 \\.H (not v1.2l) */
@@ -4182,8 +4182,8 @@ static char *thtwentyfive_oheightyfour[] = {
"", /* 225 184 173 i with tilde below (not v1.2l) */
"", /* 225 184 174 \\\'{\\\"I} (not v1.2l) */
"", /* 225 184 175 \\\'{\\\"{\\i}} (not v1.2l) */
- "", /* 225 184 176 \\\'K (not v1.2l) */
- "", /* 225 184 177 \\\'k (not v1.2l) */
+ "\\\'K", /* 225 184 176 new in 2.4 */
+ "\\\'k", /* 225 184 177 new in 2.4 */
"", /* 225 184 178 \\d{K} (not v1.2l) */
"", /* 225 184 179 \\d{k} (not v1.2l) */
"", /* 225 184 180 \\b{K} (not v1.2l) */
@@ -4288,6 +4288,83 @@ char *get_thtwentyfive_oheightyfive(unsigned char c)
}
+static char *thtwentyfive_oheightysix[] = {
+ "", /* 225 186 128 \\`W (not v1.2l) */
+ "", /* 225 186 129 \\`w (not v1.2l) */
+ "", /* 225 186 130 \\\'W (not v1.2l) */
+ "", /* 225 186 131 \\\'w (not v1.2l) */
+ "", /* 225 186 132 \\\"W (not v1.2l) */
+ "", /* 225 186 133 \\\"w (not v1.2l) */
+ "", /* 225 186 134 \\.W (not v1.2l) */
+ "", /* 225 186 135 \\.w (not v1.2l) */
+ "", /* 225 186 136 \\d{W} (not v1.2l) */
+ "", /* 225 186 137 \\d{w} (not v1.2l) */
+ "", /* 225 186 138 \\.X (not v1.2l) */
+ "", /* 225 186 139 \\.x (not v1.2l) */
+ "", /* 225 186 140 \\\"X (not v1.2l) */
+ "", /* 225 186 141 \\\"x (not v1.2l) */
+ "\\.Y", /* 225 186 142 new in 2.4 */
+ "\\.y", /* 225 186 143 new in 2.4 */
+ "\\^Z", /* 225 186 144 new in 2.4 */
+ "\\^z", /* 225 186 145 new in 2.4 */
+ "", /* 225 186 146 \\d{Z} (not v1.2l) */
+ "", /* 225 186 147 \\d{z} (not v1.2l) */
+ "", /* 225 186 148 Z with line below (not v1.2l) */
+ "", /* 225 186 149 z with line below (not v1.2l) */
+ "", /* 225 186 150 h with line below (not v1.2l) */
+ "", /* 225 186 151 \\\"t (not v1.2l) */
+ "", /* 225 186 152 \\r{w} */
+ "", /* 225 186 153 \\r{y} */
+ "", /* 225 186 154 a with right half ring (not v1.2l) */
+ "", /* 225 186 155 long s with dot above (not v1.2l) */
+ "", /* 225 186 156 long s with diagonal stroke (not v1.2l) */
+ "", /* 225 186 157 long s with high stroke (not v1.2l) */
+ "{\\SS}", /* 225 186 158 */
+ "", /* 225 186 159 \\delta (not v1.2l) */
+ "", /* 225 186 160 \\d{A} (not v1.2l) */
+ "", /* 225 186 161 \\d{a} (not v1.2l) */
+ "", /* 225 186 162 A with hook above (not v1.2l) */
+ "", /* 225 186 163 a with hook above (not v1.2l) */
+ "", /* 225 186 164 A with circumflex-acute (not v1.2l) */
+ "", /* 225 186 165 a with circumflex-acute (not v1.2l) */
+ "", /* 225 186 166 A with circumflex-grave (not v1.2l) */
+ "", /* 225 186 167 a with circumflex-grave (not v1.2l) */
+ "", /* 225 186 168 A with circumflex-hook (not v1.2l) */
+ "", /* 225 186 169 a with circumflex-hook (not v1.2l) */
+ "", /* 225 186 170 \\~{\\^A} (not v1.2l) */
+ "", /* 225 186 171 \\~{\\^a} (not v1.2l) */
+ "", /* 225 186 172 \\d{\\^A} (not v1.2l) */
+ "", /* 225 186 173 \\d{\\^a} (not v1.2l) */
+ "", /* 225 186 174 A with breve-acute (not v1.2l) */
+ "", /* 225 186 175 a with breve-acute (not v1.2l) */
+ "", /* 225 186 176 A with breve-grave (not v1.2l) */
+ "", /* 225 186 177 a with breve-grave (not v1.2l) */
+ "", /* 225 186 178 A with breve-hook (not v1.2l) */
+ "", /* 225 186 179 a with breve-hook (not v1.2l) */
+ "", /* 225 186 180 A with breve-tilde (not v1.2l) */
+ "", /* 225 186 181 a with breve-tilde (not v1.2l) */
+ "", /* 225 186 182 \\d{\\u{A}} (not v1.2l) */
+ "", /* 225 186 183 \\d{\\u{a}} (not v1.2l) */
+ "", /* 225 186 184 \\d{E} (not v1.2l) */
+ "", /* 225 186 185 \\d{e} (not v1.2l) */
+ "", /* 225 186 186 E with hook above (not v1.2l) */
+ "", /* 225 186 187 e with hook above (not v1.2l) */
+ "", /* 225 186 188 \\~E (not v1.2l) */
+ "", /* 225 186 189 \\~e (not v1.2l) */
+ "", /* 225 186 190 E with circumflex-acute (not v1.2l) */
+ "", /* 225 186 191 e with circumflex-acute (not v1.2l) */
+ NULL };
+
+#define THTWENTYFIVE_OHEIGHTYSIX 186
+
+char *get_thtwentyfive_oheightysix(unsigned char c)
+{
+ if (c >= UTF_BLOCK_BEGIN && c <= UTF_BLOCK_END) /* 128 ... 191 */
+ return thtwentyfive_oheightysix[c-UTF_BLOCK_BEGIN];
+ else return "";
+}
+
+
static char *thtwentysix_ohtwentyeight[] = {
"", /* 226 128 128 en quad (not v1.2l) */
"", /* 226 128 129 em quad (not v1.2l) */
@@ -4613,8 +4690,11 @@ int reg_utf_eight(int l, int val, char ch[UTF_EIGHT_MAXERR][UTF_EIGHT_MAXLEN+1],
{
i = 0;
while (i < l && ch[entry][i] == *(p+i) && *(p+i) != '\0') ++i;
- if (ch[entry][i] == '\0' && *(p+i) == '\0') /* (i == l) for valids */
- {
+ if ( i > 0 /* i > 0 added in 2.4 */
+ && ch[entry][i] == '\0'
+ && (*(p+i) == '\0' || i == l) /* i == l added in 2.4 */
+ )
+ {
found = 1;
break;
}
@@ -4648,7 +4728,7 @@ int utf_eight_err(const char *p)
else
if (c >= QUADRUPLES_BEGIN && c <= QUADRUPLES_END) l = 4; /* 240 ... 244 */
- /* l == 1 falls \GenericError bliebe. */
+ /* l == 1 if \GenericError stays and the char is in its arguments */
if (l >= 1)
{
utf_err_c = reg_utf_eight(l, utf_err_c, err_utf_eight, p);
@@ -4744,8 +4824,14 @@ void get_utf_eight(char in[], const char *p)
if (signeless(*(p+1)) == THTWENTYFIVE_OHEIGHTYFIVE)
pos = insposmaxstr(in, get_thtwentyfive_oheightyfive(*(p+2)), pos, MAXLEN-1);
else
- if (signeless(*(p+1)) == 186 && signeless(*(p+2)) == 158)
- pos = insposmaxstr(in, "{\\SS}", pos, MAXLEN-1); /* 225 186 158 */
+ if (signeless(*(p+1)) == THTWENTYFIVE_OHEIGHTYSIX)
+ pos = insposmaxstr(in, get_thtwentyfive_oheightysix(*(p+2)), pos, MAXLEN-1);
+ else
+ if (signeless(*(p+1)) == 187 && signeless(*(p+2)) == 178)
+ pos = insposmaxstr(in, "\\`Y", pos, MAXLEN-1); /* 225 187 178 new in 2.4 */
+ else
+ if (signeless(*(p+1)) == 187 && signeless(*(p+2)) == 179)
+ pos = insposmaxstr(in, "\\`y", pos, MAXLEN-1); /* 225 187 179 new in 2.4 */
}
else
if (a == THTWENTYSIX)
@@ -4797,8 +4883,6 @@ void get_utf_eight(char in[], const char *p)
}
in[pos] = '\0';
-
- /* printf("%% \"%s\"\n", in); */ /* !!!! */
}
@@ -6052,7 +6136,7 @@ void printfilelist(FILE *file, int filec, int cc, const char *vor, const char *n
int i = 0;
if (cc == 1)
- fprintf(file, "\n%%%% BibArts 2.3 (C) Timo Baumann 2021 [%s]\n", __DATE__);
+ fprintf(file, "\n%%%% BibArts 2.4 (C) Timo Baumann 2022 [%s]\n", __DATE__);
fprintf(file, "%%%%\n");
timestamp(file);
@@ -8495,7 +8579,7 @@ void print_utf_msg(const char err[UTF_EIGHT_MAXERR][UTF_EIGHT_MAXLEN+1], int err
while (j < err_c && j < UTF_EIGHT_MAXERR)
{
printf("%%%%> %s utf8 sequence ", msg_a);
- if (err[j][1] == '\0') printf("beginning with char ");
+ if (err[j][1] == '\0') printf("consisting only of char "); /* msg changed in 2.4 */
i = 0; while(err[j][i] != '\0') { printf("%d", ((unsigned char)err[j][i])); if(err[j][i+1] != '\0') printf("-"); ++i; }
a = ((unsigned char)err[j][0]);
@@ -8540,8 +8624,8 @@ int main(int argc, char *argv[])
char *inname = mydefault, *arg_i = NULL, *arg_o = NULL;
- printf("\n%%%%> This is bibsort 2.3 (for help: %s -\?)\n", getmyname(argv[0], 37));
- fprintf(stderr, "%%%% bibsort 2.3 is part of BibArts 2.3 (C) Timo Baumann 2021.\n");
+ printf("\n%%%%> This is bibsort 2.4 (for help: %s -\?)\n", getmyname(argv[0], 37));
+ fprintf(stderr, "%%%% bibsort 2.4 is part of BibArts 2.4 (C) Timo Baumann 2022.\n");
argc = single_option(argc, argv, "-B", "-b");
diff --git a/macros/latex/contrib/dbshow/dbshow-doc.pdf b/macros/latex/contrib/dbshow/dbshow-doc.pdf
index fd03985433..c6d4b714d4 100644
--- a/macros/latex/contrib/dbshow/dbshow-doc.pdf
+++ b/macros/latex/contrib/dbshow/dbshow-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/dbshow/dbshow-doc.tex b/macros/latex/contrib/dbshow/dbshow-doc.tex
index 40bef33d17..ebfe69c535 100644
--- a/macros/latex/contrib/dbshow/dbshow-doc.tex
+++ b/macros/latex/contrib/dbshow/dbshow-doc.tex
@@ -1,5 +1,7 @@
\documentclass[full]{l3doc}
-\usepackage[scheme=plain]{ctex}
+\usepackage[scheme=plain, fontset=ubuntu]{ctex}
+\usepackage{multicol}
+\usepackage{adjustbox}
\usepackage{zhlineskip}
\usepackage{enumitem}
\usepackage{indentfirst}
@@ -11,22 +13,9 @@
\tcbuselibrary{listings, skins, raster, breakable}
\usepackage{tabularray}
-\def\zhdate{2022年1月8日}
-\def\endate{2022/01/08}
-\def\version{v1.2}
-
-\IndexPrologue
- {
- \section*{Index}
- \markboth{Index}{Index}
- \addcontentsline{toc}{section}{Index}
- The~italic~numbers~denote~the~pages~where~the~
- corresponding~entry~is~described,~
- numbers~underlined~point~to~the~definition,~
- all~others~indicate~the~places~where~it~is~used.
- }
-
-\newcommand\tikzmark[1]{\tikz \coordinate[overlay, remember picture] (#1);}
+\def\zhdate{2022年1月10日}
+\def\endate{2022/01/10}
+\def\version{v1.3}
\geometry{
left=4.5cm,
@@ -46,8 +35,39 @@
}
}
+\IndexPrologue {
+ \part*{Index}
+ \markboth{Index}{Index}
+ \addcontentsline{toc}{part}{Index}
+ The~italic~numbers~denote~the~pages~where~the~
+ corresponding~entry~is~described,~
+ numbers~underlined~point~to~the~definition,~
+ all~others~indicate~the~places~where~it~is~used.
+}
+
+\GlossaryPrologue {
+ \part*{Change~History}
+ {\GlossaryParms\ttfamily\hyphenchar\font=`\-}
+ \markboth{Change~History}{Change~History}
+ \addcontentsline{toc}{part}{Change~History}
+}
+
+\let\subsubitem\subitem
+
\DoNotIndex{\begin, \end}
\setlength{\parskip}{\medskipamount}
+
+\newcommand\tikzmark[1]{\tikz \coordinate[overlay, remember picture] (#1);}
+\def\levelchar{?}
+\def\orbar{\textup{\textbar}}
+\def\defaultval#1{\textbf{\textup{#1}}}
+\def\TF{true\orbar false}
+\def\TTF{\defaultval{true}\orbar false}
+\def\TFF{true\orbar\defaultval{false}}
+\def\zhbefore{\textbf{前}}
+\def\zhafter{\textbf{后}}
+\def\enbefore{\textbf{before}~}
+\def\enafter{\textbf{after}~}
\DeclareDocumentEnvironment { note } { +b } {
\par\textbf{\textsf{NOTE:~}}#1\par
} {}
@@ -59,32 +79,55 @@
top=2cm,
bottom=2cm
}
+ \PrintChanges
\PrintIndex
}
\ExplSyntaxOn
-\NewDocumentCommand { \strcs } { m } {
- \texttt{\tl_to_str:n { #1 }}
+\makeatletter
+\cs_new_protected:Nn \dbshow_changes:nnnn {
+ \@bsphack\group_begin:\@sanitize
+ \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore
+ \exp_args:Nx \glossary {
+ \exp_not:N \textbf{#1}\levelchar
+ \exp_not:N \textit{#2}\c_space_tl
+ \exp_not:N \textbf{#3}\c_colon_str\c_space_tl
+ \exp_not:n { #4 }
+ }
+ \group_end:\@esphack
}
-
-\dim_new:N \l__my_syntax_dim
-\box_new:N \g__my_syntax_box
-\NewDocumentEnvironment { Syntax } { s }
- {
- \dim_set:Nn \l__my_syntax_dim
- { \textwidth }
- \hbox_gset:Nw \g__my_syntax_box
- \small \ttfamily
- \begin{minipage}[t]{\l__my_syntax_dim}
- \raggedright\obeyspaces\obeylines
+\cs_generate_variant:Nn \dbshow_changes:nnnn { xnnn }
+
+\cs_new_protected:Nn \dbshow_changes_what:nnnn {
+ \regex_extract_once:nnNT { doc|macro|bug|option }
+ { #3 } \l_tmpa_seq {
+ \dbshow_changes:xnnn {
+ \str_case_e:nn { \seq_item:Nn \l_tmpa_seq { 1 } } {
+ { doc } { Documentation }
+ { macro } { Macro }
+ { bug } { Bug }
+ { option } { Option }
+ { logic } { Logic }
+ }
+ }
+ {#2} {#3} {#4}
}
- {
- \end{minipage}
- \hbox_gset_end:
- \IfValueF { #1 } { \smallskip }
- \box_use_drop:N \g__my_syntax_box
- \smallskip
+}
+
+\cs_new_protected:Nn \dbshow_changes_how:nnnn {
+ \regex_extract_once:nnNT { Add|Update|Remove } { #3 } \l_tmpa_seq {
+ \dbshow_changes:xnnn { \seq_item:Nn \l_tmpa_seq { 1 } }
+ {#2} {#3} {#4}
}
+}
+
+% #1 version #2 date #3 type #4 desc
+\DeclareDocumentCommand \changes { m m m m } {
+ \dbshow_changes:nnnn {#1} {#2} {#3} {#4}
+ \dbshow_changes_what:nnnn {#1} {#2} {#3} {#4}
+ \dbshow_changes_how:nnnn {#1} {#2} {#3} {#4}
+}
+\makeatother
\DeclareDocumentEnvironment { Description } { o +b } {
\hbox_set:Nn \l_tmpa_box { #1 }
@@ -94,35 +137,38 @@
\end{itemize}
} { }
-\keys_define:nn { dbshow/doc } {
- opt .tl_set:N = \l_opt_tl,
- desc .tl_set:N = \l_desc_tl,
- init .tl_set:N = \l_init_tl,
- init .initial:n = init-none,
+\cs_new_protected:Nn \dbshowdoc_function_begin:N {
+ \cs_set_eq:NN \__codedoc_tmp_cs:nN \__codedoc_typeset_function_block:nN
+ \cs_set_protected:Npn \__codedoc_typeset_function_block:nN ##1##2 {
+ \__codedoc_function_label:xN {##1} ##2
+ \hbox_set:Nn \l_tmpa_box {##1}
+ \int_compare:nTF { \str_count:n {##1} <= 22 }
+ {##1} { \adjustbox{width=.7\marginparwidth, height=\box_ht:N \l_tmpa_box}{##1} }
+ #1{##1}
+ \__codedoc_typeset_expandability: \\
+ }
}
-
-\box_new:N \l__option_box
-\NewDocumentEnvironment { option } { m +b } {
- \keys_set:nn { dbshow/doc } { #1 }
- \hbox_set:Nw \l__option_box
- \small \ttfamily
- \begin{minipage}[t]{\textwidth}
- \obeyspaces\obeylines
- \textcolor{red}{
- \l_opt_tl
- \exp_args:Nx\SpecialOptionIndex{\l_opt_tl}
- }
- {~}\l_desc_tl
- \hfill(
- \tl_if_eq:NnTF \l_init_tl { init-none } { no~value }
- { initially~\texttt{\l_init_tl} }
- )
- \end{minipage}
- \hbox_gset_end:
- \box_use_drop:N \l__option_box
- #2
- \medskip
-} { }
+\cs_new_protected:Nn \dbshowdoc_function_end: {
+ \cs_set_eq:NN \__codedoc_typeset_function_block:nN \__codedoc_tmp_cs:nN
+}
+\DeclareDocumentEnvironment { option } { O{} +v }
+ {
+ \dbshowdoc_function_begin:N \SpecialOptionIndex
+ \__codedoc_function:nnw {#1} {#2}
+ }
+ {
+ \__codedoc_function_end:
+ \dbshowdoc_function_end:
+ }
+\DeclareDocumentEnvironment { environment } { O{} +v }
+ {
+ \dbshowdoc_function_begin:N \SpecialEnvIndex
+ \__codedoc_function:nnw {#1} {#2}
+ }
+ {
+ \__codedoc_function_end:
+ \dbshowdoc_function_end:
+ }
\DeclareDocumentCommand \opt { O{} m }
{ \__codedoc_cmd:no {#1} { #2 } }
@@ -163,13 +209,23 @@
和其他数据库宏包比如 \pkg{datatool} 相比,\pkg{dbshow} 更专注于非图表类型的数
据展示。
+\changes{1.2}{2022-01-09}{Add doc}{descripton for expansion}
+\begin{itemize}
+ \item 名字后带有 $\star$ 的命令是可以完全展开的(fully-expandable);
+ \item 名字后带有 \ding{73} 的命令可以有限制地展开(restricted-expandable);
+ \item 名字后不带有特殊字符的命令是不可展开的(non-expandable);
+ \item 名字后带有 $\star$ 的选项不影响相关的代码的是否可展开;
+ \item 名字后带有 \ding{73} 的选项是否影响相关代码的可展开性取决于选项的设置;
+ \item 名字后不带有特殊字符的选项会使与之相关的代码变得不可展开。
+\end{itemize}
+
\subsection{数据类型}
宏包基于 \pkg{expl3} 的基础类型构建了6种类型:
\begin{Description}[\texttt{clist}]
\item[\texttt{date}]
- 基于宏包 \pkg{datetime2} 的日期类型,以iso标准存储,支持大小比较,排序(转
- 换成字符串)。默认值为 \cs{Today}。
+ 日期类型,以 |yyyy/mm/dd| 形式存储,支持大小比较,排序(转
+ 换成字符串)。默认值为 \cs{dbtoday}。
\item[\texttt{str}]
字符串类型,支持正则匹配,英文排序。默认值为空。
\item[\texttt{tl}]
@@ -182,8 +238,14 @@
逗号分隔的列表类型。默认值为空列表。
\end{Description}
+\changes{1.3}{2022-01-08}{Remove dependency}{\pkg{datatime2}}
+除了日期类型,所有类型都是 \pkg{expl3} 的内置类型。\pkg{dbshow} 构建了一个简单
+的 |date| 类型,支持转换成整数以及带样式的打印。
+
\subsection{与 \pkg{datatool} 的区别}
+\changes{1.2}{2022-01-07}{Add doc}{add comparison to \pkg{datatool}}
+
从核心功能上看,\pkg{dbshow} 和 \pkg{datatool} 实现了相同的功能。区别在于
\pkg{dbshow} 基于 \pkg{expl3} 实现,支持字符串的正则匹配,还支持多级排序。使用
方式上更倾向于样式与内容分离,所有的样式都可以通过选项提前定义好并且可以复用。
@@ -197,7 +259,7 @@
\section{接口文档}
\subsection{创建、展示和清空数据库}
-\begin{function}{\dbNewDatabase, \dbNewDatabase*}
+\begin{function}[added=2022-01-05]{\dbNewDatabase, \dbNewDatabase*}
\begin{syntax}
\cs{dbNewDatabase} \oarg{base database} \marg{database} \{ \\
~~\meta{attr1} = \meta{type spec1}, \\
@@ -226,7 +288,7 @@
}
\meta{attr} = \meta{type} &
将 \meta{attr} 声明为 \meta{type} 类型 \\
- \meta{attr} = \meta{type}\textbar\meta{default} &
+ \meta{attr} = \meta{type}\orbar\meta{default} &
将 \meta{attr} 声明为 \meta{type} 类型,并且将默认值设置为 \meta{default}。
\\
\end{tblr}
@@ -247,7 +309,7 @@
}
\end{verbatim}
-\begin{function}{\dbshow}
+\begin{function}[added=2022-01-05]{\dbshow}
\begin{syntax}
\cs{dbshow} \marg{style} \marg{database}
\end{syntax}
@@ -255,18 +317,17 @@
使用 \meta{style} 样式来展示 \meta{database}。
\end{function}
-\begin{function}{\dbclear}
+\changes{1.2}{2022-01-07}{Add macro}{\cs{dbclear}}
+\begin{function}[added=2022-01-07]{\dbclear}
\begin{syntax}
\cs{dbclear} \marg{database}
\end{syntax}
-
清空 \meta{database} 里的所有内容。
-
\end{function}
\subsection{\cs{dbNewStyle} 和样式选项}
-\begin{function}{\dbNewStyle}
+\begin{function}[added=2022-01-05]{\dbNewStyle}
\begin{syntax}
\cs{dbNewStyle} \oarg{base styles} \marg{style} \marg{database} \marg{opts}
\end{syntax}
@@ -277,14 +338,25 @@
\subsubsection{通用选项}
-\begin{option}{opt=filter, desc={= \meta{filter}}, init=-none-}
+\begin{option}[added=2022-01-05]{filter}
+ \begin{syntax}
+ filter = <filter>
+ \end{syntax}
+
为当前样式设置由 \cs{dbCombineFilters} 所定义的过滤器
\end{option}
-\begin{option}{opt=raw-filter, desc={= \meta{cond combination}}}
- 用已定义的条件为当前样式设置匿名过滤器。下面两个例子的作用是等同的。
+\begin{option}[added=2022-01-06]{raw-filter}
+ \begin{syntax}
+ raw-filter = <conditional expression>
+ \end{syntax}
+
+ 使用条件表达式设置匿名过滤器,这里的条件指通过 \cs{dbNewConditional} 定义的
+ 条件。下面代码中两个示例的过滤器具有相同的功能。
\end{option}
+\changes{1.1}{2022-01-06}{Add option}{\opt{raw-filter}}
+
\begin{verbatim}
% method 1
\begin{dbFilters}{db}
@@ -301,10 +373,12 @@
\dbNewStyle{style}{db}{filter=filter}
\end{verbatim}
-\begin{option}{
- opt = sort,
- desc = {= \{ \meta{attr spec1}, \meta{attr spec2}, \ldots{} \}},
-}
+\changes{1.2}{2022-01-08}{Fix bug}{string sorting bug}
+\begin{option}[added=2022-01-05]{sort}
+ \begin{syntax}
+ sort = \{ <attr spec1>, <attr spec2>, \ldots{} \}
+ \end{syntax}
+
为当前样式设置排序规则。支持根据 |str|,|date|,|int|,|fp| 类型的数据进行排
序,支持多级排序。\meta{attr} 表示增序,\meta{attr}* 表示降序。下面例子中,
使用 |sort-style| 展示数据时的顺序为先按 |level| 降序,|level| 相同的再按出
@@ -323,34 +397,74 @@
}
\end{verbatim}
-\begin{option}{
- opt = item-code,
- desc = {= \meta{item code}}
-}
+\begin{option}[added=2022-01-05, rEXP]{item-code}
+ \begin{syntax}
+ item-code = <code>
+ \end{syntax}
+
该选项用来设置展示数据库中每条记录的代码。你可以使用 \cs{dbuse} 来展示属性的
值。
\end{option}
-\begin{option}{
- opt = {\meta{attr}/sep},
- desc = {= \meta{sep spec}},
- init = {,~\~}
-}
-\begin{Syntax}
- \meta{attr}/sep = \meta{separator} \\
- \meta{attr}/sep = \{ \\
- ~~\meta{separator between two}, \\
- ~~\meta{separator between more than two}, \\
- ~~\meta{separator between final two} \\
- \}
-\end{Syntax}
-
- 该选项只适用于类型为 |clist| 的属性,用来设置列表间元素的间隔。第一个版本接
- 受一个参数,将所有的元素间隔设置为 \meta{separator}。第二个版本接受逗号分隔
- 的三个参数,分别用来设置只有两个元素时的分隔符 \meta{separator between two},
- 超过两个元素时的分隔符 \meta{separator between more than two},和最后两个元
- 素之间的分隔符 \meta{separator between final two}。
+\changes{1.3}{2022-01-09}{Update option}{\opt{<attr>/sep}}
+\begin{option}[added=2022-01-05, updated=2022-01-08, rEXP]{<attr>/sep}
+ \begin{syntax}
+ <attr>/sep = <separator> \\
+ <attr>/sep = \{ \\
+ ~~\meta{separator between two}, \\
+ ~~\meta{separator between more than two}, \\
+ ~~\meta{separator between final two} \\
+ \} \\
+ <attr>/sep = \{ \\
+ ~~\meta{separator before year}, \\
+ ~~\meta{separator between year and month}, \\
+ ~~\meta{separator between month and day}, \\
+ ~~\meta{separator after day} \\
+ \} \\
+ \end{syntax}
+
+ 该选项只适用于类型为 |clist| 或 |date| 的属性,用来设置列表间元素的间隔。参
+ 数为一个 \meta{separator} 时,所有元素间的分隔符被设置为 \meta{separator}。
+ \meta{separator before year} 和 \meta{separator after day} 被设置为空。
+\end{option}
+
+ 参数为3个元素的逗号分隔的列表时,此选项用来设置列表元素的分隔符,分别用来设
+ 置只有两个元素时的分隔符 \meta{separator between two},超过两个元素时的分隔
+ 符 \meta{separator between more than two},和最后两个元素之间的分隔符
+ \meta{separator between final two}。对于类型为 |clist| 的属性,设置此选项时
+ 如果参数列表数量不是1或者3会触发报错。
+\begin{verbatim}
+ % clist-attr is an attribute of database db
+ % suppose the val of clist-attr is { 1, 2, 3 }
+ \dbNewStyle{clist-sep}{db}{
+ clist-attr/sep = { ,~ }, % print 1, 2, 3
+ clist-attr/sep = { {,~}, {,~}, {and~} } % print 1, 2 and 3
+ }
+\end{verbatim}
+
+ 参数为4个元素的逗号分隔的列表时,此选项用来设置日期的分隔符,分别用来设
+ 置 \meta{year} 之前的分隔符 \meta{separator before year} ,\meta{year} 和
+ \meta{month} 之间的分隔符 \meta{separator between year and month} ,
+ \meta{month} 和 \meta{day} 之间的分隔符,以及 \meta{day} 之后的分隔符。对于
+ 类型为 |date| 的属性,设置此选项时如果参数列表数量不是1或者4会触发报错。
+
+\begin{verbatim}
+ % date-attr is an attribute of database db
+ % suppose the val of date-attr is 2022/01/01
+ \dbNewStyle{date-sep}{db}{
+ date-attr/sep = -, % print 2022-01-01
+ date-attr/sep = { |, -, -, | } % print |2022-01-01|
+ }
+\end{verbatim}
+
+\changes{1.3}{2022-01-08}{Add option}{\opt{<attr>/zfill}}
+\begin{option}[added=2022-01-08, EXP]{<attr>/zfill}
+ \begin{syntax}
+ <attr>/zfill = <\TTF>
+ \end{syntax}
+
+ 该选项只适用于类型为 |date| 的属性。控制输出月份和天时是否补零。
\end{option}
\subsubsection{装饰器}
@@ -385,69 +499,90 @@
}
\end{verbatim}
-\begin{option}{
- opt = before-code,
- desc = {= \meta{before code}}
-}
- 该选项用来设置在展示整个数据库之前需要执行的代码。
+\changes{1.3}{2022-01-08}{Add option}{\opt{<attr>/wrapper}}
+\begin{option}[added=2022-01-08, rEXP]{<attr>/wrapper}
+ \begin{syntax}
+ <attr>/wrapper = <control sequence>
+ \end{syntax}
+
+ 该选项只适用于类型为 |date| 的属性。\meta{control sequence} 只接收一个参数即
+ 日期,如果设置了此选项,则最后输出的日期为
+ \meta{control sequence}\marg{date}。
\end{option}
-\begin{option}{
- opt = after-code,
- desc = {= \meta{after code}}
-}
- 该选项用来设置在展示整个数据库之后需要执行的代码。
+\begin{option}[added=2022-01-05, rEXP]{before-code}
+ \begin{syntax}
+ before-code = <code>
+ \end{syntax}
+
+ 该选项用来设置在展示整个数据库之\zhbefore 需要执行的代码。
\end{option}
-\begin{option}{
- opt = record-before-code,
- desc = {= \meta{before code}}
-}
- 该选项用来设置在展示当前记录之前需要执行的代码。
+\begin{option}[added=2022-01-05, rEXP]{after-code}
+ \begin{syntax}
+ after-code = <code>
+ \end{syntax}
+
+ 该选项用来设置在展示整个数据库之\zhafter 需要执行的代码。
\end{option}
-\begin{option}{
- opt = record-after-code,
- desc = {= \meta{after code}}
-}
- 该选项用来设置在展示当前记录之后需要执行的代码。
+\changes{1.2}{2022-01-08}{Add options}{\opt{record-before-code},
+\opt{record-after-code}}
+\begin{option}[added=2022-01-05, rEXP]{record-before-code}
+ \begin{syntax}
+ record-before-code = <code>
+ \end{syntax}
+
+ 该选项用来设置在展示当前记录之\zhbefore 需要执行的代码。
\end{option}
-\begin{option}{
- opt = {\meta{attr}/before-code},
- desc = {= \meta{before code}}
-}
- 该选项用来设置展示数据库中属性 \meta{attr} 对应数据之前需要执行的代码。
- \cs{dbuse} 会在展示属性数据前执行此代码。
+\begin{option}[added=2022-01-05, rEXP]{record-after-code}
+ \begin{syntax}
+ record-after-code = <code>
+ \end{syntax}
+
+ 该选项用来设置在展示当前记录之\zhafter 需要执行的代码。
\end{option}
-\begin{option}{
- opt = {\meta{attr}/after-code},
- desc = {= \meta{after code}}
-}
- 该选项用来设置展示数据库中属性 \meta{attr} 对应数据之后需要执行的代码。
- \cs{dbuse} 会在展示属性数据后执行此代码。
+\begin{option}[added=2022-01-05, rEXP]{<attr>/before-code}
+ \begin{syntax}
+ <attr>/before-code = <code>
+ \end{syntax}
+
+ 该选项用来设置展示数据库中属性 \meta{attr} 对应数据之\zhbefore 需要执行的代
+ 码。\cs{dbuse} 会在展示属性数据\zhbefore 执行此代码。
\end{option}
-\begin{option}{
- opt = {\meta{attr}/item-before-code},
- desc = {= \meta{before code}}
-}
- 该选项只适用于类型为 |clist| 的属性,用来设置展示列表每个元素前需要执行的代
- 码。
+\begin{option}[added=2022-01-05, rEXP]{<attr>/after-code}
+ \begin{syntax}
+ <attr>/after-code = <code>
+ \end{syntax}
+
+ 该选项用来设置展示数据库中属性 \meta{attr} 对应数据之\zhafter 需要执行的代码。
+ \cs{dbuse} 会在展示属性数据\zhafter 执行此代码。
\end{option}
-\begin{option}{
- opt = {\meta{attr}/item-after-code},
- desc = {= \meta{after code}}
-}
- 该选项只适用于类型为 |clist| 的属性,用来设置展示列表每个元素后需要执行的代
- 码。
+\begin{option}[added=2022-01-05, rEXP]{<attr>/item-before-code}
+ \begin{syntax}
+ <attr>/item-before-code = <code>
+ \end{syntax}
+
+ 该选项只适用于类型为 |clist| 的属性,用来设置展示列表每个元素\zhbefore 需要
+ 执行的代码。
+\end{option}
+
+\begin{option}[added=2022-01-05, rEXP]{<attr>/item-after-code}
+ \begin{syntax}
+ <attr>/item-after-code = <code>
+ \end{syntax}
+
+ 该选项只适用于类型为 |clist| 的属性,用来设置展示列表每个元素\zhafter 需要执
+ 行的代码。
\end{option}
\subsection{使用 \cs{dbNewReviewPoints} 定义复习点}
-\begin{function}{\dbNewReviewPoints}
+\begin{function}[added=2022-01-05]{\dbNewReviewPoints}
\begin{syntax}
\cs{dbNewReviewPoints} \marg{name} \marg{points}
\end{syntax}
@@ -455,6 +590,8 @@
定义名为 \meta{name} 的复习点。这是专门为错题本或复习所定制的功能,
\meta{points}是一系列整数,现在假设每道错题你都将写错时的日期记录在了 |date|
属性中,并且你希望每隔2,5,15天复习一次。下面的代码给出了一个实现示例。
+\end{function}
+
\begin{verbatim}
\dbNewReviewPoints{review-point}{2, 5, 15} % 定义复习点
\begin{dbFilters}
@@ -463,47 +600,52 @@
\end{dbFilters}
\dbNewStyle{review-style}{ques}{filter=filter1} % 定义展示样式
\end{verbatim}
-\end{function}
\subsection{在 \env{dbFilters} 环境中定义过滤器}
-\noindent\DescribeEnv{dbFilters}
-\begin{Syntax}*
- |\begin{dbFilters}|\marg{database} \\
- ~~\meta{code}
- |\end{dbFilters}| \\
-\end{Syntax}
+\begin{environment}[added=2022-01-05]{dbFilters}
+ \begin{syntax}
+ |\begin{dbFilters}|\marg{database} \\
+ ~~\meta{code}
+ |\end{dbFilters}| \\
+ \end{syntax}
-\env{dbFilters}用来定义过滤器,此环境中定义了 \cs{dbNewConditional} 命令用来定
-义条件和 \cs{dbCombineConditionals} 命令用来组合条件定义过滤器。过滤器独立于每
-个 \meta{database},这意味着你可以在不同数据库中定义名称相同的过滤条件和过滤器。
+ \env{dbFilters}用来定义过滤器,此环境中定义了 \cs{dbNewConditional} 命令用来
+ 定义条件和 \cs{dbCombineConditionals} 命令用来组合条件定义过滤器。过滤器独立
+ 于每个 \meta{database},这意味着你可以在不同数据库中定义名称相同的过滤条件和
+ 过滤器。
+\end{environment}
-\begin{function}{\dbNewConditional, \dbNewConditional*}
+\begin{function}[added=2022-01-05, updated=2022-01-08]{\dbNewConditional, \dbNewConditional*}
\begin{syntax}
\cs{dbNewConditional} \marg{name} \marg{attr} \marg{cond spec} \\
\cs{dbNewConditional}* \marg{name} \marg{attr} \marg{cond spec} \\[2pt]
- \cs{dbNewConditional} \marg{name} \marg{int/fp attr} \marg{relation} \\
- \cs{dbNewConditional}* \marg{name} \marg{int/fp attr} \marg{relation} \\
+ \cs{dbNewConditional} \marg{name} \marg{int/fp attr} \marg{expr} \\
+ \cs{dbNewConditional}* \marg{name} \marg{int/fp attr} \marg{expr} \\
\cs{dbNewConditional} \marg{name} \marg{str/tl attr} \marg{regex expr} \\
\cs{dbNewConditional}* \marg{name} \marg{str/tl attr} \marg{regex expr} \\
\cs{dbNewConditional} \marg{name} \marg{clist attr} \marg{val list} \\
\cs{dbNewConditional}* \marg{name} \marg{clist attr} \marg{val list} \\
- \cs{dbNewConditional} \marg{name} \marg{date attr} \{\meta{review points}\textbar\meta{date}\} \\
- \cs{dbNewConditional}* \marg{name} \marg{date attr} \marg{relation}
+ \cs{dbNewConditional} \marg{name} \marg{date attr} \marg{expr}
+ \cs{dbNewConditional}* \marg{name} \marg{date attr} \{\meta{review points}\orbar\meta{date}\} \\
\end{syntax}
\cs{dbNewConditional} 用来定义名为 \meta{name} 的条件,\meta{attr} 指定条件
所绑定的属性,在 \meta{cond spec} 中可以用 \cs{dbval} 指代属性的值。
\end{function}
- 对于类型为 |int| 和 |fp| 的属性,两个版本的定义是一致的,\meta{relation} 可
- 以是单个关系式,比如 |\dbval > 3|,也可以是组合关系式,比如
- |\dbval > 3 && \dbval < 10.2|。支持的操作符有 |<, >, =, ==, !=, >=, <=, !|。
+ \changes{1.3}{2022-01-10}{Update doc}{truncated division}
+ 对于类型为 |int| 和 |fp| 的属性,\meta{expr} 传递给 \cs{int_compare:nTF} 或
+ \cs{fp_compare:nTF} 处理。
+ \begin{note}
+ |/| 为四舍五入除法,截断除法请用 \cs{dbIntDivTruncate}。
+ \end{note}
对于类型为 |str| 和 |tl| 的属性,\meta{regex} 为正则表达式,
\cs{dbNewConditional} 表示部分匹配,\cs{dbNewConditional*} 表示整体匹配。
+
\begin{verbatim}
- \dbNewConditional{cond1}{str-attr}{abc} % 匹配 abc, abcd, 1abc, =abc= 等
+ \dbNewConditional {cond1}{str-attr}{abc} % 匹配 abc, abcd, 1abc, =abc= 等
\dbNewConditional*{cond2}{str-attr}{abc} % 只匹配 abc
\end{verbatim}
@@ -513,16 +655,19 @@
(列表)中条件才成立。
\begin{verbatim}
- \dbNewConditional{cond1}{clist-attr}{a, b, c} % a, b, d 满足条件
+ \dbNewConditional {cond1}{clist-attr}{a, b, c} % a, b, d 满足条件
\dbNewConditional*{cond2}{clist-attr}{a, b, c} % a, b, d 不满足条件
\end{verbatim}
- 对于类型为 |date| 的属性,\cs{dbNewConditional} 使用复习点来定义过滤条件,
- \meta{review points} 是 \cs{dbNewReviewPoints} 定义的复习点,\meta{date} 是
- 用来比较的日期;\cs{dbNewConditional*} 使用\textbf{单个}关系式来定义过滤条件。
- 支持的操作符有 |<, >, =, ==, !=, >=, <=|。
+ \changes{1.3}{2022-01-08}{Update logic}{swap definition of starred and
+ unstarred conditionals of date}
+ 对于类型为 |date| 的属性,\cs{dbNewConditional} 定义的条件后续处理中会将
+ \meta{expr} 中的所有日期转换成相对\textit{1971年1月1日}的一个整数值,然后将
+ 处理后的表达式传递给 \cs{int_compare:nTF} 做进一步处理;
+ \cs{dbNewConditional*} 使用复习点来定义过滤条件,\meta{review points} 是
+ \cs{dbNewReviewPoints} 定义的复习点,\meta{date} 是用来比较的日期。
-\begin{function}{\dbCombineConditionals}
+\begin{function}[added=2022-01-05]{\dbCombineConditionals}
\begin{syntax}
\cs{dbCombineConditionals} \marg{name} \marg{cond combination} \oarg{info}
\end{syntax}
@@ -537,51 +682,56 @@
\subsection{使用 \env{dbitem} 环境存储数据}
-\noindent\DescribeEnv{dbitem}
-\begin{Syntax}*
- |\begin{dbitem}|\marg{database}[ \\
- ~~\meta{attr1} = \meta{val1}, \\
- ~~\meta{attr2} = \meta{val2}, \\
- ~~\ldots{} \\
- ] \\
- ~~\meta{code} \\
- |\end{dbitem}|
-\end{Syntax}
+\begin{environment}[added=2022-01-05]{dbitem}
+ \begin{syntax}
+ |\begin{dbitem}|\marg{database}[ \\
+ ~~\meta{attr1} = \meta{val1}, \\
+ ~~\meta{attr2} = \meta{val2}, \\
+ ~~\ldots{} \\
+ ] \\
+ ~~\meta{code} \\
+ |\end{dbitem}|
+ \end{syntax}
\env{dbitem} 环境用来存储数据。有两种存储数据的方法,较短的数据可以在选项列
表中通过键值对设置值,较长的数据可以在 \meta{code} 中使用 \cs{dbsave} 存储。
\cs{dbsave}会覆盖选项中设置的值。没有设置的值将会被设置为全局默认值,下面给
出一个存储示例。
+\end{environment}
\begin{verbatim}
- \begin{dbitem}[date=2022-01-01, info=测试]
+ \begin{dbitem}[date = 2022-01-01, info = 测试]
\dbsave{question}{这是一个测试问题}
- \dbsave{answer}{这是一个测试答案}
+ \dbsave{answer} {这是一个测试答案}
\end{dbitem}
\end{verbatim}
\subsection{\cs{dbsave} 和 \cs{dbuse}}
-\begin{function}{\dbsave}
+\changes{1.3}{2022-01-08}{Add macro}{\cs{dbsave*}}
+\begin{function}[added=2022-01-05, updated=2022-01-08]{\dbsave, \dbsave*}
\begin{syntax}
- \cs{dbsave} \marg{attr} \marg{data}
+ \cs{dbsave} \marg{attr} \marg{data} \\
+ \cs{dbsave}* \marg{attr} \marg{data}
\end{syntax}
- \cs{dbsave} 用来存储数据,只能在 \env{item} 环境中使用。
+ \cs{dbsave} 用来存储数据,只能在 \env{item} 环境中使用。使用 \cs{dbsave*} 存
+ 储的数据会被 \cs{exp_not:n} 包裹。
\end{function}
-\begin{function}[EXP]{\dbuse}
+\changes{1.2}{2022-01-08}{Update macro}{make \cs{dbuse} fully-expandable}
+\begin{function}[added=2022-01-05, updated=2022-01-08, EXP]{\dbuse}
\begin{syntax}
- \cs{dbuse} \marg{attr}
+ \cs{dbuse} \marg{attr}
\end{syntax}
- \cs{dbuse} 用来使用数据,只能在 \opt{item-code} 选项中使用。\cs{dbuse} 是可
+ \cs{dbuse} 用来展示数据,只能在 \opt{item-code} 选项中使用。\cs{dbuse} 是可
展开的。
\end{function}
\subsection{条件判别式}
-\begin{function}[EXP]{\dbIfEmptyT, \dbIfEmptyF, \dbIfEmptyTF}
+\begin{function}[added=2022-01-05, EXP]{\dbIfEmptyT, \dbIfEmptyF, \dbIfEmptyTF}
\begin{syntax}
\cs{dbIfEmptyTF} \marg{true code} \marg{false code} \\
\cs{dbIfEmptyT} \marg{true code} \\
@@ -599,33 +749,68 @@
}
\end{verbatim}
-\subsection{特殊命令}
-
-\pkg{dbshow} 定义了一些特殊的命令,会根据语境展开为不同的内容。
-
-\DescribeMacro{\dbval}当前属性的值,只能在 \cs{dbNewConditional} 中使用
+\changes{1.2}{2022-01-08}{Remove macros}{\cs{dbItemIfEmpty(TF)}, \cs{dbClistItemIfEmpty(TF)}}
-\DescribeMacro{\dbDatabase}数据库名称
+\subsection{表达式函数}
-\DescribeMacro{\dbFilterName}过滤器名称
-
-\DescribeMacro{\dbFilterInfo}过滤器信息
-
-\DescribeMacro{\dbIndex}原始数据索引,等同于 |\dbuse{id}| 但是 \cs{dbuse} 是不可展开的
-
-\DescribeMacro{\dbarabic}用数字表示的查询集数据计数
-
-\DescribeMacro{\dbalph}用小写字母表示的查询集数据计数
+\changes{1.3}{2022-01-10}{Add macros}{expression function aliases}
+\begin{function}[added=2022-01-10, EXP]{
+ \dbIntAbs, \dbIntSign, \dbIntDivRound, \dbIntDivTruncate, \dbIntMax,
+ \dbIntMin, \dbIntMod, \dbFpSign,
+}
+ \begin{syntax}
+ \cs{dbIntAbs} \Arg{intexpr}
+ \cs{dbIntSign} \Arg{intexpr}
+ \cs{dbIntDivRound} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntDivTruncate} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMax} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMin} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMod} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbFpSign} \Arg{fpexpr}
+ \end{syntax}
+ \cs{dbIntAbs} 等同于 \cs{int_abs:n} \\
+ \cs{dbIntSign} 等同于 \cs{int_sign:n} \\
+ \cs{dbIntDivRound} 等同于 \cs{int_div_round:nn} \\
+ \cs{dbIntDivTruncate} 等同于 \cs{int_div_truncate:nn} \\
+ \cs{dbIntMax} 等同于 \cs{int_max:nn} \\
+ \cs{dbIntMin} 等同于 \cs{int_min:nn} \\
+ \cs{dbIntMod} 等同于 \cs{int_mod:nn} \\
+ \cs{dbFpSign} 等同于 \cs{fp_sign:n} \\
+ 详细的文档见 \pkg{interface3} \\
+\end{function}
-\DescribeMacro{\dbAlph}用小写字母表示的查询集数据计数
+\subsection{特殊命令}
-\DescribeMacro{\dbroman}用小写罗马数字表示的查询集数据计数
+\pkg{dbshow} 定义了一些特殊的命令,会根据语境展开为不同的内容。
-\DescribeMacro{\dbRoman}用大写罗马数字表示的查询集数据计数
+\changes{1.1}{2022-01-05}{Add macro}{
+ \cs{dbarabic}, \cs{dbalph}, \cs{dbAlph}, \cs{dbroman},
+ \cs{dbRoman}
+}
+\changes{1.1}{2022-01-06}{Fix bug}{\cs{dbIndex} not defined}
+\begin{function}[added=2022-01-05, EXP]{
+ \dbval, \dbDatabase, \dbFilterName, \dbFilterInfo,
+ \dbIndex, \dbarabic, \dbalph, \dbAlph, \dbroman, \dbRoman
+}
+\begin{tblr}{ll}
+ \cs{dbval} & 当前属性的值 \\
+ \cs{dbDatabase} & 数据库名称 \\
+ \cs{dbFilterName} & 当前样式过滤器的名称 \\
+ \cs{dbFilterInfo} & 当前样式过滤器的相关信息 \\
+ \cs{dbIndex} & 数据索引,等同于 \cs{dbuse}|{id}| \\
+ \cs{dbarabic} & 用数字表示的查询集数据计数 \\
+ \cs{dbalph} & 用小写字母表示的查询集数据计数 \\
+ \cs{dbAlph} & 用大写字母表示的查询集数据计数 \\
+ \cs{dbroman} & 用小写罗马字母表示的查询集数据计数 \\
+ \cs{dbroman} & 用大写罗马字母表示的查询集数据计数 \\
+ \end{tblr}
+\end{function}
\section{错题本示例}
见第 \ref{sec:example} 节。
+\changes{1.1}{2022-01-07}{Update doc}{improve example}
+
\title{
Package \pkg{dbshow} \version%
\protect\footnote{%
@@ -653,13 +838,26 @@ The package provides four core functions: data storage and display, data
filtering, data sorting and data display. All data is saved once and then you
can display these data with custom filters, orders and styles.
+\changes{1.2}{2022-01-09}{Add doc}{descripton for expansion}
+\begin{itemize}
+ \item Macros with a $\star$ are fully-expandable;
+ \item Macros with a \ding{73} are restricted-expandable;
+ \item Macros without appending a special symbol are nonexpandable;
+ \item Options with a $\star$ \textit{do not} affect the expandability of
+ related macros;
+ \item Options with a \ding{73} affect the expandability of related macros
+ according to its value;
+ \item Options without appending a special symbol make the related macros
+ nonexpandable.
+\end{itemize}
+
\subsection{Data Types}
The package constructs 6 types based on the internal typed of \pkg{expl3}:
\begin{Description}[\texttt{clist}]
\item[\texttt{date}]
- date based on \pkg{datetime2} in iso format, supports comparison,
- sorting (converting to |str|), default \cs{Today}.
+ date saved in |yyyy/mm/dd| format, supports comparison, sorting
+ (converting to string), default \cs{dbtoday}.
\item[\texttt{str}]
string,supports regex match and sorting, default empty.
\item[\texttt{tl}]
@@ -672,8 +870,15 @@ The package constructs 6 types based on the internal typed of \pkg{expl3}:
comma list, default empty.
\end{Description}
+\changes{1.3}{2022-01-08}{Remove dependency}{\pkg{datatime2}}
+All types are internal types of \pkg{expl3} except |date| type, which provides
+by \pkg{dbshow} itself and supports converting to integer and printing with
+style.
+
\subsection{Comparison to \pkg{datatool}}
+\changes{1.2}{2022-01-07}{Add doc}{add comparison to \pkg{datatool}}
+
\pkg{dbshow} and \pkg{datatool} implement the same core functions. But
\pkg{dbshow} is based on \pkg{expl3} and it supports string regex and
multi-level sorting. \pkg{dbshow} tries to divide style from the contents
@@ -692,7 +897,7 @@ persistence.
\subsection{Create, Display and Clear Database}
-\begin{function}{\dbNewDatabase, \dbNewDatabase*}
+\begin{function}[added=2022-01-05]{\dbNewDatabase, \dbNewDatabase*}
\begin{syntax}
\cs{dbNewDatabase} \oarg{base database} \marg{database} \{ \\
~~\meta{attr1} = \meta{type spec1}, \\
@@ -713,10 +918,10 @@ Create a new database named \meta{database}, unstarred form provides the optiona
The unstarred form always replace the old definition, while starred form
appends the new options.
-\begin{Syntax}
+\begin{syntax}
\meta{attr} = \meta{type} \\
- \meta{attr} = \meta{type}\textbar\meta{default}
-\end{Syntax}
+ \meta{attr} = \meta{type}\orbar\meta{default}
+\end{syntax}
The first form defines the \meta{attr} as \meta{type}, and the second also
sets the default value.
@@ -736,7 +941,7 @@ The example below define a database named |ques|.
}
\end{verbatim}
-\begin{function}{\dbshow}
+\begin{function}[added=2022-01-05]{\dbshow}
\begin{syntax}
\cs{dbshow} \marg{style} \marg{database}
\end{syntax}
@@ -744,36 +949,45 @@ The example below define a database named |ques|.
Show the \meta{database} with \meta{style}.
\end{function}
-\begin{function}{\dbclear}
+\changes{1.2}{2022-01-07}{Add macro}{\cs{dbclear}}
+\begin{function}[added=2022-01-07]{\dbclear}
\begin{syntax}
\cs{dbclear} \marg{database}
\end{syntax}
Clear the content of \meta{database}.
-
\end{function}
\subsection{\cs{dbNewStyle} and Style Options}
-\begin{function}{\dbNewStyle}
+\begin{function}[added=2022-01-05]{\dbNewStyle}
\begin{syntax}
\cs{dbNewStyle} \oarg{base styles} \marg{style} \marg{database} \marg{opts}
\end{syntax}
-Define a new \meta{style} that binds to \meta{database}. The style can inherit
-from a list of \meta{base styles} such as
-|\dbNewStyle[base1, base2]{new-style}{ques}{}|.
+ Define a new \meta{style} that binds to \meta{database}. The style can
+ inherit from a list of \meta{base styles} such as
+ |\dbNewStyle[base1, base2]{new-style}{ques}{}|.
\end{function}
\subsubsection{General Options}
-\begin{option}{opt=filter, desc={= \meta{filter}}, init=-none-}
+\begin{option}[added=2022-01-05]{filter}
+ \begin{syntax}
+ filter = <filter>
+ \end{syntax}
+
Set the \meta{filter} defined by \cs{dbCombineFilters}.
\end{option}
-\begin{option}{opt=raw-filter, desc={= \meta{cond combination}}}
- Set anonymous with defined conditionals. Two examples below perform the same
- function.
+\changes{1.1}{2022-01-06}{Add option}{\opt{raw-filter}}
+\begin{option}[added=2022-01-06]{raw-filter}
+ \begin{syntax}
+ raw-filter = <conditional expression>
+ \end{syntax}
+
+ Set anonymous with conditionals defined by \cs{dbNewConditional}. Two
+ filters shows in the code below have the same meaning.
\end{option}
\begin{verbatim}
@@ -792,10 +1006,12 @@ from a list of \meta{base styles} such as
\dbNewStyle{style}{db}{filter=filter}
\end{verbatim}
-\begin{option}{
- opt = sort,
- desc = {= \{ \meta{attr spec1}, \meta{attr spec2}, \ldots{} \}},
-}
+\changes{1.2}{2022-01-08}{Fix bug}{string sorting bug}
+\begin{option}[added=2022-01-05]{sort}
+ \begin{syntax}
+ sort = \{ <attr spec1>, <attr spec2>, \ldots{} \}
+ \end{syntax}
+
Set sorting rules. Attributes of type |str, date, int, fp| is supported to
sort. Multi-level sort is allowed. \meta{attr} represents for ascending
order, and \meta{attr}* represents for descending order. The example below
@@ -816,31 +1032,40 @@ from a list of \meta{base styles} such as
}
\end{verbatim}
-\begin{option}{
- opt = item-code,
- desc = {= \meta{item code}}
-}
+\begin{option}[added=2022-01-05, rEXP]{item-code}
+ \begin{syntax}
+ item-code = <code>
+ \end{syntax}
+
Set the code that show a single record. You can use \cs{dbuse} to display
certian attribute.
\end{option}
-\begin{option}{
- opt = {\meta{attr}/sep},
- desc = {= \meta{sep spec}},
- init = {,~\~}
-}
-\begin{Syntax}
- \meta{attr}/separator = \meta{separator} \\
- \meta{attr}/separator = \{ \\
- ~~\meta{separator between two}, \\
- ~~\meta{separator between more than two}, \\
- ~~\meta{separator between final two} \\
- \}
-\end{Syntax}
-
- Only for attributes of type |clist|. Set the separator between clist items.
- The first form accept one arguments and set the seperator as \meta{sep}. The
- second form is more complicated, the following documentation is quoted from
+\changes{1.3}{2022-01-09}{Update option}{\opt{<attr>/sep}}
+\begin{option}[added=2022-01-05, updated=2022-01-08, rEXP]{<attr>/sep}
+ \begin{syntax}
+ <attr>/sep = <separator> \\
+ <attr>/sep = \{ \\
+ ~~\meta{separator between two}, \\
+ ~~\meta{separator between more than two}, \\
+ ~~\meta{separator between final two} \\
+ \} \\
+ <attr>/sep = \{ \\
+ ~~\meta{separator before year}, \\
+ ~~\meta{separator between year and month}, \\
+ ~~\meta{separator between month and day}, \\
+ ~~\meta{separator after day} \\
+ \} \\
+ \end{syntax}
+
+ Only for attributes of type |clist| or |date|. Set the separator between
+ items. If the argument is an one-item comma list, all separators are set to
+ \meta{separator} but \meta{separator before year} and \meta{separator after
+ day} is set empty.
+\end{option}
+
+ If the argument is a comma list of 3 items, it is used to set the separator
+ between items of the comma list. Following documentation is quoted from
\pkg{interface3}:
\begin{quote}
If the comma list has more than two items, the \meta{separator between
@@ -851,7 +1076,39 @@ from a list of \meta{base styles} such as
it is placed in the input stream, and a comma list with no items produces
no output.
\end{quote}
+ For attributes of type |clist|, incorrect number (numbers exclude 1 and 3)
+ of items of the argument will raise an error.
+
+\begin{verbatim}
+ % clist-attr is an attribute of database db
+ % suppose the val of clist-attr is { 1, 2, 3 }
+ \dbNewStyle{clist-sep}{db}{
+ clist-attr/sep = { ,~ }, % print 1, 2, 3
+ clist-attr/sep = { {,~}, {,~}, {and~} } % print 1, 2 and 3
+ }
+\end{verbatim}
+
+ If the argument is a comma list of 4 items, it is used to set the separators
+ of the date. For attributes of type |date|, incorrect number (numbers
+ exclude 1 and 4) will raise an error.
+
+\begin{verbatim}
+ % date-attr is an attribute of database db
+ % suppose the val of date-attr is 2022/01/01
+ \dbNewStyle{date-sep}{db}{
+ date-attr/sep = -, % print 2022-01-01
+ date-attr/sep = { |, -, -, | } % print |2022-01-01|
+ }
+\end{verbatim}
+
+\changes{1.3}{2022-01-08}{Add option}{\opt{<attr>/zfill}}
+\begin{option}[added=2022-01-08, EXP]{<attr>/zfill}
+ \begin{syntax}
+ <attr>/zfill = <\TTF>
+ \end{syntax}
+ Only for attributes of type |date|. Control whether to fill zero on the left
+ of the month or day.
\end{option}
\subsubsection{Decorators}
@@ -889,69 +1146,89 @@ decorators.
}
\end{verbatim}
-\begin{option}{
- opt = before-code,
- desc = {= \meta{before code}}
-}
- Set the \meta{before code} that is executed before displaying the database.
+\changes{1.3}{2022-01-08}{Add option}{\opt{<attr>/wrapper}}
+\begin{option}[added=2022-01-08, rEXP]{<attr>/wrapper}
+ \begin{syntax}
+ <attr>/wrapper = <control sequence>
+ \end{syntax}
+
+ Only for attributes of type |date|. Output of \cs{dbuse}\marg{date attr}
+ will be \meta{control sequence}\marg{date}.
\end{option}
-\begin{option}{
- opt = after-code,
- desc = {= \meta{after code}}
-}
- Set the \meta{after code} that is executed after displaying the database.
+\begin{option}[added=2022-01-05, rEXP]{before-code}
+ \begin{syntax}
+ before-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed \enbefore displaying the database.
\end{option}
-\begin{option}{
- opt = record-before-code,
- desc = {= \meta{before code}}
-}
- Set the \meta{before code} that is executed before displaying the record.
+\begin{option}[added=2022-01-05, rEXP]{after-code}
+ \begin{syntax}
+ after-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed \enafter displaying the database.
\end{option}
-\begin{option}{
- opt = record-after-code,
- desc = {= \meta{after code}}
-}
- Set the \meta{after code} that is executed after displaying the record.
+\changes{1.2}{2022-01-08}{Add options}{\opt{record-before-code},
+\opt{record-after-code}}
+\begin{option}[added=2022-01-05, rEXP]{record-before-code}
+ \begin{syntax}
+ record-before-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed \enbefore displaying a record.
\end{option}
-\begin{option}{
- opt = {\meta{attr}/before-code},
- desc = {= \meta{before code}}
-}
- Set the \meta{before code} that is executed by \cs{dbuse} before displaying
+\begin{option}[added=2022-01-05, rEXP]{record-after-code}
+ \begin{syntax}
+ record-after-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed \enafter displaying the record.
+\end{option}
+
+\begin{option}[added=2022-01-05, rEXP]{<attr>/before-code}
+ \begin{syntax}
+ <attr>/before-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed by \cs{dbuse} \enbefore displaying
certain attribute.
\end{option}
-\begin{option}{
- opt = {\meta{attr}/after-code},
- desc = {= \meta{after code}}
-}
- Set the \meta{after code} that is executed by \cs{dbuse} after displaying
+\begin{option}[added=2022-01-05, rEXP]{<attr>/after-code}
+ \begin{syntax}
+ <attr>/after-code = <code>
+ \end{syntax}
+
+ Set the \meta{code} that is executed by \cs{dbuse} \enafter displaying
certain attribute.
\end{option}
-\begin{option}{
- opt = {\meta{attr}/item-before-code},
- desc = {= \meta{before code}}
-}
- Only for attributes of type |clist|. Set the \meta{after code} that is
- excuted before displaying the item of the comma list.
+\begin{option}[added=2022-01-05, rEXP]{<attr>/item-before-code}
+ \begin{syntax}
+ <attr>/item-before-code = <code>
+ \end{syntax}
+
+ Only for attributes of type |clist|. Set the \meta{code} that is excuted
+ \enbefore displaying the item of the comma list.
\end{option}
-\begin{option}{
- opt = {\meta{attr}/item-after-code},
- desc = {= \meta{after code}}
-}
- Only for attributes of type |clist|. Set the \meta{after code} that is
- excuted after displaying the item of the comma list.
+\begin{option}[added=2022-01-05, rEXP]{<attr>/item-after-code}
+ \begin{syntax}
+ <attr>/item-after-code = <code>
+ \end{syntax}
+
+ Only for attributes of type |clist|. Set the \meta{code} that is excuted
+ \enafter displaying the item of the comma list.
\end{option}
\subsection{Use \cs{dbNewReviewPoints} to Define Review Points}
-\begin{function}{\dbNewReviewPoints}
+\begin{function}[added=2022-01-05]{\dbNewReviewPoints}
\begin{syntax}
\cs{dbNewReviewPoints} \marg{name} \marg{points}
\end{syntax}
@@ -960,6 +1237,8 @@ decorators.
something. \meta{points} is a list of integers. Suppose you record the date
when you did not answer correctly and you plan to review every 2, 5 and 15
days. The following code give what you want.
+\end{function}
+
\begin{verbatim}
\dbNewReviewPoints{review-point}{2, 5, 15} % define points
\begin{dbFilters}
@@ -968,71 +1247,78 @@ decorators.
\end{dbFilters}
\dbNewStyle{review-style}{ques}{filter=filter1} % define style
\end{verbatim}
-\end{function}
\subsection{Define Filters inside \env{dbFilters} Environment}
-\noindent\DescribeEnv{dbFilters}
-\begin{Syntax}*
- |\begin{dbFilters}|\marg{database} \\
- ~~\meta{code}
- |\end{dbFilters}| \\
-\end{Syntax}
+\begin{environment}[added=2022-01-05]{dbFilters}
+ \begin{syntax}
+ |\begin{dbFilters}|\marg{database} \\
+ ~~\meta{code}
+ |\end{dbFilters}| \\
+ \end{syntax}
-Filters are defined inside \env{dbFilters} environment, inside which,
-\cs{dbNewConditional} is defined to declare conditionals and
-\cs{dbCombineConditionals} is defined to combine conditionals. Filters are
-independent in different databases, which means the same name of filters is
-allowed in different databases.
+ Filters are defined inside \env{dbFilters} environment, inside which,
+ \cs{dbNewConditional} is defined to declare conditionals and
+ \cs{dbCombineConditionals} is defined to combine conditionals. Filters are
+ independent in different databases, which means the same name of filters is
+ allowed in different databases.
+\end{environment}
-\begin{function}{\dbNewConditional, \dbNewConditional*}
+\begin{function}[added=2022-01-05, updated=2022-01-08]{\dbNewConditional, \dbNewConditional*}
\begin{syntax}
\cs{dbNewConditional} \marg{name} \marg{attr} \marg{cond spec} \\
\cs{dbNewConditional}* \marg{name} \marg{attr} \marg{cond spec} \\[2pt]
- \cs{dbNewConditional} \marg{name} \marg{int/fp attr} \marg{relation} \\
- \cs{dbNewConditional}* \marg{name} \marg{int/fp attr} \marg{relation} \\
+ \cs{dbNewConditional} \marg{name} \marg{int/fp attr} \marg{expr} \\
+ \cs{dbNewConditional}* \marg{name} \marg{int/fp attr} \marg{expr} \\
\cs{dbNewConditional} \marg{name} \marg{str/tl attr} \marg{regex expr} \\
\cs{dbNewConditional}* \marg{name} \marg{str/tl attr} \marg{regex expr} \\
\cs{dbNewConditional} \marg{name} \marg{clist attr} \marg{val list} \\
\cs{dbNewConditional}* \marg{name} \marg{clist attr} \marg{val list} \\
- \cs{dbNewConditional} \marg{name} \marg{date attr} \{\meta{review points}\textbar\meta{date}\} \\
- \cs{dbNewConditional}* \marg{name} \marg{date attr} \marg{relation}
+ \cs{dbNewConditional} \marg{name} \marg{date attr} \marg{expr}
+ \cs{dbNewConditional}* \marg{name} \marg{date attr} \{\meta{review points}\orbar\meta{date}\} \\
\end{syntax}
Define the conditional named \meta{name} that binds to \meta{attr}. \cs{dbval}
is replaced with the real value of the attribute inside the \meta{cond spec}.
\end{function}
-For attributes of type |int| and |fp|, two forms have the same definition.
-\meta{relation} can be a single relation formula, such as |\dbval > 3|, or the
-combination of several relation formulas, such as |\dbval > 3 && \dbval < 10.2|.
-Supported operators are |<, >, =, ==, !=, >=, <=, !|.
+ \changes{1.3}{2022-01-10}{Update doc}{truncated division}
+ For attributes of type |int| and |fp|, \meta{expr} is passed to
+ \cs{int_compare:nTF} or \cs{fp_compare:nTF}.
+ \begin{note}
+ Division using |/| rounds to the closest integer. Use \cs{dbIntDivTruncate} to rounds
+ the result toward 0.
+ \end{note}
+
+ For attribute of type |str| and |tl|, unstarred form matches any part while
+ starred form matches the whole part with the \meta{regex expr}.
-For attribute of type |str| and |tl|, unstarred form matches any part while
-starred form matches the whole part with the \meta{regex expr}.
\begin{verbatim}
- \dbNewConditional{cond1}{str-attr}{abc} % match abc, abcd, 1abc, =abc=, etc
+ \dbNewConditional {cond1}{str-attr}{abc} % match abc, abcd, 1abc, =abc=, etc
\dbNewConditional*{cond2}{str-attr}{abc} % only match abc
\end{verbatim}
-For attributes of type |clist|, the conditional defined by unstarred form is
-true if any item of \meta{val list} is in the comma list. While the
-conditional defined by starred form is true only if every item of \meta{val
-list} is in the comma list. As is showed below, for |cond1|, |a| is in
-|{a, b, d}| so |cond1| is true. While |c| is not in |{a, b, d}| so |cond2| is
-false.
+ For attributes of type |clist|, the conditional defined by unstarred form is
+ true if any item of \meta{val list} is in the comma list. While the
+ conditional defined by starred form is true only if every item of \meta{val
+ list} is in the comma list. As is showed below, for |cond1|, |a| is in
+ |{a, b, d}| so |cond1| is true. While |c| is not in |{a, b, d}| so |cond2|
+ is false.
\begin{verbatim}
- \dbNewConditional{cond1}{clist-attr}{a, b, c} % {a, b, d} -> true
+ \dbNewConditional {cond1}{clist-attr}{a, b, c} % {a, b, d} -> true
\dbNewConditional*{cond2}{clist-attr}{a, b, c} % {a, b, d} -> false
\end{verbatim}
-For attributes of type |date|, unstarred form uses \meta{review points} to
-define the conditional and \meta{date} is the date to be compared. The starred
-form define the conditional with \textbf{single} relation formula. Supported
-operators are |<, >, =, ==, !=, >=, <=|.
+ \changes{1.3}{2022-01-08}{Update logic}{swap definition of starred and
+ unstarred conditionals of date}
+ For attributes of type |date|, unstarred form replace each date with a
+ integer representing for the days between \meta{date} and
+ \textit{1971/01/01}, and the result is passed to \cs{int_compare:nTF}.
+ Starred form defines the conditional with review points defined by
+ \cs{dbNewRdbNewReviewPoints} and \meta{date} is the date to be compared.
-\begin{function}{\dbCombineConditionals}
+\begin{function}[added=2022-01-05]{\dbCombineConditionals}
\begin{syntax}
\cs{dbCombineConditionals} \marg{name} \marg{cond combination} \oarg{info}
\end{syntax}
@@ -1046,43 +1332,49 @@ operators are |<, >, =, ==, !=, >=, <=|.
\subsection{Store Data with \env{dbitem} Environment}
-\noindent\DescribeEnv{dbitem}
-\begin{Syntax}*
- |\begin{dbitem}|\marg{database}[ \\
- ~~\meta{attr1} = \meta{val1}, \\
- ~~\meta{attr2} = \meta{val2}, \\
- ~~\ldots{} \\
- ] \\
- ~~\meta{code} \\
- |\end{dbitem}|
-\end{Syntax}
-
-The data are stored with \env{dbitem} environment in two ways. Smaller data
-can be stored in the option list and the bigger data can be stored by
-\cs{dbsave}, which will suppress the value set by the option list. An example
-code is showned below.
+\begin{environment}[added=2022-01-05]{dbitem}
+ \begin{syntax}
+ |\begin{dbitem}|\marg{database}[ \\
+ ~~\meta{attr1} = \meta{val1}, \\
+ ~~\meta{attr2} = \meta{val2}, \\
+ ~~\ldots{} \\
+ ] \\
+ ~~\meta{code} \\
+ |\end{dbitem}|
+ \end{syntax}
+
+ The data are stored with \env{dbitem} environment in two ways. Smaller data
+ can be stored in the option list and the bigger data can be stored by
+ \cs{dbsave}, which will suppress the value set by the option list. An
+ example code is showned below.
+\end{environment}
\begin{verbatim}
\begin{dbitem}[date=2022-01-01, info=test]
\dbsave{question}{This is a test question.}
- \dbsave{answer}{This is the correct answer of the question.}
+ \dbsave{answer} {This is a test answer.}
\end{dbitem}
\end{verbatim}
\subsection{\cs{dbsave} and \cs{dbuse}}
-\begin{function}{\dbsave}
+\changes{1.3}{2022-01-08}{Add macro}{\cs{dbsave*}}
+\begin{function}[added=2022-01-05, updated=2022-01-08]{\dbsave, \dbsave*}
\begin{syntax}
- \cs{dbsave} \marg{attr} \marg{data}
+ \cs{dbsave} \marg{attr} \marg{data} \\
+ \cs{dbsave}* \marg{attr} \marg{data}
\end{syntax}
\cs{dbsave} save the \meta{data} to \meta{attr} of current record.
\cs{dbsave} can be used only inside the \env{dbitem} environment.
+ \meta{data} stored by \cs{dbsave*} is wrapped with \cs{exp_not:n} while
+ \meta{data} stored by \cs{dbsave} keeps the same.
\end{function}
-\begin{function}[EXP]{\dbuse}
+\changes{1.2}{2022-01-08}{Update macro}{make \cs{dbuse} fully-expandable}
+\begin{function}[added=2022-01-05, updated=2022-01-08, EXP]{\dbuse}
\begin{syntax}
- \cs{dbuse} \marg{attr}
+ \cs{dbuse} \marg{attr}
\end{syntax}
Display the value of \meta{attr} of current record. \cs{dbuse} is
@@ -1091,7 +1383,7 @@ code is showned below.
\subsection{Conditionals}
-\begin{function}[EXP]{\dbIfEmptyT, \dbIfEmptyF, \dbIfEmptyTF}
+\begin{function}[added=2022-01-05, EXP]{\dbIfEmptyT, \dbIfEmptyF, \dbIfEmptyTF}
\begin{syntax}
\cs{dbIfEmptyTF} \marg{true code} \marg{false code} \\
\cs{dbIfEmptyT} \marg{true code} \\
@@ -1110,43 +1402,77 @@ code is showned below.
}
\end{verbatim}
-\subsection{Special Macros}
-
-Some special macros are defined to expand to different contents according to context.
-
-\DescribeMacro{\dbval} Attribute value, only accessible in \cs{dbNewConditional}.
-
-\DescribeMacro{\dbDatabase} Database name.
-
-\DescribeMacro{\dbFilterName} Filter name.
+\changes{1.2}{2022-01-08}{Remove macros}{\cs{dbItemIfEmpty(TF)}, \cs{dbClistItemIfEmpty(TF)}}
-\DescribeMacro{\dbFilterInfo} Filter information.
+\subsection{Expression Functions}
-\DescribeMacro{\dbIndex} Index of original records, which is equal to |\rvuse{id}| but \cs{rvuse} is nonexpandable.
-
-
-\DescribeMacro{\dbarabic} Show the counter of query set as digits.
-
-\DescribeMacro{\dbalph} Show the counter of query set as lowercase letters.
+\changes{1.3}{2022-01-10}{Add macros}{expression function aliases}
+\begin{function}[added=2022-01-10, EXP]{
+ \dbIntAbs, \dbIntSign, \dbIntDivRound, \dbIntDivTruncate, \dbIntMax,
+ \dbIntMin, \dbIntMod, \dbFpSign,
+}
+ \begin{syntax}
+ \cs{dbIntAbs} \Arg{intexpr}
+ \cs{dbIntSign} \Arg{intexpr}
+ \cs{dbIntDivRound} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntDivTruncate} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMax} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMin} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbIntMod} \Arg{intexpr_1} \marg{intexpr_2}
+ \cs{dbFpSign} \Arg{fpexpr}
+ \end{syntax}
+ \cs{dbIntAbs} is identical to \cs{int_abs:n} \\
+ \cs{dbIntSign} is identical to \cs{int_sign:n} \\
+ \cs{dbIntDivRound} is identical to \cs{int_div_round:nn} \\
+ \cs{dbIntDivTruncate} is identical to \cs{int_div_truncate:nn} \\
+ \cs{dbIntMax} is identical to \cs{int_max:nn} \\
+ \cs{dbIntMin} is identical to \cs{int_min:nn} \\
+ \cs{dbIntMod} is identical to \cs{int_mod:nn} \\
+ \cs{dbFpSign} is identical to \cs{fp_sign:n} \\
+ Detailed documentation see \pkg{interface3} \\
+\end{function}
-\DescribeMacro{\dbAlph} Show the counter of query set as uppercase letters.
+\subsection{Special Macros}
-\DescribeMacro{\dbroman} Show the counter of query set as roman numerals.
+Some special macros are defined to expand to different contents according to context.
-\DescribeMacro{\dbRoman} Show the counter of query set as Roman numerals.
+\changes{1.1}{2022-01-05}{Add macro}{
+ \cs{dbarabic}, \cs{dbalph}, \cs{dbAlph}, \cs{dbroman},
+ \cs{dbRoman}
+}
+\changes{1.1}{2022-01-06}{Fix bug}{\cs{dbIndex} not defined}
+\begin{function}[added=2022-01-05, EXP]{
+ \dbval, \dbDatabase, \dbFilterName, \dbFilterInfo,
+ \dbIndex, \dbarabic, \dbalph, \dbAlph, \dbroman, \dbRoman
+}
+\begin{tblr}{ll}
+ \cs{dbval} & Attribute value, only according in \cs{dbNewConditional}. \\
+ \cs{dbDatabase} & Database name. \\
+ \cs{dbFilterName} & Filter name. \\
+ \cs{dbFilterInfo} & Filter information. \\
+ \cs{dbIndex} & Record index, identical to \cs{dbuse}|{id}| \\
+ \cs{dbarabic} & Show the counter of query set as digits. \\
+ \cs{dbalph} & Show the counter of query set as lowercase letters. \\
+ \cs{dbAlph} & Show the counter of query set as uppercase letters. \\
+ \cs{dbroman} & Show the counter of query set as lowercase roman numerals. \\
+ \cs{dbroman} & Show the counter of query set as uppercase roman numerals. \\
+ \end{tblr}
+\end{function}
\section{Example of Flaw Sweeper Template}
\label{sec:example}
+\changes{1.1}{2022-01-07}{Update doc}{improve example}
+
\begin{tcblisting}{enhanced jigsaw,lower separated=false,
-leftlower=0pt,rightlower=0pt,
-colframe=red!50!black,colback=yellow!10!white,
-listing options={style=tcblatex,texcsstyle=*\color{red!70!black}},
-listing and comment,
-pdf comment,freeze pdf,
-compilable listing,
-breakable,
-run pdflatex
+ leftlower=0pt,rightlower=0pt,
+ colframe=red!50!black,colback=yellow!10!white,
+ listing options={style=tcblatex,texcsstyle=*\color{red!70!black}},
+ listing and comment,
+ pdf comment,freeze pdf,
+ compilable listing,
+ breakable,
+ run pdflatex
}
\documentclass{article}
\usepackage{amsmath, physics}
@@ -1202,7 +1528,8 @@ run pdflatex
\begin{dbFilters}{ques-book}
\dbNewConditional{hard}{labels}{hard}
\dbNewConditional{bad}{count}{\dbval > 1}
- \dbNewConditional{review}{date}{review|2022-01-07}
+ \dbNewConditional*{review}{date}{review|2022/01/07}
+ \dbNewConditional{after}{date}{\dbval > 2022/01/02}
\end{dbFilters}
% show all questions with hyperlink to answers
@@ -1260,23 +1587,29 @@ run pdflatex
labels/sep = /,
}
-% show all hard questions that have answered incorrectly for more than one
-% time with hyperlink to answers
+% show all hard questions that have been answered incorrectly for more than
+% one time with hyperlink to answers
\dbNewStyle[hard]{bad}{ques-book}{
before-code = {\section{Bad Questions}},
raw-filter = {bad && hard},
}
-% show all questions that plan to be reviewed on 2022-01-07 with hyperlink to
+% show all questions that plan to be reviewed on 2022/01/07 with hyperlink to
% answers
\dbNewStyle[hard]{review}{ques-book}{
before-code = {\section{Questions to be Reviewed}},
raw-filter = {review},
}
+% show all questions that is record after 2022/01/02 with hyperlink to answers
+\dbNewStyle[hard]{after}{ques-book}{
+ before-code = {\section{Questions after 2022/01/02}},
+ raw-filter = {after},
+}
\AtEndDocument{
\dbshow{review}{ques-book}
\dbshow{hard}{ques-book}
\dbshow{bad}{ques-book}
+ \dbshow{after}{ques-book}
\dbshow{ques}{ques-book}
\dbshow{answer}{ques-book}
}
@@ -1284,7 +1617,7 @@ run pdflatex
\begin{document}
\begin{dbitem}{ques-book}[
- date=2022-01-01,
+ date=2022/01/01,
labels={math, equation, easy},
count=2
]
@@ -1297,7 +1630,7 @@ run pdflatex
\end{dbitem}
\begin{dbitem}{ques-book}[
- date=2022-01-01,
+ date=2022/01/01,
labels={math, equation, hard},
count=3
]
@@ -1310,7 +1643,7 @@ run pdflatex
\end{dbitem}
\begin{dbitem}{ques-book}[
- date=2022-01-04,
+ date=2022/01/04,
labels={math, integral, hard},
count=1
]
@@ -1325,35 +1658,5 @@ run pdflatex
\end{document}
\end{tcblisting}
-\section*{Change History}
-\markboth{Change History}{Change History}
-\addcontentsline{toc}{section}{Change History}
-\noindent
-\begin{tblr}{
- colspec = {lll},
- row{1} = {font=\bfseries},
-}
- Date & Ver. & Describe \\
- 2022-01-05 & 1.0 & {
- First version \\
- Add macro: \cmd{\dbarabic}, \cmd{\dbalph}, \cmd{\dbAlph}, \cmd{\dbroman}, \cmd{\dbRoman}
- } \\
- 2022-01-06 & & {
- Fix bug: \cmd{\dbIndex} undefined \\
- Add style option: \opt{raw-filter}
- } \\
- 2022-01-07 & 1.1 & Improve example \\
- 2022-01-07 & 1.1.1 & Add macro: \cmd{\dbclear} \\
- 2022-01-07 & 1.1.2 & Add documentation: comparison to \pkg{datatool} \\
- 2022-01-08 & 1.2 & {
- Fix str sorting bug \\
- Remove macros: \cmd{\dbItemIfEmpty(TF)}, \cmd{\dbClistItemIfEmpty(TF)} \\
- Make \cs{dbuse} expandable \\
- Add option: \opt{record-before-code}, \opt{record-after-code}
- } \\
-\end{tblr}
-
\end{documentation}
-
-
\end{document}
diff --git a/macros/latex/contrib/dbshow/dbshow.sty b/macros/latex/contrib/dbshow/dbshow.sty
index 68ac7b1d35..d60c993db1 100644
--- a/macros/latex/contrib/dbshow/dbshow.sty
+++ b/macros/latex/contrib/dbshow/dbshow.sty
@@ -14,18 +14,15 @@
% The Current Maintainer of this work is Li Changkai.
%
% This work consists of the files dbshow.sty, dbshow-doc.tex.
-\def\myfileversion{v1.2}
-\def\myfiledate{2022/01/08}
+\def\myfileversion{v1.3}
+\def\myfiledate{2022/01/10}
\RequirePackage{expl3, xparse}
-\RequirePackage[calc]{datetime2}
\ProvidesExplPackage
{dbshow}
{\myfiledate}
{\myfileversion}
{database to store and show data}
-\DTMsetdatestyle{iso}
-
\msg_new:nnn { dbshow } { non-existent-database } {
Database~'#1'~does~not~exist~\msg_line_context:.
}
@@ -91,44 +88,31 @@
{ \msg_fatal:nnn { dbshow } { non-existent-type } { #1 } }
}
-% #1 count #2 content
+% #1 valid count #2 real count #3 content
\msg_new:nnn { dbshow } { wrong-seperator } {
- option~sep~should~contain~1~or~3~items~but~only~#1~items~was~given,~
- sep~=~\{#2\}~\msg_line_context:.
+ option~'sep'~should~contain~#1~items~but~only~#2~items~was~given,~
+ sep~=~\{#3\}~\msg_line_context:.
}
-\cs_new:Nn \dbshow_sep_error:nn {
- \msg_error:nnnn { dbshow } { wrong-seperator } { #1 } { #2 }
+% #1 valid count #2 real count #3 content
+\cs_new:Nn \dbshow_sep_error:nnn {
+ \msg_error:nnnnn { dbshow } { wrong-seperator } { #1 } { #2 } { #3 }
}
-\cs_generate_variant:Nn \dbshow_sep_error:nn { xx }
+\cs_generate_variant:Nn \dbshow_sep_error:nnn { xxx }
\msg_new:nnn { dbshow } { unsupported-sort-type } {
unsupported~sort~type:~'#1'~\msg_line_context:.~The~type~should~be~one~of~
\{str,~date,~int,~fp\}.
}
-\clist_const:Nn \dbshow_type_clist { date, str, tl, clist, int, fp }
-
-\prop_const_from_keyval:Nn \dbshow_new_cs_map {
- date = str_clear_new:c,
- str = str_clear_new:c,
- tl = tl_gclear_new:c,
- clist = clist_gclear_new:c,
- int = int_gzero_new:c,
- fp = fp_gzero_new:c
+\msg_new:nnn { dbshow } { invalid-relation } {
+ invalid~relation:~'#1'.
}
-\prop_const_from_keyval:Nn \dbshow_set_cs_map {
- date = str_gset:cn,
- str = str_gset:cn,
- tl = tl_gset:cn,
- clist = clist_gset:cn,
- int = int_gset:cn,
- fp = fp_gset:cn
-}
+\clist_const:Nn \dbshow_type_clist { date, str, tl, clist, int, fp }
\prop_const_from_keyval:Nn \dbshow_default_value {
- date = \Today,
+ date = \dbtoday,
str = ,
tl = ,
clist = ,
@@ -136,15 +120,16 @@
fp = 0
}
-\newcount\l_dbshow_date_diff
-\clist_new:N \l_style_sep_clist
-\tl_new:N \l_style_item_before_code
-\tl_new:N \l_style_item_after_code
\cs_generate_variant:Nn \clist_use:nn { xx }
\cs_generate_variant:Nn \clist_use:nnnn { xxxx }
+\cs_generate_variant:Nn \prop_get:NnN { cVN }
+\cs_generate_variant:Nn \regex_extract_all:nnN { nVN }
+\cs_generate_variant:Nn \regex_split:nnN { nVN }
\prg_generate_conditional_variant:Nnn \str_compare:nNn { VNV } { TF }
\prg_generate_conditional_variant:Nnn \int_compare:nNn { VNV } { TF }
\prg_generate_conditional_variant:Nnn \fp_compare:nNn { VNV } { TF }
+\prg_generate_conditional_variant:Nnn \regex_match:nn { VV } { TF }
+\prg_generate_conditional_variant:Nnn \clist_if_in:Nn { Nx } { TF }
% #1 database #2 attr #3 type #4 default value
\cs_new:Npn \dbshow_process_default_value:w #1|#2=#3|#4\scan_stop {
@@ -214,20 +199,29 @@
% #1 database #2 attr #3 content
\cs_new:Nn \dbshow_save_data:nnn {
\dbshow_check_attr:nn { #1 } { #2 }
- \str_set:Nx \l_tmp_type { \dbshow_get_type:nn { #1 } { #2 } }
- \prop_get:NVN \dbshow_new_cs_map \l_tmp_type \l_tmp_cs_new
- \prop_get:NVN \dbshow_set_cs_map \l_tmp_type \l_tmp_cs_set
- \use:c { \l_tmp_cs_new }
- { g__dbshow_data_#1_#2_\dbshow_get_counter:n { #1 } }
- \use:c { \l_tmp_cs_set }
- { g__dbshow_data_#1_#2_\dbshow_get_counter:n { #1 } } { #3 }
+ \use:c {
+ \str_case_e:nn { \prop_item:cn { g__dbshow_type_map_#1 } { #2 } } {
+ { str } { str_clear_new:c }
+ { tl } { tl_gclear_new:c }
+ { clist } { clist_gclear_new:c }
+ { int } { int_gzero_new:c }
+ { fp } { fp_gzero_new:c }
+ { date } { dbshow_date_gclear_new:n }
+ }
+ } { g__dbshow_data_#1_#2_\int_use:c { g__dbshow_counter_#1 } }
+ \use:c {
+ \str_case_e:nn { \prop_item:cn { g__dbshow_type_map_#1 } { #2 } } {
+ { str } { str_gset:cn }
+ { tl } { tl_gset:cn }
+ { clist } { clist_gset:cn }
+ { int } { int_gset:cn }
+ { fp } { fp_gset:cn }
+ { date } { dbshow_date_gset:nx }
+ }
+ } { g__dbshow_data_#1_#2_\int_use:c { g__dbshow_counter_#1 } } { #3 }
}
\cs_generate_variant:Nn \dbshow_save_data:nnn { nnx }
-\cs_new:Nn \dbshow_brace:n {
- \exp_not:n { { #1 } }
-}
-
% #1 before code tl #2 after code tl #3 item
\cs_new:Nn \dbshow_clist_wrapper:NNn {
\exp_not:n { { #1#3#2 }, }
@@ -249,26 +243,63 @@
{ \clist_item:Nn #2 { 3 } }
}
} {
- \dbshow_sep_error:xx
+ \dbshow_sep_error:xxx
+ { 1~or~3 }
{ \clist_count:N #2 }
- { \clist_use:Nn #2 { , } }
+ { \clist_use:Nn #2 { ,~ } }
}
}
\cs_generate_variant:Nn \dbshow_clist_use:NNNN { cccc }
+% #1 date #2 sep #3 zfill bool
+\cs_new:Nn \dbshow_date_use:nNN {
+ \int_case:nnF { \clist_count:N #2 } {
+ { 1 } {
+ \bool_if:NTF { #3 }
+ { \dbshow_date_use_zfill:nf }
+ { \dbshow_date_use:nf }
+ { #1 }
+ { \clist_item:Nn #2 { 1 } }
+ }
+ { 4 } {
+ \bool_if:NTF { #3 }
+ { \dbshow_date_use_zfill:nffff }
+ { \dbshow_date_use:nffff }
+ { #1 }
+ { \clist_item:Nn #2 { 1 } }
+ { \clist_item:Nn #2 { 2 } }
+ { \clist_item:Nn #2 { 3 } }
+ { \clist_item:Nn #2 { 4 } }
+ }
+ } {
+ \dbshow_sep_error:xxx
+ { 1~or~4 }
+ { \clist_count:N #2 }
+ { \clist_use:Nn #2 { ,~ } }
+ }
+}
+\cs_generate_variant:Nn \dbshow_date_use:nNN { ncc }
+
% #1 database #2 attr #3 index #4 style
\cs_new:Nn \dbshow_use_data:nnnn {
\str_case_e:nn { \prop_item:cn { g__dbshow_type_map_#1 } { #2 } } {
- { date } { \str_use:c { g__dbshow_data_#1_#2_#3 } }
{ str } { \str_use:c { g__dbshow_data_#1_#2_#3 } }
{ tl } { \tl_use:c { g__dbshow_data_#1_#2_#3 } }
{ int } { \int_use:c { g__dbshow_data_#1_#2_#3 } }
{ fp } { \fp_use:c { g__dbshow_data_#1_#2_#3 } }
{ clist } {
\dbshow_clist_use:cccc { g__dbshow_data_#1_#2_#3 }
- { g__dbshow_style_clist_sep_#4_#1_#2 }
- { g__dbshow_style_clist_item_before_#4_#1_#2 }
- { g__dbshow_style_clist_item_after_#4_#1_#2 }
+ { g__dbshow_style_attr_sep_#4_#1_#2 }
+ { g__dbshow_style_attr_item_before_#4_#1_#2 }
+ { g__dbshow_style_attr_item_after_#4_#1_#2 }
+ }
+ { date } {
+ \exp_args:Nnx
+ \tl_use:c { g__dbshow_style_attr_wrapper_#4_#1_#2 } {
+ \dbshow_date_use:ncc { g__dbshow_data_#1_#2_#3 }
+ { g__dbshow_style_attr_sep_#4_#1_#2 }
+ { g__dbshow_style_attr_zfill_#4_#1_#2 }
+ }
}
}
}
@@ -307,9 +338,13 @@
\prop_map_function:cN { g__dbshow_type_map_#1 } \dbshow_set_default:nn
\dbshow_save_data:nnx { #1 } { id } { \dbshow_get_counter:n { #1 } }
\keys_set:nn { dbshow/database/#1 } { #2 }
- % #2 attr #3 content
- \NewDocumentCommand { \dbsave } { m m } {
- \dbshow_save_data:nnn { #1 } { ##1 } { ##2 }
+ % ##1 exp or not ##2 attr ##3 content
+ \NewDocumentCommand { \dbsave } { s m m } {
+ \IfBooleanTF { ##1 } {
+ \dbshow_save_data:nnn { #1 } { ##2 } { \exp_not:n { ##3 } }
+ } {
+ \dbshow_save_data:nnn { #1 } { ##2 } { ##3 }
+ }
}
} { #3 }
@@ -368,43 +403,53 @@
\tl_set:Nn \l_date_tl { #2 }
}
-\cs_new:Nn \dbshow_if_date: {
- \bool_if:NTF \l_star_bool {
- \regex_extract_once:nVNF { \A(.*)([!<>=]+)(.*)\Z }
- \l_dbshow_rela \l_tmpa_seq { }
- \exp_args:Nnx \DTMsavedate{day1}{ \seq_item:Nn \l_tmpa_seq { 2 } }
- \tl_set:Nx \l_rela { \seq_item:Nn \l_tmpa_seq { 3 } }
- \exp_args:Nnx \DTMsavedate{day2}{ \seq_item:Nn \l_tmpa_seq { 4 } }
- \DTMsaveddatediff{day1}{day2}{\l_dbshow_date_diff}% specious blank
- \exp_args:NnV \int_compare:nNnTF
- { \the\l_dbshow_date_diff } \l_rela { 0 }
+\cs_new_protected:Nn \dbshow_if_date: {
+ \int_zero_new:N \l__dbshow_if_tmpa_int
+ \int_zero_new:N \l__dbshow_if_tmpb_int
+ \int_zero_new:N \l__dbshow_if_diff_int
+ \bool_if:NTF \l_star_bool { % review points
+ \exp_after:wN \dbshow_parse_date:w \l_dbshow_rela\dbshow_stop
+ \dbshow_date_clear_new:n { tmp_day1 }
+ \dbshow_date_clear_new:n { tmp_day2 }
+ \dbshow_date_set:nx { tmp_day1 } { \l_date_tl }
+ \dbshow_date_set:nx { tmp_day2 } { \dbval }
+ \dbshow_date_sub:nnN { tmp_day1 } { tmp_day2 } \l__dbshow_if_diff_int
+ \clist_if_in:NxTF \l_point_clist { \int_use:N \l__dbshow_if_diff_int }
{ \dbshow_set_true: }
{ \dbshow_set_false: }
}
- {
- \exp_after:wN \dbshow_parse_date:w \l_dbshow_rela\dbshow_stop
- \exp_args:Nnx \DTMsavedate{day1}{ \l_date_tl }
- \exp_args:Nnx \DTMsavedate{day2}{ \dbval }
- \DTMsaveddatediff{day1}{day2}{\l_dbshow_date_diff}% specious blank
- \clist_if_in:NoTF \l_point_clist { \the\l_dbshow_date_diff }
+ { % rela
+ \tl_set:Nx \l_dbshow_rela { \l_dbshow_rela }
+ \regex_extract_all:nVN { \d{4}/\d+/\d+ } \l_dbshow_rela \l_date_seq
+ \regex_split:nVN { \d{4}/\d+/\d+ } \l_dbshow_rela \l_other_seq
+ \tl_clear:N \l_dbshow_rela
+ \int_set:Nn \l__dbshow_if_tmpa_int { \seq_count:N \l_date_seq }
+ \int_step_inline:nn { \l__dbshow_if_tmpa_int } {
+ \tl_put_right:Nx \l_dbshow_rela { \seq_item:Nn \l_other_seq { ##1 } }
+ \dbshow_date_clear_new:n { rela-tmp }
+ \dbshow_date_set:nx { rela-tmp } { \seq_item:Nn \l_date_seq { ##1 } }
+ \dbshow_date_to_int:nN { rela-tmp } \l__dbshow_if_tmpb_int
+ \tl_put_right:Nx \l_dbshow_rela { \int_use:N \l__dbshow_if_tmpb_int }
+ }
+ \tl_put_right:Nx \l_dbshow_rela {
+ \seq_item:Nn \l_other_seq { \l__dbshow_if_tmpa_int + 1 }
+ }
+ \int_compare:nTF { \l_dbshow_rela }
{ \dbshow_set_true: }
{ \dbshow_set_false: }
}
}
-\cs_generate_variant:Nn \prop_get:NnN { cVN }
-\prg_generate_conditional_variant:Nnn \regex_extract_once:nnN { nVN } { T, F, TF, p }
-\prg_generate_conditional_variant:Nnn \regex_match:nn { VV } { T, F, TF, p }
% #1 database name #2 cond name #3 index
\cs_set:Nn \dbshow_if:nnn {
\tl_set_eq:Nc \l_dbshow_attr { g__dbshow_filter_attr_#1_#2 }
\tl_set_eq:Nc \l_dbshow_rela { g__dbshow_filter_rela_#1_#2 }
+ \prop_get:cVN { g__dbshow_type_map_#1 } \l_dbshow_attr \l_tmp_type
\cs_set_eq:Nc \dbval { g__dbshow_data_#1_\l_dbshow_attr _#3 }
\cs_set:Nn \dbshow_set_true:
{ \bool_gset_true:c { g__dbshow_filter_bool_#1_#2 } }
\cs_set:Nn \dbshow_set_false:
{ \bool_gset_false:c { g__dbshow_filter_bool_#1_#2 } }
- \prop_get:cVN { g__dbshow_type_map_#1 } \l_dbshow_attr \l_tmp_type
\bool_set_eq:Nc \l_star_bool { g__dbshow_cond_star_#1_#2 }
\use:c { dbshow_if_\l_tmp_type : }
}
@@ -468,6 +513,8 @@
\clist_set:cn { g__review_points_#1 } { #2 }
}
+\cs_new:Nn \dbshow_identity:n { #1 }
+
% #1 style name #2 database name #3 attr
\cs_new_protected:Nn \dbshow_new_attr_style:nnn {
\dbshow_check_attr:nn { #2 } { #3 }
@@ -476,17 +523,23 @@
before-code .initial:n = ,
after-code .tl_gset:c = { g__dbshow_style_attr_after_#1_#2_#3 },
after-code .initial:n = ,
+ % for date and clist
+ sep .clist_gset:c = { g__dbshow_style_attr_sep_#1_#2_#3 },
+ % only for clist
+ item-before-code .tl_gset:c = { g__dbshow_style_attr_item_before_#1_#2_#3 },
+ item-before-code .initial:n = ,
+ item-after-code .tl_gset:c = { g__dbshow_style_attr_item_after_#1_#2_#3 },
+ item-after-code .initial:n = ,
+ % only for date
+ zfill .bool_gset:c = { g__dbshow_style_attr_zfill_#1_#2_#3 },
+ zfill .initial:n = true,
+ zfill .default:n = true,
+ wrapper .tl_gset:c = { g__dbshow_style_attr_wrapper_#1_#2_#3 },
+ wrapper .initial:n = { \dbshow_identity:n },
}
- \prop_get:cnN { g__dbshow_type_map_#2 } { #3 } \l_tmp_type
- \str_if_eq:eeT { \l_tmp_type } { clist } {
- \keys_define:nn { dbshow/style/#1/#3 } {
- sep .clist_gset:c = { g__dbshow_style_clist_sep_#1_#2_#3 },
- sep .initial:n = { { ,~ } },
- item-before-code .tl_gset:c = { g__dbshow_style_clist_item_before_#1_#2_#3 },
- item-before-code .initial:n = ,
- item-after-code .tl_gset:c = { g__dbshow_style_clist_item_after_#1_#2_#3 },
- item-after-code .initial:n = ,
- }
+ \str_case_e:nn { \prop_item:cn { g__dbshow_type_map_#2 } { #3 } } {
+ { clist } { \keys_set:nn { dbshow/style/#1/#3 } { sep = { { ,~ } } } }
+ { date } { \keys_set:nn { dbshow/style/#1/#3 } { sep = { { / } } } }
}
}
@@ -553,7 +606,7 @@
\int_zero:N \l_tmpa_int
\cs_set:Nn \dbshow_sort_single: {
\int_incr:N \l_tmpa_int
- \str_set:Nx \l_tmpa_str
+ \str_set:Nx \l_tmpa_str % attr
{ \clist_item:cn { g__dbshow_sort_#3_#1 } { \l_tmpa_int } }
\str_if_in:NnTF \l_tmpa_str { * } {
\exp_after:wN \dbshow_sort_parse_star:w \l_tmpa_str
@@ -564,15 +617,17 @@
}
\exp_args:NnV \dbshow_check_attr:nn { #1 } \l_tmpa_str
- \cs_set_eq:Nc \l_tmpa_tl { g__dbshow_data_#1_\l_tmpa_str _##1 }
- \cs_set_eq:Nc \l_tmpb_tl { g__dbshow_data_#1_\l_tmpa_str _##2 }
-
\prop_get:cVN { g__dbshow_type_map_#1 } \l_tmpa_str \l_tmp_type
\clist_if_in:nVF { str, int, date, fp } \l_tmp_type {
\msg_error:nnx { dbshow } { unsupported-sort-type } { \l_tmp_type }
}
- \str_if_eq:eeT { \l_tmp_type } { date }
- { \str_set:Nn \l_tmp_type { str } }
+
+ \str_if_eq:eeT { \l_tmp_type } { date } {
+ \str_set:Nn \l_tmp_type { str }
+ }
+
+ \cs_set_eq:Nc \l_tmpa_tl { g__dbshow_data_#1_\l_tmpa_str _##1 }
+ \cs_set_eq:Nc \l_tmpb_tl { g__dbshow_data_#1_\l_tmpa_str _##2 }
\cs_set_eq:Nc \dbshow_compare { \l_tmp_type _compare:VNVTF }
\dbshow_compare \l_tmpa_tl \l_op_same \l_tmpb_tl
@@ -660,4 +715,192 @@
{ #1 } { #2 } { g__dbshow_filter_#1_#2 }
}
+\cs_set_eq:NN \dbIntAbs \int_abs:n
+\cs_set_eq:NN \dbIntSign \int_sign:n
+\cs_set_eq:NN \dbIntDivRound \int_div_round:nn
+\cs_set_eq:NN \dbIntDivTruncate \int_div_truncate:nn
+\cs_set_eq:NN \dbIntMax \int_max:nn
+\cs_set_eq:NN \dbIntMin \int_min:nn
+\cs_set_eq:NN \dbIntMod \int_mod:nn
+\cs_set_eq:NN \dbFpSign \fp_sign:n
+
+%%%%%%%%%%%%%%%%% date
+
+% #1 year
+\prg_new_conditional:Nnn \dbshow_date_if_leap:n { T, F, TF, p } {
+ \bool_if:nTF {
+ \int_compare_p:nNn { \int_mod:nn { #1 } { 400 } } = { 0 } ||
+ (
+ !\int_compare_p:nNn { \int_mod:nn { #1 } { 100 } } = { 0 } &&
+ \int_compare_p:nNn { \int_mod:nn { #1 } { 4 } } = { 0 }
+ )
+ }
+ { \prg_return_true: }
+ { \prg_return_false: }
+}
+
+\clist_const:Nn \dbshow_date_month_clist
+ { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+
+\int_new:N \l__date_ans_int
+\int_new:N \l__date_tmpa_int
+\int_new:N \l__date_tmpb_int
+
+% #1 year #2 month #3 day #4 token to save the result
+\cs_new_protected:Nn \dbshow_date_to_int:nnnN {
+ \int_set:Nn \l__date_ans_int { #3 - 1 }
+ \int_step_inline:nn { #2 - 1 } {
+ \int_add:Nn \l__date_ans_int {
+ \clist_item:Nn \dbshow_date_month_clist { ##1 }
+ }
+ \bool_if:nT {
+ \int_compare_p:nNn { ##1 } = { 2 } &&
+ \dbshow_date_if_leap_p:n { #1 }
+ } { \int_incr:N \l__date_ans_int }
+ }
+ \int_add:Nn \l__date_ans_int { 365 * (#1 - 1971) }
+ \int_add:Nn \l__date_ans_int {
+ \int_div_truncate:nn { #1 - 1 } { 4 } -
+ \int_div_truncate:nn { 1971 } { 4 }
+ }
+ \int_sub:Nn \l__date_ans_int {
+ \int_div_truncate:nn { #1 - 1 } { 100 } -
+ \int_div_truncate:nn { 1971 } { 100 }
+ }
+ \int_add:Nn \l__date_ans_int {
+ \int_div_truncate:nn { #1 - 1 } { 400 } -
+ \int_div_truncate:nn { 1971 } { 400 }
+ }
+ \int_set_eq:NN #4 \l__date_ans_int
+}
+
+\cs_new_protected:Nn \dbshow_date_to_int:NNNN {
+ \dbshow_date_to_int:nnnN { #1 } { #2 } { #3 } #4
+}
+\cs_generate_variant:Nn \dbshow_date_to_int:NNNN { cccN }
+
+% #1 date #2 int
+\cs_new:Nn \dbshow_date_to_int:nN {
+ \dbshow_date_to_int:cccN
+ { dbshow_date_year_#1 }
+ { dbshow_date_month_#1 }
+ { dbshow_date_day_#1 }
+ #2
+}
+
+\cs_new_protected:Nn \dbshow_date_set_val:n {
+ \tl_set:cx { #1 } { \dbshow_date_use_zfill:nn { #1 } { / } }
+}
+\cs_new_protected:Nn \dbshow_date_gset_val:n {
+ \tl_gset:cx { #1 } { \dbshow_date_use_zfill:nn { #1 } { / } }
+}
+
+\cs_new_protected:Nn \dbshow_date_init:n {
+ \dbshow_date_set:nnnn { #1 } { 1971 } { 1 } { 1 }
+ \dbshow_date_set_val:n { #1 }
+}
+\cs_new_protected:Nn \dbshow_date_ginit:n {
+ \dbshow_date_gset:nnnn { #1 } { 1971 } { 1 } { 1 }
+ \dbshow_date_gset_val:n { #1 }
+}
+
+\cs_new_protected:Nn \dbshow_date_new:n {
+ \int_new:c { dbshow_date_year_#1 }
+ \int_new:c { dbshow_date_month_#1 }
+ \int_new:c { dbshow_date_day_#1 }
+ \dbshow_date_ginit:n { #1 }
+}
+
+\cs_new_protected:Nn \dbshow_date_clear_new:n {
+ \int_zero_new:c { dbshow_date_year_#1 }
+ \int_zero_new:c { dbshow_date_month_#1 }
+ \int_zero_new:c { dbshow_date_day_#1 }
+ \dbshow_date_init:n { #1 }
+}
+
+\cs_new_protected:Nn \dbshow_date_gclear_new:n {
+ \int_gzero_new:c { dbshow_date_year_#1 }
+ \int_gzero_new:c { dbshow_date_month_#1 }
+ \int_gzero_new:c { dbshow_date_day_#1 }
+ \dbshow_date_ginit:n { #1 }
+}
+
+% #1 name #2 year #3 month #4 day
+\cs_new_protected:Nn \dbshow_date_set:nnnn {
+ \int_set:cn { dbshow_date_year_#1 } { #2 }
+ \int_set:cn { dbshow_date_month_#1 } { #3 }
+ \int_set:cn { dbshow_date_day_#1 } { #4 }
+ \dbshow_date_set_val:n { #1 }
+}
+
+% #1 name #2 year #3 month #4 day
+\cs_new_protected:Nn \dbshow_date_gset:nnnn {
+ \int_gset:cn { dbshow_date_year_#1 } { #2 }
+ \int_gset:cn { dbshow_date_month_#1 } { #3 }
+ \int_gset:cn { dbshow_date_day_#1 } { #4 }
+ \dbshow_date_gset_val:n { #1 }
+}
+
+\cs_new_protected:Npn \dbshow_date_set:w #1\dbshow_sep#2/#3/#4\dbshow_stop {
+ \dbshow_date_clear_new:n { #1 }
+ \dbshow_date_set:nnnn { #1 } { #2 } { #3 } { #4 }
+}
+\cs_new_protected:Npn \dbshow_date_gset:w #1\dbshow_sep#2/#3/#4\dbshow_stop {
+ \dbshow_date_gclear_new:n { #1 }
+ \dbshow_date_gset:nnnn { #1 } { #2 } { #3 } { #4 }
+}
+
+% #1 date name #2 date
+\cs_new_protected:Nn \dbshow_date_set:nn {
+ \dbshow_date_set:w #1\dbshow_sep#2\dbshow_stop
+}
+\cs_generate_variant:Nn \dbshow_date_set:nn { nx }
+\cs_new_protected:Nn \dbshow_date_gset:nn {
+ \dbshow_date_gset:w #1\dbshow_sep#2\dbshow_stop
+}
+\cs_generate_variant:Nn \dbshow_date_gset:nn { nx }
+
+% #1 date 1 #2 date 2 #3 int token
+\cs_new_protected:Nn \dbshow_date_sub:nnN {
+ \dbshow_date_to_int:nN { #1 } \l__date_tmpa_int
+ \dbshow_date_to_int:nN { #2 } \l__date_tmpb_int
+ \int_set:Nn #3 { \l__date_tmpa_int - \l__date_tmpb_int }
+}
+
+\cs_new:Nn \dbshow_date_show_two:N {
+ \int_compare:nNnTF { #1 } > { 9 }
+ { \int_use:N #1 } { 0\int_use:N #1 }
+}
+\cs_generate_variant:Nn \dbshow_date_show_two:N { c }
+
+\cs_new:Nn \dbshow_date_use:nnnnn {
+ #2\int_use:c { dbshow_date_year_#1 }
+ #3\int_use:c { dbshow_date_month_#1 }
+ #4\int_use:c { dbshow_date_day_#1 }#5
+}
+\cs_generate_variant:Nn \dbshow_date_use:nnnnn { nffff }
+
+\cs_new:Nn \dbshow_date_use_zfill:nnnnn {
+ #2\int_use:c { dbshow_date_year_#1 }
+ #3\dbshow_date_show_two:c { dbshow_date_month_#1 }
+ #4\dbshow_date_show_two:c { dbshow_date_day_#1 }#5
+}
+\cs_generate_variant:Nn \dbshow_date_use_zfill:nnnnn { nffff }
+
+\cs_new:Nn \dbshow_date_use:nn {
+ \dbshow_date_use:nnnnn { #1 } { } { #2 } { #2 } { }
+}
+\cs_generate_variant:Nn \dbshow_date_use:nn { nf }
+
+\cs_new:Nn \dbshow_date_use_zfill:nn {
+ \dbshow_date_use_zfill:nnnnn { #1 } { } { #2 } { #2 } { }
+}
+\cs_generate_variant:Nn \dbshow_date_use_zfill:nn { nf }
+
+\tl_set:Nx \dbtoday {
+ \int_use:N \c_sys_year_int/
+ \int_use:N \c_sys_month_int/
+ \int_use:N \c_sys_day_int
+}
+
\endinput
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index b1dae3cc0c..7f0054c846 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2022/01/08}{1.44}
+\ProvidesExplClass{easybook}{2022/01/08}{1.45}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -306,7 +306,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2022/01/08}{1.44}
+\ProvidesExplPackage{easybase}{2022/01/08}{1.45}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1779,20 +1779,12 @@
format = hang,
labelfont = {color = ctex@frame},
labelsep = quad,
- singlelinecheck = true,
- belowskip = 0pt,
- aboveskip = 10pt
+ singlelinecheck = true
}
\captionsetup[table]{font = eb@table@font}
\captionsetup[figure]{font = eb@figure@font}
\captionsetup[lstlisting]{font = eb@listing@font}
-\captionsetup[subfigure]
- {
- labelformat = parens,
- font = eb@figure@font,
- belowskip = 2pt,
- aboveskip = 6pt
- }
+\captionsetup[subfigure]{labelformat = parens,font = eb@figure@font}
\ctex_at_end_package:nn { bicaption }
{
\captionsetup[figure][bi-second]{name = Figure}
@@ -1955,9 +1947,9 @@
\RenewDocumentCommand{\declaretheoremstyle}{O{}mO{}}
{\eb@declaretheoremsyle@save[#1,#3]{#2}}
\cs_set_eq:NN \newtheorem \declaretheorem
-\cs_new_protected:Npn \eb_if_thmframe_with_tcolorbox:TF #1#2
+\cs_new_protected:Npn \eb_tcbwrap_if_load_tcolorbox:TF #1#2
{
- \bool_if:NT \l__eb_thm_frame_bool
+ \bool_if:NT \l__eb_thm_tcbwrap_bool
{ \@ifpackageloaded{tcolorbox}{#1}{#2} }
}
\NewDocumentCommand{\deftheorem}
@@ -1973,7 +1965,7 @@
name = \tl_use:c { #1name },
style = fancy,#5
]
- \eb_if_thmframe_with_tcolorbox:TF
+ \eb_tcbwrap_if_load_tcolorbox:TF
{
\bool_if_exist:cTF { l__eb_tcb_repeat_env_#1_bool }
{ \bool_set_true:c { l__eb_tcb_repeat_env_#1_bool } }
@@ -2004,10 +1996,10 @@
{ \ctex_define:nn { thmset } { #1 .tl_set:N = #2 } }
\ctex_define:nn { thmset }
{
- thmframe .bool_set:N = \l__eb_thm_frame_bool,
- thmframe .default:n = true,
- thmframe .initial:n = false,
- thmbox .meta:n = { thmframe = #1 },
+ tcbwrap .bool_set:N = \l__eb_thm_tcbwrap_bool,
+ tcbwrap .default:n = true,
+ tcbwrap .initial:n = false,
+ thmbox .meta:n = { tcbwrap = #1 },
thmbox .default:n = true,
notebraces .tl_set:N = \l__eb_thm_notebraces_tl,
unknown .code:n = \eb_msg_abandon_option:n { thmset }
@@ -2034,12 +2026,12 @@
}
\msg_new:nnn { easybase } { need-tcolorbox }
{
- Now~that~the~thmframe~option~is~true. \\
+ Now~that~the~option~tcbwrap~is~true. \\
Please~load~the~tcolorbox~macro~package.
}
\eb_at_end_preamble:n
{
- \eb_if_thmframe_with_tcolorbox:TF { }
+ \eb_tcbwrap_if_load_tcolorbox:TF { }
{ \msg_warning:nn { easybase } { need-tcolorbox } }
\clist_put_right:Nx
\c__eb_thmtools_entry_clist { notebraces = \l__eb_thm_notebraces_tl }
@@ -2414,7 +2406,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/08}{1.44}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/08}{1.45}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
@@ -2429,7 +2421,6 @@
\deftcbstyle{tc-theorem}
{
enhanced~jigsaw,pad~at~break* = 3pt,
- opacityback = 0,
colframe = ctex@emph,
beforeafter~skip = 1.75ex plus .2ex minus .1ex,
left = 8pt,right = 8pt,
@@ -2497,12 +2488,12 @@
},
coltitle = #2,tc-ebparbox,#4
}
-\DeclareTotalTCBox{\ebfbox}{O{Green}vO{}}
+\DeclareTotalTCBox{\ebfbox}{O{Green}mO{}}
{
colback = #1,colframe = #1,
tc-ebfbox,#3
}{#2}
-\DeclareTotalTCBox{\ebemph}{O{Yellow}vO{}}
+\DeclareTotalTCBox{\ebemph}{O{Yellow}mO{}}
{
fuzzy~halo = 2pt~with~#1,
tc-ebemph,#3
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 9b5cbcc16d..97c5f3df65 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 259bbd6bd4..f54b553500 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -20,7 +20,7 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.44,
+ version = v1.45,
date = 2022/01/08,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
@@ -250,7 +250,7 @@
\subsection{英文字体}
\begin{options}
\keychoice{font}{noto,times,times*,ebgaramond,libertine,palatino,auto}\Default{auto}
- 预置的英文字体相关配置方案如下表所示,这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其他英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。
+ 预置的英文字体相关配置方案如下表所示,这些字体已经包含在了 \TeX Live 发行版中,所以通常不需要再专门安装。如果您想使用其它英文字体,可以使用 \pkg*{fontspec} 宏包的相关命令进行设置。
\insertblr
{
colspec = @{}*{4}{c}@{},
@@ -607,8 +607,8 @@
\label{subsec:theorem of style}
文档类已预置 12 个定理环境,环境名及对应的定理名见\ref{subsec:theorem},它们均使用预置的定理样式 \code{fancy}。下面 \module*{thmset} 模块选项的用法名称与 \pkg*{thmtools} 宏包基本一致,且仅对预置定理样式生效。如果下面的选项不满足需求,可使用支持完整选项的相关命令创建定理环境。
\begin{options}
- \keybool{thmframe}\Module{thmset}\Default{false}
- 给定理环境使用彩色盒子。这个特殊选项在本模块中使用 \pkg*{tcolorbox} 宏包来支持,\meta{盒子风格} 默认为 \code{tc-theorem}。注意它应当在定理声明命令前使用。\pkg*{thmtools} 具有类似的选项 \option*{thmbox}。
+ \keybool{tcbwrap}\Module{thmset}\Default{false}
+ 给定理环境使用彩色盒子。这个特殊选项在本模块中使用 \pkg*{tcolorbox} 宏包来支持,\meta{盒子风格} 默认为 \code{tc-theorem}。注意它应当在定理声明命令前使用。\pkg*{thmtools} 具有类似的选项 \option*{shaded}。
\keyval-{headfont}{字体命令}\Default{\cs*{color}\Carg{ctex@emph}\cs*{sffamily}}
定理标题部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
\keyval-{notefont}{字体命令}\Default
@@ -658,12 +658,12 @@
\begin{itemize}
\item 可以重复定义已存在的定理环境而不会报错。
\item 中英文模式下定理标题自动切换。针对中文定理标题的特点将 \meta{中文标题} 设计为必选参数,\meta{英文标题} 则默认为首字母大写的 \meta{环境名}。
- \item 自动定义交叉引用的格式,引用标签前缀为相应定理名。
- \item 定理盒子选项 \option{thmframe} 仍然生效,\meta{盒子风格} 可以使用 \cs{deftcbstyle} 命令创建。
+ \item 自动定义交叉引用的格式,标签引用前缀为相应定理名。
+ \item 定理盒子选项 \option{tcbwrap} 仍然生效,\meta{盒子风格} 可以使用 \cs{deftcbstyle} 命令创建。
\item 新建定理环境默认使用的 \meta{定理样式} 为 \code{fancy},而不是 \pkg*{thmtools} 的默认样式。
\end{itemize}
- 下面新建一个与\ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtotcbstyle} 命令调整 \option{thmframe} 开启时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在\ref{subsec:box}。
+ 下面新建一个与\ref{exam:new theorem env} 相同的定理环境猜想,并使用 \cs{addtotcbstyle} 命令调整 \option{tcbwrap} 开启时默认的盒子风格。它的第一个参数为 \code{tc-theorem},关于命令的介绍在\ref{subsec:box}。
\begin{ctexexam}
\deftheorem{caixiang}{猜想}[style = mythm]
\addtotcbstyle{tc-theorem}{colback = GreenYellow}
@@ -776,6 +776,10 @@
脚注正文标记编号的类型,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。
短编号的形式与列表环境类似,不过增加了中文数字 \code{c} 和符号 \code{s} 格式参数。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号类型。
+ \begin{commands}
+ \command{footref}[\marg{脚注标签名}]
+ 在当前位置对自动编号的脚注进行引用,与被引用的正文标记共享一个编号与格式。
+ \end{commands}
\begin{ctexexam}
\ebhdrset{fnmark-num = 1} % 等于编号类型plain
\ebhdrset{fnmark-num = (a)}
@@ -811,7 +815,16 @@
}
\end{ctexexam}
\keychoice{fncust-form}{format code,match}\Default
- 单独设定自定义脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。自定义脚注的命令与用法可以见\ref{subsubsec:custom footnotes}。
+ 单独设定自定义脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。自定义脚注的命令与用法可以见下方的介绍。
+ \begin{commands}\noitemsep
+ \command{Footnote}[\oarg{内容标记}\marg{正文标记}\marg{脚注文本}]\default{}
+ \command{Footnotetext}[\marg{内容标记}\marg{脚注文本}]\default{}
+ \command{Footnotemark}[\marg{正文标记}]
+ 这些是自定义标记且不影响正常编号的脚注命令,用法与它们对应首字母小写的命令类似。\meta{内容标记} 默认与 \meta{正文标记} 一致,可以进行微调。如果当前标记为空,那么将会使用上一个脚注标记。
+ \begin{ctexexam}
+ \Footnote{*}{这是可以自定义标记的脚注。}
+ \end{ctexexam}
+ \end{commands}
\keychoice{fnboth-form}{format code,match}\Default
同时设定默认脚注标记 \option{fnmate-form} 和自定义脚注标记 \option{fncust-form} 的格式。两种脚注标记匹配上标格式 \option*{spcmd} 的值是独立的,使用 \code{match} 则可以同时匹配。标记格式选项含有字体命令会覆盖 \option{footnote} 的设置,最后一个格式命令可以带有一个参数接受脚注标记。
\keyval-{fnpara-form}{格式代码}\Default
@@ -905,7 +918,6 @@
\subsection{表格}
\begin{environments}\noitemsep
- \environment*{tabularx}[\marg{长度}\marg{列格式}]\default{}
\environment*{tabular}[\marg{列格式}]\default{}
\environment{tblr}[\marg{键值列表}]
\pkg*{tabularray} 是一个强大且全面的表格宏包,不依赖其它表格宏包所以同时使用不会产生冲突。不仅提供了各种传统表格宏包的功能,还实现了用键值列表方式简便地设置表格样式。具体用法可见宏包的说明文档,下面演示一个 \env{tblr} 表格的用法:
@@ -952,7 +964,7 @@
\begin{ctexexam}
\setlist*{wide = 0em} % 取消所有列表的左边距
\begin{enumerate}[label = (\arabic*),leftmargin = 1cm,resume]
- \begin{enumerate}[(1)] % 短编号形式
+ \begin{enumerate*}[(1)] % 短编号形式
\begin{itemize}[label = \textbullet,labelsep = *]
\begin{description}[font = \sffamily\bfseries,style = nextline]
\end{ctexexam}
@@ -973,7 +985,7 @@
\environment{remark}\default{}
\environment{conjecture}\default{}
\environment{problem}
- 这些是预置的定理环境,可使用选项 \option{thmframe} 为它们添加盒子边框,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改定理盒子样式见\ref{subsec:theorem of style}。环境名与之对应的定理名如下:
+ 这些是预置的定理环境,可使用选项 \option{tcbwrap} 为它们添加盒子边框和背景,其中注与证明环境不编号,证明末尾会自动添加证明结束符,声明新的定理环境或更改定理盒子样式见\ref{subsec:theorem of style}。环境名与之对应的定理名如下:
\insertblr
{
colspec = @{}*{6}{c}@{},
@@ -1056,10 +1068,9 @@
\end{ctexexam}
\end{commands}
-\subsubsection{行间盒子}
\begin{environments}
\environment{easybox}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}]
- 环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认无标题。
+ 行间环境 \env{easybox} 创建一个带有三个可选参数的扁平盒子。使用星号参数时给盒子添加边框,\meta{颜色名} 选项设置背景颜色,\meta{段落标题} 选项可以设置标题,默认标题为空。
\begin{ctexexam}
\addtotcbstyle{tc-easybox}{arc = 6pt}
\begin{easybox}*[DarkCyan](段落标题)
@@ -1069,18 +1080,17 @@
\end{easybox}
\end{ctexexam}
\environment{ebparbox}[\sarg\oarg{颜色名}\darg{段落标题}\oarg{配置选项}]
- 环境 \env{ebparbox} 用法与 \env{easybox} 类似,同样带有三个可选参数。当使用星号参数时盒子左边带有一条竖线,\meta{颜色名} 选项可以自定义竖线颜色,使用带有星号的环境则盒子带有竖线颜色的浅色背景。\meta{段落标题} 选项可以设置标题,默认无标题。
+ 环境 \env{ebparbox} 用法与 \env{easybox} 类似,同样带有三个可选参数。盒子的左边带有一条粗竖线,\meta{颜色名} 选项可以自定义这条竖线颜色,使用星号参数则盒子带有竖线颜色的浅色背景。
\end{environments}
-\subsubsection{行内盒子}
\begin{commands}
\command{ebemph}[\oarg{颜色名}\marg{内容}\oarg{配置选项}]
- 行内盒子均为抄录命令。盒子 \cs{ebemph} 具有模糊边缘类似高亮的效果。
+ 行内盒子命令 \cs{ebemph} 具有模糊边缘类似高亮的效果。
\command{ebfbox}[\oarg{颜色名}\marg{内容}\oarg{配置选项}]
- 盒子 \cs{ebfbox} 则有直角边缘和四周框线,效果类似带颜色的 \cs*{fbox} 盒子。
+ 行内盒子命令 \cs{ebfbox} 则有直角边缘和四周框线,效果类似带颜色的 \cs*{fbox} 盒子。
\end{commands}
-\section{更多用法}
+\section{扩展功能}
\subsection{物理量}
\begin{commands}
@@ -1106,12 +1116,32 @@
\command{counteruse}[\sarg\oarg{父计数器}\darg{编号}\marg{计数器}\oarg{分隔符}\darg{整数}]
命令 \cs{newcounter} 是 \LaTeX 自带的创建计数器命令,计数器值输出命令 \cs{counteruse} 以一定的格式使用由它创建的计数器,将会以 \cs*{the}\meta{父计数器}\meta{分隔符}\cs*{the}\meta{计数器} 输出这种计数器的值。命令 \cs{counteruse} 仅具有\textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 值保持不变,\meta{计数器} 的值也可以设为指定的 \meta{整数}。计数器的 \meta{编号} 为 \code{arabic} 或 \code{alph} 等计数形式。
- 在一定的场合下可能用到 \cs{counteruse} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \cs{labelformat} 设置计数器的引用标签需添加 \code{eb@}:
+ 在一定的场合下可能用到 \cs{counteruse} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \cs{labelformat} 设置计数器的标签引用需添加 \code{eb@}:
\begin{ctexexam}
\labelformat{eb@theorem}{定理 #1}
\newcommand{\theoremhead}[1]{定理\counteruse[chapter]{theorem}\hspace{1em}#1}
\theoremhead{定理内容}\label{thm:theorem}
\end{ctexexam}
+
+ \command{counterwithin}[\sarg\oarg{格式}\marg{计数器}\marg{父计数器}]
+ 对计数器进行绑定的命令。将 \meta{计数器} 绑定于 \meta{父计数器},即 \meta{父计数器} 的值递增时 \meta{计数器} 的值会归零,输出格式 \cs*{the}\meta{计数器} 被改为 \cs*{the}\meta{父计数器}\code{.}\meta{格式}\marg{计数器}。\meta{格式} 应当为接受计数器值并改变编号形式的命令,默认为 \cs*{arabic}。带有星号参数的命令仅进行绑定不更改输出格式。
+ \command{counterwithout}[\sarg\oarg{格式}\marg{计数器}\marg{父计数器}]
+ 对计数器关系进行解绑的命令。将 \meta{计数器} 解绑于 \meta{父计数器},同时输出格式被改为 \meta{格式}\marg{计数器}。带有星号参数的命令仅进行解绑不更改输出格式。
+ \begin{ctexexam}
+ \counterwithin[\Roman]{child}{parent}
+ \counterwithout*{child}{parent}
+ \end{ctexexam}
+\end{commands}
+
+\subsection{标签引用}
+\begin{commands}
+ \command{labelformat}[\marg{计数器}\marg{标签引用格式}]
+ 标签格式命令 \cs{labelformat} 可以设置标签引用格式,\meta{标签引用格式} 中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。也可以使用 \pkg*{cleveref} 宏包提供更强大的标签功能。
+ \begin{ctexexam}
+ \labelformat{chapter}{第 #1 章}
+ \labelformat{chapter}{第\thechapter 章}
+ \AtBeginDocument{\usepackage{cleveref}}
+ \end{ctexexam}
\end{commands}
\subsection{图表题注}
@@ -1176,17 +1206,7 @@
\end{options}
\end{commands}
-\subsection{交叉引用}
-\begin{commands}
- \command*{ref}[\marg{标签名}]
- 使用 \cs*{ref} 命令引用 \cs*{label} 设置的 \meta{标签名},将会检测临近计数器并添加相应的前缀,比如图表题注、章节标题和定理等。
- \command{footref}[\marg{脚注标签名}]
- 对自动编号的脚注进行引用可使用 \cs{footref} 命令,与引用的标记共享一个编号与格式。
- \command{labelformat}[\marg{计数器}\marg{标签引用格式}]
- 标签格式命令 \cs{labelformat} 可以设置引用标签格式,\meta{标签引用格式} 中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。
-\end{commands}
-
-\subsubsection{索引}
+\subsection{索引}
\begin{commands}
\command*{indexsetup}[\marg{键值列表}]
\pkg*{imakeidx} 宏包增强了索引的功能,这是它的的接口命令,用于设置索引表的整体格式。
@@ -1198,19 +1218,7 @@
现在索引表生成命令 \cs{printindex} 被重新定义,\meta{键值列表} 中的选项与\ref{sec:document command} 其它目录命令相同,但是原本接口命令 \cs*{indexsetup} 的部分选项失效。
\end{commands}
-\subsubsection{自定义脚注}
-\label{subsubsec:custom footnotes}
-\begin{commands}\noitemsep
- \command{Footnote}[\oarg{内容标记}\marg{正文标记}\marg{脚注文本}]\default{}
- \command{Footnotetext}[\marg{内容标记}\marg{脚注文本}]\default{}
- \command{Footnotemark}[\marg{正文标记}]
- 这些是自定义标记且不影响正常编号的脚注命令,用法与它们对应首字母小写的命令类似。\meta{内容标记} 默认与 \meta{正文标记} 一致,可以进行微调。如果当前标记为空,那么将会使用上一个脚注标记。
- \begin{ctexexam}
- \Footnote{*}{这是可以自定义标记的脚注。}
- \end{ctexexam}
-\end{commands}
-
-\subsubsection{边注}
+\subsection{边注}
\begin{commands}
\command{marginnote}[\oarg{左文本}\marg{右文本}\oarg{垂直偏移}]
命令 \cs{marginnote} 可以生成简单的边注,如果只给定了 \meta{右文本},那么边注在奇偶数页文字相同。如果同时给定了 \meta{左文本},则偶数页使用 \meta{左文本} 的文字。
@@ -1238,7 +1246,7 @@
\appendix
\begin{changelog}[title = 更新日志]
- \shortversion{v = 1.44,date = 2022/01/08,changes = 经过前期各模块的功能调整和错误修复,稳定版本正式发布。}
+ \shortversion{v = 1.45,date = 2022/01/08,changes = 经过前期各模块的功能调整和错误修复,稳定版本正式发布。}
\end{changelog}
\nocite{*}
diff --git a/macros/latex/contrib/keyfloat/README.txt b/macros/latex/contrib/keyfloat/README.txt
index f9586fd2ba..dbb9df58a6 100644
--- a/macros/latex/contrib/keyfloat/README.txt
+++ b/macros/latex/contrib/keyfloat/README.txt
@@ -1,8 +1,8 @@
The LaTeX keyfloat package
Provides a key/value interface for generating floats.
-v2.06
-Copyright 2016-2021 Brian Dunn — www.BDTechConcepts.com
+v2.07
+Copyright 2016-2022 Brian Dunn — www.BDTechConcepts.com
LaTeX Project Public License, version 1.3
diff --git a/macros/latex/contrib/keyfloat/keyfloat.dtx b/macros/latex/contrib/keyfloat/keyfloat.dtx
index a729c86a4b..edd35cb03b 100644
--- a/macros/latex/contrib/keyfloat/keyfloat.dtx
+++ b/macros/latex/contrib/keyfloat/keyfloat.dtx
@@ -1,7 +1,7 @@
%
% \iffalse meta-comment
%
-% Copyright 2016--2021 Brian Dunn
+% Copyright 2016--2022 Brian Dunn
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -17,7 +17,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{keyfloat}
-%<package> [2021/06/29 v2.06 Key/value interface for floats and subfloats.]
+%<package> [2022/01/10 v2.07 Key/value interface for floats and subfloats.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -71,26 +71,15 @@
\newunicodechar{‡}{\ddag}
\newunicodechar{⚠}{\textwarning}
+\usepackage{etoolbox}
+\usepackage{xparse}
-\usepackage{metalogo}
-\makeatletter
-\@ifpackageloaded{erewhon}{
-\setlogokern{Te}{-.08em}
-\setlogokern{eX}{-0.04em}
-\setlogokern{La}{-.25em}
-\setlogokern{aT}{-.08em}
-\setlogokern{Xe}{-.04em}
-\setlogokern{eL}{-.06em}
-\setlogodrop{0.27ex}
-}{}
-\makeatother
+\usepackage{metalogox}
\usepackage{microtype}
-\usepackage{etoolbox}
-\usepackage[log-declarations=false]{xparse}
@@ -235,7 +224,8 @@ frametitlerulewidth=1pt,frametitleaboveskip=5pt,%
\pagestyle{pageheadfoot}
-\usepackage{dtxdescribe}[2019/01/11]
+% Indexing, logos, \Describexxxx, etc:
+\usepackage{dtxdescribe}[2021/09/02]
@@ -349,7 +339,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%<*package>
% \fi
%
-% \CheckSum{1392}
+% \CheckSum{1400}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -390,6 +380,8 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \changes{v2.04}{2021/06/08}{2021/06/08}
% \changes{v2.05}{2021/06/11}{2021/06/11}
% \changes{v2.06}{2021/06/29}{2021/06/29}
+% \changes{v2.07}{2021/08/30}{Docs: Show macro and environment nesting.}
+% \changes{v2.07}{2022/01/10}{2022/01/10}
@@ -413,7 +405,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%
% \bigskip
%
-% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com}
+% {\small\textcopyright{} 2016--2022} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com}
%
% \vspace{.5in}
%
@@ -1675,19 +1667,15 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% lw=1,c={Keywrap with \cs{keyfig}},l=fig:keywrapfig%
% }{image}}
% Second item.
-% Several lines of text text text text text
-% text text text text text text text text text
-% text text text text text text text.
%
% These paragraphs are inside the \texttt{keywrap}.
% A vertical gap appears below if the text is not enough to
% fill the space next to the \cs{keyfig}.
% \end{keywrap}
-% Outside the \env{wrapfig},\margintag{notes}\
+% Now outside the \env{keywrap},\margintag{notes}\
% but still in the second item.
% There is no elegant way to place only part of a paragraph
-% inside a \env{keywrap}, and attempting to do so requires
-% manually removing the vertical paragraph skip.
+% inside a \env{keywrap}.
% \item Third item.
% \end{itemize}
% \end{dtxexample}
@@ -1725,7 +1713,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \setlength{\KFLTtightframewidth}{1pt}
%
% \renewcommand{\KFLTlooseframe}[1]{%
-% \begin{mdlooseframe}[leftmargin=1.5in,rightmargin=1.5in]%
+% \begin{mdlooseframe}[leftmargin=.5in,rightmargin=.5in]%
% #1
% \end{mdlooseframe}%
% }
@@ -1733,7 +1721,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%
% \keyfig{ft,c=Custom-framed image,l=fig:customframe,r=90}{image}
% \keyfigbox{f,c=Custom loosely-framed box,
-% l=fig:customlooseframe}{A loosely-framed box.}
+% l=fig:customlooseframe}{A loosely-framed box.}
% \end{dtxexample}
%
% \gindex{frame>mdframed}
@@ -2080,6 +2068,9 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \section{Code}
% ^^A *source
%
+%
+%
+%
% \subsection{Older packages}
%
% Ensure that \pkg{tocdata}, if loaded, is new enough:
@@ -2218,6 +2209,10 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% These macros are commonly used by others.
% \begin{environment}{tablehere} Place a table exactly [H].
+%
+% \shownesting{\env{tablehere}}
+% {\shownesting{\env{minipage}}{Contents}}
+%
% \changes{v2.01}{2019/09/11}{Fix: Font and color.}
% \changes{v2.01}{2019/09/14}{Improved vertical space.}
% \begin{macrocode}
@@ -2233,6 +2228,10 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{environment}
% \begin{environment}{figurehere} Place a figure exactly [H].
+%
+% \shownesting{\env{figurehere}}
+% {\shownesting{\env{minipage}}{Contents}}
+%
% \changes{v2.01}{2019/09/11}{Fix: Font and color.}
% \changes{v2.01}{2019/09/14}{Improved vertical space.}
% \begin{macrocode}
@@ -3074,6 +3073,9 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \item [\cs{KFLTtightframe}:] Redefine to a macro which frames its contents.
% \item [\cs{KFLTtightframewidth}:] Redefine to the total width of the new.
% frame and its separation.
+% \item[\cs{KFLTlooseframe}:] Redefine to a macro which frames its contents.
+% \item[\cs{KFLTlooseframewidth}:] Redefine to the total width of the new
+% frame and its separation.
% \end{description}
%
% \begin{macro}{\KFLTtightframe} \marg{contents}
@@ -3099,12 +3101,6 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%
% A user-redefinable macro and length to loosely frame the contents.
%
-% \begin{description}
-% \item[\cs{KFLTlooseframe}:] Redefine to a macro which frames its contents.
-% \item[\cs{KFLTlooseframewidth}:] Redefine to the total width of the new
-% frame and its separation.
-% \end{description}
-%
% \begin{macrocode}
\newcommand{\KFLTlooseframe}[1]{%
\setlength{\fboxsep}{3pt}%
@@ -3125,14 +3121,25 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \begin{macro}{\KFLT@frame} \marg{contents}
%
% Frames the contents according to the |f| key. To be nested for further processing.
+% \changes{v2.07}{2022/01/08}{Reduced hbox warnings.}
% \begin{macrocode}
\newcommand{\KFLT@frame}[1]
{%
\ifbool{KFLT@ft}%
- {\KFLTtightframe{#1}}%
+ {%
+ {%
+ \hfuzz=\linewidth%
+ \KFLTtightframe{#1}%
+ }%
+ }%
{% not tightframe
\ifbool{KFLT@f}%
- {\KFLTlooseframe{#1}}%
+ {%
+ {%
+ \hfuzz=\linewidth%
+ \KFLTlooseframe{#1}%
+ }%
+ }%
{#1}% no frame
}% not looseframe
}
@@ -3214,6 +3221,15 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%
% Create an image with size, frame, and turn.
%
+% \shownesting{\cs{KFLT@onefigureimage}}
+% {
+% \shownesting{\env{turn}}
+% {
+% \shownesting{\cs{KFLT@frame} $\to$ \cs{fbox}}
+% {\cs{KFLT@includegraphics}}
+% }
+% }
+%
% \changes{v2.00}{2019/03/12}{Filename in arg instead of \cs{KFLT@i}.}
% \changes{v2.06}{2021/06/25}{Added \optn{kar}.}
% \begin{macrocode}
@@ -3871,9 +3887,22 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{macrocode}
+% \newcommand*{\showKFLTboxinner}[1]{%
+% \shownesting{\env{KFLT@boxinner}}{
+% \shownesting{\cs{KFLT@frame} $\to$ \cs{fbox}}
+% {
+% \shownesting{\env{turn}}
+% {\shownesting{\env{minipage}}{#1}}
+% }
+% }
+% }
+%
% \begin{environment}{KFLT@boxinner}
%
% Typeset the contents in a width which depends on the keys.
+%
+% \showKFLTboxinner{Contents}
+%
% \begin{macrocode}
\newsavebox{\KFLT@envbox}
@@ -3940,8 +3969,11 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
\KFLT@defaults%
% \end{macrocode}
% Remember the float type:
+% \changes{v2.07}{2022/01/06}{Fixed: Nested types.}
% \begin{macrocode}
- \renewcommand{\KFLT@type}{#2}%
+ \ifbool{KFLT@inkeysubfloats}%
+ {\renewcommand{\KFLT@type}{\@captype}}%
+ {\renewcommand{\KFLT@type}{#2}}%
% \end{macrocode}
% Set the shared keys. Expansion seems to be required for \pkg{xkeyval}.
% \begin{macrocode}
@@ -4292,9 +4324,6 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \changes{v2.02}{2021/05/18}{Work with \pkg{float}.}
% \begin{macrocode}
\ifcsdef{ftype@#3}{}{%
-% \end{macrocode}
-%
-% \begin{macrocode}
\PackageError{keyfloat}%
{%
\protect\keyflt: Invalid float type.\MessageBreak%
@@ -4305,6 +4334,9 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
Check argument order and float type.
}%
}%
+% \end{macrocode}
+%
+% \begin{macrocode}
\KFLT@ignorespaces%
\KFLT@trackrows%
\KFLT@boxkeys{#4}{#3}%
@@ -4328,6 +4360,14 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% This may be used by itself, or inside a \env{keyfloats} or
% \env{keysubtabs} environment.
%
+% \shownesting{\cs{keyflt}}{
+% \shownesting{\cs{KFLT@keyflt}}{
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+% }
+%
% \changes{v0.12}{2016/12/03}{Group around contents.}
% \changes{v2.00}{2019/03/17}{Added.}
% \begin{macrocode}
@@ -4366,6 +4406,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \subsection{The \env{keyfloat} environment}
% \begin{macro}{\KFLT@keyfloatstart} \marg{star?} \marg{loc} \marg{float type} \marg{\keyvalsarg}
+%
% \changes{v2.00}{2019/03/18}{Factored.}
% \begin{macrocode}
\newcommand{\KFLT@keyfloatstart}[4]{%
@@ -4389,6 +4430,16 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{macro}
% \begin{environment}{keyfloat} * \oarg{loc} \marg{float type} \marg{\keyvalsarg}
+%
+% \shownesting{\env{keyfloat}}{
+% \shownesting{\cs{KFLT@keyfloatstart}, \cs{KFLT@keyfloatend}}
+% {
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+% }
+%
% \changes{v2.00}{2019/03/18}{Added.}
% \begin{macrocode}
\NewDocumentEnvironment{keyfloat}{s O{tbp} m +m}
@@ -4416,6 +4467,16 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \subsection{The \env{keyfigure} environment}
% \begin{environment}{keyfigure} * \oarg{loc} \marg{\keyvalsarg}
+%
+% \shownesting{\env{keyfigure}}{
+% \shownesting{\cs{KFLT@keyfloatstart}, \cs{KFLT@keyfloatend}}
+% {
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+% }
+%
% \begin{macrocode}
\NewDocumentEnvironment{keyfigure}{s O{tbp} +m}
{%
@@ -4447,6 +4508,32 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% This may be used by itself, or inside a \env{keyfloats} or
% \env{keysubfigs} environment.
%
+% \shownesting{\cs{keyfig}}{
+% \shownesting{\cs{KFLT@keyflt}}{
+% \shownesting{\env{KFLT@boxouter}}{
+% \shownesting{
+% \begin{description}
+% \item[If \env{keysubfloats}:]
+% Uses a \env{subfigure}.
+% \item[If {[}H{]}, \env{keyfloats}, or inside a \env{keywrap}:]
+% Uses a \env{minipage}.
+% \item[If {[}W{]}:]
+% Uses a \env{wrapfloat} from the \pkg{wrapfig} package.
+% \item[If {[}M{]}:]
+% Uses a \env{KFLT@marginfloat}.
+% \item[Otherwise:]
+% Uses a \env{figure}.
+% \end{description}
+% }
+% {
+% \shownesting{\cs{KFLT@onefigureimage}}{
+% Rotate, frame, \cs{includegraphics}.
+% }
+% }
+% }
+% }
+% }
+%
% \changes{v2.00}{2019/03/17}{Factored.}
% \begin{macrocode}
\NewDocumentCommand{\keyfig}{s O{tbp} +m m}
@@ -4468,6 +4555,12 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% This may be used by itself, or inside a \env{keyfloats} or
% \env{keysubtabs} environment.
%
+% \shownesting{\cs{keyfigbox}}{
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+%
% \changes{v0.12}{2016/12/03}{Group around contents.}
% \begin{macrocode}
\NewDocumentCommand{\keyfigbox}{s O{tbp} +m +m}
@@ -4534,6 +4627,16 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% This may be used by itself, or inside a \env{keyfloats} or
% \env{keysubtabs} environment.
%
+% \shownesting{\cs{keytab}}{
+% \shownesting{\cs{keyflt}}{
+% \shownesting{\cs{KFLT@keyflt}}{
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+% }
+% }
+%
% \changes{v2.00}{2019/03/17}{Factored.}
% \begin{macrocode}
\NewDocumentCommand{\keytab}{s O{tbp} +m +m}
@@ -4551,6 +4654,15 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \subsection{The \env{keytable} environment}
% \begin{environment}{keytable} * \oarg{loc} \marg{\keyvalsarg}
+%
+% \shownesting{\env{keytable}}{
+% \shownesting{\cs{KFLT@keyfloatstart}, \cs{KFLT@keyfloatend}}{
+% \shownesting{\env{KFLT@boxouter}}{
+% \showKFLTboxinner{Contents}
+% }
+% }
+% }
+%
% \begin{macrocode}
\NewDocumentEnvironment{keytable}{s O{tbp} +m}
{%
@@ -4623,7 +4735,6 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{macrocode}
% \end{environment}
-
% \begin{environment}{keyfloats} * \oarg{loc} \marg{num columns} \oarg{shared keys/values}
%
% User-level macro to create rows of figures/tables.
@@ -4641,6 +4752,19 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% Likewise, manually-selected |w| width and |h| tags may need to be
% adjusted to prevent overflow.
%
+% \shownesting{\env{keyfloats}}
+% {
+% \shownesting{
+% \begin{description}
+% \item[If {[}H{]}, nested, subfloats, or \env{keywrap}:]
+% Uses a \env{minipage}.
+% \item[If {[}W{]}:] Uses a \env{wrapfloat}.
+% \item[If {[}M{]}:] Uses \cs{KFLT@marginfloat}.
+% \item[Otherwise:] Uses a \env{figure}.
+% \end{description}
+% }{Contents}
+% }
+%
% \changes{v0.15}{2017/05/12}{Adjustments for \protect\env{keywrap}.}
%
% \begin{macrocode}
@@ -4901,6 +5025,19 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \begin{macro}{\KFLT@subfloats} \marg{starred?} \marg{loc} \marg{cols} \marg{\keyvalsarg}
%
+% \shownesting{\cs{KFLT@subfloats}, \cs{KTLT@endsubfloats}}
+% {
+% \shownesting{
+% \begin{description}
+% \item[If {[}H{]} or \env{keywrap}:] Uses a \env{minipage}.
+% \item[If {[}W{]}:] Uses a \env{wrapfloat} and a \env{minipage}.
+% \item[If {[}M{]}:] Uses \cs{KFLT@marginfloat}.
+% \item[Otherwise:] Uses a \env{subfigure}, etc.
+% \end{description}
+% }
+% {Contents}
+% }
+%
% \changes{v0.13}{2017/01/16}{Fix: Subfloat type selection.}
% \changes{v0.15}{2017/05/12}{Adjustments for \protect\env{keywrap}.}
%
@@ -5099,6 +5236,22 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
%
% A group of subfigures typeset in rows.
%
+% \shownesting{\env{KFLT@keysubfloats}}
+% {
+% \shownesting{\cs{KFLT@subfloats}, \cs{KFLT@endsubfloats}}
+% {
+% \shownesting{
+% \begin{description}
+% \item[If {[}H{]} or \env{keywrap}:] Uses a \env{minipage}.
+% \item[If {[}W{]}:] Uses a \env{wrapfloat} and a \env{minipage}.
+% \item[If {[}M{]}:] Uses \cs{KFLT@marginfloat}.
+% \item[Otherwise:] Uses a \env{subfigure}, etc.
+% \end{description}
+% }
+% {Contents}
+% }
+% }
+%
% \begin{macrocode}
\NewDocumentEnvironment{KFLT@keysubfloats}{m m m m +m m}
{%
@@ -5136,13 +5289,33 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
}
% \end{macrocode}
% \end{environment}
-
-
+%
+%
+%
% \begin{environment}{keysubfloats} * \oarg{2: loc} \marg{3: float type}
% \marg{4: numcols} \marg{5: \keyvalsarg} \oarg{6: shared \keyvalsarg}
%
% A group of subfloats typeset in rows.
%
+% \shownesting{\env{keysubfloats}, \env{keysubfigs}, or \env{keysubtabs}}
+% {
+% \shownesting{\env{KFLT@keysubfloats}}
+% {
+% \shownesting{\cs{KFLT@subfloats}, \cs{KFLT@endsubfloats}}
+% {
+% \shownesting{
+% \begin{description}
+% \item[If {[}H{]} or \env{keywrap}:] Uses a \env{minipage}.
+% \item[If {[}W{]}:] Uses a \env{wrapfloat} and a \env{minipage}.
+% \item[If {[}M{]}:] Uses \cs{KFLT@marginfloat}.
+% \item[Otherwise:] Uses a \env{subfigure}, etc.
+% \end{description}
+% }
+% {Contents}
+% }
+% }
+% }
+%
% \changes{v2.06}{2021/06/25}{Added shared keys.}
% \begin{macrocode}
\NewDocumentEnvironment{keysubfloats}{s O{tbp} m m +m O{}}
@@ -5184,6 +5357,13 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \subsection{Margin floats}
%
% \begin{environment}{KFLT@marginfloat} \oarg{offset} \marg{type}
+%
+% \shownesting{\env{KFLT@marginfloat}}
+% {
+% \shownesting{\cs{marginpar}}
+% {\shownesting{\env{minipage}}{Contents}}
+% }
+%
% \changes{v2.01}{2019/09/11}{Fix: Font and color.}
% \begin{macrocode}
\newsavebox{\KFLT@marginfloatbox}
@@ -5212,6 +5392,17 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% Provided in case \pkg{tufte-book} is not loaded:
%
% \begin{environment}{marginfigure} \oarg{offset}
+%
+% \shownesting{\env{marginfigure}}
+% {
+% \shownesting{\env{KFLT@marginfloat}}
+% {
+% \shownesting{\cs{marginpar}}
+% {\shownesting{\env{minipage}}{Contents}}
+% }
+% }
+%
+%
% \changes{v0.12}{2016/12/03}{Added.}
% \begin{macrocode}
\ProvideDocumentEnvironment{marginfigure}{O{-1.2ex}}
@@ -5258,11 +5449,22 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{macrocode}
%
%
-% \begin{environment}{keywrap} \marg{width} \marg{keyfloat}
+% \begin{environment}{keywrap} \marg{width} \marg{wrapped content}
%
% The main text is placed in a minipage to the left,
% and the wrapped content is later placed in another minipage to the right.
%
+% \shownesting{\env{keywrap}}
+% {
+% \shownesting[.4]{\env{minipage}}
+% {Main text.\newline Multiple paragraphs.}
+% \hfill
+% \cs{hfill}
+% \hfill
+% \shownesting*[.35]{\env{minipage}}
+% {Wrapped content.}
+% }
+%
% \changes{v0.15}{2017/05/11}{Added.}
% \changes{v2.01}{2019/09/11}{Fix: Font and color.}
% \changes{v2.01}{2019/09/16}{Fix: \cs{noindent}.}
@@ -5310,10 +5512,12 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}%
% \end{environment}
%
%
+% \clearpage
+%
% \section{\pkg{keyfloat} package maintenance}
%
-% To compile the \pkg{keyfloat} documentation from \filenm{keyfloat.dtx} and
-% \filenm{keyfloat.ins}:
+% To compile \filenm{keyfloat.sty} and \cs{keyfloat.pdf}
+% from \filenm{keyfloat.dtx} and \filenm{keyfloat.ins}:
%
% \begin{sourceverb}
% pdflatex keyfloat.ins
diff --git a/macros/latex/contrib/keyfloat/keyfloat.pdf b/macros/latex/contrib/keyfloat/keyfloat.pdf
index 6493f59785..648038fb1a 100644
--- a/macros/latex/contrib/keyfloat/keyfloat.pdf
+++ b/macros/latex/contrib/keyfloat/keyfloat.pdf
Binary files differ
diff --git a/macros/latex/contrib/sillypage/README.md b/macros/latex/contrib/sillypage/README.md
new file mode 100644
index 0000000000..1a04f51626
--- /dev/null
+++ b/macros/latex/contrib/sillypage/README.md
@@ -0,0 +1,54 @@
+# The `sillypage` package
+
+This is a very simple package that provides John Cleese's iconic silly walk
+routine as page numbering style.
+
+## Usage
+
+Simply add `\usepackage{sillypage}` to your document. Then:
+
+- Write `\pagenumbering{silly}` in you document to use the page numbering
+ style defined by this package.
+- Use the macro `\silly` on a LaTeX counter to typeset the corresponding
+ image for the value of that counter.
+- Use the macro `\sillystep` to print the step number `n` from the
+ sequence of steps.
+
+## A sample document
+
+Here we go:
+
+```tex
+\documentclass{article}
+
+\usepackage{sillypage}
+\usepackage{blindtext}
+
+\begin{document}
+\pagenumbering{silly}
+\Blinddocument
+\end{document}
+```
+
+## Installation notes
+
+Just note that `sillywalk-map.png` should go under the `tex/` subtree
+(as it is required by `sillypage.sty`) instead of the `doc/` counterpart.
+
+## Isn't this package too silly?
+
+Yes.
+
+## Authors
+
+Blame these two blokes:
+
+- Phelype Oleinik
+- Paulo Cereda
+
+## License
+
+The `sillypage` package may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c of
+this license or (at your option) any later version.
+
diff --git a/macros/latex/contrib/sillypage/sillypage-example.pdf b/macros/latex/contrib/sillypage/sillypage-example.pdf
new file mode 100644
index 0000000000..eeab813f57
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillypage-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/sillypage/sillypage-example.tex b/macros/latex/contrib/sillypage/sillypage-example.tex
new file mode 100644
index 0000000000..94c0ac7111
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillypage-example.tex
@@ -0,0 +1,9 @@
+\documentclass{article}
+
+\usepackage{sillypage}
+\usepackage{blindtext}
+
+\begin{document}
+\pagenumbering{silly}
+\Blinddocument
+\end{document}
diff --git a/macros/latex/contrib/sillypage/sillypage.dtx b/macros/latex/contrib/sillypage/sillypage.dtx
new file mode 100644
index 0000000000..ea015877b1
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillypage.dtx
@@ -0,0 +1,178 @@
+% \iffalse meta-comment
+% Copyright (C) 2022
+% by Phelype Oleinik <phelype.oleinik@latex-project.org>
+% and Paulo Cereda <cereda.paulo@gmail.com>
+%
+% This work may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work is "maintained" (as per the LPPL maintenance status)
+% by Phelype Oleinik and Paulo Cereda.
+%
+%<*package>
+\def\sillypageDate{2022-01-10}
+\def\sillypageVersion{1.1}
+%</package>
+%<*driver>
+\documentclass[a4paper,full]{l3doc}
+\usepackage{sillypage}
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{\jobname.sty}
+%
+% \title{^^A
+% The \pkg{sillypage} package^^A
+% \thanks{This file has version number \sillypageVersion,
+% last revised \sillypageDate.}
+% }
+%
+% \author{^^A
+% Phelype H. Oleinik\thanks
+% {^^A
+% E-mail:
+% \href{mailto:phelype.oleinik@latex-project.org}
+% {phelype.oleinik\meta{at}latex-project.org}^^A
+% }\\
+% Paulo R. M. Cereda\thanks
+% {^^A
+% E-mail:
+% \href{mailto:cereda.paulo@gmail.com}
+% {cereda.paulo\meta{at}gmail.com}^^A
+% }^^A
+% }
+%
+% \date{Released \sillypageDate}
+% \pagenumbering{silly}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+% \section{Introduction}
+%
+% \begin{function}{\pagenumbering{silly}}
+% \begin{syntax}
+% \cs{pagenumbering}\{silly\}
+% \end{syntax}
+% Write \cs{pagenumbering}|{silly}| in you document to use the page
+% numbering style defined by this package.
+% \end{function}
+%
+% \begin{function}{\silly}
+% \begin{syntax}
+% \cs{silly} \Arg{counter}
+% \end{syntax}
+% Use the macro \cs{silly} on a \LaTeX{} \meta{counter} to typeset the
+% corresponding image for the value of that counter.
+% \end{function}
+%
+% \begin{function}{\sillystep}
+% \begin{syntax}
+% \cs{sillystep} \Arg{integer}
+% \end{syntax}
+% Prints the step number \meta{integer} from the sequence of steps.
+% \end{function}
+%
+% \section{A sample document}
+%
+% A sample document is as follows:
+%
+% \begin{verbatim}
+% \documentclass{article}
+%
+% \usepackage{sillypage}
+% \usepackage{blindtext}
+%
+% \begin{document}
+% \pagenumbering{silly}
+% \Blinddocument
+% \end{document}
+% \end{verbatim}
+%
+% This is the complete silly walk routine:
+%
+% \makeatletter
+% {\centering
+% \def\do#1{\ifnum#1>\silly@steps\else
+% \sillystep{#1}
+% \expandafter\do\expandafter{%^^A
+% \number\numexpr#1+1\relax}\fi}\do{1}\par}
+% \makeatother
+%
+% We also recommend Pilates.
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{\pkg{sillypage} Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Package requirements}
+%
+% \begin{macrocode}
+\ProvidesPackage{sillypage}[\sillypageDate\space\sillypageVersion\space
+ The silly walk as page numbering style]
+\RequirePackage{graphicx}
+% \end{macrocode}
+%
+% \subsection{Loading}
+% \begin{macro}{\silly,\sillystep}
+% \begin{macro}[int]{\@silly}
+% \begin{macro}{
+% \silly@steps,\silly@width,
+% \silly@picture,\silly@height}
+% \begin{macrocode}
+\newcommand*\silly[1]{\expandafter\@silly\csname c@#1\endcsname}
+\newcommand*\sillystep[1]{\@silly{#1}}
+\newcommand*\@silly[1]{\expandafter\@silly@walk
+ \expandafter{\number\numexpr#1\relax}}
+\newcommand*\silly@steps{12}%
+\newcommand*\silly@width{48px}%
+\newcommand*\silly@height{.8cm}%
+\newcommand*\silly@picture{sillywalk-map.png}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[int]{\@silly@walk,\@silly@walk@}
+% \begin{macrocode}
+\def\@silly@walk#1{%
+ \@ifundefined{texorpdfstring}{\@firstoftwo}{\texorpdfstring}%
+ {\@silly@walk@{#1}}% TeX
+ {#1}}% pdf string
+\def\@silly@walk@#1{%
+ \ifnum#1>\silly@steps\space
+ \expandafter\@silly@walk@\expandafter
+ {\number\numexpr#1-\silly@steps\expandafter}%
+ \else
+ \expandafter\includegraphics\expanded{[height=\silly@height,trim={%
+ \the\dimexpr\silly@width*(#1-1)\relax\space 0
+ \the\dimexpr\silly@width*(\silly@steps-#1)\relax\space 0},clip]}%
+ {\silly@picture}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \end{implementation}
+%
+\endinput
diff --git a/macros/latex/contrib/sillypage/sillypage.ins b/macros/latex/contrib/sillypage/sillypage.ins
new file mode 100644
index 0000000000..38d2e59db1
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillypage.ins
@@ -0,0 +1,94 @@
+%%
+%% Copyright (C) 2022
+%% by Phelype Oleinik <phelype.oleinik@latex-project.org>
+%% and Paulo Cereda <cereda.paulo@gmail.com>
+%%
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work is "maintained" (as per the LPPL maintenance status)
+%% by Phelype Oleinik and Paulo Cereda.
+%%
+\def\projectname{sillypage}%
+\def\nameofplainTeX{plain}%
+\def\mainext{sty}
+\ifx\fmtname\nameofplainTeX
+\else
+ \expandafter\begingroup
+\fi
+\input l3docstrip.tex
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+
+This is a generated file.
+
+Copyright 2022 Phelype Oleinik /phelype.oleinik@latex-project.org/
+ Paulo Cereda /cereda.paulo@gmail.com/
+
+This work may be distributed and/or modified under the conditions of the
+LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX version
+2005/12/01 or later.
+
+\endpreamble
+
+\postamble
+
+This work is "maintained" (as per the LPPL maintenance status)
+by Phelype Oleinik and Paulo Cereda.
+
+This work consists of the files \projectname.dtx, and
+ \projectname.ins,
+and the derived files \projectname.\mainext,
+ \projectname.pdf,
+ sillywalk-map.png, and
+ README.md.%
+
+\endpostamble
+
+\generate
+ {
+ \file{\projectname.\mainext}
+ {
+ \from{\projectname.dtx}{package}
+ }
+ }
+
+\Msg{*********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the}
+\Msg{* following file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space \projectname.\mainext}
+\Msg{*}
+\ifx\fmtname\nameofplainTeX
+ \Msg{* To produce the documentation run the file \projectname.dtx}
+ \Msg{* through LaTeX.}
+ \Msg{*}
+ \Msg{* ooh an .ins file}
+ \Msg{*}
+\fi
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{*********************************************************}
+
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+
+\input{\projectname.dtx}
diff --git a/macros/latex/contrib/sillypage/sillypage.pdf b/macros/latex/contrib/sillypage/sillypage.pdf
new file mode 100644
index 0000000000..9922c265ab
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillypage.pdf
Binary files differ
diff --git a/macros/latex/contrib/sillypage/sillywalk-map.png b/macros/latex/contrib/sillypage/sillywalk-map.png
new file mode 100644
index 0000000000..62f43c11b1
--- /dev/null
+++ b/macros/latex/contrib/sillypage/sillywalk-map.png
Binary files differ
diff --git a/macros/latex/contrib/zref-clever/CHANGELOG.md b/macros/latex/contrib/zref-clever/CHANGELOG.md
index e190d38d68..5a5addd47e 100644
--- a/macros/latex/contrib/zref-clever/CHANGELOG.md
+++ b/macros/latex/contrib/zref-clever/CHANGELOG.md
@@ -1,15 +1,39 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.1.1-alpha...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.1.2-alpha...HEAD)
+
+## [v0.1.2-alpha](https://github.com/gusbrs/zref-clever/compare/v0.1.1-alpha...v0.1.2-alpha) (2022-01-10)
+
+### Added
+- Provided Dutch language file (see PR
+ [#5](https://github.com/gusbrs/zref-clever/pull/5)).
+
+### Changed
+- The `gender` key in `\zcLanguageSetup` and in the built-in language files
+ can receive a comma separated list as value to support types with multiple
+ valid genders.
+- The `cap` and `abbrev` options can now be set also in `\zcRefTypeSetup` and
+ `\zcLanguageSetup`, so that fine grained control per-type and per-language
+ is now possible for these options.
+- Abandoned the "dictionary/translation" metaphor to refer to language
+ specific options. Mostly housekeeping, affecting the name-scheme of
+ functions and variables, but aiming at a clearer documentation in this area,
+ specially in the longer term.
+
+### Deprecated
+- The reference format options `refpre` and `refpos` have been deprecated in
+ favor or the more aptly named `preref` and `postref`, respectively.
## [v0.1.1-alpha](https://github.com/gusbrs/zref-clever/compare/v0.1.0-alpha...v0.1.1-alpha) (2021-12-07)
### Changed
- Improvements to the French dictionary (see issue
[#1](https://github.com/gusbrs/zref-clever/issues/1)).
-- Dropped the `subappendix` reference type.
- Improvements to documentation.
+### Removed
+- Dropped the `subappendix` reference type.
+
## [v0.1.0-alpha](https://github.com/gusbrs/zref-clever/releases/tag/v0.1.0-alpha) (2021-00-24)
### Added
diff --git a/macros/latex/contrib/zref-clever/MANIFEST.md b/macros/latex/contrib/zref-clever/MANIFEST.md
index e40fb05bf0..a52c56a9ee 100644
--- a/macros/latex/contrib/zref-clever/MANIFEST.md
+++ b/macros/latex/contrib/zref-clever/MANIFEST.md
@@ -42,11 +42,12 @@ The files created by ‘unpacking’ the package sources. This typically include
`.sty` and `.cls` files created from DocStrip `.dtx` files.
* zref-clever.sty †
-* zref-clever-english.dict †
-* zref-clever-french.dict †
-* zref-clever-german.dict †
-* zref-clever-portuguese.dict †
-* zref-clever-spanish.dict †
+* zref-clever-dutch.lang †
+* zref-clever-english.lang †
+* zref-clever-french.lang †
+* zref-clever-german.lang †
+* zref-clever-portuguese.lang †
+* zref-clever-spanish.lang †
### Typeset documents
@@ -82,8 +83,6 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-compat-memoir01.lvt
* zc-compat-subcaption01.lvt
* zc-compat-subfig01.lvt
-* zc-dictionaries01.lvt
-* zc-dictionaries02.lvt
* zc-howto-amsmath01.lvt
* zc-howto-enumitem01.lvt
* zc-howto-listings01.lvt
@@ -98,6 +97,8 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-howto-newtheorem04.lvt
* zc-howto-zref-xr01.lvt
* zc-label-options01.lvt
+* zc-langfiles01.lvt
+* zc-langfiles02.lvt
* zc-languages01.lvt
* zc-opt-check01.lvt
* zc-opt-d01.lvt
@@ -219,12 +220,6 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-compat-subfig01.tlg
* zc-compat-subfig01.xetex.tlg
* zc-compat-subfig01.xetexdev.tlg
-* zc-dictionaries01.tlg
-* zc-dictionaries02.luatex.tlg
-* zc-dictionaries02.luatexdev.tlg
-* zc-dictionaries02.tlg
-* zc-dictionaries02.xetex.tlg
-* zc-dictionaries02.xetexdev.tlg
* zc-howto-amsmath01.luatex.tlg
* zc-howto-amsmath01.luatexdev.tlg
* zc-howto-amsmath01.tlg
@@ -293,6 +288,12 @@ different engines (pdfTeX, XeTeX, LuaTeX, etc.).
* zc-label-options01.luatex.tlg
* zc-label-options01.luatexdev.tlg
* zc-label-options01.tlg
+* zc-langfiles01.tlg
+* zc-langfiles02.luatex.tlg
+* zc-langfiles02.luatexdev.tlg
+* zc-langfiles02.tlg
+* zc-langfiles02.xetex.tlg
+* zc-langfiles02.xetexdev.tlg
* zc-languages01.tlg
* zc-opt-check01.luatex.tlg
* zc-opt-check01.luatexdev.tlg
@@ -419,11 +420,12 @@ All files included in the `zref-clever/source` directory.
All files included in the `zref-clever/tex` directory.
-* zref-clever-english.dict
-* zref-clever-french.dict
-* zref-clever-german.dict
-* zref-clever-portuguese.dict
-* zref-clever-spanish.dict
+* zref-clever-dutch.lang
+* zref-clever-english.lang
+* zref-clever-french.lang
+* zref-clever-german.lang
+* zref-clever-portuguese.lang
+* zref-clever-spanish.lang
* zref-clever.sty
### Doc files (TDS)
diff --git a/macros/latex/contrib/zref-clever/zref-clever-code.pdf b/macros/latex/contrib/zref-clever/zref-clever-code.pdf
index f8d0003a96..b955c4c59f 100644
--- a/macros/latex/contrib/zref-clever/zref-clever-code.pdf
+++ b/macros/latex/contrib/zref-clever/zref-clever-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/zref-clever/zref-clever-code.tex b/macros/latex/contrib/zref-clever/zref-clever-code.tex
index a4ebabd625..edc439e5c3 100644
--- a/macros/latex/contrib/zref-clever/zref-clever-code.tex
+++ b/macros/latex/contrib/zref-clever/zref-clever-code.tex
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-clever".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
diff --git a/macros/latex/contrib/zref-clever/zref-clever.dtx b/macros/latex/contrib/zref-clever/zref-clever.dtx
index ac9d81f44e..3027bcab15 100644
--- a/macros/latex/contrib/zref-clever/zref-clever.dtx
+++ b/macros/latex/contrib/zref-clever/zref-clever.dtx
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-clever".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -63,6 +63,9 @@
% \NewDocumentCommand\githubissue{m}{^^A
% issue~\href{https://github.com/gusbrs/zref-clever/issues/#1}{\##1}}
%
+% \NewDocumentCommand\githubPR{m}{^^A
+% PR~\href{https://github.com/gusbrs/zref-clever/pull/#1}{\##1}}
+%
% ^^A Currently just for keeping semantic markup on this.
% \NewDocumentCommand\contributor{m}{#1}
%
@@ -129,7 +132,7 @@
% \cs{bool_case_true:}\dots{}). We presume \pkg{xparse} (which made to the
% kernel in the 2020-10-01 release), and \pkg{expl3} as well (which made to
% the kernel in the 2020-02-02 release). We also just use UTF-8 for the
-% dictionaries (which became the default input encoding in the 2018-04-01
+% language files (which became the default input encoding in the 2018-04-01
% release). Finally, a couple of changes came with the 2021-11-15 kernel
% release, which are important here. First, a fix was made to the new hook
% management system (\pkg{ltcmdhooks}), with implications to the hook we add
@@ -159,7 +162,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-clever} {2021-12-07} {0.1.1-alpha}
+\ProvidesExplPackage {zref-clever} {2022-01-10} {0.1.2-alpha}
{Clever LaTeX cross-references based on zref}
% \end{macrocode}
%
@@ -520,6 +523,11 @@
}
\msg_new:nnn { zref-clever } { key-requires-value }
{ The~'#1'~key~'#2'~requires~a~value~\msg_line_context:. }
+\msg_new:nnn { zref-clever } { key-boolean-or-empty }
+ {
+ The~key~'#1'~only~accepts~the~values~'true',~'false'~
+ or~an~empty~value~\msg_line_context:.
+ }
\msg_new:nnn { zref-clever } { language-declared }
{ Language~'#1'~is~already~declared~\msg_line_context:.~Nothing~to~do. }
\msg_new:nnn { zref-clever } { unknown-language-alias }
@@ -597,14 +605,15 @@
{ Unknown~value~'#1'~for~'nudgeif'~option~\msg_line_context:. }
\msg_new:nnn { zref-clever } { option-document-only }
{ Option~'#1'~is~only~available~after~\iow_char:N\\begin\{document\}. }
-\msg_new:nnn { zref-clever } { dict-loaded }
- { Loaded~'#1'~dictionary. }
-\msg_new:nnn { zref-clever } { dict-not-available }
- { Dictionary~for~'#1'~not~available~\msg_line_context:. }
+\msg_new:nnn { zref-clever } { langfile-loaded }
+ { Loaded~'#1'~language~file. }
+\msg_new:nnn { zref-clever } { langfile-not-available }
+ { Language~file~for~'#1'~not~available~\msg_line_context:. }
\msg_new:nnn { zref-clever } { unknown-language-load }
{
- Language~'#1'~is~unknown~\msg_line_context:.~Unable~to~load~dictionary.~
- See~documentation~for~'\iow_char:N\\zcDeclareLanguage'~and~
+ Language~'#1'~is~unknown~\msg_line_context:.~
+ Unable~to~load~language~file.~See~documentation~for~
+ '\iow_char:N\\zcDeclareLanguage'~and~
'\iow_char:N\\zcDeclareLanguageAlias'.
}
\msg_new:nnn { zref-clever } { zref-property-undefined }
@@ -654,28 +663,33 @@
{ Loaded~support~for~'#1'~package. }
\msg_new:nnn { zref-clever } { compat-class }
{ Loaded~support~for~'#1'~documentclass. }
+\msg_new:nnn { zref-clever } { option-deprecated }
+ {
+ Option~'#1'~has~been~deprecated~\msg_line_context:.\iow_newline:
+ Use~'#2'~instead.
+ }
% \end{macrocode}
%
%
% \subsection{Data extraction}
%
%
-% \begin{macro}{\@@_def_extract:Nnnn}
+% \begin{macro}{\@@_extract_default:Nnnn}
% Extract property \meta{prop} from \meta{label} and sets variable \meta{tl
% var} with extracted value. Ensure \cs{zref@extractdefault} is expanded
% exactly twice, but no further to retrieve the proper value. In case the
% property is not found, set \meta{tl var} with \meta{default}.
% \begin{syntax}
-% \cs{@@_def_extract:Nnnn} \Arg{tl val}
+% \cs{@@_extract_default:Nnnn} \Arg{tl val}
% ~~\Arg{label} \Arg{prop} \Arg{default}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_def_extract:Nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_extract_default:Nnnn #1#2#3#4
{
\exp_args:NNNo \exp_args:NNo \tl_set:Nn #1
{ \zref@extractdefault {#2} {#3} {#4} }
}
-\cs_generate_variant:Nn \@@_def_extract:Nnnn { NVnn }
+\cs_generate_variant:Nn \@@_extract_default:Nnnn { NVnn }
% \end{macrocode}
% \end{macro}
%
@@ -714,31 +728,32 @@
%
% For a general discussion on the precedence rules for reference format
% options, see Section ``Reference format'' in the User manual. Internally,
-% these precedence rules are handled / enforced in \cs{@@_get_ref_string:nN},
-% \cs{@@_get_ref_font:nN}, and \cs{@@_type_name_setup:} which are the basic
-% functions to retrieve proper values for reference format settings. The
-% ``fallback'' settings are stored in \cs{g_@@_fallback_dict_prop}.
+% these precedence rules are handled / enforced in
+% \cs{@@_get_ref_opt_typeset:nN}, \cs{@@_get_ref_opt_font:nN}, and
+% \cs{@@_type_name_setup:} which are the basic functions to retrieve proper
+% values for reference format settings. The ``fallback'' settings are stored
+% in \cs{g_@@_fallback_unknown_lang_prop}.
%
%
% \begin{macro}
% {
% \l_@@_setup_type_tl ,
-% \l_@@_dict_language_tl ,
-% \l_@@_dict_decl_case_tl ,
-% \l_@@_dict_declension_seq ,
-% \l_@@_dict_gender_seq ,
+% \l_@@_base_language_tl ,
+% \l_@@_lang_decl_case_tl ,
+% \l_@@_lang_declension_seq ,
+% \l_@@_lang_gender_seq ,
% }
% Store ``current'' type, language, and declension cases in different places
-% for option and translation handling, notably in
-% \cs{@@_provide_dictionary:n}, \cs{zcRefTypeSetup}, and
-% \cs{zcLanguageSetup}. But also for translations retrieval, in
-% \cs{@@_get_type_transl:nnnN} and \cs{@@_get_default_transl:nnN}.
+% for type-specific and language-specific options handling, notably in
+% \cs{@@_provide_langfile:n}, \cs{zcRefTypeSetup}, and
+% \cs{zcLanguageSetup}. But also for language options retrieval, in
+% \cs{@@_get_lang_opt_type:nnnN} and \cs{@@_get_lang_opt_default:nnN}.
% \begin{macrocode}
\tl_new:N \l_@@_setup_type_tl
-\tl_new:N \l_@@_dict_language_tl
-\tl_new:N \l_@@_dict_decl_case_tl
-\seq_new:N \l_@@_dict_declension_seq
-\seq_new:N \l_@@_dict_gender_seq
+\tl_new:N \l_@@_base_language_tl
+\tl_new:N \l_@@_lang_decl_case_tl
+\seq_new:N \l_@@_lang_declension_seq
+\seq_new:N \l_@@_lang_gender_seq
% \end{macrocode}
% \end{macro}
%
@@ -773,13 +788,13 @@
listsep ,
lastsep ,
rangesep ,
- refpre ,
- refpos ,
+ preref ,
+ postref ,
}
% \end{macrocode}
% Only ``type names'' are ``necessarily type-specific'', which makes them
% somewhat special on the retrieval side of things. In short, they don't have
-% their values queried by \cs{@@_get_ref_string:nN}, but by
+% their values queried by \cs{@@_get_ref_opt_typeset:nN}, but by
% \cs{@@_type_name_setup:}.
% \begin{macrocode}
\seq_const_from_clist:Nn
@@ -830,12 +845,13 @@
%
% \begin{macro}{\g_@@_languages_prop}
% Stores the names of known languages and the mapping from ``language name''
-% to ``dictionary name''. Whether or not a language or alias is known to
+% to ``base language name''. Whether or not a language or alias is known to
% \pkg{zref-clever} is decided by its presence in this property list. A
% ``base language'' (loose concept here, meaning just ``the name we gave for
-% the dictionary in that particular language'') is just like any other one,
-% the only difference is that the ``language name'' happens to be the same
-% as the ``dictionary name'', in other words, it is an ``alias to itself''.
+% the language file in that particular language'') is just like any other
+% one, the only difference is that the ``language name'' happens to be the
+% same as the ``base language name'', in other words, it is an ``alias to
+% itself''.
% \begin{macrocode}
\prop_new:N \g_@@_languages_prop
% \end{macrocode}
@@ -844,7 +860,7 @@
%
% \begin{macro}[int]{\zcDeclareLanguage}
% Declare a new language for use with \pkg{zref-clever}. \meta{language} is
-% taken to be both the ``language name'' and the ``dictionary name''.
+% taken to be both the ``language name'' and the ``base language name''.
% \oarg{options} receive a \texttt{k=v} set of options, with three valid
% options. The first, \opt{declension}, takes the noun declension cases
% prefixes for \meta{language} as a comma separated list, whose first
@@ -856,7 +872,7 @@
% \meta{language} is already known, just warn. This implies a particular
% restriction regarding \oarg{options}, namely that these options, when
% defined by the package, cannot be redefined by the user. This is
-% deliberate, otherwise the built-in dictionaries would become much too
+% deliberate, otherwise the built-in language files would become much too
% sensitive to this particular user input, and unnecessarily so.
% \cs{zcDeclareLanguage} is preamble only.
% \begin{syntax}
@@ -872,8 +888,8 @@
{ \msg_warning:nnn { zref-clever } { language-declared } {#2} }
{
\prop_gput:Nnn \g_@@_languages_prop {#2} {#2}
- \prop_new:c { g_@@_dict_ #2 _prop }
- \tl_set:Nn \l_@@_dict_language_tl {#2}
+ \prop_new:c { g_@@_lang_ #2 _prop }
+ \tl_set:Nn \l_@@_base_language_tl {#2}
\keys_set:nn { zref-clever / declarelang } {#1}
}
}
@@ -885,10 +901,10 @@
%
%
% \begin{macro}[int]{\zcDeclareLanguageAlias}
-% Declare \meta{language alias} to be an alias of \meta{aliased language}.
-% \meta{aliased language} must be already known to \pkg{zref-clever}, as
-% stored in \cs{g_@@_languages_prop}. \cs{zcDeclareLanguageAlias} is
-% preamble only.
+% Declare \meta{language alias} to be an alias of \meta{aliased language}
+% (or ``base language''). \meta{aliased language} must be already known to
+% \pkg{zref-clever}, as stored in \cs{g_@@_languages_prop}.
+% \cs{zcDeclareLanguageAlias} is preamble only.
% \begin{syntax}
% \cs{zcDeclareLanguageAlias} \marg{language alias} \marg{aliased language}
% \end{syntax}
@@ -918,21 +934,21 @@
declension .code:n =
{
\prop_gput:cnn
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ declension } {#1}
} ,
declension .value_required:n = true ,
gender .code:n =
{
\prop_gput:cnn
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ gender } {#1}
} ,
gender .value_required:n = true ,
allcaps .code:n =
{
\prop_gput:cnn
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ allcaps } { true }
} ,
allcaps .value_forbidden:n = true ,
@@ -956,7 +972,7 @@
{
\exp_args:NNx \prop_get:NnNTF \g_@@_languages_prop
{ \l_@@_ref_language_tl }
- \l_@@_dict_language_tl
+ \l_@@_base_language_tl
{
% \end{macrocode}
% Validate the declension case (\opt{d}) option against the declared cases for
@@ -967,16 +983,16 @@
% warning about it.
% \begin{macrocode}
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_declension_seq
+ \l_@@_lang_declension_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ declension }
}
- \seq_if_empty:NTF \l_@@_dict_declension_seq
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
{
\tl_if_empty:NF \l_@@_ref_decl_case_tl
{
@@ -990,18 +1006,18 @@
{
\tl_if_empty:NTF \l_@@_ref_decl_case_tl
{
- \seq_get_left:NN \l_@@_dict_declension_seq
+ \seq_get_left:NN \l_@@_lang_declension_seq
\l_@@_ref_decl_case_tl
}
{
- \seq_if_in:NVF \l_@@_dict_declension_seq
+ \seq_if_in:NVF \l_@@_lang_declension_seq
\l_@@_ref_decl_case_tl
{
\msg_warning:nnxx { zref-clever }
{ unknown-decl-case }
{ \l_@@_ref_decl_case_tl }
{ \l_@@_ref_language_tl }
- \seq_get_left:NN \l_@@_dict_declension_seq
+ \seq_get_left:NN \l_@@_lang_declension_seq
\l_@@_ref_decl_case_tl
}
}
@@ -1012,16 +1028,16 @@
% genders declared for the former, clear \cs{l_@@_ref_gender_tl} and warn.
% \begin{macrocode}
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_gender_seq
+ \l_@@_lang_gender_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ gender }
}
- \seq_if_empty:NTF \l_@@_dict_gender_seq
+ \seq_if_empty:NTF \l_@@_lang_gender_seq
{
\tl_if_empty:NF \l_@@_ref_gender_tl
{
@@ -1036,7 +1052,7 @@
{
\tl_if_empty:NF \l_@@_ref_gender_tl
{
- \seq_if_in:NVF \l_@@_dict_gender_seq
+ \seq_if_in:NVF \l_@@_lang_gender_seq
\l_@@_ref_gender_tl
{
\msg_warning:nnxx { zref-clever }
@@ -1048,20 +1064,20 @@
}
}
% \end{macrocode}
-% Ensure \cs{l_@@_capitalize_bool} is set to \texttt{true} when the language
-% was declared with \opt{allcaps} option.
+% Ensure the \opt{cap} in \cs{l_@@_ref_options_prop} is set to \texttt{true}
+% when the language was declared with \opt{allcaps} option.
% \begin{macrocode}
\str_if_eq:eeT
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ allcaps }
}
{ true }
- { \bool_set_true:N \l_@@_capitalize_bool }
+ { \prop_put:Nnn \l_@@_ref_options_prop { cap } { true } }
}
{
% \end{macrocode}
@@ -1091,26 +1107,25 @@
%
%
%
-% \subsection{Dictionaries}
+% \subsection{Language files}
%
% Contrary to general options and type options, which are always \emph{local},
-% ``dictionaries'', ``translations'' or ``language-specific settings'' are
-% always \emph{global}. Hence, the loading of built-in dictionaries, as well
-% as settings done with \cs{zcLanguageSetup}, should set the relevant
-% variables globally.
-%
-% The built-in dictionaries and their related infrastructure are designed to
-% perform ``on the fly'' loading of dictionaries, ``lazily'' as needed. Much
-% like \pkg{babel} does for languages not declared in the preamble, but used
-% in the document. This offers some convenience, of course, and that's one
-% reason to do it. But it also has the purpose of parsimony, of ``loading the
-% least possible''. Therefore, we load at \texttt{begindocument} one single
-% language (see \zcref[ref=title, noname]{sec:lang-option}), as specified by
-% the user in the preamble with the \opt{lang} option or, failing any
-% specification, the current language of the document, which is the default.
-% Anything else is lazily loaded, on the fly, along the document.
-%
-% This design decision has also implications to the \emph{form} the dictionary
+% language-specific settings are always \emph{global}. Hence, the loading of
+% built-in language files, as well as settings done with \cs{zcLanguageSetup},
+% should set the relevant variables globally.
+%
+% The built-in language files and their related infrastructure are designed to
+% perform ``on the fly'' loading of the language files, ``lazily'' as needed.
+% Much like \pkg{babel} does for languages not declared in the preamble, but
+% used in the document. This offers some convenience, of course, and that's
+% one reason to do it. But it also has the purpose of parsimony, of ``loading
+% the least possible''. Therefore, we load at \texttt{begindocument} one
+% single language (see \zcref[ref=title, noname]{sec:lang-option}), as
+% specified by the user in the preamble with the \opt{lang} option or, failing
+% any specification, the current language of the document, which is the
+% default. Anything else is lazily loaded, on the fly, along the document.
+%
+% This design decision has also implications to the \emph{form} the language
% files assumed. As far as my somewhat impressionistic sampling goes,
% dictionary or localization files of the most common packages in this area of
% functionality, are usually a set of commands which perform the relevant
@@ -1126,193 +1141,196 @@
% \file{.ini} files are not in this form, but actually resemble
% ``configuration files'' of sorts, which means they are read and processed
% somehow else than with just \cs{input}. So we do the more or less the same
-% here. It seems a reasonable way to ensure we can load dictionaries on the
+% here. It seems a reasonable way to ensure we can load language files on the
% fly robustly mid-document, without getting paranoid with the last bit of
% white-space in them, and without introducing any undue content on the stream
% when we cannot afford to do it. Hence, \pkg{zref-clever}'s built-in
-% dictionary files are a set of \emph{key-value options} which are read from
-% the file, and fed to \texttt{\cs{keys_set:nn}\{zref-clever/dictionary\}} by
-% \cs{@@_provide_dictionary:n}. And they use the same syntax and options as
-% \cs{zcLanguageSetup} does. The dictionary file itself is read with
+% language files are a set of \emph{key-value options} which are read from the
+% file, and fed to \texttt{\cs{keys_set:nn}\{zref-clever/langfile\}} by
+% \cs{@@_provide_langfile:n}. And they use the same syntax and options as
+% \cs{zcLanguageSetup} does. The language file itself is read with
% \cs{ExplSyntaxOn} with the usual implications for white-space and catcodes.
%
-% \cs{@@_provide_dictionary:n} is only meant to load the built-in
-% dictionaries. For languages declared by the user, or for any settings to a
-% known language made with \cs{zcLanguageSetup}, values are populated directly
-% to a variable \cs{g_@@_dict_\meta{language}_prop}. Hence, there is no need
-% to ``load'' anything in this case: definitions and assignments made by the
-% user are performed immediately.
+% \cs{@@_provide_langfile:n} is only meant to load the built-in language
+% files. For languages declared by the user, or for any settings to a known
+% language made with \cs{zcLanguageSetup}, values are populated directly to a
+% variable \cs{g_@@_lang_\meta{language}_prop}. Hence, there is no need to
+% ``load'' anything in this case: definitions and assignments made by the user
+% are performed immediately.
%
%
% \subsubsection*{Provide}
%
-% \begin{macro}{\g_@@_loaded_dictionaries_seq}
-% Used to keep track of whether a dictionary has already been loaded or not.
+% \begin{macro}{\g_@@_loaded_langfiles_seq}
+% Used to keep track of whether a language file has already been loaded or
+% not.
% \begin{macrocode}
-\seq_new:N \g_@@_loaded_dictionaries_seq
+\seq_new:N \g_@@_loaded_langfiles_seq
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\l_@@_load_dict_verbose_bool}
-% Controls whether \cs{@@_provide_dictionary:n} fails silently or verbosely
-% in case of unknown languages or dictionaries not found.
+% \begin{macro}{\l_@@_load_langfile_verbose_bool}
+% Controls whether \cs{@@_provide_langfile:n} fails silently or verbosely
+% in case of unknown languages or not found language files.
% \begin{macrocode}
-\bool_new:N \l_@@_load_dict_verbose_bool
+\bool_new:N \l_@@_load_langfile_verbose_bool
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\@@_provide_dictionary:n}
-% Load dictionary for known \meta{language} if it is available and if it has
-% not already been loaded.
+% \begin{macro}{\@@_provide_langfile:n}
+% Load language file for known \meta{language} if it is available and if it
+% has not already been loaded.
% \begin{syntax}
-% \cs{@@_provide_dictionary:n} \Arg{language}
+% \cs{@@_provide_langfile:n} \Arg{language}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_provide_dictionary:n #1
+\cs_new_protected:Npn \@@_provide_langfile:n #1
{
\group_begin:
\@bsphack
\prop_get:NnNTF \g_@@_languages_prop {#1}
- \l_@@_dict_language_tl
+ \l_@@_base_language_tl
{
\seq_if_in:NVF
- \g_@@_loaded_dictionaries_seq
- \l_@@_dict_language_tl
+ \g_@@_loaded_langfiles_seq
+ \l_@@_base_language_tl
{
\exp_args:Nx \file_get:nnNTF
- { zref-clever- \l_@@_dict_language_tl .dict }
+ { zref-clever- \l_@@_base_language_tl .lang }
{ \ExplSyntaxOn }
\l_tmpa_tl
{
\tl_clear:N \l_@@_setup_type_tl
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_declension_seq
+ \l_@@_lang_declension_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ declension }
}
- \seq_if_empty:NTF \l_@@_dict_declension_seq
- { \tl_clear:N \l_@@_dict_decl_case_tl }
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
+ { \tl_clear:N \l_@@_lang_decl_case_tl }
{
- \seq_get_left:NN \l_@@_dict_declension_seq
- \l_@@_dict_decl_case_tl
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
}
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_gender_seq
+ \l_@@_lang_gender_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ gender }
}
- \keys_set:nV { zref-clever / dictionary } \l_tmpa_tl
- \seq_gput_right:NV \g_@@_loaded_dictionaries_seq
- \l_@@_dict_language_tl
- \msg_note:nnx { zref-clever } { dict-loaded }
- { \l_@@_dict_language_tl }
+ \keys_set:nV { zref-clever / langfile } \l_tmpa_tl
+ \seq_gput_right:NV \g_@@_loaded_langfiles_seq
+ \l_@@_base_language_tl
+ \msg_note:nnx { zref-clever } { langfile-loaded }
+ { \l_@@_base_language_tl }
}
{
- \bool_if:NT \l_@@_load_dict_verbose_bool
+ \bool_if:NT \l_@@_load_langfile_verbose_bool
{
- \msg_warning:nnx { zref-clever } { dict-not-available }
- { \l_@@_dict_language_tl }
+ \msg_warning:nnx { zref-clever } { langfile-not-available }
+ { \l_@@_base_language_tl }
}
% \end{macrocode}
-% Even if we don't have the actual dictionary, we register it as ``loaded''.
-% At this point, it is a known language, properly declared. There is no point
-% in trying to load it multiple times, because users cannot really provide the
-% dictionary files (well, technically they could, but we are working so they
-% don't need to, and have better ways to do what they want). And if the users
-% had provided some translations themselves, by means of \cs{zcLanguageSetup},
-% everything would be in place, and they could use the \opt{lang} option
-% multiple times, and the \texttt{dict-not-available} warning would never go
-% away.
-% \begin{macrocode}
- \seq_gput_right:NV \g_@@_loaded_dictionaries_seq
- \l_@@_dict_language_tl
+% Even if we don't have the actual language file, we register it as
+% ``loaded''. At this point, it is a known language, properly declared.
+% There is no point in trying to load it multiple times, because users cannot
+% really provide the language files (well, technically they could, but we are
+% working so they don't need to, and have better ways to do what they want).
+% And if the users had provided some language-specific options themselves, by
+% means of \cs{zcLanguageSetup}, everything would be in place, and they could
+% use the \opt{lang} option multiple times, and the
+% \texttt{langfile-not-available} warning would never go away.
+% \begin{macrocode}
+ \seq_gput_right:NV \g_@@_loaded_langfiles_seq
+ \l_@@_base_language_tl
}
}
}
{
- \bool_if:NT \l_@@_load_dict_verbose_bool
+ \bool_if:NT \l_@@_load_langfile_verbose_bool
{ \msg_warning:nnn { zref-clever } { unknown-language-load } {#1} }
}
\@esphack
\group_end:
}
-\cs_generate_variant:Nn \@@_provide_dictionary:n { x }
+\cs_generate_variant:Nn \@@_provide_langfile:n { x }
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\@@_provide_dictionary_verbose:n}
-% Does the same as \cs{@@_provide_dictionary:n}, but warns if the loading of
-% the dictionary has failed.
+% \begin{macro}{\@@_provide_langfile_verbose:n}
+% Does the same as \cs{@@_provide_langfile:n}, but warns if the loading of
+% the language file has failed.
% \begin{syntax}
-% \cs{@@_provide_dictionary_verbose:n} \Arg{language}
+% \cs{@@_provide_langfile_verbose:n} \Arg{language}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_provide_dictionary_verbose:n #1
+\cs_new_protected:Npn \@@_provide_langfile_verbose:n #1
{
\group_begin:
- \bool_set_true:N \l_@@_load_dict_verbose_bool
- \@@_provide_dictionary:n {#1}
+ \bool_set_true:N \l_@@_load_langfile_verbose_bool
+ \@@_provide_langfile:n {#1}
\group_end:
}
-\cs_generate_variant:Nn \@@_provide_dictionary_verbose:n { x }
+\cs_generate_variant:Nn \@@_provide_langfile_verbose:n { x }
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}
% {
-% \@@_provide_dict_type_transl:nn ,
-% \@@_provide_dict_default_transl:nn ,
+% \@@_provide_lang_opt_type:nn ,
+% \@@_provide_lang_opt_default:nn ,
% }
% A couple of auxiliary functions for the of
-% \texttt{{zref-clever/dictionary}} keys set in
-% \cs{@@_provide_dictionary:n}. They respectively ``provide'' (i.e. set if
+% \texttt{{zref-clever/langfile}} keys set in
+% \cs{@@_provide_langfile:n}. They respectively ``provide'' (i.e. set if
% it value does not exist, do nothing if it already does) ``type-specific''
-% and ``default'' translations. Both receive \meta{key} and
-% \meta{translation} as arguments, but \cs{@@_provide_dict_type_transl:nn}
+% and ``default'' language options. Both receive \meta{key} and
+% \meta{value} as arguments, but \cs{@@_provide_lang_opt_type:nn}
% relies on the current value of \cs{l_@@_setup_type_tl}, as set by the
% \texttt{type} key.
% \begin{syntax}
-% \cs{@@_provide_dict_type_transl:nn} \Arg{key} \Arg{translation}
-% \cs{@@_provide_dict_default_transl:nn} \Arg{key} \Arg{translation}
+% \cs{@@_provide_lang_opt_type:nn} \Arg{key} \Arg{value}
+% \cs{@@_provide_lang_opt_default:nn} \Arg{key} \Arg{value}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_provide_dict_type_transl:nn #1#2
+\cs_new_protected:Npn \@@_provide_lang_opt_type:nn #1#2
{
\exp_args:Nnx \prop_gput_if_new:cnn
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ type- \l_@@_setup_type_tl - #1 } {#2}
}
-\cs_new_protected:Npn \@@_provide_dict_default_transl:nn #1#2
+\cs_generate_variant:Nn \@@_provide_lang_opt_type:nn { nV }
+\cs_new_protected:Npn \@@_provide_lang_opt_default:nn #1#2
{
\prop_gput_if_new:cnn
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ default- #1 } {#2}
}
+\cs_generate_variant:Nn \@@_provide_lang_opt_default:nn { nV }
% \end{macrocode}
% \end{macro}
%
%
-% The set of keys for \texttt{{zref-clever/dictionary}}, which is used to
-% process the dictionary files in \cs{@@_provide_dictionary:n}. The no-op
-% cases for each category have their messages sent to ``info''. These
-% messages should not occur, as long as the dictionaries are well formed, but
-% they're placed there nevertheless, and can be leveraged in regression tests.
+% The set of keys for \texttt{{zref-clever/langfile}}, which is used to
+% process the language files in \cs{@@_provide_langfile:n}. The no-op cases
+% for each category have their messages sent to ``info''. These messages
+% should not occur, as long as the language files are well formed, but they're
+% placed there nevertheless, and can be leveraged in regression tests.
%
% \begin{macrocode}
-\keys_define:nn { zref-clever / dictionary }
+\keys_define:nn { zref-clever / langfile }
{
type .code:n =
{
@@ -1320,31 +1338,33 @@
{ \tl_clear:N \l_@@_setup_type_tl }
{ \tl_set:Nn \l_@@_setup_type_tl {#1} }
} ,
+
case .code:n =
{
- \seq_if_empty:NTF \l_@@_dict_declension_seq
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
{
\msg_info:nnxx { zref-clever } { language-no-decl-setup }
- { \l_@@_dict_language_tl } {#1}
+ { \l_@@_base_language_tl } {#1}
}
{
- \seq_if_in:NnTF \l_@@_dict_declension_seq {#1}
- { \tl_set:Nn \l_@@_dict_decl_case_tl {#1} }
+ \seq_if_in:NnTF \l_@@_lang_declension_seq {#1}
+ { \tl_set:Nn \l_@@_lang_decl_case_tl {#1} }
{
\msg_info:nnxx { zref-clever } { unknown-decl-case }
- {#1} { \l_@@_dict_language_tl }
- \seq_get_left:NN \l_@@_dict_declension_seq
- \l_@@_dict_decl_case_tl
+ {#1} { \l_@@_base_language_tl }
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
}
}
} ,
case .value_required:n = true ,
+
gender .code:n =
{
- \seq_if_empty:NTF \l_@@_dict_gender_seq
+ \seq_if_empty:NTF \l_@@_lang_gender_seq
{
\msg_info:nnxxx { zref-clever } { language-no-gender }
- { \l_@@_dict_language_tl } { gender } {#1}
+ { \l_@@_base_language_tl } { gender } {#1}
}
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -1353,27 +1373,71 @@
{ option-only-type-specific } { gender }
}
{
- \seq_if_in:NnTF \l_@@_dict_gender_seq {#1}
- { \@@_provide_dict_type_transl:nn { gender } {#1} }
+ \clist_clear:N \l_tmpa_clist
+ \clist_map_inline:nn {#1}
+ {
+ \seq_if_in:NnTF \l_@@_lang_gender_seq {##1}
+ { \clist_put_right:Nn \l_tmpa_clist {##1} }
+ {
+ \msg_info:nnxx { zref-clever }
+ { gender-not-declared }
+ { \l_@@_base_language_tl } {##1}
+ }
+ }
+ \clist_if_empty:NF \l_tmpa_clist
{
- \msg_info:nnxx { zref-clever } { gender-not-declared }
- { \l_@@_dict_language_tl } {#1}
+ \exp_args:Nnx \@@_provide_lang_opt_type:nn
+ { gender } { \clist_use:Nn \l_tmpa_clist { , } }
}
}
}
} ,
gender .value_required:n = true ,
+
+ cap .choices:nn =
+ { true , false }
+ {
+ \tl_if_empty:NTF \l_@@_setup_type_tl
+ {
+ \@@_provide_lang_opt_default:nV
+ { cap } \l_keys_choice_tl
+ }
+ {
+ \@@_provide_lang_opt_type:nV
+ { cap } \l_keys_choice_tl
+ }
+ } ,
+ cap .default:n = true ,
+ nocap .meta:n = { cap = false } ,
+ nocap .value_forbidden:n = true ,
+
+ abbrev .choices:nn =
+ { true , false }
+ {
+ \tl_if_empty:NTF \l_@@_setup_type_tl
+ {
+ \@@_provide_lang_opt_default:nV
+ { abbrev } \l_keys_choice_tl
+ }
+ {
+ \@@_provide_lang_opt_type:nV
+ { abbrev } \l_keys_choice_tl
+ }
+ } ,
+ abbrev .default:n = true ,
+ noabbrev .meta:n = { abbrev = false },
+ noabbrev .value_forbidden:n = true ,
}
\seq_map_inline:Nn
\c_@@_ref_options_necessarily_not_type_specific_seq
{
- \keys_define:nn { zref-clever / dictionary }
+ \keys_define:nn { zref-clever / langfile }
{
#1 .value_required:n = true ,
#1 .code:n =
{
\tl_if_empty:NTF \l_@@_setup_type_tl
- { \@@_provide_dict_default_transl:nn {#1} {##1} }
+ { \@@_provide_lang_opt_default:nn {#1} {##1} }
{
\msg_info:nnn { zref-clever }
{ option-not-type-specific } {#1}
@@ -1384,21 +1448,21 @@
\seq_map_inline:Nn
\c_@@_ref_options_possibly_type_specific_seq
{
- \keys_define:nn { zref-clever / dictionary }
+ \keys_define:nn { zref-clever / langfile }
{
#1 .value_required:n = true ,
#1 .code:n =
{
\tl_if_empty:NTF \l_@@_setup_type_tl
- { \@@_provide_dict_default_transl:nn {#1} {##1} }
- { \@@_provide_dict_type_transl:nn {#1} {##1} }
+ { \@@_provide_lang_opt_default:nn {#1} {##1} }
+ { \@@_provide_lang_opt_type:nn {#1} {##1} }
} ,
}
}
\seq_map_inline:Nn
\c_@@_ref_options_type_names_seq
{
- \keys_define:nn { zref-clever / dictionary }
+ \keys_define:nn { zref-clever / langfile }
{
#1 .value_required:n = true ,
#1 .code:n =
@@ -1409,11 +1473,11 @@
{ option-only-type-specific } {#1}
}
{
- \tl_if_empty:NTF \l_@@_dict_decl_case_tl
- { \@@_provide_dict_type_transl:nn {#1} {##1} }
+ \tl_if_empty:NTF \l_@@_lang_decl_case_tl
+ { \@@_provide_lang_opt_type:nn {#1} {##1} }
{
- \@@_provide_dict_type_transl:nn
- { \l_@@_dict_decl_case_tl - #1 } {##1}
+ \@@_provide_lang_opt_type:nn
+ { \l_@@_lang_decl_case_tl - #1 } {##1}
}
}
} ,
@@ -1425,22 +1489,22 @@
%
% \subsubsection*{Fallback}
%
-% All ``strings'' queried with \cs{@@_get_ref_string:nN} -- in practice, those
-% in either \cs{c_@@_ref_options_necessarily_not_type_specific_seq} or
+% All ``strings'' queried with \cs{@@_get_ref_opt_typeset:nN} -- in practice,
+% those in either \cs{c_@@_ref_options_necessarily_not_type_specific_seq} or
% \cs{c_@@_ref_options_possibly_type_specific_seq} -- must have their values
% set for ``fallback'', even if to empty ones, since this is what will be
-% retrieved in the absence of a proper translation, which will be the case if
-% \pkg{babel} or \pkg{polyglossia} is loaded and sets a language which
-% \pkg{zref-clever} does not know. On the other hand, ``type names'' are not
-% looked for in ``fallback'', since it is indeed impossible to provide any
-% reasonable value for them for a ``specified but unknown language''. Also
-% ``font'' options -- those in \cs{c_@@_ref_options_font_seq}, and queried
-% with \cs{@@_get_ref_font:nN} -- do not need to be provided here, since the
-% later function sets an empty value if the option is not found.
+% retrieved in the absence of a proper language-specific option, which will be
+% the case if \pkg{babel} or \pkg{polyglossia} is loaded and sets a language
+% which \pkg{zref-clever} does not know. On the other hand, ``type names''
+% are not looked for in ``fallback'', since it is indeed impossible to provide
+% any reasonable value for them for a ``specified but unknown language''.
+% Also ``font'' options -- those in \cs{c_@@_ref_options_font_seq}, and
+% queried with \cs{@@_get_ref_opt_font:nN} -- do not need to be provided here,
+% since the later function sets an empty value if the option is not found.
%
% \begin{macrocode}
-\prop_new:N \g_@@_fallback_dict_prop
-\prop_gset_from_keyval:Nn \g_@@_fallback_dict_prop
+\prop_new:N \g_@@_fallback_unknown_lang_prop
+\prop_gset_from_keyval:Nn \g_@@_fallback_unknown_lang_prop
{
tpairsep = {,~} ,
tlistsep = {,~} ,
@@ -1451,33 +1515,33 @@
listsep = {,~} ,
lastsep = {,~} ,
rangesep = {\textendash} ,
- refpre = {} ,
- refpos = {} ,
+ preref = {} ,
+ postref = {} ,
}
% \end{macrocode}
%
%
%
-% \subsubsection*{Get translations}
+% \subsubsection*{Get language options}
%
-% \begin{macro}{\@@_get_type_transl:nnnNF}
-% Get type-specific translation of \meta{key} for \meta{type} and
+% \begin{macro}{\@@_get_lang_opt_type:nnnNF}
+% Get type-specific language option of \meta{key} for \meta{type} and
% \meta{language}, and store it in \meta{tl variable} if found. If not
% found, leave the \meta{false code} on the stream, in which case the value
% of \meta{tl variable} should not be relied upon.
% \begin{syntax}
-% \cs{@@_get_type_transl:nnnNF} \Arg{language} \Arg{type} \Arg{key}
+% \cs{@@_get_lang_opt_type:nnnNF} \Arg{language} \Arg{type} \Arg{key}
% ~~\meta{tl variable} \Arg{false code}
% \end{syntax}
% \begin{macrocode}
\prg_new_protected_conditional:Npnn
- \@@_get_type_transl:nnnN #1#2#3#4 { F }
+ \@@_get_lang_opt_type:nnnN #1#2#3#4 { F }
{
\prop_get:NnNTF \g_@@_languages_prop {#1}
- \l_@@_dict_language_tl
+ \l_@@_base_language_tl
{
\prop_get:cnNTF
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ type- #2 - #3 } #4
{ \prg_return_true: }
{ \prg_return_false: }
@@ -1485,29 +1549,29 @@
{ \prg_return_false: }
}
\prg_generate_conditional_variant:Nnn
- \@@_get_type_transl:nnnN { xxxN , xxnN } { F }
+ \@@_get_lang_opt_type:nnnN { xxxN , xxnN } { F }
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\@@_get_default_transl:nnNF}
-% Get default translation of \meta{key} for \meta{language}, and store it in
-% \meta{tl variable} if found. If not found, leave the \meta{false code} on
-% the stream, in which case the value of \meta{tl variable} should not be
-% relied upon.
+% \begin{macro}{\@@_get_lang_opt_default:nnNF}
+% Get default language option of \meta{key} for \meta{language}, and store
+% it in \meta{tl variable} if found. If not found, leave the \meta{false
+% code} on the stream, in which case the value of \meta{tl variable} should
+% not be relied upon.
% \begin{syntax}
-% \cs{@@_get_default_transl:nnNF} \Arg{language} \Arg{key}
+% \cs{@@_get_lang_opt_default:nnNF} \Arg{language} \Arg{key}
% ~~\meta{tl variable} \Arg{false code}
% \end{syntax}
% \begin{macrocode}
\prg_new_protected_conditional:Npnn
- \@@_get_default_transl:nnN #1#2#3 { F }
+ \@@_get_lang_opt_default:nnN #1#2#3 { F }
{
\prop_get:NnNTF \g_@@_languages_prop {#1}
- \l_@@_dict_language_tl
+ \l_@@_base_language_tl
{
\prop_get:cnNTF
- { g_@@_dict_ \l_@@_dict_language_tl _prop }
+ { g_@@_lang_ \l_@@_base_language_tl _prop }
{ default- #2 } #3
{ \prg_return_true: }
{ \prg_return_false: }
@@ -1515,25 +1579,26 @@
{ \prg_return_false: }
}
\prg_generate_conditional_variant:Nnn
- \@@_get_default_transl:nnN { xnN } { F }
+ \@@_get_lang_opt_default:nnN { xnN } { F }
% \end{macrocode}
% \end{macro}
%
%
-% \begin{macro}{\@@_get_fallback_transl:nNF}
-% Get fallback translation of \meta{key}, and store it in \meta{tl variable}
-% if found. If not found, leave the \meta{false code} on the stream, in
-% which case the value of \meta{tl variable} should not be relied upon.
+% \begin{macro}{\@@_get_fallback_unknown_lang_opt:nNF}
+% Get fallback language option of \meta{key}, and store it in \meta{tl
+% variable} if found. If not found, leave the \meta{false code} on the
+% stream, in which case the value of \meta{tl variable} should not be relied
+% upon.
% \begin{syntax}
-% \cs{@@_get_fallback_transl:nNF} \Arg{key}
+% \cs{@@_get_fallback_unknown_lang_opt:nNF} \Arg{key}
% ~~\meta{tl variable} \Arg{false code}
% \end{syntax}
% \begin{macrocode}
% {<key>}<tl var to set>
\prg_new_protected_conditional:Npnn
- \@@_get_fallback_transl:nN #1#2 { F }
+ \@@_get_fallback_unknown_lang_opt:nN #1#2 { F }
{
- \prop_get:NnNTF \g_@@_fallback_dict_prop
+ \prop_get:NnNTF \g_@@_fallback_unknown_lang_prop
{ #1 } #2
{ \prg_return_true: }
{ \prg_return_false: }
@@ -1712,14 +1777,26 @@
% \subsubsection*{\opt{cap} and \opt{capfirst} options}
%
% \begin{macrocode}
-\bool_new:N \l_@@_capitalize_bool
\bool_new:N \l_@@_capitalize_first_bool
\keys_define:nn { zref-clever / reference }
{
- cap .bool_set:N = \l_@@_capitalize_bool ,
- cap .initial:n = false ,
+ cap .code:n =
+ {
+ \tl_if_empty:nTF {#1}
+ { \prop_remove:Nn \l_@@_ref_options_prop { cap } }
+ {
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:nn {#1} { true } }
+ { \str_if_eq_p:nn {#1} { false } }
+ { \prop_put:Nnn \l_@@_ref_options_prop { cap } {#1} }
+ {
+ \msg_warning:nnn { zref-clever }
+ { key-boolean-or-empty } {#1}
+ }
+ }
+ } ,
cap .default:n = true ,
- nocap .meta:n = { cap = false },
+ nocap .meta:n = { cap = false } ,
nocap .value_forbidden:n = true ,
capfirst .bool_set:N = \l_@@_capitalize_first_bool ,
@@ -1732,12 +1809,24 @@
% \subsubsection*{\opt{abbrev} and \opt{noabbrevfirst} options}
%
% \begin{macrocode}
-\bool_new:N \l_@@_abbrev_bool
\bool_new:N \l_@@_noabbrev_first_bool
\keys_define:nn { zref-clever / reference }
{
- abbrev .bool_set:N = \l_@@_abbrev_bool ,
- abbrev .initial:n = false ,
+ abbrev .code:n =
+ {
+ \tl_if_empty:nTF {#1}
+ { \prop_remove:Nn \l_@@_ref_options_prop { abbrev } }
+ {
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:nn {#1} { true } }
+ { \str_if_eq_p:nn {#1} { false } }
+ { \prop_put:Nnn \l_@@_ref_options_prop { abbrev } {#1} }
+ {
+ \msg_warning:nnn { zref-clever }
+ { key-boolean-or-empty } {#1}
+ }
+ }
+ } ,
abbrev .default:n = true ,
noabbrev .meta:n = { abbrev = false },
noabbrev .value_forbidden:n = true ,
@@ -1871,8 +1960,8 @@
% executed. Finally, we set a third \texttt{begindocument} hook, at
% \texttt{begindocument/before}, so that it runs after any options set in the
% preamble. This hook redefines the \opt{lang} option for immediate execution
-% in the document body, and ensures the \texttt{current} language's dictionary
-% gets loaded, if it hadn't been already.
+% in the document body, and ensures the \texttt{current} language's language
+% file gets loaded, if it hadn't been already.
%
% For the \pkg{babel} and \pkg{polyglossia} variables which store the
% ``current'' and ``main'' languages, see
@@ -1911,9 +2000,9 @@
% Provide default value for \cs{l_@@_ref_language_tl} corresponding to option
% \opt{current}, but do so outside of the \pkg{l3keys} machinery (that is,
% instead of using \texttt{.initial:n}), so that we are able to distinguish
-% when the user actually gave the option, in which case the dictionary loading
-% is done verbosely, from when we are setting the default value (here), in
-% which case the dictionary loading is done silently.
+% when the user actually gave the option, in which case the language file
+% loading is done verbosely, from when we are setting the default value
+% (here), in which case the language file loading is done silently.
% \begin{macrocode}
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
@@ -1934,7 +2023,7 @@
{
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
- \@@_provide_dictionary_verbose:x
+ \@@_provide_langfile_verbose:x
{ \l_@@_ref_language_tl }
}
@@ -1942,7 +2031,7 @@
{
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_main_language_tl }
- \@@_provide_dictionary_verbose:x
+ \@@_provide_langfile_verbose:x
{ \l_@@_ref_language_tl }
}
}
@@ -1955,7 +2044,7 @@
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
}
- \@@_provide_dictionary_verbose:x
+ \@@_provide_langfile_verbose:x
{ \l_@@_ref_language_tl }
}
}
@@ -1975,12 +2064,12 @@
% language is already loaded, otherwise, ensure the default one
% (\texttt{current}) gets loaded early, but not verbosely.
% \begin{macrocode}
- \@@_provide_dictionary:x { \l_@@_ref_language_tl }
+ \@@_provide_langfile:x { \l_@@_ref_language_tl }
% \end{macrocode}
% Redefinition of the \texttt{lang} key option for the document body. Also,
-% drop the verbose dictionary loading in the document body, as it can become
-% intrusive depending on the use case, and does not provide much ``juice''
-% anyway: in \cs{zcref} missing names warnings will already ensue.
+% drop the verbose language file loading in the document body, as it can
+% become intrusive depending on the use case, and does not provide much
+% ``juice'' anyway: in \cs{zcref} missing names warnings will already ensue.
% \begin{macrocode}
\keys_define:nn { zref-clever / reference }
{
@@ -1992,7 +2081,7 @@
{
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
- \@@_provide_dictionary:x
+ \@@_provide_langfile:x
{ \l_@@_ref_language_tl }
}
@@ -2000,7 +2089,7 @@
{
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_main_language_tl }
- \@@_provide_dictionary:x
+ \@@_provide_langfile:x
{ \l_@@_ref_language_tl }
}
}
@@ -2013,7 +2102,7 @@
\tl_set:Nn \l_@@_ref_language_tl
{ \l_@@_current_language_tl }
}
- \@@_provide_dictionary:x
+ \@@_provide_langfile:x
{ \l_@@_ref_language_tl }
}
} ,
@@ -2480,8 +2569,8 @@
% ``not necessarily type-specific'' options are pertinent here. However, they
% \emph{may} either be type-specific or language-specific, and thus must be
% stored in a property list, \cs{l_@@_ref_options_prop}, in order to be
-% retrieved from the option \emph{name} by \cs{@@_get_ref_string:nN} and
-% \cs{@@_get_ref_font:nN} according to context and precedence rules.
+% retrieved from the option \emph{name} by \cs{@@_get_ref_opt_typeset:nN} and
+% \cs{@@_get_ref_opt_font:nN} according to context and precedence rules.
%
% The keys are set so that any value, including an empty one, is added to
% \cs{l_@@_ref_options_prop}, while a key with \emph{no value} removes the
@@ -2505,6 +2594,21 @@
} ,
}
}
+\keys_define:nn { zref-clever / reference }
+ {
+ refpre .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpre } { preref }
+ } ,
+ refpos .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpos } { postref }
+ } ,
+ }
% \end{macrocode}
%
%
@@ -2573,13 +2677,12 @@
%
% \cs{zcRefTypeSetup} is the main user interface for ``type-specific''
% reference formatting. Settings done by this command have a higher
-% precedence than any translation, hence they override any language-specific
-% setting, either done at \cs{zcLanguageSetup} or by the package's
-% dictionaries. On the other hand, they have a lower precedence than non
-% type-specific general options. The \meta{options} should be given in the
-% usual \texttt{key=val} format. The \meta{type} does not need to pre-exist,
-% the property list variable to store the properties for the type gets created
-% if need be.
+% precedence than any language-specific setting, either done at
+% \cs{zcLanguageSetup} or by the package's language files. On the other hand,
+% they have a lower precedence than non type-specific general options. The
+% \meta{options} should be given in the usual \texttt{key=val} format. The
+% \meta{type} does not need to pre-exist, the property list variable to store
+% the properties for the type gets created if need be.
%
% \begin{macro}[int]{\zcRefTypeSetup}
% \begin{syntax}
@@ -2599,14 +2702,14 @@
%
% Inside \cs{zcRefTypeSetup} any of the options \emph{can} receive empty
% values, and those values, if they exist in the property list, will override
-% translations, regardless of their emptiness. In principle, we could live
-% with the situation of, once a setting has been made in
+% language-specific options, regardless of their emptiness. In principle, we
+% could live with the situation of, once a setting has been made in
% \cs{l_@@_type_<type>_options_prop} or in \cs{l_@@_ref_options_prop} it stays
% there forever, and can only be overridden by a new value at the same
% precedence level or a higher one. But it would be nice if an user can
% ``unset'' an option at either of those scopes to go back to the lower
-% precedence level of the translations at any given point. So both in
-% \cs{zcRefTypeSetup} and in setting reference options (see
+% precedence level of the language-specific options at any given point. So
+% both in \cs{zcRefTypeSetup} and in setting reference options (see
% \zcref{sec:reference-options}), we leverage the distinction of an ``empty
% valued key'' (\texttt{key=} or \texttt{key=\{\}}) from a ``key with no
% value'' (\texttt{key}). This distinction is captured internally by the
@@ -2618,6 +2721,79 @@
% \url{https://tex.stackexchange.com/q/614690} and
% \url{https://github.com/latex3/latex3/pull/988}.
%
+%
+% \begin{macrocode}
+\keys_define:nn { zref-clever / typesetup }
+ {
+ cap .code:n =
+ {
+ \tl_if_empty:nTF {#1}
+ {
+ \prop_remove:cn
+ {
+ l_@@_type_
+ \l_@@_setup_type_tl _options_prop
+ }
+ { cap }
+ }
+ {
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:nn {#1} { true } }
+ { \str_if_eq_p:nn {#1} { false } }
+ {
+ \prop_put:cnn
+ {
+ l_@@_type_
+ \l_@@_setup_type_tl _options_prop
+ }
+ { cap } {#1}
+ }
+ {
+ \msg_warning:nnn { zref-clever }
+ { key-boolean-or-empty } {#1}
+ }
+ }
+ } ,
+ cap .default:n = true ,
+ nocap .meta:n = { cap = false } ,
+ nocap .value_forbidden:n = true ,
+
+ abbrev .code:n =
+ {
+ \tl_if_empty:nTF {#1}
+ {
+ \prop_remove:cn
+ {
+ l_@@_type_
+ \l_@@_setup_type_tl _options_prop
+ }
+ { abbrev }
+ }
+ {
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:nn {#1} { true } }
+ { \str_if_eq_p:nn {#1} { false } }
+ {
+ \prop_put:cnn
+ {
+ l_@@_type_
+ \l_@@_setup_type_tl _options_prop
+ }
+ { abbrev } {#1}
+ }
+ {
+ \msg_warning:nnn { zref-clever }
+ { key-boolean-or-empty } {#1}
+ }
+ }
+ } ,
+ abbrev .default:n = true ,
+ noabbrev .meta:n = { abbrev = false },
+ noabbrev .value_forbidden:n = true ,
+ }
+% \end{macrocode}
+%
+%
% \begin{macrocode}
\seq_map_inline:Nn
\c_@@_ref_options_necessarily_not_type_specific_seq
@@ -2663,6 +2839,21 @@
} ,
}
}
+\keys_define:nn { zref-clever / typesetup }
+ {
+ refpre .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpre } { preref }
+ } ,
+ refpos .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpos } { postref }
+ } ,
+ }
% \end{macrocode}
%
%
@@ -2674,9 +2865,9 @@
% between the two cases is captured by the \texttt{type} key, which works as a
% sort of a ``switch''. Inside the \meta{options} argument of
% \cs{zcLanguageSetup}, any options made before the first \texttt{type} key
-% declare ``default'' (non type-specific) translations. When the
+% declare ``default'' (non type-specific) language options. When the
% \texttt{type} key is given with a value, the options following it will set
-% ``type-specific'' translations for that type. The current type can be
+% ``type-specific'' language options for that type. The current type can be
% switched off by an empty \texttt{type} key. \cs{zcLanguageSetup} is
% preamble only.
%
@@ -2689,32 +2880,32 @@
{
\group_begin:
\prop_get:NnNTF \g_@@_languages_prop {#1}
- \l_@@_dict_language_tl
+ \l_@@_base_language_tl
{
\tl_clear:N \l_@@_setup_type_tl
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_declension_seq
+ \l_@@_lang_declension_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ declension }
}
- \seq_if_empty:NTF \l_@@_dict_declension_seq
- { \tl_clear:N \l_@@_dict_decl_case_tl }
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
+ { \tl_clear:N \l_@@_lang_decl_case_tl }
{
- \seq_get_left:NN \l_@@_dict_declension_seq
- \l_@@_dict_decl_case_tl
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
}
\exp_args:NNx \seq_set_from_clist:Nn
- \l_@@_dict_gender_seq
+ \l_@@_lang_gender_seq
{
\prop_item:cn
{
- g_@@_dict_
- \l_@@_dict_language_tl _prop
+ g_@@_lang_
+ \l_@@_base_language_tl _prop
}
{ gender }
}
@@ -2730,38 +2921,39 @@
%
% \begin{macro}
% {
-% \@@_declare_type_transl:nnnn ,
-% \@@_declare_default_transl:nnn ,
+% \@@_declare_lang_opt_type:nnnn ,
+% \@@_declare_lang_opt_default:nnn ,
% }
% A couple of auxiliary functions for the of
-% \texttt{{zref-clever/translation}} keys set in \cs{zcLanguageSetup}. They
+% \texttt{{zref-clever/langsetup}} keys set in \cs{zcLanguageSetup}. They
% respectively declare (unconditionally set) ``type-specific'' and
-% ``default'' translations.
+% ``default'' language-specific options.
% \begin{syntax}
-% \cs{@@_declare_type_transl:nnnn} \Arg{language} \Arg{type}
-% ~~\Arg{key} \Arg{translation}
-% \cs{@@_declare_default_transl:nnn} \Arg{language}
-% ~~\Arg{key} \Arg{translation}
+% \cs{@@_declare_lang_opt_type:nnnn} \Arg{language} \Arg{type}
+% ~~\Arg{key} \Arg{value}
+% \cs{@@_declare_lang_opt_default:nnn} \Arg{language}
+% ~~\Arg{key} \Arg{value}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_declare_type_transl:nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_declare_lang_opt_type:nnnn #1#2#3#4
{
- \prop_gput:cnn { g_@@_dict_ #1 _prop }
+ \prop_gput:cnn { g_@@_lang_ #1 _prop }
{ type- #2 - #3 } {#4}
}
-\cs_generate_variant:Nn \@@_declare_type_transl:nnnn { VVnn , VVxn }
-\cs_new_protected:Npn \@@_declare_default_transl:nnn #1#2#3
+\cs_generate_variant:Nn
+ \@@_declare_lang_opt_type:nnnn { VVnn , VVxn , VVnx , VVnV }
+\cs_new_protected:Npn \@@_declare_lang_opt_default:nnn #1#2#3
{
- \prop_gput:cnn { g_@@_dict_ #1 _prop }
+ \prop_gput:cnn { g_@@_lang_ #1 _prop }
{ default- #2 } {#3}
}
-\cs_generate_variant:Nn \@@_declare_default_transl:nnn { Vnn }
+\cs_generate_variant:Nn \@@_declare_lang_opt_default:nnn { Vnn , VnV }
% \end{macrocode}
% \end{macro}
%
%
-% The set of keys for \texttt{{zref-clever/langsetup}}, which is used to
-% set language-specific translations in \cs{zcLanguageSetup}.
+% The set of keys for \texttt{{zref-clever/langsetup}}, which is used to set
+% language-specific options in \cs{zcLanguageSetup}.
%
% \begin{macrocode}
\keys_define:nn { zref-clever / langsetup }
@@ -2772,31 +2964,33 @@
{ \tl_clear:N \l_@@_setup_type_tl }
{ \tl_set:Nn \l_@@_setup_type_tl {#1} }
} ,
+
case .code:n =
{
- \seq_if_empty:NTF \l_@@_dict_declension_seq
+ \seq_if_empty:NTF \l_@@_lang_declension_seq
{
\msg_warning:nnxx { zref-clever } { language-no-decl-setup }
- { \l_@@_dict_language_tl } {#1}
+ { \l_@@_base_language_tl } {#1}
}
{
- \seq_if_in:NnTF \l_@@_dict_declension_seq {#1}
- { \tl_set:Nn \l_@@_dict_decl_case_tl {#1} }
+ \seq_if_in:NnTF \l_@@_lang_declension_seq {#1}
+ { \tl_set:Nn \l_@@_lang_decl_case_tl {#1} }
{
\msg_warning:nnxx { zref-clever } { unknown-decl-case }
- {#1} { \l_@@_dict_language_tl }
- \seq_get_left:NN \l_@@_dict_declension_seq
- \l_@@_dict_decl_case_tl
+ {#1} { \l_@@_base_language_tl }
+ \seq_get_left:NN \l_@@_lang_declension_seq
+ \l_@@_lang_decl_case_tl
}
}
} ,
case .value_required:n = true ,
+
gender .code:n =
{
- \seq_if_empty:NTF \l_@@_dict_gender_seq
+ \seq_if_empty:NTF \l_@@_lang_gender_seq
{
\msg_warning:nnxxx { zref-clever } { language-no-gender }
- { \l_@@_dict_language_tl } { gender } {#1}
+ { \l_@@_base_language_tl } { gender } {#1}
}
{
\tl_if_empty:NTF \l_@@_setup_type_tl
@@ -2805,21 +2999,68 @@
{ option-only-type-specific } { gender }
}
{
- \seq_if_in:NnTF \l_@@_dict_gender_seq {#1}
+ \clist_clear:N \l_tmpa_clist
+ \clist_map_inline:nn {#1}
{
- \@@_declare_type_transl:VVnn
- \l_@@_dict_language_tl
- \l_@@_setup_type_tl
- { gender } {#1}
+ \seq_if_in:NnTF \l_@@_lang_gender_seq {##1}
+ { \clist_put_right:Nn \l_tmpa_clist {##1} }
+ {
+ \msg_warning:nnxx { zref-clever }
+ { gender-not-declared }
+ { \l_@@_base_language_tl } {##1}
+ }
}
+ \clist_if_empty:NF \l_tmpa_clist
{
- \msg_warning:nnxx { zref-clever } { gender-not-declared }
- { \l_@@_dict_language_tl } {#1}
+ \@@_declare_lang_opt_type:VVnx
+ \l_@@_base_language_tl
+ \l_@@_setup_type_tl
+ { gender } { \clist_use:Nn \l_tmpa_clist { , } }
}
}
}
} ,
gender .value_required:n = true ,
+
+ cap .choices:nn =
+ { true , false }
+ {
+ \tl_if_empty:NTF \l_@@_setup_type_tl
+ {
+ \@@_declare_lang_opt_default:VnV
+ \l_@@_base_language_tl
+ { cap } \l_keys_choice_tl
+ }
+ {
+ \@@_declare_lang_opt_type:VVnV
+ \l_@@_base_language_tl
+ \l_@@_setup_type_tl
+ { cap } \l_keys_choice_tl
+ }
+ } ,
+ cap .default:n = true ,
+ nocap .meta:n = { cap = false } ,
+ nocap .value_forbidden:n = true ,
+
+ abbrev .choices:nn =
+ { true , false }
+ {
+ \tl_if_empty:NTF \l_@@_setup_type_tl
+ {
+ \@@_declare_lang_opt_default:VnV
+ \l_@@_base_language_tl
+ { abbrev } \l_keys_choice_tl
+ }
+ {
+ \@@_declare_lang_opt_type:VVnV
+ \l_@@_base_language_tl
+ \l_@@_setup_type_tl
+ { abbrev } \l_keys_choice_tl
+ }
+ } ,
+ abbrev .default:n = true ,
+ noabbrev .meta:n = { abbrev = false },
+ noabbrev .value_forbidden:n = true ,
}
\seq_map_inline:Nn
\c_@@_ref_options_necessarily_not_type_specific_seq
@@ -2831,8 +3072,8 @@
{
\tl_if_empty:NTF \l_@@_setup_type_tl
{
- \@@_declare_default_transl:Vnn
- \l_@@_dict_language_tl
+ \@@_declare_lang_opt_default:Vnn
+ \l_@@_base_language_tl
{#1} {##1}
}
{
@@ -2852,19 +3093,34 @@
{
\tl_if_empty:NTF \l_@@_setup_type_tl
{
- \@@_declare_default_transl:Vnn
- \l_@@_dict_language_tl
+ \@@_declare_lang_opt_default:Vnn
+ \l_@@_base_language_tl
{#1} {##1}
}
{
- \@@_declare_type_transl:VVnn
- \l_@@_dict_language_tl
+ \@@_declare_lang_opt_type:VVnn
+ \l_@@_base_language_tl
\l_@@_setup_type_tl
{#1} {##1}
}
} ,
}
}
+\keys_define:nn { zref-clever / langsetup }
+ {
+ refpre .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpre } { preref }
+ } ,
+ refpos .code:n =
+ {
+ % NOTE Option deprecated in 2022-01-10 for v0.1.2-alpha.
+ \msg_warning:nnnn { zref-clever }{ option-deprecated }
+ { refpos } { postref }
+ } ,
+ }
\seq_map_inline:Nn
\c_@@_ref_options_type_names_seq
{
@@ -2879,18 +3135,18 @@
{ option-only-type-specific } {#1}
}
{
- \tl_if_empty:NTF \l_@@_dict_decl_case_tl
+ \tl_if_empty:NTF \l_@@_lang_decl_case_tl
{
- \@@_declare_type_transl:VVnn
- \l_@@_dict_language_tl
+ \@@_declare_lang_opt_type:VVnn
+ \l_@@_base_language_tl
\l_@@_setup_type_tl
{#1} {##1}
}
{
- \@@_declare_type_transl:VVxn
- \l_@@_dict_language_tl
+ \@@_declare_lang_opt_type:VVxn
+ \l_@@_base_language_tl
\l_@@_setup_type_tl
- { \l_@@_dict_decl_case_tl - #1 } {##1}
+ { \l_@@_lang_decl_case_tl - #1 } {##1}
}
}
} ,
@@ -2938,13 +3194,13 @@
\seq_set_from_clist:Nn \l_@@_zcref_labels_seq {#1}
\bool_set:Nn \l_@@_link_star_bool {#2}
% \end{macrocode}
-% Ensure dictionary for reference language is loaded, if available. We cannot
-% rely on \cs{keys_set:nn} for the task, since if the \opt{lang} option is set
-% for \texttt{current}, the actual language may have changed outside our
-% control. \cs{@@_provide_dictionary:x} does nothing if the dictionary is
-% already loaded.
+% Ensure language file for reference language is loaded, if available. We
+% cannot rely on \cs{keys_set:nn} for the task, since if the \opt{lang} option
+% is set for \texttt{current}, the actual language may have changed outside
+% our control. \cs{@@_provide_langfile:x} does nothing if the language file
+% is already loaded.
% \begin{macrocode}
- \@@_provide_dictionary:x { \l_@@_ref_language_tl }
+ \@@_provide_langfile:x { \l_@@_ref_language_tl }
% \end{macrocode}
% Process \cs{zcDeclareLanguage} options.
% \begin{macrocode}
@@ -2976,7 +3232,7 @@
% \begin{macrocode}
\tl_if_empty:NF \l_@@_zcref_note_tl
{
- \@@_get_ref_string:nN { notesep } \l_tmpa_tl
+ \@@_get_ref_opt_typeset:nN { notesep } \l_tmpa_tl
\l_tmpa_tl
\l_@@_zcref_note_tl
}
@@ -3175,7 +3431,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_label_type_put_new_right:n #1
{
- \@@_def_extract:Nnnn
+ \@@_extract_default:Nnnn
\l_@@_label_type_a_tl {#1} { zc@type } { \c_empty_tl }
\seq_if_in:NVF \l_@@_label_types_seq
\l_@@_label_type_a_tl
@@ -3201,9 +3457,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_sort_default:nn #1#2
{
- \@@_def_extract:Nnnn
+ \@@_extract_default:Nnnn
\l_@@_label_type_a_tl {#1} { zc@type } { zc@missingtype }
- \@@_def_extract:Nnnn
+ \@@_extract_default:Nnnn
\l_@@_label_type_b_tl {#2} { zc@type } { zc@missingtype }
\tl_if_eq:NNTF
@@ -3223,15 +3479,15 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_sort_default_same_type:nn #1#2
{
- \@@_def_extract:Nnnn \l_@@_label_enclval_a_tl
+ \@@_extract_default:Nnnn \l_@@_label_enclval_a_tl
{#1} { zc@enclval } { \c_empty_tl }
\tl_reverse:N \l_@@_label_enclval_a_tl
- \@@_def_extract:Nnnn \l_@@_label_enclval_b_tl
+ \@@_extract_default:Nnnn \l_@@_label_enclval_b_tl
{#2} { zc@enclval } { \c_empty_tl }
\tl_reverse:N \l_@@_label_enclval_b_tl
- \@@_def_extract:Nnnn \l_@@_label_extdoc_a_tl
+ \@@_extract_default:Nnnn \l_@@_label_extdoc_a_tl
{#1} { externaldocument } { \c_empty_tl }
- \@@_def_extract:Nnnn \l_@@_label_extdoc_b_tl
+ \@@_extract_default:Nnnn \l_@@_label_extdoc_b_tl
{#2} { externaldocument } { \c_empty_tl }
\bool_set_false:N \l_@@_sort_decided_bool
@@ -3638,13 +3894,15 @@
% \l_@@_listsep_tl ,
% \l_@@_lastsep_tl ,
% \l_@@_rangesep_tl ,
-% \l_@@_refpre_tl ,
-% \l_@@_refpos_tl ,
+% \l_@@_preref_tl ,
+% \l_@@_postref_tl ,
% \l_@@_namefont_tl ,
% \l_@@_reffont_tl ,
+% \l_@@_capitalize_bool ,
+% \l_@@_abbrev_bool ,
% }
-% Auxiliary variables for \cs{@@_typeset_refs:} separators, refpre/pos and
-% font options.
+% Auxiliary variables for \cs{@@_typeset_refs:} separators, pre-/postref and
+% font and other options.
% \begin{macrocode}
\tl_new:N \l_@@_tpairsep_tl
\tl_new:N \l_@@_tlistsep_tl
@@ -3654,10 +3912,12 @@
\tl_new:N \l_@@_listsep_tl
\tl_new:N \l_@@_lastsep_tl
\tl_new:N \l_@@_rangesep_tl
-\tl_new:N \l_@@_refpre_tl
-\tl_new:N \l_@@_refpos_tl
+\tl_new:N \l_@@_preref_tl
+\tl_new:N \l_@@_postref_tl
\tl_new:N \l_@@_namefont_tl
\tl_new:N \l_@@_reffont_tl
+\bool_new:N \l_@@_capitalize_bool
+\bool_new:N \l_@@_abbrev_bool
% \end{macrocode}
% \end{macro}
%
@@ -3692,11 +3952,11 @@
\int_zero:N \l_@@_range_same_count_int
% Get type block options (not type-specific).
- \@@_get_ref_string:nN { tpairsep }
+ \@@_get_ref_opt_typeset:nN { tpairsep }
\l_@@_tpairsep_tl
- \@@_get_ref_string:nN { tlistsep }
+ \@@_get_ref_opt_typeset:nN { tlistsep }
\l_@@_tlistsep_tl
- \@@_get_ref_string:nN { tlastsep }
+ \@@_get_ref_opt_typeset:nN { tlastsep }
\l_@@_tlastsep_tl
% Process label stack.
@@ -3721,9 +3981,11 @@
\tl_set:Nn \l_@@_label_type_b_tl { page }
}
{
- \@@_def_extract:NVnn \l_@@_label_type_a_tl
+ \@@_extract_default:NVnn
+ \l_@@_label_type_a_tl
\l_@@_label_a_tl { zc@type } { zc@missingtype }
- \@@_def_extract:NVnn \l_@@_label_type_b_tl
+ \@@_extract_default:NVnn
+ \l_@@_label_type_b_tl
\l_@@_label_b_tl { zc@type } { zc@missingtype }
}
@@ -3777,28 +4039,32 @@
}
}
- % Get type-specific separators, refpre/pos and font options, once per
- % type.
+ % Get type-specific separators, pre-/postref font and other options,
+ % once per type.
\int_compare:nNnT { \l_@@_label_count_int } = { 0 }
{
- \@@_get_ref_string:nN { namesep }
+ \@@_get_ref_opt_typeset:nN { namesep }
\l_@@_namesep_tl
- \@@_get_ref_string:nN { pairsep }
+ \@@_get_ref_opt_typeset:nN { pairsep }
\l_@@_pairsep_tl
- \@@_get_ref_string:nN { listsep }
+ \@@_get_ref_opt_typeset:nN { listsep }
\l_@@_listsep_tl
- \@@_get_ref_string:nN { lastsep }
+ \@@_get_ref_opt_typeset:nN { lastsep }
\l_@@_lastsep_tl
- \@@_get_ref_string:nN { rangesep }
+ \@@_get_ref_opt_typeset:nN { rangesep }
\l_@@_rangesep_tl
- \@@_get_ref_string:nN { refpre }
- \l_@@_refpre_tl
- \@@_get_ref_string:nN { refpos }
- \l_@@_refpos_tl
- \@@_get_ref_font:nN { namefont }
+ \@@_get_ref_opt_typeset:nN { preref }
+ \l_@@_preref_tl
+ \@@_get_ref_opt_typeset:nN { postref }
+ \l_@@_postref_tl
+ \@@_get_ref_opt_font:nN { namefont }
\l_@@_namefont_tl
- \@@_get_ref_font:nN { reffont }
+ \@@_get_ref_opt_font:nN { reffont }
\l_@@_reffont_tl
+ \@@_get_ref_opt_bool:nnN { cap } { false }
+ \l_@@_capitalize_bool
+ \@@_get_ref_opt_bool:nnN { abbrev } { false }
+ \l_@@_abbrev_bool
}
% Here we send this to a couple of auxiliary functions.
@@ -4348,33 +4614,33 @@
}
{
\bool_if:NF \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpre_tl }
+ { \exp_not:V \l_@@_preref_tl }
% It's two `@s', but escaped for DocStrip.
\exp_not:N \hyper@@@@link
{ \@@_extract_url_unexp:n {#1} }
{ \@@_extract_unexp:nnn {#1} { anchor } { } }
{
\bool_if:NT \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpre_tl }
+ { \exp_not:V \l_@@_preref_tl }
\exp_not:N \group_begin:
\exp_not:V \l_@@_reffont_tl
\@@_extract_unexp:nvn {#1}
{ l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\bool_if:NT \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
\bool_if:NF \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
{
- \exp_not:V \l_@@_refpre_tl
+ \exp_not:V \l_@@_preref_tl
\exp_not:N \group_begin:
\exp_not:V \l_@@_reffont_tl
\@@_extract_unexp:nvn {#1}
{ l_@@_ref_property_tl } { }
\exp_not:N \group_end:
- \exp_not:V \l_@@_refpos_tl
+ \exp_not:V \l_@@_postref_tl
}
}
{ \@@_ref_default: }
@@ -4421,7 +4687,7 @@
\exp_not:V \l_@@_type_name_tl
\exp_not:N \group_end:
\exp_not:V \l_@@_namesep_tl
- \exp_not:V \l_@@_refpre_tl
+ \exp_not:V \l_@@_preref_tl
\exp_not:N \group_begin:
\exp_not:V \l_@@_reffont_tl
\@@_extract_unexp:Vvn
@@ -4429,10 +4695,10 @@
{ l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\bool_if:NT \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
\bool_if:NF \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
{
\exp_not:N \group_begin:
@@ -4467,7 +4733,7 @@
}
{
\bool_if:NF \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpre_tl }
+ { \exp_not:V \l_@@_preref_tl }
% It's two '@s', but escaped for DocStrip.
\exp_not:N \hyper@@@@link
{
@@ -4480,7 +4746,7 @@
}
{
\bool_if:NT \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpre_tl }
+ { \exp_not:V \l_@@_preref_tl }
\exp_not:N \group_begin:
\exp_not:V \l_@@_reffont_tl
\@@_extract_unexp:Vvn
@@ -4488,20 +4754,20 @@
{ l_@@_ref_property_tl } { }
\exp_not:N \group_end:
\bool_if:NT \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
\bool_if:NF \l_@@_preposinlink_bool
- { \exp_not:V \l_@@_refpos_tl }
+ { \exp_not:V \l_@@_postref_tl }
}
{
- \exp_not:V \l_@@_refpre_tl
+ \exp_not:V \l_@@_preref_tl
\exp_not:N \group_begin:
\exp_not:V \l_@@_reffont_tl
\@@_extract_unexp:Vvn
\l_@@_type_first_label_tl
{ l_@@_ref_property_tl } { }
\exp_not:N \group_end:
- \exp_not:V \l_@@_refpos_tl
+ \exp_not:V \l_@@_postref_tl
}
}
{ \@@_ref_default: }
@@ -4594,15 +4860,17 @@
{ \l_@@_nudge_gender_bool }
{ ! \tl_if_empty_p:N \l_@@_ref_gender_tl }
{
- \@@_get_type_transl:xxnNF
+ \@@_get_lang_opt_type:xxnNF
{ \l_@@_ref_language_tl }
{ \l_@@_type_first_label_type_tl }
{ gender }
\l_@@_type_name_gender_tl
{ \tl_clear:N \l_@@_type_name_gender_tl }
- \tl_if_eq:NNF
- \l_@@_ref_gender_tl
+ \clist_set:NV \l_tmpa_clist
\l_@@_type_name_gender_tl
+ \clist_if_in:NVF
+ \l_tmpa_clist
+ \l_@@_ref_gender_tl
{
\tl_if_empty:NTF \l_@@_type_name_gender_tl
{
@@ -4640,7 +4908,7 @@
\tl_put_left:NV \l_@@_name_format_tl
\l_@@_ref_decl_case_tl
}
- \@@_get_type_transl:xxxNF
+ \@@_get_lang_opt_type:xxxNF
{ \l_@@_ref_language_tl }
{ \l_@@_type_first_label_type_tl }
{ \l_@@_name_format_tl }
@@ -4682,13 +4950,13 @@
\l_@@_name_format_fallback_tl
\l_@@_ref_decl_case_tl
}
- \@@_get_type_transl:xxxNF
+ \@@_get_lang_opt_type:xxxNF
{ \l_@@_ref_language_tl }
{ \l_@@_type_first_label_type_tl }
{ \l_@@_name_format_tl }
\l_@@_type_name_tl
{
- \@@_get_type_transl:xxxNF
+ \@@_get_lang_opt_type:xxxNF
{ \l_@@_ref_language_tl }
{ \l_@@_type_first_label_type_tl }
{ \l_@@_name_format_fallback_tl }
@@ -4776,9 +5044,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_labels_in_sequence:nn #1#2
{
- \@@_def_extract:Nnnn \l_@@_label_extdoc_a_tl
+ \@@_extract_default:Nnnn \l_@@_label_extdoc_a_tl
{#1} { externaldocument } { \c_empty_tl }
- \@@_def_extract:Nnnn \l_@@_label_extdoc_b_tl
+ \@@_extract_default:Nnnn \l_@@_label_extdoc_b_tl
{#2} { externaldocument } { \c_empty_tl }
\tl_if_eq:NNT
@@ -4855,27 +5123,28 @@
%
%
%
-% Finally, a couple of functions for retrieving options values, according to
-% the relevant precedence rules. They both receive an \meta{option} as
-% argument, and store the retrieved value in \meta{tl variable}. Though these
-% are mostly general functions (for a change\dots{}), they are not completely
-% so, they rely on the current state of \cs{l_@@_label_type_a_tl}, as set
-% during the processing of the label stack. This could be easily generalized,
-% of course, but I don't think it is worth it, \cs{l_@@_label_type_a_tl} is
-% indeed what we want in all practical cases. The difference between
-% \cs{@@_get_ref_string:nN} and \cs{@@_get_ref_font:nN} is the kind of option
-% each should be used for. \cs{@@_get_ref_string:nN} is meant for the general
-% options, and attempts to find values for them in all precedence levels (four
-% plus ``fallback''). \cs{@@_get_ref_font:nN} is intended for ``font''
+% Finally, some functions for retrieving reference options values, according
+% to the relevant precedence rules. They both receive an \meta{option} as
+% argument, and store the retrieved value in an appropriate. Though these are
+% mostly general functions (for a change\dots{}), they are not completely so,
+% they rely on the current state of \cs{l_@@_label_type_a_tl}, as set during
+% the processing of the label stack. This could be easily generalized, of
+% course, but I don't think it is worth it, \cs{l_@@_label_type_a_tl} is
+% indeed what we want in all practical cases. The difference between each of
+% these functions is the kind of option each should be used for.
+% \cs{@@_get_ref_opt_typeset:nN} is meant for the general options, and
+% attempts to find values for them in all precedence levels (four plus
+% ``fallback''). \cs{@@_get_ref_opt_font:nN} is intended for ``font''
% options, which cannot be ``language-specific'', thus for these we just
-% search general options and type options.
+% search general options and type options. \cs{@@_get_ref_opt_bool:nN} is
+% intended for boolean options.
%
-% \begin{macro}{\@@_get_ref_string:nN}
+% \begin{macro}{\@@_get_ref_opt_typeset:nN}
% \begin{syntax}
-% \cs{@@_get_ref_string:nN} \Arg{option} \Arg{tl variable}
+% \cs{@@_get_ref_opt_typeset:nN} \Arg{option} \Arg{tl variable}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_get_ref_string:nN #1#2
+\cs_new_protected:Npn \@@_get_ref_opt_typeset:nN #1#2
{
% First attempt: general options.
\prop_get:NnNF \l_@@_ref_options_prop {#1} #2
@@ -4906,19 +5175,19 @@
{#1} #2
}
{
- % If not found, try type specific translations.
- \@@_get_type_transl:xxnNF
+ % If not found, try type- and language-specific.
+ \@@_get_lang_opt_type:xxnNF
{ \l_@@_ref_language_tl }
{ \l_@@_label_type_a_tl }
{#1} #2
{
- % If not found, try default translations.
- \@@_get_default_transl:xnNF
+ % If not found, try language-specific default.
+ \@@_get_lang_opt_default:xnNF
{ \l_@@_ref_language_tl }
{#1} #2
{
% If not found, try fallback.
- \@@_get_fallback_transl:nNF {#1} #2
+ \@@_get_fallback_unknown_lang_opt:nNF {#1} #2
{
\tl_clear:N #2
\msg_warning:nnn { zref-clever }
@@ -4932,12 +5201,12 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_get_ref_font:nN}
+% \begin{macro}{\@@_get_ref_opt_font:nN}
% \begin{syntax}
-% \cs{@@_get_ref_font:nN} \Arg{option} \Arg{tl variable}
+% \cs{@@_get_ref_opt_font:nN} \Arg{option} \Arg{tl variable}
% \end{syntax}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_get_ref_font:nN #1#2
+\cs_new_protected:Npn \@@_get_ref_opt_font:nN #1#2
{
% First attempt: general options.
\prop_get:NnNF \l_@@_ref_options_prop {#1} #2
@@ -4967,6 +5236,74 @@
% \end{macro}
%
%
+% \begin{macro}{\@@_get_ref_opt_bool:nnN}
+% \begin{syntax}
+% \cs{@@_get_ref_opt_bool:nN} \Arg{option}
+% ~~\Arg{default} \Arg{bool variable}
+% \end{syntax}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_get_ref_opt_bool:nnN #1#2#3
+ {
+ % First attempt: general options.
+ \prop_get:NnNF \l_@@_ref_options_prop {#1} \l_tmpa_tl
+ {
+ % If not found, try type specific options.
+ \bool_lazy_and:nnTF
+ {
+ \prop_if_exist_p:c
+ {
+ l_@@_type_
+ \l_@@_label_type_a_tl _options_prop
+ }
+ }
+ {
+ \prop_if_in_p:cn
+ {
+ l_@@_type_
+ \l_@@_label_type_a_tl _options_prop
+ }
+ {#1}
+ }
+ {
+ \prop_get:cnN
+ {
+ l_@@_type_
+ \l_@@_label_type_a_tl _options_prop
+ }
+ {#1} \l_tmpa_tl
+ }
+ {
+ % If not found, try type- and language-specific.
+ \@@_get_lang_opt_type:xxnNF
+ { \l_@@_ref_language_tl }
+ { \l_@@_label_type_a_tl }
+ {#1} \l_tmpa_tl
+ {
+ % If not found, try language-specific default.
+ \@@_get_lang_opt_default:xnNF
+ { \l_@@_ref_language_tl }
+ {#1} \l_tmpa_tl
+ {
+ % If not found, use default argument.
+ \bool_lazy_or:nnTF
+ { \str_if_eq_p:nn {#2} { true } }
+ { \str_if_eq_p:nn {#2} { false } }
+ { \tl_set:Nn \l_tmpa_tl {#2} }
+ {
+ % And, if even that fails, presume false.
+ \tl_set:Nn \l_tmpa_tl { false }
+ }
+ }
+ }
+ }
+ }
+ % Having retrieved the option value, set the boolean. At this point, we
+ % *know* '\l_tmpa_tl' is either 'true' or 'false'.
+ \use:c { bool_set_ \l_tmpa_tl :N } #3
+ }
+% \end{macrocode}
+% \end{macro}
+%
%
% \section{Compatibility}
%
@@ -5461,8 +5798,8 @@
\zcRefTypeSetup { equation }
{
reffont = \upshape ,
- refpre = {\textup{(}} ,
- refpos = {\textup{)}} ,
+ preref = {\textup{(}} ,
+ postref = {\textup{)}} ,
}
\msg_info:nnn { zref-clever } { compat-package } { amsmath }
}
@@ -5752,10 +6089,10 @@
%
%
%
-% \section{Dictionaries}
+% \section{Language files}
%
% Initial values for the English, German, French, Portuguese, and Spanish,
-% dictionaries have been provided by the author. Translations available for
+% language files have been provided by the author. Translations available for
% document elements' names in other packages have been an useful reference for
% the purpose, namely: \pkg{babel}, \pkg{cleveref}, \pkg{translator}, and
% \pkg{translations}.
@@ -5763,7 +6100,7 @@
%
% \subsection{English}
%
-% English dictionary has been initially provided by the author.
+% English language file has been initially provided by the author.
%
% \begin{macrocode}
%<*package>
@@ -5779,7 +6116,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<*dict-english>
+%<*lang-english>
% \end{macrocode}
%
% \begin{macrocode}
@@ -5838,8 +6175,6 @@ type = page ,
name-sg = page ,
Name-pl = Pages ,
name-pl = pages ,
- name-sg-ab = p. ,
- name-pl-ab = pp. ,
rangesep = {\textendash} ,
type = line ,
@@ -5897,8 +6232,8 @@ type = equation ,
name-sg-ab = eq. ,
Name-pl-ab = Eqs. ,
name-pl-ab = eqs. ,
- refpre = {(} ,
- refpos = {)} ,
+ preref = {(} ,
+ postref = {)} ,
type = theorem ,
Name-sg = Theorem ,
@@ -5980,14 +6315,14 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%</dict-english>
+%</lang-english>
% \end{macrocode}
%
%
%
% \subsection{German}
%
-% German dictionary has been initially provided by the author.
+% German language file has been initially provided by the author.
%
% \begin{macrocode}
%<*package>
@@ -6004,7 +6339,7 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%<*dict-german>
+%<*lang-german>
% \end{macrocode}
%
% \begin{macrocode}
@@ -6251,8 +6586,8 @@ type = equation ,
case = G ,
Name-sg = Gleichung ,
Name-pl = Gleichungen ,
- refpre = {(} ,
- refpos = {)} ,
+ preref = {(} ,
+ postref = {)} ,
type = theorem ,
gender = n ,
@@ -6451,18 +6786,18 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%</dict-german>
+%</lang-german>
% \end{macrocode}
%
%
%
% \subsection{French}
%
-% French dictionary has been initially provided by the author, and has been
-% improved thanks to Denis Bitouzé (\githubissue{1}) and participants of the
-% Groupe francophone des Utilisateurs de \TeX{} (GUTenberg) (at
-% \url{https://groups.google.com/g/gut_fr/c/rNLm6weGcyg}) and the
-% \texttt{fr.comp.text.tex} (at
+% French language file has been initially provided by the author, and has been
+% improved thanks to Denis Bitouzé and François Lagarde (at \githubissue{1})
+% and participants of the Groupe francophone des Utilisateurs de \TeX{}
+% (GUTenberg) (at \url{https://groups.google.com/g/gut_fr/c/rNLm6weGcyg}) and
+% the \texttt{fr.comp.text.tex} (at
% \url{https://groups.google.com/g/fr.comp.text.tex/c/Fa11Tf6MFFs}) mailing
% lists.
%
@@ -6477,7 +6812,7 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%<*dict-french>
+%<*lang-french>
% \end{macrocode}
%
% \begin{macrocode}
@@ -6596,8 +6931,8 @@ type = equation ,
name-sg = équation ,
Name-pl = Équations ,
name-pl = équations ,
- refpre = {(} ,
- refpos = {)} ,
+ preref = {(} ,
+ postref = {)} ,
type = theorem ,
gender = m ,
@@ -6692,14 +7027,14 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%</dict-french>
+%</lang-french>
% \end{macrocode}
%
%
%
% \subsection{Portuguese}
%
-% Portuguese dictionary provided by the author, who's a native speaker of
+% Portuguese language file provided by the author, who's a native speaker of
% (Brazilian) Portuguese. I do expect this to be sufficiently general, but if
% Portuguese speakers from other places feel the need for a Portuguese
% variant, please let me know.
@@ -6714,7 +7049,7 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%<*dict-portuguese>
+%<*lang-portuguese>
% \end{macrocode}
%
% \begin{macrocode}
@@ -6780,8 +7115,6 @@ type = page ,
name-sg = página ,
Name-pl = Páginas ,
name-pl = páginas ,
- name-sg-ab = p. ,
- name-pl-ab = pp. ,
rangesep = {\textendash} ,
type = line ,
@@ -6847,8 +7180,8 @@ type = equation ,
name-sg-ab = eq. ,
Name-pl-ab = Eqs. ,
name-pl-ab = eqs. ,
- refpre = {(} ,
- refpos = {)} ,
+ preref = {(} ,
+ postref = {)} ,
type = theorem ,
gender = m ,
@@ -6943,14 +7276,14 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%</dict-portuguese>
+%</lang-portuguese>
% \end{macrocode}
%
%
%
% \subsection{Spanish}
%
-% Spanish dictionary has been initially provided by the author.
+% Spanish language file has been initially provided by the author.
%
% \begin{macrocode}
%<*package>
@@ -6959,7 +7292,7 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%<*dict-spanish>
+%<*lang-spanish>
% \end{macrocode}
%
% \begin{macrocode}
@@ -7078,8 +7411,8 @@ type = equation ,
name-sg = ecuación ,
Name-pl = Ecuaciones ,
name-pl = ecuaciones ,
- refpre = {(} ,
- refpos = {)} ,
+ preref = {(} ,
+ postref = {)} ,
type = theorem ,
gender = m ,
@@ -7174,7 +7507,255 @@ type = solution ,
% \end{macrocode}
%
% \begin{macrocode}
-%</dict-spanish>
+%</lang-spanish>
+% \end{macrocode}
+%
+%
+%
+% \subsection{Dutch}
+%
+% Dutch language file initially contributed by \texttt{niluxv} (\githubPR{5}).
+% All genders were checked against the ``Dikke Van Dale''. Many words have
+% multiple genders.
+%
+% \begin{macrocode}
+%<*package>
+\zcDeclareLanguage [ gender = { f , m , n } ] { dutch }
+%</package>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*lang-dutch>
+% \end{macrocode}
+%
+% \begin{macrocode}
+namesep = {\nobreakspace} ,
+pairsep = {~en\nobreakspace} ,
+listsep = {,~} ,
+lastsep = {~en\nobreakspace} ,
+tpairsep = {~en\nobreakspace} ,
+tlistsep = {,~} ,
+tlastsep = {,~en\nobreakspace} ,
+notesep = {~} ,
+rangesep = {~t/m\nobreakspace} ,
+
+type = book ,
+ gender = n ,
+ Name-sg = Boek ,
+ name-sg = boek ,
+ Name-pl = Boeken ,
+ name-pl = boeken ,
+
+type = part ,
+ gender = n ,
+ Name-sg = Deel ,
+ name-sg = deel ,
+ Name-pl = Delen ,
+ name-pl = delen ,
+
+type = chapter ,
+ gender = n ,
+ Name-sg = Hoofdstuk ,
+ name-sg = hoofdstuk ,
+ Name-pl = Hoofdstukken ,
+ name-pl = hoofdstukken ,
+
+type = section ,
+ gender = m ,
+ Name-sg = Paragraaf ,
+ name-sg = paragraaf ,
+ Name-pl = Paragrafen ,
+ name-pl = paragrafen ,
+
+type = paragraph ,
+ gender = f ,
+ Name-sg = Alinea ,
+ name-sg = alinea ,
+ Name-pl = Alinea's ,
+ name-pl = alinea's ,
+
+type = appendix ,
+ gender = { m , n } ,
+ Name-sg = Appendix ,
+ name-sg = appendix ,
+ Name-pl = Appendices ,
+ name-pl = appendices ,
+
+type = page ,
+ gender = { f , m } ,
+ Name-sg = Pagina ,
+ name-sg = pagina ,
+ Name-pl = Pagina's ,
+ name-pl = pagina's ,
+ rangesep = {\textendash} ,
+
+type = line ,
+ gender = m ,
+ Name-sg = Regel ,
+ name-sg = regel ,
+ Name-pl = Regels ,
+ name-pl = regels ,
+
+type = figure ,
+ gender = { n , f , m } ,
+ Name-sg = Figuur ,
+ name-sg = figuur ,
+ Name-pl = Figuren ,
+ name-pl = figuren ,
+
+type = table ,
+ gender = { f , m } ,
+ Name-sg = Tabel ,
+ name-sg = tabel ,
+ Name-pl = Tabellen ,
+ name-pl = tabellen ,
+
+type = item ,
+ gender = n ,
+ Name-sg = Punt ,
+ name-sg = punt ,
+ Name-pl = Punten ,
+ name-pl = punten ,
+
+type = footnote ,
+ gender = { f , m } ,
+ Name-sg = Voetnoot ,
+ name-sg = voetnoot ,
+ Name-pl = Voetnoten ,
+ name-pl = voetnoten ,
+
+type = endnote ,
+ gender = { f , m } ,
+ Name-sg = Eindnoot ,
+ name-sg = eindnoot ,
+ Name-pl = Eindnoten ,
+ name-pl = eindnoten ,
+
+type = note ,
+ gender = f ,
+ Name-sg = Opmerking ,
+ name-sg = opmerking ,
+ Name-pl = Opmerkingen ,
+ name-pl = opmerkingen ,
+
+type = equation ,
+ gender = f ,
+ Name-sg = Vergelijking ,
+ name-sg = vergelijking ,
+ Name-pl = Vergelijkingen ,
+ name-pl = vergelijkingen ,
+ Name-sg-ab = Vgl. ,
+ name-sg-ab = vgl. ,
+ Name-pl-ab = Vgl.'s ,
+ name-pl-ab = vgl.'s ,
+ preref = {(} ,
+ postref = {)} ,
+
+type = theorem ,
+ gender = f ,
+ Name-sg = Stelling ,
+ name-sg = stelling ,
+ Name-pl = Stellingen ,
+ name-pl = stellingen ,
+% \end{macrocode}
+%
+% 2022-01-09, \texttt{niluxv}: An alternative plural is ``lemmata''. That is
+% also a correct English plural for lemma, but the English language file
+% chooses ``lemmas''. For consistency we therefore choose ``lemma's''.
+%
+% \begin{macrocode}
+type = lemma ,
+ gender = n ,
+ Name-sg = Lemma ,
+ name-sg = lemma ,
+ Name-pl = Lemma's ,
+ name-pl = lemma's ,
+
+type = corollary ,
+ gender = n ,
+ Name-sg = Gevolg ,
+ name-sg = gevolg ,
+ Name-pl = Gevolgen ,
+ name-pl = gevolgen ,
+
+type = proposition ,
+ gender = f ,
+ Name-sg = Propositie ,
+ name-sg = propositie ,
+ Name-pl = Proposities ,
+ name-pl = proposities ,
+
+type = definition ,
+ gender = f ,
+ Name-sg = Definitie ,
+ name-sg = definitie ,
+ Name-pl = Definities ,
+ name-pl = definities ,
+
+type = proof ,
+ gender = n ,
+ Name-sg = Bewijs ,
+ name-sg = bewijs ,
+ Name-pl = Bewijzen ,
+ name-pl = bewijzen ,
+
+type = result ,
+ gender = n ,
+ Name-sg = Resultaat ,
+ name-sg = resultaat ,
+ Name-pl = Resultaten ,
+ name-pl = resultaten ,
+
+type = remark ,
+ gender = f ,
+ Name-sg = Opmerking ,
+ name-sg = opmerking ,
+ Name-pl = Opmerkingen ,
+ name-pl = opmerkingen ,
+
+type = example ,
+ gender = n ,
+ Name-sg = Voorbeeld ,
+ name-sg = voorbeeld ,
+ Name-pl = Voorbeelden ,
+ name-pl = voorbeelden ,
+
+type = algorithm ,
+ gender = { n , f , m } ,
+ Name-sg = Algoritme ,
+ name-sg = algoritme ,
+ Name-pl = Algoritmes ,
+ name-pl = algoritmes ,
+% \end{macrocode}
+%
+% 2022-01-09, \texttt{niluxv}: EN-NL Van Dale translates listing as (3)
+% ``uitdraai van computerprogramma'', ``listing''.
+%
+% \begin{macrocode}
+type = listing ,
+ gender = m ,
+ Name-sg = Listing ,
+ name-sg = listing ,
+ Name-pl = Listings ,
+ name-pl = listings ,
+
+type = exercise ,
+ gender = { f , m } ,
+ Name-sg = Opgave ,
+ name-sg = opgave ,
+ Name-pl = Opgaven ,
+ name-pl = opgaven ,
+
+type = solution ,
+ gender = f ,
+ Name-sg = Oplossing ,
+ name-sg = oplossing ,
+ Name-pl = Oplossingen ,
+ name-pl = oplossingen ,
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</lang-dutch>
% \end{macrocode}
%
%
diff --git a/macros/latex/contrib/zref-clever/zref-clever.ins b/macros/latex/contrib/zref-clever/zref-clever.ins
index 46d9982dc4..69c052679e 100644
--- a/macros/latex/contrib/zref-clever/zref-clever.ins
+++ b/macros/latex/contrib/zref-clever/zref-clever.ins
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-clever".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -50,7 +50,7 @@
This file was generated from file(s) of the LaTeX package "zref-clever".
-Copyright (C) 2021 Gustavo Barros
+Copyright (C) 2021-2022 Gustavo Barros
It may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -90,10 +90,11 @@ for those people who are interested.
\endpostamble
\generate{\file{zref-clever.sty}{\from{zref-clever.dtx}{package}}}
-\generate{\file{zref-clever-english.dict}{\from{zref-clever.dtx}{dict-english}}}
-\generate{\file{zref-clever-german.dict}{\from{zref-clever.dtx}{dict-german}}}
-\generate{\file{zref-clever-french.dict}{\from{zref-clever.dtx}{dict-french}}}
-\generate{\file{zref-clever-portuguese.dict}{\from{zref-clever.dtx}{dict-portuguese}}}
-\generate{\file{zref-clever-spanish.dict}{\from{zref-clever.dtx}{dict-spanish}}}
+\generate{\file{zref-clever-english.lang}{\from{zref-clever.dtx}{lang-english}}}
+\generate{\file{zref-clever-german.lang}{\from{zref-clever.dtx}{lang-german}}}
+\generate{\file{zref-clever-french.lang}{\from{zref-clever.dtx}{lang-french}}}
+\generate{\file{zref-clever-portuguese.lang}{\from{zref-clever.dtx}{lang-portuguese}}}
+\generate{\file{zref-clever-spanish.lang}{\from{zref-clever.dtx}{lang-spanish}}}
+\generate{\file{zref-clever-dutch.lang}{\from{zref-clever.dtx}{lang-dutch}}}
\endbatchfile
diff --git a/macros/latex/contrib/zref-clever/zref-clever.pdf b/macros/latex/contrib/zref-clever/zref-clever.pdf
index 84f9a28b55..1c64f52147 100644
--- a/macros/latex/contrib/zref-clever/zref-clever.pdf
+++ b/macros/latex/contrib/zref-clever/zref-clever.pdf
Binary files differ
diff --git a/macros/latex/contrib/zref-clever/zref-clever.tex b/macros/latex/contrib/zref-clever/zref-clever.tex
index 4da3b2453d..a4e3ab8638 100644
--- a/macros/latex/contrib/zref-clever/zref-clever.tex
+++ b/macros/latex/contrib/zref-clever/zref-clever.tex
@@ -4,7 +4,7 @@
%
% This file is part of the LaTeX package "zref-clever".
%
-% Copyright (C) 2021 Gustavo Barros
+% Copyright (C) 2021-2022 Gustavo Barros
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -56,8 +56,6 @@
\usepackage{listings}
\usepackage{microtype}
-% TEMP work-around for https://github.com/schlcht/microtype/issues/4
-\microtypesetup{nopatch=item}
\hypersetup{hidelinks}
@@ -523,9 +521,10 @@ The option given without a value is equivalent to \texttt{range=true} (in the
\DescribeOption{nocap} %
\DescribeOption{capfirst} %
The \opt{cap} option controls whether the reference type names should be
-capitalized or not. It is a boolean option, and the package's default is
-\texttt{cap=false}. The option given without a value is equivalent to
-\texttt{cap=true}. The \opt{nocap} option is a convenience alias for
+capitalized or not. It can receive values \texttt{true} or \texttt{false},
+and it can also be set for specific reference types or languages (see
+\zcref{sec:reference-format}). The option given without a value is equivalent
+to \texttt{cap=true}. The \opt{nocap} option is a convenience alias for
\texttt{cap=false}. The \opt{capfirst} option ensures that the reference type
name of the \emph{first} type block is capitalized, even when \opt{cap} is set
to \texttt{false}.
@@ -534,9 +533,10 @@ to \texttt{false}.
\DescribeOption{noabbrev} %
\DescribeOption{noabbrevfirst} %
The \opt{abbrev} option controls whether to use abbreviated reference type
-names when they are available. It is a boolean option, and the package's
-default is \texttt{abbrev=false}. The option given without a value is
-equivalent to \texttt{abbrev=true}. The \opt{noabbrev} option is a
+names when they are available. It can receive values \texttt{true} or
+\texttt{false}, and it can also be set for specific reference types or
+languages (see \zcref{sec:reference-format}). The option given without a
+value is equivalent to \texttt{abbrev=true}. The \opt{noabbrev} option is a
convenience alias for \texttt{abbrev=false}. The \opt{noabbrevfirst} ensures
that the reference type name of the \emph{first} type block is never
abbreviated, even when \opt{abbrev} is set to \texttt{true}.
@@ -592,8 +592,8 @@ the second reference none of them will. The package's default is
equivalent to \texttt{nameinlink=true}.
\DescribeOption{preposinlink} %
-The \opt{preposinlink} option controls whether the \opt{refpre} and
-\opt{refpos} reference format options (see \zcref{sec:reference-format}) are
+The \opt{preposinlink} option controls whether the \opt{preref} and
+\opt{postref} reference format options (see \zcref{sec:reference-format}) are
included in the reference hyperlink or not. It is a boolean option. The
package's default is \texttt{preposinlink=false}, and the option given without
a value is equivalent to \texttt{preposinlink=true}.
@@ -650,15 +650,15 @@ is the way to tell \cs{zcref} you know it's a singular and so not to nudge if
a compression to singular occurs, but to nudge if the contrary occurs, that
is, when a plural type name form is employed. The \texttt{gender} nudge must
be combined with option \opt{g}, and depends on the language having support
-for it. In essence language dictionaries can store the gender of each type
-name (this is done for built-in dictionaries, but can also be done with
+for it. In essence language files can store the gender(s) of each type name
+(this is done for built-in language files, but can also be done with
\cs{zcLanguageSetup} for languages declared to support it). The \opt{g}
option let's you specify the gender you expect for that particular reference
and the nudge is triggered if there is a mismatch between \opt{g} and the
-gender for the type name in the dictionary. Both the \texttt{comptosing} and
-the \texttt{gender} nudges have a type block as its scope. See
-\zcref{sec:internationalization} for more details and intended use cases of
-the ``nudging'' feature.
+gender(s) for the type name in the language file. Both the
+\texttt{comptosing} and the \texttt{gender} nudges have a type block as its
+scope. See \zcref{sec:internationalization} for more details and intended use
+cases of the ``nudging'' feature.
\DescribeOption{font} %
The \opt{font} option can receive font styling commands to change the
@@ -822,7 +822,7 @@ contrary may also happen, a \emph{counter} may be defined but we have no
these reference types are available for use out of the box.\footnote{There may
be slight availability differences depending on the language, but
\pkg{zref-clever} strives to keep this complete list available for the
- languages it has built-in dictionaries.} And, in any case, it is always
+ languages it has built-in language files.} And, in any case, it is always
easy to setup custom reference types with \cs{zcRefTypeSetup} or
\cs{zcLanguageSetup} (see \zcref{sec:user-interface, sec:reference-format,
sec:internationalization}).
@@ -883,71 +883,75 @@ less overarching effects, and some precedence rules to regulate the relation
of settings given in each of these scopes. There are four scopes in which
reference formatting can be specified by the user, in the following precedence
order: i) as \emph{general options}; ii) as \emph{type-specific options}; iii)
-as \emph{language-specific and type-specific translations}; and iv) as
-\emph{default translations} (that is, language-specific but not
-type-specific). Besides those, there's a fifth \emph{internal} scope, with
-the least priority of all, a ``fallback'', for the cases where it is
-meaningful to provide some value, even for an unknown language. The package
-itself places the default setup for reference formatting at low precedence
-levels, and the users can easily and conveniently override them as desired.
-
-``General options'' (i) can be given by the user in the optional argument of
+as \emph{language- and type-specific options}; and iv) as
+\emph{language-specific default options}. Besides those, there's a fifth
+\emph{internal} scope, with the least priority of all, a ``fallback'', for the
+cases where it is meaningful to provide some value, even for an unknown
+language. The package itself places the default setup for reference
+formatting at low precedence levels, and the users can easily and conveniently
+override them as desired.
+
+``General'' options (i) can be given by the user in the optional argument of
\cs{zcref}, but also set through \cs{zcsetup} or even, depending on the case,
as package options at load-time (see \zcref{sec:options}).\footnote{The use of
\cs{zcsetup} for global reference format settings is recommended though.
Whether you can use load-time options or not depends on the values of the
options: due to how \LaTeX{} handles package options, if the values of the
options you are setting include \emph{commands} you can't set them at
- load-time, and rather \emph{must} use \cs{zcsetup}.} ``Type-specific
-options'' (ii) are handled by \cs{zcRefTypeSetup} (see
-\zcref{sec:user-interface}). ``Language-specific translations'', be they
-``type-specific'' (iii) or ``default'' (iv) have their user interface in
-\cs{zcLanguageSetup}, and have their values populated by the package's
-built-in dictionaries (see \zcref{sec:internationalization}). Not all
-reference format specifications can be given in all of these scopes, though.
-Some of them can't be type-specific, others must be type-specific, so the set
-available in each scope depends on the pertinence of the case.
-\zcref{tab:reference-format} introduces the available reference format
-options, which will be discussed in more detail soon, and lists the scopes in
-which each is available.
+ load-time, and rather \emph{must} use \cs{zcsetup}.} ``Type'' specific
+options (ii) are handled by \cs{zcRefTypeSetup} (see
+\zcref{sec:user-interface}). ``Language'' options, whether ``type'' specific
+(iii) or ``default'' (iv) have their user interface in \cs{zcLanguageSetup},
+and have their values populated by the package's built-in language files (see
+\zcref{sec:internationalization}). Not all reference format specifications
+can be given in all of these scopes, though. Some of them can't be
+type-specific, others must be type-specific, so the set available in each
+scope depends on the pertinence of the case. \zcref{tab:reference-format}
+introduces the available reference format options, which will be discussed in
+more detail soon, and lists the scopes in which each is available.
\begin{table}[htb]
\centering
\begin{tabular}{l>{\ttfamily}lcccc}
\toprule
- & & General & Type & Type-specific & Default \\
- & & options & options & translations & translations \\
- & & (i) & (ii) & (iii) & (iv) \\
+ & & General & Type & \multicolumn{2}{c}{Language} \\
+ \cmidrule(lr){5-6}
+ & & & & Type & Default \\
+ & & (i) & (ii) & (iii) & (iv) \\
\midrule
- Necessarily not & tpairsep & $\bullet$ & & & $\bullet$ \\
- type-specific & tlistsep & $\bullet$ & & & $\bullet$ \\
- & tlastsep & $\bullet$ & & & $\bullet$ \\
- & notesep & $\bullet$ & & & $\bullet$ \\
+ Typesetting & tpairsep & $\bullet$ & & & $\bullet$ \\
+ (necessarily not & tlistsep & $\bullet$ & & & $\bullet$ \\
+ type-specific) & tlastsep & $\bullet$ & & & $\bullet$ \\
+ & notesep & $\bullet$ & & & $\bullet$ \\
\addlinespace
- Possibly & namesep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- type-specific & pairsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- & listsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- & lastsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- & rangesep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- & refpre & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
- & refpos & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ Typesetting & namesep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ (possibly & pairsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ type-specific) & listsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ & lastsep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ & rangesep & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ & preref & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ & postref & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
\addlinespace
- Necessarily & Name-sg & & $\bullet$ & $\bullet$ & \\
- type-specific & name-sg & & $\bullet$ & $\bullet$ & \\
- & Name-pl & & $\bullet$ & $\bullet$ & \\
- & name-pl & & $\bullet$ & $\bullet$ & \\
- & Name-sg-ab & & $\bullet$ & $\bullet$ & \\
- & name-sg-ab & & $\bullet$ & $\bullet$ & \\
- & Name-pl-ab & & $\bullet$ & $\bullet$ & \\
- & name-pl-ab & & $\bullet$ & $\bullet$ & \\
+ Typesetting & Name-sg & & $\bullet$ & $\bullet$ & \\
+ (necessarily & name-sg & & $\bullet$ & $\bullet$ & \\
+ type-specific) & Name-pl & & $\bullet$ & $\bullet$ & \\
+ & name-pl & & $\bullet$ & $\bullet$ & \\
+ & Name-sg-ab & & $\bullet$ & $\bullet$ & \\
+ & name-sg-ab & & $\bullet$ & $\bullet$ & \\
+ & Name-pl-ab & & $\bullet$ & $\bullet$ & \\
+ & name-pl-ab & & $\bullet$ & $\bullet$ & \\
\addlinespace
- Font & namefont & $\bullet$ & $\bullet$ & & \\
- options & reffont & $\bullet$ & $\bullet$ & & \\
+ Font & namefont & $\bullet$ & $\bullet$ & & \\
+ & reffont & $\bullet$ & $\bullet$ & & \\
+
+ \addlinespace
+ Other & cap & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
+ & abbrev & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\
\bottomrule
\end{tabular}
\caption{Reference format options and their scopes}
@@ -963,7 +967,7 @@ that which a standard \LaTeX{} \cs{ref} would typeset. A \pkg{zref-clever}
\begin{refformat}
\item \reffmt{ref-block} \(\equiv\)
-\item \reffmt{refpre} \reffmt{ref} \reffmt{refpos}
+\item \reffmt{preref} \reffmt{ref} \reffmt{postref}
\end{refformat}
A \texttt{ref-block} is built for \emph{each} label given as argument to
@@ -1037,48 +1041,48 @@ typeset output is built as:
\item \reffmt{type-block-group} \reffmt{notesep} \reffmt{note}
\end{refformat}
-Reference format options can yet be divided in two general categories: i)
-``string'' options, the ones which we have seen thus far, as ``building
-blocks'' of the reference; and ii) ``font'' options, which control font
-attributes of parts of the reference, namely \opt{namefont} and \opt{reffont}.
-These options set the font, respectively, for the \texttt{type-name} and for
-\texttt{ref} (to set the font for the whole reference, see the \opt{font}
-option in \zcref{sec:options}). ``String'' options is not really a strict
-denomination for the first category, but this set of options is intended
-exclusively for typesetting material: things you expect to see in the output
-of your references. The ``font'' options, on the other hand, are intended
-exclusively for commands that only change font attributes: style, family,
-shape, weight, size, color, etc. In either case, anything other than their
-intended uses is not supported.
+Reference format options can yet be divided in three general categories: i)
+``typesetting'' options, the ones which we have seen thus far, as ``building
+blocks'' of the reference; ii) ``font'' options, which control font attributes
+of parts of the reference, namely \opt{namefont} and \opt{reffont}; and iii)
+``other'' options. ``Typesetting'' options are intended exclusively for
+typesetting material: things you expect to see in the output of your
+references. ``Font'' options set the font, respectively, for the
+\texttt{type-name} and for \texttt{ref} (to set the font for the whole
+reference, see the \opt{font} option in \zcref{sec:options}). These options
+are intended exclusively for commands that only change font attributes: style,
+family, shape, weight, size, color, etc. In either case, anything other than
+their intended uses is not supported.
Finally, a comment about the internal ``fallback'' reference format values
mentioned above. These ``last resort'' option values are required by
\pkg{zref-clever} for a clear particular case: if the user loads either
\pkg{babel} or \pkg{polyglossia}, or explicitly sets a language, with a
-language that \pkg{zref-clever} does not know and has no dictionary for, it
+language that \pkg{zref-clever} does not know and has no language file for, it
cannot guess what language that is, and thus has to provide some reasonable
``language agnostic'' default, at least for the options for which this makes
-sense (all the ``string'' options, except for the \texttt{[Nn]ame-} ones).
-Users do not need to have access to this scope, since they know the language
-of their document, or know the values they want for those options, and can set
-them as general options, type-specific options, or language options through
-the user interface provided for the purpose. But the ``fallback'' options are
-documented here so that you can recognize when you are getting these values
-and change them appropriately as desired. Though hopefully reasonable, they
-may not be what you want. The ``fallback'' option values are the following:
+sense (all the ``typesetting'' options, except for the \texttt{[Nn]ame-}
+ones). Users do not need to have access to this scope, since they know the
+language of their document, or know the values they want for those options,
+and can set them as general options, type-specific options, or language
+options through the user interface provided for the purpose. But the
+``fallback'' options are documented here so that you can recognize when you
+are getting these values and change them appropriately as desired. Though
+hopefully reasonable, they may not be what you want. The ``fallback'' option
+values are the following:
\begin{zcexample}[escapeinside=`']
-tpairsep = {,`\textvisiblespace{}'} ,
-tlistsep = {,`\textvisiblespace{}'} ,
-tlastsep = {,`\textvisiblespace{}'} ,
-notesep = {`\textvisiblespace{}'} ,
-namesep = {\nobreakspace} ,
-pairsep = {,`\textvisiblespace{}'} ,
-listsep = {,`\textvisiblespace{}'} ,
-lastsep = {,`\textvisiblespace{}'} ,
-rangesep = {\textendash} ,
-refpre = {} ,
-refpos = {} ,
+tpairsep = {,`\textvisiblespace{}'} ,
+tlistsep = {,`\textvisiblespace{}'} ,
+tlastsep = {,`\textvisiblespace{}'} ,
+notesep = {`\textvisiblespace{}'} ,
+namesep = {\nobreakspace} ,
+pairsep = {,`\textvisiblespace{}'} ,
+listsep = {,`\textvisiblespace{}'} ,
+lastsep = {,`\textvisiblespace{}'} ,
+rangesep = {\textendash} ,
+preref = {} ,
+postref = {} ,
\end{zcexample}
@@ -1090,12 +1094,11 @@ refpos = {} ,
of these language packages, or to a language specified directly by the user.
This is primarily relevant for reference format options, particularly
reference type \emph{names} (though not only, since most reference format
-options can have language-specific values, or ``translations'', see
-\zcref{sec:reference-format}). But other features of the package also cater
-for language specific needs.
+options can have language-specific values see \zcref{sec:reference-format}).
+But other features of the package also cater for language specific needs.
As far as language selection is concerned, if the language is declared and
-\pkg{zref-clever} has a built-in ``dictionary'' for it, most use cases will
+\pkg{zref-clever} has a built-in ``language file'' for it, most use cases will
likely be covered by the \opt{lang} option (see \zcref{sec:options}), and its
values \texttt{current} and \texttt{main}. When the \opt{lang} option is set
to \texttt{current} or \texttt{main}, \pkg{zref-check} will use, respectively,
@@ -1108,17 +1111,17 @@ the \emph{current} or \emph{main} language of the document, as defined by
will note that \zcref{tab:languages-and-aliases} contains only \pkg{babel}
language names.} Users can also set \opt{lang} to a specific language
directly, in which case \pkg{babel} and \pkg{polyglossia} are disregarded.
-\pkg{zref-clever} provides a number of built-in ``dictionaries'', for the
+\pkg{zref-clever} provides a number of built-in ``language file'', for the
languages listed in \zcref{tab:languages-and-aliases}, which also includes the
declared aliases to those languages.
-\pkg{zref-clever}'s ``dictionaries'' are loaded sparingly and lazily. A
-dictionary for a single language -- that specified by user options in the
+\pkg{zref-clever}'s ``language files'' are loaded sparingly and lazily. A
+language file for a single language -- that specified by user options in the
preamble, which by default is the current document language -- is loaded at
-\texttt{begindocument}. If any other dictionary is needed, it is loaded on
+\texttt{begindocument}. If any other language file is needed, it is loaded on
the fly, if and when required. Of course, in either case, conditioned on
availability. In sum, \pkg{zref-clever} loads as little as possible, but
-allows for convenient on the fly loading of dictionaries if the values are
+allows for convenient on the fly loading of language files if the values are
indeed required, without users having to worry about it at all.
\begin{table}
@@ -1155,7 +1158,7 @@ indeed required, without users having to worry about it at all.
& brazil \\
& portuges \\
spanish & \\
- & \\
+ dutch & \\
\bottomrule
\end{tabular}
\caption{Declared languages and aliases}
@@ -1163,11 +1166,11 @@ indeed required, without users having to worry about it at all.
\end{table}
-But if the built-in dictionaries do not cover your language, or if you'd like
-to adjust some of the default language-specific options, this can be done with
-\cs{zcDeclareLanguage}, \cs{zcDeclareLanguageAlias}, and
+But if the built-in language files do not cover your language, or if you'd
+like to adjust some of the default language-specific options, this can be done
+with \cs{zcDeclareLanguage}, \cs{zcDeclareLanguageAlias}, and
\cs{zcLanguageSetup}.\footnote{Needless to say, if you'd like to contribute a
- dictionary or improve an existing one, that is much welcome at
+ language file or improve an existing one, that is much welcome at
\url{https://github.com/gusbrs/zref-clever/issues}.}
\begin{function}{\zcDeclareLanguage}
@@ -1190,13 +1193,13 @@ in \cs{zcLanguageSetup}. There is no default presumed in this case. Finally,
capitalized for grammatical reasons. For a language declared with the
\opt{allcaps} option, the \opt{cap} reference option (see \zcref{sec:options})
is disregarded, and \cs{zcref} always uses the capitalized type name forms.
-This means that dictionaries for languages with such a trait can be halved in
-size, and that user customization for them is simplified, only requiring the
-capitalized name forms. On the other hand, the non-capitalized \texttt{name-}
-reference format options are rendered no-op for the language in question.
-\zcref[S]{tab:language-options} presents an overview of the options in effect
-for the languages declared by \pkg{zref-clever}. \cs{zcDeclareLanguage} is
-preamble only.
+This means that language files for languages with such a trait can be halved
+in size, and that user customization for them is simplified, only requiring
+the capitalized name forms. On the other hand, the non-capitalized
+\texttt{name-} reference format options are rendered no-op for the language in
+question. \zcref[S]{tab:language-options} presents an overview of the options
+in effect for the languages declared by \pkg{zref-clever}.
+\cs{zcDeclareLanguage} is preamble only.
\begin{table}
\centering
@@ -1209,6 +1212,7 @@ preamble only.
german & N,A,D,G & f,m,n & yes \\
portuguese & -- & f,m & -- \\
spanish & -- & f,m & -- \\
+ dutch & -- & f,m,n & -- \\
\bottomrule
\end{tabular}
\caption{Options for declared languages}
@@ -1245,12 +1249,13 @@ for reference type \texttt{foo}. Similarly, after \texttt{case=X} (provided
first occurrence of either \opt{type} or \opt{case} default values are set.
For \opt{case} this means the default declension case, which is the first
element of the list provided to the \opt{declension} option in
-\cs{zcDeclareLanguage}. For \opt{type} this means ``default translations'',
-which are language-specific but not type-specific option values (see
-\zcref{sec:reference-format}). An empty valued \texttt{type=} key can also
-``unset'' the type. The \opt{gender} key sets the gender of the current
-\texttt{type} (provided the value it receives is one of the declared genders
-for \meta{language}). \cs{zcLanguageSetup} is preamble only.
+\cs{zcDeclareLanguage}. For \opt{type} this means language-specific but not
+type-specific option values (see \zcref{sec:reference-format}). An empty
+valued \texttt{type=} key can also ``unset'' the type. The \opt{gender} key
+sets the gender of the current \texttt{type} (provided the value it receives
+is one of the declared genders for \meta{language}). For \texttt{type}s which
+have multiple valid genders for a given language, the option can also receive
+a comma separated list. \cs{zcLanguageSetup} is preamble only.
A couple of examples to illustrate the syntax of \cs{zcLanguageSetup}:
@@ -1292,7 +1297,7 @@ their typeset output automated.
For reference type names, the declension cases for each language must be
declared with \cs{zcDeclareLanguage}, and the name reference format options
-must be provided for each case, which is done for built-in dictionaries of
+must be provided for each case, which is done for built-in language files of
languages which have noun declension, and can be done by the user with
\cs{zcLanguageSetup}, as we've seen. \pkg{zref-clever} does not try to guess
or infer the case though, you must tell it to \cs{zcref}. And this is done by
@@ -1328,11 +1333,11 @@ is comprised of multiple type blocks. \opt{comptosing} when multiple labels
of the same type block have been compressed into a single one and, hence, the
type name used is singular. Finally, \opt{gender} nudges when there is a
mismatch between the gender specified in \cs{zcref} with the \opt{g} option
-and the gender of the type name, as stored in the dictionary or language
-settings, for each type block. Which nudges to use is configurable with the
-option \opt{nudgeif}. And, if you're sure of the results for a particular
-\cs{zcref} call, you can always silence the nudges locally with the
-\opt{nonudge} option.
+and the gender of the type name, as set in the language file or with
+\cs{zcLanguageSetup}, for each type block. Which nudges to use is
+configurable with the option \opt{nudgeif}. And, if you're sure of the
+results for a particular \cs{zcref} call, you can always silence the nudges
+locally with the \opt{nonudge} option.
The main reason to watch for multiple type references with the \opt{multitype}
nudge is that bundling together automatically a list of type blocks is less
@@ -1384,14 +1389,14 @@ example, that implies that the reference to it changes gender and the likely
preceding article will no longer pass to the reference. The \opt{gender}
nudge requires that the gender of each type name and of each reference be
explicitly specified. For the type names, this is done for the built-in
-dictionaries of languages were this matters, and can be done with
+language files of languages were this matters, and can be done with
\cs{zcLanguageSetup} as well. For the references, that is the purpose of the
\opt{g} option. When there is a mismatch between the two for any type block,
the nudge is triggered. Of couse, this means that the gender markup has to be
-supplied in the document at each reference. And considering such type changes
-may not be frequent for you, or considered not particularly problematic,
-you'll have to balance if doing so is worth it. Still, the feature is
-available, and it's up to you.
+supplied in the document at each reference. And given such type changes may
+not be frequent for you, or considered not particularly problematic, you'll
+have to balance if doing so is worth it. Still, the feature is available, and
+it's up to you.
\section{How-tos}
@@ -1402,10 +1407,10 @@ set around a cross-reference ``task'' we'd like to perform with
\pkg{zref-clever}.
-\subsection{Context sensitive references}
+\subsection{Context sensitive page references}
-\zctask{Make cross-references which are sensitive to the relative position
- between the reference and the label being referred to.}
+\zctask{Make cross-references to pages which are sensitive to the relative
+ position between the reference and the label being referred to.}
It is frequently useful to make a reference to both a document element and its
page. For example:
@@ -1436,12 +1441,12 @@ corrected. Evidently, this does not fully automate the typeset results, but
it does automate the checking that the reference context is the intended one.
And to make use of this feature, one does not need to rely on compiling the
-document, make one such reference according to the current state of things,
-and then adjusting them over and over, as the document gets edited. This
-feature is best used within a certain workflow, which starts by making a
-standard reference, but adding the \texttt{pagegap} check to it:
+document, make the reference according to the current state of things, and
+then adjusting it over and over, as the document gets edited. This feature is
+best used within a certain workflow, which starts by making a standard
+reference with a page reference, but adding the \texttt{pagegap} check to it:
\begin{zcexample}
-\zcref[check=pagegap]{fig:1} on \zcpageref{fig:1}
+\zcref{fig:1} on \zcpageref[check=pagegap]{fig:1}
\end{zcexample}
During the initial editing of the document, this reference will be formally
@@ -1586,8 +1591,8 @@ cross-references in multiple languages, in which case you'd require
\cs{zcLanguageSetup}, the most convenient way to setup a reference type is
\cs{zcRefTypeSetup}. In most cases, what we really need to provide for a
custom type are the ``type names'' and other reference format options can rely
-on default translations already provided by the package (assuming the language
-is supported).
+on default language options already provided by the package (assuming the
+language is supported).
\begin{zchowto}[caption={\cs{newtheorem}, custom type}]
\documentclass{article}
@@ -2202,7 +2207,7 @@ were generously provided by (in chronological order):
% 2021-10-10: https://tex.stackexchange.com/questions/618434/#comment1544401_618439
Frank Mittelbach,
% 2021-10-14: https://github.com/latex3/latex2e/issues/687
- \texttt{@samcarter},
+ `\texttt{samcarter}',
% 2021-10-14: https://chat.stackexchange.com/transcript/message/59361777#59361777
% 2021-10-21: https://chat.stackexchange.com/transcript/message/59418309#59418309
Alan Munn,
@@ -2215,12 +2220,19 @@ were generously provided by (in chronological order):
% 2021-11-25: https://github.com/gusbrs/zref-clever/issues/1
Marcel Krüger,
% 2021-11-26: https://github.com/latex3/l3build/issues/215
- and Jürgen Spitzmüller.
+ Jürgen Spitzmüller,
% 2021-11-28: https://github.com/gusbrs/zref-clever/issues/2
+ and `\texttt{niluxv}'.
+ % 2022-01-05: https://github.com/gusbrs/zref-clever/issues/4
+ % 2022-01-05: https://github.com/gusbrs/zref-clever/pull/5
-The package's dictionaries have been provided or improved thanks to:
- Denis Bitouzé (French).
+The package's language files have been provided or improved thanks to:
+ Denis Bitouzé (French),
% 2021-11-25: https://github.com/gusbrs/zref-clever/issues/1
+ François Lagarde (French), % 'flagarde'
+ % 2021-12-09: discussion at https://github.com/gusbrs/zref-clever/issues/1
+ and `\texttt{niluxv}' (Dutch).
+ % 2022-01-09: https://github.com/gusbrs/zref-clever/pull/5
If I have inadvertently left anyone off the list I apologize, and please let
me know, so that I can correct the oversight.