summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
committerNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
commit12679ab7d3c2a210f4123163671b532b8b55d5f9 (patch)
tree0060d13467186ad977f4e73488ee20dd6c0017ab /macros/latex
parent62170822e034fdd3f81de7274835d0d3b0467100 (diff)
CTAN sync 202403150306
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx8
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin604372 -> 608488 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex23
-rw-r--r--macros/latex/contrib/incgraph/CHANGES.md27
-rw-r--r--macros/latex/contrib/incgraph/README.md4
-rw-r--r--macros/latex/contrib/incgraph/incgraph-doc.sty17
-rw-r--r--macros/latex/contrib/incgraph/incgraph-example-a.pdfbin317493 -> 313915 bytes
-rw-r--r--macros/latex/contrib/incgraph/incgraph-example-b.pdfbin328766 -> 324489 bytes
-rw-r--r--macros/latex/contrib/incgraph/incgraph-example-c.pdfbin320763 -> 315803 bytes
-rw-r--r--macros/latex/contrib/incgraph/incgraph.pdfbin1023673 -> 889331 bytes
-rw-r--r--macros/latex/contrib/incgraph/incgraph.sty1077
-rw-r--r--macros/latex/contrib/incgraph/incgraph.tex198
-rw-r--r--macros/latex/contrib/jnuexam/exam-a-answer.pdfbin109643 -> 0 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-a-empty.pdfbin95848 -> 0 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-b-answer.pdfbin109569 -> 0 bytes
-rw-r--r--macros/latex/contrib/jnuexam/exam-b-empty.pdfbin95796 -> 0 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfc-a-answer.pdfbin0 -> 112749 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfc-a-answer.tex (renamed from macros/latex/contrib/jnuexam/exam-a-answer.tex)138
-rw-r--r--macros/latex/contrib/jnuexam/examfc-a-blank.pdfbin0 -> 98857 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfc-a-blank.tex (renamed from macros/latex/contrib/jnuexam/exam-b-empty.tex)2
-rw-r--r--macros/latex/contrib/jnuexam/examfc-b-answer.pdfbin0 -> 112707 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfc-b-answer.tex (renamed from macros/latex/contrib/jnuexam/exam-b-answer.tex)2
-rw-r--r--macros/latex/contrib/jnuexam/examfc-b-blank.pdfbin0 -> 98922 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfc-b-blank.tex (renamed from macros/latex/contrib/jnuexam/exam-a-empty.tex)2
-rw-r--r--macros/latex/contrib/jnuexam/examfe-a-answer.pdfbin0 -> 69901 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfe-a-answer.tex375
-rw-r--r--macros/latex/contrib/jnuexam/examfe-a-blank.pdfbin0 -> 66139 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfe-a-blank.tex6
-rw-r--r--macros/latex/contrib/jnuexam/examfe-b-answer.pdfbin0 -> 69943 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfe-b-answer.tex6
-rw-r--r--macros/latex/contrib/jnuexam/examfe-b-blank.pdfbin0 -> 66167 bytes
-rw-r--r--macros/latex/contrib/jnuexam/examfe-b-blank.tex6
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.cls1610
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.pdfbin81144 -> 85122 bytes
-rw-r--r--macros/latex/contrib/jnuexam/jnuexam.tex154
-rw-r--r--macros/latex/contrib/l3backend/CHANGELOG.md16
-rw-r--r--macros/latex/contrib/l3backend/README.md2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-basics.dtx14
-rw-r--r--macros/latex/contrib/l3backend/l3backend-box.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-code.pdfbin910339 -> 908163 bytes
-rw-r--r--macros/latex/contrib/l3backend/l3backend-code.tex2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-color.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-draw.dtx47
-rw-r--r--macros/latex/contrib/l3backend/l3backend-graphics.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-header.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-opacity.dtx78
-rw-r--r--macros/latex/contrib/l3backend/l3backend-pdf.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/CHANGELOG.md21
-rw-r--r--macros/latex/contrib/l3experimental/README.md9
-rw-r--r--macros/latex/contrib/l3experimental/l3benchmark.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/l3benchmark.pdfbin298116 -> 298521 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-boxes.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-code.pdfbin683797 -> 685801 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-layers.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-paths.dtx79
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-points.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-scopes.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-softpath.dtx10
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-state.dtx2
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-transforms.dtx7
-rw-r--r--macros/latex/contrib/l3experimental/l3draw.dtx18
-rw-r--r--macros/latex/contrib/l3experimental/l3draw.pdfbin516478 -> 518097 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3galley.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/l3galley.pdfbin405966 -> 406366 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3graphics.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/l3graphics.pdfbin378266 -> 378667 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3opacity.dtx31
-rw-r--r--macros/latex/contrib/l3experimental/l3opacity.pdfbin299358 -> 336876 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3str-format.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/l3str-format.pdfbin337262 -> 337668 bytes
-rw-r--r--macros/latex/contrib/l3experimental/l3sys-shell.dtx446
-rw-r--r--macros/latex/contrib/l3experimental/l3sys-shell.ins62
-rw-r--r--macros/latex/contrib/l3experimental/l3sys-shell.pdfbin346725 -> 0 bytes
-rw-r--r--macros/latex/contrib/l3experimental/xcoffins.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/xcoffins.pdfbin390902 -> 391312 bytes
-rw-r--r--macros/latex/contrib/l3experimental/xgalley.dtx4
-rw-r--r--macros/latex/contrib/l3experimental/xgalley.pdfbin323194 -> 323591 bytes
-rw-r--r--macros/latex/contrib/l3kernel/CHANGELOG.md16
-rw-r--r--macros/latex/contrib/l3kernel/README.md2
-rw-r--r--macros/latex/contrib/l3kernel/expl3.dtx14
-rw-r--r--macros/latex/contrib/l3kernel/expl3.pdfbin609936 -> 610363 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.pdfbin1792518 -> 1795605 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3basics.dtx504
-rw-r--r--macros/latex/contrib/l3kernel/l3bitset.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3bootstrap.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3box.dtx12
-rw-r--r--macros/latex/contrib/l3kernel/l3cctab.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3clist.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3coffins.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3color.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3debug.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3deprecation.dtx110
-rw-r--r--macros/latex/contrib/l3kernel/l3doc.dtx26
-rw-r--r--macros/latex/contrib/l3kernel/l3doc.pdfbin565153 -> 565279 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.pdfbin150870 -> 151266 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3expan.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3flag.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-assign.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-aux.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-expo.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-extended.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-functions.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-logic.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-parse.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-random.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-round.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-symbolic.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-traps.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-trig.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-types.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fparray.dtx15
-rw-r--r--macros/latex/contrib/l3kernel/l3int.dtx10
-rw-r--r--macros/latex/contrib/l3kernel/l3intarray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3kernel-functions.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3keys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3legacy.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3luatex.dtx6
-rw-r--r--macros/latex/contrib/l3kernel/l3msg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3names.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3news.pdfbin396222 -> 396222 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news01.pdfbin122959 -> 122959 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news02.pdfbin150919 -> 150919 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news03.pdfbin148747 -> 148747 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news04.pdfbin114754 -> 114754 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news05.pdfbin112524 -> 112524 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news06.pdfbin151591 -> 151591 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news07.pdfbin128344 -> 128344 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news08.pdfbin163484 -> 163484 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news09.pdfbin250159 -> 250159 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news10.pdfbin150302 -> 150302 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news11.pdfbin170102 -> 170102 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news12.pdfbin205020 -> 205020 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3pdf.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prefixes.pdfbin82720 -> 82720 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3prg.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3prop.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3quark.dtx65
-rw-r--r--macros/latex/contrib/l3kernel/l3regex.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3seq.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3skip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3sort.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str-convert.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3str.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.pdfbin296131 -> 296553 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.pdfbin230975 -> 231402 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3sys.dtx161
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.pdfbin241772 -> 242191 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3text-case.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3text-map.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3text-purify.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3text.dtx14
-rw-r--r--macros/latex/contrib/l3kernel/l3tl-analysis.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl-build.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3token.dtx4
-rw-r--r--macros/latex/contrib/l3kernel/l3unicode.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/source3.pdfbin7559694 -> 7574289 bytes
-rw-r--r--macros/latex/contrib/l3kernel/source3.tex2
-rw-r--r--macros/latex/contrib/l3packages/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/l3packages/README.md2
-rw-r--r--macros/latex/contrib/l3packages/l3keys2e.dtx4
-rw-r--r--macros/latex/contrib/l3packages/l3keys2e.pdfbin412694 -> 412717 bytes
-rw-r--r--macros/latex/contrib/l3packages/xfp.dtx4
-rw-r--r--macros/latex/contrib/l3packages/xfp.pdfbin332379 -> 332422 bytes
-rw-r--r--macros/latex/contrib/l3packages/xparse.dtx19
-rw-r--r--macros/latex/contrib/l3packages/xparse.pdfbin534131 -> 551698 bytes
-rw-r--r--macros/latex/contrib/l3packages/xtemplate.dtx16
-rw-r--r--macros/latex/contrib/l3packages/xtemplate.pdfbin448820 -> 448862 bytes
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.pdfbin1653583 -> 1634655 bytes
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.sty13
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.tex17
180 files changed, 2743 insertions, 2956 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index e0506e460d..98f5ddab46 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2021/11/15]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2024/02/28}{2024an}
+\ProvidesExplClass{easybook}{2024/03/13}{2024ao}
{Easily typesetting Chinese theses or books}
\bool_new:N \l__eb_compile_draft_bool
@@ -297,7 +297,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2021/11/15]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2024/02/28}{2024an}
+\ProvidesExplPackage{easybase}{2024/03/13}{2024ao}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1473,6 +1473,8 @@
{ \protect\numberline{#3}{#4} }
}
}
+\cs_new_protected:Npn \AllotCaptionExt #1#2
+ { \tl_set:cn { ext@#1 } {#2} }
\ctex_define:n
{
bicontentsname .tl_set:N = \bicontentsname,
@@ -2390,7 +2392,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/02/28}{2024an}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/03/13}{2024ao}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 3bc9fb4d0e..b053b576ac 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 58886c011f..5ce75e40fa 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -23,8 +23,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK使用手册,
- version = v2024an,
- date = 2024/02/28,
+ version = v2024ao,
+ date = 2024/03/13,
authors = 瞿毅,
info = 简便地排版中文学位论文或书籍,
email = toquyi@163.com,
@@ -869,9 +869,15 @@
\DeclareFloatList{algorithm}{loa}
\listofalgorithms[multoc] % 在正文中输出双栏算法目录
\end{ctexexam}
- \command{SetTocStyle}[\marg{条目名}\marg{风格名}\marg{键值列表}]\newtag%
+ \command{AllotCaptionExt}[\marg{条目名}\marg{扩展名}]\newtag%
+ 给条目类型名称为 \meta{条目名} 的标题分配目录文件 \meta{扩展名},注意 \meta{扩展名} 需要被定义在 \cs*{ext@}\meta{条目名} 命令中才有效(\pkg*{caption} 宏包的默认定义形式)。可以使不同的 \meta{条目名} 共享一个目录:
+ \begin{ctexexam}
+ \AllotCaptionExt{table}{lof}
+ \newcommand{\listoffiguretables}{\listoffigures} % 同时输出图表目录的命令
+ \end{ctexexam}
+ \command{SetTocStyle}[\marg{条目名}\marg{风格名}\marg{键值列表}]
定义条目类型名称为 \meta{风格名} 的目录风格。使用 \cs*{ctexset} 命令设置目录样式时,除了条目标题定义选项 \option{tocline},其它选项只有在目录输出命令前设置才有效,定义完目录风格后用 \cs{UseTocStyle} 命令可以在正文中任意位置生效。如果是没有 \ding{73} 符号的选项,\meta{条目名} 设置为 \module*{tocset}。
- \command{UseTocStyle}[\marg{条目名}\marg{风格名}\marg{扩展名}]\newtag%
+ \command{UseTocStyle}[\marg{条目名}\marg{风格名}\marg{扩展名}]
使用对应条目类型名称为 \meta{风格名} 的目录风格,随后标题在目录中的格式会改变。本命令导言区和正文区均可使用,第三个必选参数还需要指定条目标题加入目录文件的 \meta{扩展名}。
\begin{ctexexam}
\SetTocStyle{chapter}{fancy}{tocformat = \color{red}\zihao{3}}
@@ -886,8 +892,8 @@
figure/tocline = \protect\numberline{图\thefigure\hspace{1em}}#2
}
\end{ctexexam}
- \command{contentsmargin}[\marg{右边距}]
- 目录中引导线到版心右边的距离,用于条目页码的精细调整。当设置条目页码对齐方式或数字较大时,可以设置适当的数值,可在导言区全局设置或在 \option{tocformat} 选项给条目类型单独设置。
+ \command{contentsmargin}[\oarg{修正距离}\marg{右边距}]
+ 设置目录中引导线到版心右边的距离,用于条目页码的精细调整。当设计条目页码对齐方式或数字较大时,可以设置适当的 \meta{右边距}。\meta{修正距离} 是在过长而换行的标题右侧 \meta{右边距} 基础上附加的距离。此命令可在导言区全局使用或在 \option{tocformat} 选项给特定条目类型单独使用。
\end{commands}
\begin{options}
@@ -1401,17 +1407,18 @@
\shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。}
\shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。}
\shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。}
- \begin{version}[v = 2024an,date = 2024/02/28]
+ \begin{version}[v = 2024ao,date = 2024/03/13]
\fixed
\item 修复图表等浮动环境题注目录中条目标签编号的计数器值显示错误问题。
\item 修复附录命令 \cs{appendix} 的可选参数设置英文目录中条目名字和编号失效的问题。
\item 修复 \pkg*{biblatex} 宏包对脚注打补丁失效的问题。
\added
\item 新增目录风格定义命令 \cs{SetTocStyle} 和使用命令 \cs{UseTocStyle}。
- \item 新增目录配置命令 \cs{SetTocOuter} 双语目录判断命令 \cs{ebifbitoc}。
+ \item 新增目录配置命令 \cs{SetTocOuter} 和双语目录判断命令 \cs{ebifbitoc}。
\item 新增脚注段落文本格式定义命令 \cs{deffntpara} 和脚注间距离选项 \option{footnotesep}。
\item 新增悬挂缩进命令 \cs{hangfrom}。
\item 新增行间公式与正文上下间距选项 \option{abovedisplayskip} 和 \option{belowdisplayskip}。
+ \item 新增目录文件扩展名分配命令 \cs{AllotCaptionExt}。
\end{version}
\end{changelog}
\nocite{*}
diff --git a/macros/latex/contrib/incgraph/CHANGES.md b/macros/latex/contrib/incgraph/CHANGES.md
index 0b6698f210..c0def83b0a 100644
--- a/macros/latex/contrib/incgraph/CHANGES.md
+++ b/macros/latex/contrib/incgraph/CHANGES.md
@@ -17,6 +17,31 @@ and this project adheres to
+## [1.3.0] - 2024-03-14
+
+### Added
+- Option `overlay page number options app` (issue #2)
+- Option `xshift`
+- Option `yshift`
+- Autosize Options:
+ - Option `autosize`
+ - Option `autosize width gap`
+ - Option `autosize height gap`
+ - Option `autosize gap`
+ - Option `autosize min scale`
+ - Option `autosize max scale`
+
+### Changed
+- Implementation overhauled and completely rewritten in LaTeX3.
+ Major changes of the whole code.
+ Option keys kept to be pgfkeys.
+- `\igrboxcenter` drops box now after usage
+
+### Fixed
+- Documentation typo (issue #4)
+
+
+
## [1.2.0] - 2021-10-20
### Added
@@ -40,7 +65,7 @@ and this project adheres to
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- From now on version numbers adhere to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html)
-- Readme moved from README to README.md and adapted to
+- Readme moved from README to README.md
- Documentation code revised
- Internal package creation process modernized (invisible to the user)
- Adaption of paper size made compatible with lualatex
diff --git a/macros/latex/contrib/incgraph/README.md b/macros/latex/contrib/incgraph/README.md
index 78e1983b50..860dc7d905 100644
--- a/macros/latex/contrib/incgraph/README.md
+++ b/macros/latex/contrib/incgraph/README.md
@@ -1,7 +1,7 @@
-# The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+# The LaTeX package incgraph - version 1.3.0 (2024/03/14)
-> Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+> Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
> This work may be distributed and/or modified under the
> conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/incgraph/incgraph-doc.sty b/macros/latex/contrib/incgraph/incgraph-doc.sty
index efa2c71447..761af119d3 100644
--- a/macros/latex/contrib/incgraph/incgraph-doc.sty
+++ b/macros/latex/contrib/incgraph/incgraph-doc.sty
@@ -1,10 +1,10 @@
% \LaTeX-Main\
% !TeX encoding=UTF-8
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
%% incgraph.tex: Manual
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -19,8 +19,8 @@
%%
%% This work consists of all files listed in README
%%
-\def\version{1.2.0}%
-\def\datum{2021/10/20}%
+\def\version{1.3.0}%
+\def\datum{2024/03/14}%
\IfFileExists{incgraph-doc.cfg}{\input{incgraph-doc.cfg}}{}\providecommand\igrpkgprefix{}
@@ -28,7 +28,7 @@
\RequirePackage[english]{babel}
\RequirePackage{lmodern,parskip,array,makeidx}
\RequirePackage{amsmath,amssymb}
-\RequirePackage[svgnames,table,hyperref]{xcolor}
+\RequirePackage[svgnames,table]{xcolor}
\RequirePackage{tikz}
\RequirePackage[bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
@@ -106,8 +106,15 @@
},
}
+\newcommand{\formatPackageOption}[1]{package option}
+\newcommand{\formatPackageOptions}[1]{Package options}
+
\tcbmakedocSubKey{docIgrKey}{igr}
\tcbmakedocSubKeys{docIgrKeys}{igr}
+\tcbmakedocSubKeys[doc key prefix=,
+ index key formatter=\formatPackageOption,
+ index keys formatter=\formatPackageOptions
+]{docPackageOptions}{}
\newcounter{texexp}
diff --git a/macros/latex/contrib/incgraph/incgraph-example-a.pdf b/macros/latex/contrib/incgraph/incgraph-example-a.pdf
index 1e5b76d304..d6765c2941 100644
--- a/macros/latex/contrib/incgraph/incgraph-example-a.pdf
+++ b/macros/latex/contrib/incgraph/incgraph-example-a.pdf
Binary files differ
diff --git a/macros/latex/contrib/incgraph/incgraph-example-b.pdf b/macros/latex/contrib/incgraph/incgraph-example-b.pdf
index 9ee06ea60d..04edecf575 100644
--- a/macros/latex/contrib/incgraph/incgraph-example-b.pdf
+++ b/macros/latex/contrib/incgraph/incgraph-example-b.pdf
Binary files differ
diff --git a/macros/latex/contrib/incgraph/incgraph-example-c.pdf b/macros/latex/contrib/incgraph/incgraph-example-c.pdf
index 67ca683b62..3b3ff6e5d4 100644
--- a/macros/latex/contrib/incgraph/incgraph-example-c.pdf
+++ b/macros/latex/contrib/incgraph/incgraph-example-c.pdf
Binary files differ
diff --git a/macros/latex/contrib/incgraph/incgraph.pdf b/macros/latex/contrib/incgraph/incgraph.pdf
index 1dd52b2d1d..651ba6f48b 100644
--- a/macros/latex/contrib/incgraph/incgraph.pdf
+++ b/macros/latex/contrib/incgraph/incgraph.pdf
Binary files differ
diff --git a/macros/latex/contrib/incgraph/incgraph.sty b/macros/latex/contrib/incgraph/incgraph.sty
index 43a2aac9a3..3eef75881c 100644
--- a/macros/latex/contrib/incgraph/incgraph.sty
+++ b/macros/latex/contrib/incgraph/incgraph.sty
@@ -1,8 +1,8 @@
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
%% incgraph.sty: Graphics inclusion page
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -17,34 +17,40 @@
%%
%% This work consists of all files listed in README
%%
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{incgraph}[2021/10/20 version 1.2.0 LaTeX special graphics inclusion]
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
+\ProvidesExplPackage{incgraph}{2024/03/14}{1.3.0}
+ {LaTeX special graphics inclusion}
-\DeclareOption{pgf}{\def\igrreq@pgf{\RequirePackage{pgf}[2008/01/15]\RequirePackage{pgffor}}}%
-\DeclareOption{nopgf}{\def\igrreq@pgf{}}%
-\DeclareOption{graphicx}{\def\igrreq@graphicx{\RequirePackage{graphicx}}}%
-\DeclareOption{nographicx}{\def\igrreq@graphicx{}}%
-\DeclareOption{bookmark}{\def\igrreq@bookmark{\RequirePackage{bookmark}}}%
-\DeclareOption{nobookmark}{\def\igrreq@bookmark{}}%
+\bool_new:N \l__incgra_package_pgf_bool
+\bool_new:N \l__incgra_package_graphicx_bool
+\bool_new:N \l__incgra_package_bookmark_bool
-\ExecuteOptions{pgf,graphicx,bookmark}
-\ProcessOptions\relax
-
-\RequirePackage{pgfkeys}
-\igrreq@pgf
-\igrreq@graphicx
-\igrreq@bookmark
+\DeclareKeys[incgra]
+ {
+ pgf .bool_set:N = \l__incgra_package_pgf_bool,
+ nopgf .bool_set_inverse:N = \l__incgra_package_pgf_bool,
+ graphicx .bool_set:N = \l__incgra_package_graphicx_bool,
+ nographicx .bool_set_inverse:N = \l__incgra_package_graphicx_bool,
+ bookmark .bool_set: N = \l__incgra_package_bookmark_bool,
+ nobookmark .bool_set_inverse:N = \l__incgra_package_bookmark_bool,
+ }
-% key management
-\pgfkeys{/igr/.is family}
+\SetKeys[incgra]{ pgf, graphicx, bookmark }
-\def\igrset{\pgfqkeys{/igr}}
+\ProcessKeyOptions[incgra]
-\newbox\igrbox
-\newdimen\igr@length
-\newcounter{igrtarget}
+\bool_if:NT \l__incgra_package_pgf_bool
+ {
+ \RequirePackage{pgf}
+ \RequirePackage{pgffor}
+ }
+\bool_if:NT \l__incgra_package_graphicx_bool
+ { \RequirePackage{graphicx} }
+\bool_if:NT \l__incgra_package_bookmark_bool
+ { \RequirePackage{bookmark} }
-\ExplSyntaxOn
+\pgfkeys{/igr/.is~family}
+\cs_set_nopar:Npn \igrset { \pgfqkeys{/igr} }
\sys_if_engine_pdftex:TF
{
@@ -114,248 +120,317 @@
}
}
-\ExplSyntaxOff
-
-\AtBeginDocument{%
- \igrGetPageSize%
- \let\igrOrginalPageWidth\igrPageWidth%
- \let\igrOrginalPageHeight\igrPageHeight%
-}
-
-\def\igr@target@auto{%
- \xdef\igrAutoTarget{igr-\theigrtarget}%
-}
-
-\def\igr@target@user{%
- \xdef\igrAutoTarget{\igr@usertarget}%
- \global\let\igr@target@next=\igr@target@auto%
-}
-
-\let\igr@target@next=\igr@target@auto
-
-\NewDocumentCommand\igrtargetset{m}{%
- \def\igr@usertarget{#1}%
- \let\igr@target@next=\igr@target@user%
-}
-
-\def\igr@nextAutoTarget{%
- \refstepcounter{igrtarget}%
- \igr@target@next%
-}
-
-\def\igr@do@rebox{%
- \setbox\igrbox\hbox{%
- \kern\igr@left@border%
- \vbox{%
- \kern\igr@top@border%
- \box\igrbox%
- \kern\igr@bottom@border%
- }%
- \kern\igr@right@border}%
-}
-
-\def\igr@rebox{%
- \ifdim\igr@top@border=0pt\relax%
- \ifdim\igr@bottom@border=0pt\relax%
- \ifdim\igr@left@border=0pt\relax%
- \ifdim\igr@right@border=0pt\relax%
- \else%
- \igr@do@rebox%
- \fi%
- \else%
- \igr@do@rebox%
- \fi%
- \else%
- \igr@do@rebox%
- \fi%
- \else%
- \igr@do@rebox%
- \fi%
-}
-
-\def\igr@get@box@dimensions{%
- \igr@length=\wd\igrbox%
- \edef\igrBoxWidth{\the\igr@length}%
- \igr@length=\ht\igrbox%
- \edef\igrBoxht{\the\igr@length}%
- \igr@length=\dp\igrbox%
- \edef\igrBoxdp{\the\igr@length}%
- \advance\igr@length by \igrBoxht%
- \edef\igrBoxHeight{\the\igr@length}%
-}
-
-\NewDocumentCommand\igrboxset{+m}{%
- \igr@nextAutoTarget%
- \setbox\igrbox\color@hbox#1\color@endbox%
- \igr@rebox%
- \igr@get@box@dimensions%
-}
-
-
-\def\igr@hyper{\hypertarget{\igrAutoTarget}{}}
-
-\NewDocumentCommand\igrboxcenter{}{%
- \igrGetPageSize%
- \thispagestyle{\igrpagestyle}%
- %
- \igr@length=-1in%
- \advance\igr@length by -\voffset%
- \advance\igr@length by -\topmargin%
- \advance\igr@length by -\headheight%
- \advance\igr@length by -\headsep%
- \edef\igr@offy@top{\the\igr@length}%
- %
- \igr@length=\igrPageHeight%
- \advance\igr@length by -\igrBoxHeight%
- \divide\igr@length by 2%
- \edef\igr@offy@abs{\the\igr@length}%
- %
- \igr@length=-1in%
- \advance\igr@length by -\hoffset%
- \if@twoside
- \ifodd\c@page
- \advance\igr@length by -\oddsidemargin%
- \else
- \advance\igr@length by -\evensidemargin%
- \fi
- \else
- \advance\igr@length by -\oddsidemargin%
- \fi%
- \edef\igr@offx@left{\the\igr@length}%
- %
- \igr@length=\igrPageWidth%
- \advance\igr@length by -\igrBoxWidth%
- \divide\igr@length by 2%
- \advance\igr@length by \igr@offx@left%
- \edef\igr@offx{\the\igr@length}%
- %
- \vbox to \vsize{%
- \kern\igr@offy@top\hbox{\kern\igr@offx@left\igr@hypertarget\hss}%
- \nointerlineskip\kern\igr@offy@abs%
- \hbox to \hsize{\kern\igr@offx\box\igrbox\hss}%
- \vss}%
- \break%
-}
-
-\NewDocumentCommand\igrboxtikz{}{%
- \path[use as bounding box] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight);
- \node[line width=0mm,inner sep=0,rectangle,above right] (box) at (0,0) {\box\igrbox};
- \node[minimum width=\igrBoxWidth,minimum height=\igrBoxHeight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};%
-}
-
-\let\igrboxtikzpage=\igrboxtikz
-
-\NewDocumentCommand\igrboxtikzcenter{}{%
- \igrGetPageSize%
- \path[use as bounding box] (0,0) rectangle (\igrPageWidth,\igrPageHeight);
- \node[line width=0mm,inner sep=0,rectangle,above right] (box) at ({(\igrPageWidth-\igrBoxWidth)/2},{(\igrPageHeight-\igrBoxHeight)/2}) {\box\igrbox};
- \let\igrBoxWidth\igrPageWidth%
- \let\igrBoxHeight\igrPageHeight%
- \node[minimum width=\igrBoxWidth,minimum height=\igrBoxHeight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};%
-}
-
-\def\igr@overlay@on{%
- \igrboxset{\begin{tikzpicture}\igrboxtikzcenter\igr@tikz@hook\end{tikzpicture}}}
-
-\def\igr@overlay@off{}
-
-\let\igr@overlay=\igr@overlay@off
-
-% Output macros
-
-\def\igr@out@resize#1#2{%
- \igrGetPageSize%
- \let\igrCurrentPageWidth\igrPageWidth%
- \let\igrCurrentPageHeight\igrPageHeight%
- \eject%
- \igrSetPageSize{#1}{#2}%
- \igr@overlay%
- \edef\theigrpage{\thepage}%
- \igrboxcenter%
- \igrSetPageSize{\igrCurrentPageWidth}{\igrCurrentPageHeight}%
-}
-
-\def\igr@out@center@fit@port{%
- \igr@out@resize{\igr@target@width}{\igr@target@height}%
-}
-
-\def\igr@out@center@fit@land{%
- \igr@out@resize{\igr@target@height}{\igr@target@width}%
-}
-
-\def\igr@out@center@fit{%
- \csname igr@out@center@fit@\igr@turn\endcsname%
-}
-
-\def\igr@out@page{%
- \igr@out@resize{\igrBoxWidth}{\igrBoxHeight}%
-}
-
-\def\igr@out@center@port{%
- \clearpage%
- \igr@overlay%
- \edef\theigrpage{\thepage}%
- \igrboxcenter%
-}
-
-\def\igr@out@center@land{%
- \igrGetPageSize%
- \let\igr@temp@w\igrPageWidth%
- \let\igr@temp@h\igrPageHeight%
- \igr@out@resize{\igr@temp@h}{\igr@temp@w}%
-}
-
-\def\igr@out@center{%
- \csname igr@out@center@\igr@turn\endcsname%
-}
-
-% Toolbox output
-
-\NewDocumentCommand\igrcenterfit{mm+m}{%
- \igrboxset{#3}%
- \igr@out@resize{#1}{#2}%
-}
-
-\NewDocumentCommand\igrpage{+m}{%
- \igrboxset{#1}%
- \igr@out@page%
-}
-
-\NewDocumentCommand\igrcenter{+m}{%
- \igrboxset{#1}%
- \igr@out@center@port%
-}
-
-
-% include macros
-
-\ExplSyntaxOn
-
-
-\bool_new:N \g__incgra_first_include
-\bool_new:N \g__incgra_multi_include
+\box_new:N \igrbox
+\newcounter{igrtarget}
+
+\bool_new:N \g__incgra_first_include_bool
+\bool_new:N \g__incgra_multi_include_bool
+\bool_new:N \l__incgra_apply_scaling_bool
+\bool_new:N \l__incgra_autosize_bool
+\bool_new:N \l__incgra_change_page_size_bool
+\bool_new:N \l__incgra_file_exist_bool
+\bool_new:N \l__incgra_overlay_bool
+\bool_new:N \l__incgra_set_hypertarget_bool
+\bool_new:N \l__incgra_turn_bool
+
\clist_new:N \l__incgra_extensions_clist
+\dim_new:N \l__incgra_offx_left_dim
+
+\fp_new:N \l__incgra_autosize_max_scale_fp
+\fp_new:N \l__incgra_autosize_min_scale_fp
+\fp_new:N \l__incgra_scale_fp
+
+\tl_new:N \l__incgra_autosize_height_gap_tl
+\tl_new:N \l__incgra_autosize_width_gap_tl
\tl_new:N \l__incgra_bookmark_heading_options_tl
\tl_new:N \l__incgra_bookmark_heading_text_tl
\tl_new:N \l__incgra_bookmark_options_tl
\tl_new:N \l__incgra_bookmark_text_tl
+\tl_new:N \l__incgra_bottom_border_tl
\tl_new:N \l__incgra_label_text_tl
+\tl_new:N \l__incgra_left_border_tl
\tl_new:N \l__incgra_options_tl
+\tl_new:N \l__incgra_overlay_code_tl
+\tl_new:N \l__incgra_overlay_pagenumber_options_tl
+\tl_new:N \l__incgra_right_border_tl
+\tl_new:N \l__incgra_target_heigth_tl
+\tl_new:N \l__incgra_target_width_tl
+\tl_new:N \l__incgra_top_border_tl
+
+\NewHook { incgra/usertarget }
+
+
+\AddToHook{begindocument}
+ {
+ \igrGetPageSize
+ \let\igrOrginalPageWidth\igrPageWidth
+ \let\igrOrginalPageHeight\igrPageHeight
+ }
+
+
+\cs_new_protected:Npn \__incgra_set_next_target:
+ {
+ \refstepcounter{igrtarget}
+ \cs_gset_nopar:Npe \igrAutoTarget { igr-\theigrtarget }
+ \UseHook{ incgra/usertarget }
+ }
+
+
+\NewDocumentCommand \igrtargetset { m }
+ {
+ \AddToHookNext{ incgra/usertarget }
+ { \cs_gset_nopar:Npe \igrAutoTarget { #1 } }
+ }
+
+
+\cs_new_protected:Npn \__incgra_apply_borders:
+ {
+ \bool_lazy_all:nF
+ {
+ { \dim_compare_p:nNn \l__incgra_top_border_tl = \c_zero_dim }
+ { \dim_compare_p:nNn \l__incgra_bottom_border_tl = \c_zero_dim }
+ { \dim_compare_p:nNn \l__incgra_left_border_tl = \c_zero_dim }
+ { \dim_compare_p:nNn \l__incgra_right_border_tl = \c_zero_dim }
+ }
+ {
+ \box_set_trim:Nnnnn \igrbox
+ { -\l__incgra_left_border_tl }
+ { -\l__incgra_bottom_border_tl }
+ { -\l__incgra_right_border_tl }
+ { -\l__incgra_top_border_tl }
+ \__incgra_get_box_dimensions:
+ }
+ }
+
+
+\cs_new_protected:Npn \__incgra_get_box_dimensions:
+ {
+ \cs_set_nopar:Npe \igrBoxWidth { \dim_eval:n { \box_wd:N \igrbox } }
+ \cs_set_nopar:Npe \igrBoxht { \dim_eval:n { \box_ht:N \igrbox } }
+ \cs_set_nopar:Npe \igrBoxdp { \dim_eval:n { \box_dp:N \igrbox } }
+ \cs_set_nopar:Npe \igrBoxHeight { \dim_eval:n { \box_ht_plus_dp:N \igrbox } }
+ }
+
+
+\cs_new_protected:Npn \__incgra_box_set:n #1
+ {
+ \__incgra_set_next_target:
+ \hbox_set:Nn \igrbox { #1 }
+ \__incgra_get_box_dimensions:
+ }
+\cs_set_eq:NN \igrboxset \__incgra_box_set:n
+
+
+% clone of \__kernel_kern:n
+\cs_new_protected:Npn \___incgra_kern:n #1
+ { \kern \dimexpr #1 \scan_stop: }
+
+
+\cs_new_protected:Npn \__incgra_box_use_center:
+ {
+ \igrGetPageSize
+ \thispagestyle{\igrpagestyle}
+
+ \legacy_if:nTF { @twoside }
+ {
+ \int_if_odd:nTF \c@page
+ {
+ \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \oddsidemargin}
+ }
+ {
+ \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \evensidemargin}
+ }
+ }
+ {
+ \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \oddsidemargin}
+ }
+
+ \vbox_to_ht:nn { \vsize }
+ {
+ \___incgra_kern:n { - 1in - \voffset - \topmargin - \headheight - \headsep }
+ \hbox:n
+ {
+ \___incgra_kern:n { \l__incgra_offx_left_dim }
+ \bool_if:NT \l__incgra_set_hypertarget_bool
+ {
+ \hypertarget { \igrAutoTarget }{}
+ }
+ \hss
+ }
+ \nointerlineskip
+ \___incgra_kern:n { ( \igrPageHeight - \igrBoxHeight ) / 2 }
+ \hbox_to_wd:nn { \hsize }
+ {
+ \___incgra_kern:n { \l__incgra_offx_left_dim + ( \igrPageWidth - \igrBoxWidth ) / 2 }
+ \box_use_drop:N \igrbox
+ \hss
+ }
+ \vss
+ }
+ \break
+ }
+
+\NewDocumentCommand \igrboxcenter { }{ \__incgra_box_use_center: }
+
+
+\NewDocumentCommand \igrboxtikz { }
+ {
+ \path[use~as~bounding~box] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight);
+ \node[line~width=0mm, inner~sep=0, rectangle, above~right] (box) at (0,0)
+ { \box_use_drop:N \igrbox };
+ \node[minimum~width=\igrBoxWidth, minimum~height=\igrBoxHeight, line~width=0mm, inner~sep=0mm, above~right] (page) at (0,0) {};
+ }
+
+\NewCommandCopy \igrboxtikzpage \igrboxtikz
+
+\NewDocumentCommand \igrboxtikzcenter { }
+ {
+ \igrGetPageSize
+ \path[use~as~bounding~box] (0,0) rectangle (\igrPageWidth,\igrPageHeight);
+ \node[line~width=0mm, inner~sep=0, rectangle, above~right] (box) at ({(\igrPageWidth-\igrBoxWidth)/2},{(\igrPageHeight-\igrBoxHeight)/2})
+ { \box_use_drop:N \igrbox };
+ \cs_set_eq:NN \igrBoxWidth \igrPageWidth
+ \cs_set_eq:NN \igrBoxHeight \igrPageHeight
+ \node[minimum~width=\igrBoxWidth, minimum~height=\igrBoxHeight, line~width=0mm, inner~sep=0mm, above~right] (page) at (0,0) {};
+ }
+
+
+\cs_new_protected:Npn \__incgra_ship_box:nn #1#2
+ {
+ \bool_if:NT \l__incgra_apply_scaling_bool
+ {
+ \bool_if:NT \l__incgra_autosize_bool
+ {
+ \fp_set:Nn \l__incgra_scale_fp
+ {
+ max
+ (
+ \l__incgra_autosize_min_scale_fp,
+ min
+ (
+ \l__incgra_autosize_max_scale_fp,
+ (#1 - \l__incgra_autosize_width_gap_tl) / \igrBoxWidth,
+ (#2 - \l__incgra_autosize_height_gap_tl) / \igrBoxHeight
+ )
+ )
+ }
+ \box_scale:Nnn \igrbox { \l__incgra_scale_fp }{ \l__incgra_scale_fp }
+ \__incgra_get_box_dimensions:
+ }
+ \__incgra_apply_borders:
+ }
+ \bool_if:NTF \l__incgra_change_page_size_bool
+ {
+ \igrGetPageSize
+ \cs_set_eq:NN \igrCurrentPageWidth \igrPageWidth
+ \cs_set_eq:NN \igrCurrentPageHeight \igrPageHeight
+ \eject
+ \igrSetPageSize { #1 }{ #2 }
+ }
+ {
+ \eject
+ }
+ \bool_if:NT \l__incgra_overlay_bool
+ {
+ \hbox_set:Nn \igrbox
+ {
+ \begin{tikzpicture}
+ \igrboxtikzcenter
+ \l__incgra_overlay_code_tl
+ \end{tikzpicture}
+ }
+ \__incgra_get_box_dimensions:
+ }
+ \cs_gset_nopar:Npx \theigrpage { \thepage }
+ \__incgra_box_use_center:
+ \bool_if:NT \l__incgra_change_page_size_bool
+ {
+ \igrSetPageSize { \igrCurrentPageWidth }{ \igrCurrentPageHeight }
+ }
+ }
+\cs_generate_variant:Nn \__incgra_ship_box:nn { oo }
+
+
+\cs_new_protected:Npn \__incgra_output_page:
+ {
+ \__incgra_apply_borders:
+ \bool_set_false:N \l__incgra_apply_scaling_bool
+ \bool_set_true:N \l__incgra_change_page_size_bool
+ \__incgra_ship_box:oo { \igrBoxWidth }{ \igrBoxHeight }
+ }
+
+
+\cs_new_protected:Npn \__incgra_output_fit:
+ {
+ \bool_set_true:N \l__incgra_apply_scaling_bool
+ \bool_set_true:N \l__incgra_change_page_size_bool
+ \bool_if:NTF \l__incgra_turn_bool
+ {
+ \__incgra_ship_box:oo { \l__incgra_target_heigth_tl }{ \l__incgra_target_width_tl }
+ }
+ {
+ \__incgra_ship_box:oo { \l__incgra_target_width_tl } {\l__incgra_target_heigth_tl }
+ }
+ }
+
+
+\cs_new_protected:Npn \__incgra_output_center:
+ {
+ \bool_set_true:N \l__incgra_apply_scaling_bool
+ \bool_if:NTF \l__incgra_turn_bool
+ {
+ \bool_set_true:N \l__incgra_change_page_size_bool
+ \__incgra_ship_box:oo { \igrPageHeight }{ \igrPageWidth }
+ }
+ {
+ \bool_set_false:N \l__incgra_change_page_size_bool
+ \__incgra_ship_box:oo { \igrPageWidth }{ \igrPageHeight }
+ }
+ }
+
+
+\NewDocumentCommand \igrcenterfit { m m +m }
+ {
+ \group_begin:
+ \tl_set:Ne \l__incgra_target_width_tl { #1 }
+ \tl_set:Ne \l__incgra_target_heigth_tl { #2 }
+ \__incgra_box_set:n { #3 }
+ \__incgra_output_fit:
+ \group_end:
+ }
+
+
+\NewDocumentCommand \igrpage { +m }
+ {
+ \group_begin:
+ \__incgra_box_set:n { #1 }
+ \__incgra_output_page:
+ \group_end:
+ }
+
+
+\NewDocumentCommand \igrcenter { +m }
+ {
+ \group_begin:
+ \__incgra_box_set:n { #1 }
+ \__incgra_output_center:
+ \group_end:
+ }
\cs_new_protected_nopar:Npn \__incgra_if_file_exist_extensions:nTF #1
{
- \bool_set_false:N \l_tmpa_bool
+ \bool_set_false:N \l__incgra_file_exist_bool
\clist_map_inline:Nn \l__incgra_extensions_clist
{
\file_if_exist:nTF { #1 ##1 }
{
\tl_put_right:Nn \nt {##1}
- \bool_set_true:N \l_tmpa_bool
+ \bool_set_true:N \l__incgra_file_exist_bool
\clist_map_break:
}
}
- \bool_if:NTF \l_tmpa_bool
+ \bool_if:NTF \l__incgra_file_exist_bool
}
@@ -371,68 +446,71 @@
}
+
\cs_new_protected_nopar:Npn \__incgra_includegraphics:nn #1#2
{
- \igr@match@hook
-
- \tl_set:Nn \l_tmpa_tl { \__incgra_include_graphics:w [ }
- \tl_put_right:NV \l_tmpa_tl \l__incgra_options_tl
- \tl_put_right:Nn \l_tmpa_tl { ,#1] }
-
- \bool_if:NTF \g__incgra_multi_include
+ \__incgra_match_hook:
+ \bool_if:NTF \g__incgra_multi_include_bool
{
- \bool_if:NTF \g__incgra_first_include
+ \bool_if:NTF \g__incgra_first_include_bool
{
- \tl_if_empty:NTF \l__incgra_label_text_tl
- {
- \igrboxset{\l_tmpa_tl{#2}}
- }
+ \__incgra_box_set:n
{
- \igrboxset{\l_tmpa_tl{#2}\label{\l__incgra_label_text_tl}}
+ \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+ \tl_if_empty:NF \l__incgra_label_text_tl { \label { \l__incgra_label_text_tl } }
}
- \igr@output
+ \__incgra_outout:
\tl_if_empty:NF \l__incgra_bookmark_heading_text_tl
{
- \tl_set:Nn \l_tmpa_tl { \bookmark[ }
- \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_heading_options_tl
- \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
- \l_tmpa_tl { \l__incgra_bookmark_heading_text_tl }
+ \exp_args:No \__incgra_bookmark_base:nn
+ { \l__incgra_bookmark_heading_options_tl, dest=\igrAutoTarget }
+ { \l__incgra_bookmark_heading_text_tl }
}
- \bool_gset_false:N \g__incgra_first_include
+ \bool_gset_false:N \g__incgra_first_include_bool
}
{
- \igrboxset{\l_tmpa_tl{#2}}
- \igr@output
+ \__incgra_box_set:n
+ {
+ \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+ }
+ \__incgra_outout:
}
}
{
- \tl_if_empty:NTF \l__incgra_label_text_tl
- {
- \igrboxset{\l_tmpa_tl{#2}}
- }
- {
- \igrboxset{\l_tmpa_tl{#2}
- \label{\l__incgra_label_text_tl}}
- }
- \igr@output
+ \__incgra_box_set:n
+ {
+ \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+ \tl_if_empty:NF \l__incgra_label_text_tl { \label { \l__incgra_label_text_tl } }
+ }
+ \__incgra_outout:
}
\tl_if_empty:NF \l__incgra_bookmark_text_tl
{
- \tl_set:Nn \l_tmpa_tl { \bookmark[ }
- \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_options_tl
- \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
- \l_tmpa_tl{\l__incgra_bookmark_text_tl}
+ \exp_args:No \__incgra_bookmark_base:nn
+ { \l__incgra_bookmark_options_tl, dest=\igrAutoTarget }
+ { \l__incgra_bookmark_text_tl }
}
}
\cs_generate_variant:Nn \__incgra_includegraphics:nn { nV }
+\cs_new_protected_nopar:Npn \__incgra_include_graphics_base:nn #1
+ {
+ \__incgra_include_graphics_base:w [ #1 ]
+ }
+
+\cs_new_protected_nopar:Npn \__incgra_bookmark_base:nn #1
+ {
+ \bookmark [ #1 ]
+ }
+
+
\NewDocumentCommand \incgraph { +O{} O{} m }
{
\group_begin:
\igrset{#1}
- \bool_gset_false:N \g__incgra_multi_include
+ \bool_gset_false:N \g__incgra_multi_include_bool
\tl_clear_new:N \nt
\tl_set:Nn \nt {#3}
\__incgra_if_file_exist:nTF{#3}
@@ -448,14 +526,14 @@
{
\group_begin:
\igrset{#1}
- \bool_gset_true:N \g__incgra_multi_include
- \bool_gset_true:N \g__incgra_first_include
+ \bool_gset_true:N \g__incgra_multi_include_bool
+ \bool_gset_true:N \g__incgra_first_include_bool
\tl_clear_new:N \nt
\tl_clear_new:N \nn
\foreach \n [count=\ni] in {#4}
{
\tl_set:Nn \nt {#3}
- \tl_set:Nx \nn {\igr@zero@fill{\n}}
+ \tl_set:Ne \nn { \__incgra_zerofill:n { \n } }
\__incgra_if_file_exist:nTF{#3}
{
\__incgra_includegraphics:nV {#2} \nt
@@ -469,8 +547,8 @@
\NewDocumentEnvironment{inctext}{ +O{} }
{
\igrset{#1}
- \igr@match@hook
- \igr@nextAutoTarget
+ \__incgra_match_hook:
+ \__incgra_set_next_target:
\clearpage
\begin{lrbox}{\igrbox}
}
@@ -481,15 +559,13 @@
\label{\l__incgra_label_text_tl}
}
\end{lrbox}
- \igr@rebox
- \igr@get@box@dimensions
- \igr@output
+ \__incgra_get_box_dimensions:
+ \__incgra_outout:
\tl_if_empty:NF \l__incgra_bookmark_text_tl
{
- \tl_set:Nn \l_tmpa_tl { \bookmark[ }
- \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_options_tl
- \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
- \l_tmpa_tl { \l__incgra_bookmark_text_tl }
+ \exp_args:No \__incgra_bookmark_base:nn
+ { \l__incgra_bookmark_options_tl, dest=\igrAutoTarget }
+ { \l__incgra_bookmark_text_tl }
}
}
@@ -498,7 +574,7 @@
{
include~command/.code =
{
- \cs_set_eq:NN \__incgra_include_graphics:w #1
+ \cs_set_eq:NN \__incgra_include_graphics_base:w #1
},
include~command/.default = \includegraphics,
extensions/.code =
@@ -563,166 +639,257 @@
bookmark~heading/.store~in = \l__incgra_bookmark_heading_text_tl,
bookmark~heading~options/.store~in = \l__incgra_bookmark_heading_options_tl,
label/.store~in = \l__incgra_label_text_tl,
+ overlay~page~number~options/.store~in = \l__incgra_overlay_pagenumber_options_tl,
+ overlay~page~number~options~app/.code =
+ {
+ \tl_if_empty:NTF \l__incgra_overlay_pagenumber_options_tl
+ {
+ \tl_set:Nn \l__incgra_overlay_pagenumber_options_tl { #1 }
+ }
+ {
+ \tl_put_right:Nn \l__incgra_overlay_pagenumber_options_tl { ,#1 }
+ }
+ },
+ overlay~page~number~at/.style =
+ {
+ overlay =
+ {
+ \exp_last_unbraced:NNV \node[\l__incgra_overlay_pagenumber_options_tl]~at~(#1)~{\thepage};
+ }
+ },
+ }
+
+
+\cs_new_protected:Npn \__incgra_make_zerofill:nnnnnnnnn #1#2#3#4#5#6#7#8#9
+ {
+ \cs_gset_nopar:Npn \__incgra_zerofill_construct:n ##1
+ {
+ \if_int_compare:w ##1 < 10 \exp_stop_f: #1
+ \else: \if_int_compare:w ##1 < 100 \exp_stop_f: #2
+ \else: \if_int_compare:w ##1 < 1000 \exp_stop_f: #3
+ \else: \if_int_compare:w ##1 < 10000 \exp_stop_f: #4
+ \else: \if_int_compare:w ##1 < 100000 \exp_stop_f: #5
+ \else: \if_int_compare:w ##1 < 1000000 \exp_stop_f: #6
+ \else: \if_int_compare:w ##1 < 10000000 \exp_stop_f: #7
+ \else: \if_int_compare:w ##1 < 100000000 \exp_stop_f: #8
+ \else: \if_int_compare:w ##1 < 1000000000 \exp_stop_f: #9
+ \fi:\fi:\fi:\fi:\fi:\fi:\fi:\fi:\fi:
+ ##1
+ }
+ }
+
+\NewDocumentCommand \igrmakezerofill { m m }
+ {
+ \cs_gset_nopar:Npn \__incgra_zerofill_construct:n ##1 { ##1 }
+ \if_case:w #2 \exp_stop_f:
+ \or:\or: \__incgra_make_zerofill:nnnnnnnnn{0}{}{}{}{}{}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{00}{0}{}{}{}{}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{000}{00}{0}{}{}{}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{0000}{000}{00}{0}{}{}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{00000}{0000}{000}{00}{0}{}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{000000}{00000}{0000}{000}{00}{0}{}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{0000000}{000000}{00000}{0000}{000}{00}{0}{}{}
+ \or: \__incgra_make_zerofill:nnnnnnnnn{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}{}
+ \else: \__incgra_make_zerofill:nnnnnnnnn{000000000}{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}
+ \fi:
+ \cs_set_eq:NN #1 \__incgra_zerofill_construct:n
+ }
+
+
+\NewDocumentCommand \igrsetmatchvalue { m m }
+ {
+ \pgfkeyssetvalue { /igrmatch/#1 }{ #2 }
+ }
+
+\NewExpandableDocumentCommand \igrifmatch { m m m }
+ {
+ \pgfkeysifdefined{ /igrmatch/#1 }
+ {
+ \pgfkeysgetvalue { /igrmatch/#1 }{ \igrmatchvalue }
+ #2
+ }
+ { #3 }
+ }
+
+
+\pgfkeys
+ {
+ /igrsetmatch/.unknown/.code=
+ {
+ \cs_set_eq:NN \igrmatchkey \pgfkeyscurrentname
+ \igrsetmatchvalue { \igrmatchkey }{ #1 }
+ }
+ }
+
+\NewDocumentCommand \igrsetmatches { m }
+ {
+ \pgfkeys{ /igrsetmatch/.cd, #1 }
}
-\ExplSyntaxOff
-
-
-
-
-\def\igr@make@zerofill#1#2#3#4#5#6#7#8#9{%
- \def\igr@zerofill##1{%
- \ifnum##1<10 #1%
- \else\ifnum##1<100 #2%
- \else\ifnum##1<1000 #3%
- \else\ifnum##1<10000 #4%
- \else\ifnum##1<100000 #5%
- \else\ifnum##1<1000000 #6%
- \else\ifnum##1<10000000 #7%
- \else\ifnum##1<100000000 #8%
- \else\ifnum##1<1000000000 #9%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi%
- ##1%
- }%
-}
-
-\NewDocumentCommand\igrmakezerofill{mm}{%
- \def\igr@zerofill##1{##1}%
- \ifcase#2\or\or\igr@make@zerofill{0}{}{}{}{}{}{}{}{}%
- \or\igr@make@zerofill{00}{0}{}{}{}{}{}{}{}%
- \or\igr@make@zerofill{000}{00}{0}{}{}{}{}{}{}%
- \or\igr@make@zerofill{0000}{000}{00}{0}{}{}{}{}{}%
- \or\igr@make@zerofill{00000}{0000}{000}{00}{0}{}{}{}{}%
- \or\igr@make@zerofill{000000}{00000}{0000}{000}{00}{0}{}{}{}%
- \or\igr@make@zerofill{0000000}{000000}{00000}{0000}{000}{00}{0}{}{}%
- \or\igr@make@zerofill{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}{}%
- \else\igr@make@zerofill{000000000}{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}%
- \fi%
- \let#1=\igr@zerofill%
-}
-
-\NewDocumentCommand\igrsetmatchvalue{mm}{%
- \pgfkeyssetvalue{/igrmatch/#1}{#2}%
-}
-
-\NewExpandableDocumentCommand\igrifmatch{mmm}{%
- \pgfkeysifdefined{/igrmatch/#1}{%
- \pgfkeysgetvalue{/igrmatch/#1}{\igrmatchvalue}#2}{#3}%
-}
-
-\pgfkeys{%
- /igrsetmatch/.unknown/.code={%
- \let\igrmatchkey=\pgfkeyscurrentname%
- \igrsetmatchvalue{\igrmatchkey}{#1}%
- }%
-}
-
-\NewDocumentCommand\igrsetmatches{m}{\pgfkeys{/igrsetmatch/.cd,#1}}
-
-
-\igrset{%
- zerofill/.code={\igrmakezerofill{\igr@zero@fill}{#1}},
- set matches/.code=\igrsetmatches{#1},
- hyper/.code={\let\igr@hypertarget=\igr@hyper},
- no hyper/.code={\def\igr@hypertarget{}},
- if match code/.code args={#1#2#3}{\def\igr@match@hook{\igrifmatch{#1}{#2}{#3}}},
- if match set/.style args={#1#2#3}{if match code={#1}{\igrset{#2}}{\igrset{#3}}},
- if match set bookmark/.style args={#1#2#3}{if match code={#1}{\igrset{bookmark={#2}}}{\igrset{bookmark={#3}}}},
- disable match/.code={\def\igr@match@hook{}},
- pagestyle/.store in=\igrpagestyle,
- target/.code={\igrtargetset{#1}},
- overlay@code/.store in=\igr@tikz@hook,
- overlay/.code={\let\igr@overlay=\igr@overlay@on\igrset{overlay@code={#1}}},
- overlay page number options/.store in=\igr@overlay@pagenumber@options,
- overlay page number at/.style={overlay={%
- \expandafter\node\expandafter[\igr@overlay@pagenumber@options]
- at (#1) {\thepage};}},
- overlay page number at top/.style={overlay page number at={\igrBoxWidth/2,\igrBoxHeight-#1}},
- overlay page number at top/.default=1.5cm,
- overlay page number at bottom/.style={overlay page number at={\igrBoxWidth/2,#1}},
- overlay page number at bottom/.default=1.5cm,
- no overlay/.code={\let\igr@overlay=\igr@overlay@off},
- portrait/.code={\def\igr@turn{port}},
- landscape/.code={\def\igr@turn{land}},
- paper size/.code args={#1:#2}{\def\igr@target@width{#1}\def\igr@target@height{#2}\let\igr@output=\igr@out@center@fit},
- a0paper/.style={paper size=841mm:1189mm},
- a1paper/.style={paper size=594mm:841mm},
- a2paper/.style={paper size=420mm:594mm},
- a3paper/.style={paper size=297mm:420mm},
- a4paper/.style={paper size=210mm:297mm},
- a5paper/.style={paper size=148mm:210mm},
- a6paper/.style={paper size=105mm:148mm},
- a7paper/.style={paper size=74mm:105mm},
- a8paper/.style={paper size=52mm:74mm},
- a9paper/.style={paper size=37mm:52mm},
- a10paper/.style={paper size=26mm:37mm},
- b0paper/.style={paper size=1000mm:1414mm},
- b1paper/.style={paper size=707mm:1000mm},
- b2paper/.style={paper size=500mm:707mm},
- b3paper/.style={paper size=353mm:500mm},
- b4paper/.style={paper size=250mm:353mm},
- b5paper/.style={paper size=176mm:250mm},
- b6paper/.style={paper size=125mm:176mm},
- b7paper/.style={paper size=88mm:125mm},
- b8paper/.style={paper size=62mm:88mm},
- b9paper/.style={paper size=44mm:62mm},
- b10paper/.style={paper size=31mm:44mm},
- c0paper/.style={paper size=917mm:1297mm},
- c1paper/.style={paper size=648mm:917mm},
- c2paper/.style={paper size=648mm:917mm},
- c3paper/.style={paper size=324mm:458mm},
- c4paper/.style={paper size=229mm:324mm},
- c5paper/.style={paper size=162mm:229mm},
- c6paper/.style={paper size=114mm:162mm},
- c7paper/.style={paper size=81mm:114mm},
- c8paper/.style={paper size=57mm:81mm},
- c9paper/.style={paper size=40mm:57mm},
- c10paper/.style={paper size=28mm:40mm},
- d0paper/.style={paper size=771mm:1091mm},
- d1paper/.style={paper size=545mm:771mm},
- d2paper/.style={paper size=385mm:545mm},
- d3paper/.style={paper size=272mm:385mm},
- d4paper/.style={paper size=192mm:272mm},
- d5paper/.style={paper size=136mm:192mm},
- d6paper/.style={paper size=96mm:136mm},
- d7paper/.style={paper size=68mm:96mm},
- executivepaper/.style={paper size=7.25in:10.5in},
- letterpaper/.style={paper size=8.5in:11in},
- legalpaper/.style={paper size=8.5in:14in},
- ledgerpaper/.style={paper size=17in:11in},
- currentpaper/.code={\let\igr@output=\igr@out@center},
- documentpaper/.style={paper size=\igrOrginalPageWidth:\igrOrginalPageHeight},
- graphicspaper/.code={\let\igr@output=\igr@out@page},
- paper/.style={#1paper},
- center/.style=currentpaper,
- page/.style=graphicspaper,
- left border/.store in=\igr@left@border,
- bottom border/.store in=\igr@bottom@border,
- right border/.store in=\igr@right@border,
- top border/.store in=\igr@top@border,
- horizontal border/.style={left border=#1,right border=#1},
- vertical border/.style={bottom border=#1,top border=#1},
- border/.style={left border=#1,bottom border=#1,right border=#1,top border=#1},
-%
- graphicspaper,
- options=,
- bookmark=,
- bookmark options=,
- bookmark heading=,
- bookmark heading options=,
- label=,
- zerofill=0,
- hyper,
- disable match,
- include command,
- ignore on not found,
- extensions={.jpg,.png},
- pagestyle=empty,
- overlay@code=,
- no overlay,
- portrait,
- border=0pt,
- overlay page number options={fill opacity=0.35,draw opacity=0.5,text opacity=1,
- inner xsep=1em,rounded corners,fill=white,draw=black},
-}
+
+\cs_new_protected:Npn \__incgra_define_paper_size:n #1
+ {
+ \__incgra_define_paper_size:w #1 \q_stop
+ }
+
+
+\use:x
+ {
+ \cs_new_protected:Npn \exp_not:N\__incgra_define_paper_size:w ##1 \c_colon_str ##2 \exp_not:N \q_stop
+ }
+ {
+ \__incgra_define_paper_size:nn { #1 }{ #2 }
+ }
+
+
+\cs_new_protected:Npn \__incgra_define_paper_size:nn #1#2
+ {
+ \tl_set:Ne \l__incgra_target_width_tl { #1 }
+ \tl_set:Ne \l__incgra_target_heigth_tl { #2 }
+ \cs_set_eq:NN \__incgra_outout: \__incgra_output_fit:
+ }
+
+\igrset
+ {
+ zerofill / .code = \igrmakezerofill { \__incgra_zerofill:n }{ #1 },
+ set~matches / .code = \igrsetmatches { #1 },
+ hyper / .code = \bool_set_true:N \l__incgra_set_hypertarget_bool,
+ no~hyper/.code = \bool_set_false:N \l__incgra_set_hypertarget_bool,
+ if~match~code / .code~args = {#1#2#3}
+ {
+ \cs_set_nopar:Npn \__incgra_match_hook: { \igrifmatch{#1}{#2}{#3} }
+ },
+ if~match~set/ .style~args = {#1#2#3}{if~match~code={#1}{\igrset{#2}}{\igrset{#3}}},
+ if~match~set~bookmark / .style~args = {#1#2#3}{if~match~code={#1}{\igrset{bookmark={#2}}}{\igrset{bookmark={#3}}}},
+ disable~match / .code =
+ {
+ \cs_set_nopar:Npn \__incgra_match_hook: { }
+ },
+ pagestyle / .store~in = \igrpagestyle,
+ target / .code = { \igrtargetset{#1} },
+ __overlay_code / .code = \tl_set:Nn \l__incgra_overlay_code_tl { #1 },
+ overlay / .code =
+ {
+ \bool_set_true:N \l__incgra_overlay_bool
+ \igrset { __overlay_code={#1} }
+ },
+ overlay~page~number~at~top / .style = {overlay~page~number~at={\igrBoxWidth/2,\igrBoxHeight-#1}},
+ overlay~page~number~at~top / .default = 1.5cm,
+ overlay~page~number~at~bottom / .style = {overlay~page~number~at={\igrBoxWidth/2,#1}},
+ overlay~page~number~at~bottom / .default = 1.5cm,
+ no~overlay / .code = \bool_set_false:N \l__incgra_overlay_bool,
+ portrait / .code = \bool_set_false:N \l__incgra_turn_bool,
+ landscape / .code = \bool_set_true:N \l__incgra_turn_bool,
+ paper~size / .code = \__incgra_define_paper_size:n{#1},
+ a0paper / .code = \__incgra_define_paper_size:nn{841mm}{1189mm},
+ a1paper / .code = \__incgra_define_paper_size:nn{594mm}{841mm},
+ a2paper / .code = \__incgra_define_paper_size:nn{420mm}{594mm},
+ a3paper / .code = \__incgra_define_paper_size:nn{297mm}{420mm},
+ a4paper / .code = \__incgra_define_paper_size:nn{210mm}{297mm},
+ a5paper / .code = \__incgra_define_paper_size:nn{148mm}{210mm},
+ a6paper / .code = \__incgra_define_paper_size:nn{105mm}{148mm},
+ a7paper / .code = \__incgra_define_paper_size:nn{74mm}{105mm},
+ a8paper / .code = \__incgra_define_paper_size:nn{52mm}{74mm},
+ a9paper / .code = \__incgra_define_paper_size:nn{37mm}{52mm},
+ a10paper / .code = \__incgra_define_paper_size:nn{26mm}{37mm},
+ b0paper / .code = \__incgra_define_paper_size:nn{1000mm}{1414mm},
+ b1paper / .code = \__incgra_define_paper_size:nn{707mm}{1000mm},
+ b2paper / .code = \__incgra_define_paper_size:nn{500mm}{707mm},
+ b3paper / .code = \__incgra_define_paper_size:nn{353mm}{500mm},
+ b4paper / .code = \__incgra_define_paper_size:nn{250mm}{353mm},
+ b5paper / .code = \__incgra_define_paper_size:nn{176mm}{250mm},
+ b6paper / .code = \__incgra_define_paper_size:nn{125mm}{176mm},
+ b7paper / .code = \__incgra_define_paper_size:nn{88mm}{125mm},
+ b8paper / .code = \__incgra_define_paper_size:nn{62mm}{88mm},
+ b9paper / .code = \__incgra_define_paper_size:nn{44mm}{62mm},
+ b10paper / .code = \__incgra_define_paper_size:nn{31mm}{44mm},
+ c0paper / .code = \__incgra_define_paper_size:nn{917mm}{1297mm},
+ c1paper / .code = \__incgra_define_paper_size:nn{648mm}{917mm},
+ c2paper / .code = \__incgra_define_paper_size:nn{648mm}{917mm},
+ c3paper / .code = \__incgra_define_paper_size:nn{324mm}{458mm},
+ c4paper / .code = \__incgra_define_paper_size:nn{229mm}{324mm},
+ c5paper / .code = \__incgra_define_paper_size:nn{162mm}{229mm},
+ c6paper / .code = \__incgra_define_paper_size:nn{114mm}{162mm},
+ c7paper / .code = \__incgra_define_paper_size:nn{81mm}{114mm},
+ c8paper / .code = \__incgra_define_paper_size:nn{57mm}{81mm},
+ c9paper / .code = \__incgra_define_paper_size:nn{40mm}{57mm},
+ c10paper / .code = \__incgra_define_paper_size:nn{28mm}{40mm},
+ d0paper / .code = \__incgra_define_paper_size:nn{771mm}{1091mm},
+ d1paper / .code = \__incgra_define_paper_size:nn{545mm}{771mm},
+ d2paper / .code = \__incgra_define_paper_size:nn{385mm}{545mm},
+ d3paper / .code = \__incgra_define_paper_size:nn{272mm}{385mm},
+ d4paper / .code = \__incgra_define_paper_size:nn{192mm}{272mm},
+ d5paper / .code = \__incgra_define_paper_size:nn{136mm}{192mm},
+ d6paper / .code = \__incgra_define_paper_size:nn{96mm}{136mm},
+ d7paper / .code = \__incgra_define_paper_size:nn{68mm}{96mm},
+ executivepaper / .code = \__incgra_define_paper_size:nn{7.25in}{10.5in},
+ letterpaper / .code = \__incgra_define_paper_size:nn{8.5in}{11in},
+ legalpaper / .code = \__incgra_define_paper_size:nn{8.5in}{14in},
+ ledgerpaper / .code = \__incgra_define_paper_size:nn{17in}{11in},
+ documentpaper / .style = \__incgra_define_paper_size:nn{\igrOrginalPageWidth}{\igrOrginalPageHeight},
+ currentpaper / .code = { \cs_set_eq:NN \__incgra_outout: \__incgra_output_center: },
+ graphicspaper / .code = { \cs_set_eq:NN \__incgra_outout: \__incgra_output_page: },
+ paper / .style = { #1paper },
+ center / .style = currentpaper,
+ page / .style = graphicspaper,
+ left~border / .code = \tl_set:Ne \l__incgra_left_border_tl { \dim_eval:n { #1 } },
+ bottom~border / .code = \tl_set:Ne \l__incgra_bottom_border_tl { \dim_eval:n { #1 } },
+ right~border / .code = \tl_set:Ne \l__incgra_right_border_tl { \dim_eval:n { #1 } },
+ top~border / .code = \tl_set:Ne \l__incgra_top_border_tl { \dim_eval:n { #1 } },
+ horizontal~border / .style = { left~border={#1}, right~border={#1} },
+ vertical~border / .style = { bottom~border={#1}, top~border={#1} },
+ border / .style = { left~border={#1}, bottom~border={#1}, right~border={#1}, top~border={#1} },
+ xshift / .code =
+ {
+ \tl_set:Ne \l__incgra_left_border_tl { \dim_eval:n { \l__incgra_left_border_tl + #1 } }
+ \tl_set:Ne \l__incgra_right_border_tl { \dim_eval:n { \l__incgra_right_border_tl - #1 } }
+ },
+ yshift / .code =
+ {
+ \tl_set:Ne \l__incgra_bottom_border_tl { \dim_eval:n { \l__incgra_bottom_border_tl + #1 } }
+ \tl_set:Ne \l__incgra_top_border_tl { \dim_eval:n { \l__incgra_top_border_tl - #1 } }
+ },
+ autosize / .is~choice,
+ autosize / true / .code = \bool_set_true:N \l__incgra_autosize_bool,
+ autosize / false / .code = \bool_set_false:N \l__incgra_autosize_bool,
+ autosize/.default = true,
+ autosize~width~gap /.code = \tl_set:Ne \l__incgra_autosize_width_gap_tl { \dim_eval:n { #1 } },
+ autosize~height~gap /.code = \tl_set:Ne \l__incgra_autosize_height_gap_tl { \dim_eval:n { #1 } },
+ autosize~gap /.style = {autosize~width~gap={#1}, autosize~height~gap={#1} },
+ autosize~min~scale /.code = \fp_set:Nn \l__incgra_autosize_min_scale_fp { #1 },
+ autosize~max~scale /.code = \fp_set:Nn \l__incgra_autosize_max_scale_fp { #1 },
+ }
+
+
+\igrset
+ {
+ graphicspaper,
+ options = ,
+ bookmark = ,
+ bookmark~options = ,
+ bookmark~heading = ,
+ bookmark~heading~options = ,
+ label = ,
+ zerofill = 0,
+ hyper,
+ disable~match,
+ include~command,
+ ignore~on~not~found,
+ extensions = { .jpg, .png },
+ pagestyle = empty,
+ __overlay_code = ,
+ no~overlay,
+ portrait,
+ border = 0pt,
+ overlay~page~number~options =
+ {
+ fill~opacity=0.35, draw~opacity=0.5, text~opacity=1,
+ inner~xsep=1em, rounded~corners, fill=white, draw=black
+ },
+ autosize = false,
+ autosize~width~gap = 0pt,
+ autosize~height~gap = 0pt,
+ autosize~min~scale = 0.001,
+ autosize~max~scale = 1000,
+ }
diff --git a/macros/latex/contrib/incgraph/incgraph.tex b/macros/latex/contrib/incgraph/incgraph.tex
index 1b739cfaf8..6c56f047e0 100644
--- a/macros/latex/contrib/incgraph/incgraph.tex
+++ b/macros/latex/contrib/incgraph/incgraph.tex
@@ -1,10 +1,10 @@
% \LaTeX-Main\
% !TeX encoding=UTF-8
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
%% incgraph.tex: Manual
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -36,7 +36,7 @@
\end{tcolorbox}\bigskip
{\large Thomas F.~Sturm%
\footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
- Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
+ University of the Bundeswehr Munich, D-85577 Neubiberg, Germany;
email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip
\normalsize\url{https://www.ctan.org/pkg/incgraph}\par
\url{https://github.com/T-F-S/incgraph}
@@ -115,14 +115,58 @@ loads the packages |pgf|, |pgffor| \cite{tantau:tikz},
the package |graphicx| \cite{carlisle:graphics}, and the
package |bookmark| \cite{oberdiek:bookmark}.
-\begin{itemize}
-\item The option |nopgf| prevents the loading of |pgf| and |pgffor|.\\
+The following package options are available:
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+ {
+ {
+ doc name = pgf,
+ doc description = {no value, initially set},
+ },
+ {
+ doc name = nopgf,
+ doc description = {no value, initially unset},
+ },
+ }
+ The option |nopgf| prevents the loading of |pgf| and |pgffor|.\\
The opposite option |pgf| resets to loading the packages.
-\item The option |nographicx| prevents the loading of |graphicx|.\\
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+ {
+ {
+ doc name = graphicx,
+ doc description = {no value, initially set},
+ },
+ {
+ doc name = nographicx,
+ doc description = {no value, initially unset},
+ },
+ }
+ The option |nographicx| prevents the loading of |graphicx|.\\
The opposite option |graphicx| resets to loading the package.
-\item The option |nobookmark| prevents the loading of |bookmark|.\\
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+ {
+ {
+ doc name = bookmark,
+ doc description = {no value, initially set},
+ },
+ {
+ doc name = nobookmark,
+ doc description = {no value, initially unset},
+ },
+ }
+ The option |nobookmark| prevents the loading of |bookmark|.\\
The opposite option |bookmark| resets to loading the package.
-\end{itemize}
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
So, the minimal package loading is done with the following:
\begin{dispListing}
@@ -220,7 +264,7 @@ the package |graphicx| \cite{carlisle:graphics}.
\begin{texexptitled}%
{Some text on a shrunk paper; see page~\pageref{inctext1}}{inctext1.listing}
\begin{inctext}[paper=graphics,label={inctext1},bookmark={A huge ABC}]
- \Huge ABC
+ \fontsize{20mm}{20mm}\selectfont\bfseries ABC
\end{inctext}
\end{texexptitled}
@@ -313,18 +357,18 @@ the package |graphicx| \cite{carlisle:graphics}.
\end{docIgrKey}
-\makeatletter%
+\ExplSyntaxOn
\foreach \x in {a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,
b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,
c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,
d0,d1,d2,d3,d4,d5,d6,d7,
executive,letter,legal,ledger}
-{\begin{docIgrKey}{\x paper}{}{no value}
+{\begin{docIgrKey}{\x paper}{}{no~value}
\igrset{\x paper}%
- The paper size is set to
- \texttt{\igr@target@width} $\times$ \texttt{\igr@target@height}.
+ The~paper~size~is~set~to~
+ \texttt{\l__incgra_target_width_tl}~$\times$~\texttt{\l__incgra_target_heigth_tl}.
\end{docIgrKey}}
-\makeatother%
+\ExplSyntaxOff
\begin{docIgrKey}{center}{}{no value, deprecated}
An alias for \refKey{/igr/currentpaper}.
@@ -387,7 +431,7 @@ the package |graphicx| \cite{carlisle:graphics}.
},
}
Omits any existence checks by the package, i.e. the underlying
- \docAuxCommand*{includegraphics} is called directly any may
+ \docAuxCommand*{includegraphics} is called directly and may
stop the compilation with an error if the included file does not exist.
Both options are equal, but the newer \refKey{/igr/no existence check}
is considered to be more comprehensible.
@@ -532,42 +576,129 @@ see page~\pageref{exarotated.listing}.
|bookmark| \cite{oberdiek:bookmark} for a list of applicable \meta{bookmark options}.
\end{docIgrKey}
+
+
\clearpage
-\subsection{Borders}
+\subsection{Autosize}
+
+\begin{docIgrKeys}
+ {
+ {
+ doc name = autosize,
+ doc parameter = \colOpt{=true\textbar false},
+ doc description = {default |true|, initially |false|},
+ doc new = {2024-03-09}
+ }
+ }
+If set to |true|, the picture box is resized to fit into the paper while
+keeping the aspect ratio. This
+setting has no effect for \refKey{/igr/graphicspaper}.
+Note that this autosize is applied after possible size and scaling options
+for |\includegraphics| are conducted, see \refCom{incgraph} and \refCom{incmultigraph}.
+
+\begin{texexptitled}%
+ {Autosized pictures; see from page~\pageref{autosize.1}}{autosize.listing}
+\incmultigraph[zerofill=4, currentpaper, autosize,
+ bookmark heading={Autosized pictures},
+ bookmark heading options={level=subsection},
+ bookmark={\nt},bookmark options={level=subsubsection},
+ overlay page number at bottom,
+ label={autosize.\n}]{exaimage-\nn.png}{1,...,150}
+\end{texexptitled}
+
+The following tuning
+options influence how the resizing is done.
+\end{docIgrKeys}
+
+
+\begin{docIgrKeys}
+ [
+ doc parameter = {=\meta{length}},
+ doc description = {no default, initially |0mm|},
+ doc new = {2024-03-09}
+ ]
+ {
+ { doc name = autosize width gap },
+ { doc name = autosize height gap },
+ { doc name = autosize gap }
+ }
+\meta{length} is subtracted from the width or height of the current paper size
+to compute the target size for the automatic picture box scaling.
+\refKey{/igr/autosize gap} sets both values at the same time.
+For example, |autosize gap=20mm| gives (at least) |10mm| space around
+the rescaled picture box.\par
+Negative \meta{length} values allow the picture box to extrude over the borders of
+the current paper.
+\end{docIgrKeys}
+
+
+\begin{docIgrKeys}
+ [
+ doc parameter = {=\meta{floating-point expression}},
+ doc new = {2024-03-09}
+ ]
+ {
+ { doc name = autosize min scale, doc description = {no default, initially |0.001|} },
+ { doc name = autosize max scale, doc description = {no default, initially |1000|} }
+ }
+The scale number of the automatic scaling will
+always be between \refKey{/igr/autosize min scale} and \refKey{/igr/autosize max scale}
+even if other settings are violated.\par
+|autosize min scale=1| means that the picture box is never to be shrunk.\par
+|autosize max scale=1| means that the picture box is never to be enlarged.\par
+\end{docIgrKeys}
+
+
+
+\clearpage
+\subsection{Borders and Shifts}
The following settings enlarge or shrink the picture box, if
\refKey{/igr/graphicspaper} is used. For other paper settings, the result
-will be just a certain shift of the picture box since the enlarged box
+will be a certain shift of the picture box since the enlarged box
will be centered on the paper.
-\begin{docIgrKey}[][doc new=2015-03-12]{left border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{left border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the left hand side.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{bottom border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{bottom border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the bottom.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{right border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{right border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the right hand side.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{top border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{top border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the top.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{horizontal border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{horizontal border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the left hand side and the right hand side.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{vertical border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{vertical border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at the top and bottom.
\end{docIgrKey}
-\begin{docIgrKey}[][doc new=2015-03-12]{border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{border}{=\meta{length}}{no default, initially |0pt|}
Adds a space of \meta{length} at all four sides.
\end{docIgrKey}
+\begin{docIgrKey}[][doc new={2024-03-08}]{xshift}{=\meta{length}}{no default, initially |0pt|}
+Shifts the picture box in horizontal direction without changing the paper size.
+This adapts the current values of \refKey{/igr/left border} and \refKey{/igr/right border}.
+Therefore, use this option \emph{after} the border values are set.
+\end{docIgrKey}
+
+\begin{docIgrKey}[][doc new={2024-03-08}]{yshift}{=\meta{length}}{no default, initially |0pt|}
+Shifts the picture box in vertical direction without changing the paper size.
+This adapts the current values of \refKey{/igr/top border} and \refKey{/igr/bottom border}.
+Therefore, use this option \emph{after} the border values are set.
+\end{docIgrKey}
+
+
\clearpage
\subsection{Map and Match}
@@ -690,6 +821,11 @@ Adds a space of \meta{length} at all four sides.
\end{docIgrKey}
+\begin{docIgrKey}[][doc new=2021-10-21]{overlay page number options app}{=\marg{tikz options}}{no default, initially unset}
+ Appends the given \meta{tikz options} to \refKey{/igr/overlay page number options}.
+\end{docIgrKey}
+
+
\begin{docIgrKey}{no overlay}{}{no value, initially set}
Removes the overlay setting.
\end{docIgrKey}
@@ -716,9 +852,9 @@ Adds a space of \meta{length} at all four sides.
\clearpage
\hypertarget{optkeyexamples}{}%
-\bookmark[level=section,dest=optkeyexamples]{User Interface Examples}
+\bookmark[level=section,dest=optkeyexamples]{User Interface and Option Examples}
\igrset{bookmark options={level=subsubsection}}
-\foreach \n in {1,...,11} {\inputlisting{\n}}
+\foreach \n in {1,...,12} {\inputlisting{\n}}
\clearpage
%--------------------------------------
@@ -793,7 +929,7 @@ Then, all four pages of the original document are imported to the new paper
size. Note that the actual document content itself is not resized because
letter and DIN A4 are not so very different. If needed, the content could be
shrunk or enlarged easily by adding a |scale| option for the underlying
-|\includegraphics| macro.
+|\includegraphics| macro or by using \refKey{/igr/autosize}.
\inputexamplelisting{\jobname-example-c.tex}{reformatting}
@@ -1179,9 +1315,9 @@ See the result on the following page.
@manual{tantau:tikz,
author = {Till Tantau},
title = {The TikZ and PGF Packages},
- subtitle = {Manual for version 3.1.9a},
+ subtitle = {Manual for version 3.1.10},
url = {https://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf},
- date = {2021-05-15},
+ date = {2023-01-15},
}
@manual{carlisle:graphics,
@@ -1195,14 +1331,14 @@ See the result on the following page.
author = {Andreas Matthias},
title = {The pdfpages Package},
url = {https://mirrors.ctan.org/macros/latex/contrib/pdfpages/pdfpages.pdf},
- date = {2021-03-06},
+ date = {2024-01-21},
}
@manual{oberdiek:bookmark,
author = {Heiko Oberdiek},
title = {The bookmark Package},
url = {https://mirrors.ctan.org/macros/latex/contrib/bookmark/bookmark.pdf},
- date = {2020-11-06},
+ date = {2023-12-10},
}
\end{tcbverbatimwrite}
diff --git a/macros/latex/contrib/jnuexam/exam-a-answer.pdf b/macros/latex/contrib/jnuexam/exam-a-answer.pdf
deleted file mode 100644
index 3088b9303a..0000000000
--- a/macros/latex/contrib/jnuexam/exam-a-answer.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-empty.pdf b/macros/latex/contrib/jnuexam/exam-a-empty.pdf
deleted file mode 100644
index 486e1bf782..0000000000
--- a/macros/latex/contrib/jnuexam/exam-a-empty.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-answer.pdf b/macros/latex/contrib/jnuexam/exam-b-answer.pdf
deleted file mode 100644
index 3da76b9f31..0000000000
--- a/macros/latex/contrib/jnuexam/exam-b-answer.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-empty.pdf b/macros/latex/contrib/jnuexam/exam-b-empty.pdf
deleted file mode 100644
index 047319bf58..0000000000
--- a/macros/latex/contrib/jnuexam/exam-b-empty.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/examfc-a-answer.pdf b/macros/latex/contrib/jnuexam/examfc-a-answer.pdf
new file mode 100644
index 0000000000..f6f0a50649
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfc-a-answer.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-answer.tex b/macros/latex/contrib/jnuexam/examfc-a-answer.tex
index 28d7c75552..e68f2c3da9 100644
--- a/macros/latex/contrib/jnuexam/exam-a-answer.tex
+++ b/macros/latex/contrib/jnuexam/examfc-a-answer.tex
@@ -1,83 +1,85 @@
% -*- coding: utf-8 -*-
% !TEX program = xelatex
-\documentclass{jnuexam}
+\documentclass[chinese]{jnuexam} % 中文试卷
-%\answerfalse %不显示答案
+%\SetExamBoolFalse{answer} %不显示答案
-\setexam{
- binding = 2, % 装订线,1 仅空白试卷有,2 试卷和答案都有
- scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
+\SetExamOption{
+ binding = 2, % 装订线,1 仅空白试卷有,2 试卷和答案都有
+ scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
seed = 19061116, % 随机数种子,用于改变 B 卷小题的随机顺序
}
\begin{document}
-\renewcommand{\niandu}{2017--2018}
-\renewcommand{\xueqi}{2}
-\renewcommand{\kecheng}{大学数学}
-\renewcommand{\zhuanye}{理工四学分} % 可以为空白
-\renewcommand{\jiaoshi}{张三,李四,王五} % 教师姓名
-\renewcommand{\shijian}{2018~年~06~月~28~日}
-\renewcommand{\bixiu}{1} % 1 为必修,0 为选修
-\renewcommand{\bijuan}{1} % 1 为闭卷,0 为开卷
-\renewcommand{\shijuan}{A} % A 或 B 或 C 卷
-\renewcommand{\neizhao}{1} % 1 打勾,0 不勾
-\renewcommand{\waizhao}{0} % 1 打勾,0 不勾
+\examtitle{ % 生成试卷表头
+ niandu = 2017--2018,
+ xueqi = 2,
+ kecheng = 大学数学,
+ zhuanye = 理工四学分, % 可以为空白
+ jiaoshi = {张三,李四,王五}, % 教师姓名
+ shijian = 2018~年~06~月~28~日,
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 0, % 1 打勾,0 不勾
+}
-\makehead % 生成试卷表头
+\gradetable[total=4] % 生成评分表
-\makepart{填空题}{共~6~小题,每小题~3~分,共~18~分}
+\exampart{填空题}[共~6~小题,每小题~3~分,共~18~分]
-\answertable[3em]{6}{3} % 生成答题栏:行高3em,总共6题,每行3题
+\answertable[total=6,column=3,strut=3em] % 生成答题栏:行高3em,总共6题,每行3题
-\begin{problem}
-设常数$k>0$,函数$f(x)=\ln x-\dfrac{x}{\e}+k$在$(0,+\infty)$内零点的个数为 \fillout{$2$}.
-\end{problem}
+\begin{question}
+设常数$k>0$,函数$f(x)=\ln x-\frac{x}{\e}+k$在$(0,+\infty)$内零点的个数为 \fillout{$2$}.
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
设$\va=(2,1,2)$,$\vb=(4,-1,10)$,$\vc=\vb-\lambda\va$,且$\va\bot\vc$,则$\lambda=$ \fillout{$3$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知二阶行列式 $\left|\begin{array}{cc}
1 & 2\\
- 3 & x
\end{array}\right|=0$,则 $x=$ \fillout{$-6$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
向量组 $\alpha_1=(1,1,0), \alpha_2=(0,1,1), \alpha_3=(1,0,1)$,
则将向量 $\beta=(4, 5, 3)$ 表示为 $\alpha_1, \alpha_2, \alpha_3$
的线性组合为 $\beta=$ \fillout{$3\alpha_1+2\alpha_2+\alpha_3$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知随机变量$\xi$的期望和方差各为$E\xi=3, D\xi=2$, 则$E\xi^2=$ \fillout{$11$}.
-\end{problem}
+\end{question}
\vfill
-\begin{problem}
+\begin{question}
已知$\xi$和$\eta$相互独立且$\xi\sim N(1,4), \eta\sim N(2,5)$,则$\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
-\end{problem}
+\end{question}
\vfill
\newpage
-\makepart{单选题}{共~6~小题,每小题~3~分,共~18~分}
+\exampart{单选题}[共~6~小题,每小题~3~分,共~18~分]
-\answertable{6}{6} % 生成答题栏:默认行高,总共8题,每行8题
+\answertable[total=6,column=6] % 生成答题栏:默认行高,总共6题,每行6题
-\begin{problem}
+\begin{question}
在下列等式中,正确的结果是\pickout{C}
\begin{abcd}
\item $\int f'(x)\dx=f(x)$
@@ -85,11 +87,11 @@
\item $\frac{\d}{\dx}\big(\int f(x)\dx\big)=f(x)$
\item $\d\big(\int f(x)\dx\big)=f(x)$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
假设$F(x)$是连续函数$f(x)$的一个原函数,则必有\pickout{A}
\begin{abcd}
\item $F(x)$是偶函数 $\Leftrightarrow$ $f(x)$是奇函数
@@ -97,11 +99,11 @@
\item $F(x)$是周期函数 $\Leftrightarrow$ $f(x)$是周期函数
\item $F(x)$是单调函数 $\Leftrightarrow$ $f(x)$是单调函数
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
设矩阵 $A = \left(\begin{array}{ccc}
1 & 1 & 0\\
1 & x & 0\\
@@ -114,11 +116,11 @@
\item $0$
\item $-1$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
二次型 $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ 对应的矩阵等于 \pickout{C}
\begin{abcd}
\item $\left(\begin{array}{cc}
@@ -138,11 +140,11 @@
- 1 & 3
\end{array}\right)$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
下列说法\CJKunderline{不正确}的是\pickout{B}
\begin{abcd}
\item 大数定律说明了大量相互独立且同分布的随机变量的均值的稳定性
@@ -150,11 +152,11 @@
\item 中心极限定理说明了大量相互独立且同分布的随机变量的和的稳定性
\item 中心极限定理说明大量相互独立且同分布的随机变量的和近似于正态分布
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
-\begin{problem}
+\begin{question}
对总体$X$和样本$(X_1,\cdots,X_n)$的说法哪个是\CJKunderline{不正确}的\pickout{D}
\begin{abcd}
\item 总体是随机变量
@@ -162,17 +164,17 @@
\item $X_1, \cdots, X_n$相互独立
\item $X_1 = X_2 =\cdots = X_n$
\end{abcd}
-\end{problem}
+\end{question}
\bigskip
\newpage
-\makepart{计算题}{共~6~小题,每小题~8~分,共~48~分}
+\exampart{计算题}[共~6~小题,每小题~8~分,共~48~分]
-\begin{problem}
+\begin{question}
求不定积分$\displaystyle\int\e^{2x}\,(\tan x+1)^2\dx$。
-\end{problem}
+\end{question}
\smallskip
@@ -186,9 +188,9 @@
\vfill
-\begin{problem}
+\begin{question}
求过点$A(1,2,-1), B(2,3,0),C(3,3,2)$ 的三角形$\triangle ABC$ 的面积和它们确定的平面方程.
-\end{problem}
+\end{question}
\smallskip
@@ -199,8 +201,8 @@
1&1&1\\
2&1&3\\
\end{vmatrix}=(2,-1,-1)$, \points{4}
-三角形$\triangle ABC$ 的面积为$S_{\triangle ABC}=\dfrac{1}{2}\big|\overrightarrow{AB}\times
-\overrightarrow{AC}\big|=\dfrac{1}{2}\sqrt{6}.$ \points{6}
+三角形$\triangle ABC$ 的面积为$S_{\triangle ABC}=\frac{1}{2}\big|\overrightarrow{AB}\times
+\overrightarrow{AC}\big|=\frac{1}{2}\sqrt{6}.$ \points{6}
所求平面的方程为$2(x-2)-(y-3)-z=0$, 即$2x-y-z-1=0$ \points{8}
\end{solution}
@@ -208,14 +210,14 @@
\newpage
-\begin{problem}
+\begin{question}
计算四阶行列式 $A = \left|\begin{array}{cccc}
0 & 1 & 2 & 3\\
1 & 2 & 3 & 0\\
2 & 3 & 0 & 1\\
3 & 0 & 1 & 2
\end{array}\right|$ 的值.
-\end{problem}
+\end{question}
\smallskip
@@ -247,10 +249,10 @@ $A \? = \left|\begin{array}{cccc}
\vfill
-\begin{problem}
+\begin{question}
利用配方法,将二次型 $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12
x_2 x_3 + 9 x^2_3$ 化为标准形 $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$ .
-\end{problem}
+\end{question}
\smallskip
@@ -268,11 +270,11 @@ $f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
\newpage
-\begin{problem}
+\begin{question}
设每发炮弹命中飞机的概率是0.2且相互独立,现在发射100发炮弹.\par
(1) 用切贝谢夫不等式估计命中数目$\xi$在10发到30发之间的概率.\par
(2) 用中心极限定理估计命中数目$\xi$在10发到30发之间的概率.
-\end{problem}
+\end{question}
\smallskip
@@ -287,10 +289,10 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\vfill
-\begin{problem}
+\begin{question}
从正态总体$N(\mu,\sigma^2)$中抽出样本容量为16的样本,算得其平均数为3160,标准差为100.
试检验假设$H_0:\mu=3140$是否成立($\alpha = 0.01$).
-\end{problem}
+\end{question}
\smallskip
@@ -306,13 +308,13 @@ $E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$.
\newpage
-\makepart{证明题}{共~2~小题,每小题~8~分,共~16~分}
+\exampart{证明题}[共~2~小题,每小题~8~分,共~16~分]
-\renewcommand{\solutionname}{证} % 将“解”字改为“证”字
+\SetExamTranslation{solution-Solution=证} % 将“解”字改为“证”字
-\begin{problem}
+\begin{question}
设数列$\{x_n\}$满足$x_1=\sqrt2$,$x_{n+1}=\sqrt{2+x_n}$.证明数列收敛,并求出极限.
-\end{problem}
+\end{question}
\smallskip
@@ -330,9 +332,9 @@ $$A=\sqrt{2+A}.$$
\vfill
-\begin{problem}
+\begin{question}
设事件$A$和$B$相互独立,证明$A$和$\widebar{B}$相互独立.
-\end{problem}
+\end{question}
\smallskip
@@ -345,7 +347,7 @@ $$A=\sqrt{2+A}.$$
\vfill
-\makedata{一些可能用到的数据} %附录数据
+\examdata{一些可能用到的数据} %附录数据
\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
\hline
diff --git a/macros/latex/contrib/jnuexam/examfc-a-blank.pdf b/macros/latex/contrib/jnuexam/examfc-a-blank.pdf
new file mode 100644
index 0000000000..09d8a14b15
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfc-a-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-empty.tex b/macros/latex/contrib/jnuexam/examfc-a-blank.tex
index 953a4aab9f..4d1ccf82c9 100644
--- a/macros/latex/contrib/jnuexam/exam-b-empty.tex
+++ b/macros/latex/contrib/jnuexam/examfc-a-blank.tex
@@ -3,4 +3,4 @@
% 重新排版原有的 A4 试卷,不显示答案
\PassOptionsToClass{noanswer}{jnuexam}
-\input{exam-b-answer}
+\input{examfc-a-answer}
diff --git a/macros/latex/contrib/jnuexam/examfc-b-answer.pdf b/macros/latex/contrib/jnuexam/examfc-b-answer.pdf
new file mode 100644
index 0000000000..2356b53690
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfc-b-answer.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-b-answer.tex b/macros/latex/contrib/jnuexam/examfc-b-answer.tex
index 6925ea8fff..e850a68bb3 100644
--- a/macros/latex/contrib/jnuexam/exam-b-answer.tex
+++ b/macros/latex/contrib/jnuexam/examfc-b-answer.tex
@@ -3,4 +3,4 @@
% 从 A 卷自动生成 B 卷,将题目乱序排列
\PassOptionsToClass{random}{jnuexam}
-\input{exam-a-answer}
+\input{examfc-a-answer}
diff --git a/macros/latex/contrib/jnuexam/examfc-b-blank.pdf b/macros/latex/contrib/jnuexam/examfc-b-blank.pdf
new file mode 100644
index 0000000000..d9160a13ed
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfc-b-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/exam-a-empty.tex b/macros/latex/contrib/jnuexam/examfc-b-blank.tex
index 2309945737..3a9dea5d81 100644
--- a/macros/latex/contrib/jnuexam/exam-a-empty.tex
+++ b/macros/latex/contrib/jnuexam/examfc-b-blank.tex
@@ -3,4 +3,4 @@
% 重新排版原有的 A4 试卷,不显示答案
\PassOptionsToClass{noanswer}{jnuexam}
-\input{exam-a-answer}
+\input{examfc-b-answer}
diff --git a/macros/latex/contrib/jnuexam/examfe-a-answer.pdf b/macros/latex/contrib/jnuexam/examfe-a-answer.pdf
new file mode 100644
index 0000000000..6ac1d17806
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-a-answer.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/examfe-a-answer.tex b/macros/latex/contrib/jnuexam/examfe-a-answer.tex
new file mode 100644
index 0000000000..ee35652a91
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-a-answer.tex
@@ -0,0 +1,375 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+\documentclass[english]{jnuexam} % 英文试卷
+
+%\SetExamBoolFalse{answer} % hide answers
+
+\SetExamOption{
+ binding = 1, % 装订线,1 仅空白试卷有,2 试卷和答案都有
+ scratch = 1, % 草稿纸数量,仅空白试卷有,A3 大小,双面印刷
+ seed = 19061116, % 随机数种子,用于改变 B 卷小题的随机顺序
+}
+
+\begin{document}
+
+% make exam title
+\examtitle{
+ AcademicYear = 2016--2017, % 教学年度
+ Semester = 2, % 第几学期
+ CourseTitle = Math 1906, % 课程名称
+ Instructor = {Jianrui Lyu}, % 教师姓名
+ Date = dd/mm/yyyy, % 考试时间
+ Compulsory = 1, % 是否必修:1 为必修,0 为选修
+ ClosedBook = 1, % 是否闭卷:1 为闭卷,0 为开卷
+ Paper = A, % 试卷版本:A 或 B 或 C 卷
+ Mainland = 0, % 内招适用:1 打勾,0 不勾
+ NonMainland = 1, % 外招适用:1 打勾,0 不勾
+}
+
+\gradetable[total=4]
+
+\exampart{Fill in the blanks.}[6 questions; 3 points for each; 18 points in total.]
+
+% make answer table: six in total, three for each row, strut height 3em
+\answertable[total=6,column=3,strut=3em]
+
+\begin{question}
+The first question $k>0$, text $f(x)=\ln x-\frac{x}{\e}+k$ text $(0,+\infty)$
+text text text text text text text text text text text text text text text text
+text text text text text text text text text text text text text \fillout{$2$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The second question $\va=(2,1,2)$, $\vb=(4,-1,10)$, $\vc=\vb-\lambda\va$,
+text text text $\va\bot\vc$, text text text text text text text text text
+text text text text text $\lambda=$ \fillout{$3$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The third question $\left|\begin{array}{cc}
+ 1 & 2\\
+ -3 & x
+\end{array}\right|=0$, text text text text text text text text
+text text text text text text text text text $x=$ \fillout{$-6$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fourth question $\alpha_1=(1,1,0), \alpha_2=(0,1,1), \alpha_3=(1,0,1)$,
+text $\beta=(4, 5, 3)$ text $\alpha_1, \alpha_2, \alpha_3$ text text text text
+text text text text text text text text text text text text text text text text
+text text text text text text $\beta=$ \fillout{$3\alpha_1+2\alpha_2+\alpha_3$}.
+\end{question}
+
+\bigskip
+
+\begin{question}%[points=3]
+The fifth question $\xi$ text text text $E\xi=3, D\xi=2$, text text text text text
+text text text text text text text text text text $E\xi^2=$ \fillout{$11$}.
+\end{question}
+
+\bigskip
+
+\begin{question}
+The sixth question $\xi$ text text text text $\eta$ text text text text $\xi\sim N(1,4),
+\eta\sim N(2,5)$, text text text text text text text text text text text text text text
+text text text text text text text text text text $\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
+\end{question}
+
+\bigskip
+
+\newpage
+
+\exampart{Select one answer from four choices.}[6 questions; 3 points for each; 18 points in total.]
+
+% make answer table: six in total, six for each row, default strut height
+\answertable[total=6,column=6]
+
+\begin{question}
+The first question text, text text text text text text text text text text
+text text text text text text text text text text text text text \pickout{C}
+\begin{abcd}
+\item first $\int f'(x)\dx=f(x)$
+\item second $\int \d f(x)=f(x)$
+\item third $\frac{\d}{\dx}\big(\int f(x)\dx\big)=f(x)$
+\item fourth $\d\big(\int f(x)\dx\big)=f(x)$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The second question $F(x)$ text $f(x)$ text, text \pickout{A}
+\begin{abcd}
+\item first choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text
+\item second choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text
+\item third choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text text
+\item fourth choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text text
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The third question $A = \left(\begin{array}{ccc}
+ 1 & 1 & 0\\
+ 1 & x & 0\\
+ 0 & 0 & 1
+\end{array}\right)$ text text $\lambda_1 = 1$ text $\lambda_2
+= 2$, text $x=$ \pickout{B}
+\begin{abcd}
+\item $2$
+\item $1$
+\item $0$
+\item $-1$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fourth question $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ text text text text text text
+text text text text text text text text text text text text text text text \pickout{C}
+\begin{abcd}
+\item $\left(\begin{array}{cc}
+ 4 & - 2\\
+ - 2 & 6
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 2 & - 2\\
+ - 2 & 3
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 4 & - 1\\
+ - 1 & 6
+\end{array}\right)$
+\item $\left(\begin{array}{cc}
+ 2 & - 1\\
+ - 1 & 3
+\end{array}\right)$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The fifth question \underline{wrong} text \pickout{B}
+\begin{abcd}
+\item first choice text text text text text text text text text
+\item second choice text text text text text text text text text
+\item third choice text text text text text text text text text
+\item fourth choice text text text text text text text text text
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\begin{question}
+The sixth question $X$ text $(X_1,\cdots,X_n)$ text \underline{wrong} text text
+text text text text text text text text text text text text text text \pickout{D}
+\begin{abcd}
+\item text text text
+\item text $n$ text
+\item $X_1, \cdots, X_n$ text
+\item $X_1 = X_2 =\cdots = X_n$
+\end{abcd}
+\end{question}
+
+\bigskip
+
+\newpage
+
+\exampart{Work out math questions.}[6 questions; 8 points for each; 48 points in total.]
+
+\begin{question}
+The first question $\int\e^{2x}\,(\tan x+1)^2\dx$.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$I$ \? $=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \points{2}
+\+ $=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \points{4}
+\+ $=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \points{6}
+\+ $=\e^{2x}\,\tan x + C$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The second question $A(1,2,-1), B(2,3,0),C(3,3,2)$ text $\triangle ABC$ text text text text text text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+Text $\overrightarrow{AB}=(1,1,1),\overrightarrow{AC}=(2,1,3)$, \points{2}
+text $\overrightarrow{AB}\times \overrightarrow{AC}=\begin{vmatrix}
+\vec{i}&\vec{j} &\vec{k}\\
+1&1&1\\
+2&1&3\\
+\end{vmatrix}=(2,-1,-1)$, \points{4}
+text $\triangle ABC$ text $S_{\triangle ABC}=\frac{1}{2}\big|\overrightarrow{AB}\times
+\overrightarrow{AC}\big|=\frac{1}{2}\sqrt{6}.$ \points{6}
+Text text $2(x-2)-(y-3)-z=0$, text $2x-y-z-1=0$. \points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\begin{question}
+The third question $A = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 2 & 3 & 0 & 1\\
+ 3 & 0 & 1 & 2
+\end{array}\right|$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$A \? = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 2 & 3 & 0 & 1\\
+ 3 & 0 & 1 & 2
+ \end{array}\right| = \left|\begin{array}{cccc}
+ 0 & 1 & 2 & 3\\
+ 1 & 2 & 3 & 0\\
+ 0 & - 1 & - 6 & 1\\
+ 0 & - 6 & - 8 & 2
+ \end{array}\right| = 1 \cdot (- 1)^{2 + 1} \left|\begin{array}{ccc}
+ 1 & 2 & 3\\
+ - 1 & - 6 & 1\\
+ - 6 & - 8 & 2
+ \end{array}\right|$ \points{4}
+\+ $= -\left|\begin{array}{ccc}
+ 1 & 2 & 3\\
+ 0 & - 4 & 4\\
+ 0 & 4 & 20
+ \end{array}\right| = - \left|\begin{array}{cc}
+ - 4 & 4\\
+ 4 & 20
+ \end{array}\right| = -(-4\cdot20-4\cdot4) = 96$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The fourth question, tex text $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12
+x_2 x_3 + 9 x^2_3$ text text $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
+ \+ $= x_1^2 + 2 x_1 (x_2 - 3 x_3) + (x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3 $ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \points{3}
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 2 x_2 \cdot 3 x_3 + (3 x_3)^2 - 9x_3^2$ \par
+ \+ $= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \points{6}
+Text $y_1 = x_1 + x_2 - 3 x_3, y_2 = x_2 - 3 x_3, y_3 = x_3$, \newline
+text $f = y_1^2 + y_2^2 - 9y_3^2$ text.\points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\begin{question}
+The fifth question text text text $0.2$ text text, text text $100$ text text.\par
+(1) text text text text text text $\xi$ text $10$ text $30$ text.\par
+(2) text text text text text $\xi$ text $10$ text $30$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+$E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \points{2}
+(1) $P (10 < \xi < 30) = P (|\xi - E\xi| < 10) \ge 1 - \frac{D\xi}{10^2}
+ = 1 - \frac{16}{100} = 0.84$. \points{4}
+(2) $P (10 < \xi < 30) \? \approx \Phi_0\left(\frac{30 - 20}{\sqrt{16}}\right)
+ - \Phi_0\left(\frac{10 - 20}{\sqrt{16}}\right)$ \points{6}
+ \+ $= 2 \Phi_0(2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}
+The sixth question $N(\mu,\sigma^2)$ text text $16$ text, text text text $3160$, text text $100$.
+Text text $H_0:\mu=3140$ text text ($\alpha = 0.01$).
+\end{question}
+
+\smallskip
+
+\begin{solution}
+(1) Text text $H_0 : \mu = 3140$. \points{2}
+(2) Text text text $T = \frac{\widebar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \points{3}
+(3) Text text $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \points{5}
+(4) Text text text $t = \frac{\widebar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\points{7}
+(5) Text $| t | < t_{\alpha}$, text text $H_0$, text text text. \points{8}
+\end{solution}
+
+\vfill
+
+\newpage
+
+\exampart{Work out math proofs.}[2 questions; 16 points in total.]
+
+\SetExamTranslation{solution-Solution=Proof} % rename "Solution" as "Proof"
+
+\begin{question}[points=9]
+The first question $\{x_n\}$ text $x_1=\sqrt2$, $x_{n+1}=\sqrt{2+x_n}$.
+Text text text, text text text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+(1) Text, text $x_1<2$, text $x_k<2$ text
+$$x_{k+1}=\sqrt{2+x_k}<\sqrt{2+2}=2,$$
+Text text text text text $n$ text $x_n<2$, text text text.
+Text text
+$$\frac{x_{n+1}}{x_n}=\sqrt{\frac{2}{x_n^2}+\frac{1}{x_n}}>\sqrt{\frac{2}{2^2}+\frac{1}{2}}=1,$$
+Text text text text text. Text text text text text, Text text text text.\points{4}
+(2) Text text text text $A$, text text text text text text
+$$A=\sqrt{2+A}.$$
+Text text $A=2$, text text $\{x_n\}$ text text text $2$.\points{8}
+\end{solution}
+
+\vfill
+
+\begin{question}[points=7]
+The second question $A$ text $B$ text, text $A$ text $\widebar{B}$ text.
+\end{question}
+
+\smallskip
+
+\begin{solution}
+\? $P (A \cdot \widebar{B}) = P (A - B) = P (A - A B)$ \points{2}
+\< $= P (A) - P (A B) = P (A) - P (A) P (B)$ \points{4}
+\< $= P (A) (1 - P (B)) = P (A) P (\widebar{B})$ \points{6}
+Text text text $A$ text text text $\widebar{B}$ text text text.\points{8}
+\end{solution}
+
+\vfill
+
+\examdata{Some data may be used in the exam} % appendix data
+
+\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
+\hline
+\Phi_0(0.5)=0.6915 & \Phi_0(1)=0.8413 & \Phi_0(2)=0.9773 & \Phi_0(2.5)=0.9938 \\
+t_{0.01}(8)=3.355 & t_{0.01}(9)=3.250 & t_{0.01}(15)=2.947 & t_{0.01}(16)=2.921 \\
+\chi_{0.005}^2(8)=22.0 & \chi_{0.005}^2(9)=23.6 & \chi_{0.005}^2(15)=32.8 & \chi_{0.005}^2(16)=34.3 \\
+\chi_{0.995}^2(8)=1.34 & \chi_{0.995}^2(9)=1.73 & \chi_{0.995}^2(15)=4.60 & \chi_{0.995}^2(16)=5.14 \\
+\hline
+\end{tabularx}
+
+\end{document}
diff --git a/macros/latex/contrib/jnuexam/examfe-a-blank.pdf b/macros/latex/contrib/jnuexam/examfe-a-blank.pdf
new file mode 100644
index 0000000000..4192ead99f
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-a-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/examfe-a-blank.tex b/macros/latex/contrib/jnuexam/examfe-a-blank.tex
new file mode 100644
index 0000000000..c017f4b528
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-a-blank.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Typeset original exam, hiding answers
+\PassOptionsToClass{noanswer}{jnuexam}
+\input{examfe-a-answer}
diff --git a/macros/latex/contrib/jnuexam/examfe-b-answer.pdf b/macros/latex/contrib/jnuexam/examfe-b-answer.pdf
new file mode 100644
index 0000000000..bf5e9342ee
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-b-answer.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/examfe-b-answer.tex b/macros/latex/contrib/jnuexam/examfe-b-answer.tex
new file mode 100644
index 0000000000..b46878822f
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-b-answer.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Generate version B from version A, shuffling questions
+\PassOptionsToClass{random}{jnuexam}
+\input{examfe-a-answer}
diff --git a/macros/latex/contrib/jnuexam/examfe-b-blank.pdf b/macros/latex/contrib/jnuexam/examfe-b-blank.pdf
new file mode 100644
index 0000000000..c37242241f
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-b-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/examfe-b-blank.tex b/macros/latex/contrib/jnuexam/examfe-b-blank.tex
new file mode 100644
index 0000000000..b09d13c45c
--- /dev/null
+++ b/macros/latex/contrib/jnuexam/examfe-b-blank.tex
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+% !TEX program = xelatex
+
+% Typeset original exam, hiding answers
+\PassOptionsToClass{noanswer}{jnuexam}
+\input{examfe-b-answer}
diff --git a/macros/latex/contrib/jnuexam/jnuexam.cls b/macros/latex/contrib/jnuexam/jnuexam.cls
index 6fa3b722ca..f5df920469 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.cls
+++ b/macros/latex/contrib/jnuexam/jnuexam.cls
@@ -6,7 +6,7 @@
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jnuexam}[2024/02/02 v2.1.1 An exam class for Jinan University]
+\ProvidesClass{jnuexam}[2024-02-18 v2024E An exam class for Jinan University]
%% 旧版本的 LaTeX 不能识别 2022-11-01 这种日期格式
%\@ifl@t@r\fmtversion{2022-11-01}{}{
@@ -17,1308 +17,546 @@
}{Please update your TeX distribution first.}
}
-\newif\ifplain \plainfalse % 是否添加装订线和草稿纸
-\newif\iftwoinone \twoinonefalse % 是否使用 A3 纸张
-\newif\ifoneside \onesidefalse % 是否单面印刷试卷
-\newif\ifresetnumber \resetnumbertrue % 是否对各题型小题分别编号
-\newif\ifrandom \randomfalse % 是否乱序出题
-\newif\ifanswer \answertrue % 是否显示答案
-\newif\ifamsfonts \amsfontsfalse % 切换数学字体
-\newif\ifsourcehan \sourcehanfalse % 切换思源字体
-\newif\ifsolidot \solidotfalse % 是否替换空心句号为实心句号
-\newif\ifcellspace \cellspacefalse % 增加表格列间距
-\newif\ifmedmath \medmathfalse % 切换公式尺寸
-
-\DeclareOption{plain}{\plaintrue}
-\DeclareOption{a3paper}{\twoinonetrue}
-\DeclareOption{a3input}{\twoinonetrue\plaintrue}
-\DeclareOption{oneside}{\onesidetrue}
-\DeclareOption{random}{\randomtrue}
-\DeclareOption{noanswer}{\answerfalse}
-\DeclareOption{amsfonts}{\amsfontstrue}
-\DeclareOption{sourcehan}{\sourcehantrue}
-\DeclareOption{solidot}{\solidottrue}
-\DeclareOption{medmath}{\cellspacetrue\medmathtrue}
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexart}} %其它选项
-
-\ProcessOptions %不可省略
-
-% 四号 小四号 五号 小五号
-% 14bp 12bp 10.5bp 9bp
-% 实际上,在旧版本 ctex 中只能用 cs4size 和 c5size 选项
-% 而新版本 ctex 中,可以利用 zihao 选项指定各种中文字号
-\PassOptionsToPackage{CJKnumber}{xeCJK}
-\LoadClass[cs4size,UTF8,noindent]{ctexart}
-
-% 在旧版本 xeCJK 中,必须用 CJKnumber 选项载入 CJKnumb 包,后面才载入会报错
-% 但在新版本 xeCJK 中 CJKnumber 选项已经被废弃,需要在后面自行载入它
-% 在 xeCJK 中已经禁止载入 CJK,但是在新版本 ctex 宏包中却失效了
-% 我们假装 CJK 已经载入,再载入 CJKnumb,避免出现 \CJKglue 重复定义的问题
-% 注意用 PDFLaTeX 编译时需要用到 CJK,所以只在未定义时才作修改
-\ifdefined\CJKglue
- \@namedef{ver@CJK.sty}{}
- %\@namedef{opt@CJK.sty}{}
-\fi
-\RequirePackage{CJKnumb}
-
-% 新版本 xeCJK 已经废弃并禁用 CJKfntef,改用 xeCJKfntef 取代,我们需要载入后者
-% 注意要保证能在较旧的 TeX 系统中编译,我们只能用 \ifXeTeX 而不能用 \ifxetex
-% 因为旧版本 iftex 宏包只有 \ifXeTeX 命令,而 ifxetex 宏包才有 \ifxetex 命令
-% 在 2019 年 10 月,LaTeX 开发团队接管了 iftex 宏包,新版本同时提供这两个命令
-\RequirePackage{CJKfntef}
-\RequirePackage{iftex}
-\ifXeTeX\@ifpackagelater{xeCJK}{2020/02/10}{\RequirePackage{xeCJKfntef}}{}\fi
-
-\iftwoinone
- \RequirePackage[a3paper,landscape,twocolumn,columnsep=60mm,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
-\else
- \RequirePackage[a4paper,left=30mm,right=30mm,top=25mm,bottom=25mm]{geometry}
-\fi
-
-\RequirePackage{amsmath}
-\RequirePackage{array}
-\RequirePackage{calc}
-\RequirePackage{comment}
-\RequirePackage[inline]{enumitem}
-\RequirePackage{environ}
-\RequirePackage{etoolbox}
-\RequirePackage{fancyhdr}
-\RequirePackage{zref-user,zref-lastpage}
-\RequirePackage{tabularx}
-\RequirePackage{xcolor}
-\RequirePackage{xkeyval}
-
-\ifplain
- \allowdisplaybreaks[4]
-\fi
-
-\ifamsfonts
- \RequirePackage{amssymb}
-\else
- \RequirePackage[utopia]{mathdesign} % charter, utopia
- \renewcommand\bfdefault{bx}
- \let\oldoiint\oiint\renewcommand{\oiint}{\oldoiint\nolimits}
- \DeclareTextCommandDefault{\nobreakspace}{\leavevmode\nobreak\ }
-\fi
-
-\newcolumntype{Y}{>{\centering\arraybackslash}X}
-\newcolumntype{n}[1]{>{\centering\arraybackslash}m{#1}}
-
-\setlength{\parindent}{0em}
-\setlength{\lineskiplimit}{4pt}
-\setlength{\lineskip}{4pt}
-
%% ---------------------------------------------------------------------------
-%% 装订线命令 \addbindingline
-%% 草稿纸命令 \addscratchpaper
-%% 这两个命令需要编译两次才能得到正确结果
+%% 开始忽略代码中的空白符号
%% ---------------------------------------------------------------------------
-\newcommand{\setexam}[1]{\setkeys{jnuexam@setup}{#1}}
+\RequirePackage{functional}
+\IgnoreSpacesOn
-\ifplain\else
- \RequirePackage{tikz}
- \RequirePackage{everypage}
-\fi
-
-\newcommand{\bindinglineleft}{
- \path (current page.north west) +(25mm,-25mm) coordinate (a1);
- \path (current page.south west) +(25mm,25mm) coordinate (a2);
- \draw[dashed] (a1) -- node[left=1mm,text width=1em,inner sep=0pt]{\1{线}\0\1{订}\0\1{装}} (a2);
-}
+\InputIfFileExists{jnuexam.cfg}{}{}
-\newcommand{\bindinglineright}{
- \path (current page.north east) +(-25mm,-25mm) coordinate (b1);
- \path (current page.south east) +(-25mm,25mm) coordinate (b2);
- \draw[dashed] (b1) -- node[right=1mm,text width=1em,inner sep=0pt]{\2{装}\0\2{订}\0\2{线}} (b2);
+\DeclareKeys[jnuexam]{
+ english .code = \PassOptionsToClass{language=english}{randexam}
+ ,chinese .code = \PassOptionsToClass{language=chinese}{randexam}
}
-\newcommand{\bindinglineone}{%
-\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
-\begin{tikzpicture}[remember picture,overlay,very thick]
- \ifnumodd{\value{page}}{\bindinglineleft}{\bindinglineright}
-\end{tikzpicture}}
-
-\newcommand{\bindinglinetwo}{%
-\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}%
-\begin{tikzpicture}[remember picture,overlay,very thick]
- \bindinglineleft\bindinglineright
-\end{tikzpicture}}
-
-\iftwoinone
- \let\bindingline=\bindinglinetwo
-\else
- \let\bindingline=\bindinglineone
-\fi
+\DeclareUnknownKeyHandler{\PassOptionsToClass{\CurrentOption}{randexam}}
+\ProcessKeyOptions
-\def\zhuangdingxian{1}
-\define@key{jnuexam@setup}{binding}[2]{\def\zhuangdingxian{#1}}
-
-\newcommand{\addbindingline}{%
- \ifcase\zhuangdingxian % 0
- \or % 1
- \ifbool{answer}{}{\bindingline}%
- \or % 2
- \bindingline
- \fi
-}
+\LoadClass[freealign,moremath]{randexam}
-\ifplain\else
- \AddEverypageHook{\addbindingline}
-\fi
-
-\newcommand{\scratchpaperone}{%
-\begin{tikzpicture}[remember picture,overlay,font=\sffamily\fontsize{120pt}{120pt}\selectfont]
- \node[text=lightgray!40,text width=120pt] at (current page.center) {草\\ 稿\\ 纸};
-\end{tikzpicture}}
-
-\newcommand{\scratchpapertwo}{%
-\begin{tikzpicture}[remember picture,overlay,font=\sffamily\fontsize{180pt}{180pt}\selectfont]
- \node[text=lightgray!40] at (current page.center) {草\quad 稿\quad 纸};
-\end{tikzpicture}}
-
-\def\caogaozhi{0}
-\define@key{jnuexam@setup}{scratch}[1]{\def\caogaozhi{#1}}
-
-\newcounter{my@empty@page} % 空白页数
-\newcounter{my@scratch@page} % 草稿页数
-\newcounter{my@extra@page} % 空白页数+草稿页数
+%% ---------------------------------------------------------------------------
+%% 试卷中英文字符串翻译
+%% ---------------------------------------------------------------------------
-% 添加空白页,使得草稿纸前页数在单面印刷时为偶数,双面印刷时为4的倍数
-% 添加草稿纸,页数在单面印刷时等于设置值的两倍,双面印刷时等于设置值的4倍
-\newcommand{\doscratchpaperone}{%
- \clearpage\pagestyle{empty}\let\addbindingline=\relax
- \ifnumgreater{\caogaozhi}{0}{%
- \ifbool{oneside}{%
- \ifnumodd{\value{page}}%
- {\setcounter{my@empty@page}{0}}%
- {\setcounter{my@empty@page}{1}}%
- \setcounter{my@scratch@page}{\caogaozhi*2}%
- }{%
- \setcounter{my@empty@page}{(\value{page}+2)/4*4+1-\value{page}}%
- \setcounter{my@scratch@page}{\caogaozhi*4}%
- }%
- \my@add@extra@page
- }{}%
+\DeclareExamTranslation{chinese}{
+ gradetable-Part = 题\quad 号
+ ,gradetable-Score = 得\quad 分
}
-% 注意在 twocolumn 文档中,\newpage 到下一栏,\clearpage 到下一页
-% 另外注意第一行的 \clearpage 等不能移动到 \my@add@extra@page 命令里
-% 因为 \clearpage 后本页已经结束,page 表示的是下一页的页码
-\newcommand{\doscratchpapertwo}{%
- \clearpage\pagestyle{empty}\let\addbindingline=\relax
- \ifnumgreater{\caogaozhi}{0}{%
- \ifbool{oneside}{%
- \setcounter{my@empty@page}{0}%
- \setcounter{my@scratch@page}{\caogaozhi}%
- }{%
- \setcounter{my@empty@page}{(\value{page}/2)-(\value{page}/2)/2*2}%
- \setcounter{my@scratch@page}{\caogaozhi*2}%
- }%
- \my@add@extra@page
- }{}%
-}
-
-\newcommand{\my@add@extra@page}{%
- \setcounter{my@extra@page}{\value{my@empty@page}+\value{my@scratch@page}}%
- \whileboolexpr{
- test{\ifnumgreater{\value{my@empty@page}}{0}}
- }{%
- \addtocounter{my@empty@page}{-1}%
- \leavevmode\clearpage
- }%
- \whileboolexpr{
- test{\ifnumgreater{\value{my@scratch@page}}{0}}
- }{%
- \addtocounter{my@scratch@page}{-1}%
- \leavevmode\scratchpaper\clearpage
- }%
- \addtocounter{page}{-\value{my@extra@page}}%
+\DeclareExamTranslation{english}{
+ gradetable-Part = Section~No.
+ ,gradetable-Total = Total~Score
+ ,exampart-Score = Score
+ ,exampart-Evaluator = Evaluator
+ ,exampart-Part = Section
}
-\iftwoinone
- \let\scratchpaper=\scratchpapertwo
- \let\doscratchpaper=\doscratchpapertwo
-\else
- \let\scratchpaper=\scratchpaperone
- \let\doscratchpaper=\doscratchpaperone
-\fi
-
-% 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
-\newcommand{\addscratchpaper}{%
- \preto{\@enddocumenthook}{\doscratchpaper}%
+\IfExamLanguageEqT{chinese}{
+ \SetExamValue{answertable}{
+ notice = {答题须知:本题答案必须写在如下表格中,否则不给分.}
+ }
+ \renewcommand{\questionpointstext}[1]{(#1~\pointorpoints{#1})}
}
-\ifplain\else\ifanswer\else
- \addscratchpaper
-\fi\fi
-
-\iftwoinone
- \RequirePackage{pdfpages}
- % 新版本 pdfpages 将 \includepdf 放在文档开头时会有命令未定义的错误
- % 见 https://tex.stackexchange.com/questions/352007/ieeetran-and-pdfpages
- % 另外从 LaTeX release 2018 开始 \@ifundefined 不再将未定义命令定义为 \relax
- % 见 https://www.latex-project.org/news/latex2e-news/ltnews28.pdf
- \@ifundefined{@setmarks}{\let\@setmarks\relax}{}
-\fi
-
%% ---------------------------------------------------------------------------
-%% 试卷表头命令 \makehead
+%% 中文期末试卷表头定制
%% ---------------------------------------------------------------------------
-\newcommand{\niandu}{2016-2017}
-\newcommand{\xueqi}{2}
-\newcommand{\kecheng}{数学课程}
-\newcommand{\zhuanye}{} % 专业学分
-\newcommand{\jiaoshi}{吕荐瑞}
-\newcommand{\shijian}{} % 考试日期
-\newcommand{\bixiu}{1} % 1 为必修,0 为选修
-\newcommand{\bijuan}{1} % 1 为闭卷,0 为开卷
-\newcommand{\shijuan}{A} % A 或 B 或 C 卷
-\newcommand{\neizhao}{1} % 1 打勾,0 不勾
-\newcommand{\waizhao}{1} % 1 打勾,0 不勾
+\NewDocumentCommand\examcheckquad{mm}{\ifnumequal{#1}{#2}{\,$\checkmark$\,}{\quad}}
-\newcommand{\underspace}[1]{\kern0pt\underline{\hspace{#1}}\kern0pt\relax}
-\newcommand{\underbox}[2]{\kern0pt\underline{\makebox[#1]{#2}}\kern0pt\relax}
-\newcommand{\underparbox}[2]{\kern0pt\underline{\parbox[b]{#1}{#2}}\kern0pt\relax}
-
-\newcommand{\ischeck}[1]{\ifnum#1>0\,$\checkmark$\,\else\quad\fi}
-\newcommand{\isquad}[1]{\ifnum#1=0\,$\checkmark$\,\else\quad\fi}
-
-\newcommand\my@temp@a{A}
-\newcommand\my@temp@c{C}
-\newcommand\my@empty{}
+\SetExamValue{examtitle}{
+ niandu = 2016--2017, % 教学年度
+ xueqi = 2, % 第几学期
+ kecheng = 数学课程, % 课程名称
+ zhuanye = , % 专业学分
+ jiaoshi = {吕荐瑞}, % 教师姓名
+ shijian = , % 考试时间
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 1, % 1 打勾,0 不勾
+}
-\newcommand{\head@table@a}{%
+\newcommand{\jdxm@fc@examtitle@table@a}{
\begin{tabular}{l}
- \underbox{11\ccwd}{\niandu}学年度第\underbox{5.5\ccwd}{\xueqi}学期 \\
- 课程名称:\underbox{17.5\ccwd}{\kecheng\ifx\zhuanye\my@empty\else\kern0pt(\zhuanye)\fi} \\
- 授课教师:\underparbox{17.5\ccwd}{\centering\rule{0pt}{3ex}\jiaoshi} \\
- 考试时间:\underbox{17.5\ccwd}{\shijian} \\
+ \underbox{11\ccwd}{\UseExamValue{examtitle}{niandu}}学年度第
+ \underbox{5.5\ccwd}{\UseExamValue{examtitle}{xueqi}}学期 \\
+ 课程名称:\underbox{17.5\ccwd}{
+ \UseExamValue{examtitle}{kecheng}
+ \tlIfEmptyF{\expWhole{\UseExamValue{examtitle}{zhuanye}}}{
+ \kern0pt(\UseExamValue{examtitle}{zhuanye})
+ }
+ } \\
+ 授课教师:\underparbox{17.5\ccwd}{
+ \centering\rule{0pt}{3ex}\UseExamValue{examtitle}{jiaoshi}
+ } \\
+ 考试时间:\underbox{17.5\ccwd}{\UseExamValue{examtitle}{shijian}} \\
\end{tabular}
}
-\newcommand{\head@table@b}{%
- \renewcommand{\arraystretch}{1}%
+\newcommand{\jdxm@fc@examtitle@table@b}{
+ \renewcommand{\arraystretch}{1}
\begin{tabular}{l}
- \textbf{课程类别} \\ 必修~[\ischeck{\bixiu}]\quad 选修~[\isquad{\bixiu}] \\
+ \textbf{课程类别} \\
+ 必修~[\examcheckquad{1}{\UseExamValue{examtitle}{bixiu}}]\quad
+ 选修~[\examcheckquad{0}{\UseExamValue{examtitle}{bixiu}}] \\
\hline
- \textbf{考试方式} \\ 开卷~[\isquad{\bijuan}]\quad 闭卷~[\ischeck{\bijuan}] \\
+ \textbf{考试方式} \\
+ 开卷~[\examcheckquad{0}{\UseExamValue{examtitle}{bijuan}}]\quad
+ 闭卷~[\examcheckquad{1}{\UseExamValue{examtitle}{bijuan}}] \\
\hline
- \textbf{试卷类别}~(\,A, B, C\,)\\\relax [\,\shijuan\,]\hfill 共~\zpageref{LastPage}~页
+ \textbf{试卷类别}~(\,A, B, C\,)\\
+ \relax [\,\UseExamValue{examtitle}{shijuan}\,]\hfill 共~\zpageref{LastPage}~页
\end{tabular}
}
-\newcommand{\head@table@c}{%
+\newcommand{\jdxm@fc@examtitle@table@c}{
\begin{tabular}{l}
- \underspace{10\ccwd}学院\underspace{8\ccwd}专业\underspace{7.5\ccwd}班\kern0pt(\kern0pt{}级\kern0pt) \\[1em]
+ \underspace{10\ccwd}学院\underspace{8\ccwd}专业\underspace{7.5\ccwd}班
+ \kern0pt(\kern0pt{}级\kern0pt) \\[1em]
姓名\underspace{8\ccwd}学号\underspace{10\ccwd}\hfill
- \bfseries 内招~[\ischeck{\neizhao}]~~外招~[\ischeck{\waizhao}] %\\[0.8em]
+ \bfseries 内招~[\examcheckquad{1}{\UseExamValue{examtitle}{neizhao}}]~~
+ 外招~[\examcheckquad{1}{\UseExamValue{examtitle}{waizhao}}] %\\[0.8em]
\end{tabular}
}
-\newcommand{\makehead}{
- \thispagestyle{plain}
- \centerline{%
- \LARGE\bfseries\ifanswer\color{red!80!black}\fi
- 暨\quad 南\quad 大\quad 学\quad 考\quad 试\quad 试\quad 卷\ifanswer\quad 答\quad 案\fi
- }%
- \vspace{2em}%
- \ifrandom
- \ifx\shijuan\my@temp@a\renewcommand{\shijuan}{B}\fi
- \ifx\shijuan\my@temp@c\renewcommand{\shijuan}{D}\fi
- \fi
+\DeclareExamTemplate{examtitle}{final-chinese}{
+ \centerline{
+ \LARGE\bfseries\IfExamBoolT{answer}{\color{red!80!black}}
+ 暨\quad 南\quad 大\quad 学\quad 考\quad 试\quad 试\quad 卷
+ \IfExamBoolT{answer}{\quad 答\quad 案}
+ }
+ \vspace{2em}
+ \IfExamBoolT{random}{
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{shijuan}}}{A}{
+ \SetExamValue{examtitle}{shijuan=B}
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{shijuan}}}{C}{
+ \SetExamValue{examtitle}{shijuan=D}
+ }
+ }
\noindent
\begin{tabularx}{\linewidth}{|@{}X@{}|}
- \hline\renewcommand{\arraystretch}{1.5}%
+ \hline\renewcommand{\arraystretch}{1.5}
{\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}|@{}l@{}}
- \begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular} & \head@table@a & \head@table@b
+ \begin{tabular}{l}教\\ 师\\ 填\\ 写\end{tabular}
+ & \jdxm@fc@examtitle@table@a & \jdxm@fc@examtitle@table@b
\end{tabularx}}\\
- \hline\renewcommand{\arraystretch}{0.9}%
+ \hline\renewcommand{\arraystretch}{0.9}
{\begin{tabularx}{\linewidth}{@{}>{\bfseries}l@{}|@{}X@{}}
- \begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular} & \head@table@c
+ \begin{tabular}{l}考\\ 生\\ 填\\ 写\end{tabular}
+ & \jdxm@fc@examtitle@table@c
\end{tabularx}}\\
\hline
\end{tabularx}
- \par\vspace{1em}
- \noindent\begin{tabularx}{\linewidth}{|*{8}{Y|}}
- \hline
- \textbf{题\quad 号} & 一 & 二 & 三 & 四 & 五 & 六 & 总分\\
- \hline
- \textbf{得\quad 分}\rule[-0.75em]{0pt}{2.5em} & & & & & & & \\
- \hline
- \textbf{评阅人}\rule[-0.75em]{0pt}{2.5em} & & & & & & & \\
- \hline
- \end{tabularx}
}
%% ---------------------------------------------------------------------------
-%% 页眉页脚设定
+%% 英文期末试卷表头定制
%% ---------------------------------------------------------------------------
-\newcommand{\my@columnbox}[1]{\makebox[\columnwidth]{#1}}
-\newcommand{\my@headleft}{\hspace{-0.3em}《\kecheng》\kern-0.3em 试卷\,\shijuan}
-\newcommand{\my@headright}{姓名\hspace{6em}学号\hspace{6em}}
-\newcommand{\my@headtext}{\my@headleft\hfill \my@headright}
-\newcommand{\my@foottext}{第~\thepage~页\quad 共~\zpageref{LastPage}~页}
-
-% fancy page style
-\fancyhf{} % 清空页眉页脚
-\iftwoinone
- \renewcommand{\headrulewidth}{0pt}%
- \lhead{\small\underline{\my@columnbox{\my@headtext}\strut}}
- \rhead{\small\underline{\my@columnbox{\my@headtext}\strut}}
- \lfoot{\small\my@columnbox{\my@foottext}}
- \rfoot{\small\my@columnbox{\stepcounter{page}\my@foottext}}
-\else
- \lhead{\small\my@headleft}
- \rhead{\small\my@headright}
- \cfoot{\small\my@foottext}
-\fi
-
-% plain page style
-\fancypagestyle{plain}{
- \renewcommand{\headrulewidth}{0pt}%
- \fancyhf{}
- \iftwoinone
- \rhead{\small\underline{\my@columnbox{\my@headtext\strut}}}
- \lfoot{\small\my@columnbox{\my@foottext}}
- \rfoot{\small\my@columnbox{\stepcounter{page}\my@foottext}}
- \else
- \cfoot{\small\my@foottext}
- \fi
-}
-
-\ifplain
- \pagestyle{plain}
-\else
- \pagestyle{fancy}
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 乱序排列选项 random
-%% 随机种子选项 seed
-%% ---------------------------------------------------------------------------
-
-%% 随机数种子不能超过 2147483647 = "7FFFFFFF
-\def\my@random@seed{19061116}
-\define@key{jnuexam@setup}{seed}[19061116]{\def\my@random@seed{#1}}
-
-\ifrandom
- \RequirePackage{pgf}
- \RequirePackage{pgffor}
- \newcommand*\exam@set@seed{%
- %% 当\pgfmathrandom的参数为3的倍数时,对相邻种子生成的多个随机数分布不均匀
- %\pgfmathsetseed{\numexpr\my@random@seed+\value{section}-1\relax}%
- %% 因此我们改用下面的方法,用随机数种子生成下一个随机数种子
- \pgfmathsetseed{\my@random@seed}%
- \pgfmathrandominteger\my@random@seed{1}{2147483647}%
- }
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 题型命令 \makepart
-%% 附录命令 \makedata
-%% 题目环境 problem
-%% 解答环境 solution
-%% ---------------------------------------------------------------------------
-
-\newif\ifonlyoneproblem \onlyoneproblemfalse % 此部分仅有一道题时不显示题目编号
-\xdef\allproblems{}
-\xdef\lastproblem{}
-\newcounter{problem} % 当前题型的小题编号
-\newcounter{problemreal} % 实际显示的小题编号,在各题型小题统一编号时使用
-\newcounter{totalproblems} % 之前各题型小题总数,在各题型小题统一编号时使用
-\newcommand{\solutionname}{解}
-\newcounter{choice} % 后面选择题的 abcd 环境要用到
-\newcommand{\hangtext}{}
-\newlength{\hanglength}
-\colorlet{part number}{black}
-\colorlet{problem number}{blue!80!black}
-\colorlet{solution name}{blue!80!black}
-
-\newcounter{my@shuffle@temp@cnt}
-\newcounter{my@list@temp@cnt}
-
-\newcommand\my@list@print[1]{%
- \par\renewcommand*{\do}[1]{(##1)}%
- \dolistloop#1%
-}
-
-\newcommand\my@list@remove[2]{%
- %\my@list@print\my@shuffle@list
- \setcounter{my@list@temp@cnt}{0}%
- \global\let\my@tmpa@list=#1%
- \gdef#1{}%
- \par\renewcommand*{\do}[1]{%
- \stepcounter{my@list@temp@cnt}%
- \ifnumequal{\value{my@list@temp@cnt}}{#2}{%
- \def\my@list@item{##1}%
- %[##1]%
- }{
- \listxadd#1{##1}%
- }%
- }%
- \dolistloop\my@tmpa@list
-}
-
-\newcommand\my@shuffle@problems{%
- \exam@set@seed
- \ifnumgreater{\value{problem}}{2}{%
- \gdef\my@shuffle@list{}%
- \foreach \i in {1,...,\value{problem}} {\listxadd\my@shuffle@list{\i}}%
- %% 首尾两个小题的位置总要改变
- \pgfmathrandom{2,\value{problem}}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@1}{my@problem@a@\my@list@item}%
- \ifnumequal{\my@list@item}{\value{problem}}{
- \pgfmathrandom{\numexpr\value{problem}-1\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{problem}}{my@problem@a@\my@list@item}%
- }{%
- \pgfmathrandom{\numexpr\value{problem}-2\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{problem}}{my@problem@a@\my@list@item}%
- }%
- %% 其他小题的位置没有任何限制
- \setcounter{my@shuffle@temp@cnt}{1}%
- \whileboolexpr{%
- test{\ifnumless{\value{my@shuffle@temp@cnt}}{\numexpr\value{problem}-1\relax}}%
- }{%
- \stepcounter{my@shuffle@temp@cnt}%
- \pgfmathrandom{\numexpr\value{problem}-\value{my@shuffle@temp@cnt}\relax}%
- \my@list@remove\my@shuffle@list{\pgfmathresult}%
- \global\csletcs{my@problem@b@\the\value{my@shuffle@temp@cnt}}{%
- my@problem@a@\my@list@item
- }%
- }%
- }{%
- \ifnumequal{\value{problem}}{2}{%
- \global\csletcs{my@problem@b@1}{my@problem@a@2}%
- \global\csletcs{my@problem@b@2}{my@problem@a@1}%
- }{}%
- }%
-}
-
-\newcommand{\printproblems}{%
- \ifrandom
- \my@appto@problems
- \my@shuffle@problems
- \setcounter{problem}{0}%
- \allproblems
- \fi
- \xdef\allproblems{}%
- \xdef\lastproblem{}%
-}
-
-\newcommand{\makepart}[2]{%
- \printproblems
- \setcounter{totalproblems}{\value{totalproblems}+\value{problem}}%
- \setcounter{problem}{0}%
- \stepcounter{section}%
- \vspace{1em}%
- \noindent\textbf{\textcolor{part number}{\Chinese{section}}、#1}(#2)%
- \par\nopagebreak
- \if\relax\detokenize{#1}\relax % #1 is empty
- \onlyoneproblemtrue
- \else
- \onlyoneproblemfalse
- \vspace{1em}%
- \fi
- %其中设定了\@nobreaktrue,保证在列表前也不分页,详情见 source2e
- \@afterheading
+\SetExamValue{examtitle}{
+ AcademicYear = 2016--2017, % 教学年度
+ Semester = 2, % 第几学期
+ CourseTitle = Math 1906, % 课程名称
+ MajorCredit = , % 专业学分,可以省略
+ Instructor = {Jianrui Lyu}, % 教师姓名
+ Date = , % 考试时间
+ Compulsory = 1, % 是否必修:1 为必修,0 为选修
+ ClosedBook = 1, % 是否闭卷:1 为闭卷,0 为开卷
+ Paper = A, % 试卷版本:A 或 B 或 C 卷
+ Mainland = 1, % 内招适用:1 打勾,0 不勾
+ NonMainland = 1, % 外招适用:1 打勾,0 不勾
+}
+
+\newcommand{\jdxm@fe@examtitle@table@a}{
+ \begin{tabular}{l}
+ \textbf{Academic~Year}:\underbox{5.5em}{\UseExamValue{examtitle}{AcademicYear}}
+ \enspace
+ \textbf{Semester}:~
+ 1\textsuperscript{st}~[\examcheckquad{\UseExamValue{examtitle}{Semester}}{1}]
+ \enspace
+ 2\textsuperscript{nd}~[\examcheckquad{\UseExamValue{examtitle}{Semester}}{2}]\\
+ \textbf{Course~Title}:\underbox{18.7em}{
+ \UseExamValue{examtitle}{CourseTitle}
+ \tlIfEmptyF{\expWhole{\UseExamValue{examtitle}{MajorCredit}}}{
+ \kern0pt(\UseExamValue{examtitle}{MajorCredit})
+ }
+ } \\
+ \textbf{Instructor's~Name}:\underparbox{16em}{
+ \centering\rule{0pt}{3ex}\UseExamValue{examtitle}{Instructor}
+ } \\
+ \textbf{Date~of~the~Examination}:\underbox{13em}{\UseExamValue{examtitle}{Date}} \\
+ \end{tabular}
}
-\newcommand{\makedata}[1]{%
- \printproblems\my@stop@random
- \centerline{\textbf{附录}\quad #1}\smallskip
+\newcommand{\jdxm@fe@examtitle@table@b}{
+ \fontsize{9pt}{11pt}\selectfont
+ \renewcommand{\arraystretch}{1.2}
+ \begin{tabular}{l}
+ \textbf{Course~Type} \\
+ Compulsory~[\examcheckquad{1}{\UseExamValue{examtitle}{Compulsory}}]\enspace
+ Elective~[\examcheckquad{0}{\UseExamValue{examtitle}{Compulsory}}] \\
+ \hline
+ \textbf{Form~of~the~Examination} \\
+ Open-book~[\examcheckquad{0}{\UseExamValue{examtitle}{ClosedBook}}]\enspace
+ Closed-book~[\examcheckquad{1}{\UseExamValue{examtitle}{ClosedBook}}] \\
+ \hline
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{A}{
+ \textbf{Paper}~A~[\,$\checkmark$\,]\enspace
+ \textbf{Paper}~B~[\quad]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{B}{
+ \textbf{Paper}~A~[\quad]\enspace
+ \textbf{Paper}~B~[\,$\checkmark$\,]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{C}{
+ \textbf{Paper}~C~[\,$\checkmark$\,]\enspace
+ \textbf{Paper}~D~[\quad]
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{D}{
+ \textbf{Paper}~C~[\quad]\enspace
+ \textbf{Paper}~D~[\,$\checkmark$\,]
+ }
+ \\
+ Total~Pages~\underbox{4em}{\zpageref{LastPage}}
+ \end{tabular}
}
-\preto{\@enddocumenthook}{\printproblems\my@stop@random}
-
-\newcommand\ignorepars{\@ifnextchar\par{\expandafter\ignorepars\@gobble}{}}
-
-% 局部定义,仅在当前题目内有效
-\define@key{jnuexam@problem}{points}[-1]{\def\my@problem@points{#1}}
-\define@key{jnuexam@problem}{level}[]{\def\my@problem@level{#1}}
-\define@key{jnuexam@problem}{year}[]{\def\my@problem@year{#1}}
-
-\newcommand{\problempointstext}[1]{(#1 分)}
-
-\newcommand\my@hook@exec@other@keys{}
-
-\newcommand{\execute@problem@keys}[1]{%
- \setkeys{jnuexam@problem}{#1}%
- \my@hook@exec@other@keys
- \ifdefvoid{\my@problem@points}{}{\problempointstext{\my@problem@points}}%
+\newcommand{\jdxm@fe@examtitle@table@c}{
+ \begin{tabular}{l}
+ \textbf{School/College}\underspace{11em}~\textbf{Major}\underspace{18.3em}\\
+ \textbf{Name}\underspace{15.4em}~\textbf{Student~No.}\underspace{15.6em}\\
+ \textbf{Mainland~Student}~[\examcheckquad{1}{\UseExamValue{examtitle}{Mainland}}]\hspace{4em}
+ \textbf{Non-mainland~Student}~[\examcheckquad{1}{\UseExamValue{examtitle}{NonMainland}}]
+ \end{tabular}
}
-\newenvironment{problemreal}[1][]{%
- \stepcounter{problem}\setcounter{choice}{0}%
- \ifresetnumber
- \ifonlyoneproblem
- \renewcommand{\hangtext}{\qquad}%
- \else
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{problem number}{\arabic{problem}}.}}\;\,}%
- \fi
- \else
- \setcounter{problemreal}{\value{totalproblems}+\value{problem}}%
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{problem number}{\arabic{problemreal}}.}}\;\,}%
- \fi
- \settowidth{\hanglength}{\hangtext}%
- \description[leftmargin=\hanglength,labelwidth=0pt,labelsep=0pt,topsep=0pt,parsep=0pt]
- \item[\hangtext]\execute@problem@keys{#1}%
-}{\enddescription}
-\newenvironment{solutionreal}{%
- \renewcommand{\hangtext}{\textbf{\textsf{\textcolor{solution name}{\solutionname}.}}\;\,}%
- \settowidth{\hanglength}{\hangtext}%
- \description[leftmargin=\hanglength,labelwidth=0pt,labelsep=0pt,topsep=0pt,parsep=0pt]
- \item[\hangtext]
-}{\enddescription}
-
-\let \oldnewpage = \newpage
-\let \oldvfill = \vfill
-\let \oldsmallskip = \smallskip
-\let \oldmedskip = \medskip
-\let \oldbigskip = \bigskip
-
-\ifrandom
- \newcommand\my@appto@problems{%
- \xappto\allproblems{\expandonce\lastproblem}%
- }%
- \NewEnviron{problem}{%
- \stepcounter{problem}%
- \my@appto@problems
- \csxdef{my@problem@a@\the\value{problem}}{%
- \unexpanded{\begin{problemreal}}%
- \unexpanded\expandafter{\BODY}%
- \unexpanded{\end{problemreal}}%
- }%
- \csxdef{my@problem@b@\the\value{problem}}{%
- \expandonce{\csname my@problem@a@\the\value{problem}\endcsname}%
- }%
- \xdef\lastproblem{%
- \expandonce{\csname my@problem@b@\the\value{problem}\endcsname}%
- }%
+\DeclareExamTemplate{examtitle}{final-english}{
+ \centerline{
+ \Large\bfseries\IfExamBoolT{answer}{\color{red!80!black}}
+ The~Examination~Paper~of~Jinan~University
+ \IfExamBoolT{answer}{~(Solutions)}
}
- \NewEnviron{solution}{%
- \csxappto{my@problem@a@\the\value{problem}}{%
- \unexpanded{\begin{solutionreal}}%
- \expandonce{\BODY}%
- \unexpanded{\end{solutionreal}}%
- }%
+ \vspace{2em}
+ \IfExamBoolT{random}{
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{A}{
+ \SetExamValue{examtitle}{Paper=B}
+ }
+ \tlIfEqT{\expWhole{\UseExamValue{examtitle}{Paper}}}{C}{
+ \SetExamValue{examtitle}{Paper=D}
+ }
}
- \renewcommand{\newpage}{\gappto\lastproblem{\oldnewpage}}
- \renewcommand{\vfill}{\csgappto{my@problem@a@\the\value{problem}}{\oldvfill}}
- \renewcommand{\smallskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldsmallskip}}
- \renewcommand{\medskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldmedskip}}
- \renewcommand{\bigskip}{\csgappto{my@problem@a@\the\value{problem}}{\oldbigskip}}
-\else
- \newenvironment{problem}[1][]{\problemreal[#1]}{\endproblemreal}
- %\newenvironment{solution}{\solutionreal}{\endsolutionreal}
- \NewEnviron{solution}{\begin{solutionreal}\BODY\end{solutionreal}}
-\fi
-
-\newcommand{\my@stop@random}{%
- \ifrandom
- \renewenvironment{problem}{\problemreal}{\endproblemreal}%
- \renewenvironment{solution}{\solutionreal}{\endsolutionreal}%
- \let \newpage = \oldnewpage
- \let \vfill = \oldvfill
- \let \smallskip = \oldsmallskip
- \let \medskip = \oldmedskip
- \let \bigskip = \oldbigskip
- \fi
-}
-
-\def\CommentCutFile{\jobname.cut}
-
-\AtBeginDocument{%
- \ifanswer\else
- \excludecomment{solution}
- \fi
-}
-
-%% ---------------------------------------------------------------------------
-%% 答题栏命令 \answertable
-%% ---------------------------------------------------------------------------
-
-\gdef\answer@lines@temp{}%
-\newcommand{\answer@lines@add}[1]{%
- \xdef\answer@lines@temp{\answer@lines@temp#1}%
-}
-
-\newrobustcmd{\answer@number@hided}[1]{小题} % 在 PDFLaTeX 中需要保护中文
-\newrobustcmd{\answer@cell@strut}[1]{\parbox[c][#1][c]{2em}{\hbox{答案}}}
-
-\newcounter{answer@col}
-\newcounter{answer@row}
-\newcounter{answer@total}
-
-\newcommand{\answer@lines}[3]{%
- % #1 答题栏各栏指定高度
- % #2 答题栏总共答案个数
- % #3 答题栏每行答案个数
- \setcounter{answer@row}{(#2-1)/#3+1}% 除法向下取整,改为向上取整
\begingroup
- \let\hline=\relax \let\\=\relax % 禁止展开
- \gdef\answer@lines@temp{}%
- \setcounter{answer@total}{1}%
- \whileboolexpr{
- test{\ifnumgreater{\value{answer@row}}{0}}
- }{%
- \addtocounter{answer@row}{-1}%
- \answer@lines@add{\answer@number@hided}%
- \setcounter{answer@col}{1}%
- \unlessboolexpr{%
- test{\ifnumgreater{\value{answer@col}}{#3}}%
- }{%
- \answer@lines@add{&}%
- \ifnumgreater{\value{answer@total}}{#2}{}{%
- \answer@lines@add{\arabic{answer@total}}%
- }%
- \stepcounter{answer@col}%
- \stepcounter{answer@total}%
- }%
- \answer@lines@add{\\ \hline \answer@cell@strut{#1}}%
- \setcounter{answer@col}{1}%
- \unlessboolexpr{
- test{\ifnumgreater{\value{answer@col}}{#3}}
- }{%
- \answer@lines@add{&}%
- \stepcounter{answer@col}%
- }%
- \answer@lines@add{\\ \hline}%
- }%
- \endgroup
- \answer@lines@temp
-}
-
-\newcommand{\answertable}[3][1em]{%
- 答题须知:本题答案必须写在如下表格中,否则不给分.\par
- \begin{tabularx}{\linewidth}{|c|*{#3}{Y|}}
+ \setlength\tabcolsep{4pt}
+ \fontsize{10pt}{12pt}\selectfont
+ \noindent
+ \begin{tabularx}{\linewidth}{|@{}X@{}|}
+ \hline\renewcommand{\arraystretch}{1.5}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}wc{5em}@{}|@{}X@{}|@{}l@{}}
+ \fontsize{9pt}{11pt}\selectfont\begin{tabular}{c}For\\Instructor\\Only\end{tabular}
+ & \jdxm@fe@examtitle@table@a & \jdxm@fe@examtitle@table@b
+ \end{tabularx}}\\
+ \hline\renewcommand{\arraystretch}{1.5}
+ {\begin{tabularx}{\linewidth}{@{}>{\bfseries}wc{5em}@{}|@{}X@{}}
+ \fontsize{9pt}{11pt}\selectfont\begin{tabular}{c}For\\Student\\Only\end{tabular}
+ & \jdxm@fe@examtitle@table@c
+ \end{tabularx}}\\
\hline
- \answer@lines{#1}{#2}{#3}
- \end{tabularx}%
- \par\vspace{0.8em}%
+ \end{tabularx}
+ \endgroup
}
%% ---------------------------------------------------------------------------
-%% 答案切换命令 \answer
-%% 判断命令 \tickin 和 \tickout
-%% 填空命令 \fillin 和 \fillout
-%% 选择命令 \pickin 和 \pickout
+%% 中英文期末试卷题型命令定制
%% ---------------------------------------------------------------------------
-\newcommand{\answer}[1]{\ifanswer#1\else\phantom{#1}\fi}
-
-\newcommand*{\cdotfill}{\leavevmode\xleaders\hbox to 0.5em{\hss$\cdot$\hss}\hfill\kern0pt\relax}
-
-\newcommand*{\tick@box}[1]{[\makebox[1.5em]{\color{blue}\answer{#1}}]}
-\newcommand*{\tick@text@t}{$\checkmark$}
-\newcommand*{\tick@text@f}{{\large$\times$}}
-\newcommand*{\tick@text@T}{\sffamily T}
-\newcommand*{\tick@text@F}{\sffamily F}
-\newcommand*{\tickin}[1]{\tick@box{\csname tick@text@#1\endcsname}}
-\newcommand*{\tickout}[1]{\unskip\nobreak\cdotfill\tick@box{\csname tick@text@#1\endcsname}}
-
-\newcommand*{\ulinefill}[1]{\xleaders\hbox{\underline{\vphantom{#1}\kern1pt}}\hfill\kern0pt}
-\newcommand*{\minwidthbox}[2]{\makebox[{\ifdim#1<\width\width\else#1\fi}]{#2}}
-
-\newcommand*{\fillout}[1]{\allowbreak\hbox{}\nobreak\ulinefill{#1}\underline{\color{blue}\answer{#1}}\ulinefill{#1}}
-\newcommand*{\fillin}[1]{\underline{\hspace{1em}\color{blue}\minwidthbox{2em}{\answer{#1}}\hspace{1em}}}
-
-\newcommand*\pickoutreal[1]{%
- \unskip\nobreak\cdotfill(\makebox[1.5em]{\color{blue}\answer{#1}})%
-}
-\newcommand*\pickinreal[1]{%
- \unskip\nobreak
- \hspace{0.3em}(\makebox[1.5em]{\color{blue}\answer{#1}})\hspace{0.3em}%
- \ignorespaces
+\DeclareExamTemplate{exampart}{final-chinese}{
+ \noindent
+ \textbf{
+ \textcolor{part~number}{\TheExamCounter{exampart}}、\UseExamValue{exampart}{type}
+ }
+ \IfExamValueEmptyF{exampart}{points}{
+ (\UseExamValue{exampart}{points})
+ }
}
-%% 选择题四个选项打乱顺序,用三种方法即可保证答案不同
-%% 1:ABCD -> CDAB; 2:ABCD -> BADC; 3: ABCD -> DCBA
-%% 即在两行排列时仅用到上下交换以及左右交换,这样可以保持两行长度不变
-
-\csdef{my@shuffle@1@A}{C} \csdef{my@shuffle@2@A}{B} \csdef{my@shuffle@3@A}{D}
-\csdef{my@shuffle@1@B}{D} \csdef{my@shuffle@2@B}{A} \csdef{my@shuffle@3@B}{C}
-\csdef{my@shuffle@1@C}{A} \csdef{my@shuffle@2@C}{D} \csdef{my@shuffle@3@C}{B}
-\csdef{my@shuffle@1@D}{B} \csdef{my@shuffle@2@D}{C} \csdef{my@shuffle@3@D}{A}
-
-\def\@my@choice@random{0}
-\newcommand\my@shuffle@abcd[1]{\csuse{my@shuffle@\@my@choice@random @#1}}
-
-\newcommand*\pickout[1]{%
- \ifbool{random}{%
- \exam@set@seed
- \pgfmathrandominteger\@my@choice@random{1}{3}%
- %\@my@choice@random
- \pickoutreal{\my@shuffle@abcd{#1}}%
- }{%
- \pickoutreal{#1}%
- }%
-}
-\newcommand*\pickoutfixed[1]{%
- \pickoutreal{#1}%
- \randomfalse
-}
-\newcommand*\pickin[1]{%
- \ifbool{random}{%
- \exam@set@seed
- \pgfmathrandominteger\@my@choice@random{1}{3}%
- %\@my@choice@random
- \pickinreal{\my@shuffle@abcd{#1}}%
- }{%
- \pickinreal{#1}%
- }%
-}
-\newcommand*\pickinfixed[1]{%
- \pickinreal{#1}%
- \randomfalse
+\DeclareExamTemplate{exampart}{final-english}{
+ \noindent
+ \begin{tblr}{width=\linewidth,colspec={llX},hlines,vlines,cell{1}{3}={r=2}{}}
+ \UseExamTranslation{exampart-Score} & \UseExamTranslation{exampart-Evaluator} &
+ \textbf{
+ \textcolor{part~number}{
+ \UseExamTranslation{exampart-Part}~\TheExamCounter{exampart}
+ }:~\UseExamValue{exampart}{type}
+ }~
+ \IfExamValueEmptyF{exampart}{points}{
+ (\UseExamValue{exampart}{points})
+ } \\
+ & &
+ \end{tblr}
}
%% ---------------------------------------------------------------------------
-%% 选择题四个选项排版环境,根据四个选项的长度自动排成一行、两行或四行
-%% 其中 abcd 环境各列平分整行宽度,而 abcd* 环境各列平分剩余空白
+%% 中英文期末试卷页眉页脚设定
%% ---------------------------------------------------------------------------
-\newlength{\my@item@len}
-\newlength{\my@label@len}
-
-\newcommand\my@item@temp{%
- \unskip\cr\stepcounter{choice}(\Alph{choice})\ %
-}
-\newcommand\my@item@box{%
- \hfill\egroup\hfill\hbox to \my@item@len\bgroup
- \stepcounter{choice}(\Alph{choice})\ \ignorespaces
-}
-\newcommand\my@item@par{%
- \stepcounter{choice}%
- \def\my@label@text{(\Alph{choice})\ }%
- \settowidth{\my@label@len}{\my@label@text}%
- \par \parshape 2 \hanglength \linewidth
- \dimexpr\hanglength + \my@label@len\relax
- \dimexpr\linewidth - \my@label@len\relax
- \my@label@text\ignorespaces
-}
-
-\NewEnviron{abcdreal}{
- \unskip
- \setlength{\parindent}{0pt}%
- \setlength{\parskip}{0pt}%
- \setcounter{choice}{0}%
- \let\item=\my@item@temp
- \settowidth{\my@item@len}{\vbox{\halign{##\hfil\cr\BODY\crcr}}}%
- \setcounter{choice}{0}%
- \ifdim\my@item@len>0.486\linewidth
- \setlength{\my@item@len}{\linewidth}%
- \let\item=\my@item@par
- \BODY\par
- \else
- \ifdim\my@item@len>.243\linewidth
- \setlength{\my@item@len}{0.5\linewidth}%
- \else
- \setlength{\my@item@len}{0.25\linewidth}%
- \fi
- \let\item=\my@item@box
- \par\bgroup\BODY\hfill\egroup\par
- \fi
-}
-
-\newcommand\my@item@one@line{%
- \unskip
- \ifnumequal{\value{choice}}{0}{}{\hfill}
- \stepcounter{choice}(\Alph{choice})\ %
-}
-\newcommand\my@item@two@line{%
- \unskip
- \ifnumodd{\value{choice}}{&}{\unskip\cr}%
- \stepcounter{choice}(\Alph{choice})\ %
-}
-
-\NewEnviron{abcd*real}{
- \unskip
- \setlength{\parindent}{0pt}%
- \setlength{\parskip}{0pt}%
- \setcounter{choice}{0}%
- \let\item=\my@item@one@line
- \settowidth{\my@item@len}{\BODY}%
- \ifdim\my@item@len<0.95\linewidth
- \setcounter{choice}{0}%
- \par\bgroup\BODY\hfill\hfill\par\egroup\par
- \else
- \setcounter{choice}{0}%
- \let\item=\my@item@two@line
- \settowidth{\my@item@len}{\vbox{\halign{##&##\hfil\cr\BODY\crcr}}}%
- \ifdim\my@item@len<0.975\linewidth
- \setcounter{choice}{0}%
- \par\bgroup\nointerlineskip
- \vbox{\halign to\linewidth{##\hfil\tabskip=0pt plus 1fil&##\hfil\cr\BODY\crcr}}%
- \egroup\par
- \else
- \setcounter{choice}{0}%
- \let\item=\my@item@par
- \par\bgroup\BODY\hfill\egroup\par
- \fi
- \fi
-}
-
-\ifbool{random}{%
- \csdef{my@swap@items@1}#1#2#3#4{\item#3\item#4\item#1\item#2}
- \csdef{my@swap@items@2}#1#2#3#4{\item#2\item#1\item#4\item#3}
- \csdef{my@swap@items@3}#1#2#3#4{\item#4\item#3\item#2\item#1}
- \long\def\my@swap@items#1\item#2\item#3\item#4\item#5\@my@stop@mark{%
- #1\csuse{my@swap@items@\@my@choice@random}{#2}{#3}{#4}{#5}%
+\IfExamLanguageEqTF{english}{
+ \DeclareExamTemplate{headleft}{fancy}{
+ \parbox{\columnwidth}{
+ \fontsize{10pt}{15pt}\selectfont
+ The~Examination~Paper~for~\ExamFillUlineText{\UseExamValue{examtitle}{CourseTitle}}~of~JNU\\
+ \strut Student~Name\hfill,~Student~No.\hfill\strut
+ }
}
-}{}
-
-\NewDocumentEnvironment{abcd}{+b}{%
- \ifbool{random}{%
- \begin{abcdreal}\my@swap@items#1\@my@stop@mark\end{abcdreal}%
- }{%
- \begin{abcdreal}#1\end{abcdreal}%
- }%
-}{}
-\NewDocumentEnvironment{abcd*}{+b}{%
- \ifbool{random}{%
- \begin{abcd*real}\my@swap@items#1\@my@stop@mark\end{abcd*real}%
- }{%
- \begin{abcd*real}#1\end{abcd*real}%
- }%
-}{}
-
-%% ---------------------------------------------------------------------------
-%% 设定有序列表使用悬挂缩进,并指定前两级有序列表的标签格式
-%% 标签宽度按最宽者自动设定,左边距自动计算,竖直空白全部去掉
-%% 最后的 itemjoin 设定行内有序列表 enumerate* 两项之间的空白
-%% ---------------------------------------------------------------------------
-
-\setlist[enumerate]{labelindent=0pt,labelsep=0.2em,itemindent=0pt,leftmargin=*,nosep,itemjoin=\quad}
-\setlist[enumerate,1]{label=(\arabic*)}
-\setlist[enumerate,2]{label=(\alph*),widest*=1}
+ \DeclareExamTemplate{headcenter}{fancy}{}
+ \DeclareExamTemplate{headright}{fancy}{}
+ \DeclareExamTemplate{footleft}{fancy}{}
+ \DeclareExamTemplate{footcenter}{fancy}{\thepage}
+ \DeclareExamTemplate{footright}{fancy}{}
+}{
+ \DeclareExamTemplate{headleft}{fancy}{
+ \hspace{-0.3em}《\UseExamValue{examtitle}{kecheng}》
+ \kern-0.3em 试卷\,\UseExamValue{examtitle}{shijuan}
+ }
+ \DeclareExamTemplate{headcenter}{fancy}{}
+ \DeclareExamTemplate{headright}{fancy}{
+ 姓名\hspace{6em}学号\hspace{6em}
+ }
+ \DeclareExamTemplate{footleft}{fancy}{}
+ \DeclareExamTemplate{footcenter}{fancy}{
+ 第~\thepage~页\quad 共~\zpageref{LastPage}~页
+ }
+ \DeclareExamTemplate{footright}{fancy}{}
+}
%% ---------------------------------------------------------------------------
-%% 自由对齐命令 \tabpoint, \tabto, \tableft
-%% 命令 \tabpoint 记录当前的水平位置,也可以简写为 \?
-%% 命令 \tabto 跳到之前记录的位置,也可以简写为 \+
-%% 命令 \tableft 跳到之前记录的位置的左侧,也可以简写为 \<
-%% 这些自由对齐命令需要编译两次才能生效
+%% 装订线命令 \addbindingline
+%% 草稿纸命令 \addscratchpaper
+%% 这两个命令需要编译两次才能得到正确结果
%% ---------------------------------------------------------------------------
-\usepackage{zref-savepos}
-
-\@ifundefined{zsaveposx}{\let\zsaveposx\zsavepos}{} % 旧版本无 \zsaveposx 命令
-
-\newcounter{saveposcnt}
-\newcounter{useposcnt}
-\renewcommand*{\thesaveposcnt}{savepos\number\value{saveposcnt}}
-\renewcommand*{\theuseposcnt}{usepos\number\value{useposcnt}}
-
-\def\my@alignment@offset{}
-
-\def\my@alignment@list{}
-\forcsvlist{\listadd\my@alignment@list}{=,<,>,\le,\ge,\leq,\geq,\approx}
-
-\newlength{\my@alignment@kern}
-
-\newcommand*{\my@alignment@check}[1]{%
- \ifx\my@let@token #1%
- \def\my@alignment@offset{5}%
- \expandafter\listbreak
- \fi
-}
-
-\newcommand{\my@alignment@next}{%
- \ifdefempty{\my@alignment@offset}{%
- \def\my@alignment@offset{0}%
- \forlistloop{\my@alignment@check}{\my@alignment@list}%
- }{}%
- \settowidth{\my@alignment@kern}{$\mkern\my@alignment@offset mu$}%
- \stepcounter{saveposcnt}%
- \rlap{\kern\my@alignment@kern\zsaveposx{\thesaveposcnt}}%
-}
-
-\newcommand*{\tabpoint}[1][]{%
- \leavevmode
- \def\my@alignment@offset{#1}%
- \futurelet\my@let@token\my@alignment@next
+\IfExamBoolF{plain}{
+ \RequirePackage{tikz}
+ \RequirePackage{everypage}
}
-\let \? = \tabpoint
-\newcommand*{\tabto}{%
- \stepcounter{useposcnt}%
- \zsaveposx{\theuseposcnt}%
- \noindent
- \hskip\zposx{\thesaveposcnt}sp\relax
- \hskip-\zposx{\theuseposcnt}sp\relax
- \ignorespaces
+\IfExamLanguageEqTF{english}{
+ \tlSet\l@jdxm@binding@text@a@tl{the}
+ \tlSet\l@jdxm@binding@text@b@tl{binding}
+ \tlSet\l@jdxm@binding@text@c@tl{line}
+}{
+ \tlSet\l@jdxm@binding@text@a@tl{装}
+ \tlSet\l@jdxm@binding@text@b@tl{订}
+ \tlSet\l@jdxm@binding@text@c@tl{线}
}
-\let \+ = \tabto
-\newcommand*{\tableft}{%
- \settowidth{\my@alignment@kern}{$=\mkern5mu$}%
- \stepcounter{useposcnt}%
- \zsaveposx{\theuseposcnt}%
- \noindent
- \hskip\zposx{\thesaveposcnt}sp\relax
- \hskip-\zposx{\theuseposcnt}sp\relax
- \hskip-\my@alignment@kern
- \ignorespaces
+\newcommand{\bindinglineleft}{
+ \path (current~page.north~west) +(25mm,-25mm) coordinate (a1);
+ \path (current~page.south~west) +(25mm,25mm) coordinate (a2);
+ \draw[dashed] (a1) -- node[left=1mm,text~width=1em,inner~sep=0pt]{
+ \1{\l@jdxm@binding@text@c@tl}\0
+ \1{\l@jdxm@binding@text@b@tl}\0
+ \1{\l@jdxm@binding@text@a@tl}
+ } (a2);
}
-\let \< = \tableft
-
-%% ---------------------------------------------------------------------------
-%% 评分命令 \points
-%% ---------------------------------------------------------------------------
-
-\PassOptionsToPackage{tbtags}{amsmath}
-\RequirePackage{amsmath}
-
-\newcommand{\mypoints}[1]{\textcolor{red}{#1\kern0.15em 分}}
-\newcommand{\pointstext}[1]{\mbox{}\nobreak\hfill$\cdots\cdots$\mypoints{#1}\par\noindent\ignorespaces}
-\newcommand{\pointseqno}[1]{\eqno{\cdots\cdots\text{\mypoints{#1}}}}
-\newcommand{\pointstag}[1]{\tag*{$\cdots\cdots$\mypoints{#1}}}
-
-\newrobustcmd{\points}[1]{%
- \ifbool{mmode}{%
- \ifdefstrequal{\tag}{\dft@tag}{\pointseqno{#1}}{\pointstag{#1}}%
- }{%
- \pointstext{#1}%
- }%
+\newcommand{\bindinglineright}{
+ \path (current~page.north~east) +(-25mm,-25mm) coordinate (b1);
+ \path (current~page.south~east) +(-25mm,25mm) coordinate (b2);
+ \draw[dashed] (b1) -- node[right=1mm,text~width=1em,inner~sep=0pt]{
+ \2{\l@jdxm@binding@text@a@tl}\0
+ \2{\l@jdxm@binding@text@b@tl}\0
+ \2{\l@jdxm@binding@text@c@tl}
+ } (b2);
}
-%% ---------------------------------------------------------------------------
-%% 载入个人定制文件 jnuexam.cfg
-%% 中文字体切换选项 sourcehan
-%% 实心句号替换选项 solidot
-%% ---------------------------------------------------------------------------
+\newcommand{\bindinglineone}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}
+\begin{tikzpicture}[remember~picture,overlay,very~thick]
+ \ifnumodd{\value{page}}{\bindinglineleft}{\bindinglineright}
+\end{tikzpicture}}
-\InputIfFileExists{jnuexam.cfg}{}{}
+\newcommand{\bindinglinetwo}{%
+\def\0{\\[70mm]}\def\1{\rotatebox{90}}\def\2{\rotatebox{-90}}
+\begin{tikzpicture}[remember~picture,overlay,very~thick]
+ \bindinglineleft\bindinglineright
+\end{tikzpicture}}
-\newcommand{\my@set@sourcehan}{
- \setCJKmainfont[BoldFont=Source Han Sans SC]{Source Han Serif SC}
- \setCJKsansfont{Source Han Sans SC}
- % 用中文字体名时 LuaTeX 找不到该字体,XeTeX 正常
- %\setCJKmainfont[BoldFont=思源黑体]{思源宋体}
- %\setCJKsansfont{思源黑体}
+\IfExamBoolTF{twoinone}{
+ \let\bindingline=\bindinglinetwo
+}{
+ \let\bindingline=\bindinglineone
}
-\AtBeginDocument{%
- \ifbool{sourcehan}{%
- % https://sourceforge.net/p/xetex/code/ci/master/tree/source/texk/web2c/xetexdir/NEWS
- \ifbool{XeTeX}{% TeXLive 2015
- \ifdimless{\the\XeTeXversion\XeTeXrevision pt}{0.99992pt}{}{\my@set@sourcehan}%
- }{}%
- \ifbool{LuaTeX}{\my@set@sourcehan}{}%
- }{}%
+%% 必须将 .store 放在 .initial:n 之前
+\DeclareKeys[randexam]{
+ binding .store = \zhuangdingxian,
+ binding .initial:n = 1,
+ binding .default:n = 2
}
-%% 这里不能用 \ifbool,因为涉及到 catcode 的改变
-\ifsolidot
- \ifXeTeX
- \catcode`。=\active\def。{.}%
- \else\ifLuaTeX
- \catcode`。=\active\def。{.}%
- \fi
+\newcommand{\addbindingline}{
+ \ifcase\zhuangdingxian % 0
+ \or % 1
+ \IfExamBoolF{answer}{\bindingline}%
+ \or % 2
+ \bindingline
\fi
-\fi
-
-%% ---------------------------------------------------------------------------
-%% 在 tabular 和 array 等表格环境中添加列间距
-%% 避免单元格里出现的分式太过接近上面和下面行
-%% ---------------------------------------------------------------------------
-
-\newcommand{\my@do@cellspace}{%
- \RequirePackage[math]{cellspace}%
- \setlength\cellspacetoplimit{2pt}%
- \setlength\cellspacebottomlimit{2pt}%
- \addparagraphcolumntypes{X}%
- \newcolumntype{0}[1]{>{\bcolumn ##1\@nil}##1<{\ecolumn}}%
- \newcolumntype{5}[1]{>{$}0{##1}<{$}}%
- % Fix cellspace bug before version 1.7
- % See https://tex.stackexchange.com/a/385581
- \@ifpackagelater{cellspace}{2017/08/12}{}{%
- \patchcmd{\@endpbox}{\color@endgroup}{\expandafter\color@endgroup}{}{}%
- }%
}
-\AtBeginDocument{%
- \ifcellspace \my@do@cellspace \fi
-}
-
-%% ---------------------------------------------------------------------------
-%% 统一行间公式和行内公式的巨算符和分式的尺寸
-%% 利用开头的 medmath 选项可以启用此部分设定
-%% ---------------------------------------------------------------------------
+\IfExamBoolF{plain}{\AddEverypageHook{\addbindingline}}
-\newcommand{\my@do@medmath}{%
- \RequirePackage[mediummath]{nccmath}%
- %% 补充 \oiint 命令的调整
- \ifdef{\oiint}{%
- \let\NCC@op@oiint=\oiint
- \DeclareRobustCommand{\oiintop}{\mathop{\medmath{\NCC@op@oiint}}}%
- \def\oiint{\DOTSI\NCC@op@prepare{\oiintop}}%
- }{}%
- %% 设定 nccmath 的积分号校正尺寸
- %% 后面已经改用相对尺寸,不再需要
- %\ifamsfonts
- % \medintcorr{0.5em}
- %\else
- % \medintcorr{0.3em}
- %\fi
- %% 使用 nccmath 宏包后,cases 环境包含定积分时将无法编译,这里重新定义此环境
- %% 注意相比 amsmath 的原始定义,我们这里将 \quad 从两列之间移动到第二列最前面
- %% 这是因为,我们常将 cases 用于只有一列的方程组,这样处理末尾不会有多余空白
- \ifbool{cellspace}{%
- \renewenvironment{cases}{%
- \left\{\linespread{1.0}\selectfont\def\arraystretch{1.2}%
- \begin{array}{@{}5l@{}>{\quad}5l@{}}%
- }{%
- \end{array}\right.%
- }%
- }{%
- \renewenvironment{cases}{%
- \left\{\linespread{1.0}\selectfont\def\arraystretch{1.2}%
- \begin{array}{@{}l@{}>{\quad}l@{}}%
- }{%
- \end{array}\right.%
- }%
+\IfExamLanguageEqTF{english}{
+ \tlSet\l@jdxm@scratch@font@one@tl{
+ \sffamily\fontsize{100pt}{100pt}\selectfont
}
- %% 当 minipage 或 \parbox 仅包含行间公式时,盒子的右边距丢失,这里修正它
- %% 其他类似问题的描述见 http://tex.stackexchange.com/q/22170
- \let\start@gather=\NCC@startgather
- \let\start@align=\NCC@startalign
- \let\start@multline=\NCC@startmultline
- \let\mathdisplay=\NCC@startdisplay
-}
-
-\newcommand{\my@do@medmath@fix}{%
- %% 修正在角标处的非积分巨算符尺寸
- %% 参考了 scalerel 宏包对数学样式的保存方法
- % 非角标巨算符保持为 \displaystyle 巨算符的 80% 大小
- % 一级角标巨算符修改为 \textstyle 巨算符的 80% 大小
- % 二级角标巨算符修改为 \scriptstyle 巨算符的 80% 大小
- \def\@my@style@D{\displaystyle}%
- \def\@my@style@T{\displaystyle}%
- \def\@my@style@S{\textstyle}%
- \def\@my@style@s{\scriptstyle}%
- \def\my@style@saved{\csname @my@style@\@my@style@switch\endcsname}%
- \newcommand{\my@style@this}[1]{%
- \mathchoice{\def\@my@style@switch{D}##1}{\def\@my@style@switch{T}##1}
- {\def\@my@style@switch{S}##1}{\def\@my@style@switch{s}##1}%
- }%
- \DeclareRobustCommand*\medmath[1]{\NCC@select@msize
- \mathord{\my@style@this{\raise\@tempdima\hbox{\NCC@prepare@msize$\my@style@saved ##1$}}}%
+ \tlSet\l@jdxm@scratch@font@two@tl{
+ \sffamily\fontsize{100pt}{100pt}\selectfont
}
- %% 修正在角标处的积分算符尺寸和上下限位置
- \newlength{\@my@em}%
- \setlength{\@my@em}{1em}%
- \ifamsfonts
- \medintcorr{0.5\@my@em}%
- \else
- \medintcorr{0.3\@my@em}%
- \fi
- \newcommand{\my@style@unit}[1]{%
- \mathchoice{\setlength{\@my@em}{1em}##1}{\setlength{\@my@em}{1em}##1}
- {\setlength{\@my@em}{0.5em}##1}{\setlength{\@my@em}{0.3em}##1}%
- }%
- \let\my@saved@op@printm=\NCC@op@printm
- \def\NCC@op@printm{\my@style@unit{\my@saved@op@printm}}%
- %% 修正在角标位置的分式和嵌套分式
- %% 总是使用当前样式尺寸来排版分式的分子和分母
- \newcommand{\my@larger@frac}[2]{%
- \mathchoice{\genfrac{}{}{}{0}{##1}{##2}}{\genfrac{}{}{}{0}{##1}{##2}}%
- {\genfrac{}{}{}{1}{##1}{##2}}{\genfrac{}{}{}{2}{##1}{##2}}%
- }%
- \DeclareRobustCommand{\frac}[2]{%
- \mathchoice{\mfrac{##1}{##2}}{\mfrac{##1}{##2}}%
- {\my@larger@frac{##1}{##2}}{\my@larger@frac{##1}{##2}}%
- }%
- \patchcmd{\NCC@prepare@msize}{%
- \def\frac{\protect\NCC@innerfrac{}}%
- }{%
- \let\frac=\my@larger@frac
- }{}{}%
+ \tlSet\l@jdxm@scratch@text@a@tl{THE}
+ \tlSet\l@jdxm@scratch@text@b@tl{SCRATCH}
+ \tlSet\l@jdxm@scratch@text@c@tl{PAPER}
+}{
+ \tlSet\l@jdxm@scratch@font@one@tl{
+ \sffamily\fontsize{120pt}{120pt}\selectfont
+ }
+ \tlSet\l@jdxm@scratch@font@two@tl{
+ \sffamily\fontsize{180pt}{180pt}\selectfont
+ }
+ \tlSet\l@jdxm@scratch@text@a@tl{草}
+ \tlSet\l@jdxm@scratch@text@b@tl{稿}
+ \tlSet\l@jdxm@scratch@text@c@tl{纸}
}
-\AtBeginDocument{%
- \ifmedmath
- \my@do@medmath \my@do@medmath@fix
- \fi
-}
+\newcommand{\scratchpaperone}{%
+\begin{tikzpicture}[remember~picture,overlay,font=\l@jdxm@scratch@font@one@tl]
+ \node[text=lightgray!40,text~width=1000pt,align=center] at (current~page.center) {
+ \l@jdxm@scratch@text@a@tl\\
+ \l@jdxm@scratch@text@b@tl\\
+ \l@jdxm@scratch@text@c@tl
+ };
+\end{tikzpicture}}
-%% ---------------------------------------------------------------------------
-%% 载入常用宏包,定义常用命令
-%% ---------------------------------------------------------------------------
+\newcommand{\scratchpapertwo}{%
+\begin{tikzpicture}[remember~picture,overlay,font=\l@jdxm@scratch@font@two@tl]
+ \node[text=lightgray!40] at (current~page.center) {
+ \l@jdxm@scratch@text@a@tl\quad
+ \l@jdxm@scratch@text@b@tl\quad
+ \l@jdxm@scratch@text@c@tl
+ };
+\end{tikzpicture}}
-\AtBeginDocument{
- \setlength{\abovedisplayskip}{4pt minus 2pt}
- \setlength{\belowdisplayskip}{4pt minus 2pt}
- \setlength{\abovedisplayshortskip}{2pt}
- \setlength{\belowdisplayshortskip}{2pt}
+%% 必须将 .store 放在 .initial:n 之前
+\DeclareKeys[randexam]{
+ scratch .store = \caogaozhi,
+ scratch .initial:n = 0,
+ scratch .default:n = 1
}
-\setlength\arraycolsep{4pt}
+\newcounter{my@empty@page} % 空白页数
+\newcounter{my@scratch@page} % 草稿页数
+\newcounter{my@extra@page} % 空白页数+草稿页数
-\ifbool{XeTeX}{
- % https://en.wikipedia.org/wiki/Number_Forms
- % Ⅰ、Ⅱ、Ⅲ、Ⅳ、Ⅴ、Ⅵ、Ⅶ、Ⅷ、Ⅸ、Ⅹ、Ⅺ、Ⅻ
- \xeCJKsetcharclass{"2150}{"218F}{1} % 斜线分数,全角罗马数字等
- % https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
- \xeCJKsetcharclass{"2460}{"24FF}{1} % 带圈数字字母,括号数字字母,带点数字等
-}{}
+% 添加空白页,使得草稿纸前页数在单面印刷时为偶数,双面印刷时为4的倍数
+% 添加草稿纸,页数在单面印刷时等于设置值的两倍,双面印刷时等于设置值的4倍
+\newcommand{\doscratchpaperone}{
+ \clearpage\pagestyle{empty}\let\addbindingline=\relax
+ \ifnumgreater{\caogaozhi}{0}{
+ \IfExamBoolTF{oneside}{
+ \ifnumodd{\value{page}}
+ {\setcounter{my@empty@page}{0}}
+ {\setcounter{my@empty@page}{1}}
+ \setcounter{my@scratch@page}{\caogaozhi*2}
+ }{
+ \setcounter{my@empty@page}{(\value{page}+2)/4*4+1-\value{page}}
+ \setcounter{my@scratch@page}{\caogaozhi*4}
+ }
+ \my@add@extra@page
+ }{}
+}
-\RequirePackage{multirow}
-\RequirePackage{tabu}
+% 注意在 twocolumn 文档中,\newpage 到下一栏,\clearpage 到下一页
+% 另外注意第一行的 \clearpage 等不能移动到 \my@add@extra@page 命令里
+% 因为 \clearpage 后本页已经结束,page 表示的是下一页的页码
+\newcommand{\doscratchpapertwo}{
+ \clearpage\pagestyle{empty}\let\addbindingline=\relax
+ \ifnumgreater{\caogaozhi}{0}{
+ \IfExamBoolTF{oneside}{
+ \setcounter{my@empty@page}{0}
+ \setcounter{my@scratch@page}{\caogaozhi}
+ }{
+ \setcounter{my@empty@page}{(\value{page}/2)-(\value{page}/2)/2*2}
+ \setcounter{my@scratch@page}{\caogaozhi*2}
+ }
+ \my@add@extra@page
+ }{}
+}
-\RequirePackage{diagbox}
-%% 修正 \diagbox 在 array 环境中使用的问题
-\newrobustcmd{\diagboxtwo}[3][]{%
- \ifbool{mmode}{%
- \hbox{\let\tabcolsep=\arraycolsep\diagbox[#1]{$#2$}{$#3$}}%
- }{%
- \diagbox[#1]{#2}{#3}%
+\newcommand{\my@add@extra@page}{
+ \setcounter{my@extra@page}{\value{my@empty@page}+\value{my@scratch@page}}
+ \whileboolexpr{
+ test{\ifnumgreater{\value{my@empty@page}}{0}}
+ }{
+ \addtocounter{my@empty@page}{-1}
+ \leavevmode\clearpage
}
-}
-\newrobustcmd{\diagboxthree}[4][]{%
- \ifbool{mmode}{%
- \hbox{\let\tabcolsep=\arraycolsep\diagbox[#1]{$#2$}{$#3$}{$#4$}}%
- }{%
- \diagbox[#1]{#2}{#3}{#4}%
+ \whileboolexpr{
+ test{\ifnumgreater{\value{my@scratch@page}}{0}}
+ }{
+ \addtocounter{my@scratch@page}{-1}
+ \leavevmode\scratchpaper\clearpage
}
+ \addtocounter{page}{-\value{my@extra@page}}
}
-\RequirePackage{mathtools} % \mathllap 命令,pmatrix* 环境等
-\RequirePackage{extarrows}
-
-\RequirePackage{relsize}
-\newcommand{\Int}{\mathop{\mathlarger{\int}}}
-
-\AtBeginDocument{%
- \let\my@saved@lim=\lim \def\lim{\my@saved@lim\limits}%
- \let\my@saved@sum=\sum \def\sum{\my@saved@sum\limits}%
- \let\my@saved@prod=\prod \def\prod{\my@saved@prod\limits}%
+\IfExamBoolTF{twoinone}{
+ \let\scratchpaper=\scratchpapertwo
+ \let\doscratchpaper=\doscratchpapertwo
+}{
+ \let\scratchpaper=\scratchpaperone
+ \let\doscratchpaper=\doscratchpaperone
}
-\newcommand{\e}{\mathrm{e}}
-\newcommand{\R}{\mathbb{R}}
-
-\DeclareMathOperator{\arccot}{arccot}
-\DeclareMathOperator{\Corr}{\rho}
-\DeclareMathOperator{\Cov}{Cov}
-\DeclareMathOperator{\diag}{diag}
-\DeclareMathOperator{\grad}{grad}
-\DeclareMathOperator{\Prj}{Prj}
-\DeclareMathOperator{\tr}{tr}
-\DeclareMathOperator{\Var}{Var}
-
-\DeclareMathOperator{\diver}{div}
-\let\division=\div
-\let\div=\diver
-
-\newcommand{\diff}{\mathop{}\!\mathrm{d}}
-\newcommand{\dx}{\diff x}
-\newcommand{\dy}{\diff y}
-\def\dz{\diff z} % 不确定命令是否已经定义
-\newcommand{\du}{\diff u}
-\newcommand{\dv}{\diff v}
-\newcommand{\dr}{\diff r}
-\newcommand{\ds}{\diff s}
-\newcommand{\dt}{\diff t}
-\newcommand{\dS}{\diff S}
-% 有些宏包比如 hyperref 会修改 \d 的定义,所以放在 document 开始处
-% 利用 etoolbox 将 \d 定义为健壮命令,以避免在 align 等环境中错误地展开
-\AtBeginDocument{%
- \let\oldd=\d
- \renewrobustcmd{\d}{\ifbool{mmode}{\diff}{\oldd}}%
+% 在旧版本 ctex 宏包中不能用 \AtEndDocument 添加含中文的内容,即不能用 \appto 而要用 \preto
+\newcommand{\addscratchpaper}{
+ \preto{\@enddocumenthook}{\doscratchpaper}
}
-\let\pd=\partial
-\newcommand{\pdf}{\pd f}
-\newcommand{\pdg}{\pd g}
-\newcommand{\pdh}{\pd h}
-\newcommand{\pdl}{\pd l}
-\newcommand{\pdn}{\pd n}
-\newcommand{\pdu}{\pd u}
-\newcommand{\pdv}{\pd v}
-\newcommand{\pdx}{\pd x}
-\newcommand{\pdy}{\pd y}
-\newcommand{\pdz}{\pd z}
-\newcommand{\pdF}{\pd F}
-\newcommand{\pdL}{\pd L}
-\newcommand{\pdP}{\pd P}
-\newcommand{\pdQ}{\pd Q}
-\newcommand{\pdR}{\pd R}
+\IfExamBoolF{plain}{\IfExamBoolF{answer}{\addscratchpaper}}
-% from mathabx package
-\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
-\DeclareFontShape{U}{mathx}{m}{n}{<-> mathx10}{}
-\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
-\DeclareMathAccent{\widebar}{0}{mathx}{"73}
-
-\newcommand{\va}{\vec{a}}
-\newcommand{\vb}{\vec{b}}
-\newcommand{\vc}{\vec{c}}
-\newcommand{\vd}{\vec{d}}
-\newcommand{\ve}{\vec{e}}
-\newcommand{\vi}{\vec{i}}
-\newcommand{\vj}{\vec{j}}
-\newcommand{\vk}{\vec{k}}
-\newcommand{\vn}{\vec{n}}
-\newcommand{\vs}{\vec{s}}
-\newcommand{\vv}{\vec{v}}
-
-\let\ov=\overrightarrow
-
-\let\le=\leqslant
-\let\ge=\geqslant
+%% ---------------------------------------------------------------------------
+%% 试卷模板主题切换
+%% ---------------------------------------------------------------------------
-\let\lb=\{
-\let\rb=\}
+\DeclareExamTheme{final-chinese}{
+ \SetExamOption{chinese}
+ \SelectExamTranslation{chinese}
+ \SetExamValue{exampart}{number=\Chinese}
+ \SelectExamTemplate{examtitle}{final-chinese}
+ \SelectExamTemplate{exampart}{final-chinese}
+}
-\def\T{\mathrm{T}\kern-.5pt}
+\DeclareExamTheme{final-english}{
+ \geometry{top=30mm,headheight=34pt}
+ \SetExamBoolFalse{sourcehan}
+ \SelectExamTranslation{english}
+ \SetExamValue{exampart}{number=\Roman}
+ \SelectExamTemplate{examtitle}{final-english}
+ \SelectExamTemplate{exampart}{final-english}
+}
-% 分数线长一点的分数,\wfrac[2pt]{x}{y} 表示左右加 2pt
-% 和前面的 medmath 一样,将代码放在 \AtBeginDocument 里
-\AtBeginDocument{%
- \newrobustcmd{\wfrac}[3][2pt]{%
- \frac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
- \newrobustcmd{\wdfrac}[3][2pt]{%
- \dfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
- \newrobustcmd{\wtfrac}[3][2pt]{%
- \tfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}%
- }%
+\IfExamLanguageEqTF{english}{
+ \SelectExamTheme{final-english}
+}{
+ \SelectExamTheme{final-chinese}
}
-% 使用 stix font 中的 white arrows
-\ifxetex
- %\IfFileExists{STIX-Regular.otf}{% 在 TeXLive 中无效
- \IfFileExists{stix.sty}{%
- \newfontfamily{\mystix}{STIX} % stix v1.1
- }{%
- \newfontfamily{\mystix}{STIXGeneral} % stix v1.0
- }
- \newrobustcmd\leftwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E6}}}%
- }
- \newrobustcmd\upwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E7}}}%
- }
- \newrobustcmd\rightwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E8}}}%
- }
- \newrobustcmd\downwhitearrow{%
- \mathrel{\text{\normalfont\mystix\symbol{"21E9}}}%
- }
-\else
- \let \leftwhitearrow = \Leftarrow
- \let \rightwhitearrow = \Rightarrow
- \let \upwhitearrow = \Uparrow
- \let \downwhitearrow = \Downarrow
-\fi
+%% ---------------------------------------------------------------------------
+%% 停止忽略代码中的空白符号
+%% ---------------------------------------------------------------------------
+\IgnoreSpacesOff
diff --git a/macros/latex/contrib/jnuexam/jnuexam.pdf b/macros/latex/contrib/jnuexam/jnuexam.pdf
index c5281ee42b..0cc01cc3f1 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.pdf
+++ b/macros/latex/contrib/jnuexam/jnuexam.pdf
Binary files differ
diff --git a/macros/latex/contrib/jnuexam/jnuexam.tex b/macros/latex/contrib/jnuexam/jnuexam.tex
index 891c0663ee..e19f1416b6 100644
--- a/macros/latex/contrib/jnuexam/jnuexam.tex
+++ b/macros/latex/contrib/jnuexam/jnuexam.tex
@@ -106,12 +106,13 @@
\frametitle{试卷结构}
下面是 \verb!jnuexam! 试卷文档的基本结构:
\begin{code}
-\documentclass{jnuexam}
+\documentclass[chinese]{jnuexam}
% 导言区
\begin{document}
% 正文区
\end{document}
\end{code}
+试卷包含中文和英文两种模板,必须在文档开头指明。\par
导言区用于设定装订线和草稿纸等等选项。\par
正文区用于填写试卷表头和输入试卷内容。
\end{framex}
@@ -120,7 +121,7 @@
\frametitle{装订草稿}
在文档的导言区可以设定装订线和草稿纸。比如:
\begin{code}
-\setexam{
+\SetExamOption{
binding = 2, % 装订线
scratch = 1, % 草稿纸
}
@@ -137,17 +138,17 @@
\documentclass{jnuexam}
\begin{document}
......
-\makehead %生成试卷表头
+\examtitle{...} %生成试卷表头,见下页
......
-\makepart{填空题}{题数分值}
+\exampart{填空题}[题数分值]
......
-\makepart{单选题}{题数分值}
+\exampart{单选题}[题数分值]
......
-\makepart{计算题}{题数分值}
+\exampart{计算题}[题数分值]
......
-\makepart{证明题}{题数分值}
+\exampart{证明题}[题数分值]
......
-\makedata{可能用到的数据} %附录数据
+\examdata{可能用到的数据} %附录数据
......
\end{document}
\end{code}
@@ -156,34 +157,48 @@
\begin{framex}
\frametitle{试卷表头}
\begin{code}
-\renewcommand{\niandu}{2010--2011}
-\renewcommand{\xueqi}{2}
-\renewcommand{\kecheng}{大学数学}
-\renewcommand{\zhuanye}{理工4学分}
-\renewcommand{\jiaoshi}{某某某}
-\renewcommand{\shijian}{2011年07月08日}
-\renewcommand{\bixiu}{1} % 1为必修,0为选修
-\renewcommand{\bijuan}{1} % 1为闭卷,0为开卷
-\renewcommand{\shijuan}{A} % A/B/C卷
-\renewcommand{\neizhao}{1} % 1打勾,0不勾
-\renewcommand{\waizhao}{0} % 1打勾,0不勾
-\makehead %生成试卷表头
+\examtitle{
+ niandu = 2017--2018,
+ xueqi = 2,
+ kecheng = 大学数学,
+ zhuanye = 理工四学分, % 可以为空白
+ jiaoshi = {张三,李四}, % 教师姓名
+ shijian = 2018年6月28日,
+ bixiu = 1, % 1 为必修,0 为选修
+ bijuan = 1, % 1 为闭卷,0 为开卷
+ shijuan = A, % A 或 B 或 C 卷
+ neizhao = 1, % 1 打勾,0 不勾
+ waizhao = 0, % 1 打勾,0 不勾
+}
+\end{code}
+其中 \verb!zhuanye! 和 \verb!shijian! 选项的内容可以为空。
+\end{framex}
+
+\begin{framex}
+\frametitle{评分表格}
+在 \verb!\examtitle! 后面,可以用 \verb!\gradetable! 命令生成空白的评分表格。比如:
+\begin{code}
+\gradetable[total=6,strut=2em]
\end{code}
-其中 \verb!\zhuanye! 和 \verb!\shijian! 命令的内容可以为空。
+其中 \verb!\gradetable! 命令的各个参数含义如下:
+\begin{description}
+ \item[total] 表示试卷总共有多少部分,默认是 \verb!6!。
+ \item[strut] 表示空白单元格的支架高度,默认是 \verb!2.5em!。
+\end{description}
\end{framex}
\begin{framex}
\frametitle{判断题目}
\begin{code}
-\makepart{判断题}{题数分值}
+\exampart{判断题}[题数分值]
-\begin{problem}
+\begin{question}
第一道判断题描述。\tickout{t}
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道判断题描述。\tickout{f}
-\end{problem}
+\end{question}
\end{code}
其中 \verb!\tickout{t}! 和 \verb!\tickout{f}!
分别表示打勾(\textcolor{blue}{$\checkmark$})和打叉(\textcolor{blue}{\large$\times$})。
@@ -196,15 +211,15 @@
\begin{framex}
\frametitle{填空题目}
\begin{code}
-\makepart{填空题}{题数分值}
+\exampart{填空题}[题数分值]
-\begin{problem}
+\begin{question}
第一道填空题描述\fillout{答案}。
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道填空题描述\fillout{答案}。
-\end{problem}
+\end{question}
\end{code}
\verb!\fillout! 命令将用下划线填满整行。另有个 \verb!\fillin! 命令,只留下最小宽度的下划线。
\par
@@ -214,15 +229,15 @@
\begin{framex}
\frametitle{选择题目}
\begin{code}
-\makepart{单选题}{题数分值}
+\exampart{单选题}[题数分值]
-\begin{problem}
+\begin{question}
第一道单选题描述\pickout{答案}。
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二道单选题描述\pickout{答案}。
-\end{problem}
+\end{question}
\end{code}
\verb!\pickout! 命令将把选择圆括号放在本行最右边。另外有个 \verb!\pickin! 命令,将选择圆括号放在当前位置。
\par
@@ -248,31 +263,32 @@
\frametitle{答题表格}
在填空题和选择题前面,还可以用 \verb!\answertable! 命令生成空白答题栏。比如:
\begin{code}
-\answertable[3em]{6}{3}
+\answertable[total=6,column=3,strut=3em]
\end{code}
-其中 \verb!\answertable! 命令的三个参数含义如下:
-\begin{itemize}
- \item 第一个可选参数表示空白单元格的高度,默认是 \verb!1em!。
- \item 第二个必选参数表示总共有多少个题目。
- \item 第三个必选参数表示每行排版几个题目。
-\end{itemize}
+其中 \verb!\answertable! 命令的各个参数含义如下:
+\begin{description}
+ \item[total] 表示总共有多少个题目。
+ \item[column] 表示每行排版几个题目。
+ \item[strut] 表示空白单元格的高度,默认是 \verb!1em!。
+ \item[notice] 表示答题表格前面提示文本的内容。
+\end{description}
\end{framex}
\begin{framex}
\frametitle{计算题目}
\begin{code}
-\makepart{计算题}{题数分值}
+\exampart{计算题}[题数分值]
-\begin{problem}
+\begin{question}
第一道计算题描述。
-\end{problem}
+\end{question}
\begin{solution}
第一道计算题答案。
\end{solution}
-\begin{problem}
+\begin{question}
第二道计算题描述。
-\end{problem}
+\end{question}
\begin{solution}
第二道计算题答案。
\end{solution}
@@ -282,18 +298,18 @@
\begin{framex}
\frametitle{证明题目}
\begin{code}
-\makepart{证明题}{题数分值}
+\exampart{证明题}[题数分值]
-\begin{problem}
+\begin{question}
第一道证明题描述。
-\end{problem}
+\end{question}
\begin{solution}
第一道证明题答案。
\end{solution}
-\begin{problem}
+\begin{question}
第二道证明题描述。
-\end{problem}
+\end{question}
\begin{solution}
第二道证明题答案。
\end{solution}
@@ -302,10 +318,10 @@
\begin{framex}
\frametitle{解答名称}
-通过重新定义 \verb!\solutionname! 命令,可以改变 \verb!solution! 环境的名称。
-比如下面例子将“解答”二字改为“证明”:
+通过重定义关键词的翻译,可以改变 \verb!solution! 环境的显示名称。
+比如下面例子将“解”改为“证”:
\begin{code}
-\renewcommand{\solutionname}{证明}
+\SetExamTranslation{solution-Solution = 证}
\end{code}
\end{framex}
@@ -360,15 +376,15 @@ $2+2=4$ \points{8}
\frametitle{其它题型}
除了上述四种题型之外,其它题型可以用下面方式编写:
\begin{code}
-\makepart{某题型}{题数分值}
+\exampart{某题型}[题数分值]
-\begin{problem}
+\begin{question}
第一题描述。\answer{第一题答案}
-\end{problem}
+\end{question}
-\begin{problem}
+\begin{question}
第二题描述。\answer{第二题答案}
-\end{problem}
+\end{question}
\end{code}
其中题目答案必须放在 \verb!\answer! 命令里面;这样才能在生成空白试卷时隐藏它。
\end{framex}
@@ -377,17 +393,17 @@ $2+2=4$ \points{8}
\frametitle{附录数据}
在试卷最后,可以用下面命令增加附录数据部分:
\begin{code}
-\makedata{可能用到的数据} %附录数据
+\examdata{可能用到的数据} %附录数据
......
\end{code}
-附录数据必须放在 \verb!\makedata! 命令后面;否则在从A卷生成B卷时会出问题。
+附录数据必须放在 \verb!\examdata! 命令后面;否则在从A卷生成B卷时会出问题。
\end{framex}
\section{模板选项}
\begin{framex}
\frametitle{空白试卷}
-假设 \verb!exam-a-answer.tex! 是含答案的试卷。新建一个包含以下内容的 \verb!exam-a-empty.tex! 文档,
+假设 \verb!exam-a-answer.tex! 是含答案的试卷。新建一个包含以下内容的 \verb!exam-a-blank.tex! 文档,
编译后将得到不含答案的空白试卷。
\begin{code}
\PassOptionsToClass{noanswer}{jnuexam}
@@ -431,26 +447,26 @@ $2+2=4$ \points{8}
\begin{framex}
\frametitle{双栏试卷}
-假设 \verb!exam-a-empty.tex! 是原来试卷的 TeX 文件。新建一个包含以下内容的文档,
+假设 \verb!exam-a-blank.tex! 是原来试卷的 TeX 文件。新建一个包含以下内容的文档,
编译后将得到的 A3 纸张的试卷。
\begin{code}
\PassOptionsToClass{a3paper}{jnuexam}
-\input{exam-a-empty}
+\input{exam-a-blank}
\end{code}
也就是说,给 \verb!jnuexam! 文档类加上 \verb!a3paper! 选项后,编译时将会按照 A3 纸张排版出双栏试卷。
\end{framex}
\begin{framex}
\frametitle{双栏试卷}
-假设 \verb!exam-a-empty.pdf! 是原来试卷的 PDF 文件。新建一个包含以下内容的文档,
+假设 \verb!exam-a-blank.pdf! 是原来试卷的 PDF 文件。新建一个包含以下内容的文档,
编译后将得到的 A3 纸张的试卷。
\begin{code}
\documentclass[a3input]{jnuexam}
\begin{document}
-\includepdf[pages=-,nup=2x1]{exam-a-empty}
+\includepdf[pages=-,nup=2x1]{exam-a-blank}
\end{document}
\end{code}
-%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-a-empty}
+%\includepdf[pages=-,nup=2x1,offset=0 0,delta=0 0]{exam-a-blank}
这种用法直接读入 A4 试卷的 PDF 文件,生成双栏的 A3 试卷,适合没有 TeX 文件时使用。
\end{framex}
diff --git a/macros/latex/contrib/l3backend/CHANGELOG.md b/macros/latex/contrib/l3backend/CHANGELOG.md
index 02dfdd3e13..66a69a3bb3 100644
--- a/macros/latex/contrib/l3backend/CHANGELOG.md
+++ b/macros/latex/contrib/l3backend/CHANGELOG.md
@@ -6,6 +6,19 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2024-03-14]
+
+### Removed
+- Range guard for opacity
+
+### Fixed
+- Initiation of opacity data (see \#1472)
+- ExtGState setup for stroking opacity (issue \#1472)
+- Inconsistent behavior of opacity functions w/o `pdfmanagement`
+ (issue \#1473)
+- Redundant braces in opacity backend for dvisvgm
+- Interaction of scope with box insertion with `dvips` (see \#1504)
+
## [2024-02-20]
### Fixed
@@ -326,7 +339,8 @@ this project uses date-based 'snapshot' version identifiers.
- Include `l3backend` in file names
- Moved backend code to internal for each 'parent' module
-[Unreleased]: https://github.com/latex3/latex3/compare/2024-02-20...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2024-03-14...HEAD
+[2024-03-14]: https://github.com/latex3/latex3/compare/2024-02-20...2024-03-14
[2024-02-20]: https://github.com/latex3/latex3/compare/2024-01-04...2024-02-20
[2024-01-04]: https://github.com/latex3/latex3/compare/2023-11-09...2024-01-04
[2023-11-09]: https://github.com/latex3/latex3/compare/2023-11-04...2023-11-09
diff --git a/macros/latex/contrib/l3backend/README.md b/macros/latex/contrib/l3backend/README.md
index 3bfc823410..7be33df8b8 100644
--- a/macros/latex/contrib/l3backend/README.md
+++ b/macros/latex/contrib/l3backend/README.md
@@ -1,7 +1,7 @@
LaTeX3 Backend Drivers
======================
-Release 2024-02-20
+Release 2024-03-14
This package forms parts of `expl3`, and contains the code used to interface
with backends (drivers) across the `expl3` codebase. The functions here are
diff --git a/macros/latex/contrib/l3backend/l3backend-basics.dtx b/macros/latex/contrib/l3backend/l3backend-basics.dtx
index c80d51e06d..4d3b68225a 100644
--- a/macros/latex/contrib/l3backend/l3backend-basics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -70,27 +70,27 @@
% \begin{macrocode}
\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-dvipdfmx.def}{2024-02-20}{}
+ {l3backend-dvipdfmx.def}{2024-03-14}{}
{L3 backend support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-dvips.def}{2024-02-20}{}
+ {l3backend-dvips.def}{2024-03-14}{}
{L3 backend support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-dvisvgm.def}{2024-02-20}{}
+ {l3backend-dvisvgm.def}{2024-03-14}{}
{L3 backend support: dvisvgm}
%</dvisvgm>
%<*luatex>
- {l3backend-luatex.def}{2024-02-20}{}
+ {l3backend-luatex.def}{2024-03-14}{}
{L3 backend support: PDF output (LuaTeX)}
%</luatex>
%<*pdftex>
- {l3backend-pdftex.def}{2024-02-20}{}
+ {l3backend-pdftex.def}{2024-03-14}{}
{L3 backend support: PDF output (pdfTeX)}
%</pdftex>
%<*xetex>
- {l3backend-xetex.def}{2024-02-20}{}
+ {l3backend-xetex.def}{2024-03-14}{}
{L3 backend support: XeTeX}
%</xetex>
% \end{macrocode}
diff --git a/macros/latex/contrib/l3backend/l3backend-box.dtx b/macros/latex/contrib/l3backend/l3backend-box.dtx
index 4b0059c2b9..3fc3243c42 100644
--- a/macros/latex/contrib/l3backend/l3backend-box.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-code.pdf b/macros/latex/contrib/l3backend/l3backend-code.pdf
index c62351ab98..9affc7d856 100644
--- a/macros/latex/contrib/l3backend/l3backend-code.pdf
+++ b/macros/latex/contrib/l3backend/l3backend-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3backend/l3backend-code.tex b/macros/latex/contrib/l3backend/l3backend-code.tex
index d8a1ca7cf6..df0dd0ea8c 100644
--- a/macros/latex/contrib/l3backend/l3backend-code.tex
+++ b/macros/latex/contrib/l3backend/l3backend-code.tex
@@ -26,7 +26,7 @@ for those people who are interested.
\fi
-\documentclass{l3doc}
+\documentclass[full,kernel]{l3doc}
\begin{document}
diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 907ca91c6e..eaa89add8c 100644
--- a/macros/latex/contrib/l3backend/l3backend-color.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index ee33a717fe..eef86886f5 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -68,7 +68,7 @@
%
% \begin{macro}{\@@_backend_literal:n, \@@_backend_literal:e}
% The same as literal PostScript: same arguments about positioning apply
-% her.
+% here.
% \begin{macrocode}
\cs_new_eq:NN \@@_backend_literal:n \__kernel_backend_literal_postscript:n
\cs_generate_variant:Nn \@@_backend_literal:n { e }
@@ -81,23 +81,20 @@
% but where we can't split material between separate calls. The
% |@beginspecial|/|@endspecial| pair are from |special.pro| and correct the
% scale and $y$-axis direction.
-% In contrast to \pkg{pgf}, we don't save the current point:
-% discussion with Tom Rokici suggested a better way to handle the necessary
-% translations (see \cs{@@_backend_box_use:Nnnnn}). (Note that
-% |@beginspecial|/|@endspecial| forms a backend scope.) The |[begin]|/^^A
-% |[end]| lines are handled differently from the rest as they are
-% conceptually different: not really drawing literals but instructions to
-% \texttt{dvips} itself.
+% As for \pkg{pgf}, we need to save the current point as this is
+% required for box placement. (Note that
+% |@beginspecial|/|@endspecial| forms a backend scope.)
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_begin:
{
- \__kernel_backend_literal:n { ps::[begin] }
+ \@@_backend_literal:n { [begin] }
+ \@@_backend_literal:n { /draw.x~currentpoint~/draw.y~exch~def~def }
\@@_backend_literal:n { @beginspecial }
}
\cs_new_protected:Npn \@@_backend_end:
{
\@@_backend_literal:n { @endspecial }
- \__kernel_backend_literal:n { ps::[end] }
+ \@@_backend_literal:n { [end] }
}
% \end{macrocode}
% \end{macro}
@@ -350,21 +347,23 @@
% Inside a picture |@beginspecial|/|@endspecial| are active, which is
% normally a good thing but means that the position and scaling would be off
% if the box was inserted directly. To deal with that, there are a number of
-% possible approaches. The implementation here was suggested by Tom Rokici
-% (author of \texttt{dvips}). We end the current special placement, then
-% set the current point with a literal |[begin]|. As for general
-% literals, we then use the stack to store the current point and move to
-% it. To insert the required transformation, we have to flip the $y$-axis,
-% once before and once after it. Then we get back to the \TeX{} reference
-% point to insert our content. The clean up has to happen in the right
-% places, hence the |[begin]|/|[end]| pair around |restore|. Finally,
-% we can return to \enquote{normal} drawing mode. Notice that the set up
-% here is very similar to that in \cs{@@_align_currentpoint_\ldots}, but
-% the ordering of saving and restoring is different (intermixed).
+% possible approaches. A previous implementation suggested by Tom Rokici
+% used |@endspecial|/|@beginspecial|. This avoids needing internals of
+% \texttt{dvips}, but fails if there the box is used inside a scope
+% (see \url{https://github.com/latex3/latex3/issues/1504}). Instead,
+% we use the same method as \pkg{pgf}, which means tracking the position
+% at the PostScript level. Also note that using |@endspecial| would
+% close the scope it creates, meaning that after a box insertion, any
+% local changes would be lost. Keeping \texttt{dvips} on track is
+% non-trivial, hence the |[begin]|/|[end]| pair before the
+% |save| and around the |restore|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_box_use:Nnnnn #1#2#3#4#5
{
- \@@_backend_literal:n { @endspecial }
+ \@@_backend_literal:n { save }
+ \@@_backend_literal:n { 72~Resolution~div~72~VResolution~div~neg~scale }
+ \@@_backend_literal:n { magscale { 1~DVImag~div~dup~scale } if }
+ \@@_backend_literal:n { draw.x~neg~draw.y~neg~translate }
\@@_backend_literal:n { [end] }
\@@_backend_literal:n { [begin] }
\@@_backend_literal:n { save }
@@ -380,7 +379,7 @@
\@@_backend_literal:n { restore }
\@@_backend_literal:n { [end] }
\@@_backend_literal:n { [begin] }
- \@@_backend_literal:n { @beginspecial }
+ \@@_backend_literal:n { restore }
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3backend/l3backend-graphics.dtx b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
index cb959169d9..9360bffd2e 100644
--- a/macros/latex/contrib/l3backend/l3backend-graphics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-header.dtx b/macros/latex/contrib/l3backend/l3backend-header.dtx
index d7b6d4c37c..84f8ab53b7 100644
--- a/macros/latex/contrib/l3backend/l3backend-header.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-header.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-opacity.dtx b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
index 6cc972f7d8..a5828bfd90 100644
--- a/macros/latex/contrib/l3backend/l3backend-opacity.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-opacity.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -71,9 +71,9 @@
%<*dvips>
% \end{macrocode}
%
-% \begin{macro}{\@@_backend_select:n,\@@_backend_select_aux:n}
+% \begin{macro}{\@@_backend_select:n}
% \begin{macro}{\@@_backend_fill:n, \@@_backend_stroke:n}
-% \begin{macro}{\@@_backend:nnn, \@@_backend:enn}
+% \begin{macro}{\@@_backend:nnn}
% No stack so set values directly. The need to deal with Distiller and
% Ghostscript separately means we use a common auxiliary: the two
% systems require different PostScript for transparency. This is
@@ -83,25 +83,20 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_select:n #1
{
- \exp_args:Ne \@@_backend_select_aux:n
- { \fp_eval:n { min(max(0,#1),1) } }
- }
-\cs_new_protected:Npn \@@_backend_select_aux:n #1
- {
\@@_backend:nnn {#1} { fill } { ca }
\@@_backend:nnn {#1} { stroke } { CA }
}
\cs_new_protected:Npn \@@_backend_fill:n #1
{
- \@@_backend:enn
- { \fp_eval:n { min(max(0,#1),1) } }
+ \@@_backend:nnn
+ { #1 }
{ fill }
{ ca }
}
\cs_new_protected:Npn \@@_backend_stroke:n #1
{
- \@@_backend:enn
- { \fp_eval:n { min(max(0,#1),1) } }
+ \@@_backend:nnn
+ { #1 }
{ stroke }
{ CA }
}
@@ -124,7 +119,6 @@
ifelse
}
}
-\cs_generate_variant:Nn \@@_backend:nnn { e }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -143,7 +137,7 @@
% \begin{macrocode}
\bool_lazy_and:nnT
{ \cs_if_exist_p:N \pdfmanagement_if_active_p: }
- { \pdfmanagement_if_active_p:}
+ { \pdfmanagement_if_active_p: }
{
%<*luatex|pdftex>
\__kernel_color_backend_stack_init:Nnn \c_@@_backend_stack_int
@@ -157,24 +151,21 @@
%
% \begin{variable}{\l_@@_backend_fill_tl, \l_@@_backend_stroke_tl}
% We use |tl| here for speed: at the backend, this should be reasonable.
+% Both need to start off fully opaque.
% \begin{macrocode}
\tl_new:N \l_@@_backend_fill_tl
\tl_new:N \l_@@_backend_stroke_tl
+\tl_set:Nn \l_@@_backend_fill_tl { 1 }
+\tl_set:Nn \l_@@_backend_stroke_tl { 1 }
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\@@_backend_select:n, \@@_backend_select_aux:n}
+% \begin{macro}{\@@_backend_select:n}
% \begin{macro}{\@@_backend_reset:}
-% Other than the need to evaluate the opacity as an \texttt{fp}, much the
-% same as color.
+% Much the same as color.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_select:n #1
{
- \exp_args:Ne \@@_backend_select_aux:n
- { \fp_eval:n { min(max(0,#1),1) } }
- }
-\cs_new_protected:Npn \@@_backend_select_aux:n #1
- {
\tl_set:Nn \l_@@_backend_fill_tl {#1}
\tl_set:Nn \l_@@_backend_stroke_tl {#1}
\pdfmanagement_add:nnn { Page / Resources / ExtGState }
@@ -189,12 +180,6 @@
{ /opacity #1 ~ gs }
\group_insert_after:N \@@_backend_reset:
}
-\bool_lazy_and:nnF
- { \cs_if_exist_p:N \pdfmanagement_if_active_p: }
- { \pdfmanagement_if_active_p:}
- {
- \cs_gset_protected:Npn \@@_backend_select_aux:n #1 { }
- }
\cs_new_protected:Npn \@@_backend_reset:
{
%<*dvipdfmx|xetex>
@@ -210,26 +195,26 @@
% \end{macro}
%
% \begin{macro}{\@@_backend_fill:n, \@@_backend_stroke:n}
-% \begin{macro}{\@@_backend_fillstroke:nn, \@@_backend_fillstroke:ee}
+% \begin{macro}{\@@_backend_fill_stroke:nn}
% For separate fill and stroke, we need to work out if we need to do
% more work or if we can stick to a single setting.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_fill:n #1
{
- \@@_backend_fill_stroke:ee
- { \fp_eval:n { min(max(0,#1),1) } }
- \l_@@_backend_stroke_tl
+ \exp_args:Nno \@@_backend_fill_stroke:nn
+ { #1 }
+ { \l_@@_backend_stroke_tl }
}
\cs_new_protected:Npn \@@_backend_stroke:n #1
{
- \@@_backend_fill_stroke:ee
- \l_@@_backend_fill_tl
- { \fp_eval:n { min(max(0,#1),1) } }
+ \exp_args:No \@@_backend_fill_stroke:nn
+ { \l_@@_backend_fill_tl }
+ { #1 }
}
\cs_new_protected:Npn \@@_backend_fill_stroke:nn #1#2
{
\str_if_eq:nnTF {#1} {#2}
- { \@@_backend_select_aux:n {#1} }
+ { \@@_backend_select:n {#1} }
{
\tl_set:Nn \l_@@_backend_fill_tl {#1}
\tl_set:Nn \l_@@_backend_stroke_tl {#2}
@@ -237,7 +222,7 @@
{ opacity.fill #1 }
{ << /ca ~ #1 >> }
\pdfmanagement_add:nnn { Page / Resources / ExtGState }
- { opacity.stroke #1 }
+ { opacity.stroke #2 }
{ << /CA ~ #2 >> }
%<*dvipdfmx|xetex>
\__kernel_backend_literal_pdf:n
@@ -249,11 +234,24 @@
\group_insert_after:N \@@_backend_reset:
}
}
-\cs_generate_variant:Nn \@@_backend_fill_stroke:nn { ee }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@@_backend_select:n, \@@_backend_fill_stroke:nn}
+% Redefine them to stubs if pdfmanagement is either not loaded or
+% deactivated.
+% \begin{macrocode}
+\bool_lazy_and:nnF
+ { \cs_if_exist_p:N \pdfmanagement_if_active_p: }
+ { \pdfmanagement_if_active_p: }
+ {
+ \cs_gset_protected:Npn \@@_backend_select:n #1 { }
+ \cs_gset_protected:Npn \@@_backend_fill_stroke:nn #1#2 { }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</dvipdfmx|luatex|pdftex|xetex>
% \end{macrocode}
@@ -272,9 +270,9 @@
\cs_new_protected:Npn \@@_backend_fill:n #1
{ \@@_backend:nn {#1} { fill- } }
\cs_new_protected:Npn \@@_backend_stroke:n #1
- { \@@_backend:nn { {#1} } { stroke- } }
+ { \@@_backend:nn {#1} { stroke- } }
\cs_new_protected:Npn \@@_backend:nn #1#2
- { \__kernel_backend_scope:e { #2 opacity = " \fp_eval:n { min(max(0,#1),1) } " } }
+ { \__kernel_backend_scope:e { #2 opacity = " #1 " } }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
index 472b7adefa..0a16a79f9e 100644
--- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/CHANGELOG.md b/macros/latex/contrib/l3experimental/CHANGELOG.md
index 197fa4254d..900626c265 100644
--- a/macros/latex/contrib/l3experimental/CHANGELOG.md
+++ b/macros/latex/contrib/l3experimental/CHANGELOG.md
@@ -7,6 +7,24 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2024-03-14]
+
+### Added
+- `\draw_path_replace_bb:`
+
+### Changed
+- `l3opacity` is sped up a bit
+- Support fp expr in `\draw_path_corner_arc:nn`
+
+### Fixed
+- Interaction between drawing rotation and shift (issue \#1483)
+- Shifting not applied to `\draw_path_rectangle:n` (issue \#1486)
+- Out of boundary lines drawn by `\draw_path_grid:nnn` (issue \#1489)
+- Two softpath markers with the same meaning in l3draw (issue \#1492)
+
+### Removed
+- `l3sys-shell` in favor of `l3sys-query` methods added to `l3kernel`
+
## [2024-02-20]
### Fixed
@@ -309,7 +327,8 @@ this project uses date-based 'snapshot' version identifiers.
- New `l3color` module using `xcolor`-like expression syntax
- New `l3draw` module, based on `pgf` layer of the TikZ system
-[Unreleased]: https://github.com/latex3/latex3/compare/2024-02-20...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2024-03-14...HEAD
+[2024-03-14]: https://github.com/latex3/latex3/compare/2024-02-20...2024-03-14
[2024-02-20]: https://github.com/latex3/latex3/compare/2024-01-04...2024-02-20
[2024-01-04]: https://github.com/latex3/latex3/compare/2023-12-08...2024-01-04
[2023-12-08]: https://github.com/latex3/latex3/compare/2023-11-01...2023-12-08
diff --git a/macros/latex/contrib/l3experimental/README.md b/macros/latex/contrib/l3experimental/README.md
index dc28bad6ee..438d6c43c5 100644
--- a/macros/latex/contrib/l3experimental/README.md
+++ b/macros/latex/contrib/l3experimental/README.md
@@ -1,7 +1,7 @@
Experimental LaTeX3 Concepts
============================
-Release 2024-02-20
+Release 2024-03-14
Overview
--------
@@ -26,7 +26,6 @@ bundles:
* `l3graphics`
* `l3opacity`
* `l3str`
-* `l3sys-shell`
* `xcoffins`
* `xgalley`
@@ -61,12 +60,6 @@ category code 12 ('other'), with the exception of spaces which have the
category code 10 ('space'). The `l3str-format` module provides methods
for formatting such strings.
-`l3sys-shell`
--------------
-
-This module provides abstractions for common shell functions, e.g. file
-deletion and copying.
-
`xcoffins`
----------
diff --git a/macros/latex/contrib/l3experimental/l3benchmark.dtx b/macros/latex/contrib/l3experimental/l3benchmark.dtx
index 58d4da8bb7..8cbd99cffb 100644
--- a/macros/latex/contrib/l3experimental/l3benchmark.dtx
+++ b/macros/latex/contrib/l3experimental/l3benchmark.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -122,7 +122,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3benchmark}{2024-02-20}{}
+\ProvidesExplPackage{l3benchmark}{2024-03-14}{}
{L3 Experimental benchmarking}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/l3benchmark.pdf b/macros/latex/contrib/l3experimental/l3benchmark.pdf
index 2c8c9d3634..5b39987238 100644
--- a/macros/latex/contrib/l3experimental/l3benchmark.pdf
+++ b/macros/latex/contrib/l3experimental/l3benchmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
index 992acaa05c..fe2207fc1b 100644
--- a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/l3draw-code.pdf b/macros/latex/contrib/l3experimental/l3draw-code.pdf
index 91237671cb..0dffee7391 100644
--- a/macros/latex/contrib/l3experimental/l3draw-code.pdf
+++ b/macros/latex/contrib/l3experimental/l3draw-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3draw-layers.dtx b/macros/latex/contrib/l3experimental/l3draw-layers.dtx
index 1244dfa0ec..bea1d2423c 100644
--- a/macros/latex/contrib/l3experimental/l3draw-layers.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-layers.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/l3draw-paths.dtx b/macros/latex/contrib/l3experimental/l3draw-paths.dtx
index e869351f6b..0b428cad0f 100644
--- a/macros/latex/contrib/l3experimental/l3draw-paths.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-paths.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -192,8 +192,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \draw_path_corner_arc:nn #1#2
{
- \dim_set:Nn \l_@@_corner_xarc_dim {#1}
- \dim_set:Nn \l_@@_corner_yarc_dim {#2}
+ \dim_set:Nn \l_@@_corner_xarc_dim { \fp_to_dim:n {#1} }
+ \dim_set:Nn \l_@@_corner_yarc_dim { \fp_to_dim:n {#2} }
\bool_lazy_and:nnTF
{ \dim_compare_p:nNn \l_@@_corner_xarc_dim = { 0pt } }
{ \dim_compare_p:nNn \l_@@_corner_yarc_dim = { 0pt } }
@@ -700,16 +700,18 @@
% \begin{macrocode}
\cs_new_protected:Npn \draw_path_rectangle:nn #1#2
{
- \@@_point_process:nnn
+ \bool_lazy_or:nnTF
+ { \l_@@_corner_arc_bool }
+ { \l_@@_matrix_active_bool }
{
- \bool_lazy_or:nnTF
- { \l_@@_corner_arc_bool }
- { \l_@@_matrix_active_bool }
- { \@@_path_rectangle_rounded:nnnn }
- { \@@_path_rectangle:nnnn }
+ \@@_point_process:nnn \@@_path_rectangle_rounded:nnnn
+ {#1} {#2}
+ }
+ {
+ \@@_point_process:nnn \@@_path_rectangle:nnnn
+ { (#1) + ( \l_@@_xshift_dim , \l_@@_yshift_dim ) }
+ { #2 }
}
- {#1}
- {#2}
}
\cs_new_protected:Npn \@@_path_rectangle:nnnn #1#2#3#4
{
@@ -766,8 +768,8 @@
\@@_point_process:nnn
{
\@@_path_grid_auxi:eennnn
- { \dim_eval:n { \dim_abs:n {#1} } }
- { \dim_eval:n { \dim_abs:n {#2} } }
+ { \dim_abs:n {#1} }
+ { \dim_abs:n {#2} }
}
{#3} {#4}
}
@@ -787,8 +789,8 @@
\cs_new_protected:Npn \@@_path_grid_auxiii:nnnnnn #1#2#3#4#5#6
{
\@@_path_grid_auxiv:eennnnnn
- { \fp_to_dim:n { #1 * trunc(#3/(#1)) } }
- { \fp_to_dim:n { #2 * trunc(#4/(#2)) } }
+ { \fp_to_dim:n { #1 * ceil(#3/(#1)) } }
+ { \fp_to_dim:n { #2 * ceil(#4/(#2)) } }
{#1} {#2} {#3} {#4} {#5} {#6}
}
\cs_new_protected:Npn \@@_path_grid_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8
@@ -832,19 +834,20 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{\l_@@_path_use_bb_bool, \l_@@_path_use_clear_bool}
+% \begin{variable}{\l_@@_path_use_clear_bool}
% Actions handled at the macro layer.
% \begin{macrocode}
-\bool_new:N \l_@@_path_use_bb_bool
\bool_new:N \l_@@_path_use_clear_bool
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\draw_path_use:n, \draw_path_use_clear:n}
+% \begin{macro}{\draw_path_replace_bb:}
+% \begin{macro}{\@@_path_replace_bb:NnN}
% \begin{macro}{\@@_path_use:n}
% \begin{macro}{\@@_path_use_action_draw:, \@@_path_use_action_fillstroke:}
% \begin{macro}{\@@_path_use_stroke_bb:}
-% \begin{macro}{\@@_path_use_stroke_bb_aux:NnN}
+% \begin{macro}{\@@_path_use_bb:NnN}
% There are a range of actions which can apply to a path: they are handled
% in a single function which can carry out several of them. The first step
% is to deal with the special case of clearing the path.
@@ -865,6 +868,23 @@
}
{ \@@_path_use:n { #1 , clear } }
}
+\cs_new_protected:Npn \draw_path_replace_bb:
+ {
+ \@@_path_replace_bb:NnN x { max } +
+ \@@_path_replace_bb:NnN y { max } +
+ \@@_path_replace_bb:NnN x { min } -
+ \@@_path_replace_bb:NnN y { min } -
+ \@@_softpath_clear:
+ \@@_path_reset_limits:
+ }
+\cs_new_protected:Npn \@@_path_replace_bb:NnN #1#2#3
+ {
+ \dim_gset:cn { g_@@_ #1#2 _dim }
+ {
+ \dim_use:c { g_@@_path_ #1#2 _dim }
+ #3 0.5 \g_@@_linewidth_dim
+ }
+ }
% \end{macrocode}
% Map over the actions and set up the data: mainly just booleans,
% but with the possibility to cover more complex cases. The business end
@@ -913,7 +933,10 @@
}
}
\bool_if:NT \l_@@_path_use_clear_bool
- { \@@_softpath_clear: }
+ {
+ \@@_softpath_clear:
+ \@@_path_reset_limits:
+ }
}
\cs_new_protected:Npn \@@_path_use_action_draw:
{
@@ -930,12 +953,12 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_path_use_stroke_bb:
{
- \@@_path_use_stroke_bb_aux:NnN x { max } +
- \@@_path_use_stroke_bb_aux:NnN y { max } +
- \@@_path_use_stroke_bb_aux:NnN x { min } -
- \@@_path_use_stroke_bb_aux:NnN y { min } -
+ \@@_path_use_bb:NnN x { max } +
+ \@@_path_use_bb:NnN y { max } +
+ \@@_path_use_bb:NnN x { min } -
+ \@@_path_use_bb:NnN y { min } -
}
-\cs_new_protected:Npn \@@_path_use_stroke_bb_aux:NnN #1#2#3
+\cs_new_protected:Npn \@@_path_use_bb:NnN #1#2#3
{
\dim_compare:nNnF { \dim_use:c { g_@@_ #1#2 _dim } } = { #3 -\c_max_dim }
{
@@ -956,6 +979,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsection{Scoping paths}
%
@@ -1017,11 +1042,13 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
+% \subsection{Messages}
+%
+% \begin{macrocode}
\msg_new:nnnn { draw } { invalid-path-action }
{ Invalid~action~'#1'~for~path. }
{ Paths~can~be~used~with~actions~'draw',~'clip',~'fill'~or~'stroke'. }
-% \end{macrocode}
+% \end{macrocode}
%
% \begin{macrocode}
%</package>
diff --git a/macros/latex/contrib/l3experimental/l3draw-points.dtx b/macros/latex/contrib/l3experimental/l3draw-points.dtx
index 0cb0fd6507..919f073440 100644
--- a/macros/latex/contrib/l3experimental/l3draw-points.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-points.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx
index 56ce949b24..81ab2dfed2 100644
--- a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx
index c929e86aa7..0d5d6d8b6b 100644
--- a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -163,6 +163,7 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{macro}{\@@_softpath_closepath:}
% \begin{macro}{\@@_softpath_curveto:nnnnnn}
% \begin{macro}
% {
@@ -227,6 +228,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
@@ -260,12 +262,14 @@
{ \@@_backend_lineto:nn {#1} {#2} }
\cs_new_protected:Npn \@@_softpath_moveto_op:nn #1#2
{ \@@_backend_moveto:nn {#1} {#2} }
-\cs_new_protected:Npn \@@_softpath_roundpoint_op:nn #1#2 { }
+\cs_new_protected:Npn \@@_softpath_roundpoint_op:nn #1#2
+ { \@@_softpath_roundpoint_op:nn }
\cs_new_protected:Npn \@@_softpath_rectangle_opi:nn #1#2
{ \@@_softpath_rectangle_opi:nnNnn {#1} {#2} }
\cs_new_protected:Npn \@@_softpath_rectangle_opi:nnNnn #1#2#3#4#5
{ \@@_backend_rectangle:nnnn {#1} {#2} {#4} {#5} }
- \cs_new_protected:Npn \@@_softpath_rectangle_opii:nn #1#2 { }
+\cs_new_protected:Npn \@@_softpath_rectangle_opii:nn #1#2
+ { \@@_softpath_rectangle_opii:nn }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/macros/latex/contrib/l3experimental/l3draw-state.dtx b/macros/latex/contrib/l3experimental/l3draw-state.dtx
index aef5c2111d..989c10fc2d 100644
--- a/macros/latex/contrib/l3experimental/l3draw-state.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-state.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx
index 8e9143420e..411bf30928 100644
--- a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -114,6 +114,7 @@
\fp_zero:N \l_@@_matrix_b_fp
\fp_zero:N \l_@@_matrix_c_fp
\fp_set:Nn \l_@@_matrix_d_fp { 1 }
+ \bool_set_false:N \l_@@_matrix_active_bool
}
\cs_new_protected:Npn \draw_transform_shift_reset:
{
@@ -219,7 +220,7 @@
\fp_to_dim:n
{
#1 +
- ( #3 * \l_@@_matrix_a_fp + #4 * \l_@@_matrix_b_fp )
+ ( #3 * \l_@@_matrix_a_fp + #4 * \l_@@_matrix_c_fp )
}
}
\dim_set:Nn \l_@@_yshift_dim
@@ -227,7 +228,7 @@
\fp_to_dim:n
{
#2 +
- ( #3 * \l_@@_matrix_c_fp + #4 * \l_@@_matrix_d_fp )
+ ( #3 * \l_@@_matrix_b_fp + #4 * \l_@@_matrix_d_fp )
}
}
}
diff --git a/macros/latex/contrib/l3experimental/l3draw.dtx b/macros/latex/contrib/l3experimental/l3draw.dtx
index 2bfa4e00af..a884b922b2 100644
--- a/macros/latex/contrib/l3experimental/l3draw.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw.dtx
@@ -110,7 +110,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -583,7 +583,7 @@
%
% \begin{function}{\draw_path_corner_arc:nn}
% \begin{syntax}
-% \cs{draw_path_corner_arc:n} \Arg{length1} \Arg{length2}
+% \cs{draw_path_corner_arc:nn} \Arg{length1} \Arg{length2}
% \end{syntax}
% Sets the degree of rounding applied to corners in a path: the two
% \meta{length} values are the distances from the corner at which the curving
@@ -658,6 +658,18 @@
% at the macro level).
% \end{function}
%
+% \begin{function}{\draw_path_replace_bb:}
+% \begin{syntax}
+% \cs{draw_path_replace_bb:}
+% \end{syntax}
+% Replaces the current bounding box of the drawing with one specified by the
+% current path: this will be applied even when \cs{l_draw_bb_update_bool}
+% is \texttt{false}. The current path is then cleared. Note that
+% \cs{l_draw_bb_update_bool} is \emph{not} changed by this function:
+% the user may wish to set it to \texttt{false} so that the bounding box
+% is then left unchanged by further operations.
+% \end{function}
+%
% \subsubsection{Path operations on drawing axes}
%
% The standard path functions are all influenced by the active transformation
@@ -1181,7 +1193,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3draw}{2024-02-20}{}
+\ProvidesExplPackage{l3draw}{2024-03-14}{}
{L3 Experimental core drawing support}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/l3draw.pdf b/macros/latex/contrib/l3experimental/l3draw.pdf
index a0941015ed..64b6ca1e50 100644
--- a/macros/latex/contrib/l3experimental/l3draw.pdf
+++ b/macros/latex/contrib/l3experimental/l3draw.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3galley.dtx b/macros/latex/contrib/l3experimental/l3galley.dtx
index 724d0d151d..8299d51d11 100644
--- a/macros/latex/contrib/l3experimental/l3galley.dtx
+++ b/macros/latex/contrib/l3experimental/l3galley.dtx
@@ -61,7 +61,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -686,7 +686,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3galley}{2024-02-20}{}
+\ProvidesExplPackage{l3galley}{2024-03-14}{}
{L3 Experimental galley code}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/l3galley.pdf b/macros/latex/contrib/l3experimental/l3galley.pdf
index b37d9194e4..d51755044e 100644
--- a/macros/latex/contrib/l3experimental/l3galley.pdf
+++ b/macros/latex/contrib/l3experimental/l3galley.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3graphics.dtx b/macros/latex/contrib/l3experimental/l3graphics.dtx
index ccb6f9669b..97be8ac39b 100644
--- a/macros/latex/contrib/l3experimental/l3graphics.dtx
+++ b/macros/latex/contrib/l3experimental/l3graphics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -184,7 +184,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3graphics}{2024-02-20}{}
+\ProvidesExplPackage{l3graphics}{2024-03-14}{}
{L3 Experimental graphics inclusion support}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/l3graphics.pdf b/macros/latex/contrib/l3experimental/l3graphics.pdf
index dd47e3b10f..8a5787f524 100644
--- a/macros/latex/contrib/l3experimental/l3graphics.pdf
+++ b/macros/latex/contrib/l3experimental/l3graphics.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3opacity.dtx b/macros/latex/contrib/l3experimental/l3opacity.dtx
index ba251f971d..fb293fd31c 100644
--- a/macros/latex/contrib/l3experimental/l3opacity.dtx
+++ b/macros/latex/contrib/l3experimental/l3opacity.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -65,6 +65,12 @@
% particular, using Adobe Distiller, you will need to enable transparency
% in the (text-based) configuration: this is not selectable from the GUI.
%
+% For users of PDF-based routes, note that opacity only takes effect if
+% a \cs{DocumentMetadata}|{}| is added \emph{before}
+% \cs[no-index]{documentclass}, which loads and activates
+% the PDF management.
+% See \file{pdfmanagement-testphase.pdf} for more info.
+%
% \begin{function}[added = 2021-07-01]{\opacity_select:n}
% \begin{syntax}
% \cs{opacity_select:n} \Arg{expression}
@@ -96,13 +102,21 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3opacity}{2024-02-20}{}
+\ProvidesExplPackage{l3opacity}{2024-03-14}{}
{L3 Experimental opacity support}
% \end{macrocode}
%
+% \begin{variable}
+% Temporary storage.
+% \begin{macrocode}
+\fp_new:N \l_@@_tmp_fp
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\opacity_select:n, \opacity_fill:n, \opacity_stroke:n}
-% \begin{macro}{\@@_select:nN, \@@_select_aux:nN}
-% Thin wrapper with error checking.
+% \begin{macro}{\@@_select:nN}
+% Thin wrapper with error checking. Opacity is passed to backend
+% functions as a bounded, evaluated decimal number.
% \begin{macrocode}
\cs_new_protected:Npn \opacity_select:n #1
{ \@@_select:nN {#1} \@@_backend_select:n }
@@ -111,14 +125,13 @@
\cs_new_protected:Npn \opacity_stroke:n #1
{ \@@_select:nN {#1} \@@_backend_stroke:n }
\cs_new_protected:Npn \@@_select:nN #1#2
- { \exp_args:Ne \@@_select_aux:nN { \fp_eval:n {#1} } #2 }
-\cs_new_protected:Npn \@@_select_aux:nN #1#2
{
+ \fp_set:Nn \l_@@_tmp_fp { #1 }
\bool_lazy_or:nnTF
- { \fp_compare_p:nNn {#1} < { 0 } }
- { \fp_compare_p:nNn {#1} > { 1 } }
+ { \fp_compare_p:nNn \l_@@_tmp_fp < \c_zero_fp }
+ { \fp_compare_p:nNn \l_@@_tmp_fp > \c_one_fp }
{ \msg_error:nnn { opacity } { out-of-range } {#1} }
- { #2 {#1} }
+ { \exp_args:Ne #2 { \fp_use:N \l_@@_tmp_fp } }
}
\msg_new:nnnn { opacity } { out-of-range }
{ Opacity~value~out~of~range. }
diff --git a/macros/latex/contrib/l3experimental/l3opacity.pdf b/macros/latex/contrib/l3experimental/l3opacity.pdf
index 7f0af34a48..e51f0341b3 100644
--- a/macros/latex/contrib/l3experimental/l3opacity.pdf
+++ b/macros/latex/contrib/l3experimental/l3opacity.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3str-format.dtx b/macros/latex/contrib/l3experimental/l3str-format.dtx
index 24aad77872..9ff5b451a9 100644
--- a/macros/latex/contrib/l3experimental/l3str-format.dtx
+++ b/macros/latex/contrib/l3experimental/l3str-format.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -166,7 +166,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3str-format}{2024-02-20}{}
+\ProvidesExplPackage{l3str-format}{2024-03-14}{}
{L3 Experimental string formatting}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/l3str-format.pdf b/macros/latex/contrib/l3experimental/l3str-format.pdf
index 45bd5bd4c2..f1203b80c2 100644
--- a/macros/latex/contrib/l3experimental/l3str-format.pdf
+++ b/macros/latex/contrib/l3experimental/l3str-format.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.dtx b/macros/latex/contrib/l3experimental/l3sys-shell.dtx
deleted file mode 100644
index 186a03d87a..0000000000
--- a/macros/latex/contrib/l3experimental/l3sys-shell.dtx
+++ /dev/null
@@ -1,446 +0,0 @@
-% \iffalse meta-comment
-%
-%% File: l3sys-shell.dtx
-%
-% Copyright (C) 2018-2024 The LaTeX Project
-%
-% It may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License (LPPL), either version 1.3c of this
-% license or (at your option) any later version. The latest version
-% of this license is in the file
-%
-% http://www.latex-project.org/lppl.txt
-%
-% This file is part of the "l3experimental bundle" (The Work in LPPL)
-% and all files in that bundle must be distributed together.
-%
-% -----------------------------------------------------------------------
-%
-% The development version of the bundle can be found at
-%
-% https://github.com/latex3/latex3
-%
-% for those people who are interested.
-%
-%<*driver|package>
-\RequirePackage{expl3}
-%</driver|package>
-%<*driver>
-\documentclass[full]{l3doc}
-\begin{document}
- \DocInput{\jobname.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-% \title{^^A
-% The \pkg{l3sys-shell} package\\ System shell functions^^A
-% }
-%
-% \author{^^A
-% The \LaTeX{} Project\thanks
-% {^^A
-% E-mail:
-% \href{mailto:latex-team@latex-project.org}
-% {latex-team@latex-project.org}^^A
-% }^^A
-% }
-%
-% \date{Released 2024-02-20}
-%
-% \maketitle
-%
-% \begin{documentation}
-%
-% This module provides platform-neutral interfaces to system shell commands.
-% These functions can only access the shell if a document is proceeded using
-% \texttt{--shell-escape}, which allows \emph{unrestricted} access to command
-% line functions.
-%
-% In general, arbitrary documents should \emph{not} be processed in this way,
-% as shell escape could either accidentally or deliberately lead to unexpected
-% side-effects. In that sense, they should be treated like any other arbitrary
-% script: with caution. No attempt is made by the functions here to avoid
-% injection of additional commands into the arguments.
-%
-% With the above security caveats in mind, these functions are provided for
-% authors where a workflow scripting \emph{within} a \LaTeX{} document is
-% preferable to using an external script. The latter would of course also have
-% the ability to run arbitrary code.
-%
-% \begin{function}[added = 2018-07-28]{\sys_shell_cp:nn}
-% \begin{syntax}
-% \cs{sys_shell_cp:nn} \Arg{source} \Arg{dest}
-% \end{syntax}
-% Copies the files specified in the \meta{source} (which may include
-% wildcards) to the \meta{dest}. The file paths should be specified using
-% |/| as a path separator. Copying is \emph{not} recursive: only files at
-% the path level given are copied. If unrestricted shell escape is not
-% enabled, no action is attempted.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-27]{\sys_shell_mkdir:n}
-% \begin{syntax}
-% \cs{sys_shell_mkdir:n} \Arg{directory}
-% \end{syntax}
-% Creates the \meta{directory}, which should be specified using |/| as
-% a path separator. If unrestricted shell escape is not enabled, no action is
-% attempted.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-28]{\sys_shell_mv:nn}
-% \begin{syntax}
-% \cs{sys_shell_mv:nn} \Arg{old} \Arg{new}
-% \end{syntax}
-% Moves the files from the \meta{old} to \meta{new} names/locations: the
-% \meta{old} names may include wildcards. In both arguments, |/| should be
-% used as the path separator. If unrestricted shell escape is not enabled, no
-% action is attempted.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-27]{\sys_shell_rm:n}
-% \begin{syntax}
-% \cs{sys_shell_rm:n} \Arg{files}
-% \end{syntax}
-% Removes the \meta{files} (which may include wildcards). The file path should
-% be specified using |/| as a path separator. If unrestricted shell escape is
-% not enabled, no action is attempted.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-27]{\sys_shell_rmdir:n}
-% \begin{syntax}
-% \cs{sys_shell_rmdir:n} \Arg{directory}
-% \end{syntax}
-% Removes the \meta{directory}, which should be specified using |/| as
-% a path separator. If unrestricted shell escape is not enabled, no action is
-% attempted.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-28]{\sys_get_shell_pwd:N}
-% \begin{syntax}
-% \cs{sys_get_shell_pwd:N} \meta{str var}
-% \end{syntax}
-% Sets the \meta{str var} to the present working directory (the output of
-% |pwd| on Unix or |cd| on Windows). Note that on Windows this will contain
-% string backslash chars (|\|). If unrestricted shell escape is not
-% enabled, no action is taken.
-% \end{function}
-%
-% \begin{function}[added = 2018-07-28, updated = 2024-02-20]
-% {\sys_shell_split_ls:nN}
-% \begin{syntax}
-% \cs{sys_shell_split_ls:N} \Arg{glob} \meta{seq}
-% \end{syntax}
-% Sets the \meta{seq var} to contain one entry per directory listing
-% (equivalent to |ls -1| or |dir /b /s| with relative paths) as specified by
-% the \meta{glob}: the entries are strings. If unrestricted shell is not
-% enabled, no action is taken.
-% \end{function}
-%
-% \end{documentation}
-%
-% \begin{implementation}
-%
-% \section{\pkg{l3sys-shell} implementation}
-%
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=sys>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvidesExplPackage{l3sys-shell}{2024-02-20}{}
- {L3 Experimental system shell functions}
-% \end{macrocode}
-%
-% \begin{variable}{\s_@@_stop}
-% Internal scan marks.
-% \begin{macrocode}
-\scan_new:N \s_@@_stop
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{variable}{\q_@@_nil}
-% Internal quarks.
-% \begin{macrocode}
-\quark_new:N \q_@@_nil
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}[pTF]{\@@_quark_if_nil:n}
-% Branching quark conditional.
-% \begin{macrocode}
-\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:N { F }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\@@_path_to_win:n}
-% \begin{macro}[EXP]{\@@_path_to_win:w}
-% \begin{macro}[EXP]{\@@_path_to_win:N}
-% A simple expandable search-and-replace for providing Windows-style paths.
-% \begin{macrocode}
-\cs_new:Npn \@@_path_to_win:n #1
- {
- \exp_after:wN \@@_path_to_win:w \tl_to_str:n {#1} ~ \s_@@_stop
- }
-\cs_new:Npn \@@_path_to_win:w #1 ~ #2 \s_@@_stop
- {
- \@@_path_to_win:N #1 \q_@@_nil
- \tl_if_empty:nF {#2}
- {
- \c_space_tl
- \@@_path_to_win:w #2 \s_@@_stop
- }
- }
-\cs_new:Npn \@@_path_to_win:N #1
- {
- \@@_quark_if_nil:NF #1
- {
- \token_if_eq_meaning:NNTF #1 /
- { \c_backslash_str }
- {#1}
- \@@_path_to_win:N
- }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_cp:nn}
-% Simple Unix-like file copying: at some stage we may need a directory-only
-% version as Windows and Unix have different requirements here.
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_cp:nn #1#2
- {
- \sys_if_shell_unrestricted:T
- {
- \sys_shell_now:e
- {
- \sys_if_platform_unix:T
- {
- cp~-f~ \exp_not:N \tl_to_str:n {#1} ~
- \exp_not:N \tl_to_str:n {#2}
- }
- \sys_if_platform_windows:T
- {
- copy~/y~ \exp_not:N \@@_path_to_win:n {#1} ~
- \exp_not:N \@@_path_to_win:n {#2}
- }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_mkdir:n}
-% Windows (with the extensions) will automatically make directory trees but
-% issues a warning if the directory already exists: avoid by including a
-% test.
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_mkdir:n #1
- {
- \sys_if_shell_unrestricted:T
- {
- \sys_shell_now:e
- {
- \sys_if_platform_unix:T
- { mkdir~-p~ \exp_not:N \tl_to_str:n {#1} }
- \sys_if_platform_windows:T
- {
- if~not~exist~
- \exp_not:N \@@_path_to_win:n { #1 / nul } ~
- mkdir~ \exp_not:N \@@_path_to_win:n {#1}
- }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_mv:nn}
-% On Windows we do not have a single |mv| operation, so copy-and-delete
-% instead.
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_mv:nn #1#2
- {
- \sys_if_shell_unrestricted:T
- {
- \sys_shell_now:e
- {
- \sys_if_platform_unix:T
- {
- mv~ \exp_not:N \tl_to_str:n {#1} ~
- \exp_not:N \tl_to_str:n {#2}
- }
- \sys_if_platform_windows:T
- {
- copy~/y~ \exp_not:N \@@_path_to_win:n {#1} ~
- \exp_not:N \@@_path_to_win:n {#2}
- \token_to_str:N & \token_to_str:N &
- del~/f~/q~\exp_not:N \@@_path_to_win:n {#1}
- }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_rm:n}
-% Deletion: obviously a big health warning here!
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_rm:n #1
- {
- \sys_if_shell_unrestricted:T
- {
- \sys_shell_now:e
- {
- \sys_if_platform_unix:T
- { rm~-f~ \exp_not:N \tl_to_str:n {#1} }
- \sys_if_platform_windows:T
- { del~/f~/q~ \exp_not:N \@@_path_to_win:n {#1} }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_rmdir:n}
-% When removing a directory, we create it first as that avoids errors in
-% the Windows case.
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_rmdir:n #1
- {
- \sys_if_shell_unrestricted:T
- {
- \sys_shell_mkdir:n {#1}
- \sys_shell_now:e
- {
- \sys_if_platform_unix:T
- { rm~-rf~ \exp_not:N \tl_to_str:n {#1} }
- \sys_if_platform_windows:T
- { rmdir~/s~/q~ \exp_not:N \@@_path_to_win:n {#1} }
- }
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{variable}{\l_@@_tmp_seq, \l_@@_tmp_tl}
-% Scratch space.
-% \begin{macrocode}
-\seq_new:N \l_@@_tmp_seq
-\tl_new:N \l_@@_tmp_tl
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}{\sys_get_shell_pwd:N}
-% Getting the path is easy: the main work is avoiding loosing any
-% information. (This information can be obtained using the recorder file:
-% that does not require shell escape. However, it's hard to see how it might
-% be useful without the other file functions.)
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_get_shell_pwd:N #1
- {
- \sys_if_shell_unrestricted:T
- {
- \exp_not:N \sys_get_shell:nnN
- {
- \sys_if_platform_unix:T { pwd }
- \sys_if_platform_windows:T { cd }
- }
- {
- \char_set_catcode_other:N \exp_not:N \\
- \char_set_catcode_other:N \exp_not:N \#
- \char_set_catcode_other:N \exp_not:N \~
- \char_set_catcode_other:N \exp_not:N \%
- \char_set_catcode_space:N \exp_not:N \ %
- \tex_endlinechar:D -1 \scan_stop:
- }
- \exp_not:N \l_@@_tmp_tl
- \str_set:NV #1 \exp_not:N \l_@@_tmp_tl
- }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sys_shell_split_ls:nN}
-% \begin{macro}{\@@_shell_split_ls:nN}
-% \begin{macro}{\@@_shell_split_ls:w}
-% Getting a one-per-line listing is easy enough. We need to set
-% \cs{ExplSyntaxOff} as that deals with the end-of-line character. After that,
-% just a case of tidying up. The listing always ends in |^^M| so there is an
-% extra entry to trim.
-% \begin{macrocode}
-\cs_new_protected:Npe \sys_shell_split_ls:nN #1#2
- {
- \sys_if_shell_unrestricted:T
- {
- \exp_not:N \exp_args:Ne \exp_not:N \sys_get_shell:nnN
- {
- \sys_if_platform_unix:T { ls~-1~ #1 }
- \sys_if_platform_windows:T
- { dir~/b~/s~ \exp_not:N \@@_path_to_win:n {#1} }
- }
- {
- \ExplSyntaxOff
- \char_set_catcode_other:N \exp_not:N \\
- \char_set_catcode_other:N \exp_not:N \#
- \char_set_catcode_other:N \exp_not:N \~
- \char_set_catcode_other:N \exp_not:N \%
- \char_set_catcode_other:n { 13 }
- }
- \exp_not:N \l_@@_tmp_tl
- \str_set:NV \exp_not:N \l_@@_tmp_tl \exp_not:N \l_@@_tmp_tl
- \seq_set_split:NnV #2 { \char_generate:nn { `\^^M } { 12 } }
- \exp_not:N \l_@@_tmp_tl
- \seq_pop_right:NN #2 \exp_not:N \l_@@_tmp_tl
- \exp_not:N \tl_if_blank:eTF { \exp_not:N \seq_item:Nn #2 { 1 } }
- { \seq_clear:N #2 }
- \sys_if_platform_windows:T
- {
- \sys_get_shell_pwd:N \exp_not:N \l_@@_tmp_tl
- \exp_not:N \exp_args:NV \exp_not:N \@@_shell_split_ls:nN
- \exp_not:N \l_@@_tmp_tl #2
- }
- }
- }
-% \end{macrocode}
-% On Windows, we can either get just file names (|dir /b|) or file names with
-% complete paths (|dir /s /b|), but not file names with relative paths in
-% a simple way. So we take the full paths and trim off the current working
-% directory. Normalization gives the same results as |ls|, hopefully.
-% \begin{macrocode}
-\sys_if_platform_windows:T
- {
- \cs_new_protected:Npe \@@_shell_split_ls:nN #1#2
- {
- \cs_set:Npn \exp_not:N \@@_shell_split_ls:w #1 \c_backslash_str { }
- \seq_set_eq:NN \exp_not:N \l_@@_tmp_seq #2
- \seq_clear:N #2
- \seq_map_inline:Nn \exp_not:N \l_@@_tmp_seq
- {
- \tl_set:Ne \exp_not:N \l_@@_tmp_tl
- { \exp_not:N \@@_shell_split_ls:w ##1 }
- \tl_replace_all:Nnn \exp_not:N \l_@@_tmp_tl
- { \c_backslash_str } { / }
- \seq_put_right:NV #2 \exp_not:N \l_@@_tmp_tl
- }
- }
- \cs_new:Npn \@@_shell_split_ls:w { }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
-%
-% \end{implementation}
-%
-% \PrintIndex
diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.ins b/macros/latex/contrib/l3experimental/l3sys-shell.ins
deleted file mode 100644
index 8e5e7169d9..0000000000
--- a/macros/latex/contrib/l3experimental/l3sys-shell.ins
+++ /dev/null
@@ -1,62 +0,0 @@
-\iffalse meta-comment
-
-File: l3sys-shell.ins
-
-Copyright (C) 2018-2024 The LaTeX Project
-
-It may be distributed and/or modified under the conditions of the
-LaTeX Project Public License (LPPL), either version 1.3c of this
-license or (at your option) any later version. The latest version
-of this license is in the file
-
- http://www.latex-project.org/lppl.txt
-
-This file is part of the "l3experimental bundle" (The Work in LPPL)
-and all files in that bundle must be distributed together.
-
------------------------------------------------------------------------
-
-The development version of the bundle can be found at
-
- https://github.com/latex3/latex3
-
-for those people who are interested.
-
------------------------------------------------------------------------
-
-Any modification of this file should ensure that the copyright and
-license information is placed in the derived files.
-
-\fi
-
-\input docstrip %
-\askforoverwritefalse
-
-\preamble
-
-Copyright (C) 2018-2024 The LaTeX Project
-
-It may be distributed and/or modified under the conditions of
-the LaTeX Project Public License (LPPL), either version 1.3c of
-this license or (at your option) any later version. The latest
-version of this license is in the file:
-
- http://www.latex-project.org/lppl.txt
-
-This file is part of the "l3experimental bundle" (The Work in LPPL)
-and all files in that bundle must be distributed together.
-
-\endpreamble
-% stop docstrip adding \endinput
-\postamble
-\endpostamble
-
-\keepsilent
-
-\generate{\file{l3sys-shell.sty}
- {
- \from{l3sys-shell.dtx}{package}
- }
-}
-
-\endbatchfile
diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.pdf b/macros/latex/contrib/l3experimental/l3sys-shell.pdf
deleted file mode 100644
index c35e6f24b6..0000000000
--- a/macros/latex/contrib/l3experimental/l3sys-shell.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/xcoffins.dtx b/macros/latex/contrib/l3experimental/xcoffins.dtx
index c84f21ae97..404171ddc1 100644
--- a/macros/latex/contrib/l3experimental/xcoffins.dtx
+++ b/macros/latex/contrib/l3experimental/xcoffins.dtx
@@ -53,7 +53,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -672,7 +672,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xcoffins}{2024-02-20}{}
+\ProvidesExplPackage{xcoffins}{2024-03-14}{}
{L3 Experimental design level coffins}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3experimental/xcoffins.pdf b/macros/latex/contrib/l3experimental/xcoffins.pdf
index a8e4ce7d9e..fa4fe50701 100644
--- a/macros/latex/contrib/l3experimental/xcoffins.pdf
+++ b/macros/latex/contrib/l3experimental/xcoffins.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3experimental/xgalley.dtx b/macros/latex/contrib/l3experimental/xgalley.dtx
index 25344df931..5e4389eb95 100644
--- a/macros/latex/contrib/l3experimental/xgalley.dtx
+++ b/macros/latex/contrib/l3experimental/xgalley.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -731,7 +731,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xgalley}{2024-02-20}{}
+\ProvidesExplPackage{xgalley}{2024-03-14}{}
{L3 Experimental galley}
\RequirePackage{xtemplate,l3galley}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3experimental/xgalley.pdf b/macros/latex/contrib/l3experimental/xgalley.pdf
index d08bc86926..5afb51f32e 100644
--- a/macros/latex/contrib/l3experimental/xgalley.pdf
+++ b/macros/latex/contrib/l3experimental/xgalley.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md
index eed4b5c3e1..9c8c4d506c 100644
--- a/macros/latex/contrib/l3kernel/CHANGELOG.md
+++ b/macros/latex/contrib/l3kernel/CHANGELOG.md
@@ -7,6 +7,19 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2024-03-14]
+
+### Added
+- Macro interface for `l3sys-query`
+
+### Changed
+- Require that `expl3` is loaded at top level in generic mode
+- Ensure that the dimension arguments to `\box_autosize_to_...:Nnn`
+ are properly formed (issue \#1502)
+
+### Fixed
+- Typeset `TF` of internal conditionals in current color (issue \#730)
+- Some functions and variables were defined locally
## [2024-02-20]
### Changed
@@ -1687,7 +1700,8 @@ this project uses date-based 'snapshot' version identifiers.
- Step functions have been added for dim variables,
e.g. `\dim_step_inline:nnnn`
-[Unreleased]: https://github.com/latex3/latex3/compare/2024-02-20...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2024-03-14...HEAD
+[2024-03-14]: https://github.com/latex3/latex3/compare/2024-02-20...2024-03-14
[2024-02-20]: https://github.com/latex3/latex3/compare/2024-02-18...2024-02-20
[2024-02-18]: https://github.com/latex3/latex3/compare/2024-02-13...2024-02-18
[2024-02-13]: https://github.com/latex3/latex3/compare/2024-01-22...2024-02-13
diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md
index 93cd009b56..8ef94a41ac 100644
--- a/macros/latex/contrib/l3kernel/README.md
+++ b/macros/latex/contrib/l3kernel/README.md
@@ -1,7 +1,7 @@
LaTeX3 Programming Conventions
==============================
-Release 2024-02-20
+Release 2024-03-14
Overview
--------
diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx
index 2c3f5f892a..76ef8ec919 100644
--- a/macros/latex/contrib/l3kernel/expl3.dtx
+++ b/macros/latex/contrib/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2024-02-20}%
+\def\ExplFileDate{2024-03-14}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -1695,6 +1695,16 @@
{\ExplFileDate\space L3 programming layer}%
% \end{macrocode}
%
+% \begin{macrocode}
+\ifnum\currentgrouplevel=0 %
+\else
+ \errhelp{expl3 cannot be loaded inside a group:
+ reading the code has been aborted.}%
+ \errmessage{expl3 Error: Loading attempted inside a group!}%
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
% \begin{variable}[int]{\l@expl@tidy@tl}
% Save the category code of |@| and then set it to \enquote{letter}.
% \begin{macrocode}
diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf
index 8468634aee..b36343153a 100644
--- a/macros/latex/contrib/l3kernel/expl3.pdf
+++ b/macros/latex/contrib/l3kernel/expl3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf
index 973d529575..1df60adf1a 100644
--- a/macros/latex/contrib/l3kernel/interface3.pdf
+++ b/macros/latex/contrib/l3kernel/interface3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex
index 985ab25097..ff8114028e 100644
--- a/macros/latex/contrib/l3kernel/interface3.tex
+++ b/macros/latex/contrib/l3kernel/interface3.tex
@@ -58,7 +58,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2024-02-20}
+\date{Released 2024-03-14}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx
index 67bd4b8791..66e999fe62 100644
--- a/macros/latex/contrib/l3kernel/l3basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -1047,7 +1047,7 @@
% \texttt{n} arguments may be an unbraced single token
% (\emph{i.e.}~an \texttt{N} argument).
% \begin{texnote}
-% These are equivalent to \LaTeXe{}'s \tn{@gobble}, \tn{@gobbbletwo},
+% These are equivalent to \LaTeXe{}'s \tn{@gobble}, \tn{@gobbletwo},
% \emph{etc.}
% \end{texnote}
% \end{function}
@@ -1387,17 +1387,17 @@
% }
% Then some conditionals.
% \begin{macrocode}
-\tex_let:D \if_true: \tex_iftrue:D
-\tex_let:D \if_false: \tex_iffalse:D
-\tex_let:D \or: \tex_or:D
-\tex_let:D \else: \tex_else:D
-\tex_let:D \fi: \tex_fi:D
-\tex_let:D \reverse_if:N \tex_unless:D
-\tex_let:D \if:w \tex_if:D
-\tex_let:D \if_charcode:w \tex_if:D
-\tex_let:D \if_catcode:w \tex_ifcat:D
-\tex_let:D \if_meaning:w \tex_ifx:D
-\tex_let:D \if_bool:N \tex_ifodd:D
+\tex_global:D \tex_let:D \if_true: \tex_iftrue:D
+\tex_global:D \tex_let:D \if_false: \tex_iffalse:D
+\tex_global:D \tex_let:D \or: \tex_or:D
+\tex_global:D \tex_let:D \else: \tex_else:D
+\tex_global:D \tex_let:D \fi: \tex_fi:D
+\tex_global:D \tex_let:D \reverse_if:N \tex_unless:D
+\tex_global:D \tex_let:D \if:w \tex_if:D
+\tex_global:D \tex_let:D \if_charcode:w \tex_if:D
+\tex_global:D \tex_let:D \if_catcode:w \tex_ifcat:D
+\tex_global:D \tex_let:D \if_meaning:w \tex_ifx:D
+\tex_global:D \tex_let:D \if_bool:N \tex_ifodd:D
% \end{macrocode}
% \end{macro}
%
@@ -1410,20 +1410,20 @@
% }
% \TeX{} lets us detect some if its modes.
% \begin{macrocode}
-\tex_let:D \if_mode_math: \tex_ifmmode:D
-\tex_let:D \if_mode_horizontal: \tex_ifhmode:D
-\tex_let:D \if_mode_vertical: \tex_ifvmode:D
-\tex_let:D \if_mode_inner: \tex_ifinner:D
+\tex_global:D \tex_let:D \if_mode_math: \tex_ifmmode:D
+\tex_global:D \tex_let:D \if_mode_horizontal: \tex_ifhmode:D
+\tex_global:D \tex_let:D \if_mode_vertical: \tex_ifvmode:D
+\tex_global:D \tex_let:D \if_mode_inner: \tex_ifinner:D
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\if_cs_exist:N, \if_cs_exist:w, \cs:w, \cs_end:}
% Building csnames and testing if control sequences exist.
% \begin{macrocode}
-\tex_let:D \if_cs_exist:N \tex_ifdefined:D
-\tex_let:D \if_cs_exist:w \tex_ifcsname:D
-\tex_let:D \cs:w \tex_csname:D
-\tex_let:D \cs_end: \tex_endcsname:D
+\tex_global:D \tex_let:D \if_cs_exist:N \tex_ifdefined:D
+\tex_global:D \tex_let:D \if_cs_exist:w \tex_ifcsname:D
+\tex_global:D \tex_let:D \cs:w \tex_csname:D
+\tex_global:D \tex_let:D \cs_end: \tex_endcsname:D
% \end{macrocode}
% \end{macro}
%
@@ -1431,28 +1431,28 @@
% The five |\exp_| functions are used in the \pkg{l3expan} module
% where they are described.
% \begin{macrocode}
-\tex_let:D \exp_after:wN \tex_expandafter:D
-\tex_let:D \exp_not:N \tex_noexpand:D
-\tex_let:D \exp_not:n \tex_unexpanded:D
-\tex_let:D \exp:w \tex_romannumeral:D
-\tex_chardef:D \exp_end: = 0 ~
+\tex_global:D \tex_let:D \exp_after:wN \tex_expandafter:D
+\tex_global:D \tex_let:D \exp_not:N \tex_noexpand:D
+\tex_global:D \tex_let:D \exp_not:n \tex_unexpanded:D
+\tex_global:D \tex_let:D \exp:w \tex_romannumeral:D
+\tex_global:D \tex_chardef:D \exp_end: = 0 ~
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\token_to_meaning:N, \cs_meaning:N}
% Examining a control sequence or token.
% \begin{macrocode}
-\tex_let:D \token_to_meaning:N \tex_meaning:D
-\tex_let:D \cs_meaning:N \tex_meaning:D
+\tex_global:D \tex_let:D \token_to_meaning:N \tex_meaning:D
+\tex_global:D \tex_let:D \cs_meaning:N \tex_meaning:D
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\tl_to_str:n, \token_to_str:N, \__kernel_tl_to_str:w}
% Making strings.
% \begin{macrocode}
-\tex_let:D \tl_to_str:n \tex_detokenize:D
-\tex_let:D \token_to_str:N \tex_string:D
-\tex_let:D \__kernel_tl_to_str:w \tex_detokenize:D
+\tex_global:D \tex_let:D \tl_to_str:n \tex_detokenize:D
+\tex_global:D \tex_let:D \token_to_str:N \tex_string:D
+\tex_global:D \tex_let:D \__kernel_tl_to_str:w \tex_detokenize:D
% \end{macrocode}
% \end{macro}
%
@@ -1461,9 +1461,9 @@
% versions that are safe inside alignments. These safe versions are
% defined in the \pkg{l3prg} module.
% \begin{macrocode}
-\tex_let:D \scan_stop: \tex_relax:D
-\tex_let:D \group_begin: \tex_begingroup:D
-\tex_let:D \group_end: \tex_endgroup:D
+\tex_global:D \tex_let:D \scan_stop: \tex_relax:D
+\tex_global:D \tex_let:D \group_begin: \tex_begingroup:D
+\tex_global:D \tex_let:D \group_end: \tex_endgroup:D
% \end{macrocode}
% \end{macro}
%
@@ -1474,24 +1474,24 @@
% \begin{macro}[EXP]{\if_int_compare:w, \@@_to_roman:w}
% For integers.
% \begin{macrocode}
-\tex_let:D \if_int_compare:w \tex_ifnum:D
-\tex_let:D \@@_to_roman:w \tex_romannumeral:D
+\tex_global:D \tex_let:D \if_int_compare:w \tex_ifnum:D
+\tex_global:D \tex_let:D \@@_to_roman:w \tex_romannumeral:D
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\group_insert_after:N}
% Adding material after the end of a group.
% \begin{macrocode}
-\tex_let:D \group_insert_after:N \tex_aftergroup:D
+\tex_global:D \tex_let:D \group_insert_after:N \tex_aftergroup:D
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\exp_args:Nc, \exp_args:cc}
% Discussed in \pkg{l3expan}, but needed much earlier.
% \begin{macrocode}
-\tex_long:D \tex_def:D \exp_args:Nc #1#2
+\tex_long:D \tex_gdef:D \exp_args:Nc #1#2
{ \exp_after:wN #1 \cs:w #2 \cs_end: }
-\tex_long:D \tex_def:D \exp_args:cc #1#2
+\tex_long:D \tex_gdef:D \exp_args:cc #1#2
{ \cs:w #1 \exp_after:wN \cs_end: \cs:w #2 \cs_end: }
% \end{macrocode}
% \end{macro}
@@ -1505,8 +1505,8 @@
% are used. The \cs{cs_meaning:c} command must check for an undefined
% control sequence to avoid defining it mistakenly.
% \begin{macrocode}
-\tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
-\tex_long:D \tex_def:D \cs_meaning:c #1
+\tex_gdef:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
+\tex_long:D \tex_gdef:D \cs_meaning:c #1
{
\if_cs_exist:w #1 \cs_end:
\exp_after:wN \use_i:nn
@@ -1516,7 +1516,7 @@
{ \exp_args:Nc \cs_meaning:N {#1} }
{ \tl_to_str:n {undefined} }
}
-\tex_let:D \token_to_meaning:c = \cs_meaning:c
+\tex_global:D \tex_let:D \token_to_meaning:c = \cs_meaning:c
% \end{macrocode}
% \end{macro}
%
@@ -1531,7 +1531,7 @@
% required but it can't be used until the allocation has been set
% up properly!
% \begin{macrocode}
-\tex_chardef:D \c_zero_int = 0 ~
+\tex_global:D \tex_chardef:D \c_zero_int = 0 ~
% \end{macrocode}
% \end{variable}
%
@@ -1542,12 +1542,12 @@
% more registers available than \eTeX{}.
% \begin{macrocode}
\tex_ifdefined:D \tex_luatexversion:D
- \tex_chardef:D \c_max_register_int = 65 535 ~
+ \tex_global:D \tex_chardef:D \c_max_register_int = 65 535 ~
\tex_else:D
\tex_ifdefined:D \tex_omathchardef:D
- \tex_omathchardef:D \c_max_register_int = 65535 ~
+ \tex_global:D \tex_omathchardef:D \c_max_register_int = 65535 ~
\tex_else:D
- \tex_mathchardef:D \c_max_register_int = 32767 ~
+ \tex_global:D \tex_mathchardef:D \c_max_register_int = 32767 ~
\tex_fi:D
\tex_fi:D
% \end{macrocode}
@@ -1556,39 +1556,7 @@
% \subsection{Defining functions}
%
% We start by providing functions for the typical definition
-% functions. First the local ones.
-%
-% \begin{macro}
-% {
-% \cs_set_nopar:Npn , \cs_set_nopar:Npe , \cs_set_nopar:Npx ,
-% \cs_set:Npn , \cs_set:Npe , \cs_set:Npx ,
-% \cs_set_protected_nopar:Npn , \cs_set_protected_nopar:Npe , \cs_set_protected_nopar:Npx ,
-% \cs_set_protected:Npn , \cs_set_protected:Npe , \cs_set_protected:Npx
-% }
-% All assignment functions in \LaTeX3 should be naturally protected;
-% after all, the \TeX{} primitives for assignments are and it can be
-% a cause of problems if others aren't.
-% \begin{macrocode}
-\tex_let:D \cs_set_nopar:Npn \tex_def:D
-\tex_let:D \cs_set_nopar:Npe \tex_edef:D
-\tex_let:D \cs_set_nopar:Npx \tex_edef:D
-\tex_protected:D \tex_long:D \tex_def:D \cs_set:Npn
- { \tex_long:D \tex_def:D }
-\tex_protected:D \tex_long:D \tex_def:D \cs_set:Npe
- { \tex_long:D \tex_edef:D }
-\tex_let:D \cs_set:Npx \cs_set:Npe
-\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npn
- { \tex_protected:D \tex_def:D }
-\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected_nopar:Npe
- { \tex_protected:D \tex_edef:D }
-\tex_let:D \cs_set_protected_nopar:Npx \cs_set_protected_nopar:Npe
-\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npn
- { \tex_protected:D \tex_long:D \tex_def:D }
-\tex_protected:D \tex_long:D \tex_def:D \cs_set_protected:Npe
- { \tex_protected:D \tex_long:D \tex_edef:D }
-\tex_let:D \cs_set_protected:Npx \cs_set_protected:Npe
-% \end{macrocode}
-% \end{macro}
+% functions. First the global ones.
%
% \begin{macro}
% {
@@ -1597,26 +1565,58 @@
% \cs_gset_protected_nopar:Npn , \cs_gset_protected_nopar:Npe , \cs_gset_protected_nopar:Npx ,
% \cs_gset_protected:Npn , \cs_gset_protected:Npe , \cs_gset_protected:Npx
% }
-% Global versions of the above functions.
+% All assignment functions in \LaTeX3 should be naturally protected;
+% after all, the \TeX{} primitives for assignments are and it can be
+% a cause of problems if others aren't.
% \begin{macrocode}
-\tex_let:D \cs_gset_nopar:Npn \tex_gdef:D
-\tex_let:D \cs_gset_nopar:Npe \tex_xdef:D
-\tex_let:D \cs_gset_nopar:Npx \tex_xdef:D
-\cs_set_protected:Npn \cs_gset:Npn
+\tex_global:D \tex_let:D \cs_gset_nopar:Npn \tex_gdef:D
+\tex_global:D \tex_let:D \cs_gset_nopar:Npe \tex_xdef:D
+\tex_global:D \tex_let:D \cs_gset_nopar:Npx \tex_xdef:D
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset:Npn
{ \tex_long:D \tex_gdef:D }
-\cs_set_protected:Npn \cs_gset:Npe
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset:Npe
{ \tex_long:D \tex_xdef:D }
-\tex_let:D \cs_gset:Npx \cs_gset:Npe
-\cs_set_protected:Npn \cs_gset_protected_nopar:Npn
+\tex_global:D \tex_let:D \cs_gset:Npx \cs_gset:Npe
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset_protected_nopar:Npn
{ \tex_protected:D \tex_gdef:D }
-\cs_set_protected:Npn \cs_gset_protected_nopar:Npe
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset_protected_nopar:Npe
{ \tex_protected:D \tex_xdef:D }
-\tex_let:D \cs_gset_protected_nopar:Npx \cs_gset_protected_nopar:Npe
-\cs_set_protected:Npn \cs_gset_protected:Npn
+\tex_global:D \tex_let:D \cs_gset_protected_nopar:Npx \cs_gset_protected_nopar:Npe
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset_protected:Npn
{ \tex_protected:D \tex_long:D \tex_gdef:D }
-\cs_set_protected:Npn \cs_gset_protected:Npe
+\tex_protected:D \tex_long:D \tex_gdef:D \cs_gset_protected:Npe
{ \tex_protected:D \tex_long:D \tex_xdef:D }
-\tex_let:D \cs_gset_protected:Npx \cs_gset_protected:Npe
+\tex_global:D \tex_let:D \cs_gset_protected:Npx \cs_gset_protected:Npe
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}
+% {
+% \cs_set_nopar:Npn , \cs_set_nopar:Npe , \cs_set_nopar:Npx ,
+% \cs_set:Npn , \cs_set:Npe , \cs_set:Npx ,
+% \cs_set_protected_nopar:Npn , \cs_set_protected_nopar:Npe , \cs_set_protected_nopar:Npx ,
+% \cs_set_protected:Npn , \cs_set_protected:Npe , \cs_set_protected:Npx
+% }
+% Local versions of the above functions.
+% \begin{macrocode}
+\tex_global:D \tex_let:D \cs_set_nopar:Npn \tex_def:D
+\tex_global:D \tex_let:D \cs_set_nopar:Npe \tex_edef:D
+\tex_global:D \tex_let:D \cs_set_nopar:Npx \tex_edef:D
+\cs_gset_protected:Npn \cs_set:Npn
+ { \tex_long:D \tex_def:D }
+\cs_gset_protected:Npn \cs_set:Npe
+ { \tex_long:D \tex_edef:D }
+\tex_global:D \tex_let:D \cs_set:Npx \cs_set:Npe
+\cs_gset_protected:Npn \cs_set_protected_nopar:Npn
+ { \tex_protected:D \tex_def:D }
+\cs_gset_protected:Npn \cs_set_protected_nopar:Npe
+ { \tex_protected:D \tex_edef:D }
+\tex_global:D \tex_let:D \cs_set_protected_nopar:Npx \cs_set_protected_nopar:Npe
+\cs_gset_protected:Npn \cs_set_protected:Npn
+ { \tex_protected:D \tex_long:D \tex_def:D }
+\cs_gset_protected:Npn \cs_set_protected:Npe
+ { \tex_protected:D \tex_long:D \tex_edef:D }
+\tex_global:D \tex_let:D \cs_set_protected:Npx \cs_set_protected:Npe
% \end{macrocode}
% \end{macro}
%
@@ -1631,14 +1631,14 @@
% used in defining conditionals. We don't use |tl| methods because
% \pkg{l3basics} is loaded earlier.
% \begin{macrocode}
-\cs_set_nopar:Npn \l_@@_internal_tl { }
+\cs_gset_nopar:Npn \l_@@_internal_tl { }
% \end{macrocode}
% \end{variable}
%
% \begin{macro}[EXP]{\use:c}
% This macro grabs its argument and returns a csname from it.
% \begin{macrocode}
-\cs_set:Npn \use:c #1 { \cs:w #1 \cs_end: }
+\cs_gset:Npn \use:c #1 { \cs:w #1 \cs_end: }
% \end{macrocode}
% \end{macro}
%
@@ -1646,7 +1646,7 @@
% Fully expands its argument and passes it to the input stream. Uses
% the reserved \cs{l_@@_internal_tl} which we've set up above.
% \begin{macrocode}
-\cs_set_protected:Npn \use:x #1
+\cs_gset_protected:Npn \use:x #1
{
\cs_set_nopar:Npx \l_@@_internal_tl {#1}
\l_@@_internal_tl
@@ -1660,7 +1660,7 @@
%
% \begin{macro}[EXP]{\use:e}
% \begin{macrocode}
-\cs_set:Npn \use:e #1 { \tex_expanded:D {#1} }
+\cs_gset:Npn \use:e #1 { \tex_expanded:D {#1} }
% \end{macrocode}
% \end{macro}
%
@@ -1672,18 +1672,18 @@
% These macros grab their arguments and return them back to the input
% (with outer braces removed).
% \begin{macrocode}
-\cs_set:Npn \use:n #1 {#1}
-\cs_set:Npn \use:nn #1#2 {#1#2}
-\cs_set:Npn \use:nnn #1#2#3 {#1#2#3}
-\cs_set:Npn \use:nnnn #1#2#3#4 {#1#2#3#4}
+\cs_gset:Npn \use:n #1 {#1}
+\cs_gset:Npn \use:nn #1#2 {#1#2}
+\cs_gset:Npn \use:nnn #1#2#3 {#1#2#3}
+\cs_gset:Npn \use:nnnn #1#2#3#4 {#1#2#3#4}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\use_i:nn, \use_ii:nn}
% The equivalent to \LaTeXe{}'s \tn{@firstoftwo} and \tn{@secondoftwo}.
% \begin{macrocode}
-\cs_set:Npn \use_i:nn #1#2 {#1}
-\cs_set:Npn \use_ii:nn #1#2 {#2}
+\cs_gset:Npn \use_i:nn #1#2 {#1}
+\cs_gset:Npn \use_ii:nn #1#2 {#2}
% \end{macrocode}
% \end{macro}
%
@@ -1705,60 +1705,60 @@
% }
% We also need something for picking up arguments from a longer list.
% \begin{macrocode}
-\cs_set:Npn \use_i:nnn #1#2#3 {#1}
-\cs_set:Npn \use_ii:nnn #1#2#3 {#2}
-\cs_set:Npn \use_iii:nnn #1#2#3 {#3}
-\cs_set:Npn \use_i:nnnn #1#2#3#4 {#1}
-\cs_set:Npn \use_ii:nnnn #1#2#3#4 {#2}
-\cs_set:Npn \use_iii:nnnn #1#2#3#4 {#3}
-\cs_set:Npn \use_iv:nnnn #1#2#3#4 {#4}
-\cs_set:Npn \use_i:nnnnn #1#2#3#4#5 {#1}
-\cs_set:Npn \use_ii:nnnnn #1#2#3#4#5 {#2}
-\cs_set:Npn \use_iii:nnnnn #1#2#3#4#5 {#3}
-\cs_set:Npn \use_iv:nnnnn #1#2#3#4#5 {#4}
-\cs_set:Npn \use_v:nnnnn #1#2#3#4#5 {#5}
-\cs_set:Npn \use_i:nnnnnn #1#2#3#4#5#6 {#1}
-\cs_set:Npn \use_ii:nnnnnn #1#2#3#4#5#6 {#2}
-\cs_set:Npn \use_iii:nnnnnn #1#2#3#4#5#6 {#3}
-\cs_set:Npn \use_iv:nnnnnn #1#2#3#4#5#6 {#4}
-\cs_set:Npn \use_v:nnnnnn #1#2#3#4#5#6 {#5}
-\cs_set:Npn \use_vi:nnnnnn #1#2#3#4#5#6 {#6}
-\cs_set:Npn \use_i:nnnnnnn #1#2#3#4#5#6#7 {#1}
-\cs_set:Npn \use_ii:nnnnnnn #1#2#3#4#5#6#7 {#2}
-\cs_set:Npn \use_iii:nnnnnnn #1#2#3#4#5#6#7 {#3}
-\cs_set:Npn \use_iv:nnnnnnn #1#2#3#4#5#6#7 {#4}
-\cs_set:Npn \use_v:nnnnnnn #1#2#3#4#5#6#7 {#5}
-\cs_set:Npn \use_vi:nnnnnnn #1#2#3#4#5#6#7 {#6}
-\cs_set:Npn \use_vii:nnnnnnn #1#2#3#4#5#6#7 {#7}
-\cs_set:Npn \use_i:nnnnnnnn #1#2#3#4#5#6#7#8 {#1}
-\cs_set:Npn \use_ii:nnnnnnnn #1#2#3#4#5#6#7#8 {#2}
-\cs_set:Npn \use_iii:nnnnnnnn #1#2#3#4#5#6#7#8 {#3}
-\cs_set:Npn \use_iv:nnnnnnnn #1#2#3#4#5#6#7#8 {#4}
-\cs_set:Npn \use_v:nnnnnnnn #1#2#3#4#5#6#7#8 {#5}
-\cs_set:Npn \use_vi:nnnnnnnn #1#2#3#4#5#6#7#8 {#6}
-\cs_set:Npn \use_vii:nnnnnnnn #1#2#3#4#5#6#7#8 {#7}
-\cs_set:Npn \use_viii:nnnnnnnn #1#2#3#4#5#6#7#8 {#8}
-\cs_set:Npn \use_i:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#1}
-\cs_set:Npn \use_ii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#2}
-\cs_set:Npn \use_iii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#3}
-\cs_set:Npn \use_iv:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#4}
-\cs_set:Npn \use_v:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#5}
-\cs_set:Npn \use_vi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#6}
-\cs_set:Npn \use_vii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#7}
-\cs_set:Npn \use_viii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#8}
-\cs_set:Npn \use_ix:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#9}
+\cs_gset:Npn \use_i:nnn #1#2#3 {#1}
+\cs_gset:Npn \use_ii:nnn #1#2#3 {#2}
+\cs_gset:Npn \use_iii:nnn #1#2#3 {#3}
+\cs_gset:Npn \use_i:nnnn #1#2#3#4 {#1}
+\cs_gset:Npn \use_ii:nnnn #1#2#3#4 {#2}
+\cs_gset:Npn \use_iii:nnnn #1#2#3#4 {#3}
+\cs_gset:Npn \use_iv:nnnn #1#2#3#4 {#4}
+\cs_gset:Npn \use_i:nnnnn #1#2#3#4#5 {#1}
+\cs_gset:Npn \use_ii:nnnnn #1#2#3#4#5 {#2}
+\cs_gset:Npn \use_iii:nnnnn #1#2#3#4#5 {#3}
+\cs_gset:Npn \use_iv:nnnnn #1#2#3#4#5 {#4}
+\cs_gset:Npn \use_v:nnnnn #1#2#3#4#5 {#5}
+\cs_gset:Npn \use_i:nnnnnn #1#2#3#4#5#6 {#1}
+\cs_gset:Npn \use_ii:nnnnnn #1#2#3#4#5#6 {#2}
+\cs_gset:Npn \use_iii:nnnnnn #1#2#3#4#5#6 {#3}
+\cs_gset:Npn \use_iv:nnnnnn #1#2#3#4#5#6 {#4}
+\cs_gset:Npn \use_v:nnnnnn #1#2#3#4#5#6 {#5}
+\cs_gset:Npn \use_vi:nnnnnn #1#2#3#4#5#6 {#6}
+\cs_gset:Npn \use_i:nnnnnnn #1#2#3#4#5#6#7 {#1}
+\cs_gset:Npn \use_ii:nnnnnnn #1#2#3#4#5#6#7 {#2}
+\cs_gset:Npn \use_iii:nnnnnnn #1#2#3#4#5#6#7 {#3}
+\cs_gset:Npn \use_iv:nnnnnnn #1#2#3#4#5#6#7 {#4}
+\cs_gset:Npn \use_v:nnnnnnn #1#2#3#4#5#6#7 {#5}
+\cs_gset:Npn \use_vi:nnnnnnn #1#2#3#4#5#6#7 {#6}
+\cs_gset:Npn \use_vii:nnnnnnn #1#2#3#4#5#6#7 {#7}
+\cs_gset:Npn \use_i:nnnnnnnn #1#2#3#4#5#6#7#8 {#1}
+\cs_gset:Npn \use_ii:nnnnnnnn #1#2#3#4#5#6#7#8 {#2}
+\cs_gset:Npn \use_iii:nnnnnnnn #1#2#3#4#5#6#7#8 {#3}
+\cs_gset:Npn \use_iv:nnnnnnnn #1#2#3#4#5#6#7#8 {#4}
+\cs_gset:Npn \use_v:nnnnnnnn #1#2#3#4#5#6#7#8 {#5}
+\cs_gset:Npn \use_vi:nnnnnnnn #1#2#3#4#5#6#7#8 {#6}
+\cs_gset:Npn \use_vii:nnnnnnnn #1#2#3#4#5#6#7#8 {#7}
+\cs_gset:Npn \use_viii:nnnnnnnn #1#2#3#4#5#6#7#8 {#8}
+\cs_gset:Npn \use_i:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#1}
+\cs_gset:Npn \use_ii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#2}
+\cs_gset:Npn \use_iii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#3}
+\cs_gset:Npn \use_iv:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#4}
+\cs_gset:Npn \use_v:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#5}
+\cs_gset:Npn \use_vi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#6}
+\cs_gset:Npn \use_vii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#7}
+\cs_gset:Npn \use_viii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#8}
+\cs_gset:Npn \use_ix:nnnnnnnnn #1#2#3#4#5#6#7#8#9 {#9}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\use_i_ii:nnn}
% \begin{macrocode}
-\cs_set:Npn \use_i_ii:nnn #1#2#3 {#1#2}
+\cs_gset:Npn \use_i_ii:nnn #1#2#3 {#1#2}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\use_ii_i:nn}
% \begin{macrocode}
-\cs_set:Npn \use_ii_i:nn #1#2 { #2 #1 }
+\cs_gset:Npn \use_ii_i:nn #1#2 { #2 #1 }
% \end{macrocode}
% \end{macro}
%
@@ -1772,9 +1772,9 @@
% Functions that gobble everything until they see either \cs{q_nil},
% \cs{q_stop}, or \cs{q_recursion_stop}, respectively.
% \begin{macrocode}
-\cs_set:Npn \use_none_delimit_by_q_nil:w #1 \q_nil { }
-\cs_set:Npn \use_none_delimit_by_q_stop:w #1 \q_stop { }
-\cs_set:Npn \use_none_delimit_by_q_recursion_stop:w #1 \q_recursion_stop { }
+\cs_gset:Npn \use_none_delimit_by_q_nil:w #1 \q_nil { }
+\cs_gset:Npn \use_none_delimit_by_q_stop:w #1 \q_stop { }
+\cs_gset:Npn \use_none_delimit_by_q_recursion_stop:w #1 \q_recursion_stop { }
% \end{macrocode}
% \end{macro}
%
@@ -1788,9 +1788,9 @@
% when you need to skip the rest of a mapping sequence but want an
% easy way to control what should be expanded next.
% \begin{macrocode}
-\cs_set:Npn \use_i_delimit_by_q_nil:nw #1#2 \q_nil {#1}
-\cs_set:Npn \use_i_delimit_by_q_stop:nw #1#2 \q_stop {#1}
-\cs_set:Npn \use_i_delimit_by_q_recursion_stop:nw
+\cs_gset:Npn \use_i_delimit_by_q_nil:nw #1#2 \q_nil {#1}
+\cs_gset:Npn \use_i_delimit_by_q_stop:nw #1#2 \q_stop {#1}
+\cs_gset:Npn \use_i_delimit_by_q_recursion_stop:nw
#1#2 \q_recursion_stop {#1}
% \end{macrocode}
% \end{macro}
@@ -1817,15 +1817,15 @@
% who will assume that expanding such a function once takes care
% of gobbling all the tokens in one go.
% \begin{macrocode}
-\cs_set:Npn \use_none:n #1 { }
-\cs_set:Npn \use_none:nn #1#2 { }
-\cs_set:Npn \use_none:nnn #1#2#3 { }
-\cs_set:Npn \use_none:nnnn #1#2#3#4 { }
-\cs_set:Npn \use_none:nnnnn #1#2#3#4#5 { }
-\cs_set:Npn \use_none:nnnnnn #1#2#3#4#5#6 { }
-\cs_set:Npn \use_none:nnnnnnn #1#2#3#4#5#6#7 { }
-\cs_set:Npn \use_none:nnnnnnnn #1#2#3#4#5#6#7#8 { }
-\cs_set:Npn \use_none:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { }
+\cs_gset:Npn \use_none:n #1 { }
+\cs_gset:Npn \use_none:nn #1#2 { }
+\cs_gset:Npn \use_none:nnn #1#2#3 { }
+\cs_gset:Npn \use_none:nnnn #1#2#3#4 { }
+\cs_gset:Npn \use_none:nnnnn #1#2#3#4#5 { }
+\cs_gset:Npn \use_none:nnnnnn #1#2#3#4#5#6 { }
+\cs_gset:Npn \use_none:nnnnnnn #1#2#3#4#5#6#7 { }
+\cs_gset:Npn \use_none:nnnnnnnn #1#2#3#4#5#6#7#8 { }
+\cs_gset:Npn \use_none:nnnnnnnnn #1#2#3#4#5#6#7#8#9 { }
% \end{macrocode}
% \end{macro}
%
@@ -1840,20 +1840,20 @@
% up with guards. We can also more easily change the logic in one
% place then. This is needed primarily for deprecations.
% \begin{macrocode}
-\cs_set_protected:Npn \__kernel_if_debug:TF #1#2 {#2}
+\cs_gset_protected:Npn \__kernel_if_debug:TF #1#2 {#2}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\debug_on:n, \debug_off:n}
% Stubs.
% \begin{macrocode}
-\cs_set_protected:Npn \debug_on:n #1
+\cs_gset_protected:Npn \debug_on:n #1
{
\sys_load_debug:
\cs_if_exist:NT \@@_all_on:
{ \debug_on:n {#1} }
}
-\cs_set_protected:Npn \debug_off:n #1
+\cs_gset_protected:Npn \debug_off:n #1
{
\sys_load_debug:
\cs_if_exist:NT \@@_all_on:
@@ -1864,8 +1864,8 @@
%
% \begin{macro}{\debug_suspend:, \debug_resume:}
% \begin{macrocode}
-\cs_set_protected:Npn \debug_suspend: { }
-\cs_set_protected:Npn \debug_resume: { }
+\cs_gset_protected:Npn \debug_suspend: { }
+\cs_gset_protected:Npn \debug_resume: { }
% \end{macrocode}
% \end{macro}
%
@@ -1875,9 +1875,9 @@
% only make these into errors if the user requests it. This relies on
% two token lists, filled up in \pkg{l3deprecation}.
% \begin{macrocode}
-\cs_set_nopar:Npn \g_@@_deprecation_on_tl { }
-\cs_set_nopar:Npn \g_@@_deprecation_off_tl { }
-\cs_set_protected:Npn \__kernel_deprecation_code:nn #1#2
+\cs_gset_nopar:Npn \g_@@_deprecation_on_tl { }
+\cs_gset_nopar:Npn \g_@@_deprecation_off_tl { }
+\cs_gset_protected:Npn \__kernel_deprecation_code:nn #1#2
{
\tl_gput_right:Nn \g_@@_deprecation_on_tl {#1}
\tl_gput_right:Nn \g_@@_deprecation_off_tl {#2}
@@ -1923,9 +1923,9 @@
% at least two tokens: see how the logical tests are actually implemented
% to see this.
% \begin{macrocode}
-\cs_set:Npn \prg_return_true:
+\cs_gset:Npn \prg_return_true:
{ \exp_after:wN \use_i:nn \exp:w }
-\cs_set:Npn \prg_return_false:
+\cs_gset:Npn \prg_return_false:
{ \exp_after:wN \use_ii:nn \exp:w}
% \end{macrocode}
% An extended state space could be implemented by including a more
@@ -1936,7 +1936,7 @@
% \begin{macro}[EXP]{\@@_use_none_delimit_by_q_recursion_stop:w}
% Private version of \cs{use_none_delimit_by_q_recursion_stop:w}.
% \begin{macrocode}
-\cs_set:Npn \@@_use_none_delimit_by_q_recursion_stop:w
+\cs_gset:Npn \@@_use_none_delimit_by_q_recursion_stop:w
#1 \q_@@_recursion_stop { }
% \end{macrocode}
% \end{macro}
@@ -1962,19 +1962,19 @@
% conditionals.
% Note that |e| stands for expandable and |p| for protected.
% \begin{macrocode}
-\cs_set_protected:Npn \prg_set_conditional:Npnn
+\cs_gset_protected:Npn \prg_set_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_set:Npn e }
-\cs_set_protected:Npn \prg_gset_conditional:Npnn
+\cs_gset_protected:Npn \prg_gset_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_gset:Npn e }
-\cs_set_protected:Npn \prg_new_conditional:Npnn
+\cs_gset_protected:Npn \prg_new_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_new:Npn e }
-\cs_set_protected:Npn \prg_set_protected_conditional:Npnn
+\cs_gset_protected:Npn \prg_set_protected_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_set_protected:Npn p }
-\cs_set_protected:Npn \prg_gset_protected_conditional:Npnn
+\cs_gset_protected:Npn \prg_gset_protected_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_gset_protected:Npn p }
-\cs_set_protected:Npn \prg_new_protected_conditional:Npnn
+\cs_gset_protected:Npn \prg_new_protected_conditional:Npnn
{ \@@_generate_conditional_parm:NNNpnn \cs_new_protected:Npn p }
-\cs_set_protected:Npn \@@_generate_conditional_parm:NNNpnn #1#2#3#4#
+\cs_gset_protected:Npn \@@_generate_conditional_parm:NNNpnn #1#2#3#4#
{
\use:e
{
@@ -2014,19 +2014,19 @@
% erroneous case where the function name contains no colon is captured
% later.
% \begin{macrocode}
-\cs_set_protected:Npn \prg_set_conditional:Nnn
+\cs_gset_protected:Npn \prg_set_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_set:Npn e }
-\cs_set_protected:Npn \prg_gset_conditional:Nnn
+\cs_gset_protected:Npn \prg_gset_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_set:Npn e }
-\cs_set_protected:Npn \prg_new_conditional:Nnn
+\cs_gset_protected:Npn \prg_new_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_new:Npn e }
-\cs_set_protected:Npn \prg_set_protected_conditional:Nnn
+\cs_gset_protected:Npn \prg_set_protected_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_set_protected:Npn p }
-\cs_set_protected:Npn \prg_gset_protected_conditional:Nnn
+\cs_gset_protected:Npn \prg_gset_protected_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_gset_protected:Npn p }
-\cs_set_protected:Npn \prg_new_protected_conditional:Nnn
+\cs_gset_protected:Npn \prg_new_protected_conditional:Nnn
{ \@@_generate_conditional_count:NNNnn \cs_new_protected:Npn p }
-\cs_set_protected:Npn \@@_generate_conditional_count:NNNnn #1#2#3
+\cs_gset_protected:Npn \@@_generate_conditional_count:NNNnn #1#2#3
{
\use:e
{
@@ -2035,7 +2035,7 @@
}
#1 #2
}
-\cs_set_protected:Npn \@@_generate_conditional_count:nnNNNnn #1#2#3#4#5
+\cs_gset_protected:Npn \@@_generate_conditional_count:nnNNNnn #1#2#3#4#5
{
\__kernel_cs_parm_from_arg_count:nnF
{ \@@_generate_conditional:nnNNNnnn {#1} {#2} #3 #4 #5 }
@@ -2076,7 +2076,7 @@
% \cs{use_i:nn} instead of \cs{use_i_ii:nnn} to functions such as
% \cs{@@_generate_p_form:wNNnnnnN}.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_generate_conditional:nnNNNnnn #1#2#3#4#5#6#7#8
+\cs_gset_protected:Npn \@@_generate_conditional:nnNNNnnn #1#2#3#4#5#6#7#8
{
\if_meaning:w \c_false_bool #3
\msg_error:nne { kernel } { missing-colon }
@@ -2097,10 +2097,10 @@
\exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop }
}
}
-\cs_set:Npn \@@_generate_conditional_test:w
+\cs_gset:Npn \@@_generate_conditional_test:w
#1 \prg_return_true: \else: \prg_return_false: \fi: \s_@@_mark #2
{ #2 {#1} }
-\cs_set:Npn \@@_generate_conditional_fast:nw #1#2 \exp_not:n #3
+\cs_gset:Npn \@@_generate_conditional_fast:nw #1#2 \exp_not:n #3
{ \exp_not:n { {#1} \use_i:nn } }
% \end{macrocode}
% Looping through the list of desired forms. First are six arguments
@@ -2111,7 +2111,7 @@
% then \cs{use_none:nnnnnnnn} cleans up. Otherwise, the
% error message is removed by the variant form.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_generate_conditional:NNnnnnNw #1#2#3#4#5#6#7#8 ,
+\cs_gset_protected:Npn \@@_generate_conditional:NNnnnnNw #1#2#3#4#5#6#7#8 ,
{
\if_meaning:w \q_@@_recursion_tail #8
\exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
@@ -2158,7 +2158,7 @@
% but if those are actually missing, the recovery from the runaway argument
% would not insert \cs{fi:} back, messing up nesting of conditionals.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_generate_p_form:wNNnnnnN
+\cs_gset_protected:Npn \@@_generate_p_form:wNNnnnnN
#1 \s_@@_stop #2#3#4#5#6#7#8
{
\if_meaning:w e #3
@@ -2177,7 +2177,7 @@
{ \token_to_str:c { #4 _p: #5 } }
}
}
-\cs_set_protected:Npn \@@_generate_T_form:wNNnnnnN
+\cs_gset_protected:Npn \@@_generate_T_form:wNNnnnnN
#1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
@@ -2185,7 +2185,7 @@
{ { #7 \exp_end: \use:n \use_none:n } }
{ #7 \@@_T_true:w \fi: \use_none:n }
}
-\cs_set_protected:Npn \@@_generate_F_form:wNNnnnnN
+\cs_gset_protected:Npn \@@_generate_F_form:wNNnnnnN
#1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
@@ -2193,7 +2193,7 @@
{ { #7 \exp_end: { } } }
{ #7 \@@_F_true:w \fi: \use:n }
}
-\cs_set_protected:Npn \@@_generate_TF_form:wNNnnnnN
+\cs_gset_protected:Npn \@@_generate_TF_form:wNNnnnnN
#1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
@@ -2201,10 +2201,10 @@
{ { #7 \exp_end: } }
{ #7 \@@_TF_true:w \fi: \use_ii:nn }
}
-\cs_set:Npn \@@_p_true:w \fi: \c_false_bool { \fi: \c_true_bool }
-\cs_set:Npn \@@_T_true:w \fi: \use_none:n { \fi: \use:n }
-\cs_set:Npn \@@_F_true:w \fi: \use:n { \fi: \use_none:n }
-\cs_set:Npn \@@_TF_true:w \fi: \use_ii:nn { \fi: \use_i:nn }
+\cs_gset:Npn \@@_p_true:w \fi: \c_false_bool { \fi: \c_true_bool }
+\cs_gset:Npn \@@_T_true:w \fi: \use_none:n { \fi: \use:n }
+\cs_gset:Npn \@@_F_true:w \fi: \use:n { \fi: \use_none:n }
+\cs_gset:Npn \@@_TF_true:w \fi: \use_ii:nn { \fi: \use_i:nn }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2223,13 +2223,13 @@
% |,| \cs{q_@@_recursion_stop}
% to a first auxiliary.
% \begin{macrocode}
-\cs_set_protected:Npn \prg_set_eq_conditional:NNn
+\cs_gset_protected:Npn \prg_set_eq_conditional:NNn
{ \@@_set_eq_conditional:NNNn \cs_set_eq:cc }
-\cs_set_protected:Npn \prg_gset_eq_conditional:NNn
+\cs_gset_protected:Npn \prg_gset_eq_conditional:NNn
{ \@@_set_eq_conditional:NNNn \cs_gset_eq:cc }
-\cs_set_protected:Npn \prg_new_eq_conditional:NNn
+\cs_gset_protected:Npn \prg_new_eq_conditional:NNn
{ \@@_set_eq_conditional:NNNn \cs_new_eq:cc }
-\cs_set_protected:Npn \@@_set_eq_conditional:NNNn #1#2#3#4
+\cs_gset_protected:Npn \@@_set_eq_conditional:NNNn #1#2#3#4
{
\use:e
{
@@ -2268,7 +2268,7 @@
% step in the loop, make sure that the conditional form we copy is
% defined, and copy it, otherwise abort.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6
+\cs_gset_protected:Npn \@@_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6
{
\if_meaning:w \c_false_bool #3
\msg_error:nne { kernel } { missing-colon }
@@ -2282,7 +2282,7 @@
\fi:
\@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#4} {#5}
}
-\cs_set_protected:Npn \@@_set_eq_conditional_loop:nnnnNw #1#2#3#4#5#6 ,
+\cs_gset_protected:Npn \@@_set_eq_conditional_loop:nnnnNw #1#2#3#4#5#6 ,
{
\if_meaning:w \q_@@_recursion_tail #6
\exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
@@ -2299,13 +2299,13 @@
#5 {#1} {#2} {#3} {#4}
\@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5
}
-\cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
+\cs_gset:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 _p : #4 } { #5 _p : #6 } }
-\cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
+\cs_gset:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 TF } { #5 : #6 TF } }
-\cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
+\cs_gset:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 T } { #5 : #6 T } }
-\cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
+\cs_gset:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 F } { #5 : #6 F } }
% \end{macrocode}
% \end{macro}
@@ -2323,8 +2323,8 @@
% \begin{variable}{\c_true_bool, \c_false_bool}
% Here are the canonical boolean values.
% \begin{macrocode}
-\tex_chardef:D \c_true_bool = 1 ~
-\tex_chardef:D \c_false_bool = 0 ~
+\tex_global:D \tex_chardef:D \c_true_bool = 1 ~
+\tex_global:D \tex_chardef:D \c_false_bool = 0 ~
% \end{macrocode}
% \end{variable}
%
@@ -2392,7 +2392,7 @@
% In all three cases, \cs{cs_to_str:N} takes two expansion steps
% to be fully expanded.
% \begin{macrocode}
-\cs_set:Npn \cs_to_str:N
+\cs_gset:Npn \cs_to_str:N
{
% \end{macrocode}
% We implement the expansion scheme using \cs{tex_romannumeral:D}
@@ -2405,8 +2405,8 @@
\if:w \token_to_str:N \ \@@_to_str:w \fi:
\exp_after:wN \@@_to_str:N \token_to_str:N
}
-\cs_set:Npn \@@_to_str:N #1 { \c_zero_int }
-\cs_set:Npn \@@_to_str:w #1 \@@_to_str:N
+\cs_gset:Npn \@@_to_str:N #1 { \c_zero_int }
+\cs_gset:Npn \@@_to_str:w #1 \@@_to_str:N
{ - \int_value:w \fi: \exp_after:wN \c_zero_int }
% \end{macrocode}
% If speed is a concern we could use \tn{csstring} in \LuaTeX{}. For
@@ -2436,19 +2436,19 @@
% auxiliary trims the trailing \cs{s_@@_mark} from the function name if
% present (that is, if the original function had no colon).
% \begin{macrocode}
-\cs_set_protected:Npn \@@_tmp:w #1
+\cs_gset_protected:Npn \@@_tmp:w #1
{
- \cs_set:Npn \cs_split_function:N ##1
+ \cs_gset:Npn \cs_split_function:N ##1
{
\exp_after:wN \exp_after:wN \exp_after:wN
\@@_split_function_auxi:w
\cs_to_str:N ##1 \s_@@_mark \c_true_bool
#1 \s_@@_mark \c_false_bool \s_@@_stop
}
- \cs_set:Npn \@@_split_function_auxi:w
+ \cs_gset:Npn \@@_split_function_auxi:w
##1 #1 ##2 \s_@@_mark ##3##4 \s_@@_stop
{ \@@_split_function_auxii:w ##1 \s_@@_mark \s_@@_stop {##2} ##3 }
- \cs_set:Npn \@@_split_function_auxii:w ##1 \s_@@_mark ##2 \s_@@_stop
+ \cs_gset:Npn \@@_split_function_auxii:w ##1 \s_@@_mark ##2 \s_@@_stop
{ {##1} }
}
\exp_after:wN \@@_tmp:w \token_to_str:N :
@@ -2476,7 +2476,7 @@
% \cs{else:} in the top level functions will be removed by the optimization,
% and this usage of \cs{else:} will be fine).
% \begin{macrocode}
-\prg_set_conditional:Npnn \cs_if_exist:N #1 { p , T , F , TF }
+\prg_gset_conditional:Npnn \cs_if_exist:N #1 { p , T , F , TF }
{
\if_meaning:w #1 \scan_stop:
\use_i:nnnn
@@ -2498,7 +2498,7 @@
% \begin{macrocode}
\cs_if_exist:NTF \tex_lastnamedcs:D
{
- \prg_set_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
+ \prg_gset_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
{
\if_cs_exist:w #1 \cs_end:
\@@_if_exist_c_aux:
@@ -2507,11 +2507,11 @@
\prg_return_false:
\fi:
}
- \cs_set:Npn \@@_if_exist_c_aux:
+ \cs_gset:Npn \@@_if_exist_c_aux:
{ \fi: \exp_after:wN \if_meaning:w \tex_lastnamedcs:D \scan_stop: \else: }
}
{
- \prg_set_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
+ \prg_gset_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
{
\if_cs_exist:w #1 \cs_end:
\@@_if_exist_c_aux:w
@@ -2523,7 +2523,7 @@
\prg_return_false:
\fi:
}
- \cs_set:Npn \@@_if_exist_c_aux:w \fi: \use_none:n #1 \if_false:
+ \cs_gset:Npn \@@_if_exist_c_aux:w \fi: \use_none:n #1 \if_false:
{ \fi: \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop: \else: }
}
% \end{macrocode}
@@ -2533,7 +2533,7 @@
% \begin{macro}[pTF, EXP]{\cs_if_free:N, \cs_if_free:c}
% The logical reversal of the above.
% \begin{macrocode}
-\prg_set_conditional:Npnn \cs_if_free:N #1 { p , T , F , TF }
+\prg_gset_conditional:Npnn \cs_if_free:N #1 { p , T , F , TF }
{
\if_cs_exist:N #1
\else:
@@ -2547,7 +2547,7 @@
}
\cs_if_exist:NTF \tex_lastnamedcs:D
{
- \prg_set_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
+ \prg_gset_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
{
\if_cs_exist:w #1 \cs_end:
\@@_if_free_c_aux:w
@@ -2558,11 +2558,11 @@
\prg_return_false:
\fi:
}
- \cs_set:Npn \@@_if_free_c_aux:w \fi: \if_true:
+ \cs_gset:Npn \@@_if_free_c_aux:w \fi: \if_true:
{ \fi: \exp_after:wN \if_meaning:w \tex_lastnamedcs:D \scan_stop: }
}
{
- \prg_set_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
+ \prg_gset_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
{
\if_cs_exist:w #1 \cs_end:
\@@_if_free_c_aux:w
@@ -2574,7 +2574,7 @@
\prg_return_false:
\fi:
}
- \cs_set:Npn \@@_if_free_c_aux:w \fi: \use_none:n #1 \if_true:
+ \cs_gset:Npn \@@_if_free_c_aux:w \fi: \use_none:n #1 \if_true:
{ \fi: \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop: }
}
% \end{macrocode}
@@ -2591,49 +2591,49 @@
% sequence in the hash table if it does not exist.
% If available we use the \tn{lastnamedcs} primitive.
% \begin{macrocode}
-\cs_set:Npn \cs_if_exist_use:NTF #1#2
+\cs_gset:Npn \cs_if_exist_use:NTF #1#2
{ \cs_if_exist:NTF #1 { #1 #2 } }
-\cs_set:Npn \cs_if_exist_use:NF #1
+\cs_gset:Npn \cs_if_exist_use:NF #1
{ \cs_if_exist:NTF #1 #1 }
-\cs_set:Npn \cs_if_exist_use:NT #1 #2
+\cs_gset:Npn \cs_if_exist_use:NT #1 #2
{ \cs_if_exist:NT #1 { #1 #2 } }
-\cs_set:Npn \cs_if_exist_use:N #1
+\cs_gset:Npn \cs_if_exist_use:N #1
{ \cs_if_exist:NT #1 #1 }
\cs_if_exist:NTF \tex_lastnamedcs:D
{
- \cs_set:Npn \cs_if_exist_use:cTF #1
+ \cs_gset:Npn \cs_if_exist_use:cTF #1
{
\if_cs_exist:w #1 \cs_end:
\@@_if_exist_use_aux:w
\fi:
\use_ii:nn
}
- \cs_set:Npn \@@_if_exist_use_aux:w \fi: \use_ii:nn
+ \cs_gset:Npn \@@_if_exist_use_aux:w \fi: \use_ii:nn
{ \fi: \exp_after:wN \@@_if_exist_use_aux:Nnn \tex_lastnamedcs:D }
}
{
- \cs_set:Npn \cs_if_exist_use:cTF #1
+ \cs_gset:Npn \cs_if_exist_use:cTF #1
{
\if_cs_exist:w #1 \cs_end:
\@@_if_exist_use_aux:w
\fi:
\use_iii:nnn {#1}
}
- \cs_set:Npn \@@_if_exist_use_aux:w \fi: \use_iii:nnn #1
+ \cs_gset:Npn \@@_if_exist_use_aux:w \fi: \use_iii:nnn #1
{ \fi: \exp_after:wN \@@_if_exist_use_aux:Nnn \cs:w #1 \cs_end: }
}
-\cs_set:Npn \@@_if_exist_use_aux:Nnn #1#2
+\cs_gset:Npn \@@_if_exist_use_aux:Nnn #1#2
{
\if_meaning:w #1 \scan_stop:
\exp_after:wN \use_iii:nnn
\fi:
\use_i:nn { #1 #2 }
}
-\cs_set:Npn \cs_if_exist_use:cF #1
+\cs_gset:Npn \cs_if_exist_use:cF #1
{ \cs_if_exist_use:cTF {#1} {} }
-\cs_set:Npn \cs_if_exist_use:cT #1#2
+\cs_gset:Npn \cs_if_exist_use:cT #1#2
{ \cs_if_exist_use:cTF {#1} {#2} {} }
-\cs_set:Npn \cs_if_exist_use:c #1
+\cs_gset:Npn \cs_if_exist_use:c #1
{ \cs_if_exist_use:cTF {#1} {} {} }
% \end{macrocode}
% \end{macro}
@@ -2659,7 +2659,7 @@
% a reasonable response. Setting the \tn{newlinechar} is needed, to
% turn |^^J| into a proper line break in plain \TeX{}.
% \begin{macrocode}
-\cs_set_protected:Npn \msg_error:nnee #1#2#3#4
+\cs_gset_protected:Npn \msg_error:nnee #1#2#3#4
{
\tex_newlinechar:D = `\^^J \scan_stop:
\tex_errmessage:D
@@ -2672,9 +2672,9 @@
}
\tex_end:D
}
-\cs_set_protected:Npn \msg_error:nne #1#2#3
+\cs_gset_protected:Npn \msg_error:nne #1#2#3
{ \msg_error:nnee {#1} {#2} {#3} { } }
-\cs_set_protected:Npn \msg_error:nn #1#2
+\cs_gset_protected:Npn \msg_error:nn #1#2
{ \msg_error:nnee {#1} {#2} { } { } }
% \end{macrocode}
% \end{macro}
@@ -2682,7 +2682,7 @@
% \begin{macro}[rEXP]{\msg_line_context:}
% Another one from \pkg{l3msg} which will be altered later.
% \begin{macrocode}
-\cs_set:Npn \msg_line_context:
+\cs_gset:Npn \msg_line_context:
{ on~line~ \tex_the:D \tex_inputlineno:D }
% \end{macrocode}
% \end{macro}
@@ -2692,9 +2692,9 @@
% similar one for writing to both the log file and the terminal.
% These will be redefined later by \pkg{l3file}.
% \begin{macrocode}
-\cs_set_protected:Npn \iow_log:e
+\cs_gset_protected:Npn \iow_log:e
{ \tex_immediate:D \tex_write:D -1 }
-\cs_set_protected:Npn \iow_term:e
+\cs_gset_protected:Npn \iow_term:e
{ \tex_immediate:D \tex_write:D 16 }
% \end{macrocode}
% \end{macro}
@@ -2708,7 +2708,7 @@
% issued. We have to make sure we don't put the argument into the
% conditional processing since it may be an |\if...| type function!
% \begin{macrocode}
-\cs_set_protected:Npn \__kernel_chk_if_free_cs:N #1
+\cs_gset_protected:Npn \__kernel_chk_if_free_cs:N #1
{
\cs_if_free:NF #1
{
@@ -2716,7 +2716,7 @@
{ \token_to_str:N #1 } { \token_to_meaning:N #1 }
}
}
-\cs_set_protected:Npn \__kernel_chk_if_free_cs:c
+\cs_gset_protected:Npn \__kernel_chk_if_free_cs:c
{ \exp_args:Nc \__kernel_chk_if_free_cs:N }
% \end{macrocode}
% \end{macro}
@@ -2740,7 +2740,7 @@
% \begin{macrocode}
\cs_set:Npn \@@_tmp:w #1#2
{
- \cs_set_protected:Npn #1 ##1
+ \cs_gset_protected:Npn #1 ##1
{
\__kernel_chk_if_free_cs:N ##1
#2 ##1
@@ -2838,7 +2838,7 @@
% \begin{macro}[documented-as=\cs_set_protected:Npn]
% {
% \cs_set_protected:cpn , \cs_set_protected:cpe , \cs_set_protected:cpx ,
-% \cs_gset_protected:cpn , \cs_gset_protected:cpe , \cs_gset_protected:cpx ,
+% \cs_gset_protected:cpn , \cs_gset_protected:cpe , \cs_gset_protected:cpx ,
% \cs_new_protected:cpn , \cs_new_protected:cpe , \cs_new_protected:cpx
% }
% Variants of the \cs{cs_set_protected:Npn} versions which make a csname
@@ -2940,7 +2940,7 @@
% the functions use here are not defined yet, but will be defined
% before this function is called.
% \begin{macrocode}
-\cs_set_protected:Npn \__kernel_cs_parm_from_arg_count:nnF #1#2
+\cs_new_protected:Npn \__kernel_cs_parm_from_arg_count:nnF #1#2
{
\exp_args:Ne \@@_parm_from_arg_count_test:nnF
{
@@ -2961,7 +2961,7 @@
}
{#1}
}
-\cs_set_protected:Npn \@@_parm_from_arg_count_test:nnF #1#2
+\cs_new_protected:Npn \@@_parm_from_arg_count_test:nnF #1#2
{
\if_meaning:w \c_false_bool #1
\exp_after:wN \use_ii:nn
diff --git a/macros/latex/contrib/l3kernel/l3bitset.dtx b/macros/latex/contrib/l3kernel/l3bitset.dtx
index ece9fbfa6c..3100c28463 100644
--- a/macros/latex/contrib/l3kernel/l3bitset.dtx
+++ b/macros/latex/contrib/l3kernel/l3bitset.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
index 9583f2548d..5ff0c2e68d 100644
--- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx
+++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -302,7 +302,7 @@ Type H <return> for immediate help}\def~{\errmessage{%
% \begin{variable}{\l_@@_expl_bool}
% The status for code syntax: this is on at present.
% \begin{macrocode}
-\chardef\l_@@_expl_bool = 1\relax
+\global\chardef\l_@@_expl_bool = 1\relax
% \end{macrocode}
%\end{variable}
%
diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx
index df79b10cc7..08463db56d 100644
--- a/macros/latex/contrib/l3kernel/l3box.dtx
+++ b/macros/latex/contrib/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -849,7 +849,8 @@
% \begin{syntax}
% \cs{box_rotate:Nn} \meta{box} \Arg{angle}
% \end{syntax}
-% Rotates the \meta{box} by \meta{angle} (in degrees) anti-clockwise about
+% Rotates the \meta{box} by \meta{angle} (a \meta{fp expr} in degrees)
+% anti-clockwise about
% its reference point. The reference point of the updated box is moved
% horizontally such that it is at the left side of the smallest rectangle
% enclosing the rotated material. The updated \meta{box} is an |hbox|,
@@ -866,7 +867,7 @@
% \end{syntax}
% Scales the \meta{box} by factors \meta{x-scale} and \meta{y-scale} in
% the horizontal and vertical directions, respectively (both scales are
-% integer expressions). The updated \meta{box} is an |hbox|, irrespective
+% \meta{fp expr}). The updated \meta{box} is an |hbox|, irrespective
% of the nature of the \meta{box} before the scaling is applied. Negative
% scalings cause the material in the \meta{box} to be reversed in
% direction, but the reference point of the \meta{box} is unchanged.
@@ -2296,8 +2297,9 @@
{
#5 #1
{
- \fp_set:Nn \l_@@_scale_x_fp { ( #2 ) / \box_wd:N #1 }
- \fp_set:Nn \l_@@_scale_y_fp { ( #3 ) / ( #4 ) }
+ \fp_set:Nn \l_@@_scale_x_fp { ( \dim_to_fp:n {#2} ) / \box_wd:N #1 }
+ \fp_set:Nn \l_@@_scale_y_fp
+ { ( \dim_to_fp:n {#3} ) / ( \dim_to_fp:n {#4} ) }
\fp_compare:nNnTF \l_@@_scale_x_fp > \l_@@_scale_y_fp
{ \fp_set_eq:NN \l_@@_scale_x_fp \l_@@_scale_y_fp }
{ \fp_set_eq:NN \l_@@_scale_y_fp \l_@@_scale_x_fp }
diff --git a/macros/latex/contrib/l3kernel/l3cctab.dtx b/macros/latex/contrib/l3kernel/l3cctab.dtx
index 311b9cc88b..5cdaa3dc92 100644
--- a/macros/latex/contrib/l3kernel/l3cctab.dtx
+++ b/macros/latex/contrib/l3kernel/l3cctab.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx
index 9f2eda4560..ad65a4b174 100644
--- a/macros/latex/contrib/l3kernel/l3clist.dtx
+++ b/macros/latex/contrib/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx
index 8ba7b27aa9..ad41224aa0 100644
--- a/macros/latex/contrib/l3kernel/l3coffins.dtx
+++ b/macros/latex/contrib/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -1302,7 +1302,7 @@
% y = s ( x - a ) + b
% \]
% \begin{macrocode}
-\cs_set_protected:Npn \@@_calculate_intersection:nnnnnn #1#2#3#4#5#6
+\cs_new_protected:Npn \@@_calculate_intersection:nnnnnn #1#2#3#4#5#6
{
\fp_compare:nNnTF {#1} = {#2}
{ \bool_set_true:N \l_@@_error_bool }
diff --git a/macros/latex/contrib/l3kernel/l3color.dtx b/macros/latex/contrib/l3kernel/l3color.dtx
index f3537307b2..514ff326a4 100644
--- a/macros/latex/contrib/l3kernel/l3color.dtx
+++ b/macros/latex/contrib/l3kernel/l3color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx
index 82c95f7ff8..6654b6d4cd 100644
--- a/macros/latex/contrib/l3kernel/l3debug.dtx
+++ b/macros/latex/contrib/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -69,7 +69,7 @@
%
% Standard file identification.
% \begin{macrocode}
-\ProvidesExplFile{l3debug.def}{2024-02-20}{}{L3 Debugging support}
+\ProvidesExplFile{l3debug.def}{2024-03-14}{}{L3 Debugging support}
% \end{macrocode}
%
% \begin{variable}{\s_@@_stop}
diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx
index 25dd05fb0c..3906c6786e 100644
--- a/macros/latex/contrib/l3kernel/l3deprecation.dtx
+++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -220,7 +220,7 @@
% up: one for Fall 2022.
% \begin{macrocode}
%\__kernel_patch_deprecation:nnNNpn { 2022-06-24 } { \cs_parameter_spec:N }
-\cs_gset:Npn \cs_argument_spec:N { \cs_parameter_spec:N }
+\cs_new:Npn \cs_argument_spec:N { \cs_parameter_spec:N }
% \end{macrocode}
% \end{macro}
%
@@ -300,13 +300,13 @@
% too long.
% \begin{macrocode}
%\__kernel_patch_deprecation:nnNNpn { 2024-01-10 } { \keys_set_exclude_groups:nnn }
-\cs_set_protected:Npn \keys_set_filter:nnn { \keys_set_exclude_groups:nnn }
+\cs_new_protected:Npn \keys_set_filter:nnn { \keys_set_exclude_groups:nnn }
\cs_generate_variant:Nn \keys_set_filter:nnn { nnV , nnv , nno }
%\__kernel_patch_deprecation:nnNNpn { 2024-01-10 } { \keys_set_exclude_groups:nnnN }
-\cs_set_protected:Npn \keys_set_filter:nnnN { \keys_set_exclude_groups:nnnN }
+\cs_new_protected:Npn \keys_set_filter:nnnN { \keys_set_exclude_groups:nnnN }
\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
%\__kernel_patch_deprecation:nnNNpn { 2024-01-10 } { \keys_set_exclude_groups:nnnnN }
-\cs_set_protected:Npn \keys_set_filter:nnnnN { \keys_set_exclude_groups:nnnnN }
+\cs_new_protected:Npn \keys_set_filter:nnnnN { \keys_set_exclude_groups:nnnnN }
\cs_generate_variant:Nn \keys_set_filter:nnnnN { nnV , nnv , nno }
% \end{macrocode}
% \end{macro}
@@ -370,13 +370,13 @@
% \begin{macro}[EXP, noTF, deprecated]{\bool_case_true:n}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case:n }
-\cs_gset:Npn \bool_case_true:n { \bool_case:n }
+\cs_new:Npn \bool_case_true:n { \bool_case:n }
\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case:nT }
-\cs_gset:Npn \bool_case_true:nT { \bool_case:nT }
+\cs_new:Npn \bool_case_true:nT { \bool_case:nT }
\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case:nF }
-\cs_gset:Npn \bool_case_true:nF { \bool_case:nF }
+\cs_new:Npn \bool_case_true:nF { \bool_case:nF }
\__kernel_patch_deprecation:nnNNpn { 2023-05-03 } { \bool_case:nTF }
-\cs_gset:Npn \bool_case_true:nTF { \bool_case:nTF }
+\cs_new:Npn \bool_case_true:nTF { \bool_case:nTF }
% \end{macrocode}
% \end{macro}
%
@@ -394,17 +394,17 @@
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:n }
-\cs_gset:Npn \str_lower_case:n { \str_lowercase:n }
+\cs_new:Npn \str_lower_case:n { \str_lowercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:f }
-\cs_gset:Npn \str_lower_case:f { \str_lowercase:f }
+\cs_new:Npn \str_lower_case:f { \str_lowercase:f }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:n }
-\cs_gset:Npn \str_upper_case:n { \str_uppercase:n }
+\cs_new:Npn \str_upper_case:n { \str_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:f }
-\cs_gset:Npn \str_upper_case:f { \str_uppercase:f }
+\cs_new:Npn \str_upper_case:f { \str_uppercase:f }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:n }
-\cs_gset:Npn \str_fold_case:n { \str_casefold:n }
+\cs_new:Npn \str_fold_case:n { \str_casefold:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:V }
-\cs_gset:Npn \str_fold_case:V { \str_casefold:V }
+\cs_new:Npn \str_fold_case:V { \str_casefold:V }
% \end{macrocode}
% \end{macro}
%
@@ -412,9 +412,9 @@
% {\str_foldcase:n, \str_foldcase:V}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-10-17 } { \str_casefold:n }
-\cs_gset:Npn \str_foldcase:n { \str_casefold:n }
+\cs_new:Npn \str_foldcase:n { \str_casefold:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:V }
-\cs_gset:Npn \str_foldcase:V { \str_casefold:V }
+\cs_new:Npn \str_foldcase:V { \str_casefold:V }
% \end{macrocode}
% \end{macro}
%
@@ -425,7 +425,7 @@
% take a value that is big enough to accommodate all of Unicode.
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-08-20 } { }
-\cs_gset_protected:Npn \str_declare_eight_bit_encoding:nnn #1
+\cs_new_protected:Npn \str_declare_eight_bit_encoding:nnn #1
{ \@@_declare_eight_bit_encoding:nnnn {#1} { 1114112 } }
% \end{macrocode}
% \end{macro}
@@ -440,9 +440,9 @@
% \begin{macro}[EXP, deprecated]{ \seq_indexed_map_function:NN}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-06-18 } { \seq_map_indexed_inline:Nn }
-\cs_gset_protected:Npn \seq_indexed_map_inline:Nn { \seq_map_indexed_inline:Nn }
+\cs_new_protected:Npn \seq_indexed_map_inline:Nn { \seq_map_indexed_inline:Nn }
\__kernel_patch_deprecation:nnNNpn { 2020-06-18 } { \seq_map_indexed_function:NN }
-\cs_gset:Npn \seq_indexed_map_function:NN { \seq_map_indexed_function:NN }
+\cs_new:Npn \seq_indexed_map_function:NN { \seq_map_indexed_function:NN }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -450,16 +450,16 @@
% \begin{macro}[deprecated]{\seq_mapthread_function:NNN}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2023-05-10 } { \seq_map_pairwise_function:NNN }
-\cs_gset:Npn \seq_mapthread_function:NNN { \seq_map_pairwise_function:NNN }
+\cs_new:Npn \seq_mapthread_function:NNN { \seq_map_pairwise_function:NNN }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[deprecated]{\seq_set_map_x:NNn, \seq_gset_map_x:NNn}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2023-10-26 } { \seq_set_map_e:NNn }
-\cs_gset_protected:Npn \seq_set_map_x:NNn { \seq_set_map_e:NNn }
+\cs_new_protected:Npn \seq_set_map_x:NNn { \seq_set_map_e:NNn }
\__kernel_patch_deprecation:nnNNpn { 2023-10-26 } { \seq_gset_map_e:NNn }
-\cs_gset_protected:Npn \seq_gset_map_x:NNn { \seq_gset_map_e:NNn }
+\cs_new_protected:Npn \seq_gset_map_x:NNn { \seq_gset_map_e:NNn }
% \end{macrocode}
% \end{macro}
%
@@ -472,7 +472,7 @@
% \begin{macro}[deprecated]{\sys_load_deprecation:}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2021-01-11 } { (no~longer~required) }
-\cs_gset_protected:Npn \sys_load_deprecation: { }
+\cs_new_protected:Npn \sys_load_deprecation: { }
% \end{macrocode}
% \end{macro}
%
@@ -486,10 +486,10 @@
% \begin{macro}[EXP, deprecated]{\text_titlecase:nn}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2023-07-08 } { \text_titlecase_first:n }
-\cs_gset:Npn \text_titlecase:n #1
+\cs_new:Npn \text_titlecase:n #1
{ \text_titlecase_first:n { \text_lowercase:n {#1} } }
\__kernel_patch_deprecation:nnNNpn { 2023-07-08 } { \text_titlecase_first:nn }
-\cs_gset:Npn \text_titlecase:nn #1#2
+\cs_new:Npn \text_titlecase:nn #1#2
{ \text_titlecase_first:nn {#1} { \text_lowercase:n {#2} } }
% \end{macrocode}
% \end{macro}
@@ -509,22 +509,22 @@
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:n }
-\cs_gset:Npn \tl_lower_case:n #1
+\cs_new:Npn \tl_lower_case:n #1
{ \text_lowercase:n {#1} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:nn }
-\cs_gset:Npn \tl_lower_case:nn #1#2
+\cs_new:Npn \tl_lower_case:nn #1#2
{ \text_lowercase:nn {#1} {#2} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_uppercase:n }
-\cs_gset:Npn \tl_upper_case:n #1
+\cs_new:Npn \tl_upper_case:n #1
{ \text_uppercase:n {#1} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_uppercase:nn }
-\cs_gset:Npn \tl_upper_case:nn #1#2
+\cs_new:Npn \tl_upper_case:nn #1#2
{ \text_uppercase:nn {#1} {#2} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:n }
-\cs_gset:Npn \tl_mixed_case:n #1
+\cs_new:Npn \tl_mixed_case:n #1
{ \text_titlecase_first:n {#1} }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:nn }
-\cs_gset:Npn \tl_mixed_case:nn #1#2
+\cs_new:Npn \tl_mixed_case:nn #1#2
{ \text_titlecase_first:nn {#1} {#2} }
% \end{macrocode}
% \end{macro}
@@ -532,13 +532,13 @@
% \begin{macro}[noTF, deprecated]{\tl_case:Nn, \tl_case:cn}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2022-05-23 } { \token_case_meaning:Nn }
-\cs_gset:Npn \tl_case:Nn { \token_case_meaning:Nn }
+\cs_new:Npn \tl_case:Nn { \token_case_meaning:Nn }
\__kernel_patch_deprecation:nnNNpn { 2022-05-23 } { \token_case_meaning:NnT }
-\cs_gset:Npn \tl_case:NnT { \token_case_meaning:NnT }
+\cs_new:Npn \tl_case:NnT { \token_case_meaning:NnT }
\__kernel_patch_deprecation:nnNNpn { 2022-05-23 } { \token_case_meaning:NnF }
-\cs_gset:Npn \tl_case:NnF { \token_case_meaning:NnF }
+\cs_new:Npn \tl_case:NnF { \token_case_meaning:NnF }
\__kernel_patch_deprecation:nnNNpn { 2022-05-23 } { \token_case_meaning:NnTF }
-\cs_gset:Npn \tl_case:NnTF { \token_case_meaning:NnTF }
+\cs_new:Npn \tl_case:NnTF { \token_case_meaning:NnTF }
\cs_generate_variant:Nn \tl_case:Nn { c }
\prg_generate_conditional_variant:Nnn \tl_case:Nn
{ c } { T , F , TF }
@@ -570,16 +570,16 @@
% \begin{macro}[EXP, deprecated]{\char_to_utfviii_bytes:n}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2022-10-09 } { [ \codepoint_generate:nn ] }
-\cs_gset:Npn \char_to_utfviii_bytes:n { \__kernel_codepoint_to_bytes:n }
+\cs_new:Npn \char_to_utfviii_bytes:n { \__kernel_codepoint_to_bytes:n }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP, deprecated]{\char_to_nfd:N, \char_to_nfd:n}
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2022-10-09 } { \codepoint_to_nfd:n }
-\cs_gset:Npn \char_to_nfd:N #1 { \codepoint_to_nfd:n {`#1} }
+\cs_new:Npn \char_to_nfd:N #1 { \codepoint_to_nfd:n {`#1} }
\__kernel_patch_deprecation:nnNNpn { 2022-10-09 } { \codepoint_to_nfd:n }
-\cs_gset:Npn \char_to_nfd:n { \codepoint_to_nfd:n }
+\cs_new:Npn \char_to_nfd:n { \codepoint_to_nfd:n }
% \end{macrocode}
% \end{macro}
%
@@ -592,21 +592,21 @@
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_lowercase:n }
-\cs_gset:Npn \char_lower_case:N { \text_lowercase:n }
+\cs_new:Npn \char_lower_case:N { \text_lowercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_uppercase:n }
-\cs_gset:Npn \char_upper_case:N { \text_uppercase:n }
+\cs_new:Npn \char_upper_case:N { \text_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \text_titlecase_first:n }
-\cs_gset:Npn \char_mixed_case:N { \text_titlecase_first:n }
+\cs_new:Npn \char_mixed_case:N { \text_titlecase_first:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:n }
-\cs_gset:Npn \char_fold_case:N { \str_casefold:n }
+\cs_new:Npn \char_fold_case:N { \str_casefold:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_lowercase:n }
-\cs_gset:Npn \char_str_lower_case:N { \str_lowercase:n }
+\cs_new:Npn \char_str_lower_case:N { \str_lowercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:n }
-\cs_gset:Npn \char_str_upper_case:N { \str_uppercase:n }
+\cs_new:Npn \char_str_upper_case:N { \str_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_titlecase:n }
-\cs_gset:Npn \char_str_mixed_case:N { \str_titlecase:n }
+\cs_new:Npn \char_str_mixed_case:N { \str_titlecase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:n }
-\cs_gset:Npn \char_str_fold_case:N { \str_casefold:n }
+\cs_new:Npn \char_str_fold_case:N { \str_casefold:n }
% \end{macrocode}
% \end{macro}
%
@@ -619,23 +619,23 @@
% }
% \begin{macrocode}
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \text_lowercase:n }
-\cs_gset:Npn \char_lowercase:N { \text_lowercase:n }
+\cs_new:Npn \char_lowercase:N { \text_lowercase:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \text_uppercase:n }
-\cs_gset:Npn \char_uppercase:N { \text_uppercase:n }
+\cs_new:Npn \char_uppercase:N { \text_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \text_titlecase_first:n }
-\cs_gset:Npn \char_titlecase:N { \text_titlecase_first:n }
+\cs_new:Npn \char_titlecase:N { \text_titlecase_first:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:n }
-\cs_gset:Npn \char_foldcase:N { \str_casefold:n }
+\cs_new:Npn \char_foldcase:N { \str_casefold:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_lowercase:n }
-\cs_gset:Npn \char_str_lowercase:N { \str_lowercase:n }
+\cs_new:Npn \char_str_lowercase:N { \str_lowercase:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 }
{ \tl_to_str:e { \text_titlecase_first:n } }
-\cs_gset:Npn \char_str_titlecase:N #1
+\cs_new:Npn \char_str_titlecase:N #1
{ \tl_to_str:e { \text_titlecase_first:n {#1} } }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_uppercase:n }
-\cs_gset:Npn \char_str_uppercase:N { \str_uppercase:n }
+\cs_new:Npn \char_str_uppercase:N { \str_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:n }
-\cs_gset:Npn \char_str_foldcase:N { \str_casefold:n }
+\cs_new:Npn \char_str_foldcase:N { \str_casefold:n }
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx
index 695e47a444..a48a24df23 100644
--- a/macros/latex/contrib/l3kernel/l3doc.dtx
+++ b/macros/latex/contrib/l3kernel/l3doc.dtx
@@ -71,7 +71,7 @@ and all files in that bundle must be distributed together.
% This isn't included in the typeset documentation because it's a bit
% ugly:
%<*class>
-\ProvidesExplClass{l3doc}{2024-02-20}{}
+\ProvidesExplClass{l3doc}{2024-03-14}{}
{L3 Experimental documentation class}
%</class>
% \fi
@@ -84,7 +84,7 @@ and all files in that bundle must be distributed together.
% require you to do updates, if the class changes.}}
%
% \author{\Team}
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
% \maketitle
% \tableofcontents
%
@@ -1655,7 +1655,7 @@ and all files in that bundle must be distributed together.
%
% \begin{macro}{\l@section, \l@subsection}
% Customise the table of contents (as we have so many sections).
-% Different design and/or structure is called for).
+% Different design and/or structure is called for.
% \begin{macrocode}
\@addtoreset{section}{part}
\cs_gset:Npn \l@section #1#2
@@ -2127,11 +2127,9 @@ and all files in that bundle must be distributed together.
{ \hyperlink { explTF } }
{ \mbox }
{
- \color{black}
\itshape TF
\makebox[0pt][r]
{
- \cs_if_exist:NT \Codedoc@explTF { \color{red} }
\underline { \phantom{\itshape TF} \kern-0.1em }
}
}
@@ -3206,18 +3204,22 @@ and all files in that bundle must be distributed together.
\tl_set:Nn \l_@@_tmpa_tl {#1}
\tl_replace_all:NnV \l_@@_tmpa_tl
{ ~ } \c_catcode_other_space_tl
- \@@_macroname_prefix:o \l_@@_tmpa_tl
- \@@_macroname_suffix:N #2
+ \@@_print_macroname_aux:on
+ \l_@@_tmpa_tl { \bool_if:NT #2 { \@@_typeset_TF: } }
}
}
-\cs_new_protected:Npn \@@_macroname_prefix:n #1
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_print_macroname_aux:nn}
+% |#1| is prefix, |#2| is optional |TF| suffix.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_print_macroname_aux:nn #1#2
{
\@@_if_macro_internal:nTF {#1}
- { \@@_typeset_aux:n {#1} } {#1}
+ { \@@_typeset_aux:n { #1 #2 } } { #1 #2 }
}
-\cs_generate_variant:Nn \@@_macroname_prefix:n { o }
-\cs_new_protected:Npn \@@_macroname_suffix:N #1
- { \bool_if:NTF #1 { \@@_typeset_TF: } { } }
+\cs_generate_variant:Nn \@@_print_macroname_aux:nn { o }
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex/contrib/l3kernel/l3doc.pdf b/macros/latex/contrib/l3kernel/l3doc.pdf
index 99b165a539..2f85329fdc 100644
--- a/macros/latex/contrib/l3kernel/l3doc.pdf
+++ b/macros/latex/contrib/l3kernel/l3doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx
index fe60a6f312..c973d593c5 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.dtx
+++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf
index b5ea68fdc7..f2e611b2c9 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.pdf
+++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx
index aaf0d04d29..7e507b7598 100644
--- a/macros/latex/contrib/l3kernel/l3expan.dtx
+++ b/macros/latex/contrib/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index 1159101ca5..3a4d1c06dc 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx
index 7604c2c2ba..40614c7348 100644
--- a/macros/latex/contrib/l3kernel/l3flag.dtx
+++ b/macros/latex/contrib/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
index cb20934904..6d00047e4d 100644
--- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
index fd75e1bb5a..1f4ea5d34d 100644
--- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
index 76b7a8cdb2..a7401407cd 100644
--- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
index 5b95dc543e..0459331326 100644
--- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
index 571cb9864a..5b5f947c38 100644
--- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
index 51e747a744..bcd16a4b68 100644
--- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-functions.dtx b/macros/latex/contrib/l3kernel/l3fp-functions.dtx
index efedd0fffb..b26d8e7f26 100644
--- a/macros/latex/contrib/l3kernel/l3fp-functions.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-functions.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
index a0984d5f36..c95704085c 100644
--- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
index a313f9b0be..53b85a7cc8 100644
--- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx
index a2c8eb81db..cdbdf38ee1 100644
--- a/macros/latex/contrib/l3kernel/l3fp-random.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx
index a19ce34195..bddb146be7 100644
--- a/macros/latex/contrib/l3kernel/l3fp-round.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-symbolic.dtx b/macros/latex/contrib/l3kernel/l3fp-symbolic.dtx
index f2073b5e52..26a084733d 100644
--- a/macros/latex/contrib/l3kernel/l3fp-symbolic.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-symbolic.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
index 70e41d5a4d..e1a3dd89a0 100644
--- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
index 98cf15b281..21cefc166c 100644
--- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
@@ -42,7 +42,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-types.dtx b/macros/latex/contrib/l3kernel/l3fp-types.dtx
index 23c7f6ac4e..0d589c9549 100644
--- a/macros/latex/contrib/l3kernel/l3fp-types.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-types.dtx
@@ -42,7 +42,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx
index 5983dc2f48..11dbcdceef 100644
--- a/macros/latex/contrib/l3kernel/l3fp.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx
index 97ebfe2295..1517840431 100644
--- a/macros/latex/contrib/l3kernel/l3fparray.dtx
+++ b/macros/latex/contrib/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -58,7 +58,7 @@
% close to that of \pkg{l3intarray}. The size of the array is fixed and
% must be given at point of initialisation
%
-% \begin{function}[added = 2018-05-05]{\fparray_new:Nn}
+% \begin{function}[added = 2018-05-05]{\fparray_new:Nn, \fparray_new:cn}
% \begin{syntax}
% \cs{fparray_new:Nn} \meta{fparray~var} \Arg{size}
% \end{syntax}
@@ -68,7 +68,7 @@
% assignments are always global.
% \end{function}
%
-% \begin{function}[EXP, added = 2018-05-05]{\fparray_count:N}
+% \begin{function}[EXP, added = 2018-05-05]{\fparray_count:N, \fparray_count:c}
% \begin{syntax}
% \cs{fparray_count:N} \meta{fparray~var}
% \end{syntax}
@@ -76,7 +76,7 @@
% variable}. This is performed in constant time.
% \end{function}
%
-% \begin{function}[added = 2018-05-05]{\fparray_gset:Nnn}
+% \begin{function}[added = 2018-05-05]{\fparray_gset:Nnn, \fparray_gset:cnn}
% \begin{syntax}
% \cs{fparray_gset:Nnn} \meta{fparray~var} \Arg{position} \Arg{value}
% \end{syntax}
@@ -87,7 +87,7 @@
% Assignments are always global.
% \end{function}
%
-% \begin{function}[added = 2018-05-05]{\fparray_gzero:N}
+% \begin{function}[added = 2018-05-05]{\fparray_gzero:N, \fparray_gzero:c}
% \begin{syntax}
% \cs{fparray_gzero:N} \meta{fparray~var}
% \end{syntax}
@@ -96,7 +96,10 @@
% \end{function}
%
% \begin{function}[EXP, added = 2018-05-05]
-% {\fparray_item:Nn, \fparray_item_to_tl:Nn}
+% {
+% \fparray_item:Nn, \fparray_item:cn
+% \fparray_item_to_tl:Nn, \fparray_item_to_tl:cn
+% }
% \begin{syntax}
% \cs{fparray_item:Nn} \meta{fparray~var} \Arg{position}
% \end{syntax}
diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx
index 0eacdb25e7..9fa2a547ff 100644
--- a/macros/latex/contrib/l3kernel/l3int.dtx
+++ b/macros/latex/contrib/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -1215,7 +1215,7 @@
}
\cs_new:Npn \@@_abs:N #1
{ \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
-\cs_set:Npn \int_max:nn #1#2
+\cs_new:Npn \int_max:nn #1#2
{
\int_value:w \exp_after:wN \@@_maxmin:wwN
\int_value:w \@@_eval:w #1 \exp_after:wN ;
@@ -1223,7 +1223,7 @@
>
\exp_stop_f:
}
-\cs_set:Npn \int_min:nn #1#2
+\cs_new:Npn \int_min:nn #1#2
{
\int_value:w \exp_after:wN \@@_maxmin:wwN
\int_value:w \@@_eval:w #1 \exp_after:wN ;
@@ -1395,10 +1395,10 @@
\cs_if_exist:NTF \tex_omathchardef:D
{ \cs_new_eq:NN \@@_constdef:Nw \tex_omathchardef:D }
{ \cs_new_eq:NN \@@_constdef:Nw \tex_chardef:D }
- \@@_constdef:Nw \c_@@_max_constdef_int 1114111 ~
+ \tex_global:D \@@_constdef:Nw \c_@@_max_constdef_int 1114111 ~
\else:
\cs_new_eq:NN \@@_constdef:Nw \tex_mathchardef:D
- \tex_mathchardef:D \c_@@_max_constdef_int 32767 ~
+ \tex_global:D \@@_constdef:Nw \c_@@_max_constdef_int 32767 ~
\fi:
% \end{macrocode}
% \end{variable}
diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx
index 4dd308a5c5..5704a2ab75 100644
--- a/macros/latex/contrib/l3kernel/l3intarray.dtx
+++ b/macros/latex/contrib/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
index be8aed20d9..480425d730 100644
--- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
+++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx
index 9000132775..5ea436176f 100644
--- a/macros/latex/contrib/l3kernel/l3keys.dtx
+++ b/macros/latex/contrib/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx
index e7970a7e2f..bd56f1ed3a 100644
--- a/macros/latex/contrib/l3kernel/l3legacy.dtx
+++ b/macros/latex/contrib/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx
index f112b99215..3d177f6345 100644
--- a/macros/latex/contrib/l3kernel/l3luatex.dtx
+++ b/macros/latex/contrib/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -267,7 +267,7 @@
\lua_now:n , \lua_now:e
}
{
- \cs_set:Npn #1 ##1
+ \cs_gset:Npn #1 ##1
{
\msg_expandable_error:nnn
{ luatex } { luatex-required } { #1 }
@@ -276,7 +276,7 @@
\clist_map_inline:nn
{ \lua_shipout_e:n , \lua_shipout:n, \lua_load_module:n }
{
- \cs_set_protected:Npn #1 ##1
+ \cs_gset_protected:Npn #1 ##1
{
\msg_error:nnn
{ luatex } { luatex-required } { #1 }
diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx
index 75ba84a6ff..3acae8d111 100644
--- a/macros/latex/contrib/l3kernel/l3msg.dtx
+++ b/macros/latex/contrib/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx
index 0782a08aa6..3e78d86acf 100644
--- a/macros/latex/contrib/l3kernel/l3names.dtx
+++ b/macros/latex/contrib/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf
index fead4d5f9f..87f01af5a7 100644
--- a/macros/latex/contrib/l3kernel/l3news.pdf
+++ b/macros/latex/contrib/l3kernel/l3news.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf
index a6a77cbf56..5a6d4af9e2 100644
--- a/macros/latex/contrib/l3kernel/l3news01.pdf
+++ b/macros/latex/contrib/l3kernel/l3news01.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf
index 8ef3a6499f..8cda69f971 100644
--- a/macros/latex/contrib/l3kernel/l3news02.pdf
+++ b/macros/latex/contrib/l3kernel/l3news02.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf
index 9afc8bd99d..f16bb58750 100644
--- a/macros/latex/contrib/l3kernel/l3news03.pdf
+++ b/macros/latex/contrib/l3kernel/l3news03.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf
index 0d2a7c3531..52c33e516a 100644
--- a/macros/latex/contrib/l3kernel/l3news04.pdf
+++ b/macros/latex/contrib/l3kernel/l3news04.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf
index 0fceb43473..1f6bda9687 100644
--- a/macros/latex/contrib/l3kernel/l3news05.pdf
+++ b/macros/latex/contrib/l3kernel/l3news05.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf
index 61ebc770ff..cd65bce3a6 100644
--- a/macros/latex/contrib/l3kernel/l3news06.pdf
+++ b/macros/latex/contrib/l3kernel/l3news06.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf
index 3f2d7e51f4..721252a9b0 100644
--- a/macros/latex/contrib/l3kernel/l3news07.pdf
+++ b/macros/latex/contrib/l3kernel/l3news07.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf
index 43104af4c3..855db5bdc5 100644
--- a/macros/latex/contrib/l3kernel/l3news08.pdf
+++ b/macros/latex/contrib/l3kernel/l3news08.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf
index 429016e9f6..5dc3a3b9ad 100644
--- a/macros/latex/contrib/l3kernel/l3news09.pdf
+++ b/macros/latex/contrib/l3kernel/l3news09.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf
index 8a19d48d88..e921d2c81b 100644
--- a/macros/latex/contrib/l3kernel/l3news10.pdf
+++ b/macros/latex/contrib/l3kernel/l3news10.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf
index 2fbf1ed30b..a4866d55e7 100644
--- a/macros/latex/contrib/l3kernel/l3news11.pdf
+++ b/macros/latex/contrib/l3kernel/l3news11.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf
index 0e0c63f2be..4b6072bca1 100644
--- a/macros/latex/contrib/l3kernel/l3news12.pdf
+++ b/macros/latex/contrib/l3kernel/l3news12.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3pdf.dtx b/macros/latex/contrib/l3kernel/l3pdf.dtx
index 0310e7c6ad..7ffd0c1c05 100644
--- a/macros/latex/contrib/l3kernel/l3pdf.dtx
+++ b/macros/latex/contrib/l3kernel/l3pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf
index 281bc5dc71..9b2e9b407e 100644
--- a/macros/latex/contrib/l3kernel/l3prefixes.pdf
+++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx
index e596e4cfb7..8bbdd6a587 100644
--- a/macros/latex/contrib/l3kernel/l3prg.dtx
+++ b/macros/latex/contrib/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx
index dcf14be536..878b9eb758 100644
--- a/macros/latex/contrib/l3kernel/l3prop.dtx
+++ b/macros/latex/contrib/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx
index c465fa251c..000063bc00 100644
--- a/macros/latex/contrib/l3kernel/l3quark.dtx
+++ b/macros/latex/contrib/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -820,43 +820,46 @@
% \begin{macro}{
% \@@_new_conditional_n:Nnnn,
% \@@_new_conditional_N:Nnnn,
+% \@@_new_conditional_n_aux:NNNn,
+% \@@_new_conditional_N_aux:NNNn
% }
% These macros implement the two possibilities for branching quark
-% conditionals, passing
-% the right arguments to \cs{@@_new_conditional_aux_do:NNnnn},
-% which defines some auxiliaries and defines the
-% main conditionals.
+% conditionals. To avoid constructing without defining the
+% \cs[no-index]{__\meta{type}_if_quark_\meta{name}:w} helper,
+% \texttt{N}-type function accepts a \cs{prg_do_nothing:} as
+% a placeholder.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_new_conditional_n:Nnnn
- { \@@_new_conditional_aux_do:NNnnn \use_i:nn }
-\cs_new_protected:Npn \@@_new_conditional_N:Nnnn
- { \@@_new_conditional_aux_do:NNnnn \use_ii:nn }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{
-% \@@_new_conditional_aux_do:NNnnn,
-% \@@_new_conditional_define:NNNNn,
-% }
-% Similar to the previous macros, but branching conditionals only
-% require one auxiliary, so we take a shortcut. In
-% \cs{@@_new_conditional_define:NNNNn}, |#4| is \cs{use_i:nn} to
-% define the \texttt{n}-type function (which needs an auxiliary) and
-% is \cs{use_ii:nn} to define the \texttt{N}-type function.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_new_conditional_aux_do:NNnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_new_conditional_n:Nnnn #1 #2 #3
+ {
+ \exp_args:Ncc \@@_new_conditional_n_aux:NNNn
+ { __ #3 _if_quark_ #2 :w } { q__ #3 _ #2 } #1
+ }
+\cs_new_protected:Npn \@@_new_conditional_N:Nnnn #1 #2 #3
{
- \exp_args:Ncc \@@_new_conditional_define:NNNNn
- { __ #4 _if_quark_ #3 :w } { q__ #4 _ #3 } #2 #1
+ \exp_args:NNc \@@_new_conditional_N_aux:NNNn
+ \prg_do_nothing: { q__ #3 _ #2 } #1
}
-\cs_new_protected:Npn \@@_new_conditional_define:NNNNn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_new_conditional_n_aux:NNNn #1 #2 #3 #4
{
- #4 { \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1 ##2 } } { }
- \exp_args:Nno \use:n { \prg_new_conditional:Npnn #3 ##1 {#5} }
+ \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1##2 }
+ \prg_new_conditional:Npnn #3 ##1 {#4}
{
- #4 { \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! } }
- { \if_meaning:w #2 ##1 }
- \prg_return_true: \else: \prg_return_false: \fi:
+ \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+ }
+\cs_new_protected:Npn \@@_new_conditional_N_aux:NNNn #1 #2 #3 #4
+ {
+ \prg_new_conditional:Npnn #3 ##1 {#4}
+ {
+ \if_meaning:w #2 ##1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
}
}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx
index 428870c453..395be76907 100644
--- a/macros/latex/contrib/l3kernel/l3regex.dtx
+++ b/macros/latex/contrib/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -4155,7 +4155,7 @@
% incorrect). That's clunky, but not too expensive, since it's only
% one test.
% \begin{macrocode}
-\cs_set:Npn \@@_show_class:NnnnN #1#2#3#4#5
+\cs_new:Npn \@@_show_class:NnnnN #1#2#3#4#5
{
\group_begin:
\tl_build_begin:N \l_@@_build_tl
diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx
index c200bf21f9..5334e8fd88 100644
--- a/macros/latex/contrib/l3kernel/l3seq.dtx
+++ b/macros/latex/contrib/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx
index c0dfc22a37..1839c8a2e5 100644
--- a/macros/latex/contrib/l3kernel/l3skip.dtx
+++ b/macros/latex/contrib/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx
index b96e3f3b2b..818f605e07 100644
--- a/macros/latex/contrib/l3kernel/l3sort.dtx
+++ b/macros/latex/contrib/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx
index e7b7ecf44d..be850b3109 100644
--- a/macros/latex/contrib/l3kernel/l3str-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx
index 827cc994f5..88ad33c74b 100644
--- a/macros/latex/contrib/l3kernel/l3str.dtx
+++ b/macros/latex/contrib/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf
index 8c34658440..322b032a67 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.pdf
+++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex
index 81590ff768..a2ffe8d770 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.tex
+++ b/macros/latex/contrib/l3kernel/l3styleguide.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2024-02-20}
+\date{Released 2024-03-14}
\begin{document}
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
index 4e1be073a9..2a701d8ec5 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
index e16dec0704..7e124576c7 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2024-02-20}
+\date{Released 2024-03-14}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx
index 9a0fb8dcf3..feec1232fd 100644
--- a/macros/latex/contrib/l3kernel/l3sys.dtx
+++ b/macros/latex/contrib/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -324,6 +324,58 @@
% Execute \meta{tokens} through shell escape at shipout.
% \end{function}
%
+% \section{System queries}
+%
+% Some queries can be made about the file system, etc., without needing to
+% use unrestricted shell escape. This is carried out using the script
+% \texttt{l3sys-query}, which is documented separately. The wrappers here
+% use this script, if available, to obtain system information that is
+% not directly available within the \TeX{} run. Note that if restricted
+% shell escape is disabled, no results can be obtained.
+%
+% \begin{function}[added = 2024-03-08]
+% {\sys_get_query:nN, \sys_get_query:nnN, \sys_get_query:nnnN}
+% \begin{syntax}
+% \cs{sys_get_query:nN} \Arg{cmd} \Arg{tl var}
+% \cs{sys_get_query:nnN} \Arg{cmd} \Arg{spec} \Arg{tl var}
+% \cs{sys_get_query:nnnN} \Arg{cmd} \Arg{options} \Arg{spec} \Arg{tl var}
+% \end{syntax}
+% Sets the \meta{tl var} to the information returned by the
+% \texttt{l3sys-query} \meta{cmd}, potentially supplying the \meta{options}
+% and \meta{spec} to the query call. The valid \meta{cmd} names are at present
+% \begin{itemize}
+% \item \texttt{pwd} Returns the present working directory
+% \item \texttt{ls} Returns a directory listing, using the \meta{spec} to
+% select files and applying the \meta{options} if given
+% \end{itemize}
+% The \meta{spec} is likely to contain the wildcards |*| or |?|,
+% and will automatically be passed to
+% the script without shell expansion. In a glob is needed within the
+% \meta{options}, this will need to be protected from shell expansion
+% using |'| tokens.
+%
+% The \meta{spec} and \meta{options}, if given, are expanded fully
+% before passing to the underlying script.
+%
+% If more than one line of text is returned by the \meta{cmd}, these will be
+% separated by character~13 (|^^M|) tokens of category code~12. In most
+% cases, \cs{sys_split_query:nnnN} should be preferred when multi-line
+% output is expected.
+% \end{function}
+%
+% \begin{function}[added = 2024-03-08]
+% {\sys_split_query:nN, \sys_split_query:nnN, \sys_split_query:nnnN}
+% \begin{syntax}
+% \cs{sys_split_query:nN} \Arg{cmd} \Arg{seq}
+% \cs{sys_split_query:nnN} \Arg{cmd} \Arg{spec} \Arg{seq}
+% \cs{sys_split_query:nnnN} \Arg{cmd} \Arg{options} \Arg{spec} \Arg{seq}
+% \end{syntax}
+% Works as described for \cs{sys_split_query:nnnN}, but sets the \meta{seq}
+% to contain one entry for each line returned by \texttt{l3sys-query}.
+% This function should therefore be preferred where multi-line return is
+% expected, e.g.~for the \texttt{ls} command.
+% \end{function}
+%
% \section{Loading configuration data}
%
% \begin{function}[added = 2019-09-12]{\sys_load_backend:n}
@@ -390,6 +442,12 @@
%<*tex>
% \end{macrocode}
%
+% \begin{macro}{\l_@@_tmp_tl}
+% \begin{macrocode}
+\tl_new:N \l_@@_tmp_tl
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{Detecting the engine}
%
% \begin{macro}{\@@_const:nn}
@@ -1083,6 +1141,107 @@ end
% \end{macrocode}
% \end{macro}
%
+% \subsection{System queries}
+%
+% \begin{macro}{\sys_get_query:nN}
+% \begin{macro}{\sys_get_query:nnN}
+% \begin{macro}
+% {
+% \sys_get_query:nnnN,
+% \@@_get_query_auxi:nnnN, \@@_get_query_auxi:neeN,
+% \@@_get_query_auxii:nnnN, \@@_get_query_auxii:neeN
+% }
+% Calling the query system is quite straight-forward: most of the effort is
+% in making the read-back catcode-safe. We also want to trim off the trailing
+% |^^M| from the last line.
+% \begin{macrocode}
+\cs_new_protected:Npn \sys_get_query:nN #1#2
+ { \sys_get_query:nnnN {#1} { } { } #2 }
+\cs_new_protected:Npn \sys_get_query:nnN #1#2#3
+ { \sys_get_query:nnnN {#1} { } {#2} #3 }
+\cs_new_protected:Npn \sys_get_query:nnnN #1#2#3#4
+ {
+ \str_clear:N #4
+ \@@_get_query_auxi:neeN {#1} {#2} {#3} #4
+ }
+\cs_new:Npn \@@_get_query_auxi:nnnN #1#2#3#4
+ {
+ \@@_get_query_auxii:neeN {#1}
+ { \tl_if_blank:nF {#2} { \tl_to_str:n { ~ #2 } } }
+ {
+ \tl_if_blank:nF {#3}
+ {
+ \c_space_tl
+ \sys_if_shell_restricted:F '
+ \tl_to_str:n {#3}
+ \sys_if_shell_restricted:F '
+ }
+ }
+ #4
+ }
+\cs_generate_variant:Nn \@@_get_query_auxi:nnnN { nee }
+\cs_new_protected:Npn \@@_get_query_auxii:nnnN #1#2#3#4
+ {
+ \sys_if_shell:T
+ {
+ \sys_get_shell:nnN
+ { l3sys-query~#1 #2 #3 }
+ {
+ \int_step_inline:nnn { 0 } { `a - 1 }
+ { \char_set_catcode_other:n {##1} }
+ \int_step_inline:nnn { `Z + 1 } { 127 }
+ { \char_set_catcode_other:n {##1} }
+ \tex_endlinechar:D 13 \scan_stop:
+ }
+ \l_@@_tmp_tl
+ \tl_if_empty:NF \l_@@_tmp_tl
+ {
+ \exp_after:wN \@@_get_query:Nw \exp_after:wN #4
+ \l_@@_tmp_tl \q_stop
+ }
+ }
+ }
+\cs_generate_variant:Nn \@@_get_query_auxii:nnnN { nee }
+\group_begin:
+ \tex_lccode:D `\* = 13 \scan_stop:
+ \tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \@@_get_query:Nw #1#2 * \q_stop
+ }
+ { \tl_set:Nn #1 {#2} }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sys_split_query:nN}
+% \begin{macro}{\sys_split_query:nnN}
+% \begin{macro}{\sys_split_query:nnnN}
+% A wrapper for convenience.
+% \begin{macrocode}
+\cs_new_protected:Npn \sys_split_query:nN #1#2
+ { \sys_split_query:nnnN {#1} { } { } #2 }
+\cs_new_protected:Npn \sys_split_query:nnN #1#2#3
+ { \sys_split_query:nnnN {#1} { } {#2} #3 }
+\group_begin:
+ \tex_lccode:D `\* = 13 \scan_stop:
+ \tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \sys_split_query:nnnN #1#2#3#4
+ {
+ \seq_clear:N #4
+ \sys_get_query:nnnN {#1} {#2} {#3} \l_@@_tmp_tl
+ \tl_if_empty:NF \l_@@_tmp_tl
+ { \seq_set_split:NnV #4 * \l_@@_tmp_tl }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \subsubsection{Held over from \pkg{l3file}}
%
% \begin{variable}{\g_file_curr_name_str}
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
index a1e571ac5c..93def3980b 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex
index 600709d762..5db9e83a45 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.tex
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2024-02-20}
+\date{Released 2024-03-14}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx
index 8a5677806c..0547db28b1 100644
--- a/macros/latex/contrib/l3kernel/l3text-case.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-case.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3text-map.dtx b/macros/latex/contrib/l3kernel/l3text-map.dtx
index fff01a5255..d364c32199 100644
--- a/macros/latex/contrib/l3kernel/l3text-map.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-map.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx
index 6de37faa62..8f92c1eae9 100644
--- a/macros/latex/contrib/l3kernel/l3text-purify.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx
index bdbd7c8d27..5feff565b9 100644
--- a/macros/latex/contrib/l3kernel/l3text.dtx
+++ b/macros/latex/contrib/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -889,12 +889,12 @@
% {\c_@@_chardef_group_end_token, \c_@@_mathchardef_group_end_token}
% Markers for implict char handling.
% \begin{macrocode}
-\tex_chardef:D \c_@@_chardef_space_token = `\ %
-\tex_mathchardef:D \c_@@_mathchardef_space_token = `\ %
-\tex_chardef:D \c_@@_chardef_group_begin_token = `\{ % `\}
-\tex_mathchardef:D \c_@@_mathchardef_group_begin_token = `\{ % `\} `\{
-\tex_chardef:D \c_@@_chardef_group_end_token = `\} % `\{
-\tex_mathchardef:D \c_@@_mathchardef_group_end_token = `\} %
+\tex_global:D \tex_chardef:D \c_@@_chardef_space_token = `\ %
+\tex_global:D \tex_mathchardef:D \c_@@_mathchardef_space_token = `\ %
+\tex_global:D \tex_chardef:D \c_@@_chardef_group_begin_token = `\{ % `\}
+\tex_global:D \tex_mathchardef:D \c_@@_mathchardef_group_begin_token = `\{ % `\} `\{
+\tex_global:D \tex_chardef:D \c_@@_chardef_group_end_token = `\} % `\{
+\tex_global:D \tex_mathchardef:D \c_@@_mathchardef_group_end_token = `\} %
% \end{macrocode}
% \end{variable}
% \end{variable}
diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
index 776b360434..d965050c76 100644
--- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3tl-build.dtx b/macros/latex/contrib/l3kernel/l3tl-build.dtx
index 1fc841ca78..175b7bc24f 100644
--- a/macros/latex/contrib/l3kernel/l3tl-build.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl-build.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx
index ed83e3bc81..0938e7cd5e 100644
--- a/macros/latex/contrib/l3kernel/l3tl.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx
index b11e4859db..cd538ee6d0 100644
--- a/macros/latex/contrib/l3kernel/l3token.dtx
+++ b/macros/latex/contrib/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -2376,7 +2376,7 @@ end
}
}
{
- \tex_chardef:D \c_@@_A_int = `A ~ %
+ \tex_global:D \tex_chardef:D \c_@@_A_int = `A ~ %
\use:e
{
\prg_new_conditional:Npnn \exp_not:N \token_if_primitive:N #1
diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx
index b4a70b24ad..cd552800b0 100644
--- a/macros/latex/contrib/l3kernel/l3unicode.dtx
+++ b/macros/latex/contrib/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-20}
+% \date{Released 2024-03-14}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf
index 6350700965..c6a6396503 100644
--- a/macros/latex/contrib/l3kernel/source3.pdf
+++ b/macros/latex/contrib/l3kernel/source3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex
index 69761fd7f3..c09d75767b 100644
--- a/macros/latex/contrib/l3kernel/source3.tex
+++ b/macros/latex/contrib/l3kernel/source3.tex
@@ -57,7 +57,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2024-02-20}
+\date{Released 2024-03-14}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3packages/CHANGELOG.md b/macros/latex/contrib/l3packages/CHANGELOG.md
index 4677988532..b12b36ec76 100644
--- a/macros/latex/contrib/l3packages/CHANGELOG.md
+++ b/macros/latex/contrib/l3packages/CHANGELOG.md
@@ -7,6 +7,11 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2024-03-14]
+
+### Changed
+- Add a new intro to `xparse.dtx` pointing to kernel methods
+
## [2024-02-18]
### Changed
@@ -248,7 +253,8 @@ this project uses date-based 'snapshot' version identifiers.
- Switch to ISO date format
- Improve cross-module use of internal functions
-[Unreleased]: https://github.com/latex3/latex3/compare/2024-02-18...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2024-03-14...HEAD
+[2024-03-14]: https://github.com/latex3/latex3/compare/2024-02-18...2024-03-14
[2024-02-18]: https://github.com/latex3/latex3/compare/2024-02-13...2024-02-18
[2024-02-13]: https://github.com/latex3/latex3/compare/2023-10-10...2024-02-13
[2023-10-10]: https://github.com/latex3/latex3/compare/2023-08-29...2023-10-10
diff --git a/macros/latex/contrib/l3packages/README.md b/macros/latex/contrib/l3packages/README.md
index 2b489b3e97..601e8d229a 100644
--- a/macros/latex/contrib/l3packages/README.md
+++ b/macros/latex/contrib/l3packages/README.md
@@ -1,6 +1,6 @@
# `l3packages`: Higher-level LaTeX3 Concepts (Deprecated)
-Release 2024-02-18
+Release 2024-03-14
## Overview
diff --git a/macros/latex/contrib/l3packages/l3keys2e.dtx b/macros/latex/contrib/l3packages/l3keys2e.dtx
index a65b0239dd..817d37a46c 100644
--- a/macros/latex/contrib/l3packages/l3keys2e.dtx
+++ b/macros/latex/contrib/l3packages/l3keys2e.dtx
@@ -62,7 +62,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-18}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -154,7 +154,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{l3keys2e}{2024-02-18}{}
+\ProvidesExplPackage{l3keys2e}{2024-03-14}{}
{LaTeX2e option processing using LaTeX3 keys}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3packages/l3keys2e.pdf b/macros/latex/contrib/l3packages/l3keys2e.pdf
index b05bece984..ecf18342cf 100644
--- a/macros/latex/contrib/l3packages/l3keys2e.pdf
+++ b/macros/latex/contrib/l3packages/l3keys2e.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3packages/xfp.dtx b/macros/latex/contrib/l3packages/xfp.dtx
index 3a97e46903..8baebbfc19 100644
--- a/macros/latex/contrib/l3packages/xfp.dtx
+++ b/macros/latex/contrib/l3packages/xfp.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-18}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -171,7 +171,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xfp}{2024-02-18}{}
+\ProvidesExplPackage{xfp}{2024-03-14}{}
{L3 Floating point unit}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3packages/xfp.pdf b/macros/latex/contrib/l3packages/xfp.pdf
index 0544fac0fa..1bfdb01596 100644
--- a/macros/latex/contrib/l3packages/xfp.pdf
+++ b/macros/latex/contrib/l3packages/xfp.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3packages/xparse.dtx b/macros/latex/contrib/l3packages/xparse.dtx
index 6dba694d39..4b731d1e0f 100644
--- a/macros/latex/contrib/l3packages/xparse.dtx
+++ b/macros/latex/contrib/l3packages/xparse.dtx
@@ -67,12 +67,27 @@
% }^^A
% }
%
-% \date{Released 2024-02-18}
+% \date{Released 2024-03-14}
%
% \maketitle
%
% \begin{documentation}
%
+% \section{Introduction}
+%
+% \begin{center}
+% \bfseries This package is obsolete with the October 2020 \LaTeX{} release.
+% \end{center}
+%
+% With new formats, \cs{NewDocumentCommand}, etc., are available in
+% the format. Other than for a small number of now-deprecated
+% argument types and support functions, package authors should transition
+% their code to avoid loading \pkg{xparse}. An updated version of the
+% documentation covering the full set of functionality available in
+% the kernel is available in \texttt{usrguide}.
+%
+% \section{Old introduction}
+%
% The \pkg{xparse} package provides a high-level interface for
% producing document-level commands. In that way, it is intended as
% a replacement for the \LaTeXe{} \cs{newcommand} macro. However,
@@ -1064,7 +1079,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesExplPackage{xparse}{2024-02-18}{}
+\ProvidesExplPackage{xparse}{2024-03-14}{}
{L3 Experimental document command parser}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/l3packages/xparse.pdf b/macros/latex/contrib/l3packages/xparse.pdf
index d666c5ec7f..91a774d39f 100644
--- a/macros/latex/contrib/l3packages/xparse.pdf
+++ b/macros/latex/contrib/l3packages/xparse.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3packages/xtemplate.dtx b/macros/latex/contrib/l3packages/xtemplate.dtx
index 7a956d82bf..4aac33434a 100644
--- a/macros/latex/contrib/l3packages/xtemplate.dtx
+++ b/macros/latex/contrib/l3packages/xtemplate.dtx
@@ -5,7 +5,7 @@
% Copyright (C) 1999 Frank Mittelbach, Chris Rowley, David Carlisle
% (C) 2004-2010 Frank Mittelbach, The LaTeX Project
% (C) 2011-2024 The LaTeX Project
-%\
+%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Released 2024-02-18}
+% \date{Released 2024-03-14}
%
% \maketitle
%
@@ -695,8 +695,8 @@
%
% \begin{macro}{\DeclareRestrictedTemplate}
% \begin{macro}{\DeclareObjectType}
-% If the new kernel code is not loaded, make a couple of compatibility
-% additions. Otherwise, hand over to the frozen version.
+% If the new kernel code is not loaded, hand over to the frozen version.
+% Otherwise, make a couple of compatibility additions.
% \begin{macrocode}
\@ifundefined{NewTemplateType}
{%
@@ -704,12 +704,12 @@
\endinput
}
{%
- \ProvidesExplPackage{xtemplate}{2023-10-10}{}
+ \ProvidesExplPackage{xtemplate}{2024-03-14}{}
{L3 Experimental prototype document functions}
\long\protected\def\DeclareRestrictedTemplate#1#2#3#4{%
- \DeclareTemplateCopy{#1}{#3}{#2}%
- \EditTemplateDefaults{#1}{#3}{#4}%
- }%
+ \DeclareTemplateCopy{#1}{#3}{#2}%
+ \EditTemplateDefaults{#1}{#3}{#4}%
+ }%
}
\ExplSyntaxOn
\cs_new_protected:Npn \DeclareObjectType #1#2
diff --git a/macros/latex/contrib/l3packages/xtemplate.pdf b/macros/latex/contrib/l3packages/xtemplate.pdf
index 9edb9f169a..b52381f6dc 100644
--- a/macros/latex/contrib/l3packages/xtemplate.pdf
+++ b/macros/latex/contrib/l3packages/xtemplate.pdf
Binary files differ
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.pdf b/macros/latex/contrib/robust-externalize/robust-externalize.pdf
index 60be5cb58b..92914f2833 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.pdf
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.pdf
Binary files differ
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.sty b/macros/latex/contrib/robust-externalize/robust-externalize.sty
index fa9500e82d..5deeec6c84 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.sty
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.sty
@@ -1,4 +1,4 @@
-\ProvidesPackage{robust-externalize}[2.7 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
+\ProvidesPackage{robust-externalize}[2.8 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
% todo:
% change order argument replace from list, it is hard to read this way
@@ -1434,10 +1434,14 @@ if __name__ == '__main__':
\int_compare:nNnTF {\l_tmpa_int} = {\c_max_int} {} {
\str_clear:c { l__robExt_placeholder_#1_str }
%% We iterate over the lines to recreate the appropriate placeholder
- \seq_map_variable:NNn \l_tmpa_seq \l_tmpa_tl {
+ \int_set:Nn \l_tmpb_int {\seq_count:N \l_tmpa_seq}
+ \seq_map_indexed_inline:Nn \l_tmpa_seq {
\str_put_right:cx { l__robExt_placeholder_#1_str } {
- \str_range:Nnn \l_tmpa_tl {\l_tmpa_int + 1} {-1}
- ^^J
+ \str_range:nnn {##2} {\l_tmpa_int + 1} {-1}
+ % We do not want to add ^^J for the very last line, otherwise it will create a new line everytime we call it
+ \int_compare:nNnTF {##1} = {\l_tmpb_int} {} {
+ ^^J
+ }
}
}
}
@@ -1445,7 +1449,6 @@ if __name__ == '__main__':
\let\placeholderRemoveLeadingSpaces\robExtPlaceholderRemoveLeadingSpaces
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Placeholders groups %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.tex b/macros/latex/contrib/robust-externalize/robust-externalize.tex
index be0c689b61..049cfb5443 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.tex
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.tex
@@ -105,7 +105,7 @@
{\Large\bfseries Cache anything (\tikzname, tikz-cd, python…),\\in a robust, efficient and pure way.}
\vspace{1em}
- {Léo Colisson \quad Version 2.7}\\[3mm]
+ {Léo Colisson \quad Version 2.8}\\[3mm]
{\href{https://github.com/leo-colisson/robust-externalize}{\texttt{github.com/leo-colisson/robust-externalize}}}
\end{center}
@@ -159,7 +159,7 @@ for name in ["Alice", "Bob"]:
\end{CacheMeCode}
\end{codeAndResult}
-Actually, we also provide this style by default (and explain how to write it yourself), just make sure to load:
+Actually, we also provide this style by default (and explain how to write it yourself), just use the above code (WARNING: in v2.7, a bug was introduced, fixed in v2.8, that was adding a new line in front of the code), just make sure to load:
\begin{verbatim}
\usepackage{pythonhighlight}
\usepackage[most]{tcolorbox}
@@ -254,7 +254,7 @@ You can also cache all tikz pictures by default, except those that are run from
\tikz[baseline=(A.base)] \node(A)[rounded corners,fill=green]{my cached node \whereIAm};
\end{codeexample}
-will gives you: {%
+will give you: {%
%% this will cache \tikz and tikzpictures by default (using the tikz preset)
\cacheTikz
%% possibly add stuff to the tikz preset
@@ -362,9 +362,9 @@ We also provide a number of other functionalities, among others:
\item To get maximum purity while minimizing the number of rebuild, we provide functions to forward macros defined in the parent document, and the set of macros that must be forwarded can be automatically detected for each element to cache. It is also possible to conditionally import a library if the element contains a given macro.
\item We provide a way to compile a template via:\\
|new compiled preset={compiled ZX}{templateZX, compile latex template}{}|\\
- in order to make the compilation even faster (but you cannot use presets except |add to preamble|)
+ in order to make the compilation even faster (but you cannot use placeholders except |add to preamble|)
\item We give a highly configurable template, compilation and inclusion system, to cache basically anything
-\item We show how to compile all images in parallel using |\robExtConfigure{compile in parallel}| or |\robExtConfigure{compile in parallel after=5}| (make sure to have xargs installed, which is available by default on linux but must be installed on Windows via by installing the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow} if you use the default command) even during the first run, so that the first run becomes faster to compile than a normal run(!)
+\item We show how to compile all images in parallel using |\robExtConfigure{compile in parallel}| or |\robExtConfigure{compile in parallel after=5}| (make sure to have xargs installed, which is available by default on linux but must be installed on Windows by installing the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow} if you use the default command) even during the first run, so that the first run becomes faster to compile than a normal run(!)
\item We furnish commands to automatically clean the cache while keeping cached elements that are still needed.
\item And more\dots
\end{itemize}
@@ -4011,7 +4011,7 @@ or using the style |force python3| that forces |python3|.
\extractkey/robExt/python print code and result\@nil
\makeatother%
\pgfmanualbody
- This is a demo style that can print a python code and its result.
+ (Warning: in 2.7 a bug was introduced (fixed in v2.8) where an empty line was automatically added in front of the code) This is a demo style that can print a python code and its result.
\begin{codeAndResult}
\begin{CacheMeCode}{python print code and result, set title={The for loop}}
for name in ["Alice", "Bob"]:
@@ -4932,6 +4932,10 @@ Options > Configure TeXstudio > Editor > Replace tabs in text with spaces
\section{Changelog}
\begin{itemize}
+\item v2.8 (current master, not yet released):
+ \begin{itemize}
+ \item Fix a regression bug introduced in 2.7: |python print code and result| was adding a new line above the code printed. This is fixed now.
+ \end{itemize}
\item v2.7:
\begin{itemize}
\item apply |remove leading spaces| by default also in |placeholderFromCode| and |PlaceholderPathFromCode|, and allow the user to customize the style. This produces a very minor backward incompatibility as it might disturb code where all lines start with a space.
@@ -5012,4 +5016,5 @@ Options > Configure TeXstudio > Editor > Replace tabs in text with spaces
% Local Variables:
% TeX-command-extra-options: "--shell-escape -halt-on-error"
% TeX-engine: luatex
+% jinx-languages: "en"
% End: \ No newline at end of file