summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-24 03:03:39 +0000
committerNorbert Preining <norbert@preining.info>2022-10-24 03:03:39 +0000
commit74697976d2ffe935077542593ccbb18a00603251 (patch)
treeca88ce389275df22be5c2c843de613d8003bf684 /macros
parent588d4f81788b3a24bd9bd480ec40bb55be4d1da1 (diff)
CTAN sync 202210240303
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/iexec/iexec.dtx26
-rw-r--r--macros/latex/contrib/iexec/iexec.pdfbin326148 -> 327771 bytes
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md12
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617674 -> 617655 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-complex.dtx48
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin665420 -> 666267 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex10
-rw-r--r--macros/latex/contrib/srdp-mathematik/README.md2
-rw-r--r--macros/latex/contrib/srdp-mathematik/srdp-mathematik.pdfbin180179 -> 180259 bytes
-rw-r--r--macros/latex/contrib/srdp-mathematik/srdp-mathematik.sty588
-rw-r--r--macros/latex/contrib/srdp-mathematik/srdp-mathematik.tex2
-rw-r--r--macros/latex/required/babel/base/README.md27
-rw-r--r--macros/latex/required/babel/base/babel.dtx205
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin885961 -> 885304 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
-rw-r--r--macros/luatex/latex/piton/piton-french.pdfbin154819 -> 217579 bytes
-rw-r--r--macros/luatex/latex/piton/piton-french.tex543
-rw-r--r--macros/luatex/latex/piton/piton.dtx857
-rw-r--r--macros/luatex/latex/piton/piton.pdfbin308546 -> 407293 bytes
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.dtx1239
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.ins4
-rw-r--r--macros/unicodetex/latex/njuthesis/njuthesis.pdfbin1185691 -> 1200264 bytes
24 files changed, 2630 insertions, 939 deletions
diff --git a/macros/latex/contrib/iexec/iexec.dtx b/macros/latex/contrib/iexec/iexec.dtx
index 30f44bdbf9..94b924652a 100644
--- a/macros/latex/contrib/iexec/iexec.dtx
+++ b/macros/latex/contrib/iexec/iexec.dtx
@@ -50,12 +50,13 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{iexec}
%<*package>
-[2022-10-22 0.11.0 Inputable Shell Executions]
+[2022-10-23 0.11.1 Inputable Shell Executions]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
\usepackage{microtype}
+\usepackage{xcolor}
\usepackage[dtx]{docshots}
\usepackage{iexec}
\usepackage{href-ul}
@@ -77,6 +78,9 @@
%
% \maketitle
%
+% \textbf{\color{red}NB!}
+% This package doesn't work on Windows!
+%
% \section{Introduction}
%
% This package helps you execute shell commands right from the
@@ -324,7 +328,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\fi%
\begingroup%
% \end{macrocode}
-% Then, start the log from a clean line:
+% Then, we start the log from a clean line:
% \begin{macrocode}
\ifdefined\iexec@log%
\message{^^J}%
@@ -339,27 +343,28 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\let\{\@charlb%
\let\}\@charrb%
% \end{macrocode}
-% Then, we execute it:
+% Then, we execute it and save exit code into a file (where we also add \% in order to trim the content to exactly one number, as suggested \href{https://tex.stackexchange.com/questions/662756}{here}):
% \changes{0.10.0}{2022/10/19}{The ability to track exit code was added. Now, the code is saved into "iexec.ret" file, which is then read and checked for zero value.}
% \changes{0.8.0}{2022/10/05}{The option "null" was introduced, allowing redirection of stdout to "/dev/null". Doesn't work on Windows, though.}
% \changes{0.9.0}{2022/10/15}{The option "stderr" was introduced, allowing redirection of stderr to a file. Without this option specified, stderr will go to stdout.}
% \changes{0.11.0}{2022/10/22}{The file with exit code now contains just numbers, without end of line.}
+% \changes{0.11.1}{2022/10/23}{When exit code is printed to the file, we add percentchar at the end of line in order to avoid extra space when reading it back.}
% \begin{macrocode}
\def\iexec@cmd{(#2)
\ifdefined\iexec@append>\fi>
\ifdefined\iexec@null/dev/null\else\iexec@stdout\fi
\space\ifdefined\iexec@stderr2>\iexec@stderr\else2>&1\fi;
- /bin/echo -n $? >\iexec@exit}
+ /bin/echo -n $?\% >\iexec@exit}
\ShellEscape{\iexec@cmd}%
% \end{macrocode}
-% Then, a message is printed to TeX log:
+% Then, a message is printed to \TeX{} log:
% \begin{macrocode}
\ifdefined\iexec@log%
\message{iexec: [\iexec@cmd]^^J}%
\fi%
\endgroup%
% \end{macrocode}
-% Then, if required, the content of the stdout file will be printed to the log:
+% Then, if required, we print the content of the stdout file to \TeX{} log:
% \begin{macrocode}
\ifdefined\iexec@null\else%
\ifdefined\iexec@log%
@@ -368,11 +373,14 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\message{<EOF>^^J}%
\fi\fi%
% \end{macrocode}
-% Then, we check exit code, unless there is |ignore| option:
+% Then, we read back the exit code, from the file:
% \begin{macrocode}
\immediate\openin\iexec@exitfile=\iexec@exit%
\read\iexec@exitfile to \iexec@code%
\immediate\closein\iexec@exitfile%
+% \end{macrocode}
+% Then, we check whether it's zero or not (if not zero, we either print a message or fail the build, depending on the presence of |ignore| option):
+% \begin{macrocode}
\ifnum\iexec@code=0\else%
\ifdefined\iexec@ignore%
\ifdefined\iexec@log%
@@ -385,7 +393,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
\fi%
\fi%
% \end{macrocode}
-% Then, include the produced output into the current document:
+% Then, we include the produced output into the current document:
% \begin{macrocode}
\ifdefined\iexec@null\else%
\ifdefined\iexec@quiet%
@@ -406,7 +414,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}.
was included into the document^^J}%
\fi\fi%
% \end{macrocode}
-% Finally, delete the file or leave it untouched:
+% Finally, we delete the file or leave it untouched:
% \begin{macrocode}
\ifdefined\iexec@null\else%
\ifiexec@trace%
diff --git a/macros/latex/contrib/iexec/iexec.pdf b/macros/latex/contrib/iexec/iexec.pdf
index e4633ab765..c3d51f4982 100644
--- a/macros/latex/contrib/iexec/iexec.pdf
+++ b/macros/latex/contrib/iexec/iexec.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index 7cdde2cf78..d1d7b1c61f 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,15 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.1.9] - 2022-10-23
+
+### Added
+- Option `print-complex-unity`
+
+## Fixed
+- Printing of complex values of exactly one (see issue
+ [\#625](https://github.com/josephwright/siunitx/issues/625))
+
## [v3.1.8] - 2022-10-04
### Fixed
@@ -1817,7 +1826,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.8...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.9...HEAD
+[v3.1.9]: https://github.com/josephwright/siunitx/compare/v3.1.8...v3.1.9
[v3.1.8]: https://github.com/josephwright/siunitx/compare/v3.1.7...v3.1.8
[v3.1.7]: https://github.com/josephwright/siunitx/compare/v3.1.6...v3.1.7
[v3.1.6]: https://github.com/josephwright/siunitx/compare/v3.1.5...v3.1.6
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index cf6bc8c78c..7bfe53e8a8 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-complex.dtx b/macros/latex/contrib/siunitx/siunitx-complex.dtx
index 9cd595d28f..8303c9f302 100644
--- a/macros/latex/contrib/siunitx/siunitx-complex.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-complex.dtx
@@ -164,6 +164,14 @@
% is |\mathrm{i}|.
% \end{function}
%
+% \begin{function}{print-complex-unity}
+% \begin{syntax}
+% |print-complex-unity| = |true|\verb"|"|false|
+% \end{syntax}
+% Switch to determine if the number \num{1} is printed for a complex
+% part which is exactly unity.
+% \end{function}
+%
% \end{documentation}
%
% \begin{implementation}
@@ -286,7 +294,9 @@
input-complex-root .tl_set:N =
\l_@@_input_root_tl ,
output-complex-root .tl_set:N =
- \l_@@_output_root_tl
+ \l_@@_output_root_tl ,
+ print-complex-unity .bool_set:N =
+ \l_@@_print_unity_bool
}
% \end{macrocode}
% \end{variable}
@@ -860,8 +870,7 @@
\cs_new_protected:Npn \@@_drop_exponent:nnnnnnn #1#2#3#4#5#6#7
{ \tl_set:Nn \l_@@_real_tl { {#1} {#2} {#3} {#4} {#5} { } { 0 } } }
% \end{macrocode}
-% Ensure the imaginary part has a sign, and also deal with the case
-% where there is no mantissa to print (as it is $1$).
+% Ensure the imaginary part has a sign.
% \begin{macrocode}
\cs_new_protected:Npn \@@_format_sign:nnnnnnn #1#2#3#4#5#6#7
{
@@ -873,14 +882,7 @@
{ \tl_if_empty:NF \l_@@_real_tl { + } }
{ \exp_not:n {#2} }
}
- \tl_if_blank:nTF {#4}
- {
- \str_if_eq:nnTF {#3} { 1 }
- { { } { } }
- { \exp_not:n { {#3} {#4} } }
- }
- { \exp_not:n { {#3} {#4} } }
- \exp_not:n { {#5} {#6} {#7} }
+ \exp_not:n { {#3} {#4} {#5} {#6} {#7} }
}
}
% \end{macrocode}
@@ -893,9 +895,12 @@
\q_nil #9 \q_stop
{
\tl_set:Nn \l_@@_sign_tl {#1#2}
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn {#3} { 1 } }
- { \tl_if_blank_p:n {#5} }
+ \bool_lazy_all:nTF
+ {
+ { ! \l_@@_print_unity_bool }
+ { \str_if_eq_p:nn {#3} { 1 } }
+ { \tl_if_blank_p:n {#5} }
+ }
{ \@@_extract_exponent_aux:nw {#6#7#8} }
{ \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} }
#9 \q_stop
@@ -1200,13 +1205,14 @@
% \begin{macrocode}
\keys_set:nn { siunitx }
{
- complex-angle-unit = degrees ,
- complex-mode = input ,
- complex-root-position = after-number ,
- complex-symbol-angle = \angle ,
- complex-symbol-degree = \degree ,
- input-complex-root = ij ,
- output-complex-root = \mathrm { i }
+ complex-angle-unit = degrees ,
+ complex-mode = input ,
+ complex-root-position = after-number ,
+ complex-symbol-angle = \angle ,
+ complex-symbol-degree = \degree ,
+ input-complex-root = ij ,
+ output-complex-root = \mathrm { i } ,
+ print-complex-unity = false
}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 3e61bbb85c..b39fdd662e 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-10-04} {3.1.8}
+\ProvidesExplPackage {siunitx} {2022-10-23} {3.1.9}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 15032f9957..92efe61c67 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 05c3e70ffa..1c4b9ab910 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -2055,6 +2055,7 @@ numbers; these are summarised in Table~\ref{tab:opt:num:complex}.
complex-symbol-degree & Literal & \cs{degree} \\
input-complex-root & Literal & ij \\
output-complex-root & Literal & \verb=\mathrm{i}= \\
+ print-complex-unity & Switch & false \\
\bottomrule
\end{tabular}
\end{table}
@@ -2121,6 +2122,15 @@ are controlled by the options \opt{complex-symbol-angle} and
\complexqty[complex-symbol-degree = d]{1:1}{\ohm}
\end{LaTeXdemo}
+\DescribeOption{print-complex-unity}
+When the complex part of a number is exactly \num{1}, it is possible to either
+print or suppress the value. This is controlled by the switch
+\opt{print-complex-unity}.
+\begin{LaTeXdemo}
+ \complexqty{1i}{\ohm} \\
+ \complexqty[print-complex-unity]{1i}{\ohm}
+\end{LaTeXdemo}
+
\subsection{Angles}
Angle processing provided by the \cs{ang} function has a set of options which
diff --git a/macros/latex/contrib/srdp-mathematik/README.md b/macros/latex/contrib/srdp-mathematik/README.md
index d9add6410e..7039bb45d1 100644
--- a/macros/latex/contrib/srdp-mathematik/README.md
+++ b/macros/latex/contrib/srdp-mathematik/README.md
@@ -1,4 +1,4 @@
-# srdp-mathematik.sty v1.10.2
+# srdp-mathematik.sty v1.10.3
This package provides basic commands for the defined formats of the Austrian sRDP in mathematics.
Furthermore, it includes ways to implement answers in the tex file, which can be voluntarily displayed in the pdf file and
diff --git a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.pdf b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.pdf
index 3fa05e4243..8f0b92a267 100644
--- a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.pdf
+++ b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.pdf
Binary files differ
diff --git a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.sty b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.sty
index d0bbee7b01..db631f2e19 100644
--- a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.sty
+++ b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.sty
@@ -10,7 +10,7 @@
%
\NeedsTeXFormat{LaTeX2e}[1996/12/26]
-\ProvidesPackage{srdp-mathematik}[2022/10/02 v1.10.2 Standard-Schularbeitsformate]
+\ProvidesPackage{srdp-mathematik}[2022/10/23 v1.10.3 Standard-Schularbeitsformate]
\usepackage{color}
@@ -934,41 +934,277 @@ Complete the following sentence by putting a cross next to one of the given poss
\ifthenelse{\numexpr#1 > 7}{\pgfmathrandomitem\z{group}\setcounter{antworth}{\z}\prunelist{group}}{}
\ifthenelse{\numexpr#1 > 8}{\pgfmathrandomitem\z{group}\setcounter{antworti}{\z}\prunelist{group}}{}
-%\begin{minipage}{0.85\linewidth}
+
\begin{tabu}{|A|c|c|}%
\hline%
\small \textsc{#2} & \small\textsc{Richtig} & \small \textsc{Falsch} \\ \hline
\forloop{ct}{1}{\value{ct}<\numexpr#1}%
-{\ifthenelse{\value{ct}=\theantworta}{\jeroen@get{L1}}{\ifthenelse{\value{ct}=\theantwortb}{\jeroen@get{L2}}{\ifthenelse{\value{ct}=\theantwortc}{\jeroen@get{L3}}{\ifthenelse{\value{ct}=\theantwortd}{\jeroen@get{L4}}{\ifthenelse{\value{ct}=\theantworte}{\jeroen@get{L5}}{\ifthenelse{\value{ct}=\theantwortf}{\jeroen@get{L6}}{\ifthenelse{\value{ct}=\theantwortg}{\jeroen@get{L7}}{\ifthenelse{\value{ct}=\theantworth}{\jeroen@get{L8}}{{\jeroen@get{L9}}}}}}}}}}&%
-%
+{\ifthenelse{\value{ct}=\theantworta}{\jeroen@get{L1}}{%
+\ifthenelse{\value{ct}=\theantwortb}{\jeroen@get{L2}}{%
+\ifthenelse{\value{ct}=\theantwortc}{\jeroen@get{L3}}{%
+\ifthenelse{\value{ct}=\theantwortd}{\jeroen@get{L4}}{%
+\ifthenelse{\value{ct}=\theantworte}{\jeroen@get{L5}}{%
+\ifthenelse{\value{ct}=\theantwortf}{\jeroen@get{L6}}{%
+\ifthenelse{\value{ct}=\theantwortg}{\jeroen@get{L7}}{%
+\ifthenelse{\value{ct}=\theantworth}{\jeroen@get{L8}}{{%
+\jeroen@get{L9}}}}}}}}}}&%
+%%%
%%% Spalte 'Richtig' %%%%
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\jeroen@get{A1}=1 \OR \jeroen@get{A2}=1 \OR \jeroen@get{A3}=1\OR \jeroen@get{A4}=1 \OR \jeroen@get{A5}=1 \OR \jeroen@get{A6}=1 \OR \jeroen@get{A7}=1 \OR \jeroen@get{A8}=1 \OR \jeroen@get{A9}=1 \AND \value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{\jeroen@get{A1}=2 \OR \jeroen@get{A2}=2 \OR \jeroen@get{A3}=2\OR \jeroen@get{A4}=2\OR \jeroen@get{A5}=2\OR \jeroen@get{A6}=2 \OR \jeroen@get{A7}=2 \OR \jeroen@get{A8}=2 \OR \jeroen@get{A9}=2 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=3 \OR \jeroen@get{A2}=3 \OR \jeroen@get{A3}=3\OR \jeroen@get{A4}=3\OR \jeroen@get{A5}=3 \OR \jeroen@get{A6}=3 \OR \jeroen@get{A7}=3 \OR \jeroen@get{A8}=3 \OR \jeroen@get{A9}=3 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{\jeroen@get{A1}=4 \OR \jeroen@get{A2}=4 \OR \jeroen@get{A3}=4\OR \jeroen@get{A4}=4\OR \jeroen@get{A5}=4\OR \jeroen@get{A6}=4 \OR \jeroen@get{A7}=4 \OR \jeroen@get{A8}=4 \OR \jeroen@get{A9}=4 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=5 \OR \jeroen@get{A2}=5 \OR \jeroen@get{A3}=5\OR \jeroen@get{A4}=5\OR \jeroen@get{A5}=5\OR \jeroen@get{A6}=5 \OR \jeroen@get{A7}=5 \OR \jeroen@get{A8}=5 \OR \jeroen@get{A9}=5 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{\jeroen@get{A1}=6 \OR \jeroen@get{A2}=6 \OR \jeroen@get{A3}=6\OR \jeroen@get{A4}=6\OR \jeroen@get{A5}=6\OR \jeroen@get{A6}=6 \OR \jeroen@get{A7}=6 \OR \jeroen@get{A8}=6 \OR \jeroen@get{A9}=6 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=7 \OR \jeroen@get{A2}=7 \OR \jeroen@get{A3}=7\OR \jeroen@get{A4}=7\OR \jeroen@get{A5}=7\OR \jeroen@get{A6}=7 \OR \jeroen@get{A7}=7 \OR \jeroen@get{A8}=7 \OR \jeroen@get{A9}=7 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=8 \OR \jeroen@get{A2}=8 \OR \jeroen@get{A3}=8\OR \jeroen@get{A4}=8\OR \jeroen@get{A5}=8\OR \jeroen@get{A6}=8 \OR \jeroen@get{A7}=8 \OR \jeroen@get{A8}=8 \OR \jeroen@get{A9}=8 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=9 \OR \jeroen@get{A2}=9 \OR \jeroen@get{A3}=9\OR \jeroen@get{A4}=9\OR \jeroen@get{A5}=9\OR \jeroen@get{A6}=9 \OR \jeroen@get{A7}=9 \OR \jeroen@get{A8}=9 \OR \jeroen@get{A9}=9 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
-\else%
-\Square\fi&%
-%
+%%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{%
+\jeroen@get{A1}=1\OR%
+\jeroen@get{A2}=1\OR%
+\jeroen@get{A3}=1\OR%
+\jeroen@get{A4}=1\OR%
+\jeroen@get{A5}=1\OR%
+\jeroen@get{A6}=1\OR%
+\jeroen@get{A7}=1\OR%
+\jeroen@get{A8}=1\OR%
+\jeroen@get{A9}=1\AND%
+\value{ct}=\theantworta}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=2\OR%
+\jeroen@get{A2}=2\OR%
+\jeroen@get{A3}=2\OR%
+\jeroen@get{A4}=2\OR%
+\jeroen@get{A5}=2\OR%
+\jeroen@get{A6}=2\OR%
+\jeroen@get{A7}=2\OR%
+\jeroen@get{A8}=2\OR%
+\jeroen@get{A9}=2\AND%
+\value{ct}=\theantwortb}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=3\OR%
+\jeroen@get{A2}=3\OR%
+\jeroen@get{A3}=3\OR%
+\jeroen@get{A4}=3\OR%
+\jeroen@get{A5}=3\OR%
+\jeroen@get{A6}=3\OR%
+\jeroen@get{A7}=3\OR%
+\jeroen@get{A8}=3\OR%
+\jeroen@get{A9}=3\AND%
+\value{ct}=\theantwortc}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=4\OR%
+\jeroen@get{A2}=4\OR%
+\jeroen@get{A3}=4\OR%
+\jeroen@get{A4}=4\OR%
+\jeroen@get{A5}=4\OR%
+\jeroen@get{A6}=4\OR%
+\jeroen@get{A7}=4\OR%
+\jeroen@get{A8}=4\OR%
+\jeroen@get{A9}=4\AND%
+\value{ct}=\theantwortd}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=5\OR%
+\jeroen@get{A2}=5\OR%
+\jeroen@get{A3}=5\OR%
+\jeroen@get{A4}=5\OR%
+\jeroen@get{A5}=5\OR%
+\jeroen@get{A6}=5\OR%
+\jeroen@get{A7}=5\OR%
+\jeroen@get{A8}=5\OR%
+\jeroen@get{A9}=5\AND%
+\value{ct}=\theantworte}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=6\OR%
+\jeroen@get{A2}=6\OR%
+\jeroen@get{A3}=6\OR%
+\jeroen@get{A4}=6\OR%
+\jeroen@get{A5}=6\OR%
+\jeroen@get{A6}=6\OR%
+\jeroen@get{A7}=6\OR%
+\jeroen@get{A8}=6\OR%
+\jeroen@get{A9}=6\AND%
+\value{ct}=\theantwortf}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=7\OR%
+\jeroen@get{A2}=7\OR%
+\jeroen@get{A3}=7\OR%
+\jeroen@get{A4}=7\OR%
+\jeroen@get{A5}=7\OR%
+\jeroen@get{A6}=7\OR%
+\jeroen@get{A7}=7\OR%
+\jeroen@get{A8}=7\OR%
+\jeroen@get{A9}=7\AND%
+\value{ct}=\theantwortg}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=8\OR%
+\jeroen@get{A2}=8\OR%
+\jeroen@get{A3}=8\OR%
+\jeroen@get{A4}=8\OR%
+\jeroen@get{A5}=8\OR%
+\jeroen@get{A6}=8\OR%
+\jeroen@get{A7}=8\OR%
+\jeroen@get{A8}=8\OR%
+\jeroen@get{A9}=8\AND%
+\value{ct}=\theantworth}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=9\OR%
+\jeroen@get{A2}=9\OR%
+\jeroen@get{A3}=9\OR%
+\jeroen@get{A4}=9\OR%
+\jeroen@get{A5}=9\OR%
+\jeroen@get{A6}=9\OR%
+\jeroen@get{A7}=9\OR%
+\jeroen@get{A8}=9\OR%
+\jeroen@get{A9}=9\AND%
+\value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
+}{\Square}&%
+%%%%
%%%% Spalte 'falsch'
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\value{acheck}=0 \AND \value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{bcheck}=0 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{ccheck}=0 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{dcheck}=0 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{echeck}=0 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{fcheck}=0 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{gcheck}=0 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{hcheck}=0 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{icheck}=0 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
-\else%
-\Square\fi\\ \hline}%
-%
+%%%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{\value{acheck}=0\AND%
+\value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{bcheck}=0 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{ccheck}=0 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{dcheck}=0 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{echeck}=0 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{fcheck}=0 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{gcheck}=0 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{hcheck}=0 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{icheck}=0 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+}{\Square}\\ \hline}%
+
+%%%%
%%%%% Spalte 'richtig' (letzte Zeile)
-\ifthenelse{\theantworta=#1}{\jeroen@get{L1}}{\ifthenelse{\theantwortb=#1}{\jeroen@get{L2}}{\ifthenelse{\theantwortc=#1}{\jeroen@get{L3}}{\ifthenelse{\theantwortd=#1}{\jeroen@get{L4}}{\ifthenelse{\theantworte=#1}{\jeroen@get{L5}}{\ifthenelse{\theantwortf=#1}{\jeroen@get{L6}}{\ifthenelse{\theantwortg=#1}{\jeroen@get{L7}}{\ifthenelse{\theantworth=#1}{\jeroen@get{L8}}{{\jeroen@get{L9}}}}}}}}}} &%
-%
-%
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\jeroen@get{A1}=1 \OR \jeroen@get{A2}=1 \OR \jeroen@get{A3}=1\OR \jeroen@get{A4}=1\OR \jeroen@get{A5}=1\OR \jeroen@get{A6}=1 \OR \jeroen@get{A7}=1 \OR \jeroen@get{A8}=1 \OR \jeroen@get{A9}=1 \AND \theantworta=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{\jeroen@get{A1}=2 \OR \jeroen@get{A2}=2 \OR \jeroen@get{A3}=2\OR \jeroen@get{A4}=2\OR \jeroen@get{A5}=2\OR \jeroen@get{A6}=2 \OR \jeroen@get{A7}=2 \OR \jeroen@get{A8}=2 \OR \jeroen@get{A9}=2 \AND \theantwortb=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=3 \OR \jeroen@get{A2}=3 \OR \jeroen@get{A3}=3\OR \jeroen@get{A4}=3\OR \jeroen@get{A5}=3\OR \jeroen@get{A6}=3 \OR \jeroen@get{A7}=3 \OR \jeroen@get{A8}=3 \OR \jeroen@get{A9}=3 \AND \theantwortc=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{\jeroen@get{A1}=4 \OR \jeroen@get{A2}=4 \OR \jeroen@get{A3}=4\OR \jeroen@get{A4}=4\OR \jeroen@get{A5}=4\OR \jeroen@get{A6}=4 \OR \jeroen@get{A7}=4 \OR \jeroen@get{A8}=4 \OR \jeroen@get{A9}=4 \AND \theantwortd=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=5 \OR \jeroen@get{A2}=5 \OR \jeroen@get{A3}=5\OR \jeroen@get{A4}=5\OR \jeroen@get{A5}=5\OR \jeroen@get{A6}=5 \OR \jeroen@get{A7}=5 \OR \jeroen@get{A8}=5 \OR \jeroen@get{A9}=5 \AND \theantworte=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{\jeroen@get{A1}=6 \OR \jeroen@get{A2}=6 \OR \jeroen@get{A3}=6\OR \jeroen@get{A4}=6\OR \jeroen@get{A5}=6\OR \jeroen@get{A6}=6 \OR \jeroen@get{A7}=6 \OR \jeroen@get{A8}=6 \OR \jeroen@get{A9}=6 \AND \theantwortf=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=7 \OR \jeroen@get{A2}=7 \OR \jeroen@get{A3}=7\OR \jeroen@get{A4}=7\OR \jeroen@get{A5}=7\OR \jeroen@get{A6}=7 \OR \jeroen@get{A7}=7 \OR \jeroen@get{A8}=7 \OR \jeroen@get{A9}=7 \AND \theantwortg=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=8 \OR \jeroen@get{A2}=8 \OR \jeroen@get{A3}=8\OR \jeroen@get{A4}=8\OR \jeroen@get{A5}=8\OR \jeroen@get{A6}=8 \OR \jeroen@get{A7}=8 \OR \jeroen@get{A8}=8 \OR \jeroen@get{A9}=8 \AND \theantworth=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=9 \OR \jeroen@get{A2}=9 \OR \jeroen@get{A3}=9\OR \jeroen@get{A4}=9\OR \jeroen@get{A5}=9\OR \jeroen@get{A6}=9 \OR \jeroen@get{A7}=9 \OR \jeroen@get{A8}=9 \OR \jeroen@get{A9}=9 \AND \theantworti=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
-\else%
-\Square\fi%
-&%
-%
+%%%%
+\ifthenelse{\theantworta=#1}{\jeroen@get{L1}}{%
+\ifthenelse{\theantwortb=#1}{\jeroen@get{L2}}{%
+\ifthenelse{\theantwortc=#1}{\jeroen@get{L3}}{%
+\ifthenelse{\theantwortd=#1}{\jeroen@get{L4}}{%
+\ifthenelse{\theantworte=#1}{\jeroen@get{L5}}{%
+\ifthenelse{\theantwortf=#1}{\jeroen@get{L6}}{%
+\ifthenelse{\theantwortg=#1}{\jeroen@get{L7}}{%
+\ifthenelse{\theantworth=#1}{\jeroen@get{L8}}{{%
+\jeroen@get{L9}}}}}}}}}}&%
+%%
+%%
+%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{%
+\jeroen@get{A1}=1\OR%
+\jeroen@get{A2}=1\OR%
+\jeroen@get{A3}=1\OR%
+\jeroen@get{A4}=1\OR%
+\jeroen@get{A5}=1\OR%
+\jeroen@get{A6}=1\OR%
+\jeroen@get{A7}=1\OR%
+\jeroen@get{A8}=1\OR%
+\jeroen@get{A9}=1\AND%
+\theantworta=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=2\OR%
+\jeroen@get{A2}=2\OR%
+\jeroen@get{A3}=2\OR%
+\jeroen@get{A4}=2\OR%
+\jeroen@get{A5}=2\OR%
+\jeroen@get{A6}=2\OR%
+\jeroen@get{A7}=2\OR%
+\jeroen@get{A8}=2\OR%
+\jeroen@get{A9}=2\AND%
+\theantwortb=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=3\OR%
+\jeroen@get{A2}=3\OR%
+\jeroen@get{A3}=3\OR%
+\jeroen@get{A4}=3\OR%
+\jeroen@get{A5}=3\OR%
+\jeroen@get{A6}=3\OR%
+\jeroen@get{A7}=3\OR%
+\jeroen@get{A8}=3\OR%
+\jeroen@get{A9}=3\AND%
+\theantwortc=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=4\OR%
+\jeroen@get{A2}=4\OR%
+\jeroen@get{A3}=4\OR%
+\jeroen@get{A4}=4\OR%
+\jeroen@get{A5}=4\OR%
+\jeroen@get{A6}=4\OR%
+\jeroen@get{A7}=4\OR%
+\jeroen@get{A8}=4\OR%
+\jeroen@get{A9}=4\AND%
+\theantwortd=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=5\OR%
+\jeroen@get{A2}=5\OR%
+\jeroen@get{A3}=5\OR%
+\jeroen@get{A4}=5\OR%
+\jeroen@get{A5}=5\OR%
+\jeroen@get{A6}=5\OR%
+\jeroen@get{A7}=5\OR%
+\jeroen@get{A8}=5\OR%
+\jeroen@get{A9}=5\AND%
+\theantworte=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=6\OR%
+\jeroen@get{A2}=6\OR%
+\jeroen@get{A3}=6\OR%
+\jeroen@get{A4}=6\OR%
+\jeroen@get{A5}=6\OR%
+\jeroen@get{A6}=6\OR%
+\jeroen@get{A7}=6\OR%
+\jeroen@get{A8}=6\OR%
+\jeroen@get{A9}=6\AND%
+\theantwortf=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=7\OR%
+\jeroen@get{A2}=7\OR%
+\jeroen@get{A3}=7\OR%
+\jeroen@get{A4}=7\OR%
+\jeroen@get{A5}=7\OR%
+\jeroen@get{A6}=7\OR%
+\jeroen@get{A7}=7\OR%
+\jeroen@get{A8}=7\OR%
+\jeroen@get{A9}=7\AND%
+\theantwortg=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=8\OR%
+\jeroen@get{A2}=8\OR%
+\jeroen@get{A3}=8\OR%
+\jeroen@get{A4}=8\OR%
+\jeroen@get{A5}=8\OR%
+\jeroen@get{A6}=8\OR%
+\jeroen@get{A7}=8\OR%
+\jeroen@get{A8}=8\OR%
+\jeroen@get{A9}=8\AND%
+\theantworth=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=9\OR%
+\jeroen@get{A2}=9\OR%
+\jeroen@get{A3}=9\OR%
+\jeroen@get{A4}=9\OR%
+\jeroen@get{A5}=9\OR%
+\jeroen@get{A6}=9\OR%
+\jeroen@get{A7}=9\OR%
+\jeroen@get{A8}=9\OR%
+\jeroen@get{A9}=9\AND%
+\theantworti=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
+}{\Square}&%
+%%%
%%%% Spalte 'falsch' (letzte Zeile)
-%
-\ifnum\theAntworten=1%
+%%%
+\ifthenelse{\theAntworten=1}{%
\ifthenelse{\theantworta=#1 \AND \value{acheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantwortb=#1 \AND \value{bcheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantwortc=#1 \AND \value{ccheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
@@ -979,8 +1215,7 @@ Complete the following sentence by putting a cross next to one of the given poss
\ifthenelse{\theantworth=#1 \AND \value{hcheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantworti=#1 \AND \value{icheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
}}}}}}}}}%
-\else%
-\Square\fi\\ \hline
+}{\Square}\\ \hline
\end{tabu}\leer
\egroup}
@@ -1010,41 +1245,277 @@ Complete the following sentence by putting a cross next to one of the given poss
\ifthenelse{\numexpr#1 > 7}{\pgfmathrandomitem\z{group}\setcounter{antworth}{\z}\prunelist{group}}{}
\ifthenelse{\numexpr#1 > 8}{\pgfmathrandomitem\z{group}\setcounter{antworti}{\z}\prunelist{group}}{}
-%\begin{minipage}{0.85\linewidth}
+
\begin{tabu}{|A|c|c|}%
\hline%
\small \textsc{#2} & \small\textsc{True} & \small \textsc{False} \\ \hline
\forloop{ct}{1}{\value{ct}<\numexpr#1}%
-{\ifthenelse{\value{ct}=\theantworta}{\jeroen@get{L1}}{\ifthenelse{\value{ct}=\theantwortb}{\jeroen@get{L2}}{\ifthenelse{\value{ct}=\theantwortc}{\jeroen@get{L3}}{\ifthenelse{\value{ct}=\theantwortd}{\jeroen@get{L4}}{\ifthenelse{\value{ct}=\theantworte}{\jeroen@get{L5}}{\ifthenelse{\value{ct}=\theantwortf}{\jeroen@get{L6}}{\ifthenelse{\value{ct}=\theantwortg}{\jeroen@get{L7}}{\ifthenelse{\value{ct}=\theantworth}{\jeroen@get{L8}}{{\jeroen@get{L9}}}}}}}}}}&%
-%
+{\ifthenelse{\value{ct}=\theantworta}{\jeroen@get{L1}}{%
+\ifthenelse{\value{ct}=\theantwortb}{\jeroen@get{L2}}{%
+\ifthenelse{\value{ct}=\theantwortc}{\jeroen@get{L3}}{%
+\ifthenelse{\value{ct}=\theantwortd}{\jeroen@get{L4}}{%
+\ifthenelse{\value{ct}=\theantworte}{\jeroen@get{L5}}{%
+\ifthenelse{\value{ct}=\theantwortf}{\jeroen@get{L6}}{%
+\ifthenelse{\value{ct}=\theantwortg}{\jeroen@get{L7}}{%
+\ifthenelse{\value{ct}=\theantworth}{\jeroen@get{L8}}{{%
+\jeroen@get{L9}}}}}}}}}}&%
+%%%
%%% Spalte 'Richtig' %%%%
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\jeroen@get{A1}=1 \OR \jeroen@get{A2}=1 \OR \jeroen@get{A3}=1\OR \jeroen@get{A4}=1 \OR \jeroen@get{A5}=1 \OR \jeroen@get{A6}=1 \OR \jeroen@get{A7}=1 \OR \jeroen@get{A8}=1 \OR \jeroen@get{A9}=1 \AND \value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{\jeroen@get{A1}=2 \OR \jeroen@get{A2}=2 \OR \jeroen@get{A3}=2\OR \jeroen@get{A4}=2\OR \jeroen@get{A5}=2\OR \jeroen@get{A6}=2 \OR \jeroen@get{A7}=2 \OR \jeroen@get{A8}=2 \OR \jeroen@get{A9}=2 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=3 \OR \jeroen@get{A2}=3 \OR \jeroen@get{A3}=3\OR \jeroen@get{A4}=3\OR \jeroen@get{A5}=3 \OR \jeroen@get{A6}=3 \OR \jeroen@get{A7}=3 \OR \jeroen@get{A8}=3 \OR \jeroen@get{A9}=3 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{\jeroen@get{A1}=4 \OR \jeroen@get{A2}=4 \OR \jeroen@get{A3}=4\OR \jeroen@get{A4}=4\OR \jeroen@get{A5}=4\OR \jeroen@get{A6}=4 \OR \jeroen@get{A7}=4 \OR \jeroen@get{A8}=4 \OR \jeroen@get{A9}=4 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=5 \OR \jeroen@get{A2}=5 \OR \jeroen@get{A3}=5\OR \jeroen@get{A4}=5\OR \jeroen@get{A5}=5\OR \jeroen@get{A6}=5 \OR \jeroen@get{A7}=5 \OR \jeroen@get{A8}=5 \OR \jeroen@get{A9}=5 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{\jeroen@get{A1}=6 \OR \jeroen@get{A2}=6 \OR \jeroen@get{A3}=6\OR \jeroen@get{A4}=6\OR \jeroen@get{A5}=6\OR \jeroen@get{A6}=6 \OR \jeroen@get{A7}=6 \OR \jeroen@get{A8}=6 \OR \jeroen@get{A9}=6 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=7 \OR \jeroen@get{A2}=7 \OR \jeroen@get{A3}=7\OR \jeroen@get{A4}=7\OR \jeroen@get{A5}=7\OR \jeroen@get{A6}=7 \OR \jeroen@get{A7}=7 \OR \jeroen@get{A8}=7 \OR \jeroen@get{A9}=7 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=8 \OR \jeroen@get{A2}=8 \OR \jeroen@get{A3}=8\OR \jeroen@get{A4}=8\OR \jeroen@get{A5}=8\OR \jeroen@get{A6}=8 \OR \jeroen@get{A7}=8 \OR \jeroen@get{A8}=8 \OR \jeroen@get{A9}=8 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=9 \OR \jeroen@get{A2}=9 \OR \jeroen@get{A3}=9\OR \jeroen@get{A4}=9\OR \jeroen@get{A5}=9\OR \jeroen@get{A6}=9 \OR \jeroen@get{A7}=9 \OR \jeroen@get{A8}=9 \OR \jeroen@get{A9}=9 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
-\else%
-\Square\fi&%
-%
+%%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{%
+\jeroen@get{A1}=1\OR%
+\jeroen@get{A2}=1\OR%
+\jeroen@get{A3}=1\OR%
+\jeroen@get{A4}=1\OR%
+\jeroen@get{A5}=1\OR%
+\jeroen@get{A6}=1\OR%
+\jeroen@get{A7}=1\OR%
+\jeroen@get{A8}=1\OR%
+\jeroen@get{A9}=1\AND%
+\value{ct}=\theantworta}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=2\OR%
+\jeroen@get{A2}=2\OR%
+\jeroen@get{A3}=2\OR%
+\jeroen@get{A4}=2\OR%
+\jeroen@get{A5}=2\OR%
+\jeroen@get{A6}=2\OR%
+\jeroen@get{A7}=2\OR%
+\jeroen@get{A8}=2\OR%
+\jeroen@get{A9}=2\AND%
+\value{ct}=\theantwortb}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=3\OR%
+\jeroen@get{A2}=3\OR%
+\jeroen@get{A3}=3\OR%
+\jeroen@get{A4}=3\OR%
+\jeroen@get{A5}=3\OR%
+\jeroen@get{A6}=3\OR%
+\jeroen@get{A7}=3\OR%
+\jeroen@get{A8}=3\OR%
+\jeroen@get{A9}=3\AND%
+\value{ct}=\theantwortc}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=4\OR%
+\jeroen@get{A2}=4\OR%
+\jeroen@get{A3}=4\OR%
+\jeroen@get{A4}=4\OR%
+\jeroen@get{A5}=4\OR%
+\jeroen@get{A6}=4\OR%
+\jeroen@get{A7}=4\OR%
+\jeroen@get{A8}=4\OR%
+\jeroen@get{A9}=4\AND%
+\value{ct}=\theantwortd}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=5\OR%
+\jeroen@get{A2}=5\OR%
+\jeroen@get{A3}=5\OR%
+\jeroen@get{A4}=5\OR%
+\jeroen@get{A5}=5\OR%
+\jeroen@get{A6}=5\OR%
+\jeroen@get{A7}=5\OR%
+\jeroen@get{A8}=5\OR%
+\jeroen@get{A9}=5\AND%
+\value{ct}=\theantworte}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=6\OR%
+\jeroen@get{A2}=6\OR%
+\jeroen@get{A3}=6\OR%
+\jeroen@get{A4}=6\OR%
+\jeroen@get{A5}=6\OR%
+\jeroen@get{A6}=6\OR%
+\jeroen@get{A7}=6\OR%
+\jeroen@get{A8}=6\OR%
+\jeroen@get{A9}=6\AND%
+\value{ct}=\theantwortf}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=7\OR%
+\jeroen@get{A2}=7\OR%
+\jeroen@get{A3}=7\OR%
+\jeroen@get{A4}=7\OR%
+\jeroen@get{A5}=7\OR%
+\jeroen@get{A6}=7\OR%
+\jeroen@get{A7}=7\OR%
+\jeroen@get{A8}=7\OR%
+\jeroen@get{A9}=7\AND%
+\value{ct}=\theantwortg}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=8\OR%
+\jeroen@get{A2}=8\OR%
+\jeroen@get{A3}=8\OR%
+\jeroen@get{A4}=8\OR%
+\jeroen@get{A5}=8\OR%
+\jeroen@get{A6}=8\OR%
+\jeroen@get{A7}=8\OR%
+\jeroen@get{A8}=8\OR%
+\jeroen@get{A9}=8\AND%
+\value{ct}=\theantworth}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{%
+\jeroen@get{A1}=9\OR%
+\jeroen@get{A2}=9\OR%
+\jeroen@get{A3}=9\OR%
+\jeroen@get{A4}=9\OR%
+\jeroen@get{A5}=9\OR%
+\jeroen@get{A6}=9\OR%
+\jeroen@get{A7}=9\OR%
+\jeroen@get{A8}=9\OR%
+\jeroen@get{A9}=9\AND%
+\value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
+}{\Square}&%
+%%%%
%%%% Spalte 'falsch'
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\value{acheck}=0 \AND \value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{bcheck}=0 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{ccheck}=0 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{dcheck}=0 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{echeck}=0 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{fcheck}=0 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{gcheck}=0 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{hcheck}=0 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}\ifthenelse{\value{icheck}=0 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
-\else%
-\Square\fi\\ \hline}%
-%
+%%%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{\value{acheck}=0\AND%
+\value{ct}=\theantworta}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{bcheck}=0 \AND \value{ct}=\theantwortb}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{ccheck}=0 \AND \value{ct}=\theantwortc}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{dcheck}=0 \AND \value{ct}=\theantwortd}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{echeck}=0 \AND \value{ct}=\theantworte}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{fcheck}=0 \AND \value{ct}=\theantwortf}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{gcheck}=0 \AND \value{ct}=\theantwortg}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{hcheck}=0 \AND \value{ct}=\theantworth}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+\ifthenelse{%
+\value{icheck}=0 \AND \value{ct}=\theantworti}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{}%
+}{\Square}\\ \hline}%
+
+%%%%
%%%%% Spalte 'richtig' (letzte Zeile)
-\ifthenelse{\theantworta=#1}{\jeroen@get{L1}}{\ifthenelse{\theantwortb=#1}{\jeroen@get{L2}}{\ifthenelse{\theantwortc=#1}{\jeroen@get{L3}}{\ifthenelse{\theantwortd=#1}{\jeroen@get{L4}}{\ifthenelse{\theantworte=#1}{\jeroen@get{L5}}{\ifthenelse{\theantwortf=#1}{\jeroen@get{L6}}{\ifthenelse{\theantwortg=#1}{\jeroen@get{L7}}{\ifthenelse{\theantworth=#1}{\jeroen@get{L8}}{{\jeroen@get{L9}}}}}}}}}} &%
-%
-%
-%
-\ifnum\theAntworten=1%
-\ifthenelse{\jeroen@get{A1}=1 \OR \jeroen@get{A2}=1 \OR \jeroen@get{A3}=1\OR \jeroen@get{A4}=1\OR \jeroen@get{A5}=1\OR \jeroen@get{A6}=1 \OR \jeroen@get{A7}=1 \OR \jeroen@get{A8}=1 \OR \jeroen@get{A9}=1 \AND \theantworta=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}\ifthenelse{\jeroen@get{A1}=2 \OR \jeroen@get{A2}=2 \OR \jeroen@get{A3}=2\OR \jeroen@get{A4}=2\OR \jeroen@get{A5}=2\OR \jeroen@get{A6}=2 \OR \jeroen@get{A7}=2 \OR \jeroen@get{A8}=2 \OR \jeroen@get{A9}=2 \AND \theantwortb=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=3 \OR \jeroen@get{A2}=3 \OR \jeroen@get{A3}=3\OR \jeroen@get{A4}=3\OR \jeroen@get{A5}=3\OR \jeroen@get{A6}=3 \OR \jeroen@get{A7}=3 \OR \jeroen@get{A8}=3 \OR \jeroen@get{A9}=3 \AND \theantwortc=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}\ifthenelse{\jeroen@get{A1}=4 \OR \jeroen@get{A2}=4 \OR \jeroen@get{A3}=4\OR \jeroen@get{A4}=4\OR \jeroen@get{A5}=4\OR \jeroen@get{A6}=4 \OR \jeroen@get{A7}=4 \OR \jeroen@get{A8}=4 \OR \jeroen@get{A9}=4 \AND \theantwortd=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=5 \OR \jeroen@get{A2}=5 \OR \jeroen@get{A3}=5\OR \jeroen@get{A4}=5\OR \jeroen@get{A5}=5\OR \jeroen@get{A6}=5 \OR \jeroen@get{A7}=5 \OR \jeroen@get{A8}=5 \OR \jeroen@get{A9}=5 \AND \theantworte=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}\ifthenelse{\jeroen@get{A1}=6 \OR \jeroen@get{A2}=6 \OR \jeroen@get{A3}=6\OR \jeroen@get{A4}=6\OR \jeroen@get{A5}=6\OR \jeroen@get{A6}=6 \OR \jeroen@get{A7}=6 \OR \jeroen@get{A8}=6 \OR \jeroen@get{A9}=6 \AND \theantwortf=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=7 \OR \jeroen@get{A2}=7 \OR \jeroen@get{A3}=7\OR \jeroen@get{A4}=7\OR \jeroen@get{A5}=7\OR \jeroen@get{A6}=7 \OR \jeroen@get{A7}=7 \OR \jeroen@get{A8}=7 \OR \jeroen@get{A9}=7 \AND \theantwortg=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=8 \OR \jeroen@get{A2}=8 \OR \jeroen@get{A3}=8\OR \jeroen@get{A4}=8\OR \jeroen@get{A5}=8\OR \jeroen@get{A6}=8 \OR \jeroen@get{A7}=8 \OR \jeroen@get{A8}=8 \OR \jeroen@get{A9}=8 \AND \theantworth=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}\ifthenelse{\jeroen@get{A1}=9 \OR \jeroen@get{A2}=9 \OR \jeroen@get{A3}=9\OR \jeroen@get{A4}=9\OR \jeroen@get{A5}=9\OR \jeroen@get{A6}=9 \OR \jeroen@get{A7}=9 \OR \jeroen@get{A8}=9 \OR \jeroen@get{A9}=9 \AND \theantworti=#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
-\else%
-\Square\fi%
-&%
-%
+%%%%
+\ifthenelse{\theantworta=#1}{\jeroen@get{L1}}{%
+\ifthenelse{\theantwortb=#1}{\jeroen@get{L2}}{%
+\ifthenelse{\theantwortc=#1}{\jeroen@get{L3}}{%
+\ifthenelse{\theantwortd=#1}{\jeroen@get{L4}}{%
+\ifthenelse{\theantworte=#1}{\jeroen@get{L5}}{%
+\ifthenelse{\theantwortf=#1}{\jeroen@get{L6}}{%
+\ifthenelse{\theantwortg=#1}{\jeroen@get{L7}}{%
+\ifthenelse{\theantworth=#1}{\jeroen@get{L8}}{{%
+\jeroen@get{L9}}}}}}}}}}&%
+%%
+%%
+%%
+\ifthenelse{\theAntworten=1}{%
+\ifthenelse{%
+\jeroen@get{A1}=1\OR%
+\jeroen@get{A2}=1\OR%
+\jeroen@get{A3}=1\OR%
+\jeroen@get{A4}=1\OR%
+\jeroen@get{A5}=1\OR%
+\jeroen@get{A6}=1\OR%
+\jeroen@get{A7}=1\OR%
+\jeroen@get{A8}=1\OR%
+\jeroen@get{A9}=1\AND%
+\theantworta=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{acheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=2\OR%
+\jeroen@get{A2}=2\OR%
+\jeroen@get{A3}=2\OR%
+\jeroen@get{A4}=2\OR%
+\jeroen@get{A5}=2\OR%
+\jeroen@get{A6}=2\OR%
+\jeroen@get{A7}=2\OR%
+\jeroen@get{A8}=2\OR%
+\jeroen@get{A9}=2\AND%
+\theantwortb=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{bcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=3\OR%
+\jeroen@get{A2}=3\OR%
+\jeroen@get{A3}=3\OR%
+\jeroen@get{A4}=3\OR%
+\jeroen@get{A5}=3\OR%
+\jeroen@get{A6}=3\OR%
+\jeroen@get{A7}=3\OR%
+\jeroen@get{A8}=3\OR%
+\jeroen@get{A9}=3\AND%
+\theantwortc=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{ccheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=4\OR%
+\jeroen@get{A2}=4\OR%
+\jeroen@get{A3}=4\OR%
+\jeroen@get{A4}=4\OR%
+\jeroen@get{A5}=4\OR%
+\jeroen@get{A6}=4\OR%
+\jeroen@get{A7}=4\OR%
+\jeroen@get{A8}=4\OR%
+\jeroen@get{A9}=4\AND%
+\theantwortd=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{dcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=5\OR%
+\jeroen@get{A2}=5\OR%
+\jeroen@get{A3}=5\OR%
+\jeroen@get{A4}=5\OR%
+\jeroen@get{A5}=5\OR%
+\jeroen@get{A6}=5\OR%
+\jeroen@get{A7}=5\OR%
+\jeroen@get{A8}=5\OR%
+\jeroen@get{A9}=5\AND%
+\theantworte=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{echeck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=6\OR%
+\jeroen@get{A2}=6\OR%
+\jeroen@get{A3}=6\OR%
+\jeroen@get{A4}=6\OR%
+\jeroen@get{A5}=6\OR%
+\jeroen@get{A6}=6\OR%
+\jeroen@get{A7}=6\OR%
+\jeroen@get{A8}=6\OR%
+\jeroen@get{A9}=6\AND%
+\theantwortf=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{fcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=7\OR%
+\jeroen@get{A2}=7\OR%
+\jeroen@get{A3}=7\OR%
+\jeroen@get{A4}=7\OR%
+\jeroen@get{A5}=7\OR%
+\jeroen@get{A6}=7\OR%
+\jeroen@get{A7}=7\OR%
+\jeroen@get{A8}=7\OR%
+\jeroen@get{A9}=7\AND%
+\theantwortg=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{gcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=8\OR%
+\jeroen@get{A2}=8\OR%
+\jeroen@get{A3}=8\OR%
+\jeroen@get{A4}=8\OR%
+\jeroen@get{A5}=8\OR%
+\jeroen@get{A6}=8\OR%
+\jeroen@get{A7}=8\OR%
+\jeroen@get{A8}=8\OR%
+\jeroen@get{A9}=8\AND%
+\theantworth=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{hcheck}{1}}{}%
+\ifthenelse{%
+\jeroen@get{A1}=9\OR%
+\jeroen@get{A2}=9\OR%
+\jeroen@get{A3}=9\OR%
+\jeroen@get{A4}=9\OR%
+\jeroen@get{A5}=9\OR%
+\jeroen@get{A6}=9\OR%
+\jeroen@get{A7}=9\OR%
+\jeroen@get{A8}=9\OR%
+\jeroen@get{A9}=9\AND%
+\theantworti=#1}{%
+\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}\setcounter{icheck}{1}}{}%
+}{\Square}&%
+%%%
%%%% Spalte 'falsch' (letzte Zeile)
-%
-\ifnum\theAntworten=1%
+%%%
+\ifthenelse{\theAntworten=1}{%
\ifthenelse{\theantworta=#1 \AND \value{acheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantwortb=#1 \AND \value{bcheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantwortc=#1 \AND \value{ccheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
@@ -1055,8 +1526,7 @@ Complete the following sentence by putting a cross next to one of the given poss
\ifthenelse{\theantworth=#1 \AND \value{hcheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
\ifthenelse{\theantworti=#1 \AND \value{icheck}=0 \AND \value{counter}<#1}{\color[rgb]{1,0,0}\XBox\color[rgb]{0,0,0}}{\addtocounter{counter}{1}%
}}}}}}}}}%
-\else%
-\Square\fi\\ \hline
+}{\Square}\\ \hline
\end{tabu}\leer
\egroup}
diff --git a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.tex b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.tex
index 1c7d82e696..ad225837ed 100644
--- a/macros/latex/contrib/srdp-mathematik/srdp-mathematik.tex
+++ b/macros/latex/contrib/srdp-mathematik/srdp-mathematik.tex
@@ -55,7 +55,7 @@ hidelinks
\vfill
-\Huge The \textit{srdp-mathematik} package v1.10.2\\[1cm]
+\Huge The \textit{srdp-mathematik} package v1.10.3\\[1cm]
Documentation \\ [1cm]
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index 173be3799d..c431f70b1e 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,6 +1,4 @@
-## Babel 3.81
-
-**Development**
+## Babel 3.82
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -10,9 +8,9 @@ is a set of ini files for about 250 languages.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.81 are described in:
+Changes in version 3.82 are described in:
-https://latex3.github.io/babel/news/whats-new-in-babel-3.81.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.82.html
Apart from the manual, you can find information on some aspects of babel at:
@@ -48,14 +46,17 @@ respective authors.
### Summary of latest changes
```
-3.81 2022-10-04
- * Tibetan line breaking and justification (lines padded with
- trailing tshegs).
- * New option 'letters' for 'onchar'.
- * Conceal 'fontspec' warnings about unknown languages and
- scripts with \babelfont.
- * More updates to the CLDR 41: Burmese, Dutch, Kwasio, Malay,
- Marathi, Mazanderani, Nepali, Norwegian, Norwegian Nynorsk.
+3.82 2022-10-23
+ * Predefined transforms can be activated after the first
+ \babelprovide (lua).
+ * Tibetan for XeTeX.
+ * More updates to the CLDR 41: Albanian, Kinyarwanda, Maltese,
+ Odia, Ossetic, Pashto, Polish, Portuguese, Punjabi, Romanian,
+ Romansh, Russian, Sakha, Sinhala, Slovak, Slovenian, Somali.
+ * Fixes:
+ - \MakeXXXcase: a (hopefully) better hack for #189 (see
+ also #193).
+ - Thai (with xetex): #182 wasn’t quite fixed.
```
### Previous changes
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index 3d8eddc505..44ed19a8f2 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2022/10/04 v3.81 The Babel package]
+\ProvidesFile{babel.dtx}[2022/10/23 v3.82 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -1232,18 +1232,6 @@ are incompatibilities with other packages.
written to the log file.\footnote{You can use alternatively the
package \textsf{silence}.}
-\Describe{strings=}{\texttt{generic} $\string|$ \texttt{unicode}
-$\string|$ \texttt{encoded} $\string|$ \meta{label} $\string|$
-\meta{font encoding}} Selects the encoding of strings in languages
-supporting this feature. Predefined labels are |generic| (for
-traditional \TeX, LICR and ASCII strings), |unicode| (for engines like
-\xetex{} and \luatex) and |encoded| (for special cases requiring mixed
-encodings). Other allowed values are font encoding codes (|T1|, |T2A|,
-|LGR|, |L7X|...), but only in languages supporting them. Be aware with
-|encoded| captions are protected, but they work in |\MakeUppercase|
-and the like (this feature misuses some internal \LaTeX\ tools, so use
-it only as a last resort).
-
\Describe{hyphenmap=}{\texttt{off} $\string|$ \texttt{first}
$\string|$ \texttt{select} $\string|$ \texttt{other} $\string|$
\texttt{other*}}
@@ -2503,11 +2491,11 @@ If the language has been loaded as an argument in |\documentclass| or
Unicode engines load the UTF-8 variants, while 8-bit engines load the
LICR (ie, with macros like |\'| or |\ss|) ones.
-\New{3.23} It may be used without a value. In such a case, the |ini|
-file set in the corresponding |babel-<language>.tex| (where
-|<language>| is the last argument in |\babelprovide|) is imported. See
-the list of recognized languages above. So, the previous example can
-be written:
+\New{3.23} It may be used without a value, and that is often the
+recommended option. In such a case, the |ini| file set in the
+corresponding |babel-<language>.tex| (where |<language>| is the last
+argument in |\babelprovide|) is imported. See the list of recognized
+languages above. So, the previous example is best written as:
\begin{verbatim}
\babelprovide[_import_]{hungarian}
\end{verbatim}
@@ -2616,8 +2604,7 @@ it acts on characters, not on spaces). There are currently two
‘actions’, which can be used at the same time (separated by a space):
with |ids| the |\language| and the |\localeid| are set to the values of
this locale; with |fonts|, the fonts are changed to those of this
-locale (as set with |\babelfont|). This option is not compatible with
-|mapfont|. Characters can be added or modified with
+locale (as set with |\babelfont|). Characters can be added or modified with
|\babelcharproperty|.
\New{3.81} Option |letters| restricts the ‘actions’ to letters, in the
@@ -2665,16 +2652,6 @@ It’s still somewhat experimental. Again, there is an explanation in the
\Describe{linebreaking=}{}
\New{3.59} Just a synonymous for \texttt{justification}.
-\Describe{mapfont=}{\texttt{direction}}
-Assigns the font for the writing direction of this language (only with
-|bidi=basic|). Whenever possible, instead of this option use |onchar|,
-based on the script, which usually makes more sense. More precisely,
-what |mapfont=direction| means is, ‘when a character has the same
-direction as the script for the “provided” language, then change its
-font to that set for this language’. There are 3 directions, following
-the bidi Unicode algorithm, namely, Arabic-like, Hebrew-like and left
-to right. So, there should be at most 3 directives of this kind.
-
\begin{note}
(1) If you need shorthands, you can define them with |\useshorthands|
and |\defineshorthand| as described above. (2) Captions and |\today|
@@ -5176,8 +5153,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.81>>
-%<<date=2022/10/04>>
+%<<version=3.82>>
+%<<date=2022/10/23>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5202,6 +5179,10 @@ help from Bernd Raichle, for which I am grateful.
{\def#1{#2}}%
{\expandafter\def\expandafter#1\expandafter{#1#2}}}
\def\bbl@xin@{\@expandtwoargs\in@}
+\def\bbl@carg#1#2{\expandafter#1\csname#2\endcsname}%
+\def\bbl@ncarg#1#2#3{\expandafter#1\expandafter#2\csname#3\endcsname}%
+\def\bbl@ccarg#1#2#3{%
+ \expandafter#1\csname#2\expandafter\endcsname\csname#3\endcsname}%
\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
\def\bbl@cs#1{\csname bbl@#1\endcsname}
\def\bbl@cl#1{\csname bbl@#1@\languagename\endcsname}
@@ -5340,8 +5321,8 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@ifblank#1{%
\bbl@ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
\long\def\bbl@ifblank@i#1#2\@nil#3#4#5\@nil{#4}
-\def\bbl@ifset#1#2#3{%
- \bbl@ifunset{#1}{#3}{\bbl@exp{\\\bbl@ifblank{#1}}{#3}{#2}}}
+\def\bbl@ifset#1#2#3{%
+ \bbl@ifunset{#1}{#3}{\bbl@exp{\\\bbl@ifblank{\@nameuse{#1}}}{#3}{#2}}}
% \end{macrocode}
% \end{macro}
%
@@ -7054,7 +7035,7 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@redefine@long#1{%
\edef\bbl@tempa{\bbl@stripslash#1}%
\expandafter\let\csname org@\bbl@tempa\endcsname#1%
- \expandafter\long\expandafter\def\csname\bbl@tempa\endcsname}
+ \long\expandafter\def\csname\bbl@tempa\endcsname}
\@onlypreamble\bbl@redefine@long
% \end{macrocode}
%
@@ -7631,7 +7612,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@csarg\edef{normal@#2}{%
\noexpand\active@prefix\noexpand#1%
\expandafter\noexpand\csname normal@char#2\endcsname}%
- \expandafter\let\expandafter#1\csname bbl@normal@#2\endcsname
+ \bbl@ncarg\let#1{bbl@normal@#2}%
% \end{macrocode}
%
% The next level of the code checks whether a user has defined a
@@ -8018,10 +7999,8 @@ help from Bernd Raichle, for which I am grateful.
\@notshorthand{#2}%
\else
\initiate@active@char{#2}%
- \expandafter\let\csname active@char\string#2\expandafter\endcsname
- \csname active@char\string#1\endcsname
- \expandafter\let\csname normal@char\string#2\expandafter\endcsname
- \csname normal@char\string#1\endcsname
+ \bbl@ccarg\let{active@char\string#2}{active@char\string#1}%
+ \bbl@ccarg\let{normal@char\string#2}{normal@char\string#1}%
\bbl@activate{#2}%
\fi
\fi}%
@@ -8714,22 +8693,46 @@ help from Bernd Raichle, for which I am grateful.
% A temporary hack:
\ifx\BabelCaseHack\@undefined
\AtBeginDocument{%
- \bbl@exp{%
- \\\in@{\string\@uclclist}%
- {\expandafter\meaning\csname MakeUppercase \endcsname}}%
+ \bbl@xin@{\string\@uclclist}%
+ {\bbl@carg\meaning{MakeUppercase }}%
\ifin@\else
- \expandafter\let\expandafter\bbl@newuc\csname MakeUppercase \endcsname
+ \chardef\bbl@ulflag\z@
+ \bbl@ncarg\let\bbl@newuc{MakeUppercase }%
\protected\@namedef{MakeUppercase }#1{{%
- \def\reserved@a##1##2{\let##1##2\reserved@a}%
- \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
- \protected@edef\reserved@a{\bbl@newuc{#1}}\reserved@a}}%
- \expandafter\let\expandafter\bbl@newlc\csname MakeLowercase \endcsname
+ \chardef\bbl@ulflag\@ne
+ \ifx\bbl@uclc\@undefined
+ \bbl@newuc{#1}%
+ \else
+ \bbl@ifunset{\languagename @bbl@uclc}%
+ {\bbl@newuc{#1}}%
+ {\def\reserved@a##1##2{\let##1##2\reserved@a}%
+ \bbl@uclc\reserved@a\reserved@b{\reserved@b\@gobble}%
+ \protected@edef\reserved@a{\bbl@newuc{#1}}% Pre-expand
+ \reserved@a}%
+ \fi}}%
+ \bbl@ncarg\let\bbl@newlc{MakeLowercase }%
\protected\@namedef{MakeLowercase }#1{{%
- \def\reserved@a##1##2{\let##2##1\reserved@a}%
- \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
- \protected@edef\reserved@a{\bbl@newlc{#1}}\reserved@a}}%
+ \chardef\bbl@ulflag\tw@
+ \ifx\bbl@uclc\@undefined
+ \bbl@newlc{#1}%
+ \else
+ \bbl@ifunset{\languagename @bbl@uclc}%
+ {\bbl@newlc{#1}}%
+ {\def\reserved@a##1##2{\let##2##1\reserved@a}%
+ \bbl@uclc\reserved@a\reserved@b{\reserved@b\@gobble}%
+ \protected@edef\reserved@a{\bbl@newlc{#1}}% Pre-expand
+ \reserved@a}%
+ \fi}}%
+ \def\bbl@cased{%
+ \ifcase\bbl@ulflag
+ \expandafter\@firstofone
+ \or
+ \expandafter\MakeUppercase
+ \or
+ \expandafter\MakeLowercase
+ \fi}%
\fi}
-\fi
+\fi
% \end{macrocode}
%
% \begin{macrocode}
@@ -9012,12 +9015,9 @@ help from Bernd Raichle, for which I am grateful.
\newcommand\SetCase[3][]{%
\bbl@patchuclc
\bbl@forlang\bbl@tempa{%
- \expandafter\bbl@encstring
- \csname\bbl@tempa @bbl@uclc\endcsname{\bbl@tempa##1}%
- \expandafter\bbl@encstring
- \csname\bbl@tempa @bbl@uc\endcsname{##2}%
- \expandafter\bbl@encstring
- \csname\bbl@tempa @bbl@lc\endcsname{##3}}}%
+ \bbl@carg\bbl@encstring{\bbl@tempa @bbl@uclc}{\bbl@tempa##1}%
+ \bbl@carg\bbl@encstring{\bbl@tempa @bbl@uc}{##2}%
+ \bbl@carg\bbl@encstring{\bbl@tempa @bbl@lc}{##3}}}%
%<</Macros local to BabelCommands>>
% \end{macrocode}
%
@@ -9520,7 +9520,7 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\def\umlauthigh{%
\def\bbl@umlauta##1{\leavevmode\bgroup%
- \expandafter\accent\csname\f@encoding dqpos\endcsname
+ \accent\csname\f@encoding dqpos\endcsname
##1\bbl@allowhyphens\egroup}%
\let\bbl@umlaute\bbl@umlauta}
\def\umlautlow{%
@@ -9566,10 +9566,10 @@ help from Bernd Raichle, for which I am grateful.
\leavevmode\bgroup
\U@D 1ex%
{\setbox\z@\hbox{%
- \expandafter\char\csname\f@encoding dqpos\endcsname}%
+ \char\csname\f@encoding dqpos\endcsname}%
\dimen@ -.45ex\advance\dimen@\ht\z@
\ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
- \expandafter\accent\csname\f@encoding dqpos\endcsname
+ \accent\csname\f@encoding dqpos\endcsname
\fontdimen5\font\U@D #1%
\egroup}
% \end{macrocode}
@@ -9953,7 +9953,7 @@ help from Bernd Raichle, for which I am grateful.
\ifin@\else\bbl@xin@{/k}{/\bbl@cl{lnbrk}}\fi
\ifin@\bbl@arabicjust\fi
\bbl@xin@{/p}{/\bbl@cl{lnbrk}}%
- \ifin@\AtBeginDocument{\bbl@tibetanjust}\fi
+ \ifin@\AtBeginDocument{\@nameuse{bbl@tibetanjust}}\fi
% == Line breaking: hyphenate.other.(locale|script) ==
\ifx\bbl@lbkflag\@empty
\bbl@ifunset{bbl@hyotl@\languagename}{}%
@@ -10104,8 +10104,20 @@ help from Bernd Raichle, for which I am grateful.
{\bbl@pre@fs}%
{\bbl@post@fs}%
\fi
- % == Release saved transforms ==
- \bbl@release@transforms\relax % \relax closes the last item.
+ % == transforms ==
+ \ifodd\bbl@engine
+ \ifx\bbl@KVP@transforms\@nnil\else
+ \def\bbl@elt##1##2##3{%
+ \in@{$transforms.}{$##1}%
+ \ifin@
+ \def\bbl@tempa{##1}%
+ \bbl@replace\bbl@tempa{transforms.}{}%
+ \bbl@carg\bbl@transforms{babel\bbl@tempa}{##2}{##3}%
+ \fi}%
+ \csname bbl@inidata@\languagename\endcsname
+ \bbl@release@transforms\relax % \relax closes the last item.
+ \fi
+ \fi
% == main ==
\ifx\bbl@KVP@main\@nnil % Restore only if not 'main'
\let\languagename\bbl@savelangname
@@ -10911,44 +10923,40 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\let\bbl@release@transforms\@empty
-\@namedef{bbl@inikv@transforms.prehyphenation}{%
- \bbl@transforms\babelprehyphenation}
-\@namedef{bbl@inikv@transforms.posthyphenation}{%
- \bbl@transforms\babelposthyphenation}
+\bbl@csarg\let{inikv@transforms.prehyphenation}\bbl@inikv
+\bbl@csarg\let{inikv@transforms.posthyphenation}\bbl@inikv
\def\bbl@transforms@aux#1#2#3#4,#5\relax{%
#1[#2]{#3}{#4}{#5}}
\begingroup % A hack. TODO. Don't require an specific order
\catcode`\%=12
\catcode`\&=14
\gdef\bbl@transforms#1#2#3{&%
- \ifx\bbl@KVP@transforms\@nnil\else
- \directlua{
- local str = [==[#2]==]
- str = str:gsub('%.%d+%.%d+$', '')
- tex.print([[\def\string\babeltempa{]] .. str .. [[}]])
- }&%
- \bbl@xin@{,\babeltempa,}{,\bbl@KVP@transforms,}&%
+ \directlua{
+ local str = [==[#2]==]
+ str = str:gsub('%.%d+%.%d+$', '')
+ tex.print([[\def\string\babeltempa{]] .. str .. [[}]])
+ }&%
+ \bbl@xin@{,\babeltempa,}{,\bbl@KVP@transforms,}&%
+ \ifin@
+ \in@{.0$}{#2$}&%
\ifin@
- \in@{.0$}{#2$}&%
- \ifin@
- \directlua{
- local str = string.match([[\bbl@KVP@transforms]],
- '%(([^%(]-)%)[^%)]-\babeltempa')
- if str == nil then
- tex.print([[\def\string\babeltempb{}]])
- else
- tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]])
- end
- }
- \toks@{#3}&%
- \bbl@exp{&%
- \\\g@addto@macro\\\bbl@release@transforms{&%
- \relax &% Closes previous \bbl@transforms@aux
- \\\bbl@transforms@aux
- \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&%
- \else
- \g@addto@macro\bbl@release@transforms{, {#3}}&%
- \fi
+ \directlua{&% (\attribute) syntax
+ local str = string.match([[\bbl@KVP@transforms]],
+ '%(([^%(]-)%)[^%)]-\babeltempa')
+ if str == nil then
+ tex.print([[\def\string\babeltempb{}]])
+ else
+ tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]])
+ end
+ }
+ \toks@{#3}&%
+ \bbl@exp{&%
+ \\\g@addto@macro\\\bbl@release@transforms{&%
+ \relax &% Closes previous \bbl@transforms@aux
+ \\\bbl@transforms@aux
+ \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&%
+ \else
+ \g@addto@macro\bbl@release@transforms{, {#3}}&%
\fi
\fi}
\endgroup
@@ -10996,7 +11004,8 @@ help from Bernd Raichle, for which I am grateful.
in the current font, and therefore the hyphen\\%
will be printed. Try changing the fontspec's\\%
'HyphenChar' to another value, but be aware\\%
- this setting is not safe (see the manual)}%
+ this setting is not safe (see the manual).\\%
+ Reported}%
\hyphenchar\font\defaulthyphenchar
\fi\fi
\fi}%
@@ -12369,7 +12378,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\ifx\bbl@opt@main\@nnil\else
- \bbl@csarg\let{loadmain\expandafter}\csname ds@\bbl@opt@main\endcsname
+ \bbl@ncarg\let\bbl@loadmain{ds@\bbl@opt@main}%
\expandafter\let\csname ds@\bbl@opt@main\endcsname\relax
\fi
% \end{macrocode}
@@ -13246,7 +13255,7 @@ help from Bernd Raichle, for which I am grateful.
\<bbl@xeipn@\languagename>}%
\\\bbl@toglobal\<extras\languagename>%
\\\bbl@add\<noextras\languagename>{%
- \XeTeXlinebreaklocale "en"}%
+ \XeTeXlinebreaklocale ""}%
\\\bbl@toglobal\<noextras\languagename>}%
\ifx\bbl@ispacesize\@undefined
\gdef\bbl@ispacesize{\bbl@cl{xeisp}}%
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index a40cfd79f3..5128ec755d 100644
--- a/macros/latex/required/babel/base/babel.ins
+++ b/macros/latex/required/babel/base/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2022/10/04}
+\def\filedate{2022/10/23}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf
index c667f527ac..161bd23b21 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index 0bc850a585..2ad2e626b7 100644
--- a/macros/latex/required/babel/base/bbcompat.dtx
+++ b/macros/latex/required/babel/base/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/10/04 v3.81]
+\ProvidesFile{bbcompat.dtx}[2022/10/23 v3.82]
%</dtx>
%
%% File 'bbcompat.dtx'
diff --git a/macros/luatex/latex/piton/piton-french.pdf b/macros/luatex/latex/piton/piton-french.pdf
index fe034629ee..44eaa5fb0e 100644
--- a/macros/luatex/latex/piton/piton-french.pdf
+++ b/macros/luatex/latex/piton/piton-french.pdf
Binary files differ
diff --git a/macros/luatex/latex/piton/piton-french.tex b/macros/luatex/latex/piton/piton-french.tex
index 1b9854cb15..a5c5a1407f 100644
--- a/macros/luatex/latex/piton/piton-french.tex
+++ b/macros/luatex/latex/piton/piton-french.tex
@@ -1,9 +1,12 @@
% -*- coding: utf-8 ; -*-
\documentclass[dvipsnames]{article}
+
+\usepackage{fontspec}
+
\usepackage[french]{babel}
\frenchsetup{og = « , fg = »}
-\usepackage[escape-inside=$$]{piton}
+\usepackage[footnotehyper,escape-inside=$$]{piton}
\usepackage{xcolor}
@@ -17,13 +20,13 @@
\usepackage{booktabs}
\usepackage{caption}
-\captionsetup{labelfont = bf}
% We use \MakeShortVerb of shortvrb and not \DefineShortVerb of fancyvrb
% because we don't want the contents of short verbatim colored in gray
\usepackage{shortvrb}
\MakeShortVerb{\|}
+\usepackage{varwidth}
\skip\footins = 2\bigskipamount
@@ -39,8 +42,6 @@
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
-\usepackage{footnote}
-
\usepackage[hyperfootnotes = false]{hyperref}
\hypersetup
@@ -80,7 +81,7 @@ en utilisant la bibliothèque Lua LPEG. L'extension \pkg{piton} nécessite l'emp
\section{Présentation}
-L'extension \pkg{piton} utilise la librarie Lua nommée LPEG\footnote{LPEG est une librairie de capture de motifs
+L'extension \pkg{piton} utilise la librairie Lua nommée LPEG\footnote{LPEG est une librairie de capture de motifs
(\emph{pattern-matching} en anglais) pour Lua, écrite en C, fondée sur les PEG (\emph{parsing expression
grammars}): \url{http://www.inf.puc-rio.br/~roberto/lpeg/}} pour «parser» le code Python et le composer avec un
coloriage syntaxique. Comme elle utilise du code Lua, elle fonctionne uniquement avec |lualatex| (et ne va pas
@@ -96,21 +97,20 @@ Voici un exemple de code Python composé avec l'environnement |{Piton}| proposé
from math import pi
def arctan(x,n=10):
- """Compute the value of arctan(x)
- n is the number of terms if the sum"""
+ '''Compute the value of arctan(x)
+ n is the number of terms if the sum'''
if x < 0:
- return -arctan(-x) # recursive call
+ return -arctan(-x) # appel récursif
elif x > 1:
- return pi/2 - arctan(1/x)
- ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ pour $x>0$)\footnote{Cet échappement vers LaTeX a été obtenu en débutant par \ttfamily\#\#.}
- else
- s = 0
- for k in range(n):
- s += (-1)**k/(2*k+1)*x**(2*k+1)
- return s
+ return pi/2 - arctan(1/x)
+ ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\pi/2$ pour $x>0$)\footnote{Cet échappement vers LaTeX a été obtenu en débutant par \ttfamily\#\#.}
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
\end{Piton}
-
\bigskip
L'extension LaTeX \pkg{piton} est entièrement contenue dans le fichier |piton.sty|. Ce
@@ -120,8 +120,17 @@ d'installer \pkg{piton} avec une distribution TeX comme MiKTeX, TeX~Live ou MacT
\section{Utilisation de l'extension}
-Pour utiliser l'extension \pkg{piton}, l'utilisateur final a seulement à charger l'extension dans son document avec
-la commande classique |\usepackage| et se souvenir que la compilation doit être faite avec LuaLaTeX.
+L'extension \pkg{piton} se charge simplement avec la commande |\usepackage| : |\usepackage{piton}|.
+
+On a néanmoins deux remarques à formuler :
+\begin{itemize}
+\item l'extension \pkg{piton} utilise l'extension \pkg{xcolor} (néanmoins \pkg{piton} charge pas \pkg{xcolor} : si
+\pkg{xcolor} n'est pas chargée avant le |\begin{document}|, une erreur fatale sera levée) ;
+
+\item l'extension \pkg{piton} n'est utilisable qu'avec LuaLaTeX : si un autre moteur de compilation (comme |latex|,
+|pdflatex| ou |xelatex|) est utilisé, une erreur fatale sera levée.
+\end{itemize}
+
\medskip
L'extension \pkg{piton} fournit trois outils pour composer du code Python: la commande |\piton|, l'environnement
@@ -133,14 +142,17 @@ paragraphe. \emph{Attention} : Cette fonction prend son argument en mode \emph{v
\verb|\verb|) et, de ce fait, cette fonction ne peut pas être utilisée à l'intérieur d'un argument d'une autre
fonction (on peut néanmoins l'utiliser à l'intérieur d'un environnement).
-\item L'environnement |{Piton}| doit être utilisé pour composer des codes de plusieurs lignes.
+\item L'environnement |{Piton}| doit être utilisé pour composer des codes de plusieurs lignes. Pour les besoins de
+personnalisation, il est possible de définir de nouveaux environnements similaires à |{Piton}| en utilisant la
+commande |\NewPitonEnvironment| : cf. partie \ref{NewPitonEnvironment} p.~\pageref{NewPitonEnvironment}.
\item La commande |\PitonInputFile| doit être utilisée pour insérer et composer un fichier extérieur.
\end{itemize}
\bigskip
Il est possible de composer des commentaires en LaTeX en commençant par |##| (c'est un échappement vers LaTeX). Les
-caractères |##| eux-mêmes ne seront pas imprimés et les espaces qui les suivent sont supprimés.
+caractères |##| eux-mêmes ne seront pas imprimés et les espaces qui les suivent sont supprimés. Ces commentaires
+seront simplement appelés «commentaires LaTeX» dans ce document.
\section{Personnalisation}
@@ -148,7 +160,7 @@ caractères |##| eux-mêmes ne seront pas imprimés et les espaces qui les suive
\subsection{La commande \textbackslash PitonOptions}
La commande |\PitonOptions| prend en argument une liste de couples \textsl{clé=valeur}. La portée des réglages
-effectués par cette commande est le groupe TeX courant.
+effectués par cette commande est le groupe TeX courant.\footnote{On rappelle que tout environnement LaTeX est, en particulier, un groupe.}
\begin{itemize}
\item La clé |gobble| peut comme valeur un entier positif $n$ : les $n$ premiers caractères de chaque ligne sont
@@ -166,20 +178,23 @@ et dans les listings produits par la commande |\PitonInputFile|.
\item Avec la clé |all-line-numbers|, \emph{toutes} les lignes sont numérotées, y compris les lignes vides.
-\item \colorbox{yellow!50}{\textbf{Nouveau 0.7}}\enskip Avec la clé |resume|, le compteur de lignes n'est pas remis à
-zéro comme il l'est normalement au début d'un environnement |{Piton}| ou bien au début d'un listing produit par
-|\PitonInputFile|.
+\item Avec la clé |resume|, le compteur de lignes n'est pas remis à zéro comme il l'est normalement au début d'un
+environnement |{Piton}| ou bien au début d'un listing produit par |\PitonInputFile|.
-\item \colorbox{yellow!50}{\textbf{Nouveau 0.7}}\enskip La clé |splittable| autorise un saut de page
-dans les environnements |{Piton}| et les listings produits par |\PitonInputFile|.
+\item La clé |splittable| autorise un saut de page dans les environnements |{Piton}| et les listings produits par
+|\PitonInputFile|.
-\item \colorbox{yellow!50}{\textbf{Nouveau 0.7}}\enskip La clé |background-color| fixe la couleur de fond des
-environnements |{Piton}| et des listings produits par |\PitonInputFile| (ce fond a une largeur égale à la valeur
-courante de |\linewidth|). Même avec une couleur de fond, les sauts de page sont possibles, à partir du moment où
-la clé |splittable| est utilisée.\footnote{Un environnement |{Piton}| est sécable même dans un environnement de
- \pkg{tcolorbox}, à patir du moment où la clé |breakable| de \pkg{tcolorbox} est utilisée. On précise cela parce
- que, en revanche, un environnement de \pkg{tcolorbox} inclus dans un autre environnement de \pkg{tcolorbox} n'est
- pas sécable, même quand les deux utilisent la clé |breakable|.}
+\item La clé |background-color| fixe la couleur de fond des environnements |{Piton}| et des listings produits par
+|\PitonInputFile| (ce fond a une largeur égale à la valeur courante de |\linewidth|). Même avec une couleur de
+fond, les sauts de page sont possibles, à partir du moment où la clé |splittable| est utilisée.\footnote{Un
+ environnement |{Piton}| est sécable même dans un environnement de \pkg{tcolorbox}, à partir du moment où la clé
+ |breakable| de \pkg{tcolorbox} est utilisée. On précise cela parce que, en revanche, un environnement de
+ \pkg{tcolorbox} inclus dans un autre environnement de \pkg{tcolorbox} n'est pas sécable, même quand les deux
+ utilisent la clé |breakable|.}
+
+\item \colorbox{yellow!50}{\textbf{Nouveau 0.8}}\enskip La clé |left-margin| fixe une marge sur la gauche. Cette
+clé peut être utile, en particulier, en conjonction avec l'une des clés |line-numbers| et |all-line-numbers| si on
+ne souhaite pas que les numéros de ligne soient dans une position en débordement sur la gauche.
\end{itemize}
\bigskip
@@ -192,18 +207,18 @@ la clé |splittable| est utilisée.\footnote{Un environnement |{Piton}| est séc
from math import pi
def arctan(x,n=10):
- """Compute the value of arctan(x)
- n is the number of terms if the sum"""
+ '''Compute the value of arctan(x)
+ n is the number of terms if the sum'''
if x < 0:
- return -arctan(-x) # recursive call
+ return -arctan(-x) # appel récursif
elif x > 1:
- return pi/2 - arctan(1/x)
- ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ pour $x>0$)
- else
- s = 0
- for k in range(n):
- s += (-1)**k/(2*k+1)*x**(2*k+1)
- return s
+ return pi/2 - arctan(1/x)
+ ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\pi/2$ pour $x>0$)
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
\end{Piton}
\end{Verbatim}
\endgroup
@@ -214,18 +229,18 @@ la clé |splittable| est utilisée.\footnote{Un environnement |{Piton}| est séc
from math import pi
def arctan(x,n=10):
- """Compute the value of arctan(x)
- n is the number of terms if the sum"""
+ '''Compute the value of arctan(x)
+ n is the number of terms if the sum'''
if x < 0:
- return -arctan(-x) # recursive call
+ return -arctan(-x) # appel récursif
elif x > 1:
- return pi/2 - arctan(1/x)
- ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ pour $x>0$)
- else
- s = 0
- for k in range(n):
- s += (-1)**k/(2*k+1)*x**(2*k+1)
- return s
+ return pi/2 - arctan(1/x)
+ ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\pi/2$ pour $x>0$)
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
\end{Piton}
\endgroup
@@ -268,23 +283,25 @@ def fact(n):
\bigskip
\emph{Attention} : L'échappement vers LaTeX permis par les caractères de |escape-inside| n'est pas actif dans les
chaînes de caractères ni dans les commentaires (pour avoir un commentaire entièrement en échappement vers LaTeX,
-il suffit de le faire débuter par |##|).
+c'est-à-dire ce qui est
+appelé dans ce document «commentaire LateX», il suffit de le faire débuter par |##|).
\subsection{Les styles}
+\label{styles}
+
L'extension \pkg{piton} fournit la commande |\SetPitonStyle| pour personnaliser les différents styles utilisés pour
formater les éléments syntaxiques des listings Python. Ces personnalisations ont une portée qui correspond au
-groupe TeX courant.
+groupe TeX courant.\footnote{On rappelle que tout environnement LaTeX est, en particulier, un groupe.}
\bigskip
La commande |\SetPitonStyle| prend en argument une liste de couples \textsl{clé=valeur}. Les clés sont les noms des
styles et les valeurs sont les instructions LaTeX de formatage correspondantes.
\bigskip
-Ces instructions LaTeX doivent être des instructions de formatage du type de |\color{...}|, |\bseries|,
-|\slshape|, etc. (les commandes de ce type sont parfois qualifiées de \emph{semi-globales}). Il est aussi possible
-de mettre, \emph{à la fin de la liste d'instructions}, une commande LaTeX prenant exactement un
-argument.
+Ces instructions LaTeX doivent être des instructions de formatage du type de |\bfseries|, |\slshape|,
+|\color{...}|, etc. (les commandes de ce type sont parfois qualifiées de \emph{semi-globales}). Il est aussi
+possible de mettre, \emph{à la fin de la liste d'instructions}, une commande LaTeX prenant exactement un argument.
\bigskip
Voici un exemple qui change le style utilisé pour le nom d'une fonction Python, au moment de sa définition
@@ -296,7 +313,8 @@ Voici un exemple qui change le style utilisé pour le nom d'une fonction Python,
\end{Verbatim}
Dans cet exemple, |\colorbox{yellow!50}| doit être considéré comme le nom d'une fonction LaTeX qui prend exactement
-un argument, puisque, habituellement, elle est utilisée avec la syntaxe |\colorbox{yellow!50}{text}|.
+un argument, puisque, habituellement, elle est utilisée avec la syntaxe
+|\colorbox{yellow!50}{|\texttt{\slshape text}|}|.
\medskip
\begingroup
@@ -306,13 +324,15 @@ Avec ce réglage, on obtient : \piton{def cube(x) : return x * x * x }
\endgroup
-
-\medskip
-Les différents styles sont décrits dans la table \ref{Semantic}.
+\bigskip
+Les différents styles sont décrits dans la table \ref{Semantic}. Les réglages initiaux effectués par \pkg{piton}
+dans |piton.sty| sont inspirés par le style \pkg{manni} de Pygments.\footnote{Voir
+ \url{https://pygments.org/styles/}. À remarquer que, par défaut, Pygments propose pour le style \pkg{manni} un
+ fond coloré dont la couleur est la couleur HTML |#F0F3F3|.}
\begin{table}[htb]
\centering
-\caption{Usage des différents styles}
+\caption{Les styles proposés par \pkg{piton}}
\label{Semantic}
\begin{tabularx}{0.9\textwidth}{@{}>{\ttfamily}l>{\raggedright\arraybackslash}X@{}}
\toprule
@@ -335,8 +355,8 @@ Name.Namespace & le nom des modules (= bibliothèques extérieures) \\
Name.Class & le nom des classes au moment de leur définition \\
Exception & le nom des exceptions prédéfinies (eg: SyntaxError) \\
Comment & les commentaires commençant par \texttt{\#} \\
-Comment.LaTeX & les commentaires commençant par \texttt{\#\#} qui sont composés en LaTeX par \pkg{piton}
- (\texttt{\#\#} est une séquence d'échappement vers LaTeX) \\
+Comment.LaTeX & les commentaires commençant par \texttt{\#\#} qui sont composés en LaTeX par \pkg{piton} (et
+ appelés simplement «commentaires LaTeX» dans ce document) \\
Keyword.Constant & |True|, |False| et |None| \\
Keyword & les mots-clés suivants :
\ttfamily assert, break, case, continue, del,
@@ -352,9 +372,11 @@ Keyword & les mots-clés suivants :
\subsection{Définition de nouveaux environnements}
+\label{NewPitonEnvironment}
+
Comme l'environnement |{Piton}| a besoin d'absorber son contenu d'une manière spéciale (à peu près comme du texte
verbatim), il n'est pas possible de définir de nouveaux environnements directement au-dessus de l'environnement
-|{Piton}|.
+|{Piton}| avec les commandes classiques |\newenvironment| et |\NewDocumentEnvironment|.
C'est pourquoi \pkg{piton} propose une commande |\NewPitonEnvironment|. Cette commande a la même syntaxe que la
commande classique |\NewDocumentEnvironment|.
@@ -363,7 +385,14 @@ commande classique |\NewDocumentEnvironment|.
Par exemple, avec l'instruction suivante, un nouvel environnement |{Python}| sera défini avec le même comportement
que l'environnement |{Piton}|:
-\verb|\NewPitonEnvironment{Python}{}{}{}|
+{\color{gray}\verb|\NewPitonEnvironment{Python}{}{}{}|}
+
+
+\bigskip
+Si on souhaite un environnement |{Python}| qui prenne en argument optionnel entre crochets les clés de
+|\PitonOptions|, on peut écrire :
+
+{\color{gray}\verb|\NewPitonEnvironment{Python}{O{}}{\PitonOptions{#1}}{}|}
\bigskip
Si on souhaite un environnement |{Python}| qui compose le code inclus dans une boîte de \pkg{tcolorbox}, on peut
@@ -376,4 +405,382 @@ Si on souhaite un environnement |{Python}| qui compose le code inclus dans une b
\end{verbatim}
+\section{Fonctionnalités avancées}
+
+\bigskip
+\subsection{Notes de pied de page dans les environnements de piton}
+
+\label{footnote}
+
+Si vous voulez mettre des notes de pied de page dans un environnement de \pkg{piton} (ou bien dans un listing
+produit par |\PitonInputFile|, bien que cela paraisse moins pertinent dans ce cas-là) vous pouvez utiliser une
+paire |\footnotemark|--|\footnotetext|.
+
+\smallskip
+Il est aussi possible d'extraire les notes de pieds de page avec l'extension \pkg{footnote} ou bien l'extension
+\pkg{footnotehyper}.
+
+\smallskip
+Si \pkg{piton} est chargée avec l'option |footnote| (avec |\usepackage[footnote]{piton}|) l'extension
+\pkg{footnote} est chargée (si elle ne l'est pas déjà) et elle est utilisée pour extraire les notes de pied de
+page.
+
+\smallskip
+Si \pkg{piton} est chargée avec l'option |footnotehyper|, l'extension \pkg{footnotehyper} est chargée (si
+elle ne l'est pas déjà) et elle est utilisée pour extraire les notes de pied de page.
+
+\smallskip
+Attention : Les extensions \pkg{footnote} et \pkg{footnotehyper} sont incompatibles.
+L'extension \pkg{footnotehyper} est le successeur de l'extension \pkg{footnote}
+et devrait être utilisée préférentiellement. L'extension \pkg{footnote} a quelques défauts ;
+en particulier, elle doit être chargée après l'extension \pkg{xcolor} et elle n'est pas parfaitement
+compatible avec \pkg{hyperref}.
+
+\medskip
+Dans ce document, l'extension \pkg{piton} a été chargée avec l'option |footnotehyper| et c'est pourquoi des notes
+peuvent être mises dans les environnements |{Piton}|: cf. première page de ce document.
+
+
+
+\section{Exemples}
+
+\PitonOptions{splittable}
+
+
+\subsection{Numérotation des lignes}
+
+Par défaut, les numéros de ligne sont composés par \pkg{piton} en débordement à gauche (en utilisant en interne la commande |\llap| de LaTeX).
+
+Si on ne veut pas de débordement, il faut réserver une place à gauche pour les numéros de lignes avec la clé |left-margin|.
+
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+~emphase&\PitonOptions{background-color=gray!10, left-margin = 5mm, line-numbers}@
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## (appel récursif)
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## (autre appel récursif)
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{Verbatim}
+\endgroup
+
+
+
+\begingroup
+\PitonOptions{background-color=gray!10,left-margin = 5mm, line-numbers}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## (appel récursif)
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## (autre appel récursif)
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\endgroup
+
+
+
+
+\subsection{Formatage des commentaires LaTeX}
+
+
+On peut modifier le style |Comment.LaTeX| (avec |\SetPitonStyle|) pour faire afficher les commentaires
+LaTeX (qui débutent par |##|) en butée à droite.
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+\PitonOptions{background-color=gray!10}
+~emphase&\SetPitonStyle{Comment.LaTeX = \hfill \normalfont\color{gray}}@
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## appel récursif
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## autre appel récursif
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{Verbatim}
+\endgroup
+
+\begingroup
+\PitonOptions{background-color=gray!10}
+\SetPitonStyle{Comment.LaTeX = \hfill \normalfont\color{gray}}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## appel récursif
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## autre appel récursif
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\endgroup
+
+
+\vspace{1cm}
+On peut aussi faire afficher les commentaires dans une deuxième colonne à droite si on limite la largeur du code
+proprement dit avec un environnement |{minipage}| de LaTeX.
+
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+\PitonOptions{background-color=gray!10}
+~emphase&\NewDocumentCommand{\MyLaTeXCommand}{m}{\hfill \normalfont\itshape\rlap{\quad #1}}@
+~emphase&\SetPitonStyle{Comment.LaTeX = \MyLaTeXCommand}@
+~emphase&\begin{minipage}{12cm}@
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## appel récursif
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## autre appel récursif
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
+\end{Piton}
+~emphase&\end{minipage}@
+\end{Verbatim}
+\endgroup
+
+
+
+\begingroup
+\PitonOptions{background-color=gray!10}
+\NewDocumentCommand{\MyLaTeXCommand}{m}{\hfill \normalfont\itshape\rlap{\quad #1}}
+\SetPitonStyle{Comment.LaTeX = \MyLaTeXCommand}
+\begin{minipage}{12cm}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x) ## appel récursif
+ elif x > 1:
+ return pi/2 - arctan(1/x) ## autre appel récursif
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
+\end{Piton}
+\end{minipage}
+\endgroup
+
+
+
+\subsection{Notes dans les listings}
+
+Pour pouvoir extraire les notes (introduites par |\footnote|), l'extension |piton| doit être chargée, soit avec la
+clé |footnote|, soit avec la clé |footnotehyper|, comme expliqué à la section \ref{footnote} p.~\pageref{footnote}.
+Dans le présent document, l'extension \pkg{piton} a été chargée par la clé |footnotehyper|.
+
+Bien entendu, une commande |\footnote| ne peut apparaître que dans un commentaire LaTeX (qui débute par |##|). Un
+tel commentaire peut se limiter à cette unique commande |\footnote|, comme dans l'exemple suivant.
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+\PitonOptions{background-color=gray!10}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)~emphase&##\footnote{Un premier appel récursif.}]@
+ elif x > 1:
+ return pi/2 - arctan(1/x)~emphase&##\footnote{Un deuxième appel récursif.}@
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{Verbatim}
+\endgroup
+
+\begingroup
+\PitonOptions{background-color=gray!10}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)##\footnote{Un premier appel récursif.}
+ elif x > 1:
+ return pi/2 - arctan(1/x)##\footnote{Un deuxième appel récursif.}
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\endgroup
+
+
+\vspace{1cm}
+
+Si on utilise l'environnement |{Piton}| dans un environnement |{minipage}| de LaTeX, les notes sont, bien entendu,
+composées au bas de l'environnement |{minipage}|. Rappelons qu'une telle |{minipage}| ne peut être coupée par un
+saut de page.
+
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+\PitonOptions{background-color=gray!10}
+\emphase\begin{minipage}{\linewidth}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)~emphase&##\footnote{Un premier appel récursif.}@
+ elif x > 1:
+ return pi/2 - arctan(1/x)~emphase&##\footnote{Un deuxième appel récursif.}@
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{minipage}
+\end{Verbatim}
+\endgroup
+
+\begingroup
+\PitonOptions{background-color=gray!10}
+\begin{minipage}{\linewidth}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)##\footnote{Un premier appel récursif.}
+ elif x > 1:
+ return pi/2 - arctan(1/x)##\footnote{Un deuxième appel récursif.}
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{minipage}
+\endgroup
+
+
+\vspace{1cm}
+Si on encapsule l'environnement |{Piton}| dans un environnement |{minipage}| pour, typiquement, limiter la largeur
+d'un fond coloré, il faut encadrer l'ensemble dans un environnement |{savenotes}| (de \pkg{footnote} ou
+\pkg{footnotehyper}) si on veut avoir les notes reportées en pied de page.
+
+\begingroup
+\fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+\begin{Verbatim}
+\PitonOptions{background-color=gray!10}
+~emphase&\begin{savenotes}@
+\begin{minipage}{13cm}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)~emphase&##\footnote{Un premier appel récursif.}@
+ elif x > 1:
+ return pi/2 - arctan(1/x)~emphase&##\footnote{Un deuxième appel récursif.}@
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{minipage}
+~emphase&\end{savenotes}@
+\end{Verbatim}
+\endgroup
+
+
+
+\begin{savenotes}
+\PitonOptions{background-color=gray!10}
+\begin{minipage}{13cm}
+\begin{Piton}
+def arctan(x,n=10):
+ if x < 0:
+ return -arctan(-x)##\footnote{Un premier appel récursif.}
+ elif x > 1:
+ return pi/2 - arctan(1/x)##\footnote{Un deuxième appel récursif.}
+ else:
+ return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+\end{Piton}
+\end{minipage}
+\end{savenotes}
+
+\subsection{Un exemple de réglage des styles}
+
+Les styles graphiques ont été présentés à la partie \ref{styles}, p.~\pageref{styles}.
+
+\smallskip
+On présente ici un réglage de ces styles adapté pour les documents en noir et blanc. On l'utilise avec la fonte
+\emph{DejaVu Sans Mono}\footnote{Voir: \url{https://dejavu-fonts.github.io}} spécifiée avec la commande
+ |\setmonofont| de \pkg{fontspec}.
+
+
+\begin{Verbatim}
+\setmonofont[Scale=0.85]{DejaVu Sans Mono}
+
+\SetPitonStyle
+ {
+ Number = ,
+ String = \itshape ,
+ String.Doc = \color{gray} \itshape ,
+ Operator = ,
+ Operator.Word = \bfseries ,
+ Name.Builtin = ,
+ Name.Function = \bfseries \colorbox{gray!20} ,
+ Comment = \color{gray} ,
+ Comment.LaTeX = \color{gray},
+ Keyword = \bfseries ,
+ Name.Namespace = ,
+ Name.Class = ,
+ Name.Type = ,
+ InitialValues = \color{gray}
+ }
+\end{Verbatim}
+
+
+
+\setmonofont[Scale=0.85]{DejaVu Sans Mono}
+
+\SetPitonStyle
+ {
+ Number = ,
+ String = \itshape ,
+ String.Doc = \color{gray} \itshape ,
+ Operator = ,
+ Operator.Word = \bfseries ,
+ Name.Builtin = ,
+ Name.Function = \bfseries \colorbox{gray!20} ,
+ Comment = \color{gray} ,
+ Comment.LaTeX = \color{gray},
+ Keyword = \bfseries ,
+ Name.Namespace = ,
+ Name.Class = ,
+ Name.Type = ,
+ InitialValues = \color{gray}
+ }
+
+
+\bigskip
+
+\begin{Piton}
+from math import pi
+
+def arctan(x,n=10):
+ '''Compute the value of arctan(x)
+ n is the number of terms if the sum'''
+ if x < 0:
+ return -arctan(-x) # appel récursif
+ elif x > 1:
+ return pi/2 - arctan(1/x)
+ ## (on a utilisé le fait que $\arctan(x)+\arctan(1/x)=\pi/2$ pour $x>0$)
+ else:
+ s = 0
+ for k in range(n):
+ s += (-1)**k/(2*k+1)*x**(2*k+1)
+ return s
+\end{Piton}
+
+
+
+\section*{Autre documentation}
+
+Le document |piton.pdf| (fourni avec l'extension \pkg{piton}) contient une traduction anglaise de la
+documentation ici présente, ainsi que le code source commenté et un historique des versions.
+
+
\end{document} \ No newline at end of file
diff --git a/macros/luatex/latex/piton/piton.dtx b/macros/luatex/latex/piton/piton.dtx
index 4aeabac72b..7d7a94fa1d 100644
--- a/macros/luatex/latex/piton/piton.dtx
+++ b/macros/luatex/latex/piton/piton.dtx
@@ -1,5 +1,4 @@
-% \iffalse -*- coding: utf-8 ; -*- \fi
-% \iffalse meta-comment
+% \iffalse -*- coding: utf-8 ; -*- \fi \iffalse meta-comment
%
% Copyright (C) 2022 by F. Pantigny
% -----------------------------------
@@ -16,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{0.7}
-\def\myfiledate{2022/10/08}
+\def\myfileversion{0.8}
+\def\myfiledate{2022/10/23}
%
%
%<*batchfile>
@@ -57,38 +56,13 @@ version 2005/12/01 or later.
\fvset{commandchars=\~\#\@,formatcom=\color{gray}}
\captionsetup{labelfont = bf}
\usepackage{ragged2e}
-\usepackage[escape-inside=$$]{piton} % $$
+\usepackage[footnotehyper,escape-inside=$$]{piton} % $$
\def\interitem{\vskip 7mm plus 2 mm minus 3mm}
\parindent 0pt
\skip\footins = 2\bigskipamount
-\begin{filecontents}[noheader,overwrite]{example1.txt}
-from math import pi
-
-def arctan(x,n=10):
- """Compute the value of arctan(x)
- n is the number of terms if the sum"""
- if x < 0:
- return -arctan(-x) # recursive call
- elif x > 1:
- return pi/2 - arctan(1/x)
- ## (we have used that $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ for $x>0$)\footnote{This LaTeX escape has been done by beginning the comment by \ttfamily\#\#.}
- else
- s = 0
- for k in range(n):
- s += (-1)**k/(2*k+1)*x**(2*k+1)
- return s
-\end{filecontents}
-
-\begin{filecontents}[noheader,overwrite]{example2.txt}
-def fact(n):
- if n==0:
- return 1
- else:
- $\colorbox{yellow!50}{$return n*fact(n-1)$}$
-\end{filecontents}
-
+\PitonOptions{gobble=2}
\EnableCrossrefs
@@ -126,8 +100,25 @@ def fact(n):
% Here is an exemple of code typeset by \pkg{piton}, with the environment |{Piton}|.
%
% \bigskip
-% \PitonInputFile{Example1.txt}
%
+% \begin{Piton}
+% from math import pi
+%
+% def arctan(x,n=10):
+% '''Compute the value of arctan(x)
+% n is the number of terms of the sum'''
+% if x < 0:
+% return -arctan(-x) # recursive call
+% elif x > 1:
+% return pi/2 - arctan(1/x)
+% ## (we have used that $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ for $x>0$)\footnote{This LaTeX escape has been done by beginning the comment by \ttfamily\#\#.}
+% else:
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
+% \end{Piton}
+%
%
% \bigskip
%
@@ -139,10 +130,20 @@ def fact(n):
%
% \section{Use of the package}
%
-% In order to use the package \pkg{piton}, one has only to load the package in
-% its document with the standard command |\usepackage| and remember that the
-% compilation must be done with |lualatex| (and no other LaTeX engine).
+% The package \pkg{piton} should be loaded with the classical command
+% |\usepackage|: |\usepackage{piton}|.
%
+% \smallskip
+% Nevertheless, we have two remarks:
+% \begin{itemize}
+% \item the package \pkg{piton} uses the package \pkg{xcolor} (but \pkg{piton}
+% does \emph{not} load \pkg{xcolor}: if \pkg{xcolor} is not loaded before the
+% |\begin{document}|, a fatal error will be raised).
+% \item the package \pkg{piton} must be used with LuaLaTeX exclusively: if
+% another LaTeX engine (|latex|, |pdflatex|, |xelatex|,\dots ) is used, a
+% fatal error will be raised.
+% \end{itemize}
+%
% \medskip
% The package \pkg{piton} provides three tools to typeset Python code: the
% command |\piton|, the environment |{Piton}| and the command |\PitonInputFile|.
@@ -153,15 +154,18 @@ def fact(n):
% \emph{verbatim}. Therefore, it cannot be used in the argument of another
% command (however, it can be used within an environment).
% \item The environment |{Piton}| should be used to typeset multi-lines code.
-%
+% For sake of customization, it's possible to define new environments similar to
+% the environment |{Piton}| with the command |\NewPitonEnvironment|:
+% cf.~\ref{NewPitonEnvironment} p.~\pageref{NewPitonEnvironment}.
% \item The command |\PitonInputFile| is used to insert and typeset a whole
-% external file.
+% external file.
% \end{itemize}
%
% \bigskip
-% It's possible to compose comments in LaTeX by beginning with |##| (it's a
+% It's possible to compose comments in LaTeX by beginning them with |##| (it's a
% ``LaTeX escape''). The characters |##| themselves won't be printed and the
-% spaces after |##| are removed.
+% spaces after |##| are removed. These comments will be called ``LaTeX
+% comments'' in this document.
%
% \section{Customization}
%
@@ -169,7 +173,8 @@ def fact(n):
%
% The command |\PitonOptions| takes in as argument a comma-separated list of
% \textsl{key=value} pairs. The scope of the settings done by that command is
-% the current TeX group.
+% the current TeX group.\footnote{We remind that an LaTeX environment is, in
+% particular, a TeX group.}
%
% \begin{itemize}
% \item The key |gobble| takes in as value a positive integer~$n$: the first $n$
@@ -194,23 +199,27 @@ def fact(n):
% \item With the key |all-line-numbers|, \emph{all} the lines are numbered,
% including the empty ones.
%
-% \item \colorbox{yellow!50}{\textbf{New 0.7}}\enskip By default, the counter of
-% lines is set to zero at the beginning of each environment |{Piton}| or use of
-% |\PitonInputFile|. With the key |resume|, that reinitialisation is not done.
+% \item By default, the counter of lines is set to zero at the beginning of each
+% environment |{Piton}| or use of |\PitonInputFile|. With the key |resume|, that
+% reinitialisation is not done.
%
-% \item \colorbox{yellow!50}{\textbf{New 0.7}}\enskip The key |splittable| allows
-% pages breaks within the environments |{Piton}| and the listings produced by
+% \item The key |splittable| allows pages breaks within the environments
+% |{Piton}| and the listings produced by
% |\PitonInputFile|.
%
-% \item \colorbox{yellow!50}{\textbf{New 0.7}}\enskip The key |background-color|
-% sets the background color of the environments |{Piton}| and the listings
-% produced by |\PitonInputFile| (that background has a width of |\linewidth|).
-% Even with a background color, the pages breaks are allowed, as soon as the key
-% |splittable| is in force.\footnote{The environments \texttt{\{Piton\}} are breakable,
-% even whithin a breakable environment of \pkg{tcolorbox}. Remind that an
-% environment of \pkg{tcolorbox} included in another environment of
-% \pkg{tcolorbox} is \emph{not} breakable, even when both environments use the
-% key |breakable| of \pkg{tcolorbox}.}
+% \item The key |background-color| sets the background color of the environments
+% |{Piton}| and the listings produced by |\PitonInputFile| (that background has
+% a width of |\linewidth|). Even with a background color, the pages breaks are
+% allowed, as soon as the key |splittable| is in force.\footnote{The
+% environments \texttt{\{Piton\}} are breakable, even within a breakable
+% environment of \pkg{tcolorbox}. Remind that an environment of \pkg{tcolorbox}
+% included in another environment of \pkg{tcolorbox} is \emph{not} breakable,
+% even when both environments use the key |breakable| of \pkg{tcolorbox}.}
+%
+% \item \colorbox{yellow!50}{\textbf{New 0.8}}\enskip The key |left-margin|
+% corresponds to a margin on the left. That key may be useful in conjonction
+% with the key |line-numbers| or the key |line-all-numbers| if one does not want
+% the numbers in an overlapping position on the left.
% \end{itemize}
%
% \bigskip
@@ -223,26 +232,41 @@ def fact(n):
% from math import pi
%
% def arctan(x,n=10):
-% """Compute the value of arctan(x)
-% n is the number of terms if the sum"""
+% '''Compute the value of arctan(x)
+% n is the number of terms of the sum'''
% if x < 0:
-% return -arctan(-x) # recursive call
+% return -arctan(-x) # recursive call
% elif x > 1:
-% return pi/2 - arctan(1/x)
-% ## (we have used that $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ pour $x>0$)
+% return pi/2 - arctan(1/x)
+% ## (we have used that $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ pour $x>0$)
% else
-% s = 0
-% for k in range(n):
-% s += (-1)**k/(2*k+1)*x**(2*k+1)
-% return s
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
% \end{Piton}
% \end{Verbatim}
% \endgroup
%
-%
% \begingroup
-% \PitonOptions{line-numbers,auto-gobble,background-color = gray!15}
-% \PitonInputFile{Example1.txt}
+% \PitonOptions{line-numbers,background-color = gray!15}
+% \begin{Piton}
+% from math import pi
+%
+% def arctan(x,n=10):
+% '''Compute the value of arctan(x)
+% n is the number of terms of the sum'''
+% if x < 0:
+% return -arctan(-x) # recursive call
+% elif x > 1:
+% return pi/2 - arctan(1/x)
+% ## (we have used that $\arctan(x)+\arctan(1/x)=\frac{\pi}{2}$ for $x>0$)
+% else
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
+% \end{Piton}
% \endgroup
%
% \subsection{The key escape-inside}
@@ -251,7 +275,7 @@ def fact(n):
% (that is to say in the instruction |\usepackage|). For technical reasons, it
% can't be used in the command |\PitonOptions|. That option takes in as value
% two characters which will be used to delimit pieces of code which will
-% thrown directly to LaTeX (and composed by LaTeX).e
+% thrown directly to LaTeX (and composed by LaTeX).
%
% \medskip
% In the following example, we assume that the extension \pkg{piton} has been
@@ -275,21 +299,31 @@ def fact(n):
% \end{Piton}
% \end{Verbatim}
%
-% \PitonInputFile{Example2.txt}
-%
+% \begin{Piton}
+% def fact(n):
+% if n==0:
+% return 1
+% else:
+% $\colorbox{yellow!50}{$return n*fact(n-1)$}$
+% \end{Piton}
+%
% \bigskip
%
% \emph{Caution} : The escape to LaTeX allowed by the characters of
% |escape-inside| is not active in the strings nor in the Python comments
% (however, it's possible to have a whole Python comment composed in LaTeX by
-% beginning it with |##|).
+% beginning it with |##|; such comments are merely called ``LaTeX comments'' in
+% this document).
%
%
% \subsection{The styles}
%
+% \label{styles}
+%
% The package \pkg{piton} provides the command |\SetPitonStyle| to customize the
% different styles used to format the syntactic elements of the Python listings.
-% The customizations done by that command are limited to the current TeX group.
+% The customizations done by that command are limited to the current TeX
+% group.\footnote{We remind that an LaTeX environment is, in particuilar, a TeX group.}
%
% \bigskip
% The command |\SetPitonStyle| takes in as argument a comma-separated list of
@@ -323,8 +357,12 @@ def fact(n):
% With that setting, we will have : \piton{def cube(x) : return x * x * x }
% \endgroup
%
-% \medskip
-% The different styles are described in the table \ref{Semantic}.
+% \bigskip
+% The different styles are described in the table \ref{Semantic}. The initial
+% settings done by \pkg{piton} in |piton.sty| are inspired by the style
+% \pkg{manni} de Pygments.\footnote{See: \url{https://pygments.org/styles/}.
+% Remark that, by default, Pygments provides for its style \pkg{manni} a colored
+% background whose color is the HTML color \texttt{\#F0F3F3}.}
%
%
%
@@ -355,8 +393,8 @@ def fact(n):
% Name.Class & the name of the classes at the point of their definition \\
% Exception & the names of the exceptions (eg: \texttt{SyntaxError}) \\
% Comment & the comments beginning with \verb|#| \\
-% LaTeX & the comments beginning by \verb|##| which are composed in LaTeX by
-% \pkg{piton} (\verb|##| is an espace sequence to LaTeX) \\
+% Comment.LaTeX & the comments beginning by \verb|##| which are composed in LaTeX by
+% \pkg{piton} (and called merely ``LaTeX comments'' in this document) \\
% Keyword.Constant & |True|, |False| and |None| \\
% Keyword & the following keywords :
% \ttfamily assert, break, case, continue, del,
@@ -373,9 +411,12 @@ def fact(n):
%
% \subsection{Creation of new environments}
%
+% \label{NewPitonEnvironment}
+%
% Since the environment |{Piton}| has to catch its body in a special way (more
% or less as verbatim text), it's not possible to construct new environments
-% directly over the environment |{Piton}|
+% directly over the environment |{Piton}| with the classical commands
+% |\newenvironment| or |\NewDocumentEnvironment|.
%
% That's why \pkg{piton} provides a command |\NewPitonEnvironment|. That
% command takes in three mandatory arguments.
@@ -387,7 +428,14 @@ def fact(n):
% With the following instruction, a new environment |{Python}| will be
% constructed with the same behaviour as |{Piton}|:
%
-% \verb|\NewPitonEnvironment{Python}{}{}{}|
+% {\color{gray}\verb|\NewPitonEnvironment{Python}{}{}{}|}
+%
+% \bigskip
+% If one wishes an environment |{Python}| with takes in as optional argument
+% (between square brackets) the keys of the command |\PitonOptions|, it's
+% possible to program as follows:
+%
+% {\color{gray}\verb|\NewPitonEnvironment{Python}{O{}}{\PitonOptions{#1}}{}|}
%
% \bigskip
% If one wishes to format Python code in a box of \pkg{tcolorbox}, it's possible
@@ -400,6 +448,397 @@ def fact(n):
% \end{verbatim}
%
%
+% \section{Advanced features}
+%
+% \subsection{Footnotes in the environments of piton}
+%
+% \label{footnote}
+% If you want to put footnotes in an environment |{Piton}| or
+% (or, more unlikely, in a listing produced by |\PitonInputFile|), you can use a
+% pair |\footnotemark|--|\footnotetext|.
+%
+% \smallskip
+% It's also possible to extract the footnotes with the help of the package
+% \pkg{footnote} or the package \pkg{footnotehyper}.
+%
+% \smallskip
+% If \pkg{piton} is loaded with the option |footnote| (with
+% |\usepackage[footnote]{piton}| or with |\PassOptionsToPackage|), the
+% package \pkg{footnote} is loaded (if it is not yet loaded) and it is used to
+% extract the footnotes.
+%
+% \smallskip
+% If \pkg{piton} is loaded with the option |footnotehyper|, the package
+% \pkg{footnotehyper} is loaded (if it is not yet loaded) ant it is used to
+% extract footnotes.
+%
+% \smallskip
+% Caution: The packages \pkg{footnote} and \pkg{footnotehyper} are incompatible.
+% The package \pkg{footnotehyper} is the successor of the package \pkg{footnote}
+% and should be used preferently. The package \pkg{footnote} has some drawbacks,
+% in particular: it must be loaded after the package \pkg{xcolor} and it is not
+% perfectly compatible with \pkg{hyperref}.
+%
+% \medskip
+% In this document, the package \pkg{piton} has been loaded with the option
+% |footnotehyper|: see the first page of this document for an example of a
+% footnote in an environment |{Piton}|.
+%
+%
+% \section{Examples}
+%
+%
+% \subsection{Line numbering}
+%
+% By default, the numbers of the lines are composed by \pkg{piton} in an
+% overlapping position on the left (by using internally the command |\llap| of LaTeX).
+%
+% In order to avoid that overlapping, it's necessary to reserve a place for the
+% number of the lines with the key |left-margin|.
+%
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% ~emphase&\PitonOptions{background-color=gray!10, left-margin = 5mm, line-numbers}@
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## (appel récursif)
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## (autre appel récursif)
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{Verbatim}
+% \endgroup
+%
+%
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10,left-margin = 5mm, line-numbers}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## (appel récursif)
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## (autre appel récursif)
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \endgroup
+%
+%
+%
+%
+% \subsection{Formatting of the LaTeX comments}
+%
+% It's possible to modify the style |Comment.LaTeX| (with |\SetPitonStyle|) in
+% order to display the LaTeX comments (which begin with |##|) aligned on the
+% right margin.
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% ~emphase&\SetPitonStyle{Comment.LaTeX = \hfill \normalfont\color{gray}}@
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## appel récursif
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## autre appel récursif
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{Verbatim}
+% \endgroup
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \SetPitonStyle{Comment.LaTeX = \hfill \normalfont\color{gray}}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## appel récursif
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## autre appel récursif
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \endgroup
+%
+%
+% \vspace{1cm}
+% It's also possible to display these LaTeX comments in a kind of second column
+% by limiting the width of the Python code by an environment |{minipage}| of LaTeX.
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% ~emphase&\NewDocumentCommand{\MyLaTeXCommand}{m}{\hfill \normalfont\itshape\rlap{\quad #1}}@
+% ~emphase&\SetPitonStyle{Comment.LaTeX = \MyLaTeXCommand}@
+% ~emphase&\begin{minipage}{12cm}@
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## appel récursif
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## autre appel récursif
+% else:
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
+% \end{Piton}
+% ~emphase&\end{minipage}@
+% \end{Verbatim}
+% \endgroup
+%
+%
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \NewDocumentCommand{\MyLaTeXCommand}{m}{\hfill \normalfont\itshape\rlap{\quad #1}}
+% \SetPitonStyle{Comment.LaTeX = \MyLaTeXCommand}
+% \begin{minipage}{12cm}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x) ## appel récursif
+% elif x > 1:
+% return pi/2 - arctan(1/x) ## autre appel récursif
+% else:
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
+% \end{Piton}
+% \end{minipage}
+% \endgroup
+%
+%
+%
+% \subsection{Notes in the listings}
+%
+% In order to be able to extract the notes (which are typeset with the command
+% |\footnote|, the extension \pkg{piton} must be loaded with the key |footnote|
+% or the key |footenotehyper| as explained in the section \ref{footnote}
+% p.~\pageref{footnote}. In this document, the extension \pkg{piton} has been
+% loaded with the key |footnotehyper|.
+%
+% Of course, in an environment |{Piton}|, a command |\footnote| may appear only
+% within a LaTeX comment (which begins with |##|). It's possible to have comments
+% which contain only that command |\footnote|. That's the case in the following example.
+%
+%
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)~emphase&##\footnote{First recursive call.}]@
+% elif x > 1:
+% return pi/2 - arctan(1/x)~emphase&##\footnote{Second recursive call.}@
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{Verbatim}
+% \endgroup
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)##\footnote{First recursive call.}
+% elif x > 1:
+% return pi/2 - arctan(1/x)##\footnote{Second recursive call.}
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \endgroup
+%
+%
+% \vspace{1cm}
+%
+% If an environment |{Piton}| is used in an environment |{minipage}| of LaTeX,
+% the notes are composed, of course, at the foot of the environment
+% |{minipage}|. Recall that such |{minipage}| can't be broken by a page break.
+
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% \emphase\begin{minipage}{\linewidth}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)~emphase&##\footnote{First recursive call.}@
+% elif x > 1:
+% return pi/2 - arctan(1/x)~emphase&##\footnote{Second recursive call.}@
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% \end{Verbatim}
+% \endgroup
+%
+% \begingroup
+% \PitonOptions{background-color=gray!10}
+% \begin{minipage}{\linewidth}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)##\footnote{First recursive call.}
+% elif x > 1:
+% return pi/2 - arctan(1/x)##\footnote{Second recursive call.}
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% \endgroup
+%
+%
+% \vspace{1cm}
+% If one embed an environment |{Piton}| in an environment |{minipage}|
+% (typically in order to limit the width of a colored background), it's
+% necessary to embed the whole environment |{minipage}| in an environment
+% |{savenotes}| (of \pkg{footnote} or \pkg{footnotehyper}) in order to have the
+% footnotes composed at the bottom of the page.
+%
+% \begingroup
+% \fvset{commandchars=\~\&\@,formatcom=\small\color{gray}}
+% \begin{Verbatim}
+% \PitonOptions{background-color=gray!10}
+% ~emphase&\begin{savenotes}@
+% \begin{minipage}{13cm}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)~emphase&##\footnote{First recursive call.}@
+% elif x > 1:
+% return pi/2 - arctan(1/x)~emphase&##\footnote{Second recursive call.}@
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% ~emphase&\end{savenotes}@
+% \end{Verbatim}
+% \endgroup
+%
+%
+%
+% \begin{savenotes}
+% \PitonOptions{background-color=gray!10}
+% \begin{minipage}{13cm}
+% \begin{Piton}
+% def arctan(x,n=10):
+% if x < 0:
+% return -arctan(-x)##\footnote{First recursive call.}
+% elif x > 1:
+% return pi/2 - arctan(1/x)##\footnote{Second recursive call.}
+% else:
+% return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) )
+% \end{Piton}
+% \end{minipage}
+% \end{savenotes}
+%
+%
+% \subsection{An example of tuning of the styles}
+%
+% The graphical styles have been presented in the section \ref{styles},
+% p.~\pageref{styles}.
+%
+% \smallskip
+% We present now an example of tuning of these styles adapted to the documents
+% in black and white. We use the font \emph{DejaVu Sans Mono}\footnote{See:
+% \url{https://dejavu-fonts.github.io}} specified by the command |\setmonofont| of
+% \pkg{fontspec}.
+%
+%
+% \begin{Verbatim}
+% \setmonofont[Scale=0.85]{DejaVu Sans Mono}
+%
+% \SetPitonStyle
+% {
+% Number = ,
+% String = \itshape ,
+% String.Doc = \color{gray} \slshape ,
+% Operator = ,
+% Operator.Word = \bfseries ,
+% Name.Builtin = ,
+% Name.Function = \bfseries \colorbox{gray!20} ,
+% Comment = \color{gray} ,
+% Comment.LaTeX = \color{gray},
+% Keyword = \bfseries ,
+% Name.Namespace = ,
+% Name.Class = ,
+% Name.Type = ,
+% InitialValues = \color{gray}
+% }
+% \end{Verbatim}
+%
+%
+% \begingroup
+%
+% \setmonofont[Scale=0.85]{DejaVu Sans Mono}
+%
+% \PitonOptions{splittable}
+%
+% \SetPitonStyle
+% {
+% Number = ,
+% String = \itshape ,
+% String.Doc = \color{gray} \slshape ,
+% Operator = ,
+% Operator.Word = \bfseries ,
+% Name.Builtin = ,
+% Name.Function = \bfseries \colorbox{gray!20} ,
+% Comment = \color{gray} ,
+% Comment.LaTeX = \color{gray} ,
+% Keyword = \bfseries ,
+% Name.Namespace = ,
+% Name.Class = ,
+% Name.Type = ,
+% InitialValues = \color{gray}
+% }
+%
+%
+% \bigskip
+%
+% \begin{Piton}
+% from math import pi
+%
+% def arctan(x,n=10):
+% '''Compute the value of arctan(x)
+% n is the number of terms if the sum'''
+% if x < 0:
+% return -arctan(-x) # appel récursif
+% elif x > 1:
+% return pi/2 - arctan(1/x)
+% ## (we have used that $\arctan(x)+\arctan(1/x)=\pi/2$ for $x>0$)
+% else:
+% s = 0
+% for k in range(n):
+% s += (-1)**k/(2*k+1)*x**(2*k+1)
+% return s
+% \end{Piton}
+%
+% \endgroup
+%
+%
+% \bigskip
+% The previous example has been composed while the key |splittable| (of
+% |\PitonOptions|) is in force. That's why a page break may have occurred.
% \clearpage
%
% \section{Implementation}
@@ -427,10 +866,27 @@ def fact(n):
% \end{macrocode}
%
% \bigskip
+% The boolean |\c_@@_footnotehyper_bool| will indicate if the option
+% |footnotehyper| is used.
+% \begin{macrocode}
+\bool_new:N \c_@@_footnotehyper_bool
+% \end{macrocode}
+%
+% \medskip
+% The boolean |\c_@@_footnote_bool| will indicate if the option |footnote| is
+% used, but quicky, it will also be set to |true| if the option |footnotehyper|
+% is used.
+% \begin{macrocode}
+\bool_new:N \c_@@_footnote_bool
+% \end{macrocode}
+%
+% \bigskip
% We define a set of keys for the options at load-time.
% \begin{macrocode}
\keys_define:nn { piton / package }
{
+ footnote .bool_set:N = \c_@@_footnote_bool ,
+ footnotehyper .bool_set:N = \c_@@_footnotehyper_bool ,
escape-inside .tl_set:N = \c_@@_escape_inside_tl ,
escape-inside .initial:n = ,
unknown .code:n = \msg_error:nn { piton } { unknown~key~for~package }
@@ -441,9 +897,9 @@ def fact(n):
\msg_new:nnn { piton } { unknown~key~for~package }
{
Unknown~key.\\
- You~have~used~the~key~'\l_keys_key_str'~but~the~only~key~available~here~
- is~the~key~'escape-inside'.~Other~keys~are~available~in~\token_to_str:N
- \PitonOptions.\\
+ You~have~used~the~key~'\l_keys_key_str'~but~the~only~keys~available~here~
+ are~'escape-inside',~'footnote'~and~'footnotehyper'.~Other~keys~are~
+ available~in~\token_to_str:N \PitonOptions.\\
That~key~will~be~ignored.
}
% \end{macrocode}
@@ -490,10 +946,79 @@ def fact(n):
% \end{macrocode}
%
%
+% \begin{macrocode}
+\msg_new:nnn { piton } { footnote~with~footnotehyper~package }
+ {
+ Footnote~forbidden.\\
+ You~can't~use~the~option~'footnote'~because~the~package~
+ footnotehyper~has~already~been~loaded.~
+ If~you~want,~you~can~use~the~option~'footnotehyper'~and~the~footnotes~
+ within~the~environments~of~piton~will~be~extracted~with~the~tools~
+ of~the~package~footnotehyper.\\
+ If~you~go~on,~the~package~footnote~won't~be~loaded.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\msg_new:nnn { piton } { footnotehyper~with~footnote~package }
+ {
+ You~can't~use~the~option~'footnotehyper'~because~the~package~
+ footnote~has~already~been~loaded.~
+ If~you~want,~you~can~use~the~option~'footnote'~and~the~footnotes~
+ within~the~environments~of~piton~will~be~extracted~with~the~tools~
+ of~the~package~footnote.\\
+ If~you~go~on,~the~package~footnotehyper~won't~be~loaded.
+ }
+% \end{macrocode}
+%
+% \medskip
+% \begin{macrocode}
+\bool_if:NT \c_@@_footnote_bool
+ {
+% \end{macrocode}
+% The class \cls{beamer} has its own system to extract footnotes and that's why
+% we have nothing to do if \cls{beamer} is used.
+% \begin{macrocode}
+ \@ifclassloaded { beamer }
+ { \bool_set_false:N \c_@@_footnote_bool }
+ {
+ \@ifpackageloaded { footnotehyper }
+ { \@@_error:n { footnote~with~footnotehyper~package } }
+ { \usepackage { footnote } }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\bool_if:NT \c_@@_footnotehyper_bool
+ {
+% \end{macrocode}
+% The class \cls{beamer} has its own system to extract footnotes and that's why
+% we have nothing to do if \cls{beamer} is used.
+% \begin{macrocode}
+ \@ifclassloaded { beamer }
+ { \bool_set_false:N \c_@@_footnote_bool }
+ {
+ \@ifpackageloaded { footnote }
+ { \@@_error:n { footnotehyper~with~footnote~package } }
+ { \usepackage { footnotehyper } }
+ \bool_set_true:N \c_@@_footnote_bool
+ }
+ }
+% \end{macrocode}
+% The flag |\c_@@_footnote_bool| is raised and so, we will only have to test
+% |\c_@@_footnote_bool| in order to know if we have to insert an environment
+% |{savenotes}|.
%
% \medskip
% \subsection{Parameters}
%
+% The following token list will contains the (potential) informations to write
+% on the |aux| (to be used in the next compilation).
+% \begin{macrocode}
+\tl_new:N \g_@@_aux_tl
+% \end{macrocode}
+%
% \medskip
% The following flag corresponds to the key |splittable| of |\PitonOptions|.
% \begin{macrocode}
@@ -501,11 +1026,41 @@ def fact(n):
% \end{macrocode}
%
% \medskip
-% The following string corresponds to the key |background-color|.
+% The following string corresponds to the key |background-color| of |\PitonOptions|.
% \begin{macrocode}
\str_new:N \l_@@_background_color_str
% \end{macrocode}
+%
+% \medskip
+% We will compute the maximal width of the lines of an environment |{Piton}| in
+% |\l_@@_width_dim|.
+% \begin{macrocode}
+\dim_new:N \l_@@_width_dim
+% \end{macrocode}
+% The value of that dimension as written on the |aux| file will be stored in
+% |\l_@@_width_on_aux_dim|.
+% \begin{macrocode}
+\dim_new:N \l_@@_width_on_aux_dim
+% \end{macrocode}
+%
+% \medskip
+% We will count the environments |{Piton}| (and, in fact, also the commands
+% |\PitonInputFile|, despite the name |\g_@@_env_int|).
+% \begin{macrocode}
+\int_new:N \g_@@_env_int
+% \end{macrocode}
%
+% \medskip
+% The following boolean corresponds to the key |slim| of |\PitonOptions|.
+% \begin{macrocode}
+\bool_new:N \l_@@_slim_bool
+% \end{macrocode}
+%
+% \medskip
+% The following dimension corresponds to the key |left-margin| of |\PitonOptions|.
+% \begin{macrocode}
+\dim_new:N \l_@@_left_margin_dim
+% \end{macrocode}
%
% \subsection{The gobbling mechanism}
%
@@ -531,14 +1086,24 @@ def fact(n):
% \begin{macrocode}
\cs_set_protected:Npn \@@_begin_line: #1 \@@_end_line:
{
+ \bool_lazy_and:nnT \l_@@_splittable_bool \c_@@_footnote_bool
+ { \begin { savenotes } }
% \end{macrocode}
-% Be careful: the following |\hbox_set:Nn| et |\hbox_set_to_wd:Nnn| take in an
-% argument by curryfication.
+%
+% Be careful: there is curryfication in the following lines.
% \begin{macrocode}
- \str_if_empty:NTF \l_@@_background_color_str
+ \bool_if:NTF \l_@@_slim_bool
{ \hbox_set:Nn \l_tmpa_box }
- { \hbox_set_to_wd:Nnn \l_tmpa_box \linewidth }
{
+ \str_if_empty:NTF \l_@@_background_color_str
+ { \hbox_set_to_wd:Nnn \l_tmpa_box \linewidth }
+ {
+ \hbox_set_to_wd:Nnn \l_tmpa_box
+ { \dim_eval:n { \linewidth - 0.5 em } }
+ }
+ }
+ {
+ \skip_horizontal:N \l_@@_left_margin_dim
\bool_if:NT \l_@@_line_numbers_bool
{
\bool_if:NF \l_@@_all_line_numbers_bool
@@ -547,26 +1112,35 @@ def fact(n):
}
\strut
\str_if_empty:NF \l_@@_background_color_str \space
- #1 \hfill
+ #1 \hfil
}
- \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + 1 pt }
- \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + 1.5 pt }
+% \end{macrocode}
+% We compute in |\l_@@_width_dim| the maximal width of the lines of the
+% environments.
+% \begin{macrocode}
+ \dim_compare:nNnT { \box_wd:N \l_tmpa_box } > \l_@@_width_dim
+ { \dim_set:Nn \l_@@_width_dim { \box_wd:N \l_tmpa_box } }
+ \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + 1.25 pt }
+ \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + 1.25 pt }
\tl_if_empty:NTF \l_@@_background_color_str
{ \box_use_drop:N \l_tmpa_box }
{
\vbox_top:n
{
- \hbox_to_wd:nn \linewidth
+ \hbox:n
{
\exp_args:NV \color \l_@@_background_color_str
\vrule height \box_ht:N \l_tmpa_box
depth \box_dp:N \l_tmpa_box
- width \linewidth
+ width \l_@@_width_on_aux_dim
}
\skip_vertical:n { - \box_ht_plus_dp:N \l_tmpa_box }
- \box_use_drop:N \l_tmpa_box
+ \box_set_wd:Nn \l_tmpa_box \l_@@_width_on_aux_dim
+ \box_use_drop:N \l_tmpa_box
}
}
+ \bool_lazy_and:nnT \l_@@_splittable_bool \c_@@_footnote_bool
+ { \end { savenotes } }
\vspace { - 2.5 pt }
}
% \end{macrocode}
@@ -610,10 +1184,14 @@ def fact(n):
all-line-numbers .value_forbidden:n = true ,
resume .bool_set:N = \l_@@_resume_bool ,
resume .value_forbidden:n = true ,
- splittable .bool_set:N = \l_@@_splittable_bool ,
- splittable .default:n = true ,
+ splittable .bool_set:N = \l_@@_splittable_bool ,
+ splittable .default:n = true ,
background-color .str_set:N = \l_@@_background_color_str ,
background-color .value_required:n = true ,
+ slim .bool_set:N = \l_@@_slim_bool ,
+ slim .default:n = true ,
+ left-margin .dim_set:N = \l_@@_left_margin_dim ,
+ left-margin .value_required:n = true ,
unknown .code:n =
\msg_error:nn { piton } { Unknown~key~for~PitonOptions }
}
@@ -626,7 +1204,7 @@ def fact(n):
Unknown~key. \\
The~key~'\l_keys_key_str'~is~unknown~for~\token_to_str:N \PitonOptions.~The~
available~keys~are:~all-line-numbers,~auto-gobble,~env-gobble,~gobble,~
- line-numbers,~resume~and~splittable.\\
+ left-margin,~line-numbers,~resume,~slim~and~splittable.\\
If~you~go~on,~that~key~will~be~ignored.
}
% \end{macrocode}
@@ -655,12 +1233,49 @@ def fact(n):
\hbox_overlap_left:n
{
{ \color { gray } \footnotesize \int_to_arabic:n \g_@@_line_int }
- \quad
+ \skip_horizontal:n { 0.4 em }
}
}
% \end{macrocode}
%
%
+% \medskip
+% \subsection{The command to write on the aux file}
+%
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_write_aux:
+ {
+ \tl_if_empty:NF \g_@@_aux_tl
+ {
+ \iow_now:Nn \@mainaux { \ExplSyntaxOn }
+ \iow_now:Nx \@mainaux
+ {
+ \tl_gset:cn { c_@@_ \int_use:N \g_@@_env_int _ tl }
+ { \exp_not:V \g_@@_aux_tl }
+ }
+ \iow_now:Nn \@mainaux { \ExplSyntaxOff }
+ }
+ \tl_gclear:N \g_@@_aux_tl
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_width_to_aux:
+ {
+ \bool_if:NT \l_@@_slim_bool
+ {
+ \str_if_empty:NF \l_@@_background_color_str
+ {
+ \tl_gput_right:Nx \g_@@_aux_tl
+ {
+ \dim_set:Nn \l_@@_width_on_aux_dim
+ { \dim_use:N \l_@@_width_dim + 0.5 em }
+ }
+ }
+ }
+ }
+% \end{macrocode}
%
% \medskip
% \subsection{The main commands and environments for the final user}
@@ -695,12 +1310,24 @@ def fact(n):
% \begin{macrocode}
\NewDocumentCommand { \PitonInputFile } { m }
{
+ \int_gincr:N \g_@@_env_int
+ \tl_gclear:N \g_@@_aux_tl
+ \tl_if_exist:cT { c_@@ _ \int_use:N \g_@@_env_int _ tl }
+ { \use:c { c_@@ _ \int_use:N \g_@@_env_int _ tl } }
+ \bool_if:NF \l_@@_splittable_bool
+ { \bool_if:NT \c_@@_footnote_bool { \begin { savenotes } } }
+ \dim_compare:nNnT \l_@@_width_on_aux_dim = \c_zero_dim
+ { \dim_set_eq:NN \l_@@_width_on_aux_dim \linewidth }
\bool_if:NF \l_@@_resume_bool { \int_gzero:N \g_@@_line_int }
\group_begin:
\dim_set_eq:NN \parindent \c_zero_dim
\ttfamily
\lua_now:e { ParseFile(token.scan_argument()) } { #1 }
+ \@@_width_to_aux:
\group_end:
+ \@@_write_aux:
+ \bool_if:NF \l_@@_splittable_bool
+ { \bool_if:NT \c_@@_footnote_bool { \end { savenotes } } }
}
% \end{macrocode}
%
@@ -708,7 +1335,8 @@ def fact(n):
% \bigskip
% \begin{macrocode}
\NewDocumentCommand { \NewPitonEnvironment } { m m m m }
- {
+ {
+ \dim_zero:N \parindent
% \end{macrocode}
% We construct a TeX macro which will catch as argument all the tokens until
% |\end{|\texttt{\textsl{name_env}}|}| with, in that
@@ -725,8 +1353,17 @@ def fact(n):
}
{
\group_end:
- \mode_if_vertical:TF \mode_leave_vertical: \newline
- \bool_if:NF \l_@@_splittable_bool \vbox_top:n
+ \mode_if_vertical:TF
+ { \mode_leave_vertical: }
+ \newline
+% \end{macrocode}
+% Be careful: there is curryfication in the following code.
+% \begin{macrocode}
+ \bool_if:NF \l_@@_splittable_bool
+ {
+ \bool_if:NT \c_@@_footnote_bool { \begin { savenotes } }
+ \vbox_top:n
+ }
{
\ttfamily
\dim_zero:N \lineskip
@@ -748,12 +1385,16 @@ def fact(n):
}
{ ##1 }
\vspace { 2.5 pt }
+ \@@_width_to_aux:
}
+ \bool_if:NF \l_@@_splittable_bool
+ { \bool_if:NT \c_@@_footnote_bool { \end { savenotes } } }
% \end{macrocode}
% The following |\end{#1}| is only for the groups and the stack of
% environments of LaTeX.
% \begin{macrocode}
\end { #1 }
+ \@@_write_aux:
}
% \end{macrocode}
%
@@ -766,6 +1407,12 @@ def fact(n):
\NewDocumentEnvironment { #1 } { #2 }
{
#3
+ \int_gincr:N \g_@@_env_int
+ \tl_gclear:N \g_@@_aux_tl
+ \tl_if_exist:cT { c_@@ _ \int_use:N \g_@@_env_int _ tl }
+ { \use:c { c_@@ _ \int_use:N \g_@@_env_int _ tl } }
+ \dim_compare:nNnT \l_@@_width_on_aux_dim = \c_zero_dim
+ { \dim_set_eq:NN \l_@@_width_on_aux_dim \linewidth }
\bool_if:NF \l_@@_resume_bool { \int_gzero:N \g_@@_line_int }
\group_begin:
\box_clear:N \l_tmpa_box
@@ -999,7 +1646,10 @@ lpeg.locale(lpeg) -- mandatory
local alpha , digit , space , punct = lpeg.alpha , lpeg.digit , lpeg.space , lpeg.punct
-local letter = alpha + S"âàçéèêëïîôûüÂÀÇÉÈÊËÏÎÔÛÜ_"
+-- Remember that à, â, ç, etc. are strings of length 2 (2 bytes)
+local letter = alpha + P "_"
+ + P "â" + P "à" + P "ç" + P "é" + P "è" + P "ê" + P "ë" + P "ï" + P "î" + P "ô" + P "û" + P "ü" +
+ P "Â" + P "À" + P "Ç" + P "É" + P "È" + P "Ê" + P "Ë" + P "Ï" + P "Î" + P "Ô" + P "Û" + P "Ü"
local alphanum = letter + digit
@@ -1310,7 +1960,6 @@ local Set = C ( P "{" )
* ItemOfSet * ( C ( P "," ) * ItemOfSet ) ^ 0
* C ( P "}" )
-
local Operator = K ( P "!=" + P "==" + P "<<" + P ">>" + S "-~+/*%=<>&.@|" , 'Operator')
local OperatorWord = K ( P "in" + P "is" + P "and" + P "or" + P "not" , 'Operator.Word')
@@ -1450,8 +2099,14 @@ end
% New keys |resume|, |splittable| and |background-color| in |\PitonOptions|.
%
% The file |piton.lua| has been embedded in the file |piton.sty|. That means
-% that the extension \pkg{piton} is now enterily contained in the file |piton.sty|.
+% that the extension \pkg{piton} is now entirely contained in the file |piton.sty|.
+%
+% \subsection*{Changes between versions 0.7 and 0.8}
%
+% New keys |footnote| and |footnotehyper| at load-time.
+%
+% New key |left-margin|.
+%
% \end{document}
%
%
diff --git a/macros/luatex/latex/piton/piton.pdf b/macros/luatex/latex/piton/piton.pdf
index 13e8b7f729..f13c17881b 100644
--- a/macros/luatex/latex/piton/piton.pdf
+++ b/macros/luatex/latex/piton/piton.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.dtx b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
index ced6a7f27e..b3da068451 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.dtx
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.dtx
@@ -20,8 +20,9 @@
% This work consists of the files njuthesis.dtx,
% and the derived files njuthesis.ins,
% njuthesis.cls,
-% njuthesis-undergraduate.def,
% njuthesis-graduate.def,
+% njuthesis-postdoctoral.def,
+% njuthesis-undergraduate.def,
% njuthesis.pdf,
% and README.md.
%
@@ -61,7 +62,7 @@ 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
+ http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.
@@ -118,7 +119,7 @@ To produce the documentation run the original source files ending with
%<*!(driver|install)>
% ^^A 诚耀百廿,雄创一流
% ^^A 南京大学一百二十周年华诞邀您共襄盛举!
-%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.0.0 2022-08-08 14:50:00
+%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.1.0 2022-10-23 12:30:00
%<+!driver> +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
@@ -134,15 +135,17 @@ To produce the documentation run the original source files ending with
%<*driver>
\ProvidesFile{njuthesis.dtx}
\documentclass[fontset=fandol]{ctxdoc}
-\usepackage{listings,njuvisual,tabularray,unicode-math,zhlineskip}
+\usepackage{listings,njuvisual,tabularray,unicode-math,xeCJKfntef,zhlineskip}
\usepackage[firstpage=true]{background}
\backgroundsetup{
contents={\njuemblem[white!85!gray]{22cm}{!}},
scale=1, angle=0, hshift=-4cm
}
\definecolor{olgreen}{HTML}{138a07}
+\renewcommand\emph[1]{\CJKunderdot[textformat=\itshape]{#1}}
\newcommand\olbutton[1]{\textcolor{olgreen}{\bfseries #1}}
\newcommand\tikzlogo{Ti\emph{k}Z}
+\newcommand\OPT[1]{\textcolor{njuyellow}{\bfseries#1}}
\hypersetup{
pdftitle = {
The njuthesis class -
@@ -216,7 +219,8 @@ To produce the documentation run the original source files ending with
alsoletter = {*, -, .},
texcsstyle = *\color{njuviolet},
emphstyle = [1]\color{nju-ai-orange},
- emphstyle = [2]\color{nju-cs-green}
+ emphstyle = [2]\color{nju-cs-green},
+ emphstyle = [3]\bfseries\color{njuyellow}
}
\lstnewenvironment{shellexample}[1][]{%
\lstset{style=style@shell, #1}}{}
@@ -351,7 +355,7 @@ To produce the documentation run the original source files ending with
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}
% {git+nju-lug-email-3104-issue-@yaoge123.cn}}}
%
-% \date{v1.0.0 \quad 2022-08-08}
+% \date{v1.1.0 \quad 2022-10-23}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
@@ -389,17 +393,17 @@ To produce the documentation run the original source files ending with
% \maketitle
%
% \begin{abstract}
-% 南京大学学位论文 \LaTeX 模板 \cls{njuthesis} 基于本科生院的论文撰写
-% 规范制作,同时参考研究生院提供的硕士、博士学位材料包,用于生成符合南京大学学
-% 位论文排版要求和相应的国家规范、行业标准的学位论文,旨在为同学提供毕业论文书
-% 写的方便。
+% \cls{njuthesis} 是制作南京大学本科生毕业论文、研究生学位论文、博士后出站报告的
+% \LaTeX 文档类。本模板基于本科生院的论文撰写规范制作,同时参考研究生院提供的硕士、
+% 博士学位材料包,用于生成符合南京大学排版要求和相应的国家规范、行业标准的学位论
+% 文,力求通过 \LaTeX3 语法实现清晰的实现逻辑、较高的可定制性以及友好的用户接口。
% \end{abstract}
%
% \def\abstractname{Abstract}
% \begin{abstract}
% The \cls{njuthesis} class is intended for typesetting Nanjing University
% dissertations with \LaTeX, providing support for bachelor, master,
-% and doctoral thesis.
+% doctoral theses as well as postdoctoral reports.
% \end{abstract}
%
% \vspace{2cm}
@@ -652,6 +656,7 @@ To produce the documentation run the original source files ending with
% \file{njuthesis-sample.bib} & 示例参考文献列表 \\
% \file{njuthesis-sample.tex} & 示例文档,不妨以此为基础撰写论文 \\
% \file{njuthesis-graduate.def} & 研究生参数配置文件 \\
+% \file{njuthesis-postdoctoral.def} & 博士后参数配置文件 \\
% \file{njuthesis-undergraduate.def} & 本科生参数配置文件 \\
% \file{README.md} & 自述文件 \\
% \bottomrule
@@ -829,7 +834,7 @@ To produce the documentation run the original source files ending with
% \begin{description}
% \item[Perl] 一般预装于 macOS 和 Linux,而 Windows 用户需要单独安装
% \href{https://strawberryperl.com/}{Strawberry Perl}。
-% \item[\pkg{latexmk}] 如果终端找不到 |latexmk| 命令,需使用包管理器单独安装。
+% \item[\normalfont\pkg{latexmk}] 如果终端找不到 |latexmk| 命令,需使用包管理器单独安装。
% \end{description}
%
% 该命令的使用方法为
@@ -960,15 +965,15 @@ To produce the documentation run the original source files ending with
% \subsubsection{学位信息}
% \begin{function}[added=2021-09-07,updated=2022-07-23]{type}
% \begin{syntax}
-% type = <(bachelor)|master|doctor|postdoc>
+% \OPT{type} = <(bachelor)|master|doctor|postdoc>
% \end{syntax}
-% 选择毕业论文模板类型,这将决定模板整体的外观。
-% 可选值分别为学士(本科生)、硕士研究生和博士研究生,默认为学士。
+% 选择毕业论文模板类型,这将决定模板整体的外观。可选值分别为
+% 学士(本科生)、硕士研究生、博士研究生和博士后,默认为学士。
% \end{function}
%
% \begin{function}[added=2021-09-07,updated=2022-07-01]{degree}
% \begin{syntax}
-% degree = <(academic)|professional>
+% \OPT{degree} = <(academic)|professional>
% \end{syntax}
% 选择研究生的学位类型。可选值分别学术型和专业型,默认为学术型。
% \end{function}
@@ -978,7 +983,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2021-09-07,updated=2022-07-05]{nl-cover}
% \begin{syntax}
-% nl-cover = <\TFF>
+% \OPT{nl-cover} = <\TFF>
% \end{syntax}
% 是否使用国家图书馆封面,默认关闭。
% \end{function}
@@ -988,7 +993,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2022-01-06]{decl-page}
% \begin{syntax}
-% decl-page = <\TFF>
+% \OPT{decl-page} = <\TFF>
% \end{syntax}
% 是否需要自动生成声明页面,默认关闭。
% \end{function}
@@ -1009,7 +1014,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-01-14]{oneside,twoside}
% \begin{syntax}
-% <oneside|(twoside)>
+% <\OPT{oneside}|(\OPT{twoside})>
% \end{syntax}
% 开启单面或双面模式,默认为双面模式。
% \end{function}
@@ -1022,7 +1027,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2021-12-15]{draft}
% \begin{syntax}
-% draft = <\TFF>
+% \OPT{draft} = <\TFF>
% \end{syntax}
% 是否开启草稿模式,默认关闭。
% \end{function}
@@ -1042,9 +1047,9 @@ To produce the documentation run the original source files ending with
% 宏包的代码环境不会显示内容,具体效果需要参照各个宏包的说明文档。
% 如需抵消草稿模式的影响,请使用 \opt{final} 选项载入相关宏包。
%
-% \begin{function}[added=2022-04-19,updated=2022-07-04]{anonymous}
+% \begin{function}[added=2022-04-19,updated=2022-09-26]{anonymous}
% \begin{syntax}
-% anonymous = <\TFF>
+% \OPT{anonymous} = <\TFF>
% \end{syntax}
% 是否开启盲审模式。
% \end{function}
@@ -1054,6 +1059,7 @@ To produce the documentation run the original source files ending with
% \item 不显示校名校徽图片
% \item 不显示“南京大学”字样
% \item 不显示作者、导师等基本信息
+% \item 不显示声明页、致谢页
% \end{itemize}
%
%
@@ -1068,31 +1074,31 @@ To produce the documentation run the original source files ending with
% footmisc,
% unicode-math}
% \begin{syntax}
-% biblatex = <\TTF>
-% cleveref = <\TTF>
-% ntheorem = <\TTF>
-% enumitem = <\TTF>
-% footmisc = <\TTF>
-% unicode-math = <\TTF>
+% \OPT{biblatex} = <\TTF>
+% \OPT{cleveref} = <\TTF>
+% \OPT{ntheorem} = <\TTF>
+% \OPT{enumitem} = <\TTF>
+% \OPT{footmisc} = <\TTF>
+% \OPT{unicode-math} = <\TTF>
% \end{syntax}
% 是否默认载入某些宏包,默认均是。选项名和宏包名是一致的。
% \end{function}
%
% \begin{function}[added=2022-08-03]{minimal}
% \begin{syntax}
-% <minimal>
+% <\OPT{minimal}>
% \end{syntax}
% 最小化模式,禁用所有上述宏包。
% \end{function}
%
% 本模板内置了一系列宏包以进行功能扩展。这些宏包为:
% \begin{description}
-% \item[\pkg{biblatex}] 复杂参考文献数据的处理。
-% \item[\pkg{cleveref}] 按来源类型自动处理引用标签。
-% \item[\pkg{ntheorem}] 定理类环境定制。
-% \item[\pkg{enumitem}] 列表环境样式定制。
-% \item[\pkg{footmisc}] 脚注样式定制。
-% \item[\pkg{unicode-math}] 支持 Unicode 数学字体。
+% \item[\normalfont\pkg{biblatex}] 复杂参考文献数据的处理。
+% \item[\normalfont\pkg{cleveref}] 按来源类型自动处理引用标签。
+% \item[\normalfont\pkg{ntheorem}] 定理类环境定制。
+% \item[\normalfont\pkg{enumitem}] 列表环境样式定制。
+% \item[\normalfont\pkg{footmisc}] 脚注样式定制。
+% \item[\normalfont\pkg{unicode-math}] 支持 Unicode 数学字体。
% \end{description}
%
% 在某些情况下,这些宏包会与旧有的经验方法冲突,可以使用上述选项在模板
@@ -1102,7 +1108,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-02-23]{config}
% \begin{syntax}
-% config = \Arg{文件}
+% \OPT{config} = \Arg{文件}
% \end{syntax}
% 配置文件路径。
% \end{function}
@@ -1118,8 +1124,8 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2021-09-07,updated=2021-12-18]{cjk-font,latin-font}
% \begin{syntax}
-% cjk-font = <win|mac|fandol|founder|noto|source|none>
-% latin-font = <win|mac|gyre|none>
+% \OPT{cjk-font} = <win|mac|fandol|founder|noto|source|none>
+% \OPT{latin-font} = <win|mac|gyre|none>
% \end{syntax}
% 手动指定字体。
% \end{function}
@@ -1202,18 +1208,19 @@ To produce the documentation run the original source files ending with
% 字体配置。Windows 和 macOS 以外的系统采用 \opt{gyre} 配置。
%
% \begin{table}[!htbp]
+% \def\TG#1{TG~#1~\TA}
% \centering
% \begin{talltblr} [
% caption = {西文字体配置},
-% label = {tab:latin-fontset},
+% label = {tab:latin-fontset},
% note{a} = {TG 表示 \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{\TeX~Gyre}。} ]
% { colspec = {cccc} }
% \toprule
-% 配置名称 & 衬线体 & 无衬线体 & 等宽字体 \\
+% 配置名称 & 衬线体 & 无衬线体 & 等宽字体 \\
% \midrule
-% \opt{win} & Times~New~Roman & Arial & Courier~New \\
-% \opt{mac} & Times~New~Roman & Arial & Menlo \\
-% \opt{gyre} & TG Termes & TG Heros & TG Cursor \\
+% \opt{win} & Times~New~Roman & Arial & Courier~New \\
+% \opt{mac} & Times~New~Roman & Arial & Menlo \\
+% \opt{gyre} & \TG{Termes} & \TG{Heros} & \TG{Cursor} \\
% \bottomrule
% \end{talltblr}
% \end{table}
@@ -1223,39 +1230,40 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-02]{math-font}
% \begin{syntax}
-% math-font=<asana|cambria|fira|garamond|lm|...|termes|xits|none>
+% \OPT{math-font} = <asana|cambria|fira|garamond|lm|...|termes|(xits)|none>
% \end{syntax}
-% 设置数学字体。
+% 设置数学字体。完整列表见表 {tab:math-fontset}。
% \end{function}
%
-% 本模板采用 \pkg{unicode-math} 宏包配置数学公式环境中使用的字体。
-% 与原生 \LaTeX{} 最接近的字体对应 \opt{lm},
-% 与 MS Word 最接近的字体对应 \opt{cambria}。
+% 本模板默认采用 \pkg{unicode-math} 宏包配置数学模式下使用的字体。
+% 与原生 \LaTeX{} 最接近的字体对应 \opt{lm},MS Word 预装的字体对应 \opt{cambria}。
%
% \begin{table}[!htbp]
+% \def\NCM{New Computer Modern}
% \centering
% \begin{talltblr} [
% caption = {数学字体配置},
-% label = {tab:math-fontset},
+% label = {tab:math-fontset},
% note{a} = {TG 表示 \href{http://www.gust.org.pl/projects/e-foundry/tex-gyre}{\TeX~Gyre}。},
% note{b} = {粗体使用 XITS Math Bold。} ]
% { colspec = {ccl} }
% \toprule
-% 配置名称 & 字体名称 & 描述 \\
+% 配置名称 & 字体名称 & 描述 \\
% \midrule
-% \opt{asana} & Asana Math & \\
-% \opt{cambria} & Cambria Math & 微软 Office 预装的数学字体 \\
-% \opt{fira} & Fira Math & 无衬线数学字体,Fira 风格 \\
-% \opt{garamond} & Garamond Math & Garamond 风格 \\
-% \opt{lm} & Latin Modern Math & Computer Modern 风格 \\
-% \opt{libertinus} & Libertinus Math & \\
-% \opt{stix} & STIX Math & Times 风格 \\
-% \opt{bonum} & TG Bonum Math \TblrNote{a} & \\
-% \opt{dejavu} & TG DejaVu Math \TblrNote{a} & DejaVu 风格 \\
-% \opt{pagella} & TG Pagella Math \TblrNote{a} & Palatino 风格 \\
-% \opt{schola} & TG Schola Math \TblrNote{a} & \\
-% \opt{termes} & TG Termes Math \TblrNote{a} & Times 风格 \\
-% \opt{xits} & XITS Math \TblrNote{b} & 基于 STIX,Times 风格 \\
+% \opt{asana} & Asana Math & \\
+% \opt{cambria} & Cambria Math & 微软 Office 预装的数学字体 \\
+% \opt{fira} & Fira Math & 无衬线数学字体,Fira 风格 \\
+% \opt{garamond} & Garamond Math & Garamond 风格 \\
+% \opt{lm} & Latin Modern Math & Computer Modern 风格 \\
+% \opt{libertinus} & Libertinus Math & \\
+% \opt{newcm} & \NCM~Math & Computer Modern 风格 \\
+% \opt{stix} & STIX Math & Times 风格 \\
+% \opt{bonum} & TG Bonum Math \TA & \\
+% \opt{dejavu} & TG DejaVu Math \TA & DejaVu 风格 \\
+% \opt{pagella} & TG Pagella Math \TA & Palatino 风格 \\
+% \opt{schola} & TG Schola Math \TA & \\
+% \opt{termes} & TG Termes Math \TA & Times 风格 \\
+% \opt{xits} & XITS Math \TB & 基于 STIX,Times 风格 \\
% \bottomrule
% \end{talltblr}
% \end{table}
@@ -1264,7 +1272,7 @@ To produce the documentation run the original source files ending with
%
% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、
% 两种思源字体和四种Fandol字体能够\emph{免费商用};
-% 英文字库中只有 Times New Roman、XITS 和三种 \TeX Gyre字体能够\emph{免费商用}。
+% 英文字库中只有 Times New Roman、XITS 和三种 \TeX~Gyre字体能够\emph{免费商用}。
% 因此,若需要将本模板用于商业相关的活动,请咨询专业人士。
%
%
@@ -1280,49 +1288,53 @@ To produce the documentation run the original source files ending with
% 根据可选参数填写方式不同,\tn{njusetup} 共有四种等效的使用方式,
% 可以根据实际情况进行灵活选择。
%
-% 在键路径留空时,为最基础的用法。此时设置项的参数是一个使用英文
-% 半角逗号分隔的键值列表,通常形如 \meta{key}|=|\meta{value}。
+% 在键路径留空时,为最基础的用法。此时设置项的参数是一个使用
+% \emph{英文半角逗号}分隔的键值列表,通常形如 \meta{key}|=|\meta{value}。
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib},
+% emph={[3]title,author,resource}]
% \njusetup{
% info/title = {奇文},
% info/author = {佚名},
-% bib/resource = {ref1.bib, ref1.bib}
+% bib/resource = {ref1.bib, ref2.bib}
% }
% \end{latexexample}
%
% 以上为最基础的填写方法,可以分组为:
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib},
+% emph={[3]title,author,resource}]
% \njusetup{
% info = {
% title = {奇文},
% author = {佚名}
% },
% bib = {
-% resource = {ref1.bib, ref1.bib},
+% resource = {ref1.bib, ref2.bib},
% }
% }
% \end{latexexample}
%
% 在键路径填入模块(类)时,只能设定当前模块下的选项。此时参数是键值列表。
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib},
+% emph={[3]title,author,resource}]
% \njusetup[info]{
% title = {奇文},
% author = {佚名}
% }
% \njusetup[bib]{
-% resource = {ref1.bib, ref1.bib}
+% resource = {ref1.bib, ref2.bib}
% }
% \end{latexexample}
%
% 在键路径填入具体选项名称时,只能设定该选项的值。
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info,bib},
+% emph={[3]title,author,resource}]
% \njusetup[info/title]{奇文}
% \njusetup[info/author]{佚名}
-% \njusetup[bib/resource]{ref1.bib, ref1.bib}
+% \njusetup[bib/resource]{ref1.bib, ref2.bib}
% \end{latexexample}
%
%
@@ -1333,8 +1345,8 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2022-01-14]{info/title,info/title*}
% \begin{syntax}
-% title = \Arg{标题}
-% title* = \Arg{英文标题}
+% \OPT{title} = \Arg{标题}
+% \OPT{title*} = \Arg{英文标题}
% \end{syntax}
% 题目。由于封面上提供给中文题目的横线长度有限\footnote{单行最长约为15
% 个汉字,建议总长度不超过45字,当然你也可以对照 \ref{subsubsec:modify-length}
@@ -1352,8 +1364,8 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2021-10-01]{info/keywords,info/keywords*}
% \begin{syntax}
-% keywords = \Arg{关键词}
-% keywords* = \Arg{英文关键词}
+% \OPT{keywords} = \Arg{关键词}
+% \OPT{keywords*} = \Arg{英文关键词}
% \end{syntax}
% 关键词列表。关键词之间需要使用英文半角逗号隔开,
% 含有空格的关键字需要使用花括号包裹以避免歧义。可以参照下方的填写示例。
@@ -1361,14 +1373,14 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2021-10-01]{info/grade}
% \begin{syntax}
-% grade = \Arg{20XX}
+% \OPT{grade} = \Arg{20XX}
% \end{syntax}
% 年级,推荐格式为“20XX”。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/student-id}
% \begin{syntax}
-% student-id = \Arg{学号或工号}
+% \OPT{student-id} = \Arg{学号或工号}
% \end{syntax}
% 学号或工号。南京大学本科生为9位数字学号,
% 研究生为两位大写字母标识加上数字组成的学号(2022级改为纯数字)。
@@ -1376,55 +1388,55 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2021-10-01]{info/author,info/author*}
% \begin{syntax}
-% author = \Arg{你的名字}
-% author* = \Arg{姓名拼音}
+% \OPT{author} = \Arg{你的名字}
+% \OPT{author*} = \Arg{姓名拼音}
% \end{syntax}
% 姓名。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/department,info/department*}
% \begin{syntax}
-% department = \Arg{院系}
-% department* = \Arg{院系}
+% \OPT{department} = \Arg{院系}
+% \OPT{department*} = \Arg{院系}
% \end{syntax}
% 院系。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/major,info/major*}
% \begin{syntax}
-% major = \Arg{专业}
-% major* = \Arg{专业}
+% \OPT{major} = \Arg{专业}
+% \OPT{major*} = \Arg{专业}
% \end{syntax}
% 专业。
% \end{function}
%
% \begin{function}[updated=2021-10-01]{info/field,info/field*}
% \begin{syntax}
-% field = \Arg{方向}
-% field* = \Arg{方向}
+% \OPT{field} = \Arg{方向}
+% \OPT{field*} = \Arg{方向}
% \end{syntax}
% 研究领域。只有研究生存在研究领域的说法,本科生无需填写。
% \end{function}
%
% \begin{function}[updated=2022-01-12]{info/supervisor,info/supervisor*}
% \begin{syntax}
-% supervisor = \Arg{导师姓名,职称}
-% supervisor* = \Arg{导师英文全称}
+% \OPT{supervisor} = \Arg{导师姓名,职称}
+% \OPT{supervisor*} = \Arg{导师英文全称}
% \end{syntax}
% 导师全称。请使用逗号( |,| )分隔导师的中文姓名与职称,英文名则不需添加逗号。
% \end{function}
%
% \begin{function}[updated=2021-01-12]{info/supervisor-ii,info/supervisor-ii*}
% \begin{syntax}
-% supervisor-ii = \Arg{第二导师姓名,职称}
-% supervisor-ii* = \Arg{第二导师英文全称}
+% \OPT{supervisor-ii} = \Arg{第二导师姓名,职称}
+% \OPT{supervisor-ii*} = \Arg{第二导师英文全称}
% \end{syntax}
% 第二导师全称。无第二导师时不填即可。
% \end{function}
%
% \begin{function}[updated=2022-01-14]{info/submit-date}
% \begin{syntax}
-% submit-date = \Arg{yyyy-mm-dd}
+% \OPT{submit-date} = \Arg{yyyy-mm-dd}
% \end{syntax}
% 提交日期。中英文日期现在可以由 ISO 日期格式\cite{gb-t-7408-2005}
% 的字符串统一生成。如果在等号后留空,则原本中文日期处使用空白的年月日字样;
@@ -1433,29 +1445,29 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[updated=2022-01-14]{info/defend-date}
% \begin{syntax}
-% defend-date = \Arg{yyyy-mm-dd}
+% \OPT{defend-date} = \Arg{yyyy-mm-dd}
% \end{syntax}
% 答辩日期,只对研究生有效,要求同提交日期。
% \end{function}
%
% \begin{function}[updated=2022-05-23]{info/confer-date}
% \begin{syntax}
-% confer-date = \Arg{yyyy-mm-dd}
+% \OPT{confer-date} = \Arg{yyyy-mm-dd}
% \end{syntax}
% 学位授予日期,只用于国家图书馆封面,要求同提交日期。
% \end{function}
%
% \begin{function}[updated=2022-05-23]{info/bottom-date}
% \begin{syntax}
-% bottom-date = \Arg{yyyy-mm-dd}
+% \OPT{bottom-date} = \Arg{yyyy-mm-dd}
% \end{syntax}
% 底部日期,只用于国家图书馆封面,要求同提交日期。
% \end{function}
%
% \begin{function}[updated=2022-05-27]{info/chairman,info/reviewer}
% \begin{syntax}
-% chairman = \Arg{答辩主席姓名职称}
-% reviewer = \Arg{答辩评委姓名职称}
+% \OPT{chairman} = \Arg{答辩主席姓名职称}
+% \OPT{reviewer} = \Arg{答辩评委姓名职称}
% \end{syntax}
% 答辩委员会信息,分别为评审委员会主席及成员的姓名加职称,只对研究生有效。
% 评审成员名单以逗号分隔的列表形式存储,填写方法同关键词。
@@ -1465,10 +1477,10 @@ To produce the documentation run the original source files ending with
% \begin{function}[updated=2021-10-01]{info/clc,info/secret-level,
% info/udc,info/supervisor-contact}
% \begin{syntax}
-% clc = \Arg{中图分类号}
-% secret-level = <不涉密|秘密|机密|绝密>
-% udc = \Arg{udc}
-% supervisor-contact = \Arg{导师联系方式}
+% \OPT{clc} = \Arg{中图分类号}
+% \OPT{secret-level} = <不涉密|秘密|机密|绝密>
+% \OPT{udc} = \Arg{UDC 分类号}
+% \OPT{supervisor-contact} = \Arg{导师联系方式}
% \end{syntax}
% 国家图书馆封面相关,包括中图分类号、密级、UDC 分类号和导师联系方式。
% \end{function}
@@ -1478,10 +1490,12 @@ To produce the documentation run the original source files ending with
%
% 本科生可以参考如下范例输入个人信息。注意不能有空行。
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info},emph={[3]title,title*,
+% keywords,keywords*,grade,student-id,author,author*,department,department*,
+% major,major*,supervisor,supervisor*,submit-date}]
% \njusetup[info]{
% title = {第一行标题\\第二行标题},
-% title* = {My title in English},
+% title* = {My Awesome Work},
% keywords = {我,就是,充数的,关键词},
% keywords* = {Dummy, Keywords, Here, {it is}},
% grade = {2018},
@@ -1500,10 +1514,12 @@ To produce the documentation run the original source files ending with
%
% 研究生可以参考如下列表输入个人信息
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info},emph={[3]title,title*,
+% keywords,keywords*,grade,student-id,author,author*,department,department*,
+% major,major*,field,field*,supervisor,supervisor*,submit-date,defend-date,email}]
% \njusetup[info]{
% title = {第一行标题\\第二行标题\\第三行标题},
-% title* = {My title in English},
+% title* = {My Awesome Work},
% keywords = {我,就是,充数的,关键词},
% keywords* = {Dummy,Keywords,Here,{it is}},
% grade = {2018},
@@ -1526,7 +1542,8 @@ To produce the documentation run the original source files ending with
%
% 如果需要国家图书馆封面,还需要加入如下信息
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info},emph={[3]confer-date,
+% bottom-date,chairman,reviewer,clc,secret-level,udc,supervisor-contact}]
% \njusetup[info]{
% confer-date = {2022-05-20},
% bottom-date = {2022-05-21},
@@ -1541,10 +1558,11 @@ To produce the documentation run the original source files ending with
%
% 博士后可以参考如下范例输入个人信息。
%
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]info},emph={[3]title,title*,
+% keywords,keywords*,student-id,author,department,major,supervisor,submit-date}]
% \njusetup[info]{
% title = {第一行标题\\第二行标题},
-% title* = {My title in English},
+% title* = {My Awesome Work},
% keywords = {我,就是,充数的,关键词},
% keywords* = {Dummy, Keywords, Here, {it is}},
% student-id = {189114514},
@@ -1588,8 +1606,8 @@ To produce the documentation run the original source files ending with
%
% \begin{function}{header/content,header/content*,footer/content,footer/content*}
% \begin{syntax}
-% content = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
-% content* = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
+% \OPT{content} = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
+% \OPT{content*} = \{\Arg{位置}\Arg{内容},\Arg{位置}\Arg{内容},...\}
% \end{syntax}
% 页眉页脚的格式与内容设置。带有星号的设置项供单面模式下使用。
% \end{function}
@@ -1604,7 +1622,7 @@ To produce the documentation run the original source files ending with
% 并将页眉格式设置成五号黑体,奇数页左侧为节名,右侧为页码,
% 偶数页左侧为页码,右侧为章名。
% \begin{latexexample}[moretexcs={\njusetup,\sffamily,\njusetformat},
-% emph={[2]header,footer}]
+% emph={[2]header,footer},emph={[3]content}]
% \njusetup[header/content]{
% { OR } { \thepage }, { OL } { \rightmark },
% { EL } { \thepage }, { ER } { \leftmark }
@@ -1639,19 +1657,36 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-08-06]{image/path}
% \begin{syntax}
-% path = \{\marg{路径1},\marg{路径2},...\}
+% \OPT{path} = \{\marg{路径1},\marg{路径2},...\}
% \end{syntax}
% 图片搜索路径,等效于 \tn{graphicspath}。这个选项仅能设置一次。
% \end{function}
%
% \subsubsection{脚注}
%
-% \begin{function}[added=2022-05-01,updated=2022-08-03]{footnote/style}
+% \begin{function}[added=2022-05-01,updated=2022-10-16]{footnote/style}
+% \begin{syntax}
+% \OPT{style} = <(plain)|pifont|circled|circled*>
+% \end{syntax}
+% 设置脚注编号样式。默认为普通数字;使用 \opt{pifont} 可修改为带圈数字,
+% 此样式受到字符闲置,单页不建议超过10条脚注;使用 \opt{circled} 或 \opt{circled*}
+% 选项同样可修改为带圈数字,且不受单页脚注数量的限制,带星号的选项为黑底白字(阴文)。
+% \footnote{此功能依赖的 \pkg{circledtext} 宏包于 2022 年 4 月发布,可能需要手动安装。}
+% \end{function}
+%
+% \begin{function}[added=2022-10-16]{footnote/circledtext-option}
+% \begin{syntax}
+% \OPT{circledtext-option} = \meta{选项列表}
+% \end{syntax}
+% \opt{circled} 或 \opt{circled*} 选项的带圈数字编号使用 \pkg{circledtext}
+% 宏包绘制,可使用本选项载入更多定制设置,详见其手册。
+% \end{function}
+%
+% \begin{function}[added=2022-10-16]{footnote/hang}
% \begin{syntax}
-% style = <(plain)|pifont>
+% \OPT{hang} = \TTF
% \end{syntax}
-% 设置脚注编号样式。默认为普通数字,使用 |pifont|
-% 选项可修改为带圈数字。单一页面内请尽量避免超过 10 条脚注。
+% 是否进行悬挂缩进。默认为是,缩进宽度为 \qty{1.5}{em}。
% \end{function}
%
% 脚注样式的调整依赖 \pkg{footmisc}。如果希望使用 \LaTeX 的默认样式,
@@ -1678,13 +1713,15 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/style}
% \begin{syntax}
-% style = <TeX|ISO|(GB)>
+% \OPT{style} = <TeX|ISO|(GB)>
% \end{syntax}
% 数学符号风格。
% \end{function}
%
% 默认的国标风格 \opt{GB} 相当于在导言区设置了
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]math}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]math},
+% emph={[3]integral,integral-limits,less-than-or-equal,
+% math-ellipsis,partial,real-part,vector,uppercase-greek}]
% \njusetup[math]{
% integral = upright,
% integral-limits = false,
@@ -1701,7 +1738,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/integral}
% \begin{syntax}
-% integral = <upright|slanted>
+% \OPT{integral} = <upright|slanted>
% \end{syntax}
% 积分号的正/斜体。
% 该选项需要字体的支持,目前仅限 \opt{xits}、\opt{newcm}。
@@ -1709,7 +1746,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/integral-limits}
% \begin{syntax}
-% integral-limits = <\TF>
+% \OPT{integral-limits} = <\TF>
% \end{syntax}
% 积分号上下限的位置,可选:\opt{true}(在上下)、\opt{false}(在右侧)。
% 这个设置只影响行间公式,行内公式统一居右侧,不受影响。
@@ -1717,7 +1754,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/less-than-or-equal}
% \begin{syntax}
-% less-than-or-equal = <slanted|horizontal>
+% \OPT{less-than-or-equal} = <slanted|horizontal>
% \end{syntax}
% 小于等于号和大于等于号的字形。
% 这将控制 \tn{le}、\tn{ge}、\tn{leq} 和 \tn{geq} 的符号是
@@ -1726,7 +1763,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/math-ellipsis}
% \begin{syntax}
-% math-ellipsis = <centered|lower>
+% \OPT{math-ellipsis} = <centered|lower>
% \end{syntax}
% 省略号 \tn{dots} 的样式,可选:\opt{centered}(按照中文的习惯固定居中)、
% \opt{lower}(取决于前后符号的位置)。
@@ -1735,28 +1772,28 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{math/partial}
% \begin{syntax}
-% partial = <upright|italic>
+% \OPT{partial} = <upright|italic>
% \end{syntax}
% 偏微分符号的正/斜体。
% \end{function}
%
% \begin{function}[added=2022-07-31]{math/real-part}
% \begin{syntax}
-% real-part = <roman|fraktur>
+% \OPT{real-part} = <roman|fraktur>
% \end{syntax}
% 实部 \tn{Re} 和虚部 \tn{Im} 的字体。
% \end{function}
%
% \begin{function}[added=2022-07-31]{math/vector}
% \begin{syntax}
-% vector = <boldfont|arrow>
+% \OPT{vector} = <boldfont|arrow>
% \end{syntax}
% 向量的表示方法,可选粗斜体或箭头。
% \end{function}
%
% \begin{function}[added=2022-07-31]{math/uppercase-greek}
% \begin{syntax}
-% uppercase-greek = <upright|italic>
+% \OPT{uppercase-greek} = <upright|italic>
% \end{syntax}
% 大写希腊字母的正/斜体。
% 有限增量符号 $\increment x$ 固定使用正体,推荐使用 \tn{increment} 表示。
@@ -1787,28 +1824,28 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-04-21]{theorem/style}
% \begin{syntax}
-% style = <(plain)|break|change|margin|empty|...>
+% \OPT{style} = <(plain)|break|change|margin|empty|...>
% \end{syntax}
% 定理基本样式。等效于 \tn{theoremstyle}\marg{样式名称}。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/header-font}
% \begin{syntax}
-% header-font = \meta{头部字体格式}
+% \OPT{header-font} = \meta{头部字体格式}
% \end{syntax}
% 定理头部字体格式。等效于 \tn{theoremheaderfont}\marg{格式}。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/body-font}
% \begin{syntax}
-% body-font = \meta{内部字体格式}
+% \OPT{body-font} = \meta{内部字体格式}
% \end{syntax}
% 定理内部字体格式。等效于 \tn{theorembodyfont}\marg{格式}。
% \end{function}
%
% \begin{function}[added=2022-04-21]{theorem/qed-symbol}
% \begin{syntax}
-% qed-symbol = \meta{证毕符号}
+% \OPT{qed-symbol} = \meta{证毕符号}
% \end{syntax}
% 证毕符号。等效于 \tn{theoremsymbol}\marg{符号}。默认为空心方块(\mdlgwhtsquare)。
% 禁用 \pkg{unicode-math} 时为实心黑色方块(\rule{1ex}{1ex})。
@@ -1816,7 +1853,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-04-21]{theorem/counter}
% \begin{syntax}
-% counter = <part|(chapter)|section|...>
+% \OPT{counter} = <part|(chapter)|section|...>
% \end{syntax}
% 定理计数器范围。
% \end{function}
@@ -1824,7 +1861,7 @@ To produce the documentation run the original source files ending with
% 模板的默认设置等效于
%
% \begin{latexexample}[moretexcs={\njusetup,\bfseries,\itshape,\mdlgwhtsquare},
-% emph={[2]theorem}]
+% emph={[2]theorem},emph={[3]style,header-font,body-font,qed-symbol,counter}]
% \njusetup[theorem]{
% style = plain,
% header-font = \normalfont \bfseries ,
@@ -1838,7 +1875,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-08-05]{theorem/type}
% \begin{syntax}
-% type = \{\marg{环境名,类型标识} \marg{头名称},...\}
+% \OPT{type} = \{\marg{环境名,类型标识} \marg{头名称},...\}
% \end{syntax}
% 需要定义的定理类型列表。在可选的 \meta{类型标识} 中,含有\emph{星号}表示
% 需要编号,含有\emph{加号}需要证毕符号。该选项存储的是用来定义环境的参数,
@@ -1846,28 +1883,29 @@ To produce the documentation run the original source files ending with
% \end{function}
%
% \opt{theorem/type} 初始定义的环境列表如表~\ref{tab:mathenv} 所示。
-% 其中证明环境较为特殊,不编号且会在结尾添加证毕符号。
% 这些环境并没有预先创建,使用方法见下面的例子。
%
% \begin{table}[htbp]
% \centering
-% \caption{预置的数学定理环境}
-% \label{tab:mathenv}
-% \begin{tabular}{cc|cc}
+% \begin{talltblr} [
+% caption = {预置的数学定理环境},
+% label = {tab:mathenv},
+% note{a} = {证明环境较为特殊,不编号且会在结尾添加证毕符号。} ]
+% { colspec = {cc|cc} }
% \toprule
-% \bf 标签 & \bf 名称 & \bf 标签 & \bf 名称 \\
+% 标签 & 名称 & 标签 & 名称 \\
% \midrule
-% axiom & 公理 & lemma & 引理 \\
-% corollary & 推论 & proof & 证明 \\
-% definition & 定义 & theorem & 定理 \\
-% example & 例 & & \\
+% axiom & 公理 & lemma & 引理 \\
+% corollary & 推论 & proof \TA & 证明 \\
+% definition & 定义 & theorem & 定理 \\
+% example & 例 & & \\
% \bottomrule
-% \end{tabular}
+% \end{talltblr}
% \end{table}
%
% \begin{function}[added=2022-08-05]{theorem/define}
% \begin{syntax}
-% <define>
+% <\OPT{define}>
% \end{syntax}
% 创建定理环境。
% \end{function}
@@ -1880,9 +1918,9 @@ To produce the documentation run the original source files ending with
% 宋体,定义了 \env{exercise} 和 \env{solution} 两种定理环境,后者没有编号。
%
% \begin{latexexample}[moretexcs={\njusetup,\normalfont},
-% emph={[2]theorem}]
+% emph={[2]theorem},emph={[3]define,body-font,type}]
% \njusetup[theorem]{
-% define,
+% define ,
% body-font = \normalfont ,
% type = {
% { {exercise} {习题} },
@@ -1897,9 +1935,9 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-07-31]{label-sep/figure,label-sep/table,label-sep/equation}
% \begin{syntax}
-% figure = \meta{符号}
-% table = \meta{符号}
-% equation = \meta{符号}
+% \OPT{figure} = \meta{符号}
+% \OPT{table} = \meta{符号}
+% \OPT{equation} = \meta{符号}
% \end{syntax}
% 图片、表格、公式编号中的连接符样式,默认为短横线(en dash)。
% \end{function}
@@ -1921,7 +1959,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2021-12-19]{bib/style}
% \begin{syntax}
-% style = <(numeric)|author-year|\meta{自定义样式}>
+% \OPT{style} = <(numeric)|author-year|\meta{自定义样式}>
% \end{syntax}
% 参考文献样式。可选顺序编码制 \opt{numeric} 和著者-出版年制 \opt{author-year},
% 或自行填入任意其他 \pkg{biblatex} 样式。默认为顺序编码制。
@@ -1945,7 +1983,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-02-15]{bib/option}
% \begin{syntax}
-% option = \meta{选项列表}
+% \OPT{option} = \meta{选项列表}
% \end{syntax}
% 待传入 \pkg{biblatex} 宏包的额外选项列表。
% \end{function}
@@ -1955,7 +1993,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2021-12-19]{bib/resource}
% \begin{syntax}
-% resource = \Arg{文件}
+% \OPT{resource} = \Arg{文件}
% \end{syntax}
% 参考文献数据源。类似于 \tn{addbibresource} 命令,但可以使用逗号分隔的
% 列表形式。必须使用带扩展名(\file{.bib})的完整文件名。
@@ -1973,7 +2011,8 @@ To produce the documentation run the original source files ending with
% 可以参考如下范例进行参考文献设置。
% 其中 \opt{bib/option} 的内容旨在关闭部分不需显示的文献信息,
% 并采取仅首字母大写的作者姓名格式,可根据需要使用。
-% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib}]
+% \begin{latexexample}[moretexcs={\njusetup},emph={[2]bib},
+% emph={[3]style,resource,option}]
% \njusetup[bib]{
% style = author-year,
% resource = {njuthesis-sample.bib},
@@ -2050,16 +2089,15 @@ To produce the documentation run the original source files ending with
% note{a} = {在此样式下 \tn{parencite} 效果等同于 \tn{cite}。} ]
% { colspec = {cll} }
% \toprule
-% 引用方式 & 命令 & 排版效果 \\
+% 引用方式 & 命令 & 排版效果 \\
% \midrule
-% 单篇文献 & \tn{cite}\TblrNote{a} &
-% 作者加年份用括号包围可设置页码 \\
-% 多篇文献 & \tn{cite} & 分号隔开 \\
-% 标注页码 & \tn{pagescite} & 作者加年份用括号包围自动页码 \\
-% 标注年份 & \tn{yearcite} & 用括号包围的年份 \\
-% 标注年份、页码 & \tn{yearpagescite} & 提供年份用括号包围自动页码 \\
-% 标注作者 & \tn{textcite} & 作者为主语加加括号包围年份 \\
-% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
+% 单篇文献 & \tn{cite} \TA & 作者加年份用括号包围可设置页码 \\
+% 多篇文献 & \tn{cite} & 分号隔开 \\
+% 标注页码 & \tn{pagescite} & 作者加年份用括号包围自动页码 \\
+% 标注年份 & \tn{yearcite} & 用括号包围的年份 \\
+% 标注年份、页码 & \tn{yearpagescite} & 提供年份用括号包围自动页码 \\
+% 标注作者 & \tn{textcite} & 作者为主语加加括号包围年份 \\
+% 完整脚注 & \tn{footfullcite} & 脚注方式 \\
% \bottomrule
% \end{talltblr}
% \end{table}
@@ -2111,8 +2149,8 @@ To produce the documentation run the original source files ending with
% \begin{function}[added=2021-12-23,updated=2022-08-06]{
% image/nju-emblem,image/nju-name}
% \begin{syntax}
-% nju-emblem = \Arg{文件}
-% nju-name = \Arg{文件}
+% \OPT{nju-emblem} = \Arg{文件}
+% \OPT{nju-name} = \Arg{文件}
% \end{syntax}
% 校名、校徽图片文件路径。
% \end{function}
@@ -2141,7 +2179,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-02-04,updated=2022-07-31]{abstract/toc-entry}
% \begin{syntax}
-% toc-entry = <\TTF>
+% \OPT{toc-entry} = <\TTF>
% \end{syntax}
% 是否将摘要条目插入目录,默认开启。
% 关闭此选项后摘要页将不会出现在目录中,仅保留其 PDF 书签。
@@ -2149,7 +2187,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-03-26,updated=2022-07-31]{abstract/title-style}
% \begin{syntax}
-% title-style = <(strict)|centered|natural>
+% \OPT{title-style} = <(strict)|centered|natural>
% \end{syntax}
% 选择研究生摘要标题样式。
% 默认为严格模式(\opt{strict}),即完全模仿材料包要求。
@@ -2191,7 +2229,7 @@ To produce the documentation run the original source files ending with
%
% \begin{function}[added=2022-08-08]{tableofcontents/dotline}
% \begin{syntax}
-% dotline = <chapter|(section)>
+% \OPT{dotline} = <chapter|(section)>
% \end{syntax}
% 目录中的引导线设置。选择 \opt{chapter} 会为章标题后添加引导线。
% \end{function}
@@ -2200,7 +2238,7 @@ To produce the documentation run the original source files ending with
% tableofcontents/toc-entry,listoffigures/toc-entry,
% listoftables/toc-entry}
% \begin{syntax}
-% toc-entry = <\TTF>
+% \OPT{toc-entry} = <\TTF>
% \end{syntax}
% 是否在目录中显示目录自身的条目,默认开启。关闭后目录、
% 插图目录和表格目录将不会出现在目录中,仅保留其 PDF 书签。
@@ -2208,7 +2246,7 @@ To produce the documentation run the original source files ending with
% \end{function}
%
% 如果仅需要禁用插图目录和表格目录的条目,可以这样设置
-% \begin{latexexample}[moretexcs={\njusetup},
+% \begin{latexexample}[moretexcs={\njusetup},emph={[3]toc-entry},
% emph={[2]tableofcontents,listoffigures,listoftables}]
% \njusetup{
% tableofcontents/toc-entry = true, % 仅作展示,无需手动启用
@@ -2236,7 +2274,8 @@ To produce the documentation run the original source files ending with
% \subsubsection{致谢页}
%
% \DescribeEnv{acknowledgement}
-% 同前言,使用 \env{acknowledgement} 环境。
+% 使用 \env{acknowledgement} 环境生成致谢页,附带有相应目录条目。
+% 在开启盲审模式时,仅显示该目录条目。
%
% \begin{latexexample}[emph={[1]acknowledgement}]
% \begin{acknowledgement}
@@ -2421,6 +2460,9 @@ To produce the documentation run the original source files ending with
% \item \pkg{fandol}、\pkg{tex-gyre}、\pkg{tex-gyre-math}、\pkg{xits} 等,
% 提供自由字体。
% \item \pkg{emptypage},在双面模式下清空空白页的页眉、页脚和页码。
+% \item \pkg{circledtext} 和 \pkg{l3experimental},用于在 \opt{footnote/circled}
+% 和 \opt{footnote/circled*} 选项下生成脚注圈码。
+% \item \pkg{pifont},用于在 \opt{footnote/pifont} 选项下生成脚注圈码。
% \item \pkg{tikz} 和 \pkg{njuvisual},用于绘制封面的校名校徽。
% \item \pkg{tabularray},用于绘制研究生的出版授权书信息表格。
% \item \pkg{xeCJKfntef} 或 \pkg{lua-ul},用于在对应引擎下绘制下划线。
@@ -2465,8 +2507,8 @@ To produce the documentation run the original source files ending with
% \bibitem{install-latex-guide-zh-cn}
% 王然.
% \newblock \textit{一份简短的关于 \LaTeX 安装的介绍} [EB/OL].
-% \newblock version 2021.12.1,
-% \newblock (2021-12-01)
+% \newblock version 2022.10.1,
+% \newblock (2022-10-01)
% \urlprefix\url{https://ctan.org/pkg/install-latex-guide-zh-cn}
% \urlprefix\CTANurl[文档:]{info/install-latex-guide-zh-cn/install-latex-guide-zh-cn.pdf}
%
@@ -2546,8 +2588,8 @@ To produce the documentation run the original source files ending with
% \bibitem{biblatex-gb7714-2015}
% 胡振震.
% \newblock \textit{符合 GB/T 7714-2015 标准的 biblatex 参考文献样式} [EB/OL].
-% \newblock version 1.1b,
-% \newblock (2021-12-11)
+% \newblock version 1.1j,
+% \newblock (2022-08-29)
% \urlprefix\url{https://ctan.org/pkg/biblatex-gb7714-2015}
% \urlprefix\CTANurl[文档:]{biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf}
%
@@ -2559,6 +2601,14 @@ To produce the documentation run the original source files ending with
% \urlprefix\url{https://ctan.org/pkg/ctex}
% \urlprefix\CTANurl[文档及源代码:]{language/chinese/ctex/ctex.pdf}
%
+% \bibitem{circledtext}
+% 耿楠.
+% \newblock \textit{Create circled text} [EB/OL].
+% \newblock version 1.1.0,
+% \newblock (2022-04-28)
+% \urlprefix\url{https://ctan.org/pkg/circledtext}
+% \urlprefix\CTANurl[文档:]{macros/latex/contrib/circledtext/circledtext.pdf}
+%
% \bibitem{latexmk}
% \textsc{Collins J}.
% \newblock \textit{Fully automated \LaTeX document generation} [EB/OL].
@@ -2763,8 +2813,8 @@ To produce the documentation run the original source files ending with
%
% \subsection{定义变量}
%
-% 本模板的变量名称通式为 |\|\meta{作用域}|_@@_|\meta{族}|_|\meta{描述}|_|\meta{类型}
-% (出现在源代码中)或 |\|\meta{作用域}|__nju_|\meta{族}|_|\meta{描述}|_|\meta{类型}
+% 本模板的变量名称通式为 \cs[no-index]{\meta{作用域}_@@_\meta{族}_\meta{描述}_\meta{类型}}
+% (出现在源代码中)或 \cs[no-index,replace=false]{\meta{作用域}_@@_\meta{族}_\meta{描述}_\meta{类型}}
% (出现在文档中)。作用域为单个字母,|l| 代表局部变量,|g| 代表全局变量,|c| 代表常
% 量。最后一个下划线后的内容指示其类型,但引擎不会根据名称检查变量类型。
%
@@ -2788,38 +2838,32 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{
-% \g_@@_info_degree_int,
-% \g_@@_info_type_int}
-% 用于存储学位类型的变量。
+% \begin{variable}{\g_@@_info_type_int}
+% 用于存储论文类型的变量。
% \begin{macrocode}
-\int_new:N \g_@@_info_degree_int
\int_new:N \g_@@_info_type_int
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{
-% \g_@@_info_degree_tl,
-% \g_@@_info_type_en_tl}
-% 用于存储学位名称的变量。
+% \begin{variable}{\g_@@_opt_academic_bool}
+% 用于判断学术型或专业型学位的变量。
% \begin{macrocode}
-\tl_new:N \g_@@_info_degree_tl
-\tl_new:N \g_@@_info_type_en_tl
+\bool_new:N \g_@@_opt_academic_bool
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_opt_twoside_bool}
% 定义用于判断是否使用双面模式的变量,初始值为使用双面模式。
% \begin{macrocode}
-\bool_new:N \g_@@_opt_twoside_bool
+\bool_new:N \g_@@_opt_twoside_bool
\bool_set_true:N \g_@@_opt_twoside_bool
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_second_supvbool}
+% \begin{variable}{\g_@@_opt_second_supv_bool}
% 定义用于判断是否有第二导师的变量。
% \begin{macrocode}
-\bool_new:N \l_@@_second_supvbool
+\bool_new:N \g_@@_opt_second_supv_bool
% \end{macrocode}
% \end{variable}
%
@@ -2856,7 +2900,6 @@ To produce the documentation run the original source files ending with
% 是否使用独立的字体文件。
% \begin{macrocode}
\bool_new:N \g_@@_font_path_bool
-\bool_gset_false:N \g_@@_font_path_bool
% \end{macrocode}
% \end{variable}
%
@@ -2867,23 +2910,6 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\g_@@_thm_type_clist}
-% 默认定理类型、头名称,以及是否需要编号和证毕符号。
-% \begin{macrocode}
-\clist_new:N \g_@@_thm_type_clist
-\clist_gset:Nn \g_@@_thm_type_clist
- {
- { axiom } { 公理 },
- { corollary } { 推论 },
- { definition } { 定义 },
- { example } { 例 },
- { lemma } { 引理 },
- { proof, *+ } { 证明 },
- { theorem } { 定理 }
- }
-% \end{macrocode}
-% \end{variable}
-%
% \begin{variable}{\c_@@_today_tl}
% 编译当天日期,格式为 |yyyy-mm-dd|。
% \begin{macrocode}
@@ -2896,18 +2922,13 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{
-% \c_@@_name_type_clist,
-% \c_@@_name_type_en_clist,
-% \c_@@_name_degree_clist}
+% \begin{variable}{\c_@@_name_type_clist,\c_@@_name_type_en_clist}
% 论文类型与学位类型。
% \begin{macrocode}
\clist_const:Nn \c_@@_name_type_clist
{ 学士, 硕士, 博士 }
\clist_const:Nn \c_@@_name_type_en_clist
{ Bachelor, Master, Doctor~of~Philosophy }
-\clist_const:Nn \c_@@_name_degree_clist
- { \c_empty_tl, 专业 }
% \end{macrocode}
% \end{variable}
%
@@ -2922,27 +2943,29 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{
-% \c_@@_name_anon_clist,
-% \c_@@_name_anon_en_clist,
-% \c_@@_name_anonlist_clist}
-% 盲审模式下不显示的个人信息项。
+% \begin{variable}{\c_@@_name_anon_clist,\c_@@_name_anon_en_clist}
+% 盲审模式下不显示的个人信息键名。
% \begin{macrocode}
\clist_const:Nn \c_@@_name_anon_clist
{
- author, chairman, clc, dept, email, field, grade,
- id, major, secretlv, supvcont, udc
+ author, chairman, email, student-id, reviewer,
+ supervisor-contact, supervisor, supervisor-ii
}
\clist_const:Nn \c_@@_name_anon_en_clist
- { author, dept, field, major, supv, supvii }
-\clist_const:Nn \c_@@_name_anonlist_clist
- { reviewer, supv, supvii }
+ { author, supervisor, supervisor-ii }
% \end{macrocode}
% \end{variable}
%
%
% \subsection{内部函数}
%
+% \begin{macro}{\@@_null:}
+% 等价于 \LaTeXe{} 中的 \tn{null}。
+% \begin{macrocode}
+\cs_new:Nn \@@_null: { \hbox:n { } }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_quad:,\@@_qquad:}
% 等价于 \LaTeXe{} 中的 \tn{quad} 和 \tn{qquad}。
% \begin{macrocode}
@@ -3041,7 +3064,7 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \begin{macro}{\@@_box_ulined_info:Nn}
-% 以上盒子只用来打印 \cs{g_@@_info_\meta{描述}_tl} 变量。
+% 以上盒子只用来打印 \cs[no-index]{g_@@_info_\meta{描述}_tl} 变量。
% \begin{macrocode}
\cs_new_protected:Npn \@@_box_ulined_info:Nn #1#2
{ \@@_box_ulined:Nc #1 { g_@@_info_ #2 _tl } }
@@ -3062,13 +3085,13 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_box_spread:NNn #1#2#3
{
\mode_leave_vertical:
- \@@_get_width:Nn \l_@@_tmpa_dim { #2 #3 }
+ \@@_get_width:Nn \l_@@_tmp_skip { #2 #3 }
\hbox_to_wd:nn { #1 }
{
- \dim_compare:nTF { \l_@@_tmpa_dim > #1 }
+ \dim_compare:nTF { \l_@@_tmp_skip > #1 }
{
\tex_hfil:D \scalebox
- { \dim_to_decimal_in_unit:nn { #1 } { \l_@@_tmpa_dim } }
+ { \dim_to_decimal_in_unit:nn { #1 } { \l_@@_tmp_skip } }
[ 1.0 ] { #2 #3 } \tex_hfil:D
}
{ #2 \tl_map_inline:nn { #3 } { ##1 \tex_hfil:D } \tex_unskip:D }
@@ -3079,7 +3102,7 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \begin{macro}{\@@_box_spread_name:Nn,\@@_box_spread_name:NNn}
-% 以上盒子只用来打印 \cs{c_@@_name_\meta{描述}_tl} 变量。
+% 以上盒子只用来打印 \cs[no-index]{c_@@_name_\meta{描述}_tl} 变量。
% \begin{macrocode}
\cs_new_protected:Npn \@@_box_spread_name:Nn #1#2
{ \@@_box_spread:NNv #1 \c_empty_tl { c_@@_name_ #2 _tl } }
@@ -3184,9 +3207,9 @@ To produce the documentation run the original source files ending with
% \item |dim| 型变量
% \item 文本 |clist|
% \end{arguments}
-% 当 \cs{l_@@_tmpa_clist} 非空时,弹出最后一个元素赋给 \cs{l_@@_tmpa_tl},
+% 当 \cs{l_@@_tmp_clist} 非空时,弹出最后一个元素赋给 \cs{l_@@_tmpa_tl},
% 获取其长度后与 |#1| 进行比较,二者中较大的那一个将成为 |#1| 的新值。
-% 不断循环,直至 \cs{l_@@_tmpa_clist} 为空。
+% 不断循环,直至 \cs{l_@@_tmp_clist} 为空。
% \begin{macrocode}
\cs_new:Npn \@@_get_max_width:NN #1#2
{
@@ -3199,55 +3222,53 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_full_uline:Nn,\@@_full_uline:Nx}
+% \begin{macro}{\@@_get_width_print:Nn,\@@_get_width_print:Nv,
+% \@@_get_width_print:Nx}
% 横跨整页的下划线。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
% \end{arguments}
-% 先使用 \cs{@@_get_text_width:Nn} 获取文本内容宽度,
+% 先使用 \cs{@@_get_width:Nn} 获取文本内容到右边距的宽度,
% 该宽度存储在调用的 |dim| 型变量中。随后输出文本内容。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_full_uline:Nn #1#2
+\cs_new_protected:Npn \@@_get_width_print:Nn #1#2
{
\@@_get_width:Nn #1 { #2 }
\dim_set:Nn #1 { \textwidth - #1 } #2
}
-\cs_generate_variant:Nn \@@_full_uline:Nn { Nx }
+\cs_generate_variant:Nn \@@_get_width_print:Nn { Nv }
+\cs_generate_variant:Nn \@@_get_width_print:Nn { Nx }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_uline_entry:Nnnn}
+% \begin{macro}{\@@_uline_entry:Nn}
% 生成占整页宽度的下划线条目。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
-% \item 文本
-% \item 分隔符
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_uline_entry:Nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_uline_entry:Nn #1#2
{
- \@@_full_uline:Nx #1 { \@@_name:n { #2 } #4 }
- \@@_box_ulined_info:Nn #1 { #3 }
+ \@@_get_width_print:Nv #1 { c_@@_name_ #2 _tl }
+ \@@_box_ulined_info:Nn #1 { #2 }
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_uline_bientry:Nnnn}
+% \begin{macro}{\@@_uline_bientry:Nn}
% 生成占半页宽度的下划线条目。
% \begin{arguments}
% \item 宽度,|dim| 型变量
% \item 文本
-% \item 文本
-% \item 分隔符
% \end{arguments}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_uline_bientry:Nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_uline_bientry:Nn #1#2
{
- \@@_full_uline:Nx #1 { \@@_name:n { #2 } #4 }
+ \@@_get_width_print:Nv #1 { c_@@_name_ #2 _tl }
\dim_sub:Nn #1 { \textwidth / 2 }
- \@@_box_ulined_info:Nn #1 { #3 }
+ \@@_box_ulined_info:Nn #1 { #2 }
}
% \end{macrocode}
% \end{macro}
@@ -3677,10 +3698,10 @@ To produce the documentation run the original source files ending with
bottom-skip = \l_@@_bottom_skip,
align =
{
- l = { \cs_set_eq:NN \@@_align: \raggedright },
- r = { \cs_set_eq:NN \@@_align: \raggedleft },
- c = { \cs_set_eq:NN \@@_align: \centering },
- n = { \__nju_cs_clear:N \@@_align: }
+ l = { \cs_set_eq:NN \@@_align: \raggedright },
+ r = { \cs_set_eq:NN \@@_align: \raggedleft },
+ c = { \cs_set_eq:NN \@@_align: \centering },
+ n = { \cs_set:Nn \@@_align: { } }
}
}
{
@@ -3802,9 +3823,9 @@ To produce the documentation run the original source files ending with
% \changes{v1.0}{2022/06/30}{修改类型选项。}
% 学位,默认为学士。
% \begin{macrocode}
- type .choices:nn = { bachelor, master, doctor, postdoc }
+ type .choices:nn = { bachelor, master, doctor, postdoc }
{ \int_gset_eq:NN \g_@@_info_type_int \l_keys_choice_int },
- type .initial:n = bachelor,
+ type .initial:n = bachelor,
% \end{macrocode}
% \end{macro}
%
@@ -3812,9 +3833,12 @@ To produce the documentation run the original source files ending with
% \changes{v1.0}{2022/06/30}{修改学位选项。}
% 研究生的学位类型,默认为学术学位。
% \begin{macrocode}
- degree .choices:nn = { academic, professional }
- { \int_gset_eq:NN \g_@@_info_degree_int \l_keys_choice_int },
- degree .initial:n = academic,
+ degree .choice:,
+ degree / academic .code:n =
+ { \bool_set_true:N \g_@@_opt_academic_bool },
+ degree / professional .code:n =
+ { \bool_set_false:N \g_@@_opt_academic_bool },
+ degree .initial:n = academic,
% \end{macrocode}
% \end{macro}
%
@@ -3822,8 +3846,8 @@ To produce the documentation run the original source files ending with
% 是否需要国家图书馆封面。本选项仅用于研究生模板,默认关闭。
% \footnote{nl 代表 National Library。}
% \begin{macrocode}
- nl-cover .bool_set:N = \g_@@_opt_nlcover_bool,
- nl-cover .initial:n = false,
+ nl-cover .bool_set:N = \g_@@_opt_nlcover_bool,
+ nl-cover .initial:n = false,
% \end{macrocode}
% \end{macro}
%
@@ -3834,8 +3858,8 @@ To produce the documentation run the original source files ending with
% \footnote{原创性声明的英文翻译为 Declaration of Originality,
% 为了使选项表义更清晰同时缩减名称长度,将其修改为“声明页”这一名称。}
% \begin{macrocode}
- decl-page .bool_set:N = \g_@@_opt_decl_bool,
- decl-page .initial:n = false,
+ decl-page .bool_set:N = \g_@@_opt_decl_bool,
+ decl-page .initial:n = false,
% \end{macrocode}
% \end{macro}
%
@@ -3843,8 +3867,8 @@ To produce the documentation run the original source files ending with
% \changes{v0.13}{2021/12/15}{新增草稿模式选项。}
% 是否开启草稿模式(默认关闭)。
% \begin{macrocode}
- draft .bool_gset:N = \g_@@_opt_draft_bool,
- draft .initial:n = false,
+ draft .bool_gset:N = \g_@@_opt_draft_bool,
+ draft .initial:n = false,
% \end{macrocode}
% \end{macro}
%
@@ -3852,9 +3876,9 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2022/01/14}{新增单双面模式选项。}
% 单双面模式(默认为双面)。
% \begin{macrocode}
- oneside .value_forbidden:n = true,
- twoside .value_forbidden:n = true,
- oneside .bool_gset_inverse:N = \g_@@_opt_twoside_bool,
+ oneside .value_forbidden:n = true,
+ twoside .value_forbidden:n = true,
+ oneside .bool_gset_inverse:N = \g_@@_opt_twoside_bool,
% \end{macrocode}
% \end{macro}
%
@@ -3864,8 +3888,8 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\g_@@_opt_anon_bool}
% 盲审模式。
% \begin{macrocode}
- anonymous .bool_set:N = \g_@@_opt_anon_bool,
- anonymous .initial:n = false,
+ anonymous .bool_set:N = \g_@@_opt_anon_bool,
+ anonymous .initial:n = false,
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3874,10 +3898,10 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2021/12/12}{简化字体选项名称。}
% 中英文字体选项。
% \begin{macrocode}
- latin-font .choices:nn =
+ latin-font .choices:nn =
{ gyre, mac, win, none }
{ \tl_set_eq:NN \g_@@_font_latin_tl \l_keys_choice_tl },
- cjk-font .choices:nn =
+ cjk-font .choices:nn =
{ fandol, founder, mac, noto, source, win, none }
{ \tl_set_eq:NN \g_@@_font_cjk_tl \l_keys_choice_tl },
% \end{macrocode}
@@ -3888,23 +3912,23 @@ To produce the documentation run the original source files ending with
% 数学字体选项。
% 由 \pkg{unicode-math} 指定 \XeTeX 和 \LuaTeX 下使用的数学字体。
% \begin{macrocode}
- math-font .choices:nn =
+ math-font .choices:nn =
{
asana, cambria, fira, garamond, lm, libertinus, newcm,
stix, bonum, dejavu, pagella, schola, termes, xits, none
}
{ \tl_set_eq:NN \g_@@_font_math_tl \l_keys_choice_tl },
- math-font .initial:n = xits,
+ math-font .initial:n = xits,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{font-path}
% 独立字体文件的路径。
% \begin{macrocode}
- font-path .code:n =
+ font-path .code:n =
{
\bool_set_true:N \g_@@_font_path_bool
- \tl_set_eq:NN \g_@@_font_path_tl \l_keys_choice_tl
+ \tl_set_eq:NN \g_@@_font_path_tl \l_keys_value_tl
},
% \end{macrocode}
% \end{macro}
@@ -3914,8 +3938,8 @@ To produce the documentation run the original source files ending with
% \begin{macro}{\g_@@_opt_zihao_tl}
% 字号。默认为小四号。
% \begin{macrocode}
- zihao .tl_set:N = \g_@@_opt_zihao_tl,
- zihao .initial:n = -4,
+ zihao .tl_set:N = \g_@@_opt_zihao_tl,
+ zihao .initial:n = -4,
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3927,8 +3951,8 @@ To produce the documentation run the original source files ending with
% Word 行距,故默认值为 $1.5\times\frac{1.3}{1.2} = 1.625$。
% 更详细的说明请参考 \pkg{zhlineskip} 宏包文档。
% \begin{macrocode}
- linespread .tl_set:N = \g_@@_opt_linespread_tl,
- linespread .initial:n = 1.625,
+ linespread .tl_set:N = \g_@@_opt_linespread_tl,
+ linespread .initial:n = 1.625,
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3937,7 +3961,7 @@ To produce the documentation run the original source files ending with
% \changes{v0.16}{2022/02/23}{新增 \opt{config} 选项。}
% 配置文件路径。
% \begin{macrocode}
- config .clist_set:N = \g_@@_config_clist
+ config .clist_set:N = \g_@@_config_clist
}
% \end{macrocode}
% \end{macro}
@@ -4035,6 +4059,13 @@ To produce the documentation run the original source files ending with
{ \tl_const:Nn \c_@@_name_pagemode_tl { oneside } }
% \end{macrocode}
%
+% \changes{v1.1}{2022/09/26}{盲审模式下不显示声明页。}
+% 盲审模式下不显示声明页。
+% \begin{macrocode}
+\bool_if:NT \g_@@_opt_anon_bool
+ { \bool_set_false:N \g_@@_opt_decl_bool }
+% \end{macrocode}
+%
%
% \subsection{用户接口}
%
@@ -4053,6 +4084,19 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_keys_set:nn}
+% \changes{v1.1}{2022/09/26}{使用 \cs{keys_set_filter:nnn} 重构盲审模式。}
+% 在开启盲审模式时,屏蔽被编入 \opt{annoymous} 分组的键值对输入。
+% \begin{macrocode}
+\bool_if:NTF \g_@@_opt_anon_bool
+ {
+ \cs_new:Npn \@@_keys_set:nn #1#2
+ { \keys_set_filter:nnn {#1} { anonymous } {#2} }
+ }
+ { \cs_new_eq:NN \@@_keys_set:nn \keys_set:nn }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\njusetup}
% \changes{v0.6}{2021/09/10}{改用键值对输入信息。}
% \changes{v1.0}{2022/08/01}{增加输入键路径的可选参数。}
@@ -4070,11 +4114,11 @@ To produce the documentation run the original source files ending with
\NewDocumentCommand \njusetup { o m }
{
\tl_if_novalue:nTF { #1 }
- { \keys_set:nn { nju } { #2 } }
+ { \@@_keys_set:nn { nju } { #2 } }
{
\tl_if_in:nnTF { #1 } { / }
- { \keys_set:nn { nju } { #1 = {#2} } }
- { \keys_set:nn { nju / #1 } {#2} }
+ { \@@_keys_set:nn { nju } { #1 = {#2} } }
+ { \@@_keys_set:nn { nju / #1 } {#2} }
}
}
% \end{macrocode}
@@ -4182,10 +4226,13 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\clist_map_inline:nn
{
- { no-math } { fontspec },
- { perpage } { footmisc },
- { capitalise, nameinlink, noabbrev }
- { cleveref }
+% \end{macrocode}
+% 隐藏 |does not contain script "CJK"| 警告。
+% \begin{macrocode}
+ { quiet } { xeCJK },
+ { no-math } { fontspec },
+ { perpage } { footmisc },
+ { capitalise, nameinlink, noabbrev } { cleveref }
}
{ \PassOptionsToPackage #1 }
% \end{macrocode}
@@ -4274,7 +4321,7 @@ To produce the documentation run the original source files ending with
\sys_if_engine_luatex:T
{
\RequirePackage { lua-ul }
- \NewDocumentCommand \njuline { m } { \underLine{#1} \null }
+ \NewDocumentCommand \njuline { m } { \underLine{#1} \@@_null: }
}
% \end{macrocode}
% \end{macro}
@@ -4407,10 +4454,10 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2022/01/14}{将标题断行控制符修改为 |\\|。}
% 题目。中文题目可使用 |\\| 手动断行。以下标注星号(|*|)的皆为对应的英文字段。
% \begin{macrocode}
- title .tl_set:N = \g_@@_info_title_tl,
- title .initial:n = { 空 },
- title* .tl_set:N = \g_@@_info_title_en_tl,
- title* .initial:n = { Empty },
+ title .tl_set:N = \g_@@_info_title_tl ,
+ title .initial:n = { 空 } ,
+ title* .tl_set:N = \g_@@_info_title_en_tl ,
+ title* .initial:n = { Empty } ,
% \end{macrocode}
% \end{macro}
%
@@ -4418,30 +4465,30 @@ To produce the documentation run the original source files ending with
% \changes{v0.11}{2021/10/01}{修改了添加关键词的方式。}
% 关键词列表。
% \begin{macrocode}
- keywords .clist_set:N = \g_@@_info_keywords_clist,
- keywords* .clist_set:N = \g_@@_info_keywords_en_clist,
+ keywords .clist_set:N = \g_@@_info_keywords_clist ,
+ keywords* .clist_set:N = \g_@@_info_keywords_en_clist ,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/grade,info/student-id,info/author,info/author*}
% 年级、学号、姓名。
% \begin{macrocode}
- grade .tl_set:N = \g_@@_info_grade_tl,
- student-id .tl_set:N = \g_@@_info_id_tl,
- author .tl_set:N = \g_@@_info_author_tl,
- author* .tl_set:N = \g_@@_info_author_en_tl,
+ grade .tl_set:N = \g_@@_info_grade_tl ,
+ student-id .tl_set:N = \g_@@_info_id_tl ,
+ author .tl_set:N = \g_@@_info_author_tl ,
+ author* .tl_set:N = \g_@@_info_author_en_tl ,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/department,info/department*,info/major,info/major*,info/field,info/field*}
% 院系、专业、方向。
% \begin{macrocode}
- department .tl_set:N = \g_@@_info_dept_tl,
- department* .tl_set:N = \g_@@_info_dept_en_tl,
- major .tl_set:N = \g_@@_info_major_tl,
- major* .tl_set:N = \g_@@_info_major_en_tl,
- field .tl_set:N = \g_@@_info_field_tl,
- field* .tl_set:N = \g_@@_info_field_en_tl,
+ department .tl_set:N = \g_@@_info_dept_tl ,
+ department* .tl_set:N = \g_@@_info_dept_en_tl ,
+ major .tl_set:N = \g_@@_info_major_tl ,
+ major* .tl_set:N = \g_@@_info_major_en_tl ,
+ field .tl_set:N = \g_@@_info_field_tl ,
+ field* .tl_set:N = \g_@@_info_field_en_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4450,16 +4497,16 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2022/01/12}{精简导师信息选项。}
% 导师信息。中文导师全称使用 |clist| 存储,便于在本科生封面中进行分割。
% \begin{macrocode}
- supervisor .clist_set:N = \g_@@_info_supv_clist,
- supervisor* .tl_set:N = \g_@@_info_supv_en_tl,
+ supervisor .clist_set:N = \g_@@_info_supv_clist ,
+ supervisor* .tl_set:N = \g_@@_info_supv_en_tl ,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/supervisor-ii,info/supervisor-ii*}
% 第二导师信息。
% \begin{macrocode}
- supervisor-ii .clist_set:N = \g_@@_info_supvii_clist,
- supervisor-ii* .tl_set:N = \g_@@_info_supvii_en_tl,
+ supervisor-ii .clist_set:N = \g_@@_info_supvii_clist ,
+ supervisor-ii* .tl_set:N = \g_@@_info_supvii_en_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4467,8 +4514,8 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2022/01/14}{精简提交日期选项。}
% 提交日期,初始值为编译当天日期。
% \begin{macrocode}
- submit-date .tl_set:N = \g_@@_info_submitdate_raw_tl,
- submit-date .initial:V = \c_@@_today_tl,
+ submit-date .tl_set:N = \g_@@_info_submitdate_raw_tl ,
+ submit-date .initial:V = \c_@@_today_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4476,8 +4523,8 @@ To produce the documentation run the original source files ending with
% \changes{v0.14}{2022/01/14}{精简答辩日期选项。}
% 答辩日期。
% \begin{macrocode}
- defend-date .tl_set:N = \g_@@_info_defenddate_raw_tl,
- defend-date .initial:V = \c_@@_today_tl,
+ defend-date .tl_set:N = \g_@@_info_defenddate_raw_tl ,
+ defend-date .initial:V = \c_@@_today_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4485,8 +4532,8 @@ To produce the documentation run the original source files ending with
% \changes{v0.19}{2022/05/23}{新增国家图书馆封面的学位授予日期设置项。}
% 学位授予日期。
% \begin{macrocode}
- confer-date .tl_set:N = \g_@@_info_conferdate_raw_tl,
- confer-date .initial:V = \c_@@_today_tl,
+ confer-date .tl_set:N = \g_@@_info_conferdate_raw_tl ,
+ confer-date .initial:V = \c_@@_today_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4494,26 +4541,26 @@ To produce the documentation run the original source files ending with
% \changes{v0.19}{2022/05/23}{新增国家图书馆封面的底部日期设置项。}
% 底部日期。
% \begin{macrocode}
- bottom-date .tl_set:N = \g_@@_info_bottomdate_raw_tl,
- bottom-date .initial:V = \c_@@_today_tl,
+ bottom-date .tl_set:N = \g_@@_info_bottomdate_raw_tl ,
+ bottom-date .initial:V = \c_@@_today_tl ,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/defend-date,info/chairman,info/reviewer}
% 答辩委员会信息。
% \begin{macrocode}
- chairman .tl_set:N = \g_@@_info_chairman_tl,
- reviewer .clist_set:N = \g_@@_info_reviewer_clist,
+ chairman .tl_set:N = \g_@@_info_chairman_tl ,
+ reviewer .clist_set:N = \g_@@_info_reviewer_clist ,
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{info/clc,info/secret-level,info/udc,info/supervisor-contact}
% 国家图书馆封面相关信息。
% \begin{macrocode}
- clc .tl_set:N = \g_@@_info_clc_tl,
- secret-level .tl_set:N = \g_@@_info_secretlv_tl,
- udc .tl_set:N = \g_@@_info_udc_tl,
- supervisor-contact .tl_set:N = \g_@@_info_supvcont_tl,
+ clc .tl_set:N = \g_@@_info_clc_tl ,
+ secret-level .tl_set:N = \g_@@_info_secretlv_tl ,
+ udc .tl_set:N = \g_@@_info_udc_tl ,
+ supervisor-contact .tl_set:N = \g_@@_info_supvcont_tl ,
% \end{macrocode}
% \end{macro}
%
@@ -4523,56 +4570,33 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
email .tl_set:N = \g_@@_info_email_tl
}
+\clist_map_inline:Nn \c_@@_name_anon_clist
+ { \keys_define:nn { nju / info } { #1 .groups:n = { anonymous } } }
+\clist_map_inline:Nn \c_@@_name_anon_en_clist
+ { \keys_define:nn { nju / info } { #1 * .groups:n = { anonymous } } }
% \end{macrocode}
% \end{macro}
%
-% \changes{v0.16}{2022/03/06}{正确处理学位和类型信息。}
-% 设置学位信息。该设置需要放在 \tn{ProcessKeysOptions}
-% 命令以及载入配置文件中的常量信息后进行。
-% \begin{macrocode}
-\tl_set:Nx \g_@@_info_type_tl
- {
- \clist_item:Nn \c_@@_name_type_clist
- { \g_@@_info_type_int }
- }
-\tl_set:Nx \g_@@_info_degree_tl
- {
- \g_@@_info_type_tl
- \clist_item:Nn \c_@@_name_degree_clist
- { \g_@@_info_degree_int }
- }
-% \end{macrocode}
-%
% \changes{v0.15}{2022/01/22}{正确处理双导师信息。}
% 在导言区录入用户信息后进行变量设置。此处使用到了 \pkg{ctex} 提供的命令,
% 应当位于载入文档类之后。
% \begin{macrocode}
-\ctex_at_end_preamble:n
+\@@_at_begin_document:n
{
% \end{macrocode}
-% 设置类型信息。
-% \begin{macrocode}
- \tl_set:Nx \g_@@_info_type_en_tl
- { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
-% \end{macrocode}
% 拼合双导师的姓名和职称。
% \begin{macrocode}
- \bool_set:Nn \l_@@_second_supvbool
- { ! \clist_if_empty_p:N \g_@@_info_supvii_clist }
- \tl_set:Nx \g_@@_info_supvfull_tl
+ \clist_map_inline:nn
+ { \g_@@_info_supv_clist, \g_@@_info_supvii_clist }
{
- \clist_use:Nn \g_@@_info_supv_clist { \@@_hskip: }
- \bool_if:NT \l_@@_second_supvbool
- {
- \@@_quad:
- \clist_use:Nn \g_@@_info_supvii_clist { \@@_hskip: }
- }
+ \tl_gput_right:Nx \g_@@_info_supvfull_tl
+ { \clist_use:Nn #1 { \@@_hskip: } \@@_quad: }
}
- \tl_set:Nx \g_@@_info_supvfull_en_tl
+ \tl_gput_right:Nn \g_@@_info_supvfull_tl { \tex_unskip:D }
+ \tl_set:Nn \g_@@_info_supvfull_en_tl
{
- \g_@@_info_supv_en_tl
- \bool_if:NT \l_@@_second_supvbool
- { \@@_quad: \g_@@_info_supvii_en_tl }
+ \g_@@_info_supv_en_tl \@@_quad:
+ \g_@@_info_supvii_en_tl \tex_unskip:D
}
}
%</class>
@@ -4624,22 +4648,46 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{variable}
%
-% 盲审模式下抹去个人信息和学校名称。
+% \changes{v0.16}{2022/03/06}{正确处理学位和类型信息。}
+% 设置学位信息。该设置需要放在 \tn{ProcessKeysOptions} 命令后进行。
+%
+% \begin{variable}{\g_@@_info_type_tl}
+% 文档类型字样。
+% \begin{macrocode}
+%<*def-g>
+\tl_new:N \g_@@_info_type_tl
+\tl_set:Nx \g_@@_info_type_tl
+ { \clist_item:Nn \c_@@_name_type_clist { \g_@@_info_type_int } }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_info_type_en_tl}
+% 英文的学位字样。
+% \begin{macrocode}
+\tl_new:N \g_@@_info_type_en_tl
+\tl_set:Nx \g_@@_info_type_en_tl
+ { \clist_item:Nn \c_@@_name_type_en_clist { \g_@@_info_type_int } }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\g_@@_info_degree_tl}
+% 学位类型字样。
+% \begin{macrocode}
+\tl_new:N \g_@@_info_degree_tl
+\tl_set_eq:NN \g_@@_info_degree_tl \g_@@_info_type_tl
+\bool_if:NF \g_@@_opt_academic_bool
+ { \tl_put_right:Nn \g_@@_info_degree_tl { 专业 } }
+%</def-g>
+% \end{macrocode}
+% \end{variable}
+%
+% 盲审模式下抹去学校名称。
% \begin{macrocode}
%<*class>
\bool_if:NT \g_@@_opt_anon_bool
{
- \ctex_at_end_preamble:n
- {
- \clist_map_inline:Nn \c_@@_name_anon_clist
- { \tl_gclear:c { g_@@_info_ #1 _tl } }
- \clist_map_inline:Nn \c_@@_name_anon_en_clist
- { \tl_gclear:c { g_@@_info_ #1 _en_tl } }
- \clist_map_inline:Nn \c_@@_name_anonlist_clist
- { \clist_gclear:c { g_@@_info_ #1 _clist } }
- \tl_gclear:N \c_@@_name_nju_tl
- \tl_gclear:N \c_@@_name_nju_en_tl
- }
+ \tl_gclear:N \c_@@_name_nju_tl
+ \tl_gclear:N \c_@@_name_nju_en_tl
}
% \end{macrocode}
%
@@ -4789,17 +4837,18 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_loadfont_cjk_mac:
{
\@@_hide_no_script_msg:
- \setCJKmainfont{Songti~SC~Light}[
- BoldFont=Songti~SC~Bold,
- ItalicFont=Kaiti~SC,
- BoldItalicFont=Kaiti~SC~Bold]
- \setCJKsansfont{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
- \setCJKmonofont{STFangsong}
- \setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
- \setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
- \setCJKfamilyfont{zhfs}{STFangsong}
- \setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
- \setCJKfamilyfont{zhnewhei}{PingFang~SC}
+ \setCJKmainfont { Songti~SC~Light }
+ [
+ BoldFont = Songti~SC~Bold,
+ ItalicFont = Kaiti~SC,
+ BoldItalicFont = Kaiti~SC~Bold
+ ]
+ \setCJKsansfont { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+ \setCJKmonofont { STFangsong }
+ \setCJKfamilyfont { zhsong } { Songti~SC~Light } [ BoldFont = Songti~SC~Bold ]
+ \setCJKfamilyfont { zhhei } { Heiti~SC~Light } [ BoldFont = Heiti~SC~Medium ]
+ \setCJKfamilyfont { zhfs } { STFangsong }
+ \setCJKfamilyfont { zhkai } { Kaiti~SC } [ BoldFont = Kaiti~SC~Bold ]
}
% \end{macrocode}
% \end{macro}
@@ -4851,7 +4900,8 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_loadfont_cjk_founder:
{
% \end{macrocode}
-% 调整方正字体括号位置。\footnote{\XeTeX 的调整方法来自 \url{https://www.zhihu.com/question/46241367/answer/101660183}。}
+% 调整方正字体括号位置。
+% \footnote{\XeTeX 的调整方法来自 \url{https://www.zhihu.com/question/46241367/answer/101660183}。}
% \begin{macrocode}
\sys_if_engine_xetex:T
{ \xeCJKEditPunctStyle {quanjiao} { optimize-kerning = true } }
@@ -5502,14 +5552,6 @@ To produce the documentation run the original source files ending with
% \end{variable}
%
% \begin{macrocode}
-\msg_new:nnn { njuthesis } { extra-bib-style }
- {
- Wrongly-placed~ bib~ style.\\
- Please~ use~ the~ `bib/style`~ field.
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
\keys_define:nn { nju / bib }
{
% \end{macrocode}
@@ -5543,17 +5585,13 @@ To produce the documentation run the original source files ending with
% \changes{v0.15}{2022/02/15}{提供传入 \pkg{biblatex} 宏包选项的接口。}
% 待传入 \pkg{biblatex} 的额外宏包选项,以列表形式储存。
% 更为常见的参考文献样式设置已由 \opt{bib/style} 提供,
-% 此处对重复的样式设置进行了检查。本设置项等效于在导言区使用
-% |\PassoptionToPackage{|\meta{key}|=|\meta{value}|}{biblatex}| 命令。
+% 两者中后传入的设置会覆盖已有的设定。本设置项等效于在导言区使用
+% |\PassoptionsToPackage{|\meta{key}|=|\meta{value}|}{biblatex}| 命令。
% \begin{macrocode}
option .code:n =
{
- \tl_if_in:VnTF \l_keys_value_tl { style = }
- { \msg_error:nn { njuthesis } { extra-bib-style } }
- {
\clist_gput_right:NV \g_@@_blx_option_clist
\l_keys_value_tl
- }
},
% \end{macrocode}
% \end{macro}
@@ -5563,10 +5601,7 @@ To produce the documentation run the original source files ending with
% 参考文献数据源,以列表形式储存。
% \begin{macrocode}
resource .code:n =
- {
- \clist_gput_right:NV \g_@@_blx_resource_clist
- \l_keys_value_tl
- },
+ { \clist_gput_right:NV \g_@@_blx_resource_clist \l_keys_value_tl },
}
% \end{macrocode}
% \end{macro}
@@ -5592,8 +5627,7 @@ To produce the documentation run the original source files ending with
{
\cs_undefine:N \addbibresource
\clist_gput_right:Nn \g_@@_blx_option_clist { backend = biber }
- \exp_args:NV \PassOptionsToPackage
- \g_@@_blx_option_clist { biblatex }
+ \exp_args:NV \PassOptionsToPackage \g_@@_blx_option_clist { biblatex }
}
% \end{macrocode}
% \end{macro}
@@ -5626,9 +5660,9 @@ To produce the documentation run the original source files ending with
% 使用 \pkg{etoolbox} 提供的 \tn{BeforeBeginEnvironment},在 \env{document} 环境
% 开始的钩子前载入 \pkg{biblatex} 并进行相关设置。
% \begin{macrocode}
-\BeforeBeginEnvironment { document }
+\bool_if:NT \g_@@_opt_load_blx_bool
{
- \bool_if:NT \g_@@_opt_load_blx_bool
+ \BeforeBeginEnvironment { document }
{
\@@_blx_pre_setup:
\RequirePackage { biblatex }
@@ -5704,61 +5738,105 @@ To produce the documentation run the original source files ending with
%
% \subsection{脚注}
% \changes{v0.18}{2022/05/01}{提供脚注设置项。}
-% ^^A 来自 fduthesis
+% ^^A 借鉴 fduthesis
+%
+% \begin{variable}{\g_@@_fn_ctext_option_clist}
+% 存储传入 \pkg{circledtext} 宏包的选项列表。
+% 由于当前版本放在编号位置的带圈数字无法正确缩放,这里手动指定了字体大小。
+% \begin{macrocode}
+\clist_set:Nn \g_@@_fn_ctext_option_clist { charf = \scriptsize }
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macrocode}
-\tl_new:N \g_@@_fn_style_tl
\keys_define:nn { nju / footnote }
{
% \end{macrocode}
% \begin{macro}{footnote/style}
+% \changes{v1.1}{2022/10/16}{增加 \opt{circled} 和 \opt{circled*} 选项。}
+% 脚注编号的样式。
% \begin{macrocode}
- style .choices:nn = { plain, pifont }
+ style .choices:nn = { plain, pifont, circled, circled* }
+ {
+ \int_case:nnF { \l_keys_choice_int }
+ {
% \end{macrocode}
-% 若使用 \opt{pifont} 类型,则需引入 \pkg{pifont} 宏包。
+% \opt{pifont} 类型,用作对旧发行版的兼容选项。
% \begin{macrocode}
- {
- \tl_gset_eq:NN \g_@@_fn_style_tl \l_keys_choice_tl
- \int_compare:nT { \l_keys_choice_int = 2 }
- { \RequirePackage { pifont } }
- }
- }
+ { 2 }
+ {
+ \RequirePackage { pifont }
+ \cs_set_eq:NN \@@_fn_number:N \@@_fn_number_pifont:N
+ }
+% \end{macrocode}
+% \opt{circled} 类型,带星号的版本为阴文,需引入 \pkg{circledtext} 宏包。
+% \begin{macrocode}
+ { 3 }
+ {
+ \RequirePackage { circledtext }
+ \cs_set:Npn \@@_fn_number:N
+ { \@@_fn_number_circled:NV \c_false_bool }
+ }
+ { 4 }
+ {
+ \RequirePackage { circledtext }
+ \cs_set:Npn \@@_fn_number:N
+ { \@@_fn_number_circled:NV \c_true_bool }
+ }
+ }
+% \end{macrocode}
+% \opt{plain} 或未知类型直接使用计数器的值。
+% \begin{macrocode}
+ { \cs_set_eq:NN \@@_fn_number:N \int_use:N }
+ },
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_fn_symbol_pifont:n}
-% \opt{pifont} 普通版。以下四种都只包含 \numrange{1}{10}。
+% \begin{macro}{footnote/circledtext-option}
+% \changes{v1.1}{2022/10/16}{将生成脚注圈码的 \pkg{pifont} 替换为 \pkg{circledtext}。}
+% \pkg{circledtext} 宏包选项。
% \begin{macrocode}
-\cs_new:Npn \@@_fn_symbol_pifont:n #1
- { \ding { \int_eval:n { 171 + #1 } } }
+ circledtext-option .code:n =
+ { \clist_gput_right:Nn \g_@@_fn_ctext_option_clist {#1} },
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_footnote_number:N}
-% 脚注编号样式。
+% \begin{macro}{footnote/hang}
+% \changes{v1.1}{2022/10/16}{新增悬挂缩进选项。}
+% 是否悬挂缩进。
% \begin{macrocode}
-\tl_const:Nn \c_@@_fn_style_plain_tl { plain }
-\tl_const:Nn \c_@@_fn_style_pifont_tl { pifont }
-\cs_new:Npn \@@_footnote_number:N #1
- {
- \tl_case:NnF \g_@@_fn_style_tl
- {
+ hang .bool_gset:N = \g_@@_fn_hang_bool,
+ hang .initial:n = true
+ }
% \end{macrocode}
-% \opt{plain} 类型直接使用计数器 |footnote| 的值。
+% \end{macro}
+%
+% \begin{macro}{\@@_fn_number_pifont:N}
+% \opt{pifont} 选项提供的带圈数字。
% \begin{macrocode}
- \c_@@_fn_style_plain_tl
- { \int_use:N #1 }
+\cs_new:Npn \@@_fn_number_pifont:N #1 { \ding { \int_eval:n { 171 + #1 } } }
% \end{macrocode}
-% \opt{pifont} 类型无需进行额外的操作。
+% \end{macro}
+%
+% \begin{macro}{\@@_fn_number_circled:Nn,\@@_fn_number_circled:NV}
+% \opt{circled} 选项提供的带圈数字。
% \begin{macrocode}
- \c_@@_fn_style_pifont_tl
- { \@@_fn_symbol_pifont:n {#1} }
- }
+\cs_generate_variant:Nn \__circledtext_handle:nn { Vn }
+\cs_new_protected:Npn \@@_fn_number_circled:Nn #1#2
+ {
+ \group_begin:
+ \bool_set_eq:NN \l__circledtext_negative_bool #1
+ \__circledtext_handle:Vn \g_@@_fn_ctext_option_clist { #2 }
+ \group_end:
+ }
+\cs_generate_variant:Nn \@@_fn_number_circled:Nn { NV }
% \end{macrocode}
-% 变量 \cs{l_@@_fn_style_tl} 保存的类型未知时,默认使用 \opt{plain}
-% 类型。
+% \end{macro}
+%
+% \begin{macro}{\@@_fn_number:N}
+% 脚注编号。默认使用计数器 |footnote| 的值。
% \begin{macrocode}
- { \int_use:N #1 }
- }
+\cs_new_eq:NN \@@_fn_number:N \int_use:N
% \end{macrocode}
% \end{macro}
%
@@ -5767,21 +5845,28 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\bool_if:NT \g_@@_opt_load_fm_bool
{
- \cs_set:Npn \thefootnote { \@@_footnote_number:N \c@footnote }
+ \cs_set:Npn \thefootnote { \@@_fn_number:N \c@footnote }
% \end{macrocode}
% \end{macro}
%
% \subsubsection{整体样式}
%
% \begin{macro}[int]{\@makefntext}
-% 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \qty{1.5}{em}。
+% 重定义内部脚注文字命令,使脚注编号不使用上标,宽度为 \qty{1.5}{em}
% \footnote{\url{http://tex.stackexchange.com/q/19844},
-% \url{https://www.zhihu.com/question/53030087}}
+% \url{https://www.zhihu.com/question/53030087}},
+% 并自行实现悬挂缩进。注意这个操作会使 \pkg{footmisc} 宏包内建的 \opt{hang} 选项失效。
% \begin{macrocode}
\cs_set:Npn \@makefntext #1
{
\mode_leave_vertical:
- \hbox_to_wd:nn { 1.5 em } { \@thefnmark \tex_hfil:D }
+ \hbox_to_wd:nn { \c_@@_fnhang_dim } { \@thefnmark \tex_hfil:D }
+ \tex_penalty:D \@M
+ \bool_if:NT \g_@@_fn_hang_bool
+ {
+ \int_set:Nn \tex_hangafter:D { 1 }
+ \dim_set_eq:NN \tex_hangindent:D \c_@@_fnhang_dim
+ }
#1
}
}
@@ -5792,7 +5877,7 @@ To produce the documentation run the original source files ending with
% \subsection{图片表格}
%
% \begin{macro}{image/path}
-% \changes{v1.0}{2021/08/06}{提供图片路径设置。}
+% \changes{v1.0}{2022/08/06}{提供图片路径设置。}
% 外置图片路径,等效于 \tn{graphicspath}。
% \begin{macrocode}
\keys_define:nn { nju / image } { path .code:n = { \graphicspath {#1} } }
@@ -5860,7 +5945,7 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
% \begin{macro}{label-sep/figure,label-sep/table,label-sep/equation}
-% \changes{1.0}{2022/07/31}{添加编号连接符设置项。}
+% \changes{v1.0}{2022/07/31}{添加编号连接符设置项。}
% 修改图片、表格、公式编号中的连接符。
% \footnote{\url{https://tex.stackexchange.com/q/61756/}}
% \begin{macrocode}
@@ -5929,10 +6014,26 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{theorem/type,theorem/define}
-% 定义和创建定理类环境的接口。
+% \begin{macro}{theorem/type}
+% 定义定理类环境。
+% \begin{macrocode}
+ type .clist_gset:N = \g_@@_thm_type_clist,
+ type .initial:n =
+ {
+ { axiom } { 公理 },
+ { corollary } { 推论 },
+ { definition } { 定义 },
+ { example } { 例 },
+ { lemma } { 引理 },
+ { proof, *+ } { 证明 },
+ { theorem } { 定理 }
+ },
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{theorem/define}
+% 创建定理类环境。
% \begin{macrocode}
- type .clist_set:N = \g_@@_thm_type_clist,
define .value_forbidden:n = true,
define .code:n =
{
@@ -6218,8 +6319,8 @@ To produce the documentation run the original source files ending with
\use:c { @@_loadfont_math_ \g_@@_font_math_tl : }
\bool_if:NT \g_@@_opt_math_leq_bool
{
- \cs_set_eq:NN \le \leslant
- \cs_set_eq:NN \ge \geslant
+ \cs_set_eq:NN \le \leqslant
+ \cs_set_eq:NN \ge \geqslant
\cs_set_eq:NN \leq \leqslant
\cs_set_eq:NN \geq \geqslant
}
@@ -6321,7 +6422,7 @@ To produce the documentation run the original source files ending with
\@@_cover_entry:NNNnn #1 \l_@@_tmpb_dim #4 { grade } { id }
\@@_cover_entry:NNNn #1 #2 #4 { author }
\@@_cover_entry_supv:NNNn #1 \l_@@_tmpb_dim #4 { supv }
- \bool_if:NT \l_@@_second_supvbool
+ \bool_if:NT \g_@@_opt_second_supv_bool
{ \@@_cover_entry_supv:NNNn #1 \l_@@_tmpb_dim #4 { supvii } }
\@@_cover_entry:NNNn #1 #2 #4 { submitdate }
}
@@ -6567,10 +6668,8 @@ To produce the documentation run the original source files ending with
{
content =
\c_@@_text_cover_en_tl \@@_vskip:
- \textsc { \clist_item:Nn \c_@@_name_type_en_clist
- { \g_@@_info_degree_int } }
- \@@_vskip: { in } \@@_vskip:
- \g_@@_info_major_en_tl,
+ \group_begin: \scshape \g_@@_info_type_en_tl \group_end:
+ \@@_vskip: { in } \@@_vskip: \g_@@_info_major_en_tl,
bottom-skip = 2 cm
}
% \end{macrocode}
@@ -6679,14 +6778,15 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_top_nl:
{
- \dim_set:Nn \l_@@_tmpa_dim { 3.2 em }
- \dim_set:Nn \l_@@_tmpb_dim { 9 em }
- \@@_box_spread_name:Nn \l_@@_tmpa_dim { clc } \@@_hskip:
- \@@_box_ulined_info:Nn \l_@@_tmpb_dim { clc } \tex_hfill:D
+ \dim_set:Nn \l_@@_tmpa_dim { 38.6 pt }
+ \dim_set:Nn \l_@@_tmpb_dim { 109 pt }
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { clc } \@@_hskip:
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { clc } \tex_hfill:D
\@@_box_spread_name:Nn \l_@@_tmpa_dim { secretlv } \@@_hskip:
\@@_box_ulined_info:Nn \l_@@_tmpb_dim { secretlv } \tex_par:D
- \@@_box_spread_name:Nn \l_@@_tmpa_dim { udc } \@@_hskip:
- \@@_box_ulined_info:Nn \l_@@_tmpb_dim { udc } \tex_hfill:D \hbox:n { }
+ \@@_box_spread_name:Nn \l_@@_tmpa_dim { udc } \@@_hskip:
+ \@@_box_ulined_info:Nn \l_@@_tmpb_dim { udc } \tex_hfill:D
+ \@@_null:
}
% \end{macrocode}
% \end{macro}
@@ -6715,20 +6815,28 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_cover_info_nl:
{
- \skip_set:Nn \l_@@_tmp_skip { 1 em plus 1 fill }
- \@@_uline_list:NNn \c_@@_name_supvinfo_tl \l_@@_tmp_skip
+ \tl_set:Nx \l_@@_tmpa_tl
{
\clist_use:Nn \g_@@_info_supv_clist { ~ }
\clist_use:Nn \g_@@_info_supvii_clist { ~ }
\@@_hskip: \g_@@_info_supvcont_tl
}
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { degree } { degree } { }
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { majorb } { major } { }
- \tex_par:D
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { submitdate } { submitdate } { }
- \@@_uline_bientry:Nnnn \l_@@_tmpa_dim { defenddate } { defenddate } { }
+ \skip_set:Nn \l_@@_tmp_skip { .5 em plus 1 fill }
+ \@@_uline_list:NNn \l_@@_tmpa_tl \l_@@_tmp_skip
+ { \c_@@_name_supvinfo_tl }
+% \end{macrocode}
+% 临时替换显示的名称字样。
+% \begin{macrocode}
+ \group_begin:
+ \tl_set_eq:NN \c_@@_name_major_tl \c_@@_name_majorb_tl
+ \@@_uline_bientry:Nn \l_@@_tmpa_dim { degree }
+ \@@_uline_bientry:Nn \l_@@_tmpa_dim { major }
+ \tex_par:D
+ \group_end:
+ \@@_uline_bientry:Nn \l_@@_tmpa_dim { submitdate }
+ \@@_uline_bientry:Nn \l_@@_tmpa_dim { defenddate }
\tex_par:D
- \@@_uline_entry:Nnnn \l_@@_tmpa_dim { confer } { confer } { }
+ \@@_uline_entry:Nn \l_@@_tmpa_dim { confer }
}
% \end{macrocode}
% \end{macro}
@@ -6850,13 +6958,14 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_degree_checkbox:n}
+% \begin{macro}{\@@_degree_checkbox:Nn}
% 信息栏的学位复选框。打勾符号对应 |U+2713|。
% \begin{macrocode}
-\cs_new_protected:Npn \@@_degree_checkbox:n #1
+\cs_new_protected:Npn \@@_degree_checkbox:Nn #1#2
{
- \int_compare:nNnTF { #1 } { = }
- { \g_@@_info_degree_int * \g_@@_info_type_int }
+ \bool_lazy_and:nnTF
+ { \g_@@_opt_academic_bool && #1 }
+ { \int_compare_p:n { \g_@@_info_type_int = #2 } }
{
\makebox [ 0 pt ] [l] { \ensuremath { \mdwhtsquare } }
\hspace { 0.1 em } \ensuremath { \checkmark }
@@ -6874,31 +6983,28 @@ To produce the documentation run the original source files ending with
\begin{tblr}
{
hlines, vlines, hspan=minimal,
- cells = {font=\normalsize},
- colspec = {cX[c]cX[c]cX[c]},
+ cells = { font = \normalsize },
+ colspec = { c X[c] c X[c] c X[c] },
cell{1}{2} = {c=5}{m}, cell{3}{2} = {c=5}{m},
cell{4}{2} = {c=5}{m}, cell{5}{2} = {c=5}{m}
}
\c_@@_name_titlec_tl & \g_@@_info_title_tl \\
\c_@@_name_ida_tl & \g_@@_info_id_tl &
\c_@@_name_depta_tl & \g_@@_info_dept_tl &
- \c_@@_name_year_tl &
+ \c_@@_name_year_tl &
\tl_range:Nnn \g_@@_info_submitdate_raw_tl {1} {4} \\
\c_@@_name_degreea_tl &
{
- \@@_degree_checkbox:n { 2 } 学术学位硕士 \qquad{}
- \@@_degree_checkbox:n { 4 } 专业学位硕士 \\
- \@@_degree_checkbox:n { 3 } 学术学位博士 \qquad{}
- \@@_degree_checkbox:n { 6 } 专业学位博士
+ \@@_degree_checkbox:Nn \c_true_bool { 2 } 学术学位硕士 \qquad
+ \@@_degree_checkbox:Nn \c_false_bool { 2 } 专业学位硕士 \\
+ \@@_degree_checkbox:Nn \c_true_bool { 3 } 学术学位博士 \qquad
+ \@@_degree_checkbox:Nn \c_false_bool { 3 } 专业学位博士
} \\
- \c_@@_name_email_tl & \g_@@_info_email_tl \\
+ \c_@@_name_email_tl & \g_@@_info_email_tl \\
\c_@@_name_supvb_tl &
- \clist_item:Nn \g_@@_info_supv_clist {1}
- \bool_if:NT \l_@@_second_supvbool
- {
- \@@_quad:
- \clist_item:Nn \g_@@_info_supvii_clist {1}
- } \\
+ \clist_item:Nn \g_@@_info_supv_clist { 1 }
+ \bool_if:NT \g_@@_opt_second_supv_bool
+ { \@@_quad: \clist_item:Nn \g_@@_info_supvii_clist { 1 } } \\
\end{tblr}
}
% \end{macrocode}
@@ -7094,9 +7200,9 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_p_decl_sign:nn #1#2
{
- \@@_name:n {#1} \c_@@_name_colon_tl \hfill
+ \@@_name:n {#1} \c_@@_name_colon_tl \tex_hfill:D
\@@_name:n {#2} \c_@@_name_colon_tl
- \skip_horizontal:n { 160 pt } \null \@@_vskip:
+ \skip_horizontal:n { 160 pt } \@@_null: \@@_vskip:
}
%</def-p>
% \end{macrocode}
@@ -7602,7 +7708,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 专业、年级、姓名。
% \begin{macrocode}
- \@@_full_uline:Nx \l_@@_tmp_skip
+ \@@_get_width_print:Nx \l_@@_tmp_skip
{
\dim_set:Nn \l_@@_tmpa_dim { 11 em }
\dim_set:Nn \l_@@_tmpb_dim { 4 em }
@@ -7615,7 +7721,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% 导师姓名、职称。
% \begin{macrocode}
- \@@_full_uline:Nx \l_@@_tmpa_dim { \c_@@_name_supva_tl #1 }
+ \@@_get_width_print:Nx \l_@@_tmpa_dim { \c_@@_name_supva_tl #1 }
\@@_box_ulined_info:Nn \l_@@_tmpa_dim { supvfull }
}
% \end{macrocode}
@@ -7792,10 +7898,14 @@ To produce the documentation run the original source files ending with
% 单独制作的前言致谢页。
% \begin{macrocode}
\NewDocumentEnvironment { preface } { +b }
- { \@@_chapter:V \c_@@_name_preface_tl #1 }
+ { \@@_chapter:V \c_@@_name_preface_tl #1 }
{ \cleardoublepage }
\NewDocumentEnvironment { acknowledgement } { +b }
- { \@@_chapter:V \c_@@_name_acknowledgement_tl #1 }
+ {
+ \bool_if:NTF \g_@@_opt_anon_bool
+ { \@@_bookmark_toc:V \c_@@_name_acknowledgementa_tl }
+ { \@@_chapter:V \c_@@_name_acknowledgement_tl #1 }
+ }
{ \cleardoublepage }
% \end{macrocode}
% \end{environment}
@@ -7944,110 +8054,111 @@ To produce the documentation run the original source files ending with
%<*(def-u|def-g|def-p)>
\clist_map_inline:nn
{
- { acknowledgement } { 致 \qquad{} 谢 },
-%<def-g> { apply } {(申请 \g_@@_info_degree_tl 学位)},
-%<def-g> { auth decl } { 学位论文出版授权书 },
-%<def-p> { auth decl } { 研究报告使用授权书 },
-%<def-p> { author } { 作者 },
+ { acknowledgement } { 致 \qquad{} 谢 },
+ { acknowledgement a } { 致谢(盲审阶段,暂时隐去) },
+%<def-g> { apply } {(申请 \g_@@_info_degree_tl 学位)},
+%<def-g> { auth decl } { 学位论文出版授权书 },
+%<def-p> { auth decl } { 研究报告使用授权书 },
+%<def-p> { author } { 作者 },
% \end{macrocode}
% 用于摘要的作者名称字样
% \begin{macrocode}
-%<def-u> { author a } { 本科生姓名 },
-%<def-g> { author a } { \g_@@_info_type_tl 生姓名 },
-%<def-g> { auth sign } { 作者签名:\njuline{\hspace{6em}} },
-%<def-p> { auth sign } { 本人签名 },
-%<def-p> { auth sign a } { 导师签名 },
-%<def-g> { chairman } { 答辩委员会主席: },
-%<def-g> { clc } { 分类号 },
-%<def-g> { confer } { 学位授予单位和日期 },
- { date } { 日期 },
-%<def-g> { defend date } { 论文答辩日期 },
-%<def-g> { degree } { 申请学位级别 },
+%<def-u> { author a } { 本科生姓名 },
+%<def-g> { author a } { \g_@@_info_type_tl 生姓名 },
+%<def-g> { auth sign } { 作者签名:\njuline{\hspace{6em}} },
+%<def-p> { auth sign } { 本人签名 },
+%<def-p> { auth sign a } { 导师签名 },
+%<def-g> { chairman } { 答辩委员会主席: },
+%<def-g> { clc } { 分类号 },
+%<def-g> { confer } { 学位授予单位和日期 },
+ { date } { 日期 },
+%<def-g> { defend date } { 论文答辩日期 },
+%<def-g> { degree } { 申请学位级别 },
% \end{macrocode}
% 用于出版授权书的学位名称字样
% \begin{macrocode}
-%<def-g> { degree a } { 论文级别 },
-%<def-p> { dept } { 系别 },
+%<def-g> { degree a } { 论文级别 },
+%<def-p> { dept } { 系别 },
% \end{macrocode}
% 用于出版授权书的院系名称字样
% \begin{macrocode}
-%<def-g> { dept a } { 所在院系 },
-%<def-g> { email } { 作者 Email },
-%<def-g> { field } { 研究方向 },
-%<def-u> { grade } { 年级 },
-%<def-g> { grade } { 级 },
-%<def-u|def-g> { id } { 学号 },
-%<def-p> { id } { 工号 },
+%<def-g> { dept a } { 所在院系 },
+%<def-g> { email } { 作者 Email },
+%<def-g> { field } { 研究方向 },
+%<def-u> { grade } { 年级 },
+%<def-g> { grade } { 级 },
+%<def-u|def-g> { id } { 学号 },
+%<def-p> { id } { 工号 },
% \end{macrocode}
% 用于出版授权书的学号名称字样
% \begin{macrocode}
-%<def-g> { id a } { 研究生学号 },
- { listoffigures } { 插图目录 },
- { listoftables } { 表格目录 },
-%<def-p> { major } { 学科专业 },
+%<def-g> { id a } { 研究生学号 },
+ { listoffigures } { 插图目录 },
+ { listoftables } { 表格目录 },
+%<def-p> { major } { 学科专业 },
% \end{macrocode}
% 用于摘要的专业名称字样
% \begin{macrocode}
-%<def-g> { major a } { 专业 },
+%<def-g> { major a } { 专业 },
% \end{macrocode}
% 用于国家图书馆封面的专业名称字样
% \begin{macrocode}
-%<def-g> { major b } { 专业名称 },
- { notation } { 符号表 },
-%<def-u> { orig decl }
-%<def-u> { 南京大学本科毕业论文(设计) \\ 诚信承诺书 },
-%<def-g> { orig decl } { 南京大学学位论文原创性声明 },
-%<def-p> { orig decl } { 研究报告原创性声明 },
-%<def-u> { orig sign } { 作者签名 },
-%<def-g> { orig sign } { 研究生签名 },
-%<def-p> { orig sign } { 研究报告作者签名 },
- { paper list } { 发表文章目录 },
- { pdf creator } { LaTeX~ with~ njuthesis~ class },
- { preface } { 前 \qquad{} 言 },
-%<def-p> { report } { 博士后研究工作报告 },
-%<def-g> { reviewer } { 评阅人: },
-%<def-g> { secret lv } { 密级 },
-%<def-g> { secret status } { 论文涉密情况: },
-%<def-g> { secret free } { 不保密 },
-%<def-g> { secret date }
+%<def-g> { major b } { 专业名称 },
+ { notation } { 符号表 },
+%<def-u> { orig decl }
+%<def-u> { 南京大学本科毕业论文(设计) \\ 诚信承诺书 },
+%<def-g> { orig decl } { 南京大学学位论文原创性声明 },
+%<def-p> { orig decl } { 研究报告原创性声明 },
+%<def-u> { orig sign } { 作者签名 },
+%<def-g> { orig sign } { 研究生签名 },
+%<def-p> { orig sign } { 研究报告作者签名 },
+ { paper list } { 发表文章目录 },
+ { pdf creator } { LaTeX~ with~ njuthesis~ class },
+ { preface } { 前 \qquad{} 言 },
+%<def-p> { report } { 博士后研究工作报告 },
+%<def-g> { reviewer } { 评阅人: },
+%<def-g> { secret lv } { 密级 },
+%<def-g> { secret status } { 论文涉密情况: },
+%<def-g> { secret free } { 不保密 },
+%<def-g> { secret date }
%<def-g> { 保密,保密期( \c_@@_name_blankdatea_tl 至
-%<def-g> \c_@@_name_blankdatea_tl ) },
-%<def-g> { sign } { (签字) },
-%<def-u> { submit date } { 提交日期 },
-%<def-g> { submit date } { 论文提交日期 },
-%<def-p> { submit date } { 完成日期 },
-%<def-g> { subtitle } { (题名和副题名) },
-%<def-u> { supv } { 指导教师 },
-%<def-g> { supv } { 导师 },
-%<def-p> { supv full } { 合作导师 },
+%<def-g> \c_@@_name_blankdatea_tl ) },
+%<def-g> { sign } { (签字) },
+%<def-u> { submit date } { 提交日期 },
+%<def-g> { submit date } { 论文提交日期 },
+%<def-p> { submit date } { 完成日期 },
+%<def-g> { subtitle } { (题名和副题名) },
+%<def-u> { supv } { 指导教师 },
+%<def-g> { supv } { 导师 },
+%<def-p> { supv full } { 合作导师 },
% \end{macrocode}
% 用于摘要的导师名称字样
% \begin{macrocode}
-%<def-g> { supv a } { 指导教师(姓名、职称) },
+%<def-g> { supv a } { 指导教师(姓名、职称) },
% \end{macrocode}
% 用于出版授权书的导师名称字样
% \begin{macrocode}
-%<def-g> { supv b } { 导师姓名 },
-%<def-g> { supv info }
-%<def-g> { 指导教师姓名、职务、职称、学位、单位名称及地址 },
- { supv ii } { 第二导师 },
- { supv title } { 职称 },
- { tableofcontents } { 目 \qquad{} 录 },
-%<def-p> { title } { 报告题目 },
+%<def-g> { supv b } { 导师姓名 },
+%<def-g> { supv info }
+%<def-g> { 指导教师姓名、职务、职称、学位、单位名称及地址 },
+ { supv ii } { 第二导师 },
+ { supv title } { 职称 },
+ { tableofcontents } { 目 \qquad{} 录 },
+%<def-p> { title } { 报告题目 },
% \end{macrocode}
% 用于摘要的标题名称字样
% \begin{macrocode}
-%<def-g> { title a } { 毕业论文题目 },
+%<def-g> { title a } { 毕业论文题目 },
% \end{macrocode}
% 用于国家图书馆封面的标题名称字样
% \begin{macrocode}
-%<def-g> { title b } { 学位论文 },
+%<def-g> { title b } { 学位论文 },
% \end{macrocode}
% 用于出版授权书的标题名称字样
% \begin{macrocode}
-%<def-g> { title c } { 论文题名 },
-%<def-g> { udc } { U D C },
-%<def-g> { year } { 学位年度 }
+%<def-g> { title c } { 论文题名 },
+%<def-g> { udc } { U D C },
+%<def-g> { year } { 学位年度 }
}
{ \@@_define_name:nn #1 }
% \end{macrocode}
@@ -8099,7 +8210,7 @@ To produce the documentation run the original source files ending with
% 对专业硕士的封面条目进行临时修改。
% \begin{macrocode}
%<*def-g>
-\int_compare:nT { \g_@@_info_degree_int == 2 }
+\bool_if:NF \g_@@_opt_academic_bool
{ \tl_set:Nn \c_@@_name_major_tl { 专业学位类别(领域) } }
%</def-g>
% \end{macrocode}
@@ -8236,7 +8347,11 @@ To produce the documentation run the original source files ending with
% 章节标题前后间距。
% \begin{macrocode}
{ chapter before } { 10 pt },
- { chapter after } { 60 pt }
+ { chapter after } { 60 pt },
+% \end{macrocode}
+% 脚注编号宽度。
+% \begin{macrocode}
+ { fn hang } { 13.5 pt }
}
{ \@@_define_dim:nn #1 }
% \end{macrocode}
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.ins b/macros/unicodetex/latex/njuthesis/njuthesis.ins
index 944922a626..82a71afd74 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.ins
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.ins
@@ -15,7 +15,7 @@
%% or (at your option) any later version. The latest version of this
%% license is in:
%%
-%% http://www.latex-project.org/lppl.txt
+%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
@@ -38,7 +38,7 @@ 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
+ http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX version
2005/12/01 or later.
diff --git a/macros/unicodetex/latex/njuthesis/njuthesis.pdf b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
index 4dd4b08be9..a02d764b62 100644
--- a/macros/unicodetex/latex/njuthesis/njuthesis.pdf
+++ b/macros/unicodetex/latex/njuthesis/njuthesis.pdf
Binary files differ