summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/README9
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdfbin550355 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdfbin556062 -> 556065 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdfbin390079 -> 390106 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdfbin981361 -> 978454 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-convert.pdfbin782007 -> 780968 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdfbin569159 -> 568770 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdfbin622976 -> 608537 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdfbin521010 -> 520457 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdfbin468371 -> 468383 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdfbin490241 -> 490713 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdfbin681124 -> 680986 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdfbin575666 -> 576301 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/expl3.pdfbin675060 -> 689148 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/interface3.pdfbin1296319 -> 1304589 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdfbin449457 -> 449467 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdfbin273207 -> 273228 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdfbin220205 -> 220218 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/source3.pdfbin0 -> 4053592 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3kernel/source3body.tex1
-rw-r--r--Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdfbin473227 -> 475912 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdfbin633938 -> 634688 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdfbin449917 -> 451855 bytes
-rw-r--r--Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdfbin400626 -> 401032 bytes
-rw-r--r--Master/texmf-dist/makeindex/l3kernel/l3doc.ist2
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.dtx1258
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.ins40
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx40
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx20
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx64
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx659
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx9
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx618
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx33
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx27
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx23
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx33
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color.dtx21
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx35
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx26
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx34
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx16
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx62
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3final.dtx15
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx8
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx16
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx5
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx91
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp.dtx21
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx162
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx129
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx18
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx44
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3names.dtx105
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx64
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx17
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3quark.dtx21
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx17
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx33
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx173
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx19
-rw-r--r--Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx39
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx63
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx16
-rw-r--r--Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty449
-rw-r--r--Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty4
-rw-r--r--Master/texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty4
-rw-r--r--Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty4
-rw-r--r--Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty4
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex16869
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex122
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/expl3.sty282
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3basics.sty887
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty274
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3box.sty265
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty1103
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3clist.sty461
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty847
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3color.sty76
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3doc.cls17
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def5
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3dvips.def5
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3expan.sty511
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3file.sty548
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3fp.sty5630
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3int.sty798
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3keys.sty818
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty190
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3msg.sty783
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3names.sty506
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def5
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3prg.sty338
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3prop.sty309
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3quark.sty172
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3seq.sty508
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3skip.sty446
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3tl.sty778
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3token.sty726
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def5
-rw-r--r--Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty33
-rw-r--r--Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty4
-rw-r--r--Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty37
-rw-r--r--Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty8
114 files changed, 18726 insertions, 20332 deletions
diff --git a/Master/texmf-dist/doc/latex/l3experimental/README b/Master/texmf-dist/doc/latex/l3experimental/README
index 02da76a3e61..7c168107e7a 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/README
+++ b/Master/texmf-dist/doc/latex/l3experimental/README
@@ -28,20 +28,11 @@ are under active development and the interfaces may change.
Currently included in the CTAN release of l3experimental are the following
bundles:
- * l3dt
* l3sort
* l3str
* xcoffins
* xgalley
-l3dt
-----
-
-A 'data table' is a method of storing data in a spreadsheet-like format,
-with rows and fields. This module provides the basic management structures
-needed to work with data tables, including the ability to map to fields
-on a row-by-row basis.
-
l3sort
------
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf
deleted file mode 100644
index 90b6a503ec0..00000000000
--- a/Master/texmf-dist/doc/latex/l3experimental/l3dt/l3dt.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf
index 9ac7b680884..2d13600253c 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3sort/l3sort.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf
index 18780cfd8d4..ba3080926ea 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3flag.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf
index 5aa998fe53d..b6d7e816a0a 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3regex.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-convert.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-convert.pdf
index 671cf576e8a..c19352318f4 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-convert.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-convert.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf
index e224c424d9b..36768afa9ce 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str-format.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf
index d9f74bf7b0e..5f9189602d7 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3str.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf
index cf99341aef8..51c3eb094ec 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-analysis.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf
index f3ca6ec4b47..a7c41132eaa 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/l3str/l3tl-build.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf b/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf
index f46a36da39f..1b6e0b9e9fd 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/xcoffins/xcoffins.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf b/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf
index e76e244036e..292f302707a 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/xgalley/l3galley.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf b/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf
index 2265e6d54c6..dbcad691583 100644
--- a/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf
+++ b/Master/texmf-dist/doc/latex/l3experimental/xgalley/xgalley.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf b/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf
index 16ca72d954b..efd7e58f1f6 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf
+++ b/Master/texmf-dist/doc/latex/l3kernel/expl3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf b/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf
index f4caa6a0fdb..499cb4ae42c 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf
+++ b/Master/texmf-dist/doc/latex/l3kernel/interface3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf
index 899311766b2..c926f2ecbd1 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf
+++ b/Master/texmf-dist/doc/latex/l3kernel/l3docstrip.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf
index b73453b63ba..1e2d94035d5 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf
+++ b/Master/texmf-dist/doc/latex/l3kernel/l3styleguide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf b/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf
index 4784aacd24e..c51cbc3a81d 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf
+++ b/Master/texmf-dist/doc/latex/l3kernel/l3syntax-changes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/source3.pdf b/Master/texmf-dist/doc/latex/l3kernel/source3.pdf
new file mode 100644
index 00000000000..aa4b66b5b2a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/l3kernel/source3.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3kernel/source3body.tex b/Master/texmf-dist/doc/latex/l3kernel/source3body.tex
index c5dbc33a7b3..92ab1fdf1d9 100644
--- a/Master/texmf-dist/doc/latex/l3kernel/source3body.tex
+++ b/Master/texmf-dist/doc/latex/l3kernel/source3body.tex
@@ -444,5 +444,6 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments.
\DocInput{l3luatex.dtx}
\DocInput{l3candidates.dtx}
+\DocInput{l3drivers.dtx}
\endinput
diff --git a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf
index 11690398396..34665dc874b 100644
--- a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf
+++ b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf
index 4928d6a76bb..65e3b946f7f 100644
--- a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf
+++ b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf
index 85ccf7a6bb3..92fd8031b13 100644
--- a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf
+++ b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf
index da45ba33d10..eb1ac41c75a 100644
--- a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf
+++ b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf
Binary files differ
diff --git a/Master/texmf-dist/makeindex/l3kernel/l3doc.ist b/Master/texmf-dist/makeindex/l3kernel/l3doc.ist
index 781c87e50f2..aec04b79c46 100644
--- a/Master/texmf-dist/makeindex/l3kernel/l3doc.ist
+++ b/Master/texmf-dist/makeindex/l3kernel/l3doc.ist
@@ -15,7 +15,7 @@
%% Do not distribute a modified version of this file.
%%
%%
-%% File: l3doc.dtx Copyright (C) 1990-2012 The LaTeX3 project
+%% File: l3doc.dtx Copyright (C) 1990-2014 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.dtx b/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.dtx
deleted file mode 100644
index 36454f14c49..00000000000
--- a/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.dtx
+++ /dev/null
@@ -1,1258 +0,0 @@
-% \iffalse meta-comment
-%
-%% File l3dt.dtx Copyright (C) 2011-2013 The LaTeX3 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 released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-%
-%<*driver|package>
-\RequirePackage{expl3}
-\GetIdInfo$Id: l3dt.dtx 4482 2013-04-24 21:05:12Z joseph $
- {L3 Experimental data tables}
-%</driver|package>
-%<*driver>
-\documentclass[full]{l3doc}
-\begin{document}
- \DocInput{\jobname.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-% \title{^^A
-% The \pkg{l3dt} package\\ Data tables^^A
-% \thanks{This file describes v\ExplFileVersion,
-% last revised \ExplFileDate.}^^A
-% }
-%
-% \author{^^A
-% The \LaTeX3 Project\thanks
-% {^^A
-% E-mail:
-% \href{mailto:latex-team@latex-project.org}
-% {latex-team@latex-project.org}^^A
-% }^^A
-% }
-%
-% \date{Released \ExplFileDate}
-%
-% \maketitle
-%
-% \begin{documentation}
-%
-% \LaTeX3 implements a \enquote{data table} variable type, which is made up of
-% a series of rows each of which contain a number of key--value pairs. Thus
-% a data table is in effect an array of property lists. The rows of the table
-% are stored in a fixed order, and are numbered consecutively from one.
-% In the same way, the order of keys (columns) is recorded in a sequence-like
-% manner, again indexed from one.
-%
-% Within each row in a data table each entry must have a unique \meta{key}: if
-% an entry is added to a row within a data table which already contains the
-% \meta{key} then the new entry will overwrite the existing one. The
-% \meta{keys} are compared on a string basis, using the same method as
-% \cs{str_if_eq:nn}.
-%
-% \section{Creating and initialising data tables}
-%
-% \begin{function}{\dt_new:N}
-% \begin{syntax}
-% \cs{dt_new:N} \meta{data table}
-% \end{syntax}
-% Creates a new \meta{data table} or raises an error if the name is
-% already taken. The declaration is global. The \meta{property lists} will
-% initially contain no entries.
-% \end{function}
-%
-% \begin{function}{\dt_clear:N, \dt_gclear:N}
-% \begin{syntax}
-% \cs{dt_clear:N} \meta{data table}
-% \end{syntax}
-% Clears all entries and keys from the \meta{data table}.
-% \end{function}
-%
-% \begin{function}{\dt_clear_new:N, \dt_gclear_new:N}
-% \begin{syntax}
-% \cs{dt_clear_new:N} \meta{data table}
-% \end{syntax}
-% Ensures that the \meta{data table} exists globally by applying
-% \cs{dt_new:N} if necessary, then applies \cs{dt_(g)clear:N} to leave
-% the table empty.
-% \end{function}
-%
-% \begin{function}{\dt_set_eq:NN, \dt_gset_eq:NN}
-% \begin{syntax}
-% \cs{dt_set_eq:NN} \meta{data table1} \meta{data table2}
-% \end{syntax}
-% Sets the content of \meta{data table1} equal to that of
-% \meta{data table2}.
-% \end{function}
-%
-% \section{Adding data}
-%
-% \begin{function}{\dt_add_key:Nn, \dt_gadd_key:Nn}
-% \begin{syntax}
-% \cs{dt_add_key:Nn} \meta{dt} \Arg{key}
-% \end{syntax}
-% Adds the \meta{key} to the list of those in the \meta{data table}. The
-% \meta{key} will be converted to a string using \cs{tl_to_str:n}, and thus
-% category codes in the \meta{key} are ignored. If the \meta{key} is already
-% present in the \meta{data table} then no action is taken.
-% \end{function}
-%
-% \begin{function}{\dt_add_row:N, \dt_gadd_row:N}
-% \begin{syntax}
-% \cs{dt_add_row:N} \meta{dt}
-% \end{syntax}
-% Adds a new row to the \meta{data table}. This will initially contain
-% no entries: all keys will be blank.
-% \end{function}
-%
-% \begin{function}{\dt_put:Nnn, \dt_gput:Nnn}
-% \begin{syntax}
-% \cs{dt_put:Nnn} \meta{dt} \Arg{key} \Arg{value}
-% \end{syntax}
-% Adds an entry to the current row of the \meta{data table} which may be
-% accessed using the \meta{key} and which has \meta{value}. Both the
-% \meta{key} and \meta{value} may contain any \meta{balanced text}. The
-% \meta{key} is stored after processing with \cs{tl_to_str:n}, meaning
-% that category codes are ignored. If the \meta{key} is already present
-% in the current row of the \meta{data table}, the existing entry is
-% overwritten by the new \meta{value}.
-% \end{function}
-%
-% \begin{function}{\dt_put:Nnnn, \dt_gput:Nnnn}
-% \begin{syntax}
-% \cs{dt_put:Nnnn} \meta{dt} \Arg{row} \Arg{key} \Arg{value}
-% \end{syntax}
-% Adds an entry to the \meta{row} of the \meta{data table} which may be
-% accessed using the \meta{key} and which has \meta{value}. Both the
-% \meta{key} and \meta{value} may contain any \meta{balanced text}. The
-% \meta{key} is stored after processing with \cs{tl_to_str:n}, meaning
-% that category codes are ignored. If the \meta{key} is already present
-% in the \meta{row} of the \meta{data table}, the existing entry is
-% overwritten by the new \meta{value}. The \meta{row} should be given as
-% an \meta{integer expression}.
-% \end{function}
-%
-% \section{Removing data}
-%
-% \begin{function}{\dt_remove:Nn, \dt_gremove:Nn}
-% \begin{syntax}
-% \cs{dt_remove:Nn} \meta{dt} \Arg{key}
-% \end{syntax}
-% Deletes any entry from the current row of the \meta{data table} with
-% the \meta{key}. The \meta{key} is compared after processing with
-% \cs{tl_to_str:n}, meaning that category codes are ignored. Deleting of
-% all entries from a row does not delete the row itself.
-% \end{function}
-%
-% \begin{function}{\dt_remove:Nnn, \dt_gremove:Nnn}
-% \begin{syntax}
-% \cs{dt_remove:Nnn} \meta{dt} \Arg{row} \Arg{key}
-% \end{syntax}
-% Deletes any entry from the \meta{row} of the \meta{data table} with
-% the \meta{key}. The \meta{key} is compared after processing with
-% \cs{tl_to_str:n}, meaning that category codes are ignored. The \meta{row}
-% may be given as an \meta{integer expression}. Deleting of
-% all entries from a row does not delete the row itself.
-% \end{function}
-%
-% \begin{function}{\dt_remove_key:Nn, \dt_gremove_key:Nn}
-% \begin{syntax}
-% \cs{dt_remove_key:N} \meta{data table} \Arg{key}
-% \end{syntax}
-% Removes the \meta{key} from the \meta{data table} if it is present.
-% The \meta{key} and any associated \meta{value} will be removed from any
-% row that it is found in.
-% \end{function}
-%
-% \begin{function}{\dt_remove_row:Nn, \dt_gremove_row:Nn}
-% \begin{syntax}
-% \cs{dt_remove_row:Nn} \meta{data table} \Arg{row}
-% \end{syntax}
-% Removes the \meta{row} (given as an \meta{integer expressions}) from the
-% \meta{data table}. The remaining rows of the table will be renumbered
-% such that they are sequential.
-% \end{function}
-%
-% \section{Recovering information}
-%
-% \begin{function}[EXP]{\dt_keys:N}
-% \begin{syntax}
-% \cs{dt_keys:N} \meta{dt}
-% \end{syntax}
-% Leaves the number of keys in the \meta{data table} in the input
-% stream as an \meta{integer denotation}.
-% \end{function}
-%
-% \begin{function}[EXP]{\dt_rows:N}
-% \begin{syntax}
-% \cs{dt_rows:N} \meta{dt}
-% \end{syntax}
-% Leaves the number of rows in the \meta{data table} in the input
-% stream as an \meta{integer denotation}.
-% \end{function}
-%
-% \begin{function}{\dt_get:NnN}
-% \begin{syntax}
-% \cs{dt_get:NnnN} \meta{dt} \Arg{key} \meta{tl var}
-% \end{syntax}
-% Recovers the \meta{value} stored with \meta{key} from the current row in
-% the \meta{data table}, and places this in the \meta{token list variable}.
-% If the \meta{key} is not found in the \meta{row} of the \meta{data table}
-% then the \meta{token list variable} will contain the special marker
-% \cs{q_no_value}. The \meta{token list variable} is set within the
-% current \TeX{} group. The \meta{row} should be given as an
-% \meta{integer expression}. See also \cs{dt_get:NnNTF}.
-% \end{function}
-%
-% \begin{function}[TF]{\dt_get:NnN}
-% \begin{syntax}
-% \cs{dt_get:NnnNTF} \meta{dt} \Arg{key} \meta{tl var} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Recovers the \meta{value} stored with \meta{key} from the current row in
-% the \meta{data table}, and places this in the \meta{token list variable}.
-% If the \meta{key} is not found in the \meta{row} of the \meta{data table}
-% then the \meta{token list variable} will contain the special marker
-% \cs{q_no_value}. The \meta{token list variable} is set within the
-% current \TeX{} group. The \meta{row} should be given as an
-% \meta{integer expression}. Once the \meta{token list variable} has been
-% assigned either the \meta{true code} or \meta{false code} will be left in
-% the input stream, depending on whether the \meta{key} was found.
-% See also \cs{dt_get:NnN}.
-% \end{function}
-%
-% \begin{function}{\dt_get:NnnN}
-% \begin{syntax}
-% \cs{dt_get:NnnN} \meta{dt} \Arg{row} \Arg{key} \meta{tl var}
-% \end{syntax}
-% Recovers the \meta{value} stored with \meta{key} from \meta{row} in the
-% \meta{data table}, and places this in the \meta{token list variable}. If
-% the \meta{key} is not found in the \meta{row} of the \meta{data table}
-% then the \meta{token list variable} will contain the special marker
-% \cs{q_no_value}. The \meta{token list variable} is set within the
-% current \TeX{} group. The \meta{row} should be given as an
-% \meta{integer expression}. See also \cs{dt_get:NnnNTF}.
-% \end{function}
-%
-% \begin{function}[TF]{\dt_get:NnnN}
-% \begin{syntax}
-% \cs{dt_get:NnnNTF} \meta{dt} \Arg{row} \Arg{key} \meta{tl var} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Recovers the \meta{value} stored with \meta{key} from \meta{row} in the
-% \meta{data table}, and places this in the \meta{token list variable}. If
-% the \meta{key} is not found in the \meta{row} of the \meta{data table}
-% then the \meta{token list variable} will contain the special marker
-% \cs{q_no_value}. The \meta{token list variable} is set within the
-% current \TeX{} group. The \meta{row} should be given as an
-% \meta{integer expression}. Once the \meta{token list variable} has been
-% assigned either the \meta{true code} or \meta{false code} will be left in
-% the input stream, depending on whether the \meta{key} was found.
-% See also \cs{dt_get:NnnN}.
-% \end{function}
-%
-% \section{Mapping to data tables}
-%
-% \begin{function}{\dt_map_variables:Nnn}
-% \begin{syntax}
-% \cs{dt_map_variables:Nnn} \meta{data table} \Arg{key--variable mapping} \Arg{code}
-% \end{syntax}
-% Applies the \meta{code} to each \meta{row} of the \meta{data table}. The
-% \meta{keys} of the \meta{data table} are mapped to variables by the
-% \meta{key--variable mapping}, which should be a key--value list of the form
-% \begin{verbatim}
-% key-a = \l_a_tl ,
-% key-b = \l_b_tl
-% ...
-% \end{verbatim}
-% It is not necessary to map all of the \meta{keys} in a \meta{data table}
-% to variables. If there is not \meta{value} for a \meta{key} in a row,
-% the variable will contain the marker \cs{q_no_value}. Assignment of the
-% \meta{variables} is local to the current \TeX{} group. The mapping
-% to rows is ordered.
-% \end{function}
-%
-% \begin{variable}{\g_dt_map_level_int}
-% The nesting level of the data table mapping is available as
-% \cs{g_dt_map_level_int}. Within a mapping, the \texttt{int} variable
-% \cs{l_dt_map_\meta{level}_row_int} is available so that the row
-% number being operated on is available. Thus
-% \begin{verbatim}
-% \int_use:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int }
-% \end{verbatim}
-% will give the current row for the current mapping.
-% \end{variable}
-%
-% \begin{function}[rEXP]{\dt_map_break:, \dt_map_break:n}
-% \begin{syntax}
-% \cs{dt_map_break:}
-% \cs{dt_map_break:n} \Arg{tokens}
-% \end{syntax}
-% Used to terminate a \cs{dt_map_\ldots} function before all
-% entries in the \meta{data table} have been processed. This will
-% normally take place within a conditional statement, for example
-% \begin{verbatim}
-% \dt_map_variables:Nn \l_my_dt { a = \l_my_tl }
-% {
-% \str_if_eq:VnTF \l_my_tl { bingo }
-% { \dt_map_break: }
-% {
-% % Do something useful
-% }
-% }
-% \end{verbatim}
-% The \texttt{:n} variant will insert the \meta{tokens} into the input stream
-% after the mapping terminates. Use outside of a \cs{dt_map_\ldots} scenario
-% will lead to low level \TeX{} errors.
-% \end{function}
-%
-% \section{Data table conditionals}
-%
-% \begin{function}[EXP, pTF]{\dt_if_empty:N}
-% \begin{syntax}
-% \cs{dt_if_empty_p:N} \meta{dt}
-% \cs{dt_if_empty:NTF} \meta{dt} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the \meta{dt} is empty, containing no keys and no rows.
-% \end{function}
-%
-% \begin{function}[EXP, pTF]{\dt_if_in:Nn}
-% \begin{syntax}
-% \cs{dt_if_in_p:Nn} \meta{dt} \Arg{key}
-% \cs{dt_if_in:NnTF} \meta{dt} \Arg{key} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the \meta{key} is present in the \meta{data table} at all,
-% \emph{i.e.} if it is one of the columns of the table. This test will be
-% \texttt{true} even if none of the rows contain an entry for the \meta{key}.
-% \end{function}
-%
-% \begin{function}[EXP, pTF]{\dt_if_in_row:Nnn}
-% \begin{syntax}
-% \cs{dt_if_in_row_p:Nnn} \meta{dt} \Arg{row} \Arg{key}
-% \cs{dt_if_in_row:NnnTF} \meta{dt} \Arg{row} \Arg{key} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the \meta{key} is present in the \meta{row} of the
-% \meta{data table}. The \meta{row} may be given as an \meta{integer
-% expression}.
-% \end{function}
-%
-% \begin{function}[EXP, pTF]{\dt_if_in_row:Nn}
-% \begin{syntax}
-% \cs{dt_if_in_row_p:Nn} \meta{dt} \Arg{key}
-% \cs{dt_if_in_row:NnTF} \meta{dt} \Arg{key} \Arg{true code} \Arg{false code}
-% \end{syntax}
-% Tests if the \meta{key} is present in the current row of
-% \meta{data table}.
-% \end{function}
-%
-% \section{Variables}
-%
-% \begin{variable}{\c_empty_dt}
-% A permanently empty data table.
-% \end{variable}
-%
-% \begin{variable}{\l_tmpa_dt, \l_tmpb_dt, \g_tmpa_dt, \g_tmpb_dt}
-% Scratch data tables for general use: these are never used by the kernel.
-% \end{variable}
-%
-% \end{documentation}
-%
-% \begin{implementation}
-%
-% \section{\pkg{l3dt} implementation}
-%
-% \begin{macrocode}
-%<*initex|package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=dt>
-% \end{macrocode}
-%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-%</package>
-% \end{macrocode}
-%
-% \subsection{Structures}
-%
-% The structure of a data table must allow each row (record) to contain only
-% some of the keys, and for the keys to be removed after the table
-% is initialised. It also needs to ensure that a unique match can be made to
-% every item in the table. At the same time, it is desirable to keep all of
-% the information about the table in a single \TeX{} macro. This can be
-% achieved by packing the data into a structure in which each key and row is
-% numbered:
-% \begin{quote}
-% \Arg{rows} \\
-% \Arg{columns} \\
-% \cs{q_@@} \meta{key_1} \cs{q_@@} \meta{key_2} \cs{q_@@} \ldots \\
-% \cs{q_nil} \\
-% \cs{q_@@_header} \\
-% \cs{q_@@_row} \\
-% \meta{row_1} \\
-% \cs{q_@@} \meta{key_1} \cs{q_@@} \Arg{data_{1,1}} \\
-% \cs{q_@@} \meta{key_2} \cs{q_@@} \Arg{data_{1,2}} \\
-% \ldots \\
-% \cs{q_@@} \\
-% \cs{q_nil} \\
-% \cs{q_@@_row} \\
-% \meta{row_2} \\
-% \cs{q_@@} \meta{key_1} \cs{q_@@} \Arg{data_{2,1}} \\
-% \cs{q_@@} \meta{key_2} \cs{q_@@} \Arg{data_{2,2}} \\
-% \ldots \\
-% \cs{q_@@} \\
-% \cs{q_nil} \\
-% \cs{q_@@_row} \\
-% \ldots \\
-% \cs{q_@@_row}
-% \end{quote}
-%
-% \begin{variable}{\q_@@, \q_@@_row, \q_@@_header}
-% The quarks are set up.
-% \begin{macrocode}
-\quark_new:N \q_@@
-\quark_new:N \q_@@_row
-\quark_new:N \q_@@_header
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{variable}{\c_empty_dt}
-% A permanently-empty data table, which therefore contains only the minimum
-% number of items necessary to comply with the structure above.
-% \begin{macrocode}
-\tl_const:Nn \c_empty_dt
- {
- { 0 }
- { 0 }
- \q_@@
- \q_nil
- \q_@@_header
- \q_@@_row
- }
-% \end{macrocode}
-% \end{variable}
-%
-% \subsection{Allocation and initialisation}
-%
-% \begin{macro}{\dt_new:N}
-% Internally, data tables are token lists, but an empty dt
-% is not an empty tl.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_new:N #1 { \cs_new_eq:NN #1 \c_empty_dt }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\dt_clear:N, \dt_gclear:N}
-% The same idea for clearing.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_clear:N #1 { \cs_set_eq:NN #1 \c_empty_dt }
-\cs_new_protected:Npn \dt_gclear:N #1 { \cs_gset_eq:NN #1 \c_empty_dt }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}
-% {\dt_clear_new:N, \dt_gclear_new:N}
-% Once again a simple copy from the token list functions.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_clear_new:N #1
- { \cs_if_exist:NTF #1 { \dt_clear:N #1 } { \dt_new:N #1 } }
-\cs_new_protected:Npn \dt_gclear_new:N #1
- { \cs_if_exist:NTF #1 { \dt_gclear:N #1 } { \dt_new:N #1 } }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\dt_set_eq:NN, \dt_gset_eq:NN}
-% Once again, these are simply copies from the token list functions.
-% \begin{macrocode}
-\cs_new_eq:NN \dt_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \dt_gset_eq:NN \tl_gset_eq:NN
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{variable}{\l_tmpa_dt, \l_tmpb_dt, \g_tmpa_dt, \g_tmpb_dt}
-% Scratch tables.
-% \begin{macrocode}
-\dt_new:N \l_tmpa_dt
-\dt_new:N \l_tmpb_dt
-\dt_new:N \g_tmpa_dt
-\dt_new:N \g_tmpb_dt
-% \end{macrocode}
-% \end{variable}
-%
-% \subsection{Splitting functions}
-%
-% \begin{macro}[aux]{\@@_split:nnnn}
-% \begin{macro}[aux]{\@@_split:w}
-% Two general auxiliaries. The \texttt{nnnn} function is used to apply the
-% \texttt{T} branch if a match is found and the \texttt{F} branch otherwise.
-% The \texttt{w} function is general purpose, and is used to define the
-% matching parameter set.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_split:nnnn #1#2#3#4 { #3 #2 }
-\cs_new_protected:Npn \@@_split:w { }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[int,EXP]{\@@_split_header:NT}
-% \begin{macro}[aux,EXP]{\@@_split_header:wn}
-% Splits the header from the table, inserting the code required to then
-% process the split table. The \cs{q_nil} is also removed from the end of the
-% header, as it is essentially a distraction here.
-% \begin{macrocode}
-\cs_new:Npn \@@_split_header:NT #1#2
- { \exp_after:wN \@@_split_header:wn #1 \q_stop {#2} }
-\cs_new:Npn \@@_split_header:wn #1 \q_nil \q_@@_header #2 \q_stop #3
- { #3 {#1} { \q_@@_header #2 } }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[int]{\@@_split_key:nnTF}
-% \begin{macro}[aux]{\@@_split_key_aux:nnTF}
-% Here, the split is made for a partial list within a row. The row is
-% basically the same as a property list, so the split here is almost
-% identical to that in \cs{prop_split_aux:NnTF}. The row-end data is set up
-% such that it will not interfere with this process.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_split_key:nnTF #1#2
- { \exp_args:No \@@_split_key_aux:nnTF { \tl_to_str:n {#2} } {#1} }
-\cs_new_protected:Npn \@@_split_key_aux:nnTF #1#2
- {
- \cs_set_protected:Npn \@@_split:w
- ##1 \q_@@ #1 \q_@@ ##2##3##4 \q_mark ##5 \q_stop
- { \@@_split:nnnn ##3 { { ##1 \q_@@ } {##2} {##4} } }
- \@@_split:w #2 \q_mark
- \q_@@ #1 \q_@@ { } { ? \use_ii:nn { } } \q_mark \q_stop
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[int]{\@@_split_key_list:NnTF}
-% \begin{macro}[aux]{\@@_split_key_list_aux:NnTF}
-% Finding a key in the header uses a similar approach to finding a key in
-% a property list. Here, if the key is found there will always be at least
-% one token between \cs{q_@@} and \cs{q_@@_header} due to the \cs{q_nil}
-% which is part of a new table. The use of |##1##2##3| in \cs{@@_split:w}
-% here is to deal with the overall number of rows and keys. The set up here
-% means that these will always be unbraced then rebraced: simply grabbing
-% |##1##2| to include this and anything before the key of interest will give
-% variable results depending on whether the match is to the very first key or not.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_split_key_list:NnTF #1#2
- { \exp_args:NNo \@@_split_key_list_aux:NnTF #1 { \tl_to_str:n {#2} } }
-\cs_new_protected:Npn \@@_split_key_list_aux:NnTF #1#2
- {
- \cs_set_protected:Npn \@@_split:w
- ##1##2##3 \q_@@ #2 \q_@@ ##4##5 \q_@@_header ##6 \q_mark ##7 \q_stop
- {
- \@@_split:nnnn ##4
- { { {##1} {##2} ##3 \q_@@ } { ##4##5 \q_@@_header ##6 } }
- }
- \exp_after:wN \@@_split:w #1 \q_mark
- \q_@@ #2 \q_@@ { ? \use_ii:nn { } } \q_@@_header \q_mark \q_stop
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[int]{\@@_split_row:NnTF}
-% \begin{macro}[aux]{\@@_split_row_aux:NnTF, \@@_split_row_aux:NfTF}
-% The usual approach, here using the fact that each row start with row number
-% and ends with \cs{q_nil} so there will always be at least one token to be
-% absorbed as |##2|. The only odd thing to watch here is that the row
-% number is evaluated so that higher-level functions in the main do not
-% need to have an \texttt{f}-type variant.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_split_row:NnTF #1#2
- { \@@_split_row_aux:NfTF #1 { \int_eval:n {#2} } }
-\cs_new_protected:Npn \@@_split_row_aux:NnTF #1#2
- {
- \cs_set_protected:Npn \@@_split:w
- ##1 \q_@@_row #2 \q_@@ ##2##3 \q_@@_row ##4 \q_mark ##5 \q_stop
- {
- \@@_split:nnnn ##2
- { { ##1 \q_@@_row } { #2 \q_@@ ##2##3 } {##4} }
- }
- \exp_after:wN \@@_split:w #1 \q_mark
- \q_@@_row #2 \q_@@ { ? \use_ii:nn { } } \q_@@_row \q_mark \q_stop
- }
-\cs_generate_variant:Nn \@@_split_row_aux:NnTF { Nf }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Adding and removing data}
-%
-% \begin{macro}{\dt_add_key:Nn, \dt_gadd_key:Nn}
-% \begin{macro}[aux]{\@@_add_key:NNn}
-% \begin{macro}[aux]{\@@_add_key:NNnnn}
-% \begin{macro}[aux]{\@@_add_key:NNnnn}
-% Here, there are two stages. If the key is already present in the list of
-% known keys then no action is taken, and the split list is thrown away.
-% On the other hand, if the key is not present then the header and body
-% are separated and the key is added to the end of the list of known keys
-% (hence keys are ordered). The \cs{@@_split_header:Nn} function will have
-% removed the \cs{q_nil} from the header, and so it is put back in here.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_add_key:Nn { \@@_add_key:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gadd_key:Nn { \@@_add_key:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \@@_add_key:NNn #1#2#3
- {
- \@@_split_key_list:NnTF #2 {#3}
- { \use_none:nn }
- {
- \@@_split_header:NT #2
- { \@@_add_key:NNnnn #1 #2 {#3} }
- }
- }
-\cs_new_protected:Npn \@@_add_key:NNnnn #1#2#3#4#5
- { \@@_add_key:NNnnnwnn #1 #2 #4 \q_stop {#3} {#5} }
-\cs_new_protected:Npn \@@_add_key:NNnnnwnn #1#2#3#4#5 \q_stop #6#7
- {
- #1 #2
- {
- {#3}
- { \int_eval:n { #4 + \c_one } }
- \exp_not:n {#5}
- \tl_to_str:n {#6}
- \exp_not:n { \q_@@ \q_nil #7 }
- }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dt_add_row:N, \dt_gadd_row:N}
-% \begin{macro}[aux]{\@@_add_row:NN}
-% \begin{macro}[aux]{\@@_add_row:NnN, \@@_add_row:NfN}
-% \begin{macro}[aux,EXP]{\@@_add_row:nw}
-% Adding a row means incrementing the total number and adding the structure
-% of an empty row. As finding the rows will get slow for large tables, this
-% is only done once.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_add_row:N { \@@_add_row:NN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gadd_row:N { \@@_add_row:NN \tl_gset:Nx }
-\cs_new_protected:Npn \@@_add_row:NN #1#2
- { \@@_add_row:NfN #1 { \int_eval:n { \dt_rows:N #2 + \c_one } } #2 }
-\cs_new_protected:Npn \@@_add_row:NnN #1#2#3
- {
- #1 #3
- {
- {#2}
- \exp_after:wN \@@_add_row:nw #3 \q_stop
- #2
- \exp_not:n { \q_@@ \q_nil \q_@@_row }
- }
- }
-\cs_generate_variant:Nn \@@_add_row:NnN { Nf }
-\cs_new:Npn \@@_add_row:nw #1#2 \q_stop { \exp_not:n {#2} }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dt_put:Nnn, \dt_gput:Nnn}
-% Adding to the current row is simply a special case of adding to an
-% arbitrary row.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_put:Nnn #1
- { \dt_put:Nnnn #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_gput:Nnn #1
- { \dt_gput:Nnnn #1 { \dt_rows:N #1 } }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\dt_put:Nnnn, \dt_gput:Nnnn}
-% \begin{macro}[aux]{\@@_put:NNNnnn}
-% \begin{macro}[aux]{\@@_put:NNnnnnn}
-% \begin{macro}[aux]{\@@_put_update:NNnnnnnnn}
-% \begin{macro}[aux]{\@@_put_add_to_row:NNnnnnn}
-% \begin{macro}[aux, EXP]{\@@_put_add_to_row_aux:w}
-% Adding to a row is a slightly complex procedure. The lead-off is the
-% standard combination across the local and global routes.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_put:Nnnn
- { \@@_put:NNNnnn \dt_add_key:Nn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gput:Nnnn
- { \@@_put:NNNnnn \dt_gadd_key:Nn \tl_gset:Nx }
-% \end{macrocode}
-% Add the key to the list those known, if necessary, then check that the
-% row requested makes sense.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_put:NNNnnn #1#2#3#4#5#6
- {
- #1 #3 {#5}
- \@@_split_row:NnTF #3 {#4}
- { \@@_put:NNnnnnn #2 #3 {#5} {#6} }
- {
- \__msg_kernel_error:nnxxx { dt } { unknown-row }
- { \token_to_str:N #3 } { \int_eval:n {#4} } { \dt_rows:N #3 }
- }
- }
-% \end{macrocode}
-% At this stage, the arguments are
-% \begin{enumerate}
-% \item the set function \cs{tl_(g)set:Nx},
-% \item the data table,
-% \item the key,
-% \item the value,
-% \item the data table before the row,
-% \item the extracted data table row,
-% \item the data table after the row.
-% \end{enumerate}
-% Splitting on the key will then leave three further items in the input
-% stack if the key is already present. So there is some care needed sending
-% the parameters forward without running out of \TeX{} arguments.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_put:NNnnnnn #1#2#3#4#5#6#7
- {
- \@@_split_key:nnTF {#6} {#3}
- { \@@_put_update:NNnnnnnnn #1 #2 {#3} {#4} {#5} {#7} }
- { \@@_put_add_to_row:NNnnnnn #1 #2 {#3} {#4} {#5} {#6} {#7} }
- }
-% \end{macrocode}
-% The arguments here are
-% \begin{enumerate}
-% \item the set function \cs{tl_(g)set:Nx},
-% \item the data table,
-% \item the key,
-% \item the value,
-% \item the data table before the row,
-% \item the data table after the row,
-% \item the row before the key,
-% \item the current value for the key
-% \item the row after the key.
-% \end{enumerate}
-% What happens here is a reconstruction of the table: everything except
-% |#8| is needed. To try to keep things clear, there are a few more
-% \cs{exp_not:n} here than formally required.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_put_update:NNnnnnnnn #1#2#3#4#5#6#7#8#9
- {
- #1 #2
- {
- \exp_not:n { #5 #7 }
- \tl_to_str:n {#3}
- \exp_not:n { \q_@@ {#4} \q_@@ #9 \q_@@_row #6 }
- }
- }
-% \end{macrocode}
-% A slightly more complex case when adding an item. The arguments here are
-% identical to those for \cs{@@_put:NNnnnnnn}. The row has not been
-% split, so the \cs{q_nil} there is removed and re-added to come after the
-% new content.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_put_add_to_row:NNnnnnn #1#2#3#4#5#6#7
- {
- #1 #2
- {
- \exp_not:n {#5}
- \exp_not:o { \@@_put_add_to_row_aux:w #6 }
- \tl_to_str:n {#3}
- \exp_not:n { \q_@@ {#4} \q_@@ \q_nil \q_@@_row #7 }
- }
- }
-\cs_new:Npn \@@_put_add_to_row_aux:w #1 \q_nil {#1}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\dt_keys:N}
-% \begin{macro}[EXP, aux]{\@@_keys:nnw}
-% \begin{macro}[EXP]{\dt_rows:N}
-% The number of rows in a dt is the very first entry. Getting the number of
-% keys is almost the same, except a custom auxiliary is needed.
-% \begin{macrocode}
-\cs_new:Npn \dt_keys:N #1 { \exp_after:wN \@@_keys:nnw #1 \q_stop }
-\cs_new:Npn \@@_keys:nnw #1#2#3 \q_stop {#2}
-\cs_new:Npn \dt_rows:N #1
- { \exp_after:wN \use_i_delimit_by_q_stop:nw #1 \q_stop }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Removing data}
-%
-% \begin{macro}{\dt_remove:Nn,\dt_gremove:Nn}
-% Deleting to the current row is simply a special case of deleting to an
-% arbitrary row.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_remove:Nn #1
- { \dt_remove:Nnn #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_gremove:Nn #1
- { \dt_gremove:Nnn #1 { \dt_rows:N #1 } }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\dt_remove:Nnn, \dt_gremove:Nnn}
-% \begin{macro}[aux]{\dt_remove_aux:NNnn}
-% \begin{macro}[aux]{\dt_remove_aux:NNnnnn}
-% \begin{macro}[aux]{\dt_remove_aux:NNnnnnn}
-% Deleting a single entry from a single row means first splitting by row,
-% then splitting by key, and finally doing the assignment. If the row or the
-% key are not present then the entire function does nothing at all.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_remove:Nnn { \dt_remove_aux:NNnn \tl_set:Nn }
-\cs_new_protected_nopar:Npn \dt_gremove:Nnn { \dt_remove_aux:NNnn \tl_gset:Nn }
-\cs_new_protected:Npn \dt_remove_aux:NNnn #1#2#3#4
- {
- \@@_split_row:NnTF #2 {#3}
- { \dt_remove_aux:NNnnnn #1 #2 {#4} }
- { }
- }
-\cs_new_protected:Npn \dt_remove_aux:NNnnnn #1#2#3#4#5#6
- {
- \@@_split_key:nnTF {#5} {#3}
- { \dt_remove_aux:NNnnnnn #1 #2 {#4} {#6} }
- { }
- }
-\cs_new_protected:Npn \dt_remove_aux:NNnnnnn #1#2#3#4#5#6#7
- { #1 #2 { #3 #5 #7 #4 } }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dt_remove_key:Nn, \dt_gremove_key:Nn}
-% \begin{macro}[aux]{\dt_remove_key_aux:NNn}
-% \begin{macro}[aux]{\dt_remove_key_aux:nNNnn}
-% \begin{macro}[aux, EXP]{\dt_remove_key_aux:w}
-% Deleting a key also removes from the table itself, so that there is no
-% need to do any awkward checks when extracting data from the table. (It's
-% likely that there will be more cases of accessing data than deleting
-% rows). The deletion mapping ignores rows entirely and just pulls out
-% matching key--value pairs, as this reduces the number of matches needed
-% to a minimum.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_remove_key:Nn
- { \dt_remove_key_aux:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gremove_key:Nn
- { \dt_remove_key_aux:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \dt_remove_key_aux:NNn #1#2#3
- {
- \@@_split_key_list:NnTF #2 {#3}
- { \exp_args:No \dt_remove_key_aux:nNNnn { \tl_to_str:n {#3} } #1 #2 }
- { }
- }
-\cs_new_protected:Npn \dt_remove_key_aux:nNNnn #1#2#3#4#5
- { \dt_remove_key_aux:nNNnnwn {#1} #2 #3 #4 \q_stop {#5} }
-\cs_new_protected:Npn \dt_remove_key_aux:nNNnnwn #1#2#3#4#5#6 \q_stop #7
- {
- \cs_set:Npn \dt_remove_key_aux:w ##1 \q_@@ #1 \q_@@ ##2 ##3
- {
- \exp_not:n {##1}
- \__quark_if_recursion_tail_break:nN {##3} \dt_map_break:
- \dt_remove_key_aux:w ##3
- }
-
- #2 #3
- {
- {#4}
- { \int_eval:n { #5 - \c_one } }
- \exp_not:n {#6}
- \dt_remove_key_aux:w #7 \q_@@ #1 \q_@@ { } \q_recursion_tail
- \__prg_break_point:Nn \dt_map_break: { }
- }
- }
-\cs_new:Npn \dt_remove_key_aux:w { }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dt_remove_row:Nn, \dt_gremove_row:Nn}
-% \begin{macro}[aux]{\dt_remove_row_aux:NNn}
-% \begin{macro}[aux]{\dt_remove_row_aux:NNnnnn}
-% \begin{macro}[aux, EXP]{\dt_remove_row_aux:nw}
-% \begin{macro}[aux, EXP]{\dt_remove_row_loop:nw}
-% Removing a row is a slightly complex operation as there are two stages.
-% The row itself is easy enough to remove, but then all later rows have to
-% be renumbers.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \dt_remove_row:Nn
- { \dt_remove_row_aux:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gremove_row:Nn
- { \dt_remove_row_aux:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \dt_remove_row_aux:NNn #1#2#3
- {
- \@@_split_row:NnTF #2 {#3}
- { \dt_remove_row_aux:NNnnn #1 #2 }
- { }
- }
-% \end{macrocode}
-% If the code gets here, then |#3| is the table before the removed row,
-% |#4| is the removed row and |#5| is everything afterwards. The first stage
-% is to work out the new number of rows, then include all of |#3| except
-% the old number of rows. The removed row |#4| is thrown away, and then there
-% is a loop to recalculate the row numbers for all of the later rows.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_remove_row_aux:NNnnn #1#2#3#4#5
- {
- #1 #2
- {
- { \int_eval:n { \dt_rows:N #2 - \c_one } }
- \dt_remove_row_aux:nw #3 \q_stop
- \dt_remove_row_loop:nw #5 \q_recursion_tail \q_@@_row
- \__prg_break_point:Nn \dt_map_break: { }
- }
- }
-\cs_new_eq:NN \dt_remove_row_aux:nw \@@_add_row:nw
-\cs_new:Npn \dt_remove_row_loop:nw #1#2 \q_@@_row
- {
- \__quark_if_recursion_tail_break:nN {#1} \dt_map_break:
- \int_eval:n { #1 - \c_one }
- \exp_not:n { #2 \q_@@_row }
- \dt_remove_row_loop:nw
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Accessing data in data tables}
-%
-% \begin{macro}{\dt_get:NnnN}
-% \begin{macro}[aux]{\dt_get_aux:nNnnn}
-% \begin{macro}[aux]{\dt_get_aux:nNnnn}
-% Recovering a value from a row means doing two splits: first find the row,
-% then find the key. Nothing exciting, just a question of tracking the
-% returned items.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_get:NnnN #1#2#3#4
- {
- \@@_split_row:NnTF #1 {#2}
- { \dt_get_aux:nNnnn {#3} #4 }
- { \tl_set:Nn #4 { \q_no_value } }
- }
-\cs_new_protected:Npn \dt_get_aux:nNnnn #1#2#3#4#5
- {
- \@@_split_key:nnTF {#4} {#1}
- { \dt_get_aux:Nnnn #2 }
- { \tl_set:Nn #2 { \q_no_value } }
- }
-\cs_new_protected:Npn \dt_get_aux:Nnnn #1#2#3#4 { \tl_set:Nn #1 {#3} }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[TF]{\dt_get:NnnN}
-% \begin{macro}[aux]{\@@_get_true:nNnnn}
-% \begin{macro}[aux]{\@@_get_true:Nnnn}
-% The same idea as the standard method, but built as a conditional.
-% \begin{macrocode}
-\prg_new_protected_conditional:Npnn \dt_get:NnnN #1#2#3#4 { T , F , TF }
- {
- \@@_split_row:NnTF #1 {#2}
- { \@@_get_true:nNnnn {#3} #4 }
- { \prg_return_false: }
- }
-\cs_new_protected:Npn \@@_get_true:nNnnn #1#2#3#4#5
- {
- \@@_split_key:nnTF {#4} {#1}
- { \@@_get_true:Nnnn #2 }
- { \prg_return_false: }
- }
-\cs_new_protected:Npn \@@_get_true:Nnnn #1#2#3#4
- {
- \tl_set:Nn #1 {#3}
- \prg_return_true:
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\dt_get:NnN}
-% \begin{macro}[TF]{\dt_get:NnN}
-% Simple wrappers.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_get:NnN #1
- { \dt_get:NnnN #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNT #1
- { \dt_get:NnnNF #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNF #1
- { \dt_get:NnnNF #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNTF #1
- { \dt_get:NnnNTF #1 { \dt_rows:N #1 } }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Mapping to data tables}
-%
-% \begin{variable}{\g_dt_map_level_int}
-% Unlike other mappings, the mapping level here has to be available
-% and so linked to the module.
-% \begin{macrocode}
-\int_new:N \g_dt_map_level_int
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}{\dt_map_variables:Nnn}
-% \begin{macro}[aux]{\@@_map_variables_key:nn}
-% \begin{macro}[aux]{\@@_map_variables:nnn}
-% \begin{macro}[aux]{\@@_map_variables:nNNw}
-% \begin{macro}[aux]{\@@_map_variables:nnw}
-% Mapping across a data table is more complex than other cases as there
-% are two \enquote{dimensions} to worry about: the rows and the keys.
-% The first stage of the mapping is to convert the key--variable mapping
-% into a sequence that can be used later. This is done with the assumption
-% that any key without a variable can simply be dropped entirely. The
-% header of the table is then split from the body.
-% \begin{macrocode}
-\cs_new_protected:Npn \dt_map_variables:Nnn #1#2#3
- {
- \int_gincr:N \g_dt_map_level_int
- \seq_gclear_new:c { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- \keyval_parse:NNn \use_none:n \@@_map_variables_key:nn {#2}
- \@@_split_header:NT #1 { \@@_map_variables:nnn {#3} }
- }
-\cs_new_protected:Npn \@@_map_variables_key:nn #1#2
- {
- \seq_gput_right:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- { {#1} #2 }
- }
-% \end{macrocode}
-% As \cs{@@_split_header:NT} will leave a couple of tokens at the front
-% of the body part of the split, there is a quick piece of tidying up
-% to remove them.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_map_variables:nnn #1#2#3
- { \@@_map_variables:nNNw {#1} #3 \q_stop }
-\cs_new_protected:Npn \@@_map_variables:nNNw
- #1 \q_@@_header \q_@@_row #2 \q_stop
- {
- \int_zero_new:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int }
- \@@_map_variables:nnw {#1} #2 { } \q_recursion_tail \q_@@_row
- \__prg_break_point:Nn \dt_map_break:
- { \int_gdecr:N \g_dt_map_level_int }
- }
-\cs_new_protected:Npn \@@_map_variables:nnw #1#2#3#4 \q_@@_row
- {
- \__quark_if_recursion_tail_break:nN {#3} \dt_map_break:
- \seq_map_inline:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- { \dt_get_aux:nNnnn ##1 { } {#3#4} { } }
- #1
- \int_incr:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int }
- \@@_map_variables:nnw {#1}
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[rEXP]{\dt_map_break:}
-% \begin{macro}[rEXP]{\dt_map_break:n}
-% The break statements use the general \cs{__prg_map_break:Nn}.
-% \begin{macrocode}
-\cs_new_nopar:Npn \dt_map_break:
- { \__prg_map_break:Nn \dt_map_break: { } }
-\cs_new_nopar:Npn \dt_map_break:n
- { \__prg_map_break:Nn \dt_map_break: }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Data table conditionals}
-%
-% \begin{macro}[pTF, EXP]{\dt_if_empty:N}
-% An empty data table has not only no rows but also no keys. (The number of
-% rows can be tested using \cs{dt_rows:N} and an \texttt{int} test.)
-% \begin{macrocode}
-\prg_new_conditional:Npnn \dt_if_empty:N #1 { T , F , TF , p }
- {
- \if_meaning:w #1 \c_empty_dt
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[pTF, EXP]{\dt_if_in:Nn}
-% \begin{macro}[aux, EXP]{\@@_if_in:nnn}
-% \begin{macro}[aux, EXP]{\@@_if_in:nwN}
-% \begin{macro}[aux, EXP]{\@@_if_in:n}
-% Expandably checking for the presence of a key in the table as a whole
-% requires a mapping to the header. The idea is the usual recursion set
-% up with a string-based comparison only after checking for the end of
-% the loop.
-% \begin{macrocode}
-\prg_new_conditional:Npnn \dt_if_in:Nn #1#2 { p , T , F , TF }
- { \@@_split_header:NT #1 { \@@_if_in:nnn {#2} } }
-\cs_new:Npn \@@_if_in:nnn #1#2#3
- {
- \exp_last_unbraced:Nno \@@_if_in:nwN {#1} { \use_none:nn #2 }
- \q_recursion_tail \q_@@
- \__prg_break_point:
- }
-\cs_new:Npn \@@_if_in:nwN #1#2 \q_@@
- {
- \if_meaning:w \q_recursion_tail #2
- \exp_after:wN \__prg_break:n
- \else:
- \exp_after:wN \use_none:n
- \fi:
- { \prg_return_false: }
- \str_if_eq:nnTF {#1} {#2}
- { \__prg_break:n { \prg_return_true: } }
- { \@@_if_in:nwN {#1} }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[pTF, EXP]{\dt_if_in_row:Nnn}
-% \begin{macro}[aux, EXP]{\@@_if_in_row:nw}
-% \begin{macro}[aux, EXP]{\@@_if_in_row:nn}
-% \begin{macro}[aux, EXP]{\@@_if_in_row:nwn}
-% \begin{macro}[aux, EXP]{\@@_if_in_row:N}
-% Finding a key in a single row in an expandable way requires two mappings.
-% To start of with, there is a search for the row. This uses for termination
-% the fact that each row starts \cs{q_@@_row} and ends \cs{q_nil}, and
-% always contains at least the row number as the first \meta{balanced
-% text}. That can be replaced by the tail marker to terminate iteration:
-% all that is then needed is the correct placement of the clean-up code.
-% \begin{macrocode}
-\prg_new_conditional:Npnn \dt_if_in_row:Nnn #1#2#3 { p , T , F , TF }
- {
- \exp_last_unbraced:Nno \@@_if_in_row:nw {#2} #1
- \q_recursion_tail \q_nil
- \__prg_break_point:
- { \tl_to_str:n {#3} }
- }
-% \end{macrocode}
-% The row iteration does a numerical comparison to see if the target row has
-% been found. That means that the row argument does not need to be converted
-% to a number earlier.
-% \begin{macrocode}
-\cs_new:Npn \@@_if_in_row:nw #1#2 \q_@@_row #3#4 \q_nil
- {
- \if_meaning:w \q_recursion_tail #3
- \exp_after:wN \__prg_break:n
- \else:
- \exp_after:wN \use_none:n
- \fi:
- {
- \use_i:nn
- \prg_return_false:
- }
- \int_compare:nNnTF {#1} = {#3}
- { \__prg_break:n { \exp_args:Nno \@@_if_in_row:nn {#4} } }
- { \@@_if_in_row:nw {#1} }
- }
-% \end{macrocode}
-% The second iteration is along the row. This is basically the same as
-% \cs{prop_if_in:NnTF} with the \cs{q_@@} in place of \cs{q__prop}.
-% \begin{macrocode}
-\cs_new:Npn \@@_if_in_row:nn #1#2
- {
- \@@_if_in_row:nwn {#2} #1 {#2} \q_@@ { } \q_recursion_tail
- \__prg_break_point:
- }
-\cs_new:Npn \@@_if_in_row:nwn #1 \q_@@ #2 \q_@@ #3
- {
- \str_if_eq_x:nnTF {#1} {#2}
- { \@@_if_in_row:N }
- { \@@_if_in_row:nwn {#1} }
- }
-\cs_new:Npn \@@_if_in_row:N #1
- {
- \if_meaning:w \q_@@ #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- \__prg_break:
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[pTF, EXP]{\dt_if_in_row:Nn}
-% Simple wrappers.
-% \begin{macrocode}
-\cs_new:Npn \dt_if_in_row_p:Nn #1
- { \dt_if_in_row_p:Nnn #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnT #1
- { \dt_if_in_row:NnnT #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnF #1
- { \dt_if_in_row:NnnF #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnTF #1
- { \dt_if_in_row:NnnTF #1 { \dt_rows:N #1 } }
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Messages}
-%
-% \begin{macrocode}
-\__msg_kernel_new:nnnn { dt } { unknown-row }
- { Data~table~#1~does~not~contain~a~row~'#2'. }
- {
- Data~table~#1~contains~#3~rows.~These~must~be~accessed~by~number:~row~
- #2~is~not~present~in~the~table.
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-%</initex|package>
-% \end{macrocode}
-%
-% \end{implementation}
-%
-% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.ins b/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.ins
deleted file mode 100644
index 54db0f43b92..00000000000
--- a/Master/texmf-dist/source/latex/l3experimental/l3dt/l3dt.ins
+++ /dev/null
@@ -1,40 +0,0 @@
-\iffalse meta-comment
-
-File l3dt.ins Copyright (C) 2011 The LaTeX3 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 "l3trial bundle" (The Work in LPPL)
-and all files in that bundle must be distributed together.
-
-The released version of this bundle is available from CTAN.
-
-\fi
-
-\input l3docstrip.tex
-\askforoverwritefalse
-
-\preamble
-
-EXPERIMENTAL CODE
-
-Do not distribute this file without also distributing the
-source files specified above.
-
-Do not distribute a modified version of this file.
-
-\endpreamble
-% stop docstrip adding \endinput
-\postamble
-\endpostamble
-
-\keepsilent
-
-\generate{\file{l3dt.sty}{\from{l3dt.dtx}{package}}}
-
-\endbatchfile
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx
index 90a2575bcd0..17c2b53a187 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3str.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3str.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str.dtx 4576 2013-07-24 21:40:24Z joseph $
+\GetIdInfo$Id: l3str.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental strings}
%</driver|package>
%<*driver>
@@ -66,7 +66,7 @@
% \date{Released \ExplFileDate}
%
% \maketitle
-%
+%
% \tableofcontents
%
% \begin{documentation}
@@ -112,40 +112,6 @@
% |\|\meta{character}.
% \end{variable}
%
-% \begin{function}[EXP]{\tl_to_str:N, \tl_to_str:n}
-% \begin{syntax}
-% \cs{tl_to_str:N} \meta{tl var}
-% \cs{tl_to_str:n} \Arg{token list}
-% \end{syntax}
-% Converts the \meta{token list} to a \meta{string}, leaving the
-% resulting character tokens in the input stream.
-% \begin{texnote}
-% Converting a \meta{token list} to a \meta{string} yields a
-% concatenation of the string representations of every token in the
-% \meta{token list}.
-% The string representation of a control sequence is
-% \begin{itemize}
-% \item an escape character, whose character code is given by the
-% internal parameter \tn{escapechar}, absent if the
-% \tn{escapechar} is negative;
-% \item the control sequence name, as defined by \cs{cs_to_str:N};
-% \item a space, unless the control sequence name is a single
-% character whose category at the time of expansion of
-% \cs{tl_to_str:n} is not \enquote{letter}.
-% \end{itemize}
-% The string representation of an explicit character token is that
-% character, doubled in the case of (explicit) macro parameter
-% characters (normally |#|).
-% In particular, the string representation of a token list may
-% depend on the category codes in effect when it is evaluated, and
-% the value of the \tn{escapechar}: for instance |\tl_to_str:n {\a}|
-% normally produces the three character \enquote{backslash},
-% \enquote{lower-case a}, \enquote{space}, but it may also produce a
-% single \enquote{lower-case a} if the escape character is negative
-% and \texttt{a} is currently not a letter.
-% \end{texnote}
-% \end{function}
-%
% \begin{function}{\str_new:N, \str_new:c}
% \begin{syntax}
% \cs{str_new:N} \meta{str~var}
diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
index 1d2a22efea3..8efec4fc252 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: xcoffins.dtx Copyright(C) 2010,2011 The LaTeX3 Project
+%% File: xcoffins.dtx Copyright(C) 2010-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -36,13 +36,13 @@
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: xcoffins.dtx 4029 2012-07-29 18:16:03Z bruno $
+\GetIdInfo$Id: xcoffins.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental design-level coffins}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
\usepackage{xcoffins} % Not yet part of expl3, so not in l3doc
-\usepackage{xcolor} % As coffins only loads basic colour support
+\usepackage{xcolor} % As coffins only loads basic color support
\NewCoffin \ExampleCoffin
\NewCoffin \SmallCoffin
\NewCoffin \OutputCoffin
@@ -131,9 +131,9 @@
% Before any alignment can take place, coffins must be created and
% their contents must be created. All coffin operations are local
% to the current \TeX{} group with the exception of coffin creation.
-% Coffins are also \enquote{colour safe}: in contrast to the code-level
+% Coffins are also \enquote{color safe}: in contrast to the code-level
% \cs{box_\ldots} functions there is no need to add additional grouping
-% to coffins when dealing with colour.
+% to coffins when dealing with color.
%
% \begin{function}{\NewCoffin}
% \begin{syntax}
@@ -620,7 +620,7 @@
%
% \begin{function}{\DisplayCoffinHandles}
% \begin{syntax}
-% \cs{DisplayCoffinHandles} \meta{coffin} \Arg{colour}
+% \cs{DisplayCoffinHandles} \meta{coffin} \Arg{color}
% \end{syntax}
% This function first calculates the intersections between all of
% the \meta{poles} of the \meta{coffin} to give a set of
@@ -628,20 +628,20 @@
% location in the source, with the position of the \meta{handles}
% marked on the coffin. The \meta{handles} will be labelled as part
% of this process: the locations of the \meta{handles} and the labels
-% are both printed in the \meta{colour} specified.
+% are both printed in the \meta{color} specified.
% \end{function}
%
% \begin{function}{\MarkCoffinHandle}
% \begin{syntax}
% \cs{MarkCoffinHandle} \meta{coffin}
-% ~~[ \meta{pole1} , \meta{pole2} ] \Arg{colour}
+% ~~[ \meta{pole1} , \meta{pole2} ] \Arg{color}
% \end{syntax}
% This function first calculates the \meta{handle} for the
% \meta{coffin} as defined by the intersection of \meta{pole1} and
% \meta{pole2}. It then marks the position of the \meta{handle}
% on the \meta{coffin}. The \meta{handle} will be labelled as part of
% this process: the location of the \meta{handle} and the label are
-% both printed in the \meta{colour} specified. If no \meta{poles} are
+% both printed in the \meta{color} specified. If no \meta{poles} are
% give, the default |(H,l)| is used.
% \end{function}
%
@@ -689,7 +689,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=coffin>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
index 3bbe92eacc0..f22931ea3b9 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
@@ -1,7 +1,7 @@
% \iffalse
%
%% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2013 The LaTeX3 Project
+%% (C) 2010-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -37,7 +37,7 @@
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: l3galley.dtx 4494 2013-05-24 06:27:01Z joseph $
+\GetIdInfo$Id: l3galley.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental galley code}
%</driver|package>
%<*driver>
@@ -172,7 +172,7 @@
% \end{function}
%
% \subsection{Between paragraphs}
-%
+%
% \begin{variable}{\g_galley_previous_par_lines_int}
% The number of lines in the preceding conceptual paragraph. This may not
% correspond to the \TeX{} \tn{prevgraf} primitive value as one conceptual
@@ -355,7 +355,7 @@
% the interaction of a display block with the paragraphs before and after it
% can be adjusted independent of the design of text.
% \end{function}
-%
+%
% \subsection{Hyphenation}
%
% \begin{variable}{\l_galley_hyphen_left_int}
@@ -562,7 +562,7 @@
% \end{variable}
%
% \section{Paragraphs}
-%
+%
% \begin{function}{\galley_par:}
% \begin{syntax}
% \cs{galley_par:}
@@ -675,7 +675,7 @@
% \begin{macrocode}
%<*initex|package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=galley>
% \end{macrocode}
@@ -691,7 +691,7 @@
%
% Functions or settings which are needed by the galley but perhaps also
% elsewhere.
-%
+%
% \begin{macro}{\seq_map_function:Nc}
% Used to allow a mapping to choose the outcome using a passed option.
% \begin{macrocode}
@@ -706,7 +706,7 @@
\tex_defaulthyphenchar:D 45 \scan_stop:
%</initex>
% \end{macrocode}
-%
+%
% \subsection{Scratch variables}
%
% \begin{variable}{\l_@@_tmp_int}
@@ -735,7 +735,7 @@
\bool_new:N \l_@@_parshape_multipar_bool
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}
% {\l_@@_parshape_left_indent_seq, \l_@@_parshape_right_indent_seq}
% Used to convert user input comma lists into sequences for mapping, and also
@@ -811,7 +811,7 @@
\bool_new:N \l_@@_begin_level_bool
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}
% {
% \g_@@_cutout_left_seq, \l_@@_cutout_left_seq,
@@ -1148,7 +1148,7 @@
{
\group_begin:
\tex_par:D
- \group_end:
+ \group_end:
}
% \end{macrocode}
% In horizontal mode, the paragraph shape is set \enquote{just in time}
@@ -1160,7 +1160,7 @@
% \begin{macrocode}
{
\g_galley_par_end_hook_tl
- \group_begin:
+ \group_begin:
\tex_par:D
\group_end:
\int_gset:Nn \g_galley_previous_par_lines_int
@@ -1528,7 +1528,7 @@
% \end{macro}
%
% \subsection{Measure}
-%
+%
% \begin{variable}{\l_@@_total_left_margin_dim, \l_@@_total_right_margin_dim}
% Used to set the measure, first by providing a place to save the existing
% values, then allowing calculation of the difference between old and new
@@ -1570,7 +1570,7 @@
- \l_galley_total_left_margin_dim
- \l_galley_total_right_margin_dim
}
- \@@_set_measure:
+ \@@_set_measure:
}
% \end{macrocode}
% Saves the previous margin state so that it can be used for calculation
@@ -1595,7 +1595,7 @@
{
\int_compare:nNnTF \tex_parshape:D = \c_zero
{ \@@_parshape_measure: }
- {
+ {
\dim_sub:Nn \l_@@_total_left_margin_dim
\l_galley_total_left_margin_dim
\dim_sub:Nn \l_@@_total_right_margin_dim
@@ -1621,7 +1621,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}{\@@_parshape_reset:}
% Test for paragraph shapes to be removed: a multi-step procedure! First,
% check to see if there is a shape at all. If there is, the second check
@@ -1634,9 +1634,9 @@
\int_compare:nNnF \tex_parshape:D = \c_zero
{
\bool_if:nTF
- {
+ {
\seq_if_empty_p:N \g_@@_cutout_left_seq
- && \seq_if_empty_p:N \g_@@_cutout_right_seq
+ && \seq_if_empty_p:N \g_@@_cutout_right_seq
}
{
\bool_if:NF \l_@@_parshape_multipar_bool
@@ -1659,13 +1659,13 @@
{ \@@_parshape_set: }
{ \@@_parshape_measure: }
\@@_cutout_set:Nn \g_@@_cutout_left_seq { left }
- \@@_cutout_set:Nn \g_@@_cutout_right_seq { right }
+ \@@_cutout_set:Nn \g_@@_cutout_right_seq { right }
}
- }
+ }
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_parshape_measure:}
% Sets the parshape to the full measure at the current time: used in a few
% places, so worth spinning out.
@@ -1679,7 +1679,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \subsection{Paragraph shape}
%
% \begin{macro}
@@ -1731,7 +1731,7 @@
{
\seq_put_right:Nn \l_@@_parshape_left_indent_seq { 0 pt }
\seq_put_right:Nn \l_@@_parshape_right_indent_seq { 0 pt }
- }
+ }
\@@_parshape_set:
}
\cs_new_protected_nopar:Npn \@@_parshape_set:
@@ -1758,13 +1758,13 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
+%
% \subsection{Cutouts}
-%
+%
% Cutouts are another way of looking at paragraph shapes, but apply to
% a fixed number of lines within a galley. As such, they require separate
% handling from the measure and shape.
-%
+%
% \begin{macro}{\galley_cutout_left:nn, \galley_cutout_right:nn}
% \begin{macro}[int]{\@@_cutout:nnn}
% \begin{macro}[aux]{\@@_cutout_store:nn}
@@ -1800,7 +1800,7 @@
{ \seq_count:c { g_@@_cutout_ #1 _ seq } }
{
\seq_map_inline:Nn \l_@@_tmpa_seq
- {
+ {
\@@_cutout_store:nn
{ \seq_gpop:cNF { g_@@_cutout_ #1 _ seq } }
{##1}
@@ -1808,7 +1808,7 @@
}
{
\seq_map_inline:cn { g_@@_cutout_ #1 _ seq }
- {
+ {
\@@_cutout_store:nn
{ \seq_pop:NNF \l_@@_tmpa_seq }
{##1}
@@ -1889,14 +1889,14 @@
\c_space_tl
\dim_eval:n { \etex_parshapelength:D \l_@@_tmp_int - ( #1 ) }
\c_space_tl
- }
+ }
}
}
\cs_new_protected:Npn \@@_cutout_right:n #1
{
\int_incr:N \l_@@_tmp_int
\tl_put_right:Nx \l_@@_tmp_tl
- {
+ {
\int_compare:nNnTF \l_@@_tmp_int > \tex_parshape:D
{
\dim_use:N \l_@@_total_left_margin_dim
@@ -1920,12 +1920,12 @@
{
\int_incr:N \l_@@_tmp_int
\tl_put_right:Nx \l_@@_tmp_tl
- {
+ {
\dim_eval:n { \etex_parshapeindent:D #1 }
\c_space_tl
\dim_eval:n { \etex_parshapelength:D #1 }
\c_space_tl
- }
+ }
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
index d0086f4a3e3..b1dda9c1990 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
@@ -1,7 +1,7 @@
% \iffalse
%
%% File: xgalley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2012 The LaTeX3 Project
+%% (C) 2010-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -37,7 +37,7 @@
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: xgalley.dtx 4373 2012-12-17 16:41:59Z joseph $
+\GetIdInfo$Id: xgalley.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental galley}
%</driver|package>
%<*driver>
@@ -744,7 +744,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=galley>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 5713c41d607..5acf857be21 100644
--- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
@@ -33,25 +33,12 @@
%%
%% -----------------------------------------------------------------------
%
-%<package>\RequirePackage{l3names}[2012/12/07]
-%<package>\@ifpackagelater{l3names}{2012/12/07}
-%<package> {}
-%<package> {%
-%<package> \PackageError{expl3}{Mismatched LaTeX3 packages detected.}
-%<package> {%
-%<package> Please install an up to date version of l3kernel
-%<package> using your TeX package manager or from CTAN.%
-%<package> \MessageBreak \MessageBreak
-%<package> Loading expl3 will abort!%
-%<package> }%
-%<package> \endinput
-%<package> }
-%<*driver|package>
+%<*driver|generic|package>
\def\ExplFileName{expl3}
-\def\ExplFileDescription{L3 Experimental code bundle wrapper}
-\def\ExplFileDate{2014/01/07}
-\def\ExplFileVersion{4646}
-%</driver|package>
+\def\ExplFileDescription{L3 programming layer}
+\def\ExplFileDate{2014/05/05}
+\def\ExplFileVersion{4742}
+%</driver|generic|package>
%<*driver>
\documentclass[full]{l3doc}
\begin{document}
@@ -954,7 +941,7 @@
% purposes, as it means that there is a complete list of all functions
% created by each module loaded (with the exceptions of a very small number
% required by the bootstrap code for \LaTeX3).
-%
+%
% \DescribeOption{driver}
% Selects the driver to be used for color, graphics and related operations that
% are driver-dependent. Options available are
@@ -970,6 +957,27 @@
% \item[xdvipdfmx] Use the \texttt{xdvipdfmx} driver (\XeTeX{} only).
% \end{itemize}
%
+% \section{Using \pkg{expl3} with formats other than \LaTeXe{}}
+%
+% As well as the \LaTeXe{} package \pkg{expl3}, there is also a
+% \enquote{generic} loader for the code, \texttt{expl3.tex}. This may be
+% loaded using the plain \TeX{} syntax
+% \begin{verbatim}
+% \input expl3-generic %
+% \end{verbatim}
+% This will enable the programming layer to work with the other formats.
+% As no options are available loading in this way, the \enquote{native}
+% drivers are automatically used. If this \enquote{generic} loader is
+% used with \LaTeXe{} the code will automatically switch to the appropriate
+% package route.
+%
+% After loading the programming layer using the generic interface, the
+% commands \cs{ExplSyntaxOn} and \cs{ExplSyntaxOff} and the code-level
+% functions and variables detailed in \pkg{interface3} will be available.
+% Note that other \LaTeXe{} packages \emph{using} \pkg{expl3} will not
+% be loadable: package loading is dependent on the \LaTeXe{} package-management
+% mechanism.
+%
% \section{The \LaTeX3 Project}
%
% Development of \LaTeX3 is carried out by The \LaTeX3 Project. Over time,
@@ -1027,27 +1035,132 @@
%
% \section{\pkg{expl3} implementation}
%
+% The implementation here covers several things. There are two
+% \enquote{loaders} to define: the parts of the code that are specific to
+% \LaTeXe{} or to non-\LaTeXe{} formats. These have to cover the same
+% concepts as each other but in rather different ways: as a result, much
+% of the code is given in separate blocks. There is also a short piece of
+% code for the start of the \enquote{payload}: this is to ensure that
+% loading is always done in the right way.
+%
+% \subsection{Loader interlock}
+%
+% A short piece of set up to check that the loader and \enquote{payload}
+% versions match.
+%
+% \begin{macro}{\ExplLoaderFileVersion}
+% As DocStrip is used to generate \cs{ExplFileVersion}
+% for all files from the same source, it has to match. Thus the loaders
+% simply save this information with a new name.
% \begin{macrocode}
-%<*package>
+%<*loader>
+\let\ExplLoaderFileVersion\ExplFileVersion
+%</loader>
% \end{macrocode}
+% \end{macro}
%
-% Load \pkg{etex} as otherwise we are likely to get into trouble
-% with registers. Some inserts are reserved also as these have to
-% be from the standard pool. The \cs{relax} is here as
-% \cs{reserveinserts} is outer. Most of the time this is fine, but
-% some packages (for example \pkg{catoptions}) redefine \cs{RequirePackage}
-% such that the trailing optional argument is tested for as a macro argument,
-% which will then lead to an error!
+% The interlock test itself is simple: \cs{ExplLoaderFileVersion} must be
+% defined and identical to \cs{ExplFileVersion}. As this has to work for
+% both \LaTeXe{} and other formats, there is some auto-detection involved.
+% (Done this way avoids having two very similar blocks for \LaTeXe{} and
+% other formats.)
% \begin{macrocode}
-\RequirePackage{etex}
-\relax
-\reserveinserts{32}
+%<*!loader>
+\begingroup
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx PackageError\endcsname\relax
+ \begingroup
+ \def\PackageError##1##2##3%
+ {%
+ \endgroup
+ \errhelp{##3}%
+ \errmessage{##1 Error: ##2!}
+ }
+ \fi
+ \def\next{}
+ \expandafter\ifx\csname ExplLoaderFileVersion\endcsname\relax
+ \def\next
+ {%
+ \PackageError{expl3}{No expl3 loader detected}
+ {%
+ You have attempted to use the expl3 code directly rather than using
+ the correct loader. Loading of expl3 will abort.
+ }
+ \endinput
+ }
+ \else
+ \ifx\ExplLoaderFileVersion\ExplFileVersion
+ \def\next{}
+ \else
+ \def\next
+ {%
+ \PackageError{expl3}{Mismatched expl3 files detected}
+ {%
+ You have attempted to load expl3 with mismatched files:
+ probably you have one or more files 'locally installed' which
+ are in conflict. Loading of expl3 will abort.
+ }%
+ \endinput
+ }
+ \fi
+ \expandafter\fi
+\expandafter\endgroup
+\next
+%</!loader>
+% \end{macrocode}
+%
+% A reload test for the payload, just in case.
+% \begin{macrocode}
+%<*!loader>
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@\ExplFileName -code.tex\endcsname\relax
+ \expandafter\edef\csname ver@\ExplFileName -code.tex\endcsname
+ {%
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space
+ }
+\else
+ \expandafter\endinput
+\fi
+%</!loader>
% \end{macrocode}
%
-% Do the package identification: this will turn on code syntax.
+% All good: log the version of the code used (for log completeness). As this
+% is more-or-less \cs{ProvidesPackage} without a separate file and as this also
+% needs to work without \LaTeXe{}, just write the information directly to the
+% log.
% \begin{macrocode}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
+%<*!loader>
+\immediate\write-1 %
+ {%
+ Package:
+ \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription\space
+ (code)
+ }
+%</!loader>
+% \end{macrocode}
+%
+% \subsection{\LaTeXe{} loader}
+%
+% \begin{macrocode}
+%<*package&loader>
+% \end{macrocode}
+%
+% Identify the package.
+% \begin{macrocode}
+\ProvidesPackage{\ExplFileName}
+ [%
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space (loader)
+ ]
+% \end{macrocode}
+%
+% For handling driver options the \pkg{ifpdf} package will be needed. To
+% avoid issues during package loading, it's most convenient to load this before
+% setting up any of the code environment.
+% \begin{macrocode}
+\RequirePackage{ifpdf}
% \end{macrocode}
%
% \begin{macro}[aux]{\expl@create@bool@option}
@@ -1063,218 +1176,69 @@
% options are handled here: others are left for a proper key--value approach
% once the kernel is loaded.
% \begin{macrocode}
-\newcommand \expl@create@bool@option [ 2 ]
- {
- \DeclareOption {#1} { \renewcommand* #2 { 1 } }
- \DeclareOption { #1 = true } { \renewcommand* #2 { 1 } }
- \DeclareOption { #1 = false } { \renewcommand* #2 { 0 } }
- \newcommand* #2 { 0 }
+\newcommand\expl@create@bool@option[2]%
+ {%
+ \DeclareOption{#1}{\chardef #2=1 }%
+ \DeclareOption{#1=true}{\chardef #2=1 }%
+ \DeclareOption{#1=false}{\chardef #2=0 }%
+ \newcommand*#2{}%
+ \chardef #2=0 %
}
-\expl@create@bool@option { check-declarations } \l@expl@check@declarations@bool
-\expl@create@bool@option { log-functions } \l@expl@log@functions@bool
-\let \expl@create@bool@option \@undefined
-\newcommand* \l@expl@options@clist { }
+\expl@create@bool@option{check-declarations}\l@expl@check@declarations@bool
+\expl@create@bool@option{log-functions}\l@expl@log@functions@bool
+\let\expl@create@bool@option\@undefined
+\newcommand*\l@expl@options@clist{}
\DeclareOption*
- {
- \ifx \l@expl@options@clist \@empty
- \let \l@expl@options@clist \CurrentOption
+ {%
+ \ifx\l@expl@options@clist\@empty
+ \let\l@expl@options@clist\CurrentOption
\else
- \edef \l@expl@options@clist
- {
- \unexpanded \expandafter \expandafter \expandafter
- {
- \expandafter \l@expl@options@clist \expandafter , \CurrentOption
- }
- }
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\l@expl@options@clist
+ \expandafter\expandafter\expandafter
+ {\expandafter\l@expl@options@clist\expandafter,\CurrentOption}
\fi
}
-\ProcessOptions \relax
+\ProcessOptions\relax
% \end{macrocode}
% \end{variable}
% \end{variable}
% \end{macro}
%
-% We already loaded \pkg{l3names} at the beginning of the \texttt{dtx} file.
-% We now load the base of \LaTeX3, stopping once token list variables are
-% defined.
-% \begin{macrocode}
-\RequirePackage { l3basics, l3expan, l3tl }
-% \end{macrocode}
-%
-% \begin{macro}[int]{\__cs_check_exists:N}
-% When used as a package, there is an option to be picky and to
-% check definitions exist. This part of the process is done now, so that
-% variable types based on |tl| (for example |clist|, |seq| and |prop|) will
-% inherit the appropriate definitions.
-% \begin{macrocode}
-\ifodd \l@expl@check@declarations@bool \relax
- \cs_new_protected:Npn \__cs_check_exists:N #1
- {
- \cs_if_exist:NF #1
- {
- \__msg_kernel_error:nnx { check } { non-declared-variable }
- { \token_to_str:N #1 }
- }
- }
-% \end{macrocode}
-% No \cs{tl_map_\ldots} yet as the mechanisms are not fully in place. Thus
-% instead do a more low level set up for a mapping, as in \pkg{l3basics}.
-% \begin{macrocode}
- \cs_set_protected:Npn \__cs_tmp:w #1
- {
- \if_meaning:w ? #1
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \use:x
- {
- \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 }
- {
- \__cs_check_exists:N \exp_not:n {##1}
- \exp_not:o { #1 {##1} {##2} }
- }
- }
- \__cs_tmp:w
- }
- \__cs_tmp:w
- \tl_set:Nn \tl_set:No \tl_set:Nx
- \tl_gset:Nn \tl_gset:No \tl_gset:Nx
- \tl_put_left:Nn \tl_put_left:NV
- \tl_put_left:No \tl_put_left:Nx
- \tl_gput_left:Nn \tl_gput_left:NV
- \tl_gput_left:No \tl_gput_left:Nx
- \tl_put_right:Nn \tl_put_right:NV
- \tl_put_right:No \tl_put_right:Nx
- \tl_gput_right:Nn \tl_gput_right:NV
- \tl_gput_right:No \tl_gput_right:Nx
- ? \q_recursion_stop
-% \end{macrocode}
-% The two \texttt{set_eq} functions are done by hand as the internals there
-% are a bit different.
-% \begin{macrocode}
- \cs_set_protected:Npn \tl_set_eq:NN #1#2
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \cs_set_eq:NN #1 #2
- }
- \cs_set_protected:Npn \tl_gset_eq:NN #1#2
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \cs_gset_eq:NN #1 #2
- }
-% \end{macrocode}
-% There is also a need to check all three arguments of the
-% \texttt{concat} functions: a token list |#2| or |#3| equal to
-% \cs{scan_stop:} would lead to problems later on.
-% \begin{macrocode}
- \cs_set_protected:Npn \tl_concat:NNN #1#2#3
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \__cs_check_exists:N #3
- \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
- }
- \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \__cs_check_exists:N #3
- \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
- }
-\fi
-% \end{macrocode}
+% \begin{macro}{\GetIdInfo}
+% This is implemented right at the start of \texttt{l3bootstrap.dtx}.
% \end{macro}
%
-% The second part of the file can now be loaded, stopping once the boolean
-% data type is defined.
+% \begin{macro}{\ProvidesExplPackage, \ProvidesExplClass, \ProvidesExplFile}
+% For other packages and classes building on this one it is convenient
+% not to need \cs{ExplSyntaxOn} each time.
% \begin{macrocode}
-\RequirePackage { l3seq, l3int, l3quark, l3prg }
-% \end{macrocode}
-%
-% Booleans are not based on token lists but do need checking: another
-% block of code.
-% \begin{macrocode}
-\ifodd \l@expl@check@declarations@bool \relax
- \cs_set_protected:Npn \bool_set_true:N #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1 \c_true_bool
- }
- \cs_set_protected:Npn \bool_set_false:N #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1 \c_false_bool
- }
- \cs_set_protected:Npn \bool_gset_true:N #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1 \c_true_bool
- }
- \cs_set_protected:Npn \bool_gset_false:N #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1 \c_false_bool
- }
- \cs_set_protected:Npn \bool_set_eq:NN #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1
- }
- \cs_set_protected:Npn \bool_gset_eq:NN #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1
- }
- \cs_set_protected:Npn \bool_set:Nn #1#2
- {
- \__cs_check_exists:N #1
- \tex_chardef:D #1 = \bool_if_p:n {#2}
- }
- \cs_set_protected:Npn \bool_gset:Nn #1#2
- {
- \__cs_check_exists:N #1
- \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2}
- }
-\fi
+\protected\def\ProvidesExplPackage#1#2#3#4%
+ {%
+ \ProvidesPackage{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
+ }
+\protected\def\ProvidesExplClass#1#2#3#4%
+ {%
+ \ProvidesClass{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
+ }
+\protected\def\ProvidesExplFile#1#2#3#4%
+ {%
+ \ProvidesFile{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
+ }
% \end{macrocode}
+% \end{macro}
%
-% Now everything else can be loaded.
+% Load the business end: this will leave \cs{expl3} syntax on.
% \begin{macrocode}
-\RequirePackage
- {
- l3clist,
- l3token,
- l3prop,
- l3msg,
- l3file,
- l3skip,
- l3keys,
- l3fp,
- l3box,
- l3coffins,
- l3color,
- l3luatex,
- l3candidates
- }
+\input{expl3-code.tex}
% \end{macrocode}
%
-% The error message for variables cannot be created before now: this means that
-% \pkg{expl3} itself may cause some odd errors.
+% Deactivate writing module information to the log.
% \begin{macrocode}
-\bool_if:nT { \l@expl@check@declarations@bool }
- {
- \__msg_kernel_new:nnnn { check } { non-declared-variable }
- { The~variable~#1~has~not~been~declared~\msg_line_context:. }
- {
- Checking~is~active,~and~you~have~tried~do~so~something~like: \\
- \ \ \tl_set:Nn ~ #1 ~ \{ ~ ... ~ \} \\
- without~first~having: \\
- \ \ \tl_new:N ~ #1 \\
- \\
- LaTeX~will~create~the~variable~and~continue.
- }
- }
+\protected\def\GetIdInfoLog{}
% \end{macrocode}
%
% \begin{macro}{\color}
@@ -1288,7 +1252,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{variable}[int]{\l__expl_driver_tl}
% \begin{variable}[int]{\l__expl_native_drivers_bool}
% With the code now loaded, options can be handled using a real key--value
@@ -1297,7 +1261,6 @@
% foo}). The checks on driver choice are set up here, so when actually
% the driver it's a straight forward operation.
% \begin{macrocode}
-\RequirePackage{ifpdf}
\__msg_kernel_new:nnnn { expl } { wrong-driver }
{ Driver~request~inconsistent~with~engine:~using~'#2'~driver. }
{
@@ -1417,7 +1380,7 @@
% \box_resize_to_wd:Nn,
% \box_scale:Nnn
% }
-% For the \LaTeXe{} drivers,
+% For the \LaTeXe{} drivers,
% alter various definitions to use the \pkg{graphics} package
% instead. The package is loaded right at the start of the hook
% as there is otherwise a potential issue with \pkg{(x)color}: see
@@ -1478,64 +1441,224 @@
% \end{macrocode}
% \end{macro}
% \begin{variable}[int]{\c__expl_def_ext_tl}
-% For native drivers, just load the appropriate file.
+% For native drivers, just load the appropriate file. As \cs{expl3} syntax
+% is already on and the full mechanism is only engaged at the end of the
+% loader, \cs{ProvidesExplFile} is temporarily redefined here.
% \begin{macrocode}
{
+ \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ { \ProvidesFile {#1} [ #2~v#3~#4 ] }
\tl_const:Nn \c__expl_def_ext_tl { def }
\@onefilewithoptions { l3 \l__expl_driver_tl } [ ] [ ] \c__expl_def_ext_tl
+ \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ {
+ \ProvidesFile {#1} [ #2~v#3~#4 ]
+ \ExplSyntaxOn
+ }
}
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\ExplSyntaxOff, \ExplSyntaxOn}
-% These are redefined here to reduce unnecessary work when switching.
-% The definition for \cs{ExplSyntaxOff} copies the code from earlier,
-% so that category codes are restored.
+% \begin{macro}{\@pushfilename, \@popfilename}
+% \begin{macro}[aux]{\__expl_status_pop:w}
+% The idea here is to use \LaTeXe{}'s \tn{@pushfilename} and
+% \tn{@popfilename} to track the current syntax status. This can be
+% achieved by saving the current status flag at each push to a stack,
+% then recovering it at the pop stage and checking if the code
+% environment should still be active.
% \begin{macrocode}
-\cs_set_protected_nopar:Npn \ExplSyntaxOn
+\tl_put_left:Nn \@pushfilename
{
- \bool_if:NF \l__kernel_expl_bool
+ \tl_put_left:Nx \l__expl_status_stack_tl
{
- \cs_set_protected_nopar:Npx \ExplSyntaxOff
- {
- \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } }
- \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } }
- \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } }
- \char_set_catcode:nn { 36 } { \char_value_catcode:n { 36 } }
- \char_set_catcode:nn { 38 } { \char_value_catcode:n { 38 } }
- \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } }
- \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } }
- \char_set_catcode:nn { 95 } { \char_value_catcode:n { 95 } }
- \char_set_catcode:nn { 124 } { \char_value_catcode:n { 124 } }
- \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } }
- \tex_endlinechar:D = \tex_the:D \tex_endlinechar:D \scan_stop:
- \bool_set_false:N \l__kernel_expl_bool
- \cs_set_protected_nopar:Npn \ExplSyntaxOff { }
- }
+ \bool_if:NTF \l__kernel_expl_bool
+ { 1 }
+ { 0 }
}
- \char_set_catcode_ignore:n { 9 } % tab
- \char_set_catcode_ignore:n { 32 } % space
- \char_set_catcode_other:n { 34 } % double quote
- \char_set_catcode_math_toggle:n { 36 } % dollar
- \char_set_catcode_alignment:n { 38 } % ampersand
- \char_set_catcode_letter:n { 58 } % colon
- \char_set_catcode_math_superscript:n { 94 } % circumflex
- \char_set_catcode_letter:n { 95 } % underscore
- \char_set_catcode_other:n { 124 } % pipe
- \char_set_catcode_space:n { 126 } % tilde
- \tex_endlinechar:D = 32 \scan_stop:
- \bool_set_true:N \l__kernel_expl_bool
+ \ExplSyntaxOff
}
-\cs_set_protected_nopar:Npx \ExplSyntaxOff
+\tl_put_right:Nn \@popfilename
{
- \exp_not:o \ExplSyntaxOff
- \cs_set_protected_nopar:Npn \ExplSyntaxOff { }
+ \tl_if_empty:NTF \l__expl_status_stack_tl
+ { \ExplSyntaxOff }
+ { \exp_after:wN \__expl_status_pop:w \l__expl_status_stack_tl \q_stop }
}
% \end{macrocode}
+% The pop auxiliary function removes the first item from the stack,
+% saves the rest of the stack and then does the test. The flag here
+% is not a proper \texttt{bool}, so a low-level test is used.
+% \begin{macrocode}
+\cs_new_protected:Npn \__expl_status_pop:w #1#2 \q_stop
+ {
+ \tl_set:Nn \l__expl_status_stack_tl {#2}
+ \int_if_odd:nTF {#1}
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
+ }
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
+% \begin{variable}{\l__expl_status_stack_tl}
+% As \pkg{expl3} itself cannot be loaded with the code environment
+% already active, at the end of the package \cs{ExplSyntaxOff} can
+% safely be called.
+% \begin{macrocode}
+\tl_new:N \l__expl_status_stack_tl
+\tl_set:Nn \l__expl_status_stack_tl { 0 }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macrocode}
+%</package&loader>
+% \end{macrocode}
+%
+% \subsection{Generic loader}
+%
+% \begin{macrocode}
+%<*generic>
+% \end{macrocode}
+%
+% The generic loader starts with a test to ensure that the current format is
+% not \LaTeXe{}!
+% \begin{macrocode}
+\begingroup
+ \def\tempa{LaTeX2e}
+ \def\next{}
+ \ifx\fmtname\tempa
+ \def\next
+ {%
+ \PackageInfo{expl3}{Switching from generic to LaTeX2e loader}
+ \endinput \RequirePackage{expl3}
+ }
+ \fi
+\expandafter\endgroup
+\next
+% \end{macrocode}
+%
+% Reload check and identify the package:
+% no \LaTeXe{} mechanism so this is all pretty basic.
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@\ExplFileName -generic.tex\endcsname\relax
+\else
+ \immediate\write-1
+ {%
+ Package \ExplFileName\space Info: The package is already loaded.
+ }%
+ \expandafter\endinput
+\fi
+\immediate\write-1
+ {%
+ Package: \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space (loader)
+ }
+\expandafter\edef\csname ver@\ExplFileName -generic.tex\endcsname
+ {\ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription}
+% \end{macrocode}
+%
+% As for the package loader, the \cs{ifpdf} package is loaded, again
+% early so there is no issue with category codes. Notice that here we do
+% not load \cs{etex} as the appropriate stuff is built into the formats.
+% \begin{macrocode}
+\input ifpdf.sty %
+% \end{macrocode}
+%
+% \begin{variable}[aux]{\l@expl@tidy@tl}
+% Save the category code of |@| and then set it to \enquote{letter}.
+% \begin{macrocode}
+\expandafter\edef\csname l@expl@tidy@tl\endcsname
+ {%
+ \catcode64=\the\catcode64\relax
+ \let\expandafter\noexpand\csname l@expl@tidy@tl\endcsname
+ \noexpand\undefined
+ }
+\catcode64=11 %
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}[int]
+% {
+% \l@expl@check@declarations@bool ,
+% \l@expl@log@functions@bool
+% }
+% In generic mode, there is no convenient option handling and so instead
+% the two variables are defined to do nothing.
+% appropriate value before input of the loader.
+% \begin{macrocode}
+\chardef \l@expl@check@declarations@bool = 0 %
+\chardef \l@expl@log@functions@bool = 0 %
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[aux]{\AtBeginDocument}
+% \begin{macro}[aux]{\expl@AtBeginDocument}
+% There are a few uses of \cs{AtBeginDocument} in the package code: the
+% easiest way around that is to simply do nothing for these. As
+% bundles such as \pkg{miniltx} may have defined \cs{AtBeginDocument}
+% any existing definition is saved for restoration after the payload.
+% \begin{macrocode}
+\let\expl@AtBeginDocument\AtBeginDocument
+\def\AtBeginDocument#1{}
+\expandafter\def\expandafter\l@expl@tidy@tl\expandafter
+ {%
+ \l@expl@tidy@tl
+ \let\AtBeginDocument\expl@AtBeginDocument
+ \let\expl@AtBeginDocument\undefined
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Load the business end: this will leave \cs{expl3} syntax on.
+% \begin{macrocode}
+\input expl3-code.tex %
+% \end{macrocode}
+%
+% \begin{macro}{\__iow_wrap_set:Nx}
+% Without \LaTeXe{} there is no \cs{protected@edef} so the more risky
+% direct use of \cs{tl_set:Nx} is required.
+% \begin{macrocode}
+\cs_set_eq:NN \__iow_wrap_set:Nx \tl_set:Nx
+% \end{macrocode}
+% \end{macro}
+%
+% Deactivate writing module information to the log.
+% \begin{macrocode}
+\protected\def\GetIdInfoLog{}
+% \end{macrocode}
+%
+% For driver loading in generic mode, there are no options: pick the most
+% appropriate case! To allow this loading to take place a temporary
+% definition of \cs{ProvidesExplFile} is provided
+% \begin{macrocode}
+\cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ { \iow_log:n { File:~#1~#2~v#3~#4 } }
+\tex_input:D
+ l3
+ \xetex_if_engine:TF
+ { xdvipdfmx }
+ {
+ \ifpdf
+ pdfmode
+ \else
+ dvips
+ \fi
+ }
+ .def \scan_stop:
+\cs_undefine:N \ProvidesExplFile
+% \end{macrocode}
+%
+% For the generic loader, a few final steps to take. Turn of \cs{expl3}
+% syntax and tidy up the small number of temporary changes.
+% \begin{macrocode}
+\ExplSyntaxOff
+\l@expl@tidy@tl
+% \end{macrocode}
+%
% \begin{macrocode}
-%</package>
+%</generic>
% \end{macrocode}
%
% \end{implementation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
index b2e99f603d4..9a6b87ce213 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3alloc.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3alloc.dtx Copyright (C) 1990-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,10 @@
%%
%% -----------------------------------------------------------------------
%
-%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3alloc.dtx 4274 2012-11-05 09:16:29Z joseph $
- {L3 Register allocation}
-%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3alloc.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Register allocation}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
index 9acc07c63da..54fcf80009b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3basics.dtx 4642 2014-01-04 17:28:32Z joseph $
+\GetIdInfo$Id: l3basics.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Basic definitions}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -183,7 +184,7 @@
% \cs{par} tokens but the function will not expand within an
% \texttt{x}-type expansion.
% \end{description}
-%
+%
% Finally, the functions in
% Subsections~\ref{sec:l3basics:defining-new-function-1}~and
% \ref{sec:l3basics:defining-new-function-2} are primarily meant to define
@@ -196,7 +197,7 @@
% described in Section~\ref{sec:l3prg:new-conditional-functions}).
% \item[|p| and |w|] These are special cases.
% \end{description}
-%
+%
% The |\cs_new:| functions below (and friends) do not stop you from using
% other argument specifiers in your function names, but they do not handle
% expansion for you. You should define the base function and then use
@@ -741,7 +742,7 @@
% \abc
% \end{verbatim}
% after two expansions of \cs{use:c}.
-%
+%
% \begin{function}[TF, added = 2012-11-10]
% {\cs_if_exist_use:N,\cs_if_exist_use:c}
% \begin{syntax}
@@ -751,7 +752,7 @@
% (whether as a function or another control sequence type), and if it
% does inserts the \meta{control sequence} into the input stream.
% \end{function}
-%
+%
% \begin{function}[TF,EXP, added = 2012-11-10]
% {\cs_if_exist_use:N,\cs_if_exist_use:c}
% \begin{syntax}
@@ -1294,6 +1295,16 @@
% error.
% \end{function}
%
+% \begin{function}{\__chk_if_exist_var:N}
+% \begin{syntax}
+% \cs{__chk_if_exist_var:N} \meta{var}
+% \end{syntax}
+% This function checks that \meta{var} is defined according to the
+% criteria for \cs{cs_if_free_p:N}, and if not raises a kernel-level
+% error. This function is only created if the package option
+% \texttt{check-declarations} is active.
+% \end{function}
+%
% \begin{function}[EXP]{\__cs_count_signature:N, \__cs_count_signature:c}
% \begin{syntax}
% \cs{__cs_count_signature:N} \meta{function}
@@ -1388,14 +1399,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Renaming some \TeX{} primitives (again)}
%
% Having given all the \TeX{} primitives a consistent name, we need to
@@ -2458,6 +2461,25 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[int]{\__chk_if_exist_var:N}
+% Create the checking function for variable definitions when the option
+% is set.
+% \begin{macrocode}
+%<*package>
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \__chk_if_exist_var:N #1
+ {
+ \cs_if_exist:NF #1
+ {
+ \__msg_kernel_error:nnx { check } { non-declared-variable }
+ { \token_to_str:N #1 }
+ }
+ }
+\fi:
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[int]{\__chk_if_exist_cs:N, \__chk_if_exist_cs:c}
% This function issues an error message when the control sequence
% in its argument does not exist.
@@ -3195,7 +3217,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\__prg_break_point:}
% \begin{macro}{\__prg_break:, \__prg_break:n}
% Very simple analogues of \cs{__prg_break_point:Nn} and
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index 9c90e27a197..a5916afd225 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
@@ -36,18 +36,28 @@
%<*driver|package>
% \begin{macro}{\GetIdInfo}
% \begin{macro}[aux]{\GetIdInfoAuxI, \GetIdInfoAuxII, \GetIdInfoAuxIII}
+% \begin{macro}[int]{\GetIdInfoLog}
% The idea here is to extract out the information needed from a standard
% \textsc{svn} \texttt{Id} line, but without a line that will get
% changed when the file is checked in. Hence the fact that there is
% not a line which includes both a dollar sign and the \texttt{Id}
% keyword together!
+%
+% At this stage, no test has taken place for the \eTeX{} extensions, and
+% so using \cs{protected} could give an error. To avoid that, it is used
+% by csname: if it's not available, the bootstrap code will bail out at
+% the point of testing for the necessary primitives, while if it is available
+% then \cs{GetIdInfo} and so on will be properly protected. All of this is
+% then done in a group to avoid leaving \cs{protected} about as equivalent
+% to \cs{relax} if the extensions are unavailable.
% \begin{macrocode}
-\protected\def\GetIdInfo
- {%
- \begingroup
- \catcode 32 = 10 %
- \GetIdInfoAuxI
- }
+\begingroup
+ \csname protected\endcsname\gdef\GetIdInfo
+ {%
+ \begingroup
+ \catcode 32 = 10 %
+ \GetIdInfoAuxI
+ }
% \end{macrocode}
% A first check for a completely empty \textsc{svn} field. If that is
% not the case, there is a second case when a file created using
@@ -56,70 +66,86 @@
% with that is the reason for the space in the line to use
% \cs{GetIdInforAuxII}.
% \begin{macrocode}
-\protected\def\GetIdInfoAuxI$#1$#2%
- {%
- \def\tempa{#1}%
- \def\tempb{Id}%
- \ifx\tempa\tempb
- \def\tempa
- {%
- \endgroup
- \def\ExplFileDate{9999/12/31}%
- \def\ExplFileDescription{#2}%
- \def\ExplFileName{[unknown name]}%
- \def\ExplFileExtension{[unknown extension]}%
- \def\ExplFileVersion{999}%
- }%
- \else
- \def\tempa
- {%
- \endgroup
- \def\ExplFileDescription{#2}%
- \GetIdInfoAuxII$#1 $%
- }%
- \fi
- \tempa
- }
-% \end{macrocode}
-% Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
-% |#4| is the version, |#5| is the check in date and |#6| is the check in
-% time and user, plus some trailing spaces. If |#4| is the marker |-1| value
-% then |#5| and |#6| will be empty.
-% \begin{macrocode}
-\protected\def\GetIdInfoAuxII$#1 #2.#3 #4 #5 #6$%
- {%
- \def\ExplFileName{#2}%
- \def\ExplFileExtension{#3}%
- \def\ExplFileVersion{#4}%
- \begingroup
- \def\tempa{#4}%
- \def\tempb{-1}%
+ \csname protected\endcsname\gdef\GetIdInfoAuxI$#1$#2%
+ {%
+ \def\tempa{#1}%
+ \def\tempb{Id}%
\ifx\tempa\tempb
\def\tempa
{%
\endgroup
\def\ExplFileDate{0000/00/00}%
+ \def\ExplFileDescription{#2}%
+ \def\ExplFileName{[unknown name]}%
+ \def\ExplFileExtension{[unknown extension]}%
+ \def\ExplFileDate{-1}%
}%
\else
\def\tempa
{%
\endgroup
- \GetIdInfoAuxIII$#5$%
+ \def\ExplFileDescription{#2}%
+ \GetIdInfoAuxII$#1 $%
}%
\fi
\tempa
- }
+ \GetIdInfoLog
+ }
+% \end{macrocode}
+% Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
+% |#4| is the version, |#5| is the check in date and |#6| is the check in
+% time and user, plus some trailing spaces. If |#4| is the marker |-1| value
+% then |#5| and |#6| will be empty.
+% \begin{macrocode}
+ \csname protected\endcsname\gdef\GetIdInfoAuxII$#1 #2.#3 #4 #5 #6$%
+ {%
+ \def\ExplFileName{#2}%
+ \def\ExplFileExtension{#3}%
+ \def\ExplFileVersion{#4}%
+ \begingroup
+ \def\tempa{#4}%
+ \def\tempb{-1}%
+ \ifx\tempa\tempb
+ \def\tempa
+ {%
+ \endgroup
+ \def\ExplFileDate{0000/00/00}%
+ }%
+ \else
+ \def\tempa
+ {%
+ \endgroup
+ \GetIdInfoAuxIII$#5$%
+ }%
+ \fi
+ \tempa
+ }
% \end{macrocode}
% Convert an \textsc{svn}-style date into a \LaTeX{}-style one.
% \begin{macrocode}
-\protected\def\GetIdInfoAuxIII$#1-#2-#3$%
- {%
- \def\ExplFileDate{#1/#2/#3}%
- }
+ \csname protected\endcsname\gdef\GetIdInfoAuxIII$#1-#2-#3$%
+ {%
+ \def\ExplFileDate{#1/#2/#3}%
+ }
+% \end{macrocode}
+% During loading of \pkg{expl3}, module information is added to the log.
+% This function gets redefined once loading is complete.
+% \begin{macrocode}
+ \csname protected\endcsname\gdef\GetIdInfoLog
+ {%
+ \immediate\write-1 %
+ {%
+ L3 Module:
+ \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription
+ }
+ }
+\endgroup
% \end{macrocode}
% \end{macro}
% \end{macro}
-\GetIdInfo$Id: l3bootstrap.dtx 4640 2014-01-04 16:03:52Z joseph $
+% \end{macro}
+\GetIdInfo$Id: l3bootstrap.dtx 4741 2014-05-05 14:16:57Z joseph $
{L3 Bootstrap code}
%</driver|package>
%<*driver>
@@ -212,9 +238,9 @@
% \ProvidesExplPackage{\ExplFileName}
% {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
% \end{verbatim}
-%
+%
% \subsection{Internal functions and variables}
-%
+%
% \begin{function}{\__expl_package_check:}
% \begin{syntax}
% \cs{__expl_package_check:}
@@ -263,89 +289,20 @@
%</initex>
% \end{macrocode}
%
-% For \LuaTeX{} the extra primitives need to be enabled before
-% they can be used. No \tn{ifdefined} yet, so do it the old-fashioned
-% way. The primitive \tn{strcmp} is simulated using some \Lua{}
-% code, which currently has to be applied to every job as the \Lua{}
-% code is not part of the format. Thanks to Taco Hoekwater for this
-% code. The odd \tn{csname} business is needed so that the later
-% deletion code will work.
+% For \LuaTeX{}, the extra primitives need to be enabled. This is not needed
+% in package mode: plain \TeX{} and Con\TeX{}t have the primitives enabled
+% while \LaTeXe{} has them with the prefix \texttt{luatex} (which is handled
+% in \pkg{l3names}).
% \begin{macrocode}
%<*initex>
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname directlua\endcsname\relax
-\else
- \directlua
- {
- tex.enableprimitives('',tex.extraprimitives ())
- lua.bytecode[1] = function ()
- function strcmp (A, B)
- if A == B then
- tex.write("0")
- elseif A < B then
- tex.write("-1")
- else
- tex.write("1")
- end
- end
- end
- lua.bytecode[1]()
- }
- \everyjob\expandafter
- {\csname\detokenize{luatex_directlua:D}\endcsname{lua.bytecode[1]()}}
- \long\edef\pdfstrcmp#1#2%
- {%
- \expandafter\noexpand\csname\detokenize{luatex_directlua:D}\endcsname
- {%
- strcmp%
- (%
- "\noexpand\luaescapestring{#1}",%
- "\noexpand\luaescapestring{#2}"%
- )%
- }%
- }
+ \directlua{tex.enableprimitives ('', tex.extraprimitives ( ))}
\fi
%</initex>
% \end{macrocode}
%
-% \subsection{Package-specific code part one}
-%
-% The package starts by identifying itself: the information itself is
-% taken from the SVN |Id| string at the start of the source file.
-% \begin{macrocode}
-%<*package>
-\ProvidesPackage{l3bootstrap}
- [%
- \ExplFileDate\space v\ExplFileVersion\space
- L3 Experimental bootstrap code%
- ]
-%</package>
-% \end{macrocode}
-%
-% For \LuaTeX{} the functionality of the \tn{pdfstrcmp} primitive
-% needs to be provided: the \pkg{pdftexmcds} package is used to
-% do this if necessary. At present, there is also a need to deal
-% with some low-level allocation stuff that could usefully be added
-% to \texttt{lualatex.ini}. As it is currently not, load Heiko
-% Oberdiek's \pkg{luatex} package instead.
-% \begin{macrocode}
-%<*package>
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname directlua\endcsname\relax
-\else
- \begingroup
- \def\@tempa
- {%
- \endgroup
- \RequirePackage{luatex}%
- \RequirePackage{pdftexcmds}%
- }%
- \expandafter\@tempa
-\fi
-%</package>
-% \end{macrocode}
-%
-% \subsection{The \tn{pdfstrcmp} primitive in \XeTeX{}}
+% \subsection{The \cs{pdfstrcmp} primitive with \XeTeX{} and \LuaTeX{}}
%
% Only \pdfTeX{} has a primitive called \tn{pdfstrcmp}. The \XeTeX{}
% version is just \tn{strcmp}, so there is some shuffling to do. As
@@ -356,13 +313,82 @@
\let\pdfstrcmp\strcmp
\fi
% \end{macrocode}
-%
+%
+% \begin{macro}{\expl_pdfstrcmp}
+% If \LuaTeX{} is in use then no primitive \cs{(pdf)strcmp} is available.
+% However, it can be emulated using some Lua code. Since this is not
+% the primitive, we do not use a misleading name: instead, a temporary
+% version is set up as \cs{expl_pdfstrcmp}. The latter is then picked up
+% and moved to the correct place by \pkg{l3names}. In earlier versions of
+% the code, the \pkg{pdftexcmds} package was loaded to do this task. However,
+% that raises some issues in \enquote{generic} (it fails with Con\TeX{}t
+% MkIV), and also adds a hardly-needed dependency.
+%
+% Note that \LuaTeX{} prior to version $0.36$ is not supported by
+% \pkg{expl3}: here that means simply skipping the definition, which will
+% then be picked up later. In format mode, the definition needs to be done
+% both during the format construction process and at the start of each
+% job. To achieve that while not requiring a separate file, the Lua code
+% is saved into a macro then used twice. That isn't required for package
+% mode but it does not harm and keeps code-sharing easier.
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname directlua\endcsname\relax
+ \else
+ \ifnum\luatexversion<36 %
+ \else
+ \catcode`\_=11 %
+ \catcode`\:=11 %
+%<*initex>
+ \def\tempa
+%</initex>
+%<*package>
+ \directlua
+%</package>
+ {%
+ l3kernel = { }
+ function l3kernel.strcmp (A, B)
+ A = A or ""
+ B = B or ""
+ if A == B then
+ tex.write ("0")
+ elseif A < B then
+ tex.write ("-1")
+ else
+ tex.write ("1")
+ end
+ end
+ }
+%<*initex>
+ \directlua{\tempa}
+ \global\everyjob\expandafter
+ {%
+ \expandafter\luatex_directlua:D\expandafter{\tempa}%
+ }
+%</initex>
+ \gdef\expl_pdfstrcmp#1#2%
+ {%
+ \luatex_directlua:D
+ {%
+ l3kernel.strcmp
+ (
+ "\luatex_luaescapestring:D {#1}" ,
+ "\luatex_luaescapestring:D {#2}"
+ )
+ }%
+ }
+ \fi
+ \fi
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Engine requirements}
%
% The code currently requires functionality equivalent to \tn{pdfstrcmp}
-% in addition to \eTeX{}. In package mode, there is the slight caveat that
-% with \LuaTeX{} emulating this primitive is be done using a different
-% name as the expansion behaviour is different.
+% in addition to \eTeX{}. This is picked up by testing for the \cs{pdfstrcmp}
+% primitive or emulation as \cs{expl_pdfstrcmp}, as the \eTeX{} primitives
+% must be available if it is.
% \begin{macrocode}
\begingroup
\def\ShortText{Required primitives not found}%
@@ -378,260 +404,163 @@
\LineBreak
}%
\expandafter\ifx\csname pdfstrcmp\endcsname\relax
+ \catcode`\_=11 %
+ \expandafter\ifx\csname expl_pdfstrcmp\endcsname\relax
%<*initex>
- \def\LineBreak{^^J}%
- \edef\Error%
- {%
- \endgroup
- \newlinechar`\noexpand\^^J\relax
- \errhelp
- {%
- \LongText
- For pdfTeX and XeTeX the '-etex' command-line switch is also
- needed.\LineBreak
- \LineBreak
- Format building will abort!\LineBreak
- }%
- \errmessage{\ShortText}%
- \noexpand\end
- }%
- \expandafter\Error
-%</initex>
+ \def\LineBreak{^^J}%
+ \edef\Error%
+ {%
+ \endgroup
+ \newlinechar`\noexpand\^^J\relax
+ \errhelp
+ {%
+ \LongText
+ For pdfTeX and XeTeX the '-etex' command-line switch is also
+ needed.\LineBreak
+ \LineBreak
+ Format building will abort!\LineBreak
+ }%
+ \errmessage{\ShortText}%
+ \noexpand\end
+ }%
+%</initex>
%<*package>
- \expandafter\ifx\csname pdf@strcmp\endcsname\relax
\def\LineBreak{\noexpand\MessageBreak}%
\edef\Error%
{%
\endgroup
\noexpand\PackageError{expl3}{\ShortText}
{\LongText Loading of expl3 will abort!}%
- \noexpand\endinput
+ \noexpand\endinput
}%
+%</package>
\expandafter\expandafter\expandafter\Error
\else
\endgroup
\fi
-%</package>
\else
\endgroup
\fi
% \end{macrocode}
%
-% \subsection{Package-specific code part two}
-%
-% \begin{macro}{\ExplSyntaxOff, \ExplSyntaxOn}
-% Experimental syntax switching is set up here for the package-loading
-% process. These are redefined in \pkg{expl3} for the package and in
-% \pkg{l3final} for the format.
+% \subsection{Extending allocators}
+%
+% In format mode, allocating registers is handled by \pkg{l3alloc}. However, in
+% package mode it's much safer to rely on more general code. For example,
+% the ability to extend \TeX{}'s allocation routine to allow for \eTeX{} has
+% been around since 1997 in the \pkg{etex} package.
+%
+% Loading this support is delayed until here as we are now sure that the
+% \eTeX{} extensions and \cs{pdfstrcmp} or equivalent are available. Thus
+% there is no danger of an \enquote{uncontrolled} error if the engine
+% requirements are not met.
+%
+% For \LaTeX{} only, load \pkg{etex} as otherwise we are likely to get into
+% trouble with registers. Some inserts are reserved also as these have to
+% be from the standard pool. Note that \cs{reserveinserts} is \cs{outer}
+% and so is accessed here by csname. In earlier versions, loading \pkg{etex}
+% was done directly and so \cs{reserveinserts} appeared in the code: this
+% then required a \cs{relax} after \cs{RequirePackage} to prevent an error
+% with \enquote{unsafe} definitions as seen for example with \pkg{capoptions}.
+% The optional loading here is done using a group and \cs{ifx} test as we
+% are not quite in the position to have a single name for \cs{pdfstrcmp} just
+% yet.
% \begin{macrocode}
%<*package>
-\protected\edef\ExplSyntaxOff
- {%
- \catcode 9 = \the\catcode 9\relax
- \catcode 32 = \the\catcode 32\relax
- \catcode 34 = \the\catcode 34\relax
- \catcode 38 = \the\catcode 38\relax
- \catcode 58 = \the\catcode 58\relax
- \catcode 94 = \the\catcode 94\relax
- \catcode 95 = \the\catcode 95\relax
- \catcode 124 = \the\catcode 124\relax
- \catcode 126 = \the\catcode 126\relax
- \endlinechar = \the\endlinechar\relax
- \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0 \relax
- }
-\protected\edef\ExplSyntaxOn
- {%
- \catcode 9 = 9 \relax
- \catcode 32 = 9 \relax
- \catcode 34 = 12 \relax
- \catcode 58 = 11 \relax
- \catcode 94 = 7 \relax
- \catcode 95 = 11 \relax
- \catcode 124 = 12 \relax
- \catcode 126 = 10 \relax
- \endlinechar = 32 \relax
- \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 1 \relax
- }
-%</package>
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{variable}{\l__kernel_expl_bool}
-% The status for experimental code syntax: this is off at present. This
-% code is used by both the package and the format.
-% \begin{macrocode}
-\expandafter\chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0 \relax
-% \end{macrocode}
-%\end{variable}
-%
-% \subsection{Dealing with package-mode meta-data}
-%
-% \begin{macro}{\GetIdInfo}
-% This is implemented right at the start of \texttt{l3bootstrap.dtx}.
-% \end{macro}
-%
-% \begin{macro}{\ProvidesExplPackage, \ProvidesExplClass, \ProvidesExplFile}
-% For other packages and classes building on this one it is convenient
-% not to need \cs{ExplSyntaxOn} each time.
-% \begin{macrocode}
-%<*package>
-\protected\def\ProvidesExplPackage
- {%
- \@ifpackageloaded{expl3}
- {}
- {%
- \PackageError{expl3}
- {Cannot load the expl3 modules separately}
- {%
- The expl3 modules cannot be loaded separately;\MessageBreak
- please \string\usepackage\string{expl3\string} instead.%
- }%
- }%
- \protected\def\ProvidesExplPackage##1##2##3##4%
+\begingroup
+ \def\@tempa{LaTeX2e}
+ \def\next{}
+ \ifx\fmtname\@tempa
+ \def\next
{%
- \ProvidesPackage{##1}[##2 v##3 ##4]%
- \ExplSyntaxOn
- }%
- \ProvidesExplPackage
- }
-\protected\def\ProvidesExplClass#1#2#3#4%
- {%
- \ProvidesClass{#1}[#2 v#3 #4]%
- \ExplSyntaxOn
- }
-\protected\def\ProvidesExplFile#1#2#3#4%
- {%
- \ProvidesFile{#1}[#2 v#3 #4]%
- \ExplSyntaxOn
- }
+ \RequirePackage{etex}%
+ \csname reserveinserts\endcsname{32}%
+ }
+ \fi
+\expandafter\endgroup
+\next
%</package>
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\@pushfilename, \@popfilename}
-% The idea here is to use \LaTeXe{}'s \tn{@pushfilename} and
-% \tn{@popfilename} to track the current syntax status. This can be
-% achieved by saving the current status flag at each push to a stack,
-% then recovering it at the pop stage and checking if the code
-% environment should still be active.
+% If \LuaTeX{} is in use there are more allocators to create. Con\TeX{}t
+% already does that, so skip any loading in that case: this is done using the
+% \cs{newattribute} allocator. Otherwise, there is a need for a test to
+% differentiate between \LaTeXe{} and plain.
% \begin{macrocode}
%<*package>
-\edef\@pushfilename
- {%
- \edef\expandafter\noexpand
- \csname\detokenize{l_@@_status_stack_tl}\endcsname
- {%
- \noexpand\ifodd\expandafter\noexpand
- \csname\detokenize{l__kernel_expl_bool}\endcsname
- 1%
- \noexpand\else
- 0%
- \noexpand\fi
- \expandafter\noexpand
- \csname\detokenize{l_@@_status_stack_tl}\endcsname
- }%
- \ExplSyntaxOff
- \unexpanded\expandafter{\@pushfilename}%
- }
-\edef\@popfilename
- {%
- \unexpanded\expandafter{\@popfilename}%
- \noexpand\if a\expandafter\noexpand\csname
- \detokenize{l_@@_status_stack_tl}\endcsname a%
- \ExplSyntaxOff
- \noexpand\else
- \noexpand\expandafter
- \expandafter\noexpand\csname
- \detokenize{@@_status_pop:w}\endcsname
- \expandafter\noexpand\csname
- \detokenize{l_@@_status_stack_tl}\endcsname
- \noexpand\@nil
- \noexpand\fi
- }
+\ifdefined\directlua
+ \ifdefined\newattribute
+ \else
+ \ifdefined\RequirePackage
+ \RequirePackage{luatex}
+ \else
+ \input luatex.sty %
+ \fi
+ \fi
+\fi
%</package>
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\l_@@_status_stack_tl}
-% As \pkg{expl3} itself cannot be loaded with the code environment
-% already active, at the end of the package \cs{ExplSyntaxOff} can
-% safely be called.
-% \begin{macrocode}
-%<*package>
-\@namedef{\detokenize{l_@@_status_stack_tl}}{0}
-%</package>
-% \end{macrocode}
-% \end{macro}
+% \subsection{The \LaTeX3 code environment}
+%
+% The code environment is now set up.
%
-% \begin{macro}[aux]{\@@_status_pop:w}
-% The pop auxiliary function removes the first item from the stack,
-% saves the rest of the stack and then does the test. As
-% \cs{ExplSyntaxOff} is already defined as a protected macro, there
-% is no need for \tn{noexpand} here.
+% \begin{macro}{\ExplSyntaxOff}
+% Before changing any category codes, in package mode we need to save
+% the situation before loading. Note the set up here means that once applied
+% \cs{ExplSyntaxOff} will be a \enquote{do nothing} command until
+% \cs{ExplSyntaxOn} is used. For format mode, there is no need to save
+% category codes so that step is skipped.
% \begin{macrocode}
+\protected\def\ExplSyntaxOff{}
%<*package>
-\expandafter\edef\csname\detokenize{@@_status_pop:w}\endcsname#1#2\@nil
+\protected\edef\ExplSyntaxOff
{%
- \def\expandafter\noexpand
- \csname\detokenize{l_@@_status_stack_tl}\endcsname{#2}%
- \noexpand\ifodd#1\space
- \noexpand\expandafter\noexpand\ExplSyntaxOn
- \noexpand\else
- \noexpand\expandafter\ExplSyntaxOff
- \noexpand\fi
+ \protected\def\ExplSyntaxOff{}%
+ \catcode 9 = \the\catcode 9\relax
+ \catcode 32 = \the\catcode 32\relax
+ \catcode 34 = \the\catcode 34\relax
+ \catcode 38 = \the\catcode 38\relax
+ \catcode 58 = \the\catcode 58\relax
+ \catcode 94 = \the\catcode 94\relax
+ \catcode 95 = \the\catcode 95\relax
+ \catcode 124 = \the\catcode 124\relax
+ \catcode 126 = \the\catcode 126\relax
+ \endlinechar = \the\endlinechar\relax
+ \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0\relax
}
%</package>
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\__expl_package_check:}
-% We want the \pkg{expl3} bundle to be loaded \enquote{as one};
-% this command is used to ensure that one of the |l3| packages isn't loaded
-% on its own.
+% The code environment is now set up.
% \begin{macrocode}
-%<*package>
-\expandafter\protected\expandafter\def
- \csname\detokenize{__expl_package_check:}\endcsname
- {%
- \@ifpackageloaded{expl3}
- {}
- {%
- \PackageError{expl3}
- {Cannot load the expl3 modules separately}
- {%
- The expl3 modules cannot be loaded separately;\MessageBreak
- please \string\usepackage\string{expl3\string} instead.%
- }%
- }%
- }
-%</package>
+\catcode 9 = 9\relax
+\catcode 32 = 9\relax
+\catcode 34 = 12\relax
+\catcode 58 = 11\relax
+\catcode 94 = 7\relax
+\catcode 95 = 11\relax
+\catcode 124 = 12\relax
+\catcode 126 = 10\relax
+\endlinechar = 32\relax
% \end{macrocode}
-% \end{macro}
%
-% \subsection{The \LaTeX3 code environment}
-%
-% The code environment is now set up for the format: the package deals
-% with this using \cs{ProvidesExplPackage}.
+% \begin{variable}{\l__kernel_expl_bool}
+% The status for experimental code syntax: this is on at present.
% \begin{macrocode}
-%<*initex>
-\catcode 9 = 9 \relax
-\catcode 32 = 9 \relax
-\catcode 34 = 12 \relax
-\catcode 58 = 11 \relax
-\catcode 94 = 7 \relax
-\catcode 95 = 11 \relax
-\catcode 124 = 12 \relax
-\catcode 126 = 10 \relax
-\endlinechar = 32 \relax
-%</initex>
+\chardef\l__kernel_expl_bool = 1 ~
% \end{macrocode}
+%\end{variable}
%
-% \begin{macro}{\ExplSyntaxOn, \ExplSyntaxOff}
+% \begin{macro}{\ExplSyntaxOn}
% The idea here is that multiple \cs{ExplSyntaxOn} calls are not
% going to mess up category codes, and that multiple calls to
-% \cs{ExplSyntaxOff} are also not wasting time.
+% \cs{ExplSyntaxOff} are also not wasting time. Applying
+% \cs{ExplSyntaxOn} will alter the definition of \cs{ExplSyntaxOff}
+% and so in package mode this function should not be used until after
+% the end of the loading process!
% \begin{macrocode}
-%<*initex>
\protected \def \ExplSyntaxOn
{
\bool_if:NF \l__kernel_expl_bool
@@ -665,20 +594,9 @@
\tex_endlinechar:D = 32 \scan_stop:
\bool_set_true:N \l__kernel_expl_bool
}
-\protected \def \ExplSyntaxOff { }
-%</initex>
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}{\l__kernel_expl_bool}
-% A flag to show the current syntax status.
-% \begin{macrocode}
-%<*initex>
-\chardef \l__kernel_expl_bool = 0 ~
-%</initex>
-% \end{macrocode}
-% \end{variable}
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 537ae210617..6c481ee323f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3box.dtx Copyright (C) 2005-2013 The LaTeX3 Project
+%% File: l3box.dtx Copyright (C) 2005-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3box.dtx 4581 2013-07-28 08:38:50Z joseph $
+\GetIdInfo$Id: l3box.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental boxes}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -328,7 +329,7 @@
% \end{syntax}
% Shows full details of the content of the \meta{box} in the terminal.
% \end{function}
-%
+%
% \begin{function}[added = 2012-05-11]{\box_show:Nnn, \box_show:cnn}
% \begin{syntax}
% \cs{box_show:Nnn} \meta{box} \meta{intexpr_1} \meta{intexpr_2}
@@ -337,14 +338,14 @@
% \meta{intexpr_1} items of the box, and descending into \meta{intexpr_2}
% group levels.
% \end{function}
-%
+%
% \begin{function}[added = 2012-05-11]{\box_log:N, \box_log:c}
% \begin{syntax}
% \cs{box_show:N} \meta{box}
% \end{syntax}
% Writes full details of the content of the \meta{box} to the log.
% \end{function}
-%
+%
% \begin{function}[added = 2012-05-11]{\box_log:Nnn, \box_log:cnn}
% \begin{syntax}
% \cs{box_show:Nnn} \meta{box} \meta{intexpr_1} \meta{intexpr_2}
@@ -650,17 +651,9 @@
% \begin{macrocode}
%<*initex|package>
% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=box>
-% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
+%<@@=box>
% \end{macrocode}
%
% The code in this module is very straight forward so I'm not going to
@@ -678,7 +671,7 @@
\cs_new_protected:Npn \box_new:N #1
{
\__chk_if_free_cs:N #1
- \newbox #1
+ \cs:w newbox \cs_end: #1
}
%</package>
\cs_generate_variant:Nn \box_new:N { c }
@@ -927,7 +920,7 @@
% \end{variable}
%
% \subsection{Viewing box contents}
-%
+%
% \TeX{}'s \tn{tex_showbox:D} is not really that helpful in many cases, and
% it is also inconsistent with other \LaTeX3{} \texttt{show} functions as it
% does not actually shows material in the terminal. So we provide a richer
@@ -946,7 +939,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}{\box_log:N, \box_log:c}
% \begin{macro}{\box_log:Nnn, \box_log:cnn}
% Getting \TeX{} to write to the log without interruption the run is done by
@@ -970,7 +963,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}[aux]{\@@_show:NNnn}
% The internal auxiliary to actually do the output uses a group to deal
% with breadth and depth values. The \cs{use:n} here gives better output
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index 65f3e70e5cc..2c77af11e46 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3candidates.dtx Copyright(C) 2012,2013 The LaTeX3 Project
+%% File: l3candidates.dtx Copyright(C) 2012-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -34,13 +34,14 @@
%% -----------------------------------------------------------------------
%%
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3candidates.dtx 4643 2014-01-06 13:28:06Z joseph $
+\GetIdInfo$Id: l3candidates.dtx 4734 2014-05-04 21:48:49Z joseph $
{L3 Experimental additions to l3kernel}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -194,7 +195,7 @@
%
% \begin{texnote}
% Clipping is implemented by the driver, and as such the full content of
-% the box is places in the output file. Thus clipping does not remove
+% the box is placed in the output file. Thus clipping does not remove
% any information from the raw output, and hidden material can therefore
% be viewed by direct examination of the file.
% \end{texnote}
@@ -879,14 +880,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Additions to \pkg{l3box}}
%
% \begin{macrocode}
@@ -1394,7 +1387,7 @@
\hbox_set:Nn \l_@@_internal_box
{
\box_move_down:nn { #3 - \box_dp:N #1 }
- { \box_use:N \l_@@_internal_box }
+ { \box_use:N \l_@@_internal_box }
}
\box_set_dp:Nn \l_@@_internal_box \c_zero_dim
}
@@ -1769,7 +1762,7 @@
% \begin{macrocode}
\hbox_set:Nn \l_@@_internal_box
{
- \tex_kern:D
+ \tex_kern:D
\__dim_eval:w
\l_@@_bounding_shift_dim - \l_@@_left_corner_dim
\__dim_eval_end:
@@ -1789,7 +1782,7 @@
\box_set_dp:Nn \l_@@_internal_box { 0 pt }
\box_set_wd:Nn \l_@@_internal_box
{ \l_@@_right_corner_dim - \l_@@_left_corner_dim }
- \hbox_set:Nn #1 { \box_use:N \l_@@_internal_box }
+ \hbox_set:Nn #1 { \box_use:N \l_@@_internal_box }
% \end{macrocode}
% The final task is to move the poles and corners such that they are
% back in alignment with the box reference point.
@@ -2347,7 +2340,7 @@
% \begin{macrocode}
\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
{ \exp_after:wN \@@_mapthread_function:wNN #2 \q_stop #1 #3 }
-\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \q_stop #2#3
+\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \q_stop #2#3
{
\exp_after:wN \@@_mapthread_function:wNw #2 \q_stop #3
#1 { ? \__prg_break: } { }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index 9b26d172cae..dcd332df4ae 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
@@ -2,7 +2,7 @@
%
%% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach,
%% The LaTeX3 project
-%% (C) 2012,2013 The LaTeX3 Project
+%% (C) 2012-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,13 +35,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3clist.dtx 4581 2013-07-28 08:38:50Z joseph $
+\GetIdInfo$Id: l3clist.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Comma separated lists}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -466,10 +467,10 @@
% For example,
% \begin{verbatim}
% \clist_set:Nn \l_tmpa_clist { a , b , , c , {de} , f }
-% \clist_use:Nn \l_tmpa_clist { ~and~ }
+% \clist_use:Nn \l_tmpa_clist { ~and~ }
% \end{verbatim}
% will insert \enquote{\texttt{a and b and c and de and f}} in the input
-% stream.
+% stream.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the \meta{items}
@@ -624,14 +625,6 @@
%<@@=clist>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \begin{variable}{\c_empty_clist}
% An empty comma list is simply an empty token list.
% \begin{macrocode}
@@ -1363,7 +1356,7 @@
{ \__prg_map_break:Nn \clist_map_break: }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\clist_count:N, \clist_count:c, \clist_count:n}
% \begin{macro}[aux]{\@@_count:n}
% \begin{macro}[aux]{\@@_count:w}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
index 7197d72e18f..f9c0d414665 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3coffins.dtx Copyright(C) 2010-2012 The LaTeX3 Project
+%% File: l3coffins.dtx Copyright(C) 2010-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -34,13 +34,14 @@
%% -----------------------------------------------------------------------
%%
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3coffins.dtx 4624 2013-12-14 13:58:48Z bruno $
+\GetIdInfo$Id: l3coffins.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Coffin code layer}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -280,7 +281,7 @@
% \begin{function}[updated = 2011-09-02]
% {\coffin_display_handles:Nn, \coffin_display_handles:cn}
% \begin{syntax}
-% \cs{coffin_display_handles:Nn} \meta{coffin} \Arg{colour}
+% \cs{coffin_display_handles:Nn} \meta{coffin} \Arg{color}
% \end{syntax}
% This function first calculates the intersections between all of
% the \meta{poles} of the \meta{coffin} to give a set of
@@ -288,20 +289,20 @@
% location in the source, with the position of the \meta{handles}
% marked on the coffin. The \meta{handles} will be labelled as part
% of this process: the locations of the \meta{handles} and the labels
-% are both printed in the \meta{colour} specified.
+% are both printed in the \meta{color} specified.
% \end{function}
%
% \begin{function}[updated = 2011-09-02]
% {\coffin_mark_handle:Nnnn, \coffin_mark_handle:cnnn}
% \begin{syntax}
-% \cs{coffin_mark_handle:Nnnn} \meta{coffin} \Arg{pole_1} \Arg{pole_2} \Arg{colour}
+% \cs{coffin_mark_handle:Nnnn} \meta{coffin} \Arg{pole_1} \Arg{pole_2} \Arg{color}
% \end{syntax}
% This function first calculates the \meta{handle} for the
% \meta{coffin} as defined by the intersection of \meta{pole_1} and
% \meta{pole_2}. It then marks the position of the \meta{handle}
% on the \meta{coffin}. The \meta{handle} will be labelled as part of
% this process: the location of the \meta{handle} and the label are
-% both printed in the \meta{colour} specified.
+% both printed in the \meta{color} specified.
% \end{function}
%
% \begin{function}[updated = 2012-09-09]
@@ -321,13 +322,13 @@
% the later, rather than the absolute values, which determines the
% direction of the pole.
% \end{function}
-%
+%
% \subsection{Constants and variables}
%
% \begin{variable}{\c_empty_coffin}
% A permanently empty coffin.
% \end{variable}
-%
+%
% \begin{variable}[added = 2012-06-19]{\l_tmpa_coffin, \l_tmpb_coffin}
% Scratch coffins for local assignment. These are never used by
% the kernel code, and so are safe for use with any \LaTeX3-defined
@@ -344,17 +345,9 @@
% \begin{macrocode}
%<*initex|package>
% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=coffin>
-% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
+%<@@=coffin>
% \end{macrocode}
%
% \subsection{Coffins: data structures and general variables}
@@ -710,7 +703,7 @@
% \end{variable}
% \end{variable}
% \end{variable}
-%
+%
% \begin{variable}{\l_tmpa_coffin, \l_tmpb_coffin}
% The usual scratch space.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
index caf5f258333..ea0dd4d2799 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3color.dtx Copyright(C) 2011,2012 The LaTeX3 Project
+%% File: l3color.dtx Copyright(C) 2011,2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -34,13 +34,14 @@
%% -----------------------------------------------------------------------
%%
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3color.dtx 4156 2012-08-29 11:10:09Z joseph $
+\GetIdInfo$Id: l3color.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Experimental color support}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -48,7 +49,7 @@
% \fi
%
% \title{^^A
-% The \textsf{l3color} package\\ Colour support^^A
+% The \textsf{l3color} package\\ Color support^^A
% \thanks{This file describes v\ExplFileVersion,
% last revised \ExplFileDate.}^^A
% }
@@ -72,7 +73,7 @@
% material here is mainly intended to support a small number of low-level
% requirements in other \pkg{l3kernel} modules.
%
-% \section{Colour in boxes}
+% \section{Color in boxes}
%
% Controlling the color of text in boxes requires a small number of control
% functions, so that the boxed material uses the color at the point where
@@ -107,14 +108,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \begin{macro}{\color_group_begin:, \color_group_end:}
% Grouping for color is almost the same as using the basic \cs{group_begin:}
% and \cs{group_end:} functions. However, in vertical mode the end-of-group
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 073a979140e..0419b628342 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3doc.dtx Copyright (C) 1990-2012 The LaTeX3 project
+%% File: l3doc.dtx Copyright (C) 1990-2014 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -78,7 +78,7 @@ Do not distribute a modified version of this file.
%</driver|class>
%
%<*driver|class>
-\GetIdInfo$Id: l3doc.dtx 4442 2013-01-13 08:56:27Z bruno $
+\GetIdInfo$Id: l3doc.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental documentation class}
%</driver|class>
%
@@ -528,7 +528,7 @@ Do not distribute a modified version of this file.
\bool_new:N \l_@@_tested_bool
% \end{macrocode}
%
-%
+%
%
% \subsection{Options and configuration}
%
@@ -591,6 +591,7 @@ Do not distribute a modified version of this file.
array,
alphalph,
amsmath,
+ amssymb,
booktabs,
color,
colortbl,
@@ -1098,7 +1099,7 @@ Do not distribute a modified version of this file.
}
}
% \end{macrocode}
-% False branch for keys and things that aren't actually csnames:
+% False branch for keys and things that aren't actually csnames:
% \begin{macrocode}
{
% for now don't bother splitting into variants:
@@ -1406,12 +1407,12 @@ Do not distribute a modified version of this file.
{ \int_gzero:N \g_@@_nested_macro_int }
{ \int_incr:N \g_@@_nested_macro_int }
- \bool_gset_false:N \l_@@_macro_aux_bool
- \bool_gset_false:N \l_@@_macro_internal_bool
- \bool_gset_false:N \l_@@_macro_TF_bool
- \bool_gset_false:N \l_@@_macro_pTF_bool
- \bool_gset_false:N \l_@@_macro_var_bool
- \bool_gset_false:N \l_@@_tested_bool
+ \bool_set_false:N \l_@@_macro_aux_bool
+ \bool_set_false:N \l_@@_macro_internal_bool
+ \bool_set_false:N \l_@@_macro_TF_bool
+ \bool_set_false:N \l_@@_macro_pTF_bool
+ \bool_set_false:N \l_@@_macro_var_bool
+ \bool_set_false:N \l_@@_tested_bool
\cs_set_eq:NN \@@_macroname_prefix:n \use:n
\cs_set_eq:NN \@@_macroname_suffix: \c_empty_tl
@@ -1487,11 +1488,11 @@ Do not distribute a modified version of this file.
\cs_set_nopar:Npn \@@_macro_single:n #1
{
\int_incr:N \l_@@_macro_int
-
+
\tl_set:Nx \l_@@_at_replaced_macro_tl { \token_to_str:N #1 }
\@@_replace_at_at:N \l_@@_at_replaced_macro_tl
\tl_set_eq:NN \saved@macroname \l_@@_at_replaced_macro_tl
-
+
\topsep\MacroTopsep
\trivlist
\cs_set_nopar:Npn \makelabel ##1 { \llap{##1} }
@@ -1703,8 +1704,8 @@ Do not distribute a modified version of this file.
\tl_replace_all:Non #1 { \token_to_str:N @ } { @ }
\tl_replace_all:Non #1 { \token_to_str:N _ } { _ }
% \end{macrocode}
-% To make the search-and-replace work, in the source of l3doc
-% itself the \verb|@@| search string needs to be protected from
+% To make the search-and-replace work, in the source of l3doc
+% itself the \verb|@@| search string needs to be protected from
% replacement by l3docstrip! This is easy to do by adding a space.
% \begin{macrocode}
\tl_replace_all:Nox #1 { _@ @ } { __ \g_@@_module_name_tl }
@@ -1754,7 +1755,7 @@ Do not distribute a modified version of this file.
\@.
}
{ \seq_item:Nn \g_@@_tmpa_seq {1}\,~and~others. }
-
+
\bool_if:nT
{
!\l_@@_macro_aux_bool &&
@@ -2519,7 +2520,7 @@ Do not distribute a modified version of this file.
% \subsection{Math extras}
%
% For \pkg{l3fp}.
-%
+%
% \begin{macrocode}
\AtBeginDocument
{
@@ -2531,7 +2532,7 @@ Do not distribute a modified version of this file.
{ \exp_args:Nc \DeclareMathOperator{#1}{#1} }
}
% \end{macrocode}
-%
+%
% \begin{macro}{\nan}
% \begin{macrocode}
\NewDocumentCommand { \nan } { } { \text { \texttt { nan } } }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
index df61cb4b0e4..057b93d8acf 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
@@ -85,22 +85,22 @@
% \maketitle
%
% \begin{documentation}
-%
+%
% \section{Extending \textsf{DocStrip}}
-%
+%
% The \pkg{l3docstrip} module adds \LaTeX3 extensions to the \textsf{DocStrip}
% program for extracting code from \texttt{.dtx}. As such, this documentation
% should be read along with that for \textsf{DocStrip}.
-%
+%
% \section{Internal functions and variables}
-%
+%
% An important consideration for \LaTeX3 development is separating out public
% and internal functions. Functions and variables which are private to one
% module should not be used or modified by any other module. As \TeX{} does
% not have any formal namespacing system, this requires a convention for
% indicating which functions in a code-level module are public and which are
% private.
-%
+%
% Using \pkg{l3docstrip} allows internal functions to be indicated using a
% \enquote{two part} system. Within the \texttt{.dtx} file, internal functions
% may be indicated using |@@| in place of the module name, for example
@@ -124,7 +124,7 @@
% % Some code here
% }
% \tl_new:N \l_@@_internal_tl
-% %</package>
+% %</package>
% \end{verbatim}
% will be extracted as
% \begin{verbatim}
@@ -136,13 +136,13 @@
% \end{verbatim}
% where the |__| indicates that the functions and variables are internal
% to the \texttt{foo} module.
-%
+%
% \end{documentation}
-%
+%
% \begin{implementation}
%
% \section{\pkg{l3docstrip} implementation}
-%
+%
% \begin{macrocode}
%<*program>
% \end{macrocode}
@@ -156,8 +156,8 @@
% \begin{macro}{\checkOption}
% The \cs{checkOption} macro is defined by \textsf{DocStrip} and is redefined
% here to accommodate the new \texttt{\%<@} syntax.
-%
-% When the macros that process a line have found that the line starts with
+%
+% When the macros that process a line have found that the line starts with
% \enquote{\texttt{\%<}}, a guard line has been encountered. The first
% character of a guard can be an asterisk (\texttt{*}), a slash (\texttt{/}),
% a plus (\texttt{+}), a minus (\texttt{-}), a less-than sign (\texttt{<})
@@ -215,7 +215,7 @@
\replaceAllIn\inLine{__@@}{__#1}%
\replaceAllIn\inLine{_@@}{__#1}%
\replaceAllIn\inLine{@@}{__#1}%
- }%
+ }%
\fi
}
\endgroup
@@ -270,7 +270,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macrocode}
%</program>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
index 778038661c1..0347a9625ed 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
@@ -34,13 +34,14 @@
%% -----------------------------------------------------------------------
%%
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3drivers.dtx 4641 2014-01-04 17:05:41Z joseph $
+\GetIdInfo$Id: l3drivers.dtx 4735 2014-05-05 06:25:42Z joseph $
{L3 Experimental drivers}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -97,8 +98,11 @@
% \end{syntax}
% Inserts the content of the \meta{box} at the current insertion point
% such that any material outside of the bounding box will not be displayed
-% by the driver. The material in the \meta{box} is still places in the
+% by the driver. The material in the \meta{box} is still placed in the
% output stream: the clipping takes place at a driver level.
+%
+% This function should only be used within a surrounding horizontal
+% box construct.
% \end{function}
%
% \section{Box rotation and scaling}
@@ -179,7 +183,6 @@
{l3xdvidpfmx.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: xdvipdfmx}
%</xdvipdfmx>
-\__expl_package_check:
%</package>
% \end{macrocode}
%
@@ -215,7 +218,7 @@
% \end{macrocode}
%
% \subsection{Driver utility functions}
-%
+%
% \begin{macro}{\@@_state_save:, \@@_state_restore:}
% All of the drivers have a stack for saving the graphic state. These
% have slightly different interfaces. For both \texttt{dvips} and
@@ -260,7 +263,7 @@
%</pdfmode>
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_literal:n}
% The driver code needs to pass on a lot of \enquote{raw} information to
% the underlying binary. The exact command is driver-dependent but the
@@ -275,7 +278,7 @@
%</dvipdfmx|xdvipdfmx>
% \end{macrocode}
% In the case of \texttt{dvips} there is no build-in saving of the current
-% position, and so some additional PostScript is required.to set up the
+% position, and so some additional PostScript is required to set up the
% transformation matrix and also to restore it afterwards. Notice the use
% of the stack to save the current position \enquote{up front} and to
% move back to it at the end of the process.
@@ -297,7 +300,7 @@
%</pdfmode>
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_literal_direct:n}
% Even \enquote{lower level} than \cs{\@@_literal:n}, these commands do
% not set the transformation matrix but simply dump the driver code directly
@@ -335,7 +338,7 @@
%</dvips>
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_matrix:n}
% Here the appropriate function is set up to insert an affine matrix
% into the PDF. With a new enough \pdfTeX{} (version~1.40.0 or later)
@@ -363,7 +366,7 @@
% \end{macro}
%
% \subsection{Box clipping}
-%
+%
% \begin{macro}{\@@_box_use_clip:N}
% The overall logic to clipping a box is the same in all cases. The general
% method is to save the current location, define a clipping path equivalent
@@ -380,7 +383,7 @@
%<*dvips>
\@@_literal:n
{
- \@@_absolute_lengths:n
+ \@@_absolute_lengths:n
{
0~
\__dim_strip_bp:n { \box_dp:N #1 } ~
@@ -418,7 +421,7 @@
% In PDF mode, an affine matrix is used instead. The transformation for
% \texttt{(x)dvipdfmx} can be done either way: the affine approach is
% chosen here as where possible we pick the PDF-style route.
-%
+%
% In both cases, some rounding code is included to limit the floating
% point values to five decimal places. There is no point using any more
% as \TeX{}'s dimensions are of that precision, and the extra figures
@@ -465,13 +468,12 @@
%</dvips>
}
% \end{macrocode}
-% \end{macro}
% The end of a rotation means tidying up the output grouping.
% \begin{macrocode}
\cs_new_eq:NN \@@_box_rotate_end: \@@_state_restore:
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\@@_box_scale_begin:, \@@_box_scale_end:}
% Scaling is not dissimilar to rotation, but the calculations are somewhat
% less complex.
@@ -518,7 +520,7 @@
%<*pdfmode>
\tl_set:Nn \l_@@_current_color_tl { 0~g~0~G }
%</pdfmode>
-%% \end{macrocode}
+% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\l_@@_color_stack_int}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index fff17ffadcd..6d920d84956 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3expan.dtx 4642 2014-01-04 17:28:32Z joseph $
+\GetIdInfo$Id: l3expan.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Argument expansion}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -623,15 +624,6 @@
%<@@=exp>
% \end{macrocode}
%
-% We start by ensuring that the required packages are loaded.
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \begin{macro}{\exp_after:wN}
% \begin{macro}{\exp_not:N}
% \begin{macro}{\exp_not:n}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index bd9898475a6..45bb0ec7adf 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3file.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3file.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3file.dtx 4596 2013-10-13 21:24:01Z joseph $
+\GetIdInfo$Id: l3file.dtx 4737 2014-05-05 07:37:48Z joseph $
{L3 File and I/O operations}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -192,7 +193,7 @@
% allocated to \meta{file name} until a \cs{ior_close:N} instruction
% is given or the \TeX{} run ends.
% \end{function}
-%
+%
% \begin{function}[added = 2013-01-12, TF]{\ior_open:Nn, \ior_open:cn}
% \begin{syntax}
% \cs{ior_open:NnTF} \meta{stream} \Arg{file name} \Arg{true code} \Arg{false code}
@@ -416,11 +417,11 @@
% Additional functions may be added to the wrapping by using the
% \meta{set up}, which is executed before the wrapping takes place: this
% may include overriding the substitutions listed.
-%
+%
% Any expandable material in the \meta{text} which is not to be expanded
% on wrapping should be converted to a string using \cs{token_to_str:N},
% \cs{tl_to_str:n}, \cs{tl_to_str:N}, \emph{etc.}
-%
+%
% The result of the wrapping operation is passed as a braced argument to the
% \meta{function}, which will typically be a wrapper around a write
% operation. The output of \cs{iow_wrap:nnnN} (\emph{i.e.}~the argument
@@ -428,7 +429,7 @@
% \enquote{other} (category code~12), with the exception of spaces which
% will have category \enquote{space} (category code~10). This means that the
% output will \emph{not} expand further when written to a file.
-%
+%
% \begin{texnote}
% Internally, \cs{iow_wrap:nnnN} carries out an \texttt{x}-type expansion
% on the \meta{text} to expand it. This is done in such a way that
@@ -551,14 +552,6 @@
%<@@=file>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{File operations}
%
% \begin{variable}{\g_file_current_name_tl}
@@ -738,6 +731,7 @@
% \end{macro}
%
% \begin{macro}{\file_input:n}
+% \begin{macro}[int]{\@@_if_exist:nT}
% \begin{macro}[aux]{\@@_input:n \@@_input:V}
% \begin{macro}[aux]{\@@_input_aux:n, \@@_input_aux:o}
% Loading a file is done in a safe way, checking first that the file
@@ -747,13 +741,22 @@
% \begin{macrocode}
\cs_new_protected:Npn \file_input:n #1
{
+ \@@_if_exist:nT {#1}
+ { \@@_input:V \l_@@_internal_name_tl }
+ }
+% \end{macrocode}
+% This code is spun out as a separate function so it is available
+% for other kernel file operations which have the same logic.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_if_exist:nT #1#2
+ {
\file_add_path:nN {#1} \l_@@_internal_name_tl
\quark_if_no_value:NTF \l_@@_internal_name_tl
{
\@@_name_sanitize:nn {#1}
{ \__msg_kernel_error:nnx { kernel } { file-not-found } }
}
- { \@@_input:V \l_@@_internal_name_tl }
+ { #2 }
}
\cs_new_protected:Npn \@@_input:n #1
{
@@ -783,6 +786,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\file_path_include:n}
% \begin{macro}{\file_path_remove:n}
@@ -907,7 +911,7 @@
\cs_generate_variant:Nn \ior_new:N { c }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\ior_open:Nn, \ior_open:cn}
% \begin{macro}[aux]{\@@_open_aux:Nn}
% Opening an input stream requires a bit of pre-processing. The file name
@@ -929,7 +933,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}[TF]{\ior_open:Nn, \ior_open:cn}
% \begin{macro}[aux]{\@@_open_aux:NnTF}
% Much the same idea for opening a read with a conditional, except the
@@ -953,7 +957,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_open:Nn, \@@_open:No}
% \begin{macro}[aux]{\@@_open_stream:Nn}
% The stream allocation itself uses the fact that there is a list of all of
@@ -974,7 +978,7 @@
%</initex>
%<*package>
{
- \newread #1
+ \cs:w newread \cs_end: #1
\tl_set:Nx \l_@@_stream_tl { \int_eval:n {#1} }
\@@_open_stream:Nn #1 {#2}
}
@@ -1182,7 +1186,7 @@
%</initex>
%<*package>
{
- \newwrite #1
+ \cs:w newwrite \cs_end: #1
\tl_set:Nx \l_@@_stream_tl { \int_eval:n {#1} }
\@@_open_stream:Nn #1 {#2}
}
@@ -1286,7 +1290,7 @@
%
% \begin{macro}{\iow_newline:}
% Global variable holding the character that forces a new line when
-% something is written to an output stream
+% something is written to an output stream.
% \begin{macrocode}
\cs_new_nopar:Npn \iow_newline: { ^^J }
% \end{macrocode}
@@ -1450,6 +1454,7 @@
% \end{macro}
%
% \begin{macro}{\iow_wrap:nnnN}
+% \begin{macro}[aux]{\@@_wrap_set:Nx}
% The main wrapping function works as follows. First give |\\|,
% \verb*|\ | and other formatting commands the correct definition for
% messages, before fully-expanding the input. In package mode, the
@@ -1484,7 +1489,7 @@
\tl_set:Nx \l_@@_wrap_tl {#1}
%</initex>
%<*package>
- \protected@edef \l_@@_wrap_tl {#1}
+ \@@_wrap_set:Nx \l_@@_wrap_tl {#1}
%</package>
% \end{macrocode}
% This is a bit of a hack to measure the string length of the run on text
@@ -1515,6 +1520,15 @@
#4 \l_@@_wrap_tl
}
% \end{macrocode}
+% As using the generic loader will mean that \cs{protected@edef} is
+% not available, it's not placed directly in the wrap function but is set
+% up as an auxiliary. In the generic loader this can then be redefined.
+% \begin{macrocode}
+%<*package>
+\cs_new_eq:NN \@@_wrap_set:Nx \protected@edef
+%</package>
+% \end{macrocode}
+% \end{macro}
% \end{macro}
%
% \begin{macro}[aux]{\@@_wrap_loop:w}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
index 8f1d56ce04f..93bf9a5f987 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3final.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3final.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,10 @@
%%
%% -----------------------------------------------------------------------
%
-%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3final.dtx 4586 2013-08-22 08:09:53Z joseph $
- {L3 Experimental format finalisation}
-%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3final.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Experimental format finalisation}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -89,18 +86,20 @@
% \end{macro}
%
% The very last job is to dump the format, taking care to first leave
-% the code environment.
+% the code environment and set the appropriate flag.
% \begin{macrocode}
\use:n
{
+ \bool_set_false:N \l__kernel_expl_bool
\char_set_catcode_space:n { 9 } % tab
\char_set_catcode_space:n { 32 } % space
\char_set_catcode_active:n { 34 } % double quote
\char_set_catcode_active:n { 36 } % dollar
\char_set_catcode_active:n { 38 } % ampersand
+ \char_set_catcode_other:n { 58 } % colon
\char_set_catcode_active:n { 94 } % circumflex
\char_set_catcode_active:n { 95 } % underscore
- \char_set_catcode_other:n { 58 } % colon
+ \char_set_catcode_other:n { 124 } % pipe
\char_set_catcode_active:n { 126 } % tilde
\tex_endlinechar:D = 13 \scan_stop:
\tex_newlinechar:D = 10 \scan_stop:
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
index c7c07218480..cfab331e2a0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%%
-%% File: l3fp-assign.dtx Copyright (C) 2011-2013 The LaTeX3 project
+%% File: l3fp-assign.dtx Copyright (C) 2011-2014 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-assign.dtx 4605 2013-11-19 03:05:27Z bruno $
- {L3 Floating-point assignments}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-assign.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point assignments}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
index 03708beff6f..e90741a8d56 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-aux.dtx Copyright(C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-aux.dtx Copyright(C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,8 +35,8 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-aux.dtx 4622 2013-12-14 13:05:45Z bruno $
+\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-aux.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Floating-point support functions}
\documentclass[full]{l3doc}
\begin{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
index d5ddae31ab0..44d8857b2b5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-basics.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-basics.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-basics.dtx 4619 2013-12-14 12:53:54Z bruno $
- {L3 Floating-point arithmetic}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-basics.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point arithmetic}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -1651,6 +1650,7 @@
{ \@@_sqrt_Newton_o:wwn 17782794; 0; {#1} {#2#3#4#5#6#7#8#9} }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[aux, rEXP]{\@@_sqrt_Newton_o:wwn}
% Newton's method maps $x\mapsto\bigl[(x + [10^{8} a_1 / x])/2\bigr]$
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
index 7b7e11bd20f..77b3d54320b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-convert.dtx Copyright(C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-convert.dtx Copyright(C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-convert.dtx 4601 2013-11-18 23:13:28Z bruno $
- {L3 Floating-point conversion}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-convert.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point conversion}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
index 75a68d95846..8c834488183 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-expo.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-expo.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-expo.dtx 4617 2013-12-14 12:37:59Z bruno $
- {L3 Floating-point exponential-related functions}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-expo.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point exponential-related functions}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
index fabc72e0392..080e95b6d98 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-extended.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-extended.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-extended.dtx 4617 2013-12-14 12:37:59Z bruno $
- {L3 Floating-points with extended precision}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-extended.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-points with extended precision}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
index 49f9630c5f3..42ae286d490 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-logic.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-logic.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-logic.dtx 3504 2012-03-06 06:38:45Z bruno $
- {L3 Floating-point conditionals}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-logic.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point conditionals}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
index b336d346ffe..229840bfcf1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-old.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-old.dtx Copyright (C) 2012 The LaTeX3 Project
+%% File: l3fp-old.dtx Copyright (C) 2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-old.dtx 4163 2012-08-30 16:33:11Z bruno $
- {L3 Experimental floating-points (old)}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-old.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Experimental floating-points (old)}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
index 7f8d4c4a194..755d9020d82 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-parse.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-parse.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-parse.dtx 4622 2013-12-14 13:05:45Z bruno $
- {L3 Floating-point expression parsing}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-parse.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Floating-point expression parsing}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -2240,8 +2239,15 @@
% arithmetic operations. The power operation must be associative in
% the opposite order from all others. For this, we use two distinct
% precedences.
+%
+% The odd requirement to set \cs{+} here is to cover the case where
+% \pkg{expl3} is loaded by plain \TeX{}: \cs{+} is an \cs{outer} macro there,
+% and so the following code would otherwise give an error in that case.
% \begin{macrocode}
\group_begin:
+%<*package>
+ \cs_set_nopar:Npn \+ { }
+%</package>
\char_set_catcode_other:N \&
\char_set_catcode_letter:N \^
\char_set_catcode_letter:N \/
@@ -2614,7 +2620,7 @@
% \end{macro}
% \end{macro}
%
-% \begingroup\catcode`^^@=12\relax % ^^A hack
+% \begingroup\catcode`\^^@=12\relax % ^^A hack
% \begin{macro}[EXP, aux]{\@@_parse_prefix_^^@:Nw}
% \begin{macrocode}
\group_begin:
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
index 556b1960fdd..78ffdfb48de 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-round.dtx Copyright(C) 2011-2012 The LaTeX3 Project
+%% File: l3fp-round.dtx Copyright(C) 2011-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
+\documentclass[full]{l3doc}
\GetIdInfo$Id: l3fp-round.dtx 3549 2012-03-13 20:54:30Z bruno $
{L3 Floating-point rounding}
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
index 3394561ccdf..8ab6c3d7967 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%%
-%% File: l3fp-traps.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-traps.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-traps.dtx 4622 2013-12-14 13:05:45Z bruno $
- {L3 Floating-point exception trapping}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-traps.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating-point exception trapping}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
index 11a058130d1..11415825d54 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3fp-trig.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3fp-trig.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -35,10 +35,9 @@
%%
%
%<*driver>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp-trig.dtx 4617 2013-12-14 12:37:59Z bruno $
- {L3 Floating-point trigonometric functions}
\documentclass[full]{l3doc}
+\GetIdInfo$Id: l3fp-trig.dtx 4721 2014-05-03 13:54:09Z joseph $
+ {L3 Floating-point trigonometric functions}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -469,7 +468,7 @@
% $0.6\cdot\text{ulp}$ in all cases.
%
% ^^A todo: if the exponent range is reduced, store 1/2pi as a simple tl
-% \begin{macro}[aux, EXP]{\@@_trig_inverse_two_pi:}
+% \begin{variable}[aux, EXP]{\@@_trig_inverse_two_pi:}
% This macro expands to |,,!| or~|,!| followed by $10112$~decimals of
% $10^{-16}/(2\pi)$. The number of decimals we really need is the
% maximum exponent plus the number of digits we will need later,~$52$,
@@ -981,28 +980,28 @@
% All inverse trigonometric functions (arcsine, arccosine, arctangent,
% arccotangent, arccosecant, and arcsecant) are based on a function
% often denoted \texttt{atan2}. This function is accessed directly by
-% feeding two arguments to arctangent, and is defined by \(\atan(y, x) =
-% \atan(y/x)\) for generic \(y\) and~\(x\). Its advantages over the
+% feeding two arguments to arctangent, and is defined by \(\operatorname{atan}(y, x) =
+% \operatorname{atan}(y/x)\) for generic \(y\) and~\(x\). Its advantages over the
% conventional arctangent is that it takes values in $[-\pi,\pi]$ rather
% than $[-\pi/2,\pi/2]$, and that it is better behaved in boundary
% cases. Other inverse trigonometric functions are expressed in terms
-% of \(\atan\) as
+% of \(\operatorname{atan}\) as
% \begin{align}
-% \operatorname{acos} x & = \atan(\sqrt{1-x^2}, x) \\
-% \operatorname{asin} x & = \atan(x, \sqrt{1-x^2}) \\
-% \operatorname{asec} x & = \atan(\sqrt{x^2-1}, 1) \\
-% \operatorname{acsc} x & = \atan(1, \sqrt{x^2-1}) \\
-% \operatorname{atan} x & = \atan(x, 1) \\
-% \operatorname{acot} x & = \atan(1, x) .
+% \operatorname{acos} x & = \operatorname{atan}(\sqrt{1-x^2}, x) \\
+% \operatorname{asin} x & = \operatorname{atan}(x, \sqrt{1-x^2}) \\
+% \operatorname{asec} x & = \operatorname{atan}(\sqrt{x^2-1}, 1) \\
+% \operatorname{acsc} x & = \operatorname{atan}(1, \sqrt{x^2-1}) \\
+% \operatorname{atan} x & = \operatorname{atan}(x, 1) \\
+% \operatorname{acot} x & = \operatorname{atan}(1, x) .
% \end{align}
% Rather than introducing a new function, \texttt{atan2}, the arctangent
% function \texttt{atan} is overloaded: it can take one or two
% arguments. In the comments below, following many texts, we call the
-% first argument~$y$ and the second~$x$, because $\atan(y, x) = \atan(y
+% first argument~$y$ and the second~$x$, because $\operatorname{atan}(y, x) = \operatorname{atan}(y
% / x)$ is the angular coordinate of the point $(x, y)$.
%
% As for direct trigonometric functions, the first step in computing
-% $\atan(y, x)$ is argument reduction. The sign of~$y$ will give that
+% $\operatorname{atan}(y, x)$ is argument reduction. The sign of~$y$ will give that
% of the result. We distinguish eight regions where the point $(x,
% \lvert y\rvert)$ can lie, of angular size roughly $\pi/8$,
% characterized by their ``octant'', between $0$ and~$7$ included. In
@@ -1012,29 +1011,29 @@
% arctangent (we assume $y>0$: otherwise replace $y$ by~$-y$ below):
% \begin{itemize}
% \item[0] $0 < \lvert y\rvert < 0.41421 x$, then
-% $\atan\frac{\lvert y\rvert}{x}$
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}$
% is given by a nicely convergent Taylor series;
% \item[1] $0 < 0.41421 x < \lvert y\rvert < x$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% = \frac{\pi}{4}-\atan\frac{x-\lvert y\rvert}{x+\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% = \frac{\pi}{4}-\operatorname{atan}\frac{x-\lvert y\rvert}{x+\lvert y\rvert}$;
% \item[2] $0 < 0.41421 \lvert y\rvert < x < \lvert y\rvert$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% = \frac{\pi}{4}+\atan\frac{-x+\lvert y\rvert}{x+\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% = \frac{\pi}{4}+\operatorname{atan}\frac{-x+\lvert y\rvert}{x+\lvert y\rvert}$;
% \item[3] $0 < x < 0.41421 \lvert y\rvert$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% = \frac{\pi}{2}-\atan\frac{x}{\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% = \frac{\pi}{2}-\operatorname{atan}\frac{x}{\lvert y\rvert}$;
% \item[4] $0 < -x < 0.41421 \lvert y\rvert$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% = \frac{\pi}{2}+\atan\frac{-x}{\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% = \frac{\pi}{2}+\operatorname{atan}\frac{-x}{\lvert y\rvert}$;
% \item[5] $0 < 0.41421 \lvert y\rvert < -x < \lvert y\rvert$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% =\frac{3\pi}{4}-\atan\frac{x+\lvert y\rvert}{-x+\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% =\frac{3\pi}{4}-\operatorname{atan}\frac{x+\lvert y\rvert}{-x+\lvert y\rvert}$;
% \item[6] $0 < -0.41421 x < \lvert y\rvert < -x$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% =\frac{3\pi}{4}+\atan\frac{-x-\lvert y\rvert}{-x+\lvert y\rvert}$;
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% =\frac{3\pi}{4}+\operatorname{atan}\frac{-x-\lvert y\rvert}{-x+\lvert y\rvert}$;
% \item[7] $0 < \lvert y\rvert < -0.41421 x$, then
-% $\atan\frac{\lvert y\rvert}{x}
-% = \pi-\atan\frac{\lvert y\rvert}{-x}$.
+% $\operatorname{atan}\frac{\lvert y\rvert}{x}
+% = \pi-\operatorname{atan}\frac{\lvert y\rvert}{-x}$.
% \end{itemize}
% In the following, we will denote by~$z$ the ratio among
% $\lvert\frac{y}{x}\rvert$, $\lvert\frac{x}{y}\rvert$,
@@ -1051,8 +1050,8 @@
% result should be given in radians or in degrees. Here, we dispatch
% according to the number of arguments. The one-argument versions of
% arctangent and arccotangent are special cases of the two-argument
-% ones: $\atan(y) = \atan(y, 1) = \operatorname{acot}(1, y)$ and
-% $\operatorname{acot}(x) = \atan(1, x) = \operatorname{acot}(x, 1)$.
+% ones: $\operatorname{atan}(y) = \operatorname{atan}(y, 1) = \operatorname{acot}(1, y)$ and
+% $\operatorname{acot}(x) = \operatorname{atan}(1, x) = \operatorname{acot}(x, 1)$.
% \begin{macrocode}
\cs_new_nopar:Npn \@@_atan_o:Nw
{
@@ -1091,7 +1090,7 @@
% other, and we call \cs{@@_atan_inf_o:NNNw} with either an argument
% of~$4$, leading to the values $\pm\pi/2$ (in degrees,~$\pm 90$),
% or~$0$, leading to $\{\pm 0, \pm\pi\}$ (in degrees, $\{\pm 0,\pm
-% 180\}$). Since $\operatorname{acot}(x, y) = \atan(y, x)$,
+% 180\}$). Since $\operatorname{acot}(x, y) = \operatorname{atan}(y, x)$,
% \cs{@@_acotii_o:ww} simply reverses its two arguments.
% \begin{macrocode}
\cs_new:Npn \@@_atanii_o:Nww
@@ -1124,9 +1123,9 @@
% on the signs, and its value is a multiple of $\pi/4$. We use the
% same auxiliary as for normal numbers,
% \cs{@@_atan_combine_o:NwwwwwN}, with arguments the final sign~|#2|;
-% the octant~|#3|; $\atan z/z=1$ as a fixed point number; $z=0$~as a
+% the octant~|#3|; $\operatorname{atan} z/z=1$ as a fixed point number; $z=0$~as a
% fixed point number; and $z=0$~as an extended-precision number.
-% Given the values we provide, $\atan z$ will be computed to be~$0$,
+% Given the values we provide, $\operatorname{atan} z$ will be computed to be~$0$,
% and the result will be $[|#3|/2]\cdot\pi/4$ if the sign~|#5| of~$x$
% is positive, and $[(7-|#3|)/2]\cdot\pi/4$ for negative~$x$, where
% the divisions are rounded up.
@@ -1149,7 +1148,7 @@
% extended-precision numbers, that is, a sign, an exponent ending with
% a comma, and a six-block mantissa ending with a semi-colon. This
% extended precision is required by other inverse trigonometric
-% functions, to compute things like $\atan(x,\sqrt{1-x^2})$ without
+% functions, to compute things like $\operatorname{atan}(x,\sqrt{1-x^2})$ without
% intermediate rounding errors.
% \begin{macrocode}
\cs_new_protected:Npn \@@_atan_normal_o:NNnwNnw
@@ -1166,7 +1165,7 @@
% This receives: the sign~|#1| of~$y$, its exponent~|#2|, its $24$
% digits~|#3| in groups of~$4$, and similarly for~$x$. We prepare to
% call \cs{@@_atan_combine_o:NwwwwwN} which expects the sign~|#1|, the
-% octant, the ratio $(\atan z)/z = 1 - \cdots$, and the value of~$z$,
+% octant, the ratio $(\operatorname{atan} z)/z = 1 - \cdots$, and the value of~$z$,
% both as a fixed point number and as an extended-precision floating
% point number with a mantissa in $[0.01,1)$. For now, we place |#1|
% as a first argument, and start an integer expression for the octant.
@@ -1205,9 +1204,9 @@
% started with is closer to the diagonals $\{\lvert y\rvert = \lvert
% x\rvert\}$ than to the axes $\{xy = 0\}$. In that case, the octant
% is~$1$ (possibly combined with the $7-$ and $3-$ inserted earlier)
-% and we wish to compute $\atan\frac{b-a}{a+b}$. Otherwise, the
+% and we wish to compute $\operatorname{atan}\frac{b-a}{a+b}$. Otherwise, the
% octant is~$0$ (again, combined with earlier terms) and we wish to
-% compute $\atan\frac{a}{b}$. In any case, call \cs{@@_atan_auxi:ww}
+% compute $\operatorname{atan}\frac{a}{b}$. In any case, call \cs{@@_atan_auxi:ww}
% followed by~$z$, as a comma-delimited exponent and a fixed point
% number.
% \begin{macrocode}
@@ -1261,12 +1260,12 @@
%
% \begin{macro}[aux, EXP]
% {\@@_atan_Taylor_loop:www, \@@_atan_Taylor_break:w}
-% We compute the series of $(\atan z)/z$. A typical intermediate
+% We compute the series of $(\operatorname{atan} z)/z$. A typical intermediate
% stage has $|#1|=2k-1$, $|#2| =
% \frac{1}{2k+1}-z^2(\frac{1}{2k+3}-z^2(\cdots-z^2\frac{1}{39}))$, and
% $|#3|=z^2$. To go to the next step $k\to k-1$, we compute
% $\frac{1}{2k-1}$, then subtract from it $z^2$ times |#2|. The loop
-% stops when $k=0$: then |#2| is $(\atan z)/z$, and there is a need to
+% stops when $k=0$: then |#2| is $(\operatorname{atan} z)/z$, and there is a need to
% clean up all the unnecessary data, end the integer expression
% computing the octant with a semicolon, and leave the result~|#2|
% afterwards.
@@ -1293,7 +1292,7 @@
% \begin{macro}[aux, EXP]
% {\@@_atan_combine_o:NwwwwwN, \@@_atan_combine_aux:ww}
% This receives a \meta{sign}, an \meta{octant}, a fixed point value
-% of $(\atan z)/z$, a fixed point number~$z$, and another
+% of $(\operatorname{atan} z)/z$, a fixed point number~$z$, and another
% representation of~$z$, as an \meta{exponent} and the fixed point
% number $10^{-\meta{exponent}} z$, followed by either \cs{use_i:nn}
% (when working in radians) or \cs{use_ii:nn} (when working in
@@ -1302,14 +1301,14 @@
% \meta{sign} \left(
% \left\lceil\frac{\meta{octant}}{2}\right\rceil
% \frac{\pi}{4}
-% + (-1)^{\meta{octant}} \frac{\atan z}{z} \cdot z\right) \,,
+% + (-1)^{\meta{octant}} \frac{\operatorname{atan} z}{z} \cdot z\right) \,,
% \end{equation}
% multiplied by $180/\pi$ if working in degrees, and using in any case
% the most appropriate representation of~$z$. The floating point
% result is passed to \cs{@@_sanitize:Nw}, which checks for overflow
% or underflow. If the octant is~$0$, leave the exponent~|#5| for
-% \cs{@@_sanitize:Nw}, and multiply $|#3|=\frac{\atan z}{z}$
-% with~|#6|, the adjusted~$z$. Otherwise, multiply $|#3|=\frac{\atan
+% \cs{@@_sanitize:Nw}, and multiply $|#3|=\frac{\operatorname{atan} z}{z}$
+% with~|#6|, the adjusted~$z$. Otherwise, multiply $|#3|=\frac{\operatorname{atan}
% z}{z}$ with $|#4|=z$, then compute the appropriate multiple of
% $\frac{\pi}{4}$ and add or subtract the product $|#3|\cdot|#4|$. In
% both cases, convert to a floating point with
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index 586e0f88ed4..6dff7765268 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
@@ -34,13 +34,14 @@
%% -----------------------------------------------------------------------
%%
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp.dtx 4642 2014-01-04 17:28:32Z joseph $
+\GetIdInfo$Id: l3fp.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Floating points}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\usepackage{amsmath}
\begin{document}
\DocInput{\jobname.dtx}
@@ -1306,19 +1307,7 @@
%
% \section{\pkg{l3fp} implementation}
%
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-% \end{macrocode}
-%
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
+% Nothing to see here: everything is in the subfiles!
%
% \end{implementation}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index 17b33143769..2fa99d37bc9 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3int.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3int.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3int.dtx 4583 2013-08-02 19:14:35Z joseph $
+\GetIdInfo$Id: l3int.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Integers}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -605,24 +606,26 @@
% \end{verbatim}
% \end{function}
%
-% \begin{function}[updated = 2011-09-17, EXP]{\int_to_binary:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_to_bin:n}
% \begin{syntax}
-% \cs{int_to_binary:n} \Arg{integer expression}
+% \cs{int_to_bin:n} \Arg{integer expression}
% \end{syntax}
% Calculates the value of the \meta{integer expression} and places
% the binary representation of the result in the input stream.
% \end{function}
%
-% \begin{function}[updated = 2011-09-17, EXP]{\int_to_hexadecimal:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_to_hex:n, \int_to_Hex:n}
% \begin{syntax}
-% \cs{int_to_hexadecimal:n} \Arg{integer expression}
+% \cs{int_to_hex:n} \Arg{integer expression}
% \end{syntax}
% Calculates the value of the \meta{integer expression} and places
% the hexadecimal (base~$16$) representation of the result in the
-% input stream. Upper case letters are used for digits beyond $9$.
+% input stream. Letters are used for digits beyond~$9$: lower
+% case letters for \cs{int_to_hex:n} and upper case ones for
+% \cs{int_to_Hex:n}.
% \end{function}
%
-% \begin{function}[updated = 2011-09-17, EXP]{\int_to_octal:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_to_oct:n}
% \begin{syntax}
% \cs{int_to_octal:n} \Arg{integer expression}
% \end{syntax}
@@ -631,18 +634,21 @@
% stream.
% \end{function}
%
-% \begin{function}[updated = 2011-09-17, EXP]{\int_to_base:nn}
+% \begin{function}[updated = 2014-02-11, EXP]
+% {\int_to_base:nn, \int_to_Base:nn}
% \begin{syntax}
% \cs{int_to_base:nn} \Arg{integer expression} \Arg{base}
% \end{syntax}
% Calculates the value of the \meta{integer expression} and
% converts it into the appropriate representation in the \meta{base};
% the later may be given as an integer expression. For bases greater
-% than $10$ the higher \enquote{digits} are represented by the upper case
-% letters from the English alphabet.
+% than $10$ the higher \enquote{digits} are represented by
+% letters from the English alphabet: lower
+% case letters for \cs{int_to_base:n} and upper case ones for
+% \cs{int_to_Base:n}.
% The maximum \meta{base} value is $36$.
% \begin{texnote}
-% This is a generic version of \cs{int_to_binary:n}, \emph{etc.}
+% This is a generic version of \cs{int_to_bin:n}, \emph{etc.}
% \end{texnote}
% \end{function}
%
@@ -670,17 +676,17 @@
% \cs{int_to_alph:n}.
% \end{function}
%
-% \begin{function}[EXP]{\int_from_binary:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_from_bin:n}
% \begin{syntax}
-% \cs{int_from_binary:n} \Arg{binary number}
+% \cs{int_from_bin:n} \Arg{binary number}
% \end{syntax}
% Converts the \meta{binary number} into the integer (base~$10$)
% representation and leaves this in the input stream.
% \end{function}
%
-% \begin{function}[EXP]{\int_from_hexadecimal:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_from_hex:n}
% \begin{syntax}
-% \cs{int_from_binary:n} \Arg{hexadecimal number}
+% \cs{int_from_hex:n} \Arg{hexadecimal number}
% \end{syntax}
% Converts the \meta{hexadecimal number} into the integer
% (base~$10$) representation and leaves this in the input stream.
@@ -688,9 +694,9 @@
% \meta{hexadecimal number} by upper or lower case letters.
% \end{function}
%
-% \begin{function}[EXP]{\int_from_octal:n}
+% \begin{function}[added = 2014-02-11, EXP]{\int_from_oct:n}
% \begin{syntax}
-% \cs{int_from_octal:n} \Arg{octal number}
+% \cs{int_from_oct:n} \Arg{octal number}
% \end{syntax}
% Converts the \meta{octal number} into the integer (base~$10$)
% representation and leaves this in the input stream.
@@ -914,14 +920,6 @@
%
% \TestFiles{m3int001,m3int002,m3int03}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \begin{macro}{\@@_to_roman:w}
% \begin{macro}{\if_int_compare:w}
% Done in \pkg{l3basics}.
@@ -1087,13 +1085,16 @@
% \begin{macro}{\int_new:N, \int_new:c}
% \UnitTested
% Two ways to do this: one for the format and one for the \LaTeXe{}
-% package.
+% package. In plain \TeX{}, \cs{newcount} (and other allocators) are
+% \cs{outer}: to allow the code here to work in \enquote{generic} mode
+% this is therefore accessed by name. (The same applies to \cs{newbox},
+% \cs{newdimen} and so on.)
% \begin{macrocode}
%<*package>
\cs_new_protected:Npn \int_new:N #1
{
\__chk_if_free_cs:N #1
- \newcount #1
+ \cs:w newcount \cs_end: #1
}
%</package>
\cs_generate_variant:Nn \int_new:N { c }
@@ -1830,9 +1831,9 @@
%
% \begin{macro}{\int_to_base:nn}
% \UnitTested
-% \begin{macro}[aux]{\@@_to_base:nn,
-% \@@_to_base:nnN,\@@_to_base:nnnN}
-% \begin{macro}[aux]{\@@_to_letter:n}
+% \begin{macro}[aux]{\@@_to_base:nn, \@@_to_Base:nn,
+% \@@_to_base:nnN,\@@_to_Base:nnN,\@@_to_base:nnnN,\@@_to_Base:nnnN}
+% \begin{macro}[aux]{\@@_to_letter:n, \@@_to_Letter:n}
% \UnitTested
% Converting from base ten (|#1|) to a second base (|#2|) starts with
% computing |#1|: if it is a complicated calculation, we shouldn't
@@ -1842,12 +1843,20 @@
% \begin{macrocode}
\cs_new:Npn \int_to_base:nn #1
{ \exp_args:Nf \@@_to_base:nn { \int_eval:n {#1} } }
+\cs_new:Npn \int_to_Base:nn #1
+ { \exp_args:Nf \@@_to_Base:nn { \int_eval:n {#1} } }
\cs_new:Npn \@@_to_base:nn #1#2
{
\int_compare:nNnTF {#1} < \c_zero
{ \exp_args:No \@@_to_base:nnN { \use_none:n #1 } {#2} - }
{ \@@_to_base:nnN {#1} {#2} \c_empty_tl }
}
+\cs_new:Npn \@@_to_Base:nn #1#2
+ {
+ \int_compare:nNnTF {#1} < \c_zero
+ { \exp_args:No \@@_to_Base:nnN { \use_none:n #1 } {#2} - }
+ { \@@_to_Base:nnN {#1} {#2} \c_empty_tl }
+ }
% \end{macrocode}
% Here, the idea is to provide a recursive system to deal with the
% input. The output is built up after the end of the function.
@@ -1879,6 +1888,26 @@
#4
#1
}
+\cs_new:Npn \@@_to_Base:nnN #1#2#3
+ {
+ \int_compare:nNnTF {#1} < {#2}
+ { \exp_last_unbraced:Nf #3 { \@@_to_Letter:n {#1} } }
+ {
+ \exp_args:Nf \@@_to_Base:nnnN
+ { \@@_to_Letter:n { \int_mod:nn {#1} {#2} } }
+ {#1}
+ {#2}
+ #3
+ }
+ }
+\cs_new:Npn \@@_to_Base:nnnN #1#2#3#4
+ {
+ \exp_args:Nf \@@_to_Base:nnN
+ { \int_div_truncate:nn {#2} {#3} }
+ {#3}
+ #4
+ #1
+ }
% \end{macrocode}
% Convert to a letter only if necessary, otherwise simply return the
% value unchanged. It would be cleaner to use \cs{int_case:nn},
@@ -1893,6 +1922,39 @@
{
\exp_after:wN \exp_after:wN
\if_case:w \@@_eval:w #1 - \c_ten \@@_eval_end:
+ a
+ \or: b
+ \or: c
+ \or: d
+ \or: e
+ \or: f
+ \or: g
+ \or: h
+ \or: i
+ \or: j
+ \or: k
+ \or: l
+ \or: m
+ \or: n
+ \or: o
+ \or: p
+ \or: q
+ \or: r
+ \or: s
+ \or: t
+ \or: u
+ \or: v
+ \or: w
+ \or: x
+ \or: y
+ \or: z
+ \else: \@@_value:w \@@_eval:w #1 \exp_after:wN \@@_eval_end:
+ \fi:
+ }
+\cs_new:Npn \@@_to_Letter:n #1
+ {
+ \exp_after:wN \exp_after:wN
+ \if_case:w \@@_eval:w #1 - \c_ten \@@_eval_end:
A
\or: B
\or: C
@@ -1927,15 +1989,17 @@
%\end{macro}
%\end{macro}
%
-% \begin{macro}{\int_to_binary:n, \int_to_hexadecimal:n, \int_to_octal:n}
+% \begin{macro}{\int_to_bin:n, \int_to_hex:n, \int_to_Hex:n, \int_to_oct:n}
% \UnitTested
% Wrappers around the generic function.
% \begin{macrocode}
-\cs_new:Npn \int_to_binary:n #1
+\cs_new:Npn \int_to_bin:n #1
{ \int_to_base:nn {#1} { 2 } }
-\cs_new:Npn \int_to_hexadecimal:n #1
+\cs_new:Npn \int_to_hex:n #1
{ \int_to_base:nn {#1} { 16 } }
-\cs_new:Npn \int_to_octal:n #1
+\cs_new:Npn \int_to_Hex:n #1
+ { \int_to_Base:nn {#1} { 16 } }
+\cs_new:Npn \int_to_oct:n #1
{ \int_to_base:nn {#1} { 8 } }
% \end{macrocode}
% \end{macro}
@@ -2141,15 +2205,15 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\int_from_binary:n, \int_from_hexadecimal:n, \int_from_octal:n}
+% \begin{macro}{\int_from_bin:n, \int_from_hex:n, \int_from_oct:n}
% \UnitTested
% Wrappers around the generic function.
% \begin{macrocode}
-\cs_new:Npn \int_from_binary:n #1
+\cs_new:Npn \int_from_bin:n #1
{ \int_from_base:nn {#1} \c_two }
-\cs_new:Npn \int_from_hexadecimal:n #1
+\cs_new:Npn \int_from_hex:n #1
{ \int_from_base:nn {#1} \c_sixteen }
-\cs_new:Npn \int_from_octal:n #1
+\cs_new:Npn \int_from_oct:n #1
{ \int_from_base:nn {#1} \c_eight }
% \end{macrocode}
% \end{macro}
@@ -2363,6 +2427,22 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\int_to_binary:n, \int_from_binary:n}
+% \begin{macro}{\int_to_hexadecimal:n, \int_from_hexadecimal:n}
+% \begin{macro}{\int_to_octal:n, \int_from_octal:n}
+% Deprecated 2014-02-11.
+% \begin{macrocode}
+\cs_new_eq:NN \int_to_binary:n \int_to_bin:n
+\cs_new_eq:NN \int_to_hexadecimal:n \int_to_Hex:n
+\cs_new_eq:NN \int_to_octal:n \int_to_oct:n
+\cs_new_eq:NN \int_from_binary:n \int_from_bin:n
+\cs_new_eq:NN \int_from_hexadecimal:n \int_from_hex:n
+\cs_new_eq:NN \int_from_octal:n \int_from_oct:n
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index a825c0cad3b..f49bd433df4 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3keys.dtx Copyright (C) 2006-2013 The LaTeX3 Project
+%% File: l3keys.dtx Copyright (C) 2006-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3keys.dtx 4614 2013-12-08 17:07:31Z joseph $
- {L3 Experimental key-value interfaces}
+\GetIdInfo$Id: l3keys.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Key-value interfaces}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -281,7 +282,7 @@
% (which must a floating point expression). If the variable does not exist,
% it will be created globally at the point that the key is set up.
% \end{function}
-%
+%
% \begin{function}[added = 2013-07-14]
% {.groups:n}
% \begin{syntax}
@@ -321,7 +322,7 @@
% is used, then the value will be passed through to the subsidiary
% \meta{keys} for processing (as |#1|).
% \end{function}
-%
+%
% \begin{function}[added = 2013-07-10]{.meta:nn}
% \begin{syntax}
% \meta{key} .meta:nn = \Arg{path} \Arg{keyval list}
@@ -330,7 +331,7 @@
% one go using the \meta{path} in place of the current one.
% If \meta{key} is given with a value at the time the key
% is used, then the value will be passed through to the subsidiary
-% \meta{keys} for processing (as |#1|).
+% \meta{keys} for processing (as |#1|).
% \end{function}
%
% \begin{function}[added = 2011-08-21]{.multichoice:}
@@ -488,7 +489,7 @@
% These variables do not have defined behaviour when used outside of
% code created using \texttt{.choices:nn}
% (\emph{i.e.}~anything might happen).
-%
+%
% It is possible to allow choice keys to take values which have not previously
% been defined by adding code for the special \texttt{unknown} choice. The
% general behavior of the \texttt{unknown} key is described in
@@ -501,16 +502,16 @@
% key / choice-a .code:n = code-a,
% key / choice-b .code:n = code-b,
% key / choice-c .code:n = code-c,
-% key / unknown .code:n =
+% key / unknown .code:n =
% \msg_error:nnxxx { mymodule } { unknown-choice }
% { key } % Name of choice key
% { choice-a , choice-b , choice-c } % Valid choices
% { \exp_not:n {#1} } % Invalid choice given
% %
-% %
+% %
% }
% \end{verbatim}
-%
+%
% Multiple choices are created in a very similar manner to mutually-exclusive
% choices, using the properties \texttt{.multichoice:} and
% \texttt{.multichoices:nn}. As with mutually exclusive choices, multiple
@@ -538,8 +539,8 @@
% key / choice-c .code:n = code-c,
% }
% \end{verbatim}
-% are valid.
-%
+% are valid.
+%
% When a multiple choice key is set
% \begin{verbatim}
% \keys_set:nn { mymodule }
@@ -557,9 +558,9 @@
% key = c ,
% }
% \end{verbatim}
-% Thus each separate choice will have passed to it the
+% Thus each separate choice will have passed to it the
% \cs{l_keys_choice_tl} and \cs{l_keys_choice_int} in exactly
-% the same way as described for \texttt{.choices:nn}.
+% the same way as described for \texttt{.choices:nn}.
%
% \section{Setting keys}
%
@@ -573,17 +574,17 @@
% by defining a special \texttt{unknown} key: this will be illustrated
% later.
% \end{function}
-%
+%
% \begin{variable}{\l_keys_key_tl, \l_keys_path_tl, \l_keys_value_tl}
% For each key processed, information of the full \emph{path} of the
% key, the \emph{name} of the key and the \emph{value} of the key is
% available within three token list variables. These may be used within
% the code of the key.
-%
+%
% The \emph{value} is everything after the \texttt{=}, which may be
% empty if no value was given. This is stored in \cs{l_keys_value_tl}, and
% is not processed in any way by \cs{keys_set:nn}.
-%
+%
% The \emph{path} of the key is a \enquote{full} description of the key,
% and is unique for each key. It consists of the module and full key name,
% thus for example
@@ -596,7 +597,7 @@
% \end{verbatim}
% has path \texttt{mymodule/subset/key-a}. This information is stored in
% \cs{l_keys_path_tl}, and will have been processed by \cs{tl_to_str:n}.
-%
+%
% The \emph{name} of the key is the part of the path after the last
% \texttt{/}, and thus is not unique. In the preceding examples, both keys
% have name \texttt{key-a} despite having different paths. This information
@@ -619,7 +620,7 @@
% }
% \end{verbatim}
%
-% \begin{function}[added = 2011-08-23]
+% \begin{function}[added = 2011-08-23, updated = 2014-04-27]
% {
% \keys_set_known:nnN, \keys_set_known:nVN,
% \keys_set_known:nvN, \keys_set_known:noN,
@@ -636,13 +637,16 @@
% are not processed further by the parser.
% The key--value pairs for each \emph{unknown} key name will be
% stored in the \meta{tl} in a comma-separated form (\emph{i.e.}~an edited
-% version of the \meta{keyval list}). The \cs{keys_set_known:nn} version skips
-% this stage.
+% version of the \meta{keyval list}). The \cs{keys_set_known:nn} version
+% skips this stage.
+%
+% Use of \cs{keys_set_known:nnN} can be nested, with the correct residual
+% \meta{keyval list} returned at each stage.
% \end{function}
-%
+%
% \section{Selective key setting}
% \label{sec:l3keys:selective}
-%
+%
% In some cases it may be useful to be able to select only some keys for
% setting, even though these keys have the same path. For example, with
% a set of keys defined using
@@ -675,12 +679,12 @@
% will assign \texttt{key-one} and \texttt{key-two} to group \texttt{first},
% \texttt{key-three} to group \texttt{second}, while \texttt{key-four} is
% not assigned to a group.
-%
+%
% Selective key setting may be achieved either by selecting one or more
% groups to be made \enquote{active}, or by marking one or more groups to
% be ignored in key setting.
-%
-% \begin{function}[added = 2013-07-14]
+%
+% \begin{function}[added = 2013-07-14, updated = 2014-04-27]
% {
% \keys_set_filter:nnnN, \keys_set_filter:nnVN,
% \keys_set_filter:nnvN, \keys_set_filter:nnoN,
@@ -697,8 +701,11 @@
% key which is filtered out will be stored in the \meta{tl} in a
% comma-separated form (\emph{i.e.}~an edited version of the \meta{keyval
% list}). The \cs{keys_set_filter:nnn} version skips this stage.
+%
+% Use of \cs{keys_set_filter:nnnN} can be nested, with the correct residual
+% \meta{keyval list} returned at each stage.
% \end{function}
-%
+%
% \begin{function}[added = 2013-07-14]
% {
% \keys_set_groups:nnn, \keys_set_groups:nnV,
@@ -826,14 +833,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Low-level interface}
%
% \begin{macrocode}
@@ -1077,7 +1076,7 @@
\tl_new:N \l_keys_choice_tl
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_groups_clist}
% Used for storing and recovering the list of groups which apply to a key:
% set as a comma list but at one point we have to use this for a token
@@ -1108,7 +1107,7 @@
\bool_new:N \l_@@_no_value_bool
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_only_known_bool}
% Used to track if only \enquote{known} keys are being set.
% \begin{macrocode}
@@ -1131,7 +1130,7 @@
\tl_new:N \l_@@_property_tl
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_selective_bool, \l_@@_filtered_bool}
% Two flags for using key groups: one to indicate that \enquote{selective}
% setting is active, a second to specify which type (\enquote{opt-in}
@@ -1141,7 +1140,7 @@
\bool_new:N \l_@@_filtered_bool
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_selective_seq}
% The list of key groups being filtered in or out during selective setting.
% \begin{macrocode}
@@ -1162,7 +1161,7 @@
\tl_new:N \l_keys_value_tl
% \end{macrocode}
% \end{variable}
-%
+%
% \begin{variable}{\l_@@_tmp_bool}
% Scratch space.
% \begin{macrocode}
@@ -1399,7 +1398,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}[int]{\@@_groups_set:n}
% Assigning a key to one or more groups uses comma lists. So that the comma
% list is \enquote{well-behaved} later, the storage is done via a stored
@@ -1521,7 +1520,7 @@
%
% The key property functions are all wrappers for internal functions,
% meaning that things stay readable and can also be altered later on.
-%
+%
% Importantly, while key properties have \enquote{normal} argument specs, the
% underlying code always supplies one braced argument to these. As such, argument
% expansion is handled by hand rather than using the standard tools. This shows
@@ -1655,7 +1654,7 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}{.groups:n}
% A single property to create groups of keys.
% \begin{macrocode}
@@ -1701,7 +1700,7 @@
{ \@@_meta_make:n {#1} }
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{.meta:nn}
% Meta with path: potentially lots of variants, but for the moment
% no so many defined.
@@ -1816,21 +1815,29 @@
% \keys_set_known:nnN, \keys_set_known:nVN,
% \keys_set_known:nvN, \keys_set_known:noN
% }
+% \begin{macro}[aux]{\@@_set_known:nnnN, \@@_set_known:onnN}
% \begin{macro}
% {
% \keys_set_known:nn, \keys_set_known:nV,
% \keys_set_known:nv, \keys_set_known:no
% }
% Setting known keys simply means setting the appropriate flag, then
-% running the standard code.
+% running the standard code. To allow for nested setting, any existing
+% value of \cs{l_@@_unused_clist} is saved on the stack and reset
+% afterwards.Note that for speed/simplicity reasons we use a \texttt{tl}
+% operation to set the \texttt{clist} here!
% \begin{macrocode}
-\cs_new_protected:Npn \keys_set_known:nnN #1#2#3
+\cs_new_protected_nopar:Npn \keys_set_known:nnN
+ { \@@_set_known:onnN \l_@@_unused_clist }
+\cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no }
+\cs_new_protected:Npn \@@_set_known:nnnN #1#2#3#4
{
\clist_clear:N \l_@@_unused_clist
- \keys_set_known:nn {#1} {#2}
- \tl_set:Nx #3 { \exp_not:o { \l_@@_unused_clist } }
+ \keys_set_known:nn {#2} {#3}
+ \tl_set:Nx #4 { \exp_not:o { \l_@@_unused_clist } }
+ \tl_set:Nn \l_@@_unused_clist {#1}
}
-\cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no }
+\cs_generate_variant:Nn \@@_set_known:nnnN { o }
\cs_new_protected:Npn \keys_set_known:nn #1#2
{
\bool_set_true:N \l_@@_only_known_bool
@@ -1841,12 +1848,14 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {
% \keys_set_filter:nnnN, \keys_set_filter:nnVN, \keys_set_filter:nnvN
% \keys_set_filter:nnoN
% }
+% \begin{macro}[aux]{\@@_set_filter:nnnnN, \@@_set_filter:onnnN}
% \begin{macro}
% {
% \keys_set_filter:nnn, \keys_set_filter:nnV, \keys_set_filter:nnv
@@ -1858,15 +1867,20 @@
% \keys_set_groups:nno
% }
% The idea of setting keys in a selective manner again uses flags
-% wrapped around the basic code.
+% wrapped around the basic code. The comments on \cs{keys_set_known:nnN}
+% also apply here.
% \begin{macrocode}
-\cs_new_protected:Npn \keys_set_filter:nnnN #1#2#3#4
+\cs_new_protected_nopar:Npn \keys_set_filter:nnnN
+ { \@@_set_filter:onnnN \l_@@_unused_clist }
+\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
+\cs_new_protected:Npn \@@_set_filter:nnnnN #1#2#3#4#5
{
\clist_clear:N \l_@@_unused_clist
- \keys_set_filter:nnn {#1} {#2} {#3}
- \tl_set:Nx #4 { \exp_not:o { \l_@@_unused_clist } }
+ \keys_set_filter:nnn {#2} {#3} {#4}
+ \tl_set:Nx #5 { \exp_not:o { \l_@@_unused_clist } }
+ \tl_set:Nn \l_@@_unused_clist {#1}
}
-\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
+\cs_generate_variant:Nn \@@_set_filter:nnnnN { o }
\cs_new_protected:Npn \keys_set_filter:nnn #1#2#3
{
\bool_set_true:N \l_@@_selective_bool
@@ -1889,6 +1903,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[int]{\@@_set_elt:n, \@@_set_elt:nn}
% \begin{macro}[aux]{\@@_set_elt_aux:nn}
@@ -2155,7 +2170,7 @@
{
\c_msg_coding_error_text_tl
Inside~\keys_define:nn each~key~name~
- needs~a~property: \\ \\
+ needs~a~property: \\ \\
\iow_indent:n { #1 .<property> } \\ \\
LaTeX~did~not~find~a~'.'~to~indicate~the~start~of~a~property.
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index d6e34107c13..ccecf9c4f48 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3luatex.dtx Copyright (C) 2010-2013 The LaTeX3 Project
+%% File: l3luatex.dtx Copyright (C) 2010-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3luatex.dtx 4581 2013-07-28 08:38:50Z joseph $
+\GetIdInfo$Id: l3luatex.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Experimental LuaTeX-specific functions}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -234,15 +235,6 @@
%<*initex|package>
% \end{macrocode}
%
-% Announce and ensure that the required packages are loaded.
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \begin{macro}{\lua_now_x:n, \lua_now_x:x}
% \begin{macro}{\lua_now:n, \lua_now:x}
% \begin{macro}{\lua_shipout_x:n, \lua_shipout_x:x}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index aa3cf3ca654..44a558917aa 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3msg.dtx Copyright (C) 2009-2013 The LaTeX3 Project
+%% File: l3msg.dtx Copyright (C) 2009-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3msg.dtx 4581 2013-07-28 08:38:50Z joseph $
+\GetIdInfo$Id: l3msg.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Messages}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -231,7 +232,7 @@
% message is given, using |#1| as the name of the \meta{module} to
% be included.
% \end{function}
-%
+%
% \begin{function}[EXP]{\msg_see_documentation_text:n}
% \begin{syntax}
% \cs{msg_see_documentation_text:n} \Arg{module}
@@ -239,7 +240,7 @@
% Produces the standard text
% \begin{quote}
% \ttfamily
-%
+%
% See the \meta{module} documentation for further information.
% \end{quote}
% This function can be redefined to alter the language in which the
@@ -768,17 +769,9 @@
% \begin{macrocode}
%<*initex|package>
% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=msg>
-% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
+%<@@=msg>
% \end{macrocode}
%
% \begin{variable}{\l_@@_internal_tl}
@@ -905,9 +898,9 @@
\tl_const:Nn \c_msg_continue_text_tl
{ Type~<return>~to~continue }
\tl_const:Nn \c_msg_critical_text_tl
- { Reading~the~current~file~will~stop }
+ { Reading~the~current~file~will~stop. }
\tl_const:Nn \c_msg_fatal_text_tl
- { This~is~a~fatal~error:~LaTeX~will~abort }
+ { This~is~a~fatal~error:~LaTeX~will~abort. }
\tl_const:Nn \c_msg_help_text_tl
{ For~immediate~help~type~H~<return> }
\tl_const:Nn \c_msg_no_info_text_tl
@@ -1350,7 +1343,7 @@
% \begin{macrocode}
\group_end:
% \end{macrocode}
-%
+%
% \begin{macro}[aux]{\@@_class_chk_exist:nT}
% Checking that a message class exists. We build this from
% \cs{cs_if_free:cTF} rather than \cs{cs_if_exist:cTF} because that
@@ -1760,7 +1753,7 @@
\c_msg_return_text_tl
}
\@@_kernel_new:nnnn { kernel } { message-redirect-loop }
- {
+ {
Message~redirection~loop~caused~by~ {#1} ~=>~ {#2}
\tl_if_empty:nF {#3} { ~for~module~' \use_none:n #3 ' } .
}
@@ -1835,6 +1828,19 @@
LaTeX~has~been~asked~to~define~the~conditional~form~'#1'~of~
the~function~'#2',~but~only~'TF',~'T',~'F',~and~'p'~forms~exist.
}
+\bool_if:NT \l@expl@check@declarations@bool
+ {
+ \@@_kernel_new:nnnn { check } { non-declared-variable }
+ { The~variable~#1~has~not~been~declared~\msg_line_context:. }
+ {
+ Checking~is~active,~and~you~have~tried~do~so~something~like: \\
+ \ \ \tl_set:Nn ~ #1 ~ \{ ~ ... ~ \} \\
+ without~first~having: \\
+ \ \ \tl_new:N ~ #1 \\
+ \\
+ LaTeX~will~create~the~variable~and~continue.
+ }
+ }
\@@_kernel_new:nnnn { kernel } { scanmark-already-defined }
{ Scan~mark~#1~already~defined. }
{
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
index 55b9165bfeb..b2e834d843c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
-%<*package>
-\RequirePackage{l3bootstrap}[2012/07/15]
-\GetIdInfo$Id: l3names.dtx 4640 2014-01-04 16:03:52Z joseph $
- {L3 Namespace for primitives}
-%</package>
%<*driver>
\documentclass[full]{l3doc}
+%</driver>
+%<*driver|package>
+\GetIdInfo$Id: l3names.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Namespace for primitives}
+%</driver|package>
+%<*driver>
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -102,11 +103,9 @@
%<*initex|package>
% \end{macrocode}
%
+% No prefix substitution here.
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-%</package>
+%<@@=>
% \end{macrocode}
%
% The code here simply renames all of the primitives to new, internal,
@@ -596,8 +595,10 @@
\__kernel_primitive:NN \directlua \luatex_directlua:D
\__kernel_primitive:NN \initcatcodetable \luatex_initcatcodetable:D
\__kernel_primitive:NN \latelua \luatex_latelua:D
+ \__kernel_primitive:NN \luaescapestring \luatex_luaescapestring:D
\__kernel_primitive:NN \luatexversion \luatex_luatexversion:D
\__kernel_primitive:NN \savecatcodetable \luatex_savecatcodetable:D
+ \__kernel_primitive:NN \Uchar \luatex_Uchar:D
% \end{macrocode}
% Slightly more awkward are the directional primitives in \LuaTeX{}. These
% come from Omega \emph{via} Aleph, but we do not support those engines and
@@ -614,39 +615,79 @@
% \begin{macrocode}
\tex_endgroup:D
% \end{macrocode}
-%
+% If the underlying engine is Lua\TeX{} then the \tn{pdfstrcmp} primitive
+% is emulated as \cs{expl_pdfstrcmp} as part of the bootstrap process.
+% That can be detected as \cs{pdftex_strcmp:D} will not be defined: is
+% that is the case, copy the code and then remove the temporary emulation.
+% \begin{macrocode}
+\etex_ifdefined:D \pdftex_strcmp:D
+\tex_else:D
+ \tex_let:D \pdftex_strcmp:D \expl_pdfstrcmp
+ \tex_let:D \expl_pdfstrcmp \tex_undefined:D
+\tex_fi:D
+% \end{macrocode}
+%
% \LaTeXe{} will have moved a few primitives, so these are sorted out.
+% A convenient test for \LaTeXe{} is the \cs{@@end} saved primitive.
% \begin{macrocode}
%<*package>
-\tex_let:D \tex_end:D \@@end
-\tex_let:D \tex_everydisplay:D \frozen@everydisplay
-\tex_let:D \tex_everymath:D \frozen@everymath
-\tex_let:D \tex_hyphen:D \@@hyph
-\tex_let:D \tex_input:D \@@input
-\tex_let:D \tex_italiccorrection:D \@@italiccorr
-\tex_let:D \tex_underline:D \@@underline
+\etex_ifdefined:D \@@end
+ \tex_let:D \tex_end:D \@@end
+ \tex_let:D \tex_everydisplay:D \frozen@everydisplay
+ \tex_let:D \tex_everymath:D \frozen@everymath
+ \tex_let:D \tex_hyphen:D \@@hyph
+ \tex_let:D \tex_input:D \@@input
+ \tex_let:D \tex_italiccorrection:D \@@italiccorr
+ \tex_let:D \tex_underline:D \@@underline
% \end{macrocode}
-% That is also true for the \pkg{luatex} package for \LaTeXe{}.
+% That is also true for the \LuaTeX{} primitives under \LaTeXe{}.
% \begin{macrocode}
-\tex_let:D \luatex_catcodetable:D \luatexcatcodetable
-\tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable
-\tex_let:D \luatex_latelua:D \luatexlatelua
-\tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable
+ \tex_let:D \luatex_catcodetable:D \luatexcatcodetable
+ \tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable
+ \tex_let:D \luatex_latelua:D \luatexlatelua
+ \tex_let:D \luatex_luaescapestring:D \luatexluaescapestring
+ \tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable
+ \tex_let:D \luatex_Uchar:D \luatexUchar
% \end{macrocode}
% Which also covers those slightly odd ones.
% \begin{macrocode}
-\tex_let:D \luatex_bodydir:D \luatexbodydir
-\tex_let:D \luatex_mathdir:D \luatexmathdir
-\tex_let:D \luatex_pagedir:D \luatexpagedir
-\tex_let:D \luatex_pardir:D \luatexpardir
-\tex_let:D \luatex_textdir:D \luatextextdir
+ \tex_let:D \luatex_bodydir:D \luatexbodydir
+ \tex_let:D \luatex_mathdir:D \luatexmathdir
+ \tex_let:D \luatex_pagedir:D \luatexpagedir
+ \tex_let:D \luatex_pardir:D \luatexpardir
+ \tex_let:D \luatex_textdir:D \luatextextdir
+\tex_fi:D
% \end{macrocode}
-% Finally, in package mode with \LuaTeX{} the \cs{pdfstrcmp} primitive will
-% be emulated as \cs{pdf@strcmp}.
+%
+% For Con\TeX{}t, two tests are needed. Both Mark~II and Mark~IV move several
+% primitives: these are all covered by the first test, again using \cs{end}
+% as a marker. For Mark~IV, a few more primitives are moved: they are
+% implemented using some Lua code in the current Con\TeX{}t.
% \begin{macrocode}
-\etex_ifdefined:D \pdftex_strcmp:D
-\tex_else:D
- \tex_let:D \pdftex_strcmp:D \pdf@strcmp
+\etex_ifdefined:D \normalend
+ \tex_let:D \tex_outer:D \normalouter
+ \tex_let:D \tex_input:D \normalinput
+ \tex_let:D \tex_end:D \normalend
+ \tex_let:D \tex_language:D \normallanguage
+ \tex_let:D \tex_vcenter:D \normalvcneter
+ \tex_let:D \tex_over:D \normalover
+ \tex_let:D \tex_mathop:D \normalmathop
+ \tex_let:D \tex_month:D \normalmonth
+ \tex_let:D \tex_everyjob:D \normaleveryjob
+ \tex_let:D \etex_unexpanded:D \normalunexpanded
+\tex_fi:D
+\etex_ifdefined:D \normalitaliccorrection
+ \tex_let:D \tex_hoffset:D \normalhoffset
+ \tex_let:D \tex_italiccorrection:D \normalitaliccorrection
+ \tex_let:D \tex_voffset:D \normalvoffset
+ \tex_let:D \etex_showtokens:D \normalshowtokens
+ \tex_let:D \luatex_bodydir:D \spac_directions_normal_body_dir
+ \tex_let:D \luatex_pagedir:D \spac_directions_normal_page_dir
+\tex_fi:D
+\etex_ifdefined:D \normalleft
+ \tex_let:D \tex_left:D \normalleft
+ \tex_let:D \tex_middle:D \normalmiddle
+ \tex_let:D \tex_right:D \normalright
\tex_fi:D
%</package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index 599957933fe..3613101e0b6 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prg.dtx 4642 2014-01-04 17:28:32Z joseph $
+\GetIdInfo$Id: l3prg.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Control structures}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -694,14 +695,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Primitive conditionals}
%
% \begin{macro}{\if_bool:N}
@@ -823,6 +816,55 @@
% \end{macro}
% \end{macro}
%
+% Booleans are not based on token lists but do need checking: this
+% code complements similar material in \pkg{l3tl}.
+% \begin{macrocode}
+%<*package>
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \bool_set_true:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1 \c_true_bool
+ }
+ \cs_set_protected:Npn \bool_set_false:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1 \c_false_bool
+ }
+ \cs_set_protected:Npn \bool_gset_true:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1 \c_true_bool
+ }
+ \cs_set_protected:Npn \bool_gset_false:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1 \c_false_bool
+ }
+ \cs_set_protected:Npn \bool_set_eq:NN #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1
+ }
+ \cs_set_protected:Npn \bool_gset_eq:NN #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1
+ }
+ \cs_set_protected:Npn \bool_set:Nn #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \tex_chardef:D #1 = \bool_if_p:n {#2}
+ }
+ \cs_set_protected:Npn \bool_gset:Nn #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2}
+ }
+\tex_fi:D
+%</package>
+% \end{macrocode}
+%
% \begin{macro}[pTF]{\bool_if:N, \bool_if:c}
% \UnitTested
% Straight forward here. We could optimize here if we wanted to as
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index bce67a2fb30..265833a8e10 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3prop.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3prop.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prop.dtx 4623 2013-12-14 13:53:40Z bruno $
+\GetIdInfo$Id: l3prop.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Property lists}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -494,14 +495,6 @@
%<@@=prop>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% A property list is a macro whose top-level expansion is for the form
% \begin{quote}
% \cs{s_@@}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
index d38da212ecb..e204fe0dec2 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3quark.dtx Copyright (C) 1990-2012 The LaTeX3 Project
+%% File: l3quark.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3quark.dtx 4623 2013-12-14 13:53:40Z bruno $
+\GetIdInfo$Id: l3quark.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Quarks}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -373,7 +374,7 @@
% contexts, they can be used to mark the end of a set of instructions.
% This allows to skip to that point if the end of the instructions
% should not be performed (see \pkg{l3regex}).
-%
+%
% The scan marks system is only for internal use by the kernel team in
% a small number of very specific places. These functions should not be
% used more generally.
@@ -412,14 +413,6 @@
%<*initex|package>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Quarks}
%
% \begin{macro}{\quark_new:N}
@@ -613,7 +606,7 @@
% \end{variable}
%
% \subsection{Scan marks}
-%
+%
% \begin{macrocode}
%<@@=scan>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index ef713afaa31..6924433ab00 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3seq.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3seq.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3seq.dtx 4623 2013-12-14 13:53:40Z bruno $
+\GetIdInfo$Id: l3seq.dtx 4712 2014-04-30 08:17:49Z joseph $
{L3 Sequences and stacks}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -767,14 +768,6 @@
%<@@=seq>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% A sequence is a control sequence whose top-level expansion is of the
% form \enquote{\cs{s_@@} \cs{@@_item:n} \marg{item_1} \ldots
% \cs{@@_item:n} \marg{item_n}}, with a leading scan
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index f7af3985dd1..abd4bac865d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
%% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project
-%% (C) 2012,2013 The LaTeX3 Project
+%% (C) 2012-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -34,13 +34,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3skip.dtx 4581 2013-07-28 08:38:50Z joseph $
+\GetIdInfo$Id: l3skip.dtx 4738 2014-05-05 08:00:05Z joseph $
{L3 Dimensions and skips}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -936,14 +937,6 @@
%<@@=dim>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% \subsection{Length primitives renamed}
%
% \begin{macro}{\if_dim:w}
@@ -968,7 +961,7 @@
\cs_new_protected:Npn \dim_new:N #1
{
\__chk_if_free_cs:N #1
- \newdimen #1
+ \cs:w newdimen \cs_end: #1
}
%</package>
\cs_generate_variant:Nn \dim_new:N { c }
@@ -1351,9 +1344,17 @@
% \end{macro}
%
% \begin{macro}[EXP, int]{\@@_strip_bp:n}
+% Conversion to big points is done using a scaling inside \cs{__dim_eval:w}
+% as \eTeX{} does that using $64$-bit precision. Here, $800/803$ is the
+% integer fraction for $72/72.27$.
% \begin{macrocode}
\cs_new:Npn \@@_strip_bp:n #1
- { \@@_strip_pt:n { 0.996 26 \@@_eval:w #1 \@@_eval_end: } }
+ {
+ \__dim_strip_pt:n
+ {
+ \__dim_eval:w ( #1 ) * 800 / 803 \__dim_eval_end:
+ }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1446,7 +1447,7 @@
\cs_new_protected:Npn \skip_new:N #1
{
\__chk_if_free_cs:N #1
- \newskip #1
+ \cs:w newskip \cs_end: #1
}
%</package>
\cs_generate_variant:Nn \skip_new:N { c }
@@ -1687,7 +1688,7 @@
\cs_new_protected:Npn \muskip_new:N #1
{
\__chk_if_free_cs:N #1
- \newmuskip #1
+ \cs:w newmuskip \cs_end: #1
}
%</package>
\cs_generate_variant:Nn \muskip_new:N { c }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index f5164b6f093..befa072b22d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3tl.dtx Copyright (C) 1990-2013 The LaTeX3 Project
+%% File: l3tl.dtx Copyright (C) 1990-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3tl.dtx 4625 2013-12-27 15:55:36Z joseph $
+\GetIdInfo$Id: l3tl.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Token lists}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -333,20 +334,28 @@
% \cs{tl_set_rescan:Nnn} \meta{tl~var} \Arg{setup} \Arg{tokens}
% \end{syntax}
% Sets \meta{tl~var} to contain \meta{tokens},
-% applying the category code r{\'e}gime specified in the
+% applying the category code r\'{e}gime specified in the
% \meta{setup} before carrying out the assignment. This allows the
% \meta{tl~var} to contain material with category codes
-% other than those that apply when \meta{tokens} are absorbed. See also
-% \cs{tl_rescan:nn}.
+% other than those that apply when \meta{tokens} are absorbed.
+% Trailing spaces at the end of the \meta{tokens} are discarded
+% in the rescanning process. The \meta{setup} is not limited to
+% changes of category code but may contain any valid input, for
+% example assignment of the expansion of active tokens.
+% See also \cs{tl_rescan:nn}.
% \end{function}
%
% \begin{function}[updated = 2011-12-18]{\tl_rescan:nn}
% \begin{syntax}
% \cs{tl_rescan:nn} \Arg{setup} \Arg{tokens}
% \end{syntax}
-% Rescans \meta{tokens} applying the category code r\'egime specified
+% Rescans \meta{tokens} applying the category code r\'{e}gime specified
% in the \meta{setup}, and leaves the resulting tokens in the input
-% stream. See also \cs{tl_set_rescan:Nnn}.
+% stream. Trailing spaces at the end of the \meta{tokens} are discarded
+% in the rescanning process. The \meta{setup} is not limited to
+% changes of category code but may contain any valid input, for
+% example assignment of the expansion of active tokens.
+% See also \cs{tl_set_rescan:Nnn}.
% \end{function}
%
% \section{Reassigning token list character codes}
@@ -632,29 +641,50 @@
%
% \section{Using token lists}
%
-% \begin{function}[EXP]{\tl_to_str:N, \tl_to_str:c}
+% \begin{function}[EXP]{\tl_to_str:n}
% \begin{syntax}
-% \cs{tl_to_str:N} \meta{tl~var}
+% \cs{tl_to_str:n} \Arg{token list}
% \end{syntax}
-% Converts the content of the \meta{tl~var} into a series of characters
-% with category code $12$ (other) with the exception of spaces, which
-% retain category code $10$ (space). This \meta{string} is then left
-% in the input stream.
+% Converts the \meta{token list} to a \meta{string}, leaving the
+% resulting character tokens in the input stream. A \meta{string}
+% is a series of tokens with category code $12$ (other) with the exception
+% of spaces, which retain category code $10$ (space).
+% \begin{texnote}
+% Converting a \meta{token list} to a \meta{string} yields a
+% concatenation of the string representations of every token in the
+% \meta{token list}.
+% The string representation of a control sequence is
+% \begin{itemize}
+% \item an escape character, whose character code is given by the
+% internal parameter \tn{escapechar}, absent if the
+% \tn{escapechar} is negative;
+% \item the control sequence name, as defined by \cs{cs_to_str:N};
+% \item a space, unless the control sequence name is a single
+% character whose category at the time of expansion of
+% \cs{tl_to_str:n} is not \enquote{letter}.
+% \end{itemize}
+% The string representation of an explicit character token is that
+% character, doubled in the case of (explicit) macro parameter
+% characters (normally |#|).
+% In particular, the string representation of a token list may
+% depend on the category codes in effect when it is evaluated, and
+% the value of the \tn{escapechar}: for instance |\tl_to_str:n {\a}|
+% normally produces the three character \enquote{backslash},
+% \enquote{lower-case a}, \enquote{space}, but it may also produce a
+% single \enquote{lower-case a} if the escape character is negative
+% and \texttt{a} is currently not a letter.
+% \end{texnote}
% \end{function}
%
-% \begin{function}[EXP]{\tl_to_str:n}
+% \begin{function}[EXP]{\tl_to_str:N, \tl_to_str:c}
% \begin{syntax}
-% \cs{tl_to_str:n} \Arg{tokens}
+% \cs{tl_to_str:N} \meta{tl~var}
% \end{syntax}
-% Converts the given \meta{tokens} into a series of characters with
-% category code $12$ (other) with the exception of spaces, which
+% Converts the content of the \meta{tl~var} into a series of characters
+% with category code $12$ (other) with the exception of spaces, which
% retain category code $10$ (space). This \meta{string} is then left
-% in the input stream. Note that this function requires only a single
-% expansion.
-% \begin{texnote}
-% This is the \eTeX{} primitive \tn{detokenize}. Hence its argument
-% \emph{must} be given within braces.
-% \end{texnote}
+% in the input stream. For low-level details, see the notes given for
+% \cs{tl_to_str:n}.
% \end{function}
%
% \begin{function}[EXP]{\tl_use:N, \tl_use:c}
@@ -810,7 +840,7 @@
% \end{verbatim}
% yields \verb*| ab|.
% A blank \meta{token list} (see \cs{tl_if_blank:nTF}) will result in
-% \cs{tl_head:n} leaving nothing in the input stream.
+% \cs{tl_head:n} leaving nothing in the input stream.
% \begin{texnote}
% The result is returned within \cs{exp_not:n}, which means that the token
% list will not expand further when appearing in an \texttt{x}-type
@@ -1047,14 +1077,6 @@
%<@@=tl>
% \end{macrocode}
%
-% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
-% \end{macrocode}
-%
% A token list variable is a \TeX{} macro that holds tokens. By using the
% \eTeX{} primitive \tn{unexpanded} inside a \TeX{} \tn{edef} it is
% possible to store any tokens, including |#|, in this way.
@@ -1159,7 +1181,7 @@
\prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p }
% \end{macrocode}
% \end{macro}
-%
+%%
% \subsection{Constant token lists}
%
% \begin{variable}{\c_empty_tl}
@@ -1328,6 +1350,85 @@
% \end{macro}
% \end{macro}
%
+% When used as a package, there is an option to be picky and to
+% check definitions exist. This part of the process is done now, so that
+% variable types based on |tl| (for example |clist|, |seq| and |prop|) will
+% inherit the appropriate definitions.
+% No \cs{tl_map_\ldots} yet as the mechanisms are not fully in place. Thus
+% instead do a more low level set up for a mapping, as in \pkg{l3basics}.
+% \begin{macrocode}
+%<*package>
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \__cs_tmp:w #1
+ {
+ \if_meaning:w ? #1
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \use:x
+ {
+ \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 }
+ {
+ \__chk_if_exist_var:N \exp_not:n {##1}
+ \exp_not:o { #1 {##1} {##2} }
+ }
+ }
+ \__cs_tmp:w
+ }
+ \__cs_tmp:w
+ \tl_set:Nn \tl_set:No \tl_set:Nx
+ \tl_gset:Nn \tl_gset:No \tl_gset:Nx
+ \tl_put_left:Nn \tl_put_left:NV
+ \tl_put_left:No \tl_put_left:Nx
+ \tl_gput_left:Nn \tl_gput_left:NV
+ \tl_gput_left:No \tl_gput_left:Nx
+ \tl_put_right:Nn \tl_put_right:NV
+ \tl_put_right:No \tl_put_right:Nx
+ \tl_gput_right:Nn \tl_gput_right:NV
+ \tl_gput_right:No \tl_gput_right:Nx
+ ? \q_recursion_stop
+%</package>
+% \end{macrocode}
+% The two \texttt{set_eq} functions are done by hand as the internals there
+% are a bit different.
+% \begin{macrocode}
+%<*package>
+ \cs_set_protected:Npn \tl_set_eq:NN #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \cs_set_eq:NN #1 #2
+ }
+ \cs_set_protected:Npn \tl_gset_eq:NN #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \cs_gset_eq:NN #1 #2
+ }
+%</package>
+% \end{macrocode}
+% There is also a need to check all three arguments of the
+% \texttt{concat} functions: a token list |#2| or |#3| equal to
+% \cs{scan_stop:} would lead to problems later on.
+% \begin{macrocode}
+%<*package>
+ \cs_set_protected:Npn \tl_concat:NNN #1#2#3
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \__chk_if_exist_var:N #3
+ \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
+ }
+ \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \__chk_if_exist_var:N #3
+ \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
+ }
+\tex_fi:D
+%</package>
+% \end{macrocode}
+%
% \subsection{Reassigning token list category codes}
%
% \begin{variable}{\c_@@_rescan_marker_tl}
@@ -2259,7 +2360,7 @@
% the closing delimiter: this is the only safe choice, as any other token
% would not be able to parse it's own code. Using a marker, we can see if
% what we are grabbing is exactly the marker, or there is anything else to
-% deal with. Is there is, there is a loop. If not, tidy up and leave the
+% deal with. Is there is, there is a loop. If not, tidy up and leave the
% item in the output stream. More detail in
% \url{http://tex.stackexchange.com/a/70168}.
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 7132a1f40c0..ff569c8e8c0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3token.dtx Copyright (C) 2005-2013 The LaTeX3 Project
+%% File: l3token.dtx Copyright (C) 2005-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -33,13 +33,14 @@
%%
%% -----------------------------------------------------------------------
%
+%<*driver>
+\documentclass[full]{l3doc}
+%</driver>
%<*driver|package>
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3token.dtx 4587 2013-08-25 21:30:10Z joseph $
+\GetIdInfo$Id: l3token.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental token manipulation}
%</driver|package>
%<*driver>
-\documentclass[full]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -956,17 +957,9 @@
% \begin{macrocode}
%<*initex|package>
% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=token>
-% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%</package>
+%<@@=token>
% \end{macrocode}
%
% \subsection{Character tokens}
diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
index f66febfeaeb..6158b9c21a9 100644
--- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3keys2e.dtx (C) Copyright 2009,2011-2013 The LaTeX3 Project
+%% File: l3keys2e.dtx (C) Copyright 2009,2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -37,8 +37,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2013/12/31]
-%<package>\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+%<package>\@ifpackagelater{expl3}{2014/05/05}
%<package> {}
%<package> {%
%<package> \PackageError{l3keys2e}{Support package l3kernel too old}
@@ -50,7 +50,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3keys2e.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: l3keys2e.dtx 4740 2014-05-05 14:04:24Z joseph $
{LaTeX2e option processing using LaTeX3 keys}
%</driver|package>
%<*driver>
@@ -143,7 +143,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=keys>
% \end{macrocode}
@@ -153,6 +153,11 @@
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
% \end{macrocode}
%
+% One non-standard variant needed.
+% \begin{macrocode}
+\cs_generate_variant:Nn \clist_put_right:Nn { Nv }
+% \end{macrocode}
+%
% \begin{macro}{\l_@@_latexe_options_clist}
% A single list is used for all options, into which they are collected
% before processing.
@@ -193,7 +198,11 @@
}
}
}
- \keys_set:nV {#1} \l_@@_latexe_options_clist
+ \clist_map_inline:Nn \l_@@_latexe_options_clist
+ {
+ \tl_set:Nn \CurrentOption {##1}
+ \keys_set:nn {#1} {##1}
+ }
\AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: }
}
% \end{macrocode}
@@ -230,14 +239,20 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_latexe_options_class:n #1
{
- \keys_if_exist:nnTF {#1} { unknown }
- { \clist_put_right:No \l_@@_latexe_options_clist \@classoptionslist }
+ \cs_if_free:cF { opt@ \@currname . \@currext }
{
- \clist_map_inline:Nn \@classoptionslist
+ \keys_if_exist:nnTF {#1} { unknown }
{
- \keys_if_exist:nnTF {#1} { \@@_latexe_remove_equals:n {##1} }
- { \clist_put_right:Nn \l_@@_latexe_options_clist {##1} }
- { \clist_put_right:Nn \@unusedoptionlist {##1} }
+ \clist_put_right:Nv \l_@@_latexe_options_clist
+ { opt@ \@currname . \@currext }
+ }
+ {
+ \clist_map_inline:cn { opt@ \@currname . \@currext }
+ {
+ \keys_if_exist:nnTF {#1} { \@@_latexe_remove_equals:n {##1} }
+ { \clist_put_right:Nn \l_@@_latexe_options_clist {##1} }
+ { \clist_put_right:Nn \@unusedoptionlist {##1} }
+ }
}
}
}
diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
index 0d3243c8dd8..7a1f982e844 100644
--- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
%% File: xfrac.dtx Copyright (C) 2004, 2008-2010 Morten Hoegholm
-%% (C) 2011,2012 The LaTeX3 Project
+%% (C) 2011,2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -37,7 +37,7 @@
%
%<*driver|package>
\RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate}
-\GetIdInfo$Id: xfrac.dtx 4299 2012-11-09 18:48:51Z joseph $
+\GetIdInfo$Id: xfrac.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental split-level fractions}
%</driver|package>
%<*driver>
@@ -530,7 +530,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=xfrac>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 5c8c0ddaa43..cda5afc4764 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
@@ -4,7 +4,7 @@
%% David Carlisle
%% (C) Copyright 2004-2008 Frank Mittelbach,
%% The LaTeX3 Project
-%% (C) Copyright 2009-2013 The LaTeX3 Project
+%% (C) Copyright 2009-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -41,8 +41,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2013/12/31]
-%<package>\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+%<package>\@ifpackagelater{expl3}{2014/05/05}
%<package> {}
%<package> {%
%<package> \PackageError{xparse}{Support package l3kernel too old}
@@ -54,7 +54,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: xparse.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: xparse.dtx 4740 2014-05-05 14:04:24Z joseph $
{L3 Experimental document command parser}
%</driver|package>
%<*driver>
@@ -213,7 +213,7 @@
% \item |#4| = ||
% \item |#5| = |Three|
% \end{itemize}
-%
+%
% Delimited argument types (\texttt{d}, \texttt{o} and \texttt{r}) are
% defined such that they require matched pairs of delimiters when collecting
% an argument. For example
@@ -225,7 +225,7 @@
% Also note that |{| and |}| cannot be used as delimiters as they are used
% by \TeX{} as grouping tokens. Arguments to be grabbed inside these tokens
% must be created as either \texttt{m}- or \texttt{g}-type arguments.
-%
+%
% Within delimited arguments, non-balanced or otherwise awkward tokens may
% be included by protecting the entire argument with a brace pair
% \begin{verbatim}
@@ -280,6 +280,8 @@
% \verb*|\foo{arg1} [arg2]| will not. This is so that trailing optional
% arguments are not picked up \enquote{by accident} in input.
%
+% There is one major exception to the rules listed above: when \pkg{xparse} is used to define what \TeX\ defines as \enquote{control symbols} in which the function name is made up of a single character, such as \enquote{\cmd{\\}}, spaces are \emph{not} ignored directly after them even for mandatory arguments.
+%
% \subsection{Required delimited arguments}
%
% The contrast between a delimited (\texttt{D}-type) and \enquote{required
@@ -339,6 +341,7 @@
% \meta{function}. The argument specification for the function is
% given by \meta{arg spec}, and expanding
% to be replaced by the \meta{code}.
+% \end{function}
%
% As an example:
% \begin{verbatim}
@@ -372,10 +375,9 @@
%
% \begin{texnote}
% Unlike \LaTeXe{}'s \cs{newcommand} and relatives, the
-% \cs{DeclareDocumentCommand} function do not prevent creation of
+% \cs{DeclareDocumentCommand} family of functions do not prevent creation of
% functions with names starting \cs{end\ldots}.
% \end{texnote}
-% \end{function}
%
% \begin{function}
% {
@@ -404,8 +406,10 @@
% \begin{function}[EXP,TF]{\IfNoValue}
% \begin{syntax}
% \cs{IfNoValueTF} \Arg{argument} \Arg{true code} \Arg{false code}
+% \cs{IfNoValueT} \Arg{argument} \Arg{true code}
+% \cs{IfNoValueF} \Arg{argument} \Arg{false code}
% \end{syntax}
-% The \cs{IfNoValue} tests are used to check if \meta{argument} (|#1|,
+% The \cs{IfNoValue(TF)} tests are used to check if \meta{argument} (|#1|,
% |#2|, \emph{etc.}) is the special |-NoValue-| marker For example
% \begin{verbatim}
% \DeclareDocumentCommand \foo { o m }
@@ -418,6 +422,10 @@
% will use a different internal function if the optional argument
% is given than if it is not present.
%
+% Note that three tests are available, depending on which outcome
+% branches are required: \cs{IfNoValueTF}, \cs{IfNoValueT} and
+% \cs{IfNoValueF}.
+%
% As the \cs{IfNoValue(TF)} tests are expandable, it is possible to
% test these values later, for example at the point of typesetting or
% in an expansion context.
@@ -521,7 +529,7 @@
% input. The processed input is placed inside
% $\text{\meta{number}} + 1$ sets of braces for further use.
% If there are fewer than \Arg{number} of \Arg{tokens} in the argument
-% then empty brace groups are added at the end of the processed
+% then \cs{NoValue} markers are added at the end of the processed
% argument.
% \begin{verbatim}
% \DeclareDocumentCommand \foo
@@ -692,7 +700,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=xparse>
% \end{macrocode}
@@ -703,7 +711,7 @@
% \end{macrocode}
%
% \subsection{Variables and constants}
-%
+%
% \begin{variable}{\c_@@_no_value_tl}
% A special \enquote{awkward} token list: it contains two |-|~tokens with
% different category codes. This is used as the marker for nothing being
@@ -1661,12 +1669,14 @@
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_expandable_type_g:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { g }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { g }
\@@_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \@@_add_expandable_type_G:w #1
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { G }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { G }
\@@_add_expandable_type_m:w
}
% \end{macrocode}
@@ -1679,7 +1689,8 @@
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_expandable_type_l:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { l }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { l }
\@@_add_expandable_type_m:w
}
% \end{macrocode}
@@ -1753,7 +1764,8 @@
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_expandable_type_u:w #1
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { u }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { u }
\@@_add_expandable_type_m:w
}
% \end{macrocode}
@@ -1764,7 +1776,8 @@
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_expandable_type_v:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { v }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { v }
\@@_add_expandable_type_m:w
}
% \end{macrocode}
@@ -3143,20 +3156,20 @@
{
You~have~used~\NewDocumentCommand
with~a~command~that~already~has~a~definition. \\
- The~existing~definition~of~'#1'~will~be~overwritten.
+ The~existing~definition~of~'#1'~will~not~be~altered.
}
\__msg_kernel_new:nnnn { xparse } { command-not-yet-defined }
{ Command ~'#1'~not~yet~defined! }
{
You~have~used~\RenewDocumentCommand
- with~a~command~that~was~never~defined.\\
+ with~a~command~that~was~never~defined. \\
A~new~command~'#1'~will~be~created.
}
\__msg_kernel_new:nnnn { xparse } { environment-already-defined }
{ Environment~'#1'~already~defined! }
{
You~have~used~\NewDocumentEnvironment
- with~an~environment~that~already~has~a~definition.\\
+ with~an~environment~that~already~has~a~definition. \\
The~existing~definition~of~'#1'~will~be~overwritten.
}
\__msg_kernel_new:nnnn { xparse } { environment-mismatch }
@@ -3169,18 +3182,20 @@
{ Environment~'#1'~not~yet~defined! }
{
You~have~used~\RenewDocumentEnvironment
- with~an~environment~that~was~never~defined.\\
+ with~an~environment~that~was~never~defined. \\
A~new~environment~'#1'~will~be~created.
}
\__msg_kernel_new:nnnn { xparse } { environment-unknown }
{ Environment~'#1'~undefined. }
{
You~have~tried~to~start~an~environment~called~'#1',~
- but~this~has~never~been~defined.\\
+ but~this~has~never~been~defined. \\
The~command~will~be~ignored.
}
\__msg_kernel_new:nnnn { xparse } { expandable-ending-optional }
- { Argument~specification~for~expandable~command~ends~with~optional~argument. }
+ {
+ Argument~specification~for~expandable~command~ends~with~optional~argument.
+ }
{
\c_msg_coding_error_text_tl
Expandable~commands~must~have~a~final~mandatory~argument~
@@ -3449,7 +3464,7 @@
% \end{macro}
%
% \subsection{Package options}
-%
+%
% \begin{variable}{\l_@@_options_clist}
% \begin{variable}{\l_@@_log_bool}
% Key--value option to log information: done by hand to keep dependencies
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
index 534ebfa4c28..bef0843c51c 100644
--- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
@@ -4,7 +4,7 @@
%% David Carlisle
%% (C) Copyright 2004-2010 Frank Mittelbach,
%% The LaTeX3 Project
-%% (C) Copyright 2011-2013 The LaTeX3 Project
+%% (C) Copyright 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -41,8 +41,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2013/12/31]
-%<package>\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+%<package>\@ifpackagelater{expl3}{2014/05/05}
%<package> {}
%<package> {%
%<package> \PackageError{xtemplate}{Support package l3kernel too old}
@@ -54,7 +54,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: xtemplate.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: xtemplate.dtx 4740 2014-05-05 14:04:24Z joseph $
{L3 Experimental prototype document functions}
%</driver|package>
%<*driver>
@@ -657,7 +657,7 @@
% \texttt{a}, \texttt{b} and \texttt{c}, plus code for an \texttt{unknown}
% branch.
% \end{function}
-%
+%
% \section{Collections}
%
% The implementation of templates includes a concept termed
@@ -671,7 +671,7 @@
% achieve this, at least with the current approach. As such, the collection
% functions should be regarded as deprecated: they remain available to support
% existing code, but will be removed when a better mechanism is developed.
-%
+%
%
% \begin{function}{\ShowCollectionInstanceValues}
% \begin{syntax}
@@ -691,7 +691,7 @@
% \begin{macrocode}
%<*package>
% \end{macrocode}
-%
+%
% \begin{macrocode}
%<@@=xtemplate>
% \end{macrocode}
@@ -2278,7 +2278,7 @@
% \begin{macro}[aux]{\@@_assign_tokenlist_aux:NN}
% Life would be easy here if it were not for \cs{KeyValue}. To deal
% correctly with that, we need to allow for the recovery a a stored value
-% at point of use.
+% at point of use.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_assign_tokenlist:
{
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty b/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty
deleted file mode 100644
index ace519666d8..00000000000
--- a/Master/texmf-dist/tex/latex/l3experimental/l3dt/l3dt.sty
+++ /dev/null
@@ -1,449 +0,0 @@
-%%
-%% This is file `l3dt.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3dt.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File l3dt.dtx Copyright (C) 2011-2013 The LaTeX3 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 released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\RequirePackage{expl3}
-\GetIdInfo$Id: l3dt.dtx 4482 2013-04-24 21:05:12Z joseph $
- {L3 Experimental data tables}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\quark_new:N \q__dt
-\quark_new:N \q__dt_row
-\quark_new:N \q__dt_header
-\tl_const:Nn \c_empty_dt
- {
- { 0 }
- { 0 }
- \q__dt
- \q_nil
- \q__dt_header
- \q__dt_row
- }
-\cs_new_protected:Npn \dt_new:N #1 { \cs_new_eq:NN #1 \c_empty_dt }
-\cs_new_protected:Npn \dt_clear:N #1 { \cs_set_eq:NN #1 \c_empty_dt }
-\cs_new_protected:Npn \dt_gclear:N #1 { \cs_gset_eq:NN #1 \c_empty_dt }
-\cs_new_protected:Npn \dt_clear_new:N #1
- { \cs_if_exist:NTF #1 { \dt_clear:N #1 } { \dt_new:N #1 } }
-\cs_new_protected:Npn \dt_gclear_new:N #1
- { \cs_if_exist:NTF #1 { \dt_gclear:N #1 } { \dt_new:N #1 } }
-\cs_new_eq:NN \dt_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \dt_gset_eq:NN \tl_gset_eq:NN
-\dt_new:N \l_tmpa_dt
-\dt_new:N \l_tmpb_dt
-\dt_new:N \g_tmpa_dt
-\dt_new:N \g_tmpb_dt
-\cs_new_protected:Npn \__dt_split:nnnn #1#2#3#4 { #3 #2 }
-\cs_new_protected:Npn \__dt_split:w { }
-\cs_new:Npn \__dt_split_header:NT #1#2
- { \exp_after:wN \__dt_split_header:wn #1 \q_stop {#2} }
-\cs_new:Npn \__dt_split_header:wn #1 \q_nil \q__dt_header #2 \q_stop #3
- { #3 {#1} { \q__dt_header #2 } }
-\cs_new_protected:Npn \__dt_split_key:nnTF #1#2
- { \exp_args:No \__dt_split_key_aux:nnTF { \tl_to_str:n {#2} } {#1} }
-\cs_new_protected:Npn \__dt_split_key_aux:nnTF #1#2
- {
- \cs_set_protected:Npn \__dt_split:w
- ##1 \q__dt #1 \q__dt ##2##3##4 \q_mark ##5 \q_stop
- { \__dt_split:nnnn ##3 { { ##1 \q__dt } {##2} {##4} } }
- \__dt_split:w #2 \q_mark
- \q__dt #1 \q__dt { } { ? \use_ii:nn { } } \q_mark \q_stop
- }
-\cs_new_protected:Npn \__dt_split_key_list:NnTF #1#2
- { \exp_args:NNo \__dt_split_key_list_aux:NnTF #1 { \tl_to_str:n {#2} } }
-\cs_new_protected:Npn \__dt_split_key_list_aux:NnTF #1#2
- {
- \cs_set_protected:Npn \__dt_split:w
- ##1##2##3 \q__dt #2 \q__dt ##4##5 \q__dt_header ##6 \q_mark ##7 \q_stop
- {
- \__dt_split:nnnn ##4
- { { {##1} {##2} ##3 \q__dt } { ##4##5 \q__dt_header ##6 } }
- }
- \exp_after:wN \__dt_split:w #1 \q_mark
- \q__dt #2 \q__dt { ? \use_ii:nn { } } \q__dt_header \q_mark \q_stop
- }
-\cs_new_protected:Npn \__dt_split_row:NnTF #1#2
- { \__dt_split_row_aux:NfTF #1 { \int_eval:n {#2} } }
-\cs_new_protected:Npn \__dt_split_row_aux:NnTF #1#2
- {
- \cs_set_protected:Npn \__dt_split:w
- ##1 \q__dt_row #2 \q__dt ##2##3 \q__dt_row ##4 \q_mark ##5 \q_stop
- {
- \__dt_split:nnnn ##2
- { { ##1 \q__dt_row } { #2 \q__dt ##2##3 } {##4} }
- }
- \exp_after:wN \__dt_split:w #1 \q_mark
- \q__dt_row #2 \q__dt { ? \use_ii:nn { } } \q__dt_row \q_mark \q_stop
- }
-\cs_generate_variant:Nn \__dt_split_row_aux:NnTF { Nf }
-\cs_new_protected_nopar:Npn \dt_add_key:Nn { \__dt_add_key:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gadd_key:Nn { \__dt_add_key:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \__dt_add_key:NNn #1#2#3
- {
- \__dt_split_key_list:NnTF #2 {#3}
- { \use_none:nn }
- {
- \__dt_split_header:NT #2
- { \__dt_add_key:NNnnn #1 #2 {#3} }
- }
- }
-\cs_new_protected:Npn \__dt_add_key:NNnnn #1#2#3#4#5
- { \__dt_add_key:NNnnnwnn #1 #2 #4 \q_stop {#3} {#5} }
-\cs_new_protected:Npn \__dt_add_key:NNnnnwnn #1#2#3#4#5 \q_stop #6#7
- {
- #1 #2
- {
- {#3}
- { \int_eval:n { #4 + \c_one } }
- \exp_not:n {#5}
- \tl_to_str:n {#6}
- \exp_not:n { \q__dt \q_nil #7 }
- }
- }
-\cs_new_protected_nopar:Npn \dt_add_row:N { \__dt_add_row:NN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gadd_row:N { \__dt_add_row:NN \tl_gset:Nx }
-\cs_new_protected:Npn \__dt_add_row:NN #1#2
- { \__dt_add_row:NfN #1 { \int_eval:n { \dt_rows:N #2 + \c_one } } #2 }
-\cs_new_protected:Npn \__dt_add_row:NnN #1#2#3
- {
- #1 #3
- {
- {#2}
- \exp_after:wN \__dt_add_row:nw #3 \q_stop
- #2
- \exp_not:n { \q__dt \q_nil \q__dt_row }
- }
- }
-\cs_generate_variant:Nn \__dt_add_row:NnN { Nf }
-\cs_new:Npn \__dt_add_row:nw #1#2 \q_stop { \exp_not:n {#2} }
-\cs_new_protected:Npn \dt_put:Nnn #1
- { \dt_put:Nnnn #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_gput:Nnn #1
- { \dt_gput:Nnnn #1 { \dt_rows:N #1 } }
-\cs_new_protected_nopar:Npn \dt_put:Nnnn
- { \__dt_put:NNNnnn \dt_add_key:Nn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gput:Nnnn
- { \__dt_put:NNNnnn \dt_gadd_key:Nn \tl_gset:Nx }
-\cs_new_protected:Npn \__dt_put:NNNnnn #1#2#3#4#5#6
- {
- #1 #3 {#5}
- \__dt_split_row:NnTF #3 {#4}
- { \__dt_put:NNnnnnn #2 #3 {#5} {#6} }
- {
- \__msg_kernel_error:nnxxx { dt } { unknown-row }
- { \token_to_str:N #3 } { \int_eval:n {#4} } { \dt_rows:N #3 }
- }
- }
-\cs_new_protected:Npn \__dt_put:NNnnnnn #1#2#3#4#5#6#7
- {
- \__dt_split_key:nnTF {#6} {#3}
- { \__dt_put_update:NNnnnnnnn #1 #2 {#3} {#4} {#5} {#7} }
- { \__dt_put_add_to_row:NNnnnnn #1 #2 {#3} {#4} {#5} {#6} {#7} }
- }
-\cs_new_protected:Npn \__dt_put_update:NNnnnnnnn #1#2#3#4#5#6#7#8#9
- {
- #1 #2
- {
- \exp_not:n { #5 #7 }
- \tl_to_str:n {#3}
- \exp_not:n { \q__dt {#4} \q__dt #9 \q__dt_row #6 }
- }
- }
-\cs_new_protected:Npn \__dt_put_add_to_row:NNnnnnn #1#2#3#4#5#6#7
- {
- #1 #2
- {
- \exp_not:n {#5}
- \exp_not:o { \__dt_put_add_to_row_aux:w #6 }
- \tl_to_str:n {#3}
- \exp_not:n { \q__dt {#4} \q__dt \q_nil \q__dt_row #7 }
- }
- }
-\cs_new:Npn \__dt_put_add_to_row_aux:w #1 \q_nil {#1}
-\cs_new:Npn \dt_keys:N #1 { \exp_after:wN \__dt_keys:nnw #1 \q_stop }
-\cs_new:Npn \__dt_keys:nnw #1#2#3 \q_stop {#2}
-\cs_new:Npn \dt_rows:N #1
- { \exp_after:wN \use_i_delimit_by_q_stop:nw #1 \q_stop }
-\cs_new_protected:Npn \dt_remove:Nn #1
- { \dt_remove:Nnn #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_gremove:Nn #1
- { \dt_gremove:Nnn #1 { \dt_rows:N #1 } }
-\cs_new_protected_nopar:Npn \dt_remove:Nnn { \dt_remove_aux:NNnn \tl_set:Nn }
-\cs_new_protected_nopar:Npn \dt_gremove:Nnn { \dt_remove_aux:NNnn \tl_gset:Nn }
-\cs_new_protected:Npn \dt_remove_aux:NNnn #1#2#3#4
- {
- \__dt_split_row:NnTF #2 {#3}
- { \dt_remove_aux:NNnnnn #1 #2 {#4} }
- { }
- }
-\cs_new_protected:Npn \dt_remove_aux:NNnnnn #1#2#3#4#5#6
- {
- \__dt_split_key:nnTF {#5} {#3}
- { \dt_remove_aux:NNnnnnn #1 #2 {#4} {#6} }
- { }
- }
-\cs_new_protected:Npn \dt_remove_aux:NNnnnnn #1#2#3#4#5#6#7
- { #1 #2 { #3 #5 #7 #4 } }
-\cs_new_protected_nopar:Npn \dt_remove_key:Nn
- { \dt_remove_key_aux:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gremove_key:Nn
- { \dt_remove_key_aux:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \dt_remove_key_aux:NNn #1#2#3
- {
- \__dt_split_key_list:NnTF #2 {#3}
- { \exp_args:No \dt_remove_key_aux:nNNnn { \tl_to_str:n {#3} } #1 #2 }
- { }
- }
-\cs_new_protected:Npn \dt_remove_key_aux:nNNnn #1#2#3#4#5
- { \dt_remove_key_aux:nNNnnwn {#1} #2 #3 #4 \q_stop {#5} }
-\cs_new_protected:Npn \dt_remove_key_aux:nNNnnwn #1#2#3#4#5#6 \q_stop #7
- {
- \cs_set:Npn \dt_remove_key_aux:w ##1 \q__dt #1 \q__dt ##2 ##3
- {
- \exp_not:n {##1}
- \__quark_if_recursion_tail_break:nN {##3} \dt_map_break:
- \dt_remove_key_aux:w ##3
- }
-
- #2 #3
- {
- {#4}
- { \int_eval:n { #5 - \c_one } }
- \exp_not:n {#6}
- \dt_remove_key_aux:w #7 \q__dt #1 \q__dt { } \q_recursion_tail
- \__prg_break_point:Nn \dt_map_break: { }
- }
- }
-\cs_new:Npn \dt_remove_key_aux:w { }
-\cs_new_protected_nopar:Npn \dt_remove_row:Nn
- { \dt_remove_row_aux:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \dt_gremove_row:Nn
- { \dt_remove_row_aux:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \dt_remove_row_aux:NNn #1#2#3
- {
- \__dt_split_row:NnTF #2 {#3}
- { \dt_remove_row_aux:NNnnn #1 #2 }
- { }
- }
-\cs_new_protected:Npn \dt_remove_row_aux:NNnnn #1#2#3#4#5
- {
- #1 #2
- {
- { \int_eval:n { \dt_rows:N #2 - \c_one } }
- \dt_remove_row_aux:nw #3 \q_stop
- \dt_remove_row_loop:nw #5 \q_recursion_tail \q__dt_row
- \__prg_break_point:Nn \dt_map_break: { }
- }
- }
-\cs_new_eq:NN \dt_remove_row_aux:nw \__dt_add_row:nw
-\cs_new:Npn \dt_remove_row_loop:nw #1#2 \q__dt_row
- {
- \__quark_if_recursion_tail_break:nN {#1} \dt_map_break:
- \int_eval:n { #1 - \c_one }
- \exp_not:n { #2 \q__dt_row }
- \dt_remove_row_loop:nw
- }
-\cs_new_protected:Npn \dt_get:NnnN #1#2#3#4
- {
- \__dt_split_row:NnTF #1 {#2}
- { \dt_get_aux:nNnnn {#3} #4 }
- { \tl_set:Nn #4 { \q_no_value } }
- }
-\cs_new_protected:Npn \dt_get_aux:nNnnn #1#2#3#4#5
- {
- \__dt_split_key:nnTF {#4} {#1}
- { \dt_get_aux:Nnnn #2 }
- { \tl_set:Nn #2 { \q_no_value } }
- }
-\cs_new_protected:Npn \dt_get_aux:Nnnn #1#2#3#4 { \tl_set:Nn #1 {#3} }
-\prg_new_protected_conditional:Npnn \dt_get:NnnN #1#2#3#4 { T , F , TF }
- {
- \__dt_split_row:NnTF #1 {#2}
- { \__dt_get_true:nNnnn {#3} #4 }
- { \prg_return_false: }
- }
-\cs_new_protected:Npn \__dt_get_true:nNnnn #1#2#3#4#5
- {
- \__dt_split_key:nnTF {#4} {#1}
- { \__dt_get_true:Nnnn #2 }
- { \prg_return_false: }
- }
-\cs_new_protected:Npn \__dt_get_true:Nnnn #1#2#3#4
- {
- \tl_set:Nn #1 {#3}
- \prg_return_true:
- }
-\cs_new_protected:Npn \dt_get:NnN #1
- { \dt_get:NnnN #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNT #1
- { \dt_get:NnnNF #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNF #1
- { \dt_get:NnnNF #1 { \dt_rows:N #1 } }
-\cs_new_protected:Npn \dt_get:NnNTF #1
- { \dt_get:NnnNTF #1 { \dt_rows:N #1 } }
-\int_new:N \g_dt_map_level_int
-\cs_new_protected:Npn \dt_map_variables:Nnn #1#2#3
- {
- \int_gincr:N \g_dt_map_level_int
- \seq_gclear_new:c { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- \keyval_parse:NNn \use_none:n \__dt_map_variables_key:nn {#2}
- \__dt_split_header:NT #1 { \__dt_map_variables:nnn {#3} }
- }
-\cs_new_protected:Npn \__dt_map_variables_key:nn #1#2
- {
- \seq_gput_right:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- { {#1} #2 }
- }
-\cs_new_protected:Npn \__dt_map_variables:nnn #1#2#3
- { \__dt_map_variables:nNNw {#1} #3 \q_stop }
-\cs_new_protected:Npn \__dt_map_variables:nNNw
- #1 \q__dt_header \q__dt_row #2 \q_stop
- {
- \int_zero_new:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int }
- \__dt_map_variables:nnw {#1} #2 { } \q_recursion_tail \q__dt_row
- \__prg_break_point:Nn \dt_map_break:
- { \int_gdecr:N \g_dt_map_level_int }
- }
-\cs_new_protected:Npn \__dt_map_variables:nnw #1#2#3#4 \q__dt_row
- {
- \__quark_if_recursion_tail_break:nN {#3} \dt_map_break:
- \seq_map_inline:cn { g_dt_map_ \int_use:N \g_dt_map_level_int _seq }
- { \dt_get_aux:nNnnn ##1 { } {#3#4} { } }
- #1
- \int_incr:c { l_dt_map_ \int_use:N \g_dt_map_level_int _row_int }
- \__dt_map_variables:nnw {#1}
- }
-\cs_new_nopar:Npn \dt_map_break:
- { \__prg_map_break:Nn \dt_map_break: { } }
-\cs_new_nopar:Npn \dt_map_break:n
- { \__prg_map_break:Nn \dt_map_break: }
-\prg_new_conditional:Npnn \dt_if_empty:N #1 { T , F , TF , p }
- {
- \if_meaning:w #1 \c_empty_dt
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Npnn \dt_if_in:Nn #1#2 { p , T , F , TF }
- { \__dt_split_header:NT #1 { \__dt_if_in:nnn {#2} } }
-\cs_new:Npn \__dt_if_in:nnn #1#2#3
- {
- \exp_last_unbraced:Nno \__dt_if_in:nwN {#1} { \use_none:nn #2 }
- \q_recursion_tail \q__dt
- \__prg_break_point:
- }
-\cs_new:Npn \__dt_if_in:nwN #1#2 \q__dt
- {
- \if_meaning:w \q_recursion_tail #2
- \exp_after:wN \__prg_break:n
- \else:
- \exp_after:wN \use_none:n
- \fi:
- { \prg_return_false: }
- \str_if_eq:nnTF {#1} {#2}
- { \__prg_break:n { \prg_return_true: } }
- { \__dt_if_in:nwN {#1} }
- }
-\prg_new_conditional:Npnn \dt_if_in_row:Nnn #1#2#3 { p , T , F , TF }
- {
- \exp_last_unbraced:Nno \__dt_if_in_row:nw {#2} #1
- \q_recursion_tail \q_nil
- \__prg_break_point:
- { \tl_to_str:n {#3} }
- }
-\cs_new:Npn \__dt_if_in_row:nw #1#2 \q__dt_row #3#4 \q_nil
- {
- \if_meaning:w \q_recursion_tail #3
- \exp_after:wN \__prg_break:n
- \else:
- \exp_after:wN \use_none:n
- \fi:
- {
- \use_i:nn
- \prg_return_false:
- }
- \int_compare:nNnTF {#1} = {#3}
- { \__prg_break:n { \exp_args:Nno \__dt_if_in_row:nn {#4} } }
- { \__dt_if_in_row:nw {#1} }
- }
-\cs_new:Npn \__dt_if_in_row:nn #1#2
- {
- \__dt_if_in_row:nwn {#2} #1 {#2} \q__dt { } \q_recursion_tail
- \__prg_break_point:
- }
-\cs_new:Npn \__dt_if_in_row:nwn #1 \q__dt #2 \q__dt #3
- {
- \str_if_eq_x:nnTF {#1} {#2}
- { \__dt_if_in_row:N }
- { \__dt_if_in_row:nwn {#1} }
- }
-\cs_new:Npn \__dt_if_in_row:N #1
- {
- \if_meaning:w \q__dt #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- \__prg_break:
- }
-\cs_new:Npn \dt_if_in_row_p:Nn #1
- { \dt_if_in_row_p:Nnn #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnT #1
- { \dt_if_in_row:NnnT #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnF #1
- { \dt_if_in_row:NnnF #1 { \dt_rows:N #1 } }
-\cs_new:Npn \dt_if_in_row:NnTF #1
- { \dt_if_in_row:NnnTF #1 { \dt_rows:N #1 } }
-\__msg_kernel_new:nnnn { dt } { unknown-row }
- { Data~table~#1~does~not~contain~a~row~'#2'. }
- {
- Data~table~#1~contains~#3~rows.~These~must~be~accessed~by~number:~row~
- #2~is~not~present~in~the~table.
- }
-%%
-%%
-%% End of file `l3dt.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty
index e374955c56b..5f8bcae6e85 100644
--- a/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty
+++ b/Master/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty
@@ -13,7 +13,7 @@
%%
%% Do not distribute a modified version of this file.
%%
-%% File: l3str.dtx Copyright (C) 2011-2013 The LaTeX3 Project
+%% File: l3str.dtx Copyright (C) 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -46,7 +46,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str.dtx 4576 2013-07-24 21:40:24Z joseph $
+\GetIdInfo$Id: l3str.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental strings}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
diff --git a/Master/texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty b/Master/texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty
index 371fbc3f650..fdf1cae5d59 100644
--- a/Master/texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty
+++ b/Master/texmf-dist/tex/latex/l3experimental/xcoffins/xcoffins.sty
@@ -13,7 +13,7 @@
%%
%% Do not distribute a modified version of this file.
%%
-%% File: xcoffins.dtx Copyright(C) 2010,2011 The LaTeX3 Project
+%% File: xcoffins.dtx Copyright(C) 2010-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -47,7 +47,7 @@
%% -----------------------------------------------------------------------
%%
\RequirePackage{xparse}
-\GetIdInfo$Id: xcoffins.dtx 4029 2012-07-29 18:16:03Z bruno $
+\GetIdInfo$Id: xcoffins.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental design-level coffins}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty
index ec016098bdd..25e080d20df 100644
--- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty
+++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty
@@ -14,7 +14,7 @@
%% Do not distribute a modified version of this file.
%%
%% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2013 The LaTeX3 Project
+%% (C) 2010-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -48,7 +48,7 @@
%% -----------------------------------------------------------------------
%%
\RequirePackage{xparse}
-\GetIdInfo$Id: l3galley.dtx 4494 2013-05-24 06:27:01Z joseph $
+\GetIdInfo$Id: l3galley.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental galley code}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty
index f736e2b74a6..93bbff8537b 100644
--- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty
+++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/xgalley.sty
@@ -14,7 +14,7 @@
%% Do not distribute a modified version of this file.
%%
%% File: xgalley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2012 The LaTeX3 Project
+%% (C) 2010-2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -48,7 +48,7 @@
%% -----------------------------------------------------------------------
%%
\RequirePackage{expl3}
-\GetIdInfo$Id: xgalley.dtx 4373 2012-12-17 16:41:59Z joseph $
+\GetIdInfo$Id: xgalley.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental galley}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
new file mode 100644
index 00000000000..71af1b2c7ac
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
@@ -0,0 +1,16869 @@
+%%
+%% This is file `expl3-code.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% expl3.dtx (with options: `package')
+%% l3bootstrap.dtx (with options: `package')
+%% l3names.dtx (with options: `package')
+%% l3basics.dtx (with options: `package')
+%% l3expan.dtx (with options: `package')
+%% l3tl.dtx (with options: `package')
+%% l3seq.dtx (with options: `package')
+%% l3int.dtx (with options: `package')
+%% l3quark.dtx (with options: `package')
+%% l3prg.dtx (with options: `package')
+%% l3clist.dtx (with options: `package')
+%% l3token.dtx (with options: `package')
+%% l3prop.dtx (with options: `package')
+%% l3msg.dtx (with options: `package')
+%% l3file.dtx (with options: `package')
+%% l3skip.dtx (with options: `package')
+%% l3keys.dtx (with options: `package')
+%% l3fp.dtx (with options: `package')
+%% l3fp-aux.dtx (with options: `package')
+%% l3fp-traps.dtx (with options: `package')
+%% l3fp-round.dtx (with options: `package')
+%% l3fp-parse.dtx (with options: `package')
+%% l3fp-logic.dtx (with options: `package')
+%% l3fp-basics.dtx (with options: `package')
+%% l3fp-extended.dtx (with options: `package')
+%% l3fp-expo.dtx (with options: `package')
+%% l3fp-trig.dtx (with options: `package')
+%% l3fp-convert.dtx (with options: `package')
+%% l3fp-assign.dtx (with options: `package')
+%% l3fp-old.dtx (with options: `package')
+%% l3box.dtx (with options: `package')
+%% l3coffins.dtx (with options: `package')
+%% l3color.dtx (with options: `package')
+%% l3luatex.dtx (with options: `package')
+%% l3candidates.dtx (with options: `package')
+%%
+%% EXPERIMENTAL CODE
+%%
+%% Do not distribute this file without also distributing the
+%% source files specified above.
+%%
+%% Do not distribute a modified version of this file.
+%%
+%% File: expl3.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\def\ExplFileName{expl3}
+\def\ExplFileDescription{L3 programming layer}
+\def\ExplFileDate{2014/05/05}
+\def\ExplFileVersion{4742}
+\begingroup
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx PackageError\endcsname\relax
+ \begingroup
+ \def\PackageError##1##2##3%
+ {%
+ \endgroup
+ \errhelp{##3}%
+ \errmessage{##1 Error: ##2!}
+ }
+ \fi
+ \def\next{}
+ \expandafter\ifx\csname ExplLoaderFileVersion\endcsname\relax
+ \def\next
+ {%
+ \PackageError{expl3}{No expl3 loader detected}
+ {%
+ You have attempted to use the expl3 code directly rather than using
+ the correct loader. Loading of expl3 will abort.
+ }
+ \endinput
+ }
+ \else
+ \ifx\ExplLoaderFileVersion\ExplFileVersion
+ \def\next{}
+ \else
+ \def\next
+ {%
+ \PackageError{expl3}{Mismatched expl3 files detected}
+ {%
+ You have attempted to load expl3 with mismatched files:
+ probably you have one or more files 'locally installed' which
+ are in conflict. Loading of expl3 will abort.
+ }%
+ \endinput
+ }
+ \fi
+ \expandafter\fi
+\expandafter\endgroup
+\next
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@\ExplFileName -code.tex\endcsname\relax
+ \expandafter\edef\csname ver@\ExplFileName -code.tex\endcsname
+ {%
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space
+ }
+\else
+ \expandafter\endinput
+\fi
+\immediate\write-1 %
+ {%
+ Package:
+ \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription\space
+ (code)
+ }
+%% File: l3bootstrap.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\begingroup
+ \csname protected\endcsname\gdef\GetIdInfo
+ {%
+ \begingroup
+ \catcode 32 = 10 %
+ \GetIdInfoAuxI
+ }
+ \csname protected\endcsname\gdef\GetIdInfoAuxI$#1$#2%
+ {%
+ \def\tempa{#1}%
+ \def\tempb{Id}%
+ \ifx\tempa\tempb
+ \def\tempa
+ {%
+ \endgroup
+ \def\ExplFileDate{0000/00/00}%
+ \def\ExplFileDescription{#2}%
+ \def\ExplFileName{[unknown name]}%
+ \def\ExplFileExtension{[unknown extension]}%
+ \def\ExplFileDate{-1}%
+ }%
+ \else
+ \def\tempa
+ {%
+ \endgroup
+ \def\ExplFileDescription{#2}%
+ \GetIdInfoAuxII$#1 $%
+ }%
+ \fi
+ \tempa
+ \GetIdInfoLog
+ }
+ \csname protected\endcsname\gdef\GetIdInfoAuxII$#1 #2.#3 #4 #5 #6$%
+ {%
+ \def\ExplFileName{#2}%
+ \def\ExplFileExtension{#3}%
+ \def\ExplFileVersion{#4}%
+ \begingroup
+ \def\tempa{#4}%
+ \def\tempb{-1}%
+ \ifx\tempa\tempb
+ \def\tempa
+ {%
+ \endgroup
+ \def\ExplFileDate{0000/00/00}%
+ }%
+ \else
+ \def\tempa
+ {%
+ \endgroup
+ \GetIdInfoAuxIII$#5$%
+ }%
+ \fi
+ \tempa
+ }
+ \csname protected\endcsname\gdef\GetIdInfoAuxIII$#1-#2-#3$%
+ {%
+ \def\ExplFileDate{#1/#2/#3}%
+ }
+ \csname protected\endcsname\gdef\GetIdInfoLog
+ {%
+ \immediate\write-1 %
+ {%
+ L3 Module:
+ \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription
+ }
+ }
+\endgroup
+\GetIdInfo$Id: l3bootstrap.dtx 4741 2014-05-05 14:16:57Z joseph $
+ {L3 Bootstrap code}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdfstrcmp\endcsname\relax
+ \let\pdfstrcmp\strcmp
+\fi
+\begingroup
+ \expandafter\ifx\csname directlua\endcsname\relax
+ \else
+ \ifnum\luatexversion<36 %
+ \else
+ \catcode`\_=11 %
+ \catcode`\:=11 %
+ \directlua
+ {%
+ l3kernel = { }
+ function l3kernel.strcmp (A, B)
+ A = A or ""
+ B = B or ""
+ if A == B then
+ tex.write ("0")
+ elseif A < B then
+ tex.write ("-1")
+ else
+ tex.write ("1")
+ end
+ end
+ }
+ \gdef\expl_pdfstrcmp#1#2%
+ {%
+ \luatex_directlua:D
+ {%
+ l3kernel.strcmp
+ (
+ "\luatex_luaescapestring:D {#1}" ,
+ "\luatex_luaescapestring:D {#2}"
+ )
+ }%
+ }
+ \fi
+ \fi
+\endgroup
+\begingroup
+ \def\ShortText{Required primitives not found}%
+ \def\LongText%
+ {%
+ LaTeX3 requires the e-TeX primitives and \string\pdfstrcmp.\LineBreak
+ \LineBreak
+ These are available in engine versions:\LineBreak
+ - pdfTeX 1.30\LineBreak
+ - XeTeX 0.9994\LineBreak
+ - LuaTeX 0.40\LineBreak
+ or later.\LineBreak
+ \LineBreak
+ }%
+ \expandafter\ifx\csname pdfstrcmp\endcsname\relax
+ \catcode`\_=11 %
+ \expandafter\ifx\csname expl_pdfstrcmp\endcsname\relax
+ \def\LineBreak{\noexpand\MessageBreak}%
+ \edef\Error%
+ {%
+ \endgroup
+ \noexpand\PackageError{expl3}{\ShortText}
+ {\LongText Loading of expl3 will abort!}%
+ \noexpand\endinput
+ }%
+ \expandafter\expandafter\expandafter\Error
+ \else
+ \endgroup
+ \fi
+\else
+ \endgroup
+\fi
+\begingroup
+ \def\@tempa{LaTeX2e}
+ \def\next{}
+ \ifx\fmtname\@tempa
+ \def\next
+ {%
+ \RequirePackage{etex}%
+ \csname reserveinserts\endcsname{32}%
+ }
+ \fi
+\expandafter\endgroup
+\next
+\ifdefined\directlua
+ \ifdefined\newattribute
+ \else
+ \ifdefined\RequirePackage
+ \RequirePackage{luatex}
+ \else
+ \input luatex.sty %
+ \fi
+ \fi
+\fi
+\protected\def\ExplSyntaxOff{}
+\protected\edef\ExplSyntaxOff
+ {%
+ \protected\def\ExplSyntaxOff{}%
+ \catcode 9 = \the\catcode 9\relax
+ \catcode 32 = \the\catcode 32\relax
+ \catcode 34 = \the\catcode 34\relax
+ \catcode 38 = \the\catcode 38\relax
+ \catcode 58 = \the\catcode 58\relax
+ \catcode 94 = \the\catcode 94\relax
+ \catcode 95 = \the\catcode 95\relax
+ \catcode 124 = \the\catcode 124\relax
+ \catcode 126 = \the\catcode 126\relax
+ \endlinechar = \the\endlinechar\relax
+ \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0\relax
+ }
+\catcode 9 = 9\relax
+\catcode 32 = 9\relax
+\catcode 34 = 12\relax
+\catcode 58 = 11\relax
+\catcode 94 = 7\relax
+\catcode 95 = 11\relax
+\catcode 124 = 12\relax
+\catcode 126 = 10\relax
+\endlinechar = 32\relax
+\chardef\l__kernel_expl_bool = 1 ~
+\protected \def \ExplSyntaxOn
+ {
+ \bool_if:NF \l__kernel_expl_bool
+ {
+ \cs_set_protected_nopar:Npx \ExplSyntaxOff
+ {
+ \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } }
+ \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } }
+ \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } }
+ \char_set_catcode:nn { 38 } { \char_value_catcode:n { 38 } }
+ \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } }
+ \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } }
+ \char_set_catcode:nn { 95 } { \char_value_catcode:n { 95 } }
+ \char_set_catcode:nn { 124 } { \char_value_catcode:n { 124 } }
+ \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } }
+ \tex_endlinechar:D =
+ \tex_the:D \tex_endlinechar:D \scan_stop:
+ \bool_set_false:N \l__kernel_expl_bool
+ \cs_set_protected_nopar:Npn \ExplSyntaxOff { }
+ }
+ }
+ \char_set_catcode_ignore:n { 9 } % tab
+ \char_set_catcode_ignore:n { 32 } % space
+ \char_set_catcode_other:n { 34 } % double quote
+ \char_set_catcode_alignment:n { 38 } % ampersand
+ \char_set_catcode_letter:n { 58 } % colon
+ \char_set_catcode_math_superscript:n { 94 } % circumflex
+ \char_set_catcode_letter:n { 95 } % underscore
+ \char_set_catcode_other:n { 124 } % pipe
+ \char_set_catcode_space:n { 126 } % tilde
+ \tex_endlinechar:D = 32 \scan_stop:
+ \bool_set_true:N \l__kernel_expl_bool
+ }
+%% File: l3names.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3names.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Namespace for primitives}
+\let \tex_global:D \global
+\let \tex_let:D \let
+\begingroup
+ \long \def \__kernel_primitive:NN #1#2
+ {
+ \tex_global:D \tex_let:D #2 #1
+ }
+ \__kernel_primitive:NN \ \tex_space:D
+ \__kernel_primitive:NN \/ \tex_italiccorrection:D
+ \__kernel_primitive:NN \- \tex_hyphen:D
+ \__kernel_primitive:NN \let \tex_let:D
+ \__kernel_primitive:NN \def \tex_def:D
+ \__kernel_primitive:NN \edef \tex_edef:D
+ \__kernel_primitive:NN \gdef \tex_gdef:D
+ \__kernel_primitive:NN \xdef \tex_xdef:D
+ \__kernel_primitive:NN \chardef \tex_chardef:D
+ \__kernel_primitive:NN \countdef \tex_countdef:D
+ \__kernel_primitive:NN \dimendef \tex_dimendef:D
+ \__kernel_primitive:NN \skipdef \tex_skipdef:D
+ \__kernel_primitive:NN \muskipdef \tex_muskipdef:D
+ \__kernel_primitive:NN \mathchardef \tex_mathchardef:D
+ \__kernel_primitive:NN \toksdef \tex_toksdef:D
+ \__kernel_primitive:NN \futurelet \tex_futurelet:D
+ \__kernel_primitive:NN \advance \tex_advance:D
+ \__kernel_primitive:NN \divide \tex_divide:D
+ \__kernel_primitive:NN \multiply \tex_multiply:D
+ \__kernel_primitive:NN \font \tex_font:D
+ \__kernel_primitive:NN \fam \tex_fam:D
+ \__kernel_primitive:NN \global \tex_global:D
+ \__kernel_primitive:NN \long \tex_long:D
+ \__kernel_primitive:NN \outer \tex_outer:D
+ \__kernel_primitive:NN \setlanguage \tex_setlanguage:D
+ \__kernel_primitive:NN \globaldefs \tex_globaldefs:D
+ \__kernel_primitive:NN \afterassignment \tex_afterassignment:D
+ \__kernel_primitive:NN \aftergroup \tex_aftergroup:D
+ \__kernel_primitive:NN \expandafter \tex_expandafter:D
+ \__kernel_primitive:NN \noexpand \tex_noexpand:D
+ \__kernel_primitive:NN \begingroup \tex_begingroup:D
+ \__kernel_primitive:NN \endgroup \tex_endgroup:D
+ \__kernel_primitive:NN \halign \tex_halign:D
+ \__kernel_primitive:NN \valign \tex_valign:D
+ \__kernel_primitive:NN \cr \tex_cr:D
+ \__kernel_primitive:NN \crcr \tex_crcr:D
+ \__kernel_primitive:NN \noalign \tex_noalign:D
+ \__kernel_primitive:NN \omit \tex_omit:D
+ \__kernel_primitive:NN \span \tex_span:D
+ \__kernel_primitive:NN \tabskip \tex_tabskip:D
+ \__kernel_primitive:NN \everycr \tex_everycr:D
+ \__kernel_primitive:NN \if \tex_if:D
+ \__kernel_primitive:NN \ifcase \tex_ifcase:D
+ \__kernel_primitive:NN \ifcat \tex_ifcat:D
+ \__kernel_primitive:NN \ifnum \tex_ifnum:D
+ \__kernel_primitive:NN \ifodd \tex_ifodd:D
+ \__kernel_primitive:NN \ifdim \tex_ifdim:D
+ \__kernel_primitive:NN \ifeof \tex_ifeof:D
+ \__kernel_primitive:NN \ifhbox \tex_ifhbox:D
+ \__kernel_primitive:NN \ifvbox \tex_ifvbox:D
+ \__kernel_primitive:NN \ifvoid \tex_ifvoid:D
+ \__kernel_primitive:NN \ifx \tex_ifx:D
+ \__kernel_primitive:NN \iffalse \tex_iffalse:D
+ \__kernel_primitive:NN \iftrue \tex_iftrue:D
+ \__kernel_primitive:NN \ifhmode \tex_ifhmode:D
+ \__kernel_primitive:NN \ifmmode \tex_ifmmode:D
+ \__kernel_primitive:NN \ifvmode \tex_ifvmode:D
+ \__kernel_primitive:NN \ifinner \tex_ifinner:D
+ \__kernel_primitive:NN \else \tex_else:D
+ \__kernel_primitive:NN \fi \tex_fi:D
+ \__kernel_primitive:NN \or \tex_or:D
+ \__kernel_primitive:NN \immediate \tex_immediate:D
+ \__kernel_primitive:NN \closeout \tex_closeout:D
+ \__kernel_primitive:NN \openin \tex_openin:D
+ \__kernel_primitive:NN \openout \tex_openout:D
+ \__kernel_primitive:NN \read \tex_read:D
+ \__kernel_primitive:NN \write \tex_write:D
+ \__kernel_primitive:NN \closein \tex_closein:D
+ \__kernel_primitive:NN \newlinechar \tex_newlinechar:D
+ \__kernel_primitive:NN \input \tex_input:D
+ \__kernel_primitive:NN \endinput \tex_endinput:D
+ \__kernel_primitive:NN \inputlineno \tex_inputlineno:D
+ \__kernel_primitive:NN \errmessage \tex_errmessage:D
+ \__kernel_primitive:NN \message \tex_message:D
+ \__kernel_primitive:NN \show \tex_show:D
+ \__kernel_primitive:NN \showthe \tex_showthe:D
+ \__kernel_primitive:NN \showbox \tex_showbox:D
+ \__kernel_primitive:NN \showlists \tex_showlists:D
+ \__kernel_primitive:NN \errhelp \tex_errhelp:D
+ \__kernel_primitive:NN \errorcontextlines \tex_errorcontextlines:D
+ \__kernel_primitive:NN \tracingcommands \tex_tracingcommands:D
+ \__kernel_primitive:NN \tracinglostchars \tex_tracinglostchars:D
+ \__kernel_primitive:NN \tracingmacros \tex_tracingmacros:D
+ \__kernel_primitive:NN \tracingonline \tex_tracingonline:D
+ \__kernel_primitive:NN \tracingoutput \tex_tracingoutput:D
+ \__kernel_primitive:NN \tracingpages \tex_tracingpages:D
+ \__kernel_primitive:NN \tracingparagraphs \tex_tracingparagraphs:D
+ \__kernel_primitive:NN \tracingrestores \tex_tracingrestores:D
+ \__kernel_primitive:NN \tracingstats \tex_tracingstats:D
+ \__kernel_primitive:NN \pausing \tex_pausing:D
+ \__kernel_primitive:NN \showboxbreadth \tex_showboxbreadth:D
+ \__kernel_primitive:NN \showboxdepth \tex_showboxdepth:D
+ \__kernel_primitive:NN \batchmode \tex_batchmode:D
+ \__kernel_primitive:NN \errorstopmode \tex_errorstopmode:D
+ \__kernel_primitive:NN \nonstopmode \tex_nonstopmode:D
+ \__kernel_primitive:NN \scrollmode \tex_scrollmode:D
+ \__kernel_primitive:NN \end \tex_end:D
+ \__kernel_primitive:NN \csname \tex_csname:D
+ \__kernel_primitive:NN \endcsname \tex_endcsname:D
+ \__kernel_primitive:NN \ignorespaces \tex_ignorespaces:D
+ \__kernel_primitive:NN \relax \tex_relax:D
+ \__kernel_primitive:NN \the \tex_the:D
+ \__kernel_primitive:NN \mag \tex_mag:D
+ \__kernel_primitive:NN \language \tex_language:D
+ \__kernel_primitive:NN \mark \tex_mark:D
+ \__kernel_primitive:NN \topmark \tex_topmark:D
+ \__kernel_primitive:NN \firstmark \tex_firstmark:D
+ \__kernel_primitive:NN \botmark \tex_botmark:D
+ \__kernel_primitive:NN \splitfirstmark \tex_splitfirstmark:D
+ \__kernel_primitive:NN \splitbotmark \tex_splitbotmark:D
+ \__kernel_primitive:NN \fontname \tex_fontname:D
+ \__kernel_primitive:NN \escapechar \tex_escapechar:D
+ \__kernel_primitive:NN \endlinechar \tex_endlinechar:D
+ \__kernel_primitive:NN \mathchoice \tex_mathchoice:D
+ \__kernel_primitive:NN \delimiter \tex_delimiter:D
+ \__kernel_primitive:NN \mathaccent \tex_mathaccent:D
+ \__kernel_primitive:NN \mathchar \tex_mathchar:D
+ \__kernel_primitive:NN \mskip \tex_mskip:D
+ \__kernel_primitive:NN \radical \tex_radical:D
+ \__kernel_primitive:NN \vcenter \tex_vcenter:D
+ \__kernel_primitive:NN \mkern \tex_mkern:D
+ \__kernel_primitive:NN \above \tex_above:D
+ \__kernel_primitive:NN \abovewithdelims \tex_abovewithdelims:D
+ \__kernel_primitive:NN \atop \tex_atop:D
+ \__kernel_primitive:NN \atopwithdelims \tex_atopwithdelims:D
+ \__kernel_primitive:NN \over \tex_over:D
+ \__kernel_primitive:NN \overwithdelims \tex_overwithdelims:D
+ \__kernel_primitive:NN \displaystyle \tex_displaystyle:D
+ \__kernel_primitive:NN \textstyle \tex_textstyle:D
+ \__kernel_primitive:NN \scriptstyle \tex_scriptstyle:D
+ \__kernel_primitive:NN \scriptscriptstyle \tex_scriptscriptstyle:D
+ \__kernel_primitive:NN \nonscript \tex_nonscript:D
+ \__kernel_primitive:NN \eqno \tex_eqno:D
+ \__kernel_primitive:NN \leqno \tex_leqno:D
+ \__kernel_primitive:NN \abovedisplayshortskip \tex_abovedisplayshortskip:D
+ \__kernel_primitive:NN \abovedisplayskip \tex_abovedisplayskip:D
+ \__kernel_primitive:NN \belowdisplayshortskip \tex_belowdisplayshortskip:D
+ \__kernel_primitive:NN \belowdisplayskip \tex_belowdisplayskip:D
+ \__kernel_primitive:NN \displaywidowpenalty \tex_displaywidowpenalty:D
+ \__kernel_primitive:NN \displayindent \tex_displayindent:D
+ \__kernel_primitive:NN \displaywidth \tex_displaywidth:D
+ \__kernel_primitive:NN \everydisplay \tex_everydisplay:D
+ \__kernel_primitive:NN \predisplaysize \tex_predisplaysize:D
+ \__kernel_primitive:NN \predisplaypenalty \tex_predisplaypenalty:D
+ \__kernel_primitive:NN \postdisplaypenalty \tex_postdisplaypenalty:D
+ \__kernel_primitive:NN \mathbin \tex_mathbin:D
+ \__kernel_primitive:NN \mathclose \tex_mathclose:D
+ \__kernel_primitive:NN \mathinner \tex_mathinner:D
+ \__kernel_primitive:NN \mathop \tex_mathop:D
+ \__kernel_primitive:NN \displaylimits \tex_displaylimits:D
+ \__kernel_primitive:NN \limits \tex_limits:D
+ \__kernel_primitive:NN \nolimits \tex_nolimits:D
+ \__kernel_primitive:NN \mathopen \tex_mathopen:D
+ \__kernel_primitive:NN \mathord \tex_mathord:D
+ \__kernel_primitive:NN \mathpunct \tex_mathpunct:D
+ \__kernel_primitive:NN \mathrel \tex_mathrel:D
+ \__kernel_primitive:NN \overline \tex_overline:D
+ \__kernel_primitive:NN \underline \tex_underline:D
+ \__kernel_primitive:NN \left \tex_left:D
+ \__kernel_primitive:NN \right \tex_right:D
+ \__kernel_primitive:NN \binoppenalty \tex_binoppenalty:D
+ \__kernel_primitive:NN \relpenalty \tex_relpenalty:D
+ \__kernel_primitive:NN \delimitershortfall \tex_delimitershortfall:D
+ \__kernel_primitive:NN \delimiterfactor \tex_delimiterfactor:D
+ \__kernel_primitive:NN \nulldelimiterspace \tex_nulldelimiterspace:D
+ \__kernel_primitive:NN \everymath \tex_everymath:D
+ \__kernel_primitive:NN \mathsurround \tex_mathsurround:D
+ \__kernel_primitive:NN \medmuskip \tex_medmuskip:D
+ \__kernel_primitive:NN \thinmuskip \tex_thinmuskip:D
+ \__kernel_primitive:NN \thickmuskip \tex_thickmuskip:D
+ \__kernel_primitive:NN \scriptspace \tex_scriptspace:D
+ \__kernel_primitive:NN \noboundary \tex_noboundary:D
+ \__kernel_primitive:NN \accent \tex_accent:D
+ \__kernel_primitive:NN \char \tex_char:D
+ \__kernel_primitive:NN \discretionary \tex_discretionary:D
+ \__kernel_primitive:NN \hfil \tex_hfil:D
+ \__kernel_primitive:NN \hfilneg \tex_hfilneg:D
+ \__kernel_primitive:NN \hfill \tex_hfill:D
+ \__kernel_primitive:NN \hskip \tex_hskip:D
+ \__kernel_primitive:NN \hss \tex_hss:D
+ \__kernel_primitive:NN \vfil \tex_vfil:D
+ \__kernel_primitive:NN \vfilneg \tex_vfilneg:D
+ \__kernel_primitive:NN \vfill \tex_vfill:D
+ \__kernel_primitive:NN \vskip \tex_vskip:D
+ \__kernel_primitive:NN \vss \tex_vss:D
+ \__kernel_primitive:NN \unskip \tex_unskip:D
+ \__kernel_primitive:NN \kern \tex_kern:D
+ \__kernel_primitive:NN \unkern \tex_unkern:D
+ \__kernel_primitive:NN \hrule \tex_hrule:D
+ \__kernel_primitive:NN \vrule \tex_vrule:D
+ \__kernel_primitive:NN \leaders \tex_leaders:D
+ \__kernel_primitive:NN \cleaders \tex_cleaders:D
+ \__kernel_primitive:NN \xleaders \tex_xleaders:D
+ \__kernel_primitive:NN \lastkern \tex_lastkern:D
+ \__kernel_primitive:NN \lastskip \tex_lastskip:D
+ \__kernel_primitive:NN \indent \tex_indent:D
+ \__kernel_primitive:NN \par \tex_par:D
+ \__kernel_primitive:NN \noindent \tex_noindent:D
+ \__kernel_primitive:NN \vadjust \tex_vadjust:D
+ \__kernel_primitive:NN \baselineskip \tex_baselineskip:D
+ \__kernel_primitive:NN \lineskip \tex_lineskip:D
+ \__kernel_primitive:NN \lineskiplimit \tex_lineskiplimit:D
+ \__kernel_primitive:NN \clubpenalty \tex_clubpenalty:D
+ \__kernel_primitive:NN \widowpenalty \tex_widowpenalty:D
+ \__kernel_primitive:NN \exhyphenpenalty \tex_exhyphenpenalty:D
+ \__kernel_primitive:NN \hyphenpenalty \tex_hyphenpenalty:D
+ \__kernel_primitive:NN \linepenalty \tex_linepenalty:D
+ \__kernel_primitive:NN \doublehyphendemerits \tex_doublehyphendemerits:D
+ \__kernel_primitive:NN \finalhyphendemerits \tex_finalhyphendemerits:D
+ \__kernel_primitive:NN \adjdemerits \tex_adjdemerits:D
+ \__kernel_primitive:NN \hangafter \tex_hangafter:D
+ \__kernel_primitive:NN \hangindent \tex_hangindent:D
+ \__kernel_primitive:NN \parshape \tex_parshape:D
+ \__kernel_primitive:NN \hsize \tex_hsize:D
+ \__kernel_primitive:NN \lefthyphenmin \tex_lefthyphenmin:D
+ \__kernel_primitive:NN \righthyphenmin \tex_righthyphenmin:D
+ \__kernel_primitive:NN \leftskip \tex_leftskip:D
+ \__kernel_primitive:NN \rightskip \tex_rightskip:D
+ \__kernel_primitive:NN \looseness \tex_looseness:D
+ \__kernel_primitive:NN \parskip \tex_parskip:D
+ \__kernel_primitive:NN \parindent \tex_parindent:D
+ \__kernel_primitive:NN \uchyph \tex_uchyph:D
+ \__kernel_primitive:NN \emergencystretch \tex_emergencystretch:D
+ \__kernel_primitive:NN \pretolerance \tex_pretolerance:D
+ \__kernel_primitive:NN \tolerance \tex_tolerance:D
+ \__kernel_primitive:NN \spaceskip \tex_spaceskip:D
+ \__kernel_primitive:NN \xspaceskip \tex_xspaceskip:D
+ \__kernel_primitive:NN \parfillskip \tex_parfillskip:D
+ \__kernel_primitive:NN \everypar \tex_everypar:D
+ \__kernel_primitive:NN \prevgraf \tex_prevgraf:D
+ \__kernel_primitive:NN \spacefactor \tex_spacefactor:D
+ \__kernel_primitive:NN \shipout \tex_shipout:D
+ \__kernel_primitive:NN \vsize \tex_vsize:D
+ \__kernel_primitive:NN \interlinepenalty \tex_interlinepenalty:D
+ \__kernel_primitive:NN \brokenpenalty \tex_brokenpenalty:D
+ \__kernel_primitive:NN \topskip \tex_topskip:D
+ \__kernel_primitive:NN \maxdeadcycles \tex_maxdeadcycles:D
+ \__kernel_primitive:NN \maxdepth \tex_maxdepth:D
+ \__kernel_primitive:NN \output \tex_output:D
+ \__kernel_primitive:NN \deadcycles \tex_deadcycles:D
+ \__kernel_primitive:NN \pagedepth \tex_pagedepth:D
+ \__kernel_primitive:NN \pagestretch \tex_pagestretch:D
+ \__kernel_primitive:NN \pagefilstretch \tex_pagefilstretch:D
+ \__kernel_primitive:NN \pagefillstretch \tex_pagefillstretch:D
+ \__kernel_primitive:NN \pagefilllstretch \tex_pagefilllstretch:D
+ \__kernel_primitive:NN \pageshrink \tex_pageshrink:D
+ \__kernel_primitive:NN \pagegoal \tex_pagegoal:D
+ \__kernel_primitive:NN \pagetotal \tex_pagetotal:D
+ \__kernel_primitive:NN \outputpenalty \tex_outputpenalty:D
+ \__kernel_primitive:NN \hoffset \tex_hoffset:D
+ \__kernel_primitive:NN \voffset \tex_voffset:D
+ \__kernel_primitive:NN \insert \tex_insert:D
+ \__kernel_primitive:NN \holdinginserts \tex_holdinginserts:D
+ \__kernel_primitive:NN \floatingpenalty \tex_floatingpenalty:D
+ \__kernel_primitive:NN \insertpenalties \tex_insertpenalties:D
+ \__kernel_primitive:NN \lower \tex_lower:D
+ \__kernel_primitive:NN \moveleft \tex_moveleft:D
+ \__kernel_primitive:NN \moveright \tex_moveright:D
+ \__kernel_primitive:NN \raise \tex_raise:D
+ \__kernel_primitive:NN \copy \tex_copy:D
+ \__kernel_primitive:NN \lastbox \tex_lastbox:D
+ \__kernel_primitive:NN \vsplit \tex_vsplit:D
+ \__kernel_primitive:NN \unhbox \tex_unhbox:D
+ \__kernel_primitive:NN \unhcopy \tex_unhcopy:D
+ \__kernel_primitive:NN \unvbox \tex_unvbox:D
+ \__kernel_primitive:NN \unvcopy \tex_unvcopy:D
+ \__kernel_primitive:NN \setbox \tex_setbox:D
+ \__kernel_primitive:NN \hbox \tex_hbox:D
+ \__kernel_primitive:NN \vbox \tex_vbox:D
+ \__kernel_primitive:NN \vtop \tex_vtop:D
+ \__kernel_primitive:NN \prevdepth \tex_prevdepth:D
+ \__kernel_primitive:NN \badness \tex_badness:D
+ \__kernel_primitive:NN \hbadness \tex_hbadness:D
+ \__kernel_primitive:NN \vbadness \tex_vbadness:D
+ \__kernel_primitive:NN \hfuzz \tex_hfuzz:D
+ \__kernel_primitive:NN \vfuzz \tex_vfuzz:D
+ \__kernel_primitive:NN \overfullrule \tex_overfullrule:D
+ \__kernel_primitive:NN \boxmaxdepth \tex_boxmaxdepth:D
+ \__kernel_primitive:NN \splitmaxdepth \tex_splitmaxdepth:D
+ \__kernel_primitive:NN \splittopskip \tex_splittopskip:D
+ \__kernel_primitive:NN \everyhbox \tex_everyhbox:D
+ \__kernel_primitive:NN \everyvbox \tex_everyvbox:D
+ \__kernel_primitive:NN \nullfont \tex_nullfont:D
+ \__kernel_primitive:NN \textfont \tex_textfont:D
+ \__kernel_primitive:NN \scriptfont \tex_scriptfont:D
+ \__kernel_primitive:NN \scriptscriptfont \tex_scriptscriptfont:D
+ \__kernel_primitive:NN \fontdimen \tex_fontdimen:D
+ \__kernel_primitive:NN \hyphenchar \tex_hyphenchar:D
+ \__kernel_primitive:NN \skewchar \tex_skewchar:D
+ \__kernel_primitive:NN \defaulthyphenchar \tex_defaulthyphenchar:D
+ \__kernel_primitive:NN \defaultskewchar \tex_defaultskewchar:D
+ \__kernel_primitive:NN \number \tex_number:D
+ \__kernel_primitive:NN \romannumeral \tex_romannumeral:D
+ \__kernel_primitive:NN \string \tex_string:D
+ \__kernel_primitive:NN \lowercase \tex_lowercase:D
+ \__kernel_primitive:NN \uppercase \tex_uppercase:D
+ \__kernel_primitive:NN \meaning \tex_meaning:D
+ \__kernel_primitive:NN \penalty \tex_penalty:D
+ \__kernel_primitive:NN \unpenalty \tex_unpenalty:D
+ \__kernel_primitive:NN \lastpenalty \tex_lastpenalty:D
+ \__kernel_primitive:NN \special \tex_special:D
+ \__kernel_primitive:NN \dump \tex_dump:D
+ \__kernel_primitive:NN \patterns \tex_patterns:D
+ \__kernel_primitive:NN \hyphenation \tex_hyphenation:D
+ \__kernel_primitive:NN \time \tex_time:D
+ \__kernel_primitive:NN \day \tex_day:D
+ \__kernel_primitive:NN \month \tex_month:D
+ \__kernel_primitive:NN \year \tex_year:D
+ \__kernel_primitive:NN \jobname \tex_jobname:D
+ \__kernel_primitive:NN \everyjob \tex_everyjob:D
+ \__kernel_primitive:NN \count \tex_count:D
+ \__kernel_primitive:NN \dimen \tex_dimen:D
+ \__kernel_primitive:NN \skip \tex_skip:D
+ \__kernel_primitive:NN \toks \tex_toks:D
+ \__kernel_primitive:NN \muskip \tex_muskip:D
+ \__kernel_primitive:NN \box \tex_box:D
+ \__kernel_primitive:NN \wd \tex_wd:D
+ \__kernel_primitive:NN \ht \tex_ht:D
+ \__kernel_primitive:NN \dp \tex_dp:D
+ \__kernel_primitive:NN \catcode \tex_catcode:D
+ \__kernel_primitive:NN \delcode \tex_delcode:D
+ \__kernel_primitive:NN \sfcode \tex_sfcode:D
+ \__kernel_primitive:NN \lccode \tex_lccode:D
+ \__kernel_primitive:NN \uccode \tex_uccode:D
+ \__kernel_primitive:NN \mathcode \tex_mathcode:D
+ \__kernel_primitive:NN \ifdefined \etex_ifdefined:D
+ \__kernel_primitive:NN \ifcsname \etex_ifcsname:D
+ \__kernel_primitive:NN \unless \etex_unless:D
+ \__kernel_primitive:NN \eTeXversion \etex_eTeXversion:D
+ \__kernel_primitive:NN \eTeXrevision \etex_eTeXrevision:D
+ \__kernel_primitive:NN \marks \etex_marks:D
+ \__kernel_primitive:NN \topmarks \etex_topmarks:D
+ \__kernel_primitive:NN \firstmarks \etex_firstmarks:D
+ \__kernel_primitive:NN \botmarks \etex_botmarks:D
+ \__kernel_primitive:NN \splitfirstmarks \etex_splitfirstmarks:D
+ \__kernel_primitive:NN \splitbotmarks \etex_splitbotmarks:D
+ \__kernel_primitive:NN \unexpanded \etex_unexpanded:D
+ \__kernel_primitive:NN \detokenize \etex_detokenize:D
+ \__kernel_primitive:NN \scantokens \etex_scantokens:D
+ \__kernel_primitive:NN \showtokens \etex_showtokens:D
+ \__kernel_primitive:NN \readline \etex_readline:D
+ \__kernel_primitive:NN \tracingassigns \etex_tracingassigns:D
+ \__kernel_primitive:NN \tracingscantokens \etex_tracingscantokens:D
+ \__kernel_primitive:NN \tracingnesting \etex_tracingnesting:D
+ \__kernel_primitive:NN \tracingifs \etex_tracingifs:D
+ \__kernel_primitive:NN \currentiflevel \etex_currentiflevel:D
+ \__kernel_primitive:NN \currentifbranch \etex_currentifbranch:D
+ \__kernel_primitive:NN \currentiftype \etex_currentiftype:D
+ \__kernel_primitive:NN \tracinggroups \etex_tracinggroups:D
+ \__kernel_primitive:NN \currentgrouplevel \etex_currentgrouplevel:D
+ \__kernel_primitive:NN \currentgrouptype \etex_currentgrouptype:D
+ \__kernel_primitive:NN \showgroups \etex_showgroups:D
+ \__kernel_primitive:NN \showifs \etex_showifs:D
+ \__kernel_primitive:NN \interactionmode \etex_interactionmode:D
+ \__kernel_primitive:NN \lastnodetype \etex_lastnodetype:D
+ \__kernel_primitive:NN \iffontchar \etex_iffontchar:D
+ \__kernel_primitive:NN \fontcharht \etex_fontcharht:D
+ \__kernel_primitive:NN \fontchardp \etex_fontchardp:D
+ \__kernel_primitive:NN \fontcharwd \etex_fontcharwd:D
+ \__kernel_primitive:NN \fontcharic \etex_fontcharic:D
+ \__kernel_primitive:NN \parshapeindent \etex_parshapeindent:D
+ \__kernel_primitive:NN \parshapelength \etex_parshapelength:D
+ \__kernel_primitive:NN \parshapedimen \etex_parshapedimen:D
+ \__kernel_primitive:NN \numexpr \etex_numexpr:D
+ \__kernel_primitive:NN \dimexpr \etex_dimexpr:D
+ \__kernel_primitive:NN \glueexpr \etex_glueexpr:D
+ \__kernel_primitive:NN \muexpr \etex_muexpr:D
+ \__kernel_primitive:NN \gluestretch \etex_gluestretch:D
+ \__kernel_primitive:NN \glueshrink \etex_glueshrink:D
+ \__kernel_primitive:NN \gluestretchorder \etex_gluestretchorder:D
+ \__kernel_primitive:NN \glueshrinkorder \etex_glueshrinkorder:D
+ \__kernel_primitive:NN \gluetomu \etex_gluetomu:D
+ \__kernel_primitive:NN \mutoglue \etex_mutoglue:D
+ \__kernel_primitive:NN \lastlinefit \etex_lastlinefit:D
+ \__kernel_primitive:NN \interlinepenalties \etex_interlinepenalties:D
+ \__kernel_primitive:NN \clubpenalties \etex_clubpenalties:D
+ \__kernel_primitive:NN \widowpenalties \etex_widowpenalties:D
+ \__kernel_primitive:NN \displaywidowpenalties \etex_displaywidowpenalties:D
+ \__kernel_primitive:NN \middle \etex_middle:D
+ \__kernel_primitive:NN \savinghyphcodes \etex_savinghyphcodes:D
+ \__kernel_primitive:NN \savingvdiscards \etex_savingvdiscards:D
+ \__kernel_primitive:NN \pagediscards \etex_pagediscards:D
+ \__kernel_primitive:NN \splitdiscards \etex_splitdiscards:D
+ \__kernel_primitive:NN \TeXXeTstate \etex_TeXXeTstate:D
+ \__kernel_primitive:NN \beginL \etex_beginL:D
+ \__kernel_primitive:NN \endL \etex_endL:D
+ \__kernel_primitive:NN \beginR \etex_beginR:D
+ \__kernel_primitive:NN \endR \etex_endR:D
+ \__kernel_primitive:NN \predisplaydirection \etex_predisplaydirection:D
+ \__kernel_primitive:NN \everyeof \etex_everyeof:D
+ \__kernel_primitive:NN \protected \etex_protected:D
+ \__kernel_primitive:NN \pdfcreationdate \pdftex_pdfcreationdate:D
+ \__kernel_primitive:NN \pdfcolorstack \pdftex_pdfcolorstack:D
+ \__kernel_primitive:NN \pdfcompresslevel \pdftex_pdfcompresslevel:D
+ \__kernel_primitive:NN \pdfdecimaldigits \pdftex_pdfdecimaldigits:D
+ \__kernel_primitive:NN \pdfhorigin \pdftex_pdfhorigin:D
+ \__kernel_primitive:NN \pdfinfo \pdftex_pdfinfo:D
+ \__kernel_primitive:NN \pdflastxform \pdftex_pdflastxform:D
+ \__kernel_primitive:NN \pdfliteral \pdftex_pdfliteral:D
+ \__kernel_primitive:NN \pdfminorversion \pdftex_pdfminorversion:D
+ \__kernel_primitive:NN \pdfobjcompresslevel \pdftex_pdfobjcompresslevel:D
+ \__kernel_primitive:NN \pdfoutput \pdftex_pdfoutput:D
+ \__kernel_primitive:NN \pdfrefxform \pdftex_pdfrefxform:D
+ \__kernel_primitive:NN \pdfrestore \pdftex_pdfrestore:D
+ \__kernel_primitive:NN \pdfsave \pdftex_pdfsave:D
+ \__kernel_primitive:NN \pdfsetmatrix \pdftex_pdfsetmatrix:D
+ \__kernel_primitive:NN \pdfpkresolution \pdftex_pdfpkresolution:D
+ \__kernel_primitive:NN \pdftexrevision \pdftex_pdftextrevision:D
+ \__kernel_primitive:NN \pdfvorigin \pdftex_pdfvorigin:D
+ \__kernel_primitive:NN \pdfxform \pdftex_pdfxform:D
+ \__kernel_primitive:NN \pdfstrcmp \pdftex_strcmp:D
+ \__kernel_primitive:NN \XeTeXversion \xetex_XeTeXversion:D
+ \__kernel_primitive:NN \catcodetable \luatex_catcodetable:D
+ \__kernel_primitive:NN \directlua \luatex_directlua:D
+ \__kernel_primitive:NN \initcatcodetable \luatex_initcatcodetable:D
+ \__kernel_primitive:NN \latelua \luatex_latelua:D
+ \__kernel_primitive:NN \luaescapestring \luatex_luaescapestring:D
+ \__kernel_primitive:NN \luatexversion \luatex_luatexversion:D
+ \__kernel_primitive:NN \savecatcodetable \luatex_savecatcodetable:D
+ \__kernel_primitive:NN \Uchar \luatex_Uchar:D
+ \__kernel_primitive:NN \bodydir \luatex_bodydir:D
+ \__kernel_primitive:NN \mathdir \luatex_mathdir:D
+ \__kernel_primitive:NN \pagedir \luatex_pagedir:D
+ \__kernel_primitive:NN \pardir \luatex_pardir:D
+ \__kernel_primitive:NN \textdir \luatex_textdir:D
+\tex_endgroup:D
+\etex_ifdefined:D \pdftex_strcmp:D
+\tex_else:D
+ \tex_let:D \pdftex_strcmp:D \expl_pdfstrcmp
+ \tex_let:D \expl_pdfstrcmp \tex_undefined:D
+\tex_fi:D
+\etex_ifdefined:D \@@end
+ \tex_let:D \tex_end:D \@@end
+ \tex_let:D \tex_everydisplay:D \frozen@everydisplay
+ \tex_let:D \tex_everymath:D \frozen@everymath
+ \tex_let:D \tex_hyphen:D \@@hyph
+ \tex_let:D \tex_input:D \@@input
+ \tex_let:D \tex_italiccorrection:D \@@italiccorr
+ \tex_let:D \tex_underline:D \@@underline
+ \tex_let:D \luatex_catcodetable:D \luatexcatcodetable
+ \tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable
+ \tex_let:D \luatex_latelua:D \luatexlatelua
+ \tex_let:D \luatex_luaescapestring:D \luatexluaescapestring
+ \tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable
+ \tex_let:D \luatex_Uchar:D \luatexUchar
+ \tex_let:D \luatex_bodydir:D \luatexbodydir
+ \tex_let:D \luatex_mathdir:D \luatexmathdir
+ \tex_let:D \luatex_pagedir:D \luatexpagedir
+ \tex_let:D \luatex_pardir:D \luatexpardir
+ \tex_let:D \luatex_textdir:D \luatextextdir
+\tex_fi:D
+\etex_ifdefined:D \normalend
+ \tex_let:D \tex_outer:D \normalouter
+ \tex_let:D \tex_input:D \normalinput
+ \tex_let:D \tex_end:D \normalend
+ \tex_let:D \tex_language:D \normallanguage
+ \tex_let:D \tex_vcenter:D \normalvcneter
+ \tex_let:D \tex_over:D \normalover
+ \tex_let:D \tex_mathop:D \normalmathop
+ \tex_let:D \tex_month:D \normalmonth
+ \tex_let:D \tex_everyjob:D \normaleveryjob
+ \tex_let:D \etex_unexpanded:D \normalunexpanded
+\tex_fi:D
+\etex_ifdefined:D \normalitaliccorrection
+ \tex_let:D \tex_hoffset:D \normalhoffset
+ \tex_let:D \tex_italiccorrection:D \normalitaliccorrection
+ \tex_let:D \tex_voffset:D \normalvoffset
+ \tex_let:D \etex_showtokens:D \normalshowtokens
+ \tex_let:D \luatex_bodydir:D \spac_directions_normal_body_dir
+ \tex_let:D \luatex_pagedir:D \spac_directions_normal_page_dir
+\tex_fi:D
+\etex_ifdefined:D \normalleft
+ \tex_let:D \tex_left:D \normalleft
+ \tex_let:D \tex_middle:D \normalmiddle
+ \tex_let:D \tex_right:D \normalright
+\tex_fi:D
+%% File: l3basics.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3basics.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Basic definitions}
+\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 \etex_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_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_let:D \if_cs_exist:N \etex_ifdefined:D
+\tex_let:D \if_cs_exist:w \etex_ifcsname:D
+\tex_let:D \cs:w \tex_csname:D
+\tex_let:D \cs_end: \tex_endcsname:D
+\tex_let:D \exp_after:wN \tex_expandafter:D
+\tex_let:D \exp_not:N \tex_noexpand:D
+\tex_let:D \exp_not:n \etex_unexpanded:D
+\tex_let:D \token_to_meaning:N \tex_meaning:D
+\tex_let:D \token_to_str:N \tex_string:D
+\tex_let:D \cs_meaning:N \tex_meaning:D
+\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_let:D \if_int_compare:w \tex_ifnum:D
+\tex_let:D \__int_to_roman:w \tex_romannumeral:D
+\tex_let:D \group_insert_after:N \tex_aftergroup:D
+\tex_long:D \tex_def: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
+ { \cs:w #1 \exp_after:wN \cs_end: \cs:w #2 \cs_end: }
+\tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
+\tex_long:D \tex_def:D \cs_meaning:c #1
+ {
+ \if_cs_exist:w #1 \cs_end:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { \exp_args:Nc \cs_meaning:N {#1} }
+ { \tl_to_str:n {undefined} }
+ }
+\tex_let:D \token_to_meaning:c = \cs_meaning:c
+\tex_let:D \c_minus_one \m@ne
+\tex_chardef:D \c_sixteen = 16 ~
+\tex_chardef:D \c_zero = 0 ~
+\tex_chardef:D \c_six = 6 ~
+\tex_chardef:D \c_seven = 7 ~
+\tex_chardef:D \c_twelve = 12 ~
+\etex_ifdefined:D \luatex_luatexversion:D
+ \tex_chardef:D \c_max_register_int = 65 535 ~
+\tex_else:D
+ \tex_mathchardef:D \c_max_register_int = 32 767 ~
+\tex_fi:D
+\tex_let:D \cs_set_nopar:Npn \tex_def:D
+\tex_let:D \cs_set_nopar:Npx \tex_edef:D
+\etex_protected:D \cs_set_nopar:Npn \cs_set:Npn
+ { \tex_long:D \cs_set_nopar:Npn }
+\etex_protected:D \cs_set_nopar:Npn \cs_set:Npx
+ { \tex_long:D \cs_set_nopar:Npx }
+\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn
+ { \etex_protected:D \cs_set_nopar:Npn }
+\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx
+ { \etex_protected:D \cs_set_nopar:Npx }
+\cs_set_protected_nopar:Npn \cs_set_protected:Npn
+ { \etex_protected:D \tex_long:D \cs_set_nopar:Npn }
+\cs_set_protected_nopar:Npn \cs_set_protected:Npx
+ { \etex_protected:D \tex_long:D \cs_set_nopar:Npx }
+\tex_let:D \cs_gset_nopar:Npn \tex_gdef:D
+\tex_let:D \cs_gset_nopar:Npx \tex_xdef:D
+\cs_set_protected_nopar:Npn \cs_gset:Npn
+ { \tex_long:D \cs_gset_nopar:Npn }
+\cs_set_protected_nopar:Npn \cs_gset:Npx
+ { \tex_long:D \cs_gset_nopar:Npx }
+\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npn
+ { \etex_protected:D \cs_gset_nopar:Npn }
+\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npx
+ { \etex_protected:D \cs_gset_nopar:Npx }
+\cs_set_protected_nopar:Npn \cs_gset_protected:Npn
+ { \etex_protected:D \tex_long:D \cs_gset_nopar:Npn }
+\cs_set_protected_nopar:Npn \cs_gset_protected:Npx
+ { \etex_protected:D \tex_long:D \cs_gset_nopar:Npx }
+\cs_set_nopar:Npn \l__exp_internal_tl { }
+\cs_set:Npn \use:c #1 { \cs:w #1 \cs_end: }
+\cs_set_protected:Npn \use:x #1
+ {
+ \cs_set_nopar:Npx \l__exp_internal_tl {#1}
+ \l__exp_internal_tl
+ }
+\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_set:Npn \use_i:nn #1#2 {#1}
+\cs_set:Npn \use_ii:nn #1#2 {#2}
+\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_ii:nnn #1#2#3 {#1#2}
+\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_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_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 #1#2 \q_recursion_stop {#1}
+\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_set_nopar:Npn \prg_return_true:
+ { \exp_after:wN \use_i:nn \__int_to_roman:w }
+\cs_set_nopar:Npn \prg_return_false:
+ { \exp_after:wN \use_ii:nn \__int_to_roman:w}
+\cs_set_protected_nopar:Npn \prg_set_conditional:Npnn
+ { \__prg_generate_conditional_parm:nnNpnn { set } { } }
+\cs_set_protected_nopar:Npn \prg_new_conditional:Npnn
+ { \__prg_generate_conditional_parm:nnNpnn { new } { } }
+\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Npnn
+ { \__prg_generate_conditional_parm:nnNpnn { set } { _protected } }
+\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Npnn
+ { \__prg_generate_conditional_parm:nnNpnn { new } { _protected } }
+\cs_set_protected:Npn \__prg_generate_conditional_parm:nnNpnn #1#2#3#4#
+ {
+ \__cs_split_function:NN #3 \__prg_generate_conditional:nnNnnnnn
+ {#1} {#2} {#4}
+ }
+\cs_set_protected_nopar:Npn \prg_set_conditional:Nnn
+ { \__prg_generate_conditional_count:nnNnn { set } { } }
+\cs_set_protected_nopar:Npn \prg_new_conditional:Nnn
+ { \__prg_generate_conditional_count:nnNnn { new } { } }
+\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Nnn
+ { \__prg_generate_conditional_count:nnNnn { set } { _protected } }
+\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Nnn
+ { \__prg_generate_conditional_count:nnNnn { new } { _protected } }
+\cs_set_protected:Npn \__prg_generate_conditional_count:nnNnn #1#2#3
+ {
+ \__cs_split_function:NN #3 \__prg_generate_conditional_count:nnNnnnn
+ {#1} {#2}
+ }
+\cs_set_protected:Npn \__prg_generate_conditional_count:nnNnnnn #1#2#3#4#5
+ {
+ \__cs_parm_from_arg_count:nnF
+ { \__prg_generate_conditional:nnNnnnnn {#1} {#2} #3 {#4} {#5} }
+ { \tl_count:n {#2} }
+ {
+ \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments }
+ { \token_to_str:c { #1 : #2 } }
+ { \tl_count:n {#2} }
+ \use_none:nn
+ }
+ }
+\cs_set_protected:Npn \__prg_generate_conditional:nnNnnnnn #1#2#3#4#5#6#7#8
+ {
+ \if_meaning:w \c_false_bool #3
+ \__msg_kernel_error:nnx { kernel } { missing-colon }
+ { \token_to_str:c {#1} }
+ \exp_after:wN \use_none:nn
+ \fi:
+ \use:x
+ {
+ \exp_not:N \__prg_generate_conditional:nnnnnnw
+ \exp_not:n { {#4} {#5} {#1} {#2} {#6} {#8} }
+ \etex_detokenize:D {#7}
+ \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ }
+ }
+\cs_set_protected:Npn \__prg_generate_conditional:nnnnnnw #1#2#3#4#5#6#7 ,
+ {
+ \if_meaning:w \q_recursion_tail #7
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \use:c { __prg_generate_ #7 _form:wnnnnnn }
+ \tl_if_empty:nF {#7}
+ {
+ \__msg_kernel_error:nnxx
+ { kernel } { conditional-form-unknown }
+ {#7} { \token_to_str:c { #3 : #4 } }
+ }
+ \use_none:nnnnnnn
+ \q_stop
+ {#1} {#2} {#3} {#4} {#5} {#6}
+ \__prg_generate_conditional:nnnnnnw {#1} {#2} {#3} {#4} {#5} {#6}
+ }
+\cs_set_protected:Npn \__prg_generate_p_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
+ {
+ \if_meaning:w \scan_stop: #3 \scan_stop:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {
+ \exp_args:cc { cs_ #2 #3 :Npn } { #4 _p: #5 } #6
+ { #7 \c_zero \c_true_bool \c_false_bool }
+ }
+ {
+ \__msg_kernel_error:nnx { kernel } { protected-predicate }
+ { \token_to_str:c { #4 _p: #5 } }
+ }
+ }
+\cs_set_protected:Npn \__prg_generate_T_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
+ {
+ \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 T } #6
+ { #7 \c_zero \use:n \use_none:n }
+ }
+\cs_set_protected:Npn \__prg_generate_F_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
+ {
+ \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 F } #6
+ { #7 \c_zero { } }
+ }
+\cs_set_protected:Npn \__prg_generate_TF_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
+ {
+ \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 TF } #6
+ { #7 \c_zero }
+ }
+\cs_set_protected_nopar:Npn \prg_set_eq_conditional:NNn
+ { \__prg_set_eq_conditional:NNNn \cs_set_eq:cc }
+\cs_set_protected_nopar:Npn \prg_new_eq_conditional:NNn
+ { \__prg_set_eq_conditional:NNNn \cs_new_eq:cc }
+\cs_set_protected:Npn \__prg_set_eq_conditional:NNNn #1#2#3#4
+ {
+ \use:x
+ {
+ \exp_not:N \__prg_set_eq_conditional:nnNnnNNw
+ \__cs_split_function:NN #2 \prg_do_nothing:
+ \__cs_split_function:NN #3 \prg_do_nothing:
+ \exp_not:N #1
+ \etex_detokenize:D {#4}
+ \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ }
+ }
+\cs_set_protected:Npn \__prg_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6
+ {
+ \if_meaning:w \c_false_bool #3
+ \__msg_kernel_error:nnx { kernel } { missing-colon }
+ { \token_to_str:c {#1} }
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \if_meaning:w \c_false_bool #6
+ \__msg_kernel_error:nnx { kernel } { missing-colon }
+ { \token_to_str:c {#4} }
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \__prg_set_eq_conditional_loop:nnnnNw {#1} {#2} {#4} {#5}
+ }
+\cs_set_protected:Npn \__prg_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
+ \fi:
+ \use:c { __prg_set_eq_conditional_ #6 _form:wNnnnn }
+ \tl_if_empty:nF {#6}
+ {
+ \__msg_kernel_error:nnxx
+ { kernel } { conditional-form-unknown }
+ {#6} { \token_to_str:c { #1 : #2 } }
+ }
+ \use_none:nnnnnn
+ \q_stop
+ #5 {#1} {#2} {#3} {#4}
+ \__prg_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5
+ }
+\cs_set:Npn \__prg_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6
+ {
+ \__chk_if_exist_cs:c { #5 _p : #6 }
+ #2 { #3 _p : #4 } { #5 _p : #6 }
+ }
+\cs_set:Npn \__prg_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6
+ {
+ \__chk_if_exist_cs:c { #5 : #6 TF }
+ #2 { #3 : #4 TF } { #5 : #6 TF }
+ }
+\cs_set:Npn \__prg_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6
+ {
+ \__chk_if_exist_cs:c { #5 : #6 T }
+ #2 { #3 : #4 T } { #5 : #6 T }
+ }
+\cs_set:Npn \__prg_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6
+ {
+ \__chk_if_exist_cs:c { #5 : #6 F }
+ #2 { #3 : #4 F } { #5 : #6 F }
+ }
+\tex_chardef:D \c_true_bool = 1 ~
+\tex_chardef:D \c_false_bool = 0 ~
+\cs_set_nopar:Npn \cs_to_str:N
+ {
+ \__int_to_roman:w
+ \if:w \token_to_str:N \ \__cs_to_str:w \fi:
+ \exp_after:wN \__cs_to_str:N \token_to_str:N
+ }
+\cs_set:Npn \__cs_to_str:N #1 { \c_zero }
+\cs_set:Npn \__cs_to_str:w #1 \__cs_to_str:N
+ { - \__int_value:w \fi: \exp_after:wN \c_zero }
+\group_begin:
+\tex_lccode:D `\@ = `\: \scan_stop:
+\tex_catcode:D `\@ = 12 ~
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_set:Npn \__cs_split_function:NN #1
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__cs_split_function_auxi:w
+ \cs_to_str:N #1 \q_mark \c_true_bool
+ @ \q_mark \c_false_bool
+ \q_stop
+ }
+ \cs_set:Npn \__cs_split_function_auxi:w #1 @ #2 \q_mark #3#4 \q_stop #5
+ { \__cs_split_function_auxii:w #5 #1 \q_mark \q_stop {#2} #3 }
+ \cs_set:Npn \__cs_split_function_auxii:w #1#2 \q_mark #3 \q_stop
+ { #1 {#2} }
+ }
+\cs_set:Npn \__cs_get_function_name:N #1
+ { \__cs_split_function:NN #1 \use_i:nnn }
+\cs_set:Npn \__cs_get_function_signature:N #1
+ { \__cs_split_function:NN #1 \use_ii:nnn }
+\prg_set_conditional:Npnn \cs_if_exist:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w #1 \scan_stop:
+ \prg_return_false:
+ \else:
+ \if_cs_exist:N #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ \fi:
+ }
+\prg_set_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
+ {
+ \if_cs_exist:w #1 \cs_end:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {
+ \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop:
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+ \prg_return_false:
+ }
+\prg_set_conditional:Npnn \cs_if_free:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w #1 \scan_stop:
+ \prg_return_true:
+ \else:
+ \if_cs_exist:N #1
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ \fi:
+ }
+\prg_set_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
+ {
+ \if_cs_exist:w #1 \cs_end:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {
+ \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+ { \prg_return_true: }
+ }
+\cs_set: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_if_exist:NTF #1 { #1 } }
+\cs_set:Npn \cs_if_exist_use:NT #1 #2
+ { \cs_if_exist:NTF #1 { #1 #2 } { } }
+\cs_set:Npn \cs_if_exist_use:N #1
+ { \cs_if_exist:NTF #1 { #1 } { } }
+\cs_set:Npn \cs_if_exist_use:cTF #1#2
+ { \cs_if_exist:cTF {#1} { \use:c {#1} #2 } }
+\cs_set:Npn \cs_if_exist_use:cF #1
+ { \cs_if_exist:cTF {#1} { \use:c {#1} } }
+\cs_set:Npn \cs_if_exist_use:cT #1#2
+ { \cs_if_exist:cTF {#1} { \use:c {#1} #2 } { } }
+\cs_set:Npn \cs_if_exist_use:c #1
+ { \cs_if_exist:cTF {#1} { \use:c {#1} } { } }
+\cs_set_protected_nopar:Npn \iow_log:x
+ { \tex_immediate:D \tex_write:D \c_minus_one }
+\cs_set_protected_nopar:Npn \iow_term:x
+ { \tex_immediate:D \tex_write:D \c_sixteen }
+\cs_set_protected:Npn \__msg_kernel_error:nnxx #1#2#3#4
+ {
+ \tex_errmessage:D
+ {
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~! ^^J
+ Argh,~internal~LaTeX3~error! ^^J ^^J
+ Module ~ #1 , ~ message~name~"#2": ^^J
+ Arguments~'#3'~and~'#4' ^^J ^^J
+ This~is~one~for~The~LaTeX3~Project:~bailing~out
+ }
+ \tex_end:D
+ }
+\cs_set_protected:Npn \__msg_kernel_error:nnx #1#2#3
+ { \__msg_kernel_error:nnxx {#1} {#2} {#3} { } }
+\cs_set_protected:Npn \__msg_kernel_error:nn #1#2
+ { \__msg_kernel_error:nnxx {#1} {#2} { } { } }
+\cs_set_nopar:Npn \msg_line_context:
+ { on~line~ \tex_the:D \tex_inputlineno:D }
+\cs_set_protected:Npn \__chk_if_free_cs:N #1
+ {
+ \cs_if_free:NF #1
+ {
+ \__msg_kernel_error:nnxx { kernel } { command-already-defined }
+ { \token_to_str:N #1 } { \token_to_meaning:N #1 }
+ }
+}
+\tex_ifodd:D \l@expl@log@functions@bool
+ \cs_set_protected:Npn \__chk_if_free_cs:N #1
+ {
+ \cs_if_free:NF #1
+ {
+ \__msg_kernel_error:nnxx { kernel } { command-already-defined }
+ { \token_to_str:N #1 } { \token_to_meaning:N #1 }
+ }
+ \iow_log:x { Defining~\token_to_str:N #1~ \msg_line_context: }
+ }
+\fi:
+\cs_set_protected_nopar:Npn \__chk_if_free_cs:c
+ { \exp_args:Nc \__chk_if_free_cs:N }
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \__chk_if_exist_var:N #1
+ {
+ \cs_if_exist:NF #1
+ {
+ \__msg_kernel_error:nnx { check } { non-declared-variable }
+ { \token_to_str:N #1 }
+ }
+ }
+\fi:
+\cs_set_protected:Npn \__chk_if_exist_cs:N #1
+ {
+ \cs_if_exist:NF #1
+ {
+ \__msg_kernel_error:nnx { kernel } { command-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_set_protected_nopar:Npn \__chk_if_exist_cs:c
+ { \exp_args:Nc \__chk_if_exist_cs:N }
+\cs_set:Npn \__cs_tmp:w #1#2
+ {
+ \cs_set_protected:Npn #1 ##1
+ {
+ \__chk_if_free_cs:N ##1
+ #2 ##1
+ }
+ }
+\__cs_tmp:w \cs_new_nopar:Npn \cs_gset_nopar:Npn
+\__cs_tmp:w \cs_new_nopar:Npx \cs_gset_nopar:Npx
+\__cs_tmp:w \cs_new:Npn \cs_gset:Npn
+\__cs_tmp:w \cs_new:Npx \cs_gset:Npx
+\__cs_tmp:w \cs_new_protected_nopar:Npn \cs_gset_protected_nopar:Npn
+\__cs_tmp:w \cs_new_protected_nopar:Npx \cs_gset_protected_nopar:Npx
+\__cs_tmp:w \cs_new_protected:Npn \cs_gset_protected:Npn
+\__cs_tmp:w \cs_new_protected:Npx \cs_gset_protected:Npx
+\cs_set:Npn \__cs_tmp:w #1#2
+ { \cs_new_protected_nopar:Npn #1 { \exp_args:Nc #2 } }
+\__cs_tmp:w \cs_set_nopar:cpn \cs_set_nopar:Npn
+\__cs_tmp:w \cs_set_nopar:cpx \cs_set_nopar:Npx
+\__cs_tmp:w \cs_gset_nopar:cpn \cs_gset_nopar:Npn
+\__cs_tmp:w \cs_gset_nopar:cpx \cs_gset_nopar:Npx
+\__cs_tmp:w \cs_new_nopar:cpn \cs_new_nopar:Npn
+\__cs_tmp:w \cs_new_nopar:cpx \cs_new_nopar:Npx
+\__cs_tmp:w \cs_set:cpn \cs_set:Npn
+\__cs_tmp:w \cs_set:cpx \cs_set:Npx
+\__cs_tmp:w \cs_gset:cpn \cs_gset:Npn
+\__cs_tmp:w \cs_gset:cpx \cs_gset:Npx
+\__cs_tmp:w \cs_new:cpn \cs_new:Npn
+\__cs_tmp:w \cs_new:cpx \cs_new:Npx
+\__cs_tmp:w \cs_set_protected_nopar:cpn \cs_set_protected_nopar:Npn
+\__cs_tmp:w \cs_set_protected_nopar:cpx \cs_set_protected_nopar:Npx
+\__cs_tmp:w \cs_gset_protected_nopar:cpn \cs_gset_protected_nopar:Npn
+\__cs_tmp:w \cs_gset_protected_nopar:cpx \cs_gset_protected_nopar:Npx
+\__cs_tmp:w \cs_new_protected_nopar:cpn \cs_new_protected_nopar:Npn
+\__cs_tmp:w \cs_new_protected_nopar:cpx \cs_new_protected_nopar:Npx
+\__cs_tmp:w \cs_set_protected:cpn \cs_set_protected:Npn
+\__cs_tmp:w \cs_set_protected:cpx \cs_set_protected:Npx
+\__cs_tmp:w \cs_gset_protected:cpn \cs_gset_protected:Npn
+\__cs_tmp:w \cs_gset_protected:cpx \cs_gset_protected:Npx
+\__cs_tmp:w \cs_new_protected:cpn \cs_new_protected:Npn
+\__cs_tmp:w \cs_new_protected:cpx \cs_new_protected:Npx
+\cs_new_protected:Npn \cs_set_eq:NN #1 { \tex_let:D #1 =~ }
+\cs_new_protected_nopar:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN }
+\cs_new_protected_nopar:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN }
+\cs_new_protected_nopar:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN }
+\cs_new_protected_nopar:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN }
+\cs_new_protected_nopar:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN }
+\cs_new_protected_nopar:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN }
+\cs_new_protected_nopar:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN }
+\cs_new_protected:Npn \cs_new_eq:NN #1
+ {
+ \__chk_if_free_cs:N #1
+ \tex_global:D \cs_set_eq:NN #1
+ }
+\cs_new_protected_nopar:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN }
+\cs_new_protected_nopar:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN }
+\cs_new_protected_nopar:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN }
+\cs_new_protected:Npn \cs_undefine:N #1
+ { \cs_gset_eq:NN #1 \tex_undefined:D }
+\cs_new_protected:Npn \cs_undefine:c #1
+ {
+ \if_cs_exist:w #1 \cs_end:
+ \exp_after:wN \use:n
+ \else:
+ \exp_after:wN \use_none:n
+ \fi:
+ { \cs_gset_eq:cN {#1} \tex_undefined:D }
+ }
+\cs_set_protected:Npn \__cs_parm_from_arg_count:nnF #1#2
+ {
+ \exp_args:Nx \__cs_parm_from_arg_count_test:nnF
+ {
+ \exp_after:wN \exp_not:n
+ \if_case:w \__int_eval:w #2 \__int_eval_end:
+ { }
+ \or: { ##1 }
+ \or: { ##1##2 }
+ \or: { ##1##2##3 }
+ \or: { ##1##2##3##4 }
+ \or: { ##1##2##3##4##5 }
+ \or: { ##1##2##3##4##5##6 }
+ \or: { ##1##2##3##4##5##6##7 }
+ \or: { ##1##2##3##4##5##6##7##8 }
+ \or: { ##1##2##3##4##5##6##7##8##9 }
+ \else: { \c_false_bool }
+ \fi:
+ }
+ {#1}
+ }
+\cs_set_protected:Npn \__cs_parm_from_arg_count_test:nnF #1#2
+ {
+ \if_meaning:w \c_false_bool #1
+ \exp_after:wN \use_ii:nn
+ \else:
+ \exp_after:wN \use_i:nn
+ \fi:
+ { #2 {#1} }
+ }
+\cs_new:Npn \__cs_count_signature:N #1
+ { \int_eval:n { \__cs_split_function:NN #1 \__cs_count_signature:nnN } }
+\cs_new:Npn \__cs_count_signature:nnN #1#2#3
+ {
+ \if_meaning:w \c_true_bool #3
+ \tl_count:n {#2}
+ \else:
+ \c_minus_one
+ \fi:
+ }
+\cs_new_nopar:Npn \__cs_count_signature:c
+ { \exp_args:Nc \__cs_count_signature:N }
+\cs_new_protected:Npn \cs_generate_from_arg_count:NNnn #1#2#3#4
+ {
+ \__cs_parm_from_arg_count:nnF { \use:nnn #2 #1 } {#3}
+ {
+ \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments }
+ { \token_to_str:N #1 } { \int_eval:n {#3} }
+ }
+ {#4}
+ }
+\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:cNnn
+ { \exp_args:Nc \cs_generate_from_arg_count:NNnn }
+\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:Ncnn
+ { \exp_args:NNc \cs_generate_from_arg_count:NNnn }
+\cs_set:Npn \__cs_tmp:w #1#2#3
+ {
+ \cs_new_protected_nopar:cpx { cs_ #1 : #2 }
+ {
+ \exp_not:N \__cs_generate_from_signature:NNn
+ \exp_after:wN \exp_not:N \cs:w cs_ #1 : #3 \cs_end:
+ }
+ }
+\cs_new_protected:Npn \__cs_generate_from_signature:NNn #1#2
+ {
+ \__cs_split_function:NN #2 \__cs_generate_from_signature:nnNNNn
+ #1 #2
+ }
+\cs_new_protected:Npn \__cs_generate_from_signature:nnNNNn #1#2#3#4#5#6
+ {
+ \bool_if:NTF #3
+ {
+ \cs_generate_from_arg_count:NNnn
+ #5 #4 { \tl_count:n {#2} } {#6}
+ }
+ {
+ \__msg_kernel_error:nnx { kernel } { missing-colon }
+ { \token_to_str:N #5 }
+ }
+ }
+\__cs_tmp:w { set } { Nn } { Npn }
+\__cs_tmp:w { set } { Nx } { Npx }
+\__cs_tmp:w { set_nopar } { Nn } { Npn }
+\__cs_tmp:w { set_nopar } { Nx } { Npx }
+\__cs_tmp:w { set_protected } { Nn } { Npn }
+\__cs_tmp:w { set_protected } { Nx } { Npx }
+\__cs_tmp:w { set_protected_nopar } { Nn } { Npn }
+\__cs_tmp:w { set_protected_nopar } { Nx } { Npx }
+\__cs_tmp:w { gset } { Nn } { Npn }
+\__cs_tmp:w { gset } { Nx } { Npx }
+\__cs_tmp:w { gset_nopar } { Nn } { Npn }
+\__cs_tmp:w { gset_nopar } { Nx } { Npx }
+\__cs_tmp:w { gset_protected } { Nn } { Npn }
+\__cs_tmp:w { gset_protected } { Nx } { Npx }
+\__cs_tmp:w { gset_protected_nopar } { Nn } { Npn }
+\__cs_tmp:w { gset_protected_nopar } { Nx } { Npx }
+\__cs_tmp:w { new } { Nn } { Npn }
+\__cs_tmp:w { new } { Nx } { Npx }
+\__cs_tmp:w { new_nopar } { Nn } { Npn }
+\__cs_tmp:w { new_nopar } { Nx } { Npx }
+\__cs_tmp:w { new_protected } { Nn } { Npn }
+\__cs_tmp:w { new_protected } { Nx } { Npx }
+\__cs_tmp:w { new_protected_nopar } { Nn } { Npn }
+\__cs_tmp:w { new_protected_nopar } { Nx } { Npx }
+\cs_set:Npn \__cs_tmp:w #1#2
+ {
+ \cs_new_protected_nopar:cpx { cs_ #1 : c #2 }
+ {
+ \exp_not:N \exp_args:Nc
+ \exp_after:wN \exp_not:N \cs:w cs_ #1 : N #2 \cs_end:
+ }
+ }
+\__cs_tmp:w { set } { n }
+\__cs_tmp:w { set } { x }
+\__cs_tmp:w { set_nopar } { n }
+\__cs_tmp:w { set_nopar } { x }
+\__cs_tmp:w { set_protected } { n }
+\__cs_tmp:w { set_protected } { x }
+\__cs_tmp:w { set_protected_nopar } { n }
+\__cs_tmp:w { set_protected_nopar } { x }
+\__cs_tmp:w { gset } { n }
+\__cs_tmp:w { gset } { x }
+\__cs_tmp:w { gset_nopar } { n }
+\__cs_tmp:w { gset_nopar } { x }
+\__cs_tmp:w { gset_protected } { n }
+\__cs_tmp:w { gset_protected } { x }
+\__cs_tmp:w { gset_protected_nopar } { n }
+\__cs_tmp:w { gset_protected_nopar } { x }
+\__cs_tmp:w { new } { n }
+\__cs_tmp:w { new } { x }
+\__cs_tmp:w { new_nopar } { n }
+\__cs_tmp:w { new_nopar } { x }
+\__cs_tmp:w { new_protected } { n }
+\__cs_tmp:w { new_protected } { x }
+\__cs_tmp:w { new_protected_nopar } { n }
+\__cs_tmp:w { new_protected_nopar } { x }
+\prg_new_conditional:Npnn \cs_if_eq:NN #1#2 { p , T , F , TF }
+ {
+ \if_meaning:w #1#2
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_new_nopar:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN }
+\cs_new_nopar:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF }
+\cs_new_nopar:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT }
+\cs_new_nopar:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF }
+\cs_new_nopar:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN }
+\cs_new_nopar:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF }
+\cs_new_nopar:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT }
+\cs_new_nopar:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF }
+\cs_new_nopar:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN }
+\cs_new_nopar:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF }
+\cs_new_nopar:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT }
+\cs_new_nopar:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF }
+\cs_new_protected:Npn \__kernel_register_show:N #1
+ {
+ \cs_if_exist:NTF #1
+ { \tex_showthe:D \use:n {#1} }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_new_protected_nopar:Npn \__kernel_register_show:c
+ { \exp_args:Nc \__kernel_register_show:N }
+\group_begin:
+ \tex_lccode:D `? = `: \scan_stop:
+ \tex_catcode:D `? = 12 \scan_stop:
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \cs_show:N #1
+ {
+ \__msg_show_variable:n
+ {
+ > ~ \token_to_str:N #1 =
+ \exp_after:wN \__cs_show:www \cs_meaning:N #1
+ \use_none:nn ? \prg_do_nothing:
+ }
+ }
+ \cs_new:Npn \__cs_show:www #1 ? { #1 ? \\ }
+ }
+\cs_new_protected_nopar:Npn \cs_show:c
+ { \group_begin: \exp_args:NNc \group_end: \cs_show:N }
+\cs_new_eq:NN \luatex_if_engine:T \use_none:n
+\cs_new_eq:NN \luatex_if_engine:F \use:n
+\cs_new_eq:NN \luatex_if_engine:TF \use_ii:nn
+\cs_new_eq:NN \pdftex_if_engine:T \use:n
+\cs_new_eq:NN \pdftex_if_engine:F \use_none:n
+\cs_new_eq:NN \pdftex_if_engine:TF \use_i:nn
+\cs_new_eq:NN \xetex_if_engine:T \use_none:n
+\cs_new_eq:NN \xetex_if_engine:F \use:n
+\cs_new_eq:NN \xetex_if_engine:TF \use_ii:nn
+\cs_new_eq:NN \luatex_if_engine_p: \c_false_bool
+\cs_new_eq:NN \pdftex_if_engine_p: \c_true_bool
+\cs_new_eq:NN \xetex_if_engine_p: \c_false_bool
+\cs_if_exist:NT \xetex_XeTeXversion:D
+ {
+ \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n
+ \cs_gset_eq:NN \pdftex_if_engine:F \use:n
+ \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn
+ \cs_gset_eq:NN \xetex_if_engine:T \use:n
+ \cs_gset_eq:NN \xetex_if_engine:F \use_none:n
+ \cs_gset_eq:NN \xetex_if_engine:TF \use_i:nn
+ \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool
+ \cs_gset_eq:NN \xetex_if_engine_p: \c_true_bool
+ }
+\cs_if_exist:NT \luatex_directlua:D
+ {
+ \cs_gset_eq:NN \luatex_if_engine:T \use:n
+ \cs_gset_eq:NN \luatex_if_engine:F \use_none:n
+ \cs_gset_eq:NN \luatex_if_engine:TF \use_i:nn
+ \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n
+ \cs_gset_eq:NN \pdftex_if_engine:F \use:n
+ \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn
+ \cs_gset_eq:NN \luatex_if_engine_p: \c_true_bool
+ \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool
+ }
+\cs_new_nopar:Npn \prg_do_nothing: { }
+\prg_new_conditional:Npnn \str_if_eq:nn #1#2 { p , T , F , TF }
+ {
+ \if_int_compare:w \pdftex_strcmp:D { \exp_not:n {#1} } { \exp_not:n {#2} }
+ = \c_zero
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \str_if_eq_x:nn #1#2 { p , T , F , TF }
+ {
+ \if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\cs_new:Npn \__str_if_eq_x_return:nn #1 #2
+ {
+ \if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \str_case:nn #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case:nnTF {#1} {#2} { } { }
+ }
+\cs_new:Npn \str_case:nnT #1#2#3
+ {
+ \tex_romannumeral:D
+ \__str_case:nnTF {#1} {#2} {#3} { }
+ }
+\cs_new:Npn \str_case:nnF #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case:nnTF {#1} {#2} { }
+ }
+\cs_new:Npn \str_case:nnTF #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case:nnTF {#1} {#2}
+ }
+\cs_new:Npn \__str_case:nnTF #1#2#3#4
+ { \__str_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+\cs_new:Npn \__str_case:nw #1#2#3
+ {
+ \str_if_eq:nnTF {#1} {#2}
+ { \__str_case_end:nw {#3} }
+ { \__str_case:nw {#1} }
+ }
+\cs_new:Npn \str_case_x:nn #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case_x:nnTF {#1} {#2} { } { }
+ }
+\cs_new:Npn \str_case_x:nnT #1#2#3
+ {
+ \tex_romannumeral:D
+ \__str_case_x:nnTF {#1} {#2} {#3} { }
+ }
+\cs_new:Npn \str_case_x:nnF #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case_x:nnTF {#1} {#2} { }
+ }
+\cs_new:Npn \str_case_x:nnTF #1#2
+ {
+ \tex_romannumeral:D
+ \__str_case_x:nnTF {#1} {#2}
+ }
+\cs_new:Npn \__str_case_x:nnTF #1#2#3#4
+ { \__str_case_x:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+\cs_new:Npn \__str_case_x:nw #1#2#3
+ {
+ \str_if_eq_x:nnTF {#1} {#2}
+ { \__str_case_end:nw {#3} }
+ { \__str_case_x:nw {#1} }
+ }
+\cs_new:Npn \__prg_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+ { \c_zero #1 #4 }
+\cs_new_eq:NN \__str_case_end:nw \__prg_case_end:nw
+\cs_new_eq:NN \__prg_break_point:Nn \use_ii:nn
+\cs_new:Npn \__prg_map_break:Nn #1#2#3 \__prg_break_point:Nn #4#5
+ {
+ #5
+ \if_meaning:w #1 #4
+ \exp_after:wN \use_iii:nnn
+ \fi:
+ \__prg_map_break:Nn #1 {#2}
+ }
+\cs_new_eq:NN \__prg_break_point: \prg_do_nothing:
+\cs_new:Npn \__prg_break: #1 \__prg_break_point: { }
+\cs_new:Npn \__prg_break:n #1#2 \__prg_break_point: {#1}
+\cs_new_eq:NN \str_case:nnn \str_case:nnF
+\cs_new_eq:NN \str_case_x:nnn \str_case_x:nnF
+%% File: l3expan.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3expan.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Argument expansion}
+\cs_new:Npn \__exp_arg_next:nnn #1#2#3 { #2 \::: { #3 {#1} } }
+\cs_new:Npn \__exp_arg_next:Nnn #1#2#3 { #2 \::: { #3 #1 } }
+\cs_new:Npn \::: #1 {#1}
+\cs_new:Npn \::n #1 \::: #2#3 { #1 \::: { #2 {#3} } }
+\cs_new:Npn \::N #1 \::: #2#3 { #1 \::: {#2#3} }
+\cs_new:Npn \::p #1 \::: #2#3# { #1 \::: {#2#3} }
+\cs_new:Npn \::c #1 \::: #2#3
+ { \exp_after:wN \__exp_arg_next:Nnn \cs:w #3 \cs_end: {#1} {#2} }
+\cs_new:Npn \::o #1 \::: #2#3
+ { \exp_after:wN \__exp_arg_next:nnn \exp_after:wN {#3} {#1} {#2} }
+\cs_new:Npn \::f #1 \::: #2#3
+ {
+ \exp_after:wN \__exp_arg_next:nnn
+ \exp_after:wN { \tex_romannumeral:D -`0 #3 }
+ {#1} {#2}
+ }
+\use:nn { \cs_new_eq:NN \exp_stop_f: } { ~ }
+\cs_new_protected:Npn \::x #1 \::: #2#3
+ {
+ \cs_set_nopar:Npx \l__exp_internal_tl { {#3} }
+ \exp_after:wN \__exp_arg_next:nnn \l__exp_internal_tl {#1} {#2}
+ }
+\cs_new:Npn \::V #1 \::: #2#3
+ {
+ \exp_after:wN \__exp_arg_next:nnn
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
+ {#1} {#2}
+}
+\cs_new:Npn \::v # 1\::: #2#3
+ {
+ \exp_after:wN \__exp_arg_next:nnn
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#3} }
+ {#1} {#2}
+ }
+\cs_new:Npn \__exp_eval_register:N #1
+ {
+ \exp_after:wN \if_meaning:w \exp_not:N #1 #1
+ \if_meaning:w \scan_stop: #1
+ \__exp_eval_error_msg:w
+ \fi:
+ \else:
+ \exp_after:wN \use_i_ii:nnn
+ \fi:
+ \exp_after:wN \c_zero \tex_the:D #1
+ }
+\cs_new:Npn \__exp_eval_register:c #1
+ { \exp_after:wN \__exp_eval_register:N \cs:w #1 \cs_end: }
+\cs_new:Npn \__exp_eval_error_msg:w #1 \tex_the:D #2
+ {
+ \fi:
+ \fi:
+ \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2}
+ \c_zero
+ }
+\cs_new:Npn \exp_args:No #1#2 { \exp_after:wN #1 \exp_after:wN {#2} }
+\cs_new:Npn \exp_args:NNo #1#2#3
+ { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN {#3} }
+\cs_new:Npn \exp_args:NNNo #1#2#3#4
+ { \exp_after:wN #1 \exp_after:wN#2 \exp_after:wN #3 \exp_after:wN {#4} }
+\cs_new:Npn \exp_args:NNc #1#2#3
+ { \exp_after:wN #1 \exp_after:wN #2 \cs:w # 3\cs_end: }
+\cs_new:Npn \exp_args:Ncc #1#2#3
+ { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: \cs:w #3 \cs_end: }
+\cs_new:Npn \exp_args:Nccc #1#2#3#4
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \cs:w #3 \exp_after:wN \cs_end:
+ \cs:w #4 \cs_end:
+ }
+\cs_new:Npn \exp_args:Nf #1#2
+ { \exp_after:wN #1 \exp_after:wN { \tex_romannumeral:D -`0 #2 } }
+\cs_new:Npn \exp_args:Nv #1#2
+ {
+ \exp_after:wN #1 \exp_after:wN
+ { \tex_romannumeral:D \__exp_eval_register:c {#2} }
+ }
+\cs_new:Npn \exp_args:NV #1#2
+ {
+ \exp_after:wN #1 \exp_after:wN
+ { \tex_romannumeral:D \__exp_eval_register:N #2 }
+ }
+\cs_new:Npn \exp_args:NNf #1#2#3
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN { \tex_romannumeral:D -`0 #3 }
+ }
+\cs_new:Npn \exp_args:NNv #1#2#3
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#3} }
+ }
+\cs_new:Npn \exp_args:NNV #1#2#3
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
+ }
+\cs_new:Npn \exp_args:Nco #1#2#3
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \exp_after:wN {#3}
+ }
+\cs_new:Npn \exp_args:Ncf #1#2#3
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \exp_after:wN { \tex_romannumeral:D -`0 #3 }
+ }
+\cs_new:Npn \exp_args:NVV #1#2#3
+ {
+ \exp_after:wN #1
+ \exp_after:wN { \tex_romannumeral:D \exp_after:wN
+ \__exp_eval_register:N \exp_after:wN #2 \exp_after:wN }
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
+ }
+\cs_new:Npn \exp_args:NNNV #1#2#3#4
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #4 }
+ }
+\cs_new:Npn \exp_args:NcNc #1#2#3#4
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \exp_after:wN #3
+ \cs:w #4 \cs_end:
+ }
+\cs_new:Npn \exp_args:NcNo #1#2#3#4
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \exp_after:wN #3
+ \exp_after:wN {#4}
+ }
+\cs_new:Npn \exp_args:Ncco #1#2#3#4
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \cs:w #3 \exp_after:wN \cs_end:
+ \exp_after:wN {#4}
+ }
+\cs_new_protected_nopar:Npn \exp_args:Nx { \::x \::: }
+\cs_new_nopar:Npn \exp_args:Nnc { \::n \::c \::: }
+\cs_new_nopar:Npn \exp_args:Nfo { \::f \::o \::: }
+\cs_new_nopar:Npn \exp_args:Nff { \::f \::f \::: }
+\cs_new_nopar:Npn \exp_args:Nnf { \::n \::f \::: }
+\cs_new_nopar:Npn \exp_args:Nno { \::n \::o \::: }
+\cs_new_nopar:Npn \exp_args:NnV { \::n \::V \::: }
+\cs_new_nopar:Npn \exp_args:Noo { \::o \::o \::: }
+\cs_new_nopar:Npn \exp_args:Nof { \::o \::f \::: }
+\cs_new_nopar:Npn \exp_args:Noc { \::o \::c \::: }
+\cs_new_protected_nopar:Npn \exp_args:NNx { \::N \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Ncx { \::c \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nnx { \::n \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nox { \::o \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nxo { \::x \::o \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nxx { \::x \::x \::: }
+\cs_new_nopar:Npn \exp_args:NNno { \::N \::n \::o \::: }
+\cs_new_nopar:Npn \exp_args:NNoo { \::N \::o \::o \::: }
+\cs_new_nopar:Npn \exp_args:Nnnc { \::n \::n \::c \::: }
+\cs_new_nopar:Npn \exp_args:Nnno { \::n \::n \::o \::: }
+\cs_new_nopar:Npn \exp_args:Nooo { \::o \::o \::o \::: }
+\cs_new_protected_nopar:Npn \exp_args:NNnx { \::N \::n \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:NNox { \::N \::o \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nnnx { \::n \::n \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nnox { \::n \::o \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Nccx { \::c \::c \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Ncnx { \::c \::n \::x \::: }
+\cs_new_protected_nopar:Npn \exp_args:Noox { \::o \::o \::x \::: }
+\cs_new:Npn \__exp_arg_last_unbraced:nn #1#2 { #2#1 }
+\cs_new:Npn \::f_unbraced \::: #1#2
+ {
+ \exp_after:wN \__exp_arg_last_unbraced:nn
+ \exp_after:wN { \tex_romannumeral:D -`0 #2 } {#1}
+ }
+\cs_new:Npn \::o_unbraced \::: #1#2
+ { \exp_after:wN \__exp_arg_last_unbraced:nn \exp_after:wN {#2} {#1} }
+\cs_new:Npn \::V_unbraced \::: #1#2
+ {
+ \exp_after:wN \__exp_arg_last_unbraced:nn
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #2 } {#1}
+ }
+\cs_new:Npn \::v_unbraced \::: #1#2
+ {
+ \exp_after:wN \__exp_arg_last_unbraced:nn
+ \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#2} } {#1}
+ }
+\cs_new_protected:Npn \::x_unbraced \::: #1#2
+ {
+ \cs_set_nopar:Npx \l__exp_internal_tl { \exp_not:n {#1} #2 }
+ \l__exp_internal_tl
+ }
+\cs_new:Npn \exp_last_unbraced:NV #1#2
+ { \exp_after:wN #1 \tex_romannumeral:D \__exp_eval_register:N #2 }
+\cs_new:Npn \exp_last_unbraced:Nv #1#2
+ { \exp_after:wN #1 \tex_romannumeral:D \__exp_eval_register:c {#2} }
+\cs_new:Npn \exp_last_unbraced:No #1#2 { \exp_after:wN #1 #2 }
+\cs_new:Npn \exp_last_unbraced:Nf #1#2
+ { \exp_after:wN #1 \tex_romannumeral:D -`0 #2 }
+\cs_new:Npn \exp_last_unbraced:Nco #1#2#3
+ { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: #3 }
+\cs_new:Npn \exp_last_unbraced:NcV #1#2#3
+ {
+ \exp_after:wN #1
+ \cs:w #2 \exp_after:wN \cs_end:
+ \tex_romannumeral:D \__exp_eval_register:N #3
+ }
+\cs_new:Npn \exp_last_unbraced:NNV #1#2#3
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \tex_romannumeral:D \__exp_eval_register:N #3
+ }
+\cs_new:Npn \exp_last_unbraced:NNo #1#2#3
+ { \exp_after:wN #1 \exp_after:wN #2 #3 }
+\cs_new:Npn \exp_last_unbraced:NNNV #1#2#3#4
+ {
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \tex_romannumeral:D \__exp_eval_register:N #4
+ }
+\cs_new:Npn \exp_last_unbraced:NNNo #1#2#3#4
+ { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 #4 }
+\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: }
+\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: }
+\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: }
+\cs_new_nopar:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: }
+\cs_new_protected_nopar:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: }
+\cs_new:Npn \exp_last_two_unbraced:Noo #1#2#3
+ { \exp_after:wN \__exp_last_two_unbraced:noN \exp_after:wN {#3} {#2} #1 }
+\cs_new:Npn \__exp_last_two_unbraced:noN #1#2#3
+ { \exp_after:wN #3 #2 #1 }
+\cs_new:Npn \exp_not:o #1 { \etex_unexpanded:D \exp_after:wN {#1} }
+\cs_new:Npn \exp_not:c #1 { \exp_after:wN \exp_not:N \cs:w #1 \cs_end: }
+\cs_new:Npn \exp_not:f #1
+ { \etex_unexpanded:D \exp_after:wN { \tex_romannumeral:D -`0 #1 } }
+\cs_new:Npn \exp_not:V #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ { \tex_romannumeral:D \__exp_eval_register:N #1 }
+ }
+\cs_new:Npn \exp_not:v #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ { \tex_romannumeral:D \__exp_eval_register:c {#1} }
+ }
+\cs_new_protected:Npn \cs_generate_variant:Nn #1#2
+ {
+ \__chk_if_exist_cs:N #1
+ \__cs_generate_variant:N #1
+ \exp_after:wN \__cs_split_function:NN
+ \exp_after:wN #1
+ \exp_after:wN \__cs_generate_variant:nnNN
+ \exp_after:wN #1
+ \etex_detokenize:D {#2} , \scan_stop: , \q_recursion_stop
+ }
+\group_begin:
+ \tex_catcode:D `\M = 12 \scan_stop:
+ \tex_catcode:D `\A = 12 \scan_stop:
+ \tex_catcode:D `\P = 12 \scan_stop:
+ \tex_catcode:D `\R = 12 \scan_stop:
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \__cs_generate_variant:N #1
+ {
+ \exp_after:wN \if_meaning:w \exp_not:N #1 #1
+ \cs_set_eq:NN \__cs_tmp:w \cs_new_protected_nopar:Npx
+ \else:
+ \exp_after:wN \__cs_generate_variant:ww
+ \token_to_meaning:N #1 MA \q_mark
+ \q_mark \cs_new_protected_nopar:Npx
+ PR
+ \q_mark \cs_new_nopar:Npx
+ \q_stop
+ \fi:
+ }
+ \cs_new_protected:Npn \__cs_generate_variant:ww #1 MA #2 \q_mark
+ { \__cs_generate_variant:wwNw #1 }
+ \cs_new_protected:Npn \__cs_generate_variant:wwNw
+ #1 PR #2 \q_mark #3 #4 \q_stop
+ {
+ \cs_set_eq:NN \__cs_tmp:w #3
+ }
+ }
+\cs_new_protected:Npn \__cs_generate_variant:nnNN #1#2#3#4
+ {
+ \if_meaning:w \c_false_bool #3
+ \__msg_kernel_error:nnx { kernel } { missing-colon }
+ { \token_to_str:c {#1} }
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \__cs_generate_variant:Nnnw #4 {#1}{#2}
+ }
+\cs_new_protected:Npn \__cs_generate_variant:Nnnw #1#2#3#4 ,
+ {
+ \if_meaning:w \scan_stop: #4
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \use:x
+ {
+ \exp_not:N \__cs_generate_variant:wwNN
+ \__cs_generate_variant_loop:nNwN { }
+ #4
+ \__cs_generate_variant_loop_end:nwwwNNnn
+ \q_mark
+ #3 ~
+ { ~ { } \fi: \__cs_generate_variant_loop_long:wNNnn } ~
+ { }
+ \q_stop
+ \exp_not:N #1 {#2} {#4}
+ }
+ \__cs_generate_variant:Nnnw #1 {#2} {#3}
+ }
+\cs_new:Npn \__cs_generate_variant_loop:nNwN #1#2#3 \q_mark #4
+ {
+ \if:w #2 #4
+ \exp_after:wN \__cs_generate_variant_loop_same:w
+ \else:
+ \if:w N #4 \else:
+ \if:w n #4 \else:
+ \__cs_generate_variant_loop_invalid:NNwNNnn #4#2
+ \fi:
+ \fi:
+ \fi:
+ #1
+ \prg_do_nothing:
+ #2
+ \__cs_generate_variant_loop:nNwN { } #3 \q_mark
+ }
+\cs_new:Npn \__cs_generate_variant_loop_same:w
+ #1 \prg_do_nothing: #2#3#4
+ {
+ #3 { #1 \__cs_generate_variant_same:N #2 }
+ }
+\cs_new:Npn \__cs_generate_variant_loop_end:nwwwNNnn
+ #1#2 \q_mark #3 ~ #4 \q_stop #5#6#7#8
+ {
+ \scan_stop: \scan_stop: \fi:
+ \exp_not:N \q_mark
+ \exp_not:N \q_stop
+ \exp_not:N #6
+ \exp_not:c { #7 : #8 #1 #3 }
+ }
+\cs_new:Npn \__cs_generate_variant_loop_long:wNNnn #1 \q_stop #2#3#4#5
+ {
+ \exp_not:n
+ {
+ \q_mark
+ \__msg_kernel_error:nnxx { kernel } { variant-too-long }
+ {#5} { \token_to_str:N #3 }
+ \use_none:nnnn
+ \q_stop
+ #3
+ #3
+ }
+ }
+\cs_new:Npn \__cs_generate_variant_loop_invalid:NNwNNnn
+ #1#2 \fi: \fi: \fi: #3 \q_stop #4#5#6#7
+ {
+ \fi: \fi: \fi:
+ \exp_not:n
+ {
+ \q_mark
+ \__msg_kernel_error:nnxxxx { kernel } { invalid-variant }
+ {#7} { \token_to_str:N #5 } {#1} {#2}
+ \use_none:nnnn
+ \q_stop
+ #5
+ #5
+ }
+ }
+\cs_new:Npn \__cs_generate_variant_same:N #1
+ {
+ \if:w N #1
+ N
+ \else:
+ \if:w p #1
+ p
+ \else:
+ n
+ \fi:
+ \fi:
+ }
+\cs_new_protected:Npn \__cs_generate_variant:wwNN
+ #1 \q_mark #2 \q_stop #3#4
+ {
+ #2
+ \cs_if_free:NTF #4
+ {
+ \group_begin:
+ \__cs_generate_internal_variant:n {#1}
+ \__cs_tmp:w #4 { \exp_not:c { exp_args:N #1 } \exp_not:N #3 }
+ \group_end:
+ }
+ {
+ \iow_log:x
+ {
+ Variant~\token_to_str:N #4~%
+ already~defined;~ not~ changing~ it~on~line~%
+ \tex_the:D \tex_inputlineno:D
+ }
+ }
+ }
+\group_begin:
+ \tex_catcode:D `\X = 12 \scan_stop:
+ \tex_lccode:D `\N = `\N \scan_stop:
+\tex_lowercase:D
+ {
+ \group_end:
+ \cs_new_protected:Npn \__cs_generate_internal_variant:n #1
+ {
+ \__cs_generate_internal_variant:wwnNwnn
+ #1 \q_mark
+ { \cs_set_eq:NN \__cs_tmp:w \cs_new_protected_nopar:Npx }
+ \cs_new_protected_nopar:cpx
+ X \q_mark
+ { }
+ \cs_new_nopar:cpx
+ \q_stop
+ { exp_args:N #1 }
+ { \__cs_generate_internal_variant_loop:n #1 { : \use_i:nn } }
+ }
+ \cs_new_protected:Npn \__cs_generate_internal_variant:wwnNwnn
+ #1 X #2 \q_mark #3 #4 #5 \q_stop #6 #7
+ {
+ #3
+ \cs_if_free:cT {#6} { #4 {#6} {#7} }
+ }
+ }
+\cs_new:Npn \__cs_generate_internal_variant_loop:n #1
+ {
+ \exp_after:wN \exp_not:N \cs:w :: #1 \cs_end:
+ \__cs_generate_internal_variant_loop:n
+ }
+\cs_generate_variant:Nn \str_if_eq_p:nn { V , o }
+\cs_generate_variant:Nn \str_if_eq_p:nn { nV , no , VV }
+\cs_generate_variant:Nn \str_if_eq:nnT { V , o }
+\cs_generate_variant:Nn \str_if_eq:nnT { nV , no , VV }
+\cs_generate_variant:Nn \str_if_eq:nnF { V , o }
+\cs_generate_variant:Nn \str_if_eq:nnF { nV , no , VV }
+\cs_generate_variant:Nn \str_if_eq:nnTF { V , o }
+\cs_generate_variant:Nn \str_if_eq:nnTF { nV , no , VV }
+\cs_generate_variant:Nn \str_case:nn { o }
+\cs_generate_variant:Nn \str_case:nnT { o }
+\cs_generate_variant:Nn \str_case:nnF { o }
+\cs_generate_variant:Nn \str_case:nnTF { o }
+\cs_new_eq:NN \str_case:onn \str_case:onF
+%% File: l3tl.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3tl.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Token lists}
+\cs_new_protected:Npn \tl_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs_gset_eq:NN #1 \c_empty_tl
+ }
+\cs_generate_variant:Nn \tl_new:N { c }
+\cs_new_protected:Npn \tl_const:Nn #1#2
+ {
+ \__chk_if_free_cs:N #1
+ \cs_gset_nopar:Npx #1 { \exp_not:n {#2} }
+ }
+\cs_new_protected:Npn \tl_const:Nx #1#2
+ {
+ \__chk_if_free_cs:N #1
+ \cs_gset_nopar:Npx #1 {#2}
+ }
+\cs_generate_variant:Nn \tl_const:Nn { c }
+\cs_generate_variant:Nn \tl_const:Nx { c }
+\cs_new_protected:Npn \tl_clear:N #1
+ { \tl_set_eq:NN #1 \c_empty_tl }
+\cs_new_protected:Npn \tl_gclear:N #1
+ { \tl_gset_eq:NN #1 \c_empty_tl }
+\cs_generate_variant:Nn \tl_clear:N { c }
+\cs_generate_variant:Nn \tl_gclear:N { c }
+\cs_new_protected:Npn \tl_clear_new:N #1
+ { \tl_if_exist:NTF #1 { \tl_clear:N #1 } { \tl_new:N #1 } }
+\cs_new_protected:Npn \tl_gclear_new:N #1
+ { \tl_if_exist:NTF #1 { \tl_gclear:N #1 } { \tl_new:N #1 } }
+\cs_generate_variant:Nn \tl_clear_new:N { c }
+\cs_generate_variant:Nn \tl_gclear_new:N { c }
+\cs_new_eq:NN \tl_set_eq:NN \cs_set_eq:NN
+\cs_new_eq:NN \tl_set_eq:cN \cs_set_eq:cN
+\cs_new_eq:NN \tl_set_eq:Nc \cs_set_eq:Nc
+\cs_new_eq:NN \tl_set_eq:cc \cs_set_eq:cc
+\cs_new_eq:NN \tl_gset_eq:NN \cs_gset_eq:NN
+\cs_new_eq:NN \tl_gset_eq:cN \cs_gset_eq:cN
+\cs_new_eq:NN \tl_gset_eq:Nc \cs_gset_eq:Nc
+\cs_new_eq:NN \tl_gset_eq:cc \cs_gset_eq:cc
+\cs_new_protected:Npn \tl_concat:NNN #1#2#3
+ { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
+\cs_new_protected:Npn \tl_gconcat:NNN #1#2#3
+ { \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
+\cs_generate_variant:Nn \tl_concat:NNN { ccc }
+\cs_generate_variant:Nn \tl_gconcat:NNN { ccc }
+\prg_new_eq_conditional:NNn \tl_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p }
+%%
+\tl_const:Nn \c_empty_tl { }
+\tl_const:Nx \c_job_name_tl { \tex_jobname:D }
+\tl_const:Nn \c_space_tl { ~ }
+\cs_new_protected:Npn \tl_set:Nn #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:n {#2} } }
+\cs_new_protected:Npn \tl_set:No #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o {#2} } }
+\cs_new_protected:Npn \tl_set:Nx #1#2
+ { \cs_set_nopar:Npx #1 {#2} }
+\cs_new_protected:Npn \tl_gset:Nn #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } }
+\cs_new_protected:Npn \tl_gset:No #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} } }
+\cs_new_protected:Npn \tl_gset:Nx #1#2
+ { \cs_gset_nopar:Npx #1 {#2} }
+\cs_generate_variant:Nn \tl_set:Nn { NV , Nv , Nf }
+\cs_generate_variant:Nn \tl_set:Nx { c }
+\cs_generate_variant:Nn \tl_set:Nn { c, co , cV , cv , cf }
+\cs_generate_variant:Nn \tl_gset:Nn { NV , Nv , Nf }
+\cs_generate_variant:Nn \tl_gset:Nx { c }
+\cs_generate_variant:Nn \tl_gset:Nn { c, co , cV , cv , cf }
+\cs_new_protected:Npn \tl_put_left:Nn #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_put_left:NV #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_put_left:No #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_put_left:Nx #1#2
+ { \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_gput_left:Nn #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_gput_left:NV #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_gput_left:No #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } }
+\cs_new_protected:Npn \tl_gput_left:Nx #1#2
+ { \cs_gset_nopar:Npx #1 { #2 \exp_not:o {#1} } }
+\cs_generate_variant:Nn \tl_put_left:Nn { c }
+\cs_generate_variant:Nn \tl_put_left:NV { c }
+\cs_generate_variant:Nn \tl_put_left:No { c }
+\cs_generate_variant:Nn \tl_put_left:Nx { c }
+\cs_generate_variant:Nn \tl_gput_left:Nn { c }
+\cs_generate_variant:Nn \tl_gput_left:NV { c }
+\cs_generate_variant:Nn \tl_gput_left:No { c }
+\cs_generate_variant:Nn \tl_gput_left:Nx { c }
+\cs_new_protected:Npn \tl_put_right:Nn #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } }
+\cs_new_protected:Npn \tl_put_right:NV #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } }
+\cs_new_protected:Npn \tl_put_right:No #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } }
+\cs_new_protected:Npn \tl_put_right:Nx #1#2
+ { \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } }
+\cs_new_protected:Npn \tl_gput_right:Nn #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } }
+\cs_new_protected:Npn \tl_gput_right:NV #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } }
+\cs_new_protected:Npn \tl_gput_right:No #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } }
+\cs_new_protected:Npn \tl_gput_right:Nx #1#2
+ { \cs_gset_nopar:Npx #1 { \exp_not:o {#1} #2 } }
+\cs_generate_variant:Nn \tl_put_right:Nn { c }
+\cs_generate_variant:Nn \tl_put_right:NV { c }
+\cs_generate_variant:Nn \tl_put_right:No { c }
+\cs_generate_variant:Nn \tl_put_right:Nx { c }
+\cs_generate_variant:Nn \tl_gput_right:Nn { c }
+\cs_generate_variant:Nn \tl_gput_right:NV { c }
+\cs_generate_variant:Nn \tl_gput_right:No { c }
+\cs_generate_variant:Nn \tl_gput_right:Nx { c }
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \__cs_tmp:w #1
+ {
+ \if_meaning:w ? #1
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ \use:x
+ {
+ \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 }
+ {
+ \__chk_if_exist_var:N \exp_not:n {##1}
+ \exp_not:o { #1 {##1} {##2} }
+ }
+ }
+ \__cs_tmp:w
+ }
+ \__cs_tmp:w
+ \tl_set:Nn \tl_set:No \tl_set:Nx
+ \tl_gset:Nn \tl_gset:No \tl_gset:Nx
+ \tl_put_left:Nn \tl_put_left:NV
+ \tl_put_left:No \tl_put_left:Nx
+ \tl_gput_left:Nn \tl_gput_left:NV
+ \tl_gput_left:No \tl_gput_left:Nx
+ \tl_put_right:Nn \tl_put_right:NV
+ \tl_put_right:No \tl_put_right:Nx
+ \tl_gput_right:Nn \tl_gput_right:NV
+ \tl_gput_right:No \tl_gput_right:Nx
+ ? \q_recursion_stop
+ \cs_set_protected:Npn \tl_set_eq:NN #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \cs_set_eq:NN #1 #2
+ }
+ \cs_set_protected:Npn \tl_gset_eq:NN #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \cs_gset_eq:NN #1 #2
+ }
+ \cs_set_protected:Npn \tl_concat:NNN #1#2#3
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \__chk_if_exist_var:N #3
+ \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
+ }
+ \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3
+ {
+ \__chk_if_exist_var:N #1
+ \__chk_if_exist_var:N #2
+ \__chk_if_exist_var:N #3
+ \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
+ }
+\tex_fi:D
+\group_begin:
+ \tex_lccode:D `\A = `\@ \scan_stop:
+ \tex_lccode:D `\B = `\@ \scan_stop:
+ \tex_catcode:D `\A = 8 \scan_stop:
+ \tex_catcode:D `\B = 3 \scan_stop:
+\tex_lowercase:D
+ {
+ \group_end:
+ \tl_const:Nn \c__tl_rescan_marker_tl { A B }
+ }
+\cs_new_protected_nopar:Npn \tl_set_rescan:Nnn
+ { \__tl_set_rescan:NNnn \tl_set:Nn }
+\cs_new_protected_nopar:Npn \tl_gset_rescan:Nnn
+ { \__tl_set_rescan:NNnn \tl_gset:Nn }
+\cs_new_protected_nopar:Npn \tl_rescan:nn
+ { \__tl_set_rescan:NNnn \prg_do_nothing: \use:n }
+\cs_new_protected:Npn \__tl_set_rescan:NNnn #1#2#3#4
+ {
+ \group_begin:
+ \exp_args:No \etex_everyeof:D { \c__tl_rescan_marker_tl \exp_not:N }
+ \tex_endlinechar:D \c_minus_one
+ \tex_newlinechar:D \c_minus_one
+ #3
+ \use:x
+ {
+ \group_end:
+ #1 \exp_not:N #2
+ {
+ \exp_after:wN \__tl_rescan:w
+ \exp_after:wN \prg_do_nothing:
+ \etex_scantokens:D {#4}
+ }
+ }
+ }
+\use:x
+ {
+ \cs_new:Npn \exp_not:N \__tl_rescan:w ##1
+ \c__tl_rescan_marker_tl
+ { \exp_not:N \exp_not:o { ##1 } }
+ }
+\cs_generate_variant:Nn \tl_set_rescan:Nnn { Nno , Nnx }
+\cs_generate_variant:Nn \tl_set_rescan:Nnn { c , cno , cnx }
+\cs_generate_variant:Nn \tl_gset_rescan:Nnn { Nno , Nnx }
+\cs_generate_variant:Nn \tl_gset_rescan:Nnn { c , cno }
+\cs_new_protected:Npn \tl_to_lowercase:n #1
+ { \tex_lowercase:D {#1} }
+\cs_new_protected:Npn \tl_to_uppercase:n #1
+ { \tex_uppercase:D {#1} }
+\cs_new_protected_nopar:Npn \tl_replace_once:Nnn
+ { \__tl_replace:NNNnn \__tl_replace_once: \tl_set:Nx }
+\cs_new_protected_nopar:Npn \tl_greplace_once:Nnn
+ { \__tl_replace:NNNnn \__tl_replace_once: \tl_gset:Nx }
+\cs_new_protected_nopar:Npn \tl_replace_all:Nnn
+ { \__tl_replace:NNNnn \__tl_replace_all: \tl_set:Nx }
+\cs_new_protected_nopar:Npn \tl_greplace_all:Nnn
+ { \__tl_replace:NNNnn \__tl_replace_all: \tl_gset:Nx }
+\cs_generate_variant:Nn \tl_replace_once:Nnn { c }
+\cs_generate_variant:Nn \tl_greplace_once:Nnn { c }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { c }
+\cs_generate_variant:Nn \tl_greplace_all:Nnn { c }
+\cs_new_protected:Npn \__tl_replace:NNNnn #1#2#3#4#5
+ {
+ \tl_if_empty:nTF {#4}
+ {
+ \__msg_kernel_error:nnx { kernel } { empty-search-pattern }
+ { \tl_to_str:n {#5} }
+ }
+ {
+ \group_align_safe_begin:
+ \cs_set:Npx \__tl_tmp:w ##1##2 #4
+ {
+ ##2
+ \exp_not:N \q_mark
+ \exp_not:N \use_none_delimit_by_q_stop:w
+ \exp_not:n { \exp_not:n {#5} }
+ ##1
+ }
+ \group_align_safe_end:
+ #2 #3
+ {
+ \exp_after:wN #1
+ #3 \q_mark #4 \q_stop
+ }
+ }
+ }
+\cs_new:Npn \__tl_replace:w #1 \q_mark #2 { \exp_not:o {#1} }
+\cs_new_nopar:Npn \__tl_replace_all:
+ {
+ \exp_after:wN \__tl_replace:w
+ \__tl_tmp:w \__tl_replace_all: \prg_do_nothing:
+ }
+\cs_new_nopar:Npn \__tl_replace_once:
+ {
+ \exp_after:wN \__tl_replace:w
+ \__tl_tmp:w { \__tl_replace_once_end:w \prg_do_nothing: } \prg_do_nothing:
+ }
+\cs_new:Npn \__tl_replace_once_end:w #1 \q_mark #2 \q_stop
+ { \exp_not:o {#1} }
+\cs_new_protected:Npn \tl_remove_once:Nn #1#2
+ { \tl_replace_once:Nnn #1 {#2} { } }
+\cs_new_protected:Npn \tl_gremove_once:Nn #1#2
+ { \tl_greplace_once:Nnn #1 {#2} { } }
+\cs_generate_variant:Nn \tl_remove_once:Nn { c }
+\cs_generate_variant:Nn \tl_gremove_once:Nn { c }
+\cs_new_protected:Npn \tl_remove_all:Nn #1#2
+ { \tl_replace_all:Nnn #1 {#2} { } }
+\cs_new_protected:Npn \tl_gremove_all:Nn #1#2
+ { \tl_greplace_all:Nnn #1 {#2} { } }
+\cs_generate_variant:Nn \tl_remove_all:Nn { c }
+\cs_generate_variant:Nn \tl_gremove_all:Nn { c }
+\prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
+ { \__tl_if_empty_return:o { \use_none:n #1 ? } }
+\cs_generate_variant:Nn \tl_if_blank_p:n { V }
+\cs_generate_variant:Nn \tl_if_blank:nT { V }
+\cs_generate_variant:Nn \tl_if_blank:nF { V }
+\cs_generate_variant:Nn \tl_if_blank:nTF { V }
+\cs_generate_variant:Nn \tl_if_blank_p:n { o }
+\cs_generate_variant:Nn \tl_if_blank:nT { o }
+\cs_generate_variant:Nn \tl_if_blank:nF { o }
+\cs_generate_variant:Nn \tl_if_blank:nTF { o }
+\prg_new_conditional:Npnn \tl_if_empty:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w #1 \c_empty_tl
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \tl_if_empty_p:N { c }
+\cs_generate_variant:Nn \tl_if_empty:NT { c }
+\cs_generate_variant:Nn \tl_if_empty:NF { c }
+\cs_generate_variant:Nn \tl_if_empty:NTF { c }
+\prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F }
+ {
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \tl_to_str:n {#1} \q_nil
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \tl_if_empty_p:n { V }
+\cs_generate_variant:Nn \tl_if_empty:nTF { V }
+\cs_generate_variant:Nn \tl_if_empty:nT { V }
+\cs_generate_variant:Nn \tl_if_empty:nF { V }
+\cs_new:Npn \__tl_if_empty_return:o #1
+ {
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
+ \tl_to_str:n \exp_after:wN {#1} \q_nil
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
+ { \__tl_if_empty_return:o {#1} }
+\prg_new_conditional:Npnn \tl_if_eq:NN #1#2 { p , T , F , TF }
+ {
+ \if_meaning:w #1 #2
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \tl_if_eq_p:NN { Nc , c , cc }
+\cs_generate_variant:Nn \tl_if_eq:NNTF { Nc , c , cc }
+\cs_generate_variant:Nn \tl_if_eq:NNT { Nc , c , cc }
+\cs_generate_variant:Nn \tl_if_eq:NNF { Nc , c , cc }
+\prg_new_protected_conditional:Npnn \tl_if_eq:nn #1#2 { T , F , TF }
+ {
+ \group_begin:
+ \tl_set:Nn \l__tl_internal_a_tl {#1}
+ \tl_set:Nn \l__tl_internal_b_tl {#2}
+ \if_meaning:w \l__tl_internal_a_tl \l__tl_internal_b_tl
+ \group_end:
+ \prg_return_true:
+ \else:
+ \group_end:
+ \prg_return_false:
+ \fi:
+ }
+\tl_new:N \l__tl_internal_a_tl
+\tl_new:N \l__tl_internal_b_tl
+\cs_new_protected_nopar:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT }
+\cs_new_protected_nopar:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF }
+\cs_new_protected_nopar:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF }
+\cs_generate_variant:Nn \tl_if_in:NnT { c }
+\cs_generate_variant:Nn \tl_if_in:NnF { c }
+\cs_generate_variant:Nn \tl_if_in:NnTF { c }
+\prg_new_protected_conditional:Npnn \tl_if_in:nn #1#2 { T , F , TF }
+ {
+ \cs_set:Npn \__tl_tmp:w ##1 #2 { }
+ \tl_if_empty:oTF { \__tl_tmp:w #1 {} {} #2 }
+ { \prg_return_false: } { \prg_return_true: }
+ }
+\cs_generate_variant:Nn \tl_if_in:nnT { V , o , no }
+\cs_generate_variant:Nn \tl_if_in:nnF { V , o , no }
+\cs_generate_variant:Nn \tl_if_in:nnTF { V , o , no }
+\cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n }
+\cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT }
+\cs_new:Npn \tl_if_single:NF { \exp_args:No \tl_if_single:nF }
+\cs_new:Npn \tl_if_single:NTF { \exp_args:No \tl_if_single:nTF }
+\prg_new_conditional:Npnn \tl_if_single:n #1 { p , T , F , TF }
+ { \__str_if_eq_x_return:nn { \exp_not:o { \use_none:nn #1 ?? } } {?} }
+\cs_new:Npn \tl_case:Nn #1#2
+ {
+ \tex_romannumeral:D
+ \__tl_case:NnTF #1 {#2} { } { }
+ }
+\cs_new:Npn \tl_case:NnT #1#2#3
+ {
+ \tex_romannumeral:D
+ \__tl_case:NnTF #1 {#2} {#3} { }
+ }
+\cs_new:Npn \tl_case:NnF #1#2#3
+ {
+ \tex_romannumeral:D
+ \__tl_case:NnTF #1 {#2} { } {#3}
+ }
+\cs_new:Npn \tl_case:NnTF #1#2
+ {
+ \tex_romannumeral:D
+ \__tl_case:NnTF #1 {#2}
+ }
+\cs_new:Npn \__tl_case:NnTF #1#2#3#4
+ { \__tl_case:Nw #1 #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop }
+\cs_new:Npn \__tl_case:Nw #1#2#3
+ {
+ \tl_if_eq:NNTF #1 #2
+ { \__tl_case_end:nw {#3} }
+ { \__tl_case:Nw #1 }
+ }
+\cs_generate_variant:Nn \tl_case:Nn { c }
+\cs_generate_variant:Nn \tl_case:NnT { c }
+\cs_generate_variant:Nn \tl_case:NnF { c }
+\cs_generate_variant:Nn \tl_case:NnTF { c }
+\cs_new_eq:NN \__tl_case_end:nw \__prg_case_end:nw
+\cs_new:Npn \tl_map_function:nN #1#2
+ {
+ \__tl_map_function:Nn #2 #1
+ \q_recursion_tail
+ \__prg_break_point:Nn \tl_map_break: { }
+ }
+\cs_new_nopar:Npn \tl_map_function:NN
+ { \exp_args:No \tl_map_function:nN }
+\cs_new:Npn \__tl_map_function:Nn #1#2
+ {
+ \__quark_if_recursion_tail_break:nN {#2} \tl_map_break:
+ #1 {#2} \__tl_map_function:Nn #1
+ }
+\cs_generate_variant:Nn \tl_map_function:NN { c }
+\cs_new_protected:Npn \tl_map_inline:nn #1#2
+ {
+ \int_gincr:N \g__prg_map_int
+ \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+ \exp_args:Nc \__tl_map_function:Nn
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ #1 \q_recursion_tail
+ \__prg_break_point:Nn \tl_map_break: { \int_gdecr:N \g__prg_map_int }
+ }
+\cs_new_protected:Npn \tl_map_inline:Nn
+ { \exp_args:No \tl_map_inline:nn }
+\cs_generate_variant:Nn \tl_map_inline:Nn { c }
+\cs_new_protected:Npn \tl_map_variable:nNn #1#2#3
+ {
+ \__tl_map_variable:Nnn #2 {#3} #1
+ \q_recursion_tail
+ \__prg_break_point:Nn \tl_map_break: { }
+ }
+\cs_new_protected_nopar:Npn \tl_map_variable:NNn
+ { \exp_args:No \tl_map_variable:nNn }
+\cs_new_protected:Npn \__tl_map_variable:Nnn #1#2#3
+ {
+ \tl_set:Nn #1 {#3}
+ \__quark_if_recursion_tail_break:NN #1 \tl_map_break:
+ \use:n {#2}
+ \__tl_map_variable:Nnn #1 {#2}
+ }
+\cs_generate_variant:Nn \tl_map_variable:NNn { c }
+\cs_new_nopar:Npn \tl_map_break:
+ { \__prg_map_break:Nn \tl_map_break: { } }
+\cs_new_nopar:Npn \tl_map_break:n
+ { \__prg_map_break:Nn \tl_map_break: }
+\cs_new_eq:NN \tl_to_str:n \etex_detokenize:D
+\cs_new:Npn \tl_to_str:N #1 { \etex_detokenize:D \exp_after:wN {#1} }
+\cs_generate_variant:Nn \tl_to_str:N { c }
+\cs_new:Npn \tl_use:N #1
+ {
+ \tl_if_exist:NTF #1 {#1}
+ { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
+ }
+\cs_generate_variant:Nn \tl_use:N { c }
+\cs_new:Npn \tl_count:n #1
+ {
+ \int_eval:n
+ { 0 \tl_map_function:nN {#1} \__tl_count:n }
+ }
+\cs_new:Npn \tl_count:N #1
+ {
+ \int_eval:n
+ { 0 \tl_map_function:NN #1 \__tl_count:n }
+ }
+\cs_new:Npn \__tl_count:n #1 { + \c_one }
+\cs_generate_variant:Nn \tl_count:n { V , o }
+\cs_generate_variant:Nn \tl_count:N { c }
+\cs_new:Npn \tl_reverse_items:n #1
+ {
+ \__tl_reverse_items:nwNwn #1 ?
+ \q_mark \__tl_reverse_items:nwNwn
+ \q_mark \__tl_reverse_items:wn
+ \q_stop { }
+ }
+\cs_new:Npn \__tl_reverse_items:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5
+ {
+ #3 #2
+ \q_mark \__tl_reverse_items:nwNwn
+ \q_mark \__tl_reverse_items:wn
+ \q_stop { {#1} #5 }
+ }
+\cs_new:Npn \__tl_reverse_items:wn #1 \q_stop #2
+ { \exp_not:o { \use_none:nn #2 } }
+\cs_new:Npn \tl_trim_spaces:n #1
+ { \__tl_trim_spaces:nn { \q_mark #1 } \exp_not:o }
+\cs_new_protected:Npn \tl_trim_spaces:N #1
+ { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
+\cs_new_protected:Npn \tl_gtrim_spaces:N #1
+ { \tl_gset:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
+\cs_generate_variant:Nn \tl_trim_spaces:N { c }
+\cs_generate_variant:Nn \tl_gtrim_spaces:N { c }
+\cs_set:Npn \__tl_tmp:w #1
+ {
+ \cs_new:Npn \__tl_trim_spaces:nn ##1
+ {
+ \__tl_trim_spaces_auxi:w
+ ##1
+ \q_nil
+ \q_mark #1 { }
+ \q_mark \__tl_trim_spaces_auxii:w
+ \__tl_trim_spaces_auxiii:w
+ #1 \q_nil
+ \__tl_trim_spaces_auxiv:w
+ \q_stop
+ }
+ \cs_new:Npn \__tl_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3
+ {
+ ##3
+ \__tl_trim_spaces_auxi:w
+ \q_mark
+ ##2
+ \q_mark #1 {##1}
+ }
+ \cs_new:Npn \__tl_trim_spaces_auxii:w
+ \__tl_trim_spaces_auxi:w \q_mark \q_mark ##1
+ {
+ \__tl_trim_spaces_auxiii:w
+ ##1
+ }
+ \cs_new:Npn \__tl_trim_spaces_auxiii:w ##1 #1 \q_nil ##2
+ {
+ ##2
+ ##1 \q_nil
+ \__tl_trim_spaces_auxiii:w
+ }
+ \cs_new:Npn \__tl_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3
+ { ##3 { \use_none:n ##1 } }
+ }
+\__tl_tmp:w { ~ }
+\cs_new:Npn \__tl_act:NNNnn #1#2#3#4#5
+ {
+ \group_align_safe_begin:
+ \__tl_act_loop:w #5 \q__tl_act_mark \q__tl_act_stop
+ {#4} #1 #2 #3
+ \__tl_act_result:n { }
+ }
+\cs_new:Npn \__tl_act_loop:w #1 \q__tl_act_stop
+ {
+ \tl_if_head_is_N_type:nTF {#1}
+ { \__tl_act_normal:NwnNNN }
+ {
+ \tl_if_head_is_group:nTF {#1}
+ { \__tl_act_group:nwnNNN }
+ { \__tl_act_space:wwnNNN }
+ }
+ #1 \q__tl_act_stop
+ }
+\cs_new:Npn \__tl_act_normal:NwnNNN #1 #2 \q__tl_act_stop #3#4
+ {
+ \if_meaning:w \q__tl_act_mark #1
+ \exp_after:wN \__tl_act_end:wn
+ \fi:
+ #4 {#3} #1
+ \__tl_act_loop:w #2 \q__tl_act_stop
+ {#3} #4
+ }
+\cs_new:Npn \__tl_act_end:wn #1 \__tl_act_result:n #2
+ { \group_align_safe_end: \c_zero #2 }
+\cs_new:Npn \__tl_act_group:nwnNNN #1 #2 \q__tl_act_stop #3#4#5
+ {
+ #5 {#3} {#1}
+ \__tl_act_loop:w #2 \q__tl_act_stop
+ {#3} #4 #5
+ }
+\exp_last_unbraced:NNo
+ \cs_new:Npn \__tl_act_space:wwnNNN \c_space_tl #1 \q__tl_act_stop #2#3#4#5
+ {
+ #5 {#2}
+ \__tl_act_loop:w #1 \q__tl_act_stop
+ {#2} #3 #4 #5
+ }
+\cs_new:Npn \__tl_act_output:n #1 #2 \__tl_act_result:n #3
+ { #2 \__tl_act_result:n { #3 #1 } }
+\cs_new:Npn \__tl_act_reverse_output:n #1 #2 \__tl_act_result:n #3
+ { #2 \__tl_act_result:n { #1 #3 } }
+\cs_new:Npn \tl_reverse:n #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ {
+ \tex_romannumeral:D
+ \__tl_act:NNNnn
+ \__tl_reverse_normal:nN
+ \__tl_reverse_group_preserve:nn
+ \__tl_reverse_space:n
+ { }
+ {#1}
+ }
+ }
+\cs_generate_variant:Nn \tl_reverse:n { o , V }
+\cs_new:Npn \__tl_reverse_normal:nN #1#2
+ { \__tl_act_reverse_output:n {#2} }
+\cs_new:Npn \__tl_reverse_group_preserve:nn #1#2
+ { \__tl_act_reverse_output:n { {#2} } }
+\cs_new:Npn \__tl_reverse_space:n #1
+ { \__tl_act_reverse_output:n { ~ } }
+\cs_new_protected:Npn \tl_reverse:N #1
+ { \tl_set:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
+\cs_new_protected:Npn \tl_greverse:N #1
+ { \tl_gset:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
+\cs_generate_variant:Nn \tl_reverse:N { c }
+\cs_generate_variant:Nn \tl_greverse:N { c }
+\cs_new:Npn \tl_head:n #1
+ {
+ \etex_unexpanded:D
+ \if_false: { \fi: \__tl_head_auxi:nw #1 { } \q_stop }
+ }
+\cs_new:Npn \__tl_head_auxi:nw #1#2 \q_stop
+ { \exp_after:wN \__tl_head_auxii:nw \exp_after:wN { \if_false: } \fi: {#1} }
+\cs_new:Npn \__tl_head_auxii:nw #1
+ {
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
+ \tl_to_str:n \exp_after:wN { \use_none:n #1 } \q_nil
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {#1}
+ { \if_false: { \fi: \__tl_head_auxi:nw #1 } }
+ }
+\cs_generate_variant:Nn \tl_head:n { V , v , f }
+\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
+\cs_new_nopar:Npn \tl_head:N { \exp_args:No \tl_head:n }
+\cs_new:Npn \tl_tail:n #1
+ {
+ \etex_unexpanded:D
+ \tl_if_blank:nTF {#1}
+ { { } }
+ { \exp_after:wN { \use_none:n #1 } }
+ }
+\cs_generate_variant:Nn \tl_tail:n { V , v , f }
+\cs_new_nopar:Npn \tl_tail:N { \exp_args:No \tl_tail:n }
+\cs_new:Npn \str_head:n #1
+ {
+ \exp_after:wN \__str_head:w
+ \tl_to_str:n {#1}
+ { { } } ~ \q_stop
+ }
+\cs_new:Npn \__str_head:w #1 ~ %
+ { \tl_head:w #1 { ~ } }
+\cs_new:Npn \str_tail:n #1
+ {
+ \exp_after:wN \__str_tail:w
+ \reverse_if:N \if_charcode:w
+ \scan_stop: \tl_to_str:n {#1} X X \q_stop
+ }
+\cs_new:Npn \__str_tail:w #1 X #2 \q_stop { \fi: #1 }
+\prg_new_conditional:Npnn \tl_if_head_eq_charcode:nN #1#2 { p , T , F , TF }
+ {
+ \if_charcode:w
+ \exp_not:N #2
+ \tl_if_head_is_N_type:nTF { #1 ? }
+ {
+ \exp_after:wN \exp_not:N
+ \tl_head:w #1 { ? \use_none:nn } \q_stop
+ }
+ { \str_head:n {#1} }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode_p:nN { f }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { f }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { f }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { f }
+\prg_new_conditional:Npnn \tl_if_head_eq_catcode:nN #1 #2 { p , T , F , TF }
+ {
+ \if_catcode:w
+ \exp_not:N #2
+ \tl_if_head_is_N_type:nTF { #1 ? }
+ {
+ \exp_after:wN \exp_not:N
+ \tl_head:w #1 { ? \use_none:nn } \q_stop
+ }
+ {
+ \tl_if_head_is_group:nTF {#1}
+ { \c_group_begin_token }
+ { \c_space_token }
+ }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\prg_new_conditional:Npnn \tl_if_head_eq_meaning:nN #1#2 { p , T , F , TF }
+ {
+ \tl_if_head_is_N_type:nTF { #1 ? }
+ { \__tl_if_head_eq_meaning_normal:nN }
+ { \__tl_if_head_eq_meaning_special:nN }
+ {#1} #2
+ }
+\cs_new:Npn \__tl_if_head_eq_meaning_normal:nN #1 #2
+ {
+ \exp_after:wN \if_meaning:w
+ \tl_head:w #1 { ?? \use_none:nnn } \q_stop #2
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \__tl_if_head_eq_meaning_special:nN #1 #2
+ {
+ \if_charcode:w \str_head:n {#1} \exp_not:N #2
+ \exp_after:wN \use:n
+ \else:
+ \prg_return_false:
+ \exp_after:wN \use_none:n
+ \fi:
+ {
+ \if_catcode:w \exp_not:N #2
+ \tl_if_head_is_group:nTF {#1}
+ { \c_group_begin_token }
+ { \c_space_token }
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+ }
+\prg_new_conditional:Npnn \tl_if_head_is_N_type:n #1 { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ { \exp_not:o { \use:n #1 { } } }
+ { \exp_not:n { #1 { } } }
+ }
+\prg_new_conditional:Npnn \tl_if_head_is_group:n #1 { p , T , F , TF }
+ {
+ \if_catcode:w *
+ \exp_after:wN \use_none:n
+ \exp_after:wN {
+ \exp_after:wN {
+ \token_to_str:N #1 ?
+ }
+ }
+ *
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\prg_new_conditional:Npnn \tl_if_head_is_space:n #1 { p , T , F , TF }
+ {
+ \tex_romannumeral:D \if_false: { \fi:
+ \__tl_if_head_is_space:w ? #1 ? ~ }
+ }
+\cs_new:Npn \__tl_if_head_is_space:w #1 ~
+ {
+ \tl_if_empty:oTF { \use_none:n #1 }
+ { \exp_after:wN \c_zero \exp_after:wN \prg_return_true: }
+ { \exp_after:wN \c_zero \exp_after:wN \prg_return_false: }
+ \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi:
+ }
+\cs_new_protected:Npn \tl_show:N #1
+ {
+ \tl_if_exist:NTF #1
+ { \cs_show:N #1 }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_generate_variant:Nn \tl_show:N { c }
+\cs_new_protected:Npn \tl_show:n #1
+ { \__msg_show_variable:n { > ~ \tl_to_str:n {#1} } }
+\tl_new:N \g_tmpa_tl
+\tl_new:N \g_tmpb_tl
+\tl_new:N \l_tmpa_tl
+\tl_new:N \l_tmpb_tl
+\cs_new_eq:NN \tl_case:Nnn \tl_case:NnF
+\cs_new_eq:NN \tl_case:cnn \tl_case:cnF
+%% File: l3seq.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3seq.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Sequences and stacks}
+\cs_new:Npn \__seq_item:n
+ {
+ \__msg_kernel_expandable_error:nn { kernel } { misused-sequence }
+ \use_none:n
+ }
+\tl_new:N \l__seq_internal_a_tl
+\tl_new:N \l__seq_internal_b_tl
+\cs_new_eq:NN \__seq_tmp:w ?
+\tl_const:Nn \c_empty_seq { \s__seq }
+\cs_new_protected:Npn \seq_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs_gset_eq:NN #1 \c_empty_seq
+ }
+\cs_generate_variant:Nn \seq_new:N { c }
+\cs_new_protected:Npn \seq_clear:N #1
+ { \seq_set_eq:NN #1 \c_empty_seq }
+\cs_generate_variant:Nn \seq_clear:N { c }
+\cs_new_protected:Npn \seq_gclear:N #1
+ { \seq_gset_eq:NN #1 \c_empty_seq }
+\cs_generate_variant:Nn \seq_gclear:N { c }
+\cs_new_protected:Npn \seq_clear_new:N #1
+ { \seq_if_exist:NTF #1 { \seq_clear:N #1 } { \seq_new:N #1 } }
+\cs_generate_variant:Nn \seq_clear_new:N { c }
+\cs_new_protected:Npn \seq_gclear_new:N #1
+ { \seq_if_exist:NTF #1 { \seq_gclear:N #1 } { \seq_new:N #1 } }
+\cs_generate_variant:Nn \seq_gclear_new:N { c }
+\cs_new_eq:NN \seq_set_eq:NN \tl_set_eq:NN
+\cs_new_eq:NN \seq_set_eq:Nc \tl_set_eq:Nc
+\cs_new_eq:NN \seq_set_eq:cN \tl_set_eq:cN
+\cs_new_eq:NN \seq_set_eq:cc \tl_set_eq:cc
+\cs_new_eq:NN \seq_gset_eq:NN \tl_gset_eq:NN
+\cs_new_eq:NN \seq_gset_eq:Nc \tl_gset_eq:Nc
+\cs_new_eq:NN \seq_gset_eq:cN \tl_gset_eq:cN
+\cs_new_eq:NN \seq_gset_eq:cc \tl_gset_eq:cc
+\cs_new_protected_nopar:Npn \seq_set_split:Nnn
+ { \__seq_set_split:NNnn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gset_split:Nnn
+ { \__seq_set_split:NNnn \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_set_split:NNnn #1#2#3#4
+ {
+ \tl_if_empty:nTF {#3}
+ {
+ \tl_set:Nn \l__seq_internal_a_tl
+ { \tl_map_function:nN {#4} \__seq_wrap_item:n }
+ }
+ {
+ \tl_set:Nn \l__seq_internal_a_tl
+ {
+ \__seq_set_split_auxi:w \prg_do_nothing:
+ #4
+ \__seq_set_split_end:
+ }
+ \tl_replace_all:Nnn \l__seq_internal_a_tl { #3 }
+ {
+ \__seq_set_split_end:
+ \__seq_set_split_auxi:w \prg_do_nothing:
+ }
+ \tl_set:Nx \l__seq_internal_a_tl { \l__seq_internal_a_tl }
+ }
+ #1 #2 { \s__seq \l__seq_internal_a_tl }
+ }
+\cs_new:Npn \__seq_set_split_auxi:w #1 \__seq_set_split_end:
+ {
+ \exp_not:N \__seq_set_split_auxii:w
+ \exp_args:No \tl_trim_spaces:n {#1}
+ \exp_not:N \__seq_set_split_end:
+ }
+\cs_new:Npn \__seq_set_split_auxii:w #1 \__seq_set_split_end:
+ { \__seq_wrap_item:n {#1} }
+\cs_generate_variant:Nn \seq_set_split:Nnn { NnV }
+\cs_generate_variant:Nn \seq_gset_split:Nnn { NnV }
+\cs_new_protected:Npn \seq_concat:NNN #1#2#3
+ { \tl_set:Nf #1 { \exp_after:wN \use_i:nn \exp_after:wN #2 #3 } }
+\cs_new_protected:Npn \seq_gconcat:NNN #1#2#3
+ { \tl_gset:Nf #1 { \exp_after:wN \use_i:nn \exp_after:wN #2 #3 } }
+\cs_generate_variant:Nn \seq_concat:NNN { ccc }
+\cs_generate_variant:Nn \seq_gconcat:NNN { ccc }
+\prg_new_eq_conditional:NNn \seq_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \seq_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_protected:Npn \seq_put_left:Nn #1#2
+ {
+ \tl_set:Nx #1
+ {
+ \exp_not:n { \s__seq \__seq_item:n {#2} }
+ \exp_not:f { \exp_after:wN \__seq_put_left_aux:w #1 }
+ }
+ }
+\cs_new_protected:Npn \seq_gput_left:Nn #1#2
+ {
+ \tl_gset:Nx #1
+ {
+ \exp_not:n { \s__seq \__seq_item:n {#2} }
+ \exp_not:f { \exp_after:wN \__seq_put_left_aux:w #1 }
+ }
+ }
+\cs_new:Npn \__seq_put_left_aux:w \s__seq { \exp_stop_f: }
+\cs_generate_variant:Nn \seq_put_left:Nn { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_put_left:Nn { c , cV , cv , co , cx }
+\cs_generate_variant:Nn \seq_gput_left:Nn { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_gput_left:Nn { c , cV , cv , co , cx }
+\cs_new_protected:Npn \seq_put_right:Nn #1#2
+ { \tl_put_right:Nn #1 { \__seq_item:n {#2} } }
+\cs_new_protected:Npn \seq_gput_right:Nn #1#2
+ { \tl_gput_right:Nn #1 { \__seq_item:n {#2} } }
+\cs_generate_variant:Nn \seq_gput_right:Nn { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_gput_right:Nn { c , cV , cv , co , cx }
+\cs_generate_variant:Nn \seq_put_right:Nn { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_put_right:Nn { c , cV , cv , co , cx }
+\cs_new:Npn \__seq_wrap_item:n #1 { \exp_not:n { \__seq_item:n {#1} } }
+\seq_new:N \l__seq_remove_seq
+\cs_new_protected:Npn \seq_remove_duplicates:N
+ { \__seq_remove_duplicates:NN \seq_set_eq:NN }
+\cs_new_protected:Npn \seq_gremove_duplicates:N
+ { \__seq_remove_duplicates:NN \seq_gset_eq:NN }
+\cs_new_protected:Npn \__seq_remove_duplicates:NN #1#2
+ {
+ \seq_clear:N \l__seq_remove_seq
+ \seq_map_inline:Nn #2
+ {
+ \seq_if_in:NnF \l__seq_remove_seq {##1}
+ { \seq_put_right:Nn \l__seq_remove_seq {##1} }
+ }
+ #1 #2 \l__seq_remove_seq
+ }
+\cs_generate_variant:Nn \seq_remove_duplicates:N { c }
+\cs_generate_variant:Nn \seq_gremove_duplicates:N { c }
+\cs_new_protected:Npn \seq_remove_all:Nn
+ { \__seq_remove_all_aux:NNn \tl_set:Nx }
+\cs_new_protected:Npn \seq_gremove_all:Nn
+ { \__seq_remove_all_aux:NNn \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_remove_all_aux:NNn #1#2#3
+ {
+ \__seq_push_item_def:n
+ {
+ \str_if_eq:nnT {##1} {#3}
+ {
+ \if_false: { \fi: }
+ \tl_set:Nn \l__seq_internal_b_tl {##1}
+ #1 #2
+ { \if_false: } \fi:
+ \exp_not:o {#2}
+ \tl_if_eq:NNT \l__seq_internal_a_tl \l__seq_internal_b_tl
+ { \use_none:nn }
+ }
+ \__seq_wrap_item:n {##1}
+ }
+ \tl_set:Nn \l__seq_internal_a_tl {#3}
+ #1 #2 {#2}
+ \__seq_pop_item_def:
+ }
+\cs_generate_variant:Nn \seq_remove_all:Nn { c }
+\cs_generate_variant:Nn \seq_gremove_all:Nn { c }
+\prg_new_conditional:Npnn \seq_if_empty:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w #1 \c_empty_seq
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \seq_if_empty_p:N { c }
+\cs_generate_variant:Nn \seq_if_empty:NT { c }
+\cs_generate_variant:Nn \seq_if_empty:NF { c }
+\cs_generate_variant:Nn \seq_if_empty:NTF { c }
+\prg_new_protected_conditional:Npnn \seq_if_in:Nn #1#2
+ { T , F , TF }
+ {
+ \group_begin:
+ \tl_set:Nn \l__seq_internal_a_tl {#2}
+ \cs_set_protected:Npn \__seq_item:n ##1
+ {
+ \tl_set:Nn \l__seq_internal_b_tl {##1}
+ \if_meaning:w \l__seq_internal_a_tl \l__seq_internal_b_tl
+ \exp_after:wN \__seq_if_in:
+ \fi:
+ }
+ #1
+ \group_end:
+ \prg_return_false:
+ \__prg_break_point:
+ }
+\cs_new_nopar:Npn \__seq_if_in:
+ { \__prg_break:n { \group_end: \prg_return_true: } }
+\cs_generate_variant:Nn \seq_if_in:NnT { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_if_in:NnT { c , cV , cv , co , cx }
+\cs_generate_variant:Nn \seq_if_in:NnF { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_if_in:NnF { c , cV , cv , co , cx }
+\cs_generate_variant:Nn \seq_if_in:NnTF { NV , Nv , No , Nx }
+\cs_generate_variant:Nn \seq_if_in:NnTF { c , cV , cv , co , cx }
+\cs_new_protected:Npn \__seq_pop:NNNN #1#2#3#4
+ {
+ \if_meaning:w #3 \c_empty_seq
+ \tl_set:Nn #4 { \q_no_value }
+ \else:
+ #1#2#3#4
+ \fi:
+ }
+\cs_new_protected:Npn \__seq_pop_TF:NNNN #1#2#3#4
+ {
+ \if_meaning:w #3 \c_empty_seq
+ % \tl_set:Nn #4 { \q_no_value }
+ \prg_return_false:
+ \else:
+ #1#2#3#4
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_protected:Npn \seq_get_left:NN #1#2
+ {
+ \tl_set:Nx #2
+ {
+ \exp_after:wN \__seq_get_left:wnw
+ #1 \__seq_item:n { \q_no_value } \q_stop
+ }
+ }
+\cs_new:Npn \__seq_get_left:wnw #1 \__seq_item:n #2#3 \q_stop
+ { \exp_not:n {#2} }
+\cs_generate_variant:Nn \seq_get_left:NN { c }
+\cs_new_protected_nopar:Npn \seq_pop_left:NN
+ { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_set:Nn }
+\cs_new_protected_nopar:Npn \seq_gpop_left:NN
+ { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_gset:Nn }
+\cs_new_protected:Npn \__seq_pop_left:NNN #1#2#3
+ { \exp_after:wN \__seq_pop_left:wnwNNN #2 \q_stop #1#2#3 }
+\cs_new_protected:Npn \__seq_pop_left:wnwNNN
+ #1 \__seq_item:n #2#3 \q_stop #4#5#6
+ {
+ #4 #5 { #1 #3 }
+ \tl_set:Nn #6 {#2}
+ }
+\cs_generate_variant:Nn \seq_pop_left:NN { c }
+\cs_generate_variant:Nn \seq_gpop_left:NN { c }
+\cs_new_protected:Npn \seq_get_right:NN #1#2
+ {
+ \exp_after:wN \use_i_ii:nnn
+ \exp_after:wN \__seq_get_right_loop:nn
+ \exp_after:wN \q_no_value
+ #1
+ { ?? \tl_set:Nn #2 }
+ { } { }
+ }
+\cs_new_protected:Npn \__seq_get_right_loop:nn #1#2
+ {
+ \use_none:nn #2 {#1}
+ \__seq_get_right_loop:nn
+ }
+\cs_generate_variant:Nn \seq_get_right:NN { c }
+\cs_new_protected_nopar:Npn \seq_pop_right:NN
+ { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gpop_right:NN
+ { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_pop_right:NNN #1#2#3
+ {
+ \cs_set_eq:NN \__seq_tmp:w \__seq_item:n
+ \cs_set_eq:NN \__seq_item:n \scan_stop:
+ #1 #2
+ { \if_false: } \fi: \s__seq
+ \exp_after:wN \use_i:nnn
+ \exp_after:wN \__seq_pop_right_loop:nn
+ #2
+ {
+ \if_false: { \fi: }
+ \tl_set:Nx #3
+ }
+ { } \use_none:nn
+ \cs_set_eq:NN \__seq_item:n \__seq_tmp:w
+ }
+\cs_new:Npn \__seq_pop_right_loop:nn #1#2
+ {
+ #2 { \exp_not:n {#1} }
+ \__seq_pop_right_loop:nn
+ }
+\cs_generate_variant:Nn \seq_pop_right:NN { c }
+\cs_generate_variant:Nn \seq_gpop_right:NN { c }
+\prg_new_protected_conditional:Npnn \seq_get_left:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \prg_do_nothing: \seq_get_left:NN #1#2 }
+\prg_new_protected_conditional:Npnn \seq_get_right:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \prg_do_nothing: \seq_get_right:NN #1#2 }
+\cs_generate_variant:Nn \seq_get_left:NNT { c }
+\cs_generate_variant:Nn \seq_get_left:NNF { c }
+\cs_generate_variant:Nn \seq_get_left:NNTF { c }
+\cs_generate_variant:Nn \seq_get_right:NNT { c }
+\cs_generate_variant:Nn \seq_get_right:NNF { c }
+\cs_generate_variant:Nn \seq_get_right:NNTF { c }
+\prg_new_protected_conditional:Npnn \seq_pop_left:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \__seq_pop_left:NNN \tl_set:Nn #1 #2 }
+\prg_new_protected_conditional:Npnn \seq_gpop_left:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \__seq_pop_left:NNN \tl_gset:Nn #1 #2 }
+\prg_new_protected_conditional:Npnn \seq_pop_right:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \__seq_pop_right:NNN \tl_set:Nx #1 #2 }
+\prg_new_protected_conditional:Npnn \seq_gpop_right:NN #1#2 { T , F , TF }
+ { \__seq_pop_TF:NNNN \__seq_pop_right:NNN \tl_gset:Nx #1 #2 }
+\cs_generate_variant:Nn \seq_pop_left:NNT { c }
+\cs_generate_variant:Nn \seq_pop_left:NNF { c }
+\cs_generate_variant:Nn \seq_pop_left:NNTF { c }
+\cs_generate_variant:Nn \seq_gpop_left:NNT { c }
+\cs_generate_variant:Nn \seq_gpop_left:NNF { c }
+\cs_generate_variant:Nn \seq_gpop_left:NNTF { c }
+\cs_generate_variant:Nn \seq_pop_right:NNT { c }
+\cs_generate_variant:Nn \seq_pop_right:NNF { c }
+\cs_generate_variant:Nn \seq_pop_right:NNTF { c }
+\cs_generate_variant:Nn \seq_gpop_right:NNT { c }
+\cs_generate_variant:Nn \seq_gpop_right:NNF { c }
+\cs_generate_variant:Nn \seq_gpop_right:NNTF { c }
+\cs_new_nopar:Npn \seq_map_break:
+ { \__prg_map_break:Nn \seq_map_break: { } }
+\cs_new_nopar:Npn \seq_map_break:n
+ { \__prg_map_break:Nn \seq_map_break: }
+\cs_new:Npn \seq_map_function:NN #1#2
+ {
+ \exp_after:wN \use_i_ii:nnn
+ \exp_after:wN \__seq_map_function:NNn
+ \exp_after:wN #2
+ #1
+ { ? \seq_map_break: } { }
+ \__prg_break_point:Nn \seq_map_break: { }
+ }
+\cs_new:Npn \__seq_map_function:NNn #1#2#3
+ {
+ \use_none:n #2
+ #1 {#3}
+ \__seq_map_function:NNn #1
+ }
+\cs_generate_variant:Nn \seq_map_function:NN { c }
+\cs_new_protected:Npn \__seq_push_item_def:n
+ {
+ \__seq_push_item_def:
+ \cs_gset:Npn \__seq_item:n ##1
+ }
+\cs_new_protected:Npn \__seq_push_item_def:x
+ {
+ \__seq_push_item_def:
+ \cs_gset:Npx \__seq_item:n ##1
+ }
+\cs_new_protected:Npn \__seq_push_item_def:
+ {
+ \int_gincr:N \g__prg_map_int
+ \cs_gset_eq:cN { __prg_map_ \int_use:N \g__prg_map_int :w }
+ \__seq_item:n
+ }
+\cs_new_protected_nopar:Npn \__seq_pop_item_def:
+ {
+ \cs_gset_eq:Nc \__seq_item:n
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ \int_gdecr:N \g__prg_map_int
+ }
+\cs_new_protected:Npn \seq_map_inline:Nn #1#2
+ {
+ \__seq_push_item_def:n {#2}
+ #1
+ \__prg_break_point:Nn \seq_map_break: { \__seq_pop_item_def: }
+ }
+\cs_generate_variant:Nn \seq_map_inline:Nn { c }
+\cs_new_protected:Npn \seq_map_variable:NNn #1#2#3
+ {
+ \__seq_push_item_def:x
+ {
+ \tl_set:Nn \exp_not:N #2 {##1}
+ \exp_not:n {#3}
+ }
+ #1
+ \__prg_break_point:Nn \seq_map_break: { \__seq_pop_item_def: }
+ }
+\cs_generate_variant:Nn \seq_map_variable:NNn { Nc }
+\cs_generate_variant:Nn \seq_map_variable:NNn { c , cc }
+\cs_new:Npn \seq_count:N #1
+ {
+ \int_eval:n
+ {
+ 0
+ \seq_map_function:NN #1 \__seq_count:n
+ }
+ }
+\cs_new:Npn \__seq_count:n #1 { + \c_one }
+\cs_generate_variant:Nn \seq_count:N { c }
+\cs_new:Npn \seq_use:Nnnn #1#2#3#4
+ {
+ \seq_if_exist:NTF #1
+ {
+ \int_case:nnF { \seq_count:N #1 }
+ {
+ { 0 } { }
+ { 1 } { \exp_after:wN \__seq_use:NNnNnn #1 ? { } { } }
+ { 2 } { \exp_after:wN \__seq_use:NNnNnn #1 {#2} }
+ }
+ {
+ \exp_after:wN \__seq_use_setup:w #1 \__seq_item:n
+ \q_mark { \__seq_use:nwwwwnwn {#3} }
+ \q_mark { \__seq_use:nwwn {#4} }
+ \q_stop { }
+ }
+ }
+ { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
+ }
+\cs_generate_variant:Nn \seq_use:Nnnn { c }
+\cs_new:Npn \__seq_use:NNnNnn #1#2#3#4#5#6 { \exp_not:n { #3 #6 #5 } }
+\cs_new:Npn \__seq_use_setup:w \s__seq { \__seq_use:nwwwwnwn { } }
+\cs_new:Npn \__seq_use:nwwwwnwn
+ #1 \__seq_item:n #2 \__seq_item:n #3 \__seq_item:n #4#5
+ \q_mark #6#7 \q_stop #8
+ {
+ #6 \__seq_item:n {#3} \__seq_item:n {#4} #5
+ \q_mark {#6} #7 \q_stop { #8 #1 #2 }
+ }
+\cs_new:Npn \__seq_use:nwwn #1 \__seq_item:n #2 #3 \q_stop #4
+ { \exp_not:n { #4 #1 #2 } }
+\cs_new:Npn \seq_use:Nn #1#2
+ { \seq_use:Nnnn #1 {#2} {#2} {#2} }
+\cs_generate_variant:Nn \seq_use:Nn { c }
+\cs_new_eq:NN \seq_push:Nn \seq_put_left:Nn
+\cs_new_eq:NN \seq_push:NV \seq_put_left:NV
+\cs_new_eq:NN \seq_push:Nv \seq_put_left:Nv
+\cs_new_eq:NN \seq_push:No \seq_put_left:No
+\cs_new_eq:NN \seq_push:Nx \seq_put_left:Nx
+\cs_new_eq:NN \seq_push:cn \seq_put_left:cn
+\cs_new_eq:NN \seq_push:cV \seq_put_left:cV
+\cs_new_eq:NN \seq_push:cv \seq_put_left:cv
+\cs_new_eq:NN \seq_push:co \seq_put_left:co
+\cs_new_eq:NN \seq_push:cx \seq_put_left:cx
+\cs_new_eq:NN \seq_gpush:Nn \seq_gput_left:Nn
+\cs_new_eq:NN \seq_gpush:NV \seq_gput_left:NV
+\cs_new_eq:NN \seq_gpush:Nv \seq_gput_left:Nv
+\cs_new_eq:NN \seq_gpush:No \seq_gput_left:No
+\cs_new_eq:NN \seq_gpush:Nx \seq_gput_left:Nx
+\cs_new_eq:NN \seq_gpush:cn \seq_gput_left:cn
+\cs_new_eq:NN \seq_gpush:cV \seq_gput_left:cV
+\cs_new_eq:NN \seq_gpush:cv \seq_gput_left:cv
+\cs_new_eq:NN \seq_gpush:co \seq_gput_left:co
+\cs_new_eq:NN \seq_gpush:cx \seq_gput_left:cx
+\cs_new_eq:NN \seq_get:NN \seq_get_left:NN
+\cs_new_eq:NN \seq_get:cN \seq_get_left:cN
+\cs_new_eq:NN \seq_pop:NN \seq_pop_left:NN
+\cs_new_eq:NN \seq_pop:cN \seq_pop_left:cN
+\cs_new_eq:NN \seq_gpop:NN \seq_gpop_left:NN
+\cs_new_eq:NN \seq_gpop:cN \seq_gpop_left:cN
+\prg_new_eq_conditional:NNn \seq_get:NN \seq_get_left:NN { T , F , TF }
+\prg_new_eq_conditional:NNn \seq_get:cN \seq_get_left:cN { T , F , TF }
+\prg_new_eq_conditional:NNn \seq_pop:NN \seq_pop_left:NN { T , F , TF }
+\prg_new_eq_conditional:NNn \seq_pop:cN \seq_pop_left:cN { T , F , TF }
+\prg_new_eq_conditional:NNn \seq_gpop:NN \seq_gpop_left:NN { T , F , TF }
+\prg_new_eq_conditional:NNn \seq_gpop:cN \seq_gpop_left:cN { T , F , TF }
+\cs_new_protected:Npn \seq_show:N #1
+ {
+ \__msg_show_variable:Nnn #1 { seq }
+ { \seq_map_function:NN #1 \__msg_show_item:n }
+ }
+\cs_generate_variant:Nn \seq_show:N { c }
+\seq_new:N \l_tmpa_seq
+\seq_new:N \l_tmpb_seq
+\seq_new:N \g_tmpa_seq
+\seq_new:N \g_tmpb_seq
+%% File: l3int.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3int.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Integers}
+\cs_new_eq:NN \__int_value:w \tex_number:D
+\cs_new_eq:NN \__int_eval:w \etex_numexpr:D
+\cs_new_eq:NN \__int_eval_end: \tex_relax:D
+\cs_new_eq:NN \if_int_odd:w \tex_ifodd:D
+\cs_new_eq:NN \if_case:w \tex_ifcase:D
+\cs_new:Npn \int_eval:n #1 { \__int_value:w \__int_eval:w #1 \__int_eval_end: }
+\cs_new:Npn \int_abs:n #1
+ {
+ \__int_value:w \exp_after:wN \__int_abs:N
+ \int_use:N \__int_eval:w #1 \__int_eval_end:
+ \exp_stop_f:
+ }
+\cs_new:Npn \__int_abs:N #1
+ { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
+\cs_set:Npn \int_max:nn #1#2
+ {
+ \__int_value:w \exp_after:wN \__int_maxmin:wwN
+ \int_use:N \__int_eval:w #1 \exp_after:wN ;
+ \int_use:N \__int_eval:w #2 ;
+ >
+ \exp_stop_f:
+ }
+\cs_set:Npn \int_min:nn #1#2
+ {
+ \__int_value:w \exp_after:wN \__int_maxmin:wwN
+ \int_use:N \__int_eval:w #1 \exp_after:wN ;
+ \int_use:N \__int_eval:w #2 ;
+ <
+ \exp_stop_f:
+ }
+\cs_new:Npn \__int_maxmin:wwN #1 ; #2 ; #3
+ {
+ \if_int_compare:w #1 #3 #2 ~
+ #1
+ \else:
+ #2
+ \fi:
+ }
+\cs_new:Npn \int_div_truncate:nn #1#2
+ {
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__int_div_truncate:NwNw
+ \int_use:N \__int_eval:w #1 \exp_after:wN ;
+ \int_use:N \__int_eval:w #2 ;
+ \__int_eval_end:
+ }
+\cs_new:Npn \__int_div_truncate:NwNw #1#2; #3#4;
+ {
+ \if_meaning:w 0 #1
+ \c_zero
+ \else:
+ (
+ #1#2
+ \if_meaning:w - #1 + \else: - \fi:
+ ( \if_meaning:w - #3 - \fi: #3#4 - \c_one ) / \c_two
+ )
+ \fi:
+ / #3#4
+ }
+\cs_new:Npn \int_div_round:nn #1#2
+ { \__int_value:w \__int_eval:w ( #1 ) / ( #2 ) \__int_eval_end: }
+\cs_new:Npn \int_mod:nn #1#2
+ {
+ \__int_value:w \__int_eval:w \exp_after:wN \__int_mod:ww
+ \__int_value:w \__int_eval:w #1 \exp_after:wN ;
+ \__int_value:w \__int_eval:w #2 ;
+ \__int_eval_end:
+ }
+\cs_new:Npn \__int_mod:ww #1; #2;
+ { #1 - ( \__int_div_truncate:NwNw #1 ; #2 ; ) * #2 }
+\cs_new_protected:Npn \int_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs:w newcount \cs_end: #1
+ }
+\cs_generate_variant:Nn \int_new:N { c }
+\cs_new_protected:Npn \int_const:Nn #1#2
+ {
+ \int_compare:nNnTF {#2} > \c_minus_one
+ {
+ \int_compare:nNnTF {#2} > \c__max_constdef_int
+ {
+ \int_new:N #1
+ \int_gset:Nn #1 {#2}
+ }
+ {
+ \__chk_if_free_cs:N #1
+ \tex_global:D \__int_constdef:Nw #1 =
+ \__int_eval:w #2 \__int_eval_end:
+ }
+ }
+ {
+ \int_new:N #1
+ \int_gset:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \int_const:Nn { c }
+\pdftex_if_engine:TF
+ {
+ \cs_new_eq:NN \__int_constdef:Nw \tex_mathchardef:D
+ \tex_mathchardef:D \c__max_constdef_int 32 767 ~
+ }
+ {
+ \cs_new_eq:NN \__int_constdef:Nw \tex_chardef:D
+ \tex_chardef:D \c__max_constdef_int 1 114 111 ~
+ }
+\cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero }
+\cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero }
+\cs_generate_variant:Nn \int_zero:N { c }
+\cs_generate_variant:Nn \int_gzero:N { c }
+\cs_new_protected:Npn \int_zero_new:N #1
+ { \int_if_exist:NTF #1 { \int_zero:N #1 } { \int_new:N #1 } }
+\cs_new_protected:Npn \int_gzero_new:N #1
+ { \int_if_exist:NTF #1 { \int_gzero:N #1 } { \int_new:N #1 } }
+\cs_generate_variant:Nn \int_zero_new:N { c }
+\cs_generate_variant:Nn \int_gzero_new:N { c }
+\cs_new_protected:Npn \int_set_eq:NN #1#2 { #1 = #2 }
+\cs_generate_variant:Nn \int_set_eq:NN { c }
+\cs_generate_variant:Nn \int_set_eq:NN { Nc , cc }
+\cs_new_protected:Npn \int_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
+\cs_generate_variant:Nn \int_gset_eq:NN { c }
+\cs_generate_variant:Nn \int_gset_eq:NN { Nc , cc }
+\prg_new_eq_conditional:NNn \int_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \int_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_protected:Npn \int_add:Nn #1#2
+ { \tex_advance:D #1 by \__int_eval:w #2 \__int_eval_end: }
+\cs_new_protected:Npn \int_sub:Nn #1#2
+ { \tex_advance:D #1 by - \__int_eval:w #2 \__int_eval_end: }
+\cs_new_protected_nopar:Npn \int_gadd:Nn
+ { \tex_global:D \int_add:Nn }
+\cs_new_protected_nopar:Npn \int_gsub:Nn
+ { \tex_global:D \int_sub:Nn }
+\cs_generate_variant:Nn \int_add:Nn { c }
+\cs_generate_variant:Nn \int_gadd:Nn { c }
+\cs_generate_variant:Nn \int_sub:Nn { c }
+\cs_generate_variant:Nn \int_gsub:Nn { c }
+\cs_new_protected:Npn \int_incr:N #1
+ { \tex_advance:D #1 \c_one }
+\cs_new_protected:Npn \int_decr:N #1
+ { \tex_advance:D #1 \c_minus_one }
+\cs_new_protected_nopar:Npn \int_gincr:N
+ { \tex_global:D \int_incr:N }
+\cs_new_protected_nopar:Npn \int_gdecr:N
+ { \tex_global:D \int_decr:N }
+\cs_generate_variant:Nn \int_incr:N { c }
+\cs_generate_variant:Nn \int_decr:N { c }
+\cs_generate_variant:Nn \int_gincr:N { c }
+\cs_generate_variant:Nn \int_gdecr:N { c }
+\cs_new_protected:Npn \int_set:Nn #1#2
+ { #1 ~ \__int_eval:w #2\__int_eval_end: }
+\cs_new_protected_nopar:Npn \int_gset:Nn { \tex_global:D \int_set:Nn }
+\cs_generate_variant:Nn \int_set:Nn { c }
+\cs_generate_variant:Nn \int_gset:Nn { c }
+\cs_new_eq:NN \int_use:N \tex_the:D
+\cs_new:Npn \int_use:c #1 { \int_use:N \cs:w #1 \cs_end: }
+\cs_new_protected_nopar:Npn \__prg_compare_error:
+ {
+ \if_int_compare:w \c_zero \c_zero \fi:
+ =
+ \__prg_compare_error:
+ }
+\cs_new:Npn \__prg_compare_error:Nw
+ #1#2 \q_stop
+ {
+ { }
+ \c_zero \fi:
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { unknown-comparison } {#1}
+ \prg_return_false:
+ }
+\prg_new_conditional:Npnn \int_compare:n #1 { p , T , F , TF }
+ {
+ \exp_after:wN \__int_compare:w
+ \int_use:N \__int_eval:w #1 \__prg_compare_error:
+ }
+\cs_new:Npn \__int_compare:w #1 \__prg_compare_error:
+ {
+ \exp_after:wN \if_false: \__int_value:w
+ \__int_compare:Nw #1 e { = nd_ } \q_stop
+ }
+\cs_new:Npn \__int_compare:Nw #1#2 \q_stop
+ {
+ \exp_after:wN \__int_compare:NNw
+ \__int_to_roman:w - 0 #2 \q_mark
+ #1#2 \q_stop
+ }
+\cs_new:Npn \__int_compare:NNw #1#2#3 \q_mark
+ {
+ \etex_unexpanded:D
+ \use:c { __int_compare_ #1 \if_meaning:w = #2 = \fi: :NNw }
+ \__prg_compare_error:Nw #1
+ }
+\cs_new:cpn { __int_compare_end_=:NNw } #1#2#3 e #4 \q_stop
+ {
+ {#3} \exp_stop_f:
+ \prg_return_false: \else: \prg_return_true: \fi:
+ }
+\cs_new:Npn \__int_compare:nnN #1#2#3
+ {
+ {#2} \exp_stop_f:
+ \prg_return_false: \exp_after:wN \use_none_delimit_by_q_stop:w
+ \fi:
+ #1 #2 #3 \exp_after:wN \__int_compare:Nw \__int_value:w \__int_eval:w
+ }
+\cs_new:cpn { __int_compare_=:NNw } #1#2#3 =
+ { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
+\cs_new:cpn { __int_compare_<:NNw } #1#2#3 <
+ { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} < }
+\cs_new:cpn { __int_compare_>:NNw } #1#2#3 >
+ { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} > }
+\cs_new:cpn { __int_compare_==:NNw } #1#2#3 ==
+ { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
+\cs_new:cpn { __int_compare_!=:NNw } #1#2#3 !=
+ { \__int_compare:nnN { \if_int_compare:w } {#3} = }
+\cs_new:cpn { __int_compare_<=:NNw } #1#2#3 <=
+ { \__int_compare:nnN { \if_int_compare:w } {#3} > }
+\cs_new:cpn { __int_compare_>=:NNw } #1#2#3 >=
+ { \__int_compare:nnN { \if_int_compare:w } {#3} < }
+\prg_new_conditional:Npnn \int_compare:nNn #1#2#3 { p , T , F , TF }
+ {
+ \if_int_compare:w \__int_eval:w #1 #2 \__int_eval:w #3 \__int_eval_end:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \int_case:nnTF #1
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} }
+ }
+\cs_new:Npn \int_case:nnT #1#2#3
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} {#3} { }
+ }
+\cs_new:Npn \int_case:nnF #1#2
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} { }
+ }
+\cs_new:Npn \int_case:nn #1#2
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} { } { }
+ }
+\cs_new:Npn \__int_case:nnTF #1#2#3#4
+ { \__int_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+\cs_new:Npn \__int_case:nw #1#2#3
+ {
+ \int_compare:nNnTF {#1} = {#2}
+ { \__int_case_end:nw {#3} }
+ { \__int_case:nw {#1} }
+ }
+\cs_new_eq:NN \__int_case_end:nw \__prg_case_end:nw
+\prg_new_conditional:Npnn \int_if_odd:n #1 { p , T , F , TF}
+ {
+ \if_int_odd:w \__int_eval:w #1 \__int_eval_end:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\prg_new_conditional:Npnn \int_if_even:n #1 { p , T , F , TF}
+ {
+ \if_int_odd:w \__int_eval:w #1 \__int_eval_end:
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\cs_new:Npn \int_while_do:nn #1#2
+ {
+ \int_compare:nT {#1}
+ {
+ #2
+ \int_while_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \int_until_do:nn #1#2
+ {
+ \int_compare:nF {#1}
+ {
+ #2
+ \int_until_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \int_do_while:nn #1#2
+ {
+ #2
+ \int_compare:nT {#1}
+ { \int_do_while:nn {#1} {#2} }
+ }
+\cs_new:Npn \int_do_until:nn #1#2
+ {
+ #2
+ \int_compare:nF {#1}
+ { \int_do_until:nn {#1} {#2} }
+ }
+\cs_new:Npn \int_while_do:nNnn #1#2#3#4
+ {
+ \int_compare:nNnT {#1} #2 {#3}
+ {
+ #4
+ \int_while_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_new:Npn \int_until_do:nNnn #1#2#3#4
+ {
+ \int_compare:nNnF {#1} #2 {#3}
+ {
+ #4
+ \int_until_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_new:Npn \int_do_while:nNnn #1#2#3#4
+ {
+ #4
+ \int_compare:nNnT {#1} #2 {#3}
+ { \int_do_while:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_new:Npn \int_do_until:nNnn #1#2#3#4
+ {
+ #4
+ \int_compare:nNnF {#1} #2 {#3}
+ { \int_do_until:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_new:Npn \int_step_function:nnnN #1#2#3#4
+ {
+ \int_compare:nNnTF {#2} > \c_zero
+ { \exp_args:NNf \__int_step:NnnnN > }
+ {
+ \int_compare:nNnTF {#2} = \c_zero
+ {
+ \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#4}
+ \use_none:nnnn
+ }
+ { \exp_args:NNf \__int_step:NnnnN < }
+ }
+ { \int_eval:n {#1} } {#2} {#3} #4
+ }
+\cs_new:Npn \__int_step:NnnnN #1#2#3#4#5
+ {
+ \int_compare:nNnF {#2} #1 {#4}
+ {
+ #5 {#2}
+ \exp_args:NNf \__int_step:NnnnN
+ #1 { \int_eval:n { #2 + #3 } } {#3} {#4} #5
+ }
+ }
+\cs_new_protected_nopar:Npn \int_step_inline:nnnn
+ {
+ \int_gincr:N \g__prg_map_int
+ \exp_args:NNc \__int_step:NNnnnn
+ \cs_gset_nopar:Npn
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ }
+\cs_new_protected:Npn \int_step_variable:nnnNn #1#2#3#4#5
+ {
+ \int_gincr:N \g__prg_map_int
+ \exp_args:NNc \__int_step:NNnnnn
+ \cs_gset_nopar:Npx
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ {#1}{#2}{#3}
+ {
+ \tl_set:Nn \exp_not:N #4 {##1}
+ \exp_not:n {#5}
+ }
+ }
+\cs_new_protected:Npn \__int_step:NNnnnn #1#2#3#4#5#6
+ {
+ #1 #2 ##1 {#6}
+ \int_step_function:nnnN {#3} {#4} {#5} #2
+ \__prg_break_point:Nn \scan_stop: { \int_gdecr:N \g__prg_map_int }
+ }
+\cs_new:Npn \int_to_arabic:n #1 { \int_eval:n {#1} }
+\cs_new:Npn \int_to_symbols:nnn #1#2#3
+ {
+ \int_compare:nNnTF {#1} > {#2}
+ {
+ \exp_args:NNo \exp_args:No \__int_to_symbols:nnnn
+ {
+ \int_case:nn
+ { 1 + \int_mod:nn { #1 - 1 } {#2} }
+ {#3}
+ }
+ {#1} {#2} {#3}
+ }
+ { \int_case:nn {#1} {#3} }
+ }
+\cs_new:Npn \__int_to_symbols:nnnn #1#2#3#4
+ {
+ \exp_args:Nf \int_to_symbols:nnn
+ { \int_div_truncate:nn { #2 - 1 } {#3} } {#3} {#4}
+ #1
+ }
+\cs_new:Npn \int_to_alph:n #1
+ {
+ \int_to_symbols:nnn {#1} { 26 }
+ {
+ { 1 } { a }
+ { 2 } { b }
+ { 3 } { c }
+ { 4 } { d }
+ { 5 } { e }
+ { 6 } { f }
+ { 7 } { g }
+ { 8 } { h }
+ { 9 } { i }
+ { 10 } { j }
+ { 11 } { k }
+ { 12 } { l }
+ { 13 } { m }
+ { 14 } { n }
+ { 15 } { o }
+ { 16 } { p }
+ { 17 } { q }
+ { 18 } { r }
+ { 19 } { s }
+ { 20 } { t }
+ { 21 } { u }
+ { 22 } { v }
+ { 23 } { w }
+ { 24 } { x }
+ { 25 } { y }
+ { 26 } { z }
+ }
+ }
+\cs_new:Npn \int_to_Alph:n #1
+ {
+ \int_to_symbols:nnn {#1} { 26 }
+ {
+ { 1 } { A }
+ { 2 } { B }
+ { 3 } { C }
+ { 4 } { D }
+ { 5 } { E }
+ { 6 } { F }
+ { 7 } { G }
+ { 8 } { H }
+ { 9 } { I }
+ { 10 } { J }
+ { 11 } { K }
+ { 12 } { L }
+ { 13 } { M }
+ { 14 } { N }
+ { 15 } { O }
+ { 16 } { P }
+ { 17 } { Q }
+ { 18 } { R }
+ { 19 } { S }
+ { 20 } { T }
+ { 21 } { U }
+ { 22 } { V }
+ { 23 } { W }
+ { 24 } { X }
+ { 25 } { Y }
+ { 26 } { Z }
+ }
+ }
+\cs_new:Npn \int_to_base:nn #1
+ { \exp_args:Nf \__int_to_base:nn { \int_eval:n {#1} } }
+\cs_new:Npn \int_to_Base:nn #1
+ { \exp_args:Nf \__int_to_Base:nn { \int_eval:n {#1} } }
+\cs_new:Npn \__int_to_base:nn #1#2
+ {
+ \int_compare:nNnTF {#1} < \c_zero
+ { \exp_args:No \__int_to_base:nnN { \use_none:n #1 } {#2} - }
+ { \__int_to_base:nnN {#1} {#2} \c_empty_tl }
+ }
+\cs_new:Npn \__int_to_Base:nn #1#2
+ {
+ \int_compare:nNnTF {#1} < \c_zero
+ { \exp_args:No \__int_to_Base:nnN { \use_none:n #1 } {#2} - }
+ { \__int_to_Base:nnN {#1} {#2} \c_empty_tl }
+ }
+\cs_new:Npn \__int_to_base:nnN #1#2#3
+ {
+ \int_compare:nNnTF {#1} < {#2}
+ { \exp_last_unbraced:Nf #3 { \__int_to_letter:n {#1} } }
+ {
+ \exp_args:Nf \__int_to_base:nnnN
+ { \__int_to_letter:n { \int_mod:nn {#1} {#2} } }
+ {#1}
+ {#2}
+ #3
+ }
+ }
+\cs_new:Npn \__int_to_base:nnnN #1#2#3#4
+ {
+ \exp_args:Nf \__int_to_base:nnN
+ { \int_div_truncate:nn {#2} {#3} }
+ {#3}
+ #4
+ #1
+ }
+\cs_new:Npn \__int_to_Base:nnN #1#2#3
+ {
+ \int_compare:nNnTF {#1} < {#2}
+ { \exp_last_unbraced:Nf #3 { \__int_to_Letter:n {#1} } }
+ {
+ \exp_args:Nf \__int_to_Base:nnnN
+ { \__int_to_Letter:n { \int_mod:nn {#1} {#2} } }
+ {#1}
+ {#2}
+ #3
+ }
+ }
+\cs_new:Npn \__int_to_Base:nnnN #1#2#3#4
+ {
+ \exp_args:Nf \__int_to_Base:nnN
+ { \int_div_truncate:nn {#2} {#3} }
+ {#3}
+ #4
+ #1
+ }
+\cs_new:Npn \__int_to_letter:n #1
+ {
+ \exp_after:wN \exp_after:wN
+ \if_case:w \__int_eval:w #1 - \c_ten \__int_eval_end:
+ a
+ \or: b
+ \or: c
+ \or: d
+ \or: e
+ \or: f
+ \or: g
+ \or: h
+ \or: i
+ \or: j
+ \or: k
+ \or: l
+ \or: m
+ \or: n
+ \or: o
+ \or: p
+ \or: q
+ \or: r
+ \or: s
+ \or: t
+ \or: u
+ \or: v
+ \or: w
+ \or: x
+ \or: y
+ \or: z
+ \else: \__int_value:w \__int_eval:w #1 \exp_after:wN \__int_eval_end:
+ \fi:
+ }
+\cs_new:Npn \__int_to_Letter:n #1
+ {
+ \exp_after:wN \exp_after:wN
+ \if_case:w \__int_eval:w #1 - \c_ten \__int_eval_end:
+ A
+ \or: B
+ \or: C
+ \or: D
+ \or: E
+ \or: F
+ \or: G
+ \or: H
+ \or: I
+ \or: J
+ \or: K
+ \or: L
+ \or: M
+ \or: N
+ \or: O
+ \or: P
+ \or: Q
+ \or: R
+ \or: S
+ \or: T
+ \or: U
+ \or: V
+ \or: W
+ \or: X
+ \or: Y
+ \or: Z
+ \else: \__int_value:w \__int_eval:w #1 \exp_after:wN \__int_eval_end:
+ \fi:
+ }
+\cs_new:Npn \int_to_bin:n #1
+ { \int_to_base:nn {#1} { 2 } }
+\cs_new:Npn \int_to_hex:n #1
+ { \int_to_base:nn {#1} { 16 } }
+\cs_new:Npn \int_to_Hex:n #1
+ { \int_to_Base:nn {#1} { 16 } }
+\cs_new:Npn \int_to_oct:n #1
+ { \int_to_base:nn {#1} { 8 } }
+\cs_new:Npn \int_to_roman:n #1
+ {
+ \exp_after:wN \__int_to_roman:N
+ \__int_to_roman:w \int_eval:n {#1} Q
+ }
+\cs_new:Npn \__int_to_roman:N #1
+ {
+ \use:c { __int_to_roman_ #1 :w }
+ \__int_to_roman:N
+ }
+\cs_new:Npn \int_to_Roman:n #1
+ {
+ \exp_after:wN \__int_to_Roman_aux:N
+ \__int_to_roman:w \int_eval:n {#1} Q
+ }
+\cs_new:Npn \__int_to_Roman_aux:N #1
+ {
+ \use:c { __int_to_Roman_ #1 :w }
+ \__int_to_Roman_aux:N
+ }
+\cs_new_nopar:Npn \__int_to_roman_i:w { i }
+\cs_new_nopar:Npn \__int_to_roman_v:w { v }
+\cs_new_nopar:Npn \__int_to_roman_x:w { x }
+\cs_new_nopar:Npn \__int_to_roman_l:w { l }
+\cs_new_nopar:Npn \__int_to_roman_c:w { c }
+\cs_new_nopar:Npn \__int_to_roman_d:w { d }
+\cs_new_nopar:Npn \__int_to_roman_m:w { m }
+\cs_new_nopar:Npn \__int_to_roman_Q:w #1 { }
+\cs_new_nopar:Npn \__int_to_Roman_i:w { I }
+\cs_new_nopar:Npn \__int_to_Roman_v:w { V }
+\cs_new_nopar:Npn \__int_to_Roman_x:w { X }
+\cs_new_nopar:Npn \__int_to_Roman_l:w { L }
+\cs_new_nopar:Npn \__int_to_Roman_c:w { C }
+\cs_new_nopar:Npn \__int_to_Roman_d:w { D }
+\cs_new_nopar:Npn \__int_to_Roman_m:w { M }
+\cs_new:Npn \__int_to_Roman_Q:w #1 { }
+\cs_new:Npn \__int_get_sign:n #1
+ {
+ \__int_get_sign_and_digits:nNNN {#1}
+ \c_true_bool \c_true_bool \c_false_bool
+ }
+\cs_new:Npn \__int_get_digits:n #1
+ {
+ \__int_get_sign_and_digits:nNNN {#1}
+ \c_true_bool \c_false_bool \c_true_bool
+ }
+\cs_new:Npn \__int_get_sign_and_digits:nNNN #1#2#3#4
+ {
+ \exp_args:Nf \tl_if_head_eq_charcode:nNTF {#1} -
+ {
+ \bool_if:NTF #2
+ {
+ \__int_get_sign_and_digits:oNNN
+ { \use_none:n #1 } \c_false_bool #3#4
+ }
+ {
+ \__int_get_sign_and_digits:oNNN
+ { \use_none:n #1 } \c_true_bool #3#4
+ }
+ }
+ {
+ \exp_args:Nf \tl_if_head_eq_charcode:nNTF {#1} +
+ { \__int_get_sign_and_digits:oNNN { \use_none:n #1 } #2#3#4 }
+ {
+ \bool_if:NT #3 { \bool_if:NF #2 - }
+ \bool_if:NT #4 {#1}
+ }
+ }
+ }
+\cs_generate_variant:Nn \__int_get_sign_and_digits:nNNN { o }
+\cs_new:Npn \int_from_alph:n #1
+ {
+ \int_eval:n
+ {
+ \__int_get_sign:n {#1}
+ \exp_args:Nf \__int_from_alph:n { \__int_get_digits:n {#1} }
+ }
+ }
+\cs_new:Npn \__int_from_alph:n #1
+ { \__int_from_alph:nN { 0 } #1 \q_nil }
+\cs_new:Npn \__int_from_alph:nN #1#2
+ {
+ \quark_if_nil:NTF #2
+ {#1}
+ {
+ \exp_args:Nf \__int_from_alph:nN
+ { \int_eval:n { #1 * 26 + \__int_from_alph:N #2 } }
+ }
+ }
+\cs_new:Npn \__int_from_alph:N #1
+ { \int_eval:n { `#1 - \int_compare:nNnTF { `#1 } < { 91 } { 64 } { 96 } } }
+\cs_new:Npn \int_from_base:nn #1#2
+ {
+ \int_eval:n
+ {
+ \__int_get_sign:n {#1}
+ \exp_args:Nf \__int_from_base:nn
+ { \__int_get_digits:n {#1} } {#2}
+ }
+ }
+\cs_new:Npn \__int_from_base:nn #1#2
+ { \__int_from_base:nnN { 0 } { #2 } #1 \q_nil }
+\cs_new:Npn \__int_from_base:nnN #1#2#3
+ {
+ \quark_if_nil:NTF #3
+ {#1}
+ {
+ \exp_args:Nf \__int_from_base:nnN
+ { \int_eval:n { #1 * #2 + \__int_from_base:N #3 } }
+ {#2}
+ }
+ }
+\cs_new:Npn \__int_from_base:N #1
+ {
+ \int_compare:nNnTF { `#1 } < { 58 }
+ {#1}
+ {
+ \int_eval:n
+ { `#1 - \int_compare:nNnTF { `#1 } < { 91 } { 55 } { 87 } }
+ }
+ }
+\cs_new:Npn \int_from_bin:n #1
+ { \int_from_base:nn {#1} \c_two }
+\cs_new:Npn \int_from_hex:n #1
+ { \int_from_base:nn {#1} \c_sixteen }
+\cs_new:Npn \int_from_oct:n #1
+ { \int_from_base:nn {#1} \c_eight }
+\int_const:cn { c__int_from_roman_i_int } { 1 }
+\int_const:cn { c__int_from_roman_v_int } { 5 }
+\int_const:cn { c__int_from_roman_x_int } { 10 }
+\int_const:cn { c__int_from_roman_l_int } { 50 }
+\int_const:cn { c__int_from_roman_c_int } { 100 }
+\int_const:cn { c__int_from_roman_d_int } { 500 }
+\int_const:cn { c__int_from_roman_m_int } { 1000 }
+\int_const:cn { c__int_from_roman_I_int } { 1 }
+\int_const:cn { c__int_from_roman_V_int } { 5 }
+\int_const:cn { c__int_from_roman_X_int } { 10 }
+\int_const:cn { c__int_from_roman_L_int } { 50 }
+\int_const:cn { c__int_from_roman_C_int } { 100 }
+\int_const:cn { c__int_from_roman_D_int } { 500 }
+\int_const:cn { c__int_from_roman_M_int } { 1000 }
+\cs_new:Npn \int_from_roman:n #1
+ {
+ \tl_if_blank:nF {#1}
+ {
+ \exp_after:wN \__int_from_roman_end:w
+ \__int_value:w \__int_eval:w
+ \__int_from_roman:NN #1 Q \q_stop
+ }
+ }
+\cs_new:Npn \__int_from_roman:NN #1#2
+ {
+ \str_if_eq:nnTF {#1} { Q }
+ {#1#2}
+ {
+ \str_if_eq:nnTF {#2} { Q }
+ {
+ \int_if_exist:cF { c__int_from_roman_ #1 _int }
+ { \__int_from_roman_clean_up:w }
+ +
+ \use:c { c__int_from_roman_ #1 _int }
+ #2
+ }
+ {
+ \int_if_exist:cF { c__int_from_roman_ #1 _int }
+ { \__int_from_roman_clean_up:w }
+ \int_if_exist:cF { c__int_from_roman_ #2 _int }
+ { \__int_from_roman_clean_up:w }
+ \int_compare:nNnTF
+ { \use:c { c__int_from_roman_ #1 _int } }
+ <
+ { \use:c { c__int_from_roman_ #2 _int } }
+ {
+ + \use:c { c__int_from_roman_ #2 _int }
+ - \use:c { c__int_from_roman_ #1 _int }
+ \__int_from_roman:NN
+ }
+ {
+ + \use:c { c__int_from_roman_ #1 _int }
+ \__int_from_roman:NN #2
+ }
+ }
+ }
+ }
+\cs_new:Npn \__int_from_roman_end:w #1 Q #2 \q_stop
+ { \tl_if_empty:nTF {#2} {#1} {#2} }
+\cs_new:Npn \__int_from_roman_clean_up:w #1 Q { + 0 Q -1 }
+\cs_new_eq:NN \int_show:N \__kernel_register_show:N
+\cs_new_eq:NN \int_show:c \__kernel_register_show:c
+\cs_new_protected:Npn \int_show:n #1
+ { \etex_showtokens:D \exp_after:wN { \int_use:N \__int_eval:w #1 } }
+\int_const:Nn \c_one { 1 }
+\int_const:Nn \c_two { 2 }
+\int_const:Nn \c_three { 3 }
+\int_const:Nn \c_four { 4 }
+\int_const:Nn \c_five { 5 }
+\int_const:Nn \c_eight { 8 }
+\int_const:Nn \c_nine { 9 }
+\int_const:Nn \c_ten { 10 }
+\int_const:Nn \c_eleven { 11 }
+\int_const:Nn \c_thirteen { 13 }
+\int_const:Nn \c_fourteen { 14 }
+\int_const:Nn \c_fifteen { 15 }
+\int_const:Nn \c_thirty_two { 32 }
+\int_const:Nn \c_two_hundred_fifty_five { 255 }
+\int_const:Nn \c_two_hundred_fifty_six { 256 }
+\int_const:Nn \c_one_hundred { 100 }
+\int_const:Nn \c_one_thousand { 1000 }
+\int_const:Nn \c_ten_thousand { 10000 }
+\int_const:Nn \c_max_int { 2 147 483 647 }
+\int_new:N \l_tmpa_int
+\int_new:N \l_tmpb_int
+\int_new:N \g_tmpa_int
+\int_new:N \g_tmpb_int
+\cs_new_eq:NN \int_case:nnn \int_case:nnF
+\cs_new_eq:NN \int_to_binary:n \int_to_bin:n
+\cs_new_eq:NN \int_to_hexadecimal:n \int_to_Hex:n
+\cs_new_eq:NN \int_to_octal:n \int_to_oct:n
+\cs_new_eq:NN \int_from_binary:n \int_from_bin:n
+\cs_new_eq:NN \int_from_hexadecimal:n \int_from_hex:n
+\cs_new_eq:NN \int_from_octal:n \int_from_oct:n
+%% File: l3quark.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3quark.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Quarks}
+\cs_new_protected:Npn \quark_new:N #1 { \tl_const:Nn #1 {#1} }
+\quark_new:N \q_nil
+\quark_new:N \q_mark
+\quark_new:N \q_no_value
+\quark_new:N \q_stop
+\quark_new:N \q_recursion_tail
+\quark_new:N \q_recursion_stop
+\cs_new:Npn \quark_if_recursion_tail_stop:N #1
+ {
+ \if_meaning:w \q_recursion_tail #1
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ }
+\cs_new:Npn \quark_if_recursion_tail_stop_do:Nn #1
+ {
+ \if_meaning:w \q_recursion_tail #1
+ \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw
+ \else:
+ \exp_after:wN \use_none:n
+ \fi:
+ }
+\cs_new:Npn \quark_if_recursion_tail_stop:n #1
+ {
+ \if_int_compare:w \pdftex_strcmp:D
+ { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
+ \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \fi:
+ }
+\cs_new:Npn \quark_if_recursion_tail_stop_do:nn #1
+ {
+ \if_int_compare:w \pdftex_strcmp:D
+ { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
+ \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw
+ \else:
+ \exp_after:wN \use_none:n
+ \fi:
+ }
+\cs_generate_variant:Nn \quark_if_recursion_tail_stop:n { o }
+\cs_generate_variant:Nn \quark_if_recursion_tail_stop_do:nn { o }
+\cs_new:Npn \__quark_if_recursion_tail_break:NN #1#2
+ {
+ \if_meaning:w \q_recursion_tail #1
+ \exp_after:wN #2
+ \fi:
+ }
+\cs_new:Npn \__quark_if_recursion_tail_break:nN #1#2
+ {
+ \if_int_compare:w \pdftex_strcmp:D
+ { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
+ \exp_after:wN #2
+ \fi:
+ }
+\prg_new_conditional:Nnn \quark_if_nil:N { p, T , F , TF }
+ {
+ \if_meaning:w \q_nil #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\prg_new_conditional:Nnn \quark_if_no_value:N { p, T , F , TF }
+ {
+ \if_meaning:w \q_no_value #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \quark_if_no_value_p:N { c }
+\cs_generate_variant:Nn \quark_if_no_value:NT { c }
+\cs_generate_variant:Nn \quark_if_no_value:NF { c }
+\cs_generate_variant:Nn \quark_if_no_value:NTF { c }
+\prg_new_conditional:Nnn \quark_if_nil:n { p, T , F , TF }
+ {
+ \if_int_compare:w \pdftex_strcmp:D
+ { \exp_not:N \q_nil } { \exp_not:n {#1} } = \c_zero
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\prg_new_conditional:Nnn \quark_if_no_value:n { p, T , F , TF }
+ {
+ \if_int_compare:w \pdftex_strcmp:D
+ { \exp_not:N \q_no_value } { \exp_not:n {#1} } = \c_zero
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \quark_if_nil_p:n { V , o }
+\cs_generate_variant:Nn \quark_if_nil:nTF { V , o }
+\cs_generate_variant:Nn \quark_if_nil:nT { V , o }
+\cs_generate_variant:Nn \quark_if_nil:nF { V , o }
+\quark_new:N \q__tl_act_mark
+\quark_new:N \q__tl_act_stop
+\tl_new:N \g__scan_marks_tl
+\cs_new_protected:Npn \__scan_new:N #1
+ {
+ \tl_if_in:NnTF \g__scan_marks_tl { #1 }
+ {
+ \__msg_kernel_error:nnx { kernel } { scanmark-already-defined }
+ { \token_to_str:N #1 }
+ }
+ {
+ \tl_gput_right:Nn \g__scan_marks_tl {#1}
+ \cs_new_eq:NN #1 \scan_stop:
+ }
+ }
+\__scan_new:N \s__stop
+\cs_new:Npn \__use_none_delimit_by_s__stop:w #1 \s__stop { }
+\__scan_new:N \s__seq
+\cs_new:Npn \quark_if_recursion_tail_break:N #1
+ { \__quark_if_recursion_tail_break:NN #1 \prg_break: }
+\cs_new:Npn \quark_if_recursion_tail_break:n #1
+ { \__quark_if_recursion_tail_break:nN {#1} \prg_break: }
+%% File: l3prg.dtx Copyright (C) 2005-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3prg.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Control structures}
+%%
+\tex_let:D \if_bool:N \tex_ifodd:D
+\tex_let:D \if_predicate:w \tex_ifodd:D
+\cs_new_protected:Npn \bool_new:N #1 { \cs_new_eq:NN #1 \c_false_bool }
+\cs_generate_variant:Nn \bool_new:N { c }
+\cs_new_protected:Npn \bool_set_true:N #1
+ { \cs_set_eq:NN #1 \c_true_bool }
+\cs_new_protected:Npn \bool_set_false:N #1
+ { \cs_set_eq:NN #1 \c_false_bool }
+\cs_new_protected:Npn \bool_gset_true:N #1
+ { \cs_gset_eq:NN #1 \c_true_bool }
+\cs_new_protected:Npn \bool_gset_false:N #1
+ { \cs_gset_eq:NN #1 \c_false_bool }
+\cs_generate_variant:Nn \bool_set_true:N { c }
+\cs_generate_variant:Nn \bool_set_false:N { c }
+\cs_generate_variant:Nn \bool_gset_true:N { c }
+\cs_generate_variant:Nn \bool_gset_false:N { c }
+\cs_new_eq:NN \bool_set_eq:NN \cs_set_eq:NN
+\cs_new_eq:NN \bool_set_eq:Nc \cs_set_eq:Nc
+\cs_new_eq:NN \bool_set_eq:cN \cs_set_eq:cN
+\cs_new_eq:NN \bool_set_eq:cc \cs_set_eq:cc
+\cs_new_eq:NN \bool_gset_eq:NN \cs_gset_eq:NN
+\cs_new_eq:NN \bool_gset_eq:Nc \cs_gset_eq:Nc
+\cs_new_eq:NN \bool_gset_eq:cN \cs_gset_eq:cN
+\cs_new_eq:NN \bool_gset_eq:cc \cs_gset_eq:cc
+\cs_new_protected:Npn \bool_set:Nn #1#2
+ { \tex_chardef:D #1 = \bool_if_p:n {#2} }
+\cs_new_protected:Npn \bool_gset:Nn #1#2
+ { \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} }
+\cs_generate_variant:Nn \bool_set:Nn { c }
+\cs_generate_variant:Nn \bool_gset:Nn { c }
+\tex_ifodd:D \l@expl@check@declarations@bool
+ \cs_set_protected:Npn \bool_set_true:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1 \c_true_bool
+ }
+ \cs_set_protected:Npn \bool_set_false:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1 \c_false_bool
+ }
+ \cs_set_protected:Npn \bool_gset_true:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1 \c_true_bool
+ }
+ \cs_set_protected:Npn \bool_gset_false:N #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1 \c_false_bool
+ }
+ \cs_set_protected:Npn \bool_set_eq:NN #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_set_eq:NN #1
+ }
+ \cs_set_protected:Npn \bool_gset_eq:NN #1
+ {
+ \__chk_if_exist_var:N #1
+ \cs_gset_eq:NN #1
+ }
+ \cs_set_protected:Npn \bool_set:Nn #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \tex_chardef:D #1 = \bool_if_p:n {#2}
+ }
+ \cs_set_protected:Npn \bool_gset:Nn #1#2
+ {
+ \__chk_if_exist_var:N #1
+ \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2}
+ }
+\tex_fi:D
+\prg_new_conditional:Npnn \bool_if:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \c_true_bool #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_generate_variant:Nn \bool_if_p:N { c }
+\cs_generate_variant:Nn \bool_if:NT { c }
+\cs_generate_variant:Nn \bool_if:NF { c }
+\cs_generate_variant:Nn \bool_if:NTF { c }
+\cs_new_protected:Npn \bool_show:N #1
+ {
+ \bool_if_exist:NTF #1
+ { \bool_show:n {#1} }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_new_protected:Npn \bool_show:n #1
+ {
+ \bool_if:nTF {#1}
+ { \__msg_show_variable:n { > ~ true } }
+ { \__msg_show_variable:n { > ~ false } }
+ }
+\cs_generate_variant:Nn \bool_show:N { c }
+\bool_new:N \l_tmpa_bool
+\bool_new:N \l_tmpb_bool
+\bool_new:N \g_tmpa_bool
+\bool_new:N \g_tmpb_bool
+\prg_new_eq_conditional:NNn \bool_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \bool_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\prg_new_conditional:Npnn \bool_if:n #1 { T , F , TF }
+ {
+ \if_predicate:w \bool_if_p:n {#1}
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \bool_if_p:n #1
+ {
+ \group_align_safe_begin:
+ \__bool_if_left_parentheses:wwwn \q_nil
+ #1 \q_mark { }
+ ( \q_mark { \__bool_if_right_parentheses:wwwn \q_nil }
+ ) \q_mark { \__bool_if_or:wwwn \q_nil }
+ || \q_mark \__bool_if_parse:NNNww
+ \q_stop
+ }
+\cs_new:Npn \__bool_if_left_parentheses:wwwn #1 \q_nil #2 ( #3 \q_mark #4
+ { #4 \__bool_if_left_parentheses:wwwn #1 #2 (( \q_nil #3 \q_mark {#4} }
+\cs_new:Npn \__bool_if_right_parentheses:wwwn #1 \q_nil #2 ) #3 \q_mark #4
+ { #4 \__bool_if_right_parentheses:wwwn #1 #2 )) \q_nil #3 \q_mark {#4} }
+\cs_new:Npn \__bool_if_or:wwwn #1 \q_nil #2 || #3 \q_mark #4
+ { #4 \__bool_if_or:wwwn #1 #2 )||( \q_nil #3 \q_mark {#4} }
+\cs_new:Npn \__bool_if_parse:NNNww #1#2#3#4 \q_mark #5 \q_stop
+ {
+ \__bool_get_next:NN \use_i:nn (( #4 )) S
+ }
+\cs_new:Npn \__bool_get_next:NN #1#2
+ {
+ \use:c
+ {
+ __bool_
+ \if_meaning:w !#2 ! \else: \if_meaning:w (#2 ( \else: p \fi: \fi:
+ :Nw
+ }
+ #1 #2
+ }
+\cs_new:cpn { __bool_!:Nw } #1#2
+ { \exp_after:wN \__bool_get_next:NN #1 \use_ii:nn \use_i:nn }
+\cs_new:cpn { __bool_(:Nw } #1#2
+ {
+ \exp_after:wN \__bool_choose:NNN \exp_after:wN #1
+ \__int_value:w \__bool_get_next:NN \use_i:nn
+ }
+\cs_new:cpn { __bool_p:Nw } #1
+ { \exp_after:wN \__bool_choose:NNN \exp_after:wN #1 \__int_value:w }
+\cs_new:Npn \__bool_choose:NNN #1#2#3
+ {
+ \use:c
+ {
+ __bool_ #3 _
+ #1 #2 { \if_meaning:w 0 #2 1 \else: 0 \fi: }
+ :w
+ }
+ }
+\cs_new_nopar:cpn { __bool_)_0:w } { \c_false_bool }
+\cs_new_nopar:cpn { __bool_)_1:w } { \c_true_bool }
+\cs_new_nopar:cpn { __bool_S_0:w } { \group_align_safe_end: \c_false_bool }
+\cs_new_nopar:cpn { __bool_S_1:w } { \group_align_safe_end: \c_true_bool }
+\cs_new_nopar:cpn { __bool_&_1:w } & { \__bool_get_next:NN \use_i:nn }
+\cs_new_nopar:cpn { __bool_|_0:w } | { \__bool_get_next:NN \use_i:nn }
+\cs_new_nopar:cpn { __bool_&_0:w } & { \__bool_eval_skip_to_end_auxi:Nw \c_false_bool }
+\cs_new_nopar:cpn { __bool_|_1:w } | { \__bool_eval_skip_to_end_auxi:Nw \c_true_bool }
+%% (
+\cs_new:Npn \__bool_eval_skip_to_end_auxi:Nw #1#2 )
+ {
+ \__bool_eval_skip_to_end_auxii:Nw #1#2 ( % )
+ \q_no_value \q_stop
+ {#2}
+ }
+\cs_new:Npn \__bool_eval_skip_to_end_auxii:Nw #1#2 ( #3#4 \q_stop #5 % )
+ {
+ \quark_if_no_value:NTF #3
+ {#1}
+ { \__bool_eval_skip_to_end_auxiii:Nw #1 #5 }
+ }
+\cs_new:Npn \__bool_eval_skip_to_end_auxiii:Nw #1#2 ( #3 )
+ { % (
+ \__bool_eval_skip_to_end_auxi:Nw #1#3 )
+ }
+\cs_new:Npn \bool_not_p:n #1 { \bool_if_p:n { ! ( #1 ) } }
+\cs_new:Npn \bool_xor_p:nn #1#2
+ {
+ \int_compare:nNnTF { \bool_if_p:n {#1} } = { \bool_if_p:n {#2} }
+ \c_false_bool
+ \c_true_bool
+ }
+\cs_new:Npn \bool_while_do:Nn #1#2
+ { \bool_if:NT #1 { #2 \bool_while_do:Nn #1 {#2} } }
+\cs_new:Npn \bool_until_do:Nn #1#2
+ { \bool_if:NF #1 { #2 \bool_until_do:Nn #1 {#2} } }
+\cs_generate_variant:Nn \bool_while_do:Nn { c }
+\cs_generate_variant:Nn \bool_until_do:Nn { c }
+\cs_new:Npn \bool_do_while:Nn #1#2
+ { #2 \bool_if:NT #1 { \bool_do_while:Nn #1 {#2} } }
+\cs_new:Npn \bool_do_until:Nn #1#2
+ { #2 \bool_if:NF #1 { \bool_do_until:Nn #1 {#2} } }
+\cs_generate_variant:Nn \bool_do_while:Nn { c }
+\cs_generate_variant:Nn \bool_do_until:Nn { c }
+\cs_new:Npn \bool_while_do:nn #1#2
+ {
+ \bool_if:nT {#1}
+ {
+ #2
+ \bool_while_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \bool_do_while:nn #1#2
+ {
+ #2
+ \bool_if:nT {#1} { \bool_do_while:nn {#1} {#2} }
+ }
+\cs_new:Npn \bool_until_do:nn #1#2
+ {
+ \bool_if:nF {#1}
+ {
+ #2
+ \bool_until_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \bool_do_until:nn #1#2
+ {
+ #2
+ \bool_if:nF {#1} { \bool_do_until:nn {#1} {#2} }
+ }
+\cs_new:Npn \prg_replicate:nn #1
+ {
+ \__int_to_roman:w
+ \exp_after:wN \__prg_replicate_first:N
+ \__int_value:w \__int_eval:w #1 \__int_eval_end:
+ \cs_end:
+ }
+\cs_new:Npn \__prg_replicate:N #1
+ { \cs:w __prg_replicate_#1 :n \__prg_replicate:N }
+\cs_new:Npn \__prg_replicate_first:N #1
+ { \cs:w __prg_replicate_first_ #1 :n \__prg_replicate:N }
+\cs_new:Npn \__prg_replicate_ :n #1 { \cs_end: }
+\cs_new:cpn { __prg_replicate_0:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} }
+\cs_new:cpn { __prg_replicate_1:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1 }
+\cs_new:cpn { __prg_replicate_2:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1 }
+\cs_new:cpn { __prg_replicate_3:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1 }
+\cs_new:cpn { __prg_replicate_4:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1 }
+\cs_new:cpn { __prg_replicate_5:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_6:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_7:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_8:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_9:n } #1
+ { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_-:n } #1
+ {
+ \c_zero
+ \__msg_kernel_expandable_error:nn { kernel } { negative-replication }
+ }
+\cs_new:cpn { __prg_replicate_first_0:n } #1 { \c_zero }
+\cs_new:cpn { __prg_replicate_first_1:n } #1 { \c_zero #1 }
+\cs_new:cpn { __prg_replicate_first_2:n } #1 { \c_zero #1#1 }
+\cs_new:cpn { __prg_replicate_first_3:n } #1 { \c_zero #1#1#1 }
+\cs_new:cpn { __prg_replicate_first_4:n } #1 { \c_zero #1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_5:n } #1 { \c_zero #1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_6:n } #1 { \c_zero #1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_7:n } #1 { \c_zero #1#1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_8:n } #1 { \c_zero #1#1#1#1#1#1#1#1 }
+\cs_new:cpn { __prg_replicate_first_9:n } #1 { \c_zero #1#1#1#1#1#1#1#1#1 }
+\prg_new_conditional:Npnn \mode_if_vertical: { p , T , F , TF }
+ { \if_mode_vertical: \prg_return_true: \else: \prg_return_false: \fi: }
+\prg_new_conditional:Npnn \mode_if_horizontal: { p , T , F , TF }
+ { \if_mode_horizontal: \prg_return_true: \else: \prg_return_false: \fi: }
+\prg_new_conditional:Npnn \mode_if_inner: { p , T , F , TF }
+ { \if_mode_inner: \prg_return_true: \else: \prg_return_false: \fi: }
+\prg_new_conditional:Npnn \mode_if_math: { p , T , F , TF }
+ { \if_mode_math: \prg_return_true: \else: \prg_return_false: \fi: }
+\cs_new_nopar:Npn \group_align_safe_begin:
+ { \if_int_compare:w \if_false: { \fi: `} = \c_zero \fi: }
+\cs_new_nopar:Npn \group_align_safe_end:
+ { \if_int_compare:w `{ = \c_zero } \fi: }
+\cs_new_protected_nopar:Npn \scan_align_safe_stop: { }
+\group_begin:
+ \tex_lccode:D `* = `g \scan_stop:
+ \tex_catcode:D `* = \c_twelve
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new:Npn \__prg_variable_get_scope:N #1
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__prg_variable_get_scope:w
+ \cs_to_str:N #1 \exp_stop_f: \q_stop
+ }
+ \cs_new:Npn \__prg_variable_get_scope:w #1#2 \q_stop
+ { \token_if_eq_meaning:NNT * #1 { g } }
+ }
+\group_begin:
+ \tex_lccode:D `* = `_ \scan_stop:
+ \tex_catcode:D `* = \c_twelve
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new:Npn \__prg_variable_get_type:N #1
+ {
+ \exp_after:wN \__prg_variable_get_type:w
+ \token_to_str:N #1 * a \q_stop
+ }
+ \cs_new:Npn \__prg_variable_get_type:w #1 * #2#3 \q_stop
+ {
+ \token_if_eq_meaning:NNTF a #2
+ {#1}
+ { \__prg_variable_get_type:w #2#3 \q_stop }
+ }
+ }
+\int_new:N \g__prg_map_int
+%% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach,
+%% The LaTeX3 project
+%% (C) 2012-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3clist.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Comma separated lists}
+\cs_new_eq:NN \c_empty_clist \c_empty_tl
+\tl_new:N \l__clist_internal_clist
+\cs_new_protected:Npn \__clist_tmp:w { }
+\cs_new_eq:NN \clist_new:N \tl_new:N
+\cs_new_eq:NN \clist_new:c \tl_new:c
+\cs_new_eq:NN \clist_clear:N \tl_clear:N
+\cs_new_eq:NN \clist_clear:c \tl_clear:c
+\cs_new_eq:NN \clist_gclear:N \tl_gclear:N
+\cs_new_eq:NN \clist_gclear:c \tl_gclear:c
+\cs_new_eq:NN \clist_clear_new:N \tl_clear_new:N
+\cs_new_eq:NN \clist_clear_new:c \tl_clear_new:c
+\cs_new_eq:NN \clist_gclear_new:N \tl_gclear_new:N
+\cs_new_eq:NN \clist_gclear_new:c \tl_gclear_new:c
+\cs_new_eq:NN \clist_set_eq:NN \tl_set_eq:NN
+\cs_new_eq:NN \clist_set_eq:Nc \tl_set_eq:Nc
+\cs_new_eq:NN \clist_set_eq:cN \tl_set_eq:cN
+\cs_new_eq:NN \clist_set_eq:cc \tl_set_eq:cc
+\cs_new_eq:NN \clist_gset_eq:NN \tl_gset_eq:NN
+\cs_new_eq:NN \clist_gset_eq:Nc \tl_gset_eq:Nc
+\cs_new_eq:NN \clist_gset_eq:cN \tl_gset_eq:cN
+\cs_new_eq:NN \clist_gset_eq:cc \tl_gset_eq:cc
+\cs_new_protected_nopar:Npn \clist_concat:NNN
+ { \__clist_concat:NNNN \tl_set:Nx }
+\cs_new_protected_nopar:Npn \clist_gconcat:NNN
+ { \__clist_concat:NNNN \tl_gset:Nx }
+\cs_new_protected:Npn \__clist_concat:NNNN #1#2#3#4
+ {
+ #1 #2
+ {
+ \exp_not:o #3
+ \clist_if_empty:NF #3 { \clist_if_empty:NF #4 { , } }
+ \exp_not:o #4
+ }
+ }
+\cs_generate_variant:Nn \clist_concat:NNN { ccc }
+\cs_generate_variant:Nn \clist_gconcat:NNN { ccc }
+\prg_new_eq_conditional:NNn \clist_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \clist_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new:Npn \__clist_trim_spaces_generic:nw #1#2 ,
+ {
+ \__tl_trim_spaces:nn {#2}
+ { \exp_args:No \__clist_trim_spaces_generic:nn } {#1}
+ }
+\cs_new:Npn \__clist_trim_spaces_generic:nn #1#2 { #2 {#1} }
+\cs_new:Npn \__clist_trim_spaces:n #1
+ {
+ \__clist_trim_spaces_generic:nw
+ { \__clist_trim_spaces:nn { } }
+ \q_mark #1 ,
+ \q_recursion_tail, \q_recursion_stop
+ }
+\cs_new:Npn \__clist_trim_spaces:nn #1 #2
+ {
+ \quark_if_recursion_tail_stop:n {#2}
+ \tl_if_empty:nTF {#2}
+ {
+ \__clist_trim_spaces_generic:nw
+ { \__clist_trim_spaces:nn {#1} } \q_mark
+ }
+ {
+ #1 \exp_not:n {#2}
+ \__clist_trim_spaces_generic:nw
+ { \__clist_trim_spaces:nn { , } } \q_mark
+ }
+ }
+\cs_new_protected:Npn \clist_set:Nn #1#2
+ { \tl_set:Nx #1 { \__clist_trim_spaces:n {#2} } }
+\cs_new_protected:Npn \clist_gset:Nn #1#2
+ { \tl_gset:Nx #1 { \__clist_trim_spaces:n {#2} } }
+\cs_generate_variant:Nn \clist_set:Nn { NV , No , Nx , c , cV , co , cx }
+\cs_generate_variant:Nn \clist_gset:Nn { NV , No , Nx , c , cV , co , cx }
+\cs_new_protected_nopar:Npn \clist_put_left:Nn
+ { \__clist_put_left:NNNn \clist_concat:NNN \clist_set:Nn }
+\cs_new_protected_nopar:Npn \clist_gput_left:Nn
+ { \__clist_put_left:NNNn \clist_gconcat:NNN \clist_set:Nn }
+\cs_new_protected:Npn \__clist_put_left:NNNn #1#2#3#4
+ {
+ #2 \l__clist_internal_clist {#4}
+ #1 #3 \l__clist_internal_clist #3
+ }
+\cs_generate_variant:Nn \clist_put_left:Nn { NV , No , Nx }
+\cs_generate_variant:Nn \clist_put_left:Nn { c , cV , co , cx }
+\cs_generate_variant:Nn \clist_gput_left:Nn { NV , No , Nx }
+\cs_generate_variant:Nn \clist_gput_left:Nn { c , cV , co , cx }
+\cs_new_protected_nopar:Npn \clist_put_right:Nn
+ { \__clist_put_right:NNNn \clist_concat:NNN \clist_set:Nn }
+\cs_new_protected_nopar:Npn \clist_gput_right:Nn
+ { \__clist_put_right:NNNn \clist_gconcat:NNN \clist_set:Nn }
+\cs_new_protected:Npn \__clist_put_right:NNNn #1#2#3#4
+ {
+ #2 \l__clist_internal_clist {#4}
+ #1 #3 #3 \l__clist_internal_clist
+ }
+\cs_generate_variant:Nn \clist_put_right:Nn { NV , No , Nx }
+\cs_generate_variant:Nn \clist_put_right:Nn { c , cV , co , cx }
+\cs_generate_variant:Nn \clist_gput_right:Nn { NV , No , Nx }
+\cs_generate_variant:Nn \clist_gput_right:Nn { c , cV , co , cx }
+\cs_new_protected:Npn \clist_get:NN #1#2
+ {
+ \if_meaning:w #1 \c_empty_clist
+ \tl_set:Nn #2 { \q_no_value }
+ \else:
+ \exp_after:wN \__clist_get:wN #1 , \q_stop #2
+ \fi:
+ }
+\cs_new_protected:Npn \__clist_get:wN #1 , #2 \q_stop #3
+ { \tl_set:Nn #3 {#1} }
+\cs_generate_variant:Nn \clist_get:NN { c }
+\cs_new_protected_nopar:Npn \clist_pop:NN
+ { \__clist_pop:NNN \tl_set:Nx }
+\cs_new_protected_nopar:Npn \clist_gpop:NN
+ { \__clist_pop:NNN \tl_gset:Nx }
+\cs_new_protected:Npn \__clist_pop:NNN #1#2#3
+ {
+ \if_meaning:w #2 \c_empty_clist
+ \tl_set:Nn #3 { \q_no_value }
+ \else:
+ \exp_after:wN \__clist_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
+ \fi:
+ }
+\cs_new_protected:Npn \__clist_pop:wwNNN #1 , #2 \q_stop #3#4#5
+ {
+ \tl_set:Nn #5 {#1}
+ #3 #4
+ {
+ \__clist_pop:wN \prg_do_nothing:
+ #2 \exp_not:o
+ , \q_mark \use_none:n
+ \q_stop
+ }
+ }
+\cs_new:Npn \__clist_pop:wN #1 , \q_mark #2 #3 \q_stop { #2 {#1} }
+\cs_generate_variant:Nn \clist_pop:NN { c }
+\cs_generate_variant:Nn \clist_gpop:NN { c }
+\prg_new_protected_conditional:Npnn \clist_get:NN #1#2 { T , F , TF }
+ {
+ \if_meaning:w #1 \c_empty_clist
+ \prg_return_false:
+ \else:
+ \exp_after:wN \__clist_get:wN #1 , \q_stop #2
+ \prg_return_true:
+ \fi:
+ }
+\cs_generate_variant:Nn \clist_get:NNT { c }
+\cs_generate_variant:Nn \clist_get:NNF { c }
+\cs_generate_variant:Nn \clist_get:NNTF { c }
+\prg_new_protected_conditional:Npnn \clist_pop:NN #1#2 { T , F , TF }
+ { \__clist_pop_TF:NNN \tl_set:Nx #1 #2 }
+\prg_new_protected_conditional:Npnn \clist_gpop:NN #1#2 { T , F , TF }
+ { \__clist_pop_TF:NNN \tl_gset:Nx #1 #2 }
+\cs_new_protected:Npn \__clist_pop_TF:NNN #1#2#3
+ {
+ \if_meaning:w #2 \c_empty_clist
+ \prg_return_false:
+ \else:
+ \exp_after:wN \__clist_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
+ \prg_return_true:
+ \fi:
+ }
+\cs_generate_variant:Nn \clist_pop:NNT { c }
+\cs_generate_variant:Nn \clist_pop:NNF { c }
+\cs_generate_variant:Nn \clist_pop:NNTF { c }
+\cs_generate_variant:Nn \clist_gpop:NNT { c }
+\cs_generate_variant:Nn \clist_gpop:NNF { c }
+\cs_generate_variant:Nn \clist_gpop:NNTF { c }
+\cs_new_eq:NN \clist_push:Nn \clist_put_left:Nn
+\cs_new_eq:NN \clist_push:NV \clist_put_left:NV
+\cs_new_eq:NN \clist_push:No \clist_put_left:No
+\cs_new_eq:NN \clist_push:Nx \clist_put_left:Nx
+\cs_new_eq:NN \clist_push:cn \clist_put_left:cn
+\cs_new_eq:NN \clist_push:cV \clist_put_left:cV
+\cs_new_eq:NN \clist_push:co \clist_put_left:co
+\cs_new_eq:NN \clist_push:cx \clist_put_left:cx
+\cs_new_eq:NN \clist_gpush:Nn \clist_gput_left:Nn
+\cs_new_eq:NN \clist_gpush:NV \clist_gput_left:NV
+\cs_new_eq:NN \clist_gpush:No \clist_gput_left:No
+\cs_new_eq:NN \clist_gpush:Nx \clist_gput_left:Nx
+\cs_new_eq:NN \clist_gpush:cn \clist_gput_left:cn
+\cs_new_eq:NN \clist_gpush:cV \clist_gput_left:cV
+\cs_new_eq:NN \clist_gpush:co \clist_gput_left:co
+\cs_new_eq:NN \clist_gpush:cx \clist_gput_left:cx
+\clist_new:N \l__clist_internal_remove_clist
+\cs_new_protected:Npn \clist_remove_duplicates:N
+ { \__clist_remove_duplicates:NN \clist_set_eq:NN }
+\cs_new_protected:Npn \clist_gremove_duplicates:N
+ { \__clist_remove_duplicates:NN \clist_gset_eq:NN }
+\cs_new_protected:Npn \__clist_remove_duplicates:NN #1#2
+ {
+ \clist_clear:N \l__clist_internal_remove_clist
+ \clist_map_inline:Nn #2
+ {
+ \clist_if_in:NnF \l__clist_internal_remove_clist {##1}
+ { \clist_put_right:Nn \l__clist_internal_remove_clist {##1} }
+ }
+ #1 #2 \l__clist_internal_remove_clist
+ }
+\cs_generate_variant:Nn \clist_remove_duplicates:N { c }
+\cs_generate_variant:Nn \clist_gremove_duplicates:N { c }
+\cs_new_protected:Npn \clist_remove_all:Nn
+ { \__clist_remove_all:NNn \tl_set:Nx }
+\cs_new_protected:Npn \clist_gremove_all:Nn
+ { \__clist_remove_all:NNn \tl_gset:Nx }
+\cs_new_protected:Npn \__clist_remove_all:NNn #1#2#3
+ {
+ \cs_set:Npn \__clist_tmp:w ##1 , #3 ,
+ {
+ ##1
+ , \q_mark , \use_none_delimit_by_q_stop:w ,
+ \__clist_remove_all:
+ }
+ #1 #2
+ {
+ \exp_after:wN \__clist_remove_all:
+ #2 , \q_mark , #3 , \q_stop
+ }
+ \clist_if_empty:NF #2
+ {
+ #1 #2
+ {
+ \exp_args:No \exp_not:o
+ { \exp_after:wN \use_none:n #2 }
+ }
+ }
+ }
+\cs_new:Npn \__clist_remove_all:
+ { \exp_after:wN \__clist_remove_all:w \__clist_tmp:w , }
+\cs_new:Npn \__clist_remove_all:w #1 , \q_mark , #2 , { \exp_not:n {#1} }
+\cs_generate_variant:Nn \clist_remove_all:Nn { c }
+\cs_generate_variant:Nn \clist_gremove_all:Nn { c }
+\prg_new_eq_conditional:NNn \clist_if_empty:N \tl_if_empty:N { p , T , F , TF }
+\prg_new_eq_conditional:NNn \clist_if_empty:c \tl_if_empty:c { p , T , F , TF }
+\prg_new_protected_conditional:Npnn \clist_if_in:Nn #1#2 { T , F , TF }
+ {
+ \exp_args:No \__clist_if_in_return:nn #1 {#2}
+ }
+\prg_new_protected_conditional:Npnn \clist_if_in:nn #1#2 { T , F , TF }
+ {
+ \clist_set:Nn \l__clist_internal_clist {#1}
+ \exp_args:No \__clist_if_in_return:nn \l__clist_internal_clist {#2}
+ }
+\cs_new_protected:Npn \__clist_if_in_return:nn #1#2
+ {
+ \cs_set:Npn \__clist_tmp:w ##1 ,#2, { }
+ \tl_if_empty:oTF
+ { \__clist_tmp:w ,#1, {} {} ,#2, }
+ { \prg_return_false: } { \prg_return_true: }
+ }
+\cs_generate_variant:Nn \clist_if_in:NnT { NV , No }
+\cs_generate_variant:Nn \clist_if_in:NnT { c , cV , co }
+\cs_generate_variant:Nn \clist_if_in:NnF { NV , No }
+\cs_generate_variant:Nn \clist_if_in:NnF { c , cV , co }
+\cs_generate_variant:Nn \clist_if_in:NnTF { NV , No }
+\cs_generate_variant:Nn \clist_if_in:NnTF { c , cV , co }
+\cs_generate_variant:Nn \clist_if_in:nnT { nV , no }
+\cs_generate_variant:Nn \clist_if_in:nnF { nV , no }
+\cs_generate_variant:Nn \clist_if_in:nnTF { nV , no }
+\cs_new:Npn \clist_map_function:NN #1#2
+ {
+ \clist_if_empty:NF #1
+ {
+ \exp_last_unbraced:NNo \__clist_map_function:Nw #2 #1
+ , \q_recursion_tail ,
+ \__prg_break_point:Nn \clist_map_break: { }
+ }
+ }
+\cs_new:Npn \__clist_map_function:Nw #1#2 ,
+ {
+ \__quark_if_recursion_tail_break:nN {#2} \clist_map_break:
+ #1 {#2}
+ \__clist_map_function:Nw #1
+ }
+\cs_generate_variant:Nn \clist_map_function:NN { c }
+\cs_new:Npn \clist_map_function:nN #1#2
+ {
+ \__clist_trim_spaces_generic:nw { \__clist_map_function_n:Nn #2 }
+ \q_mark #1, \q_recursion_tail,
+ \__prg_break_point:Nn \clist_map_break: { }
+ }
+\cs_new:Npn \__clist_map_function_n:Nn #1 #2
+ {
+ \__quark_if_recursion_tail_break:nN {#2} \clist_map_break:
+ \tl_if_empty:nF {#2} { \__clist_map_unbrace:Nw #1 #2, }
+ \__clist_trim_spaces_generic:nw { \__clist_map_function_n:Nn #1 }
+ \q_mark
+ }
+\cs_new:Npn \__clist_map_unbrace:Nw #1 #2, { #1 {#2} }
+\cs_new_protected:Npn \clist_map_inline:Nn #1#2
+ {
+ \clist_if_empty:NF #1
+ {
+ \int_gincr:N \g__prg_map_int
+ \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+ \exp_last_unbraced:Nco \__clist_map_function:Nw
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ #1 , \q_recursion_tail ,
+ \__prg_break_point:Nn \clist_map_break:
+ { \int_gdecr:N \g__prg_map_int }
+ }
+ }
+\cs_new_protected:Npn \clist_map_inline:nn #1
+ {
+ \clist_set:Nn \l__clist_internal_clist {#1}
+ \clist_map_inline:Nn \l__clist_internal_clist
+ }
+\cs_generate_variant:Nn \clist_map_inline:Nn { c }
+\cs_new_protected:Npn \clist_map_variable:NNn #1#2#3
+ {
+ \clist_if_empty:NF #1
+ {
+ \exp_args:Nno \use:nn
+ { \__clist_map_variable:Nnw #2 {#3} }
+ #1
+ , \q_recursion_tail , \q_recursion_stop
+ \__prg_break_point:Nn \clist_map_break: { }
+ }
+ }
+\cs_new_protected:Npn \clist_map_variable:nNn #1
+ {
+ \clist_set:Nn \l__clist_internal_clist {#1}
+ \clist_map_variable:NNn \l__clist_internal_clist
+ }
+\cs_new_protected:Npn \__clist_map_variable:Nnw #1#2#3,
+ {
+ \tl_set:Nn #1 {#3}
+ \quark_if_recursion_tail_stop:N #1
+ \use:n {#2}
+ \__clist_map_variable:Nnw #1 {#2}
+ }
+\cs_generate_variant:Nn \clist_map_variable:NNn { c }
+\cs_new_nopar:Npn \clist_map_break:
+ { \__prg_map_break:Nn \clist_map_break: { } }
+\cs_new_nopar:Npn \clist_map_break:n
+ { \__prg_map_break:Nn \clist_map_break: }
+\cs_new:Npn \clist_count:N #1
+ {
+ \int_eval:n
+ {
+ 0
+ \clist_map_function:NN #1 \__clist_count:n
+ }
+ }
+\cs_generate_variant:Nn \clist_count:N { c }
+\cs_new:Npx \clist_count:n #1
+ {
+ \exp_not:N \int_eval:n
+ {
+ 0
+ \exp_not:N \__clist_count:w \c_space_tl
+ #1 \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ }
+ }
+\cs_new:Npn \__clist_count:n #1 { + \c_one }
+\cs_new:Npx \__clist_count:w #1 ,
+ {
+ \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1}
+ \exp_not:N \tl_if_blank:nF {#1} { + \c_one }
+ \exp_not:N \__clist_count:w \c_space_tl
+ }
+\cs_new:Npn \clist_use:Nnnn #1#2#3#4
+ {
+ \clist_if_exist:NTF #1
+ {
+ \int_case:nnF { \clist_count:N #1 }
+ {
+ { 0 } { }
+ { 1 } { \exp_after:wN \__clist_use:wwn #1 , , { } }
+ { 2 } { \exp_after:wN \__clist_use:wwn #1 , {#2} }
+ }
+ {
+ \exp_after:wN \__clist_use:nwwwwnwn
+ \exp_after:wN { \exp_after:wN } #1 ,
+ \q_mark , { \__clist_use:nwwwwnwn {#3} }
+ \q_mark , { \__clist_use:nwwn {#4} }
+ \q_stop { }
+ }
+ }
+ { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
+ }
+\cs_generate_variant:Nn \clist_use:Nnnn { c }
+\cs_new:Npn \__clist_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } }
+\cs_new:Npn \__clist_use:nwwwwnwn
+ #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8
+ { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } }
+\cs_new:Npn \__clist_use:nwwn #1#2 , #3 \q_stop #4
+ { \exp_not:n { #4 #1 #2 } }
+\cs_new:Npn \clist_use:Nn #1#2
+ { \clist_use:Nnnn #1 {#2} {#2} {#2} }
+\cs_generate_variant:Nn \clist_use:Nn { c }
+\cs_new_protected:Npn \clist_show:N #1
+ {
+ \__msg_show_variable:Nnn #1 { clist }
+ { \clist_map_function:NN #1 \__msg_show_item:n }
+ }
+\cs_new_protected:Npn \clist_show:n #1
+ {
+ \clist_set:Nn \l__clist_internal_clist {#1}
+ \clist_show:N \l__clist_internal_clist
+ }
+\cs_generate_variant:Nn \clist_show:N { c }
+\clist_new:N \l_tmpa_clist
+\clist_new:N \l_tmpb_clist
+\clist_new:N \g_tmpa_clist
+\clist_new:N \g_tmpb_clist
+%% File: l3token.dtx Copyright (C) 2005-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3token.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Experimental token manipulation}
+\cs_new_protected:Npn \char_set_catcode:nn #1#2
+ { \tex_catcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
+\cs_new:Npn \char_value_catcode:n #1
+ { \tex_the:D \tex_catcode:D \__int_eval:w #1\__int_eval_end: }
+\cs_new_protected:Npn \char_show_value_catcode:n #1
+ { \tex_showthe:D \tex_catcode:D \__int_eval:w #1 \__int_eval_end: }
+\cs_new_protected:Npn \char_set_catcode_escape:N #1
+ { \char_set_catcode:nn { `#1 } \c_zero }
+\cs_new_protected:Npn \char_set_catcode_group_begin:N #1
+ { \char_set_catcode:nn { `#1 } \c_one }
+\cs_new_protected:Npn \char_set_catcode_group_end:N #1
+ { \char_set_catcode:nn { `#1 } \c_two }
+\cs_new_protected:Npn \char_set_catcode_math_toggle:N #1
+ { \char_set_catcode:nn { `#1 } \c_three }
+\cs_new_protected:Npn \char_set_catcode_alignment:N #1
+ { \char_set_catcode:nn { `#1 } \c_four }
+\cs_new_protected:Npn \char_set_catcode_end_line:N #1
+ { \char_set_catcode:nn { `#1 } \c_five }
+\cs_new_protected:Npn \char_set_catcode_parameter:N #1
+ { \char_set_catcode:nn { `#1 } \c_six }
+\cs_new_protected:Npn \char_set_catcode_math_superscript:N #1
+ { \char_set_catcode:nn { `#1 } \c_seven }
+\cs_new_protected:Npn \char_set_catcode_math_subscript:N #1
+ { \char_set_catcode:nn { `#1 } \c_eight }
+\cs_new_protected:Npn \char_set_catcode_ignore:N #1
+ { \char_set_catcode:nn { `#1 } \c_nine }
+\cs_new_protected:Npn \char_set_catcode_space:N #1
+ { \char_set_catcode:nn { `#1 } \c_ten }
+\cs_new_protected:Npn \char_set_catcode_letter:N #1
+ { \char_set_catcode:nn { `#1 } \c_eleven }
+\cs_new_protected:Npn \char_set_catcode_other:N #1
+ { \char_set_catcode:nn { `#1 } \c_twelve }
+\cs_new_protected:Npn \char_set_catcode_active:N #1
+ { \char_set_catcode:nn { `#1 } \c_thirteen }
+\cs_new_protected:Npn \char_set_catcode_comment:N #1
+ { \char_set_catcode:nn { `#1 } \c_fourteen }
+\cs_new_protected:Npn \char_set_catcode_invalid:N #1
+ { \char_set_catcode:nn { `#1 } \c_fifteen }
+\cs_new_protected:Npn \char_set_catcode_escape:n #1
+ { \char_set_catcode:nn {#1} \c_zero }
+\cs_new_protected:Npn \char_set_catcode_group_begin:n #1
+ { \char_set_catcode:nn {#1} \c_one }
+\cs_new_protected:Npn \char_set_catcode_group_end:n #1
+ { \char_set_catcode:nn {#1} \c_two }
+\cs_new_protected:Npn \char_set_catcode_math_toggle:n #1
+ { \char_set_catcode:nn {#1} \c_three }
+\cs_new_protected:Npn \char_set_catcode_alignment:n #1
+ { \char_set_catcode:nn {#1} \c_four }
+\cs_new_protected:Npn \char_set_catcode_end_line:n #1
+ { \char_set_catcode:nn {#1} \c_five }
+\cs_new_protected:Npn \char_set_catcode_parameter:n #1
+ { \char_set_catcode:nn {#1} \c_six }
+\cs_new_protected:Npn \char_set_catcode_math_superscript:n #1
+ { \char_set_catcode:nn {#1} \c_seven }
+\cs_new_protected:Npn \char_set_catcode_math_subscript:n #1
+ { \char_set_catcode:nn {#1} \c_eight }
+\cs_new_protected:Npn \char_set_catcode_ignore:n #1
+ { \char_set_catcode:nn {#1} \c_nine }
+\cs_new_protected:Npn \char_set_catcode_space:n #1
+ { \char_set_catcode:nn {#1} \c_ten }
+\cs_new_protected:Npn \char_set_catcode_letter:n #1
+ { \char_set_catcode:nn {#1} \c_eleven }
+\cs_new_protected:Npn \char_set_catcode_other:n #1
+ { \char_set_catcode:nn {#1} \c_twelve }
+\cs_new_protected:Npn \char_set_catcode_active:n #1
+ { \char_set_catcode:nn {#1} \c_thirteen }
+\cs_new_protected:Npn \char_set_catcode_comment:n #1
+ { \char_set_catcode:nn {#1} \c_fourteen }
+\cs_new_protected:Npn \char_set_catcode_invalid:n #1
+ { \char_set_catcode:nn {#1} \c_fifteen }
+\cs_new_protected:Npn \char_set_mathcode:nn #1#2
+ { \tex_mathcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
+\cs_new:Npn \char_value_mathcode:n #1
+ { \tex_the:D \tex_mathcode:D \__int_eval:w #1\__int_eval_end: }
+\cs_new_protected:Npn \char_show_value_mathcode:n #1
+ { \tex_showthe:D \tex_mathcode:D \__int_eval:w #1 \__int_eval_end: }
+\cs_new_protected:Npn \char_set_lccode:nn #1#2
+ { \tex_lccode:D #1 = \__int_eval:w #2 \__int_eval_end: }
+\cs_new:Npn \char_value_lccode:n #1
+ { \tex_the:D \tex_lccode:D \__int_eval:w #1\__int_eval_end: }
+\cs_new_protected:Npn \char_show_value_lccode:n #1
+ { \tex_showthe:D \tex_lccode:D \__int_eval:w #1 \__int_eval_end: }
+\cs_new_protected:Npn \char_set_uccode:nn #1#2
+ { \tex_uccode:D #1 = \__int_eval:w #2 \__int_eval_end: }
+\cs_new:Npn \char_value_uccode:n #1
+ { \tex_the:D \tex_uccode:D \__int_eval:w #1\__int_eval_end: }
+\cs_new_protected:Npn \char_show_value_uccode:n #1
+ { \tex_showthe:D \tex_uccode:D \__int_eval:w #1 \__int_eval_end: }
+\cs_new_protected:Npn \char_set_sfcode:nn #1#2
+ { \tex_sfcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
+\cs_new:Npn \char_value_sfcode:n #1
+ { \tex_the:D \tex_sfcode:D \__int_eval:w #1\__int_eval_end: }
+\cs_new_protected:Npn \char_show_value_sfcode:n #1
+ { \tex_showthe:D \tex_sfcode:D \__int_eval:w #1 \__int_eval_end: }
+\cs_new_protected:Npn \token_new:Nn #1#2 { \cs_new_eq:NN #1 #2 }
+\cs_new_eq:NN \c_group_begin_token {
+\cs_new_eq:NN \c_group_end_token }
+\group_begin:
+ \char_set_catcode_math_toggle:N \*
+ \token_new:Nn \c_math_toggle_token { * }
+ \char_set_catcode_alignment:N \*
+ \token_new:Nn \c_alignment_token { * }
+ \token_new:Nn \c_parameter_token { # }
+ \token_new:Nn \c_math_superscript_token { ^ }
+ \char_set_catcode_math_subscript:N \*
+ \token_new:Nn \c_math_subscript_token { * }
+ \token_new:Nn \c_space_token { ~ }
+ \token_new:Nn \c_catcode_letter_token { a }
+ \token_new:Nn \c_catcode_other_token { 1 }
+\group_end:
+\group_begin:
+ \char_set_catcode_active:N \*
+ \tl_const:Nn \c_catcode_active_tl { \exp_not:N * }
+\group_end:
+\seq_new:N \l_char_active_seq
+\use:n
+ {
+ \group_begin:
+ \char_set_catcode_active:N \"
+ \char_set_catcode_active:N \$
+ \char_set_catcode_active:N \&
+ \char_set_catcode_active:N \^
+ \char_set_catcode_active:N \_
+ \char_set_catcode_active:N \~
+ \use:nn
+ {
+ \group_end:
+ \seq_set_split:Nnn \l_char_active_seq { }
+ }
+ }
+ { { " $ & ^ _ ~ } } %$
+\seq_new:N \l_char_special_seq
+\seq_set_split:Nnn \l_char_special_seq { }
+ { \ \" \# \$ \% \& \\ \^ \_ \{ \} \~ }
+\prg_new_conditional:Npnn \token_if_group_begin:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_group_begin_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_group_end:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_group_end_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_math_toggle:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_math_toggle_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_alignment:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_alignment_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\group_begin:
+\cs_set_eq:NN \c_parameter_token \scan_stop:
+\prg_new_conditional:Npnn \token_if_parameter:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_parameter_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\group_end:
+\prg_new_conditional:Npnn \token_if_math_superscript:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_math_superscript_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_math_subscript:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_math_subscript_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_space:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_space_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_letter:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_catcode_letter_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_other:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_catcode_other_token
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_active:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \c_catcode_active_tl
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_eq_meaning:NN #1#2 { p , T , F , TF }
+ {
+ \if_meaning:w #1 #2
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_eq_catcode:NN #1#2 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \exp_not:N #2
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_eq_charcode:NN #1#2 { p , T , F , TF }
+ {
+ \if_charcode:w \exp_not:N #1 \exp_not:N #2
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\group_begin:
+\char_set_catcode_other:N \M
+\char_set_catcode_other:N \A
+\char_set_lccode:nn { `\; } { `\: }
+\char_set_lccode:nn { `\T } { `\T }
+\char_set_lccode:nn { `\F } { `\F }
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \prg_new_conditional:Npnn \token_if_macro:N #1 { p , T , F , TF }
+ {
+ \exp_after:wN \__token_if_macro_p:w
+ \token_to_meaning:N #1 MA; \q_stop
+ }
+ \cs_new:Npn \__token_if_macro_p:w #1 MA #2 ; #3 \q_stop
+ {
+ \if_int_compare:w \pdftex_strcmp:D { #2 } { cro } = \c_zero
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+ }
+\prg_new_conditional:Npnn \token_if_cs:N #1 { p , T , F , TF }
+ {
+ \if_catcode:w \exp_not:N #1 \scan_stop:
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \token_if_expandable:N #1 { p , T , F , TF }
+ {
+ \exp_after:wN \if_meaning:w \exp_not:N #1 #1
+ \prg_return_false:
+ \else:
+ \if_cs_exist:N #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ \fi:
+ }
+\group_begin:
+ \char_set_lccode:nn { `T } { `T }
+ \char_set_lccode:nn { `F } { `F }
+ \char_set_lccode:nn { `X } { `n }
+ \char_set_lccode:nn { `Y } { `t }
+ \char_set_lccode:nn { `Z } { `d }
+ \tl_map_inline:nn { A C E G H I K L M O P R S U X Y Z R " }
+ { \char_set_catcode:nn { `#1 } \c_twelve }
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \prg_new_conditional:Npnn \token_if_chardef:N #1 { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_chardef:w
+ \token_to_meaning:N #1 CHAR" \q_stop
+ }
+ { \token_to_str:N \char }
+ }
+ \prg_new_conditional:Npnn \token_if_mathchardef:N #1 { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_chardef:w
+ \token_to_meaning:N #1 CHAR" \q_stop
+ }
+ { \token_to_str:N \mathchar }
+ }
+ \cs_new:Npn \__token_if_chardef:w #1 CHAR" #2 \q_stop { #1 CHAR }
+ \prg_new_conditional:Npnn \token_if_dim_register:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \tex_dimen:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_dimendef:D #1
+ \prg_return_false:
+ \else:
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_dim_register:w
+ \token_to_meaning:N #1 ZIMEX \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ }
+ \cs_new:Npn \__token_if_dim_register:w #1 ZIMEX #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_int_register:N #1 { p , T , F , TF }
+ {
+ % \token_if_chardef:NTF #1 { \prg_return_true: }
+ % {
+ % \token_if_mathchardef:NTF #1 { \prg_return_true: }
+ % {
+ \if_meaning:w \tex_count:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_countdef:D #1
+ \prg_return_false:
+ \else:
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_int_register:w
+ \token_to_meaning:N #1 COUXY \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ % }
+ % }
+ }
+ \cs_new:Npn \__token_if_int_register:w #1 COUXY #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_muskip_register:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \tex_muskip:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_muskipdef:D #1
+ \prg_return_false:
+ \else:
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_muskip_register:w
+ \token_to_meaning:N #1 MUSKIP \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ }
+ \cs_new:Npn \__token_if_muskip_register:w #1 MUSKIP #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \tex_skip:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_skipdef:D #1
+ \prg_return_false:
+ \else:
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_skip_register:w
+ \token_to_meaning:N #1 SKIP \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ }
+ \cs_new:Npn \__token_if_skip_register:w #1 SKIP #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_toks_register:N #1 { p , T , F , TF }
+ {
+ \if_meaning:w \tex_toks:D #1
+ \prg_return_false:
+ \else:
+ \if_meaning:w \tex_toksdef:D #1
+ \prg_return_false:
+ \else:
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_toks_register:w
+ \token_to_meaning:N #1 YOKS \q_stop
+ }
+ { \token_to_str:N \ }
+ \fi:
+ \fi:
+ }
+ \cs_new:Npn \__token_if_toks_register:w #1 YOKS #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_protected_macro:N #1
+ { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_protected_macro:w
+ \token_to_meaning:N #1 PROYECYEZ~MACRO \q_stop
+ }
+ { \token_to_str:N \ }
+ }
+ \cs_new:Npn \__token_if_protected_macro:w
+ #1 PROYECYEZ~MACRO #2 \q_stop { #1 ~ }
+ \prg_new_conditional:Npnn \token_if_long_macro:N #1 { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_long_macro:w
+ \token_to_meaning:N #1 LOXG~MACRO \q_stop
+ }
+ { \token_to_str:N \ }
+ }
+ \prg_new_conditional:Npnn \token_if_protected_long_macro:N #1
+ { p , T , F , TF }
+ {
+ \__str_if_eq_x_return:nn
+ {
+ \exp_after:wN \__token_if_long_macro:w
+ \token_to_meaning:N #1 LOXG~MACRO \q_stop
+ }
+ { \token_to_str:N \protected \token_to_str:N \ }
+ }
+ \cs_new:Npn \__token_if_long_macro:w #1 LOXG~MACRO #2 \q_stop { #1 ~ }
+ }
+\tex_chardef:D \c_token_A_int = `A ~ %
+\group_begin:
+\char_set_catcode_other:N \;
+\char_set_lccode:nn { `\; } { `\: }
+\char_set_lccode:nn { `\T } { `\T }
+\char_set_lccode:nn { `\F } { `\F }
+\tl_to_lowercase:n {
+ \group_end:
+ \prg_new_conditional:Npnn \token_if_primitive:N #1 { p , T , F , TF }
+ {
+ \token_if_macro:NTF #1
+ \prg_return_false:
+ {
+ \exp_after:wN \__token_if_primitive:NNw
+ \token_to_meaning:N #1 ; ; ; \q_stop #1
+ }
+ }
+ \cs_new:Npn \__token_if_primitive:NNw #1#2 #3 ; #4 \q_stop
+ {
+ \tl_if_empty:oTF { \__token_if_primitive_space:w #3 ~ }
+ { \__token_if_primitive_loop:N #3 ; \q_stop }
+ { \__token_if_primitive_nullfont:N }
+ }
+}
+\cs_new:Npn \__token_if_primitive_space:w #1 ~ { }
+\cs_new:Npn \__token_if_primitive_nullfont:N #1
+ {
+ \if_meaning:w \tex_nullfont:D #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \__token_if_primitive_loop:N #1
+ {
+ \if_int_compare:w `#1 < \c_token_A_int %
+ \exp_after:wN \__token_if_primitive:Nw
+ \exp_after:wN #1
+ \else:
+ \exp_after:wN \__token_if_primitive_loop:N
+ \fi:
+ }
+\cs_new:Npn \__token_if_primitive:Nw #1 #2 \q_stop
+ {
+ \if:w : #1
+ \exp_after:wN \__token_if_primitive_undefined:N
+ \else:
+ \prg_return_false:
+ \exp_after:wN \use_none:n
+ \fi:
+ }
+\cs_new:Npn \__token_if_primitive_undefined:N #1
+ {
+ \if_cs_exist:N #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new_eq:NN \l_peek_token ?
+\cs_new_eq:NN \g_peek_token ?
+\cs_new_eq:NN \l__peek_search_token ?
+\tl_new:N \l__peek_search_tl
+\cs_new_nopar:Npn \__peek_true:w { }
+\cs_new_nopar:Npn \__peek_true_aux:w { }
+\cs_new_nopar:Npn \__peek_false:w { }
+\cs_new:Npn \__peek_tmp:w { }
+\cs_new_protected_nopar:Npn \peek_after:Nw
+ { \tex_futurelet:D \l_peek_token }
+\cs_new_protected_nopar:Npn \peek_gafter:Nw
+ { \tex_global:D \tex_futurelet:D \g_peek_token }
+\cs_new_protected:Npn \__peek_true_remove:w
+ {
+ \group_align_safe_end:
+ \tex_afterassignment:D \__peek_true_aux:w
+ \cs_set_eq:NN \__peek_tmp:w
+ }
+\cs_new_protected:Npn \__peek_token_generic:NNTF #1#2#3#4
+ {
+ \cs_set_eq:NN \l__peek_search_token #2
+ \tl_set:Nn \l__peek_search_tl {#2}
+ \cs_set_nopar:Npx \__peek_true:w
+ {
+ \exp_not:N \group_align_safe_end:
+ \exp_not:n {#3}
+ }
+ \cs_set_nopar:Npx \__peek_false:w
+ {
+ \exp_not:N \group_align_safe_end:
+ \exp_not:n {#4}
+ }
+ \group_align_safe_begin:
+ \peek_after:Nw #1
+ }
+\cs_new_protected:Npn \__peek_token_generic:NNT #1#2#3
+ { \__peek_token_generic:NNTF #1 #2 {#3} { } }
+\cs_new_protected:Npn \__peek_token_generic:NNF #1#2#3
+ { \__peek_token_generic:NNTF #1 #2 { } {#3} }
+\cs_new_protected:Npn \__peek_token_remove_generic:NNTF #1#2#3#4
+ {
+ \cs_set_eq:NN \l__peek_search_token #2
+ \tl_set:Nn \l__peek_search_tl {#2}
+ \cs_set_eq:NN \__peek_true:w \__peek_true_remove:w
+ \cs_set_nopar:Npx \__peek_true_aux:w { \exp_not:n {#3} }
+ \cs_set_nopar:Npx \__peek_false:w
+ {
+ \exp_not:N \group_align_safe_end:
+ \exp_not:n {#4}
+ }
+ \group_align_safe_begin:
+ \peek_after:Nw #1
+ }
+\cs_new_protected:Npn \__peek_token_remove_generic:NNT #1#2#3
+ { \__peek_token_remove_generic:NNTF #1 #2 {#3} { } }
+\cs_new_protected:Npn \__peek_token_remove_generic:NNF #1#2#3
+ { \__peek_token_remove_generic:NNTF #1 #2 { } {#3} }
+\cs_new_nopar:Npn \__peek_execute_branches_meaning:
+ {
+ \if_meaning:w \l_peek_token \l__peek_search_token
+ \exp_after:wN \__peek_true:w
+ \else:
+ \exp_after:wN \__peek_false:w
+ \fi:
+ }
+\cs_new_nopar:Npn \__peek_execute_branches_catcode:
+ { \if_catcode:w \__peek_execute_branches_catcode_aux: }
+\cs_new_nopar:Npn \__peek_execute_branches_charcode:
+ { \if_charcode:w \__peek_execute_branches_catcode_aux: }
+\cs_new_nopar:Npn \__peek_execute_branches_catcode_aux:
+ {
+ \if_catcode:w \exp_not:N \l_peek_token \scan_stop:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__peek_execute_branches_catcode_auxii:N
+ \exp_after:wN \exp_not:N
+ \else:
+ \exp_after:wN \__peek_execute_branches_catcode_auxiii:
+ \fi:
+ }
+\cs_new:Npn \__peek_execute_branches_catcode_auxii:N #1
+ {
+ \exp_not:N #1
+ \exp_after:wN \exp_not:N \l__peek_search_tl
+ \exp_after:wN \__peek_true:w
+ \else:
+ \exp_after:wN \__peek_false:w
+ \fi:
+ #1
+ }
+\cs_new_nopar:Npn \__peek_execute_branches_catcode_auxiii:
+ {
+ \exp_not:N \l_peek_token
+ \exp_after:wN \exp_not:N \l__peek_search_tl
+ \exp_after:wN \__peek_true:w
+ \else:
+ \exp_after:wN \__peek_false:w
+ \fi:
+ }
+\cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches:
+ {
+ \if_meaning:w \l_peek_token \c_space_token
+ \exp_after:wN \peek_after:Nw
+ \exp_after:wN \__peek_ignore_spaces_execute_branches:
+ \tex_romannumeral:D -`0
+ \else:
+ \exp_after:wN \__peek_execute_branches:
+ \fi:
+ }
+\group_begin:
+ \cs_set:Npn \__peek_def:nnnn #1#2#3#4
+ {
+ \__peek_def:nnnnn {#1} {#2} {#3} {#4} { TF }
+ \__peek_def:nnnnn {#1} {#2} {#3} {#4} { T }
+ \__peek_def:nnnnn {#1} {#2} {#3} {#4} { F }
+ }
+ \cs_set:Npn \__peek_def:nnnnn #1#2#3#4#5
+ {
+ \cs_new_protected_nopar:cpx { #1 #5 }
+ {
+ \tl_if_empty:nF {#2}
+ { \exp_not:n { \cs_set_eq:NN \__peek_execute_branches: #2 } }
+ \exp_not:c { #3 #5 }
+ \exp_not:n {#4}
+ }
+ }
+ \__peek_def:nnnn { peek_catcode:N }
+ { }
+ { __peek_token_generic:NN }
+ { \__peek_execute_branches_catcode: }
+ \__peek_def:nnnn { peek_catcode_ignore_spaces:N }
+ { \__peek_execute_branches_catcode: }
+ { __peek_token_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+ \__peek_def:nnnn { peek_catcode_remove:N }
+ { }
+ { __peek_token_remove_generic:NN }
+ { \__peek_execute_branches_catcode: }
+ \__peek_def:nnnn { peek_catcode_remove_ignore_spaces:N }
+ { \__peek_execute_branches_catcode: }
+ { __peek_token_remove_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+ \__peek_def:nnnn { peek_charcode:N }
+ { }
+ { __peek_token_generic:NN }
+ { \__peek_execute_branches_charcode: }
+ \__peek_def:nnnn { peek_charcode_ignore_spaces:N }
+ { \__peek_execute_branches_charcode: }
+ { __peek_token_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+ \__peek_def:nnnn { peek_charcode_remove:N }
+ { }
+ { __peek_token_remove_generic:NN }
+ { \__peek_execute_branches_charcode: }
+ \__peek_def:nnnn { peek_charcode_remove_ignore_spaces:N }
+ { \__peek_execute_branches_charcode: }
+ { __peek_token_remove_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+ \__peek_def:nnnn { peek_meaning:N }
+ { }
+ { __peek_token_generic:NN }
+ { \__peek_execute_branches_meaning: }
+ \__peek_def:nnnn { peek_meaning_ignore_spaces:N }
+ { \__peek_execute_branches_meaning: }
+ { __peek_token_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+ \__peek_def:nnnn { peek_meaning_remove:N }
+ { }
+ { __peek_token_remove_generic:NN }
+ { \__peek_execute_branches_meaning: }
+ \__peek_def:nnnn { peek_meaning_remove_ignore_spaces:N }
+ { \__peek_execute_branches_meaning: }
+ { __peek_token_remove_generic:NN }
+ { \__peek_ignore_spaces_execute_branches: }
+\group_end:
+\exp_args:Nno \use:nn
+ { \cs_new:Npn \__peek_get_prefix_arg_replacement:wN #1 }
+ { \tl_to_str:n { macro : } #2 -> #3 \q_stop #4 }
+ { #4 {#1} {#2} {#3} }
+\cs_new:Npn \token_get_prefix_spec:N #1
+ {
+ \token_if_macro:NTF #1
+ {
+ \exp_after:wN \__peek_get_prefix_arg_replacement:wN
+ \token_to_meaning:N #1 \q_stop \use_i:nnn
+ }
+ { \scan_stop: }
+ }
+\cs_new:Npn \token_get_arg_spec:N #1
+ {
+ \token_if_macro:NTF #1
+ {
+ \exp_after:wN \__peek_get_prefix_arg_replacement:wN
+ \token_to_meaning:N #1 \q_stop \use_ii:nnn
+ }
+ { \scan_stop: }
+ }
+\cs_new:Npn \token_get_replacement_spec:N #1
+ {
+ \token_if_macro:NTF #1
+ {
+ \exp_after:wN \__peek_get_prefix_arg_replacement:wN
+ \token_to_meaning:N #1 \q_stop \use_iii:nnn
+ }
+ { \scan_stop: }
+ }
+%% File: l3prop.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3prop.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Property lists}
+\__scan_new:N \s__prop
+\cs_new:Npn \__prop_pair:wn #1 \s__prop #2
+ { \__msg_kernel_expandable_error:nn { kernel } { misused-prop } }
+\tl_new:N \l__prop_internal_tl
+\tl_const:Nn \c_empty_prop { \s__prop }
+\cs_new_protected:Npn \prop_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs_gset_eq:NN #1 \c_empty_prop
+ }
+\cs_generate_variant:Nn \prop_new:N { c }
+\cs_new_protected:Npn \prop_clear:N #1
+ { \prop_set_eq:NN #1 \c_empty_prop }
+\cs_generate_variant:Nn \prop_clear:N { c }
+\cs_new_protected:Npn \prop_gclear:N #1
+ { \prop_gset_eq:NN #1 \c_empty_prop }
+\cs_generate_variant:Nn \prop_gclear:N { c }
+\cs_new_protected:Npn \prop_clear_new:N #1
+ { \prop_if_exist:NTF #1 { \prop_clear:N #1 } { \prop_new:N #1 } }
+\cs_generate_variant:Nn \prop_clear_new:N { c }
+\cs_new_protected:Npn \prop_gclear_new:N #1
+ { \prop_if_exist:NTF #1 { \prop_gclear:N #1 } { \prop_new:N #1 } }
+\cs_generate_variant:Nn \prop_gclear_new:N { c }
+\cs_new_eq:NN \prop_set_eq:NN \tl_set_eq:NN
+\cs_new_eq:NN \prop_set_eq:Nc \tl_set_eq:Nc
+\cs_new_eq:NN \prop_set_eq:cN \tl_set_eq:cN
+\cs_new_eq:NN \prop_set_eq:cc \tl_set_eq:cc
+\cs_new_eq:NN \prop_gset_eq:NN \tl_gset_eq:NN
+\cs_new_eq:NN \prop_gset_eq:Nc \tl_gset_eq:Nc
+\cs_new_eq:NN \prop_gset_eq:cN \tl_gset_eq:cN
+\cs_new_eq:NN \prop_gset_eq:cc \tl_gset_eq:cc
+\prop_new:N \l_tmpa_prop
+\prop_new:N \l_tmpb_prop
+\prop_new:N \g_tmpa_prop
+\prop_new:N \g_tmpb_prop
+\cs_new_protected:Npn \__prop_split:NnTF #1#2
+ { \exp_args:NNo \__prop_split_aux:NnTF #1 { \tl_to_str:n {#2} } }
+\cs_new_protected:Npn \__prop_split_aux:NnTF #1#2#3#4
+ {
+ \cs_set:Npn \__prop_split_aux:w ##1
+ \__prop_pair:wn #2 \s__prop ##2 ##3 \q_mark ##4 ##5 \q_stop
+ { ##4 {#3} {#4} }
+ \exp_after:wN \__prop_split_aux:w #1 \q_mark \use_i:nn
+ \__prop_pair:wn #2 \s__prop { } \q_mark \use_ii:nn \q_stop
+ }
+\cs_new:Npn \__prop_split_aux:w { }
+\cs_new_protected:Npn \prop_remove:Nn #1#2
+ {
+ \__prop_split:NnTF #1 {#2}
+ { \tl_set:Nn #1 { ##1 ##3 } }
+ { }
+ }
+\cs_new_protected:Npn \prop_gremove:Nn #1#2
+ {
+ \__prop_split:NnTF #1 {#2}
+ { \tl_gset:Nn #1 { ##1 ##3 } }
+ { }
+ }
+\cs_generate_variant:Nn \prop_remove:Nn { NV }
+\cs_generate_variant:Nn \prop_remove:Nn { c , cV }
+\cs_generate_variant:Nn \prop_gremove:Nn { NV }
+\cs_generate_variant:Nn \prop_gremove:Nn { c , cV }
+\cs_new_protected:Npn \prop_get:NnN #1#2#3
+ {
+ \__prop_split:NnTF #1 {#2}
+ { \tl_set:Nn #3 {##2} }
+ { \tl_set:Nn #3 { \q_no_value } }
+ }
+\cs_generate_variant:Nn \prop_get:NnN { NV , No }
+\cs_generate_variant:Nn \prop_get:NnN { c , cV , co }
+\cs_new_protected:Npn \prop_pop:NnN #1#2#3
+ {
+ \__prop_split:NnTF #1 {#2}
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_set:Nn #1 { ##1 ##3 }
+ }
+ { \tl_set:Nn #3 { \q_no_value } }
+ }
+\cs_new_protected:Npn \prop_gpop:NnN #1#2#3
+ {
+ \__prop_split:NnTF #1 {#2}
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_gset:Nn #1 { ##1 ##3 }
+ }
+ { \tl_set:Nn #3 { \q_no_value } }
+ }
+\cs_generate_variant:Nn \prop_pop:NnN { No }
+\cs_generate_variant:Nn \prop_pop:NnN { c , co }
+\cs_generate_variant:Nn \prop_gpop:NnN { No }
+\cs_generate_variant:Nn \prop_gpop:NnN { c , co }
+\prg_new_protected_conditional:Npnn \prop_pop:NnN #1#2#3 { T , F , TF }
+ {
+ \__prop_split:NnTF #1 {#2}
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_set:Nn #1 { ##1 ##3 }
+ \prg_return_true:
+ }
+ { \prg_return_false: }
+ }
+\prg_new_protected_conditional:Npnn \prop_gpop:NnN #1#2#3 { T , F , TF }
+ {
+ \__prop_split:NnTF #1 {#2}
+ {
+ \tl_set:Nn #3 {##2}
+ \tl_gset:Nn #1 { ##1 ##3 }
+ \prg_return_true:
+ }
+ { \prg_return_false: }
+ }
+\cs_generate_variant:Nn \prop_pop:NnNT { c }
+\cs_generate_variant:Nn \prop_pop:NnNF { c }
+\cs_generate_variant:Nn \prop_pop:NnNTF { c }
+\cs_generate_variant:Nn \prop_gpop:NnNT { c }
+\cs_generate_variant:Nn \prop_gpop:NnNF { c }
+\cs_generate_variant:Nn \prop_gpop:NnNTF { c }
+\cs_new_protected_nopar:Npn \prop_put:Nnn { \__prop_put:NNnn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \prop_gput:Nnn { \__prop_put:NNnn \tl_gset:Nx }
+\cs_new_protected:Npn \__prop_put:NNnn #1#2#3#4
+ {
+ \tl_set:Nn \l__prop_internal_tl
+ {
+ \exp_not:N \__prop_pair:wn \tl_to_str:n {#3}
+ \s__prop { \exp_not:n {#4} }
+ }
+ \__prop_split:NnTF #2 {#3}
+ { #1 #2 { \exp_not:n {##1} \l__prop_internal_tl \exp_not:n {##3} } }
+ { #1 #2 { \exp_not:o {#2} \l__prop_internal_tl } }
+ }
+\cs_generate_variant:Nn \prop_put:Nnn
+ { NnV , Nno , Nnx , NV , NVV , No , Noo }
+\cs_generate_variant:Nn \prop_put:Nnn
+ { c , cnV , cno , cnx , cV , cVV , co , coo }
+\cs_generate_variant:Nn \prop_gput:Nnn
+ { NnV , Nno , Nnx , NV , NVV , No , Noo }
+\cs_generate_variant:Nn \prop_gput:Nnn
+ { c , cnV , cno , cnx , cV , cVV , co , coo }
+\cs_new_protected_nopar:Npn \prop_put_if_new:Nnn
+ { \__prop_put_if_new:NNnn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \prop_gput_if_new:Nnn
+ { \__prop_put_if_new:NNnn \tl_gset:Nx }
+\cs_new_protected:Npn \__prop_put_if_new:NNnn #1#2#3#4
+ {
+ \tl_set:Nn \l__prop_internal_tl
+ {
+ \exp_not:N \__prop_pair:wn \tl_to_str:n {#3}
+ \s__prop \exp_not:n { {#4} }
+ }
+ \__prop_split:NnTF #2 {#3}
+ { }
+ { #1 #2 { \exp_not:o {#2} \l__prop_internal_tl } }
+ }
+\cs_generate_variant:Nn \prop_put_if_new:Nnn { c }
+\cs_generate_variant:Nn \prop_gput_if_new:Nnn { c }
+\prg_new_eq_conditional:NNn \prop_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \prop_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\prg_new_conditional:Npnn \prop_if_empty:N #1 { p , T , F , TF }
+ {
+ \tl_if_eq:NNTF #1 \c_empty_prop
+ \prg_return_true: \prg_return_false:
+ }
+\cs_generate_variant:Nn \prop_if_empty_p:N { c }
+\cs_generate_variant:Nn \prop_if_empty:NT { c }
+\cs_generate_variant:Nn \prop_if_empty:NF { c }
+\cs_generate_variant:Nn \prop_if_empty:NTF { c }
+\prg_new_conditional:Npnn \prop_if_in:Nn #1#2 { p , T , F , TF }
+ {
+ \exp_last_unbraced:Noo \__prop_if_in:nwwn { \tl_to_str:n {#2} } #1
+ \__prop_pair:wn \tl_to_str:n {#2} \s__prop { }
+ \q_recursion_tail
+ \__prg_break_point:
+ }
+\cs_new:Npn \__prop_if_in:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
+ {
+ \str_if_eq_x:nnTF {#1} {#3}
+ { \__prop_if_in:N }
+ { \__prop_if_in:nwwn {#1} }
+ }
+\cs_new:Npn \__prop_if_in:N #1
+ {
+ \if_meaning:w \q_recursion_tail #1
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ \__prg_break:
+ }
+\cs_generate_variant:Nn \prop_if_in_p:Nn { NV , No }
+\cs_generate_variant:Nn \prop_if_in_p:Nn { c , cV , co }
+\cs_generate_variant:Nn \prop_if_in:NnT { NV , No }
+\cs_generate_variant:Nn \prop_if_in:NnT { c , cV , co }
+\cs_generate_variant:Nn \prop_if_in:NnF { NV , No }
+\cs_generate_variant:Nn \prop_if_in:NnF { c , cV , co }
+\cs_generate_variant:Nn \prop_if_in:NnTF { NV , No }
+\cs_generate_variant:Nn \prop_if_in:NnTF { c , cV , co }
+\prg_new_protected_conditional:Npnn \prop_get:NnN #1#2#3 { T , F , TF }
+ {
+ \__prop_split:NnTF #1 {#2}
+ {
+ \tl_set:Nn #3 {##2}
+ \prg_return_true:
+ }
+ { \prg_return_false: }
+ }
+\cs_generate_variant:Nn \prop_get:NnNT { NV , No }
+\cs_generate_variant:Nn \prop_get:NnNF { NV , No }
+\cs_generate_variant:Nn \prop_get:NnNTF { NV , No }
+\cs_generate_variant:Nn \prop_get:NnNT { c , cV , co }
+\cs_generate_variant:Nn \prop_get:NnNF { c , cV , co }
+\cs_generate_variant:Nn \prop_get:NnNTF { c , cV , co }
+\cs_new:Npn \prop_map_function:NN #1#2
+ {
+ \exp_last_unbraced:NNo \__prop_map_function:Nwwn #2 #1
+ \__prop_pair:wn \q_recursion_tail \s__prop { }
+ \__prg_break_point:Nn \prop_map_break: { }
+ }
+\cs_new:Npn \__prop_map_function:Nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
+ {
+ \if_meaning:w \q_recursion_tail #3
+ \exp_after:wN \prop_map_break:
+ \fi:
+ #1 {#3} {#4}
+ \__prop_map_function:Nwwn #1
+ }
+\cs_generate_variant:Nn \prop_map_function:NN { Nc }
+\cs_generate_variant:Nn \prop_map_function:NN { c , cc }
+\cs_new_protected:Npn \prop_map_inline:Nn #1#2
+ {
+ \cs_gset_eq:cN
+ { __prg_map_ \int_use:N \g__prg_map_int :wn } \__prop_pair:wn
+ \int_gincr:N \g__prg_map_int
+ \cs_gset:Npn \__prop_pair:wn ##1 \s__prop ##2 {#2}
+ #1
+ \__prg_break_point:Nn \prop_map_break:
+ {
+ \int_gdecr:N \g__prg_map_int
+ \cs_gset_eq:Nc \__prop_pair:wn
+ { __prg_map_ \int_use:N \g__prg_map_int :wn }
+ }
+ }
+\cs_generate_variant:Nn \prop_map_inline:Nn { c }
+\cs_new_nopar:Npn \prop_map_break:
+ { \__prg_map_break:Nn \prop_map_break: { } }
+\cs_new_nopar:Npn \prop_map_break:n
+ { \__prg_map_break:Nn \prop_map_break: }
+\cs_new_protected:Npn \prop_show:N #1
+ {
+ \__msg_show_variable:Nnn #1 { prop }
+ { \prop_map_function:NN #1 \__msg_show_item:nn }
+ }
+\cs_generate_variant:Nn \prop_show:N { c }
+%% File: l3msg.dtx Copyright (C) 2009-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3msg.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Messages}
+\tl_new:N \l__msg_internal_tl
+\tl_const:Nn \c__msg_text_prefix_tl { msg~text~>~ }
+\tl_const:Nn \c__msg_more_text_prefix_tl { msg~extra~text~>~ }
+\prg_new_conditional:Npnn \msg_if_exist:nn #1#2 { p , T , F , TF }
+ {
+ \cs_if_exist:cTF { \c__msg_text_prefix_tl #1 / #2 }
+ { \prg_return_true: } { \prg_return_false: }
+ }
+\cs_new_protected:Npn \__chk_if_free_msg:nn #1#2
+ {
+ \msg_if_exist:nnT {#1} {#2}
+ {
+ \__msg_kernel_error:nnxx { kernel } { message-already-defined }
+ {#1} {#2}
+ }
+ }
+\tex_ifodd:D \l@expl@log@functions@bool
+ \cs_gset_protected:Npn \__chk_if_free_msg:nn #1#2
+ {
+ \msg_if_exist:nnT {#1} {#2}
+ {
+ \__msg_kernel_error:nnxx { kernel } { message-already-defined }
+ {#1} {#2}
+ }
+ \iow_log:x { Defining~message~ #1 / #2 ~\msg_line_context: }
+ }
+\fi:
+\cs_new_protected:Npn \msg_new:nnnn #1#2
+ {
+ \__chk_if_free_msg:nn {#1} {#2}
+ \msg_gset:nnnn {#1} {#2}
+ }
+\cs_new_protected:Npn \msg_new:nnn #1#2#3
+ { \msg_new:nnnn {#1} {#2} {#3} { } }
+\cs_new_protected:Npn \msg_set:nnnn #1#2#3#4
+ {
+ \cs_set:cpn { \c__msg_text_prefix_tl #1 / #2 }
+ ##1##2##3##4 {#3}
+ \cs_set:cpn { \c__msg_more_text_prefix_tl #1 / #2 }
+ ##1##2##3##4 {#4}
+ }
+\cs_new_protected:Npn \msg_set:nnn #1#2#3
+ { \msg_set:nnnn {#1} {#2} {#3} { } }
+\cs_new_protected:Npn \msg_gset:nnnn #1#2#3#4
+ {
+ \cs_gset:cpn { \c__msg_text_prefix_tl #1 / #2 }
+ ##1##2##3##4 {#3}
+ \cs_gset:cpn { \c__msg_more_text_prefix_tl #1 / #2 }
+ ##1##2##3##4 {#4}
+ }
+\cs_new_protected:Npn \msg_gset:nnn #1#2#3
+ { \msg_gset:nnnn {#1} {#2} {#3} { } }
+\tl_const:Nn \c_msg_coding_error_text_tl
+ {
+ This~is~a~coding~error.
+ \\ \\
+ }
+\tl_const:Nn \c_msg_continue_text_tl
+ { Type~<return>~to~continue }
+\tl_const:Nn \c_msg_critical_text_tl
+ { Reading~the~current~file~will~stop. }
+\tl_const:Nn \c_msg_fatal_text_tl
+ { This~is~a~fatal~error:~LaTeX~will~abort. }
+\tl_const:Nn \c_msg_help_text_tl
+ { For~immediate~help~type~H~<return> }
+\tl_const:Nn \c_msg_no_info_text_tl
+ {
+ LaTeX~does~not~know~anything~more~about~this~error,~sorry.
+ \c_msg_return_text_tl
+ }
+\tl_const:Nn \c_msg_on_line_text_tl { on~line }
+\tl_const:Nn \c_msg_return_text_tl
+ {
+ \\ \\
+ Try~typing~<return>~to~proceed.
+ \\
+ If~that~doesn't~work,~type~X~<return>~to~quit.
+ }
+\tl_const:Nn \c_msg_trouble_text_tl
+ {
+ \\ \\
+ More~errors~will~almost~certainly~follow: \\
+ the~LaTeX~run~should~be~aborted.
+ }
+\cs_new_nopar:Npn \msg_line_number: { \int_use:N \tex_inputlineno:D }
+\cs_gset_nopar:Npn \msg_line_context:
+ {
+ \c_msg_on_line_text_tl
+ \c_space_tl
+ \msg_line_number:
+ }
+\cs_new_protected:Npn \msg_interrupt:nnn #1#2#3
+ {
+ \tl_if_empty:nTF {#3}
+ {
+ \__msg_interrupt_wrap:nn { \\ \c_msg_no_info_text_tl }
+ {#1 \\\\ #2 \\\\ \c_msg_continue_text_tl }
+ }
+ {
+ \__msg_interrupt_wrap:nn { \\ #3 }
+ {#1 \\\\ #2 \\\\ \c_msg_help_text_tl }
+ }
+ }
+\cs_new_protected:Npn \__msg_interrupt_wrap:nn #1#2
+ {
+ \iow_wrap:nnnN {#1} { | ~ } { } \__msg_interrupt_more_text:n
+ \iow_wrap:nnnN {#2} { ! ~ } { } \__msg_interrupt_text:n
+ }
+\cs_new_protected:Npn \__msg_interrupt_more_text:n #1
+ {
+ \exp_args:Nx \tex_errhelp:D
+ {
+ |'''''''''''''''''''''''''''''''''''''''''''''''
+ #1 \iow_newline:
+ |...............................................
+ }
+ }
+\group_begin:
+ \char_set_lccode:nn {`\{} {`\ }
+ \char_set_lccode:nn {`\}} {`\ }
+ \char_set_lccode:nn {`\&} {`\!}
+ \char_set_catcode_active:N \&
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new_protected:Npn \__msg_interrupt_text:n #1
+ {
+ \iow_term:x
+ {
+ \iow_newline:
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ \iow_newline:
+ !
+ }
+ \group_begin:
+ \cs_set_protected_nopar:Npn &
+ {
+ \tex_errmessage:D
+ {
+ #1
+ \use_none:n
+ { ............................................ }
+ }
+ }
+ \exp_after:wN
+ \group_end:
+ &
+ }
+ }
+\cs_new_protected:Npn \msg_log:n #1
+ {
+ \iow_log:n { ................................................. }
+ \iow_wrap:nnnN { . ~ #1} { . ~ } { } \iow_log:n
+ \iow_log:n { ................................................. }
+ }
+\cs_new_protected:Npn \msg_term:n #1
+ {
+ \iow_term:n { ************************************************* }
+ \iow_wrap:nnnN { * ~ #1} { * ~ } { } \iow_term:n
+ \iow_term:n { ************************************************* }
+ }
+\cs_new:Npn \msg_fatal_text:n #1 { Fatal~#1~error }
+\cs_new:Npn \msg_critical_text:n #1 { Critical~#1~error }
+\cs_new:Npn \msg_error_text:n #1 { #1~error }
+\cs_new:Npn \msg_warning_text:n #1 { #1~warning }
+\cs_new:Npn \msg_info_text:n #1 { #1~info }
+\cs_new:Npn \msg_see_documentation_text:n #1
+ {
+ \\ \\ See~the~
+ \str_if_eq:nnTF {#1} { LaTeX } { LaTeX3 } {#1} ~
+ documentation~for~further~information.
+ }
+\group_begin:
+ \cs_set_protected:Npn \__msg_class_new:nn #1#2
+ {
+ \prop_new:c { l__msg_redirect_ #1 _prop }
+ \cs_new_protected:cpn { __msg_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2}
+ \cs_new_protected:cpn { msg_ #1 :nnnnnn } ##1##2##3##4##5##6
+ {
+ \use:x
+ {
+ \exp_not:n { \__msg_use:nnnnnnn {#1} {##1} {##2} }
+ { \tl_to_str:n {##3} } { \tl_to_str:n {##4} }
+ { \tl_to_str:n {##5} } { \tl_to_str:n {##6} }
+ }
+ }
+ \cs_new_protected:cpx { msg_ #1 :nnnnn } ##1##2##3##4##5
+ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } }
+ \cs_new_protected:cpx { msg_ #1 :nnnn } ##1##2##3##4
+ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } }
+ \cs_new_protected:cpx { msg_ #1 :nnn } ##1##2##3
+ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } }
+ \cs_new_protected:cpx { msg_ #1 :nn } ##1##2
+ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } }
+ \cs_new_protected:cpx { msg_ #1 :nnxxxx } ##1##2##3##4##5##6
+ {
+ \use:x
+ {
+ \exp_not:N \exp_not:n
+ { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} }
+ {##3} {##4} {##5} {##6}
+ }
+ }
+ \cs_new_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5
+ { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } }
+ \cs_new_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4
+ { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } }
+ \cs_new_protected:cpx { msg_ #1 :nnx } ##1##2##3
+ { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } }
+ }
+ \__msg_class_new:nn { fatal }
+ {
+ \msg_interrupt:nnn
+ { \msg_fatal_text:n {#1} : ~ "#2" }
+ {
+ \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
+ \msg_see_documentation_text:n {#1}
+ }
+ { \c_msg_fatal_text_tl }
+ \tex_end:D
+ }
+ \__msg_class_new:nn { critical }
+ {
+ \msg_interrupt:nnn
+ { \msg_critical_text:n {#1} : ~ "#2" }
+ {
+ \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
+ \msg_see_documentation_text:n {#1}
+ }
+ { \c_msg_critical_text_tl }
+ \tex_endinput:D
+ }
+ \__msg_class_new:nn { error }
+ {
+ \__msg_error:cnnnnn
+ { \c__msg_more_text_prefix_tl #1 / #2 }
+ {#3} {#4} {#5} {#6}
+ {
+ \msg_interrupt:nnn
+ { \msg_error_text:n {#1} : ~ "#2" }
+ {
+ \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
+ \msg_see_documentation_text:n {#1}
+ }
+ }
+ }
+ \cs_new_protected:Npn \__msg_error:cnnnnn #1#2#3#4#5#6
+ {
+ \cs_if_eq:cNTF {#1} \__msg_no_more_text:nnnn
+ { #6 { } }
+ { #6 { \use:c {#1} {#2} {#3} {#4} {#5} } }
+ }
+ \cs_new:Npn \__msg_no_more_text:nnnn #1#2#3#4 { }
+ \__msg_class_new:nn { warning }
+ {
+ \msg_term:n
+ {
+ \msg_warning_text:n {#1} : ~ "#2" \\ \\
+ \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
+ }
+ }
+ \__msg_class_new:nn { info }
+ {
+ \msg_log:n
+ {
+ \msg_info_text:n {#1} : ~ "#2" \\ \\
+ \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
+ }
+ }
+ \__msg_class_new:nn { log }
+ {
+ \iow_wrap:nnnN
+ { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
+ { } { } \iow_log:n
+ }
+ \__msg_class_new:nn { none } { }
+\group_end:
+\cs_new:Npn \__msg_class_chk_exist:nT #1
+ {
+ \cs_if_free:cTF { __msg_ #1 _code:nnnnnn }
+ { \__msg_kernel_error:nnx { kernel } { message-class-unknown } {#1} }
+ }
+\tl_new:N \l__msg_class_tl
+\tl_new:N \l__msg_current_class_tl
+\prop_new:N \l__msg_redirect_prop
+\seq_new:N \l__msg_hierarchy_seq
+\seq_new:N \l__msg_class_loop_seq
+\cs_new_protected:Npn \__msg_use:nnnnnnn #1#2#3#4#5#6#7
+ {
+ \msg_if_exist:nnTF {#2} {#3}
+ {
+ \__msg_class_chk_exist:nT {#1}
+ {
+ \tl_set:Nn \l__msg_current_class_tl {#1}
+ \cs_set_protected_nopar:Npx \__msg_use_code:
+ {
+ \exp_not:n
+ {
+ \use:c { __msg_ \l__msg_class_tl _code:nnnnnn }
+ {#2} {#3} {#4} {#5} {#6} {#7}
+ }
+ }
+ \__msg_use_redirect_name:n { #2 / #3 }
+ }
+ }
+ { \__msg_kernel_error:nnxx { kernel } { message-unknown } {#2} {#3} }
+ }
+\cs_new_protected_nopar:Npn \__msg_use_code: { }
+\cs_new_protected:Npn \__msg_use_redirect_name:n #1
+ {
+ \prop_get:NnNTF \l__msg_redirect_prop { / #1 } \l__msg_class_tl
+ { \__msg_use_code: }
+ {
+ \seq_clear:N \l__msg_hierarchy_seq
+ \__msg_use_hierarchy:nwwN { }
+ #1 \q_mark \__msg_use_hierarchy:nwwN
+ / \q_mark \use_none_delimit_by_q_stop:w
+ \q_stop
+ \__msg_use_redirect_module:n { }
+ }
+ }
+\cs_new_protected:Npn \__msg_use_hierarchy:nwwN #1#2 / #3 \q_mark #4
+ {
+ \seq_put_left:Nn \l__msg_hierarchy_seq {#1}
+ #4 { #1 / #2 } #3 \q_mark #4
+ }
+\cs_new_protected:Npn \__msg_use_redirect_module:n #1
+ {
+ \seq_map_inline:Nn \l__msg_hierarchy_seq
+ {
+ \prop_get:cnNTF { l__msg_redirect_ \l__msg_current_class_tl _prop }
+ {##1} \l__msg_class_tl
+ {
+ \seq_map_break:n
+ {
+ \tl_if_eq:NNTF \l__msg_current_class_tl \l__msg_class_tl
+ { \__msg_use_code: }
+ {
+ \tl_set_eq:NN \l__msg_current_class_tl \l__msg_class_tl
+ \__msg_use_redirect_module:n {##1}
+ }
+ }
+ }
+ {
+ \str_if_eq:nnT {##1} {#1}
+ {
+ \tl_set_eq:NN \l__msg_class_tl \l__msg_current_class_tl
+ \seq_map_break:n { \__msg_use_code: }
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \msg_redirect_name:nnn #1#2#3
+ {
+ \tl_if_empty:nTF {#3}
+ { \prop_remove:Nn \l__msg_redirect_prop { / #1 / #2 } }
+ {
+ \__msg_class_chk_exist:nT {#3}
+ { \prop_put:Nnn \l__msg_redirect_prop { / #1 / #2 } {#3} }
+ }
+ }
+\cs_new_protected_nopar:Npn \msg_redirect_class:nn
+ { \__msg_redirect:nnn { } }
+\cs_new_protected:Npn \msg_redirect_module:nnn #1
+ { \__msg_redirect:nnn { / #1 } }
+\cs_new_protected:Npn \__msg_redirect:nnn #1#2#3
+ {
+ \__msg_class_chk_exist:nT {#2}
+ {
+ \tl_if_empty:nTF {#3}
+ { \prop_remove:cn { l__msg_redirect_ #2 _prop } {#1} }
+ {
+ \__msg_class_chk_exist:nT {#3}
+ {
+ \prop_put:cnn { l__msg_redirect_ #2 _prop } {#1} {#3}
+ \tl_set:Nn \l__msg_current_class_tl {#2}
+ \seq_clear:N \l__msg_class_loop_seq
+ \__msg_redirect_loop_chk:nnn {#2} {#3} {#1}
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__msg_redirect_loop_chk:nnn #1#2#3
+ {
+ \seq_put_right:Nn \l__msg_class_loop_seq {#1}
+ \prop_get:cnNT { l__msg_redirect_ #1 _prop } {#3} \l__msg_class_tl
+ {
+ \str_if_eq_x:nnF { \l__msg_class_tl } {#1}
+ {
+ \tl_if_eq:NNTF \l__msg_class_tl \l__msg_current_class_tl
+ {
+ \prop_put:cnn { l__msg_redirect_ #2 _prop } {#3} {#2}
+ \__msg_kernel_warning:nnxxxx { kernel } { message-redirect-loop }
+ { \seq_item:Nn \l__msg_class_loop_seq { \c_one } }
+ { \seq_item:Nn \l__msg_class_loop_seq { \c_two } }
+ {#3}
+ {
+ \seq_map_function:NN \l__msg_class_loop_seq
+ \__msg_redirect_loop_list:n
+ { \seq_item:Nn \l__msg_class_loop_seq { \c_one } }
+ }
+ }
+ { \__msg_redirect_loop_chk:onn \l__msg_class_tl {#2} {#3} }
+ }
+ }
+ }
+\cs_generate_variant:Nn \__msg_redirect_loop_chk:nnn { o }
+\cs_new:Npn \__msg_redirect_loop_list:n #1 { {#1} ~ => ~ }
+\cs_new_protected:Npn \__msg_kernel_new:nnnn #1#2
+ { \msg_new:nnnn { LaTeX } { #1 / #2 } }
+\cs_new_protected:Npn \__msg_kernel_new:nnn #1#2
+ { \msg_new:nnn { LaTeX } { #1 / #2 } }
+\cs_new_protected:Npn \__msg_kernel_set:nnnn #1#2
+ { \msg_set:nnnn { LaTeX } { #1 / #2 } }
+\cs_new_protected:Npn \__msg_kernel_set:nnn #1#2
+ { \msg_set:nnn { LaTeX } { #1 / #2 } }
+\group_begin:
+ \cs_set_protected:Npn \__msg_kernel_class_new:nN #1
+ { \__msg_kernel_class_new_aux:nN { kernel_ #1 } }
+ \cs_set_protected:Npn \__msg_kernel_class_new_aux:nN #1#2
+ {
+ \cs_new_protected:cpn { __msg_ #1 :nnnnnn } ##1##2##3##4##5##6
+ {
+ \use:x
+ {
+ \exp_not:n { #2 { LaTeX } { ##1 / ##2 } }
+ { \tl_to_str:n {##3} } { \tl_to_str:n {##4} }
+ { \tl_to_str:n {##5} } { \tl_to_str:n {##6} }
+ }
+ }
+ \cs_new_protected:cpx { __msg_ #1 :nnnnn } ##1##2##3##4##5
+ { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } }
+ \cs_new_protected:cpx { __msg_ #1 :nnnn } ##1##2##3##4
+ { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } }
+ \cs_new_protected:cpx { __msg_ #1 :nnn } ##1##2##3
+ { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } }
+ \cs_new_protected:cpx { __msg_ #1 :nn } ##1##2
+ { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } }
+ \cs_new_protected:cpx { __msg_ #1 :nnxxxx } ##1##2##3##4##5##6
+ {
+ \use:x
+ {
+ \exp_not:N \exp_not:n
+ { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} }
+ {##3} {##4} {##5} {##6}
+ }
+ }
+ \cs_new_protected:cpx { __msg_ #1 :nnxxx } ##1##2##3##4##5
+ { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } }
+ \cs_new_protected:cpx { __msg_ #1 :nnxx } ##1##2##3##4
+ { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } }
+ \cs_new_protected:cpx { __msg_ #1 :nnx } ##1##2##3
+ { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } }
+ }
+ \__msg_kernel_class_new:nN { fatal } \__msg_fatal_code:nnnnnn
+ \cs_undefine:N \__msg_kernel_error:nnxx
+ \cs_undefine:N \__msg_kernel_error:nnx
+ \cs_undefine:N \__msg_kernel_error:nn
+ \__msg_kernel_class_new:nN { error } \__msg_error_code:nnnnnn
+ \__msg_kernel_class_new:nN { warning } \msg_warning:nnxxxx
+ \__msg_kernel_class_new:nN { info } \msg_info:nnxxxx
+\group_end:
+\__msg_kernel_new:nnnn { kernel } { message-already-defined }
+ { Message~'#2'~for~module~'#1'~already~defined. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~was~asked~to~define~a~new~message~called~'#2'\
+ by~the~module~'#1':~this~message~already~exists.
+ \c_msg_return_text_tl
+ }
+\__msg_kernel_new:nnnn { kernel } { message-unknown }
+ { Unknown~message~'#2'~for~module~'#1'. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~was~asked~to~display~a~message~called~'#2'\\
+ by~the~module~'#1':~this~message~does~not~exist.
+ \c_msg_return_text_tl
+ }
+\__msg_kernel_new:nnnn { kernel } { message-class-unknown }
+ { Unknown~message~class~'#1'. }
+ {
+ LaTeX~has~been~asked~to~redirect~messages~to~a~class~'#1':\\
+ this~was~never~defined.
+ \c_msg_return_text_tl
+ }
+\__msg_kernel_new:nnnn { kernel } { message-redirect-loop }
+ {
+ Message~redirection~loop~caused~by~ {#1} ~=>~ {#2}
+ \tl_if_empty:nF {#3} { ~for~module~' \use_none:n #3 ' } .
+ }
+ {
+ Adding~the~message~redirection~ {#1} ~=>~ {#2}
+ \tl_if_empty:nF {#3} { ~for~the~module~' \use_none:n #3 ' } ~
+ created~an~infinite~loop\\\\
+ \iow_indent:n { #4 \\\\ }
+ }
+\__msg_kernel_new:nnnn { kernel } { bad-number-of-arguments }
+ { Function~'#1'~cannot~be~defined~with~#2~arguments. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~define~a~function~'#1'~with~
+ #2~arguments.~
+ TeX~allows~between~0~and~9~arguments~for~a~single~function.
+ }
+\__msg_kernel_new:nnnn { kernel } { command-already-defined }
+ { Control~sequence~#1~already~defined. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~create~a~new~control~sequence~'#1'~
+ but~this~name~has~already~been~used~elsewhere. \\ \\
+ The~current~meaning~is:\\
+ \ \ #2
+ }
+\__msg_kernel_new:nnnn { kernel } { command-not-defined }
+ { Control~sequence~#1~undefined. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~use~a~command~#1,~but~this~has~not~
+ been~defined~yet.
+ }
+\__msg_kernel_new:nnnn { kernel } { empty-search-pattern }
+ { Empty~search~pattern. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~
+ would~lead~to~an~infinite~loop!
+ }
+\__msg_kernel_new:nnnn { kernel } { out-of-registers }
+ { No~room~for~a~new~#1. }
+ {
+ TeX~only~supports~\int_use:N \c_max_register_int \
+ of~each~type.~All~the~#1~registers~have~been~used.~
+ This~run~will~be~aborted~now.
+ }
+\__msg_kernel_new:nnnn { kernel } { missing-colon }
+ { Function~'#1'~contains~no~':'. }
+ {
+ \c_msg_coding_error_text_tl
+ Code-level~functions~must~contain~':'~to~separate~the~
+ argument~specification~from~the~function~name.~This~is~
+ needed~when~defining~conditionals~or~variants,~or~when~building~a~
+ parameter~text~from~the~number~of~arguments~of~the~function.
+ }
+\__msg_kernel_new:nnnn { kernel } { protected-predicate }
+ { Predicate~'#1'~must~be~expandable. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~define~'#1'~as~a~protected~predicate.~
+ Only~expandable~tests~can~have~a~predicate~version.
+ }
+\__msg_kernel_new:nnnn { kernel } { conditional-form-unknown }
+ { Conditional~form~'#1'~for~function~'#2'~unknown. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~define~the~conditional~form~'#1'~of~
+ the~function~'#2',~but~only~'TF',~'T',~'F',~and~'p'~forms~exist.
+ }
+\bool_if:NT \l@expl@check@declarations@bool
+ {
+ \__msg_kernel_new:nnnn { check } { non-declared-variable }
+ { The~variable~#1~has~not~been~declared~\msg_line_context:. }
+ {
+ Checking~is~active,~and~you~have~tried~do~so~something~like: \\
+ \ \ \tl_set:Nn ~ #1 ~ \{ ~ ... ~ \} \\
+ without~first~having: \\
+ \ \ \tl_new:N ~ #1 \\
+ \\
+ LaTeX~will~create~the~variable~and~continue.
+ }
+ }
+\__msg_kernel_new:nnnn { kernel } { scanmark-already-defined }
+ { Scan~mark~#1~already~defined. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~create~a~new~scan~mark~'#1'~
+ but~this~name~has~already~been~used~for~a~scan~mark.
+ }
+\__msg_kernel_new:nnnn { kernel } { variable-not-defined }
+ { Variable~#1~undefined. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~show~a~variable~#1,~but~this~has~not~
+ been~defined~yet.
+ }
+\__msg_kernel_new:nnnn { kernel } { variant-too-long }
+ { Variant~form~'#1'~longer~than~base~signature~of~'#2'. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~create~a~variant~of~the~function~'#2'~
+ with~a~signature~starting~with~'#1',~but~that~is~longer~than~
+ the~signature~(part~after~the~colon)~of~'#2'.
+ }
+\__msg_kernel_new:nnnn { kernel } { invalid-variant }
+ { Variant~form~'#1'~invalid~for~base~form~'#2'. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~create~a~variant~of~the~function~'#2'~
+ with~a~signature~starting~with~'#1',~but~cannot~change~an~argument~
+ from~type~'#3'~to~type~'#4'.
+ }
+\__msg_kernel_new:nnn { kernel } { bad-variable }
+ { Erroneous~variable~#1 used! }
+\__msg_kernel_new:nnn { kernel } { misused-sequence }
+ { A~sequence~was~misused. }
+\__msg_kernel_new:nnn { kernel } { misused-prop }
+ { A~property~list~was~misused. }
+\__msg_kernel_new:nnn { kernel } { negative-replication }
+ { Negative~argument~for~\prg_replicate:nn. }
+\__msg_kernel_new:nnn { kernel } { unknown-comparison }
+ { Relation~symbol~'#1'~unknown:~use~=,~<,~>,~==,~!=,~<=,~>=. }
+\__msg_kernel_new:nnn { kernel } { zero-step }
+ { Zero~step~size~for~step~function~#1. }
+\__msg_kernel_new:nnn { kernel } { show-clist }
+ {
+ The~comma~list~
+ \str_if_eq:nnF {#1} { \l__clist_internal_clist } { \token_to_str:N #1~}
+ \clist_if_empty:NTF #1
+ { is~empty }
+ { contains~the~items~(without~outer~braces): }
+ }
+\__msg_kernel_new:nnn { kernel } { show-prop }
+ {
+ The~property~list~\token_to_str:N #1~
+ \prop_if_empty:NTF #1
+ { is~empty }
+ { contains~the~pairs~(without~outer~braces): }
+ }
+\__msg_kernel_new:nnn { kernel } { show-seq }
+ {
+ The~sequence~\token_to_str:N #1~
+ \seq_if_empty:NTF #1
+ { is~empty }
+ { contains~the~items~(without~outer~braces): }
+ }
+\__msg_kernel_new:nnn { kernel } { show-no-stream }
+ { No~ #1 ~streams~are~open }
+\__msg_kernel_new:nnn { kernel } { show-open-streams }
+ { The~following~ #1 ~streams~are~in~use: }
+\group_begin:
+\char_set_catcode_math_superscript:N \^
+\char_set_lccode:nn { `^ } { `\ }
+\char_set_lccode:nn { `L } { `L }
+\char_set_lccode:nn { `T } { `T }
+\char_set_lccode:nn { `X } { `X }
+\tl_to_lowercase:n
+ {
+ \cs_new:Npx \__msg_expandable_error:n #1
+ {
+ \exp_not:n
+ {
+ \tex_romannumeral:D
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__msg_expandable_error:w
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \c_zero
+ }
+ \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } ^
+ }
+ \cs_new:Npn \__msg_expandable_error:w #1 ^ #2 ^ { #1 }
+ }
+\group_end:
+\cs_new:Npn \__msg_kernel_expandable_error:nnnnnn #1#2#3#4#5#6
+ {
+ \exp_args:Nf \__msg_expandable_error:n
+ {
+ \exp_args:NNc \exp_after:wN \exp_stop_f:
+ { \c__msg_text_prefix_tl LaTeX / #1 / #2 }
+ {#3} {#4} {#5} {#6}
+ }
+ }
+\cs_new:Npn \__msg_kernel_expandable_error:nnnnn #1#2#3#4#5
+ {
+ \__msg_kernel_expandable_error:nnnnnn
+ {#1} {#2} {#3} {#4} {#5} { }
+ }
+\cs_new:Npn \__msg_kernel_expandable_error:nnnn #1#2#3#4
+ {
+ \__msg_kernel_expandable_error:nnnnnn
+ {#1} {#2} {#3} {#4} { } { }
+ }
+\cs_new:Npn \__msg_kernel_expandable_error:nnn #1#2#3
+ {
+ \__msg_kernel_expandable_error:nnnnnn
+ {#1} {#2} {#3} { } { } { }
+ }
+\cs_new:Npn \__msg_kernel_expandable_error:nn #1#2
+ {
+ \__msg_kernel_expandable_error:nnnnnn
+ {#1} {#2} { } { } { } { }
+ }
+\cs_new_protected:Npn \__msg_term:nnnnnn #1#2#3#4#5#6
+ {
+ \iow_wrap:nnnN
+ { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
+ { } { } \iow_term:n
+ }
+\cs_generate_variant:Nn \__msg_term:nnnnnn { nnnnnV }
+\cs_new_protected:Npn \__msg_term:nnnnn #1#2#3#4#5
+ { \__msg_term:nnnnnn {#1} {#2} {#3} {#4} {#5} { } }
+\cs_new_protected:Npn \__msg_term:nnn #1#2#3
+ { \__msg_term:nnnnnn {#1} {#2} {#3} { } { } { } }
+\cs_new_protected:Npn \__msg_term:nn #1#2
+ { \__msg_term:nnnnnn {#1} {#2} { } { } { } { } }
+\cs_new_protected:Npn \__msg_show_variable:Nnn #1#2#3
+ {
+ \cs_if_exist:NTF #1
+ {
+ \__msg_term:nnn { LaTeX / kernel } { show- #2 } {#1}
+ \__msg_show_variable:n {#3}
+ }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_new_protected:Npn \__msg_show_variable:n #1
+ { \iow_wrap:nnnN {#1} { } { } \__msg_show_variable_aux:n }
+\cs_new_protected:Npn \__msg_show_variable_aux:n #1
+ {
+ \tl_if_empty:nTF {#1}
+ { \tl_clear:N \l__msg_internal_tl }
+ { \tl_set:Nf \l__msg_internal_tl { \__msg_show_variable_aux:w #1 } }
+ \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
+ { \exp_after:wN \l__msg_internal_tl }
+ }
+\cs_new:Npn \__msg_show_variable_aux:w #1 > { }
+\cs_new:Npn \__msg_show_item:n #1
+ {
+ \\ > \ \ \{ \tl_to_str:n {#1} \}
+ }
+\cs_new:Npn \__msg_show_item:nn #1#2
+ {
+ \\ > \ \ \{ \tl_to_str:n {#1} \}
+ \ \ => \ \ \{ \tl_to_str:n {#2} \}
+ }
+\cs_new:Npn \__msg_show_item_unbraced:nn #1#2
+ {
+ \\ > \ \ \tl_to_str:n {#1}
+ \ \ => \ \ \tl_to_str:n {#2}
+ }
+%% File: l3file.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3file.dtx 4737 2014-05-05 07:37:48Z joseph $
+ {L3 File and I/O operations}
+\tl_new:N \g_file_current_name_tl
+\tl_gset_eq:NN \g_file_current_name_tl \@currname
+\seq_new:N \g__file_stack_seq
+\seq_new:N \g__file_record_seq
+\tl_new:N \l__file_internal_tl
+\tl_new:N \l__file_internal_name_tl
+\seq_new:N \l__file_search_path_seq
+\seq_new:N \l__file_saved_search_path_seq
+\seq_new:N \l__file_internal_seq
+\cs_new_protected:Npn \__file_name_sanitize:nn #1#2
+ {
+ \group_begin:
+ \seq_map_inline:Nn \l_char_active_seq
+ { \cs_set_nopar:Npx ##1 { \token_to_str:N ##1 } }
+ \tl_set:Nx \l__file_internal_name_tl {#1}
+ \tl_set:Nx \l__file_internal_name_tl
+ { \tl_to_str:N \l__file_internal_name_tl }
+ \tl_if_in:NnT \l__file_internal_name_tl { ~ }
+ {
+ \__msg_kernel_error:nnx { kernel } { space-in-file-name }
+ { \l__file_internal_name_tl }
+ \tl_remove_all:Nn \l__file_internal_name_tl { ~ }
+ }
+ \use:x
+ {
+ \group_end:
+ \exp_not:n {#2} { \l__file_internal_name_tl }
+ }
+ }
+\cs_new_protected:Npn \file_add_path:nN #1
+ { \__file_name_sanitize:nn {#1} { \__file_add_path:nN } }
+\cs_new_protected:Npn \__file_add_path:nN #1#2
+ {
+ \__ior_open:Nn \g__file_internal_ior {#1}
+ \ior_if_eof:NTF \g__file_internal_ior
+ { \__file_add_path_search:nN {#1} #2 }
+ { \tl_set:Nn #2 {#1} }
+ \ior_close:N \g__file_internal_ior
+ }
+\cs_new_protected:Npn \__file_add_path_search:nN #1#2
+ {
+ \tl_set:Nn #2 { \q_no_value }
+ \cs_if_exist:NT \input@path
+ {
+ \seq_set_eq:NN \l__file_saved_search_path_seq \l__file_search_path_seq
+ \seq_set_split:NnV \l__file_internal_seq { , } \input@path
+ \seq_concat:NNN \l__file_search_path_seq
+ \l__file_search_path_seq \l__file_internal_seq
+ }
+ \seq_map_inline:Nn \l__file_search_path_seq
+ {
+ \__ior_open:Nn \g__file_internal_ior { ##1 #1 }
+ \ior_if_eof:NF \g__file_internal_ior
+ {
+ \tl_set:Nx #2 { ##1 #1 }
+ \seq_map_break:
+ }
+ }
+ \cs_if_exist:NT \input@path
+ { \seq_set_eq:NN \l__file_search_path_seq \l__file_saved_search_path_seq }
+ }
+\prg_new_protected_conditional:Npnn \file_if_exist:n #1 { T , F , TF }
+ {
+ \file_add_path:nN {#1} \l__file_internal_name_tl
+ \quark_if_no_value:NTF \l__file_internal_name_tl
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+\cs_new_protected:Npn \file_input:n #1
+ {
+ \__file_if_exist:nT {#1}
+ { \__file_input:V \l__file_internal_name_tl }
+ }
+\cs_new_protected:Npn \__file_if_exist:nT #1#2
+ {
+ \file_add_path:nN {#1} \l__file_internal_name_tl
+ \quark_if_no_value:NTF \l__file_internal_name_tl
+ {
+ \__file_name_sanitize:nn {#1}
+ { \__msg_kernel_error:nnx { kernel } { file-not-found } }
+ }
+ { #2 }
+ }
+\cs_new_protected:Npn \__file_input:n #1
+ {
+ \tl_if_in:nnTF {#1} { . }
+ { \__file_input_aux:n {#1} }
+ { \__file_input_aux:o { \tl_to_str:n { #1 . tex } } }
+ }
+\cs_generate_variant:Nn \__file_input:n { V }
+\cs_new_protected:Npn \__file_input_aux:n #1
+ {
+ \clist_if_exist:NTF \@filelist
+ { \@addtofilelist {#1} }
+ { \seq_gput_right:Nn \g__file_record_seq {#1} }
+ \seq_gpush:No \g__file_stack_seq \g_file_current_name_tl
+ \tl_gset:Nn \g_file_current_name_tl {#1}
+ \tex_input:D #1 \c_space_tl
+ \seq_gpop:NN \g__file_stack_seq \l__file_internal_tl
+ \tl_gset_eq:NN \g_file_current_name_tl \l__file_internal_tl
+ }
+\cs_generate_variant:Nn \__file_input_aux:n { o }
+\cs_new_protected:Npn \file_path_include:n #1
+ { \__file_name_sanitize:nn {#1} { \__file_path_include:n } }
+\cs_new_protected:Npn \__file_path_include:n #1
+ {
+ \seq_if_in:NnF \l__file_search_path_seq {#1}
+ { \seq_put_right:Nn \l__file_search_path_seq {#1} }
+ }
+\cs_new_protected:Npn \file_path_remove:n #1
+ {
+ \__file_name_sanitize:nn {#1}
+ { \seq_remove_all:Nn \l__file_search_path_seq }
+ }
+\cs_new_protected_nopar:Npn \file_list:
+ {
+ \seq_set_eq:NN \l__file_internal_seq \g__file_record_seq
+ \clist_if_exist:NT \@filelist
+ {
+ \clist_map_inline:Nn \@filelist
+ {
+ \seq_put_right:No \l__file_internal_seq
+ { \tl_to_str:n {##1} }
+ }
+ }
+ \seq_remove_duplicates:N \l__file_internal_seq
+ \iow_log:n { *~File~List~* }
+ \seq_map_inline:Nn \l__file_internal_seq { \iow_log:n {##1} }
+ \iow_log:n { ************* }
+ }
+\AtBeginDocument
+ {
+ \clist_map_inline:Nn \@filelist
+ { \seq_gput_right:No \g__file_record_seq { \tl_to_str:n {#1} } }
+ }
+\cs_new_eq:NN \c_term_ior \c_sixteen
+\seq_new:N \g__ior_streams_seq
+\tl_new:N \l__ior_stream_tl
+\prop_new:N \g__ior_streams_prop
+\prop_gput:Nnn \g__ior_streams_prop { 0 } { LaTeX2e~reserved }
+\cs_new_protected:Npn \ior_new:N #1 { \cs_new_eq:NN #1 \c_term_ior }
+\cs_generate_variant:Nn \ior_new:N { c }
+\cs_new_protected:Npn \ior_open:Nn #1#2
+ { \__file_name_sanitize:nn {#2} { \__ior_open_aux:Nn #1 } }
+\cs_generate_variant:Nn \ior_open:Nn { c }
+\cs_new_protected:Npn \__ior_open_aux:Nn #1#2
+ {
+ \file_add_path:nN {#2} \l__file_internal_name_tl
+ \quark_if_no_value:NTF \l__file_internal_name_tl
+ { \__msg_kernel_error:nnx { kernel } { file-not-found } {#2} }
+ { \__ior_open:No #1 \l__file_internal_name_tl }
+ }
+\prg_new_protected_conditional:Npnn \ior_open:Nn #1#2 { T , F , TF }
+ { \__file_name_sanitize:nn {#2} { \__ior_open_aux:NnTF #1 } }
+\cs_generate_variant:Nn \ior_open:NnT { c }
+\cs_generate_variant:Nn \ior_open:NnF { c }
+\cs_generate_variant:Nn \ior_open:NnTF { c }
+\cs_new_protected:Npn \__ior_open_aux:NnTF #1#2
+ {
+ \file_add_path:nN {#2} \l__file_internal_name_tl
+ \quark_if_no_value:NTF \l__file_internal_name_tl
+ { \prg_return_false: }
+ {
+ \__ior_open:No #1 \l__file_internal_name_tl
+ \prg_return_true:
+ }
+ }
+\cs_new_protected:Npn \__ior_open:Nn #1#2
+ {
+ \ior_close:N #1
+ \seq_gpop:NNTF \g__ior_streams_seq \l__ior_stream_tl
+ { \__ior_open_stream:Nn #1 {#2} }
+ {
+ \cs:w newread \cs_end: #1
+ \tl_set:Nx \l__ior_stream_tl { \int_eval:n {#1} }
+ \__ior_open_stream:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__ior_open:Nn { No }
+\cs_new_protected:Npn \__ior_open_stream:Nn #1#2
+ {
+ \tex_global:D \tex_chardef:D #1 = \l__ior_stream_tl \scan_stop:
+ \prop_gput:NVn \g__ior_streams_prop #1 {#2}
+ \tex_openin:D #1 #2 \scan_stop:
+ }
+\cs_new_protected:Npn \ior_close:N #1
+ {
+ \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
+ {
+ \tex_closein:D #1
+ \prop_gremove:NV \g__ior_streams_prop #1
+ \seq_if_in:NVF \g__ior_streams_seq #1
+ { \seq_gpush:NV \g__ior_streams_seq #1 }
+ \cs_gset_eq:NN #1 \c_term_ior
+ }
+ }
+\cs_generate_variant:Nn \ior_close:N { c }
+\cs_new_protected_nopar:Npn \ior_list_streams:
+ { \__ior_list_streams:Nn \g__ior_streams_prop { input } }
+\cs_new_protected:Npn \__ior_list_streams:Nn #1#2
+ {
+ \__msg_term:nnn { LaTeX / kernel }
+ { \prop_if_empty:NTF #1 { show-no-stream } { show-open-streams } }
+ {#2}
+ \__msg_show_variable:n
+ { \prop_map_function:NN #1 \__msg_show_item_unbraced:nn }
+ }
+\cs_new_eq:NN \if_eof:w \tex_ifeof:D
+\prg_new_conditional:Nnn \ior_if_eof:N { p , T , F , TF }
+ {
+ \cs_if_exist:NTF #1
+ {
+ \if_int_compare:w #1 = \c_sixteen
+ \prg_return_true:
+ \else:
+ \if_eof:w #1
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ \fi:
+ }
+ { \prg_return_true: }
+ }
+\cs_new_protected:Npn \ior_get:NN #1#2
+ { \tex_read:D #1 to #2 }
+\cs_new_protected:Npn \ior_get_str:NN #1#2
+ {
+ \use:x
+ {
+ \int_set_eq:NN \tex_endlinechar:D \c_minus_one
+ \exp_not:n { \etex_readline:D #1 to #2 }
+ \int_set:Nn \tex_endlinechar:D { \int_use:N \tex_endlinechar:D }
+ }
+ }
+\ior_new:N \g__file_internal_ior
+\cs_new_eq:NN \c_log_iow \c_minus_one
+\cs_new_eq:NN \c_term_iow \c_sixteen
+\seq_new:N \g__iow_streams_seq
+\tl_new:N \l__iow_stream_tl
+\prop_new:N \g__iow_streams_prop
+\prop_put:Nnn \g__iow_streams_prop { 0 } { LaTeX2e~reserved }
+\prop_put:Nnn \g__iow_streams_prop { 1 } { LaTeX2e~reserved }
+\prop_put:Nnn \g__iow_streams_prop { 2 } { LaTeX2e~reserved }
+\cs_new_protected:Npn \iow_new:N #1 { \cs_new_eq:NN #1 \c_term_iow }
+\cs_generate_variant:Nn \iow_new:N { c }
+\cs_new_protected:Npn \iow_open:Nn #1#2
+ { \__file_name_sanitize:nn {#2} { \__iow_open:Nn #1 } }
+\cs_generate_variant:Nn \iow_open:Nn { c }
+\cs_new_protected:Npn \__iow_open:Nn #1#2
+ {
+ \iow_close:N #1
+ \seq_gpop:NNTF \g__iow_streams_seq \l__iow_stream_tl
+ { \__iow_open_stream:Nn #1 {#2} }
+ {
+ \cs:w newwrite \cs_end: #1
+ \tl_set:Nx \l__iow_stream_tl { \int_eval:n {#1} }
+ \__iow_open_stream:Nn #1 {#2}
+ }
+ }
+\cs_generate_variant:Nn \__iow_open:Nn { No }
+\cs_new_protected:Npn \__iow_open_stream:Nn #1#2
+ {
+ \tex_global:D \tex_chardef:D #1 = \l__iow_stream_tl \scan_stop:
+ \prop_gput:NVn \g__iow_streams_prop #1 {#2}
+ \tex_immediate:D \tex_openout:D #1 #2 \scan_stop:
+ }
+\cs_new_protected:Npn \iow_close:N #1
+ {
+ \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
+ {
+ \tex_immediate:D \tex_closeout:D #1
+ \prop_gremove:NV \g__iow_streams_prop #1
+ \seq_if_in:NVF \g__iow_streams_seq #1
+ { \seq_gpush:NV \g__iow_streams_seq #1 }
+ \cs_gset_eq:NN #1 \c_term_ior
+ }
+ }
+\cs_generate_variant:Nn \iow_close:N { c }
+\cs_new_protected_nopar:Npn \iow_list_streams:
+ { \__iow_list_streams:Nn \g__iow_streams_prop { output } }
+\cs_new_eq:NN \__iow_list_streams:Nn \__ior_list_streams:Nn
+\cs_new_protected:Npn \iow_shipout_x:Nn #1#2
+ { \tex_write:D #1 {#2} }
+\cs_generate_variant:Nn \iow_shipout_x:Nn { Nx }
+\cs_new_protected:Npn \iow_shipout:Nn #1#2
+ { \tex_write:D #1 { \exp_not:n {#2} } }
+\cs_generate_variant:Nn \iow_shipout:Nn { Nx }
+\cs_new_protected:Npn \iow_now:Nn #1#2
+ { \tex_immediate:D \tex_write:D #1 { \exp_not:n {#2} } }
+\cs_generate_variant:Nn \iow_now:Nn { Nx }
+\cs_set_protected_nopar:Npn \iow_log:x { \iow_now:Nx \c_log_iow }
+\cs_new_protected_nopar:Npn \iow_log:n { \iow_now:Nn \c_log_iow }
+\cs_set_protected_nopar:Npn \iow_term:x { \iow_now:Nx \c_term_iow }
+\cs_new_protected_nopar:Npn \iow_term:n { \iow_now:Nn \c_term_iow }
+\cs_new_nopar:Npn \iow_newline: { ^^J }
+\cs_new_eq:NN \iow_char:N \cs_to_str:N
+\int_new:N \l_iow_line_count_int
+\int_set:Nn \l_iow_line_count_int { 78 }
+\int_new:N \l__iow_target_count_int
+\int_new:N \l__iow_current_line_int
+\int_new:N \l__iow_current_word_int
+\int_new:N \l__iow_current_indentation_int
+\tl_new:N \l__iow_current_line_tl
+\tl_new:N \l__iow_current_word_tl
+\tl_new:N \l__iow_current_indentation_tl
+\tl_new:N \l__iow_wrap_tl
+\tl_new:N \l__iow_newline_tl
+\bool_new:N \l__iow_line_start_bool
+\group_begin:
+ \char_set_catcode_other:N \*
+ \char_set_lccode:nn {`\*} {`\ }
+ \tl_to_lowercase:n { \tl_const:Nn \c_catcode_other_space_tl { * } }
+\group_end:
+\group_begin:
+ \int_set_eq:NN \tex_escapechar:D \c_minus_one
+ \tl_const:Nx \c__iow_wrap_marker_tl
+ { \tl_to_str:n { \^^I \^^O \^^W \^^_ \^^W \^^R \^^A \^^P } }
+\group_end:
+\tl_map_inline:nn
+ { { end } { newline } { indent } { unindent } }
+ {
+ \tl_const:cx { c__iow_wrap_ #1 _marker_tl }
+ {
+ \c_catcode_other_space_tl
+ \c__iow_wrap_marker_tl
+ \c_catcode_other_space_tl
+ #1
+ \c_catcode_other_space_tl
+ }
+ }
+\cs_new_protected:Npn \iow_indent:n #1 { }
+\cs_new:Npx \__iow_indent:n #1
+ {
+ \c__iow_wrap_indent_marker_tl
+ #1
+ \c__iow_wrap_unindent_marker_tl
+ }
+\cs_new_protected:Npn \iow_wrap:nnnN #1#2#3#4
+ {
+ \group_begin:
+ \int_set_eq:NN \tex_escapechar:D \c_minus_one
+ \cs_set_nopar:Npx \{ { \token_to_str:N \{ }
+ \cs_set_nopar:Npx \# { \token_to_str:N \# }
+ \cs_set_nopar:Npx \} { \token_to_str:N \} }
+ \cs_set_nopar:Npx \% { \token_to_str:N \% }
+ \cs_set_nopar:Npx \~ { \token_to_str:N \~ }
+ \int_set:Nn \tex_escapechar:D { 92 }
+ \cs_set_eq:NN \\ \c__iow_wrap_newline_marker_tl
+ \cs_set_eq:NN \ \c_catcode_other_space_tl
+ \cs_set_eq:NN \iow_indent:n \__iow_indent:n
+ #3
+ \__iow_wrap_set:Nx \l__iow_wrap_tl {#1}
+ \tl_set:Nx \l__iow_newline_tl { \iow_newline: #2 }
+ \tl_set:Nx \l__iow_newline_tl { \tl_to_str:N \l__iow_newline_tl }
+ \tl_replace_all:Nnn \l__iow_newline_tl { ~ } { \c_space_tl }
+ \int_set:Nn \l__iow_target_count_int
+ { \l_iow_line_count_int - \tl_count:N \l__iow_newline_tl + \c_one }
+ \int_zero:N \l__iow_current_indentation_int
+ \tl_clear:N \l__iow_current_indentation_tl
+ \int_zero:N \l__iow_current_line_int
+ \tl_clear:N \l__iow_current_line_tl
+ \bool_set_true:N \l__iow_line_start_bool
+ \use:x
+ {
+ \exp_not:n { \tl_clear:N \l__iow_wrap_tl }
+ \__iow_wrap_loop:w
+ \tl_to_str:N \l__iow_wrap_tl
+ \tl_to_str:N \c__iow_wrap_end_marker_tl
+ \c_space_tl \c_space_tl
+ \exp_not:N \q_stop
+ }
+ \exp_args:NNo \group_end:
+ #4 \l__iow_wrap_tl
+ }
+\cs_new_eq:NN \__iow_wrap_set:Nx \protected@edef
+\cs_new_protected:Npn \__iow_wrap_loop:w #1 ~ %
+ {
+ \tl_set:Nn \l__iow_current_word_tl {#1}
+ \tl_if_eq:NNTF \l__iow_current_word_tl \c__iow_wrap_marker_tl
+ { \__iow_wrap_special:w }
+ { \__iow_wrap_word: }
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_word:
+ {
+ \int_set:Nn \l__iow_current_word_int
+ { \__str_count_ignore_spaces:N \l__iow_current_word_tl }
+ \int_add:Nn \l__iow_current_line_int { \l__iow_current_word_int }
+ \int_compare:nNnTF \l__iow_current_line_int < \l__iow_target_count_int
+ { \__iow_wrap_word_fits: }
+ { \__iow_wrap_word_newline: }
+ \__iow_wrap_loop:w
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_word_fits:
+ {
+ \bool_if:NTF \l__iow_line_start_bool
+ {
+ \bool_set_false:N \l__iow_line_start_bool
+ \tl_put_right:Nx \l__iow_current_line_tl
+ { \l__iow_current_indentation_tl \l__iow_current_word_tl }
+ \int_add:Nn \l__iow_current_line_int
+ { \l__iow_current_indentation_int }
+ }
+ {
+ \tl_put_right:Nx \l__iow_current_line_tl
+ { ~ \l__iow_current_word_tl }
+ \int_incr:N \l__iow_current_line_int
+ }
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_word_newline:
+ {
+ \tl_put_right:Nx \l__iow_wrap_tl
+ { \l__iow_current_line_tl \l__iow_newline_tl }
+ \int_set:Nn \l__iow_current_line_int
+ {
+ \l__iow_current_word_int
+ + \l__iow_current_indentation_int
+ }
+ \tl_set:Nx \l__iow_current_line_tl
+ { \l__iow_current_indentation_tl \l__iow_current_word_tl }
+ }
+\cs_new_protected:Npn \__iow_wrap_special:w #1 ~ #2 ~ #3 ~ %
+ {
+ \use:c { __iow_wrap_#1: }
+ \str_if_eq_x:nnTF { #2~#3 } { ~ \c__iow_wrap_marker_tl }
+ { \__iow_wrap_special:w }
+ { \__iow_wrap_loop:w #2 ~ #3 ~ }
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_newline:
+ {
+ \tl_put_right:Nx \l__iow_wrap_tl
+ { \l__iow_current_line_tl \l__iow_newline_tl }
+ \int_zero:N \l__iow_current_line_int
+ \tl_clear:N \l__iow_current_line_tl
+ \bool_set_true:N \l__iow_line_start_bool
+ }
+\cs_new_protected_nopar:Npx \__iow_wrap_indent:
+ {
+ \int_add:Nn \l__iow_current_indentation_int \c_four
+ \tl_put_right:Nx \exp_not:N \l__iow_current_indentation_tl
+ { \c_space_tl \c_space_tl \c_space_tl \c_space_tl }
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_unindent:
+ {
+ \int_sub:Nn \l__iow_current_indentation_int \c_four
+ \tl_set:Nx \l__iow_current_indentation_tl
+ { \prg_replicate:nn \l__iow_current_indentation_int { ~ } }
+ }
+\cs_new_protected_nopar:Npn \__iow_wrap_end:
+ {
+ \tl_put_right:Nx \l__iow_wrap_tl
+ { \l__iow_current_line_tl }
+ \use_none_delimit_by_q_stop:w
+ }
+\cs_new_nopar:Npn \__str_count_ignore_spaces:N
+ { \exp_args:No \__str_count_ignore_spaces:n }
+\cs_new:Npn \__str_count_ignore_spaces:n #1
+ {
+ \__int_value:w \__int_eval:w
+ \exp_after:wN \__str_count_loop:NNNNNNNNN \tl_to_str:n {#1}
+ { X8 } { X7 } { X6 } { X5 } { X4 } { X3 } { X2 } { X1 } { X0 } \q_stop
+ \__int_eval_end:
+ }
+\cs_new:Npn \__str_count_loop:NNNNNNNNN #1#2#3#4#5#6#7#8#9
+ {
+ \if_catcode:w X #9
+ \exp_after:wN \use_none_delimit_by_q_stop:w
+ \else:
+ 9 +
+ \exp_after:wN \__str_count_loop:NNNNNNNNN
+ \fi:
+ }
+\__msg_kernel_new:nnnn { kernel } { file-not-found }
+ { File~'#1'~not~found. }
+ {
+ The~requested~file~could~not~be~found~in~the~current~directory,~
+ in~the~TeX~search~path~or~in~the~LaTeX~search~path.
+ }
+\__msg_kernel_new:nnnn { kernel } { input-streams-exhausted }
+ { Input~streams~exhausted }
+ {
+ TeX~can~only~open~up~to~16~input~streams~at~one~time.\\
+ All~16~are~currently~in~use,~and~something~wanted~to~open~
+ another~one.
+ }
+\__msg_kernel_new:nnnn { kernel } { output-streams-exhausted }
+ { Output~streams~exhausted }
+ {
+ TeX~can~only~open~up~to~16~output~streams~at~one~time.\\
+ All~16~are~currently~in~use,~and~something~wanted~to~open~
+ another~one.
+ }
+\__msg_kernel_new:nnnn { kernel } { space-in-file-name }
+ { Space~in~file~name~'#1'. }
+ {
+ Spaces~are~not~permitted~in~files~loaded~by~LaTeX: \\
+ Further~errors~may~follow!
+ }
+%% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project
+%% (C) 2012-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3skip.dtx 4738 2014-05-05 08:00:05Z joseph $
+ {L3 Dimensions and skips}
+\cs_new_eq:NN \if_dim:w \tex_ifdim:D
+\cs_new_eq:NN \__dim_eval:w \etex_dimexpr:D
+\cs_new_eq:NN \__dim_eval_end: \tex_relax:D
+\cs_new_protected:Npn \dim_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs:w newdimen \cs_end: #1
+ }
+\cs_generate_variant:Nn \dim_new:N { c }
+\cs_new_protected:Npn \dim_const:Nn #1
+ {
+ \dim_new:N #1
+ \dim_gset:Nn #1
+ }
+\cs_generate_variant:Nn \dim_const:Nn { c }
+\cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_dim }
+\cs_new_protected:Npn \dim_gzero:N { \tex_global:D \dim_zero:N }
+\cs_generate_variant:Nn \dim_zero:N { c }
+\cs_generate_variant:Nn \dim_gzero:N { c }
+\cs_new_protected:Npn \dim_zero_new:N #1
+ { \dim_if_exist:NTF #1 { \dim_zero:N #1 } { \dim_new:N #1 } }
+\cs_new_protected:Npn \dim_gzero_new:N #1
+ { \dim_if_exist:NTF #1 { \dim_gzero:N #1 } { \dim_new:N #1 } }
+\cs_generate_variant:Nn \dim_zero_new:N { c }
+\cs_generate_variant:Nn \dim_gzero_new:N { c }
+\prg_new_eq_conditional:NNn \dim_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \dim_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_protected:Npn \dim_set:Nn #1#2
+ { #1 ~ \__dim_eval:w #2 \__dim_eval_end: }
+\cs_new_protected:Npn \dim_gset:Nn { \tex_global:D \dim_set:Nn }
+\cs_generate_variant:Nn \dim_set:Nn { c }
+\cs_generate_variant:Nn \dim_gset:Nn { c }
+\cs_new_protected:Npn \dim_set_eq:NN #1#2 { #1 = #2 }
+\cs_generate_variant:Nn \dim_set_eq:NN { c }
+\cs_generate_variant:Nn \dim_set_eq:NN { Nc , cc }
+\cs_new_protected:Npn \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
+\cs_generate_variant:Nn \dim_gset_eq:NN { c }
+\cs_generate_variant:Nn \dim_gset_eq:NN { Nc , cc }
+\cs_new_protected:Npn \dim_add:Nn #1#2
+ { \tex_advance:D #1 by \__dim_eval:w #2 \__dim_eval_end: }
+\cs_new_protected:Npn \dim_gadd:Nn { \tex_global:D \dim_add:Nn }
+\cs_generate_variant:Nn \dim_add:Nn { c }
+\cs_generate_variant:Nn \dim_gadd:Nn { c }
+\cs_new_protected:Npn \dim_sub:Nn #1#2
+ { \tex_advance:D #1 by - \__dim_eval:w #2 \__dim_eval_end: }
+\cs_new_protected:Npn \dim_gsub:Nn { \tex_global:D \dim_sub:Nn }
+\cs_generate_variant:Nn \dim_sub:Nn { c }
+\cs_generate_variant:Nn \dim_gsub:Nn { c }
+\cs_new:Npn \dim_abs:n #1
+ {
+ \exp_after:wN \__dim_abs:N
+ \dim_use:N \__dim_eval:w #1 \__dim_eval_end:
+ }
+\cs_new:Npn \__dim_abs:N #1
+ { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
+\cs_set:Npn \dim_max:nn #1#2
+ {
+ \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
+ \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
+ \dim_use:N \__dim_eval:w #2 ;
+ >
+ \__dim_eval_end:
+ }
+\cs_set:Npn \dim_min:nn #1#2
+ {
+ \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
+ \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
+ \dim_use:N \__dim_eval:w #2 ;
+ <
+ \__dim_eval_end:
+ }
+\cs_new:Npn \__dim_maxmin:wwN #1 ; #2 ; #3
+ {
+ \if_dim:w #1 #3 #2 ~
+ #1
+ \else:
+ #2
+ \fi:
+ }
+\cs_new:Npn \dim_ratio:nn #1#2
+ { \__dim_ratio:n {#1} / \__dim_ratio:n {#2} }
+\cs_new:Npn \__dim_ratio:n #1
+ { \__int_value:w \__dim_eval:w #1 \__dim_eval_end: }
+\prg_new_conditional:Npnn \dim_compare:nNn #1#2#3 { p , T , F , TF }
+ {
+ \if_dim:w \__dim_eval:w #1 #2 \__dim_eval:w #3 \__dim_eval_end:
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \dim_compare:n #1 { p , T , F , TF }
+ {
+ \exp_after:wN \__dim_compare:w
+ \dim_use:N \__dim_eval:w #1 \__prg_compare_error:
+ }
+\cs_new:Npn \__dim_compare:w #1 \__prg_compare_error:
+ {
+ \exp_after:wN \if_false: \tex_romannumeral:D -`0
+ \__dim_compare:wNN #1 ? { = \__dim_compare_end:w \else: } \q_stop
+ }
+\exp_args:Nno \use:nn
+ { \cs_new:Npn \__dim_compare:wNN #1 }
+ { \tl_to_str:n {pt} }
+ #2#3
+ {
+ \if_meaning:w = #3
+ \use:c { __dim_compare_#2:w }
+ \fi:
+ #1 pt \exp_stop_f:
+ \prg_return_false:
+ \exp_after:wN \use_none_delimit_by_q_stop:w
+ \fi:
+ \reverse_if:N \if_dim:w #1 pt #2
+ \exp_after:wN \__dim_compare:wNN
+ \dim_use:N \__dim_eval:w #3
+ }
+\cs_new:cpn { __dim_compare_ ! :w }
+ #1 \reverse_if:N #2 ! #3 = { #1 #2 = #3 }
+\cs_new:cpn { __dim_compare_ = :w }
+ #1 \__dim_eval:w = { #1 \__dim_eval:w }
+\cs_new:cpn { __dim_compare_ < :w }
+ #1 \reverse_if:N #2 < #3 = { #1 #2 > #3 }
+\cs_new:cpn { __dim_compare_ > :w }
+ #1 \reverse_if:N #2 > #3 = { #1 #2 < #3 }
+\cs_new:Npn \__dim_compare_end:w #1 \prg_return_false: #2 \q_stop
+ { #1 \prg_return_false: \else: \prg_return_true: \fi: }
+\cs_new:Npn \dim_case:nnTF #1
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} }
+ }
+\cs_new:Npn \dim_case:nnT #1#2#3
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} {#3} { }
+ }
+\cs_new:Npn \dim_case:nnF #1#2
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} { }
+ }
+\cs_new:Npn \dim_case:nn #1#2
+ {
+ \tex_romannumeral:D
+ \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} { } { }
+ }
+\cs_new:Npn \__dim_case:nnTF #1#2#3#4
+ { \__dim_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+\cs_new:Npn \__dim_case:nw #1#2#3
+ {
+ \dim_compare:nNnTF {#1} = {#2}
+ { \__dim_case_end:nw {#3} }
+ { \__dim_case:nw {#1} }
+ }
+\cs_new_eq:NN \__dim_case_end:nw \__prg_case_end:nw
+\cs_set:Npn \dim_while_do:nn #1#2
+ {
+ \dim_compare:nT {#1}
+ {
+ #2
+ \dim_while_do:nn {#1} {#2}
+ }
+ }
+\cs_set:Npn \dim_until_do:nn #1#2
+ {
+ \dim_compare:nF {#1}
+ {
+ #2
+ \dim_until_do:nn {#1} {#2}
+ }
+ }
+\cs_set:Npn \dim_do_while:nn #1#2
+ {
+ #2
+ \dim_compare:nT {#1}
+ { \dim_do_while:nn {#1} {#2} }
+ }
+\cs_set:Npn \dim_do_until:nn #1#2
+ {
+ #2
+ \dim_compare:nF {#1}
+ { \dim_do_until:nn {#1} {#2} }
+ }
+\cs_set:Npn \dim_while_do:nNnn #1#2#3#4
+ {
+ \dim_compare:nNnT {#1} #2 {#3}
+ {
+ #4
+ \dim_while_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_set:Npn \dim_until_do:nNnn #1#2#3#4
+ {
+ \dim_compare:nNnF {#1} #2 {#3}
+ {
+ #4
+ \dim_until_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_set:Npn \dim_do_while:nNnn #1#2#3#4
+ {
+ #4
+ \dim_compare:nNnT {#1} #2 {#3}
+ { \dim_do_while:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_set:Npn \dim_do_until:nNnn #1#2#3#4
+ {
+ #4
+ \dim_compare:nNnF {#1} #2 {#3}
+ { \dim_do_until:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_new:Npn \dim_eval:n #1
+ { \dim_use:N \__dim_eval:w #1 \__dim_eval_end: }
+\cs_new:Npn \__dim_strip_bp:n #1
+ {
+ \__dim_strip_pt:n
+ {
+ \__dim_eval:w ( #1 ) * 800 / 803 \__dim_eval_end:
+ }
+ }
+\cs_new:Npn \__dim_strip_pt:n #1
+ {
+ \exp_after:wN
+ \__dim_strip_pt:w \dim_use:N \__dim_eval:w #1 \__dim_eval_end: \q_stop
+ }
+\use:x
+ {
+ \cs_new:Npn \exp_not:N \__dim_strip_pt:w
+ ##1 . ##2 \tl_to_str:n { pt } ##3 \exp_not:N \q_stop
+ {
+ ##1
+ \exp_not:N \int_compare:nNnT {##2} > \c_zero
+ { . ##2 }
+ }
+ }
+\cs_new_eq:NN \dim_use:N \tex_the:D
+\cs_generate_variant:Nn \dim_use:N { c }
+\cs_new_eq:NN \dim_show:N \__kernel_register_show:N
+\cs_generate_variant:Nn \dim_show:N { c }
+\cs_new_protected:Npn \dim_show:n #1
+ { \etex_showtokens:D \exp_after:wN { \dim_use:N \__dim_eval:w #1 } }
+\dim_const:Nn \c_zero_dim { 0 pt }
+\dim_const:Nn \c_max_dim { 16383.99999 pt }
+\dim_new:N \l_tmpa_dim
+\dim_new:N \l_tmpb_dim
+\dim_new:N \g_tmpa_dim
+\dim_new:N \g_tmpb_dim
+\cs_new_protected:Npn \skip_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs:w newskip \cs_end: #1
+ }
+\cs_generate_variant:Nn \skip_new:N { c }
+\cs_new_protected:Npn \skip_const:Nn #1
+ {
+ \skip_new:N #1
+ \skip_gset:Nn #1
+ }
+\cs_generate_variant:Nn \skip_const:Nn { c }
+\cs_new_protected:Npn \skip_zero:N #1 { #1 \c_zero_skip }
+\cs_new_protected:Npn \skip_gzero:N { \tex_global:D \skip_zero:N }
+\cs_generate_variant:Nn \skip_zero:N { c }
+\cs_generate_variant:Nn \skip_gzero:N { c }
+\cs_new_protected:Npn \skip_zero_new:N #1
+ { \skip_if_exist:NTF #1 { \skip_zero:N #1 } { \skip_new:N #1 } }
+\cs_new_protected:Npn \skip_gzero_new:N #1
+ { \skip_if_exist:NTF #1 { \skip_gzero:N #1 } { \skip_new:N #1 } }
+\cs_generate_variant:Nn \skip_zero_new:N { c }
+\cs_generate_variant:Nn \skip_gzero_new:N { c }
+\prg_new_eq_conditional:NNn \skip_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \skip_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_protected:Npn \skip_set:Nn #1#2
+ { #1 ~ \etex_glueexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \skip_gset:Nn { \tex_global:D \skip_set:Nn }
+\cs_generate_variant:Nn \skip_set:Nn { c }
+\cs_generate_variant:Nn \skip_gset:Nn { c }
+\cs_new_protected:Npn \skip_set_eq:NN #1#2 { #1 = #2 }
+\cs_generate_variant:Nn \skip_set_eq:NN { c }
+\cs_generate_variant:Nn \skip_set_eq:NN { Nc , cc }
+\cs_new_protected:Npn \skip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
+\cs_generate_variant:Nn \skip_gset_eq:NN { c }
+\cs_generate_variant:Nn \skip_gset_eq:NN { Nc , cc }
+\cs_new_protected:Npn \skip_add:Nn #1#2
+ { \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \skip_gadd:Nn { \tex_global:D \skip_add:Nn }
+\cs_generate_variant:Nn \skip_add:Nn { c }
+\cs_generate_variant:Nn \skip_gadd:Nn { c }
+\cs_new_protected:Npn \skip_sub:Nn #1#2
+ { \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \skip_gsub:Nn { \tex_global:D \skip_sub:Nn }
+\cs_generate_variant:Nn \skip_sub:Nn { c }
+\cs_generate_variant:Nn \skip_gsub:Nn { c }
+\prg_new_conditional:Npnn \skip_if_eq:nn #1#2 { p , T , F , TF }
+ {
+ \if_int_compare:w
+ \pdftex_strcmp:D { \skip_eval:n { #1 } } { \skip_eval:n { #2 } }
+ = \c_zero
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_set_protected:Npn \__cs_tmp:w #1
+ {
+ \prg_new_conditional:Npnn \skip_if_finite:n ##1 { p , T , F , TF }
+ {
+ \exp_after:wN \__skip_if_finite:wwNw
+ \skip_use:N \etex_glueexpr:D ##1 ; \prg_return_false:
+ #1 ; \prg_return_true: \q_stop
+ }
+ \cs_new:Npn \__skip_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3}
+ }
+\exp_args:No \__cs_tmp:w { \tl_to_str:n { fil } }
+\cs_new:Npn \skip_eval:n #1
+ { \skip_use:N \etex_glueexpr:D #1 \scan_stop: }
+\cs_new_eq:NN \skip_use:N \tex_the:D
+\cs_generate_variant:Nn \skip_use:N { c }
+\cs_new_eq:NN \skip_horizontal:N \tex_hskip:D
+\cs_new:Npn \skip_horizontal:n #1
+ { \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: }
+\cs_new_eq:NN \skip_vertical:N \tex_vskip:D
+\cs_new:Npn \skip_vertical:n #1
+ { \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: }
+\cs_generate_variant:Nn \skip_horizontal:N { c }
+\cs_generate_variant:Nn \skip_vertical:N { c }
+\cs_new_eq:NN \skip_show:N \__kernel_register_show:N
+\cs_generate_variant:Nn \skip_show:N { c }
+\cs_new_protected:Npn \skip_show:n #1
+ { \etex_showtokens:D \exp_after:wN { \tex_the:D \etex_glueexpr:D #1 } }
+\skip_const:Nn \c_zero_skip { \c_zero_dim }
+\skip_const:Nn \c_max_skip { \c_max_dim }
+\skip_new:N \l_tmpa_skip
+\skip_new:N \l_tmpb_skip
+\skip_new:N \g_tmpa_skip
+\skip_new:N \g_tmpb_skip
+\cs_new_protected:Npn \muskip_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs:w newmuskip \cs_end: #1
+ }
+\cs_generate_variant:Nn \muskip_new:N { c }
+\cs_new_protected:Npn \muskip_const:Nn #1
+ {
+ \muskip_new:N #1
+ \muskip_gset:Nn #1
+ }
+\cs_generate_variant:Nn \muskip_const:Nn { c }
+\cs_new_protected:Npn \muskip_zero:N #1
+ { #1 \c_zero_muskip }
+\cs_new_protected:Npn \muskip_gzero:N { \tex_global:D \muskip_zero:N }
+\cs_generate_variant:Nn \muskip_zero:N { c }
+\cs_generate_variant:Nn \muskip_gzero:N { c }
+\cs_new_protected:Npn \muskip_zero_new:N #1
+ { \muskip_if_exist:NTF #1 { \muskip_zero:N #1 } { \muskip_new:N #1 } }
+\cs_new_protected:Npn \muskip_gzero_new:N #1
+ { \muskip_if_exist:NTF #1 { \muskip_gzero:N #1 } { \muskip_new:N #1 } }
+\cs_generate_variant:Nn \muskip_zero_new:N { c }
+\cs_generate_variant:Nn \muskip_gzero_new:N { c }
+\prg_new_eq_conditional:NNn \muskip_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \muskip_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_protected:Npn \muskip_set:Nn #1#2
+ { #1 ~ \etex_muexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \muskip_gset:Nn { \tex_global:D \muskip_set:Nn }
+\cs_generate_variant:Nn \muskip_set:Nn { c }
+\cs_generate_variant:Nn \muskip_gset:Nn { c }
+\cs_new_protected:Npn \muskip_set_eq:NN #1#2 { #1 = #2 }
+\cs_generate_variant:Nn \muskip_set_eq:NN { c }
+\cs_generate_variant:Nn \muskip_set_eq:NN { Nc , cc }
+\cs_new_protected:Npn \muskip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
+\cs_generate_variant:Nn \muskip_gset_eq:NN { c }
+\cs_generate_variant:Nn \muskip_gset_eq:NN { Nc , cc }
+\cs_new_protected:Npn \muskip_add:Nn #1#2
+ { \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \muskip_gadd:Nn { \tex_global:D \muskip_add:Nn }
+\cs_generate_variant:Nn \muskip_add:Nn { c }
+\cs_generate_variant:Nn \muskip_gadd:Nn { c }
+\cs_new_protected:Npn \muskip_sub:Nn #1#2
+ { \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: }
+\cs_new_protected:Npn \muskip_gsub:Nn { \tex_global:D \muskip_sub:Nn }
+\cs_generate_variant:Nn \muskip_sub:Nn { c }
+\cs_generate_variant:Nn \muskip_gsub:Nn { c }
+\cs_new:Npn \muskip_eval:n #1
+ { \muskip_use:N \etex_muexpr:D #1 \scan_stop: }
+\cs_new_eq:NN \muskip_use:N \tex_the:D
+\cs_generate_variant:Nn \muskip_use:N { c }
+\cs_new_eq:NN \muskip_show:N \__kernel_register_show:N
+\cs_generate_variant:Nn \muskip_show:N { c }
+\cs_new_protected:Npn \muskip_show:n #1
+ { \etex_showtokens:D \exp_after:wN { \tex_the:D \etex_muexpr:D #1 } }
+\muskip_const:Nn \c_zero_muskip { 0 mu }
+\muskip_const:Nn \c_max_muskip { 16383.99999 mu }
+\muskip_new:N \l_tmpa_muskip
+\muskip_new:N \l_tmpb_muskip
+\muskip_new:N \g_tmpa_muskip
+\muskip_new:N \g_tmpb_muskip
+\cs_new_eq:NN \dim_case:nnn \dim_case:nnF
+%% File: l3keys.dtx Copyright (C) 2006-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3keys.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Key-value interfaces}
+\int_new:N \g__keyval_level_int
+\tl_new:N \l__keyval_key_tl
+\tl_new:N \l__keyval_value_tl
+\tl_new:N \l__keyval_sanitise_tl
+\tl_new:N \l__keyval_parse_tl
+\group_begin:
+ \char_set_catcode_active:n { `\= }
+ \char_set_catcode_active:n { `\, }
+ \char_set_lccode:nn { `\8 } { `\= }
+ \char_set_lccode:nn { `\9 } { `\, }
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new_protected:Npn \__keyval_parse:n #1
+ {
+ \group_begin:
+ \tl_clear:N \l__keyval_sanitise_tl
+ \tl_set:Nn \l__keyval_sanitise_tl {#1}
+ \tl_replace_all:Nnn \l__keyval_sanitise_tl { = } { 8 }
+ \tl_replace_all:Nnn \l__keyval_sanitise_tl { , } { 9 }
+ \tl_clear:N \l__keyval_parse_tl
+ \exp_after:wN \__keyval_parse_elt:w \exp_after:wN
+ \q_nil \l__keyval_sanitise_tl 9 \q_recursion_tail 9 \q_recursion_stop
+ \exp_after:wN \group_end:
+ \l__keyval_parse_tl
+ }
+ }
+\cs_new_protected:Npn \__keyval_parse_elt:w #1 ,
+ {
+ \tl_if_blank:oTF { \use_none:n #1 }
+ { \__keyval_parse_elt:w \q_nil }
+ {
+ \quark_if_recursion_tail_stop:o { \use_ii:nn #1 }
+ \__keyval_split_key_value:w #1 = = \q_stop
+ \__keyval_parse_elt:w \q_nil
+ }
+ }
+\cs_new_protected:Npn \__keyval_split_key_value:w #1 = #2 \q_stop
+ {
+ \__keyval_split_key:n {#1}
+ \str_if_eq:nnTF {#2} { = }
+ {
+ \tl_put_right:Nx \l__keyval_parse_tl
+ {
+ \exp_not:c
+ { __keyval_key_no_value_elt_ \int_use:N \g__keyval_level_int :n }
+ { \exp_not:o \l__keyval_key_tl }
+ }
+ }
+ {
+ \__keyval_split_key_value:wTF #2 \q_no_value \q_stop
+ { \__keyval_split_value:w \q_nil #2 }
+ { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } }
+ }
+ }
+\cs_new:Npn \__keyval_split_key_value:wTF #1 = #2#3 \q_stop
+ { \tl_if_head_eq_meaning:nNTF {#3} \q_no_value }
+\cs_new_protected:Npn \__keyval_split_key:n #1
+ {
+ \quark_if_nil:oTF { \use_none:nnn #1 \q_nil \q_nil }
+ { \tl_set:Nx \l__keyval_key_tl { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
+ { \__keyval_split_key:w #1 \q_stop }
+ }
+\cs_new_protected:Npn \__keyval_split_key:w \q_nil #1 \q_stop
+ { \tl_set:Nx \l__keyval_key_tl { \tl_trim_spaces:n {#1} } }
+\cs_new_protected:Npn \__keyval_split_value:w #1 = =
+ {
+ \tl_put_right:Nx \l__keyval_parse_tl
+ {
+ \exp_not:c
+ { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn }
+ { \exp_not:o \l__keyval_key_tl }
+ }
+ \tl_set:Nx \l__keyval_value_tl
+ { \exp_not:o { \use_none:nnn #1 \q_nil \q_nil } }
+ \tl_if_empty:NTF \l__keyval_value_tl
+ { \tl_put_right:Nn \l__keyval_parse_tl { { } } }
+ {
+ \quark_if_nil:NTF \l__keyval_value_tl
+ {
+ \tl_put_right:Nx \l__keyval_parse_tl
+ { { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
+ }
+ { \__keyval_split_value_aux:w #1 \q_stop }
+ }
+ }
+\cs_new_protected:Npn \__keyval_split_value_aux:w \q_nil #1 \q_stop
+ {
+ \tl_set:Nx \l__keyval_value_tl { \tl_trim_spaces:n {#1} }
+ \tl_put_right:Nx \l__keyval_parse_tl
+ { { \exp_not:o \l__keyval_value_tl } }
+ }
+\cs_new_protected:Npn \keyval_parse:NNn #1#2#3
+ {
+ \int_gincr:N \g__keyval_level_int
+ \cs_gset_eq:cN
+ { __keyval_key_no_value_elt_ \int_use:N \g__keyval_level_int :n } #1
+ \cs_gset_eq:cN
+ { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn } #2
+ \__keyval_parse:n {#3}
+ \int_gdecr:N \g__keyval_level_int
+ }
+\__msg_kernel_new:nnnn { kernel } { misplaced-equals-sign }
+ { Misplaced~equals~sign~in~key-value~input~\msg_line_number: }
+ {
+ LaTeX~is~attempting~to~parse~some~key-value~input~but~found~
+ two~equals~signs~not~separated~by~a~comma.
+ }
+\tl_const:Nn \c__keys_code_root_tl { key~code~>~ }
+\tl_const:Nn \c__keys_info_root_tl { key~info~>~ }
+\tl_const:Nn \c__keys_props_root_tl { key~prop~>~ }
+\int_new:N \l_keys_choice_int
+\tl_new:N \l_keys_choice_tl
+\clist_new:N \l__keys_groups_clist
+\tl_new:N \l_keys_key_tl
+\tl_new:N \l__keys_module_tl
+\bool_new:N \l__keys_no_value_bool
+\bool_new:N \l__keys_only_known_bool
+\tl_new:N \l_keys_path_tl
+\tl_new:N \l__keys_property_tl
+\bool_new:N \l__keys_selective_bool
+\bool_new:N \l__keys_filtered_bool
+\seq_new:N \l__keys_selective_seq
+\tl_new:N \l__keys_unused_clist
+\tl_new:N \l_keys_value_tl
+\bool_new:N \l__keys_tmp_bool
+\cs_new_protected:Npn \keys_define:nn
+ { \__keys_define:onn \l__keys_module_tl }
+\cs_new_protected:Npn \__keys_define:nnn #1#2#3
+ {
+ \tl_set:Nx \l__keys_module_tl { \tl_to_str:n {#2} }
+ \keyval_parse:NNn \__keys_define_elt:n \__keys_define_elt:nn {#3}
+ \tl_set:Nn \l__keys_module_tl {#1}
+ }
+\cs_generate_variant:Nn \__keys_define:nnn { o }
+\cs_new_protected:Npn \__keys_define_elt:n #1
+ {
+ \bool_set_true:N \l__keys_no_value_bool
+ \__keys_define_elt_aux:nn {#1} { }
+ }
+\cs_new_protected:Npn \__keys_define_elt:nn #1#2
+ {
+ \bool_set_false:N \l__keys_no_value_bool
+ \__keys_define_elt_aux:nn {#1} {#2}
+ }
+\cs_new_protected:Npn \__keys_define_elt_aux:nn #1#2
+ {
+ \__keys_property_find:n {#1}
+ \cs_if_exist:cTF { \c__keys_props_root_tl \l__keys_property_tl }
+ { \__keys_define_key:n {#2} }
+ {
+ \str_if_eq_x:nnF { \l__keys_property_tl } { .abort: }
+ {
+ \__msg_kernel_error:nnxx { kernel } { property-unknown }
+ { \l__keys_property_tl } { \l_keys_path_tl }
+ }
+ }
+ }
+\cs_new_protected:Npn \__keys_property_find:n #1
+ {
+ \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / }
+ \tl_if_in:nnTF {#1} { . }
+ { \__keys_property_find:w #1 \q_stop }
+ {
+ \__msg_kernel_error:nnx { kernel } { key-no-property } {#1}
+ \tl_set:Nn \l__keys_property_tl { .abort: }
+ }
+ }
+\cs_new_protected:Npn \__keys_property_find:w #1 . #2 \q_stop
+ {
+ \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl \tl_to_str:n {#1} }
+ \tl_if_in:nnTF {#2} { . }
+ {
+ \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . }
+ \__keys_property_find:w #2 \q_stop
+ }
+ { \tl_set:Nn \l__keys_property_tl { . #2 } }
+ }
+\cs_new_protected:Npn \__keys_define_key:n #1
+ {
+ \bool_if:NTF \l__keys_no_value_bool
+ {
+ \exp_after:wN \__keys_define_key:w
+ \l__keys_property_tl \q_stop
+ { \use:c { \c__keys_props_root_tl \l__keys_property_tl } }
+ {
+ \__msg_kernel_error:nnxx { kernel }
+ { property-requires-value } { \l__keys_property_tl }
+ { \l_keys_path_tl }
+ }
+ }
+ { \use:c { \c__keys_props_root_tl \l__keys_property_tl } {#1} }
+ }
+\cs_new_protected:Npn \__keys_define_key:w #1 : #2 \q_stop
+ { \tl_if_empty:nTF {#2} }
+\cs_new_protected:Npn \__keys_bool_set:Nn #1#2
+ {
+ \bool_if_exist:NF #1 { \bool_new:N #1 }
+ \__keys_choice_make:
+ \__keys_cmd_set:nx { \l_keys_path_tl / true }
+ { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 }
+ \__keys_cmd_set:nx { \l_keys_path_tl / false }
+ { \exp_not:c { bool_ #2 set_false:N } \exp_not:N #1 }
+ \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
+ {
+ \__msg_kernel_error:nnx { kernel } { boolean-values-only }
+ { \l_keys_key_tl }
+ }
+ \__keys_default_set:n { true }
+ }
+\cs_generate_variant:Nn \__keys_bool_set:Nn { c }
+\cs_new_protected:Npn \__keys_bool_set_inverse:Nn #1#2
+ {
+ \bool_if_exist:NF #1 { \bool_new:N #1 }
+ \__keys_choice_make:
+ \__keys_cmd_set:nx { \l_keys_path_tl / true }
+ { \exp_not:c { bool_ #2 set_false:N } \exp_not:N #1 }
+ \__keys_cmd_set:nx { \l_keys_path_tl / false }
+ { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 }
+ \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
+ {
+ \__msg_kernel_error:nnx { kernel } { boolean-values-only }
+ { \l_keys_key_tl }
+ }
+ \__keys_default_set:n { true }
+ }
+\cs_generate_variant:Nn \__keys_bool_set_inverse:Nn { c }
+\cs_new_protected_nopar:Npn \__keys_choice_make:
+ {
+ \__keys_cmd_set:nn { \l_keys_path_tl }
+ { \__keys_choice_find:n {##1} }
+ \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
+ {
+ \__msg_kernel_error:nnxx { kernel } { key-choice-unknown }
+ { \l_keys_path_tl } {##1}
+ }
+ }
+\cs_new_protected:Npn \__keys_choices_make:nn #1#2
+ {
+ \__keys_choice_make:
+ \int_zero:N \l_keys_choice_int
+ \clist_map_inline:nn {#1}
+ {
+ \int_incr:N \l_keys_choice_int
+ \__keys_cmd_set:nx { \l_keys_path_tl / ##1 }
+ {
+ \tl_set:Nn \exp_not:N \l_keys_choice_tl {##1}
+ \int_set:Nn \exp_not:N \l_keys_choice_int
+ { \int_use:N \l_keys_choice_int }
+ \exp_not:n {#2}
+ }
+ }
+ }
+\cs_new_protected:Npn \__keys_cmd_set:nn #1#2
+ {
+ \prop_clear_new:c { \c__keys_info_root_tl #1 }
+ \cs_set:cpn { \c__keys_code_root_tl #1 } ##1 {#2}
+ }
+\cs_generate_variant:Nn \__keys_cmd_set:nn { nx , Vn , Vo }
+\cs_new_protected:Npn \__keys_default_set:n #1
+ {
+ \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
+ { \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } { default } {#1} }
+ }
+\cs_new_protected:Npn \__keys_groups_set:n #1
+ {
+ \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
+ {
+ \clist_set:Nn \l__keys_groups_clist {#1}
+ \prop_put:cnV { \c__keys_info_root_tl \l_keys_path_tl }
+ { groups } \l__keys_groups_clist
+ }
+ }
+\cs_new_protected:Npn \__keys_initialise:n #1
+ { \exp_after:wN \__keys_initialise:wn \l_keys_path_tl \q_stop {#1} }
+\cs_new_protected:Npn \__keys_initialise:wn #1 / #2 \q_stop #3
+ { \keys_set:nn {#1} { #2 = {#3} } }
+\cs_new_protected:Npn \__keys_meta_make:n #1
+ {
+ \__keys_cmd_set:Vo \l_keys_path_tl
+ { \exp_after:wN \keys_set:nn \exp_after:wN { \l__keys_module_tl } {#1} }
+ }
+\cs_new_protected:Npn \__keys_meta_make:nn #1#2
+ { \__keys_cmd_set:Vn \l_keys_path_tl { \keys_set:nn {#1} {#2} } }
+\cs_new:Npn \__keys_multichoice_find:n #1
+ { \clist_map_function:nN {#1} \__keys_choice_find:n }
+\cs_new_protected_nopar:Npn \__keys_multichoice_make:
+ {
+ \__keys_cmd_set:nn { \l_keys_path_tl }
+ { \__keys_multichoice_find:n {##1} }
+ \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
+ {
+ \__msg_kernel_error:nnxx { kernel } { key-choice-unknown }
+ { \l_keys_path_tl } {##1}
+ }
+ }
+\cs_new_protected:Npn \__keys_multichoices_make:nn #1#2
+ {
+ \__keys_multichoice_make:
+ \int_zero:N \l_keys_choice_int
+ \clist_map_inline:nn {#1}
+ {
+ \int_incr:N \l_keys_choice_int
+ \__keys_cmd_set:nx { \l_keys_path_tl / ##1 }
+ {
+ \tl_set:Nn \exp_not:N \l_keys_choice_tl {##1}
+ \int_set:Nn \exp_not:N \l_keys_choice_int
+ { \int_use:N \l_keys_choice_int }
+ \exp_not:n {#2}
+ }
+ }
+ }
+\cs_new_protected:Npn \__keys_value_requirement:n #1
+ {
+ \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
+ {
+ \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } { required }
+ \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } { forbidden }
+ \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } {#1} { true }
+ }
+ }
+\cs_new_protected:Npn \__keys_variable_set:NnnN #1#2#3#4
+ {
+ \use:c { #2_if_exist:NF } #1 { \use:c { #2 _new:N } #1 }
+ \__keys_cmd_set:nx { \l_keys_path_tl }
+ { \exp_not:c { #2 _ #3 set:N #4 } \exp_not:N #1 \exp_not:n { {##1} } }
+ }
+\cs_generate_variant:Nn \__keys_variable_set:NnnN { c }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set:N } #1
+ { \__keys_bool_set:Nn #1 { } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set:c } #1
+ { \__keys_bool_set:cn {#1} { } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset:N } #1
+ { \__keys_bool_set:Nn #1 { g } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset:c } #1
+ { \__keys_bool_set:cn {#1} { g } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_inverse:N } #1
+ { \__keys_bool_set_inverse:Nn #1 { } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_inverse:c } #1
+ { \__keys_bool_set_inverse:cn {#1} { } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_inverse:N } #1
+ { \__keys_bool_set_inverse:Nn #1 { g } }
+\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_inverse:c } #1
+ { \__keys_bool_set_inverse:cn {#1} { g } }
+\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .choice: }
+ { \__keys_choice_make: }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choices:nn } #1
+ { \__keys_choices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choices:Vn } #1
+ { \exp_args:NV \__keys_choices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choices:on } #1
+ { \exp_args:No \__keys_choices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choices:xn } #1
+ { \exp_args:Nx \__keys_choices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .code:n } #1
+ { \__keys_cmd_set:nn { \l_keys_path_tl } {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .clist_set:N } #1
+ { \__keys_variable_set:NnnN #1 { clist } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .clist_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { clist } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .clist_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { clist } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .clist_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { clist } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .default:n } #1
+ { \__keys_default_set:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .default:V } #1
+ { \exp_args:NV \__keys_default_set:n #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .default:o } #1
+ { \exp_args:No \__keys_default_set:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .default:x } #1
+ { \exp_args:Nx \__keys_default_set:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .dim_set:N } #1
+ { \__keys_variable_set:NnnN #1 { dim } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .dim_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { dim } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .dim_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { dim } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .dim_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { dim } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .fp_set:N } #1
+ { \__keys_variable_set:NnnN #1 { fp } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .fp_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { fp } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .fp_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { fp } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .fp_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { fp } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .groups:n } #1
+ { \__keys_groups_set:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .initial:n } #1
+ { \__keys_initialise:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .initial:V } #1
+ { \exp_args:NV \__keys_initialise:n #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .initial:o } #1
+ { \exp_args:No \__keys_initialise:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .initial:x } #1
+ { \exp_args:Nx \__keys_initialise:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .int_set:N } #1
+ { \__keys_variable_set:NnnN #1 { int } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .int_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { int } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .int_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { int } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .int_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { int } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .meta:n } #1
+ { \__keys_meta_make:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .meta:nn } #1
+ { \__keys_meta_make:nn #1 }
+\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .multichoice: }
+ { \__keys_multichoice_make: }
+\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:nn } #1
+ { \__keys_multichoices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:Vn } #1
+ { \exp_args:NV \__keys_multichoices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:on } #1
+ { \exp_args:No \__keys_multichoices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:xn } #1
+ { \exp_args:Nx \__keys_multichoices_make:nn #1 }
+\cs_new_protected:cpn { \c__keys_props_root_tl .skip_set:N } #1
+ { \__keys_variable_set:NnnN #1 { skip } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .skip_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { skip } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .skip_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { skip } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .skip_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { skip } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set:N } #1
+ { \__keys_variable_set:NnnN #1 { tl } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set:c } #1
+ { \__keys_variable_set:cnnN {#1} { tl } { } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set_x:N } #1
+ { \__keys_variable_set:NnnN #1 { tl } { } x }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set_x:c } #1
+ { \__keys_variable_set:cnnN {#1} { tl } { } x }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset:N } #1
+ { \__keys_variable_set:NnnN #1 { tl } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset:c } #1
+ { \__keys_variable_set:cnnN {#1} { tl } { g } n }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset_x:N } #1
+ { \__keys_variable_set:NnnN #1 { tl } { g } x }
+\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset_x:c } #1
+ { \__keys_variable_set:cnnN {#1} { tl } { g } x }
+\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_forbidden: }
+ { \__keys_value_requirement:n { forbidden } }
+\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_required: }
+ { \__keys_value_requirement:n { required } }
+\cs_new_protected_nopar:Npn \keys_set:nn
+ { \__keys_set:onn { \l__keys_module_tl } }
+\cs_new_protected:Npn \__keys_set:nnn #1#2#3
+ {
+ \tl_set:Nx \l__keys_module_tl { \tl_to_str:n {#2} }
+ \keyval_parse:NNn \__keys_set_elt:n \__keys_set_elt:nn {#3}
+ \tl_set:Nn \l__keys_module_tl {#1}
+ }
+\cs_generate_variant:Nn \keys_set:nn { nV , nv , no }
+\cs_generate_variant:Nn \__keys_set:nnn { o }
+\cs_new_protected_nopar:Npn \keys_set_known:nnN
+ { \__keys_set_known:onnN \l__keys_unused_clist }
+\cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no }
+\cs_new_protected:Npn \__keys_set_known:nnnN #1#2#3#4
+ {
+ \clist_clear:N \l__keys_unused_clist
+ \keys_set_known:nn {#2} {#3}
+ \tl_set:Nx #4 { \exp_not:o { \l__keys_unused_clist } }
+ \tl_set:Nn \l__keys_unused_clist {#1}
+ }
+\cs_generate_variant:Nn \__keys_set_known:nnnN { o }
+\cs_new_protected:Npn \keys_set_known:nn #1#2
+ {
+ \bool_set_true:N \l__keys_only_known_bool
+ \keys_set:nn {#1} {#2}
+ \bool_set_false:N \l__keys_only_known_bool
+ }
+\cs_generate_variant:Nn \keys_set_known:nn { nV , nv , no }
+\cs_new_protected_nopar:Npn \keys_set_filter:nnnN
+ { \__keys_set_filter:onnnN \l__keys_unused_clist }
+\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
+\cs_new_protected:Npn \__keys_set_filter:nnnnN #1#2#3#4#5
+ {
+ \clist_clear:N \l__keys_unused_clist
+ \keys_set_filter:nnn {#2} {#3} {#4}
+ \tl_set:Nx #5 { \exp_not:o { \l__keys_unused_clist } }
+ \tl_set:Nn \l__keys_unused_clist {#1}
+ }
+\cs_generate_variant:Nn \__keys_set_filter:nnnnN { o }
+\cs_new_protected:Npn \keys_set_filter:nnn #1#2#3
+ {
+ \bool_set_true:N \l__keys_selective_bool
+ \bool_set_true:N \l__keys_filtered_bool
+ \seq_set_from_clist:Nn \l__keys_selective_seq {#2}
+ \keys_set:nn {#1} {#3}
+ \bool_set_false:N \l__keys_selective_bool
+ }
+\cs_generate_variant:Nn \keys_set_filter:nnn { nnV , nnv , nno }
+\cs_new_protected:Npn \keys_set_groups:nnn #1#2#3
+ {
+ \bool_set_true:N \l__keys_selective_bool
+ \bool_set_false:N \l__keys_filtered_bool
+ \seq_set_from_clist:Nn \l__keys_selective_seq {#2}
+ \keys_set:nn {#1} {#3}
+ \bool_set_false:N \l__keys_selective_bool
+ }
+\cs_generate_variant:Nn \keys_set_groups:nnn { nnV , nnv , nno }
+\cs_new_protected:Npn \__keys_set_elt:n #1
+ {
+ \bool_set_true:N \l__keys_no_value_bool
+ \__keys_set_elt_aux:nn {#1} { }
+ }
+\cs_new_protected:Npn \__keys_set_elt:nn #1#2
+ {
+ \bool_set_false:N \l__keys_no_value_bool
+ \__keys_set_elt_aux:nn {#1} {#2}
+ }
+\cs_new_protected:Npn \__keys_set_elt_aux:nn #1#2
+ {
+ \tl_set:Nx \l_keys_key_tl { \tl_to_str:n {#1} }
+ \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / \l_keys_key_tl }
+ \__keys_value_or_default:n {#2}
+ \bool_if:NTF \l__keys_selective_bool
+ { \__keys_set_elt_selective: }
+ { \__keys_set_elt_aux: }
+ }
+\cs_new_protected_nopar:Npn \__keys_set_elt_aux:
+ {
+ \bool_if:nTF
+ {
+ \__keys_if_value_p:n { required } &&
+ \l__keys_no_value_bool
+ }
+ {
+ \__msg_kernel_error:nnx { kernel } { value-required }
+ { \l_keys_path_tl }
+ }
+ {
+ \bool_if:nTF
+ {
+ \__keys_if_value_p:n { forbidden } &&
+ ! \l__keys_no_value_bool
+ }
+ {
+ \__msg_kernel_error:nnxx { kernel } { value-forbidden }
+ { \l_keys_path_tl } { \l_keys_value_tl }
+ }
+ { \__keys_execute: }
+ }
+ }
+\cs_new_protected_nopar:Npn \__keys_set_elt_selective:
+ {
+ \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl }
+ {
+ \prop_get:cnNTF { \c__keys_info_root_tl \l_keys_path_tl }
+ { groups } \l__keys_groups_clist
+ { \__keys_check_groups: }
+ {
+ \bool_if:NTF \l__keys_filtered_bool
+ { \__keys_set_elt_aux: }
+ { \__keys_store_unused: }
+ }
+ }
+ {
+ \bool_if:NTF \l__keys_filtered_bool
+ { \__keys_set_elt_aux: }
+ { \__keys_store_unused: }
+ }
+ }
+\cs_new_protected_nopar:Npn \__keys_check_groups:
+ {
+ \bool_set_false:N \l__keys_tmp_bool
+ \seq_map_inline:Nn \l__keys_selective_seq
+ {
+ \clist_map_inline:Nn \l__keys_groups_clist
+ {
+ \str_if_eq:nnT {##1} {####1}
+ {
+ \bool_set_true:N \l__keys_tmp_bool
+ \clist_map_break:n { \seq_map_break: }
+ }
+ }
+ }
+ \bool_if:NTF \l__keys_tmp_bool
+ {
+ \bool_if:NTF \l__keys_filtered_bool
+ { \__keys_store_unused: }
+ { \__keys_set_elt_aux: }
+ }
+ {
+ \bool_if:NTF \l__keys_filtered_bool
+ { \__keys_set_elt_aux: }
+ { \__keys_store_unused: }
+ }
+ }
+\cs_new_protected:Npn \__keys_value_or_default:n #1
+ {
+ \bool_if:NTF \l__keys_no_value_bool
+ {
+ \prop_get:cnNF { \c__keys_info_root_tl \l_keys_path_tl }
+ { default } \l_keys_value_tl
+ { \tl_clear:N \l_keys_value_tl }
+ }
+ { \tl_set:Nn \l_keys_value_tl {#1} }
+ }
+\prg_new_conditional:Npnn \__keys_if_value:n #1 { p }
+ {
+ \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl }
+ {
+ \prop_if_in:cnTF { \c__keys_info_root_tl \l_keys_path_tl } {#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
+ }
+\cs_new_protected_nopar:Npn \__keys_execute:
+ { \__keys_execute:nn { \l_keys_path_tl } { \__keys_execute_unknown: } }
+\cs_new_protected_nopar:Npn \__keys_execute_unknown:
+ {
+ \bool_if:NTF \l__keys_only_known_bool
+ { \__keys_store_unused: }
+ {
+ \__keys_execute:nn { \l__keys_module_tl / unknown }
+ {
+ \__msg_kernel_error:nnxx { kernel } { key-unknown }
+ { \l_keys_path_tl } { \l__keys_module_tl }
+ }
+ }
+ }
+\cs_new:Npn \__keys_execute:nn #1#2
+ {
+ \cs_if_exist:cTF { \c__keys_code_root_tl #1 }
+ {
+ \exp_args:Nc \exp_args:No { \c__keys_code_root_tl #1 }
+ \l_keys_value_tl
+ }
+ {#2}
+ }
+\cs_new_protected_nopar:Npn \__keys_store_unused:
+ {
+ \clist_put_right:Nx \l__keys_unused_clist
+ {
+ \exp_not:o \l_keys_key_tl
+ \bool_if:NF \l__keys_no_value_bool
+ { = { \exp_not:o \l_keys_value_tl } }
+ }
+ }
+\cs_new:Npn \__keys_choice_find:n #1
+ {
+ \__keys_execute:nn { \l_keys_path_tl / \tl_to_str:n {#1} }
+ { \__keys_execute:nn { \l_keys_path_tl / unknown } { } }
+ }
+\prg_new_conditional:Npnn \keys_if_exist:nn #1#2 { p , T , F , TF }
+ {
+ \cs_if_exist:cTF { \c__keys_code_root_tl #1 / #2 }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+\prg_new_conditional:Npnn \keys_if_choice_exist:nnn #1#2#3 { p , T , F , TF }
+ {
+ \cs_if_exist:cTF { \c__keys_code_root_tl #1 / #2 / #3 }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+\cs_new_protected:Npn \keys_show:nn #1#2
+ { \cs_show:c { \c__keys_code_root_tl #1 / \tl_to_str:n {#2} } }
+\__msg_kernel_new:nnnn { kernel } { boolean-values-only }
+ { Key~'#1'~accepts~boolean~values~only. }
+ { The~key~'#1'~only~accepts~the~values~'true'~and~'false'. }
+\__msg_kernel_new:nnnn { kernel } { choice-unknown }
+ { Choice~'#2'~unknown~for~key~'#1'. }
+ {
+ The~key~'#1'~takes~a~limited~number~of~values.\\
+ The~input~given,~'#2',~is~not~on~the~list~accepted.
+ }
+\__msg_kernel_new:nnnn { kernel } { key-choice-unknown }
+ { Key~'#1'~accepts~only~a~fixed~set~of~choices. }
+ {
+ The~key~'#1'~only~accepts~predefined~values,~and~'#2'~is~not~one~of~these.
+ }
+\__msg_kernel_new:nnnn { kernel } { key-no-property }
+ { No~property~given~in~definition~of~key~'#1'. }
+ {
+ \c_msg_coding_error_text_tl
+ Inside~\keys_define:nn each~key~name~
+ needs~a~property: \\ \\
+ \iow_indent:n { #1 .<property> } \\ \\
+ LaTeX~did~not~find~a~'.'~to~indicate~the~start~of~a~property.
+ }
+\__msg_kernel_new:nnnn { kernel } { key-unknown }
+ { The~key~'#1'~is~unknown~and~is~being~ignored. }
+ {
+ The~module~'#2'~does~not~have~a~key~called~#1'.\\
+ Check~that~you~have~spelled~the~key~name~correctly.
+ }
+\__msg_kernel_new:nnnn { kernel } { property-requires-value }
+ { The~property~'#1'~requires~a~value. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~was~asked~to~set~property~'#1'~for~key~'#2'.\\
+ No~value~was~given~for~the~property,~and~one~is~required.
+ }
+\__msg_kernel_new:nnnn { kernel } { property-unknown }
+ { The~key~property~'#1'~is~unknown. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~set~the~property~'#1'~for~key~'#2':~
+ this~property~is~not~defined.
+ }
+\__msg_kernel_new:nnnn { kernel } { value-forbidden }
+ { The~key~'#1'~does~not~taken~a~value. }
+ {
+ The~key~'#1'~should~be~given~without~a~value.\\
+ LaTeX~will~ignore~the~given~value~'#2'.
+ }
+\__msg_kernel_new:nnnn { kernel } { value-required }
+ { The~key~'#1'~requires~a~value. }
+ {
+ The~key~'#1'~must~have~a~value.\\
+ No~value~was~present:~the~key~will~be~ignored.
+ }
+\cs_new_protected:Npn \__keys_choice_code_store:n #1
+ {
+ \cs_if_exist:cF
+ { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
+ {
+ \tl_new:c
+ { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
+ }
+ \tl_set:cn { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
+ {#1}
+ }
+\cs_generate_variant:Nn \__keys_choice_code_store:n { x }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choice_code:n } #1
+ { \__keys_choice_code_store:n {#1} }
+\cs_new_protected:cpn { \c__keys_props_root_tl .choice_code:x } #1
+ { \__keys_choice_code_store:x {#1} }
+\cs_new_protected:Npn \__keys_choices_generate:n #1
+ {
+ \cs_if_exist:cTF
+ { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
+ {
+ \__keys_choice_make:
+ \int_zero:N \l_keys_choice_int
+ \clist_map_function:nN {#1} \__keys_choices_generate_aux:n
+ }
+ {
+ \__msg_kernel_error:nnx { kernel }
+ { generate-choices-before-code } { \l_keys_path_tl }
+ }
+ }
+\cs_new_protected:Npn \__keys_choices_generate_aux:n #1
+ {
+ \int_incr:N \l_keys_choice_int
+ \__keys_cmd_set:nx { \l_keys_path_tl / #1 }
+ {
+ \tl_set:Nn \exp_not:N \l_keys_choice_tl {#1}
+ \int_set:Nn \exp_not:N \l_keys_choice_int
+ { \int_use:N \l_keys_choice_int }
+ \exp_not:v
+ { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
+ }
+ }
+\__msg_kernel_new:nnnn { kernel } { generate-choices-before-code }
+ { No~code~available~to~generate~choices~for~key~'#1'. }
+ {
+ \c_msg_coding_error_text_tl
+ Before~using~.generate_choices:n~the~code~should~be~defined~
+ with~'.choice_code:n'~or~'.choice_code:x'.
+ }
+\cs_new_protected:cpn { \c__keys_props_root_tl .generate_choices:n } #1
+ { \__keys_choices_generate:n {#1} }
+%% File: l3fp.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\GetIdInfo$Id: l3fp.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Floating points}
+%% File: l3fp-aux.dtx Copyright(C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_use_none_stop_f:n #1 { \exp_stop_f: }
+\cs_new:Npn \__fp_use_s:n #1 { #1; }
+\cs_new:Npn \__fp_use_s:nn #1#2 { #1#2; }
+\cs_new:Npn \__fp_use_none_until_s:w #1; { }
+\cs_new:Npn \__fp_use_i_until_s:nw #1#2; {#1}
+\cs_new:Npn \__fp_use_ii_until_s:nnw #1#2#3; {#2}
+\cs_new:Npn \__fp_reverse_args:Nww #1 #2; #3; { #1 #3; #2; }
+\cs_new:Npn \__fp_rrot:www #1; #2; #3; { #2; #3; #1; }
+\cs_new:Npn \__fp_use_i:ww #1; #2; { #1; }
+\cs_new:Npn \__fp_use_i:www #1; #2; #3; { #1; }
+\__scan_new:N \s__fp
+\cs_new_protected:Npn \__fp_chk:w #1 ;
+ {
+ \__msg_kernel_error:nnx { kernel } { misused-fp }
+ { \fp_to_tl:n { \s__fp \__fp_chk:w #1 ; } }
+ }
+\__scan_new:N \s__fp_mark
+\__scan_new:N \s__fp_stop
+\__scan_new:N \s__fp_invalid
+\__scan_new:N \s__fp_underflow
+\__scan_new:N \s__fp_overflow
+\__scan_new:N \s__fp_division
+\__scan_new:N \s__fp_exact
+\tl_const:Nn \c_zero_fp { \s__fp \__fp_chk:w 0 0 \s__fp_exact ; }
+\tl_const:Nn \c_minus_zero_fp { \s__fp \__fp_chk:w 0 2 \s__fp_exact ; }
+\tl_const:Nn \c_inf_fp { \s__fp \__fp_chk:w 2 0 \s__fp_exact ; }
+\tl_const:Nn \c_minus_inf_fp { \s__fp \__fp_chk:w 2 2 \s__fp_exact ; }
+\tl_const:Nn \c_nan_fp { \s__fp \__fp_chk:w 3 1 \s__fp_exact ; }
+\int_const:Nn \c__fp_max_exponent_int { 10000 }
+\cs_new:Npn \__fp_zero_fp:N #1 { \s__fp \__fp_chk:w 0 #1 \s__fp_underflow ; }
+\cs_new:Npn \__fp_inf_fp:N #1 { \s__fp \__fp_chk:w 2 #1 \s__fp_overflow ; }
+\cs_new:Npn \__fp_min_fp:N #1
+ {
+ \s__fp \__fp_chk:w 1 #1
+ { \int_eval:n { - \c__fp_max_exponent_int } }
+ {1000} {0000} {0000} {0000} ;
+ }
+\cs_new:Npn \__fp_max_fp:N #1
+ {
+ \s__fp \__fp_chk:w 1 #1
+ { \int_use:N \c__fp_max_exponent_int }
+ {9999} {9999} {9999} {9999} ;
+ }
+\cs_new:Npn \__fp_exponent:w \s__fp \__fp_chk:w #1
+ {
+ \if_meaning:w 1 #1
+ \exp_after:wN \__fp_use_ii_until_s:nnw
+ \else:
+ \exp_after:wN \__fp_use_i_until_s:nw
+ \exp_after:wN 0
+ \fi:
+ }
+\cs_new:Npn \__fp_neg_sign:N #1
+ { \__int_eval:w \c_two - #1 \__int_eval_end: }
+\cs_new:Npn \__fp_sanitize:Nw #1 #2;
+ {
+ \if_case:w \if_int_compare:w #2 > \c__fp_max_exponent_int \c_one \else:
+ \if_int_compare:w #2 < - \c__fp_max_exponent_int \c_two \else:
+ \if_meaning:w 1 #1 \c_three \else: \c_zero \fi: \fi: \fi:
+ \or: \exp_after:wN \__fp_overflow:w
+ \or: \exp_after:wN \__fp_underflow:w
+ \or: \exp_after:wN \__fp_sanitize_zero:w
+ \fi:
+ \s__fp \__fp_chk:w 1 #1 {#2}
+ }
+\cs_new:Npn \__fp_sanitize:wN #1; #2 { \__fp_sanitize:Nw #2 #1; }
+\cs_new:Npn \__fp_sanitize_zero:w \s__fp \__fp_chk:w #1 #2 #3; { \c_zero_fp }
+\cs_new:Npn \__fp_exp_after_o:w \s__fp \__fp_chk:w #1
+ {
+ \if_meaning:w 1 #1
+ \exp_after:wN \__fp_exp_after_normal:nNNw
+ \else:
+ \exp_after:wN \__fp_exp_after_special:nNNw
+ \fi:
+ { }
+ #1
+ }
+\cs_new:Npn \__fp_exp_after_o:nw #1 \s__fp \__fp_chk:w #2
+ {
+ \if_meaning:w 1 #2
+ \exp_after:wN \__fp_exp_after_normal:nNNw
+ \else:
+ \exp_after:wN \__fp_exp_after_special:nNNw
+ \fi:
+ { #1 }
+ #2
+ }
+\cs_new:Npn \__fp_exp_after_f:nw #1 \s__fp \__fp_chk:w #2
+ {
+ \if_meaning:w 1 #2
+ \exp_after:wN \__fp_exp_after_normal:nNNw
+ \else:
+ \exp_after:wN \__fp_exp_after_special:nNNw
+ \fi:
+ { \tex_romannumeral:D -`0 #1 }
+ #2
+ }
+\cs_new:Npn \__fp_exp_after_special:nNNw #1#2#3#4;
+ {
+ \exp_after:wN \s__fp
+ \exp_after:wN \__fp_chk:w
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \exp_after:wN #4
+ \exp_after:wN ;
+ #1
+ }
+\cs_new:Npn \__fp_exp_after_normal:nNNw #1 1 #2 #3 #4#5#6#7;
+ {
+ \exp_after:wN \__fp_exp_after_normal:Nwwwww
+ \exp_after:wN #2
+ \__int_value:w #3 \exp_after:wN ;
+ \__int_value:w 1 #4 \exp_after:wN ;
+ \__int_value:w 1 #5 \exp_after:wN ;
+ \__int_value:w 1 #6 \exp_after:wN ;
+ \__int_value:w 1 #7 \exp_after:wN ; #1
+ }
+\cs_new:Npn \__fp_exp_after_normal:Nwwwww
+ #1 #2; 1 #3 ; 1 #4 ; 1 #5 ; 1 #6 ;
+ { \s__fp \__fp_chk:w 1 #1 {#2} {#3} {#4} {#5} {#6} ; }
+\cs_new:Npn \__fp_exp_after_array_f:w #1
+ {
+ \cs:w __fp_exp_after \__fp_type_from_scan:N #1 _f:nw \cs_end:
+ { \__fp_exp_after_array_f:w }
+ #1
+ }
+\cs_new_eq:NN \__fp_exp_after_stop_f:nw \use_none:nn
+\int_const:Nn \c__fp_leading_shift_int { - 5 0000 }
+\int_const:Nn \c__fp_middle_shift_int { 5 0000 * 9999 }
+\int_const:Nn \c__fp_trailing_shift_int { 5 0000 * 10000 }
+\cs_new:Npn \__fp_pack:NNNNNw #1 #2#3#4#5 #6; { + #1#2#3#4#5 ; {#6} }
+\int_const:Nn \c__fp_big_leading_shift_int { - 15 2374 }
+\int_const:Nn \c__fp_big_middle_shift_int { 15 2374 * 9999 }
+\int_const:Nn \c__fp_big_trailing_shift_int { 15 2374 * 10000 }
+\cs_new:Npn \__fp_pack_big:NNNNNNw #1#2 #3#4#5#6 #7;
+ { + #1#2#3#4#5#6 ; {#7} }
+\int_const:Nn \c__fp_Bigg_leading_shift_int { - 20 0000 }
+\int_const:Nn \c__fp_Bigg_middle_shift_int { 20 0000 * 9999 }
+\int_const:Nn \c__fp_Bigg_trailing_shift_int { 20 0000 * 10000 }
+\cs_new:Npn \__fp_pack_Bigg:NNNNNNw #1#2 #3#4#5#6 #7;
+ { + #1#2#3#4#5#6 ; {#7} }
+\cs_new:Npn \__fp_pack_twice_four:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9
+ { #1 {#2#3#4#5} {#6#7#8#9} ; }
+\cs_new:Npn \__fp_pack_eight:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9
+ { #1 {#2#3#4#5#6#7#8#9} ; }
+\cs_new:Npn \__fp_decimate:nNnnnn #1
+ {
+ \cs:w
+ __fp_decimate_
+ \if_int_compare:w \__int_eval:w #1 > \c_sixteen
+ tiny
+ \else:
+ \tex_romannumeral:D \__int_eval:w #1
+ \fi:
+ :Nnnnn
+ \cs_end:
+ }
+\cs_new:Npn \__fp_decimate_:Nnnnn #1 #2#3#4#5
+ { #1 0 {#2#3} {#4#5} ; }
+\cs_new:Npn \__fp_decimate_tiny:Nnnnn #1 #2#3#4#5
+ { #1 1 { 0000 0000 } { 0000 0000 } 0 #2#3#4#5 ; }
+\cs_new:Npn \__fp_tmp:w #1 #2 #3
+ {
+ \cs_new:cpn { __fp_decimate_ #1 :Nnnnn } ##1 ##2##3##4##5
+ {
+ \exp_after:wN ##1
+ \__int_value:w
+ \exp_after:wN \__fp_round_digit:Nw #2 ;
+ \__fp_decimate_pack:nnnnnnnnnnw #3 ;
+ }
+ }
+\__fp_tmp:w {i} {\use_none:nnn #50} { 0{#2}#3{#4}#5 }
+\__fp_tmp:w {ii} {\use_none:nn #5 } { 00{#2}#3{#4}#5 }
+\__fp_tmp:w {iii} {\use_none:n #5 } { 000{#2}#3{#4}#5 }
+\__fp_tmp:w {iv} { #5 } { {0000}#2{#3}#4 #5 }
+\__fp_tmp:w {v} {\use_none:nnn #4#5 } { 0{0000}#2{#3}#4 #5 }
+\__fp_tmp:w {vi} {\use_none:nn #4#5 } { 00{0000}#2{#3}#4 #5 }
+\__fp_tmp:w {vii} {\use_none:n #4#5 } { 000{0000}#2{#3}#4 #5 }
+\__fp_tmp:w {viii}{ #4#5 } { {0000}0000{#2}#3 #4 #5 }
+\__fp_tmp:w {ix} {\use_none:nnn #3#4+#5} { 0{0000}0000{#2}#3 #4 #5 }
+\__fp_tmp:w {x} {\use_none:nn #3#4+#5} { 00{0000}0000{#2}#3 #4 #5 }
+\__fp_tmp:w {xi} {\use_none:n #3#4+#5} { 000{0000}0000{#2}#3 #4 #5 }
+\__fp_tmp:w {xii} { #3#4+#5} { {0000}0000{0000}#2 #3 #4 #5 }
+\__fp_tmp:w {xiii}{\use_none:nnn#2#3+#4#5} { 0{0000}0000{0000}#2 #3 #4 #5 }
+\__fp_tmp:w {xiv} {\use_none:nn #2#3+#4#5} { 00{0000}0000{0000}#2 #3 #4 #5 }
+\__fp_tmp:w {xv} {\use_none:n #2#3+#4#5} { 000{0000}0000{0000}#2 #3 #4 #5 }
+\__fp_tmp:w {xvi} { #2#3+#4#5} {{0000}0000{0000}0000 #2 #3 #4 #5 }
+\cs_new:Npn \__fp_decimate_pack:nnnnnnnnnnw #1#2#3#4#5
+ { \__fp_decimate_pack:nnnnnnw { #1#2#3#4#5 } }
+\cs_new:Npn \__fp_decimate_pack:nnnnnnw #1 #2#3#4#5#6
+ { {#1} {#2#3#4#5#6} }
+\cs_new:Npn \__fp_case_use:nw #1#2 \fi: #3 \s__fp { \fi: #1 \s__fp }
+\cs_new:Npn \__fp_case_return:nw #1#2 \fi: #3 ; { \fi: #1 }
+\cs_new:Npn \__fp_case_return_o:Nw #1#2 \fi: #3 \s__fp #4 ;
+ { \fi: \exp_after:wN #1 }
+\cs_new:Npn \__fp_case_return_same_o:w #1 \fi: #2 \s__fp
+ { \fi: \__fp_exp_after_o:w \s__fp }
+\cs_new:Npn \__fp_case_return_o:Nww #1#2 \fi: #3 \s__fp #4 ; #5 ;
+ { \fi: \exp_after:wN #1 }
+\cs_new:Npn \__fp_case_return_i_o:ww #1 \fi: #2 \s__fp #3 ; \s__fp #4 ;
+ { \fi: \__fp_exp_after_o:w \s__fp #3 ; }
+\cs_new:Npn \__fp_case_return_ii_o:ww #1 \fi: #2 \s__fp #3 ;
+ { \fi: \__fp_exp_after_o:w }
+\cs_new:Npn \__fp_small_int:wTF \s__fp \__fp_chk:w #1#2
+ {
+ \if_case:w #1 \exp_stop_f:
+ \__fp_case_return:nw { \__fp_small_int_true:wTF 0 ; }
+ \or: \exp_after:wN \__fp_small_int_normal:NnwTF
+ \or:
+ \__fp_case_return:nw
+ {
+ \exp_after:wN \__fp_small_int_true:wTF \__int_value:w
+ \if_meaning:w 2 #2 - \fi: 1 0000 0000 ;
+ }
+ \else: \__fp_case_return:nw \use_ii:nn
+ \fi:
+ #2
+ }
+\cs_new:Npn \__fp_small_int_true:wTF #1; #2#3 { #2 {#1} }
+\cs_new:Npn \__fp_small_int_normal:NnwTF #1#2#3;
+ {
+ \if_int_compare:w #2 > \c_zero
+ \__fp_decimate:nNnnnn { \c_sixteen - #2 }
+ \__fp_small_int_test:NnnwNnw
+ #3 #1 {#2}
+ \else:
+ \exp_after:wN \use_iii:nnn
+ \fi:
+ ;
+ }
+\cs_new:Npn \__fp_small_int_test:NnnwNnw #1#2#3#4; #5#6
+ {
+ \if_meaning:w 0 #1
+ \exp_after:wN \__fp_small_int_true:wTF
+ \__int_value:w \if_meaning:w 2 #5 - \fi:
+ \if_int_compare:w #6 > \c_eight
+ 1 0000 0000
+ \else:
+ #3
+ \fi:
+ \else:
+ \use_i:nn
+ \fi:
+ }
+\cs_new:Npn \__fp_array_count:n #1
+ {
+ \int_use:N \__int_eval:w \c_zero
+ \__fp_array_count_loop:Nw #1 { ? \__prg_break: } ;
+ \__prg_break_point:
+ \__int_eval_end:
+ }
+\cs_new:Npn \__fp_array_count_loop:Nw #1#2;
+ { \use_none:n #1 + \c_one \__fp_array_count_loop:Nw }
+\cs_new:Npn \__fp_expand:n #1
+ {
+ \__fp_expand_loop:nwnN { }
+ #1 \prg_do_nothing:
+ \s__fp_mark { } \__fp_expand_loop:nwnN
+ \s__fp_mark { } \__fp_use_i_until_s:nw ;
+ }
+\cs_new:Npn \__fp_expand_loop:nwnN #1#2 \s__fp_mark #3 #4
+ {
+ \exp_after:wN #4 \tex_romannumeral:D -`0
+ #2
+ \s__fp_mark { #3 #1 } #4
+ }
+\__msg_kernel_new:nnnn { kernel } { misused-fp }
+ { A~floating~point~with~value~'#1'~was~misused. }
+ {
+ To~obtain~the~value~of~a~floating~point~variable,~use~
+ '\token_to_str:N \fp_to_decimal:N',~
+ '\token_to_str:N \fp_to_scientific:N',~or~other~
+ conversion~functions.
+ }
+%%
+%% File: l3fp-traps.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new_protected:Npn \fp_flag_off:n #1
+ { \cs_set_eq:cN { l__fp_ #1 _flag_token } \tex_undefined:D }
+\cs_new:Npn \fp_flag_on:n #1
+ { \exp_args:Nc \use_none:n { l__fp_ #1 _flag_token } }
+\prg_new_conditional:Npnn \fp_if_flag_on:n #1 { p , T , F , TF }
+ {
+ \if_cs_exist:w l__fp_ #1 _flag_token \cs_end:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new_eq:NN \l__fp_invalid_operation_flag_token \tex_undefined:D
+\cs_new_eq:NN \l__fp_division_by_zero_flag_token \tex_undefined:D
+\cs_new_eq:NN \l__fp_overflow_flag_token \tex_undefined:D
+\cs_new_eq:NN \l__fp_underflow_flag_token \tex_undefined:D
+\cs_new_protected:Npn \fp_trap:nn #1#2
+ {
+ \cs_if_exist_use:cF { __fp_trap_#1_set_#2: }
+ {
+ \clist_if_in:nnTF
+ { invalid_operation , division_by_zero , overflow , underflow }
+ {#1}
+ {
+ \__msg_kernel_error:nnxx { kernel }
+ { unknown-fpu-trap-type } {#1} {#2}
+ }
+ { \__msg_kernel_error:nnx { kernel } { unknown-fpu-exception } {#1} }
+ }
+ }
+\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_error:
+ { \__fp_trap_invalid_operation_set:N \prg_do_nothing: }
+\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_flag:
+ { \__fp_trap_invalid_operation_set:N \use_none:nnnnn }
+\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_none:
+ { \__fp_trap_invalid_operation_set:N \use_none:nnnnnnn }
+\cs_new_protected:Npn \__fp_trap_invalid_operation_set:N #1
+ {
+ \exp_args:Nno \use:n
+ { \cs_set:Npn \__fp_invalid_operation:nnw ##1##2##3; }
+ {
+ #1
+ \__fp_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { }
+ \fp_flag_on:n { invalid_operation }
+ ##1
+ }
+ \exp_args:Nno \use:n
+ { \cs_set:Npn \__fp_invalid_operation_o:Nww ##1##2; ##3; }
+ {
+ #1
+ \__fp_error:nffn { invalid-ii }
+ { \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1}
+ \fp_flag_on:n { invalid_operation }
+ \exp_after:wN \c_nan_fp
+ }
+ \exp_args:Nno \use:n
+ { \cs_set:Npn \__fp_invalid_operation_tl_o:ff ##1##2 }
+ {
+ #1
+ \__fp_error:nffn { invalid } {##1} {##2} { }
+ \fp_flag_on:n { invalid_operation }
+ \exp_after:wN \c_nan_fp
+ }
+ }
+\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_error:
+ { \__fp_trap_division_by_zero_set:N \prg_do_nothing: }
+\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_flag:
+ { \__fp_trap_division_by_zero_set:N \use_none:nnnnn }
+\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_none:
+ { \__fp_trap_division_by_zero_set:N \use_none:nnnnnnn }
+\cs_new_protected:Npn \__fp_trap_division_by_zero_set:N #1
+ {
+ \exp_args:Nno \use:n
+ { \cs_set:Npn \__fp_division_by_zero_o:Nnw ##1##2##3; }
+ {
+ #1
+ \__fp_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { }
+ \fp_flag_on:n { division_by_zero }
+ \exp_after:wN ##1
+ }
+ \exp_args:Nno \use:n
+ { \cs_set:Npn \__fp_division_by_zero_o:NNww ##1##2##3; ##4; }
+ {
+ #1
+ \__fp_error:nffn { zero-div-ii }
+ { \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2}
+ \fp_flag_on:n { division_by_zero }
+ \exp_after:wN ##1
+ }
+ }
+\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_error:
+ { \__fp_trap_overflow_set:N \prg_do_nothing: }
+\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_flag:
+ { \__fp_trap_overflow_set:N \use_none:nnnnn }
+\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_none:
+ { \__fp_trap_overflow_set:N \use_none:nnnnnnn }
+\cs_new_protected:Npn \__fp_trap_overflow_set:N #1
+ { \__fp_trap_overflow_set:NnNn #1 { overflow } \__fp_inf_fp:N { inf } }
+\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_error:
+ { \__fp_trap_underflow_set:N \prg_do_nothing: }
+\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_flag:
+ { \__fp_trap_underflow_set:N \use_none:nnnnn }
+\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_none:
+ { \__fp_trap_underflow_set:N \use_none:nnnnnnn }
+\cs_new_protected:Npn \__fp_trap_underflow_set:N #1
+ { \__fp_trap_overflow_set:NnNn #1 { underflow } \__fp_zero_fp:N { 0 } }
+\cs_new_protected:Npn \__fp_trap_overflow_set:NnNn #1#2#3#4
+ {
+ \exp_args:Nno \use:n
+ { \cs_set:cpn { __fp_ #2 :w } \s__fp \__fp_chk:w ##1##2##3; }
+ {
+ #1
+ \__fp_error:nffn
+ { flow \if_meaning:w 1 ##1 -to \fi: }
+ { \fp_to_tl:n { \s__fp \__fp_chk:w ##1##2##3; } }
+ { \token_if_eq_meaning:NNF 0 ##2 { - } #4 }
+ {#2}
+ \fp_flag_on:n {#2}
+ #3 ##2
+ }
+ }
+\cs_new:Npn \__fp_invalid_operation:nnw #1#2#3; { }
+\cs_new:Npn \__fp_invalid_operation_o:Nww #1#2; #3; { }
+\cs_new:Npn \__fp_invalid_operation_tl_o:ff #1 #2 { }
+\cs_new:Npn \__fp_division_by_zero_o:Nnw #1#2#3; { }
+\cs_new:Npn \__fp_division_by_zero_o:NNww #1#2#3; #4; { }
+\cs_new:Npn \__fp_overflow:w { }
+\cs_new:Npn \__fp_underflow:w { }
+\fp_trap:nn { invalid_operation } { error }
+\fp_trap:nn { division_by_zero } { flag }
+\fp_trap:nn { overflow } { flag }
+\fp_trap:nn { underflow } { flag }
+\cs_new_nopar:Npn \__fp_invalid_operation_o:nw
+ { \__fp_invalid_operation:nnw { \exp_after:wN \c_nan_fp } }
+\cs_generate_variant:Nn \__fp_invalid_operation_o:nw { f }
+\cs_new:Npn \__fp_error:nnnn #1
+ { \__msg_kernel_expandable_error:nnnnn { kernel } { fp - #1 } }
+\cs_generate_variant:Nn \__fp_error:nnnn { nnf, nff }
+\__msg_kernel_new:nnnn { kernel } { unknown-fpu-exception }
+ { The~FPU~exception~'#1'~is~not~known:~that~trap~will~never~be~triggered. }
+ {
+ The~only~exceptions~to~which~traps~can~be~attached~are \\
+ \iow_indent:n
+ {
+ * ~ invalid_operation \\
+ * ~ division_by_zero \\
+ * ~ overflow \\
+ * ~ underflow
+ }
+ }
+\__msg_kernel_new:nnnn { kernel } { unknown-fpu-trap-type }
+ { The~FPU~trap~type~'#2'~is~not~known. }
+ {
+ The~trap~type~must~be~one~of \\
+ \iow_indent:n
+ {
+ * ~ error \\
+ * ~ flag \\
+ * ~ none
+ }
+ }
+\__msg_kernel_new:nnn { kernel } { fp-flow }
+ { An ~ #3 ~ occurred. }
+\__msg_kernel_new:nnn { kernel } { fp-flow-to }
+ { #1 ~ #3 ed ~ to ~ #2 . }
+\__msg_kernel_new:nnn { kernel } { fp-zero-div }
+ { Division~by~zero~in~ #1 (#2) }
+\__msg_kernel_new:nnn { kernel } { fp-zero-div-ii }
+ { Division~by~zero~in~ (#1) #3 (#2) }
+\__msg_kernel_new:nnn { kernel } { fp-invalid }
+ { Invalid~operation~ #1 (#2) }
+\__msg_kernel_new:nnn { kernel } { fp-invalid-ii }
+ { Invalid~operation~ (#1) #3 (#2) }
+%% File: l3fp-round.dtx Copyright(C) 2011-2012,2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_round_return_one:
+ { \exp_after:wN \c_one \tex_romannumeral:D }
+\cs_new:Npn \__fp_round_to_ninf:NNN #1 #2 #3
+ {
+ \if_meaning:w 2 #1
+ \if_int_compare:w #3 > \c_zero
+ \__fp_round_return_one:
+ \fi:
+ \fi:
+ \c_zero
+ }
+\cs_new:Npn \__fp_round_to_zero:NNN #1 #2 #3 { \c_zero }
+\cs_new:Npn \__fp_round_to_pinf:NNN #1 #2 #3
+ {
+ \if_meaning:w 0 #1
+ \if_int_compare:w #3 > \c_zero
+ \__fp_round_return_one:
+ \fi:
+ \fi:
+ \c_zero
+ }
+\cs_new:Npn \__fp_round_to_nearest:NNN #1 #2 #3
+ {
+ \if_int_compare:w #3 > \c_five
+ \__fp_round_return_one:
+ \else:
+ \if_meaning:w 5 #3
+ \if_int_odd:w #2 \exp_stop_f:
+ \__fp_round_return_one:
+ \fi:
+ \fi:
+ \fi:
+ \c_zero
+ }
+\cs_new_eq:NN \__fp_round:NNN \__fp_round_to_nearest:NNN
+\cs_new:Npn \__fp_round_s:NNNw #1 #2 #3 #4;
+ {
+ \exp_after:wN \__fp_round:NNN
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w
+ \if_int_odd:w 0 \if_meaning:w 0 #3 1 \fi:
+ \if_meaning:w 5 #3 1 \fi:
+ \exp_stop_f:
+ \if_int_compare:w \__int_eval:w #4 > \c_zero
+ 1 +
+ \fi:
+ \fi:
+ #3
+ ;
+ }
+\cs_new:Npn \__fp_round_digit:Nw #1 #2;
+ {
+ \if_int_odd:w \if_meaning:w 0 #1 \c_one \else:
+ \if_meaning:w 5 #1 \c_one \else:
+ \c_zero \fi: \fi:
+ \if_int_compare:w \__int_eval:w #2 > \c_zero
+ \__int_eval:w \c_one +
+ \fi:
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_round_to_ninf_neg:NNN #1 #2 #3
+ {
+ \if_meaning:w 0 #1
+ \if_int_compare:w #3 > \c_zero
+ \__fp_round_return_one:
+ \fi:
+ \fi:
+ \c_zero
+ }
+\cs_new:Npn \__fp_round_to_zero_neg:NNN #1 #2 #3
+ {
+ \if_int_compare:w #3 > \c_zero
+ \__fp_round_return_one:
+ \fi:
+ \c_zero
+ }
+\cs_new:Npn \__fp_round_to_pinf_neg:NNN #1 #2 #3
+ {
+ \if_meaning:w 2 #1
+ \if_int_compare:w #3 > \c_zero
+ \__fp_round_return_one:
+ \fi:
+ \fi:
+ \c_zero
+ }
+\cs_new_eq:NN \__fp_round_to_nearest_neg:NNN \__fp_round_to_nearest:NNN
+\cs_new_eq:NN \__fp_round_neg:NNN \__fp_round_to_nearest_neg:NNN
+\cs_new:Npn \__fp_round_o:Nw #1#2 @
+ {
+ \if_case:w
+ \__int_eval:w \__fp_array_count:n {#2} - \c_one \__int_eval_end:
+ \__fp_round:Nwn #1 #2 {0} \tex_romannumeral:D
+ \or: \__fp_round:Nww #1 #2 \tex_romannumeral:D
+ \else:
+ \__fp_error:nffn { num-args }
+ { \__fp_round_name_from_cs:N #1 () } { 1 } { 2 }
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D
+ \fi:
+ -`0
+ }
+\cs_new:Npn \__fp_round_name_from_cs:N #1
+ {
+ \cs_if_eq:NNTF #1 \__fp_round_to_zero:NNN { trunc }
+ {
+ \cs_if_eq:NNTF #1 \__fp_round_to_ninf:NNN { floor }
+ {
+ \cs_if_eq:NNTF #1 \__fp_round_to_pinf:NNN { ceil }
+ { round }
+ }
+ }
+ }
+\cs_new:Npn \__fp_round:Nww #1#2 ; #3 ;
+ {
+ \__fp_small_int:wTF #3; { \__fp_round:Nwn #1#2; }
+ {
+ \__fp_invalid_operation_tl_o:ff
+ { \__fp_round_name_from_cs:N #1 }
+ { \__fp_array_to_clist:n { #2; #3; } }
+ }
+ }
+\cs_new:Npn \__fp_round:Nwn #1 \s__fp \__fp_chk:w #2#3#4; #5
+ {
+ \if_meaning:w 1 #2
+ \exp_after:wN \__fp_round_normal:NwNNnw
+ \exp_after:wN #1
+ \__int_value:w #5
+ \else:
+ \exp_after:wN \__fp_exp_after_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2#3#4;
+ }
+\cs_new:Npn \__fp_round_normal:NwNNnw #1#2 \s__fp \__fp_chk:w 1#3#4#5;
+ {
+ \__fp_decimate:nNnnnn { \c_sixteen - #4 - #2 }
+ \__fp_round_normal:NnnwNNnn #5 #1 #3 {#4} {#2}
+ }
+\cs_new:Npn \__fp_round_normal:NnnwNNnn #1#2#3#4; #5#6
+ {
+ \exp_after:wN \__fp_round_normal:NNwNnn
+ \int_use:N \__int_eval:w
+ \if_int_compare:w #2 > \c_zero
+ 1 \__int_value:w #2
+ \exp_after:wN \__fp_round_pack:Nw
+ \int_use:N \__int_eval:w 1#3 +
+ \else:
+ \if_int_compare:w #3 > \c_zero
+ 1 \__int_value:w #3 +
+ \fi:
+ \fi:
+ \exp_after:wN #5
+ \exp_after:wN #6
+ \use_none:nnnnnnn #3
+ #1
+ \__int_eval_end:
+ 0000 0000 0000 0000 ; #6
+ }
+\cs_new:Npn \__fp_round_pack:Nw #1
+ { \if_meaning:w 2 #1 + \c_one \fi: \__int_eval_end: }
+\cs_new:Npn \__fp_round_normal:NNwNnn #1 #2
+ {
+ \if_meaning:w 0 #2
+ \exp_after:wN \__fp_round_special:NwwNnn
+ \exp_after:wN #1
+ \fi:
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_round_normal_end:wwNnn
+ ; #2
+ }
+\cs_new:Npn \__fp_round_normal_end:wwNnn #1;#2;#3#4#5
+ {
+ \exp_after:wN \__fp_exp_after_o:w \tex_romannumeral:D -`0
+ \__fp_sanitize:Nw #3 #4 ; #1 ;
+ }
+\cs_new:Npn \__fp_round_special:NwwNnn #1#2;#3;#4#5#6
+ {
+ \if_meaning:w 0 #1
+ \__fp_case_return:nw
+ { \exp_after:wN \__fp_zero_fp:N \exp_after:wN #4 }
+ \else:
+ \exp_after:wN \__fp_round_special_aux:Nw
+ \exp_after:wN #4
+ \int_use:N \__int_eval:w \c_one
+ \if_meaning:w 1 #1 -#6 \else: +#5 \fi:
+ \fi:
+ ;
+ }
+\cs_new:Npn \__fp_round_special_aux:Nw #1#2;
+ {
+ \exp_after:wN \__fp_exp_after_o:w \tex_romannumeral:D -`0
+ \__fp_sanitize:Nw #1#2; {1000}{0000}{0000}{0000};
+ }
+%% File: l3fp-parse.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_parse_expand:w #1 { -`0 #1 }
+\cs_new:Npn \__fp_parse_return_semicolon:w
+ #1 \fi: \__fp_parse_expand:w { \fi: ; #1 }
+\group_begin:
+\char_set_catcode_other:N \S
+\char_set_catcode_other:N \F
+\char_set_catcode_other:N \P
+\char_set_lccode:nn { `\- } { `\_ }
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new:Npn \__fp_type_from_scan:N #1
+ {
+ \exp_after:wN \__fp_type_from_scan:w
+ \token_to_str:N #1 \q_mark S--FP-? \q_mark \q_stop
+ }
+ \cs_new:Npn \__fp_type_from_scan:w #1 S--FP #2 \q_mark #3 \q_stop {#2}
+ }
+\cs_set_protected:Npn \__fp_tmp:w #1 #2 #3
+ {
+ \cs_new:cpn { __fp_parse_digits_ #1 :N } ##1
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N ##1 \exp_stop_f:
+ \token_to_str:N ##1 \exp_after:wN #2 \tex_romannumeral:D
+ \else:
+ \__fp_parse_return_semicolon:w #3 ##1
+ \fi:
+ \__fp_parse_expand:w
+ }
+ }
+\__fp_tmp:w {vii} \__fp_parse_digits_vi:N { 0000000 ; 7 }
+\__fp_tmp:w {vi} \__fp_parse_digits_v:N { 000000 ; 6 }
+\__fp_tmp:w {v} \__fp_parse_digits_iv:N { 00000 ; 5 }
+\__fp_tmp:w {iv} \__fp_parse_digits_iii:N { 0000 ; 4 }
+\__fp_tmp:w {iii} \__fp_parse_digits_ii:N { 000 ; 3 }
+\__fp_tmp:w {ii} \__fp_parse_digits_i:N { 00 ; 2 }
+\__fp_tmp:w {i} \__fp_parse_digits_:N { 0 ; 1 }
+\cs_new_nopar:Npn \__fp_parse_digits_:N { ; ; 0 }
+\cs_new:Npn \__fp_parse_one:Nw #1 #2
+ {
+ \if_catcode:w \scan_stop: \exp_not:N #2
+ \if_meaning:w \scan_stop: #2
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_one_fp:NN
+ \else:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_one_register:NN
+ \fi:
+ \else:
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_one_digit:NN
+ \else:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_one_other:NN
+ \fi:
+ \fi:
+ #1 #2
+ }
+\cs_new:Npn \__fp_parse_one_fp:NN #1#2
+ {
+ \cs:w __fp_exp_after \__fp_type_from_scan:N #2 _f:nw \cs_end:
+ {
+ \exp_after:wN \__fp_parse_infix:NN
+ \exp_after:wN #1 \tex_romannumeral:D \__fp_parse_expand:w
+ }
+ #2
+ }
+\cs_new:Npn \__fp_exp_after_mark_f:nw #1
+ {
+ \__msg_kernel_expandable_error:nn { kernel } { fp-early-end }
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 #1
+ }
+\cs_new:cpn { __fp_exp_after_?_f:nw } #1#2
+ {
+ \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2}
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 #1
+ }
+\cs_new:Npn \__fp_parse_one_register:NN #1#2
+ {
+ \exp_after:wN \__fp_parse_infix_after_operand:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \exp_after:wN \__fp_parse_one_register_aux:Nw
+ \exp_after:wN #2
+ \__int_value:w
+ \exp_after:wN \__fp_parse_exponent:N
+ \tex_romannumeral:D \__fp_parse_expand:w
+ }
+\group_begin:
+\char_set_catcode_other:N \P
+\char_set_catcode_other:N \T
+\char_set_catcode_other:N \M
+\char_set_catcode_other:N \U
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new:Npn \__fp_parse_one_register_aux:Nw #1
+ {
+ \exp_after:wN \use:nn
+ \exp_after:wN \__fp_parse_one_register_auxii:wwwNw
+ \exp_after:wN { \tex_the:D \exp_not:N #1 }
+ ; \__fp_parse_one_register_dim:ww
+ PT ; \__fp_parse_one_register_mu:www
+ . PT ; \__fp_parse_one_register_int:www
+ \q_stop
+ }
+ \cs_new:Npn \__fp_parse_one_register_auxii:wwwNw
+ #1 . #2 PT #3 ; #4#5 \q_stop { #4 #1.#2; }
+ \cs_new:Npn \__fp_parse_one_register_mu:www #1 MU; #2;
+ { \__fp_parse_one_register_dim:ww #1; }
+ }
+\cs_new:Npn \__fp_parse_one_register_int:www #1; #2.; #3;
+ { \__fp_parse:n { #1 e #3 } }
+\cs_new:Npn \__fp_parse_one_register_dim:ww #1; #2;
+ {
+ \exp_after:wN \__fp_from_dim_test:ww
+ \__int_value:w #2 \exp_after:wN ,
+ \__int_value:w \__dim_eval:w #1 pt ;
+ }
+\cs_new:Npn \__fp_parse_one_digit:NN #1
+ {
+ \exp_after:wN \__fp_parse_infix_after_operand:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \exp_after:wN \__fp_sanitize:wN
+ \int_use:N \__int_eval:w \c_zero \__fp_parse_trim_zeros:N
+ }
+\cs_new:Npn \__fp_parse_one_other:NN #1 #2
+ {
+ \if_int_compare:w
+ \__int_eval:w
+ ( `#2 \if_int_compare:w `#2 > `Z - \c_thirty_two \fi: ) / 26
+ = \c_three
+ \exp_after:wN \__fp_parse_word:Nw
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_letters:N
+ \tex_romannumeral:D
+ \else:
+ \exp_after:wN \__fp_parse_prefix:NNN
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \cs:w __fp_parse_prefix_#2:Nw \exp_after:wN \cs_end:
+ \tex_romannumeral:D
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_word:Nw #1#2;
+ {
+ \cs_if_exist_use:cF { __fp_parse_word_#2:N }
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { unknown-fp-word } {#2}
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0
+ \__fp_parse_infix:NN
+ }
+ #1
+ }
+\cs_new:Npn \__fp_parse_letters:N #1
+ {
+ -`0
+ \if_int_compare:w
+ \if_catcode:w \scan_stop: \exp_not:N #1
+ \c_zero
+ \else:
+ \__int_eval:w
+ ( `#1 \if_int_compare:w `#1 > `Z - \c_thirty_two \fi: )
+ / 26
+ \fi:
+ = \c_three
+ \exp_after:wN #1
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_letters:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_return_semicolon:w #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_prefix:NNN #1#2#3
+ {
+ \if_meaning:w \scan_stop: #3
+ \exp_after:wN \__fp_parse_prefix_unknown:NNN
+ \exp_after:wN #2
+ \fi:
+ #3 #1
+ }
+\cs_new:Npn \__fp_parse_prefix_unknown:NNN #1#2#3
+ {
+ \cs_if_exist:cTF { __fp_parse_infix_#1:N }
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-missing-number } {#1}
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0
+ \__fp_parse_infix:NN #3 #1
+ }
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-unknown-symbol } {#1}
+ \__fp_parse_one:Nw #3
+ }
+ }
+\cs_new:Npn \__fp_parse_trim_zeros:N #1
+ {
+ \if:w 0 \exp_not:N #1
+ \exp_after:wN \__fp_parse_trim_zeros:N
+ \tex_romannumeral:D
+ \else:
+ \if:w . \exp_not:N #1
+ \exp_after:wN \__fp_parse_strim_zeros:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_trim_end:w #1
+ \fi:
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_trim_end:w #1 \fi: \fi: \__fp_parse_expand:w
+ {
+ \fi:
+ \fi:
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ \exp_after:wN \__fp_parse_large:N
+ \else:
+ \exp_after:wN \__fp_parse_zero:
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_parse_strim_zeros:N #1
+ {
+ \if:w 0 \exp_not:N #1
+ - \c_one
+ \exp_after:wN \__fp_parse_strim_zeros:N \tex_romannumeral:D
+ \else:
+ \__fp_parse_strim_end:w #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_strim_end:w #1 \fi: \__fp_parse_expand:w
+ {
+ \fi:
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ \exp_after:wN \__fp_parse_small:N
+ \else:
+ \exp_after:wN \__fp_parse_zero:
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_parse_zero:
+ {
+ \exp_after:wN ; \exp_after:wN 1
+ \__int_value:w \__fp_parse_exponent:N
+ }
+\cs_new:Npn \__fp_parse_small:N #1
+ {
+ \exp_after:wN \__fp_parse_pack_leading:NNNNNww
+ \int_use:N \__int_eval:w 1 \token_to_str:N #1
+ \exp_after:wN \__fp_parse_small_leading:wwNN
+ \__int_value:w 1
+ \exp_after:wN \__fp_parse_digits_vii:N
+ \tex_romannumeral:D \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_small_leading:wwNN 1 #1 ; #2; #3 #4
+ {
+ #1 #2
+ \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
+ \exp_after:wN \c_zero
+ \int_use:N \__int_eval:w 1
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
+ \token_to_str:N #4
+ \exp_after:wN \__fp_parse_small_trailing:wwNN
+ \__int_value:w 1
+ \exp_after:wN \__fp_parse_digits_vi:N
+ \tex_romannumeral:D
+ \else:
+ 0000 0000 \__fp_parse_exponent:Nw #4
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_small_trailing:wwNN 1 #1 ; #2; #3 #4
+ {
+ #1 #2
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
+ \token_to_str:N #4
+ \exp_after:wN \__fp_parse_small_round:NN
+ \exp_after:wN #4
+ \tex_romannumeral:D
+ \else:
+ 0 \__fp_parse_exponent:Nw #4
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_pack_trailing:NNNNNNww #1 #2 #3#4#5#6 #7; #8 ;
+ {
+ \if_meaning:w 2 #2 + \c_one \fi:
+ ; #8 + #1 ; {#3#4#5#6} {#7};
+ }
+\cs_new:Npn \__fp_parse_pack_leading:NNNNNww #1 #2#3#4#5 #6; #7;
+ {
+ + #7
+ \if_meaning:w 2 #1 \__fp_parse_pack_carry:w \fi:
+ ; 0 {#2#3#4#5} {#6}
+ }
+\cs_new:Npn \__fp_parse_pack_carry:w \fi: ; 0 #1
+ { \fi: + \c_one ; 0 {1000} }
+\cs_new:Npn \__fp_parse_large:N #1
+ {
+ \exp_after:wN \__fp_parse_large_leading:wwNN
+ \__int_value:w 1 \token_to_str:N #1
+ \exp_after:wN \__fp_parse_digits_vii:N
+ \tex_romannumeral:D \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_large_leading:wwNN 1 #1 ; #2; #3 #4
+ {
+ + \c_eight - #3
+ \exp_after:wN \__fp_parse_pack_leading:NNNNNww
+ \int_use:N \__int_eval:w 1 #1
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
+ \exp_after:wN \__fp_parse_large_trailing:wwNN
+ \__int_value:w 1 \token_to_str:N #4
+ \exp_after:wN \__fp_parse_digits_vi:N
+ \tex_romannumeral:D
+ \else:
+ \if:w . \exp_not:N #4
+ \exp_after:wN \__fp_parse_small_leading:wwNN
+ \__int_value:w 1
+ \cs:w
+ __fp_parse_digits_
+ \tex_romannumeral:D #3
+ :N \exp_after:wN
+ \cs_end:
+ \tex_romannumeral:D
+ \else:
+ #2
+ \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
+ \exp_after:wN \c_zero
+ \__int_value:w 1 0000 0000
+ \__fp_parse_exponent:Nw #4
+ \fi:
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_large_trailing:wwNN 1 #1 ; #2; #3 #4
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
+ \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
+ \exp_after:wN \c_eight
+ \int_use:N \__int_eval:w 1 #1 \token_to_str:N #4
+ \exp_after:wN \__fp_parse_large_round:NN
+ \exp_after:wN #4
+ \tex_romannumeral:D
+ \else:
+ \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
+ \int_use:N \__int_eval:w \c_seven - #3 \exp_stop_f:
+ \int_use:N \__int_eval:w 1 #1
+ \if:w . \exp_not:N #4
+ \exp_after:wN \__fp_parse_small_trailing:wwNN
+ \__int_value:w 1
+ \cs:w
+ __fp_parse_digits_
+ \tex_romannumeral:D #3
+ :N \exp_after:wN
+ \cs_end:
+ \tex_romannumeral:D
+ \else:
+ #2 0 \__fp_parse_exponent:Nw #4
+ \fi:
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_round_loop:N #1
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ + \c_one
+ \if:w 0 \token_to_str:N #1
+ \exp_after:wN \__fp_parse_round_loop:N
+ \tex_romannumeral:D
+ \else:
+ \exp_after:wN \__fp_parse_round_up:N
+ \tex_romannumeral:D
+ \fi:
+ \else:
+ \__fp_parse_return_semicolon:w \c_zero #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_round_up:N #1
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ + \c_one
+ \exp_after:wN \__fp_parse_round_up:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_return_semicolon:w \c_one #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_round_after:wN #1; #2
+ {
+ + #2 \exp_after:wN ;
+ \int_use:N \__int_eval:w #1 + \__fp_parse_exponent:N
+ }
+\cs_new:Npn \__fp_parse_small_round:NN #1#2
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
+ +
+ \exp_after:wN \__fp_round_s:NNNw
+ \exp_after:wN 0
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_parse_round_after:wN
+ \int_use:N \__int_eval:w \c_zero * \__int_eval:w \c_zero
+ \exp_after:wN \__fp_parse_round_loop:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_exponent:Nw #2
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_large_round:NN #1#2
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
+ +
+ \exp_after:wN \__fp_round_s:NNNw
+ \exp_after:wN 0
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_parse_large_round_aux:wNN
+ \int_use:N \__int_eval:w \c_one
+ \exp_after:wN \__fp_parse_round_loop:N
+ \else: %^^A could be dot, or e, or other
+ \exp_after:wN \__fp_parse_large_round_test:NN
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_large_round_test:NN #1#2
+ {
+ \if:w . \exp_not:N #2
+ \exp_after:wN \__fp_parse_small_round:NN
+ \exp_after:wN #1
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_exponent:Nw #2
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_large_round_aux:wNN #1 ; #2 #3
+ {
+ + #2
+ \exp_after:wN \__fp_parse_round_after:wN
+ \int_use:N \__int_eval:w #1
+ \if:w . \exp_not:N #3
+ + \c_zero * \__int_eval:w \c_zero
+ \exp_after:wN \__fp_parse_round_loop:N
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN ;
+ \exp_after:wN \c_zero
+ \exp_after:wN #3
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_exponent:Nw #1 #2 \__fp_parse_expand:w
+ {
+ \exp_after:wN ;
+ \__int_value:w #2 \__fp_parse_exponent:N #1
+ }
+\cs_new:Npn \__fp_parse_exponent:N #1
+ {
+ \if:w e \exp_not:N #1
+ \exp_after:wN \__fp_parse_exponent_aux:N
+ \tex_romannumeral:D
+ \else:
+ 0 \__fp_parse_return_semicolon:w #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_exponent_aux:N #1
+ {
+ \if_int_compare:w \if_catcode:w \scan_stop: \exp_not:N #1
+ \c_zero \else: `#1 \fi: > `9 \exp_stop_f:
+ 0 \exp_after:wN ; \exp_after:wN e
+ \else:
+ \exp_after:wN \__fp_parse_exponent_sign:N
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_parse_exponent_sign:N #1
+ {
+ \if:w + \if:w - \exp_not:N #1 + \fi: \token_to_str:N #1
+ \exp_after:wN \__fp_parse_exponent_sign:N
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN \__fp_parse_exponent_body:N
+ \exp_after:wN #1
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_exponent_body:N #1
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ \token_to_str:N #1
+ \exp_after:wN \__fp_parse_exponent_digits:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_exponent_keep:NTF #1
+ { \__fp_parse_return_semicolon:w #1 }
+ {
+ \exp_after:wN ;
+ \tex_romannumeral:D
+ }
+ \fi:
+ \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_exponent_digits:N #1
+ {
+ \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
+ \token_to_str:N #1
+ \exp_after:wN \__fp_parse_exponent_digits:N
+ \tex_romannumeral:D
+ \else:
+ \__fp_parse_return_semicolon:w #1
+ \fi:
+ \__fp_parse_expand:w
+ }
+\prg_new_conditional:Npnn \__fp_parse_exponent_keep:N #1 { TF }
+ {
+ \if_catcode:w \scan_stop: \exp_not:N #1
+ \if_meaning:w \scan_stop: #1
+ \if_int_compare:w
+ \pdftex_strcmp:D { \s__fp } { \exp_not:N #1 } = \c_zero
+ 0
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-after-e } { floating~point~ }
+ \prg_return_true:
+ \else:
+ 0
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { bad-variable } {#1}
+ \prg_return_false:
+ \fi:
+ \else:
+ \if_int_compare:w
+ \pdftex_strcmp:D { \__int_value:w #1 } { \tex_the:D #1 }
+ = \c_zero
+ \__int_value:w #1
+ \else:
+ 0
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-after-e } { dimension~#1 }
+ \fi:
+ \prg_return_false:
+ \fi:
+ \else:
+ 0
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-missing } { exponent }
+ \prg_return_true:
+ \fi:
+ }
+\cs_new_eq:cN { __fp_parse_prefix_+:Nw } \__fp_parse_one:Nw
+\cs_new:Npn \__fp_parse_apply_unary:NNNwN #1#2#3#4@#5
+ {
+ #3 #2 #4 @
+ \tex_romannumeral:D -`0 #5 #1
+ }
+\cs_set_protected:Npn \__fp_tmp:w #1#2#3#4
+ {
+ \cs_new:cpn { __fp_parse_prefix_ #1 :Nw } ##1
+ {
+ \exp_after:wN \__fp_parse_apply_unary:NNNwN
+ \exp_after:wN ##1
+ \exp_after:wN #4
+ \exp_after:wN #3
+ \tex_romannumeral:D
+ \if_int_compare:w #2 < ##1
+ \__fp_parse_operand:Nw ##1
+ \else:
+ \__fp_parse_operand:Nw #2
+ \fi:
+ \__fp_parse_expand:w
+ }
+ }
+\__fp_tmp:w - \c_twelve \__fp_set_sign_o:w 2
+\__fp_tmp:w ! \c_twelve \__fp_not_o:w ?
+\cs_new:cpn { __fp_parse_prefix_.:Nw } #1
+ {
+ \exp_after:wN \__fp_parse_infix_after_operand:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \exp_after:wN \__fp_sanitize:wN
+ \int_use:N \__int_eval:w \c_zero \__fp_parse_strim_zeros:N
+ }
+\group_begin:
+ \char_set_catcode_letter:N (
+ \char_set_catcode_letter:N )
+ \cs_new:Npn \__fp_parse_prefix_(:Nw #1
+ {
+ \exp_after:wN \__fp_parse_lparen_after:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D
+ \if_int_compare:w #1 = \c_sixteen
+ \__fp_parse_operand:Nw \c_one
+ \else:
+ \__fp_parse_operand:Nw \c_zero
+ \fi:
+ \__fp_parse_expand:w
+ }
+ \cs_new:Npn \__fp_parse_lparen_after:NwN #1#2 @ #3
+ {
+ \token_if_eq_meaning:NNTF #3 \__fp_parse_infix_):N
+ {
+ \__fp_exp_after_array_f:w #2 \s__fp_stop
+ \exp_after:wN \__fp_parse_infix:NN
+ \exp_after:wN #1
+ \tex_romannumeral:D \__fp_parse_expand:w
+ }
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-missing } { ) }
+ #2 @ \use_none:n #3
+ }
+ }
+\group_end:
+\cs_set_protected:Npn \__fp_tmp:w #1 #2
+ {
+ \cs_new_nopar:cpn { __fp_parse_word_#1:N }
+ { \exp_after:wN #2 \tex_romannumeral:D -`0 \__fp_parse_infix:NN }
+ }
+\__fp_tmp:w { inf } \c_inf_fp
+\__fp_tmp:w { nan } \c_nan_fp
+\__fp_tmp:w { pi } \c_pi_fp
+\__fp_tmp:w { deg } \c_one_degree_fp
+\__fp_tmp:w { true } \c_one_fp
+\__fp_tmp:w { false } \c_zero_fp
+\cs_set_protected:Npn \__fp_tmp:w #1 #2
+ {
+ \cs_new_nopar:cpn { __fp_parse_word_#1:N }
+ {
+ \__fp_exp_after_f:nw { \__fp_parse_infix:NN }
+ \s__fp \__fp_chk:w 10 #2 ;
+ }
+ }
+\__fp_tmp:w {pt} { {1} {1000} {0000} {0000} {0000} }
+\__fp_tmp:w {in} { {2} {7227} {0000} {0000} {0000} }
+\__fp_tmp:w {pc} { {2} {1200} {0000} {0000} {0000} }
+\__fp_tmp:w {cm} { {2} {2845} {2755} {9055} {1181} }
+\__fp_tmp:w {mm} { {1} {2845} {2755} {9055} {1181} }
+\__fp_tmp:w {dd} { {1} {1070} {0085} {6496} {0630} }
+\__fp_tmp:w {cc} { {2} {1284} {0102} {7795} {2756} }
+\__fp_tmp:w {nd} { {1} {1066} {9783} {4645} {6693} }
+\__fp_tmp:w {nc} { {2} {1280} {3740} {1574} {8031} }
+\__fp_tmp:w {bp} { {1} {1003} {7500} {0000} {0000} }
+\__fp_tmp:w {sp} { {-4} {1525} {8789} {0625} {0000} }
+\tl_map_inline:nn { {em} {ex} }
+ {
+ \cs_new_nopar:cpn { __fp_parse_word_#1:N }
+ {
+ \exp_after:wN \__fp_from_dim_test:ww
+ \exp_after:wN 0 \exp_after:wN ,
+ \__int_value:w \__dim_eval:w 1 #1 \exp_after:wN ;
+ \tex_romannumeral:D -`0 \__fp_parse_infix:NN
+ }
+ }
+\cs_new:Npn \__fp_parse_unary_function:nNN #1#2#3
+ {
+ \exp_after:wN \__fp_parse_apply_unary:NNNwN
+ \exp_after:wN #3
+ \exp_after:wN #2
+ \cs:w __fp_#1_o:w \exp_after:wN \cs_end:
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_fifteen \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_function:NNN #1#2#3
+ {
+ \exp_after:wN \__fp_parse_apply_unary:NNNwN
+ \exp_after:wN #3
+ \exp_after:wN #2
+ \exp_after:wN #1
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_sixteen \__fp_parse_expand:w
+ }
+\cs_new_nopar:Npn \__fp_parse_word_acot:N
+ { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_i:nn }
+\cs_new_nopar:Npn \__fp_parse_word_acotd:N
+ { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_ii:nn }
+\cs_new_nopar:Npn \__fp_parse_word_atan:N
+ { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_i:nn }
+\cs_new_nopar:Npn \__fp_parse_word_atand:N
+ { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_ii:nn }
+\cs_new_nopar:Npn \__fp_parse_word_max:N
+ { \__fp_parse_function:NNN \__fp_minmax_o:Nw 2 }
+\cs_new_nopar:Npn \__fp_parse_word_min:N
+ { \__fp_parse_function:NNN \__fp_minmax_o:Nw 0 }
+\cs_new:Npn \__fp_parse_word_abs:N
+ { \__fp_parse_unary_function:nNN { set_sign } 0 }
+\cs_new_nopar:Npn \__fp_parse_word_exp:N
+ { \__fp_parse_unary_function:nNN {exp} ? }
+\cs_new_nopar:Npn \__fp_parse_word_ln:N
+ { \__fp_parse_unary_function:nNN {ln} ? }
+\cs_new_nopar:Npn \__fp_parse_word_sqrt:N
+ { \__fp_parse_unary_function:nNN {sqrt} ? }
+\tl_map_inline:nn
+ {
+ {acos} {acsc} {asec} {asin}
+ {cos} {cot} {csc} {sec} {sin} {tan}
+ }
+ {
+ \cs_new_nopar:cpn { __fp_parse_word_#1:N }
+ { \__fp_parse_unary_function:nNN {#1} \use_i:nn }
+ \cs_new_nopar:cpn { __fp_parse_word_#1d:N }
+ { \__fp_parse_unary_function:nNN {#1} \use_ii:nn }
+ }
+\cs_new_nopar:Npn \__fp_parse_word_trunc:N
+ { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_zero:NNN }
+\cs_new_nopar:Npn \__fp_parse_word_floor:N
+ { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_ninf:NNN }
+\cs_new_nopar:Npn \__fp_parse_word_ceil:N
+ { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_pinf:NNN }
+\cs_new:Npn \__fp_parse_word_round:N #1#2
+ {
+ \if_meaning:w + #2
+ \__fp_parse_round:Nw \__fp_round_to_pinf:NNN
+ \else:
+ \if_meaning:w 0 #2
+ \__fp_parse_round:Nw \__fp_round_to_zero:NNN
+ \else:
+ \if_meaning:w - #2
+ \__fp_parse_round:Nw \__fp_round_to_ninf:NNN
+ \fi:
+ \fi:
+ \fi:
+ \__fp_parse_function:NNN
+ \__fp_round_o:Nw \__fp_round_to_nearest:NNN #1
+ #2
+ }
+\cs_new:Npn \__fp_parse_round:Nw
+ #1 #2 \__fp_round_to_nearest:NNN #3#4 { #2 #1 #3 }
+\cs_new:Npn \__fp_parse:n #1
+ {
+ \tex_romannumeral:D
+ \exp_after:wN \__fp_parse_after:ww
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_minus_one
+ \__fp_parse_expand:w #1 \s__fp_mark
+ \s__fp_stop
+ }
+\cs_new:Npn \__fp_parse_after:ww
+ #1@ \__fp_parse_infix_end:N \s__fp_mark \s__fp_stop
+ { \c_zero #1 }
+\cs_new:Npn \__fp_parse_operand:Nw #1
+ {
+ -`0
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \exp_after:wN \__fp_parse_one:Nw
+ \exp_after:wN #1
+ \tex_romannumeral:D
+ }
+\cs_new:Npn \__fp_parse_continue:NwN #1 #2 @ #3 { #3 #1 #2 @ }
+\cs_new:Npn \__fp_parse_apply_binary:NwNwN #1 #2@ #3 #4@ #5
+ {
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0 \cs:w __fp_#3_o:ww \cs_end: #2 #4
+ \tex_romannumeral:D -`0 #5 #1
+ }
+\cs_new:Npn \__fp_parse_infix_after_operand:NwN #1 #2;
+ {
+ \__fp_exp_after_f:nw { \__fp_parse_infix:NN #1 }
+ #2;
+ }
+\group_begin:
+ \char_set_catcode_letter:N \*
+ \cs_new:Npn \__fp_parse_infix:NN #1 #2
+ {
+ \if_catcode:w \scan_stop: \exp_not:N #2
+ \if_int_compare:w
+ \pdftex_strcmp:D { \s__fp_mark } { \exp_not:N #2 }
+ = \c_zero
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_infix_end:N
+ \else:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_infix_juxtapose:N
+ \fi:
+ \else:
+ \if_int_compare:w
+ \__int_eval:w
+ ( `#2 \if_int_compare:w `#2 > `Z - \c_thirty_two \fi: )
+ / 26
+ = \c_three
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_parse_infix_juxtapose:N
+ \else:
+ \exp_after:wN \__fp_parse_infix_check:NNN
+ \cs:w
+ __fp_parse_infix_#2:N
+ \exp_after:wN \exp_after:wN \exp_after:wN
+ \cs_end:
+ \fi:
+ \fi:
+ #1
+ #2
+ }
+ \cs_new:Npn \__fp_parse_infix_check:NNN #1#2#3
+ {
+ \if_meaning:w \scan_stop: #1
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { fp-missing } { * }
+ \exp_after:wN \__fp_parse_infix_*:N
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \else:
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \fi:
+ }
+\group_end:
+\cs_new:Npn \__fp_parse_infix_end:N #1
+ { @ \use_none:n \__fp_parse_infix_end:N }
+\group_begin:
+ \char_set_catcode_letter:N \)
+ \cs_new:Npn \__fp_parse_infix_):N #1
+ {
+ \if_int_compare:w #1 < \c_zero
+ \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) }
+ \exp_after:wN \__fp_parse_infix:NN
+ \exp_after:wN #1
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_infix_):N
+ \fi:
+ }
+\group_end:
+\group_begin:
+ \char_set_catcode_letter:N \,
+ \cs_new:Npn \__fp_parse_infix_,:N #1
+ {
+ \if_int_compare:w #1 > \c_one
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_infix_,:N
+ \else:
+ \if_int_compare:w #1 = \c_one
+ \exp_after:wN \__fp_parse_infix_comma:w
+ \tex_romannumeral:D
+ \else:
+ \exp_after:wN \__fp_parse_infix_comma_gobble:w
+ \tex_romannumeral:D
+ \fi:
+ \__fp_parse_operand:Nw \c_one
+ \exp_after:wN \__fp_parse_expand:w
+ \fi:
+ }
+ \cs_new:Npn \__fp_parse_infix_comma:w #1 @
+ { #1 @ \use_none:n }
+ \cs_new:Npn \__fp_parse_infix_comma_gobble:w #1 @
+ {
+ \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma }
+ @ \use_none:n
+ }
+\group_end:
+\group_begin:
+ \cs_set_nopar:Npn \+ { }
+ \char_set_catcode_other:N \&
+ \char_set_catcode_letter:N \^
+ \char_set_catcode_letter:N \/
+ \char_set_catcode_letter:N \-
+ \char_set_catcode_letter:N \+
+ \cs_set_protected:Npn \__fp_tmp:w #1#2#3#4
+ {
+ \cs_new:Npn #1 ##1
+ {
+ \if_int_compare:w ##1 < #3
+ \exp_after:wN @
+ \exp_after:wN \__fp_parse_apply_binary:NwNwN
+ \exp_after:wN #2
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw #4
+ \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN #1
+ \fi:
+ }
+ }
+ \__fp_tmp:w \__fp_parse_infix_^:N ^ \c_fifteen \c_fourteen
+ \__fp_tmp:w \__fp_parse_infix_/:N / \c_ten \c_ten
+ \__fp_tmp:w \__fp_parse_infix_mul:N * \c_ten \c_ten
+ \__fp_tmp:w \__fp_parse_infix_-:N - \c_nine \c_nine
+ \__fp_tmp:w \__fp_parse_infix_+:N + \c_nine \c_nine
+ \__fp_tmp:w \__fp_parse_infix_and:N & \c_five \c_five
+ \__fp_tmp:w \__fp_parse_infix_or:N | \c_four \c_four
+\group_end:
+\cs_new:cpn { __fp_parse_infix_(:N } #1
+ { \__fp_parse_infix_juxtapose:N #1 ( }
+\cs_new:Npn \__fp_parse_infix_juxtapose:N #1
+ {
+ \if_int_compare:w #1 < \c_thirty_two
+ \exp_after:wN @
+ \exp_after:wN \__fp_parse_apply_juxtapose:NwwN
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_thirty_two
+ \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_infix_juxtapose:N
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_apply_juxtapose:NwwN #1 #2;#3@ #4;#5@
+ {
+ \if_catcode:w ^ \tl_to_str:n { #3 #5 } ^
+ \else:
+ \__fp_error:nffn { invalid-ii }
+ { \__fp_array_to_clist:n { #2; #3 } }
+ { \__fp_array_to_clist:n { #4; #5 } }
+ { }
+ \fi:
+ \__fp_parse_apply_binary:NwNwN #1 #2;@ * #4;@
+ }
+\group_begin:
+ \char_set_catcode_letter:N ^
+ \cs_new:cpn { __fp_parse_infix_*:N } #1#2
+ {
+ \if:w * \exp_not:N #2
+ \exp_after:wN \__fp_parse_infix_^:N
+ \exp_after:wN #1
+ \else:
+ \exp_after:wN \__fp_parse_infix_mul:N
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \fi:
+ }
+\group_end:
+\group_begin:
+ \char_set_catcode_letter:N \|
+ \char_set_catcode_letter:N \&
+ \cs_new:Npn \__fp_parse_infix_|:N #1#2
+ {
+ \if:w | \exp_not:N #2
+ \exp_after:wN \__fp_parse_infix_|:N
+ \exp_after:wN #1
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN \__fp_parse_infix_or:N
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \fi:
+ }
+ \cs_new:Npn \__fp_parse_infix_&:N #1#2
+ {
+ \if:w & \exp_not:N #2
+ \exp_after:wN \__fp_parse_infix_&:N
+ \exp_after:wN #1
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN \__fp_parse_infix_and:N
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \fi:
+ }
+\group_end:
+\group_begin:
+ \char_set_catcode_letter:N \?
+ \cs_new:Npn \__fp_parse_infix_?:N #1
+ {
+ \if_int_compare:w #1 < \c_three
+ \exp_after:wN @
+ \exp_after:wN \__fp_ternary:NwwN
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_three
+ \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_infix_?:N
+ \fi:
+ }
+ \cs_new:Npn \__fp_parse_infix_::N #1
+ {
+ \if_int_compare:w #1 < \c_three
+ \__msg_kernel_expandable_error:nnnn
+ { kernel } { fp-missing } { ? } { ~for~?: }
+ \exp_after:wN @
+ \exp_after:wN \__fp_ternary_auxii:NwwN
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_two
+ \exp_after:wN \__fp_parse_expand:w
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_infix_::N
+ \fi:
+ }
+\group_end:
+\cs_new:cpn { __fp_parse_infix_<:N } #1
+ {
+ \__fp_parse_compare:NNNNNNN #1 \c_one
+ \c_zero \c_zero \c_zero \c_zero <
+ }
+\cs_new:cpn { __fp_parse_infix_=:N } #1
+ {
+ \__fp_parse_compare:NNNNNNN #1 \c_one
+ \c_zero \c_zero \c_zero \c_zero =
+ }
+\cs_new:cpn { __fp_parse_infix_>:N } #1
+ {
+ \__fp_parse_compare:NNNNNNN #1 \c_one
+ \c_zero \c_zero \c_zero \c_zero >
+ }
+\cs_new:cpn { __fp_parse_infix_!:N } #1
+ {
+ \exp_after:wN \__fp_parse_compare:NNNNNNN
+ \exp_after:wN #1
+ \exp_after:wN \c_zero
+ \exp_after:wN \c_one
+ \exp_after:wN \c_one
+ \exp_after:wN \c_one
+ \exp_after:wN \c_one
+ }
+\cs_new:Npn \__fp_parse_excl_error:
+ {
+ \__msg_kernel_expandable_error:nnnn
+ { kernel } { fp-missing } { = } { ~after~!. }
+ }
+\cs_new:Npn \__fp_parse_compare:NNNNNNN #1
+ {
+ \if_int_compare:w #1 < \c_seven
+ \exp_after:wN \__fp_parse_compare_auxi:NNNNNNN
+ \exp_after:wN \__fp_parse_excl_error:
+ \else:
+ \exp_after:wN @
+ \exp_after:wN \use_none:n
+ \exp_after:wN \__fp_parse_compare:NNNNNNN
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_compare_auxi:NNNNNNN #1#2#3#4#5#6#7
+ {
+ \if_case:w
+ \if_catcode:w \scan_stop: \exp_not:N #7
+ \c_minus_one
+ \else:
+ \__int_eval:w `#7 - `< \__int_eval_end:
+ \fi:
+ \__fp_parse_compare_auxii:NNNNN #2#2#4#5#6
+ \or: \__fp_parse_compare_auxii:NNNNN #2#3#2#5#6
+ \or: \__fp_parse_compare_auxii:NNNNN #2#3#4#2#6
+ \or: \__fp_parse_compare_auxii:NNNNN #2#3#4#5#2
+ \else: #1 \__fp_parse_compare_end:NNNNw #3#4#5#6#7
+ \fi:
+ }
+\cs_new:Npn \__fp_parse_compare_auxii:NNNNN #1#2#3#4#5
+ {
+ \exp_after:wN \__fp_parse_compare_auxi:NNNNNNN
+ \exp_after:wN \prg_do_nothing:
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \exp_after:wN #4
+ \exp_after:wN #5
+ \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
+ }
+\cs_new:Npn \__fp_parse_compare_end:NNNNw #1#2#3#4#5 \fi:
+ {
+ \fi:
+ \exp_after:wN @
+ \exp_after:wN \__fp_parse_apply_compare:NwNNNNNwN
+ \exp_after:wN \c_one_fp
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \exp_after:wN #4
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_seven \__fp_parse_expand:w #5
+ }
+\cs_new:Npn \__fp_parse_apply_compare:NwNNNNNwN
+ #1 #2@ #3 #4#5#6#7 #8@ #9
+ {
+ \if_int_odd:w
+ \if_meaning:w \c_zero_fp #3
+ \c_zero
+ \else:
+ \if_case:w \__fp_compare_back:ww #8 #2 \exp_stop_f:
+ #5 \or: #6 \or: #7 \else: #4
+ \fi:
+ \fi:
+ \exp_after:wN \__fp_parse_apply_compare_aux:NNwN
+ \exp_after:wN \c_one_fp
+ \else:
+ \exp_after:wN \__fp_parse_apply_compare_aux:NNwN
+ \exp_after:wN \c_zero_fp
+ \fi:
+ #1 #8 #9
+ }
+\cs_new:Npn \__fp_parse_apply_compare_aux:NNwN #1 #2 #3; #4
+ {
+ \if_meaning:w \__fp_parse_compare:NNNNNNN #4
+ \exp_after:wN \__fp_parse_continue_compare:NNwNN
+ \exp_after:wN #1
+ \exp_after:wN #2
+ \tex_romannumeral:D -`0
+ \__fp_exp_after_o:w #3;
+ \tex_romannumeral:D -`0
+ \else:
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #2
+ \tex_romannumeral:D -`0
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \fi:
+ #4 #2
+ }
+\cs_new:Npn \__fp_parse_continue_compare:NNwNN #1#2 #3@ #4#5
+ { #4 #2 #3@ #1 }
+\group_begin:
+ \char_set_catcode_other:N \^^@
+ \cs_new:Npn \fp_function:Nw #1 { ^^@ ; { \exp_after:wN #1 } }
+\group_end:
+\group_begin:
+ \char_set_catcode_other:N \^^@
+ \cs_new_protected:Npn \fp_new_function:Npn #1#2#
+ {
+ \cs_new:Npx #1
+ {
+ ^^@ ;
+ {
+ \exp_not:N \exp_after:wN
+ \exp_not:N \__fp_function_args:Nwn
+ \exp_not:N \exp_after:wN
+ \exp_not:c { __fp_user_ \cs_to_str:N #1 }
+ \exp_not:N \__int_value:w
+ \int_eval:n { \tl_count:n {#2} / \c_two }
+ \exp_not:N \exp_after:wN ;
+ }
+ }
+ \cs_new:cpn { __fp_user_ \cs_to_str:N #1 } #2
+ }
+\group_end:
+\cs_new:Npn \__fp_function_args:Nwn #1#2; #3
+ {
+ \int_compare:nNnTF { \tl_count:n {#3} } = {#2}
+ { #1 #3 }
+ {
+ \__msg_kernel_expandable_error:nnnnn
+ { kernel } { fp-num-args } { #1() } {#2} {#2}
+ \c_nan_fp
+ }
+ }
+\group_begin:
+ \char_set_catcode_other:N \^^@
+ \cs_new:cpn { __fp_parse_prefix_ ^^@ :Nw } #1 ; #2
+ {
+ \exp_after:wN \__fp_function_apply:NnwN
+ \exp_after:wN #1
+ \exp_after:wN { #2 \exp_after:wN }
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_sixteen \__fp_parse_expand:w
+ }
+\group_end:
+\cs_new:Npn \__fp_function_apply:NnwN #1#2#3@#4
+ {
+ \exp_after:wN \__fp_exp_after_array_f:w
+ \tex_romannumeral:D -`0
+ \__fp_function_store:wwNwnn #3
+ \s__fp_mark \__fp_function_store:wwNwnn ;
+ \s__fp_mark \__fp_function_store_end:wnnn
+ \s__fp_stop { } { } {#2}
+ \s__fp_stop
+ #4 #1
+ }
+\cs_new:Npn \__fp_function_store:wwNwnn
+ #1; #2 \s__fp_mark #3#4 \s__fp_stop #5#6
+ { #3 #2 \s__fp_mark #3#4 \s__fp_stop { #5 #6 } { { #1; } } }
+\cs_new:Npn \__fp_function_store_end:wnnn
+ #1 \s__fp_stop #2#3#4
+ { \__fp_parse:n { #4 {#2} } }
+\__msg_kernel_new:nnn { kernel } { unknown-fp-word }
+ { Unknown~fp~word~#1. }
+\__msg_kernel_new:nnn { kernel } { fp-missing }
+ { Missing~#1~inserted #2. }
+\__msg_kernel_new:nnn { kernel } { fp-extra }
+ { Extra~#1~ignored. }
+\__msg_kernel_new:nnn { kernel } { fp-early-end }
+ { Premature~end~in~fp~expression. }
+\__msg_kernel_new:nnn { kernel } { fp-after-e }
+ { Cannot~use~#1 after~'e'. }
+\__msg_kernel_new:nnn { kernel } { fp-missing-number }
+ { Missing~number~before~'#1'. }
+\__msg_kernel_new:nnn { kernel } { fp-unknown-symbol }
+ { Unknown~symbol~#1~ignored. }
+\__msg_kernel_new:nnn { kernel } { fp-extra-comma }
+ { Unexpected~comma:~extra~arguments~ignored. }
+\__msg_kernel_new:nnn { kernel } { fp-num-args }
+ { #1~expects~between~#2~and~#3~arguments. }
+%% File: l3fp-logic.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\prg_new_eq_conditional:NNn \fp_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \fp_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\prg_new_conditional:Npnn \fp_compare:n #1 { p , T , F , TF }
+ {
+ \exp_after:wN \__fp_compare_return:w
+ \tex_romannumeral:D -`0 \__fp_parse:n {#1}
+ }
+\cs_new:Npn \__fp_compare_return:w \s__fp \__fp_chk:w #1#2;
+ {
+ \if_meaning:w 0 #1
+ \prg_return_false:
+ \else:
+ \prg_return_true:
+ \fi:
+ }
+\prg_new_conditional:Npnn \fp_compare:nNn #1#2#3 { p , T , F , TF }
+ {
+ \if_int_compare:w
+ \exp_after:wN \__fp_compare_aux:wn
+ \tex_romannumeral:D -`0 \__fp_parse:n {#1} {#3}
+ = \__int_eval:w `#2 - `= \__int_eval_end:
+ \prg_return_true:
+ \else:
+ \prg_return_false:
+ \fi:
+ }
+\cs_new:Npn \__fp_compare_aux:wn #1; #2
+ {
+ \exp_after:wN \__fp_compare_back:ww
+ \tex_romannumeral:D -`0 \__fp_parse:n {#2} #1;
+ }
+\cs_new:Npn \__fp_compare_back:ww
+ \s__fp \__fp_chk:w #1 #2 #3;
+ \s__fp \__fp_chk:w #4 #5 #6;
+ {
+ \__int_value:w
+ \if_meaning:w 3 #1 \exp_after:wN \__fp_compare_nan:w \fi:
+ \if_meaning:w 3 #4 \exp_after:wN \__fp_compare_nan:w \fi:
+ \if_meaning:w 2 #5 - \fi:
+ \if_meaning:w #2 #5
+ \if_meaning:w #1 #4
+ \if_meaning:w 1 #1
+ \__fp_compare_npos:nwnw #6; #3;
+ \else:
+ 0
+ \fi:
+ \else:
+ \if_int_compare:w #4 < #1 - \fi: 1
+ \fi:
+ \else:
+ \if_int_compare:w #1#4 = \c_zero
+ 0
+ \else:
+ 1
+ \fi:
+ \fi:
+ \exp_stop_f:
+ }
+\cs_new:Npn \__fp_compare_nan:w #1 \exp_stop_f: { \c_two }
+\cs_new:Npn \__fp_compare_npos:nwnw #1#2; #3#4;
+ {
+ \if_int_compare:w #1 = #3 \exp_stop_f:
+ \__fp_compare_significand:nnnnnnnn #2 #4
+ \else:
+ \if_int_compare:w #1 < #3 - \fi: 1
+ \fi:
+ }
+\cs_new:Npn \__fp_compare_significand:nnnnnnnn #1#2#3#4#5#6#7#8
+ {
+ \if_int_compare:w #1#2 = #5#6 \exp_stop_f:
+ \if_int_compare:w #3#4 = #7#8 \exp_stop_f:
+ 0
+ \else:
+ \if_int_compare:w #3#4 < #7#8 - \fi: 1
+ \fi:
+ \else:
+ \if_int_compare:w #1#2 < #5#6 - \fi: 1
+ \fi:
+ }
+\cs_new:Npn \fp_do_until:nn #1#2
+ {
+ #2
+ \fp_compare:nF {#1}
+ { \fp_do_until:nn {#1} {#2} }
+ }
+\cs_new:Npn \fp_do_while:nn #1#2
+ {
+ #2
+ \fp_compare:nT {#1}
+ { \fp_do_while:nn {#1} {#2} }
+ }
+\cs_new:Npn \fp_until_do:nn #1#2
+ {
+ \fp_compare:nF {#1}
+ {
+ #2
+ \fp_until_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \fp_while_do:nn #1#2
+ {
+ \fp_compare:nT {#1}
+ {
+ #2
+ \fp_while_do:nn {#1} {#2}
+ }
+ }
+\cs_new:Npn \fp_do_until:nNnn #1#2#3#4
+ {
+ #4
+ \fp_compare:nNnF {#1} #2 {#3}
+ { \fp_do_until:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_new:Npn \fp_do_while:nNnn #1#2#3#4
+ {
+ #4
+ \fp_compare:nNnT {#1} #2 {#3}
+ { \fp_do_while:nNnn {#1} #2 {#3} {#4} }
+ }
+\cs_new:Npn \fp_until_do:nNnn #1#2#3#4
+ {
+ \fp_compare:nNnF {#1} #2 {#3}
+ {
+ #4
+ \fp_until_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_new:Npn \fp_while_do:nNnn #1#2#3#4
+ {
+ \fp_compare:nNnT {#1} #2 {#3}
+ {
+ #4
+ \fp_while_do:nNnn {#1} #2 {#3} {#4}
+ }
+ }
+\cs_new:Npn \__fp_minmax_o:Nw #1#2 @
+ {
+ \if_meaning:w 0 #1
+ \exp_after:wN \__fp_minmax_loop:Nww \exp_after:wN \c_one
+ \else:
+ \exp_after:wN \__fp_minmax_loop:Nww \exp_after:wN \c_minus_one
+ \fi:
+ #2
+ \s__fp \__fp_chk:w 2 #1 \s__fp_exact ;
+ \s__fp \__fp_chk:w { 3 \__fp_minmax_break_o:w } ;
+ }
+\cs_new:Npn \__fp_minmax_loop:Nww
+ #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5;
+ {
+ \if_meaning:w 3 #4
+ \if_meaning:w 3 #2
+ \__fp_minmax_auxi:ww
+ \else:
+ \__fp_minmax_auxii:ww
+ \fi:
+ \else:
+ \if_int_compare:w
+ \__fp_compare_back:ww
+ \s__fp \__fp_chk:w #4#5;
+ \s__fp \__fp_chk:w #2#3;
+ = #1
+ \__fp_minmax_auxii:ww
+ \else:
+ \__fp_minmax_auxi:ww
+ \fi:
+ \fi:
+ \__fp_minmax_loop:Nww #1
+ \s__fp \__fp_chk:w #2#3;
+ \s__fp \__fp_chk:w #4#5;
+ }
+\cs_new:Npn \__fp_minmax_auxi:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4;
+ { \fi: \fi: #2 \s__fp #3 ; }
+\cs_new:Npn \__fp_minmax_auxii:ww #1 \fi: \fi: #2 \s__fp #3 ;
+ { \fi: \fi: #2 }
+\cs_new:Npn \__fp_minmax_break_o:w #1 \fi: \fi: #2 \s__fp #3; #4;
+ { \fi: \__fp_exp_after_o:w \s__fp #3; }
+\cs_new:cpn { __fp_not_o:w } #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_meaning:w 0 #2
+ \exp_after:wN \exp_after:wN \exp_after:wN \c_one_fp
+ \else:
+ \exp_after:wN \exp_after:wN \exp_after:wN \c_zero_fp
+ \fi:
+ }
+\group_begin:
+ \char_set_catcode_letter:N &
+ \char_set_catcode_letter:N |
+ \cs_new:Npn \__fp_&_o:ww #1 \s__fp \__fp_chk:w #2#3;
+ {
+ \if_meaning:w 0 #2 #1
+ \__fp_and_return:wNw \s__fp \__fp_chk:w #2#3;
+ \fi:
+ \__fp_exp_after_o:w
+ }
+ \cs_new_nopar:Npn \__fp_|_o:ww { \__fp_&_o:ww \else: }
+\group_end:
+\cs_new:Npn \__fp_and_return:wNw #1; \fi: #2#3; { \fi: #2 #1; }
+\cs_new:Npn \__fp_ternary:NwwN #1 #2@ #3@ #4
+ {
+ \if_meaning:w \__fp_parse_infix_::N #4
+ \__fp_ternary_loop:Nw
+ #2
+ \s__fp \__fp_chk:w { \__fp_ternary_loop_break:w } ;
+ \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_auxi:NwwN }
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \__fp_exp_after_array_f:w #3 \s__fp_stop
+ \exp_after:wN @
+ \tex_romannumeral:D
+ \__fp_parse_operand:Nw \c_two
+ \__fp_parse_expand:w
+ \else:
+ \__msg_kernel_expandable_error:nnnn
+ { kernel } { fp-missing } { : } { ~for~?: }
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \__fp_exp_after_array_f:w #3 \s__fp_stop
+ \exp_after:wN #4
+ \exp_after:wN #1
+ \fi:
+ }
+\cs_new:Npn \__fp_ternary_loop_break:w #1 \fi: #2 \__fp_ternary_break_point:n #3
+ {
+ \c_zero = \c_zero \fi:
+ \exp_after:wN \__fp_ternary_auxii:NwwN
+ }
+\cs_new:Npn \__fp_ternary_loop:Nw \s__fp \__fp_chk:w #1#2;
+ {
+ \if_int_compare:w #1 > \c_zero
+ \exp_after:wN \__fp_ternary_map_break:
+ \fi:
+ \__fp_ternary_loop:Nw
+ }
+\cs_new:Npn \__fp_ternary_map_break: #1 \__fp_ternary_break_point:n #2 {#2}
+\cs_new:Npn \__fp_ternary_auxi:NwwN #1#2@#3@#4
+ {
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \__fp_exp_after_array_f:w #2 \s__fp_stop
+ #4 #1
+ }
+\cs_new:Npn \__fp_ternary_auxii:NwwN #1#2@#3@#4
+ {
+ \exp_after:wN \__fp_parse_continue:NwN
+ \exp_after:wN #1
+ \tex_romannumeral:D -`0
+ \__fp_exp_after_array_f:w #3 \s__fp_stop
+ #4 #1
+ }
+%% File: l3fp-basics.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_basics_pack_low:NNNNNw #1 #2#3#4#5 #6;
+ { + #1 - \c_one ; {#2#3#4#5} {#6} ; }
+\cs_new:Npn \__fp_basics_pack_high:NNNNNw #1 #2#3#4#5 #6;
+ {
+ \if_meaning:w 2 #1
+ \__fp_basics_pack_high_carry:w
+ \fi:
+ ; {#2#3#4#5} {#6}
+ }
+\cs_new:Npn \__fp_basics_pack_high_carry:w \fi: ; #1
+ { \fi: + \c_one ; {1000} }
+\cs_new:Npn \__fp_basics_pack_weird_low:NNNNw #1 #2#3#4 #5;
+ {
+ \if_meaning:w 2 #1
+ + \c_one
+ \fi:
+ \__int_eval_end:
+ #2#3#4; {#5} ;
+ }
+\cs_new:Npn \__fp_basics_pack_weird_high:NNNNNNNNw
+ 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} }
+\cs_new_nopar:cpx { __fp_-_o:ww } \s__fp
+ {
+ \exp_not:c { __fp_+_o:ww }
+ \exp_not:n { \s__fp \__fp_neg_sign:N }
+ }
+\cs_new:cpn { __fp_+_o:ww }
+ \s__fp #1 \__fp_chk:w #2 #3 ; \s__fp \__fp_chk:w #4 #5
+ {
+ \if_case:w
+ \if_meaning:w #2 #4
+ #2 \exp_stop_f:
+ \else:
+ \if_int_compare:w #2 > #4 \exp_stop_f:
+ \c_three
+ \else:
+ \c_minus_one
+ \fi:
+ \fi:
+ \exp_after:wN \__fp_add_zeros_o:Nww \__int_value:w
+ \or: \exp_after:wN \__fp_add_normal_o:Nww \__int_value:w
+ \or: \exp_after:wN \__fp_add_inf_o:Nww \__int_value:w
+ \or: \__fp_case_return_i_o:ww
+ \else: \exp_after:wN \__fp_add_return_ii_o:Nww \__int_value:w
+ \fi:
+ #1 #5
+ \s__fp \__fp_chk:w #2 #3 ;
+ \s__fp \__fp_chk:w #4 #5
+ }
+\cs_new:Npn \__fp_add_return_ii_o:Nww #1 #2 ; \s__fp \__fp_chk:w #3 #4
+ { \__fp_exp_after_o:w \s__fp \__fp_chk:w #3 #1 }
+\cs_new:Npn \__fp_add_zeros_o:Nww #1 \s__fp \__fp_chk:w 0 #2
+ {
+ \if_int_compare:w #2 #1 = 20 \exp_stop_f:
+ \exp_after:wN \__fp_add_return_ii_o:Nww
+ \else:
+ \__fp_case_return_i_o:ww
+ \fi:
+ #1
+ \s__fp \__fp_chk:w 0 #2
+ }
+\cs_new:Npn \__fp_add_inf_o:Nww
+ #1 \s__fp \__fp_chk:w 2 #2 #3; \s__fp \__fp_chk:w 2 #4
+ {
+ \if_meaning:w #1 #2
+ \__fp_case_return_i_o:ww
+ \else:
+ \__fp_case_use:nw
+ {
+ \if_meaning:w #1 #4
+ \exp_after:wN \__fp_invalid_operation_o:Nww
+ \exp_after:wN +
+ \else:
+ \exp_after:wN \__fp_invalid_operation_o:Nww
+ \exp_after:wN -
+ \fi:
+ }
+ \fi:
+ \s__fp \__fp_chk:w 2 #2 #3;
+ \s__fp \__fp_chk:w 2 #4
+ }
+\cs_new:Npn \__fp_add_normal_o:Nww #1 \s__fp \__fp_chk:w 1 #2
+ {
+ \if_meaning:w #1#2
+ \exp_after:wN \__fp_add_npos_o:NnwNnw
+ \else:
+ \exp_after:wN \__fp_sub_npos_o:NnwNnw
+ \fi:
+ #2
+ }
+\cs_new:Npn \__fp_add_npos_o:NnwNnw #1#2#3 ; \s__fp \__fp_chk:w 1 #4 #5
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ \if_int_compare:w #2 > #5 \exp_stop_f:
+ #2
+ \exp_after:wN \__fp_add_big_i_o:wNww \__int_value:w -
+ \else:
+ #5
+ \exp_after:wN \__fp_add_big_ii_o:wNww \__int_value:w
+ \fi:
+ \__int_eval:w #5 - #2 ; #1 #3;
+ }
+\cs_new:Npn \__fp_add_big_i_o:wNww #1; #2 #3; #4;
+ {
+ \__fp_decimate:nNnnnn {#1}
+ \__fp_add_significand_o:NnnwnnnnN
+ #4
+ #3
+ #2
+ }
+\cs_new:Npn \__fp_add_big_ii_o:wNww #1; #2 #3; #4;
+ {
+ \__fp_decimate:nNnnnn {#1}
+ \__fp_add_significand_o:NnnwnnnnN
+ #3
+ #4
+ #2
+ }
+\cs_new:Npn \__fp_add_significand_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8
+ {
+ \exp_after:wN \__fp_add_significand_test_o:N
+ \int_use:N \__int_eval:w 1#5#6 + #2
+ \exp_after:wN \__fp_add_significand_pack:NNNNNNN
+ \int_use:N \__int_eval:w 1#7#8 + #3 ; #1
+ }
+\cs_new:Npn \__fp_add_significand_pack:NNNNNNN #1 #2#3#4#5#6#7
+ {
+ \if_meaning:w 2 #1
+ + \c_one
+ \fi:
+ ; #2 #3 #4 #5 #6 #7 ;
+ }
+\cs_new:Npn \__fp_add_significand_test_o:N #1
+ {
+ \if_meaning:w 2 #1
+ \exp_after:wN \__fp_add_significand_carry_o:wwwNN
+ \else:
+ \exp_after:wN \__fp_add_significand_no_carry_o:wwwNN
+ \fi:
+ }
+\cs_new:Npn \__fp_add_significand_no_carry_o:wwwNN
+ #1; #2; #3#4 ; #5#6
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1 #1
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1 #2 #3#4
+ + \__fp_round:NNN #6 #4 #5
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_add_significand_carry_o:wwwNN
+ #1; #2; #3#4; #5#6
+ {
+ + \c_one
+ \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw
+ \int_use:N \__int_eval:w 1 1 #1
+ \exp_after:wN \__fp_basics_pack_weird_low:NNNNw
+ \int_use:N \__int_eval:w 1 #2#3 +
+ \exp_after:wN \__fp_round:NNN
+ \exp_after:wN #6
+ \exp_after:wN #3
+ \__int_value:w \__fp_round_digit:Nw #4 #5 ;
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_sub_npos_o:NnwNnw #1#2#3; \s__fp \__fp_chk:w 1 #4#5#6;
+ {
+ \if_case:w \__fp_compare_npos:nwnw {#2} #3; {#5} #6; \exp_stop_f:
+ \exp_after:wN \__fp_sub_eq_o:Nnwnw
+ \or:
+ \exp_after:wN \__fp_sub_npos_i_o:Nnwnw
+ \else:
+ \exp_after:wN \__fp_sub_npos_ii_o:Nnwnw
+ \fi:
+ #1 {#2} #3; {#5} #6;
+ }
+\cs_new:Npn \__fp_sub_eq_o:Nnwnw #1#2; #3; { \exp_after:wN \c_zero_fp }
+\cs_new:Npn \__fp_sub_npos_ii_o:Nnwnw #1 #2; #3;
+ {
+ \exp_after:wN \__fp_sub_npos_i_o:Nnwnw
+ \int_use:N \__int_eval:w \c_two - #1 \__int_eval_end:
+ #3; #2;
+ }
+\cs_new:Npn \__fp_sub_npos_i_o:Nnwnw #1 #2#3; #4#5;
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ #2
+ \if_int_compare:w #2 = #4 \exp_stop_f:
+ \exp_after:wN \__fp_sub_back_near_o:nnnnnnnnN
+ \else:
+ \exp_after:wN \__fp_decimate:nNnnnn \exp_after:wN
+ { \int_use:N \__int_eval:w #2 - #4 - \c_one \exp_after:wN }
+ \exp_after:wN \__fp_sub_back_far_o:NnnwnnnnN
+ \fi:
+ #5
+ #3
+ #1
+ }
+\cs_new:Npn \__fp_sub_back_near_o:nnnnnnnnN #1#2#3#4 #5#6#7#8 #9
+ {
+ \exp_after:wN \__fp_sub_back_near_after:wNNNNw
+ \int_use:N \__int_eval:w 10#5#6 - #1#2 - \c_eleven
+ \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw
+ \int_use:N \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_sub_back_near_pack:NNNNNNw #1#2#3#4#5#6#7 ;
+ { + #1#2 ; {#3#4#5#6} {#7} ; }
+\cs_new:Npn \__fp_sub_back_near_after:wNNNNw 10 #1#2#3#4 #5 ;
+ {
+ \if_meaning:w 0 #1
+ \exp_after:wN \__fp_sub_back_shift:wnnnn
+ \fi:
+ ; {#1#2#3#4} {#5}
+ }
+\cs_new:Npn \__fp_sub_back_shift:wnnnn ; #1#2
+ {
+ \exp_after:wN \__fp_sub_back_shift_ii:ww
+ \__int_value:w #1 #2 0 ;
+ }
+\cs_new:Npn \__fp_sub_back_shift_ii:ww #1 0 ; #2#3 ;
+ {
+ \if_meaning:w @ #1 @
+ - \c_seven
+ - \exp_after:wN \use_i:nnn
+ \exp_after:wN \__fp_sub_back_shift_iii:NNNNNNNNw
+ \__int_value:w #2#3 0 ~ 123456789;
+ \else:
+ - \__fp_sub_back_shift_iii:NNNNNNNNw #1 123456789;
+ \fi:
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_sub_back_shift_iv:nnnnw
+ \exp_after:wN ;
+ \__int_value:w
+ #1 ~ #2#3 0 ~ 0000 0000 0000 000 ;
+ }
+\cs_new:Npn \__fp_sub_back_shift_iii:NNNNNNNNw #1#2#3#4#5#6#7#8#9; {#8}
+\cs_new:Npn \__fp_sub_back_shift_iv:nnnnw #1 ; #2 ; { ; #1 ; }
+\cs_new:Npn \__fp_sub_back_far_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8
+ {
+ \if_case:w
+ \if_int_compare:w 1 #2 = #5#6 \use_i:nnnn #7 \exp_stop_f:
+ \if_int_compare:w #3 = \use_none:n #7#8 0 \exp_stop_f:
+ \c_zero
+ \else:
+ \if_int_compare:w #3 > \use_none:n #7#8 0 - \fi: \c_one
+ \fi:
+ \else:
+ \if_int_compare:w 1 #2 > #5#6 \use_i:nnnn #7 - \fi: \c_one
+ \fi:
+ \exp_after:wN \__fp_sub_back_quite_far_o:wwNN
+ \or: \exp_after:wN \__fp_sub_back_very_far_o:wwwwNN
+ \else: \exp_after:wN \__fp_sub_back_not_far_o:wwwwNN
+ \fi:
+ #2 ~ #3 ; #5 #6 ~ #7 #8 ; #1
+ }
+\cs_new:Npn \__fp_sub_back_quite_far_o:wwNN #1; #2; #3#4
+ {
+ \exp_after:wN \__fp_sub_back_quite_far_ii:NN
+ \exp_after:wN #3
+ \exp_after:wN #4
+ }
+\cs_new:Npn \__fp_sub_back_quite_far_ii:NN #1#2
+ {
+ \if_case:w \__fp_round_neg:NNN #2 0 #1
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { ; {1000} {0000} {0000} {0000} ; }
+ { - \c_one ; {9999} {9999} {9999} {9999} ; }
+ }
+\cs_new:Npn \__fp_sub_back_not_far_o:wwwwNN #1 ~ #2; #3 ~ #4; #5#6
+ {
+ - \c_one
+ \exp_after:wN \__fp_sub_back_near_after:wNNNNw
+ \int_use:N \__int_eval:w 1#30 - #1 - \c_eleven
+ \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw
+ \int_use:N \__int_eval:w 11 0000 0000 + #40 - #2
+ - \exp_after:wN \__fp_round_neg:NNN
+ \exp_after:wN #6
+ \use_none:nnnnnnn #2 #5
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_sub_back_very_far_o:wwwwNN #1#2#3#4#5#6#7
+ {
+ \__fp_pack_eight:wNNNNNNNN
+ \__fp_sub_back_very_far_ii_o:nnNwwNN
+ { 0 #1#2#3 #4#5#6#7 }
+ ;
+ }
+\cs_new:Npn \__fp_sub_back_very_far_ii_o:nnNwwNN #1#2 ; #3 ; #4 ~ #5; #6#7
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1#4 - #1 - \c_one
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 2#5 - #2
+ - \exp_after:wN \__fp_round_neg:NNN
+ \exp_after:wN #7
+ \__int_value:w
+ \if_int_odd:w \__int_eval:w #5 - #2 \__int_eval_end:
+ 1 \else: 2 \fi:
+ \__int_value:w \__fp_round_digit:Nw #3 #6 ;
+ \exp_after:wN ;
+ }
+\cs_new_nopar:cpn { __fp_*_o:ww }
+ {
+ \__fp_mul_cases_o:NnNnww
+ *
+ { - \c_two + }
+ \__fp_mul_npos_o:Nww
+ { }
+ }
+\cs_new:Npn \__fp_mul_cases_o:NnNnww
+ #1#2#3#4 \s__fp \__fp_chk:w #5#6#7; \s__fp \__fp_chk:w #8#9
+ {
+ \if_case:w \__int_eval:w
+ \if_int_compare:w #5 #8 = \c_eleven
+ \c_one
+ \else:
+ \if_meaning:w 3 #8
+ \c_three
+ \else:
+ \if_meaning:w 3 #5
+ \c_two
+ \else:
+ \if_int_compare:w #5 #8 = \c_ten
+ \c_nine #2 - \c_two
+ \else:
+ (#5 #2 #8) / \c_two * \c_two + \c_seven
+ \fi:
+ \fi:
+ \fi:
+ \fi:
+ \if_meaning:w #6 #9 - \c_one \fi:
+ \__int_eval_end:
+ \__fp_case_use:nw { #3 0 }
+ \or: \__fp_case_use:nw { #3 2 }
+ \or: \__fp_case_return_i_o:ww
+ \or: \__fp_case_return_ii_o:ww
+ \or: \__fp_case_return_o:Nww \c_zero_fp
+ \or: \__fp_case_return_o:Nww \c_minus_zero_fp
+ \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 }
+ \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 }
+ \or: \__fp_case_return_o:Nww \c_inf_fp
+ \or: \__fp_case_return_o:Nww \c_minus_inf_fp
+ #4
+ \fi:
+ \s__fp \__fp_chk:w #5 #6 #7;
+ \s__fp \__fp_chk:w #8 #9
+ }
+\cs_new:Npn \__fp_mul_npos_o:Nww
+ #1 \s__fp \__fp_chk:w #2 #3 #4 #5 ; \s__fp \__fp_chk:w #6 #7 #8 #9 ;
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ #4 + #8
+ \__fp_mul_significand_o:nnnnNnnnn #5 #1 #9
+ }
+\cs_new:Npn \__fp_mul_significand_o:nnnnNnnnn #1#2#3#4 #5 #6#7#8#9
+ {
+ \exp_after:wN \__fp_mul_significand_test_f:NNN
+ \exp_after:wN #5
+ \int_use:N \__int_eval:w 99990000 + #1*#6 +
+ \exp_after:wN \__fp_mul_significand_keep:NNNNNw
+ \int_use:N \__int_eval:w 99990000 + #1*#7 + #2*#6 +
+ \exp_after:wN \__fp_mul_significand_keep:NNNNNw
+ \int_use:N \__int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 +
+ \exp_after:wN \__fp_mul_significand_drop:NNNNNw
+ \int_use:N \__int_eval:w 99990000 + #1*#9 + #2*#8 + #3*#7 + #4*#6 +
+ \exp_after:wN \__fp_mul_significand_drop:NNNNNw
+ \int_use:N \__int_eval:w 99990000 + #2*#9 + #3*#8 + #4*#7 +
+ \exp_after:wN \__fp_mul_significand_drop:NNNNNw
+ \int_use:N \__int_eval:w 99990000 + #3*#9 + #4*#8 +
+ \exp_after:wN \__fp_mul_significand_drop:NNNNNw
+ \int_use:N \__int_eval:w 100000000 + #4*#9 ;
+ ; \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_mul_significand_drop:NNNNNw #1#2#3#4#5 #6;
+ { #1#2#3#4#5 ; + #6 }
+\cs_new:Npn \__fp_mul_significand_keep:NNNNNw #1#2#3#4#5 #6;
+ { #1#2#3#4#5 ; #6 ; }
+\cs_new:Npn \__fp_mul_significand_test_f:NNN #1 #2 #3
+ {
+ \if_meaning:w 0 #3
+ \exp_after:wN \__fp_mul_significand_small_f:NNwwwN
+ \else:
+ \exp_after:wN \__fp_mul_significand_large_f:NwwNNNN
+ \fi:
+ #1 #3
+ }
+\cs_new:Npn \__fp_mul_significand_large_f:NwwNNNN #1 #2; #3; #4#5#6#7; +
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1#2
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1#3#4#5#6#7
+ + \exp_after:wN \__fp_round:NNN
+ \exp_after:wN #1
+ \exp_after:wN #7
+ \__int_value:w \__fp_round_digit:Nw
+ }
+\cs_new:Npn \__fp_mul_significand_small_f:NNwwwN #1 #2#3; #4#5; #6; + #7
+ {
+ - \c_one
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1#3#4
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1#5#6#7
+ + \exp_after:wN \__fp_round:NNN
+ \exp_after:wN #1
+ \exp_after:wN #7
+ \__int_value:w \__fp_round_digit:Nw
+ }
+\cs_new_nopar:cpn { __fp_/_o:ww }
+ {
+ \__fp_mul_cases_o:NnNnww
+ /
+ { - }
+ \__fp_div_npos_o:Nww
+ {
+ \or:
+ \__fp_case_use:nw
+ { \__fp_division_by_zero_o:NNww \c_inf_fp / }
+ \or:
+ \__fp_case_use:nw
+ { \__fp_division_by_zero_o:NNww \c_minus_inf_fp / }
+ }
+ }
+\cs_new:Npn \__fp_div_npos_o:Nww
+ #1 \s__fp \__fp_chk:w 1 #2 #3 #4 ; \s__fp \__fp_chk:w 1 #5 #6 #7#8#9;
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ #3 - #6
+ \exp_after:wN \__fp_div_significand_i_o:wnnw
+ \int_use:N \__int_eval:w #7 \use_i:nnnn #8 + \c_one ;
+ #4
+ {#7}{#8}#9 ;
+ #1
+ }
+\cs_new:Npn \__fp_div_significand_i_o:wnnw #1 ; #2#3 #4 ;
+ {
+ \exp_after:wN \__fp_div_significand_test_o:w
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
+ \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ;
+ #2 #3 ;
+ #4
+ { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_div_significand_iii:wwnnnnn \__int_value:w #1 }
+ }
+\cs_new:Npn \__fp_div_significand_calc:wwnnnnnnn 1#1
+ {
+ \if_meaning:w 1 #1
+ \exp_after:wN \__fp_div_significand_calc_i:wwnnnnnnn
+ \else:
+ \exp_after:wN \__fp_div_significand_calc_ii:wwnnnnnnn
+ \fi:
+ }
+\cs_new:Npn \__fp_div_significand_calc_i:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
+ {
+ 1 1 #1
+ #9 \exp_after:wN ;
+ \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int
+ + #2 - #1 * #5 - #5#60
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
+ + #3 - #1 * #6 - #70
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
+ + #4 - #1 * #7 - #80
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int
+ - #1 * #8 ;
+ {#5}{#6}{#7}{#8}
+ }
+\cs_new:Npn \__fp_div_significand_calc_ii:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
+ {
+ 1 0 #1
+ #9 \exp_after:wN ;
+ \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int
+ + #2 - #1 * #5
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
+ + #3 - #1 * #6
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
+ + #4 - #1 * #7
+ \exp_after:wN \__fp_pack_Bigg:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int
+ - #1 * #8 ;
+ {#5}{#6}{#7}{#8}
+ }
+\cs_new:Npn \__fp_div_significand_ii:wwn #1; #2;#3
+ {
+ \exp_after:wN \__fp_div_significand_pack:NNN
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
+ \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ;
+ }
+\cs_new:Npn \__fp_div_significand_iii:wwnnnnn #1; #2;#3#4#5 #6#7
+ {
+ 0
+ \exp_after:wN \__fp_div_significand_iv:wwnnnnnnn
+ \int_use:N \__int_eval:w (\c_two * #2 #3) / #6 #7 ; % <- P
+ #2 ; {#3} {#4} {#5}
+ {#6} {#7}
+ }
+\cs_new:Npn \__fp_div_significand_iv:wwnnnnnnn #1; #2;#3#4#5 #6#7#8#9
+ {
+ + \c_five * #1
+ \exp_after:wN \__fp_div_significand_vi:Nw
+ \int_use:N \__int_eval:w -20 + 2*#2#3 - #1*#6#7 +
+ \exp_after:wN \__fp_div_significand_v:NN
+ \int_use:N \__int_eval:w 199980 + 2*#4 - #1*#8 +
+ \exp_after:wN \__fp_div_significand_v:NN
+ \int_use:N \__int_eval:w 200000 + 2*#5 - #1*#9 ;
+ }
+\cs_new:Npn \__fp_div_significand_v:NN #1#2 { #1#2 \__int_eval_end: + }
+\cs_new:Npn \__fp_div_significand_vi:Nw #1#2;
+ {
+ \if_meaning:w 0 #1
+ \if_int_compare:w \__int_eval:w #2 > \c_zero + \c_one \fi:
+ \else:
+ \if_meaning:w - #1 - \else: + \fi: \c_one
+ \fi:
+ ;
+ }
+\cs_new:Npn \__fp_div_significand_pack:NNN 1 #1 #2 { + #1 #2 ; }
+\cs_new:Npn \__fp_div_significand_test_o:w 10 #1
+ {
+ \if_meaning:w 0 #1
+ \exp_after:wN \__fp_div_significand_small_o:wwwNNNNwN
+ \else:
+ \exp_after:wN \__fp_div_significand_large_o:wwwNNNNwN
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_div_significand_small_o:wwwNNNNwN
+ 0 #1; #2; #3; #4#5#6#7#8; #9
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1 #1#2
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1 #3#4#5#6#7
+ + \__fp_round:NNN #9 #7 #8
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_div_significand_large_o:wwwNNNNwN
+ #1; #2; #3; #4#5#6#7#8; #9
+ {
+ + \c_one
+ \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw
+ \int_use:N \__int_eval:w 1 #1 #2
+ \exp_after:wN \__fp_basics_pack_weird_low:NNNNw
+ \int_use:N \__int_eval:w 1 #3 #4 #5 #6 +
+ \exp_after:wN \__fp_round:NNN
+ \exp_after:wN #9
+ \exp_after:wN #6
+ \__int_value:w \__fp_round_digit:Nw #7 #8 ;
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_sqrt_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_meaning:w 0 #2 \__fp_case_return_same_o:w \fi:
+ \if_meaning:w 2 #3
+ \__fp_case_use:nw { \__fp_invalid_operation_o:nw { sqrt } }
+ \fi:
+ \if_meaning:w 1 #2 \else: \__fp_case_return_same_o:w \fi:
+ \__fp_sqrt_npos_o:w
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_sqrt_npos_o:w \s__fp \__fp_chk:w 1 0 #1#2#3#4#5;
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN 0
+ \int_use:N \__int_eval:w
+ \if_int_odd:w #1 \exp_stop_f:
+ \exp_after:wN \__fp_sqrt_npos_auxi_o:wwnnN
+ \fi:
+ #1 / \c_two
+ \__fp_sqrt_Newton_o:wwn 56234133; 0; {#2#3} {#4#5} 0
+ }
+\cs_new:Npn \__fp_sqrt_npos_auxi_o:wwnnN #1 / \c_two #2; 0; #3#4#5
+ {
+ ( #1 + \c_one ) / \c_two
+ \__fp_pack_eight:wNNNNNNNN
+ \__fp_sqrt_npos_auxii_o:wNNNNNNNN
+ ;
+ 0 #3 #4
+ }
+\cs_new:Npn \__fp_sqrt_npos_auxii_o:wNNNNNNNN #1; #2#3#4#5#6#7#8#9
+ { \__fp_sqrt_Newton_o:wwn 17782794; 0; {#1} {#2#3#4#5#6#7#8#9} }
+\cs_new:Npn \__fp_sqrt_Newton_o:wwn #1; #2; #3
+ {
+ \if_int_compare:w #1 = #2 \exp_stop_f:
+ \exp_after:wN \__fp_sqrt_auxi_o:NNNNwnnN
+ \int_use:N \__int_eval:w 9999 9999 +
+ \exp_after:wN \__fp_use_none_until_s:w
+ \fi:
+ \exp_after:wN \__fp_sqrt_Newton_o:wwn
+ \int_use:N \__int_eval:w (#1 + #3 * 1 0000 0000 / #1) / \c_two ;
+ #1; {#3}
+ }
+\cs_new:Npn \__fp_sqrt_auxi_o:NNNNwnnN 1 #1#2#3#4#5;
+ {
+ \__fp_sqrt_auxii_o:NnnnnnnnN
+ \__fp_sqrt_auxiii_o:wnnnnnnnn
+ {#1#2#3#4} {#5} {2499} {9988} {7500}
+ }
+\cs_new:Npn \__fp_sqrt_auxii_o:NnnnnnnnN #1 #2#3#4#5#6 #7#8#9
+ {
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
+ + #7 - #2 * #2
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ - 2 * #2 * #3
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ + #8 - #3 * #3 - 2 * #2 * #4
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ - 2 * #3 * #4 - 2 * #2 * #5
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ + #9 000 0000 - #4 * #4 - 2 * #3 * #5 - 2 * #2 * #6
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ - 2 * #4 * #5 - 2 * #3 * #6
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ - #5 * #5 - 2 * #4 * #6
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w
+ \c__fp_big_middle_shift_int
+ - 2 * #5 * #6
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w
+ \c__fp_big_trailing_shift_int
+ - #6 * #6 ;
+ % (
+ - 257 ) * 5000 0000 / (#2#3 + 1) + 10 0000 0000 ;
+ {#2}{#3}{#4}{#5}{#6} {#7}{#8}#9
+ }
+\cs_new:Npn \__fp_sqrt_auxiii_o:wnnnnnnnn
+ #1; #2#3#4#5#6#7#8#9
+ {
+ \if_int_compare:w #1 > \c_one
+ \exp_after:wN \__fp_sqrt_auxiv_o:NNNNNw
+ \int_use:N \__int_eval:w (#1#2 %)
+ \else:
+ \if_int_compare:w #1#2 > \c_one
+ \exp_after:wN \__fp_sqrt_auxv_o:NNNNNw
+ \int_use:N \__int_eval:w (#1#2#3 %)
+ \else:
+ \if_int_compare:w #1#2#3 > \c_one
+ \exp_after:wN \__fp_sqrt_auxvi_o:NNNNNw
+ \int_use:N \__int_eval:w (#1#2#3#4 %)
+ \else:
+ \exp_after:wN \__fp_sqrt_auxvii_o:NNNNNw
+ \int_use:N \__int_eval:w (#1#2#3#4#5 %)
+ \fi:
+ \fi:
+ \fi:
+ }
+\cs_new:Npn \__fp_sqrt_auxiv_o:NNNNNw 1#1#2#3#4#5#6;
+ { \__fp_sqrt_auxviii_o:nnnnnnn {#1#2#3#4#5#6} {00000000} }
+\cs_new:Npn \__fp_sqrt_auxv_o:NNNNNw 1#1#2#3#4#5#6;
+ { \__fp_sqrt_auxviii_o:nnnnnnn {000#1#2#3#4#5} {#60000} }
+\cs_new:Npn \__fp_sqrt_auxvi_o:NNNNNw 1#1#2#3#4#5#6;
+ { \__fp_sqrt_auxviii_o:nnnnnnn {0000000#1} {#2#3#4#5#6} }
+\cs_new:Npn \__fp_sqrt_auxvii_o:NNNNNw 1#1#2#3#4#5#6;
+ {
+ \if_int_compare:w #1#2 = \c_zero
+ \exp_after:wN \__fp_sqrt_auxx_o:Nnnnnnnn
+ \fi:
+ \__fp_sqrt_auxviii_o:nnnnnnn {00000000} {000#1#2#3#4#5}
+ }
+\cs_new:Npn \__fp_sqrt_auxviii_o:nnnnnnn #1#2 #3#4#5#6#7
+ {
+ \exp_after:wN \__fp_sqrt_auxix_o:wnwnw
+ \int_use:N \__int_eval:w #3
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w #1 + 1#4#5
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w #2 + 1#6#7 ;
+ }
+\cs_new:Npn \__fp_sqrt_auxix_o:wnwnw #1; #2#3; #4#5;
+ {
+ \__fp_sqrt_auxii_o:NnnnnnnnN
+ \__fp_sqrt_auxiii_o:wnnnnnnnn {#1}{#2}{#3}{#4}{#5}
+ }
+\cs_new:Npn \__fp_sqrt_auxx_o:Nnnnnnnn #1#2#3 #4#5#6#7#8
+ {
+ \exp_after:wN \__fp_sqrt_auxxi_o:wwnnN
+ \int_use:N \__int_eval:w
+ (#8 + 2499) / 5000 * 5000 ;
+ {#4} {#5} {#6} {#7} ;
+ }
+\cs_new:Npn \__fp_sqrt_auxxi_o:wwnnN #1; #2; #3#4#5
+ {
+ \__fp_sqrt_auxii_o:NnnnnnnnN
+ \__fp_sqrt_auxxii_o:nnnnnnnnw
+ #2 {#1}
+ {#3} { #4 + \c_one } #5
+ }
+\cs_new:Npn \__fp_sqrt_auxxii_o:nnnnnnnnw 0; #1#2#3#4#5#6#7#8 #9;
+ {
+ \if_int_compare:w #1#2 > \c_zero
+ \if_int_compare:w #1#2 = \c_one
+ \if_int_compare:w #3#4 = \c_zero
+ \if_int_compare:w #5#6 = \c_zero
+ \if_int_compare:w #7#8 = \c_zero
+ \__fp_sqrt_auxxiii_o:w
+ \fi:
+ \fi:
+ \fi:
+ \fi:
+ \exp_after:wN \__fp_sqrt_auxxiv_o:wnnnnnnnN
+ \__int_value:w 9998
+ \else:
+ \exp_after:wN \__fp_sqrt_auxxiv_o:wnnnnnnnN
+ \__int_value:w 10000
+ \fi:
+ ;
+ }
+\cs_new:Npn \__fp_sqrt_auxxiii_o:w \fi: \fi: \fi: \fi: #1 \fi: ;
+ {
+ \fi: \fi: \fi: \fi: \fi:
+ \__fp_sqrt_auxxiv_o:wnnnnnnnN 9999 ;
+ }
+\cs_new:Npn \__fp_sqrt_auxxiv_o:wnnnnnnnN #1; #2#3#4#5#6 #7#8#9
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1 0000 0000 + #2#3
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1 0000 0000
+ + #4#5
+ \if_int_compare:w #6 > #1 \exp_stop_f: + \c_one \fi:
+ + \exp_after:wN \__fp_round:NNN
+ \exp_after:wN 0
+ \exp_after:wN 0
+ \__int_value:w
+ \exp_after:wN \use_i:nn
+ \exp_after:wN \__fp_round_digit:Nw
+ \int_use:N \__int_eval:w #6 + 19999 - #1 ;
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_set_sign_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \exp_after:wN \__fp_exp_after_o:w
+ \exp_after:wN \s__fp
+ \exp_after:wN \__fp_chk:w
+ \exp_after:wN #2
+ \__int_value:w
+ \if_case:w #3 \exp_stop_f: #1 \or: 1 \or: 0 \fi: \exp_stop_f:
+ #4;
+ }
+%% File: l3fp-extended.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\tl_const:Nn \c__fp_one_fixed_tl
+ { {10000} {0000} {0000} {0000} {0000} {0000} }
+\cs_new:Npn \__fp_fixed_continue:wn #1; #2 { #2 #1; }
+\cs_new:Npn \__fp_fixed_add_one:wN #1#2; #3
+ {
+ \exp_after:wN #3 \exp_after:wN
+ { \int_use:N \__int_eval:w \c_ten_thousand + #1 } #2 ;
+ }
+\cs_new:Npn \__fp_fixed_div_myriad:wn #1#2#3#4#5#6;
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_trailing_shift_int
+ + #1 ; {#2}{#3}{#4}{#5};
+ }
+\cs_new:Npn \__fp_fixed_mul_after:wwn #1; #2; #3 { #3 {#1} #2; }
+\cs_new:Npn \__fp_fixed_mul_short:wwn #1#2#3#4#5#6; #7#8#9;
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ + #1*#7
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#8 + #2*#7
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#9 + #2*#8 + #3*#7
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #2*#9 + #3*#8 + #4*#7
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #3*#9 + #4*#8 + #5*#7
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_trailing_shift_int
+ + #4*#9 + #5*#8 + #6*#7
+ + ( #5*#9 + #6*#8 + #6*#9 / \c_ten_thousand )
+ / \c_ten_thousand ; ;
+ }
+\cs_new:Npn \__fp_fixed_div_int:wwN #1#2#3#4#5#6 ; #7 ; #8
+ {
+ \exp_after:wN \__fp_fixed_div_int_after:Nw
+ \exp_after:wN #8
+ \int_use:N \__int_eval:w \c_minus_one
+ \__fp_fixed_div_int:wnN
+ #1; {#7} \__fp_fixed_div_int_auxi:wnn
+ #2; {#7} \__fp_fixed_div_int_auxi:wnn
+ #3; {#7} \__fp_fixed_div_int_auxi:wnn
+ #4; {#7} \__fp_fixed_div_int_auxi:wnn
+ #5; {#7} \__fp_fixed_div_int_auxi:wnn
+ #6; {#7} \__fp_fixed_div_int_auxii:wnn ;
+ }
+\cs_new:Npn \__fp_fixed_div_int:wnN #1; #2 #3
+ {
+ \exp_after:wN #3
+ \int_use:N \__int_eval:w #1 / #2 - \c_one ;
+ {#2}
+ {#1}
+ }
+\cs_new:Npn \__fp_fixed_div_int_auxi:wnn #1; #2 #3
+ {
+ + #1
+ \exp_after:wN \__fp_fixed_div_int_pack:Nw
+ \int_use:N \__int_eval:w 9999
+ \exp_after:wN \__fp_fixed_div_int:wnN
+ \int_use:N \__int_eval:w #3 - #1*#2 \__int_eval_end:
+ }
+\cs_new:Npn \__fp_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; }
+\cs_new:Npn \__fp_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} }
+\cs_new:Npn \__fp_fixed_div_int_after:Nw #1 #2; { #1 {#2} }
+\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + }
+\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - }
+\cs_new:Npn \__fp_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8
+ {
+ \exp_after:wN \__fp_fixed_add_after:NNNNNwn
+ \int_use:N \__int_eval:w 9 9999 9998 + #2#3 #1 #7#8
+ \exp_after:wN \__fp_fixed_add_pack:NNNNNwn
+ \int_use:N \__int_eval:w 1 9999 9998 + #4#5
+ \__fp_fixed_add:nnNnnnwn #6 #1
+ }
+\cs_new:Npn \__fp_fixed_add:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8
+ {
+ #3 #4#5
+ \exp_after:wN \__fp_fixed_add_pack:NNNNNwn
+ \int_use:N \__int_eval:w 2 0000 0000 #3 #6#7 + #1#2 ; {#8} ;
+ }
+\cs_new:Npn \__fp_fixed_add_pack:NNNNNwn #1 #2#3#4#5 #6; #7
+ { + #1 ; {#7} {#2#3#4#5} {#6} }
+\cs_new:Npn \__fp_fixed_add_after:NNNNNwn 1 #1 #2#3#4#5 #6; #7
+ { #7 {#1#2#3#4#5} {#6} }
+\cs_new:Npn \__fp_fixed_mul:wwn #1#2#3#4 #5; #6#7#8#9
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#6
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#7 + #2*#6
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#8 + #2*#7 + #3*#6
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #1*#9 + #2*#8 + #3*#7 + #4*#6
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_trailing_shift_int
+ + #2*#9 + #3*#8 + #4*#7
+ + ( #3*#9 + #4*#8
+ + \__fp_fixed_mul:nnnnnnnw #5 {#6}{#7} {#1}{#2}
+ }
+\cs_new:Npn \__fp_fixed_mul:nnnnnnnw #1#2 #3#4 #5#6 #7#8 ;
+ {
+ #1*#4 + #2*#3 + #5*#8 + #6*#7 ) / \c_ten_thousand
+ + #1*#3 + #5*#7 ; ;
+ }
+\cs_new:Npn \__fp_fixed_mul_add:wwwn #1; #2; #3#4#5#6#7#8;
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4
+ \__fp_fixed_mul_add:Nwnnnwnnn +
+ + #5 #6 ; #2 ; #1 ; #2 ; +
+ + #7 #8 ; ;
+ }
+\cs_new:Npn \__fp_fixed_mul_sub_back:wwwn #1; #2; #3#4#5#6#7#8;
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4
+ \__fp_fixed_mul_add:Nwnnnwnnn -
+ + #5 #6 ; #2 ; #1 ; #2 ; -
+ + #7 #8 ; ;
+ }
+\cs_new:Npn \__fp_fixed_one_minus_mul:wwn #1; #2;
+ {
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + 1 0000 0000
+ \__fp_fixed_mul_add:Nwnnnwnnn -
+ ; #2 ; #1 ; #2 ; -
+ ; ;
+ }
+\cs_new:Npn \__fp_fixed_mul_add:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9
+ {
+ #1 #7*#3
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ #1 #7*#4 #1 #8*#3
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ #1 #7*#5 #1 #8*#4 #1 #9*#3 #2
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
+ #1 \__fp_fixed_mul_add:nnnnwnnnn {#7}{#8}{#9}
+ }
+\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnnn #1#2#3#4#5; #6#7#8#9
+ {
+ ( #1*#9 + #2*#8 + #3*#7 + #4*#6 )
+ \exp_after:wN \__fp_pack_big:NNNNNNw
+ \int_use:N \__int_eval:w \c__fp_big_trailing_shift_int
+ \__fp_fixed_mul_add:nnnnwnnwN
+ { #6 + #4*#7 + #3*#8 + #2*#9 + #1 }
+ { #7 + #4*#8 + #3*#9 + #2 }
+ {#1} #5;
+ {#6}
+ }
+\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9
+ {
+ #9 (#4* #1 *#7)
+ #9 (#5*#6+#4* #2 *#7+#3*#8) / \c_ten_thousand
+ }
+\cs_new:Npn \__fp_ep_to_fixed:wwn #1,#2
+ {
+ \exp_after:wN \__fp_ep_to_fixed_auxi:www
+ \int_use:N \__int_eval:w 1 0000 0000 + #2 \exp_after:wN ;
+ \tex_romannumeral:D -`0
+ \prg_replicate:nn { \c_four - \int_max:nn {#1} { -32 } } { 0 } ;
+ }
+\cs_new:Npn \__fp_ep_to_fixed_auxi:www 1#1; #2; #3#4#5#6#7;
+ {
+ \__fp_pack_eight:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_ep_to_fixed_auxii:nnnnnnnwn ;
+ #2 #1#3#4#5#6#7 0000 !
+ }
+\cs_new:Npn \__fp_ep_to_fixed_auxii:nnnnnnnwn #1#2#3#4#5#6#7; #8! #9
+ { #9 {#1#2}{#3}{#4}{#5}{#6}{#7}; }
+\cs_new:Npn \__fp_ep_to_ep:wwN #1,#2#3#4#5#6#7; #8
+ {
+ \exp_after:wN #8
+ \int_use:N \__int_eval:w #1 + \c_four
+ \exp_after:wN \use_i:nn
+ \exp_after:wN \__fp_ep_to_ep_loop:N
+ \int_use:N \__int_eval:w 1 0000 0000 + #2 \__int_eval_end:
+ #3#4#5#6#7 ; ; !
+ }
+\cs_new:Npn \__fp_ep_to_ep_loop:N #1
+ {
+ \if_meaning:w 0 #1
+ - \c_one
+ \else:
+ \__fp_ep_to_ep_end:www #1
+ \fi:
+ \__fp_ep_to_ep_loop:N
+ }
+\cs_new:Npn \__fp_ep_to_ep_end:www
+ #1 \fi: \__fp_ep_to_ep_loop:N #2; #3!
+ {
+ \fi:
+ \if_meaning:w ; #1
+ - \c_two * \c__fp_max_exponent_int
+ \__fp_ep_to_ep_zero:ww
+ \fi:
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_use_i:ww , ;
+ #1 #2 0000 0000 0000 0000 0000 0000 ;
+ }
+\cs_new:Npn \__fp_ep_to_ep_zero:ww \fi: #1; #2; #3;
+ { \fi: , {1000}{0000}{0000}{0000}{0000}{0000} ; }
+\cs_new:Npn \__fp_ep_compare:wwww #1,#2#3#4#5#6#7;
+ { \__fp_ep_compare_aux:wwww {#1}{#2}{#3}{#4}{#5}; #6#7; }
+\cs_new:Npn \__fp_ep_compare_aux:wwww #1;#2;#3,#4#5#6#7#8#9;
+ {
+ \if_case:w
+ \__fp_compare_npos:nwnw #1; {#3}{#4}{#5}{#6}{#7}; \exp_stop_f:
+ \if_int_compare:w #2 = #8#9 \exp_stop_f:
+ 0
+ \else:
+ \if_int_compare:w #2 < #8#9 - \fi: 1
+ \fi:
+ \or: 1
+ \else: -1
+ \fi:
+ }
+\cs_new:Npn \__fp_ep_mul:wwwwn #1,#2; #3,#4;
+ {
+ \__fp_ep_to_ep:wwN #3,#4;
+ \__fp_fixed_continue:wn
+ {
+ \__fp_ep_to_ep:wwN #1,#2;
+ \__fp_ep_mul_raw:wwwwN
+ }
+ \__fp_fixed_continue:wn
+ }
+\cs_new:Npn \__fp_ep_mul_raw:wwwwN #1,#2; #3,#4; #5
+ {
+ \__fp_fixed_mul:wwn #2; #4;
+ { \exp_after:wN #5 \int_use:N \__int_eval:w #1 + #3 , }
+ }
+\cs_new:Npn \__fp_ep_div:wwwwn #1,#2; #3,#4;
+ {
+ \__fp_ep_to_ep:wwN #1,#2;
+ \__fp_fixed_continue:wn
+ {
+ \__fp_ep_to_ep:wwN #3,#4;
+ \__fp_ep_div_esti:wwwwn
+ }
+ }
+\cs_new:Npn \__fp_ep_div_esti:wwwwn #1,#2#3; #4,
+ {
+ \exp_after:wN \__fp_ep_div_estii:wwnnwwn
+ \int_use:N \__int_eval:w 10 0000 0000 / ( #2 + \c_one )
+ \exp_after:wN ;
+ \int_use:N \__int_eval:w #4 - #1 + \c_one ,
+ {#2} #3;
+ }
+\cs_new:Npn \__fp_ep_div_estii:wwnnwwn #1; #2,#3#4#5; #6; #7
+ {
+ \exp_after:wN \__fp_ep_div_estiii:NNNNNwwwn
+ \int_use:N \__int_eval:w 10 0000 0000 - 1750
+ + #1 000 + (10 0000 0000 / #3 - #1) * (1000 - #4 / 10) ;
+ {#3}{#4}#5; #6; { #7 #2, }
+ }
+\cs_new:Npn \__fp_ep_div_estiii:NNNNNwwwn 1#1#2#3#4#5#6; #7;
+ {
+ \__fp_fixed_mul_short:wwn #7; {#1}{#2#3#4#5}{#6};
+ \__fp_ep_div_epsi:wnNNNNNn {#1#2#3#4}#5#6
+ \__fp_fixed_mul:wwn
+ }
+\cs_new:Npn \__fp_ep_div_epsi:wnNNNNNn #1#2#3#4#5#6;
+ {
+ \exp_after:wN \__fp_ep_div_epsii:wwnNNNNNn
+ \int_use:N \__int_eval:w 1 9998 - #2
+ \exp_after:wN \__fp_ep_div_eps_pack:NNNNNw
+ \int_use:N \__int_eval:w 1 9999 9998 - #3#4
+ \exp_after:wN \__fp_ep_div_eps_pack:NNNNNw
+ \int_use:N \__int_eval:w 2 0000 0000 - #5#6 ; ;
+ }
+\cs_new:Npn \__fp_ep_div_eps_pack:NNNNNw #1#2#3#4#5#6;
+ { + #1 ; {#2#3#4#5} {#6} }
+\cs_new:Npn \__fp_ep_div_epsii:wwnNNNNNn 1#1; #2; #3#4#5#6#7#8
+ {
+ \__fp_fixed_mul:wwn {0000}{#1}#2; {0000}{#1}#2;
+ \__fp_fixed_add_one:wN
+ \__fp_fixed_mul:wwn {10000} {#1} #2 ;
+ {
+ \__fp_fixed_mul_short:wwn {0000}{#1}#2; {#3}{#4#5#6#7}{#8000};
+ \__fp_fixed_div_myriad:wn
+ \__fp_fixed_mul:wwn
+ }
+ \__fp_fixed_add:wwn {#3}{#4#5#6#7}{#8000}{0000}{0000}{0000};
+ }
+\cs_new:Npn \__fp_ep_isqrt:wwn #1,#2;
+ {
+ \__fp_ep_to_ep:wwN #1,#2;
+ \__fp_ep_isqrt_auxi:wwn
+ }
+\cs_new:Npn \__fp_ep_isqrt_auxi:wwn #1,
+ {
+ \exp_after:wN \__fp_ep_isqrt_auxii:wwnnnwn
+ \int_use:N \__int_eval:w
+ \int_if_odd:nTF {#1}
+ { (\c_one - #1) / \c_two , 535 , { 0 } { } }
+ { \c_one - #1 / \c_two , 168 , { } { 0 } }
+ }
+\cs_new:Npn \__fp_ep_isqrt_auxii:wwnnnwn #1, #2, #3#4 #5#6; #7
+ {
+ \__fp_ep_isqrt_esti:wwwnnwn #2, 0, #5, {#3} {#4}
+ {#5} #6 ; { #7 #1 , }
+ }
+\cs_new:Npn \__fp_ep_isqrt_esti:wwwnnwn #1, #2, #3, #4
+ {
+ \if_int_compare:w #1 = #2 \exp_stop_f:
+ \exp_after:wN \__fp_ep_isqrt_estii:wwwnnwn
+ \fi:
+ \exp_after:wN \__fp_ep_isqrt_esti:wwwnnwn
+ \int_use:N \__int_eval:w
+ (#1 + 1 0050 0000 #4 / (#1 * #3)) / \c_two ,
+ #1, #3, {#4}
+ }
+\cs_new:Npn \__fp_ep_isqrt_estii:wwwnnwn #1, #2, #3, #4#5
+ {
+ \exp_after:wN \__fp_ep_isqrt_estiii:NNNNNwwwn
+ \int_use:N \__int_eval:w 1000 0000 + #2 * #2 #5 * \c_five
+ \exp_after:wN , \int_use:N \__int_eval:w 10000 + #2 ;
+ }
+\cs_new:Npn \__fp_ep_isqrt_estiii:NNNNNwwwn 1#1#2#3#4#5#6, 1#7#8; #9;
+ {
+ \__fp_fixed_mul_short:wwn #9; {#1} {#2#3#4#5} {#600} ;
+ \__fp_ep_isqrt_epsi:wN
+ \__fp_fixed_mul_short:wwn {#7} {#80} {0000} ;
+ }
+\cs_new:Npn \__fp_ep_isqrt_epsi:wN #1;
+ {
+ \__fp_fixed_sub:wwn {15000}{0000}{0000}{0000}{0000}{0000}; #1;
+ \__fp_ep_isqrt_epsii:wwN #1;
+ \__fp_ep_isqrt_epsii:wwN #1;
+ \__fp_ep_isqrt_epsii:wwN #1;
+ }
+\cs_new:Npn \__fp_ep_isqrt_epsii:wwN #1; #2;
+ {
+ \__fp_fixed_mul:wwn #1; #1;
+ \__fp_fixed_mul_sub_back:wwwn #2;
+ {15000}{0000}{0000}{0000}{0000}{0000};
+ \__fp_fixed_mul:wwn #1;
+ }
+\cs_new:Npn \__fp_ep_to_float:wwN #1,
+ { + \__int_eval:w #1 \__fp_fixed_to_float:wN }
+\cs_new:Npn \__fp_ep_inv_to_float:wwN #1,#2;
+ {
+ \__fp_ep_div:wwwwn 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1,#2;
+ \__fp_ep_to_float:wwN
+ }
+\cs_new:Npn \__fp_fixed_inv_to_float:wN
+ { \__fp_ep_inv_to_float:wwN 0, }
+\cs_new:Npn \__fp_fixed_to_float_rad:wN #1;
+ {
+ \__fp_fixed_mul:wwn #1; {5729}{5779}{5130}{8232}{0876}{7981};
+ { \__fp_ep_to_float:wwN 2, }
+ }
+\cs_new:Npn \__fp_fixed_to_float:Nw #1#2; { \__fp_fixed_to_float:wN #2; #1 }
+\cs_new:Npn \__fp_fixed_to_float:wN #1#2#3#4#5#6; #7
+ {
+ + \__int_eval:w \c_four % for the 8-digit-at-the-start thing.
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_fixed_to_loop:N
+ \exp_after:wN \use_none:n
+ \int_use:N \__int_eval:w
+ 1 0000 0000 + #1 \exp_after:wN \__fp_use_none_stop_f:n
+ \__int_value:w 1#2 \exp_after:wN \__fp_use_none_stop_f:n
+ \__int_value:w 1#3#4 \exp_after:wN \__fp_use_none_stop_f:n
+ \__int_value:w 1#5#6
+ \exp_after:wN ;
+ \exp_after:wN ;
+ }
+\cs_new:Npn \__fp_fixed_to_loop:N #1
+ {
+ \if_meaning:w 0 #1
+ - \c_one
+ \exp_after:wN \__fp_fixed_to_loop:N
+ \else:
+ \exp_after:wN \__fp_fixed_to_loop_end:w
+ \exp_after:wN #1
+ \fi:
+ }
+\cs_new:Npn \__fp_fixed_to_loop_end:w #1 #2 ;
+ {
+ \if_meaning:w ; #1
+ \exp_after:wN \__fp_fixed_to_float_zero:w
+ \else:
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_fixed_to_float_pack:ww
+ \exp_after:wN ;
+ \fi:
+ #1 #2 0000 0000 0000 0000 ;
+ }
+\cs_new:Npn \__fp_fixed_to_float_zero:w ; 0000 0000 0000 0000 ;
+ {
+ - \c_two * \c__fp_max_exponent_int ;
+ {0000} {0000} {0000} {0000} ;
+ }
+\cs_new:Npn \__fp_fixed_to_float_pack:ww #1 ; #2#3 ; ;
+ {
+ \if_int_compare:w #2 > \c_four
+ \exp_after:wN \__fp_fixed_to_float_round_up:wnnnnw
+ \fi:
+ ; #1 ;
+ }
+\cs_new:Npn \__fp_fixed_to_float_round_up:wnnnnw ; #1#2#3#4 ;
+ {
+ \exp_after:wN \__fp_basics_pack_high:NNNNNw
+ \int_use:N \__int_eval:w 1 #1#2
+ \exp_after:wN \__fp_basics_pack_low:NNNNNw
+ \int_use:N \__int_eval:w 1 #3#4 + \c_one ;
+ }
+%% File: l3fp-expo.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\tl_const:Nn \c__fp_ln_i_fixed_tl { {0000}{0000}{0000}{0000}{0000}{0000} }
+\tl_const:Nn \c__fp_ln_ii_fixed_tl { {6931}{4718}{0559}{9453}{0941}{7232} }
+\tl_const:Nn \c__fp_ln_iii_fixed_tl {{10986}{1228}{8668}{1096}{9139}{5245} }
+\tl_const:Nn \c__fp_ln_iv_fixed_tl {{13862}{9436}{1119}{8906}{1883}{4464} }
+\tl_const:Nn \c__fp_ln_vi_fixed_tl {{17917}{5946}{9228}{0550}{0081}{2477} }
+\tl_const:Nn \c__fp_ln_vii_fixed_tl {{19459}{1014}{9055}{3133}{0510}{5353} }
+\tl_const:Nn \c__fp_ln_viii_fixed_tl{{20794}{4154}{1679}{8359}{2825}{1696} }
+\tl_const:Nn \c__fp_ln_ix_fixed_tl {{21972}{2457}{7336}{2193}{8279}{0490} }
+\tl_const:Nn \c__fp_ln_x_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991} }
+\cs_new:Npn \__fp_ln_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_meaning:w 2 #3
+ \__fp_case_use:nw { \__fp_invalid_operation_o:nw { ln } }
+ \fi:
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_use:nw
+ { \__fp_division_by_zero_o:Nnw \c_minus_inf_fp { ln } }
+ \or:
+ \else:
+ \__fp_case_return_same_o:w
+ \fi:
+ \__fp_ln_npos_o:w \s__fp \__fp_chk:w #2#3#4;
+ }
+\cs_new:Npn \__fp_ln_npos_o:w \s__fp \__fp_chk:w 10#1#2#3;
+ { %^^A todo: ln(1) should be "exact zero", not "underflow"
+ \exp_after:wN \__fp_sanitize:Nw
+ \__int_value:w % for the overall sign
+ \if_int_compare:w #1 < \c_one
+ 2
+ \else:
+ 0
+ \fi:
+ \exp_after:wN \exp_stop_f:
+ \int_use:N \__int_eval:w % for the exponent
+ \__fp_ln_significand:NNNNnnnN #2#3
+ \__fp_ln_exponent:wn {#1}
+ }
+\cs_new:Npn \__fp_ln_significand:NNNNnnnN #1#2#3#4
+ {
+ \exp_after:wN \__fp_ln_x_ii:wnnnn
+ \__int_value:w
+ \if_case:w #1 \exp_stop_f:
+ \or:
+ \if_int_compare:w #2 < \c_four
+ \__int_eval:w \c_ten - #2
+ \else:
+ 6
+ \fi:
+ \or: 4
+ \or: 3
+ \or: 2
+ \or: 2
+ \or: 2
+ \else: 1
+ \fi:
+ ; { #1 #2 #3 #4 }
+ }
+\cs_new:Npn \__fp_ln_x_ii:wnnnn #1; #2#3#4#5
+ {
+ \exp_after:wN \__fp_ln_div_after:Nw
+ \cs:w c__fp_ln_ \tex_romannumeral:D #1 _fixed_tl \exp_after:wN \cs_end:
+ \__int_value:w
+ \exp_after:wN \__fp_ln_x_iv:wnnnnnnnn
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_ln_x_iii_var:NNNNNw
+ \int_use:N \__int_eval:w 9999 9999 + #1*#2#3 +
+ \exp_after:wN \__fp_ln_x_iii:NNNNNw
+ \int_use:N \__int_eval:w 1 0000 0000 + #1*#4#5 ;
+ {20000} {0000} {0000} {0000}
+ } %^^A todo: reoptimize (a generalization attempt failed).
+\cs_new:Npn \__fp_ln_x_iii:NNNNNw #1 #2#3#4#5 #6; { #1; {#2#3#4#5} {#6} }
+\cs_new:Npn \__fp_ln_x_iii_var:NNNNNw #1 #2#3#4#5 #6;
+ {
+ #1#2#3#4#5 + \c_one ;
+ {#1#2#3#4#5} {#6}
+ }
+\cs_new:Npn \__fp_ln_x_iv:wnnnnnnnn #1; #2#3#4#5 #6#7#8#9
+ {
+ \exp_after:wN \__fp_div_significand_pack:NNN
+ \int_use:N \__int_eval:w
+ \__fp_ln_div_i:w #1 ;
+ #6 #7 ; {#8} {#9}
+ {#2} {#3} {#4} {#5}
+ { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
+ { \exp_after:wN \__fp_ln_div_vi:wwn \__int_value:w #1 }
+ }
+\cs_new:Npn \__fp_ln_div_i:w #1;
+ {
+ \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
+ \int_use:N \__int_eval:w 999999 + 2 0000 0000 / #1 ; % Q1
+ }
+\cs_new:Npn \__fp_ln_div_ii:wwn #1; #2;#3 % y; B1;B2 <- for k=1
+ {
+ \exp_after:wN \__fp_div_significand_pack:NNN
+ \int_use:N \__int_eval:w
+ \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
+ \int_use:N \__int_eval:w 999999 + #2 #3 / #1 ; % Q2
+ #2 #3 ;
+ }
+\cs_new:Npn \__fp_ln_div_vi:wwn #1; #2;#3#4#5 #6#7#8#9 %y;F1;F2F3F4x1x2x3x4
+ {
+ \exp_after:wN \__fp_div_significand_pack:NNN
+ \int_use:N \__int_eval:w 1000000 + #2 #3 / #1 ; % Q6
+ }
+\cs_new:Npn \__fp_ln_div_after:Nw #1#2;
+ {
+ \if_meaning:w 0 #2
+ \exp_after:wN \__fp_ln_t_small:Nw
+ \else:
+ \exp_after:wN \__fp_ln_t_large:NNw
+ \exp_after:wN -
+ \fi:
+ #1
+ }
+\cs_new:Npn \__fp_ln_t_small:Nw #1 #2; #3; #4; #5; #6; #7;
+ {
+ \exp_after:wN \__fp_ln_t_large:NNw
+ \exp_after:wN + % <sign>
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w 9999 - #2 \exp_after:wN ;
+ \int_use:N \__int_eval:w 9999 - #3 \exp_after:wN ;
+ \int_use:N \__int_eval:w 9999 - #4 \exp_after:wN ;
+ \int_use:N \__int_eval:w 9999 - #5 \exp_after:wN ;
+ \int_use:N \__int_eval:w 9999 - #6 \exp_after:wN ;
+ \int_use:N \__int_eval:w 1 0000 - #7 ;
+ }
+\cs_new:Npn \__fp_ln_t_large:NNw #1 #2 #3; #4; #5; #6; #7; #8;
+ {
+ \exp_after:wN \__fp_ln_square_t_after:w
+ \int_use:N \__int_eval:w 9999 0000 + #3*#3
+ \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
+ \int_use:N \__int_eval:w 9999 0000 + 2*#3*#4
+ \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
+ \int_use:N \__int_eval:w 9999 0000 + 2*#3*#5 + #4*#4
+ \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
+ \int_use:N \__int_eval:w 9999 0000 + 2*#3*#6 + 2*#4*#5
+ \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
+ \int_use:N \__int_eval:w 1 0000 0000 + 2*#3*#7 + 2*#4*#6 + #5*#5
+ + (2*#3*#8 + 2*#4*#7 + 2*#5*#6) / 1 0000
+ % ; ; ;
+ \exp_after:wN \__fp_ln_twice_t_after:w
+ \int_use:N \__int_eval:w -1 + 2*#3
+ \exp_after:wN \__fp_ln_twice_t_pack:Nw
+ \int_use:N \__int_eval:w 9999 + 2*#4
+ \exp_after:wN \__fp_ln_twice_t_pack:Nw
+ \int_use:N \__int_eval:w 9999 + 2*#5
+ \exp_after:wN \__fp_ln_twice_t_pack:Nw
+ \int_use:N \__int_eval:w 9999 + 2*#6
+ \exp_after:wN \__fp_ln_twice_t_pack:Nw
+ \int_use:N \__int_eval:w 9999 + 2*#7
+ \exp_after:wN \__fp_ln_twice_t_pack:Nw
+ \int_use:N \__int_eval:w 10000 + 2*#8 ; ;
+ { \__fp_ln_c:NwNw #1 }
+ #2
+ }
+\cs_new:Npn \__fp_ln_twice_t_pack:Nw #1 #2; { + #1 ; {#2} }
+\cs_new:Npn \__fp_ln_twice_t_after:w #1; { ;;; {#1} }
+\cs_new:Npn \__fp_ln_square_t_pack:NNNNNw #1 #2#3#4#5 #6;
+ { + #1#2#3#4#5 ; {#6} }
+\cs_new:Npn \__fp_ln_square_t_after:w 1 0 #1#2#3 #4;
+ { \__fp_ln_Taylor:wwNw {0#1#2#3} {#4} }
+\cs_new:Npn \__fp_ln_Taylor:wwNw
+ { \__fp_ln_Taylor_loop:www 21 ; {0000}{0000}{0000}{0000}{0000}{0000} ; }
+\cs_new:Npn \__fp_ln_Taylor_loop:www #1; #2; #3;
+ {
+ \if_int_compare:w #1 = \c_one
+ \__fp_ln_Taylor_break:w
+ \fi:
+ \exp_after:wN \__fp_fixed_div_int:wwN \c__fp_one_fixed_tl ; #1;
+ \__fp_fixed_add:wwn #2;
+ \__fp_fixed_mul:wwn #3;
+ {
+ \exp_after:wN \__fp_ln_Taylor_loop:www
+ \int_use:N \__int_eval:w #1 - \c_two ;
+ }
+ #3;
+ }
+\cs_new:Npn \__fp_ln_Taylor_break:w \fi: #1 \__fp_fixed_add:wwn #2#3; #4 ;;
+ {
+ \fi:
+ \exp_after:wN \__fp_fixed_mul:wwn
+ \exp_after:wN { \int_use:N \__int_eval:w 10000 + #2 } #3;
+ }
+\cs_new:Npn \__fp_ln_c:NwNw #1 #2; #3
+ {
+ \if_meaning:w + #1
+ \exp_after:wN \exp_after:wN \exp_after:wN \__fp_fixed_sub:wwn
+ \else:
+ \exp_after:wN \exp_after:wN \exp_after:wN \__fp_fixed_add:wwn
+ \fi:
+ #3 ; #2 ;
+ }
+\cs_new:Npn \__fp_ln_exponent:wn #1; #2
+ {
+ \if_case:w #2 \exp_stop_f:
+ \c_zero \__fp_case_return:nw { \__fp_fixed_to_float:Nw 2 }
+ \or:
+ \exp_after:wN \__fp_ln_exponent_one:ww \__int_value:w
+ \else:
+ \if_int_compare:w #2 > \c_zero
+ \exp_after:wN \__fp_ln_exponent_small:NNww
+ \exp_after:wN 0
+ \exp_after:wN \__fp_fixed_sub:wwn \__int_value:w
+ \else:
+ \exp_after:wN \__fp_ln_exponent_small:NNww
+ \exp_after:wN 2
+ \exp_after:wN \__fp_fixed_add:wwn \__int_value:w -
+ \fi:
+ \fi:
+ #2; #1;
+ }
+\cs_new:Npn \__fp_ln_exponent_one:ww 1; #1;
+ {
+ \c_zero
+ \exp_after:wN \__fp_fixed_sub:wwn \c__fp_ln_x_fixed_tl ; #1;
+ \__fp_fixed_to_float:wN 0
+ }
+\cs_new:Npn \__fp_ln_exponent_small:NNww #1#2#3; #4#5#6#7#8#9;
+ {
+ \c_four
+ \exp_after:wN \__fp_fixed_mul:wwn
+ \c__fp_ln_x_fixed_tl ;
+ {#3}{0000}{0000}{0000}{0000}{0000} ;
+ #2
+ {0000}{#4}{#5}{#6}{#7}{#8};
+ \__fp_fixed_to_float:wN #1
+ }
+\cs_new:Npn \__fp_exp_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_o:Nw \c_one_fp
+ \or:
+ \exp_after:wN \__fp_exp_normal:w
+ \or:
+ \if_meaning:w 0 #3
+ \exp_after:wN \__fp_case_return_o:Nw
+ \exp_after:wN \c_inf_fp
+ \else:
+ \exp_after:wN \__fp_case_return_o:Nw
+ \exp_after:wN \c_zero_fp
+ \fi:
+ \or:
+ \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2#3#4;
+ }
+\cs_new:Npn \__fp_exp_normal:w \s__fp \__fp_chk:w 1#1
+ {
+ \if_meaning:w 0 #1
+ \__fp_exp_pos:NNwnw + \__fp_fixed_to_float:wN
+ \else:
+ \__fp_exp_pos:NNwnw - \__fp_fixed_inv_to_float:wN
+ \fi:
+ }
+\cs_new:Npn \__fp_exp_pos:NNwnw #1#2#3 \fi: #4#5;
+ {
+ \fi:
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN 0
+ \__int_value:w #1 \__int_eval:w
+ \if_int_compare:w #4 < - \c_eight
+ \c_one
+ \exp_after:wN \__fp_add_big_i_o:wNww
+ \int_use:N \__int_eval:w \c_one - #4 ;
+ 0 {1000}{0000}{0000}{0000} ; #5;
+ \tex_romannumeral:D
+ \else:
+ \if_int_compare:w #4 > \c_five % cf \c__fp_max_exponent_int
+ \exp_after:wN \__fp_exp_overflow:
+ \tex_romannumeral:D
+ \else:
+ \if_int_compare:w #4 < \c_zero
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ {
+ \c_zero
+ \__fp_decimate:nNnnnn { - #4 }
+ \__fp_exp_Taylor:Nnnwn
+ }
+ {
+ \__fp_decimate:nNnnnn { \c_sixteen - #4 }
+ \__fp_exp_pos_large:NnnNwn
+ }
+ #5
+ {#4}
+ #1 #2 0
+ \tex_romannumeral:D
+ \fi:
+ \fi:
+ \exp_after:wN \c_zero
+ }
+\cs_new:Npn \__fp_exp_overflow:
+ { + \c_two * \c__fp_max_exponent_int ; {1000} {0000} {0000} {0000} ; }
+\cs_new:Npn \__fp_exp_Taylor:Nnnwn #1#2#3 #4; #5 #6
+ {
+ #6
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_pack_twice_four:wNNNNNNNN
+ \__fp_exp_Taylor_ii:ww
+ ; #2#3#4 0000 0000 ;
+ }
+\cs_new:Npn \__fp_exp_Taylor_ii:ww #1; #2;
+ { \__fp_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s__stop }
+\cs_new:Npn \__fp_exp_Taylor_loop:www #1; #2; #3;
+ {
+ \if_int_compare:w #1 = \c_one
+ \exp_after:wN \__fp_exp_Taylor_break:Nww
+ \fi:
+ \__fp_fixed_div_int:wwN #3 ; #1 ;
+ \__fp_fixed_add_one:wN
+ \__fp_fixed_mul:wwn #2 ;
+ {
+ \exp_after:wN \__fp_exp_Taylor_loop:www
+ \int_use:N \__int_eval:w #1 - 1 ;
+ #2 ;
+ }
+ }
+\cs_new:Npn \__fp_exp_Taylor_break:Nww #1 #2; #3 \s__stop
+ { \__fp_fixed_add_one:wN #2 ; }
+\cs_new:Npn \__fp_exp_pos_large:NnnNwn #1#2#3 #4#5; #6
+ {
+ \exp_after:wN \exp_after:wN
+ \cs:w __fp_exp_large_\tex_romannumeral:D #6:wN \exp_after:wN \cs_end:
+ \exp_after:wN \c__fp_one_fixed_tl
+ \exp_after:wN ;
+ \__int_value:w #3 #4 \exp_stop_f:
+ #5 00000 ;
+ }
+\cs_new:Npn \__fp_exp_large:w #1 \or: #2 \fi:
+ { \fi: \__fp_fixed_mul:wwn #1; }
+\cs_new:Npn \__fp_exp_large_v:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 4343 \__fp_exp_large:w {8806}{8182}{2566}{2921}{5872}{6150} \or:
+ + 8686 \__fp_exp_large:w {7756}{0047}{2598}{6861}{0458}{3204} \or:
+ + 13029 \__fp_exp_large:w {6830}{5723}{7791}{4884}{1932}{7351} \or:
+ + 17372 \__fp_exp_large:w {6015}{5609}{3095}{3052}{3494}{7574} \or:
+ + 21715 \__fp_exp_large:w {5297}{7951}{6443}{0315}{3251}{3576} \or:
+ + 26058 \__fp_exp_large:w {4665}{6719}{0099}{3379}{5527}{2929} \or:
+ + 30401 \__fp_exp_large:w {4108}{9724}{3326}{3186}{5271}{5665} \or:
+ + 34744 \__fp_exp_large:w {3618}{6973}{3140}{0875}{3856}{4102} \or:
+ + 39087 \__fp_exp_large:w {3186}{9209}{6113}{3900}{6705}{9685} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_iv:wN
+ }
+\cs_new:Npn \__fp_exp_large_iv:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 435 \__fp_exp_large:w {1970}{0711}{1401}{7046}{9938}{8888} \or:
+ + 869 \__fp_exp_large:w {3881}{1801}{9428}{4368}{5764}{8232} \or:
+ + 1303 \__fp_exp_large:w {7646}{2009}{8905}{4704}{8893}{1073} \or:
+ + 1738 \__fp_exp_large:w {1506}{3559}{7005}{0524}{9009}{7592} \or:
+ + 2172 \__fp_exp_large:w {2967}{6283}{8402}{3667}{0689}{6630} \or:
+ + 2606 \__fp_exp_large:w {5846}{4389}{5650}{2114}{7278}{5046} \or:
+ + 3041 \__fp_exp_large:w {1151}{7900}{5080}{6878}{2914}{4154} \or:
+ + 3475 \__fp_exp_large:w {2269}{1083}{0850}{6857}{8724}{4002} \or:
+ + 3909 \__fp_exp_large:w {4470}{3047}{3316}{5442}{6408}{6591} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_iii:wN
+ }
+\cs_new:Npn \__fp_exp_large_iii:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 44 \__fp_exp_large:w {2688}{1171}{4181}{6135}{4484}{1263} \or:
+ + 87 \__fp_exp_large:w {7225}{9737}{6812}{5749}{2581}{7748} \or:
+ + 131 \__fp_exp_large:w {1942}{4263}{9524}{1255}{9365}{8421} \or:
+ + 174 \__fp_exp_large:w {5221}{4696}{8976}{4143}{9505}{8876} \or:
+ + 218 \__fp_exp_large:w {1403}{5922}{1785}{2837}{4107}{3977} \or:
+ + 261 \__fp_exp_large:w {3773}{0203}{0092}{9939}{8234}{0143} \or:
+ + 305 \__fp_exp_large:w {1014}{2320}{5473}{5004}{5094}{5533} \or:
+ + 348 \__fp_exp_large:w {2726}{3745}{7211}{2566}{5673}{6478} \or:
+ + 391 \__fp_exp_large:w {7328}{8142}{2230}{7421}{7051}{8866} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_ii:wN
+ }
+\cs_new:Npn \__fp_exp_large_ii:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 5 \__fp_exp_large:w {2202}{6465}{7948}{0671}{6516}{9579} \or:
+ + 9 \__fp_exp_large:w {4851}{6519}{5409}{7902}{7796}{9107} \or:
+ + 14 \__fp_exp_large:w {1068}{6474}{5815}{2446}{2146}{9905} \or:
+ + 18 \__fp_exp_large:w {2353}{8526}{6837}{0199}{8540}{7900} \or:
+ + 22 \__fp_exp_large:w {5184}{7055}{2858}{7072}{4640}{8745} \or:
+ + 27 \__fp_exp_large:w {1142}{0073}{8981}{5684}{2836}{6296} \or:
+ + 31 \__fp_exp_large:w {2515}{4386}{7091}{9167}{0062}{6578} \or:
+ + 35 \__fp_exp_large:w {5540}{6223}{8439}{3510}{0525}{7117} \or:
+ + 40 \__fp_exp_large:w {1220}{4032}{9431}{7840}{8020}{0271} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_i:wN
+ }
+\cs_new:Npn \__fp_exp_large_i:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 1 \__fp_exp_large:w {2718}{2818}{2845}{9045}{2353}{6029} \or:
+ + 1 \__fp_exp_large:w {7389}{0560}{9893}{0650}{2272}{3043} \or:
+ + 2 \__fp_exp_large:w {2008}{5536}{9231}{8766}{7740}{9285} \or:
+ + 2 \__fp_exp_large:w {5459}{8150}{0331}{4423}{9078}{1103} \or:
+ + 3 \__fp_exp_large:w {1484}{1315}{9102}{5766}{0342}{1116} \or:
+ + 3 \__fp_exp_large:w {4034}{2879}{3492}{7351}{2260}{8387} \or:
+ + 4 \__fp_exp_large:w {1096}{6331}{5842}{8458}{5992}{6372} \or:
+ + 4 \__fp_exp_large:w {2980}{9579}{8704}{1728}{2747}{4359} \or:
+ + 4 \__fp_exp_large:w {8103}{0839}{2757}{5384}{0077}{1000} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_:wN
+ }
+\cs_new:Npn \__fp_exp_large_:wN #1; #2
+ {
+ \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
+ + 1 \__fp_exp_large:w {1105}{1709}{1807}{5647}{6248}{1171} \or:
+ + 1 \__fp_exp_large:w {1221}{4027}{5816}{0169}{8339}{2107} \or:
+ + 1 \__fp_exp_large:w {1349}{8588}{0757}{6003}{1039}{8374} \or:
+ + 1 \__fp_exp_large:w {1491}{8246}{9764}{1270}{3178}{2485} \or:
+ + 1 \__fp_exp_large:w {1648}{7212}{7070}{0128}{1468}{4865} \or:
+ + 1 \__fp_exp_large:w {1822}{1188}{0039}{0508}{9748}{7537} \or:
+ + 1 \__fp_exp_large:w {2013}{7527}{0747}{0476}{5216}{2455} \or:
+ + 1 \__fp_exp_large:w {2225}{5409}{2849}{2467}{6045}{7954} \or:
+ + 1 \__fp_exp_large:w {2459}{6031}{1115}{6949}{6638}{0013} \or:
+ \fi:
+ #1;
+ \__fp_exp_large_after:wwn
+ }
+\cs_new:Npn \__fp_exp_large_after:wwn #1; #2; #3
+ {
+ \__fp_exp_Taylor:Nnnwn ? { } { } 0 #2; {} #3
+ \__fp_fixed_mul:wwn #1;
+ }
+\cs_new:cpn { __fp_ \iow_char:N \^ _o:ww }
+ \s__fp \__fp_chk:w #1#2#3; \s__fp \__fp_chk:w #4#5#6;
+ {
+ \if_meaning:w 0 #4
+ \__fp_case_return_o:Nw \c_one_fp
+ \fi:
+ \if_case:w #2 \exp_stop_f:
+ \exp_after:wN \use_i:nn
+ \or:
+ \__fp_case_return_o:Nw \c_nan_fp
+ \else:
+ \exp_after:wN \__fp_pow_neg:www
+ \tex_romannumeral:D -`0 \exp_after:wN \use:nn
+ \fi:
+ {
+ \if_meaning:w 1 #1
+ \exp_after:wN \__fp_pow_normal:ww
+ \else:
+ \exp_after:wN \__fp_pow_zero_or_inf:ww
+ \fi:
+ \s__fp \__fp_chk:w #1#2#3;
+ }
+ { \s__fp \__fp_chk:w #4#5#6; \s__fp \__fp_chk:w #1#2#3; }
+ \s__fp \__fp_chk:w #4#5#6;
+ }
+\cs_new:Npn \__fp_pow_zero_or_inf:ww \s__fp \__fp_chk:w #1#2; \s__fp \__fp_chk:w #3#4
+ {
+ \if_meaning:w 1 #4
+ \__fp_case_return_same_o:w
+ \fi:
+ \if_meaning:w #1 #4
+ \__fp_case_return_o:Nw \c_zero_fp
+ \fi:
+ \if_meaning:w 0 #1
+ \__fp_case_use:nw
+ {
+ \__fp_division_by_zero_o:NNww \c_inf_fp ^
+ \s__fp \__fp_chk:w #1 #2 ;
+ }
+ \else:
+ \__fp_case_return_o:Nw \c_inf_fp
+ \fi:
+ \s__fp \__fp_chk:w #3#4
+ }
+\cs_new:Npn \__fp_pow_normal:ww \s__fp \__fp_chk:w 1 #1#2#3; \s__fp \__fp_chk:w #4#5
+ {
+ \if_int_compare:w \pdftex_strcmp:D { #2 #3 }
+ { 1 {1000} {0000} {0000} {0000} } = \c_zero
+ \if_int_compare:w #4 #1 = 32 \exp_stop_f:
+ \exp_after:wN \__fp_case_return_ii_o:ww
+ \fi:
+ \__fp_case_return_o:Nww \c_one_fp
+ \fi:
+ \if_case:w #4 \exp_stop_f:
+ \or:
+ \exp_after:wN \__fp_pow_npos:Nww
+ \exp_after:wN #5
+ \or:
+ \if_meaning:w 2 #5 \exp_after:wN \reverse_if:N \fi:
+ \if_int_compare:w #2 > \c_zero
+ \exp_after:wN \__fp_case_return_o:Nww
+ \exp_after:wN \c_inf_fp
+ \else:
+ \exp_after:wN \__fp_case_return_o:Nww
+ \exp_after:wN \c_zero_fp
+ \fi:
+ \or:
+ \__fp_case_return_ii_o:ww
+ \fi:
+ \s__fp \__fp_chk:w 1 #1 {#2} #3 ;
+ \s__fp \__fp_chk:w #4 #5
+ }
+\cs_new:Npn \__fp_pow_npos:Nww #1 \s__fp \__fp_chk:w 1#2#3
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN 0
+ \__int_value:w
+ \if:w #1 \if_int_compare:w #3 > \c_zero 0 \else: 2 \fi:
+ \exp_after:wN \__fp_pow_npos_aux:NNnww
+ \exp_after:wN +
+ \exp_after:wN \__fp_fixed_to_float:wN
+ \else:
+ \exp_after:wN \__fp_pow_npos_aux:NNnww
+ \exp_after:wN -
+ \exp_after:wN \__fp_fixed_inv_to_float:wN
+ \fi:
+ {#3}
+ }
+\cs_new:Npn \__fp_pow_npos_aux:NNnww #1#2#3#4#5; \s__fp \__fp_chk:w 1#6#7#8;
+ {
+ #1
+ \__int_eval:w
+ \__fp_ln_significand:NNNNnnnN #4#5
+ \__fp_pow_exponent:wnN {#3}
+ \__fp_fixed_mul:wwn #8 {0000}{0000} ;
+ \__fp_pow_B:wwN #7;
+ #1 #2 0 % fixed_to_float:wN
+ }
+\cs_new:Npn \__fp_pow_exponent:wnN #1; #2
+ {
+ \if_int_compare:w #2 > \c_zero
+ \exp_after:wN \__fp_pow_exponent:Nwnnnnnw % n\ln(10) - (-\ln(x))
+ \exp_after:wN +
+ \else:
+ \exp_after:wN \__fp_pow_exponent:Nwnnnnnw % -( |n|\ln(10) + (-\ln(x)) )
+ \exp_after:wN -
+ \fi:
+ #2; #1;
+ }
+\cs_new:Npn \__fp_pow_exponent:Nwnnnnnw #1#2; #3#4#5#6#7#8;
+ { %^^A todo: use that in ln.
+ \exp_after:wN \__fp_fixed_mul_after:wwn
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ #1#2*23025 - #1 #3
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ #1 #2*8509 - #1 #4
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ #1 #2*2994 - #1 #5
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ #1 #2*0456 - #1 #6
+ \exp_after:wN \__fp_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_trailing_shift_int
+ #1 #2*8401 - #1 #7
+ #1 ( #2*7991 - #8 ) / 1 0000 ; ;
+ }
+\cs_new:Npn \__fp_pow_B:wwN #1#2#3#4#5#6; #7;
+ {
+ \if_int_compare:w #7 < \c_zero
+ \exp_after:wN \__fp_pow_C_neg:w \__int_value:w -
+ \else:
+ \if_int_compare:w #7 < 22 \exp_stop_f:
+ \exp_after:wN \__fp_pow_C_pos:w \__int_value:w
+ \else:
+ \exp_after:wN \__fp_pow_C_overflow:w \__int_value:w
+ \fi:
+ \fi:
+ #7 \exp_after:wN ;
+ \int_use:N \__int_eval:w 10 0000 + #1 \__int_eval_end:
+ #2#3#4#5#6 0000 0000 0000 0000 0000 0000 ; %^^A todo: how many 0?
+ }
+\cs_new:Npn \__fp_pow_C_overflow:w #1; #2; #3
+ {
+ + \c_two * \c__fp_max_exponent_int
+ \exp_after:wN \__fp_fixed_continue:wn \c__fp_one_fixed_tl ;
+ }
+\cs_new:Npn \__fp_pow_C_neg:w #1 ; 1
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN \__fp_pow_C_pack:w
+ \prg_replicate:nn {#1} {0}
+ }
+\cs_new:Npn \__fp_pow_C_pos:w #1; 1
+ { \__fp_pow_C_pos_loop:wN #1; }
+\cs_new:Npn \__fp_pow_C_pos_loop:wN #1; #2
+ {
+ \if_meaning:w 0 #1
+ \exp_after:wN \__fp_pow_C_pack:w
+ \exp_after:wN #2
+ \else:
+ \if_meaning:w 0 #2
+ \exp_after:wN \__fp_pow_C_pos_loop:wN \__int_value:w
+ \else:
+ \exp_after:wN \__fp_pow_C_overflow:w \__int_value:w
+ \fi:
+ \__int_eval:w #1 - \c_one \exp_after:wN ;
+ \fi:
+ }
+\cs_new:Npn \__fp_pow_C_pack:w
+ { \exp_after:wN \__fp_exp_large_v:wN \c__fp_one_fixed_tl ; }
+\cs_new:Npn \__fp_pow_neg:www \s__fp \__fp_chk:w #1#2; #3; #4;
+ {
+ \if_case:w \__fp_pow_neg_case:w #4 ;
+ \exp_after:wN \__fp_pow_neg_aux:wNN
+ \or:
+ \if_int_compare:w \__int_eval:w #1 / \c_two = \c_one
+ \__fp_invalid_operation_o:Nww ^ #3; #4;
+ \tex_romannumeral:D -`0
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_use_none_until_s:w
+ \fi:
+ \fi:
+ \__fp_exp_after_o:w
+ \s__fp \__fp_chk:w #1#2;
+ }
+\cs_new:Npn \__fp_pow_neg_aux:wNN #1 \s__fp \__fp_chk:w #2#3
+ {
+ \exp_after:wN \__fp_exp_after_o:w
+ \exp_after:wN \s__fp
+ \exp_after:wN \__fp_chk:w
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w \c_two - #3 \__int_eval_end:
+ }
+\cs_new:Npn \__fp_pow_neg_case:w \s__fp \__fp_chk:w #1#2#3;
+ {
+ \if_case:w #1 \exp_stop_f:
+ \c_minus_one
+ \or: \__fp_pow_neg_case_aux:nnnnn #3
+ \else: \c_one
+ \fi:
+ }
+\cs_new:Npn \__fp_pow_neg_case_aux:nnnnn #1#2#3#4#5
+ {
+ \if_int_compare:w #1 > \c_eight
+ \if_int_compare:w #1 > \c_sixteen
+ \c_minus_one
+ \else:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_pow_neg_case_aux:NNNNNNNNw
+ \prg_replicate:nn { \c_sixteen - #1 } { 0 } #4#5 ;
+ \fi:
+ \else:
+ \if_int_compare:w #1 > \c_zero
+ \if_int_compare:w #4#5 = \c_zero
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_pow_neg_case_aux:NNNNNNNNw
+ \prg_replicate:nn { \c_eight - #1 } { 0 } #2#3 ;
+ \else:
+ \c_one
+ \fi:
+ \else:
+ \c_one
+ \fi:
+ \fi:
+ }
+\cs_new:Npn \__fp_pow_neg_case_aux:NNNNNNNNw #1#2#3#4#5#6#7#8#9;
+ {
+ \if_int_compare:w 0 #9 = \c_zero
+ \if_int_odd:w #8 \exp_stop_f:
+ \c_zero
+ \else:
+ \c_minus_one
+ \fi:
+ \else:
+ \c_one
+ \fi:
+ }
+%% File: l3fp-trig.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_sin_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_same_o:w
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
+ \__fp_ep_to_float:wwN #3 \c_zero
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { sin } { sind } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_cos_o:w #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_o:Nw \c_one_fp
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
+ \__fp_ep_to_float:wwN 0 \c_two
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { cos } { cosd } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3;
+ }
+\cs_new:Npn \__fp_csc_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_cot_zero_o:Nfw #3 { #1 { csc } { cscd } }
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
+ \__fp_ep_inv_to_float:wwN #3 \c_zero
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { csc } { cscd } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_sec_o:w #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_o:Nw \c_one_fp
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
+ \__fp_ep_inv_to_float:wwN 0 \c_two
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { sec } { secd } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3;
+ }
+\cs_new:Npn \__fp_tan_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_same_o:w
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1
+ \__fp_tan_series_o:NNwwww 0 #3 \c_one
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { tan } { tand } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_cot_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_cot_zero_o:Nfw #3 { #1 { cot } { cotd } }
+ \or: \__fp_case_use:nw
+ {
+ \__fp_trig:NNNNNwn #1
+ \__fp_tan_series_o:NNwwww 2 #3 \c_three
+ }
+ \or: \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { cot } { cotd } } }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_cot_zero_o:Nfw #1#2#3 \fi:
+ {
+ \fi:
+ \token_if_eq_meaning:NNTF 0 #1
+ { \exp_args:NNf \__fp_division_by_zero_o:Nnw \c_inf_fp }
+ { \exp_args:NNf \__fp_division_by_zero_o:Nnw \c_minus_inf_fp }
+ {#2}
+ }
+\cs_new:Npn \__fp_trig:NNNNNwn #1#2#3#4#5 \s__fp \__fp_chk:w 1#6#7#8;
+ {
+ \exp_after:wN #2
+ \exp_after:wN #3
+ \exp_after:wN #4
+ \int_use:N \__int_eval:w #5
+ \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
+ \if_int_compare:w #7 > #1 \c_zero \c_one
+ #1 \__fp_trig_large:ww \__fp_trigd_large:ww
+ \else:
+ #1 \__fp_trig_small:ww \__fp_trigd_small:ww
+ \fi:
+ #7,#8{0000}{0000};
+ }
+\cs_new:Npn \__fp_trig_small:ww #1,#2;
+ { \__fp_ep_to_fixed:wwn #1,#2; . #1,#2; }
+\cs_new:Npn \__fp_trigd_small:ww #1,#2;
+ {
+ \__fp_ep_mul_raw:wwwwN
+ -1,{1745}{3292}{5199}{4329}{5769}{2369}; #1,#2;
+ \__fp_trig_small:ww
+ }
+\cs_new:Npn \__fp_trigd_large:ww #1, #2#3#4#5#6#7;
+ {
+ \exp_after:wN \__fp_pack_eight:wNNNNNNNN
+ \exp_after:wN \__fp_pack_eight:wNNNNNNNN
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
+ \exp_after:wN \__fp_trigd_large_auxi:nnnnwNNNN
+ \exp_after:wN ;
+ \tex_romannumeral:D -`0
+ \prg_replicate:nn { \int_max:nn { 22 - #1 } { 0 } } { 0 }
+ #2#3#4#5#6#7 0000 0000 0000 !
+ }
+\cs_new:Npn \__fp_trigd_large_auxi:nnnnwNNNN #1#2#3#4#5; #6#7#8#9
+ {
+ \exp_after:wN \__fp_trigd_large_auxii:wNw
+ \int_use:N \__int_eval:w #1 + #2
+ - (#1 + #2 - \c_four) / \c_nine * \c_nine \__int_eval_end:
+ #3;
+ #4; #5{#6#7#8#9};
+ }
+\cs_new:Npn \__fp_trigd_large_auxii:wNw #1; #2#3;
+ {
+ + (#1#2 - \c_four) / \c_nine * \c_two
+ \exp_after:wN \__fp_trigd_large_auxiii:www
+ \int_use:N \__int_eval:w #1#2
+ - (#1#2 - \c_four) / \c_nine * \c_nine \__int_eval_end: #3 ;
+ }
+\cs_new:Npn \__fp_trigd_large_auxiii:www #1; #2; #3!
+ {
+ \if_int_compare:w #1 < 4500 \exp_stop_f:
+ \exp_after:wN \__fp_use_i_until_s:nw
+ \exp_after:wN \__fp_fixed_continue:wn
+ \else:
+ + \c_one
+ \fi:
+ \__fp_fixed_sub:wwn {9000}{0000}{0000}{0000}{0000}{0000};
+ {#1}#2{0000}{0000};
+ { \__fp_trigd_small:ww 2, }
+ }
+\cs_new_nopar:Npx \__fp_trig_inverse_two_pi:
+ {
+ \exp_not:n { \exp_after:wN \use_none:n \token_to_str:N }
+ \cs:w , , !
+ 0000000000000000159154943091895335768883763372514362034459645740 ~
+ 4564487476673440588967976342265350901138027662530859560728427267 ~
+ 5795803689291184611457865287796741073169983922923996693740907757 ~
+ 3077746396925307688717392896217397661693362390241723629011832380 ~
+ 1142226997557159404618900869026739561204894109369378440855287230 ~
+ 9994644340024867234773945961089832309678307490616698646280469944 ~
+ 8652187881574786566964241038995874139348609983868099199962442875 ~
+ 5851711788584311175187671605465475369880097394603647593337680593 ~
+ 0249449663530532715677550322032477781639716602294674811959816584 ~
+ 0606016803035998133911987498832786654435279755070016240677564388 ~
+ 8495713108801221993761476813777647378906330680464579784817613124 ~
+ 2731406996077502450029775985708905690279678513152521001631774602 ~
+ 0924811606240561456203146484089248459191435211575407556200871526 ~
+ 6068022171591407574745827225977462853998751553293908139817724093 ~
+ 5825479707332871904069997590765770784934703935898280871734256403 ~
+ 6689511662545705943327631268650026122717971153211259950438667945 ~
+ 0376255608363171169525975812822494162333431451061235368785631136 ~
+ 3669216714206974696012925057833605311960859450983955671870995474 ~
+ 6510431623815517580839442979970999505254387566129445883306846050 ~
+ 7852915151410404892988506388160776196993073410389995786918905980 ~
+ 9373777206187543222718930136625526123878038753888110681406765434 ~
+ 0828278526933426799556070790386060352738996245125995749276297023 ~
+ 5940955843011648296411855777124057544494570217897697924094903272 ~
+ 9477021664960356531815354400384068987471769158876319096650696440 ~
+ 4776970687683656778104779795450353395758301881838687937766124814 ~
+ 9530599655802190835987510351271290432315804987196868777594656634 ~
+ 6221034204440855497850379273869429353661937782928735937843470323 ~
+ 0237145837923557118636341929460183182291964165008783079331353497 ~
+ 7909974586492902674506098936890945883050337030538054731232158094 ~
+ 3197676032283131418980974982243833517435698984750103950068388003 ~
+ 9786723599608024002739010874954854787923568261139948903268997427 ~
+ 0834961149208289037767847430355045684560836714793084567233270354 ~
+ 8539255620208683932409956221175331839402097079357077496549880868 ~
+ 6066360968661967037474542102831219251846224834991161149566556037 ~
+ 9696761399312829960776082779901007830360023382729879085402387615 ~
+ 5744543092601191005433799838904654921248295160707285300522721023 ~
+ 6017523313173179759311050328155109373913639645305792607180083617 ~
+ 9548767246459804739772924481092009371257869183328958862839904358 ~
+ 6866663975673445140950363732719174311388066383072592302759734506 ~
+ 0548212778037065337783032170987734966568490800326988506741791464 ~
+ 6835082816168533143361607309951498531198197337584442098416559541 ~
+ 5225064339431286444038388356150879771645017064706751877456059160 ~
+ 8716857857939226234756331711132998655941596890719850688744230057 ~
+ 5191977056900382183925622033874235362568083541565172971088117217 ~
+ 9593683256488518749974870855311659830610139214454460161488452770 ~
+ 2511411070248521739745103866736403872860099674893173561812071174 ~
+ 0478899368886556923078485023057057144063638632023685201074100574 ~
+ 8592281115721968003978247595300166958522123034641877365043546764 ~
+ 6456565971901123084767099309708591283646669191776938791433315566 ~
+ 5066981321641521008957117286238426070678451760111345080069947684 ~
+ 2235698962488051577598095339708085475059753626564903439445420581 ~
+ 7886435683042000315095594743439252544850674914290864751442303321 ~
+ 3324569511634945677539394240360905438335528292434220349484366151 ~
+ 4663228602477666660495314065734357553014090827988091478669343492 ~
+ 2737602634997829957018161964321233140475762897484082891174097478 ~
+ 2637899181699939487497715198981872666294601830539583275209236350 ~
+ 6853889228468247259972528300766856937583659722919824429747406163 ~
+ 8183113958306744348516928597383237392662402434501997809940402189 ~
+ 6134834273613676449913827154166063424829363741850612261086132119 ~
+ 9863346284709941839942742955915628333990480382117501161211667205 ~
+ 1912579303552929241134403116134112495318385926958490443846807849 ~
+ 0973982808855297045153053991400988698840883654836652224668624087 ~
+ 2540140400911787421220452307533473972538149403884190586842311594 ~
+ 6322744339066125162393106283195323883392131534556381511752035108 ~
+ 7459558201123754359768155340187407394340363397803881721004531691 ~
+ 8295194879591767395417787924352761740724605939160273228287946819 ~
+ 3649128949714953432552723591659298072479985806126900733218844526 ~
+ 7943350455801952492566306204876616134365339920287545208555344144 ~
+ 0990512982727454659118132223284051166615650709837557433729548631 ~
+ 2041121716380915606161165732000083306114606181280326258695951602 ~
+ 4632166138576614804719932707771316441201594960110632830520759583 ~
+ 4850305079095584982982186740289838551383239570208076397550429225 ~
+ 9847647071016426974384504309165864528360324933604354657237557916 ~
+ 1366324120457809969715663402215880545794313282780055246132088901 ~
+ 8742121092448910410052154968097113720754005710963406643135745439 ~
+ 9159769435788920793425617783022237011486424925239248728713132021 ~
+ 7667360756645598272609574156602343787436291321097485897150713073 ~
+ 9104072643541417970572226547980381512759579124002534468048220261 ~
+ 7342299001020483062463033796474678190501811830375153802879523433 ~
+ 4195502135689770912905614317878792086205744999257897569018492103 ~
+ 2420647138519113881475640209760554895793785141404145305151583964 ~
+ 2823265406020603311891586570272086250269916393751527887360608114 ~
+ 5569484210322407772727421651364234366992716340309405307480652685 ~
+ 0930165892136921414312937134106157153714062039784761842650297807 ~
+ 8606266969960809184223476335047746719017450451446166382846208240 ~
+ 8673595102371302904443779408535034454426334130626307459513830310 ~
+ 2293146934466832851766328241515210179422644395718121717021756492 ~
+ 1964449396532222187658488244511909401340504432139858628621083179 ~
+ 3939608443898019147873897723310286310131486955212620518278063494 ~
+ 5711866277825659883100535155231665984394090221806314454521212978 ~
+ 9734471488741258268223860236027109981191520568823472398358013366 ~
+ 0683786328867928619732367253606685216856320119489780733958419190 ~
+ 6659583867852941241871821727987506103946064819585745620060892122 ~
+ 8416394373846549589932028481236433466119707324309545859073361878 ~
+ 6290631850165106267576851216357588696307451999220010776676830946 ~
+ 9814975622682434793671310841210219520899481912444048751171059184 ~
+ 4139907889455775184621619041530934543802808938628073237578615267 ~
+ 7971143323241969857805637630180884386640607175368321362629671224 ~
+ 2609428540110963218262765120117022552929289655594608204938409069 ~
+ 0760692003954646191640021567336017909631872891998634341086903200 ~
+ 5796637103128612356988817640364252540837098108148351903121318624 ~
+ 7228181050845123690190646632235938872454630737272808789830041018 ~
+ 9485913673742589418124056729191238003306344998219631580386381054 ~
+ 2457893450084553280313511884341007373060595654437362488771292628 ~
+ 9807423539074061786905784443105274262641767830058221486462289361 ~
+ 9296692992033046693328438158053564864073184440599549689353773183 ~
+ 6726613130108623588021288043289344562140479789454233736058506327 ~
+ 0439981932635916687341943656783901281912202816229500333012236091 ~
+ 8587559201959081224153679499095448881099758919890811581163538891 ~
+ 6339402923722049848375224236209100834097566791710084167957022331 ~
+ 7897107102928884897013099533995424415335060625843921452433864640 ~
+ 3432440657317477553405404481006177612569084746461432976543900008 ~
+ 3826521145210162366431119798731902751191441213616962045693602633 ~
+ 6102355962140467029012156796418735746835873172331004745963339773 ~
+ 2477044918885134415363760091537564267438450166221393719306748706 ~
+ 2881595464819775192207710236743289062690709117919412776212245117 ~
+ 2354677115640433357720616661564674474627305622913332030953340551 ~
+ 3841718194605321501426328000879551813296754972846701883657425342 ~
+ 5016994231069156343106626043412205213831587971115075454063290657 ~
+ 0248488648697402872037259869281149360627403842332874942332178578 ~
+ 7750735571857043787379693402336902911446961448649769719434527467 ~
+ 4429603089437192540526658890710662062575509930379976658367936112 ~
+ 8137451104971506153783743579555867972129358764463093757203221320 ~
+ 2460565661129971310275869112846043251843432691552928458573495971 ~
+ 5042565399302112184947232132380516549802909919676815118022483192 ~
+ 5127372199792134331067642187484426215985121676396779352982985195 ~
+ 8545392106957880586853123277545433229161989053189053725391582222 ~
+ 9232597278133427818256064882333760719681014481453198336237910767 ~
+ 1255017528826351836492103572587410356573894694875444694018175923 ~
+ 0609370828146501857425324969212764624247832210765473750568198834 ~
+ 5641035458027261252285503154325039591848918982630498759115406321 ~
+ 0354263890012837426155187877318375862355175378506956599570028011 ~
+ 5841258870150030170259167463020842412449128392380525772514737141 ~
+ 2310230172563968305553583262840383638157686828464330456805994018 ~
+ 7001071952092970177990583216417579868116586547147748964716547948 ~
+ 8312140431836079844314055731179349677763739898930227765607058530 ~
+ 4083747752640947435070395214524701683884070908706147194437225650 ~
+ 2823145872995869738316897126851939042297110721350756978037262545 ~
+ 8141095038270388987364516284820180468288205829135339013835649144 ~
+ 3004015706509887926715417450706686888783438055583501196745862340 ~
+ 8059532724727843829259395771584036885940989939255241688378793572 ~
+ 7967951654076673927031256418760962190243046993485989199060012977 ~
+ 7469214532970421677817261517850653008552559997940209969455431545 ~
+ 2745856704403686680428648404512881182309793496962721836492935516 ~
+ 2029872469583299481932978335803459023227052612542114437084359584 ~
+ 9443383638388317751841160881711251279233374577219339820819005406 ~
+ 3292937775306906607415304997682647124407768817248673421685881509 ~
+ 9133422075930947173855159340808957124410634720893194912880783576 ~
+ 3115829400549708918023366596077070927599010527028150868897828549 ~
+ 4340372642729262103487013992868853550062061514343078665396085995 ~
+ 0058714939141652065302070085265624074703660736605333805263766757 ~
+ 2018839497277047222153633851135483463624619855425993871933367482 ~
+ 0422097449956672702505446423243957506869591330193746919142980999 ~
+ 3424230550172665212092414559625960554427590951996824313084279693 ~
+ 7113207021049823238195747175985519501864630940297594363194450091 ~
+ 9150616049228764323192129703446093584259267276386814363309856853 ~
+ 2786024332141052330760658841495858718197071242995959226781172796 ~
+ 4438853796763139274314227953114500064922126500133268623021550837
+ \cs_end:
+ }
+\cs_new:Npn \__fp_trig_large:ww #1, #2#3#4#5#6;
+ {
+ \exp_after:wN \__fp_trig_large_auxi:wwwwww
+ \int_use:N \__int_eval:w (#1 - 32) / 64 \exp_after:wN ,
+ \int_use:N \__int_eval:w (#1 - 4) / 8 \exp_after:wN ,
+ \__int_value:w #1 \__fp_trig_inverse_two_pi: ;
+ {#2}{#3}{#4}{#5} ;
+ }
+\cs_new:Npn \__fp_trig_large_auxi:wwwwww #1, #2, #3, #4!
+ {
+ \prg_replicate:nn {#1} { \__fp_trig_large_auxii:ww }
+ \prg_replicate:nn { #2 - #1 * \c_eight }
+ { \__fp_trig_large_auxiii:wNNNNNNNN }
+ \prg_replicate:nn { #3 - #2 * \c_eight }
+ { \__fp_trig_large_auxiv:wN }
+ \prg_replicate:nn { \c_eight } { \__fp_pack_twice_four:wNNNNNNNN }
+ \__fp_trig_large_auxv:www
+ ;
+ }
+\cs_new:Npn \__fp_trig_large_auxii:ww #1; #2 ~ { #1; }
+\cs_new:Npn \__fp_trig_large_auxiii:wNNNNNNNN
+ #1; #2#3#4#5#6#7#8#9 { #1; }
+\cs_new:Npn \__fp_trig_large_auxiv:wN #1; #2 { #1; }
+\cs_new:Npn \__fp_trig_large_auxv:www #1; #2; #3;
+ {
+ \exp_after:wN \__fp_use_i_until_s:nw
+ \exp_after:wN \__fp_trig_large_auxvii:w
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ \prg_replicate:nn { \c_thirteen }
+ { \__fp_trig_large_auxvi:wnnnnnnnn }
+ + \c__fp_trailing_shift_int - \c__fp_middle_shift_int
+ \__fp_use_i_until_s:nw
+ ; #3 #1 ; ;
+ }
+\cs_new:Npn \__fp_trig_large_auxvi:wnnnnnnnn #1; #2#3#4#5#6#7#8#9
+ {
+ \exp_after:wN \__fp_trig_large_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ + #2*#9 + #3*#8 + #4*#7 + #5*#6
+ #1; {#2}{#3}{#4}{#5} {#7}{#8}{#9}
+ }
+\cs_new:Npn \__fp_trig_large_pack:NNNNNw #1#2#3#4#5#6;
+ { + #1#2#3#4#5 ; #6 }
+\cs_new:Npn \__fp_trig_large_auxvii:w #1#2#3
+ {
+ \exp_after:wN \__fp_trig_large_auxviii:ww
+ \int_use:N \__int_eval:w (#1#2#3 - 62) / 125 ;
+ #1#2#3
+ }
+\cs_new:Npn \__fp_trig_large_auxviii:ww #1;
+ {
+ + #1
+ \if_int_odd:w #1 \exp_stop_f:
+ \exp_after:wN \__fp_trig_large_auxix:Nw
+ \exp_after:wN -
+ \else:
+ \exp_after:wN \__fp_trig_large_auxix:Nw
+ \exp_after:wN +
+ \fi:
+ }
+\cs_new_nopar:Npn \__fp_trig_large_auxix:Nw
+ {
+ \exp_after:wN \__fp_use_i_until_s:nw
+ \exp_after:wN \__fp_trig_large_auxxi:w
+ \int_use:N \__int_eval:w \c__fp_leading_shift_int
+ \prg_replicate:nn { \c_thirteen }
+ { \__fp_trig_large_auxx:wNNNNN }
+ + \c__fp_trailing_shift_int - \c__fp_middle_shift_int
+ ;
+ }
+\cs_new:Npn \__fp_trig_large_auxx:wNNNNN #1; #2 #3#4#5#6
+ {
+ \exp_after:wN \__fp_trig_large_pack:NNNNNw
+ \int_use:N \__int_eval:w \c__fp_middle_shift_int
+ #2 \c_eight * #3#4#5#6
+ #1; #2
+ }
+\cs_new:Npn \__fp_trig_large_auxxi:w #1;
+ {
+ \exp_after:wN \__fp_ep_mul_raw:wwwwN
+ \int_use:N \__int_eval:w \c_zero \__fp_ep_to_ep_loop:N #1 ; ; !
+ 0,{7853}{9816}{3397}{4483}{0961}{5661};
+ \__fp_trig_small:ww
+ }
+\cs_new:Npn \__fp_sin_series_o:NNwwww #1#2#3. #4;
+ {
+ \__fp_fixed_mul:wwn #4; #4;
+ {
+ \exp_after:wN \__fp_sin_series_aux_o:NNnwww
+ \exp_after:wN #1
+ \__int_value:w
+ \if_int_odd:w \__int_eval:w ( #3 + \c_two ) / \c_four \__int_eval_end:
+ #2
+ \else:
+ \if_meaning:w #2 0 2 \else: 0 \fi:
+ \fi:
+ {#3}
+ }
+ }
+\cs_new:Npn \__fp_sin_series_aux_o:NNnwww #1#2#3 #4; #5,#6;
+ {
+ \if_int_odd:w \__int_eval:w #3 / \c_two \__int_eval_end:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { % 1/18!
+ \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0001}{5619}{2070};
+ #4; {0000}{0000}{0000}{0477}{9477}{3324};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{0011}{4707}{4559}{7730};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{2087}{6756}{9878}{6810};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0027}{5573}{1922}{3985}{8907};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{2480}{1587}{3015}{8730}{1587};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0013}{8888}{8888}{8888}{8888}{8889};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0416}{6666}{6666}{6666}{6666}{6667};
+ \__fp_fixed_mul_sub_back:wwwn #4; {5000}{0000}{0000}{0000}{0000}{0000};
+ \__fp_fixed_mul_sub_back:wwwn #4;{10000}{0000}{0000}{0000}{0000}{0000};
+ { \__fp_fixed_continue:wn 0, }
+ }
+ { % 1/17!
+ \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0028}{1145}{7254};
+ #4; {0000}{0000}{0000}{7647}{1637}{3182};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{0160}{5904}{3836}{8216};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0002}{5052}{1083}{8544}{1719};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0275}{5731}{9223}{9858}{9065};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0001}{9841}{2698}{4126}{9841}{2698};
+ \__fp_fixed_mul_sub_back:wwwn #4; {0083}{3333}{3333}{3333}{3333}{3333};
+ \__fp_fixed_mul_sub_back:wwwn #4; {1666}{6666}{6666}{6666}{6666}{6667};
+ \__fp_fixed_mul_sub_back:wwwn #4;{10000}{0000}{0000}{0000}{0000}{0000};
+ { \__fp_ep_mul:wwwwn 0, } #5,#6;
+ }
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w #1
+ }
+ #2
+ }
+\cs_new:Npn \__fp_tan_series_o:NNwwww #1#2#3. #4;
+ {
+ \__fp_fixed_mul:wwn #4; #4;
+ {
+ \exp_after:wN \__fp_tan_series_aux_o:Nnwww
+ \__int_value:w
+ \if_int_odd:w \__int_eval:w #3 / \c_two \__int_eval_end:
+ \exp_after:wN \reverse_if:N
+ \fi:
+ \if_meaning:w #1#2 2 \else: 0 \fi:
+ {#3}
+ }
+ }
+\cs_new:Npn \__fp_tan_series_aux_o:Nnwww #1 #2 #3; #4,#5;
+ {
+ \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{1527}{3493}{0856}{7059};
+ #3; {0000}{0159}{6080}{0274}{5257}{6472};
+ \__fp_fixed_mul_sub_back:wwwn #3; {0002}{4571}{2320}{0157}{2558}{8481};
+ \__fp_fixed_mul_sub_back:wwwn #3; {0115}{5830}{7533}{5397}{3168}{2147};
+ \__fp_fixed_mul_sub_back:wwwn #3; {1929}{8245}{6140}{3508}{7719}{2982};
+ \__fp_fixed_mul_sub_back:wwwn #3;{10000}{0000}{0000}{0000}{0000}{0000};
+ { \__fp_ep_mul:wwwwn 0, } #4,#5;
+ {
+ \__fp_fixed_mul_sub_back:wwwn {0000}{0007}{0258}{0681}{9408}{4706};
+ #3; {0000}{2343}{7175}{1399}{6151}{7670};
+ \__fp_fixed_mul_sub_back:wwwn #3; {0019}{2638}{4588}{9232}{8861}{3691};
+ \__fp_fixed_mul_sub_back:wwwn #3; {0536}{6357}{0691}{4344}{6852}{4252};
+ \__fp_fixed_mul_sub_back:wwwn #3; {5263}{1578}{9473}{6842}{1052}{6315};
+ \__fp_fixed_mul_sub_back:wwwn #3;{10000}{0000}{0000}{0000}{0000}{0000};
+ {
+ \reverse_if:N \if_int_odd:w
+ \__int_eval:w (#2 - \c_one) / \c_two \__int_eval_end:
+ \exp_after:wN \__fp_reverse_args:Nww
+ \fi:
+ \__fp_ep_div:wwwwn 0,
+ }
+ }
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w \__fp_ep_to_float:wwN
+ }
+ #1
+ }
+\cs_new_nopar:Npn \__fp_atan_o:Nw
+ {
+ \__fp_atan_dispatch_o:NNnNw
+ \__fp_acotii_o:Nww \__fp_atanii_o:Nww { atan }
+ }
+\cs_new_nopar:Npn \__fp_acot_o:Nw
+ {
+ \__fp_atan_dispatch_o:NNnNw
+ \__fp_atanii_o:Nww \__fp_acotii_o:Nww { acot }
+ }
+\cs_new:Npn \__fp_atan_dispatch_o:NNnNw #1#2#3#4#5@
+ {
+ \if_case:w
+ \__int_eval:w \__fp_array_count:n {#5} - \c_one \__int_eval_end:
+ \exp_after:wN #1 \exp_after:wN #4 \c_one_fp #5
+ \tex_romannumeral:D
+ \or: #2 #4 #5 \tex_romannumeral:D
+ \else:
+ \__msg_kernel_expandable_error:nnnnn
+ { kernel } { fp-num-args } { #3() } { 1 } { 2 }
+ \exp_after:wN \c_nan_fp \tex_romannumeral:D
+ \fi:
+ \exp_after:wN \c_zero
+ }
+\cs_new:Npn \__fp_atanii_o:Nww
+ #1 \s__fp \__fp_chk:w #2#3#4; \s__fp \__fp_chk:w #5
+ {
+ \if_meaning:w 3 #2 \__fp_case_return_i_o:ww \fi:
+ \if_meaning:w 3 #5 \__fp_case_return_ii_o:ww \fi:
+ \if_case:w
+ \if_meaning:w #2 #5
+ \if_meaning:w 1 #2 \c_ten \else: \c_zero \fi:
+ \else:
+ \if_int_compare:w #2 > #5 \c_one \else: \c_two \fi:
+ \fi:
+ \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_two }
+ \or: \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_four }
+ \or: \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_zero }
+ \fi:
+ \__fp_atan_normal_o:NNnwNnw #1
+ \s__fp \__fp_chk:w #2#3#4;
+ \s__fp \__fp_chk:w #5
+ }
+\cs_new:Npn \__fp_acotii_o:Nww #1#2; #3;
+ { \__fp_atanii_o:Nww #1#3; #2; }
+\cs_new:Npn \__fp_atan_inf_o:NNNw #1#2#3 \s__fp \__fp_chk:w #4#5#6;
+ {
+ \exp_after:wN \__fp_atan_combine_o:NwwwwwN
+ \exp_after:wN #2
+ \int_use:N \__int_eval:w
+ \if_meaning:w 2 #5 \c_seven - \fi: #3 \exp_after:wN ;
+ \c__fp_one_fixed_tl ;
+ {0000}{0000}{0000}{0000}{0000}{0000};
+ 0,{0000}{0000}{0000}{0000}{0000}{0000}; #1
+ }
+\cs_new_protected:Npn \__fp_atan_normal_o:NNnwNnw
+ #1 \s__fp \__fp_chk:w 1#2#3#4; \s__fp \__fp_chk:w 1#5#6#7;
+ {
+ \__fp_atan_test_o:NwwNwwN
+ #2 #3, #4{0000}{0000};
+ #5 #6, #7{0000}{0000}; #1
+ }
+\cs_new:Npn \__fp_atan_test_o:NwwNwwN #1#2,#3; #4#5,#6;
+ {
+ \exp_after:wN \__fp_atan_combine_o:NwwwwwN
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ \if_meaning:w 2 #4
+ \c_seven - \__int_eval:w
+ \fi:
+ \if_int_compare:w
+ \__fp_ep_compare:wwww #2,#3; #5,#6; > \c_zero
+ \c_three -
+ \exp_after:wN \__fp_reverse_args:Nww
+ \fi:
+ \__fp_atan_div:wnwwnw #2,#3; #5,#6;
+ }
+\cs_new:Npn \__fp_atan_div:wnwwnw #1,#2#3; #4,#5#6;
+ {
+ \if_int_compare:w
+ \__int_eval:w 41421 * #5 < #2 000
+ \if_case:w \__int_eval:w #4 - #1 \__int_eval_end: 00 \or: 0 \fi:
+ \exp_stop_f:
+ \exp_after:wN \__fp_atan_near:wwwn
+ \fi:
+ \c_zero
+ \__fp_ep_div:wwwwn #1,{#2}#3; #4,{#5}#6;
+ \__fp_atan_auxi:ww
+ }
+\cs_new:Npn \__fp_atan_near:wwwn
+ \c_zero \__fp_ep_div:wwwwn #1,#2; #3,
+ {
+ \c_one
+ \__fp_ep_to_fixed:wwn #1 - #3, #2;
+ \__fp_atan_near_aux:wwn
+ }
+\cs_new:Npn \__fp_atan_near_aux:wwn #1; #2;
+ {
+ \__fp_fixed_add:wwn #1; #2;
+ { \__fp_fixed_sub:wwn #2; #1; { \__fp_ep_div:wwwwn 0, } 0, }
+ }
+\cs_new:Npn \__fp_atan_auxi:ww #1,#2;
+ { \__fp_ep_to_fixed:wwn #1,#2; \__fp_atan_auxii:w #1,#2; }
+\cs_new:Npn \__fp_atan_auxii:w #1;
+ {
+ \__fp_fixed_mul:wwn #1; #1;
+ {
+ \__fp_atan_Taylor_loop:www 39 ;
+ {0000}{0000}{0000}{0000}{0000}{0000} ;
+ }
+ ! #1;
+ }
+\cs_new:Npn \__fp_atan_Taylor_loop:www #1; #2; #3;
+ {
+ \if_int_compare:w #1 = \c_minus_one
+ \__fp_atan_Taylor_break:w
+ \fi:
+ \exp_after:wN \__fp_fixed_div_int:wwN \c__fp_one_fixed_tl ; #1;
+ \__fp_rrot:www \__fp_fixed_mul_sub_back:wwwn #2; #3;
+ {
+ \exp_after:wN \__fp_atan_Taylor_loop:www
+ \int_use:N \__int_eval:w #1 - \c_two ;
+ }
+ #3;
+ }
+\cs_new:Npn \__fp_atan_Taylor_break:w
+ \fi: #1 \__fp_fixed_mul_sub_back:wwwn #2; #3 !
+ { \fi: ; #2 ; }
+\cs_new:Npn \__fp_atan_combine_o:NwwwwwN #1 #2; #3; #4; #5,#6; #7
+ {
+ \exp_after:wN \__fp_sanitize:Nw
+ \exp_after:wN #1
+ \int_use:N \__int_eval:w
+ \if_meaning:w 0 #2
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { #5 \__fp_fixed_mul:wwn #3; #6; }
+ {
+ \__fp_fixed_mul:wwn #3; #4;
+ {
+ \exp_after:wN \__fp_atan_combine_aux:ww
+ \int_use:N \__int_eval:w #2 / \c_two ; #2;
+ }
+ }
+ { #7 \__fp_fixed_to_float:wN \__fp_fixed_to_float_rad:wN }
+ #1
+ }
+\cs_new:Npn \__fp_atan_combine_aux:ww #1; #2;
+ {
+ \__fp_fixed_mul_short:wwn
+ {7853}{9816}{3397}{4483}{0961}{5661};
+ {#1}{0000}{0000};
+ {
+ \if_int_odd:w #2 \exp_stop_f:
+ \exp_after:wN \__fp_fixed_sub:wwn
+ \else:
+ \exp_after:wN \__fp_fixed_add:wwn
+ \fi:
+ }
+ }
+\cs_new:Npn \__fp_asin_o:w #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_return_same_o:w
+ \or:
+ \__fp_case_use:nw
+ { \__fp_asin_normal_o:NfwNnnnnw #1 { #1 { asin } { asind } } }
+ \or:
+ \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { asin } { asind } } }
+ \else:
+ \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3;
+ }
+\cs_new:Npn \__fp_acos_o:w #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_use:nw { \__fp_atan_inf_o:NNNw #1 0 \c_four }
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_asin_normal_o:NfwNnnnnw #1 { #1 { acos } { acosd } }
+ \__fp_reverse_args:Nww
+ }
+ \or:
+ \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { acos } { acosd } } }
+ \else:
+ \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3;
+ }
+\cs_new:Npn \__fp_asin_normal_o:NfwNnnnnw
+ #1#2#3 \s__fp \__fp_chk:w 1#4#5#6#7#8#9;
+ {
+ \if_int_compare:w #5 < \c_one
+ \exp_after:wN \__fp_use_none_until_s:w
+ \fi:
+ \if_int_compare:w \__int_eval:w #5 + #6#7 + #8#9 = 1000 0001 ~
+ \exp_after:wN \__fp_use_none_until_s:w
+ \fi:
+ \__fp_use_i:ww
+ \__fp_invalid_operation_o:fw {#2}
+ \s__fp \__fp_chk:w 1#4{#5}{#6}{#7}{#8}{#9};
+ \__fp_asin_auxi_o:NnNww
+ #1 {#3} #4 #5,{#6}{#7}{#8}{#9}{0000}{0000};
+ }
+\cs_new:Npn \__fp_asin_auxi_o:NnNww #1#2#3#4,#5;
+ {
+ \__fp_ep_to_fixed:wwn #4,#5;
+ \__fp_asin_isqrt:wn
+ \__fp_ep_mul:wwwwn #4,#5;
+ \__fp_ep_to_ep:wwN
+ \__fp_fixed_continue:wn
+ { #2 \__fp_atan_test_o:NwwNwwN #3 }
+ 0 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1
+ }
+\cs_new:Npn \__fp_asin_isqrt:wn #1;
+ {
+ \exp_after:wN \__fp_fixed_sub:wwn \c__fp_one_fixed_tl ; #1;
+ {
+ \__fp_fixed_add_one:wN #1;
+ \__fp_fixed_continue:wn { \__fp_ep_mul:wwwwn 0, } 0,
+ }
+ \__fp_ep_isqrt:wwn
+ }
+\cs_new:Npn \__fp_acsc_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
+ {
+ \if_case:w \if_meaning:w 2 #2 #3 \fi: #2 \exp_stop_f:
+ \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { acsc } { acscd } } }
+ \or: \__fp_case_use:nw
+ { \__fp_acsc_normal_o:NfwNnw #1 { #1 { acsc } { acscd } } }
+ \or: \__fp_case_return_o:Nw \c_zero_fp
+ \or: \__fp_case_return_same_o:w
+ \else: \__fp_case_return_o:Nw \c_minus_zero_fp
+ \fi:
+ \s__fp \__fp_chk:w #2 #3 #4;
+ }
+\cs_new:Npn \__fp_asec_o:w #1 \s__fp \__fp_chk:w #2#3; @
+ {
+ \if_case:w #2 \exp_stop_f:
+ \__fp_case_use:nw
+ { \__fp_invalid_operation_o:fw { #1 { asec } { asecd } } }
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_acsc_normal_o:NfwNnw #1 { #1 { asec } { asecd } }
+ \__fp_reverse_args:Nww
+ }
+ \or: \__fp_case_use:nw { \__fp_atan_inf_o:NNNw #1 0 \c_four }
+ \else: \__fp_case_return_same_o:w
+ \fi:
+ \s__fp \__fp_chk:w #2 #3;
+ }
+\cs_new:Npn \__fp_acsc_normal_o:NfwNnw #1#2#3 \s__fp \__fp_chk:w 1#4#5#6;
+ {
+ \int_compare:nNnTF {#5} < \c_one
+ {
+ \__fp_invalid_operation_o:fw {#2}
+ \s__fp \__fp_chk:w 1#4{#5}#6;
+ }
+ {
+ \__fp_ep_div:wwwwn
+ 1,{1000}{0000}{0000}{0000}{0000}{0000};
+ #5,#6{0000}{0000};
+ { \__fp_asin_auxi_o:NnNww #1 {#3} #4 }
+ }
+ }
+%% File: l3fp-convert.dtx Copyright(C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new:Npn \__fp_trim_zeros:w #1 ;
+ {
+ \__fp_trim_zeros_loop:w #1
+ ; \__fp_trim_zeros_loop:w 0; \__fp_trim_zeros_dot:w .; \s__stop
+ }
+\cs_new:Npn \__fp_trim_zeros_loop:w #1 0; #2 { #2 #1 ; #2 }
+\cs_new:Npn \__fp_trim_zeros_dot:w #1 .; { \__fp_trim_zeros_end:w #1 ; }
+\cs_new:Npn \__fp_trim_zeros_end:w #1 ; #2 \s__stop { #1 }
+\cs_new:Npn \fp_to_scientific:N #1
+ { \exp_after:wN \__fp_to_scientific_dispatch:w #1 }
+\cs_generate_variant:Nn \fp_to_scientific:N { c }
+\cs_new_nopar:Npn \fp_to_scientific:n
+ {
+ \exp_after:wN \__fp_to_scientific_dispatch:w
+ \tex_romannumeral:D -`0 \__fp_parse:n
+ }
+\group_begin:
+\char_set_catcode_other:N E
+\tl_to_lowercase:n
+ {
+ \group_end:
+ \cs_new:Npn \__fp_to_scientific_dispatch:w \s__fp \__fp_chk:w #1#2
+ {
+ \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
+ \if_case:w #1 \exp_stop_f:
+ \__fp_case_return:nw { 0 }
+ \or: \exp_after:wN \__fp_to_scientific_normal:wnnnnn
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_invalid_operation:nnw
+ {
+ \exp_after:wN 1
+ \exp_after:wN E
+ \int_use:N \c__fp_max_exponent_int
+ }
+ { fp_to_scientific }
+ }
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_invalid_operation:nnw
+ { 0 }
+ { fp_to_scientific }
+ }
+ \fi:
+ \s__fp \__fp_chk:w #1 #2
+ }
+ \cs_new:Npn \__fp_to_scientific_normal:wnnnnn
+ \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ;
+ {
+ \if_int_compare:w #2 = \c_one
+ \exp_after:wN \__fp_to_scientific_normal:wNw
+ \else:
+ \exp_after:wN \__fp_to_scientific_normal:wNw
+ \exp_after:wN E
+ \int_use:N \__int_eval:w #2 - \c_one
+ \fi:
+ ; #3 #4 #5 #6 ;
+ }
+ }
+\cs_new:Npn \__fp_to_scientific_normal:wNw #1 ; #2#3;
+ { \__fp_trim_zeros:w #2.#3 ; #1 }
+\cs_new:Npn \fp_to_decimal:N #1
+ { \exp_after:wN \__fp_to_decimal_dispatch:w #1 }
+\cs_generate_variant:Nn \fp_to_decimal:N { c }
+\cs_new_nopar:Npn \fp_to_decimal:n
+ {
+ \exp_after:wN \__fp_to_decimal_dispatch:w
+ \tex_romannumeral:D -`0 \__fp_parse:n
+ }
+\cs_new:Npn \__fp_to_decimal_dispatch:w \s__fp \__fp_chk:w #1#2
+ {
+ \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
+ \if_case:w #1 \exp_stop_f:
+ \__fp_case_return:nw { 0 }
+ \or: \exp_after:wN \__fp_to_decimal_normal:wnnnnn
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_invalid_operation:nnw
+ {
+ \exp_after:wN \exp_after:wN \exp_after:wN 1
+ \prg_replicate:nn \c__fp_max_exponent_int 0
+ }
+ { fp_to_decimal }
+ }
+ \or:
+ \__fp_case_use:nw
+ {
+ \__fp_invalid_operation:nnw
+ { 0 }
+ { fp_to_decimal }
+ }
+ \fi:
+ \s__fp \__fp_chk:w #1 #2
+ }
+\cs_new:Npn \__fp_to_decimal_normal:wnnnnn
+ \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ;
+ {
+ \int_compare:nNnTF {#2} > \c_zero
+ {
+ \int_compare:nNnTF {#2} < \c_sixteen
+ {
+ \__fp_decimate:nNnnnn { \c_sixteen - #2 }
+ \__fp_to_decimal_large:Nnnw
+ }
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_to_decimal_huge:wnnnn
+ \prg_replicate:nn { #2 - \c_sixteen } { 0 } ;
+ }
+ {#3} {#4} {#5} {#6}
+ }
+ {
+ \exp_after:wN \__fp_trim_zeros:w
+ \exp_after:wN 0
+ \exp_after:wN .
+ \tex_romannumeral:D -`0 \prg_replicate:nn { - #2 } { 0 }
+ #3#4#5#6 ;
+ }
+ }
+\cs_new:Npn \__fp_to_decimal_large:Nnnw #1#2#3#4;
+ {
+ \exp_after:wN \__fp_trim_zeros:w \__int_value:w
+ \if_int_compare:w #2 > \c_zero
+ #2
+ \fi:
+ \exp_stop_f:
+ #3.#4 ;
+ }
+\cs_new:Npn \__fp_to_decimal_huge:wnnnn #1; #2#3#4#5 { #2#3#4#5 #1 }
+\cs_new:Npn \fp_to_tl:N #1 { \exp_after:wN \__fp_to_tl_dispatch:w #1 }
+\cs_generate_variant:Nn \fp_to_tl:N { c }
+\cs_new_nopar:Npn \fp_to_tl:n
+ {
+ \exp_after:wN \__fp_to_tl_dispatch:w
+ \tex_romannumeral:D -`0 \__fp_parse:n
+ }
+\cs_new:Npn \__fp_to_tl_dispatch:w \s__fp \__fp_chk:w #1#2
+ {
+ \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
+ \if_case:w #1 \exp_stop_f:
+ \__fp_case_return:nw { 0 }
+ \or: \exp_after:wN \__fp_to_tl_normal:nnnnn
+ \or: \__fp_case_return:nw { \tl_to_str:n {inf} }
+ \else: \__fp_case_return:nw { \tl_to_str:n {nan} }
+ \fi:
+ }
+\cs_new:Npn \__fp_to_tl_normal:nnnnn #1
+ {
+ \if_int_compare:w #1 > \c_sixteen
+ \exp_after:wN \__fp_to_scientific_normal:wnnnnn
+ \else:
+ \if_int_compare:w #1 < - \c_two
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_to_scientific_normal:wnnnnn
+ \else:
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_to_decimal_normal:wnnnnn
+ \fi:
+ \fi:
+ \s__fp \__fp_chk:w 1 0 {#1}
+ }
+\cs_new:Npx \fp_to_dim:N #1
+ { \exp_not:N \fp_to_decimal:N #1 \tl_to_str:n {pt} }
+\cs_generate_variant:Nn \fp_to_dim:N { c }
+\cs_new:Npx \fp_to_dim:n #1
+ { \exp_not:N \fp_to_decimal:n {#1} \tl_to_str:n {pt} }
+\cs_new:Npn \fp_to_int:N #1 { \exp_after:wN \__fp_to_int_dispatch:w #1 }
+\cs_generate_variant:Nn \fp_to_int:N { c }
+\cs_new_nopar:Npn \fp_to_int:n
+ {
+ \exp_after:wN \__fp_to_int_dispatch:w
+ \tex_romannumeral:D -`0 \__fp_parse:n
+ }
+\cs_new:Npn \__fp_to_int_dispatch:w #1;
+ {
+ \exp_after:wN \__fp_to_decimal_dispatch:w \tex_romannumeral:D -`0
+ \__fp_round:Nwn \__fp_round_to_nearest:NNN #1; { 0 }
+ }
+\cs_new:Npn \dim_to_fp:n #1
+ {
+ \exp_after:wN \__fp_from_dim_test:ww
+ \exp_after:wN 0
+ \exp_after:wN ,
+ \__int_value:w \etex_glueexpr:D #1 ;
+ }
+\cs_new:Npn \__fp_from_dim_test:ww #1, #2
+ {
+ \if_meaning:w 0 #2
+ \__fp_case_return:nw { \exp_after:wN \c_zero_fp }
+ \else:
+ \exp_after:wN \__fp_from_dim:wNw
+ \int_use:N \__int_eval:w #1 - \c_four
+ \if_meaning:w - #2
+ \exp_after:wN , \exp_after:wN 2 \__int_value:w
+ \else:
+ \exp_after:wN , \exp_after:wN 0 \__int_value:w #2
+ \fi:
+ \fi:
+ }
+\cs_new:Npn \__fp_from_dim:wNw #1,#2#3;
+ {
+ \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim:wNNnnnnnn ;
+ #3 000 0000 00 {10}987654321; #2 {#1}
+ }
+\cs_new:Npn \__fp_from_dim:wNNnnnnnn #1; #2#3#4#5#6#7#8#9
+ { \__fp_from_dim:wnnnnwNn #1 {#2#300} {0000} ; }
+\cs_new:Npn \__fp_from_dim:wnnnnwNn #1; #2#3#4#5#6; #7#8
+ {
+ \__fp_mul_npos_o:Nww #7
+ \s__fp \__fp_chk:w 1 #7 {#5} #1 ;
+ \s__fp \__fp_chk:w 1 0 {#8} {1525} {8789} {0625} {0000} ;
+ \prg_do_nothing:
+ }
+\cs_new_eq:NN \fp_use:N \fp_to_decimal:N
+\cs_generate_variant:Nn \fp_use:N { c }
+\cs_new_eq:NN \fp_eval:n \fp_to_decimal:n
+\cs_new:Npn \fp_abs:n #1
+ { \fp_to_decimal:n { abs \__fp_parse:n {#1} } }
+\cs_new:Npn \fp_max:nn #1#2
+ { \fp_to_decimal:n { max ( \__fp_parse:n {#1} , \__fp_parse:n {#2} ) } }
+\cs_new:Npn \fp_min:nn #1#2
+ { \fp_to_decimal:n { min ( \__fp_parse:n {#1} , \__fp_parse:n {#2} ) } }
+\cs_new:Npn \__fp_array_to_clist:n #1
+ {
+ \tl_if_empty:nF {#1}
+ {
+ \__fp_expand:n
+ {
+ { \use_ii:nn }
+ \__fp_array_to_clist_loop:Nw #1 { ? \__prg_break: } ;
+ \__prg_break_point:
+ }
+ }
+ }
+\cs_new:Npx \__fp_array_to_clist_loop:Nw #1#2;
+ {
+ \exp_not:N \use_none:n #1
+ \exp_not:N \exp_after:wN
+ {
+ \exp_not:N \exp_after:wN ,
+ \exp_not:N \exp_after:wN \c_space_tl
+ \exp_not:N \tex_romannumeral:D -`0
+ \exp_not:N \__fp_to_tl_dispatch:w #1 #2 ;
+ }
+ \exp_not:N \__fp_array_to_clist_loop:Nw
+ }
+%%
+%% File: l3fp-assign.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\cs_new_protected:Npn \fp_new:N #1
+ { \cs_new_eq:NN #1 \c_zero_fp }
+\cs_generate_variant:Nn \fp_new:N {c}
+\cs_new_protected:Npn \fp_set:Nn #1#2
+ { \tl_set:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
+\cs_new_protected:Npn \fp_gset:Nn #1#2
+ { \tl_gset:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
+\cs_new_protected:Npn \fp_const:Nn #1#2
+ { \tl_const:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
+\cs_generate_variant:Nn \fp_set:Nn {c}
+\cs_generate_variant:Nn \fp_gset:Nn {c}
+\cs_generate_variant:Nn \fp_const:Nn {c}
+\cs_new_eq:NN \fp_set_eq:NN \tl_set_eq:NN
+\cs_new_eq:NN \fp_gset_eq:NN \tl_gset_eq:NN
+\cs_generate_variant:Nn \fp_set_eq:NN { c , Nc , cc }
+\cs_generate_variant:Nn \fp_gset_eq:NN { c , Nc , cc }
+\cs_new_protected:Npn \fp_zero:N #1 { \fp_set_eq:NN #1 \c_zero_fp }
+\cs_new_protected:Npn \fp_gzero:N #1 { \fp_gset_eq:NN #1 \c_zero_fp }
+\cs_generate_variant:Nn \fp_zero:N { c }
+\cs_generate_variant:Nn \fp_gzero:N { c }
+\cs_new_protected:Npn \fp_zero_new:N #1
+ { \fp_if_exist:NTF #1 { \fp_zero:N #1 } { \fp_new:N #1 } }
+\cs_new_protected:Npn \fp_gzero_new:N #1
+ { \fp_if_exist:NTF #1 { \fp_gzero:N #1 } { \fp_new:N #1 } }
+\cs_generate_variant:Nn \fp_zero_new:N { c }
+\cs_generate_variant:Nn \fp_gzero_new:N { c }
+\cs_new_protected_nopar:Npn \fp_add:Nn { \__fp_add:NNNn \fp_set:Nn + }
+\cs_new_protected_nopar:Npn \fp_gadd:Nn { \__fp_add:NNNn \fp_gset:Nn + }
+\cs_new_protected_nopar:Npn \fp_sub:Nn { \__fp_add:NNNn \fp_set:Nn - }
+\cs_new_protected_nopar:Npn \fp_gsub:Nn { \__fp_add:NNNn \fp_gset:Nn - }
+\cs_new_protected:Npn \__fp_add:NNNn #1#2#3#4
+ { #1 #3 { #3 #2 \__fp_parse:n {#4} } }
+\cs_generate_variant:Nn \fp_add:Nn { c }
+\cs_generate_variant:Nn \fp_gadd:Nn { c }
+\cs_generate_variant:Nn \fp_sub:Nn { c }
+\cs_generate_variant:Nn \fp_gsub:Nn { c }
+\cs_new_protected:Npn \fp_show:N #1
+ {
+ \fp_if_exist:NTF #1
+ { \__msg_show_variable:n { > ~ \fp_to_tl:N #1 } }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_new_protected:Npn \fp_show:n #1
+ { \__msg_show_variable:n { > ~ \fp_to_tl:n {#1} } }
+\cs_generate_variant:Nn \fp_show:N { c }
+\fp_const:Nn \c_e_fp { 2.718 2818 2845 9045 }
+\fp_const:Nn \c_one_fp { 1 }
+\fp_const:Nn \c_pi_fp { 3.141 5926 5358 9793 }
+\fp_const:Nn \c_one_degree_fp { 0.0 1745 3292 5199 4330 }
+\fp_new:N \l_tmpa_fp
+\fp_new:N \l_tmpb_fp
+\fp_new:N \g_tmpa_fp
+\fp_new:N \g_tmpb_fp
+%% File: l3fp-old.dtx Copyright (C) 2012,2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\fp_const:Nn \c_undefined_fp { nan }
+\prg_new_conditional:Npnn \fp_if_undefined:N #1 { p , T , F , TF }
+ { \exp_after:wN \__fp_if_undefined:w #1 }
+\cs_new:Npn \__fp_if_undefined:w \s__fp \__fp_chk:w #1#2;
+ {
+ \if_int_compare:w #1 > \c_one
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+\prg_new_conditional:Npnn \fp_if_zero:N #1 { p , T , F , TF }
+ { \exp_after:wN \__fp_if_zero:w #1 }
+\cs_new:Npn \__fp_if_zero:w \s__fp \__fp_chk:w #1#2;
+ { \if_meaning:w #1 0 \prg_return_true: \else: \prg_return_false: \fi: }
+\cs_new_protected_nopar:Npn \fp_abs:N { \__fp_abs:NNN \tl_set:Nx \__fp_abs_o:w }
+\cs_new_protected_nopar:Npn \fp_gabs:N { \__fp_abs:NNN \tl_gset:Nx \__fp_abs_o:w }
+\cs_new_protected_nopar:Npx \fp_neg:N
+ {
+ \exp_not:N \__fp_abs:NNN
+ \exp_not:N \tl_set:Nx
+ \exp_not:c { __fp_-_o:w }
+ }
+\cs_new_protected_nopar:Npx \fp_gneg:N
+ {
+ \exp_not:N \__fp_abs:NNN
+ \exp_not:N \tl_gset:Nx
+ \exp_not:c { __fp_-_o:w }
+ }
+\cs_new_protected:Npn \__fp_abs:NNN #1#2#3
+ { #1 #3 { \exp_after:wN #2 #3 \prg_do_nothing: } }
+\cs_generate_variant:Nn \fp_abs:N { c }
+\cs_generate_variant:Nn \fp_gabs:N { c }
+\cs_generate_variant:Nn \fp_neg:N { c }
+\cs_generate_variant:Nn \fp_gneg:N { c }
+\cs_new_protected_nopar:Npn \fp_mul:Nn { \__fp_mul:NNNn \fp_set:Nn * }
+\cs_new_protected_nopar:Npn \fp_gmul:Nn { \__fp_mul:NNNn \fp_gset:Nn * }
+\cs_new_protected_nopar:Npn \fp_div:Nn { \__fp_mul:NNNn \fp_set:Nn / }
+\cs_new_protected_nopar:Npn \fp_gdiv:Nn { \__fp_mul:NNNn \fp_gset:Nn / }
+\cs_new_protected_nopar:Npn \fp_pow:Nn { \__fp_mul:NNNn \fp_set:Nn ^ }
+\cs_new_protected_nopar:Npn \fp_gpow:Nn { \__fp_mul:NNNn \fp_gset:Nn ^ }
+\cs_new_protected:Npn \__fp_mul:NNNn #1#2#3#4
+ { #1 #3 { #3 #2 \__fp_parse:n {#4} } }
+\cs_generate_variant:Nn \fp_mul:Nn { c }
+\cs_generate_variant:Nn \fp_gmul:Nn { c }
+\cs_generate_variant:Nn \fp_div:Nn { c }
+\cs_generate_variant:Nn \fp_gdiv:Nn { c }
+\cs_generate_variant:Nn \fp_pow:Nn { c }
+\cs_generate_variant:Nn \fp_gpow:Nn { c }
+\cs_set_protected:Npn \__fp_tmp:w #1#2#3#4#5
+ {
+ \cs_new_protected_nopar:Npn #1 { #5 {#4} \tl_set_eq:NN #3 }
+ \cs_new_protected_nopar:Npn #2 { #5 {#4} \tl_gset_eq:NN #3 }
+ \cs_generate_variant:Nn #1 { c }
+ \cs_generate_variant:Nn #2 { c }
+ }
+\__fp_tmp:w \fp_exp:Nn \fp_gexp:Nn \__fp_exp_o:w {exp} \__fp_assign_to:nNNNn
+\__fp_tmp:w \fp_ln:Nn \fp_gln:Nn \__fp_ln_o:w {ln } \__fp_assign_to:nNNNn
+\__fp_tmp:w \fp_sin:Nn \fp_gsin:Nn \__fp_sin_o:w {sin} \__fp_assign_to:nNNNn
+\__fp_tmp:w \fp_cos:Nn \fp_gcos:Nn \__fp_cos_o:w {cos} \__fp_assign_to:nNNNn
+\__fp_tmp:w \fp_tan:Nn \fp_gtan:Nn \__fp_tan_o:w {tan} \__fp_assign_to:nNNNn
+\cs_new_protected:Npn \__fp_assign_to:nNNNn #1#2#3#4#5
+ {
+ \exp_after:wN \__fp_assign_to_i:wNNNn
+ \tex_romannumeral:D -`0 \__fp_parse:n {#5} {#1} #2#3#4
+ }
+\cs_new_protected:Npn \__fp_assign_to_i:wNNNn \s__fp \__fp_chk:w #1#2#3; #4
+ {
+ \exp_args:Nc \__fp_assign_to_ii:NnNNN
+ { c__fp_ #4 [ #1 # 2 \if_meaning:w 1 #1 #3 \fi: ] _fp }
+ { #1#2#3 }
+ }
+\cs_new_protected:Npn \__fp_assign_to_ii:NnNNN #1#2#3#4#5
+ {
+ \cs_if_exist:NF #1
+ { \tl_const:Nx #1 { #4 \s__fp \__fp_chk:w #2; } }
+ #3 #5 #1
+ }
+\cs_new_protected_nopar:Npn \fp_compare:NNNTF { \fp_compare:nNnTF }
+\cs_new_protected_nopar:Npn \fp_compare:NNNT { \fp_compare:nNnT }
+\cs_new_protected_nopar:Npn \fp_compare:NNNF { \fp_compare:nNnF }
+\cs_new_protected_nopar:Npn \fp_round_places:Nn
+ { \__fp_round_places:NNn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \fp_ground_places:Nn
+ { \__fp_round_places:NNn \tl_gset:Nx }
+\cs_new_protected:Npn \__fp_round_places:NNn #1#2#3
+ {
+ #1 #2
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_round:Nwn
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \__fp_round_to_nearest:NNN
+ \exp_after:wN #2
+ \exp_after:wN { \int_use:N \__int_eval:w #3 }
+ }
+ }
+\cs_generate_variant:Nn \fp_round_places:Nn { c }
+\cs_generate_variant:Nn \fp_ground_places:Nn { c }
+\cs_new_protected:Npn \fp_round_figures:Nn #1#2
+ {
+ \__fp_round_places:NNn \tl_set:Nx #1
+ { #2 - \exp_after:wN \__fp_exponent:w #1 }
+ }
+\cs_new_protected:Npn \fp_ground_figures:Nn #1#2
+ {
+ \__fp_round_places:NNn \tl_gset:Nx #1
+ { #2 - \exp_after:wN \__fp_exponent:w #1 }
+ }
+\cs_generate_variant:Nn \fp_round_figures:Nn { c }
+\cs_generate_variant:Nn \fp_ground_figures:Nn { c }
+%% File: l3box.dtx Copyright (C) 2005-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3box.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Experimental boxes}
+\cs_new_protected:Npn \box_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \cs:w newbox \cs_end: #1
+ }
+\cs_generate_variant:Nn \box_new:N { c }
+\cs_new_protected:Npn \box_clear:N #1
+ { \box_set_eq:NN #1 \c_empty_box }
+\cs_new_protected:Npn \box_gclear:N #1
+ { \box_gset_eq:NN #1 \c_empty_box }
+\cs_generate_variant:Nn \box_clear:N { c }
+\cs_generate_variant:Nn \box_gclear:N { c }
+\cs_new_protected:Npn \box_clear_new:N #1
+ { \box_if_exist:NTF #1 { \box_clear:N #1 } { \box_new:N #1 } }
+\cs_new_protected:Npn \box_gclear_new:N #1
+ { \box_if_exist:NTF #1 { \box_gclear:N #1 } { \box_new:N #1 } }
+\cs_generate_variant:Nn \box_clear_new:N { c }
+\cs_generate_variant:Nn \box_gclear_new:N { c }
+\cs_new_protected:Npn \box_set_eq:NN #1#2
+ { \tex_setbox:D #1 \tex_copy:D #2 }
+\cs_new_protected:Npn \box_gset_eq:NN
+ { \tex_global:D \box_set_eq:NN }
+\cs_generate_variant:Nn \box_set_eq:NN { c , Nc , cc }
+\cs_generate_variant:Nn \box_gset_eq:NN { c , Nc , cc }
+\cs_new_protected:Npn \box_set_eq_clear:NN #1#2
+ { \tex_setbox:D #1 \tex_box:D #2 }
+\cs_new_protected:Npn \box_gset_eq_clear:NN
+ { \tex_global:D \box_set_eq_clear:NN }
+\cs_generate_variant:Nn \box_set_eq_clear:NN { c , Nc , cc }
+\cs_generate_variant:Nn \box_gset_eq_clear:NN { c , Nc , cc }
+\prg_new_eq_conditional:NNn \box_if_exist:N \cs_if_exist:N { TF , T , F , p }
+\prg_new_eq_conditional:NNn \box_if_exist:c \cs_if_exist:c { TF , T , F , p }
+\cs_new_eq:NN \box_ht:N \tex_ht:D
+\cs_new_eq:NN \box_dp:N \tex_dp:D
+\cs_new_eq:NN \box_wd:N \tex_wd:D
+\cs_generate_variant:Nn \box_ht:N { c }
+\cs_generate_variant:Nn \box_dp:N { c }
+\cs_generate_variant:Nn \box_wd:N { c }
+\cs_new_protected:Npn \box_set_dp:Nn #1#2
+ { \box_dp:N #1 \__dim_eval:w #2 \__dim_eval_end: }
+\cs_new_protected:Npn \box_set_ht:Nn #1#2
+ { \box_ht:N #1 \__dim_eval:w #2 \__dim_eval_end: }
+\cs_new_protected:Npn \box_set_wd:Nn #1#2
+ { \box_wd:N #1 \__dim_eval:w #2 \__dim_eval_end: }
+\cs_generate_variant:Nn \box_set_ht:Nn { c }
+\cs_generate_variant:Nn \box_set_dp:Nn { c }
+\cs_generate_variant:Nn \box_set_wd:Nn { c }
+\cs_new_eq:NN \box_use_clear:N \tex_box:D
+\cs_new_eq:NN \box_use:N \tex_copy:D
+\cs_generate_variant:Nn \box_use_clear:N { c }
+\cs_generate_variant:Nn \box_use:N { c }
+\cs_new_protected:Npn \box_move_left:nn #1#2
+ { \tex_moveleft:D \__dim_eval:w #1 \__dim_eval_end: #2 }
+\cs_new_protected:Npn \box_move_right:nn #1#2
+ { \tex_moveright:D \__dim_eval:w #1 \__dim_eval_end: #2 }
+\cs_new_protected:Npn \box_move_up:nn #1#2
+ { \tex_raise:D \__dim_eval:w #1 \__dim_eval_end: #2 }
+\cs_new_protected:Npn \box_move_down:nn #1#2
+ { \tex_lower:D \__dim_eval:w #1 \__dim_eval_end: #2 }
+\cs_new_eq:NN \if_hbox:N \tex_ifhbox:D
+\cs_new_eq:NN \if_vbox:N \tex_ifvbox:D
+\cs_new_eq:NN \if_box_empty:N \tex_ifvoid:D
+\prg_new_conditional:Npnn \box_if_horizontal:N #1 { p , T , F , TF }
+ { \if_hbox:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
+\prg_new_conditional:Npnn \box_if_vertical:N #1 { p , T , F , TF }
+ { \if_vbox:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
+\cs_generate_variant:Nn \box_if_horizontal_p:N { c }
+\cs_generate_variant:Nn \box_if_horizontal:NT { c }
+\cs_generate_variant:Nn \box_if_horizontal:NF { c }
+\cs_generate_variant:Nn \box_if_horizontal:NTF { c }
+\cs_generate_variant:Nn \box_if_vertical_p:N { c }
+\cs_generate_variant:Nn \box_if_vertical:NT { c }
+\cs_generate_variant:Nn \box_if_vertical:NF { c }
+\cs_generate_variant:Nn \box_if_vertical:NTF { c }
+\prg_new_conditional:Npnn \box_if_empty:N #1 { p , T , F , TF }
+ { \if_box_empty:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
+\cs_generate_variant:Nn \box_if_empty_p:N { c }
+\cs_generate_variant:Nn \box_if_empty:NT { c }
+\cs_generate_variant:Nn \box_if_empty:NF { c }
+\cs_generate_variant:Nn \box_if_empty:NTF { c }
+\cs_new_protected:Npn \box_set_to_last:N #1
+ { \tex_setbox:D #1 \tex_lastbox:D }
+\cs_new_protected:Npn \box_gset_to_last:N
+ { \tex_global:D \box_set_to_last:N }
+\cs_generate_variant:Nn \box_set_to_last:N { c }
+\cs_generate_variant:Nn \box_gset_to_last:N { c }
+\box_new:N \c_empty_box
+\box_new:N \l_tmpa_box
+\box_new:N \l_tmpb_box
+\box_new:N \g_tmpa_box
+\box_new:N \g_tmpb_box
+\cs_new_protected:Npn \box_show:N #1
+ { \box_show:Nnn #1 \c_max_int \c_max_int }
+\cs_generate_variant:Nn \box_show:N { c }
+\cs_new_protected_nopar:Npn \box_show:Nnn
+ { \__box_show:NNnn \c_one }
+\cs_generate_variant:Nn \box_show:Nnn { c }
+\cs_new_protected:Npn \box_log:N #1
+ { \box_log:Nnn #1 \c_max_int \c_max_int }
+\cs_generate_variant:Nn \box_log:N { c }
+\cs_new_protected:Npn \box_log:Nnn #1#2#3
+ {
+ \use:x
+ {
+ \etex_interactionmode:D \c_zero
+ \__box_show:NNnn \c_zero \exp_not:N #1
+ { \int_eval:n {#2} } { \int_eval:n {#3} }
+ \etex_interactionmode:D
+ = \tex_the:D \etex_interactionmode:D \scan_stop:
+ }
+ }
+\cs_generate_variant:Nn \box_log:Nnn { c }
+\cs_new_protected:Npn \__box_show:NNnn #1#2#3#4
+ {
+ \group_begin:
+ \int_set:Nn \tex_showboxbreadth:D {#3}
+ \int_set:Nn \tex_showboxdepth:D {#4}
+ \int_set_eq:NN \tex_tracingonline:D #1
+ \box_if_exist:NTF #2
+ { \tex_showbox:D \use:n {#2} }
+ {
+ \__msg_kernel_error:nnx { kernel } { variable-not-defined }
+ { \token_to_str:N #2 }
+ }
+ \group_end:
+ }
+\cs_new_protected:Npn \hbox:n { \tex_hbox:D \scan_stop: }
+\cs_new_protected:Npn \hbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_hbox:D {#2} }
+\cs_new_protected:Npn \hbox_gset:Nn { \tex_global:D \hbox_set:Nn }
+\cs_generate_variant:Nn \hbox_set:Nn { c }
+\cs_generate_variant:Nn \hbox_gset:Nn { c }
+\cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3
+ { \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end: {#3} }
+\cs_new_protected:Npn \hbox_gset_to_wd:Nnn
+ { \tex_global:D \hbox_set_to_wd:Nnn }
+\cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c }
+\cs_generate_variant:Nn \hbox_gset_to_wd:Nnn { c }
+\cs_new_protected:Npn \hbox_set:Nw #1
+ { \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token }
+\cs_new_protected:Npn \hbox_gset:Nw
+ { \tex_global:D \hbox_set:Nw }
+\cs_generate_variant:Nn \hbox_set:Nw { c }
+\cs_generate_variant:Nn \hbox_gset:Nw { c }
+\cs_new_eq:NN \hbox_set_end: \c_group_end_token
+\cs_new_eq:NN \hbox_gset_end: \c_group_end_token
+\cs_new_eq:NN \hbox_set_inline_begin:N \hbox_set:Nw
+\cs_new_eq:NN \hbox_set_inline_begin:c \hbox_set:cw
+\cs_new_eq:NN \hbox_set_inline_end: \hbox_set_end:
+\cs_new_eq:NN \hbox_gset_inline_begin:N \hbox_gset:Nw
+\cs_new_eq:NN \hbox_gset_inline_begin:c \hbox_gset:cw
+\cs_new_eq:NN \hbox_gset_inline_end: \hbox_gset_end:
+\cs_new_protected:Npn \hbox_to_wd:nn #1#2
+ { \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end: {#2} }
+\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_dim {#1} }
+\cs_new_protected:Npn \hbox_overlap_left:n #1
+ { \hbox_to_zero:n { \tex_hss:D #1 } }
+\cs_new_protected:Npn \hbox_overlap_right:n #1
+ { \hbox_to_zero:n { #1 \tex_hss:D } }
+\cs_new_eq:NN \hbox_unpack:N \tex_unhcopy:D
+\cs_new_eq:NN \hbox_unpack_clear:N \tex_unhbox:D
+\cs_generate_variant:Nn \hbox_unpack:N { c }
+\cs_generate_variant:Nn \hbox_unpack_clear:N { c }
+\cs_new_protected:Npn \vbox:n #1 { \tex_vbox:D { #1 \par } }
+\cs_new_protected:Npn \vbox_top:n #1 { \tex_vtop:D { #1 \par } }
+\cs_new_protected:Npn \vbox_to_ht:nn #1#2
+ { \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end: { #2 \par } }
+\cs_new_protected:Npn \vbox_to_zero:n #1
+ { \tex_vbox:D to \c_zero_dim { #1 \par } }
+\cs_new_protected:Npn \vbox_set:Nn #1#2
+ { \tex_setbox:D #1 \tex_vbox:D { #2 \par } }
+\cs_new_protected:Npn \vbox_gset:Nn { \tex_global:D \vbox_set:Nn }
+\cs_generate_variant:Nn \vbox_set:Nn { c }
+\cs_generate_variant:Nn \vbox_gset:Nn { c }
+\cs_new_protected:Npn \vbox_set_top:Nn #1#2
+ { \tex_setbox:D #1 \tex_vtop:D { #2 \par } }
+\cs_new_protected:Npn \vbox_gset_top:Nn
+ { \tex_global:D \vbox_set_top:Nn }
+\cs_generate_variant:Nn \vbox_set_top:Nn { c }
+\cs_generate_variant:Nn \vbox_gset_top:Nn { c }
+\cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3
+ { \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:w #2 \__dim_eval_end: { #3 \par } }
+\cs_new_protected:Npn \vbox_gset_to_ht:Nnn
+ { \tex_global:D \vbox_set_to_ht:Nnn }
+\cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c }
+\cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c }
+\cs_new_protected:Npn \vbox_set:Nw #1
+ { \tex_setbox:D #1 \tex_vbox:D \c_group_begin_token }
+\cs_new_protected:Npn \vbox_gset:Nw
+ { \tex_global:D \vbox_set:Nw }
+\cs_generate_variant:Nn \vbox_set:Nw { c }
+\cs_generate_variant:Nn \vbox_gset:Nw { c }
+\cs_new_protected:Npn \vbox_set_end:
+ {
+ \par
+ \c_group_end_token
+ }
+\cs_new_eq:NN \vbox_gset_end: \vbox_set_end:
+\cs_new_eq:NN \vbox_set_inline_begin:N \vbox_set:Nw
+\cs_new_eq:NN \vbox_set_inline_begin:c \vbox_set:cw
+\cs_new_eq:NN \vbox_set_inline_end: \vbox_set_end:
+\cs_new_eq:NN \vbox_gset_inline_begin:N \vbox_gset:Nw
+\cs_new_eq:NN \vbox_gset_inline_begin:c \vbox_gset:cw
+\cs_new_eq:NN \vbox_gset_inline_end: \vbox_gset_end:
+\cs_new_eq:NN \vbox_unpack:N \tex_unvcopy:D
+\cs_new_eq:NN \vbox_unpack_clear:N \tex_unvbox:D
+\cs_generate_variant:Nn \vbox_unpack:N { c }
+\cs_generate_variant:Nn \vbox_unpack_clear:N { c }
+\cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3
+ { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:w #3 \__dim_eval_end: }
+%% File: l3coffins.dtx Copyright(C) 2010-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\GetIdInfo$Id: l3coffins.dtx 4728 2014-05-04 13:25:37Z joseph $
+ {L3 Coffin code layer}
+\box_new:N \l__coffin_internal_box
+\dim_new:N \l__coffin_internal_dim
+\tl_new:N \l__coffin_internal_tl
+\prop_new:N \c__coffin_corners_prop
+\prop_put:Nnn \c__coffin_corners_prop { tl } { { 0 pt } { 0 pt } }
+\prop_put:Nnn \c__coffin_corners_prop { tr } { { 0 pt } { 0 pt } }
+\prop_put:Nnn \c__coffin_corners_prop { bl } { { 0 pt } { 0 pt } }
+\prop_put:Nnn \c__coffin_corners_prop { br } { { 0 pt } { 0 pt } }
+\prop_new:N \c__coffin_poles_prop
+\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } }
+\prop_put:Nno \c__coffin_poles_prop { l } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { hc } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { r } { \l__coffin_internal_tl }
+\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } }
+\prop_put:Nno \c__coffin_poles_prop { b } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { vc } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { t } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { B } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { H } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { T } { \l__coffin_internal_tl }
+\fp_new:N \l__coffin_slope_x_fp
+\fp_new:N \l__coffin_slope_y_fp
+\bool_new:N \l__coffin_error_bool
+\dim_new:N \l__coffin_offset_x_dim
+\dim_new:N \l__coffin_offset_y_dim
+\tl_new:N \l__coffin_pole_a_tl
+\tl_new:N \l__coffin_pole_b_tl
+\dim_new:N \l__coffin_x_dim
+\dim_new:N \l__coffin_y_dim
+\dim_new:N \l__coffin_x_prime_dim
+\dim_new:N \l__coffin_y_prime_dim
+\prg_new_conditional:Npnn \coffin_if_exist:N #1 { p , T , F , TF }
+ {
+ \cs_if_exist:NTF #1
+ {
+ \cs_if_exist:cTF { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
+ }
+\cs_generate_variant:Nn \coffin_if_exist_p:N { c }
+\cs_generate_variant:Nn \coffin_if_exist:NT { c }
+\cs_generate_variant:Nn \coffin_if_exist:NF { c }
+\cs_generate_variant:Nn \coffin_if_exist:NTF { c }
+\cs_new_protected:Npn \__coffin_if_exist:NT #1#2
+ {
+ \coffin_if_exist:NTF #1
+ { #2 }
+ {
+ \__msg_kernel_error:nnx { kernel } { unknown-coffin }
+ { \token_to_str:N #1 }
+ }
+ }
+\cs_new_protected:Npn \coffin_clear:N #1
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \box_clear:N #1
+ \__coffin_reset_structure:N #1
+ }
+ }
+\cs_generate_variant:Nn \coffin_clear:N { c }
+\cs_new_protected:Npn \coffin_new:N #1
+ {
+ \box_new:N #1
+ \prop_clear_new:c { l__coffin_corners_ \__int_value:w #1 _prop }
+ \prop_clear_new:c { l__coffin_poles_ \__int_value:w #1 _prop }
+ \prop_gset_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
+ \c__coffin_corners_prop
+ \prop_gset_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
+ \c__coffin_poles_prop
+ }
+\cs_generate_variant:Nn \coffin_new:N { c }
+\cs_new_protected:Npn \hcoffin_set:Nn #1#2
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \hbox_set:Nn #1
+ {
+ \color_group_begin:
+ \color_ensure_current:
+ #2
+ \color_group_end:
+ }
+ \__coffin_reset_structure:N #1
+ \__coffin_update_poles:N #1
+ \__coffin_update_corners:N #1
+ }
+ }
+\cs_generate_variant:Nn \hcoffin_set:Nn { c }
+\cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \vbox_set:Nn #1
+ {
+ \dim_set:Nn \tex_hsize:D {#2}
+ \dim_set_eq:NN \linewidth \tex_hsize:D
+ \dim_set_eq:NN \columnwidth \tex_hsize:D
+ \color_group_begin:
+ #3
+ \color_group_end:
+ }
+ \__coffin_reset_structure:N #1
+ \__coffin_update_poles:N #1
+ \__coffin_update_corners:N #1
+ \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
+ \__coffin_set_pole:Nnx #1 { T }
+ {
+ { 0 pt }
+ { \dim_eval:n { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box } }
+ { 1000 pt }
+ { 0 pt }
+ }
+ \box_clear:N \l__coffin_internal_box
+ }
+ }
+\cs_generate_variant:Nn \vcoffin_set:Nnn { c }
+\cs_new_protected:Npn \hcoffin_set:Nw #1
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \hbox_set:Nw #1 \color_group_begin: \color_ensure_current:
+ \cs_set_protected_nopar:Npn \hcoffin_set_end:
+ {
+ \color_group_end:
+ \hbox_set_end:
+ \__coffin_reset_structure:N #1
+ \__coffin_update_poles:N #1
+ \__coffin_update_corners:N #1
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \hcoffin_set_end: { }
+\cs_generate_variant:Nn \hcoffin_set:Nw { c }
+\cs_new_protected:Npn \vcoffin_set:Nnw #1#2
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \vbox_set:Nw #1
+ \dim_set:Nn \tex_hsize:D {#2}
+ \dim_set_eq:NN \linewidth \tex_hsize:D
+ \dim_set_eq:NN \columnwidth \tex_hsize:D
+ \color_group_begin: \color_ensure_current:
+ \cs_set_protected:Npn \vcoffin_set_end:
+ {
+ \color_group_end:
+ \vbox_set_end:
+ \__coffin_reset_structure:N #1
+ \__coffin_update_poles:N #1
+ \__coffin_update_corners:N #1
+ \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
+ \__coffin_set_pole:Nnx #1 { T }
+ {
+ { 0 pt }
+ {
+ \dim_eval:n { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
+ }
+ { 1000 pt }
+ { 0 pt }
+ }
+ \box_clear:N \l__coffin_internal_box
+ }
+ }
+ }
+\cs_new_protected_nopar:Npn \vcoffin_set_end: { }
+\cs_generate_variant:Nn \vcoffin_set:Nnw { c }
+\cs_new_protected:Npn \coffin_set_eq:NN #1#2
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \box_set_eq:NN #1 #2
+ \__coffin_set_eq_structure:NN #1 #2
+ }
+ }
+\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc }
+\coffin_new:N \c_empty_coffin
+\hbox_set:Nn \c_empty_coffin { }
+\coffin_new:N \l__coffin_aligned_coffin
+\coffin_new:N \l__coffin_aligned_internal_coffin
+\coffin_new:N \l_tmpa_coffin
+\coffin_new:N \l_tmpb_coffin
+\cs_new_eq:NN \coffin_dp:N \box_dp:N
+\cs_new_eq:NN \coffin_dp:c \box_dp:c
+\cs_new_eq:NN \coffin_ht:N \box_ht:N
+\cs_new_eq:NN \coffin_ht:c \box_ht:c
+\cs_new_eq:NN \coffin_wd:N \box_wd:N
+\cs_new_eq:NN \coffin_wd:c \box_wd:c
+\cs_new_protected:Npn \__coffin_get_pole:NnN #1#2#3
+ {
+ \prop_get:cnNF
+ { l__coffin_poles_ \__int_value:w #1 _prop } {#2} #3
+ {
+ \__msg_kernel_error:nnxx { kernel } { unknown-coffin-pole }
+ {#2} { \token_to_str:N #1 }
+ \tl_set:Nn #3 { { 0 pt } { 0 pt } { 0 pt } { 0 pt } }
+ }
+ }
+\cs_new_protected:Npn \__coffin_reset_structure:N #1
+ {
+ \prop_set_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
+ \c__coffin_corners_prop
+ \prop_set_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
+ \c__coffin_poles_prop
+ }
+\cs_new_protected:Npn \__coffin_set_eq_structure:NN #1#2
+ {
+ \prop_set_eq:cc { l__coffin_corners_ \__int_value:w #1 _prop }
+ { l__coffin_corners_ \__int_value:w #2 _prop }
+ \prop_set_eq:cc { l__coffin_poles_ \__int_value:w #1 _prop }
+ { l__coffin_poles_ \__int_value:w #2 _prop }
+ }
+\cs_new_protected:Npn \__coffin_gset_eq_structure:NN #1#2
+ {
+ \prop_gset_eq:cc { l__coffin_corners_ \__int_value:w #1 _prop }
+ { l__coffin_corners_ \__int_value:w #2 _prop }
+ \prop_gset_eq:cc { l__coffin_poles_ \__int_value:w #1 _prop }
+ { l__coffin_poles_ \__int_value:w #2 _prop }
+ }
+\cs_new_protected:Npn \coffin_set_horizontal_pole:Nnn #1#2#3
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \__coffin_set_pole:Nnx #1 {#2}
+ {
+ { 0 pt } { \dim_eval:n {#3} }
+ { 1000 pt } { 0 pt }
+ }
+ }
+ }
+\cs_new_protected:Npn \coffin_set_vertical_pole:Nnn #1#2#3
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \__coffin_set_pole:Nnx #1 {#2}
+ {
+ { \dim_eval:n {#3} } { 0 pt }
+ { 0 pt } { 1000 pt }
+ }
+ }
+ }
+\cs_new_protected:Npn \__coffin_set_pole:Nnn #1#2#3
+ { \prop_put:cnn { l__coffin_poles_ \__int_value:w #1 _prop } {#2} {#3} }
+\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c }
+\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c }
+\cs_generate_variant:Nn \__coffin_set_pole:Nnn { Nnx }
+\cs_new_protected:Npn \__coffin_update_corners:N #1
+ {
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tl }
+ { { 0 pt } { \dim_use:N \box_ht:N #1 } }
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tr }
+ { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } }
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { bl }
+ { { 0 pt } { \dim_eval:n { - \box_dp:N #1 } } }
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { br }
+ { { \dim_use:N \box_wd:N #1 } { \dim_eval:n { - \box_dp:N #1 } } }
+ }
+\cs_new_protected:Npn \__coffin_update_poles:N #1
+ {
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { hc }
+ {
+ { \dim_eval:n { 0.5 \box_wd:N #1 } }
+ { 0 pt } { 0 pt } { 1000 pt }
+ }
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { r }
+ {
+ { \dim_use:N \box_wd:N #1 }
+ { 0 pt } { 0 pt } { 1000 pt }
+ }
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { vc }
+ {
+ { 0 pt }
+ { \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } }
+ { 1000 pt }
+ { 0 pt }
+ }
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { t }
+ {
+ { 0 pt }
+ { \dim_use:N \box_ht:N #1 }
+ { 1000 pt }
+ { 0 pt }
+ }
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { b }
+ {
+ { 0 pt }
+ { \dim_eval:n { - \box_dp:N #1 } }
+ { 1000 pt }
+ { 0 pt }
+ }
+ }
+\cs_new_protected:Npn \__coffin_calculate_intersection:Nnn #1#2#3
+ {
+ \__coffin_get_pole:NnN #1 {#2} \l__coffin_pole_a_tl
+ \__coffin_get_pole:NnN #1 {#3} \l__coffin_pole_b_tl
+ \bool_set_false:N \l__coffin_error_bool
+ \exp_last_two_unbraced:Noo
+ \__coffin_calculate_intersection:nnnnnnnn
+ \l__coffin_pole_a_tl \l__coffin_pole_b_tl
+ \bool_if:NT \l__coffin_error_bool
+ {
+ \__msg_kernel_error:nn { kernel } { no-pole-intersection }
+ \dim_zero:N \l__coffin_x_dim
+ \dim_zero:N \l__coffin_y_dim
+ }
+ }
+\cs_new_protected:Npn \__coffin_calculate_intersection:nnnnnnnn
+ #1#2#3#4#5#6#7#8
+ {
+ \dim_compare:nNnTF {#3} = { \c_zero_dim }
+ {
+ \dim_set:Nn \l__coffin_x_dim {#1}
+ \dim_compare:nNnTF {#7} = \c_zero_dim
+ { \bool_set_true:N \l__coffin_error_bool }
+ {
+ \dim_compare:nNnTF {#8} = \c_zero_dim
+ { \dim_set:Nn \l__coffin_y_dim {#6} }
+ {
+ \__coffin_calculate_intersection_aux:nnnnnN
+ {#1} {#5} {#6} {#7} {#8} \l__coffin_y_dim
+ }
+ }
+ }
+ {
+ \dim_compare:nNnTF {#4} = \c_zero_dim
+ {
+ \dim_set:Nn \l__coffin_y_dim {#2}
+ \dim_compare:nNnTF {#8} = { \c_zero_dim }
+ { \bool_set_true:N \l__coffin_error_bool }
+ {
+ \dim_compare:nNnTF {#7} = \c_zero_dim
+ { \dim_set:Nn \l__coffin_x_dim {#5} }
+ {
+ \__coffin_calculate_intersection_aux:nnnnnN
+ {#2} {#6} {#5} {#8} {#7} \l__coffin_x_dim
+ }
+ }
+ }
+ {
+ \dim_compare:nNnTF {#7} = \c_zero_dim
+ {
+ \dim_set:Nn \l__coffin_x_dim {#5}
+ \__coffin_calculate_intersection_aux:nnnnnN
+ {#5} {#1} {#2} {#3} {#4} \l__coffin_y_dim
+ }
+ {
+ \dim_compare:nNnTF {#8} = \c_zero_dim
+ {
+ \dim_set:Nn \l__coffin_y_dim {#6}
+ \__coffin_calculate_intersection_aux:nnnnnN
+ {#6} {#2} {#1} {#4} {#3} \l__coffin_x_dim
+ }
+ {
+ \fp_set:Nn \l__coffin_slope_x_fp
+ { \dim_to_fp:n {#4} / \dim_to_fp:n {#3} }
+ \fp_set:Nn \l__coffin_slope_y_fp
+ { \dim_to_fp:n {#8} / \dim_to_fp:n {#7} }
+ \fp_compare:nNnTF
+ \l__coffin_slope_x_fp = \l__coffin_slope_y_fp
+ { \bool_set_true:N \l__coffin_error_bool }
+ {
+ \dim_set:Nn \l__coffin_x_dim
+ {
+ \fp_to_dim:n
+ {
+ (
+ \dim_to_fp:n {#1} * \l__coffin_slope_x_fp
+ - ( \dim_to_fp:n {#5} * \l__coffin_slope_y_fp )
+ - \dim_to_fp:n {#2}
+ + \dim_to_fp:n {#6}
+ )
+ /
+ ( \l__coffin_slope_x_fp - \l__coffin_slope_y_fp )
+ }
+ }
+ \__coffin_calculate_intersection_aux:nnnnnN
+ { \l__coffin_x_dim }
+ {#5} {#6} {#8} {#7} \l__coffin_y_dim
+ }
+ }
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__coffin_calculate_intersection_aux:nnnnnN #1#2#3#4#5#6
+ {
+ \dim_set:Nn #6
+ {
+ \fp_to_dim:n
+ {
+ \dim_to_fp:n {#4} *
+ ( \dim_to_fp:n {#1} - \dim_to_fp:n {#2} ) /
+ \dim_to_fp:n {#5}
+ + \dim_to_fp:n {#3}
+ }
+ }
+ }
+\cs_new_protected:Npn \coffin_join:NnnNnnnn #1#2#3#4#5#6#7#8
+ {
+ \__coffin_align:NnnNnnnnN
+ #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
+ \hbox_set:Nn \l__coffin_aligned_coffin
+ {
+ \dim_compare:nNnT { \l__coffin_offset_x_dim } < \c_zero_dim
+ { \tex_kern:D -\l__coffin_offset_x_dim }
+ \hbox_unpack:N \l__coffin_aligned_coffin
+ \dim_set:Nn \l__coffin_internal_dim
+ { \l__coffin_offset_x_dim - \box_wd:N #1 + \box_wd:N #4 }
+ \dim_compare:nNnT \l__coffin_internal_dim < \c_zero_dim
+ { \tex_kern:D -\l__coffin_internal_dim }
+ }
+ \__coffin_reset_structure:N \l__coffin_aligned_coffin
+ \prop_clear:c
+ { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _ prop }
+ \__coffin_update_poles:N \l__coffin_aligned_coffin
+ \dim_compare:nNnTF \l__coffin_offset_x_dim < \c_zero_dim
+ {
+ \__coffin_offset_poles:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
+ \__coffin_offset_poles:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
+ \__coffin_offset_corners:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
+ \__coffin_offset_corners:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
+ }
+ {
+ \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
+ \__coffin_offset_poles:Nnn #4
+ { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
+ \__coffin_offset_corners:Nnn #1 { 0 pt } { 0 pt }
+ \__coffin_offset_corners:Nnn #4
+ { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
+ }
+ \__coffin_update_vertical_poles:NNN #1 #4 \l__coffin_aligned_coffin
+ \coffin_set_eq:NN #1 \l__coffin_aligned_coffin
+ }
+\cs_generate_variant:Nn \coffin_join:NnnNnnnn { c , Nnnc , cnnc }
+\cs_new_protected:Npn \coffin_attach:NnnNnnnn #1#2#3#4#5#6#7#8
+ {
+ \__coffin_align:NnnNnnnnN
+ #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
+ \box_set_ht:Nn \l__coffin_aligned_coffin { \box_ht:N #1 }
+ \box_set_dp:Nn \l__coffin_aligned_coffin { \box_dp:N #1 }
+ \box_set_wd:Nn \l__coffin_aligned_coffin { \box_wd:N #1 }
+ \__coffin_reset_structure:N \l__coffin_aligned_coffin
+ \prop_set_eq:cc
+ { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _prop }
+ { l__coffin_corners_ \__int_value:w #1 _prop }
+ \__coffin_update_poles:N \l__coffin_aligned_coffin
+ \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
+ \__coffin_offset_poles:Nnn #4
+ { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
+ \__coffin_update_vertical_poles:NNN #1 #4 \l__coffin_aligned_coffin
+ \coffin_set_eq:NN #1 \l__coffin_aligned_coffin
+ }
+\cs_new_protected:Npn \coffin_attach_mark:NnnNnnnn #1#2#3#4#5#6#7#8
+ {
+ \__coffin_align:NnnNnnnnN
+ #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
+ \box_set_ht:Nn \l__coffin_aligned_coffin { \box_ht:N #1 }
+ \box_set_dp:Nn \l__coffin_aligned_coffin { \box_dp:N #1 }
+ \box_set_wd:Nn \l__coffin_aligned_coffin { \box_wd:N #1 }
+ \box_set_eq:NN #1 \l__coffin_aligned_coffin
+ }
+\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { c , Nnnc , cnnc }
+\cs_new_protected:Npn \__coffin_align:NnnNnnnnN #1#2#3#4#5#6#7#8#9
+ {
+ \__coffin_calculate_intersection:Nnn #4 {#5} {#6}
+ \dim_set:Nn \l__coffin_x_prime_dim { \l__coffin_x_dim }
+ \dim_set:Nn \l__coffin_y_prime_dim { \l__coffin_y_dim }
+ \__coffin_calculate_intersection:Nnn #1 {#2} {#3}
+ \dim_set:Nn \l__coffin_offset_x_dim
+ { \l__coffin_x_dim - \l__coffin_x_prime_dim + #7 }
+ \dim_set:Nn \l__coffin_offset_y_dim
+ { \l__coffin_y_dim - \l__coffin_y_prime_dim + #8 }
+ \hbox_set:Nn \l__coffin_aligned_internal_coffin
+ {
+ \box_use:N #1
+ \tex_kern:D -\box_wd:N #1
+ \tex_kern:D \l__coffin_offset_x_dim
+ \box_move_up:nn { \l__coffin_offset_y_dim } { \box_use:N #4 }
+ }
+ \coffin_set_eq:NN #9 \l__coffin_aligned_internal_coffin
+ }
+\cs_new_protected:Npn \__coffin_offset_poles:Nnn #1#2#3
+ {
+ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \__coffin_offset_pole:Nnnnnnn #1 {##1} ##2 {#2} {#3} }
+ }
+\cs_new_protected:Npn \__coffin_offset_pole:Nnnnnnn #1#2#3#4#5#6#7#8
+ {
+ \dim_set:Nn \l__coffin_x_dim { #3 + #7 }
+ \dim_set:Nn \l__coffin_y_dim { #4 + #8 }
+ \tl_if_in:nnTF {#2} { - }
+ { \tl_set:Nn \l__coffin_internal_tl { {#2} } }
+ { \tl_set:Nn \l__coffin_internal_tl { { #1 - #2 } } }
+ \exp_last_unbraced:NNo \__coffin_set_pole:Nnx \l__coffin_aligned_coffin
+ { \l__coffin_internal_tl }
+ {
+ { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
+ {#5} {#6}
+ }
+ }
+\cs_new_protected:Npn \__coffin_offset_corners:Nnn #1#2#3
+ {
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_offset_corner:Nnnnn #1 {##1} ##2 {#2} {#3} }
+ }
+\cs_new_protected:Npn \__coffin_offset_corner:Nnnnn #1#2#3#4#5#6
+ {
+ \prop_put:cnx
+ { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _prop }
+ { #1 - #2 }
+ {
+ { \dim_eval:n { #3 + #5 } }
+ { \dim_eval:n { #4 + #6 } }
+ }
+ }
+\cs_new_protected:Npn \__coffin_update_vertical_poles:NNN #1#2#3
+ {
+ \__coffin_get_pole:NnN #3 { #1 -T } \l__coffin_pole_a_tl
+ \__coffin_get_pole:NnN #3 { #2 -T } \l__coffin_pole_b_tl
+ \exp_last_two_unbraced:Noo \__coffin_update_T:nnnnnnnnN
+ \l__coffin_pole_a_tl \l__coffin_pole_b_tl #3
+ \__coffin_get_pole:NnN #3 { #1 -B } \l__coffin_pole_a_tl
+ \__coffin_get_pole:NnN #3 { #2 -B } \l__coffin_pole_b_tl
+ \exp_last_two_unbraced:Noo \__coffin_update_B:nnnnnnnnN
+ \l__coffin_pole_a_tl \l__coffin_pole_b_tl #3
+ }
+\cs_new_protected:Npn \__coffin_update_T:nnnnnnnnN #1#2#3#4#5#6#7#8#9
+ {
+ \dim_compare:nNnTF {#2} < {#6}
+ {
+ \__coffin_set_pole:Nnx #9 { T }
+ { { 0 pt } {#6} { 1000 pt } { 0 pt } }
+ }
+ {
+ \__coffin_set_pole:Nnx #9 { T }
+ { { 0 pt } {#2} { 1000 pt } { 0 pt } }
+ }
+ }
+\cs_new_protected:Npn \__coffin_update_B:nnnnnnnnN #1#2#3#4#5#6#7#8#9
+ {
+ \dim_compare:nNnTF {#2} < {#6}
+ {
+ \__coffin_set_pole:Nnx #9 { B }
+ { { 0 pt } {#2} { 1000 pt } { 0 pt } }
+ }
+ {
+ \__coffin_set_pole:Nnx #9 { B }
+ { { 0 pt } {#6} { 1000 pt } { 0 pt } }
+ }
+ }
+\cs_new_protected:Npn \coffin_typeset:Nnnnn #1#2#3#4#5
+ {
+ \hbox_unpack:N \c_empty_box
+ \__coffin_align:NnnNnnnnN \c_empty_coffin { H } { l }
+ #1 {#2} {#3} {#4} {#5} \l__coffin_aligned_coffin
+ \box_use:N \l__coffin_aligned_coffin
+ }
+\cs_generate_variant:Nn \coffin_typeset:Nnnnn { c }
+\coffin_new:N \l__coffin_display_coffin
+\coffin_new:N \l__coffin_display_coord_coffin
+\coffin_new:N \l__coffin_display_pole_coffin
+\prop_new:N \l__coffin_display_handles_prop
+\prop_put:Nnn \l__coffin_display_handles_prop { tl }
+ { { b } { r } { -1 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { thc }
+ { { b } { hc } { 0 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { tr }
+ { { b } { l } { 1 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { vcl }
+ { { vc } { r } { -1 } { 0 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { vchc }
+ { { vc } { hc } { 0 } { 0 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { vcr }
+ { { vc } { l } { 1 } { 0 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { bl }
+ { { t } { r } { -1 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { bhc }
+ { { t } { hc } { 0 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { br }
+ { { t } { l } { 1 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Tl }
+ { { t } { r } { -1 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Thc }
+ { { t } { hc } { 0 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Tr }
+ { { t } { l } { 1 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Hl }
+ { { vc } { r } { -1 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Hhc }
+ { { vc } { hc } { 0 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Hr }
+ { { vc } { l } { 1 } { 1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Bl }
+ { { b } { r } { -1 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Bhc }
+ { { b } { hc } { 0 } { -1 } }
+\prop_put:Nnn \l__coffin_display_handles_prop { Br }
+ { { b } { l } { 1 } { -1 } }
+\dim_new:N \l__coffin_display_offset_dim
+\dim_set:Nn \l__coffin_display_offset_dim { 2 pt }
+\dim_new:N \l__coffin_display_x_dim
+\dim_new:N \l__coffin_display_y_dim
+\prop_new:N \l__coffin_display_poles_prop
+\tl_new:N \l__coffin_display_font_tl
+\tl_set:Nn \l__coffin_display_font_tl { \sffamily \tiny }
+\cs_new_protected:Npn \coffin_mark_handle:Nnnn #1#2#3#4
+ {
+ \hcoffin_set:Nn \l__coffin_display_pole_coffin
+ {
+ \color {#4}
+ \rule { 1 pt } { 1 pt }
+ }
+ \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
+ \l__coffin_display_pole_coffin { hc } { vc } { 0 pt } { 0 pt }
+ \hcoffin_set:Nn \l__coffin_display_coord_coffin
+ {
+ \color {#4}
+ \l__coffin_display_font_tl
+ ( \tl_to_str:n { #2 , #3 } )
+ }
+ \prop_get:NnN \l__coffin_display_handles_prop
+ { #2 #3 } \l__coffin_internal_tl
+ \quark_if_no_value:NTF \l__coffin_internal_tl
+ {
+ \prop_get:NnN \l__coffin_display_handles_prop
+ { #3 #2 } \l__coffin_internal_tl
+ \quark_if_no_value:NTF \l__coffin_internal_tl
+ {
+ \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
+ \l__coffin_display_coord_coffin { l } { vc }
+ { 1 pt } { 0 pt }
+ }
+ {
+ \exp_last_unbraced:No \__coffin_mark_handle_aux:nnnnNnn
+ \l__coffin_internal_tl #1 {#2} {#3}
+ }
+ }
+ {
+ \exp_last_unbraced:No \__coffin_mark_handle_aux:nnnnNnn
+ \l__coffin_internal_tl #1 {#2} {#3}
+ }
+ }
+\cs_new_protected:Npn \__coffin_mark_handle_aux:nnnnNnn #1#2#3#4#5#6#7
+ {
+ \coffin_attach_mark:NnnNnnnn #5 {#6} {#7}
+ \l__coffin_display_coord_coffin {#1} {#2}
+ { #3 \l__coffin_display_offset_dim }
+ { #4 \l__coffin_display_offset_dim }
+ }
+\cs_generate_variant:Nn \coffin_mark_handle:Nnnn { c }
+\cs_new_protected:Npn \coffin_display_handles:Nn #1#2
+ {
+ \hcoffin_set:Nn \l__coffin_display_pole_coffin
+ {
+ \color {#2}
+ \rule { 1 pt } { 1 pt }
+ }
+ \prop_set_eq:Nc \l__coffin_display_poles_prop
+ { l__coffin_poles_ \__int_value:w #1 _prop }
+ \__coffin_get_pole:NnN #1 { H } \l__coffin_pole_a_tl
+ \__coffin_get_pole:NnN #1 { T } \l__coffin_pole_b_tl
+ \tl_if_eq:NNT \l__coffin_pole_a_tl \l__coffin_pole_b_tl
+ { \prop_remove:Nn \l__coffin_display_poles_prop { T } }
+ \__coffin_get_pole:NnN #1 { B } \l__coffin_pole_b_tl
+ \tl_if_eq:NNT \l__coffin_pole_a_tl \l__coffin_pole_b_tl
+ { \prop_remove:Nn \l__coffin_display_poles_prop { B } }
+ \coffin_set_eq:NN \l__coffin_display_coffin #1
+ \prop_map_inline:Nn \l__coffin_display_poles_prop
+ {
+ \prop_remove:Nn \l__coffin_display_poles_prop {##1}
+ \__coffin_display_handles_aux:nnnnnn {##1} ##2 {#2}
+ }
+ \box_use:N \l__coffin_display_coffin
+ }
+\cs_new_protected:Npn \__coffin_display_handles_aux:nnnnnn #1#2#3#4#5#6
+ {
+ \prop_map_inline:Nn \l__coffin_display_poles_prop
+ {
+ \bool_set_false:N \l__coffin_error_bool
+ \__coffin_calculate_intersection:nnnnnnnn {#2} {#3} {#4} {#5} ##2
+ \bool_if:NF \l__coffin_error_bool
+ {
+ \dim_set:Nn \l__coffin_display_x_dim { \l__coffin_x_dim }
+ \dim_set:Nn \l__coffin_display_y_dim { \l__coffin_y_dim }
+ \__coffin_display_attach:Nnnnn
+ \l__coffin_display_pole_coffin { hc } { vc }
+ { 0 pt } { 0 pt }
+ \hcoffin_set:Nn \l__coffin_display_coord_coffin
+ {
+ \color {#6}
+ \l__coffin_display_font_tl
+ ( \tl_to_str:n { #1 , ##1 } )
+ }
+ \prop_get:NnN \l__coffin_display_handles_prop
+ { #1 ##1 } \l__coffin_internal_tl
+ \quark_if_no_value:NTF \l__coffin_internal_tl
+ {
+ \prop_get:NnN \l__coffin_display_handles_prop
+ { ##1 #1 } \l__coffin_internal_tl
+ \quark_if_no_value:NTF \l__coffin_internal_tl
+ {
+ \__coffin_display_attach:Nnnnn
+ \l__coffin_display_coord_coffin { l } { vc }
+ { 1 pt } { 0 pt }
+ }
+ {
+ \exp_last_unbraced:No
+ \__coffin_display_handles_aux:nnnn
+ \l__coffin_internal_tl
+ }
+ }
+ {
+ \exp_last_unbraced:No \__coffin_display_handles_aux:nnnn
+ \l__coffin_internal_tl
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__coffin_display_handles_aux:nnnn #1#2#3#4
+ {
+ \__coffin_display_attach:Nnnnn
+ \l__coffin_display_coord_coffin {#1} {#2}
+ { #3 \l__coffin_display_offset_dim }
+ { #4 \l__coffin_display_offset_dim }
+ }
+\cs_generate_variant:Nn \coffin_display_handles:Nn { c }
+\cs_new_protected:Npn \__coffin_display_attach:Nnnnn #1#2#3#4#5
+ {
+ \__coffin_calculate_intersection:Nnn #1 {#2} {#3}
+ \dim_set:Nn \l__coffin_x_prime_dim { \l__coffin_x_dim }
+ \dim_set:Nn \l__coffin_y_prime_dim { \l__coffin_y_dim }
+ \dim_set:Nn \l__coffin_offset_x_dim
+ { \l__coffin_display_x_dim - \l__coffin_x_prime_dim + #4 }
+ \dim_set:Nn \l__coffin_offset_y_dim
+ { \l__coffin_display_y_dim - \l__coffin_y_prime_dim + #5 }
+ \hbox_set:Nn \l__coffin_aligned_coffin
+ {
+ \box_use:N \l__coffin_display_coffin
+ \tex_kern:D -\box_wd:N \l__coffin_display_coffin
+ \tex_kern:D \l__coffin_offset_x_dim
+ \box_move_up:nn { \l__coffin_offset_y_dim } { \box_use:N #1 }
+ }
+ \box_set_ht:Nn \l__coffin_aligned_coffin
+ { \box_ht:N \l__coffin_display_coffin }
+ \box_set_dp:Nn \l__coffin_aligned_coffin
+ { \box_dp:N \l__coffin_display_coffin }
+ \box_set_wd:Nn \l__coffin_aligned_coffin
+ { \box_wd:N \l__coffin_display_coffin }
+ \box_set_eq:NN \l__coffin_display_coffin \l__coffin_aligned_coffin
+ }
+\cs_new_protected:Npn \coffin_show_structure:N #1
+ {
+ \__coffin_if_exist:NT #1
+ {
+ \__msg_show_variable:Nnn #1 { coffins }
+ {
+ \prop_map_function:cN
+ { l__coffin_poles_ \__int_value:w #1 _prop }
+ \__msg_show_item_unbraced:nn
+ }
+ }
+ }
+\cs_generate_variant:Nn \coffin_show_structure:N { c }
+\__msg_kernel_new:nnnn { kernel } { no-pole-intersection }
+ { No~intersection~between~coffin~poles. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~was~asked~to~find~the~intersection~between~two~poles,~
+ but~they~do~not~have~a~unique~meeting~point:~
+ the~value~(0~pt,~0~pt)~will~be~used.
+ }
+\__msg_kernel_new:nnnn { kernel } { unknown-coffin }
+ { Unknown~coffin~'#1'. }
+ { The~coffin~'#1'~was~never~defined. }
+\__msg_kernel_new:nnnn { kernel } { unknown-coffin-pole }
+ { Pole~'#1'~unknown~for~coffin~'#2'. }
+ {
+ \c_msg_coding_error_text_tl
+ LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~
+ but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong.
+ }
+\__msg_kernel_new:nnn { kernel } { show-coffins }
+ {
+ Size~of~coffin~\token_to_str:N #1 : \\
+ > ~ ht~=~\dim_use:N \box_ht:N #1 \\
+ > ~ dp~=~\dim_use:N \box_dp:N #1 \\
+ > ~ wd~=~\dim_use:N \box_wd:N #1 \\
+ Poles~of~coffin~\token_to_str:N #1 :
+ }
+%% File: l3color.dtx Copyright(C) 2011,2012,2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\GetIdInfo$Id: l3color.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Experimental color support}
+\cs_new_eq:NN \color_group_begin: \group_begin:
+\cs_new_protected_nopar:Npn \color_group_end:
+ {
+ \tex_par:D
+ \group_end:
+ }
+\cs_new_protected_nopar:Npn \color_ensure_current: { }
+\AtBeginDocument
+ {
+ \cs_if_exist:NTF \__driver_color_ensure_current:
+ {
+ \cs_set_protected_nopar:Npn \color_ensure_current:
+ { \__driver_color_ensure_current: }
+ }
+ {
+ \cs_if_exist:NT \set@color
+ { \cs_set_protected_nopar:Npn \color_ensure_current: { \set@color } }
+ }
+ }
+%% File: l3luatex.dtx Copyright (C) 2010-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\GetIdInfo$Id: l3luatex.dtx 4712 2014-04-30 08:17:49Z joseph $
+ {L3 Experimental LuaTeX-specific functions}
+\luatex_if_engine:TF
+ {
+ \cs_new_eq:NN \lua_now_x:n \luatex_directlua:D
+ \cs_new_eq:NN \lua_shipout_x:n \luatex_latelua:D
+ }
+ {
+ \cs_new:Npn \lua_now_x:n #1
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { bad-engine } { \lua_now_x:n }
+ }
+ \cs_new_protected:Npn \lua_shipout_x:n #1
+ {
+ \__msg_kernel_expandable_error:nnn
+ { kernel } { bad-engine } { \lua_shipout_x:n }
+ }
+ }
+\cs_generate_variant:Nn \lua_now_x:n { x }
+\cs_new:Npn \lua_now:n #1
+ { \lua_now_x:n { \exp_not:n {#1} } }
+\cs_generate_variant:Nn \lua_now:n { x }
+\cs_generate_variant:Nn \lua_shipout_x:n { x }
+\cs_new_protected:Npn \lua_shipout:n #1
+ { \lua_shipout_x:n { \exp_not:n {#1} } }
+\cs_generate_variant:Nn \lua_shipout:n { x }
+\int_new:N \g__cctab_allocate_int
+\int_set:Nn \g__cctab_allocate_int { \c_minus_one }
+\int_new:N \g__cctab_stack_int
+\seq_new:N \g__cctab_stack_seq
+\cs_new_protected:Npn \cctab_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \int_gadd:Nn \g__cctab_allocate_int { \c_two }
+ \int_compare:nNnTF
+ \g__cctab_allocate_int < { \c_max_register_int + \c_one }
+ {
+ \tex_global:D \tex_chardef:D #1 \g__cctab_allocate_int
+ \luatex_initcatcodetable:D #1
+ }
+ { \__msg_kernel_fatal:nnx { kernel } { out-of-registers } { cctab } }
+ }
+\luatex_if_engine:F
+ {
+ \cs_set_protected:Npn \cctab_new:N #1
+ {
+ \__msg_kernel_error:nnx { kernel } { bad-engine }
+ { \exp_not:N \cctab_new:N }
+ }
+ }
+\luatex_if_engine:T
+ {
+ \cs_set_protected:Npn \cctab_new:N #1
+ {
+ \__chk_if_free_cs:N #1
+ \newcatcodetable #1
+ \luatex_initcatcodetable:D #1
+ }
+ }
+\cs_new_protected:Npn \cctab_begin:N #1
+ {
+ \seq_gpush:Nx \g__cctab_stack_seq { \tex_the:D \luatex_catcodetable:D }
+ \luatex_catcodetable:D #1
+ \int_gadd:Nn \g__cctab_stack_int { \c_two }
+ \int_compare:nNnT \g__cctab_stack_int > \c_max_register_int
+ { \__msg_kernel_fatal:nn { kernel } { cctab-stack-full } }
+ \luatex_savecatcodetable:D \g__cctab_stack_int
+ \luatex_catcodetable:D \g__cctab_stack_int
+ }
+\cs_new_protected_nopar:Npn \cctab_end:
+ {
+ \int_gsub:Nn \g__cctab_stack_int { \c_two }
+ \seq_if_empty:NTF \g__cctab_stack_seq
+ { \tl_set:Nn \l__cctab_internal_tl { 0 } }
+ { \seq_gpop:NN \g__cctab_stack_seq \l__cctab_internal_tl }
+ \luatex_catcodetable:D \l__cctab_internal_tl \scan_stop:
+ }
+\luatex_if_engine:F
+ {
+ \cs_set_protected:Npn \cctab_begin:N #1
+ {
+ \__msg_kernel_error:nnxx { kernel } { bad-engine }
+ { \exp_not:N \cctab_begin:N } {#1}
+ }
+ \cs_set_protected_nopar:Npn \cctab_end:
+ {
+ \__msg_kernel_error:nnx { kernel } { bad-engine }
+ { \exp_not:N \cctab_end: }
+ }
+ }
+\luatex_if_engine:T
+ {
+ \cs_set_protected:Npn \cctab_begin:N #1 { \BeginCatcodeRegime #1 }
+ \cs_set_protected_nopar:Npn \cctab_end: { \EndCatcodeRegime }
+ }
+\tl_new:N \l__cctab_internal_tl
+\cs_new_protected:Npn \cctab_gset:Nn #1#2
+ {
+ \group_begin:
+ #2
+ \luatex_savecatcodetable:D #1
+ \group_end:
+ }
+\luatex_if_engine:F
+ {
+ \cs_set_protected:Npn \cctab_gset:Nn #1#2
+ {
+ \__msg_kernel_error:nnxx { kernel } { bad-engine }
+ { \exp_not:N \cctab_gset:Nn } { #1 {#2} }
+ }
+ }
+\luatex_if_engine:T
+ {
+ \cctab_new:N \c_code_cctab
+ \cctab_gset:Nn \c_code_cctab { }
+ }
+\luatex_if_engine:T
+ {
+ \cs_new_eq:NN \c_document_cctab \CatcodeTableLaTeX
+ \cs_new_eq:NN \c_initex_cctab \CatcodeTableIniTeX
+ \cs_new_eq:NN \c_other_cctab \CatcodeTableOther
+ \cs_new_eq:NN \c_str_cctab \CatcodeTableString
+ }
+\__msg_kernel_new:nnnn { kernel } { bad-engine }
+ { LuaTeX~engine~not~in~use!~Ignoring~#1. }
+ {
+ The~feature~you~are~using~is~only~available~
+ with~the~LuaTeX~engine.~LaTeX3~ignored~`#1#2'.
+ }
+\__msg_kernel_new:nnnn { kernel } { cctab-stack-full }
+ { The~category~code~table~stack~is~exhausted. }
+ {
+ LaTeX~has~been~asked~to~switch~to~a~new~category~code~table,~
+ but~there~is~no~more~space~to~do~this!
+ }
+%% File: l3candidates.dtx Copyright(C) 2012-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX Project Team.
+%%
+%% -----------------------------------------------------------------------
+%%
+\GetIdInfo$Id: l3candidates.dtx 4734 2014-05-04 21:48:49Z joseph $
+ {L3 Experimental additions to l3kernel}
+\fp_new:N \l__box_angle_fp
+\fp_new:N \l__box_cos_fp
+\fp_new:N \l__box_sin_fp
+\dim_new:N \l__box_top_dim
+\dim_new:N \l__box_bottom_dim
+\dim_new:N \l__box_left_dim
+\dim_new:N \l__box_right_dim
+\dim_new:N \l__box_top_new_dim
+\dim_new:N \l__box_bottom_new_dim
+\dim_new:N \l__box_left_new_dim
+\dim_new:N \l__box_right_new_dim
+\box_new:N \l__box_internal_box
+\cs_new_protected:Npn \box_rotate:Nn #1#2
+ {
+ \hbox_set:Nn #1
+ {
+ \group_begin:
+ \fp_set:Nn \l__box_angle_fp {#2}
+ \fp_set:Nn \l__box_sin_fp { sind ( \l__box_angle_fp ) }
+ \fp_set:Nn \l__box_cos_fp { cosd ( \l__box_angle_fp ) }
+ \__box_rotate:N #1
+ \group_end:
+ }
+ }
+\cs_new_protected:Npn \__box_rotate:N #1
+ {
+ \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
+ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+ \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
+ \dim_zero:N \l__box_left_dim
+ \fp_compare:nNnTF \l__box_sin_fp > \c_zero_fp
+ {
+ \fp_compare:nNnTF \l__box_cos_fp > \c_zero_fp
+ { \__box_rotate_quadrant_one: }
+ { \__box_rotate_quadrant_two: }
+ }
+ {
+ \fp_compare:nNnTF \l__box_cos_fp < \c_zero_fp
+ { \__box_rotate_quadrant_three: }
+ { \__box_rotate_quadrant_four: }
+ }
+ \hbox_set:Nn \l__box_internal_box { \box_use:N #1 }
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \tex_kern:D -\l__box_left_new_dim
+ \hbox:n
+ {
+ \__driver_box_rotate_begin:
+ \box_use:N \l__box_internal_box
+ \__driver_box_rotate_end:
+ }
+ }
+ \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
+ \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
+ \box_set_wd:Nn \l__box_internal_box
+ { \l__box_right_new_dim - \l__box_left_new_dim }
+ \box_use:N \l__box_internal_box
+ }
+\cs_new_protected:Npn \__box_rotate_x:nnN #1#2#3
+ {
+ \dim_set:Nn #3
+ {
+ \fp_to_dim:n
+ {
+ \l__box_cos_fp * \dim_to_fp:n {#1}
+ - ( \l__box_sin_fp * \dim_to_fp:n {#2} )
+ }
+ }
+ }
+\cs_new_protected:Npn \__box_rotate_y:nnN #1#2#3
+ {
+ \dim_set:Nn #3
+ {
+ \fp_to_dim:n
+ {
+ \l__box_sin_fp * \dim_to_fp:n {#1}
+ + \l__box_cos_fp * \dim_to_fp:n {#2}
+ }
+ }
+ }
+\cs_new_protected:Npn \__box_rotate_quadrant_one:
+ {
+ \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
+ \l__box_top_new_dim
+ \__box_rotate_y:nnN \l__box_left_dim \l__box_bottom_dim
+ \l__box_bottom_new_dim
+ \__box_rotate_x:nnN \l__box_left_dim \l__box_top_dim
+ \l__box_left_new_dim
+ \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
+ \l__box_right_new_dim
+ }
+\cs_new_protected:Npn \__box_rotate_quadrant_two:
+ {
+ \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
+ \l__box_top_new_dim
+ \__box_rotate_y:nnN \l__box_left_dim \l__box_top_dim
+ \l__box_bottom_new_dim
+ \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
+ \l__box_left_new_dim
+ \__box_rotate_x:nnN \l__box_left_dim \l__box_bottom_dim
+ \l__box_right_new_dim
+ }
+\cs_new_protected:Npn \__box_rotate_quadrant_three:
+ {
+ \__box_rotate_y:nnN \l__box_left_dim \l__box_bottom_dim
+ \l__box_top_new_dim
+ \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
+ \l__box_bottom_new_dim
+ \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
+ \l__box_left_new_dim
+ \__box_rotate_x:nnN \l__box_left_dim \l__box_top_dim
+ \l__box_right_new_dim
+ }
+\cs_new_protected:Npn \__box_rotate_quadrant_four:
+ {
+ \__box_rotate_y:nnN \l__box_left_dim \l__box_top_dim
+ \l__box_top_new_dim
+ \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
+ \l__box_bottom_new_dim
+ \__box_rotate_x:nnN \l__box_left_dim \l__box_bottom_dim
+ \l__box_left_new_dim
+ \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
+ \l__box_right_new_dim
+ }
+\fp_new:N \l__box_scale_x_fp
+\fp_new:N \l__box_scale_y_fp
+\cs_new_protected:Npn \box_resize:Nnn #1#2#3
+ {
+ \hbox_set:Nn #1
+ {
+ \group_begin:
+ \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
+ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+ \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
+ \dim_zero:N \l__box_left_dim
+ \fp_set:Nn \l__box_scale_x_fp
+ { \dim_to_fp:n {#2} / ( \dim_to_fp:n \l__box_right_dim ) }
+ \fp_set:Nn \l__box_scale_y_fp
+ {
+ \dim_to_fp:n {#3} /
+ ( \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim } )
+ }
+ \__box_resize:Nnn #1 {#2} {#3}
+ \group_end:
+ }
+ }
+\cs_generate_variant:Nn \box_resize:Nnn { c }
+\cs_new_protected:Npn \__box_resize:Nnn #1#2#3
+ {
+ \dim_set:Nn \l__box_right_new_dim { \dim_abs:n {#2} }
+ \dim_set:Nn \l__box_bottom_new_dim
+ { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
+ \dim_set:Nn \l__box_top_new_dim
+ { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
+ \__box_resize_common:N #1
+ }
+\cs_new_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2
+ {
+ \hbox_set:Nn #1
+ {
+ \group_begin:
+ \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
+ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+ \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
+ \dim_zero:N \l__box_left_dim
+ \fp_set:Nn \l__box_scale_y_fp
+ {
+ \dim_to_fp:n {#2} /
+ ( \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim } )
+ }
+ \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
+ \__box_resize:Nnn #1 {#2} {#2}
+ \group_end:
+ }
+ }
+\cs_generate_variant:Nn \box_resize_to_ht_plus_dp:Nn { c }
+\cs_new_protected:Npn \box_resize_to_wd:Nn #1#2
+ {
+ \hbox_set:Nn #1
+ {
+ \group_begin:
+ \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
+ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+ \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
+ \dim_zero:N \l__box_left_dim
+ \fp_set:Nn \l__box_scale_x_fp
+ { \dim_to_fp:n {#2} / ( \dim_to_fp:n \l__box_right_dim ) }
+ \fp_set_eq:NN \l__box_scale_y_fp \l__box_scale_x_fp
+ \__box_resize:Nnn #1 {#2} {#2}
+ \group_end:
+ }
+ }
+\cs_generate_variant:Nn \box_resize_to_wd:Nn { c }
+\cs_new_protected:Npn \box_scale:Nnn #1#2#3
+ {
+ \hbox_set:Nn #1
+ {
+ \group_begin:
+ \fp_set:Nn \l__box_scale_x_fp {#2}
+ \fp_set:Nn \l__box_scale_y_fp {#3}
+ \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
+ \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+ \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
+ \dim_zero:N \l__box_left_dim
+ \dim_set:Nn \l__box_top_new_dim
+ { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
+ \dim_set:Nn \l__box_bottom_new_dim
+ { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
+ \dim_set:Nn \l__box_right_new_dim
+ { \fp_abs:n { \l__box_scale_x_fp } \l__box_right_dim }
+ \__box_resize_common:N #1
+ \group_end:
+ }
+ }
+\cs_generate_variant:Nn \box_scale:Nnn { c }
+\cs_new_protected:Npn \__box_resize_common:N #1
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \__driver_box_scale_begin:
+ \hbox_overlap_right:n { \box_use:N #1 }
+ \__driver_box_scale_end:
+ }
+ \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
+ \box_set_dp:Nn \l__box_internal_box { \l__box_bottom_new_dim }
+ \fp_compare:nNnTF \l__box_scale_x_fp < \c_zero_fp
+ {
+ \hbox_to_wd:nn { \l__box_right_new_dim }
+ {
+ \tex_kern:D \l__box_right_new_dim
+ \box_use:N \l__box_internal_box
+ \tex_hss:D
+ }
+ }
+ {
+ \box_set_wd:Nn \l__box_internal_box { \l__box_right_new_dim }
+ \hbox:n
+ {
+ \tex_kern:D \c_zero_dim
+ \box_use:N \l__box_internal_box
+ \tex_hss:D
+ }
+ }
+ }
+\cs_new_protected:Npn \box_clip:N #1
+ { \hbox_set:Nn #1 { \__driver_box_use_clip:N #1 } }
+\cs_generate_variant:Nn \box_clip:N { c }
+\cs_new_protected:Npn \box_trim:Nnnnn #1#2#3#4#5
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
+ \box_use:N #1
+ \tex_kern:D -\__dim_eval:w #4 \__dim_eval_end:
+ }
+ \dim_compare:nNnTF { \box_dp:N #1 } > {#3}
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \box_move_down:nn \c_zero_dim
+ { \box_use:N \l__box_internal_box }
+ }
+ \box_set_dp:Nn \l__box_internal_box { \box_dp:N #1 - (#3) }
+ }
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \box_move_down:nn { #3 - \box_dp:N #1 }
+ { \box_use:N \l__box_internal_box }
+ }
+ \box_set_dp:Nn \l__box_internal_box \c_zero_dim
+ }
+ \dim_compare:nNnTF { \box_ht:N \l__box_internal_box } > {#5}
+ {
+ \hbox_set:Nn \l__box_internal_box
+ { \box_move_up:nn \c_zero_dim { \box_use:N \l__box_internal_box } }
+ \box_set_ht:Nn \l__box_internal_box
+ { \box_ht:N \l__box_internal_box - (#5) }
+ }
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \box_move_up:nn { #5 - \box_ht:N \l__box_internal_box }
+ { \box_use:N \l__box_internal_box }
+ }
+ \box_set_ht:Nn \l__box_internal_box \c_zero_dim
+ }
+ \box_set_eq:NN #1 \l__box_internal_box
+ }
+\cs_generate_variant:Nn \box_trim:Nnnnn { c }
+\cs_new_protected:Npn \box_viewport:Nnnnn #1#2#3#4#5
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
+ \box_use:N #1
+ \tex_kern:D \__dim_eval:w #4 - \box_wd:N #1 \__dim_eval_end:
+ }
+ \dim_compare:nNnTF {#3} < \c_zero_dim
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \box_move_down:nn \c_zero_dim
+ { \box_use:N \l__box_internal_box }
+ }
+ \box_set_dp:Nn \l__box_internal_box { -\dim_eval:n {#3} }
+ }
+ {
+ \hbox_set:Nn \l__box_internal_box
+ { \box_move_down:nn {#3} { \box_use:N \l__box_internal_box } }
+ \box_set_dp:Nn \l__box_internal_box \c_zero_dim
+ }
+ \dim_compare:nNnTF {#5} > \c_zero_dim
+ {
+ \hbox_set:Nn \l__box_internal_box
+ { \box_move_up:nn \c_zero_dim { \box_use:N \l__box_internal_box } }
+ \box_set_ht:Nn \l__box_internal_box
+ {
+ #5
+ \dim_compare:nNnT {#3} > \c_zero_dim
+ { - (#3) }
+ }
+ }
+ {
+ \hbox_set:Nn \l__box_internal_box
+ {
+ \box_move_up:nn { -\dim_eval:n {#5} }
+ { \box_use:N \l__box_internal_box }
+ }
+ \box_set_ht:Nn \l__box_internal_box \c_zero_dim
+ }
+ \box_set_eq:NN #1 \l__box_internal_box
+ }
+\cs_generate_variant:Nn \box_viewport:Nnnnn { c }
+\cs_new:Npn \clist_item:Nn #1#2
+ {
+ \exp_args:Nfo \__clist_item:nnNn
+ { \clist_count:N #1 }
+ #1
+ \__clist_item_N_loop:nw
+ {#2}
+ }
+\cs_new:Npn \__clist_item:nnNn #1#2#3#4
+ {
+ \int_compare:nNnTF {#4} < \c_zero
+ {
+ \int_compare:nNnTF {#4} < { - #1 }
+ { \use_none_delimit_by_q_stop:w }
+ { \exp_args:Nf #3 { \int_eval:n { #4 + \c_one + #1 } } }
+ }
+ {
+ \int_compare:nNnTF {#4} > {#1}
+ { \use_none_delimit_by_q_stop:w }
+ { #3 {#4} }
+ }
+ { } , #2 , \q_stop
+ }
+\cs_new:Npn \__clist_item_N_loop:nw #1 #2,
+ {
+ \int_compare:nNnTF {#1} = \c_zero
+ { \use_i_delimit_by_q_stop:nw { \exp_not:n {#2} } }
+ { \exp_args:Nf \__clist_item_N_loop:nw { \int_eval:n { #1 - 1 } } }
+ }
+\cs_generate_variant:Nn \clist_item:Nn { c }
+\cs_new:Npn \clist_item:nn #1#2
+ {
+ \exp_args:Nf \__clist_item:nnNn
+ { \clist_count:n {#1} }
+ {#1}
+ \__clist_item_n:nw
+ {#2}
+ }
+\cs_new:Npn \__clist_item_n:nw #1
+ { \__clist_item_n_loop:nw {#1} \prg_do_nothing: }
+\cs_new:Npn \__clist_item_n_loop:nw #1 #2,
+ {
+ \exp_args:No \tl_if_blank:nTF {#2}
+ { \__clist_item_n_loop:nw {#1} \prg_do_nothing: }
+ {
+ \int_compare:nNnTF {#1} = \c_zero
+ { \exp_args:No \__clist_item_n_end:n {#2} }
+ {
+ \exp_args:Nf \__clist_item_n_loop:nw
+ { \int_eval:n { #1 - 1 } }
+ \prg_do_nothing:
+ }
+ }
+ }
+\cs_new:Npn \__clist_item_n_end:n #1 #2 \q_stop
+ {
+ \__tl_trim_spaces:nn { \q_mark #1 }
+ { \exp_last_unbraced:No \__clist_item_n_strip:w } ,
+ }
+\cs_new:Npn \__clist_item_n_strip:w #1 , { \exp_not:n {#1} }
+\cs_new_protected:Npn \clist_set_from_seq:NN
+ { \__clist_set_from_seq:NNNN \clist_clear:N \tl_set:Nx }
+\cs_new_protected:Npn \clist_gset_from_seq:NN
+ { \__clist_set_from_seq:NNNN \clist_gclear:N \tl_gset:Nx }
+\cs_new_protected:Npn \__clist_set_from_seq:NNNN #1#2#3#4
+ {
+ \seq_if_empty:NTF #4
+ { #1 #3 }
+ {
+ #2 #3
+ {
+ \exp_last_unbraced:Nf \use_none:n
+ { \seq_map_function:NN #4 \__clist_wrap_item:n }
+ }
+ }
+ }
+\cs_new:Npn \__clist_wrap_item:n #1
+ {
+ ,
+ \tl_if_empty:oTF { \__clist_set_from_seq:w #1 ~ , #1 ~ }
+ { \exp_not:n {#1} }
+ { \exp_not:n { {#1} } }
+ }
+\cs_new:Npn \__clist_set_from_seq:w #1 , #2 ~ { }
+\cs_generate_variant:Nn \clist_set_from_seq:NN { Nc }
+\cs_generate_variant:Nn \clist_set_from_seq:NN { c , cc }
+\cs_generate_variant:Nn \clist_gset_from_seq:NN { Nc }
+\cs_generate_variant:Nn \clist_gset_from_seq:NN { c , cc }
+\cs_new_protected:Npn \clist_const:Nn #1#2
+ { \tl_const:Nx #1 { \__clist_trim_spaces:n {#2} } }
+\cs_generate_variant:Nn \clist_const:Nn { c , Nx , cx }
+\prg_new_conditional:Npnn \clist_if_empty:n #1 { p , T , F , TF }
+ {
+ \__clist_if_empty_n:w ? #1
+ , \q_mark \prg_return_false:
+ , \q_mark \prg_return_true:
+ \q_stop
+ }
+\cs_new:Npn \__clist_if_empty_n:w #1 ,
+ {
+ \tl_if_empty:oTF { \use_none:nn #1 ? }
+ { \__clist_if_empty_n:w ? }
+ { \__clist_if_empty_n:wNw }
+ }
+\cs_new:Npn \__clist_if_empty_n:wNw #1 \q_mark #2#3 \q_stop {#2}
+\fp_new:N \l__coffin_sin_fp
+\fp_new:N \l__coffin_cos_fp
+\prop_new:N \l__coffin_bounding_prop
+\dim_new:N \l__coffin_bounding_shift_dim
+\dim_new:N \l__coffin_left_corner_dim
+\dim_new:N \l__coffin_right_corner_dim
+\dim_new:N \l__coffin_bottom_corner_dim
+\dim_new:N \l__coffin_top_corner_dim
+\cs_new_protected:Npn \coffin_rotate:Nn #1#2
+ {
+ \fp_set:Nn \l__coffin_sin_fp { sind ( #2 ) }
+ \fp_set:Nn \l__coffin_cos_fp { cosd ( #2 ) }
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_rotate_corner:Nnnn #1 {##1} ##2 }
+ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \__coffin_rotate_pole:Nnnnnn #1 {##1} ##2 }
+ \__coffin_set_bounding:N #1
+ \prop_map_inline:Nn \l__coffin_bounding_prop
+ { \__coffin_rotate_bounding:nnn {##1} ##2 }
+ \__coffin_find_corner_maxima:N #1
+ \__coffin_find_bounding_shift:
+ \box_rotate:Nn #1 {#2}
+ \hbox_set:Nn \l__coffin_internal_box
+ {
+ \tex_kern:D
+ \__dim_eval:w
+ \l__coffin_bounding_shift_dim - \l__coffin_left_corner_dim
+ \__dim_eval_end:
+ \box_move_down:nn { \l__coffin_bottom_corner_dim }
+ { \box_use:N #1 }
+ }
+ \box_set_ht:Nn \l__coffin_internal_box
+ { \l__coffin_top_corner_dim - \l__coffin_bottom_corner_dim }
+ \box_set_dp:Nn \l__coffin_internal_box { 0 pt }
+ \box_set_wd:Nn \l__coffin_internal_box
+ { \l__coffin_right_corner_dim - \l__coffin_left_corner_dim }
+ \hbox_set:Nn #1 { \box_use:N \l__coffin_internal_box }
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_shift_corner:Nnnn #1 {##1} ##2 }
+ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \__coffin_shift_pole:Nnnnnn #1 {##1} ##2 }
+ }
+\cs_generate_variant:Nn \coffin_rotate:Nn { c }
+\cs_new_protected:Npn \__coffin_set_bounding:N #1
+ {
+ \prop_put:Nnx \l__coffin_bounding_prop { tl }
+ { { 0 pt } { \dim_use:N \box_ht:N #1 } }
+ \prop_put:Nnx \l__coffin_bounding_prop { tr }
+ { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } }
+ \dim_set:Nn \l__coffin_internal_dim { - \box_dp:N #1 }
+ \prop_put:Nnx \l__coffin_bounding_prop { bl }
+ { { 0 pt } { \dim_use:N \l__coffin_internal_dim } }
+ \prop_put:Nnx \l__coffin_bounding_prop { br }
+ { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l__coffin_internal_dim } }
+ }
+\cs_new_protected:Npn \__coffin_rotate_bounding:nnn #1#2#3
+ {
+ \__coffin_rotate_vector:nnNN {#2} {#3} \l__coffin_x_dim \l__coffin_y_dim
+ \prop_put:Nnx \l__coffin_bounding_prop {#1}
+ { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
+ }
+\cs_new_protected:Npn \__coffin_rotate_corner:Nnnn #1#2#3#4
+ {
+ \__coffin_rotate_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
+ { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
+ }
+\cs_new_protected:Npn \__coffin_rotate_pole:Nnnnnn #1#2#3#4#5#6
+ {
+ \__coffin_rotate_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
+ \__coffin_rotate_vector:nnNN {#5} {#6}
+ \l__coffin_x_prime_dim \l__coffin_y_prime_dim
+ \__coffin_set_pole:Nnx #1 {#2}
+ {
+ { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
+ { \dim_use:N \l__coffin_x_prime_dim }
+ { \dim_use:N \l__coffin_y_prime_dim }
+ }
+ }
+\cs_new_protected:Npn \__coffin_rotate_vector:nnNN #1#2#3#4
+ {
+ \dim_set:Nn #3
+ {
+ \fp_to_dim:n
+ {
+ \dim_to_fp:n {#1} * \l__coffin_cos_fp
+ - ( \dim_to_fp:n {#2} * \l__coffin_sin_fp )
+ }
+ }
+ \dim_set:Nn #4
+ {
+ \fp_to_dim:n
+ {
+ \dim_to_fp:n {#1} * \l__coffin_sin_fp
+ + ( \dim_to_fp:n {#2} * \l__coffin_cos_fp )
+ }
+ }
+ }
+\cs_new_protected:Npn \__coffin_find_corner_maxima:N #1
+ {
+ \dim_set:Nn \l__coffin_top_corner_dim { -\c_max_dim }
+ \dim_set:Nn \l__coffin_right_corner_dim { -\c_max_dim }
+ \dim_set:Nn \l__coffin_bottom_corner_dim { \c_max_dim }
+ \dim_set:Nn \l__coffin_left_corner_dim { \c_max_dim }
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_find_corner_maxima_aux:nn ##2 }
+ }
+\cs_new_protected:Npn \__coffin_find_corner_maxima_aux:nn #1#2
+ {
+ \dim_set:Nn \l__coffin_left_corner_dim
+ { \dim_min:nn { \l__coffin_left_corner_dim } {#1} }
+ \dim_set:Nn \l__coffin_right_corner_dim
+ { \dim_max:nn { \l__coffin_right_corner_dim } {#1} }
+ \dim_set:Nn \l__coffin_bottom_corner_dim
+ { \dim_min:nn { \l__coffin_bottom_corner_dim } {#2} }
+ \dim_set:Nn \l__coffin_top_corner_dim
+ { \dim_max:nn { \l__coffin_top_corner_dim } {#2} }
+ }
+\cs_new_protected_nopar:Npn \__coffin_find_bounding_shift:
+ {
+ \dim_set:Nn \l__coffin_bounding_shift_dim { \c_max_dim }
+ \prop_map_inline:Nn \l__coffin_bounding_prop
+ { \__coffin_find_bounding_shift_aux:nn ##2 }
+ }
+\cs_new_protected:Npn \__coffin_find_bounding_shift_aux:nn #1#2
+ {
+ \dim_set:Nn \l__coffin_bounding_shift_dim
+ { \dim_min:nn { \l__coffin_bounding_shift_dim } {#1} }
+ }
+\cs_new_protected:Npn \__coffin_shift_corner:Nnnn #1#2#3#4
+ {
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _ prop } {#2}
+ {
+ { \dim_eval:n { #3 - \l__coffin_left_corner_dim } }
+ { \dim_eval:n { #4 - \l__coffin_bottom_corner_dim } }
+ }
+ }
+\cs_new_protected:Npn \__coffin_shift_pole:Nnnnnn #1#2#3#4#5#6
+ {
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _ prop } {#2}
+ {
+ { \dim_eval:n { #3 - \l__coffin_left_corner_dim } }
+ { \dim_eval:n { #4 - \l__coffin_bottom_corner_dim } }
+ {#5} {#6}
+ }
+ }
+\fp_new:N \l__coffin_scale_x_fp
+\fp_new:N \l__coffin_scale_y_fp
+\dim_new:N \l__coffin_scaled_total_height_dim
+\dim_new:N \l__coffin_scaled_width_dim
+\cs_new_protected:Npn \coffin_resize:Nnn #1#2#3
+ {
+ \fp_set:Nn \l__coffin_scale_x_fp
+ { \dim_to_fp:n {#2} / \dim_to_fp:n { \coffin_wd:N #1 } }
+ \fp_set:Nn \l__coffin_scale_y_fp
+ {
+ \dim_to_fp:n {#3} / \dim_to_fp:n { \coffin_ht:N #1 + \coffin_dp:N #1 }
+ }
+ \box_resize:Nnn #1 {#2} {#3}
+ \__coffin_resize_common:Nnn #1 {#2} {#3}
+ }
+\cs_generate_variant:Nn \coffin_resize:Nnn { c }
+\cs_new_protected:Npn \__coffin_resize_common:Nnn #1#2#3
+ {
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_scale_corner:Nnnn #1 {##1} ##2 }
+ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \__coffin_scale_pole:Nnnnnn #1 {##1} ##2 }
+ \fp_compare:nNnT \l__coffin_scale_x_fp < \c_zero_fp
+ {
+ \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
+ { \__coffin_x_shift_corner:Nnnn #1 {##1} ##2 }
+ \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
+ { \__coffin_x_shift_pole:Nnnnnn #1 {##1} ##2 }
+ }
+ }
+\cs_new_protected:Npn \coffin_scale:Nnn #1#2#3
+ {
+ \fp_set:Nn \l__coffin_scale_x_fp {#2}
+ \fp_set:Nn \l__coffin_scale_y_fp {#3}
+ \box_scale:Nnn #1 { \l__coffin_scale_x_fp } { \l__coffin_scale_y_fp }
+ \dim_set:Nn \l__coffin_internal_dim
+ { \coffin_ht:N #1 + \coffin_dp:N #1 }
+ \dim_set:Nn \l__coffin_scaled_total_height_dim
+ { \fp_abs:n { \l__coffin_scale_y_fp } \l__coffin_internal_dim }
+ \dim_set:Nn \l__coffin_scaled_width_dim
+ { -\fp_abs:n { \l__coffin_scale_x_fp } \coffin_wd:N #1 }
+ \__coffin_resize_common:Nnn #1
+ { \l__coffin_scaled_width_dim } { \l__coffin_scaled_total_height_dim }
+ }
+\cs_generate_variant:Nn \coffin_scale:Nnn { c }
+\cs_new_protected:Npn \__coffin_scale_vector:nnNN #1#2#3#4
+ {
+ \dim_set:Nn #3
+ { \fp_to_dim:n { \dim_to_fp:n {#1} * \l__coffin_scale_x_fp } }
+ \dim_set:Nn #4
+ { \fp_to_dim:n { \dim_to_fp:n {#2} * \l__coffin_scale_y_fp } }
+ }
+\cs_new_protected:Npn \__coffin_scale_corner:Nnnn #1#2#3#4
+ {
+ \__coffin_scale_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
+ { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
+ }
+\cs_new_protected:Npn \__coffin_scale_pole:Nnnnnn #1#2#3#4#5#6
+ {
+ \__coffin_scale_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
+ \__coffin_set_pole:Nnx #1 {#2}
+ {
+ { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
+ {#5} {#6}
+ }
+ }
+\cs_new_protected:Npn \__coffin_x_shift_corner:Nnnn #1#2#3#4
+ {
+ \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
+ {
+ { \dim_eval:n { #3 + \box_wd:N #1 } } {#4}
+ }
+ }
+\cs_new_protected:Npn \__coffin_x_shift_pole:Nnnnnn #1#2#3#4#5#6
+ {
+ \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } {#2}
+ {
+ { \dim_eval:n #3 + \box_wd:N #1 } {#4}
+ {#5} {#6}
+ }
+ }
+\cs_new_nopar:Npn \ior_map_break:
+ { \__prg_map_break:Nn \ior_map_break: { } }
+\cs_new_nopar:Npn \ior_map_break:n
+ { \__prg_map_break:Nn \ior_map_break: }
+\cs_new_protected_nopar:Npn \ior_map_inline:Nn
+ { \__ior_map_inline:NNn \ior_get:NN }
+\cs_new_protected_nopar:Npn \ior_str_map_inline:Nn
+ { \__ior_map_inline:NNn \ior_get_str:NN }
+\cs_new_protected_nopar:Npn \__ior_map_inline:NNn
+ {
+ \int_gincr:N \g__prg_map_int
+ \exp_args:Nc \__ior_map_inline:NNNn
+ { __prg_map_ \int_use:N \g__prg_map_int :n }
+ }
+\cs_new_protected:Npn \__ior_map_inline:NNNn #1#2#3#4
+ {
+ \cs_set:Npn #1 ##1 {#4}
+ \ior_if_eof:NF #3 { \__ior_map_inline_loop:NNN #1#2#3 }
+ \__prg_break_point:Nn \ior_map_break:
+ { \int_gdecr:N \g__prg_map_int }
+ }
+\cs_new_protected:Npn \__ior_map_inline_loop:NNN #1#2#3
+ {
+ #2 #3 \l__ior_internal_tl
+ \ior_if_eof:NF #3
+ {
+ \exp_args:No #1 \l__ior_internal_tl
+ \__ior_map_inline_loop:NNN #1#2#3
+ }
+ }
+\tl_new:N \l__ior_internal_tl
+\cs_new_protected:Npn \fp_set_from_dim:Nn #1#2
+ { \tl_set:Nx #1 { \dim_to_fp:n {#2} } }
+\cs_new_protected:Npn \fp_gset_from_dim:Nn #1#2
+ { \tl_gset:Nx #1 { \dim_to_fp:n {#2} } }
+\cs_generate_variant:Nn \fp_set_from_dim:Nn { c }
+\cs_generate_variant:Nn \fp_gset_from_dim:Nn { c }
+\cs_new:Npn \prop_map_tokens:Nn #1#2
+ {
+ \exp_last_unbraced:Nno \__prop_map_tokens:nwwn {#2} #1
+ \__prop_pair:wn \q_recursion_tail \s__prop { }
+ \__prg_break_point:Nn \prop_map_break: { }
+ }
+\cs_new:Npn \__prop_map_tokens:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
+ {
+ \if_meaning:w \q_recursion_tail #3
+ \exp_after:wN \prop_map_break:
+ \fi:
+ \use:n {#1} {#3} {#4}
+ \__prop_map_tokens:nwwn {#1}
+ }
+\cs_generate_variant:Nn \prop_map_tokens:Nn { c }
+\cs_new:Npn \prop_get:Nn #1#2
+ {
+ \exp_last_unbraced:Noo \__prop_get_Nn:nwwn { \tl_to_str:n {#2} } #1
+ \__prop_pair:wn \tl_to_str:n {#2} \s__prop { }
+ \__prg_break_point:
+ }
+\cs_new:Npn \__prop_get_Nn:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
+ {
+ \str_if_eq_x:nnTF {#1} {#3}
+ { \__prg_break:n { \exp_not:n {#4} } }
+ { \__prop_get_Nn:nwwn {#1} }
+ }
+\cs_generate_variant:Nn \prop_get:Nn { c }
+\cs_new:Npn \seq_item:Nn #1
+ { \exp_after:wN \__seq_item:wNn #1 \q_stop #1 }
+\cs_new:Npn \__seq_item:wNn \s__seq #1 \q_stop #2#3
+ {
+ \exp_args:Nf \__seq_item:nnn
+ {
+ \int_eval:n
+ {
+ \int_compare:nNnT {#3} < \c_zero
+ { \seq_count:N #2 + \c_one + }
+ #3
+ }
+ }
+ #1
+ { ? \__prg_break: } { }
+ \__prg_break_point:
+ }
+\cs_new:Npn \__seq_item:nnn #1#2#3
+ {
+ \use_none:n #2
+ \int_compare:nNnTF {#1} = \c_one
+ { \__prg_break:n { \exp_not:n {#3} } }
+ { \exp_args:Nf \__seq_item:nnn { \int_eval:n { #1 - 1 } } }
+ }
+\cs_generate_variant:Nn \seq_item:Nn { c }
+\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
+ { \exp_after:wN \__seq_mapthread_function:wNN #2 \q_stop #1 #3 }
+\cs_new:Npn \__seq_mapthread_function:wNN \s__seq #1 \q_stop #2#3
+ {
+ \exp_after:wN \__seq_mapthread_function:wNw #2 \q_stop #3
+ #1 { ? \__prg_break: } { }
+ \__prg_break_point:
+ }
+\cs_new:Npn \__seq_mapthread_function:wNw \s__seq #1 \q_stop #2
+ {
+ \__seq_mapthread_function:Nnnwnn #2
+ #1 { ? \__prg_break: } { }
+ \q_stop
+ }
+\cs_new:Npn \__seq_mapthread_function:Nnnwnn #1#2#3#4 \q_stop #5#6
+ {
+ \use_none:n #2
+ \use_none:n #5
+ #1 {#3} {#6}
+ \__seq_mapthread_function:Nnnwnn #1 #4 \q_stop
+ }
+\cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc }
+\cs_generate_variant:Nn \seq_mapthread_function:NNN { c , cc }
+\cs_new_protected:Npn \seq_set_from_clist:NN #1#2
+ {
+ \tl_set:Nx #1
+ { \s__seq \clist_map_function:NN #2 \__seq_wrap_item:n }
+ }
+\cs_new_protected:Npn \seq_set_from_clist:Nn #1#2
+ {
+ \tl_set:Nx #1
+ { \s__seq \clist_map_function:nN {#2} \__seq_wrap_item:n }
+ }
+\cs_new_protected:Npn \seq_gset_from_clist:NN #1#2
+ {
+ \tl_gset:Nx #1
+ { \s__seq \clist_map_function:NN #2 \__seq_wrap_item:n }
+ }
+\cs_new_protected:Npn \seq_gset_from_clist:Nn #1#2
+ {
+ \tl_gset:Nx #1
+ { \s__seq \clist_map_function:nN {#2} \__seq_wrap_item:n }
+ }
+\cs_generate_variant:Nn \seq_set_from_clist:NN { Nc }
+\cs_generate_variant:Nn \seq_set_from_clist:NN { c , cc }
+\cs_generate_variant:Nn \seq_set_from_clist:Nn { c }
+\cs_generate_variant:Nn \seq_gset_from_clist:NN { Nc }
+\cs_generate_variant:Nn \seq_gset_from_clist:NN { c , cc }
+\cs_generate_variant:Nn \seq_gset_from_clist:Nn { c }
+\cs_new_protected_nopar:Npn \seq_reverse:N
+ { \__seq_reverse:NN \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_greverse:N
+ { \__seq_reverse:NN \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_reverse:NN #1 #2
+ {
+ \cs_set_eq:NN \__seq_tmp:w \__seq_item:n
+ \cs_set_eq:NN \__seq_item:n \__seq_reverse_item:nwn
+ #1 #2 { #2 \exp_not:n { } }
+ \cs_set_eq:NN \__seq_item:n \__seq_tmp:w
+ }
+\cs_new:Npn \__seq_reverse_item:nwn #1 #2 \exp_not:n #3
+ {
+ #2
+ \exp_not:n { \__seq_item:n {#1} #3 }
+ }
+\cs_generate_variant:Nn \seq_reverse:N { c }
+\cs_generate_variant:Nn \seq_greverse:N { c }
+\cs_new_protected_nopar:Npn \seq_set_filter:NNn
+ { \__seq_set_filter:NNNn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gset_filter:NNn
+ { \__seq_set_filter:NNNn \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_set_filter:NNNn #1#2#3#4
+ {
+ \__seq_push_item_def:n { \bool_if:nT {#4} { \__seq_wrap_item:n {##1} } }
+ #1 #2 { #3 }
+ \__seq_pop_item_def:
+ }
+\cs_new_protected_nopar:Npn \seq_set_map:NNn
+ { \__seq_set_map:NNNn \tl_set:Nx }
+\cs_new_protected_nopar:Npn \seq_gset_map:NNn
+ { \__seq_set_map:NNNn \tl_gset:Nx }
+\cs_new_protected:Npn \__seq_set_map:NNNn #1#2#3#4
+ {
+ \__seq_push_item_def:n { \exp_not:N \__seq_item:n {#4} }
+ #1 #2 { #3 }
+ \__seq_pop_item_def:
+ }
+\cs_new_eq:NN \dim_to_pt:n \__dim_strip_pt:n
+\cs_new:Npn \dim_to_unit:nn #1#2
+ {
+ \dim_to_pt:n
+ {
+ 1pt * \__dim_to_unit:n { \dim_to_pt:n {#1} pt }
+ / \__dim_to_unit:n { \dim_to_pt:n {#2} pt }
+ }
+ }
+\cs_new:Npn \__dim_to_unit:n #1
+ { \__int_value:w \__dim_eval:w #1 \__dim_eval_end: }
+\cs_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4
+ {
+ \skip_if_finite:nTF {#1}
+ {
+ #3 = \etex_gluestretch:D #1 \scan_stop:
+ #4 = \etex_glueshrink:D #1 \scan_stop:
+ }
+ {
+ #3 = \c_zero_skip
+ #4 = \c_zero_skip
+ #2
+ }
+ }
+\prg_new_conditional:Npnn \tl_if_single_token:n #1 { p , T , F , TF }
+ {
+ \tl_if_head_is_N_type:nTF {#1}
+ { \__str_if_eq_x_return:nn { \exp_not:o { \use_none:n #1 } } { } }
+ { \__str_if_eq_x_return:nn { \exp_not:n {#1} } { ~ } }
+ }
+\cs_new:Npn \tl_reverse_tokens:n #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ {
+ \tex_romannumeral:D
+ \__tl_act:NNNnn
+ \__tl_reverse_normal:nN
+ \__tl_reverse_group:nn
+ \__tl_reverse_space:n
+ { }
+ {#1}
+ }
+ }
+\cs_new:Npn \__tl_reverse_group:nn #1
+ {
+ \__tl_act_group_recurse:Nnn
+ \__tl_act_reverse_output:n
+ { \tl_reverse_tokens:n }
+ }
+\cs_new:Npn \__tl_act_group_recurse:Nnn #1#2#3
+ {
+ \exp_args:Nf #1
+ { \exp_after:wN \exp_after:wN \exp_after:wN { #2 {#3} } }
+ }
+\cs_new:Npn \tl_count_tokens:n #1
+ {
+ \int_eval:n
+ {
+ \__tl_act:NNNnn
+ \__tl_act_count_normal:nN
+ \__tl_act_count_group:nn
+ \__tl_act_count_space:n
+ { }
+ {#1}
+ }
+ }
+\cs_new:Npn \__tl_act_count_normal:nN #1 #2 { 1 + }
+\cs_new:Npn \__tl_act_count_space:n #1 { 1 + }
+\cs_new:Npn \__tl_act_count_group:nn #1 #2
+ { 2 + \tl_count_tokens:n {#2} + }
+\tl_const:Nn \c__tl_act_uppercase_tl
+ {
+ aA bB cC dD eE fF gG hH iI jJ kK lL mM
+ nN oO pP qQ rR sS tT uU vV wW xX yY zZ
+ }
+\tl_const:Nn \c__tl_act_lowercase_tl
+ {
+ Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm
+ Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz
+ }
+\cs_new:Npn \tl_expandable_uppercase:n #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ {
+ \tex_romannumeral:D
+ \__tl_act_case_aux:nn { \c__tl_act_uppercase_tl } {#1}
+ }
+ }
+\cs_new:Npn \tl_expandable_lowercase:n #1
+ {
+ \etex_unexpanded:D \exp_after:wN
+ {
+ \tex_romannumeral:D
+ \__tl_act_case_aux:nn { \c__tl_act_lowercase_tl } {#1}
+ }
+ }
+\cs_new:Npn \__tl_act_case_aux:nn
+ {
+ \__tl_act:NNNnn
+ \__tl_act_case_normal:nN
+ \__tl_act_case_group:nn
+ \__tl_act_case_space:n
+ }
+\cs_new:Npn \__tl_act_case_space:n #1 { \__tl_act_output:n {~} }
+\cs_new:Npn \__tl_act_case_normal:nN #1 #2
+ {
+ \exp_args:Nf \__tl_act_output:n
+ {
+ \exp_args:NNo \str_case:nnF #2 {#1}
+ { \exp_stop_f: #2 }
+ }
+ }
+\cs_new:Npn \__tl_act_case_group:nn #1 #2
+ {
+ \exp_after:wN \__tl_act_output:n \exp_after:wN
+ { \exp_after:wN { \tex_romannumeral:D \__tl_act_case_aux:nn {#1} {#2} } }
+ }
+\cs_new:Npn \tl_item:nn #1#2
+ {
+ \exp_args:Nf \__tl_item:nn
+ {
+ \int_eval:n
+ {
+ \int_compare:nNnT {#2} < \c_zero
+ { \tl_count:n {#1} + \c_one + }
+ #2
+ }
+ }
+ #1
+ \q_recursion_tail
+ \__prg_break_point:
+ }
+\cs_new:Npn \__tl_item:nn #1#2
+ {
+ \__quark_if_recursion_tail_break:nN {#2} \__prg_break:
+ \int_compare:nNnTF {#1} = \c_one
+ { \__prg_break:n { \exp_not:n {#2} } }
+ { \exp_args:Nf \__tl_item:nn { \int_eval:n { #1 - 1 } } }
+ }
+\cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn }
+\cs_generate_variant:Nn \tl_item:Nn { c }
+\group_begin:
+ \char_set_catcode_active:N \^^@
+ \cs_set:Npn \char_tmp:NN #1#2
+ {
+ \cs_new:Npn #1 ##1
+ {
+ \char_set_catcode_active:n { `##1 }
+ \group_begin:
+ \char_set_lccode:nn { `\^^@ } { `##1 }
+ \tl_to_lowercase:n { \group_end: #2 ^^@ }
+ }
+ }
+ \char_tmp:NN \char_set_active:Npn \cs_set:Npn
+ \char_tmp:NN \char_set_active:Npx \cs_set:Npx
+ \char_tmp:NN \char_gset_active:Npn \cs_gset:Npn
+ \char_tmp:NN \char_gset_active:Npx \cs_gset:Npx
+ \char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN
+ \char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN
+\group_end:
+\group_begin:
+ \char_set_catcode_other:N \O
+ \char_set_catcode_other:N \U
+ \char_set_catcode_other:N \T
+ \char_set_catcode_other:N \E
+ \char_set_catcode_other:N \R
+ \tl_to_lowercase:n
+ {
+ \cs_new_protected_nopar:Npn \__peek_execute_branches_N_type:
+ {
+ \if_int_odd:w
+ \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi:
+ \if_catcode:w \exp_not:N \l_peek_token } \c_two \fi:
+ \if_meaning:w \l_peek_token \c_space_token \c_two \fi:
+ \c_one
+ \exp_after:wN \__peek_N_type:w
+ \token_to_meaning:N \l_peek_token
+ \q_mark \__peek_N_type_aux:nnw
+ OUTER \q_mark \use_none_delimit_by_q_stop:w
+ \q_stop
+ \exp_after:wN \__peek_true:w
+ \else:
+ \exp_after:wN \__peek_false:w
+ \fi:
+ }
+ \cs_new_protected:Npn \__peek_N_type:w #1 OUTER #2 \q_mark #3
+ { #3 {#1} {#2} }
+ }
+\group_end:
+\cs_new_protected:Npn \__peek_N_type_aux:nnw #1 #2 #3 \fi:
+ {
+ \fi:
+ \tl_if_in:noTF {#1} { \tl_to_str:n {ma} }
+ { \__peek_true:w }
+ { \tl_if_empty:nTF {#2} { \__peek_true:w } { \__peek_false:w } }
+ }
+\cs_new_protected_nopar:Npn \peek_N_type:TF
+ { \__peek_token_generic:NNTF \__peek_execute_branches_N_type: \scan_stop: }
+\cs_new_protected_nopar:Npn \peek_N_type:T
+ { \__peek_token_generic:NNT \__peek_execute_branches_N_type: \scan_stop: }
+\cs_new_protected_nopar:Npn \peek_N_type:F
+ { \__peek_token_generic:NNF \__peek_execute_branches_N_type: \scan_stop: }
+%%
+%%
+%% End of file `expl3-code.tex'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex
new file mode 100644
index 00000000000..02cf3ce2e1e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex
@@ -0,0 +1,122 @@
+%%
+%% This is file `expl3-generic.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% expl3.dtx (with options: `generic,loader')
+%%
+%% EXPERIMENTAL CODE
+%%
+%% Do not distribute this file without also distributing the
+%% source files specified above.
+%%
+%% Do not distribute a modified version of this file.
+%%
+%% File: expl3.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% The released version of this bundle is available from CTAN.
+%%
+%% -----------------------------------------------------------------------
+%%
+%% The development version of the bundle can be found at
+%%
+%% http://www.latex-project.org/svnroot/experimental/trunk/
+%%
+%% for those people who are interested.
+%%
+%%%%%%%%%%%
+%% NOTE: %%
+%%%%%%%%%%%
+%%
+%% Snapshots taken from the repository represent work in progress and may
+%% not work or may contain conflicting material! We therefore ask
+%% people _not_ to put them into distributions, archives, etc. without
+%% prior consultation with the LaTeX3 Project.
+%%
+%% -----------------------------------------------------------------------
+\def\ExplFileName{expl3}
+\def\ExplFileDescription{L3 programming layer}
+\def\ExplFileDate{2014/05/05}
+\def\ExplFileVersion{4742}
+\let\ExplLoaderFileVersion\ExplFileVersion
+\begingroup
+ \def\tempa{LaTeX2e}
+ \def\next{}
+ \ifx\fmtname\tempa
+ \def\next
+ {%
+ \PackageInfo{expl3}{Switching from generic to LaTeX2e loader}
+ \endinput \RequirePackage{expl3}
+ }
+ \fi
+\expandafter\endgroup
+\next
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname ver@\ExplFileName -generic.tex\endcsname\relax
+\else
+ \immediate\write-1
+ {%
+ Package \ExplFileName\space Info: The package is already loaded.
+ }%
+ \expandafter\endinput
+\fi
+\immediate\write-1
+ {%
+ Package: \ExplFileName\space
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space (loader)
+ }
+\expandafter\edef\csname ver@\ExplFileName -generic.tex\endcsname
+ {\ExplFileDate\space v\ExplFileVersion\space \ExplFileDescription}
+\input ifpdf.sty %
+\expandafter\edef\csname l@expl@tidy@tl\endcsname
+ {%
+ \catcode64=\the\catcode64\relax
+ \let\expandafter\noexpand\csname l@expl@tidy@tl\endcsname
+ \noexpand\undefined
+ }
+\catcode64=11 %
+\chardef \l@expl@check@declarations@bool = 0 %
+\chardef \l@expl@log@functions@bool = 0 %
+\let\expl@AtBeginDocument\AtBeginDocument
+\def\AtBeginDocument#1{}
+\expandafter\def\expandafter\l@expl@tidy@tl\expandafter
+ {%
+ \l@expl@tidy@tl
+ \let\AtBeginDocument\expl@AtBeginDocument
+ \let\expl@AtBeginDocument\undefined
+ }
+\input expl3-code.tex %
+\cs_set_eq:NN \__iow_wrap_set:Nx \tl_set:Nx
+\protected\def\GetIdInfoLog{}
+\cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ { \iow_log:n { File:~#1~#2~v#3~#4 } }
+\tex_input:D
+ l3
+ \xetex_if_engine:TF
+ { xdvipdfmx }
+ {
+ \ifpdf
+ pdfmode
+ \else
+ dvips
+ \fi
+ }
+ .def \scan_stop:
+\cs_undefine:N \ProvidesExplFile
+\ExplSyntaxOff
+\l@expl@tidy@tl
+%%
+%%
+%% End of file `expl3-generic.tex'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty
index dd27359ed69..1f9b7d2eaad 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% expl3.dtx (with options: `package')
+%% expl3.dtx (with options: `package,loader')
%%
%% EXPERIMENTAL CODE
%%
@@ -45,196 +45,63 @@
%% prior consultation with the LaTeX3 Project.
%%
%% -----------------------------------------------------------------------
-\RequirePackage{l3names}[2012/12/07]
-\@ifpackagelater{l3names}{2012/12/07}
- {}
- {%
- \PackageError{expl3}{Mismatched LaTeX3 packages detected.}
- {%
- Please install an up to date version of l3kernel
- using your TeX package manager or from CTAN.%
- \MessageBreak \MessageBreak
- Loading expl3 will abort!%
- }%
- \endinput
- }
\def\ExplFileName{expl3}
-\def\ExplFileDescription{L3 Experimental code bundle wrapper}
-\def\ExplFileDate{2014/01/07}
-\def\ExplFileVersion{4646}
-\RequirePackage{etex}
-\relax
-\reserveinserts{32}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\newcommand \expl@create@bool@option [ 2 ]
- {
- \DeclareOption {#1} { \renewcommand* #2 { 1 } }
- \DeclareOption { #1 = true } { \renewcommand* #2 { 1 } }
- \DeclareOption { #1 = false } { \renewcommand* #2 { 0 } }
- \newcommand* #2 { 0 }
+\def\ExplFileDescription{L3 programming layer}
+\def\ExplFileDate{2014/05/05}
+\def\ExplFileVersion{4742}
+\let\ExplLoaderFileVersion\ExplFileVersion
+\ProvidesPackage{\ExplFileName}
+ [%
+ \ExplFileDate\space v\ExplFileVersion\space
+ \ExplFileDescription\space (loader)
+ ]
+\RequirePackage{ifpdf}
+\newcommand\expl@create@bool@option[2]%
+ {%
+ \DeclareOption{#1}{\chardef #2=1 }%
+ \DeclareOption{#1=true}{\chardef #2=1 }%
+ \DeclareOption{#1=false}{\chardef #2=0 }%
+ \newcommand*#2{}%
+ \chardef #2=0 %
}
-\expl@create@bool@option { check-declarations } \l@expl@check@declarations@bool
-\expl@create@bool@option { log-functions } \l@expl@log@functions@bool
-\let \expl@create@bool@option \@undefined
-\newcommand* \l@expl@options@clist { }
+\expl@create@bool@option{check-declarations}\l@expl@check@declarations@bool
+\expl@create@bool@option{log-functions}\l@expl@log@functions@bool
+\let\expl@create@bool@option\@undefined
+\newcommand*\l@expl@options@clist{}
\DeclareOption*
- {
- \ifx \l@expl@options@clist \@empty
- \let \l@expl@options@clist \CurrentOption
+ {%
+ \ifx\l@expl@options@clist\@empty
+ \let\l@expl@options@clist\CurrentOption
\else
- \edef \l@expl@options@clist
- {
- \unexpanded \expandafter \expandafter \expandafter
- {
- \expandafter \l@expl@options@clist \expandafter , \CurrentOption
- }
- }
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\l@expl@options@clist
+ \expandafter\expandafter\expandafter
+ {\expandafter\l@expl@options@clist\expandafter,\CurrentOption}
\fi
}
-\ProcessOptions \relax
-\RequirePackage { l3basics, l3expan, l3tl }
-\ifodd \l@expl@check@declarations@bool \relax
- \cs_new_protected:Npn \__cs_check_exists:N #1
- {
- \cs_if_exist:NF #1
- {
- \__msg_kernel_error:nnx { check } { non-declared-variable }
- { \token_to_str:N #1 }
- }
- }
- \cs_set_protected:Npn \__cs_tmp:w #1
- {
- \if_meaning:w ? #1
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \use:x
- {
- \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 }
- {
- \__cs_check_exists:N \exp_not:n {##1}
- \exp_not:o { #1 {##1} {##2} }
- }
- }
- \__cs_tmp:w
- }
- \__cs_tmp:w
- \tl_set:Nn \tl_set:No \tl_set:Nx
- \tl_gset:Nn \tl_gset:No \tl_gset:Nx
- \tl_put_left:Nn \tl_put_left:NV
- \tl_put_left:No \tl_put_left:Nx
- \tl_gput_left:Nn \tl_gput_left:NV
- \tl_gput_left:No \tl_gput_left:Nx
- \tl_put_right:Nn \tl_put_right:NV
- \tl_put_right:No \tl_put_right:Nx
- \tl_gput_right:Nn \tl_gput_right:NV
- \tl_gput_right:No \tl_gput_right:Nx
- ? \q_recursion_stop
- \cs_set_protected:Npn \tl_set_eq:NN #1#2
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \cs_set_eq:NN #1 #2
- }
- \cs_set_protected:Npn \tl_gset_eq:NN #1#2
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \cs_gset_eq:NN #1 #2
- }
- \cs_set_protected:Npn \tl_concat:NNN #1#2#3
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \__cs_check_exists:N #3
- \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
- }
- \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3
- {
- \__cs_check_exists:N #1
- \__cs_check_exists:N #2
- \__cs_check_exists:N #3
- \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} }
- }
-\fi
-\RequirePackage { l3seq, l3int, l3quark, l3prg }
-\ifodd \l@expl@check@declarations@bool \relax
- \cs_set_protected:Npn \bool_set_true:N #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1 \c_true_bool
- }
- \cs_set_protected:Npn \bool_set_false:N #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1 \c_false_bool
- }
- \cs_set_protected:Npn \bool_gset_true:N #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1 \c_true_bool
- }
- \cs_set_protected:Npn \bool_gset_false:N #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1 \c_false_bool
- }
- \cs_set_protected:Npn \bool_set_eq:NN #1
- {
- \__cs_check_exists:N #1
- \cs_set_eq:NN #1
- }
- \cs_set_protected:Npn \bool_gset_eq:NN #1
- {
- \__cs_check_exists:N #1
- \cs_gset_eq:NN #1
- }
- \cs_set_protected:Npn \bool_set:Nn #1#2
- {
- \__cs_check_exists:N #1
- \tex_chardef:D #1 = \bool_if_p:n {#2}
- }
- \cs_set_protected:Npn \bool_gset:Nn #1#2
- {
- \__cs_check_exists:N #1
- \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2}
- }
-\fi
-\RequirePackage
- {
- l3clist,
- l3token,
- l3prop,
- l3msg,
- l3file,
- l3skip,
- l3keys,
- l3fp,
- l3box,
- l3coffins,
- l3color,
- l3luatex,
- l3candidates
+\ProcessOptions\relax
+\protected\def\ProvidesExplPackage#1#2#3#4%
+ {%
+ \ProvidesPackage{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
}
-\bool_if:nT { \l@expl@check@declarations@bool }
- {
- \__msg_kernel_new:nnnn { check } { non-declared-variable }
- { The~variable~#1~has~not~been~declared~\msg_line_context:. }
- {
- Checking~is~active,~and~you~have~tried~do~so~something~like: \\
- \ \ \tl_set:Nn ~ #1 ~ \{ ~ ... ~ \} \\
- without~first~having: \\
- \ \ \tl_new:N ~ #1 \\
- \\
- LaTeX~will~create~the~variable~and~continue.
- }
+\protected\def\ProvidesExplClass#1#2#3#4%
+ {%
+ \ProvidesClass{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
+ }
+\protected\def\ProvidesExplFile#1#2#3#4%
+ {%
+ \ProvidesFile{#1}[#2 v#3 #4]%
+ \ExplSyntaxOn
}
+\input{expl3-code.tex}
+\protected\def\GetIdInfoLog{}
\AtBeginDocument
{
\cs_if_exist:NF \color
{ \DeclareRobustCommand \color [2] [ ] { } }
}
-\RequirePackage{ifpdf}
\__msg_kernel_new:nnnn { expl } { wrong-driver }
{ Driver~request~inconsistent~with~engine:~using~'#2'~driver. }
{
@@ -392,48 +259,41 @@
}
}
{
+ \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ { \ProvidesFile {#1} [ #2~v#3~#4 ] }
\tl_const:Nn \c__expl_def_ext_tl { def }
\@onefilewithoptions { l3 \l__expl_driver_tl } [ ] [ ] \c__expl_def_ext_tl
+ \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4
+ {
+ \ProvidesFile {#1} [ #2~v#3~#4 ]
+ \ExplSyntaxOn
+ }
}
-\cs_set_protected_nopar:Npn \ExplSyntaxOn
+\tl_put_left:Nn \@pushfilename
{
- \bool_if:NF \l__kernel_expl_bool
+ \tl_put_left:Nx \l__expl_status_stack_tl
{
- \cs_set_protected_nopar:Npx \ExplSyntaxOff
- {
- \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } }
- \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } }
- \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } }
- \char_set_catcode:nn { 36 } { \char_value_catcode:n { 36 } }
- \char_set_catcode:nn { 38 } { \char_value_catcode:n { 38 } }
- \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } }
- \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } }
- \char_set_catcode:nn { 95 } { \char_value_catcode:n { 95 } }
- \char_set_catcode:nn { 124 } { \char_value_catcode:n { 124 } }
- \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } }
- \tex_endlinechar:D = \tex_the:D \tex_endlinechar:D \scan_stop:
- \bool_set_false:N \l__kernel_expl_bool
- \cs_set_protected_nopar:Npn \ExplSyntaxOff { }
- }
+ \bool_if:NTF \l__kernel_expl_bool
+ { 1 }
+ { 0 }
}
- \char_set_catcode_ignore:n { 9 } % tab
- \char_set_catcode_ignore:n { 32 } % space
- \char_set_catcode_other:n { 34 } % double quote
- \char_set_catcode_math_toggle:n { 36 } % dollar
- \char_set_catcode_alignment:n { 38 } % ampersand
- \char_set_catcode_letter:n { 58 } % colon
- \char_set_catcode_math_superscript:n { 94 } % circumflex
- \char_set_catcode_letter:n { 95 } % underscore
- \char_set_catcode_other:n { 124 } % pipe
- \char_set_catcode_space:n { 126 } % tilde
- \tex_endlinechar:D = 32 \scan_stop:
- \bool_set_true:N \l__kernel_expl_bool
+ \ExplSyntaxOff
+ }
+\tl_put_right:Nn \@popfilename
+ {
+ \tl_if_empty:NTF \l__expl_status_stack_tl
+ { \ExplSyntaxOff }
+ { \exp_after:wN \__expl_status_pop:w \l__expl_status_stack_tl \q_stop }
}
-\cs_set_protected_nopar:Npx \ExplSyntaxOff
+\cs_new_protected:Npn \__expl_status_pop:w #1#2 \q_stop
{
- \exp_not:o \ExplSyntaxOff
- \cs_set_protected_nopar:Npn \ExplSyntaxOff { }
+ \tl_set:Nn \l__expl_status_stack_tl {#2}
+ \int_if_odd:nTF {#1}
+ { \ExplSyntaxOn }
+ { \ExplSyntaxOff }
}
+\tl_new:N \l__expl_status_stack_tl
+\tl_set:Nn \l__expl_status_stack_tl { 0 }
%%
%%
%% End of file `expl3.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
deleted file mode 100644
index 7835917a66b..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
+++ /dev/null
@@ -1,887 +0,0 @@
-%%
-%% This is file `l3basics.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3basics.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3basics.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3basics.dtx 4642 2014-01-04 17:28:32Z joseph $
- {L3 Basic definitions}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\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 \etex_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_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_let:D \if_cs_exist:N \etex_ifdefined:D
-\tex_let:D \if_cs_exist:w \etex_ifcsname:D
-\tex_let:D \cs:w \tex_csname:D
-\tex_let:D \cs_end: \tex_endcsname:D
-\tex_let:D \exp_after:wN \tex_expandafter:D
-\tex_let:D \exp_not:N \tex_noexpand:D
-\tex_let:D \exp_not:n \etex_unexpanded:D
-\tex_let:D \token_to_meaning:N \tex_meaning:D
-\tex_let:D \token_to_str:N \tex_string:D
-\tex_let:D \cs_meaning:N \tex_meaning:D
-\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_let:D \if_int_compare:w \tex_ifnum:D
-\tex_let:D \__int_to_roman:w \tex_romannumeral:D
-\tex_let:D \group_insert_after:N \tex_aftergroup:D
-\tex_long:D \tex_def: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
- { \cs:w #1 \exp_after:wN \cs_end: \cs:w #2 \cs_end: }
-\tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
-\tex_long:D \tex_def:D \cs_meaning:c #1
- {
- \if_cs_exist:w #1 \cs_end:
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- { \exp_args:Nc \cs_meaning:N {#1} }
- { \tl_to_str:n {undefined} }
- }
-\tex_let:D \token_to_meaning:c = \cs_meaning:c
-\tex_let:D \c_minus_one \m@ne
-\tex_chardef:D \c_sixteen = 16 ~
-\tex_chardef:D \c_zero = 0 ~
-\tex_chardef:D \c_six = 6 ~
-\tex_chardef:D \c_seven = 7 ~
-\tex_chardef:D \c_twelve = 12 ~
-\etex_ifdefined:D \luatex_luatexversion:D
- \tex_chardef:D \c_max_register_int = 65 535 ~
-\tex_else:D
- \tex_mathchardef:D \c_max_register_int = 32 767 ~
-\tex_fi:D
-\tex_let:D \cs_set_nopar:Npn \tex_def:D
-\tex_let:D \cs_set_nopar:Npx \tex_edef:D
-\etex_protected:D \cs_set_nopar:Npn \cs_set:Npn
- { \tex_long:D \cs_set_nopar:Npn }
-\etex_protected:D \cs_set_nopar:Npn \cs_set:Npx
- { \tex_long:D \cs_set_nopar:Npx }
-\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npn
- { \etex_protected:D \cs_set_nopar:Npn }
-\etex_protected:D \cs_set_nopar:Npn \cs_set_protected_nopar:Npx
- { \etex_protected:D \cs_set_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_set_protected:Npn
- { \etex_protected:D \tex_long:D \cs_set_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_set_protected:Npx
- { \etex_protected:D \tex_long:D \cs_set_nopar:Npx }
-\tex_let:D \cs_gset_nopar:Npn \tex_gdef:D
-\tex_let:D \cs_gset_nopar:Npx \tex_xdef:D
-\cs_set_protected_nopar:Npn \cs_gset:Npn
- { \tex_long:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset:Npx
- { \tex_long:D \cs_gset_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npn
- { \etex_protected:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset_protected_nopar:Npx
- { \etex_protected:D \cs_gset_nopar:Npx }
-\cs_set_protected_nopar:Npn \cs_gset_protected:Npn
- { \etex_protected:D \tex_long:D \cs_gset_nopar:Npn }
-\cs_set_protected_nopar:Npn \cs_gset_protected:Npx
- { \etex_protected:D \tex_long:D \cs_gset_nopar:Npx }
-\cs_set_nopar:Npn \l__exp_internal_tl { }
-\cs_set:Npn \use:c #1 { \cs:w #1 \cs_end: }
-\cs_set_protected:Npn \use:x #1
- {
- \cs_set_nopar:Npx \l__exp_internal_tl {#1}
- \l__exp_internal_tl
- }
-\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_set:Npn \use_i:nn #1#2 {#1}
-\cs_set:Npn \use_ii:nn #1#2 {#2}
-\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_ii:nnn #1#2#3 {#1#2}
-\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_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_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 #1#2 \q_recursion_stop {#1}
-\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_set_nopar:Npn \prg_return_true:
- { \exp_after:wN \use_i:nn \__int_to_roman:w }
-\cs_set_nopar:Npn \prg_return_false:
- { \exp_after:wN \use_ii:nn \__int_to_roman:w}
-\cs_set_protected_nopar:Npn \prg_set_conditional:Npnn
- { \__prg_generate_conditional_parm:nnNpnn { set } { } }
-\cs_set_protected_nopar:Npn \prg_new_conditional:Npnn
- { \__prg_generate_conditional_parm:nnNpnn { new } { } }
-\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Npnn
- { \__prg_generate_conditional_parm:nnNpnn { set } { _protected } }
-\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Npnn
- { \__prg_generate_conditional_parm:nnNpnn { new } { _protected } }
-\cs_set_protected:Npn \__prg_generate_conditional_parm:nnNpnn #1#2#3#4#
- {
- \__cs_split_function:NN #3 \__prg_generate_conditional:nnNnnnnn
- {#1} {#2} {#4}
- }
-\cs_set_protected_nopar:Npn \prg_set_conditional:Nnn
- { \__prg_generate_conditional_count:nnNnn { set } { } }
-\cs_set_protected_nopar:Npn \prg_new_conditional:Nnn
- { \__prg_generate_conditional_count:nnNnn { new } { } }
-\cs_set_protected_nopar:Npn \prg_set_protected_conditional:Nnn
- { \__prg_generate_conditional_count:nnNnn { set } { _protected } }
-\cs_set_protected_nopar:Npn \prg_new_protected_conditional:Nnn
- { \__prg_generate_conditional_count:nnNnn { new } { _protected } }
-\cs_set_protected:Npn \__prg_generate_conditional_count:nnNnn #1#2#3
- {
- \__cs_split_function:NN #3 \__prg_generate_conditional_count:nnNnnnn
- {#1} {#2}
- }
-\cs_set_protected:Npn \__prg_generate_conditional_count:nnNnnnn #1#2#3#4#5
- {
- \__cs_parm_from_arg_count:nnF
- { \__prg_generate_conditional:nnNnnnnn {#1} {#2} #3 {#4} {#5} }
- { \tl_count:n {#2} }
- {
- \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments }
- { \token_to_str:c { #1 : #2 } }
- { \tl_count:n {#2} }
- \use_none:nn
- }
- }
-\cs_set_protected:Npn \__prg_generate_conditional:nnNnnnnn #1#2#3#4#5#6#7#8
- {
- \if_meaning:w \c_false_bool #3
- \__msg_kernel_error:nnx { kernel } { missing-colon }
- { \token_to_str:c {#1} }
- \exp_after:wN \use_none:nn
- \fi:
- \use:x
- {
- \exp_not:N \__prg_generate_conditional:nnnnnnw
- \exp_not:n { {#4} {#5} {#1} {#2} {#6} {#8} }
- \etex_detokenize:D {#7}
- \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
- }
- }
-\cs_set_protected:Npn \__prg_generate_conditional:nnnnnnw #1#2#3#4#5#6#7 ,
- {
- \if_meaning:w \q_recursion_tail #7
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \use:c { __prg_generate_ #7 _form:wnnnnnn }
- \tl_if_empty:nF {#7}
- {
- \__msg_kernel_error:nnxx
- { kernel } { conditional-form-unknown }
- {#7} { \token_to_str:c { #3 : #4 } }
- }
- \use_none:nnnnnnn
- \q_stop
- {#1} {#2} {#3} {#4} {#5} {#6}
- \__prg_generate_conditional:nnnnnnw {#1} {#2} {#3} {#4} {#5} {#6}
- }
-\cs_set_protected:Npn \__prg_generate_p_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
- {
- \if_meaning:w \scan_stop: #3 \scan_stop:
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- {
- \exp_args:cc { cs_ #2 #3 :Npn } { #4 _p: #5 } #6
- { #7 \c_zero \c_true_bool \c_false_bool }
- }
- {
- \__msg_kernel_error:nnx { kernel } { protected-predicate }
- { \token_to_str:c { #4 _p: #5 } }
- }
- }
-\cs_set_protected:Npn \__prg_generate_T_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
- {
- \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 T } #6
- { #7 \c_zero \use:n \use_none:n }
- }
-\cs_set_protected:Npn \__prg_generate_F_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
- {
- \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 F } #6
- { #7 \c_zero { } }
- }
-\cs_set_protected:Npn \__prg_generate_TF_form:wnnnnnn #1 \q_stop #2#3#4#5#6#7
- {
- \exp_args:cc { cs_ #2 #3 :Npn } { #4 : #5 TF } #6
- { #7 \c_zero }
- }
-\cs_set_protected_nopar:Npn \prg_set_eq_conditional:NNn
- { \__prg_set_eq_conditional:NNNn \cs_set_eq:cc }
-\cs_set_protected_nopar:Npn \prg_new_eq_conditional:NNn
- { \__prg_set_eq_conditional:NNNn \cs_new_eq:cc }
-\cs_set_protected:Npn \__prg_set_eq_conditional:NNNn #1#2#3#4
- {
- \use:x
- {
- \exp_not:N \__prg_set_eq_conditional:nnNnnNNw
- \__cs_split_function:NN #2 \prg_do_nothing:
- \__cs_split_function:NN #3 \prg_do_nothing:
- \exp_not:N #1
- \etex_detokenize:D {#4}
- \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
- }
- }
-\cs_set_protected:Npn \__prg_set_eq_conditional:nnNnnNNw #1#2#3#4#5#6
- {
- \if_meaning:w \c_false_bool #3
- \__msg_kernel_error:nnx { kernel } { missing-colon }
- { \token_to_str:c {#1} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \if_meaning:w \c_false_bool #6
- \__msg_kernel_error:nnx { kernel } { missing-colon }
- { \token_to_str:c {#4} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \__prg_set_eq_conditional_loop:nnnnNw {#1} {#2} {#4} {#5}
- }
-\cs_set_protected:Npn \__prg_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
- \fi:
- \use:c { __prg_set_eq_conditional_ #6 _form:wNnnnn }
- \tl_if_empty:nF {#6}
- {
- \__msg_kernel_error:nnxx
- { kernel } { conditional-form-unknown }
- {#6} { \token_to_str:c { #1 : #2 } }
- }
- \use_none:nnnnnn
- \q_stop
- #5 {#1} {#2} {#3} {#4}
- \__prg_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5
- }
-\cs_set:Npn \__prg_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6
- {
- \__chk_if_exist_cs:c { #5 _p : #6 }
- #2 { #3 _p : #4 } { #5 _p : #6 }
- }
-\cs_set:Npn \__prg_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6
- {
- \__chk_if_exist_cs:c { #5 : #6 TF }
- #2 { #3 : #4 TF } { #5 : #6 TF }
- }
-\cs_set:Npn \__prg_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6
- {
- \__chk_if_exist_cs:c { #5 : #6 T }
- #2 { #3 : #4 T } { #5 : #6 T }
- }
-\cs_set:Npn \__prg_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6
- {
- \__chk_if_exist_cs:c { #5 : #6 F }
- #2 { #3 : #4 F } { #5 : #6 F }
- }
-\tex_chardef:D \c_true_bool = 1 ~
-\tex_chardef:D \c_false_bool = 0 ~
-\cs_set_nopar:Npn \cs_to_str:N
- {
- \__int_to_roman:w
- \if:w \token_to_str:N \ \__cs_to_str:w \fi:
- \exp_after:wN \__cs_to_str:N \token_to_str:N
- }
-\cs_set:Npn \__cs_to_str:N #1 { \c_zero }
-\cs_set:Npn \__cs_to_str:w #1 \__cs_to_str:N
- { - \__int_value:w \fi: \exp_after:wN \c_zero }
-\group_begin:
-\tex_lccode:D `\@ = `\: \scan_stop:
-\tex_catcode:D `\@ = 12 ~
-\tex_lowercase:D
- {
- \group_end:
- \cs_set:Npn \__cs_split_function:NN #1
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__cs_split_function_auxi:w
- \cs_to_str:N #1 \q_mark \c_true_bool
- @ \q_mark \c_false_bool
- \q_stop
- }
- \cs_set:Npn \__cs_split_function_auxi:w #1 @ #2 \q_mark #3#4 \q_stop #5
- { \__cs_split_function_auxii:w #5 #1 \q_mark \q_stop {#2} #3 }
- \cs_set:Npn \__cs_split_function_auxii:w #1#2 \q_mark #3 \q_stop
- { #1 {#2} }
- }
-\cs_set:Npn \__cs_get_function_name:N #1
- { \__cs_split_function:NN #1 \use_i:nnn }
-\cs_set:Npn \__cs_get_function_signature:N #1
- { \__cs_split_function:NN #1 \use_ii:nnn }
-\prg_set_conditional:Npnn \cs_if_exist:N #1 { p , T , F , TF }
- {
- \if_meaning:w #1 \scan_stop:
- \prg_return_false:
- \else:
- \if_cs_exist:N #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- \fi:
- }
-\prg_set_conditional:Npnn \cs_if_exist:c #1 { p , T , F , TF }
- {
- \if_cs_exist:w #1 \cs_end:
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- {
- \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop:
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- }
- \prg_return_false:
- }
-\prg_set_conditional:Npnn \cs_if_free:N #1 { p , T , F , TF }
- {
- \if_meaning:w #1 \scan_stop:
- \prg_return_true:
- \else:
- \if_cs_exist:N #1
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- \fi:
- }
-\prg_set_conditional:Npnn \cs_if_free:c #1 { p , T , F , TF }
- {
- \if_cs_exist:w #1 \cs_end:
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- {
- \exp_after:wN \if_meaning:w \cs:w #1 \cs_end: \scan_stop:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
- { \prg_return_true: }
- }
-\cs_set: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_if_exist:NTF #1 { #1 } }
-\cs_set:Npn \cs_if_exist_use:NT #1 #2
- { \cs_if_exist:NTF #1 { #1 #2 } { } }
-\cs_set:Npn \cs_if_exist_use:N #1
- { \cs_if_exist:NTF #1 { #1 } { } }
-\cs_set:Npn \cs_if_exist_use:cTF #1#2
- { \cs_if_exist:cTF {#1} { \use:c {#1} #2 } }
-\cs_set:Npn \cs_if_exist_use:cF #1
- { \cs_if_exist:cTF {#1} { \use:c {#1} } }
-\cs_set:Npn \cs_if_exist_use:cT #1#2
- { \cs_if_exist:cTF {#1} { \use:c {#1} #2 } { } }
-\cs_set:Npn \cs_if_exist_use:c #1
- { \cs_if_exist:cTF {#1} { \use:c {#1} } { } }
-\cs_set_protected_nopar:Npn \iow_log:x
- { \tex_immediate:D \tex_write:D \c_minus_one }
-\cs_set_protected_nopar:Npn \iow_term:x
- { \tex_immediate:D \tex_write:D \c_sixteen }
-\cs_set_protected:Npn \__msg_kernel_error:nnxx #1#2#3#4
- {
- \tex_errmessage:D
- {
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!~! ^^J
- Argh,~internal~LaTeX3~error! ^^J ^^J
- Module ~ #1 , ~ message~name~"#2": ^^J
- Arguments~'#3'~and~'#4' ^^J ^^J
- This~is~one~for~The~LaTeX3~Project:~bailing~out
- }
- \tex_end:D
- }
-\cs_set_protected:Npn \__msg_kernel_error:nnx #1#2#3
- { \__msg_kernel_error:nnxx {#1} {#2} {#3} { } }
-\cs_set_protected:Npn \__msg_kernel_error:nn #1#2
- { \__msg_kernel_error:nnxx {#1} {#2} { } { } }
-\cs_set_nopar:Npn \msg_line_context:
- { on~line~ \tex_the:D \tex_inputlineno:D }
-\cs_set_protected:Npn \__chk_if_free_cs:N #1
- {
- \cs_if_free:NF #1
- {
- \__msg_kernel_error:nnxx { kernel } { command-already-defined }
- { \token_to_str:N #1 } { \token_to_meaning:N #1 }
- }
-}
-\tex_ifodd:D \l@expl@log@functions@bool
- \cs_set_protected:Npn \__chk_if_free_cs:N #1
- {
- \cs_if_free:NF #1
- {
- \__msg_kernel_error:nnxx { kernel } { command-already-defined }
- { \token_to_str:N #1 } { \token_to_meaning:N #1 }
- }
- \iow_log:x { Defining~\token_to_str:N #1~ \msg_line_context: }
- }
-\fi:
-\cs_set_protected_nopar:Npn \__chk_if_free_cs:c
- { \exp_args:Nc \__chk_if_free_cs:N }
-\cs_set_protected:Npn \__chk_if_exist_cs:N #1
- {
- \cs_if_exist:NF #1
- {
- \__msg_kernel_error:nnx { kernel } { command-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_set_protected_nopar:Npn \__chk_if_exist_cs:c
- { \exp_args:Nc \__chk_if_exist_cs:N }
-\cs_set:Npn \__cs_tmp:w #1#2
- {
- \cs_set_protected:Npn #1 ##1
- {
- \__chk_if_free_cs:N ##1
- #2 ##1
- }
- }
-\__cs_tmp:w \cs_new_nopar:Npn \cs_gset_nopar:Npn
-\__cs_tmp:w \cs_new_nopar:Npx \cs_gset_nopar:Npx
-\__cs_tmp:w \cs_new:Npn \cs_gset:Npn
-\__cs_tmp:w \cs_new:Npx \cs_gset:Npx
-\__cs_tmp:w \cs_new_protected_nopar:Npn \cs_gset_protected_nopar:Npn
-\__cs_tmp:w \cs_new_protected_nopar:Npx \cs_gset_protected_nopar:Npx
-\__cs_tmp:w \cs_new_protected:Npn \cs_gset_protected:Npn
-\__cs_tmp:w \cs_new_protected:Npx \cs_gset_protected:Npx
-\cs_set:Npn \__cs_tmp:w #1#2
- { \cs_new_protected_nopar:Npn #1 { \exp_args:Nc #2 } }
-\__cs_tmp:w \cs_set_nopar:cpn \cs_set_nopar:Npn
-\__cs_tmp:w \cs_set_nopar:cpx \cs_set_nopar:Npx
-\__cs_tmp:w \cs_gset_nopar:cpn \cs_gset_nopar:Npn
-\__cs_tmp:w \cs_gset_nopar:cpx \cs_gset_nopar:Npx
-\__cs_tmp:w \cs_new_nopar:cpn \cs_new_nopar:Npn
-\__cs_tmp:w \cs_new_nopar:cpx \cs_new_nopar:Npx
-\__cs_tmp:w \cs_set:cpn \cs_set:Npn
-\__cs_tmp:w \cs_set:cpx \cs_set:Npx
-\__cs_tmp:w \cs_gset:cpn \cs_gset:Npn
-\__cs_tmp:w \cs_gset:cpx \cs_gset:Npx
-\__cs_tmp:w \cs_new:cpn \cs_new:Npn
-\__cs_tmp:w \cs_new:cpx \cs_new:Npx
-\__cs_tmp:w \cs_set_protected_nopar:cpn \cs_set_protected_nopar:Npn
-\__cs_tmp:w \cs_set_protected_nopar:cpx \cs_set_protected_nopar:Npx
-\__cs_tmp:w \cs_gset_protected_nopar:cpn \cs_gset_protected_nopar:Npn
-\__cs_tmp:w \cs_gset_protected_nopar:cpx \cs_gset_protected_nopar:Npx
-\__cs_tmp:w \cs_new_protected_nopar:cpn \cs_new_protected_nopar:Npn
-\__cs_tmp:w \cs_new_protected_nopar:cpx \cs_new_protected_nopar:Npx
-\__cs_tmp:w \cs_set_protected:cpn \cs_set_protected:Npn
-\__cs_tmp:w \cs_set_protected:cpx \cs_set_protected:Npx
-\__cs_tmp:w \cs_gset_protected:cpn \cs_gset_protected:Npn
-\__cs_tmp:w \cs_gset_protected:cpx \cs_gset_protected:Npx
-\__cs_tmp:w \cs_new_protected:cpn \cs_new_protected:Npn
-\__cs_tmp:w \cs_new_protected:cpx \cs_new_protected:Npx
-\cs_new_protected:Npn \cs_set_eq:NN #1 { \tex_let:D #1 =~ }
-\cs_new_protected_nopar:Npn \cs_set_eq:cN { \exp_args:Nc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_set_eq:Nc { \exp_args:NNc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_set_eq:cc { \exp_args:Ncc \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:NN { \tex_global:D \cs_set_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN }
-\cs_new_protected_nopar:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN }
-\cs_new_protected:Npn \cs_new_eq:NN #1
- {
- \__chk_if_free_cs:N #1
- \tex_global:D \cs_set_eq:NN #1
- }
-\cs_new_protected_nopar:Npn \cs_new_eq:cN { \exp_args:Nc \cs_new_eq:NN }
-\cs_new_protected_nopar:Npn \cs_new_eq:Nc { \exp_args:NNc \cs_new_eq:NN }
-\cs_new_protected_nopar:Npn \cs_new_eq:cc { \exp_args:Ncc \cs_new_eq:NN }
-\cs_new_protected:Npn \cs_undefine:N #1
- { \cs_gset_eq:NN #1 \tex_undefined:D }
-\cs_new_protected:Npn \cs_undefine:c #1
- {
- \if_cs_exist:w #1 \cs_end:
- \exp_after:wN \use:n
- \else:
- \exp_after:wN \use_none:n
- \fi:
- { \cs_gset_eq:cN {#1} \tex_undefined:D }
- }
-\cs_set_protected:Npn \__cs_parm_from_arg_count:nnF #1#2
- {
- \exp_args:Nx \__cs_parm_from_arg_count_test:nnF
- {
- \exp_after:wN \exp_not:n
- \if_case:w \__int_eval:w #2 \__int_eval_end:
- { }
- \or: { ##1 }
- \or: { ##1##2 }
- \or: { ##1##2##3 }
- \or: { ##1##2##3##4 }
- \or: { ##1##2##3##4##5 }
- \or: { ##1##2##3##4##5##6 }
- \or: { ##1##2##3##4##5##6##7 }
- \or: { ##1##2##3##4##5##6##7##8 }
- \or: { ##1##2##3##4##5##6##7##8##9 }
- \else: { \c_false_bool }
- \fi:
- }
- {#1}
- }
-\cs_set_protected:Npn \__cs_parm_from_arg_count_test:nnF #1#2
- {
- \if_meaning:w \c_false_bool #1
- \exp_after:wN \use_ii:nn
- \else:
- \exp_after:wN \use_i:nn
- \fi:
- { #2 {#1} }
- }
-\cs_new:Npn \__cs_count_signature:N #1
- { \int_eval:n { \__cs_split_function:NN #1 \__cs_count_signature:nnN } }
-\cs_new:Npn \__cs_count_signature:nnN #1#2#3
- {
- \if_meaning:w \c_true_bool #3
- \tl_count:n {#2}
- \else:
- \c_minus_one
- \fi:
- }
-\cs_new_nopar:Npn \__cs_count_signature:c
- { \exp_args:Nc \__cs_count_signature:N }
-\cs_new_protected:Npn \cs_generate_from_arg_count:NNnn #1#2#3#4
- {
- \__cs_parm_from_arg_count:nnF { \use:nnn #2 #1 } {#3}
- {
- \__msg_kernel_error:nnxx { kernel } { bad-number-of-arguments }
- { \token_to_str:N #1 } { \int_eval:n {#3} }
- }
- {#4}
- }
-\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:cNnn
- { \exp_args:Nc \cs_generate_from_arg_count:NNnn }
-\cs_new_protected_nopar:Npn \cs_generate_from_arg_count:Ncnn
- { \exp_args:NNc \cs_generate_from_arg_count:NNnn }
-\cs_set:Npn \__cs_tmp:w #1#2#3
- {
- \cs_new_protected_nopar:cpx { cs_ #1 : #2 }
- {
- \exp_not:N \__cs_generate_from_signature:NNn
- \exp_after:wN \exp_not:N \cs:w cs_ #1 : #3 \cs_end:
- }
- }
-\cs_new_protected:Npn \__cs_generate_from_signature:NNn #1#2
- {
- \__cs_split_function:NN #2 \__cs_generate_from_signature:nnNNNn
- #1 #2
- }
-\cs_new_protected:Npn \__cs_generate_from_signature:nnNNNn #1#2#3#4#5#6
- {
- \bool_if:NTF #3
- {
- \cs_generate_from_arg_count:NNnn
- #5 #4 { \tl_count:n {#2} } {#6}
- }
- {
- \__msg_kernel_error:nnx { kernel } { missing-colon }
- { \token_to_str:N #5 }
- }
- }
-\__cs_tmp:w { set } { Nn } { Npn }
-\__cs_tmp:w { set } { Nx } { Npx }
-\__cs_tmp:w { set_nopar } { Nn } { Npn }
-\__cs_tmp:w { set_nopar } { Nx } { Npx }
-\__cs_tmp:w { set_protected } { Nn } { Npn }
-\__cs_tmp:w { set_protected } { Nx } { Npx }
-\__cs_tmp:w { set_protected_nopar } { Nn } { Npn }
-\__cs_tmp:w { set_protected_nopar } { Nx } { Npx }
-\__cs_tmp:w { gset } { Nn } { Npn }
-\__cs_tmp:w { gset } { Nx } { Npx }
-\__cs_tmp:w { gset_nopar } { Nn } { Npn }
-\__cs_tmp:w { gset_nopar } { Nx } { Npx }
-\__cs_tmp:w { gset_protected } { Nn } { Npn }
-\__cs_tmp:w { gset_protected } { Nx } { Npx }
-\__cs_tmp:w { gset_protected_nopar } { Nn } { Npn }
-\__cs_tmp:w { gset_protected_nopar } { Nx } { Npx }
-\__cs_tmp:w { new } { Nn } { Npn }
-\__cs_tmp:w { new } { Nx } { Npx }
-\__cs_tmp:w { new_nopar } { Nn } { Npn }
-\__cs_tmp:w { new_nopar } { Nx } { Npx }
-\__cs_tmp:w { new_protected } { Nn } { Npn }
-\__cs_tmp:w { new_protected } { Nx } { Npx }
-\__cs_tmp:w { new_protected_nopar } { Nn } { Npn }
-\__cs_tmp:w { new_protected_nopar } { Nx } { Npx }
-\cs_set:Npn \__cs_tmp:w #1#2
- {
- \cs_new_protected_nopar:cpx { cs_ #1 : c #2 }
- {
- \exp_not:N \exp_args:Nc
- \exp_after:wN \exp_not:N \cs:w cs_ #1 : N #2 \cs_end:
- }
- }
-\__cs_tmp:w { set } { n }
-\__cs_tmp:w { set } { x }
-\__cs_tmp:w { set_nopar } { n }
-\__cs_tmp:w { set_nopar } { x }
-\__cs_tmp:w { set_protected } { n }
-\__cs_tmp:w { set_protected } { x }
-\__cs_tmp:w { set_protected_nopar } { n }
-\__cs_tmp:w { set_protected_nopar } { x }
-\__cs_tmp:w { gset } { n }
-\__cs_tmp:w { gset } { x }
-\__cs_tmp:w { gset_nopar } { n }
-\__cs_tmp:w { gset_nopar } { x }
-\__cs_tmp:w { gset_protected } { n }
-\__cs_tmp:w { gset_protected } { x }
-\__cs_tmp:w { gset_protected_nopar } { n }
-\__cs_tmp:w { gset_protected_nopar } { x }
-\__cs_tmp:w { new } { n }
-\__cs_tmp:w { new } { x }
-\__cs_tmp:w { new_nopar } { n }
-\__cs_tmp:w { new_nopar } { x }
-\__cs_tmp:w { new_protected } { n }
-\__cs_tmp:w { new_protected } { x }
-\__cs_tmp:w { new_protected_nopar } { n }
-\__cs_tmp:w { new_protected_nopar } { x }
-\prg_new_conditional:Npnn \cs_if_eq:NN #1#2 { p , T , F , TF }
- {
- \if_meaning:w #1#2
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\cs_new_nopar:Npn \cs_if_eq_p:cN { \exp_args:Nc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:cNTF { \exp_args:Nc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:cNT { \exp_args:Nc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:cNF { \exp_args:Nc \cs_if_eq:NNF }
-\cs_new_nopar:Npn \cs_if_eq_p:Nc { \exp_args:NNc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:NcTF { \exp_args:NNc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:NcT { \exp_args:NNc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:NcF { \exp_args:NNc \cs_if_eq:NNF }
-\cs_new_nopar:Npn \cs_if_eq_p:cc { \exp_args:Ncc \cs_if_eq_p:NN }
-\cs_new_nopar:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF }
-\cs_new_nopar:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT }
-\cs_new_nopar:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF }
-\cs_new_protected:Npn \__kernel_register_show:N #1
- {
- \cs_if_exist:NTF #1
- { \tex_showthe:D \use:n {#1} }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected_nopar:Npn \__kernel_register_show:c
- { \exp_args:Nc \__kernel_register_show:N }
-\group_begin:
- \tex_lccode:D `? = `: \scan_stop:
- \tex_catcode:D `? = 12 \scan_stop:
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \cs_show:N #1
- {
- \__msg_show_variable:n
- {
- > ~ \token_to_str:N #1 =
- \exp_after:wN \__cs_show:www \cs_meaning:N #1
- \use_none:nn ? \prg_do_nothing:
- }
- }
- \cs_new:Npn \__cs_show:www #1 ? { #1 ? \\ }
- }
-\cs_new_protected_nopar:Npn \cs_show:c
- { \group_begin: \exp_args:NNc \group_end: \cs_show:N }
-\cs_new_eq:NN \luatex_if_engine:T \use_none:n
-\cs_new_eq:NN \luatex_if_engine:F \use:n
-\cs_new_eq:NN \luatex_if_engine:TF \use_ii:nn
-\cs_new_eq:NN \pdftex_if_engine:T \use:n
-\cs_new_eq:NN \pdftex_if_engine:F \use_none:n
-\cs_new_eq:NN \pdftex_if_engine:TF \use_i:nn
-\cs_new_eq:NN \xetex_if_engine:T \use_none:n
-\cs_new_eq:NN \xetex_if_engine:F \use:n
-\cs_new_eq:NN \xetex_if_engine:TF \use_ii:nn
-\cs_new_eq:NN \luatex_if_engine_p: \c_false_bool
-\cs_new_eq:NN \pdftex_if_engine_p: \c_true_bool
-\cs_new_eq:NN \xetex_if_engine_p: \c_false_bool
-\cs_if_exist:NT \xetex_XeTeXversion:D
- {
- \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n
- \cs_gset_eq:NN \pdftex_if_engine:F \use:n
- \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn
- \cs_gset_eq:NN \xetex_if_engine:T \use:n
- \cs_gset_eq:NN \xetex_if_engine:F \use_none:n
- \cs_gset_eq:NN \xetex_if_engine:TF \use_i:nn
- \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool
- \cs_gset_eq:NN \xetex_if_engine_p: \c_true_bool
- }
-\cs_if_exist:NT \luatex_directlua:D
- {
- \cs_gset_eq:NN \luatex_if_engine:T \use:n
- \cs_gset_eq:NN \luatex_if_engine:F \use_none:n
- \cs_gset_eq:NN \luatex_if_engine:TF \use_i:nn
- \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n
- \cs_gset_eq:NN \pdftex_if_engine:F \use:n
- \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn
- \cs_gset_eq:NN \luatex_if_engine_p: \c_true_bool
- \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool
- }
-\cs_new_nopar:Npn \prg_do_nothing: { }
-\prg_new_conditional:Npnn \str_if_eq:nn #1#2 { p , T , F , TF }
- {
- \if_int_compare:w \pdftex_strcmp:D { \exp_not:n {#1} } { \exp_not:n {#2} }
- = \c_zero
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \str_if_eq_x:nn #1#2 { p , T , F , TF }
- {
- \if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\cs_new:Npn \__str_if_eq_x_return:nn #1 #2
- {
- \if_int_compare:w \pdftex_strcmp:D {#1} {#2} = \c_zero
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \str_case:nn #1#2
- {
- \tex_romannumeral:D
- \__str_case:nnTF {#1} {#2} { } { }
- }
-\cs_new:Npn \str_case:nnT #1#2#3
- {
- \tex_romannumeral:D
- \__str_case:nnTF {#1} {#2} {#3} { }
- }
-\cs_new:Npn \str_case:nnF #1#2
- {
- \tex_romannumeral:D
- \__str_case:nnTF {#1} {#2} { }
- }
-\cs_new:Npn \str_case:nnTF #1#2
- {
- \tex_romannumeral:D
- \__str_case:nnTF {#1} {#2}
- }
-\cs_new:Npn \__str_case:nnTF #1#2#3#4
- { \__str_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
-\cs_new:Npn \__str_case:nw #1#2#3
- {
- \str_if_eq:nnTF {#1} {#2}
- { \__str_case_end:nw {#3} }
- { \__str_case:nw {#1} }
- }
-\cs_new:Npn \str_case_x:nn #1#2
- {
- \tex_romannumeral:D
- \__str_case_x:nnTF {#1} {#2} { } { }
- }
-\cs_new:Npn \str_case_x:nnT #1#2#3
- {
- \tex_romannumeral:D
- \__str_case_x:nnTF {#1} {#2} {#3} { }
- }
-\cs_new:Npn \str_case_x:nnF #1#2
- {
- \tex_romannumeral:D
- \__str_case_x:nnTF {#1} {#2} { }
- }
-\cs_new:Npn \str_case_x:nnTF #1#2
- {
- \tex_romannumeral:D
- \__str_case_x:nnTF {#1} {#2}
- }
-\cs_new:Npn \__str_case_x:nnTF #1#2#3#4
- { \__str_case_x:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
-\cs_new:Npn \__str_case_x:nw #1#2#3
- {
- \str_if_eq_x:nnTF {#1} {#2}
- { \__str_case_end:nw {#3} }
- { \__str_case_x:nw {#1} }
- }
-\cs_new:Npn \__prg_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
- { \c_zero #1 #4 }
-\cs_new_eq:NN \__str_case_end:nw \__prg_case_end:nw
-\cs_new_eq:NN \__prg_break_point:Nn \use_ii:nn
-\cs_new:Npn \__prg_map_break:Nn #1#2#3 \__prg_break_point:Nn #4#5
- {
- #5
- \if_meaning:w #1 #4
- \exp_after:wN \use_iii:nnn
- \fi:
- \__prg_map_break:Nn #1 {#2}
- }
-\cs_new_eq:NN \__prg_break_point: \prg_do_nothing:
-\cs_new:Npn \__prg_break: #1 \__prg_break_point: { }
-\cs_new:Npn \__prg_break:n #1#2 \__prg_break_point: {#1}
-\cs_new_eq:NN \str_case:nnn \str_case:nnF
-\cs_new_eq:NN \str_case_x:nnn \str_case_x:nnF
-%%
-%%
-%% End of file `l3basics.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty b/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty
deleted file mode 100644
index dacc6a0203a..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty
+++ /dev/null
@@ -1,274 +0,0 @@
-%%
-%% This is file `l3bootstrap.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3bootstrap.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3bootstrap.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\protected\def\GetIdInfo
- {%
- \begingroup
- \catcode 32 = 10 %
- \GetIdInfoAuxI
- }
-\protected\def\GetIdInfoAuxI$#1$#2%
- {%
- \def\tempa{#1}%
- \def\tempb{Id}%
- \ifx\tempa\tempb
- \def\tempa
- {%
- \endgroup
- \def\ExplFileDate{9999/12/31}%
- \def\ExplFileDescription{#2}%
- \def\ExplFileName{[unknown name]}%
- \def\ExplFileExtension{[unknown extension]}%
- \def\ExplFileVersion{999}%
- }%
- \else
- \def\tempa
- {%
- \endgroup
- \def\ExplFileDescription{#2}%
- \GetIdInfoAuxII$#1 $%
- }%
- \fi
- \tempa
- }
-\protected\def\GetIdInfoAuxII$#1 #2.#3 #4 #5 #6$%
- {%
- \def\ExplFileName{#2}%
- \def\ExplFileExtension{#3}%
- \def\ExplFileVersion{#4}%
- \begingroup
- \def\tempa{#4}%
- \def\tempb{-1}%
- \ifx\tempa\tempb
- \def\tempa
- {%
- \endgroup
- \def\ExplFileDate{0000/00/00}%
- }%
- \else
- \def\tempa
- {%
- \endgroup
- \GetIdInfoAuxIII$#5$%
- }%
- \fi
- \tempa
- }
-\protected\def\GetIdInfoAuxIII$#1-#2-#3$%
- {%
- \def\ExplFileDate{#1/#2/#3}%
- }
-\GetIdInfo$Id: l3bootstrap.dtx 4640 2014-01-04 16:03:52Z joseph $
- {L3 Bootstrap code}
-\ProvidesPackage{l3bootstrap}
- [%
- \ExplFileDate\space v\ExplFileVersion\space
- L3 Experimental bootstrap code%
- ]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname directlua\endcsname\relax
-\else
- \begingroup
- \def\@tempa
- {%
- \endgroup
- \RequirePackage{luatex}%
- \RequirePackage{pdftexcmds}%
- }%
- \expandafter\@tempa
-\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname pdfstrcmp\endcsname\relax
- \let\pdfstrcmp\strcmp
-\fi
-\begingroup
- \def\ShortText{Required primitives not found}%
- \def\LongText%
- {%
- LaTeX3 requires the e-TeX primitives and \string\pdfstrcmp.\LineBreak
- \LineBreak
- These are available in engine versions:\LineBreak
- - pdfTeX 1.30\LineBreak
- - XeTeX 0.9994\LineBreak
- - LuaTeX 0.40\LineBreak
- or later.\LineBreak
- \LineBreak
- }%
- \expandafter\ifx\csname pdfstrcmp\endcsname\relax
- \expandafter\ifx\csname pdf@strcmp\endcsname\relax
- \def\LineBreak{\noexpand\MessageBreak}%
- \edef\Error%
- {%
- \endgroup
- \noexpand\PackageError{expl3}{\ShortText}
- {\LongText Loading of expl3 will abort!}%
- \noexpand\endinput
- }%
- \expandafter\expandafter\expandafter\Error
- \else
- \endgroup
- \fi
-\else
- \endgroup
-\fi
-\protected\edef\ExplSyntaxOff
- {%
- \catcode 9 = \the\catcode 9\relax
- \catcode 32 = \the\catcode 32\relax
- \catcode 34 = \the\catcode 34\relax
- \catcode 38 = \the\catcode 38\relax
- \catcode 58 = \the\catcode 58\relax
- \catcode 94 = \the\catcode 94\relax
- \catcode 95 = \the\catcode 95\relax
- \catcode 124 = \the\catcode 124\relax
- \catcode 126 = \the\catcode 126\relax
- \endlinechar = \the\endlinechar\relax
- \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0 \relax
- }
-\protected\edef\ExplSyntaxOn
- {%
- \catcode 9 = 9 \relax
- \catcode 32 = 9 \relax
- \catcode 34 = 12 \relax
- \catcode 58 = 11 \relax
- \catcode 94 = 7 \relax
- \catcode 95 = 11 \relax
- \catcode 124 = 12 \relax
- \catcode 126 = 10 \relax
- \endlinechar = 32 \relax
- \chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 1 \relax
- }
-\expandafter\chardef\csname\detokenize{l__kernel_expl_bool}\endcsname = 0 \relax
-\protected\def\ProvidesExplPackage
- {%
- \@ifpackageloaded{expl3}
- {}
- {%
- \PackageError{expl3}
- {Cannot load the expl3 modules separately}
- {%
- The expl3 modules cannot be loaded separately;\MessageBreak
- please \string\usepackage\string{expl3\string} instead.%
- }%
- }%
- \protected\def\ProvidesExplPackage##1##2##3##4%
- {%
- \ProvidesPackage{##1}[##2 v##3 ##4]%
- \ExplSyntaxOn
- }%
- \ProvidesExplPackage
- }
-\protected\def\ProvidesExplClass#1#2#3#4%
- {%
- \ProvidesClass{#1}[#2 v#3 #4]%
- \ExplSyntaxOn
- }
-\protected\def\ProvidesExplFile#1#2#3#4%
- {%
- \ProvidesFile{#1}[#2 v#3 #4]%
- \ExplSyntaxOn
- }
-\edef\@pushfilename
- {%
- \edef\expandafter\noexpand
- \csname\detokenize{l__expl_status_stack_tl}\endcsname
- {%
- \noexpand\ifodd\expandafter\noexpand
- \csname\detokenize{l__kernel_expl_bool}\endcsname
- 1%
- \noexpand\else
- 0%
- \noexpand\fi
- \expandafter\noexpand
- \csname\detokenize{l__expl_status_stack_tl}\endcsname
- }%
- \ExplSyntaxOff
- \unexpanded\expandafter{\@pushfilename}%
- }
-\edef\@popfilename
- {%
- \unexpanded\expandafter{\@popfilename}%
- \noexpand\if a\expandafter\noexpand\csname
- \detokenize{l__expl_status_stack_tl}\endcsname a%
- \ExplSyntaxOff
- \noexpand\else
- \noexpand\expandafter
- \expandafter\noexpand\csname
- \detokenize{__expl_status_pop:w}\endcsname
- \expandafter\noexpand\csname
- \detokenize{l__expl_status_stack_tl}\endcsname
- \noexpand\@nil
- \noexpand\fi
- }
-\@namedef{\detokenize{l__expl_status_stack_tl}}{0}
-\expandafter\edef\csname\detokenize{__expl_status_pop:w}\endcsname#1#2\@nil
- {%
- \def\expandafter\noexpand
- \csname\detokenize{l__expl_status_stack_tl}\endcsname{#2}%
- \noexpand\ifodd#1\space
- \noexpand\expandafter\noexpand\ExplSyntaxOn
- \noexpand\else
- \noexpand\expandafter\ExplSyntaxOff
- \noexpand\fi
- }
-\expandafter\protected\expandafter\def
- \csname\detokenize{__expl_package_check:}\endcsname
- {%
- \@ifpackageloaded{expl3}
- {}
- {%
- \PackageError{expl3}
- {Cannot load the expl3 modules separately}
- {%
- The expl3 modules cannot be loaded separately;\MessageBreak
- please \string\usepackage\string{expl3\string} instead.%
- }%
- }%
- }
-%%
-%%
-%% End of file `l3bootstrap.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty b/Master/texmf-dist/tex/latex/l3kernel/l3box.sty
deleted file mode 100644
index 1f9be4b1206..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3box.sty
+++ /dev/null
@@ -1,265 +0,0 @@
-%%
-%% This is file `l3box.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3box.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3box.dtx Copyright (C) 2005-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3box.dtx 4581 2013-07-28 08:38:50Z joseph $
- {L3 Experimental boxes}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_protected:Npn \box_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newbox #1
- }
-\cs_generate_variant:Nn \box_new:N { c }
-\cs_new_protected:Npn \box_clear:N #1
- { \box_set_eq:NN #1 \c_empty_box }
-\cs_new_protected:Npn \box_gclear:N #1
- { \box_gset_eq:NN #1 \c_empty_box }
-\cs_generate_variant:Nn \box_clear:N { c }
-\cs_generate_variant:Nn \box_gclear:N { c }
-\cs_new_protected:Npn \box_clear_new:N #1
- { \box_if_exist:NTF #1 { \box_clear:N #1 } { \box_new:N #1 } }
-\cs_new_protected:Npn \box_gclear_new:N #1
- { \box_if_exist:NTF #1 { \box_gclear:N #1 } { \box_new:N #1 } }
-\cs_generate_variant:Nn \box_clear_new:N { c }
-\cs_generate_variant:Nn \box_gclear_new:N { c }
-\cs_new_protected:Npn \box_set_eq:NN #1#2
- { \tex_setbox:D #1 \tex_copy:D #2 }
-\cs_new_protected:Npn \box_gset_eq:NN
- { \tex_global:D \box_set_eq:NN }
-\cs_generate_variant:Nn \box_set_eq:NN { c , Nc , cc }
-\cs_generate_variant:Nn \box_gset_eq:NN { c , Nc , cc }
-\cs_new_protected:Npn \box_set_eq_clear:NN #1#2
- { \tex_setbox:D #1 \tex_box:D #2 }
-\cs_new_protected:Npn \box_gset_eq_clear:NN
- { \tex_global:D \box_set_eq_clear:NN }
-\cs_generate_variant:Nn \box_set_eq_clear:NN { c , Nc , cc }
-\cs_generate_variant:Nn \box_gset_eq_clear:NN { c , Nc , cc }
-\prg_new_eq_conditional:NNn \box_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \box_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_eq:NN \box_ht:N \tex_ht:D
-\cs_new_eq:NN \box_dp:N \tex_dp:D
-\cs_new_eq:NN \box_wd:N \tex_wd:D
-\cs_generate_variant:Nn \box_ht:N { c }
-\cs_generate_variant:Nn \box_dp:N { c }
-\cs_generate_variant:Nn \box_wd:N { c }
-\cs_new_protected:Npn \box_set_dp:Nn #1#2
- { \box_dp:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\cs_new_protected:Npn \box_set_ht:Nn #1#2
- { \box_ht:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\cs_new_protected:Npn \box_set_wd:Nn #1#2
- { \box_wd:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\cs_generate_variant:Nn \box_set_ht:Nn { c }
-\cs_generate_variant:Nn \box_set_dp:Nn { c }
-\cs_generate_variant:Nn \box_set_wd:Nn { c }
-\cs_new_eq:NN \box_use_clear:N \tex_box:D
-\cs_new_eq:NN \box_use:N \tex_copy:D
-\cs_generate_variant:Nn \box_use_clear:N { c }
-\cs_generate_variant:Nn \box_use:N { c }
-\cs_new_protected:Npn \box_move_left:nn #1#2
- { \tex_moveleft:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\cs_new_protected:Npn \box_move_right:nn #1#2
- { \tex_moveright:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\cs_new_protected:Npn \box_move_up:nn #1#2
- { \tex_raise:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\cs_new_protected:Npn \box_move_down:nn #1#2
- { \tex_lower:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\cs_new_eq:NN \if_hbox:N \tex_ifhbox:D
-\cs_new_eq:NN \if_vbox:N \tex_ifvbox:D
-\cs_new_eq:NN \if_box_empty:N \tex_ifvoid:D
-\prg_new_conditional:Npnn \box_if_horizontal:N #1 { p , T , F , TF }
- { \if_hbox:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
-\prg_new_conditional:Npnn \box_if_vertical:N #1 { p , T , F , TF }
- { \if_vbox:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
-\cs_generate_variant:Nn \box_if_horizontal_p:N { c }
-\cs_generate_variant:Nn \box_if_horizontal:NT { c }
-\cs_generate_variant:Nn \box_if_horizontal:NF { c }
-\cs_generate_variant:Nn \box_if_horizontal:NTF { c }
-\cs_generate_variant:Nn \box_if_vertical_p:N { c }
-\cs_generate_variant:Nn \box_if_vertical:NT { c }
-\cs_generate_variant:Nn \box_if_vertical:NF { c }
-\cs_generate_variant:Nn \box_if_vertical:NTF { c }
-\prg_new_conditional:Npnn \box_if_empty:N #1 { p , T , F , TF }
- { \if_box_empty:N #1 \prg_return_true: \else: \prg_return_false: \fi: }
-\cs_generate_variant:Nn \box_if_empty_p:N { c }
-\cs_generate_variant:Nn \box_if_empty:NT { c }
-\cs_generate_variant:Nn \box_if_empty:NF { c }
-\cs_generate_variant:Nn \box_if_empty:NTF { c }
-\cs_new_protected:Npn \box_set_to_last:N #1
- { \tex_setbox:D #1 \tex_lastbox:D }
-\cs_new_protected:Npn \box_gset_to_last:N
- { \tex_global:D \box_set_to_last:N }
-\cs_generate_variant:Nn \box_set_to_last:N { c }
-\cs_generate_variant:Nn \box_gset_to_last:N { c }
-\box_new:N \c_empty_box
-\box_new:N \l_tmpa_box
-\box_new:N \l_tmpb_box
-\box_new:N \g_tmpa_box
-\box_new:N \g_tmpb_box
-\cs_new_protected:Npn \box_show:N #1
- { \box_show:Nnn #1 \c_max_int \c_max_int }
-\cs_generate_variant:Nn \box_show:N { c }
-\cs_new_protected_nopar:Npn \box_show:Nnn
- { \__box_show:NNnn \c_one }
-\cs_generate_variant:Nn \box_show:Nnn { c }
-\cs_new_protected:Npn \box_log:N #1
- { \box_log:Nnn #1 \c_max_int \c_max_int }
-\cs_generate_variant:Nn \box_log:N { c }
-\cs_new_protected:Npn \box_log:Nnn #1#2#3
- {
- \use:x
- {
- \etex_interactionmode:D \c_zero
- \__box_show:NNnn \c_zero \exp_not:N #1
- { \int_eval:n {#2} } { \int_eval:n {#3} }
- \etex_interactionmode:D
- = \tex_the:D \etex_interactionmode:D \scan_stop:
- }
- }
-\cs_generate_variant:Nn \box_log:Nnn { c }
-\cs_new_protected:Npn \__box_show:NNnn #1#2#3#4
- {
- \group_begin:
- \int_set:Nn \tex_showboxbreadth:D {#3}
- \int_set:Nn \tex_showboxdepth:D {#4}
- \int_set_eq:NN \tex_tracingonline:D #1
- \box_if_exist:NTF #2
- { \tex_showbox:D \use:n {#2} }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #2 }
- }
- \group_end:
- }
-\cs_new_protected:Npn \hbox:n { \tex_hbox:D \scan_stop: }
-\cs_new_protected:Npn \hbox_set:Nn #1#2 { \tex_setbox:D #1 \tex_hbox:D {#2} }
-\cs_new_protected:Npn \hbox_gset:Nn { \tex_global:D \hbox_set:Nn }
-\cs_generate_variant:Nn \hbox_set:Nn { c }
-\cs_generate_variant:Nn \hbox_gset:Nn { c }
-\cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3
- { \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end: {#3} }
-\cs_new_protected:Npn \hbox_gset_to_wd:Nnn
- { \tex_global:D \hbox_set_to_wd:Nnn }
-\cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c }
-\cs_generate_variant:Nn \hbox_gset_to_wd:Nnn { c }
-\cs_new_protected:Npn \hbox_set:Nw #1
- { \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token }
-\cs_new_protected:Npn \hbox_gset:Nw
- { \tex_global:D \hbox_set:Nw }
-\cs_generate_variant:Nn \hbox_set:Nw { c }
-\cs_generate_variant:Nn \hbox_gset:Nw { c }
-\cs_new_eq:NN \hbox_set_end: \c_group_end_token
-\cs_new_eq:NN \hbox_gset_end: \c_group_end_token
-\cs_new_eq:NN \hbox_set_inline_begin:N \hbox_set:Nw
-\cs_new_eq:NN \hbox_set_inline_begin:c \hbox_set:cw
-\cs_new_eq:NN \hbox_set_inline_end: \hbox_set_end:
-\cs_new_eq:NN \hbox_gset_inline_begin:N \hbox_gset:Nw
-\cs_new_eq:NN \hbox_gset_inline_begin:c \hbox_gset:cw
-\cs_new_eq:NN \hbox_gset_inline_end: \hbox_gset_end:
-\cs_new_protected:Npn \hbox_to_wd:nn #1#2
- { \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end: {#2} }
-\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_dim {#1} }
-\cs_new_protected:Npn \hbox_overlap_left:n #1
- { \hbox_to_zero:n { \tex_hss:D #1 } }
-\cs_new_protected:Npn \hbox_overlap_right:n #1
- { \hbox_to_zero:n { #1 \tex_hss:D } }
-\cs_new_eq:NN \hbox_unpack:N \tex_unhcopy:D
-\cs_new_eq:NN \hbox_unpack_clear:N \tex_unhbox:D
-\cs_generate_variant:Nn \hbox_unpack:N { c }
-\cs_generate_variant:Nn \hbox_unpack_clear:N { c }
-\cs_new_protected:Npn \vbox:n #1 { \tex_vbox:D { #1 \par } }
-\cs_new_protected:Npn \vbox_top:n #1 { \tex_vtop:D { #1 \par } }
-\cs_new_protected:Npn \vbox_to_ht:nn #1#2
- { \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end: { #2 \par } }
-\cs_new_protected:Npn \vbox_to_zero:n #1
- { \tex_vbox:D to \c_zero_dim { #1 \par } }
-\cs_new_protected:Npn \vbox_set:Nn #1#2
- { \tex_setbox:D #1 \tex_vbox:D { #2 \par } }
-\cs_new_protected:Npn \vbox_gset:Nn { \tex_global:D \vbox_set:Nn }
-\cs_generate_variant:Nn \vbox_set:Nn { c }
-\cs_generate_variant:Nn \vbox_gset:Nn { c }
-\cs_new_protected:Npn \vbox_set_top:Nn #1#2
- { \tex_setbox:D #1 \tex_vtop:D { #2 \par } }
-\cs_new_protected:Npn \vbox_gset_top:Nn
- { \tex_global:D \vbox_set_top:Nn }
-\cs_generate_variant:Nn \vbox_set_top:Nn { c }
-\cs_generate_variant:Nn \vbox_gset_top:Nn { c }
-\cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3
- { \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:w #2 \__dim_eval_end: { #3 \par } }
-\cs_new_protected:Npn \vbox_gset_to_ht:Nnn
- { \tex_global:D \vbox_set_to_ht:Nnn }
-\cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c }
-\cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c }
-\cs_new_protected:Npn \vbox_set:Nw #1
- { \tex_setbox:D #1 \tex_vbox:D \c_group_begin_token }
-\cs_new_protected:Npn \vbox_gset:Nw
- { \tex_global:D \vbox_set:Nw }
-\cs_generate_variant:Nn \vbox_set:Nw { c }
-\cs_generate_variant:Nn \vbox_gset:Nw { c }
-\cs_new_protected:Npn \vbox_set_end:
- {
- \par
- \c_group_end_token
- }
-\cs_new_eq:NN \vbox_gset_end: \vbox_set_end:
-\cs_new_eq:NN \vbox_set_inline_begin:N \vbox_set:Nw
-\cs_new_eq:NN \vbox_set_inline_begin:c \vbox_set:cw
-\cs_new_eq:NN \vbox_set_inline_end: \vbox_set_end:
-\cs_new_eq:NN \vbox_gset_inline_begin:N \vbox_gset:Nw
-\cs_new_eq:NN \vbox_gset_inline_begin:c \vbox_gset:cw
-\cs_new_eq:NN \vbox_gset_inline_end: \vbox_gset_end:
-\cs_new_eq:NN \vbox_unpack:N \tex_unvcopy:D
-\cs_new_eq:NN \vbox_unpack_clear:N \tex_unvbox:D
-\cs_generate_variant:Nn \vbox_unpack:N { c }
-\cs_generate_variant:Nn \vbox_unpack_clear:N { c }
-\cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3
- { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:w #3 \__dim_eval_end: }
-%%
-%%
-%% End of file `l3box.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty b/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty
deleted file mode 100644
index 34161b8360d..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3candidates.sty
+++ /dev/null
@@ -1,1103 +0,0 @@
-%%
-%% This is file `l3candidates.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3candidates.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3candidates.dtx Copyright(C) 2012,2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3candidates.dtx 4643 2014-01-06 13:28:06Z joseph $
- {L3 Experimental additions to l3kernel}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\fp_new:N \l__box_angle_fp
-\fp_new:N \l__box_cos_fp
-\fp_new:N \l__box_sin_fp
-\dim_new:N \l__box_top_dim
-\dim_new:N \l__box_bottom_dim
-\dim_new:N \l__box_left_dim
-\dim_new:N \l__box_right_dim
-\dim_new:N \l__box_top_new_dim
-\dim_new:N \l__box_bottom_new_dim
-\dim_new:N \l__box_left_new_dim
-\dim_new:N \l__box_right_new_dim
-\box_new:N \l__box_internal_box
-\cs_new_protected:Npn \box_rotate:Nn #1#2
- {
- \hbox_set:Nn #1
- {
- \group_begin:
- \fp_set:Nn \l__box_angle_fp {#2}
- \fp_set:Nn \l__box_sin_fp { sind ( \l__box_angle_fp ) }
- \fp_set:Nn \l__box_cos_fp { cosd ( \l__box_angle_fp ) }
- \__box_rotate:N #1
- \group_end:
- }
- }
-\cs_new_protected:Npn \__box_rotate:N #1
- {
- \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
- \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
- \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
- \dim_zero:N \l__box_left_dim
- \fp_compare:nNnTF \l__box_sin_fp > \c_zero_fp
- {
- \fp_compare:nNnTF \l__box_cos_fp > \c_zero_fp
- { \__box_rotate_quadrant_one: }
- { \__box_rotate_quadrant_two: }
- }
- {
- \fp_compare:nNnTF \l__box_cos_fp < \c_zero_fp
- { \__box_rotate_quadrant_three: }
- { \__box_rotate_quadrant_four: }
- }
- \hbox_set:Nn \l__box_internal_box { \box_use:N #1 }
- \hbox_set:Nn \l__box_internal_box
- {
- \tex_kern:D -\l__box_left_new_dim
- \hbox:n
- {
- \__driver_box_rotate_begin:
- \box_use:N \l__box_internal_box
- \__driver_box_rotate_end:
- }
- }
- \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
- \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
- \box_set_wd:Nn \l__box_internal_box
- { \l__box_right_new_dim - \l__box_left_new_dim }
- \box_use:N \l__box_internal_box
- }
-\cs_new_protected:Npn \__box_rotate_x:nnN #1#2#3
- {
- \dim_set:Nn #3
- {
- \fp_to_dim:n
- {
- \l__box_cos_fp * \dim_to_fp:n {#1}
- - ( \l__box_sin_fp * \dim_to_fp:n {#2} )
- }
- }
- }
-\cs_new_protected:Npn \__box_rotate_y:nnN #1#2#3
- {
- \dim_set:Nn #3
- {
- \fp_to_dim:n
- {
- \l__box_sin_fp * \dim_to_fp:n {#1}
- + \l__box_cos_fp * \dim_to_fp:n {#2}
- }
- }
- }
-\cs_new_protected:Npn \__box_rotate_quadrant_one:
- {
- \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
- \l__box_top_new_dim
- \__box_rotate_y:nnN \l__box_left_dim \l__box_bottom_dim
- \l__box_bottom_new_dim
- \__box_rotate_x:nnN \l__box_left_dim \l__box_top_dim
- \l__box_left_new_dim
- \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
- \l__box_right_new_dim
- }
-\cs_new_protected:Npn \__box_rotate_quadrant_two:
- {
- \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
- \l__box_top_new_dim
- \__box_rotate_y:nnN \l__box_left_dim \l__box_top_dim
- \l__box_bottom_new_dim
- \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
- \l__box_left_new_dim
- \__box_rotate_x:nnN \l__box_left_dim \l__box_bottom_dim
- \l__box_right_new_dim
- }
-\cs_new_protected:Npn \__box_rotate_quadrant_three:
- {
- \__box_rotate_y:nnN \l__box_left_dim \l__box_bottom_dim
- \l__box_top_new_dim
- \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
- \l__box_bottom_new_dim
- \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
- \l__box_left_new_dim
- \__box_rotate_x:nnN \l__box_left_dim \l__box_top_dim
- \l__box_right_new_dim
- }
-\cs_new_protected:Npn \__box_rotate_quadrant_four:
- {
- \__box_rotate_y:nnN \l__box_left_dim \l__box_top_dim
- \l__box_top_new_dim
- \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
- \l__box_bottom_new_dim
- \__box_rotate_x:nnN \l__box_left_dim \l__box_bottom_dim
- \l__box_left_new_dim
- \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
- \l__box_right_new_dim
- }
-\fp_new:N \l__box_scale_x_fp
-\fp_new:N \l__box_scale_y_fp
-\cs_new_protected:Npn \box_resize:Nnn #1#2#3
- {
- \hbox_set:Nn #1
- {
- \group_begin:
- \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
- \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
- \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
- \dim_zero:N \l__box_left_dim
- \fp_set:Nn \l__box_scale_x_fp
- { \dim_to_fp:n {#2} / ( \dim_to_fp:n \l__box_right_dim ) }
- \fp_set:Nn \l__box_scale_y_fp
- {
- \dim_to_fp:n {#3} /
- ( \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim } )
- }
- \__box_resize:Nnn #1 {#2} {#3}
- \group_end:
- }
- }
-\cs_generate_variant:Nn \box_resize:Nnn { c }
-\cs_new_protected:Npn \__box_resize:Nnn #1#2#3
- {
- \dim_set:Nn \l__box_right_new_dim { \dim_abs:n {#2} }
- \dim_set:Nn \l__box_bottom_new_dim
- { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
- \dim_set:Nn \l__box_top_new_dim
- { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
- \__box_resize_common:N #1
- }
-\cs_new_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2
- {
- \hbox_set:Nn #1
- {
- \group_begin:
- \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
- \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
- \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
- \dim_zero:N \l__box_left_dim
- \fp_set:Nn \l__box_scale_y_fp
- {
- \dim_to_fp:n {#2} /
- ( \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim } )
- }
- \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
- \__box_resize:Nnn #1 {#2} {#2}
- \group_end:
- }
- }
-\cs_generate_variant:Nn \box_resize_to_ht_plus_dp:Nn { c }
-\cs_new_protected:Npn \box_resize_to_wd:Nn #1#2
- {
- \hbox_set:Nn #1
- {
- \group_begin:
- \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
- \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
- \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
- \dim_zero:N \l__box_left_dim
- \fp_set:Nn \l__box_scale_x_fp
- { \dim_to_fp:n {#2} / ( \dim_to_fp:n \l__box_right_dim ) }
- \fp_set_eq:NN \l__box_scale_y_fp \l__box_scale_x_fp
- \__box_resize:Nnn #1 {#2} {#2}
- \group_end:
- }
- }
-\cs_generate_variant:Nn \box_resize_to_wd:Nn { c }
-\cs_new_protected:Npn \box_scale:Nnn #1#2#3
- {
- \hbox_set:Nn #1
- {
- \group_begin:
- \fp_set:Nn \l__box_scale_x_fp {#2}
- \fp_set:Nn \l__box_scale_y_fp {#3}
- \dim_set:Nn \l__box_top_dim { \box_ht:N #1 }
- \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
- \dim_set:Nn \l__box_right_dim { \box_wd:N #1 }
- \dim_zero:N \l__box_left_dim
- \dim_set:Nn \l__box_top_new_dim
- { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
- \dim_set:Nn \l__box_bottom_new_dim
- { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
- \dim_set:Nn \l__box_right_new_dim
- { \fp_abs:n { \l__box_scale_x_fp } \l__box_right_dim }
- \__box_resize_common:N #1
- \group_end:
- }
- }
-\cs_generate_variant:Nn \box_scale:Nnn { c }
-\cs_new_protected:Npn \__box_resize_common:N #1
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \__driver_box_scale_begin:
- \hbox_overlap_right:n { \box_use:N #1 }
- \__driver_box_scale_end:
- }
- \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
- \box_set_dp:Nn \l__box_internal_box { \l__box_bottom_new_dim }
- \fp_compare:nNnTF \l__box_scale_x_fp < \c_zero_fp
- {
- \hbox_to_wd:nn { \l__box_right_new_dim }
- {
- \tex_kern:D \l__box_right_new_dim
- \box_use:N \l__box_internal_box
- \tex_hss:D
- }
- }
- {
- \box_set_wd:Nn \l__box_internal_box { \l__box_right_new_dim }
- \hbox:n
- {
- \tex_kern:D \c_zero_dim
- \box_use:N \l__box_internal_box
- \tex_hss:D
- }
- }
- }
-\cs_new_protected:Npn \box_clip:N #1
- { \hbox_set:Nn #1 { \__driver_box_use_clip:N #1 } }
-\cs_generate_variant:Nn \box_clip:N { c }
-\cs_new_protected:Npn \box_trim:Nnnnn #1#2#3#4#5
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
- \box_use:N #1
- \tex_kern:D -\__dim_eval:w #4 \__dim_eval_end:
- }
- \dim_compare:nNnTF { \box_dp:N #1 } > {#3}
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \box_move_down:nn \c_zero_dim
- { \box_use:N \l__box_internal_box }
- }
- \box_set_dp:Nn \l__box_internal_box { \box_dp:N #1 - (#3) }
- }
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \box_move_down:nn { #3 - \box_dp:N #1 }
- { \box_use:N \l__box_internal_box }
- }
- \box_set_dp:Nn \l__box_internal_box \c_zero_dim
- }
- \dim_compare:nNnTF { \box_ht:N \l__box_internal_box } > {#5}
- {
- \hbox_set:Nn \l__box_internal_box
- { \box_move_up:nn \c_zero_dim { \box_use:N \l__box_internal_box } }
- \box_set_ht:Nn \l__box_internal_box
- { \box_ht:N \l__box_internal_box - (#5) }
- }
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \box_move_up:nn { #5 - \box_ht:N \l__box_internal_box }
- { \box_use:N \l__box_internal_box }
- }
- \box_set_ht:Nn \l__box_internal_box \c_zero_dim
- }
- \box_set_eq:NN #1 \l__box_internal_box
- }
-\cs_generate_variant:Nn \box_trim:Nnnnn { c }
-\cs_new_protected:Npn \box_viewport:Nnnnn #1#2#3#4#5
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end:
- \box_use:N #1
- \tex_kern:D \__dim_eval:w #4 - \box_wd:N #1 \__dim_eval_end:
- }
- \dim_compare:nNnTF {#3} < \c_zero_dim
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \box_move_down:nn \c_zero_dim
- { \box_use:N \l__box_internal_box }
- }
- \box_set_dp:Nn \l__box_internal_box { -\dim_eval:n {#3} }
- }
- {
- \hbox_set:Nn \l__box_internal_box
- { \box_move_down:nn {#3} { \box_use:N \l__box_internal_box } }
- \box_set_dp:Nn \l__box_internal_box \c_zero_dim
- }
- \dim_compare:nNnTF {#5} > \c_zero_dim
- {
- \hbox_set:Nn \l__box_internal_box
- { \box_move_up:nn \c_zero_dim { \box_use:N \l__box_internal_box } }
- \box_set_ht:Nn \l__box_internal_box
- {
- #5
- \dim_compare:nNnT {#3} > \c_zero_dim
- { - (#3) }
- }
- }
- {
- \hbox_set:Nn \l__box_internal_box
- {
- \box_move_up:nn { -\dim_eval:n {#5} }
- { \box_use:N \l__box_internal_box }
- }
- \box_set_ht:Nn \l__box_internal_box \c_zero_dim
- }
- \box_set_eq:NN #1 \l__box_internal_box
- }
-\cs_generate_variant:Nn \box_viewport:Nnnnn { c }
-\cs_new:Npn \clist_item:Nn #1#2
- {
- \exp_args:Nfo \__clist_item:nnNn
- { \clist_count:N #1 }
- #1
- \__clist_item_N_loop:nw
- {#2}
- }
-\cs_new:Npn \__clist_item:nnNn #1#2#3#4
- {
- \int_compare:nNnTF {#4} < \c_zero
- {
- \int_compare:nNnTF {#4} < { - #1 }
- { \use_none_delimit_by_q_stop:w }
- { \exp_args:Nf #3 { \int_eval:n { #4 + \c_one + #1 } } }
- }
- {
- \int_compare:nNnTF {#4} > {#1}
- { \use_none_delimit_by_q_stop:w }
- { #3 {#4} }
- }
- { } , #2 , \q_stop
- }
-\cs_new:Npn \__clist_item_N_loop:nw #1 #2,
- {
- \int_compare:nNnTF {#1} = \c_zero
- { \use_i_delimit_by_q_stop:nw { \exp_not:n {#2} } }
- { \exp_args:Nf \__clist_item_N_loop:nw { \int_eval:n { #1 - 1 } } }
- }
-\cs_generate_variant:Nn \clist_item:Nn { c }
-\cs_new:Npn \clist_item:nn #1#2
- {
- \exp_args:Nf \__clist_item:nnNn
- { \clist_count:n {#1} }
- {#1}
- \__clist_item_n:nw
- {#2}
- }
-\cs_new:Npn \__clist_item_n:nw #1
- { \__clist_item_n_loop:nw {#1} \prg_do_nothing: }
-\cs_new:Npn \__clist_item_n_loop:nw #1 #2,
- {
- \exp_args:No \tl_if_blank:nTF {#2}
- { \__clist_item_n_loop:nw {#1} \prg_do_nothing: }
- {
- \int_compare:nNnTF {#1} = \c_zero
- { \exp_args:No \__clist_item_n_end:n {#2} }
- {
- \exp_args:Nf \__clist_item_n_loop:nw
- { \int_eval:n { #1 - 1 } }
- \prg_do_nothing:
- }
- }
- }
-\cs_new:Npn \__clist_item_n_end:n #1 #2 \q_stop
- {
- \__tl_trim_spaces:nn { \q_mark #1 }
- { \exp_last_unbraced:No \__clist_item_n_strip:w } ,
- }
-\cs_new:Npn \__clist_item_n_strip:w #1 , { \exp_not:n {#1} }
-\cs_new_protected:Npn \clist_set_from_seq:NN
- { \__clist_set_from_seq:NNNN \clist_clear:N \tl_set:Nx }
-\cs_new_protected:Npn \clist_gset_from_seq:NN
- { \__clist_set_from_seq:NNNN \clist_gclear:N \tl_gset:Nx }
-\cs_new_protected:Npn \__clist_set_from_seq:NNNN #1#2#3#4
- {
- \seq_if_empty:NTF #4
- { #1 #3 }
- {
- #2 #3
- {
- \exp_last_unbraced:Nf \use_none:n
- { \seq_map_function:NN #4 \__clist_wrap_item:n }
- }
- }
- }
-\cs_new:Npn \__clist_wrap_item:n #1
- {
- ,
- \tl_if_empty:oTF { \__clist_set_from_seq:w #1 ~ , #1 ~ }
- { \exp_not:n {#1} }
- { \exp_not:n { {#1} } }
- }
-\cs_new:Npn \__clist_set_from_seq:w #1 , #2 ~ { }
-\cs_generate_variant:Nn \clist_set_from_seq:NN { Nc }
-\cs_generate_variant:Nn \clist_set_from_seq:NN { c , cc }
-\cs_generate_variant:Nn \clist_gset_from_seq:NN { Nc }
-\cs_generate_variant:Nn \clist_gset_from_seq:NN { c , cc }
-\cs_new_protected:Npn \clist_const:Nn #1#2
- { \tl_const:Nx #1 { \__clist_trim_spaces:n {#2} } }
-\cs_generate_variant:Nn \clist_const:Nn { c , Nx , cx }
-\prg_new_conditional:Npnn \clist_if_empty:n #1 { p , T , F , TF }
- {
- \__clist_if_empty_n:w ? #1
- , \q_mark \prg_return_false:
- , \q_mark \prg_return_true:
- \q_stop
- }
-\cs_new:Npn \__clist_if_empty_n:w #1 ,
- {
- \tl_if_empty:oTF { \use_none:nn #1 ? }
- { \__clist_if_empty_n:w ? }
- { \__clist_if_empty_n:wNw }
- }
-\cs_new:Npn \__clist_if_empty_n:wNw #1 \q_mark #2#3 \q_stop {#2}
-\fp_new:N \l__coffin_sin_fp
-\fp_new:N \l__coffin_cos_fp
-\prop_new:N \l__coffin_bounding_prop
-\dim_new:N \l__coffin_bounding_shift_dim
-\dim_new:N \l__coffin_left_corner_dim
-\dim_new:N \l__coffin_right_corner_dim
-\dim_new:N \l__coffin_bottom_corner_dim
-\dim_new:N \l__coffin_top_corner_dim
-\cs_new_protected:Npn \coffin_rotate:Nn #1#2
- {
- \fp_set:Nn \l__coffin_sin_fp { sind ( #2 ) }
- \fp_set:Nn \l__coffin_cos_fp { cosd ( #2 ) }
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_rotate_corner:Nnnn #1 {##1} ##2 }
- \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
- { \__coffin_rotate_pole:Nnnnnn #1 {##1} ##2 }
- \__coffin_set_bounding:N #1
- \prop_map_inline:Nn \l__coffin_bounding_prop
- { \__coffin_rotate_bounding:nnn {##1} ##2 }
- \__coffin_find_corner_maxima:N #1
- \__coffin_find_bounding_shift:
- \box_rotate:Nn #1 {#2}
- \hbox_set:Nn \l__coffin_internal_box
- {
- \tex_kern:D
- \__dim_eval:w
- \l__coffin_bounding_shift_dim - \l__coffin_left_corner_dim
- \__dim_eval_end:
- \box_move_down:nn { \l__coffin_bottom_corner_dim }
- { \box_use:N #1 }
- }
- \box_set_ht:Nn \l__coffin_internal_box
- { \l__coffin_top_corner_dim - \l__coffin_bottom_corner_dim }
- \box_set_dp:Nn \l__coffin_internal_box { 0 pt }
- \box_set_wd:Nn \l__coffin_internal_box
- { \l__coffin_right_corner_dim - \l__coffin_left_corner_dim }
- \hbox_set:Nn #1 { \box_use:N \l__coffin_internal_box }
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_shift_corner:Nnnn #1 {##1} ##2 }
- \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
- { \__coffin_shift_pole:Nnnnnn #1 {##1} ##2 }
- }
-\cs_generate_variant:Nn \coffin_rotate:Nn { c }
-\cs_new_protected:Npn \__coffin_set_bounding:N #1
- {
- \prop_put:Nnx \l__coffin_bounding_prop { tl }
- { { 0 pt } { \dim_use:N \box_ht:N #1 } }
- \prop_put:Nnx \l__coffin_bounding_prop { tr }
- { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } }
- \dim_set:Nn \l__coffin_internal_dim { - \box_dp:N #1 }
- \prop_put:Nnx \l__coffin_bounding_prop { bl }
- { { 0 pt } { \dim_use:N \l__coffin_internal_dim } }
- \prop_put:Nnx \l__coffin_bounding_prop { br }
- { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l__coffin_internal_dim } }
- }
-\cs_new_protected:Npn \__coffin_rotate_bounding:nnn #1#2#3
- {
- \__coffin_rotate_vector:nnNN {#2} {#3} \l__coffin_x_dim \l__coffin_y_dim
- \prop_put:Nnx \l__coffin_bounding_prop {#1}
- { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
- }
-\cs_new_protected:Npn \__coffin_rotate_corner:Nnnn #1#2#3#4
- {
- \__coffin_rotate_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
- { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
- }
-\cs_new_protected:Npn \__coffin_rotate_pole:Nnnnnn #1#2#3#4#5#6
- {
- \__coffin_rotate_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
- \__coffin_rotate_vector:nnNN {#5} {#6}
- \l__coffin_x_prime_dim \l__coffin_y_prime_dim
- \__coffin_set_pole:Nnx #1 {#2}
- {
- { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
- { \dim_use:N \l__coffin_x_prime_dim }
- { \dim_use:N \l__coffin_y_prime_dim }
- }
- }
-\cs_new_protected:Npn \__coffin_rotate_vector:nnNN #1#2#3#4
- {
- \dim_set:Nn #3
- {
- \fp_to_dim:n
- {
- \dim_to_fp:n {#1} * \l__coffin_cos_fp
- - ( \dim_to_fp:n {#2} * \l__coffin_sin_fp )
- }
- }
- \dim_set:Nn #4
- {
- \fp_to_dim:n
- {
- \dim_to_fp:n {#1} * \l__coffin_sin_fp
- + ( \dim_to_fp:n {#2} * \l__coffin_cos_fp )
- }
- }
- }
-\cs_new_protected:Npn \__coffin_find_corner_maxima:N #1
- {
- \dim_set:Nn \l__coffin_top_corner_dim { -\c_max_dim }
- \dim_set:Nn \l__coffin_right_corner_dim { -\c_max_dim }
- \dim_set:Nn \l__coffin_bottom_corner_dim { \c_max_dim }
- \dim_set:Nn \l__coffin_left_corner_dim { \c_max_dim }
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_find_corner_maxima_aux:nn ##2 }
- }
-\cs_new_protected:Npn \__coffin_find_corner_maxima_aux:nn #1#2
- {
- \dim_set:Nn \l__coffin_left_corner_dim
- { \dim_min:nn { \l__coffin_left_corner_dim } {#1} }
- \dim_set:Nn \l__coffin_right_corner_dim
- { \dim_max:nn { \l__coffin_right_corner_dim } {#1} }
- \dim_set:Nn \l__coffin_bottom_corner_dim
- { \dim_min:nn { \l__coffin_bottom_corner_dim } {#2} }
- \dim_set:Nn \l__coffin_top_corner_dim
- { \dim_max:nn { \l__coffin_top_corner_dim } {#2} }
- }
-\cs_new_protected_nopar:Npn \__coffin_find_bounding_shift:
- {
- \dim_set:Nn \l__coffin_bounding_shift_dim { \c_max_dim }
- \prop_map_inline:Nn \l__coffin_bounding_prop
- { \__coffin_find_bounding_shift_aux:nn ##2 }
- }
-\cs_new_protected:Npn \__coffin_find_bounding_shift_aux:nn #1#2
- {
- \dim_set:Nn \l__coffin_bounding_shift_dim
- { \dim_min:nn { \l__coffin_bounding_shift_dim } {#1} }
- }
-\cs_new_protected:Npn \__coffin_shift_corner:Nnnn #1#2#3#4
- {
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _ prop } {#2}
- {
- { \dim_eval:n { #3 - \l__coffin_left_corner_dim } }
- { \dim_eval:n { #4 - \l__coffin_bottom_corner_dim } }
- }
- }
-\cs_new_protected:Npn \__coffin_shift_pole:Nnnnnn #1#2#3#4#5#6
- {
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _ prop } {#2}
- {
- { \dim_eval:n { #3 - \l__coffin_left_corner_dim } }
- { \dim_eval:n { #4 - \l__coffin_bottom_corner_dim } }
- {#5} {#6}
- }
- }
-\fp_new:N \l__coffin_scale_x_fp
-\fp_new:N \l__coffin_scale_y_fp
-\dim_new:N \l__coffin_scaled_total_height_dim
-\dim_new:N \l__coffin_scaled_width_dim
-\cs_new_protected:Npn \coffin_resize:Nnn #1#2#3
- {
- \fp_set:Nn \l__coffin_scale_x_fp
- { \dim_to_fp:n {#2} / \dim_to_fp:n { \coffin_wd:N #1 } }
- \fp_set:Nn \l__coffin_scale_y_fp
- {
- \dim_to_fp:n {#3} / \dim_to_fp:n { \coffin_ht:N #1 + \coffin_dp:N #1 }
- }
- \box_resize:Nnn #1 {#2} {#3}
- \__coffin_resize_common:Nnn #1 {#2} {#3}
- }
-\cs_generate_variant:Nn \coffin_resize:Nnn { c }
-\cs_new_protected:Npn \__coffin_resize_common:Nnn #1#2#3
- {
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_scale_corner:Nnnn #1 {##1} ##2 }
- \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
- { \__coffin_scale_pole:Nnnnnn #1 {##1} ##2 }
- \fp_compare:nNnT \l__coffin_scale_x_fp < \c_zero_fp
- {
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_x_shift_corner:Nnnn #1 {##1} ##2 }
- \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
- { \__coffin_x_shift_pole:Nnnnnn #1 {##1} ##2 }
- }
- }
-\cs_new_protected:Npn \coffin_scale:Nnn #1#2#3
- {
- \fp_set:Nn \l__coffin_scale_x_fp {#2}
- \fp_set:Nn \l__coffin_scale_y_fp {#3}
- \box_scale:Nnn #1 { \l__coffin_scale_x_fp } { \l__coffin_scale_y_fp }
- \dim_set:Nn \l__coffin_internal_dim
- { \coffin_ht:N #1 + \coffin_dp:N #1 }
- \dim_set:Nn \l__coffin_scaled_total_height_dim
- { \fp_abs:n { \l__coffin_scale_y_fp } \l__coffin_internal_dim }
- \dim_set:Nn \l__coffin_scaled_width_dim
- { -\fp_abs:n { \l__coffin_scale_x_fp } \coffin_wd:N #1 }
- \__coffin_resize_common:Nnn #1
- { \l__coffin_scaled_width_dim } { \l__coffin_scaled_total_height_dim }
- }
-\cs_generate_variant:Nn \coffin_scale:Nnn { c }
-\cs_new_protected:Npn \__coffin_scale_vector:nnNN #1#2#3#4
- {
- \dim_set:Nn #3
- { \fp_to_dim:n { \dim_to_fp:n {#1} * \l__coffin_scale_x_fp } }
- \dim_set:Nn #4
- { \fp_to_dim:n { \dim_to_fp:n {#2} * \l__coffin_scale_y_fp } }
- }
-\cs_new_protected:Npn \__coffin_scale_corner:Nnnn #1#2#3#4
- {
- \__coffin_scale_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
- { { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim } }
- }
-\cs_new_protected:Npn \__coffin_scale_pole:Nnnnnn #1#2#3#4#5#6
- {
- \__coffin_scale_vector:nnNN {#3} {#4} \l__coffin_x_dim \l__coffin_y_dim
- \__coffin_set_pole:Nnx #1 {#2}
- {
- { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
- {#5} {#6}
- }
- }
-\cs_new_protected:Npn \__coffin_x_shift_corner:Nnnn #1#2#3#4
- {
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } {#2}
- {
- { \dim_eval:n { #3 + \box_wd:N #1 } } {#4}
- }
- }
-\cs_new_protected:Npn \__coffin_x_shift_pole:Nnnnnn #1#2#3#4#5#6
- {
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } {#2}
- {
- { \dim_eval:n #3 + \box_wd:N #1 } {#4}
- {#5} {#6}
- }
- }
-\cs_new_nopar:Npn \ior_map_break:
- { \__prg_map_break:Nn \ior_map_break: { } }
-\cs_new_nopar:Npn \ior_map_break:n
- { \__prg_map_break:Nn \ior_map_break: }
-\cs_new_protected_nopar:Npn \ior_map_inline:Nn
- { \__ior_map_inline:NNn \ior_get:NN }
-\cs_new_protected_nopar:Npn \ior_str_map_inline:Nn
- { \__ior_map_inline:NNn \ior_get_str:NN }
-\cs_new_protected_nopar:Npn \__ior_map_inline:NNn
- {
- \int_gincr:N \g__prg_map_int
- \exp_args:Nc \__ior_map_inline:NNNn
- { __prg_map_ \int_use:N \g__prg_map_int :n }
- }
-\cs_new_protected:Npn \__ior_map_inline:NNNn #1#2#3#4
- {
- \cs_set:Npn #1 ##1 {#4}
- \ior_if_eof:NF #3 { \__ior_map_inline_loop:NNN #1#2#3 }
- \__prg_break_point:Nn \ior_map_break:
- { \int_gdecr:N \g__prg_map_int }
- }
-\cs_new_protected:Npn \__ior_map_inline_loop:NNN #1#2#3
- {
- #2 #3 \l__ior_internal_tl
- \ior_if_eof:NF #3
- {
- \exp_args:No #1 \l__ior_internal_tl
- \__ior_map_inline_loop:NNN #1#2#3
- }
- }
-\tl_new:N \l__ior_internal_tl
-\cs_new_protected:Npn \fp_set_from_dim:Nn #1#2
- { \tl_set:Nx #1 { \dim_to_fp:n {#2} } }
-\cs_new_protected:Npn \fp_gset_from_dim:Nn #1#2
- { \tl_gset:Nx #1 { \dim_to_fp:n {#2} } }
-\cs_generate_variant:Nn \fp_set_from_dim:Nn { c }
-\cs_generate_variant:Nn \fp_gset_from_dim:Nn { c }
-\cs_new:Npn \prop_map_tokens:Nn #1#2
- {
- \exp_last_unbraced:Nno \__prop_map_tokens:nwwn {#2} #1
- \__prop_pair:wn \q_recursion_tail \s__prop { }
- \__prg_break_point:Nn \prop_map_break: { }
- }
-\cs_new:Npn \__prop_map_tokens:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
- {
- \if_meaning:w \q_recursion_tail #3
- \exp_after:wN \prop_map_break:
- \fi:
- \use:n {#1} {#3} {#4}
- \__prop_map_tokens:nwwn {#1}
- }
-\cs_generate_variant:Nn \prop_map_tokens:Nn { c }
-\cs_new:Npn \prop_get:Nn #1#2
- {
- \exp_last_unbraced:Noo \__prop_get_Nn:nwwn { \tl_to_str:n {#2} } #1
- \__prop_pair:wn \tl_to_str:n {#2} \s__prop { }
- \__prg_break_point:
- }
-\cs_new:Npn \__prop_get_Nn:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
- {
- \str_if_eq_x:nnTF {#1} {#3}
- { \__prg_break:n { \exp_not:n {#4} } }
- { \__prop_get_Nn:nwwn {#1} }
- }
-\cs_generate_variant:Nn \prop_get:Nn { c }
-\cs_new:Npn \seq_item:Nn #1
- { \exp_after:wN \__seq_item:wNn #1 \q_stop #1 }
-\cs_new:Npn \__seq_item:wNn \s__seq #1 \q_stop #2#3
- {
- \exp_args:Nf \__seq_item:nnn
- {
- \int_eval:n
- {
- \int_compare:nNnT {#3} < \c_zero
- { \seq_count:N #2 + \c_one + }
- #3
- }
- }
- #1
- { ? \__prg_break: } { }
- \__prg_break_point:
- }
-\cs_new:Npn \__seq_item:nnn #1#2#3
- {
- \use_none:n #2
- \int_compare:nNnTF {#1} = \c_one
- { \__prg_break:n { \exp_not:n {#3} } }
- { \exp_args:Nf \__seq_item:nnn { \int_eval:n { #1 - 1 } } }
- }
-\cs_generate_variant:Nn \seq_item:Nn { c }
-\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
- { \exp_after:wN \__seq_mapthread_function:wNN #2 \q_stop #1 #3 }
-\cs_new:Npn \__seq_mapthread_function:wNN \s__seq #1 \q_stop #2#3
- {
- \exp_after:wN \__seq_mapthread_function:wNw #2 \q_stop #3
- #1 { ? \__prg_break: } { }
- \__prg_break_point:
- }
-\cs_new:Npn \__seq_mapthread_function:wNw \s__seq #1 \q_stop #2
- {
- \__seq_mapthread_function:Nnnwnn #2
- #1 { ? \__prg_break: } { }
- \q_stop
- }
-\cs_new:Npn \__seq_mapthread_function:Nnnwnn #1#2#3#4 \q_stop #5#6
- {
- \use_none:n #2
- \use_none:n #5
- #1 {#3} {#6}
- \__seq_mapthread_function:Nnnwnn #1 #4 \q_stop
- }
-\cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc }
-\cs_generate_variant:Nn \seq_mapthread_function:NNN { c , cc }
-\cs_new_protected:Npn \seq_set_from_clist:NN #1#2
- {
- \tl_set:Nx #1
- { \s__seq \clist_map_function:NN #2 \__seq_wrap_item:n }
- }
-\cs_new_protected:Npn \seq_set_from_clist:Nn #1#2
- {
- \tl_set:Nx #1
- { \s__seq \clist_map_function:nN {#2} \__seq_wrap_item:n }
- }
-\cs_new_protected:Npn \seq_gset_from_clist:NN #1#2
- {
- \tl_gset:Nx #1
- { \s__seq \clist_map_function:NN #2 \__seq_wrap_item:n }
- }
-\cs_new_protected:Npn \seq_gset_from_clist:Nn #1#2
- {
- \tl_gset:Nx #1
- { \s__seq \clist_map_function:nN {#2} \__seq_wrap_item:n }
- }
-\cs_generate_variant:Nn \seq_set_from_clist:NN { Nc }
-\cs_generate_variant:Nn \seq_set_from_clist:NN { c , cc }
-\cs_generate_variant:Nn \seq_set_from_clist:Nn { c }
-\cs_generate_variant:Nn \seq_gset_from_clist:NN { Nc }
-\cs_generate_variant:Nn \seq_gset_from_clist:NN { c , cc }
-\cs_generate_variant:Nn \seq_gset_from_clist:Nn { c }
-\cs_new_protected_nopar:Npn \seq_reverse:N
- { \__seq_reverse:NN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \seq_greverse:N
- { \__seq_reverse:NN \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_reverse:NN #1 #2
- {
- \cs_set_eq:NN \__seq_tmp:w \__seq_item:n
- \cs_set_eq:NN \__seq_item:n \__seq_reverse_item:nwn
- #1 #2 { #2 \exp_not:n { } }
- \cs_set_eq:NN \__seq_item:n \__seq_tmp:w
- }
-\cs_new:Npn \__seq_reverse_item:nwn #1 #2 \exp_not:n #3
- {
- #2
- \exp_not:n { \__seq_item:n {#1} #3 }
- }
-\cs_generate_variant:Nn \seq_reverse:N { c }
-\cs_generate_variant:Nn \seq_greverse:N { c }
-\cs_new_protected_nopar:Npn \seq_set_filter:NNn
- { \__seq_set_filter:NNNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \seq_gset_filter:NNn
- { \__seq_set_filter:NNNn \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_set_filter:NNNn #1#2#3#4
- {
- \__seq_push_item_def:n { \bool_if:nT {#4} { \__seq_wrap_item:n {##1} } }
- #1 #2 { #3 }
- \__seq_pop_item_def:
- }
-\cs_new_protected_nopar:Npn \seq_set_map:NNn
- { \__seq_set_map:NNNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \seq_gset_map:NNn
- { \__seq_set_map:NNNn \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_set_map:NNNn #1#2#3#4
- {
- \__seq_push_item_def:n { \exp_not:N \__seq_item:n {#4} }
- #1 #2 { #3 }
- \__seq_pop_item_def:
- }
-\cs_new_eq:NN \dim_to_pt:n \__dim_strip_pt:n
-\cs_new:Npn \dim_to_unit:nn #1#2
- {
- \dim_to_pt:n
- {
- 1pt * \__dim_to_unit:n { \dim_to_pt:n {#1} pt }
- / \__dim_to_unit:n { \dim_to_pt:n {#2} pt }
- }
- }
-\cs_new:Npn \__dim_to_unit:n #1
- { \__int_value:w \__dim_eval:w #1 \__dim_eval_end: }
-\cs_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4
- {
- \skip_if_finite:nTF {#1}
- {
- #3 = \etex_gluestretch:D #1 \scan_stop:
- #4 = \etex_glueshrink:D #1 \scan_stop:
- }
- {
- #3 = \c_zero_skip
- #4 = \c_zero_skip
- #2
- }
- }
-\prg_new_conditional:Npnn \tl_if_single_token:n #1 { p , T , F , TF }
- {
- \tl_if_head_is_N_type:nTF {#1}
- { \__str_if_eq_x_return:nn { \exp_not:o { \use_none:n #1 } } { } }
- { \__str_if_eq_x_return:nn { \exp_not:n {#1} } { ~ } }
- }
-\cs_new:Npn \tl_reverse_tokens:n #1
- {
- \etex_unexpanded:D \exp_after:wN
- {
- \tex_romannumeral:D
- \__tl_act:NNNnn
- \__tl_reverse_normal:nN
- \__tl_reverse_group:nn
- \__tl_reverse_space:n
- { }
- {#1}
- }
- }
-\cs_new:Npn \__tl_reverse_group:nn #1
- {
- \__tl_act_group_recurse:Nnn
- \__tl_act_reverse_output:n
- { \tl_reverse_tokens:n }
- }
-\cs_new:Npn \__tl_act_group_recurse:Nnn #1#2#3
- {
- \exp_args:Nf #1
- { \exp_after:wN \exp_after:wN \exp_after:wN { #2 {#3} } }
- }
-\cs_new:Npn \tl_count_tokens:n #1
- {
- \int_eval:n
- {
- \__tl_act:NNNnn
- \__tl_act_count_normal:nN
- \__tl_act_count_group:nn
- \__tl_act_count_space:n
- { }
- {#1}
- }
- }
-\cs_new:Npn \__tl_act_count_normal:nN #1 #2 { 1 + }
-\cs_new:Npn \__tl_act_count_space:n #1 { 1 + }
-\cs_new:Npn \__tl_act_count_group:nn #1 #2
- { 2 + \tl_count_tokens:n {#2} + }
-\tl_const:Nn \c__tl_act_uppercase_tl
- {
- aA bB cC dD eE fF gG hH iI jJ kK lL mM
- nN oO pP qQ rR sS tT uU vV wW xX yY zZ
- }
-\tl_const:Nn \c__tl_act_lowercase_tl
- {
- Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm
- Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz
- }
-\cs_new:Npn \tl_expandable_uppercase:n #1
- {
- \etex_unexpanded:D \exp_after:wN
- {
- \tex_romannumeral:D
- \__tl_act_case_aux:nn { \c__tl_act_uppercase_tl } {#1}
- }
- }
-\cs_new:Npn \tl_expandable_lowercase:n #1
- {
- \etex_unexpanded:D \exp_after:wN
- {
- \tex_romannumeral:D
- \__tl_act_case_aux:nn { \c__tl_act_lowercase_tl } {#1}
- }
- }
-\cs_new:Npn \__tl_act_case_aux:nn
- {
- \__tl_act:NNNnn
- \__tl_act_case_normal:nN
- \__tl_act_case_group:nn
- \__tl_act_case_space:n
- }
-\cs_new:Npn \__tl_act_case_space:n #1 { \__tl_act_output:n {~} }
-\cs_new:Npn \__tl_act_case_normal:nN #1 #2
- {
- \exp_args:Nf \__tl_act_output:n
- {
- \exp_args:NNo \str_case:nnF #2 {#1}
- { \exp_stop_f: #2 }
- }
- }
-\cs_new:Npn \__tl_act_case_group:nn #1 #2
- {
- \exp_after:wN \__tl_act_output:n \exp_after:wN
- { \exp_after:wN { \tex_romannumeral:D \__tl_act_case_aux:nn {#1} {#2} } }
- }
-\cs_new:Npn \tl_item:nn #1#2
- {
- \exp_args:Nf \__tl_item:nn
- {
- \int_eval:n
- {
- \int_compare:nNnT {#2} < \c_zero
- { \tl_count:n {#1} + \c_one + }
- #2
- }
- }
- #1
- \q_recursion_tail
- \__prg_break_point:
- }
-\cs_new:Npn \__tl_item:nn #1#2
- {
- \__quark_if_recursion_tail_break:nN {#2} \__prg_break:
- \int_compare:nNnTF {#1} = \c_one
- { \__prg_break:n { \exp_not:n {#2} } }
- { \exp_args:Nf \__tl_item:nn { \int_eval:n { #1 - 1 } } }
- }
-\cs_new_nopar:Npn \tl_item:Nn { \exp_args:No \tl_item:nn }
-\cs_generate_variant:Nn \tl_item:Nn { c }
-\group_begin:
- \char_set_catcode_active:N \^^@
- \cs_set:Npn \char_tmp:NN #1#2
- {
- \cs_new:Npn #1 ##1
- {
- \char_set_catcode_active:n { `##1 }
- \group_begin:
- \char_set_lccode:nn { `\^^@ } { `##1 }
- \tl_to_lowercase:n { \group_end: #2 ^^@ }
- }
- }
- \char_tmp:NN \char_set_active:Npn \cs_set:Npn
- \char_tmp:NN \char_set_active:Npx \cs_set:Npx
- \char_tmp:NN \char_gset_active:Npn \cs_gset:Npn
- \char_tmp:NN \char_gset_active:Npx \cs_gset:Npx
- \char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN
- \char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN
-\group_end:
-\group_begin:
- \char_set_catcode_other:N \O
- \char_set_catcode_other:N \U
- \char_set_catcode_other:N \T
- \char_set_catcode_other:N \E
- \char_set_catcode_other:N \R
- \tl_to_lowercase:n
- {
- \cs_new_protected_nopar:Npn \__peek_execute_branches_N_type:
- {
- \if_int_odd:w
- \if_catcode:w \exp_not:N \l_peek_token { \c_two \fi:
- \if_catcode:w \exp_not:N \l_peek_token } \c_two \fi:
- \if_meaning:w \l_peek_token \c_space_token \c_two \fi:
- \c_one
- \exp_after:wN \__peek_N_type:w
- \token_to_meaning:N \l_peek_token
- \q_mark \__peek_N_type_aux:nnw
- OUTER \q_mark \use_none_delimit_by_q_stop:w
- \q_stop
- \exp_after:wN \__peek_true:w
- \else:
- \exp_after:wN \__peek_false:w
- \fi:
- }
- \cs_new_protected:Npn \__peek_N_type:w #1 OUTER #2 \q_mark #3
- { #3 {#1} {#2} }
- }
-\group_end:
-\cs_new_protected:Npn \__peek_N_type_aux:nnw #1 #2 #3 \fi:
- {
- \fi:
- \tl_if_in:noTF {#1} { \tl_to_str:n {ma} }
- { \__peek_true:w }
- { \tl_if_empty:nTF {#2} { \__peek_true:w } { \__peek_false:w } }
- }
-\cs_new_protected_nopar:Npn \peek_N_type:TF
- { \__peek_token_generic:NNTF \__peek_execute_branches_N_type: \scan_stop: }
-\cs_new_protected_nopar:Npn \peek_N_type:T
- { \__peek_token_generic:NNT \__peek_execute_branches_N_type: \scan_stop: }
-\cs_new_protected_nopar:Npn \peek_N_type:F
- { \__peek_token_generic:NNF \__peek_execute_branches_N_type: \scan_stop: }
-%%
-%%
-%% End of file `l3candidates.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty b/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty
deleted file mode 100644
index 5c066bd8b3e..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3clist.sty
+++ /dev/null
@@ -1,461 +0,0 @@
-%%
-%% This is file `l3clist.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3clist.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach,
-%% The LaTeX3 project
-%% (C) 2012,2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3clist.dtx 4581 2013-07-28 08:38:50Z joseph $
- {L3 Comma separated lists}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_eq:NN \c_empty_clist \c_empty_tl
-\tl_new:N \l__clist_internal_clist
-\cs_new_protected:Npn \__clist_tmp:w { }
-\cs_new_eq:NN \clist_new:N \tl_new:N
-\cs_new_eq:NN \clist_new:c \tl_new:c
-\cs_new_eq:NN \clist_clear:N \tl_clear:N
-\cs_new_eq:NN \clist_clear:c \tl_clear:c
-\cs_new_eq:NN \clist_gclear:N \tl_gclear:N
-\cs_new_eq:NN \clist_gclear:c \tl_gclear:c
-\cs_new_eq:NN \clist_clear_new:N \tl_clear_new:N
-\cs_new_eq:NN \clist_clear_new:c \tl_clear_new:c
-\cs_new_eq:NN \clist_gclear_new:N \tl_gclear_new:N
-\cs_new_eq:NN \clist_gclear_new:c \tl_gclear_new:c
-\cs_new_eq:NN \clist_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \clist_set_eq:Nc \tl_set_eq:Nc
-\cs_new_eq:NN \clist_set_eq:cN \tl_set_eq:cN
-\cs_new_eq:NN \clist_set_eq:cc \tl_set_eq:cc
-\cs_new_eq:NN \clist_gset_eq:NN \tl_gset_eq:NN
-\cs_new_eq:NN \clist_gset_eq:Nc \tl_gset_eq:Nc
-\cs_new_eq:NN \clist_gset_eq:cN \tl_gset_eq:cN
-\cs_new_eq:NN \clist_gset_eq:cc \tl_gset_eq:cc
-\cs_new_protected_nopar:Npn \clist_concat:NNN
- { \__clist_concat:NNNN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \clist_gconcat:NNN
- { \__clist_concat:NNNN \tl_gset:Nx }
-\cs_new_protected:Npn \__clist_concat:NNNN #1#2#3#4
- {
- #1 #2
- {
- \exp_not:o #3
- \clist_if_empty:NF #3 { \clist_if_empty:NF #4 { , } }
- \exp_not:o #4
- }
- }
-\cs_generate_variant:Nn \clist_concat:NNN { ccc }
-\cs_generate_variant:Nn \clist_gconcat:NNN { ccc }
-\prg_new_eq_conditional:NNn \clist_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \clist_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new:Npn \__clist_trim_spaces_generic:nw #1#2 ,
- {
- \__tl_trim_spaces:nn {#2}
- { \exp_args:No \__clist_trim_spaces_generic:nn } {#1}
- }
-\cs_new:Npn \__clist_trim_spaces_generic:nn #1#2 { #2 {#1} }
-\cs_new:Npn \__clist_trim_spaces:n #1
- {
- \__clist_trim_spaces_generic:nw
- { \__clist_trim_spaces:nn { } }
- \q_mark #1 ,
- \q_recursion_tail, \q_recursion_stop
- }
-\cs_new:Npn \__clist_trim_spaces:nn #1 #2
- {
- \quark_if_recursion_tail_stop:n {#2}
- \tl_if_empty:nTF {#2}
- {
- \__clist_trim_spaces_generic:nw
- { \__clist_trim_spaces:nn {#1} } \q_mark
- }
- {
- #1 \exp_not:n {#2}
- \__clist_trim_spaces_generic:nw
- { \__clist_trim_spaces:nn { , } } \q_mark
- }
- }
-\cs_new_protected:Npn \clist_set:Nn #1#2
- { \tl_set:Nx #1 { \__clist_trim_spaces:n {#2} } }
-\cs_new_protected:Npn \clist_gset:Nn #1#2
- { \tl_gset:Nx #1 { \__clist_trim_spaces:n {#2} } }
-\cs_generate_variant:Nn \clist_set:Nn { NV , No , Nx , c , cV , co , cx }
-\cs_generate_variant:Nn \clist_gset:Nn { NV , No , Nx , c , cV , co , cx }
-\cs_new_protected_nopar:Npn \clist_put_left:Nn
- { \__clist_put_left:NNNn \clist_concat:NNN \clist_set:Nn }
-\cs_new_protected_nopar:Npn \clist_gput_left:Nn
- { \__clist_put_left:NNNn \clist_gconcat:NNN \clist_set:Nn }
-\cs_new_protected:Npn \__clist_put_left:NNNn #1#2#3#4
- {
- #2 \l__clist_internal_clist {#4}
- #1 #3 \l__clist_internal_clist #3
- }
-\cs_generate_variant:Nn \clist_put_left:Nn { NV , No , Nx }
-\cs_generate_variant:Nn \clist_put_left:Nn { c , cV , co , cx }
-\cs_generate_variant:Nn \clist_gput_left:Nn { NV , No , Nx }
-\cs_generate_variant:Nn \clist_gput_left:Nn { c , cV , co , cx }
-\cs_new_protected_nopar:Npn \clist_put_right:Nn
- { \__clist_put_right:NNNn \clist_concat:NNN \clist_set:Nn }
-\cs_new_protected_nopar:Npn \clist_gput_right:Nn
- { \__clist_put_right:NNNn \clist_gconcat:NNN \clist_set:Nn }
-\cs_new_protected:Npn \__clist_put_right:NNNn #1#2#3#4
- {
- #2 \l__clist_internal_clist {#4}
- #1 #3 #3 \l__clist_internal_clist
- }
-\cs_generate_variant:Nn \clist_put_right:Nn { NV , No , Nx }
-\cs_generate_variant:Nn \clist_put_right:Nn { c , cV , co , cx }
-\cs_generate_variant:Nn \clist_gput_right:Nn { NV , No , Nx }
-\cs_generate_variant:Nn \clist_gput_right:Nn { c , cV , co , cx }
-\cs_new_protected:Npn \clist_get:NN #1#2
- {
- \if_meaning:w #1 \c_empty_clist
- \tl_set:Nn #2 { \q_no_value }
- \else:
- \exp_after:wN \__clist_get:wN #1 , \q_stop #2
- \fi:
- }
-\cs_new_protected:Npn \__clist_get:wN #1 , #2 \q_stop #3
- { \tl_set:Nn #3 {#1} }
-\cs_generate_variant:Nn \clist_get:NN { c }
-\cs_new_protected_nopar:Npn \clist_pop:NN
- { \__clist_pop:NNN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \clist_gpop:NN
- { \__clist_pop:NNN \tl_gset:Nx }
-\cs_new_protected:Npn \__clist_pop:NNN #1#2#3
- {
- \if_meaning:w #2 \c_empty_clist
- \tl_set:Nn #3 { \q_no_value }
- \else:
- \exp_after:wN \__clist_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
- \fi:
- }
-\cs_new_protected:Npn \__clist_pop:wwNNN #1 , #2 \q_stop #3#4#5
- {
- \tl_set:Nn #5 {#1}
- #3 #4
- {
- \__clist_pop:wN \prg_do_nothing:
- #2 \exp_not:o
- , \q_mark \use_none:n
- \q_stop
- }
- }
-\cs_new:Npn \__clist_pop:wN #1 , \q_mark #2 #3 \q_stop { #2 {#1} }
-\cs_generate_variant:Nn \clist_pop:NN { c }
-\cs_generate_variant:Nn \clist_gpop:NN { c }
-\prg_new_protected_conditional:Npnn \clist_get:NN #1#2 { T , F , TF }
- {
- \if_meaning:w #1 \c_empty_clist
- \prg_return_false:
- \else:
- \exp_after:wN \__clist_get:wN #1 , \q_stop #2
- \prg_return_true:
- \fi:
- }
-\cs_generate_variant:Nn \clist_get:NNT { c }
-\cs_generate_variant:Nn \clist_get:NNF { c }
-\cs_generate_variant:Nn \clist_get:NNTF { c }
-\prg_new_protected_conditional:Npnn \clist_pop:NN #1#2 { T , F , TF }
- { \__clist_pop_TF:NNN \tl_set:Nx #1 #2 }
-\prg_new_protected_conditional:Npnn \clist_gpop:NN #1#2 { T , F , TF }
- { \__clist_pop_TF:NNN \tl_gset:Nx #1 #2 }
-\cs_new_protected:Npn \__clist_pop_TF:NNN #1#2#3
- {
- \if_meaning:w #2 \c_empty_clist
- \prg_return_false:
- \else:
- \exp_after:wN \__clist_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
- \prg_return_true:
- \fi:
- }
-\cs_generate_variant:Nn \clist_pop:NNT { c }
-\cs_generate_variant:Nn \clist_pop:NNF { c }
-\cs_generate_variant:Nn \clist_pop:NNTF { c }
-\cs_generate_variant:Nn \clist_gpop:NNT { c }
-\cs_generate_variant:Nn \clist_gpop:NNF { c }
-\cs_generate_variant:Nn \clist_gpop:NNTF { c }
-\cs_new_eq:NN \clist_push:Nn \clist_put_left:Nn
-\cs_new_eq:NN \clist_push:NV \clist_put_left:NV
-\cs_new_eq:NN \clist_push:No \clist_put_left:No
-\cs_new_eq:NN \clist_push:Nx \clist_put_left:Nx
-\cs_new_eq:NN \clist_push:cn \clist_put_left:cn
-\cs_new_eq:NN \clist_push:cV \clist_put_left:cV
-\cs_new_eq:NN \clist_push:co \clist_put_left:co
-\cs_new_eq:NN \clist_push:cx \clist_put_left:cx
-\cs_new_eq:NN \clist_gpush:Nn \clist_gput_left:Nn
-\cs_new_eq:NN \clist_gpush:NV \clist_gput_left:NV
-\cs_new_eq:NN \clist_gpush:No \clist_gput_left:No
-\cs_new_eq:NN \clist_gpush:Nx \clist_gput_left:Nx
-\cs_new_eq:NN \clist_gpush:cn \clist_gput_left:cn
-\cs_new_eq:NN \clist_gpush:cV \clist_gput_left:cV
-\cs_new_eq:NN \clist_gpush:co \clist_gput_left:co
-\cs_new_eq:NN \clist_gpush:cx \clist_gput_left:cx
-\clist_new:N \l__clist_internal_remove_clist
-\cs_new_protected:Npn \clist_remove_duplicates:N
- { \__clist_remove_duplicates:NN \clist_set_eq:NN }
-\cs_new_protected:Npn \clist_gremove_duplicates:N
- { \__clist_remove_duplicates:NN \clist_gset_eq:NN }
-\cs_new_protected:Npn \__clist_remove_duplicates:NN #1#2
- {
- \clist_clear:N \l__clist_internal_remove_clist
- \clist_map_inline:Nn #2
- {
- \clist_if_in:NnF \l__clist_internal_remove_clist {##1}
- { \clist_put_right:Nn \l__clist_internal_remove_clist {##1} }
- }
- #1 #2 \l__clist_internal_remove_clist
- }
-\cs_generate_variant:Nn \clist_remove_duplicates:N { c }
-\cs_generate_variant:Nn \clist_gremove_duplicates:N { c }
-\cs_new_protected:Npn \clist_remove_all:Nn
- { \__clist_remove_all:NNn \tl_set:Nx }
-\cs_new_protected:Npn \clist_gremove_all:Nn
- { \__clist_remove_all:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \__clist_remove_all:NNn #1#2#3
- {
- \cs_set:Npn \__clist_tmp:w ##1 , #3 ,
- {
- ##1
- , \q_mark , \use_none_delimit_by_q_stop:w ,
- \__clist_remove_all:
- }
- #1 #2
- {
- \exp_after:wN \__clist_remove_all:
- #2 , \q_mark , #3 , \q_stop
- }
- \clist_if_empty:NF #2
- {
- #1 #2
- {
- \exp_args:No \exp_not:o
- { \exp_after:wN \use_none:n #2 }
- }
- }
- }
-\cs_new:Npn \__clist_remove_all:
- { \exp_after:wN \__clist_remove_all:w \__clist_tmp:w , }
-\cs_new:Npn \__clist_remove_all:w #1 , \q_mark , #2 , { \exp_not:n {#1} }
-\cs_generate_variant:Nn \clist_remove_all:Nn { c }
-\cs_generate_variant:Nn \clist_gremove_all:Nn { c }
-\prg_new_eq_conditional:NNn \clist_if_empty:N \tl_if_empty:N { p , T , F , TF }
-\prg_new_eq_conditional:NNn \clist_if_empty:c \tl_if_empty:c { p , T , F , TF }
-\prg_new_protected_conditional:Npnn \clist_if_in:Nn #1#2 { T , F , TF }
- {
- \exp_args:No \__clist_if_in_return:nn #1 {#2}
- }
-\prg_new_protected_conditional:Npnn \clist_if_in:nn #1#2 { T , F , TF }
- {
- \clist_set:Nn \l__clist_internal_clist {#1}
- \exp_args:No \__clist_if_in_return:nn \l__clist_internal_clist {#2}
- }
-\cs_new_protected:Npn \__clist_if_in_return:nn #1#2
- {
- \cs_set:Npn \__clist_tmp:w ##1 ,#2, { }
- \tl_if_empty:oTF
- { \__clist_tmp:w ,#1, {} {} ,#2, }
- { \prg_return_false: } { \prg_return_true: }
- }
-\cs_generate_variant:Nn \clist_if_in:NnT { NV , No }
-\cs_generate_variant:Nn \clist_if_in:NnT { c , cV , co }
-\cs_generate_variant:Nn \clist_if_in:NnF { NV , No }
-\cs_generate_variant:Nn \clist_if_in:NnF { c , cV , co }
-\cs_generate_variant:Nn \clist_if_in:NnTF { NV , No }
-\cs_generate_variant:Nn \clist_if_in:NnTF { c , cV , co }
-\cs_generate_variant:Nn \clist_if_in:nnT { nV , no }
-\cs_generate_variant:Nn \clist_if_in:nnF { nV , no }
-\cs_generate_variant:Nn \clist_if_in:nnTF { nV , no }
-\cs_new:Npn \clist_map_function:NN #1#2
- {
- \clist_if_empty:NF #1
- {
- \exp_last_unbraced:NNo \__clist_map_function:Nw #2 #1
- , \q_recursion_tail ,
- \__prg_break_point:Nn \clist_map_break: { }
- }
- }
-\cs_new:Npn \__clist_map_function:Nw #1#2 ,
- {
- \__quark_if_recursion_tail_break:nN {#2} \clist_map_break:
- #1 {#2}
- \__clist_map_function:Nw #1
- }
-\cs_generate_variant:Nn \clist_map_function:NN { c }
-\cs_new:Npn \clist_map_function:nN #1#2
- {
- \__clist_trim_spaces_generic:nw { \__clist_map_function_n:Nn #2 }
- \q_mark #1, \q_recursion_tail,
- \__prg_break_point:Nn \clist_map_break: { }
- }
-\cs_new:Npn \__clist_map_function_n:Nn #1 #2
- {
- \__quark_if_recursion_tail_break:nN {#2} \clist_map_break:
- \tl_if_empty:nF {#2} { \__clist_map_unbrace:Nw #1 #2, }
- \__clist_trim_spaces_generic:nw { \__clist_map_function_n:Nn #1 }
- \q_mark
- }
-\cs_new:Npn \__clist_map_unbrace:Nw #1 #2, { #1 {#2} }
-\cs_new_protected:Npn \clist_map_inline:Nn #1#2
- {
- \clist_if_empty:NF #1
- {
- \int_gincr:N \g__prg_map_int
- \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
- \exp_last_unbraced:Nco \__clist_map_function:Nw
- { __prg_map_ \int_use:N \g__prg_map_int :w }
- #1 , \q_recursion_tail ,
- \__prg_break_point:Nn \clist_map_break:
- { \int_gdecr:N \g__prg_map_int }
- }
- }
-\cs_new_protected:Npn \clist_map_inline:nn #1
- {
- \clist_set:Nn \l__clist_internal_clist {#1}
- \clist_map_inline:Nn \l__clist_internal_clist
- }
-\cs_generate_variant:Nn \clist_map_inline:Nn { c }
-\cs_new_protected:Npn \clist_map_variable:NNn #1#2#3
- {
- \clist_if_empty:NF #1
- {
- \exp_args:Nno \use:nn
- { \__clist_map_variable:Nnw #2 {#3} }
- #1
- , \q_recursion_tail , \q_recursion_stop
- \__prg_break_point:Nn \clist_map_break: { }
- }
- }
-\cs_new_protected:Npn \clist_map_variable:nNn #1
- {
- \clist_set:Nn \l__clist_internal_clist {#1}
- \clist_map_variable:NNn \l__clist_internal_clist
- }
-\cs_new_protected:Npn \__clist_map_variable:Nnw #1#2#3,
- {
- \tl_set:Nn #1 {#3}
- \quark_if_recursion_tail_stop:N #1
- \use:n {#2}
- \__clist_map_variable:Nnw #1 {#2}
- }
-\cs_generate_variant:Nn \clist_map_variable:NNn { c }
-\cs_new_nopar:Npn \clist_map_break:
- { \__prg_map_break:Nn \clist_map_break: { } }
-\cs_new_nopar:Npn \clist_map_break:n
- { \__prg_map_break:Nn \clist_map_break: }
-\cs_new:Npn \clist_count:N #1
- {
- \int_eval:n
- {
- 0
- \clist_map_function:NN #1 \__clist_count:n
- }
- }
-\cs_generate_variant:Nn \clist_count:N { c }
-\cs_new:Npx \clist_count:n #1
- {
- \exp_not:N \int_eval:n
- {
- 0
- \exp_not:N \__clist_count:w \c_space_tl
- #1 \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
- }
- }
-\cs_new:Npn \__clist_count:n #1 { + \c_one }
-\cs_new:Npx \__clist_count:w #1 ,
- {
- \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1}
- \exp_not:N \tl_if_blank:nF {#1} { + \c_one }
- \exp_not:N \__clist_count:w \c_space_tl
- }
-\cs_new:Npn \clist_use:Nnnn #1#2#3#4
- {
- \clist_if_exist:NTF #1
- {
- \int_case:nnF { \clist_count:N #1 }
- {
- { 0 } { }
- { 1 } { \exp_after:wN \__clist_use:wwn #1 , , { } }
- { 2 } { \exp_after:wN \__clist_use:wwn #1 , {#2} }
- }
- {
- \exp_after:wN \__clist_use:nwwwwnwn
- \exp_after:wN { \exp_after:wN } #1 ,
- \q_mark , { \__clist_use:nwwwwnwn {#3} }
- \q_mark , { \__clist_use:nwwn {#4} }
- \q_stop { }
- }
- }
- { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
- }
-\cs_generate_variant:Nn \clist_use:Nnnn { c }
-\cs_new:Npn \__clist_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } }
-\cs_new:Npn \__clist_use:nwwwwnwn
- #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8
- { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } }
-\cs_new:Npn \__clist_use:nwwn #1#2 , #3 \q_stop #4
- { \exp_not:n { #4 #1 #2 } }
-\cs_new:Npn \clist_use:Nn #1#2
- { \clist_use:Nnnn #1 {#2} {#2} {#2} }
-\cs_generate_variant:Nn \clist_use:Nn { c }
-\cs_new_protected:Npn \clist_show:N #1
- {
- \__msg_show_variable:Nnn #1 { clist }
- { \clist_map_function:NN #1 \__msg_show_item:n }
- }
-\cs_new_protected:Npn \clist_show:n #1
- {
- \clist_set:Nn \l__clist_internal_clist {#1}
- \clist_show:N \l__clist_internal_clist
- }
-\cs_generate_variant:Nn \clist_show:N { c }
-\clist_new:N \l_tmpa_clist
-\clist_new:N \l_tmpb_clist
-\clist_new:N \g_tmpa_clist
-\clist_new:N \g_tmpb_clist
-%%
-%%
-%% End of file `l3clist.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty b/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty
deleted file mode 100644
index e19b0b20e62..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3coffins.sty
+++ /dev/null
@@ -1,847 +0,0 @@
-%%
-%% This is file `l3coffins.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3coffins.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3coffins.dtx Copyright(C) 2010-2012 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3coffins.dtx 4624 2013-12-14 13:58:48Z bruno $
- {L3 Coffin code layer}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\box_new:N \l__coffin_internal_box
-\dim_new:N \l__coffin_internal_dim
-\tl_new:N \l__coffin_internal_tl
-\prop_new:N \c__coffin_corners_prop
-\prop_put:Nnn \c__coffin_corners_prop { tl } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { tr } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { bl } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { br } { { 0 pt } { 0 pt } }
-\prop_new:N \c__coffin_poles_prop
-\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } }
-\prop_put:Nno \c__coffin_poles_prop { l } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { hc } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { r } { \l__coffin_internal_tl }
-\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } }
-\prop_put:Nno \c__coffin_poles_prop { b } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { vc } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { t } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { B } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { H } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { T } { \l__coffin_internal_tl }
-\fp_new:N \l__coffin_slope_x_fp
-\fp_new:N \l__coffin_slope_y_fp
-\bool_new:N \l__coffin_error_bool
-\dim_new:N \l__coffin_offset_x_dim
-\dim_new:N \l__coffin_offset_y_dim
-\tl_new:N \l__coffin_pole_a_tl
-\tl_new:N \l__coffin_pole_b_tl
-\dim_new:N \l__coffin_x_dim
-\dim_new:N \l__coffin_y_dim
-\dim_new:N \l__coffin_x_prime_dim
-\dim_new:N \l__coffin_y_prime_dim
-\prg_new_conditional:Npnn \coffin_if_exist:N #1 { p , T , F , TF }
- {
- \cs_if_exist:NTF #1
- {
- \cs_if_exist:cTF { l__coffin_poles_ \__int_value:w #1 _prop }
- { \prg_return_true: }
- { \prg_return_false: }
- }
- { \prg_return_false: }
- }
-\cs_generate_variant:Nn \coffin_if_exist_p:N { c }
-\cs_generate_variant:Nn \coffin_if_exist:NT { c }
-\cs_generate_variant:Nn \coffin_if_exist:NF { c }
-\cs_generate_variant:Nn \coffin_if_exist:NTF { c }
-\cs_new_protected:Npn \__coffin_if_exist:NT #1#2
- {
- \coffin_if_exist:NTF #1
- { #2 }
- {
- \__msg_kernel_error:nnx { kernel } { unknown-coffin }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \coffin_clear:N #1
- {
- \__coffin_if_exist:NT #1
- {
- \box_clear:N #1
- \__coffin_reset_structure:N #1
- }
- }
-\cs_generate_variant:Nn \coffin_clear:N { c }
-\cs_new_protected:Npn \coffin_new:N #1
- {
- \box_new:N #1
- \prop_clear_new:c { l__coffin_corners_ \__int_value:w #1 _prop }
- \prop_clear_new:c { l__coffin_poles_ \__int_value:w #1 _prop }
- \prop_gset_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
- \c__coffin_corners_prop
- \prop_gset_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
- \c__coffin_poles_prop
- }
-\cs_generate_variant:Nn \coffin_new:N { c }
-\cs_new_protected:Npn \hcoffin_set:Nn #1#2
- {
- \__coffin_if_exist:NT #1
- {
- \hbox_set:Nn #1
- {
- \color_group_begin:
- \color_ensure_current:
- #2
- \color_group_end:
- }
- \__coffin_reset_structure:N #1
- \__coffin_update_poles:N #1
- \__coffin_update_corners:N #1
- }
- }
-\cs_generate_variant:Nn \hcoffin_set:Nn { c }
-\cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3
- {
- \__coffin_if_exist:NT #1
- {
- \vbox_set:Nn #1
- {
- \dim_set:Nn \tex_hsize:D {#2}
- \dim_set_eq:NN \linewidth \tex_hsize:D
- \dim_set_eq:NN \columnwidth \tex_hsize:D
- \color_group_begin:
- #3
- \color_group_end:
- }
- \__coffin_reset_structure:N #1
- \__coffin_update_poles:N #1
- \__coffin_update_corners:N #1
- \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
- \__coffin_set_pole:Nnx #1 { T }
- {
- { 0 pt }
- { \dim_eval:n { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box } }
- { 1000 pt }
- { 0 pt }
- }
- \box_clear:N \l__coffin_internal_box
- }
- }
-\cs_generate_variant:Nn \vcoffin_set:Nnn { c }
-\cs_new_protected:Npn \hcoffin_set:Nw #1
- {
- \__coffin_if_exist:NT #1
- {
- \hbox_set:Nw #1 \color_group_begin: \color_ensure_current:
- \cs_set_protected_nopar:Npn \hcoffin_set_end:
- {
- \color_group_end:
- \hbox_set_end:
- \__coffin_reset_structure:N #1
- \__coffin_update_poles:N #1
- \__coffin_update_corners:N #1
- }
- }
- }
-\cs_new_protected_nopar:Npn \hcoffin_set_end: { }
-\cs_generate_variant:Nn \hcoffin_set:Nw { c }
-\cs_new_protected:Npn \vcoffin_set:Nnw #1#2
- {
- \__coffin_if_exist:NT #1
- {
- \vbox_set:Nw #1
- \dim_set:Nn \tex_hsize:D {#2}
- \dim_set_eq:NN \linewidth \tex_hsize:D
- \dim_set_eq:NN \columnwidth \tex_hsize:D
- \color_group_begin: \color_ensure_current:
- \cs_set_protected:Npn \vcoffin_set_end:
- {
- \color_group_end:
- \vbox_set_end:
- \__coffin_reset_structure:N #1
- \__coffin_update_poles:N #1
- \__coffin_update_corners:N #1
- \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
- \__coffin_set_pole:Nnx #1 { T }
- {
- { 0 pt }
- {
- \dim_eval:n { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
- }
- { 1000 pt }
- { 0 pt }
- }
- \box_clear:N \l__coffin_internal_box
- }
- }
- }
-\cs_new_protected_nopar:Npn \vcoffin_set_end: { }
-\cs_generate_variant:Nn \vcoffin_set:Nnw { c }
-\cs_new_protected:Npn \coffin_set_eq:NN #1#2
- {
- \__coffin_if_exist:NT #1
- {
- \box_set_eq:NN #1 #2
- \__coffin_set_eq_structure:NN #1 #2
- }
- }
-\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc }
-\coffin_new:N \c_empty_coffin
-\hbox_set:Nn \c_empty_coffin { }
-\coffin_new:N \l__coffin_aligned_coffin
-\coffin_new:N \l__coffin_aligned_internal_coffin
-\coffin_new:N \l_tmpa_coffin
-\coffin_new:N \l_tmpb_coffin
-\cs_new_eq:NN \coffin_dp:N \box_dp:N
-\cs_new_eq:NN \coffin_dp:c \box_dp:c
-\cs_new_eq:NN \coffin_ht:N \box_ht:N
-\cs_new_eq:NN \coffin_ht:c \box_ht:c
-\cs_new_eq:NN \coffin_wd:N \box_wd:N
-\cs_new_eq:NN \coffin_wd:c \box_wd:c
-\cs_new_protected:Npn \__coffin_get_pole:NnN #1#2#3
- {
- \prop_get:cnNF
- { l__coffin_poles_ \__int_value:w #1 _prop } {#2} #3
- {
- \__msg_kernel_error:nnxx { kernel } { unknown-coffin-pole }
- {#2} { \token_to_str:N #1 }
- \tl_set:Nn #3 { { 0 pt } { 0 pt } { 0 pt } { 0 pt } }
- }
- }
-\cs_new_protected:Npn \__coffin_reset_structure:N #1
- {
- \prop_set_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
- \c__coffin_corners_prop
- \prop_set_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
- \c__coffin_poles_prop
- }
-\cs_new_protected:Npn \__coffin_set_eq_structure:NN #1#2
- {
- \prop_set_eq:cc { l__coffin_corners_ \__int_value:w #1 _prop }
- { l__coffin_corners_ \__int_value:w #2 _prop }
- \prop_set_eq:cc { l__coffin_poles_ \__int_value:w #1 _prop }
- { l__coffin_poles_ \__int_value:w #2 _prop }
- }
-\cs_new_protected:Npn \__coffin_gset_eq_structure:NN #1#2
- {
- \prop_gset_eq:cc { l__coffin_corners_ \__int_value:w #1 _prop }
- { l__coffin_corners_ \__int_value:w #2 _prop }
- \prop_gset_eq:cc { l__coffin_poles_ \__int_value:w #1 _prop }
- { l__coffin_poles_ \__int_value:w #2 _prop }
- }
-\cs_new_protected:Npn \coffin_set_horizontal_pole:Nnn #1#2#3
- {
- \__coffin_if_exist:NT #1
- {
- \__coffin_set_pole:Nnx #1 {#2}
- {
- { 0 pt } { \dim_eval:n {#3} }
- { 1000 pt } { 0 pt }
- }
- }
- }
-\cs_new_protected:Npn \coffin_set_vertical_pole:Nnn #1#2#3
- {
- \__coffin_if_exist:NT #1
- {
- \__coffin_set_pole:Nnx #1 {#2}
- {
- { \dim_eval:n {#3} } { 0 pt }
- { 0 pt } { 1000 pt }
- }
- }
- }
-\cs_new_protected:Npn \__coffin_set_pole:Nnn #1#2#3
- { \prop_put:cnn { l__coffin_poles_ \__int_value:w #1 _prop } {#2} {#3} }
-\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c }
-\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c }
-\cs_generate_variant:Nn \__coffin_set_pole:Nnn { Nnx }
-\cs_new_protected:Npn \__coffin_update_corners:N #1
- {
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tl }
- { { 0 pt } { \dim_use:N \box_ht:N #1 } }
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tr }
- { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } }
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { bl }
- { { 0 pt } { \dim_eval:n { - \box_dp:N #1 } } }
- \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { br }
- { { \dim_use:N \box_wd:N #1 } { \dim_eval:n { - \box_dp:N #1 } } }
- }
-\cs_new_protected:Npn \__coffin_update_poles:N #1
- {
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { hc }
- {
- { \dim_eval:n { 0.5 \box_wd:N #1 } }
- { 0 pt } { 0 pt } { 1000 pt }
- }
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { r }
- {
- { \dim_use:N \box_wd:N #1 }
- { 0 pt } { 0 pt } { 1000 pt }
- }
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { vc }
- {
- { 0 pt }
- { \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } }
- { 1000 pt }
- { 0 pt }
- }
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { t }
- {
- { 0 pt }
- { \dim_use:N \box_ht:N #1 }
- { 1000 pt }
- { 0 pt }
- }
- \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { b }
- {
- { 0 pt }
- { \dim_eval:n { - \box_dp:N #1 } }
- { 1000 pt }
- { 0 pt }
- }
- }
-\cs_new_protected:Npn \__coffin_calculate_intersection:Nnn #1#2#3
- {
- \__coffin_get_pole:NnN #1 {#2} \l__coffin_pole_a_tl
- \__coffin_get_pole:NnN #1 {#3} \l__coffin_pole_b_tl
- \bool_set_false:N \l__coffin_error_bool
- \exp_last_two_unbraced:Noo
- \__coffin_calculate_intersection:nnnnnnnn
- \l__coffin_pole_a_tl \l__coffin_pole_b_tl
- \bool_if:NT \l__coffin_error_bool
- {
- \__msg_kernel_error:nn { kernel } { no-pole-intersection }
- \dim_zero:N \l__coffin_x_dim
- \dim_zero:N \l__coffin_y_dim
- }
- }
-\cs_new_protected:Npn \__coffin_calculate_intersection:nnnnnnnn
- #1#2#3#4#5#6#7#8
- {
- \dim_compare:nNnTF {#3} = { \c_zero_dim }
- {
- \dim_set:Nn \l__coffin_x_dim {#1}
- \dim_compare:nNnTF {#7} = \c_zero_dim
- { \bool_set_true:N \l__coffin_error_bool }
- {
- \dim_compare:nNnTF {#8} = \c_zero_dim
- { \dim_set:Nn \l__coffin_y_dim {#6} }
- {
- \__coffin_calculate_intersection_aux:nnnnnN
- {#1} {#5} {#6} {#7} {#8} \l__coffin_y_dim
- }
- }
- }
- {
- \dim_compare:nNnTF {#4} = \c_zero_dim
- {
- \dim_set:Nn \l__coffin_y_dim {#2}
- \dim_compare:nNnTF {#8} = { \c_zero_dim }
- { \bool_set_true:N \l__coffin_error_bool }
- {
- \dim_compare:nNnTF {#7} = \c_zero_dim
- { \dim_set:Nn \l__coffin_x_dim {#5} }
- {
- \__coffin_calculate_intersection_aux:nnnnnN
- {#2} {#6} {#5} {#8} {#7} \l__coffin_x_dim
- }
- }
- }
- {
- \dim_compare:nNnTF {#7} = \c_zero_dim
- {
- \dim_set:Nn \l__coffin_x_dim {#5}
- \__coffin_calculate_intersection_aux:nnnnnN
- {#5} {#1} {#2} {#3} {#4} \l__coffin_y_dim
- }
- {
- \dim_compare:nNnTF {#8} = \c_zero_dim
- {
- \dim_set:Nn \l__coffin_y_dim {#6}
- \__coffin_calculate_intersection_aux:nnnnnN
- {#6} {#2} {#1} {#4} {#3} \l__coffin_x_dim
- }
- {
- \fp_set:Nn \l__coffin_slope_x_fp
- { \dim_to_fp:n {#4} / \dim_to_fp:n {#3} }
- \fp_set:Nn \l__coffin_slope_y_fp
- { \dim_to_fp:n {#8} / \dim_to_fp:n {#7} }
- \fp_compare:nNnTF
- \l__coffin_slope_x_fp = \l__coffin_slope_y_fp
- { \bool_set_true:N \l__coffin_error_bool }
- {
- \dim_set:Nn \l__coffin_x_dim
- {
- \fp_to_dim:n
- {
- (
- \dim_to_fp:n {#1} * \l__coffin_slope_x_fp
- - ( \dim_to_fp:n {#5} * \l__coffin_slope_y_fp )
- - \dim_to_fp:n {#2}
- + \dim_to_fp:n {#6}
- )
- /
- ( \l__coffin_slope_x_fp - \l__coffin_slope_y_fp )
- }
- }
- \__coffin_calculate_intersection_aux:nnnnnN
- { \l__coffin_x_dim }
- {#5} {#6} {#8} {#7} \l__coffin_y_dim
- }
- }
- }
- }
- }
- }
-\cs_new_protected:Npn \__coffin_calculate_intersection_aux:nnnnnN #1#2#3#4#5#6
- {
- \dim_set:Nn #6
- {
- \fp_to_dim:n
- {
- \dim_to_fp:n {#4} *
- ( \dim_to_fp:n {#1} - \dim_to_fp:n {#2} ) /
- \dim_to_fp:n {#5}
- + \dim_to_fp:n {#3}
- }
- }
- }
-\cs_new_protected:Npn \coffin_join:NnnNnnnn #1#2#3#4#5#6#7#8
- {
- \__coffin_align:NnnNnnnnN
- #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
- \hbox_set:Nn \l__coffin_aligned_coffin
- {
- \dim_compare:nNnT { \l__coffin_offset_x_dim } < \c_zero_dim
- { \tex_kern:D -\l__coffin_offset_x_dim }
- \hbox_unpack:N \l__coffin_aligned_coffin
- \dim_set:Nn \l__coffin_internal_dim
- { \l__coffin_offset_x_dim - \box_wd:N #1 + \box_wd:N #4 }
- \dim_compare:nNnT \l__coffin_internal_dim < \c_zero_dim
- { \tex_kern:D -\l__coffin_internal_dim }
- }
- \__coffin_reset_structure:N \l__coffin_aligned_coffin
- \prop_clear:c
- { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _ prop }
- \__coffin_update_poles:N \l__coffin_aligned_coffin
- \dim_compare:nNnTF \l__coffin_offset_x_dim < \c_zero_dim
- {
- \__coffin_offset_poles:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
- \__coffin_offset_poles:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
- \__coffin_offset_corners:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
- \__coffin_offset_corners:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
- }
- {
- \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
- \__coffin_offset_poles:Nnn #4
- { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
- \__coffin_offset_corners:Nnn #1 { 0 pt } { 0 pt }
- \__coffin_offset_corners:Nnn #4
- { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
- }
- \__coffin_update_vertical_poles:NNN #1 #4 \l__coffin_aligned_coffin
- \coffin_set_eq:NN #1 \l__coffin_aligned_coffin
- }
-\cs_generate_variant:Nn \coffin_join:NnnNnnnn { c , Nnnc , cnnc }
-\cs_new_protected:Npn \coffin_attach:NnnNnnnn #1#2#3#4#5#6#7#8
- {
- \__coffin_align:NnnNnnnnN
- #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
- \box_set_ht:Nn \l__coffin_aligned_coffin { \box_ht:N #1 }
- \box_set_dp:Nn \l__coffin_aligned_coffin { \box_dp:N #1 }
- \box_set_wd:Nn \l__coffin_aligned_coffin { \box_wd:N #1 }
- \__coffin_reset_structure:N \l__coffin_aligned_coffin
- \prop_set_eq:cc
- { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _prop }
- { l__coffin_corners_ \__int_value:w #1 _prop }
- \__coffin_update_poles:N \l__coffin_aligned_coffin
- \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
- \__coffin_offset_poles:Nnn #4
- { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
- \__coffin_update_vertical_poles:NNN #1 #4 \l__coffin_aligned_coffin
- \coffin_set_eq:NN #1 \l__coffin_aligned_coffin
- }
-\cs_new_protected:Npn \coffin_attach_mark:NnnNnnnn #1#2#3#4#5#6#7#8
- {
- \__coffin_align:NnnNnnnnN
- #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l__coffin_aligned_coffin
- \box_set_ht:Nn \l__coffin_aligned_coffin { \box_ht:N #1 }
- \box_set_dp:Nn \l__coffin_aligned_coffin { \box_dp:N #1 }
- \box_set_wd:Nn \l__coffin_aligned_coffin { \box_wd:N #1 }
- \box_set_eq:NN #1 \l__coffin_aligned_coffin
- }
-\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { c , Nnnc , cnnc }
-\cs_new_protected:Npn \__coffin_align:NnnNnnnnN #1#2#3#4#5#6#7#8#9
- {
- \__coffin_calculate_intersection:Nnn #4 {#5} {#6}
- \dim_set:Nn \l__coffin_x_prime_dim { \l__coffin_x_dim }
- \dim_set:Nn \l__coffin_y_prime_dim { \l__coffin_y_dim }
- \__coffin_calculate_intersection:Nnn #1 {#2} {#3}
- \dim_set:Nn \l__coffin_offset_x_dim
- { \l__coffin_x_dim - \l__coffin_x_prime_dim + #7 }
- \dim_set:Nn \l__coffin_offset_y_dim
- { \l__coffin_y_dim - \l__coffin_y_prime_dim + #8 }
- \hbox_set:Nn \l__coffin_aligned_internal_coffin
- {
- \box_use:N #1
- \tex_kern:D -\box_wd:N #1
- \tex_kern:D \l__coffin_offset_x_dim
- \box_move_up:nn { \l__coffin_offset_y_dim } { \box_use:N #4 }
- }
- \coffin_set_eq:NN #9 \l__coffin_aligned_internal_coffin
- }
-\cs_new_protected:Npn \__coffin_offset_poles:Nnn #1#2#3
- {
- \prop_map_inline:cn { l__coffin_poles_ \__int_value:w #1 _prop }
- { \__coffin_offset_pole:Nnnnnnn #1 {##1} ##2 {#2} {#3} }
- }
-\cs_new_protected:Npn \__coffin_offset_pole:Nnnnnnn #1#2#3#4#5#6#7#8
- {
- \dim_set:Nn \l__coffin_x_dim { #3 + #7 }
- \dim_set:Nn \l__coffin_y_dim { #4 + #8 }
- \tl_if_in:nnTF {#2} { - }
- { \tl_set:Nn \l__coffin_internal_tl { {#2} } }
- { \tl_set:Nn \l__coffin_internal_tl { { #1 - #2 } } }
- \exp_last_unbraced:NNo \__coffin_set_pole:Nnx \l__coffin_aligned_coffin
- { \l__coffin_internal_tl }
- {
- { \dim_use:N \l__coffin_x_dim } { \dim_use:N \l__coffin_y_dim }
- {#5} {#6}
- }
- }
-\cs_new_protected:Npn \__coffin_offset_corners:Nnn #1#2#3
- {
- \prop_map_inline:cn { l__coffin_corners_ \__int_value:w #1 _prop }
- { \__coffin_offset_corner:Nnnnn #1 {##1} ##2 {#2} {#3} }
- }
-\cs_new_protected:Npn \__coffin_offset_corner:Nnnnn #1#2#3#4#5#6
- {
- \prop_put:cnx
- { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _prop }
- { #1 - #2 }
- {
- { \dim_eval:n { #3 + #5 } }
- { \dim_eval:n { #4 + #6 } }
- }
- }
-\cs_new_protected:Npn \__coffin_update_vertical_poles:NNN #1#2#3
- {
- \__coffin_get_pole:NnN #3 { #1 -T } \l__coffin_pole_a_tl
- \__coffin_get_pole:NnN #3 { #2 -T } \l__coffin_pole_b_tl
- \exp_last_two_unbraced:Noo \__coffin_update_T:nnnnnnnnN
- \l__coffin_pole_a_tl \l__coffin_pole_b_tl #3
- \__coffin_get_pole:NnN #3 { #1 -B } \l__coffin_pole_a_tl
- \__coffin_get_pole:NnN #3 { #2 -B } \l__coffin_pole_b_tl
- \exp_last_two_unbraced:Noo \__coffin_update_B:nnnnnnnnN
- \l__coffin_pole_a_tl \l__coffin_pole_b_tl #3
- }
-\cs_new_protected:Npn \__coffin_update_T:nnnnnnnnN #1#2#3#4#5#6#7#8#9
- {
- \dim_compare:nNnTF {#2} < {#6}
- {
- \__coffin_set_pole:Nnx #9 { T }
- { { 0 pt } {#6} { 1000 pt } { 0 pt } }
- }
- {
- \__coffin_set_pole:Nnx #9 { T }
- { { 0 pt } {#2} { 1000 pt } { 0 pt } }
- }
- }
-\cs_new_protected:Npn \__coffin_update_B:nnnnnnnnN #1#2#3#4#5#6#7#8#9
- {
- \dim_compare:nNnTF {#2} < {#6}
- {
- \__coffin_set_pole:Nnx #9 { B }
- { { 0 pt } {#2} { 1000 pt } { 0 pt } }
- }
- {
- \__coffin_set_pole:Nnx #9 { B }
- { { 0 pt } {#6} { 1000 pt } { 0 pt } }
- }
- }
-\cs_new_protected:Npn \coffin_typeset:Nnnnn #1#2#3#4#5
- {
- \hbox_unpack:N \c_empty_box
- \__coffin_align:NnnNnnnnN \c_empty_coffin { H } { l }
- #1 {#2} {#3} {#4} {#5} \l__coffin_aligned_coffin
- \box_use:N \l__coffin_aligned_coffin
- }
-\cs_generate_variant:Nn \coffin_typeset:Nnnnn { c }
-\coffin_new:N \l__coffin_display_coffin
-\coffin_new:N \l__coffin_display_coord_coffin
-\coffin_new:N \l__coffin_display_pole_coffin
-\prop_new:N \l__coffin_display_handles_prop
-\prop_put:Nnn \l__coffin_display_handles_prop { tl }
- { { b } { r } { -1 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { thc }
- { { b } { hc } { 0 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { tr }
- { { b } { l } { 1 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { vcl }
- { { vc } { r } { -1 } { 0 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { vchc }
- { { vc } { hc } { 0 } { 0 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { vcr }
- { { vc } { l } { 1 } { 0 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { bl }
- { { t } { r } { -1 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { bhc }
- { { t } { hc } { 0 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { br }
- { { t } { l } { 1 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Tl }
- { { t } { r } { -1 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Thc }
- { { t } { hc } { 0 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Tr }
- { { t } { l } { 1 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Hl }
- { { vc } { r } { -1 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Hhc }
- { { vc } { hc } { 0 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Hr }
- { { vc } { l } { 1 } { 1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Bl }
- { { b } { r } { -1 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Bhc }
- { { b } { hc } { 0 } { -1 } }
-\prop_put:Nnn \l__coffin_display_handles_prop { Br }
- { { b } { l } { 1 } { -1 } }
-\dim_new:N \l__coffin_display_offset_dim
-\dim_set:Nn \l__coffin_display_offset_dim { 2 pt }
-\dim_new:N \l__coffin_display_x_dim
-\dim_new:N \l__coffin_display_y_dim
-\prop_new:N \l__coffin_display_poles_prop
-\tl_new:N \l__coffin_display_font_tl
-\tl_set:Nn \l__coffin_display_font_tl { \sffamily \tiny }
-\cs_new_protected:Npn \coffin_mark_handle:Nnnn #1#2#3#4
- {
- \hcoffin_set:Nn \l__coffin_display_pole_coffin
- {
- \color {#4}
- \rule { 1 pt } { 1 pt }
- }
- \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
- \l__coffin_display_pole_coffin { hc } { vc } { 0 pt } { 0 pt }
- \hcoffin_set:Nn \l__coffin_display_coord_coffin
- {
- \color {#4}
- \l__coffin_display_font_tl
- ( \tl_to_str:n { #2 , #3 } )
- }
- \prop_get:NnN \l__coffin_display_handles_prop
- { #2 #3 } \l__coffin_internal_tl
- \quark_if_no_value:NTF \l__coffin_internal_tl
- {
- \prop_get:NnN \l__coffin_display_handles_prop
- { #3 #2 } \l__coffin_internal_tl
- \quark_if_no_value:NTF \l__coffin_internal_tl
- {
- \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
- \l__coffin_display_coord_coffin { l } { vc }
- { 1 pt } { 0 pt }
- }
- {
- \exp_last_unbraced:No \__coffin_mark_handle_aux:nnnnNnn
- \l__coffin_internal_tl #1 {#2} {#3}
- }
- }
- {
- \exp_last_unbraced:No \__coffin_mark_handle_aux:nnnnNnn
- \l__coffin_internal_tl #1 {#2} {#3}
- }
- }
-\cs_new_protected:Npn \__coffin_mark_handle_aux:nnnnNnn #1#2#3#4#5#6#7
- {
- \coffin_attach_mark:NnnNnnnn #5 {#6} {#7}
- \l__coffin_display_coord_coffin {#1} {#2}
- { #3 \l__coffin_display_offset_dim }
- { #4 \l__coffin_display_offset_dim }
- }
-\cs_generate_variant:Nn \coffin_mark_handle:Nnnn { c }
-\cs_new_protected:Npn \coffin_display_handles:Nn #1#2
- {
- \hcoffin_set:Nn \l__coffin_display_pole_coffin
- {
- \color {#2}
- \rule { 1 pt } { 1 pt }
- }
- \prop_set_eq:Nc \l__coffin_display_poles_prop
- { l__coffin_poles_ \__int_value:w #1 _prop }
- \__coffin_get_pole:NnN #1 { H } \l__coffin_pole_a_tl
- \__coffin_get_pole:NnN #1 { T } \l__coffin_pole_b_tl
- \tl_if_eq:NNT \l__coffin_pole_a_tl \l__coffin_pole_b_tl
- { \prop_remove:Nn \l__coffin_display_poles_prop { T } }
- \__coffin_get_pole:NnN #1 { B } \l__coffin_pole_b_tl
- \tl_if_eq:NNT \l__coffin_pole_a_tl \l__coffin_pole_b_tl
- { \prop_remove:Nn \l__coffin_display_poles_prop { B } }
- \coffin_set_eq:NN \l__coffin_display_coffin #1
- \prop_map_inline:Nn \l__coffin_display_poles_prop
- {
- \prop_remove:Nn \l__coffin_display_poles_prop {##1}
- \__coffin_display_handles_aux:nnnnnn {##1} ##2 {#2}
- }
- \box_use:N \l__coffin_display_coffin
- }
-\cs_new_protected:Npn \__coffin_display_handles_aux:nnnnnn #1#2#3#4#5#6
- {
- \prop_map_inline:Nn \l__coffin_display_poles_prop
- {
- \bool_set_false:N \l__coffin_error_bool
- \__coffin_calculate_intersection:nnnnnnnn {#2} {#3} {#4} {#5} ##2
- \bool_if:NF \l__coffin_error_bool
- {
- \dim_set:Nn \l__coffin_display_x_dim { \l__coffin_x_dim }
- \dim_set:Nn \l__coffin_display_y_dim { \l__coffin_y_dim }
- \__coffin_display_attach:Nnnnn
- \l__coffin_display_pole_coffin { hc } { vc }
- { 0 pt } { 0 pt }
- \hcoffin_set:Nn \l__coffin_display_coord_coffin
- {
- \color {#6}
- \l__coffin_display_font_tl
- ( \tl_to_str:n { #1 , ##1 } )
- }
- \prop_get:NnN \l__coffin_display_handles_prop
- { #1 ##1 } \l__coffin_internal_tl
- \quark_if_no_value:NTF \l__coffin_internal_tl
- {
- \prop_get:NnN \l__coffin_display_handles_prop
- { ##1 #1 } \l__coffin_internal_tl
- \quark_if_no_value:NTF \l__coffin_internal_tl
- {
- \__coffin_display_attach:Nnnnn
- \l__coffin_display_coord_coffin { l } { vc }
- { 1 pt } { 0 pt }
- }
- {
- \exp_last_unbraced:No
- \__coffin_display_handles_aux:nnnn
- \l__coffin_internal_tl
- }
- }
- {
- \exp_last_unbraced:No \__coffin_display_handles_aux:nnnn
- \l__coffin_internal_tl
- }
- }
- }
- }
-\cs_new_protected:Npn \__coffin_display_handles_aux:nnnn #1#2#3#4
- {
- \__coffin_display_attach:Nnnnn
- \l__coffin_display_coord_coffin {#1} {#2}
- { #3 \l__coffin_display_offset_dim }
- { #4 \l__coffin_display_offset_dim }
- }
-\cs_generate_variant:Nn \coffin_display_handles:Nn { c }
-\cs_new_protected:Npn \__coffin_display_attach:Nnnnn #1#2#3#4#5
- {
- \__coffin_calculate_intersection:Nnn #1 {#2} {#3}
- \dim_set:Nn \l__coffin_x_prime_dim { \l__coffin_x_dim }
- \dim_set:Nn \l__coffin_y_prime_dim { \l__coffin_y_dim }
- \dim_set:Nn \l__coffin_offset_x_dim
- { \l__coffin_display_x_dim - \l__coffin_x_prime_dim + #4 }
- \dim_set:Nn \l__coffin_offset_y_dim
- { \l__coffin_display_y_dim - \l__coffin_y_prime_dim + #5 }
- \hbox_set:Nn \l__coffin_aligned_coffin
- {
- \box_use:N \l__coffin_display_coffin
- \tex_kern:D -\box_wd:N \l__coffin_display_coffin
- \tex_kern:D \l__coffin_offset_x_dim
- \box_move_up:nn { \l__coffin_offset_y_dim } { \box_use:N #1 }
- }
- \box_set_ht:Nn \l__coffin_aligned_coffin
- { \box_ht:N \l__coffin_display_coffin }
- \box_set_dp:Nn \l__coffin_aligned_coffin
- { \box_dp:N \l__coffin_display_coffin }
- \box_set_wd:Nn \l__coffin_aligned_coffin
- { \box_wd:N \l__coffin_display_coffin }
- \box_set_eq:NN \l__coffin_display_coffin \l__coffin_aligned_coffin
- }
-\cs_new_protected:Npn \coffin_show_structure:N #1
- {
- \__coffin_if_exist:NT #1
- {
- \__msg_show_variable:Nnn #1 { coffins }
- {
- \prop_map_function:cN
- { l__coffin_poles_ \__int_value:w #1 _prop }
- \__msg_show_item_unbraced:nn
- }
- }
- }
-\cs_generate_variant:Nn \coffin_show_structure:N { c }
-\__msg_kernel_new:nnnn { kernel } { no-pole-intersection }
- { No~intersection~between~coffin~poles. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~was~asked~to~find~the~intersection~between~two~poles,~
- but~they~do~not~have~a~unique~meeting~point:~
- the~value~(0~pt,~0~pt)~will~be~used.
- }
-\__msg_kernel_new:nnnn { kernel } { unknown-coffin }
- { Unknown~coffin~'#1'. }
- { The~coffin~'#1'~was~never~defined. }
-\__msg_kernel_new:nnnn { kernel } { unknown-coffin-pole }
- { Pole~'#1'~unknown~for~coffin~'#2'. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~
- but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong.
- }
-\__msg_kernel_new:nnn { kernel } { show-coffins }
- {
- Size~of~coffin~\token_to_str:N #1 : \\
- > ~ ht~=~\dim_use:N \box_ht:N #1 \\
- > ~ dp~=~\dim_use:N \box_dp:N #1 \\
- > ~ wd~=~\dim_use:N \box_wd:N #1 \\
- Poles~of~coffin~\token_to_str:N #1 :
- }
-%%
-%%
-%% End of file `l3coffins.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3color.sty b/Master/texmf-dist/tex/latex/l3kernel/l3color.sty
deleted file mode 100644
index 12b019250a5..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3color.sty
+++ /dev/null
@@ -1,76 +0,0 @@
-%%
-%% This is file `l3color.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3color.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3color.dtx Copyright(C) 2011,2012 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3color.dtx 4156 2012-08-29 11:10:09Z joseph $
- {L3 Experimental color support}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_eq:NN \color_group_begin: \group_begin:
-\cs_new_protected_nopar:Npn \color_group_end:
- {
- \tex_par:D
- \group_end:
- }
-\cs_new_protected_nopar:Npn \color_ensure_current: { }
-\AtBeginDocument
- {
- \cs_if_exist:NTF \__driver_color_ensure_current:
- {
- \cs_set_protected_nopar:Npn \color_ensure_current:
- { \__driver_color_ensure_current: }
- }
- {
- \cs_if_exist:NT \set@color
- { \cs_set_protected_nopar:Npn \color_ensure_current: { \set@color } }
- }
- }
-%%
-%%
-%% End of file `l3color.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
index 9fa07d959ef..87772eedfb7 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
@@ -15,7 +15,7 @@
%% Do not distribute a modified version of this file.
%%
%%
-%% File: l3doc.dtx Copyright (C) 1990-2012 The LaTeX3 project
+%% File: l3doc.dtx Copyright (C) 1990-2014 The LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -52,7 +52,7 @@
\let \fileversionOld \ExplFileVersion
\let \filedescriptionOld \ExplFileDescription
\RequirePackage{expl3,xparse,calc}
-\GetIdInfo$Id: l3doc.dtx 4442 2013-01-13 08:56:27Z bruno $
+\GetIdInfo$Id: l3doc.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental documentation class}
\ProvidesExplClass
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -124,6 +124,7 @@
array,
alphalph,
amsmath,
+ amssymb,
booktabs,
color,
colortbl,
@@ -698,12 +699,12 @@
{ \int_gzero:N \g__codedoc_nested_macro_int }
{ \int_incr:N \g__codedoc_nested_macro_int }
- \bool_gset_false:N \l__codedoc_macro_aux_bool
- \bool_gset_false:N \l__codedoc_macro_internal_bool
- \bool_gset_false:N \l__codedoc_macro_TF_bool
- \bool_gset_false:N \l__codedoc_macro_pTF_bool
- \bool_gset_false:N \l__codedoc_macro_var_bool
- \bool_gset_false:N \l__codedoc_tested_bool
+ \bool_set_false:N \l__codedoc_macro_aux_bool
+ \bool_set_false:N \l__codedoc_macro_internal_bool
+ \bool_set_false:N \l__codedoc_macro_TF_bool
+ \bool_set_false:N \l__codedoc_macro_pTF_bool
+ \bool_set_false:N \l__codedoc_macro_var_bool
+ \bool_set_false:N \l__codedoc_tested_bool
\cs_set_eq:NN \__codedoc_macroname_prefix:n \use:n
\cs_set_eq:NN \__codedoc_macroname_suffix: \c_empty_tl
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def
index d1d70fb39d9..3f5a629b6c9 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def
@@ -46,13 +46,11 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3drivers.dtx 4641 2014-01-04 17:05:41Z joseph $
+\GetIdInfo$Id: l3drivers.dtx 4735 2014-05-05 06:25:42Z joseph $
{L3 Experimental drivers}
\ProvidesExplFile
{l3dvidpfmx.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: dvipdfmx}
-\__expl_package_check:
\cs_new_protected_nopar:Npn \__driver_state_save:
{ \tex_special:D { pdf:literal~q } }
\cs_new_protected_nopar:Npn \__driver_state_restore:
@@ -116,7 +114,6 @@
\cs_new_eq:NN \__driver_box_scale_end: \__driver_state_restore:
\tl_new:N \l__driver_current_color_tl
\tl_set:Nn \l__driver_current_color_tl { gray~0 }
-%% \end{macrocode}
\cs_new_protected_nopar:Npn \__driver_color_ensure_current:
{
\tex_special:D { color~push~\l__driver_current_color_tl }
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
index 5b0d1ff96a1..cd56223cf65 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def
@@ -46,13 +46,11 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3drivers.dtx 4641 2014-01-04 17:05:41Z joseph $
+\GetIdInfo$Id: l3drivers.dtx 4735 2014-05-05 06:25:42Z joseph $
{L3 Experimental drivers}
\ProvidesExplFile
{l3dvips.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: dvips}
-\__expl_package_check:
\cs_new_protected_nopar:Npn \__driver_state_save:
{ \tex_special:D { ps:gsave } }
\cs_new_protected_nopar:Npn \__driver_state_restore:
@@ -125,7 +123,6 @@
\cs_new_eq:NN \__driver_box_scale_end: \__driver_state_restore:
\tl_new:N \l__driver_current_color_tl
\tl_set:Nn \l__driver_current_color_tl { Black }
-%% \end{macrocode}
\cs_new_protected_nopar:Npn \__driver_color_ensure_current:
{
\tex_special:D { color~push~\l__driver_current_color_tl }
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty b/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty
deleted file mode 100644
index 40c33448806..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3expan.sty
+++ /dev/null
@@ -1,511 +0,0 @@
-%%
-%% This is file `l3expan.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3expan.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3expan.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3expan.dtx 4642 2014-01-04 17:28:32Z joseph $
- {L3 Argument expansion}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new:Npn \__exp_arg_next:nnn #1#2#3 { #2 \::: { #3 {#1} } }
-\cs_new:Npn \__exp_arg_next:Nnn #1#2#3 { #2 \::: { #3 #1 } }
-\cs_new:Npn \::: #1 {#1}
-\cs_new:Npn \::n #1 \::: #2#3 { #1 \::: { #2 {#3} } }
-\cs_new:Npn \::N #1 \::: #2#3 { #1 \::: {#2#3} }
-\cs_new:Npn \::p #1 \::: #2#3# { #1 \::: {#2#3} }
-\cs_new:Npn \::c #1 \::: #2#3
- { \exp_after:wN \__exp_arg_next:Nnn \cs:w #3 \cs_end: {#1} {#2} }
-\cs_new:Npn \::o #1 \::: #2#3
- { \exp_after:wN \__exp_arg_next:nnn \exp_after:wN {#3} {#1} {#2} }
-\cs_new:Npn \::f #1 \::: #2#3
- {
- \exp_after:wN \__exp_arg_next:nnn
- \exp_after:wN { \tex_romannumeral:D -`0 #3 }
- {#1} {#2}
- }
-\use:nn { \cs_new_eq:NN \exp_stop_f: } { ~ }
-\cs_new_protected:Npn \::x #1 \::: #2#3
- {
- \cs_set_nopar:Npx \l__exp_internal_tl { {#3} }
- \exp_after:wN \__exp_arg_next:nnn \l__exp_internal_tl {#1} {#2}
- }
-\cs_new:Npn \::V #1 \::: #2#3
- {
- \exp_after:wN \__exp_arg_next:nnn
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
- {#1} {#2}
-}
-\cs_new:Npn \::v # 1\::: #2#3
- {
- \exp_after:wN \__exp_arg_next:nnn
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#3} }
- {#1} {#2}
- }
-\cs_new:Npn \__exp_eval_register:N #1
- {
- \exp_after:wN \if_meaning:w \exp_not:N #1 #1
- \if_meaning:w \scan_stop: #1
- \__exp_eval_error_msg:w
- \fi:
- \else:
- \exp_after:wN \use_i_ii:nnn
- \fi:
- \exp_after:wN \c_zero \tex_the:D #1
- }
-\cs_new:Npn \__exp_eval_register:c #1
- { \exp_after:wN \__exp_eval_register:N \cs:w #1 \cs_end: }
-\cs_new:Npn \__exp_eval_error_msg:w #1 \tex_the:D #2
- {
- \fi:
- \fi:
- \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2}
- \c_zero
- }
-\cs_new:Npn \exp_args:No #1#2 { \exp_after:wN #1 \exp_after:wN {#2} }
-\cs_new:Npn \exp_args:NNo #1#2#3
- { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN {#3} }
-\cs_new:Npn \exp_args:NNNo #1#2#3#4
- { \exp_after:wN #1 \exp_after:wN#2 \exp_after:wN #3 \exp_after:wN {#4} }
-\cs_new:Npn \exp_args:NNc #1#2#3
- { \exp_after:wN #1 \exp_after:wN #2 \cs:w # 3\cs_end: }
-\cs_new:Npn \exp_args:Ncc #1#2#3
- { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: \cs:w #3 \cs_end: }
-\cs_new:Npn \exp_args:Nccc #1#2#3#4
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \cs:w #3 \exp_after:wN \cs_end:
- \cs:w #4 \cs_end:
- }
-\cs_new:Npn \exp_args:Nf #1#2
- { \exp_after:wN #1 \exp_after:wN { \tex_romannumeral:D -`0 #2 } }
-\cs_new:Npn \exp_args:Nv #1#2
- {
- \exp_after:wN #1 \exp_after:wN
- { \tex_romannumeral:D \__exp_eval_register:c {#2} }
- }
-\cs_new:Npn \exp_args:NV #1#2
- {
- \exp_after:wN #1 \exp_after:wN
- { \tex_romannumeral:D \__exp_eval_register:N #2 }
- }
-\cs_new:Npn \exp_args:NNf #1#2#3
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN { \tex_romannumeral:D -`0 #3 }
- }
-\cs_new:Npn \exp_args:NNv #1#2#3
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#3} }
- }
-\cs_new:Npn \exp_args:NNV #1#2#3
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
- }
-\cs_new:Npn \exp_args:Nco #1#2#3
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \exp_after:wN {#3}
- }
-\cs_new:Npn \exp_args:Ncf #1#2#3
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \exp_after:wN { \tex_romannumeral:D -`0 #3 }
- }
-\cs_new:Npn \exp_args:NVV #1#2#3
- {
- \exp_after:wN #1
- \exp_after:wN { \tex_romannumeral:D \exp_after:wN
- \__exp_eval_register:N \exp_after:wN #2 \exp_after:wN }
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #3 }
- }
-\cs_new:Npn \exp_args:NNNV #1#2#3#4
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN #3
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #4 }
- }
-\cs_new:Npn \exp_args:NcNc #1#2#3#4
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \exp_after:wN #3
- \cs:w #4 \cs_end:
- }
-\cs_new:Npn \exp_args:NcNo #1#2#3#4
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \exp_after:wN #3
- \exp_after:wN {#4}
- }
-\cs_new:Npn \exp_args:Ncco #1#2#3#4
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \cs:w #3 \exp_after:wN \cs_end:
- \exp_after:wN {#4}
- }
-\cs_new_protected_nopar:Npn \exp_args:Nx { \::x \::: }
-\cs_new_nopar:Npn \exp_args:Nnc { \::n \::c \::: }
-\cs_new_nopar:Npn \exp_args:Nfo { \::f \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nff { \::f \::f \::: }
-\cs_new_nopar:Npn \exp_args:Nnf { \::n \::f \::: }
-\cs_new_nopar:Npn \exp_args:Nno { \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:NnV { \::n \::V \::: }
-\cs_new_nopar:Npn \exp_args:Noo { \::o \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nof { \::o \::f \::: }
-\cs_new_nopar:Npn \exp_args:Noc { \::o \::c \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNx { \::N \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Ncx { \::c \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnx { \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nox { \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nxo { \::x \::o \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nxx { \::x \::x \::: }
-\cs_new_nopar:Npn \exp_args:NNno { \::N \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:NNoo { \::N \::o \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nnnc { \::n \::n \::c \::: }
-\cs_new_nopar:Npn \exp_args:Nnno { \::n \::n \::o \::: }
-\cs_new_nopar:Npn \exp_args:Nooo { \::o \::o \::o \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNnx { \::N \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:NNox { \::N \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnnx { \::n \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nnox { \::n \::o \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Nccx { \::c \::c \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Ncnx { \::c \::n \::x \::: }
-\cs_new_protected_nopar:Npn \exp_args:Noox { \::o \::o \::x \::: }
-\cs_new:Npn \__exp_arg_last_unbraced:nn #1#2 { #2#1 }
-\cs_new:Npn \::f_unbraced \::: #1#2
- {
- \exp_after:wN \__exp_arg_last_unbraced:nn
- \exp_after:wN { \tex_romannumeral:D -`0 #2 } {#1}
- }
-\cs_new:Npn \::o_unbraced \::: #1#2
- { \exp_after:wN \__exp_arg_last_unbraced:nn \exp_after:wN {#2} {#1} }
-\cs_new:Npn \::V_unbraced \::: #1#2
- {
- \exp_after:wN \__exp_arg_last_unbraced:nn
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:N #2 } {#1}
- }
-\cs_new:Npn \::v_unbraced \::: #1#2
- {
- \exp_after:wN \__exp_arg_last_unbraced:nn
- \exp_after:wN { \tex_romannumeral:D \__exp_eval_register:c {#2} } {#1}
- }
-\cs_new_protected:Npn \::x_unbraced \::: #1#2
- {
- \cs_set_nopar:Npx \l__exp_internal_tl { \exp_not:n {#1} #2 }
- \l__exp_internal_tl
- }
-\cs_new:Npn \exp_last_unbraced:NV #1#2
- { \exp_after:wN #1 \tex_romannumeral:D \__exp_eval_register:N #2 }
-\cs_new:Npn \exp_last_unbraced:Nv #1#2
- { \exp_after:wN #1 \tex_romannumeral:D \__exp_eval_register:c {#2} }
-\cs_new:Npn \exp_last_unbraced:No #1#2 { \exp_after:wN #1 #2 }
-\cs_new:Npn \exp_last_unbraced:Nf #1#2
- { \exp_after:wN #1 \tex_romannumeral:D -`0 #2 }
-\cs_new:Npn \exp_last_unbraced:Nco #1#2#3
- { \exp_after:wN #1 \cs:w #2 \exp_after:wN \cs_end: #3 }
-\cs_new:Npn \exp_last_unbraced:NcV #1#2#3
- {
- \exp_after:wN #1
- \cs:w #2 \exp_after:wN \cs_end:
- \tex_romannumeral:D \__exp_eval_register:N #3
- }
-\cs_new:Npn \exp_last_unbraced:NNV #1#2#3
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \tex_romannumeral:D \__exp_eval_register:N #3
- }
-\cs_new:Npn \exp_last_unbraced:NNo #1#2#3
- { \exp_after:wN #1 \exp_after:wN #2 #3 }
-\cs_new:Npn \exp_last_unbraced:NNNV #1#2#3#4
- {
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN #3
- \tex_romannumeral:D \__exp_eval_register:N #4
- }
-\cs_new:Npn \exp_last_unbraced:NNNo #1#2#3#4
- { \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN #3 #4 }
-\cs_new_nopar:Npn \exp_last_unbraced:Nno { \::n \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:Noo { \::o \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:Nfo { \::f \::o_unbraced \::: }
-\cs_new_nopar:Npn \exp_last_unbraced:NnNo { \::n \::N \::o_unbraced \::: }
-\cs_new_protected_nopar:Npn \exp_last_unbraced:Nx { \::x_unbraced \::: }
-\cs_new:Npn \exp_last_two_unbraced:Noo #1#2#3
- { \exp_after:wN \__exp_last_two_unbraced:noN \exp_after:wN {#3} {#2} #1 }
-\cs_new:Npn \__exp_last_two_unbraced:noN #1#2#3
- { \exp_after:wN #3 #2 #1 }
-\cs_new:Npn \exp_not:o #1 { \etex_unexpanded:D \exp_after:wN {#1} }
-\cs_new:Npn \exp_not:c #1 { \exp_after:wN \exp_not:N \cs:w #1 \cs_end: }
-\cs_new:Npn \exp_not:f #1
- { \etex_unexpanded:D \exp_after:wN { \tex_romannumeral:D -`0 #1 } }
-\cs_new:Npn \exp_not:V #1
- {
- \etex_unexpanded:D \exp_after:wN
- { \tex_romannumeral:D \__exp_eval_register:N #1 }
- }
-\cs_new:Npn \exp_not:v #1
- {
- \etex_unexpanded:D \exp_after:wN
- { \tex_romannumeral:D \__exp_eval_register:c {#1} }
- }
-\cs_new_protected:Npn \cs_generate_variant:Nn #1#2
- {
- \__chk_if_exist_cs:N #1
- \__cs_generate_variant:N #1
- \exp_after:wN \__cs_split_function:NN
- \exp_after:wN #1
- \exp_after:wN \__cs_generate_variant:nnNN
- \exp_after:wN #1
- \etex_detokenize:D {#2} , \scan_stop: , \q_recursion_stop
- }
-\group_begin:
- \tex_catcode:D `\M = 12 \scan_stop:
- \tex_catcode:D `\A = 12 \scan_stop:
- \tex_catcode:D `\P = 12 \scan_stop:
- \tex_catcode:D `\R = 12 \scan_stop:
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \__cs_generate_variant:N #1
- {
- \exp_after:wN \if_meaning:w \exp_not:N #1 #1
- \cs_set_eq:NN \__cs_tmp:w \cs_new_protected_nopar:Npx
- \else:
- \exp_after:wN \__cs_generate_variant:ww
- \token_to_meaning:N #1 MA \q_mark
- \q_mark \cs_new_protected_nopar:Npx
- PR
- \q_mark \cs_new_nopar:Npx
- \q_stop
- \fi:
- }
- \cs_new_protected:Npn \__cs_generate_variant:ww #1 MA #2 \q_mark
- { \__cs_generate_variant:wwNw #1 }
- \cs_new_protected:Npn \__cs_generate_variant:wwNw
- #1 PR #2 \q_mark #3 #4 \q_stop
- {
- \cs_set_eq:NN \__cs_tmp:w #3
- }
- }
-\cs_new_protected:Npn \__cs_generate_variant:nnNN #1#2#3#4
- {
- \if_meaning:w \c_false_bool #3
- \__msg_kernel_error:nnx { kernel } { missing-colon }
- { \token_to_str:c {#1} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \__cs_generate_variant:Nnnw #4 {#1}{#2}
- }
-\cs_new_protected:Npn \__cs_generate_variant:Nnnw #1#2#3#4 ,
- {
- \if_meaning:w \scan_stop: #4
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- \use:x
- {
- \exp_not:N \__cs_generate_variant:wwNN
- \__cs_generate_variant_loop:nNwN { }
- #4
- \__cs_generate_variant_loop_end:nwwwNNnn
- \q_mark
- #3 ~
- { ~ { } \fi: \__cs_generate_variant_loop_long:wNNnn } ~
- { }
- \q_stop
- \exp_not:N #1 {#2} {#4}
- }
- \__cs_generate_variant:Nnnw #1 {#2} {#3}
- }
-\cs_new:Npn \__cs_generate_variant_loop:nNwN #1#2#3 \q_mark #4
- {
- \if:w #2 #4
- \exp_after:wN \__cs_generate_variant_loop_same:w
- \else:
- \if:w N #4 \else:
- \if:w n #4 \else:
- \__cs_generate_variant_loop_invalid:NNwNNnn #4#2
- \fi:
- \fi:
- \fi:
- #1
- \prg_do_nothing:
- #2
- \__cs_generate_variant_loop:nNwN { } #3 \q_mark
- }
-\cs_new:Npn \__cs_generate_variant_loop_same:w
- #1 \prg_do_nothing: #2#3#4
- {
- #3 { #1 \__cs_generate_variant_same:N #2 }
- }
-\cs_new:Npn \__cs_generate_variant_loop_end:nwwwNNnn
- #1#2 \q_mark #3 ~ #4 \q_stop #5#6#7#8
- {
- \scan_stop: \scan_stop: \fi:
- \exp_not:N \q_mark
- \exp_not:N \q_stop
- \exp_not:N #6
- \exp_not:c { #7 : #8 #1 #3 }
- }
-\cs_new:Npn \__cs_generate_variant_loop_long:wNNnn #1 \q_stop #2#3#4#5
- {
- \exp_not:n
- {
- \q_mark
- \__msg_kernel_error:nnxx { kernel } { variant-too-long }
- {#5} { \token_to_str:N #3 }
- \use_none:nnnn
- \q_stop
- #3
- #3
- }
- }
-\cs_new:Npn \__cs_generate_variant_loop_invalid:NNwNNnn
- #1#2 \fi: \fi: \fi: #3 \q_stop #4#5#6#7
- {
- \fi: \fi: \fi:
- \exp_not:n
- {
- \q_mark
- \__msg_kernel_error:nnxxxx { kernel } { invalid-variant }
- {#7} { \token_to_str:N #5 } {#1} {#2}
- \use_none:nnnn
- \q_stop
- #5
- #5
- }
- }
-\cs_new:Npn \__cs_generate_variant_same:N #1
- {
- \if:w N #1
- N
- \else:
- \if:w p #1
- p
- \else:
- n
- \fi:
- \fi:
- }
-\cs_new_protected:Npn \__cs_generate_variant:wwNN
- #1 \q_mark #2 \q_stop #3#4
- {
- #2
- \cs_if_free:NTF #4
- {
- \group_begin:
- \__cs_generate_internal_variant:n {#1}
- \__cs_tmp:w #4 { \exp_not:c { exp_args:N #1 } \exp_not:N #3 }
- \group_end:
- }
- {
- \iow_log:x
- {
- Variant~\token_to_str:N #4~%
- already~defined;~ not~ changing~ it~on~line~%
- \tex_the:D \tex_inputlineno:D
- }
- }
- }
-\group_begin:
- \tex_catcode:D `\X = 12 \scan_stop:
- \tex_lccode:D `\N = `\N \scan_stop:
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \__cs_generate_internal_variant:n #1
- {
- \__cs_generate_internal_variant:wwnNwnn
- #1 \q_mark
- { \cs_set_eq:NN \__cs_tmp:w \cs_new_protected_nopar:Npx }
- \cs_new_protected_nopar:cpx
- X \q_mark
- { }
- \cs_new_nopar:cpx
- \q_stop
- { exp_args:N #1 }
- { \__cs_generate_internal_variant_loop:n #1 { : \use_i:nn } }
- }
- \cs_new_protected:Npn \__cs_generate_internal_variant:wwnNwnn
- #1 X #2 \q_mark #3 #4 #5 \q_stop #6 #7
- {
- #3
- \cs_if_free:cT {#6} { #4 {#6} {#7} }
- }
- }
-\cs_new:Npn \__cs_generate_internal_variant_loop:n #1
- {
- \exp_after:wN \exp_not:N \cs:w :: #1 \cs_end:
- \__cs_generate_internal_variant_loop:n
- }
-\cs_generate_variant:Nn \str_if_eq_p:nn { V , o }
-\cs_generate_variant:Nn \str_if_eq_p:nn { nV , no , VV }
-\cs_generate_variant:Nn \str_if_eq:nnT { V , o }
-\cs_generate_variant:Nn \str_if_eq:nnT { nV , no , VV }
-\cs_generate_variant:Nn \str_if_eq:nnF { V , o }
-\cs_generate_variant:Nn \str_if_eq:nnF { nV , no , VV }
-\cs_generate_variant:Nn \str_if_eq:nnTF { V , o }
-\cs_generate_variant:Nn \str_if_eq:nnTF { nV , no , VV }
-\cs_generate_variant:Nn \str_case:nn { o }
-\cs_generate_variant:Nn \str_case:nnT { o }
-\cs_generate_variant:Nn \str_case:nnF { o }
-\cs_generate_variant:Nn \str_case:nnTF { o }
-\cs_new_eq:NN \str_case:onn \str_case:onF
-%%
-%%
-%% End of file `l3expan.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty b/Master/texmf-dist/tex/latex/l3kernel/l3file.sty
deleted file mode 100644
index cecc6672fa6..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3file.sty
+++ /dev/null
@@ -1,548 +0,0 @@
-%%
-%% This is file `l3file.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3file.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3file.dtx Copyright (C) 1990-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3file.dtx 4596 2013-10-13 21:24:01Z joseph $
- {L3 File and I/O operations}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\tl_new:N \g_file_current_name_tl
-\tl_gset_eq:NN \g_file_current_name_tl \@currname
-\seq_new:N \g__file_stack_seq
-\seq_new:N \g__file_record_seq
-\tl_new:N \l__file_internal_tl
-\tl_new:N \l__file_internal_name_tl
-\seq_new:N \l__file_search_path_seq
-\seq_new:N \l__file_saved_search_path_seq
-\seq_new:N \l__file_internal_seq
-\cs_new_protected:Npn \__file_name_sanitize:nn #1#2
- {
- \group_begin:
- \seq_map_inline:Nn \l_char_active_seq
- { \cs_set_nopar:Npx ##1 { \token_to_str:N ##1 } }
- \tl_set:Nx \l__file_internal_name_tl {#1}
- \tl_set:Nx \l__file_internal_name_tl
- { \tl_to_str:N \l__file_internal_name_tl }
- \tl_if_in:NnT \l__file_internal_name_tl { ~ }
- {
- \__msg_kernel_error:nnx { kernel } { space-in-file-name }
- { \l__file_internal_name_tl }
- \tl_remove_all:Nn \l__file_internal_name_tl { ~ }
- }
- \use:x
- {
- \group_end:
- \exp_not:n {#2} { \l__file_internal_name_tl }
- }
- }
-\cs_new_protected:Npn \file_add_path:nN #1
- { \__file_name_sanitize:nn {#1} { \__file_add_path:nN } }
-\cs_new_protected:Npn \__file_add_path:nN #1#2
- {
- \__ior_open:Nn \g__file_internal_ior {#1}
- \ior_if_eof:NTF \g__file_internal_ior
- { \__file_add_path_search:nN {#1} #2 }
- { \tl_set:Nn #2 {#1} }
- \ior_close:N \g__file_internal_ior
- }
-\cs_new_protected:Npn \__file_add_path_search:nN #1#2
- {
- \tl_set:Nn #2 { \q_no_value }
- \cs_if_exist:NT \input@path
- {
- \seq_set_eq:NN \l__file_saved_search_path_seq \l__file_search_path_seq
- \seq_set_split:NnV \l__file_internal_seq { , } \input@path
- \seq_concat:NNN \l__file_search_path_seq
- \l__file_search_path_seq \l__file_internal_seq
- }
- \seq_map_inline:Nn \l__file_search_path_seq
- {
- \__ior_open:Nn \g__file_internal_ior { ##1 #1 }
- \ior_if_eof:NF \g__file_internal_ior
- {
- \tl_set:Nx #2 { ##1 #1 }
- \seq_map_break:
- }
- }
- \cs_if_exist:NT \input@path
- { \seq_set_eq:NN \l__file_search_path_seq \l__file_saved_search_path_seq }
- }
-\prg_new_protected_conditional:Npnn \file_if_exist:n #1 { T , F , TF }
- {
- \file_add_path:nN {#1} \l__file_internal_name_tl
- \quark_if_no_value:NTF \l__file_internal_name_tl
- { \prg_return_false: }
- { \prg_return_true: }
- }
-\cs_new_protected:Npn \file_input:n #1
- {
- \file_add_path:nN {#1} \l__file_internal_name_tl
- \quark_if_no_value:NTF \l__file_internal_name_tl
- {
- \__file_name_sanitize:nn {#1}
- { \__msg_kernel_error:nnx { kernel } { file-not-found } }
- }
- { \__file_input:V \l__file_internal_name_tl }
- }
-\cs_new_protected:Npn \__file_input:n #1
- {
- \tl_if_in:nnTF {#1} { . }
- { \__file_input_aux:n {#1} }
- { \__file_input_aux:o { \tl_to_str:n { #1 . tex } } }
- }
-\cs_generate_variant:Nn \__file_input:n { V }
-\cs_new_protected:Npn \__file_input_aux:n #1
- {
- \clist_if_exist:NTF \@filelist
- { \@addtofilelist {#1} }
- { \seq_gput_right:Nn \g__file_record_seq {#1} }
- \seq_gpush:No \g__file_stack_seq \g_file_current_name_tl
- \tl_gset:Nn \g_file_current_name_tl {#1}
- \tex_input:D #1 \c_space_tl
- \seq_gpop:NN \g__file_stack_seq \l__file_internal_tl
- \tl_gset_eq:NN \g_file_current_name_tl \l__file_internal_tl
- }
-\cs_generate_variant:Nn \__file_input_aux:n { o }
-\cs_new_protected:Npn \file_path_include:n #1
- { \__file_name_sanitize:nn {#1} { \__file_path_include:n } }
-\cs_new_protected:Npn \__file_path_include:n #1
- {
- \seq_if_in:NnF \l__file_search_path_seq {#1}
- { \seq_put_right:Nn \l__file_search_path_seq {#1} }
- }
-\cs_new_protected:Npn \file_path_remove:n #1
- {
- \__file_name_sanitize:nn {#1}
- { \seq_remove_all:Nn \l__file_search_path_seq }
- }
-\cs_new_protected_nopar:Npn \file_list:
- {
- \seq_set_eq:NN \l__file_internal_seq \g__file_record_seq
- \clist_if_exist:NT \@filelist
- {
- \clist_map_inline:Nn \@filelist
- {
- \seq_put_right:No \l__file_internal_seq
- { \tl_to_str:n {##1} }
- }
- }
- \seq_remove_duplicates:N \l__file_internal_seq
- \iow_log:n { *~File~List~* }
- \seq_map_inline:Nn \l__file_internal_seq { \iow_log:n {##1} }
- \iow_log:n { ************* }
- }
-\AtBeginDocument
- {
- \clist_map_inline:Nn \@filelist
- { \seq_gput_right:No \g__file_record_seq { \tl_to_str:n {#1} } }
- }
-\cs_new_eq:NN \c_term_ior \c_sixteen
-\seq_new:N \g__ior_streams_seq
-\tl_new:N \l__ior_stream_tl
-\prop_new:N \g__ior_streams_prop
-\prop_gput:Nnn \g__ior_streams_prop { 0 } { LaTeX2e~reserved }
-\cs_new_protected:Npn \ior_new:N #1 { \cs_new_eq:NN #1 \c_term_ior }
-\cs_generate_variant:Nn \ior_new:N { c }
-\cs_new_protected:Npn \ior_open:Nn #1#2
- { \__file_name_sanitize:nn {#2} { \__ior_open_aux:Nn #1 } }
-\cs_generate_variant:Nn \ior_open:Nn { c }
-\cs_new_protected:Npn \__ior_open_aux:Nn #1#2
- {
- \file_add_path:nN {#2} \l__file_internal_name_tl
- \quark_if_no_value:NTF \l__file_internal_name_tl
- { \__msg_kernel_error:nnx { kernel } { file-not-found } {#2} }
- { \__ior_open:No #1 \l__file_internal_name_tl }
- }
-\prg_new_protected_conditional:Npnn \ior_open:Nn #1#2 { T , F , TF }
- { \__file_name_sanitize:nn {#2} { \__ior_open_aux:NnTF #1 } }
-\cs_generate_variant:Nn \ior_open:NnT { c }
-\cs_generate_variant:Nn \ior_open:NnF { c }
-\cs_generate_variant:Nn \ior_open:NnTF { c }
-\cs_new_protected:Npn \__ior_open_aux:NnTF #1#2
- {
- \file_add_path:nN {#2} \l__file_internal_name_tl
- \quark_if_no_value:NTF \l__file_internal_name_tl
- { \prg_return_false: }
- {
- \__ior_open:No #1 \l__file_internal_name_tl
- \prg_return_true:
- }
- }
-\cs_new_protected:Npn \__ior_open:Nn #1#2
- {
- \ior_close:N #1
- \seq_gpop:NNTF \g__ior_streams_seq \l__ior_stream_tl
- { \__ior_open_stream:Nn #1 {#2} }
- {
- \newread #1
- \tl_set:Nx \l__ior_stream_tl { \int_eval:n {#1} }
- \__ior_open_stream:Nn #1 {#2}
- }
- }
-\cs_generate_variant:Nn \__ior_open:Nn { No }
-\cs_new_protected:Npn \__ior_open_stream:Nn #1#2
- {
- \tex_global:D \tex_chardef:D #1 = \l__ior_stream_tl \scan_stop:
- \prop_gput:NVn \g__ior_streams_prop #1 {#2}
- \tex_openin:D #1 #2 \scan_stop:
- }
-\cs_new_protected:Npn \ior_close:N #1
- {
- \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
- {
- \tex_closein:D #1
- \prop_gremove:NV \g__ior_streams_prop #1
- \seq_if_in:NVF \g__ior_streams_seq #1
- { \seq_gpush:NV \g__ior_streams_seq #1 }
- \cs_gset_eq:NN #1 \c_term_ior
- }
- }
-\cs_generate_variant:Nn \ior_close:N { c }
-\cs_new_protected_nopar:Npn \ior_list_streams:
- { \__ior_list_streams:Nn \g__ior_streams_prop { input } }
-\cs_new_protected:Npn \__ior_list_streams:Nn #1#2
- {
- \__msg_term:nnn { LaTeX / kernel }
- { \prop_if_empty:NTF #1 { show-no-stream } { show-open-streams } }
- {#2}
- \__msg_show_variable:n
- { \prop_map_function:NN #1 \__msg_show_item_unbraced:nn }
- }
-\cs_new_eq:NN \if_eof:w \tex_ifeof:D
-\prg_new_conditional:Nnn \ior_if_eof:N { p , T , F , TF }
- {
- \cs_if_exist:NTF #1
- {
- \if_int_compare:w #1 = \c_sixteen
- \prg_return_true:
- \else:
- \if_eof:w #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- \fi:
- }
- { \prg_return_true: }
- }
-\cs_new_protected:Npn \ior_get:NN #1#2
- { \tex_read:D #1 to #2 }
-\cs_new_protected:Npn \ior_get_str:NN #1#2
- {
- \use:x
- {
- \int_set_eq:NN \tex_endlinechar:D \c_minus_one
- \exp_not:n { \etex_readline:D #1 to #2 }
- \int_set:Nn \tex_endlinechar:D { \int_use:N \tex_endlinechar:D }
- }
- }
-\ior_new:N \g__file_internal_ior
-\cs_new_eq:NN \c_log_iow \c_minus_one
-\cs_new_eq:NN \c_term_iow \c_sixteen
-\seq_new:N \g__iow_streams_seq
-\tl_new:N \l__iow_stream_tl
-\prop_new:N \g__iow_streams_prop
-\prop_put:Nnn \g__iow_streams_prop { 0 } { LaTeX2e~reserved }
-\prop_put:Nnn \g__iow_streams_prop { 1 } { LaTeX2e~reserved }
-\prop_put:Nnn \g__iow_streams_prop { 2 } { LaTeX2e~reserved }
-\cs_new_protected:Npn \iow_new:N #1 { \cs_new_eq:NN #1 \c_term_iow }
-\cs_generate_variant:Nn \iow_new:N { c }
-\cs_new_protected:Npn \iow_open:Nn #1#2
- { \__file_name_sanitize:nn {#2} { \__iow_open:Nn #1 } }
-\cs_generate_variant:Nn \iow_open:Nn { c }
-\cs_new_protected:Npn \__iow_open:Nn #1#2
- {
- \iow_close:N #1
- \seq_gpop:NNTF \g__iow_streams_seq \l__iow_stream_tl
- { \__iow_open_stream:Nn #1 {#2} }
- {
- \newwrite #1
- \tl_set:Nx \l__iow_stream_tl { \int_eval:n {#1} }
- \__iow_open_stream:Nn #1 {#2}
- }
- }
-\cs_generate_variant:Nn \__iow_open:Nn { No }
-\cs_new_protected:Npn \__iow_open_stream:Nn #1#2
- {
- \tex_global:D \tex_chardef:D #1 = \l__iow_stream_tl \scan_stop:
- \prop_gput:NVn \g__iow_streams_prop #1 {#2}
- \tex_immediate:D \tex_openout:D #1 #2 \scan_stop:
- }
-\cs_new_protected:Npn \iow_close:N #1
- {
- \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
- {
- \tex_immediate:D \tex_closeout:D #1
- \prop_gremove:NV \g__iow_streams_prop #1
- \seq_if_in:NVF \g__iow_streams_seq #1
- { \seq_gpush:NV \g__iow_streams_seq #1 }
- \cs_gset_eq:NN #1 \c_term_ior
- }
- }
-\cs_generate_variant:Nn \iow_close:N { c }
-\cs_new_protected_nopar:Npn \iow_list_streams:
- { \__iow_list_streams:Nn \g__iow_streams_prop { output } }
-\cs_new_eq:NN \__iow_list_streams:Nn \__ior_list_streams:Nn
-\cs_new_protected:Npn \iow_shipout_x:Nn #1#2
- { \tex_write:D #1 {#2} }
-\cs_generate_variant:Nn \iow_shipout_x:Nn { Nx }
-\cs_new_protected:Npn \iow_shipout:Nn #1#2
- { \tex_write:D #1 { \exp_not:n {#2} } }
-\cs_generate_variant:Nn \iow_shipout:Nn { Nx }
-\cs_new_protected:Npn \iow_now:Nn #1#2
- { \tex_immediate:D \tex_write:D #1 { \exp_not:n {#2} } }
-\cs_generate_variant:Nn \iow_now:Nn { Nx }
-\cs_set_protected_nopar:Npn \iow_log:x { \iow_now:Nx \c_log_iow }
-\cs_new_protected_nopar:Npn \iow_log:n { \iow_now:Nn \c_log_iow }
-\cs_set_protected_nopar:Npn \iow_term:x { \iow_now:Nx \c_term_iow }
-\cs_new_protected_nopar:Npn \iow_term:n { \iow_now:Nn \c_term_iow }
-\cs_new_nopar:Npn \iow_newline: { ^^J }
-\cs_new_eq:NN \iow_char:N \cs_to_str:N
-\int_new:N \l_iow_line_count_int
-\int_set:Nn \l_iow_line_count_int { 78 }
-\int_new:N \l__iow_target_count_int
-\int_new:N \l__iow_current_line_int
-\int_new:N \l__iow_current_word_int
-\int_new:N \l__iow_current_indentation_int
-\tl_new:N \l__iow_current_line_tl
-\tl_new:N \l__iow_current_word_tl
-\tl_new:N \l__iow_current_indentation_tl
-\tl_new:N \l__iow_wrap_tl
-\tl_new:N \l__iow_newline_tl
-\bool_new:N \l__iow_line_start_bool
-\group_begin:
- \char_set_catcode_other:N \*
- \char_set_lccode:nn {`\*} {`\ }
- \tl_to_lowercase:n { \tl_const:Nn \c_catcode_other_space_tl { * } }
-\group_end:
-\group_begin:
- \int_set_eq:NN \tex_escapechar:D \c_minus_one
- \tl_const:Nx \c__iow_wrap_marker_tl
- { \tl_to_str:n { \^^I \^^O \^^W \^^_ \^^W \^^R \^^A \^^P } }
-\group_end:
-\tl_map_inline:nn
- { { end } { newline } { indent } { unindent } }
- {
- \tl_const:cx { c__iow_wrap_ #1 _marker_tl }
- {
- \c_catcode_other_space_tl
- \c__iow_wrap_marker_tl
- \c_catcode_other_space_tl
- #1
- \c_catcode_other_space_tl
- }
- }
-\cs_new_protected:Npn \iow_indent:n #1 { }
-\cs_new:Npx \__iow_indent:n #1
- {
- \c__iow_wrap_indent_marker_tl
- #1
- \c__iow_wrap_unindent_marker_tl
- }
-\cs_new_protected:Npn \iow_wrap:nnnN #1#2#3#4
- {
- \group_begin:
- \int_set_eq:NN \tex_escapechar:D \c_minus_one
- \cs_set_nopar:Npx \{ { \token_to_str:N \{ }
- \cs_set_nopar:Npx \# { \token_to_str:N \# }
- \cs_set_nopar:Npx \} { \token_to_str:N \} }
- \cs_set_nopar:Npx \% { \token_to_str:N \% }
- \cs_set_nopar:Npx \~ { \token_to_str:N \~ }
- \int_set:Nn \tex_escapechar:D { 92 }
- \cs_set_eq:NN \\ \c__iow_wrap_newline_marker_tl
- \cs_set_eq:NN \ \c_catcode_other_space_tl
- \cs_set_eq:NN \iow_indent:n \__iow_indent:n
- #3
- \protected@edef \l__iow_wrap_tl {#1}
- \tl_set:Nx \l__iow_newline_tl { \iow_newline: #2 }
- \tl_set:Nx \l__iow_newline_tl { \tl_to_str:N \l__iow_newline_tl }
- \tl_replace_all:Nnn \l__iow_newline_tl { ~ } { \c_space_tl }
- \int_set:Nn \l__iow_target_count_int
- { \l_iow_line_count_int - \tl_count:N \l__iow_newline_tl + \c_one }
- \int_zero:N \l__iow_current_indentation_int
- \tl_clear:N \l__iow_current_indentation_tl
- \int_zero:N \l__iow_current_line_int
- \tl_clear:N \l__iow_current_line_tl
- \bool_set_true:N \l__iow_line_start_bool
- \use:x
- {
- \exp_not:n { \tl_clear:N \l__iow_wrap_tl }
- \__iow_wrap_loop:w
- \tl_to_str:N \l__iow_wrap_tl
- \tl_to_str:N \c__iow_wrap_end_marker_tl
- \c_space_tl \c_space_tl
- \exp_not:N \q_stop
- }
- \exp_args:NNo \group_end:
- #4 \l__iow_wrap_tl
- }
-\cs_new_protected:Npn \__iow_wrap_loop:w #1 ~ %
- {
- \tl_set:Nn \l__iow_current_word_tl {#1}
- \tl_if_eq:NNTF \l__iow_current_word_tl \c__iow_wrap_marker_tl
- { \__iow_wrap_special:w }
- { \__iow_wrap_word: }
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_word:
- {
- \int_set:Nn \l__iow_current_word_int
- { \__str_count_ignore_spaces:N \l__iow_current_word_tl }
- \int_add:Nn \l__iow_current_line_int { \l__iow_current_word_int }
- \int_compare:nNnTF \l__iow_current_line_int < \l__iow_target_count_int
- { \__iow_wrap_word_fits: }
- { \__iow_wrap_word_newline: }
- \__iow_wrap_loop:w
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_word_fits:
- {
- \bool_if:NTF \l__iow_line_start_bool
- {
- \bool_set_false:N \l__iow_line_start_bool
- \tl_put_right:Nx \l__iow_current_line_tl
- { \l__iow_current_indentation_tl \l__iow_current_word_tl }
- \int_add:Nn \l__iow_current_line_int
- { \l__iow_current_indentation_int }
- }
- {
- \tl_put_right:Nx \l__iow_current_line_tl
- { ~ \l__iow_current_word_tl }
- \int_incr:N \l__iow_current_line_int
- }
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_word_newline:
- {
- \tl_put_right:Nx \l__iow_wrap_tl
- { \l__iow_current_line_tl \l__iow_newline_tl }
- \int_set:Nn \l__iow_current_line_int
- {
- \l__iow_current_word_int
- + \l__iow_current_indentation_int
- }
- \tl_set:Nx \l__iow_current_line_tl
- { \l__iow_current_indentation_tl \l__iow_current_word_tl }
- }
-\cs_new_protected:Npn \__iow_wrap_special:w #1 ~ #2 ~ #3 ~ %
- {
- \use:c { __iow_wrap_#1: }
- \str_if_eq_x:nnTF { #2~#3 } { ~ \c__iow_wrap_marker_tl }
- { \__iow_wrap_special:w }
- { \__iow_wrap_loop:w #2 ~ #3 ~ }
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_newline:
- {
- \tl_put_right:Nx \l__iow_wrap_tl
- { \l__iow_current_line_tl \l__iow_newline_tl }
- \int_zero:N \l__iow_current_line_int
- \tl_clear:N \l__iow_current_line_tl
- \bool_set_true:N \l__iow_line_start_bool
- }
-\cs_new_protected_nopar:Npx \__iow_wrap_indent:
- {
- \int_add:Nn \l__iow_current_indentation_int \c_four
- \tl_put_right:Nx \exp_not:N \l__iow_current_indentation_tl
- { \c_space_tl \c_space_tl \c_space_tl \c_space_tl }
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_unindent:
- {
- \int_sub:Nn \l__iow_current_indentation_int \c_four
- \tl_set:Nx \l__iow_current_indentation_tl
- { \prg_replicate:nn \l__iow_current_indentation_int { ~ } }
- }
-\cs_new_protected_nopar:Npn \__iow_wrap_end:
- {
- \tl_put_right:Nx \l__iow_wrap_tl
- { \l__iow_current_line_tl }
- \use_none_delimit_by_q_stop:w
- }
-\cs_new_nopar:Npn \__str_count_ignore_spaces:N
- { \exp_args:No \__str_count_ignore_spaces:n }
-\cs_new:Npn \__str_count_ignore_spaces:n #1
- {
- \__int_value:w \__int_eval:w
- \exp_after:wN \__str_count_loop:NNNNNNNNN \tl_to_str:n {#1}
- { X8 } { X7 } { X6 } { X5 } { X4 } { X3 } { X2 } { X1 } { X0 } \q_stop
- \__int_eval_end:
- }
-\cs_new:Npn \__str_count_loop:NNNNNNNNN #1#2#3#4#5#6#7#8#9
- {
- \if_catcode:w X #9
- \exp_after:wN \use_none_delimit_by_q_stop:w
- \else:
- 9 +
- \exp_after:wN \__str_count_loop:NNNNNNNNN
- \fi:
- }
-\__msg_kernel_new:nnnn { kernel } { file-not-found }
- { File~'#1'~not~found. }
- {
- The~requested~file~could~not~be~found~in~the~current~directory,~
- in~the~TeX~search~path~or~in~the~LaTeX~search~path.
- }
-\__msg_kernel_new:nnnn { kernel } { input-streams-exhausted }
- { Input~streams~exhausted }
- {
- TeX~can~only~open~up~to~16~input~streams~at~one~time.\\
- All~16~are~currently~in~use,~and~something~wanted~to~open~
- another~one.
- }
-\__msg_kernel_new:nnnn { kernel } { output-streams-exhausted }
- { Output~streams~exhausted }
- {
- TeX~can~only~open~up~to~16~output~streams~at~one~time.\\
- All~16~are~currently~in~use,~and~something~wanted~to~open~
- another~one.
- }
-\__msg_kernel_new:nnnn { kernel } { space-in-file-name }
- { Space~in~file~name~'#1'. }
- {
- Spaces~are~not~permitted~in~files~loaded~by~LaTeX: \\
- Further~errors~may~follow!
- }
-%%
-%%
-%% End of file `l3file.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty b/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty
deleted file mode 100644
index 5ec5c9c034c..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3fp.sty
+++ /dev/null
@@ -1,5630 +0,0 @@
-%%
-%% This is file `l3fp.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3fp.dtx (with options: `package')
-%% l3fp-aux.dtx (with options: `package')
-%% l3fp-traps.dtx (with options: `package')
-%% l3fp-round.dtx (with options: `package')
-%% l3fp-parse.dtx (with options: `package')
-%% l3fp-logic.dtx (with options: `package')
-%% l3fp-basics.dtx (with options: `package')
-%% l3fp-extended.dtx (with options: `package')
-%% l3fp-expo.dtx (with options: `package')
-%% l3fp-trig.dtx (with options: `package')
-%% l3fp-convert.dtx (with options: `package')
-%% l3fp-assign.dtx (with options: `package')
-%% l3fp-old.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3fp.dtx Copyright (C) 2011-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3fp.dtx 4642 2014-01-04 17:28:32Z joseph $
- {L3 Floating points}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-%% File: l3fp-aux.dtx Copyright(C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_use_none_stop_f:n #1 { \exp_stop_f: }
-\cs_new:Npn \__fp_use_s:n #1 { #1; }
-\cs_new:Npn \__fp_use_s:nn #1#2 { #1#2; }
-\cs_new:Npn \__fp_use_none_until_s:w #1; { }
-\cs_new:Npn \__fp_use_i_until_s:nw #1#2; {#1}
-\cs_new:Npn \__fp_use_ii_until_s:nnw #1#2#3; {#2}
-\cs_new:Npn \__fp_reverse_args:Nww #1 #2; #3; { #1 #3; #2; }
-\cs_new:Npn \__fp_rrot:www #1; #2; #3; { #2; #3; #1; }
-\cs_new:Npn \__fp_use_i:ww #1; #2; { #1; }
-\cs_new:Npn \__fp_use_i:www #1; #2; #3; { #1; }
-\__scan_new:N \s__fp
-\cs_new_protected:Npn \__fp_chk:w #1 ;
- {
- \__msg_kernel_error:nnx { kernel } { misused-fp }
- { \fp_to_tl:n { \s__fp \__fp_chk:w #1 ; } }
- }
-\__scan_new:N \s__fp_mark
-\__scan_new:N \s__fp_stop
-\__scan_new:N \s__fp_invalid
-\__scan_new:N \s__fp_underflow
-\__scan_new:N \s__fp_overflow
-\__scan_new:N \s__fp_division
-\__scan_new:N \s__fp_exact
-\tl_const:Nn \c_zero_fp { \s__fp \__fp_chk:w 0 0 \s__fp_exact ; }
-\tl_const:Nn \c_minus_zero_fp { \s__fp \__fp_chk:w 0 2 \s__fp_exact ; }
-\tl_const:Nn \c_inf_fp { \s__fp \__fp_chk:w 2 0 \s__fp_exact ; }
-\tl_const:Nn \c_minus_inf_fp { \s__fp \__fp_chk:w 2 2 \s__fp_exact ; }
-\tl_const:Nn \c_nan_fp { \s__fp \__fp_chk:w 3 1 \s__fp_exact ; }
-\int_const:Nn \c__fp_max_exponent_int { 10000 }
-\cs_new:Npn \__fp_zero_fp:N #1 { \s__fp \__fp_chk:w 0 #1 \s__fp_underflow ; }
-\cs_new:Npn \__fp_inf_fp:N #1 { \s__fp \__fp_chk:w 2 #1 \s__fp_overflow ; }
-\cs_new:Npn \__fp_min_fp:N #1
- {
- \s__fp \__fp_chk:w 1 #1
- { \int_eval:n { - \c__fp_max_exponent_int } }
- {1000} {0000} {0000} {0000} ;
- }
-\cs_new:Npn \__fp_max_fp:N #1
- {
- \s__fp \__fp_chk:w 1 #1
- { \int_use:N \c__fp_max_exponent_int }
- {9999} {9999} {9999} {9999} ;
- }
-\cs_new:Npn \__fp_exponent:w \s__fp \__fp_chk:w #1
- {
- \if_meaning:w 1 #1
- \exp_after:wN \__fp_use_ii_until_s:nnw
- \else:
- \exp_after:wN \__fp_use_i_until_s:nw
- \exp_after:wN 0
- \fi:
- }
-\cs_new:Npn \__fp_neg_sign:N #1
- { \__int_eval:w \c_two - #1 \__int_eval_end: }
-\cs_new:Npn \__fp_sanitize:Nw #1 #2;
- {
- \if_case:w \if_int_compare:w #2 > \c__fp_max_exponent_int \c_one \else:
- \if_int_compare:w #2 < - \c__fp_max_exponent_int \c_two \else:
- \if_meaning:w 1 #1 \c_three \else: \c_zero \fi: \fi: \fi:
- \or: \exp_after:wN \__fp_overflow:w
- \or: \exp_after:wN \__fp_underflow:w
- \or: \exp_after:wN \__fp_sanitize_zero:w
- \fi:
- \s__fp \__fp_chk:w 1 #1 {#2}
- }
-\cs_new:Npn \__fp_sanitize:wN #1; #2 { \__fp_sanitize:Nw #2 #1; }
-\cs_new:Npn \__fp_sanitize_zero:w \s__fp \__fp_chk:w #1 #2 #3; { \c_zero_fp }
-\cs_new:Npn \__fp_exp_after_o:w \s__fp \__fp_chk:w #1
- {
- \if_meaning:w 1 #1
- \exp_after:wN \__fp_exp_after_normal:nNNw
- \else:
- \exp_after:wN \__fp_exp_after_special:nNNw
- \fi:
- { }
- #1
- }
-\cs_new:Npn \__fp_exp_after_o:nw #1 \s__fp \__fp_chk:w #2
- {
- \if_meaning:w 1 #2
- \exp_after:wN \__fp_exp_after_normal:nNNw
- \else:
- \exp_after:wN \__fp_exp_after_special:nNNw
- \fi:
- { #1 }
- #2
- }
-\cs_new:Npn \__fp_exp_after_f:nw #1 \s__fp \__fp_chk:w #2
- {
- \if_meaning:w 1 #2
- \exp_after:wN \__fp_exp_after_normal:nNNw
- \else:
- \exp_after:wN \__fp_exp_after_special:nNNw
- \fi:
- { \tex_romannumeral:D -`0 #1 }
- #2
- }
-\cs_new:Npn \__fp_exp_after_special:nNNw #1#2#3#4;
- {
- \exp_after:wN \s__fp
- \exp_after:wN \__fp_chk:w
- \exp_after:wN #2
- \exp_after:wN #3
- \exp_after:wN #4
- \exp_after:wN ;
- #1
- }
-\cs_new:Npn \__fp_exp_after_normal:nNNw #1 1 #2 #3 #4#5#6#7;
- {
- \exp_after:wN \__fp_exp_after_normal:Nwwwww
- \exp_after:wN #2
- \__int_value:w #3 \exp_after:wN ;
- \__int_value:w 1 #4 \exp_after:wN ;
- \__int_value:w 1 #5 \exp_after:wN ;
- \__int_value:w 1 #6 \exp_after:wN ;
- \__int_value:w 1 #7 \exp_after:wN ; #1
- }
-\cs_new:Npn \__fp_exp_after_normal:Nwwwww
- #1 #2; 1 #3 ; 1 #4 ; 1 #5 ; 1 #6 ;
- { \s__fp \__fp_chk:w 1 #1 {#2} {#3} {#4} {#5} {#6} ; }
-\cs_new:Npn \__fp_exp_after_array_f:w #1
- {
- \cs:w __fp_exp_after \__fp_type_from_scan:N #1 _f:nw \cs_end:
- { \__fp_exp_after_array_f:w }
- #1
- }
-\cs_new_eq:NN \__fp_exp_after_stop_f:nw \use_none:nn
-\int_const:Nn \c__fp_leading_shift_int { - 5 0000 }
-\int_const:Nn \c__fp_middle_shift_int { 5 0000 * 9999 }
-\int_const:Nn \c__fp_trailing_shift_int { 5 0000 * 10000 }
-\cs_new:Npn \__fp_pack:NNNNNw #1 #2#3#4#5 #6; { + #1#2#3#4#5 ; {#6} }
-\int_const:Nn \c__fp_big_leading_shift_int { - 15 2374 }
-\int_const:Nn \c__fp_big_middle_shift_int { 15 2374 * 9999 }
-\int_const:Nn \c__fp_big_trailing_shift_int { 15 2374 * 10000 }
-\cs_new:Npn \__fp_pack_big:NNNNNNw #1#2 #3#4#5#6 #7;
- { + #1#2#3#4#5#6 ; {#7} }
-\int_const:Nn \c__fp_Bigg_leading_shift_int { - 20 0000 }
-\int_const:Nn \c__fp_Bigg_middle_shift_int { 20 0000 * 9999 }
-\int_const:Nn \c__fp_Bigg_trailing_shift_int { 20 0000 * 10000 }
-\cs_new:Npn \__fp_pack_Bigg:NNNNNNw #1#2 #3#4#5#6 #7;
- { + #1#2#3#4#5#6 ; {#7} }
-\cs_new:Npn \__fp_pack_twice_four:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9
- { #1 {#2#3#4#5} {#6#7#8#9} ; }
-\cs_new:Npn \__fp_pack_eight:wNNNNNNNN #1; #2#3#4#5 #6#7#8#9
- { #1 {#2#3#4#5#6#7#8#9} ; }
-\cs_new:Npn \__fp_decimate:nNnnnn #1
- {
- \cs:w
- __fp_decimate_
- \if_int_compare:w \__int_eval:w #1 > \c_sixteen
- tiny
- \else:
- \tex_romannumeral:D \__int_eval:w #1
- \fi:
- :Nnnnn
- \cs_end:
- }
-\cs_new:Npn \__fp_decimate_:Nnnnn #1 #2#3#4#5
- { #1 0 {#2#3} {#4#5} ; }
-\cs_new:Npn \__fp_decimate_tiny:Nnnnn #1 #2#3#4#5
- { #1 1 { 0000 0000 } { 0000 0000 } 0 #2#3#4#5 ; }
-\cs_new:Npn \__fp_tmp:w #1 #2 #3
- {
- \cs_new:cpn { __fp_decimate_ #1 :Nnnnn } ##1 ##2##3##4##5
- {
- \exp_after:wN ##1
- \__int_value:w
- \exp_after:wN \__fp_round_digit:Nw #2 ;
- \__fp_decimate_pack:nnnnnnnnnnw #3 ;
- }
- }
-\__fp_tmp:w {i} {\use_none:nnn #50} { 0{#2}#3{#4}#5 }
-\__fp_tmp:w {ii} {\use_none:nn #5 } { 00{#2}#3{#4}#5 }
-\__fp_tmp:w {iii} {\use_none:n #5 } { 000{#2}#3{#4}#5 }
-\__fp_tmp:w {iv} { #5 } { {0000}#2{#3}#4 #5 }
-\__fp_tmp:w {v} {\use_none:nnn #4#5 } { 0{0000}#2{#3}#4 #5 }
-\__fp_tmp:w {vi} {\use_none:nn #4#5 } { 00{0000}#2{#3}#4 #5 }
-\__fp_tmp:w {vii} {\use_none:n #4#5 } { 000{0000}#2{#3}#4 #5 }
-\__fp_tmp:w {viii}{ #4#5 } { {0000}0000{#2}#3 #4 #5 }
-\__fp_tmp:w {ix} {\use_none:nnn #3#4+#5} { 0{0000}0000{#2}#3 #4 #5 }
-\__fp_tmp:w {x} {\use_none:nn #3#4+#5} { 00{0000}0000{#2}#3 #4 #5 }
-\__fp_tmp:w {xi} {\use_none:n #3#4+#5} { 000{0000}0000{#2}#3 #4 #5 }
-\__fp_tmp:w {xii} { #3#4+#5} { {0000}0000{0000}#2 #3 #4 #5 }
-\__fp_tmp:w {xiii}{\use_none:nnn#2#3+#4#5} { 0{0000}0000{0000}#2 #3 #4 #5 }
-\__fp_tmp:w {xiv} {\use_none:nn #2#3+#4#5} { 00{0000}0000{0000}#2 #3 #4 #5 }
-\__fp_tmp:w {xv} {\use_none:n #2#3+#4#5} { 000{0000}0000{0000}#2 #3 #4 #5 }
-\__fp_tmp:w {xvi} { #2#3+#4#5} {{0000}0000{0000}0000 #2 #3 #4 #5 }
-\cs_new:Npn \__fp_decimate_pack:nnnnnnnnnnw #1#2#3#4#5
- { \__fp_decimate_pack:nnnnnnw { #1#2#3#4#5 } }
-\cs_new:Npn \__fp_decimate_pack:nnnnnnw #1 #2#3#4#5#6
- { {#1} {#2#3#4#5#6} }
-\cs_new:Npn \__fp_case_use:nw #1#2 \fi: #3 \s__fp { \fi: #1 \s__fp }
-\cs_new:Npn \__fp_case_return:nw #1#2 \fi: #3 ; { \fi: #1 }
-\cs_new:Npn \__fp_case_return_o:Nw #1#2 \fi: #3 \s__fp #4 ;
- { \fi: \exp_after:wN #1 }
-\cs_new:Npn \__fp_case_return_same_o:w #1 \fi: #2 \s__fp
- { \fi: \__fp_exp_after_o:w \s__fp }
-\cs_new:Npn \__fp_case_return_o:Nww #1#2 \fi: #3 \s__fp #4 ; #5 ;
- { \fi: \exp_after:wN #1 }
-\cs_new:Npn \__fp_case_return_i_o:ww #1 \fi: #2 \s__fp #3 ; \s__fp #4 ;
- { \fi: \__fp_exp_after_o:w \s__fp #3 ; }
-\cs_new:Npn \__fp_case_return_ii_o:ww #1 \fi: #2 \s__fp #3 ;
- { \fi: \__fp_exp_after_o:w }
-\cs_new:Npn \__fp_small_int:wTF \s__fp \__fp_chk:w #1#2
- {
- \if_case:w #1 \exp_stop_f:
- \__fp_case_return:nw { \__fp_small_int_true:wTF 0 ; }
- \or: \exp_after:wN \__fp_small_int_normal:NnwTF
- \or:
- \__fp_case_return:nw
- {
- \exp_after:wN \__fp_small_int_true:wTF \__int_value:w
- \if_meaning:w 2 #2 - \fi: 1 0000 0000 ;
- }
- \else: \__fp_case_return:nw \use_ii:nn
- \fi:
- #2
- }
-\cs_new:Npn \__fp_small_int_true:wTF #1; #2#3 { #2 {#1} }
-\cs_new:Npn \__fp_small_int_normal:NnwTF #1#2#3;
- {
- \if_int_compare:w #2 > \c_zero
- \__fp_decimate:nNnnnn { \c_sixteen - #2 }
- \__fp_small_int_test:NnnwNnw
- #3 #1 {#2}
- \else:
- \exp_after:wN \use_iii:nnn
- \fi:
- ;
- }
-\cs_new:Npn \__fp_small_int_test:NnnwNnw #1#2#3#4; #5#6
- {
- \if_meaning:w 0 #1
- \exp_after:wN \__fp_small_int_true:wTF
- \__int_value:w \if_meaning:w 2 #5 - \fi:
- \if_int_compare:w #6 > \c_eight
- 1 0000 0000
- \else:
- #3
- \fi:
- \else:
- \use_i:nn
- \fi:
- }
-\cs_new:Npn \__fp_array_count:n #1
- {
- \int_use:N \__int_eval:w \c_zero
- \__fp_array_count_loop:Nw #1 { ? \__prg_break: } ;
- \__prg_break_point:
- \__int_eval_end:
- }
-\cs_new:Npn \__fp_array_count_loop:Nw #1#2;
- { \use_none:n #1 + \c_one \__fp_array_count_loop:Nw }
-\cs_new:Npn \__fp_expand:n #1
- {
- \__fp_expand_loop:nwnN { }
- #1 \prg_do_nothing:
- \s__fp_mark { } \__fp_expand_loop:nwnN
- \s__fp_mark { } \__fp_use_i_until_s:nw ;
- }
-\cs_new:Npn \__fp_expand_loop:nwnN #1#2 \s__fp_mark #3 #4
- {
- \exp_after:wN #4 \tex_romannumeral:D -`0
- #2
- \s__fp_mark { #3 #1 } #4
- }
-\__msg_kernel_new:nnnn { kernel } { misused-fp }
- { A~floating~point~with~value~'#1'~was~misused. }
- {
- To~obtain~the~value~of~a~floating~point~variable,~use~
- '\token_to_str:N \fp_to_decimal:N',~
- '\token_to_str:N \fp_to_scientific:N',~or~other~
- conversion~functions.
- }
-%%
-%% File: l3fp-traps.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new_protected:Npn \fp_flag_off:n #1
- { \cs_set_eq:cN { l__fp_ #1 _flag_token } \tex_undefined:D }
-\cs_new:Npn \fp_flag_on:n #1
- { \exp_args:Nc \use_none:n { l__fp_ #1 _flag_token } }
-\prg_new_conditional:Npnn \fp_if_flag_on:n #1 { p , T , F , TF }
- {
- \if_cs_exist:w l__fp_ #1 _flag_token \cs_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new_eq:NN \l__fp_invalid_operation_flag_token \tex_undefined:D
-\cs_new_eq:NN \l__fp_division_by_zero_flag_token \tex_undefined:D
-\cs_new_eq:NN \l__fp_overflow_flag_token \tex_undefined:D
-\cs_new_eq:NN \l__fp_underflow_flag_token \tex_undefined:D
-\cs_new_protected:Npn \fp_trap:nn #1#2
- {
- \cs_if_exist_use:cF { __fp_trap_#1_set_#2: }
- {
- \clist_if_in:nnTF
- { invalid_operation , division_by_zero , overflow , underflow }
- {#1}
- {
- \__msg_kernel_error:nnxx { kernel }
- { unknown-fpu-trap-type } {#1} {#2}
- }
- { \__msg_kernel_error:nnx { kernel } { unknown-fpu-exception } {#1} }
- }
- }
-\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_error:
- { \__fp_trap_invalid_operation_set:N \prg_do_nothing: }
-\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_flag:
- { \__fp_trap_invalid_operation_set:N \use_none:nnnnn }
-\cs_new_protected_nopar:Npn \__fp_trap_invalid_operation_set_none:
- { \__fp_trap_invalid_operation_set:N \use_none:nnnnnnn }
-\cs_new_protected:Npn \__fp_trap_invalid_operation_set:N #1
- {
- \exp_args:Nno \use:n
- { \cs_set:Npn \__fp_invalid_operation:nnw ##1##2##3; }
- {
- #1
- \__fp_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { }
- \fp_flag_on:n { invalid_operation }
- ##1
- }
- \exp_args:Nno \use:n
- { \cs_set:Npn \__fp_invalid_operation_o:Nww ##1##2; ##3; }
- {
- #1
- \__fp_error:nffn { invalid-ii }
- { \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1}
- \fp_flag_on:n { invalid_operation }
- \exp_after:wN \c_nan_fp
- }
- \exp_args:Nno \use:n
- { \cs_set:Npn \__fp_invalid_operation_tl_o:ff ##1##2 }
- {
- #1
- \__fp_error:nffn { invalid } {##1} {##2} { }
- \fp_flag_on:n { invalid_operation }
- \exp_after:wN \c_nan_fp
- }
- }
-\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_error:
- { \__fp_trap_division_by_zero_set:N \prg_do_nothing: }
-\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_flag:
- { \__fp_trap_division_by_zero_set:N \use_none:nnnnn }
-\cs_new_protected_nopar:Npn \__fp_trap_division_by_zero_set_none:
- { \__fp_trap_division_by_zero_set:N \use_none:nnnnnnn }
-\cs_new_protected:Npn \__fp_trap_division_by_zero_set:N #1
- {
- \exp_args:Nno \use:n
- { \cs_set:Npn \__fp_division_by_zero_o:Nnw ##1##2##3; }
- {
- #1
- \__fp_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { }
- \fp_flag_on:n { division_by_zero }
- \exp_after:wN ##1
- }
- \exp_args:Nno \use:n
- { \cs_set:Npn \__fp_division_by_zero_o:NNww ##1##2##3; ##4; }
- {
- #1
- \__fp_error:nffn { zero-div-ii }
- { \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2}
- \fp_flag_on:n { division_by_zero }
- \exp_after:wN ##1
- }
- }
-\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_error:
- { \__fp_trap_overflow_set:N \prg_do_nothing: }
-\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_flag:
- { \__fp_trap_overflow_set:N \use_none:nnnnn }
-\cs_new_protected_nopar:Npn \__fp_trap_overflow_set_none:
- { \__fp_trap_overflow_set:N \use_none:nnnnnnn }
-\cs_new_protected:Npn \__fp_trap_overflow_set:N #1
- { \__fp_trap_overflow_set:NnNn #1 { overflow } \__fp_inf_fp:N { inf } }
-\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_error:
- { \__fp_trap_underflow_set:N \prg_do_nothing: }
-\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_flag:
- { \__fp_trap_underflow_set:N \use_none:nnnnn }
-\cs_new_protected_nopar:Npn \__fp_trap_underflow_set_none:
- { \__fp_trap_underflow_set:N \use_none:nnnnnnn }
-\cs_new_protected:Npn \__fp_trap_underflow_set:N #1
- { \__fp_trap_overflow_set:NnNn #1 { underflow } \__fp_zero_fp:N { 0 } }
-\cs_new_protected:Npn \__fp_trap_overflow_set:NnNn #1#2#3#4
- {
- \exp_args:Nno \use:n
- { \cs_set:cpn { __fp_ #2 :w } \s__fp \__fp_chk:w ##1##2##3; }
- {
- #1
- \__fp_error:nffn
- { flow \if_meaning:w 1 ##1 -to \fi: }
- { \fp_to_tl:n { \s__fp \__fp_chk:w ##1##2##3; } }
- { \token_if_eq_meaning:NNF 0 ##2 { - } #4 }
- {#2}
- \fp_flag_on:n {#2}
- #3 ##2
- }
- }
-\cs_new:Npn \__fp_invalid_operation:nnw #1#2#3; { }
-\cs_new:Npn \__fp_invalid_operation_o:Nww #1#2; #3; { }
-\cs_new:Npn \__fp_invalid_operation_tl_o:ff #1 #2 { }
-\cs_new:Npn \__fp_division_by_zero_o:Nnw #1#2#3; { }
-\cs_new:Npn \__fp_division_by_zero_o:NNww #1#2#3; #4; { }
-\cs_new:Npn \__fp_overflow:w { }
-\cs_new:Npn \__fp_underflow:w { }
-\fp_trap:nn { invalid_operation } { error }
-\fp_trap:nn { division_by_zero } { flag }
-\fp_trap:nn { overflow } { flag }
-\fp_trap:nn { underflow } { flag }
-\cs_new_nopar:Npn \__fp_invalid_operation_o:nw
- { \__fp_invalid_operation:nnw { \exp_after:wN \c_nan_fp } }
-\cs_generate_variant:Nn \__fp_invalid_operation_o:nw { f }
-\cs_new:Npn \__fp_error:nnnn #1
- { \__msg_kernel_expandable_error:nnnnn { kernel } { fp - #1 } }
-\cs_generate_variant:Nn \__fp_error:nnnn { nnf, nff }
-\__msg_kernel_new:nnnn { kernel } { unknown-fpu-exception }
- { The~FPU~exception~'#1'~is~not~known:~that~trap~will~never~be~triggered. }
- {
- The~only~exceptions~to~which~traps~can~be~attached~are \\
- \iow_indent:n
- {
- * ~ invalid_operation \\
- * ~ division_by_zero \\
- * ~ overflow \\
- * ~ underflow
- }
- }
-\__msg_kernel_new:nnnn { kernel } { unknown-fpu-trap-type }
- { The~FPU~trap~type~'#2'~is~not~known. }
- {
- The~trap~type~must~be~one~of \\
- \iow_indent:n
- {
- * ~ error \\
- * ~ flag \\
- * ~ none
- }
- }
-\__msg_kernel_new:nnn { kernel } { fp-flow }
- { An ~ #3 ~ occurred. }
-\__msg_kernel_new:nnn { kernel } { fp-flow-to }
- { #1 ~ #3 ed ~ to ~ #2 . }
-\__msg_kernel_new:nnn { kernel } { fp-zero-div }
- { Division~by~zero~in~ #1 (#2) }
-\__msg_kernel_new:nnn { kernel } { fp-zero-div-ii }
- { Division~by~zero~in~ (#1) #3 (#2) }
-\__msg_kernel_new:nnn { kernel } { fp-invalid }
- { Invalid~operation~ #1 (#2) }
-\__msg_kernel_new:nnn { kernel } { fp-invalid-ii }
- { Invalid~operation~ (#1) #3 (#2) }
-%% File: l3fp-round.dtx Copyright(C) 2011-2012 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_round_return_one:
- { \exp_after:wN \c_one \tex_romannumeral:D }
-\cs_new:Npn \__fp_round_to_ninf:NNN #1 #2 #3
- {
- \if_meaning:w 2 #1
- \if_int_compare:w #3 > \c_zero
- \__fp_round_return_one:
- \fi:
- \fi:
- \c_zero
- }
-\cs_new:Npn \__fp_round_to_zero:NNN #1 #2 #3 { \c_zero }
-\cs_new:Npn \__fp_round_to_pinf:NNN #1 #2 #3
- {
- \if_meaning:w 0 #1
- \if_int_compare:w #3 > \c_zero
- \__fp_round_return_one:
- \fi:
- \fi:
- \c_zero
- }
-\cs_new:Npn \__fp_round_to_nearest:NNN #1 #2 #3
- {
- \if_int_compare:w #3 > \c_five
- \__fp_round_return_one:
- \else:
- \if_meaning:w 5 #3
- \if_int_odd:w #2 \exp_stop_f:
- \__fp_round_return_one:
- \fi:
- \fi:
- \fi:
- \c_zero
- }
-\cs_new_eq:NN \__fp_round:NNN \__fp_round_to_nearest:NNN
-\cs_new:Npn \__fp_round_s:NNNw #1 #2 #3 #4;
- {
- \exp_after:wN \__fp_round:NNN
- \exp_after:wN #1
- \exp_after:wN #2
- \int_use:N \__int_eval:w
- \if_int_odd:w 0 \if_meaning:w 0 #3 1 \fi:
- \if_meaning:w 5 #3 1 \fi:
- \exp_stop_f:
- \if_int_compare:w \__int_eval:w #4 > \c_zero
- 1 +
- \fi:
- \fi:
- #3
- ;
- }
-\cs_new:Npn \__fp_round_digit:Nw #1 #2;
- {
- \if_int_odd:w \if_meaning:w 0 #1 \c_one \else:
- \if_meaning:w 5 #1 \c_one \else:
- \c_zero \fi: \fi:
- \if_int_compare:w \__int_eval:w #2 > \c_zero
- \__int_eval:w \c_one +
- \fi:
- \fi:
- #1
- }
-\cs_new:Npn \__fp_round_to_ninf_neg:NNN #1 #2 #3
- {
- \if_meaning:w 0 #1
- \if_int_compare:w #3 > \c_zero
- \__fp_round_return_one:
- \fi:
- \fi:
- \c_zero
- }
-\cs_new:Npn \__fp_round_to_zero_neg:NNN #1 #2 #3
- {
- \if_int_compare:w #3 > \c_zero
- \__fp_round_return_one:
- \fi:
- \c_zero
- }
-\cs_new:Npn \__fp_round_to_pinf_neg:NNN #1 #2 #3
- {
- \if_meaning:w 2 #1
- \if_int_compare:w #3 > \c_zero
- \__fp_round_return_one:
- \fi:
- \fi:
- \c_zero
- }
-\cs_new_eq:NN \__fp_round_to_nearest_neg:NNN \__fp_round_to_nearest:NNN
-\cs_new_eq:NN \__fp_round_neg:NNN \__fp_round_to_nearest_neg:NNN
-\cs_new:Npn \__fp_round_o:Nw #1#2 @
- {
- \if_case:w
- \__int_eval:w \__fp_array_count:n {#2} - \c_one \__int_eval_end:
- \__fp_round:Nwn #1 #2 {0} \tex_romannumeral:D
- \or: \__fp_round:Nww #1 #2 \tex_romannumeral:D
- \else:
- \__fp_error:nffn { num-args }
- { \__fp_round_name_from_cs:N #1 () } { 1 } { 2 }
- \exp_after:wN \c_nan_fp \tex_romannumeral:D
- \fi:
- -`0
- }
-\cs_new:Npn \__fp_round_name_from_cs:N #1
- {
- \cs_if_eq:NNTF #1 \__fp_round_to_zero:NNN { trunc }
- {
- \cs_if_eq:NNTF #1 \__fp_round_to_ninf:NNN { floor }
- {
- \cs_if_eq:NNTF #1 \__fp_round_to_pinf:NNN { ceil }
- { round }
- }
- }
- }
-\cs_new:Npn \__fp_round:Nww #1#2 ; #3 ;
- {
- \__fp_small_int:wTF #3; { \__fp_round:Nwn #1#2; }
- {
- \__fp_invalid_operation_tl_o:ff
- { \__fp_round_name_from_cs:N #1 }
- { \__fp_array_to_clist:n { #2; #3; } }
- }
- }
-\cs_new:Npn \__fp_round:Nwn #1 \s__fp \__fp_chk:w #2#3#4; #5
- {
- \if_meaning:w 1 #2
- \exp_after:wN \__fp_round_normal:NwNNnw
- \exp_after:wN #1
- \__int_value:w #5
- \else:
- \exp_after:wN \__fp_exp_after_o:w
- \fi:
- \s__fp \__fp_chk:w #2#3#4;
- }
-\cs_new:Npn \__fp_round_normal:NwNNnw #1#2 \s__fp \__fp_chk:w 1#3#4#5;
- {
- \__fp_decimate:nNnnnn { \c_sixteen - #4 - #2 }
- \__fp_round_normal:NnnwNNnn #5 #1 #3 {#4} {#2}
- }
-\cs_new:Npn \__fp_round_normal:NnnwNNnn #1#2#3#4; #5#6
- {
- \exp_after:wN \__fp_round_normal:NNwNnn
- \int_use:N \__int_eval:w
- \if_int_compare:w #2 > \c_zero
- 1 \__int_value:w #2
- \exp_after:wN \__fp_round_pack:Nw
- \int_use:N \__int_eval:w 1#3 +
- \else:
- \if_int_compare:w #3 > \c_zero
- 1 \__int_value:w #3 +
- \fi:
- \fi:
- \exp_after:wN #5
- \exp_after:wN #6
- \use_none:nnnnnnn #3
- #1
- \__int_eval_end:
- 0000 0000 0000 0000 ; #6
- }
-\cs_new:Npn \__fp_round_pack:Nw #1
- { \if_meaning:w 2 #1 + \c_one \fi: \__int_eval_end: }
-\cs_new:Npn \__fp_round_normal:NNwNnn #1 #2
- {
- \if_meaning:w 0 #2
- \exp_after:wN \__fp_round_special:NwwNnn
- \exp_after:wN #1
- \fi:
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_round_normal_end:wwNnn
- ; #2
- }
-\cs_new:Npn \__fp_round_normal_end:wwNnn #1;#2;#3#4#5
- {
- \exp_after:wN \__fp_exp_after_o:w \tex_romannumeral:D -`0
- \__fp_sanitize:Nw #3 #4 ; #1 ;
- }
-\cs_new:Npn \__fp_round_special:NwwNnn #1#2;#3;#4#5#6
- {
- \if_meaning:w 0 #1
- \__fp_case_return:nw
- { \exp_after:wN \__fp_zero_fp:N \exp_after:wN #4 }
- \else:
- \exp_after:wN \__fp_round_special_aux:Nw
- \exp_after:wN #4
- \int_use:N \__int_eval:w \c_one
- \if_meaning:w 1 #1 -#6 \else: +#5 \fi:
- \fi:
- ;
- }
-\cs_new:Npn \__fp_round_special_aux:Nw #1#2;
- {
- \exp_after:wN \__fp_exp_after_o:w \tex_romannumeral:D -`0
- \__fp_sanitize:Nw #1#2; {1000}{0000}{0000}{0000};
- }
-%% File: l3fp-parse.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_parse_expand:w #1 { -`0 #1 }
-\cs_new:Npn \__fp_parse_return_semicolon:w
- #1 \fi: \__fp_parse_expand:w { \fi: ; #1 }
-\group_begin:
-\char_set_catcode_other:N \S
-\char_set_catcode_other:N \F
-\char_set_catcode_other:N \P
-\char_set_lccode:nn { `\- } { `\_ }
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new:Npn \__fp_type_from_scan:N #1
- {
- \exp_after:wN \__fp_type_from_scan:w
- \token_to_str:N #1 \q_mark S--FP-? \q_mark \q_stop
- }
- \cs_new:Npn \__fp_type_from_scan:w #1 S--FP #2 \q_mark #3 \q_stop {#2}
- }
-\cs_set_protected:Npn \__fp_tmp:w #1 #2 #3
- {
- \cs_new:cpn { __fp_parse_digits_ #1 :N } ##1
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N ##1 \exp_stop_f:
- \token_to_str:N ##1 \exp_after:wN #2 \tex_romannumeral:D
- \else:
- \__fp_parse_return_semicolon:w #3 ##1
- \fi:
- \__fp_parse_expand:w
- }
- }
-\__fp_tmp:w {vii} \__fp_parse_digits_vi:N { 0000000 ; 7 }
-\__fp_tmp:w {vi} \__fp_parse_digits_v:N { 000000 ; 6 }
-\__fp_tmp:w {v} \__fp_parse_digits_iv:N { 00000 ; 5 }
-\__fp_tmp:w {iv} \__fp_parse_digits_iii:N { 0000 ; 4 }
-\__fp_tmp:w {iii} \__fp_parse_digits_ii:N { 000 ; 3 }
-\__fp_tmp:w {ii} \__fp_parse_digits_i:N { 00 ; 2 }
-\__fp_tmp:w {i} \__fp_parse_digits_:N { 0 ; 1 }
-\cs_new_nopar:Npn \__fp_parse_digits_:N { ; ; 0 }
-\cs_new:Npn \__fp_parse_one:Nw #1 #2
- {
- \if_catcode:w \scan_stop: \exp_not:N #2
- \if_meaning:w \scan_stop: #2
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_one_fp:NN
- \else:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_one_register:NN
- \fi:
- \else:
- \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_one_digit:NN
- \else:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_one_other:NN
- \fi:
- \fi:
- #1 #2
- }
-\cs_new:Npn \__fp_parse_one_fp:NN #1#2
- {
- \cs:w __fp_exp_after \__fp_type_from_scan:N #2 _f:nw \cs_end:
- {
- \exp_after:wN \__fp_parse_infix:NN
- \exp_after:wN #1 \tex_romannumeral:D \__fp_parse_expand:w
- }
- #2
- }
-\cs_new:Npn \__fp_exp_after_mark_f:nw #1
- {
- \__msg_kernel_expandable_error:nn { kernel } { fp-early-end }
- \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 #1
- }
-\cs_new:cpn { __fp_exp_after_?_f:nw } #1#2
- {
- \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#2}
- \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0 #1
- }
-\cs_new:Npn \__fp_parse_one_register:NN #1#2
- {
- \exp_after:wN \__fp_parse_infix_after_operand:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \exp_after:wN \__fp_parse_one_register_aux:Nw
- \exp_after:wN #2
- \__int_value:w
- \exp_after:wN \__fp_parse_exponent:N
- \tex_romannumeral:D \__fp_parse_expand:w
- }
-\group_begin:
-\char_set_catcode_other:N \P
-\char_set_catcode_other:N \T
-\char_set_catcode_other:N \M
-\char_set_catcode_other:N \U
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new:Npn \__fp_parse_one_register_aux:Nw #1
- {
- \exp_after:wN \use:nn
- \exp_after:wN \__fp_parse_one_register_auxii:wwwNw
- \exp_after:wN { \tex_the:D \exp_not:N #1 }
- ; \__fp_parse_one_register_dim:ww
- PT ; \__fp_parse_one_register_mu:www
- . PT ; \__fp_parse_one_register_int:www
- \q_stop
- }
- \cs_new:Npn \__fp_parse_one_register_auxii:wwwNw
- #1 . #2 PT #3 ; #4#5 \q_stop { #4 #1.#2; }
- \cs_new:Npn \__fp_parse_one_register_mu:www #1 MU; #2;
- { \__fp_parse_one_register_dim:ww #1; }
- }
-\cs_new:Npn \__fp_parse_one_register_int:www #1; #2.; #3;
- { \__fp_parse:n { #1 e #3 } }
-\cs_new:Npn \__fp_parse_one_register_dim:ww #1; #2;
- {
- \exp_after:wN \__fp_from_dim_test:ww
- \__int_value:w #2 \exp_after:wN ,
- \__int_value:w \__dim_eval:w #1 pt ;
- }
-\cs_new:Npn \__fp_parse_one_digit:NN #1
- {
- \exp_after:wN \__fp_parse_infix_after_operand:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \exp_after:wN \__fp_sanitize:wN
- \int_use:N \__int_eval:w \c_zero \__fp_parse_trim_zeros:N
- }
-\cs_new:Npn \__fp_parse_one_other:NN #1 #2
- {
- \if_int_compare:w
- \__int_eval:w
- ( `#2 \if_int_compare:w `#2 > `Z - \c_thirty_two \fi: ) / 26
- = \c_three
- \exp_after:wN \__fp_parse_word:Nw
- \exp_after:wN #1
- \exp_after:wN #2
- \tex_romannumeral:D \exp_after:wN \__fp_parse_letters:N
- \tex_romannumeral:D
- \else:
- \exp_after:wN \__fp_parse_prefix:NNN
- \exp_after:wN #1
- \exp_after:wN #2
- \cs:w __fp_parse_prefix_#2:Nw \exp_after:wN \cs_end:
- \tex_romannumeral:D
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_word:Nw #1#2;
- {
- \cs_if_exist_use:cF { __fp_parse_word_#2:N }
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { unknown-fp-word } {#2}
- \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0
- \__fp_parse_infix:NN
- }
- #1
- }
-\cs_new:Npn \__fp_parse_letters:N #1
- {
- -`0
- \if_int_compare:w
- \if_catcode:w \scan_stop: \exp_not:N #1
- \c_zero
- \else:
- \__int_eval:w
- ( `#1 \if_int_compare:w `#1 > `Z - \c_thirty_two \fi: )
- / 26
- \fi:
- = \c_three
- \exp_after:wN #1
- \tex_romannumeral:D \exp_after:wN \__fp_parse_letters:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_return_semicolon:w #1
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_prefix:NNN #1#2#3
- {
- \if_meaning:w \scan_stop: #3
- \exp_after:wN \__fp_parse_prefix_unknown:NNN
- \exp_after:wN #2
- \fi:
- #3 #1
- }
-\cs_new:Npn \__fp_parse_prefix_unknown:NNN #1#2#3
- {
- \cs_if_exist:cTF { __fp_parse_infix_#1:N }
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-missing-number } {#1}
- \exp_after:wN \c_nan_fp \tex_romannumeral:D -`0
- \__fp_parse_infix:NN #3 #1
- }
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-unknown-symbol } {#1}
- \__fp_parse_one:Nw #3
- }
- }
-\cs_new:Npn \__fp_parse_trim_zeros:N #1
- {
- \if:w 0 \exp_not:N #1
- \exp_after:wN \__fp_parse_trim_zeros:N
- \tex_romannumeral:D
- \else:
- \if:w . \exp_not:N #1
- \exp_after:wN \__fp_parse_strim_zeros:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_trim_end:w #1
- \fi:
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_trim_end:w #1 \fi: \fi: \__fp_parse_expand:w
- {
- \fi:
- \fi:
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- \exp_after:wN \__fp_parse_large:N
- \else:
- \exp_after:wN \__fp_parse_zero:
- \fi:
- #1
- }
-\cs_new:Npn \__fp_parse_strim_zeros:N #1
- {
- \if:w 0 \exp_not:N #1
- - \c_one
- \exp_after:wN \__fp_parse_strim_zeros:N \tex_romannumeral:D
- \else:
- \__fp_parse_strim_end:w #1
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_strim_end:w #1 \fi: \__fp_parse_expand:w
- {
- \fi:
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- \exp_after:wN \__fp_parse_small:N
- \else:
- \exp_after:wN \__fp_parse_zero:
- \fi:
- #1
- }
-\cs_new:Npn \__fp_parse_zero:
- {
- \exp_after:wN ; \exp_after:wN 1
- \__int_value:w \__fp_parse_exponent:N
- }
-\cs_new:Npn \__fp_parse_small:N #1
- {
- \exp_after:wN \__fp_parse_pack_leading:NNNNNww
- \int_use:N \__int_eval:w 1 \token_to_str:N #1
- \exp_after:wN \__fp_parse_small_leading:wwNN
- \__int_value:w 1
- \exp_after:wN \__fp_parse_digits_vii:N
- \tex_romannumeral:D \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_small_leading:wwNN 1 #1 ; #2; #3 #4
- {
- #1 #2
- \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
- \exp_after:wN \c_zero
- \int_use:N \__int_eval:w 1
- \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
- \token_to_str:N #4
- \exp_after:wN \__fp_parse_small_trailing:wwNN
- \__int_value:w 1
- \exp_after:wN \__fp_parse_digits_vi:N
- \tex_romannumeral:D
- \else:
- 0000 0000 \__fp_parse_exponent:Nw #4
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_small_trailing:wwNN 1 #1 ; #2; #3 #4
- {
- #1 #2
- \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
- \token_to_str:N #4
- \exp_after:wN \__fp_parse_small_round:NN
- \exp_after:wN #4
- \tex_romannumeral:D
- \else:
- 0 \__fp_parse_exponent:Nw #4
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_pack_trailing:NNNNNNww #1 #2 #3#4#5#6 #7; #8 ;
- {
- \if_meaning:w 2 #2 + \c_one \fi:
- ; #8 + #1 ; {#3#4#5#6} {#7};
- }
-\cs_new:Npn \__fp_parse_pack_leading:NNNNNww #1 #2#3#4#5 #6; #7;
- {
- + #7
- \if_meaning:w 2 #1 \__fp_parse_pack_carry:w \fi:
- ; 0 {#2#3#4#5} {#6}
- }
-\cs_new:Npn \__fp_parse_pack_carry:w \fi: ; 0 #1
- { \fi: + \c_one ; 0 {1000} }
-\cs_new:Npn \__fp_parse_large:N #1
- {
- \exp_after:wN \__fp_parse_large_leading:wwNN
- \__int_value:w 1 \token_to_str:N #1
- \exp_after:wN \__fp_parse_digits_vii:N
- \tex_romannumeral:D \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_large_leading:wwNN 1 #1 ; #2; #3 #4
- {
- + \c_eight - #3
- \exp_after:wN \__fp_parse_pack_leading:NNNNNww
- \int_use:N \__int_eval:w 1 #1
- \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
- \exp_after:wN \__fp_parse_large_trailing:wwNN
- \__int_value:w 1 \token_to_str:N #4
- \exp_after:wN \__fp_parse_digits_vi:N
- \tex_romannumeral:D
- \else:
- \if:w . \exp_not:N #4
- \exp_after:wN \__fp_parse_small_leading:wwNN
- \__int_value:w 1
- \cs:w
- __fp_parse_digits_
- \tex_romannumeral:D #3
- :N \exp_after:wN
- \cs_end:
- \tex_romannumeral:D
- \else:
- #2
- \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
- \exp_after:wN \c_zero
- \__int_value:w 1 0000 0000
- \__fp_parse_exponent:Nw #4
- \fi:
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_large_trailing:wwNN 1 #1 ; #2; #3 #4
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #4 \exp_stop_f:
- \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
- \exp_after:wN \c_eight
- \int_use:N \__int_eval:w 1 #1 \token_to_str:N #4
- \exp_after:wN \__fp_parse_large_round:NN
- \exp_after:wN #4
- \tex_romannumeral:D
- \else:
- \exp_after:wN \__fp_parse_pack_trailing:NNNNNNww
- \int_use:N \__int_eval:w \c_seven - #3 \exp_stop_f:
- \int_use:N \__int_eval:w 1 #1
- \if:w . \exp_not:N #4
- \exp_after:wN \__fp_parse_small_trailing:wwNN
- \__int_value:w 1
- \cs:w
- __fp_parse_digits_
- \tex_romannumeral:D #3
- :N \exp_after:wN
- \cs_end:
- \tex_romannumeral:D
- \else:
- #2 0 \__fp_parse_exponent:Nw #4
- \fi:
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_round_loop:N #1
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- + \c_one
- \if:w 0 \token_to_str:N #1
- \exp_after:wN \__fp_parse_round_loop:N
- \tex_romannumeral:D
- \else:
- \exp_after:wN \__fp_parse_round_up:N
- \tex_romannumeral:D
- \fi:
- \else:
- \__fp_parse_return_semicolon:w \c_zero #1
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_round_up:N #1
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- + \c_one
- \exp_after:wN \__fp_parse_round_up:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_return_semicolon:w \c_one #1
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_round_after:wN #1; #2
- {
- + #2 \exp_after:wN ;
- \int_use:N \__int_eval:w #1 + \__fp_parse_exponent:N
- }
-\cs_new:Npn \__fp_parse_small_round:NN #1#2
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
- +
- \exp_after:wN \__fp_round_s:NNNw
- \exp_after:wN 0
- \exp_after:wN #1
- \exp_after:wN #2
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_parse_round_after:wN
- \int_use:N \__int_eval:w \c_zero * \__int_eval:w \c_zero
- \exp_after:wN \__fp_parse_round_loop:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_exponent:Nw #2
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_large_round:NN #1#2
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #2 \exp_stop_f:
- +
- \exp_after:wN \__fp_round_s:NNNw
- \exp_after:wN 0
- \exp_after:wN #1
- \exp_after:wN #2
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_parse_large_round_aux:wNN
- \int_use:N \__int_eval:w \c_one
- \exp_after:wN \__fp_parse_round_loop:N
- \else: %^^A could be dot, or e, or other
- \exp_after:wN \__fp_parse_large_round_test:NN
- \exp_after:wN #1
- \exp_after:wN #2
- \fi:
- }
-\cs_new:Npn \__fp_parse_large_round_test:NN #1#2
- {
- \if:w . \exp_not:N #2
- \exp_after:wN \__fp_parse_small_round:NN
- \exp_after:wN #1
- \tex_romannumeral:D
- \else:
- \__fp_parse_exponent:Nw #2
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_large_round_aux:wNN #1 ; #2 #3
- {
- + #2
- \exp_after:wN \__fp_parse_round_after:wN
- \int_use:N \__int_eval:w #1
- \if:w . \exp_not:N #3
- + \c_zero * \__int_eval:w \c_zero
- \exp_after:wN \__fp_parse_round_loop:N
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN ;
- \exp_after:wN \c_zero
- \exp_after:wN #3
- \fi:
- }
-\cs_new:Npn \__fp_parse_exponent:Nw #1 #2 \__fp_parse_expand:w
- {
- \exp_after:wN ;
- \__int_value:w #2 \__fp_parse_exponent:N #1
- }
-\cs_new:Npn \__fp_parse_exponent:N #1
- {
- \if:w e \exp_not:N #1
- \exp_after:wN \__fp_parse_exponent_aux:N
- \tex_romannumeral:D
- \else:
- 0 \__fp_parse_return_semicolon:w #1
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_exponent_aux:N #1
- {
- \if_int_compare:w \if_catcode:w \scan_stop: \exp_not:N #1
- \c_zero \else: `#1 \fi: > `9 \exp_stop_f:
- 0 \exp_after:wN ; \exp_after:wN e
- \else:
- \exp_after:wN \__fp_parse_exponent_sign:N
- \fi:
- #1
- }
-\cs_new:Npn \__fp_parse_exponent_sign:N #1
- {
- \if:w + \if:w - \exp_not:N #1 + \fi: \token_to_str:N #1
- \exp_after:wN \__fp_parse_exponent_sign:N
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN \__fp_parse_exponent_body:N
- \exp_after:wN #1
- \fi:
- }
-\cs_new:Npn \__fp_parse_exponent_body:N #1
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- \token_to_str:N #1
- \exp_after:wN \__fp_parse_exponent_digits:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_exponent_keep:NTF #1
- { \__fp_parse_return_semicolon:w #1 }
- {
- \exp_after:wN ;
- \tex_romannumeral:D
- }
- \fi:
- \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_exponent_digits:N #1
- {
- \if_int_compare:w \c_nine < 1 \token_to_str:N #1 \exp_stop_f:
- \token_to_str:N #1
- \exp_after:wN \__fp_parse_exponent_digits:N
- \tex_romannumeral:D
- \else:
- \__fp_parse_return_semicolon:w #1
- \fi:
- \__fp_parse_expand:w
- }
-\prg_new_conditional:Npnn \__fp_parse_exponent_keep:N #1 { TF }
- {
- \if_catcode:w \scan_stop: \exp_not:N #1
- \if_meaning:w \scan_stop: #1
- \if_int_compare:w
- \pdftex_strcmp:D { \s__fp } { \exp_not:N #1 } = \c_zero
- 0
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-after-e } { floating~point~ }
- \prg_return_true:
- \else:
- 0
- \__msg_kernel_expandable_error:nnn
- { kernel } { bad-variable } {#1}
- \prg_return_false:
- \fi:
- \else:
- \if_int_compare:w
- \pdftex_strcmp:D { \__int_value:w #1 } { \tex_the:D #1 }
- = \c_zero
- \__int_value:w #1
- \else:
- 0
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-after-e } { dimension~#1 }
- \fi:
- \prg_return_false:
- \fi:
- \else:
- 0
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-missing } { exponent }
- \prg_return_true:
- \fi:
- }
-\cs_new_eq:cN { __fp_parse_prefix_+:Nw } \__fp_parse_one:Nw
-\cs_new:Npn \__fp_parse_apply_unary:NNNwN #1#2#3#4@#5
- {
- #3 #2 #4 @
- \tex_romannumeral:D -`0 #5 #1
- }
-\cs_set_protected:Npn \__fp_tmp:w #1#2#3#4
- {
- \cs_new:cpn { __fp_parse_prefix_ #1 :Nw } ##1
- {
- \exp_after:wN \__fp_parse_apply_unary:NNNwN
- \exp_after:wN ##1
- \exp_after:wN #4
- \exp_after:wN #3
- \tex_romannumeral:D
- \if_int_compare:w #2 < ##1
- \__fp_parse_operand:Nw ##1
- \else:
- \__fp_parse_operand:Nw #2
- \fi:
- \__fp_parse_expand:w
- }
- }
-\__fp_tmp:w - \c_twelve \__fp_set_sign_o:w 2
-\__fp_tmp:w ! \c_twelve \__fp_not_o:w ?
-\cs_new:cpn { __fp_parse_prefix_.:Nw } #1
- {
- \exp_after:wN \__fp_parse_infix_after_operand:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \exp_after:wN \__fp_sanitize:wN
- \int_use:N \__int_eval:w \c_zero \__fp_parse_strim_zeros:N
- }
-\group_begin:
- \char_set_catcode_letter:N (
- \char_set_catcode_letter:N )
- \cs_new:Npn \__fp_parse_prefix_(:Nw #1
- {
- \exp_after:wN \__fp_parse_lparen_after:NwN
- \exp_after:wN #1
- \tex_romannumeral:D
- \if_int_compare:w #1 = \c_sixteen
- \__fp_parse_operand:Nw \c_one
- \else:
- \__fp_parse_operand:Nw \c_zero
- \fi:
- \__fp_parse_expand:w
- }
- \cs_new:Npn \__fp_parse_lparen_after:NwN #1#2 @ #3
- {
- \token_if_eq_meaning:NNTF #3 \__fp_parse_infix_):N
- {
- \__fp_exp_after_array_f:w #2 \s__fp_stop
- \exp_after:wN \__fp_parse_infix:NN
- \exp_after:wN #1
- \tex_romannumeral:D \__fp_parse_expand:w
- }
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-missing } { ) }
- #2 @ \use_none:n #3
- }
- }
-\group_end:
-\cs_set_protected:Npn \__fp_tmp:w #1 #2
- {
- \cs_new_nopar:cpn { __fp_parse_word_#1:N }
- { \exp_after:wN #2 \tex_romannumeral:D -`0 \__fp_parse_infix:NN }
- }
-\__fp_tmp:w { inf } \c_inf_fp
-\__fp_tmp:w { nan } \c_nan_fp
-\__fp_tmp:w { pi } \c_pi_fp
-\__fp_tmp:w { deg } \c_one_degree_fp
-\__fp_tmp:w { true } \c_one_fp
-\__fp_tmp:w { false } \c_zero_fp
-\cs_set_protected:Npn \__fp_tmp:w #1 #2
- {
- \cs_new_nopar:cpn { __fp_parse_word_#1:N }
- {
- \__fp_exp_after_f:nw { \__fp_parse_infix:NN }
- \s__fp \__fp_chk:w 10 #2 ;
- }
- }
-\__fp_tmp:w {pt} { {1} {1000} {0000} {0000} {0000} }
-\__fp_tmp:w {in} { {2} {7227} {0000} {0000} {0000} }
-\__fp_tmp:w {pc} { {2} {1200} {0000} {0000} {0000} }
-\__fp_tmp:w {cm} { {2} {2845} {2755} {9055} {1181} }
-\__fp_tmp:w {mm} { {1} {2845} {2755} {9055} {1181} }
-\__fp_tmp:w {dd} { {1} {1070} {0085} {6496} {0630} }
-\__fp_tmp:w {cc} { {2} {1284} {0102} {7795} {2756} }
-\__fp_tmp:w {nd} { {1} {1066} {9783} {4645} {6693} }
-\__fp_tmp:w {nc} { {2} {1280} {3740} {1574} {8031} }
-\__fp_tmp:w {bp} { {1} {1003} {7500} {0000} {0000} }
-\__fp_tmp:w {sp} { {-4} {1525} {8789} {0625} {0000} }
-\tl_map_inline:nn { {em} {ex} }
- {
- \cs_new_nopar:cpn { __fp_parse_word_#1:N }
- {
- \exp_after:wN \__fp_from_dim_test:ww
- \exp_after:wN 0 \exp_after:wN ,
- \__int_value:w \__dim_eval:w 1 #1 \exp_after:wN ;
- \tex_romannumeral:D -`0 \__fp_parse_infix:NN
- }
- }
-\cs_new:Npn \__fp_parse_unary_function:nNN #1#2#3
- {
- \exp_after:wN \__fp_parse_apply_unary:NNNwN
- \exp_after:wN #3
- \exp_after:wN #2
- \cs:w __fp_#1_o:w \exp_after:wN \cs_end:
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_fifteen \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_function:NNN #1#2#3
- {
- \exp_after:wN \__fp_parse_apply_unary:NNNwN
- \exp_after:wN #3
- \exp_after:wN #2
- \exp_after:wN #1
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_sixteen \__fp_parse_expand:w
- }
-\cs_new_nopar:Npn \__fp_parse_word_acot:N
- { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_i:nn }
-\cs_new_nopar:Npn \__fp_parse_word_acotd:N
- { \__fp_parse_function:NNN \__fp_acot_o:Nw \use_ii:nn }
-\cs_new_nopar:Npn \__fp_parse_word_atan:N
- { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_i:nn }
-\cs_new_nopar:Npn \__fp_parse_word_atand:N
- { \__fp_parse_function:NNN \__fp_atan_o:Nw \use_ii:nn }
-\cs_new_nopar:Npn \__fp_parse_word_max:N
- { \__fp_parse_function:NNN \__fp_minmax_o:Nw 2 }
-\cs_new_nopar:Npn \__fp_parse_word_min:N
- { \__fp_parse_function:NNN \__fp_minmax_o:Nw 0 }
-\cs_new:Npn \__fp_parse_word_abs:N
- { \__fp_parse_unary_function:nNN { set_sign } 0 }
-\cs_new_nopar:Npn \__fp_parse_word_exp:N
- { \__fp_parse_unary_function:nNN {exp} ? }
-\cs_new_nopar:Npn \__fp_parse_word_ln:N
- { \__fp_parse_unary_function:nNN {ln} ? }
-\cs_new_nopar:Npn \__fp_parse_word_sqrt:N
- { \__fp_parse_unary_function:nNN {sqrt} ? }
-\tl_map_inline:nn
- {
- {acos} {acsc} {asec} {asin}
- {cos} {cot} {csc} {sec} {sin} {tan}
- }
- {
- \cs_new_nopar:cpn { __fp_parse_word_#1:N }
- { \__fp_parse_unary_function:nNN {#1} \use_i:nn }
- \cs_new_nopar:cpn { __fp_parse_word_#1d:N }
- { \__fp_parse_unary_function:nNN {#1} \use_ii:nn }
- }
-\cs_new_nopar:Npn \__fp_parse_word_trunc:N
- { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_zero:NNN }
-\cs_new_nopar:Npn \__fp_parse_word_floor:N
- { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_ninf:NNN }
-\cs_new_nopar:Npn \__fp_parse_word_ceil:N
- { \__fp_parse_function:NNN \__fp_round_o:Nw \__fp_round_to_pinf:NNN }
-\cs_new:Npn \__fp_parse_word_round:N #1#2
- {
- \if_meaning:w + #2
- \__fp_parse_round:Nw \__fp_round_to_pinf:NNN
- \else:
- \if_meaning:w 0 #2
- \__fp_parse_round:Nw \__fp_round_to_zero:NNN
- \else:
- \if_meaning:w - #2
- \__fp_parse_round:Nw \__fp_round_to_ninf:NNN
- \fi:
- \fi:
- \fi:
- \__fp_parse_function:NNN
- \__fp_round_o:Nw \__fp_round_to_nearest:NNN #1
- #2
- }
-\cs_new:Npn \__fp_parse_round:Nw
- #1 #2 \__fp_round_to_nearest:NNN #3#4 { #2 #1 #3 }
-\cs_new:Npn \__fp_parse:n #1
- {
- \tex_romannumeral:D
- \exp_after:wN \__fp_parse_after:ww
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_minus_one
- \__fp_parse_expand:w #1 \s__fp_mark
- \s__fp_stop
- }
-\cs_new:Npn \__fp_parse_after:ww
- #1@ \__fp_parse_infix_end:N \s__fp_mark \s__fp_stop
- { \c_zero #1 }
-\cs_new:Npn \__fp_parse_operand:Nw #1
- {
- -`0
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \exp_after:wN \__fp_parse_one:Nw
- \exp_after:wN #1
- \tex_romannumeral:D
- }
-\cs_new:Npn \__fp_parse_continue:NwN #1 #2 @ #3 { #3 #1 #2 @ }
-\cs_new:Npn \__fp_parse_apply_binary:NwNwN #1 #2@ #3 #4@ #5
- {
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0 \cs:w __fp_#3_o:ww \cs_end: #2 #4
- \tex_romannumeral:D -`0 #5 #1
- }
-\cs_new:Npn \__fp_parse_infix_after_operand:NwN #1 #2;
- {
- \__fp_exp_after_f:nw { \__fp_parse_infix:NN #1 }
- #2;
- }
-\group_begin:
- \char_set_catcode_letter:N \*
- \cs_new:Npn \__fp_parse_infix:NN #1 #2
- {
- \if_catcode:w \scan_stop: \exp_not:N #2
- \if_int_compare:w
- \pdftex_strcmp:D { \s__fp_mark } { \exp_not:N #2 }
- = \c_zero
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_infix_end:N
- \else:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_infix_juxtapose:N
- \fi:
- \else:
- \if_int_compare:w
- \__int_eval:w
- ( `#2 \if_int_compare:w `#2 > `Z - \c_thirty_two \fi: )
- / 26
- = \c_three
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_parse_infix_juxtapose:N
- \else:
- \exp_after:wN \__fp_parse_infix_check:NNN
- \cs:w
- __fp_parse_infix_#2:N
- \exp_after:wN \exp_after:wN \exp_after:wN
- \cs_end:
- \fi:
- \fi:
- #1
- #2
- }
- \cs_new:Npn \__fp_parse_infix_check:NNN #1#2#3
- {
- \if_meaning:w \scan_stop: #1
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-missing } { * }
- \exp_after:wN \__fp_parse_infix_*:N
- \exp_after:wN #2
- \exp_after:wN #3
- \else:
- \exp_after:wN #1
- \exp_after:wN #2
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \fi:
- }
-\group_end:
-\cs_new:Npn \__fp_parse_infix_end:N #1
- { @ \use_none:n \__fp_parse_infix_end:N }
-\group_begin:
- \char_set_catcode_letter:N \)
- \cs_new:Npn \__fp_parse_infix_):N #1
- {
- \if_int_compare:w #1 < \c_zero
- \__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) }
- \exp_after:wN \__fp_parse_infix:NN
- \exp_after:wN #1
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_infix_):N
- \fi:
- }
-\group_end:
-\group_begin:
- \char_set_catcode_letter:N \,
- \cs_new:Npn \__fp_parse_infix_,:N #1
- {
- \if_int_compare:w #1 > \c_one
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_infix_,:N
- \else:
- \if_int_compare:w #1 = \c_one
- \exp_after:wN \__fp_parse_infix_comma:w
- \tex_romannumeral:D
- \else:
- \exp_after:wN \__fp_parse_infix_comma_gobble:w
- \tex_romannumeral:D
- \fi:
- \__fp_parse_operand:Nw \c_one
- \exp_after:wN \__fp_parse_expand:w
- \fi:
- }
- \cs_new:Npn \__fp_parse_infix_comma:w #1 @
- { #1 @ \use_none:n }
- \cs_new:Npn \__fp_parse_infix_comma_gobble:w #1 @
- {
- \__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma }
- @ \use_none:n
- }
-\group_end:
-\group_begin:
- \char_set_catcode_other:N \&
- \char_set_catcode_letter:N \^
- \char_set_catcode_letter:N \/
- \char_set_catcode_letter:N \-
- \char_set_catcode_letter:N \+
- \cs_set_protected:Npn \__fp_tmp:w #1#2#3#4
- {
- \cs_new:Npn #1 ##1
- {
- \if_int_compare:w ##1 < #3
- \exp_after:wN @
- \exp_after:wN \__fp_parse_apply_binary:NwNwN
- \exp_after:wN #2
- \tex_romannumeral:D
- \__fp_parse_operand:Nw #4
- \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN #1
- \fi:
- }
- }
- \__fp_tmp:w \__fp_parse_infix_^:N ^ \c_fifteen \c_fourteen
- \__fp_tmp:w \__fp_parse_infix_/:N / \c_ten \c_ten
- \__fp_tmp:w \__fp_parse_infix_mul:N * \c_ten \c_ten
- \__fp_tmp:w \__fp_parse_infix_-:N - \c_nine \c_nine
- \__fp_tmp:w \__fp_parse_infix_+:N + \c_nine \c_nine
- \__fp_tmp:w \__fp_parse_infix_and:N & \c_five \c_five
- \__fp_tmp:w \__fp_parse_infix_or:N | \c_four \c_four
-\group_end:
-\cs_new:cpn { __fp_parse_infix_(:N } #1
- { \__fp_parse_infix_juxtapose:N #1 ( }
-\cs_new:Npn \__fp_parse_infix_juxtapose:N #1
- {
- \if_int_compare:w #1 < \c_thirty_two
- \exp_after:wN @
- \exp_after:wN \__fp_parse_apply_juxtapose:NwwN
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_thirty_two
- \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_infix_juxtapose:N
- \fi:
- }
-\cs_new:Npn \__fp_parse_apply_juxtapose:NwwN #1 #2;#3@ #4;#5@
- {
- \if_catcode:w ^ \tl_to_str:n { #3 #5 } ^
- \else:
- \__fp_error:nffn { invalid-ii }
- { \__fp_array_to_clist:n { #2; #3 } }
- { \__fp_array_to_clist:n { #4; #5 } }
- { }
- \fi:
- \__fp_parse_apply_binary:NwNwN #1 #2;@ * #4;@
- }
-\group_begin:
- \char_set_catcode_letter:N ^
- \cs_new:cpn { __fp_parse_infix_*:N } #1#2
- {
- \if:w * \exp_not:N #2
- \exp_after:wN \__fp_parse_infix_^:N
- \exp_after:wN #1
- \else:
- \exp_after:wN \__fp_parse_infix_mul:N
- \exp_after:wN #1
- \exp_after:wN #2
- \fi:
- }
-\group_end:
-\group_begin:
- \char_set_catcode_letter:N \|
- \char_set_catcode_letter:N \&
- \cs_new:Npn \__fp_parse_infix_|:N #1#2
- {
- \if:w | \exp_not:N #2
- \exp_after:wN \__fp_parse_infix_|:N
- \exp_after:wN #1
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN \__fp_parse_infix_or:N
- \exp_after:wN #1
- \exp_after:wN #2
- \fi:
- }
- \cs_new:Npn \__fp_parse_infix_&:N #1#2
- {
- \if:w & \exp_not:N #2
- \exp_after:wN \__fp_parse_infix_&:N
- \exp_after:wN #1
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN \__fp_parse_infix_and:N
- \exp_after:wN #1
- \exp_after:wN #2
- \fi:
- }
-\group_end:
-\group_begin:
- \char_set_catcode_letter:N \?
- \cs_new:Npn \__fp_parse_infix_?:N #1
- {
- \if_int_compare:w #1 < \c_three
- \exp_after:wN @
- \exp_after:wN \__fp_ternary:NwwN
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_three
- \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_infix_?:N
- \fi:
- }
- \cs_new:Npn \__fp_parse_infix_::N #1
- {
- \if_int_compare:w #1 < \c_three
- \__msg_kernel_expandable_error:nnnn
- { kernel } { fp-missing } { ? } { ~for~?: }
- \exp_after:wN @
- \exp_after:wN \__fp_ternary_auxii:NwwN
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_two
- \exp_after:wN \__fp_parse_expand:w
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_infix_::N
- \fi:
- }
-\group_end:
-\cs_new:cpn { __fp_parse_infix_<:N } #1
- {
- \__fp_parse_compare:NNNNNNN #1 \c_one
- \c_zero \c_zero \c_zero \c_zero <
- }
-\cs_new:cpn { __fp_parse_infix_=:N } #1
- {
- \__fp_parse_compare:NNNNNNN #1 \c_one
- \c_zero \c_zero \c_zero \c_zero =
- }
-\cs_new:cpn { __fp_parse_infix_>:N } #1
- {
- \__fp_parse_compare:NNNNNNN #1 \c_one
- \c_zero \c_zero \c_zero \c_zero >
- }
-\cs_new:cpn { __fp_parse_infix_!:N } #1
- {
- \exp_after:wN \__fp_parse_compare:NNNNNNN
- \exp_after:wN #1
- \exp_after:wN \c_zero
- \exp_after:wN \c_one
- \exp_after:wN \c_one
- \exp_after:wN \c_one
- \exp_after:wN \c_one
- }
-\cs_new:Npn \__fp_parse_excl_error:
- {
- \__msg_kernel_expandable_error:nnnn
- { kernel } { fp-missing } { = } { ~after~!. }
- }
-\cs_new:Npn \__fp_parse_compare:NNNNNNN #1
- {
- \if_int_compare:w #1 < \c_seven
- \exp_after:wN \__fp_parse_compare_auxi:NNNNNNN
- \exp_after:wN \__fp_parse_excl_error:
- \else:
- \exp_after:wN @
- \exp_after:wN \use_none:n
- \exp_after:wN \__fp_parse_compare:NNNNNNN
- \fi:
- }
-\cs_new:Npn \__fp_parse_compare_auxi:NNNNNNN #1#2#3#4#5#6#7
- {
- \if_case:w
- \if_catcode:w \scan_stop: \exp_not:N #7
- \c_minus_one
- \else:
- \__int_eval:w `#7 - `< \__int_eval_end:
- \fi:
- \__fp_parse_compare_auxii:NNNNN #2#2#4#5#6
- \or: \__fp_parse_compare_auxii:NNNNN #2#3#2#5#6
- \or: \__fp_parse_compare_auxii:NNNNN #2#3#4#2#6
- \or: \__fp_parse_compare_auxii:NNNNN #2#3#4#5#2
- \else: #1 \__fp_parse_compare_end:NNNNw #3#4#5#6#7
- \fi:
- }
-\cs_new:Npn \__fp_parse_compare_auxii:NNNNN #1#2#3#4#5
- {
- \exp_after:wN \__fp_parse_compare_auxi:NNNNNNN
- \exp_after:wN \prg_do_nothing:
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN #3
- \exp_after:wN #4
- \exp_after:wN #5
- \tex_romannumeral:D \exp_after:wN \__fp_parse_expand:w
- }
-\cs_new:Npn \__fp_parse_compare_end:NNNNw #1#2#3#4#5 \fi:
- {
- \fi:
- \exp_after:wN @
- \exp_after:wN \__fp_parse_apply_compare:NwNNNNNwN
- \exp_after:wN \c_one_fp
- \exp_after:wN #1
- \exp_after:wN #2
- \exp_after:wN #3
- \exp_after:wN #4
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_seven \__fp_parse_expand:w #5
- }
-\cs_new:Npn \__fp_parse_apply_compare:NwNNNNNwN
- #1 #2@ #3 #4#5#6#7 #8@ #9
- {
- \if_int_odd:w
- \if_meaning:w \c_zero_fp #3
- \c_zero
- \else:
- \if_case:w \__fp_compare_back:ww #8 #2 \exp_stop_f:
- #5 \or: #6 \or: #7 \else: #4
- \fi:
- \fi:
- \exp_after:wN \__fp_parse_apply_compare_aux:NNwN
- \exp_after:wN \c_one_fp
- \else:
- \exp_after:wN \__fp_parse_apply_compare_aux:NNwN
- \exp_after:wN \c_zero_fp
- \fi:
- #1 #8 #9
- }
-\cs_new:Npn \__fp_parse_apply_compare_aux:NNwN #1 #2 #3; #4
- {
- \if_meaning:w \__fp_parse_compare:NNNNNNN #4
- \exp_after:wN \__fp_parse_continue_compare:NNwNN
- \exp_after:wN #1
- \exp_after:wN #2
- \tex_romannumeral:D -`0
- \__fp_exp_after_o:w #3;
- \tex_romannumeral:D -`0
- \else:
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #2
- \tex_romannumeral:D -`0
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \fi:
- #4 #2
- }
-\cs_new:Npn \__fp_parse_continue_compare:NNwNN #1#2 #3@ #4#5
- { #4 #2 #3@ #1 }
-\group_begin:
- \char_set_catcode_other:N \^^@
- \cs_new:Npn \fp_function:Nw #1 { ^^@ ; { \exp_after:wN #1 } }
-\group_end:
-\group_begin:
- \char_set_catcode_other:N \^^@
- \cs_new_protected:Npn \fp_new_function:Npn #1#2#
- {
- \cs_new:Npx #1
- {
- ^^@ ;
- {
- \exp_not:N \exp_after:wN
- \exp_not:N \__fp_function_args:Nwn
- \exp_not:N \exp_after:wN
- \exp_not:c { __fp_user_ \cs_to_str:N #1 }
- \exp_not:N \__int_value:w
- \int_eval:n { \tl_count:n {#2} / \c_two }
- \exp_not:N \exp_after:wN ;
- }
- }
- \cs_new:cpn { __fp_user_ \cs_to_str:N #1 } #2
- }
-\group_end:
-\cs_new:Npn \__fp_function_args:Nwn #1#2; #3
- {
- \int_compare:nNnTF { \tl_count:n {#3} } = {#2}
- { #1 #3 }
- {
- \__msg_kernel_expandable_error:nnnnn
- { kernel } { fp-num-args } { #1() } {#2} {#2}
- \c_nan_fp
- }
- }
-\group_begin:
- \char_set_catcode_other:N \^^@
- \cs_new:cpn { __fp_parse_prefix_ ^^@ :Nw } #1 ; #2
- {
- \exp_after:wN \__fp_function_apply:NnwN
- \exp_after:wN #1
- \exp_after:wN { #2 \exp_after:wN }
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_sixteen \__fp_parse_expand:w
- }
-\group_end:
-\cs_new:Npn \__fp_function_apply:NnwN #1#2#3@#4
- {
- \exp_after:wN \__fp_exp_after_array_f:w
- \tex_romannumeral:D -`0
- \__fp_function_store:wwNwnn #3
- \s__fp_mark \__fp_function_store:wwNwnn ;
- \s__fp_mark \__fp_function_store_end:wnnn
- \s__fp_stop { } { } {#2}
- \s__fp_stop
- #4 #1
- }
-\cs_new:Npn \__fp_function_store:wwNwnn
- #1; #2 \s__fp_mark #3#4 \s__fp_stop #5#6
- { #3 #2 \s__fp_mark #3#4 \s__fp_stop { #5 #6 } { { #1; } } }
-\cs_new:Npn \__fp_function_store_end:wnnn
- #1 \s__fp_stop #2#3#4
- { \__fp_parse:n { #4 {#2} } }
-\__msg_kernel_new:nnn { kernel } { unknown-fp-word }
- { Unknown~fp~word~#1. }
-\__msg_kernel_new:nnn { kernel } { fp-missing }
- { Missing~#1~inserted #2. }
-\__msg_kernel_new:nnn { kernel } { fp-extra }
- { Extra~#1~ignored. }
-\__msg_kernel_new:nnn { kernel } { fp-early-end }
- { Premature~end~in~fp~expression. }
-\__msg_kernel_new:nnn { kernel } { fp-after-e }
- { Cannot~use~#1 after~'e'. }
-\__msg_kernel_new:nnn { kernel } { fp-missing-number }
- { Missing~number~before~'#1'. }
-\__msg_kernel_new:nnn { kernel } { fp-unknown-symbol }
- { Unknown~symbol~#1~ignored. }
-\__msg_kernel_new:nnn { kernel } { fp-extra-comma }
- { Unexpected~comma:~extra~arguments~ignored. }
-\__msg_kernel_new:nnn { kernel } { fp-num-args }
- { #1~expects~between~#2~and~#3~arguments. }
-%% File: l3fp-logic.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\prg_new_eq_conditional:NNn \fp_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \fp_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\prg_new_conditional:Npnn \fp_compare:n #1 { p , T , F , TF }
- {
- \exp_after:wN \__fp_compare_return:w
- \tex_romannumeral:D -`0 \__fp_parse:n {#1}
- }
-\cs_new:Npn \__fp_compare_return:w \s__fp \__fp_chk:w #1#2;
- {
- \if_meaning:w 0 #1
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- }
-\prg_new_conditional:Npnn \fp_compare:nNn #1#2#3 { p , T , F , TF }
- {
- \if_int_compare:w
- \exp_after:wN \__fp_compare_aux:wn
- \tex_romannumeral:D -`0 \__fp_parse:n {#1} {#3}
- = \__int_eval:w `#2 - `= \__int_eval_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \__fp_compare_aux:wn #1; #2
- {
- \exp_after:wN \__fp_compare_back:ww
- \tex_romannumeral:D -`0 \__fp_parse:n {#2} #1;
- }
-\cs_new:Npn \__fp_compare_back:ww
- \s__fp \__fp_chk:w #1 #2 #3;
- \s__fp \__fp_chk:w #4 #5 #6;
- {
- \__int_value:w
- \if_meaning:w 3 #1 \exp_after:wN \__fp_compare_nan:w \fi:
- \if_meaning:w 3 #4 \exp_after:wN \__fp_compare_nan:w \fi:
- \if_meaning:w 2 #5 - \fi:
- \if_meaning:w #2 #5
- \if_meaning:w #1 #4
- \if_meaning:w 1 #1
- \__fp_compare_npos:nwnw #6; #3;
- \else:
- 0
- \fi:
- \else:
- \if_int_compare:w #4 < #1 - \fi: 1
- \fi:
- \else:
- \if_int_compare:w #1#4 = \c_zero
- 0
- \else:
- 1
- \fi:
- \fi:
- \exp_stop_f:
- }
-\cs_new:Npn \__fp_compare_nan:w #1 \exp_stop_f: { \c_two }
-\cs_new:Npn \__fp_compare_npos:nwnw #1#2; #3#4;
- {
- \if_int_compare:w #1 = #3 \exp_stop_f:
- \__fp_compare_significand:nnnnnnnn #2 #4
- \else:
- \if_int_compare:w #1 < #3 - \fi: 1
- \fi:
- }
-\cs_new:Npn \__fp_compare_significand:nnnnnnnn #1#2#3#4#5#6#7#8
- {
- \if_int_compare:w #1#2 = #5#6 \exp_stop_f:
- \if_int_compare:w #3#4 = #7#8 \exp_stop_f:
- 0
- \else:
- \if_int_compare:w #3#4 < #7#8 - \fi: 1
- \fi:
- \else:
- \if_int_compare:w #1#2 < #5#6 - \fi: 1
- \fi:
- }
-\cs_new:Npn \fp_do_until:nn #1#2
- {
- #2
- \fp_compare:nF {#1}
- { \fp_do_until:nn {#1} {#2} }
- }
-\cs_new:Npn \fp_do_while:nn #1#2
- {
- #2
- \fp_compare:nT {#1}
- { \fp_do_while:nn {#1} {#2} }
- }
-\cs_new:Npn \fp_until_do:nn #1#2
- {
- \fp_compare:nF {#1}
- {
- #2
- \fp_until_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \fp_while_do:nn #1#2
- {
- \fp_compare:nT {#1}
- {
- #2
- \fp_while_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \fp_do_until:nNnn #1#2#3#4
- {
- #4
- \fp_compare:nNnF {#1} #2 {#3}
- { \fp_do_until:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_new:Npn \fp_do_while:nNnn #1#2#3#4
- {
- #4
- \fp_compare:nNnT {#1} #2 {#3}
- { \fp_do_while:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_new:Npn \fp_until_do:nNnn #1#2#3#4
- {
- \fp_compare:nNnF {#1} #2 {#3}
- {
- #4
- \fp_until_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_new:Npn \fp_while_do:nNnn #1#2#3#4
- {
- \fp_compare:nNnT {#1} #2 {#3}
- {
- #4
- \fp_while_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_new:Npn \__fp_minmax_o:Nw #1#2 @
- {
- \if_meaning:w 0 #1
- \exp_after:wN \__fp_minmax_loop:Nww \exp_after:wN \c_one
- \else:
- \exp_after:wN \__fp_minmax_loop:Nww \exp_after:wN \c_minus_one
- \fi:
- #2
- \s__fp \__fp_chk:w 2 #1 \s__fp_exact ;
- \s__fp \__fp_chk:w { 3 \__fp_minmax_break_o:w } ;
- }
-\cs_new:Npn \__fp_minmax_loop:Nww
- #1 \s__fp \__fp_chk:w #2#3; \s__fp \__fp_chk:w #4#5;
- {
- \if_meaning:w 3 #4
- \if_meaning:w 3 #2
- \__fp_minmax_auxi:ww
- \else:
- \__fp_minmax_auxii:ww
- \fi:
- \else:
- \if_int_compare:w
- \__fp_compare_back:ww
- \s__fp \__fp_chk:w #4#5;
- \s__fp \__fp_chk:w #2#3;
- = #1
- \__fp_minmax_auxii:ww
- \else:
- \__fp_minmax_auxi:ww
- \fi:
- \fi:
- \__fp_minmax_loop:Nww #1
- \s__fp \__fp_chk:w #2#3;
- \s__fp \__fp_chk:w #4#5;
- }
-\cs_new:Npn \__fp_minmax_auxi:ww #1 \fi: \fi: #2 \s__fp #3 ; \s__fp #4;
- { \fi: \fi: #2 \s__fp #3 ; }
-\cs_new:Npn \__fp_minmax_auxii:ww #1 \fi: \fi: #2 \s__fp #3 ;
- { \fi: \fi: #2 }
-\cs_new:Npn \__fp_minmax_break_o:w #1 \fi: \fi: #2 \s__fp #3; #4;
- { \fi: \__fp_exp_after_o:w \s__fp #3; }
-\cs_new:cpn { __fp_not_o:w } #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_meaning:w 0 #2
- \exp_after:wN \exp_after:wN \exp_after:wN \c_one_fp
- \else:
- \exp_after:wN \exp_after:wN \exp_after:wN \c_zero_fp
- \fi:
- }
-\group_begin:
- \char_set_catcode_letter:N &
- \char_set_catcode_letter:N |
- \cs_new:Npn \__fp_&_o:ww #1 \s__fp \__fp_chk:w #2#3;
- {
- \if_meaning:w 0 #2 #1
- \__fp_and_return:wNw \s__fp \__fp_chk:w #2#3;
- \fi:
- \__fp_exp_after_o:w
- }
- \cs_new_nopar:Npn \__fp_|_o:ww { \__fp_&_o:ww \else: }
-\group_end:
-\cs_new:Npn \__fp_and_return:wNw #1; \fi: #2#3; { \fi: #2 #1; }
-\cs_new:Npn \__fp_ternary:NwwN #1 #2@ #3@ #4
- {
- \if_meaning:w \__fp_parse_infix_::N #4
- \__fp_ternary_loop:Nw
- #2
- \s__fp \__fp_chk:w { \__fp_ternary_loop_break:w } ;
- \__fp_ternary_break_point:n { \exp_after:wN \__fp_ternary_auxi:NwwN }
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \__fp_exp_after_array_f:w #3 \s__fp_stop
- \exp_after:wN @
- \tex_romannumeral:D
- \__fp_parse_operand:Nw \c_two
- \__fp_parse_expand:w
- \else:
- \__msg_kernel_expandable_error:nnnn
- { kernel } { fp-missing } { : } { ~for~?: }
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \__fp_exp_after_array_f:w #3 \s__fp_stop
- \exp_after:wN #4
- \exp_after:wN #1
- \fi:
- }
-\cs_new:Npn \__fp_ternary_loop_break:w #1 \fi: #2 \__fp_ternary_break_point:n #3
- {
- \c_zero = \c_zero \fi:
- \exp_after:wN \__fp_ternary_auxii:NwwN
- }
-\cs_new:Npn \__fp_ternary_loop:Nw \s__fp \__fp_chk:w #1#2;
- {
- \if_int_compare:w #1 > \c_zero
- \exp_after:wN \__fp_ternary_map_break:
- \fi:
- \__fp_ternary_loop:Nw
- }
-\cs_new:Npn \__fp_ternary_map_break: #1 \__fp_ternary_break_point:n #2 {#2}
-\cs_new:Npn \__fp_ternary_auxi:NwwN #1#2@#3@#4
- {
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \__fp_exp_after_array_f:w #2 \s__fp_stop
- #4 #1
- }
-\cs_new:Npn \__fp_ternary_auxii:NwwN #1#2@#3@#4
- {
- \exp_after:wN \__fp_parse_continue:NwN
- \exp_after:wN #1
- \tex_romannumeral:D -`0
- \__fp_exp_after_array_f:w #3 \s__fp_stop
- #4 #1
- }
-%% File: l3fp-basics.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_basics_pack_low:NNNNNw #1 #2#3#4#5 #6;
- { + #1 - \c_one ; {#2#3#4#5} {#6} ; }
-\cs_new:Npn \__fp_basics_pack_high:NNNNNw #1 #2#3#4#5 #6;
- {
- \if_meaning:w 2 #1
- \__fp_basics_pack_high_carry:w
- \fi:
- ; {#2#3#4#5} {#6}
- }
-\cs_new:Npn \__fp_basics_pack_high_carry:w \fi: ; #1
- { \fi: + \c_one ; {1000} }
-\cs_new:Npn \__fp_basics_pack_weird_low:NNNNw #1 #2#3#4 #5;
- {
- \if_meaning:w 2 #1
- + \c_one
- \fi:
- \__int_eval_end:
- #2#3#4; {#5} ;
- }
-\cs_new:Npn \__fp_basics_pack_weird_high:NNNNNNNNw
- 1 #1#2#3#4 #5#6#7#8 #9; { ; {#1#2#3#4} {#5#6#7#8} {#9} }
-\cs_new_nopar:cpx { __fp_-_o:ww } \s__fp
- {
- \exp_not:c { __fp_+_o:ww }
- \exp_not:n { \s__fp \__fp_neg_sign:N }
- }
-\cs_new:cpn { __fp_+_o:ww }
- \s__fp #1 \__fp_chk:w #2 #3 ; \s__fp \__fp_chk:w #4 #5
- {
- \if_case:w
- \if_meaning:w #2 #4
- #2 \exp_stop_f:
- \else:
- \if_int_compare:w #2 > #4 \exp_stop_f:
- \c_three
- \else:
- \c_minus_one
- \fi:
- \fi:
- \exp_after:wN \__fp_add_zeros_o:Nww \__int_value:w
- \or: \exp_after:wN \__fp_add_normal_o:Nww \__int_value:w
- \or: \exp_after:wN \__fp_add_inf_o:Nww \__int_value:w
- \or: \__fp_case_return_i_o:ww
- \else: \exp_after:wN \__fp_add_return_ii_o:Nww \__int_value:w
- \fi:
- #1 #5
- \s__fp \__fp_chk:w #2 #3 ;
- \s__fp \__fp_chk:w #4 #5
- }
-\cs_new:Npn \__fp_add_return_ii_o:Nww #1 #2 ; \s__fp \__fp_chk:w #3 #4
- { \__fp_exp_after_o:w \s__fp \__fp_chk:w #3 #1 }
-\cs_new:Npn \__fp_add_zeros_o:Nww #1 \s__fp \__fp_chk:w 0 #2
- {
- \if_int_compare:w #2 #1 = 20 \exp_stop_f:
- \exp_after:wN \__fp_add_return_ii_o:Nww
- \else:
- \__fp_case_return_i_o:ww
- \fi:
- #1
- \s__fp \__fp_chk:w 0 #2
- }
-\cs_new:Npn \__fp_add_inf_o:Nww
- #1 \s__fp \__fp_chk:w 2 #2 #3; \s__fp \__fp_chk:w 2 #4
- {
- \if_meaning:w #1 #2
- \__fp_case_return_i_o:ww
- \else:
- \__fp_case_use:nw
- {
- \if_meaning:w #1 #4
- \exp_after:wN \__fp_invalid_operation_o:Nww
- \exp_after:wN +
- \else:
- \exp_after:wN \__fp_invalid_operation_o:Nww
- \exp_after:wN -
- \fi:
- }
- \fi:
- \s__fp \__fp_chk:w 2 #2 #3;
- \s__fp \__fp_chk:w 2 #4
- }
-\cs_new:Npn \__fp_add_normal_o:Nww #1 \s__fp \__fp_chk:w 1 #2
- {
- \if_meaning:w #1#2
- \exp_after:wN \__fp_add_npos_o:NnwNnw
- \else:
- \exp_after:wN \__fp_sub_npos_o:NnwNnw
- \fi:
- #2
- }
-\cs_new:Npn \__fp_add_npos_o:NnwNnw #1#2#3 ; \s__fp \__fp_chk:w 1 #4 #5
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- \if_int_compare:w #2 > #5 \exp_stop_f:
- #2
- \exp_after:wN \__fp_add_big_i_o:wNww \__int_value:w -
- \else:
- #5
- \exp_after:wN \__fp_add_big_ii_o:wNww \__int_value:w
- \fi:
- \__int_eval:w #5 - #2 ; #1 #3;
- }
-\cs_new:Npn \__fp_add_big_i_o:wNww #1; #2 #3; #4;
- {
- \__fp_decimate:nNnnnn {#1}
- \__fp_add_significand_o:NnnwnnnnN
- #4
- #3
- #2
- }
-\cs_new:Npn \__fp_add_big_ii_o:wNww #1; #2 #3; #4;
- {
- \__fp_decimate:nNnnnn {#1}
- \__fp_add_significand_o:NnnwnnnnN
- #3
- #4
- #2
- }
-\cs_new:Npn \__fp_add_significand_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8
- {
- \exp_after:wN \__fp_add_significand_test_o:N
- \int_use:N \__int_eval:w 1#5#6 + #2
- \exp_after:wN \__fp_add_significand_pack:NNNNNNN
- \int_use:N \__int_eval:w 1#7#8 + #3 ; #1
- }
-\cs_new:Npn \__fp_add_significand_pack:NNNNNNN #1 #2#3#4#5#6#7
- {
- \if_meaning:w 2 #1
- + \c_one
- \fi:
- ; #2 #3 #4 #5 #6 #7 ;
- }
-\cs_new:Npn \__fp_add_significand_test_o:N #1
- {
- \if_meaning:w 2 #1
- \exp_after:wN \__fp_add_significand_carry_o:wwwNN
- \else:
- \exp_after:wN \__fp_add_significand_no_carry_o:wwwNN
- \fi:
- }
-\cs_new:Npn \__fp_add_significand_no_carry_o:wwwNN
- #1; #2; #3#4 ; #5#6
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1 #1
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1 #2 #3#4
- + \__fp_round:NNN #6 #4 #5
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_add_significand_carry_o:wwwNN
- #1; #2; #3#4; #5#6
- {
- + \c_one
- \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw
- \int_use:N \__int_eval:w 1 1 #1
- \exp_after:wN \__fp_basics_pack_weird_low:NNNNw
- \int_use:N \__int_eval:w 1 #2#3 +
- \exp_after:wN \__fp_round:NNN
- \exp_after:wN #6
- \exp_after:wN #3
- \__int_value:w \__fp_round_digit:Nw #4 #5 ;
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_sub_npos_o:NnwNnw #1#2#3; \s__fp \__fp_chk:w 1 #4#5#6;
- {
- \if_case:w \__fp_compare_npos:nwnw {#2} #3; {#5} #6; \exp_stop_f:
- \exp_after:wN \__fp_sub_eq_o:Nnwnw
- \or:
- \exp_after:wN \__fp_sub_npos_i_o:Nnwnw
- \else:
- \exp_after:wN \__fp_sub_npos_ii_o:Nnwnw
- \fi:
- #1 {#2} #3; {#5} #6;
- }
-\cs_new:Npn \__fp_sub_eq_o:Nnwnw #1#2; #3; { \exp_after:wN \c_zero_fp }
-\cs_new:Npn \__fp_sub_npos_ii_o:Nnwnw #1 #2; #3;
- {
- \exp_after:wN \__fp_sub_npos_i_o:Nnwnw
- \int_use:N \__int_eval:w \c_two - #1 \__int_eval_end:
- #3; #2;
- }
-\cs_new:Npn \__fp_sub_npos_i_o:Nnwnw #1 #2#3; #4#5;
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- #2
- \if_int_compare:w #2 = #4 \exp_stop_f:
- \exp_after:wN \__fp_sub_back_near_o:nnnnnnnnN
- \else:
- \exp_after:wN \__fp_decimate:nNnnnn \exp_after:wN
- { \int_use:N \__int_eval:w #2 - #4 - \c_one \exp_after:wN }
- \exp_after:wN \__fp_sub_back_far_o:NnnwnnnnN
- \fi:
- #5
- #3
- #1
- }
-\cs_new:Npn \__fp_sub_back_near_o:nnnnnnnnN #1#2#3#4 #5#6#7#8 #9
- {
- \exp_after:wN \__fp_sub_back_near_after:wNNNNw
- \int_use:N \__int_eval:w 10#5#6 - #1#2 - \c_eleven
- \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw
- \int_use:N \__int_eval:w 11#7#8 - #3#4 \exp_after:wN ;
- }
-\cs_new:Npn \__fp_sub_back_near_pack:NNNNNNw #1#2#3#4#5#6#7 ;
- { + #1#2 ; {#3#4#5#6} {#7} ; }
-\cs_new:Npn \__fp_sub_back_near_after:wNNNNw 10 #1#2#3#4 #5 ;
- {
- \if_meaning:w 0 #1
- \exp_after:wN \__fp_sub_back_shift:wnnnn
- \fi:
- ; {#1#2#3#4} {#5}
- }
-\cs_new:Npn \__fp_sub_back_shift:wnnnn ; #1#2
- {
- \exp_after:wN \__fp_sub_back_shift_ii:ww
- \__int_value:w #1 #2 0 ;
- }
-\cs_new:Npn \__fp_sub_back_shift_ii:ww #1 0 ; #2#3 ;
- {
- \if_meaning:w @ #1 @
- - \c_seven
- - \exp_after:wN \use_i:nnn
- \exp_after:wN \__fp_sub_back_shift_iii:NNNNNNNNw
- \__int_value:w #2#3 0 ~ 123456789;
- \else:
- - \__fp_sub_back_shift_iii:NNNNNNNNw #1 123456789;
- \fi:
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_sub_back_shift_iv:nnnnw
- \exp_after:wN ;
- \__int_value:w
- #1 ~ #2#3 0 ~ 0000 0000 0000 000 ;
- }
-\cs_new:Npn \__fp_sub_back_shift_iii:NNNNNNNNw #1#2#3#4#5#6#7#8#9; {#8}
-\cs_new:Npn \__fp_sub_back_shift_iv:nnnnw #1 ; #2 ; { ; #1 ; }
-\cs_new:Npn \__fp_sub_back_far_o:NnnwnnnnN #1 #2#3 #4; #5#6#7#8
- {
- \if_case:w
- \if_int_compare:w 1 #2 = #5#6 \use_i:nnnn #7 \exp_stop_f:
- \if_int_compare:w #3 = \use_none:n #7#8 0 \exp_stop_f:
- \c_zero
- \else:
- \if_int_compare:w #3 > \use_none:n #7#8 0 - \fi: \c_one
- \fi:
- \else:
- \if_int_compare:w 1 #2 > #5#6 \use_i:nnnn #7 - \fi: \c_one
- \fi:
- \exp_after:wN \__fp_sub_back_quite_far_o:wwNN
- \or: \exp_after:wN \__fp_sub_back_very_far_o:wwwwNN
- \else: \exp_after:wN \__fp_sub_back_not_far_o:wwwwNN
- \fi:
- #2 ~ #3 ; #5 #6 ~ #7 #8 ; #1
- }
-\cs_new:Npn \__fp_sub_back_quite_far_o:wwNN #1; #2; #3#4
- {
- \exp_after:wN \__fp_sub_back_quite_far_ii:NN
- \exp_after:wN #3
- \exp_after:wN #4
- }
-\cs_new:Npn \__fp_sub_back_quite_far_ii:NN #1#2
- {
- \if_case:w \__fp_round_neg:NNN #2 0 #1
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- { ; {1000} {0000} {0000} {0000} ; }
- { - \c_one ; {9999} {9999} {9999} {9999} ; }
- }
-\cs_new:Npn \__fp_sub_back_not_far_o:wwwwNN #1 ~ #2; #3 ~ #4; #5#6
- {
- - \c_one
- \exp_after:wN \__fp_sub_back_near_after:wNNNNw
- \int_use:N \__int_eval:w 1#30 - #1 - \c_eleven
- \exp_after:wN \__fp_sub_back_near_pack:NNNNNNw
- \int_use:N \__int_eval:w 11 0000 0000 + #40 - #2
- - \exp_after:wN \__fp_round_neg:NNN
- \exp_after:wN #6
- \use_none:nnnnnnn #2 #5
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_sub_back_very_far_o:wwwwNN #1#2#3#4#5#6#7
- {
- \__fp_pack_eight:wNNNNNNNN
- \__fp_sub_back_very_far_ii_o:nnNwwNN
- { 0 #1#2#3 #4#5#6#7 }
- ;
- }
-\cs_new:Npn \__fp_sub_back_very_far_ii_o:nnNwwNN #1#2 ; #3 ; #4 ~ #5; #6#7
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1#4 - #1 - \c_one
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 2#5 - #2
- - \exp_after:wN \__fp_round_neg:NNN
- \exp_after:wN #7
- \__int_value:w
- \if_int_odd:w \__int_eval:w #5 - #2 \__int_eval_end:
- 1 \else: 2 \fi:
- \__int_value:w \__fp_round_digit:Nw #3 #6 ;
- \exp_after:wN ;
- }
-\cs_new_nopar:cpn { __fp_*_o:ww }
- {
- \__fp_mul_cases_o:NnNnww
- *
- { - \c_two + }
- \__fp_mul_npos_o:Nww
- { }
- }
-\cs_new:Npn \__fp_mul_cases_o:NnNnww
- #1#2#3#4 \s__fp \__fp_chk:w #5#6#7; \s__fp \__fp_chk:w #8#9
- {
- \if_case:w \__int_eval:w
- \if_int_compare:w #5 #8 = \c_eleven
- \c_one
- \else:
- \if_meaning:w 3 #8
- \c_three
- \else:
- \if_meaning:w 3 #5
- \c_two
- \else:
- \if_int_compare:w #5 #8 = \c_ten
- \c_nine #2 - \c_two
- \else:
- (#5 #2 #8) / \c_two * \c_two + \c_seven
- \fi:
- \fi:
- \fi:
- \fi:
- \if_meaning:w #6 #9 - \c_one \fi:
- \__int_eval_end:
- \__fp_case_use:nw { #3 0 }
- \or: \__fp_case_use:nw { #3 2 }
- \or: \__fp_case_return_i_o:ww
- \or: \__fp_case_return_ii_o:ww
- \or: \__fp_case_return_o:Nww \c_zero_fp
- \or: \__fp_case_return_o:Nww \c_minus_zero_fp
- \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 }
- \or: \__fp_case_use:nw { \__fp_invalid_operation_o:Nww #1 }
- \or: \__fp_case_return_o:Nww \c_inf_fp
- \or: \__fp_case_return_o:Nww \c_minus_inf_fp
- #4
- \fi:
- \s__fp \__fp_chk:w #5 #6 #7;
- \s__fp \__fp_chk:w #8 #9
- }
-\cs_new:Npn \__fp_mul_npos_o:Nww
- #1 \s__fp \__fp_chk:w #2 #3 #4 #5 ; \s__fp \__fp_chk:w #6 #7 #8 #9 ;
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- #4 + #8
- \__fp_mul_significand_o:nnnnNnnnn #5 #1 #9
- }
-\cs_new:Npn \__fp_mul_significand_o:nnnnNnnnn #1#2#3#4 #5 #6#7#8#9
- {
- \exp_after:wN \__fp_mul_significand_test_f:NNN
- \exp_after:wN #5
- \int_use:N \__int_eval:w 99990000 + #1*#6 +
- \exp_after:wN \__fp_mul_significand_keep:NNNNNw
- \int_use:N \__int_eval:w 99990000 + #1*#7 + #2*#6 +
- \exp_after:wN \__fp_mul_significand_keep:NNNNNw
- \int_use:N \__int_eval:w 99990000 + #1*#8 + #2*#7 + #3*#6 +
- \exp_after:wN \__fp_mul_significand_drop:NNNNNw
- \int_use:N \__int_eval:w 99990000 + #1*#9 + #2*#8 + #3*#7 + #4*#6 +
- \exp_after:wN \__fp_mul_significand_drop:NNNNNw
- \int_use:N \__int_eval:w 99990000 + #2*#9 + #3*#8 + #4*#7 +
- \exp_after:wN \__fp_mul_significand_drop:NNNNNw
- \int_use:N \__int_eval:w 99990000 + #3*#9 + #4*#8 +
- \exp_after:wN \__fp_mul_significand_drop:NNNNNw
- \int_use:N \__int_eval:w 100000000 + #4*#9 ;
- ; \exp_after:wN ;
- }
-\cs_new:Npn \__fp_mul_significand_drop:NNNNNw #1#2#3#4#5 #6;
- { #1#2#3#4#5 ; + #6 }
-\cs_new:Npn \__fp_mul_significand_keep:NNNNNw #1#2#3#4#5 #6;
- { #1#2#3#4#5 ; #6 ; }
-\cs_new:Npn \__fp_mul_significand_test_f:NNN #1 #2 #3
- {
- \if_meaning:w 0 #3
- \exp_after:wN \__fp_mul_significand_small_f:NNwwwN
- \else:
- \exp_after:wN \__fp_mul_significand_large_f:NwwNNNN
- \fi:
- #1 #3
- }
-\cs_new:Npn \__fp_mul_significand_large_f:NwwNNNN #1 #2; #3; #4#5#6#7; +
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1#2
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1#3#4#5#6#7
- + \exp_after:wN \__fp_round:NNN
- \exp_after:wN #1
- \exp_after:wN #7
- \__int_value:w \__fp_round_digit:Nw
- }
-\cs_new:Npn \__fp_mul_significand_small_f:NNwwwN #1 #2#3; #4#5; #6; + #7
- {
- - \c_one
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1#3#4
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1#5#6#7
- + \exp_after:wN \__fp_round:NNN
- \exp_after:wN #1
- \exp_after:wN #7
- \__int_value:w \__fp_round_digit:Nw
- }
-\cs_new_nopar:cpn { __fp_/_o:ww }
- {
- \__fp_mul_cases_o:NnNnww
- /
- { - }
- \__fp_div_npos_o:Nww
- {
- \or:
- \__fp_case_use:nw
- { \__fp_division_by_zero_o:NNww \c_inf_fp / }
- \or:
- \__fp_case_use:nw
- { \__fp_division_by_zero_o:NNww \c_minus_inf_fp / }
- }
- }
-\cs_new:Npn \__fp_div_npos_o:Nww
- #1 \s__fp \__fp_chk:w 1 #2 #3 #4 ; \s__fp \__fp_chk:w 1 #5 #6 #7#8#9;
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- #3 - #6
- \exp_after:wN \__fp_div_significand_i_o:wnnw
- \int_use:N \__int_eval:w #7 \use_i:nnnn #8 + \c_one ;
- #4
- {#7}{#8}#9 ;
- #1
- }
-\cs_new:Npn \__fp_div_significand_i_o:wnnw #1 ; #2#3 #4 ;
- {
- \exp_after:wN \__fp_div_significand_test_o:w
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
- \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ;
- #2 #3 ;
- #4
- { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_div_significand_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_div_significand_iii:wwnnnnn \__int_value:w #1 }
- }
-\cs_new:Npn \__fp_div_significand_calc:wwnnnnnnn 1#1
- {
- \if_meaning:w 1 #1
- \exp_after:wN \__fp_div_significand_calc_i:wwnnnnnnn
- \else:
- \exp_after:wN \__fp_div_significand_calc_ii:wwnnnnnnn
- \fi:
- }
-\cs_new:Npn \__fp_div_significand_calc_i:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
- {
- 1 1 #1
- #9 \exp_after:wN ;
- \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int
- + #2 - #1 * #5 - #5#60
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
- + #3 - #1 * #6 - #70
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
- + #4 - #1 * #7 - #80
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int
- - #1 * #8 ;
- {#5}{#6}{#7}{#8}
- }
-\cs_new:Npn \__fp_div_significand_calc_ii:wwnnnnnnn #1; #2;#3#4 #5#6#7#8 #9
- {
- 1 0 #1
- #9 \exp_after:wN ;
- \int_use:N \__int_eval:w \c__fp_Bigg_leading_shift_int
- + #2 - #1 * #5
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
- + #3 - #1 * #6
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_middle_shift_int
- + #4 - #1 * #7
- \exp_after:wN \__fp_pack_Bigg:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_Bigg_trailing_shift_int
- - #1 * #8 ;
- {#5}{#6}{#7}{#8}
- }
-\cs_new:Npn \__fp_div_significand_ii:wwn #1; #2;#3
- {
- \exp_after:wN \__fp_div_significand_pack:NNN
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
- \int_use:N \__int_eval:w 999999 + #2 #3 0 / #1 ; #2 #3 ;
- }
-\cs_new:Npn \__fp_div_significand_iii:wwnnnnn #1; #2;#3#4#5 #6#7
- {
- 0
- \exp_after:wN \__fp_div_significand_iv:wwnnnnnnn
- \int_use:N \__int_eval:w (\c_two * #2 #3) / #6 #7 ; % <- P
- #2 ; {#3} {#4} {#5}
- {#6} {#7}
- }
-\cs_new:Npn \__fp_div_significand_iv:wwnnnnnnn #1; #2;#3#4#5 #6#7#8#9
- {
- + \c_five * #1
- \exp_after:wN \__fp_div_significand_vi:Nw
- \int_use:N \__int_eval:w -20 + 2*#2#3 - #1*#6#7 +
- \exp_after:wN \__fp_div_significand_v:NN
- \int_use:N \__int_eval:w 199980 + 2*#4 - #1*#8 +
- \exp_after:wN \__fp_div_significand_v:NN
- \int_use:N \__int_eval:w 200000 + 2*#5 - #1*#9 ;
- }
-\cs_new:Npn \__fp_div_significand_v:NN #1#2 { #1#2 \__int_eval_end: + }
-\cs_new:Npn \__fp_div_significand_vi:Nw #1#2;
- {
- \if_meaning:w 0 #1
- \if_int_compare:w \__int_eval:w #2 > \c_zero + \c_one \fi:
- \else:
- \if_meaning:w - #1 - \else: + \fi: \c_one
- \fi:
- ;
- }
-\cs_new:Npn \__fp_div_significand_pack:NNN 1 #1 #2 { + #1 #2 ; }
-\cs_new:Npn \__fp_div_significand_test_o:w 10 #1
- {
- \if_meaning:w 0 #1
- \exp_after:wN \__fp_div_significand_small_o:wwwNNNNwN
- \else:
- \exp_after:wN \__fp_div_significand_large_o:wwwNNNNwN
- \fi:
- #1
- }
-\cs_new:Npn \__fp_div_significand_small_o:wwwNNNNwN
- 0 #1; #2; #3; #4#5#6#7#8; #9
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1 #1#2
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1 #3#4#5#6#7
- + \__fp_round:NNN #9 #7 #8
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_div_significand_large_o:wwwNNNNwN
- #1; #2; #3; #4#5#6#7#8; #9
- {
- + \c_one
- \exp_after:wN \__fp_basics_pack_weird_high:NNNNNNNNw
- \int_use:N \__int_eval:w 1 #1 #2
- \exp_after:wN \__fp_basics_pack_weird_low:NNNNw
- \int_use:N \__int_eval:w 1 #3 #4 #5 #6 +
- \exp_after:wN \__fp_round:NNN
- \exp_after:wN #9
- \exp_after:wN #6
- \__int_value:w \__fp_round_digit:Nw #7 #8 ;
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_sqrt_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_meaning:w 0 #2 \__fp_case_return_same_o:w \fi:
- \if_meaning:w 2 #3
- \__fp_case_use:nw { \__fp_invalid_operation_o:nw { sqrt } }
- \fi:
- \if_meaning:w 1 #2 \else: \__fp_case_return_same_o:w \fi:
- \__fp_sqrt_npos_o:w
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_sqrt_npos_o:w \s__fp \__fp_chk:w 1 0 #1#2#3#4#5;
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN 0
- \int_use:N \__int_eval:w
- \if_int_odd:w #1 \exp_stop_f:
- \exp_after:wN \__fp_sqrt_npos_auxi_o:wwnnN
- \fi:
- #1 / \c_two
- \__fp_sqrt_Newton_o:wwn 56234133; 0; {#2#3} {#4#5} 0
- }
-\cs_new:Npn \__fp_sqrt_npos_auxi_o:wwnnN #1 / \c_two #2; 0; #3#4#5
- {
- ( #1 + \c_one ) / \c_two
- \__fp_pack_eight:wNNNNNNNN
- \__fp_sqrt_npos_auxii_o:wNNNNNNNN
- ;
- 0 #3 #4
- }
-\cs_new:Npn \__fp_sqrt_npos_auxii_o:wNNNNNNNN #1; #2#3#4#5#6#7#8#9
- { \__fp_sqrt_Newton_o:wwn 17782794; 0; {#1} {#2#3#4#5#6#7#8#9} }
-\cs_new:Npn \__fp_sqrt_Newton_o:wwn #1; #2; #3
- {
- \if_int_compare:w #1 = #2 \exp_stop_f:
- \exp_after:wN \__fp_sqrt_auxi_o:NNNNwnnN
- \int_use:N \__int_eval:w 9999 9999 +
- \exp_after:wN \__fp_use_none_until_s:w
- \fi:
- \exp_after:wN \__fp_sqrt_Newton_o:wwn
- \int_use:N \__int_eval:w (#1 + #3 * 1 0000 0000 / #1) / \c_two ;
- #1; {#3}
- }
-\cs_new:Npn \__fp_sqrt_auxi_o:NNNNwnnN 1 #1#2#3#4#5;
- {
- \__fp_sqrt_auxii_o:NnnnnnnnN
- \__fp_sqrt_auxiii_o:wnnnnnnnn
- {#1#2#3#4} {#5} {2499} {9988} {7500}
- }
-\cs_new:Npn \__fp_sqrt_auxii_o:NnnnnnnnN #1 #2#3#4#5#6 #7#8#9
- {
- \exp_after:wN #1
- \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
- + #7 - #2 * #2
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- - 2 * #2 * #3
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- + #8 - #3 * #3 - 2 * #2 * #4
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- - 2 * #3 * #4 - 2 * #2 * #5
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- + #9 000 0000 - #4 * #4 - 2 * #3 * #5 - 2 * #2 * #6
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- - 2 * #4 * #5 - 2 * #3 * #6
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- - #5 * #5 - 2 * #4 * #6
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w
- \c__fp_big_middle_shift_int
- - 2 * #5 * #6
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w
- \c__fp_big_trailing_shift_int
- - #6 * #6 ;
- % (
- - 257 ) * 5000 0000 / (#2#3 + 1) + 10 0000 0000 ;
- {#2}{#3}{#4}{#5}{#6} {#7}{#8}#9
- }
-\cs_new:Npn \__fp_sqrt_auxiii_o:wnnnnnnnn
- #1; #2#3#4#5#6#7#8#9
- {
- \if_int_compare:w #1 > \c_one
- \exp_after:wN \__fp_sqrt_auxiv_o:NNNNNw
- \int_use:N \__int_eval:w (#1#2 %)
- \else:
- \if_int_compare:w #1#2 > \c_one
- \exp_after:wN \__fp_sqrt_auxv_o:NNNNNw
- \int_use:N \__int_eval:w (#1#2#3 %)
- \else:
- \if_int_compare:w #1#2#3 > \c_one
- \exp_after:wN \__fp_sqrt_auxvi_o:NNNNNw
- \int_use:N \__int_eval:w (#1#2#3#4 %)
- \else:
- \exp_after:wN \__fp_sqrt_auxvii_o:NNNNNw
- \int_use:N \__int_eval:w (#1#2#3#4#5 %)
- \fi:
- \fi:
- \fi:
- }
-\cs_new:Npn \__fp_sqrt_auxiv_o:NNNNNw 1#1#2#3#4#5#6;
- { \__fp_sqrt_auxviii_o:nnnnnnn {#1#2#3#4#5#6} {00000000} }
-\cs_new:Npn \__fp_sqrt_auxv_o:NNNNNw 1#1#2#3#4#5#6;
- { \__fp_sqrt_auxviii_o:nnnnnnn {000#1#2#3#4#5} {#60000} }
-\cs_new:Npn \__fp_sqrt_auxvi_o:NNNNNw 1#1#2#3#4#5#6;
- { \__fp_sqrt_auxviii_o:nnnnnnn {0000000#1} {#2#3#4#5#6} }
-\cs_new:Npn \__fp_sqrt_auxvii_o:NNNNNw 1#1#2#3#4#5#6;
- {
- \if_int_compare:w #1#2 = \c_zero
- \exp_after:wN \__fp_sqrt_auxx_o:Nnnnnnnn
- \fi:
- \__fp_sqrt_auxviii_o:nnnnnnn {00000000} {000#1#2#3#4#5}
- }
-\cs_new:Npn \__fp_sqrt_auxviii_o:nnnnnnn #1#2 #3#4#5#6#7
- {
- \exp_after:wN \__fp_sqrt_auxix_o:wnwnw
- \int_use:N \__int_eval:w #3
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w #1 + 1#4#5
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w #2 + 1#6#7 ;
- }
-\cs_new:Npn \__fp_sqrt_auxix_o:wnwnw #1; #2#3; #4#5;
- {
- \__fp_sqrt_auxii_o:NnnnnnnnN
- \__fp_sqrt_auxiii_o:wnnnnnnnn {#1}{#2}{#3}{#4}{#5}
- }
-\cs_new:Npn \__fp_sqrt_auxx_o:Nnnnnnnn #1#2#3 #4#5#6#7#8
- {
- \exp_after:wN \__fp_sqrt_auxxi_o:wwnnN
- \int_use:N \__int_eval:w
- (#8 + 2499) / 5000 * 5000 ;
- {#4} {#5} {#6} {#7} ;
- }
-\cs_new:Npn \__fp_sqrt_auxxi_o:wwnnN #1; #2; #3#4#5
- {
- \__fp_sqrt_auxii_o:NnnnnnnnN
- \__fp_sqrt_auxxii_o:nnnnnnnnw
- #2 {#1}
- {#3} { #4 + \c_one } #5
- }
-\cs_new:Npn \__fp_sqrt_auxxii_o:nnnnnnnnw 0; #1#2#3#4#5#6#7#8 #9;
- {
- \if_int_compare:w #1#2 > \c_zero
- \if_int_compare:w #1#2 = \c_one
- \if_int_compare:w #3#4 = \c_zero
- \if_int_compare:w #5#6 = \c_zero
- \if_int_compare:w #7#8 = \c_zero
- \__fp_sqrt_auxxiii_o:w
- \fi:
- \fi:
- \fi:
- \fi:
- \exp_after:wN \__fp_sqrt_auxxiv_o:wnnnnnnnN
- \__int_value:w 9998
- \else:
- \exp_after:wN \__fp_sqrt_auxxiv_o:wnnnnnnnN
- \__int_value:w 10000
- \fi:
- ;
- }
-\cs_new:Npn \__fp_sqrt_auxxiii_o:w \fi: \fi: \fi: \fi: #1 \fi: ;
- {
- \fi: \fi: \fi: \fi: \fi:
- \__fp_sqrt_auxxiv_o:wnnnnnnnN 9999 ;
- }
-\cs_new:Npn \__fp_sqrt_auxxiv_o:wnnnnnnnN #1; #2#3#4#5#6 #7#8#9
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1 0000 0000 + #2#3
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1 0000 0000
- + #4#5
- \if_int_compare:w #6 > #1 \exp_stop_f: + \c_one \fi:
- + \exp_after:wN \__fp_round:NNN
- \exp_after:wN 0
- \exp_after:wN 0
- \__int_value:w
- \exp_after:wN \use_i:nn
- \exp_after:wN \__fp_round_digit:Nw
- \int_use:N \__int_eval:w #6 + 19999 - #1 ;
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_set_sign_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \exp_after:wN \__fp_exp_after_o:w
- \exp_after:wN \s__fp
- \exp_after:wN \__fp_chk:w
- \exp_after:wN #2
- \__int_value:w
- \if_case:w #3 \exp_stop_f: #1 \or: 1 \or: 0 \fi: \exp_stop_f:
- #4;
- }
-%% File: l3fp-extended.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\tl_const:Nn \c__fp_one_fixed_tl
- { {10000} {0000} {0000} {0000} {0000} {0000} }
-\cs_new:Npn \__fp_fixed_continue:wn #1; #2 { #2 #1; }
-\cs_new:Npn \__fp_fixed_add_one:wN #1#2; #3
- {
- \exp_after:wN #3 \exp_after:wN
- { \int_use:N \__int_eval:w \c_ten_thousand + #1 } #2 ;
- }
-\cs_new:Npn \__fp_fixed_div_myriad:wn #1#2#3#4#5#6;
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_trailing_shift_int
- + #1 ; {#2}{#3}{#4}{#5};
- }
-\cs_new:Npn \__fp_fixed_mul_after:wwn #1; #2; #3 { #3 {#1} #2; }
-\cs_new:Npn \__fp_fixed_mul_short:wwn #1#2#3#4#5#6; #7#8#9;
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- + #1*#7
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#8 + #2*#7
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#9 + #2*#8 + #3*#7
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #2*#9 + #3*#8 + #4*#7
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #3*#9 + #4*#8 + #5*#7
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_trailing_shift_int
- + #4*#9 + #5*#8 + #6*#7
- + ( #5*#9 + #6*#8 + #6*#9 / \c_ten_thousand )
- / \c_ten_thousand ; ;
- }
-\cs_new:Npn \__fp_fixed_div_int:wwN #1#2#3#4#5#6 ; #7 ; #8
- {
- \exp_after:wN \__fp_fixed_div_int_after:Nw
- \exp_after:wN #8
- \int_use:N \__int_eval:w \c_minus_one
- \__fp_fixed_div_int:wnN
- #1; {#7} \__fp_fixed_div_int_auxi:wnn
- #2; {#7} \__fp_fixed_div_int_auxi:wnn
- #3; {#7} \__fp_fixed_div_int_auxi:wnn
- #4; {#7} \__fp_fixed_div_int_auxi:wnn
- #5; {#7} \__fp_fixed_div_int_auxi:wnn
- #6; {#7} \__fp_fixed_div_int_auxii:wnn ;
- }
-\cs_new:Npn \__fp_fixed_div_int:wnN #1; #2 #3
- {
- \exp_after:wN #3
- \int_use:N \__int_eval:w #1 / #2 - \c_one ;
- {#2}
- {#1}
- }
-\cs_new:Npn \__fp_fixed_div_int_auxi:wnn #1; #2 #3
- {
- + #1
- \exp_after:wN \__fp_fixed_div_int_pack:Nw
- \int_use:N \__int_eval:w 9999
- \exp_after:wN \__fp_fixed_div_int:wnN
- \int_use:N \__int_eval:w #3 - #1*#2 \__int_eval_end:
- }
-\cs_new:Npn \__fp_fixed_div_int_auxii:wnn #1; #2 #3 { + #1 + \c_two ; }
-\cs_new:Npn \__fp_fixed_div_int_pack:Nw #1 #2; { + #1; {#2} }
-\cs_new:Npn \__fp_fixed_div_int_after:Nw #1 #2; { #1 {#2} }
-\cs_new_nopar:Npn \__fp_fixed_add:wwn { \__fp_fixed_add:Nnnnnwnn + }
-\cs_new_nopar:Npn \__fp_fixed_sub:wwn { \__fp_fixed_add:Nnnnnwnn - }
-\cs_new:Npn \__fp_fixed_add:Nnnnnwnn #1 #2#3#4#5 #6; #7#8
- {
- \exp_after:wN \__fp_fixed_add_after:NNNNNwn
- \int_use:N \__int_eval:w 9 9999 9998 + #2#3 #1 #7#8
- \exp_after:wN \__fp_fixed_add_pack:NNNNNwn
- \int_use:N \__int_eval:w 1 9999 9998 + #4#5
- \__fp_fixed_add:nnNnnnwn #6 #1
- }
-\cs_new:Npn \__fp_fixed_add:nnNnnnwn #1#2 #3 #4#5 #6#7 ; #8
- {
- #3 #4#5
- \exp_after:wN \__fp_fixed_add_pack:NNNNNwn
- \int_use:N \__int_eval:w 2 0000 0000 #3 #6#7 + #1#2 ; {#8} ;
- }
-\cs_new:Npn \__fp_fixed_add_pack:NNNNNwn #1 #2#3#4#5 #6; #7
- { + #1 ; {#7} {#2#3#4#5} {#6} }
-\cs_new:Npn \__fp_fixed_add_after:NNNNNwn 1 #1 #2#3#4#5 #6; #7
- { #7 {#1#2#3#4#5} {#6} }
-\cs_new:Npn \__fp_fixed_mul:wwn #1#2#3#4 #5; #6#7#8#9
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#6
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#7 + #2*#6
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#8 + #2*#7 + #3*#6
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #1*#9 + #2*#8 + #3*#7 + #4*#6
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_trailing_shift_int
- + #2*#9 + #3*#8 + #4*#7
- + ( #3*#9 + #4*#8
- + \__fp_fixed_mul:nnnnnnnw #5 {#6}{#7} {#1}{#2}
- }
-\cs_new:Npn \__fp_fixed_mul:nnnnnnnw #1#2 #3#4 #5#6 #7#8 ;
- {
- #1*#4 + #2*#3 + #5*#8 + #6*#7 ) / \c_ten_thousand
- + #1*#3 + #5*#7 ; ;
- }
-\cs_new:Npn \__fp_fixed_mul_add:wwwn #1; #2; #3#4#5#6#7#8;
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4
- \__fp_fixed_mul_add:Nwnnnwnnn +
- + #5 #6 ; #2 ; #1 ; #2 ; +
- + #7 #8 ; ;
- }
-\cs_new:Npn \__fp_fixed_mul_sub_back:wwwn #1; #2; #3#4#5#6#7#8;
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + #3 #4
- \__fp_fixed_mul_add:Nwnnnwnnn -
- + #5 #6 ; #2 ; #1 ; #2 ; -
- + #7 #8 ; ;
- }
-\cs_new:Npn \__fp_fixed_one_minus_mul:wwn #1; #2;
- {
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_big_leading_shift_int
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int + 1 0000 0000
- \__fp_fixed_mul_add:Nwnnnwnnn -
- ; #2 ; #1 ; #2 ; -
- ; ;
- }
-\cs_new:Npn \__fp_fixed_mul_add:Nwnnnwnnn #1 #2; #3#4#5#6; #7#8#9
- {
- #1 #7*#3
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- #1 #7*#4 #1 #8*#3
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- #1 #7*#5 #1 #8*#4 #1 #9*#3 #2
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_middle_shift_int
- #1 \__fp_fixed_mul_add:nnnnwnnnn {#7}{#8}{#9}
- }
-\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnnn #1#2#3#4#5; #6#7#8#9
- {
- ( #1*#9 + #2*#8 + #3*#7 + #4*#6 )
- \exp_after:wN \__fp_pack_big:NNNNNNw
- \int_use:N \__int_eval:w \c__fp_big_trailing_shift_int
- \__fp_fixed_mul_add:nnnnwnnwN
- { #6 + #4*#7 + #3*#8 + #2*#9 + #1 }
- { #7 + #4*#8 + #3*#9 + #2 }
- {#1} #5;
- {#6}
- }
-\cs_new:Npn \__fp_fixed_mul_add:nnnnwnnwN #1#2 #3#4#5; #6#7#8; #9
- {
- #9 (#4* #1 *#7)
- #9 (#5*#6+#4* #2 *#7+#3*#8) / \c_ten_thousand
- }
-\cs_new:Npn \__fp_ep_to_fixed:wwn #1,#2
- {
- \exp_after:wN \__fp_ep_to_fixed_auxi:www
- \int_use:N \__int_eval:w 1 0000 0000 + #2 \exp_after:wN ;
- \tex_romannumeral:D -`0
- \prg_replicate:nn { \c_four - \int_max:nn {#1} { -32 } } { 0 } ;
- }
-\cs_new:Npn \__fp_ep_to_fixed_auxi:www 1#1; #2; #3#4#5#6#7;
- {
- \__fp_pack_eight:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_ep_to_fixed_auxii:nnnnnnnwn ;
- #2 #1#3#4#5#6#7 0000 !
- }
-\cs_new:Npn \__fp_ep_to_fixed_auxii:nnnnnnnwn #1#2#3#4#5#6#7; #8! #9
- { #9 {#1#2}{#3}{#4}{#5}{#6}{#7}; }
-\cs_new:Npn \__fp_ep_to_ep:wwN #1,#2#3#4#5#6#7; #8
- {
- \exp_after:wN #8
- \int_use:N \__int_eval:w #1 + \c_four
- \exp_after:wN \use_i:nn
- \exp_after:wN \__fp_ep_to_ep_loop:N
- \int_use:N \__int_eval:w 1 0000 0000 + #2 \__int_eval_end:
- #3#4#5#6#7 ; ; !
- }
-\cs_new:Npn \__fp_ep_to_ep_loop:N #1
- {
- \if_meaning:w 0 #1
- - \c_one
- \else:
- \__fp_ep_to_ep_end:www #1
- \fi:
- \__fp_ep_to_ep_loop:N
- }
-\cs_new:Npn \__fp_ep_to_ep_end:www
- #1 \fi: \__fp_ep_to_ep_loop:N #2; #3!
- {
- \fi:
- \if_meaning:w ; #1
- - \c_two * \c__fp_max_exponent_int
- \__fp_ep_to_ep_zero:ww
- \fi:
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_use_i:ww , ;
- #1 #2 0000 0000 0000 0000 0000 0000 ;
- }
-\cs_new:Npn \__fp_ep_to_ep_zero:ww \fi: #1; #2; #3;
- { \fi: , {1000}{0000}{0000}{0000}{0000}{0000} ; }
-\cs_new:Npn \__fp_ep_compare:wwww #1,#2#3#4#5#6#7;
- { \__fp_ep_compare_aux:wwww {#1}{#2}{#3}{#4}{#5}; #6#7; }
-\cs_new:Npn \__fp_ep_compare_aux:wwww #1;#2;#3,#4#5#6#7#8#9;
- {
- \if_case:w
- \__fp_compare_npos:nwnw #1; {#3}{#4}{#5}{#6}{#7}; \exp_stop_f:
- \if_int_compare:w #2 = #8#9 \exp_stop_f:
- 0
- \else:
- \if_int_compare:w #2 < #8#9 - \fi: 1
- \fi:
- \or: 1
- \else: -1
- \fi:
- }
-\cs_new:Npn \__fp_ep_mul:wwwwn #1,#2; #3,#4;
- {
- \__fp_ep_to_ep:wwN #3,#4;
- \__fp_fixed_continue:wn
- {
- \__fp_ep_to_ep:wwN #1,#2;
- \__fp_ep_mul_raw:wwwwN
- }
- \__fp_fixed_continue:wn
- }
-\cs_new:Npn \__fp_ep_mul_raw:wwwwN #1,#2; #3,#4; #5
- {
- \__fp_fixed_mul:wwn #2; #4;
- { \exp_after:wN #5 \int_use:N \__int_eval:w #1 + #3 , }
- }
-\cs_new:Npn \__fp_ep_div:wwwwn #1,#2; #3,#4;
- {
- \__fp_ep_to_ep:wwN #1,#2;
- \__fp_fixed_continue:wn
- {
- \__fp_ep_to_ep:wwN #3,#4;
- \__fp_ep_div_esti:wwwwn
- }
- }
-\cs_new:Npn \__fp_ep_div_esti:wwwwn #1,#2#3; #4,
- {
- \exp_after:wN \__fp_ep_div_estii:wwnnwwn
- \int_use:N \__int_eval:w 10 0000 0000 / ( #2 + \c_one )
- \exp_after:wN ;
- \int_use:N \__int_eval:w #4 - #1 + \c_one ,
- {#2} #3;
- }
-\cs_new:Npn \__fp_ep_div_estii:wwnnwwn #1; #2,#3#4#5; #6; #7
- {
- \exp_after:wN \__fp_ep_div_estiii:NNNNNwwwn
- \int_use:N \__int_eval:w 10 0000 0000 - 1750
- + #1 000 + (10 0000 0000 / #3 - #1) * (1000 - #4 / 10) ;
- {#3}{#4}#5; #6; { #7 #2, }
- }
-\cs_new:Npn \__fp_ep_div_estiii:NNNNNwwwn 1#1#2#3#4#5#6; #7;
- {
- \__fp_fixed_mul_short:wwn #7; {#1}{#2#3#4#5}{#6};
- \__fp_ep_div_epsi:wnNNNNNn {#1#2#3#4}#5#6
- \__fp_fixed_mul:wwn
- }
-\cs_new:Npn \__fp_ep_div_epsi:wnNNNNNn #1#2#3#4#5#6;
- {
- \exp_after:wN \__fp_ep_div_epsii:wwnNNNNNn
- \int_use:N \__int_eval:w 1 9998 - #2
- \exp_after:wN \__fp_ep_div_eps_pack:NNNNNw
- \int_use:N \__int_eval:w 1 9999 9998 - #3#4
- \exp_after:wN \__fp_ep_div_eps_pack:NNNNNw
- \int_use:N \__int_eval:w 2 0000 0000 - #5#6 ; ;
- }
-\cs_new:Npn \__fp_ep_div_eps_pack:NNNNNw #1#2#3#4#5#6;
- { + #1 ; {#2#3#4#5} {#6} }
-\cs_new:Npn \__fp_ep_div_epsii:wwnNNNNNn 1#1; #2; #3#4#5#6#7#8
- {
- \__fp_fixed_mul:wwn {0000}{#1}#2; {0000}{#1}#2;
- \__fp_fixed_add_one:wN
- \__fp_fixed_mul:wwn {10000} {#1} #2 ;
- {
- \__fp_fixed_mul_short:wwn {0000}{#1}#2; {#3}{#4#5#6#7}{#8000};
- \__fp_fixed_div_myriad:wn
- \__fp_fixed_mul:wwn
- }
- \__fp_fixed_add:wwn {#3}{#4#5#6#7}{#8000}{0000}{0000}{0000};
- }
-\cs_new:Npn \__fp_ep_isqrt:wwn #1,#2;
- {
- \__fp_ep_to_ep:wwN #1,#2;
- \__fp_ep_isqrt_auxi:wwn
- }
-\cs_new:Npn \__fp_ep_isqrt_auxi:wwn #1,
- {
- \exp_after:wN \__fp_ep_isqrt_auxii:wwnnnwn
- \int_use:N \__int_eval:w
- \int_if_odd:nTF {#1}
- { (\c_one - #1) / \c_two , 535 , { 0 } { } }
- { \c_one - #1 / \c_two , 168 , { } { 0 } }
- }
-\cs_new:Npn \__fp_ep_isqrt_auxii:wwnnnwn #1, #2, #3#4 #5#6; #7
- {
- \__fp_ep_isqrt_esti:wwwnnwn #2, 0, #5, {#3} {#4}
- {#5} #6 ; { #7 #1 , }
- }
-\cs_new:Npn \__fp_ep_isqrt_esti:wwwnnwn #1, #2, #3, #4
- {
- \if_int_compare:w #1 = #2 \exp_stop_f:
- \exp_after:wN \__fp_ep_isqrt_estii:wwwnnwn
- \fi:
- \exp_after:wN \__fp_ep_isqrt_esti:wwwnnwn
- \int_use:N \__int_eval:w
- (#1 + 1 0050 0000 #4 / (#1 * #3)) / \c_two ,
- #1, #3, {#4}
- }
-\cs_new:Npn \__fp_ep_isqrt_estii:wwwnnwn #1, #2, #3, #4#5
- {
- \exp_after:wN \__fp_ep_isqrt_estiii:NNNNNwwwn
- \int_use:N \__int_eval:w 1000 0000 + #2 * #2 #5 * \c_five
- \exp_after:wN , \int_use:N \__int_eval:w 10000 + #2 ;
- }
-\cs_new:Npn \__fp_ep_isqrt_estiii:NNNNNwwwn 1#1#2#3#4#5#6, 1#7#8; #9;
- {
- \__fp_fixed_mul_short:wwn #9; {#1} {#2#3#4#5} {#600} ;
- \__fp_ep_isqrt_epsi:wN
- \__fp_fixed_mul_short:wwn {#7} {#80} {0000} ;
- }
-\cs_new:Npn \__fp_ep_isqrt_epsi:wN #1;
- {
- \__fp_fixed_sub:wwn {15000}{0000}{0000}{0000}{0000}{0000}; #1;
- \__fp_ep_isqrt_epsii:wwN #1;
- \__fp_ep_isqrt_epsii:wwN #1;
- \__fp_ep_isqrt_epsii:wwN #1;
- }
-\cs_new:Npn \__fp_ep_isqrt_epsii:wwN #1; #2;
- {
- \__fp_fixed_mul:wwn #1; #1;
- \__fp_fixed_mul_sub_back:wwwn #2;
- {15000}{0000}{0000}{0000}{0000}{0000};
- \__fp_fixed_mul:wwn #1;
- }
-\cs_new:Npn \__fp_ep_to_float:wwN #1,
- { + \__int_eval:w #1 \__fp_fixed_to_float:wN }
-\cs_new:Npn \__fp_ep_inv_to_float:wwN #1,#2;
- {
- \__fp_ep_div:wwwwn 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1,#2;
- \__fp_ep_to_float:wwN
- }
-\cs_new:Npn \__fp_fixed_inv_to_float:wN
- { \__fp_ep_inv_to_float:wwN 0, }
-\cs_new:Npn \__fp_fixed_to_float_rad:wN #1;
- {
- \__fp_fixed_mul:wwn #1; {5729}{5779}{5130}{8232}{0876}{7981};
- { \__fp_ep_to_float:wwN 2, }
- }
-\cs_new:Npn \__fp_fixed_to_float:Nw #1#2; { \__fp_fixed_to_float:wN #2; #1 }
-\cs_new:Npn \__fp_fixed_to_float:wN #1#2#3#4#5#6; #7
- {
- + \__int_eval:w \c_four % for the 8-digit-at-the-start thing.
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_fixed_to_loop:N
- \exp_after:wN \use_none:n
- \int_use:N \__int_eval:w
- 1 0000 0000 + #1 \exp_after:wN \__fp_use_none_stop_f:n
- \__int_value:w 1#2 \exp_after:wN \__fp_use_none_stop_f:n
- \__int_value:w 1#3#4 \exp_after:wN \__fp_use_none_stop_f:n
- \__int_value:w 1#5#6
- \exp_after:wN ;
- \exp_after:wN ;
- }
-\cs_new:Npn \__fp_fixed_to_loop:N #1
- {
- \if_meaning:w 0 #1
- - \c_one
- \exp_after:wN \__fp_fixed_to_loop:N
- \else:
- \exp_after:wN \__fp_fixed_to_loop_end:w
- \exp_after:wN #1
- \fi:
- }
-\cs_new:Npn \__fp_fixed_to_loop_end:w #1 #2 ;
- {
- \if_meaning:w ; #1
- \exp_after:wN \__fp_fixed_to_float_zero:w
- \else:
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_fixed_to_float_pack:ww
- \exp_after:wN ;
- \fi:
- #1 #2 0000 0000 0000 0000 ;
- }
-\cs_new:Npn \__fp_fixed_to_float_zero:w ; 0000 0000 0000 0000 ;
- {
- - \c_two * \c__fp_max_exponent_int ;
- {0000} {0000} {0000} {0000} ;
- }
-\cs_new:Npn \__fp_fixed_to_float_pack:ww #1 ; #2#3 ; ;
- {
- \if_int_compare:w #2 > \c_four
- \exp_after:wN \__fp_fixed_to_float_round_up:wnnnnw
- \fi:
- ; #1 ;
- }
-\cs_new:Npn \__fp_fixed_to_float_round_up:wnnnnw ; #1#2#3#4 ;
- {
- \exp_after:wN \__fp_basics_pack_high:NNNNNw
- \int_use:N \__int_eval:w 1 #1#2
- \exp_after:wN \__fp_basics_pack_low:NNNNNw
- \int_use:N \__int_eval:w 1 #3#4 + \c_one ;
- }
-%% File: l3fp-expo.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\tl_const:Nn \c__fp_ln_i_fixed_tl { {0000}{0000}{0000}{0000}{0000}{0000} }
-\tl_const:Nn \c__fp_ln_ii_fixed_tl { {6931}{4718}{0559}{9453}{0941}{7232} }
-\tl_const:Nn \c__fp_ln_iii_fixed_tl {{10986}{1228}{8668}{1096}{9139}{5245} }
-\tl_const:Nn \c__fp_ln_iv_fixed_tl {{13862}{9436}{1119}{8906}{1883}{4464} }
-\tl_const:Nn \c__fp_ln_vi_fixed_tl {{17917}{5946}{9228}{0550}{0081}{2477} }
-\tl_const:Nn \c__fp_ln_vii_fixed_tl {{19459}{1014}{9055}{3133}{0510}{5353} }
-\tl_const:Nn \c__fp_ln_viii_fixed_tl{{20794}{4154}{1679}{8359}{2825}{1696} }
-\tl_const:Nn \c__fp_ln_ix_fixed_tl {{21972}{2457}{7336}{2193}{8279}{0490} }
-\tl_const:Nn \c__fp_ln_x_fixed_tl {{23025}{8509}{2994}{0456}{8401}{7991} }
-\cs_new:Npn \__fp_ln_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_meaning:w 2 #3
- \__fp_case_use:nw { \__fp_invalid_operation_o:nw { ln } }
- \fi:
- \if_case:w #2 \exp_stop_f:
- \__fp_case_use:nw
- { \__fp_division_by_zero_o:Nnw \c_minus_inf_fp { ln } }
- \or:
- \else:
- \__fp_case_return_same_o:w
- \fi:
- \__fp_ln_npos_o:w \s__fp \__fp_chk:w #2#3#4;
- }
-\cs_new:Npn \__fp_ln_npos_o:w \s__fp \__fp_chk:w 10#1#2#3;
- { %^^A todo: ln(1) should be "exact zero", not "underflow"
- \exp_after:wN \__fp_sanitize:Nw
- \__int_value:w % for the overall sign
- \if_int_compare:w #1 < \c_one
- 2
- \else:
- 0
- \fi:
- \exp_after:wN \exp_stop_f:
- \int_use:N \__int_eval:w % for the exponent
- \__fp_ln_significand:NNNNnnnN #2#3
- \__fp_ln_exponent:wn {#1}
- }
-\cs_new:Npn \__fp_ln_significand:NNNNnnnN #1#2#3#4
- {
- \exp_after:wN \__fp_ln_x_ii:wnnnn
- \__int_value:w
- \if_case:w #1 \exp_stop_f:
- \or:
- \if_int_compare:w #2 < \c_four
- \__int_eval:w \c_ten - #2
- \else:
- 6
- \fi:
- \or: 4
- \or: 3
- \or: 2
- \or: 2
- \or: 2
- \else: 1
- \fi:
- ; { #1 #2 #3 #4 }
- }
-\cs_new:Npn \__fp_ln_x_ii:wnnnn #1; #2#3#4#5
- {
- \exp_after:wN \__fp_ln_div_after:Nw
- \cs:w c__fp_ln_ \tex_romannumeral:D #1 _fixed_tl \exp_after:wN \cs_end:
- \__int_value:w
- \exp_after:wN \__fp_ln_x_iv:wnnnnnnnn
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_ln_x_iii_var:NNNNNw
- \int_use:N \__int_eval:w 9999 9999 + #1*#2#3 +
- \exp_after:wN \__fp_ln_x_iii:NNNNNw
- \int_use:N \__int_eval:w 1 0000 0000 + #1*#4#5 ;
- {20000} {0000} {0000} {0000}
- } %^^A todo: reoptimize (a generalization attempt failed).
-\cs_new:Npn \__fp_ln_x_iii:NNNNNw #1 #2#3#4#5 #6; { #1; {#2#3#4#5} {#6} }
-\cs_new:Npn \__fp_ln_x_iii_var:NNNNNw #1 #2#3#4#5 #6;
- {
- #1#2#3#4#5 + \c_one ;
- {#1#2#3#4#5} {#6}
- }
-\cs_new:Npn \__fp_ln_x_iv:wnnnnnnnn #1; #2#3#4#5 #6#7#8#9
- {
- \exp_after:wN \__fp_div_significand_pack:NNN
- \int_use:N \__int_eval:w
- \__fp_ln_div_i:w #1 ;
- #6 #7 ; {#8} {#9}
- {#2} {#3} {#4} {#5}
- { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_ln_div_ii:wwn \__int_value:w #1 }
- { \exp_after:wN \__fp_ln_div_vi:wwn \__int_value:w #1 }
- }
-\cs_new:Npn \__fp_ln_div_i:w #1;
- {
- \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
- \int_use:N \__int_eval:w 999999 + 2 0000 0000 / #1 ; % Q1
- }
-\cs_new:Npn \__fp_ln_div_ii:wwn #1; #2;#3 % y; B1;B2 <- for k=1
- {
- \exp_after:wN \__fp_div_significand_pack:NNN
- \int_use:N \__int_eval:w
- \exp_after:wN \__fp_div_significand_calc:wwnnnnnnn
- \int_use:N \__int_eval:w 999999 + #2 #3 / #1 ; % Q2
- #2 #3 ;
- }
-\cs_new:Npn \__fp_ln_div_vi:wwn #1; #2;#3#4#5 #6#7#8#9 %y;F1;F2F3F4x1x2x3x4
- {
- \exp_after:wN \__fp_div_significand_pack:NNN
- \int_use:N \__int_eval:w 1000000 + #2 #3 / #1 ; % Q6
- }
-\cs_new:Npn \__fp_ln_div_after:Nw #1#2;
- {
- \if_meaning:w 0 #2
- \exp_after:wN \__fp_ln_t_small:Nw
- \else:
- \exp_after:wN \__fp_ln_t_large:NNw
- \exp_after:wN -
- \fi:
- #1
- }
-\cs_new:Npn \__fp_ln_t_small:Nw #1 #2; #3; #4; #5; #6; #7;
- {
- \exp_after:wN \__fp_ln_t_large:NNw
- \exp_after:wN + % <sign>
- \exp_after:wN #1
- \int_use:N \__int_eval:w 9999 - #2 \exp_after:wN ;
- \int_use:N \__int_eval:w 9999 - #3 \exp_after:wN ;
- \int_use:N \__int_eval:w 9999 - #4 \exp_after:wN ;
- \int_use:N \__int_eval:w 9999 - #5 \exp_after:wN ;
- \int_use:N \__int_eval:w 9999 - #6 \exp_after:wN ;
- \int_use:N \__int_eval:w 1 0000 - #7 ;
- }
-\cs_new:Npn \__fp_ln_t_large:NNw #1 #2 #3; #4; #5; #6; #7; #8;
- {
- \exp_after:wN \__fp_ln_square_t_after:w
- \int_use:N \__int_eval:w 9999 0000 + #3*#3
- \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
- \int_use:N \__int_eval:w 9999 0000 + 2*#3*#4
- \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
- \int_use:N \__int_eval:w 9999 0000 + 2*#3*#5 + #4*#4
- \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
- \int_use:N \__int_eval:w 9999 0000 + 2*#3*#6 + 2*#4*#5
- \exp_after:wN \__fp_ln_square_t_pack:NNNNNw
- \int_use:N \__int_eval:w 1 0000 0000 + 2*#3*#7 + 2*#4*#6 + #5*#5
- + (2*#3*#8 + 2*#4*#7 + 2*#5*#6) / 1 0000
- % ; ; ;
- \exp_after:wN \__fp_ln_twice_t_after:w
- \int_use:N \__int_eval:w -1 + 2*#3
- \exp_after:wN \__fp_ln_twice_t_pack:Nw
- \int_use:N \__int_eval:w 9999 + 2*#4
- \exp_after:wN \__fp_ln_twice_t_pack:Nw
- \int_use:N \__int_eval:w 9999 + 2*#5
- \exp_after:wN \__fp_ln_twice_t_pack:Nw
- \int_use:N \__int_eval:w 9999 + 2*#6
- \exp_after:wN \__fp_ln_twice_t_pack:Nw
- \int_use:N \__int_eval:w 9999 + 2*#7
- \exp_after:wN \__fp_ln_twice_t_pack:Nw
- \int_use:N \__int_eval:w 10000 + 2*#8 ; ;
- { \__fp_ln_c:NwNw #1 }
- #2
- }
-\cs_new:Npn \__fp_ln_twice_t_pack:Nw #1 #2; { + #1 ; {#2} }
-\cs_new:Npn \__fp_ln_twice_t_after:w #1; { ;;; {#1} }
-\cs_new:Npn \__fp_ln_square_t_pack:NNNNNw #1 #2#3#4#5 #6;
- { + #1#2#3#4#5 ; {#6} }
-\cs_new:Npn \__fp_ln_square_t_after:w 1 0 #1#2#3 #4;
- { \__fp_ln_Taylor:wwNw {0#1#2#3} {#4} }
-\cs_new:Npn \__fp_ln_Taylor:wwNw
- { \__fp_ln_Taylor_loop:www 21 ; {0000}{0000}{0000}{0000}{0000}{0000} ; }
-\cs_new:Npn \__fp_ln_Taylor_loop:www #1; #2; #3;
- {
- \if_int_compare:w #1 = \c_one
- \__fp_ln_Taylor_break:w
- \fi:
- \exp_after:wN \__fp_fixed_div_int:wwN \c__fp_one_fixed_tl ; #1;
- \__fp_fixed_add:wwn #2;
- \__fp_fixed_mul:wwn #3;
- {
- \exp_after:wN \__fp_ln_Taylor_loop:www
- \int_use:N \__int_eval:w #1 - \c_two ;
- }
- #3;
- }
-\cs_new:Npn \__fp_ln_Taylor_break:w \fi: #1 \__fp_fixed_add:wwn #2#3; #4 ;;
- {
- \fi:
- \exp_after:wN \__fp_fixed_mul:wwn
- \exp_after:wN { \int_use:N \__int_eval:w 10000 + #2 } #3;
- }
-\cs_new:Npn \__fp_ln_c:NwNw #1 #2; #3
- {
- \if_meaning:w + #1
- \exp_after:wN \exp_after:wN \exp_after:wN \__fp_fixed_sub:wwn
- \else:
- \exp_after:wN \exp_after:wN \exp_after:wN \__fp_fixed_add:wwn
- \fi:
- #3 ; #2 ;
- }
-\cs_new:Npn \__fp_ln_exponent:wn #1; #2
- {
- \if_case:w #2 \exp_stop_f:
- \c_zero \__fp_case_return:nw { \__fp_fixed_to_float:Nw 2 }
- \or:
- \exp_after:wN \__fp_ln_exponent_one:ww \__int_value:w
- \else:
- \if_int_compare:w #2 > \c_zero
- \exp_after:wN \__fp_ln_exponent_small:NNww
- \exp_after:wN 0
- \exp_after:wN \__fp_fixed_sub:wwn \__int_value:w
- \else:
- \exp_after:wN \__fp_ln_exponent_small:NNww
- \exp_after:wN 2
- \exp_after:wN \__fp_fixed_add:wwn \__int_value:w -
- \fi:
- \fi:
- #2; #1;
- }
-\cs_new:Npn \__fp_ln_exponent_one:ww 1; #1;
- {
- \c_zero
- \exp_after:wN \__fp_fixed_sub:wwn \c__fp_ln_x_fixed_tl ; #1;
- \__fp_fixed_to_float:wN 0
- }
-\cs_new:Npn \__fp_ln_exponent_small:NNww #1#2#3; #4#5#6#7#8#9;
- {
- \c_four
- \exp_after:wN \__fp_fixed_mul:wwn
- \c__fp_ln_x_fixed_tl ;
- {#3}{0000}{0000}{0000}{0000}{0000} ;
- #2
- {0000}{#4}{#5}{#6}{#7}{#8};
- \__fp_fixed_to_float:wN #1
- }
-\cs_new:Npn \__fp_exp_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_o:Nw \c_one_fp
- \or:
- \exp_after:wN \__fp_exp_normal:w
- \or:
- \if_meaning:w 0 #3
- \exp_after:wN \__fp_case_return_o:Nw
- \exp_after:wN \c_inf_fp
- \else:
- \exp_after:wN \__fp_case_return_o:Nw
- \exp_after:wN \c_zero_fp
- \fi:
- \or:
- \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2#3#4;
- }
-\cs_new:Npn \__fp_exp_normal:w \s__fp \__fp_chk:w 1#1
- {
- \if_meaning:w 0 #1
- \__fp_exp_pos:NNwnw + \__fp_fixed_to_float:wN
- \else:
- \__fp_exp_pos:NNwnw - \__fp_fixed_inv_to_float:wN
- \fi:
- }
-\cs_new:Npn \__fp_exp_pos:NNwnw #1#2#3 \fi: #4#5;
- {
- \fi:
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN 0
- \__int_value:w #1 \__int_eval:w
- \if_int_compare:w #4 < - \c_eight
- \c_one
- \exp_after:wN \__fp_add_big_i_o:wNww
- \int_use:N \__int_eval:w \c_one - #4 ;
- 0 {1000}{0000}{0000}{0000} ; #5;
- \tex_romannumeral:D
- \else:
- \if_int_compare:w #4 > \c_five % cf \c__fp_max_exponent_int
- \exp_after:wN \__fp_exp_overflow:
- \tex_romannumeral:D
- \else:
- \if_int_compare:w #4 < \c_zero
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- {
- \c_zero
- \__fp_decimate:nNnnnn { - #4 }
- \__fp_exp_Taylor:Nnnwn
- }
- {
- \__fp_decimate:nNnnnn { \c_sixteen - #4 }
- \__fp_exp_pos_large:NnnNwn
- }
- #5
- {#4}
- #1 #2 0
- \tex_romannumeral:D
- \fi:
- \fi:
- \exp_after:wN \c_zero
- }
-\cs_new:Npn \__fp_exp_overflow:
- { + \c_two * \c__fp_max_exponent_int ; {1000} {0000} {0000} {0000} ; }
-\cs_new:Npn \__fp_exp_Taylor:Nnnwn #1#2#3 #4; #5 #6
- {
- #6
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_pack_twice_four:wNNNNNNNN
- \__fp_exp_Taylor_ii:ww
- ; #2#3#4 0000 0000 ;
- }
-\cs_new:Npn \__fp_exp_Taylor_ii:ww #1; #2;
- { \__fp_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s__stop }
-\cs_new:Npn \__fp_exp_Taylor_loop:www #1; #2; #3;
- {
- \if_int_compare:w #1 = \c_one
- \exp_after:wN \__fp_exp_Taylor_break:Nww
- \fi:
- \__fp_fixed_div_int:wwN #3 ; #1 ;
- \__fp_fixed_add_one:wN
- \__fp_fixed_mul:wwn #2 ;
- {
- \exp_after:wN \__fp_exp_Taylor_loop:www
- \int_use:N \__int_eval:w #1 - 1 ;
- #2 ;
- }
- }
-\cs_new:Npn \__fp_exp_Taylor_break:Nww #1 #2; #3 \s__stop
- { \__fp_fixed_add_one:wN #2 ; }
-\cs_new:Npn \__fp_exp_pos_large:NnnNwn #1#2#3 #4#5; #6
- {
- \exp_after:wN \exp_after:wN
- \cs:w __fp_exp_large_\tex_romannumeral:D #6:wN \exp_after:wN \cs_end:
- \exp_after:wN \c__fp_one_fixed_tl
- \exp_after:wN ;
- \__int_value:w #3 #4 \exp_stop_f:
- #5 00000 ;
- }
-\cs_new:Npn \__fp_exp_large:w #1 \or: #2 \fi:
- { \fi: \__fp_fixed_mul:wwn #1; }
-\cs_new:Npn \__fp_exp_large_v:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 4343 \__fp_exp_large:w {8806}{8182}{2566}{2921}{5872}{6150} \or:
- + 8686 \__fp_exp_large:w {7756}{0047}{2598}{6861}{0458}{3204} \or:
- + 13029 \__fp_exp_large:w {6830}{5723}{7791}{4884}{1932}{7351} \or:
- + 17372 \__fp_exp_large:w {6015}{5609}{3095}{3052}{3494}{7574} \or:
- + 21715 \__fp_exp_large:w {5297}{7951}{6443}{0315}{3251}{3576} \or:
- + 26058 \__fp_exp_large:w {4665}{6719}{0099}{3379}{5527}{2929} \or:
- + 30401 \__fp_exp_large:w {4108}{9724}{3326}{3186}{5271}{5665} \or:
- + 34744 \__fp_exp_large:w {3618}{6973}{3140}{0875}{3856}{4102} \or:
- + 39087 \__fp_exp_large:w {3186}{9209}{6113}{3900}{6705}{9685} \or:
- \fi:
- #1;
- \__fp_exp_large_iv:wN
- }
-\cs_new:Npn \__fp_exp_large_iv:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 435 \__fp_exp_large:w {1970}{0711}{1401}{7046}{9938}{8888} \or:
- + 869 \__fp_exp_large:w {3881}{1801}{9428}{4368}{5764}{8232} \or:
- + 1303 \__fp_exp_large:w {7646}{2009}{8905}{4704}{8893}{1073} \or:
- + 1738 \__fp_exp_large:w {1506}{3559}{7005}{0524}{9009}{7592} \or:
- + 2172 \__fp_exp_large:w {2967}{6283}{8402}{3667}{0689}{6630} \or:
- + 2606 \__fp_exp_large:w {5846}{4389}{5650}{2114}{7278}{5046} \or:
- + 3041 \__fp_exp_large:w {1151}{7900}{5080}{6878}{2914}{4154} \or:
- + 3475 \__fp_exp_large:w {2269}{1083}{0850}{6857}{8724}{4002} \or:
- + 3909 \__fp_exp_large:w {4470}{3047}{3316}{5442}{6408}{6591} \or:
- \fi:
- #1;
- \__fp_exp_large_iii:wN
- }
-\cs_new:Npn \__fp_exp_large_iii:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 44 \__fp_exp_large:w {2688}{1171}{4181}{6135}{4484}{1263} \or:
- + 87 \__fp_exp_large:w {7225}{9737}{6812}{5749}{2581}{7748} \or:
- + 131 \__fp_exp_large:w {1942}{4263}{9524}{1255}{9365}{8421} \or:
- + 174 \__fp_exp_large:w {5221}{4696}{8976}{4143}{9505}{8876} \or:
- + 218 \__fp_exp_large:w {1403}{5922}{1785}{2837}{4107}{3977} \or:
- + 261 \__fp_exp_large:w {3773}{0203}{0092}{9939}{8234}{0143} \or:
- + 305 \__fp_exp_large:w {1014}{2320}{5473}{5004}{5094}{5533} \or:
- + 348 \__fp_exp_large:w {2726}{3745}{7211}{2566}{5673}{6478} \or:
- + 391 \__fp_exp_large:w {7328}{8142}{2230}{7421}{7051}{8866} \or:
- \fi:
- #1;
- \__fp_exp_large_ii:wN
- }
-\cs_new:Npn \__fp_exp_large_ii:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 5 \__fp_exp_large:w {2202}{6465}{7948}{0671}{6516}{9579} \or:
- + 9 \__fp_exp_large:w {4851}{6519}{5409}{7902}{7796}{9107} \or:
- + 14 \__fp_exp_large:w {1068}{6474}{5815}{2446}{2146}{9905} \or:
- + 18 \__fp_exp_large:w {2353}{8526}{6837}{0199}{8540}{7900} \or:
- + 22 \__fp_exp_large:w {5184}{7055}{2858}{7072}{4640}{8745} \or:
- + 27 \__fp_exp_large:w {1142}{0073}{8981}{5684}{2836}{6296} \or:
- + 31 \__fp_exp_large:w {2515}{4386}{7091}{9167}{0062}{6578} \or:
- + 35 \__fp_exp_large:w {5540}{6223}{8439}{3510}{0525}{7117} \or:
- + 40 \__fp_exp_large:w {1220}{4032}{9431}{7840}{8020}{0271} \or:
- \fi:
- #1;
- \__fp_exp_large_i:wN
- }
-\cs_new:Npn \__fp_exp_large_i:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 1 \__fp_exp_large:w {2718}{2818}{2845}{9045}{2353}{6029} \or:
- + 1 \__fp_exp_large:w {7389}{0560}{9893}{0650}{2272}{3043} \or:
- + 2 \__fp_exp_large:w {2008}{5536}{9231}{8766}{7740}{9285} \or:
- + 2 \__fp_exp_large:w {5459}{8150}{0331}{4423}{9078}{1103} \or:
- + 3 \__fp_exp_large:w {1484}{1315}{9102}{5766}{0342}{1116} \or:
- + 3 \__fp_exp_large:w {4034}{2879}{3492}{7351}{2260}{8387} \or:
- + 4 \__fp_exp_large:w {1096}{6331}{5842}{8458}{5992}{6372} \or:
- + 4 \__fp_exp_large:w {2980}{9579}{8704}{1728}{2747}{4359} \or:
- + 4 \__fp_exp_large:w {8103}{0839}{2757}{5384}{0077}{1000} \or:
- \fi:
- #1;
- \__fp_exp_large_:wN
- }
-\cs_new:Npn \__fp_exp_large_:wN #1; #2
- {
- \if_case:w #2 ~ \exp_after:wN \__fp_fixed_continue:wn \or:
- + 1 \__fp_exp_large:w {1105}{1709}{1807}{5647}{6248}{1171} \or:
- + 1 \__fp_exp_large:w {1221}{4027}{5816}{0169}{8339}{2107} \or:
- + 1 \__fp_exp_large:w {1349}{8588}{0757}{6003}{1039}{8374} \or:
- + 1 \__fp_exp_large:w {1491}{8246}{9764}{1270}{3178}{2485} \or:
- + 1 \__fp_exp_large:w {1648}{7212}{7070}{0128}{1468}{4865} \or:
- + 1 \__fp_exp_large:w {1822}{1188}{0039}{0508}{9748}{7537} \or:
- + 1 \__fp_exp_large:w {2013}{7527}{0747}{0476}{5216}{2455} \or:
- + 1 \__fp_exp_large:w {2225}{5409}{2849}{2467}{6045}{7954} \or:
- + 1 \__fp_exp_large:w {2459}{6031}{1115}{6949}{6638}{0013} \or:
- \fi:
- #1;
- \__fp_exp_large_after:wwn
- }
-\cs_new:Npn \__fp_exp_large_after:wwn #1; #2; #3
- {
- \__fp_exp_Taylor:Nnnwn ? { } { } 0 #2; {} #3
- \__fp_fixed_mul:wwn #1;
- }
-\cs_new:cpn { __fp_ \iow_char:N \^ _o:ww }
- \s__fp \__fp_chk:w #1#2#3; \s__fp \__fp_chk:w #4#5#6;
- {
- \if_meaning:w 0 #4
- \__fp_case_return_o:Nw \c_one_fp
- \fi:
- \if_case:w #2 \exp_stop_f:
- \exp_after:wN \use_i:nn
- \or:
- \__fp_case_return_o:Nw \c_nan_fp
- \else:
- \exp_after:wN \__fp_pow_neg:www
- \tex_romannumeral:D -`0 \exp_after:wN \use:nn
- \fi:
- {
- \if_meaning:w 1 #1
- \exp_after:wN \__fp_pow_normal:ww
- \else:
- \exp_after:wN \__fp_pow_zero_or_inf:ww
- \fi:
- \s__fp \__fp_chk:w #1#2#3;
- }
- { \s__fp \__fp_chk:w #4#5#6; \s__fp \__fp_chk:w #1#2#3; }
- \s__fp \__fp_chk:w #4#5#6;
- }
-\cs_new:Npn \__fp_pow_zero_or_inf:ww \s__fp \__fp_chk:w #1#2; \s__fp \__fp_chk:w #3#4
- {
- \if_meaning:w 1 #4
- \__fp_case_return_same_o:w
- \fi:
- \if_meaning:w #1 #4
- \__fp_case_return_o:Nw \c_zero_fp
- \fi:
- \if_meaning:w 0 #1
- \__fp_case_use:nw
- {
- \__fp_division_by_zero_o:NNww \c_inf_fp ^
- \s__fp \__fp_chk:w #1 #2 ;
- }
- \else:
- \__fp_case_return_o:Nw \c_inf_fp
- \fi:
- \s__fp \__fp_chk:w #3#4
- }
-\cs_new:Npn \__fp_pow_normal:ww \s__fp \__fp_chk:w 1 #1#2#3; \s__fp \__fp_chk:w #4#5
- {
- \if_int_compare:w \pdftex_strcmp:D { #2 #3 }
- { 1 {1000} {0000} {0000} {0000} } = \c_zero
- \if_int_compare:w #4 #1 = 32 \exp_stop_f:
- \exp_after:wN \__fp_case_return_ii_o:ww
- \fi:
- \__fp_case_return_o:Nww \c_one_fp
- \fi:
- \if_case:w #4 \exp_stop_f:
- \or:
- \exp_after:wN \__fp_pow_npos:Nww
- \exp_after:wN #5
- \or:
- \if_meaning:w 2 #5 \exp_after:wN \reverse_if:N \fi:
- \if_int_compare:w #2 > \c_zero
- \exp_after:wN \__fp_case_return_o:Nww
- \exp_after:wN \c_inf_fp
- \else:
- \exp_after:wN \__fp_case_return_o:Nww
- \exp_after:wN \c_zero_fp
- \fi:
- \or:
- \__fp_case_return_ii_o:ww
- \fi:
- \s__fp \__fp_chk:w 1 #1 {#2} #3 ;
- \s__fp \__fp_chk:w #4 #5
- }
-\cs_new:Npn \__fp_pow_npos:Nww #1 \s__fp \__fp_chk:w 1#2#3
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN 0
- \__int_value:w
- \if:w #1 \if_int_compare:w #3 > \c_zero 0 \else: 2 \fi:
- \exp_after:wN \__fp_pow_npos_aux:NNnww
- \exp_after:wN +
- \exp_after:wN \__fp_fixed_to_float:wN
- \else:
- \exp_after:wN \__fp_pow_npos_aux:NNnww
- \exp_after:wN -
- \exp_after:wN \__fp_fixed_inv_to_float:wN
- \fi:
- {#3}
- }
-\cs_new:Npn \__fp_pow_npos_aux:NNnww #1#2#3#4#5; \s__fp \__fp_chk:w 1#6#7#8;
- {
- #1
- \__int_eval:w
- \__fp_ln_significand:NNNNnnnN #4#5
- \__fp_pow_exponent:wnN {#3}
- \__fp_fixed_mul:wwn #8 {0000}{0000} ;
- \__fp_pow_B:wwN #7;
- #1 #2 0 % fixed_to_float:wN
- }
-\cs_new:Npn \__fp_pow_exponent:wnN #1; #2
- {
- \if_int_compare:w #2 > \c_zero
- \exp_after:wN \__fp_pow_exponent:Nwnnnnnw % n\ln(10) - (-\ln(x))
- \exp_after:wN +
- \else:
- \exp_after:wN \__fp_pow_exponent:Nwnnnnnw % -( |n|\ln(10) + (-\ln(x)) )
- \exp_after:wN -
- \fi:
- #2; #1;
- }
-\cs_new:Npn \__fp_pow_exponent:Nwnnnnnw #1#2; #3#4#5#6#7#8;
- { %^^A todo: use that in ln.
- \exp_after:wN \__fp_fixed_mul_after:wwn
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- #1#2*23025 - #1 #3
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- #1 #2*8509 - #1 #4
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- #1 #2*2994 - #1 #5
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- #1 #2*0456 - #1 #6
- \exp_after:wN \__fp_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_trailing_shift_int
- #1 #2*8401 - #1 #7
- #1 ( #2*7991 - #8 ) / 1 0000 ; ;
- }
-\cs_new:Npn \__fp_pow_B:wwN #1#2#3#4#5#6; #7;
- {
- \if_int_compare:w #7 < \c_zero
- \exp_after:wN \__fp_pow_C_neg:w \__int_value:w -
- \else:
- \if_int_compare:w #7 < 22 \exp_stop_f:
- \exp_after:wN \__fp_pow_C_pos:w \__int_value:w
- \else:
- \exp_after:wN \__fp_pow_C_overflow:w \__int_value:w
- \fi:
- \fi:
- #7 \exp_after:wN ;
- \int_use:N \__int_eval:w 10 0000 + #1 \__int_eval_end:
- #2#3#4#5#6 0000 0000 0000 0000 0000 0000 ; %^^A todo: how many 0?
- }
-\cs_new:Npn \__fp_pow_C_overflow:w #1; #2; #3
- {
- + \c_two * \c__fp_max_exponent_int
- \exp_after:wN \__fp_fixed_continue:wn \c__fp_one_fixed_tl ;
- }
-\cs_new:Npn \__fp_pow_C_neg:w #1 ; 1
- {
- \exp_after:wN \exp_after:wN \exp_after:wN \__fp_pow_C_pack:w
- \prg_replicate:nn {#1} {0}
- }
-\cs_new:Npn \__fp_pow_C_pos:w #1; 1
- { \__fp_pow_C_pos_loop:wN #1; }
-\cs_new:Npn \__fp_pow_C_pos_loop:wN #1; #2
- {
- \if_meaning:w 0 #1
- \exp_after:wN \__fp_pow_C_pack:w
- \exp_after:wN #2
- \else:
- \if_meaning:w 0 #2
- \exp_after:wN \__fp_pow_C_pos_loop:wN \__int_value:w
- \else:
- \exp_after:wN \__fp_pow_C_overflow:w \__int_value:w
- \fi:
- \__int_eval:w #1 - \c_one \exp_after:wN ;
- \fi:
- }
-\cs_new:Npn \__fp_pow_C_pack:w
- { \exp_after:wN \__fp_exp_large_v:wN \c__fp_one_fixed_tl ; }
-\cs_new:Npn \__fp_pow_neg:www \s__fp \__fp_chk:w #1#2; #3; #4;
- {
- \if_case:w \__fp_pow_neg_case:w #4 ;
- \exp_after:wN \__fp_pow_neg_aux:wNN
- \or:
- \if_int_compare:w \__int_eval:w #1 / \c_two = \c_one
- \__fp_invalid_operation_o:Nww ^ #3; #4;
- \tex_romannumeral:D -`0
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_use_none_until_s:w
- \fi:
- \fi:
- \__fp_exp_after_o:w
- \s__fp \__fp_chk:w #1#2;
- }
-\cs_new:Npn \__fp_pow_neg_aux:wNN #1 \s__fp \__fp_chk:w #2#3
- {
- \exp_after:wN \__fp_exp_after_o:w
- \exp_after:wN \s__fp
- \exp_after:wN \__fp_chk:w
- \exp_after:wN #2
- \int_use:N \__int_eval:w \c_two - #3 \__int_eval_end:
- }
-\cs_new:Npn \__fp_pow_neg_case:w \s__fp \__fp_chk:w #1#2#3;
- {
- \if_case:w #1 \exp_stop_f:
- \c_minus_one
- \or: \__fp_pow_neg_case_aux:nnnnn #3
- \else: \c_one
- \fi:
- }
-\cs_new:Npn \__fp_pow_neg_case_aux:nnnnn #1#2#3#4#5
- {
- \if_int_compare:w #1 > \c_eight
- \if_int_compare:w #1 > \c_sixteen
- \c_minus_one
- \else:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_pow_neg_case_aux:NNNNNNNNw
- \prg_replicate:nn { \c_sixteen - #1 } { 0 } #4#5 ;
- \fi:
- \else:
- \if_int_compare:w #1 > \c_zero
- \if_int_compare:w #4#5 = \c_zero
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_pow_neg_case_aux:NNNNNNNNw
- \prg_replicate:nn { \c_eight - #1 } { 0 } #2#3 ;
- \else:
- \c_one
- \fi:
- \else:
- \c_one
- \fi:
- \fi:
- }
-\cs_new:Npn \__fp_pow_neg_case_aux:NNNNNNNNw #1#2#3#4#5#6#7#8#9;
- {
- \if_int_compare:w 0 #9 = \c_zero
- \if_int_odd:w #8 \exp_stop_f:
- \c_zero
- \else:
- \c_minus_one
- \fi:
- \else:
- \c_one
- \fi:
- }
-%% File: l3fp-trig.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_sin_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_same_o:w
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
- \__fp_ep_to_float:wwN #3 \c_zero
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { sin } { sind } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_cos_o:w #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_o:Nw \c_one_fp
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
- \__fp_ep_to_float:wwN 0 \c_two
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { cos } { cosd } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3;
- }
-\cs_new:Npn \__fp_csc_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_cot_zero_o:Nfw #3 { #1 { csc } { cscd } }
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
- \__fp_ep_inv_to_float:wwN #3 \c_zero
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { csc } { cscd } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_sec_o:w #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_o:Nw \c_one_fp
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1 \__fp_sin_series_o:NNwwww
- \__fp_ep_inv_to_float:wwN 0 \c_two
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { sec } { secd } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3;
- }
-\cs_new:Npn \__fp_tan_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_same_o:w
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1
- \__fp_tan_series_o:NNwwww 0 #3 \c_one
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { tan } { tand } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_cot_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_cot_zero_o:Nfw #3 { #1 { cot } { cotd } }
- \or: \__fp_case_use:nw
- {
- \__fp_trig:NNNNNwn #1
- \__fp_tan_series_o:NNwwww 2 #3 \c_three
- }
- \or: \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { cot } { cotd } } }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_cot_zero_o:Nfw #1#2#3 \fi:
- {
- \fi:
- \token_if_eq_meaning:NNTF 0 #1
- { \exp_args:NNf \__fp_division_by_zero_o:Nnw \c_inf_fp }
- { \exp_args:NNf \__fp_division_by_zero_o:Nnw \c_minus_inf_fp }
- {#2}
- }
-\cs_new:Npn \__fp_trig:NNNNNwn #1#2#3#4#5 \s__fp \__fp_chk:w 1#6#7#8;
- {
- \exp_after:wN #2
- \exp_after:wN #3
- \exp_after:wN #4
- \int_use:N \__int_eval:w #5
- \exp_after:wN \exp_after:wN \exp_after:wN \exp_after:wN
- \if_int_compare:w #7 > #1 \c_zero \c_one
- #1 \__fp_trig_large:ww \__fp_trigd_large:ww
- \else:
- #1 \__fp_trig_small:ww \__fp_trigd_small:ww
- \fi:
- #7,#8{0000}{0000};
- }
-\cs_new:Npn \__fp_trig_small:ww #1,#2;
- { \__fp_ep_to_fixed:wwn #1,#2; . #1,#2; }
-\cs_new:Npn \__fp_trigd_small:ww #1,#2;
- {
- \__fp_ep_mul_raw:wwwwN
- -1,{1745}{3292}{5199}{4329}{5769}{2369}; #1,#2;
- \__fp_trig_small:ww
- }
-\cs_new:Npn \__fp_trigd_large:ww #1, #2#3#4#5#6#7;
- {
- \exp_after:wN \__fp_pack_eight:wNNNNNNNN
- \exp_after:wN \__fp_pack_eight:wNNNNNNNN
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_pack_twice_four:wNNNNNNNN
- \exp_after:wN \__fp_trigd_large_auxi:nnnnwNNNN
- \exp_after:wN ;
- \tex_romannumeral:D -`0
- \prg_replicate:nn { \int_max:nn { 22 - #1 } { 0 } } { 0 }
- #2#3#4#5#6#7 0000 0000 0000 !
- }
-\cs_new:Npn \__fp_trigd_large_auxi:nnnnwNNNN #1#2#3#4#5; #6#7#8#9
- {
- \exp_after:wN \__fp_trigd_large_auxii:wNw
- \int_use:N \__int_eval:w #1 + #2
- - (#1 + #2 - \c_four) / \c_nine * \c_nine \__int_eval_end:
- #3;
- #4; #5{#6#7#8#9};
- }
-\cs_new:Npn \__fp_trigd_large_auxii:wNw #1; #2#3;
- {
- + (#1#2 - \c_four) / \c_nine * \c_two
- \exp_after:wN \__fp_trigd_large_auxiii:www
- \int_use:N \__int_eval:w #1#2
- - (#1#2 - \c_four) / \c_nine * \c_nine \__int_eval_end: #3 ;
- }
-\cs_new:Npn \__fp_trigd_large_auxiii:www #1; #2; #3!
- {
- \if_int_compare:w #1 < 4500 \exp_stop_f:
- \exp_after:wN \__fp_use_i_until_s:nw
- \exp_after:wN \__fp_fixed_continue:wn
- \else:
- + \c_one
- \fi:
- \__fp_fixed_sub:wwn {9000}{0000}{0000}{0000}{0000}{0000};
- {#1}#2{0000}{0000};
- { \__fp_trigd_small:ww 2, }
- }
-\cs_new_nopar:Npx \__fp_trig_inverse_two_pi:
- {
- \exp_not:n { \exp_after:wN \use_none:n \token_to_str:N }
- \cs:w , , !
- 0000000000000000159154943091895335768883763372514362034459645740 ~
- 4564487476673440588967976342265350901138027662530859560728427267 ~
- 5795803689291184611457865287796741073169983922923996693740907757 ~
- 3077746396925307688717392896217397661693362390241723629011832380 ~
- 1142226997557159404618900869026739561204894109369378440855287230 ~
- 9994644340024867234773945961089832309678307490616698646280469944 ~
- 8652187881574786566964241038995874139348609983868099199962442875 ~
- 5851711788584311175187671605465475369880097394603647593337680593 ~
- 0249449663530532715677550322032477781639716602294674811959816584 ~
- 0606016803035998133911987498832786654435279755070016240677564388 ~
- 8495713108801221993761476813777647378906330680464579784817613124 ~
- 2731406996077502450029775985708905690279678513152521001631774602 ~
- 0924811606240561456203146484089248459191435211575407556200871526 ~
- 6068022171591407574745827225977462853998751553293908139817724093 ~
- 5825479707332871904069997590765770784934703935898280871734256403 ~
- 6689511662545705943327631268650026122717971153211259950438667945 ~
- 0376255608363171169525975812822494162333431451061235368785631136 ~
- 3669216714206974696012925057833605311960859450983955671870995474 ~
- 6510431623815517580839442979970999505254387566129445883306846050 ~
- 7852915151410404892988506388160776196993073410389995786918905980 ~
- 9373777206187543222718930136625526123878038753888110681406765434 ~
- 0828278526933426799556070790386060352738996245125995749276297023 ~
- 5940955843011648296411855777124057544494570217897697924094903272 ~
- 9477021664960356531815354400384068987471769158876319096650696440 ~
- 4776970687683656778104779795450353395758301881838687937766124814 ~
- 9530599655802190835987510351271290432315804987196868777594656634 ~
- 6221034204440855497850379273869429353661937782928735937843470323 ~
- 0237145837923557118636341929460183182291964165008783079331353497 ~
- 7909974586492902674506098936890945883050337030538054731232158094 ~
- 3197676032283131418980974982243833517435698984750103950068388003 ~
- 9786723599608024002739010874954854787923568261139948903268997427 ~
- 0834961149208289037767847430355045684560836714793084567233270354 ~
- 8539255620208683932409956221175331839402097079357077496549880868 ~
- 6066360968661967037474542102831219251846224834991161149566556037 ~
- 9696761399312829960776082779901007830360023382729879085402387615 ~
- 5744543092601191005433799838904654921248295160707285300522721023 ~
- 6017523313173179759311050328155109373913639645305792607180083617 ~
- 9548767246459804739772924481092009371257869183328958862839904358 ~
- 6866663975673445140950363732719174311388066383072592302759734506 ~
- 0548212778037065337783032170987734966568490800326988506741791464 ~
- 6835082816168533143361607309951498531198197337584442098416559541 ~
- 5225064339431286444038388356150879771645017064706751877456059160 ~
- 8716857857939226234756331711132998655941596890719850688744230057 ~
- 5191977056900382183925622033874235362568083541565172971088117217 ~
- 9593683256488518749974870855311659830610139214454460161488452770 ~
- 2511411070248521739745103866736403872860099674893173561812071174 ~
- 0478899368886556923078485023057057144063638632023685201074100574 ~
- 8592281115721968003978247595300166958522123034641877365043546764 ~
- 6456565971901123084767099309708591283646669191776938791433315566 ~
- 5066981321641521008957117286238426070678451760111345080069947684 ~
- 2235698962488051577598095339708085475059753626564903439445420581 ~
- 7886435683042000315095594743439252544850674914290864751442303321 ~
- 3324569511634945677539394240360905438335528292434220349484366151 ~
- 4663228602477666660495314065734357553014090827988091478669343492 ~
- 2737602634997829957018161964321233140475762897484082891174097478 ~
- 2637899181699939487497715198981872666294601830539583275209236350 ~
- 6853889228468247259972528300766856937583659722919824429747406163 ~
- 8183113958306744348516928597383237392662402434501997809940402189 ~
- 6134834273613676449913827154166063424829363741850612261086132119 ~
- 9863346284709941839942742955915628333990480382117501161211667205 ~
- 1912579303552929241134403116134112495318385926958490443846807849 ~
- 0973982808855297045153053991400988698840883654836652224668624087 ~
- 2540140400911787421220452307533473972538149403884190586842311594 ~
- 6322744339066125162393106283195323883392131534556381511752035108 ~
- 7459558201123754359768155340187407394340363397803881721004531691 ~
- 8295194879591767395417787924352761740724605939160273228287946819 ~
- 3649128949714953432552723591659298072479985806126900733218844526 ~
- 7943350455801952492566306204876616134365339920287545208555344144 ~
- 0990512982727454659118132223284051166615650709837557433729548631 ~
- 2041121716380915606161165732000083306114606181280326258695951602 ~
- 4632166138576614804719932707771316441201594960110632830520759583 ~
- 4850305079095584982982186740289838551383239570208076397550429225 ~
- 9847647071016426974384504309165864528360324933604354657237557916 ~
- 1366324120457809969715663402215880545794313282780055246132088901 ~
- 8742121092448910410052154968097113720754005710963406643135745439 ~
- 9159769435788920793425617783022237011486424925239248728713132021 ~
- 7667360756645598272609574156602343787436291321097485897150713073 ~
- 9104072643541417970572226547980381512759579124002534468048220261 ~
- 7342299001020483062463033796474678190501811830375153802879523433 ~
- 4195502135689770912905614317878792086205744999257897569018492103 ~
- 2420647138519113881475640209760554895793785141404145305151583964 ~
- 2823265406020603311891586570272086250269916393751527887360608114 ~
- 5569484210322407772727421651364234366992716340309405307480652685 ~
- 0930165892136921414312937134106157153714062039784761842650297807 ~
- 8606266969960809184223476335047746719017450451446166382846208240 ~
- 8673595102371302904443779408535034454426334130626307459513830310 ~
- 2293146934466832851766328241515210179422644395718121717021756492 ~
- 1964449396532222187658488244511909401340504432139858628621083179 ~
- 3939608443898019147873897723310286310131486955212620518278063494 ~
- 5711866277825659883100535155231665984394090221806314454521212978 ~
- 9734471488741258268223860236027109981191520568823472398358013366 ~
- 0683786328867928619732367253606685216856320119489780733958419190 ~
- 6659583867852941241871821727987506103946064819585745620060892122 ~
- 8416394373846549589932028481236433466119707324309545859073361878 ~
- 6290631850165106267576851216357588696307451999220010776676830946 ~
- 9814975622682434793671310841210219520899481912444048751171059184 ~
- 4139907889455775184621619041530934543802808938628073237578615267 ~
- 7971143323241969857805637630180884386640607175368321362629671224 ~
- 2609428540110963218262765120117022552929289655594608204938409069 ~
- 0760692003954646191640021567336017909631872891998634341086903200 ~
- 5796637103128612356988817640364252540837098108148351903121318624 ~
- 7228181050845123690190646632235938872454630737272808789830041018 ~
- 9485913673742589418124056729191238003306344998219631580386381054 ~
- 2457893450084553280313511884341007373060595654437362488771292628 ~
- 9807423539074061786905784443105274262641767830058221486462289361 ~
- 9296692992033046693328438158053564864073184440599549689353773183 ~
- 6726613130108623588021288043289344562140479789454233736058506327 ~
- 0439981932635916687341943656783901281912202816229500333012236091 ~
- 8587559201959081224153679499095448881099758919890811581163538891 ~
- 6339402923722049848375224236209100834097566791710084167957022331 ~
- 7897107102928884897013099533995424415335060625843921452433864640 ~
- 3432440657317477553405404481006177612569084746461432976543900008 ~
- 3826521145210162366431119798731902751191441213616962045693602633 ~
- 6102355962140467029012156796418735746835873172331004745963339773 ~
- 2477044918885134415363760091537564267438450166221393719306748706 ~
- 2881595464819775192207710236743289062690709117919412776212245117 ~
- 2354677115640433357720616661564674474627305622913332030953340551 ~
- 3841718194605321501426328000879551813296754972846701883657425342 ~
- 5016994231069156343106626043412205213831587971115075454063290657 ~
- 0248488648697402872037259869281149360627403842332874942332178578 ~
- 7750735571857043787379693402336902911446961448649769719434527467 ~
- 4429603089437192540526658890710662062575509930379976658367936112 ~
- 8137451104971506153783743579555867972129358764463093757203221320 ~
- 2460565661129971310275869112846043251843432691552928458573495971 ~
- 5042565399302112184947232132380516549802909919676815118022483192 ~
- 5127372199792134331067642187484426215985121676396779352982985195 ~
- 8545392106957880586853123277545433229161989053189053725391582222 ~
- 9232597278133427818256064882333760719681014481453198336237910767 ~
- 1255017528826351836492103572587410356573894694875444694018175923 ~
- 0609370828146501857425324969212764624247832210765473750568198834 ~
- 5641035458027261252285503154325039591848918982630498759115406321 ~
- 0354263890012837426155187877318375862355175378506956599570028011 ~
- 5841258870150030170259167463020842412449128392380525772514737141 ~
- 2310230172563968305553583262840383638157686828464330456805994018 ~
- 7001071952092970177990583216417579868116586547147748964716547948 ~
- 8312140431836079844314055731179349677763739898930227765607058530 ~
- 4083747752640947435070395214524701683884070908706147194437225650 ~
- 2823145872995869738316897126851939042297110721350756978037262545 ~
- 8141095038270388987364516284820180468288205829135339013835649144 ~
- 3004015706509887926715417450706686888783438055583501196745862340 ~
- 8059532724727843829259395771584036885940989939255241688378793572 ~
- 7967951654076673927031256418760962190243046993485989199060012977 ~
- 7469214532970421677817261517850653008552559997940209969455431545 ~
- 2745856704403686680428648404512881182309793496962721836492935516 ~
- 2029872469583299481932978335803459023227052612542114437084359584 ~
- 9443383638388317751841160881711251279233374577219339820819005406 ~
- 3292937775306906607415304997682647124407768817248673421685881509 ~
- 9133422075930947173855159340808957124410634720893194912880783576 ~
- 3115829400549708918023366596077070927599010527028150868897828549 ~
- 4340372642729262103487013992868853550062061514343078665396085995 ~
- 0058714939141652065302070085265624074703660736605333805263766757 ~
- 2018839497277047222153633851135483463624619855425993871933367482 ~
- 0422097449956672702505446423243957506869591330193746919142980999 ~
- 3424230550172665212092414559625960554427590951996824313084279693 ~
- 7113207021049823238195747175985519501864630940297594363194450091 ~
- 9150616049228764323192129703446093584259267276386814363309856853 ~
- 2786024332141052330760658841495858718197071242995959226781172796 ~
- 4438853796763139274314227953114500064922126500133268623021550837
- \cs_end:
- }
-\cs_new:Npn \__fp_trig_large:ww #1, #2#3#4#5#6;
- {
- \exp_after:wN \__fp_trig_large_auxi:wwwwww
- \int_use:N \__int_eval:w (#1 - 32) / 64 \exp_after:wN ,
- \int_use:N \__int_eval:w (#1 - 4) / 8 \exp_after:wN ,
- \__int_value:w #1 \__fp_trig_inverse_two_pi: ;
- {#2}{#3}{#4}{#5} ;
- }
-\cs_new:Npn \__fp_trig_large_auxi:wwwwww #1, #2, #3, #4!
- {
- \prg_replicate:nn {#1} { \__fp_trig_large_auxii:ww }
- \prg_replicate:nn { #2 - #1 * \c_eight }
- { \__fp_trig_large_auxiii:wNNNNNNNN }
- \prg_replicate:nn { #3 - #2 * \c_eight }
- { \__fp_trig_large_auxiv:wN }
- \prg_replicate:nn { \c_eight } { \__fp_pack_twice_four:wNNNNNNNN }
- \__fp_trig_large_auxv:www
- ;
- }
-\cs_new:Npn \__fp_trig_large_auxii:ww #1; #2 ~ { #1; }
-\cs_new:Npn \__fp_trig_large_auxiii:wNNNNNNNN
- #1; #2#3#4#5#6#7#8#9 { #1; }
-\cs_new:Npn \__fp_trig_large_auxiv:wN #1; #2 { #1; }
-\cs_new:Npn \__fp_trig_large_auxv:www #1; #2; #3;
- {
- \exp_after:wN \__fp_use_i_until_s:nw
- \exp_after:wN \__fp_trig_large_auxvii:w
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- \prg_replicate:nn { \c_thirteen }
- { \__fp_trig_large_auxvi:wnnnnnnnn }
- + \c__fp_trailing_shift_int - \c__fp_middle_shift_int
- \__fp_use_i_until_s:nw
- ; #3 #1 ; ;
- }
-\cs_new:Npn \__fp_trig_large_auxvi:wnnnnnnnn #1; #2#3#4#5#6#7#8#9
- {
- \exp_after:wN \__fp_trig_large_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- + #2*#9 + #3*#8 + #4*#7 + #5*#6
- #1; {#2}{#3}{#4}{#5} {#7}{#8}{#9}
- }
-\cs_new:Npn \__fp_trig_large_pack:NNNNNw #1#2#3#4#5#6;
- { + #1#2#3#4#5 ; #6 }
-\cs_new:Npn \__fp_trig_large_auxvii:w #1#2#3
- {
- \exp_after:wN \__fp_trig_large_auxviii:ww
- \int_use:N \__int_eval:w (#1#2#3 - 62) / 125 ;
- #1#2#3
- }
-\cs_new:Npn \__fp_trig_large_auxviii:ww #1;
- {
- + #1
- \if_int_odd:w #1 \exp_stop_f:
- \exp_after:wN \__fp_trig_large_auxix:Nw
- \exp_after:wN -
- \else:
- \exp_after:wN \__fp_trig_large_auxix:Nw
- \exp_after:wN +
- \fi:
- }
-\cs_new_nopar:Npn \__fp_trig_large_auxix:Nw
- {
- \exp_after:wN \__fp_use_i_until_s:nw
- \exp_after:wN \__fp_trig_large_auxxi:w
- \int_use:N \__int_eval:w \c__fp_leading_shift_int
- \prg_replicate:nn { \c_thirteen }
- { \__fp_trig_large_auxx:wNNNNN }
- + \c__fp_trailing_shift_int - \c__fp_middle_shift_int
- ;
- }
-\cs_new:Npn \__fp_trig_large_auxx:wNNNNN #1; #2 #3#4#5#6
- {
- \exp_after:wN \__fp_trig_large_pack:NNNNNw
- \int_use:N \__int_eval:w \c__fp_middle_shift_int
- #2 \c_eight * #3#4#5#6
- #1; #2
- }
-\cs_new:Npn \__fp_trig_large_auxxi:w #1;
- {
- \exp_after:wN \__fp_ep_mul_raw:wwwwN
- \int_use:N \__int_eval:w \c_zero \__fp_ep_to_ep_loop:N #1 ; ; !
- 0,{7853}{9816}{3397}{4483}{0961}{5661};
- \__fp_trig_small:ww
- }
-\cs_new:Npn \__fp_sin_series_o:NNwwww #1#2#3. #4;
- {
- \__fp_fixed_mul:wwn #4; #4;
- {
- \exp_after:wN \__fp_sin_series_aux_o:NNnwww
- \exp_after:wN #1
- \__int_value:w
- \if_int_odd:w \__int_eval:w ( #3 + \c_two ) / \c_four \__int_eval_end:
- #2
- \else:
- \if_meaning:w #2 0 2 \else: 0 \fi:
- \fi:
- {#3}
- }
- }
-\cs_new:Npn \__fp_sin_series_aux_o:NNnwww #1#2#3 #4; #5,#6;
- {
- \if_int_odd:w \__int_eval:w #3 / \c_two \__int_eval_end:
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- { % 1/18!
- \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0001}{5619}{2070};
- #4; {0000}{0000}{0000}{0477}{9477}{3324};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{0011}{4707}{4559}{7730};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{2087}{6756}{9878}{6810};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0027}{5573}{1922}{3985}{8907};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{2480}{1587}{3015}{8730}{1587};
- \__fp_fixed_mul_sub_back:wwwn #4; {0013}{8888}{8888}{8888}{8888}{8889};
- \__fp_fixed_mul_sub_back:wwwn #4; {0416}{6666}{6666}{6666}{6666}{6667};
- \__fp_fixed_mul_sub_back:wwwn #4; {5000}{0000}{0000}{0000}{0000}{0000};
- \__fp_fixed_mul_sub_back:wwwn #4;{10000}{0000}{0000}{0000}{0000}{0000};
- { \__fp_fixed_continue:wn 0, }
- }
- { % 1/17!
- \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{0000}{0028}{1145}{7254};
- #4; {0000}{0000}{0000}{7647}{1637}{3182};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0000}{0160}{5904}{3836}{8216};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0002}{5052}{1083}{8544}{1719};
- \__fp_fixed_mul_sub_back:wwwn #4; {0000}{0275}{5731}{9223}{9858}{9065};
- \__fp_fixed_mul_sub_back:wwwn #4; {0001}{9841}{2698}{4126}{9841}{2698};
- \__fp_fixed_mul_sub_back:wwwn #4; {0083}{3333}{3333}{3333}{3333}{3333};
- \__fp_fixed_mul_sub_back:wwwn #4; {1666}{6666}{6666}{6666}{6666}{6667};
- \__fp_fixed_mul_sub_back:wwwn #4;{10000}{0000}{0000}{0000}{0000}{0000};
- { \__fp_ep_mul:wwwwn 0, } #5,#6;
- }
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #2
- \int_use:N \__int_eval:w #1
- }
- #2
- }
-\cs_new:Npn \__fp_tan_series_o:NNwwww #1#2#3. #4;
- {
- \__fp_fixed_mul:wwn #4; #4;
- {
- \exp_after:wN \__fp_tan_series_aux_o:Nnwww
- \__int_value:w
- \if_int_odd:w \__int_eval:w #3 / \c_two \__int_eval_end:
- \exp_after:wN \reverse_if:N
- \fi:
- \if_meaning:w #1#2 2 \else: 0 \fi:
- {#3}
- }
- }
-\cs_new:Npn \__fp_tan_series_aux_o:Nnwww #1 #2 #3; #4,#5;
- {
- \__fp_fixed_mul_sub_back:wwwn {0000}{0000}{1527}{3493}{0856}{7059};
- #3; {0000}{0159}{6080}{0274}{5257}{6472};
- \__fp_fixed_mul_sub_back:wwwn #3; {0002}{4571}{2320}{0157}{2558}{8481};
- \__fp_fixed_mul_sub_back:wwwn #3; {0115}{5830}{7533}{5397}{3168}{2147};
- \__fp_fixed_mul_sub_back:wwwn #3; {1929}{8245}{6140}{3508}{7719}{2982};
- \__fp_fixed_mul_sub_back:wwwn #3;{10000}{0000}{0000}{0000}{0000}{0000};
- { \__fp_ep_mul:wwwwn 0, } #4,#5;
- {
- \__fp_fixed_mul_sub_back:wwwn {0000}{0007}{0258}{0681}{9408}{4706};
- #3; {0000}{2343}{7175}{1399}{6151}{7670};
- \__fp_fixed_mul_sub_back:wwwn #3; {0019}{2638}{4588}{9232}{8861}{3691};
- \__fp_fixed_mul_sub_back:wwwn #3; {0536}{6357}{0691}{4344}{6852}{4252};
- \__fp_fixed_mul_sub_back:wwwn #3; {5263}{1578}{9473}{6842}{1052}{6315};
- \__fp_fixed_mul_sub_back:wwwn #3;{10000}{0000}{0000}{0000}{0000}{0000};
- {
- \reverse_if:N \if_int_odd:w
- \__int_eval:w (#2 - \c_one) / \c_two \__int_eval_end:
- \exp_after:wN \__fp_reverse_args:Nww
- \fi:
- \__fp_ep_div:wwwwn 0,
- }
- }
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w \__fp_ep_to_float:wwN
- }
- #1
- }
-\cs_new_nopar:Npn \__fp_atan_o:Nw
- {
- \__fp_atan_dispatch_o:NNnNw
- \__fp_acotii_o:Nww \__fp_atanii_o:Nww { atan }
- }
-\cs_new_nopar:Npn \__fp_acot_o:Nw
- {
- \__fp_atan_dispatch_o:NNnNw
- \__fp_atanii_o:Nww \__fp_acotii_o:Nww { acot }
- }
-\cs_new:Npn \__fp_atan_dispatch_o:NNnNw #1#2#3#4#5@
- {
- \if_case:w
- \__int_eval:w \__fp_array_count:n {#5} - \c_one \__int_eval_end:
- \exp_after:wN #1 \exp_after:wN #4 \c_one_fp #5
- \tex_romannumeral:D
- \or: #2 #4 #5 \tex_romannumeral:D
- \else:
- \__msg_kernel_expandable_error:nnnnn
- { kernel } { fp-num-args } { #3() } { 1 } { 2 }
- \exp_after:wN \c_nan_fp \tex_romannumeral:D
- \fi:
- \exp_after:wN \c_zero
- }
-\cs_new:Npn \__fp_atanii_o:Nww
- #1 \s__fp \__fp_chk:w #2#3#4; \s__fp \__fp_chk:w #5
- {
- \if_meaning:w 3 #2 \__fp_case_return_i_o:ww \fi:
- \if_meaning:w 3 #5 \__fp_case_return_ii_o:ww \fi:
- \if_case:w
- \if_meaning:w #2 #5
- \if_meaning:w 1 #2 \c_ten \else: \c_zero \fi:
- \else:
- \if_int_compare:w #2 > #5 \c_one \else: \c_two \fi:
- \fi:
- \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_two }
- \or: \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_four }
- \or: \__fp_case_return:nw { \__fp_atan_inf_o:NNNw #1 #3 \c_zero }
- \fi:
- \__fp_atan_normal_o:NNnwNnw #1
- \s__fp \__fp_chk:w #2#3#4;
- \s__fp \__fp_chk:w #5
- }
-\cs_new:Npn \__fp_acotii_o:Nww #1#2; #3;
- { \__fp_atanii_o:Nww #1#3; #2; }
-\cs_new:Npn \__fp_atan_inf_o:NNNw #1#2#3 \s__fp \__fp_chk:w #4#5#6;
- {
- \exp_after:wN \__fp_atan_combine_o:NwwwwwN
- \exp_after:wN #2
- \int_use:N \__int_eval:w
- \if_meaning:w 2 #5 \c_seven - \fi: #3 \exp_after:wN ;
- \c__fp_one_fixed_tl ;
- {0000}{0000}{0000}{0000}{0000}{0000};
- 0,{0000}{0000}{0000}{0000}{0000}{0000}; #1
- }
-\cs_new_protected:Npn \__fp_atan_normal_o:NNnwNnw
- #1 \s__fp \__fp_chk:w 1#2#3#4; \s__fp \__fp_chk:w 1#5#6#7;
- {
- \__fp_atan_test_o:NwwNwwN
- #2 #3, #4{0000}{0000};
- #5 #6, #7{0000}{0000}; #1
- }
-\cs_new:Npn \__fp_atan_test_o:NwwNwwN #1#2,#3; #4#5,#6;
- {
- \exp_after:wN \__fp_atan_combine_o:NwwwwwN
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- \if_meaning:w 2 #4
- \c_seven - \__int_eval:w
- \fi:
- \if_int_compare:w
- \__fp_ep_compare:wwww #2,#3; #5,#6; > \c_zero
- \c_three -
- \exp_after:wN \__fp_reverse_args:Nww
- \fi:
- \__fp_atan_div:wnwwnw #2,#3; #5,#6;
- }
-\cs_new:Npn \__fp_atan_div:wnwwnw #1,#2#3; #4,#5#6;
- {
- \if_int_compare:w
- \__int_eval:w 41421 * #5 < #2 000
- \if_case:w \__int_eval:w #4 - #1 \__int_eval_end: 00 \or: 0 \fi:
- \exp_stop_f:
- \exp_after:wN \__fp_atan_near:wwwn
- \fi:
- \c_zero
- \__fp_ep_div:wwwwn #1,{#2}#3; #4,{#5}#6;
- \__fp_atan_auxi:ww
- }
-\cs_new:Npn \__fp_atan_near:wwwn
- \c_zero \__fp_ep_div:wwwwn #1,#2; #3,
- {
- \c_one
- \__fp_ep_to_fixed:wwn #1 - #3, #2;
- \__fp_atan_near_aux:wwn
- }
-\cs_new:Npn \__fp_atan_near_aux:wwn #1; #2;
- {
- \__fp_fixed_add:wwn #1; #2;
- { \__fp_fixed_sub:wwn #2; #1; { \__fp_ep_div:wwwwn 0, } 0, }
- }
-\cs_new:Npn \__fp_atan_auxi:ww #1,#2;
- { \__fp_ep_to_fixed:wwn #1,#2; \__fp_atan_auxii:w #1,#2; }
-\cs_new:Npn \__fp_atan_auxii:w #1;
- {
- \__fp_fixed_mul:wwn #1; #1;
- {
- \__fp_atan_Taylor_loop:www 39 ;
- {0000}{0000}{0000}{0000}{0000}{0000} ;
- }
- ! #1;
- }
-\cs_new:Npn \__fp_atan_Taylor_loop:www #1; #2; #3;
- {
- \if_int_compare:w #1 = \c_minus_one
- \__fp_atan_Taylor_break:w
- \fi:
- \exp_after:wN \__fp_fixed_div_int:wwN \c__fp_one_fixed_tl ; #1;
- \__fp_rrot:www \__fp_fixed_mul_sub_back:wwwn #2; #3;
- {
- \exp_after:wN \__fp_atan_Taylor_loop:www
- \int_use:N \__int_eval:w #1 - \c_two ;
- }
- #3;
- }
-\cs_new:Npn \__fp_atan_Taylor_break:w
- \fi: #1 \__fp_fixed_mul_sub_back:wwwn #2; #3 !
- { \fi: ; #2 ; }
-\cs_new:Npn \__fp_atan_combine_o:NwwwwwN #1 #2; #3; #4; #5,#6; #7
- {
- \exp_after:wN \__fp_sanitize:Nw
- \exp_after:wN #1
- \int_use:N \__int_eval:w
- \if_meaning:w 0 #2
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- { #5 \__fp_fixed_mul:wwn #3; #6; }
- {
- \__fp_fixed_mul:wwn #3; #4;
- {
- \exp_after:wN \__fp_atan_combine_aux:ww
- \int_use:N \__int_eval:w #2 / \c_two ; #2;
- }
- }
- { #7 \__fp_fixed_to_float:wN \__fp_fixed_to_float_rad:wN }
- #1
- }
-\cs_new:Npn \__fp_atan_combine_aux:ww #1; #2;
- {
- \__fp_fixed_mul_short:wwn
- {7853}{9816}{3397}{4483}{0961}{5661};
- {#1}{0000}{0000};
- {
- \if_int_odd:w #2 \exp_stop_f:
- \exp_after:wN \__fp_fixed_sub:wwn
- \else:
- \exp_after:wN \__fp_fixed_add:wwn
- \fi:
- }
- }
-\cs_new:Npn \__fp_asin_o:w #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_return_same_o:w
- \or:
- \__fp_case_use:nw
- { \__fp_asin_normal_o:NfwNnnnnw #1 { #1 { asin } { asind } } }
- \or:
- \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { asin } { asind } } }
- \else:
- \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3;
- }
-\cs_new:Npn \__fp_acos_o:w #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_use:nw { \__fp_atan_inf_o:NNNw #1 0 \c_four }
- \or:
- \__fp_case_use:nw
- {
- \__fp_asin_normal_o:NfwNnnnnw #1 { #1 { acos } { acosd } }
- \__fp_reverse_args:Nww
- }
- \or:
- \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { acos } { acosd } } }
- \else:
- \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3;
- }
-\cs_new:Npn \__fp_asin_normal_o:NfwNnnnnw
- #1#2#3 \s__fp \__fp_chk:w 1#4#5#6#7#8#9;
- {
- \if_int_compare:w #5 < \c_one
- \exp_after:wN \__fp_use_none_until_s:w
- \fi:
- \if_int_compare:w \__int_eval:w #5 + #6#7 + #8#9 = 1000 0001 ~
- \exp_after:wN \__fp_use_none_until_s:w
- \fi:
- \__fp_use_i:ww
- \__fp_invalid_operation_o:fw {#2}
- \s__fp \__fp_chk:w 1#4{#5}{#6}{#7}{#8}{#9};
- \__fp_asin_auxi_o:NnNww
- #1 {#3} #4 #5,{#6}{#7}{#8}{#9}{0000}{0000};
- }
-\cs_new:Npn \__fp_asin_auxi_o:NnNww #1#2#3#4,#5;
- {
- \__fp_ep_to_fixed:wwn #4,#5;
- \__fp_asin_isqrt:wn
- \__fp_ep_mul:wwwwn #4,#5;
- \__fp_ep_to_ep:wwN
- \__fp_fixed_continue:wn
- { #2 \__fp_atan_test_o:NwwNwwN #3 }
- 0 1,{1000}{0000}{0000}{0000}{0000}{0000}; #1
- }
-\cs_new:Npn \__fp_asin_isqrt:wn #1;
- {
- \exp_after:wN \__fp_fixed_sub:wwn \c__fp_one_fixed_tl ; #1;
- {
- \__fp_fixed_add_one:wN #1;
- \__fp_fixed_continue:wn { \__fp_ep_mul:wwwwn 0, } 0,
- }
- \__fp_ep_isqrt:wwn
- }
-\cs_new:Npn \__fp_acsc_o:w #1 \s__fp \__fp_chk:w #2#3#4; @
- {
- \if_case:w \if_meaning:w 2 #2 #3 \fi: #2 \exp_stop_f:
- \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { acsc } { acscd } } }
- \or: \__fp_case_use:nw
- { \__fp_acsc_normal_o:NfwNnw #1 { #1 { acsc } { acscd } } }
- \or: \__fp_case_return_o:Nw \c_zero_fp
- \or: \__fp_case_return_same_o:w
- \else: \__fp_case_return_o:Nw \c_minus_zero_fp
- \fi:
- \s__fp \__fp_chk:w #2 #3 #4;
- }
-\cs_new:Npn \__fp_asec_o:w #1 \s__fp \__fp_chk:w #2#3; @
- {
- \if_case:w #2 \exp_stop_f:
- \__fp_case_use:nw
- { \__fp_invalid_operation_o:fw { #1 { asec } { asecd } } }
- \or:
- \__fp_case_use:nw
- {
- \__fp_acsc_normal_o:NfwNnw #1 { #1 { asec } { asecd } }
- \__fp_reverse_args:Nww
- }
- \or: \__fp_case_use:nw { \__fp_atan_inf_o:NNNw #1 0 \c_four }
- \else: \__fp_case_return_same_o:w
- \fi:
- \s__fp \__fp_chk:w #2 #3;
- }
-\cs_new:Npn \__fp_acsc_normal_o:NfwNnw #1#2#3 \s__fp \__fp_chk:w 1#4#5#6;
- {
- \int_compare:nNnTF {#5} < \c_one
- {
- \__fp_invalid_operation_o:fw {#2}
- \s__fp \__fp_chk:w 1#4{#5}#6;
- }
- {
- \__fp_ep_div:wwwwn
- 1,{1000}{0000}{0000}{0000}{0000}{0000};
- #5,#6{0000}{0000};
- { \__fp_asin_auxi_o:NnNww #1 {#3} #4 }
- }
- }
-%% File: l3fp-convert.dtx Copyright(C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new:Npn \__fp_trim_zeros:w #1 ;
- {
- \__fp_trim_zeros_loop:w #1
- ; \__fp_trim_zeros_loop:w 0; \__fp_trim_zeros_dot:w .; \s__stop
- }
-\cs_new:Npn \__fp_trim_zeros_loop:w #1 0; #2 { #2 #1 ; #2 }
-\cs_new:Npn \__fp_trim_zeros_dot:w #1 .; { \__fp_trim_zeros_end:w #1 ; }
-\cs_new:Npn \__fp_trim_zeros_end:w #1 ; #2 \s__stop { #1 }
-\cs_new:Npn \fp_to_scientific:N #1
- { \exp_after:wN \__fp_to_scientific_dispatch:w #1 }
-\cs_generate_variant:Nn \fp_to_scientific:N { c }
-\cs_new_nopar:Npn \fp_to_scientific:n
- {
- \exp_after:wN \__fp_to_scientific_dispatch:w
- \tex_romannumeral:D -`0 \__fp_parse:n
- }
-\group_begin:
-\char_set_catcode_other:N E
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new:Npn \__fp_to_scientific_dispatch:w \s__fp \__fp_chk:w #1#2
- {
- \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
- \if_case:w #1 \exp_stop_f:
- \__fp_case_return:nw { 0 }
- \or: \exp_after:wN \__fp_to_scientific_normal:wnnnnn
- \or:
- \__fp_case_use:nw
- {
- \__fp_invalid_operation:nnw
- {
- \exp_after:wN 1
- \exp_after:wN E
- \int_use:N \c__fp_max_exponent_int
- }
- { fp_to_scientific }
- }
- \or:
- \__fp_case_use:nw
- {
- \__fp_invalid_operation:nnw
- { 0 }
- { fp_to_scientific }
- }
- \fi:
- \s__fp \__fp_chk:w #1 #2
- }
- \cs_new:Npn \__fp_to_scientific_normal:wnnnnn
- \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ;
- {
- \if_int_compare:w #2 = \c_one
- \exp_after:wN \__fp_to_scientific_normal:wNw
- \else:
- \exp_after:wN \__fp_to_scientific_normal:wNw
- \exp_after:wN E
- \int_use:N \__int_eval:w #2 - \c_one
- \fi:
- ; #3 #4 #5 #6 ;
- }
- }
-\cs_new:Npn \__fp_to_scientific_normal:wNw #1 ; #2#3;
- { \__fp_trim_zeros:w #2.#3 ; #1 }
-\cs_new:Npn \fp_to_decimal:N #1
- { \exp_after:wN \__fp_to_decimal_dispatch:w #1 }
-\cs_generate_variant:Nn \fp_to_decimal:N { c }
-\cs_new_nopar:Npn \fp_to_decimal:n
- {
- \exp_after:wN \__fp_to_decimal_dispatch:w
- \tex_romannumeral:D -`0 \__fp_parse:n
- }
-\cs_new:Npn \__fp_to_decimal_dispatch:w \s__fp \__fp_chk:w #1#2
- {
- \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
- \if_case:w #1 \exp_stop_f:
- \__fp_case_return:nw { 0 }
- \or: \exp_after:wN \__fp_to_decimal_normal:wnnnnn
- \or:
- \__fp_case_use:nw
- {
- \__fp_invalid_operation:nnw
- {
- \exp_after:wN \exp_after:wN \exp_after:wN 1
- \prg_replicate:nn \c__fp_max_exponent_int 0
- }
- { fp_to_decimal }
- }
- \or:
- \__fp_case_use:nw
- {
- \__fp_invalid_operation:nnw
- { 0 }
- { fp_to_decimal }
- }
- \fi:
- \s__fp \__fp_chk:w #1 #2
- }
-\cs_new:Npn \__fp_to_decimal_normal:wnnnnn
- \s__fp \__fp_chk:w 1 #1 #2 #3#4#5#6 ;
- {
- \int_compare:nNnTF {#2} > \c_zero
- {
- \int_compare:nNnTF {#2} < \c_sixteen
- {
- \__fp_decimate:nNnnnn { \c_sixteen - #2 }
- \__fp_to_decimal_large:Nnnw
- }
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_to_decimal_huge:wnnnn
- \prg_replicate:nn { #2 - \c_sixteen } { 0 } ;
- }
- {#3} {#4} {#5} {#6}
- }
- {
- \exp_after:wN \__fp_trim_zeros:w
- \exp_after:wN 0
- \exp_after:wN .
- \tex_romannumeral:D -`0 \prg_replicate:nn { - #2 } { 0 }
- #3#4#5#6 ;
- }
- }
-\cs_new:Npn \__fp_to_decimal_large:Nnnw #1#2#3#4;
- {
- \exp_after:wN \__fp_trim_zeros:w \__int_value:w
- \if_int_compare:w #2 > \c_zero
- #2
- \fi:
- \exp_stop_f:
- #3.#4 ;
- }
-\cs_new:Npn \__fp_to_decimal_huge:wnnnn #1; #2#3#4#5 { #2#3#4#5 #1 }
-\cs_new:Npn \fp_to_tl:N #1 { \exp_after:wN \__fp_to_tl_dispatch:w #1 }
-\cs_generate_variant:Nn \fp_to_tl:N { c }
-\cs_new_nopar:Npn \fp_to_tl:n
- {
- \exp_after:wN \__fp_to_tl_dispatch:w
- \tex_romannumeral:D -`0 \__fp_parse:n
- }
-\cs_new:Npn \__fp_to_tl_dispatch:w \s__fp \__fp_chk:w #1#2
- {
- \if_meaning:w 2 #2 \exp_after:wN - \tex_romannumeral:D -`0 \fi:
- \if_case:w #1 \exp_stop_f:
- \__fp_case_return:nw { 0 }
- \or: \exp_after:wN \__fp_to_tl_normal:nnnnn
- \or: \__fp_case_return:nw { \tl_to_str:n {inf} }
- \else: \__fp_case_return:nw { \tl_to_str:n {nan} }
- \fi:
- }
-\cs_new:Npn \__fp_to_tl_normal:nnnnn #1
- {
- \if_int_compare:w #1 > \c_sixteen
- \exp_after:wN \__fp_to_scientific_normal:wnnnnn
- \else:
- \if_int_compare:w #1 < - \c_two
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_to_scientific_normal:wnnnnn
- \else:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_to_decimal_normal:wnnnnn
- \fi:
- \fi:
- \s__fp \__fp_chk:w 1 0 {#1}
- }
-\cs_new:Npx \fp_to_dim:N #1
- { \exp_not:N \fp_to_decimal:N #1 \tl_to_str:n {pt} }
-\cs_generate_variant:Nn \fp_to_dim:N { c }
-\cs_new:Npx \fp_to_dim:n #1
- { \exp_not:N \fp_to_decimal:n {#1} \tl_to_str:n {pt} }
-\cs_new:Npn \fp_to_int:N #1 { \exp_after:wN \__fp_to_int_dispatch:w #1 }
-\cs_generate_variant:Nn \fp_to_int:N { c }
-\cs_new_nopar:Npn \fp_to_int:n
- {
- \exp_after:wN \__fp_to_int_dispatch:w
- \tex_romannumeral:D -`0 \__fp_parse:n
- }
-\cs_new:Npn \__fp_to_int_dispatch:w #1;
- {
- \exp_after:wN \__fp_to_decimal_dispatch:w \tex_romannumeral:D -`0
- \__fp_round:Nwn \__fp_round_to_nearest:NNN #1; { 0 }
- }
-\cs_new:Npn \dim_to_fp:n #1
- {
- \exp_after:wN \__fp_from_dim_test:ww
- \exp_after:wN 0
- \exp_after:wN ,
- \__int_value:w \etex_glueexpr:D #1 ;
- }
-\cs_new:Npn \__fp_from_dim_test:ww #1, #2
- {
- \if_meaning:w 0 #2
- \__fp_case_return:nw { \exp_after:wN \c_zero_fp }
- \else:
- \exp_after:wN \__fp_from_dim:wNw
- \int_use:N \__int_eval:w #1 - \c_four
- \if_meaning:w - #2
- \exp_after:wN , \exp_after:wN 2 \__int_value:w
- \else:
- \exp_after:wN , \exp_after:wN 0 \__int_value:w #2
- \fi:
- \fi:
- }
-\cs_new:Npn \__fp_from_dim:wNw #1,#2#3;
- {
- \__fp_pack_twice_four:wNNNNNNNN \__fp_from_dim:wNNnnnnnn ;
- #3 000 0000 00 {10}987654321; #2 {#1}
- }
-\cs_new:Npn \__fp_from_dim:wNNnnnnnn #1; #2#3#4#5#6#7#8#9
- { \__fp_from_dim:wnnnnwNn #1 {#2#300} {0000} ; }
-\cs_new:Npn \__fp_from_dim:wnnnnwNn #1; #2#3#4#5#6; #7#8
- {
- \__fp_mul_npos_o:Nww #7
- \s__fp \__fp_chk:w 1 #7 {#5} #1 ;
- \s__fp \__fp_chk:w 1 0 {#8} {1525} {8789} {0625} {0000} ;
- \prg_do_nothing:
- }
-\cs_new_eq:NN \fp_use:N \fp_to_decimal:N
-\cs_generate_variant:Nn \fp_use:N { c }
-\cs_new_eq:NN \fp_eval:n \fp_to_decimal:n
-\cs_new:Npn \fp_abs:n #1
- { \fp_to_decimal:n { abs \__fp_parse:n {#1} } }
-\cs_new:Npn \fp_max:nn #1#2
- { \fp_to_decimal:n { max ( \__fp_parse:n {#1} , \__fp_parse:n {#2} ) } }
-\cs_new:Npn \fp_min:nn #1#2
- { \fp_to_decimal:n { min ( \__fp_parse:n {#1} , \__fp_parse:n {#2} ) } }
-\cs_new:Npn \__fp_array_to_clist:n #1
- {
- \tl_if_empty:nF {#1}
- {
- \__fp_expand:n
- {
- { \use_ii:nn }
- \__fp_array_to_clist_loop:Nw #1 { ? \__prg_break: } ;
- \__prg_break_point:
- }
- }
- }
-\cs_new:Npx \__fp_array_to_clist_loop:Nw #1#2;
- {
- \exp_not:N \use_none:n #1
- \exp_not:N \exp_after:wN
- {
- \exp_not:N \exp_after:wN ,
- \exp_not:N \exp_after:wN \c_space_tl
- \exp_not:N \tex_romannumeral:D -`0
- \exp_not:N \__fp_to_tl_dispatch:w #1 #2 ;
- }
- \exp_not:N \__fp_array_to_clist_loop:Nw
- }
-%%
-%% File: l3fp-assign.dtx Copyright (C) 2011-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\cs_new_protected:Npn \fp_new:N #1
- { \cs_new_eq:NN #1 \c_zero_fp }
-\cs_generate_variant:Nn \fp_new:N {c}
-\cs_new_protected:Npn \fp_set:Nn #1#2
- { \tl_set:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
-\cs_new_protected:Npn \fp_gset:Nn #1#2
- { \tl_gset:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
-\cs_new_protected:Npn \fp_const:Nn #1#2
- { \tl_const:Nx #1 { \exp_not:f { \__fp_parse:n {#2} } } }
-\cs_generate_variant:Nn \fp_set:Nn {c}
-\cs_generate_variant:Nn \fp_gset:Nn {c}
-\cs_generate_variant:Nn \fp_const:Nn {c}
-\cs_new_eq:NN \fp_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \fp_gset_eq:NN \tl_gset_eq:NN
-\cs_generate_variant:Nn \fp_set_eq:NN { c , Nc , cc }
-\cs_generate_variant:Nn \fp_gset_eq:NN { c , Nc , cc }
-\cs_new_protected:Npn \fp_zero:N #1 { \fp_set_eq:NN #1 \c_zero_fp }
-\cs_new_protected:Npn \fp_gzero:N #1 { \fp_gset_eq:NN #1 \c_zero_fp }
-\cs_generate_variant:Nn \fp_zero:N { c }
-\cs_generate_variant:Nn \fp_gzero:N { c }
-\cs_new_protected:Npn \fp_zero_new:N #1
- { \fp_if_exist:NTF #1 { \fp_zero:N #1 } { \fp_new:N #1 } }
-\cs_new_protected:Npn \fp_gzero_new:N #1
- { \fp_if_exist:NTF #1 { \fp_gzero:N #1 } { \fp_new:N #1 } }
-\cs_generate_variant:Nn \fp_zero_new:N { c }
-\cs_generate_variant:Nn \fp_gzero_new:N { c }
-\cs_new_protected_nopar:Npn \fp_add:Nn { \__fp_add:NNNn \fp_set:Nn + }
-\cs_new_protected_nopar:Npn \fp_gadd:Nn { \__fp_add:NNNn \fp_gset:Nn + }
-\cs_new_protected_nopar:Npn \fp_sub:Nn { \__fp_add:NNNn \fp_set:Nn - }
-\cs_new_protected_nopar:Npn \fp_gsub:Nn { \__fp_add:NNNn \fp_gset:Nn - }
-\cs_new_protected:Npn \__fp_add:NNNn #1#2#3#4
- { #1 #3 { #3 #2 \__fp_parse:n {#4} } }
-\cs_generate_variant:Nn \fp_add:Nn { c }
-\cs_generate_variant:Nn \fp_gadd:Nn { c }
-\cs_generate_variant:Nn \fp_sub:Nn { c }
-\cs_generate_variant:Nn \fp_gsub:Nn { c }
-\cs_new_protected:Npn \fp_show:N #1
- {
- \fp_if_exist:NTF #1
- { \__msg_show_variable:n { > ~ \fp_to_tl:N #1 } }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \fp_show:n #1
- { \__msg_show_variable:n { > ~ \fp_to_tl:n {#1} } }
-\cs_generate_variant:Nn \fp_show:N { c }
-\fp_const:Nn \c_e_fp { 2.718 2818 2845 9045 }
-\fp_const:Nn \c_one_fp { 1 }
-\fp_const:Nn \c_pi_fp { 3.141 5926 5358 9793 }
-\fp_const:Nn \c_one_degree_fp { 0.0 1745 3292 5199 4330 }
-\fp_new:N \l_tmpa_fp
-\fp_new:N \l_tmpb_fp
-\fp_new:N \g_tmpa_fp
-\fp_new:N \g_tmpb_fp
-%% File: l3fp-old.dtx Copyright (C) 2012 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
-\fp_const:Nn \c_undefined_fp { nan }
-\prg_new_conditional:Npnn \fp_if_undefined:N #1 { p , T , F , TF }
- { \exp_after:wN \__fp_if_undefined:w #1 }
-\cs_new:Npn \__fp_if_undefined:w \s__fp \__fp_chk:w #1#2;
- {
- \if_int_compare:w #1 > \c_one
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \fp_if_zero:N #1 { p , T , F , TF }
- { \exp_after:wN \__fp_if_zero:w #1 }
-\cs_new:Npn \__fp_if_zero:w \s__fp \__fp_chk:w #1#2;
- { \if_meaning:w #1 0 \prg_return_true: \else: \prg_return_false: \fi: }
-\cs_new_protected_nopar:Npn \fp_abs:N { \__fp_abs:NNN \tl_set:Nx \__fp_abs_o:w }
-\cs_new_protected_nopar:Npn \fp_gabs:N { \__fp_abs:NNN \tl_gset:Nx \__fp_abs_o:w }
-\cs_new_protected_nopar:Npx \fp_neg:N
- {
- \exp_not:N \__fp_abs:NNN
- \exp_not:N \tl_set:Nx
- \exp_not:c { __fp_-_o:w }
- }
-\cs_new_protected_nopar:Npx \fp_gneg:N
- {
- \exp_not:N \__fp_abs:NNN
- \exp_not:N \tl_gset:Nx
- \exp_not:c { __fp_-_o:w }
- }
-\cs_new_protected:Npn \__fp_abs:NNN #1#2#3
- { #1 #3 { \exp_after:wN #2 #3 \prg_do_nothing: } }
-\cs_generate_variant:Nn \fp_abs:N { c }
-\cs_generate_variant:Nn \fp_gabs:N { c }
-\cs_generate_variant:Nn \fp_neg:N { c }
-\cs_generate_variant:Nn \fp_gneg:N { c }
-\cs_new_protected_nopar:Npn \fp_mul:Nn { \__fp_mul:NNNn \fp_set:Nn * }
-\cs_new_protected_nopar:Npn \fp_gmul:Nn { \__fp_mul:NNNn \fp_gset:Nn * }
-\cs_new_protected_nopar:Npn \fp_div:Nn { \__fp_mul:NNNn \fp_set:Nn / }
-\cs_new_protected_nopar:Npn \fp_gdiv:Nn { \__fp_mul:NNNn \fp_gset:Nn / }
-\cs_new_protected_nopar:Npn \fp_pow:Nn { \__fp_mul:NNNn \fp_set:Nn ^ }
-\cs_new_protected_nopar:Npn \fp_gpow:Nn { \__fp_mul:NNNn \fp_gset:Nn ^ }
-\cs_new_protected:Npn \__fp_mul:NNNn #1#2#3#4
- { #1 #3 { #3 #2 \__fp_parse:n {#4} } }
-\cs_generate_variant:Nn \fp_mul:Nn { c }
-\cs_generate_variant:Nn \fp_gmul:Nn { c }
-\cs_generate_variant:Nn \fp_div:Nn { c }
-\cs_generate_variant:Nn \fp_gdiv:Nn { c }
-\cs_generate_variant:Nn \fp_pow:Nn { c }
-\cs_generate_variant:Nn \fp_gpow:Nn { c }
-\cs_set_protected:Npn \__fp_tmp:w #1#2#3#4#5
- {
- \cs_new_protected_nopar:Npn #1 { #5 {#4} \tl_set_eq:NN #3 }
- \cs_new_protected_nopar:Npn #2 { #5 {#4} \tl_gset_eq:NN #3 }
- \cs_generate_variant:Nn #1 { c }
- \cs_generate_variant:Nn #2 { c }
- }
-\__fp_tmp:w \fp_exp:Nn \fp_gexp:Nn \__fp_exp_o:w {exp} \__fp_assign_to:nNNNn
-\__fp_tmp:w \fp_ln:Nn \fp_gln:Nn \__fp_ln_o:w {ln } \__fp_assign_to:nNNNn
-\__fp_tmp:w \fp_sin:Nn \fp_gsin:Nn \__fp_sin_o:w {sin} \__fp_assign_to:nNNNn
-\__fp_tmp:w \fp_cos:Nn \fp_gcos:Nn \__fp_cos_o:w {cos} \__fp_assign_to:nNNNn
-\__fp_tmp:w \fp_tan:Nn \fp_gtan:Nn \__fp_tan_o:w {tan} \__fp_assign_to:nNNNn
-\cs_new_protected:Npn \__fp_assign_to:nNNNn #1#2#3#4#5
- {
- \exp_after:wN \__fp_assign_to_i:wNNNn
- \tex_romannumeral:D -`0 \__fp_parse:n {#5} {#1} #2#3#4
- }
-\cs_new_protected:Npn \__fp_assign_to_i:wNNNn \s__fp \__fp_chk:w #1#2#3; #4
- {
- \exp_args:Nc \__fp_assign_to_ii:NnNNN
- { c__fp_ #4 [ #1 # 2 \if_meaning:w 1 #1 #3 \fi: ] _fp }
- { #1#2#3 }
- }
-\cs_new_protected:Npn \__fp_assign_to_ii:NnNNN #1#2#3#4#5
- {
- \cs_if_exist:NF #1
- { \tl_const:Nx #1 { #4 \s__fp \__fp_chk:w #2; } }
- #3 #5 #1
- }
-\cs_new_protected_nopar:Npn \fp_compare:NNNTF { \fp_compare:nNnTF }
-\cs_new_protected_nopar:Npn \fp_compare:NNNT { \fp_compare:nNnT }
-\cs_new_protected_nopar:Npn \fp_compare:NNNF { \fp_compare:nNnF }
-\cs_new_protected_nopar:Npn \fp_round_places:Nn
- { \__fp_round_places:NNn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \fp_ground_places:Nn
- { \__fp_round_places:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \__fp_round_places:NNn #1#2#3
- {
- #1 #2
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_round:Nwn
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__fp_round_to_nearest:NNN
- \exp_after:wN #2
- \exp_after:wN { \int_use:N \__int_eval:w #3 }
- }
- }
-\cs_generate_variant:Nn \fp_round_places:Nn { c }
-\cs_generate_variant:Nn \fp_ground_places:Nn { c }
-\cs_new_protected:Npn \fp_round_figures:Nn #1#2
- {
- \__fp_round_places:NNn \tl_set:Nx #1
- { #2 - \exp_after:wN \__fp_exponent:w #1 }
- }
-\cs_new_protected:Npn \fp_ground_figures:Nn #1#2
- {
- \__fp_round_places:NNn \tl_gset:Nx #1
- { #2 - \exp_after:wN \__fp_exponent:w #1 }
- }
-\cs_generate_variant:Nn \fp_round_figures:Nn { c }
-\cs_generate_variant:Nn \fp_ground_figures:Nn { c }
-%%
-%%
-%% End of file `l3fp.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty b/Master/texmf-dist/tex/latex/l3kernel/l3int.sty
deleted file mode 100644
index c9b84c7e081..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3int.sty
+++ /dev/null
@@ -1,798 +0,0 @@
-%%
-%% This is file `l3int.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3int.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3int.dtx Copyright (C) 1990-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3int.dtx 4583 2013-08-02 19:14:35Z joseph $
- {L3 Integers}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_eq:NN \__int_value:w \tex_number:D
-\cs_new_eq:NN \__int_eval:w \etex_numexpr:D
-\cs_new_eq:NN \__int_eval_end: \tex_relax:D
-\cs_new_eq:NN \if_int_odd:w \tex_ifodd:D
-\cs_new_eq:NN \if_case:w \tex_ifcase:D
-\cs_new:Npn \int_eval:n #1 { \__int_value:w \__int_eval:w #1 \__int_eval_end: }
-\cs_new:Npn \int_abs:n #1
- {
- \__int_value:w \exp_after:wN \__int_abs:N
- \int_use:N \__int_eval:w #1 \__int_eval_end:
- \exp_stop_f:
- }
-\cs_new:Npn \__int_abs:N #1
- { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
-\cs_set:Npn \int_max:nn #1#2
- {
- \__int_value:w \exp_after:wN \__int_maxmin:wwN
- \int_use:N \__int_eval:w #1 \exp_after:wN ;
- \int_use:N \__int_eval:w #2 ;
- >
- \exp_stop_f:
- }
-\cs_set:Npn \int_min:nn #1#2
- {
- \__int_value:w \exp_after:wN \__int_maxmin:wwN
- \int_use:N \__int_eval:w #1 \exp_after:wN ;
- \int_use:N \__int_eval:w #2 ;
- <
- \exp_stop_f:
- }
-\cs_new:Npn \__int_maxmin:wwN #1 ; #2 ; #3
- {
- \if_int_compare:w #1 #3 #2 ~
- #1
- \else:
- #2
- \fi:
- }
-\cs_new:Npn \int_div_truncate:nn #1#2
- {
- \int_use:N \__int_eval:w
- \exp_after:wN \__int_div_truncate:NwNw
- \int_use:N \__int_eval:w #1 \exp_after:wN ;
- \int_use:N \__int_eval:w #2 ;
- \__int_eval_end:
- }
-\cs_new:Npn \__int_div_truncate:NwNw #1#2; #3#4;
- {
- \if_meaning:w 0 #1
- \c_zero
- \else:
- (
- #1#2
- \if_meaning:w - #1 + \else: - \fi:
- ( \if_meaning:w - #3 - \fi: #3#4 - \c_one ) / \c_two
- )
- \fi:
- / #3#4
- }
-\cs_new:Npn \int_div_round:nn #1#2
- { \__int_value:w \__int_eval:w ( #1 ) / ( #2 ) \__int_eval_end: }
-\cs_new:Npn \int_mod:nn #1#2
- {
- \__int_value:w \__int_eval:w \exp_after:wN \__int_mod:ww
- \__int_value:w \__int_eval:w #1 \exp_after:wN ;
- \__int_value:w \__int_eval:w #2 ;
- \__int_eval_end:
- }
-\cs_new:Npn \__int_mod:ww #1; #2;
- { #1 - ( \__int_div_truncate:NwNw #1 ; #2 ; ) * #2 }
-\cs_new_protected:Npn \int_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newcount #1
- }
-\cs_generate_variant:Nn \int_new:N { c }
-\cs_new_protected:Npn \int_const:Nn #1#2
- {
- \int_compare:nNnTF {#2} > \c_minus_one
- {
- \int_compare:nNnTF {#2} > \c__max_constdef_int
- {
- \int_new:N #1
- \int_gset:Nn #1 {#2}
- }
- {
- \__chk_if_free_cs:N #1
- \tex_global:D \__int_constdef:Nw #1 =
- \__int_eval:w #2 \__int_eval_end:
- }
- }
- {
- \int_new:N #1
- \int_gset:Nn #1 {#2}
- }
- }
-\cs_generate_variant:Nn \int_const:Nn { c }
-\pdftex_if_engine:TF
- {
- \cs_new_eq:NN \__int_constdef:Nw \tex_mathchardef:D
- \tex_mathchardef:D \c__max_constdef_int 32 767 ~
- }
- {
- \cs_new_eq:NN \__int_constdef:Nw \tex_chardef:D
- \tex_chardef:D \c__max_constdef_int 1 114 111 ~
- }
-\cs_new_protected:Npn \int_zero:N #1 { #1 = \c_zero }
-\cs_new_protected:Npn \int_gzero:N #1 { \tex_global:D #1 = \c_zero }
-\cs_generate_variant:Nn \int_zero:N { c }
-\cs_generate_variant:Nn \int_gzero:N { c }
-\cs_new_protected:Npn \int_zero_new:N #1
- { \int_if_exist:NTF #1 { \int_zero:N #1 } { \int_new:N #1 } }
-\cs_new_protected:Npn \int_gzero_new:N #1
- { \int_if_exist:NTF #1 { \int_gzero:N #1 } { \int_new:N #1 } }
-\cs_generate_variant:Nn \int_zero_new:N { c }
-\cs_generate_variant:Nn \int_gzero_new:N { c }
-\cs_new_protected:Npn \int_set_eq:NN #1#2 { #1 = #2 }
-\cs_generate_variant:Nn \int_set_eq:NN { c }
-\cs_generate_variant:Nn \int_set_eq:NN { Nc , cc }
-\cs_new_protected:Npn \int_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
-\cs_generate_variant:Nn \int_gset_eq:NN { c }
-\cs_generate_variant:Nn \int_gset_eq:NN { Nc , cc }
-\prg_new_eq_conditional:NNn \int_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \int_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_protected:Npn \int_add:Nn #1#2
- { \tex_advance:D #1 by \__int_eval:w #2 \__int_eval_end: }
-\cs_new_protected:Npn \int_sub:Nn #1#2
- { \tex_advance:D #1 by - \__int_eval:w #2 \__int_eval_end: }
-\cs_new_protected_nopar:Npn \int_gadd:Nn
- { \tex_global:D \int_add:Nn }
-\cs_new_protected_nopar:Npn \int_gsub:Nn
- { \tex_global:D \int_sub:Nn }
-\cs_generate_variant:Nn \int_add:Nn { c }
-\cs_generate_variant:Nn \int_gadd:Nn { c }
-\cs_generate_variant:Nn \int_sub:Nn { c }
-\cs_generate_variant:Nn \int_gsub:Nn { c }
-\cs_new_protected:Npn \int_incr:N #1
- { \tex_advance:D #1 \c_one }
-\cs_new_protected:Npn \int_decr:N #1
- { \tex_advance:D #1 \c_minus_one }
-\cs_new_protected_nopar:Npn \int_gincr:N
- { \tex_global:D \int_incr:N }
-\cs_new_protected_nopar:Npn \int_gdecr:N
- { \tex_global:D \int_decr:N }
-\cs_generate_variant:Nn \int_incr:N { c }
-\cs_generate_variant:Nn \int_decr:N { c }
-\cs_generate_variant:Nn \int_gincr:N { c }
-\cs_generate_variant:Nn \int_gdecr:N { c }
-\cs_new_protected:Npn \int_set:Nn #1#2
- { #1 ~ \__int_eval:w #2\__int_eval_end: }
-\cs_new_protected_nopar:Npn \int_gset:Nn { \tex_global:D \int_set:Nn }
-\cs_generate_variant:Nn \int_set:Nn { c }
-\cs_generate_variant:Nn \int_gset:Nn { c }
-\cs_new_eq:NN \int_use:N \tex_the:D
-\cs_new:Npn \int_use:c #1 { \int_use:N \cs:w #1 \cs_end: }
-\cs_new_protected_nopar:Npn \__prg_compare_error:
- {
- \if_int_compare:w \c_zero \c_zero \fi:
- =
- \__prg_compare_error:
- }
-\cs_new:Npn \__prg_compare_error:Nw
- #1#2 \q_stop
- {
- { }
- \c_zero \fi:
- \__msg_kernel_expandable_error:nnn
- { kernel } { unknown-comparison } {#1}
- \prg_return_false:
- }
-\prg_new_conditional:Npnn \int_compare:n #1 { p , T , F , TF }
- {
- \exp_after:wN \__int_compare:w
- \int_use:N \__int_eval:w #1 \__prg_compare_error:
- }
-\cs_new:Npn \__int_compare:w #1 \__prg_compare_error:
- {
- \exp_after:wN \if_false: \__int_value:w
- \__int_compare:Nw #1 e { = nd_ } \q_stop
- }
-\cs_new:Npn \__int_compare:Nw #1#2 \q_stop
- {
- \exp_after:wN \__int_compare:NNw
- \__int_to_roman:w - 0 #2 \q_mark
- #1#2 \q_stop
- }
-\cs_new:Npn \__int_compare:NNw #1#2#3 \q_mark
- {
- \etex_unexpanded:D
- \use:c { __int_compare_ #1 \if_meaning:w = #2 = \fi: :NNw }
- \__prg_compare_error:Nw #1
- }
-\cs_new:cpn { __int_compare_end_=:NNw } #1#2#3 e #4 \q_stop
- {
- {#3} \exp_stop_f:
- \prg_return_false: \else: \prg_return_true: \fi:
- }
-\cs_new:Npn \__int_compare:nnN #1#2#3
- {
- {#2} \exp_stop_f:
- \prg_return_false: \exp_after:wN \use_none_delimit_by_q_stop:w
- \fi:
- #1 #2 #3 \exp_after:wN \__int_compare:Nw \__int_value:w \__int_eval:w
- }
-\cs_new:cpn { __int_compare_=:NNw } #1#2#3 =
- { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
-\cs_new:cpn { __int_compare_<:NNw } #1#2#3 <
- { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} < }
-\cs_new:cpn { __int_compare_>:NNw } #1#2#3 >
- { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} > }
-\cs_new:cpn { __int_compare_==:NNw } #1#2#3 ==
- { \__int_compare:nnN { \reverse_if:N \if_int_compare:w } {#3} = }
-\cs_new:cpn { __int_compare_!=:NNw } #1#2#3 !=
- { \__int_compare:nnN { \if_int_compare:w } {#3} = }
-\cs_new:cpn { __int_compare_<=:NNw } #1#2#3 <=
- { \__int_compare:nnN { \if_int_compare:w } {#3} > }
-\cs_new:cpn { __int_compare_>=:NNw } #1#2#3 >=
- { \__int_compare:nnN { \if_int_compare:w } {#3} < }
-\prg_new_conditional:Npnn \int_compare:nNn #1#2#3 { p , T , F , TF }
- {
- \if_int_compare:w \__int_eval:w #1 #2 \__int_eval:w #3 \__int_eval_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \int_case:nnTF #1
- {
- \tex_romannumeral:D
- \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} }
- }
-\cs_new:Npn \int_case:nnT #1#2#3
- {
- \tex_romannumeral:D
- \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} {#3} { }
- }
-\cs_new:Npn \int_case:nnF #1#2
- {
- \tex_romannumeral:D
- \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} { }
- }
-\cs_new:Npn \int_case:nn #1#2
- {
- \tex_romannumeral:D
- \exp_args:Nf \__int_case:nnTF { \int_eval:n {#1} } {#2} { } { }
- }
-\cs_new:Npn \__int_case:nnTF #1#2#3#4
- { \__int_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
-\cs_new:Npn \__int_case:nw #1#2#3
- {
- \int_compare:nNnTF {#1} = {#2}
- { \__int_case_end:nw {#3} }
- { \__int_case:nw {#1} }
- }
-\cs_new_eq:NN \__int_case_end:nw \__prg_case_end:nw
-\prg_new_conditional:Npnn \int_if_odd:n #1 { p , T , F , TF}
- {
- \if_int_odd:w \__int_eval:w #1 \__int_eval_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Npnn \int_if_even:n #1 { p , T , F , TF}
- {
- \if_int_odd:w \__int_eval:w #1 \__int_eval_end:
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- }
-\cs_new:Npn \int_while_do:nn #1#2
- {
- \int_compare:nT {#1}
- {
- #2
- \int_while_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \int_until_do:nn #1#2
- {
- \int_compare:nF {#1}
- {
- #2
- \int_until_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \int_do_while:nn #1#2
- {
- #2
- \int_compare:nT {#1}
- { \int_do_while:nn {#1} {#2} }
- }
-\cs_new:Npn \int_do_until:nn #1#2
- {
- #2
- \int_compare:nF {#1}
- { \int_do_until:nn {#1} {#2} }
- }
-\cs_new:Npn \int_while_do:nNnn #1#2#3#4
- {
- \int_compare:nNnT {#1} #2 {#3}
- {
- #4
- \int_while_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_new:Npn \int_until_do:nNnn #1#2#3#4
- {
- \int_compare:nNnF {#1} #2 {#3}
- {
- #4
- \int_until_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_new:Npn \int_do_while:nNnn #1#2#3#4
- {
- #4
- \int_compare:nNnT {#1} #2 {#3}
- { \int_do_while:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_new:Npn \int_do_until:nNnn #1#2#3#4
- {
- #4
- \int_compare:nNnF {#1} #2 {#3}
- { \int_do_until:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_new:Npn \int_step_function:nnnN #1#2#3#4
- {
- \int_compare:nNnTF {#2} > \c_zero
- { \exp_args:NNf \__int_step:NnnnN > }
- {
- \int_compare:nNnTF {#2} = \c_zero
- {
- \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#4}
- \use_none:nnnn
- }
- { \exp_args:NNf \__int_step:NnnnN < }
- }
- { \int_eval:n {#1} } {#2} {#3} #4
- }
-\cs_new:Npn \__int_step:NnnnN #1#2#3#4#5
- {
- \int_compare:nNnF {#2} #1 {#4}
- {
- #5 {#2}
- \exp_args:NNf \__int_step:NnnnN
- #1 { \int_eval:n { #2 + #3 } } {#3} {#4} #5
- }
- }
-\cs_new_protected_nopar:Npn \int_step_inline:nnnn
- {
- \int_gincr:N \g__prg_map_int
- \exp_args:NNc \__int_step:NNnnnn
- \cs_gset_nopar:Npn
- { __prg_map_ \int_use:N \g__prg_map_int :w }
- }
-\cs_new_protected:Npn \int_step_variable:nnnNn #1#2#3#4#5
- {
- \int_gincr:N \g__prg_map_int
- \exp_args:NNc \__int_step:NNnnnn
- \cs_gset_nopar:Npx
- { __prg_map_ \int_use:N \g__prg_map_int :w }
- {#1}{#2}{#3}
- {
- \tl_set:Nn \exp_not:N #4 {##1}
- \exp_not:n {#5}
- }
- }
-\cs_new_protected:Npn \__int_step:NNnnnn #1#2#3#4#5#6
- {
- #1 #2 ##1 {#6}
- \int_step_function:nnnN {#3} {#4} {#5} #2
- \__prg_break_point:Nn \scan_stop: { \int_gdecr:N \g__prg_map_int }
- }
-\cs_new:Npn \int_to_arabic:n #1 { \int_eval:n {#1} }
-\cs_new:Npn \int_to_symbols:nnn #1#2#3
- {
- \int_compare:nNnTF {#1} > {#2}
- {
- \exp_args:NNo \exp_args:No \__int_to_symbols:nnnn
- {
- \int_case:nn
- { 1 + \int_mod:nn { #1 - 1 } {#2} }
- {#3}
- }
- {#1} {#2} {#3}
- }
- { \int_case:nn {#1} {#3} }
- }
-\cs_new:Npn \__int_to_symbols:nnnn #1#2#3#4
- {
- \exp_args:Nf \int_to_symbols:nnn
- { \int_div_truncate:nn { #2 - 1 } {#3} } {#3} {#4}
- #1
- }
-\cs_new:Npn \int_to_alph:n #1
- {
- \int_to_symbols:nnn {#1} { 26 }
- {
- { 1 } { a }
- { 2 } { b }
- { 3 } { c }
- { 4 } { d }
- { 5 } { e }
- { 6 } { f }
- { 7 } { g }
- { 8 } { h }
- { 9 } { i }
- { 10 } { j }
- { 11 } { k }
- { 12 } { l }
- { 13 } { m }
- { 14 } { n }
- { 15 } { o }
- { 16 } { p }
- { 17 } { q }
- { 18 } { r }
- { 19 } { s }
- { 20 } { t }
- { 21 } { u }
- { 22 } { v }
- { 23 } { w }
- { 24 } { x }
- { 25 } { y }
- { 26 } { z }
- }
- }
-\cs_new:Npn \int_to_Alph:n #1
- {
- \int_to_symbols:nnn {#1} { 26 }
- {
- { 1 } { A }
- { 2 } { B }
- { 3 } { C }
- { 4 } { D }
- { 5 } { E }
- { 6 } { F }
- { 7 } { G }
- { 8 } { H }
- { 9 } { I }
- { 10 } { J }
- { 11 } { K }
- { 12 } { L }
- { 13 } { M }
- { 14 } { N }
- { 15 } { O }
- { 16 } { P }
- { 17 } { Q }
- { 18 } { R }
- { 19 } { S }
- { 20 } { T }
- { 21 } { U }
- { 22 } { V }
- { 23 } { W }
- { 24 } { X }
- { 25 } { Y }
- { 26 } { Z }
- }
- }
-\cs_new:Npn \int_to_base:nn #1
- { \exp_args:Nf \__int_to_base:nn { \int_eval:n {#1} } }
-\cs_new:Npn \__int_to_base:nn #1#2
- {
- \int_compare:nNnTF {#1} < \c_zero
- { \exp_args:No \__int_to_base:nnN { \use_none:n #1 } {#2} - }
- { \__int_to_base:nnN {#1} {#2} \c_empty_tl }
- }
-\cs_new:Npn \__int_to_base:nnN #1#2#3
- {
- \int_compare:nNnTF {#1} < {#2}
- { \exp_last_unbraced:Nf #3 { \__int_to_letter:n {#1} } }
- {
- \exp_args:Nf \__int_to_base:nnnN
- { \__int_to_letter:n { \int_mod:nn {#1} {#2} } }
- {#1}
- {#2}
- #3
- }
- }
-\cs_new:Npn \__int_to_base:nnnN #1#2#3#4
- {
- \exp_args:Nf \__int_to_base:nnN
- { \int_div_truncate:nn {#2} {#3} }
- {#3}
- #4
- #1
- }
-\cs_new:Npn \__int_to_letter:n #1
- {
- \exp_after:wN \exp_after:wN
- \if_case:w \__int_eval:w #1 - \c_ten \__int_eval_end:
- A
- \or: B
- \or: C
- \or: D
- \or: E
- \or: F
- \or: G
- \or: H
- \or: I
- \or: J
- \or: K
- \or: L
- \or: M
- \or: N
- \or: O
- \or: P
- \or: Q
- \or: R
- \or: S
- \or: T
- \or: U
- \or: V
- \or: W
- \or: X
- \or: Y
- \or: Z
- \else: \__int_value:w \__int_eval:w #1 \exp_after:wN \__int_eval_end:
- \fi:
- }
-\cs_new:Npn \int_to_binary:n #1
- { \int_to_base:nn {#1} { 2 } }
-\cs_new:Npn \int_to_hexadecimal:n #1
- { \int_to_base:nn {#1} { 16 } }
-\cs_new:Npn \int_to_octal:n #1
- { \int_to_base:nn {#1} { 8 } }
-\cs_new:Npn \int_to_roman:n #1
- {
- \exp_after:wN \__int_to_roman:N
- \__int_to_roman:w \int_eval:n {#1} Q
- }
-\cs_new:Npn \__int_to_roman:N #1
- {
- \use:c { __int_to_roman_ #1 :w }
- \__int_to_roman:N
- }
-\cs_new:Npn \int_to_Roman:n #1
- {
- \exp_after:wN \__int_to_Roman_aux:N
- \__int_to_roman:w \int_eval:n {#1} Q
- }
-\cs_new:Npn \__int_to_Roman_aux:N #1
- {
- \use:c { __int_to_Roman_ #1 :w }
- \__int_to_Roman_aux:N
- }
-\cs_new_nopar:Npn \__int_to_roman_i:w { i }
-\cs_new_nopar:Npn \__int_to_roman_v:w { v }
-\cs_new_nopar:Npn \__int_to_roman_x:w { x }
-\cs_new_nopar:Npn \__int_to_roman_l:w { l }
-\cs_new_nopar:Npn \__int_to_roman_c:w { c }
-\cs_new_nopar:Npn \__int_to_roman_d:w { d }
-\cs_new_nopar:Npn \__int_to_roman_m:w { m }
-\cs_new_nopar:Npn \__int_to_roman_Q:w #1 { }
-\cs_new_nopar:Npn \__int_to_Roman_i:w { I }
-\cs_new_nopar:Npn \__int_to_Roman_v:w { V }
-\cs_new_nopar:Npn \__int_to_Roman_x:w { X }
-\cs_new_nopar:Npn \__int_to_Roman_l:w { L }
-\cs_new_nopar:Npn \__int_to_Roman_c:w { C }
-\cs_new_nopar:Npn \__int_to_Roman_d:w { D }
-\cs_new_nopar:Npn \__int_to_Roman_m:w { M }
-\cs_new:Npn \__int_to_Roman_Q:w #1 { }
-\cs_new:Npn \__int_get_sign:n #1
- {
- \__int_get_sign_and_digits:nNNN {#1}
- \c_true_bool \c_true_bool \c_false_bool
- }
-\cs_new:Npn \__int_get_digits:n #1
- {
- \__int_get_sign_and_digits:nNNN {#1}
- \c_true_bool \c_false_bool \c_true_bool
- }
-\cs_new:Npn \__int_get_sign_and_digits:nNNN #1#2#3#4
- {
- \exp_args:Nf \tl_if_head_eq_charcode:nNTF {#1} -
- {
- \bool_if:NTF #2
- {
- \__int_get_sign_and_digits:oNNN
- { \use_none:n #1 } \c_false_bool #3#4
- }
- {
- \__int_get_sign_and_digits:oNNN
- { \use_none:n #1 } \c_true_bool #3#4
- }
- }
- {
- \exp_args:Nf \tl_if_head_eq_charcode:nNTF {#1} +
- { \__int_get_sign_and_digits:oNNN { \use_none:n #1 } #2#3#4 }
- {
- \bool_if:NT #3 { \bool_if:NF #2 - }
- \bool_if:NT #4 {#1}
- }
- }
- }
-\cs_generate_variant:Nn \__int_get_sign_and_digits:nNNN { o }
-\cs_new:Npn \int_from_alph:n #1
- {
- \int_eval:n
- {
- \__int_get_sign:n {#1}
- \exp_args:Nf \__int_from_alph:n { \__int_get_digits:n {#1} }
- }
- }
-\cs_new:Npn \__int_from_alph:n #1
- { \__int_from_alph:nN { 0 } #1 \q_nil }
-\cs_new:Npn \__int_from_alph:nN #1#2
- {
- \quark_if_nil:NTF #2
- {#1}
- {
- \exp_args:Nf \__int_from_alph:nN
- { \int_eval:n { #1 * 26 + \__int_from_alph:N #2 } }
- }
- }
-\cs_new:Npn \__int_from_alph:N #1
- { \int_eval:n { `#1 - \int_compare:nNnTF { `#1 } < { 91 } { 64 } { 96 } } }
-\cs_new:Npn \int_from_base:nn #1#2
- {
- \int_eval:n
- {
- \__int_get_sign:n {#1}
- \exp_args:Nf \__int_from_base:nn
- { \__int_get_digits:n {#1} } {#2}
- }
- }
-\cs_new:Npn \__int_from_base:nn #1#2
- { \__int_from_base:nnN { 0 } { #2 } #1 \q_nil }
-\cs_new:Npn \__int_from_base:nnN #1#2#3
- {
- \quark_if_nil:NTF #3
- {#1}
- {
- \exp_args:Nf \__int_from_base:nnN
- { \int_eval:n { #1 * #2 + \__int_from_base:N #3 } }
- {#2}
- }
- }
-\cs_new:Npn \__int_from_base:N #1
- {
- \int_compare:nNnTF { `#1 } < { 58 }
- {#1}
- {
- \int_eval:n
- { `#1 - \int_compare:nNnTF { `#1 } < { 91 } { 55 } { 87 } }
- }
- }
-\cs_new:Npn \int_from_binary:n #1
- { \int_from_base:nn {#1} \c_two }
-\cs_new:Npn \int_from_hexadecimal:n #1
- { \int_from_base:nn {#1} \c_sixteen }
-\cs_new:Npn \int_from_octal:n #1
- { \int_from_base:nn {#1} \c_eight }
-\int_const:cn { c__int_from_roman_i_int } { 1 }
-\int_const:cn { c__int_from_roman_v_int } { 5 }
-\int_const:cn { c__int_from_roman_x_int } { 10 }
-\int_const:cn { c__int_from_roman_l_int } { 50 }
-\int_const:cn { c__int_from_roman_c_int } { 100 }
-\int_const:cn { c__int_from_roman_d_int } { 500 }
-\int_const:cn { c__int_from_roman_m_int } { 1000 }
-\int_const:cn { c__int_from_roman_I_int } { 1 }
-\int_const:cn { c__int_from_roman_V_int } { 5 }
-\int_const:cn { c__int_from_roman_X_int } { 10 }
-\int_const:cn { c__int_from_roman_L_int } { 50 }
-\int_const:cn { c__int_from_roman_C_int } { 100 }
-\int_const:cn { c__int_from_roman_D_int } { 500 }
-\int_const:cn { c__int_from_roman_M_int } { 1000 }
-\cs_new:Npn \int_from_roman:n #1
- {
- \tl_if_blank:nF {#1}
- {
- \exp_after:wN \__int_from_roman_end:w
- \__int_value:w \__int_eval:w
- \__int_from_roman:NN #1 Q \q_stop
- }
- }
-\cs_new:Npn \__int_from_roman:NN #1#2
- {
- \str_if_eq:nnTF {#1} { Q }
- {#1#2}
- {
- \str_if_eq:nnTF {#2} { Q }
- {
- \int_if_exist:cF { c__int_from_roman_ #1 _int }
- { \__int_from_roman_clean_up:w }
- +
- \use:c { c__int_from_roman_ #1 _int }
- #2
- }
- {
- \int_if_exist:cF { c__int_from_roman_ #1 _int }
- { \__int_from_roman_clean_up:w }
- \int_if_exist:cF { c__int_from_roman_ #2 _int }
- { \__int_from_roman_clean_up:w }
- \int_compare:nNnTF
- { \use:c { c__int_from_roman_ #1 _int } }
- <
- { \use:c { c__int_from_roman_ #2 _int } }
- {
- + \use:c { c__int_from_roman_ #2 _int }
- - \use:c { c__int_from_roman_ #1 _int }
- \__int_from_roman:NN
- }
- {
- + \use:c { c__int_from_roman_ #1 _int }
- \__int_from_roman:NN #2
- }
- }
- }
- }
-\cs_new:Npn \__int_from_roman_end:w #1 Q #2 \q_stop
- { \tl_if_empty:nTF {#2} {#1} {#2} }
-\cs_new:Npn \__int_from_roman_clean_up:w #1 Q { + 0 Q -1 }
-\cs_new_eq:NN \int_show:N \__kernel_register_show:N
-\cs_new_eq:NN \int_show:c \__kernel_register_show:c
-\cs_new_protected:Npn \int_show:n #1
- { \etex_showtokens:D \exp_after:wN { \int_use:N \__int_eval:w #1 } }
-\int_const:Nn \c_one { 1 }
-\int_const:Nn \c_two { 2 }
-\int_const:Nn \c_three { 3 }
-\int_const:Nn \c_four { 4 }
-\int_const:Nn \c_five { 5 }
-\int_const:Nn \c_eight { 8 }
-\int_const:Nn \c_nine { 9 }
-\int_const:Nn \c_ten { 10 }
-\int_const:Nn \c_eleven { 11 }
-\int_const:Nn \c_thirteen { 13 }
-\int_const:Nn \c_fourteen { 14 }
-\int_const:Nn \c_fifteen { 15 }
-\int_const:Nn \c_thirty_two { 32 }
-\int_const:Nn \c_two_hundred_fifty_five { 255 }
-\int_const:Nn \c_two_hundred_fifty_six { 256 }
-\int_const:Nn \c_one_hundred { 100 }
-\int_const:Nn \c_one_thousand { 1000 }
-\int_const:Nn \c_ten_thousand { 10000 }
-\int_const:Nn \c_max_int { 2 147 483 647 }
-\int_new:N \l_tmpa_int
-\int_new:N \l_tmpb_int
-\int_new:N \g_tmpa_int
-\int_new:N \g_tmpb_int
-\cs_new_eq:NN \int_case:nnn \int_case:nnF
-%%
-%%
-%% End of file `l3int.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty b/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty
deleted file mode 100644
index 62baa8a027e..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3keys.sty
+++ /dev/null
@@ -1,818 +0,0 @@
-%%
-%% This is file `l3keys.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3keys.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3keys.dtx Copyright (C) 2006-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3keys.dtx 4614 2013-12-08 17:07:31Z joseph $
- {L3 Experimental key-value interfaces}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\int_new:N \g__keyval_level_int
-\tl_new:N \l__keyval_key_tl
-\tl_new:N \l__keyval_value_tl
-\tl_new:N \l__keyval_sanitise_tl
-\tl_new:N \l__keyval_parse_tl
-\group_begin:
- \char_set_catcode_active:n { `\= }
- \char_set_catcode_active:n { `\, }
- \char_set_lccode:nn { `\8 } { `\= }
- \char_set_lccode:nn { `\9 } { `\, }
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new_protected:Npn \__keyval_parse:n #1
- {
- \group_begin:
- \tl_clear:N \l__keyval_sanitise_tl
- \tl_set:Nn \l__keyval_sanitise_tl {#1}
- \tl_replace_all:Nnn \l__keyval_sanitise_tl { = } { 8 }
- \tl_replace_all:Nnn \l__keyval_sanitise_tl { , } { 9 }
- \tl_clear:N \l__keyval_parse_tl
- \exp_after:wN \__keyval_parse_elt:w \exp_after:wN
- \q_nil \l__keyval_sanitise_tl 9 \q_recursion_tail 9 \q_recursion_stop
- \exp_after:wN \group_end:
- \l__keyval_parse_tl
- }
- }
-\cs_new_protected:Npn \__keyval_parse_elt:w #1 ,
- {
- \tl_if_blank:oTF { \use_none:n #1 }
- { \__keyval_parse_elt:w \q_nil }
- {
- \quark_if_recursion_tail_stop:o { \use_ii:nn #1 }
- \__keyval_split_key_value:w #1 = = \q_stop
- \__keyval_parse_elt:w \q_nil
- }
- }
-\cs_new_protected:Npn \__keyval_split_key_value:w #1 = #2 \q_stop
- {
- \__keyval_split_key:n {#1}
- \str_if_eq:nnTF {#2} { = }
- {
- \tl_put_right:Nx \l__keyval_parse_tl
- {
- \exp_not:c
- { __keyval_key_no_value_elt_ \int_use:N \g__keyval_level_int :n }
- { \exp_not:o \l__keyval_key_tl }
- }
- }
- {
- \__keyval_split_key_value:wTF #2 \q_no_value \q_stop
- { \__keyval_split_value:w \q_nil #2 }
- { \__msg_kernel_error:nn { kernel } { misplaced-equals-sign } }
- }
- }
-\cs_new:Npn \__keyval_split_key_value:wTF #1 = #2#3 \q_stop
- { \tl_if_head_eq_meaning:nNTF {#3} \q_no_value }
-\cs_new_protected:Npn \__keyval_split_key:n #1
- {
- \quark_if_nil:oTF { \use_none:nnn #1 \q_nil \q_nil }
- { \tl_set:Nx \l__keyval_key_tl { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
- { \__keyval_split_key:w #1 \q_stop }
- }
-\cs_new_protected:Npn \__keyval_split_key:w \q_nil #1 \q_stop
- { \tl_set:Nx \l__keyval_key_tl { \tl_trim_spaces:n {#1} } }
-\cs_new_protected:Npn \__keyval_split_value:w #1 = =
- {
- \tl_put_right:Nx \l__keyval_parse_tl
- {
- \exp_not:c
- { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn }
- { \exp_not:o \l__keyval_key_tl }
- }
- \tl_set:Nx \l__keyval_value_tl
- { \exp_not:o { \use_none:nnn #1 \q_nil \q_nil } }
- \tl_if_empty:NTF \l__keyval_value_tl
- { \tl_put_right:Nn \l__keyval_parse_tl { { } } }
- {
- \quark_if_nil:NTF \l__keyval_value_tl
- {
- \tl_put_right:Nx \l__keyval_parse_tl
- { { \exp_not:o { \use_ii:nnn #1 \q_nil } } }
- }
- { \__keyval_split_value_aux:w #1 \q_stop }
- }
- }
-\cs_new_protected:Npn \__keyval_split_value_aux:w \q_nil #1 \q_stop
- {
- \tl_set:Nx \l__keyval_value_tl { \tl_trim_spaces:n {#1} }
- \tl_put_right:Nx \l__keyval_parse_tl
- { { \exp_not:o \l__keyval_value_tl } }
- }
-\cs_new_protected:Npn \keyval_parse:NNn #1#2#3
- {
- \int_gincr:N \g__keyval_level_int
- \cs_gset_eq:cN
- { __keyval_key_no_value_elt_ \int_use:N \g__keyval_level_int :n } #1
- \cs_gset_eq:cN
- { __keyval_key_value_elt_ \int_use:N \g__keyval_level_int :nn } #2
- \__keyval_parse:n {#3}
- \int_gdecr:N \g__keyval_level_int
- }
-\__msg_kernel_new:nnnn { kernel } { misplaced-equals-sign }
- { Misplaced~equals~sign~in~key-value~input~\msg_line_number: }
- {
- LaTeX~is~attempting~to~parse~some~key-value~input~but~found~
- two~equals~signs~not~separated~by~a~comma.
- }
-\tl_const:Nn \c__keys_code_root_tl { key~code~>~ }
-\tl_const:Nn \c__keys_info_root_tl { key~info~>~ }
-\tl_const:Nn \c__keys_props_root_tl { key~prop~>~ }
-\int_new:N \l_keys_choice_int
-\tl_new:N \l_keys_choice_tl
-\clist_new:N \l__keys_groups_clist
-\tl_new:N \l_keys_key_tl
-\tl_new:N \l__keys_module_tl
-\bool_new:N \l__keys_no_value_bool
-\bool_new:N \l__keys_only_known_bool
-\tl_new:N \l_keys_path_tl
-\tl_new:N \l__keys_property_tl
-\bool_new:N \l__keys_selective_bool
-\bool_new:N \l__keys_filtered_bool
-\seq_new:N \l__keys_selective_seq
-\tl_new:N \l__keys_unused_clist
-\tl_new:N \l_keys_value_tl
-\bool_new:N \l__keys_tmp_bool
-\cs_new_protected:Npn \keys_define:nn
- { \__keys_define:onn \l__keys_module_tl }
-\cs_new_protected:Npn \__keys_define:nnn #1#2#3
- {
- \tl_set:Nx \l__keys_module_tl { \tl_to_str:n {#2} }
- \keyval_parse:NNn \__keys_define_elt:n \__keys_define_elt:nn {#3}
- \tl_set:Nn \l__keys_module_tl {#1}
- }
-\cs_generate_variant:Nn \__keys_define:nnn { o }
-\cs_new_protected:Npn \__keys_define_elt:n #1
- {
- \bool_set_true:N \l__keys_no_value_bool
- \__keys_define_elt_aux:nn {#1} { }
- }
-\cs_new_protected:Npn \__keys_define_elt:nn #1#2
- {
- \bool_set_false:N \l__keys_no_value_bool
- \__keys_define_elt_aux:nn {#1} {#2}
- }
-\cs_new_protected:Npn \__keys_define_elt_aux:nn #1#2
- {
- \__keys_property_find:n {#1}
- \cs_if_exist:cTF { \c__keys_props_root_tl \l__keys_property_tl }
- { \__keys_define_key:n {#2} }
- {
- \str_if_eq_x:nnF { \l__keys_property_tl } { .abort: }
- {
- \__msg_kernel_error:nnxx { kernel } { property-unknown }
- { \l__keys_property_tl } { \l_keys_path_tl }
- }
- }
- }
-\cs_new_protected:Npn \__keys_property_find:n #1
- {
- \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / }
- \tl_if_in:nnTF {#1} { . }
- { \__keys_property_find:w #1 \q_stop }
- {
- \__msg_kernel_error:nnx { kernel } { key-no-property } {#1}
- \tl_set:Nn \l__keys_property_tl { .abort: }
- }
- }
-\cs_new_protected:Npn \__keys_property_find:w #1 . #2 \q_stop
- {
- \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl \tl_to_str:n {#1} }
- \tl_if_in:nnTF {#2} { . }
- {
- \tl_set:Nx \l_keys_path_tl { \l_keys_path_tl . }
- \__keys_property_find:w #2 \q_stop
- }
- { \tl_set:Nn \l__keys_property_tl { . #2 } }
- }
-\cs_new_protected:Npn \__keys_define_key:n #1
- {
- \bool_if:NTF \l__keys_no_value_bool
- {
- \exp_after:wN \__keys_define_key:w
- \l__keys_property_tl \q_stop
- { \use:c { \c__keys_props_root_tl \l__keys_property_tl } }
- {
- \__msg_kernel_error:nnxx { kernel }
- { property-requires-value } { \l__keys_property_tl }
- { \l_keys_path_tl }
- }
- }
- { \use:c { \c__keys_props_root_tl \l__keys_property_tl } {#1} }
- }
-\cs_new_protected:Npn \__keys_define_key:w #1 : #2 \q_stop
- { \tl_if_empty:nTF {#2} }
-\cs_new_protected:Npn \__keys_bool_set:Nn #1#2
- {
- \bool_if_exist:NF #1 { \bool_new:N #1 }
- \__keys_choice_make:
- \__keys_cmd_set:nx { \l_keys_path_tl / true }
- { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 }
- \__keys_cmd_set:nx { \l_keys_path_tl / false }
- { \exp_not:c { bool_ #2 set_false:N } \exp_not:N #1 }
- \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
- {
- \__msg_kernel_error:nnx { kernel } { boolean-values-only }
- { \l_keys_key_tl }
- }
- \__keys_default_set:n { true }
- }
-\cs_generate_variant:Nn \__keys_bool_set:Nn { c }
-\cs_new_protected:Npn \__keys_bool_set_inverse:Nn #1#2
- {
- \bool_if_exist:NF #1 { \bool_new:N #1 }
- \__keys_choice_make:
- \__keys_cmd_set:nx { \l_keys_path_tl / true }
- { \exp_not:c { bool_ #2 set_false:N } \exp_not:N #1 }
- \__keys_cmd_set:nx { \l_keys_path_tl / false }
- { \exp_not:c { bool_ #2 set_true:N } \exp_not:N #1 }
- \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
- {
- \__msg_kernel_error:nnx { kernel } { boolean-values-only }
- { \l_keys_key_tl }
- }
- \__keys_default_set:n { true }
- }
-\cs_generate_variant:Nn \__keys_bool_set_inverse:Nn { c }
-\cs_new_protected_nopar:Npn \__keys_choice_make:
- {
- \__keys_cmd_set:nn { \l_keys_path_tl }
- { \__keys_choice_find:n {##1} }
- \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
- {
- \__msg_kernel_error:nnxx { kernel } { key-choice-unknown }
- { \l_keys_path_tl } {##1}
- }
- }
-\cs_new_protected:Npn \__keys_choices_make:nn #1#2
- {
- \__keys_choice_make:
- \int_zero:N \l_keys_choice_int
- \clist_map_inline:nn {#1}
- {
- \int_incr:N \l_keys_choice_int
- \__keys_cmd_set:nx { \l_keys_path_tl / ##1 }
- {
- \tl_set:Nn \exp_not:N \l_keys_choice_tl {##1}
- \int_set:Nn \exp_not:N \l_keys_choice_int
- { \int_use:N \l_keys_choice_int }
- \exp_not:n {#2}
- }
- }
- }
-\cs_new_protected:Npn \__keys_cmd_set:nn #1#2
- {
- \prop_clear_new:c { \c__keys_info_root_tl #1 }
- \cs_set:cpn { \c__keys_code_root_tl #1 } ##1 {#2}
- }
-\cs_generate_variant:Nn \__keys_cmd_set:nn { nx , Vn , Vo }
-\cs_new_protected:Npn \__keys_default_set:n #1
- {
- \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
- { \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } { default } {#1} }
- }
-\cs_new_protected:Npn \__keys_groups_set:n #1
- {
- \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
- {
- \clist_set:Nn \l__keys_groups_clist {#1}
- \prop_put:cnV { \c__keys_info_root_tl \l_keys_path_tl }
- { groups } \l__keys_groups_clist
- }
- }
-\cs_new_protected:Npn \__keys_initialise:n #1
- { \exp_after:wN \__keys_initialise:wn \l_keys_path_tl \q_stop {#1} }
-\cs_new_protected:Npn \__keys_initialise:wn #1 / #2 \q_stop #3
- { \keys_set:nn {#1} { #2 = {#3} } }
-\cs_new_protected:Npn \__keys_meta_make:n #1
- {
- \__keys_cmd_set:Vo \l_keys_path_tl
- { \exp_after:wN \keys_set:nn \exp_after:wN { \l__keys_module_tl } {#1} }
- }
-\cs_new_protected:Npn \__keys_meta_make:nn #1#2
- { \__keys_cmd_set:Vn \l_keys_path_tl { \keys_set:nn {#1} {#2} } }
-\cs_new:Npn \__keys_multichoice_find:n #1
- { \clist_map_function:nN {#1} \__keys_choice_find:n }
-\cs_new_protected_nopar:Npn \__keys_multichoice_make:
- {
- \__keys_cmd_set:nn { \l_keys_path_tl }
- { \__keys_multichoice_find:n {##1} }
- \__keys_cmd_set:nn { \l_keys_path_tl / unknown }
- {
- \__msg_kernel_error:nnxx { kernel } { key-choice-unknown }
- { \l_keys_path_tl } {##1}
- }
- }
-\cs_new_protected:Npn \__keys_multichoices_make:nn #1#2
- {
- \__keys_multichoice_make:
- \int_zero:N \l_keys_choice_int
- \clist_map_inline:nn {#1}
- {
- \int_incr:N \l_keys_choice_int
- \__keys_cmd_set:nx { \l_keys_path_tl / ##1 }
- {
- \tl_set:Nn \exp_not:N \l_keys_choice_tl {##1}
- \int_set:Nn \exp_not:N \l_keys_choice_int
- { \int_use:N \l_keys_choice_int }
- \exp_not:n {#2}
- }
- }
- }
-\cs_new_protected:Npn \__keys_value_requirement:n #1
- {
- \prop_if_exist:cT { \c__keys_info_root_tl \l_keys_path_tl }
- {
- \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } { required }
- \prop_remove:cn { \c__keys_info_root_tl \l_keys_path_tl } { forbidden }
- \prop_put:cnn { \c__keys_info_root_tl \l_keys_path_tl } {#1} { true }
- }
- }
-\cs_new_protected:Npn \__keys_variable_set:NnnN #1#2#3#4
- {
- \use:c { #2_if_exist:NF } #1 { \use:c { #2 _new:N } #1 }
- \__keys_cmd_set:nx { \l_keys_path_tl }
- { \exp_not:c { #2 _ #3 set:N #4 } \exp_not:N #1 \exp_not:n { {##1} } }
- }
-\cs_generate_variant:Nn \__keys_variable_set:NnnN { c }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set:N } #1
- { \__keys_bool_set:Nn #1 { } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set:c } #1
- { \__keys_bool_set:cn {#1} { } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset:N } #1
- { \__keys_bool_set:Nn #1 { g } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset:c } #1
- { \__keys_bool_set:cn {#1} { g } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_inverse:N } #1
- { \__keys_bool_set_inverse:Nn #1 { } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_set_inverse:c } #1
- { \__keys_bool_set_inverse:cn {#1} { } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_inverse:N } #1
- { \__keys_bool_set_inverse:Nn #1 { g } }
-\cs_new_protected:cpn { \c__keys_props_root_tl .bool_gset_inverse:c } #1
- { \__keys_bool_set_inverse:cn {#1} { g } }
-\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .choice: }
- { \__keys_choice_make: }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choices:nn } #1
- { \__keys_choices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choices:Vn } #1
- { \exp_args:NV \__keys_choices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choices:on } #1
- { \exp_args:No \__keys_choices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choices:xn } #1
- { \exp_args:Nx \__keys_choices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .code:n } #1
- { \__keys_cmd_set:nn { \l_keys_path_tl } {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .clist_set:N } #1
- { \__keys_variable_set:NnnN #1 { clist } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .clist_set:c } #1
- { \__keys_variable_set:cnnN {#1} { clist } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .clist_gset:N } #1
- { \__keys_variable_set:NnnN #1 { clist } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .clist_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { clist } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .default:n } #1
- { \__keys_default_set:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .default:V } #1
- { \exp_args:NV \__keys_default_set:n #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .default:o } #1
- { \exp_args:No \__keys_default_set:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .default:x } #1
- { \exp_args:Nx \__keys_default_set:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .dim_set:N } #1
- { \__keys_variable_set:NnnN #1 { dim } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .dim_set:c } #1
- { \__keys_variable_set:cnnN {#1} { dim } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .dim_gset:N } #1
- { \__keys_variable_set:NnnN #1 { dim } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .dim_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { dim } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .fp_set:N } #1
- { \__keys_variable_set:NnnN #1 { fp } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .fp_set:c } #1
- { \__keys_variable_set:cnnN {#1} { fp } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .fp_gset:N } #1
- { \__keys_variable_set:NnnN #1 { fp } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .fp_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { fp } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .groups:n } #1
- { \__keys_groups_set:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .initial:n } #1
- { \__keys_initialise:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .initial:V } #1
- { \exp_args:NV \__keys_initialise:n #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .initial:o } #1
- { \exp_args:No \__keys_initialise:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .initial:x } #1
- { \exp_args:Nx \__keys_initialise:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .int_set:N } #1
- { \__keys_variable_set:NnnN #1 { int } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .int_set:c } #1
- { \__keys_variable_set:cnnN {#1} { int } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .int_gset:N } #1
- { \__keys_variable_set:NnnN #1 { int } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .int_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { int } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .meta:n } #1
- { \__keys_meta_make:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .meta:nn } #1
- { \__keys_meta_make:nn #1 }
-\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .multichoice: }
- { \__keys_multichoice_make: }
-\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:nn } #1
- { \__keys_multichoices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:Vn } #1
- { \exp_args:NV \__keys_multichoices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:on } #1
- { \exp_args:No \__keys_multichoices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .multichoices:xn } #1
- { \exp_args:Nx \__keys_multichoices_make:nn #1 }
-\cs_new_protected:cpn { \c__keys_props_root_tl .skip_set:N } #1
- { \__keys_variable_set:NnnN #1 { skip } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .skip_set:c } #1
- { \__keys_variable_set:cnnN {#1} { skip } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .skip_gset:N } #1
- { \__keys_variable_set:NnnN #1 { skip } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .skip_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { skip } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set:N } #1
- { \__keys_variable_set:NnnN #1 { tl } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set:c } #1
- { \__keys_variable_set:cnnN {#1} { tl } { } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set_x:N } #1
- { \__keys_variable_set:NnnN #1 { tl } { } x }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_set_x:c } #1
- { \__keys_variable_set:cnnN {#1} { tl } { } x }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset:N } #1
- { \__keys_variable_set:NnnN #1 { tl } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset:c } #1
- { \__keys_variable_set:cnnN {#1} { tl } { g } n }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset_x:N } #1
- { \__keys_variable_set:NnnN #1 { tl } { g } x }
-\cs_new_protected:cpn { \c__keys_props_root_tl .tl_gset_x:c } #1
- { \__keys_variable_set:cnnN {#1} { tl } { g } x }
-\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_forbidden: }
- { \__keys_value_requirement:n { forbidden } }
-\cs_new_protected_nopar:cpn { \c__keys_props_root_tl .value_required: }
- { \__keys_value_requirement:n { required } }
-\cs_new_protected_nopar:Npn \keys_set:nn
- { \__keys_set:onn { \l__keys_module_tl } }
-\cs_new_protected:Npn \__keys_set:nnn #1#2#3
- {
- \tl_set:Nx \l__keys_module_tl { \tl_to_str:n {#2} }
- \keyval_parse:NNn \__keys_set_elt:n \__keys_set_elt:nn {#3}
- \tl_set:Nn \l__keys_module_tl {#1}
- }
-\cs_generate_variant:Nn \keys_set:nn { nV , nv , no }
-\cs_generate_variant:Nn \__keys_set:nnn { o }
-\cs_new_protected:Npn \keys_set_known:nnN #1#2#3
- {
- \clist_clear:N \l__keys_unused_clist
- \keys_set_known:nn {#1} {#2}
- \tl_set:Nx #3 { \exp_not:o { \l__keys_unused_clist } }
- }
-\cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no }
-\cs_new_protected:Npn \keys_set_known:nn #1#2
- {
- \bool_set_true:N \l__keys_only_known_bool
- \keys_set:nn {#1} {#2}
- \bool_set_false:N \l__keys_only_known_bool
- }
-\cs_generate_variant:Nn \keys_set_known:nn { nV , nv , no }
-\cs_new_protected:Npn \keys_set_filter:nnnN #1#2#3#4
- {
- \clist_clear:N \l__keys_unused_clist
- \keys_set_filter:nnn {#1} {#2} {#3}
- \tl_set:Nx #4 { \exp_not:o { \l__keys_unused_clist } }
- }
-\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
-\cs_new_protected:Npn \keys_set_filter:nnn #1#2#3
- {
- \bool_set_true:N \l__keys_selective_bool
- \bool_set_true:N \l__keys_filtered_bool
- \seq_set_from_clist:Nn \l__keys_selective_seq {#2}
- \keys_set:nn {#1} {#3}
- \bool_set_false:N \l__keys_selective_bool
- }
-\cs_generate_variant:Nn \keys_set_filter:nnn { nnV , nnv , nno }
-\cs_new_protected:Npn \keys_set_groups:nnn #1#2#3
- {
- \bool_set_true:N \l__keys_selective_bool
- \bool_set_false:N \l__keys_filtered_bool
- \seq_set_from_clist:Nn \l__keys_selective_seq {#2}
- \keys_set:nn {#1} {#3}
- \bool_set_false:N \l__keys_selective_bool
- }
-\cs_generate_variant:Nn \keys_set_groups:nnn { nnV , nnv , nno }
-\cs_new_protected:Npn \__keys_set_elt:n #1
- {
- \bool_set_true:N \l__keys_no_value_bool
- \__keys_set_elt_aux:nn {#1} { }
- }
-\cs_new_protected:Npn \__keys_set_elt:nn #1#2
- {
- \bool_set_false:N \l__keys_no_value_bool
- \__keys_set_elt_aux:nn {#1} {#2}
- }
-\cs_new_protected:Npn \__keys_set_elt_aux:nn #1#2
- {
- \tl_set:Nx \l_keys_key_tl { \tl_to_str:n {#1} }
- \tl_set:Nx \l_keys_path_tl { \l__keys_module_tl / \l_keys_key_tl }
- \__keys_value_or_default:n {#2}
- \bool_if:NTF \l__keys_selective_bool
- { \__keys_set_elt_selective: }
- { \__keys_set_elt_aux: }
- }
-\cs_new_protected_nopar:Npn \__keys_set_elt_aux:
- {
- \bool_if:nTF
- {
- \__keys_if_value_p:n { required } &&
- \l__keys_no_value_bool
- }
- {
- \__msg_kernel_error:nnx { kernel } { value-required }
- { \l_keys_path_tl }
- }
- {
- \bool_if:nTF
- {
- \__keys_if_value_p:n { forbidden } &&
- ! \l__keys_no_value_bool
- }
- {
- \__msg_kernel_error:nnxx { kernel } { value-forbidden }
- { \l_keys_path_tl } { \l_keys_value_tl }
- }
- { \__keys_execute: }
- }
- }
-\cs_new_protected_nopar:Npn \__keys_set_elt_selective:
- {
- \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl }
- {
- \prop_get:cnNTF { \c__keys_info_root_tl \l_keys_path_tl }
- { groups } \l__keys_groups_clist
- { \__keys_check_groups: }
- {
- \bool_if:NTF \l__keys_filtered_bool
- { \__keys_set_elt_aux: }
- { \__keys_store_unused: }
- }
- }
- {
- \bool_if:NTF \l__keys_filtered_bool
- { \__keys_set_elt_aux: }
- { \__keys_store_unused: }
- }
- }
-\cs_new_protected_nopar:Npn \__keys_check_groups:
- {
- \bool_set_false:N \l__keys_tmp_bool
- \seq_map_inline:Nn \l__keys_selective_seq
- {
- \clist_map_inline:Nn \l__keys_groups_clist
- {
- \str_if_eq:nnT {##1} {####1}
- {
- \bool_set_true:N \l__keys_tmp_bool
- \clist_map_break:n { \seq_map_break: }
- }
- }
- }
- \bool_if:NTF \l__keys_tmp_bool
- {
- \bool_if:NTF \l__keys_filtered_bool
- { \__keys_store_unused: }
- { \__keys_set_elt_aux: }
- }
- {
- \bool_if:NTF \l__keys_filtered_bool
- { \__keys_set_elt_aux: }
- { \__keys_store_unused: }
- }
- }
-\cs_new_protected:Npn \__keys_value_or_default:n #1
- {
- \bool_if:NTF \l__keys_no_value_bool
- {
- \prop_get:cnNF { \c__keys_info_root_tl \l_keys_path_tl }
- { default } \l_keys_value_tl
- { \tl_clear:N \l_keys_value_tl }
- }
- { \tl_set:Nn \l_keys_value_tl {#1} }
- }
-\prg_new_conditional:Npnn \__keys_if_value:n #1 { p }
- {
- \prop_if_exist:cTF { \c__keys_info_root_tl \l_keys_path_tl }
- {
- \prop_if_in:cnTF { \c__keys_info_root_tl \l_keys_path_tl } {#1}
- { \prg_return_true: }
- { \prg_return_false: }
- }
- { \prg_return_false: }
- }
-\cs_new_protected_nopar:Npn \__keys_execute:
- { \__keys_execute:nn { \l_keys_path_tl } { \__keys_execute_unknown: } }
-\cs_new_protected_nopar:Npn \__keys_execute_unknown:
- {
- \bool_if:NTF \l__keys_only_known_bool
- { \__keys_store_unused: }
- {
- \__keys_execute:nn { \l__keys_module_tl / unknown }
- {
- \__msg_kernel_error:nnxx { kernel } { key-unknown }
- { \l_keys_path_tl } { \l__keys_module_tl }
- }
- }
- }
-\cs_new:Npn \__keys_execute:nn #1#2
- {
- \cs_if_exist:cTF { \c__keys_code_root_tl #1 }
- {
- \exp_args:Nc \exp_args:No { \c__keys_code_root_tl #1 }
- \l_keys_value_tl
- }
- {#2}
- }
-\cs_new_protected_nopar:Npn \__keys_store_unused:
- {
- \clist_put_right:Nx \l__keys_unused_clist
- {
- \exp_not:o \l_keys_key_tl
- \bool_if:NF \l__keys_no_value_bool
- { = { \exp_not:o \l_keys_value_tl } }
- }
- }
-\cs_new:Npn \__keys_choice_find:n #1
- {
- \__keys_execute:nn { \l_keys_path_tl / \tl_to_str:n {#1} }
- { \__keys_execute:nn { \l_keys_path_tl / unknown } { } }
- }
-\prg_new_conditional:Npnn \keys_if_exist:nn #1#2 { p , T , F , TF }
- {
- \cs_if_exist:cTF { \c__keys_code_root_tl #1 / #2 }
- { \prg_return_true: }
- { \prg_return_false: }
- }
-\prg_new_conditional:Npnn \keys_if_choice_exist:nnn #1#2#3 { p , T , F , TF }
- {
- \cs_if_exist:cTF { \c__keys_code_root_tl #1 / #2 / #3 }
- { \prg_return_true: }
- { \prg_return_false: }
- }
-\cs_new_protected:Npn \keys_show:nn #1#2
- { \cs_show:c { \c__keys_code_root_tl #1 / \tl_to_str:n {#2} } }
-\__msg_kernel_new:nnnn { kernel } { boolean-values-only }
- { Key~'#1'~accepts~boolean~values~only. }
- { The~key~'#1'~only~accepts~the~values~'true'~and~'false'. }
-\__msg_kernel_new:nnnn { kernel } { choice-unknown }
- { Choice~'#2'~unknown~for~key~'#1'. }
- {
- The~key~'#1'~takes~a~limited~number~of~values.\\
- The~input~given,~'#2',~is~not~on~the~list~accepted.
- }
-\__msg_kernel_new:nnnn { kernel } { key-choice-unknown }
- { Key~'#1'~accepts~only~a~fixed~set~of~choices. }
- {
- The~key~'#1'~only~accepts~predefined~values,~and~'#2'~is~not~one~of~these.
- }
-\__msg_kernel_new:nnnn { kernel } { key-no-property }
- { No~property~given~in~definition~of~key~'#1'. }
- {
- \c_msg_coding_error_text_tl
- Inside~\keys_define:nn each~key~name~
- needs~a~property: \\ \\
- \iow_indent:n { #1 .<property> } \\ \\
- LaTeX~did~not~find~a~'.'~to~indicate~the~start~of~a~property.
- }
-\__msg_kernel_new:nnnn { kernel } { key-unknown }
- { The~key~'#1'~is~unknown~and~is~being~ignored. }
- {
- The~module~'#2'~does~not~have~a~key~called~#1'.\\
- Check~that~you~have~spelled~the~key~name~correctly.
- }
-\__msg_kernel_new:nnnn { kernel } { property-requires-value }
- { The~property~'#1'~requires~a~value. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~was~asked~to~set~property~'#1'~for~key~'#2'.\\
- No~value~was~given~for~the~property,~and~one~is~required.
- }
-\__msg_kernel_new:nnnn { kernel } { property-unknown }
- { The~key~property~'#1'~is~unknown. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~set~the~property~'#1'~for~key~'#2':~
- this~property~is~not~defined.
- }
-\__msg_kernel_new:nnnn { kernel } { value-forbidden }
- { The~key~'#1'~does~not~taken~a~value. }
- {
- The~key~'#1'~should~be~given~without~a~value.\\
- LaTeX~will~ignore~the~given~value~'#2'.
- }
-\__msg_kernel_new:nnnn { kernel } { value-required }
- { The~key~'#1'~requires~a~value. }
- {
- The~key~'#1'~must~have~a~value.\\
- No~value~was~present:~the~key~will~be~ignored.
- }
-\cs_new_protected:Npn \__keys_choice_code_store:n #1
- {
- \cs_if_exist:cF
- { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
- {
- \tl_new:c
- { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
- }
- \tl_set:cn { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
- {#1}
- }
-\cs_generate_variant:Nn \__keys_choice_code_store:n { x }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choice_code:n } #1
- { \__keys_choice_code_store:n {#1} }
-\cs_new_protected:cpn { \c__keys_props_root_tl .choice_code:x } #1
- { \__keys_choice_code_store:x {#1} }
-\cs_new_protected:Npn \__keys_choices_generate:n #1
- {
- \cs_if_exist:cTF
- { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
- {
- \__keys_choice_make:
- \int_zero:N \l_keys_choice_int
- \clist_map_function:nN {#1} \__keys_choices_generate_aux:n
- }
- {
- \__msg_kernel_error:nnx { kernel }
- { generate-choices-before-code } { \l_keys_path_tl }
- }
- }
-\cs_new_protected:Npn \__keys_choices_generate_aux:n #1
- {
- \int_incr:N \l_keys_choice_int
- \__keys_cmd_set:nx { \l_keys_path_tl / #1 }
- {
- \tl_set:Nn \exp_not:N \l_keys_choice_tl {#1}
- \int_set:Nn \exp_not:N \l_keys_choice_int
- { \int_use:N \l_keys_choice_int }
- \exp_not:v
- { \c__keys_info_root_tl \l_keys_path_tl .choice~code }
- }
- }
-\__msg_kernel_new:nnnn { kernel } { generate-choices-before-code }
- { No~code~available~to~generate~choices~for~key~'#1'. }
- {
- \c_msg_coding_error_text_tl
- Before~using~.generate_choices:n~the~code~should~be~defined~
- with~'.choice_code:n'~or~'.choice_code:x'.
- }
-\cs_new_protected:cpn { \c__keys_props_root_tl .generate_choices:n } #1
- { \__keys_choices_generate:n {#1} }
-%%
-%%
-%% End of file `l3keys.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty b/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty
deleted file mode 100644
index 74d3875a445..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3luatex.sty
+++ /dev/null
@@ -1,190 +0,0 @@
-%%
-%% This is file `l3luatex.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3luatex.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3luatex.dtx Copyright (C) 2010-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3luatex.dtx 4581 2013-07-28 08:38:50Z joseph $
- {L3 Experimental LuaTeX-specific functions}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\luatex_if_engine:TF
- {
- \cs_new_eq:NN \lua_now_x:n \luatex_directlua:D
- \cs_new_eq:NN \lua_shipout_x:n \luatex_latelua:D
- }
- {
- \cs_new:Npn \lua_now_x:n #1
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { bad-engine } { \lua_now_x:n }
- }
- \cs_new_protected:Npn \lua_shipout_x:n #1
- {
- \__msg_kernel_expandable_error:nnn
- { kernel } { bad-engine } { \lua_shipout_x:n }
- }
- }
-\cs_generate_variant:Nn \lua_now_x:n { x }
-\cs_new:Npn \lua_now:n #1
- { \lua_now_x:n { \exp_not:n {#1} } }
-\cs_generate_variant:Nn \lua_now:n { x }
-\cs_generate_variant:Nn \lua_shipout_x:n { x }
-\cs_new_protected:Npn \lua_shipout:n #1
- { \lua_shipout_x:n { \exp_not:n {#1} } }
-\cs_generate_variant:Nn \lua_shipout:n { x }
-\int_new:N \g__cctab_allocate_int
-\int_set:Nn \g__cctab_allocate_int { \c_minus_one }
-\int_new:N \g__cctab_stack_int
-\seq_new:N \g__cctab_stack_seq
-\cs_new_protected:Npn \cctab_new:N #1
- {
- \__chk_if_free_cs:N #1
- \int_gadd:Nn \g__cctab_allocate_int { \c_two }
- \int_compare:nNnTF
- \g__cctab_allocate_int < { \c_max_register_int + \c_one }
- {
- \tex_global:D \tex_chardef:D #1 \g__cctab_allocate_int
- \luatex_initcatcodetable:D #1
- }
- { \__msg_kernel_fatal:nnx { kernel } { out-of-registers } { cctab } }
- }
-\luatex_if_engine:F
- {
- \cs_set_protected:Npn \cctab_new:N #1
- {
- \__msg_kernel_error:nnx { kernel } { bad-engine }
- { \exp_not:N \cctab_new:N }
- }
- }
-\luatex_if_engine:T
- {
- \cs_set_protected:Npn \cctab_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newcatcodetable #1
- \luatex_initcatcodetable:D #1
- }
- }
-\cs_new_protected:Npn \cctab_begin:N #1
- {
- \seq_gpush:Nx \g__cctab_stack_seq { \tex_the:D \luatex_catcodetable:D }
- \luatex_catcodetable:D #1
- \int_gadd:Nn \g__cctab_stack_int { \c_two }
- \int_compare:nNnT \g__cctab_stack_int > \c_max_register_int
- { \__msg_kernel_fatal:nn { kernel } { cctab-stack-full } }
- \luatex_savecatcodetable:D \g__cctab_stack_int
- \luatex_catcodetable:D \g__cctab_stack_int
- }
-\cs_new_protected_nopar:Npn \cctab_end:
- {
- \int_gsub:Nn \g__cctab_stack_int { \c_two }
- \seq_if_empty:NTF \g__cctab_stack_seq
- { \tl_set:Nn \l__cctab_internal_tl { 0 } }
- { \seq_gpop:NN \g__cctab_stack_seq \l__cctab_internal_tl }
- \luatex_catcodetable:D \l__cctab_internal_tl \scan_stop:
- }
-\luatex_if_engine:F
- {
- \cs_set_protected:Npn \cctab_begin:N #1
- {
- \__msg_kernel_error:nnxx { kernel } { bad-engine }
- { \exp_not:N \cctab_begin:N } {#1}
- }
- \cs_set_protected_nopar:Npn \cctab_end:
- {
- \__msg_kernel_error:nnx { kernel } { bad-engine }
- { \exp_not:N \cctab_end: }
- }
- }
-\luatex_if_engine:T
- {
- \cs_set_protected:Npn \cctab_begin:N #1 { \BeginCatcodeRegime #1 }
- \cs_set_protected_nopar:Npn \cctab_end: { \EndCatcodeRegime }
- }
-\tl_new:N \l__cctab_internal_tl
-\cs_new_protected:Npn \cctab_gset:Nn #1#2
- {
- \group_begin:
- #2
- \luatex_savecatcodetable:D #1
- \group_end:
- }
-\luatex_if_engine:F
- {
- \cs_set_protected:Npn \cctab_gset:Nn #1#2
- {
- \__msg_kernel_error:nnxx { kernel } { bad-engine }
- { \exp_not:N \cctab_gset:Nn } { #1 {#2} }
- }
- }
-\luatex_if_engine:T
- {
- \cctab_new:N \c_code_cctab
- \cctab_gset:Nn \c_code_cctab { }
- }
-\luatex_if_engine:T
- {
- \cs_new_eq:NN \c_document_cctab \CatcodeTableLaTeX
- \cs_new_eq:NN \c_initex_cctab \CatcodeTableIniTeX
- \cs_new_eq:NN \c_other_cctab \CatcodeTableOther
- \cs_new_eq:NN \c_str_cctab \CatcodeTableString
- }
-\__msg_kernel_new:nnnn { kernel } { bad-engine }
- { LuaTeX~engine~not~in~use!~Ignoring~#1. }
- {
- The~feature~you~are~using~is~only~available~
- with~the~LuaTeX~engine.~LaTeX3~ignored~`#1#2'.
- }
-\__msg_kernel_new:nnnn { kernel } { cctab-stack-full }
- { The~category~code~table~stack~is~exhausted. }
- {
- LaTeX~has~been~asked~to~switch~to~a~new~category~code~table,~
- but~there~is~no~more~space~to~do~this!
- }
-%%
-%%
-%% End of file `l3luatex.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty
deleted file mode 100644
index fd4541915c4..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty
+++ /dev/null
@@ -1,783 +0,0 @@
-%%
-%% This is file `l3msg.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3msg.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3msg.dtx Copyright (C) 2009-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3msg.dtx 4581 2013-07-28 08:38:50Z joseph $
- {L3 Messages}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\tl_new:N \l__msg_internal_tl
-\tl_const:Nn \c__msg_text_prefix_tl { msg~text~>~ }
-\tl_const:Nn \c__msg_more_text_prefix_tl { msg~extra~text~>~ }
-\prg_new_conditional:Npnn \msg_if_exist:nn #1#2 { p , T , F , TF }
- {
- \cs_if_exist:cTF { \c__msg_text_prefix_tl #1 / #2 }
- { \prg_return_true: } { \prg_return_false: }
- }
-\cs_new_protected:Npn \__chk_if_free_msg:nn #1#2
- {
- \msg_if_exist:nnT {#1} {#2}
- {
- \__msg_kernel_error:nnxx { kernel } { message-already-defined }
- {#1} {#2}
- }
- }
-\tex_ifodd:D \l@expl@log@functions@bool
- \cs_gset_protected:Npn \__chk_if_free_msg:nn #1#2
- {
- \msg_if_exist:nnT {#1} {#2}
- {
- \__msg_kernel_error:nnxx { kernel } { message-already-defined }
- {#1} {#2}
- }
- \iow_log:x { Defining~message~ #1 / #2 ~\msg_line_context: }
- }
-\fi:
-\cs_new_protected:Npn \msg_new:nnnn #1#2
- {
- \__chk_if_free_msg:nn {#1} {#2}
- \msg_gset:nnnn {#1} {#2}
- }
-\cs_new_protected:Npn \msg_new:nnn #1#2#3
- { \msg_new:nnnn {#1} {#2} {#3} { } }
-\cs_new_protected:Npn \msg_set:nnnn #1#2#3#4
- {
- \cs_set:cpn { \c__msg_text_prefix_tl #1 / #2 }
- ##1##2##3##4 {#3}
- \cs_set:cpn { \c__msg_more_text_prefix_tl #1 / #2 }
- ##1##2##3##4 {#4}
- }
-\cs_new_protected:Npn \msg_set:nnn #1#2#3
- { \msg_set:nnnn {#1} {#2} {#3} { } }
-\cs_new_protected:Npn \msg_gset:nnnn #1#2#3#4
- {
- \cs_gset:cpn { \c__msg_text_prefix_tl #1 / #2 }
- ##1##2##3##4 {#3}
- \cs_gset:cpn { \c__msg_more_text_prefix_tl #1 / #2 }
- ##1##2##3##4 {#4}
- }
-\cs_new_protected:Npn \msg_gset:nnn #1#2#3
- { \msg_gset:nnnn {#1} {#2} {#3} { } }
-\tl_const:Nn \c_msg_coding_error_text_tl
- {
- This~is~a~coding~error.
- \\ \\
- }
-\tl_const:Nn \c_msg_continue_text_tl
- { Type~<return>~to~continue }
-\tl_const:Nn \c_msg_critical_text_tl
- { Reading~the~current~file~will~stop }
-\tl_const:Nn \c_msg_fatal_text_tl
- { This~is~a~fatal~error:~LaTeX~will~abort }
-\tl_const:Nn \c_msg_help_text_tl
- { For~immediate~help~type~H~<return> }
-\tl_const:Nn \c_msg_no_info_text_tl
- {
- LaTeX~does~not~know~anything~more~about~this~error,~sorry.
- \c_msg_return_text_tl
- }
-\tl_const:Nn \c_msg_on_line_text_tl { on~line }
-\tl_const:Nn \c_msg_return_text_tl
- {
- \\ \\
- Try~typing~<return>~to~proceed.
- \\
- If~that~doesn't~work,~type~X~<return>~to~quit.
- }
-\tl_const:Nn \c_msg_trouble_text_tl
- {
- \\ \\
- More~errors~will~almost~certainly~follow: \\
- the~LaTeX~run~should~be~aborted.
- }
-\cs_new_nopar:Npn \msg_line_number: { \int_use:N \tex_inputlineno:D }
-\cs_gset_nopar:Npn \msg_line_context:
- {
- \c_msg_on_line_text_tl
- \c_space_tl
- \msg_line_number:
- }
-\cs_new_protected:Npn \msg_interrupt:nnn #1#2#3
- {
- \tl_if_empty:nTF {#3}
- {
- \__msg_interrupt_wrap:nn { \\ \c_msg_no_info_text_tl }
- {#1 \\\\ #2 \\\\ \c_msg_continue_text_tl }
- }
- {
- \__msg_interrupt_wrap:nn { \\ #3 }
- {#1 \\\\ #2 \\\\ \c_msg_help_text_tl }
- }
- }
-\cs_new_protected:Npn \__msg_interrupt_wrap:nn #1#2
- {
- \iow_wrap:nnnN {#1} { | ~ } { } \__msg_interrupt_more_text:n
- \iow_wrap:nnnN {#2} { ! ~ } { } \__msg_interrupt_text:n
- }
-\cs_new_protected:Npn \__msg_interrupt_more_text:n #1
- {
- \exp_args:Nx \tex_errhelp:D
- {
- |'''''''''''''''''''''''''''''''''''''''''''''''
- #1 \iow_newline:
- |...............................................
- }
- }
-\group_begin:
- \char_set_lccode:nn {`\{} {`\ }
- \char_set_lccode:nn {`\}} {`\ }
- \char_set_lccode:nn {`\&} {`\!}
- \char_set_catcode_active:N \&
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new_protected:Npn \__msg_interrupt_text:n #1
- {
- \iow_term:x
- {
- \iow_newline:
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- \iow_newline:
- !
- }
- \group_begin:
- \cs_set_protected_nopar:Npn &
- {
- \tex_errmessage:D
- {
- #1
- \use_none:n
- { ............................................ }
- }
- }
- \exp_after:wN
- \group_end:
- &
- }
- }
-\cs_new_protected:Npn \msg_log:n #1
- {
- \iow_log:n { ................................................. }
- \iow_wrap:nnnN { . ~ #1} { . ~ } { } \iow_log:n
- \iow_log:n { ................................................. }
- }
-\cs_new_protected:Npn \msg_term:n #1
- {
- \iow_term:n { ************************************************* }
- \iow_wrap:nnnN { * ~ #1} { * ~ } { } \iow_term:n
- \iow_term:n { ************************************************* }
- }
-\cs_new:Npn \msg_fatal_text:n #1 { Fatal~#1~error }
-\cs_new:Npn \msg_critical_text:n #1 { Critical~#1~error }
-\cs_new:Npn \msg_error_text:n #1 { #1~error }
-\cs_new:Npn \msg_warning_text:n #1 { #1~warning }
-\cs_new:Npn \msg_info_text:n #1 { #1~info }
-\cs_new:Npn \msg_see_documentation_text:n #1
- {
- \\ \\ See~the~
- \str_if_eq:nnTF {#1} { LaTeX } { LaTeX3 } {#1} ~
- documentation~for~further~information.
- }
-\group_begin:
- \cs_set_protected:Npn \__msg_class_new:nn #1#2
- {
- \prop_new:c { l__msg_redirect_ #1 _prop }
- \cs_new_protected:cpn { __msg_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2}
- \cs_new_protected:cpn { msg_ #1 :nnnnnn } ##1##2##3##4##5##6
- {
- \use:x
- {
- \exp_not:n { \__msg_use:nnnnnnn {#1} {##1} {##2} }
- { \tl_to_str:n {##3} } { \tl_to_str:n {##4} }
- { \tl_to_str:n {##5} } { \tl_to_str:n {##6} }
- }
- }
- \cs_new_protected:cpx { msg_ #1 :nnnnn } ##1##2##3##4##5
- { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } }
- \cs_new_protected:cpx { msg_ #1 :nnnn } ##1##2##3##4
- { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } }
- \cs_new_protected:cpx { msg_ #1 :nnn } ##1##2##3
- { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } }
- \cs_new_protected:cpx { msg_ #1 :nn } ##1##2
- { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } }
- \cs_new_protected:cpx { msg_ #1 :nnxxxx } ##1##2##3##4##5##6
- {
- \use:x
- {
- \exp_not:N \exp_not:n
- { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} }
- {##3} {##4} {##5} {##6}
- }
- }
- \cs_new_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5
- { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } }
- \cs_new_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4
- { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } }
- \cs_new_protected:cpx { msg_ #1 :nnx } ##1##2##3
- { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } }
- }
- \__msg_class_new:nn { fatal }
- {
- \msg_interrupt:nnn
- { \msg_fatal_text:n {#1} : ~ "#2" }
- {
- \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
- \msg_see_documentation_text:n {#1}
- }
- { \c_msg_fatal_text_tl }
- \tex_end:D
- }
- \__msg_class_new:nn { critical }
- {
- \msg_interrupt:nnn
- { \msg_critical_text:n {#1} : ~ "#2" }
- {
- \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
- \msg_see_documentation_text:n {#1}
- }
- { \c_msg_critical_text_tl }
- \tex_endinput:D
- }
- \__msg_class_new:nn { error }
- {
- \__msg_error:cnnnnn
- { \c__msg_more_text_prefix_tl #1 / #2 }
- {#3} {#4} {#5} {#6}
- {
- \msg_interrupt:nnn
- { \msg_error_text:n {#1} : ~ "#2" }
- {
- \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
- \msg_see_documentation_text:n {#1}
- }
- }
- }
- \cs_new_protected:Npn \__msg_error:cnnnnn #1#2#3#4#5#6
- {
- \cs_if_eq:cNTF {#1} \__msg_no_more_text:nnnn
- { #6 { } }
- { #6 { \use:c {#1} {#2} {#3} {#4} {#5} } }
- }
- \cs_new:Npn \__msg_no_more_text:nnnn #1#2#3#4 { }
- \__msg_class_new:nn { warning }
- {
- \msg_term:n
- {
- \msg_warning_text:n {#1} : ~ "#2" \\ \\
- \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
- }
- }
- \__msg_class_new:nn { info }
- {
- \msg_log:n
- {
- \msg_info_text:n {#1} : ~ "#2" \\ \\
- \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6}
- }
- }
- \__msg_class_new:nn { log }
- {
- \iow_wrap:nnnN
- { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
- { } { } \iow_log:n
- }
- \__msg_class_new:nn { none } { }
-\group_end:
-\cs_new:Npn \__msg_class_chk_exist:nT #1
- {
- \cs_if_free:cTF { __msg_ #1 _code:nnnnnn }
- { \__msg_kernel_error:nnx { kernel } { message-class-unknown } {#1} }
- }
-\tl_new:N \l__msg_class_tl
-\tl_new:N \l__msg_current_class_tl
-\prop_new:N \l__msg_redirect_prop
-\seq_new:N \l__msg_hierarchy_seq
-\seq_new:N \l__msg_class_loop_seq
-\cs_new_protected:Npn \__msg_use:nnnnnnn #1#2#3#4#5#6#7
- {
- \msg_if_exist:nnTF {#2} {#3}
- {
- \__msg_class_chk_exist:nT {#1}
- {
- \tl_set:Nn \l__msg_current_class_tl {#1}
- \cs_set_protected_nopar:Npx \__msg_use_code:
- {
- \exp_not:n
- {
- \use:c { __msg_ \l__msg_class_tl _code:nnnnnn }
- {#2} {#3} {#4} {#5} {#6} {#7}
- }
- }
- \__msg_use_redirect_name:n { #2 / #3 }
- }
- }
- { \__msg_kernel_error:nnxx { kernel } { message-unknown } {#2} {#3} }
- }
-\cs_new_protected_nopar:Npn \__msg_use_code: { }
-\cs_new_protected:Npn \__msg_use_redirect_name:n #1
- {
- \prop_get:NnNTF \l__msg_redirect_prop { / #1 } \l__msg_class_tl
- { \__msg_use_code: }
- {
- \seq_clear:N \l__msg_hierarchy_seq
- \__msg_use_hierarchy:nwwN { }
- #1 \q_mark \__msg_use_hierarchy:nwwN
- / \q_mark \use_none_delimit_by_q_stop:w
- \q_stop
- \__msg_use_redirect_module:n { }
- }
- }
-\cs_new_protected:Npn \__msg_use_hierarchy:nwwN #1#2 / #3 \q_mark #4
- {
- \seq_put_left:Nn \l__msg_hierarchy_seq {#1}
- #4 { #1 / #2 } #3 \q_mark #4
- }
-\cs_new_protected:Npn \__msg_use_redirect_module:n #1
- {
- \seq_map_inline:Nn \l__msg_hierarchy_seq
- {
- \prop_get:cnNTF { l__msg_redirect_ \l__msg_current_class_tl _prop }
- {##1} \l__msg_class_tl
- {
- \seq_map_break:n
- {
- \tl_if_eq:NNTF \l__msg_current_class_tl \l__msg_class_tl
- { \__msg_use_code: }
- {
- \tl_set_eq:NN \l__msg_current_class_tl \l__msg_class_tl
- \__msg_use_redirect_module:n {##1}
- }
- }
- }
- {
- \str_if_eq:nnT {##1} {#1}
- {
- \tl_set_eq:NN \l__msg_class_tl \l__msg_current_class_tl
- \seq_map_break:n { \__msg_use_code: }
- }
- }
- }
- }
-\cs_new_protected:Npn \msg_redirect_name:nnn #1#2#3
- {
- \tl_if_empty:nTF {#3}
- { \prop_remove:Nn \l__msg_redirect_prop { / #1 / #2 } }
- {
- \__msg_class_chk_exist:nT {#3}
- { \prop_put:Nnn \l__msg_redirect_prop { / #1 / #2 } {#3} }
- }
- }
-\cs_new_protected_nopar:Npn \msg_redirect_class:nn
- { \__msg_redirect:nnn { } }
-\cs_new_protected:Npn \msg_redirect_module:nnn #1
- { \__msg_redirect:nnn { / #1 } }
-\cs_new_protected:Npn \__msg_redirect:nnn #1#2#3
- {
- \__msg_class_chk_exist:nT {#2}
- {
- \tl_if_empty:nTF {#3}
- { \prop_remove:cn { l__msg_redirect_ #2 _prop } {#1} }
- {
- \__msg_class_chk_exist:nT {#3}
- {
- \prop_put:cnn { l__msg_redirect_ #2 _prop } {#1} {#3}
- \tl_set:Nn \l__msg_current_class_tl {#2}
- \seq_clear:N \l__msg_class_loop_seq
- \__msg_redirect_loop_chk:nnn {#2} {#3} {#1}
- }
- }
- }
- }
-\cs_new_protected:Npn \__msg_redirect_loop_chk:nnn #1#2#3
- {
- \seq_put_right:Nn \l__msg_class_loop_seq {#1}
- \prop_get:cnNT { l__msg_redirect_ #1 _prop } {#3} \l__msg_class_tl
- {
- \str_if_eq_x:nnF { \l__msg_class_tl } {#1}
- {
- \tl_if_eq:NNTF \l__msg_class_tl \l__msg_current_class_tl
- {
- \prop_put:cnn { l__msg_redirect_ #2 _prop } {#3} {#2}
- \__msg_kernel_warning:nnxxxx { kernel } { message-redirect-loop }
- { \seq_item:Nn \l__msg_class_loop_seq { \c_one } }
- { \seq_item:Nn \l__msg_class_loop_seq { \c_two } }
- {#3}
- {
- \seq_map_function:NN \l__msg_class_loop_seq
- \__msg_redirect_loop_list:n
- { \seq_item:Nn \l__msg_class_loop_seq { \c_one } }
- }
- }
- { \__msg_redirect_loop_chk:onn \l__msg_class_tl {#2} {#3} }
- }
- }
- }
-\cs_generate_variant:Nn \__msg_redirect_loop_chk:nnn { o }
-\cs_new:Npn \__msg_redirect_loop_list:n #1 { {#1} ~ => ~ }
-\cs_new_protected:Npn \__msg_kernel_new:nnnn #1#2
- { \msg_new:nnnn { LaTeX } { #1 / #2 } }
-\cs_new_protected:Npn \__msg_kernel_new:nnn #1#2
- { \msg_new:nnn { LaTeX } { #1 / #2 } }
-\cs_new_protected:Npn \__msg_kernel_set:nnnn #1#2
- { \msg_set:nnnn { LaTeX } { #1 / #2 } }
-\cs_new_protected:Npn \__msg_kernel_set:nnn #1#2
- { \msg_set:nnn { LaTeX } { #1 / #2 } }
-\group_begin:
- \cs_set_protected:Npn \__msg_kernel_class_new:nN #1
- { \__msg_kernel_class_new_aux:nN { kernel_ #1 } }
- \cs_set_protected:Npn \__msg_kernel_class_new_aux:nN #1#2
- {
- \cs_new_protected:cpn { __msg_ #1 :nnnnnn } ##1##2##3##4##5##6
- {
- \use:x
- {
- \exp_not:n { #2 { LaTeX } { ##1 / ##2 } }
- { \tl_to_str:n {##3} } { \tl_to_str:n {##4} }
- { \tl_to_str:n {##5} } { \tl_to_str:n {##6} }
- }
- }
- \cs_new_protected:cpx { __msg_ #1 :nnnnn } ##1##2##3##4##5
- { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } }
- \cs_new_protected:cpx { __msg_ #1 :nnnn } ##1##2##3##4
- { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } }
- \cs_new_protected:cpx { __msg_ #1 :nnn } ##1##2##3
- { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } }
- \cs_new_protected:cpx { __msg_ #1 :nn } ##1##2
- { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } }
- \cs_new_protected:cpx { __msg_ #1 :nnxxxx } ##1##2##3##4##5##6
- {
- \use:x
- {
- \exp_not:N \exp_not:n
- { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} }
- {##3} {##4} {##5} {##6}
- }
- }
- \cs_new_protected:cpx { __msg_ #1 :nnxxx } ##1##2##3##4##5
- { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } }
- \cs_new_protected:cpx { __msg_ #1 :nnxx } ##1##2##3##4
- { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } }
- \cs_new_protected:cpx { __msg_ #1 :nnx } ##1##2##3
- { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } }
- }
- \__msg_kernel_class_new:nN { fatal } \__msg_fatal_code:nnnnnn
- \cs_undefine:N \__msg_kernel_error:nnxx
- \cs_undefine:N \__msg_kernel_error:nnx
- \cs_undefine:N \__msg_kernel_error:nn
- \__msg_kernel_class_new:nN { error } \__msg_error_code:nnnnnn
- \__msg_kernel_class_new:nN { warning } \msg_warning:nnxxxx
- \__msg_kernel_class_new:nN { info } \msg_info:nnxxxx
-\group_end:
-\__msg_kernel_new:nnnn { kernel } { message-already-defined }
- { Message~'#2'~for~module~'#1'~already~defined. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~was~asked~to~define~a~new~message~called~'#2'\
- by~the~module~'#1':~this~message~already~exists.
- \c_msg_return_text_tl
- }
-\__msg_kernel_new:nnnn { kernel } { message-unknown }
- { Unknown~message~'#2'~for~module~'#1'. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~was~asked~to~display~a~message~called~'#2'\\
- by~the~module~'#1':~this~message~does~not~exist.
- \c_msg_return_text_tl
- }
-\__msg_kernel_new:nnnn { kernel } { message-class-unknown }
- { Unknown~message~class~'#1'. }
- {
- LaTeX~has~been~asked~to~redirect~messages~to~a~class~'#1':\\
- this~was~never~defined.
- \c_msg_return_text_tl
- }
-\__msg_kernel_new:nnnn { kernel } { message-redirect-loop }
- {
- Message~redirection~loop~caused~by~ {#1} ~=>~ {#2}
- \tl_if_empty:nF {#3} { ~for~module~' \use_none:n #3 ' } .
- }
- {
- Adding~the~message~redirection~ {#1} ~=>~ {#2}
- \tl_if_empty:nF {#3} { ~for~the~module~' \use_none:n #3 ' } ~
- created~an~infinite~loop\\\\
- \iow_indent:n { #4 \\\\ }
- }
-\__msg_kernel_new:nnnn { kernel } { bad-number-of-arguments }
- { Function~'#1'~cannot~be~defined~with~#2~arguments. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~define~a~function~'#1'~with~
- #2~arguments.~
- TeX~allows~between~0~and~9~arguments~for~a~single~function.
- }
-\__msg_kernel_new:nnnn { kernel } { command-already-defined }
- { Control~sequence~#1~already~defined. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~create~a~new~control~sequence~'#1'~
- but~this~name~has~already~been~used~elsewhere. \\ \\
- The~current~meaning~is:\\
- \ \ #2
- }
-\__msg_kernel_new:nnnn { kernel } { command-not-defined }
- { Control~sequence~#1~undefined. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~use~a~command~#1,~but~this~has~not~
- been~defined~yet.
- }
-\__msg_kernel_new:nnnn { kernel } { empty-search-pattern }
- { Empty~search~pattern. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~
- would~lead~to~an~infinite~loop!
- }
-\__msg_kernel_new:nnnn { kernel } { out-of-registers }
- { No~room~for~a~new~#1. }
- {
- TeX~only~supports~\int_use:N \c_max_register_int \
- of~each~type.~All~the~#1~registers~have~been~used.~
- This~run~will~be~aborted~now.
- }
-\__msg_kernel_new:nnnn { kernel } { missing-colon }
- { Function~'#1'~contains~no~':'. }
- {
- \c_msg_coding_error_text_tl
- Code-level~functions~must~contain~':'~to~separate~the~
- argument~specification~from~the~function~name.~This~is~
- needed~when~defining~conditionals~or~variants,~or~when~building~a~
- parameter~text~from~the~number~of~arguments~of~the~function.
- }
-\__msg_kernel_new:nnnn { kernel } { protected-predicate }
- { Predicate~'#1'~must~be~expandable. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~define~'#1'~as~a~protected~predicate.~
- Only~expandable~tests~can~have~a~predicate~version.
- }
-\__msg_kernel_new:nnnn { kernel } { conditional-form-unknown }
- { Conditional~form~'#1'~for~function~'#2'~unknown. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~define~the~conditional~form~'#1'~of~
- the~function~'#2',~but~only~'TF',~'T',~'F',~and~'p'~forms~exist.
- }
-\__msg_kernel_new:nnnn { kernel } { scanmark-already-defined }
- { Scan~mark~#1~already~defined. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~create~a~new~scan~mark~'#1'~
- but~this~name~has~already~been~used~for~a~scan~mark.
- }
-\__msg_kernel_new:nnnn { kernel } { variable-not-defined }
- { Variable~#1~undefined. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~show~a~variable~#1,~but~this~has~not~
- been~defined~yet.
- }
-\__msg_kernel_new:nnnn { kernel } { variant-too-long }
- { Variant~form~'#1'~longer~than~base~signature~of~'#2'. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~create~a~variant~of~the~function~'#2'~
- with~a~signature~starting~with~'#1',~but~that~is~longer~than~
- the~signature~(part~after~the~colon)~of~'#2'.
- }
-\__msg_kernel_new:nnnn { kernel } { invalid-variant }
- { Variant~form~'#1'~invalid~for~base~form~'#2'. }
- {
- \c_msg_coding_error_text_tl
- LaTeX~has~been~asked~to~create~a~variant~of~the~function~'#2'~
- with~a~signature~starting~with~'#1',~but~cannot~change~an~argument~
- from~type~'#3'~to~type~'#4'.
- }
-\__msg_kernel_new:nnn { kernel } { bad-variable }
- { Erroneous~variable~#1 used! }
-\__msg_kernel_new:nnn { kernel } { misused-sequence }
- { A~sequence~was~misused. }
-\__msg_kernel_new:nnn { kernel } { misused-prop }
- { A~property~list~was~misused. }
-\__msg_kernel_new:nnn { kernel } { negative-replication }
- { Negative~argument~for~\prg_replicate:nn. }
-\__msg_kernel_new:nnn { kernel } { unknown-comparison }
- { Relation~symbol~'#1'~unknown:~use~=,~<,~>,~==,~!=,~<=,~>=. }
-\__msg_kernel_new:nnn { kernel } { zero-step }
- { Zero~step~size~for~step~function~#1. }
-\__msg_kernel_new:nnn { kernel } { show-clist }
- {
- The~comma~list~
- \str_if_eq:nnF {#1} { \l__clist_internal_clist } { \token_to_str:N #1~}
- \clist_if_empty:NTF #1
- { is~empty }
- { contains~the~items~(without~outer~braces): }
- }
-\__msg_kernel_new:nnn { kernel } { show-prop }
- {
- The~property~list~\token_to_str:N #1~
- \prop_if_empty:NTF #1
- { is~empty }
- { contains~the~pairs~(without~outer~braces): }
- }
-\__msg_kernel_new:nnn { kernel } { show-seq }
- {
- The~sequence~\token_to_str:N #1~
- \seq_if_empty:NTF #1
- { is~empty }
- { contains~the~items~(without~outer~braces): }
- }
-\__msg_kernel_new:nnn { kernel } { show-no-stream }
- { No~ #1 ~streams~are~open }
-\__msg_kernel_new:nnn { kernel } { show-open-streams }
- { The~following~ #1 ~streams~are~in~use: }
-\group_begin:
-\char_set_catcode_math_superscript:N \^
-\char_set_lccode:nn { `^ } { `\ }
-\char_set_lccode:nn { `L } { `L }
-\char_set_lccode:nn { `T } { `T }
-\char_set_lccode:nn { `X } { `X }
-\tl_to_lowercase:n
- {
- \cs_new:Npx \__msg_expandable_error:n #1
- {
- \exp_not:n
- {
- \tex_romannumeral:D
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__msg_expandable_error:w
- \exp_after:wN \exp_after:wN
- \exp_after:wN \c_zero
- }
- \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } ^
- }
- \cs_new:Npn \__msg_expandable_error:w #1 ^ #2 ^ { #1 }
- }
-\group_end:
-\cs_new:Npn \__msg_kernel_expandable_error:nnnnnn #1#2#3#4#5#6
- {
- \exp_args:Nf \__msg_expandable_error:n
- {
- \exp_args:NNc \exp_after:wN \exp_stop_f:
- { \c__msg_text_prefix_tl LaTeX / #1 / #2 }
- {#3} {#4} {#5} {#6}
- }
- }
-\cs_new:Npn \__msg_kernel_expandable_error:nnnnn #1#2#3#4#5
- {
- \__msg_kernel_expandable_error:nnnnnn
- {#1} {#2} {#3} {#4} {#5} { }
- }
-\cs_new:Npn \__msg_kernel_expandable_error:nnnn #1#2#3#4
- {
- \__msg_kernel_expandable_error:nnnnnn
- {#1} {#2} {#3} {#4} { } { }
- }
-\cs_new:Npn \__msg_kernel_expandable_error:nnn #1#2#3
- {
- \__msg_kernel_expandable_error:nnnnnn
- {#1} {#2} {#3} { } { } { }
- }
-\cs_new:Npn \__msg_kernel_expandable_error:nn #1#2
- {
- \__msg_kernel_expandable_error:nnnnnn
- {#1} {#2} { } { } { } { }
- }
-\cs_new_protected:Npn \__msg_term:nnnnnn #1#2#3#4#5#6
- {
- \iow_wrap:nnnN
- { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
- { } { } \iow_term:n
- }
-\cs_generate_variant:Nn \__msg_term:nnnnnn { nnnnnV }
-\cs_new_protected:Npn \__msg_term:nnnnn #1#2#3#4#5
- { \__msg_term:nnnnnn {#1} {#2} {#3} {#4} {#5} { } }
-\cs_new_protected:Npn \__msg_term:nnn #1#2#3
- { \__msg_term:nnnnnn {#1} {#2} {#3} { } { } { } }
-\cs_new_protected:Npn \__msg_term:nn #1#2
- { \__msg_term:nnnnnn {#1} {#2} { } { } { } { } }
-\cs_new_protected:Npn \__msg_show_variable:Nnn #1#2#3
- {
- \cs_if_exist:NTF #1
- {
- \__msg_term:nnn { LaTeX / kernel } { show- #2 } {#1}
- \__msg_show_variable:n {#3}
- }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \__msg_show_variable:n #1
- { \iow_wrap:nnnN {#1} { } { } \__msg_show_variable_aux:n }
-\cs_new_protected:Npn \__msg_show_variable_aux:n #1
- {
- \tl_if_empty:nTF {#1}
- { \tl_clear:N \l__msg_internal_tl }
- { \tl_set:Nf \l__msg_internal_tl { \__msg_show_variable_aux:w #1 } }
- \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
- { \exp_after:wN \l__msg_internal_tl }
- }
-\cs_new:Npn \__msg_show_variable_aux:w #1 > { }
-\cs_new:Npn \__msg_show_item:n #1
- {
- \\ > \ \ \{ \tl_to_str:n {#1} \}
- }
-\cs_new:Npn \__msg_show_item:nn #1#2
- {
- \\ > \ \ \{ \tl_to_str:n {#1} \}
- \ \ => \ \ \{ \tl_to_str:n {#2} \}
- }
-\cs_new:Npn \__msg_show_item_unbraced:nn #1#2
- {
- \\ > \ \ \tl_to_str:n {#1}
- \ \ => \ \ \tl_to_str:n {#2}
- }
-%%
-%%
-%% End of file `l3msg.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3names.sty b/Master/texmf-dist/tex/latex/l3kernel/l3names.sty
deleted file mode 100644
index 4746f4e17b4..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3names.sty
+++ /dev/null
@@ -1,506 +0,0 @@
-%%
-%% This is file `l3names.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3names.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3names.dtx Copyright (C) 1990-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}[2012/07/15]
-\GetIdInfo$Id: l3names.dtx 4640 2014-01-04 16:03:52Z joseph $
- {L3 Namespace for primitives}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\let \tex_global:D \global
-\let \tex_let:D \let
-\begingroup
- \long \def \__kernel_primitive:NN #1#2
- {
- \tex_global:D \tex_let:D #2 #1
- }
- \__kernel_primitive:NN \ \tex_space:D
- \__kernel_primitive:NN \/ \tex_italiccorrection:D
- \__kernel_primitive:NN \- \tex_hyphen:D
- \__kernel_primitive:NN \let \tex_let:D
- \__kernel_primitive:NN \def \tex_def:D
- \__kernel_primitive:NN \edef \tex_edef:D
- \__kernel_primitive:NN \gdef \tex_gdef:D
- \__kernel_primitive:NN \xdef \tex_xdef:D
- \__kernel_primitive:NN \chardef \tex_chardef:D
- \__kernel_primitive:NN \countdef \tex_countdef:D
- \__kernel_primitive:NN \dimendef \tex_dimendef:D
- \__kernel_primitive:NN \skipdef \tex_skipdef:D
- \__kernel_primitive:NN \muskipdef \tex_muskipdef:D
- \__kernel_primitive:NN \mathchardef \tex_mathchardef:D
- \__kernel_primitive:NN \toksdef \tex_toksdef:D
- \__kernel_primitive:NN \futurelet \tex_futurelet:D
- \__kernel_primitive:NN \advance \tex_advance:D
- \__kernel_primitive:NN \divide \tex_divide:D
- \__kernel_primitive:NN \multiply \tex_multiply:D
- \__kernel_primitive:NN \font \tex_font:D
- \__kernel_primitive:NN \fam \tex_fam:D
- \__kernel_primitive:NN \global \tex_global:D
- \__kernel_primitive:NN \long \tex_long:D
- \__kernel_primitive:NN \outer \tex_outer:D
- \__kernel_primitive:NN \setlanguage \tex_setlanguage:D
- \__kernel_primitive:NN \globaldefs \tex_globaldefs:D
- \__kernel_primitive:NN \afterassignment \tex_afterassignment:D
- \__kernel_primitive:NN \aftergroup \tex_aftergroup:D
- \__kernel_primitive:NN \expandafter \tex_expandafter:D
- \__kernel_primitive:NN \noexpand \tex_noexpand:D
- \__kernel_primitive:NN \begingroup \tex_begingroup:D
- \__kernel_primitive:NN \endgroup \tex_endgroup:D
- \__kernel_primitive:NN \halign \tex_halign:D
- \__kernel_primitive:NN \valign \tex_valign:D
- \__kernel_primitive:NN \cr \tex_cr:D
- \__kernel_primitive:NN \crcr \tex_crcr:D
- \__kernel_primitive:NN \noalign \tex_noalign:D
- \__kernel_primitive:NN \omit \tex_omit:D
- \__kernel_primitive:NN \span \tex_span:D
- \__kernel_primitive:NN \tabskip \tex_tabskip:D
- \__kernel_primitive:NN \everycr \tex_everycr:D
- \__kernel_primitive:NN \if \tex_if:D
- \__kernel_primitive:NN \ifcase \tex_ifcase:D
- \__kernel_primitive:NN \ifcat \tex_ifcat:D
- \__kernel_primitive:NN \ifnum \tex_ifnum:D
- \__kernel_primitive:NN \ifodd \tex_ifodd:D
- \__kernel_primitive:NN \ifdim \tex_ifdim:D
- \__kernel_primitive:NN \ifeof \tex_ifeof:D
- \__kernel_primitive:NN \ifhbox \tex_ifhbox:D
- \__kernel_primitive:NN \ifvbox \tex_ifvbox:D
- \__kernel_primitive:NN \ifvoid \tex_ifvoid:D
- \__kernel_primitive:NN \ifx \tex_ifx:D
- \__kernel_primitive:NN \iffalse \tex_iffalse:D
- \__kernel_primitive:NN \iftrue \tex_iftrue:D
- \__kernel_primitive:NN \ifhmode \tex_ifhmode:D
- \__kernel_primitive:NN \ifmmode \tex_ifmmode:D
- \__kernel_primitive:NN \ifvmode \tex_ifvmode:D
- \__kernel_primitive:NN \ifinner \tex_ifinner:D
- \__kernel_primitive:NN \else \tex_else:D
- \__kernel_primitive:NN \fi \tex_fi:D
- \__kernel_primitive:NN \or \tex_or:D
- \__kernel_primitive:NN \immediate \tex_immediate:D
- \__kernel_primitive:NN \closeout \tex_closeout:D
- \__kernel_primitive:NN \openin \tex_openin:D
- \__kernel_primitive:NN \openout \tex_openout:D
- \__kernel_primitive:NN \read \tex_read:D
- \__kernel_primitive:NN \write \tex_write:D
- \__kernel_primitive:NN \closein \tex_closein:D
- \__kernel_primitive:NN \newlinechar \tex_newlinechar:D
- \__kernel_primitive:NN \input \tex_input:D
- \__kernel_primitive:NN \endinput \tex_endinput:D
- \__kernel_primitive:NN \inputlineno \tex_inputlineno:D
- \__kernel_primitive:NN \errmessage \tex_errmessage:D
- \__kernel_primitive:NN \message \tex_message:D
- \__kernel_primitive:NN \show \tex_show:D
- \__kernel_primitive:NN \showthe \tex_showthe:D
- \__kernel_primitive:NN \showbox \tex_showbox:D
- \__kernel_primitive:NN \showlists \tex_showlists:D
- \__kernel_primitive:NN \errhelp \tex_errhelp:D
- \__kernel_primitive:NN \errorcontextlines \tex_errorcontextlines:D
- \__kernel_primitive:NN \tracingcommands \tex_tracingcommands:D
- \__kernel_primitive:NN \tracinglostchars \tex_tracinglostchars:D
- \__kernel_primitive:NN \tracingmacros \tex_tracingmacros:D
- \__kernel_primitive:NN \tracingonline \tex_tracingonline:D
- \__kernel_primitive:NN \tracingoutput \tex_tracingoutput:D
- \__kernel_primitive:NN \tracingpages \tex_tracingpages:D
- \__kernel_primitive:NN \tracingparagraphs \tex_tracingparagraphs:D
- \__kernel_primitive:NN \tracingrestores \tex_tracingrestores:D
- \__kernel_primitive:NN \tracingstats \tex_tracingstats:D
- \__kernel_primitive:NN \pausing \tex_pausing:D
- \__kernel_primitive:NN \showboxbreadth \tex_showboxbreadth:D
- \__kernel_primitive:NN \showboxdepth \tex_showboxdepth:D
- \__kernel_primitive:NN \batchmode \tex_batchmode:D
- \__kernel_primitive:NN \errorstopmode \tex_errorstopmode:D
- \__kernel_primitive:NN \nonstopmode \tex_nonstopmode:D
- \__kernel_primitive:NN \scrollmode \tex_scrollmode:D
- \__kernel_primitive:NN \end \tex_end:D
- \__kernel_primitive:NN \csname \tex_csname:D
- \__kernel_primitive:NN \endcsname \tex_endcsname:D
- \__kernel_primitive:NN \ignorespaces \tex_ignorespaces:D
- \__kernel_primitive:NN \relax \tex_relax:D
- \__kernel_primitive:NN \the \tex_the:D
- \__kernel_primitive:NN \mag \tex_mag:D
- \__kernel_primitive:NN \language \tex_language:D
- \__kernel_primitive:NN \mark \tex_mark:D
- \__kernel_primitive:NN \topmark \tex_topmark:D
- \__kernel_primitive:NN \firstmark \tex_firstmark:D
- \__kernel_primitive:NN \botmark \tex_botmark:D
- \__kernel_primitive:NN \splitfirstmark \tex_splitfirstmark:D
- \__kernel_primitive:NN \splitbotmark \tex_splitbotmark:D
- \__kernel_primitive:NN \fontname \tex_fontname:D
- \__kernel_primitive:NN \escapechar \tex_escapechar:D
- \__kernel_primitive:NN \endlinechar \tex_endlinechar:D
- \__kernel_primitive:NN \mathchoice \tex_mathchoice:D
- \__kernel_primitive:NN \delimiter \tex_delimiter:D
- \__kernel_primitive:NN \mathaccent \tex_mathaccent:D
- \__kernel_primitive:NN \mathchar \tex_mathchar:D
- \__kernel_primitive:NN \mskip \tex_mskip:D
- \__kernel_primitive:NN \radical \tex_radical:D
- \__kernel_primitive:NN \vcenter \tex_vcenter:D
- \__kernel_primitive:NN \mkern \tex_mkern:D
- \__kernel_primitive:NN \above \tex_above:D
- \__kernel_primitive:NN \abovewithdelims \tex_abovewithdelims:D
- \__kernel_primitive:NN \atop \tex_atop:D
- \__kernel_primitive:NN \atopwithdelims \tex_atopwithdelims:D
- \__kernel_primitive:NN \over \tex_over:D
- \__kernel_primitive:NN \overwithdelims \tex_overwithdelims:D
- \__kernel_primitive:NN \displaystyle \tex_displaystyle:D
- \__kernel_primitive:NN \textstyle \tex_textstyle:D
- \__kernel_primitive:NN \scriptstyle \tex_scriptstyle:D
- \__kernel_primitive:NN \scriptscriptstyle \tex_scriptscriptstyle:D
- \__kernel_primitive:NN \nonscript \tex_nonscript:D
- \__kernel_primitive:NN \eqno \tex_eqno:D
- \__kernel_primitive:NN \leqno \tex_leqno:D
- \__kernel_primitive:NN \abovedisplayshortskip \tex_abovedisplayshortskip:D
- \__kernel_primitive:NN \abovedisplayskip \tex_abovedisplayskip:D
- \__kernel_primitive:NN \belowdisplayshortskip \tex_belowdisplayshortskip:D
- \__kernel_primitive:NN \belowdisplayskip \tex_belowdisplayskip:D
- \__kernel_primitive:NN \displaywidowpenalty \tex_displaywidowpenalty:D
- \__kernel_primitive:NN \displayindent \tex_displayindent:D
- \__kernel_primitive:NN \displaywidth \tex_displaywidth:D
- \__kernel_primitive:NN \everydisplay \tex_everydisplay:D
- \__kernel_primitive:NN \predisplaysize \tex_predisplaysize:D
- \__kernel_primitive:NN \predisplaypenalty \tex_predisplaypenalty:D
- \__kernel_primitive:NN \postdisplaypenalty \tex_postdisplaypenalty:D
- \__kernel_primitive:NN \mathbin \tex_mathbin:D
- \__kernel_primitive:NN \mathclose \tex_mathclose:D
- \__kernel_primitive:NN \mathinner \tex_mathinner:D
- \__kernel_primitive:NN \mathop \tex_mathop:D
- \__kernel_primitive:NN \displaylimits \tex_displaylimits:D
- \__kernel_primitive:NN \limits \tex_limits:D
- \__kernel_primitive:NN \nolimits \tex_nolimits:D
- \__kernel_primitive:NN \mathopen \tex_mathopen:D
- \__kernel_primitive:NN \mathord \tex_mathord:D
- \__kernel_primitive:NN \mathpunct \tex_mathpunct:D
- \__kernel_primitive:NN \mathrel \tex_mathrel:D
- \__kernel_primitive:NN \overline \tex_overline:D
- \__kernel_primitive:NN \underline \tex_underline:D
- \__kernel_primitive:NN \left \tex_left:D
- \__kernel_primitive:NN \right \tex_right:D
- \__kernel_primitive:NN \binoppenalty \tex_binoppenalty:D
- \__kernel_primitive:NN \relpenalty \tex_relpenalty:D
- \__kernel_primitive:NN \delimitershortfall \tex_delimitershortfall:D
- \__kernel_primitive:NN \delimiterfactor \tex_delimiterfactor:D
- \__kernel_primitive:NN \nulldelimiterspace \tex_nulldelimiterspace:D
- \__kernel_primitive:NN \everymath \tex_everymath:D
- \__kernel_primitive:NN \mathsurround \tex_mathsurround:D
- \__kernel_primitive:NN \medmuskip \tex_medmuskip:D
- \__kernel_primitive:NN \thinmuskip \tex_thinmuskip:D
- \__kernel_primitive:NN \thickmuskip \tex_thickmuskip:D
- \__kernel_primitive:NN \scriptspace \tex_scriptspace:D
- \__kernel_primitive:NN \noboundary \tex_noboundary:D
- \__kernel_primitive:NN \accent \tex_accent:D
- \__kernel_primitive:NN \char \tex_char:D
- \__kernel_primitive:NN \discretionary \tex_discretionary:D
- \__kernel_primitive:NN \hfil \tex_hfil:D
- \__kernel_primitive:NN \hfilneg \tex_hfilneg:D
- \__kernel_primitive:NN \hfill \tex_hfill:D
- \__kernel_primitive:NN \hskip \tex_hskip:D
- \__kernel_primitive:NN \hss \tex_hss:D
- \__kernel_primitive:NN \vfil \tex_vfil:D
- \__kernel_primitive:NN \vfilneg \tex_vfilneg:D
- \__kernel_primitive:NN \vfill \tex_vfill:D
- \__kernel_primitive:NN \vskip \tex_vskip:D
- \__kernel_primitive:NN \vss \tex_vss:D
- \__kernel_primitive:NN \unskip \tex_unskip:D
- \__kernel_primitive:NN \kern \tex_kern:D
- \__kernel_primitive:NN \unkern \tex_unkern:D
- \__kernel_primitive:NN \hrule \tex_hrule:D
- \__kernel_primitive:NN \vrule \tex_vrule:D
- \__kernel_primitive:NN \leaders \tex_leaders:D
- \__kernel_primitive:NN \cleaders \tex_cleaders:D
- \__kernel_primitive:NN \xleaders \tex_xleaders:D
- \__kernel_primitive:NN \lastkern \tex_lastkern:D
- \__kernel_primitive:NN \lastskip \tex_lastskip:D
- \__kernel_primitive:NN \indent \tex_indent:D
- \__kernel_primitive:NN \par \tex_par:D
- \__kernel_primitive:NN \noindent \tex_noindent:D
- \__kernel_primitive:NN \vadjust \tex_vadjust:D
- \__kernel_primitive:NN \baselineskip \tex_baselineskip:D
- \__kernel_primitive:NN \lineskip \tex_lineskip:D
- \__kernel_primitive:NN \lineskiplimit \tex_lineskiplimit:D
- \__kernel_primitive:NN \clubpenalty \tex_clubpenalty:D
- \__kernel_primitive:NN \widowpenalty \tex_widowpenalty:D
- \__kernel_primitive:NN \exhyphenpenalty \tex_exhyphenpenalty:D
- \__kernel_primitive:NN \hyphenpenalty \tex_hyphenpenalty:D
- \__kernel_primitive:NN \linepenalty \tex_linepenalty:D
- \__kernel_primitive:NN \doublehyphendemerits \tex_doublehyphendemerits:D
- \__kernel_primitive:NN \finalhyphendemerits \tex_finalhyphendemerits:D
- \__kernel_primitive:NN \adjdemerits \tex_adjdemerits:D
- \__kernel_primitive:NN \hangafter \tex_hangafter:D
- \__kernel_primitive:NN \hangindent \tex_hangindent:D
- \__kernel_primitive:NN \parshape \tex_parshape:D
- \__kernel_primitive:NN \hsize \tex_hsize:D
- \__kernel_primitive:NN \lefthyphenmin \tex_lefthyphenmin:D
- \__kernel_primitive:NN \righthyphenmin \tex_righthyphenmin:D
- \__kernel_primitive:NN \leftskip \tex_leftskip:D
- \__kernel_primitive:NN \rightskip \tex_rightskip:D
- \__kernel_primitive:NN \looseness \tex_looseness:D
- \__kernel_primitive:NN \parskip \tex_parskip:D
- \__kernel_primitive:NN \parindent \tex_parindent:D
- \__kernel_primitive:NN \uchyph \tex_uchyph:D
- \__kernel_primitive:NN \emergencystretch \tex_emergencystretch:D
- \__kernel_primitive:NN \pretolerance \tex_pretolerance:D
- \__kernel_primitive:NN \tolerance \tex_tolerance:D
- \__kernel_primitive:NN \spaceskip \tex_spaceskip:D
- \__kernel_primitive:NN \xspaceskip \tex_xspaceskip:D
- \__kernel_primitive:NN \parfillskip \tex_parfillskip:D
- \__kernel_primitive:NN \everypar \tex_everypar:D
- \__kernel_primitive:NN \prevgraf \tex_prevgraf:D
- \__kernel_primitive:NN \spacefactor \tex_spacefactor:D
- \__kernel_primitive:NN \shipout \tex_shipout:D
- \__kernel_primitive:NN \vsize \tex_vsize:D
- \__kernel_primitive:NN \interlinepenalty \tex_interlinepenalty:D
- \__kernel_primitive:NN \brokenpenalty \tex_brokenpenalty:D
- \__kernel_primitive:NN \topskip \tex_topskip:D
- \__kernel_primitive:NN \maxdeadcycles \tex_maxdeadcycles:D
- \__kernel_primitive:NN \maxdepth \tex_maxdepth:D
- \__kernel_primitive:NN \output \tex_output:D
- \__kernel_primitive:NN \deadcycles \tex_deadcycles:D
- \__kernel_primitive:NN \pagedepth \tex_pagedepth:D
- \__kernel_primitive:NN \pagestretch \tex_pagestretch:D
- \__kernel_primitive:NN \pagefilstretch \tex_pagefilstretch:D
- \__kernel_primitive:NN \pagefillstretch \tex_pagefillstretch:D
- \__kernel_primitive:NN \pagefilllstretch \tex_pagefilllstretch:D
- \__kernel_primitive:NN \pageshrink \tex_pageshrink:D
- \__kernel_primitive:NN \pagegoal \tex_pagegoal:D
- \__kernel_primitive:NN \pagetotal \tex_pagetotal:D
- \__kernel_primitive:NN \outputpenalty \tex_outputpenalty:D
- \__kernel_primitive:NN \hoffset \tex_hoffset:D
- \__kernel_primitive:NN \voffset \tex_voffset:D
- \__kernel_primitive:NN \insert \tex_insert:D
- \__kernel_primitive:NN \holdinginserts \tex_holdinginserts:D
- \__kernel_primitive:NN \floatingpenalty \tex_floatingpenalty:D
- \__kernel_primitive:NN \insertpenalties \tex_insertpenalties:D
- \__kernel_primitive:NN \lower \tex_lower:D
- \__kernel_primitive:NN \moveleft \tex_moveleft:D
- \__kernel_primitive:NN \moveright \tex_moveright:D
- \__kernel_primitive:NN \raise \tex_raise:D
- \__kernel_primitive:NN \copy \tex_copy:D
- \__kernel_primitive:NN \lastbox \tex_lastbox:D
- \__kernel_primitive:NN \vsplit \tex_vsplit:D
- \__kernel_primitive:NN \unhbox \tex_unhbox:D
- \__kernel_primitive:NN \unhcopy \tex_unhcopy:D
- \__kernel_primitive:NN \unvbox \tex_unvbox:D
- \__kernel_primitive:NN \unvcopy \tex_unvcopy:D
- \__kernel_primitive:NN \setbox \tex_setbox:D
- \__kernel_primitive:NN \hbox \tex_hbox:D
- \__kernel_primitive:NN \vbox \tex_vbox:D
- \__kernel_primitive:NN \vtop \tex_vtop:D
- \__kernel_primitive:NN \prevdepth \tex_prevdepth:D
- \__kernel_primitive:NN \badness \tex_badness:D
- \__kernel_primitive:NN \hbadness \tex_hbadness:D
- \__kernel_primitive:NN \vbadness \tex_vbadness:D
- \__kernel_primitive:NN \hfuzz \tex_hfuzz:D
- \__kernel_primitive:NN \vfuzz \tex_vfuzz:D
- \__kernel_primitive:NN \overfullrule \tex_overfullrule:D
- \__kernel_primitive:NN \boxmaxdepth \tex_boxmaxdepth:D
- \__kernel_primitive:NN \splitmaxdepth \tex_splitmaxdepth:D
- \__kernel_primitive:NN \splittopskip \tex_splittopskip:D
- \__kernel_primitive:NN \everyhbox \tex_everyhbox:D
- \__kernel_primitive:NN \everyvbox \tex_everyvbox:D
- \__kernel_primitive:NN \nullfont \tex_nullfont:D
- \__kernel_primitive:NN \textfont \tex_textfont:D
- \__kernel_primitive:NN \scriptfont \tex_scriptfont:D
- \__kernel_primitive:NN \scriptscriptfont \tex_scriptscriptfont:D
- \__kernel_primitive:NN \fontdimen \tex_fontdimen:D
- \__kernel_primitive:NN \hyphenchar \tex_hyphenchar:D
- \__kernel_primitive:NN \skewchar \tex_skewchar:D
- \__kernel_primitive:NN \defaulthyphenchar \tex_defaulthyphenchar:D
- \__kernel_primitive:NN \defaultskewchar \tex_defaultskewchar:D
- \__kernel_primitive:NN \number \tex_number:D
- \__kernel_primitive:NN \romannumeral \tex_romannumeral:D
- \__kernel_primitive:NN \string \tex_string:D
- \__kernel_primitive:NN \lowercase \tex_lowercase:D
- \__kernel_primitive:NN \uppercase \tex_uppercase:D
- \__kernel_primitive:NN \meaning \tex_meaning:D
- \__kernel_primitive:NN \penalty \tex_penalty:D
- \__kernel_primitive:NN \unpenalty \tex_unpenalty:D
- \__kernel_primitive:NN \lastpenalty \tex_lastpenalty:D
- \__kernel_primitive:NN \special \tex_special:D
- \__kernel_primitive:NN \dump \tex_dump:D
- \__kernel_primitive:NN \patterns \tex_patterns:D
- \__kernel_primitive:NN \hyphenation \tex_hyphenation:D
- \__kernel_primitive:NN \time \tex_time:D
- \__kernel_primitive:NN \day \tex_day:D
- \__kernel_primitive:NN \month \tex_month:D
- \__kernel_primitive:NN \year \tex_year:D
- \__kernel_primitive:NN \jobname \tex_jobname:D
- \__kernel_primitive:NN \everyjob \tex_everyjob:D
- \__kernel_primitive:NN \count \tex_count:D
- \__kernel_primitive:NN \dimen \tex_dimen:D
- \__kernel_primitive:NN \skip \tex_skip:D
- \__kernel_primitive:NN \toks \tex_toks:D
- \__kernel_primitive:NN \muskip \tex_muskip:D
- \__kernel_primitive:NN \box \tex_box:D
- \__kernel_primitive:NN \wd \tex_wd:D
- \__kernel_primitive:NN \ht \tex_ht:D
- \__kernel_primitive:NN \dp \tex_dp:D
- \__kernel_primitive:NN \catcode \tex_catcode:D
- \__kernel_primitive:NN \delcode \tex_delcode:D
- \__kernel_primitive:NN \sfcode \tex_sfcode:D
- \__kernel_primitive:NN \lccode \tex_lccode:D
- \__kernel_primitive:NN \uccode \tex_uccode:D
- \__kernel_primitive:NN \mathcode \tex_mathcode:D
- \__kernel_primitive:NN \ifdefined \etex_ifdefined:D
- \__kernel_primitive:NN \ifcsname \etex_ifcsname:D
- \__kernel_primitive:NN \unless \etex_unless:D
- \__kernel_primitive:NN \eTeXversion \etex_eTeXversion:D
- \__kernel_primitive:NN \eTeXrevision \etex_eTeXrevision:D
- \__kernel_primitive:NN \marks \etex_marks:D
- \__kernel_primitive:NN \topmarks \etex_topmarks:D
- \__kernel_primitive:NN \firstmarks \etex_firstmarks:D
- \__kernel_primitive:NN \botmarks \etex_botmarks:D
- \__kernel_primitive:NN \splitfirstmarks \etex_splitfirstmarks:D
- \__kernel_primitive:NN \splitbotmarks \etex_splitbotmarks:D
- \__kernel_primitive:NN \unexpanded \etex_unexpanded:D
- \__kernel_primitive:NN \detokenize \etex_detokenize:D
- \__kernel_primitive:NN \scantokens \etex_scantokens:D
- \__kernel_primitive:NN \showtokens \etex_showtokens:D
- \__kernel_primitive:NN \readline \etex_readline:D
- \__kernel_primitive:NN \tracingassigns \etex_tracingassigns:D
- \__kernel_primitive:NN \tracingscantokens \etex_tracingscantokens:D
- \__kernel_primitive:NN \tracingnesting \etex_tracingnesting:D
- \__kernel_primitive:NN \tracingifs \etex_tracingifs:D
- \__kernel_primitive:NN \currentiflevel \etex_currentiflevel:D
- \__kernel_primitive:NN \currentifbranch \etex_currentifbranch:D
- \__kernel_primitive:NN \currentiftype \etex_currentiftype:D
- \__kernel_primitive:NN \tracinggroups \etex_tracinggroups:D
- \__kernel_primitive:NN \currentgrouplevel \etex_currentgrouplevel:D
- \__kernel_primitive:NN \currentgrouptype \etex_currentgrouptype:D
- \__kernel_primitive:NN \showgroups \etex_showgroups:D
- \__kernel_primitive:NN \showifs \etex_showifs:D
- \__kernel_primitive:NN \interactionmode \etex_interactionmode:D
- \__kernel_primitive:NN \lastnodetype \etex_lastnodetype:D
- \__kernel_primitive:NN \iffontchar \etex_iffontchar:D
- \__kernel_primitive:NN \fontcharht \etex_fontcharht:D
- \__kernel_primitive:NN \fontchardp \etex_fontchardp:D
- \__kernel_primitive:NN \fontcharwd \etex_fontcharwd:D
- \__kernel_primitive:NN \fontcharic \etex_fontcharic:D
- \__kernel_primitive:NN \parshapeindent \etex_parshapeindent:D
- \__kernel_primitive:NN \parshapelength \etex_parshapelength:D
- \__kernel_primitive:NN \parshapedimen \etex_parshapedimen:D
- \__kernel_primitive:NN \numexpr \etex_numexpr:D
- \__kernel_primitive:NN \dimexpr \etex_dimexpr:D
- \__kernel_primitive:NN \glueexpr \etex_glueexpr:D
- \__kernel_primitive:NN \muexpr \etex_muexpr:D
- \__kernel_primitive:NN \gluestretch \etex_gluestretch:D
- \__kernel_primitive:NN \glueshrink \etex_glueshrink:D
- \__kernel_primitive:NN \gluestretchorder \etex_gluestretchorder:D
- \__kernel_primitive:NN \glueshrinkorder \etex_glueshrinkorder:D
- \__kernel_primitive:NN \gluetomu \etex_gluetomu:D
- \__kernel_primitive:NN \mutoglue \etex_mutoglue:D
- \__kernel_primitive:NN \lastlinefit \etex_lastlinefit:D
- \__kernel_primitive:NN \interlinepenalties \etex_interlinepenalties:D
- \__kernel_primitive:NN \clubpenalties \etex_clubpenalties:D
- \__kernel_primitive:NN \widowpenalties \etex_widowpenalties:D
- \__kernel_primitive:NN \displaywidowpenalties \etex_displaywidowpenalties:D
- \__kernel_primitive:NN \middle \etex_middle:D
- \__kernel_primitive:NN \savinghyphcodes \etex_savinghyphcodes:D
- \__kernel_primitive:NN \savingvdiscards \etex_savingvdiscards:D
- \__kernel_primitive:NN \pagediscards \etex_pagediscards:D
- \__kernel_primitive:NN \splitdiscards \etex_splitdiscards:D
- \__kernel_primitive:NN \TeXXeTstate \etex_TeXXeTstate:D
- \__kernel_primitive:NN \beginL \etex_beginL:D
- \__kernel_primitive:NN \endL \etex_endL:D
- \__kernel_primitive:NN \beginR \etex_beginR:D
- \__kernel_primitive:NN \endR \etex_endR:D
- \__kernel_primitive:NN \predisplaydirection \etex_predisplaydirection:D
- \__kernel_primitive:NN \everyeof \etex_everyeof:D
- \__kernel_primitive:NN \protected \etex_protected:D
- \__kernel_primitive:NN \pdfcreationdate \pdftex_pdfcreationdate:D
- \__kernel_primitive:NN \pdfcolorstack \pdftex_pdfcolorstack:D
- \__kernel_primitive:NN \pdfcompresslevel \pdftex_pdfcompresslevel:D
- \__kernel_primitive:NN \pdfdecimaldigits \pdftex_pdfdecimaldigits:D
- \__kernel_primitive:NN \pdfhorigin \pdftex_pdfhorigin:D
- \__kernel_primitive:NN \pdfinfo \pdftex_pdfinfo:D
- \__kernel_primitive:NN \pdflastxform \pdftex_pdflastxform:D
- \__kernel_primitive:NN \pdfliteral \pdftex_pdfliteral:D
- \__kernel_primitive:NN \pdfminorversion \pdftex_pdfminorversion:D
- \__kernel_primitive:NN \pdfobjcompresslevel \pdftex_pdfobjcompresslevel:D
- \__kernel_primitive:NN \pdfoutput \pdftex_pdfoutput:D
- \__kernel_primitive:NN \pdfrefxform \pdftex_pdfrefxform:D
- \__kernel_primitive:NN \pdfrestore \pdftex_pdfrestore:D
- \__kernel_primitive:NN \pdfsave \pdftex_pdfsave:D
- \__kernel_primitive:NN \pdfsetmatrix \pdftex_pdfsetmatrix:D
- \__kernel_primitive:NN \pdfpkresolution \pdftex_pdfpkresolution:D
- \__kernel_primitive:NN \pdftexrevision \pdftex_pdftextrevision:D
- \__kernel_primitive:NN \pdfvorigin \pdftex_pdfvorigin:D
- \__kernel_primitive:NN \pdfxform \pdftex_pdfxform:D
- \__kernel_primitive:NN \pdfstrcmp \pdftex_strcmp:D
- \__kernel_primitive:NN \XeTeXversion \xetex_XeTeXversion:D
- \__kernel_primitive:NN \catcodetable \luatex_catcodetable:D
- \__kernel_primitive:NN \directlua \luatex_directlua:D
- \__kernel_primitive:NN \initcatcodetable \luatex_initcatcodetable:D
- \__kernel_primitive:NN \latelua \luatex_latelua:D
- \__kernel_primitive:NN \luatexversion \luatex_luatexversion:D
- \__kernel_primitive:NN \savecatcodetable \luatex_savecatcodetable:D
- \__kernel_primitive:NN \bodydir \luatex_bodydir:D
- \__kernel_primitive:NN \mathdir \luatex_mathdir:D
- \__kernel_primitive:NN \pagedir \luatex_pagedir:D
- \__kernel_primitive:NN \pardir \luatex_pardir:D
- \__kernel_primitive:NN \textdir \luatex_textdir:D
-\tex_endgroup:D
-\tex_let:D \tex_end:D \@@end
-\tex_let:D \tex_everydisplay:D \frozen@everydisplay
-\tex_let:D \tex_everymath:D \frozen@everymath
-\tex_let:D \tex_hyphen:D \@@hyph
-\tex_let:D \tex_input:D \@@input
-\tex_let:D \tex_italiccorrection:D \@@italiccorr
-\tex_let:D \tex_underline:D \@@underline
-\tex_let:D \luatex_catcodetable:D \luatexcatcodetable
-\tex_let:D \luatex_initcatcodetable:D \luatexinitcatcodetable
-\tex_let:D \luatex_latelua:D \luatexlatelua
-\tex_let:D \luatex_savecatcodetable:D \luatexsavecatcodetable
-\tex_let:D \luatex_bodydir:D \luatexbodydir
-\tex_let:D \luatex_mathdir:D \luatexmathdir
-\tex_let:D \luatex_pagedir:D \luatexpagedir
-\tex_let:D \luatex_pardir:D \luatexpardir
-\tex_let:D \luatex_textdir:D \luatextextdir
-\etex_ifdefined:D \pdftex_strcmp:D
-\tex_else:D
- \tex_let:D \pdftex_strcmp:D \pdf@strcmp
-\tex_fi:D
-%%
-%%
-%% End of file `l3names.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
index d6054191278..4fae6967485 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
@@ -46,13 +46,11 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3drivers.dtx 4641 2014-01-04 17:05:41Z joseph $
+\GetIdInfo$Id: l3drivers.dtx 4735 2014-05-05 06:25:42Z joseph $
{L3 Experimental drivers}
\ProvidesExplFile
{l3pdfmode.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: PDF mode}
-\__expl_package_check:
\cs_if_exist:NTF \pdftex_pdfsave:D
{
\cs_new_eq:NN \__driver_state_save: \pdftex_pdfsave:D
@@ -130,7 +128,6 @@
\cs_new_eq:NN \__driver_box_scale_end: \__driver_state_restore:
\tl_new:N \l__driver_current_color_tl
\tl_set:Nn \l__driver_current_color_tl { 0~g~0~G }
-%% \end{macrocode}
\int_new:N \l__driver_color_stack_int
\cs_if_exist:NTF \pdftex_pdfcolorstack:D
{
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty
deleted file mode 100644
index 53b96ee65c3..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3prg.sty
+++ /dev/null
@@ -1,338 +0,0 @@
-%%
-%% This is file `l3prg.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3prg.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3prg.dtx Copyright (C) 2005-2014 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prg.dtx 4642 2014-01-04 17:28:32Z joseph $
- {L3 Control structures}
-%%
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\tex_let:D \if_bool:N \tex_ifodd:D
-\tex_let:D \if_predicate:w \tex_ifodd:D
-\cs_new_protected:Npn \bool_new:N #1 { \cs_new_eq:NN #1 \c_false_bool }
-\cs_generate_variant:Nn \bool_new:N { c }
-\cs_new_protected:Npn \bool_set_true:N #1
- { \cs_set_eq:NN #1 \c_true_bool }
-\cs_new_protected:Npn \bool_set_false:N #1
- { \cs_set_eq:NN #1 \c_false_bool }
-\cs_new_protected:Npn \bool_gset_true:N #1
- { \cs_gset_eq:NN #1 \c_true_bool }
-\cs_new_protected:Npn \bool_gset_false:N #1
- { \cs_gset_eq:NN #1 \c_false_bool }
-\cs_generate_variant:Nn \bool_set_true:N { c }
-\cs_generate_variant:Nn \bool_set_false:N { c }
-\cs_generate_variant:Nn \bool_gset_true:N { c }
-\cs_generate_variant:Nn \bool_gset_false:N { c }
-\cs_new_eq:NN \bool_set_eq:NN \cs_set_eq:NN
-\cs_new_eq:NN \bool_set_eq:Nc \cs_set_eq:Nc
-\cs_new_eq:NN \bool_set_eq:cN \cs_set_eq:cN
-\cs_new_eq:NN \bool_set_eq:cc \cs_set_eq:cc
-\cs_new_eq:NN \bool_gset_eq:NN \cs_gset_eq:NN
-\cs_new_eq:NN \bool_gset_eq:Nc \cs_gset_eq:Nc
-\cs_new_eq:NN \bool_gset_eq:cN \cs_gset_eq:cN
-\cs_new_eq:NN \bool_gset_eq:cc \cs_gset_eq:cc
-\cs_new_protected:Npn \bool_set:Nn #1#2
- { \tex_chardef:D #1 = \bool_if_p:n {#2} }
-\cs_new_protected:Npn \bool_gset:Nn #1#2
- { \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} }
-\cs_generate_variant:Nn \bool_set:Nn { c }
-\cs_generate_variant:Nn \bool_gset:Nn { c }
-\prg_new_conditional:Npnn \bool_if:N #1 { p , T , F , TF }
- {
- \if_meaning:w \c_true_bool #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \bool_if_p:N { c }
-\cs_generate_variant:Nn \bool_if:NT { c }
-\cs_generate_variant:Nn \bool_if:NF { c }
-\cs_generate_variant:Nn \bool_if:NTF { c }
-\cs_new_protected:Npn \bool_show:N #1
- {
- \bool_if_exist:NTF #1
- { \bool_show:n {#1} }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \bool_show:n #1
- {
- \bool_if:nTF {#1}
- { \__msg_show_variable:n { > ~ true } }
- { \__msg_show_variable:n { > ~ false } }
- }
-\cs_generate_variant:Nn \bool_show:N { c }
-\bool_new:N \l_tmpa_bool
-\bool_new:N \l_tmpb_bool
-\bool_new:N \g_tmpa_bool
-\bool_new:N \g_tmpb_bool
-\prg_new_eq_conditional:NNn \bool_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \bool_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\prg_new_conditional:Npnn \bool_if:n #1 { T , F , TF }
- {
- \if_predicate:w \bool_if_p:n {#1}
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \bool_if_p:n #1
- {
- \group_align_safe_begin:
- \__bool_if_left_parentheses:wwwn \q_nil
- #1 \q_mark { }
- ( \q_mark { \__bool_if_right_parentheses:wwwn \q_nil }
- ) \q_mark { \__bool_if_or:wwwn \q_nil }
- || \q_mark \__bool_if_parse:NNNww
- \q_stop
- }
-\cs_new:Npn \__bool_if_left_parentheses:wwwn #1 \q_nil #2 ( #3 \q_mark #4
- { #4 \__bool_if_left_parentheses:wwwn #1 #2 (( \q_nil #3 \q_mark {#4} }
-\cs_new:Npn \__bool_if_right_parentheses:wwwn #1 \q_nil #2 ) #3 \q_mark #4
- { #4 \__bool_if_right_parentheses:wwwn #1 #2 )) \q_nil #3 \q_mark {#4} }
-\cs_new:Npn \__bool_if_or:wwwn #1 \q_nil #2 || #3 \q_mark #4
- { #4 \__bool_if_or:wwwn #1 #2 )||( \q_nil #3 \q_mark {#4} }
-\cs_new:Npn \__bool_if_parse:NNNww #1#2#3#4 \q_mark #5 \q_stop
- {
- \__bool_get_next:NN \use_i:nn (( #4 )) S
- }
-\cs_new:Npn \__bool_get_next:NN #1#2
- {
- \use:c
- {
- __bool_
- \if_meaning:w !#2 ! \else: \if_meaning:w (#2 ( \else: p \fi: \fi:
- :Nw
- }
- #1 #2
- }
-\cs_new:cpn { __bool_!:Nw } #1#2
- { \exp_after:wN \__bool_get_next:NN #1 \use_ii:nn \use_i:nn }
-\cs_new:cpn { __bool_(:Nw } #1#2
- {
- \exp_after:wN \__bool_choose:NNN \exp_after:wN #1
- \__int_value:w \__bool_get_next:NN \use_i:nn
- }
-\cs_new:cpn { __bool_p:Nw } #1
- { \exp_after:wN \__bool_choose:NNN \exp_after:wN #1 \__int_value:w }
-\cs_new:Npn \__bool_choose:NNN #1#2#3
- {
- \use:c
- {
- __bool_ #3 _
- #1 #2 { \if_meaning:w 0 #2 1 \else: 0 \fi: }
- :w
- }
- }
-\cs_new_nopar:cpn { __bool_)_0:w } { \c_false_bool }
-\cs_new_nopar:cpn { __bool_)_1:w } { \c_true_bool }
-\cs_new_nopar:cpn { __bool_S_0:w } { \group_align_safe_end: \c_false_bool }
-\cs_new_nopar:cpn { __bool_S_1:w } { \group_align_safe_end: \c_true_bool }
-\cs_new_nopar:cpn { __bool_&_1:w } & { \__bool_get_next:NN \use_i:nn }
-\cs_new_nopar:cpn { __bool_|_0:w } | { \__bool_get_next:NN \use_i:nn }
-\cs_new_nopar:cpn { __bool_&_0:w } & { \__bool_eval_skip_to_end_auxi:Nw \c_false_bool }
-\cs_new_nopar:cpn { __bool_|_1:w } | { \__bool_eval_skip_to_end_auxi:Nw \c_true_bool }
-%% (
-\cs_new:Npn \__bool_eval_skip_to_end_auxi:Nw #1#2 )
- {
- \__bool_eval_skip_to_end_auxii:Nw #1#2 ( % )
- \q_no_value \q_stop
- {#2}
- }
-\cs_new:Npn \__bool_eval_skip_to_end_auxii:Nw #1#2 ( #3#4 \q_stop #5 % )
- {
- \quark_if_no_value:NTF #3
- {#1}
- { \__bool_eval_skip_to_end_auxiii:Nw #1 #5 }
- }
-\cs_new:Npn \__bool_eval_skip_to_end_auxiii:Nw #1#2 ( #3 )
- { % (
- \__bool_eval_skip_to_end_auxi:Nw #1#3 )
- }
-\cs_new:Npn \bool_not_p:n #1 { \bool_if_p:n { ! ( #1 ) } }
-\cs_new:Npn \bool_xor_p:nn #1#2
- {
- \int_compare:nNnTF { \bool_if_p:n {#1} } = { \bool_if_p:n {#2} }
- \c_false_bool
- \c_true_bool
- }
-\cs_new:Npn \bool_while_do:Nn #1#2
- { \bool_if:NT #1 { #2 \bool_while_do:Nn #1 {#2} } }
-\cs_new:Npn \bool_until_do:Nn #1#2
- { \bool_if:NF #1 { #2 \bool_until_do:Nn #1 {#2} } }
-\cs_generate_variant:Nn \bool_while_do:Nn { c }
-\cs_generate_variant:Nn \bool_until_do:Nn { c }
-\cs_new:Npn \bool_do_while:Nn #1#2
- { #2 \bool_if:NT #1 { \bool_do_while:Nn #1 {#2} } }
-\cs_new:Npn \bool_do_until:Nn #1#2
- { #2 \bool_if:NF #1 { \bool_do_until:Nn #1 {#2} } }
-\cs_generate_variant:Nn \bool_do_while:Nn { c }
-\cs_generate_variant:Nn \bool_do_until:Nn { c }
-\cs_new:Npn \bool_while_do:nn #1#2
- {
- \bool_if:nT {#1}
- {
- #2
- \bool_while_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \bool_do_while:nn #1#2
- {
- #2
- \bool_if:nT {#1} { \bool_do_while:nn {#1} {#2} }
- }
-\cs_new:Npn \bool_until_do:nn #1#2
- {
- \bool_if:nF {#1}
- {
- #2
- \bool_until_do:nn {#1} {#2}
- }
- }
-\cs_new:Npn \bool_do_until:nn #1#2
- {
- #2
- \bool_if:nF {#1} { \bool_do_until:nn {#1} {#2} }
- }
-\cs_new:Npn \prg_replicate:nn #1
- {
- \__int_to_roman:w
- \exp_after:wN \__prg_replicate_first:N
- \__int_value:w \__int_eval:w #1 \__int_eval_end:
- \cs_end:
- }
-\cs_new:Npn \__prg_replicate:N #1
- { \cs:w __prg_replicate_#1 :n \__prg_replicate:N }
-\cs_new:Npn \__prg_replicate_first:N #1
- { \cs:w __prg_replicate_first_ #1 :n \__prg_replicate:N }
-\cs_new:Npn \__prg_replicate_ :n #1 { \cs_end: }
-\cs_new:cpn { __prg_replicate_0:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} }
-\cs_new:cpn { __prg_replicate_1:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1 }
-\cs_new:cpn { __prg_replicate_2:n } #1 { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1 }
-\cs_new:cpn { __prg_replicate_3:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1 }
-\cs_new:cpn { __prg_replicate_4:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1 }
-\cs_new:cpn { __prg_replicate_5:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_6:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_7:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_8:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_9:n } #1
- { \cs_end: {#1#1#1#1#1#1#1#1#1#1} #1#1#1#1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_-:n } #1
- {
- \c_zero
- \__msg_kernel_expandable_error:nn { kernel } { negative-replication }
- }
-\cs_new:cpn { __prg_replicate_first_0:n } #1 { \c_zero }
-\cs_new:cpn { __prg_replicate_first_1:n } #1 { \c_zero #1 }
-\cs_new:cpn { __prg_replicate_first_2:n } #1 { \c_zero #1#1 }
-\cs_new:cpn { __prg_replicate_first_3:n } #1 { \c_zero #1#1#1 }
-\cs_new:cpn { __prg_replicate_first_4:n } #1 { \c_zero #1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_5:n } #1 { \c_zero #1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_6:n } #1 { \c_zero #1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_7:n } #1 { \c_zero #1#1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_8:n } #1 { \c_zero #1#1#1#1#1#1#1#1 }
-\cs_new:cpn { __prg_replicate_first_9:n } #1 { \c_zero #1#1#1#1#1#1#1#1#1 }
-\prg_new_conditional:Npnn \mode_if_vertical: { p , T , F , TF }
- { \if_mode_vertical: \prg_return_true: \else: \prg_return_false: \fi: }
-\prg_new_conditional:Npnn \mode_if_horizontal: { p , T , F , TF }
- { \if_mode_horizontal: \prg_return_true: \else: \prg_return_false: \fi: }
-\prg_new_conditional:Npnn \mode_if_inner: { p , T , F , TF }
- { \if_mode_inner: \prg_return_true: \else: \prg_return_false: \fi: }
-\prg_new_conditional:Npnn \mode_if_math: { p , T , F , TF }
- { \if_mode_math: \prg_return_true: \else: \prg_return_false: \fi: }
-\cs_new_nopar:Npn \group_align_safe_begin:
- { \if_int_compare:w \if_false: { \fi: `} = \c_zero \fi: }
-\cs_new_nopar:Npn \group_align_safe_end:
- { \if_int_compare:w `{ = \c_zero } \fi: }
-\cs_new_protected_nopar:Npn \scan_align_safe_stop: { }
-\group_begin:
- \tex_lccode:D `* = `g \scan_stop:
- \tex_catcode:D `* = \c_twelve
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new:Npn \__prg_variable_get_scope:N #1
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__prg_variable_get_scope:w
- \cs_to_str:N #1 \exp_stop_f: \q_stop
- }
- \cs_new:Npn \__prg_variable_get_scope:w #1#2 \q_stop
- { \token_if_eq_meaning:NNT * #1 { g } }
- }
-\group_begin:
- \tex_lccode:D `* = `_ \scan_stop:
- \tex_catcode:D `* = \c_twelve
-\tl_to_lowercase:n
- {
- \group_end:
- \cs_new:Npn \__prg_variable_get_type:N #1
- {
- \exp_after:wN \__prg_variable_get_type:w
- \token_to_str:N #1 * a \q_stop
- }
- \cs_new:Npn \__prg_variable_get_type:w #1 * #2#3 \q_stop
- {
- \token_if_eq_meaning:NNTF a #2
- {#1}
- { \__prg_variable_get_type:w #2#3 \q_stop }
- }
- }
-\int_new:N \g__prg_map_int
-%%
-%%
-%% End of file `l3prg.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty b/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty
deleted file mode 100644
index 8f1aa4f4044..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3prop.sty
+++ /dev/null
@@ -1,309 +0,0 @@
-%%
-%% This is file `l3prop.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3prop.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3prop.dtx Copyright (C) 1990-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3prop.dtx 4623 2013-12-14 13:53:40Z bruno $
- {L3 Property lists}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\__scan_new:N \s__prop
-\cs_new:Npn \__prop_pair:wn #1 \s__prop #2
- { \__msg_kernel_expandable_error:nn { kernel } { misused-prop } }
-\tl_new:N \l__prop_internal_tl
-\tl_const:Nn \c_empty_prop { \s__prop }
-\cs_new_protected:Npn \prop_new:N #1
- {
- \__chk_if_free_cs:N #1
- \cs_gset_eq:NN #1 \c_empty_prop
- }
-\cs_generate_variant:Nn \prop_new:N { c }
-\cs_new_protected:Npn \prop_clear:N #1
- { \prop_set_eq:NN #1 \c_empty_prop }
-\cs_generate_variant:Nn \prop_clear:N { c }
-\cs_new_protected:Npn \prop_gclear:N #1
- { \prop_gset_eq:NN #1 \c_empty_prop }
-\cs_generate_variant:Nn \prop_gclear:N { c }
-\cs_new_protected:Npn \prop_clear_new:N #1
- { \prop_if_exist:NTF #1 { \prop_clear:N #1 } { \prop_new:N #1 } }
-\cs_generate_variant:Nn \prop_clear_new:N { c }
-\cs_new_protected:Npn \prop_gclear_new:N #1
- { \prop_if_exist:NTF #1 { \prop_gclear:N #1 } { \prop_new:N #1 } }
-\cs_generate_variant:Nn \prop_gclear_new:N { c }
-\cs_new_eq:NN \prop_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \prop_set_eq:Nc \tl_set_eq:Nc
-\cs_new_eq:NN \prop_set_eq:cN \tl_set_eq:cN
-\cs_new_eq:NN \prop_set_eq:cc \tl_set_eq:cc
-\cs_new_eq:NN \prop_gset_eq:NN \tl_gset_eq:NN
-\cs_new_eq:NN \prop_gset_eq:Nc \tl_gset_eq:Nc
-\cs_new_eq:NN \prop_gset_eq:cN \tl_gset_eq:cN
-\cs_new_eq:NN \prop_gset_eq:cc \tl_gset_eq:cc
-\prop_new:N \l_tmpa_prop
-\prop_new:N \l_tmpb_prop
-\prop_new:N \g_tmpa_prop
-\prop_new:N \g_tmpb_prop
-\cs_new_protected:Npn \__prop_split:NnTF #1#2
- { \exp_args:NNo \__prop_split_aux:NnTF #1 { \tl_to_str:n {#2} } }
-\cs_new_protected:Npn \__prop_split_aux:NnTF #1#2#3#4
- {
- \cs_set:Npn \__prop_split_aux:w ##1
- \__prop_pair:wn #2 \s__prop ##2 ##3 \q_mark ##4 ##5 \q_stop
- { ##4 {#3} {#4} }
- \exp_after:wN \__prop_split_aux:w #1 \q_mark \use_i:nn
- \__prop_pair:wn #2 \s__prop { } \q_mark \use_ii:nn \q_stop
- }
-\cs_new:Npn \__prop_split_aux:w { }
-\cs_new_protected:Npn \prop_remove:Nn #1#2
- {
- \__prop_split:NnTF #1 {#2}
- { \tl_set:Nn #1 { ##1 ##3 } }
- { }
- }
-\cs_new_protected:Npn \prop_gremove:Nn #1#2
- {
- \__prop_split:NnTF #1 {#2}
- { \tl_gset:Nn #1 { ##1 ##3 } }
- { }
- }
-\cs_generate_variant:Nn \prop_remove:Nn { NV }
-\cs_generate_variant:Nn \prop_remove:Nn { c , cV }
-\cs_generate_variant:Nn \prop_gremove:Nn { NV }
-\cs_generate_variant:Nn \prop_gremove:Nn { c , cV }
-\cs_new_protected:Npn \prop_get:NnN #1#2#3
- {
- \__prop_split:NnTF #1 {#2}
- { \tl_set:Nn #3 {##2} }
- { \tl_set:Nn #3 { \q_no_value } }
- }
-\cs_generate_variant:Nn \prop_get:NnN { NV , No }
-\cs_generate_variant:Nn \prop_get:NnN { c , cV , co }
-\cs_new_protected:Npn \prop_pop:NnN #1#2#3
- {
- \__prop_split:NnTF #1 {#2}
- {
- \tl_set:Nn #3 {##2}
- \tl_set:Nn #1 { ##1 ##3 }
- }
- { \tl_set:Nn #3 { \q_no_value } }
- }
-\cs_new_protected:Npn \prop_gpop:NnN #1#2#3
- {
- \__prop_split:NnTF #1 {#2}
- {
- \tl_set:Nn #3 {##2}
- \tl_gset:Nn #1 { ##1 ##3 }
- }
- { \tl_set:Nn #3 { \q_no_value } }
- }
-\cs_generate_variant:Nn \prop_pop:NnN { No }
-\cs_generate_variant:Nn \prop_pop:NnN { c , co }
-\cs_generate_variant:Nn \prop_gpop:NnN { No }
-\cs_generate_variant:Nn \prop_gpop:NnN { c , co }
-\prg_new_protected_conditional:Npnn \prop_pop:NnN #1#2#3 { T , F , TF }
- {
- \__prop_split:NnTF #1 {#2}
- {
- \tl_set:Nn #3 {##2}
- \tl_set:Nn #1 { ##1 ##3 }
- \prg_return_true:
- }
- { \prg_return_false: }
- }
-\prg_new_protected_conditional:Npnn \prop_gpop:NnN #1#2#3 { T , F , TF }
- {
- \__prop_split:NnTF #1 {#2}
- {
- \tl_set:Nn #3 {##2}
- \tl_gset:Nn #1 { ##1 ##3 }
- \prg_return_true:
- }
- { \prg_return_false: }
- }
-\cs_generate_variant:Nn \prop_pop:NnNT { c }
-\cs_generate_variant:Nn \prop_pop:NnNF { c }
-\cs_generate_variant:Nn \prop_pop:NnNTF { c }
-\cs_generate_variant:Nn \prop_gpop:NnNT { c }
-\cs_generate_variant:Nn \prop_gpop:NnNF { c }
-\cs_generate_variant:Nn \prop_gpop:NnNTF { c }
-\cs_new_protected_nopar:Npn \prop_put:Nnn { \__prop_put:NNnn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \prop_gput:Nnn { \__prop_put:NNnn \tl_gset:Nx }
-\cs_new_protected:Npn \__prop_put:NNnn #1#2#3#4
- {
- \tl_set:Nn \l__prop_internal_tl
- {
- \exp_not:N \__prop_pair:wn \tl_to_str:n {#3}
- \s__prop { \exp_not:n {#4} }
- }
- \__prop_split:NnTF #2 {#3}
- { #1 #2 { \exp_not:n {##1} \l__prop_internal_tl \exp_not:n {##3} } }
- { #1 #2 { \exp_not:o {#2} \l__prop_internal_tl } }
- }
-\cs_generate_variant:Nn \prop_put:Nnn
- { NnV , Nno , Nnx , NV , NVV , No , Noo }
-\cs_generate_variant:Nn \prop_put:Nnn
- { c , cnV , cno , cnx , cV , cVV , co , coo }
-\cs_generate_variant:Nn \prop_gput:Nnn
- { NnV , Nno , Nnx , NV , NVV , No , Noo }
-\cs_generate_variant:Nn \prop_gput:Nnn
- { c , cnV , cno , cnx , cV , cVV , co , coo }
-\cs_new_protected_nopar:Npn \prop_put_if_new:Nnn
- { \__prop_put_if_new:NNnn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \prop_gput_if_new:Nnn
- { \__prop_put_if_new:NNnn \tl_gset:Nx }
-\cs_new_protected:Npn \__prop_put_if_new:NNnn #1#2#3#4
- {
- \tl_set:Nn \l__prop_internal_tl
- {
- \exp_not:N \__prop_pair:wn \tl_to_str:n {#3}
- \s__prop \exp_not:n { {#4} }
- }
- \__prop_split:NnTF #2 {#3}
- { }
- { #1 #2 { \exp_not:o {#2} \l__prop_internal_tl } }
- }
-\cs_generate_variant:Nn \prop_put_if_new:Nnn { c }
-\cs_generate_variant:Nn \prop_gput_if_new:Nnn { c }
-\prg_new_eq_conditional:NNn \prop_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \prop_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\prg_new_conditional:Npnn \prop_if_empty:N #1 { p , T , F , TF }
- {
- \tl_if_eq:NNTF #1 \c_empty_prop
- \prg_return_true: \prg_return_false:
- }
-\cs_generate_variant:Nn \prop_if_empty_p:N { c }
-\cs_generate_variant:Nn \prop_if_empty:NT { c }
-\cs_generate_variant:Nn \prop_if_empty:NF { c }
-\cs_generate_variant:Nn \prop_if_empty:NTF { c }
-\prg_new_conditional:Npnn \prop_if_in:Nn #1#2 { p , T , F , TF }
- {
- \exp_last_unbraced:Noo \__prop_if_in:nwwn { \tl_to_str:n {#2} } #1
- \__prop_pair:wn \tl_to_str:n {#2} \s__prop { }
- \q_recursion_tail
- \__prg_break_point:
- }
-\cs_new:Npn \__prop_if_in:nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
- {
- \str_if_eq_x:nnTF {#1} {#3}
- { \__prop_if_in:N }
- { \__prop_if_in:nwwn {#1} }
- }
-\cs_new:Npn \__prop_if_in:N #1
- {
- \if_meaning:w \q_recursion_tail #1
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- \__prg_break:
- }
-\cs_generate_variant:Nn \prop_if_in_p:Nn { NV , No }
-\cs_generate_variant:Nn \prop_if_in_p:Nn { c , cV , co }
-\cs_generate_variant:Nn \prop_if_in:NnT { NV , No }
-\cs_generate_variant:Nn \prop_if_in:NnT { c , cV , co }
-\cs_generate_variant:Nn \prop_if_in:NnF { NV , No }
-\cs_generate_variant:Nn \prop_if_in:NnF { c , cV , co }
-\cs_generate_variant:Nn \prop_if_in:NnTF { NV , No }
-\cs_generate_variant:Nn \prop_if_in:NnTF { c , cV , co }
-\prg_new_protected_conditional:Npnn \prop_get:NnN #1#2#3 { T , F , TF }
- {
- \__prop_split:NnTF #1 {#2}
- {
- \tl_set:Nn #3 {##2}
- \prg_return_true:
- }
- { \prg_return_false: }
- }
-\cs_generate_variant:Nn \prop_get:NnNT { NV , No }
-\cs_generate_variant:Nn \prop_get:NnNF { NV , No }
-\cs_generate_variant:Nn \prop_get:NnNTF { NV , No }
-\cs_generate_variant:Nn \prop_get:NnNT { c , cV , co }
-\cs_generate_variant:Nn \prop_get:NnNF { c , cV , co }
-\cs_generate_variant:Nn \prop_get:NnNTF { c , cV , co }
-\cs_new:Npn \prop_map_function:NN #1#2
- {
- \exp_last_unbraced:NNo \__prop_map_function:Nwwn #2 #1
- \__prop_pair:wn \q_recursion_tail \s__prop { }
- \__prg_break_point:Nn \prop_map_break: { }
- }
-\cs_new:Npn \__prop_map_function:Nwwn #1#2 \__prop_pair:wn #3 \s__prop #4
- {
- \if_meaning:w \q_recursion_tail #3
- \exp_after:wN \prop_map_break:
- \fi:
- #1 {#3} {#4}
- \__prop_map_function:Nwwn #1
- }
-\cs_generate_variant:Nn \prop_map_function:NN { Nc }
-\cs_generate_variant:Nn \prop_map_function:NN { c , cc }
-\cs_new_protected:Npn \prop_map_inline:Nn #1#2
- {
- \cs_gset_eq:cN
- { __prg_map_ \int_use:N \g__prg_map_int :wn } \__prop_pair:wn
- \int_gincr:N \g__prg_map_int
- \cs_gset:Npn \__prop_pair:wn ##1 \s__prop ##2 {#2}
- #1
- \__prg_break_point:Nn \prop_map_break:
- {
- \int_gdecr:N \g__prg_map_int
- \cs_gset_eq:Nc \__prop_pair:wn
- { __prg_map_ \int_use:N \g__prg_map_int :wn }
- }
- }
-\cs_generate_variant:Nn \prop_map_inline:Nn { c }
-\cs_new_nopar:Npn \prop_map_break:
- { \__prg_map_break:Nn \prop_map_break: { } }
-\cs_new_nopar:Npn \prop_map_break:n
- { \__prg_map_break:Nn \prop_map_break: }
-\cs_new_protected:Npn \prop_show:N #1
- {
- \__msg_show_variable:Nnn #1 { prop }
- { \prop_map_function:NN #1 \__msg_show_item:nn }
- }
-\cs_generate_variant:Nn \prop_show:N { c }
-%%
-%%
-%% End of file `l3prop.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty b/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty
deleted file mode 100644
index 8fef7cdef20..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3quark.sty
+++ /dev/null
@@ -1,172 +0,0 @@
-%%
-%% This is file `l3quark.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3quark.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3quark.dtx Copyright (C) 1990-2012 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3quark.dtx 4623 2013-12-14 13:53:40Z bruno $
- {L3 Quarks}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_protected:Npn \quark_new:N #1 { \tl_const:Nn #1 {#1} }
-\quark_new:N \q_nil
-\quark_new:N \q_mark
-\quark_new:N \q_no_value
-\quark_new:N \q_stop
-\quark_new:N \q_recursion_tail
-\quark_new:N \q_recursion_stop
-\cs_new:Npn \quark_if_recursion_tail_stop:N #1
- {
- \if_meaning:w \q_recursion_tail #1
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- }
-\cs_new:Npn \quark_if_recursion_tail_stop_do:Nn #1
- {
- \if_meaning:w \q_recursion_tail #1
- \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw
- \else:
- \exp_after:wN \use_none:n
- \fi:
- }
-\cs_new:Npn \quark_if_recursion_tail_stop:n #1
- {
- \if_int_compare:w \pdftex_strcmp:D
- { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
- \fi:
- }
-\cs_new:Npn \quark_if_recursion_tail_stop_do:nn #1
- {
- \if_int_compare:w \pdftex_strcmp:D
- { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
- \exp_after:wN \use_i_delimit_by_q_recursion_stop:nw
- \else:
- \exp_after:wN \use_none:n
- \fi:
- }
-\cs_generate_variant:Nn \quark_if_recursion_tail_stop:n { o }
-\cs_generate_variant:Nn \quark_if_recursion_tail_stop_do:nn { o }
-\cs_new:Npn \__quark_if_recursion_tail_break:NN #1#2
- {
- \if_meaning:w \q_recursion_tail #1
- \exp_after:wN #2
- \fi:
- }
-\cs_new:Npn \__quark_if_recursion_tail_break:nN #1#2
- {
- \if_int_compare:w \pdftex_strcmp:D
- { \exp_not:N \q_recursion_tail } { \exp_not:n {#1} } = \c_zero
- \exp_after:wN #2
- \fi:
- }
-\prg_new_conditional:Nnn \quark_if_nil:N { p, T , F , TF }
- {
- \if_meaning:w \q_nil #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Nnn \quark_if_no_value:N { p, T , F , TF }
- {
- \if_meaning:w \q_no_value #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \quark_if_no_value_p:N { c }
-\cs_generate_variant:Nn \quark_if_no_value:NT { c }
-\cs_generate_variant:Nn \quark_if_no_value:NF { c }
-\cs_generate_variant:Nn \quark_if_no_value:NTF { c }
-\prg_new_conditional:Nnn \quark_if_nil:n { p, T , F , TF }
- {
- \if_int_compare:w \pdftex_strcmp:D
- { \exp_not:N \q_nil } { \exp_not:n {#1} } = \c_zero
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Nnn \quark_if_no_value:n { p, T , F , TF }
- {
- \if_int_compare:w \pdftex_strcmp:D
- { \exp_not:N \q_no_value } { \exp_not:n {#1} } = \c_zero
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \quark_if_nil_p:n { V , o }
-\cs_generate_variant:Nn \quark_if_nil:nTF { V , o }
-\cs_generate_variant:Nn \quark_if_nil:nT { V , o }
-\cs_generate_variant:Nn \quark_if_nil:nF { V , o }
-\quark_new:N \q__tl_act_mark
-\quark_new:N \q__tl_act_stop
-\tl_new:N \g__scan_marks_tl
-\cs_new_protected:Npn \__scan_new:N #1
- {
- \tl_if_in:NnTF \g__scan_marks_tl { #1 }
- {
- \__msg_kernel_error:nnx { kernel } { scanmark-already-defined }
- { \token_to_str:N #1 }
- }
- {
- \tl_gput_right:Nn \g__scan_marks_tl {#1}
- \cs_new_eq:NN #1 \scan_stop:
- }
- }
-\__scan_new:N \s__stop
-\cs_new:Npn \__use_none_delimit_by_s__stop:w #1 \s__stop { }
-\__scan_new:N \s__seq
-\cs_new:Npn \quark_if_recursion_tail_break:N #1
- { \__quark_if_recursion_tail_break:NN #1 \prg_break: }
-\cs_new:Npn \quark_if_recursion_tail_break:n #1
- { \__quark_if_recursion_tail_break:nN {#1} \prg_break: }
-%%
-%%
-%% End of file `l3quark.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty b/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
deleted file mode 100644
index 758407cb40f..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3seq.sty
+++ /dev/null
@@ -1,508 +0,0 @@
-%%
-%% This is file `l3seq.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3seq.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3seq.dtx Copyright (C) 1990-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3seq.dtx 4623 2013-12-14 13:53:40Z bruno $
- {L3 Sequences and stacks}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new:Npn \__seq_item:n
- {
- \__msg_kernel_expandable_error:nn { kernel } { misused-sequence }
- \use_none:n
- }
-\tl_new:N \l__seq_internal_a_tl
-\tl_new:N \l__seq_internal_b_tl
-\cs_new_eq:NN \__seq_tmp:w ?
-\tl_const:Nn \c_empty_seq { \s__seq }
-\cs_new_protected:Npn \seq_new:N #1
- {
- \__chk_if_free_cs:N #1
- \cs_gset_eq:NN #1 \c_empty_seq
- }
-\cs_generate_variant:Nn \seq_new:N { c }
-\cs_new_protected:Npn \seq_clear:N #1
- { \seq_set_eq:NN #1 \c_empty_seq }
-\cs_generate_variant:Nn \seq_clear:N { c }
-\cs_new_protected:Npn \seq_gclear:N #1
- { \seq_gset_eq:NN #1 \c_empty_seq }
-\cs_generate_variant:Nn \seq_gclear:N { c }
-\cs_new_protected:Npn \seq_clear_new:N #1
- { \seq_if_exist:NTF #1 { \seq_clear:N #1 } { \seq_new:N #1 } }
-\cs_generate_variant:Nn \seq_clear_new:N { c }
-\cs_new_protected:Npn \seq_gclear_new:N #1
- { \seq_if_exist:NTF #1 { \seq_gclear:N #1 } { \seq_new:N #1 } }
-\cs_generate_variant:Nn \seq_gclear_new:N { c }
-\cs_new_eq:NN \seq_set_eq:NN \tl_set_eq:NN
-\cs_new_eq:NN \seq_set_eq:Nc \tl_set_eq:Nc
-\cs_new_eq:NN \seq_set_eq:cN \tl_set_eq:cN
-\cs_new_eq:NN \seq_set_eq:cc \tl_set_eq:cc
-\cs_new_eq:NN \seq_gset_eq:NN \tl_gset_eq:NN
-\cs_new_eq:NN \seq_gset_eq:Nc \tl_gset_eq:Nc
-\cs_new_eq:NN \seq_gset_eq:cN \tl_gset_eq:cN
-\cs_new_eq:NN \seq_gset_eq:cc \tl_gset_eq:cc
-\cs_new_protected_nopar:Npn \seq_set_split:Nnn
- { \__seq_set_split:NNnn \tl_set:Nx }
-\cs_new_protected_nopar:Npn \seq_gset_split:Nnn
- { \__seq_set_split:NNnn \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_set_split:NNnn #1#2#3#4
- {
- \tl_if_empty:nTF {#3}
- {
- \tl_set:Nn \l__seq_internal_a_tl
- { \tl_map_function:nN {#4} \__seq_wrap_item:n }
- }
- {
- \tl_set:Nn \l__seq_internal_a_tl
- {
- \__seq_set_split_auxi:w \prg_do_nothing:
- #4
- \__seq_set_split_end:
- }
- \tl_replace_all:Nnn \l__seq_internal_a_tl { #3 }
- {
- \__seq_set_split_end:
- \__seq_set_split_auxi:w \prg_do_nothing:
- }
- \tl_set:Nx \l__seq_internal_a_tl { \l__seq_internal_a_tl }
- }
- #1 #2 { \s__seq \l__seq_internal_a_tl }
- }
-\cs_new:Npn \__seq_set_split_auxi:w #1 \__seq_set_split_end:
- {
- \exp_not:N \__seq_set_split_auxii:w
- \exp_args:No \tl_trim_spaces:n {#1}
- \exp_not:N \__seq_set_split_end:
- }
-\cs_new:Npn \__seq_set_split_auxii:w #1 \__seq_set_split_end:
- { \__seq_wrap_item:n {#1} }
-\cs_generate_variant:Nn \seq_set_split:Nnn { NnV }
-\cs_generate_variant:Nn \seq_gset_split:Nnn { NnV }
-\cs_new_protected:Npn \seq_concat:NNN #1#2#3
- { \tl_set:Nf #1 { \exp_after:wN \use_i:nn \exp_after:wN #2 #3 } }
-\cs_new_protected:Npn \seq_gconcat:NNN #1#2#3
- { \tl_gset:Nf #1 { \exp_after:wN \use_i:nn \exp_after:wN #2 #3 } }
-\cs_generate_variant:Nn \seq_concat:NNN { ccc }
-\cs_generate_variant:Nn \seq_gconcat:NNN { ccc }
-\prg_new_eq_conditional:NNn \seq_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \seq_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_protected:Npn \seq_put_left:Nn #1#2
- {
- \tl_set:Nx #1
- {
- \exp_not:n { \s__seq \__seq_item:n {#2} }
- \exp_not:f { \exp_after:wN \__seq_put_left_aux:w #1 }
- }
- }
-\cs_new_protected:Npn \seq_gput_left:Nn #1#2
- {
- \tl_gset:Nx #1
- {
- \exp_not:n { \s__seq \__seq_item:n {#2} }
- \exp_not:f { \exp_after:wN \__seq_put_left_aux:w #1 }
- }
- }
-\cs_new:Npn \__seq_put_left_aux:w \s__seq { \exp_stop_f: }
-\cs_generate_variant:Nn \seq_put_left:Nn { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_put_left:Nn { c , cV , cv , co , cx }
-\cs_generate_variant:Nn \seq_gput_left:Nn { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_gput_left:Nn { c , cV , cv , co , cx }
-\cs_new_protected:Npn \seq_put_right:Nn #1#2
- { \tl_put_right:Nn #1 { \__seq_item:n {#2} } }
-\cs_new_protected:Npn \seq_gput_right:Nn #1#2
- { \tl_gput_right:Nn #1 { \__seq_item:n {#2} } }
-\cs_generate_variant:Nn \seq_gput_right:Nn { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_gput_right:Nn { c , cV , cv , co , cx }
-\cs_generate_variant:Nn \seq_put_right:Nn { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_put_right:Nn { c , cV , cv , co , cx }
-\cs_new:Npn \__seq_wrap_item:n #1 { \exp_not:n { \__seq_item:n {#1} } }
-\seq_new:N \l__seq_remove_seq
-\cs_new_protected:Npn \seq_remove_duplicates:N
- { \__seq_remove_duplicates:NN \seq_set_eq:NN }
-\cs_new_protected:Npn \seq_gremove_duplicates:N
- { \__seq_remove_duplicates:NN \seq_gset_eq:NN }
-\cs_new_protected:Npn \__seq_remove_duplicates:NN #1#2
- {
- \seq_clear:N \l__seq_remove_seq
- \seq_map_inline:Nn #2
- {
- \seq_if_in:NnF \l__seq_remove_seq {##1}
- { \seq_put_right:Nn \l__seq_remove_seq {##1} }
- }
- #1 #2 \l__seq_remove_seq
- }
-\cs_generate_variant:Nn \seq_remove_duplicates:N { c }
-\cs_generate_variant:Nn \seq_gremove_duplicates:N { c }
-\cs_new_protected:Npn \seq_remove_all:Nn
- { \__seq_remove_all_aux:NNn \tl_set:Nx }
-\cs_new_protected:Npn \seq_gremove_all:Nn
- { \__seq_remove_all_aux:NNn \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_remove_all_aux:NNn #1#2#3
- {
- \__seq_push_item_def:n
- {
- \str_if_eq:nnT {##1} {#3}
- {
- \if_false: { \fi: }
- \tl_set:Nn \l__seq_internal_b_tl {##1}
- #1 #2
- { \if_false: } \fi:
- \exp_not:o {#2}
- \tl_if_eq:NNT \l__seq_internal_a_tl \l__seq_internal_b_tl
- { \use_none:nn }
- }
- \__seq_wrap_item:n {##1}
- }
- \tl_set:Nn \l__seq_internal_a_tl {#3}
- #1 #2 {#2}
- \__seq_pop_item_def:
- }
-\cs_generate_variant:Nn \seq_remove_all:Nn { c }
-\cs_generate_variant:Nn \seq_gremove_all:Nn { c }
-\prg_new_conditional:Npnn \seq_if_empty:N #1 { p , T , F , TF }
- {
- \if_meaning:w #1 \c_empty_seq
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \seq_if_empty_p:N { c }
-\cs_generate_variant:Nn \seq_if_empty:NT { c }
-\cs_generate_variant:Nn \seq_if_empty:NF { c }
-\cs_generate_variant:Nn \seq_if_empty:NTF { c }
-\prg_new_protected_conditional:Npnn \seq_if_in:Nn #1#2
- { T , F , TF }
- {
- \group_begin:
- \tl_set:Nn \l__seq_internal_a_tl {#2}
- \cs_set_protected:Npn \__seq_item:n ##1
- {
- \tl_set:Nn \l__seq_internal_b_tl {##1}
- \if_meaning:w \l__seq_internal_a_tl \l__seq_internal_b_tl
- \exp_after:wN \__seq_if_in:
- \fi:
- }
- #1
- \group_end:
- \prg_return_false:
- \__prg_break_point:
- }
-\cs_new_nopar:Npn \__seq_if_in:
- { \__prg_break:n { \group_end: \prg_return_true: } }
-\cs_generate_variant:Nn \seq_if_in:NnT { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_if_in:NnT { c , cV , cv , co , cx }
-\cs_generate_variant:Nn \seq_if_in:NnF { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_if_in:NnF { c , cV , cv , co , cx }
-\cs_generate_variant:Nn \seq_if_in:NnTF { NV , Nv , No , Nx }
-\cs_generate_variant:Nn \seq_if_in:NnTF { c , cV , cv , co , cx }
-\cs_new_protected:Npn \__seq_pop:NNNN #1#2#3#4
- {
- \if_meaning:w #3 \c_empty_seq
- \tl_set:Nn #4 { \q_no_value }
- \else:
- #1#2#3#4
- \fi:
- }
-\cs_new_protected:Npn \__seq_pop_TF:NNNN #1#2#3#4
- {
- \if_meaning:w #3 \c_empty_seq
- % \tl_set:Nn #4 { \q_no_value }
- \prg_return_false:
- \else:
- #1#2#3#4
- \prg_return_true:
- \fi:
- }
-\cs_new_protected:Npn \seq_get_left:NN #1#2
- {
- \tl_set:Nx #2
- {
- \exp_after:wN \__seq_get_left:wnw
- #1 \__seq_item:n { \q_no_value } \q_stop
- }
- }
-\cs_new:Npn \__seq_get_left:wnw #1 \__seq_item:n #2#3 \q_stop
- { \exp_not:n {#2} }
-\cs_generate_variant:Nn \seq_get_left:NN { c }
-\cs_new_protected_nopar:Npn \seq_pop_left:NN
- { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_set:Nn }
-\cs_new_protected_nopar:Npn \seq_gpop_left:NN
- { \__seq_pop:NNNN \__seq_pop_left:NNN \tl_gset:Nn }
-\cs_new_protected:Npn \__seq_pop_left:NNN #1#2#3
- { \exp_after:wN \__seq_pop_left:wnwNNN #2 \q_stop #1#2#3 }
-\cs_new_protected:Npn \__seq_pop_left:wnwNNN
- #1 \__seq_item:n #2#3 \q_stop #4#5#6
- {
- #4 #5 { #1 #3 }
- \tl_set:Nn #6 {#2}
- }
-\cs_generate_variant:Nn \seq_pop_left:NN { c }
-\cs_generate_variant:Nn \seq_gpop_left:NN { c }
-\cs_new_protected:Npn \seq_get_right:NN #1#2
- {
- \exp_after:wN \use_i_ii:nnn
- \exp_after:wN \__seq_get_right_loop:nn
- \exp_after:wN \q_no_value
- #1
- { ?? \tl_set:Nn #2 }
- { } { }
- }
-\cs_new_protected:Npn \__seq_get_right_loop:nn #1#2
- {
- \use_none:nn #2 {#1}
- \__seq_get_right_loop:nn
- }
-\cs_generate_variant:Nn \seq_get_right:NN { c }
-\cs_new_protected_nopar:Npn \seq_pop_right:NN
- { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_set:Nx }
-\cs_new_protected_nopar:Npn \seq_gpop_right:NN
- { \__seq_pop:NNNN \__seq_pop_right:NNN \tl_gset:Nx }
-\cs_new_protected:Npn \__seq_pop_right:NNN #1#2#3
- {
- \cs_set_eq:NN \__seq_tmp:w \__seq_item:n
- \cs_set_eq:NN \__seq_item:n \scan_stop:
- #1 #2
- { \if_false: } \fi: \s__seq
- \exp_after:wN \use_i:nnn
- \exp_after:wN \__seq_pop_right_loop:nn
- #2
- {
- \if_false: { \fi: }
- \tl_set:Nx #3
- }
- { } \use_none:nn
- \cs_set_eq:NN \__seq_item:n \__seq_tmp:w
- }
-\cs_new:Npn \__seq_pop_right_loop:nn #1#2
- {
- #2 { \exp_not:n {#1} }
- \__seq_pop_right_loop:nn
- }
-\cs_generate_variant:Nn \seq_pop_right:NN { c }
-\cs_generate_variant:Nn \seq_gpop_right:NN { c }
-\prg_new_protected_conditional:Npnn \seq_get_left:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \prg_do_nothing: \seq_get_left:NN #1#2 }
-\prg_new_protected_conditional:Npnn \seq_get_right:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \prg_do_nothing: \seq_get_right:NN #1#2 }
-\cs_generate_variant:Nn \seq_get_left:NNT { c }
-\cs_generate_variant:Nn \seq_get_left:NNF { c }
-\cs_generate_variant:Nn \seq_get_left:NNTF { c }
-\cs_generate_variant:Nn \seq_get_right:NNT { c }
-\cs_generate_variant:Nn \seq_get_right:NNF { c }
-\cs_generate_variant:Nn \seq_get_right:NNTF { c }
-\prg_new_protected_conditional:Npnn \seq_pop_left:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \__seq_pop_left:NNN \tl_set:Nn #1 #2 }
-\prg_new_protected_conditional:Npnn \seq_gpop_left:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \__seq_pop_left:NNN \tl_gset:Nn #1 #2 }
-\prg_new_protected_conditional:Npnn \seq_pop_right:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \__seq_pop_right:NNN \tl_set:Nx #1 #2 }
-\prg_new_protected_conditional:Npnn \seq_gpop_right:NN #1#2 { T , F , TF }
- { \__seq_pop_TF:NNNN \__seq_pop_right:NNN \tl_gset:Nx #1 #2 }
-\cs_generate_variant:Nn \seq_pop_left:NNT { c }
-\cs_generate_variant:Nn \seq_pop_left:NNF { c }
-\cs_generate_variant:Nn \seq_pop_left:NNTF { c }
-\cs_generate_variant:Nn \seq_gpop_left:NNT { c }
-\cs_generate_variant:Nn \seq_gpop_left:NNF { c }
-\cs_generate_variant:Nn \seq_gpop_left:NNTF { c }
-\cs_generate_variant:Nn \seq_pop_right:NNT { c }
-\cs_generate_variant:Nn \seq_pop_right:NNF { c }
-\cs_generate_variant:Nn \seq_pop_right:NNTF { c }
-\cs_generate_variant:Nn \seq_gpop_right:NNT { c }
-\cs_generate_variant:Nn \seq_gpop_right:NNF { c }
-\cs_generate_variant:Nn \seq_gpop_right:NNTF { c }
-\cs_new_nopar:Npn \seq_map_break:
- { \__prg_map_break:Nn \seq_map_break: { } }
-\cs_new_nopar:Npn \seq_map_break:n
- { \__prg_map_break:Nn \seq_map_break: }
-\cs_new:Npn \seq_map_function:NN #1#2
- {
- \exp_after:wN \use_i_ii:nnn
- \exp_after:wN \__seq_map_function:NNn
- \exp_after:wN #2
- #1
- { ? \seq_map_break: } { }
- \__prg_break_point:Nn \seq_map_break: { }
- }
-\cs_new:Npn \__seq_map_function:NNn #1#2#3
- {
- \use_none:n #2
- #1 {#3}
- \__seq_map_function:NNn #1
- }
-\cs_generate_variant:Nn \seq_map_function:NN { c }
-\cs_new_protected:Npn \__seq_push_item_def:n
- {
- \__seq_push_item_def:
- \cs_gset:Npn \__seq_item:n ##1
- }
-\cs_new_protected:Npn \__seq_push_item_def:x
- {
- \__seq_push_item_def:
- \cs_gset:Npx \__seq_item:n ##1
- }
-\cs_new_protected:Npn \__seq_push_item_def:
- {
- \int_gincr:N \g__prg_map_int
- \cs_gset_eq:cN { __prg_map_ \int_use:N \g__prg_map_int :w }
- \__seq_item:n
- }
-\cs_new_protected_nopar:Npn \__seq_pop_item_def:
- {
- \cs_gset_eq:Nc \__seq_item:n
- { __prg_map_ \int_use:N \g__prg_map_int :w }
- \int_gdecr:N \g__prg_map_int
- }
-\cs_new_protected:Npn \seq_map_inline:Nn #1#2
- {
- \__seq_push_item_def:n {#2}
- #1
- \__prg_break_point:Nn \seq_map_break: { \__seq_pop_item_def: }
- }
-\cs_generate_variant:Nn \seq_map_inline:Nn { c }
-\cs_new_protected:Npn \seq_map_variable:NNn #1#2#3
- {
- \__seq_push_item_def:x
- {
- \tl_set:Nn \exp_not:N #2 {##1}
- \exp_not:n {#3}
- }
- #1
- \__prg_break_point:Nn \seq_map_break: { \__seq_pop_item_def: }
- }
-\cs_generate_variant:Nn \seq_map_variable:NNn { Nc }
-\cs_generate_variant:Nn \seq_map_variable:NNn { c , cc }
-\cs_new:Npn \seq_count:N #1
- {
- \int_eval:n
- {
- 0
- \seq_map_function:NN #1 \__seq_count:n
- }
- }
-\cs_new:Npn \__seq_count:n #1 { + \c_one }
-\cs_generate_variant:Nn \seq_count:N { c }
-\cs_new:Npn \seq_use:Nnnn #1#2#3#4
- {
- \seq_if_exist:NTF #1
- {
- \int_case:nnF { \seq_count:N #1 }
- {
- { 0 } { }
- { 1 } { \exp_after:wN \__seq_use:NNnNnn #1 ? { } { } }
- { 2 } { \exp_after:wN \__seq_use:NNnNnn #1 {#2} }
- }
- {
- \exp_after:wN \__seq_use_setup:w #1 \__seq_item:n
- \q_mark { \__seq_use:nwwwwnwn {#3} }
- \q_mark { \__seq_use:nwwn {#4} }
- \q_stop { }
- }
- }
- { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
- }
-\cs_generate_variant:Nn \seq_use:Nnnn { c }
-\cs_new:Npn \__seq_use:NNnNnn #1#2#3#4#5#6 { \exp_not:n { #3 #6 #5 } }
-\cs_new:Npn \__seq_use_setup:w \s__seq { \__seq_use:nwwwwnwn { } }
-\cs_new:Npn \__seq_use:nwwwwnwn
- #1 \__seq_item:n #2 \__seq_item:n #3 \__seq_item:n #4#5
- \q_mark #6#7 \q_stop #8
- {
- #6 \__seq_item:n {#3} \__seq_item:n {#4} #5
- \q_mark {#6} #7 \q_stop { #8 #1 #2 }
- }
-\cs_new:Npn \__seq_use:nwwn #1 \__seq_item:n #2 #3 \q_stop #4
- { \exp_not:n { #4 #1 #2 } }
-\cs_new:Npn \seq_use:Nn #1#2
- { \seq_use:Nnnn #1 {#2} {#2} {#2} }
-\cs_generate_variant:Nn \seq_use:Nn { c }
-\cs_new_eq:NN \seq_push:Nn \seq_put_left:Nn
-\cs_new_eq:NN \seq_push:NV \seq_put_left:NV
-\cs_new_eq:NN \seq_push:Nv \seq_put_left:Nv
-\cs_new_eq:NN \seq_push:No \seq_put_left:No
-\cs_new_eq:NN \seq_push:Nx \seq_put_left:Nx
-\cs_new_eq:NN \seq_push:cn \seq_put_left:cn
-\cs_new_eq:NN \seq_push:cV \seq_put_left:cV
-\cs_new_eq:NN \seq_push:cv \seq_put_left:cv
-\cs_new_eq:NN \seq_push:co \seq_put_left:co
-\cs_new_eq:NN \seq_push:cx \seq_put_left:cx
-\cs_new_eq:NN \seq_gpush:Nn \seq_gput_left:Nn
-\cs_new_eq:NN \seq_gpush:NV \seq_gput_left:NV
-\cs_new_eq:NN \seq_gpush:Nv \seq_gput_left:Nv
-\cs_new_eq:NN \seq_gpush:No \seq_gput_left:No
-\cs_new_eq:NN \seq_gpush:Nx \seq_gput_left:Nx
-\cs_new_eq:NN \seq_gpush:cn \seq_gput_left:cn
-\cs_new_eq:NN \seq_gpush:cV \seq_gput_left:cV
-\cs_new_eq:NN \seq_gpush:cv \seq_gput_left:cv
-\cs_new_eq:NN \seq_gpush:co \seq_gput_left:co
-\cs_new_eq:NN \seq_gpush:cx \seq_gput_left:cx
-\cs_new_eq:NN \seq_get:NN \seq_get_left:NN
-\cs_new_eq:NN \seq_get:cN \seq_get_left:cN
-\cs_new_eq:NN \seq_pop:NN \seq_pop_left:NN
-\cs_new_eq:NN \seq_pop:cN \seq_pop_left:cN
-\cs_new_eq:NN \seq_gpop:NN \seq_gpop_left:NN
-\cs_new_eq:NN \seq_gpop:cN \seq_gpop_left:cN
-\prg_new_eq_conditional:NNn \seq_get:NN \seq_get_left:NN { T , F , TF }
-\prg_new_eq_conditional:NNn \seq_get:cN \seq_get_left:cN { T , F , TF }
-\prg_new_eq_conditional:NNn \seq_pop:NN \seq_pop_left:NN { T , F , TF }
-\prg_new_eq_conditional:NNn \seq_pop:cN \seq_pop_left:cN { T , F , TF }
-\prg_new_eq_conditional:NNn \seq_gpop:NN \seq_gpop_left:NN { T , F , TF }
-\prg_new_eq_conditional:NNn \seq_gpop:cN \seq_gpop_left:cN { T , F , TF }
-\cs_new_protected:Npn \seq_show:N #1
- {
- \__msg_show_variable:Nnn #1 { seq }
- { \seq_map_function:NN #1 \__msg_show_item:n }
- }
-\cs_generate_variant:Nn \seq_show:N { c }
-\seq_new:N \l_tmpa_seq
-\seq_new:N \l_tmpb_seq
-\seq_new:N \g_tmpa_seq
-\seq_new:N \g_tmpb_seq
-%%
-%%
-%% End of file `l3seq.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
deleted file mode 100644
index 419536abeab..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
+++ /dev/null
@@ -1,446 +0,0 @@
-%%
-%% This is file `l3skip.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3skip.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project
-%% (C) 2012,2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3skip.dtx 4581 2013-07-28 08:38:50Z joseph $
- {L3 Dimensions and skips}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_eq:NN \if_dim:w \tex_ifdim:D
-\cs_new_eq:NN \__dim_eval:w \etex_dimexpr:D
-\cs_new_eq:NN \__dim_eval_end: \tex_relax:D
-\cs_new_protected:Npn \dim_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newdimen #1
- }
-\cs_generate_variant:Nn \dim_new:N { c }
-\cs_new_protected:Npn \dim_const:Nn #1
- {
- \dim_new:N #1
- \dim_gset:Nn #1
- }
-\cs_generate_variant:Nn \dim_const:Nn { c }
-\cs_new_protected:Npn \dim_zero:N #1 { #1 \c_zero_dim }
-\cs_new_protected:Npn \dim_gzero:N { \tex_global:D \dim_zero:N }
-\cs_generate_variant:Nn \dim_zero:N { c }
-\cs_generate_variant:Nn \dim_gzero:N { c }
-\cs_new_protected:Npn \dim_zero_new:N #1
- { \dim_if_exist:NTF #1 { \dim_zero:N #1 } { \dim_new:N #1 } }
-\cs_new_protected:Npn \dim_gzero_new:N #1
- { \dim_if_exist:NTF #1 { \dim_gzero:N #1 } { \dim_new:N #1 } }
-\cs_generate_variant:Nn \dim_zero_new:N { c }
-\cs_generate_variant:Nn \dim_gzero_new:N { c }
-\prg_new_eq_conditional:NNn \dim_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \dim_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_protected:Npn \dim_set:Nn #1#2
- { #1 ~ \__dim_eval:w #2 \__dim_eval_end: }
-\cs_new_protected:Npn \dim_gset:Nn { \tex_global:D \dim_set:Nn }
-\cs_generate_variant:Nn \dim_set:Nn { c }
-\cs_generate_variant:Nn \dim_gset:Nn { c }
-\cs_new_protected:Npn \dim_set_eq:NN #1#2 { #1 = #2 }
-\cs_generate_variant:Nn \dim_set_eq:NN { c }
-\cs_generate_variant:Nn \dim_set_eq:NN { Nc , cc }
-\cs_new_protected:Npn \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
-\cs_generate_variant:Nn \dim_gset_eq:NN { c }
-\cs_generate_variant:Nn \dim_gset_eq:NN { Nc , cc }
-\cs_new_protected:Npn \dim_add:Nn #1#2
- { \tex_advance:D #1 by \__dim_eval:w #2 \__dim_eval_end: }
-\cs_new_protected:Npn \dim_gadd:Nn { \tex_global:D \dim_add:Nn }
-\cs_generate_variant:Nn \dim_add:Nn { c }
-\cs_generate_variant:Nn \dim_gadd:Nn { c }
-\cs_new_protected:Npn \dim_sub:Nn #1#2
- { \tex_advance:D #1 by - \__dim_eval:w #2 \__dim_eval_end: }
-\cs_new_protected:Npn \dim_gsub:Nn { \tex_global:D \dim_sub:Nn }
-\cs_generate_variant:Nn \dim_sub:Nn { c }
-\cs_generate_variant:Nn \dim_gsub:Nn { c }
-\cs_new:Npn \dim_abs:n #1
- {
- \exp_after:wN \__dim_abs:N
- \dim_use:N \__dim_eval:w #1 \__dim_eval_end:
- }
-\cs_new:Npn \__dim_abs:N #1
- { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
-\cs_set:Npn \dim_max:nn #1#2
- {
- \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
- \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
- \dim_use:N \__dim_eval:w #2 ;
- >
- \__dim_eval_end:
- }
-\cs_set:Npn \dim_min:nn #1#2
- {
- \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
- \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
- \dim_use:N \__dim_eval:w #2 ;
- <
- \__dim_eval_end:
- }
-\cs_new:Npn \__dim_maxmin:wwN #1 ; #2 ; #3
- {
- \if_dim:w #1 #3 #2 ~
- #1
- \else:
- #2
- \fi:
- }
-\cs_new:Npn \dim_ratio:nn #1#2
- { \__dim_ratio:n {#1} / \__dim_ratio:n {#2} }
-\cs_new:Npn \__dim_ratio:n #1
- { \__int_value:w \__dim_eval:w #1 \__dim_eval_end: }
-\prg_new_conditional:Npnn \dim_compare:nNn #1#2#3 { p , T , F , TF }
- {
- \if_dim:w \__dim_eval:w #1 #2 \__dim_eval:w #3 \__dim_eval_end:
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \dim_compare:n #1 { p , T , F , TF }
- {
- \exp_after:wN \__dim_compare:w
- \dim_use:N \__dim_eval:w #1 \__prg_compare_error:
- }
-\cs_new:Npn \__dim_compare:w #1 \__prg_compare_error:
- {
- \exp_after:wN \if_false: \tex_romannumeral:D -`0
- \__dim_compare:wNN #1 ? { = \__dim_compare_end:w \else: } \q_stop
- }
-\exp_args:Nno \use:nn
- { \cs_new:Npn \__dim_compare:wNN #1 }
- { \tl_to_str:n {pt} }
- #2#3
- {
- \if_meaning:w = #3
- \use:c { __dim_compare_#2:w }
- \fi:
- #1 pt \exp_stop_f:
- \prg_return_false:
- \exp_after:wN \use_none_delimit_by_q_stop:w
- \fi:
- \reverse_if:N \if_dim:w #1 pt #2
- \exp_after:wN \__dim_compare:wNN
- \dim_use:N \__dim_eval:w #3
- }
-\cs_new:cpn { __dim_compare_ ! :w }
- #1 \reverse_if:N #2 ! #3 = { #1 #2 = #3 }
-\cs_new:cpn { __dim_compare_ = :w }
- #1 \__dim_eval:w = { #1 \__dim_eval:w }
-\cs_new:cpn { __dim_compare_ < :w }
- #1 \reverse_if:N #2 < #3 = { #1 #2 > #3 }
-\cs_new:cpn { __dim_compare_ > :w }
- #1 \reverse_if:N #2 > #3 = { #1 #2 < #3 }
-\cs_new:Npn \__dim_compare_end:w #1 \prg_return_false: #2 \q_stop
- { #1 \prg_return_false: \else: \prg_return_true: \fi: }
-\cs_new:Npn \dim_case:nnTF #1
- {
- \tex_romannumeral:D
- \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} }
- }
-\cs_new:Npn \dim_case:nnT #1#2#3
- {
- \tex_romannumeral:D
- \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} {#3} { }
- }
-\cs_new:Npn \dim_case:nnF #1#2
- {
- \tex_romannumeral:D
- \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} { }
- }
-\cs_new:Npn \dim_case:nn #1#2
- {
- \tex_romannumeral:D
- \exp_args:Nf \__dim_case:nnTF { \dim_eval:n {#1} } {#2} { } { }
- }
-\cs_new:Npn \__dim_case:nnTF #1#2#3#4
- { \__dim_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
-\cs_new:Npn \__dim_case:nw #1#2#3
- {
- \dim_compare:nNnTF {#1} = {#2}
- { \__dim_case_end:nw {#3} }
- { \__dim_case:nw {#1} }
- }
-\cs_new_eq:NN \__dim_case_end:nw \__prg_case_end:nw
-\cs_set:Npn \dim_while_do:nn #1#2
- {
- \dim_compare:nT {#1}
- {
- #2
- \dim_while_do:nn {#1} {#2}
- }
- }
-\cs_set:Npn \dim_until_do:nn #1#2
- {
- \dim_compare:nF {#1}
- {
- #2
- \dim_until_do:nn {#1} {#2}
- }
- }
-\cs_set:Npn \dim_do_while:nn #1#2
- {
- #2
- \dim_compare:nT {#1}
- { \dim_do_while:nn {#1} {#2} }
- }
-\cs_set:Npn \dim_do_until:nn #1#2
- {
- #2
- \dim_compare:nF {#1}
- { \dim_do_until:nn {#1} {#2} }
- }
-\cs_set:Npn \dim_while_do:nNnn #1#2#3#4
- {
- \dim_compare:nNnT {#1} #2 {#3}
- {
- #4
- \dim_while_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_set:Npn \dim_until_do:nNnn #1#2#3#4
- {
- \dim_compare:nNnF {#1} #2 {#3}
- {
- #4
- \dim_until_do:nNnn {#1} #2 {#3} {#4}
- }
- }
-\cs_set:Npn \dim_do_while:nNnn #1#2#3#4
- {
- #4
- \dim_compare:nNnT {#1} #2 {#3}
- { \dim_do_while:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_set:Npn \dim_do_until:nNnn #1#2#3#4
- {
- #4
- \dim_compare:nNnF {#1} #2 {#3}
- { \dim_do_until:nNnn {#1} #2 {#3} {#4} }
- }
-\cs_new:Npn \dim_eval:n #1
- { \dim_use:N \__dim_eval:w #1 \__dim_eval_end: }
-\cs_new:Npn \__dim_strip_bp:n #1
- { \__dim_strip_pt:n { 0.996 26 \__dim_eval:w #1 \__dim_eval_end: } }
-\cs_new:Npn \__dim_strip_pt:n #1
- {
- \exp_after:wN
- \__dim_strip_pt:w \dim_use:N \__dim_eval:w #1 \__dim_eval_end: \q_stop
- }
-\use:x
- {
- \cs_new:Npn \exp_not:N \__dim_strip_pt:w
- ##1 . ##2 \tl_to_str:n { pt } ##3 \exp_not:N \q_stop
- {
- ##1
- \exp_not:N \int_compare:nNnT {##2} > \c_zero
- { . ##2 }
- }
- }
-\cs_new_eq:NN \dim_use:N \tex_the:D
-\cs_generate_variant:Nn \dim_use:N { c }
-\cs_new_eq:NN \dim_show:N \__kernel_register_show:N
-\cs_generate_variant:Nn \dim_show:N { c }
-\cs_new_protected:Npn \dim_show:n #1
- { \etex_showtokens:D \exp_after:wN { \dim_use:N \__dim_eval:w #1 } }
-\dim_const:Nn \c_zero_dim { 0 pt }
-\dim_const:Nn \c_max_dim { 16383.99999 pt }
-\dim_new:N \l_tmpa_dim
-\dim_new:N \l_tmpb_dim
-\dim_new:N \g_tmpa_dim
-\dim_new:N \g_tmpb_dim
-\cs_new_protected:Npn \skip_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newskip #1
- }
-\cs_generate_variant:Nn \skip_new:N { c }
-\cs_new_protected:Npn \skip_const:Nn #1
- {
- \skip_new:N #1
- \skip_gset:Nn #1
- }
-\cs_generate_variant:Nn \skip_const:Nn { c }
-\cs_new_protected:Npn \skip_zero:N #1 { #1 \c_zero_skip }
-\cs_new_protected:Npn \skip_gzero:N { \tex_global:D \skip_zero:N }
-\cs_generate_variant:Nn \skip_zero:N { c }
-\cs_generate_variant:Nn \skip_gzero:N { c }
-\cs_new_protected:Npn \skip_zero_new:N #1
- { \skip_if_exist:NTF #1 { \skip_zero:N #1 } { \skip_new:N #1 } }
-\cs_new_protected:Npn \skip_gzero_new:N #1
- { \skip_if_exist:NTF #1 { \skip_gzero:N #1 } { \skip_new:N #1 } }
-\cs_generate_variant:Nn \skip_zero_new:N { c }
-\cs_generate_variant:Nn \skip_gzero_new:N { c }
-\prg_new_eq_conditional:NNn \skip_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \skip_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_protected:Npn \skip_set:Nn #1#2
- { #1 ~ \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gset:Nn { \tex_global:D \skip_set:Nn }
-\cs_generate_variant:Nn \skip_set:Nn { c }
-\cs_generate_variant:Nn \skip_gset:Nn { c }
-\cs_new_protected:Npn \skip_set_eq:NN #1#2 { #1 = #2 }
-\cs_generate_variant:Nn \skip_set_eq:NN { c }
-\cs_generate_variant:Nn \skip_set_eq:NN { Nc , cc }
-\cs_new_protected:Npn \skip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
-\cs_generate_variant:Nn \skip_gset_eq:NN { c }
-\cs_generate_variant:Nn \skip_gset_eq:NN { Nc , cc }
-\cs_new_protected:Npn \skip_add:Nn #1#2
- { \tex_advance:D #1 by \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gadd:Nn { \tex_global:D \skip_add:Nn }
-\cs_generate_variant:Nn \skip_add:Nn { c }
-\cs_generate_variant:Nn \skip_gadd:Nn { c }
-\cs_new_protected:Npn \skip_sub:Nn #1#2
- { \tex_advance:D #1 by - \etex_glueexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \skip_gsub:Nn { \tex_global:D \skip_sub:Nn }
-\cs_generate_variant:Nn \skip_sub:Nn { c }
-\cs_generate_variant:Nn \skip_gsub:Nn { c }
-\prg_new_conditional:Npnn \skip_if_eq:nn #1#2 { p , T , F , TF }
- {
- \if_int_compare:w
- \pdftex_strcmp:D { \skip_eval:n { #1 } } { \skip_eval:n { #2 } }
- = \c_zero
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_set_protected:Npn \__cs_tmp:w #1
- {
- \prg_new_conditional:Npnn \skip_if_finite:n ##1 { p , T , F , TF }
- {
- \exp_after:wN \__skip_if_finite:wwNw
- \skip_use:N \etex_glueexpr:D ##1 ; \prg_return_false:
- #1 ; \prg_return_true: \q_stop
- }
- \cs_new:Npn \__skip_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3}
- }
-\exp_args:No \__cs_tmp:w { \tl_to_str:n { fil } }
-\cs_new:Npn \skip_eval:n #1
- { \skip_use:N \etex_glueexpr:D #1 \scan_stop: }
-\cs_new_eq:NN \skip_use:N \tex_the:D
-\cs_generate_variant:Nn \skip_use:N { c }
-\cs_new_eq:NN \skip_horizontal:N \tex_hskip:D
-\cs_new:Npn \skip_horizontal:n #1
- { \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: }
-\cs_new_eq:NN \skip_vertical:N \tex_vskip:D
-\cs_new:Npn \skip_vertical:n #1
- { \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: }
-\cs_generate_variant:Nn \skip_horizontal:N { c }
-\cs_generate_variant:Nn \skip_vertical:N { c }
-\cs_new_eq:NN \skip_show:N \__kernel_register_show:N
-\cs_generate_variant:Nn \skip_show:N { c }
-\cs_new_protected:Npn \skip_show:n #1
- { \etex_showtokens:D \exp_after:wN { \tex_the:D \etex_glueexpr:D #1 } }
-\skip_const:Nn \c_zero_skip { \c_zero_dim }
-\skip_const:Nn \c_max_skip { \c_max_dim }
-\skip_new:N \l_tmpa_skip
-\skip_new:N \l_tmpb_skip
-\skip_new:N \g_tmpa_skip
-\skip_new:N \g_tmpb_skip
-\cs_new_protected:Npn \muskip_new:N #1
- {
- \__chk_if_free_cs:N #1
- \newmuskip #1
- }
-\cs_generate_variant:Nn \muskip_new:N { c }
-\cs_new_protected:Npn \muskip_const:Nn #1
- {
- \muskip_new:N #1
- \muskip_gset:Nn #1
- }
-\cs_generate_variant:Nn \muskip_const:Nn { c }
-\cs_new_protected:Npn \muskip_zero:N #1
- { #1 \c_zero_muskip }
-\cs_new_protected:Npn \muskip_gzero:N { \tex_global:D \muskip_zero:N }
-\cs_generate_variant:Nn \muskip_zero:N { c }
-\cs_generate_variant:Nn \muskip_gzero:N { c }
-\cs_new_protected:Npn \muskip_zero_new:N #1
- { \muskip_if_exist:NTF #1 { \muskip_zero:N #1 } { \muskip_new:N #1 } }
-\cs_new_protected:Npn \muskip_gzero_new:N #1
- { \muskip_if_exist:NTF #1 { \muskip_gzero:N #1 } { \muskip_new:N #1 } }
-\cs_generate_variant:Nn \muskip_zero_new:N { c }
-\cs_generate_variant:Nn \muskip_gzero_new:N { c }
-\prg_new_eq_conditional:NNn \muskip_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \muskip_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\cs_new_protected:Npn \muskip_set:Nn #1#2
- { #1 ~ \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gset:Nn { \tex_global:D \muskip_set:Nn }
-\cs_generate_variant:Nn \muskip_set:Nn { c }
-\cs_generate_variant:Nn \muskip_gset:Nn { c }
-\cs_new_protected:Npn \muskip_set_eq:NN #1#2 { #1 = #2 }
-\cs_generate_variant:Nn \muskip_set_eq:NN { c }
-\cs_generate_variant:Nn \muskip_set_eq:NN { Nc , cc }
-\cs_new_protected:Npn \muskip_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
-\cs_generate_variant:Nn \muskip_gset_eq:NN { c }
-\cs_generate_variant:Nn \muskip_gset_eq:NN { Nc , cc }
-\cs_new_protected:Npn \muskip_add:Nn #1#2
- { \tex_advance:D #1 by \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gadd:Nn { \tex_global:D \muskip_add:Nn }
-\cs_generate_variant:Nn \muskip_add:Nn { c }
-\cs_generate_variant:Nn \muskip_gadd:Nn { c }
-\cs_new_protected:Npn \muskip_sub:Nn #1#2
- { \tex_advance:D #1 by - \etex_muexpr:D #2 \scan_stop: }
-\cs_new_protected:Npn \muskip_gsub:Nn { \tex_global:D \muskip_sub:Nn }
-\cs_generate_variant:Nn \muskip_sub:Nn { c }
-\cs_generate_variant:Nn \muskip_gsub:Nn { c }
-\cs_new:Npn \muskip_eval:n #1
- { \muskip_use:N \etex_muexpr:D #1 \scan_stop: }
-\cs_new_eq:NN \muskip_use:N \tex_the:D
-\cs_generate_variant:Nn \muskip_use:N { c }
-\cs_new_eq:NN \muskip_show:N \__kernel_register_show:N
-\cs_generate_variant:Nn \muskip_show:N { c }
-\cs_new_protected:Npn \muskip_show:n #1
- { \etex_showtokens:D \exp_after:wN { \tex_the:D \etex_muexpr:D #1 } }
-\muskip_const:Nn \c_zero_muskip { 0 mu }
-\muskip_const:Nn \c_max_muskip { 16383.99999 mu }
-\muskip_new:N \l_tmpa_muskip
-\muskip_new:N \l_tmpb_muskip
-\muskip_new:N \g_tmpa_muskip
-\muskip_new:N \g_tmpb_muskip
-\cs_new_eq:NN \dim_case:nnn \dim_case:nnF
-%%
-%%
-%% End of file `l3skip.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty b/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
deleted file mode 100644
index 9e1afe4039e..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3tl.sty
+++ /dev/null
@@ -1,778 +0,0 @@
-%%
-%% This is file `l3tl.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3tl.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3tl.dtx Copyright (C) 1990-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3tl.dtx 4625 2013-12-27 15:55:36Z joseph $
- {L3 Token lists}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_protected:Npn \tl_new:N #1
- {
- \__chk_if_free_cs:N #1
- \cs_gset_eq:NN #1 \c_empty_tl
- }
-\cs_generate_variant:Nn \tl_new:N { c }
-\cs_new_protected:Npn \tl_const:Nn #1#2
- {
- \__chk_if_free_cs:N #1
- \cs_gset_nopar:Npx #1 { \exp_not:n {#2} }
- }
-\cs_new_protected:Npn \tl_const:Nx #1#2
- {
- \__chk_if_free_cs:N #1
- \cs_gset_nopar:Npx #1 {#2}
- }
-\cs_generate_variant:Nn \tl_const:Nn { c }
-\cs_generate_variant:Nn \tl_const:Nx { c }
-\cs_new_protected:Npn \tl_clear:N #1
- { \tl_set_eq:NN #1 \c_empty_tl }
-\cs_new_protected:Npn \tl_gclear:N #1
- { \tl_gset_eq:NN #1 \c_empty_tl }
-\cs_generate_variant:Nn \tl_clear:N { c }
-\cs_generate_variant:Nn \tl_gclear:N { c }
-\cs_new_protected:Npn \tl_clear_new:N #1
- { \tl_if_exist:NTF #1 { \tl_clear:N #1 } { \tl_new:N #1 } }
-\cs_new_protected:Npn \tl_gclear_new:N #1
- { \tl_if_exist:NTF #1 { \tl_gclear:N #1 } { \tl_new:N #1 } }
-\cs_generate_variant:Nn \tl_clear_new:N { c }
-\cs_generate_variant:Nn \tl_gclear_new:N { c }
-\cs_new_eq:NN \tl_set_eq:NN \cs_set_eq:NN
-\cs_new_eq:NN \tl_set_eq:cN \cs_set_eq:cN
-\cs_new_eq:NN \tl_set_eq:Nc \cs_set_eq:Nc
-\cs_new_eq:NN \tl_set_eq:cc \cs_set_eq:cc
-\cs_new_eq:NN \tl_gset_eq:NN \cs_gset_eq:NN
-\cs_new_eq:NN \tl_gset_eq:cN \cs_gset_eq:cN
-\cs_new_eq:NN \tl_gset_eq:Nc \cs_gset_eq:Nc
-\cs_new_eq:NN \tl_gset_eq:cc \cs_gset_eq:cc
-\cs_new_protected:Npn \tl_concat:NNN #1#2#3
- { \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
-\cs_new_protected:Npn \tl_gconcat:NNN #1#2#3
- { \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } }
-\cs_generate_variant:Nn \tl_concat:NNN { ccc }
-\cs_generate_variant:Nn \tl_gconcat:NNN { ccc }
-\prg_new_eq_conditional:NNn \tl_if_exist:N \cs_if_exist:N { TF , T , F , p }
-\prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p }
-\tl_const:Nn \c_empty_tl { }
-\tl_const:Nx \c_job_name_tl { \tex_jobname:D }
-\tl_const:Nn \c_space_tl { ~ }
-\cs_new_protected:Npn \tl_set:Nn #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:n {#2} } }
-\cs_new_protected:Npn \tl_set:No #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o {#2} } }
-\cs_new_protected:Npn \tl_set:Nx #1#2
- { \cs_set_nopar:Npx #1 {#2} }
-\cs_new_protected:Npn \tl_gset:Nn #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} } }
-\cs_new_protected:Npn \tl_gset:No #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} } }
-\cs_new_protected:Npn \tl_gset:Nx #1#2
- { \cs_gset_nopar:Npx #1 {#2} }
-\cs_generate_variant:Nn \tl_set:Nn { NV , Nv , Nf }
-\cs_generate_variant:Nn \tl_set:Nx { c }
-\cs_generate_variant:Nn \tl_set:Nn { c, co , cV , cv , cf }
-\cs_generate_variant:Nn \tl_gset:Nn { NV , Nv , Nf }
-\cs_generate_variant:Nn \tl_gset:Nx { c }
-\cs_generate_variant:Nn \tl_gset:Nn { c, co , cV , cv , cf }
-\cs_new_protected:Npn \tl_put_left:Nn #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_put_left:NV #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_put_left:No #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_put_left:Nx #1#2
- { \cs_set_nopar:Npx #1 { #2 \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_gput_left:Nn #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:n {#2} \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_gput_left:NV #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:V #2 \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_gput_left:No #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o {#2} \exp_not:o #1 } }
-\cs_new_protected:Npn \tl_gput_left:Nx #1#2
- { \cs_gset_nopar:Npx #1 { #2 \exp_not:o {#1} } }
-\cs_generate_variant:Nn \tl_put_left:Nn { c }
-\cs_generate_variant:Nn \tl_put_left:NV { c }
-\cs_generate_variant:Nn \tl_put_left:No { c }
-\cs_generate_variant:Nn \tl_put_left:Nx { c }
-\cs_generate_variant:Nn \tl_gput_left:Nn { c }
-\cs_generate_variant:Nn \tl_gput_left:NV { c }
-\cs_generate_variant:Nn \tl_gput_left:No { c }
-\cs_generate_variant:Nn \tl_gput_left:Nx { c }
-\cs_new_protected:Npn \tl_put_right:Nn #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } }
-\cs_new_protected:Npn \tl_put_right:NV #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } }
-\cs_new_protected:Npn \tl_put_right:No #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } }
-\cs_new_protected:Npn \tl_put_right:Nx #1#2
- { \cs_set_nopar:Npx #1 { \exp_not:o #1 #2 } }
-\cs_new_protected:Npn \tl_gput_right:Nn #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:n {#2} } }
-\cs_new_protected:Npn \tl_gput_right:NV #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:V #2 } }
-\cs_new_protected:Npn \tl_gput_right:No #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o #1 \exp_not:o {#2} } }
-\cs_new_protected:Npn \tl_gput_right:Nx #1#2
- { \cs_gset_nopar:Npx #1 { \exp_not:o {#1} #2 } }
-\cs_generate_variant:Nn \tl_put_right:Nn { c }
-\cs_generate_variant:Nn \tl_put_right:NV { c }
-\cs_generate_variant:Nn \tl_put_right:No { c }
-\cs_generate_variant:Nn \tl_put_right:Nx { c }
-\cs_generate_variant:Nn \tl_gput_right:Nn { c }
-\cs_generate_variant:Nn \tl_gput_right:NV { c }
-\cs_generate_variant:Nn \tl_gput_right:No { c }
-\cs_generate_variant:Nn \tl_gput_right:Nx { c }
-\group_begin:
- \tex_lccode:D `\A = `\@ \scan_stop:
- \tex_lccode:D `\B = `\@ \scan_stop:
- \tex_catcode:D `\A = 8 \scan_stop:
- \tex_catcode:D `\B = 3 \scan_stop:
-\tex_lowercase:D
- {
- \group_end:
- \tl_const:Nn \c__tl_rescan_marker_tl { A B }
- }
-\cs_new_protected_nopar:Npn \tl_set_rescan:Nnn
- { \__tl_set_rescan:NNnn \tl_set:Nn }
-\cs_new_protected_nopar:Npn \tl_gset_rescan:Nnn
- { \__tl_set_rescan:NNnn \tl_gset:Nn }
-\cs_new_protected_nopar:Npn \tl_rescan:nn
- { \__tl_set_rescan:NNnn \prg_do_nothing: \use:n }
-\cs_new_protected:Npn \__tl_set_rescan:NNnn #1#2#3#4
- {
- \group_begin:
- \exp_args:No \etex_everyeof:D { \c__tl_rescan_marker_tl \exp_not:N }
- \tex_endlinechar:D \c_minus_one
- \tex_newlinechar:D \c_minus_one
- #3
- \use:x
- {
- \group_end:
- #1 \exp_not:N #2
- {
- \exp_after:wN \__tl_rescan:w
- \exp_after:wN \prg_do_nothing:
- \etex_scantokens:D {#4}
- }
- }
- }
-\use:x
- {
- \cs_new:Npn \exp_not:N \__tl_rescan:w ##1
- \c__tl_rescan_marker_tl
- { \exp_not:N \exp_not:o { ##1 } }
- }
-\cs_generate_variant:Nn \tl_set_rescan:Nnn { Nno , Nnx }
-\cs_generate_variant:Nn \tl_set_rescan:Nnn { c , cno , cnx }
-\cs_generate_variant:Nn \tl_gset_rescan:Nnn { Nno , Nnx }
-\cs_generate_variant:Nn \tl_gset_rescan:Nnn { c , cno }
-\cs_new_protected:Npn \tl_to_lowercase:n #1
- { \tex_lowercase:D {#1} }
-\cs_new_protected:Npn \tl_to_uppercase:n #1
- { \tex_uppercase:D {#1} }
-\cs_new_protected_nopar:Npn \tl_replace_once:Nnn
- { \__tl_replace:NNNnn \__tl_replace_once: \tl_set:Nx }
-\cs_new_protected_nopar:Npn \tl_greplace_once:Nnn
- { \__tl_replace:NNNnn \__tl_replace_once: \tl_gset:Nx }
-\cs_new_protected_nopar:Npn \tl_replace_all:Nnn
- { \__tl_replace:NNNnn \__tl_replace_all: \tl_set:Nx }
-\cs_new_protected_nopar:Npn \tl_greplace_all:Nnn
- { \__tl_replace:NNNnn \__tl_replace_all: \tl_gset:Nx }
-\cs_generate_variant:Nn \tl_replace_once:Nnn { c }
-\cs_generate_variant:Nn \tl_greplace_once:Nnn { c }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { c }
-\cs_generate_variant:Nn \tl_greplace_all:Nnn { c }
-\cs_new_protected:Npn \__tl_replace:NNNnn #1#2#3#4#5
- {
- \tl_if_empty:nTF {#4}
- {
- \__msg_kernel_error:nnx { kernel } { empty-search-pattern }
- { \tl_to_str:n {#5} }
- }
- {
- \group_align_safe_begin:
- \cs_set:Npx \__tl_tmp:w ##1##2 #4
- {
- ##2
- \exp_not:N \q_mark
- \exp_not:N \use_none_delimit_by_q_stop:w
- \exp_not:n { \exp_not:n {#5} }
- ##1
- }
- \group_align_safe_end:
- #2 #3
- {
- \exp_after:wN #1
- #3 \q_mark #4 \q_stop
- }
- }
- }
-\cs_new:Npn \__tl_replace:w #1 \q_mark #2 { \exp_not:o {#1} }
-\cs_new_nopar:Npn \__tl_replace_all:
- {
- \exp_after:wN \__tl_replace:w
- \__tl_tmp:w \__tl_replace_all: \prg_do_nothing:
- }
-\cs_new_nopar:Npn \__tl_replace_once:
- {
- \exp_after:wN \__tl_replace:w
- \__tl_tmp:w { \__tl_replace_once_end:w \prg_do_nothing: } \prg_do_nothing:
- }
-\cs_new:Npn \__tl_replace_once_end:w #1 \q_mark #2 \q_stop
- { \exp_not:o {#1} }
-\cs_new_protected:Npn \tl_remove_once:Nn #1#2
- { \tl_replace_once:Nnn #1 {#2} { } }
-\cs_new_protected:Npn \tl_gremove_once:Nn #1#2
- { \tl_greplace_once:Nnn #1 {#2} { } }
-\cs_generate_variant:Nn \tl_remove_once:Nn { c }
-\cs_generate_variant:Nn \tl_gremove_once:Nn { c }
-\cs_new_protected:Npn \tl_remove_all:Nn #1#2
- { \tl_replace_all:Nnn #1 {#2} { } }
-\cs_new_protected:Npn \tl_gremove_all:Nn #1#2
- { \tl_greplace_all:Nnn #1 {#2} { } }
-\cs_generate_variant:Nn \tl_remove_all:Nn { c }
-\cs_generate_variant:Nn \tl_gremove_all:Nn { c }
-\prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
- { \__tl_if_empty_return:o { \use_none:n #1 ? } }
-\cs_generate_variant:Nn \tl_if_blank_p:n { V }
-\cs_generate_variant:Nn \tl_if_blank:nT { V }
-\cs_generate_variant:Nn \tl_if_blank:nF { V }
-\cs_generate_variant:Nn \tl_if_blank:nTF { V }
-\cs_generate_variant:Nn \tl_if_blank_p:n { o }
-\cs_generate_variant:Nn \tl_if_blank:nT { o }
-\cs_generate_variant:Nn \tl_if_blank:nF { o }
-\cs_generate_variant:Nn \tl_if_blank:nTF { o }
-\prg_new_conditional:Npnn \tl_if_empty:N #1 { p , T , F , TF }
- {
- \if_meaning:w #1 \c_empty_tl
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \tl_if_empty_p:N { c }
-\cs_generate_variant:Nn \tl_if_empty:NT { c }
-\cs_generate_variant:Nn \tl_if_empty:NF { c }
-\cs_generate_variant:Nn \tl_if_empty:NTF { c }
-\prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F }
- {
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil \tl_to_str:n {#1} \q_nil
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \tl_if_empty_p:n { V }
-\cs_generate_variant:Nn \tl_if_empty:nTF { V }
-\cs_generate_variant:Nn \tl_if_empty:nT { V }
-\cs_generate_variant:Nn \tl_if_empty:nF { V }
-\cs_new:Npn \__tl_if_empty_return:o #1
- {
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
- \tl_to_str:n \exp_after:wN {#1} \q_nil
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
- { \__tl_if_empty_return:o {#1} }
-\prg_new_conditional:Npnn \tl_if_eq:NN #1#2 { p , T , F , TF }
- {
- \if_meaning:w #1 #2
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \tl_if_eq_p:NN { Nc , c , cc }
-\cs_generate_variant:Nn \tl_if_eq:NNTF { Nc , c , cc }
-\cs_generate_variant:Nn \tl_if_eq:NNT { Nc , c , cc }
-\cs_generate_variant:Nn \tl_if_eq:NNF { Nc , c , cc }
-\prg_new_protected_conditional:Npnn \tl_if_eq:nn #1#2 { T , F , TF }
- {
- \group_begin:
- \tl_set:Nn \l__tl_internal_a_tl {#1}
- \tl_set:Nn \l__tl_internal_b_tl {#2}
- \if_meaning:w \l__tl_internal_a_tl \l__tl_internal_b_tl
- \group_end:
- \prg_return_true:
- \else:
- \group_end:
- \prg_return_false:
- \fi:
- }
-\tl_new:N \l__tl_internal_a_tl
-\tl_new:N \l__tl_internal_b_tl
-\cs_new_protected_nopar:Npn \tl_if_in:NnT { \exp_args:No \tl_if_in:nnT }
-\cs_new_protected_nopar:Npn \tl_if_in:NnF { \exp_args:No \tl_if_in:nnF }
-\cs_new_protected_nopar:Npn \tl_if_in:NnTF { \exp_args:No \tl_if_in:nnTF }
-\cs_generate_variant:Nn \tl_if_in:NnT { c }
-\cs_generate_variant:Nn \tl_if_in:NnF { c }
-\cs_generate_variant:Nn \tl_if_in:NnTF { c }
-\prg_new_protected_conditional:Npnn \tl_if_in:nn #1#2 { T , F , TF }
- {
- \cs_set:Npn \__tl_tmp:w ##1 #2 { }
- \tl_if_empty:oTF { \__tl_tmp:w #1 {} {} #2 }
- { \prg_return_false: } { \prg_return_true: }
- }
-\cs_generate_variant:Nn \tl_if_in:nnT { V , o , no }
-\cs_generate_variant:Nn \tl_if_in:nnF { V , o , no }
-\cs_generate_variant:Nn \tl_if_in:nnTF { V , o , no }
-\cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n }
-\cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT }
-\cs_new:Npn \tl_if_single:NF { \exp_args:No \tl_if_single:nF }
-\cs_new:Npn \tl_if_single:NTF { \exp_args:No \tl_if_single:nTF }
-\prg_new_conditional:Npnn \tl_if_single:n #1 { p , T , F , TF }
- { \__str_if_eq_x_return:nn { \exp_not:o { \use_none:nn #1 ?? } } {?} }
-\cs_new:Npn \tl_case:Nn #1#2
- {
- \tex_romannumeral:D
- \__tl_case:NnTF #1 {#2} { } { }
- }
-\cs_new:Npn \tl_case:NnT #1#2#3
- {
- \tex_romannumeral:D
- \__tl_case:NnTF #1 {#2} {#3} { }
- }
-\cs_new:Npn \tl_case:NnF #1#2#3
- {
- \tex_romannumeral:D
- \__tl_case:NnTF #1 {#2} { } {#3}
- }
-\cs_new:Npn \tl_case:NnTF #1#2
- {
- \tex_romannumeral:D
- \__tl_case:NnTF #1 {#2}
- }
-\cs_new:Npn \__tl_case:NnTF #1#2#3#4
- { \__tl_case:Nw #1 #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop }
-\cs_new:Npn \__tl_case:Nw #1#2#3
- {
- \tl_if_eq:NNTF #1 #2
- { \__tl_case_end:nw {#3} }
- { \__tl_case:Nw #1 }
- }
-\cs_generate_variant:Nn \tl_case:Nn { c }
-\cs_generate_variant:Nn \tl_case:NnT { c }
-\cs_generate_variant:Nn \tl_case:NnF { c }
-\cs_generate_variant:Nn \tl_case:NnTF { c }
-\cs_new_eq:NN \__tl_case_end:nw \__prg_case_end:nw
-\cs_new:Npn \tl_map_function:nN #1#2
- {
- \__tl_map_function:Nn #2 #1
- \q_recursion_tail
- \__prg_break_point:Nn \tl_map_break: { }
- }
-\cs_new_nopar:Npn \tl_map_function:NN
- { \exp_args:No \tl_map_function:nN }
-\cs_new:Npn \__tl_map_function:Nn #1#2
- {
- \__quark_if_recursion_tail_break:nN {#2} \tl_map_break:
- #1 {#2} \__tl_map_function:Nn #1
- }
-\cs_generate_variant:Nn \tl_map_function:NN { c }
-\cs_new_protected:Npn \tl_map_inline:nn #1#2
- {
- \int_gincr:N \g__prg_map_int
- \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
- \exp_args:Nc \__tl_map_function:Nn
- { __prg_map_ \int_use:N \g__prg_map_int :w }
- #1 \q_recursion_tail
- \__prg_break_point:Nn \tl_map_break: { \int_gdecr:N \g__prg_map_int }
- }
-\cs_new_protected:Npn \tl_map_inline:Nn
- { \exp_args:No \tl_map_inline:nn }
-\cs_generate_variant:Nn \tl_map_inline:Nn { c }
-\cs_new_protected:Npn \tl_map_variable:nNn #1#2#3
- {
- \__tl_map_variable:Nnn #2 {#3} #1
- \q_recursion_tail
- \__prg_break_point:Nn \tl_map_break: { }
- }
-\cs_new_protected_nopar:Npn \tl_map_variable:NNn
- { \exp_args:No \tl_map_variable:nNn }
-\cs_new_protected:Npn \__tl_map_variable:Nnn #1#2#3
- {
- \tl_set:Nn #1 {#3}
- \__quark_if_recursion_tail_break:NN #1 \tl_map_break:
- \use:n {#2}
- \__tl_map_variable:Nnn #1 {#2}
- }
-\cs_generate_variant:Nn \tl_map_variable:NNn { c }
-\cs_new_nopar:Npn \tl_map_break:
- { \__prg_map_break:Nn \tl_map_break: { } }
-\cs_new_nopar:Npn \tl_map_break:n
- { \__prg_map_break:Nn \tl_map_break: }
-\cs_new_eq:NN \tl_to_str:n \etex_detokenize:D
-\cs_new:Npn \tl_to_str:N #1 { \etex_detokenize:D \exp_after:wN {#1} }
-\cs_generate_variant:Nn \tl_to_str:N { c }
-\cs_new:Npn \tl_use:N #1
- {
- \tl_if_exist:NTF #1 {#1}
- { \__msg_kernel_expandable_error:nnn { kernel } { bad-variable } {#1} }
- }
-\cs_generate_variant:Nn \tl_use:N { c }
-\cs_new:Npn \tl_count:n #1
- {
- \int_eval:n
- { 0 \tl_map_function:nN {#1} \__tl_count:n }
- }
-\cs_new:Npn \tl_count:N #1
- {
- \int_eval:n
- { 0 \tl_map_function:NN #1 \__tl_count:n }
- }
-\cs_new:Npn \__tl_count:n #1 { + \c_one }
-\cs_generate_variant:Nn \tl_count:n { V , o }
-\cs_generate_variant:Nn \tl_count:N { c }
-\cs_new:Npn \tl_reverse_items:n #1
- {
- \__tl_reverse_items:nwNwn #1 ?
- \q_mark \__tl_reverse_items:nwNwn
- \q_mark \__tl_reverse_items:wn
- \q_stop { }
- }
-\cs_new:Npn \__tl_reverse_items:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5
- {
- #3 #2
- \q_mark \__tl_reverse_items:nwNwn
- \q_mark \__tl_reverse_items:wn
- \q_stop { {#1} #5 }
- }
-\cs_new:Npn \__tl_reverse_items:wn #1 \q_stop #2
- { \exp_not:o { \use_none:nn #2 } }
-\cs_new:Npn \tl_trim_spaces:n #1
- { \__tl_trim_spaces:nn { \q_mark #1 } \exp_not:o }
-\cs_new_protected:Npn \tl_trim_spaces:N #1
- { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
-\cs_new_protected:Npn \tl_gtrim_spaces:N #1
- { \tl_gset:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
-\cs_generate_variant:Nn \tl_trim_spaces:N { c }
-\cs_generate_variant:Nn \tl_gtrim_spaces:N { c }
-\cs_set:Npn \__tl_tmp:w #1
- {
- \cs_new:Npn \__tl_trim_spaces:nn ##1
- {
- \__tl_trim_spaces_auxi:w
- ##1
- \q_nil
- \q_mark #1 { }
- \q_mark \__tl_trim_spaces_auxii:w
- \__tl_trim_spaces_auxiii:w
- #1 \q_nil
- \__tl_trim_spaces_auxiv:w
- \q_stop
- }
- \cs_new:Npn \__tl_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3
- {
- ##3
- \__tl_trim_spaces_auxi:w
- \q_mark
- ##2
- \q_mark #1 {##1}
- }
- \cs_new:Npn \__tl_trim_spaces_auxii:w
- \__tl_trim_spaces_auxi:w \q_mark \q_mark ##1
- {
- \__tl_trim_spaces_auxiii:w
- ##1
- }
- \cs_new:Npn \__tl_trim_spaces_auxiii:w ##1 #1 \q_nil ##2
- {
- ##2
- ##1 \q_nil
- \__tl_trim_spaces_auxiii:w
- }
- \cs_new:Npn \__tl_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3
- { ##3 { \use_none:n ##1 } }
- }
-\__tl_tmp:w { ~ }
-\cs_new:Npn \__tl_act:NNNnn #1#2#3#4#5
- {
- \group_align_safe_begin:
- \__tl_act_loop:w #5 \q__tl_act_mark \q__tl_act_stop
- {#4} #1 #2 #3
- \__tl_act_result:n { }
- }
-\cs_new:Npn \__tl_act_loop:w #1 \q__tl_act_stop
- {
- \tl_if_head_is_N_type:nTF {#1}
- { \__tl_act_normal:NwnNNN }
- {
- \tl_if_head_is_group:nTF {#1}
- { \__tl_act_group:nwnNNN }
- { \__tl_act_space:wwnNNN }
- }
- #1 \q__tl_act_stop
- }
-\cs_new:Npn \__tl_act_normal:NwnNNN #1 #2 \q__tl_act_stop #3#4
- {
- \if_meaning:w \q__tl_act_mark #1
- \exp_after:wN \__tl_act_end:wn
- \fi:
- #4 {#3} #1
- \__tl_act_loop:w #2 \q__tl_act_stop
- {#3} #4
- }
-\cs_new:Npn \__tl_act_end:wn #1 \__tl_act_result:n #2
- { \group_align_safe_end: \c_zero #2 }
-\cs_new:Npn \__tl_act_group:nwnNNN #1 #2 \q__tl_act_stop #3#4#5
- {
- #5 {#3} {#1}
- \__tl_act_loop:w #2 \q__tl_act_stop
- {#3} #4 #5
- }
-\exp_last_unbraced:NNo
- \cs_new:Npn \__tl_act_space:wwnNNN \c_space_tl #1 \q__tl_act_stop #2#3#4#5
- {
- #5 {#2}
- \__tl_act_loop:w #1 \q__tl_act_stop
- {#2} #3 #4 #5
- }
-\cs_new:Npn \__tl_act_output:n #1 #2 \__tl_act_result:n #3
- { #2 \__tl_act_result:n { #3 #1 } }
-\cs_new:Npn \__tl_act_reverse_output:n #1 #2 \__tl_act_result:n #3
- { #2 \__tl_act_result:n { #1 #3 } }
-\cs_new:Npn \tl_reverse:n #1
- {
- \etex_unexpanded:D \exp_after:wN
- {
- \tex_romannumeral:D
- \__tl_act:NNNnn
- \__tl_reverse_normal:nN
- \__tl_reverse_group_preserve:nn
- \__tl_reverse_space:n
- { }
- {#1}
- }
- }
-\cs_generate_variant:Nn \tl_reverse:n { o , V }
-\cs_new:Npn \__tl_reverse_normal:nN #1#2
- { \__tl_act_reverse_output:n {#2} }
-\cs_new:Npn \__tl_reverse_group_preserve:nn #1#2
- { \__tl_act_reverse_output:n { {#2} } }
-\cs_new:Npn \__tl_reverse_space:n #1
- { \__tl_act_reverse_output:n { ~ } }
-\cs_new_protected:Npn \tl_reverse:N #1
- { \tl_set:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
-\cs_new_protected:Npn \tl_greverse:N #1
- { \tl_gset:Nx #1 { \exp_args:No \tl_reverse:n { #1 } } }
-\cs_generate_variant:Nn \tl_reverse:N { c }
-\cs_generate_variant:Nn \tl_greverse:N { c }
-\cs_new:Npn \tl_head:n #1
- {
- \etex_unexpanded:D
- \if_false: { \fi: \__tl_head_auxi:nw #1 { } \q_stop }
- }
-\cs_new:Npn \__tl_head_auxi:nw #1#2 \q_stop
- { \exp_after:wN \__tl_head_auxii:nw \exp_after:wN { \if_false: } \fi: {#1} }
-\cs_new:Npn \__tl_head_auxii:nw #1
- {
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
- \tl_to_str:n \exp_after:wN { \use_none:n #1 } \q_nil
- \exp_after:wN \use_i:nn
- \else:
- \exp_after:wN \use_ii:nn
- \fi:
- {#1}
- { \if_false: { \fi: \__tl_head_auxi:nw #1 } }
- }
-\cs_generate_variant:Nn \tl_head:n { V , v , f }
-\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
-\cs_new_nopar:Npn \tl_head:N { \exp_args:No \tl_head:n }
-\cs_new:Npn \tl_tail:n #1
- {
- \etex_unexpanded:D
- \tl_if_blank:nTF {#1}
- { { } }
- { \exp_after:wN { \use_none:n #1 } }
- }
-\cs_generate_variant:Nn \tl_tail:n { V , v , f }
-\cs_new_nopar:Npn \tl_tail:N { \exp_args:No \tl_tail:n }
-\cs_new:Npn \str_head:n #1
- {
- \exp_after:wN \__str_head:w
- \tl_to_str:n {#1}
- { { } } ~ \q_stop
- }
-\cs_new:Npn \__str_head:w #1 ~ %
- { \tl_head:w #1 { ~ } }
-\cs_new:Npn \str_tail:n #1
- {
- \exp_after:wN \__str_tail:w
- \reverse_if:N \if_charcode:w
- \scan_stop: \tl_to_str:n {#1} X X \q_stop
- }
-\cs_new:Npn \__str_tail:w #1 X #2 \q_stop { \fi: #1 }
-\prg_new_conditional:Npnn \tl_if_head_eq_charcode:nN #1#2 { p , T , F , TF }
- {
- \if_charcode:w
- \exp_not:N #2
- \tl_if_head_is_N_type:nTF { #1 ? }
- {
- \exp_after:wN \exp_not:N
- \tl_head:w #1 { ? \use_none:nn } \q_stop
- }
- { \str_head:n {#1} }
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode_p:nN { f }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { f }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { f }
-\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { f }
-\prg_new_conditional:Npnn \tl_if_head_eq_catcode:nN #1 #2 { p , T , F , TF }
- {
- \if_catcode:w
- \exp_not:N #2
- \tl_if_head_is_N_type:nTF { #1 ? }
- {
- \exp_after:wN \exp_not:N
- \tl_head:w #1 { ? \use_none:nn } \q_stop
- }
- {
- \tl_if_head_is_group:nTF {#1}
- { \c_group_begin_token }
- { \c_space_token }
- }
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\prg_new_conditional:Npnn \tl_if_head_eq_meaning:nN #1#2 { p , T , F , TF }
- {
- \tl_if_head_is_N_type:nTF { #1 ? }
- { \__tl_if_head_eq_meaning_normal:nN }
- { \__tl_if_head_eq_meaning_special:nN }
- {#1} #2
- }
-\cs_new:Npn \__tl_if_head_eq_meaning_normal:nN #1 #2
- {
- \exp_after:wN \if_meaning:w
- \tl_head:w #1 { ?? \use_none:nnn } \q_stop #2
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \__tl_if_head_eq_meaning_special:nN #1 #2
- {
- \if_charcode:w \str_head:n {#1} \exp_not:N #2
- \exp_after:wN \use:n
- \else:
- \prg_return_false:
- \exp_after:wN \use_none:n
- \fi:
- {
- \if_catcode:w \exp_not:N #2
- \tl_if_head_is_group:nTF {#1}
- { \c_group_begin_token }
- { \c_space_token }
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
- }
-\prg_new_conditional:Npnn \tl_if_head_is_N_type:n #1 { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- { \exp_not:o { \use:n #1 { } } }
- { \exp_not:n { #1 { } } }
- }
-\prg_new_conditional:Npnn \tl_if_head_is_group:n #1 { p , T , F , TF }
- {
- \if_catcode:w *
- \exp_after:wN \use_none:n
- \exp_after:wN {
- \exp_after:wN {
- \token_to_str:N #1 ?
- }
- }
- *
- \prg_return_false:
- \else:
- \prg_return_true:
- \fi:
- }
-\prg_new_conditional:Npnn \tl_if_head_is_space:n #1 { p , T , F , TF }
- {
- \tex_romannumeral:D \if_false: { \fi:
- \__tl_if_head_is_space:w ? #1 ? ~ }
- }
-\cs_new:Npn \__tl_if_head_is_space:w #1 ~
- {
- \tl_if_empty:oTF { \use_none:n #1 }
- { \exp_after:wN \c_zero \exp_after:wN \prg_return_true: }
- { \exp_after:wN \c_zero \exp_after:wN \prg_return_false: }
- \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi:
- }
-\cs_new_protected:Npn \tl_show:N #1
- {
- \tl_if_exist:NTF #1
- { \cs_show:N #1 }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_generate_variant:Nn \tl_show:N { c }
-\cs_new_protected:Npn \tl_show:n #1
- { \__msg_show_variable:n { > ~ \tl_to_str:n {#1} } }
-\tl_new:N \g_tmpa_tl
-\tl_new:N \g_tmpb_tl
-\tl_new:N \l_tmpa_tl
-\tl_new:N \l_tmpb_tl
-\cs_new_eq:NN \tl_case:Nnn \tl_case:NnF
-\cs_new_eq:NN \tl_case:cnn \tl_case:cnF
-%%
-%%
-%% End of file `l3tl.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty b/Master/texmf-dist/tex/latex/l3kernel/l3token.sty
deleted file mode 100644
index ba456ba2196..00000000000
--- a/Master/texmf-dist/tex/latex/l3kernel/l3token.sty
+++ /dev/null
@@ -1,726 +0,0 @@
-%%
-%% This is file `l3token.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% l3token.dtx (with options: `package')
-%%
-%% EXPERIMENTAL CODE
-%%
-%% Do not distribute this file without also distributing the
-%% source files specified above.
-%%
-%% Do not distribute a modified version of this file.
-%%
-%% File: l3token.dtx Copyright (C) 2005-2013 The LaTeX3 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 "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3token.dtx 4587 2013-08-25 21:30:10Z joseph $
- {L3 Experimental token manipulation}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\__expl_package_check:
-\cs_new_protected:Npn \char_set_catcode:nn #1#2
- { \tex_catcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
-\cs_new:Npn \char_value_catcode:n #1
- { \tex_the:D \tex_catcode:D \__int_eval:w #1\__int_eval_end: }
-\cs_new_protected:Npn \char_show_value_catcode:n #1
- { \tex_showthe:D \tex_catcode:D \__int_eval:w #1 \__int_eval_end: }
-\cs_new_protected:Npn \char_set_catcode_escape:N #1
- { \char_set_catcode:nn { `#1 } \c_zero }
-\cs_new_protected:Npn \char_set_catcode_group_begin:N #1
- { \char_set_catcode:nn { `#1 } \c_one }
-\cs_new_protected:Npn \char_set_catcode_group_end:N #1
- { \char_set_catcode:nn { `#1 } \c_two }
-\cs_new_protected:Npn \char_set_catcode_math_toggle:N #1
- { \char_set_catcode:nn { `#1 } \c_three }
-\cs_new_protected:Npn \char_set_catcode_alignment:N #1
- { \char_set_catcode:nn { `#1 } \c_four }
-\cs_new_protected:Npn \char_set_catcode_end_line:N #1
- { \char_set_catcode:nn { `#1 } \c_five }
-\cs_new_protected:Npn \char_set_catcode_parameter:N #1
- { \char_set_catcode:nn { `#1 } \c_six }
-\cs_new_protected:Npn \char_set_catcode_math_superscript:N #1
- { \char_set_catcode:nn { `#1 } \c_seven }
-\cs_new_protected:Npn \char_set_catcode_math_subscript:N #1
- { \char_set_catcode:nn { `#1 } \c_eight }
-\cs_new_protected:Npn \char_set_catcode_ignore:N #1
- { \char_set_catcode:nn { `#1 } \c_nine }
-\cs_new_protected:Npn \char_set_catcode_space:N #1
- { \char_set_catcode:nn { `#1 } \c_ten }
-\cs_new_protected:Npn \char_set_catcode_letter:N #1
- { \char_set_catcode:nn { `#1 } \c_eleven }
-\cs_new_protected:Npn \char_set_catcode_other:N #1
- { \char_set_catcode:nn { `#1 } \c_twelve }
-\cs_new_protected:Npn \char_set_catcode_active:N #1
- { \char_set_catcode:nn { `#1 } \c_thirteen }
-\cs_new_protected:Npn \char_set_catcode_comment:N #1
- { \char_set_catcode:nn { `#1 } \c_fourteen }
-\cs_new_protected:Npn \char_set_catcode_invalid:N #1
- { \char_set_catcode:nn { `#1 } \c_fifteen }
-\cs_new_protected:Npn \char_set_catcode_escape:n #1
- { \char_set_catcode:nn {#1} \c_zero }
-\cs_new_protected:Npn \char_set_catcode_group_begin:n #1
- { \char_set_catcode:nn {#1} \c_one }
-\cs_new_protected:Npn \char_set_catcode_group_end:n #1
- { \char_set_catcode:nn {#1} \c_two }
-\cs_new_protected:Npn \char_set_catcode_math_toggle:n #1
- { \char_set_catcode:nn {#1} \c_three }
-\cs_new_protected:Npn \char_set_catcode_alignment:n #1
- { \char_set_catcode:nn {#1} \c_four }
-\cs_new_protected:Npn \char_set_catcode_end_line:n #1
- { \char_set_catcode:nn {#1} \c_five }
-\cs_new_protected:Npn \char_set_catcode_parameter:n #1
- { \char_set_catcode:nn {#1} \c_six }
-\cs_new_protected:Npn \char_set_catcode_math_superscript:n #1
- { \char_set_catcode:nn {#1} \c_seven }
-\cs_new_protected:Npn \char_set_catcode_math_subscript:n #1
- { \char_set_catcode:nn {#1} \c_eight }
-\cs_new_protected:Npn \char_set_catcode_ignore:n #1
- { \char_set_catcode:nn {#1} \c_nine }
-\cs_new_protected:Npn \char_set_catcode_space:n #1
- { \char_set_catcode:nn {#1} \c_ten }
-\cs_new_protected:Npn \char_set_catcode_letter:n #1
- { \char_set_catcode:nn {#1} \c_eleven }
-\cs_new_protected:Npn \char_set_catcode_other:n #1
- { \char_set_catcode:nn {#1} \c_twelve }
-\cs_new_protected:Npn \char_set_catcode_active:n #1
- { \char_set_catcode:nn {#1} \c_thirteen }
-\cs_new_protected:Npn \char_set_catcode_comment:n #1
- { \char_set_catcode:nn {#1} \c_fourteen }
-\cs_new_protected:Npn \char_set_catcode_invalid:n #1
- { \char_set_catcode:nn {#1} \c_fifteen }
-\cs_new_protected:Npn \char_set_mathcode:nn #1#2
- { \tex_mathcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
-\cs_new:Npn \char_value_mathcode:n #1
- { \tex_the:D \tex_mathcode:D \__int_eval:w #1\__int_eval_end: }
-\cs_new_protected:Npn \char_show_value_mathcode:n #1
- { \tex_showthe:D \tex_mathcode:D \__int_eval:w #1 \__int_eval_end: }
-\cs_new_protected:Npn \char_set_lccode:nn #1#2
- { \tex_lccode:D #1 = \__int_eval:w #2 \__int_eval_end: }
-\cs_new:Npn \char_value_lccode:n #1
- { \tex_the:D \tex_lccode:D \__int_eval:w #1\__int_eval_end: }
-\cs_new_protected:Npn \char_show_value_lccode:n #1
- { \tex_showthe:D \tex_lccode:D \__int_eval:w #1 \__int_eval_end: }
-\cs_new_protected:Npn \char_set_uccode:nn #1#2
- { \tex_uccode:D #1 = \__int_eval:w #2 \__int_eval_end: }
-\cs_new:Npn \char_value_uccode:n #1
- { \tex_the:D \tex_uccode:D \__int_eval:w #1\__int_eval_end: }
-\cs_new_protected:Npn \char_show_value_uccode:n #1
- { \tex_showthe:D \tex_uccode:D \__int_eval:w #1 \__int_eval_end: }
-\cs_new_protected:Npn \char_set_sfcode:nn #1#2
- { \tex_sfcode:D #1 = \__int_eval:w #2 \__int_eval_end: }
-\cs_new:Npn \char_value_sfcode:n #1
- { \tex_the:D \tex_sfcode:D \__int_eval:w #1\__int_eval_end: }
-\cs_new_protected:Npn \char_show_value_sfcode:n #1
- { \tex_showthe:D \tex_sfcode:D \__int_eval:w #1 \__int_eval_end: }
-\cs_new_protected:Npn \token_new:Nn #1#2 { \cs_new_eq:NN #1 #2 }
-\cs_new_eq:NN \c_group_begin_token {
-\cs_new_eq:NN \c_group_end_token }
-\group_begin:
- \char_set_catcode_math_toggle:N \*
- \token_new:Nn \c_math_toggle_token { * }
- \char_set_catcode_alignment:N \*
- \token_new:Nn \c_alignment_token { * }
- \token_new:Nn \c_parameter_token { # }
- \token_new:Nn \c_math_superscript_token { ^ }
- \char_set_catcode_math_subscript:N \*
- \token_new:Nn \c_math_subscript_token { * }
- \token_new:Nn \c_space_token { ~ }
- \token_new:Nn \c_catcode_letter_token { a }
- \token_new:Nn \c_catcode_other_token { 1 }
-\group_end:
-\group_begin:
- \char_set_catcode_active:N \*
- \tl_const:Nn \c_catcode_active_tl { \exp_not:N * }
-\group_end:
-\seq_new:N \l_char_active_seq
-\use:n
- {
- \group_begin:
- \char_set_catcode_active:N \"
- \char_set_catcode_active:N \$
- \char_set_catcode_active:N \&
- \char_set_catcode_active:N \^
- \char_set_catcode_active:N \_
- \char_set_catcode_active:N \~
- \use:nn
- {
- \group_end:
- \seq_set_split:Nnn \l_char_active_seq { }
- }
- }
- { { " $ & ^ _ ~ } } %$
-\seq_new:N \l_char_special_seq
-\seq_set_split:Nnn \l_char_special_seq { }
- { \ \" \# \$ \% \& \\ \^ \_ \{ \} \~ }
-\prg_new_conditional:Npnn \token_if_group_begin:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_group_begin_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_group_end:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_group_end_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_math_toggle:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_math_toggle_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_alignment:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_alignment_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\group_begin:
-\cs_set_eq:NN \c_parameter_token \scan_stop:
-\prg_new_conditional:Npnn \token_if_parameter:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_parameter_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\group_end:
-\prg_new_conditional:Npnn \token_if_math_superscript:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_math_superscript_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_math_subscript:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_math_subscript_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_space:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_space_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_letter:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_catcode_letter_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_other:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_catcode_other_token
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_active:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \c_catcode_active_tl
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_eq_meaning:NN #1#2 { p , T , F , TF }
- {
- \if_meaning:w #1 #2
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_eq_catcode:NN #1#2 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \exp_not:N #2
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_eq_charcode:NN #1#2 { p , T , F , TF }
- {
- \if_charcode:w \exp_not:N #1 \exp_not:N #2
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\group_begin:
-\char_set_catcode_other:N \M
-\char_set_catcode_other:N \A
-\char_set_lccode:nn { `\; } { `\: }
-\char_set_lccode:nn { `\T } { `\T }
-\char_set_lccode:nn { `\F } { `\F }
-\tl_to_lowercase:n
- {
- \group_end:
- \prg_new_conditional:Npnn \token_if_macro:N #1 { p , T , F , TF }
- {
- \exp_after:wN \__token_if_macro_p:w
- \token_to_meaning:N #1 MA; \q_stop
- }
- \cs_new:Npn \__token_if_macro_p:w #1 MA #2 ; #3 \q_stop
- {
- \if_int_compare:w \pdftex_strcmp:D { #2 } { cro } = \c_zero
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
- }
-\prg_new_conditional:Npnn \token_if_cs:N #1 { p , T , F , TF }
- {
- \if_catcode:w \exp_not:N #1 \scan_stop:
- \prg_return_true: \else: \prg_return_false: \fi:
- }
-\prg_new_conditional:Npnn \token_if_expandable:N #1 { p , T , F , TF }
- {
- \exp_after:wN \if_meaning:w \exp_not:N #1 #1
- \prg_return_false:
- \else:
- \if_cs_exist:N #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- \fi:
- }
-\group_begin:
- \char_set_lccode:nn { `T } { `T }
- \char_set_lccode:nn { `F } { `F }
- \char_set_lccode:nn { `X } { `n }
- \char_set_lccode:nn { `Y } { `t }
- \char_set_lccode:nn { `Z } { `d }
- \tl_map_inline:nn { A C E G H I K L M O P R S U X Y Z R " }
- { \char_set_catcode:nn { `#1 } \c_twelve }
-\tl_to_lowercase:n
- {
- \group_end:
- \prg_new_conditional:Npnn \token_if_chardef:N #1 { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_chardef:w
- \token_to_meaning:N #1 CHAR" \q_stop
- }
- { \token_to_str:N \char }
- }
- \prg_new_conditional:Npnn \token_if_mathchardef:N #1 { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_chardef:w
- \token_to_meaning:N #1 CHAR" \q_stop
- }
- { \token_to_str:N \mathchar }
- }
- \cs_new:Npn \__token_if_chardef:w #1 CHAR" #2 \q_stop { #1 CHAR }
- \prg_new_conditional:Npnn \token_if_dim_register:N #1 { p , T , F , TF }
- {
- \if_meaning:w \tex_dimen:D #1
- \prg_return_false:
- \else:
- \if_meaning:w \tex_dimendef:D #1
- \prg_return_false:
- \else:
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_dim_register:w
- \token_to_meaning:N #1 ZIMEX \q_stop
- }
- { \token_to_str:N \ }
- \fi:
- \fi:
- }
- \cs_new:Npn \__token_if_dim_register:w #1 ZIMEX #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_int_register:N #1 { p , T , F , TF }
- {
- % \token_if_chardef:NTF #1 { \prg_return_true: }
- % {
- % \token_if_mathchardef:NTF #1 { \prg_return_true: }
- % {
- \if_meaning:w \tex_count:D #1
- \prg_return_false:
- \else:
- \if_meaning:w \tex_countdef:D #1
- \prg_return_false:
- \else:
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_int_register:w
- \token_to_meaning:N #1 COUXY \q_stop
- }
- { \token_to_str:N \ }
- \fi:
- \fi:
- % }
- % }
- }
- \cs_new:Npn \__token_if_int_register:w #1 COUXY #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_muskip_register:N #1 { p , T , F , TF }
- {
- \if_meaning:w \tex_muskip:D #1
- \prg_return_false:
- \else:
- \if_meaning:w \tex_muskipdef:D #1
- \prg_return_false:
- \else:
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_muskip_register:w
- \token_to_meaning:N #1 MUSKIP \q_stop
- }
- { \token_to_str:N \ }
- \fi:
- \fi:
- }
- \cs_new:Npn \__token_if_muskip_register:w #1 MUSKIP #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_skip_register:N #1 { p , T , F , TF }
- {
- \if_meaning:w \tex_skip:D #1
- \prg_return_false:
- \else:
- \if_meaning:w \tex_skipdef:D #1
- \prg_return_false:
- \else:
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_skip_register:w
- \token_to_meaning:N #1 SKIP \q_stop
- }
- { \token_to_str:N \ }
- \fi:
- \fi:
- }
- \cs_new:Npn \__token_if_skip_register:w #1 SKIP #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_toks_register:N #1 { p , T , F , TF }
- {
- \if_meaning:w \tex_toks:D #1
- \prg_return_false:
- \else:
- \if_meaning:w \tex_toksdef:D #1
- \prg_return_false:
- \else:
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_toks_register:w
- \token_to_meaning:N #1 YOKS \q_stop
- }
- { \token_to_str:N \ }
- \fi:
- \fi:
- }
- \cs_new:Npn \__token_if_toks_register:w #1 YOKS #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_protected_macro:N #1
- { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_protected_macro:w
- \token_to_meaning:N #1 PROYECYEZ~MACRO \q_stop
- }
- { \token_to_str:N \ }
- }
- \cs_new:Npn \__token_if_protected_macro:w
- #1 PROYECYEZ~MACRO #2 \q_stop { #1 ~ }
- \prg_new_conditional:Npnn \token_if_long_macro:N #1 { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_long_macro:w
- \token_to_meaning:N #1 LOXG~MACRO \q_stop
- }
- { \token_to_str:N \ }
- }
- \prg_new_conditional:Npnn \token_if_protected_long_macro:N #1
- { p , T , F , TF }
- {
- \__str_if_eq_x_return:nn
- {
- \exp_after:wN \__token_if_long_macro:w
- \token_to_meaning:N #1 LOXG~MACRO \q_stop
- }
- { \token_to_str:N \protected \token_to_str:N \ }
- }
- \cs_new:Npn \__token_if_long_macro:w #1 LOXG~MACRO #2 \q_stop { #1 ~ }
- }
-\tex_chardef:D \c_token_A_int = `A ~ %
-\group_begin:
-\char_set_catcode_other:N \;
-\char_set_lccode:nn { `\; } { `\: }
-\char_set_lccode:nn { `\T } { `\T }
-\char_set_lccode:nn { `\F } { `\F }
-\tl_to_lowercase:n {
- \group_end:
- \prg_new_conditional:Npnn \token_if_primitive:N #1 { p , T , F , TF }
- {
- \token_if_macro:NTF #1
- \prg_return_false:
- {
- \exp_after:wN \__token_if_primitive:NNw
- \token_to_meaning:N #1 ; ; ; \q_stop #1
- }
- }
- \cs_new:Npn \__token_if_primitive:NNw #1#2 #3 ; #4 \q_stop
- {
- \tl_if_empty:oTF { \__token_if_primitive_space:w #3 ~ }
- { \__token_if_primitive_loop:N #3 ; \q_stop }
- { \__token_if_primitive_nullfont:N }
- }
-}
-\cs_new:Npn \__token_if_primitive_space:w #1 ~ { }
-\cs_new:Npn \__token_if_primitive_nullfont:N #1
- {
- \if_meaning:w \tex_nullfont:D #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new:Npn \__token_if_primitive_loop:N #1
- {
- \if_int_compare:w `#1 < \c_token_A_int %
- \exp_after:wN \__token_if_primitive:Nw
- \exp_after:wN #1
- \else:
- \exp_after:wN \__token_if_primitive_loop:N
- \fi:
- }
-\cs_new:Npn \__token_if_primitive:Nw #1 #2 \q_stop
- {
- \if:w : #1
- \exp_after:wN \__token_if_primitive_undefined:N
- \else:
- \prg_return_false:
- \exp_after:wN \use_none:n
- \fi:
- }
-\cs_new:Npn \__token_if_primitive_undefined:N #1
- {
- \if_cs_exist:N #1
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-\cs_new_eq:NN \l_peek_token ?
-\cs_new_eq:NN \g_peek_token ?
-\cs_new_eq:NN \l__peek_search_token ?
-\tl_new:N \l__peek_search_tl
-\cs_new_nopar:Npn \__peek_true:w { }
-\cs_new_nopar:Npn \__peek_true_aux:w { }
-\cs_new_nopar:Npn \__peek_false:w { }
-\cs_new:Npn \__peek_tmp:w { }
-\cs_new_protected_nopar:Npn \peek_after:Nw
- { \tex_futurelet:D \l_peek_token }
-\cs_new_protected_nopar:Npn \peek_gafter:Nw
- { \tex_global:D \tex_futurelet:D \g_peek_token }
-\cs_new_protected:Npn \__peek_true_remove:w
- {
- \group_align_safe_end:
- \tex_afterassignment:D \__peek_true_aux:w
- \cs_set_eq:NN \__peek_tmp:w
- }
-\cs_new_protected:Npn \__peek_token_generic:NNTF #1#2#3#4
- {
- \cs_set_eq:NN \l__peek_search_token #2
- \tl_set:Nn \l__peek_search_tl {#2}
- \cs_set_nopar:Npx \__peek_true:w
- {
- \exp_not:N \group_align_safe_end:
- \exp_not:n {#3}
- }
- \cs_set_nopar:Npx \__peek_false:w
- {
- \exp_not:N \group_align_safe_end:
- \exp_not:n {#4}
- }
- \group_align_safe_begin:
- \peek_after:Nw #1
- }
-\cs_new_protected:Npn \__peek_token_generic:NNT #1#2#3
- { \__peek_token_generic:NNTF #1 #2 {#3} { } }
-\cs_new_protected:Npn \__peek_token_generic:NNF #1#2#3
- { \__peek_token_generic:NNTF #1 #2 { } {#3} }
-\cs_new_protected:Npn \__peek_token_remove_generic:NNTF #1#2#3#4
- {
- \cs_set_eq:NN \l__peek_search_token #2
- \tl_set:Nn \l__peek_search_tl {#2}
- \cs_set_eq:NN \__peek_true:w \__peek_true_remove:w
- \cs_set_nopar:Npx \__peek_true_aux:w { \exp_not:n {#3} }
- \cs_set_nopar:Npx \__peek_false:w
- {
- \exp_not:N \group_align_safe_end:
- \exp_not:n {#4}
- }
- \group_align_safe_begin:
- \peek_after:Nw #1
- }
-\cs_new_protected:Npn \__peek_token_remove_generic:NNT #1#2#3
- { \__peek_token_remove_generic:NNTF #1 #2 {#3} { } }
-\cs_new_protected:Npn \__peek_token_remove_generic:NNF #1#2#3
- { \__peek_token_remove_generic:NNTF #1 #2 { } {#3} }
-\cs_new_nopar:Npn \__peek_execute_branches_meaning:
- {
- \if_meaning:w \l_peek_token \l__peek_search_token
- \exp_after:wN \__peek_true:w
- \else:
- \exp_after:wN \__peek_false:w
- \fi:
- }
-\cs_new_nopar:Npn \__peek_execute_branches_catcode:
- { \if_catcode:w \__peek_execute_branches_catcode_aux: }
-\cs_new_nopar:Npn \__peek_execute_branches_charcode:
- { \if_charcode:w \__peek_execute_branches_catcode_aux: }
-\cs_new_nopar:Npn \__peek_execute_branches_catcode_aux:
- {
- \if_catcode:w \exp_not:N \l_peek_token \scan_stop:
- \exp_after:wN \exp_after:wN
- \exp_after:wN \__peek_execute_branches_catcode_auxii:N
- \exp_after:wN \exp_not:N
- \else:
- \exp_after:wN \__peek_execute_branches_catcode_auxiii:
- \fi:
- }
-\cs_new:Npn \__peek_execute_branches_catcode_auxii:N #1
- {
- \exp_not:N #1
- \exp_after:wN \exp_not:N \l__peek_search_tl
- \exp_after:wN \__peek_true:w
- \else:
- \exp_after:wN \__peek_false:w
- \fi:
- #1
- }
-\cs_new_nopar:Npn \__peek_execute_branches_catcode_auxiii:
- {
- \exp_not:N \l_peek_token
- \exp_after:wN \exp_not:N \l__peek_search_tl
- \exp_after:wN \__peek_true:w
- \else:
- \exp_after:wN \__peek_false:w
- \fi:
- }
-\cs_new_protected_nopar:Npn \__peek_ignore_spaces_execute_branches:
- {
- \if_meaning:w \l_peek_token \c_space_token
- \exp_after:wN \peek_after:Nw
- \exp_after:wN \__peek_ignore_spaces_execute_branches:
- \tex_romannumeral:D -`0
- \else:
- \exp_after:wN \__peek_execute_branches:
- \fi:
- }
-\group_begin:
- \cs_set:Npn \__peek_def:nnnn #1#2#3#4
- {
- \__peek_def:nnnnn {#1} {#2} {#3} {#4} { TF }
- \__peek_def:nnnnn {#1} {#2} {#3} {#4} { T }
- \__peek_def:nnnnn {#1} {#2} {#3} {#4} { F }
- }
- \cs_set:Npn \__peek_def:nnnnn #1#2#3#4#5
- {
- \cs_new_protected_nopar:cpx { #1 #5 }
- {
- \tl_if_empty:nF {#2}
- { \exp_not:n { \cs_set_eq:NN \__peek_execute_branches: #2 } }
- \exp_not:c { #3 #5 }
- \exp_not:n {#4}
- }
- }
- \__peek_def:nnnn { peek_catcode:N }
- { }
- { __peek_token_generic:NN }
- { \__peek_execute_branches_catcode: }
- \__peek_def:nnnn { peek_catcode_ignore_spaces:N }
- { \__peek_execute_branches_catcode: }
- { __peek_token_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
- \__peek_def:nnnn { peek_catcode_remove:N }
- { }
- { __peek_token_remove_generic:NN }
- { \__peek_execute_branches_catcode: }
- \__peek_def:nnnn { peek_catcode_remove_ignore_spaces:N }
- { \__peek_execute_branches_catcode: }
- { __peek_token_remove_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
- \__peek_def:nnnn { peek_charcode:N }
- { }
- { __peek_token_generic:NN }
- { \__peek_execute_branches_charcode: }
- \__peek_def:nnnn { peek_charcode_ignore_spaces:N }
- { \__peek_execute_branches_charcode: }
- { __peek_token_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
- \__peek_def:nnnn { peek_charcode_remove:N }
- { }
- { __peek_token_remove_generic:NN }
- { \__peek_execute_branches_charcode: }
- \__peek_def:nnnn { peek_charcode_remove_ignore_spaces:N }
- { \__peek_execute_branches_charcode: }
- { __peek_token_remove_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
- \__peek_def:nnnn { peek_meaning:N }
- { }
- { __peek_token_generic:NN }
- { \__peek_execute_branches_meaning: }
- \__peek_def:nnnn { peek_meaning_ignore_spaces:N }
- { \__peek_execute_branches_meaning: }
- { __peek_token_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
- \__peek_def:nnnn { peek_meaning_remove:N }
- { }
- { __peek_token_remove_generic:NN }
- { \__peek_execute_branches_meaning: }
- \__peek_def:nnnn { peek_meaning_remove_ignore_spaces:N }
- { \__peek_execute_branches_meaning: }
- { __peek_token_remove_generic:NN }
- { \__peek_ignore_spaces_execute_branches: }
-\group_end:
-\exp_args:Nno \use:nn
- { \cs_new:Npn \__peek_get_prefix_arg_replacement:wN #1 }
- { \tl_to_str:n { macro : } #2 -> #3 \q_stop #4 }
- { #4 {#1} {#2} {#3} }
-\cs_new:Npn \token_get_prefix_spec:N #1
- {
- \token_if_macro:NTF #1
- {
- \exp_after:wN \__peek_get_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_i:nnn
- }
- { \scan_stop: }
- }
-\cs_new:Npn \token_get_arg_spec:N #1
- {
- \token_if_macro:NTF #1
- {
- \exp_after:wN \__peek_get_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_ii:nnn
- }
- { \scan_stop: }
- }
-\cs_new:Npn \token_get_replacement_spec:N #1
- {
- \token_if_macro:NTF #1
- {
- \exp_after:wN \__peek_get_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_iii:nnn
- }
- { \scan_stop: }
- }
-%%
-%%
-%% End of file `l3token.sty'.
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
index 3cb19f3088d..308126a7a20 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
@@ -46,13 +46,11 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3drivers.dtx 4641 2014-01-04 17:05:41Z joseph $
+\GetIdInfo$Id: l3drivers.dtx 4735 2014-05-05 06:25:42Z joseph $
{L3 Experimental drivers}
\ProvidesExplFile
{l3xdvidpfmx.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: xdvipdfmx}
-\__expl_package_check:
\cs_new_protected_nopar:Npn \__driver_state_save:
{ \tex_special:D { pdf:literal~q } }
\cs_new_protected_nopar:Npn \__driver_state_restore:
@@ -116,7 +114,6 @@
\cs_new_eq:NN \__driver_box_scale_end: \__driver_state_restore:
\tl_new:N \l__driver_current_color_tl
\tl_set:Nn \l__driver_current_color_tl { gray~0 }
-%% \end{macrocode}
\cs_new_protected_nopar:Npn \__driver_color_ensure_current:
{
\tex_special:D { color~push~\l__driver_current_color_tl }
diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
index eefd87478f3..6d5daa9410e 100644
--- a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
+++ b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
@@ -13,7 +13,7 @@
%%
%% Do not distribute a modified version of this file.
%%
-%% File: l3keys2e.dtx (C) Copyright 2009,2011-2013 The LaTeX3 Project
+%% File: l3keys2e.dtx (C) Copyright 2009,2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -46,8 +46,8 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{expl3}[2013/12/31]
-\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+\@ifpackagelater{expl3}{2014/05/05}
{}
{%
\PackageError{l3keys2e}{Support package l3kernel too old}
@@ -59,10 +59,11 @@
}%
\endinput
}
-\GetIdInfo$Id: l3keys2e.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: l3keys2e.dtx 4740 2014-05-05 14:04:24Z joseph $
{LaTeX2e option processing using LaTeX3 keys}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
+\cs_generate_variant:Nn \clist_put_right:Nn { Nv }
\clist_new:N \l__keys_latexe_options_clist
\bool_new:N \l__keys_process_class_bool
\cs_new_protected:Npn \__keys_latexe_options:n #1
@@ -81,7 +82,11 @@
}
}
}
- \keys_set:nV {#1} \l__keys_latexe_options_clist
+ \clist_map_inline:Nn \l__keys_latexe_options_clist
+ {
+ \tl_set:Nn \CurrentOption {##1}
+ \keys_set:nn {#1} {##1}
+ }
\AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: }
}
\cs_new_protected:Npn \__keys_latexe_options_global:n #1
@@ -98,14 +103,20 @@
}
\cs_new_protected:Npn \__keys_latexe_options_class:n #1
{
- \keys_if_exist:nnTF {#1} { unknown }
- { \clist_put_right:No \l__keys_latexe_options_clist \@classoptionslist }
+ \cs_if_free:cF { opt@ \@currname . \@currext }
{
- \clist_map_inline:Nn \@classoptionslist
+ \keys_if_exist:nnTF {#1} { unknown }
{
- \keys_if_exist:nnTF {#1} { \__keys_latexe_remove_equals:n {##1} }
- { \clist_put_right:Nn \l__keys_latexe_options_clist {##1} }
- { \clist_put_right:Nn \@unusedoptionlist {##1} }
+ \clist_put_right:Nv \l__keys_latexe_options_clist
+ { opt@ \@currname . \@currext }
+ }
+ {
+ \clist_map_inline:cn { opt@ \@currname . \@currext }
+ {
+ \keys_if_exist:nnTF {#1} { \__keys_latexe_remove_equals:n {##1} }
+ { \clist_put_right:Nn \l__keys_latexe_options_clist {##1} }
+ { \clist_put_right:Nn \@unusedoptionlist {##1} }
+ }
}
}
}
diff --git a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty
index 44b4a39bba0..320805da81a 100644
--- a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty
+++ b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty
@@ -14,7 +14,7 @@
%% Do not distribute a modified version of this file.
%%
%% File: xfrac.dtx Copyright (C) 2004, 2008-2010 Morten Hoegholm
-%% (C) 2011,2012 The LaTeX3 Project
+%% (C) 2011,2012,2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -48,7 +48,7 @@
%% -----------------------------------------------------------------------
%%
\RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate}
-\GetIdInfo$Id: xfrac.dtx 4299 2012-11-09 18:48:51Z joseph $
+\GetIdInfo$Id: xfrac.dtx 4728 2014-05-04 13:25:37Z joseph $
{L3 Experimental split-level fractions}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
index aa5177281ed..beae464378c 100644
--- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
+++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
@@ -17,7 +17,7 @@
%% David Carlisle
%% (C) Copyright 2004-2008 Frank Mittelbach,
%% The LaTeX3 Project
-%% (C) Copyright 2009-2013 The LaTeX3 Project
+%% (C) Copyright 2009-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -50,8 +50,8 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{expl3}[2013/12/31]
-\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+\@ifpackagelater{expl3}{2014/05/05}
{}
{%
\PackageError{xparse}{Support package l3kernel too old}
@@ -63,7 +63,7 @@
}%
\endinput
}
-\GetIdInfo$Id: xparse.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: xparse.dtx 4740 2014-05-05 14:04:24Z joseph $
{L3 Experimental document command parser}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -546,17 +546,20 @@
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_g:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { g }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { g }
\__xparse_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_G:w #1
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { G }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { G }
\__xparse_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_l:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { l }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { l }
\__xparse_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_m:w
@@ -600,12 +603,14 @@
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_u:w #1
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { u }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { u }
\__xparse_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_type_v:w
{
- \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type } { v }
+ \__msg_kernel_error:nnx { xparse } { invalid-expandable-argument-type }
+ { v }
\__xparse_add_expandable_type_m:w
}
\cs_new_protected_nopar:Npn \__xparse_add_expandable_grabber_mandatory:n #1
@@ -1399,20 +1404,20 @@
{
You~have~used~\NewDocumentCommand
with~a~command~that~already~has~a~definition. \\
- The~existing~definition~of~'#1'~will~be~overwritten.
+ The~existing~definition~of~'#1'~will~not~be~altered.
}
\__msg_kernel_new:nnnn { xparse } { command-not-yet-defined }
{ Command ~'#1'~not~yet~defined! }
{
You~have~used~\RenewDocumentCommand
- with~a~command~that~was~never~defined.\\
+ with~a~command~that~was~never~defined. \\
A~new~command~'#1'~will~be~created.
}
\__msg_kernel_new:nnnn { xparse } { environment-already-defined }
{ Environment~'#1'~already~defined! }
{
You~have~used~\NewDocumentEnvironment
- with~an~environment~that~already~has~a~definition.\\
+ with~an~environment~that~already~has~a~definition. \\
The~existing~definition~of~'#1'~will~be~overwritten.
}
\__msg_kernel_new:nnnn { xparse } { environment-mismatch }
@@ -1425,18 +1430,20 @@
{ Environment~'#1'~not~yet~defined! }
{
You~have~used~\RenewDocumentEnvironment
- with~an~environment~that~was~never~defined.\\
+ with~an~environment~that~was~never~defined. \\
A~new~environment~'#1'~will~be~created.
}
\__msg_kernel_new:nnnn { xparse } { environment-unknown }
{ Environment~'#1'~undefined. }
{
You~have~tried~to~start~an~environment~called~'#1',~
- but~this~has~never~been~defined.\\
+ but~this~has~never~been~defined. \\
The~command~will~be~ignored.
}
\__msg_kernel_new:nnnn { xparse } { expandable-ending-optional }
- { Argument~specification~for~expandable~command~ends~with~optional~argument. }
+ {
+ Argument~specification~for~expandable~command~ends~with~optional~argument.
+ }
{
\c_msg_coding_error_text_tl
Expandable~commands~must~have~a~final~mandatory~argument~
diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty
index e054d0013c5..499b870ecf6 100644
--- a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty
+++ b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty
@@ -17,7 +17,7 @@
%% David Carlisle
%% (C) Copyright 2004-2010 Frank Mittelbach,
%% The LaTeX3 Project
-%% (C) Copyright 2011-2013 The LaTeX3 Project
+%% (C) Copyright 2011-2014 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -50,8 +50,8 @@
%%
%% -----------------------------------------------------------------------
%%
-\RequirePackage{expl3}[2013/12/31]
-\@ifpackagelater{expl3}{2013/12/31}
+\RequirePackage{expl3}[2014/05/05]
+\@ifpackagelater{expl3}{2014/05/05}
{}
{%
\PackageError{xtemplate}{Support package l3kernel too old}
@@ -63,7 +63,7 @@
}%
\endinput
}
-\GetIdInfo$Id: xtemplate.dtx 4634 2013-12-31 17:32:19Z joseph $
+\GetIdInfo$Id: xtemplate.dtx 4740 2014-05-05 14:04:24Z joseph $
{L3 Experimental prototype document functions}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}