summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-17 03:01:02 +0000
committerNorbert Preining <norbert@preining.info>2024-01-17 03:01:02 +0000
commit4fd81a66c82a2ba8787c6ca78bfcc14820e4017c (patch)
treebd843b1d561c776d5f54e18c0f07c05b079bb791
parent384734a07c53090ad651e786d248c5ba8cd4606e (diff)
CTAN sync 202401170301
-rw-r--r--FILES.byname406
-rw-r--r--FILES.byname.gzbin2592041 -> 2592248 bytes
-rw-r--r--FILES.last07days311
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.12
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.dtx2
-rw-r--r--biblio/bibtex/utils/bibcop/bibcop.pdfbin348056 -> 348056 bytes
-rwxr-xr-xbiblio/bibtex/utils/bibcop/bibcop.pl8
-rw-r--r--biblio/ctan-bibdata/ctan.bib106
-rw-r--r--graphics/pgf/contrib/zx-calculus/README.md2
-rw-r--r--graphics/pgf/contrib/zx-calculus/biblio.bib48
-rw-r--r--graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex2754
-rw-r--r--graphics/pgf/contrib/zx-calculus/zx-calculus.pdfbin616917 -> 1142885 bytes
-rw-r--r--graphics/pgf/contrib/zx-calculus/zx-calculus.sty3
-rw-r--r--graphics/pgf/contrib/zx-calculus/zx-calculus.tex2376
-rw-r--r--macros/generic/memoize/CHANGELOG.md7
-rw-r--r--macros/generic/memoize/Makefile23
-rw-r--r--macros/generic/memoize/doc/memoize-clean.1.md4
-rw-r--r--macros/generic/memoize/doc/memoize-code.pdfbin626766 -> 626771 bytes
-rw-r--r--macros/generic/memoize/doc/memoize-doc.pdfbin2180931 -> 2181032 bytes
-rw-r--r--macros/generic/memoize/doc/memoize-doc.tex2
-rw-r--r--macros/generic/memoize/doc/memoize-extract.1.md4
-rwxr-xr-xmacros/generic/memoize/memoize-clean.pl2
-rwxr-xr-xmacros/generic/memoize/memoize-clean.py2
-rwxr-xr-xmacros/generic/memoize/memoize-extract.pl2
-rwxr-xr-xmacros/generic/memoize/memoize-extract.py2
-rw-r--r--macros/generic/memoize/memoize.edtx26
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx57
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin599029 -> 601383 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex35
-rw-r--r--macros/latex/contrib/ppt-slides/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/ppt-slides/LICENSE.txt2
-rw-r--r--macros/latex/contrib/ppt-slides/README.md2
-rw-r--r--macros/latex/contrib/ppt-slides/ppt-slides.dtx93
-rw-r--r--macros/latex/contrib/ppt-slides/ppt-slides.ins4
-rw-r--r--macros/latex/contrib/ppt-slides/ppt-slides.pdfbin934686 -> 935899 bytes
-rw-r--r--macros/latex/contrib/regulatory/README.md27
-rw-r--r--macros/latex/contrib/regulatory/doc/example.md23
-rw-r--r--macros/latex/contrib/regulatory/doc/example1-en.pdfbin0 -> 25767 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/example1-en.tex42
-rw-r--r--macros/latex/contrib/regulatory/doc/example1-nl.pdfbin0 -> 25612 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/example1-nl.tex42
-rw-r--r--macros/latex/contrib/regulatory/doc/example1.bib15
-rw-r--r--macros/latex/contrib/regulatory/doc/example1.tex25
-rw-r--r--macros/latex/contrib/regulatory/doc/example2-en.pdfbin0 -> 52584 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/example2-en.tex49
-rw-r--r--macros/latex/contrib/regulatory/doc/example2-nl.pdfbin0 -> 52617 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/example2-nl.tex49
-rw-r--r--macros/latex/contrib/regulatory/doc/example2.bib5
-rw-r--r--macros/latex/contrib/regulatory/doc/example2.tex21
-rw-r--r--macros/latex/contrib/regulatory/doc/md-example.tex24
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory-en.pdfbin0 -> 224493 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory-en.tex52
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory-nl.pdfbin0 -> 226188 bytes
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory-nl.tex63
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory-preamble.tex110
-rw-r--r--macros/latex/contrib/regulatory/doc/regulatory.tex779
-rw-r--r--macros/latex/contrib/regulatory/tex/fc-dutch.def424
-rw-r--r--macros/latex/contrib/regulatory/tex/regulatory.sty699
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.pdfbin766861 -> 1596591 bytes
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.sty1071
-rw-r--r--macros/latex/contrib/robust-externalize/robust-externalize.tex903
-rw-r--r--macros/latex/contrib/tkz/tkz-base/README.md5
-rw-r--r--macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex6
-rw-r--r--macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdfbin362010 -> 356502 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg10
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex10
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/README.md36
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex296
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex151
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex526
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex175
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex261
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex26
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex112
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex1
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex195
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex3
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex366
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex100
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-tests.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex47
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/gold_preamble.lua46
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/sangaku.lua14
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdfbin584764 -> 642250 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty10
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua82
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua81
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua149
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua47
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua16
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua10
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua62
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua6
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/README.md15
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdfbin1118849 -> 1116615 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex10
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex6
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg13
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty24
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex12
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex10
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex8
-rw-r--r--support/TeX4ht/source/ChangeLog13
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex55
-rw-r--r--timestamp2
182 files changed, 12386 insertions, 1896 deletions
diff --git a/FILES.byname b/FILES.byname
index a3f8f7d1e0..f5282122d7 100644
--- a/FILES.byname
+++ b/FILES.byname
@@ -1530,16 +1530,16 @@
1997/02/27 | 18375 | biblio/bibtex/utils/bibclean/bibclean-2.11.3.tar-lst
2006/06/02 | 55589 | biblio/bibtex/utils/bibclean/bibclean.pdf
2006/06/02 | 26456 | biblio/bibtex/utils/bibclean/README
-2024/01/12 | 958 | biblio/bibtex/utils/bibcop/bibcop.1
-2024/01/12 | 16344 | biblio/bibtex/utils/bibcop/bibcop.dtx
-2024/01/12 | 2628 | biblio/bibtex/utils/bibcop/bibcop.ins
-2024/01/12 | 5100 | biblio/bibtex/utils/bibcop/bibcop-logo.pdf
-2024/01/12 | 348056 | biblio/bibtex/utils/bibcop/bibcop.pdf
-2024/01/12 | 26638 | biblio/bibtex/utils/bibcop/bibcop.pl
-2024/01/12 | 211 | biblio/bibtex/utils/bibcop/DEPENDS.txt
-2024/01/12 | 1083 | biblio/bibtex/utils/bibcop/LICENSE.txt
-2024/01/12 | 2917 | biblio/bibtex/utils/bibcop/README.md
-2024/01/12 | 367388 | biblio/bibtex/utils/bibcop.zip
+2024/01/16 | 958 | biblio/bibtex/utils/bibcop/bibcop.1
+2024/01/16 | 16344 | biblio/bibtex/utils/bibcop/bibcop.dtx
+2024/01/16 | 2628 | biblio/bibtex/utils/bibcop/bibcop.ins
+2024/01/16 | 5100 | biblio/bibtex/utils/bibcop/bibcop-logo.pdf
+2024/01/16 | 348056 | biblio/bibtex/utils/bibcop/bibcop.pdf
+2024/01/16 | 26644 | biblio/bibtex/utils/bibcop/bibcop.pl
+2024/01/16 | 211 | biblio/bibtex/utils/bibcop/DEPENDS.txt
+2024/01/16 | 1083 | biblio/bibtex/utils/bibcop/LICENSE.txt
+2024/01/16 | 2917 | biblio/bibtex/utils/bibcop/README.md
+2024/01/16 | 367397 | biblio/bibtex/utils/bibcop.zip
2019/03/30 | 43446 | biblio/bibtex/utils/bibexport/bibexport.dtx
2019/03/30 | 2002 | biblio/bibtex/utils/bibexport/bibexport.ins
2019/03/30 | 256849 | biblio/bibtex/utils/bibexport/bibexport.pdf
@@ -2077,12 +2077,12 @@
2023/10/05 | 1710 | biblio/citation-style-language/README.md
2023/10/05 | 12878 | biblio/citation-style-language/vancouver.csl
2023/10/05 | 4531754 | biblio/citation-style-language.zip
-2024/01/15 | 1678 | biblio/ctan-bibdata/biblatex-ctan/ctan.bbx
+2024/01/16 | 1678 | biblio/ctan-bibdata/biblatex-ctan/ctan.bbx
2022/10/08 | 127 | biblio/ctan-bibdata/biblatex-ctan/ctan.cbx
-2024/01/15 | 2839240 | biblio/ctan-bibdata/ctan.bib
-2024/01/15 | 3708800 | biblio/ctan-bibdata/ctan.pdf
+2024/01/16 | 2839351 | biblio/ctan-bibdata/ctan.bib
+2024/01/16 | 3708800 | biblio/ctan-bibdata/ctan.pdf
2023/01/16 | 1489 | biblio/ctan-bibdata/README
-2024/01/15 | 4115495 | biblio/ctan-bibdata.zip
+2024/01/16 | 4115526 | biblio/ctan-bibdata.zip
2023/02/23 | 3126 | biblio/pbibtex/pbibtex-base/cpp.awk
2023/02/23 | 1009 | biblio/pbibtex/pbibtex-base/generate.sh
2023/02/23 | 22362 | biblio/pbibtex/pbibtex-base/jabbrv.bst
@@ -5444,7 +5444,7 @@
1990/10/02 | 5440 | dviware/vutex/vaxvms.hlp
1990/10/02 | 812 | dviware/vutex/vaxvms.ins
1990/10/02 | 127576 | dviware/vutex/vutex.web
-2024/01/15 | 360571 | FILES.last07days
+2024/01/16 | 81817 | FILES.last07days
2021/07/24 | 1139410 | fonts/aboensis/Aboensis.glyphs
2021/07/24 | 18907382 | fonts/aboensis/aboensis.pdf
2021/07/24 | 137860 | fonts/aboensis/Aboensis-Regular.otf
@@ -168358,12 +168358,13 @@
2023/11/26 | 2176 | graphics/pgf/contrib/yquant/tex/yquant.sty
2022/01/07 | 26284 | graphics/pgf/contrib/yquant/tex/yquant-tools.tex
2023/11/29 | 943211 | graphics/pgf/contrib/yquant.zip
-2021/10/22 | 557 | graphics/pgf/contrib/zx-calculus/README.md
-2021/10/22 | 81903 | graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
-2021/10/22 | 652511 | graphics/pgf/contrib/zx-calculus.zip
-2021/10/22 | 616917 | graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
-2021/10/22 | 434 | graphics/pgf/contrib/zx-calculus/zx-calculus.sty
-2021/10/22 | 132713 | graphics/pgf/contrib/zx-calculus/zx-calculus.tex
+2024/01/16 | 5318 | graphics/pgf/contrib/zx-calculus/biblio.bib
+2024/01/16 | 552 | graphics/pgf/contrib/zx-calculus/README.md
+2024/01/16 | 183955 | graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
+2024/01/16 | 1207093 | graphics/pgf/contrib/zx-calculus.zip
+2024/01/16 | 1142885 | graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
+2024/01/16 | 463 | graphics/pgf/contrib/zx-calculus/zx-calculus.sty
+2024/01/16 | 251893 | graphics/pgf/contrib/zx-calculus/zx-calculus.tex
2007/12/11 | 654 | graphics/pgf/README
2005/10/19 | 4608 | graphics/pictex/addon/piccorr.sty
1994/04/20 | 2876 | graphics/pictex/addon/picmore.tex
@@ -198826,7 +198827,7 @@
2012/09/20 | 321508 | install/macros/generic/langcode.tds.zip
2023/04/27 | 1452921 | install/macros/generic/markdown.tds.zip
2014/06/11 | 428488 | install/macros/generic/mathdots.tds.zip
-2024/01/02 | 2843538 | install/macros/generic/memoize.tds.zip
+2024/01/16 | 2843707 | install/macros/generic/memoize.tds.zip
2014/01/02 | 496633 | install/macros/generic/minifp.tds.zip
2012/09/20 | 369585 | install/macros/generic/plainpkg.tds.zip
2023/11/20 | 9022 | install/macros/generic/tex-ini-files.tds.zip
@@ -207551,31 +207552,31 @@
2014/06/11 | 1340 | macros/generic/mathdots/plmdotest.tex
2014/06/11 | 2128 | macros/generic/mathdots/README
2014/06/12 | 424240 | macros/generic/mathdots.zip
-2024/01/02 | 1816 | macros/generic/memoize/CHANGELOG.md
-2024/01/02 | 31104 | macros/generic/memoize/doc/examples-src.zip
-2024/01/02 | 30964 | macros/generic/memoize/doc/examples.zip
-2024/01/02 | 1630 | macros/generic/memoize/doc/memoize-clean.1.md
-2024/01/02 | 626766 | macros/generic/memoize/doc/memoize-code.pdf
-2024/01/02 | 8453 | macros/generic/memoize/doc/memoize-code.sty
-2024/01/02 | 2487 | macros/generic/memoize/doc/memoize-code.tex
-2024/01/02 | 5166 | macros/generic/memoize/doc/memoize-doc-common.sty
-2024/01/02 | 10 | macros/generic/memoize/doc/memoize-doc.mst
-2024/01/02 | 2180931 | macros/generic/memoize/doc/memoize-doc.pdf
-2024/01/02 | 21574 | macros/generic/memoize/doc/memoize-doc.sty
-2024/01/02 | 466720 | macros/generic/memoize/doc/memoize-doc.tex
-2024/01/02 | 5036 | macros/generic/memoize/doc/memoize-extract.1.md
-2024/01/02 | 12932 | macros/generic/memoize/doc/yadoc.sty
-2024/01/02 | 7078 | macros/generic/memoize/INSTALL.md
-2024/01/02 | 19102 | macros/generic/memoize/LICENCE
-2024/01/02 | 5225 | macros/generic/memoize/Makefile
-2024/01/02 | 5248 | macros/generic/memoize/memoize-clean.pl
-2024/01/02 | 6344 | macros/generic/memoize/memoize-clean.py
-2024/01/02 | 144411 | macros/generic/memoize/memoize.edtx
-2024/01/02 | 28466 | macros/generic/memoize/memoize-extract.pl
-2024/01/02 | 25273 | macros/generic/memoize/memoize-extract.py
-2024/01/02 | 1735 | macros/generic/memoize/memoize.ins
-2024/01/02 | 668 | macros/generic/memoize/README.md
-2024/01/02 | 2792294 | macros/generic/memoize.zip
+2024/01/16 | 1949 | macros/generic/memoize/CHANGELOG.md
+2024/01/16 | 31122 | macros/generic/memoize/doc/examples-src.zip
+2024/01/16 | 30964 | macros/generic/memoize/doc/examples.zip
+2024/01/16 | 1630 | macros/generic/memoize/doc/memoize-clean.1.md
+2024/01/16 | 626771 | macros/generic/memoize/doc/memoize-code.pdf
+2024/01/16 | 8453 | macros/generic/memoize/doc/memoize-code.sty
+2024/01/16 | 2487 | macros/generic/memoize/doc/memoize-code.tex
+2024/01/16 | 5166 | macros/generic/memoize/doc/memoize-doc-common.sty
+2024/01/16 | 10 | macros/generic/memoize/doc/memoize-doc.mst
+2024/01/16 | 2181032 | macros/generic/memoize/doc/memoize-doc.pdf
+2024/01/16 | 21574 | macros/generic/memoize/doc/memoize-doc.sty
+2024/01/16 | 466720 | macros/generic/memoize/doc/memoize-doc.tex
+2024/01/16 | 5036 | macros/generic/memoize/doc/memoize-extract.1.md
+2024/01/16 | 12932 | macros/generic/memoize/doc/yadoc.sty
+2024/01/16 | 7078 | macros/generic/memoize/INSTALL.md
+2024/01/16 | 19102 | macros/generic/memoize/LICENCE
+2024/01/16 | 5261 | macros/generic/memoize/Makefile
+2024/01/16 | 5248 | macros/generic/memoize/memoize-clean.pl
+2024/01/16 | 6344 | macros/generic/memoize/memoize-clean.py
+2024/01/16 | 144413 | macros/generic/memoize/memoize.edtx
+2024/01/16 | 28466 | macros/generic/memoize/memoize-extract.pl
+2024/01/16 | 25273 | macros/generic/memoize/memoize-extract.py
+2024/01/16 | 1735 | macros/generic/memoize/memoize.ins
+2024/01/16 | 668 | macros/generic/memoize/README.md
+2024/01/16 | 2792473 | macros/generic/memoize.zip
1993/02/15 | 15966 | macros/generic/midnight/border.doc
1993/02/15 | 10837 | macros/generic/midnight/border.tex
1993/02/15 | 12687 | macros/generic/midnight/dolines.doc
@@ -224500,12 +224501,12 @@
2008/02/10 | 19110 | macros/latex/contrib/ean13isbn/License.txt
2021/01/24 | 422 | macros/latex/contrib/ean13isbn/README
2021/01/24 | 322624 | macros/latex/contrib/ean13isbn.zip
-2024/01/14 | 75256 | macros/latex/contrib/easybook/easybook.dtx
+2024/01/16 | 76095 | macros/latex/contrib/easybook/easybook.dtx
2024/01/04 | 2081 | macros/latex/contrib/easybook/easybook.ins
-2024/01/14 | 599029 | macros/latex/contrib/easybook/easybook.pdf
-2024/01/14 | 86766 | macros/latex/contrib/easybook/easybook.tex
+2024/01/16 | 601383 | macros/latex/contrib/easybook/easybook.pdf
+2024/01/16 | 88258 | macros/latex/contrib/easybook/easybook.tex
2024/01/03 | 801 | macros/latex/contrib/easybook/README.md
-2024/01/14 | 641469 | macros/latex/contrib/easybook.zip
+2024/01/16 | 644406 | macros/latex/contrib/easybook.zip
2009/06/17 | 82589 | macros/latex/contrib/easy/doc/docbib.pdf
2009/06/17 | 78378 | macros/latex/contrib/easy/doc/docbmat.pdf
2009/06/17 | 99132 | macros/latex/contrib/easy/doc/doceqn.pdf
@@ -238888,19 +238889,19 @@
2005/09/04 | 335095 | macros/latex/contrib/ppr-prv/ppr-prv.pdf
2005/09/02 | 4261 | macros/latex/contrib/ppr-prv/README
2005/09/04 | 328544 | macros/latex/contrib/ppr-prv.zip
-2023/11/08 | 654 | macros/latex/contrib/ppt-slides/DEPENDS.txt
-2023/11/08 | 1083 | macros/latex/contrib/ppt-slides/LICENSE.txt
-2023/11/08 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark-mono.tex
-2023/11/08 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark.tex
-2023/11/08 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light-mono.tex
-2023/11/08 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light.tex
-2023/11/08 | 19254 | macros/latex/contrib/ppt-slides/ppt-slides.dtx
-2023/11/08 | 2640 | macros/latex/contrib/ppt-slides/ppt-slides.ins
-2023/11/08 | 934686 | macros/latex/contrib/ppt-slides/ppt-slides.pdf
-2023/11/08 | 3989 | macros/latex/contrib/ppt-slides/ppt-templates/ppt-9x6.tex
-2023/11/08 | 1620 | macros/latex/contrib/ppt-slides/README.md
-2023/11/08 | 94352 | macros/latex/contrib/ppt-slides/socrates.jpg
-2023/11/08 | 1020932 | macros/latex/contrib/ppt-slides.zip
+2024/01/16 | 668 | macros/latex/contrib/ppt-slides/DEPENDS.txt
+2024/01/16 | 1083 | macros/latex/contrib/ppt-slides/LICENSE.txt
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark-mono.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light-mono.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light.tex
+2024/01/16 | 20921 | macros/latex/contrib/ppt-slides/ppt-slides.dtx
+2024/01/16 | 2640 | macros/latex/contrib/ppt-slides/ppt-slides.ins
+2024/01/16 | 935899 | macros/latex/contrib/ppt-slides/ppt-slides.pdf
+2024/01/16 | 3989 | macros/latex/contrib/ppt-slides/ppt-templates/ppt-9x6.tex
+2024/01/16 | 1584 | macros/latex/contrib/ppt-slides/README.md
+2024/01/16 | 94352 | macros/latex/contrib/ppt-slides/socrates.jpg
+2024/01/16 | 1022188 | macros/latex/contrib/ppt-slides.zip
2007/08/13 | 4545 | macros/latex/contrib/pracjourn/pjsample.ltx
2006/11/16 | 122311 | macros/latex/contrib/pracjourn/pjsample.pdf
2007/08/25 | 50011 | macros/latex/contrib/pracjourn/pracjourn.dtx
@@ -240420,6 +240421,30 @@
2023/04/04 | 59861 | macros/latex/contrib/regstats/regstats-example.pdf
2023/04/04 | 474650 | macros/latex/contrib/regstats/regstats.pdf
2023/04/06 | 537416 | macros/latex/contrib/regstats.zip
+2023/03/24 | 200 | macros/latex/contrib/regulatory/doc/example1.bib
+2024/01/16 | 25767 | macros/latex/contrib/regulatory/doc/example1-en.pdf
+2024/01/16 | 1205 | macros/latex/contrib/regulatory/doc/example1-en.tex
+2024/01/16 | 25612 | macros/latex/contrib/regulatory/doc/example1-nl.pdf
+2024/01/16 | 1206 | macros/latex/contrib/regulatory/doc/example1-nl.tex
+2024/01/15 | 1077 | macros/latex/contrib/regulatory/doc/example1.tex
+2023/03/26 | 72 | macros/latex/contrib/regulatory/doc/example2.bib
+2024/01/16 | 52584 | macros/latex/contrib/regulatory/doc/example2-en.pdf
+2024/01/16 | 1427 | macros/latex/contrib/regulatory/doc/example2-en.tex
+2024/01/16 | 52617 | macros/latex/contrib/regulatory/doc/example2-nl.pdf
+2024/01/16 | 1436 | macros/latex/contrib/regulatory/doc/example2-nl.tex
+2024/01/15 | 676 | macros/latex/contrib/regulatory/doc/example2.tex
+2023/03/24 | 772 | macros/latex/contrib/regulatory/doc/example.md
+2024/01/16 | 455 | macros/latex/contrib/regulatory/doc/md-example.tex
+2024/01/16 | 224493 | macros/latex/contrib/regulatory/doc/regulatory-en.pdf
+2024/01/16 | 1504 | macros/latex/contrib/regulatory/doc/regulatory-en.tex
+2024/01/16 | 226188 | macros/latex/contrib/regulatory/doc/regulatory-nl.pdf
+2024/01/16 | 1701 | macros/latex/contrib/regulatory/doc/regulatory-nl.tex
+2024/01/16 | 3404 | macros/latex/contrib/regulatory/doc/regulatory-preamble.tex
+2024/01/16 | 44104 | macros/latex/contrib/regulatory/doc/regulatory.tex
+2024/01/16 | 1248 | macros/latex/contrib/regulatory/README.md
+2024/01/16 | 10740 | macros/latex/contrib/regulatory/tex/fc-dutch.def
+2024/01/16 | 22194 | macros/latex/contrib/regulatory/tex/regulatory.sty
+2024/01/16 | 618605 | macros/latex/contrib/regulatory.zip
2023/06/23 | 24795 | macros/latex/contrib/reledmac/doc-include/migrate-mac.dtx
2023/06/23 | 5602 | macros/latex/contrib/reledmac/doc-include/migrate-par.dtx
2023/06/23 | 16 | macros/latex/contrib/reledmac/doc-more/latexmkrc
@@ -240765,11 +240790,11 @@
2006/04/04 | 1957 | macros/latex/contrib/robustcommand/robustcommand.ins
2006/04/11 | 72818 | macros/latex/contrib/robustcommand/robustcommand.pdf
2006/04/11 | 62251 | macros/latex/contrib/robustcommand.zip
-2023/11/14 | 463 | macros/latex/contrib/robust-externalize/README.md
-2023/11/14 | 766861 | macros/latex/contrib/robust-externalize/robust-externalize.pdf
-2023/11/14 | 141859 | macros/latex/contrib/robust-externalize/robust-externalize.sty
-2023/11/14 | 221797 | macros/latex/contrib/robust-externalize/robust-externalize.tex
-2023/11/14 | 746124 | macros/latex/contrib/robust-externalize.zip
+2024/01/16 | 463 | macros/latex/contrib/robust-externalize/README.md
+2024/01/16 | 1596591 | macros/latex/contrib/robust-externalize/robust-externalize.pdf
+2024/01/16 | 181953 | macros/latex/contrib/robust-externalize/robust-externalize.sty
+2024/01/16 | 269282 | macros/latex/contrib/robust-externalize/robust-externalize.tex
+2024/01/16 | 1481159 | macros/latex/contrib/robust-externalize.zip
2019/01/29 | 162849 | macros/latex/contrib/robustindex/multisample.pdf
2019/01/24 | 7898 | macros/latex/contrib/robustindex/multisample.tex
2019/01/29 | 1037 | macros/latex/contrib/robustindex/README.md
@@ -245234,35 +245259,35 @@
2021/12/17 | 5148 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-grid.tex
2021/12/12 | 8845 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-initialisation.tex
2021/12/12 | 799 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-installation.tex
-2022/06/12 | 6618 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
+2024/01/16 | 6620 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
2021/12/12 | 5859 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-marks.tex
2022/01/05 | 2119 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-news.tex
2020/03/02 | 267 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-obj.tex
-2022/04/02 | 23916 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
+2024/01/16 | 23932 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
2020/03/19 | 1971 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-rep.tex
2020/03/18 | 2223 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-style.tex
2020/03/20 | 4271 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-texte.tex
-2022/07/15 | 362010 | macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
-2022/07/15 | 11216 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
-2022/07/15 | 3579 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
-2022/07/15 | 4366 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
-2022/07/15 | 1995 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
-2022/07/15 | 18263 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
-2022/07/15 | 3466 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
-2022/07/15 | 4904 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
-2022/07/15 | 13313 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
-2022/07/15 | 2724 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
-2022/07/15 | 6480 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
-2022/07/15 | 3474 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
-2022/07/15 | 1216 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
-2022/07/15 | 2256 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
-2022/07/15 | 3482 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
-2022/07/15 | 2742 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
-2022/07/15 | 2703 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
-2022/07/15 | 2978 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
-2022/07/15 | 7778 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
-2022/07/15 | 2762 | macros/latex/contrib/tkz/tkz-base/README.md
-2022/07/15 | 442465 | macros/latex/contrib/tkz/tkz-base.zip
+2024/01/16 | 356502 | macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
+2024/01/16 | 11218 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
+2024/01/16 | 3582 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
+2024/01/16 | 4368 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
+2024/01/16 | 1997 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
+2024/01/16 | 18266 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
+2024/01/16 | 3468 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
+2024/01/16 | 4906 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
+2024/01/16 | 13315 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
+2024/01/16 | 2726 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
+2024/01/16 | 6482 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
+2024/01/16 | 3476 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
+2024/01/16 | 1218 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
+2024/01/16 | 2258 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
+2024/01/16 | 3484 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
+2024/01/16 | 2744 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
+2024/01/16 | 2705 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
+2024/01/16 | 2980 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
+2024/01/16 | 7780 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
+2024/01/16 | 2951 | macros/latex/contrib/tkz/tkz-base/README.md
+2024/01/16 | 437438 | macros/latex/contrib/tkz/tkz-base.zip
2021/01/18 | 20634 | macros/latex/contrib/tkz/tkz-berge/doc/latex/TKZdoc-berge-classic.tex
2021/01/18 | 12925 | macros/latex/contrib/tkz/tkz-berge/doc/latex/TKZdoc-berge-macros-e.tex
2021/01/18 | 8992 | macros/latex/contrib/tkz/tkz-berge/doc/latex/TKZdoc-berge-macros.tex
@@ -245431,28 +245456,33 @@
2021/01/20 | 65 | macros/latex/contrib/tkz/tkz-berge/NamedGraphs/examples/tkzpreamblenamed.ltx
2021/01/20 | 1990 | macros/latex/contrib/tkz/tkz-berge/README.md
2021/01/21 | 1065010 | macros/latex/contrib/tkz/tkz-berge.zip
-2023/12/22 | 25067 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
-2023/12/02 | 12731 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
-2023/12/21 | 17737 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
-2023/12/21 | 11471 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
-2023/12/18 | 4250 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
-2023/12/10 | 16154 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
-2023/12/05 | 4652 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
-2023/12/23 | 8255 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
-2023/12/02 | 3109 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
-2023/12/03 | 5108 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
-2023/12/02 | 3258 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
-2023/12/15 | 13721 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
+2023/12/13 | 1719 | macros/latex/contrib/tkz/tkz-elements/doc/latex/gold_preamble.lua
+2024/01/09 | 352 | macros/latex/contrib/tkz/tkz-elements/doc/latex/sangaku.lua
+2024/01/05 | 32944 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
+2024/01/08 | 12905 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
+2024/01/08 | 28698 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
+2024/01/09 | 12872 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
+2024/01/04 | 4300 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
+2024/01/08 | 19342 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
+2024/01/04 | 4702 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
+2024/01/04 | 8297 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
+2024/01/04 | 3158 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
+2024/01/04 | 5144 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
+2024/01/05 | 3257 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
+2024/01/09 | 14228 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
2023/12/05 | 5053 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
-2023/12/23 | 134798 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
-2023/12/21 | 21593 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
+2024/01/08 | 135503 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
+2024/01/07 | 21579 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
2023/12/23 | 7712 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
-2023/12/22 | 8853 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+2023/12/24 | 88 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
+2024/01/16 | 21987 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+2024/01/09 | 3607 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
2023/12/22 | 9164 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
2023/11/30 | 2777 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-structure.tex
-2023/12/21 | 4364 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
-2023/12/07 | 9277 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
-2023/12/24 | 584764 | macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
+2023/12/24 | 65 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-tests.tex
+2024/01/09 | 4677 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
+2024/01/09 | 9289 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
+2024/01/16 | 642250 | macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
2023/10/25 | 20611 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf
2023/10/26 | 1491 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex
2023/12/02 | 16392 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
@@ -245461,30 +245491,30 @@
2023/10/25 | 2359 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex
2023/11/09 | 11343 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdf
2023/10/31 | 807 | macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex
-2023/12/24 | 7392 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
-2023/12/24 | 1305 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
-2023/12/24 | 3901 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
-2023/12/24 | 4377 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
-2023/12/24 | 6462 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
-2023/12/24 | 3247 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
-2023/12/24 | 2792 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
-2023/12/24 | 2527 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
-2023/12/24 | 996 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
-2023/12/24 | 9128 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
-2023/12/24 | 10025 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
-2023/12/24 | 1488 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
-2023/12/24 | 1937 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
-2023/12/24 | 2055 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
-2023/12/24 | 7858 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
-2023/12/24 | 2136 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
-2023/12/24 | 4174 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
-2023/12/24 | 2326 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
-2023/12/24 | 3243 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
-2023/12/24 | 1691 | macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
-2023/12/24 | 11715 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
-2023/12/24 | 1386 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
-2023/12/24 | 5889 | macros/latex/contrib/tkz/tkz-elements/README.md
-2023/12/24 | 741896 | macros/latex/contrib/tkz/tkz-elements.zip
+2024/01/16 | 8280 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
+2024/01/16 | 1307 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
+2024/01/16 | 3903 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
+2024/01/16 | 4685 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
+2024/01/16 | 6464 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
+2024/01/16 | 3250 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
+2024/01/16 | 2794 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
+2024/01/16 | 2529 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
+2024/01/16 | 1021 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
+2024/01/16 | 9130 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
+2024/01/16 | 12914 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
+2024/01/16 | 1490 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
+2024/01/16 | 1827 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
+2024/01/16 | 2058 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
+2024/01/16 | 7860 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
+2024/01/16 | 2138 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
+2024/01/16 | 4178 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
+2024/01/16 | 2328 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
+2024/01/16 | 3245 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+2024/01/16 | 1789 | macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
+2024/01/16 | 11651 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+2024/01/16 | 1388 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
+2024/01/16 | 7236 | macros/latex/contrib/tkz/tkz-elements/README.md
+2024/01/16 | 808825 | macros/latex/contrib/tkz/tkz-elements.zip
2023/01/17 | 10308 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-angles.tex
2022/06/11 | 5093 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-circleby.tex
2023/10/14 | 11711 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-circles.tex
@@ -245501,70 +245531,70 @@
2023/01/22 | 13418 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-labelling.tex
2022/06/11 | 10307 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lines.tex
2023/01/23 | 1471 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex
-2023/10/26 | 7814 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex
+2024/01/08 | 7814 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex
2023/01/22 | 12001 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex
-2023/10/20 | 11169 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
+2024/01/16 | 11277 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
2023/01/21 | 12703 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-others.tex
2022/04/18 | 17558 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-pointby.tex
2022/08/29 | 33317 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-pointsSpc.tex
2022/06/10 | 10298 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-points.tex
2022/03/31 | 9798 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-pointwith.tex
2022/06/11 | 8013 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-polygons.tex
-2023/01/23 | 23278 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
+2024/01/10 | 23286 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
2022/04/16 | 1600 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-rapporteur.tex
2022/07/17 | 2582 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-rnd.tex
2022/06/11 | 6455 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-show.tex
2022/04/18 | 18644 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex
2023/01/15 | 17327 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex
2022/06/11 | 22352 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-triangles.tex
-2023/10/26 | 1118849 | macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
-2023/10/26 | 21718 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
-2023/10/26 | 5854 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
-2023/10/26 | 3975 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
-2023/10/26 | 901 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
-2023/10/26 | 10203 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
-2023/10/26 | 6360 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
-2023/10/26 | 3948 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
-2023/10/26 | 4601 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
-2023/10/26 | 12163 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
-2023/10/26 | 14423 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
-2023/10/26 | 4375 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
-2023/10/26 | 2005 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
-2023/10/26 | 6591 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
-2023/10/26 | 8993 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
-2023/10/26 | 18295 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
-2023/10/26 | 25253 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
-2023/10/26 | 6521 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
-2023/10/26 | 10839 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
-2023/10/26 | 6765 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
-2023/10/26 | 6574 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
-2023/10/26 | 8983 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
-2023/10/26 | 3473 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
-2023/10/26 | 10450 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
-2023/10/26 | 18510 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
-2023/10/26 | 5343 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
-2023/10/26 | 23353 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
-2023/10/26 | 6837 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
-2023/10/26 | 10652 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
-2023/10/26 | 4085 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
-2023/10/26 | 17804 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
-2023/10/26 | 11224 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
-2023/10/26 | 6652 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
-2023/10/26 | 3884 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
-2023/10/26 | 3496 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
-2023/10/26 | 19094 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
-2023/10/26 | 11099 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
-2023/10/26 | 3056 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
-2023/10/26 | 3497 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
-2023/10/26 | 1224 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
-2023/10/26 | 2268 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
-2023/10/26 | 18272 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
-2023/10/26 | 9000 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
-2023/10/26 | 2749 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
-2023/10/26 | 2987 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
-2023/10/26 | 5841 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
-2023/10/26 | 12163 | macros/latex/contrib/tkz/tkz-euclide/README.md
-2023/10/26 | 1309430 | macros/latex/contrib/tkz/tkz-euclide.zip
+2024/01/16 | 1116615 | macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
+2024/01/16 | 21718 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
+2024/01/16 | 5854 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
+2024/01/16 | 3975 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
+2024/01/16 | 901 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
+2024/01/16 | 10203 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
+2024/01/16 | 6364 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
+2024/01/16 | 3948 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
+2024/01/16 | 4601 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
+2024/01/16 | 12163 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
+2024/01/16 | 14423 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
+2024/01/16 | 4375 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
+2024/01/16 | 2005 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
+2024/01/16 | 6591 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
+2024/01/16 | 8993 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
+2024/01/16 | 18295 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
+2024/01/16 | 25253 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
+2024/01/16 | 6521 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
+2024/01/16 | 10839 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
+2024/01/16 | 6765 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
+2024/01/16 | 6574 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
+2024/01/16 | 8983 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
+2024/01/16 | 3473 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
+2024/01/16 | 10450 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
+2024/01/16 | 18510 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
+2024/01/16 | 5343 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
+2024/01/16 | 23353 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
+2024/01/16 | 6837 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
+2024/01/16 | 10652 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
+2024/01/16 | 4085 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
+2024/01/16 | 17804 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
+2024/01/16 | 11280 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
+2024/01/16 | 6554 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
+2024/01/16 | 3884 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
+2024/01/16 | 3496 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
+2024/01/16 | 19094 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
+2024/01/16 | 11099 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
+2024/01/16 | 3056 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
+2024/01/16 | 3497 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
+2024/01/16 | 1224 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
+2024/01/16 | 2267 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
+2024/01/16 | 18272 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
+2024/01/16 | 9000 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
+2024/01/16 | 2749 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
+2024/01/16 | 2987 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
+2024/01/16 | 5841 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
+2024/01/16 | 12188 | macros/latex/contrib/tkz/tkz-euclide/README.md
+2024/01/16 | 1307177 | macros/latex/contrib/tkz/tkz-euclide.zip
2022/07/15 | 17886 | macros/latex/contrib/tkz/tkzexample/doc/latex/tkzexample.tex
2022/07/15 | 98599 | macros/latex/contrib/tkz/tkzexample/doc/tkzexample.pdf
2022/07/15 | 15954 | macros/latex/contrib/tkz/tkzexample/latex/tkzexample.sty
@@ -292226,7 +292256,7 @@
2021/05/03 | 629 | support/TeX4ht/doc/README
2020/08/24 | 358454 | support/TeX4ht/doc/TeX4ht-doc.tex
2021/05/11 | 262 | support/TeX4ht/README
-2024/01/13 | 242262 | support/TeX4ht/source/ChangeLog
+2024/01/15 | 242798 | support/TeX4ht/source/ChangeLog
2021/05/03 | 1375 | support/TeX4ht/source/checklog.lua
2021/05/03 | 1189 | support/TeX4ht/source/common-code.tex
2021/05/03 | 2727 | support/TeX4ht/source/common-info.tex
@@ -292238,7 +292268,7 @@
2021/05/03 | 1121 | support/TeX4ht/source/README
2021/05/03 | 1744 | support/TeX4ht/source/t1fontmake.lua
2021/05/03 | 297 | support/TeX4ht/source/t1fontsample.tex
-2024/01/13 | 1173423 | support/TeX4ht/source/tex4ht-4ht.tex
+2024/01/15 | 1174354 | support/TeX4ht/source/tex4ht-4ht.tex
2021/05/03 | 7127 | support/TeX4ht/source/tex4ht-auto-script.tex
2021/05/16 | 1539 | support/TeX4ht/source/tex4ht-bibtex2.tex
2023/10/16 | 21307 | support/TeX4ht/source/tex4ht-cond4ht.tex
@@ -321005,7 +321035,7 @@
2014/07/05 | 611 | systems/win32/yandy/README
2014/07/05 | 1004628 | systems/win32/yandy/yandy-src.tar.xz
2014/07/05 | 1012416 | systems/win32/yandy.zip
-2024/01/16 | 186 | timestamp
+2024/01/17 | 186 | timestamp
2002/08/26 | 61898 | usergrps/dante/antrag.pdf
2002/08/26 | 118217 | usergrps/dante/antrag.ps
2021/11/11 | 917 | usergrps/dante/dtk/doc/beispiel.bib
diff --git a/FILES.byname.gz b/FILES.byname.gz
index fe99e22ec1..99ba079dbf 100644
--- a/FILES.byname.gz
+++ b/FILES.byname.gz
Binary files differ
diff --git a/FILES.last07days b/FILES.last07days
index c0f8fb3e40..ce184f4f5e 100644
--- a/FILES.last07days
+++ b/FILES.last07days
@@ -1,3 +1,189 @@
+2024/01/16 | 958 | biblio/bibtex/utils/bibcop/bibcop.1
+2024/01/16 | 94352 | macros/latex/contrib/ppt-slides/socrates.jpg
+2024/01/16 | 935899 | macros/latex/contrib/ppt-slides/ppt-slides.pdf
+2024/01/16 | 9130 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
+2024/01/16 | 901 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
+2024/01/16 | 9000 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
+2024/01/16 | 8993 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
+2024/01/16 | 8983 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
+2024/01/16 | 88258 | macros/latex/contrib/easybook/easybook.tex
+2024/01/16 | 8453 | macros/generic/memoize/doc/memoize-code.sty
+2024/01/16 | 8280 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
+2024/01/16 | 808825 | macros/latex/contrib/tkz/tkz-elements.zip
+2024/01/16 | 7860 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
+2024/01/16 | 7780 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
+2024/01/16 | 76095 | macros/latex/contrib/easybook/easybook.dtx
+2024/01/16 | 7236 | macros/latex/contrib/tkz/tkz-elements/README.md
+2024/01/16 | 7078 | macros/generic/memoize/INSTALL.md
+2024/01/16 | 6837 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
+2024/01/16 | 6765 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
+2024/01/16 | 668 | macros/latex/contrib/ppt-slides/DEPENDS.txt
+2024/01/16 | 668 | macros/generic/memoize/README.md
+2024/01/16 | 6620 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
+2024/01/16 | 6591 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
+2024/01/16 | 6574 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
+2024/01/16 | 6554 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
+2024/01/16 | 6521 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
+2024/01/16 | 6482 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
+2024/01/16 | 6464 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
+2024/01/16 | 644406 | macros/latex/contrib/easybook.zip
+2024/01/16 | 642250 | macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
+2024/01/16 | 6364 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
+2024/01/16 | 6344 | macros/generic/memoize/memoize-clean.py
+2024/01/16 | 626771 | macros/generic/memoize/doc/memoize-code.pdf
+2024/01/16 | 618605 | macros/latex/contrib/regulatory.zip
+2024/01/16 | 601383 | macros/latex/contrib/easybook/easybook.pdf
+2024/01/16 | 5854 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
+2024/01/16 | 5841 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
+2024/01/16 | 552 | graphics/pgf/contrib/zx-calculus/README.md
+2024/01/16 | 5343 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
+2024/01/16 | 5318 | graphics/pgf/contrib/zx-calculus/biblio.bib
+2024/01/16 | 5261 | macros/generic/memoize/Makefile
+2024/01/16 | 52617 | macros/latex/contrib/regulatory/doc/example2-nl.pdf
+2024/01/16 | 52584 | macros/latex/contrib/regulatory/doc/example2-en.pdf
+2024/01/16 | 5248 | macros/generic/memoize/memoize-clean.pl
+2024/01/16 | 5166 | macros/generic/memoize/doc/memoize-doc-common.sty
+2024/01/16 | 5100 | biblio/bibtex/utils/bibcop/bibcop-logo.pdf
+2024/01/16 | 5036 | macros/generic/memoize/doc/memoize-extract.1.md
+2024/01/16 | 4906 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
+2024/01/16 | 4685 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
+2024/01/16 | 466720 | macros/generic/memoize/doc/memoize-doc.tex
+2024/01/16 | 463 | macros/latex/contrib/robust-externalize/README.md
+2024/01/16 | 463 | graphics/pgf/contrib/zx-calculus/zx-calculus.sty
+2024/01/16 | 4601 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
+2024/01/16 | 455 | macros/latex/contrib/regulatory/doc/md-example.tex
+2024/01/16 | 44104 | macros/latex/contrib/regulatory/doc/regulatory.tex
+2024/01/16 | 4375 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
+2024/01/16 | 437438 | macros/latex/contrib/tkz/tkz-base.zip
+2024/01/16 | 4368 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
+2024/01/16 | 4178 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
+2024/01/16 | 4115526 | biblio/ctan-bibdata.zip
+2024/01/16 | 4085 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
+2024/01/16 | 3989 | macros/latex/contrib/ppt-slides/ppt-templates/ppt-9x6.tex
+2024/01/16 | 3975 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
+2024/01/16 | 3948 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
+2024/01/16 | 3903 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
+2024/01/16 | 3884 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
+2024/01/16 | 3708800 | biblio/ctan-bibdata/ctan.pdf
+2024/01/16 | 367397 | biblio/bibtex/utils/bibcop.zip
+2024/01/16 | 3582 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
+2024/01/16 | 356502 | macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
+2024/01/16 | 3497 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
+2024/01/16 | 3496 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
+2024/01/16 | 3484 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
+2024/01/16 | 348056 | biblio/bibtex/utils/bibcop/bibcop.pdf
+2024/01/16 | 3476 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
+2024/01/16 | 3473 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
+2024/01/16 | 3468 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
+2024/01/16 | 3404 | macros/latex/contrib/regulatory/doc/regulatory-preamble.tex
+2024/01/16 | 3250 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
+2024/01/16 | 3245 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+2024/01/16 | 31122 | macros/generic/memoize/doc/examples-src.zip
+2024/01/16 | 30964 | macros/generic/memoize/doc/examples.zip
+2024/01/16 | 3056 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
+2024/01/16 | 2987 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
+2024/01/16 | 2980 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
+2024/01/16 | 2951 | macros/latex/contrib/tkz/tkz-base/README.md
+2024/01/16 | 2917 | biblio/bibtex/utils/bibcop/README.md
+2024/01/16 | 28466 | macros/generic/memoize/memoize-extract.pl
+2024/01/16 | 2843707 | install/macros/generic/memoize.tds.zip
+2024/01/16 | 2839351 | biblio/ctan-bibdata/ctan.bib
+2024/01/16 | 2794 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
+2024/01/16 | 2792473 | macros/generic/memoize.zip
+2024/01/16 | 2749 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
+2024/01/16 | 2744 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
+2024/01/16 | 2726 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
+2024/01/16 | 2705 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
+2024/01/16 | 269282 | macros/latex/contrib/robust-externalize/robust-externalize.tex
+2024/01/16 | 26644 | biblio/bibtex/utils/bibcop/bibcop.pl
+2024/01/16 | 2640 | macros/latex/contrib/ppt-slides/ppt-slides.ins
+2024/01/16 | 2628 | biblio/bibtex/utils/bibcop/bibcop.ins
+2024/01/16 | 25767 | macros/latex/contrib/regulatory/doc/example1-en.pdf
+2024/01/16 | 25612 | macros/latex/contrib/regulatory/doc/example1-nl.pdf
+2024/01/16 | 2529 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
+2024/01/16 | 25273 | macros/generic/memoize/memoize-extract.py
+2024/01/16 | 25253 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
+2024/01/16 | 251893 | graphics/pgf/contrib/zx-calculus/zx-calculus.tex
+2024/01/16 | 2487 | macros/generic/memoize/doc/memoize-code.tex
+2024/01/16 | 23932 | macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
+2024/01/16 | 23353 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
+2024/01/16 | 2328 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
+2024/01/16 | 2267 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
+2024/01/16 | 226188 | macros/latex/contrib/regulatory/doc/regulatory-nl.pdf
+2024/01/16 | 2258 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
+2024/01/16 | 224493 | macros/latex/contrib/regulatory/doc/regulatory-en.pdf
+2024/01/16 | 22194 | macros/latex/contrib/regulatory/tex/regulatory.sty
+2024/01/16 | 21987 | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+2024/01/16 | 2181032 | macros/generic/memoize/doc/memoize-doc.pdf
+2024/01/16 | 21718 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
+2024/01/16 | 21574 | macros/generic/memoize/doc/memoize-doc.sty
+2024/01/16 | 2138 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
+2024/01/16 | 211 | biblio/bibtex/utils/bibcop/DEPENDS.txt
+2024/01/16 | 20921 | macros/latex/contrib/ppt-slides/ppt-slides.dtx
+2024/01/16 | 2058 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
+2024/01/16 | 2005 | macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
+2024/01/16 | 1997 | macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
+2024/01/16 | 1949 | macros/generic/memoize/CHANGELOG.md
+2024/01/16 | 19102 | macros/generic/memoize/LICENCE
+2024/01/16 | 19094 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
+2024/01/16 | 18510 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
+2024/01/16 | 183955 | graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
+2024/01/16 | 18295 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
+2024/01/16 | 1827 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
+2024/01/16 | 18272 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
+2024/01/16 | 18266 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
+2024/01/16 | 181953 | macros/latex/contrib/robust-externalize/robust-externalize.sty
+2024/01/16 | 1789 | macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
+2024/01/16 | 17804 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
+2024/01/16 | 1735 | macros/generic/memoize/memoize.ins
+2024/01/16 | 1701 | macros/latex/contrib/regulatory/doc/regulatory-nl.tex
+2024/01/16 | 1678 | biblio/ctan-bibdata/biblatex-ctan/ctan.bbx
+2024/01/16 | 16344 | biblio/bibtex/utils/bibcop/bibcop.dtx
+2024/01/16 | 1630 | macros/generic/memoize/doc/memoize-clean.1.md
+2024/01/16 | 1596591 | macros/latex/contrib/robust-externalize/robust-externalize.pdf
+2024/01/16 | 1584 | macros/latex/contrib/ppt-slides/README.md
+2024/01/16 | 1504 | macros/latex/contrib/regulatory/doc/regulatory-en.tex
+2024/01/16 | 1490 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
+2024/01/16 | 1481159 | macros/latex/contrib/robust-externalize.zip
+2024/01/16 | 144413 | macros/generic/memoize/memoize.edtx
+2024/01/16 | 14423 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
+2024/01/16 | 1436 | macros/latex/contrib/regulatory/doc/example2-nl.tex
+2024/01/16 | 1427 | macros/latex/contrib/regulatory/doc/example2-en.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-light-mono.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark.tex
+2024/01/16 | 1420 | macros/latex/contrib/ppt-slides/ppt-schemes/ppt-dark-mono.tex
+2024/01/16 | 1388 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
+2024/01/16 | 13315 | macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
+2024/01/16 | 1307 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
+2024/01/16 | 1307177 | macros/latex/contrib/tkz/tkz-euclide.zip
+2024/01/16 | 12932 | macros/generic/memoize/doc/yadoc.sty
+2024/01/16 | 12914 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
+2024/01/16 | 1248 | macros/latex/contrib/regulatory/README.md
+2024/01/16 | 1224 | macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
+2024/01/16 | 1218 | macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
+2024/01/16 | 12188 | macros/latex/contrib/tkz/tkz-euclide/README.md
+2024/01/16 | 12163 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
+2024/01/16 | 1207093 | graphics/pgf/contrib/zx-calculus.zip
+2024/01/16 | 1206 | macros/latex/contrib/regulatory/doc/example1-nl.tex
+2024/01/16 | 1205 | macros/latex/contrib/regulatory/doc/example1-en.tex
+2024/01/16 | 11651 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+2024/01/16 | 1142885 | graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
+2024/01/16 | 11280 | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
+2024/01/16 | 11277 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
+2024/01/16 | 11218 | macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
+2024/01/16 | 1116615 | macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
+2024/01/16 | 11099 | macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
+2024/01/16 | 10 | macros/generic/memoize/doc/memoize-doc.mst
+2024/01/16 | 1083 | macros/latex/contrib/ppt-slides/LICENSE.txt
+2024/01/16 | 1083 | biblio/bibtex/utils/bibcop/LICENSE.txt
+2024/01/16 | 10839 | macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
+2024/01/16 | 10740 | macros/latex/contrib/regulatory/tex/fc-dutch.def
+2024/01/16 | 10652 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
+2024/01/16 | 10450 | macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
+2024/01/16 | 1022188 | macros/latex/contrib/ppt-slides.zip
+2024/01/16 | 1021 | macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
+2024/01/16 | 10203 | macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
2024/01/15 | 99 | macros/latex/base/ltpara-code.tex
2024/01/15 | 999254 | macros/luatex/latex/piton/piton.pdf
2024/01/15 | 9935 | macros/latex/base/ltnews21.tex
@@ -42,6 +228,7 @@
2024/01/15 | 69439 | macros/latex/base/clsguide-historic.tex
2024/01/15 | 69002 | macros/latex/base/ltpictur.dtx
2024/01/15 | 68735 | macros/latex/base/usrguide-historic.tex
+2024/01/15 | 676 | macros/latex/contrib/regulatory/doc/example2.tex
2024/01/15 | 6760 | macros/latex/base/slides.ins
2024/01/15 | 67588 | macros/latex/base/ltcmdhooks.dtx
2024/01/15 | 67442 | macros/latex/base/ltfilehook.dtx
@@ -149,7 +336,6 @@
2024/01/15 | 4219 | macros/latex/base/latex209.ins
2024/01/15 | 4190 | macros/latex/base/ltnews19.tex
2024/01/15 | 415615 | macros/latex/base/clsguide-historic.pdf
-2024/01/15 | 4115495 | biblio/ctan-bibdata.zip
2024/01/15 | 4087 | macros/latex/base/classes.ins
2024/01/15 | 4079 | macros/latex/base/lablst.tex
2024/01/15 | 405305 | macros/luatex/latex/piton/piton-french.pdf
@@ -164,7 +350,6 @@
2024/01/15 | 37673 | macros/latex/base/ltsockets.dtx
2024/01/15 | 375493 | macros/latex/base/slides.pdf
2024/01/15 | 3725 | macros/latex/base/ltlogos.dtx
-2024/01/15 | 3708800 | biblio/ctan-bibdata/ctan.pdf
2024/01/15 | 36154 | macros/latex/base/ltlists.dtx
2024/01/15 | 35984 | macros/latex/base/ltdirchk.dtx
2024/01/15 | 353563 | macros/latex/base/utf8ienc.pdf
@@ -208,7 +393,6 @@
2024/01/15 | 287727 | macros/latex/base/fix-cm.pdf
2024/01/15 | 286964 | systems/texlive/tlnet/archive/profmaquette.doc.r69420.tar.xz
2024/01/15 | 286824 | macros/latex/base/ltnews23.pdf
-2024/01/15 | 2839240 | biblio/ctan-bibdata/ctan.bib
2024/01/15 | 282095 | macros/latex/base/latexrelease.pdf
2024/01/15 | 2810 | support/texlogsieve/README.md
2024/01/15 | 2728 | macros/latex/base/ltpageno.dtx
@@ -232,6 +416,7 @@
2024/01/15 | 243 | macros/latex/base/ltproperties-doc.tex
2024/01/15 | 24385 | support/texlogsieve/texlogsieve.tex
2024/01/15 | 24286 | macros/latex/base/ltcounts.dtx
+2024/01/15 | 242798 | support/TeX4ht/source/ChangeLog
2024/01/15 | 242471 | macros/latex/base/doc.dtx
2024/01/15 | 241 | macros/latex/base/ltfilehook-doc.tex
2024/01/15 | 240 | macros/latex/base/ltsockets-doc.tex
@@ -290,7 +475,6 @@
2024/01/15 | 169553 | macros/latex/base/ltnews01.pdf
2024/01/15 | 1694 | macros/latex/base/small2e.tex
2024/01/15 | 169433 | macros/latex/base/ltnews10.pdf
-2024/01/15 | 1678 | biblio/ctan-bibdata/biblatex-ctan/ctan.bbx
2024/01/15 | 166269 | macros/latex/base/ltnews17.pdf
2024/01/15 | 165816 | macros/latex/base/makeindx.pdf
2024/01/15 | 16500 | macros/latex/base/modguide.tex
@@ -461,6 +645,7 @@
2024/01/15 | 12334 | macros/latex/base/ltnews24.tex
2024/01/15 | 12246 | macros/latex/base/tulm.fdd
2024/01/15 | 1200 | fonts/newtxtt/tfm/txttz.tfm
+2024/01/15 | 1174354 | support/TeX4ht/source/tex4ht-4ht.tex
2024/01/15 | 11463 | macros/latex/base/manifest.txt
2024/01/15 | 114276 | systems/texlive/tlnet/archive/texlive-scripts.r69415.tar.xz
2024/01/15 | 112208 | macros/latex/base/ltnews11.pdf
@@ -469,6 +654,7 @@
2024/01/15 | 10798 | macros/latex/base/ltnews26.tex
2024/01/15 | 10792 | macros/latex/base/ltnews22.tex
2024/01/15 | 10791 | macros/latex/base/ltnews23.tex
+2024/01/15 | 1077 | macros/latex/contrib/regulatory/doc/example1.tex
2024/01/15 | 1075672 | macros/latex/base/doc-code.pdf
2024/01/15 | 106904 | macros/latex/base/inputenc.dtx
2024/01/15 | 10601 | macros/latex/base/makeindx.dtx
@@ -483,14 +669,10 @@
2024/01/14 | 9836 | systems/texlive/tlnet/archive/tikzquads.r69409.tar.xz
2024/01/14 | 93200 | info/docsurvey/docsurvey.tex
2024/01/14 | 883835 | graphics/pgf/contrib/bodeplot/bodeplot-doc.pdf
-2024/01/14 | 86766 | macros/latex/contrib/easybook/easybook.tex
2024/01/14 | 817 | info/docsurvey/README.txt
-2024/01/14 | 75256 | macros/latex/contrib/easybook/easybook.dtx
2024/01/14 | 7407 | systems/texlive/tlnet/tlpkg/installer/ctan-mirrors.pl
2024/01/14 | 7248 | systems/texlive/tlnet/archive/docshots.source.r69410.tar.xz
-2024/01/14 | 641469 | macros/latex/contrib/easybook.zip
2024/01/14 | 622156 | systems/texlive/tlnet/archive/easybook.doc.r69411.tar.xz
-2024/01/14 | 599029 | macros/latex/contrib/easybook/easybook.pdf
2024/01/14 | 56640 | macros/latex/contrib/profmaquette/doc/ProfMaquette-doc.tex
2024/01/14 | 487 | macros/latex/contrib/amnestyreport/README
2024/01/14 | 431196 | systems/texlive/tlnet/archive/tikzquads.doc.r69409.tar.xz
@@ -589,7 +771,6 @@
2024/01/13 | 2460 | language/armenian/armtex/fonts/tfm/artmsl10.tfm
2024/01/13 | 2460 | language/armenian/armtex/fonts/tfm/artmr10.tfm
2024/01/13 | 2432460 | systems/texlive/tlnet/archive/simpleicons.doc.r69396.tar.xz
-2024/01/13 | 242262 | support/TeX4ht/source/ChangeLog
2024/01/13 | 22708 | macros/latex/contrib/docshots/docshots.dtx
2024/01/13 | 2212 | language/armenian/armtex/tex/latex/ot6cmr.fd
2024/01/13 | 2135 | graphics/pgf/contrib/tikzquads/README.md
@@ -630,7 +811,6 @@
2024/01/13 | 120855 | language/armenian/armtex/fonts/source/arsssl10.mf
2024/01/13 | 120789 | language/armenian/armtex/fonts/source/arssr10.mf
2024/01/13 | 12052 | systems/texlive/tlnet/archive/tocdata.source.r69402.tar.xz
-2024/01/13 | 1173423 | support/TeX4ht/source/tex4ht-4ht.tex
2024/01/13 | 10978 | language/armenian/armtex/tex/plain/armkb-a8.tex
2024/01/13 | 1083 | macros/latex/contrib/docshots/LICENSE.txt
2024/01/13 | 1052904 | systems/texlive/tlnet/archive/keyfloat.doc.r69399.tar.xz
@@ -643,7 +823,6 @@
2024/01/13 | 10109 | language/armenian/armtex/fonts/afm/arssb10.afm
2024/01/12 | 969452 | systems/texlive/tlnet/archive/newtx.doc.r69381.tar.xz
2024/01/12 | 960487 | macros/latex/contrib/tocdata.zip
-2024/01/12 | 958 | biblio/bibtex/utils/bibcop/bibcop.1
2024/01/12 | 958705 | macros/latex/contrib/tocdata/tocdata.pdf
2024/01/12 | 9467 | macros/latex/contrib/labelschanged/labelschanged.dtx
2024/01/12 | 9068 | systems/texlive/tlnet/archive/eolang.r69391.tar.xz
@@ -666,7 +845,6 @@
2024/01/12 | 514 | macros/luatex/latex/lua-placeholders/README.md
2024/01/12 | 51360 | systems/texlive/tlnet/archive/proflycee.r69386.tar.xz
2024/01/12 | 51244 | macros/latex/contrib/tocdata/tocdata.dtx
-2024/01/12 | 5100 | biblio/bibtex/utils/bibcop/bibcop-logo.pdf
2024/01/12 | 502300 | systems/texlive/tlnet/archive/ffcode.doc.r69383.tar.xz
2024/01/12 | 4936 | systems/texlive/tlnet/archive/ffcode.source.r69383.tar.xz
2024/01/12 | 476084 | systems/texlive/tlnet/archive/newpx.doc.r69380.tar.xz
@@ -684,7 +862,6 @@
2024/01/12 | 3698 | fonts/simpleicons/enc/simpleiconsthree.enc
2024/01/12 | 3695 | fonts/simpleicons/enc/simpleiconsfour.enc
2024/01/12 | 3694 | fonts/simpleicons/enc/simpleiconsfive.enc
-2024/01/12 | 367388 | biblio/bibtex/utils/bibcop.zip
2024/01/12 | 3672 | fonts/simpleicons/enc/simpleiconsseven.enc
2024/01/12 | 3648 | fonts/simpleicons/enc/simpleiconstwo.enc
2024/01/12 | 3646 | fonts/simpleicons/enc/simpleiconseight.enc
@@ -694,7 +871,6 @@
2024/01/12 | 3542 | fonts/simpleicons/enc/simpleiconssix.enc
2024/01/12 | 351825 | macros/luatex/latex/lua-typo.zip
2024/01/12 | 348 | systems/texlive/tlnet/archive/eolang.x86_64-darwinlegacy.r69391.tar.xz
-2024/01/12 | 348056 | biblio/bibtex/utils/bibcop/bibcop.pdf
2024/01/12 | 340 | systems/texlive/tlnet/archive/eolang.x86_64-linux.r69391.tar.xz
2024/01/12 | 340 | systems/texlive/tlnet/archive/eolang.x86_64-linuxmusl.r69391.tar.xz
2024/01/12 | 340 | systems/texlive/tlnet/archive/eolang.x86_64-cygwin.r69391.tar.xz
@@ -714,7 +890,6 @@
2024/01/12 | 314124 | systems/texlive/tlnet/archive/tikzquests.doc.r69388.tar.xz
2024/01/12 | 3116 | systems/texlive/tlnet/archive/tikzdotncross.r69382.tar.xz
2024/01/12 | 2997 | macros/luatex/latex/lua-typo/doc/lua-typo-demo.tex
-2024/01/12 | 2917 | biblio/bibtex/utils/bibcop/README.md
2024/01/12 | 2846 | macros/luatex/latex/lua-placeholders/tex/lua-placeholders.sty
2024/01/12 | 281897 | fonts/simpleicons/tex/simpleiconsglyphs-pdftex.tex
2024/01/12 | 2788 | fonts/simpleicons/enc/simpleiconsonetwo.enc
@@ -723,11 +898,9 @@
2024/01/12 | 269 | fonts/simpleicons/tex/usimpleiconsonetwo.fd
2024/01/12 | 269 | fonts/simpleicons/tex/usimpleiconsoneone.fd
2024/01/12 | 2675 | macros/luatex/latex/lua-placeholders/scripts/lua-placeholders-namespace.lua
-2024/01/12 | 26638 | biblio/bibtex/utils/bibcop/bibcop.pl
2024/01/12 | 264 | fonts/simpleicons/tex/usimpleiconsthree.fd
2024/01/12 | 264 | fonts/simpleicons/tex/usimpleiconsseven.fd
2024/01/12 | 264 | fonts/simpleicons/tex/usimpleiconseight.fd
-2024/01/12 | 2628 | biblio/bibtex/utils/bibcop/bibcop.ins
2024/01/12 | 259 | fonts/simpleicons/tex/usimpleiconsnine.fd
2024/01/12 | 259 | fonts/simpleicons/tex/usimpleiconsfour.fd
2024/01/12 | 259 | fonts/simpleicons/tex/usimpleiconsfive.fd
@@ -749,7 +922,6 @@
2024/01/12 | 215741 | macros/latex/contrib/labelschanged/labelschanged.pdf
2024/01/12 | 215391 | macros/luatex/latex/lua-typo/doc/lua-typo.pdf
2024/01/12 | 213587 | macros/latex/contrib/labelschanged.zip
-2024/01/12 | 211 | biblio/bibtex/utils/bibcop/DEPENDS.txt
2024/01/12 | 2116 | systems/texlive/tlnet/archive/ffcode.r69383.tar.xz
2024/01/12 | 2004 | systems/texlive/tlnet/archive/verifycommand.r69389.tar.xz
2024/01/12 | 1812 | fonts/simpleicons/doc/simpleicons.tex
@@ -761,7 +933,6 @@
2024/01/12 | 164768 | macros/latex/contrib/keyfloat/keyfloat.dtx
2024/01/12 | 1644 | macros/latex/contrib/keyfloat/keyfloat.ins
2024/01/12 | 1636 | macros/latex/contrib/tocdata/tocdata.ins
-2024/01/12 | 16344 | biblio/bibtex/utils/bibcop/bibcop.dtx
2024/01/12 | 1632 | fonts/simpleicons/tex/simpleicons.sty
2024/01/12 | 15726400 | systems/texlive/tlnet/archive/newcomputermodern.doc.r69379.tar.xz
2024/01/12 | 152072 | systems/texlive/tlnet/archive/pgfkeysearch.doc.r69385.tar.xz
@@ -785,7 +956,6 @@
2024/01/12 | 1207 | fonts/simpleicons/README.md
2024/01/12 | 1154 | macros/latex/contrib/keyfloat/README.txt
2024/01/12 | 1088701 | macros/latex/contrib/keyfloat.zip
-2024/01/12 | 1083 | biblio/bibtex/utils/bibcop/LICENSE.txt
2024/01/12 | 107762 | macros/luatex/latex/lua-typo/doc/lua-typo-fr.pdf
2024/01/12 | 1058922 | macros/latex/contrib/keyfloat/keyfloat.pdf
2024/01/12 | 1019 | macros/latex/contrib/labelschanged/labelschanged.ins
@@ -1014,7 +1184,6 @@
2024/01/10 | 37188 | systems/texlive/tlnet/archive/mptopdf.r69363.tar.xz
2024/01/10 | 36704 | systems/texlive/tlnet/archive/l3build.r69360.tar.xz
2024/01/10 | 365848 | fonts/newcomputermodern/otf/NewCMSans10-Regular.otf
-2024/01/10 | 36536 | graphics/pgf/contrib/braids/braids.tex
2024/01/10 | 363240 | fonts/newcomputermodern/otf/NewCMSans10-BookOblique.otf
2024/01/10 | 35224 | macros/latex/contrib/tcolorbox/lichtspiel.jpg
2024/01/10 | 3486 | macros/latex/contrib/tcolorbox/tcolorbox.tex
@@ -1052,6 +1221,7 @@
2024/01/10 | 242842 | support/latexmk/latexmk.txt
2024/01/10 | 2400 | macros/luatex/latex/pyluatex/example/typesetting-listings.tex
2024/01/10 | 2349 | macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
+2024/01/10 | 23286 | macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
2024/01/10 | 2310 | macros/luatex/latex/pyluatex/example/repl.tex
2024/01/10 | 230284 | support/latexmk/latexmk.pdf
2024/01/10 | 22785 | macros/latex/contrib/physics2/physics2.tex
@@ -1106,102 +1276,3 @@
2024/01/10 | 103614 | macros/latex/contrib/tcolorbox/tcolorbox.sty
2024/01/10 | 1022 | macros/latex/contrib/physics2/README.md
2024/01/10 | 10040 | macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
-2024/01/09 | 983 | fonts/junicodevf/doc/encoded-glyphs.tex
-2024/01/09 | 9542 | graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.tex
-2024/01/09 | 88792 | systems/texlive/tlnet/archive/spbmark.doc.r69350.tar.xz
-2024/01/09 | 881 | macros/latex/contrib/changebar/README
-2024/01/09 | 827193 | install/macros/latex/contrib/l3build.tds.zip
-2024/01/09 | 823268 | macros/latex/contrib/l3build.zip
-2024/01/09 | 8093 | macros/latex/contrib/l3build/l3build-variables.lua
-2024/01/09 | 80335 | fonts/junicodevf/doc/Feature_Reference.tex
-2024/01/09 | 7996 | systems/texlive/tlnet/archive/dtxdescribe.r69348.tar.xz
-2024/01/09 | 79312 | graphics/pmdraw/pmdraw.tex
-2024/01/09 | 7816 | macros/latex/contrib/l3build/l3build-arguments.lua
-2024/01/09 | 773595 | macros/latex/contrib/changebar.zip
-2024/01/09 | 749004 | macros/latex/contrib/l3build/l3build.pdf
-2024/01/09 | 7375 | fonts/junicodevf/doc/EnlargeAxis.tex
-2024/01/09 | 7201 | macros/latex/contrib/l3build/l3build-manifest.lua
-2024/01/09 | 7129 | macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex
-2024/01/09 | 7076 | graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.tex
-2024/01/09 | 7019 | macros/latex/contrib/l3build/l3build.lua
-2024/01/09 | 6825 | fonts/junicodevf/lualatex/junicodevf.lua
-2024/01/09 | 6482 | macros/latex/contrib/l3build/l3build-typesetting.lua
-2024/01/09 | 6392 | systems/texlive/tlnet/archive/minim-xmp.r69352.tar.xz
-2024/01/09 | 6388 | fonts/junicodevf/doc/JunicodeManual.sty
-2024/01/09 | 6336 | macros/latex/contrib/l3build/l3build-aux.lua
-2024/01/09 | 61960 | systems/texlive/tlnet/archive/minim-xmp.doc.r69352.tar.xz
-2024/01/09 | 59994 | fonts/junicodevf/doc/tag_key_ins.tex
-2024/01/09 | 5610 | macros/latex/contrib/href-ul/href-ul.dtx
-2024/01/09 | 5419579 | install/fonts/junicodevf.tds.zip
-2024/01/09 | 5416995 | fonts/junicodevf.zip
-2024/01/09 | 513977 | fonts/junicodevf/doc/junicodevf-samples.pdf
-2024/01/09 | 4973 | macros/latex/contrib/l3build/l3build-ctan.lua
-2024/01/09 | 486497 | macros/latex/contrib/changebar/changebar.pdf
-2024/01/09 | 48636 | systems/texlive/tlnet/archive/tuda-ci.r69351.tar.xz
-2024/01/09 | 461072 | systems/texlive/tlnet/archive/dtxdescribe.doc.r69348.tar.xz
-2024/01/09 | 44411 | graphics/pmdraw/pmdraw.sty
-2024/01/09 | 438 | macros/luatex/latex/lua-placeholders/doc/lua-placeholders-deps.bib
-2024/01/09 | 4356 | fonts/junicodevf/doc/OFL.txt
-2024/01/09 | 4349 | macros/latex/contrib/l3build/l3build-stdmain.lua
-2024/01/09 | 427969 | graphics/pgf/contrib/thematicpuzzle.zip
-2024/01/09 | 4156 | macros/latex/contrib/l3build/l3build-zip.lua
-2024/01/09 | 397279 | graphics/pmdraw.zip
-2024/01/09 | 38553 | macros/latex/contrib/l3build/l3build-check.lua
-2024/01/09 | 377618 | graphics/pmdraw/pmdraw.pdf
-2024/01/09 | 3480 | fonts/junicodevf/README
-2024/01/09 | 344744 | systems/texlive/tlnet/archive/minim.doc.r69352.tar.xz
-2024/01/09 | 3420 | systems/texlive/tlnet/archive/spbmark.r69350.tar.xz
-2024/01/09 | 34080 | systems/texlive/tlnet/archive/minim-math.r69352.tar.xz
-2024/01/09 | 339 | macros/latex/contrib/changebar/CATALOG
-2024/01/09 | 3170 | fonts/junicodevf/doc/About.tex
-2024/01/09 | 300457 | macros/latex/contrib/href-ul/href-ul.pdf
-2024/01/09 | 288348 | macros/latex/contrib/href-ul.zip
-2024/01/09 | 2825400 | fonts/junicodevf/truetype/JunicodeVF-Italic.ttf
-2024/01/09 | 2754408 | fonts/junicodevf/truetype/JunicodeVF-Roman.ttf
-2024/01/09 | 2746 | macros/latex/contrib/l3build/l3build-unpack.lua
-2024/01/09 | 2631 | macros/latex/contrib/href-ul/href-ul.ins
-2024/01/09 | 2611 | macros/latex/contrib/changebar/changebar.ins
-2024/01/09 | 25444 | systems/texlive/tlnet/archive/minim.r69352.tar.xz
-2024/01/09 | 2469 | macros/latex/contrib/l3build/l3build-help.lua
-2024/01/09 | 24252 | systems/texlive/tlnet/archive/dtxdescribe.source.r69348.tar.xz
-2024/01/09 | 2411 | macros/latex/contrib/l3build/l3build.1
-2024/01/09 | 236 | macros/latex/contrib/href-ul/DEPENDS.txt
-2024/01/09 | 23253 | macros/latex/contrib/l3build/CHANGELOG.md
-2024/01/09 | 2286 | macros/latex/contrib/l3build/l3build-tagging.lua
-2024/01/09 | 2145 | macros/latex/contrib/l3build/l3build-clean.lua
-2024/01/09 | 214166 | graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-fr.pdf
-2024/01/09 | 213685 | graphics/pgf/contrib/thematicpuzzle/doc/thematicpuzzle-doc-en.pdf
-2024/01/09 | 207960 | macros/latex/contrib/ukbill.zip
-2024/01/09 | 20624 | systems/texlive/tlnet/archive/minim-mp.r69352.tar.xz
-2024/01/09 | 1895371 | fonts/junicodevf/doc/JunicodeManual.pdf
-2024/01/09 | 18857 | fonts/junicodevf/doc/Record_Interpreter_notes.tex
-2024/01/09 | 1854 | graphics/pmdraw/README.md
-2024/01/09 | 17134 | fonts/junicodevf/doc/in_tex.tex
-2024/01/09 | 16421836 | macros/texinfo/texinfo.zip
-2024/01/09 | 16356 | systems/texlive/tlnet/archive/minim-pdf.r69352.tar.xz
-2024/01/09 | 1537 | macros/latex/contrib/l3build/l3build.ins
-2024/01/09 | 151740 | systems/texlive/tlnet/archive/texlive-msg-translations.r69346.tar.xz
-2024/01/09 | 14744 | systems/texlive/tlnet/archive/iran-bibtex.r69347.tar.xz
-2024/01/09 | 1384 | fonts/junicodevf/doc/JunicodeManual.tex
-2024/01/09 | 133393 | macros/latex/contrib/changebar/changebar.dtx
-2024/01/09 | 13186 | macros/latex/contrib/l3build/l3build-upload.lua
-2024/01/09 | 129615659 | fonts/junicode.zip
-2024/01/09 | 12542 | macros/latex/contrib/l3build/l3build-file-functions.lua
-2024/01/09 | 1244 | macros/latex/contrib/href-ul/README.md
-2024/01/09 | 122996 | systems/texlive/tlnet/archive/minim-pdf.doc.r69352.tar.xz
-2024/01/09 | 12093 | fonts/junicodevf/doc/dns.png
-2024/01/09 | 11924 | macros/latex/contrib/changebar/changebar.bug
-2024/01/09 | 11922 | fonts/junicodevf/lualatex/junicodevf.sty
-2024/01/09 | 11921 | fonts/junicodevf/doc/Specimens.tex
-2024/01/09 | 11896 | fonts/junicodevf/doc/GettingStarted.tex
-2024/01/09 | 1167844 | systems/texlive/tlnet/archive/tuda-ci.doc.r69351.tar.xz
-2024/01/09 | 11665 | graphics/pgf/contrib/thematicpuzzle/tex/thematicpuzzle.sty
-2024/01/09 | 115764 | systems/texlive/tlnet/archive/minim-mp.doc.r69352.tar.xz
-2024/01/09 | 113783 | macros/latex/contrib/l3build/l3build.dtx
-2024/01/09 | 11077 | macros/latex/contrib/l3build/l3build-install.lua
-2024/01/09 | 10844 | fonts/junicodevf/doc/OnTheWeb.tex
-2024/01/09 | 1083 | macros/latex/contrib/href-ul/LICENSE.txt
-2024/01/09 | 10782 | macros/latex/contrib/l3build/l3build-manifest-setup.lua
-2024/01/09 | 1021 | macros/latex/contrib/l3build/README.md
-2024/01/09 | 101784 | systems/texlive/tlnet/archive/iran-bibtex.doc.r69347.tar.xz
-2024/01/09 | 100224 | systems/texlive/tlnet/archive/minim-math.doc.r69352.tar.xz
diff --git a/biblio/bibtex/utils/bibcop/bibcop.1 b/biblio/bibtex/utils/bibcop/bibcop.1
index 744ca010c2..b4752f9544 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.1
+++ b/biblio/bibtex/utils/bibcop/bibcop.1
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2024-01-12"
+.TH bibcop 1 "2024-01-16"
.SH NAME
bibcop \- Style Checker and Fixer of BibTeX Files (.bib)
.SH SYNOPSIS
diff --git a/biblio/bibtex/utils/bibcop/bibcop.dtx b/biblio/bibtex/utils/bibcop/bibcop.dtx
index 191279353d..b4bc9b9cf9 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.dtx
+++ b/biblio/bibtex/utils/bibcop/bibcop.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{bibcop}
%<*package>
-[2024-01-12 0.0.17 Style Checker of Bibliography Files]
+[2024-01-16 0.0.18 Style Checker of Bibliography Files]
%</package>
%<*driver>
\documentclass{ltxdoc}
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pdf b/biblio/bibtex/utils/bibcop/bibcop.pdf
index 1ea78dc701..bf900181a5 100644
--- a/biblio/bibtex/utils/bibcop/bibcop.pdf
+++ b/biblio/bibtex/utils/bibcop/bibcop.pdf
Binary files differ
diff --git a/biblio/bibtex/utils/bibcop/bibcop.pl b/biblio/bibtex/utils/bibcop/bibcop.pl
index 2b44f2d571..f1e5121ffc 100755
--- a/biblio/bibtex/utils/bibcop/bibcop.pl
+++ b/biblio/bibtex/utils/bibcop/bibcop.pl
@@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-# 2024-01-12 0.0.17
+# 2024-01-16 0.0.18
package bibcop;
use warnings;
@@ -894,7 +894,7 @@ sub fail {
}
if (not basename($0) eq 'bibcop.pl') {
- return 1;
+ goto END;
}
if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
@@ -917,7 +917,7 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
" --latex Report errors in LaTeX format using \\PackageWarningNoLine command\n\n" .
"If any issues, report to GitHub: https://github.com/yegor256/bibcop");
} elsif (exists $args{'--version'} or exists $args{'-v'}) {
- info('0.0.17 2024-01-12');
+ info('0.0.18 2024-01-16');
} else {
my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
if (not $file) {
@@ -957,5 +957,7 @@ if (@ARGV+0 eq 0 or exists $args{'--help'} or exists $args{'-?'}) {
}
}
+END:
+
# In order to finish it with success:
1;
diff --git a/biblio/ctan-bibdata/ctan.bib b/biblio/ctan-bibdata/ctan.bib
index d449ea7da6..95cf96b878 100644
--- a/biblio/ctan-bibdata/ctan.bib
+++ b/biblio/ctan-bibdata/ctan.bib
@@ -1,7 +1,7 @@
%% bib file of all CTAN packages
%% (C) Herbert Voß
%%
-%% created at 15-01-2024, 02:00:03
+%% created at 16-01-2024, 02:00:03
%%
%% This file is provided under the terms of the LPPL v1.3 or
@@ -1627,7 +1627,7 @@
title = {The \texttt{alltt} package},
subtitle = {Everything in tt font, but obey commands and line endings},
author = {Leslie Lamport and Johannes L. Braams and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.0g},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -1897,13 +1897,13 @@
title = {The \texttt{amnestyreport} package},
subtitle = {A \LaTeX{} class for Amnesty International},
author = {Boris Veytsman},
- date = {2024-01-08},
- version = {1.1},
+ date = {2024-01-15},
+ version = {1.2},
license = {lppl1.3},
mirror = {https://mirror.ctan.org/macros/latex/contrib/amnestyreport},
url = {https://ctan.org/pkg/amnestyreport},
annotation = {This package provides a class for Amnesty International reports
- according to guidelines at
+ according to guidelines at
.},
}
@@ -3377,7 +3377,7 @@
title = {The \texttt{article} package},
subtitle = {Default class for composing an article},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.4n},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -9251,7 +9251,7 @@
subtitle = {Draw Bode, Nyquist and Nichols plots with gnuplot or pgfplots},
author = {Rushikesh Kamalapurkar},
date = {2021-09-11},
- version = {1.1.5},
+ version = {1.1.6},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/graphics/pgf/contrib/bodeplot},
url = {https://ctan.org/pkg/bodeplot},
@@ -9382,7 +9382,7 @@
title = {The \texttt{book} package},
subtitle = {A class for typesetting books},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.4n},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -12953,7 +12953,7 @@
title = {The \texttt{classes} package},
subtitle = {The source of \LaTeX{}’s standard classes},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.4n},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -13554,7 +13554,7 @@
title = {The \texttt{cmextra-latex} package},
subtitle = {Install macros for “standard” fonts not used by \LaTeX{} itself},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base/cmextra.ins},
url = {https://ctan.org/pkg/cmextra-latex},
@@ -19067,7 +19067,7 @@
title = {The \texttt{doc} package},
subtitle = {Format \LaTeX{} documentation},
author = {Frank Mittelbach and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {3.0m},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -19164,7 +19164,7 @@
title = {The \texttt{docstrip} package},
subtitle = {Remove comments from file},
author = {Frank Mittelbach and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.6b},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -24301,7 +24301,7 @@
title = {The \texttt{exscale} package},
subtitle = {Implements scaling of the 'cmex' fonts},
author = {Frank Mittelbach and Rainer Schöpf and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.1i},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -25891,7 +25891,7 @@
title = {The \texttt{fix-cm} package},
subtitle = {Permit Computer Modern fonts at arbitrary sizes},
author = {Walter A. Schmidt and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.1t},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -25985,7 +25985,7 @@
title = {The \texttt{fixltx2e} package},
subtitle = {Patches for \LaTeX{}},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.1a},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -30230,7 +30230,7 @@
title = {The \texttt{graphpap} package},
subtitle = {For producing graph paper},
author = {Leslie Lamport and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.0c},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -33699,7 +33699,7 @@
title = {The \texttt{ifthen} package},
subtitle = {Conditional commands in \LaTeX{} documents},
author = {Leslie Lamport and David Carlisle and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.1d},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -37724,8 +37724,8 @@
title = {The \texttt{latex-base} package},
subtitle = {Base sources of \LaTeX{}},
author = {{The LaTeX Project Team} and Frank Mittelbach},
- date = {2023-11-01},
- version = {},
+ date = {2024-01-15},
+ version = {2023-11-01 PL1},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
url = {https://ctan.org/pkg/latex-base},
@@ -37836,8 +37836,8 @@
title = {The \texttt{latex-doc} package},
subtitle = {Documentation supplied as part of the \LaTeX{} distribution},
author = {{The LaTeX Project Team}},
- date = {2023-06-19},
- version = {2023-06-01 PL1},
+ date = {2024-01-15},
+ version = {2023-11-01 PL1},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
url = {https://ctan.org/pkg/latex-doc},
@@ -38239,8 +38239,8 @@
title = {The \texttt{latex} package},
subtitle = {A \TeX{} macro package that defines \LaTeX{}},
author = {{The LaTeX Project Team} and Leslie Lamport},
- date = {2023-06-19},
- version = {2023-06-01 PL1},
+ date = {2024-01-15},
+ version = {2023-11-01 PL1},
license = {lppl1.3c},
url = {https://ctan.org/pkg/latex},
}
@@ -38744,7 +38744,7 @@
title = {The \texttt{latexrelease} package},
subtitle = {LaTeX release emulation},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.0p},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -39664,8 +39664,8 @@
title = {The \texttt{LibertinusT1Math} package},
subtitle = {A Type 1 font and \LaTeX{} support for Libertinus Math},
author = {Michael Sharpe},
- date = {2023-12-08},
- version = {2.0.3},
+ date = {2024-01-15},
+ version = {2.0.4},
license = {ofl,lppl},
mirror = {https://mirror.ctan.org/fonts/libertinust1math},
url = {https://ctan.org/pkg/libertinust1math},
@@ -44570,17 +44570,18 @@
@manual{ctan-medmath,
title = {The \texttt{medmath} package},
- subtitle = {Fix mediummath option in nccmath package},
+ subtitle = {Better medium-size math commands},
author = {Jianrui Lyu},
- date = {2024-01-11},
- version = {2024B},
+ date = {2024-01-15},
+ version = {2024D},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/contrib/medmath},
url = {https://ctan.org/pkg/medmath},
- annotation = {This package fixes and improves the mediummath option
- in the package.
- This concerns sizes of operators and infinite loops
- caused by definite integrals.},
+ annotation = {This package started as a fork of the mediummath code
+ of the package,
+ aiming to provide more stable and flexible medium-size
+ math commands. This concerns sizes of operators and
+ infinite loops caused by definite integrals.},
}
@manual{ctan-medstarbeamer,
@@ -45930,7 +45931,7 @@
title = {The \texttt{minimal} package},
subtitle = {A trivial class, for use when testing},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -48793,8 +48794,8 @@
title = {The \texttt{newtxtt} package},
subtitle = {Enhancement of typewriter fonts from newtx},
author = {Michael Sharpe},
- date = {2020-02-16},
- version = {1.056},
+ date = {2024-01-15},
+ version = {1.057},
license = {gpl3,lppl},
mirror = {https://mirror.ctan.org/fonts/newtxtt},
url = {https://ctan.org/pkg/newtxtt},
@@ -48878,7 +48879,7 @@
title = {The \texttt{nfssfont} package},
subtitle = {Typesetting font tables using \LaTeX{}’s NFSS notation},
author = {Frank Mittelbach and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.2e},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -53830,8 +53831,8 @@
title = {The \texttt{piton} package},
subtitle = {Typeset Python listings with LPEG},
author = {François Pantigny},
- date = {2024-01-06},
- version = {2.3},
+ date = {2024-01-15},
+ version = {2.4},
license = {lppl1.3},
mirror = {https://mirror.ctan.org/macros/luatex/latex/piton},
url = {https://ctan.org/pkg/piton},
@@ -55324,7 +55325,7 @@
title = {The \texttt{proc} package},
subtitle = {Class for producing “proceedings”},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.3m},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -59496,7 +59497,7 @@
title = {The \texttt{report} package},
subtitle = {Typeset a multi-chapter report},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {1.4n},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -62901,7 +62902,7 @@
title = {The \texttt{shortvrb} package},
subtitle = {Abbreviated verbatim commands},
author = {{The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {3.0m},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -63776,7 +63777,7 @@
title = {The \texttt{slides} package},
subtitle = {Class for creating slides},
author = {Frank Mittelbach and Rainer Schöpf and {The LaTeX Project Team}},
- date = {2023-06-09},
+ date = {2024-01-15},
version = {2.4b},
license = {lppl1.3c},
mirror = {https://mirror.ctan.org/macros/latex/base},
@@ -68888,20 +68889,21 @@
title = {The \texttt{texlogsieve} package},
subtitle = {Filter and summarize \LaTeX{} log files},
author = {Nelson Lago},
- date = {2023-12-07},
- version = {1.4.0},
+ date = {2024-01-15},
+ version = {1.4.1},
license = {gpl3+},
mirror = {https://mirror.ctan.org/support/texlogsieve},
url = {https://ctan.org/pkg/texlogsieve},
- annotation = {reads a \LaTeX{} log file (or the standard input
- if no file is specified), filters out less relevant messages,
- and displays a summary report.
- It is a script, similar in spirit to tools such as
- ,
- ,
+ annotation = {texlogsieve reads a \LaTeX{} log file (or the standard input if
+ no file is specified), filters out less relevant messages, and
+ displays a summary report. It is a texlua script, similar in
+ spirit to tools such as ,
+ ,
+ ,
+ ,
,
,
- , and others. Highlights:},
+ and others. Highlights:},
}
@manual{ctan-texmacs,
diff --git a/graphics/pgf/contrib/zx-calculus/README.md b/graphics/pgf/contrib/zx-calculus/README.md
index de8a2d5819..55d714bed6 100644
--- a/graphics/pgf/contrib/zx-calculus/README.md
+++ b/graphics/pgf/contrib/zx-calculus/README.md
@@ -2,6 +2,6 @@
This library (based on the great TikZ and Tikz-cd packages) allows you to typeset ZX-calculus directly in LaTeX. It comes with a default (but highly customizable) style. For more information, see the documentation in [`zx-calculus.pdf`][1].
-The project is hosted at https://github.com/leo-colisson/zx-calculus , feel free to report any bug there. It is licensed under MIT and its author is Léo Colisson.
+The project, created by Léo Colisson, is hosted at https://github.com/leo-colisson/zx-calculus . Feel free to report any bug there. It is licensed under MIT.
[1]: https://raw.githubusercontent.com/leo-colisson/zx-calculus/main/doc/zx-calculus.pdf
diff --git a/graphics/pgf/contrib/zx-calculus/biblio.bib b/graphics/pgf/contrib/zx-calculus/biblio.bib
new file mode 100644
index 0000000000..dec2f682e1
--- /dev/null
+++ b/graphics/pgf/contrib/zx-calculus/biblio.bib
@@ -0,0 +1,48 @@
+@book{CK17_PicturingQuantumProcesses,
+ title = {Picturing {{Quantum Processes}}: {{A First Course}} in {{Quantum Theory}} and {{Diagrammatic Reasoning}}},
+ shorttitle = {Picturing {{Quantum Processes}}},
+ author = {Coecke, Bob and Kissinger, Aleks},
+ date = {2017},
+ publisher = {{Cambridge University Press}},
+ location = {{Cambridge}},
+ doi = {10.1017/9781316219317},
+ url = {https://www.cambridge.org/core/books/picturing-quantum-processes/1119568B3101F3A685BE832FEEC53E52},
+ urldate = {2021-11-17},
+ abstract = {The unique features of the quantum world are explained in this book through the language of diagrams, setting out an innovative visual method for presenting complex theories. Requiring only basic mathematical literacy, this book employs a unique formalism that builds an intuitive understanding of quantum features while eliminating the need for complex calculations. This entirely diagrammatic presentation of quantum theory represents the culmination of ten years of research, uniting classical techniques in linear algebra and Hilbert spaces with cutting-edge developments in quantum computation and foundations. Written in an entertaining and user-friendly style and including more than one hundred exercises, this book is an ideal first course in quantum theory, foundations, and computation for students from undergraduate to PhD level, as well as an opportunity for researchers from a broad range of fields, from physics to biology, linguistics, and cognitive science, to discover a new set of tools for studying processes and interaction.},
+ isbn = {978-1-107-10422-8},
+ file = {/home/leo/Zotero/storage/ACRTPLF2/Bob Coecke, Aleks Kissinger - Picturing Quantum Processes_ A First Course in Quantum Theory and Diagrammatic Reasoning (2017, Cambridge Uni.djvu;/home/leo/Zotero/storage/H4JRJABV/Kissinger_Coecke.pdf;/home/leo/Zotero/storage/MX3QRG3Z/1119568B3101F3A685BE832FEEC53E52.html}
+}
+
+@unpublished{CHP19_SZXcalculusScalableGraphical,
+ title = {{{SZX-calculus}}: {{Scalable Graphical Quantum Reasoning}}},
+ shorttitle = {{{SZX-calculus}}},
+ author = {Carette, Titouan and Horsman, Dominic and Perdrix, Simon},
+ date = {2019},
+ eprint = {1905.00041},
+ eprinttype = {arxiv},
+ primaryclass = {quant-ph},
+ pages = {15 pages},
+ doi = {10.4230/LIPIcs.MFCS.2019.55},
+ url = {http://arxiv.org/abs/1905.00041},
+ urldate = {2022-09-08},
+ abstract = {We introduce the Scalable ZX-calculus (SZX-calculus for short), a formal and compact graphical language for the design and verification of quantum computations. The SZX-calculus is an extension of the ZX-calculus, a powerful framework that captures graphically the fundamental properties of quantum mechanics through its complete set of rewrite rules. The ZX-calculus is, however, a low level language, with each wire representing a single qubit. This limits its ability to handle large and elaborate quantum evolutions. We extend the ZX-calculus to registers of qubits and allow compact representation of sub-diagrams via binary matrices. We show soundness and completeness of the SZX-calculus and provide two examples of applications, for graph states and error correcting codes.},
+ archiveprefix = {arXiv},
+ keywords = {Quantum Physics},
+ file = {/home/leo/Zotero/storage/F4PPGLC6/Carette et al. - 2019 - SZX-calculus Scalable Graphical Quantum Reasoning.pdf;/home/leo/Zotero/storage/MUPUEFDZ/1905.html}
+}
+
+@unpublished{van20_ZXcalculusWorkingQuantum,
+ title = {{{ZX-calculus}} for the Working Quantum Computer Scientist},
+ author = {van de Wetering, John},
+ options = {useprefix=true},
+ date = {2020-12-27},
+ eprint = {2012.13966},
+ eprinttype = {arxiv},
+ primaryclass = {quant-ph},
+ url = {http://arxiv.org/abs/2012.13966},
+ urldate = {2021-05-29},
+ abstract = {The ZX-calculus is a graphical language for reasoning about quantum computation that has recently seen an increased usage in a variety of areas such as quantum circuit optimisation, surface codes and lattice surgery, measurement-based quantum computation, and quantum foundations. The first half of this review gives a gentle introduction to the ZX-calculus suitable for those familiar with the basics of quantum computing. The aim here is to make the reader comfortable enough with the ZX-calculus that they could use it in their daily work for small computations on quantum circuits and states. The latter sections give a condensed overview of the literature on the ZX-calculus. We discuss Clifford computation and graphically prove the Gottesman-Knill theorem, we discuss a recently introduced extension of the ZX-calculus that allows for convenient reasoning about Toffoli gates, and we discuss the recent completeness theorems for the ZX-calculus that show that, in principle, all reasoning about quantum computation can be done using ZX-diagrams. Additionally, we discuss the categorical and algebraic origins of the ZX-calculus and we discuss several extensions of the language which can represent mixed states, measurement, classical control and higher-dimensional qudits.},
+ archiveprefix = {arXiv},
+ keywords = {Not published,Quantum Physics,Reviews,ZX-Calculus},
+ file = {/home/leo/Zotero/storage/ZY35RJC6/van de Wetering - 2020 - ZX-calculus for the working quantum computer scien.pdf;/home/leo/Zotero/storage/LFUZAV6Q/2012.html}
+}
diff --git a/graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex b/graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
index af29676b46..c23955e6cf 100644
--- a/graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
+++ b/graphics/pgf/contrib/zx-calculus/tikzlibraryzx-calculus.code.tex
@@ -1,26 +1,43 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Version: 2021/10/22
+%%% Version: 2.0
%%% License: MIT
%%% Author: Léo Colisson
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Understand why if a "fake" alias does not exists but was created before I get no error
+
+%% TODO:
+%% - Check why this displays weirdly:
+% \begin{ZX}[myBold]
+% & & \zxDivider[a=div]{} \ar['>, to=Gll] \ar['>, to=Gll2] & & & \\
+% & \zxH{} \ar[to=div,<',wce] \ar[to=root,<.] & & \zxMatrix[a=Gll]'*{G^\matrixUr} & \zxMatrix[a=Gll2]'/*{G^\matrixUr} & \\
+% \zxN{} \ar[rr] & & [\zxwCol] \zxZ[a=root]{} \ar[B,rrr] \ar[to=Gll,.>] \ar[to=Gll2,.>] & & &
+% \end{ZX}
+%
% A tikzlibrary[libraryName].code.tex is loaded automatically by tikz when using
% \usetikzlibrary{libraryName}. Therefore, you should just use
% \usetikzlibrary{zx} to load this library. We also provide a package to
% directly load this library using \usepackage{zx}.
+%%% Some random notes for myself:
+%%% - \tikz@pp@name{X} outputs the name prefix + X + the name suffix, where these prefix are local prefix assigned to all node names. While they are often empty, it might not be always the case.
+
\RequirePackage{amssymb} % For short minus
-\RequirePackage{etoolbox}
+\RequirePackage{etoolbox} % \AfterEndPreamble...
\RequirePackage{ifthen} % For conditions
\RequirePackage{xparse} % For NewDocumentComments
\RequirePackage{bm} % For bold math fonts
+\RequirePackage{xstring} % For \IfInteger
+\RequirePackage{varwidth} % For varwidth
-\usetikzlibrary{cd,backgrounds,positioning,shapes,calc,intersections}
+\usetikzlibrary{cd,backgrounds,positioning,shapes,calc,intersections,fit,decorations.pathreplacing}
% Declare layers.
\pgfdeclarelayer{background} % Fox boxes using "fit" to group parts of the graph.
-\pgfdeclarelayer{edgelayer} % For edges that are explicitely defined "wc"
-\pgfdeclarelayer{nodelayer} % For nodes... in theory, this fails for now. https://tex.stackexchange.com/questions/618823/node-on-layer-style-in-tikz-matrix-tikzcd
+\pgfdeclarelayer{belownodelayer} % For nodes that always want to stay below any arrow...
+\pgfdeclarelayer{edgelayer} % For nodes that always want to stay below any arrow...
+\pgfdeclarelayer{nodelayer} % For nodes... in theory, this fails for now.
\pgfdeclarelayer{main}
+\pgfdeclarelayer{abovenodelayer} % For nodes that want to stay above others.
\pgfdeclarelayer{box} % For boxes using "fit" to fake multi-column boxes
\pgfdeclarelayer{labellayer} % For labels... in theory, this fails for now. https://tex.stackexchange.com/questions/618823/node-on-layer-style-in-tikz-matrix-tikzcd
\pgfdeclarelayer{foreground} % For the user, if they want to put anything really above everything.
@@ -33,6 +50,7 @@
\definecolor{colorZxZ}{RGB}{204,255,204}
\definecolor{colorZxX}{RGB}{255,136,136}
\definecolor{colorZxH}{RGB}{255,255,0}
+\definecolor{colorZxMatrix}{RGB}{200,200,200}
%%% Some wires (the one having an intermediate H, X, or S gate) may need some additional space for
%%% specific columns.
@@ -66,9 +84,12 @@
%% Default separation between rows and columns
\newcommand{\zxDefaultColumnSep}{1.5mm}
\newcommand{\zxDefaultRowSep}{1.5mm}
+% In circuit mode, we have mostly gates, and the default setting might be too small
+\newcommand{\zxDefaultColumnSepCircuit}{4mm}
+\newcommand{\zxDefaultRowSepCircuit}{4mm}
% To cancel the default tow separation
-\newcommand{\zxZeroCol}{-\zxDefaultColumnSep}
-\newcommand{\zxZeroRow}{-\zxDefaultRowSep}
+\newcommand{\zxZeroCol}{-\pgfmatrixcolumnsep}%\zxDefaultColumnSep}
+\newcommand{\zxZeroRow}{-\pgfmatrixrowsep}%\zxDefaultRowSep}
%% When adding two lines with only empty nodes, it can create quite a large space. Use this to reduce it
%% Yes, we can add multiple arguments, space will add up (see documentation pgfmatrixnextcell)
\newcommand{\zxNCol}{-\zxDefaultColumnSep,.5mm}
@@ -92,6 +113,9 @@
\def\zxDefaultSoftAngleO{40}
\def\zxDefaultSoftAngleChevron{60}
+\def\zxGroundScale{1.8}
+\def\zxMeterScale{1}
+
% Styles for O,N,... (new bezier version)
\tikzset{
/zx/args/-andL/.cd,
@@ -126,6 +150,15 @@
% Scale to use when scaling 3 dots
\def\zxScaleDots{.7}
+% Size of the minimum width of boxes
+% We need 4ex to fit most elements in height, at least with the default font (f_a is the heigher), and 1.83em to fit them in width (W is the wider).
+% Since these two values are quite close, lets take the maximum (1.83em) to have a square shape
+\def\zxBoxMinimumWidth{1.83em}
+\def\zxBoxMinimumHeight{1.83em}
+\def\zxEltMinimumWidth{1.83em}
+\def\zxEltMinimumHeight{1.83em}
+
+
% 0.4pt is default in tikz. Also used to ensure it has not been modified document wise by other libraries
% (quantikz notably changes this parameter).
\newcommand{\zxDefaultLineWidth}{0.4pt}
@@ -168,12 +201,43 @@
% center does not exists), but then the wire will be hidden behind the node (it is a problem
% mostly if you use H nodes a lot, otherwise we recommend this solution):
\def\zxWireInsideIfNoIntersectionName{}
-% If you prefer to start the wire on the surface of the node, do that instead...
-% but be aware that the shape of the wire will be changed a lot, since we can't use anymore the
-% fake anchors... You could also define a style that does that.
+% If you prefer to start the wire on the surface of the node, do that instead... but it will take longer to compute. See also our ui style
+% as the default styles are not meant to work in that setting.
% \let\zxWireInsideIfNoIntersectionName\undefined
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Global temporary variables/dimensions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newsavebox{\zx@tmp@box}%
+
+%%%%%%%%%%%%%%%%%%%%%
+%%%% Utils
+%%%%%%%%%%%%%%%%%%%%%
+
+% by default "execute at end node" accumulate by adding at the end of the existing value,
+% it can be helpful to reset completely the value, or add it before
+\tikzset{
+ zx execute before end node/.code={%
+ \def\zx@options{#1}%
+ \edef\zx@cmd{%
+ \noexpand\def\noexpand\tikz@atend@node{\expandonce{\zx@options}\expandonce{\tikz@atend@node}}%
+ }%
+ \zx@cmd%
+ },
+ zx set execute at begin node/.code={%
+ \def\tikz@atbegin@node{#1}%
+ },
+ zx set execute at end node/.code={%
+ \def\tikz@atend@node{#1}%
+ },
+ zx reset execute node/.style={
+ zx set execute at begin node={},
+ zx set execute at end node={},
+ },
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Adding anchors
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -257,6 +321,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% For readability
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\NewExpandableDocumentCommand{\zxWire}{m}{
+ \arrow[r,#1]
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Tikz styles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -421,12 +493,10 @@
%%% First intersection: we use the line between the two nodes... but it's really ugly (e.g. in o it does not make a lot of sense)
\begin{pgfinterruptboundingbox}%
\ifdefined\zxIntersectionLineBetweenStartEnd%
- %% Not idea why, but x axis is inverted???
- \pgfpointdiff{\tikz@scan@one@point\pgf@process(#2)}{\pgfpointanchor{#1}{center}}%
- \pgfpathmoveto{\pgfpoint{-\pgf@x}{\pgf@y}}%
- % And now both axis are???
- \pgfpointdiff{\tikz@scan@one@point\pgf@process(#3)}{\pgfpointanchor{#1}{center}}%
- \pgfpathlineto{\pgfpoint{-\pgf@x}{-\pgf@y}}%
+ \pgfpointdiff{\pgfpointanchor{#1}{center}}{\tikz@scan@one@point\pgf@process(#2)}%
+ \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@y}}%
+ \pgfpointdiff{\pgfpointanchor{#1}{center}}{\tikz@scan@one@point\pgf@process(#3)}%
+ \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@y}}%
\else%
%% We use now the method used for bezier curve (at least it's what I see "experimentally")
%% More precisely, we use the direction of the bezier curve to know where to start the wire.
@@ -546,6 +616,12 @@
\fi%
}%
+\def\zxRevertToNormalSpacing{%
+ \thinmuskip=3.0mu\relax%
+ \medmuskip=4.0mu plus 2.0mu minus 4.0mu\relax%
+ \thickmuskip=5.0mu plus 5.0mu\relax%
+}
+
% Styles. User should not modify "wires definition", but is free to change:
% - "/zx/default style nodes/" to change completely the node style
% - "/zx/user overlay nodes" to add stuff on current node style
@@ -559,12 +635,58 @@
draw,
-,
line width=\zxDefaultLineWidth,
+ % This changes globally the thickness of boxes and wires, empty by default,
+ % mostly useful to change gates and wires at the same time
+ zx thickness wires style,
%%% Useful shortcut (shorter lines means easy "align" of & symbols. Love M-x align in emacs btw.)
ls/.style={looseness=##1},
looseness wires only/.style={% Looseness used for wires only.
looseness=1.2,
},
lw/.style={looseness wires only},
+ bold/.style={very thick},
+ non bold/.style={
+ line width=\zxDefaultLineWidth,
+ % We need to disable bold later since "bold wires" will automatically add bold at the end
+ bold/.style={},
+ },
+ B/.style={bold},
+ NB/.style={non bold},
+ %% Adds a n above to denote the number of wires
+ Bn/.style={BnArgs={##1}{}},
+ Bn/.default={n},
+ boldn/.style={BnArgs={##1}{}},
+ boldn/.default={n},
+ Bn'/.style={Bn'Args={##1}{}},
+ Bn'/.default={n},
+ boldn'/.style={Bn'Args={##1}{}},
+ boldn'/.default={n},
+ Bn./.style={Bn.Args={##1}{}},
+ Bn./.default={n},
+ boldn./.style={Bn.Args={##1}{}},
+ boldn./.default={n},
+ Bn-/.style={Bn-Args={##1}{}},
+ Bn-/.default={n},
+ boldn-/.style={Bn-Args={##1}{}},
+ boldn-/.default={n},
+ %% For wires left to right
+ Bn'Args/.style 2 args={bold, "|" {rotate=65-90,anchor=center,##2}, "##1" {above,yshift=3pt,##2}},
+ Bn'Args/.default={n}{},
+ Bn.Args/.style 2 args={bold, "|" {rotate=65-90,anchor=center,##2}, "##1" {below,yshift=-3pt,##2}},
+ Bn.Args/.default={n}{},
+ %% for wires top/down (left,right)
+ BnArgs/.style 2 args={bold, "|" {rotate=-65,anchor=center,##2}, "##1" {left,xshift=-2pt,##2}},
+ BnArgs/.default={n}{},
+ Bn-Args/.style 2 args={bold, "|" {rotate=-65,anchor=center,##2}, "##1" {right,xshift=2pt,##2}},
+ Bn-Args/.default={n}{},
+ type'/.style={Bn'={##1}, non bold},
+ type./.style={Bn.={##1}, non bold},
+ type/.style={Bn={##1}, non bold},
+ type-/.style={Bn-={##1}, non bold},
+ % boldnPos/.style={bold, "/" {anchor=center}, "##1" {yshift=3pt}},
+ % boldnPos/.default={n}{pos=50},
+ % boldn.Pos/.style={bold, "/" {anchor=center}, "##1" {below,yshift=-3pt}},
+ % boldn.Pos/.default={n}{pos=50},
% Use this when you are drawing lines between none nodes only (like swap gates...) in IO mode
between none/.style={
looseness wires only,
@@ -633,18 +755,34 @@
C@generic/.style n args={8}{ % min/max, angle1, angle2, anchor, \x or \y, \y or \x, where to move,radius code (for circle should be "radius=\n3")
to path={
\pgfextra{%% <- we will use def... so need to "exit" a few seconds pgf
+ \zxTryFirstSubnodeThenAnchorThenNode{\tikztostart}{true ##4}{##4}%
+ \edef\StartPoint{\zx@result}%
+ % % Test if tikztostart is a point or a node, and define StartPoint accordingly.
+ % \ifPgfpointOrNode{\tikztostart}{%
+ % \def\StartPoint{\tikztostart}%
+ % }{%
+ % % For some nodes, "north" might not point to north (notably after a rotation). So we can define some anchors "true north" that actually point
+ % % to the north.
+ % % Test if "true north" etc exists:
+ % \ifAnchorExistsNodeSpecific{\tikztostart}{true ##4}{%
+ % \def\StartPoint{\tikztostart.true ##4}%
+ % }{%
+ % \def\StartPoint{\tikztostart.##4}%
+ % }%
+ % }%
% Test if tikztostart is a point or a node, and define StartPoint accordingly.
- \ifPgfpointOrNode{\tikztostart}{%
- \def\StartPoint{\tikztostart}%
- }{%
- \def\StartPoint{\tikztostart.##4}%
- }%
- % Test if tikztostart is a point or a node, and define StartPoint accordingly.
- \ifPgfpointOrNode{\tikztotarget}{%
- \def\TargetPoint{\tikztotarget}%
- }{%
- \def\TargetPoint{\tikztotarget.##4}%
- }%
+ \zxTryFirstSubnodeThenAnchorThenNode{\tikztotarget}{true ##4}{##4}%
+ \edef\TargetPoint{\zx@result}%
+ % \ifPgfpointOrNode{\tikztotarget}{%
+ % \def\TargetPoint{\tikztotarget}%
+ % }{%
+ % % Test if "true north" etc exists:
+ % \ifAnchorExistsNodeSpecific{\tikztotarget}{true ##4}{%
+ % \def\TargetPoint{\tikztotarget.true ##4}%
+ % }{%
+ % \def\TargetPoint{\tikztotarget.##4}%
+ % }%
+ % }%
}%
(\StartPoint) % <- the path starts at StartPoint
%%% Get x coordinate of left-most point
@@ -676,7 +814,7 @@
\pgfmathapproxequalto{##52}{\n1}%
}%
\ifpgfmathcomparison\else -- (\TargetPoint)\fi
- \tikztonodes% All to path finishes with that to deal with futur nodes I think
+ \tikztonodes% All to path finishes with that to deal with future nodes I think
}
},
% At the first version, styles were defined using in=... out=... looseness=... However
@@ -684,10 +822,6 @@
% too close or too far appart. However, it may still be useful, so now we define the old
% styles, that you can use them using \ar[r,IO,C].
% NB: for the newest styles, we add new anchors to the nodes depending on the direction.
- % I also wanted to add more complicated ways to configqure the starting point (i.e. start at the boundary
- % and not behind the node), but seems like it's hard (impossible?) to do with matrices...
- % The reason is that the intersection library seems to fail with matrices.
- % If you know how to solve that, you can help here: https://tex.stackexchange.com/questions/619274
C/.style={C@generic={min}{90}{180+90}{west}{\x}{\y}{(\n1,\y1)}{y radius=\n3, x radius=##1*\n3}},
C/.default=1,
% Like C, but rotated
@@ -866,30 +1000,49 @@
bezier 4 y={\pgfkeysvalueof{/zx/args/-andL/1-}}{\pgfkeysvalueof{/zx/args/-andL/1L}}{\pgfkeysvalueof{/zx/args/-andL/2-}}{\pgfkeysvalueof{/zx/args/-andL/2L}}
}%
},
+ %% /zx/utils/change@tikz@fake@center={\tikztostart}{fake center west}{\myoutput} will set \myoutput to be the coordinate of the fake center
+ %% if it exists, and of center otherwise (and if tikztostart is already a coordinate, we just set myoutput to this coordinate):
% Directions: configure start/end points to "fake center *" if it exists.
% If the input is not a node, it's copied to ##3
/zx/utils/change@tikz@fake@center/.code n args={3}{%
% ##1: \tikztostart or \tikztotarget,
% ##2: fake center north...
% ##3 name of result. e.g. \tikztostart
- \ifPgfpointOrNode{##1}{%
- %%% Sometimes, ##1 is not 1pt,2pt but "tikz-1-2.north east". Since later we use
- %%% a parsing mechanism which assumes that we have a coordinate... this is a problem.
- \edef##3{##1}%
- % This is a great explaination of how parsing is done in tikz:
- % https://tex.stackexchange.com/a/516897/116348
- }{% This is a node, not a point:
- \ifAnchorExists{##1}{##2}{%
- \pgfpointanchor{##1}{##2}%
- }{%
- \pgfpointanchor{##1}{center}%
- }%
- %%% Whoo, pgfpoint only redefine pgf@x/pgf@y, but in no way it stores it!!!
- %%% So can't do \pgfpoint{\pgf@x}{\pgf@y}...
- %%% I needed to create my own system... see \zx@parse@coordx.
- \edef##3{\the\pgf@x,\the\pgf@y}%
- }%
+ % This sets \zx@result to the appropriate node or to center if no exists:
+ \zxTryFirstSubnodeThenAnchorThenNodeToCoordinate{##1}{##2}{center}%
+ \edef##3{\zx@result}%
},
+ % /zx/utils/change@tikz@fake@center/.code n args={3}{%
+ % % ##1: \tikztostart or \tikztotarget,
+ % % ##2: fake center north...
+ % % ##3 name of result. e.g. \tikztostart
+ % \ifPgfpointOrNode{##1}{%
+ % %%% Sometimes, ##1 is not (1pt,2pt) but "tikz-1-2.north east". Since later we use
+ % %%% a parsing mechanism which assumes that we have a coordinate... this is a problem.
+ % \edef##3{##1}%
+ % % This is a great explaination of how parsing is done in tikz:
+ % % https://tex.stackexchange.com/a/516897/116348
+ % }{% This is a node, not a point:
+ % % "zx add anchor to node" might define per-node anchors, and they are stored in
+ % % a macro called like \pgf@sh@ma@tikz@f@3-2-2, so we need to read this first:
+ % % TODO: maybe use pp@name everywhere? (see comment beginning of this file)
+ % \begingroup% This group avoids pollution done by executing pgf@sh@ma@NODENAME
+ % \pgfutil@ifundefined{pgf@sh@ma@\tikz@pp@name{##1}}{}{%
+ % % We the per-node macro exists, we run it.
+ % \csname pgf@sh@ma@\tikz@pp@name{##1}\endcsname%
+ % }%
+ % \ifAnchorExists{##1}{##2}{%
+ % \pgfpointanchor{##1}{##2}%
+ % }{%
+ % \pgfpointanchor{##1}{center}%
+ % }%
+ % %%% Whoo, pgfpoint only redefine pgf@x/pgf@y, but in no way it stores it!!!
+ % %%% So can't do \pgfpoint{\pgf@x}{\pgf@y}...
+ % %%% I needed to create my own system... see \zx@parse@coordx.
+ % \xdef##3{\the\pgf@x,\the\pgf@y}%
+ % \endgroup%
+ % }%
+ % },
% Directions: configure start/end points to the intersection between
% the "fake center *" if it exists and the "fake center *" of the destination.
% If the input is not a node, nothing is done.
@@ -971,6 +1124,119 @@
start anchor=,
end anchor=,
},
+ % Classical wires: we make them bend
+ classical/.style={
+ double distance=1pt,
+ double,
+ line cap=rect,
+ % the .5pt is half of the double distance
+ shorten <=.5pt+.5\pgflinewidth,
+ shorten >=.5pt+.5\pgflinewidth,
+ % to path={},
+ },
+ cl/.style={classical},
+ connect -|/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart) -| (\tikztotarget) \tikztonodes}
+ },
+ --|/.style={connect -|},
+ connect |-/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart) |- (\tikztotarget) \tikztonodes}
+ },
+ |--/.style={connect |-},
+ horizontal |--/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart |- \tikztotarget) -- (\tikztotarget) \tikztonodes}
+ },
+ horizontal --|/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart) -- (\tikztostart -| \tikztotarget) \tikztonodes}
+ },
+ vertical |--/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart) -- (\tikztostart |- \tikztotarget) \tikztonodes}
+ },
+ vertical --|/.style={
+ on layer={edgelayer},
+ to path={(\tikztostart -| \tikztotarget) -- (\tikztotarget) \tikztonodes}
+ },
+ h|--/.style={horizontal |--},
+ h--|/.style={horizontal --|},
+ v|--/.style={vertical |--},
+ v--|/.style={vertical --|},
+ % fake a wire being above by putting white stuff around
+ 3d above/.style={
+ draw=white,
+ double=black,
+ double distance=\pgflinewidth,
+ very thick,
+ },
+ %% To go to a subnode defined in a pic with from subnode=mysubnode.
+ start subnode/.code={%
+ \zxGetSubnodeOfNode{\tikzcd@ar@start}{##1}{\edef\tikzcd@ar@start{\zx@result}}{\PackageError{zx-calculus}{In "start subnode=##1", \zx@error}}%
+ },
+ % start subnode/.code={%
+ % \edef\zx@tmp{zx@alias@\zxCurrentDiagram @\tikzcd@ar@start}%
+ % % First, rewrite \tikzcd@ar@start so that it equals the name of the current node without alias
+ % \ifcsname \zx@tmp\endcsname% There exists an alias
+ % \edef\zx@tmp@alias{(alias \zx@tmp) }% Mostly for the error message
+ % \edef\tikzcd@ar@start{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@start\endcsname}%
+ % \else%
+ % \edef\zx@tmp@alias{(no alias) }% Mostly for the error message
+ % \fi
+ % % First, we check if there is a node with this name on this node. If not, we will try with the parent node
+ % \@ifundefined{pgf@sh@ns@\tikzcd@ar@start ##1}{%
+ % % The current node has no such subnode name: let's start its parent.
+ % \@ifundefined{\tikzcd@ar@start -zxOriginalRow}{%
+ % % There is no original coordinate: error
+ % \PackageError{zx-calculus}{In "start subnode=##1", the subnode ##1 of node \tikzcd@ar@start \zx@tmp@alias does not exist.}{}%
+ % }{%
+ % % There is an original coordinate: we try to see if the original node admits a subnode.
+ % \edef\zx@tmp@originalRow{\csname \tikzcd@ar@start-zxOriginalRow\endcsname}%
+ % \edef\zx@tmp@originalCol{\csname \tikzcd@ar@start-zxOriginalCol\endcsname}%
+ % \@ifundefined{pgf@sh@ns@\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol ##1}{%
+ % \PackageError{zx-calculus}{In "start subnode=##1", the subnode ##1 of aliased node \tikzcd@ar@start{} \zx@tmp@alias does not exist (even in the parent node at coordinate \zx@tmp@originalRow - \zx@tmp@originalCol).}{}%
+ % }{%
+ % \edef\tikzcd@ar@start{\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol ##1}%%
+ % }%
+ % }%
+ % }{% There exists a subnode in the current name
+ % \edef\tikzcd@ar@start{\tikzcd@ar@start ##1}%%
+ % }%
+ % },
+ end subnode/.code={% The edef is needed, or it always go into the first loop and might give errors later
+ \zxGetSubnodeOfNode{\tikzcd@ar@target}{##1}{\edef\tikzcd@ar@target{\zx@result}}{\PackageError{zx-calculus}{In "end subnode=##1", \zx@error}}%
+ },
+ % end subnode/.code={% The edef is needed, or it always go into the first loop and might give errors later
+ % \edef\zx@tmp{zx@alias@\zxCurrentDiagram @\tikzcd@ar@target}%
+ % % First, rewrite \tikzcd@ar@target so that it equals the name of the current node without alias
+ % \ifcsname \zx@tmp\endcsname% There exists an alias
+ % \edef\zx@tmp@alias{(alias \zx@tmp) }% Mostly for the error message
+ % \edef\tikzcd@ar@target{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@target\endcsname}%
+ % \else%
+ % \edef\zx@tmp@alias{(no alias) }% Mostly for the error message
+ % \fi
+ % % First, we check if there is a node with this name on this node. If not, we will try with the parent node
+ % \@ifundefined{pgf@sh@ns@\tikzcd@ar@target ##1}{%
+ % % The current node has no such subnode name: let's start its parent.
+ % \@ifundefined{\tikzcd@ar@target -zxOriginalRow}{%
+ % % There is no original coordinate: error
+ % \PackageError{zx-calculus}{In "end subnode=##1", the subnode ##1 of node \tikzcd@ar@target{} \zx@tmp@alias does not exist.}{}%
+ % }{%
+ % % There is an original coordinate: we try to see if the original node admits a subnode.
+ % \edef\zx@tmp@originalRow{\csname \tikzcd@ar@target-zxOriginalRow\endcsname}%
+ % \edef\zx@tmp@originalCol{\csname \tikzcd@ar@target-zxOriginalCol\endcsname}%
+ % \@ifundefined{pgf@sh@ns@\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol ##1}{%
+ % \PackageError{zx-calculus}{In "end subnode=##1", the subnode ##1 of aliased node \tikzcd@ar@target{} \zx@tmp@alias does not exist (even in the parent node at coordinate \zx@tmp@originalRow - \zx@tmp@originalCol).}{}%
+ % }{%
+ % \edef\tikzcd@ar@target{\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol ##1}%%
+ % }%
+ % }%
+ % }{% There exists a subnode in the current name
+ % \edef\tikzcd@ar@target{\tikzcd@ar@target ##1}%%
+ % }%
+ % },
%% Forced versions are versions which do not nicely fallback to center if shape does not
%% have "fake center XXX". This is used mostly for wires based on in/out (our function b.
%% Not sure how to have a code which always fallback to center if shape does not.
@@ -1258,9 +1524,11 @@
N.-/.default=\zxDefaultSoftAngleN,
},
% No line but vdots/dots in between.
- 3 vdots/.style={draw=none, "\makebox[0pt][r]{##1}\scalebox{\zxScaleDots}{$\cvdotsCenterMathline$}" anchor=center},
+ 3 vdots/.style={draw=none, "\makebox[0pt][r]{\footnotesize\smash{##1\,}}\scalebox{\zxScaleDots}{$\cvdotsCenterMathline$}" {anchor=center,zxNormalFont}},
3 vdots/.default={},
- 3 dots/.style={draw=none, "\makebox[0pt][r]{##1}\scalebox{\zxScaleDots}{$\chdots$}" anchor=center},
+ 3 vdotsr/.style={draw=none, "\scalebox{\zxScaleDots}{$\cvdotsCenterMathline$}\makebox[0pt][l]{\footnotesize\smash{\,##1}}" {anchor=center,zxNormalFont}},
+ 3 vdotsr/.default={},
+ 3 dots/.style={draw=none, "\makebox[0pt][r]{\footnotesize\smash{##1}}\scalebox{\zxScaleDots}{$\chdots$}" {anchor=center,zxNormalFont}},
3 dots/.default={},
% Add a Hadmard/Z/X (no phase) in the middle of the line. Practical to add small nodes without creating
% a new column/row. However, make sure the corresponding row/column is larger, using &[\zxHCol]
@@ -1272,7 +1540,19 @@
Z/.default={},
X/.style={"" {zxNoPhaseSmallX,anchor=center,##1}},
X/.default={},
- % Arrow will go out from the center of the shape instead of from the border. Useful
+ % Sometimes, it might be handy to specify an anchor only if no anchor was set before, notably when using "post arrow style if end node" (see
+ % for instance the Divider).
+ end anchor if not set/.code={%
+ \ifx\tikzcd@endanchor\pgfutil@empty% If there is no anchor, we can set ours:
+ \pgfkeysalso{/tikz/commutative diagrams/end anchor={##1}}%
+ \fi%
+ },
+ start anchor if not set/.code={%
+ \ifx\tikzcd@startanchor\pgfutil@empty% If there is no anchor, we can set ours:
+ \pgfkeysalso{/tikz/commutative diagrams/start anchor=##1}%
+ \fi%
+ },
+ % Arrow will go out from the center of the shape instead of from the border. Useful e.g.
% when connecting nodes with different shapes, it will give back a symetric connection.
wire centered/.style={
on layer=edgelayer,
@@ -1295,14 +1575,90 @@
/tikz/commutative diagrams/end anchor=,
},
},
+ %% Will be loaded in tikzcd options directly.
+ /zx/styles/rounded style preload/.style={
+ content fixed baseline/.style={
+ /zx/user overlay nodes/.style={
+ zxShort/.append style={content fixed baseline},
+ % fixed baseline gives poor result in fractions, so we disable it here
+ zxSpecificFrac/.append style={content vertically centered},
+ },
+ },
+ content fixed baseline also frac/.style={
+ /zx/user overlay nodes/.style={
+ zxShort/.append style={content fixed baseline},
+ },
+ },
+ content vertically centered/.style={
+ /zx/user overlay nodes/.style={
+ zxShort/.append style={content vertically centered}
+ },
+ },
+ /zx/styles/rounded style common nodes and ZX,
+ },
+ % These styles make sense both in "ZX" options and in nodes options.
+ /zx/styles/rounded style common nodes and ZX/.style={
+ small minus/.code={
+ \def\zxMinus{\zxShortMinus}%
+ \def\zxMinusInShort{\zxShortMinus}%
+ },
+ big minus/.code={
+ \def\zxMinus{-}%
+ \def\zxMinusInShort{-}%
+ },
+ },
/zx/styles/rounded style/.style={
+ /zx/styles/rounded style common nodes and ZX,
%% Can be redefined by user
% Style for empty nodes
+ zxSpacingInsideNodes/.style={
+ execute at begin node={\thinmuskip=0mu\medmuskip=0mu\thickmuskip=0mu}, % Reduce space around +/-...
+ },
+ zxNormalSpacing/.style={
+ execute at begin node={\thinmuskip=3.0mu\medmuskip=4.0mu plus 2.0mu minus 4.0mu\thickmuskip=5.0mu plus 5.0mu}, %
+ },
+ %% Normalize fonts to avoid different rendering when document has a different font shape.
+ zxNormalFont/.style={
+ font={\fontsize{10}{12}\selectfont},
+ },
+ zxTinyFont/.style={
+ font={\fontsize{6}{6}\selectfont},
+ },
+ zxTinyFontAndSpacing/.style={
+ zxSpacingInsideNodes,
+ zxTinyFont,
+ },
+ % Practical styles to either vertically center the content, or fix the position of the baseline.
+ content fixed baseline/.style={
+ text height=1.5mm,%5.4pt,%1.5mm,%.45em,
+ text depth=0.1mm,%1.8pt,%0.1mm,%.15em,
+ },
+ % Style for empty nodes
+ content vertically centered/.style={
+ text height=,
+ text depth=,
+ },
+ bold/.style={very thick},
+ B/.style={bold},
+ non bold/.style={%
+ line width=\zxDefaultLineWidth,
+ },
+ NB/.style={non bold},
+ %% To set bold all wires connected to the current wire
+ bold wires/.style={
+ post arrow style if end node={B},
+ post arrow style if start node={B},
+ },
+ wires bold/.style={bold wires},% backward compatible
+ Bw/.style={wires bold},
+ BBw/.style={bold, wires bold,},
zxAllNodes/.style={
shape=rectangle, % Otherwise nodes are asymetrical rectangle, which is not practical in our case. Gives notably anchor "center" which is really centered compared to asymatrical rectangles
anchor=center, % Center cells
line width=\zxDefaultLineWidth,
- execute at begin node={\thinmuskip=0mu\medmuskip=0mu\thickmuskip=0mu}, % Reduce space around +/-...
+ % Normalize the font size (avoids different rendering of dots...)
+ zxSpacingInsideNodes,
+ zxNormalFont,
},
% Use this to denote an empty diagram
zxEmptyDiagram/.style={
@@ -1408,6 +1764,9 @@
stylePhaseInLabel,
fill=red!20!white
},
+ % Some styles should be applied only on frac
+ zxSpecificFrac/.style={
+ },
%%%%%%%%%%% Style defined depending on above ones. Feel free to redefine.
zxNoPhaseZ/.style={zxNoPhase,fill=colorZxZ},
zxNoPhaseX/.style={zxNoPhase,fill=colorZxX},
@@ -1523,23 +1882,23 @@
}%
}%
},
- pil/.style={phase in label=##1},
+ pil/.style={phase in label={##1}},
phase in label below/.style={
phase in label={label position=below,##1}
},
- pilb/.style={phase in label below=##1},
+ pilb/.style={phase in label below={##1}},
phase in label above/.style={
phase in label={label position=above,##1}
},
- pila/.style={phase in label above=##1},
+ pila/.style={phase in label above={##1}},
phase in label right/.style={
phase in label={label position=right,##1}
},
- pilr/.style={phase in label right=##1},
+ pilr/.style={phase in label right={##1}},
phase in label left/.style={
phase in label={label position=left,##1}
},
- pill/.style={phase in label left=##1},
+ pill/.style={phase in label left={##1}},
%%% Was supposed to automatically find the good style depending on content... Can't find how to do.
% Styles zxLong{X/Z} zxNoPhase{X/Z} are automatically selected by \zxZ4{...} and \zxX4{...} commands
% and zxShort is selected for fractions only like in \zxFracZ-{\pi}{4}
@@ -1609,11 +1968,11 @@
%% These take 6 arguments: additional style, sign (string "-" for minus, nothing for "+",
%% otherwise inserted directly), above fraction (no parens), below fraction (no parens), above fraction (parens), below fraction (parens).
zxFracZ6/.style n args={6}{
- add@Phase@Spider@Frac={zxNoPhaseZ}{zxShortZ}{stylePhaseInLabelZ}{##2}{##3}{##4}{##5}{##6},
+ add@Phase@Spider@Frac={zxNoPhaseZ}{zxShortZ,zxSpecificFrac}{stylePhaseInLabelZ}{##2}{##3}{##4}{##5}{##6},
/zx/post preparation labels,
/zx/user post preparation labels,
##1,
- zx@Execute@Very@End@Frac={zxNoPhaseZ}{zxShortZ}{stylePhaseInLabelZ}{##2}{##3}{##4}{##5}{##6},
+ zx@Execute@Very@End@Frac={zxNoPhaseZ}{zxShortZ,zxSpecificFrac}{stylePhaseInLabelZ}{##2}{##3}{##4}{##5}{##6},
},
zxFracX6/.style n args={6}{
add@Phase@Spider@Frac={zxNoPhaseX}{zxShortX}{stylePhaseInLabelX}{##2}{##3}{##4}{##5}{##6},
@@ -1638,9 +1997,16 @@
/zx/default style nodes/.style={
/zx/styles/rounded style
},
+ % Will be executed in tikzcd options. Useful to define a "global" option specific to a given style.
+ /zx/default style nodes preload/.style={
+ /zx/styles/rounded style preload,
+ },
% User can put here any additional property
/zx/user overlay nodes/.style={
},
+ % User can put here any global ZX options
+ /zx/user overlay/.style={
+ },
% Any additional property that needs to be loaded after add@Phase@Spider (by script, not by user).
/zx/post preparation labels/.style={
},
@@ -1653,6 +2019,34 @@
% User can add stuff in this style to improve wire styles
/zx/user overlay wires/.style={
},
+ /zx/every arrow pre/.style={%
+ /utils/exec={% We provide a way to disable the default behavior
+ \ifdefined\zxDisablePreRunStart\else%
+ %%% If it is an alias, we replace it with the original node:
+ \ifcsname zx@alias@\zxCurrentDiagram @\tikzcd@ar@start\endcsname% This is an alias: let's rename it to the original node
+ \edef\tikzcd@ar@start{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@start\endcsname}%
+ \fi%
+ %%% Load the arrow style set by the start node:
+ \edef\zx@tmp{% Make sure that the style exists and load it:
+ /zx/internals/preRunIfIamStartNode-\tikzcd@ar@start/.append style={},%
+ /zx/internals/preRunIfIamStartNode-\tikzcd@ar@start,%
+ }%
+ \pgfkeysalsofrom{\zx@tmp}%
+ \fi%
+ %%% Load the arrow style set by the end node:
+ \ifdefined\zxDisablePreRunEnd\else%
+ %%% If it is an alias, we replace it with the original node:
+ \ifcsname zx@alias@\zxCurrentDiagram @\tikzcd@ar@target\endcsname% This is an alias: let's rename it to the original node
+ \edef\tikzcd@ar@target{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@target\endcsname}%
+ \fi%
+ \edef\zx@tmp{% Make sure that the style exists and load it:
+ /zx/internals/preRunIfIamEndNode-\tikzcd@ar@target/.append style={},%
+ /zx/internals/preRunIfIamEndNode-\tikzcd@ar@target,%
+ }%
+ \pgfkeysalsofrom{\zx@tmp}%
+ \fi%
+ }%
+ },%
/zx/defaultEnv/.style={
%tiny depends on the size of the font... which we want to keep consistent look
column sep=\zxDefaultColumnSep,
@@ -1678,18 +2072,87 @@
1-row diagram/.style={},
%% usage: math baseline=wantedBaseline, where you have somewhere \zxX[a=wantedBaseline]{\beta}
math baseline/.style={baseline={([yshift=-axis_height]##1)}},
+ % math baseline row/.style={math baseline=\zxCurrentDiagram-##1-1},
+ math baseline row/.code={%
+ \IfInteger{##1}{%
+ \pgfkeysalso{math baseline=\zxCurrentDiagram-##1-1}%
+ }{%
+ % We have a non-integer value like 1.5 that means between both values.
+ % We first extract these values:
+ \pgfmathtruncatemacro{\zx@first@index}{floor(##1)}%
+ \pgfmathtruncatemacro{\zx@second@index}{floor(##1)+1}%
+ \pgfmathsetmacro{\zx@percent}{##1-floor(##1)}%
+ \pgfkeysalso{math baseline/.expanded={$(\noexpand\zxCurrentDiagram-\zx@first@index-1)!\zx@percent!(\noexpand\zxCurrentDiagram-\zx@second@index-1)$}}%
+ }%
+ },
+ math baseline row/.default={1},
+ mbr/.style={math baseline row={##1}},
+ mbr/.default={1},
+ thick lines/.style={
+ /tikz/zx thickness wires style/.style={thick, line cap=round},
+ },
+ % In circuits (mostly gates), the default separation feels too small, so we adjust it here
+ circuit/.style={
+ column sep=\zxDefaultColumnSepCircuit,
+ row sep=\zxDefaultRowSepCircuit,
+ },
+ bold/.style={
+ /tikz/commutative diagrams/arrows={B},
+ /zx/user overlay nodes/.style={
+ zxSpiders/.append style={BBw},
+ zxH/.append style={BBw},
+ },
+ /utils/exec={\def\zxEnableAllElementsBold{}},
+ },
+ B/.style={
+ bold
+ },
+ debug mode/.code={\def\zxDebugMode{}},
+ no debug mode/.code={\let\zxDebugMode\undefined},
+ amp/.style={
+ ampersand replacement=\&,
+ },
%%% Include a diagram in another diagram.
use diagram/.style 2 args={
execute at end picture={
- \node[fit=##2,inner sep=0pt,yshift=-axis_height]{\zxUseDiagram{##1}};
+ \node[fit=##2,anchor=center,inner sep=0pt,yshift=-axis_height]{\zxUseDiagram{##1}};
+ }
+ },
+ %%% Include a diagram in another diagram.
+ use diagram advanced/.style n args={3}{
+ execute at end picture={
+ \node[fit=##2,anchor=center,inner sep=0pt,yshift=-axis_height,##3]{\zxUseDiagram{##1}};
}
},
% Load (thanks ".search also") our own style
/tikz/every node/.style={%
+ % Otherwise, the empty nodes take some space… and create weird bugs. But I don't know how to add empties
+ % https://tex.stackexchange.com/questions/675958/tikz-empty-nodes-with-different-style-coordinate
+ % ==> solved, see "empty"
+ nodes={
+ zxAllNodes,
+ inner sep=0pt,
+ outer sep=0mm,
+ },
% For quickly adding alias, and displaying this alias in debug mode.
a/.code={%
\pgfkeysalso{%
- alias=####1,%
+ % alias=####1,%
+ % alias seems to fail with nodes in pic… let's try another method. See also:
+ % https://tex.stackexchange.com/questions/679647/tikz-pic-alias-to-internal-node
+ %% TODO: according to the above discussion, this append after command should be done after the
+ %% add anchor to node is finished, as an alias is basically copying all the macros of the initial node,
+ %% so you want to do it once its finished (in particular to preserve the anchors). But maybe
+ %% append after command is already avoiding that issue. In any case it would be good to make it more
+ %% robust (\tikzlastnode might change, so defining my own \tikzlastnode might help, use link instead
+ %% of copy alias to be sure the anchors are preserved etc...)
+ append after command={\pgfextra{%
+ \pgfnodealias{####1}{\tikzlastnode}%
+ % There is no way anymore to remember the link between the alias and the non-alias. Let's rembember it
+ % manually
+ \expandafter\xdef\csname zx@alias@\zxCurrentDiagram @####1\endcsname{\tikzlastnode}%
+ }%
+ },
}%
%% name path won't work with alias... So let's create two name path ^^
%% https://tex.stackexchange.com/questions/619622
@@ -1706,14 +2169,181 @@
}%
\fi%
},
+ % runs a=foo only if we are at the origin (0,0) of a zxExecuteAtRegionRelative
+ a if origin/.code={%
+ \ifnum \the\pgfmatrixcurrentrow=\zxOriginalRow\relax%
+ \ifnum \the\pgfmatrixcurrentcolumn=\zxOriginalCol\relax%
+ \pgfkeysalso{a={####1}}%
+ \fi%
+ \fi%
+ },
+ %% To allow blocks
+ block/.style={
+ zx set execute at begin node={\begin{varwidth}{50cm}}, % 50cm is just hardcoded to be long enough so that any content fits inside
+ zx set execute at end node={\end{varwidth}},
+ },
+ %% This allows nodes to specify styles for the arrows that start/end from them.
+ %% This style will be loaded last as otherwise we don't know yet the starting and ending point.
+ %% See how we apply it on the arrow side using "every arrow post"
+ post arrow style if start node/.style={%
+ append after command={% This expects a path, but we want to write a code without any path:
+ \pgfextra% this syntax with \endpgfextra completely turns off the tikz syntax, that might be safer than \pgfextra{...}.
+ \def\zx@arguments{####1}%
+ \edef\zx@tmp{%
+ /zx/internals/postRunIfIamStartNode-\tikzlastnode/.append style={\unexpanded\expandafter{\zx@arguments}},%
+ }% https://tex.stackexchange.com/questions/47905/how-to-globally-tikzset-styles
+ {%
+ \globaldefs=1\relax%
+ \pgfkeysalsofrom{\zx@tmp}%
+ }%
+ \endpgfextra%
+ },%
+ },
+ post arrow style if end node/.style={%
+ append after command={% This expects a path, but we want to write a code without any path:
+ \pgfextra% this syntax with \endpgfextra completely turns off the tikz syntax, that might be safer than \pgfextra{...}.
+ \def\zx@arguments{####1}%
+ \edef\zx@tmp{%
+ /zx/internals/postRunIfIamEndNode-\tikzlastnode/.append style={\unexpanded\expandafter{\zx@arguments}},%
+ }% https://tex.stackexchange.com/questions/47905/how-to-globally-tikzset-styles
+ {%
+ \globaldefs=1\relax%
+ \pgfkeysalsofrom{\zx@tmp}%
+ }%
+ \endpgfextra%
+ },%
+ },%
+ pre arrow style if start node/.style={%
+ append after command={% This expects a path, but we want to write a code without any path:
+ \pgfextra% this syntax with \endpgfextra completely turns off the tikz syntax, that might be safer than \pgfextra{...}.
+ \def\zx@arguments{####1}%
+ \edef\zx@tmp{%
+ /zx/internals/preRunIfIamStartNode-\tikzlastnode/.append style={\unexpanded\expandafter{\zx@arguments}},%
+ }% https://tex.stackexchange.com/questions/47905/how-to-globally-tikzset-styles
+ {%
+ \globaldefs=1\relax%
+ \pgfkeysalsofrom{\zx@tmp}%
+ }%
+ \endpgfextra%
+ },%
+ },
+ pre arrow style if end node/.style={%
+ append after command={% This expects a path, but we want to write a code without any path:
+ \pgfextra% this syntax with \endpgfextra completely turns off the tikz syntax, that might be safer than \pgfextra{...}.
+ \def\zx@arguments{####1}%
+ \edef\zx@tmp{%
+ /zx/internals/preRunIfIamEndNode-\tikzlastnode/.append style={\unexpanded\expandafter{\zx@arguments}},%
+ }% https://tex.stackexchange.com/questions/47905/how-to-globally-tikzset-styles
+ {%
+ \globaldefs=1\relax%
+ \pgfkeysalsofrom{\zx@tmp}%
+ }%
+ \endpgfextra%
+ },%
+ },
/zx/default style nodes,
/zx/user overlay nodes,
},
every arrow/.style={%
/zx/wires definition,
/zx/default style wires,
+ /zx/every arrow pre,
/zx/user overlay wires,
+ %%% Load the post arrow style at the end:
+ %% See also every arrow pre if you want to run it before the style of the arrow
+ /tikz/commutative diagrams/every arrow post/.append style={%
+ /utils/exec={% We provide a way to disable the default behavior
+ \ifdefined\zxDisablePostRunStart\else%
+ %%% If it is an alias, we replace it with the original node:
+ \ifcsname zx@alias@\zxCurrentDiagram @\tikzcd@ar@start\endcsname% This is an alias: let's rename it to the original node
+ \edef\tikzcd@ar@start{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@start\endcsname}%
+ \fi%
+ %%% Load the arrow style set by the start node:
+ \edef\zx@tmp{% Make sure that the style exists and load it:
+ /zx/internals/postRunIfIamStartNode-\tikzcd@ar@start/.append style={},%
+ /zx/internals/postRunIfIamStartNode-\tikzcd@ar@start,%
+ }%
+ \pgfkeysalsofrom{\zx@tmp}%
+ \fi%
+ %%% Load the arrow style set by the end node:
+ \ifdefined\zxDisablePostRunEnd\else%
+ %%% If it is an alias, we replace it with the original node:
+ \ifcsname zx@alias@\zxCurrentDiagram @\tikzcd@ar@target\endcsname% This is an alias: let's rename it to the original node
+ \edef\tikzcd@ar@target{\csname zx@alias@\zxCurrentDiagram @\tikzcd@ar@target\endcsname}%
+ \fi%
+ \edef\zx@tmp{% Make sure that the style exists and load it:
+ /zx/internals/postRunIfIamEndNode-\tikzcd@ar@target/.append style={},%
+ /zx/internals/postRunIfIamEndNode-\tikzcd@ar@target,%
+ }%
+ \pgfkeysalsofrom{\zx@tmp}%
+ \fi%
+ }%
+ },%
+ disable post run start/.code={\def\zxDisablePostRunStart{}},
+ disable post run end/.code={\def\zxDisablePostRunEnd{}},
+ disable post run/.style={
+ disable post run start,
+ disable post run end,
+ },
+ enable post run start/.code={\let\zxDisablePostRunStart\undefined},
+ enable post run end/.code={\let\zxDisablePostRunEnd\undefined},
+ enable post run/.style={
+ enable post run start,
+ enable post run end,
+ },
+ enable post run,
+ },
+ %% We add an empty coordinate in every node. This has multiple advantages: first this avoids errors about
+ %% single ampersand when the matrix does not start with None, and it also avoids using \zxN{} everywhere.
+ %% However, we can't just use 'nodes in empty cells=true' or it will add nodes that might take some space:
+ % https://tex.stackexchange.com/questions/696622/tikz-allow-the-style-syntax-in-execute-at-empty-cells?noredirect=1#comment1729912_696622
+ % /tikz/replace empty cell with/.code={%
+ % \def\tikz@at@emptycell{%
+ % \tikz@lib@matrix@start@cell
+ % #1%
+ % \tikz@lib@matrix@end@cell
+ % }%
+ % },
+ % /tikz/replace empty cell with={%
+ % /tikz/execute at empty cell/.code={%
+ % \expandafter\def\expandafter\tikz@at@emptycell\expandafter
+ % {\tikz@at@emptycell\expandafter\expandafter\expandafter
+ % \tikz@lib@matrix@start@cell##1\tikz@lib@matrix@end@cell}},
+ % This is started at the beginning of non-empty cells
+ every matrix/.append style={
+ /tikz/execute at end cell={%
+ \ifcsname zxExecuteAtCell-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn\endcsname%
+ \csname zxExecuteAtCell-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn\endcsname%
+ \fi%
+ },%
+ },%
+ /tikz/execute at empty cell={%
+ % We want to check if there is a
+ \ifcsname zxExecuteAtCell-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn\endcsname%
+ % I wanted to allow a syntax with |[]| but first it seems to be quite hard (as it depends on the number of extensions):
+ % %% https://tex.stackexchange.com/questions/696622/tikz-allow-the-style-syntax-in-execute-at-empty-cells
+ % but anyway I guess it is better to turn everything into nodes so that \zxX{} can be inserted outside of a matrix.
+ \csname zxExecuteAtCell-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn\endcsname%
+ \else%
+ \ifdefined\zxCustomExecuteAtEmptyCell\zxCustomExecuteAtEmptyCell%
+ \else%
+ \coordinate[
+ % yshift=axis_height, % We already do that elsewhere
+ name=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn];%
+ \fi%
+ \fi%
},
+ % When an arrow is present, it will not detect it as an empty cell… The below code tries to avoid this issue, but actually has another issue as it removes all nodes without text in it, like |[circle, draw, inner sep=3pt]|, so
+ % we disable it for now.
+ %% https://tex.stackexchange.com/questions/675958/tikz-empty-nodes-with-different-style-coordinate/675971#675971
+ % /tikz/every node/.append code={%
+ % \tikz@addoption{%
+ % \ifdim\wd\pgfnodeparttextbox=0pt
+ % \pgfutil@ifx\tikz@shape\tikz@coordinate@text{}{%
+ % \def\tikz@shape{coordinate}%
+ % \pgftransformyshift{axis_height}}%
+ % \fi}%
+ % },
%%% To be used only in \zx{...} environment.
%%% Exemple:
phase in content/.style={
@@ -1723,38 +2353,49 @@
},
phase in label/.style={
/zx/post preparation labels/.append style={
- phase in label=##1,
+ phase in label={##1},
}
},
phase in label above/.style={
/zx/post preparation labels/.append style={
- phase in label above=##1,
+ phase in label above={##1},
}
},
phase in label below/.style={
/zx/post preparation labels/.append style={
- phase in label below=##1,
+ phase in label below={##1},
}
},
phase in label right/.style={
/zx/post preparation labels/.append style={
- phase in label right=##1,
+ phase in label right={##1},
}
},
phase in label left/.style={
/zx/post preparation labels/.append style={
- phase in label left=##1,
+ phase in label left={##1},
}
},
% for "Phase In Label"
- pil/.style={phase in label=##1},
- pilb/.style={phase in label below=##1},
- pila/.style={phase in label above=##1},
- pilr/.style={phase in label right=##1},
- pill/.style={phase in label left=##1},
+ pil/.style={phase in label={##1}},
+ pilb/.style={phase in label below={##1}},
+ pila/.style={phase in label above={##1}},
+ pilr/.style={phase in label right={##1}},
+ pill/.style={phase in label left={##1}},
+ % Load the global options style-specific
+ /zx/default style nodes preload,
+ /zx/user overlay,
},
}
+% % Call \zxSetStyleWhenEndingHere{your, zx, style} when you want to configure a particular style when arriving on a particular cell
+% \NewExpandableDocumentCommand{\zxSetStyleWhenEndingHere}{m}{%
+% \pgfkeys{
+% /zx/internals/postRunIfIamEndNode-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn/.append code={#1},
+% /zx/internals/postRunIfIamEndNode-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn
+% }%
+% }
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Helper functions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1782,7 +2423,8 @@
\def\node@on@layer{\aftergroup\node@@on@layer}
%%% Declare a symbol for a short minus (useful in fractions)
-\DeclareMathSymbol{\zxMinus}{\mathbin}{AMSa}{"39}% Requires amssymb
+\DeclareMathSymbol{\zxShortMinus}{\mathbin}{AMSa}{"39}% Requires amssymb. This version should not be redefined by the user to obtain a normal minus (or "small minus" won't work anymore)
+\def\zxMinus{\zxShortMinus}
%%% Checks if a function is a point or a node.
%%% Not sure if best solution (needed to dig into source of TeX), but can't find anything better in manual
@@ -1797,7 +2439,7 @@
% shape anchor name if exists if not. Works, while doing \pgfutil@ifundefined{pgf@anchor@\shapenode{}@#2} fails.
% I guess it has to do with the way macro are expanded...
-\def\ifAnchorExistsFromShape#1#2#3#4{
+\def\ifAnchorExistsFromShape#1#2#3#4{%
\pgfutil@ifundefined{pgf@anchor@#1@#2}{%
#4%
}{%
@@ -1809,10 +2451,135 @@
\def\ifAnchorExists#1#2#3#4{%
%%% First we extract the shape of the node:
\edef\pgf@node@name{#1}%
- \edef\shapenode{\csname pgf@sh@ns@\pgf@node@name\endcsname}%
- \ifAnchorExistsFromShape{\shapenode}{#2}{#3}{#4}
+ \edef\shapenode{\csname pgf@sh@ns@\pgf@node@name\endcsname}% e.g. rectangle
+ \ifAnchorExistsFromShape{\shapenode}{#2}{#3}{#4}%
+}
+
+%% If we manually add an anchor to a note, \ifAnchorExists will not work. Hence this improved version:
+%% Note that #3 and #4 will run in a group
+\def\ifAnchorExistsNodeSpecific#1#2#3#4{%
+ \let\zxcalculus@tmp\undefined% This is used to run #3 and #4 outside the group
+ {% group not to pollute stuff with pgf@sh@ma
+ \ifcsname pgf@sh@ma@#1\endcsname% per node config
+ \csname pgf@sh@ma@#1\endcsname% we run the config
+ \fi%
+ %%% First we extract the shape of the node:
+ \edef\pgf@node@name{#1}%
+ \edef\shapenode{\csname pgf@sh@ns@\pgf@node@name\endcsname}% e.g. rectangle
+ \ifAnchorExistsFromShape{\shapenode}{#2}{\gdef\zxcalculus@tmp{}}{}%
+ }%
+ \ifdefined\zxcalculus@tmp%
+ #3%
+ \else%
+ #4%
+ \fi%
+}
+
+% \zxGetSubnodeOfNode{\tikzcd@ar@start}{mysubnode}{True branch}{False branch} will set \zx@result to the corresponding node if it exits and run True branch
+% otherwise it will run False branch, where \zx@error will contain more details on why it failed. This function also try to use \zxOriginalRow to find
+% a possible parent.
+\def\zxGetSubnodeOfNode#1#2#3#4{%
+ \edef\zx@result{#1}%
+ % First we try to see if there is an alias:
+ \edef\zx@tmp{zx@alias@\zxCurrentDiagram @#1}%
+ % First, rewrite #1 so that it equals the name of the current node without alias
+ \ifcsname \zx@tmp\endcsname% There exists an alias
+ \edef\zx@tmp@alias{(alias \zx@tmp) }% Mostly for the error message
+ \edef\zx@result{\csname zx@alias@\zxCurrentDiagram @#1\endcsname}%
+ \else%
+ \edef\zx@tmp@alias{(no alias) }% Mostly for the error message
+ \fi
+ % First, we check if there is a node with this name on this node. If not, we will try with the parent node
+ \@ifundefined{pgf@sh@ns@\zx@result #2}{%
+ % The current node has no such subnode name: let's start its parent.
+ \@ifundefined{\zx@result -zxOriginalRow}{%
+ % There is no original coordinate: error
+ \def\zx@error{the subnode #2 of node \zx@result \zx@tmp@alias does not exist.}%
+ #4%
+ }{%
+ % There is an original coordinate: we try to see if the original node admits a subnode.
+ \edef\zx@tmp@originalRow{\csname \zx@result -zxOriginalRow\endcsname}%
+ \edef\zx@tmp@originalCol{\csname \zx@result -zxOriginalCol\endcsname}%
+ \@ifundefined{pgf@sh@ns@\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol #2}{%
+ \def\zx@error{the subnode #2 of aliased node \zx@result {} \zx@tmp@alias does not exist (even in the parent node at coordinate \zx@tmp@originalRow - \zx@tmp@originalCol).}%
+ #4%
+ }{%
+ \edef\zx@result{\zxCurrentDiagram-\zx@tmp@originalRow-\zx@tmp@originalCol #2}%%
+ #3%
+ }%
+ }%
+ }{% There exists a subnode in the current name
+ \edef\zx@result{\zx@result #2}%%
+ #3%
+ }%
}
+% \zxTryFirstSubnodeThenAnchorThenNode{\tikztostart}{true north}{north} will set \zx@result to the corresponding subnode if it exists, otherwise the true north anchor,
+% otherwise the north anchor
+\def\zxTryFirstSubnodeThenAnchorThenNode#1#2#3{%
+ \zxGetSubnodeOfNode{#1}{#2}{%
+ % The subnode exists: we forward \zx@result
+ }{%
+ % No submode exists:
+ % Test if it is a point or a node, and define StartPoint accordingly.
+ \ifPgfpointOrNode{#1}{%
+ \edef\zx@result{#1}%
+ }{% This is a node
+ % "zx add anchor to node" might define per-node anchors, and they are stored in
+ % a macro called like \pgf@sh@ma@tikz@f@3-2-2, so we need to read this first:
+ % TODO: maybe use pp@name everywhere? (see comment beginning of this file)
+ \begingroup% This group avoids pollution done by executing pgf@sh@ma@NODENAME
+ \pgfutil@ifundefined{pgf@sh@ma@\tikz@pp@name{##1}}{}{%
+ % We the per-node macro exists, we run it.
+ \csname pgf@sh@ma@\tikz@pp@name{##1}\endcsname%
+ }%
+ % Test if "true north" etc exists:
+ \ifAnchorExistsNodeSpecific{#1}{#2}{%
+ \xdef\zx@result{#1.#2}%
+ }{%
+ \xdef\zx@result{#1.#3}%
+ }%
+ \endgroup%
+ }%
+ }
+}
+
+% Like zxTryFirstSubnodeThenAnchorThenNodeToCoordinate but \zx@result will contain coordinates of the final point.
+\def\zxTryFirstSubnodeThenAnchorThenNodeToCoordinate#1#2#3{%
+ \zxGetSubnodeOfNode{#1}{#2}{%
+ % The subnode exists: we forward \zx@result after turning it in a coordinate
+ \ifPgfpointOrNode{\zx@result}{}{%
+ % this is a node, so we take the center
+ \pgfpointanchor{\zx@result}{#3}%
+ \def\zx@result{\the\pgf@x,\the\pgf@y}%
+ }%
+ }{%
+ % No submode exists:
+ % Test if it is a point or a node, and define StartPoint accordingly.
+ \ifPgfpointOrNode{#1}{%
+ \edef\zx@result{#1}%
+ }{% This is a node
+ % "zx add anchor to node" might define per-node anchors, and they are stored in
+ % a macro called like \pgf@sh@ma@tikz@f@3-2-2, so we need to read this first:
+ % TODO: maybe use pp@name everywhere? (see comment beginning of this file)
+ \begingroup% This group avoids pollution done by executing pgf@sh@ma@NODENAME
+ \pgfutil@ifundefined{pgf@sh@ma@\tikz@pp@name{#1}}{}{%
+ % We the per-node macro exists, we run it.
+ \csname pgf@sh@ma@\tikz@pp@name{#1}\endcsname%
+ }%
+ % Test if "true north" etc exists:
+ \ifAnchorExistsNodeSpecific{#1}{#2}{%
+ \pgfpointanchor{#1}{#2}%
+ }{%
+ \pgfpointanchor{#1}{#3}%
+ }%
+ \xdef\zx@result{\the\pgf@x,\the\pgf@y}%
+ \endgroup%
+ }%
+ }
+}
+
+
%%% Create different kinds of dots...
%% https://tex.stackexchange.com/questions/617959
%% https://tex.stackexchange.com/questions/528774/excess-vertical-space-in-vdots/528775#528775
@@ -1842,44 +2609,1599 @@
\DeclareRobustCommand{\cvdots}{\cvdotsCenterMathline}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Practical functions to define multirow/multicols gates
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% We provide a generic set of functions to execute code later
+% (in a later cell, or at the end of the picture), together with
+% a way to pass any kind of variables for later
+
+\NewExpandableDocumentCommand{\zxCoordinateMain}{O{}m}{
+ \coordinate[#1,#2](\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn);
+}
+
+\NewExpandableDocumentCommand{\zxCoordinateSubnode}{O{}m}{
+ \coordinate[#1](\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn#2);
+}
+
+\NewDocumentCommand{\zxMainNodeAlreadySet}{m}{\def\zxMainNodeAlreadySetMacro{}}
+
+\tikzset{
+ % When using the \node{}; instead of |[foo]| bar structure, no name is given to the node. This is fixed with
+ % this:
+ zx main node/.code={%
+ % If we are in a matrix, we can give it the name of the current column
+ \ifdefined\zxCurrentDiagram%
+ % Useful to temporarily disable this, for instance useful in matrix to change the size of a single cell.
+ \ifdefined\zxMainNodeAlreadySetMacro\else%
+ \tikzset{name=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn}%
+ \fi%
+ \fi%
+ },
+ zx at origin/.style={at={(0,0)}},
+ zx subnode/.code={
+ % we forbid empty subnode as otherwise it will be equivalent to "zx main node" due to the way we handle subnodes for now.
+ % and most of the time when it is empty it just means that the user does not want to set a subnode.
+ % test if empty: https://tex.stackexchange.com/questions/53068/how-to-check-if-a-macro-value-is-empty-or-will-not-create-text-with-plain-tex-co
+ \if\relax\detokenize{#1}\relax%
+ \message{Empty subnode name}%
+ \else%
+ \ifdefined\zxCurrentDiagram%
+ \ifdefined\zxOriginalRow%
+ \tikzset{alias=\zxCurrentDiagram-\zxOriginalRow-\zxOriginalCol#1}%
+ % \tikzset{name=\zxCurrentDiagram-\zxOriginalRow-\zxOriginalCol#1}%
+ \else%
+ \tikzset{alias=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn#1}%
+ % \tikzset{name=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn#1}%
+ \fi%
+ \else%
+ \message{Warning: you or outside of a tikzcd environment, so you will not be able to implement subnodes for now. But you might want to try to define zxCurrentDiagram, pgfmatrixcurrentrow and pgfmatrixcurrentcolumn yourself, you might be lucky.}%
+ \fi%
+ \fi%
+ },
+ zx independent subnode/.style={
+ name=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn#1,%
+ },
+ zx apply style/.code={\tikzset{/tikz/.cd,#1}},
+ zx style from variable/.style={%
+ zx apply style/.expand twice={\csname zxGateMultiVariable-\zxCurrentDiagram-\zxOriginalRow-\zxOriginalCol-#1\endcsname},
+ % \expandafter\scantokens\expandafter{\zx@tmp}%
+ % \zx@tmp%
+ },
+}
+
+\NewExpandableDocumentCommand{\zxGetNameAbsoluteNode}{mm}{%
+ \tikzcdmatrixname-#1-#2%
+}%
+
+%% here you can use previously defined variables if you created them
+%% will only work inside environments where \zxOriginalRow/Col are defined
+\NewExpandableDocumentCommand{\zxGetNameRelativeNode}{mm}{%
+ \ifdefined\zxOriginalRow%
+ \zxCurrentDiagram-\the\numexpr\zxOriginalRow+#1\relax-\the\numexpr\zxOriginalCol+#2\relax%
+ \else%
+ \zxCurrentDiagram-\the\numexpr\the\pgfmatrixcurrentrow+#1\relax-\the\numexpr\the\pgfmatrixcurrentcolumn+#2\relax%
+ \fi%
+}%
+
+\NewExpandableDocumentCommand{\zxGetNameRelativeNodeStartOne}{mm}{%
+ \zxGetNameRelativeNode{\numexpr #1-1\relax}{\numexpr #2-1\relax}%
+}%
+
+
+% \zxExecuteAtEndPicture{\node{A};} will execute \node{A}; at the end of the picture (or rather after the draw of the matrix, but before the draw of the wires)
+\NewExpandableDocumentCommand{\zxExecuteAtEndPicture}{m}{%
+ \edef\zx@tmp@args{\unexpanded{#1}}%
+ \edef\zx@tmp{\noexpand\pgfutil@g@addto@macro\noexpand\tikzcd@before@paths@hook{%
+ % We give random value just to avoid having errors when it is not yet defined, but you should always specify the
+ % to and from.
+ \noexpand\def\noexpand\tikzcd@currentrow{In execute at end picture}%
+ \noexpand\def\noexpand\tikzcd@currentcolumn{In execute at end picture}%
+ \noexpand\def\noexpand\tikzcd@lineno{In zxArrowNow}%
+ \noexpand\def\noexpand\zxOriginalRow{\the\pgfmatrixcurrentrow}%
+ \noexpand\def\noexpand\zxOriginalCol{\the\pgfmatrixcurrentcolumn}%
+ \expandonce\zx@tmp@args%
+ }%
+ }%
+ \zx@tmp%
+}
+
+\NewExpandableDocumentCommand{\zxExecuteWhenDrawingArrows}{m}{%
+ \edef\zx@tmp@args{\unexpanded{#1}}%
+ \edef\zx@tmp{\noexpand\pgfutil@g@addto@macro\noexpand\tikzcd@savedpaths{%
+ \noexpand\def\noexpand\zxOriginalRow{\the\pgfmatrixcurrentrow}%
+ \noexpand\def\noexpand\zxOriginalCol{\the\pgfmatrixcurrentcolumn}%
+ \expandonce\zx@tmp@args%
+ }%
+ }%
+ \zx@tmp%
+}
+
+% like \ar but run it directly. Usually run it in \zxExecuteWhenDrawingArrows.
+\NewExpandableDocumentCommand{\zxArrowNow}{O{}m}{%
+ \path[/tikz/commutative diagrams/.cd,every arrow,#1] (\tikzcd@ar@start\tikzcd@startanchor) to (\tikzcd@ar@target\tikzcd@endanchor);%
+}
+
+% \zxExecuteAtCellAbsolute{1}{2}{\node{A};} will execute at cell row 1, column 2 the code \node{A};, just make sure that nothing is already present in that cell
+\NewExpandableDocumentCommand{\zxExecuteAtCellAbsolute}{mmm}{%
+ \def\zx@tmp@args{#3}%
+ \edef\zx@tmp{zxExecuteAtCell-\zxCurrentDiagram-#1-#2}%
+ % Make sure to define the macro as we can't add to it if it does not exist
+ \ifcsname \zx@tmp\endcsname\else\expandafter\gdef\csname \zx@tmp\endcsname{}\fi%
+ \edef\zx@tmp@code{
+ \noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname zxExecuteAtCell-\zxCurrentDiagram-#1-#2\noexpand\endcsname{%
+ \noexpand\def\noexpand\zxOriginalRow{\the\pgfmatrixcurrentrow}%
+ \noexpand\def\noexpand\zxOriginalCol{\the\pgfmatrixcurrentcolumn}%
+ % To allow to recover \zxOriginalRow from the name of the node later, we create a new macro "namenode-zxOriginalRow" with the value of the original row, same for Col
+ \noexpand\expandafter\noexpand\xdef\noexpand\csname\zxCurrentDiagram-\noexpand\the\noexpand\pgfmatrixcurrentrow-\noexpand\the\noexpand\pgfmatrixcurrentcolumn-zxOriginalRow\endcsname{\noexpand\zxOriginalRow}%
+ \noexpand\expandafter\noexpand\xdef\noexpand\csname\zxCurrentDiagram-\noexpand\the\noexpand\pgfmatrixcurrentrow-\noexpand\the\noexpand\pgfmatrixcurrentcolumn-zxOriginalCol\endcsname{\noexpand\zxOriginalCol}%
+ \expandonce{\zx@tmp@args}%
+ }%
+ }%
+ \zx@tmp@code%
+}
+
+% TODO: maybe use instead /tikz/every cell={n}{m} that is always run even if the cell is not empty? Or execute at begin cell that applies to non-empty cells?
+% \zxExecuteAtCellRelative{1}{2}{\node{A};} will execute at cell current row + 1, current column + 2 the code \node{A};, just make sure that nothing is already present in that cell
+\NewExpandableDocumentCommand{\zxExecuteAtCellRelative}{mmm}{%
+ \def\zx@tmp@args{#3}%
+ % putting this in the csname directly does not work
+ \edef\zx@tmp{zxExecuteAtCell-\zxCurrentDiagram-\the\numexpr \the\pgfmatrixcurrentrow+#1\relax-\the\numexpr\the\pgfmatrixcurrentcolumn+#2\relax}%
+ % \noexpand\expandafter\noexpand\gdef\noexpand\csname \zx@tmp\noexpand\endcsname{%
+ % Make sure to define the macro as we can't add to it if it does not exist
+ \ifcsname \zx@tmp\endcsname\else\expandafter\gdef\csname \zx@tmp\endcsname{}\fi%
+ \edef\zx@tmp@code{%
+ \noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname \zx@tmp\noexpand\endcsname{%
+ \noexpand\def\noexpand\zxOriginalRow{\the\pgfmatrixcurrentrow}%
+ \noexpand\def\noexpand\zxOriginalCol{\the\pgfmatrixcurrentcolumn}%
+ % To allow to recover \zxOriginalRow from the name of the node later, we create a new macro "namenode-zxOriginalRow" with the value of the original row, same for Col
+ \noexpand\expandafter\noexpand\xdef\noexpand\csname\zxCurrentDiagram-\noexpand\the\noexpand\pgfmatrixcurrentrow-\noexpand\the\noexpand\pgfmatrixcurrentcolumn-zxOriginalRow\endcsname{\noexpand\zxOriginalRow}%
+ \noexpand\expandafter\noexpand\xdef\noexpand\csname\zxCurrentDiagram-\noexpand\the\noexpand\pgfmatrixcurrentrow-\noexpand\the\noexpand\pgfmatrixcurrentcolumn-zxOriginalCol\endcsname{\noexpand\zxOriginalCol}%
+ \expandonce{\zx@tmp@args}%
+ }%
+ }%
+ \zx@tmp@code%
+ % \edef\zx@tmp{}%
+ % \expandafter\gdef\csname \zx@tmp\endcsname{#3}%
+}
+
+% \zxExecuteAtRegionRelative{n}{m}{code} will execute code \zxExecuteAtCellRelative in all cells starting from the current cell (note that
+% it will have no effect on the (0,0) cell since this cell is not empty and already processed
+\NewExpandableDocumentCommand{\zxExecuteAtRegionRelative}{mmm}{%
+ \pgfmathparse{#1-1}%
+ \foreach \i in {0,...,\pgfmathresult}{%
+ \pgfmathparse{#2-1}%
+ \foreach \j in {0,...,\pgfmathresult}{%
+ \zxExecuteAtCellRelative{\i}{\j}{#3}%
+ }%
+ }%
+}
+
+\NewExpandableDocumentCommand{\zxExecuteAtRegionRelativeAndOrigin}{mmm}{%
+ % Just a trick or the tikz matrix parser will not understand that we are in a node if we start with def:
+ \coordinate(zx@Useless);
+ \def\zxOriginalRow{\the\pgfmatrixcurrentrow}%
+ \def\zxOriginalCol{\the\pgfmatrixcurrentcolumn}%
+ %#3%
+ \zxExecuteAtRegionRelative{#1}{#2}{#3}%
+}
+
+%%%
+%%% Variables that you can create in one cell and reuse later
+%%
+
+% \zxGateMultiNewVariable{my variable}{value}
+\NewExpandableDocumentCommand{\zxSetVariable}{mm}{%
+ % For some reasons it fails inside the csname directly
+ \edef\zx@tmp{zxGateMultiVariable-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn-#1}%
+ \expandafter\gdef\csname \zx@tmp\endcsname{%
+ #2%
+ }%
+}
+
+\NewExpandableDocumentCommand{\zxSetVariableExpandOnce}{mm}{%
+ % For some reasons it fails inside the csname directly
+ \edef\zx@tmp{zxGateMultiVariable-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn-#1}%
+ \expandafter\xdef\csname \zx@tmp\endcsname{%
+ \expandonce{#2}%
+ }%
+}
+
+\NewExpandableDocumentCommand{\zxSetVariableExpand}{mm}{%
+ % For some reasons it fails inside the csname directly
+ \edef\zx@tmp{zxGateMultiVariable-\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn-#1}%
+ \expandafter\xdef\csname \zx@tmp\endcsname{%
+ #2%
+ }%
+}
+
+\def\zxGetVariable#1{%
+ \csname zxGateMultiVariable-\zxCurrentDiagram-\zxOriginalRow-\zxOriginalCol-#1\endcsname%
+}
+
+\def\zxShowVariable#1{%
+ \expandafter\show\csname zxGateMultiVariable-\zxCurrentDiagram-\zxOriginalRow-\zxOriginalCol-#1\endcsname%
+}
+
+%%%%%%%%%%
+%%% Slices
+%%%%%%%%%%
+
+\tikzset{
+ /zx/slice label style/.style={
+ align=center,pos=0, black, anchor=south,zxTinyFont,
+ },
+ /zx/slice line style/.style={
+ dashed, red, thick,
+ },
+}
+
+\NewDocumentCommand{\zxSlice}{O{}O{}O{.5}m}{%
+ \zxExecuteAtEndPicture{
+ \draw[/zx/slice line style,#2]
+ (\tikzcdmatrixname.north-|{$(\zxCurrentDiagram-1-\zxOriginalCol)!#3!(\zxCurrentDiagram-1-\the\numexpr\zxOriginalCol+1\relax)$})
+ -- (\tikzcdmatrixname.south-|{$(\zxCurrentDiagram-1-\zxOriginalCol)!#3!(\zxCurrentDiagram-1-\the\numexpr\zxOriginalCol+1\relax)$})
+ node[rotated/.style={anchor=south west,yshift=-.5ex,rotate=##1},rotated/.default=30, /zx/slice label style,#1]{#4};
+ }
+}
+
+\tikzset{
+ /zx/vertical slice label style/.style={
+ align=center,pos=1, black, anchor=west,zxTinyFont,
+ },
+ /zx/vertical slice line style/.style={
+ dashed, red, thick,
+ },
+}
+
+\NewDocumentCommand{\zxVSlice}{O{}O{}m}{%
+ \zxExecuteAtEndPicture{%
+ % \pgfextra{
+ \pgfpointanchor{\tikzcdmatrixname}{west}%
+ \pgfgetlastxy{\zx@tmp@west@x}{\zx@tmp@west@y}%
+ \pgfpointanchor{\tikzcdmatrixname}{east}%
+ \pgfgetlastxy{\zx@tmp@east@x}{\zx@tmp@east@y}%
+ \pgfmathparse{\zx@tmp@east@x-\zx@tmp@west@x}%
+ \edef\zxMatrixWidth{\pgfmathresult pt}%
+ % }%
+ \draw[/zx/vertical slice line style,#2]
+ (\tikzcdmatrixname.west|-{$(\zxCurrentDiagram-\zxOriginalRow-1)!.5!(\zxCurrentDiagram-\the\numexpr\zxOriginalRow+1\relax-1)$})
+ -- (\tikzcdmatrixname.east|-{$(\zxCurrentDiagram-\zxOriginalRow-1)!.5!(\zxCurrentDiagram-\the\numexpr\zxOriginalRow+1\relax-1)$})
+ node[rotated/.style={anchor=south west,yshift=-.5ex,rotate=####1},rotated/.default=30, /zx/vertical slice label style,#1]{#3};
+ }
+}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Practical functions to nest diagrams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NewDocumentCommand{\zxSaveDiagram}{mO{}m}{
\newsavebox{#1}%
- \savebox{#1}{\begin{ZX}[ampersand replacement=\&,#2]#3\end{ZX}}%
+ \savebox{#1}{%
+ \ifdefined\tikz@library@external@loaded% Library external is loaded...
+ \tikzset{external/optimize=false}% Otherwise, tikz will try to optimize and replace the box with a text
+ \fi%
+ \begin{ZX}[#2]#3\end{ZX}
+ }%
}
\NewDocumentCommand{\zxUseDiagram}{m}{
\usebox{#1}%
}
+%%%%%%%%%%%%%%%%%%%%%
+%%% Main environments
+%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Practical macros to automatically choose appropriate style and arrows
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% /!\ Warning: you should add {} at the end of all macros (except arrows)!
-% Not using that may work for now, but it may break later...
-% TODO: define them only in \zx environment.
+% Quantikz has a bug which adds space automatically.
+% https://tex.stackexchange.com/questions/618330
+% Fixing that by copying the original (unpatched) functions, and reusing them later.
+% Warning: you must load this package **before** quantikz otherwise the fix will not work.
+\let\tikzcd@@originalCopyZx\tikzcd@
+\let\endtikzcd@originalCopyZx\endtikzcd
-% % Example: \leftManyDots{n}
-% Useful to put on the left of a node like "n \vdots", linked to the next node. Example: \leftManyDots{n}.
-% First optional argument is scale of text, second is scale of =.
-\NewExpandableDocumentCommand{\leftManyDots}{O{1}O{\zxScaleDots}m}{%
- |[zxNone+,inner xsep=0pt]| \scalebox{#1}{$#3$\,}\makebox[0pt][l]{\scalebox{#2}{$\cvdotsCenterMathline$}} \ar[r,-N.,start anchor=north east] \ar[r,-N',start anchor=south east] \pgfmatrixnextcell[\zxwCol]%
+%%%%% Main environment \begin{ZX}...\end{ZX}. However, we call it ZXNoExt because when using
+%%%%% externalization (to save compilation time), we need to wrap it around a figure.
+\NewDocumentEnvironment{ZXNoExt}{O{}}{%
+ \bgroup%
+ % Do not change the font size here or it will change axis_height... Use \fontsize{10}{12}\selectfont
+ % when drawing some texts instead.
+ % Add a switch in case someone really wants the current tikzcd version:
+ \ifdefined\doNotPatchQuantikz% Do not patch tikzcd.
+ \else% Restore locally original tikzcd.
+ \let\tikzcd@\tikzcd@@originalCopyZx%
+ \let\endtikzcd\endtikzcd@originalCopyZx%
+ \fi%
+ % we need to reset this or it will get data from previous pictures
+ \global\let\tikzcd@before@paths@hook\pgfutil@empty%
+ \global\let\tikzcd@savedpaths\pgfutil@empty%
+ \ifdefined\zxDoNotPatchArrows% Do not patch arrows (we need sometimes "every arrow post")
+ \else% Copy/pasted from https://github.com/astoff/tikz-cd/blob/master/tikzlibrarycd.code.tex, just added "every arrow post".
+ %% I'm not sure which method is more resilient: patchcmd is likely to fail on minor library update,
+ %% while redefining \tikzcd@ar@new might not apply some major library upgrades (note that we redefine it
+ %% only locally). Since I don't know what is better, I do both depending on this macro
+ \ifdefined\zxUsePatchCmdToPatchArrows%
+ \patchcmd\tikzcd@ar@new%
+ {\path[/tikz/commutative diagrams/.cd,every arrow,#1]}%
+ {\path[/tikz/commutative diagrams/.cd,every arrow,#1,every arrow post]}%
+ {}%
+ {}%
+ \else%
+ \def\tikzcd@ar@new[##1]{% Make sure to turn #1 into ##1 as the command is nested
+ \pgfutil@g@addto@macro\tikzcd@savedpaths{%
+ \path[/tikz/commutative diagrams/.cd,every arrow,##1,every arrow post]%<--- we added every arrow post
+ (\tikzcd@ar@start\tikzcd@startanchor) to (\tikzcd@ar@target\tikzcd@endanchor); }}%
+ \fi%
+ \fi%
+ % We make sure "every arrow post" exists:
+ \tikzset{%
+ /tikz/commutative diagrams/every arrow post/.append style={}%
+ }%
+ \pgfsetlayers{background,belownodelayer,edgelayer,nodelayer,main,abovenodelayer,box,labellayer,foreground}% Layers are defined locally to avoid to disturb other drawings
+ %% Provide a way to reference the current diagram. This way it is for instance possible to do
+ %% \ar[from=Zbotright, to=\zxCurrentDiagram-1-1]
+ %% For this to work, you should not modify the name of the matrix.
+ %% Old way
+ % \def\zxCurrentDiagram{tikz@f@\the\tikz@fig@count}%Does not exists yet... Hopefully it's updated soon enough
+ % Should be equivalent but might even work if we change the name of the matrix, hopefully we only use it at the right time.
+ % Also, when drawing the lines, we are not anymore inside the tikzmatrix, but tikzcdmatrixname contains the name of the matrix instead:
+ \def\zxCurrentDiagram{\ifdefined\tikzmatrixname\tikzmatrixname\else\tikzcdmatrixname\fi}%
+ % \pgfutil@g@addto@macro\tikzcd@before@paths@hook{%
+ % \def\zxCurrentDiagram{\tikzcdmatrixname}%
+ % }%
+ % the problem with \tikzcdmatrixname is that it is only defined at the end, once the matrix is built
+ % We provide a way to get the current matrix name:
+ \begin{tikzcd}[%
+ /zx/defaultEnv,%
+ #1]%
+ }{\end{tikzcd}%
+ \global\let\tikzcd@before@paths@hook\pgfutil@empty%
+ \global\let\tikzcd@savedpaths\pgfutil@empty%
+ \egroup}
+
+% https://tex.stackexchange.com/a/619983/116348
+\ExplSyntaxOn
+%%%%% Shortcut macro \zxNoExt{...} equivalent to \begin{ZX}...\end{ZX}
+%%%%% We will create an alias \zx, but when we use externalization we
+%%%%% wrap it around a figure.
+\NewDocumentCommand{\zxNoExt}{O{}+m}{% Warning, expl syntax removes space.
+ \tl_rescan:nn { \char_set_catcode_active:N \& } { \begin{ZXNoExt}[#1] #2 \end{ZXNoExt} }
}
+\ExplSyntaxOff
-% Useful to link two nodes and put a vdots in between.
-\NewExpandableDocumentCommand{\middleManyDots}{}{%
- \ar[r,3 vdots] \ar[o',r] \ar[o.,r]%
+%% Version to use when using externalize (it wraps it around a
+\NewDocumentCommand{\zxExt}{O{}O{}O{}+m}{% Warning, expl syntax removes space.
+ \begin{tikzpicture}[baseline=(zxlibrarymainnode.base),#2]%
+ \node(zxlibrarymainnode)[inner sep=0pt,outer sep=0pt,#3]{\zxNoExt[#1]{#4}};%
+ \end{tikzpicture}%
}
-% Like \leftManyDots but on the right. Do *not* create a new node, like in |[zxShortZ]| \alpha \rightManyDots{m}
-\NewExpandableDocumentCommand{\rightManyDots}{O{1}O{\zxScaleDots}m}{%
- \ar[r,N'-,end anchor=north west] \ar[r,N.-,end anchor=south west] \pgfmatrixnextcell[\zxwCol] |[zxNone+,inner xsep=0pt]| \makebox[0pt][r]{\scalebox{#2}{$\cvdotsCenterMathline$}}\scalebox{#1}{\,$#3$}
+\NewDocumentEnvironment{ZXExt}{O{}O{}O{}b}{%
+ \zxExt[#1][#2][#2]{#4}%
+}{}%
+
+\NewDocumentEnvironment{ZX}{O{}O{}O{}b}{%
+ \zx[#1][#2][#3]{#4}%
+}{}
+
+% The external library is not compatible with tikzcd directly.
+% So if:
+% \zx@external@mode is enabled, we wrap the figure into another figure to be compatible with tikz externalize
+% otherwise, we check if the external library is loaded, and disable it temporarily.
+\NewDocumentCommand\zx{O{}O{}O{}+m}{%
+ {%
+ % Suffix for pictures made only with zx when using the external library
+ \ifdefined\tikz@library@external@loaded% Library external is loaded...
+ \ifdefined\zx@external@suffix%
+ \tikzappendtofigurename{\zx@external@suffix}%
+ \fi%
+ \fi%
+ \ifdefined\zx@external@mode%
+ % We wrap everything around figures and enable tikz external (useful when many figures
+ % are not compatible with external):
+ \ifthenelse{\equal{\zx@external@mode}{wrapForceExt}}{%
+ {\tikzexternalenable\zxExt[#1][#2][#3]{#4}}%
+ }{%
+ \ifthenelse{\equal{\zx@external@mode}{wrap}}{% We wrap everything around figures to be compatible with external
+ \zxExt[#1][#2][#3]{#4}%
+ }{% We don't wrap anything inside figures, so we lose external compatibility.
+ \ifthenelse{\equal{\zx@external@mode}{noWrapNoExt}}{%
+ % We disable the tikz external library temporarily (tikzcd is not compatible with it)
+ \ifdefined\tikz@library@external@loaded% Library external is loaded...
+ \tikzexternaldisable%
+ \message{WARNING: you chose to disable temporarily the tikz external library.}%
+ \fi%
+ }{}%
+ \zxNoExt[#1]{#4}%
+ }%
+ }%
+ \else% Mode auto enabled
+ {% If the tikz library is loaded:
+ \ifdefined\tikz@library@external@loaded% Library external is loaded...
+ \zxExt[#1][#2][#3]{#4}%
+ \else%
+ \zxNoExt[#1]{#4}%
+ \fi%
+ }%
+ \fi%
+ }%
+}
+
+%% By default, the error displayed when compiling using "external"
+%% is not meaningful and does not stop if a picture already exists.
+%% https://tex.stackexchange.com/questions/633100/stop-at-error-meaningfull-errors-with-shell-escape-and-tikz-externalize/633121#633121
+%% See also this bug, that shows that if you have an error and compile twice, the error disappears, but the old file is used instead.
+%% https://github.com/pgf-tikz/pgf/issues/1137
+\NewDocumentCommand\zxConfigureExternalSystemCall{O{}}{
+ %% Code inspired by https://github.com/pgf-tikz/pgf/blob/a7b45b35e99af11bf7156aa3697b897b98870e5b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex#L277
+ \expandafter\def\csname zx@driver@pgfsys-luatex.def\endcsname{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ lualatex \tikzexternalcheckshellescape #1 -jobname "\image" "\texsource"%
+ }%
+ }%
+ \expandafter\def\csname zx@driver@pgfsys-pdftex.def\endcsname{%
+ \pgfutil@IfUndefined{directlua}{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ pdflatex \tikzexternalcheckshellescape #1 -jobname "\image" "\texsource"%
+ }%
+ }{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ lualatex \tikzexternalcheckshellescape #1 -jobname "\image" "\texsource"%
+ }%
+ }%
+ }%
+ \expandafter\def\csname zx@driver@pgfsys-xetex.def\endcsname{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ xelatex \tikzexternalcheckshellescape #1 -jobname "\image" "\texsource"%
+ }%
+ }%
+ \expandafter\def\csname zx@driver@pgfsys-dvips.def\endcsname{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ latex \tikzexternalcheckshellescape #1 -jobname "\image" "\texsource" %
+ && dvips -o "\image".ps "\image".dvi %
+ }%
+ }%
+ % Auto-select a suitable default value fo 'system call':
+ \pgfutil@ifundefined{tikzexternal@driver@\pgfsysdriver}{%
+ % fallback. We do not know the driver here.
+ \csname zx@driver@pgfsys-pdftex.def\endcsname
+ }{%
+ \csname zx@driver@\pgfsysdriver\endcsname
+ }%
+}
+
+% Call zxConfigureExternalSystemCall with the same system call as the calling program
+% Useful otherwise the error may be missed (for instance errorstopmode works in pdflatex but not in
+% emacs, and nonstopmode works in emacs, but not in pdflatex).
+% The current mode is stored in \interactionmode, 0, 1, 2, 3 corresponding respectively to batch, nonstop, scroll or errorstop.
+% https://tex.stackexchange.com/questions/91592/where-to-find-official-and-extended-documentation-for-tex-latexs-commandlin
+\NewDocumentCommand\zxConfigureExternalSystemCallAuto{}{%
+ \ifnum\interactionmode=0 %
+ \zxConfigureExternalSystemCall[-interaction=batchmode]%
+ \fi%
+ \ifnum\interactionmode=1 %
+ \zxConfigureExternalSystemCall[-interaction=nonstopmode]% emacs
+ \fi%
+ \ifnum\interactionmode=2 %
+ \zxConfigureExternalSystemCall[-interaction=scrollmode]%
+ \fi%
+ \ifnum\interactionmode=3 %
+ \zxConfigureExternalSystemCall[-interaction=errorstopmode]% pdflatex by default
+ \fi%
+}
+
+
+\ifdefined\zxDoNotPatchSystemCall\else%
+ \zxConfigureExternalSystemCallAuto
+\fi
+
+% \zx@external@mode can be undefined (=auto), wrap or nowrap.
+
+%% Automatically check if the external library is loaded, and use it.
+\NewDocumentCommand\zxExternalAuto{}{%
+ \let\zx@external@mode\undefined%
+}
+
+%% Force to wrap the ZX figures around a figure to ensure compatibility with external.
+\NewDocumentCommand\zxExternalWrap{}{%
+ \def\zx@external@mode{wrap}%
+}
+
+%% Do not wrap the ZX figures around another figure (not compatible with external)
+\NewDocumentCommand\zxExternalNoWrap{}{%
+ \def\zx@external@mode{nowrap}%
+}
+
+%% Do not wrap the ZX figures, but disable external for these figures (semi-compatible with external)
+\NewDocumentCommand\zxExternalNoWrapNoExt{}{%
+ \def\zx@external@mode{noWrapNoExt}%
+}
+
+%% Wrap the ZX figures, and enable external for these figures (useful when most other environments
+%% are not compatible with tikz external)
+\NewDocumentCommand\zxExternalWrapForceExt{}{%
+ \def\zx@external@mode{wrapForceExt}%
}
+% Mode auto is enabled by default
+\zxExternalAuto
+
+\NewDocumentCommand\zxExternalSuffix{m}{
+ \ifthenelse{\equal{#1}{}}{% Nothing submitted: we erase the suffix
+ \let\zx@external@suffix\undefined%
+ }{%
+ \def\zx@external@suffix{#1}
+ }%
+}
+
+\zxExternalSuffix{zx}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Custom nodes from Pic
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% It is quite complicated to define custom node shapes, especially when using anchors. Here, we define a
+%% Way to easily create a custom node from a picture.
+
+%% This code allows to add a new anchor to a given node:
+%% https://tex.stackexchange.com/a/676090/116348
+\tikzset{
+ zx add anchor to node/.code n args={3}{%
+ \edef\tikz@temp##1{% \tikz@pp@name/\tikzlastnode needs to be expanded
+ %% This codes does the following thing:
+ %% First, it modifies the "\pgf@anchor@rectangle@fake center west" macro (rectangle might be another shape,
+ %% same for anchor). But since this macro might be different between nodes sharing the same shape,
+ %% it adds it to a per-node macro called like \pgf@sh@ma@tikz@f@3-2-2 (tikz@f@3-2-2 is the name of the
+ %% node).
+ \noexpand\pgfutil@g@addto@macro\expandafter\noexpand\csname pgf@sh@ma@\tikz@pp@name{#1}\endcsname{%
+ \def\expandafter\noexpand\csname pgf@anchor@\csname pgf@sh@ns@\tikz@pp@name{#1}\endcsname @#2\endcsname{##1}%
+ }%
+ }%
+ \tikz@temp{#3}%
+ },
+ zx add anchor to pic default/.style={/tikz/zx add anchor to pic={#1}{#1}},
+ zx add anchor to pic/.code 2 args={%
+ % If base coordinate isn't created yet, do so at (0,0)
+ % in the current coordinate system!
+ \pgfutil@ifundefined{pgf@sh@ns@\tikz@pp@name{}}{%
+ \pgfcoordinate{\tikz@pp@name{}}{\pgfpointorigin}%
+ }{}%
+ \begingroup
+ % What is the distance between coordinate and base?
+ % We have to do this in the coordinate system of the base coordinate.
+ \pgfsettransform{\csname pgf@sh@nt@\tikz@pp@name{}\endcsname}%
+ \pgf@process{\pgfpointanchor{\tikz@pp@name{#2}}{center}}%
+ % This distance is the new anchors coordinate
+ % in the base's coordinate system.
+ % Adding an anchor to a node must be global
+ % which is why we can do this inside the group.
+ \pgfkeysalso{
+ /tikz/zx add anchor to node/.expanded=%
+ {}{#1}{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ }%
+ \endgroup
+ }%
+}
+
+%%% Create automatically a new pic-based node
+%%% \zxNewNodeFromPic{nameOfNode}[default style before user][default style after user]{content of the pic}
+%%% - In 'default style before user', we can put any style that is given to the pic (e.g. colors, rotate, scale…)
+%%% or even custom properties that will be read by the pic (e.g. to allow the define the number of spikes of a
+%%% star). This style can notably have "zx create anchors={a, list, of, coordinates, to, turn, into, anchors}"
+%%% that will automatically turn any coordinate in the pic in the list of coordinates into an anchor of the
+%%% parent node.
+%%% - In 'default style after user', the style is run after the code provided by the user. In particular, you can
+%%% use "invert top bottom" to invert the "top" version with the "bottom" version (rotation is minus 90 instead
+%%% of 90 for instance).
+\NewDocumentCommand{\zxNewNodeFromPic}{mO{}O{}O{}O{}m}{%
+ \tikzset{%
+ #1Pic/.pic={%
+ #6%
+ % The user can even add more stuff to draw after if needed by redefining this macro:
+ \ifdefined\zxCustomPicAdditionalPic\zxCustomPicAdditionalPic\fi%
+ \tikzset{%
+ % We store the list of anchors to create into \zxListOfNewAnchors. If it does not exist we create it:
+ /utils/exec={\ifdefined\zxListOfNewAnchors\else\def\zxListOfNewAnchors{}\fi},
+ % We add the coordinates in \zxListOfNewAnchors as anchors for the node
+ zx add anchor to pic default/.list/.expanded={\zxListOfNewAnchors}}%
+ },%
+ #1/.style={%
+ %shape=coordinate, %yshift=axis_height, %% already applied
+ #4,
+ append after command={%
+ pic[
+ % We configure the name and position of the pic
+ at=(\tikzlastnode), name=\tikzlastnode,
+ % We create a command to add anchors via zx create anchors={my, list, of, anchors}. This way, it also allows dynamic anchors using
+ % the default style after user.
+ zx create anchors/.store in={\zxListOfNewAnchors},
+ zx create anchors={},
+ % We create a new style to apply to the main node
+ zx main node/.style={
+ name=,
+ zx forward to node/.append style={},
+ zx forward to node,
+ },
+ % We load the other default arguments:
+ #2,
+ % We try to load a potentially global style configured by the user (mostly used to override this library)
+ /zx/picCustomStyleBeforeUser#1/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleBeforeUser#1,
+ % We load the per-instance arguments:
+ ##1,
+ % We try to load a potentially global style configured by the user (mostly used to override this library)
+ /zx/picCustomStyleAfterUser#1/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleAfterUser#1,
+ #3,
+ % We try to load a potentially global style configured by the user (mostly used to override this library)
+ /zx/picCustomStyleLastPic#1/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleLastPic#1,
+ ]{#1Pic}%
+ },
+ }%
+ }%
+ %% \ExpandArgs{c} is an equivalent of expandafter + csname, to expand the first argument before evaluating the function:
+ %% https://tex.stackexchange.com/a/676103/116348
+ %% ##1: pic additional style
+ %% ##2: node additional style
+ %% ##3: text to consume with \tikzpictext
+ % \ExpandArgs{c}\NewExpandableDocumentCommand{zx#1}{t.t-t'O{}O{}m}{%
+ % |[#1={pic text={##6}, ##4}, ##5]|%
+ % }%
+ % Actually ExpandArgs is not available before ~2023? maybe, so let’s use expandafter
+ \expandafter\NewExpandableDocumentCommand\csname zx#1\endcsname{O{}O{}t.t-t't/t*e_m}{%
+ \node[zx main node, #1={
+ pic text={##9},
+ %% The alias=… should rather be called on the second element. But it's quite handy to write it here, so here we go:
+ a/.style={%
+ zx forward to node/.append style={
+ a={########1},
+ },
+ },
+ %% The mode stored in \zxRotationMode contains the current rotation mode (i.e. the angle between 0 and 359, typically 0,90,180,270),
+ %% to allow further tweaks (for instance, a pic might be mirrored instead of rotated by 180° when using the parameter -, and this
+ %% can be configured by reading this variable).
+ /utils/exec={%
+ \def\zxCurrentRotationMode{0}%
+ %%% Fake center is mostly for curves like <', and true north/ is mostly for curves like C, C'...
+ %%% These anchor name are changed depending on the rotation: the north/… is before the rotation.
+ \def\zxVirtualCenterNorth{fake center north}%
+ \def\zxVirtualCenterSouth{fake center south}%
+ \def\zxVirtualCenterEast{fake center east}%
+ \def\zxVirtualCenterWest{fake center west}%
+ \def\zxTrueNorth{true north}%
+ \def\zxTrueSouth{true south}%
+ \def\zxTrueEast{true east}%
+ \def\zxTrueWest{true west}%
+ \IfBooleanT{##3}{%
+ \def\zxCurrentRotationMode{90}%
+ \def\zxVirtualCenterNorth{fake center west}%
+ \def\zxVirtualCenterSouth{fake center east}%
+ \def\zxVirtualCenterEast{fake center north}%
+ \def\zxVirtualCenterWest{fake center south}%
+ \def\zxTrueNorth{true west}%
+ \def\zxTrueSouth{true east}%
+ \def\zxTrueEast{true north}%
+ \def\zxTrueWest{true south}%
+ }%
+ \IfBooleanT{##4}{%
+ \def\zxCurrentRotationMode{180}%
+ \def\zxVirtualCenterNorth{fake center south}%
+ \def\zxVirtualCenterSouth{fake center north}%
+ \def\zxVirtualCenterEast{fake center west}%
+ \def\zxVirtualCenterWest{fake center east}%
+ \def\zxTrueNorth{true south}%
+ \def\zxTrueSouth{true north}%
+ \def\zxTrueEast{true west}%
+ \def\zxTrueWest{true east}%
+ }%
+ \IfBooleanT{##5}{%
+ \def\zxCurrentRotationMode{270}%
+ \def\zxVirtualCenterNorth{fake center east}%
+ \def\zxVirtualCenterSouth{fake center west}%
+ \def\zxVirtualCenterEast{fake center south}%
+ \def\zxVirtualCenterWest{fake center north}%
+ \def\zxTrueNorth{true east}%
+ \def\zxTrueSouth{true west}%
+ \def\zxTrueEast{true south}%
+ \def\zxTrueWest{true north}%
+ }%
+ \IfBooleanT{##6}{%
+ \def\zxModeSlash{}%
+ }%
+ \IfBooleanT{##7}{%
+ \def\zxModeStar{}%
+ }%
+ % Embellishments can contain something like \zxMynode_{Text A}{Text B}
+ \IfNoValueTF{##8}{}{%
+ \def\zxModeUnderscore{##8}%
+ }%
+ },
+ rotate=\zxCurrentRotationMode,%
+ %%% Sometimes it can be quite handy to invert the top and the bottom version if it does not match with the
+ %%% intuitive position it should have.
+ %%% Make sure to call this in the second optional parameter (after user style)
+ invert top bottom/.style={
+ rotate=-\zxCurrentRotationMode,
+ /utils/exec={%
+ \ifnum\zxCurrentRotationMode=90\relax
+ \def\zxCurrentRotationMode{270}%
+ \else
+ \ifnum\zxCurrentRotationMode=270\relax
+ \def\zxCurrentRotationMode{90}%
+ \fi
+ \fi
+ },
+ rotate=\zxCurrentRotationMode,%
+ },%
+ invert right left/.style={
+ rotate=-\zxCurrentRotationMode,
+ /utils/exec={%
+ \ifnum\zxCurrentRotationMode=0\relax
+ \def\zxCurrentRotationMode{180}%
+ \else
+ \ifnum\zxCurrentRotationMode=180\relax
+ \def\zxCurrentRotationMode{0}%
+ \fi
+ \fi
+ },
+ rotate=\zxCurrentRotationMode,%
+ },%
+ ##1}, #5, ##2]{};%
+ }%
+}%
+
+%% Useful to increase or decrease the bounding box of a custom node.
+%% Parameters are like extend=5mm (that extends on all directions), and similarly for top/bottom/left/right/horizontal/vertical
+\NewExpandableDocumentCommand{\zxExtendBoundingBox}{m}{%
+ \pgfkeys{
+ /zx/.cd,
+ left/.store in=\zx@left,
+ left=0pt,
+ right/.store in=\zx@right,
+ right=0pt,
+ top/.store in=\zx@top,
+ top=0pt,
+ bottom/.store in=\zx@bottom,
+ bottom=0pt,
+ horizontal/.style={
+ left=##1,
+ right=##1,
+ },
+ vertical/.style={
+ /zx/top=##1,
+ /zx/bottom=##1,
+ },
+ extend/.style={
+ vertical=##1,
+ horizontal=##1,
+ },
+ #1,
+ }%
+ \path[use as bounding box] ([xshift=-\zx@left,yshift=\zx@top]current bounding box.north west)
+ rectangle ([xshift=\zx@right,yshift=-\zx@bottom]current bounding box.south east);%
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Some special nodes based on \zxNewNodeFromPic
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Ground symbol
+\zxNewNodeFromPic{Ground}[scale=\zxGroundScale][invert top bottom]{
+ \draw[line width=\zxDefaultLineWidth]
+ (0,0) -- (1mm,0)
+ -- +(0,1mm) -- +(0,-1mm)
+ ++(.4mm,0)
+ -- +(0,.7mm) -- +(0,-.7mm)
+ ++(.4mm,0)
+ -- +(0,.35mm) -- +(0,-.35mm);
+ \coordinate() at (0,0); % Empty coordinate make the center start at the right position
+}
+
+%% From scalable ZX calculus
+\zxNewNodeFromPic{Divider}[][
+ % Because of the rounded corners, the lines will stop before touching the shape when arriving on the angle. So we force such nodes to be drawn below
+ % the shape, targeting a point inside the node.
+ %post arrow style if end node/.expanded={% we need to expand everything before setting the style, as this style will be executed much later in the arrow,
+ post arrow style if end node={% if the text contains macro like \zxVirtualCenterWest use post arrow style if end node/.expanded instead as these macro
+ % will not exist anymore once the line is drawn
+ on layer=edgelayer,%
+ end anchor if not set=fake center north,
+ },%
+ post arrow style if start node={% if the text contains macro like \zxVirtualCenterWest use post arrow style if end node/.expanded instead as these macro
+ % will not exist anymore once the line is drawn
+ on layer=edgelayer,%
+ start anchor if not set=fake center south,
+ },%
+ zx create anchors={\zxVirtualCenterWest, \zxVirtualCenterEast, \zxVirtualCenterNorth, \zxVirtualCenterSouth},
+ every node/.append style={transform shape}
+]{
+ \node[regular polygon, regular polygon sides=3,shape border rotate=90, draw=black,fill=gray!50, inner sep=1.6pt, rounded corners=0.8mm,zx main node] {};
+ \coordinate(\zxVirtualCenterEast) at (.2mm,0); % Used to start lines on the side of the shape
+ \coordinate(\zxVirtualCenterWest) at (-1mm,0);
+ \coordinate(\zxVirtualCenterNorth) at (\zxVirtualCenterWest); % Synonyme, useful to determine where to start
+ \coordinate(\zxVirtualCenterSouth) at (\zxVirtualCenterEast); % Synonyme, useful to determine where to start
+}
+
+%% Matrix symbol
+\zxNewNodeFromPic{Matrix}
+ [
+ % As we want - to only swap the position of the label but not the rotation (we use * already for transpose)
+ % we disable the above rotation:
+ rotate=-\zxCurrentRotationMode,
+ % Otherwise the space between colums is too big
+ /utils/exec={\setlength\arraycolsep{1pt}},
+ ][zx create anchors={true north,true south,true east,true west}]{
+ \node[zx main node, draw, signal, fill=colorZxMatrix, inner sep=1pt, minimum height=6pt, transform shape,
+ % The direction of the shape is turned when using the * symbol (transpose).
+ signal to/.expanded={\ifdefined\zxModeStar west\else east\fi},
+ signal from/.expanded={\ifdefined\zxModeStar east\else west\fi},
+ % We disabled the default rotation (* is for transpose), but we still want to rotate it to read to/down:
+ rotate/.expanded={mod(-\zxCurrentRotationMode,180)},
+ % If we want the syntax \zxMatrix{45:f} to put f at 45 degrees, we want to expand \tikzpictext
+ % *before* to read the key, hence the need for expanded.
+ label/.expanded={[
+ inner sep=2pt,
+ % The position of the label is independent of the rotation, but depends on the rotation mode ('.-):
+ absolute,
+ label position=\ifdefined\zxLabelAngle \zxLabelAngle\else 90+\zxCurrentRotationMode\fi,
+ font=\noexpand\footnotesize, % We don't want to expand \footnotesize before defining the label
+ % we use the / decoration
+ overlay/.expanded={\ifdefined\zxModeSlash true\else false\fi},
+ % Math mode by default:
+ execute at begin node=$, execute at end node=$,
+ /zx/picCustomStyleMatrixLabel/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleMatrixLabel,
+ ]
+ % We put as the label the text directly. Note that \unexpanded\expandafter expands the next token only once
+ % as if it gets expanded further, we can get errors (e.g.\ with pmatrix)
+ \unexpanded\expandafter{\tikzpictext}
+ \ifdefined\zxModeUnderscore\noexpand\begin{bmatrix}\noexpand\zxModeUnderscore\noexpand\end{bmatrix}\fi
+ },
+ /zx/picCustomStyleMatrixMainNode/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleMatrixMainNode,
+ ]{};
+ \coordinate(true east) at (.east); % Used to start lines on the side of the shape
+ \coordinate(true west) at (.west);
+ \coordinate(true north) at (true west); % Synonyme, useful to determine where to start
+ \coordinate(true south) at (true east); % Synonyme, useful to determine where to start
+}
+
+%% Gates
+
+\pgfkeys{
+ /zx/every box/.style={
+ draw,
+ inner sep=1.3mm,
+ rectangle,
+ zx filling style,
+ zx thickness wires style,
+ % not sure why, but seems to be already in math mode (maybe global options), and writing it twice disturbs the system
+ % execute at begin node=$, execute at end node=$,
+ execute at begin node={\renewcommand{\arraystretch}{1}\setlength\arraycolsep{2pt}},
+ zxNormalFont,
+ minimum width=\zxBoxMinimumWidth,
+ minimum height=\zxBoxMinimumHeight,
+ },
+ % https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+ /zx/boxes/.code={%
+ \scantokens{%
+ \pgfkeysalso{%
+ /zx/every box/.append style={#1}%
+ }%
+ }%
+ },
+ /zx/box load style/.style={
+ add label advanced/.style 2 args={
+ label={[inner sep=1.8pt,zxTinyFont,##1]##2},
+ },
+ add label/.style={
+ add label advanced={}{##1},
+ },
+ },
+}
+
+\NewExpandableDocumentCommand{\zxBox}{O{}m}{
+ \node[%
+ zx main node,
+ zx at origin,
+ alias=zxTmp,
+ /zx/box load style,
+ /zx/every box,%
+ #1%
+ ]{#2};%
+ % Nicer if you want '> to work
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center north};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center south};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center east};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center west};%
+}
+
+
+\NewCommandCopy\zxGate\zxBox
+
+\pgfkeys{
+ /zx/every elt/.style={
+ zx main node,
+ minimum width=\zxEltMinimumWidth,
+ minimum height=\zxEltMinimumHeight,
+ },
+ % https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+ /zx/elts/.code={%
+ \scantokens{%
+ \pgfkeysalso{%
+ /zx/every elt/.append style={#1}%
+ }%
+ }%
+ },
+ /zx/elt load style/.style={
+ add label advanced/.style 2 args={
+ label={[inner sep=1.8pt,zxTinyFont,##1]##2},
+ },
+ add label/.style={
+ add label advanced={}{##1},
+ },
+ },
+}
+
+\NewExpandableDocumentCommand{\zxElt}{O{}m}{
+ \node[%
+ zx main node,
+ zx at origin,
+ alias=zxTmp,
+ /zx/elt load style,
+ /zx/every elt,%
+ #1%
+ ]{#2};%
+ % Nicer if you want '> to work
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center north};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center south};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center east};%
+ \zxCoordinateSubnode[at={(zxTmp.center)}]{fake center west};%
+}
+
+
+% \NewExpandableDocumentCommand{\zxEltMulti}{O{}mmm}{
+% \zxGateMulti[#1]{#2}{#3}{#4}
+% }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Gate Multi (user part)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\NewExpandableDocumentCommand{\zxGenericMulti}{m}{%
+ \path;%
+ \pgfkeys{%
+ /zx/generic multi/.cd,%
+ %%% Some default styles
+ /tikz/cleanup style for measure node/.style={
+ a/.style={},%
+ },
+ cleanup style for fit node/.store in=\zx@cleanupStyleFitNode,
+ cleanup style for fit node={},
+ %%% this part is mostly used by the wrapping macro (e.g. to create \zxGateMulti)
+ command to run to measure node/.store in=\zx@commandToRunToMeasureNode,
+ command to run to create inner nodes/.store in=\zx@commandToRunToCreateInnerNodes,
+ command to run to create the fit node/.store in=\zx@commandToCreateTheFitNode,
+ command to run to create the main label/.store in=\zx@commandToCreateTheMainLabel,%
+ minimum height inner nodes/.store in=\zx@minimumHeightInnerNodes,
+ minimum width inner nodes/.store in=\zx@minimumWidthInnerNodes,
+ number rows/.store in=\zx@nbRows,
+ number columns/.store in=\zx@nbColumns,%
+ %%% this part can be used by the end user, and may be used inside the above commands
+ %%% Note that the wrapping macro should also initialize these values that might be changed by the user
+ %%% It might seem like this part is redundant, but not really, as this part can be changed by the user
+ %%% and is more fine grained that the above commands
+ content inner nodes/.store in=\myContent,
+ %%% TODO: in the function: content inner nodes={#4},
+ style inner nodes/.store in=\zx@genericMultiStyle,
+ style inner nodes={},
+ % this will be set by fit content not to override the user value
+ before style inner nodes/.store in=\zx@genericBeforeStyleInnerNodes,
+ before style inner nodes={},
+ % style for the main style
+ main/.store in=\zx@genericMultiMainStyle,
+ main={},
+ main text/.store in=\zx@genericMultiMainTextStyle,
+ main text={},
+ original content/.store in=\zx@GenericMultiOriginalContent,
+ % Run additional code after the last \node
+ additional code/.store in=\zx@genericMultiAdditionalCode,
+ additional code=,
+ do not run fit content/.code={\def\zx@donotrunfitcontent{}},
+ run fit content/.code={\let\zx@donotrunfitcontent\undefined},
+ run fit content,
+ % This will compute the size of the content, and adapt the width of the inner nodes
+ % leaving around a margin specified in the 2 first arguments (row/column), the last argument is the minimum width of the inner nodes
+ % note that we take as a reference the content of \pgfmatrixcolumnsep which might not be constant: if you change the width of the columns,
+ % you are on your own.
+ fit content/.code n args={4}{
+ % New version:
+ \begin{lrbox}{\zx@tmp@box}%
+ \begin{pgfinterruptpicture}%
+ \begin{pgfpicture}%
+ \zx@commandToRunToMeasureNode%
+ \end{pgfpicture}%
+ \end{pgfinterruptpicture}%
+ \end{lrbox}%
+ % % we measure the content of the box (##x appears 2 times since we have left and right margins):
+ \edef\zx@totalheight{\the\dimexpr\ht\zx@tmp@box + \dp\zx@tmp@box + ##1 + ##1\relax}%
+ \edef\zx@width{\the\dimexpr\wd\zx@tmp@box + ##2 + ##2\relax}%
+ \edef\zx@width{\the\dimexpr\wd\zx@tmp@box\relax}%
+ % \show\zx@totalheight
+ % \show\zx@width
+ %% We compute now the width/total height of each node. Basically, we have #3 blocks, and #3-1 column separations, so we want to find x such that:
+ %% x*#2 + (#2-1)*\pgfmatrixcolumnsep = \zx@width, i.e.
+ %% x = (\zx@width - (#2-1)*\pgfmatrixcolumnsep)/#2,
+ \pgfmathsetmacro{\zx@final@width@block}{max(##4,(\zx@width - (\zx@nbColumns-1)*\pgfmatrixcolumnsep)/(\zx@nbColumns))}%
+ \pgfmathsetmacro{\zx@final@height@block}{max(##3,(\zx@totalheight - (\zx@nbRows-1)*\pgfmatrixrowsep)/(\zx@nbRows))}%
+ \pgfkeysalso{%
+ content inner nodes={},
+ before style inner nodes/.expanded={
+ inner sep=0pt,
+ outer sep=0pt,
+ % opacity=0,
+ minimum width=\zx@final@width@block pt,
+ minimum height=\zx@final@height@block pt,
+ },
+ % we disable it not to run it more than once in case the user decided to run it
+ do not run fit content,
+ }%
+ },
+ fit content/.default={0mm}{0mm}{\zx@minimumHeightInnerNodes}{\zx@minimumWidthInnerNodes},
+ safe fit/.style={
+ before style inner nodes={},
+ content inner nodes/.expand once={\zx@GenericMultiOriginalContent},
+ do not run fit content,
+ },
+ #1,
+ /utils/exec={
+ \ifdefined\zx@donotrunfitcontent\else%
+ \pgfkeysalso{fit content}%
+ \fi%
+ },
+ }%
+ % Store the content for letter use
+ \zxSetVariableExpandOnce{content inner nodes}{\myContent}%
+ \zxSetVariableExpandOnce{style inner nodes}{\zx@genericMultiStyle}%
+ \zxSetVariableExpandOnce{before style inner nodes}{\zx@genericBeforeStyleInnerNodes}%
+ \zxSetVariableExpandOnce{style main node}{\zx@genericMultiMainStyle}%
+ \zxSetVariableExpandOnce{style main text node}{\zx@genericMultiMainTextStyle}%
+ \zxSetVariableExpandOnce{additional code}{\zx@genericMultiAdditionalCode}%
+ \zxSetVariableExpandOnce{command to run to create inner nodes}{\zx@commandToRunToCreateInnerNodes}%
+ \zxSetVariableExpandOnce{command to run to create the fit node}{\zx@commandToCreateTheFitNode}%
+ \zxSetVariableExpandOnce{command to run to create the main label}{\zx@commandToCreateTheMainLabel}%
+ \zxSetVariableExpandOnce{cleanup style for fit node}{\zx@cleanupStyleFitNode}%
+ \zxExecuteAtRegionRelativeAndOrigin{\zx@nbRows}{\zx@nbColumns}{%
+ \zxGetVariable{command to run to create inner nodes}%
+ }%
+ \zxExecuteAtEndPicture{%
+ % We cannot use fit directly as it misplace the text. According to the doc, we should place the text using another intermediate node:
+ \scantokens{%
+ \zxGetVariable{command to run to create the fit node}%
+ \zxGetVariable{command to run to create the main label}%
+ \zxGetVariable{additional code}%
+ }%
+ }
+}
+
+% the first style is kind of the style that is applied by default to the elements when
+% it makes sense, but for most precise stuff use the second argument that can individually address other
+% elements
+\NewExpandableDocumentCommand{\zxGateMulti}{O{}O{}mmm}{%
+ \zxGenericMulti{
+ command to run to measure node={%
+ \zxBox[%
+ % we disable a here since we do not want to use alias when measuring the node
+ cleanup style for measure node,
+ % Similarly, measuring nodes should not be done here
+ add label advanced/.style 2 args={},
+ % label already exists
+ add label/.style={},
+ #1%
+ ]{#5}%
+ },
+ original content={#5},
+ command to run to create inner nodes={
+ \zxBox[%
+ opacity=0,
+ zx style from variable={before style inner nodes},
+ zx style from variable={style inner nodes},
+ ]{\zxGetVariable{content inner nodes}}
+ },
+ command to run to create the fit node={%
+ \node[
+ /zx/box load style,
+ /zx/every box,%
+ zx style from variable={cleanup style for fit node},
+ add label advanced/.style 2 args={
+ label={[align=center,inner sep=1.8pt,zxTinyFont,####1]####2},
+ },
+ % label already exists
+ add label/.style={
+ add label advanced={}{####1},
+ },
+ #1,% this can set the alias for instance
+ inner sep=0pt,
+ minimum width=0pt,
+ minimum height=0pt,
+ alias=zxMainNode,%needed to place the main label
+ fit=(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{\the\numexpr#3-1\relax}{\the\numexpr#4-1\relax}),
+ zx style from variable={style main node},
+ ]{};%
+ },
+ command to run to create the main label={
+ \node[
+ rectangle,
+ zxNormalFont,
+ execute at begin node=$,
+ execute at end node=$,
+ % alias should be set on the fit node, not here:
+ a/.style={},
+ alias/.style={},
+ % Similarly, measuring nodes should not be done here
+ add label advanced/.style 2 args={},
+ % label already exists
+ add label/.style={},
+ #1,% needed for instance for the block stuff
+ % We disable stuff that should rather be set for the fit node
+ draw=none,
+ fill=none,
+ at=(zxMainNode.center),
+ alias=zxMainNodeText,
+ zx style from variable={style main text node}]{#5};
+ },%
+ minimum height inner nodes={\zxBoxMinimumHeight},
+ minimum width inner nodes={\zxBoxMinimumWidth},
+ number rows={#3},
+ number columns={#4},
+ #2,
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Circuit-related gates
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\tikzset{
+ zx filling style/.style={
+ fill=white
+ },
+ % To change the thickness of wires and boxes at the same time
+ zx thickness wires style/.style={
+ },
+}
+
+\NewExpandableDocumentCommand{\zxCtrl}{O{}m}{%
+ \node[zx main node, circle, inner sep=2pt, fill=black, #1]{};
+}
+
+% white ctrl
+\NewExpandableDocumentCommand{\zxOCtrl}{O{}m}{%
+ \node[zx main node, circle, inner sep=2pt, zx filling style, zx thickness wires style, draw, #1]{};
+}
+
+\NewExpandableDocumentCommand{\zxNot}{O{}m}{%
+ \node[zx main node, circle, inner sep=2.5pt, draw, zx filling style, zx thickness wires style, append after command={(\tikzlastnode.north) edge[zx thickness wires style] (\tikzlastnode.south) (\tikzlastnode.east) edge[zx thickness wires style] (\tikzlastnode.west)}, #1]{};
+}
+
+\NewExpandableDocumentCommand{\zxCross}{O{}m}{%
+ \zxCoordinateMain{}
+ \node[at={(0,0)}, rectangle, inner sep=3pt, append after command={(\tikzlastnode.north east) edge[line cap=round,zx thickness wires style] (\tikzlastnode.south west) (\tikzlastnode.south east) edge[line cap=round,zx thickness wires style] (\tikzlastnode.north west)}, #1]{};
+}
+
+% Loosely inspired by
+% https://tex.stackexchange.com/questions/416055/measurement-meter-quantum-circuit-with-tikz
+% Avoid nesting tikz pictures, more efficient, more configurable
+\newsavebox\zxMeterBox
+\begin{lrbox}{\zxMeterBox}%
+ \begin{tikzpicture}[line width=.5,scale=.5]%
+ \draw[line cap=round] (0,0) to[bend left=50] (1,0);%
+ % \draw[line cap=round,-latex] (.5,-.2) to (.7,.8);
+ \draw[line cap=round,-{Stealth[length=6, round]}] (.5,-.15) to (.9,.75);%
+ %\useasboundingbox (-0.1,-.16) (1.1,.9);
+ \end{tikzpicture}%
+\end{lrbox}
+
+\NewExpandableDocumentCommand{\zxMeter}{O{1}m}{%
+ \pgfmathparse{.8*\zxMeterScale*#1}%
+ \scalebox{\pgfmathresult}{\usebox{\zxMeterBox}}%
+}
+
+% ---------------------------------
+% --- (Circuit/Gate) inputs/outputs
+% ---------------------------------
+% I found no great way to pass the style to the label... but it seems like somehow the font color
+% of the parent node is automatically transferred to the label, so the interface is not too bad
+
+\pgfkeys{
+ /zx/input style/.style={
+ align=center,
+ inner sep=2pt,
+ zxNormalFont,
+ anchor=east,
+ },
+}
+
+\def\zx@call@enlarge@brace#1{
+ \ifnum#1=1%
+ \pgfkeysalso{enlarge brace={\zxDefaultEnlargeBraceOne}}%
+ \else%
+ \pgfkeysalso{enlarge brace={\zxDefaultEnlargeBraceMulti}}%
+ \fi%
+}
+
+\NewExpandableDocumentCommand{\zxInput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/input style,#1] at (\zxGetNameRelativeNode{0}{0}){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/output style/.style={
+ align=center,
+ inner sep=2pt,
+ zxNormalFont,
+ anchor=west,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxOutput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/output style,#1] at (\zxGetNameRelativeNode{0}{0}){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/input multi style/.style={
+ decorate,
+ decoration={brace, mirror, raise=2pt},
+ },
+ /zx/input multi label style/.style={swap,outer sep=5pt,zxNormalFont},
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\NewExpandableDocumentCommand{\zxInputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0},
+ to=\zxGetNameRelativeNodeStartOne{#3}{1},
+ /zx/input multi style/.try,
+ enlarge brace/.style={
+ start anchor={[yshift=####1]},
+ end anchor={[yshift=-####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/input multi label style, #2},
+ ]{}
+ }%
+}
+
+\pgfkeys{
+ /zx/output multi style/.style={
+ decorate,
+ decoration={brace, raise=2pt},
+ },
+ /zx/output multi label style/.style={outer sep=5pt,zxNormalFont},
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\def\zxDefaultEnlargeBraceMulti{.75mm}
+\def\zxDefaultEnlargeBraceOne{2mm}
+\NewExpandableDocumentCommand{\zxOutputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0},
+ to=\zxGetNameRelativeNodeStartOne{#3}{1},
+ enlarge brace/.style={
+ start anchor={[yshift=####1]},
+ end anchor={[yshift=-####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ /zx/output multi style/.try,
+ #1,
+ "#4" {/zx/output multi label style, #2},
+ ]{}
+ }%
+}
+
+
+\pgfkeys{
+ /zx/gate input multi style/.style={
+ decorate,
+ decoration={brace, raise=2pt},
+ },
+ /zx/gate input multi label style/.style={
+ outer sep=4pt,
+ zxTinyFontAndSpacing
+ },
+}
+
+
+\NewExpandableDocumentCommand{\zxGateInputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0}.west,
+ to=\zxGetNameRelativeNodeStartOne{#3}{1}.west,
+ /zx/gate input multi style/.try,
+ enlarge brace/.style={
+ start anchor={[yshift=####1]},
+ end anchor={[yshift=-####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/gate input multi label style, #2},
+ ]{}
+ }%
+}
+
+\pgfkeys{
+ /zx/gate output multi style/.style={
+ decorate,
+ decoration={brace, mirror, raise=2pt},
+ },
+ /zx/gate output multi label style/.style={
+ swap,
+ outer sep=4pt,
+ zxTinyFontAndSpacing
+ },
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\NewExpandableDocumentCommand{\zxGateOutputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0}.east,
+ to=\zxGetNameRelativeNodeStartOne{#3}{1}.east,
+ /zx/gate output multi style/.try,
+ enlarge brace/.style={
+ start anchor={[yshift=####1]},
+ end anchor={[yshift=-####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/gate output multi label style, #2},
+ ]{}
+ }%
+}
+
+
+\pgfkeys{
+ /zx/gate output style/.style={
+ align=center,
+ inner sep=2pt,
+ zxTinyFontAndSpacing,
+ anchor=east,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxGateOutput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/gate output style,#1] at (\zxGetNameRelativeNode{0}{0}.east){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/gate input style/.style={
+ align=center,
+ inner sep=2pt,
+ zxTinyFontAndSpacing,
+ anchor=west,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxGateInput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/gate input style,#1] at (\zxGetNameRelativeNode{0}{0}.west){$#2$};}%
+}
+
+% --- Same, but reading bottom to top
+
+\pgfkeys{
+ /zx/vertical input style/.style={
+ align=center,
+ inner sep=2pt,
+ zxNormalFont,
+ anchor=north,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxVInput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/vertical input style,#1] at (\zxGetNameRelativeNode{0}{0}){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/vertical output style/.style={
+ align=center,
+ inner sep=2pt,
+ zxNormalFont,
+ anchor=south,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxVOutput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/vertical output style,#1] at (\zxGetNameRelativeNode{0}{0}){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/vertical input multi style/.style={
+ decorate,
+ decoration={brace, mirror, raise=2pt},
+ },
+ /zx/vertical input multi label style/.style={swap,outer sep=5pt,zxNormalFont},
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\NewExpandableDocumentCommand{\zxVInputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0},
+ to=\zxGetNameRelativeNodeStartOne{1}{2},
+ % to=\zxGetNameRelativeNodeStartOne{1}{#3},
+ /zx/vertical input multi style/.try,
+ enlarge brace/.style={
+ start anchor={[xshift=-####1]},
+ end anchor={[xshift=####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/vertical input multi label style, #2},
+ ]{}
+ }%
+}
+
+\pgfkeys{
+ /zx/vertical output multi style/.style={
+ decorate,
+ decoration={brace, raise=2pt},
+ },
+ /zx/vertical output multi label style/.style={outer sep=5pt,zxNormalFont},
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\NewExpandableDocumentCommand{\zxVOutputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0},
+ to=\zxGetNameRelativeNodeStartOne{1}{#3},
+ /zx/vertical output multi style/.try,
+ enlarge brace/.style={
+ start anchor={[xshift=-####1]},
+ end anchor={[xshift=####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/vertical output multi label style, #2},
+ ]{}
+ }%
+}
+
+
+\pgfkeys{
+ /zx/vertical gate input multi style/.style={
+ decorate,
+ decoration={brace, raise=2pt},
+ },
+ /zx/vertical gate input multi label style/.style={
+ outer sep=4pt,
+ zxTinyFontAndSpacing
+ },
+}
+
+
+\NewExpandableDocumentCommand{\zxVGateInputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0}.south,
+ to=\zxGetNameRelativeNodeStartOne{1}{#3}.south,
+ /zx/vertical gate input multi style/.try,
+ enlarge brace/.style={
+ start anchor={[xshift=-####1]},
+ end anchor={[xshift=####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/vertical gate input multi label style, #2},
+ ]{}
+ }%
+}
+
+\pgfkeys{
+ /zx/vertical gate output multi style/.style={
+ decorate,
+ decoration={brace, mirror, raise=2pt},
+ },
+ /zx/vertical gate output multi label style/.style={
+ swap,
+ outer sep=4pt,
+ zxTinyFontAndSpacing
+ },
+}
+
+% https://tex.stackexchange.com/questions/696958/simple-way-to-specify-a-pass-a-style-with-syntax-my-style-foo/697043
+%
+\NewExpandableDocumentCommand{\zxVGateOutputMulti}{O{}O{}mm}{%
+ \zxExecuteWhenDrawingArrows{%
+ \zxArrowNow[
+ from=\zxGetNameRelativeNode{0}{0}.north,
+ to=\zxGetNameRelativeNodeStartOne{1}{#3}.north,
+ /zx/vertical gate output multi style/.try,
+ enlarge brace/.style={
+ start anchor={[xshift=-####1]},
+ end anchor={[xshift=####1]},
+ },
+ /utils/exec={\zx@call@enlarge@brace{#3}},
+ #1,
+ "#4" {/zx/vertical gate output multi label style, #2},
+ ]{}
+ }%
+}
+
+\pgfkeys{
+ /zx/vertical gate output style/.style={
+ align=center,
+ inner sep=2pt,
+ zxTinyFontAndSpacing,
+ anchor=north,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxVGateOutput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/vertical gate output style,#1] at (\zxGetNameRelativeNode{0}{0}.north){$#2$};}%
+}
+
+\pgfkeys{
+ /zx/vertical gate input style/.style={
+ align=center,
+ inner sep=2pt,
+ zxTinyFontAndSpacing,
+ anchor=south,
+ },
+}
+
+\NewExpandableDocumentCommand{\zxVGateInput}{O{}m}{%
+ \zxExecuteAtEndPicture{\node[/zx/vertical gate input style,#1] at (\zxGetNameRelativeNode{0}{0}.south){$#2$};}%
+}
+
+%% If people prefer to read from top:
+
+\let\zxTOutput\zxVInput
+\let\zxTInput\zxVOutput
+\let\zxTOutputMulti\zxVInputMulti
+\let\zxTInputMulti\zxVOutputMulti
+\let\zxTGateOutputMulti\zxVGateInputMulti
+\let\zxTGateInputMulti\zxVGateOutputMulti
+\let\zxTGateInput\zxVGateOutput
+\let\zxTGateOutput\zxVGateInput
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%
+%%% Now using a special command for fractions (easier to code, and more customizable)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%% Like \zx but uses \& instead of &. This WAS useful for instance in "align" environments
+%%%%% since \zx{} was given an error (even without using &, changing the catcode was enough to
+%%%%% break the function). However, in recent versions, \zx should work as it in align, and
+%%%%% \begin{ZX}...\end{ZX} seems to always work in align without any issues.
+%%%%% Anyway, if at some points you have troubles, either use
+%%%%% \begin{ZX}[amp] ... \end{ZX} (amp is shortcut for "ampersand replacement=\&") or this function:
+\NewDocumentCommand{\zxAmp}{O{}+m}{%
+ \begin{ZX}[ampersand replacement=\&, #1]%
+ #2%
+ \end{ZX}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Practical macros to automatically choose appropriate style and arrows
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% /!\ Warning: you should add {} at the end of all macros (except arrows)!
+% Not using that may work for now, but it may break later...
+% TODO: define them only in \zx environment.
+
% A swap on one line... Practical mostly to gain space. Must be used with large nodes tough...
% \NewExpandableDocumentCommand{\OneLineSwap}{}{%
% \ar[r,s,start anchor=south,end anchor=north] \ar[r,s,start anchor=north,end anchor=south]
@@ -1891,7 +4213,7 @@
}
\NewExpandableDocumentCommand{\zxLoopAboveDots}{O{20}O{}m}{%
- \ar[loop,in=90-#1,out=90+#1,looseness=8,min distance=3mm,"\cvdotsCenterMathline" {scale=.6,anchor=north,yshift=-0.25mm},#2]
+ \ar[loop,in=90-#1,out=90+#1,looseness=8,min distance=3mm,"\cvdotsCenterMathline" {zxNormalFont,scale=.6,anchor=north,yshift=-0.25mm},#2]
}
@@ -1899,49 +4221,62 @@
% and vertical, \zxNone-{} is only horizontal space, \zxNone|{} is only vertical space.
\NewExpandableDocumentCommand{\zxNone}{t+t-t|O{}m}{
\IfBooleanTF{#1}{% \zxNone+
- |[zxNone+,#4]| #5%
+ \node[zx main node, zxNone+,#4] {#5};%
}{
\IfBooleanTF{#2}{% \zxNone-
- |[zxNone-,#4]| #5%
+ \node[zx main node, zxNone-,#4] {#5};%
}{
\IfBooleanTF{#3}{% \zxNone
- |[zxNoneI,#4]| #5%
+ \node[zx main node, zxNoneI,#4] {#5};%
}{% \zxNone
- |[zxNone,#4]| #5%
- }
- }
- }
+ \node[zx main node, zxNone,#4] {#5};%
+ }%
+ }%
+ }%
}
% Usage: alias of \zxNone... To bad token can't be easily forwarded to another function.
\NewExpandableDocumentCommand{\zxN}{t+t-t|O{}m}{
\IfBooleanTF{#1}{% \zxNone+
- |[zxNone+,#4]| #5%
+ \node[zx main node, zxNone+,#4] {#5};%
}{
\IfBooleanTF{#2}{% \zxNone-
- |[zxNone-,#4]| #5%
+ \node[zx main node, zxNone-,#4]{#5};%
}{
- \IfBooleanTF{#3}{% \zxNone
- |[zxNoneI,#4]| #5%
+ \IfBooleanTF{#3}{% \zxNone|
+ \node[zx main node, zxNoneI,#4]{#5};%
}{% \zxNone
- |[zxNone,#4]| #5%
- }
- }
- }
+ \node[zx main node, zxNone,#4]{#5};%
+ }%
+ }%
+ }%
}
+
+% Usage: can be used without {}. Wait, actually it MUST be used without {} which is disturbing… to fix
+\def\zxNL{
+ \zxN{} \rar \pgfmatrixnextcell[\zxwCol]%
+}
+
+% Usage: can be used without {}
+\def\zxNR{
+ \pgfmatrixnextcell[\zxwCol] \zxN{} \ar[l]
+}
+
+
+
% Cf \zxNone, but with larger space.
\NewExpandableDocumentCommand{\zxNoneDouble}{t+t-t|O{}m}{
\IfBooleanTF{#1}{% \zxNoneDouble+
- |[zxNoneDouble+,#4]| #5%
+ \node[zx main node, zxNoneDouble+,#4]{#5};%
}{
\IfBooleanTF{#2}{% \zxNoneDouble-
- |[zxNoneDouble-,#4]| #5%
+ \node[zx main node, zxNoneDouble-,#4]{#5};%
}{
\IfBooleanTF{#3}{% \zxNoneDouble
- |[zxNoneDoubleI,#4]| #5%
+ \node[zx main node, zxNoneDoubleI,#4]{#5};%
}{% \zxNoneDouble
- |[zxNoneDouble,#4]| #5%
+ \node[zx main node, zxNoneDouble,#4]{#5};%
}
}
}
@@ -1950,77 +4285,187 @@
%% For maximum styling liberty, the content is given directly to the style.
% It allows the style to put the phase in a label.
\NewExpandableDocumentCommand{\zxZ}{O{}t*t-m}{
- |[zxZ4={#1}{\IfBooleanTF{#3}{-}{}}{\IfBooleanTF{#2}{*}{}}{#4}]| %
+ \node[zx main node, zxZ4={#1}{\IfBooleanTF{#3}{-}{}}{\IfBooleanTF{#2}{*}{}}{#4}] {}; %
}
%% For maximum styling liberty, the content is given directly to the style.
%% It allows the style to put the phase in a label.
\NewExpandableDocumentCommand{\zxX}{O{}t*t-m}{
- |[zxX4={#1}{\IfBooleanTF{#3}{-}{}}{\IfBooleanTF{#2}{*}{}}{#4}]| %
+ \node[zx main node, zxX4={#1}{\IfBooleanTF{#3}{-}{}}{\IfBooleanTF{#2}{*}{}}{#4}]{};%
}
\NewExpandableDocumentCommand{\zxH}{O{}m}{
- |[zxH,#1]| {}%
+ \node[zx main node, zxH,#1]{};%
}
% Use like: \zxFracX{\pi}{4} for positive values or for negative \zxFracX-{\pi}{4}
\NewExpandableDocumentCommand{\zxFracZ}{O{}t-moom}{%
\IfNoValueTF{#5}{% 2 arguments like: \zxFracZ{\pi}{2}
- |[zxFracZ6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#3}{#6}]| %
+ \node[zx main node, zxFracZ6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#3}{#6}]{};%
}{% 4 arguments like \zxFracZ{a+b}[(a+b)][(c+d)]{c+d}
- |[zxFracZ6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#4}{#5}]| %
+ \node[zx main node, zxFracZ6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#4}{#5}]{};%
}%
}
% Use like: \zxFracX{\pi}{4} for positive values or for negative \zxFracX-{\pi}{4}
\NewExpandableDocumentCommand{\zxFracX}{O{}t-moom}{%
\IfNoValueTF{#5}{% 2 arguments like: \zxFracZ{\pi}{2}
- |[zxFracX6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#3}{#6}]| %
+ \node[zx main node, zxFracX6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#3}{#6}]{};%
}{% 4 arguments like \zxFracZ{a+b}[(a+b)][(c+d)]{c+d}
- |[zxFracX6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#4}{#5}]| %
+ \node[zx main node, zxFracX6={#1}{\IfBooleanTF{#2}{\zxMinus}{}}{#3}{#6}{#4}{#5}]{};%
}%
}
\NewExpandableDocumentCommand{\zxEmptyDiagram}{}{
- |[zxEmptyDiagram]| {}%
+ \node[zx main node, zxEmptyDiagram]{};%
}
-% Quantikz has a bug which adds space automatically.
-% https://tex.stackexchange.com/questions/618330
-% Fixing that by copying the original (unpatched) functions, and reusing them later.
-% Warning: you must load this package **before** quantikz otherwise the fix will not work.
-\let\tikzcd@@originalCopyZx\tikzcd@
-\let\endtikzcd@originalCopyZx\endtikzcd
-%%%%% Main environment \begin{ZX}...\end{ZX}
-\NewDocumentEnvironment{ZX}{O{}}{%
- \bgroup%
- \fontsize{10}{12}\selectfont% Normalize the font size to have consistent drawings everywhere.
- % Add a switch in case someone really wants the current tikzcd version:
- \ifdefined\doNotPatchQuantikz% Do not patch tikzcd.
- \else% Restore locally original tikzcd.
- \let\tikzcd@\tikzcd@@originalCopyZx%
- \let\endtikzcd\endtikzcd@originalCopyZx%
- \fi%
- \pgfsetlayers{background,edgelayer,nodelayer,main,box,labellayer,foreground}% Layers are defined locally to avoid to disturb other drawings
- \begin{tikzcd}[%
- /zx/defaultEnv,%
- #1]%
- }{\end{tikzcd}\egroup}
-
-%%%%% Shortcut macro \zx{...} equivalent to \begin{ZX}...\end{ZX}
-\newcommand\zx{%
- \begingroup% To avoid ampersand issues https://tex.stackexchange.com/a/611535/116348
- \NewDocumentCommand{\tmpZX}{O{}+m}{%
- \endgroup%
- \begin{ZX}[##1]%
- ##2%
- \end{ZX}%
+% % Example: \leftManyDots{n}
+% Useful to put on the left of a node like "n \vdots", linked to the next node. Example: \leftManyDots{n}.
+% First optional argument is scale of text, second is scale of =.
+\NewExpandableDocumentCommand{\leftManyDots}{O{1}O{\zxScaleDots}m}{%
+ \node[zx main node, zxNone+,inner xsep=0pt]{\scalebox{#1}{$#3$\,}\makebox[0pt][l]{\scalebox{#2}{$\cvdotsCenterMathline$}}}; \ar[r,-N.,start anchor=north east] \ar[r,-N',start anchor=south east] \pgfmatrixnextcell[\zxwCol]%
+}
+
+% Useful to link two nodes and put a vdots in between.
+\NewExpandableDocumentCommand{\middleManyDots}{}{%
+ \ar[r,3 vdots] \ar[o',r] \ar[o.,r]%
+}
+
+% Like \leftManyDots but on the right. Do *not* create a new node, like in |[zxShortZ]| \alpha \rightManyDots{m}
+\NewExpandableDocumentCommand{\rightManyDots}{O{1}O{\zxScaleDots}m}{%
+ \ar[r,N'-,end anchor=north west] \ar[r,N.-,end anchor=south west] \pgfmatrixnextcell[\zxwCol] \node[zx main node, zxNone+,inner xsep=0pt]{\makebox[0pt][r]{\scalebox{#2}{$\cvdotsCenterMathline$}}\scalebox{#1}{\,$#3$}};
+}
+
+% Shortcut for frequent wires
+\NewExpandableDocumentCommand{\zxDoubleO}{O{}m}{%
+ \ar[r,o.,#1] \ar[r,o',#1]
+}
+
+% Version going down
+\NewExpandableDocumentCommand{\zxDoubleOD}{O{}m}{%
+ \ar[r,o-,#1] \ar[r,-o,#1]
+}
+
+\NewExpandableDocumentCommand{\zxTtripleO}{O{}m}{%
+ \rar \ar[r,o.,#1] \ar[r,o',#1]
+}
+
+\NewExpandableDocumentCommand{\zxTripleOD}{O{}m}{%
+ \rar \ar[r,-.,#1] \ar[r,o-,#1]
+}
+
+
+\NewExpandableDocumentCommand{\zxOneOverSqrtTwo}{O{}m}{%
+ \zxZ{} \rar[#1] \ar[r,o.,#1] \ar[r,o',#1] \pgfmatrixnextcell \zxX{}
+}
+
+\NewExpandableDocumentCommand{\zxSqrtTwo}{O{}m}{%
+ \zxZ{} \rar[#1] \pgfmatrixnextcell \zxX{}
+}
+
+
+%% Need AfterEndPreamble otherwise there is an error when using tikzexternalize.
+\AfterEndPreamble{
+ \zxSaveDiagram{\zxCteOneOverSqrtTwo}{\zxZ{} \rar \ar[r,o.] \ar[r,o'] \pgfmatrixnextcell \zxX{}}
+ \zxSaveDiagram{\zxCteSqrtTwo}{\zxZ{} \rar \pgfmatrixnextcell \zxX{}}
+}
+
+%% Useful to give name to box
+%% \namedBox{(node1)(node2)}{text}
+%% \namedBox[additional style][color]{(node1)(node2)}[additional label options]{optional position:text}
+%% \begin{ZX}[
+%% execute at end picture={
+%% \zxNamedBox{(measZ)(measZ)}{right:Bell measure}
+%% }
+%% ]
+%% \zxN{} \dar[C] \ar[rrr] & & & \zxN{} \\
+%% \zxN{} \ar[rr] &&\zxX[a=measX]{x\pi} \dar[C-]\\
+%% & \zxX{r\pi} \rar& \zxZ[a=measZ]{z\pi}
+%% \end{ZX}
+
+%% Helper
+%% https://tex.stackexchange.com/questions/523579/tikz-fit-inner-sep-seperate-values-for-all-4-directions
+% \tikzset{fit margins/.style={
+% /tikz/afit/.cd,
+% #1,
+% /tikz/.cd,
+% inner xsep=\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
+% inner ysep=\pgfkeysvalueof{/tikz/afit/top}+\pgfkeysvalueof{/tikz/afit/bottom},
+% xshift=-\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
+% yshift=-\pgfkeysvalueof{/tikz/afit/bottom}+\pgfkeysvalueof{/tikz/afit/top},
+% afit/.cd,
+% left/.initial=1pt,right/.initial=1pt,bottom/.initial=1pt,top/.initial=1pt
+% }}
+
+\tikzset{
+ fit margins/.style={
+ /tikz/afit/.cd,#1,
+ /tikz/.cd,
+ inner xsep=\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
+ inner ysep=\pgfkeysvalueof{/tikz/afit/top}+\pgfkeysvalueof{/tikz/afit/bottom},
+ %/utils/exec={\message{Last xishft is \pgfkeysvalueof{/tikz/afit/last xshift} and \pgfkeysvalueof{/tikz/afit/last yshift}}},
+ xshift/.evaluated=-\pgfkeysvalueof{/tikz/afit/last xshift}
+ -\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
+ yshift/.evaluated=-\pgfkeysvalueof{/tikz/afit/last yshift}
+ -\pgfkeysvalueof{/tikz/afit/bottom}+\pgfkeysvalueof{/tikz/afit/top},
+ /tikz/afit/last xshift/.evaluated=-\pgfkeysvalueof{/tikz/afit/left}+\pgfkeysvalueof{/tikz/afit/right},
+ /tikz/afit/last yshift/.evaluated=-\pgfkeysvalueof{/tikz/afit/bottom}+\pgfkeysvalueof{/tikz/afit/top},
+ },
+ afit/.cd,
+ % used to save the last xshift done by fit margins, so that applying it twice does not shift twice
+ % since xshift=2cm,xshift=2cm is like xshift=4cm
+ last xshift/.initial=0pt,
+ last yshift/.initial=0pt,
+ % actual values
+ left/.initial=1pt,
+ right/.initial=1pt,
+ bottom/.initial=1pt,
+ top/.initial=1pt,
+ horizontal/.style={
+ left=#1,
+ right=#1,
+ },
+ vertical/.style={
+ top=#1,
+ bottom=#1,
+ },
+ all/.style={
+ horizontal=#1,
+ vertical=#1,
+ },
+ /tikz/.cd
+}
+
+\NewExpandableDocumentCommand{\zxNamedBox}{O{}O{blue}mO{}m}{
+ \node[l/.style={fit margins={all=1mm}},inner sep=2pt, node on layer=background, rounded corners, draw=#2,dashed, fill={#2!50!white}, opacity=.5, fit=#3,label={[#4]#5},#1]{};
+}
+
+% Cont is for container, equivalent of zxNamedBox but inside the matrix directly
+\NewExpandableDocumentCommand{\zxCont}{O{}O{blue}mmO{}O{}m}{%
+ \zxExecuteAtEndPicture{%
+ \zxNamedBox[zx subnode=wrapper,#1][#2]{(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{\numexpr #3-1\relax}{\numexpr #4-1\relax})#6}[#5]{#7}%
+ }%
+}
+
+% Cont is for container, equivalent of zxNamedBox but inside the matrix directly
+\NewExpandableDocumentCommand{\zxGroupGates}{O{}mmO{}O{}m}{%
+ \zxCont[fill=none,rounded corners=0pt,solid,opacity=1,zx thickness wires style,draw=black,rectangle,
+ fit margins={all=.5mm},
+ #1]{#2}{#3}[#4][#5]{#6}
+}
+
+% Cont is for container, equivalent of zxNamedBox but inside the matrix directly
+% this is the version where you specify the name of the node and not the relative pos
+\NewExpandableDocumentCommand{\zxContName}{O{}O{blue}mO{}m}{%
+ \zxExecuteAtEndPicture{%
+ \zxNamedBox[#1][#2]{(\zxGetNameRelativeNode{0}{0})#3}[#4]{#5}%
}%
- \catcode`&=13%
- \tmpZX%
}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Old code that tried to automatically find if zxShort or zxLong should be used...
%%% Now using a special command for fractions (easier to code, and more customizable)
@@ -2050,3 +4495,4 @@
}%
}%
}
+
diff --git a/graphics/pgf/contrib/zx-calculus/zx-calculus.pdf b/graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
index 77f0646ac8..762c10a208 100644
--- a/graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
+++ b/graphics/pgf/contrib/zx-calculus/zx-calculus.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/zx-calculus/zx-calculus.sty b/graphics/pgf/contrib/zx-calculus/zx-calculus.sty
index cb6a983c1f..4cb629b513 100644
--- a/graphics/pgf/contrib/zx-calculus/zx-calculus.sty
+++ b/graphics/pgf/contrib/zx-calculus/zx-calculus.sty
@@ -2,8 +2,9 @@
% Written by Léo Colisson. Report bugs on https://github.com/leo-colisson/zx-calculus/issues
% Published under the MIT license.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{zx-calculus}[2021/10/22 A package to typeset ZX calculus in directly in LaTeX, based on tikz/tikzcd.]
+\ProvidesPackage{zx-calculus}[v2.0 A package to typeset ZX calculus and circuits directly in LaTeX, based on tikz/tikzcd.]
\RequirePackage{tikz}
+\RequirePackage{tikz-cd}
\usetikzlibrary{zx-calculus} % See library in "tikzlibraryzx.code.tex".
diff --git a/graphics/pgf/contrib/zx-calculus/zx-calculus.tex b/graphics/pgf/contrib/zx-calculus/zx-calculus.tex
index c10f420285..5531da1e9c 100644
--- a/graphics/pgf/contrib/zx-calculus/zx-calculus.tex
+++ b/graphics/pgf/contrib/zx-calculus/zx-calculus.tex
@@ -1,15 +1,20 @@
-\documentclass[a4paper]{ltxdoc}
-
+\documentclass[a4paper,doc2]{ltxdoc} % doc2 is needed to force the old version, or links get colored in a weird red way even with hidelinks. https://github.com/latex3/latex2e/issues/822
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Warning: if you compile and get:
+%% ERROR: Argument of \tikz@lib@matrix@with@options has an extra }.
+%% make sure to fix catcodes around it as | is given a different meaning in ltxdoc.
\usepackage{amsmath}
\usepackage[margin=3cm]{geometry}
\usepackage{calc}
+\usepackage{braket}
\usepackage{tikz}
\usetikzlibrary{shadows,fit}
+\usetikzlibrary{snakes}
+\usetikzlibrary{nfold} % needs very recent CTAN > 2023, or manually copy the .tex files
% \usetikzlibrary fails because file is not in current directory, lazy to setup TEXINPUTS
\makeatletter
\usetikzlibrary{zx-calculus}
@@ -18,10 +23,54 @@
\input{pgfmanual-en-macros.tex} % Is supposed to be included in recent TeX distributions, but I get errors...
\usepackage{makeidx} % Produces an index of commands.
\makeindex % Useful or not index will be created
+\usepackage{alertmessage} % For warning, info...
\usepackage[hidelinks]{hyperref}
\newcommand{\mylink}[2]{\href{#1}{#2}\footnote{\url{#1}}}
\usepackage{verbatim}
\usepackage{cleveref}
+\usepackage{mathtools}
+\usepackage{listings}
+\usepackage [
+n,
+lambda,
+advantage,
+operators,
+sets,
+adversary,
+landau,
+probability,
+notions,
+logic,
+ff,
+mm,
+primitives,
+events,
+complexity,
+asymptotics,
+keys
+] {cryptocode}
+
+%%%% Bibliography
+% I want to have separate references for appendix and main body
+% https://tex.stackexchange.com/questions/98660/
+\usepackage[style=trad-alpha,
+ sortcites=true,
+ doi=false,
+ url=false,
+ giveninits=true, % Bob Foo --> B. Foo
+ isbn=false,
+ url=false,
+ eprint=false,
+ sortcites=false, % \cite{B,A,C}: [A,B,C] --> [B,A,C]
+]{biblatex}
+\renewcommand{\multicitedelim}{, } % [ABC96; DEF12] -> [ABC96, DEF12]
+% [unknown_ref] => [??]
+% https://tex.stackexchange.com/a/352573
+\makeatletter
+\protected\def\abx@missing#1{\textbf{??}}
+\makeatother
+\renewcommand*{\bibfont}{\normalfont\small} % BibLatex font seems bigger than Bibtex?
+\addbibresource{biblio.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Documentation
@@ -38,7 +87,7 @@
{\Large\bfseries ZX-calculus with \tikzname}
\vspace{1em}
- {Version 2021/10/22}\\[3mm]
+ {Léo Colisson \quad Version 2.0}\\[3mm]
{\href{https://github.com/leo-colisson/zx-calculus}{\texttt{github.com/leo-colisson/zx-calculus}}}
\end{center}
@@ -46,7 +95,7 @@
\section{Introduction}
-This library (based on the great \tikzname{} and \tikzname-cd packages) allows you to typeset ZX-calculus directly in \LaTeX{}. It comes with a default---but highly customizable---style:
+This library (based on the great \tikzname{} and \tikzname-cd packages) allows you to typeset ZX-calculus and diagrams for diagrammatic reasoning~\cite{CK17_PicturingQuantumProcesses,van20_ZXcalculusWorkingQuantum} directly in \LaTeX{}. It comes with a default---but highly customizable---style:
\begin{codeexample}[]
\begin{ZX}
\zxZ{\alpha} \arrow[r] & \zxFracX-{\pi}{4}
@@ -60,6 +109,69 @@ Even if this has not yet been tested a lot, you can also use a ``phase in label'
\end{ZX}
\end{codeexample}
+Since 24/02/2023, we also provide ways to easily create new, highly customizable shapes, with text, anchors, sub-nodes, rotations, and more:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+% Define a reusable node
+\zxNewNodeFromPic{MyDivider}[][zx create anchors={\zxVirtualCenterWest, \zxVirtualCenterEast},
+ every node/.append style={transform shape}
+ ]{
+ \node[regular polygon, regular polygon sides=3,shape border rotate=90,%shape border rotate=90,
+ draw=black,fill=gray!50, inner sep=1.6pt, rounded corners=0.8mm,zx main node] {};
+ \coordinate(\zxVirtualCenterEast) at (.2mm,0); % Used to start lines on the side of the shape
+ \coordinate(\zxVirtualCenterWest) at (-1mm,0);
+}
+% Use the node
+\begin{ZX}
+ & [2mm] & [3mm] \zxN{} \\[\zxZeroRow]
+ \zxZ[B]{} \rar[Bn'=n+m, wc] & \zxMyDivider{}
+ \rar[<',ru,Bn'Args={n}{pos=.7}]
+ \rar[Bn.Args={m}{pos=.7},<.,rd] &\\[\zxZeroRow]
+ & & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+
+Since 2023-09-27, you can also do advanced operations on multi-gate elements or use our default style:
+\begin{codeexample}[]
+\begin{ZX}[circuit, thick lines]
+ \rar & \zxGate{H} \rar & \zxGateMulti{2}{3}{H} & & \rar & \\
+ \rar & \zxGate{H} \rar & & & \rar &
+\end{ZX}
+\end{codeexample}
+
+and create more traditional circuits:
+
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit, thick lines]
+ \zxInput{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar & \zxOutput{\ket{\phi}}
+\end{ZX}
+\end{codeexample}
+
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \ar[rr] & & [\zxZeroCol] \zxCtrl{} \dar \ar[rr] & [\zxZeroCol] & \\
+ \rar \zxInputMulti{2}{\ket{\psi}} & \zxGateMulti{3}{3}{U} \zxGateInputMulti{2}{x}
+ & & \rar \zxGateOutputMulti{2}{x \oplus y} & \zxOutputMulti{2}{\text{Output}} \\
+ \rar &
+ & & \rar & \\
+ \rar \zxInput{\ket{0}} & \zxGateInput{y}
+ & & \rar \zxGateOutput{y \oplus 1} & \zxOutput{\ket{1}}
+\end{ZX}
+\end{codeexample}
+
+\begin{codeexample}[width=0cm]
+ \begin{ZX}[circuit]
+ \ar[rr] && \zxCtrl{} \ar[dl, end subnode=wrapper] \ar[rr] && \\
+ \rar & \zxCtrl{} \dar \rar \zxGroupGates{2}{3}{below:\textsc{swap}} & \zxNot{} \dar \rar & \zxCtrl{} \dar \rar & \\
+ \rar & \zxNot{} \rar & \zxCtrl{} \rar & \zxNot{} \rar &
+ \end{ZX}
+\end{codeexample}
+}
The goal is to provide an alternative to the great |tikzit| package: we wanted a solution that does not require the creation of an additional file, the use of an external software, and which automatically adapts the width of columns and rows depending on the content of the nodes (in |tikzit| one needs to manually tune the position of each node, especially when dealing with large nodes). Our library also provides a default style and tries to separate the content from the style: that way it should be easy to globally change the styling of a given project without redesigning all diagrams. However, it should be fairly easy to combine tikzit and this library: when some diagrams are easier to design in tikzit, then it should be possible to directly load the style of this library inside tikzit.
@@ -84,13 +196,19 @@ If this library is not yet packaged into CTAN (which is very likely in 2021), yo
\section{Quickstart}
-You can create a diagram either with |\zx[options]{matrix}| or with:
+You can create a diagram either with |\zx[options]{matrix}|, |\zxAmp[options]{matrix}| or with:
\begin{verse}
|\begin{ZX}[options]|\\
| matrix|\\
|\end{ZX}|
\end{verse}
-The matrix is composed of columns separated by |&| and rows separated by |\\|. This matrix is basically a \tikzname{} matrix of nodes (even better, a |tikz-cd| matrix, so you can use all the machinary of |tikz-cd|), so cells can be created using \verb#|tikz style| content#. However, the users does not usually need to use this syntax since many nodes like |\zxZ{spider phase}| have been created for them (including |\zxN{}| which is an empty node):
+The matrix is composed of rows separated by |\\| and columns separated by |&| (except in |\zxAmp| where columns are separated with |\&|).
+
+% \alertwarning{ % Can't use |...| or \verb|...| in this environment :'(
+% Due to \LaTeX{} restrictions, \texttt{\&} can sometimes cause some troubles. \texttt{\textbackslash{}zxAmp} is always guaranteed to work (just make sure to use \texttt{\textbackslash{}\&} instead of \texttt{\&}). See \cref{subsec:addDiagram} for more details.
+% }
+
+This matrix is basically a \tikzname{} matrix of nodes (even better, a |tikz-cd| matrix, so you can use all the machinary of |tikz-cd|), so cells can be created using \verb#|[tikz style]| content#. However, the users does not usually need to use this syntax since many nodes like |\zxZ{spider phase}| have been created for them (including |\zxN{}| which is an empty node):
\begin{codeexample}[width=0pt]
\begin{ZX}
@@ -109,14 +227,39 @@ To link the nodes, you should use |\arrow[options]| (|\ar[options]| for short) a
& & \zxX-{\alpha}
\end{ZX}
\end{codeexample}
-See how the alignment of your matrix helps reading it: in emacs |M-x align| is your friend. You may also encounter some shortcuts, like |\rar| instead of |\ar[r]|. Since straight lines are boring, we created many styles that you can just add in the options. For instance, a measured Bell-pair can be created using the |C| style (note also how the |*| argument forces the node to be tighter):
+See how the alignment of your matrix helps reading it: in emacs |M-x align| is your friend (or even better, if you are tired of selecting the lines to align, bind \mylink{https://tex.stackexchange.com/a/64566/116348}{this \texttt{align-environment} function} to some shortcuts, like |C-<tab>| and you will just have to do a single key-press to align your matrix).
+
+You may also encounter some shortcuts, like |\rar| instead of |\ar[r]|. Since straight lines are boring, we created many styles that you can just add in the options. For instance, a measured Bell-pair can be created using the |C| style (note also how the |*| argument forces the node to be tighter), as the name of the style tries to mimic the shape of the wire:
\begin{codeexample}[]
\begin{ZX}
\zxZ*{a \pi} \ar[d,C]\\
\zxZ*{b \pi}
\end{ZX}
\end{codeexample}
-The name of the style usually tries to graphically represent the shape of a node (here it looks like a |C|). We also introduce many other styles, like |N| for wires that arrive and leave at wide angle (yeah, the |N| is the best letter I could find to fit that shape):
+
+\alertinfo{
+ \textbf{Tips}: on small diagrams, describing the arrow position using relative position like \texttt{rrb} works really nicely, but on big diagrams that you need to rewrite, it can quickly be hard to manage, as moving a node will break all links to it. While it is possible to specify both |from| and |to| in an absolute way, the experience shows that it is easier to work with a ``semi-relative'' addressing, where only the |to| is specified in an absolute setting, while the |from| is automatically derived from the current position of the arrow. You can use \texttt{a=somename} to give a name for a node (\texttt{a} being the short name of alias).}
+
+This way, on non-trivial diagrams, we recommend to format graphs like:
+\begin{codeexample}[]
+\begin{ZX}
+ \zxN{} & \zxZ[a=beta]{\beta} \\
+ \zxZ{\alpha} \ar[to=beta,N] \ar[to=gamma,N] & \\
+ & \zxZ[a=gamma]{\gamma}
+\end{ZX}
+\end{codeexample}
+Note that you can also set |debug mode| to display the name of the nodes for an easier addressing:
+\begin{codeexample}[]
+\begin{ZX}[debug mode]
+ % See how the code stayed unchanged despite changing the position of the nodes
+ \zxN{} & \zxZ[a=beta]{\beta} \\
+ \zxZ{\alpha} \ar[to=beta,N] \ar[to=gamma,N] & \\
+ & \\
+ & & \zxZ[a=gamma]{\gamma}
+\end{ZX}
+\end{codeexample}
+
+We also introduce many other styles, like |N| for wires that arrive and leave at wide angle (yeah, the |N| is the best letter I could find to fit that shape):
\begin{codeexample}[]
\begin{ZX}
\zxN{} & \zxZ{\beta}\\
@@ -124,11 +267,11 @@ The name of the style usually tries to graphically represent the shape of a node
& \zxZ{\gamma}
\end{ZX}
\end{codeexample}
-Or |s| for wires that arrive and leave at sharp angles (the |\zxN{}| is used because it seems that the first cell of a matrix can't be empty):
+Or |s| for wires that arrive and leave at sharp angles\footnote{Note: on older versions, a |\textbackslash zxN\{\}| might be needed on the first cell as it seems that the first cell of a matrix can't be empty… this should be fixed in latest versions.}:
\begin{codeexample}[]
\begin{ZX}
- \zxN{} & \zxZ{\beta}\\
- \zxZ{\alpha} \ar[ru,s] \ar[rd,s] &\\
+ & \zxZ{\beta} \\
+ \zxZ{\alpha} \ar[ru,s] \ar[rd,s] & \\
& \zxZ{\gamma}
\end{ZX}
\end{codeexample}
@@ -146,7 +289,7 @@ Similarly |o'| is a style for wires that have the shape of the top part of the c
\zxZ{\beta}
\end{ZX}
\end{codeexample}
-Note that the position of the embellishments (|'|, |-|, |.|\dots{}) tries to graphically represent the shape of the node. That way |-o| means ``take the left part (position of |-|) or the circle |o|''. Applied to |C|, this gives:
+Note that the position of the embellishments (|'|, |-|, |.|\dots{}) tries to graphically represent the shape of the node. That way |-o| means ``take the left part (position of |-|) of the circle |o|''. Applied to |C|, this gives:
\begin{codeexample}[]
\begin{ZX}
\zxX{} \ar[d,C] \ar[r,C'] & \zxZ{} \ar[d,C-]\\
@@ -160,7 +303,7 @@ You also have styles which automatically add another node in between, for instan
\zxZ{\alpha} \ar[r,o',H] \ar[r,o.,H] &[\zxHCol] \zxZ{\beta}
\end{ZX}
\end{codeexample}
-Note that we used also |&[\zxHCol]| instead of |&| (on the first line). This is useful to add an extra space between the columns to have a nicer look. The same apply for rows (see the |*Row| instead of |*Col|):
+Note that we used also |&[\zxHCol]| instead of |&| (on the first line). This is useful to add an extra space between the columns to have a nicer look. The same applies for rows (see the |*Row| instead of |*Col|):
\begin{codeexample}[]
\begin{ZX}
\zxZ{\alpha} \ar[d,-o,Z] \ar[d,o-,X] \\[\zxSRow]
@@ -182,7 +325,15 @@ The reason for this is that it is hard to always get exactly the good spacing by
\end{codeexample}
-When writing equations, you may also want to change the baseline to align properly your diagrams on a given line like that:
+When writing equations, you may also want to change the baseline to align properly your diagrams on a given line like that (since march 2023):
+\begin{codeexample}[]
+ $\zx[mbr=2]{ % mbr is a shortcut for "math baseline row"
+ \zxX{}\\
+ \zxZ[a=myZ]{}
+ }
+ = \zx{\zxX{} & \zxZ{}}$
+\end{codeexample}
+You can also specify (this works on older versions) a specific node like that (|a=blabla| gives the alias name |blabla| to the node, and configure tools useful for debugging):
\begin{codeexample}[]
$\zx[math baseline=myZ]{
\zxX{}\\
@@ -274,7 +425,7 @@ Now you should know enough to start your first diagrams. The rest of the documen
\end{ZX}
} \ (of course it only helps during the construction).\\
-You will also see how you can customize the styles, and how you can easily extand this library to get any custom diagram:
+You will also see how you can customize the styles, and how you can easily extend this library to get any custom diagram:
{\catcode`\|=12 % Ensures | is not anymore \verb|...|
\begin{codeexample}[width=0pt]
{ % \usetikzlibrary{shadows}
@@ -301,12 +452,13 @@ If you have some questions, suggestions, or bugs, please report them on \texttt{
\section{Usage}
-\subsection{Add a diagram}
+\subsection{Add a diagram}\label{subsec:addDiagram}
\begin{pgfmanualentry}
\extractcommand\zx\opt{\oarg{options}}\marg{your diagram}\@@
\extractenvironement{ZX}\opt{\oarg{options}}\@@
+ \extractcommand\zxAmp\opt{\oarg{options}}\marg{your diagram}\@@
\pgfmanualbody
- You can create a new ZX-diagram either with a command (quicker for inline diagrams) or with an environment. The \meta{options} can be used to locally change the style of the diagram, using the same options as the |{tikz-cd}| environment (from the \mylink{https://www.ctan.org/pkg/tikz-cd}{\texttt{tikz-cd} package}). The \meta{your diagram} argument, or the content of |{ZX}| environment is a \tikzname{} matrix of nodes, exactly like in the |tikz-cd| package: columns are separated using |&|, columns using |\\|, and nodes are created using \verb#|[tikz style]| node content# or with shortcut commands presented later in this document (recommended). Content is typeset in math mode by default, and diagrams can be included in any equation. Wires can be added like in |tikz-cd| (see more below) using |\arrow| or |\ar|: we provide later recommended styles to quickly create different kinds of wires which can change with the configured style.
+ You can create a new ZX-diagram either with a macro (quicker for inline diagrams) or with an environment. All these commands are mostly equivalent, except that in |\zxAmp| columns are separated with |\&| instead of |&| (this was useful before as |&| was not usable in |align| or inside macros. Now it should be fixed.). The \meta{options} can be used to locally change the style of the diagram, using the same options as the |{tikz-cd}| environment (from the \mylink{https://www.ctan.org/pkg/tikz-cd}{\texttt{tikz-cd} package}). The \meta{your diagram} argument, or the content of |{ZX}| environment is a \tikzname{} matrix of nodes, exactly like in the |tikz-cd| package: rows are separated using |\\|, columns using |&| (except for |\zxAmp| where columns are separated using |\&|), and nodes are created using \verb#|[tikz style]| node content# or with shortcut commands presented later in this document (recommended). Wires can be added like in |tikz-cd| (see more below) using |\arrow| or |\ar|: we provide later recommended styles to quickly create different kinds of wires which can change with the configured style. Content is typeset in math mode by default, and diagrams can be included in any equation.
{\catcode`\|=12 % Ensures | is not anymore \verb|...|
% Do not indent not to put space in final code
\begin{codeexample}[]
@@ -320,8 +472,23 @@ and custom diagram: %
}
\end{pgfmanualentry}
-\subsection{Nodes}
+\begin{stylekey}{/zx/defaultEnv/amp}
+ In a previous version (before 2022/02/09), it was not possible to use |&| inside macros and |align| due to \LaTeX{} limitations. However, we found a solution by re-scanning the tokens, so now no special care should be taken in align or macros. But in case you need to deal with an environment having troubles with |&|, either use the |ampersand replacement=\&| option (whose shortcut is |amp|) or |\zxAmp| (in any case, replace |&| with |\&|).
+\begin{codeexample}[vbox]
+An aligned equation:
+\begin{align}
+ \zxAmp{\zxZ{} \arrow[r] \& \zxX{}} &= \begin{ZX}[amp] \zxX{} \arrow[r] \& \zxZ{} \end{ZX}
+\end{align}
+This limitation does not apply anymore:
+\begin{align}
+ \zx{\zxZ{} \arrow[r] & \zxX{}} &= \begin{ZX} \zxX{} \arrow[r] & \zxZ{} \end{ZX}
+\end{align}
+even in macros: {\setlength{\fboxsep}{0pt} \fbox{\zx{\zxZ{} \rar & \zxX{}}}}
+\end{codeexample}
+\end{stylekey}
+\subsection{Nodes}
+\subsubsection{Spiders}
The following commands are useful to create different kinds of nodes. Always add empty arguments like |\example{}| if none are already present, otherwise if you type |\example| we don't guarantee backward compatibility.
\begin{command}{\zxEmptyDiagram{}}
@@ -335,12 +502,14 @@ The following commands are useful to create different kinds of nodes. Always add
\begin{pgfmanualentry}
- \extractcommand\zxNone\opt{+}\opt{-}\marg{text}\@@
- \extractcommand\zxN\opt{+}\opt{-}\marg{text}\@@
+ \extractcommand\zxNone\opt{-\textbar+}\marg{text}\@@
+ \extractcommand\zxN\opt{-\textbar+}\marg{text}\@@
+ \extractcommand\zxNL\@@
+ \extractcommand\zxNR\@@
\pgfmanualbody
- Adds an empty node with |\zxNone{}| (alias |\zxN{}|). The \verb#-|+# decorations are used to add a bit of horizontal (\verb#\zxNone-{}#), vertical (\verb#\zxNone|{}#) and both (\verb#\zxNone+{}#) spacing (I don't know how to add \verb#|# in the documentation of the function).
+ Adds an empty node with |\zxNone{}| (alias |\zxN{}|). The \verb#-|+# decorations are used to add a bit of horizontal (\verb#\zxNone-{}#), vertical (\verb#\zxNone|{}#) and both (\verb#\zxNone+{}#) spacing.
- |\zxNone| is just a coordinate (when possible this node should be preferred over the other versions), but |\zxNone-{}| and \verb#\zxNone|{}# are actually nodes with |inner sep=0| along one direction. For that reason, they still have a tiny height or width (impossible to remove as far as I know). If you don't want to get holes when connecting multiple wires to them, it is therefore necessary to use the |wire centered| style (alias |wc|) (if you are using the |IO| mode, see also the |between none| style).
+ |\zxNone| is just a coordinate (and therefore can't have any text inside, but when possible this node should be preferred over the other versions since it has really zero width), but |\zxNone-{}| and \verb#\zxNone|{}# are actually nodes with |inner sep=0| along one direction. For that reason, they still have a tiny height or width (impossible to remove as far as I know). If you don't want to get holes when connecting multiple wires to them, it is therefore necessary to use |\zxNone{}| or the |wire centered| style (alias |wc|) (if you are using the |IO| mode, see also the |between none| style). But anyway you should mostly use |\zxNone|.
Moreover, you should also add column and row spacing |&[\zxWCol]| and |\\[\zxWRow]| to avoid too shrinked diagrams when only wires are involved.
\begin{codeexample}[width=3cm]
@@ -357,7 +526,24 @@ Compare \begin{ZX}
\zxN{} \rar &[\zxwCol] \zxZ{} \rar &[\zxwCol] \zxN{}
\end{ZX}
\end{codeexample}
-Note also that when the top left cell is empty, you can get an error at the compilation (no idea why) |Single ampersand used with wrong catcode|. To prevent that, you can add a none node at this position:
+This kind of code is so common that there is an alias for it: |\zxNL| and |\zxNR| automatically add a |\zxN{}| node, configure the column space (for this reason don't add an additional |&|, and be aware that emacs won't align them properly. Note also that the space will only be taken into account if it is on the first line) and add a straight arrow. The |L/R| part of the name is just to specify if the node is on the right or left of the diagram to put the column and arrow on the right side:
+\begin{codeexample}[]
+\zx{\zxNL \zxX{} \zxNR}
+\end{codeexample}
+Note that these two alias can be used without |{}|. But they are the only ones.
+
+The \verb!\zxN|{text}! and \verb!\zxN-{text}! may be useful to display some texts:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+ \begin{ZX}[content fixed baseline]
+ & \zxN|{\dots} \dar \\
+ \zxZ{\theta_i} \rar & \zxZ{} \dar \rar & \zxZ{-(\delta_i+\theta_i+r\pi)}\rar & \zxH{} \rar & \zxX{a\pi} \\
+ & \zxN|{\dots} \\
+ \end{ZX}
+\end{codeexample}
+}
+
+When the top left cell is empty, you may get an error at the compilation |Single ampersand used with wrong catcode| (this error should be fixed in latest releases) or |<symbol> allowed only in math mode| (not sure why). To solve this issue, you can add an empty node on the very first cell:
\begin{codeexample}[]
\begin{ZX}
\zxN{} &[\zxwCol] \zxN{} \ar[d]\\[\zxwRow]
@@ -365,11 +551,12 @@ Note also that when the top left cell is empty, you can get an error at the comp
\end{ZX}
\end{codeexample}
\end{pgfmanualentry}
-You may also get this error when |&| has already a different meaning, for instance in |align|, in that case you may change the |&| character into |\&| using |[ampersand replacement=\&]|:
+
+You may also get the error |Single ampersand used with wrong catcode| when |&| has already a different meaning, for instance in |align|, in that case you may change the |&| character into |\&| using |[ampersand replacement=\&]|. Note however that in recent versions ($\geq$ 2022/02/09) this should not happen anymore.
\begin{codeexample}[vbox]
\begin{align}
\begin{ZX}[ampersand replacement=\&]
- \zxN{} \rar \&[\zxwCol] \zxN{}
+ \zxN{} \rar \&[\zxWCol] \zxN{}
\end{ZX}
&= \begin{ZX}[ampersand replacement=\&]
\zxN{} \rar \&[\zxwCol] \zxZ{} \rar \&[\zxwCol] \zxN{}
@@ -380,17 +567,19 @@ You may also get this error when |&| has already a different meaning, for instan
\end{align}
\end{codeexample}
-\begin{command}{\zxNoneDouble\opt{+-}\marg{text}}
- Like |\zxNone|, but the spacing for \verb#+-|# is large enough to fake two lines in only one. Not extremely useful (or one needs to play with |start anchor=south,end anchor=north|).
+\begin{command}{\zxNoneDouble\opt{-\textbar+}\marg{text}}
+ Like |\zxNone|, but the spacing for \verb#-|+# is large enough to fake two lines in only one. Not extremely useful (or one needs to play with |start anchor=south,end anchor=north|).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
\begin{codeexample}[width=3cm]
\begin{ZX}
\zxNoneDouble|{} \ar[r,s,start anchor=north,end anchor=south] \ar[r,s,start anchor=south,end anchor=north] &[\zxWCol] \zxNoneDouble|{}
\end{ZX}
\end{codeexample}
+}
\end{command}
\begin{command}{\zxFracZ\opt{-}\marg{numerator}\opt{\oarg{numerator with parens}\oarg{denominator with parens}}\marg{denominator}}
- Adds a Z node with a fraction, use the minus decorator to add a small minus in front (the default minus is very big).
+ Adds a Z node with a fraction, use the minus decorator to add a small minus in front (a normal minus would be too big, but you can configure the symbol).
\begin{codeexample}[width=3cm]
\begin{ZX}
\zxFracZ{\pi}{2} & \zxFracZ-{\pi}{2}
@@ -398,7 +587,7 @@ You may also get this error when |&| has already a different meaning, for instan
\end{codeexample}
The optional arguments are useful when the numerator or the denominator need parens when they are written inline (in that case optional arguments must be specified): it will prove useful when using a style that writes the fraction inline, for instance the default style for labels:
\begin{codeexample}[]
-Compare
+Compare %
\begin{ZX}
\zxFracZ{a+b}[(a+b)][(c+d)]{c+d}
\end{ZX} with %
@@ -421,7 +610,7 @@ Compare
Adds a Z node. \meta{other styles} are optional \tikzname{} arguments (the same as the one provided to |tikz-cd|) They should be use with care, and if possible moved to the style directly to keep a consistent look across the paper.
\begin{codeexample}[width=3cm]
\begin{ZX}
- \zxZ{} & \zxZ{\alpha} & \zxZ{\alpha + \beta} & \zxZ[text=red]{(a \oplus b)\pi}
+ \zxZ{} & \zxZ{\alpha} & \zxZ{\alpha + \beta} & \zxZ[fill=blue!50!white,text=red]{(a \oplus b)\pi}
\end{ZX}
\end{codeexample}
The optional |-| optional argument is to add a minus sign (customizable, see |\zxMinusInShort|) in front of a very short expression and try to keep a circular shape. This is recommended notably for single letter expressions.
@@ -484,7 +673,7 @@ The |*| optional argument is to force a condensed style, no matter what is the t
\end{command}
\begin{command}{\middleManyDots{}}
- Shortcut to add a dots and a text next to it. It automatically adds the new column, see more examples below.
+ Shortcut to add a dots and a text next to it, see more examples below.
\begin{codeexample}[width=3cm]
\begin{ZX}
\zxX{\alpha} \middleManyDots{} & \zxX{\beta}
@@ -518,24 +707,76 @@ The |*| optional argument is to force a condensed style, no matter what is the t
\end{ZX}
\end{codeexample}
-\subsection{Phase in label style}
+
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/styles/rounded style/content vertically centered\@nil%
+ \extractkey/zx/styles/rounded style/content fixed baseline\@nil%
+ \extractkey/zx/styles/rounded style preload/content vertically centered\@nil%
+ \extractkey/zx/styles/rounded style preload/content fixed baseline\@nil%
+ \extractkey/zx/styles/rounded style preload/content fixed also frac\@nil%
+ \makeatother
+ \pgfmanualbody
+ By default the content of the nodes are vertically centered. This can be nice to have as much space as possible around the text, but when using several nodes with letters having different height or depth, the baseline of each node won't be aligned (this is particularly visible on nodes with very high text, like |b'|):
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxX[a=start]{\alpha} & \zxX{\beta} & \zxX{a} & \zxX{b} & \zxX*{a\pi} & \zxX*{b\pi}
+ & \zxX*{b'\pi} & \zxZ*{'b\pi} & \zxZ{(a \oplus b )\pi} & \zxFracX-{\pi}{4}
+ & \zxFracZ{\pi}{4} & \zxZ-{\delta} & \zxZ[a=end]-{\gamma}
+ \ar[from=start,to=end,on layer=background]
+\end{ZX}
+\end{codeexample}
+Using |content fixed baseline|, it is however possible to fix the height and depth of the text to make sure the baselines are aligned (|content vertically centered| is use to come back to the default behavior). When used as a ZX option, it avoids setting this on fractions since it renders poorly. Use |content fixed baseline also frac| if you also want to fix the baseline of all fractions as well (this last style is useful only as a ZX option, since |content fixed baseline| works on all nodes).
+\begin{codeexample}[width=0pt]
+\begin{ZX}[content fixed baseline]
+ \zxX[a=start]{\alpha} & \zxX{\beta} & \zxX{a} & \zxX{b} & \zxX*{a\pi} & \zxX*{b\pi}
+ & \zxX*{b'\pi} & \zxZ*{'b\pi} & \zxZ{(a \oplus b )\pi} & \zxFracX-{\pi}{4}
+ & \zxFracZ{\pi}{4} & \zxZ-{\delta} & \zxZ[a=end]-{\gamma}
+ \ar[from=start,to=end,on layer=background]
+\end{ZX}
+\end{codeexample}
+Note however that the height is really hardcoded (not sure how to avoid that) and is quite small (otherwise nodes quickly become too large), so too large content may overlay on top of the node (this is visible on the |'b\pi| node). You can use this style either on a per-picture basis (it's what we just did), on a per-node basis (just use it in the options of the node), or globally:
+\begin{codeexample}[width=0pt]
+\tikzset{
+ /zx/user overlay/.style={
+ content fixed baseline,
+ },
+}
+\begin{ZX}
+ \zxX[a=start]{\alpha} & \zxX{\beta} & \zxX{a} & \zxX{b} & \zxX*{a\pi} & \zxX*{b\pi}
+ & \zxX*{b'\pi} & \zxZ*{'b\pi} & \zxZ{(a \oplus b )\pi} & \zxFracX-{\pi}{4}
+ & \zxFracZ{\pi}{4} & \zxZ-{\delta} & \zxZ[a=end]-{\gamma}
+ \ar[from=start,to=end,on layer=background]
+\end{ZX}
+\end{codeexample}
+It can also be practical to combine it with |small minus|:
+\begin{codeexample}[]
+\begin{ZX}
+ \zxZ-{\delta_j} & \zxZ[content fixed baseline]-{\delta_j} &
+ \zxZ[small minus]-{\delta_j} & \zxZ[content fixed baseline,small minus]-{\delta_j}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\subsubsection{Phase in label style}
We also provide styles to place the phase on a label next to an empty node (not yet very well tested):
\begin{pgfmanualentry}
\makeatletter
\def\extrakeytext{style, }
- \extractkey/zx/styles rounded style/phase in content\@nil%
- \extractkey/zx/styles rounded style/phase in label=style (default {})\@nil%
- \extractkey/zx/styles rounded style/pil=style (default {})\@nil%
- \extractkey/zx/styles rounded style/phase in label above=style (default {})\@nil%
- \extractkey/zx/styles rounded style/pila=style (default {})\@nil%
- \extractkey/zx/styles rounded style/phase in label below=style (default {})\@nil%
- \extractkey/zx/styles rounded style/pilb=style (default {})\@nil%
- \extractkey/zx/styles rounded style/phase in label right=style (default {})\@nil%
- \extractkey/zx/styles rounded style/pilr=style (default {})\@nil%
- \extractkey/zx/styles rounded style/phase in label left=style (default {})\@nil%
- \extractkey/zx/styles rounded style/pill=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/phase in content\@nil%
+ \extractkey/zx/styles/rounded style/phase in label=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/pil=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/phase in label above=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/pila=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/phase in label below=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/pilb=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/phase in label right=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/pilr=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/phase in label left=style (default {})\@nil%
+ \extractkey/zx/styles/rounded style/pill=style (default {})\@nil%
\makeatother
\pgfmanualbody
The above styles are useful to place a spider phase in a label outside the node. They can either be put on the style of a node to modify a single node at a time:
@@ -551,16 +792,14 @@ We also provide styles to place the phase on a label next to an empty node (not
\end{codeexample}
\noindent or globally:
\begin{codeexample}[]
-{
- \tikzset{
- /zx/user post preparation labels/.style={
- phase in label={label position=-45, text=purple,fill=none}
- }
- }
- \zx{
- \zxFracX-{\pi}{2}
+\tikzset{
+ /zx/user overlay/.style={
+ phase in label={label position=-45, text=purple,fill=none}
}
}
+\zx{
+ \zxFracX-{\pi}{2}
+}
\end{codeexample}
Note that we must use |user post preparation labels| and not |/zx/user overlay nodes| because this will be run after all the machinery for labels has been setup.
@@ -600,6 +839,17 @@ For fractions, you can configure how you want the label text to be displayed, ei
Note that in |\zxFracZ{a+b}[(a+b)][(c+d)]{c+d}| the optional arguments are useful to put parens appropriately when the fraction is written inline.
\end{pgfmanualentry}
+\begin{stylekey}{/zx/defaultEnvdebug mode}
+ If this macro is defined, debug mode is active. See below how it can be useful (here is a quick example).
+\begin{codeexample}[width=3cm]
+\begin{ZX}[debug mode]
+ \rar[B] & [\zxwCol] \zxDivider[a=divTop]{} & \\
+ & & \zxZ[a=Ztopleft]{}
+ \ar[from=divTop, to=Ztopleft]
+\end{ZX}
+\end{codeexample}
+\end{stylekey}
+
\begin{command}{\zxDebugMode{}}
If this macro is defined, debug mode is active. See below how it can be useful.
\end{command}
@@ -649,7 +899,7 @@ Also, if you find your diagram a bit ``too high'', check that you did not forget
\begin{codeexample}[width=3cm]
Compare $\begin{ZX}
\zxZ{} \rar[o'] \rar[o.] & \zxX{}\\
- \zxZ{} \rar[o'] \rar[o.] \rar & \zxX{}\\ %% <--- remove last |\\|
+ \zxZ{} \rar[o'] \rar[o.] \rar & \zxX{}\\ %% <--- remove last \\
\end{ZX} = \zx{\zxEmptyDiagram}$ with $\begin{ZX}
\zxZ{} \rar[o'] \rar[o.] & \zxX{}\\
\zxZ{} \rar[o'] \rar[o.] \rar & \zxX{}
@@ -657,6 +907,739 @@ Also, if you find your diagram a bit ``too high'', check that you did not forget
\end{codeexample}
\end{stylekey}
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/zx/defaultEnv/math baseline row=row to center (default {1})\@nil%
+ \extractkey/zx/defaultEnv/mbr=row to center (default {1})\@nil%
+ \makeatother
+ You can also choose directly a line to center on: for instance to center on the first line, use: |math baseline row=1|, or, equivalently |mbr=1| or directly |mbr|:
+\begin{codeexample}[width=0pt]
+ $\begin{ZX}[mbr]
+ \zxN{} \rar[B] & [\zxwCol] \zxMatrix{A} \rar[B] &[\zxwCol] \zxN{}
+ \end{ZX} = A$
+\end{codeexample}
+Since 2023/10/03 you can also use a float value to specify that you want to set the center between two lines:
+\begin{codeexample}[width=0pt]
+ Compare $G = \begin{ZX}[circuit]
+ \rar & \zxGate{G} \rar & \zxGate{H} \rar & \\
+ \ar[rrr] & & &
+ \end{ZX}$ with $G = \begin{ZX}[circuit,mbr=1.5]
+ \rar & \zxGate{G} \rar & \zxGate{H} \rar & \\
+ \ar[rrr] & & &
+ \end{ZX}$.
+\end{codeexample}
+\end{pgfmanualentry}
+
+\subsubsection{Ground}
+
+\textbf{NB}: this functionality, based on custom nodes (\cref{subsec:customNodes}) was added on 13/03/2023.
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxGround\oarg{picture style}\opt{.}\opt{-}\opt{'}\marg{}\@@
+ \extractcommand\zxGroundScale\@@
+ \pgfmanualbody
+The ground symbol can be used to denote a discarding operation… but is also useful to compute the norm of a state or denote a measurement by first copying the state and discarding one copy. This way, a measurement in the computational basis can be represented as:
+\begin{codeexample}[width=0pt]
+ \begin{ZX}
+ & [\zxwCol] & [\zxwCol] \zxN{} \rar & \zxN{} \\
+ \zxN{} \rar & \zxZ{} \ar[ur,<'] \ar[dr,<'] & \\[\zxZeroRow]
+ & & \zxGround{}
+ \end{ZX}
+\end{codeexample}
+You can also change the direction using the alternative names:
+\begin{codeexample}[]
+ \begin{ZX}
+ \zxGround-{}\rar & \zxGround{} \\
+ \zxGround'{}\dar\\
+ \zxGround.{}
+ \end{ZX}
+\end{codeexample}
+Internally, the ground symbol is drawn using a |pic|, so you can customize it as any other pic:
+\begin{codeexample}[]
+ \begin{ZX}
+ \zxN{} \rar &[\zxwCol] \zxGround[scale=1.5,red,rotate=45]{}
+ \end{ZX}
+\end{codeexample}
+Note that you can also redefine |\def\zxGroundScale{1.8}| to change the default scale on a whole document.
+Moreover, by default the |pic| takes some space (this way it will not overlap with the next symbol, or the text below/after), but you want sometimes to make it |overlay|, for instance to preserve the symmetry with an empty wire (then, you might need to add some column space |&[yourspace]| or row space |\\[yourspace]| to avoid overlap with text around it):
+\begin{codeexample}[width=0pt]
+ Compare
+ \begin{ZX}
+ & [\zxwCol] & [\zxwCol] \zxN{} \rar & \zxN{} \\
+ \zxN{} \rar & \zxZ{} \ar[ur,<'] \ar[dr,<'] & \\
+ & & \zxGround[overlay]{}
+ \end{ZX}
+ with
+ \begin{ZX}
+ & [\zxwCol] & [\zxwCol] \zxN{} \rar & \zxN{} \\
+ \zxN{} \rar & \zxZ{} \ar[ur,<'] \ar[dr,<'] & \\
+ & & \zxGround{}
+ \end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\subsubsection{Scalable ZX}
+
+We provide some notations coming from the scalable ZX calculus~\cite{CHP19_SZXcalculusScalableGraphical}.
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxDivider\oarg{picture style}\oarg{picture style}\opt{.}\opt{-}\opt{'}\marg{}\@@
+ \pgfmanualbody
+ Dividers can be used to split (or gather) groups of wires. The |.|,|-|,|'| modifiers are used, respectively, to denote the bottom/right/top versions:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+We provide some pre-defined symbols in both horizontal: %
+\begin{ZX}
+ \zxZ[B]{} \rar[Bn'=n+m, wc] &[\zxwCol] \zxDivider{}
+ \rar[o',Bn'Args={n}{}]
+ \rar[o.,Bn.Args={m}{}] &[\zxWCol] \zxDivider-{} \rar[B,wc] & \zxZ[B]{}
+\end{ZX}
+ and vertical mode:
+\begin{ZX}
+ \zxZ[B]{} \dar[Bn=n+m, wc] \\[\zxwRow]
+ \zxDivider'{} \dar[-o,BnArgs={n}{}] \dar[o-,Bn-Args={m}{}] \\[\zxWRow]
+ \zxDivider.{} \dar[B,wc]\\
+ \zxZ[B]{}
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxMatrix\oarg{pic style}\oarg{node style}\opt{.}\opt{-}\opt{'}\opt{/}\opt{*}\opt{\_\{text in pmatrix\}}\marg{matrix name}\@@
+ \pgfmanualbody
+ Matrices are represented using arrows: |matrix name| is the content of the label of the node:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}
+ \zxN{} \rar & \zxMatrix{A} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+The |*| option is used to reverse the direction of the arrow, typically for the transpose (note how we can give an alias (with |a| in |node style|) to combine with |math baseline|, or its quicker variants |mbr=nb line to center on| to properly vertically align the node):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+We define %
+$\begin{ZX}[mbr]
+ \zxN{} \rar[B] & \zxMatrix*{A} \rar[B] & \zxN{}
+\end{ZX} \coloneqq
+\begin{ZX}[mbr=2]
+ & [\zxWCol] \zxN{} \ar[B,dr,s] & [\zxWCol] \zxN{} \\[\zxZeroCol+.3mm]
+\ar[B,dr,s] & \zxMatrix{A} \ar[B,u,C] \ar[B,d,C-] & \\
+ & & \zxN{} \\
+\end{ZX}$.
+\end{codeexample}
+}
+The position of the label can be changed with |-| is in horizontal wires, and in vertical wires we use |'| and |.| (putting the label respectively on right and left).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxN{} \rar & \zxMatrix{} \rar & \zxMatrix{A} \rar & \zxMatrix*{A} \rar
+ & \zxMatrix-{A} \rar & \zxMatrix-*{A} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Similarly in horizontal wires:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}
+ \zxN{} \dar \\
+ \zxMatrix'{} \dar \\
+ \zxMatrix.{A} \dar \\
+ \zxMatrix'*{A} \dar \\
+ \zxMatrix'{A} \dar \\
+ \zxMatrix.*{A} \dar \\
+ \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+If you want to change the position of the label to a more advanced position (e.g.\ with an angle), the simpler solution is to add |yourAngle:| in front of the label (see tikz labels for more details):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}
+ \zxZ{} \rar & \zxMatrix{45:A} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Note that it might be useful to put the label as an overlay using |/| (i.e. it is not counted in the bounding box of the cell, and might overlap with content around) in order to reduce space if we know there is nothing on the nearby cell: (we can also manually change the row/colum sep with negative values… but it might be better to avoid this kind of manual tweaks):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+Compare %
+\begin{ZX}
+ \zxZ{} \rar \dar & \zxMatrix-{A} \rar & \zxN{} \\
+ \zxX{}
+\end{ZX} with %
+\begin{ZX}
+ \zxZ{} \rar \dar & \zxMatrix-/{A} \rar & \zxN{} \\
+ \zxX{}
+\end{ZX}
+\end{codeexample}
+}
+It is also useful to put a |pmatrix| inside. While it is possible to write the full |pmatrix|, we can use the |_{}| embelishment to automatically wrap the text with |\begin{bmatrix} \end{bmatrix}|:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+This %
+\begin{ZX}[mbr]
+ \zxN{} \rar & \zxMatrix_{A & B \\ C & D}{} \rar & \zxN{}
+\end{ZX} %
+is a shortcut for %
+\begin{ZX}[math baseline row=1]
+ \zxN{} \rar & \zxMatrix{\begin{bmatrix} A & B \\ C & D \end{bmatrix}} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Note that it seems that some environments do not play well with the way we handle |&| (our changes were needed to make them compatible with |align|, and to provide an easy interface with the |external| library… but it seems to not fit well with all environments, e.g.\ arrays). In that case you should use |\begin{ZXNoExt}| together with |[ampersand replacement=\&]| (of course, use |\&| instead of |&| in the rest of the matrix):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+$\begin{ZXNoExt}[ampersand replacement=\&]
+ \zxN{} \rar \& \zxMatrix{
+ \begin{bmatrix}
+ \begin{array}{c|c}
+ A & B \\
+ \hline
+ C & D
+ \end{array}
+ \end{bmatrix}} \rar \& \zxN{}
+\end{ZXNoExt}$
+\end{codeexample}
+}
+Here is a demo to check if the true north etc anchors are placed correctly:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C'] \ar[to=Gll,C.] & \zxMatrix[a=Gll]'{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C'] \ar[to=Gll,C.] & \zxMatrix[a=Gll]'*{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C'] \ar[to=Gll,C.] & \zxMatrix[a=Gll].{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C'] \ar[to=Gll,C.] & \zxMatrix[a=Gll].*{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C] \ar[to=Gll,C-] \\
+ \zxMatrix[a=Gll]{G}
+\end{ZX} %
+\begin{ZX} %
+ \zxH{} \ar[to=Gll,C] \ar[to=Gll,C-] \\
+ \zxMatrix[a=Gll]*{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C-] \ar[to=Gll,C] \\
+ \zxMatrix[a=Gll]-{G}
+\end{ZX} %
+\begin{ZX}
+ \zxH{} \ar[to=Gll,C] \ar[to=Gll,C-] \\
+ \zxMatrix[a=Gll]-*{G}
+\end{ZX}
+\end{codeexample}
+}
+
+
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/zx/picCustomStyleMatrixMainNode\@nil%
+ \extractkey/zx/picCustomStyleMatrixLabel\@nil%
+ \extractkey/zx/picCustomStyleBeforeUserMatrix\@nil%
+ \extractkey/zx/picCustomStyleAterUserMatrix\@nil%
+ \extractkey/zx/picCustomStyleLastPicMatrix\@nil%
+ \makeatother
+ \pgfmanualbody
+If you would like to override some settings, note that you can use all customization options provided by our custom node system (\cref{subsec:customNodes}). In particular, you can use |pic style| to change the options of the pic used to draw the node, including scale, rotation…, |node style| to style the parent node of the pic (less used, mostly to give alias names to the shape). We additionally provide special styles to configure the nodes more precisely: |/zx/picCustomStyleMatrixMainNode| and |/zx/picCustomStyleMatrixLabel| to configure more specifically the :
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxN{} \rar & \zxMatrix{A} \rar &
+ \zxMatrix[
+ scale=2,
+ /zx/picCustomStyleMatrixMainNode/.style={fill=blue!50},
+ /zx/picCustomStyleMatrixLabel/.style={red}]{A}
+ \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+You can also set globally the styles like |/zx/picCustomStyleBeforeUserMatrix| (automatically provided, see details in \cref{subsec:customNodes}) to automatically add a style to your picture :
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\tikzset{
+ /zx/picCustomStyleBeforeUserMatrix/.style={
+ scale=2,
+ /zx/picCustomStyleMatrixMainNode/.style={fill=blue!50},
+ /zx/picCustomStyleMatrixLabel/.style={red,circle,draw,inner sep=1pt},
+ % \zxCustomPicAdditionalPic can be any tikz code to run after the creation of the pic:
+ /utils/exec={\def\zxCustomPicAdditionalPic{%
+ % the main node has empty name, so .center is the center of the main node
+ \node[draw,circle,inner sep=2pt,fill=pink] at (.center) {};%
+ }%
+ },
+ },
+}
+\begin{ZX}
+ \zxZ{} \rar & \zxMatrix{A} \rar & \zxMatrix*{B} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+
+\subsubsection{Circuit-related}
+
+Since 2023-09-17, we provide a number of options to typeset circuits.
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxBox\opt{\oarg{style}}\marg{box text}\@@
+ \extractcommand\zxGate\opt{\oarg{style}}\marg{box text}\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/every box=style\@nil%
+ \extractkey/zx/boxes=\marg{style to add}\@nil%
+ \makeatother
+ \pgfmanualbody
+ (both commands are alias) You can add simple gates using |\zxGate{X}| (the content is typeset in math mode by default), possibly adding additional styling to the main box using the optional argument or |/zx/every box/.style={your replacement style}| or |/zx/boxes={your style to add}|:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}
+ \zxBox{G} \rar[B] & [\zxwCol] \zxN{} \\
+ \zxBox[fill=green]{G_A} \rar[B] & [\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit, thick lines]
+ \rar & \zxGate[add label={below:\text{Hadamard}}]{H} \rar &
+\end{ZX}
+\end{codeexample}
+Note that you can also use matrices inside:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \rar & \zxGate{
+ \begin{pmatrix}
+ a & b\\
+ c & d
+ \end{pmatrix}
+ } \rar & \zxGate{f} \rar &
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\zxDefaultColumnSepCircuit\@@
+ \extractcommand\zxDefaultRowSepCircuit\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/defaultEnv/circuit\@nil%
+ \makeatother
+ \pgfmanualbody
+ This style enables the circuit mode, which is simply changing the default spacing between lines and columns. Compare:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}
+ \rar & \zxGate{H} \rar & \zxGateMulti{2}{3}{H} & & \rar & \\
+ \rar & \zxGate{H} \rar & & & \rar &
+\end{ZX}
+\end{codeexample}
+}
+with
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+ \rar & \zxGate{H} \rar & \zxGateMulti{2}{3}{H} & & \rar & \\
+ \rar & \zxGate{H} \rar & & & \rar &
+\end{ZX}
+\end{codeexample}
+}
+You can customize the default spacing with |\def\zxDefaultColumnSepCircuit{4mm}| and |\def\zxDefaultRowSepCircuit{4mm}|.
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxGateMulti\opt{\oarg{style fit node}}\opt{\oarg{advanced styling}}\marg{number rows}\marg{number columns}\marg{box text}\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/generic multi/add label=\marg{label}\@nil%
+ \extractkey/zx/generic multi/add label advanced=\marg{style}\marg{label}\@nil%
+ \extractkey/zx/generic multi/content inner nodes=\marg{content inner nodes}\@nil%
+ \extractkey/zx/generic multi/main=\marg{style}\@nil%
+ \extractkey/zx/generic multi/main text=\marg{style}\@nil%
+ \extractkey/zx/generic multi/additional code=\marg{code to add new nodes}\@nil%
+ \extractkey/zx/generic multi/fit content=\opt{\marg{additional row margin}\marg{additional column margin}\marg{minimum height inner nodes}\marg{minimum width inner nodes}}\@nil%
+ \extractkey/zx/generic multi/safe fit\@nil%
+ \makeatother
+ \pgfmanualbody
+ Create a multi-line/row gate:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+ \rar & \zxGate{H} \rar & \zxGateMulti{2}{3}{H} & & \rar & \\
+ \rar & \zxGate{H} \rar & & & \rar &
+\end{ZX}
+\end{codeexample}
+}
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+ \begin{ZX}
+ \rar & \zxBox{H} \rar & \zxGateMulti{1}{3}{H} \dar & & \rar & \zxBox{H} & & \\
+ & & \zxBox{H} \rar & \zxBox{H} & \zxBox{H} & & &
+ \end{ZX}
+\end{codeexample}
+}
+Note that the column will adapt to fit the content if it is too long:
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+ \rar & \zxGateMulti{1}{2}{HHHHHHHHHH} & \rar & \\
+ \zxGate{H} & \zxGate{H} & \zxGate{H} & \zxGate{H} &
+\end{ZX}
+\end{codeexample}
+You can also customize the style of a gate in a simple way using the first argument (the style will only be applied to the fitting box and to the box when computing its dimensions, but not to the content itself that is added in a separate node, see below for more fine-tuned configuration):
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+A & B & C & D & E & & \\
+\zxBox{H} \rar & \zxGateMulti[a=secondGate]{2}{3}{H} & & \rar & \zxBox{X} & & \\
+\zxBox{H} \rar & & & & \zxBox{X} \lar & & \\
+\zxBox{H} \rar \ar[dr,bend right] & \zxBox{H} \rar[to=secondGate] & & & & & \\
+ & \zxGateMulti[,fill=orange!50!white]{1}{2}{H} & &
+\end{ZX}
+\end{codeexample}
+You can also customize its behavior more precisely using the second optional argument using the above listed styles. |main| and |main text| allows you to change the style of the main node and the main text:
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+A & B & C & D & E & & \\
+\zxBox{H} \rar & \zxGateMulti[a=secondGate]{2}{3}{H} & & \rar & \zxBox{X} & & \\
+\zxBox{H} \rar & & & & \zxBox{X} \lar & & \\
+\zxBox{H} \rar \ar[dr,bend right] & \zxBox{H} \rar[to=secondGate] & & & & & \\
+ & \zxGateMulti[][main={fill=orange!50!white}, main text={red}]{1}{2}{H} & &
+\end{ZX}
+\end{codeexample}
+while |additional code| allows you to write arbitrary code after the creation of the main node (|zxMainNode| and |zxMainNodeText| are the alias of the main node and text node):
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+ \zxBox{H} \rar & \zxGateMulti[][
+ main={fill=orange!50!white},
+ main text={red},
+ additional code={
+ \node[
+ circle,
+ inner sep=2pt,
+ fill=red,
+ at={($(zxMainNode.east)+(0mm,1.5mm)$)},
+ zx subnode={redCircle}
+ ]
+ {};
+ }%
+ ]{1}{2}{H} & \rar[start subnode={redCircle}, to=lastH, C-] & \\
+ \zxBox[a=lastH]{H} &
+\end{ZX}
+\end{codeexample}
+
+The |add label| and |add label advanced| allows you to add labels:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \rar & \zxGateMulti[add label={Bell \\measurement}]{2}{1}{\zxMeter{}} \rar[classical] & \\
+ \rar & \rar[cl] &
+\end{ZX}
+\end{codeexample}
+Internally, in order to place the matrix, we place a number of inner nodes in the region of the matrix. You can customize them using |content inner nodes| and |style inner nodes|. This can be practical if you want to force the node to take less space for instance (but the content might go outside of the node):
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ & & & & & & & \\
+ & \zxGate{H} \rar & \zxGateMulti[][
+ content inner nodes={},
+ main={opacity=.5},
+ style inner nodes={
+ red,
+ minimum width=2pt,
+ minimum height=2pt,
+ test/.style={fill=#1,opacity=.7}, test=red
+ }]{2}{3}{HHHH} & & & & & \\
+ & & & & & & &
+ \end{ZX}
+\end{codeexample}
+
+By default, we run |fit content/.default={0mm}{0mm}{\zxBoxMinimumHeight}{\zxBoxMinimumWidth}| which works by evaluating the width of the content, and by automatically setting the size of the inner nodes so that the content fits nicely at the end (it takes the default column sep of the matrix, so it will not see custom adjustment of the column size with |&[1cm]|), with a minimum size. You can also call instead |safe fit| in the second argument, that will just set all inner nodes to be equal to the size of the content (which might not be optimal in term of space). While it is faster and works well with nodes of small size, it gives weird results on large nodes:
+Compare
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ & A & B & C & D & E & & \\
+ & \zxBox{H} \rar & \zxGateMulti{1}{3}{HHHH} & & \rar & \zxBox{H} & & \\
+ & & \zxBox{H} & \zxBox{H} & \zxBox{H} & & & \\
+ & & & & & & & \\
+ & & & & & & & \\
+\end{ZX}
+\end{codeexample}
+with
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ & A & B & C & D & E & & \\
+ & \zxBox{H} \rar & \zxGateMulti[][safe fit]{1}{3}{HHHH} & & \rar & \zxBox{H} & & \\
+ & & \zxBox{H} & \zxBox{H} & \zxBox{H} & & & \\
+ & & & & & & & \\
+ & & & & & & & \\
+\end{ZX}
+\end{codeexample}
+Note that if time is an issue for you, see the section on externalization \cref{sec:externalization}.
+\end{pgfmanualentry}
+
+%{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxElt\opt{\oarg{style}}\marg{box text}\@@
+ \extractcommand\zxCtrl\opt{\oarg{style}}\marg{}\@@
+ \extractcommand\zxOCtrl\opt{\oarg{style}}\marg{}\@@
+ \extractcommand\zxNot\opt{\oarg{style}}\marg{}\@@
+ \extractcommand\zxCross\opt{\oarg{style}}\marg{}\@@
+ \extractcommand\zxMeter\opt{\oarg{scale}}\marg{}\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/wires definition/classical\@nil%
+ \extractkey/zx/wires definition/cl\@nil%
+ \extractkey/zx/wires definition/=--\textbar\@nil%
+ \extractkey/zx/wires definition/=\textbar--\@nil%
+ \makeatother
+ \pgfmanualbody
+ |\zxElt| is like |\zxGate| but without any border (useful to add spacing around elements like |\ket{\psi}|, but you might prefer |\zxInput| that does not reserve any space in the matrix for the content and allows an easier align of wires), and the other commands just create the corresponding symbols that you can link together as you want as usual using |\ar| (note that |\zxMeter{}| is node a node but just an icon, so place it yourself inside |\zxGate| or |\zxGateMulti|). The style are wire styles, and are useful to print classical wires (|cl| is an alias for |classical|) and wires bent with a 90 degrees angle. Note that I could not write the right name in the doc, you should remove the equal sign like in \texttt{--\textbar}.
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \zxElt{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar &
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxInput\opt{\oarg{style}}\marg{text}\@@
+ \extractcommand\zxInputMulti\opt{\oarg{style}}\opt{\oarg{label style}}\marg{nb rows}\marg{text}\@@
+ \extractcommand\zxOutput\opt{\oarg{style}}\marg{text}\@@
+ \extractcommand\zxOutputMulti\opt{\oarg{style}}\opt{\oarg{label style}}\marg{nb rows}\marg{text}\@@
+ \extractcommand\zxGateInput\opt{\oarg{style}}\marg{text}\@@
+ \extractcommand\zxGateInputMulti\opt{\oarg{style}}\opt{\oarg{label style}}\marg{nb rows}\marg{text}\@@
+ \extractcommand\zxGateOutput\opt{\oarg{style}}\marg{text}\@@
+ \extractcommand\zxGateOutputMulti\opt{\oarg{style}}\opt{\oarg{label style}}\marg{nb rows}\marg{text}\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/enlarge brace=\marg{+ or - distance}\@nil%
+ \extractkey/zx/input style=\marg{style}\@nil%
+ \extractkey/zx/output style=\marg{style}\@nil%
+ \extractkey/zx/input multi style=\marg{style}\@nil%
+ \extractkey/zx/output multi style=\marg{style}\@nil%
+ \extractkey/zx/input multi label style=\marg{style}\@nil%
+ \extractkey/zx/output multi label style=\marg{style}\@nil%
+ \extractkey/zx/gate input style=\marg{style}\@nil%
+ \extractkey/zx/gate output style=\marg{style}\@nil%
+ \extractkey/zx/gate input multi style=\marg{style}\@nil%
+ \extractkey/zx/gate output multi style=\marg{style}\@nil%
+ \extractkey/zx/gate input multi label style=\marg{style}\@nil%
+ \extractkey/zx/gate output multi label style=\marg{style}\@nil%
+ \makeatother
+ \pgfmanualbody
+
+Use these functions in order to label the input or outputs of circuits (you can also label any diagram made with this library) or gates (the variant you want to use should be clear from the name. You can customize the arrow and label using the optional arguments or globally using the corresponding style (note that the style for the gate inputs was inspired by the great Quantikz package). The command should be located on the row where the brace should start (either in the cell containing the wire or inside the gate directly):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[]
+\begin{ZX}[circuit]
+ \rar \zxInputMulti[blue]{2}{\ket{\psi}} & \zxGateMulti{3}{2}{U} \zxGateInputMulti{2}{x}
+ & \rar \zxGateOutputMulti{2}{x \oplus y} & \zxOutputMulti[red][green]{2}{\text{Output}} \\
+ \rar &
+ & \rar & \\
+ \rar \zxInput{\ket{0}} & \zxGateInput{y}
+ & \rar \zxGateOutput{y \oplus 1} & \zxOutput{\ket{1}}
+\end{ZX}
+\end{codeexample}
+}
+
+You can enlarge or reduce the distance of the braces (set by default to |\zxDefaultEnlargeBraceOne| for braces on single wires, and |\zxDefaultEnlargeBraceMulti| for braces on multiple wires) using |enlarge brace|:
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxBox[a=A]{A} \rar & \zxOutputMulti{1}{\parbox{2.2cm}{\raggedright\tiny
+ This is the default spacing for one multi-output}} \\
+ \zxBox{B} \rar & \zxOutputMulti{2}{\parbox{2.2cm}{\raggedright\tiny
+ This is the default spacing for multiple outputs}} \\
+ \zxBox[a=B]{B} \rar & \\
+ \zxBox[a=A]{A} \rar & \zxOutputMulti[enlarge brace=1mm]{1}{\parbox{2.2cm}{\raggedright\tiny
+ You can increase or decrease the spacing}} \\
+ \zxBox{B} \rar & \zxOutputMulti[enlarge brace=-\zxDefaultEnlargeBraceMulti]{2}{\parbox{2.2cm}{
+ \raggedright\tiny You can increase or decrease the spacing}} \\
+ \zxBox[a=B]{B} \rar & \\
+\end{ZX}
+\end{codeexample}
+
+You can prefix the above commands with |V| (for vertical) when reading from bottom to top (the associated style starts with |vertical|):
+
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \dar \zxVOutputMulti{2}{\text{Output}} & \dar & \dar \zxVOutput{\ket{1}} \\
+ \zxGateMulti{2}{3}{U} \zxVGateOutputMulti{2}{x \oplus y} & & \zxVGateOutput{y \oplus 1} \\
+ \dar \zxVGateInputMulti{2}{x} & \dar & \dar \zxVGateInput{y} \\
+ \zxVInputMulti{2}{\ket{\psi}} & & \zxVInput{\ket{0}}
+\end{ZX}
+\end{codeexample}
+}
+
+You can also use |\zxT| (for Top) instead of |\zxV| if you prefer the convention where inputs are located at the top of the diagram):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \dar \zxTInputMulti{2}{\ket{\psi}} & \dar & \dar \zxTInput{\ket{0}} \\
+ \zxGateMulti{2}{3}{U} \zxTGateInputMulti{2}{x} & & \zxTGateInput{y} \\
+ \dar \zxTGateOutputMulti{2}{x\oplus y} & \dar & \dar \zxTGateOutput{y \oplus 1} \\
+ \zxTOutputMulti{2}{\text{Output}} & & \zxTOutput{\ket{1}}
+\end{ZX}
+\end{codeexample}
+}
+Note that these labels are not taken into account when computing the width of the gate box, so you might need to manually adapt their width of the column, for instance by setting the content of an individual cell like:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \dar \zxTInputMulti{2}{\ket{\psi}} & \dar & \dar \zxTInput{\ket{0}} \\
+ \zxGateMulti{2}{3}{U} \zxTGateInputMulti{2}{x} & & \zxTGateInput{y} \\
+ \dar \zxTGateOutputMulti{2}{x\oplus y} & \dar
+ %% We replace the cell with a larger cell:
+ & \zxGate[zxTinyFontAndSpacing]{\phantom{y \oplus 1 \oplus x}};
+ %% This is useful or the cell will be replaced by another cell during the fit:
+ \zxMainNodeAlreadySet{} \dar \zxTGateOutput{y \oplus 1 \oplus x} \\
+ \zxTOutputMulti{2}{\text{Output}} & & \zxTOutput{\ket{1}}
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxSlice\opt{\oarg{style label}}\opt{\oarg{style line}}\opt{position percent}\marg{text}\@@
+ \extractcommand\zxVSlice\opt{\oarg{style label}}\opt{\oarg{style line}}\opt{position percent}\marg{text}\@@
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/slice label style=\marg{style}\@nil%
+ \extractkey/zx/slice line style=\marg{style}\@nil%
+ \extractkey/zx/vertical slice label style=\marg{style}\@nil%
+ \extractkey/zx/vertical slice line style=\marg{style}\@nil%
+ \makeatother
+ \pgfmanualbody
+
+ You can add a slice in your diagram or circuit using |\zxSlice{text}| at the corresponding column:
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ \rar & \zxGate{X} \zxSlice{1} \rar & \zxGate{Y} \zxSlice{Part\\2} \rar & \zxGate{\zxMeter{}} \\
+ \rar & \zxGate{H} \rar & \zxGate{Y} \rar &
+ \end{ZX}
+\end{codeexample}
+We also provide a style |rotated=angle| to rotate the label (the default angle is 30 degrees):
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \rar & \zxGate{X} \zxSlice[rotated]{First part} \rar
+ & \zxGate{Y} \zxSlice[rotated]{Second part} \rar & \zxGate{\zxMeter{}} \\
+ \rar & \zxGate{H} \rar & \zxGate{Y} \rar &
+\end{ZX}
+\end{codeexample}
+You can change the position using the 3rd optional argument (default to .5):
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ \rar & \zxGate{X} \zxSlice[][][.2]{1} \rar & \zxGate{Y} \zxSlice[][][.8]{Part\\2} \rar & \zxGate{\zxMeter{}} \\
+ \rar & \zxGate{H} \rar & \zxGate{Y} \rar &
+ \end{ZX}
+\end{codeexample}
+You can also customize it as you want using the two optional arguments (for the label first and for the line after):
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ \rar
+ & \zxGate{Y} \rar
+ \zxSlice[rotate=90,anchor=east,pos=1,blue][solid,blue,decorate,decoration={snake}]{Why not \\below?}
+ & \zxGate{\zxMeter{}} \\
+ \rar & \zxGate{H} \rar & \zxGate{Y} \rar &
+\end{ZX}
+\end{codeexample}
+Finally, the |\zxVSlice| version works similarly, but for vertical slices (make sure to insert it \textbf{before} the newline):
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ \zxElt{\text{Alice}} &[\zxZeroCol] \rar & \zxGate{X} \rar & \zxGate{Y} \rar & \zxGate{\zxMeter{}}
+ \zxVSlice{No communication}\\
+ \zxElt{\text{Bob}} & \rar & \zxGate{H} \rar & \zxGate{Y} \rar &
+ \end{ZX}
+\end{codeexample}
+You can configure it as before, for instance to obtain this fancy effect:
+\begin{codeexample}[width=0pt]
+ \begin{ZX}[circuit]
+ \rar & \zxCtrl{} \rar \dar & \zxGate{Y} \rar & \zxGate{\zxMeter{}}
+ \zxVSlice[][
+ black,
+ double distance=4pt,
+ double,
+ solid,
+ decorate,
+ decoration={snake,segment length=2cm},
+ % Also funny:
+ % decoration={random steps,segment length=.2cm},
+ on layer=foreground
+ ]{Repeat $n$ times}\\[3mm]
+ \rar & \zxCtrl{} \dar \rar & \zxGate{Y} \rar & \zxGate{\zxMeter{}}\\
+ \rar & \zxGate{X} \rar & \zxGate{Y} \rar & \zxGate{\zxMeter{}}
+ \end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/tikz/zx filling style=\marg{your style} (default {fill=white})\@nil%
+ \makeatother
+ \pgfmanualbody
+We can also disable or set any custom filling using this style:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit,/tikz/zx filling style/.style={}]
+ \zxInput{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar & \zxOutput{\ket{\phi}}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/tikz/every node/block\@nil%
+ \makeatother
+This is useful if you wish to typeset a block that must be wrapped inside a minipage-like environment (actually we use varwidth):
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \rar & \zxGate[block]{
+ \procedureblock[linenumbering]{$\indcpa_\enc^\adv(\secpar)$}{
+ b \sample \bin\\
+ (\pk,\sk)\sample \kgen(\secparam)
+ }
+ } \rar & \zxGate{f} \rar &
+\end{ZX}
+\end{codeexample}
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit, zx column sep=6mm]
+ \rar["k"] & \zxGateMulti[block]{2}{3}{
+ \procedureblock[linenumbering]{$\mathsf{Enc}(k,m)$}{
+ \pclinecomment{This is the standard one-time pad:} \\
+ \pcreturn k \oplus m
+ }
+ } & & \rar["c"] & \zxGate{\mathcal{A}} \rar["\tilde{m}"] & \\
+ \rar["m"]&& & & &
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+
\subsection{Wires}
\subsubsection{Creating wires and debug mode}
@@ -664,8 +1647,9 @@ Also, if you find your diagram a bit ``too high'', check that you did not forget
\begin{pgfmanualentry}
\extractcommand\arrow\opt{\oarg{options}}\@@
\extractcommand\ar\opt{\oarg{options}}\@@
+ \extractcommand\zxWire\marg{options}\@@
\pgfmanualbody
- These synonym commands (actually coming from |tikz-cd|) are used to draw wires between nodes. We refer to |tikz-cd| for an in-depth documentation, but what is important for our purpose is that the direction of the wires can be specified in the \meta{options} using a string of letters |r| (right), |l| (left), |u| (up), |d| (down). It's also possible to specify a node alias as a source or destination as shown below.
+ These synonym commands (actually coming from |tikz-cd|, except for the last |\zxWire| that is introduced in this library in 2023-10-03 for readability, note that |\zxWire| additionally adds by default a |r| to go right) are used to draw wires between nodes. We refer to |tikz-cd| for an in-depth documentation, but what is important for our purpose is that the direction of the wires can be specified in the \meta{options} using a string of letters |r| (right), |l| (left), |u| (up), |d| (down). It's also possible to specify a node alias as a source or destination as shown below.
\begin{codeexample}[]
\zx{\zxZ{} \ar[r] & \zxX{}} = \zx{\zxX{} \arrow[rd] \\ & \zxZ{}}
\end{codeexample}
@@ -682,6 +1666,13 @@ Also, if you find your diagram a bit ``too high'', check that you did not forget
\end{ZX}
\end{codeexample}
}
+The |\zxWire| can be used as follows:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit, row sep={.6cm,between origins}]
+\zxWire{} & \zxCross{} \zxWire{} \zxWire{d} & \\
+\zxWire{} & \zxCross{} \zxWire{} &
+\end{ZX}
+\end{codeexample}
\end{pgfmanualentry}
As explained in |tikz-cd|, there are further shortened forms:
@@ -775,12 +1766,133 @@ In that setting, it is often useful to enable the debug mode via |\def\zxDebugMo
}
\end{codeexample}
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/zx/wires definition/3d above\@nil%
+ \makeatother
+ \pgfmanualbody
+This style is useful to fake a 3D effect to put a wire above another one like \begin{ZX}[]
+ \zxN{} \ar[d,C] \ar[rd,s] & [\zxWCol] \zxN{} \dar[C-] \\[\zxWRow]
+ \zxN{} \ar[ru,s,3d above] & \zxN{}
+\end{ZX} using:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[]
+ \zxN{} \ar[d,C] \ar[rd,s] & [\zxWCol] \zxN{} \dar[C-] \\[\zxWRow]
+ \zxN{} \ar[ru,s,3d above,very thick] & \zxN{}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/zx/defaultEnv/thick lines\@nil%
+ \extractkey/tikz/zx thickness wires style=your style\@nil%
+ \makeatother
+When designing circuits, you might prefer a thicker line style, following the style of Quantikz. This is not enabled by default since for ZX diagrams we want to maintain an important difference between this version and the bold version, but you can enable it with |thick lines|, that internally sets the style |zx thickness wires style| to |thick, line cap=round|.
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+Compare \begin{ZX}[circuit, thick lines]
+ \zxInput{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar & \zxOutput{\ket{\phi}}
+\end{ZX} with \begin{ZX}[circuit]
+ \zxInput{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar & \zxOutput{\ket{\phi}}
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+
\subsubsection{Wire styles (new generation)}
We give now a list of wire styles provided in this library (|/zx/wires definition/| is an automatically loaded style). We recommend using them instead of manual styling to ensure they are the same document-wise, but they can of course be customized to your need. Note that the name of the styles are supposed (ahah, I do my best with what ASCII provides) to graphically represent the action of the style, and some characters are added to precise the shape: typically |'| means top, |.| bottom, |X-| is right to X (or should arrive with angle 0), |-X| is left to X (or should leave with angle zero). These shapes are usually designed to work when the starting node is left most (or above of both nodes have the same column). But they may work both way for some of them.
Note that the first version of that library (which appeared one week before this new version\dots{} hopefully backward compatibility won't be too much of a problem) was using |in=| and |out=| to create these styles. However, it turns out to be not very reliable since the shape of the wire was changing (sometimes importantly) depending on the position of the nodes. This new version should be more reliable, but the older styles are still available by using |IO, nameOfWirestyle| (read more in \cref{subsub:IOwires}).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ % not sure how to do it in a cleaner way without manually defining everything
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/|--}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{|--}{}
+ % the space after \textt is important or we get two different sections
+ % the 2 is just a random char since | does not work (the syntax is "stuff to group@actual text to print" as
+ % I understand)
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!2--@\texttt {\protect\pgfmanualbar--}}
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/--|}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{--|}{}
+ % the space after \textt is important or we get two different sections
+ % the 2 is just a random char since | does not work (the syntax is "stuff to group@actual text to print" as
+ % I understand)
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!--2@\texttt {--\protect\pgfmanualbar}}
+ \makeatother
+ \pgfmanualbody
+ This gives a wire bent with a 90 degrees angle (respectively starting horizontally then vertically, or first vertically then horizontally).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}[circuit]
+ \zxElt{\ket{\psi}} \rar & \zxBox{H} \rar & \zxCtrl{} \dar \rar & \zxCross{} \dar \rar
+ & \zxBox[add label={Measure}]{\zxMeter{}} \ar[dr,classical,--|] \\
+ \ar[r] & \zxOCtrl{} \rar \ar[u] & \zxNot{} \rar & \zxCross{} \ar[rr]
+ & & \zxBox{H} \rar &
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+}
+
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+ % I can't find a cleaner solution than manually calling pdflabel, pgfmanualentryheadline etc due to the |
+ % character
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }\catcode`\|=12
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/horizontal |--}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{horizontal |--}{}
+ % the space after \textt is important or we get two different sections
+ % the 2 is just a random char since | does not work (the syntax is "stuff to group@actual text to print" as
+ % I understand)
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!horizontal 2--@\texttt {horizontal \protect\pgfmanualbar--}}
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/horizontal --|}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{horizontal --|}{}
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!horizontal --2@\texttt {horizontal --\protect\pgfmanualbar}}
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/vertical |--}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{vertical |--}{}
+ % the space after \textt is important or we get two different sections
+ % the 2 is just a random char since | does not work (the syntax is "stuff to group@actual text to print" as
+ % I understand)
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!vertical 2--@\texttt {vertical \protect\pgfmanualbar--}}
+ \pgfmanualentryheadline{{\ttfamily\declare{/zx/wires definition/vertical --|}}\hfill(style, no default)}%
+ \pgfmanualpdflabel[\catcode`\|=12 ]{vertical --|}{}
+ \index{zx@\texttt {/zx/}!wires definition@\texttt {wires definition/}!vertical --2@\texttt {vertical --\protect\pgfmanualbar}}
+ \makeatother
+ \pgfmanualbody
+Like \texttt{--\textbar} \texttt{\textbar--} except that it only keeps the horizontal/vertical part. This is mostly useful when you want an horizontal/vertical wire starting/ending at a point without having to bother about shifting the other point to maintain horizontality:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \rar[horizontal |--, end subnode=A] \rar[horizontal |--, end subnode=B] &
+ \node[circle,fill=blue,zx subnode=A,yshift=2mm]{a}; \node[circle,fill=green,zx subnode=B,yshift=-2mm]{b};
+ \rar[horizontal --|, start subnode=A] \rar[horizontal --|, start subnode=B] &
+\end{ZX} and %
+\begin{ZX}
+ \dar[vertical --|, end subnode=A]
+ \dar[vertical --|, end subnode=B] \\
+ \node[circle,fill=blue,zx subnode=A,xshift=-2mm]{a};
+ \node[circle,fill=green,zx subnode=B,xshift=2mm]{b};
+ \dar[vertical |--, start subnode=A] \dar[vertical |--, start subnode=B] \\
+\end{ZX}
+\end{codeexample}
+}
+\end{pgfmanualentry}
+}
+
\begin{pgfmanualentry}
\makeatletter
\def\extrakeytext{style, }
@@ -827,6 +1939,26 @@ The \meta{radius ratio} parameter can be used to turn the circle into an ellipse
\zxZ{} \ar[r,C.=2] & \zxX{}
\end{ZX}.
\end{codeexample}
+
+Note that you can customize like for other nodes the direction of the wire using something like |\ar[d, C, end anchor=south]| or |\ar[d, C, end subnode=mySubnode]|. For more advanced users, you can create your own gates and specify directly inside the gate where the |C|-like shapes should connect to. The algorithm followed is:
+\begin{itemize}
+\item First, it tries to connect to the center of a |true west|, |true east|, |true north|, |true south| subnode (depending on the variation of |C|).
+\item Then, it tries to connect to a |true west|, |true east|, |true north|, |true south| \textbf{anchor}
+\item Otherwise, it falls back to the |west|, |east|, |north|, |south| anchors.
+\end{itemize}
+
+\begin{codeexample}[width=0pt]
+\NewExpandableDocumentCommand{\myWeirdGate}{}{
+ \zxBox[a=foo]{D}
+ \node[circle,fill=green,zx subnode=true west,inner sep=2pt,at=(foo.south west)]{};
+}
+
+\begin{ZX}
+ A \dar[C] \\
+ \myWeirdGate
+\end{ZX}
+\end{codeexample}
+
\end{pgfmanualentry}
@@ -906,7 +2038,7 @@ When the nodes are too far appart, the default angle of |30| may produce strange
\extractkey/zx/wires definition/no fake center\@nil%
\makeatother
\pgfmanualbody
- Usually each wire should properly use these functions, so the end user should not need that too often (during a first reading, you can skip this paragraph). We added 4 anchors to nodes: |fake center north|, |fake center south|, |fake center east| and |fake center west|. These anchors are used to determine the starting point of the wires depending on the direction of the wire (I tried to use more complex methods to ensure the wires would start on the boundary, but \mylink{https://tex.stackexchange.com/questions/619274}{they all fail}). Because some nodes may not have these anchors, we can't directly set |start anchor=fake center north, on layer=edgelayer| (but the user can do that if they are using only nodes with these anchors) or the code may fail on some nodes. For that reason, we check that these anchors exist while drawing our wires (which, at the best of my knowledge, can only be done while drawing the path). The |start/end fake center *| code is responsible to configure that properly (|start real center| will use the real center), and |left to right| (and similar) just configure both the |start| and |end| point to ensure the node starts at the appropriate anchor. However this won't work for style not defined in this library: in case you are sure that these anchors exists and want to use your own wire styles, you can then set the anchors manually and use |on layer=edgelayer|, or use |force left to right| (and similar) which will automatically do that for the |start| and |end| points.
+ Usually each wire should properly use these functions, so the end user should not need that too often (during a first reading, you can skip this paragraph). We added 4 anchors to nodes: |fake center north|, |fake center south|, |fake center east| and |fake center west|. These anchors are used to determine the starting point of the wires depending on the direction of the wire. Because some nodes may not have these anchors, we can't directly set |start anchor=fake center north, on layer=edgelayer| (but the user can do that if they are using only nodes with these anchors) or the code may fail on some nodes. For that reason, we check that these anchors exist while drawing our wires (which, at the best of my knowledge, can only be done while drawing the path). The |start/end fake center *| code is responsible to configure that properly (|start real center| will use the real center), and |left to right| (and similar) just configure both the |start| and |end| point to ensure the node starts at the appropriate anchor. However this won't work for style not defined in this library: in case you are sure that these anchors exists and want to use your own wire styles, you can then set the anchors manually and use |on layer=edgelayer|, or use |force left to right| (and similar) which will automatically do that for the |start| and |end| points.
\begin{codeexample}[]
\begin{ZX}
\zxX{\alpha+\beta} \ar[r,o',no fake center] & \zxZ{\alpha+\beta}\\
@@ -977,7 +2109,7 @@ When the nodes are too far appart, the default angle of |30| may produce strange
\extractkey/zx/wires definition/S.-=-andL config (default \{defaultS',default-S,symmetry\})\@nil%
\makeatother
\pgfmanualbody
- |s| and |S| are used to create a s-like wire, to have nicer diagonal lines between nodes. Other versions are soften versions (the input and output angles are not as sharp. Adding |'| or |.| specifies if the wire is going up-right or down-right, however as of today if it mostly used for backward compatibility since, for instance, |-s'| is the same as |-s| (but some styles may want to do a difference later). The only exception is for |s|/|s'|/|s.|: |s| has a sharper output angle than |s'| and |s.| (which are both equals).
+ |s| and |S| are used to create a s-like wire (|s| is smoother than |S| that arrives and leave horizontally), to have nicer diagonal lines between nodes. Other versions are soften versions (the input and output angles are not as sharp. Adding |'| or |.| specifies if the wire is going up-right or down-right, however as of today if it mostly used for backward compatibility since, for instance, |-s'| is the same as |-s| (but some styles may want to do a difference later). The only exception is for |s|/|s'|/|s.|: |s| has a sharper output angle than |s'| and |s.| (which are both equals).
\begin{codeexample}[width=3cm]
\begin{ZX}
\zxX{\alpha} \ar[s,rd] \\
@@ -1317,6 +2449,20 @@ Note that it's possible to automatically start wires on the border of the node,
\makeatother
\pgfmanualbody
To create a bezier wire. These styles are not really meant to be used for the final user because they are long to type and would not be changed document-wise when the style is changed, but most styles are based on these styles. For the |bezier 4 *| versions, the two first arguments are the relative position of the first anchor (|x| and |y| position), the next two of the second anchor. In the |bezier *| versions, the value of |1-| will be the relative |x| position of the first point, |1L| the relative position of the second, and |2-| and |2L| will be for the second point (the advantage of this is that it is also possible to specify angles using |1al={angle}{length}|\dots{} as explained in the |-andL| syle). They are said to be relative in the sense that |{0}{0}| is the coordinate of the first point, and |{1}{1}| the second point. The |bezier x| and |bezier 4 y| are useful when the node are supposed to be horizontally or vertically aligned: the distance are now expressed as a fraction of the horizontal (respectively vertical) distance between the two nodes. Using relative coordinates has the advantage that if the nodes positions are moved, the aspect of the wire does not change (it is just squeezed), while this is not true with |in|/|out| wires which preserves angles but not shapes.
+Note that all arrows that are based on the |bezier| style (most of the keys: |o|-like, |N|-like, |<|-like, |s|-like) can try to connect to subnodes or anchors called |fake center {east/north/west/south}| in order to start the wire in between the real center and an |east/...| coordinate (note that some variations can use another anchor, for instance |<'| will set the end anchor to |west| by default). Since adding manually an anchor to a node can be quite tedious, it is often easier to create a subnode, using either |zx subnode=name of subnode| or |\zxCoordinateSubnode{name of subnode}|. For instance, we show how to create a node such that bezier arriving from right will be connected to the south east part of the node while bezier leaving from the left will start at the north east anchor:
+\begin{codeexample}[width=0pt]
+\NewExpandableDocumentCommand{\myWeirdNode}{m}{%
+ \node[zx main node,alias=tmp,fill=pink,rounded corners,inner sep=2pt]{A};
+ % will be used by bezier curves to know how to connect:
+ \zxCoordinateSubnode[at={(tmp.north east)}]{fake center east}
+ \zxCoordinateSubnode[at={(tmp.south west)}]{fake center west}
+}
+
+\begin{ZX}
+ \myWeirdNode{A} \ar[rd, s] \ar[C,dr] & & \myWeirdNode{B} \\
+ & \zxZ{a \oplus b \oplus c \oplus d} \ar[ru, s] &
+\end{ZX}
+\end{codeexample}
\end{pgfmanualentry}
@@ -1402,7 +2548,7 @@ Note that the |IO| version cannot really be used when nodes are not aligned (usi
Normal \begin{ZX}
\zxX{\alpha} \ar[dr,C]\\
& \zxNone{}
- \end{ZX}, and |IO| \begin{ZX}
+ \end{ZX}, and IO \begin{ZX}
\zxX{\alpha} \ar[dr,IO,C]\\
& \zxNone{}
\end{ZX}
@@ -1638,6 +2784,928 @@ A swapped Bell pair is %
\end{codeexample}
\end{pgfmanualentry}
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/wires definition/bold\@nil%
+ \extractkey/zx/wires definition/B\@nil%
+ \extractkey/zx/wires definition/non bold\@nil%
+ \extractkey/zx/wires definition/NB\@nil%
+ \extractkey/zx/wires definition/boldn\@nil%
+ \extractkey/zx/wires definition/boldn-\@nil%
+ \extractkey/zx/wires definition/boldn'\@nil%
+ \extractkey/zx/wires definition/boldn.\@nil%
+ \extractkey/zx/wires definition/Bn=message (default n)\@nil%
+ \extractkey/zx/wires definition/Bn-=message (default n)\@nil%
+ \extractkey/zx/wires definition/Bn'=message (default n)\@nil%
+ \extractkey/zx/wires definition/Bn.=message (default n)\@nil%
+ \extractkey/zx/wires definition/BnArgs=\{message\}\{style\} (default \{n\}\{\})\@nil%
+ \extractkey/zx/wires definition/Bn-Args=\{message\}\{style\} (default \{n\}\{\})\@nil%
+ \extractkey/zx/wires definition/Bn'Args=\{message\}\{style\} (default \{n\}\{\})\@nil%
+ \extractkey/zx/wires definition/Bn.Args=\{message\}\{style\} (default \{n\}\{\})\@nil%
+ \makeatother
+ \pgfmanualbody
+ Creates a bold (or non-bold) wire (|B| and |NB| being short aliases). The versions with a |n| at the end adds a $n$ on the right/left/above/below (for the respective symbols empty, |-|, |'|, |.|), that you can overwrite by providing an option:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxX[bold]{} \rar[Bn',o'] \rar[Bn.=m,o.] &[\zxwCol] \zxZ{} \rar &[\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Finally, the last variations with args like |BnArgs| allows you to provide an additional label style, notably arguments like |pos=.7| to change the position of the line in the path (when the lines are drawn from the middle of the nodes, which is the case for many styles by default for efficiency reasons, the middle of the path may appear poorly centered: using |pos| is one method to center it back, see also \cref{subsec:wiresInsideOutside}).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxX[bold]{} \rar[<.,Bn.Args={n}{pos=.6},dr] &[\zxwCol] \\
+ & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Note that |bold| and its alias |B| can also be used as an argument to the |ZX| environment to turn all spiders and wires in bold:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[bold]
+ \zxX{} \rar[o'] \rar[o.] & \zxZ{} \rar &[\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+You might also want to combine it with the |non bold| option to temporarily set a wire non-bold:
+\begin{codeexample}[width=0pt]
+\begin{ZX}[bold]
+ \zxX{} \rar[o'] \rar[o.] & \zxZ{} \rar[non bold] &[\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \makeatletter
+ \def\extrakeytext{style, }
+ \extractkey/zx/styles/rounded style/wires bold\@nil%
+ \extractkey/zx/styles/rounded style/Bw\@nil%
+ \extractkey/zx/styles/rounded style/BBw\@nil%
+ \makeatother
+ \pgfmanualbody
+ If you set |wires bold| (alias |Bw|) to a node, all wired connected to that node will be bold. |BBw| additionally turn the current node bold.
+\begin{codeexample}[width=0pt]
+\begin{ZX}
+ \zxX{} \rar[o'] \rar[o.] & \zxZ[BBw]{} \rar &[\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+
+\subsection{Custom nodes}\label{subsec:customNodes}
+
+\textbf{NB}: a number of functionalities needed in this section were added on 24/02/2023 and 03/10/2023, so be sure to have the latest version.
+
+\subsubsection{Creating your own node: method 1}
+
+Technically, you can create any tikz style to create custom nodes like:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \begin{ZX}
+ \zxN{} \rar & |[draw,fill=blue!50,draw=blue,inner sep=3mm]| \text{my custom node}
+ \end{ZX}
+\end{codeexample}
+}
+possibly using |\tikzset| and/or |\NewExpandableDocumentCommand| to avoid repetitions:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \tikzset{
+ my custom node/.style={
+ draw,fill=blue!50,draw=blue,inner sep=3mm
+ },
+ }
+ \NewExpandableDocumentCommand{\myCustomNode}{m}{|[my custom node]| \text{#1}}
+ \begin{ZX}
+ \zxN{} \rar & \myCustomNode{Hey}
+ \end{ZX}
+\end{codeexample}
+}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxCoordinateSubnode\opt{\oarg{style}}\marg{name of subnode}\@@
+ \extractcommand\zxCoordinateMain\opt{\oarg{style}}\marg{}\@@
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/tikz/zx main node\@nil%
+ \extractkey/tikz/zx subnode=\marg{name of subnode}\@nil%
+ \extractkey/tikz/zx at origin\@nil%
+ \extractkey/tikz/start subnode=\marg{name of subnode}\@nil%
+ \extractkey/tikz/end subnode=\marg{name of subnode}\@nil%
+ \makeatother
+ \pgfmanualbody%
+
+However, we recommend users to use the |\node[zx main node,zx at origin, ...]{...};| syntax rather than:
+\begin{verbatim}
+|[...]| ...
+\end{verbatim}
+for multiple reasons: first, it will be more robust (for instance you need the |\node| syntax if you plan to insert this in |zxExecuteAtEndPicture| or in a regular tikz picture which is not contained in a matrix), but you also have more freedom since you can create nodes having multiples subnodes, anchors etc.
+You should note the |zx main node| that is needed to give a name to the current node so that |\arrow| can find it, otherwise you will get an error saying that the node does not exists when you try to link to it, and |zx at origin| that will just do |at={(0,0)}| (which is the default position anyway) but that might be useful later in order to easily place a node outside of a matrix. We also provide |\zxCoordinateMain| as the equivalent of |zx main node| for coordinates since they would not accept a name via a style.
+
+Subnodes are a kind of generalization of anchors: you can define an existing node as a subnode with |zx subnode=your subnode| and link from/to this node using |start subnode=your subnode| and |end subnode=your subnode|:
+
+\begin{codeexample}[width=0pt]
+\NewExpandableDocumentCommand{\zxMyDoubleNode}{O{}m}{
+ \node[fill=blue!20, zx main node, inner sep=3mm,alias=zxtmp,#1] {\text{#2}};
+ \node[circle,fill=red!70, inner sep=.8mm,zx subnode=redNode] at ([shift={(0mm,1.5mm)}]zxtmp.west) {};
+ \node[circle,fill=orange!70, inner sep=.8mm,zx subnode=orangeNode] at ([shift={(0mm,-1.5mm)}]zxtmp.west) {};
+ \node[circle,fill=green!70, inner sep=.8mm,zx subnode=greenNode] at ([shift={(0mm,-1.5mm)}]zxtmp.east) {};
+}
+\begin{ZX}
+ A \rar[end subnode=redNode] \rar[end subnode=orangeNode]
+ & [5mm] \zxMyDoubleNode{Hey} \dar \rar[start subnode=greenNode,end subnode=orangeNode]
+ & \zxMyDoubleNode[fill=pink]{Hey}\\
+ B \ar[ru, end subnode=orangeNode] &
+\end{ZX}
+\end{codeexample}
+Node that you can also set some special subnodes called |fake center {north,south,east,west}| in order to help bezier-based wires to find where to start, and |true {north,south,east,west}| to say to |C| where to start (see the corresponding section for more details). Since we often want to specify coordinates here to be precise, you can use |\zxCoordinateSubnode| to place the coordinate at the right place.
+\end{pgfmanualentry}
+
+
+\subsubsection{Method 2: using pic}
+
+We also provide a second approach to create custom nodes (the syntax is actually very close) based on |pic|. This has pro and cons compared to the above approach: it is a bit more complicated and involve more dark magic under the hood, but only creates a single node, provides reusable styles that might be easier to integrate in a tikz picture, and we also provide some automatic way to deal with rotations, scaling etc... Historically, this was created before we realized that cells could contain multiple nodes and that it was possible to use subnodes to anchors, but now that subnodes have been introduced both approaches are relatively close. Nonetheless, all tricks introduced here can be used with the first method, except that anchors should be replaced with subnodes.
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxNewNodeFromPic\marg{name new node}\oarg{style before user}\oarg{style after user}\marg{code}\@@
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/tikz/zx create anchors=\marg{list, of, coordinates, to, turn, in, anchor}\@nil%
+ \extractkey/tikz/invert top bottom\@nil%
+ \extractkey/tikz/start subnode=\marg{name of subnode}\@nil%
+ \extractkey/tikz/stop subnode=\marg{name of subnode}\@nil%
+ \makeatother
+ \pgfmanualbody
+ |\zxNewNodeFromPic{Name}[style before][style after]{code}| is used to create a new command with name |\zxName|. |code| is the code to draw the node (that you would use in a |\pic| environment, and that will be centered on |(0,0)|):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyNode}{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, zx main node, alias=mynode] at (0,0) {};
+ \node[draw,fill=red!50,draw=blue,inner sep=1mm] at (mynode.north east) {};
+ }
+ \begin{ZX}
+ \zxN{} \rar & \zxMyNode{} \rar & \zxMyNode{}
+ \end{ZX}
+\end{codeexample}
+}
+Note how giving |zx main node| to a node makes it the target of arrows (note that you should make sure that your picture has at least one main node if you want features like |debug mode| to work). Without this, the lines would go to the coordinate |(0,0)|, and go through all the nodes:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyNode}{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, alias=mynode] at (0,0) {};
+ \node[draw,fill=red!50,draw=blue,inner sep=1mm] at (mynode.north east) {};
+ }
+ \begin{ZX}
+ \zxN{} \rar & \zxMyNode{}
+ \end{ZX}
+\end{codeexample}
+}
+Note that sometimes, one might want to draw lines to a fixed point, while leaving the line below the object (for instance if you use a |rounded corners| option and try to enter by the corner, tikz will actually stop before which is not beautiful). A simple solution is to use |wc| (short for |wire centered|) on the arrow, and it will automatically move the path on a layer behind (see also |wcs| and |wce| to configure only the starting or ending points, and some other nodes also use this, notably most styles based on |bezier|, like |s|):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\zxNewNodeFromPic{MyDivider}{
+ \node[regular polygon, regular polygon sides=3, shape border rotate=90,
+ draw=black,fill=gray!50, inner sep=1.6pt, rounded corners=0.8mm,zx main node] {};
+}
+Compare %
+\begin{ZX}
+ \zxZ{} \rar[very thick] &\zxMyDivider{} \rar[very thick] & \zxN{}
+\end{ZX} %
+and %
+\begin{ZX}
+ \zxZ{} \rar[very thick,wce] &\zxMyDivider{} \rar[very thick] & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+Note that I'm working on a better solutions to move nodes on different layers, or automatically see which anchor to choose depending on the custom node… but it's not that \mylink{https://tex.stackexchange.com/questions/618823/node-on-layer-style-in-tikz-matrix-tikzcd}{easy}.
+
+We can similarly put the |zx main node| on the other node to point to the other node by default:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyNode}{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, alias=mynode] at (0,0) {};
+ \node[draw,fill=red!50,draw=blue,inner sep=1mm, zx main node] at (mynode.north east) {};
+ }
+ \begin{ZX}
+ A \rar[end anchor=center,on layer=main] & \zxMyNode{} \rar & B & \zxMyNode{} & \zxMyNode{}
+ \end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Add margin around nodes.} You might want to add empty paths to increase the ``margin'' around your picture, or |overlay| some nodes if you don't want them to be counted when computing the bounding box. For simplicity, we provide a command |\zxExtendBoundingBox| that extends the current bounding box. This command takes as argument a list of arguments like |left|, |right|, |top|, |bottom|, |horizontal|, |vertical|, |extend|, where each argument takes a distance and extends to the corresponding direction (|extend| extends in all directions). For instance, below we increase the box by 1cm horizontally and by 3mm on each side on the y axis:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyNode}{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, zx main node] at (0,0) {};
+ \zxExtendBoundingBox{horizontal=1cm, vertical=3mm}
+ }
+ \begin{ZX}
+ A \rar & \zxMyNode{} \rar & B\\
+ \end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Give text as argument.} It is also possible to pass text as an argument by simply adding |\tikzpictext| where you want the text to appear, and calling then |\zxMyNode{your text}|:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyNode}{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, zx main node, alias=mynode] at (0,0) {\tikzpictext};
+ \node[draw,fill=red!50,draw=blue,inner sep=1mm] at (mynode.north east) {};
+ }
+ \begin{ZX}
+ \zxMyNode{Hello} & \zxMyNode{do you see} & \zxMyNode{the text} & ?
+ \end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Pass arbitrary arguments.} You can actually pass virtually any argument(s) by using the optional argument of the created |\zxMyNode| (that is just an additional argument to the pic options, inserted before \emph{style after user}, but after \emph{style before user} that we can use to create additional arguments with default values using the tikz/pgf power):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+% Requires \usetikzlibrary {shapes.geometric} for the star shape
+\zxNewNodeFromPic{MyStar}[
+ nb spikes/.store in=\myNbSides, % When users type nb spikes=42, this puts 42 into \myNbSides
+ nb spikes=5, % <- Default value
+]{
+ \node[star, star points=\myNbSides, minimum size=6mm, draw, fill=red] at (0,0) {};
+}
+\begin{ZX}
+ \text{Default:} & \zxMyStar{} & \text{More !} & \zxMyStar[nb spikes=8]{} & \zxMyStar[nb spikes=12]{}
+\end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Overriding existing parameters.}
+
+You might want to override a custom node, for instance because this custom node was provided by an external library (e.g.\ the ground and scalable ZX symbols are made using custom-nodes, and you might want to customize them). We provide for that a series of styles: if |XXXX| is the name on the node (e.g.\ |Ground|), the |/zx/picCustomStyleBeforeUserXXXX| style is sent to the picture style before loading the options of the user, |/zx/picCustomStyleAfterUserXXXX| is loaded after the input of the user, |/zx/picCustomStyleLastPicXXXX| is loaded as the last argument to the picture (after the default style). You can also set the command |\zxCustomPicAdditionalPic| to any code to draw at the end of the picture:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\tikzset{
+ /zx/picCustomStyleBeforeUserMatrix/.style={
+ scale=2,
+ % \zxCustomPicAdditionalPic can be any tikz code to run after the creation of the pic:
+ /utils/exec={\def\zxCustomPicAdditionalPic{%
+ % the main node has empty name, so .center is the center of the main node
+ \node[draw,circle,inner sep=2pt,fill=pink] at (.center) {};%
+ }%
+ },
+ },
+}
+\begin{ZX}
+ \zxZ{} \rar & \zxMatrix{A} \rar & \zxMatrix*{B} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+
+When designing your own custom nodes, you can also put:\\
+|NameOfYourStyle/.append style={}, NameOfYourStyle,|\\
+where you want to allow users to load |NameOfYourStyle| (|NameOfYourStyle/.append style={}| is used to create the style if it does not exist).
+
+If you want to change a create a new node style without overriding a style, you can of course create your own command that sets the parameters for you:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\tikzset{
+ /zx/picCustomStyleBeforeUserMatrix/.style={
+ scale=2,
+ % \zxCustomPicAdditionalPic can be any tikz code to run after the creation of the pic:
+ /utils/exec={\def\zxCustomPicAdditionalPic{%
+ % the main node has empty name, so .center is the center of the main node
+ \node[draw,circle,inner sep=2pt,fill=pink] at (.center) {};%
+ }%
+ },
+ },
+}
+\begin{ZX}
+ \zxZ{} \rar & \zxMatrix{A} \rar & \zxMatrix*{B} \rar & \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Local style.}
+
+Sometimes, you might want to define styles that are available only locally: for instance, you might prefer to type |main={fill=green}| instead of:\\
+|/zx/picCustomStyleBoxMainNode/.append style={fill=green}|\\
+Nothing prevents you from doing so directly in the default style. Just, make sure to use, e.g.\ |####1|, if you want to call an argument (internally we use nested styles and functions):
+
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\zxNewNodeFromPic{MyBox}[
+ main/.style={
+ /zx/picCustomStyleMyBoxMainNode/.append style={####1},
+ },
+]{%
+ \node[draw, inner sep=1.3mm, rectangle, zx main node, execute at begin node=$, execute at end node=$,
+ /zx/picCustomStyleMyBoxMainNode/.append style={}, % Make sure it exists to avoid errors
+ /zx/picCustomStyleMyBoxMainNode,
+ ]{\tikzpictext};%
+}
+
+\begin{ZX}
+ \zxMyBox{G} \rar[B] & [\zxwCol] \zxN{}\\
+ \zxMyBox[main={fill=green}]{G} \rar[B] & [\zxwCol] \zxN{}
+\end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Rotations.} Note that often, we want to rotate the nodes. The automatically generated macro to add new nodes comes with multiple flavors by adding the usual symbols |-|,|'|,|.|: by default, |\myNode-| will ``rotate'' by 180 degrees the pic, |\myNode'| will rotate it by 270 degrees to fake a node put ``above'', and |\myNode.| will rotate it by 90 degrees to fake a node put below. Importantly, by default tikz rotates/scales the coordinates, but \textbf{not the nodes or text}, so you might want to specify \textbf{transform shape} on each node you want to rotate and scale according to the parent transform, or using the |every node/.append style={transform shape}| (\textbf{WARNING}: make sure to use |append| or otherwise |zx main node| you not work and you will not be able to give a name to a node) option to apply it on all nodes:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyTriangle}[
+ % To also rotate/scale the node, otherwise only it's coordinate is rotated
+ every node/.append style={transform shape},
+ % Just to show how to quickly scale a node by default, to quickly update the size of a whole picture:
+ scale=1.3
+ ]{
+ \node[regular polygon, regular polygon sides=3, shape border rotate=90, draw=black,fill=blue!50, inner sep=1mm,rounded corners, zx main node] {};
+ }
+ \begin{ZX}
+ \zxMyTriangle{} \rar & \zxMyTriangle-{} & \zxMyTriangle'{} \dar \\
+ & & \zxMyTriangle.{}
+ \end{ZX}
+\end{codeexample}
+}
+Note however that you can customize how rotations is applied. By default, the |'-.| variants updates |\zxCurrentRotationMode| to the rotation angle (from 0 to 90,180,270), and do |rotate=\zxCurrentRotationMode|. You can however easily change that behavior, by first undoing this rotation (in the \emph{style before user}) with |rotate=-\zxCurrentRotationMode| and do any action you like depending on the value of |\zxCurrentRotationMode|. Here is a nice use-case: if you rotate a node with |transform shape|, it will also rotate the text inside:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyTriangle}[
+ every node/.append style={transform shape},
+ ]{
+ \node[regular polygon, regular polygon sides=3, shape border rotate=90, draw=black,fill=blue!50, font=\footnotesize,inner sep=1pt,rounded corners, zx main node] {\tikzpictext};
+ }
+ \begin{ZX}
+ \zxMyTriangle{A} \rar & \zxMyTriangle-{A} & \zxMyTriangle'{A} \dar \\
+ & & \zxMyTriangle.{A} \\
+ \end{ZX}
+\end{codeexample}
+}
+To avoid that issue, we will undo the default rotation, and apply on the node of interest a rotation with |shape border rotate| (that rotates the border but not the text inside):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyTriangle}[
+ % We undo the default rotation:
+ rotate=-\zxCurrentRotationMode,
+ ]{
+ \node[
+ regular polygon, regular polygon sides=3, draw=black,fill=blue!50, font=\footnotesize,
+ inner sep=1pt,rounded corners, zx main node,
+ shape border rotate=90+\zxCurrentRotationMode, % Rotates the shape but not the text
+ ] {\tikzpictext};
+ }
+ \begin{ZX}
+ \zxMyTriangle{A} \rar & \zxMyTriangle-{A} & \zxMyTriangle'{A} \dar \\
+ & & \zxMyTriangle.{A} \\
+ \end{ZX}
+\end{codeexample}
+}
+Note that one might want to exchange |\zxMyNode|/|\zxMyNode-| or |\zxMyNode'|/|\zxMyNode.| (for instance, it might be more natural to denote |'| in place of |.| and |.| in place |'|, since these symbols visually represent the top/bottom place of the node). In that case, you just need to apply the style |invert top bottom| or |invert right left| in your \emph{style before user} and it will invert them automatically.
+
+\paragraph{Add anchors to node.} We can automatically (and easily) add multiple anchors to our nodes (the |fake center east/…| anchors are used for instance by shapes like |\ar[<']| to see where the node should start from, while the |true north/…| anchors are used to notify where is the true north after the rotation (after rotating a node, the east might actually be on the north etc), which is for instance used by shapes like |C'|): just add coordinates with the name of the desired anchor in your graph (say |anchorA| and |anchorB|), and in \emph{style \textbf{after} user} add this list of anchor like: |zx create anchors={anchorA,anchorB}| (actually this list is expanded using the |\foreach| syntax so you can use more advanced syntax like |anchor1,anchor...,anchor10| to avoid repeating the 10 names of the anchor). For instance, we can do this way:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyStar}[][
+ % Note that this is the SECOND optional argument!
+ zx create anchors={anchorA,anchorB},
+ ]{
+ \node[star, minimum size=6mm, draw, alias=mystar, fill=red, zx main node] at (0,0) {};
+ \coordinate (anchorA) at (mystar.outer point 1);
+ \coordinate (anchorB) at (mystar.outer point 2);
+ }
+ \begin{ZX}
+ A \rar \rar[->,end anchor=anchorA,bend left] \rar[->,end anchor=anchorB,bend left] &[5mm] \zxMyStar{}
+ \end{ZX}
+\end{codeexample}
+}
+The ZX library typically uses some special anchors like |fake center east/…| and |true east/…| to determine where some wires should start (not all kinds of wires follow this convention, for instance |<'| uses |fake center| since the wire is supposed to leave close to the center, while |C| follows |true west| since the wire is supposed to leave from the west). Because the north anchor is not anymore in the north after applying a rotation, we provide also |\zxVirtualCenterWest| (same for |East|, |North|, |South|) that will ``counter balance'' the rotation, to ensure the real north anchor is always in the north, by renaming the anchors appropriately. This way, by using these ``virtual anchors'', you only need to place your anchor when the shape is not rotated, and it should automatically rotate the anchors appropriately when needed (see remarks regarding |every node/.append style={transform shape}|):
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+% Define a reusable node
+ \zxNewNodeFromPic{MyDivider}[][zx create anchors={\zxVirtualCenterWest, \zxVirtualCenterEast},
+ every node/.append style={transform shape}
+ ]{
+ \node[regular polygon, regular polygon sides=3,shape border rotate=90,%shape border rotate=90,
+ draw=black,fill=gray!50, inner sep=1.6pt, rounded corners=0.8mm,zx main node] {};
+ \coordinate(\zxVirtualCenterEast) at (.2mm,0); % Used to start lines on the side of the shape
+ \coordinate(\zxVirtualCenterWest) at (-1mm,0);
+}
+% Use the node horizontally
+\begin{ZX}
+ \zxZ[B]{} \rar[Bn'=n+m, wc] & \zxMyDivider{}
+ \rar[o',Bn'Args={n}{}]
+ \rar[o.,Bn.Args={m}{}] &[\zxWCol] \zxMyDivider-{} \rar[B,wc] & \zxZ[B]{}
+\end{ZX}
+% Use the node vertically
+\begin{ZX}
+ \zxZ[B]{} \dar[Bn=n+m, wc] \\
+ \zxMyDivider'{} \dar[-o,BnArgs={n}{}] \dar[o-,Bn-Args={m}{}] \\[\zxWRow]
+ \zxMyDivider.{} \dar[B,wc]\\
+ \zxZ[B]{}
+\end{ZX}
+\end{codeexample}
+}
+
+You can even dynamically add anchors depending on the input of the user. For instance, if the user can choose the number of spikes of the star, you might want to create as many anchors as there are spikes:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\zxNewNodeFromPic{MyStar}[
+ nb spikes/.store in=\myNbSides,
+ nb spikes=5,
+ every node/.append style={transform shape},
+ ][
+ % zx create anchors is parsed ultimately by \foreach so we can use lists like
+ % this to create anchors spike-1, spike-2...
+ zx create anchors/.expanded={spike-1,spike-...,spike-\myNbSides},
+ ]{%
+ \node[star, fill=red, star points=\myNbSides, minimum size=1cm, draw, alias=mystar]
+ at (0,0) {\tikzpictext};
+ % We need to place coordinates where we want to final anchors to be.
+ \foreach \i in {1,...,\myNbSides}{
+ \coordinate (spike-\i) at (mystar.outer point \i);
+ }%
+}
+\begin{ZX}
+ B \foreach \i in {1,...,8}{\expanded{\noexpand\rar[->,end anchor=spike-\i,bend left]}} &[5cm] \zxMyStar[nb spikes=8]{?!?}
+\end{ZX}
+\end{codeexample}
+}
+
+Note that this library uses some anchors called |fake center {east,west,north,south}|, to indicate for some curve style where the line should start and stop (|\ar| alone does not use any anchor, and not all curves use them: |S| for instance does not use it, while |s| does: in any case, you can force it for any curve with |force left to right| and alike, see the corresponding documentation Note also that in this mode the curve is drawn by default below the shapes, but this can be changed, see the corresponding section for details).
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+\zxNewNodeFromPic{MyNode}[][zx create anchors/.expanded={fake center west}]{
+ \node[draw,fill=blue!50,draw=blue,inner sep=3mm, zx main node, alias=mynode] at (0,0) {};
+ \node[draw,fill=red!50,draw=blue,inner sep=1mm] at (mynode.north east) {};
+ \coordinate(fake center west) at (mynode.north east);
+}
+\begin{ZX}
+ \zxZ{} \ar[rd,s] & \\
+ A \rar & \zxMyNode{}
+\end{ZX}
+\end{codeexample}
+}
+
+\paragraph{Link to a sub-node.} Sometimes, we might prefer to draw a link to a node instead of an anchor (an anchor can only be a single coordinate). To that end, just name your nodes as usual, and use |start subnode| or |end subnode| to do the link
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\begin{codeexample}[width=0pt]
+ \zxNewNodeFromPic{MyDoubleNode}{
+ \node[fill=blue!20, zx main node, inner sep=3mm] at (0,0) {};
+ \node[circle,fill=red!70, inner sep=.8mm,name=redNode] at (0,1.5mm) {};
+ \node[circle,fill=orange!70, inner sep=.8mm, name=orangeNode] at (0,-1.5mm) {};
+ }
+ \begin{ZX}
+ A \rar[end subnode=redNode] \rar[end subnode=orangeNode] &[5mm] \zxMyDoubleNode{}\\
+ B \ar[ru, end subnode=orangeNode]
+ \end{ZX}
+\end{codeexample}
+}
+
+Note that you can also combine it with |to| and |alias|:
+{\catcode`\|=12 % Ensures | is not anymore \verb|...|
+\zxNewNodeFromPic{MyDoubleNode}{
+ \node[fill=blue!20, zx main node, inner sep=3mm] at (0,0) {};
+ \node[circle,fill=red!70, inner sep=.8mm,name=redNode] at (0,1.5mm) {};
+ \node[circle,fill=orange!70, inner sep=.8mm, name=orangeNode] at (0,-1.5mm) {};
+}
+\begin{ZX}
+ \zxZ{} \ar[to=buttons, end subnode=orangeNode] \\
+ \zxX{} \rar & \zxMyDoubleNode[a=buttons]{} \rar &
+\end{ZX}
+}
+
+\end{pgfmanualentry}
+
+
+
+
+\subsubsection{Create your own multi-column/row gate}
+
+We provide since 2023/09/23 a number of functions in order to deal with gates spawning multiple rows or columns, including to create your own multi-columns/rows gates. We present first the individual functions, and show after how to combine them to create more advanced styles. Note that the following define commands, but you can easily insert them in a style using:
+\begin{verbatim}
+/utils/exec={\yourCommands}
+\end{verbatim}
+or by creating a new style with |my style/.code={\yourCommand}|.
+
+\begin{pgfmanualentry}
+ \extractcommand\zxGetNameAbsoluteNode\marg{row}\marg{column}\@@
+ \pgfmanualbody%
+ Function to get the name of a cell using its absolute coordinate in the matrix (start at 1):
+\begin{codeexample}[]
+\begin{ZX}[
+ execute at end picture={
+ \node[draw, rounded corners, fill=orange,
+ node on layer=background,
+ fit=(\zxGetNameAbsoluteNode{1}{1})(\zxGetNameAbsoluteNode{1}{2})
+ ]{};
+ }]
+ A & B
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\zxExecuteAtEndPicture\marg{code}\@@
+ \extractcommand\zxOriginalRow\@@
+ \extractcommand\zxOriginalCol\@@
+ \extractcommand\zxGetNameRelativeNode\marg{relative row}\marg{relative column}\@@
+ \extractcommand\zxGetNameRelativeNodeStartOne\marg{relative row}\marg{relative column}\@@
+ \pgfmanualbody%
+ |execute at end picture| is first annoying to use, but it also runs after the definition of the wires, meaning that it is not possible to point to nodes defined in that portion of the code. To solve these issues, we define |\zxExecuteAtEndPicture{your code}| that you can insert inside a node. Note that in |your code| you can use |\zxOriginalRow| and |\zxOriginalCol| that will contain the position of the column and row where you inserted that command, and |\zxGetNameRelativeNode| will allow you to get the name of the neighbour nodes by specifying the difference of columns and the difference of lines. Note that these variables and commands are usable in |\zxExecuteAtCellRelative| and |\zxExecuteAtCellAbsolute| as well.
+\begin{codeexample}[]
+\NewExpandableDocumentCommand{\myFitWithBelowNeighbour}{}{
+ \zxExecuteAtEndPicture{%
+ \node[draw, rounded corners, fill=orange,
+ node on layer=background,
+ fit=(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{1}{0})
+ ]{};
+ }%
+}
+\begin{ZX}
+ A & B & C & D \\
+ A & B \myFitWithBelowNeighbour & C & D \\
+ A & B & C & D \\
+\end{ZX}
+\end{codeexample}
+The |zxGetNameRelativeNodeStartOne| variant index elements from $1$ instead of $0$.
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxExecuteAtCellAbsolute\marg{row}\marg{column}\marg{code}\@@
+ \extractcommand\zxExecuteAtCellRelative\marg{relative row}\marg{relative column}\marg{code}\@@
+ \extractcommand\zxExecuteAtRegionRelative\marg{relative row}\marg{relative column}\marg{code}\@@
+ \pgfmanualbody%
+ Often, just adding some nodes at the end of the picture is not enough: you might want to add other nodes automatically in the matrix. For instance, if you want to implement yourself a gate spawning multiple rows, a simple way to achieve that would be to add invisible boxes inside the matrix and use them to fit the final component. You can place nodes where you want using something like this (note that you should use |zx main node| that is basically a shortcut for:
+\begin{verbatim}
+\tikzset{name=\zxCurrentDiagram-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn}
+\end{verbatim}
+otherwise |\rar| will not be able to know which node to join: note that it is automatically added in nodes like |\zxX{}|):
+\begin{codeexample}[]
+\NewExpandableDocumentCommand{\mySimpleMultigate}{m}{
+ \zxBox{#1}
+ \zxExecuteAtCellRelative{1}{-1}{\node[zx main node, green]{\text{I am relative}};}
+ \zxExecuteAtCellRelative{0}{1}{\node[zx main node, green]{\text{I am also relative}};}
+ \zxExecuteAtCellAbsolute{2}{4}{\node[zx main node, red]{\text{I am absolute}};}
+}
+\begin{ZX}
+A & B & C \\
+ & \mySimpleMultigate{X} & & \\
+ & & \\
+\end{ZX}
+\end{codeexample}
+(note that the relative version adds it to cells relative to the current cell while the absolute version executes it at the absolute cell coordinate)
+\textbf{Important}: for all these manipulation to work, be sure to only specify coordinates after the main node, either later on the same line or on next rows since previous cells have already been parsed.
+
+You can also do it for a whole region of size $n \times m$ using |\zxExecuteAtRegionRelative{n}{m}{code}| like this (just make sure that the cells exist):
+\begin{codeexample}[]
+\NewExpandableDocumentCommand{\myRegion}{}{
+ \zxExecuteAtRegionRelative{2}{3}{%
+ \zxBox{\text{\tiny Original row: \zxOriginalRow{}, column:\zxOriginalCol{}
+ % We compute the relative position to print it:
+ (rel: \the\numexpr\the\pgfmatrixcurrentrow -\zxOriginalRow\relax
+ x\the\numexpr\the\pgfmatrixcurrentcolumn-\zxOriginalCol\relax).}}}
+}
+\begin{ZX}
+ A & B & C & D & E & F & G \\
+ & & \myRegion & & & & \\
+ & & & & & & \\
+ & & & & & &
+\end{ZX}
+\end{codeexample}
+(note that if you use |\zxExecuteAtRegionRelative| and want to define one alias for the top-left node, you should use |a if origin=alias for the node| instead of |a=alias name for the node| since it would give the alias to the last node instead of the first node). Note that if you execute it multiple times on the same cell, both codes will be executed.
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxSetVariable\marg{name variable}\marg{content variable}\@@
+ \extractcommand\zxSetVariableExpandOnce\marg{name variable}\marg{content variable}\@@
+ \extractcommand\zxSetVariableExpand\marg{name variable}\marg{content variable}\@@
+ \extractcommand\zxGetVariable\marg{name variable}\@@
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/tikz/zx style from variable=\marg{name variable}\@nil%
+ \makeatother
+ \pgfmanualbody%
+ You might want at some point to pass data to the node you placed elsewhere, for instance the style it should take etc. For simple setups, you can directly pass the argument like:
+\begin{codeexample}[]
+ \NewExpandableDocumentCommand{\mySimpleMultigate}{mmmm}{
+ \zxBox{#1}
+ \zxExecuteAtCellRelative{1}{-1}{\node[zx main node, #2]{\text{I am relative}};}
+ \zxExecuteAtCellRelative{0}{1}{\zxBox[zx main node]{\text{I am also relative}}}
+ \zxExecuteAtCellAbsolute{2}{4}{\node[zx main node, #4]{\text{I am absolute}};}
+ }
+ \begin{ZX}
+ & & \\
+ & \mySimpleMultigate{X}{red}{pink}{orange} & & \\
+ & & \\
+ \end{ZX}
+\end{codeexample}
+but for more complicated setups, you might want to use some variables. This can be done using the above commands (set it in the main node, and get it in other nodes) (or you can also directly give it the argument): this should just create a new macro and evaluate it.
+\begin{codeexample}[]
+\NewExpandableDocumentCommand{\mySimpleMultigate}{mmm}{
+ \zxX{#1}
+ \zxSetVariable{my variable}{Hey #2}
+ \zxSetVariable{my style}{#3}
+ \zxExecuteAtCellRelative{1}{-1}{\node[zx style from variable={my style}]{\text{\zxGetVariable{my variable}}};}
+}
+\begin{ZX}
+A & B & C \\
+ & \mySimpleMultigate{\alpha}{Alice}{purple,opacity={.3}} & & \\
+ & & \\
+\end{ZX}
+\end{codeexample}
+The difference between |\zxSetVariable|, |\zxSetVariableExpandOnce| and |\zxSetVariableExpand| is that they respectively don't expand their input like |\gdef|, expand it once, or expand it completely like |\gxdef|. This can be useful in more complex setups, for instance if you store the style/variable in a macro first using pgfkeys:
+\begin{codeexample}[width=0pt]
+\NewExpandableDocumentCommand{\MyGateMulti}{O{}mmm}{
+ % The path; here is useful to help tikzcd to see that it is a node as it tries to search for path and \pgfkeys does not look like a path
+ % If you forget it, you will get something like \node is not defined
+ \path;\pgfkeys{
+ /zx/gateMulti/.cd,
+ content inner nodes/.store in=\myContent,
+ content inner nodes=#4,
+ a/.store in=\zxGateMultiAlias,
+ a=,
+ style inner nodes/.store in=\zxGateMultiStyle,
+ style inner nodes={},
+ #1,
+ }%
+ % Store the content for letter use
+ \zxSetVariableExpandOnce{content inner nodes}{\myContent}
+ \zxSetVariableExpandOnce{style inner nodes}{\zxGateMultiStyle}
+ \zxExecuteAtRegionRelativeAndOrigin{#2}{#3}{%
+ \zxBox[zx main node,
+ % a if origin=\zxGateMultiAlias,
+ draw,
+ zx style from variable={style inner nodes},
+ %/zx/gateMulti/style inner nodes aux
+ ]{\zxGetVariable{content inner nodes}};
+ }%
+}
+
+\begin{ZX}
+ & & & & & & & \\
+ & & \MyGateMulti[style inner nodes={red,test/.style={fill=#1,opacity=.3},test=red}]{2}{3}{H} & & & & & \\
+ & & & & & & & \\
+ & & & & & & & \\
+ & & & & & & & \\
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+With all of this, we can now create a simple multi-columns/rows gate mechanism (but you certainly want to use the one provided by this library if you actually care about multi-columns/rows gates:
+
+
+\begin{codeexample}[width=0pt]
+ % \mySimpleMultigate{rows}{cols}{content}
+ \NewExpandableDocumentCommand{\mySimpleMultigate}{mmm}{
+ \node[zx main node, inner sep=1mm]{#3};
+ \zxExecuteAtCellRelative{#1}{#2}{%
+ \node[zx main node, inner sep=1mm]{#3};
+ }
+ \zxExecuteAtEndPicture{
+ \node[node on layer=foreground,
+ fill=white, inner sep=0pt, draw,
+ fit=(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{#1}{#2}),
+ label={[node on layer=foreground]center:{#3}}]{};
+ }
+ }
+ \begin{ZX}
+A & B & C & D & E & F \\
+\rar & \mySimpleMultigate{2}{3}{X} & & & & \lar \\
+\rar & & & & & \lar \\
+\zxN{} \dar[C] \rar & & & & & \zxN[a=bottomright]{} \lar \\
+\zxN{} \ar[to=bottomright,C-] &
+\end{ZX}
+\end{codeexample}
+
+Note that you can also define subnodes in the final node and point to them. You can either use its alias, or point to any node added via region relative or cell relative, it will automatically find the parent node:
+
+\begin{codeexample}[width=0pt]
+ % \mySimpleMultigate{rows}{cols}{content}
+ \NewExpandableDocumentCommand{\myFancyGate}{O{}mmm}{
+ % a=#1 make sure to add the alias on the first element
+ \node[zx main node, inner sep=1mm, a=#1]{#4};
+ \zxExecuteAtRegionRelative{#2}{#3}{%
+ \node[zx main node, inner sep=1mm]{#4};
+ }%
+ \zxExecuteAtEndPicture{
+ \node[node on layer=foreground,
+ alias=tmp,
+ opacity=.5,
+ fill=white, inner sep=0pt, draw,
+ fit=(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{\the\numexpr#2-1\relax}{\the\numexpr#3-1\relax}),
+ label={[node on layer=foreground]center:{#4}}]
+ {};
+ \node[node on layer=foreground, fill=red, inner sep=.9mm, circle, zx subnode=redCircle] at (tmp.south east) {};
+ }
+ }
+ \begin{ZX}
+A & B & C & D & E & F \\
+\rar[end subnode=redCircle, blue, bend right] & \myFancyGate[aliasMyGate]{3}{4}{X} & & & \rar & \\
+\rar[purple] & & & & & \lar \\
+\rar[end subnode=redCircle, pink, bend right] & & & & & \lar \\
+\ar[to=aliasMyGate,red] & \\
+\ar[to=aliasMyGate,end subnode=redCircle,green,bend right] &
+\end{ZX}
+\end{codeexample}
+
+You can also force all nodes pointing to a region-relative or cell-relative to point to a specific anchor:
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/every node/pre arrow style if start node=\marg{style, to, apply}\@nil%
+ \extractkey/every node/pre arrow style if end node=\marg{style, to, apply}\@nil%
+ \extractkey/every node/post arrow style if start node=\marg{style, to, apply}\@nil%
+ \extractkey/every node/post arrow style if end node=\marg{style, to, apply}\@nil%
+ \makeatother
+ \pgfmanualbody%
+ This will apply the corresponding style to any wire leaving from the current cell or arriving to the current cell depending on the variation (node that you can use these functions in any node, there is no special role played by |zxExecuteAtRegionRelativeAndOrigin| here), |pre| variants being run before the user input (\textbf{WARNING}: at the step, the target of the node is not known!) while |post| variants are run after the user input:
+
+\begin{codeexample}[width=0pt]
+% \myFancyGate[alias]{rows}{cols}{content}
+\NewExpandableDocumentCommand{\myFancyGate}{O{}mmm}{
+ \zxExecuteAtRegionRelativeAndOrigin{#2}{#3}{%
+ \node[zx main node, inner sep=1mm, a if origin=#1,
+ %% These two lines says to connect any line coming/leaving from here to the redCircle subnode
+ post arrow style if start node={start subnode=redCircle},
+ post arrow style if end node={end subnode=redCircle},
+ ]{#4};
+ }%
+ \zxExecuteAtEndPicture{
+ \node[node on layer=foreground,
+ alias=tmp,
+ opacity=.5,
+ fill=white, inner sep=0pt, draw,
+ % The expression "\the\numexpr#3-1\relax" removes 1 to the current column or it will draw too many
+ % columns (size n x m means that we stop at element (n-1) x (m-1) since we start from zero
+ fit=(\zxGetNameRelativeNode{0}{0})(\zxGetNameRelativeNode{\the\numexpr#2-1\relax}{\the\numexpr#3-1\relax}),
+ label={[node on layer=foreground]center:{#4}}]
+ {};
+ \node[node on layer=foreground, fill=red, inner sep=.9mm, circle, zx subnode=redCircle] at (tmp.south east) {};
+ }
+}
+\begin{ZX}
+A & B & C & D & E & F \\
+\rar & \myFancyGate[aliasMyGate]{3}{4}{X} & & & \rar & \\
+\rar[purple] & & & & & \lar \\
+\rar[end subnode=redCircle, pink, bend right] & & & & & \lar \\
+\ar[to=aliasMyGate,red] & \\
+\ar[to=aliasMyGate,end subnode=redCircle,green,bend right]
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
+
+\subsection{Caching pictures via an externalization library}\label{sec:externalization}
+
+The pictures built with this package can easily take maybe 0.5 seconds per picture to be built, which can easily add up to a long compilation time. Caching externalization can save you a lot of time: I went from a tiny draft taking 30 seconds to be built to a built time of 2.5 seconds.
+
+\subsubsection{robust-externalize: recommended}
+
+While \tikzname{} provides an external library, it has many drawbacks that make it unusable in practice. To solve that issue, I created my own library called \mylink{https://github.com/leo-colisson/robust-externalize}{\texttt{robust-externalize}}. It's still very young, but has been working really reliably in my tests (note that a major update occurred in september 2023, so we updated the instruction accordingly).
+
+To use it, first install |robust-externalize| by copy/pasting robust-externalize.sty in your project (unless your \LaTeX{} distribution already has it), make sure you have version 1.1, and load it using:
+\begin{codeexample}[code only]
+\usepackage{robust-externalize}
+\robExtConfigure{
+ % We create a new preset for zx pictures
+ new preset={ZX}{
+ latex, % we inherit from the latex preset
+ % make sure to use the same font as the document, or the equations will not be properly aligned
+ add to latex options={11pt},
+ add to preamble={ % we make sure the zx library is loaded when building cached images
+ \usepackage{amsmath}
+ \usepackage{zx-calculus}
+ },
+ dependencies={}, % Add here any file that must induce a recompilation of your file if it changes.
+ },
+}
+
+% say to cache by default all ZX environments (can be changed later) and \zx{} commands
+\cacheEnvironment{ZX}{ZX}
+\cacheCommand{zx}{ZX}
+
+% You can pass options to robust-externalize via <>
+\begin{ZX}<add to preamble={\def\name{Alice}}>
+ \zxX{\text{\name}}
+\end{ZX}
+\end{codeexample}
+
+Now, just recompile your project: it should cache the pictures. See \mylink{https://github.com/leo-colisson/robust-externalize}{\texttt{robust-externalize}} for more details.
+
+\subsubsection{Tikz external: not recommended}
+
+\textbf{WARNING}: I added some options to use tikz |external| library to save compilation time... And then I realized that tikz |external| was quite close to be unusable in practice as it has many caveats. I ended up coding my own replacement to externalize any operation, and it works much better! See comment in the previous section.
+
+Since 2022/02/08, it is possible to use the tikz |external| library to save compilation time. To load it, you need to add the following tikz libraries:
+\begin{verse}
+ |\usetikzlibrary{external}|\\
+ |\usetikzlibrary{zx-calculus}|\\
+ |\tikzexternalize|\\
+ |\zxConfigureExternalSystemCallAuto|\\
+\end{verse}
+Then, compile with shell-escape, for instance using |pdflatex -shell-escape yourfile.tex|.
+
+\textbf{WARNING}: if |external| is loaded before |zx-calculus|, you don't need to run |\zxConfigureExternalSystemCallAuto|. This command is only useful to ensure the system call used by |external| displays errors appropriately by configuring the interaction mode to match the one used by the parent compilation command. If you prefer to disable this feature to use |external|'s default, define `\def\zxDoNotPatchSystemCall{}` before loading the |zx-calculus| library.
+
+\alertwarning{Note however that this has not yet being extensively tested, and the \texttt{external} library has a few caveats presented below}
+\begin{itemize}
+\item If you change the order of the diagrams, or add a diagram in the middle of the document, all subsequent diagrams will be recompiled. This issue has been reported \mylink{https://github.com/pgf-tikz/pgf/issues/758}{here} and is caused by the fact that the figures are called \texttt{figure0},\dots,\texttt{figureN}. To limit this issue, you can regularly insert \texttt{\textbackslash{}tikzsetfigurename\{nameprefix\}} in your document with different names to avoid a full recompilation of the file (or using groups to change it for a single newly added equation).
+\item The \texttt{external} library uses the main file to recompile each picture, so if your file is large or loads a lot of libraries, it may \mylink{https://tex.stackexchange.com/questions/633175/tikz-externalize-is-much-slower-than-tikz-on-first-run}{take a while to compile a single diagram} (to give an example, this library takes 41 seconds to compile without the externalize library, with the externalize library it takes 14mn for the first run and 3 seconds for the next runs). For this reason, you may want to use \texttt{\textbackslash{}tikzset\{external/export=false\}} or |\tikzexternaldisable| (the latter won't fail if your elements are not parsable by tikz external) in a group to disable temporarily the external library while you are writing your diagram. You may like the |list and make| option of tikz external that produces a Makefile that one can compile separately to build in parallel all pictures.
+\item If you compile once a diagram without any error, and recompile it after inserting an error, you will see an error while compiling. But if you recompile again, the error will disappear and the diagram that lastly succeeded to build will be inserted instead of the newly buggy diagram. This has been reported \mylink{https://github.com/pgf-tikz/pgf/issues/1137}{here}.
+\item Sometimes, |external| cuts some parts of the picture, namely when parts are drawn outside of the bounding box. I've not experienced that with zx diagrams directly (we don't go beyond the bounding box), but the example at the end of this document with the |double copy shadow| has such issues because the shadow is drawn outside of the bounding box. One should therefore disable the externalization (or increase the bounding box) in these cases.
+\item It seems that sometimes the inner sep of some labels in |external| mode defaults to zero (see the CNOT example below), I'm not sure why. Adding explicitly the value of the label fixes this.
+\end{itemize}
+
+\begin{pgfmanualentry}
+ \extractcommand\zxExternalAuto\@@
+ \extractcommand\zxExternalWrap\@@
+ \extractcommand\zxExternalNoWrap\@@
+ \extractcommand\zxExternalNoWrapNoExt\@@
+ \extractcommand\zxExternalWrapForceExt\@@
+ \pgfmanualbody
+ Also, the library |external| forces us to wrap our diagrams into a basically empty tikz-pictures to make it work. The current library will automatically wrap the diagrams when the |external| library is enabled, but you can customize how diagrams are wrapped manually: |\zxExternalAuto| (default) will wrap it automatically if |external| is enabled, |\zxExternalWrap| will always wrap it, |\zxExternalNoWrap| will never wrap it (you will get errors if you use |external|), |\zxExternalNoWrapNoExt| will not wrap the figure, but will disable temporary the externalization for diagrams to avoid errors and |\zxExternalWrapForceExt| will wrap the figures and enable tikz |external| locally only for zx-diagrams (using |\tikzexternalenable|). This last option is particularly useful when using |external| while most other environments are not compatible with externalization (like tikzcd, quantikz, blochsphere, maybe cryptocode\dots{}): the idea is to disable tikzexternalize everywhere, except for zx diagrams:
+\begin{verse}
+|\tikzexternalize|\\
+|\tikzexternaldisable|\\
+|\zxExternalWrapForceExt|
+\end{verse}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\zxExternalSuffix\marg{suffix}\@@
+ \pgfmanualbody
+By default, the library adds a suffix |zx| to figures corresponding to zx diagrams (it avoids to recompile diagrams when a normal figure is added in between two zx diagrams). You can change (or remove) this suffix using |\zxExternalSuffix{yoursuffix}|, where the suffix can also be empty.
+\end{pgfmanualentry}
+
+Note that if you get an error:\\
+|Argument of \tikzexternal@laTeX@collect@until@end@tikzpicture has an extra }|\\
+it is likely that you have an element that is not handled by tikz external, like a raw |tikzcd| environment, a |blochsphere| environment\dots{} Either disable temporary tikz external around it:\\
+|{\tikzexternaldisable your code not compatible with external}|\\
+or wrap your element around |\begin{tikzpicture}\node{your figure};\end{tikzpicture}| (people usually don't like nested tikz pictures\dots{} but it often works nicely). In case you also care about the baseline, you may prefer to wrap it using:\\
+|\begin{tikzpicture}[baseline=(mynode.base)]\node(mynode){your figure};\end{tikzpicture}|
+
+\subsection{How to visually group multiple nodes}\label{subsec:decoration}
+
+
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxCont\oarg{style}\oarg{color}\marg{nb rows}\marg{nb columns}\oarg{label style}\oarg{(other)(nodes)(to)(fit)}\marg{Text of label}\@@
+ \extractcommand\zxGroupGates\oarg{style}\marg{nb rows}\marg{nb columns}\oarg{label style}\oarg{(other)(nodes)(to)(fit)}\marg{Text of label}\@@
+ \extractcommand\zxContName\oarg{style}\oarg{color}\marg{(nodes)(to)(fit)}\oarg{label style}\marg{Text of label}\@@
+ \extractcommand\zxNamedBox\oarg{style}\oarg{color}\marg{(nodes)(to)(fit)}\oarg{label style}\marg{Text of label}\@@
+ \pgfmanualbody
+ These commands are used to highlight a part of a diagram (|Cont| is for ``Container''), or, for |\zxGroupGates|, to group gates together (it is like |Cont| but with a different style), the main difference is that the |Cont| version can be used inside the matrix and will automatically contain the current node (you must then either by specifying the size of the box or the name of the other nodes to fit), while |\zxNamedBox| must be inserted later (so you might not use it much), like:
+\begin{codeexample}[width=0cm]
+ \begin{ZX}
+ \zxN{} \rar & [\zxwCol] \zxZ{} \zxCont{2}{1}{\textsc{cnot}} \dar \rar & [\zxwCol] \zxN{} \\
+ \zxN{} \rar & \zxX{} \rar & [\zxwCol] \zxN{} \\
+ \end{ZX}
+\end{codeexample}
+\begin{codeexample}[width=0cm]
+ \begin{ZX}
+ \zxN{} \rar & [\zxwCol] \zxZ{} \zxContName{(endCnot)}{\textsc{cnot}} \dar \rar & [\zxwCol] \zxN{} \\
+ \zxN{} \rar & \zxX[a=endCnot]{} \rar & [\zxwCol] \zxN{} \\
+ \end{ZX}
+\end{codeexample}
+\begin{codeexample}[width=0cm]
+ \begin{ZX}[
+ % \zxCont offers a more practical interface
+ execute at end picture={
+ \zxNamedBox{(cnot1)(cnot2)}{
+ below:\textsc{cnot}
+ }
+ }
+ ]
+ \zxN{} \rar &[\zxwCol] \zxZ[alias=cnot1]{} \dar \rar &[\zxwCol] \zxN{}\\
+ \zxN{} \rar & \zxX[alias=cnot2]{} \rar &[\zxwCol] \zxN{}\\
+ \end{ZX}
+\end{codeexample}
+
+Note that the |fit| library cannot fit a wire. So if you want to include the wires around a node, the simpler thing might be to manually increase the size of the box in the style. We provide for that an helper command |fit margins={top=1mm,bottom=2mm,right=2.2mm,left=2.2mm}| (the |inner sep| and |shift| commands of tikz are not really practical to move a single border), you can also use |horizontal|, |vertical|, or |all|, and |l| is a shorcut to add larger margins instead of |fit margins={all=1mm}|.
+\begin{codeexample}[width=0cm]
+ \begin{ZX}[
+ execute at end picture={
+ \zxNamedBox[fit margins={right=2.2mm}]{(measX)(measZ)}{
+ below:\footnotesize Bell measurement
+ }
+ \zxNamedBox[fit margins={bottom=2pt,top=2pt,left=2.0mm}][green!80!black]{(bellA)(bellB)}{
+ left:\footnotesize Bell pair:
+ }
+ }
+ ]
+ \zxN[a=bellA]{} \rar \dar[C] & [\zxwCol] \zxX*{x\pi} \rar & \zxZ*{z\pi} \rar & \zxN{} \\[\zxwCol]
+ \zxN[a=bellB]{} \rar & \zxX[a=measX]{x\pi} \dar[C-] & \\
+ \zxN{} \rar & \zxZ[a=measZ]{z\pi}
+ \end{ZX}
+\end{codeexample}
+This will automatically create a subnode |wrapper| pointing to the wrapping node. You can use it to link to that node (note that you should be sure that the wire points to the top left element of the group):
+\begin{codeexample}[width=0cm]
+ \begin{ZX}[circuit]
+ \ar[rr] && \zxCtrl{} \ar[dl, end subnode=wrapper] \ar[rr] && \\
+ \rar & \zxCtrl{} \dar \rar \zxGroupGates{2}{3}{below:\textsc{swap}} & \zxNot{} \dar \rar & \zxCtrl{} \dar \rar & \\
+ \rar & \zxNot{} \rar & \zxCtrl{} \rar & \zxNot{} \rar &
+ \end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
+
\section{Advanced styling}
\subsection{Overlaying or creating styles}
@@ -1673,6 +3741,20 @@ You can also change it on a per-diagram basis:
The list of keys that can be changed will be given below in |/zx/styles/rounded style/*|.
\end{stylekey}
+\begin{stylekey}{/zx/user overlay}
+ This key will be loaded like it if were inside the options of the picture |\zx[options]{...}|. To avoid always typing |\zx[content vertically centered]{...}|, you can therefore use:
+\begin{codeexample}[width=0pt]
+\tikzset{
+ /zx/user overlay/.style={
+ content vertically centered,
+ },
+}
+\begin{ZX}
+ \zxX{\alpha} & \zxX{\beta} & \zxX{a} & \zxX{b} & \zxX*{a\pi} & \zxX*{b\pi} & \zxX*{b'\pi} & \zxX*{'b\pi} & \zxZ{(a \oplus b )\pi}
+\end{ZX}
+\end{codeexample}
+\end{stylekey}
+
\begin{stylekey}{/zx/default style wires}
Default style for wires. Note that |/zx/wires definition/| is always loaded by default, and we don't add any other style for wires by default. But additional styles may use this functionality.
\end{stylekey}
@@ -1787,8 +3869,20 @@ We present now all the properties that a new node style must have (and that can
This is used to change how the library does the conversion between |\zxFrac| and the actual written text (either in the node content or in the label depending on the function). The first argument is the sign (string |-| for minus, anything else must be written in place of the minus), the second and third argument are the numerator and denominator of the fraction when used in |\frac{}{}| while the last two arguments are the same except that they include the parens which should be added when using an inline version. For instance, one could get a call |\zxConvertToFracInLabel{-}{a+b}{c+d}{(a+b)}{(c+d)}|. See part on labels to see an example of use.
\end{pgfmanualentry}
-\begin{command}{\zxMinusInShort}
- Sign used in |\zxZ-{\alpha}| and |\zxX-{\alpha}|-like patterns. You can redefine it, for instance:
+\begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractcommand\zxMinusUnchanged\@@
+ \extractcommand\zxMinus\@@
+ \extractcommand\zxMinusInShort\@@
+ \makeatletter% should not be letter for \@@... strange
+ \extractkey/zx/defaultEnv/zx column sep=length\@nil%
+ \extractkey/zx/styles/rounded style preload/small minus\@nil%
+ \extractkey/zx/styles/rounded style preload/big minus\@nil%
+ \extractkey/zx/styles/rounded style/small minus\@nil%
+ \extractkey/zx/styles/rounded style/big minus\@nil%
+ \makeatother
+ \pgfmanualbody
+ |\zxMinus| is the minus sign used in fractions, |\zxMinusInShort| is used in |\zxZ-{\alpha}| and |\zxMinusUnchanged| is a minus sign shorter than $-$. You can redefine them, for instance:
\begin{codeexample}[]
Compare {\def\zxMinusInShort{-}
\zx{\zxZ-{\alpha}}
@@ -1797,7 +3891,20 @@ Compare {\def\zxMinusInShort{-}
\zx{\zxZ-{\alpha}}
}
\end{codeexample}
-\end{command}
+You can also choose to always use a big or a small minus, either on a per-node, per-figure, or document-wise.
+\begin{codeexample}[]
+\begin{ZX}
+ \zxFracZ-{\pi}{4} & \zxZ-{\alpha} & \zxZ-{\delta_i} & \zxZ[small minus]-{\delta_i}
+\end{ZX} Picture-wise %
+\begin{ZX}[small minus]
+ \zxZ-{\alpha} & \zxZ-{\delta_i} & \zxZ-{\delta_i} & \zxFracZ-{\pi}{4}
+\end{ZX} Document-wise %
+\tikzset{/zx/user overlay/.style={small minus}}%
+\begin{ZX}
+ \zxZ-{\alpha} & \zxZ-{\delta_i} & \zxZ[big minus]-{\delta_i} & \zxFracZ[big minus]-{\pi}{4}
+\end{ZX}
+\end{codeexample}
+\end{pgfmanualentry}
\noindent We also define several spacing commands that can be redefined to your needs:
\begin{pgfmanualentry}
@@ -1834,7 +3941,21 @@ Compare {\def\zxMinusInShort{-}
\zxN{} \ar[ru,-N'] & & \zxN{}
\end{ZX}
\end{codeexample}
-Note that you can add multiple of them by separating with commas (see |\pgfmatrixnextcell|'s documentation for more details). For instance to have a column separation of exactly |2mm|, do |&[\zxZeroCol,2mm]| (if you just do |&[2mm]| the column will be |2mm| larger).
+Note that you can add multiple of them by separating with commas (see |\pgfmatrixnextcell|'s documentation for more details). For instance to have a column separation of exactly |2mm|, do |&[\zxZeroCol,2mm]| (if you just do |&[2mm]| the column will be |2mm| larger). This can also be useful to avoid having a huge space when nodes have multiple empty outputs:
+\begin{codeexample}[]
+ Compare:
+ \begin{ZX}
+ \zxN{} & & \zxN{} \\
+ \zxN{} \rar & \zxZ{} \ar[ur,<'] \ar[dr,<'] & \\
+ & & \zxN{} \\
+ \end{ZX}
+ with
+ \begin{ZX}
+ \zxN{} & & \zxN{} \\[\zxZeroRow]
+ \zxN{} \rar & \zxZ{} \ar[ur,<'] \ar[dr,<'] & \\[\zxZeroRow]
+ & & \zxN{}
+ \end{ZX}
+\end{codeexample}
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -1858,10 +3979,6 @@ Note that you can add multiple of them by separating with commas (see |\pgfmatri
Default opening angles of |S|, |o| and |v|/|<| wires. Defaults to respectively $30$, $40$ and $45$.
\end{pgfmanualentry}
-\begin{command}{\zxMinus{}}
- The minus sign used in fractions.
-\end{command}
-
\subsection{Wire customization}\label{subsec:wirecustom}
\begin{pgfmanualentry}
@@ -1912,7 +4029,7 @@ By default the lines will be drawn behind the node and the starting and ending p
\zx{\zxZ{\alpha+\beta} \ar[dr,edge above,s] \\
& \zxZ{\alpha+\beta}}
\end{codeexample}
-(you can node the fact that the wire does not start at the center but at a |fake center *| anchor to provide a nicer look)
+(you can note the fact that the wire does not start at the center but at a |fake center *| anchor to provide a nicer look)
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2452,7 +4569,6 @@ Now, we can also globally enable the |ui| style and the intersection only for so
\end{pgfmanualentry}
-
\begin{pgfmanualentry}
\def\extrakeytext{style, }
\extractcommand\zxIntersectionLineBetweenStartEnd\@@
@@ -2506,11 +4622,12 @@ You can see that the constant looks much wider in the second picture, due to the
%% Create a new box
\newsavebox{\myZXbox}
%% Save our small diagram.
-%% Warning: the char '&' cause troubles in functions, so use ampersand replacement
-%% and \& instead:
+%% Warning: on older versions, you needed to use \& instead of &
+%% (the char '&' cause troubles in functions), but I fixed it 2022/02/09
\sbox{\myZXbox}{%
- \zx[ampersand replacement=\&]{ %<-- strange font? this is just an ampersand.
- \zxX{} \rar \ar[r,o'] \ar[r,o.] \& \zxZ{}
+ % add \tikzset{external/optimize=false} if you use tikz "external" library %
+ \zx{ % you may need
+ \zxX{} \rar \ar[r,o'] \ar[r,o.] & \zxZ{}
}%
}
@@ -2520,7 +4637,7 @@ $x = \begin{ZX}[
\node[fit=(start)(end),yshift=-axis_height] {\usebox{\myZXbox}};
},
math baseline=myb]
- &[\zxwCol] \zxFracX-{\pi}{2} & \zxN[a=start]{} & \zxN[a=end]\\
+ &[\zxwCol] \zxFracX-{\pi}{2} & \zxN[a=start]{} & \zxN[a=end]{}\\
\zxN[a=myb]{} \rar & \zxFracZ{\pi}{2} \rar & \zxFracX{\pi}{2} \rar & \zxFracZ{\pi}{2} \rar & \zxN{}
\end{ZX}$
\end{codeexample}
@@ -2534,18 +4651,45 @@ Note that this has the advantage of preserving the baseline of the big drawing.
\extractkey/zx/wires definition/use diagram=\marg{name with \textbackslash}\marg{(nodes)(to)(fit)}\@nil%
\makeatother
\pgfmanualbody
- Use |\zxSaveDiagram| to save and name a diagram (must be done before the diagram you want to insert this diagram into, also \textbf{do not forget the backslash before the name} and \textbf{replace all} |&| \textbf{in the first diagram with} |\&|. Then, |use diagram| to insert it inside a diagram (the second argument is a list of nodes given to the |fit| library):
+ Use |\zxSaveDiagram| to save and name a diagram (must be done before the diagram you want to insert this diagram into, also \textbf{do not forget the backslash before the name} (note that before 2022/09/02, you needed to use |\&| instead of |&|, but this has been fixed after 2022/02/09. In case you really care about backward compatibility, either download the sty file in your folder, or add |ampersand replacement=\&| in the options of the |\zxSaveDiagram| function and use |\&| as before). Then, |use diagram| to insert it inside a diagram (the second argument is a list of nodes given to the |fit| library):
\begin{codeexample}[width=0pt]
-%% v---- note the backslash note the \& ---v
-\zxSaveDiagram{\myZXconstant}{\zxX{} \rar \ar[r,o'] \ar[r,o.] \& \zxZ{}}
+%% v---- note the backslash
+\zxSaveDiagram{\myZXconstant}{\zxX{} \rar \ar[r,o'] \ar[r,o.] & \zxZ{}}
$x = \begin{ZX}[use diagram={\myZXconstant}{(start)(end)}, math baseline=myb]
- &[\zxwCol] \zxFracX-{\pi}{2} & \zxN[a=start]{} & \zxN[a=end]\\
+ &[\zxwCol] \zxFracX-{\pi}{2} & \zxN[a=start]{} & \zxN[a=end]{}\\
\zxN[a=myb]{} \rar & \zxFracZ{\pi}{2} \rar & \zxFracX{\pi}{2} \rar & \zxFracZ{\pi}{2} \rar & \zxN{}
\end{ZX}$
\end{codeexample}
Note that if you need more space to insert the drawing, you can use |\zxN+[a=start,minimum width=2cm]{}| instead of |\zxN|.
\end{pgfmanualentry}
+Sometimes, you may also find useful to stack diagram (for instance because the matrix of the first diagram is not related to the matrix of the second diagram), or position multiple diagrams relative to each others. You can use arrays to do that, but it will not preserve the baseline. Another solution is to put the |ZX| environment inside nodes contained in |tikzpicture| (I know that tikz does not like nesting\dots{} but it works nice for what I tried. I will also try to provide an helper function to do that later). For example here we use it to add the constants below the second diagram:
+\begin{codeexample}[vbox]
+\begin{equation*}
+ \begin{ZX}
+ &[\zxwCol] & &[\zxwCol] \zxN{} \ar[dd,3 vdots] \\[\zxNCol]
+ \zxN{} \rar & \zxZ{\pi} \rar & \zxX{\alpha} \ar[ru,N'-] \ar[rd,N.-] & \\[\zxNCol]
+ & & & \zxN{}
+ \end{ZX} =
+ \begin{tikzpicture}[
+ baseline=(A.base)
+ ]
+ \node[inner sep=0pt](A){%
+ \begin{ZX}
+ &[\zxwCol] & \zxZ{\pi} \ar[dd,3 vdots] \rar &[\zxwCol] \zxN{} \\[\zxNCol]
+ \zxN{} \rar & \zxX-{\alpha} \ar[ru,N'-] \ar[rd,N.-] & \\[\zxNCol]
+ & & \zxZ{\pi} \rar & \zxN{}
+ \end{ZX}
+ };
+ \node[inner sep=0pt,below=\zxDefaultColumnSep of A](B){
+ \begin{ZX}
+ \zxOneOverSqrtTwo{} & \zxX{\alpha} \rar & \zxZ{\pi}
+ \end{ZX}
+ };
+ \end{tikzpicture}
+\end{equation*}
+\end{codeexample}
+
\subsection{Further customization}
You can further customize your drawings using any functionality from \tikzname{} and |tikz-cd| (but it is of course at your own risk). For instance, we can change the separation between rows and/or columns for a whole picture (but prefer to use |zx row sep| as it also updates pre-configured column spaces):
@@ -2558,6 +4702,18 @@ You can further customize your drawings using any functionality from \tikzname{}
\zxN{} \rar & \zxFracZ-{\pi}{4} \ar[ru,('] \ar[rr,o.] & & \zxX{} \ar[rr] & & \zxN{}
\end{ZX}
\end{codeexample}
+You can also use the tikz |between origins| option in order to specify the distance between the center of the rows and not between their borders. This is particularly practical when gates have different heights, or if you want to compare two diagram with different content (you might also want to use something like |mbr=1.5| to set the math baseline between two lines):
+\begin{codeexample}[width=0pt]
+$\begin{ZX}[circuit, row sep={.6cm,between origins}]
+\rar & \zxCross{} \rar \dar & \\
+\rar & \zxCross{} \rar &
+\end{ZX} =
+\begin{ZX}[circuit, row sep={.6cm,between origins}]
+\rar & \zxN{} \ar[rd,s] & \zxN{} \rar & \\
+\rar & \zxN{} \ar[ru,s] & \zxN{} \rar &
+\end{ZX}$
+\end{codeexample}
+
Or we can define our own style to create blocks:
{\catcode`\|=12 % Ensures | is not anymore \verb|...|
\begin{codeexample}[width=0pt]
@@ -2593,7 +4749,7 @@ We can also use for instance |fit|, |alias|, |execute at end picture| and layers
fill=blue!50!white,
opacity=.5,
fit=(cnot1)(cnot2), %% position of the node, thanks fit library
- "\textsc{cnot}" above %% Adds label, thanks quote library
+ "\textsc{cnot}" {above, inner sep=1mm} %% Adds label, thanks quote library. Not sure why, inner sep is set to 0 when using tikz "external" library.
] {};
}
]
@@ -2601,39 +4757,65 @@ We can also use for instance |fit|, |alias|, |execute at end picture| and layers
\zxNone{} \rar & \zxX[alias=cnot2]{} \rar & \zxNone{}\\
\end{ZX}
\end{codeexample}
+Because this code is quite lengthy and useful, we provide in \cref{subsec:decoration} a shorter syntax.
}
-This can also be used to fake multi-columns nodes (I need to check later if I can facilitate this kind of operation from the library directly):
+
+You can also use other libraries, in particular |nfold| can be practical to insert many wires at once (note that you need a recent version since it was introduced in CTAN 2023, or you need to manually install the library):
{\catcode`\|=12 % Ensures | is not anymore \verb|...|
-\begin{codeexample}[width=3cm]
-% \usetikzlibrary{fit}
-\tikzset{
- my box/.style={inner sep=4pt, draw, thick, fill=white,anchor=center},
-}
-\begin{ZX}[
- execute at end picture={
- \node[
- my box,
- node on layer=box, %% Ensure the node is above the wires
- fit=(f1)(f2), %% position of the node, thanks fit library
- label={[node on layer=box]center:$f$},
- ] {};
- }
- ]
- \zxNoneDouble+[alias=f1]{} \rar &[1mm] |[my box]| g \rar & \zxNone{}\\
- \zxNoneDouble+[alias=f2]{} \rar &[1mm] \zxZ{} \rar & \zxNone{}\\
+\begin{codeexample}[width=0pt]
+% \usetikzlibrary{nfold} % needs very recent CTAN > 2023, or manually copy the .tex files
+\begin{ZX}[circuit]
+ \rar[scaling nfold=5]
+ & \zxGate{X} \rar[rd, line join=round, double distance=2pt, scaling nfold=3,--|] & \\
+ & & \zxGate{Y}
\end{ZX}
\end{codeexample}
}
-\section{Futur works}
-There is surely many things to improve in this library, and given how young it is there is surely many undiscovered bugs. So feel free to propose ideas or report bugs \mylink{https://github.com/leo-colisson/zx-calculus/issues}{one the github page}. I also would like to provide externalization to boost compilation time. But |tikz-cd| is not really compatible with externalization, so it would need a bit of work (of course, you can always compile your images in a separate file, but it is cumbersome). See potential solutions here: \mylink{https://tex.stackexchange.com/questions/171931/}{here}. The intersections code is also quite slow, so I would be curious to check if I can optimize it (the first goal was to make it work). I should also work on the compatibility with tikzit (basically just write tikz configuration files that you can just use and document how to use tikzit with it), or even write a dedicated graphical tool (why not based on tikzit itself, or \mylink{https://tikzcd.yichuanshen.de/}{this tool}). I also want to find a nicer way to merge cells (for now I propose to use the |fit| library but it's not very robust against overlays) and to nest ZX diagrams (see ). And of course fix typos in the documentation and write other styles, including notations not specific to ZX-calculus. Feel free to submit Pull Requests to solve that!
+\section{Future works}
+
+There is surely many things to improve in this library, and given how young it is there is surely many undiscovered bugs. So feel free to propose ideas or report bugs \mylink{https://github.com/leo-colisson/zx-calculus/issues}{one the github page}. The intersections code is also quite slow, so I would be curious to check if I can optimize it (the first goal was to make it work). I should also work on the compatibility with tikzit (basically just write tikz configuration files that you can just use and document how to use tikzit with it), or even write a dedicated graphical tool (why not based on tikzit itself, or \mylink{https://tikzcd.yichuanshen.de/}{this tool}). I also want to find a nicer way to merge cells (for now I propose to use the |fit| library but it's not very robust against overlays) and to nest ZX diagrams. And of course fix typos in the documentation and write other styles, including notations not specific to ZX-calculus. Feel free to submit Pull Requests to solve that, or to submit bug reports to explain uncovered use-cases!
\section{Acknowledgement}
-I'm very grateful of course to everybody that worked on these amazing field which made diagramatic quantum computing possible, and to the many StackExchange users that helped me to understand a bit more \LaTeX{} and \tikzname{} (sorry, I don't want to risk an incomplete list, but many thanks to egreg, David Carlisle, cfr, percusse, Andrew Stacey, Henri Menke, SebGlav\dots{}). I also thank Robert Booth for making me realize how my old style was bad, and for giving advices on how to improve it. Thanks to John van de Wetering, whose style has also been a source of inspiration.
+I'm very grateful of course to everybody that worked on these amazing field which made diagramatic quantum computing possible, and to the many StackExchange users that helped me to understand a bit more \LaTeX{} and \tikzname{} (sorry, I don't want to risk an incomplete list, but many thanks to egreg, David Carlisle, cfr, percusse, Andrew Stacey, Henri Menke, SebGlav, Qrrbrbirlbel\dots{}). I also thank Robert Booth for making me realize how my old style was ugly, and for giving advices on how to improve it. Thanks to John van de Wetering and Alastair Kay (author of Quantikz), whose styles have also been a source of inspiration~\cite{van20_ZXcalculusWorkingQuantum}, and to Augusto Stoffel for the great tikzcd package on which this library is built.
+
+\section{Changelog}
+
+\begin{itemize}
+\item 2023/09/26:
+ Many updates in the past months:
+ \begin{itemize}
+ \item Custom nodes are made easy
+ \item Multi-gates nodes and many circuit-related functions
+ \item Added |post arrow style if start node| and other similar commands
+ \item updated the doc to use the latest version of robust-externalize that is much simpler to use now\dots
+ \item Some nodes can also now be usable outside tikzcd, but I've not tried (I should provide more options for this).
+ \item Group gates
+ \item
+ \end{itemize}
+\item 2022/02/09:
+ \begin{itemize}
+ \item Added compatibility with external tikz library
+ \item More robust handling of |&|: align and macros does not need |\&| anymore.
+ \item |\&| in |\zxSaveDiagram| is replaced with |&|. This introduces a small backward incompatibility, but hey, I said it was still subject to changes :-)
+ \end{itemize}
+\end{itemize}
+
+\section{TODO}
+\begin{itemize}
+\item I think that some anchors are not properly configured in stuff like |\zxBox| etc, so a nice sanity check should be done
+\item Clean the code, eventually
+\item Consider subnodes as anchors (fake center etc)
+\item more circuit related stuff
+\item multigate invisible element
+\item curly braces made easy
+\item lstick
+\end{itemize}
\printindex
+\printbibliography[heading=bibintoc]
\end{document}
diff --git a/macros/generic/memoize/CHANGELOG.md b/macros/generic/memoize/CHANGELOG.md
index f0d283ee76..291490e568 100644
--- a/macros/generic/memoize/CHANGELOG.md
+++ b/macros/generic/memoize/CHANGELOG.md
@@ -3,7 +3,12 @@
For the development history, see [Memoize's GitHub
repository](https://github.com/sasozivanovic/memoize).
-## 2024/1/02 v1.1.0
+## 2024/01/16 v1.1.1
+
+* Fix a bug where, under `no memo dir`, Memoize was checking whether the extern
+ exists in the root folder.
+
+## 2024/01/02 v1.1.0
* Improve the extraction scripts:
* respect `TEXMF_OUTPUT_DIRECTORY`;
diff --git a/macros/generic/memoize/Makefile b/macros/generic/memoize/Makefile
index 2f79a3b8ce..120b104903 100644
--- a/macros/generic/memoize/Makefile
+++ b/macros/generic/memoize/Makefile
@@ -5,21 +5,22 @@ PACKAGES = memoize advice collargs
all: ctan/memoize.zip
$(MAKE) -f Makefile.advice ctan/advice.zip
$(MAKE) -f Makefile.collargs ctan/collargs.zip
+ @echo "Don't forget to run the tests!"
# Prepare the CTAN submission.
PACKAGE = memoize
-VERSION = 1.1.0
+VERSION = 1.1.1
YEAR = 2024
MONTH = 01
-DAY = 02
+DAY = 16
FORMAT = generic
COMMON = memoize nomemoize memoizable
PLAIN = memoize-extract-one.tex
GENERIC = memoizable.code.tex
-SOURCE = memoize.edtx memoize.ins # $(makefiles)
+SOURCE = memoize.edtx memoize.ins
SCRIPTS := memoize-extract memoize-clean
man-src := $(SCRIPTS:%=doc/%.1.md)
@@ -38,6 +39,9 @@ CHANGELOG = CHANGELOG.md
MAKEFILE = Makefile
LICENCE = LICENCE
+PACKAGES.edtx = $(PACKAGES:%=%.edtx)
+PACKAGES.ins = $(PACKAGES:%=%.ins)
+
makefiles = Makefile.package Makefile.runtimes Makefile.advice Makefile.collargs
codedoc-source = memoize-code.tex \
@@ -87,14 +91,13 @@ ctan/$(PACKAGE).zip:
edtx2dtx -s -c '#' -B '^my \$$PROG' -E '^# Local Variables:' $< \
| sed -e '/^% Local Variables:/Q' > $@
-doc/memoize-code.pdf: $(SOURCE) $(codedoc-source) \
- advice.edtx advice.ins collargs.edtx collargs.ins \
- $(SCRIPTS:%=%.dtx)
+doc/memoize-code.pdf: $(codedoc-source) \
+ $(PACKAGES.edtx) $(PACKAGES.ins) $(SCRIPTS:%=%.dtx)
-doc/memoize.pdf: $(manual-source) $(examples-src) memoize.edtx advice.edtx collargs.edtx
+doc/memoize.pdf: $(manual-source) $(examples-src) $(PACKAGES.edtx)
%.pdf: %.tex
- latexmk -cd -lualatex -bibtex- $< && touch $@
+ latexmk -cd -lualatex -bibtex- $(LATEXMK) $< && touch $@
@@ -128,11 +131,11 @@ version:
$(call EDIT-VERSION-MAN,doc/memoize-clean.1.md)
$(call EDIT-DATE-CHANGELOG,CHANGELOG.md)
define COLOR_VERSION
-grep -E --color '[0-9]{4}[/-][0-9]{2}[/-][0-9]{2}|v?[0-9]\.[0-9]\.[0-9]([-a-z]*)|(January|February|March|April|May|June|July|August|September|October|November|December) [0-9]+, [0-9]{4}'
+grep -E --color '[0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2}|v?[0-9]\.[0-9]\.[0-9]([-a-z]*)|(January|February|March|April|May|June|July|August|September|October|November|December) [0-9]+, [0-9]{4}'
endef
versions-show:
- @grep -E '%<latex>\\ProvidesPackage|^%<context>%D\s*(version|date)=' $(PACKAGES:%=%.edtx) | ${COLOR_VERSION}
+ @grep -E '%<latex>\\ProvidesPackage|^%<context>%D\s*(version|date)=' $(PACKAGES.edtx) | ${COLOR_VERSION}
@grep __version__ *.py | ${COLOR_VERSION}
@grep VERSION *.pl | ${COLOR_VERSION}
@grep -E '^(footer|date):' doc/memoize-*.md | ${COLOR_VERSION}
diff --git a/macros/generic/memoize/doc/memoize-clean.1.md b/macros/generic/memoize/doc/memoize-clean.1.md
index b296697d6c..c64cbc0cd0 100644
--- a/macros/generic/memoize/doc/memoize-clean.1.md
+++ b/macros/generic/memoize/doc/memoize-clean.1.md
@@ -2,8 +2,8 @@
title: memoize-clean
section: 1
header: User Manual
-footer: memoize-clean of Memoize v1.1.0
-date: January 02, 2024
+footer: memoize-clean of Memoize v1.1.1
+date: January 16, 2024
hyphenate: false
---
diff --git a/macros/generic/memoize/doc/memoize-code.pdf b/macros/generic/memoize/doc/memoize-code.pdf
index 415b401f42..3ef2312ae0 100644
--- a/macros/generic/memoize/doc/memoize-code.pdf
+++ b/macros/generic/memoize/doc/memoize-code.pdf
Binary files differ
diff --git a/macros/generic/memoize/doc/memoize-doc.pdf b/macros/generic/memoize/doc/memoize-doc.pdf
index 02d3caf6f0..f02f803abc 100644
--- a/macros/generic/memoize/doc/memoize-doc.pdf
+++ b/macros/generic/memoize/doc/memoize-doc.pdf
Binary files differ
diff --git a/macros/generic/memoize/doc/memoize-doc.tex b/macros/generic/memoize/doc/memoize-doc.tex
index efde098ef0..951d4b469f 100644
--- a/macros/generic/memoize/doc/memoize-doc.tex
+++ b/macros/generic/memoize/doc/memoize-doc.tex
@@ -3360,7 +3360,7 @@ to memoize environment |listii|, we will at that point redefine \cs{label} to do
that. In effect, changing the location of |listii| will only recompile it if
it contains a \cs{label}.
-At announced, we redefine \cs{label} once the memoization of |listii| begins,
+As announced, we redefine \cs{label} once the memoization of |listii| begins,
so within \refmmz{at begin memoization}.\footnote{Another generally good
location for such redefinitions is among the auto-options of |listii|. We
could include an \refmmz{auto}\cs{label}\marg{...} there, or a |/utils/exec|
diff --git a/macros/generic/memoize/doc/memoize-extract.1.md b/macros/generic/memoize/doc/memoize-extract.1.md
index f3f3d52ad0..266f65b962 100644
--- a/macros/generic/memoize/doc/memoize-extract.1.md
+++ b/macros/generic/memoize/doc/memoize-extract.1.md
@@ -2,8 +2,8 @@
title: memoize-extract
section: 1
header: User Manual
-footer: memoize-extract of Memoize v1.1.0
-date: January 02, 2024
+footer: memoize-extract of Memoize v1.1.1
+date: January 16, 2024
hyphenate: false
---
diff --git a/macros/generic/memoize/memoize-clean.pl b/macros/generic/memoize/memoize-clean.pl
index 7d7e4f5b43..f3c4dd01bc 100755
--- a/macros/generic/memoize/memoize-clean.pl
+++ b/macros/generic/memoize/memoize-clean.pl
@@ -19,7 +19,7 @@
# <texmf>/doc/generic/memoize/FILES.
my $PROG = 'memoize-clean.pl';
-my $VERSION = '2024/01/02 v1.1.0';
+my $VERSION = '2024/01/16 v1.1.1';
use strict;
use Getopt::Long;
diff --git a/macros/generic/memoize/memoize-clean.py b/macros/generic/memoize/memoize-clean.py
index db758bbd35..b123ed68fe 100755
--- a/macros/generic/memoize/memoize-clean.py
+++ b/macros/generic/memoize/memoize-clean.py
@@ -18,7 +18,7 @@
# The files belonging to this work and covered by LPPL are listed in
# <texmf>/doc/generic/memoize/FILES.
-__version__ = '2024/01/02 v1.1.0'
+__version__ = '2024/01/16 v1.1.1'
import argparse, re, sys, pathlib, os
diff --git a/macros/generic/memoize/memoize-extract.pl b/macros/generic/memoize/memoize-extract.pl
index 96eec29b97..c3cd430016 100755
--- a/macros/generic/memoize/memoize-extract.pl
+++ b/macros/generic/memoize/memoize-extract.pl
@@ -19,7 +19,7 @@
# <texmf>/doc/generic/memoize/FILES.
my $PROG = 'memoize-extract.pl';
-my $VERSION = '2024/01/02 v1.1.0';
+my $VERSION = '2024/01/16 v1.1.1';
use strict;
use File::Basename qw/basename/;
diff --git a/macros/generic/memoize/memoize-extract.py b/macros/generic/memoize/memoize-extract.py
index 29ea58192c..cc936e0447 100755
--- a/macros/generic/memoize/memoize-extract.py
+++ b/macros/generic/memoize/memoize-extract.py
@@ -18,7 +18,7 @@
# The files belonging to this work and covered by LPPL are listed in
# <texmf>/doc/generic/memoize/FILES.
-__version__ = '2024/01/02 v1.1.0'
+__version__ = '2024/01/16 v1.1.1'
import argparse, re, sys, os, subprocess, itertools, traceback, platform
from pathlib import Path, PurePath
diff --git a/macros/generic/memoize/memoize.edtx b/macros/generic/memoize/memoize.edtx
index 86ed2b6197..77cf376391 100644
--- a/macros/generic/memoize/memoize.edtx
+++ b/macros/generic/memoize/memoize.edtx
@@ -90,55 +90,55 @@
%
% \paragraph{Identification} of |memoize|, |memoizable| and |nomemoize|.
%<*mmz>
-%<latex>\ProvidesPackage{memoize}[2024/1/02 v1.1.0 Fast and flexible externalization]
+%<latex>\ProvidesPackage{memoize}[2024/01/16 v1.1.1 Fast and flexible externalization]
%<context>%D \module[
%<context>%D file=t-memoize.tex,
-%<context>%D version=1.1.0,
+%<context>%D version=1.1.1,
%<context>%D title=Memoize,
%<context>%D subtitle=Fast and flexible externalization,
%<context>%D author=Saso Zivanovic,
-%<context>%D date=2024-01-02,
+%<context>%D date=2024-01-16,
%<context>%D copyright=Saso Zivanovic,
%<context>%D license=LPPL,
%<context>%D ]
%<context>\writestatus{loading}{ConTeXt User Module / memoize}
%<context>\unprotect
%<context>\startmodule[memoize]
-%<plain>% Package memoize 2024/01/02 v1.1.0
+%<plain>% Package memoize 2024/01/16 v1.1.1
%</mmz>
%<*mmzable>
-%<latex>\ProvidesPackage{memoizable}[2024/1/02 v1.1.0 A programmer's stub for Memoize]
+%<latex>\ProvidesPackage{memoizable}[2024/01/16 v1.1.1 A programmer's stub for Memoize]
%<context>%D \module[
%<context>%D file=t-memoizable.tex,
-%<context>%D version=1.1.0,
+%<context>%D version=1.1.1,
%<context>%D title=Memoizable,
%<context>%D subtitle=A programmer's stub for Memoize,
%<context>%D author=Saso Zivanovic,
-%<context>%D date=2024-01-02,
+%<context>%D date=2024-01-16,
%<context>%D copyright=Saso Zivanovic,
%<context>%D license=LPPL,
%<context>%D ]
%<context>\writestatus{loading}{ConTeXt User Module / memoizable}
%<context>\unprotect
%<context>\startmodule[memoizable]
-%<plain>% Package memoizable 2024/01/02 v1.1.0
+%<plain>% Package memoizable 2024/01/16 v1.1.1
%</mmzable>
%<*nommz>
-%<latex>\ProvidesPackage{nomemoize}[2024/1/02 v1.1.0 A no-op stub for Memoize]
+%<latex>\ProvidesPackage{nomemoize}[2024/01/16 v1.1.1 A no-op stub for Memoize]
%<context>%D \module[
%<context>%D file=t-nomemoize.tex,
-%<context>%D version=1.1.0,
+%<context>%D version=1.1.1,
%<context>%D title=Memoize,
%<context>%D subtitle=A no-op stub for Memoize,
%<context>%D author=Saso Zivanovic,
-%<context>%D date=2024-01-02,
+%<context>%D date=2024-01-16,
%<context>%D copyright=Saso Zivanovic,
%<context>%D license=LPPL,
%<context>%D ]
%<context>\writestatus{loading}{ConTeXt User Module / nomemoize}
%<context>\unprotect
%<context>\startmodule[nomemoize]
-%<mmz>% Package nomemoize 2024/01/02 v1.1.0
+%<mmz>% Package nomemoize 2024/01/16 v1.1.1
%</nommz>
%
% \paragraph{Required packages} and \hologo{LaTeX}ization of \hologo{plainTeX}
@@ -1766,7 +1766,7 @@
% might be produced by a failed \hologo{TeX}-based extraction, should count
% as no file. The |0| behind |\ifnum| is there because |\pdffilesize|
% returns an empty string when the file does not exist.
- \ifnum0\pdf@filesize{\mmz@prefix@dir/#1}=0
+ \ifnum0\pdf@filesize{\mmz@prefix@dir#1}=0
\ifmmz@direct@ccmemo@input
\let\mmzMemo\endinput
\else
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index ef77b1dd23..94cecae2dc 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2024/01/14}{2024H}
+\ProvidesExplClass{easybook}{2024/01/16}{2024I}
{Easily typesetting Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -158,7 +158,7 @@
\eb_setsansfont:nn { Arial } { }
\eb_setmonofont:nn { Courier~New } { }
}
-\cs_new_protected:Npn \eb_font_load_libertinus_sans:
+\cs_new_protected:Npn \eb@font@load@libertinus@sans
{
\eb_setsansfont:nn { LibertinusSans }
{
@@ -168,7 +168,7 @@
ItalicFont = *-Italic
}
}
-\cs_new_protected:Npn \eb_font_load_lmmonolt_mono:
+\cs_new_protected:Npn \eb@font@load@lmmonolt@mono
{
\eb_setmonofont:nn { lmmonolt10 }
{
@@ -189,8 +189,8 @@
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic
}
- \eb_font_load_libertinus_sans:
- \eb_font_load_lmmonolt_mono:
+ \eb@font@load@libertinus@sans
+ \eb@font@load@lmmonolt@mono
}
\cs_new_protected:Npn \eb@font@load@libertine
{
@@ -202,8 +202,8 @@
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic
}
- \eb_font_load_libertinus_sans:
- \eb_font_load_lmmonolt_mono:
+ \eb@font@load@libertinus@sans
+ \eb@font@load@lmmonolt@mono
}
\cs_new_protected:Npn \eb@font@load@palatino
{
@@ -215,8 +215,8 @@
ItalicFont = *-italic,
BoldItalicFont = *-bolditalic
}
- \eb_font_load_libertinus_sans:
- \eb_font_load_lmmonolt_mono:
+ \eb@font@load@libertinus@sans
+ \eb@font@load@lmmonolt@mono
}
\cs_new_protected:Npn \eb_put_newtxmath:n #1
{ \PassOptionsToPackage{#1}{newtxmath} }
@@ -302,7 +302,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2024/01/14}{2024H}
+\ProvidesExplPackage{easybase}{2024/01/16}{2024I}
{Easily typesetting Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1245,7 +1245,6 @@
\cs_set:Npn \thebisection { \eb_section_counter_prefix:n { bi } }
\cs_set:Npn \thebisubsection { \thebisection.\@arabic\c@bisubsection }
\cs_set:Npn \thesection { \eb_section_counter_prefix:n { } }
-\contentsuse{}{tec}
\tl_new:N \eb@before@addbitoc@hook
\NewDocumentCommand{\BeforeAddBitoc}{sm}
{
@@ -1390,8 +1389,13 @@
}
\cs_new_protected:Npn \eb_toc_title_level_cmd:n #1
{
- \IfBooleanF{#1}
- {\eb@toc@title@level{\eb@toc@title}{\eb@bitoc@title}}
+ \IfBooleanTF{#1}
+ {\par}
+ {
+ \tl_if_exist:NTF \eb@toc@title
+ { \eb@toc@title@level{\eb@toc@title}{\eb@bitoc@title} }
+ { \par }
+ }
}
\cs_new_protected:Npn \eb_toc_float_list_parse:nnnnn #1#2#3#4#5
{
@@ -1499,7 +1503,7 @@
\tl_use:c { l__eb_toc_#1_after_tl }
}
}
-\cs_new_protected:Npn \RegisterTocName #1
+\cs_new_protected:Npn \eb@toc@format@define #1
{
\ctex_define:n
{
@@ -1511,6 +1515,9 @@
#1/tocafter .tl_set:c = l__eb_toc_#1_after_tl,
#1/tocbelow .tl_set:c = l__eb_toc_#1_below_tl
}
+ }
+\cs_new_protected:Npn \eb@toc@format@initial #1
+ {
\titlecontents{#1}
[\dim_use:c { l__eb_toc_#1_indent_dim }]
{\tl_use:c { l__eb_toc_#1_format_tl }}
@@ -1518,8 +1525,20 @@
{\tl_use:c { l__eb_toc_#1_rule_tl }}
[\tl_use:c { l__eb_toc_#1_below_tl }]
}
+\cs_new_protected:Npn \RegisterTocName #1
+ {
+ \eb@toc@format@define{#1}
+ \eb@toc@format@initial{#1}
+ }
\seq_map_function:NN
\c__ctex_headings_seq \RegisterTocName
+\seq_remove_all:Nn \c__ctex_headings_seq { table }
+\seq_remove_all:Nn \c__ctex_headings_seq { figure }
+\seq_remove_all:Nn \c__ctex_headings_seq { lstlisting }
+\cs_new_protected:Npn \eb@key@path@meta@define #1
+ { \ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} } }
+\seq_map_function:NN
+\c__ctex_headings_seq \eb@key@path@meta@define
\eb_seq_map_inline:nn
{
tocformat,tocformat+,tocformat~+,
@@ -1586,6 +1605,14 @@
}
}
}
+\cs_set_eq:NN \eb@ctexsetii \ctex_set:nn
+\cs_new_protected:Npn \SetTocStyle #1#2#3
+ {
+ \tl_set:cn { eb@toc@style@set@#1@#2 }
+ { \eb@ctexsetii{#1}{#3} }
+ }
+\cs_new_protected:Npn \UseTocStyle #1#2#3
+ { \addtocontents{#3}{\@nameuse{eb@toc@style@set@#1@#2}} }
\ctex_set:n
{
part =
@@ -2321,7 +2348,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2024/01/14}{2024H}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2024/01/16}{2024I}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 9538d1c7cf..a0fea3d113 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 1dbe185ff6..d0df41762e 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -23,8 +23,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK使用手册,
- version = v2024H,
- date = 2024/01/14,
+ version = v2024I,
+ date = 2024/01/16,
authors = 瞿毅,
info = 简便地排版中文学位论文或书籍,
email = toquyi@163.com,
@@ -558,7 +558,7 @@
\keyval{numberlike}{计数器}
定理将使用此 \meta{计数器} 进行编号,通常这是另一个定理环境的名称。
\keyval{qed}{证毕符号}
- 证毕符号。位于定理段落末尾行的右侧边缘,可以设置成 \cs{qedsymbol} 默认是空心方块。
+ 证毕符号。位于定理段落末尾行的版心右边,可以设置成 \cs{qedsymbol} 默认是空心方块。
\keyval{style}{定理样式}
选项的值为使用 \cs{declaretheoremstyle} 命令新定义的定理样式。
@@ -681,7 +681,7 @@
\begin{commands}
\command{markrule}[\oarg{长度}\darg{颜色名}\marg{线宽}\baroarg{上间距,下间距}]
- 实线命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,上下间距之间用符号 \code{|} 分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子:
+ 实线命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为版心的宽度,上下间距为横线与上下方部件的间距,带有长度单位,上下间距之间用符号 \code{|} 分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子:
\begin{ctexexam}
\ebhdrset{headrule = \markrule(DarkOrchid){0.5pt}[2pt|2pt]}
\fancyhead[ER]{\leftmark}
@@ -810,10 +810,10 @@
\end{commands}
\keyval{tocafter}{距离命令}\dtag\Default{\cs*{hspace}\Marg{1em}}
目录条目标签与标题间的代码,默认为插入 \code{1em} 横向距离。
- \keyval{tocbelow}{距离命令}\dtag\newtag%
+ \keyval{tocbelow}{距离命令}\dtag
在目录条目下方执行的代码,可以插入垂直距离等命令。
\keyval{tocline}{条目定义}\dtag[\textcolor{red}{\ding{73}}]
- 这个选项在章节标题基础上扩展了浮动环境的题注在目录文件中的定义。选项中参数 \code{\#1} 代表相应题注编号 \cs*{the}\meta{计数器} 的值,参数 \code{\#2} 代表相应题注内容。
+ 这个选项在章节标题基础上扩展了浮动环境的题注标题在目录文件中的定义。由于设计的原因,章节标题选项中参数 \code{\#1} 代表标题编号 \cs*{the}\meta{计数器} 对应的计数器名称,而题注标题选项中参数 \code{\#1} 代表标题编号 \cs*{the}\meta{计数器} 的值,章节和题注标题中参数 \code{\#2} 均代表相应标题内容。
\begin{ctexexam}
\ctexset
{
@@ -830,11 +830,11 @@
\end{options}
\begin{commands}
- \command{RegisterTocName}[\marg{条目名}]\newtag%
+ \command{RegisterTocName}[\marg{条目名}]
给条目类型名称为 \meta{条目名} 的标题注册用于设置目录样式的选项,即选项前有符号 \ding{73} 表示需要注册后使用。前面提到的条目类型均已注册,需要注意新类型的条目注册后选项初始值\textbf{均为空}。
\command{contentsuse}[\marg{条目名}\marg{扩展名}]
激活条目类型名称为 \meta{条目名} 的目录定制功能,它使用的目录文件后缀为 \meta{扩展名}。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。
- \command{DeclareFloatList}[\marg{条目名}\marg{扩展名}]\newtag%
+ \command{DeclareFloatList}[\marg{条目名}\marg{扩展名}]
声明一种条目类型的目录命令 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}},并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,例如搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有红色符号 \textcolor{red}{\ding{73}}(仍包含黑色符号选项的性质)表示在声明后可用。下面举一个声明算法环境和对应题注目录的例子:
\begin{ctexexam}
\usepackage{newfloat}
@@ -846,6 +846,14 @@
\DeclareFloatList{algorithm}{loa}
\listofalgorithms[multoc] % 在正文中输出双栏算法目录
\end{ctexexam}
+ \command{SetTocStyle}[\marg{条目名}\marg{风格名}\marg{键值列表}]\newtag%
+ 定义条目类型名称为 \meta{风格名} 的目录风格。使用 \cs*{ctexset} 命令设置目录样式时,除了条目标题定义选项 \option{tocline},其它选项只有在目录输出命令前设置才有效,定义完目录风格后用 \cs{UseTocStyle} 命令可以在正文中任意位置生效。如果是没有 \ding{73} 符号的选项,\meta{条目名} 设置为 \module*{tocset}。
+ \command{UseTocStyle}[\marg{条目名}\marg{风格名}\marg{扩展名}]\newtag%
+ 使用对应条目类型名称为 \meta{风格名} 的目录风格,随后标题在目录中的格式会改变。本命令导言区和正文区均可使用,第三个必选参数还需要指定条目标题加入目录文件的 \meta{扩展名}。
+ \begin{ctexexam}
+ \SetTocStyle{chapter}{fancy}{tocformat = \color{red}\zihao{3}}
+ \UseTocStyle{chapter}{fancy}{toc}
+ \end{ctexexam}
\command{listnumberline}[\marg{条目名}]
在图表等浮动环境的题注目录中插入条目标签,默认标签的名字可以由格式命令 \cs{labelformat} 设置。注意其中 \meta{条目名} 需要用对应名称\textbf{显式指定}。
\begin{ctexexam}
@@ -855,6 +863,8 @@
lstlisting/tocline = \protect\numberline{代码#1\hspace{1em}}#2
}
\end{ctexexam}
+ \command{contentsmargin}[\marg{右边距}]
+ 目录中引导线到版心右边的距离,用于条目页码的精细调整。当设置条目页码对齐方式或数字较大时,可以设置适当的数值,可在导言区全局设置或在 \option{tocformat} 选项给条目类型单独设置。
\end{commands}
\begin{options}
@@ -864,7 +874,7 @@
代码目录中每章第一个条目上方增加的垂直距离。与 \CTeX 的表格和图片目录中每章间的条目距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。
\keyval{between}{代码钩子}\dtag[\textcolor{red}{\ding{73}}]
目录标题与条目内容间的钩子(作用于标题下方间距之后),一般插入负的垂直距离代码用于抵消目录首行额外的垂直间距。除了条目名的键路径外,此选项也可用于 \module*{tocset} 路径中,表示章节标题目录标题代码钩子。
- \keyval{bibetween}{代码钩子}\newtag%
+ \keyval{bibetween}{代码钩子}
与选项 \option{between} 类似,是英文章节标题目录(如果启用)标题代码钩子。
\keychoice{dotalign}{\fbox{true},false}
引导线选项 \option{dotalign} 可以使目录引导线右端对齐并与页码保持一定间距,否则会与页码相连。
@@ -963,9 +973,9 @@
\command{appendix}[\splitoarg{前名字,后名字}\darg{编号输出命令}]
附录起始命令,其后的章节标题变为附录形式。\meta{前名字} 为英文目录中附录标题的前名字,同理 \meta{后名字} 为英文目录中附录标题的后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文目录中附录标题前名字。\meta{编号输出命令} 为附录标题计数器在英文目录中的编号命令。注意这两个参数仅对 \code{bichapter} 级别的标题生效。
\command{BeforeAddBitoc}[\sarg\marg{英文标题加入目录前的代码}]
- 作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \cs{bichapter} 等双语标题命令前生效。这个命令在设置英文目录标题格式中有最高优先级。举一个在英文目录节标题编号前添加 \code{Section} 字符串的例子:
+ 作用于局部范围的英文目录章节标题钩子,代码在标题加入目录前执行,可以插入条目标题定义命令临时改变英文目录中条目的格式,带有星号参数的命令会重置之前的代码。这个命令设置英文目录条目的标题格式具有最高优先级,放置在导言区或 \cs{bichapter} 等双语标题命令前生效。举一个在英文目录节标题编号前添加 \code{Section} 字符串的例子:
\begin{ctexexam}
- \BeforeAddBitoc{\ctexset{section/name = Section}}
+ \BeforeAddBitoc{\ctexset{section/name = Section\space}}
\bisection{zhtitle}{entitle}
\end{ctexexam}
\end{commands}
@@ -1340,9 +1350,10 @@
\shortversion{v = 1.638,date = 2022/03/04,changes = 增加目录条目样式选项注册命令 \cs{RegisterTocName}。}
\shortversion{v = 1.644,date = 2022/03/10,changes = 增加浮动环境目录声明命令 \cs{DeclareFloatList} 配合 \pkg*{caption} 宏包。}
\shortversion{v = 1.682,date = 2022/05/01,changes = 将迷你页判断命令 \cs{notminipage} 改为被保护命令兼容 \pkg*{circledtext} 宏包。}
- \begin{version}[v = 2024H,date = 2024/01/14,simple]
+ \begin{version}[v = 2024I,date = 2024/01/16,simple]
\item 核对依赖宏包的更新改动,优化使用手册的内容细节。
\item 修复图表题注目录中条目标签编号的计数器值显示错误问题。
+ \item 新增目录风格定义命令 \cs{SetTocStyle} 和使用命令 \cs{UseTocStyle}。
\end{version}
\end{changelog}
\nocite{*}
diff --git a/macros/latex/contrib/ppt-slides/DEPENDS.txt b/macros/latex/contrib/ppt-slides/DEPENDS.txt
index 9234b174c7..d0c2464766 100644
--- a/macros/latex/contrib/ppt-slides/DEPENDS.txt
+++ b/macros/latex/contrib/ppt-slides/DEPENDS.txt
@@ -18,6 +18,7 @@ hard tikzpagenodes
hard titling
hard varwidth
hard xcolor
+hard listings
soft acmart
soft biber
soft biblatex
diff --git a/macros/latex/contrib/ppt-slides/LICENSE.txt b/macros/latex/contrib/ppt-slides/LICENSE.txt
index 5744f745f0..1f211e0287 100644
--- a/macros/latex/contrib/ppt-slides/LICENSE.txt
+++ b/macros/latex/contrib/ppt-slides/LICENSE.txt
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2021-2023 Yegor Bugayenko
+Copyright (c) 2021-2024 Yegor Bugayenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
diff --git a/macros/latex/contrib/ppt-slides/README.md b/macros/latex/contrib/ppt-slides/README.md
index 3827f11588..f1f92da99d 100644
--- a/macros/latex/contrib/ppt-slides/README.md
+++ b/macros/latex/contrib/ppt-slides/README.md
@@ -25,7 +25,7 @@ and then use in preamble:
\end{document}
```
-Otherwise, you can download [`ppt-slides.sty`](https://raw.githubusercontent.com/yegor256/ppt-slides/gh-pages/ppt-slides/ppt-slides.sty) and add to your project.
+Otherwise, you can download [`ppt-slides.sty`](https://yegor256.github.io/ppt-slides/ppt-slides.sty) and add to your project.
If you want to contribute yourself, make a fork, then create a branch,
then run `l3build ctan` in the root directory.
diff --git a/macros/latex/contrib/ppt-slides/ppt-slides.dtx b/macros/latex/contrib/ppt-slides/ppt-slides.dtx
index 54abab106f..9e14a1170d 100644
--- a/macros/latex/contrib/ppt-slides/ppt-slides.dtx
+++ b/macros/latex/contrib/ppt-slides/ppt-slides.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% (The MIT License)
%
-% Copyright (c) 2021-2023 Yegor Bugayenko
+% Copyright (c) 2021-2024 Yegor Bugayenko
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the 'Software'), to deal
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{ppt-slides}
%<*package>
-[2023-11-08 0.3.0 Slide Decks a la Power Point]
+[2024-01-16 0.3.1 Slide Decks a la Power Point]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -410,18 +410,77 @@
\fi\makeatother
% \end{macrocode}
-% Then, we include a few packages:
+% Then, we include \href{https://ctan.org/pkg/ifthen}{ifthen}
+% in order to enable |if/then/else| commands:
% \begin{macrocode}
-\RequirePackage{ifthen} % for if/then/else in LaTeX
-\RequirePackage{href-ul} % for nice hyperlinks
-\RequirePackage{pagecolor} % to change page color
-\RequirePackage{varwidth} % for pptWide
-\RequirePackage{qrcode} % to print QR codes
-\RequirePackage{tikz} % for drawings in TOC
- \usetikzlibrary{calc} % for positioning of pinned boxes
-\RequirePackage{tikzpagenodes} % for pptPin
-\RequirePackage[inline]{enumitem} % for lists in crumbs
-\RequirePackage{crumbs} % for crumbs
+\RequirePackage{ifthen}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/href-ul}{href-ul}
+% in order to enable underlined hyperlinks:
+% \begin{macrocode}
+\RequirePackage{href-ul}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/pagecolor}{pagecolor}
+% in order to make it possible to change the background color of a page:
+% \begin{macrocode}
+\RequirePackage{pagecolor}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/varwidth}{varwidth}
+% in order to change the width of the page, inside |pptWide|:
+% \begin{macrocode}
+\RequirePackage{varwidth}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/qrcode}{qrcode}
+% in order to render QR codes:
+% \begin{macrocode}
+\RequirePackage{qrcode}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/tikz}{tikz}
+% in order to position elements on the page, especially in the Table of Contents:
+% \begin{macrocode}
+\RequirePackage{tikz}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/tikzpagenodes}{tikzpagenodes}
+% in order to pin a block in |\pptPin|:
+% \begin{macrocode}
+\RequirePackage{tikzpagenodes}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/enumitem}{enumitem}
+% in order to render inline lists in crumbs:
+% \begin{macrocode}
+\RequirePackage[inline]{enumitem}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/crumbs}{crumbs}
+% in order to show top-page menus:
+% \begin{macrocode}
+\RequirePackage{crumbs}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/calc}{calc}
+% in order to calculate positions of elements more precisely:
+% \changes{0.3.1}{2024/01/13}{The \texttt{calc} package added.}
+% \begin{macrocode}
+\RequirePackage{calc}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/tabularx}{tabularx}
+% in order to render |\pptQuote|:
+% \begin{macrocode}
+\RequirePackage{tabularx}
+% \end{macrocode}
+
+% Then, we include \href{https://ctan.org/pkg/seqsplit}{seqsplit}
+% in order to split long links:
+% \begin{macrocode}
+\RequirePackage{seqsplit}
% \end{macrocode}
% \begin{macro}{\pptMiddle}
@@ -536,7 +595,6 @@
% Then, we define the |\pptQuote| command, with one optional and three mandatory arguments:
% \changes{0.3.0}{2023/11/08}{The \texttt{\char`\\pptQuote} command has got an optional parameter, where the name of the person on the photo can be specified.}
% \begin{macrocode}
-\RequirePackage{tabularx}
\newcommand\pptQuote[4][]{%
\begin{tabularx}{\columnwidth}{c>{\raggedright\arraybackslash}X}%
\raisebox{\dimexpr-\height+\ht\strutbox}{
@@ -654,7 +712,6 @@
% \begin{macro}{\pptPinQR}
% Then, we define the |\pptPinQR| command:
% \begin{macrocode}
-\RequirePackage{seqsplit}
\newcommand\pptPinQR[2][right]{%
\pptPin[#1]{%
\begin{minipage}{1.4in}%
@@ -682,14 +739,12 @@
% \end{macrocode}
% \end{macro}
+% \begin{macrocode}
\endinput
+% \end{macrocode}
% \Finale
-% \clearpage
-% \printbibliography
-% \clearpage
-
% \PrintChanges
% \clearpage
% \PrintIndex
diff --git a/macros/latex/contrib/ppt-slides/ppt-slides.ins b/macros/latex/contrib/ppt-slides/ppt-slides.ins
index a5f87589b0..eb3965fa10 100644
--- a/macros/latex/contrib/ppt-slides/ppt-slides.ins
+++ b/macros/latex/contrib/ppt-slides/ppt-slides.ins
@@ -1,6 +1,6 @@
%% (The MIT License)
%%
-%% Copyright (c) 2021-2023 Yegor Bugayenko
+%% Copyright (c) 2021-2024 Yegor Bugayenko
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +26,7 @@
\preamble
(The MIT License)
-Copyright (c) 2021-2023 Yegor Bugayenko
+Copyright (c) 2021-2024 Yegor Bugayenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
diff --git a/macros/latex/contrib/ppt-slides/ppt-slides.pdf b/macros/latex/contrib/ppt-slides/ppt-slides.pdf
index 9e22a9e1aa..774992d89f 100644
--- a/macros/latex/contrib/ppt-slides/ppt-slides.pdf
+++ b/macros/latex/contrib/ppt-slides/ppt-slides.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/README.md b/macros/latex/contrib/regulatory/README.md
new file mode 100644
index 0000000000..ec9a283dc9
--- /dev/null
+++ b/macros/latex/contrib/regulatory/README.md
@@ -0,0 +1,27 @@
+# Regulatory
+
+A LaTeX package which provides macro's for crafting regulatory documents.
+
+## Installation
+In order to install this package the `texmf` tree has to be copied to a directory LaTeX will search in.
+Consult `tlmgr conf texmf TEXMFHOME` to get any ideas of where that should be.
+
+If it's favored to keep this tree separate from other LaTeX trees one can add a configuration to `/etc/texmf/texmf.d` which adds a TEXMF AUX TREE (Debian and derivatives only).
+This can be useful when you need to change the source and/or push changes with Git.
+
+```bash
+TEXMFAUXTREES=$HOME/src/regulatory/texmf,
+```
+*/etc/texmf/texmf.d/01xerdi.cnf*
+
+Afterward execute `update-texmf` with root permissions.
+It can be validated by the output of: `kpsewhich -var-value TEXMFAUXTREES`.
+## Documentation
+The documentation is available in Dutch and English and will be included in every release.
+See the [releases page](https://github.com/Xerdi/regulatory/releases) for the PDF files.
+
+For more information on building all documentation, see [Makefile](Makefile) and [doc/Makefile](doc/Makefile) in this project.
+
+## License
+This project is licensed under the LPPL version 1.3c and maintained by Erik Nijenhuis.
+See [LICENSE.txt](LICENSE.txt) for more information.
diff --git a/macros/latex/contrib/regulatory/doc/example.md b/macros/latex/contrib/regulatory/doc/example.md
new file mode 100644
index 0000000000..9ad1a4dcae
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example.md
@@ -0,0 +1,23 @@
+# Definitiones
+\label{art:defs}
+\glssetwidest{Nam dui}
+
+Lorem
+: \describe{def1}
+Nam dui
+: \describe{def2}
+Nulla
+: \describe{def3}
+
+# Quisque ullamcorper
+
+1. \label{lid:lorem}\textfill
+2. \label{lid:lorem2}\textfill
+ 1. \label{sub:lorem}\textfill~\Aref{lid:lorem}.
+ 2. \label{sub:lorem2}\textfill~\Aref{ex2-lid:lorem}.
+ 3. \label{sub:lorem3}\textfill~\Aref{lid:lorem,lid:lorem2}.
+ 4. \label{sub:lorem4}\textfill~\Aref{ex2-lid:lorem,ex2-lid:lorem2,ex2-lid:lorem3}.
+ 5. \label{sub:lorem5}\textfill~\Aref{ex2-lid:lorem,ex2-lid:lorem2,ex2-lid:lorem3,ex2-lid:lorem5}.
+ 6. \label{sub:lorem6}\textfill~\Gls{def1} ipsum dolor sit amed.
+ 7. \label{sub:lorem7}\textfill~\Aref{ex2-sub:lorem,ex2-sub:lorem2,ex2-sub:lorem4}.
+ 8. \label{sub:lorem8}\textfill \ No newline at end of file
diff --git a/macros/latex/contrib/regulatory/doc/example1-en.pdf b/macros/latex/contrib/regulatory/doc/example1-en.pdf
new file mode 100644
index 0000000000..0e08431dbf
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/example1-en.tex b/macros/latex/contrib/regulatory/doc/example1-en.tex
new file mode 100644
index 0000000000..eeb17acc99
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1-en.tex
@@ -0,0 +1,42 @@
+%% example1-en.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[12pt,english]{article}
+\usepackage{babel}
+\usepackage[alldefs]{regulatory}
+\usepackage{lipsum}
+
+\newcounter{lip}
+\setcounter{lip}{1}
+\newcommand\textfill{\lipsum[\arabic{lip}]\stepcounter{lip}}
+
+\newcommand\translation[2]{#1}
+
+\refdocument[ex2-]{example2-en}{%
+ ref label=of Example Two
+}
+
+\loadglsdefs{example1}
+
+\begin{document}
+ \input{example1}
+\end{document}
diff --git a/macros/latex/contrib/regulatory/doc/example1-nl.pdf b/macros/latex/contrib/regulatory/doc/example1-nl.pdf
new file mode 100644
index 0000000000..63522191b7
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1-nl.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/example1-nl.tex b/macros/latex/contrib/regulatory/doc/example1-nl.tex
new file mode 100644
index 0000000000..df01669786
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1-nl.tex
@@ -0,0 +1,42 @@
+%% example1-nl.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[12pt,dutch]{article}
+\usepackage{babel}
+\usepackage[alldefs]{regulatory}
+\usepackage{lipsum}
+
+\newcounter{lip}
+\setcounter{lip}{1}
+\newcommand\textfill{\lipsum[\arabic{lip}]\stepcounter{lip}}
+
+\newcommand\translation[2]{#2}
+
+\refdocument[ex2-]{example2-nl}{%
+ ref label=van Voorbeeld Twee
+}
+
+\loadglsdefs{example1}
+
+\begin{document}
+ \input{example1}
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/regulatory/doc/example1.bib b/macros/latex/contrib/regulatory/doc/example1.bib
new file mode 100644
index 0000000000..c1b0311764
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1.bib
@@ -0,0 +1,15 @@
+
+@entry{def1,
+ name = {Lorem},
+ description = {\textfill}
+}
+
+@entry{def2,
+ name = {Nam dui},
+ description = {\textfill}
+}
+
+@entry{def3,
+ name = {Nulla},
+ description = {\textfill}
+}
diff --git a/macros/latex/contrib/regulatory/doc/example1.tex b/macros/latex/contrib/regulatory/doc/example1.tex
new file mode 100644
index 0000000000..b9e0f1331f
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example1.tex
@@ -0,0 +1,25 @@
+\begin{center}
+ \Huge \translation{Example One}{Voorbeeld Één}
+\end{center}
+\article{Definitiones}\label{art:defs}
+\printdefs{Nam dui}
+\article{Quisque ullamcorper}\label{art:lorem}
+\begin{paras}
+ \item \label{lid:lorem} \textfill
+ \item \label{lid:lorem2} \textfill
+ \begin{paras}
+ \item \label{sub:lorem} \textfill~\Aref{lid:lorem}.
+ \item \label{sub:lorem2} \textfill~\Aref{ex2-lid:lorem}.
+ \item \label{sub:lorem3} \textfill~\Aref{lid:lorem,lid:lorem2}.
+ \item \label{sub:lorem4} \textfill~\Aref{ex2-lid:lorem,ex2-lid:lorem2,ex2-lid:lorem3}.
+ \item \label{sub:lorem5} \textfill~\Aref{ex2-lid:lorem,ex2-lid:lorem2,ex2-lid:lorem3,ex2-lid:lorem5}.
+ \item \label{sub:lorem6} \textfill~\Gls{def1} ipsum dolor sit amed.
+ \item \label{sub:lorem7} \textfill~\Aref{ex2-sub:lorem,ex2-sub:lorem2,ex2-sub:lorem4}.
+ \item \label{sub:lorem8} \textfill
+ \end{paras}
+\end{paras}
+\article{Etiam ac leo}\label{art:lorem2}
+\para{A risus tristique nonummy}
+\textfill
+\article{Nulla in ipsum}\label{art:lorem3}
+\textfill
diff --git a/macros/latex/contrib/regulatory/doc/example2-en.pdf b/macros/latex/contrib/regulatory/doc/example2-en.pdf
new file mode 100644
index 0000000000..bc253e499b
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/example2-en.tex b/macros/latex/contrib/regulatory/doc/example2-en.tex
new file mode 100644
index 0000000000..f47f7d0d9e
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2-en.tex
@@ -0,0 +1,49 @@
+%% example2-en.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[12pt,english]{article}
+\usepackage{babel}
+\usepackage{regulatory}
+\usepackage{lipsum}
+
+\newcounter{lip}
+\setcounter{lip}{1}
+\newcommand\textfill{\lipsum[\arabic{lip}]\stepcounter{lip}}
+
+\newcommand\translation[2]{#1}
+
+\newcommand\definitionlabel[1]{~(see #1)}
+
+\masterdocument[ex1-]{example1-en}{%
+ defs=example1,%
+ author=E. Nijenhuis,%
+ subject= Example One,%
+ description = The first example document,
+ footnote label = Attachment:~,
+ ref label=of Example One,
+ def label=\definitionlabel
+}
+\loadglsdefs{example2}
+
+\begin{document}
+ \input{example2}
+\end{document}
diff --git a/macros/latex/contrib/regulatory/doc/example2-nl.pdf b/macros/latex/contrib/regulatory/doc/example2-nl.pdf
new file mode 100644
index 0000000000..be0484a77c
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2-nl.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/example2-nl.tex b/macros/latex/contrib/regulatory/doc/example2-nl.tex
new file mode 100644
index 0000000000..071cce4a00
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2-nl.tex
@@ -0,0 +1,49 @@
+%% example2-nl.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[12pt,dutch]{article}
+\usepackage{babel}
+\usepackage{regulatory}
+\usepackage{lipsum}
+
+\newcounter{lip}
+\setcounter{lip}{1}
+\newcommand\textfill{\lipsum[\arabic{lip}]\stepcounter{lip}}
+
+\newcommand\translation[2]{#2}
+
+\newcommand\definitionlabel[1]{~(zie #1)}
+
+\masterdocument[ex1-]{example1-nl}{%
+ defs=example1,%
+ author=E. Nijenhuis,%
+ subject= Voorbeeld Één,%
+ description = Het éérste voorbeeld document,
+ footnote label = Bijlage:~,
+ ref label=van Voorbeeld Één,
+ def label=\definitionlabel
+}
+\loadglsdefs{example2}
+
+\begin{document}
+ \input{example2}
+\end{document}
diff --git a/macros/latex/contrib/regulatory/doc/example2.bib b/macros/latex/contrib/regulatory/doc/example2.bib
new file mode 100644
index 0000000000..555f4f976e
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2.bib
@@ -0,0 +1,5 @@
+
+@entry{def4,
+ name = {Suspendisse},
+ description = {\textfill}
+}
diff --git a/macros/latex/contrib/regulatory/doc/example2.tex b/macros/latex/contrib/regulatory/doc/example2.tex
new file mode 100644
index 0000000000..4721fad59b
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/example2.tex
@@ -0,0 +1,21 @@
+\begin{center}
+ \Huge \translation{Example Two}{Voorbeeld Twee}
+\end{center}
+\article{Pactum}\label{art:agreement}
+\begin{paras}
+ \item \label{lid:lorem} \textfill~\Gls{def1}.
+ \item \label{lid:lorem2} \textfill~\Gls{def2}.
+ \item \label{lid:lorem3} \textfill
+ \item \label{lid:lorem4} \textfill
+ \item \label{lid:lorem5} \textfill~\Gls{def4} ipsum dolor sit amed.\\
+ \printdefs{Suspendisse}
+ \begin{paras}
+ \item \label{sub:lorem} \textfill
+ \item \label{sub:lorem2} \textfill
+ \item \label{sub:lorem3} \textfill
+ \item \label{sub:lorem4} \textfill
+ \end{paras}
+\end{paras}
+\article{Suspendisse}
+\para{Aliquam}
+\textfill \ No newline at end of file
diff --git a/macros/latex/contrib/regulatory/doc/md-example.tex b/macros/latex/contrib/regulatory/doc/md-example.tex
new file mode 100644
index 0000000000..475dc773b4
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/md-example.tex
@@ -0,0 +1,24 @@
+\documentclass[12pt,dutch]{article}
+\usepackage{babel}
+\usepackage[md,alldefs]{regulatory}
+\usepackage{lipsum}
+
+\newcounter{lip}
+\setcounter{lip}{1}
+\newcommand\textfill{\lipsum[\arabic{lip}]\stepcounter{lip}}
+
+\refdocument[ex2-]{example2-nl}{
+ defs=example2
+ ref label=van Voorbeeld Twee
+}
+
+\loadglsdefs{example1}
+
+\begin{document}
+ \begin{center}
+ \Huge Voorbeeld Markdown
+ \end{center}
+
+ \markdownInput{example.md}
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/regulatory/doc/regulatory-en.pdf b/macros/latex/contrib/regulatory/doc/regulatory-en.pdf
new file mode 100644
index 0000000000..11f032e016
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/regulatory-en.tex b/macros/latex/contrib/regulatory/doc/regulatory-en.tex
new file mode 100644
index 0000000000..0ec1ac52b9
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory-en.tex
@@ -0,0 +1,52 @@
+%% regulatory-en.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[10pt,english]{ltxdoc}
+
+%! suppress = InclusionLoop
+\usepackage[md]{regulatory}
+\usepackage{tabularx}
+\usepackage[english,dutch]{babel}
+
+\input{regulatory-preamble}
+\newcommand\translation[2]{#1}
+\masterdocument[ex1-]{example1-en}{%
+ defs=example1,%
+ author=E. Nijenhuis,%
+ subject= Example One,%
+ description = The first example document,
+ ref label=of Example One
+}
+
+\masterdocument[ex2-]{example2-en}{%
+ defs=example2,%
+ author=E. Nijenhuis,%
+ subject= Example Two,%
+ description = The second example document,
+ ref label=of Example Two
+}
+
+% Document
+\begin{document}
+ \selectlanguage{english}
+ \input{regulatory}
+\end{document}
diff --git a/macros/latex/contrib/regulatory/doc/regulatory-nl.pdf b/macros/latex/contrib/regulatory/doc/regulatory-nl.pdf
new file mode 100644
index 0000000000..334e4f3c55
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory-nl.pdf
Binary files differ
diff --git a/macros/latex/contrib/regulatory/doc/regulatory-nl.tex b/macros/latex/contrib/regulatory/doc/regulatory-nl.tex
new file mode 100644
index 0000000000..af6a3e7941
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory-nl.tex
@@ -0,0 +1,63 @@
+%% regulatory-nl.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\documentclass[10pt,dutch]{ltxdoc}
+
+%! suppress = InclusionLoop
+\usepackage[md]{regulatory}
+\usepackage{tabularx}
+\usepackage[dutch,english]{babel}
+
+\input{regulatory-preamble}
+
+\zcRefTypeSetup{listing}{%
+ Name-sg = Codelijst,
+ name-sg = codelijst,
+ Name-pl = Codelijsten,
+ name-pl = codelijsten
+}
+
+\renewcommand{\lstlistingname}{Codelijst}
+
+\newcommand\translation[2]{#2}
+
+\masterdocument[ex1-]{example1-nl}{%
+ defs=example1,%
+ author=E. Nijenhuis,%
+ subject= Voorbeeld Één,%
+ description = Het éérste voorbeeld document,
+ ref label=van Voorbeeld Één
+}
+
+\masterdocument[ex2-]{example2-nl}{%
+ defs=example2,%
+ author=E. Nijenhuis,%
+ subject= Voorbeeld Twee,%
+ description = Het tweede voorbeeld document,
+ ref label=van Voorbeeld Twee
+}
+
+% Document
+\begin{document}
+ \selectlanguage{dutch}
+ \input{regulatory}
+\end{document}
diff --git a/macros/latex/contrib/regulatory/doc/regulatory-preamble.tex b/macros/latex/contrib/regulatory/doc/regulatory-preamble.tex
new file mode 100644
index 0000000000..50c6db1bee
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory-preamble.tex
@@ -0,0 +1,110 @@
+%% regulatory-preamble.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\usepackage{gitinfo-lua}
+\usepackage{listings}
+
+\usepackage{fontspec}
+\usepackage{textcomp}
+
+\def\projecturl{https://github.com/Xerdi/regulatory}
+
+\definecolor{greycolor}{HTML}{BFBFBF}
+\definecolor{primary}{HTML}{174A67}
+\definecolor{darkcolor}{HTML}{091D28}
+\definecolor{greencolor}{HTML}{176734}
+\colorlet{artlabel}{primary}
+\colorlet{green}{greencolor}
+
+\lstdefinestyle{tex}{%
+ language=[LaTeX]TeX,
+ keywordsprefix={\\},
+ alsoletter={\\},
+ morekeywords={article,para,textfill,masterdocument,refdocument,loadglsdefs,printdefs,setmiddleconjunction,setlastconjunction,setrangeconjunction,setconjunction,markdownInput,glssetwidest,describe}
+}
+
+\lstdefinestyle{bash}{%
+ language=bash,
+ morekeywords={pdflatex,lualatex,latexmk,makeglossaries,bib2gls}
+}
+
+\lstdefinelanguage{Markdown}[LaTeX]{TeX}{%
+ sensitive=false,
+ morecomment=[l][\bfseries\ttfamily\color{green}]{\#},
+ morecomment=[s][\bfseries\ttfamily\color{purple}]{:\ \ }{\ },
+ morestring=[s][\color{black}]{\{}{\}},
+ morekeywords={article,para,textfill,masterdocument,refdocument,loadglsdefs,printdefs,setmiddleconjunction,setlastconjunction,setrangeconjunction,setconjunction,markdownInput,glssetwidest,describe},
+ keywordsprefix={\\},
+ alsoletter={\\},
+}
+
+\lstdefinestyle{md}{%
+ language=Markdown
+}
+
+\lstdefinelanguage{BibTeX}{%
+ keywords={%
+ article,book,collectedbook,conference,electronic,entry,ieeetranbstctl,%
+ inbook,incollectedbook,incollection,injournal,inproceedings,%
+ manual,mastersthesis,misc,patent,periodical,phdthesis,preamble,%
+ proceedings,standard,string,techreport,unpublished%
+ },
+ keywordsprefix={@},
+ comment=[l][\itshape]{@comment},
+ sensitive=false,
+}
+
+\lstdefinestyle{bib}{%
+ language=BibTeX,
+ morestring=[s][\bfseries\ttfamily\color{purple}]{\ \ \ \ }{\ },
+ morecomment=[n][\bfseries\ttfamily\color{green}]{\ \{}{\}},
+}
+
+\lstset{
+ title=\lstname,
+ basicstyle=\ttfamily,
+ numberstyle=\ttfamily,
+ numbersep=5pt,
+ rulecolor=\color{greycolor},
+ stringstyle=\color{pink},
+ keywordstyle=\color{primary},
+ commentstyle=\itshape\color{darkcolor},
+ breaklines=true,
+ captionpos=b,
+ tabsize=4,
+ showtabs=true
+}
+
+\newcommand\package{\texttt}
+\newcommand\file{\texttt}
+\newcommand\option{\texttt}
+
+\def\packagedate{\gitdate}
+\def\packageversion{\gitversion}
+
+%\def\cmd{\lstinline[style=tex]}
+\def\cmditem#1{\item[\ttfamily\textbackslash{}#1]}
+
+\newcommand\Vtextvisiblespace[1][.3em]{%
+ \mbox{\kern.06em\vrule height.3ex}%
+ \vbox{\hrule width#1}%
+ \hbox{\vrule height.3ex}}
diff --git a/macros/latex/contrib/regulatory/doc/regulatory.tex b/macros/latex/contrib/regulatory/doc/regulatory.tex
new file mode 100644
index 0000000000..ffb0ce5ecb
--- /dev/null
+++ b/macros/latex/contrib/regulatory/doc/regulatory.tex
@@ -0,0 +1,779 @@
+%% regulatory.tex
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\translation{%
+ \title{Package \package{regulatory}\thanks{This document corresponds to \textsf{regulatory}~\packageversion, written on \packagedate.}}
+}{%
+ \title{Het \package{regulatory} pakket\thanks{Dit document correspondeert aan \textsf{regulatory}~\packageversion, geschreven op \packagedate.}}%
+}
+\author{Erik Nijenhuis\\
+\href{mailto:erik@xerdi.com}{erik@xerdi.com}}
+\date{\packagedate}
+\maketitle
+\begin{abstract}
+ % Structuur %
+ \translation{%
+ The \package{regulatory} package is well-suited for legal professionals in a broad sense. This package encompasses common structures, such as articles, sections, parts, and definitions.%
+ }{%
+ Het \package{regulatory} pakket leent zich uitstekend voor juristen in brede zin.
+ Dit pakket brengt veel voorkomende structuren, zoals artikelen, leden, onderdelen en definities.%
+ }
+
+ % Verwijzen %
+ \translation{%
+ Referring within the legal domain can be a significant challenge; therefore, this package provides an elegant way of referencing, as one would expect with standard \LaTeX{} macros, such as for a chapter using \cmd{\section}, namely through labeling. For this purpose, the \package{regulatory} package introduces its own \cmd{\rref}, \cmd{\nref}, and \cmd{\aref} macro families that provide default support for both Dutch and English.%
+ }{%
+ Verwijzen binnen het juridisch domein kan een grote uitdaging zijn, daarom biedt dit pakket een elegante manier van verwijzen, zoals men mag verwachten bij standaard \LaTeX{} macro's, zoals voor een hoofdstuk \cmd{\section}, namelijk door middel van labelen.
+ Hiervoor introduceert pakket \package{regulatory} zijn eigen \cmd{\rref}, \cmd{\nref} en \cmd{\aref} macrofamilies die standaard ondersteuning bieden voor Nederlands en Engels.%
+ }
+
+ % Definities %
+ \translation{%
+ Managing definitions uniformly across all documents can be achieved using \package{BibTeX}.
+ When it comes to referencing definitions, the \package{regulatory} package aligns with the existing \cmd{\gls} macro family of the \package{glossaries} package.%
+ }{%
+ Het beheren van definities kan eenduidig voor alle documenten met behulp van \package{BibTeX}.
+ Voor het verwijzen naar definities speelt het \package{regulatory} pakket in op de al bestaande \cmd{\gls} macrofamilie van \package{glossaries}.%
+ }
+ % Externe Documenten %
+ \translation{%
+ Referencing articles, sections, parts, and definitions is not limited to within a single document but can also be done from other documents written using the \package{regulatory} package.
+ This makes cross-referencing between documents straightforward. Consider, for example, Terms and Conditions and a Maintenance Agreement that refer to each other's articles or use each other's terms.
+ It is even possible to attach the Terms and Conditions as an appendix to the PDF file for completeness.%
+ }{%
+ Het verwijzen naar artikelen, leden, onderdelen en definities beperkt zich niet alleen tot één document, maar zijn ook aan te halen vanuit andere documenten geschreven met het \package{regulatory} pakket.
+ Op deze manier blijft het eenvoudig verwijzen voor documenten onderling.
+ Denk b\ij{}voorbeeld aan Algemene Voorwaarden en een Onderhoudsovereenkomst die naar elkaars artikelen verwijzen of elkaars begrippen gebruiken.
+ Het is zelfs mogelijk om bij documenten de Algemene Voorwaarden als bijlage in het PDF-bestand te voegen voor de volledigheid.%
+ }
+\end{abstract}
+
+\clearpage
+\tableofcontents
+\clearpage
+
+
+\section{\translation{Usage}{Gebruik}}
+\translation{%
+ The \package{regulatory} package is explicitly designed for generating PDF documents with \LaTeX{}.
+ Therefore, use either \texttt{pdflatex} or \texttt{lualatex}.%
+}{%
+ Het pakket \package{regulatory} is uitdrukkelijk bedoeld voor het genereren van PDF-documenten met \LaTeX{}.
+ Gebruik daarom \texttt{pdflatex} of \texttt{lualatex}.%
+}
+\begin{lstlisting}[style=tex,caption={main.tex},label=code:simple]
+\documentclass[dutch]{article}
+\usepackage{regulatory}
+\begin{document}
+ \article{...}
+\end{document}
+\end{lstlisting}
+\translation{%
+ The example does not use any options. This means that \option{bib2gls} is active.
+ To switch back to TeX code for definition lists, the option \oarg{nobibdefs} is available.
+ Additionally, there are options such as \oarg{md,alldefs,hidelinks,nameinlink}.
+ Where \option{md} activates Markdown support, \option{alldefs} lists all definitions instead of only the used definitions within the same document (useful for Terms and Conditions where not all definitions necessarily appear), \option{hidelinks} hides all colored borders of hyperlinks, and \option{nameinlink} places the hyperlink around the label.%
+}{%
+ Het voorbeeld gebruikt geen opties.
+ Dit houdt in dat \option{bib2gls} actief is.
+ Om terug te schakelen naar TeX code voor definitielijsten is er de optie \oarg{nobibdefs}.
+ Verder zijn er nog de opties \oarg{md,alldefs,hidelinks,nameinlink}.
+ Waar \option{md} Markdown support activeert, \option{alldefs} alle definities opsomt in plaats van alleen de gebruikte definities binnen hetzelfde document (handig voor Algemene Voorwaarden waarin niet alle definities per se voorkomen), \option{hidelinks} alle gekleurde kaders van hyperlinks verbergt en \option{nameinlink} de hyperlink om het label heen plaatst.%
+}\\
+
+\noindent
+\translation{%
+ The example of \zcref{code:simple} can be generated to PDF as follows:%
+}{%
+ Het voorbeeld van \zcref{code:simple} kan als volgt gegenereerd worden naar PDF:%
+}
+\begin{lstlisting}[style=bash,caption={\translation{Commandline examples}{Commandline voorbeelden}}]
+pdflatex main
+# Or
+lualatex main
+# Or keep generating
+latexmk -pvc -lualatex -interaction=nonstopmode main
+\end{lstlisting}
+
+\noindent
+\translation{%
+ Suppose definition lists are used; in that case, additional steps are added to the generation process, e.g:%
+}{%
+ Stel er worden definitie lijsten gebruikt, dan komen er nog extra stappen bij in het generatieproces, namelijk:%
+}
+\begin{lstlisting}[style=Bash,caption={\translation{Commandline with definitions}{Commandline met definities}}]
+lualatex main
+bib2gls main
+lualatex main
+lualatex main
+# Or for bibtex
+lualatex main
+makeglossaries main
+lualatex main
+lualatex main
+\end{lstlisting}
+\translation{%
+ In case \texttt{latexmk} is used, the command \texttt{bib2gls} or \texttt{makeglossaries} can be executed in a separate terminal. LatexMK automatically detects file changes and regenerates the document accordingly.%
+}{%
+ In het geval gebruik gemaakt wordt van \texttt{latexmk}, dan kan er in een aparte terminal het commando \texttt{bib2gls} of \texttt{makeglossaries} gebruikt worden.
+ LatexMK ziet vanzelf de bestanden wijzigen en genereert dan het document opnieuw.%
+}
+
+\clearpage
+
+
+\section{\translation{Structure}{Structuur}}\label{sec:struct}
+\translation{%
+ This package provides familiar structures without breaking the existing functionalities of \LaTeX{}.%
+}{%
+ Dit pakket levert bekende structuren, zonder de bestaande functionaliteiten van \LaTeX{} te breken.%
+}
+\DescribeMacro{\article}
+\DescribeMacro{\para}
+\translation{%
+ For example, consider \cmd{\article}\marg{title} and \cmd{\para}\marg{title}.
+ These are defined as separate macros and formatted using \package{titlesec}.%
+}{%
+ Neem b\ij{}voorbeeld \cmd{\article}\marg{title} en \cmd{\para}\marg{title}.
+ Deze zijn als aparte macro's gedefinieerd en opgemaakt met behulp van \package{titlesec}.%
+}\\
+
+\noindent
+\DescribeEnv{paras}
+\translation{%
+ For the \option{paras}\footnote{%
+ Originally the naming was taken from Dutch ``artikel, lid en onderdeel'', which was hard to introduce in English, due to ambiguity reasons.%
+ Therefore, section and part are aliased to paras.%
+ } and ``subparagraphs'', a new environment has been created using \package{enumitem}.
+ The labels for the members have been adjusted to
+}{%
+ Voor de \option{paras} en ``onderdelen'' is een nieuwe environment aangemaakt met behulp van \package{enumitem}.
+ De labels van de leden zijn aangepast naar
+}\lstinline[style=tex]|\thearticle.\arabic*|\translation{
+ for paragraphs and
+}{, voor leden en,
+}\lstinline[style=tex]|\abalphnum{\arabic*)|\translation{
+ for subparagraphs.%
+}{, voor onderdelen.}
+\translation{%
+ For ``subparagraphs'', \cmd{\abalpnum} from the \package{fmtcount} package is used to enumerate multiple subparagraphs.
+ Suppose \cmd{\alph} were used; in that case, \option{paras} (second level) would be limited to 26 subparagraphs.
+ With \cmd{\abalphnum}, for example, with a value of 125, the result is `\texttt{du}'.
+}{%
+ Voor onderdelen wordt er gebruik gemaakt van \cmd{\abalpnum} uit pakket \package{fmtcount}\footnote{Het pakket \package{fmtcount} heeft geen ondersteuning voor Nederlands. Dit pakket levert daarvoor de juist configuratie mee.} om meerdere onderdelen te kunnen opsommen.
+ Stel er zou gebruik gemaakt worden van \cmd{\alph}, dan is \option{paras} beperkt tot 26 onderdelen.
+ Bij \cmd{\abalphnum} met b\ij{}voorbeeld een waarde van 125 is `\texttt{du}' de uitkomst.
+}
+
+\begin{lstlisting}[style=tex]
+\article{Voorbeeld}
+\begin{paras}
+ \item \textfill
+ \begin{paras}
+ \item \textfill
+ \end{paras}
+ \item \textfill
+\end{paras}
+
+\article{Voorbeeld2}
+\textfill
+
+\para{Voorbeeld3}
+\textfill
+\end{lstlisting}
+\translation
+{See \zcref{code:example1,code:example2} for more \LaTeX{} examples.}
+{Zie \zcref{code:example1,code:example2} voor meer \LaTeX{} voorbeelden.}
+
+\subsection{Markdown}
+\translation{%
+ With the package option \option{md}, this package ensures that all these structures are handled.
+ However, this means that no chapters or other standard components can be typed.
+ Instead, the writer is specifically limited to the components described in this chapter.
+ Refer to \zcref{code:example-md} for a Markdown example, and check \zcref{code:md-example} to see how such a Markdown source can ultimately be used from within \LaTeX{}.
+}{%
+ Met de pakketoptie \option{md} zorgt dit pakket ervoor dat al deze structuren gehanteerd worden.
+ Dit betekend echter wel dat er geen hoofdstukken of andere standaard onderdelen meer getypt kunnen worden.
+ In plaats daarvan is de schrijver juist beperkt tot de onderdelen omschreven in dit hoofdstuk.
+ Kijk naar \zcref{code:example-md} voor een markdown voorbeeld en naar \zcref{code:md-example} hoe zo'n Markdown bron uiteindelijk kan gebruikt worden vanuit \LaTeX{}.
+}
+\clearpage
+
+
+\section{\translation{Definitions}{Definities}}
+\translation{%
+ For referencing definitions, \package{glossaries-extra} is used.
+ This allows referencing with the \cmd{\gls}\marg{label} macro family.%
+}{%
+ Voor het verwijzen naar definities wordt gebruik gemaakt van \package{glossaries-extra}.
+ Dit zorgt ervoor dat er met de \cmd{\gls}\marg{label} macrofamilie kan worden verwezen.%
+}\\
+
+\noindent
+\DescribeEnv{definitions}
+\DescribeEnv{externals}
+\translation{%
+ To prevent conflicts between terms, abbreviations, and definitions, this package adds two \texttt{glossary} types.
+ Definitions within the same file are placed under the type \option{definitions}, while definitions from other documents are placed under \option{externals} (see \zcref{sec:extern}).%
+}{%
+ Om conflicten tussen begrippen, afkortingen en definities te voorkomen voegt dit pakket twee \texttt{glossary} types toe.
+ Voor definities binnen hetzelfde bestand worden ze ingedeeld onder het type \option{definitions}, terwijl definities van andere documenten worden ingedeeld onder \option{externals} (zie \zcref{sec:extern}).%
+}\\
+
+\noindent
+\DescribeMacro{\printdefs}
+\translation{%
+ To list definitions, various macros have been added.
+ The most straightforward one, \cmd{\printdefs}\marg{width of text}, enumerates the definitions with a customized style.
+ The argument \marg{width of text} is provided for the alignment of definition labels and descriptions.%
+}{%
+ Om definities in te laden zijn er twee macro's gedefinieerd.
+ De \cmd{\loadglsdefs}\marg{src} macro voegt BibTeX bibliotheken toe onder het type \option{definitions} en heeft als categorie \option{definitions}.
+ Gebruikte definities in deze bibliotheken zullen opgesomd worden wanneer \cmd{\printdefs} wordt aangeroepen.
+ Indien de optie \option{alldefs} bij het pakket is meegegeven, dan zullen alle definities in die bibliotheken opgesomd worden.
+ De opsomming wordt gesorteerd aan de hand van het Nederlandse woordenboek.
+ Woorden die niet voorkomen daarin zullen als eerste opgesomd worden.%
+}\\
+
+\noindent
+\DescribeMacro{\describe}
+\translation{%
+ To achieve the same result with \cmd{\describe}\marg{label}, it is first necessary to invoke \cmd{\glssetwidest}, for example, in Markdown (see \zcref{code:example-md}).
+ The \cmd{\describe} macro is well-suited for manually placing definition descriptions.
+ This macro adds an anchor point, required for functional hyperlinks.%
+}{%
+ Om hetzelfde resultaat te behalen met \cmd{\describe}\marg{label} is het eerst nodig om \cmd{\glssetwidest} aan te roepen in b\ij{}voorbeeld Markdown (zie \zcref{code:example-md}).
+ De macro \cmd{\describe} leent zich uitstekend om handmatig definitie beschrijvingen te plaatsen.
+ Deze macro voegt namelijk een ankerpunt toe, vereist voor werkende hyperlinks.%
+}\\
+
+\noindent
+\DescribeMacro{\loadglsdefs}
+\translation{%
+ To load definitions, two macros are defined. The \cmd{\loadglsdefs}\marg{src} macro adds BibTeX libraries under the type \option{definitions} and has the category \option{definitions}.
+ Definitions used in these libraries will be listed when \cmd{\printdefs} is called.
+ If the package is given the \option{alldefs} option, then all definitions in those libraries will be listed.
+ The listing is sorted according to the Dutch dictionary.
+ Words not found in it are listed first.%
+}{%
+ Om definities in te laden zijn er twee macro's gedefinieerd.
+ De \cmd{\loadglsdefs}\marg{src} macro voegt BibTeX bibliotheken toe onder het type \option{definitions} en heeft als categorie \option{definitions}.
+ Gebruikte definities in deze bibliotheken zullen opgesomd worden wanneer \cmd{\printdefs} wordt aangeroepen.
+ Als bij het pakket de optie \option{alldefs} is meegegeven, dan zullen alle definities in die bibliotheken opgesomd worden.
+ De opsomming wordt gesorteerd aan de hand van het Nederlandse woordenboek.
+ Woorden die niet voorkomen daarin worden als eerste opgesomd.%
+}\\
+
+\noindent
+\DescribeMacro{\loadextdefs}
+\translation{%
+ For \cmd{\loadextdefs}\oarg{category}\marg{src}, it can be useful to provide a category so that definitions from different sources can be distinguished.
+ However, it is unwise to call this macro directly since \cmd{\masterdocument} is already smartly handling it.
+}{%
+ Voor \cmd{\loadextdefs}\oarg{category}\marg{src} kan het handig zijn om een categorie mee te geven, zodat definities van verschillende bronnen uit elkaar gehouden kunnen worden.
+ Het is echter niet aan te raden deze direct aan te roepen, aangezien \cmd{\masterdocument} hier al slim op in speelt.
+}
+\clearpage
+
+
+\section{\translation{References}{Verwijzingen}}
+\translation{%
+ For referencing articles, members, and parts, \package{zref} is used behind the scenes.
+ All components mentioned in \zcref{sec:struct} are configured for this purpose.
+ However, \package{zref} does not provide as many formatting adjustments as \package{cleveref}.
+}{%
+ Voor het verwijzen naar artikelen, leden en onderdelen wordt onder water gebruik gemaakt van \package{zref}.
+ Alle onderdelen genoemd in \zcref{sec:struct} zijn hiervoor ingesteld, echter biedt \package{zref} niet zoveel formaat aanpassingen als \package{cleveref}.
+}
+
+\DescribeMacro{\rref}
+\DescribeMacro{\Rref}
+\translation{%
+ Due to this limitation, it was decided to develop entirely new variants, including \cmd{\rref}\marg{label}.
+ With \cmd{\rref}, one can refer to articles just as is customary for \cmd{\section}, \cmd{\subsection}, and so on.
+ The \cmd{\rref} family consists of a total of four different macros:%
+}{%
+ Door deze beperking is er voor gekozen om geheel nieuwe varianten te ontwikkelen, waaronder \cmd{\rref}\marg{label}.
+ Er kan dus met \cmd{\rref} verwezen worden naar artikelen net als gebruikelijk is voor \cmd{\section}, \cmd{\subsection}, en dergelijke.
+ De \cmd{\rref} familie kent in totaal vier verschillende macro's:%
+}
+\begin{labeling}{\textbackslash{}Rref*\quad}
+ \cmditem{rref} \translation
+ {Starting with a lowercase letter and with a hyperlink.}
+ {Beginnend met een kleine letter en met hyperlink.}\\
+ \begin{tabularx}{\linewidth}{@{}X X X@{}}
+ \textbf{\translation{Article}{Artikel}} & \textbf{\translation{Paragraph}{Lid}} & \textbf{\translation{Subparagraph}{Onderdeel}} \\
+ \rref{ex1-art:lorem} & \rref{ex1-lid:lorem} & \rref{ex1-sub:lorem} \\
+ \end{tabularx}
+ \cmditem{rref*} \translation
+ {Starting with a lowercase letter and without a hyperlink.}
+ {Beginnend met een kleine letter en zonder hyperlink.}\\
+ \begin{tabularx}{\linewidth}{@{}X X X@{}}
+ \textbf{\translation{Article}{Artikel}} & \textbf{\translation{Paragraph}{Lid}} & \textbf{\translation{Subparagraph}{Onderdeel}} \\
+ \rref*{ex1-art:lorem} & \rref*{ex1-lid:lorem} & \rref*{ex1-sub:lorem} \\
+ \end{tabularx}
+ \cmditem{Rref} \translation
+ {Starting with an uppercase letter and with a hyperlink.}
+ {Beginnend met een hoofdletter en met hyperlink.}\\
+ \begin{tabularx}{\linewidth}{@{}X X X@{}}
+ \textbf{\translation{Article}{Artikel}} & \textbf{\translation{Paragraph}{Lid}} & \textbf{\translation{Subparagraph}{Onderdeel}} \\
+ \Rref{ex1-art:lorem} & \Rref{ex1-lid:lorem} & \Rref{ex1-sub:lorem} \\
+ \end{tabularx}
+ \cmditem{Rref*} \translation
+ {Starting with an uppercase letter and without a hyperlink.}
+ {Beginnend met een hoofdletter en zonder hyperlink.}\\
+ \begin{tabularx}{\linewidth}{@{}X X X@{}}
+ \textbf{\translation{Article}{Artikel}} & \textbf{\translation{Paragraph}{Lid}} & \textbf{\translation{Subparagraph}{Onderdeel}} \\
+ \Rref*{ex1-art:lorem} & \Rref*{ex1-lid:lorem} & \Rref*{ex1-sub:lorem} \\
+ \end{tabularx}
+\end{labeling}
+\translation{%
+ In the examples above, a notable difference is already apparent in the alternative \cmd{\zref}, namely the presentation of the reference number/letter/word and a distinct type in the title.
+ For instance, for \texttt{ex1-lid:lorem}, the title is '2.1,' and it is referenced as '(1)'.%
+}{%
+ In de voorbeelden hierboven is al een opmerkelijk verschil te zien tussen alternatief \cmd{\zref}, namelijk de presentatie van de/het verwijsnummer/letter/woord en een afwijkend type in de titel.
+ B\ij{}voorbeeld voor \texttt{ex1-lid:lorem} is de titel `2.1' en wordt aangehaald met `eerste'.%
+}\\
+
+\noindent
+\DescribeMacro{\nref}
+\DescribeMacro{\Nref}
+\translation{%
+ To reference with the corresponding designation, the macro family \cmd{\nref}\marg{label} has been developed.
+ This family, like \cmd{\rref}, has four variants.
+ In the following example, for simplicity, we'll only consider \cmd{\Nref}.%
+}{%
+ Om te verwijzen met de bijbehorende benaming is er de macrofamilie \cmd{\nref}\marg{label} ontwikkeld.
+ Deze familie heeft net als \cmd{\rref} vier varianten.
+ In het volgende voorbeeld gaan we voor het gemak alleen uit van \cmd{\Nref}.%
+}\\
+
+\noindent
+\begin{tabularx}{\linewidth}{@{}p{\widthof{EN}} X X X@{}}
+ & \textbf{\translation{Article}{Artikel}} & \textbf{\translation{Paragraph}{Lid}} & \textbf{\translation{Subparagraph}{Onderdeel}} \\
+ \translation{EN}{NL} & \Nref{ex1-art:lorem} & \Nref{ex1-lid:lorem} & \Nref{ex1-sub:lorem} \\
+\end{tabularx}\translation{\selectlanguage{dutch}}{\selectlanguage{english}}\\
+\begin{tabularx}{\linewidth}{@{}p{\widthof{EN}} X X X@{}}
+ \translation{NL}{EN} & \Nref{ex1-art:lorem} & \Nref{ex1-lid:lorem} & \Nref{ex1-sub:lorem}\\
+\end{tabularx}\translation{\selectlanguage{english}}{\selectlanguage{dutch}}\\
+
+\noindent
+\translation{%
+ A notable difference with the alternative \cmd{\zcref} is that \cmd{\nref} can take into account the position of the designation.
+ For example, consider the outcome for the subparagraph (\meta{written ordinal} \meta{designation}).%
+}{%
+ Een opmerkelijk verschil tussen het alternatief \cmd{\zcref} is dat \cmd{\nref} rekening kan houden met de positie van de benaming.
+ Kijk bijvoorbeeld naar de uitkomst van het lid (\meta{geschreven ordinaal} \meta{benoeming}).%
+}\\
+
+\noindent
+\translation{%
+ With the macro families \cmd{\rref} and \cmd{\nref}, a lot is already possible; however, there are still many other factors to consider when it comes to referencing.
+ For example, the \cmd{\nref} macro already includes the correct designation, but when referring to a member, the corresponding article is not mentioned.%
+}{%
+ Met de macrofamilies \cmd{\rref} en \cmd{\nref} is er dus al veel mogelijk, echter zijn er nog veel andere factoren die meespelen als het gaat om verwijzen.
+ Macro \cmd{\nref} doet bijvoorbeeld wel al de juiste benaming erbij, maar bij het verwijzen naar een lid wordt er geen bijbehorend artikel genoemd.%
+}
+\DescribeMacro{\aref}
+\DescribeMacro{\Aref}
+\translation{%
+ For complete and automatic references, the \cmd{\aref}\marg{labels...} has been developed.
+ This macro family records all components of the reference.
+ Additionally, \cmd{\aref} accepts multiple labels and connects them in the correct way.
+ This can result in a list enumeration, such as \aref{ex1-sub:lorem,ex1-sub:lorem3,ex1-sub:lorem4}, or a range, like \aref{ex1-sub:lorem,ex1-sub:lorem2,ex1-sub:lorem3,ex1-sub:lorem4}.
+ However, there is one limitation: the \option{nameinlink} option cannot be applied when multiple labels are provided. This limitation does not apply when only one label is given.
+ Another additional feature is that these references are easily translatable into Dutch:%
+}{%
+ Voor volledige en automatische verwijzingen is de \cmd{\aref}\marg{labels...} ontwikkeld.
+ Deze macrofamilie noteert dus alle onderdelen van de verwijzing.
+ Daarnaast accepteert \cmd{\aref} meerdere labels en koppelt het de labels op de juiste manier.
+ Dit kan een lijst opsomming geven, zoals \aref{ex1-sub:lorem,ex1-sub:lorem3,ex1-sub:lorem4}, of een reeks, zoals \aref{ex1-sub:lorem,ex1-sub:lorem2,ex1-sub:lorem3,ex1-sub:lorem4}.
+ Hierop is alleen één tekortkoming, namelijk, de optie \option{nameinlink} kan niet toegepast worden wanneer er meerdere labels meegegeven worden.
+ Deze tekortkoming geldt niet wanneer er één label wordt meegegeven.
+ Een andere bijkomstigheid is dat deze verwijzingen gemakkelijk te vertalen zijn naar het Engels:%
+}\\
+\begin{lstlisting}[style=tex]
+\selectlanguage{dutch} / \selectlanguage{english}
+Zie / See \aref{ex1-sub:lorem,ex1-sub:lorem3,ex1-sub:lorem4}
+en / and \aref{ex1-sub:lorem,ex1-sub:lorem2,ex1-sub:lorem3,ex1-sub:lorem4}.
+\end{lstlisting}%
+\translation{\selectlanguage{dutch}}{\selectlanguage{english}}~\\
+\vspace*{-4em}
+\begin{center}
+ \large
+ \translation{Zie}{See} \aref{ex1-sub:lorem,ex1-sub:lorem3,ex1-sub:lorem4}
+ \translation{en}{and} \aref{ex1-sub:lorem,ex1-sub:lorem2,ex1-sub:lorem3,ex1-sub:lorem4}.
+\end{center}
+\translation{\selectlanguage{english}}{\selectlanguage{dutch}}
+\translation{The only limitation that arises is that the reference name for the document isn't translated.
+}{De enige beperking die optreedt is dat de verwijsnaam voor het document niet vertaald is.}
+
+\subsection{\translation{Conjunction}{Conjunctie}}
+\DescribeMacro{\setmiddleconjunction\\\marg{format}}
+\DescribeMacro{\setlastconjunction}
+\DescribeMacro{\setrangeconjunction}
+\DescribeMacro{\setconjunction\\\marg{middle}\\\marg{last}\\\marg{range}\\}
+\translation{%
+ The linking of labels is done through \package{zref}.
+ However, thanks to the reimplementation, other macros have been written in a similar way as \package{cleveref} does, i.e:%
+}{%
+ Het koppelen van de labels gebeurt via \package{zref}.
+ Er zijn echter dankzij de herimplementatie andere macro's geschreven op een vergelijkbare manier als \package{cleveref} dat doet, namelijk:%
+}
+\begin{lstlisting}[style=tex]
+\setmiddleconjunction}{, }
+\setlastconjunction}{ \GetTranslation{and} }
+\setrangeconjunction}{ \GetTranslation{to} }
+\setconjunction{, }{ \GetTranslation{and} }{ \GetTranslation{to} }
+\end{lstlisting}
+\DescribeMacro{\setjuncto}
+\DescribeMacro{\unsetjuncto}
+\translation{%
+ There are also macros to easily switch to legacy notation.
+ With \cmd{\setjuncto}, one can switch throughout the document to the conjunction word `\texttt{ jo.\textbackslash\ }'.
+ Using \cmd{\unsetjuncto} restores \cmd{\lastconjunction} back to `\texttt{ and }'.
+ If manual changes have been made to the conjunctions earlier, those changes will be overridden by one of these macros.
+ In that case, use \cmd{\setlastconjunction}\marg{value} instead of \cmd{\unsetjuncto}.
+}{%
+ Er zijn ook macro's om gemakkelijk naar verouderde notatie te schakelen.
+ Met \cmd{\setjuncto} kan er willekeurig in het document omgeschakeld worden naar het koppelwoord `\texttt{ jo.\textbackslash\ }'.
+ Door \cmd{\unsetjuncto} te gebruiken wordt \cmd{\lastconjunction} weer terug gezet naar `\texttt{ en }'.
+ Als eerder handmatig de koppelingen zijn veranderd, dan zijn die wijzigingen door één van deze macro's overschreven.
+ Gebruik dan in plaats van \cmd{\unsetjuncto} \cmd{\setlastconjunction}\marg{waarde}.
+}
+\clearpage
+
+
+\section{\translation{Interdocument References}{Interdocumentaire Verwijzingen}}\label{sec:extern}
+\translation{Referencing Other Documents Generated with the \package{regulatory} Package is Quite Simple.}{Verwijzen naar andere documenten gegenereerd met het \package{regulatory} pakket kan vrij eenvoudig.}
+\DescribeMacro{\refdocument\\\oarg{prefix}\\\marg{name}\\\marg{opts...}}
+\translation{%
+ After specifying \cmd{\refdocument} in the preamble, it is possible to refer to articles, paragraphs, and subparagraphs.
+ The macro family \cmd{\aref} continues to work seamlessly, thanks to \cmd{\zexternaldocument} from \package{zref-xr}.
+ To avoid ambiguity, a special \option{prefix} can be added.
+ If a \option{prefix} is omitted, a default \option{prefix} is still applied, namely \texttt{ext-}.
+ For instance, label \texttt{lid:lorem} becomes \texttt{ext-lid:lorem}.
+ Note that the \option{prefix} does not apply when referring to definitions with \cmd{\gls}.%
+}{%
+ Na het opgeven van \cmd{\refdocument} in de preamble kan er naar artikelen, leden en onderdelen verwezen worden.
+ De macro familie \cmd{\aref} blijft dankzij \cmd{\zexternaldocument} van \package{zref-xr} nog steeds werken.
+ Om ambiguïteit te voorkomen kan er een speciale \option{prefix} toegevoegd worden.
+ Bij het weglaten van een \option{prefix} is er alsnog een \option{prefix}, namelijk \texttt{ext-}.
+ Label \texttt{lid:lorem} wordt dan \texttt{ext-lid:lorem}.
+ Let wel dat de \option{prefix} niet geldt voor het verwijzen naar definities met \cmd{\gls}.%
+}\\
+
+\noindent
+\DescribeMacro{\masterdocument\\\oarg{prefix}\\\marg{name}\\\marg{opts...}\\}
+\translation{%
+ To create a complete link with other \package{regulatory} documents, the \cmd{\masterdocument} macro is used.
+ A complete link involves:%
+}{%
+ Om een volledige koppeling te maken met andere \package{regulatory} documenten wordt de \cmd{\masterdocument} macro gebruikt.
+ Een volledige koppeling houdt in:%
+}
+\begin{enumerate}
+ \item \translation{referring with the \cmd{\aref} family}{verwijzen met de \cmd{\aref} familie};
+ \item \translation{referencing definitions with the \cmd{\gls} family}{verwijzen naar definities met de \cmd{\gls} familie};
+ \item \translation{referring to the associated document}{verwijzen naar het bijbehorende document};
+ \item \translation{a footnote with the document attached as an appendix to the first occurrence of a reference or definition}{een voetnoot met het document als bijlage bij de eerste verschijning van een verwijzing of definitie}.
+\end{enumerate}
+\translation{%
+ It's even possible for a document to have multiple 'master' documents, as is the case with this document (in Dutch):%
+}{%
+ Het kan zelfs dat een document meerdere `master' documenten heeft, zoals dit document:%
+}
+\begin{lstlisting}[style=tex]
+\newcommand\definitionlabel[1]{~(zie #1)}
+\masterdocument[ex1-]{example1}{
+ defs=example1,
+ author=E. Nijenhuis,
+ subject= Voorbeeld Één,
+ description = Het éérste voorbeeld document,
+ ref label=van Voorbeeld Één,
+ def label=\definitionlabel
+}
+
+\masterdocument[ex2-]{example2}{
+ defs=example2,
+ author=E. Nijenhuis,
+ subject= Voorbeeld Twee,
+ description = Het tweede voorbeeld document,
+ ref label=van Voorbeeld Twee,
+ def label=\definitionlabel
+}
+\end{lstlisting}
+
+\translation{%
+ Both macros \cmd{\refdocument} and \cmd{\masterdocument} have, as a third argument, a choice among the following options:
+}{%
+ Beide macro's \cmd{\refdocument} en \cmd{\masterdocument} hebben als derde argument keuze uit de volgende opties:%
+}
+\begin{labeling}{\texttt{footnote label}}
+ \addtokomafont{labelinglabel}{\ttfamily}
+ \item[name] \translation{%
+ by default, the same as the first argument of the macros.%
+ }{%
+ standaard hetzelfde als het eerste argument van de macro's.%
+ }
+ \item[filename] \translation{%
+ by default, the first argument concatenated with \texttt{.pdf}.
+ This option can be overridden if the name does not correspond to the filename.%
+ }{%
+ standaard het eerste argument met \texttt{.pdf} geconcateneerd.
+ Deze optie kan overschreven worden wanneer de naam niet correspondeerd met de bestandsnaam.%
+ }
+ \item[ref label] \translation{%
+ by default, this macro has no value, and in that case, the following default value is used in \cmd{\documentlabel}:%
+ }{%
+ standaard heeft deze macro geen waarde en in dat geval wordt er in \cmd{\documentlabel} de volgende standaard waarde gebruikt:%
+ } \lstinline|\GetTranslation{of the} \artifactsubject{#1}|.
+ \translation{%
+ This macro receives the \texttt{name} of the document as an argument.%
+ }{%
+ Deze macro krijgt als argument de \texttt{name} van het document.%
+ }
+ \item[def label] \translation{%
+ by default, this macro has the following value:%
+ }{%
+ standaard heeft deze macro de volgende waarde:%
+ } \lstinline|~(\GetTranslation{see} #1)|.
+ \translation{%
+ The argument contains the \texttt{subject} with a possible footnote (depending on \texttt{referred}).%
+ }{%
+ Het argument bevat de \texttt{subject} met eventueel de footnote (afhankelijk van \texttt{referred}).%
+ }
+ \item[footnote] \translation{%
+ by default, the value is \texttt{true}, so that footnotes are added at the first occurrence.
+ This can be set to \texttt{false} to prevent this.%
+ }{%
+ standaard is de waarde \texttt{true}, zodat er voetnoten geplaatst worden bij de eerste verschijning.
+ Deze kan naar \texttt{false} gezet worden om dit te voorkomen.%
+ }
+ \item[footnote label] \translation{%
+ This macro receives the attached document with \texttt{subject} as its representation in the text.
+ By default, this macro only prints the first argument.%
+ }{%
+ deze macro krijgt als argument het bijgevoegde document met \texttt{subject} als weergave in de tekst.
+ Standaard print deze macro enkel het eerste argument.%
+ }
+ \item[url] \translation{%
+ this option is yet to be implemented.
+ The purpose of this option is to indicate the source of the document in the footnote.%
+ }{%
+ deze optie wordt is nog niet geïmplementeerd.
+ De bedoeling van deze optie is om in de voetnoot de vindplaats van het document te duiden.%
+ }
+ \item[referred] \translation{%
+ This option is for internal use.
+ \cmd{\documentfootnote} sets this value to \texttt{true}.%
+ }{%
+ deze optie is voor intern gebruik.
+ \cmd{\documentfootnote} zet deze waarde naar \texttt{true}.%
+ }
+ \item[defs] \translation{%
+ This option is used to load external definition lists under this document.
+ This way, the correct source can be mentioned for first occurrences of definitions.%
+ }{%
+ deze optie wordt gebruikt om externe definitielijsten in te laden onder dit document.
+ Op deze manier kan bij eerste verschijningen van definities de juiste bron vermeldt worden.%
+ }
+ \item[author] \translation{%
+ This option is used in \cmd{\documentattachment} for metadata purposes in some PDF viewing applications.%
+ }{%
+ deze optie wordt in \cmd{\documentattachment} gebruikt voor metadata t.b.v.\ sommige PDF-weergave applicaties.%
+ }
+ \item[subject] \translation{%
+ This option is used, like \texttt{author}, in the appendix.%
+ }{%
+ deze optie wordt net als \texttt{author} gebruikt in de bijlage.%
+ }
+ \item[description] \translation{%
+ This option is used, like \texttt{author}, in the appendix.%
+ }{%
+ deze optie wordt net als \texttt{author} gebruikt in de bijlage.%
+ }
+\end{labeling}
+
+\noindent
+\DescribeMacro{\documentlabel\\\marg{label}}
+\DescribeMacro{\documentfootnote\\\oarg{link text}\\\marg{label}}
+\DescribeMacro{\documentattachment\\\marg{label}\\\marg{link text}}
+\translation{%
+ For both references to definitions and articles, etc., the source is mentioned, and at the first appearance, a footnote is placed with an appendix of the document.
+ Behind the scenes, \cmd{\documentlabel}\footnote{This macro uses the label of references and not definitions.}, \cmd{\documentfootnote}, and \cmd{\documentattachment} are invoked for articles, etc., and definitions.%
+}{%
+ Voor zowel verwijzingen naar definities als artikelen e.d.\ wordt de bron vermeldt en wordt er bij de eerste verschijning een voetnoot geplaatst met een bijlage van het exemplaar.
+ Onder water worden \cmd{\documentlabel}\footnote{Deze macro gebruikt het label van verwijzingen en dus niet van definities.} \cmd{\documentfootnote} en \cmd{\documentattachment} aangeroepen voor artikelen e.d.\ en definities.%
+}\\
+
+\noindent
+\translation{These macros can be called manually.}{Deze macro's kunnen ook handmatig uitgevoerd worden.}
+\translation{For example,}{Neem b\ij{}voorbeeld} \lstinline[style=tex]|\documentfootnote{example2}| \translation{, which results in}{wat zou leiden tot}:
+`\documentfootnote{example2-\translation{en}{nl}}'.
+
+\clearpage
+
+
+\section{\translation{Language Support}{Taalondersteuning}}
+\translation{%
+ Initially, this package only provided support for Dutch.
+ When English was implemented, certain macros were added to facilitate easy switching between languages.
+ The notation of references in English and Dutch differs to an extent that setting the language can be quite complex, but this may make it adjustable for other languages as well.%
+}{%
+ In beginsel bood dit pakket alleen ondersteuning voor Nederlands.
+ Toen Engels geïmplementeerd werd zijn er bepaalde macro's bij gekomen, zodat er makkelijk geschakeld kan worden tussen talen.
+ De notatie van verwijzingen in het Engels en Nederlands verschilt dusdanig dat de instelling van een taal enigszins complex kan zijn.
+ Echter, dit maakt het mogelijk aanpasbaar voor andere talen.%
+}\\
+
+\noindent
+\DescribeMacro{\rref@setup\\\marg{lang}\\\marg{article opts...}\\\marg{para opts...}\\\marg{sub opts...}}
+\translation{%
+ The \cmd{\rref@setup} macro takes the \meta{language} as first argument.
+ The other three arguments accept multiple options, namely:%
+}{%
+ De \cmd{\rref@setup} macro heeft als eerste argument \meta{de taal} die moet worden ingesteld.
+ De andere drie argumenten accepteren meerdere opties, namelijk:%
+}
+\begin{labeling}{\texttt{group conjunction}}
+ \addtokomafont{labelinglabel}{\ttfamily}
+ \item[name]
+ \translation{%
+ the designation in lower case.
+ For example `article', `art.', `par', et cetera.
+ Default for%
+ }{%
+ de benaming in kleine letters, b\ij{}voorbeeld `artikel', `art.', `onderdeel', enzovoort.
+ Standaard voor%
+ }\\\GetTranslation{article} \lstinline|\GetTranslation{article}|, \\\GetTranslation{paragraph} \lstinline|\GetTranslation{paragraph}| \GetTranslation{and} \\\GetTranslation{subparagraph} \lstinline|\GetTranslation{subparagraph}|.%
+ \item[Name] \translation{%
+ the designation starting with a capital letter. For example, 'Article'. Like \texttt{name}, this option defaults to using \cmd{\GetTranslation}, but with an initial capital letter.%
+ }{%
+ de benaming beginnend met een hoofdletter, b\ij{}voorbeeld `Artikel'.
+ Net als \texttt{name} gebruikt deze optie standaard \cmd{\GetTranslation}, maar dan met een hoofdletter.%
+ }
+ \item[ref format] \translation{%
+ a macro with one argument, namely the current number.
+ For example, for a member (or subparagraph in English), \cmd{\ordinalstringnum} is used for this.
+ In such cases, it is important to consider case sensitivity using \cmd{\@ifrrefcap}.
+ Example:%
+ }{%
+ een macro met één argument, namelijk het huidige nummer.
+ Voor bijvoorbeeld een lid (of subparagraph in het Engels) is hiervoor \cmd{\ordinalstringnum} gebruikt.
+ In zo'n geval is het belangrijk om rekening te houden met hoofdletter gevoeligheid d.m.v.\ \cmd{\@ifrrefcap}.
+ Voorbeeld:%
+ } \lstinline[style=tex]|\@ifrrefcap{\Ordinalstringnum{...}}{\ordinalstringnum{...}}|.
+ \item[label format] \translation{%
+ the order of the reference and the name.
+ This macro takes two arguments, namely the \texttt{name} and the result of \texttt{ref format}.
+ For example, for an article in Dutch, the order is \texttt{\{\#1 \#2\}}, for a paragraph in Dutch \texttt{\{\#2 \#1\}}, and for a paragraph/lid in English \texttt{\textbackslash@gobble\{\#1\}\#2}\footnote{\texttt{\textbackslash@gobble} processes the argument but does not print anything.}.
+ Note that you need to specify a macro.
+ In the first example, you would pass \cmd{\mylabelformat} as an option and define it as:
+ }{%
+ de volgorde van de verwijzing en de naam.
+ Deze macro krijgt twee argumenten mee, namelijk de \texttt{name} en het resultaat van \texttt{ref format}.
+ Voor bijvoorbeeld een artikel is de volgorde \texttt{\{\#1 \#2\}}, voor een lid \texttt{\{\#2 \#1\}}, en voor een paragraph/lid in het engels \texttt{\textbackslash@gobble\{\#1\}\#2}\footnote{\texttt{\textbackslash@gobble} verwerkt het argument maar print niks uit.}.
+ Let wel dat je een macro dient op te geven.
+ Bij het eerste voorbeeld zou je \cmd{\mylabelformat} als optie meegeven en zou gedefinieerd zijn als:
+ }\lstinline[style=tex]|\newcommand\mylabelformat[2]{#1 #2}|.
+ \item[group conjunction] \translation{%
+ This value indicates how it should be linked to the parent part.
+ For example (Dutch), in ``artikel\Vtextvisiblespace1\textcolor{red}{,\Vtextvisiblespace}eerste\Vtextvisiblespace lid,'' the \texttt{group conjunction} is set to \lstinline|{,~}| for the article.%
+ }{%
+ deze waarde geeft aan hoe het dient gekoppeld te worden aan het bovenliggende onderdeel.
+ Bijvoorbeeld, in ``artikel\Vtextvisiblespace1\textcolor{red}{,\Vtextvisiblespace}eerste\Vtextvisiblespace lid'' is de \texttt{group conjunction} bij de instelling van het artikel gelijk aan \lstinline|{,~}|.%
+ }
+ \item[group format] \translation{%
+ This option accepts a macro with one argument.
+ The first argument contains all subparts.
+ For example, in English, for a subparagraph/onderdeel, the article and paragraph/lid need to be surrounded by square brackets.
+ The value would then be for the subpart \texttt{{[}\#1{]}}.
+ }{%
+ deze optie accepteert een macro met één argument.
+ Het eerste argument bevat alle onderliggende onderdelen.
+ Bijvoorbeeld in het Engels dient bij een subparagraph/onderdeel het artikel en paragraph/lid omringd te worden met blokhaken.
+ De waarde is dan bij het onderdeel \texttt{{[}\#1{]}}.
+ }
+\end{labeling}
+\translation{%
+ These options can vary for each article, paragraph, and subparagraph.
+
+ When defining a new language, it's important to know that the default values are based on the English configuration.
+ For example, consider the Dutch configuration, including all the used helper macros:
+}{%
+ Deze opties kunnen verschillen per artikel, lid en onderdeel.
+
+ Bij het definiëren van een nieuwe taal is het belangrijk om te weten dat de standaard waarden gebaseerd zijn op de Engelse configuratie.
+ Neem bijvoorbeeld de Nederlandse configuratie, inclusief alle gebruikte hulp macro's:%
+}
+\begin{lstlisting}[style=TeX,caption={\translation{Dutch configuration}{Nederlandse configuratie}},numbers=left]
+\newcommand\rref@refformat@noop[1]{#1}
+\newcommand\rref@refformat@parenthesis[1]{(#1)}
+\newcommand\rref@refformat@ordinal[1]{%
+ \@ifrrefcap{%
+ \Ordinalstringnum{#1}%
+ }{%
+ \ordinalstringnum{#1}%
+ }%
+}
+\newcommand\rref@refformat@alpha[1]{%
+ \@ifrrefcap{%
+ \ABAlphnum{#1}%
+ }{%
+ \abalphnum{#1}%
+ }%
+}
+\newcommand\rref@label@prefix[2]{#1 #2}
+\newcommand\rref@label@postfix[2]{#2 #1}
+\newcommand\rref@label@refonly[2]{\@gobble{#1}#2}
+\newcommand\rref@group@braced[1]{{[}#1{]~}}
+
+\rref@setup{dutch}{
+ group conjunction={,~}
+}{
+ ref format=\rref@refformat@ordinal,
+ label format=\rref@label@postfix,
+ group conjunction={,~},
+ group format=\rref@refformat@noop
+}{
+ ref format=\rref@refformat@alpha,
+ label format=\rref@label@prefix,
+ group conjunction={,~},
+ group format=\rref@refformat@noop
+}
+\end{lstlisting}
+
+\clearpage
+\section*{\translation{Examples}{Voorbeelden}}\label{sec:example}
+\lstset{numbers=left,frame=single}
+\lstinputlisting[style=tex,numbers=left,caption={example1.tex},label={code:example1}]{example1.tex}
+
+\lstinputlisting[style=tex,numbers=left,caption={example2.tex},label={code:example2}]{example2.tex}\clearpage
+
+\lstinputlisting[style=tex,numbers=left,caption={md-example.tex},label={code:md-example}]{md-example.tex}\clearpage
+
+\lstinputlisting[style=md,numbers=left,caption={example.md},label={code:example-md}]{example.md}\clearpage
+
+\lstinputlisting[style=bib,numbers=left,caption={example1.bib}]{example1.bib}
+
+\lstinputlisting[style=bib,numbers=left,caption={example2.bib}]{example2.bib}
diff --git a/macros/latex/contrib/regulatory/tex/fc-dutch.def b/macros/latex/contrib/regulatory/tex/fc-dutch.def
new file mode 100644
index 0000000000..e1e1432121
--- /dev/null
+++ b/macros/latex/contrib/regulatory/tex/fc-dutch.def
@@ -0,0 +1,424 @@
+%% fc-dutch.def
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\ProvidesFCLanguage{dutch}[2022/06/19]
+
+\newcommand{\@ordinalMdutch}[2]{\edef#2{\number#1\relax.}}
+\global\let\@ordinalMdutch\@ordinalMdutch
+\newcommand{\@ordinalFdutch}[2]{\edef#2{\number#1\relax.}}
+\global\let\@ordinalFdutch\@ordinalFdutch
+\newcommand{\@ordinalNdutch}[2]{\edef#2{\number#1\relax.}}
+\global\let\@ordinalNdutch\@ordinalNdutch
+
+\newcommand*\@@unitstringdutch[1]{%
+ \ifcase#1%
+ nul%
+ \or één%
+ \or twee%
+ \or drie%
+ \or vier%
+ \or vijf%
+ \or zes%
+ \or zeven%
+ \or acht%
+ \or negen%
+ \fi
+}%
+\global\let\@@unitstringdutch\@@unitstringdutch
+
+\global\let\@@unitstringdutch\@@unitstringdutch
+\newcommand*\@@tenstringdutch[1]{%
+ \ifcase#1%
+ \or tien%
+ \or twintig%
+ \or dertig%
+ \or veertig%
+ \or vijftig%
+ \or zestig%
+ \or zeventig%
+ \or tachtig%
+ \or negentig%
+ \or honderd%
+ \fi
+}%
+\global\let\@@tenstringdutch\@@tenstringdutch
+
+\providecommand*{\honderd}{honderd}%
+\providecommand*{\duizend}{duizend}%
+\global\let\honderd\honderd
+\global\let\duizend\duizend
+
+\newcommand*\@@teenstringdutch[1]{%
+ \ifcase#1%
+ tien%
+ \or elf%
+ \or twaalf%
+ \or dertien%
+ \or veertien%
+ \or vijftien%
+ \or zestien%
+ \or zeventien%
+ \or achttien%
+ \or negentien%
+ \fi
+}%
+\global\let\@@teenstringdutch\@@teenstringdutch
+
+\newcommand*{\@numberstringMdutch}[2]{%
+ \let\@unitstring=\@@unitstringdutch
+ \let\@teenstring=\@@teenstringdutch
+ \let\@tenstring=\@@tenstringdutch
+ \@@numberstringdutch{#1}{#2}%
+}
+\global\let\@numberstringMdutch\@numberstringMdutch
+\global\let\@numberstringFdutch=\@numberstringMdutch
+\global\let\@numberstringNdutch=\@numberstringMdutch
+
+\newcommand*{\@NumberstringMdutch}[2]{%
+\@numberstringMdutch{#1}{\@@num@str}%
+\edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}}
+\global\let\@NumberstringMdutch\@NumberstringMdutch
+\global\let\@NumberstringFdutch=\@NumberstringMdutch
+\global\let\@NumberstringNdutch=\@NumberstringMdutch
+
+\newcommand*{\@ordinalstringMdutch}[2]{%
+ \let\@unitthstring=\@@unitthstringMdutch
+ \let\@teenthstring=\@@teenthstringMdutch
+ \let\@tenthstring=\@@tenthstringMdutch
+ \let\@unitstring=\@@unitstringdutch
+ \let\@teenstring=\@@teenstringdutch
+ \let\@tenstring=\@@tenstringdutch
+ \def\@thousandth{duizendste}%
+ \def\@hundredth{honderdste}%
+ \@@ordinalstringdutch{#1}{#2}%
+}%
+\global\let\@ordinalstringMdutch\@ordinalstringMdutch
+
+\global\let\@ordinalstringMdutch\@ordinalstringMdutch
+\newcommand*{\@ordinalstringFdutch}[2]{%
+ \let\@unitthstring=\@@unitthstringFdutch
+ \let\@teenthstring=\@@teenthstringFdutch
+ \let\@tenthstring=\@@tenthstringFdutch
+ \let\@unitstring=\@@unitstringdutch
+ \let\@teenstring=\@@teenstringdutch
+ \let\@tenstring=\@@tenstringdutch
+ \def\@thousandth{duizendste}%
+ \def\@hundredth{honderdste}%
+ \@@ordinalstringdutch{#1}{#2}%
+}%
+\global\let\@ordinalstringFdutch\@ordinalstringFdutch
+
+\newcommand*{\@ordinalstringNdutch}[2]{%
+ \let\@unitthstring=\@@unitthstringNdutch
+ \let\@teenthstring=\@@teenthstringNdutch
+ \let\@tenthstring=\@@tenthstringNdutch
+ \let\@unitstring=\@@unitstringdutch
+ \let\@teenstring=\@@teenstringdutch
+ \let\@tenstring=\@@tenstringdutch
+ \def\@thousandth{duizendste}%
+ \def\@hundredth{honderdste}%
+ \@@ordinalstringdutch{#1}{#2}%
+}%
+\global\let\@ordinalstringNdutch\@ordinalstringNdutch
+
+\newcommand*{\@OrdinalstringMdutch}[2]{%
+ \@ordinalstringMdutch{#1}{\@@num@str}%
+ \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
+}%
+\global\let\@OrdinalstringMdutch\@OrdinalstringMdutch
+\newcommand*{\@OrdinalstringFdutch}[2]{%
+ \@ordinalstringFdutch{#1}{\@@num@str}%
+ \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
+}%
+\global\let\@OrdinalstringFdutch\@OrdinalstringFdutch
+\newcommand*{\@OrdinalstringNdutch}[2]{%
+ \@ordinalstringNdutch{#1}{\@@num@str}%
+ \edef#2{\noexpand\MakeUppercase\expandonce\@@num@str}%
+}%
+\global\let\@OrdinalstringNdutch\@OrdinalstringNdutch
+
+\newcommand*\@@unitthstringMdutch[1]{%
+ \ifcase#1%
+ nulde%
+ \or eerste%
+ \or tweede%
+ \or derde%
+ \or vierde%
+ \or vijfde%
+ \or zesde%
+ \or zevende%
+ \or achtste%
+ \or negende%
+ \fi
+}%
+\global\let\@@unitthstringMdutch\@@unitthstringMdutch
+\newcommand*\@@tenthstringMdutch[1]{%
+ \ifcase#1%
+ \or tiende%
+ \or twintigste%
+ \or dertigste%
+ \or veertigste%
+ \or vijftigste%
+ \or zestigste%
+ \or zeventigste%
+ \or tachtigste%
+ \or negentigste%
+ \fi
+}%
+\global\let\@@tenthstringMdutch\@@tenthstringMdutch
+\newcommand*\@@teenthstringMdutch[1]{%
+ \ifcase#1%
+ tiende%
+ \or elfde%
+ \or twaalfde%
+ \or dertiende%
+ \or veertiende%
+ \or vijftiende%
+ \or zestiende%
+ \or zeventiende%
+ \or achttiende%
+ \or negentiende%
+ \fi
+}%
+\global\let\@@teenthstringMdutch\@@teenthstringMdutch
+\newcommand*\@@unitthstringFdutch[1]{%
+ \ifcase#1%
+ nullte%
+ \or eerste%
+ \or tweede%
+ \or derde%
+ \or vierde%
+ \or vijfde%
+ \or zesde%
+ \or zevende%
+ \or achtste%
+ \or negende%
+ \fi
+}%
+\global\let\@@unitthstringFdutch\@@unitthstringFdutch
+\newcommand*\@@tenthstringFdutch[1]{%
+ \ifcase#1%
+ \or tiende%
+ \or twintigste%
+ \or dertigste%
+ \or veertigste%
+ \or vijftigste%
+ \or zestigste%
+ \or zeventigste%
+ \or tachtigste%
+ \or negentigste%
+ \fi
+}%
+\global\let\@@tenthstringFdutch\@@tenthstringFdutch
+\newcommand*\@@teenthstringFdutch[1]{%
+ \ifcase#1%
+ tiende%
+ \or elfde%
+ \or twaalfde%
+ \or dertiende%
+ \or veertiende%
+ \or vijftiende%
+ \or zestiende%
+ \or zeventiende%
+ \or achttiende%
+ \or zegentiende%
+ \fi
+}%
+\global\let\@@teenthstringFdutch\@@teenthstringFdutch
+\newcommand*\@@unitthstringNdutch[1]{%
+ \ifcase#1%
+ nulde%
+ \or eerste%
+ \or tweede%
+ \or derde%
+ \or vierde%
+ \or vijfde%
+ \or zesde%
+ \or zevende%
+ \or achtste%
+ \or negende%
+ \fi
+}%
+\global\let\@@teenthstringNdutch\@@teenthstringNdutch
+\newcommand*\@@numberunderhundreddutch[2]{%
+\ifnum#1<10\relax
+ \ifnum#1>0\relax
+ \eappto#2{\@unitstring{#1}}%
+ \fi
+\else
+ \@tmpstrctr=#1\relax
+ \@FCmodulo{\@tmpstrctr}{10}%
+ \ifnum#1<20\relax
+ \eappto#2{\@teenstring{\@tmpstrctr}}%
+ \else
+ \ifnum\@tmpstrctr=0\relax
+ \else
+ \eappto#2{\@unitstring{\@tmpstrctr}en}%
+ \fi
+ \@tmpstrctr=#1\relax
+ \divide\@tmpstrctr by 10\relax
+ \eappto#2{\@tenstring{\@tmpstrctr}}%
+ \fi
+\fi
+}%
+\global\let\@@numberunderhundreddutch\@@numberunderhundreddutch
+\newcommand*\@@numberstringdutch[2]{%
+\ifnum#1>99999\relax
+ \PackageError{fmtcount}{Out of range}%
+ {This macro only works for values less than 100000}%
+\else
+ \ifnum#1<0\relax
+ \PackageError{fmtcount}{Negative numbers not permitted}%
+ {This macro does not work for negative numbers, however
+ you can try typing "minus" first, and then pass the modulus of
+ this number}%
+ \fi
+\fi
+\def#2{}%
+\@strctr=#1\relax \divide\@strctr by 1000\relax
+\ifnum\@strctr>1\relax
+ \@@numberunderhundreddutch{\@strctr}{#2}%
+ \appto#2{duizend}%
+\else
+ \ifnum\@strctr=1\relax
+ \eappto#2{\eintausend}%
+ \fi
+\fi
+\@strctr=#1\relax
+\@FCmodulo{\@strctr}{1000}%
+\divide\@strctr by 100\relax
+\ifnum\@strctr>1\relax
+ \eappto#2{\@unitstring{\@strctr}honderd}%
+\else
+ \ifnum\@strctr=1\relax
+ \ifnum#1>1000\relax
+ \appto#2{honderd}%
+ \else
+ \eappto#2{\honderd}%
+ \fi
+ \fi
+\fi
+\@strctr=#1\relax
+\@FCmodulo{\@strctr}{100}%
+\ifnum#1=0\relax
+ \def#2{null}%
+\else
+ \ifnum\@strctr=1\relax
+ \appto#2{één}%
+ \else
+ \@@numberunderhundreddutch{\@strctr}{#2}%
+ \fi
+\fi
+}%
+\global\let\@@numberstringdutch\@@numberstringdutch
+\newcommand*\@@numberunderhundredthdutch[2]{%
+\ifnum#1<10\relax
+ \eappto#2{\@unitthstring{#1}}%
+\else
+ \@tmpstrctr=#1\relax
+ \@FCmodulo{\@tmpstrctr}{10}%
+ \ifnum#1<20\relax
+ \eappto#2{\@teenthstring{\@tmpstrctr}}%
+ \else
+ \ifnum\@tmpstrctr=0\relax
+ \else
+ \eappto#2{\@unitstring{\@tmpstrctr}-en-}%
+ \fi
+ \@tmpstrctr=#1\relax
+ \divide\@tmpstrctr by 10\relax
+ \eappto#2{\@tenthstring{\@tmpstrctr}}%
+ \fi
+\fi
+}%
+\global\let\@@numberunderhundredthdutch\@@numberunderhundredthdutch
+\newcommand*\@@ordinalstringdutch[2]{%
+\@orgargctr=#1\relax
+\ifnum\@orgargctr>99999\relax
+ \PackageError{fmtcount}{Out of range}%
+ {This macro only works for values less than 100000}%
+\else
+ \ifnum\@orgargctr<0\relax
+ \PackageError{fmtcount}{Negative numbers not permitted}%
+ {This macro does not work for negative numbers, however
+ you can try typing "minus" first, and then pass the modulus of
+ this number}%
+ \fi
+\fi
+\def#2{}%
+\@strctr=\@orgargctr\divide\@strctr by 1000\relax
+\ifnum\@strctr>1\relax
+\@@numberunderhundreddutch{\@strctr}{#2}%
+ \@tmpstrctr=\@orgargctr\@FCmodulo{\@tmpstrctr}{1000}%
+ \ifnum\@tmpstrctr=0\relax
+ \eappto#2{\@thousandth}%
+ \else
+ \appto#2{duizend}%
+ \fi
+\else
+ \ifnum\@strctr=1\relax
+ \ifnum\@orgargctr=1000\relax
+ \eappto#2{\@thousandth}%
+ \else
+ \eappto#2{\duizend}%
+ \fi
+ \fi
+\fi
+\@strctr=\@orgargctr
+\@FCmodulo{\@strctr}{1000}%
+\divide\@strctr by 100\relax
+\ifnum\@strctr>1\relax
+ \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
+ \ifnum\@tmpstrctr=0\relax
+ \ifnum\@strctr=1\relax
+ \eappto#2{\@hundredth}%
+ \else
+ \eappto#2{\@unitstring{\@strctr}\@hundredth}%
+ \fi
+ \else
+ \eappto#2{\@unitstring{\@strctr}honderd}%
+ \fi
+\else
+ \ifnum\@strctr=1\relax
+ \@tmpstrctr=\@orgargctr \@FCmodulo{\@tmpstrctr}{100}%
+ \ifnum\@tmpstrctr=0\relax
+ \eappto#2{\@hundredth}%
+ \else
+ \ifnum\@orgargctr>1000\relax
+ \appto#2{honderd}%
+ \else
+ \eappto#2{\honderd}%
+ \fi
+ \fi
+ \fi
+\fi
+\@strctr=\@orgargctr
+\@FCmodulo{\@strctr}{100}%
+\ifthenelse{\@strctr=0 \and \@orgargctr>0 }{}{%
+\@@numberunderhundredthdutch{\@strctr}{#2}%
+}%
+}%
+\global\let\@@ordinalstringdutch\@@ordinalstringdutch
+%\FCloadlang{dutchb}%
+\iffalse Local variables: \fi
+\iffalse mode: docTeX \fi
+\iffalse End: \fi
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/regulatory/tex/regulatory.sty b/macros/latex/contrib/regulatory/tex/regulatory.sty
new file mode 100644
index 0000000000..f6b3be5e88
--- /dev/null
+++ b/macros/latex/contrib/regulatory/tex/regulatory.sty
@@ -0,0 +1,699 @@
+%% regulatory.sty
+%% Copyright 2024 E. Nijenhuis
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status ‘maintained’.
+%
+% The Current Maintainer of this work is E. Nijenhuis.
+%
+% This work consists of the files regulatory.tex,
+% regulatory-preamble.tex, regulatory-nl.tex, regulatory-en.tex,
+% example1.bib, example2.bib,
+% example1-nl.tex, example2-nl.tex,
+% example1-en.tex, example2-en.tex,
+% md-example.tex, example.md,
+% fc-dutch.def and regulatory.sty
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{regulatory}[2024/01/16 Xerdi's Regulatory Package]
+
+\RequirePackage{pgfopts}
+\RequirePackage{xifthen}
+\RequirePackage{keyval}
+\RequirePackage{xstring}
+\RequirePackage{xspace}
+
+\newif\ifregulatory@markdown
+\newif\ifregulatory@bibtogls
+\newif\ifregulatory@legacy
+\newif\ifregulatory@alldefs
+\pgfkeys{
+ /regulatory/.is family,
+ /regulatory,
+ md/.is if=regulatory@markdown,
+ md=false,
+ bib2gls/.is if=regulatory@bibtogls,
+ bib2gls=true,
+ legacy/.is if=regulatory@legacy,
+ legacy=false,
+ alldefs/.is if=regulatory@alldefs,
+ alldefs=false
+}
+
+\InputIfFileExists{regulatory.cfg}{%
+ \PackageInfo{regulatory}{Using local configuration file}%
+}{%
+ \PackageInfo{regulatory}{No local configuration file}%
+}
+
+\newboolean{regulatory@nameinlink}
+\setboolean{regulatory@nameinlink}{true}
+
+\ProcessPgfPackageOptions{/regulatory}
+
+% Markdown support
+\ifregulatory@markdown
+\RequirePackage[hashEnumerators,definitionLists,hybrid,headerAttributes=true]{markdown}
+\setkeys{markdownRenderers}{
+headingOne={\article{#1}},
+olItemWithNumber={\item{}},
+olBeginTight={\begin{paras}},
+olEndTight={\end{paras}},
+olBegin={\begin{paras}},
+olEnd={\end{paras}},
+dlBeginTight={\begin{labeling}{\@glswidestname}},
+dlEndTight={\end{labeling}},
+dlBegin={\begin{labeling}{\@glswidestname}},
+dlEnd={\end{labeling}}%
+\renewcommand\markdownRendererOlItemWithNumber[1]{\item{}\label{ml:##1}}
+}
+\fi
+
+% Pakketten ná markdown (anders gaat enumitem kapot)
+\RequirePackage{xcolor}
+\RequirePackage{xassoccnt}
+\RequirePackage{xpatch}
+\RequirePackage{titlesec}
+\RequirePackage{enumitem}
+\RequirePackage{fmtcount}
+\RequirePackage{scrextend}
+\RequirePackage{xr-hyper}
+\RequirePackage[user,counter,hyperref,xr]{zref}
+\RequirePackage{zref-xr,zref-user,zref-clever,zref-hyperref}
+\RequirePackage{hyperref}
+\RequirePackage{pgf}
+\RequirePackage[sanitize=none,nopostdot]{glossaries}
+\ifregulatory@bibtogls
+\RequirePackage[record,style=alttree]{glossaries-extra}
+\else
+\PackageWarning{regulatory}{Using glossaries for definitions without bib2gls. This is mostly untested.}
+\fi
+
+\RequirePackage{attachfile2}
+\RequirePackage{translations}
+
+\newboolean{regulatory@defslisted}
+\setboolean{regulatory@defslisted}{false}
+
+% Kleuren
+\providecolor{artlabel}{rgb}{0,0,0}
+\providecolor{arttitle}{rgb}{0,0,0}
+\providecolor{paralabel}{rgb}{0,0,0}
+\providecolor{paratitle}{rgb}{0,0,0}
+\providecolor{sublabel}{rgb}{0,0,0}
+\providecolor{subtitle}{rgb}{0,0,0}
+
+
+
+% Artikelen
+\newcounter{article}
+\titleclass{\article}[0]{straight}
+\titleformat{\article}{\normalfont\color{arttitle}}{\bfseries\color{artlabel}Artikel \thearticle.\quad}{1em}{}
+\titlespacing*{\article}{0pt}{3.5ex plus 1ex minus .2ex}{5pt}
+
+\newcounter{para}
+\titleclass{\para}{straight}[\article]
+\titleformat{\para}{\normalfont\color{paratitle}}{\normalfont\color{paralabel}\thearticle.\thepara.\quad}{1em}{}
+\titlespacing*{\para}{0pt}{3.5ex plus 1ex minus .2ex}{5pt}
+\counterwithin{para}{article}
+
+\renewcommand{\thearticle}{\arabic{article}}
+\renewcommand{\thepara}{\arabic{para}}
+\makeatletter
+\newcommand{\l@article}{\@dottedtocline{1}{1.5em}{2.3em}}
+\def\toclevel@article{2}
+\newcommand{\l@para}{\@dottedtocline{1}{3.8em}{2.3em}}
+\def\toclevel@para{3}
+
+\newcounter{provisions}
+\newlist{provisions}{enumerate}{1}
+\setlist[provisions,1]{label=\arabic*.,align=left,itemsep=0pt}
+\counterwithin{provisions}{section}
+
+\newlist{paras}{enumerate}{2}
+\setlist[paras,1]{label=\thearticle.\arabic*.,ref=\arabic*,align=left,itemsep=0pt}
+\setlist[paras,2]{label=\abalphnum{\arabic*}),ref=\arabic*,itemsep=0pt}
+\counterwithin{parasi}{article}
+\counterwithin{parasii}{parasi}
+
+\zref@newprop{article}[-1]{\number\value{article}}
+\zref@newprop{para}[-1]{\ifnum\value{para}>0\number\value{para}\else\number\value{parasi}\fi}
+\zref@newprop{sub}[-1]{\number\value{parasii}}
+\zref@addprops{main}{article,para,sub}
+
+\DeclareTranslation{dutch}{article}{artikel}
+\DeclareTranslation{dutch}{paragraph}{lid}
+\DeclareTranslation{dutch}{subparagraph}{onderdeel}
+\DeclareTranslation{dutch}{Article}{Artikel}
+\DeclareTranslation{dutch}{Paragraph}{Lid}
+\DeclareTranslation{dutch}{Subparagraph}{Onderdeel}
+\DeclareTranslation{dutch}{to}{tot}
+\DeclareTranslation{dutch}{Definitions}{Definities}
+\DeclareTranslation{dutch}{of the}{van de}
+
+\zcRefTypeSetup{article}{%
+ Name-sg = \GetTranslation{Article},
+ name-sg = \GetTranslation{article},
+ Name-pl = Artikelen,
+ name-pl = artikelen
+}
+\zcRefTypeSetup{para}{%
+ Name-sg = \GetTranslation{Paragraph},
+ name-sg = \GetTranslation{paragraph},
+ Name-pl = Leden,
+ name-pl = leden
+}
+\zcRefTypeSetup{parasi}{%
+ Name-sg = \GetTranslation{Paragraph},
+ name-sg = \GetTranslation{paragraph},
+ Name-pl = Leden,
+ name-pl = leden
+}
+\zcRefTypeSetup{parasii}{%
+ Name-sg = \GetTranslation{Subparagraph},
+ name-sg = \GetTranslation{subparagraph},
+ Name-pl = Onderdelen,
+ name-pl = onderdelen
+}
+
+\makeatother
+{\catcode`\#=12 \gdef\hashchar{#}}
+\makeatletter
+\def\rref@linkpr{\href{\rref@current@fullurl}}
+
+\newboolean{rref@cap}
+\def\@ifrrefcap#1#2{%
+ \ifthenelse{\boolean{rref@cap}}{%
+ #1%
+ \ifthenelse{\equal{#1}{}}{}{%
+ \setboolean{rref@cap}{false}%
+ }%
+ }{%
+ #2%
+ }%
+}
+\def\@ifnameinlink#1#2{%
+ \ifthenelse{\boolean{regulatory@nameinlink}}{#1}{#2}%
+}
+
+\newcommand\rref@middleconjunction{, }
+\newcommand\rref@lastconjunction{ \GetTranslation{and} }
+\newcommand\rref@rangeconjunction{ \GetTranslation{to} }
+
+\newcommand\setmiddleconjunction[1]{\renewcommand\rref@middleconjunction{#1}}
+\newcommand\setlastconjunction[1]{\renewcommand\rref@lastconjunction{#1}}
+\newcommand\setrangeconjunction[1]{\renewcommand\rref@rangeconjunction{#1}}
+
+\newcommand\setconjunction[3]{%
+ \setmiddleconjunction{#1}%
+ \setlastconjunction{#1}%
+ \setrangeconjunction{#1}%
+}
+
+\newcommand\setjuncto{%
+\setlastconjunction{ jo.\ }%
+}
+
+\newcommand\unsetjuncto{%
+\setlastconjunction{ \GetTranslation{and} }%
+}
+
+\ifregulatory@legacy
+\setjuncto
+\fi
+
+\newcommand\rref@refformat@noop[1]{#1}
+\newcommand\rref@refformat@parenthesis[1]{(#1)}
+\newcommand\rref@refformat@ordinal[1]{\@ifrrefcap{\Ordinalstringnum{#1}}{\ordinalstringnum{#1}}}
+\newcommand\rref@refformat@alpha[1]{\@ifrrefcap{\ABAlphnum{#1}}{\abalphnum{#1}}}
+\newcommand\rref@label@prefix[2]{#1 #2}
+\newcommand\rref@label@postfix[2]{#2 #1}
+\newcommand\rref@label@refonly[2]{\@gobble{#1}#2}
+\newcommand\rref@group@braced[1]{{[}#1{]~}}
+
+\newcommand\rref@init@lang@article[1]{%
+ \pgfkeys{/rref/#1/article/.is family,
+ /rref/#1/article,
+ name/.initial=\GetTranslation{article},
+ Name/.initial=\GetTranslation{Article},
+ ref format/.initial=\rref@refformat@noop,
+ label format/.initial=\rref@label@prefix,
+ group conjunction/.initial={},
+ group format/.initial=\rref@refformat@noop
+ }
+}
+\newcommand\rref@init@lang@para[1]{%
+ \pgfkeys{/rref/#1/para/.is family,
+ /rref/#1/para,
+ name/.initial=\GetTranslation{paragraph},
+ Name/.initial=\GetTranslation{Paragraph},
+ ref format/.initial=\rref@refformat@parenthesis,
+ label format/.initial=\rref@label@refonly,
+ group conjunction/.initial={,},
+ group format/.initial=\rref@refformat@noop
+ }
+}
+\newcommand\rref@init@lang@sub[1]{%
+ \pgfkeys{/rref/#1/sub/.is family,
+ /rref/#1/sub,
+ name/.initial=\GetTranslation{subparagraph},
+ Name/.initial=\GetTranslation{Subparagraph},
+ ref format/.initial=\rref@refformat@ordinal,
+ label format/.initial=\rref@label@postfix,
+ group conjunction/.initial={,},
+ group format/.initial=\rref@group@braced
+ }
+}
+
+\newcommand\rref@setup@lang[3]{%
+ \pgfkeys{/rref/#1/#2,#3}
+}
+
+\newcommand\rref@setup[4]{%
+ \rref@init@lang@article{#1}
+ \rref@init@lang@para{#1}
+ \rref@init@lang@sub{#1}
+ \rref@setup@lang{#1}{article}{#2}
+ \rref@setup@lang{#1}{para}{#3}
+ \rref@setup@lang{#1}{sub}{#4}
+}
+
+% The defaults are already based on English, so no arguments are given.
+\rref@setup{english}{}{}{}
+
+\rref@setup{dutch}{
+ group conjunction={,~}
+}{
+ ref format=\rref@refformat@ordinal,
+ label format=\rref@label@postfix,
+ group conjunction={,~},
+ group format=\rref@refformat@noop
+}{
+ ref format=\rref@refformat@alpha,
+ label format=\rref@label@prefix,
+ group conjunction={,~},
+ group format=\rref@refformat@noop
+}%
+
+\newcommand\rref@set[4][\languagename]{%
+ \pgfkeysgetvalue{/rref/#1/#2/#3}{#4}%
+}
+
+\newcommand\rref@get[3][\languagename]{%
+ \pgfkeysvalueof{/rref/#1/#2/#3}%
+}
+
+\newcommand\rref@name[2][\languagename]{\@ifrrefcap{\rref@get[#1]{#2}{Name}}{\rref@get[#1]{#2}{name}}}
+\def\rref@article@name{\rref@name{article}}
+\def\rref@para@name{\rref@name{para}}
+\def\rref@sub@name{\rref@name{sub}}
+
+\newcommand\rref@refformat[2][\rref@current@type]{\rref@set{#1}{ref format}{\@@rrefformat}\@@rrefformat{#2}}
+\newcommand\rref@labelformat[2][\rref@current@type]{\rref@set{#1}{label format}{\@@labelformat}\@@labelformat{\rref@name{#1}}{#2}}
+\newcommand\rref@linkformat[2][\rref@current@type]{%
+ \@ifnameinlink{%
+ \rref@linkpr{\rref@labelformat[#1]{\rref@refformat[#1]{#2}}}%
+ }{%
+ \rref@labelformat[#1]{\rref@linkpr{\rref@refformat[#1]{#2}}}%
+ }%
+}
+\newcommand\rref@reflink[2][\rref@current@type]{%
+ \rref@linkpr{\rref@refformat[#1]{#2}}%
+}
+\newcommand\rref@groupformat[2][\rref@current@type]{%
+ \rref@set{#1}{group format}{\@@groupformat}\@@groupformat{#2}%
+}
+
+\def\rref{\@ifstar\rref@star\rref@nostar}
+\def\rref@star#1{%
+ \rref@setcurrent{#1}%
+ \ifnum\rref@current@value>0%
+ \rref@refformat{\rref@current@value}%
+ \else%
+ \zref{#1}%
+ \fi%
+}
+\def\rref@nostar#1{%
+ \rref@setcurrent{#1}%
+ \ifnum\rref@current@value>0%
+ \rref@linkpr{\rref@refformat{\rref@current@value}}%
+ \else%
+ \zcref[noname]{#1}%
+ \fi%
+}
+\def\Rref{\@ifstar\Rref@star\Rref@nostar}
+\def\Rref@star#1{%
+ \setboolean{rref@cap}{true}%
+ \rref*{#1}%
+}
+\def\Rref@nostar#1{%
+ \setboolean{rref@cap}{true}%
+ \rref{#1}%
+}
+
+\def\nref{\@ifstar\nref@star\nref@nostar}
+\def\nref@star#1{%
+ \rref@setcurrent{#1}%
+ \ifnum\rref@current@value>0%
+ \rref@labelformat{\rref@refformat{\rref@current@value}}%
+ \else%
+ \zcref*{#1}%
+ \fi%
+}
+\def\nref@nostar#1{%
+ \rref@setcurrent{#1}%
+ \ifnum\rref@current@value>0%
+ \rref@linkformat{\rref@current@value}%
+ \else%
+ \zcref{#1}%
+ \fi%
+}
+\def\Nref{\@ifstar\Nref@star\Nref@nostar}
+\def\Nref@star#1{%
+ \setboolean{rref@cap}{true}%
+ \nref*{#1}%
+}
+\def\Nref@nostar#1{%
+ \setboolean{rref@cap}{true}%
+ \nref{#1}%
+}
+
+\def\rref@setcurrent#1{%
+ \def\rref@current{#1}%
+ \def\rref@current@counter{\zref@extract{#1}{counter}}%
+ \def\rref@current@article{\zref@extract{#1}{article}}%
+ \def\rref@current@para{\zref@extract{#1}{para}}%
+ \def\rref@current@sub{\zref@extract{#1}{sub}}%
+ \rref@settype%
+ \rref@setlink%
+}
+\def\rref@settype{%
+ \ifthenelse{\equal{article}{\rref@current@counter}}{%
+ \def\rref@current@type{article}%
+ \def\rref@current@value{\rref@current@article}%
+ \def\rref@current@fullformat{}%
+ }{%
+ \ifthenelse{\equal{para}{\rref@current@counter}\or\equal{parasi}{\rref@current@counter}}{%
+ \def\rref@current@type{para}%
+ \def\rref@current@value{\rref@current@para}%
+ }{%
+ \ifthenelse{\equal{parasii}{\rref@current@counter}}{%
+ \def\rref@current@type{sub}%
+ \def\rref@current@value{\rref@current@sub}%
+ }{%
+ \def\rref@current@type{}%
+ \def\rref@current@value{-1}%
+ }%
+ }%
+ }%
+}
+\def\rref@setlink{%
+ \def\rref@current@anchor{\zref@extract{\rref@current}{anchor}}%
+ \def\rref@current@url{\zref@extractdefault{\rref@current}{url}{}}%
+ \def\rref@current@fullurl{\rref@current@url\hashchar\rref@current@anchor}%
+}
+\newcommand\rref@number[1]{%
+ \zref@extractdefault{#1}{\rref@current@type}{-1}%
+}
+
+\newcommand\aref@setcurrent[1]{%
+ \def\aref@current@reflink{\rref@reflink[\rref@current@type]{\rref@current@value}}%
+ \zref@ifrefcontainsprop{#1}{externaldocument}{%
+ \filename@parse{\expanded{\zref@extract{#1}{externaldocument}}}%
+ \edef\@aref@filelabel{\expanded{\filename@base}}%
+ \def\@aref@postlink{%
+ , \documentlabel{\@aref@filelabel}%
+ \ifthenelse{\equal{\artifactfootnote{\@aref@filelabel}}{true}\and\equal{\artifactreferred{\@aref@filelabel}}{false}}{%
+ \documentfootnote{\@aref@filelabel}%
+ }{}%
+ }%
+ }{%
+ \def\@aref@postlink{}%
+ }%
+ \ifthenelse{\equal{\rref@current@type}{article}}{%
+ \def\@aref@prefix{}%
+ \def\@aref@postfix{}%
+ }{%
+ \ifthenelse{\equal{\rref@current@type}{para}}{%
+ \def\@aref@prefix{%
+ \rref@labelformat[article]{\rref@current@article}\rref@get{article}{group conjunction}%
+ }%
+ \def\@aref@postfix{}%
+ }{%
+ \ifthenelse{\equal{\rref@current@type}{sub}}{%
+ \def\@aref@prefix{%
+ \rref@labelformat[article]{\rref@refformat[article]{\rref@current@article}}\rref@get{article}{group conjunction}%
+ \rref@labelformat[para]{\rref@refformat[para]{\rref@current@para}}\rref@get{para}{group conjunction}%
+ }%
+ \def\@aref@postfix{}%
+ }{%
+ \def\@aref@prefix{}%
+ \def\@aref@postfix{}%
+ }%
+ }%
+ }%
+}
+
+\newcommand{\aref}[1]{%
+ \def\@@arefsetup##1##2{%
+ \rref@setcurrent{##1}%
+ \aref@setcurrent{##1}%
+ \rref@groupformat{\@aref@prefix}%
+ ##2%
+ \@aref@postfix\@aref@postlink%
+ }%
+ \IfSubStr{#1}{,}{%
+ \StrBefore[1]{#1}{,}[\firstarg]%
+ \@@arefsetup{\firstarg}{\rref@labelformat{\aref@group{#1}}}%
+ }{%
+ \@@arefsetup{#1}{\nref{#1}}%
+ }%
+}
+
+\newcommand{\Aref}[1]{%
+ \setboolean{rref@cap}{true}%
+ \aref{#1}%
+}
+
+\def\listterminator{-1}
+
+\newcommand\aref@group[1]{%
+ \bubblesort{#1}%
+ \expandafter\begincompaction\sortedlist,\listterminator,\relax%
+}
+\def\begincompaction#1,#2\relax{%
+ \def\startlist{#1}%
+ \def\currentendlist{#1}%
+ \findendlist#2\relax%
+}
+\def\findendlist#1,#2\relax{%
+ \ifnum\numexpr\rref@number{\currentendlist}+1\relax=\rref@number{#1}\relax%
+ \def\currentendlist{#1}%
+ \findendlist#2\relax%
+ \else%
+ \ifnum\rref@number{\startlist}=\rref@number{\currentendlist}\relax%
+ \ignorespaces\rref{\startlist}\unskip%
+ \else%
+ \ifnum\numexpr\rref@number{\startlist}+1\relax=\rref@number{\currentendlist}\relax%
+ \ignorespaces\rref{\startlist}\unskip%
+ \ifnum\rref@number{#1}=\listterminator\relax%
+ \rref@lastconjunction%
+ \else%
+ \rref@middleconjunction%
+ \fi\ignorespaces%
+ \rref{\currentendlist}\unskip%
+ \else%
+ \ignorespaces\rref{\startlist}\unskip\rref@rangeconjunction\ignorespaces%
+ \rref{\currentendlist}\unskip%
+ \fi%
+ \fi%
+ \ifnum\rref@number{#1}=\listterminator\else%
+ \IfStrEq{#2}{\listterminator,}{\rref@lastconjunction}{\rref@middleconjunction}\begincompaction#1,#2\relax%
+ \fi%
+ \fi%
+}
+\newcommand\bubblesort[1]{\def\sortedlist{}\sortlist#1,\listterminator,\relax}
+\def\sortlist#1,#2,#3\relax{%
+ \rref@setcurrent{#1}%
+ \aref@setcurrent{#1}%
+ \ifnum\rref@number{#2}=\listterminator\relax%
+ \edef\sortedlist{\sortedlist#1}%
+ \else%
+ \ifnum\rref@number{#1}<\rref@number{#2}\relax%
+ \edef\sortedlist{\sortedlist#1,}%
+ \sortlist#2,#3\relax%
+ \else%
+ \let\tmp\sortedlist%
+ \def\sortedlist{}%
+ \expandafter\sortlist\tmp#2,#1,#3\relax%
+ \fi%
+ \fi%
+}
+
+\GetAllResetLists
+\RegisterPostLabelHook{\zlabel}
+
+\newglossary*{definitions}{Definitions}
+\newglossary*{externals}{Externals}
+
+\newcommand\artifact@footnote@noop[1]{#1}
+\newcommand\artifact@def@label@default[1]{~(\GetTranslation{see} #1)}
+
+\newcommand\newartifact[2]{%
+ \pgfkeys{
+ /artifact/#1/.is family,
+ /artifact/#1,
+ name/.initial = #1,
+ filename/.initial = #1.pdf,
+ path/.initial = ./,
+ ref label/.initial=,
+ def label/.initial=\artifact@def@label@default,
+ footnote/.initial = true,
+ footnote label/.initial=\artifact@footnote@noop,
+ url/.initial=,
+ referred/.initial = false,
+ defs/.initial=,
+ author/.initial=<author>,
+ subject/.initial=<subject>,
+ description/.initial=<description>
+ }
+ \pgfkeys{/artifact/#1,#2}
+}
+\newcommand\@aget[2]{\pgfkeysvalueof{/artifact/#1/#2}}
+\newcommand\artifact@setfootnotelabel[1]{\pgfkeysgetvalue{/artifact/#1/footnote label}{\artifactfootnotelabel}}
+\newcommand\artifactname[1]{\@aget{#1}{name}}
+\newcommand\artifactfullname[1]{\@aget{#1}{path}\@aget{#1}{name}}
+\newcommand\artifactfilename[1]{\@aget{#1}{filename}}
+\newcommand\artifactfullfilename[1]{\@aget{#1}{path}\@aget{#1}{filename}}
+\newcommand\artifactfootnote[1]{\@aget{#1}{footnote}}
+\newcommand\artifacturl[1]{\@aget{#1}{url}}
+\newcommand\artifactreferred[1]{\@aget{#1}{referred}}
+\newcommand\artifactdefs[1]{\@aget{#1}{defs}}
+\newcommand\artifactauthor[1]{\@aget{#1}{author}}
+\newcommand\artifactsubject[1]{\@aget{#1}{subject}}
+\newcommand\artifactdescription[1]{\@aget{#1}{description}}
+
+\renewcommand{\glossarysection}[2][]{\@gobble{#1}\@gobble{#2}}%
+\setglossarypreamble[definitions]{%
+ \ifnum\value{article}=0%
+ \article{\GetTranslation{Definitions}}\label{art:definitions}%
+ \vspace*{-\baselineskip}%
+ \else%
+ \ifnum\value{parasi}=0%
+ \vspace*{-\baselineskip}%
+ \fi%
+ \fi%
+}
+
+\newcommand\describe[1]{\setboolean{regulatory@defslisted}{true}\glstarget{#1}{\glsentrydesc{#1}}}
+\newcommand\printdefs[1]{%
+ \renewcommand*{\glsnamefont}[1]{\textmd{##1}}%
+ \setboolean{regulatory@defslisted}{true}%
+ \glssetwidest{#1}%
+ \ifnum\value{parasi}>0%
+ \def\@@wrapper##1{\begin{minipage}{\linewidth}##1\end{minipage}}%
+ \else%
+ \def\@@wrapper##1{##1}%
+ \fi%
+ \@@wrapper{%
+ \ifregulatory@bibtogls%
+ \printunsrtglossary[type=definitions,style=alttree,title={},nonumberlist=true]%
+ \else%
+ \printglossary[type=definitions,style=alttree,title={},nonumberlist=true]%
+ \fi%
+ }%
+}
+
+\attachfilesetup{color=black}
+
+\newcommand\documentattachment[2]{%
+ \def\@tmpfile{\artifactfullfilename{#1}}%
+ \IfFileExists{\@tmpfile}{%
+ \textattachfile[description={\artifactdescription{#1}},subject={\artifactsubject{#1}},author={\artifactauthor{#1}}]{\@tmpfile}{#2}}%
+ {\texttt{#2}}%
+}
+
+\newcommand\documentlabel[1]{%
+ \def\@@label{\@aget{#1}{ref label}}%
+ \ifthenelse{\equal{\@@label}{}}{%
+ \GetTranslation{of the} \artifactsubject{#1}%
+ }{\@@label}%
+}
+
+\newcommand\documentfootnote[2][]{%
+ \pgfkeysifdefined{/artifact/#2/referred}{%
+ \pgfkeys{/artifact/#2,referred=true}%
+ \artifact@setfootnotelabel{#2}%
+ \ifthenelse{\equal{#1}{}}{%
+ \def\artifact@description{\artifactsubject{#2}}%
+ }{%
+ \def\artifact@description{#1}%
+ }%
+ \footnote{\artifactfootnotelabel{\documentattachment{#2}{\artifact@description}}}%
+ }{\PackageWarning{regulatory}{Artifact does not exists '#2'}\footnote{DOCUMENT NOT FOUND '#2'}}
+}
+
+\edef\@regulatory@bib@selection{}
+\ifregulatory@alldefs
+\edef\@regulatory@bib@selection{,selection=all}
+\fi
+
+\newcommand\loadglsdefs[1]{%
+ \setboolean{regulatory@defslisted}{true}%
+ \ifregulatory@bibtogls%
+ \GlsXtrLoadResources[type=definitions,src={#1},sort={nl-NL},category={defs}\@regulatory@bib@selection]%
+ \else%
+ \loadglsentries[definitions]{#1}%
+ \fi%
+}
+
+\newcommand\loadextdefs[2][externals]{%
+ \ifregulatory@bibtogls%
+ \GlsXtrLoadResources[type=externals,src={#2},sort={nl-NL},category={#1}]%
+ \else%}{%
+ \loadglsentries[externals]{#2}%
+ \fi%}%
+ \glsdefpostlink{#1}{%
+ \ifthenelse{\equal{\artifactreferred{#1}}{true}}{}{%
+ \@aget{#1}{def label}{%
+ \artifactsubject{#1}%
+ \documentfootnote{#1}%
+ }%
+ }%
+ }%
+}
+
+\newcommand\refdocument[3][ext-]{%
+ \newartifact{#2}{footnote=false,#3}%
+ \zexternaldocument[#1]{\artifactfullname{#2}}[#2]%
+}
+
+\newcommand\masterdocument[3][ext-]{%
+ \newartifact{#2}{#3}%
+ \zexternaldocument[#1]{\artifactfullname{#2}}[#2]%
+ \ifthenelse{\equal{\string\artifactdefs{#2}}{}}{%
+ \PackageWarning{regulatory}{No definitions given to the master document. \the\gls commands will therefore not work.}%
+ }{%
+ \PackageWarning{regulatory}{Agreement file loads #1, #2, #3.}
+ \loadextdefs[#2]{\artifactdefs{#2}}%
+ \ifregulatory@bibtogls%
+ \glssetcategoryattribute{#2}{targeturl}{\artifactfilename{#2}}%
+ \glssetcategoryattribute{#2}{targetname}{\glolinkprefix\glslabel}%
+ \fi%
+ }%
+}
+
+\AtEndPreamble{%
+\ifregulatory@bibtogls\else%
+\ifthenelse{\boolean{regulatory@defslisted}}{\makeglossaries}{}%
+\fi%
+}
+\AtEndDocument{%
+\ifregulatory@alldefs\glsaddallunused\fi%
+}
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.pdf b/macros/latex/contrib/robust-externalize/robust-externalize.pdf
index cb3a4071e7..58ea1ff714 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.pdf
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.pdf
Binary files differ
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.sty b/macros/latex/contrib/robust-externalize/robust-externalize.sty
index 3bf14a9f95..0a36647946 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.sty
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.sty
@@ -1,4 +1,4 @@
-\ProvidesPackage{robust-externalize}[2.2 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
+\ProvidesPackage{robust-externalize}[2.5 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
% todo:
% change order argument replace from list, it is hard to read this way
@@ -11,7 +11,7 @@
\RequirePackage{iftex} % computing md5 sum differs on lualatex/pdflatex/xelatex
\RequirePackage{xparse} % solve https://github.com/leo-colisson/robust-externalize/issues/6
\RequirePackage{atveryend} % to compile in parallel all images
-\usepackage{etl} % For auto forward https://tex.stackexchange.com/a/700844/116348
+%\usepackage{etl} % For auto forward https://tex.stackexchange.com/a/700844/116348
%% TODO list:
% - provide an easy way to use cross-ref, bibtex etc (we just need to add them when writing the file) without recompiling the whole document (we don't want to lose the cache everytime a new bib entry is added) but while preserving.
@@ -20,14 +20,127 @@
%%%%%%%%%%% Utils %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% If the file contains a space, the jobname gets quotes around...
+% https://tex.stackexchange.com/questions/418670/avoid-quotation-marks-when-using-jobname-or-currfilename
+\newcommand*{\jobnameNoQuotes}{}
+\newcommand*{\setjobnameNoQuotes}{%
+ \edef\jobnameNoQuotes{\jobname}%
+ \expandafter\expandafter\expandafter\setjobnameNoQuotesaux
+ \expandafter\jobnameNoQuotes\expandafter"\jobnameNoQuotes"\relax
+}
+\newcommand*{\setjobnameNoQuotesaux}{}
+\def\setjobnameNoQuotesaux#1"#2"#3\relax{\def\jobnameNoQuotes{#2}}
+\setjobnameNoQuotes
+
\ExplSyntaxOn
\NewDocumentCommand{\robExtIfWindowsTF}{mm}{%
\sys_if_platform_windows:TF {#1}{#2}%
}
+
+% This will be printed in from of the error message, mostly useful in texstudio that only print lines
+% containing errors
+\def\robExtPrefixLogMessage{}
+
+% Prints the next 4 lines after an error:
+\def\robExtLinesAfterError{3}
+\def\robExtRemoveLineNumber{}
+
+%% Needed for studio to prepend ! in front of all lines, including big ones.
+%% https://tex.stackexchange.com/questions/705502/message-add-symbol-in-front-of-new-lines-even-if-there-is-a-line-break
+\def\robExtMessageWithPrefixNumberLines{^^J}%
+\cs_new:Nn \robExt__message_with_prefix:n {
+ \str_set:Nn \l_tmpa_str {#1}
+ \int_compare:nNnTF {\str_count:N \l_tmpa_str + \str_count:N \robExtPrefixLogMessage} > {78} {
+ \typeout{\robExtPrefixLogMessage \str_range:Nnn \l_tmpa_str {1} {78 - \str_count:N \robExtPrefixLogMessage}\robExtMessageWithPrefixNumberLines}
+ \robExt__message_with_prefix:x {\str_range:Nnn \l_tmpa_str {78 - \str_count:N \robExtPrefixLogMessage + 1} {-1}}
+ }{
+ \typeout{\robExtPrefixLogMessage \l_tmpa_str \robExtMessageWithPrefixNumberLines}
+ }
+}
+\cs_generate_variant:Nn \robExt__message_with_prefix:n { x }
+
+% We might want to remove l.XX in front of lines as emacs interpret this as a line of error and goes to a wrong place.
+\cs_new:Nn \robExt__clean_line_if_needed:n {
+ \ifdefined\robExtRemoveLineNumber%
+ \str_compare:eNeTF {\str_range:nnn {#1} {1} {2}} = {l.} {
+ \str_range:nnn {#1} {3} {-1}%
+ } {
+ #1
+ }
+ \else
+ #1
+ \fi
+}
+\cs_generate_variant:Nn \robExt__clean_line_if_needed:n { V }
+
+\cs_new:Nn \robExt_get_errors_from_file:n {
+ \ior_open:Nn \g__robExt_read_ior {#1}%
+ \cs_undefine:N \l__robExt_I_saw_an_error:
+ \str_clear_new:N \l__robExt_tmp_str%
+ \int_set:Nn \l_tmpa_int {0}
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \ifdefined\robExtPrintWholeFile
+ \str_gput_right:Nx \l__robExt_tmp_str {\tl_to_str:n{##1}^^J}%
+ \cs_set:Nn \l__robExt_I_saw_an_error: {}
+ \int_set:Nn \l_tmpa_int {\robExtLinesAfterError}
+ \else
+ \str_if_in:xnTF {\str_lowercase:n{##1}} {error} {
+ \str_gput_right:Nx \l__robExt_tmp_str {\robExt__clean_line_if_needed:V{\tl_to_str:n{##1}^^J}}%
+ \cs_set:Nn \l__robExt_I_saw_an_error: {}
+ \int_set:Nn \l_tmpa_int {\robExtLinesAfterError}
+ } {
+ \str_if_in:xnTF {\str_lowercase:n{##1}} {invalid} {
+ \str_gput_right:Nx \l__robExt_tmp_str {\robExt__clean_line_if_needed:V{\tl_to_str:n{##1}^^J}}%
+ \cs_set:Nn \l__robExt_I_saw_an_error: {}
+ \int_set:Nn \l_tmpa_int {\robExtLinesAfterError}
+ } {
+ % Check if it starts with a ! (usually latex errors start with this symbol)
+ \str_compare:eNeTF {\str_range:nnn {##1} {1} {1}} = {!} {
+ \str_gput_right:Nx \l__robExt_tmp_str {\robExt__clean_line_if_needed:V{\tl_to_str:n{##1}^^J}}%
+ \cs_set:Nn \l__robExt_I_saw_an_error: {}
+ \int_set:Nn \l_tmpa_int {\robExtLinesAfterError}
+ }{
+ % Check if we saw an error not too long ago:
+ \int_compare:nNnTF {\l_tmpa_int} > {0} {
+ \str_gput_right:Nx \l__robExt_tmp_str {\robExt__clean_line_if_needed:V{\tl_to_str:n{##1}^^J}}%
+ } {
+ \str_set:Nn \l_tmp_str {##1}
+ }
+ \int_set:Nn \l_tmpa_int {\l_tmpa_int - 1}
+ }
+ }
+ }
+ \fi
+ }%
+ \cs_if_exist:NTF \l__robExt_I_saw_an_error: {} {
+ % We print the last line if we found no error. Might be useful for errors like:
+ % sh: ligne 1: gnuplot : commande introuvable.
+ \str_set_eq:NN \l__robExt_tmp_str \l_tmp_str
+ }
+}
+
+\cs_new:Nn \robExt_write_file_in_log:n {
+ \ior_open:Nn \g__robExt_read_ior {#1}%
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \ifdefined\robExtPrintWholeFile
+ \ifdefempty{\robExtPrefixLogMessage}{
+ \typeout{\tl_to_str:n{##1}}%
+ }{
+ \robExt__message_with_prefix:x {\tl_to_str:n{##1}}
+ }
+ \else
+ \typeout{\tl_to_str:n{##1}}%
+ \fi
+ }%
+}
+
+\cs_generate_variant:Nn \robExt_write_file_in_log:n { x }
+
\ExplSyntaxOff
% Debug function: by default, do nothing
\def\robExtDebugMessage#1{}
+\def\robExtDebugInfo#1{\message{#1}}
\def\robExtDebugWarning#1{\message{^^J[robExt warning] #1}}
\NewDocumentCommand{\robExtConfigure}{m}{%
@@ -53,6 +166,7 @@
\cs_generate_variant:Nn \str_replace_all:Nnn { Nnx, Nnv, cnx, cxx, NnV, Nnx, Nnv }
\cs_generate_variant:Nn \str_set:Nn { NV }
+\cs_generate_variant:Nn \str_if_in:nnTF { xnTF }
\cs_generate_variant:Nn \tl_rescan:nn { nv }
\cs_generate_variant:Nn \tl_set_rescan:Nnn { Nnv, NnV }
@@ -65,6 +179,7 @@
\cs_generate_variant:Nn \ior_str_get:NN { Nc }
\cs_generate_variant:Nn \file_if_exist:nTF { xTF }
+\cs_generate_variant:Nn \file_mdfive_hash:n { x }
\cs_generate_variant:Nn \cs_replacement_spec:N { c }
\cs_generate_variant:Nn \cs_argument_spec:N { c }
@@ -110,25 +225,33 @@
%% In LaTeX3 error messages are defined here, this allows people to translate them, filter them, change them,
%% make them more verbose etc.
\msg_new:nnn {robExt}{underscore in name}{Error:~all~the~placeholders~should~contain~two~consecutive~underscores~in~their~name.}
-\msg_new:nnn {robExt}{placeholder not existing}{[robExtGetPlaceholderInResultFromSinglePlaceholder] ~ The ~ placeholder ~ #3 ~ does ~ not ~ exists.}
+\msg_new:nnn {robExt}{placeholder not existing}{[robExtGetPlaceholderInResultFromSinglePlaceholder] ~ The ~ placeholder ~ #1 ~ does ~ not ~ exists.}
\msg_new:nnn {robExt}{forgot template}{You ~ are ~ writing ~ __ROBEXT_TEMPLATE__ ~ to ~ your ~ file: ~ seems ~ like ~ you ~ forgot ~ to ~ define ~ your ~ template ~ or ~ set ~ a ~ preset}
\msg_new:nnn {robExt}{need shell escape}{You ~ need ~ to ~ compile ~ with ~ shell-escape ~ as ~ in: ~ "pdflatex ~ -shell-escape ~ yourfile.tex" ~ to ~ be ~ able ~ to ~ compile ~ automatically ~ the ~ figures}
+\msg_new:nnn {robExt}{need shell escape with}{You ~ need ~ to ~ compile ~ with ~ shell-escape ~ as ~ in: ~ "pdflatex ~ -shell-escape ~ yourfile.tex" ~ to ~ be ~ able ~ to ~ #1}
\msg_new:nnn {robExt}{need shell escape parallel}{You ~ need ~ to ~ compile ~ with ~ shell-escape ~ as ~ in: ~ "pdflatex ~ -shell-escape ~ yourfile.tex" ~ to ~ be ~ able ~ to ~ compile ~ automatically ~ the ~ figures ~ in ~ parallel}
-\msg_new:nnn {robExt}{missing compiled pdf}{The ~ pdf ~ file ~ #1.pdf ~ is ~ not ~ present. ~ The ~ compilation ~ command ~ certainly ~ failed, ~ see ~ logs ~ above ~ or ~ in ~ #1.log.}
-\msg_new:nnn {robExt}{missing compiled pdf parallel}{The ~ pdf ~ file ~ #1.pdf ~ is ~ not ~ present. ~ The ~ compilation ~ command ~ "#3"~used~to~compile~the~environment~on~line~#2~ certainly ~ failed, ~ see ~ logs ~ above ~ or ~ in ~ #1.log.}
+\msg_new:nnn {robExt}{missing compiled pdf parallel}{The~compilation~of~block~at~line~#2~failed~as~the~following ~ file~is~missing: ~ #1.pdf. ~ The ~ compilation ~ command ~ "#3"~used~to~compile~the~environment~on~line~#2~ certainly ~ failed, ~ see ~ logs ~ above ~ or ~ in ~ #1.log.}
+\msg_new:nnn {robExt}{dependency does not exist}{The~dependency~#1~does~not~exist.}
+
+\msg_new:nnn {robExt}{missing compiled pdf parallel with log}{The~compilation~of~the~code~block~at~line~#2~failed:~the~following ~ file~is~indeed~missing: ~ #1.pdf. ~ The ~ compilation ~ command ~ "#3"~used~to~compile~the~environment~on~line~#2~ certainly ~ failed~with~errors:^^Jvvvvvv^^J\l__robExt_tmp_str^^J\string^\string^\string^\string^\string^\string^ ^^JSee~full~logs~#4~ or ~ in ~ #1-compilation.log.}
+
+
\msg_new:nnn {robExt}{auto forward not in cachemecode}{Auto~forward~is~less~efficient~in~cacheMeCode.}
+\msg_new:nnn {robExt}{file does not exist}{The~file~#1~does~not~exist.}
+
% warnings
\msg_new:nnn {robExt}{recommend two underscores in placeholders}{We~recommend~to~use~only~placeholders~containing~two~consecutive~underscores~in~their~name}
\msg_new:nnn {robExt}{enabled parallel no shell escape}{Warning:~you~enabled~parallel~compilation~but~shell-escape~is~disabled.}
\msg_new:nnn {robExt}{rerun because parallel}{Warning:~Compiling~all~missing~figures~in~parallel~with~"#1".~You~need~to~rerun~LaTeX~to~include~them.}
+\msg_new:nnn {robExt}{gpgetvar recompilation needed}{Warning:~you~need~to~recompile~as~the~gpgetvar~variable~"#1"~does~not~exist~yet.}
% dummy placeholders added if image is not present
\def\robExtImagePlaceholderIfManualMode{
\framebox[\linewidth]
{
\begin{minipage}{\linewidth}
- \textbf{Manual ~ mode: ~ either ~ compile ~ with ~ \texttt{-shell-escape} ~ or ~ compile:\newline \texttt{\robExtAddCachePathAndName{\robExtFinalHash.tex}}\newline via ~ \newline \texttt{\l__robExt_current_compilation_command_str}\newline or ~ call ~ \newline\texttt{bash ~ \jobname-\robExtAddPrefixName{compile-missing-figures.sh}}\newline to ~ compile ~ all ~ missing ~ figures.}
+ \textbf{Manual ~ mode: ~ either ~ compile ~ with ~ \texttt{-shell-escape} ~ or ~ compile:\newline \texttt{\robExtAddCachePathAndName{\robExtFinalHash.tex}}\newline via ~ \newline \texttt{\l__robExt_current_compilation_command_str}\newline or ~ call ~ \newline\texttt{bash ~ \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}}\newline to ~ compile ~ all ~ missing ~ figures.}
\end{minipage}
}
}
@@ -137,7 +260,7 @@
\framebox[\linewidth]
{
\begin{minipage}{\linewidth}
- \textbf{Falling ~ back ~ to ~ draft ~ mode: ~ either ~ compile ~ with ~ \texttt{-shell-escape} ~ or ~ compile:\newline \texttt{\robExtAddCachePathAndName{\robExtFinalHash.tex}}\newline via ~ \newline \texttt{\l__robExt_current_compilation_command_str}\newline or ~ call ~ \newline\texttt{bash ~ \jobname-\robExtAddPrefixName{compile-missing-figures.sh}}\newline to ~ compile ~ all ~ missing ~ figures.}
+ \textbf{Falling ~ back ~ to ~ draft ~ mode: ~ either ~ compile ~ with ~ \texttt{-shell-escape} ~ or ~ compile:\newline \texttt{\robExtAddCachePathAndName{\robExtFinalHash.tex}}\newline via ~ \newline \texttt{\l__robExt_current_compilation_command_str}\newline or ~ call ~ \newline\texttt{bash ~ \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}}\newline to ~ compile ~ all ~ missing ~ figures.}
\end{minipage}
}
}
@@ -163,9 +286,10 @@
%%% Important: this script is NOT executed by this file, it is only created so that users can remove unused previously cached files by running this script
%%% outside of LaTeX.
%%% Create scripts to remove useless files:
-%%% Note that we don't override the script if it exists on purpose (the user might have changed it to fits their needs)
-\begin{filecontents}[noheader]{robExt-remove-old-figures.py}
+\begin{filecontents}[noheader,overwrite]{robExt-remove-old-figures.py}
#!/usr/bin/env python3
+## This file is automatically generated, so do not change that file directly
+## Instead, if you need to change it, copy it with a different name and edit the copy
import os
import re
import glob
@@ -214,6 +338,63 @@ if __name__ == '__main__':
main()
\end{filecontents}
+\begin{filecontents}[noheader,overwrite]{robExt-prepare-for-arxiv.py}
+#!/usr/bin/env python3
+## This file is automatically generated, so do not change that file directly
+## Instead, if you need to change it, copy it with a different name and edit the copy
+
+## This file must be called when sending stuff to the arxiv website, that would otherwise remove the .pdf
+## in presence of a .tex.
+## This script will simply rename the .tex files in robustExternalize into .tex-backup.
+## Then, you should call "rename backup files for arxiv" to rename back the files.
+import os
+import re
+import glob
+# Just run this script in order to remove all old figures not listed in robExt-all-figures.txt.
+
+# Note that this part is not extracted from the pdf file since it might be different on a previous run. You can however hardcode
+# it here, your updated script will not be overriden unless you remove it yourself.
+prefixes = [ "robExt-" ]
+folders = [ "robustExternalize" ]
+
+def main():
+ listOfFilesToMove = []
+ listOfFilesAlreadyAdded = set()
+ for folder in folders:
+ for root, dirs, files in os.walk(folder):
+ for f in files:
+ if f.endswith(".tex"):
+ pdf = os.path.splitext(f)[0] + ".pdf"
+ if os.path.exists(os.path.join(root,pdf)):
+ listOfFilesToMove.append((os.path.join(root,f), os.path.join(root,f + "-backup")))
+ if f.endswith(".tex-backup"):
+ tex = os.path.splitext(f)[0] + ".tex"
+ listOfFilesAlreadyAdded.add(os.path.join(root,tex))
+ for (f,f2) in listOfFilesToMove:
+ print(f"-- {f} moved to {f2}")
+ listOfFilesAlreadyAdded.discard(f)
+ for f in listOfFilesAlreadyAdded:
+ print(f"-- {f} already moved")
+ print(f"Above are the files to move or already moved, are you sure you want to proceed? [y/N] (based on prefixes {prefixes})")
+ x = input().strip()
+ if x not in ["y", "Y"]:
+ print("All right, we abort.")
+ exit(1)
+ for (f,f2) in listOfFilesToMove:
+ os.replace(f, f2)
+ print(f"Moved {f} to {f2}")
+ with open('robExt-arxiv-files-to-rename.txt', 'w') as fd:
+ for (f,f2) in listOfFilesToMove:
+ fd.write(f'{f}\n')
+ for f in listOfFilesAlreadyAdded:
+ fd.write(f'{f}\n')
+ print('The files have been written to robExt-arxiv-files-to-rename.txt.')
+ print('Add \\robExtConfigure{rename backup files for arxiv} in your tex file.')
+
+if __name__ == '__main__':
+ main()
+\end{filecontents}
+
\ExplSyntaxOn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -258,6 +439,9 @@ if __name__ == '__main__':
%%%%%%%%%%% Paths %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% For support of --output-directory
+\def\robExtPrefixAllCompilationCommands{\ifdefined\robExtOutputDirectory cd~"\robExtOutputDirectory"~&&~\fi}
+
\def\robExtPrefixFilename{robExt-}
\NewExpandableDocumentCommand{\robExtAddCachePathAndName}{m}{%
@@ -272,6 +456,48 @@ if __name__ == '__main__':
\fi#1%
}
+% mv in unix and move in windows:
+\robExtIfWindowsTF{
+ \def\robExtMv{move}
+ \def\robExtCp{copy}
+}{
+ \def\robExtMv{mv}
+ \def\robExtCp{cp}
+}
+
+\NewDocumentCommand{\robExtBackupSource}{m}{%
+ % arXiv will remove the .pdf file if the .tex is present. Solution: we move the .tex into .tex-backup
+ % and restore it during compilation. We could also backup the pdf but usually this file is bigger and will contain
+ % binary data that might not be so easy to copy in pure tex (in arxiv shell escape is disabled so we cannot
+ % use cp).
+ % \show\inBackupSource
+ \robExtRunCmdIfPossible{%
+ \robExtMv\space"\robExtAddCachePath{#1}"~%
+ "\robExtAddCachePath{#1-backup}"%
+ }%
+}
+
+\NewDocumentCommand{\robExtRunCmdIfPossible}{m}{%
+ % Check if the output directory exists
+ \bool_if:nTF { \sys_if_shell_unrestricted_p: || \cs_if_exist_p:N \robExtForceCompilation}
+ {
+ \ifdefined\robExtManualMode
+ \message{Warning:~running~in~manual~mode~so~we~cannot~run~the~command~``#1''.}
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {#1}
+ \else
+ \message{Running:~\robExtPrefixAllCompilationCommands #1}%
+ \sys_shell_now:x {\robExtPrefixAllCompilationCommands #1}
+ \fi
+ }{
+ \ifdefined\robExtFallbackManualMode
+ \message{Warning:~shell~escape~fallback~to~manual~mode~so~cannot~run~#1.}
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {#1}
+ \else
+ \msg_error:nnx{robExt}{need shell escape with}{run~#1}
+ \fi
+ }
+}
+
\NewDocumentCommand{\robExtCheckIfPrefixFolderExists}{}{
% Check if the output directory exists
\ifdefined\robExtCacheFolder
@@ -279,17 +505,74 @@ if __name__ == '__main__':
{
\ifdefined\robExtDoNotMkdirFolder\else
\ifdefined\robExtManualMode
- \message{If ~ you ~ get~ an~ error,~ make ~ sure ~ to ~ enable ~ pdflatex ~ -shell-escape ~ or ~ to ~ manually ~ create ~ the ~ folder ~ \robExtCacheFolder.}
+ \message{If ~ you ~ get~ an~ error,~ make ~ sure ~ to ~ enable ~ pdflatex ~ -shell-escape ~ or ~ to ~ MANUALLY ~ CREATE ~ THE ~ FOLDER ~ \robExtCacheFolder.}
\else
- \sys_shell_now:x {mkdir ~ -p ~ \robExtCacheFolder}
+ \sys_shell_now:x {\robExtPrefixAllCompilationCommands mkdir ~ -p ~ \robExtCacheFolder}
\fi
\fi
}{
- \message{If ~ you ~ get~ an~ error,~ make ~ sure ~ to ~ enable ~ pdflatex ~ -shell-escape ~ or ~ to ~ manually ~ CREATE ~ THE ~ FOLDER ~ \robExtCacheFolder.}
+ \message{Warning: If ~ you ~ get~ an~ error,~ make ~ sure ~ to ~ enable ~ pdflatex ~ -shell-escape ~ or ~ to ~ manually ~ CREATE ~ THE ~ FOLDER ~ \robExtCacheFolder.}
}
\fi
}
+\NewDocumentCommand{\robExtCopyFileToCache}{m}{
+ \robExtCheckIfPrefixFolderExists%
+ \file_if_exist:xTF {#1}{}{
+ \msg_error:nnx{robExt}{file does not exist}{#1~(to~copy~to~cache)}
+ }
+ \file_if_exist:xTF {\robExtAddCachePath{#1}}{
+ \robExtDebugInfo{The~file~\robExtAddCachePath{#1}~already~exists,~let~us~compare~md5~sum.}
+ \str_set:Nx \l_tmpa_str {\file_mdfive_hash:n{#1}}
+ \str_set:Nx \l_tmpb_str {\file_mdfive_hash:n{\robExtAddCachePath{#1}}}
+ \str_compare:eNeTF {\l_tmpa_str} = {\l_tmpb_str} {
+ \robExtDebugInfo{The~file~\robExtAddCachePath{#1}~has~the~good~md5~hash.}
+ }{
+ \robExtDebugInfo{The~md5~hashes~of~#1~and~\robExtAddCachePath{#1}~are~different(\l_tmpa_str \space vs \space \l_tmpb_str),~let~us~copy~the~file.}%
+ \robExtRunCmdIfPossible{\robExtCp \space "#1"~"\robExtAddCachePath{#1}"}%
+ }
+ }{
+ \robExtDebugInfo{The~file~\robExtAddCachePath{#1}~does~not~exist,~let~us~copy~it:}
+ \robExtRunCmdIfPossible{\robExtCp \space "#1"~"\robExtAddCachePath{#1}"}%
+ }
+}
+\let\copyFileToCache\robExtCopyFileToCache
+
+% \robExtRenameBackupFilesForArxiv{robExt-arxiv-files-to-rename.txt} takes all elements listed in the .tex file
+% (like robustExternalize/robExt-F83AB245D8043E653A89489C2E25AA6A.tex) and rename the
+% robustExternalize/robExt-F83AB245D8043E653A89489C2E25AA6A.tex-backup into
+% robustExternalize/robExt-F83AB245D8043E653A89489C2E25AA6A.tex
+% (needed for arxiv)
+% This is done, importantly, without shell escape as arxiv does not have shell escape.
+\NewDocumentCommand{\robExtRenameBackupFilesForArxiv}{O{-backup}m}{
+ \file_if_exist:xTF{#2} {
+ \robExtDebugInfo{We~will~read~the~file~#2.}
+ \ior_open:Nn \g__robExt_read_ior {#2}%
+ %% We avoid creating a new ior since the number of available files is limited in tex
+ \seq_clear:N \l_tmpa_seq
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \file_if_exist:xTF{##1#1} {
+ \seq_put_right:Nn \l_tmpa_seq {##1}
+ }{
+ \robExtDebugInfo{Warning:~##1#1~does~not~exist,~so~we~will~not~rename~back~this~file~for~arXiv.}
+ }
+ }%
+ \ior_close:N \g__robExt_read_ior
+ \seq_map_inline:Nn \l_tmpa_seq {
+ \robExtDebugInfo{We~copy~the~source~##1#1~to~##1^^J}%
+ % First we read the file:
+ \ior_open:Nn \g__robExt_read_ior {##1#1}%
+ \iow_open:Nx \g__robExt_write_iow {##1}
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \iow_now:Nx \g__robExt_write_iow {\tl_to_str:n{####1}}%
+ }%
+ \iow_close:N \g__robExt_write_iow
+ \ior_close:N \g__robExt_read_ior
+ }
+ }{
+ \robExtDebugInfo{Warning:~#2~does~not~exist,~so~we~will~not~rename~back~elements~for~arXiv.}
+ }
+}
\NewExpandableDocumentCommand{\robExtGetPrefixPath}{}{%
\ifdefined\robExtCacheFolder%
@@ -317,9 +600,9 @@ if __name__ == '__main__':
%% TODO: create a makefile.
\iow_new:N \g__robExt_write_list_all_figures_iow
%% Create a file robExt-all-figures.txt with the list of .tex files
-\iow_open:Nx \g__robExt_write_list_all_figures_iow {\jobname-\robExtAddPrefixName{all-figures.txt}}
+\iow_open:Nx \g__robExt_write_list_all_figures_iow {\jobnameNoQuotes-\robExtAddPrefixName{all-figures.txt}}
\iow_new:N \g__robExt_write_manually_compile_all_missing_figures_iow
-\iow_open:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\jobname-\robExtAddPrefixName{compile-missing-figures.sh}}
+\iow_open:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}}
% Contains the list of dependency files (useful to compute the final md5sum)
\seq_new:N \l__robExt_dependencies_str
@@ -450,7 +733,7 @@ if __name__ == '__main__':
}
\let\evalPlaceholderNoReplacement\robExtEvalPlaceholderNoReplacement
-\NewDocumentCommand{\robExtGetPlaceholderNoReplacement}{m}{
+\NewExpandableDocumentCommand{\robExtGetPlaceholderNoReplacement}{m}{
\str_use:c { l__robExt_placeholder_#1_str }
}
\let\getPlaceholderNoReplacement\robExtGetPlaceholderNoReplacement
@@ -545,7 +828,7 @@ if __name__ == '__main__':
%% Warning: only LaTeX-friendly code should be placed here, as LaTeX does not preserve some symbols and adds spaces
%% Tested!
%% The star version does NOT import the placeholder (useful for efficiency reasons)
-\NewDocumentCommand{\robExtPlaceholderFromContent}{smm}{
+\NewDocumentCommand{\robExtPlaceholderFromContent}{sm+m}{
\robExt_set_hash_robust:cn { l__robExt_placeholder_#2_str } {#3}
\checkIfPlaceholderNameIsLegal{#2}
\ifdefined\robExtCompletelyDisableWholeImportSystem\else% Mostly for time optimizations...
@@ -662,10 +945,10 @@ if __name__ == '__main__':
%% https://tex.stackexchange.com/a/680259/116348 might work and be more efficient, but it might be less reliable
%% and definitely more complicated and error prone. Instead, we write to a file and read the result.
%% TODO: try to do it using verbatim, might be trivial or complicated, not sure, maybe see https://tex.stackexchange.com/questions/555359/reading-lines-verbatim-into-a-sequence-variable
- \XSIMfilewritestart{\jobname-robExt-tmp-file-you-can-remove.tmp}%
+ \XSIMfilewritestart{\jobnameNoQuotes-robExt-tmp-file-you-can-remove.tmp}%
}{%
\XSIMfilewritestop%
- \ior_open:Nn \g__robExt_read_ior {\jobname-robExt-tmp-file-you-can-remove.tmp}%
+ \ior_open:Nn \g__robExt_read_ior {\jobnameNoQuotes-robExt-tmp-file-you-can-remove.tmp}%
%% Put the file in l__robExt_tmp_contain_file_str
\str_clear_new:N \l__robExt_tmp_str%
\ior_str_map_inline:Nn \g__robExt_read_ior {%
@@ -762,10 +1045,10 @@ if __name__ == '__main__':
%% This will copy "some code" in the cache, and set MYLIBPATH to the name of the file in the cache like
%% MYLIBPATH = robExt-abc.py
\NewDocumentEnvironment{RobExtPlaceholderPathFromCode}{sO{}m}{
- \XSIMfilewritestart*{\jobname-robExt-tmp-file-you-can-remove.tmp}
+ \XSIMfilewritestart*{\jobnameNoQuotes-robExt-tmp-file-you-can-remove.tmp}
}{
\XSIMfilewritestop
- \ior_open:Nn \g__robExt_read_ior {\jobname-robExt-tmp-file-you-can-remove.tmp}
+ \ior_open:Nn \g__robExt_read_ior {\jobnameNoQuotes-robExt-tmp-file-you-can-remove.tmp}
%% Put the file in \l__robExt_tmp_contain_file_str
\str_clear_new:N \l__robExt_tmp_contain_file_str
\ior_str_map_inline:Nn \g__robExt_read_ior {
@@ -856,7 +1139,7 @@ if __name__ == '__main__':
\cs_if_exist:cTF { l__robExt_placeholder_#3_str }{
\str_set_eq:Nc { \l_robExt_result_str }{ l__robExt_placeholder_#3_str }
}{
- \msg_error:nn{robExt}{placeholder not existing}
+ \msg_error:nnx{robExt}{placeholder not existing}{#3}
}
\robExtDebugMessage{Starting~to~replace~placeholder~#3~to~get~\l_robExt_result_str}
\__robExt_replace_until_impossible:
@@ -1039,7 +1322,7 @@ if __name__ == '__main__':
% First we remove existing occurrences (useful to avoid listing the same macro more than once
% if we redefine a macro):
\seq_map_inline:Nn \l__robExt_tmp_seq {
- \message{Adding ##1 to #1}
+ \robExtDebugMessage{Adding ##1 to #1}
\seq_remove_all:cn {l__robExt_placeholder_group_#1_seq} {##1}
\seq_put_right:cn {l__robExt_placeholder_group_#1_seq} {##1}
}
@@ -1126,6 +1409,7 @@ if __name__ == '__main__':
\seq_new:N \l__robExt_list_groups_seq % contains the list of all groups
+%%%% \robExtRegisterGroupPlaceholders{bash} adds "bash" to the list of existing groups
\NewDocumentCommand{\robExtRegisterGroupPlaceholders}{m}{
\seq_if_exist:cTF {l__robExt_placeholder_group_#1_seq}{}{
\seq_clear_new:c {l__robExt_placeholder_group_#1_seq}
@@ -1187,7 +1471,11 @@ if __name__ == '__main__':
}
\NewDocumentCommand{\robExtAddDependency}{m}{
- \seq_put_left:Nx \l__robExt_dependencies_str {#1}
+ \file_if_exist:nTF {#1} {
+ \seq_put_left:Nx \l__robExt_dependencies_str {#1}
+ } {
+ \msg_error:nnx{robExt}{dependency does not exist}{#1}
+ }
}
\NewDocumentCommand{\robExtDebugDependency}{}{
@@ -1356,7 +1644,12 @@ if __name__ == '__main__':
% not want to recompile when the file changes
\robExtUseHookJustBeforeWritingFiles%
%% We add the figure in the list of files.
- \iow_now:Nx \g__robExt_write_list_all_figures_iow {\robExtAddPrefixName{\robExtFinalHash.tex}}
+ % Avoid writing the same command multiple times (might occur in environments that execute the
+ % same command multiple times like align etc)
+ \cs_if_exist:cTF {l__robExt_write_list_all_figures_\robExtAddPrefixName{\robExtFinalHash.tex}:}{}{
+ \iow_now:Nx \g__robExt_write_list_all_figures_iow {\robExtAddPrefixName{\robExtFinalHash.tex}}
+ \cs_gset:cn {l__robExt_write_list_all_figures_\robExtAddPrefixName{\robExtFinalHash.tex}:} {}
+ }
%% We can now set the placeholders, and recompute the final value of the file:
%% I was doing before \robExtPlaceholderFromContent + \robExtEvalPlaceholderInplace, but it is too slow
\str_set:Nx \l_tmp_output_prefix_str {\robExtAddPrefixName{\robExtFinalHash}}
@@ -1367,21 +1660,45 @@ if __name__ == '__main__':
\str_replace_all:Nnx \l_robExt_result_str {__ROBEXT_WAY_BACK__}{\robExtCacheFolderWayBack}
\str_replace_all:Nnx \l_robExt_result_str {__ROBEXT_CACHE_FOLDER__}{\robExtCacheFolder}
\file_if_exist:xTF{\robExtAddCachePathAndName{\robExtFinalHash.tex}}{
- \message{The\space file\space \robExtAddCachePathAndName{\robExtFinalHash.tex} \space already\space exists.^^J}
+ \robExtDebugInfo{The\space file\space \robExtAddCachePathAndName{\robExtFinalHash.tex} \space already\space exists.^^J}
}{
- \str_if_eq:VnTF { \l_robExt_result_str }{__ROBEXT_TEMPLATE__} {
- \msg_error:nn{robExt}{forgot template}
+ % arXiv removes the .pdf if the .tex is present... so we need to manually remove the .tex file.
+ \file_if_exist:xTF{\robExtAddCachePathAndName{\robExtFinalHash.pdf}}{
+ \robExtDebugInfo{The\space file\space \robExtAddCachePathAndName{\robExtFinalHash.pdf} \space already\space exists.^^J}
+ % Sometimes we still want to refer to the original tex file, for instance to input the source.
+ % So if a file .tex-backup exists, we copy it back to .tex:
+ \file_if_exist:xTF{\robExtAddCachePathAndName{\robExtFinalHash.tex-backup}} {
+ \robExtDebugInfo{We~copy~the~source~\robExtFinalHash.tex-backup~to~\robExtFinalHash.tex^^J}%
+ % First we read the file:
+ \ior_open:Nn \g__robExt_read_ior {\robExtAddCachePathAndName{\robExtFinalHash.tex-backup}}%
+ \iow_open:Nx \g__robExt_write_iow {\robExtAddCachePathAndName{\robExtFinalHash.tex}}
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \iow_now:Nx \g__robExt_write_iow {\tl_to_str:n{##1}}%
+ }%
+ \iow_close:N \g__robExt_write_iow
+ \ior_close:N \g__robExt_read_ior
+ }{}
}{
- % Check if the output directory exists
- \robExtCheckIfPrefixFolderExists
- \iow_open:Nx \g__robExt_write_iow {\robExtAddCachePathAndName{\robExtFinalHash.deps}}
- \iow_now:NV \g__robExt_write_iow \l__robExt_dependencies_mdfive_str
- \iow_close:N \g__robExt_write_iow
- %% Save the final file:
- \iow_open:Nx \g__robExt_write_iow {\robExtAddCachePathAndName{\robExtFinalHash.tex}}
- \iow_now:NV \g__robExt_write_iow \l_robExt_result_str
- \iow_close:N \g__robExt_write_iow
- \message{Source ~ saved ~ in ~ \robExtAddCachePathAndName{\robExtFinalHash.tex}.}
+ \str_if_eq:VnTF { \l_robExt_result_str }{__ROBEXT_TEMPLATE__} {
+ \msg_error:nn{robExt}{forgot template}
+ }{
+ % Check if the output directory exists
+ \robExtCheckIfPrefixFolderExists
+ \iow_open:Nx \g__robExt_write_iow {\robExtAddCachePathAndName{\robExtFinalHash.deps}}
+ \iow_now:NV \g__robExt_write_iow \l__robExt_dependencies_mdfive_str
+ \iow_close:N \g__robExt_write_iow
+ %% Save the final file:
+ \iow_open:Nx \g__robExt_write_iow {\robExtAddCachePathAndName{\robExtFinalHash.tex}}
+ \iow_now:NV \g__robExt_write_iow \l_robExt_result_str
+ \iow_close:N \g__robExt_write_iow
+ \robExtDebugInfo{Source ~ saved ~ in ~ \robExtAddCachePathAndName{\robExtFinalHash.tex}.}
+ \ifdefined\robExtPrintSourceWhenSaving
+ \typeout{Content~of~the~deps~file~\robExtAddCachePathAndName{\robExtFinalHash.deps}:^^J}
+ \robExt_write_file_in_log:x {\robExtAddCachePathAndName{\robExtFinalHash.deps}}
+ \typeout{Content~of~the~source~file~\robExtAddCachePathAndName{\robExtFinalHash.tex}:^^J}
+ \robExt_write_file_in_log:x {\robExtAddCachePathAndName{\robExtFinalHash.tex}}
+ \fi
+ }
}
}
}
@@ -1401,7 +1718,7 @@ if __name__ == '__main__':
\let\l__robExt_do_not_compile\undefined
}
\cs_if_exist:NTF {\l__robExt_do_not_compile}{
- \message{No ~ need ~ to ~ recompile ~ \robExtAddCachePathAndName{\robExtFinalHash.pdf}^^J}
+ \robExtDebugInfo{No ~ need ~ to ~ recompile ~ \robExtAddCachePathAndName{\robExtFinalHash.pdf}^^J}
}{
% Used to know later if we have run a compilation command at that step or not
\cs_undefine:N \l__robExt_I_just_ran_a_compilation_command:
@@ -1429,25 +1746,37 @@ if __name__ == '__main__':
} {}
\fi
\ifdefined\robExtManualMode
- \message{[robExt] Manual mode enabled: please, manually compile the images using \l__robExt_current_compilation_command_str or run 'bash \jobname-\robExtAddPrefixName{compile-missing-figures.sh}'.}
+ \message{[robExt] Manual mode enabled: please, manually compile the images using \l__robExt_current_compilation_command_str or run 'bash \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}'.}
% Avoid writing the same command multiple times (might occur in environments that execute the
% same command multiple times like align etc)
\cs_if_exist:cTF {l__robExt_missing_figure_\l__robExt_current_compilation_command_str :}{}{
- \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\l__robExt_current_compilation_command_str}% a new line is automatically added
+ \ifdefined\robExtDoNotRedirectOutputInManuallyCompileMissingFigures%
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\l__robExt_current_compilation_command_str}% a new line is automatically added
+ \else
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {(~\l__robExt_current_compilation_command_str~)~>~\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}~2>&1}% a new line is automatically added
+ \fi
\cs_gset:cn {l__robExt_missing_figure_\l__robExt_current_compilation_command_str :} {}
\ifdefined\robExt@compile@parallel@after
\gdef\robExt@compile@parallel@must@compile{}
\seq_gput_right:Nx \g__robExt_files_compiled_in_parallel {\robExtAddCachePathAndName{\robExtFinalHash}}
% Gets the line with the error for easier debugging
\cs_gset:cx {g__robExt_lines_error_\robExtAddCachePathAndName{\robExtFinalHash}:} {\msg_line_number:}
+ \ifdefined\robExtPrintWholeFile
+ \cs_gset:cx {g__robExt_print_whole_file_\robExtAddCachePathAndName{\robExtFinalHash}:} {}
+ \fi
\cs_gset:cx {g__robExt_compilation_command_\robExtAddCachePathAndName{\robExtFinalHash}:} {\l__robExt_current_compilation_command_str}
\fi
}
- \else
+ \else%
\bool_if:nTF { \sys_if_shell_unrestricted_p: || \cs_if_exist_p:N \robExtForceCompilation }
{
- \message{[robExt] We ~ will ~ start ~ the ~ compilation using: ~ \l__robExt_current_compilation_command_str.}
- \sys_shell_now:x {\l__robExt_current_compilation_command_str} % The ~ are used in ExplSyntaxOn to add space
+ % For a better debugging, we create a new file:
+ \ifdefined\robExtDoNotRedirectOutput%
+ \sys_shell_now:x {\robExtPrefixAllCompilationCommands \l__robExt_current_compilation_command_str}%
+ \else
+ \sys_shell_now:x {\robExtPrefixAllCompilationCommands (~\l__robExt_current_compilation_command_str~)~>~\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}~2>&1}%
+ \fi
+ \message{[robExt] We ~ will ~ start ~ the ~ compilation ~ using: ~ \l__robExt_current_compilation_command_str.}%
%% We notify that we are running the compilation command, this way it is possible to check later
%% if the file is not present because of some compilation error or because we are in manual mode
%% or fallback
@@ -1457,8 +1786,12 @@ if __name__ == '__main__':
% Avoid writing the same command multiple times (might occur in environments that execute the
% same command multiple times like align etc)
\cs_if_exist:cTF {l__robExt_missing_figure_\l__robExt_current_compilation_command_str :}{}{
- \message{[robExt] Fallback to manual mode: please, manually compile the images using \l__robExt_current_compilation_command_str or run 'bash \jobname-\robExtAddPrefixName{compile-missing-figures.sh}'.}
- \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\l__robExt_current_compilation_command_str}% a new line is automatically added
+ \message{[robExt] Fallback to manual mode: please, manually compile the images using \l__robExt_current_compilation_command_str or run 'bash \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}'.}
+ \ifdefined\robExtDoNotRedirectOutputInManuallyCompileMissingFigures%
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {\l__robExt_current_compilation_command_str}% a new line is automatically added
+ \else
+ \iow_now:Nx \g__robExt_write_manually_compile_all_missing_figures_iow {(~\l__robExt_current_compilation_command_str~)~>~\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}~2>&1}% a new line is automatically added
+ \fi
\cs_gset:cn {l__robExt_missing_figure_\l__robExt_current_compilation_command_str :} {}
\ifdefined\robExt@compile@parallel@after
\gdef\robExt@compile@parallel@must@compile{}
@@ -1466,6 +1799,9 @@ if __name__ == '__main__':
\fi
}
\else
+ \ifdefined\robExtPrintSourceWhenSaving
+ \typeout{Compilation~command~that~we~would~have~run:^^J\l__robExt_current_compilation_command_str^^J}
+ \fi
\msg_error:nn{robExt}{need shell escape}
\fi
}
@@ -1523,10 +1859,29 @@ if __name__ == '__main__':
% Check if we tried to run a compilation command at the previous step:
\cs_if_exist:NTF \l__robExt_I_just_ran_a_compilation_command: {
% We ran a compilation command but it failed: we print an error message
- \msg_error:nnxxx{robExt}{missing compiled pdf parallel}{\robExtAddCachePathAndName{\robExtFinalHash}}{\msg_line_number:}{\l__robExt_current_compilation_command_str}
+ % We first check if an error file has been produced:
+ \file_if_exist:nTF {\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}} {
+ % We print the error twice as some editor might display only the first error while in others
+ % it might be easier to see the last error. For instance, in emacs if we do not do that
+ % then it first prints the error message in a file in the cache (but it forgets the
+ % robustExternalize prefix)
+ % But first we get the lines containing the word error:
+ \robExt_get_errors_from_file:n {\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}}%
+ % We print the message before the log because otherwise emacs is confused and tries to open the
+ % auxiliary cached file, and I don't want that.
+ \ifdefined\robExtHideFirstErrorMessage\else
+ \msg_error:nnxxxx{robExt}{missing compiled pdf parallel with log}{\robExtAddCachePathAndName{\robExtFinalHash}}{\msg_line_number:}{\l__robExt_current_compilation_command_str}{below~(you~might~need~to~press~ENTER~to~go~to~the~next~error)}
+ \fi
+ \message{--------~We~print~now~the~full~log~--------^^J}
+ \robExt_write_file_in_log:n {\robExtAddCachePathAndName{\robExtFinalHash-compilation.log}}%
+ \message{--------~End~of~the~full~log~--------^^J}
+ \msg_error:nnxxxx{robExt}{missing compiled pdf parallel with log}{\robExtAddCachePathAndName{\robExtFinalHash}}{\msg_line_number:}{\l__robExt_current_compilation_command_str}{above}
+ }{
+ \msg_error:nnxxx{robExt}{missing compiled pdf parallel}{\robExtAddCachePathAndName{\robExtFinalHash}}{\msg_line_number:}{\l__robExt_current_compilation_command_str}
+ }%
} { % We ran no compilation command: we print instead a placeholder depending on the context:
\cs_if_exist:NTF \robExt@compile@parallel@must@compile {
- % we are supposed to compile the current picture in parallel, let'us check if it will be possible:
+ % we are supposed to compile the current picture in parallel, let us check if it will be possible:
\bool_if:nTF { \sys_if_shell_unrestricted_p: || \cs_if_exist_p:N \robExtForceCompilation} {
\robExtImagePlaceholderIfParallelCompilation
}{
@@ -1535,10 +1890,10 @@ if __name__ == '__main__':
}{
\cs_if_exist:NTF \robExtManualMode {
\robExtImagePlaceholderIfManualMode
- \message{[robExt] ~ You ~ are ~ in ~ manual ~ mode: ~ please ~ compile ~ yourself ~ \robExtAddCachePathAndName{\robExtFinalHash.tex} ~ or ~ use ~ the ~ bash ~ \jobname-\robExtAddPrefixName{compile-missing-figures.sh}}
+ \message{[robExt] ~ You ~ are ~ in ~ manual ~ mode: ~ please ~ compile ~ yourself ~ \robExtAddCachePathAndName{\robExtFinalHash.tex} ~ or ~ use ~ the ~ bash ~ \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}}
}{
\robExtImagePlaceholderIfFallbackMode
- \message{[robExt] ~ You ~ are ~ falling ~ back ~ to ~ manual ~ mode: ~ please ~ compile ~ yourself ~ \robExtAddCachePathAndName{\robExtFinalHash.tex} ~ or ~ use ~ the ~ bash ~ \jobname-\robExtAddPrefixName{compile-missing-figures.sh}}
+ \message{[robExt] ~ You ~ are ~ falling ~ back ~ to ~ manual ~ mode: ~ please ~ compile ~ yourself ~ \robExtAddCachePathAndName{\robExtFinalHash.tex} ~ or ~ use ~ the ~ bash ~ \jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}}
}
}
}
@@ -1634,7 +1989,7 @@ if __name__ == '__main__':
}
\let\autoForwardMacro\robExtAutoForwardMacro
-\NewDocumentCommand{\robExtLoadAutoForwardMacroConfig}{m}{
+\NewDocumentCommand{\robExtLoadAutoForwardMacroConfig}{+m}{
%\str_set:Nx \l__robExt_tmp_str {\cs_to_str:N #1}
\cs_if_exist:cTF {l__robExt_execute_if_macro_present\string#1}{
% if the macro is present twice, we want to run \forward only once
@@ -1660,16 +2015,21 @@ if __name__ == '__main__':
%% "auto forward"
\NewDocumentCommand{\robExtAutoForward}{}{
- \ifdefined\robExtUserInputCacheMe\else
- \msg_warning:nn{robExt}{auto forward not in cachemecode}
- \tl_set_rescan:NnV \robExtUserInputCacheMe {} \l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str
+ % some code will automatically add auto forward, but we don't want to run it twice.
+ \robExtDebugInfo{Running auto forward.}
+ \ifdefined\robExt@already@ran@autoforward\robExtDebugInfo{Auto forward already ran}\else
+ \ifdefined\robExtUserInputCacheMe\else
+ \msg_warning:nn{robExt}{auto forward not in cachemecode}
+ \tl_set_rescan:NnV \robExtUserInputCacheMe {} \l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str
+ \fi
+ \robExt@normalBraces\robExtUserInputCacheMe
+ \expandafter\robExt@getfromstringA\robExtUserInputCacheMe\robExt@getfromstringA%\robExt@getfromstringA is added to know when to stop
+ \def\robExt@already@ran@autoforward{}%
\fi
- \robExt@normalBraces\robExtUserInputCacheMe
- \expandafter\robExt@getfromstringA\robExtUserInputCacheMe\robExt@getfromstringA%\robExt@getfromstringA is added to know when to stop
}
% https://tex.stackexchange.com/questions/700834/efficiently-program-search-of-macro-in-string/700844
-\def\robExt@getfromstringA#1{\ifx#1\robExt@getfromstringA \else
+\long\def\robExt@getfromstringA#1{\ifx#1\robExt@getfromstringA \else
%\ifcsname L:\string#1\endcsname \addto\listmacros{#1}\fi
\robExtLoadAutoForwardMacroConfig{#1}%
\expandafter\robExt@getfromstringA\fi
@@ -1677,7 +2037,7 @@ if __name__ == '__main__':
\def\robExt@normalBraces#1{{\catcode`{=12 \catcode`}=12 \everyeof={\endfile}%
\expandafter\robExt@normalBracesA\expandafter#1\scantokens\expandafter{#1}}}
-\def\robExt@normalBracesA#1#2\endfile{\gdef#1{#2}}
+\long\def\robExt@normalBracesA#1#2\endfile{\gdef#1{#2}}
%%% To automatically define and forward
\NewDocumentCommand{\newcommandAutoForward}{moomO{}}{
@@ -1774,33 +2134,57 @@ if __name__ == '__main__':
}
\NewDocumentCommand{\defAutoForward}{mO{}mO{}}{
- \def#1#2{#3}
- \robExtAutoForwardMacro{#1}[#4]
+ \def#1#2{#3}%
+ \robExtAutoForwardMacro{#1}[#4]%
}
-% \robExtGenericAutoForward[tikz]{string to match}[additional style to run]{
+% \robExtGenericAutoForward[tikz][namespace]{string to match}[additional style to run]{
% code to run in cached file if string matches, and to always run in current folder if not using
% the star version
% }
\ExplSyntaxOff
-\NewDocumentCommand{\robExtGenericAutoForward}{sO{latex}mO{}m}{%
- \IfBooleanTF{#1}{}{#5}% We run the code right now
- \robExt@set@hash@robust\zxTmpMacro{#5}%
+
+\NewDocumentCommand{\definecolorAutoForward}{mmmO{}}{%
+ \definecolor{#1}{#2}{#3}%
+ \robExtConfigure{if matches word={#1}{forward color=#1,#4}}%
+}
+
+\NewDocumentCommand{\colorletAutoForward}{mmO{}}{%
+ \colorlet{#1}{#2}%
+ \robExtConfigure{if matches word={#1}{forward color=#1,#3}}%
+}
+
+
+\NewDocumentCommand{\robExtRunHereAndInPreambleOfCachedFiles}{O{latex}m}{%
+ #2%
\robExtConfigure{%
- add to preset={#2}{%
- if matches word={#3}{
- command if externalization/.append code={
- \expanded{%
- \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
- \expandonce{\zxTmpMacro}%
- % #1%%
- }%
+ add to preset={#1}{%
+ add to preamble={#2},
+ },%
+ }%
+}
+\let\runHereAndInPreambleOfCachedFiles\robExtRunHereAndInPreambleOfCachedFiles
+
+\NewDocumentCommand{\robExtGenericAutoForward}{sO{latex}O{}mO{}m}{%
+ \IfBooleanTF{#1}{}{#6}% We run the code right now
+ \robExt@set@hash@robust\zxTmpMacro{#6}%
+ \expanded{%
+ \noexpand\robExtConfigure{%
+ register word with namespace={#3}{#4}{%
+ /utils/exec={%
+ \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
+ \expandonce{\zxTmpMacro}%
}%
- },#4%
+ },%
+ #5%
+ },%
+ add to preset={#2}{%
+ auto forward words namespace={#3},%
}%
}%
- }%
+ }%
}
+
\let\genericAutoForward\robExtGenericAutoForward
% uses "if matches" instead of "if matches word"
@@ -1810,7 +2194,7 @@ if __name__ == '__main__':
\robExtConfigure{%
add to preset={#2}{%
if matches={#3}{
- command if externalization/.append code={
+ run command if externalization={
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
\expandonce{\zxTmpMacro}%
@@ -1840,8 +2224,120 @@ if __name__ == '__main__':
\str_if_in:NnTF \l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str {#1} {\pgfkeysalso{#2}} {}
}
+% \robExtRegisterWord {namespace} {word} {style}
+\NewDocumentCommand{\robExtRegisterWord}{mmm}{
+ % \robExt_register_match_word:nnn {#1} {#2} {\pgfkeysalso{#3}}
+ \robExtRegisterWordCode{#1}{#2}{\pgfkeysalso{#3}}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Automatically forward (word-based)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% For efficiency reasons, we first extract in a single pass all words in the text (a word is basically [A-Za-z]+)
+% and run a function on these words
+
+%%% I tried this, but it is really slow (500x slower than if_string_matches, overall 20% increase of
+%%% compilation time)
+% % \__robExt_auto_forward_words:N \commandToRunOnEachWord \stringToSearchOn
+% \cs_set:Nn \__robExt_auto_forward_words:NN {
+% % \l_tmpa_str will contain the current word read so far
+% \str_set:Nn \l_tmpa_str {}%
+% \str_map_inline:Nn #2 {
+% % \token_case_charcode:NnTF ##1 {} {} {}
+% \__robExt_if_letter:nTF {##1} {
+% \str_put_right:Nn \l_tmpa_str {##1}
+% }{
+% \str_if_empty:NTF \l_tmpa_str { } {
+% % if the string is empty, we run the command on the string
+% #1 \l_tmpa_str%
+% \str_set:Nn \l_tmpa_str {}% we reset its value
+% }
+% }
+% }
+% }
+
+% %% \__robExt_if_letter:nTF {char} {true} {false} tests if an element is a letter
+% %% https://tex.stackexchange.com/a/700864/116348
+% \prg_new_conditional:Npnn \__robExt_if_letter:n #1 { TF }
+% {
+% \bool_lazy_or:nnTF
+% {
+% \bool_lazy_and_p:nn
+% { \int_compare_p:nNn { `#1 } > { `a - 1 } }
+% { \int_compare_p:nNn { `#1 } < { `z + 1 } }
+% }
+% {
+% \bool_lazy_and_p:nn
+% { \int_compare_p:nNn { `#1 } > { `A - 1 } }
+% { \int_compare_p:nNn { `#1 } < { `Z + 1 } }
+% }
+% \prg_return_true:
+% \prg_return_false:
+% }
+
+% % \robExt_register_match_word {namespace that defaults to empty} {word} {code to run if word is present}
+% \cs_set:Nn \robExt_register_match_word:nnn {
+% \cs_set:cn {l__robExt_execute_if_word_present_#1_#2:} {#3}
+% }
+
+% % \robExt_try_to_execute_if_match_word:nn {namespace} {word}
+% \cs_set:Nn \robExt_try_to_execute_if_match_word:nn {
+% \cs_if_exist:cTF {l__robExt_execute_if_word_present_#1_#2:} {%
+% \cs_if_exist:cTF {l__robExt_execute_if_word_present_#1_#2__already_forwarded:}{\message{Already forwarded}}{
+% \use:c {l__robExt_execute_if_word_present_#1_#2:}%
+% % define it so that we do not import twice next time
+% \cs_set:cx {l__robExt_execute_if_word_present_#1_#2__already_forwarded:} {}
+% }
+% } { }
+% }
+% \cs_generate_variant:Nn \robExt_try_to_execute_if_match_word:nn { nV }
+
+% \NewDocumentCommand{\robExtAutoForwardWords}{O{}}{
+% \cs_set:Nn \__robExt_tmp_fct:N {
+% \robExt_try_to_execute_if_match_word:nV {#1} ##1
+% }
+% \__robExt_auto_forward_words:NN \__robExt_tmp_fct:N \l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str
+% }
+
+% \robExtAutoForwardWords[namespace]
+\NewDocumentCommand{\robExtAutoForwardWords}{m}{%
+ % needed or the original string will be changed
+ \let\robExt@tmpString\l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str%
+ \robExt@scanmacro@find@word{#1}\robExt@tmpString%
+}
+
\ExplSyntaxOff
+% Thanks a lot wipet for this optimized version!!
+% https://tex.stackexchange.com/questions/701351/more-efficient-string-extraction-of-words/701441#701441
+\def\robExtWordSeparators{{ };:."?!@+-/*,=\{\}[]\\'()&|~_^<>}
+
+% Not for user, use \robExtAutoForwardWords
+% \robExt@scanmacro@find@word{namespace}\stringToParse
+\def\robExt@scanmacro@find@word#1#2{%
+ \def\robExt@namespace{#1}%
+ % we will change the lccode (basically ascii code) of some characters like +- to delimit what a word is
+ % supposed to be. Since we do not want to affect other stuff, we put it in a bgroup.
+ \bgroup \expandafter\robExt@set@to@comma\robExtWordSeparators\relax%
+ \ifdefined\robExtAdditionalCodeInScanMacroFindWord\robExtAdditionalCodeInScanMacroFindWord\fi%
+ % This seems to set the string in lower case, so fill or Fill or get triggered. But it is not what we want here.
+ % \lowercase\expandafter{\expandafter\gdef\expandafter#2\expandafter{#2}}%
+ \lowercase\expandafter{\expandafter\gdef\expandafter#2\expandafter{#2}}%
+ \edef#2{\detokenize\expandafter{#2}}%
+ % \message{\string#2: \meaning#2} % prints the modified format of the scanned macro
+ \expandafter\egroup%
+ \expandafter\robExt@wordscan@aux#2,\relax,%
+}
+\def\robExt@set@to@comma #1{\ifx\relax#1\else \lccode`#1=`, \expandafter\robExt@set@to@comma\fi}
+\def\robExt@wordscan@aux#1,{\ifx\relax#1\empty\else%
+ %\message{{#1}} % prints each scanned "word"
+ \ifcsname robExt@action@to@run@on@word:\robExt@namespace:#1\endcsname \csname robExt@action@to@run@on@word:\robExt@namespace:#1\endcsname \fi%
+ \expandafter\robExt@wordscan@aux\fi%
+}
+%\robExtRegisterWordCode{namespace}{word}{code}
+\def\robExtRegisterWordCode#1#2#3{\expandafter\gdef\csname robExt@action@to@run@on@word:\string#1:\string#2\endcsname{#3}}
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Interface
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1864,10 +2360,16 @@ if __name__ == '__main__':
\robExtEvalPlaceholderReplaceFromList{__ROBEXT_TMP__}{%
\pgfkeys{%
/robExt/.cd,
- #1/.append style={__ROBEXT_TMP__},%
+ #1/.append style={%
+ % Some styles run differently if inside a preset or not,
+ % like if matches word. This macro helps with detecting it.
+ /utils/exec={\def\robExtCurrentlyDefiningPreset{}},%
+ __ROBEXT_TMP__%
+ },%
}%
}%
\robExtRemovePlaceholder{__ROBEXT_TMP__}% let us clean our variables
+ \let\robExtCurrentlyDefiningPreset\undefined%
},
new preset/.code 2 args={%
\robExtStrSetDoubleHash{\robExtTmpStr}{#2}%
@@ -1878,10 +2380,16 @@ if __name__ == '__main__':
\robExtEvalPlaceholderReplaceFromList{__ROBEXT_TMP__}{%
\pgfkeys{%
/robExt/.cd,%
- #1/.style={__ROBEXT_TMP__},%
+ #1/.style={%
+ % Some styles run differently if inside a preset or not,
+ % like if matches word. This macro helps with detecting it.
+ /utils/exec={\def\robExtCurrentlyDefiningPreset{}},%
+ __ROBEXT_TMP__%
+ },%
}%
}%
\robExtRemovePlaceholder{__ROBEXT_TMP__}% let us clean our variables
+ \let\robExtCurrentlyDefiningPreset\undefined%
},
% new compiled preset={latex compiled}{
% code to compile in order to produce the expected strings
@@ -2025,8 +2533,8 @@ if __name__ == '__main__':
%%%%%%%%%%%%%
%%% Debug %%%
%%%%%%%%%%%%%
- more logs/.code={\def\robExtDebugMessage#1{\message{^^J[robExt] #1}}},
- less logs/.code={\def\robExtDebugMessage#1{}},
+ more logs/.code={\def\robExtDebugMessage##1{\message{^^J[robExt] ##1}}\def\robExtDebugInfo##1{^^J[robExt] ##1}},
+ less logs/.code={\def\robExtDebugMessage##1{}\def\robExtDebugInfo##1{}},
show placeholder/.code={\robExtShowPlaceholder{#1}},
show placeholders/.code={\robExtShowPlaceholders},
show placeholders contents/.code={\robExtShowPlaceholdersContents},
@@ -2116,6 +2624,27 @@ if __name__ == '__main__':
recompile/.code={\def\robExtForceRecompilation{}},
do not recompile/.code={\let\robExtForceRecompilation\undefined},
set compilation command/.code={\robExtSetCompilationCommand{#1}},
+ % like "set compilation command" but moves the "__ROBEXT_OUTPUT_PDF__-tmp" to "__ROBEXT_OUTPUT_PDF__" if
+ % there is no error.
+ set compilation command move if no error/.style={
+ set compilation command/.expanded={#1 && \robExtMv\space"__ROBEXT_OUTPUT_PDF__-tmp" "__ROBEXT_OUTPUT_PDF__"}
+ },
+ set compilation command create if no error/.code={\robExtSetCompilationCommand{#1 && echo "" > __ROBEXT_OUTPUT_PDF__}},
+ do not redirect compilation output/.code={\def\robExtDoNotRedirectOutput{}\def\robExtDoNotRedirectOutputInManuallyCompileMissingFigures{}},
+ print whole file in error message/.code={\def\robExtPrintWholeFile{}},
+ do not print whole file in error message/.code={\let\robExtPrintWholeFile\undefined},
+ prefix log message with/.code={\def\robExtPrefixLogMessage{#1}},
+ spacing between lines in log/.code={\def\robExtMessageWithPrefixNumberLines{#1}},
+ % This adds a ! in front of the code if \robExtPrintWholeFile is defined
+ logs should show as errors/.style={prefix log message with={!\space}},
+ texstudio/.style={
+ logs should show as errors,
+ spacing between lines in log={^^J^^J(sorry, these 4 empty lines are ugly but needed for texstudio to consider them as separate errors, customize me "with spacing between lines in log")^^J},
+ },
+ remove line number/.code={\def\robExtRemoveLineNumber{}}, % Removes the l. if the log error line starts with l.42 or it will disturb emacs.
+ do not remove line number/.code={\let\robExtRemoveLineNumber\undefined},
+ remove line number,
+ nb lines after error to show/.code={\def\robExtLinesAfterError{#1}},
add argument to compilation command/.code={\robExtAddArgumentToCompilationCommand{#1}},
add arguments to compilation command/.style={
add argument to compilation command/.list={#1}
@@ -2143,6 +2672,24 @@ if __name__ == '__main__':
% The default include command includes the pdf, making sure it is raised depending on its depth,
% but you can override it:
custom include command/.code={\def\robExtIncludeCommand{#1}},
+ include command is input/.style={
+ custom include command={#1\input{\robExtAddCachePathAndName{\robExtFinalHash.pdf}}},
+ },
+ include command is input/.default={},
+ % Sometimes (gnuplot), we need to include an image located in the cache folder:
+ % https://tex.stackexchange.com/questions/171587/append-entries-to-an-existing-graphicspath
+ add cache to graphicspath/.code={%
+ \appto\Ginput@path{\robExtCacheFolder}%
+ },%
+ %% This is needed notably if the cached elements are nested, like the include command uses itself a tikz picture
+ %% etc cached via \cacheTikz... It it hard to reset everything efficiently (like we might not want to reset
+ %% all compilation commands etc), so you can add here stuff that might need to be restored later.
+ reset/.code={%
+ \let\robExtIncludeCommandAdvanced\undefined%
+ \let\robExtIncludeCommand\undefined%
+ \let\robExtPrintWholeFile\undefined%
+ \setPlaceholder{__ROBEXT_INCLUDEGRAPHICS_FILE__}{\robExtAddCachePathAndName{\robExtFinalHash.pdf}}%
+ },
%% Use this when we do not want to include anything (e.g. the video will be processed later in the chain):
do not include pdf/.style={
custom include command={}%
@@ -2153,12 +2700,22 @@ if __name__ == '__main__':
disable manual mode/.code={\let\robExtManualMode\undefined},
enable fallback to manual mode/.code={\def\robExtFallbackManualMode{}},
disable fallback to manual mode/.code={\let\robExtFallbackManualMode\undefined},
+ % For the arxiv, we need to rename the source .tex into .tex-backup or it will be removed
+ backup source for arxiv/.code={\def\robExtEnableBackupSource{}},
+ do not backup source for arxiv/.code={\let\robExtEnableBackupSource\undefined},
+ rename backup files for arxiv/.code={\robExtRenameBackupFilesForArxiv{#1}},
+ rename backup files for arxiv/.default={robExt-arxiv-files-to-rename.txt},
+ % print in the log the file. Useful to debug in arxiv where we do not have any access to the logs
+ print source when saving/.code={\def\robExtPrintSourceWhenSaving{}},
+ copy file to cache/.code={\robExtCopyFileToCache{#1}},
%% Arguments to include graphics
include graphics args/.code={\def\robExtIncludeGraphicsArgs{#1}},
%% The role of this command is to set \l_robExt_result_str, that will contain the final string.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Configuration of the cache %%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % For support of --output-directory
+ set output directory/.code={\def\robExtOutputDirectory{#1}},
%% Configure the prefix (default to "robExt-")
set filename prefix/.code={\def\robExtPrefixFilename{#1}},
% first argument is subfolder, second is how to get from subfolder to the folder containing the source:
@@ -2171,6 +2728,13 @@ if __name__ == '__main__':
% Change this before starting to cache any library, and if you change it mid-document, be aware
% that you will not be able to refer to elements in the old folder.
set subfolder and way back={robustExternalize/}{../},
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %%% Enable externalization for tikz %%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ cache tikz/.code={\robExtExternalizeAllTikzpictures{}},
+ do not cache tikz/.code={\robExtDoNotExternalizeAllTikzpictures{}},
+ cache tikz 2 args/.code 2 args={\robExtExternalizeAllTikzpictures[#1][#2]{}},
+ cache tikz 3 args/.code n args={3}{\robExtExternalizeAllTikzpictures[#1][#2][3]{}},
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Disable externalization %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2191,9 +2755,20 @@ if __name__ == '__main__':
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Forward macros if externalization is enabled %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- command if externalization/.code={},
+ command if externalization/.code={\def\robExt@we@are@already@in@command@if@externalization{}},
+ % Doing "command if externalization/.append code={}" is not always good since we don't always know if the style
+ % will always be run before running "command if externalization". In particular this arrives when using
+ % something like "if matches word={mypink}{forward color=mypink}"
+ run command if externalization/.code={
+ \ifdefined\robExt@we@are@already@in@command@if@externalization%
+ % we are already running command if externalization
+ #1%
+ \else%
+ \pgfkeysalso{command if externalization/.append code={#1}}%
+ \fi%
+ },
fw/.style={forward=#1},
- run code before main content if externalization enabled/.code={\message{#1}},
+ run code before main content if externalization enabled/.code={},
% run code before main content if externalization enabled/.code={
% \message{aaa #1}
% \def\zx@tmp{#1}%
@@ -2213,7 +2788,7 @@ if __name__ == '__main__':
% },
% },
forward/.style={%
- command if externalization/.append code={%
+ run command if externalization={%
\robExtGetCommandDefinitionInMacro{#1}%
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
@@ -2223,7 +2798,7 @@ if __name__ == '__main__':
},
},
forward at letter/.style={%
- command if externalization/.append code={%
+ run command if externalization={%
\robExtGetCommandDefinitionInMacro{#1}%
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
@@ -2235,7 +2810,7 @@ if __name__ == '__main__':
},
},
forward eval/.style={%
- command if externalization/.append code={%
+ run command if externalization={%
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
\noexpand\def\noexpand#1{#1}%
@@ -2244,7 +2819,7 @@ if __name__ == '__main__':
},%
},
forward counter/.style={%
- command if externalization/.append code={%
+ run command if externalization={%
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
\noexpand\makeatletter%
@@ -2256,8 +2831,23 @@ if __name__ == '__main__':
}%
},%
},%
+ % Useful when we want to force the value of a forwarded counter. Useful for arXiv, e.g.
+ % if the page number is not the good one.
+ forward counter force value/.style 2 args={%
+ run command if externalization={%
+ \expanded{%
+ \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
+ \noexpand\makeatletter%
+ % Make sure the counter exists:
+ \noexpand\ifcsname c@#1\noexpand\endcsname\noexpand\else\noexpand\newcounter{#1}\noexpand\fi%
+ \noexpand\setcounter{#1}{#2}%
+ \noexpand\makeatother
+ }%
+ }%
+ },%
+ },%
forward color/.style={
- command if externalization/.append code={%
+ run command if externalization={%
\extractcolorspecs{#1}{\zx@tmp@model}{\zx@tmp@cmd}%
\expanded{%
\noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
@@ -2268,19 +2858,47 @@ if __name__ == '__main__':
},%
%% This will try to automatically forward some macros. For this, you must first define
%%
- auto forward/.code={\robExtAutoForward},
+ auto forward only macros/.code={\robExtAutoForward},
+ auto forward/.code={\robExtAutoForward\pgfkeysalso{auto forward words}},
auto forward color/.style 2 args={%
- add to preset={#1}{
- % if matches={\b #2\b}{forward color=#2},
- % the Regex is maybe more precise (avoid unnecessary forwards) but is way faster
- if matches={#2}{forward color=#2},
+ add to preset={#1}{%
+ if matches word={#2}{forward color=#2},
},
},
load auto forward macro config/.code={\robExtLoadAutoForwardMacroConfig{#1}},
+ %% Auto forward words
+ auto forward words namespace/.code={%
+ \ifdefined\robExt@autoforward@enabled\else%
+ \pgfkeysalso{command if externalization/.append code={%
+ \ifdefined\robExt@autoforward@enabled%
+ \expanded{\noexpand\robExtAutoForwardWords{\robExt@autoforward@enabled}}%
+ \fi%
+ }%
+ }%
+ \fi%
+ \def\robExt@autoforward@enabled{#1}%
+ },%%% todo: finish
+ auto forward words/.style={auto forward words namespace={}},
%% This will
if matches regex/.code 2 args={\robExtIfMatchesRegex{#1}{#2}},
- if matches word/.code 2 args={\robExtIfMatchesString{#1}{#2}},
if matches/.code 2 args={\robExtIfMatchesString{#1}{#2}},
+ if matches word/.code 2 args={%
+ \robExtRegisterWord{}{#1}{#2}%
+ % If ran inside a preset, we want to enable it, otherwise we enable it on the latex preset
+ \ifdefined\robExtCurrentlyDefiningPreset%
+ \pgfkeysalso{auto forward words}%
+ \else%
+ \pgfkeysalso{/robExt/latex/.append style={auto forward words}}%
+ \fi%
+ },
+ % more efficient since we can register the words before the preset, but make sure to call `auto forward words namespace`.
+ % You can use an empty namespace.
+ register word with namespace/.code n args={3}{%
+ \robExtRegisterWord{#1}{#2}{#3}%
+ },
+ register word/.style 2 args={%
+ register word with namespace={}{#1}{#2},%
+ },
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Run code before/after inclusion %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2320,12 +2938,12 @@ if __name__ == '__main__':
compile in parallel command/.store in=\robExt@compile@parallel@command,
% Different backends to compile in parallel
compile in parallel with gnu parallel/.style={
- compile in parallel command={parallel --jobs #1 :::: '\jobname-\robExtAddPrefixName{compile-missing-figures.sh}'},
+ compile in parallel command={parallel --jobs #1 :::: '\jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}'},
},
compile in parallel with gnu parallel/.default={200\%},
compile in parallel with xargs/.style={
% Use " instead of ' as Windows does not consider ' as a valid surrounding for strings
- compile in parallel command={xargs -t -I "{}" -P #1 \robExtParallelShell\space "{}" < "\jobname-\robExtAddPrefixName{compile-missing-figures.sh}"},
+ compile in parallel command={xargs -t -I "{}" -P #1 \robExtParallelShell\space "{}" < "\jobnameNoQuotes-\robExtAddPrefixName{compile-missing-figures.sh}"},
},
% With 0 it spawns as many shells at possible, i.e. it compiles all 200 pictures at the same time, making the
% system a laggy, and it is actually *slower* (2:05mn vs 1:15mn) than when using 16 threads.
@@ -2361,12 +2979,36 @@ if __name__ == '__main__':
\iow_close:N \g__robExt_write_manually_compile_all_missing_figures_iow
\msg_warning:nnx{robExt}{rerun because parallel}{\robExt@compile@parallel@command}
\message{\robExt@compile@parallel@command}
- \sys_shell_now:x {\robExt@compile@parallel@command}
+ % Note that we do not save this into a file because it might help to see in real time where we are in
+ % the compilation process. This also means that we get poorer error message if this specific
+ % command fails in texstudio since it only prints the log file and not the whole terminal...
+ % Since this should anyway be quite rare (user has not xargs installed basically), this should be fine.
+ \sys_shell_now:x {\robExtPrefixAllCompilationCommands\robExt@compile@parallel@command}
% We check if some files failed to compile
\seq_map_inline:Nn \g__robExt_files_compiled_in_parallel {
- \message{#1}
\file_if_exist:xTF{#1.pdf}{}{
- \msg_error:nnxxx{robExt}{missing compiled pdf parallel}{#1}{\use:c {g__robExt_lines_error_#1:}}{\use:c {g__robExt_compilation_command_#1:}}
+ \file_if_exist:nTF {#1-compilation.log} {
+ % We print the error twice as some editor might display only the first error while in others
+ % it might be easier to see the last error. For instance, in emacs if we do not do that
+ % then it first prints the error message in a file in the cache (but it forgets the
+ % robustExternalize prefix)
+ % But first we get the lines containing the word error:
+ \let\robExtPrintWholeFile\undefined
+ \cs_if_exist:cTF {g__robExt_print_whole_file_#1:} {\def\robExtPrintWholeFile{}} {}
+ \robExt_get_errors_from_file:n {#1-compilation.log}%
+ % We print the message before the log because otherwise emacs is confused and tries to open the
+ % auxiliary cached file, and I don't want that.
+ \ifdefined\robExtHideFirstErrorMessage\else
+ \msg_error:nnxxxx{robExt}{missing compiled pdf parallel with log}{#1}{\use:c {g__robExt_lines_error_#1:}}{\use:c {g__robExt_compilation_command_#1:}}{below~(you~might~need~to~press~ENTER~to~go~to~the~next~error)}
+ \fi
+ \message{--------~We~print~now~the~full~log~--------^^J}
+ \robExt_write_file_in_log:n {#1-compilation.log}%
+ \message{--------~End~of~the~full~log~--------^^J}
+ \msg_error:nnxxxx{robExt}{missing compiled pdf parallel with log}{#1}{\use:c {g__robExt_lines_error_#1:}}{\use:c {g__robExt_compilation_command_#1:}}{above}
+ \let\robExtPrintWholeFile\undefined
+ }{
+ \msg_error:nnxxx{robExt}{missing compiled pdf parallel}{#1}{\use:c {g__robExt_lines_error_#1:}}{\use:c {g__robExt_compilation_command_#1:}}
+ }
}
}
} {
@@ -2378,6 +3020,18 @@ if __name__ == '__main__':
}
\fi
\fi
+ % \robExtBackupSource moves the source .tex into .tex-backup, needed for the arXiv website that removes the
+ % .pdf if there is a .tex file.
+ % We need to run it at the very end, as if we move it right after a cacheMe, we cannot refer anymore to the
+ % input file of this block later.
+ \iow_close:N \g__robExt_write_list_all_figures_iow
+ \ifdefined\robExtEnableBackupSource%
+ \ior_open:Nn \g__robExt_read_ior {\jobnameNoQuotes-\robExtAddPrefixName{all-figures.txt}}%
+ \ior_str_map_inline:Nn \g__robExt_read_ior {%
+ \robExtBackupSource{#1}%
+ }%
+ \ior_close:N \g__robExt_read_ior
+ \fi%
}
\ExplSyntaxOff
@@ -2401,17 +3055,22 @@ if __name__ == '__main__':
\ifdefined\robExtExecuteNamedOutput\robExtExecuteNamedOutput\fi%
\ifdefined\robExtExecuteAfter\robExtExecuteAfter\fi%
\fi%
- \message{Finished to include the file.}%
+ \robExtDebugInfo{Finished to include the file.}%
}
%% #1: Arguments, #2: content to externalize
-\NewDocumentCommand{\robExtCacheMe}{O{}m}{%
+\NewDocumentCommand{\robExtCacheMe}{O{}+m}{%
{% Group
%% We store the input in a non-string element for efficiently implementing "auto forward"
\edef\robExtUserInputCacheMe{\unexpanded{#2}}% \unexpanded is needed if the macro contains a #1
\pgfkeys{%
/robExt/.cd,%
+ %% This is needed notably if the cached elements are nested, like the include command uses itself a tikz
+ %% picture etc cached via \cacheTikz... It it hard to reset everything efficiently (like we might not
+ %% want to reset all compilation commands etc), so you can add here stuff that might need to be restored
+ %% later.
+ reset,
set placeholder={__ROBEXT_MAIN_CONTENT_ORIG__}{#2},%
default style,%
#1,
@@ -2637,12 +3296,16 @@ __ROBEXT_LATEX_WRITE_DEPTH_TO_OUT_FILE__%
enable placeholders,
% This way it appears before orig in the list: more efficient
import placeholders from group={latex},
+ %/utils/exec={\message{I am in the latex style!!!!!!}},
set placeholder={__ROBEXT_MAIN_CONTENT__}{__ROBEXT_MAIN_CONTENT_ORIG__},
import placeholder={__ROBEXT_MAIN_CONTENT_ORIG__},
first placeholders latex,
set template={__ROBEXT_LATEX__},
set compilation command={__ROBEXT_LATEX_COMPILATION_COMMAND__},
%% Configure the latex compilation engine
+ add to compilation command options/.style={
+ add to placeholder={__ROBEXT_LATEX_COMPILATION_COMMAND_OPTIONS__}{#1},
+ },
use latexmk/.style={
set placeholder={__ROBEXT_LATEX_ENGINE__}{latexmk},
},
@@ -2787,9 +3450,9 @@ def finished_with_no_error():
created (otherwise robust-externalize will think that the compilation failed)
'''
if not os.path.exists(get_filename_from_extension(".pdf")):
- # we create an empty path
+ # we create a nearly empty pdf (not empty or arxiv will remove it)
with open(get_filename_from_extension(".pdf"), 'w') as f:
- pass
+ f.write("ok")
### Starting main content
__ROBEXT_MAIN_CONTENT__
@@ -2810,6 +3473,7 @@ finished_with_no_error()
\robExtConfigure{
python/.style={
enable placeholders,
+ print whole file in error message,
import placeholders={__ROBEXT_PYTHON__,__ROBEXT_PYTHON_IMPORT__,__ROBEXT_PYTHON_MAIN_CONTENT_WRAPPED__,__ROBEXT_PYTHON_FINISHED_WITH_NO_ERROR__,__ROBEXT_PYTHON_EXEC__},
set compilation command={__ROBEXT_PYTHON_EXEC__ "__ROBEXT_SOURCE_FILE__"},
set template={__ROBEXT_PYTHON__},
@@ -2906,13 +3570,24 @@ print_file.close()
\robExtClearGroupPlaceholders{main}
+%% Inspired by
+%% https://tex.stackexchange.com/questions/259247/rescaling-gnuplottex-to-fit-in-subfigure/259271
+\ExplSyntaxOn
+\DeclareExpandableDocumentCommand{\robExtLenToCm}{ O{cm} m }
+{
+ \dim_to_decimal_in_unit:nn { #2 } { 1 #1 } #1
+}
+\ExplSyntaxOff
+\let\lenToCm\robExtLenToCm
+
\robExtConfigure{
verbatim text/.style={
enable placeholders,
set template={__ROBEXT_MAIN_CONTENT__},
custom include command={\evalPlaceholder{\verbatiminput{\robExtAddCachePathAndName{\robExtFinalHash.tex}}}},
%% Apparently this works on windows as well https://stackoverflow.com/questions/1702762/how-can-i-create-an-empty-file-at-the-command-line-in-windows
- set compilation command={echo "" > __ROBEXT_OUTPUT_PDF__},
+ %% We do not want it to be empty or arXiv will remove the file.
+ set compilation command={echo "ok" > __ROBEXT_OUTPUT_PDF__},
},
verbatim text no include/.style={
verbatim text,
@@ -2928,6 +3603,94 @@ print_file.close()
%%%%%%
+%%%%%% Group "gnuplot"
+%%%%%%
+
+% We clean the "main" group, that we will copy later to gnuplot.
+\robExtClearGroupPlaceholders{main}
+
+\begin{PlaceholderFromCode}*{__GNUPLOT_TEMPLATE__}
+set terminal __ROBEXT_GNUPLOT_TERMINAL__
+set output "__ROBEXT_GNUPLOT_OUTPUTFILE__"
+set loadpath "__ROBEXT_WAY_BACK__"
+__ROBEXT_GNUPLOT_PRELUDE__
+__ROBEXT_MAIN_CONTENT__
+\end{PlaceholderFromCode}
+
+\begin{PlaceholderFromCode}{__ROBEXT_GNUPLOT_PRELUDE__}
+\end{PlaceholderFromCode}
+
+\robExtCopyGroupPlaceholders{gnuplot}{main}
+\robExtRegisterGroupPlaceholders{gnuplot}
+
+\robExtConfigure{
+ new preset={gnuplot}{
+ enable placeholders,
+ print whole file in error message,
+ import placeholders from group={gnuplot},
+ set compilation command={gnuplot -c "__ROBEXT_SOURCE_FILE__" && echo "ok" > "__ROBEXT_OUTPUT_PDF__"},
+ set terminal/.style={
+ set placeholder={__ROBEXT_GNUPLOT_TERMINAL__}{#1},
+ },
+ % The extension is important. Notably, the cairolatex expects a .tex.
+ set filename/.style={
+ set placeholder={__ROBEXT_GNUPLOT_OUTPUTFILE__}{__ROBEXT_OUTPUT_PREFIX__-gnuplot-#1},
+ set placeholder={__ROBEXT_INCLUDEGRAPHICS_FILE__}{\robExtAddCachePathAndName{\robExtFinalHash-gnuplot-#1}},
+ },
+ pdf terminal/.style={
+ set terminal={pdf #1},
+ set filename={.pdf},
+ },
+ pdf terminal/.default={},
+ pdf terminal,
+ is tex output/.style={
+ set filename={.tex},
+ add cache to graphicspath, % At least in cairolatex, we first need to input a file that includegraphics an image in the cache.
+ custom include command={\message{We will input the file \robExtAddCachePathAndName{\robExtFinalHash-gnuplot-.tex}}\input{\robExtAddCachePathAndName{\robExtFinalHash-gnuplot-.tex}}},
+ },
+ tikz terminal/.style={
+ set terminal={tikz #1},
+ is tex output,
+ },
+ tikz terminal/.default={},
+ % Warning: you cannot define this option with the name "tikz" if you try to nest elements, for instance
+ % if the include command calls an \input that calls a tikz picture, that is cached by \cacheTikz and therefore
+ % call the "tikz" preset that is now changed.
+ cairolatex terminal/.style={
+ set terminal={cairolatex #1},
+ is tex output,
+ },
+ cairolatex terminal/.default={},
+ set template={__GNUPLOT_TEMPLATE__},
+ print verbatim if no externalization,
+ },
+}
+
+
+% Like \gpgetvar but do not produce an error if the variable does not exist yet
+% Fix https://github.com/leo-colisson/robust-externalize/issues/17
+\ExplSyntaxOn
+\NewDocumentCommand{\robExtGpgetvar}{m}{%
+ \ifcsname gp@var@#1\endcsname%
+ \gpgetvar{#1}%
+ \else%
+ \msg_warning:nnx{robExt}{gpgetvar recompilation needed}{#1}%
+ \emph{Please~recompile~to~load~ variable:~}%
+ \texttt{\tl_to_str:n {#1}}%
+ \fi%
+}
+% Is useful if you want a number even if there is an error https://github.com/leo-colisson/robust-externalize/issues/17#issuecomment-1862556771
+% It must be expandable.
+\NewExpandableDocumentCommand{\robExtGpgetvarNb}{sO{404}m}{%
+ \ifcsname gp@var@#3\endcsname%
+ \gpgetvar{#3}%
+ \else% We cannot print a waring or siunit will complain.
+ \sys_if_engine_luatex:TF{\directlua{texio.write_nl('Warning:~the~variable~#3~used~in~robExtGpgetvarNb~does~not~exist~yet.~Please~recompile.')}}{}#2%
+ \fi%
+}
+\ExplSyntaxOff
+
+%%%%%%
%%%%%% Group "bash"
%%%%%%
@@ -2941,7 +3704,7 @@ outputTex="__ROBEXT_OUTPUT_PREFIX__-out.tex"
outputPdf="__ROBEXT_OUTPUT_PDF__"
__ROBEXT_MAIN_CONTENT__
# Create the pdf file to certify that no compilation error occured
-touch "${outputPdf}"
+echo "ok" > "${outputPdf}"
\end{RobExtPlaceholderFromCode}
\robExtSetPlaceholder{__ROBEXT_BASH_SHELL__}{bash}
@@ -2949,6 +3712,7 @@ touch "${outputPdf}"
\robExtConfigure{
bash/.style={
enable placeholders,
+ print whole file in error message,
import placeholders={__ROBEXT_BASH_TEMPLATE__,__ROBEXT_BASH_SHELL__},
set compilation command={__ROBEXT_BASH_SHELL__ "__ROBEXT_SOURCE_FILE__"},
set template={__ROBEXT_BASH_TEMPLATE__},
@@ -2960,6 +3724,50 @@ touch "${outputPdf}"
\robExtRegisterGroupPlaceholders{bash}
%%%%%%
+%%%%%% Group "web image", to download images automatically
+%%%%%%
+
+\robExtClearGroupPlaceholders{main}
+
+% \begin{RobExtPlaceholderFromCode}{__ROBEXT_BASH_TEMPLATE__}
+% # Quit if there is an error
+% set -e
+% outputTxt="__ROBEXT_OUTPUT_PREFIX__-out.txt"
+% outputTex="__ROBEXT_OUTPUT_PREFIX__-out.tex"
+% outputPdf="__ROBEXT_OUTPUT_PDF__"
+% __ROBEXT_MAIN_CONTENT__
+% # Create the pdf file to certify that no compilation error occured
+% echo "ok" > "${outputPdf}"
+% \end{RobExtPlaceholderFromCode}
+
+\robExtConfigure{
+ web image/.style={
+ enable placeholders,
+ print whole file in error message,
+ wget/.style={
+ set compilation command move if no error={wget "__ROBEXT_MAIN_CONTENT__" -O "__ROBEXT_OUTPUT_PDF__-tmp"},
+ },
+ curl/.style={
+ set compilation command move if no error={curl "__ROBEXT_MAIN_CONTENT__" -L -o "__ROBEXT_OUTPUT_PDF__-tmp"},
+ },
+ if unix={
+ wget
+ },
+ if windows={
+ curl
+ },
+ set template={},
+ }
+}
+
+\NewDocumentCommand{\robExtIncludegraphicsWeb}{D<>{}O{}m}{\robExtCacheMe[web image,set includegraphics options={#2},#1]{#3}}
+\let\includegraphicsWeb\robExtIncludegraphicsWeb
+
+\robExtCopyGroupPlaceholders{web image}{main}
+\robExtRegisterGroupPlaceholders{web image}
+
+
+%%%%%%
%%%%%% Group "default", available in all styles
%%%%%%
@@ -3063,6 +3871,7 @@ touch "${outputPdf}"
}
\NewDocumentCommand{\robExtExternalizeAllTikzpictures}{O{tikz}O{tikzpicture}O{<>}}{%
+ \robExtDoNotExternalizeAllTikzpictures%
\robExtCacheEnvironment[#3]{tikzpicture}{#2}%
% Tikz has a more complicated parsing system
\DeclareCommandCopy{\robExtCommandOrigtikz}{\tikz}% we save the function for later reset
@@ -3077,12 +3886,65 @@ touch "${outputPdf}"
}
\let\cacheTikz\robExtExternalizeAllTikzpictures
+\NewDocumentCommand{\robExtDoNotExternalizeAllTikzpictures}{}{%
+ \ifdefined\robExtCommandOrigtikz%
+ \DeclareCommandCopy{\tikz}{\robExtCommandOrigtikz}%
+ \let\robExtCommandOrigtikz\undefined
+ \fi%
+ \ifdefined\robExtEnvironmentOrigtikzpicture%
+ \DeclareEnvironmentCopy{tikzpicture}{robExtEnvironmentOrigtikzpicture}%
+ \let\robExtEnvironmentOrigtikzpicture\undefined
+ \fi%
+}
+\let\doNotCacheTikz\robExtDoNotExternalizeAllTikzpictures
+
+
%% The cached version
\DeclareDocumentEnvironment{tikzpictureC}{D<>{}O{}O{}}{%
\begin{CacheMe}{tikzpicture,#1}[#2]%
}{\end{CacheMe}}%
%%%%%%
+%%%%%% Cache tikzit
+%%%%%%
+
+\NewDocumentCommand{\robExtCacheTikzit}{O{tikzit}}{%
+ \ifdefined\robExtCommandOrigtikzfig\else%
+ \DeclareCommandCopy{\robExtCommandOrigtikzfig}{\tikzfig}%
+ \fi%
+ \robExtAddToCommandResetList{tikzfig}%
+ \DeclareDocumentCommand{\tikzfig}{D<>{}m}{%
+ % tikzit tries first ##2.tikz and fallsback to figures/##2.tikz otherwise.
+ \IfFileExists{##2.tikz}{\def\robExtTikzfigFile{##2}}{\def\robExtTikzfigFile{figures/##2}}%
+ \expanded{\noexpand\cacheMe[
+ #1,
+ add dependencies/.expanded={\robExtTikzfigFile.tikz},
+ ##1,
+ command if no externalization/.code={\noexpand\robExtDisableTikzpictureOverwrite\noexpand\robExtCommandOrigtikzfig{##2}},
+ ]{\noexpand\tikzfig{__ROBEXT_WAY_BACK__\robExtTikzfigFile}}}%
+ }%
+}
+\let\cacheTikzit\robExtCacheTikzit
+
+\NewDocumentCommand{\robExtCacheTikzitWithStyle}{O{tikzit}m}{%
+ \robExtCacheTikzit[#1]%
+ \robExtConfigure{
+ % First, we copy the tikzit-related files to the cache:
+ copy file to cache={tikzit.sty},
+ copy file to cache={#2},
+ % We create the tikzit preset loaded by default:
+ new preset={#1}{
+ latex,
+ add to preamble={
+ \usepackage{tikzit}
+ \input{#2}
+ },
+ },
+ }%
+}
+\let\cacheTikzitWithStyle\robExtCacheTikzitWithStyle
+
+%%%%%%
%%%%%% The generic functions
%%%%%%
@@ -3090,7 +3952,8 @@ touch "${outputPdf}"
\NewDocumentCommand{\robExtCacheEnvironment}{O{<>}mm}{%
%% We need to save the original environment to avoid infinite recursion if we disable externalization
%% https://tex.stackexchange.com/questions/695391/why-isnt-my-environment-restored/695398
- \NewEnvironmentCopy{robExtEnvironmentOrig#2}{#2}%
+ \ifcsname robExtEnvironmentOrig#2\endcsname\PackageWarning{Your are trying to cache an environment #2 that seems to be already cached... Expect weird things to happen.}{}\fi
+ \DeclareEnvironmentCopy{robExtEnvironmentOrig#2}{#2}%
\robExtAddToEnvironmentResetList{#2}%
\DeclareDocumentEnvironment{#2}{D#1{}}{%
\def\robExtEnvironmentOrigName{#2}%
diff --git a/macros/latex/contrib/robust-externalize/robust-externalize.tex b/macros/latex/contrib/robust-externalize/robust-externalize.tex
index 58d64342c5..f06333b9fe 100644
--- a/macros/latex/contrib/robust-externalize/robust-externalize.tex
+++ b/macros/latex/contrib/robust-externalize/robust-externalize.tex
@@ -1,3 +1,4 @@
+%\pdfoutput=1% Do not remove, needed for arxiv
\documentclass[a4paper,doc2]{ltxdoc} % doc2 is needed to force the old version, or links get colored in a weird red way even with hidelinks. https://github.com/latex3/latex2e/issues/822
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -10,15 +11,24 @@
\usepackage{amsmath}
\usepackage[margin=3cm]{geometry}
\usepackage{calc}
+\usepackage{siunitx}
\usepackage{tikz}
+\usepackage{tikzit}
+\input{new_zxstyle.tikzstyles}
\usetikzlibrary{shadows,fit}
% \usetikzlibrary fails because file is not in current directory, lazy to setup TEXINPUTS
\makeatletter
\usepackage{robust-externalize}
\makeatother
\robExtConfigure{
- enable optimizations
-}
+ enable optimizations,
+ copy file to cache={zx-calculus.sty},
+ copy file to cache={tikzlibraryzx-calculus.code.tex},
+ % You need to uncomment that line to rename the .tex files into .tex-backup
+ % backup source for arxiv,
+ rename backup files for arxiv,
+ print source when saving, % debug
+}
\usepackage{zx-calculus}
\usepackage{forest}
\setlength{\marginparwidth}{2cm}
@@ -26,6 +36,7 @@
% Loads the great package that produces tikz-like manual (see also tikzcd for examples)
\input{pgfmanual-en-macros.tex} % Is supposed to be included in recent TeX distributions, but I get errors...
+\usepackage{gnuplot-lua-tikz} %% Generate with gnuplot -e "set terminal tikz createstyle"
%% For verbatim environments:
@@ -94,7 +105,7 @@
{\Large\bfseries Cache anything (\tikzname, tikz-cd, python…),\\in a robust, efficient and pure way.}
\vspace{1em}
- {Léo Colisson \quad Version 2.2}\\[3mm]
+ {Léo Colisson \quad Version 2.5}\\[3mm]
{\href{https://github.com/leo-colisson/robust-externalize}{\texttt{github.com/leo-colisson/robust-externalize}}}
\end{center}
@@ -102,10 +113,11 @@
\bigskip
-\textbf{WARNING: This library is young and might lack some testing (and is an important rewrite of a previous version), but v2.0 is definitely usable. Even if we try to stay backward compatible, the only guaranteed way to be immune to changes is to copy/paste the library in your main project folder. Please report any bug to \url{https://github.com/leo-colisson/robust-externalize}!}
+\textbf{WARNING: Even if we try to stay backward compatible, the only guaranteed way to be 100\% immune to changes is to copy/paste the\ .sty file of the library in your main project folder. Please report any bug to \url{https://github.com/leo-colisson/robust-externalize}!}
-\textbf{WARNING 2: the coming version 2.1 improves significantly the compilation time compared with 2.0 that was surprisingly slow. Now, it is fairly well optimized (but the code needs a bit of cleaning and documentation before doing an official release)}
+\textbf{WARNING 2: the recent versions 2.1 and 2.2 improves significantly the compilation time compared with 2.0 that was surprisingly slow. Now, it is fairly well optimized, and version 2.3 is even more optimized.}
+\textbf{WARNING 3: If you read this documentation from the arXiv or CTAN, you might prefer to read it from \mylink{https://github.com/leo-colisson/robust-externalize}{Github} to get the latest version.}
\section{A taste of this library}
@@ -118,7 +130,7 @@ This library allows you to cache any language: not only \LaTeX{} documents and \
enable fallback to manual mode,
}
\end{verbatim}
-Then type something like this (note the |C| for |cached| at the end of |tikzpictureC|, see below to override the original command), and compile with |pdflatex -shell-escape yourfile.tex| (or \textcolor{red}{\textbf{read below if you do not want to use }}|-shell-escape|\textcolor{red}{\textbf{ (note that overleaf enables shell-escape by default, and it not needed once all pictures are cached)}}):
+Then type something like this (note the |C| for |cached| at the end of |tikzpictureC|, see below to override the original tikz commands), and compile with |pdflatex -shell-escape yourfile.tex| (or \textcolor{red}{\textbf{read below if you do not want to use }}|-shell-escape|\textcolor{red}{\textbf{ (note that overleaf enables shell-escape by default, and it is not needed once all pictures are cached)}}):
\begin{codeexample}[width=0pt,vbox]
\robExtConfigure{
add to preset={tikz}{
@@ -128,11 +140,16 @@ Then type something like this (note the |C| for |cached| at the end of |tikzpict
}
The next picture is cached %
\begin{tikzpictureC}[baseline=(A.base)]
- \node[fill=red, rounded corners](A){My node that respects baseline \ding{164}.};
+ \node[fill=red, rounded corners](A){My node respecting baseline \ding{164}.};
\node[fill=red, rounded corners, opacity=.3,overlay] at (A.north east){I am an overlay text};
\end{tikzpictureC} and you can see that overlay and depth works.
\end{codeexample}
+Since v2.3 we also provide a way to include online pictures with |\includegraphicsWeb|:
+\begin{codeexample}[width=0pt,vbox]
+Here is a picture of cat downloaded online: \includegraphicsWeb[width=3cm]{http://placekitten.com/400/300}.
+\end{codeexample}
+
You can also cache arbitrary code (e.g.\ python). You can also define arbitrary compilation commands, inclusion commands, and presets to fit you need. For instance, you can create a preset to obtain:
\begin{codeAndResult}
@@ -145,7 +162,7 @@ for name in ["Alice", "Bob"]:
Actually, we also provide this style by default (and explain how to write it yourself), just make sure to load:
\begin{verbatim}
\usepackage{pythonhighlight}
-\usepackage{tcolorbox}
+\usepackage[most]{tcolorbox}
\end{verbatim}
You can also cache any environment and command using something like:
@@ -208,6 +225,17 @@ A ZX figure %
}
\end{codeAndResult}
\end{itemize}
+
+We also provide methods to cache automatically \mylink{https://tikzit.github.io/}{TikZit} pictures (|\cacheCommand| alone would not be sufficient as the source relies on an external file):
+
+\begin{codeexample}[vbox]
+ %%%%%%% In your preamble:
+ \cacheTikzitWithStyle{new_zxstyle.tikzstyles}
+
+ %%%%%%% In your document:
+ \tikzfig{demo} %figures/ can be omitted
+\end{codeexample}
+
You can also cache all tikz pictures by default, except those that are run from some commands (as remember picture does not work yet, this is important). For instance, this code will allow you to freely use the |todonotes| package (that uses internally tikz but is not cachable with this library since it uses remember picture) while caching all other elements:
\begin{codeexample}[code only]
%% this will cache \tikz and tikzpictures by default (using the tikz preset)
@@ -341,6 +369,13 @@ We also provide a number of other functionalities, among others:
\item And more\dots
\end{itemize}
+\section{Acknowledgments}
+
+I am deeply indebted to many users on \url{tex.stackexchange.com} that made the writing of this library possible. I can't list you all, but thank you so much! A big thanks also to the project \url{https://github.com/sasozivanovic/memoize/} from which I borrowed most of the code to automatically wrap commands. Thanks to kiryph and dflvunoooooo for providing very useful feedbacks.
+
+\section{Support}
+
+If you find this library useful, please consider citing the arXiv version of this documentation, possibly using |\nocite|. If you want to support me financially and offer me a virtual coffee, you can use my \mylink{https://github.com/sponsors/tobiasBora}{GitHub sponsor page}.
\section{Introduction}
@@ -378,10 +413,10 @@ I tested the library on Linux and Windows, but the library should work on all OS
\paragraph{Do I need to compile using -shell-escape?}
-Since we need to compile the images via an external command, the simpler option is to add the argument |-shell-escape| to let the library run the compilation command automatically (this is also the case of \tikzname's externalize library). However, people worried by security issues of |-shell-escape| (that allows arbitrary code execution if you don't trust the \LaTeX{} code) might be interested by these facts:
+Since we need to compile the images via an external command the first time, the simpler option is to add the argument |-shell-escape| to let the library run the compilation command automatically (this is also the case of \tikzname's externalize library). Note that overleaf already defines this option by default, so you don't need to do anything special in overleaf. Moreover, this is only needed \textbf{during the first compilation} since once the image is cached, |-shell-escape| is not needed anymore (therefore, on the arXiv website, you can upload the |robustExternalize| folder containing the cached images without any issue, see \cref{sec:arxiv} for details). However, people worried by security issues of |-shell-escape| (that allows arbitrary code execution if you don't trust the \LaTeX{} code) might be interested by these facts:
\begin{itemize}
-\item You can choose to display a dummy content explaining how to manually compile the pictures until they are compiled, see |enable fallback to manual mode|.
-\item You can compile manually the images: all the commands that are left to be executed are also listed in \texttt{robExt-compile-missing-figures.sh} and you can just inspect and run them, either with \texttt{bash robExt-compile-missing-figures.sh} or by typing them manually (most of the time it's only a matter of running \texttt{pdflatex somefile.tex}).
+\item You can choose to display a dummy content explaining how to manually compile the pictures instead of giving an error until they are compiled, see |enable fallback to manual mode|.
+\item You can compile manually the images: all the commands that are left to be executed are also listed in \texttt{JOBNAME-robExt-compile-missing-figures.sh} and you can just inspect and run them, either with \texttt{bash robExt-compile-missing-figures.sh} or by typing them manually (most of the time it's only a matter of running \texttt{pdflatex somefile.tex} from the \texttt{robustExternalize} folder).
\item If you allowed:
\begin{itemize}
\item |pdflatex| (needed to compile latex documents)
@@ -396,11 +431,29 @@ Since we need to compile the images via an external command, the simpler option
\paragraph{Is it working on overleaf?}
-Yes: overleaf automatically compiles documents with |-shell-escape|, so nothing special needs to be done there (of course, if you use this library to run some code, the programming language might not be available, but I heard that python is installed on overleaf servers for instance, even if this needs to be doubled checked). If the first compilation of the document to cache images times out, you can just repeat this operation multiple times until all images are cached.
+Yes: overleaf automatically compiles documents with |-shell-escape|, so nothing special needs to be done there (of course, if you use this library to run some code, the programming language might not be available, but I heard that python is installed on overleaf servers for instance, even if this needs to be doubled checked). If the first compilation of the document to cache images times out, you can just repeat this operation multiple times until all images are cached. In case of doubt, you can look at the log file to see which file is getting cached. If overleaf still times out, read the next paragraph.
+
+\paragraph{Overleaf still times-out, why?}
+
+During the first compilation, the pictures are not compiled, so you may obtain a time out. However, at each compilation, new pictures should be added to the cache, so you should eventually be able to compile (check the log file, you should read ``No need to recompile XX.pdf'' if the picture is already in the cache). If you want this to be faster, you can try to enable |\robExtConfigure{compile in parallel}| in order to compile the pictures in parallel (need 2 compilations). If you do not often change all pictures, you can also locally download the project (it might be more practical to use the git bridge if you have it enabled), compile them locally, and copy back the |robustExternalize| folder containing all cached pictures.
+
+If all pictures are still compiled, but you still experience timeouts, you can try to use compiled presets, with something like:
+\begin{verbatim}
+\robExtConfigure{
+ new compiled preset={compiled ZX}{templateZX, compile latex template}{}
+}
+\end{verbatim}
+to create a new, more efficient (we call it compiled) preset called |compiled ZX| from a preset |templateZX|.
+
+You can also try to reduce the compilation time by reducing the number of compilation passes. Indeed, overleaf will run |pdflatex| multiple times to make it converge to the final version, increasing mechanically the compilation time (for instance a file that takes 6s to compile locally was not able to compile online). You can force overleaf to compile a single time the document by creating a |latexmkrc| file at the root of the project, containing:
+\begin{verbatim}
+$max_repeat=1
+\end{verbatim}
+Of course, you might need to recompile more than once the document to reach the final version.
\paragraph{Do you have some benchmarks?}
-We completely rewrote the \href{https://github.com/leo-colisson/robust-externalize/commit/09a05a86ec9c04eb6687b75831ebb84185786ac5}{original library} to introduce the notion of placeholders (before, the template was fixed forever), allowing for greater flexibility. The original rewrite (1.0) had really poor performance compared to the original library (only x3 improvement compared to no externalization, while the old library could be 20x faster), but we made some changes (v2.0) that correct this issue. Here is a benchmark we made on an article with 159 small pictures (ZX diagrams from the zx-calculus library):
+We completely rewrote the \href{https://github.com/leo-colisson/robust-externalize/commit/09a05a86ec9c04eb6687b75831ebb84185786ac5}{original library} to introduce the notion of placeholders (before, the template was fixed forever), allowing for greater flexibility. The original rewrite (1.0) had really poor performance compared to the original library (only x3 improvement compared to no externalization, while the old library could be 20x faster), but we made some changes (v2.0) that correct this issue to recover the original speed (at least when using compiled templates). Here is a benchmark we made on an article with 159 small pictures (ZX diagrams from the zx-calculus library):
\begin{itemize}
\item without externalization: 1mn25
\item with externalization, v2.0 (first run, not in parallel): 3mn05, so takes twice the time; but (first run in parallel) takes 60s (so faster by a factor of 1.5).
@@ -453,6 +506,45 @@ Cons of \url{https://github.com/sasozivanovic/memoize}:
Note that |remember picture| is not supported in both libraries, but we can provide multiple methods to disable externalizations when |remember picture| is used.
+\subsection{How to use with arXiv}\label{sec:arxiv}
+
+You can completely use this library with the arXiv's website (this documentation is also compiled in arXiv), but you need to follow a few steps due to arXiv's particularities:
+\begin{itemize}
+\item First, arXiv does NOT allow |-shell-escape|. So you either need to disable externalization (not recommended since this will of course increase the compilation time and will not work when working with non-latex code like python or external images), or you need to compile locally the document to cache all images locally\footnote{Make sure to recompile from scratch, by removing the .aux file, if your cached pictures can depend on counters (like the current page) that can change across compilations.}, and upload the |robustExternalize/| folder containing all cached images online in a zip file.
+\item Moreover, if you choose to upload the |robustExternalize/| folder, the arXiv website will automatically remove all |.pdf| files if a |.tex| file is present (which will break this library, since it puts all sources in the |.tex| file and the output in a |.pdf| file). The trick is to rename all the source |.tex| files into |.tex-backup| (this library will automatically recreate the |.tex| from the |.tex-backup| starting from v2.4). We provide two approaches for that:
+ \begin{itemize}
+ \item \textbf{Solution 1}: if you have python installed the most robust solution is to run
+\begin{verbatim}
+$ python robExt-prepare-for-arxiv.py
+\end{verbatim}
+ before sending the document to the arXiv. This will rename all the |.tex| files in the |robust-externalize| folder that have a matching |*.pdf| file into |.tex-backup|, and list these files in |robExt-arxiv-files-to-rename.txt|. Then, add in the preamble of your document:
+ \begin{codeexample}[code only]
+ \robExtConfigure{
+ rename backup files for arxiv,
+ }
+ \end{codeexample}
+ This will automatically rename back the |.tex-backup| files into |.tex| (without needing shell-escape), based on the |robExt-arxiv-files-to-rename.txt| file (if this file exists and if the files have not already been renamed: it is therefore safe to keep this option on even without running the python code), allowing the rest of the document to compile normally.
+ \item \textbf{Solution 2}: if you do \textbf{not} have python installed, you can simply run:
+ \begin{codeexample}[code only]
+ \robExtConfigure{
+ backup source for arxiv,
+ }
+ \end{codeexample}
+ This will automatically rename the source files |.tex| into |.tex-backup| (make sure to comment this line on the final pdf sent to the arXiv). Note however that this is less robust than solution 1 since the |.tex-backup| will be renamed into |.tex| only if it is in the source, but sometimes other |.tex| files might need to be renamed as well: for instance, |gnuplot| with |cairolatex| terminal creates two files |-gnuplot-.tex| and |-gnuplot-.pdf|, and this file will not be renamed with this method, so the |-gnuplot-.pdf| file will be lost.
+ \end{itemize}
+\item This should be enough to compile most documents. But note that since the arXiv uses a different Texlive version and might try to compile other document formats, it might be the case that the number of page varies from your original document: if you uses things like |forward counter=page|, it might cause you some troubles since your local cache might contain the cache for |page=42| while the arXiv would ask for the cached value for |page=45|, producing an error like |enable -shell-escape|. There are a few steps you can follow to fix these issues:
+ \begin{itemize}
+ \item First, make sure to have the same margins/paper on your local file and online (by default arXiv will create a document in |letterpaper|). To that end, you can force the paper format with |\documentclass[a4paper]{article}|.
+ \item ArXiv might try to compile with various output formats like eps, so it might help to force a pdf output by starting your document with |\pdfoutput=1| (not sure how helpful this is, it might already be forced when we insert a pdf?).
+ \item ArXiv will automatically remove all empty files. While for some files it is not an issue (aux files and compilation logs), if this file is the |.pdf| it will be an issue. So make sure to always generate non-empty output files.
+ \item If despite these options, arXiv still tries to fetch a cached value that is not present in your local cache, you can enable
+\begin{verbatim}
+\robExtConfigure{print source when saving}
+\end{verbatim}
+ This will print in the log file the content of the |.deps| file, of the |.tex| file, and the compilation command that would have been run without the error. You can then recreate these files in the cache and compile it locally. If you do not want to copy/paste the content of the file, it might be simpler to simply see the value that differs from your own local cache and just temporarily change this value in your local document to automatically generate the correct cache entry. If the value is obtained via |forward counter=page|, you can use |forward counter force value={page}{45}| to force the value of the counter.
+ \end{itemize}
+\end{itemize}
+
\section{Tutorial}
\subsection{Installation}
@@ -473,7 +565,7 @@ If you want to display a message in the pdf on how to manually compile the file
\noindent (otherwise, it will give you an error if |-shell-escape| is disabled and if some pictures are not yet cached)
-If you forget/do not want to enable |-shell-escape|, this will give you this kind of message:
+If you forget/do not want to enable |-shell-escape|, this will give you this kind of message with instructions to follow to compile without shell escape:
\noindent {
\robExtConfigure{
@@ -486,6 +578,32 @@ If you forget/do not want to enable |-shell-escape|, this will give you this kin
}
+If you use an editor, you can usually configure |-shell-escape| directly inside the editor, even on a per-document basis. Shell-escape is enabled by default on overleaf. In emacs/auctex, just add at the end of your document:
+\begin{verbatim}
+% Local Variables:
+% TeX-command-extra-options: "--shell-escape"
+% End:
+\end{verbatim}
+save, and run |M-x revert-buffer| (Note that it seems that |--shell-escape| can be used with one or two dashes on Linux, I am not sure about the number of dashes needed in Windows.)
+
+For TeXstudio, you can enable shell-escape on the current document by adding in your document:
+\begin{verbatim}
+% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]
+\end{verbatim}
+and you might also want to enable:
+\begin{verbatim}
+\robExtConfigure{textstudio}
+\end{verbatim}
+to get clearer error messages as TeXstudio is \mylink{https://github.com/texstudio-org/texstudio/issues/1410}{fairly bad at parsing error messages} (see also |print whole file in error message|).
+
+If you use |latexmk| (with any editor), you can create a file called |.latexmkrc| containing:
+\begin{verbatim}
+$pdf_mode = 1;
+$pdflatex = 'pdflatex --shell-escape';
+\end{verbatim}
+
+For other editors, \mylink{https://tex.stackexchange.com/questions/598818/how-can-i-enable-shell-escape}{this answer} describe pretty accurately the solutions you have depending on your software.
+
\subsection{Caching a tikz picture}
If you only care about \tikzname's picture, you have 3 options:
@@ -610,11 +728,48 @@ Note that if you use the |tikzpictureC| or |tikzpicture| syntax, you want to add
\textbf{Important}: Note that the preset options can be specified in a number of places: in |\robExtConfigure| (possibly in a group, or inside a preset), in the options of the picture, in the default options of |cacheEnvironment| and |cacheCommand| etc. Most options can be used in all these places, the only difference being the scope of the options.
+If you find yourself duplicating code between the main document and the preamble of the cached file, we provide multiple solutions with different properties:
+\begin{itemize}
+\item Recommended: |\newcommandAutoForward| etc, to automatically forward specific macros/colors etc: see \cref{sec:forwardIntro}. Very useful if you want maximum purity without annoying recompilation.
+\item |\runHereAndInPreambleOfCachedFiles|: mostly useful if you want to always add a text both in the current file and in the cached files, like a font etc.
+\item Share a common input file with or without dependencies (see \cref{sec:dependencies}), useful if you need to work with external files or if you do NOT want purity (i.e.\ you can choose not to recompile the file even if its content changes).
+\end{itemize}
+
+|\runHereAndInPreambleOfCachedFiles{XXX}| is very simple (need at least version 2.3), as it is simply a shortcut for typing |XXX| in the current file and in the preamble of the cached files (default to latex preset). For instance if you want the current file and all cached files to use the Times New Roman font, you can do:
+
+\begin{codeexample}[code only]
+% By default adds
+\runHereAndInPreambleOfCachedFiles{
+ \usepackage{fontspec}
+ % need lualatex or xelatex to compile
+ \setmainfont{Times New Roman}
+}
+
+\robExtConfigure{
+ add to preset={latex}{
+ use lualatex, % Make sure to compile with lualatex the cached images.
+ },
+}
+\end{codeexample}
+
+You can also define your common macros (even if we recommend |\newcommandAutoForward| to avoid frequent recompilations when the definitions changes):
+\begin{codeexample}[width=0pt,vbox]
+\runHereAndInPreambleOfCachedFiles{
+ \def\name#1{The great lady #1 and her friends.}
+}
+
+\cacheTikz
+This is the picture of \name{Alice}:
+\begin{tikzpicture}
+ \node[fill=orange]{\name{Alice}};
+\end{tikzpicture}
+\end{codeexample}
+
\subsection{Dependencies}\label{sec:dependencies}
-\textbf{Note: dependencies can sometimes be advantageously replaced with auto-forwarding of arguments, cf.\ \cref{sec:forwardIntro}.}
+\textbf{Note: dependencies can sometimes be advantageously replaced with auto-forwarding of arguments, cf.\ \cref{sec:forwardIntro}, or |\runHereAndInPreambleOfCachedFiles|.}
-It might be handy to have a file that is loaded in both the main document and in the cached pictures. For instance, if you have a file |common_inputs.tex| that you want to input in both the main file and in the cached files, that contains, say:\\
+It might be handy to have a file that is loaded in both the main document and in the cached pictures. For instance, if you have a logo that might be included in the cached files, or if you have a file |common_inputs.tex| that you want to input in both the main file and in the cached files, that contains, say:\\
|\def\myValueDefinedInCommonInputs{42}|\\
then you can add it as a dependency this way (here we use the |latex| preset that does not wrap the code inside a |tikzpicture| only to illustrate that we can also cache things that are not generated by tikz):
\begin{codeexample}[width=0pt,vbox]
@@ -628,6 +783,13 @@ Note that the placeholder |__ROBEXT_WAY_BACK__| contains the path from the cache
You can note that we used |add dependencies={common_inputs.tex}|: this allows us to recompile the files if |common_inputs.tex| changes. If you do not want this behavior (e.g. |common_inputs.tex| changes too often and you do not want to recompile everything at every change), you can remove this line, but beware: if you do a breaking changes in |common_inputs.tex| (e.g.\ redefine |42| to |43|), then the previously cached picture will not be recompiled! (So you will still read 42 instead of 43.)
+Sometimes, it can also be useful to copy a file in the cache folder. This can be done via:
+\begin{codeexample}[code only]
+\robExtConfigure{
+ copy file to cache={zx-calculus.sty},
+}
+\end{codeexample}
+
\subsection{Wrap arbitrary environments}
You can wrap arbitrary environments using the already presented |cacheEnvironment| and |cacheCommand|, where the first mandatory argument is the name of the environment/macro, and the second mandatory argument contains the default preset. |cacheEnvironment| works for any environment while |cacheCommand| might need a bit of help to determine the signature of the macro if the function is defined via xparse. Long story short, |O{foo}| is an optional argument with default value foo, |m| is a mandatory argument. By default, you can pass an optional arguments via the first argument enclosed in |<>|:
@@ -725,6 +887,7 @@ Some text %
You can feed data from the main document to the cached file using placeholders, since |set placeholder eval={__foo__}{\bar}| will evaluate |\bar| and put the result in |__foo__|. For instance, if the picture depends on the current page, you can do:
+\message{We will export the page: \thepage}
\begin{codeexample}[width=0pt,vbox]
\begin{tikzpictureC}<set placeholder eval={__thepage__}{\thepage}>
\node[rounded corners, fill=red]{The current page is __thepage__.};
@@ -820,6 +983,105 @@ We compute this data that is long to compute:
We computed the cached value \myLongResult.
\end{codeexample}
+\subsection{A note on font handling}
+
+Cached pictures are basically simple latex files that are compiled in a separate |standalone| document. Therefore, if the main document loads a different font, there is no reason for the cached document to also use that font. Fully-automatically forwarding the current font by default is not so easy because there are so many ways to load a font in LaTeX (by loading a package like |\usepackage{times}|, by using xelatex or lualatex, by calling locally |\rmfamily|, by loading a different class… and here I'm not even mentioning math font where each symbol \mylink{https://tex.stackexchange.com/questions/603475/is-there-any-command-to-find-out-the-current-math-font-used)}{can use a different font}, and this is even more complicated if the main file is compiled with a different engine (e.g.\ what should I do if the main document is compiled with lualatex but the inner cached images are compiled with pdflatex, that supports very few fonts by default?). For these reasons, it is simpler to simply let the user load fonts as they want, for instance using something like:
+\begin{codeexample}[width=0pt]
+\robExtConfigure{
+ add to preset={latex}{
+ add to preamble={\usepackage{times}},
+ },
+}
+
+\begin{tikzpictureC}
+\node[fill=green]{See I am using times font};
+\end{tikzpictureC}
+\end{codeexample}
+or:
+\begin{codeexample}[width=0pt]
+\robExtConfigure{
+ add to preset={latex}{
+ add to latex options={12pt},
+ },
+}
+
+\begin{tikzpictureC}
+\node[fill=green]{See I am using a 12pt font};
+\end{tikzpictureC}
+\end{codeexample}
+
+But if you want to use the same font as the current document, you might want to avoid code duplication (this might also be useful for any arbitrary code). Since v2.3, you can do:
+\begin{codeexample}[code only]
+\runHereAndInPreambleOfCachedFiles{
+ \usepackage{fontspec}
+ % need lualatex or xelatex to compile
+ \setmainfont{Times New Roman}
+}
+
+\robExtConfigure{
+ add to preset={latex}{
+ use lualatex, % Make sure to compile with lualatex the cached images.
+ },
+}
+\end{codeexample}
+and it will automatically compile the cached images with lualatex, and configure the font of the current document and of the cached documents to follow |Times New Roman|.
+
+If you like to often change the font in the document, you can also do something like that to always compile the document with the font currently in use if you use lualatex (this code fails with \mylink{https://tex.stackexchange.com/questions/705208/get-current-font}{xelatex}, currently trying to understand why):
+\begin{codeexample}[code only]
+\usepackage{fontspec}
+\setmainfont{Times New Roman}
+
+%% needed since \f@family contains a @ in its name:
+\makeatletter
+\def\myCurrentFont{\f@family}
+\makeatother
+
+\robExtConfigure{
+ add to preset={latex}{
+ use lualatex,
+ % create a new placeholder containing the name of the current font:
+ set placeholder eval={__MY_FONT__}{\myCurrentFont},
+ add to preamble={
+ \usepackage{fontspec}
+ \setmainfont{__MY_FONT__}
+ },
+ },
+}
+\end{codeexample}
+If you want this to work on xelatex, you can either manually attribute a |NFSSFamily| name like:
+\begin{codeexample}[code only]
+\runHereAndInPreambleOfCachedFiles{
+ \usepackage{fontspec}
+ % need lualatex or xelatex to compile, make sure to use a different NFSSFamily for each new font you add here
+ \setmainfont[NFSSFamily=tmsnr]{Times New Roman}
+}
+\end{codeexample}
+and use the above solution for lualatex (you can change the font with |\fontfamily{tmsnr}\selectfont|), or do instead something like this:
+\begin{codeexample}[code only]
+% Create a new command \mysetmainfont which forwards the font to the picture.
+\NewDocumentCommand{\mysetmainfont}{m}{%
+ \def\myCurrentFont{#1}% Stores the name of the current font in \myCurrentFont
+ \setmainfont{#1}%
+}
+
+% Use mysetmainfont from now to change font:
+\mysetmainfont{Times New Roman}
+
+\usepackage{robust-externalize}
+\robExtConfigure{
+ add to preset={latex}{
+ use xelatex,
+ set placeholder eval={__MY_FONT__}{\myCurrentFont},
+ add to preamble={
+ \usepackage{fontspec}
+ \setmainfont{__MY_FONT__}
+ },
+ },
+}
+\end{codeexample}
+
+
+
\subsection{Compile in parallel}
Make sure to have xargs installed (installed by default on most linux, on Windows you need to install the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow}), and type in your preamble:
\begin{codeexample}[code only]
@@ -1162,7 +1424,8 @@ We also provide support for other languages, notably |bash|, but it is relativel
set -e
__ROBEXT_MAIN_CONTENT__
# Create the pdf file to certify that no compilation error occured
-touch "__ROBEXT_OUTPUT_PDF__"
+# (non empty file to avoid arXiv error)
+echo "ok" > "__ROBEXT_OUTPUT_PDF__"
\end{PlaceholderFromCode}
\robExtConfigure{
@@ -1216,7 +1479,9 @@ plt.savefig("__ROBEXT_OUTPUT_PDF__")
If you want to recompile a file (e.g. an untracked dependency was changed\dots{} and you do not want to track it to avoid recompilation when you change a single line in this file), you can use the |recompile| style since v2.1:
-\begin{codeexample}[vbox]
+\begin{codeexample}[vbox,
+ %TURN_INTO_CODE_ONLY_ARXIV
+ ]
\cacheEnvironment{tikzcd}{tikz, add to preamble={\usepackage{tikz-cd}}}
\begin{tikzcd}<recompile>
A \rar & B
@@ -1248,7 +1513,7 @@ Note also that we usually define two names for each function, one normal and one
\subsection{Placeholders}\label{sec:placeholders}
-Placeholders are the main concept allowing this library to generate the content of a source file based on a template (a template will itself be a placeholder containing other placeholders). A placeholder is a special strings like |__COLOR_IMAGE__| that should start and end with two underscores, ideally containing no space or double underscores inside the name directly. Placeholders are inserted for instance in a string and will be given a value later. This value will be used to replace (recursively) the placeholder in the template. For instance, if a placeholder |__LIKES__| contains |I like __FRUIT__ and __VEGETABLE__|, if the placeholder |__FRUIT__| contains |oranges| and if the placeholder |__VEGETABLE__| contains |salad|, then evaluating |__LIKES__| will output |I like oranges and salad.|
+Placeholders are the main concept allowing this library to generate the content of a source file based on a template (a template will itself be a placeholder containing other placeholders). A placeholder is a special strings like |__COLOR_IMAGE__| that should start and end with two underscores, ideally containing no space or double underscores inside the name directly (we might use this property even more in a future release to improve further the efficiency). Placeholders are inserted for instance in a string and will be given a value later. This value will be used to replace (recursively) the placeholder in the template. For instance, if a placeholder |__LIKES__| contains |I like __FRUIT__ and __VEGETABLE__|, if the placeholder |__FRUIT__| contains |oranges| and if the placeholder |__VEGETABLE__| contains |salad|, then evaluating |__LIKES__| will output |I like oranges and salad.|
Note that you are not strictly forced to follow the above convention (it allows us to optimize the code to find and replace placeholders), but in that case you should enable |not all placeholders have underscores|.
@@ -1405,6 +1670,18 @@ Compare with:
\placeholderFromContent{__NAME__}{Alice}
The (unexpanded) template contains \texttt{\getPlaceholderNoReplacement{__LIKES__}}
\end{codeexample}
+Note that this macro is expandable, which can be helpful for instance if you use |siunitx| that expects an expandable content:
+\begin{codeexample}[width=0pt,vbox]
+\setPlaceholder{__TEST__}{4.42345}
+\num[round-mode=figures,round-precision=3]{\getPlaceholderNoReplacement{__TEST__}}
+\end{codeexample}
+This is contrary to |\getPlaceholder| that is not expandable, so if you do want expandable |\getPlaceholder| with replacements, you should rather first evaluate the placeholder with |\getPlaceholderInResult{__TEST_VARIABLE__}|:
+\begin{codeexample}[width=0pt,vbox]
+\setPlaceholder{__TEST_A__}{4.42345}
+\setPlaceholder{__TEST__}{__TEST_A__}
+\getPlaceholderInResult{__TEST_A__}
+\num[round-mode=figures,round-precision=3]{\robExtResult}
+\end{codeexample}
\end{pgfmanualentry}
\subsubsection{Setting a value to a placeholder}
@@ -2297,9 +2574,16 @@ plt.ylabel('Number of futurestud.io Tutorials')
\makeatletter%
\def\extrakeytext{style, }
\extractkey/robExt/set compilation command=\marg{compilation command}\@nil
+ \extractkey/robExt/set compilation command create if no error=\marg{compilation command}\@nil
+ \extractkey/robExt/set compilation command move if no error=\marg{compilation command}\@nil
\makeatother%
\pgfmanualbody
- Style that alias to |set placeholder={__ROBEXT_COMPILATION_COMMAND__}{#1}|, in order to define the placeholder that will hold the compilation command.
+ |set compilation command| is equivalent to |set placeholder={__ROBEXT_COMPILATION_COMMAND__}{#1}|, in order to define the placeholder that will hold the compilation command.
+
+ Then, |set compilation command move if no error| (new in v2.4)
+ is like |set compilation command| except that it will copy the file located in |__ROBEXT_OUTPUT_PDF__-tmp| into |__ROBEXT_OUTPUT_PDF__| if the command succeeds (returns a status code of 0), and otherwise it will not create the |__ROBEXT_OUTPUT_PDF__| at all, creating an error message. This is needed by some programs that will create an output file even if an error occurs, for instance wget will still create an empty file if there is no internet connection, producing no error during the compilation, which can be confusing.
+
+ |set compilation command create if no error| (new in v2.4) will, on the other hand, create an empty |__ROBEXT_OUTPUT_PDF__| file if the command succeeds (only useful if you use a custom include command).
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2353,7 +2637,9 @@ plt.ylabel('Number of futurestud.io Tutorials')
\pgfmanualbody
(new to v2.1) |recompile| will force a compilation even if the image is already cached (mostly useful if you made a change to a non-tracked dependency). Note that since this library does not want to remove any file on the hard drive (we do not want to risk to remove important files in case of a bug), this command will NOT clear the auxiliary files already present, so for maximum purity, ensure that your compiling command is idempotent (so that compiling twice gives the same outcome as compiling once).
-\begin{codeexample}[vbox]
+\begin{codeexample}[vbox,
+ %TURN_INTO_CODE_ONLY_ARXIV
+ ]
\cacheEnvironment{tikzcd}{tikz, add to preamble={\usepackage{tikz-cd}}}
\begin{tikzcd}<recompile>
A \rar & B
@@ -2393,6 +2679,15 @@ You want to delete the file \texttt{\filetodeleteInCache.pdf}. %
\end{pgfmanualentry}
+\begin{pgfmanualentry}
+ \extractcommand\robExtMv\@@
+ \extractcommand\robExtCp\@@
+ \pgfmanualbody
+ (new in v2.4) Respectively expands to |mv| and |cp| in linux/unix and to |move| and |copy| in Windows (needed to create a compilation command that works in both linux and windows). Note that |set compilation command| does NOT expand its argument by default and spaces after macros are removed by latex, so you need to use |/.expanded| and |\space| like in:
+ \begin{codeexample}[code only]
+ set compilation command/.expanded={\robExtCp\space"__ROBEXT_SOURCE_FILE__" "__ROBEXT_OUTPUT_PDF__"}
+ \end{codeexample}
+\end{pgfmanualentry}
\subsubsection{Options to configure the inclusion command}
@@ -2413,19 +2708,26 @@ The inclusion command is the command that is run to include the cached file back
\makeatletter%
\def\extrakeytext{style, }
\extractkey/robExt/custom include command=\marg{include command}\@nil
+ \extractkey/robExt/include command is input=\opt{\oarg{additional code to run}}\@nil
\makeatother%
\pgfmanualbody
- Sets the command to run to include the compiled file, after checking if the file has been correctly compiled and loading |*-out.tex| (useful to pass information back to the pdf).
+ Sets the command to run to include the compiled file, after checking if the file has been correctly compiled and loading |*-out.tex| (useful to pass information back to the pdf). |include command is input={SOME CODE}| is a shortcut for:
+\begin{verbatim}
+custom include command={SOME CODE\input{\robExtAddCachePathAndName{\robExtFinalHash.pdf}}},
+\end{verbatim}
\end{pgfmanualentry}
\begin{pgfmanualentry}
\makeatletter%
\def\extrakeytext{style, }
\extractkey/robExt/do not include pdf\@nil
+ \extractkey/robExt/include command is input=\opt{additional command}\@nil
\makeatother%
\pgfmanualbody
- Do not include the pdf. Useful if you only want to compile the file but use it later (note that you should still generate a |.pdf| file, possibly empty, to indicate that the compilation runs smootly). Equivalent to:\\
+ |do not include pdf| do not include the pdf. Useful if you only want to compile the file but use it later (note that you should still generate a |.pdf| file, possibly empty, to indicate that the compilation runs smootly). Equivalent to:\\
|custom include command={}|
+ Use |include command is input| (v2.3 and after) in order to specify that you should |\input| the |.pdf| file (note that despite the extension, it should still contain a LaTeX code). You can also specify an optional command to run before. Equivalent to:
+ |custom include command={#1\input{\robExtAddCachePathAndName{\robExtFinalHash.pdf}}}|
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2465,6 +2767,16 @@ The inclusion command is the command that is run to include the cached file back
By default, the include commands runs |\includegraphics| on the pdf, and possibly raises it if needed. You can customize the arguments passed to |\includegraphics| here.
\end{pgfmanualentry}
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/add cache to graphicspath\@nil
+ \makeatother%
+ \pgfmanualbody
+ This will add the folder containing the cache in the |\graphicspath{}|. Mostly useful if you need to input a file from the cache that does |\includegraphics{foo}| where |foo| is an image from the cache itself (looking at you gnuplot).
+\end{pgfmanualentry}
+
+
\subsubsection{Configuration of the cache}
If needed, you can configure the cache:
@@ -2497,6 +2809,24 @@ If needed, you can configure the cache:
\begin{pgfmanualentry}
\makeatletter%
\def\extrakeytext{style, }
+ \extractkey/robExt/set output directory=\marg{output directory}\@nil
+ \makeatother%
+ \pgfmanualbody
+ If you compile with |--output-directory build|, you also need to tell this library that you are compiling with |--output-directory build|. As I can't find a reliable way to get this value, even using |TEXMF_OUTPUT_DIRECTORY|, you need to specify manually the compilation directory. To do that, you can either compile with:
+ \begin{codeexample}[code only]
+ pdflatex -shell-escape -output-directory=build "\def\robExtOutputDirectory{build}\input{test.tex}"
+ \end{codeexample}
+ or add in your file:
+ \begin{codeexample}[code only]
+ \robExtConfigure{
+ set output directory=build,
+ }
+ \end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
\extractkey/robExt/no cache folder\@nil
\makeatother%
\pgfmanualbody
@@ -2580,6 +2910,7 @@ Some text %
\def\extrakeytext{style, }
\extractkey/robExt/command if no externalization\@nil
\extractkey/robExt/command if externalization\@nil
+ \extractkey/robExt/run command if externalization=\marg{code}\@nil
\makeatother%
\pgfmanualbody
You can easily change the command to run if externalization is disabled using by setting the \textbf{.code} of this key. By default, it is configured as:\\
@@ -2589,7 +2920,7 @@ command if no externalization/.code={%
}
\end{verbatim}
Unless you know what you are doing, you should include |\robExtDisableTikzpictureOverwrite| as it is often necessary to avoid infinite recursion when externalization is disabled and the original command has been replaced with a cached version (for instance done by |\cacheTikz|). Note that if you write your own style, try to modify |__ROBEXT_MAIN_CONTENT__| so that it can be included as-it in a document: this way you do not need to change this command.
- You can also use |command if externalization/.append code={...}| if you want to run a code only if externalization is enabled (this is used for instance by the |forward| functionality).
+ You can also use |command if externalization/.append code={...}| if you want to run a code only if externalization is enabled (this is used for instance by the |forward| functionality), but we advise you rather to use |run command if externalization={...}| as this will also work if the style is executed while |command if externalization| is already running (this might occur when calling the style inside |if matches word|, for instance when forwarding colors).
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2665,6 +2996,23 @@ In order to enforce reproducibility, you should tell what are the files that you
Note that the placeholder |__ROBEXT_WAY_BACK__| contains the path from the cache folder (containing the |.tex| that will be cached) to the root folder.\\ This way, you can easily input files contained in the root folder.
\end{pgfmanualentry}
+\begin{pgfmanualentry}
+ \extractcommand\copyFileToCache\@@
+ \extractcommand\forceCopyFileToCache\@@
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/copy file to cache=\marg{file}\@nil
+ \makeatother%
+ \pgfmanualbody
+ It can sometimes be handy to copy a file to the cache folder to avoid using |__ROBEXT_WAY_BACK__| for instance to refer to another file. This can be done with |copy file to cache|, either in a preset or in |\robExtConfigure| like:
+\begin{codeexample}[code only]
+\robExtConfigure{
+ copy file to cache={zx-calculus.sty},
+}
+\end{codeexample}
+Note that |copy file to cache| will always compare the md5 sum to check if a copy must be done or not.
+\end{pgfmanualentry}
+
\subsubsection{Forward macros}\label{sec:forward}
(since v2.1)
@@ -2762,6 +3110,7 @@ Really involved macros (e.g.\ defined inside libraries) might call many other ma
\makeatletter%
\def\extrakeytext{style, }
\extractkey/robExt/forward counter=counter to forward\@nil
+ \extractkey/robExt/forward counter force value=\marg{counter to forward}\marg{value of counter}\@nil
\makeatother%
\pgfmanualbody
Forward a counter:
@@ -2770,6 +3119,12 @@ Really involved macros (e.g.\ defined inside libraries) might call many other ma
\node[rounded corners, fill=red]{The current page is \thepage.};
\end{tikzpictureC}
\end{codeexample}
+The force value also assigns a value to the counter irrespective of the current value (might be useful for instance to generate a cached value for the arXiv).
+\begin{codeexample}[width=0pt]
+\begin{tikzpictureC}<forward counter force value={page}{65}>
+ \node[rounded corners, fill=red]{The current page is \thepage.};
+\end{tikzpictureC}
+\end{codeexample}
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2794,13 +3149,25 @@ but also with colors defined with |\colorlet|:
\node[fill=myviolet,yshift=-1cm]{B};
\end{tikzpictureC}
\end{codeexample}
-Note that using |if matches word|, you can also automatically forward colors:
+Note that using |if matches word|, you can also automatically forward colors. This command also scales better than |if matches|: if |if matches| is used to register $N$ words, the compilation time will increase for each new |if matches| (since we need to check each time if the string contains the expression). |if matches word|, on the other hand, is more clever, and extracts in a single loop all the words of the string: the running time is therefore independent of the number of times |if matches word| was called. You can call |if matches word| outside of any preset like in:
\begin{codeexample}[width=0pt]
\definecolor{myred}{HTML}{F01122}
\colorlet{myviolet}{blue!50!myred}
\colorlet{mypink}{pink!90!orange}
\robExtConfigure{
- add to preset={tikz}{
+ if matches word={mypink}{forward color=mypink},
+}
+\begin{tikzpictureC}
+ \node[fill=mypink,yshift=-1cm]{B};
+\end{tikzpictureC}
+\end{codeexample}
+And this will automatically allow all presets based on |latex| to forward this color (see also |\definecolorAutoForward| to do that even quicker). You can also simply call it on any preset of your choice like:
+\begin{codeexample}[width=0pt]
+\definecolor{myred}{HTML}{F01122}
+\colorlet{myviolet}{blue!50!myred}
+\colorlet{mypink}{pink!90!orange}
+\robExtConfigure{
+ add to preset={latex}{
if matches word={mypink}{forward color=mypink},
},
}
@@ -2808,7 +3175,7 @@ Note that using |if matches word|, you can also automatically forward colors:
\node[fill=mypink,yshift=-1cm]{B};
\end{tikzpictureC}
\end{codeexample}
-but since this is a bit long to type, we provide a shortcut:
+or, equivalently:
\begin{codeexample}[width=0pt]
\definecolor{myred}{HTML}{F01122}
\colorlet{myviolet}{blue!50!myred}
@@ -2826,9 +3193,11 @@ but since this is a bit long to type, we provide a shortcut:
\makeatletter%
\def\extrakeytext{style, }
\extractkey/robExt/auto forward\@nil
+ \extractkey/robExt/auto forward only macros\@nil
+ \extractkey/robExt/auto forward words\@nil
\makeatother%
\pgfmanualbody
- Enable automatic forwarding of macros marked with |*AutoForward| commands or |\configIfMacroPresent|. This command naively extracts all used macro via a simple regex match and forwards them/execute the style configured in |\configIfMacroPresent| if it exists.
+ |auto forward| enables automatic forwarding of macros marked with |*AutoForward| commands or |\configIfMacroPresent| or |if matches word|. This command naively extracts all used macros via a simple regex match and forwards them/execute the style configured in |\configIfMacroPresent| if it exists. It does a similar thing for words registered via |if matches word| or |register word with namespace|. If you want to only forward macros or words, you can use |auto forward only macros| or |auto forward words|.
\begin{codeexample}[vbox]
\cacheTikz
\robExtConfigure{add to preset={tikz}{auto forward}}
@@ -2878,8 +3247,8 @@ but since this is a bit long to type, we provide a shortcut:
\extractcommand\ProvideExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
\extractcommand\DeclareExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
\extractcommand\defAutoForward\marg{macro}\opt{\oarg{def-style arg spec}}\marg{macro}\opt{\oarg{additional style}}\@@
- \extractcommand\genericAutoForward\opt{*}\opt{\oarg{preset}}\marg{string to match}\opt{\oarg{additional style}}\marg{code to execute}\@@
- \extractcommand\genericAutoForwardStringMatch\opt{*}\opt{\oarg{preset}}\marg{string to match}\opt{\oarg{additional style in preset}}\opt{\oarg{additional style outside preset}}\marg{code to execute}\@@
+ \extractcommand\genericAutoForward\opt{*}\opt{\oarg{preset}}\opt{\oarg{namespace}}\marg{word}\opt{\oarg{additional style}}\marg{code to run}\@@
+ \extractcommand\genericAutoForwardStringMatch\opt{*}\opt{\oarg{preset}}\marg{string}\opt{\oarg{additional style}}\marg{code to run}\@@
\pgfmanualbody
\begin{verbatim}
\newcommandAutoForward{\macro}[nb args][default value]{def}[STYLE]
@@ -2908,7 +3277,7 @@ but since this is a bit long to type, we provide a shortcut:
\end{tikzpicture}
\end{codeexample}
- This works similarly for other commands (note that for |\defAutoForward|, you need to put the arguments in a bracket, like |\defAutoForward\myMacro[#1 and #2]{Hey #1, #2}| for |\def\myMacro#1 and #2{Hey #1, #2}|). |\genericAutoForward| and |\genericAutoForwardStringMatch| are a bit special (for now these two commands are alias, but only use the first one if the string is surrounded by non-letter characters as we plan to make that special case more efficient later as it uses internally |if matches word|), as it can be used to run any code assuming that |string to match| is present. For instance, you can use it to automatically forward the code that defines a new tikz style assuming |mystyle| is preset:
+ This works similarly for other commands (note that for |\defAutoForward|, you need to put the arguments in a bracket, like |\defAutoForward\myMacro[#1 and #2]{Hey #1, #2}| for |\def\myMacro#1 and #2{Hey #1, #2}|). |\genericAutoForward| and |\genericAutoForwardStringMatch| are a bit special, as it can be used to run any code assuming that |word|/|string to match| is present (|\genericAutoForward| is more efficient as it does not scale with the number of words, but do not allow spaces etc in the name). For instance, you can use it to automatically forward the code that defines a new tikz style assuming |mystyle| is preset:
\begin{codeexample}[width=0pt]
\cacheTikz
\genericAutoForward{mystyle}{
@@ -2943,6 +3312,68 @@ This will also run the code to define it in the current document (practical for
};
\end{tikzpicture}
\end{codeexample}
+ \begin{codeexample}[vbox]
+ % space is not allowed in the name with this more efficient version:
+ \robExtGenericAutoForward{mystyle}{%
+ \tikzset{%
+ mystyle/.style={fill=#1!30!white,text=#1!40!black},
+ }%
+ }
+ \begin{tikzpictureC}
+ \node[mystyle=green]{My style automatically forwarded};
+ \end{tikzpictureC}
+ \end{codeexample}
+ \begin{codeexample}[vbox]
+ % space is allowed in the name with this slightly less efficient version:
+ \robExtGenericAutoForwardStringMatch{my style}{%
+ \tikzset{%
+ my style/.style={fill=#1!30!white,text=#1!40!black},
+ }%
+ }
+ \begin{tikzpictureC}
+ \node[my style=green]{My style with a space in the name automatically forwarded};
+ \end{tikzpictureC}
+ \end{codeexample}
+ Note that by default, this forwards elements in the |latex| preset, but you can change it via |preset|. You can also configure additional style to run, and choose another namespace for the word version (practical only if you want to forward different codes to different presets: note that a single namespace is allowed per preset).
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\runHereAndInPreambleOfCachedFiles\opt{\oarg{preset}}\marg{code}\@@
+ \pgfmanualbody
+ (from v2.3) This will run |code| right now and it will add it in the preamble of the files that use the preset |preset| (defaults to |latex|). This is practical to avoid duplicating the code into |add to preamble|. For instance, if want the configure the font of the current document and of all latex documents at the same time, use:
+\begin{codeexample}[code only]
+\runHereAndInPreambleOfCachedFiles{
+ \usepackage{fontspec}
+ \setmainfont{Times New Roman}
+}
+
+\robExtConfigure{
+ add to preset={latex}{
+ use lualatex, % Make sure to compile with lualatex the cached images.
+ },
+}
+\end{codeexample}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\definecolorAutoForward\marg{color}\marg{model}\marg{value}\opt{\oarg{additional style}}\@@
+ \extractcommand\colorletAutoForward\marg{color}\marg{value}\opt{\oarg{additional style}}\@@
+ \pgfmanualbody
+ Define colors like |\definecolor| and |\colorlet|, but also runs
+\begin{verbatim}
+if matches word={COLOR}{forward color=COLOR}
+\end{verbatim}
+ to automatically forward the color (this will forward it only in latex-based presets). You can provide additional style to run as well in option.
+ \begin{codeexample}[vbox]
+ \definecolorAutoForward{myred}{HTML}{F01122}
+ \colorletAutoForward{myviolet}{blue!50!myred}
+ \begin{tikzpictureC}
+ \node[fill=myred,yshift=-1cm]{Uses myred};
+ \end{tikzpictureC}
+ \begin{tikzpictureC}
+ \node[fill=myviolet,yshift=-1cm]{Myviolet};
+ \end{tikzpictureC}
+ \end{codeexample}
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -2974,9 +3405,12 @@ This will also run the code to define it in the current document (practical for
\extractkey/robExt/if matches=\marg{string}\marg{style to apply}\@nil
\extractkey/robExt/if matches word=\marg{string}\marg{style to apply}\@nil
\extractkey/robExt/if matches regex=\marg{latex3 regex}\marg{style to apply}\@nil
+ \extractkey/robExt/register word with namespace=\marg{namespace}\marg{word}\marg{style}\@nil
+ \extractkey/robExt/auto forward words\@nil
+ \extractkey/robExt/auto forward words namespace=\marg{namespace}\@nil
\makeatother%
\pgfmanualbody
- Apply the corresponding style if the string (resp.\ regex in \LaTeX{}3 format) matches is matched in the content. As of today, |if matches word| and |if matches| are equivalent, but I plan to make |if watches word| more efficient\footnote{Scaling with $O(s)$ instead of $O(sn)$, where $s$ is the size of the string typed in |cacheMe| and $n$ is the number of times |if matches| is used, for instance when replacing multiple strings.}, and make it only match words that are made of consecutive letters |[A-Za-z]|. The regex version can be more expressive, but is significantly slower (it can easily multiply by 2 the compilation time).
+ |if matches *| applies the corresponding style if the string (resp.\ word or regex in \LaTeX{}3 format) matches is matched in the content. |if matches word| is more efficient that |if matches string| since the running time is independent of the number of times |if matches word| is called\footnote{Scaling with $O(s)$ instead of $O(sn)$, where $s$ is the size of the string typed in |cacheMe| and $n$ is the number of times |if matches| is used, for instance when replacing multiple strings.}. |if matches word| make it only match words that are mostly made of consecutive letters and numbers |[A-Za-z0-9]| (more precisely separated by elements in |\robExtWordSeparators|). The regex version can be more expressive, but is significantly slower (it can easily multiply by 2 the compilation time).
\begin{codeexample}[vbox]
\robExtConfigure{
add to preset={my python}{
@@ -3021,8 +3455,10 @@ Some text %
\draw[->] (0,0) to[bend left] (my original node);
\end{tikzpicture}
\end{codeexample}
+Note that to make |if matches word| even more efficient, you can call it before the preset. It will "register" the corresponding word with |register word| (itself a shortcut for |register word with namespace| with an empty namespace), and call |auto forward words| (shortcut for |auto forward words namespace={}|) in the |latex| preset (or in the current preset if we are already in a preset) to forward all words registered in the corresponding namespace (empty by default). Unless you want to forward different words to different presets, these more advanced functions involving namespaces should not be really useful for the end user.
\end{pgfmanualentry}
+
\subsubsection{Pass compiled file to another template}\label{sec:passOutputToOtherTemplate}
It can sometimes be handy to use the result of a previous cached file to cache another file, or to do anything else (e.g.\ it can also be practical to debug an issue). |name output| can be used to do that
@@ -3490,7 +3926,7 @@ outputTxt="__ROBEXT_OUTPUT_PREFIX__-out.txt"
outputTex="__ROBEXT_OUTPUT_PREFIX__-out.tex"
outputPdf="__ROBEXT_OUTPUT_PDF__"
\end{verbatim}
-in order to quit when an error occurs, and to define two variables containing the path to the |pdf| file and to the file that is read by the |verbatim output| setting (that just apply a |\verbatiminput| on that file). Finally, it also creates the file |outputPdf| with |touch| in order to notify that the compilation succeeded.
+in order to quit when an error occurs, and to define two variables containing the path to the |pdf| file and to the file that is read by the |verbatim output| setting (that just apply a |\verbatiminput| on that file). Finally, it also creates the file |outputPdf| with |echo "ok"| in order to notify that the compilation succeeded.
In practice:
\begin{codeAndResult}
@@ -3530,6 +3966,230 @@ This file contains:
You might also like to use |name output=yourfile| that will create two macros |\yourfile| and |\yourfileInCache|, equal respectively to the prefix |robExt-somehash| and |pathOfCache/robExt-somehash|.
+\subsubsection{Online images}
+
+We also provide support for online images since v2.3.
+\begin{pgfmanualentry}
+ \extractcommand\includegraphicsWeb\opt{<robExt options>}\opt{\oarg{includegraphics options}}\marg{url image}\@@
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/web image\@nil
+ \extractkey/robExt/web image/wget\@nil
+ \extractkey/robExt/web image/curl\@nil
+ \makeatother%
+ \pgfmanualbody
+ |\includegraphicsWeb| is used in place of |\includegraphics| to download online images:
+\begin{codeexample}[width=0pt,vbox]
+Here is a cat downloaded online: \includegraphicsWeb[width=3cm]{http://placekitten.com/400/300}.
+\end{codeexample}
+By default, the engine uses |wget| in linux (since it is installed by default) and |curl| on windows (should also be installed by default on recent windows). But you can change it by modifying the |web image| preset (or using the optional robExt options that are loaded after |web image|):
+\begin{codeexample}[width=0pt,vbox]
+\robExtConfigure{
+ add to preset={web image}{
+ curl
+ },
+}
+
+Here is a cat downloaded online: \includegraphicsWeb[width=3cm]{http://placekitten.com/400/303}.
+\end{codeexample}
+By default, the |wget| and |curl| presets are defined as:
+\begin{verbatim}
+wget/.style={
+ set compilation command={wget "__ROBEXT_MAIN_CONTENT__" -O "__ROBEXT_OUTPUT_PDF__"},
+},
+curl/.style={
+ set compilation command={curl "__ROBEXT_MAIN_CONTENT__" -L -o "__ROBEXT_OUTPUT_PDF__"},
+},
+\end{verbatim}
+\end{pgfmanualentry}
+
+\subsubsection{Gnuplot}
+
+We also provide support for gnuplot since v2.3.
+
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/gnuplot\@nil
+ \extractkey/robExt/gnuplot/set terminal=\marg{terminal and options}\@nil
+ \extractkey/robExt/gnuplot/pdf terminal=\opt{pdf terminal options}\@nil
+ \extractkey/robExt/gnuplot/tikz terminal=\opt{tikz terminal options}\@nil
+ \makeatother%
+ \pgfmanualbody
+ Loads the |gnuplot| preset. By default, it uses the |pdf| terminal:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+
+You can also specify the gnuplot options to the pdf terminal, like the size, using:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot,pdf terminal={size 5cm,4cm}}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+You can also change the options of the |includegraphics| command used to include the image, using as usual:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot,set includegraphics options={width=5cm,height=4cm}}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+You can also use other terminals using the |set terminal| option. For instance, you can use the png terminal and configure its size using:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot,set terminal={png size 400,300}}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+The tikz terminal is a bit special since we do not want to use |\includegraphics| but |\input| to include the file. You can use it like this, just make sure:
+\begin{itemize}
+\item to have gnuplot installed with lua support. With nix you can get it with:\\
+ |nix-shell -p '(gnuplot.override { withLua = true; })'|
+\item Add |\usepackage{gnuplot-lua-tikz}| after making sure to run\\
+ |gnuplot -e "set terminal tikz createstyle"| once to create the |.sty| file.
+\end{itemize}
+\begin{codeAndResult}
+% \usepackage{gnuplot-lua-tikz} %% Generate with gnuplot -e "set terminal tikz createstyle"
+\begin{CacheMeCode}{gnuplot,tikz terminal={size 5cm,4cm}}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+(Note that if you do not provide any option to |tikz terminal|, it will just use the default value in gnuplot, you can also add any other option to the terminal here.) By default, we only cache the gnuplot compilation, but the |\input| is not cached (so gnuplot will not be run again the next time, but tikz will run every time). But it can also be cached, just add |cache tikz| for that:
+\begin{codeAndResult}
+\robExtConfigure{
+ add to preset={tikz}{
+ % Run gnuplot -e "set terminal tikz createstyle" in the robustExternalize folder first
+ % to create this file, or, better, run this command in your local folder and use
+ % "copy file to cache" to copy the 3 generated files.:
+ add to preamble={\usepackage{gnuplot-lua-tikz}},
+ },
+ add to preset={gnuplot}{
+ tikz terminal/.append style={
+ cache tikz,
+ },
+ },
+}
+\begin{CacheMeCode}{gnuplot, tikz terminal={size 8cm,5cm}}
+plot cos(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+We also automatically add |__ROBEXT_WAY_BACK__| to the |loadpath|, this way you do NOT need to type |plot "__ROBEXT_WAY_BACK__yourfile.dat"`| if the data is in the main folder. Note however that you need to add this file to the list of dependencies, otherwise it will not be recompiled if the file changes:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot, dependencies={gnuplot_data.dat}}
+plot "gnuplot_data.dat"
+\end{CacheMeCode}
+\end{codeAndResult}
+
+You can also use the current text width when using the tikz terminal using something like:\\
+|tikz terminal/.expanded={size \lenToCm{\textwidth},\lenToCm{.3\textwidth}}|\\
+Full example:
+\begin{codeAndResult}
+% Just to check size:
+\noindent\rule{\textwidth}{1mm}\\%
+\begin{CacheMeCode}{gnuplot, tikz terminal/.expanded={size \lenToCm{\textwidth},\lenToCm{.3\textwidth}}}
+plot cos(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+
+Similar to the tikz terminal, you can also use the |cairolatex| terminal like this:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot,cairolatex terminal}
+plot sin(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+As before, you can also specify the size, for instance it term of the current textwidth:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot, cairolatex terminal/.expanded={size \lenToCm{\textwidth},\lenToCm{.3\textwidth}}}
+plot cos(x)
+\end{CacheMeCode}
+\end{codeAndResult}
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \extractcommand\robExtGpgetvar\marg{variable name}\@@
+ \extractcommand\robExtGpgetvarNb\opt{*}\opt{\oarg{text, default 404}}\marg{variable name}\@@
+ \pgfmanualbody
+ Like |\gpgetvar{}| from |gnuplot-lua-tikz| but does not produce an error if the variable does not exist yet (mostly useful if you compile in parallel as shown \mylink{https://github.com/leo-colisson/robust-externalize/issues/17}{here}). The first time, you will get a message like:
+
+ \robExtGpgetvar{test_variable}
+
+ and later this will compile fine:
+\begin{codeAndResult}
+\begin{CacheMeCode}{gnuplot, tikz terminal={providevars test_variable}}
+test_variable = 5
+plot cos(test_variable * x) title "Test2"
+\end{CacheMeCode}
+Variable is \robExtGpgetvar{test_variable}.
+\end{codeAndResult}
+|\robExtGpgetvarNb| is similar, except that it prints a number 404 by default (useful if you use it in siunit) and is expandable (also \mylink{https://github.com/leo-colisson/robust-externalize/issues/17}{needed for siunit}). You can choose another text using the optional argument. The star version prints a warning in the log if the variable does not exist, but can only be used in LuaLaTeX:
+\begin{codeAndResult}
+Variable is \num[round-mode=figures,round-precision=3]{\robExtGpgetvarNb{non_existing_variable}}.
+\end{codeAndResult}
+Note that you will get a warning if the variable does not exist (yet?) only in LuaLaTeX as in other engines there is no \mylink{https://tex.stackexchange.com/questions/705299/print-message-in-expandable-macro/705304}{way to write in the log with an expandable function}.
+\end{pgfmanualentry}
+
+\subsubsection{TikZit}
+
+\mylink{https://tikzit.github.io/}{TikZit} is a software to produce \tikzname{} images via a graphical interface.
+
+\begin{pgfmanualentry}
+ \extractcommand\cacheTikzit\opt{\oarg{preset}}\@@
+ \extractcommand\cacheTikzitWithStyle\opt{\oarg{preset}}\marg{name of style file}\@@
+ \pgfmanualbody
+ (since v2.5) These command will automatically cache the |\tikzfig| command (and therefore also |\ctikzfig|). While |\cacheTikzit| will let you create the preset (named |tikzit| preset by default), |\cacheTikzitWithStyle| will automatically create the preset style for you, loading your style given as parameter:
+ \begin{codeexample}[vbox]
+ %%%%%%% In your preamble:
+ \cacheTikzitWithStyle{new_zxstyle.tikzstyles}
+
+ %%%%%%% In your document:
+ \tikzfig{demo} % figures/ is optional
+ \end{codeexample}
+ If you prefer to do it manually, you can do instead:
+ \begin{codeexample}[vbox]
+ %%%%%%% In your preamble:
+ \robExtConfigure{
+ % First, we copy the tikzit-related files to the cache:
+ copy file to cache={tikzit.sty},
+ copy file to cache={new_zxstyle.tikzstyles},
+ % We create the tikzit preset loaded by default:
+ new preset={tikzit}{
+ latex,
+ add to preamble={
+ \usepackage{tikzit}
+ \input{new_zxstyle.tikzstyles}
+ },
+ },
+ }
+ % Cache all tikzit figures:
+ \cacheTikzit
+
+ %%%%%%% In your document:
+ \tikzfig{figures/demo}
+ \end{codeexample}
+ \textbf{WARNING:} since the tikz picture uses |baseline| that relies on the current font size to vertically align the figure, and since we do not yet propagate the current font size to the cached picture (there are so many ways to configure the font in \LaTeX\dots{}), you should make sure that the |tikzit| preset sets the font size like in your main document, for instance via:
+ \begin{codeexample}[vbox]
+ %%%%%%% In your preamble:
+ \cacheTikzitWithStyle{new_zxstyle.tikzstyles}
+ \robExtConfigure{
+ add to preset={tikzit}{
+ add to latex options={12pt},
+ },
+ }
+ %%%%%%% In your document:
+ \tikzfig{demo} % figures/ is optional
+ \end{codeexample}
+ Note that |\tikzfig| accepts an additional optional argument for further options, for instance to forward locally a macro or to disable externalization:
+ \begin{codeexample}[vbox]
+ %%%%%%% In your preamble, make sure to load:
+ %% \usepackage{tikzit}
+ %% \input{new_zxstyle.tikzstyles}
+ %% if you want "disable externalization" to work.
+ \cacheTikzitWithStyle{new_zxstyle.tikzstyles}
+ %%%%%%% In your document:
+ \tikzfig<disable externalization>{demo} % figures/ is optional
+ \end{codeexample}
+\end{pgfmanualentry}
+
\subsubsection{Custom languages}
To add support to new languages, see \cref{sec:otherLanguages} for an example.
@@ -3632,10 +4292,19 @@ It might be handy to cache automatically a given environment: we already provide
to cache all tikz pictures (unless externalization is disabled), but we also provide tools to handle arbitrary environments.
\begin{pgfmanualentry}
- \extractcommand\robExtExternalizeAllTikzpicture\opt{\oarg{preset for tikz}}\opt{\oarg{preset for tikzpicture}}\opt{\oarg{delimiters}}\@@
+ \extractcommand\robExtExternalizeAllTikzpictures\opt{\oarg{preset for tikz}}\opt{\oarg{preset for tikzpicture}}\opt{\oarg{delimiters}}\@@
\extractcommand\cacheTikz\opt{\oarg{preset for tikz}}\opt{\oarg{preset for tikzpicture}}\opt{\oarg{delimiters}}\@@
+ \extractcommand\robExtDoNotExternalizeAllTikzpictures\@@
+ \extractcommand\doNotCacheTikz\@@
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/cache tikz\@nil
+ \extractkey/robExt/cache tikz\@nil
+ \extractkey/robExt/cache tikz 2 args=\marg{tikz preset}\marg{tikzpicture preset}\@nil
+ \extractkey/robExt/cache tikz 3 args=\marg{tikz preset}\marg{tikzpicture preset}\marg{delimiters cacheMe options}\@nil
+ \makeatother%
\pgfmanualbody
- This will automatically cache all tikz pictures (both are alias, |\cacheTizk| is available from v2.0). Since v2.0, we added the delimiters options and we allow to specify custom presets for |tikz| and |tikzpicture|, and we parse |\tikz| as well (the |tikz| preset is now used by |\tikz| by default while the |tikzpicture| preset is used by |tikzpicture|). Note that we add an additional optional argument to the tikz picture via its first argument delimited by |delimiters| (defaults to |<>|) to specify preset options, which can for instance be practical to disable externalization on individual pictures. Cf.\ \cref{sec:disableExternalization} to see an example of use.
+ (|cache tikz*| from 2.3, simply style alias) This will automatically cache all tikz pictures (the |*ExternalizeAllTikzpicturers| are alias of the |*cacheTikz| which is available from v2.0). Since v2.0, we added the delimiters options and we allow to specify custom presets for |tikz| and |tikzpicture|, and we parse |\tikz| as well (the |tikz| preset is now used by |\tikz| by default while the |tikzpicture| preset is used by |tikzpicture|). Note that we add an additional optional argument to the tikz picture via its first argument delimited by |delimiters| (defaults to |<>|) to specify preset options, which can for instance be practical to disable externalization on individual pictures. Cf.\ \cref{sec:disableExternalization} to see an example of use.
\begin{codeexample}[width=0pt,vbox]
\cacheTikz
@@ -3687,7 +4356,27 @@ You can also change the default style loaded for tikz and tikzpicture (note that
\node(A){In tikzpicture \hello};
\end{tikzpicture}
\end{codeexample}
+Note that the |cache tikz| styles (the variation just provide default values) is useful for instance if you only want to locally enable |cache tikz| for the |\input| of a style (this way you can cache the output of a cached thing\dots{}). For instance, |gnuplot| with a tikz terminal will compile into a tex file that will be inputted. But unless |\cacheTikz| is enabled, the inputted picture will not be cached (i.e. tikz will need to run). If you still want to cache it without enabling |\cacheTikz| globally, you can load this style in the |gnuplot| style, or do something like:
+
+|\doNotCacheTikz| just undo |\cacheTikz|:
+\begin{codeexample}[width=0pt,vbox]
+\def\whereIAm{(not cached)}
+\robExtConfigure{
+ add to preset={tikz}{
+ add to preamble={
+ \def\whereIAm{(cached)}
+ },
+ },
+}
+\cacheTikz
+\doNotCacheTikz
+
+\tikz \node[fill=pink, rounded corners]{\whereIAm};
+\begin{tikzpicture}
+ \node[fill=pink, rounded corners]{\whereIAm};
+\end{tikzpicture}
+\end{codeexample}
\end{pgfmanualentry}
\begin{pgfmanualentry}
@@ -3809,7 +4498,7 @@ Let us say that you want to cache all elements of a given environment, like |min
\end{pgfmanualentry}
\paragraph{Defining its own macro without repeating its definition.}
-Note that when you define yourself a macro function, the above structure might not be optimal as you need to define the macro in the main document (in case you disable the externalization) and in the template. One option to avoid repeated code is to write the definition in a common input file (see \cref{sec:dependencies}), but you might prefer to keep everything in a single file. In that case, you can simply wrap your function into |cacheMe| yourself. Say you want your function to draw a circle like, |\tikz \draw[fill=#2] (0,0) circle [radius=#1];|, then wrap in inside |CacheMe|:
+Note that when you define yourself a macro function, the above structure might not be optimal as you need to define the macro in the main document (in case you disable the externalization) and in the template. One option to avoid repeated code is to write the definition in a common input file (see \cref{sec:dependencies}), use |\runHereAndInPreambleOfCachedFiles| or |forward=\macroToExport|. But sometimes, you might need to do more involved operations, for instance to add a file as a dependency etc. So another solution it to wrap yourself your function into |cacheMe| yourself. Say you want your function to draw a circle like, |\tikz \draw[fill=#2] (0,0) circle [radius=#1];|, then wrap in inside |CacheMe|:
\begin{codeexample}[width=0mm,vbox]
% D<>{} is an optional argument enclosed in <>, we use this to pass arguments to CacheMe
@@ -3899,9 +4588,77 @@ bash JOBNAME-robExt-compile-missing-figures.sh
\subsection{How to debug}\label{sec:debug}
-If for some reasons you are unable to understand why a build fails, first check if you compiled your document with |-shell-escape| (not that this must appear \textbf{before} the filename). Then, you can look at the log file to get more advices: when a cached document is compiled, we always write the full compilation command before compiling the file in the log file. This way, you can easily check the content of the file and see why it fails to compile. The compilation errors are also displayed directly in the output, and you can read the log file for details.
+If for some reasons you are unable to understand why a build fails, first check if you compiled your document with |-shell-escape| (not that this must appear \textbf{before} the filename).
+
+Since v2.3, we provide a more advanced error handling system in order to provide more meaningful errors to the user, and to write the full compilation output in the log in case of an error. We do so by wrapping commands around something like |(my command) > somelog.tex 2>&1|; therefore nothing is printed on screen during the compilation of the cached picture, you only get a message if there is an error.
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/do not redirect compilation output\@nil
+ \makeatother
+ If you want to come back to the old behavior, that just runs the command is it either set this option, or set |\def\robExtDoNotRedirectOutput{}| and |\def\robExtDoNotRedirectOutputInManuallyCompileMissingFigures{}| (the last one will only concern commands written to the |robExt-compile-missing-figures.sh|, which is used in manual mode and in parallel mode).
+\end{pgfmanualentry}
+
+Starting from 2.3, we also automatically print an actual error message like:
+\begin{verbatim}
+! Package robExt Error: On line 20: the pdf file
+(robExt)
+robustExternalize/robExt-F27CD43D192AA2668A16DEAA616591FF.pdf
+(robExt) is not present. The compilation command "cd
+(robExt) robustExternalize/ && xelatex -halt-on-error
+(robExt) "robExt-F27CD43D192AA2668A16DEAA616591FF.tex"" used
+(robExt) to compile the environment on line 20 certainly
+(robExt) failed with errors:
+(robExt) vvvvvv
+(robExt) ! Package tikz Error: Giving up on this path. Did
+(robExt) you forget a semicolon?.
+(robExt)
+(robExt) ^^^^^^
+(robExt) See full logs below (you might need to press ENTER
+(robExt) to go to the next error) or in
+(robExt)
+robustExternalize/robExt-F27CD43D192AA2668A16DEAA616591FF-compilation.log.
+\end{verbatim}
+You can see inside the location in the main tex file of the block containing the error, we provide also the compilation command that lead to this error, and the lines of the log containing the word ``error'' (case insensitive), as well as the path to the full log of the compilation of the inner command, that you can also see if you continue the compilation by pressing Enter or by looking at the full log file, for instance in TeXstudio. This smaller message is often good enough in LaTeX, but usually not very good for languages that do not print the word ``error''. In that case, add to your preset:
-You might often get an error |! Missing $ inserted.|: this is typically when a placeholder was left unreplaced (e.g.\ you forgot to define it, import it, or you forgot to wrap a command in |\evalPlaceholder{}|): since \LaTeX{} is asked to typeset |__something__|, it thinks that you are trying to write a subscript, and asks you to start first the math mode.
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/print whole file in error message\@nil
+ \extractkey/robExt/do not print whole file in error message\@nil
+ \makeatother
+ (Add this only in preset, do NOT set it globally)
+ If you want to print the whole file in the small error message because you do not want to inspect the full log file, you can use the style |print whole file in error message|. This is enabled by default on the gnuplot, python and bash presets for instance, but disabled in \LaTeX{} has it makes little sense to print thousands of log lines in the error.
+\end{pgfmanualentry}
+
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/texstudio\@nil
+ \extractkey/robExt/logs should show as errors\@nil
+ \extractkey/robExt/prefix log message with=\marg{string to prepend to log message}\@nil
+ \extractkey/robExt/spacing between lines in log=\marg{content to separate lines in log}\@nil
+ \makeatother
+ Some IDE like TeXstudio will only print lines starting with an exclamation mark, assuming that they are spaced enough, so to make the compilation errors more visible in the log, we can start every line in the log with a |!| (you can set it globally via |logs should show as errors| that internally calls |prefix log message with|) and separate all lines with enough empty lines using |spacing between lines in log|. For simplicity, we create |texstudio| to automatically configure these values so that errors print nicely in texstudio via:
+\begin{verbatim}
+\robExtConfigure{texstudio}
+\end{verbatim}
+This way you will get errors like:
+\begin{verbatim}
+-------- We print now the full log --------
+! sh: ligne 1: gnuplot : commande introuvable
+-------- End of the full log --------
+\end{verbatim}
+and the line |sh: ligne 1: gnuplot : commande introuvable| will appear in your IDE without going in the log file. Note that this will only be printed for items that enable |print whole file in error message| not to pollute the errors space when the log contains many lines (e.g. \LaTeX{}), but this is automatically enabled on most default presets.
+\end{pgfmanualentry}
+
+Then, you can look at the log files\footnote{Either the latex one or the |-compilation.log| file, and sometimes try in a terminal if you really can't see any useful error as it might be the case that the error is not printed in the log file, which occurs for instance if xparse is not installed on Windows and you use the compilation command in parallel.} to get more advices, and run yourself the compilation command printed in the above error message. This way, you can easily check the content of the file and see why it fails to compile. In version before 2.3, or if you use |do not redirect compilation output|, the compilation errors are also displayed directly in the output, and you can read the log file for details.
+
+You might often get an error:
+\begin{verbatim}
+! Missing $ inserted.
+\end{verbatim}
+This is typically when a placeholder was left unreplaced (e.g.\ you forgot to define it, import it, or you forgot to wrap a command in |\evalPlaceholder{}|): since \LaTeX{} is asked to typeset |__something__|, it thinks that you are trying to write a subscript, and asks you to start first the math mode.
To get more advanced info during the compilation command, set the style |more logs| (that does |\def\robExtDebugMessage#1{\message{^^J[robExt] #1}}|) in order to print some messages on the replacement process (there is also |\robExtDebugWarning| for more important messages, but it prints the logs by default.
@@ -3948,6 +4705,15 @@ You can also use |debug| (or its alias |print command and source|) in order to d
Show all imported placeholders and their content. Use the start not to pause.
\end{pgfmanualentry}
+\begin{pgfmanualentry}
+ \makeatletter%
+ \def\extrakeytext{style, }
+ \extractkey/robExt/nb lines after error to show=\marg{nb lines to keep}\@nil
+ \extractkey/robExt/remove line number\@nil
+ \extractkey/robExt/do not remove line number\@nil
+ \makeatother
+ In order to make the small error message more meaningful (to avoid getting to the full log), we try to extract some errors automatically, reading lines staring with |!|, or containing |error| or |invalid|. But this line alone is often not enough, so you can use |nb lines after error to show| to determine the number of lines to show after (defaults to 3). |remove line number| will remove in the short error message any |l.| at the beginning of the line, otherwise some editors (at least emacs), will interpret it as a line number in the current file and will jump to a bad position (this is enabled by default). These options would work best if set globally when you use |compile in parallel|.
+\end{pgfmanualentry}
\subsection{Advanced optimizations}\label{sec:advancedOperations}
@@ -4006,36 +4772,58 @@ In order to know when to stop replacing placeholders earlier (i.e.\ without runn
If you disable the import mechanism (enabled by default), it will do an |\importAllPlaceholders| while evaluating the template. This is not recommended as it is quite inefficient, it is better to selectively import the group you need.
\end{pgfmanualentry}
-\begin{pgfmanualentry}
- \makeatletter%
- \def\extrakeytext{style, }
- \extractkey/robExt/disable optimizations\@nil
- \extractkey/robExt/enable optimizations\@nil
- \makeatother%
- \pgfmanualbody
-
-\end{pgfmanualentry}
+\section{Frequent errors}
+
+\subsection{Xelatex and tabs}
+It seems that xelatex (I never had issues with pdflatex and lualatex, but if you get this error on other engines you can try the same fix) \mylink{https://tex.stackexchange.com/a/14776/116348}{has a hard time dealing with tabs} if you do not compile with:
+\begin{verbatim}
+xelatex -8bit yourfile.tex
+\end{verbatim}
+If you see that tabs in your input file are turned into |^^I| in the source code, you should either add the |-8bit| option\dots{} or simply follow egreg's advice:
+\begin{center}
+ \emph{The strategy is very simple: never use TAB when dealing with TeX. Reserve the TAB key to trigger autocompletion and your life will be happier.}
+\end{center}
+If you use TeXstudio that uses Tabs by default, you can disable this feature by setting these two options:
+\begin{verbatim}
+Options > Configure TeXstudio > Editor > Replace indentation tabs with spaces
+Options > Configure TeXstudio > Editor > Replace tabs in text with spaces
+\end{verbatim}
\section{TODO and known bugs:}
\begin{itemize}
\item See how to deal with label, links and cite inside pictures (without disabling externalization). For label and links, I have a proof of concept, I ``just'' need to write it down. \url{https://tex.stackexchange.com/questions/695277/clickable-includegraphics-for-cross-reference-data}
\item Deal with remember picture
-\item Since externalizing is all about speed, it would be nice to do more benchmarks. But overall, it seems fairly optimized, at least when using the compiled presets.
-\item Add a way to forward tikz styles and/or arbitrary code.
-\item Create a more efficient/precise way to check if a word is present than string ``is in''. Indeed, for now for each color/... to export, we check if the string contains this word, which scales like $O(sn)$ where $s$ is the size of the string and $n$ is the number of colors etc to export. Instead, I'd like to run it in $O(s)$ by extracting all words a single time, and then checking if this word exists or not. This is not an issue for |\newcommandAutoforward|, but could be an issue when exporting many colors or |\genericAutoForward|.
+\item Since externalizing is all about speed, it would be nice to do more benchmarks. But overall, it seems fairly optimized, at least when using the compiled presets. One option to gain in term of efficiency and simplicity might be to directly use the fact that the placeholders start and end with two dashes: a more efficient implementation might be doable using something like |\def\findPlaceholders#1__#2__{}| instead of string replacement. I will try to investigate in future releases.
\end{itemize}
-\section{Acknowledgments}
-
-I am deeply indebted to many users on \url{tex.stackexchange.com} that made the writing of this library possible. I can't list you all, but thank you so much! A big thanks also to the project \url{https://github.com/sasozivanovic/memoize/} from which I borrowed most of the code to automatically wrap commands. Thanks to kiryph for providing useful feedbacks.
-
\section{Changelog}
\begin{itemize}
-\item Future v2.3 (master on github, not released yet on CTAN):
+\item v2.5:
+ \begin{itemize}
+ \item Add tikzit support
+ \item Add support for |--output-directory|
+ \end{itemize}
+\item v2.4:
+ \begin{itemize}
+ \item Better error message in wget if file not found
+ \item Add support for arXiv with |rename backup files for arxiv|, |print source when saving|, |backup source for arxiv|, |forward counter force value|
+ \item Add |\robExtMv|, |\robExtCp|, |set compilation command create if no error| and |set compilation command move if no error|.
+ \item Add |copy file to cache|
+ \end{itemize}
+\item v2.3:
+ \begin{itemize}
+ \item Fix bug in |more logs| and |less logs|
+ \item Make |if matches word| more efficient, independent on the number of runs, allowing registration, namespaces, etc.
+ \item Added |\definecolorAutoForward| and |\colorletAutoForward|
+ \item Add support for gnuplot
+ \item Added |\runHereAndInPreambleOfCachedFiles|
+ \item Clearer and more advanced error handling
+ \item Add support for online images with |\includegraphicsWeb|
+ \end{itemize}
\item v2.2
\begin{itemize}
\item v2.1 introduced two important bugs where hashes could not be used in a |\cacheMe| environment, and |auto forward| was not working if the string was containing an environment. This is fixed now.
@@ -4078,6 +4866,9 @@ I am deeply indebted to many users on \url{tex.stackexchange.com} that made the
\printindex
\end{document}
+% Luatex is needed, otherwise quotes ' are turned into another symbol in documentation
+% https://github.com/leo-colisson/robust-externalize/issues/11
% Local Variables:
-% TeX-command-extra-options: "-shell-escape -halt-on-error"
+% TeX-command-extra-options: "--shell-escape -halt-on-error"
+% TeX-engine: luatex
% End: \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-base/README.md b/macros/latex/contrib/tkz/tkz-base/README.md
index 9c6b4a3d34..c4c1a749b1 100644
--- a/macros/latex/contrib/tkz/tkz-base/README.md
+++ b/macros/latex/contrib/tkz/tkz-base/README.md
@@ -1,6 +1,6 @@
# tkz-base — for Cartesian coordinate system
-Release 4.2c 2022/07/14
+Release 4.21c 2024/01/16
## Description
The package `tkz-base` provides some tools like a Cartesian (rectangular) coordinate system to other packages like `tkz-euclide` or `tkz-fct`.
@@ -60,6 +60,9 @@ Other examples, in French, are on my site.
The new version of `tkz-base` is *not* fully compatible with the version 3 but the differences are minor
## History
+- 4.21c Correction of bug tkz-obj-axes line 35, missing a symbol `%` (thanks Pascal Nuns)
+
+ Replace in TKZdoc-base-points.tex p 462 tkzDefCentroid(A,B,C,O) by tkzDefBarycentric(A,B,C,O)
- 4.2c adaptation to the new version of tkz-euclide.
- 4.05b Correction of an option (tkzDrawY).
Removing axesmin.tex Move from \newif\iftkz@integer to base.sty
diff --git a/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex b/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
index 8302156108..a114a0f844 100644
--- a/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
+++ b/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-main.tex
@@ -1,7 +1,7 @@
%!TEX TS-program = lualatex
% encoding: utf8
% documentation of tkz-base.sty
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -21,10 +21,10 @@
]{tkz-doc}
%\usepackage{etoc}
\gdef\tkznameofpack{tkz-base}
-\gdef\tkzversionofpack{4.2c}
+\gdef\tkzversionofpack{4.21c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{doc-tkz-base}
-\gdef\tkzversionofdoc{4.2c}
+\gdef\tkzversionofdoc{4.21c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
diff --git a/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex b/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
index ee25236f64..a6321cfc98 100644
--- a/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
+++ b/macros/latex/contrib/tkz/tkz-base/doc/latex/TKZdoc-base-point.tex
@@ -459,7 +459,7 @@ Here the points are positioned relative to the center of gravity of $A,B,C \ \te
\tkzGetPoint{B}
\tkzDrawPoints(O,A,B,C)
\tkzDrawSegments(C,B B,A A,O O,C)
- \tkzDefCentroid(A,B,C,O)
+ \tkzDefBarycentricPoint(A=1,B=1,C=1,O=1)
\tkzDrawPoint(tkzPointResult)
\tkzAutoLabelPoints[center=tkzPointResult,
dist=.3,red](O,A,B,C)
diff --git a/macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf b/macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
index 79495febbf..820469cef4 100644
--- a/macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
+++ b/macros/latex/contrib/tkz/tkz-base/doc/tkz-base.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg b/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
index 4d05fb564a..631dcece53 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.cfg
@@ -1,5 +1,5 @@
% tkz-base.cfg
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -16,9 +16,9 @@
% and save the file in a directory part of your TEXINPUTS environment
% variable.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-base.cfg}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-base.cfg}
%<------ colors ---------------------------------------–>
\def\tkz@backgroundcolor{white}
\def\tkz@textcolor{black}
@@ -134,7 +134,7 @@ arc style/.style={%
\def\tkz@mk@fill{\tkz@otherlinecolor}
%<--------------------------------------------------------------------------–>
%<------------------------------ styles ---------------------------------–>
-\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2022
+\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2024
\tikzset{xlabel style/.style = {below = 3 pt,
inner sep = 1pt,
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty b/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
index 0cea394871..347d87fe70 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-base.sty
@@ -1,5 +1,5 @@
% tkz-base.sty %
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,10 +10,10 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\typeout{2022/07/14 4.2c tkz-base.sty}
+\def\fileversion{4.21c}
+\typeout{2024/01/16 4.21c tkz-base.sty}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tkz-base}[2022/07/14 4.2c tkz-base]
+\ProvidesPackage{tkz-base}[2024/01/16 4.21c tkz-base]
\@ifpackageloaded{tkz-euclide}{\typeout{tkz-base and tkz-fct must be loaded before tkz-euclide}
\PackageError{tkz-base}{tkz-base must be loaded before tkz-euclide}{tkz-base must be loaded before tkz-euclide}%
\endinput}{}
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
index 8cb6a366a6..4f40bee35b 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-marks.tex
@@ -1,5 +1,5 @@
% tkz-lib-marks.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-lib-marks.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-lib-marks.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Création des symboles
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
index 8f45042a1b..1ed58295b5 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-lib-shape.tex
@@ -1,5 +1,5 @@
% tkz-lib-shape.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-lib-shape.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-lib-shape.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Création des symboles
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
index 1baf269bf9..530e405347 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-axes.tex
@@ -1,5 +1,5 @@
% tkz-obj-axes.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-obj-axes}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-obj-axes}
\makeatletter
\def\removedot#1.{#1}
@@ -32,7 +32,7 @@
% some tools
%<--------------------------------------------------------------------------–>
\def\tkz@showgrad#1{%
-\tkzgetinteger{#1}
+\tkzgetinteger{#1}%
\iftkz@integer\edef\tkz@result{\fpeval{trunc(#1,0)}}\else\edef\tkz@result{#1}\fi}%
\def\tkz@Xresult{%
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
index 654a29c49c..c7ba978f07 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-grids.tex
@@ -1,5 +1,5 @@
% tkz-obj-grids.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-obj-grids.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-obj-grids.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Setup Grid
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
index 6b39328d0d..5e0f01c604 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-marks.tex
@@ -1,5 +1,5 @@
%tkz-obj-marks.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-obj-marks.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-obj-marks.tex}
\makeatletter
%<-------------------------------------------------------------------------–>
% Setup Marks
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
index 21f2987bb9..c5e364753a 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-points.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-points.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14 }
-\typeout{2022/07/14 4.2c tkz-obj-points.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16 }
+\typeout{2024/01/16 4.21c tkz-obj-points.tex}
\makeatletter
%<--------------------------------------------------------------------------->
% init def point
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
index 7ec1e86626..b42ad25e50 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-obj-rep.tex
@@ -1,5 +1,5 @@
% tkz-obj-rep.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-obj-rep.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-obj-rep.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% repère
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
index 8d2f196f30..9246f98b45 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-BB.tex
@@ -1,5 +1,5 @@
% tkz-tools-BB.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-obj-BB.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-obj-BB.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
\def\tkzShowBB{\pgfutil@ifnextchar[{\tkz@ShowBB}{\tkz@ShowBB[]}}
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
index 2a163531a7..059e6b331d 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-arith.tex
@@ -1,5 +1,5 @@
% tkz-tools-arith.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-arith.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-arith.tex}
% 1.161 test if "isfactor" is already defined
% now with pgf 3.0 gcd isprime isodd iseven are defined
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
index 85955e1461..1a82a38b90 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-base.tex
@@ -1,5 +1,5 @@
% tkz-tools-base.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-base.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-base.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
index 9beab795b0..582f97b04b 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-colors.tex
@@ -1,5 +1,5 @@
% tkz-tools-colors
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-colors}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-colors}
\makeatletter
%<------ Initialisation of the colors with tkzSetUpColors ----------------->
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
index 83ae7c231c..f36f4e6b21 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-misc.tex
@@ -1,5 +1,5 @@
% tkz-tools-misc.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-misc.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-misc.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% hline pb avec line
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
index f662f8bfbe..ad378a78a2 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-modules.tex
@@ -1,5 +1,5 @@
% tkz-tools-modules
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-modules.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-modules.tex}
\makeatletter
%<------------- % chargement des modules ---------------------------------->
\def\tkz@obj@all{angles,arcs,compass,defcircles,deflines,defpoints,defpointsby,defpointsrnd,defpointswith,polygons,protractor,sectors,show,triangles}%
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
index 9776e57679..6b150d3314 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-print.tex
@@ -1,5 +1,5 @@
% tkz-tool-print.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-print}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-print}
\makeatletter
%<------------- tkzPrintFrac ---------------------------------->
\def\tkzPrintFrac#1#2{%
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
index 5c1f7fb8af..f8f236567c 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-text.tex
@@ -1,5 +1,5 @@
% tkz-tools-text.tex
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-text.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-text.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzText
diff --git a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
index f132d6053a..be21c796c3 100644
--- a/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
+++ b/macros/latex/contrib/tkz/tkz-base/latex/tkz-tools-utilities.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-utilities
-% Copyright 2022 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.2c}
-\def\filedate{2022/07/14}
-\typeout{2022/07/14 4.2c tkz-tools-utilities.tex}
+\def\fileversion{4.21c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 4.21c tkz-tools-utilities.tex}
\makeatletter
\pgfkeys{/tkzClip/.cd,
space/.store in = {\tkz@CLI@space},
diff --git a/macros/latex/contrib/tkz/tkz-elements/README.md b/macros/latex/contrib/tkz/tkz-elements/README.md
index a357bf2bf0..f5bfcebc80 100644
--- a/macros/latex/contrib/tkz/tkz-elements/README.md
+++ b/macros/latex/contrib/tkz/tkz-elements/README.md
@@ -1,10 +1,10 @@
# tkz-elements — for euclidean geometry
-Release 1.72c 2023/12/24
+Release 1.82c 2024/01/16
## Description
-`tkz-elements v.1.72c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`.
+`tkz-elements v.1.82c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`.
The main possibility of programmation proposed is oriented "object programming" with object classes like point, line, triangle, circle and ellipse. For the moment, once the calculations are done, it is `tkz-euclide` or `TikZ` which allows the drawings.
@@ -60,6 +60,38 @@ An important example `Golden Arbelos` using the package is on the site. All the
are on the site.
## History
+ - version 1.82c
+ - Point object : name like z.App now gives a node with name A''
+ - Modification of methods north,south
+ - Added the function length(z.A,z.B) shortcut for point.abs(z.A-z.B).
+ - Line object added some methods
+ - Added method in\_out\_segment
+ - (sacred triangle)
+ - gold
+ - sublime or euclide
+ - cheops
+ - divine
+ - pythagoras or isis or egyptian
+ - golden
+ - (classic triangles)
+ - two\_angles (side between)
+ - sss (three sides)
+ - ssa (two sides and an angle)
+ - sas (an angle between two sides)
+ - school (30°, 60° and 90°)
+ - half right triangle in A with AB= 2AC
+ - Circle object
+ - added method common_tangent (gives the common tangents of two circles)
+ - Correction for a bug and an oversight in the circles_position method.
+ - Rewriting the radical_axis methods
+ - Triangle object
+ - method trilinear (to use trilinear coordinates)
+ - method barycentric (to use barycentric coordinates)
+ - Added some functions
+ - bisector (a,b,c) altitude (a,b,c) bisector_ext(a,b,c) equilateral (a,b) midpoint (a,b) to avoid creating unnecessary objects.
+ - Added new examples and a cheat sheet in the documentation
+
+
- version 1.72c
- added a line method (apollonius) set of points M with MA/MB = k
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
index a945f3de7c..4dd3b75b60 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
@@ -13,18 +13,20 @@ This class is also defined by two points: on the one hand, the center and on the
\bgroup
\catcode`_=12
\small
-\captionof{table}{Circle attributes.}
+\captionof{table}{Circle attributes.}\label{circle:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} &\\
\Iattr{circle}{center} & |z.A = C.AB.center| &\\
\Iattr{circle}{through} & |z.B = C.AB.through| &\\
-\Iattr{circle}{type} & |C.AB.type| &\tkzar |C.OA.type = 'circle'|\\
-\Iattr{circle}{radius} & |C.AB.radius| &\tkzar |r = C.OA.radius | $r$ real number\\
-\Iattr{circle}{north} & |C.AB.north| &\tkzar |z.N = C.OA.north|\\
-\Iattr{circle}{south} & |C.AB.south| & \tkzar |z.S = C.OA.south| \\
-\Iattr{circle}{east} & |C.AB.east| &\tkzar |z.E = C.OA.east| \\
-\Iattr{circle}{west} & |C.AB.west| &\tkzar |z.W = C.OA.west| \\
+\Iattr{circle}{type} & |C.AB.type| & |C.OA.type = 'circle'|\\
+\Iattr{circle}{radius} & |C.AB.radius| & |r = C.OA.radius | $r$ real number\\
+\Iattr{circle}{north} & |C.AB.north| & |z.N = C.OA.north|\\
+\Iattr{circle}{south} & |C.AB.south| & |z.S = C.OA.south| \\
+\Iattr{circle}{east} & |C.AB.east| & |z.E = C.OA.east| \\
+\Iattr{circle}{west} & |C.AB.west| & |z.W = C.OA.west| \\
+\Iattr{circle}{opp} & |z.Ap = C.AB.opp| & see (\ref{ssub:example_circle_attributes}) \\
+\Iattr{circle}{ct} & |L = C.AB.ct| & see (\ref{ssub:example_circle_attributes}) \\
\bottomrule %
\end{tabular}
\egroup
@@ -44,14 +46,16 @@ Three attributes are used (south, west, radius).
z.s = C.ab.south
z.w = C.ab.west
r = C.ab.radius
+ z.c = C.ab.opp
+ z.r,z.t = get_points (C.ab.ct : ortho_from (z.b))
\end{tkzelements}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPoints(a,b,s,w)
- \tkzLabelPoints(a,b,s,w)
- \tkzDrawCircle(a,b)
- \tkzDrawSegment(a,b)
- \tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{r}}
+\tkzGetNodes
+\tkzDrawPoints(a,b,c,s,w)
+\tkzLabelPoints(a,b,c,s,w)
+\tkzDrawCircle(a,b)
+\tkzDrawSegments(a,b r,t b,c)
+\tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{r}}
\end{tikzpicture}
\end{tkzexample}
\end{minipage}
@@ -64,15 +68,16 @@ Three attributes are used (south, west, radius).
z.s = C.ab.south
z.w = C.ab.west
r = C.ab.radius
+ z.c = C.ab.opp
+ z.r,z.t = get_points (C.ab.ct : ortho_from (z.b))
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
-\tkzDrawPoints(a,b,s,w)
-\tkzLabelPoints(a,b,s,w)
+\tkzDrawPoints(a,b,c,s,w)
+\tkzLabelPoints(a,b,c,s,w)
\tkzDrawCircle(a,b)
-\tkzDrawSegment(a,b)
+\tkzDrawSegments(a,b r,t b,c)
\tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{r}}
\end{tikzpicture}
\hspace*{\fill}
@@ -86,45 +91,49 @@ Three attributes are used (south, west, radius).
\bgroup
\catcode`_=12
\small
-\captionof{table}{Circle methods.}
+\captionof{table}{Circle methods.}\label{circle:met}
\begin{tabular}{lll}
\toprule
\textbf{Methods} & \textbf{Comments} & \\
\midrule \\
\Imeth{circle}{new(O,A)} & |C.OA = circle : new (z.O,z.A)| & circle center $O$ through $A$\\
\Imeth{circle}{radius(O,r)} & |C.OA = circle : radius (z.O,2)| & circle center $O$ radius =2 cm\\
+\Imeth{circle}{diameter(A,B)} & |C.OA = circle :diameter(z.A,z.B)| & circle diameter $[AB]$ \\
\midrule
\textbf{Points} &&\\
\midrule
\Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| & $[BC]$ is a diameter \\
\Imeth{circle}{inversion (pt)} & |z.Bp = C.AC: inversion (z.B)|&\\
-\Imeth{circle}{midarc (z1,z2)} & |z.D = C.AB: midarc (z.B,z.C)|& $D$ is the midarc of $\widearc{BC}$\\
-\Imeth{circle}{point (t)} & |z.E = C.AB: point (0.25)|& |t| between 0 and 1\\
+\Imeth{circle}{midarc (pt,pt)} & |z.D = C.AB: midarc (z.B,z.C)|& $D$ is the midarc of $\widearc{BC}$\\
+\Imeth{circle}{point (r)} & |z.E = C.AB: point (0.25)|& |r| between 0 and 1\\
\Imeth{circle}{random\_pt(lower, upper)} & &\\
\Imeth{circle}{internal\_similitude (C)} & |z.I = C.one : internal_similitude (C.two)| &\\
\Imeth{circle}{external\_similitude (C)} & |z.J = C.one : external_similitude (C.two)| & \\
+\Imeth{circle}{radical\_center (C1<,C2>)} & or only (C1) & see \ref{sub:radical_center} \\
\midrule
\textbf{Lines} & & \\
\midrule
-\Imeth{circle}{radical\_axis (C)} & & \\
-\Imeth{circle}{tangent\_at (pt)} & |z.P = C.OA: tangent_at (z.M)| & $((PM) \perp (OM))$\\
-\Imeth{circle}{tangent\_from (pt)}& |z.M,z.N = C.OA: tangent_from (z.P)| &\\
-\Imeth{circle}{inversion (line)} & |L or C = C.AC: inversion (L.EF)|&\\
+\Imeth{circle}{radical\_axis (C)} & see ( \ref{sub:d_alembert_2} ; \ref{sub:radical_axis_v1} ; \ref{sub:radical_axis_v2} ; \ref{sub:radical_axis_v3} ; \ref{sub:radical_axis_v4})& \\
+\Imeth{circle}{tangent\_at (pt)} & |z.P = C.OA: tangent_at (z.M)| & see (\ref{ssub:lemoine} ; \ref{ssub:example_combination_of_methods})\\
+\Imeth{circle}{tangent\_from (pt)}& |z.M,z.N = C.OA: tangent_from (z.P)| & see (\ref{tangent_from})\\
+\Imeth{circle}{inversion (line)} & |L or C = C.AC: inversion (L.EF)|& see (\ref{ssub:inversion_line})\\
+\Imeth{circle}{common\_tangent (C)} & |z.a,z.b = C.AC: common_tangent (C.EF)|& see (\ref{sub:common_tangent} ; \ref{sub:common_tangent_orthogonality})\\
\midrule
\textbf{Circles}& &\\
\midrule
-\Imeth{circle}{orthogonal\_from (pt)} & |C = C.OA: orthogonal_from (z.P)| & \\
-\Imeth{circle}{orthogonal\_through (pta,ptb)} & |C = C.OA: orthogonal_through (z.z1,z.z2)|\\
+\Imeth{circle}{orthogonal\_from (pt)} & |C = C.OA: orthogonal_from (z.P)| & see (\ref{ssub:altshiller} ; \ref{sub:common_tangent_orthogonality} ; \ref{sub:orthogonal_circles_v1} ; \ref{sub:pencil_v1}) \\
+\Imeth{circle}{orthogonal\_through (pta,ptb)} & |C = C.OA: orthogonal_through (z.z1,z.z2)| & see (\ref{sub:orthogonal_circle_through})\\
\Imeth{circle}{inversion (...)} & | C.AC: inversion (pt, pts, L or C )|& see \ref{ssub:inversion}, \ref{ssub:inversion_point}, \ref{ssub:inversion_line}, \ref{ssub:inversion_circle}\\
\Imeth{circle}{midcircle (C)} & |C.inv = C.OA: midcircle (C.EF)| & see \ref{ssub:midcircle} \\
+\Imeth{circle}{radical\_circle (C1<,C2>)} & or only (C1) & see \ref{sub:radical_circle}\\
\midrule
\textbf{Miscellaneous} &&\\
\midrule
-\Imeth{circle}{power (pt)} &|p = C.OA: power (z.M)| & power with respect to a circle \\
-\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & boolean \\
-\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & boolean \\
+\Imeth{circle}{power (pt)} &|p = C.OA: power (z.M)| & see (\ref{sub:power_v1} ; \ref{sub:power_v2} ; \ref{sub:apollonius_circle_v1_with_inversion}) \\
+\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & see (\ref{sub:in_out_for_circle_and_disk}) \\
+\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & see (\ref{sub:in_out_for_circle_and_disk}) \\
\Imeth{circle}{draw ()} & for further use &\\
-\Imeth{circle}{circles\_position (C1,C2)} & see \ref{sub:circles_position} \\
+\Imeth{circle}{circles\_position (C1)} & result = string &see (\ref{sub:circles_position}) \\
\bottomrule
\end{tabular}
\egroup
@@ -570,7 +579,7 @@ z.X,z.Y = intersection (C.AO,C.BP)
This case is a little more complicated. We'll construct the two circles $(\alpha)$ and $(\beta)$ tangent to the two given circles. Then we construct the radical circle orthogonal to the circles $(\alpha)$ and $(\beta)$. Its center is the radical center as well as the center of internal similtude of circles of center $A$ and $B$.
\item When the two given circles are external to each other, we construct the external center of similitude of the two given circles.
-$I$ is the center of external similarity of the two given circles. To obtain the inversion circle, simply note that $H$ is such that $IH^2= IE\times IF$
+$I$ is the center of external similarity of the two given circles. To obtain the inversion circle, simply note that $H$ is such that $IH^2= IE\times IF$. \label{tangent_from}
\begin{minipage}{.4\textwidth}
\begin{verbatim}
@@ -757,13 +766,13 @@ Cette fonction retourne une chaîne qui indique la position du cercle par rappor
\begin{minipage}{.5\textwidth}
\begin{verbatim}
\begin{tkzelements}
- z.A = point : new ( 0 , 0 )
- z.a = point : new ( 3 , 0 )
- z.B = point : new ( 2 , 0 )
- z.b = point : new ( 3 , 0 )
- C.Aa = circle: new (z.A,z.a)
- C.Bb ·= circle: new (z.B,z.b)
- position = circles_position (C.Aa,C.Bb)
+ z.A = point : new ( 0 , 0 )
+ z.a = point : new ( 3 , 0 )
+ z.B = point : new ( 2 , 0 )
+ z.b = point : new ( 3 , 0 )
+ C.Aa = circle: new (z.A,z.a)
+ C.Bb = circle: new (z.B,z.b)
+ position = C.Aa : circles_position (C.Bb)
if position == "inside tangent"
then color = "orange"
else color = "blue" end
@@ -784,7 +793,7 @@ z.B = point : new ( 2 , 0 )
z.b = point : new ( 3 , 0 )
C.Aa = circle: new (z.A,z.a)
C.Bb = circle: new (z.B,z.b)
-position = circles_position (C.Aa,C.Bb)
+position = C.Aa : circles_position (C.Bb)
if position == "inside tangent" then color = "orange" else color = "blue" end
\end{tkzelements}
\hspace{\fill}
@@ -795,5 +804,214 @@ if position == "inside tangent" then color = "orange" else color = "blue" end
\end{tikzpicture}\hspace{\fill}
\end{minipage}
% subsection circles__position (end)
+
+\subsection{Common tangent: Angle of two intersecting circles} % (fold)
+\label{sub:common_tangent}
+
+Let be a tangent common to both circles at $T$ and $T'$ (closest to $C$). Let a secant parallel to this tangent pass through $C$. Then the segment $[TT']$ is seen from the other common point $D$ at an angle equal to half the angle of the two circles.
+
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ z.C = point : new ( 1 , 2 )
+ C.AC = circle : new (z.A,z.C)
+ C.BC = circle : new (z.B,z.C)
+ z.T,z.Tp = C.AC : common_tangent (C.BC)
+ L.TTp = line : new (z.T,z.Tp)
+ z.M = C.AC : point (0.45)
+ L.MC =line : new (z.M,z.C)
+ z.Mp = intersection (L.MC, C.BC)
+ L.mm = L.TTp : ll_from (z.C)
+ _,z.M = intersection (L.mm, C.AC)
+ z.Mp = intersection (L.mm, C.BC)
+ _,z.D = intersection (C.AC,C.BC)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,C B,C)
+ \tkzDrawSegments(M,M' A,D B,D A,B C,D T,C T',C)
+ \tkzDrawSegments[gray](D,M D,M' T,T' D,T D,T')
+ \tkzDrawPoints(A,B,C,D,M,M',T,T')
+ \tkzLabelPoints(A,B,D,M)
+ \tkzLabelPoints[above](C,M',T,T')
+ \tkzMarkAngles[mark=|,size=.75](T,C,M C,T,T' C,D,T T,D,M)
+ \tkzMarkAngles[mark=||,size=.75](M',C,T' T,T',C T',D,C M',D,T')
+\end{tikzpicture}
+\end{verbatim}
+
+
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 2 )
+L.AB = line : new ( z.A , z.B )
+z.C = point : new ( 1 , 2 )
+C.AC = circle : new (z.A,z.C)
+C.BC = circle : new (z.B,z.C)
+z.T,z.Tp = C.AC : common_tangent (C.BC)
+L.TTp = line : new (z.T,z.Tp)
+z.M = C.AC : point (0.45)
+L.MC =line : new (z.M,z.C)
+z.Mp = intersection (L.MC, C.BC)
+L.mm = L.TTp : ll_from (z.C)
+_,z.M = intersection (L.mm, C.AC)
+z.Mp = intersection (L.mm, C.BC)
+_,z.D = intersection (C.AC,C.BC)
+\end{tkzelements}
+\hspace*{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles(A,C B,C)
+\tkzDrawSegments(M,M' A,D B,D A,B C,D T,C T',C)
+\tkzDrawSegments[gray](D,M D,M' T,T' D,T D,T')
+\tkzDrawPoints(A,B,C,D,M,M',T,T')
+\tkzLabelPoints(A,B,D,M)
+\tkzLabelPoints[above](C,M',T,T')
+\tkzMarkAngles[mark=|,size=.75](T,C,M C,T,T' C,D,T T,D,M)
+\tkzMarkAngles[mark=||,size=.75](M',C,T' T,T',C T',D,C M',D,T')
+\end{tikzpicture}
+\hspace*{\fill}
+
+% subsection common_tangent (end)
+
+\subsection{Common tangent: orthogonality} % (fold)
+\label{sub:common_tangent_orthogonality}
+For two circles to be orthogonal, it is necessary and sufficient for a secant passing through one of their common points to be seen from the other common point at a right angle.
+
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ z.a = point : new ( 1 , 2 )
+ C.Aa = circle : new (z.A,z.a)
+ C.BC = C.Aa : orthogonal_from (z.B)
+ z.C,z.D = intersection (C.Aa,C.BC)
+ C.AC = circle : new (z.A,z.C)
+ z.T,z.Tp = C.AC : common_tangent (C.BC)
+ L.TTp = line : new (z.T,z.Tp)
+ z.M = C.AC : point (0.45)
+ L.MC =line : new (z.M,z.C)
+ z.Mp = intersection (L.MC, C.BC)
+ L.mm = L.TTp : ll_from (z.C)
+ _,z.M = intersection (L.mm, C.AC)
+ z.Mp = intersection (L.mm, C.BC)
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,C B,C)
+ \tkzDrawSegments(M,M' A,C B,C A,B)
+ \tkzDrawSegments[gray](D,M D,M' T,T')
+ \tkzDrawPoints(A,B,C,D,M,M',T,T')
+ \tkzLabelPoints(A,B,D,M)
+ \tkzLabelPoints[above](C,M',T,T')
+ \tkzMarkRightAngles(M',D,M A,C,B)
+\end{tikzpicture}
+\end{verbatim}
+
+\begin{tkzelements}
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 2 )
+L.AB = line : new ( z.A , z.B )
+z.a = point : new ( 1 , 2 )
+C.Aa = circle : new (z.A,z.a)
+C.BC = C.Aa : orthogonal_from (z.B)
+z.C,z.D = intersection (C.Aa,C.BC)
+C.AC = circle : new (z.A,z.C)
+z.T,z.Tp = C.AC : common_tangent (C.BC)
+L.TTp = line : new (z.T,z.Tp)
+z.M = C.AC : point (0.45)
+L.MC =line : new (z.M,z.C)
+z.Mp = intersection (L.MC, C.BC)
+L.mm = L.TTp : ll_from (z.C)
+_,z.M = intersection (L.mm, C.AC)
+z.Mp = intersection (L.mm, C.BC)
+\end{tkzelements}
+ \hspace*{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,C B,C)
+ \tkzDrawSegments(M,M' A,C B,C A,B)
+ \tkzDrawSegments[gray](D,M D,M' T,T')
+ \tkzDrawPoints(A,B,C,D,M,M',T,T')
+ \tkzLabelPoints(A,B,D,M)
+ \tkzLabelPoints[above](C,M',T,T')
+ \tkzMarkRightAngles(M',D,M A,C,B)
+\end{tikzpicture}
+\hspace*{\fill}
+% subsection common_tangent_orthogonality (end)
+
+\subsection{In\_out for circle and disk} % (fold)
+\label{sub:in_out_for_circle_and_disk}
+
+\begin{verbatim}
+\begin{tkzelements}
+z.O = point : new (0,0)
+z.A = point : new (1,2)
+C.OA = circle : new (z.O,z.A)
+z.N = point : new (-2,2)
+z.M = point : new (1,0)
+z.P = point : new (2,1)
+BCm = C.OA : in_out (z.M)
+BDm = C.OA : in_out_disk (z.M)
+BCn = C.OA : in_out (z.N)
+BDn = C.OA : in_out_disk (z.N)
+BCp = C.OA : in_out (z.P)
+BDp = C.OA : in_out_disk (z.P)
+\end{tkzelements}
+\def\tkzPosPoint#1#2#3#4{%
+\tkzLabelPoints(O,M,N,P)
+ \ifthenelse{\equal{\tkzUseLua{#1}}{true}}{
+ \tkzLabelPoint[below=#4pt,font=\scriptsize](#2){on the #3}}{%
+ \tkzLabelPoint[below=#4pt,font=\scriptsize](#2){out the #3}}}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawSegments[dashed](O,M O,N O,P)
+\tkzDrawCircle(O,A)
+\tkzDrawPoints(O,M,N,P)
+\tkzPosPoint{BCm}{M}{circle}{8}
+\tkzPosPoint{BCn}{N}{circle}{8}
+\tkzPosPoint{BCp}{P}{circle}{8}
+\tkzPosPoint{BDm}{M}{disk}{14}
+\tkzPosPoint{BDn}{N}{disk}{14}
+\tkzPosPoint{BDp}{P}{disk}{14}
+\end{tikzpicture}
+\end{verbatim}
+
+\begin{tkzelements}
+z.O = point : new (0,0)
+z.A = point : new (1,2)
+C.OA = circle : new (z.O,z.A)
+z.N = point : new (-2,2)
+z.M = point : new (1,0)
+z.P = point : new (2,1)
+BCm = C.OA : in_out (z.M)
+BDm = C.OA : in_out_disk (z.M)
+BCn = C.OA : in_out (z.N)
+BDn = C.OA : in_out_disk (z.N)
+BCp = C.OA : in_out (z.P)
+BDp = C.OA : in_out_disk (z.P)
+\end{tkzelements}
+\def\tkzPosPoint#1#2#3#4{%
+\tkzLabelPoints(O,M,N,P)
+ \ifthenelse{\equal{\tkzUseLua{#1}}{true}}{
+ \tkzLabelPoint[below=#4pt,font=\scriptsize](#2){on the #3}}{%
+ \tkzLabelPoint[below=#4pt,font=\scriptsize](#2){out the #3}}
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawSegments[dashed](O,M O,N O,P)
+\tkzDrawCircle(O,A)
+\tkzDrawPoints(O,M,N,P)
+\tkzPosPoint{BCm}{M}{circle}{8}
+\tkzPosPoint{BCn}{N}{circle}{8}
+\tkzPosPoint{BCp}{P}{circle}{8}
+\tkzPosPoint{BDm}{M}{disk}{14}
+\tkzPosPoint{BDn}{N}{disk}{14}
+\tkzPosPoint{BDp}{P}{disk}{14}
+\end{tikzpicture}
+% subsection in_out_for_circle_and_disk (end)
% section class_circle (end)
\endinput
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
index e700019fa3..bbe39aa1a2 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex
@@ -10,7 +10,7 @@ The first attributes are the three points that define the ellipse : \Iattr{ellip
\bgroup
\catcode`_=12
\small
-\captionof{table}{Ellipse attributes.}
+\captionof{table}{Ellipse attributes.}\label{ellipse:att}
\begin{tabular}{ll}
\toprule
\textbf{Attributes} & \textbf{Application}\\
@@ -34,84 +34,85 @@ The first attributes are the three points that define the ellipse : \Iattr{ellip
\subsubsection{Atributes of an ellipse: example} % (fold)
\label{ssub:attributes_of_an_ellipse}
-\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.C = point: new (3 , 2)
- z.A = point: new (5 , 1)
- L.CA = line : new (z.C,z.A)
- z.b = L.CA.north_pa
- L = line : new (z.C,z.b)
- z.B = L : point (0.5)
- E = ellipse: new (z.C,z.A,z.B)
- a = E.Rx
- b = E.Ry
- z.F1 = E.Fa
- z.F2 = E.Fb
- slope = math.deg(E.slope)
- z.E = E.east
- z.N = E.north
- z.W = E.west
- z.S = E.south
- z.Co = E.covertex
- z.Ve = E.vertex
-\end{tkzelements}
-\begin{tikzpicture}
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.C = point: new (3 , 2)
+ z.A = point: new (5 , 1)
+ L.CA = line : new (z.C,z.A)
+ z.b = L.CA.north_pa
+ L = line : new (z.C,z.b)
+ z.B = L : point (0.5)
+ E = ellipse: new (z.C,z.A,z.B)
+ a = E.Rx
+ b = E.Ry
+ z.F1 = E.Fa
+ z.F2 = E.Fb
+ slope = math.deg(E.slope)
+ z.E = E.east
+ z.N = E.north
+ z.W = E.west
+ z.S = E.south
+ z.Co = E.covertex
+ z.Ve = E.vertex
+ \end{tkzelements}
+ \begin{tikzpicture}
+ \pgfkeys{/pgf/number format/.cd,fixed,precision=2}
+ \tkzGetNodes
+ \tkzDrawCircles[teal](C,A)
+ \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},
+ \tkzUseLua{slope})
+ \tkzDrawPoints(C,A,B,b,W,S,F1,F2)
+ \tkzLabelPoints(C,A,B)
+ \tkzDrawLine[add = .5 and .5](A,W)
+ \tkzLabelSegment[pos=1.5,above,sloped](A,W){%
+ slope = \pgfmathprintnumber{\tkzUseLua{slope}}}
+ \tkzLabelPoint[below](S){South}
+ \tkzLabelPoint[below left](F1){Focus 1}
+ \tkzLabelPoint[below left](F2){Focus 2}
+ \tkzLabelPoint[above right](Ve){Vertex ; East}
+ \tkzLabelPoint[above right](Co){Covertex ; North}
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{tkzelements}
+ z.C = point: new (3 , 2)
+ z.A = point: new (5 , 1)
+ L.CA = line : new (z.C,z.A)
+ z.b = L.CA.north_pa
+ L = line : new (z.C,z.b)
+ z.B = L : point (0.5)
+ E = ellipse: new (z.C,z.A,z.B)
+ a = E.Rx
+ b = E.Ry
+ z.F1 = E.Fa
+ z.F2 = E.Fb
+ slope = math.deg(E.slope)
+ z.E = E.east
+ z.N = E.north
+ z.W = E.west
+ z.S = E.south
+ z.Co = E.covertex
+ z.Ve = E.vertex
+ \end{tkzelements}
+ \hspace*{\fill}
+ \begin{tikzpicture}
\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
\tkzGetNodes
\tkzDrawCircles[teal](C,A)
- \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},
- \tkzUseLua{slope})
+ \tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
\tkzDrawPoints(C,A,B,b,W,S,F1,F2)
\tkzLabelPoints(C,A,B)
\tkzDrawLine[add = .5 and .5](A,W)
- \tkzLabelSegment[pos=1.5,above,sloped](A,W){%
- slope = \pgfmathprintnumber{\tkzUseLua{slope}}}
+ \tkzLabelSegment[pos=1.25,above,sloped](A,W){slope = \pgfmathprintnumber{\tkzUseLua{slope}}}
\tkzLabelPoint[below](S){South}
\tkzLabelPoint[below left](F1){Focus 1}
\tkzLabelPoint[below left](F2){Focus 2}
\tkzLabelPoint[above right](Ve){Vertex ; East}
\tkzLabelPoint[above right](Co){Covertex ; North}
-\end{tikzpicture}
-\end{tkzexample}
-
-\begin{tkzelements}
-z.C = point: new (3 , 2)
-z.A = point: new (5 , 1)
-L.CA = line : new (z.C,z.A)
-z.b = L.CA.north_pa
-L = line : new (z.C,z.b)
-z.B = L : point (0.5)
-E = ellipse: new (z.C,z.A,z.B)
-a = E.Rx
-b = E.Ry
-z.F1 = E.Fa
-z.F2 = E.Fb
-slope = math.deg(E.slope)
-z.E = E.east
-z.N = E.north
-z.W = E.west
-z.S = E.south
-z.Co = E.covertex
-z.Ve = E.vertex
-\end{tkzelements}
-
-\hspace*{\fill}
-\begin{tikzpicture}
-\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
-\tkzGetNodes
-\tkzDrawCircles[teal](C,A)
-\tkzDrawEllipse[red](C,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{slope})
-\tkzDrawPoints(C,A,B,b,W,S,F1,F2)
-\tkzLabelPoints(C,A,B)
-\tkzDrawLine[add = .5 and .5](A,W)
-\tkzLabelSegment[pos=1.5,above,sloped](A,W){slope = \pgfmathprintnumber{\tkzUseLua{slope}}}
-\tkzLabelPoint[below](S){South}
-\tkzLabelPoint[below left](F1){Focus 1}
-\tkzLabelPoint[below left](F2){Focus 2}
-\tkzLabelPoint[above right](Ve){Vertex ; East}
-\tkzLabelPoint[above right](Co){Covertex ; North}
-\end{tikzpicture}
-\hspace*{\fill}
+ \end{tikzpicture}
+\end{minipage}
% \caption{Class Ellipse}
% subsection attributes_of_an_ellipse (end)
@@ -128,7 +129,7 @@ To do this, you'll need to use a \pkg{tkz-elements }function: \Igfct{package}{se
\bgroup
\catcode`_=12
\small
-\captionof{table}{Ellipse methods.}
+\captionof{table}{Ellipse methods.}\label{ellipse:met}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Example} \\
@@ -193,7 +194,7 @@ slope = math.deg(E.slope)
\end{tikzpicture}
\end{minipage}
-The function \Igfct{package}{set\_lua\_to\_tex (list)} is used to define the macros that will be used to draw the ellipse with \TIKZ\ or \pkg{tkz-euclide}.
+The function \Igfct{package}{tkzUseLua (variable)} is used to transfer values to \TIKZ\ or \pkg{tkz-euclide}.
% subsubsection method_imeth_ellipse_new (end)
@@ -203,7 +204,8 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
\emph{The function launches the |new| method, all the characteristics of the ellipse are defined.}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{minipage}{0.6\textwidth}
+\begin{verbatim}
\begin{tkzelements}
z.A = point: new (0 , 0)
z.B = point: new (5 , 1)
@@ -227,9 +229,6 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
a,b = E.Rx,E.Ry
ang = math.deg(E.slope)
\end{tkzelements}
-\end{tkzexample}
-\begin{minipage}{0.6\textwidth}
- \begin{tkzexample}[latex=0cm,small,code only]
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygon(A,B,C)
@@ -245,7 +244,7 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
\tkzLabelPoints[left](A)
\tkzLabelPoints[right](B,I,S,H)
\end{tikzpicture}
-\end{tkzexample}
+\end{verbatim}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{tkzelements}
@@ -290,7 +289,7 @@ The first two points are the foci of the ellipse. The third one is the vertex. W
% subsubsection function_tkzname_ellipse__foci (end)
\subsubsection{Method \Imeth{ellipse}{point} and \Imeth{ellipse}{radii}} % (fold)
-\label{ssub:method_point}
+\label{ssub:ellipse_method_point}
The method \Imeth{ellipse}{point} defines a point $M$ of the ellipse whose coordinates are $(a\times cos(phi), b\times sin(phi))$. |phi| angle between (center,vertex) and (center,M)
\emph{The environment \tkzNameEnv{tkzelements} uses as \tkzname{lua} the radian as unit for angles. }
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
index 8ecdac344f..feab38af27 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
@@ -18,7 +18,7 @@ The attributes are :
\bgroup
\catcode`_=12
\small
-\captionof{table}{Line attributes.}
+\captionof{table}{Line attributes.}\label{line:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} & \\
@@ -26,12 +26,12 @@ The attributes are :
\Iattr{line}{pb} & Second point of the segment & \\
\Iattr{line}{type} & Type is 'line' & |L.AB.type = 'line'| \\
\Iattr{line}{mid} & Middle of the segment& |z.M = L.AB.mid|\\
-\Iattr{line}{slope} & Slope of the line & obtained with |an = L.AB.slope|\\
-\Iattr{line}{length} & Length of the segment& |l = L.AB.length| \\
-\Iattr{line}{north\_pa} & See next example& d(a,north—pa)=d(a,b)=d(east,b) =etc. \\
+\Iattr{line}{slope} & Slope of the line & see (\ref{ssub:example_class_line})\\
+\Iattr{line}{length} &|l = L.AB.length|&see (\ref{sub:transfer_from_lua_to_tex} ; \ref{ssub:example_class_line})\\
+\Iattr{line}{north\_pa} & See (\ref{ssub:example_class_line}) & \\
\Iattr{line}{north\_pb} & &\\
\Iattr{line}{south\_pa} & &\\
-\Iattr{line}{south\_pb} & &\\
+\Iattr{line}{south\_pb} & &See (\ref{ssub:example_class_line}) \\
\Iattr{line}{east} & &\\
\Iattr{line}{west} & &\\
\bottomrule
@@ -76,8 +76,8 @@ z.m = L.ab.mid
z.w = L.ab.west
z.e = L.ab.east
z.r = L.ab.north_pa
-z.s = L.ab.south_pb
-sl = L.ab.slope
+z.s = L.ab.south_pb
+sl = L.ab.slope
len = L.ab.length
\end{tkzelements}
\hspace*{\fill}
@@ -146,78 +146,433 @@ With | L.AB = line : new (z.A,z.B)|, a line is defined.
% subsubsection example_line_attributes (end)
% subsection attributes_of_a_line (end)
-\clearpage\newpage
+\newpage
\subsection{Methods of the class line} % (fold)
\label{sub:methods_from_class_line}
-Here's the list of methods for the \tkzNameObj{line} object. The results are either reals, points, lines, circles or triangles.
-\subsubsection{Table of the methods from class line} % (fold)
-\label{ssub:table_of_the_methods_from_class_line}
+Here's the list of methods for the \tkzNameObj{line} object. The results are either reals, points, lines, circles or triangles. The triangles obtained are similar to the triangles defined below.
-\vspace{1em}
\begin{minipage}{\textwidth}
- \bgroup
- \catcode`_=12
- \small
- \captionof{table}{Methods of the class line.}
- \begin{tabular}{lll}
- \toprule
- \textbf{Methods} & \textbf{Comments} & \\
- \midrule
- \Imeth{line}{new(A, B)} & |L.AB = line : new(z.A,z.B)| line through the points $A$ and $B$&\\
- \midrule
- \textbf{Points} &&\\
- \midrule
- \Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| & gold ratio \\
- \Imeth{line}{normalize ()} & |z.C = L.AB : normalize()| & AC =1 and $C\in (AB)$ \\
- \Imeth{line}{normalize\_inv ()} & |z.C = L.AB : normalize_inv()| & CB =1 and $C\in (AB)$ \\
- \Imeth{line}{barycenter (ka,kb)} & |z.C = L.AB : barycenter (1,2)| $C$ & barycenter of |{(A,1)(B,2)}|\\
- \Imeth{line}{point (t)} & |z.C = L.AB : point (2)| & $\overrightarrow{AC} = 2\overrightarrow{AB}$\\
- \Imeth{line}{midpoint ()} & |z.M = L.AB : midpoint ()| & better is |z.M = L.AB.mid| \\
- \Imeth{line}{harmonic\_int } & |z.D = L.AB : harmonic_int (z.C)| & $D\in [AB]$ $C\notin [AB]$\\
- \Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| & $D\notin [AB]$ $C\in [AB]$\\
- \Imeth{line}{harmonic\_both (k)} & |z.C,z.D = L.AB : harmonic_both (tkzphi)| & ${ {CA/CB}={DA/DB}=t\varphi.}$\\
- \Imeth{line}{square ()} & |S.AB =(L.AB : square ()) | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}\\
- \midrule
- \textbf{Lines} &&\\
- \midrule
- \Imeth{line}{ll\_from ( pt )} & |L.CD = L.AB : ll_from (z.C)| & $(CD) \parallel (AB)$ \\
- \Imeth{line}{ortho\_from ( pt )} & |L.CD = L.AB : ortho_from (z.C)|& $(CD) \perp (AB)$\\
- \Imeth{line}{mediator ()}&|L.uv = L.AB : mediator ()| & $(u,v)$ mediator of $(A,B)$\\
- \midrule
- \textbf{Triangles}&&\\
- \midrule
- \Imeth{line}{equilateral (swap)} & |T.ABC = L.AB : equilateral ()| $(\overrightarrow{AB},\overrightarrow{AC})>0$ & or < with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.} \\
- \Imeth{line}{isosceles (phi,swap)} & |T.ABC = L.AB : isosceles (math.pi/6)|& \\
- \Imeth{line}{gold (swap)} & |T.ABC = L.AB : gold ()| & right in $B$ and $AC = \varphi \times AB $ \\
- \Imeth{line}{euclide (swap)} & |T.ABC = L.AB : euclide ()| & $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = math.pi/5$ \\
- \Imeth{line}{golden (swap)} & |T.ABC = L.AB : golden ()| & $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ \\
- \midrule
- \textbf{Circles} &&\\
- \midrule
- \Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| & center pa through pb \\
- \Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle\_swap ()|& center pb through pa \\
- \Imeth{line}{apollonius (k)} & |C.apo = L.AB : apollonius (2)|& Ensemble des points tq. |MA/MB = 2| \\
- \midrule
- \textbf{Transformations} &&\\
- \midrule
- \Imeth{line}{reflection ( obj )} & |new obj = L.AB : reflection (obj|&\\
- \Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|&\\
- \Imeth{line}{projection ( obj )} & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$\\
- \midrule
- \textbf{Miscellaneous} &&\\
- \midrule
- \Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| & see \ref{ssub:example_distance_and_projection}\\
- \Imeth{line}{in\_out (pt)} & |b = L.AB: in_out(z.C)| b=true if $C\in (AB)$ &\\
- \Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope \\
- \bottomrule
- \end{tabular}
-
- \egroup
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Methods of the class line.(part 1)}\label{line:methods1}
+\begin{tabular}{lll}
+\toprule
+\textbf{Methods} & \textbf{Comments} & \\
+\midrule
+\Imeth{line}{new(pt, pt)} & |L.AB = line : new(z.A,z.B)| line $(AB)$& see (\ref{ssub:altshiller})\\
+\midrule
+\textbf{Points} &&\\
+\midrule
+\Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| & see (\ref{sub:gold_ratio_with_segment} ; \ref{sub:the_figure_pappus_circle} ; \ref{sub:bankoff_circle}) \\
+\Imeth{line}{normalize ()} & |z.C = L.AB : normalize()| & AC =1 and $C\in (AB)$ see (\ref{ssub:normalize}) \\
+\Imeth{line}{normalize\_inv ()} & |z.C = L.AB : normalize_inv()| & CB =1 and $C\in (AB)$ \\
+ \Imeth{line}{barycenter (r,r)} & |z.C = L.AB : barycenter (1,2)| & see (\ref{ssub:barycenter_with_a_line})\\
+ \Imeth{line}{point (r)} & |z.C = L.AB : point (2)| & $\overrightarrow{AC} = 2\overrightarrow{AB}$ See (\ref{sub:ellipse} ; \ref{ssub:method_point})\\
+\Imeth{line}{midpoint ()} & |z.M = L.AB : midpoint ()| & better is |z.M = L.AB.mid| \\
+\Imeth{line}{harmonic\_int (pt)} & |z.D = L.AB : harmonic_int (z.C)| & See (\ref{sub:bankoff_circle})\\
+\Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| & See (\ref{sub:bankoff_circle})\\
+\Imeth{line}{harmonic\_both (r)} & |z.C,z.D = L.AB : harmonic_both|($\varphi$) & \ref{sub:harmonic_division_with_tkzphi}\\
+\Imeth{line}{square ()} & |S.AB = L.AB : square () | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}\\
+\midrule
+\textbf{Lines} &&\\
+\midrule
+\Imeth{line}{ll\_from ( pt )} & |L.CD = L.AB : ll_from (z.C)| & $(CD) \parallel (AB)$ \\
+\Imeth{line}{ortho\_from ( pt )} & |L.CD = L.AB : ortho_from (z.C)|& $(CD) \perp (AB)$\\
+\Imeth{line}{mediator ()}&|L.uv = L.AB : mediator ()| & $(u,v)$ mediator of $(A,B)$\\
+\midrule
+\textbf{Triangles}&&\\
+\midrule
+\Imeth{line}{equilateral (<swap>)} & |T.ABC = L.AB : equilateral ()| & $(\overrightarrow{AB},\overrightarrow{AC})>0$ or $<0$ with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.} \\
+\Imeth{line}{isosceles (an<,swap>)} & |T.ABC = L.AB : isosceles (math.pi/6)|& \\
+\Imeth{line}{two\_angles (an,an)} & |T.ABC = L.AB : two_angles (an,an)|&note \footnote{The given side is between the two angles} see ( ) \\
+\Imeth{line}{school ()} & Angle measurements are 30°,60° and 90°. & \\
+\Imeth{line}{sss (r,r)} & $AC=r$ $BC=r$ & \\
+\Imeth{line}{as (r,an)} & $AC =r$ $\widehat{BAC} = an$& \\
+\Imeth{line}{sa (r,an)} & $AC =r$ $\widehat{ABC} = an$& \\
+\midrule
+\textbf{Sacred triangles}&&\\
+\midrule
+\Imeth{line}{gold (<swap>)} & |T.ABC = L.AB : gold ()| & right in $B$ and $AC = \varphi \times AB $ \\
+\Imeth{line}{euclide (<swap>)} & |T.ABC = L.AB : euclide ()| & $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = \pi/5$ \\
+\Imeth{line}{golden (<swap>)} & |T.ABC = L.AB : golden ()| &
+ $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ \\
+\Imeth{line}{divine ()} & & \\
+\Imeth{line}{egyptian ()} & & \\
+\Imeth{line}{cheops ()} & & \\
+\bottomrule
+\end{tabular}
+\egroup
\end{minipage}
-% subsubsection table_of_the_methods_from_class_line (end)
+\begin{minipage}{\textwidth}
+\bgroup
+\catcode`_=12
+\small
+\captionof{table}{Methods of the class line.(part 2)}\label{line:methods2}
+\begin{tabular}{lll}
+\toprule
+\textbf{Methods} & \textbf{Comments} & \\
+\midrule
+\textbf{Circles} &&\\
+\midrule
+\Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| & center pa through pb \\
+\Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle_swap ()|& center pb through pa \\
+\Imeth{line}{apollonius (r)} & |C.apo = L.AB : apollonius (2)|& Ensemble des points tq. |MA/MB = 2| \\
+\midrule
+\textbf{Transformations} &&\\
+\midrule
+\Imeth{line}{reflection ( obj )} & |new obj = L.AB : reflection (obj|&\\
+\Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|&\\
+\Imeth{line}{projection ( obj )} & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$\\
+\midrule
+\textbf{Miscellaneous} &&\\
+\midrule
+\Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| & see \ref{ssub:example_distance_and_projection}\\
+\Imeth{line}{in\_out (pt)} & |b = L.AB: in_out(z.C)| & b=true if $C\in (AB)$ \\
+\Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope \\
+\Imeth{line}{in\_out\_segment (pt)} & |b = L.AB : in_out_segment(z.C)| & b=true if $C\in [AB$] \\
+\bottomrule
+\end{tabular}
+\egroup
+\end{minipage}
+
+\vspace{1 em}
Here are a few examples.
+\subsubsection{Triangle with two\_angles} % (fold)
+\label{ssub:triangle_with_two__angles}
+
+The angles are on either side of the given segment
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : two_angles (math.pi/6,math.pi/2)
+ z.C = T.ABC.pc
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+ \begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC= L.AB : two_angles (math.pi/6,math.pi/2)
+ z.C = T.ABC.pc
+ \end{tkzelements}
+ \hspace*{\fill}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C)
+ \end{tikzpicture}
+ \hspace*{\fill}
+\end{minipage}
+% subsubsection triangle_with_two__angles (end)
+
+\subsubsection{Triangle with three given sides} % (fold)
+\label{ssub:triangle_with_three_given_sides}
+
+In the following example, a small difficulty arises. The given lengths are not affected by scaling, so it's necessary to use the \Igfct{math}{value (r) } function, which will modify the lengths according to the scale.
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ scale =1.25
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : sss (value(3),value(4))
+ z.C = T.ABC.pc
+\end{tkzelements}
+\begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+ \begin{tkzelements}
+ scale =1.25
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : sss (value(3),value(4))
+ z.C = T.ABC.pc
+ \end{tkzelements}
+\hspace{\fill} \begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C)
+ \end{tikzpicture}
+\end{minipage}
+% subsubsection triangle_with_three_given_sides (end)
+
+\subsubsection{Triangle with side between side and angle} % (fold)
+\label{ssub:triangle_with_side_between_side_and_angle}
+
+In some cases, two solutions are possible.
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ scale =1.2
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6)
+ z.C = T.ABC.pc
+ z.D = T.ABD.pc
+\end{tkzelements}
+\begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C A,B,D)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C,D)
+ \tkzLabelAngle(C,B,A){$\pi/3$}
+ \tkzLabelSegment[below left](A,C){$7$}
+ \tkzLabelSegment[below left](A,D){$7$}
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+ \begin{tkzelements}
+ scale =1.2
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6)
+ z.C = T.ABC.pc
+ z.D = T.ABD.pc
+ \end{tkzelements}
+ \hspace{\fill} \begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C A,B,D)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoints[above](C,D)
+ \tkzLabelAngle(C,B,A){$\pi/3$}
+ \tkzLabelSegment[below left](A,C){$7$}
+ \tkzLabelSegment[below left](A,D){$7$}
+ \end{tikzpicture}
+\end{minipage}
+
+% subsubsection triangle_with_side_between_side_and_angle (end)
+
+\subsubsection{About sacred triangles} % (fold)
+\label{ssub:about_triangles}
+The side lengths are proportional to the lengths given in the table. They depend on the length of the initial segment.
+
+\captionof{table}{Sacred triangles.}\label{line:met}
+\begin{tabular}{ll}
+\toprule
+\textbf{Name} & \textbf{definition} \\
+\midrule
+\Imeth{line}{gold (<swap>)} & Right triangle with $a=\varphi$, $b=1$ and $c=\sqrt{\varphi}$\\
+\Imeth{line}{golden (<swap>)} &Right triangle $b=\varphi$ $c=1$ ; half of gold rectangle \\
+\Imeth{line}{divine ()} & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\
+\Imeth{line}{pythagoras ()} & $a=5$, $b=4$, $c=3$ and other names: isis or egyptian\\
+\Imeth{line}{sublime ()} & Isosceles $a=1$, $b=c=\varphi$ and $\beta =\gamma=2\pi/5$ ; other name: euclid\\
+\Imeth{line}{cheops ()} & Isosceles $a=2$, $b=c=\varphi$ and height = $\sqrt{\varphi}$ \\
+\bottomrule
+\end{tabular}
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : cheops ()
+ z.C = T.ABC.pc
+ T.ABD = L.AB : gold ()
+ z.D = T.ABD.pc
+ T.ABE = L.AB : euclide ()
+ z.E = T.ABE.pc
+ T.ABF = L.AB : golden ()
+ z.F = T.ABF.pc
+ T.ABG = L.AB : devine ()
+ z.G = T.ABG.pc
+ T.ABH = L.AB : pythagoras ()
+ z.H = T.ABH.pc
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
+ \tkzDrawPoints(A,...,H)
+ \tkzLabelPoints(A,...,H)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : cheops ()
+ z.C = T.ABC.pc
+ T.ABD = L.AB : gold ()
+ z.D = T.ABD.pc
+ T.ABE = L.AB : euclide ()
+ z.E = T.ABE.pc
+ T.ABF = L.AB : golden ()
+ z.F = T.ABF.pc
+ T.ABG = L.AB : divine ()
+ z.G = T.ABG.pc
+ T.ABH = L.AB : pythagoras ()
+ z.H = T.ABH.pc
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
+ \tkzDrawPoints(A,...,H)
+ \tkzLabelPoints(A,...,H)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection about_triangles (end)
+
+\subsubsection{Method point }% (fold)
+\label{ssub:method_point}
+This method is very useful. It allows you to place a point on the line under consideration.
+If |r = 0| then the point is |pa|, if |r = 1| it's |pb|.
+
+If |r = .5| the point obtained is the midpoint of the segment. |r| can be negative or greater than 1.
+
+This method exists for all objects except quadrilaterals.
+
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new (-1,-1)
+ z.B = point : new (1,1)
+ L.AB = line : new (z.A,z.B)
+ z.I = L.AB : point (0.5)
+ z.J = L.AB : point (-0.5)
+ z.K = L.AB : point (2)
+\end{tkzelements}
+\begin{tikzpicture}[gridded]
+\tkzGetNodes
+ \tkzDrawLine(J,K)
+ \tkzDrawPoints(A,B,I,J,K)
+ \tkzLabelPoints(A,B,I,J,K)
+ \end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+ \begin{tkzelements}
+ z.A = point : new (-1,-1)
+ z.B = point : new (1,1)
+ L.AB = line : new (z.A,z.B)
+ z.I = L.AB : point (0.5)
+ z.J = L.AB : point (-0.5)
+ z.K = L.AB : point (2)
+\end{tkzelements}
+\begin{tikzpicture}[gridded]
+\tkzGetNodes
+ \tkzDrawLine(J,K)
+ \tkzDrawPoints(A,B,I,J,K)
+ \tkzLabelPoints(A,B,I,J,K)
+ \end{tikzpicture}
+ \end{minipage}
+% subsubsection method_point (end)
+
+\subsubsection{Normalize} % (fold)
+\label{ssub:normalize}
+
+
+\begin{minipage}{.4\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ z.a = point: new (1, 1)
+ z.b = point: new (5, 4)
+ L.ab = line : new (z.a,z.b)
+ z.c = L.ab : normalize ()
+ \end{tkzelements}
+
+ \begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawSegments(a,b)
+ \tkzDrawCircle(a,c)
+ \tkzDrawPoints(a,b,c)
+ \tkzLabelPoints(a,b,c)
+ \end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+ z.a = point: new (1, 1)
+ z.b = point: new (5, 4)
+ L.ab = line : new (z.a,z.b)
+ z.c = L.ab : normalize ()
+\end{tkzelements}
+\hspace*{\fill}
+\begin{tikzpicture}[gridded]
+\tkzGetNodes
+\tkzDrawSegments(a,b)
+\tkzDrawCircle(a,c)
+\tkzDrawPoints(a,b,c)
+\tkzLabelPoints(a,b,c)
+\end{tikzpicture}
+\hspace*{\fill}
+\end{minipage}
+% subsubsection normalize (end)
+
+
+\subsubsection{Barycenter with a line} % (fold)
+\label{ssub:barycenter_with_a_line}
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , -1 )
+ z.B = point : new ( 4 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ z.G = L.AB : barycenter (1,2)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,G)
+ \tkzLabelPoints(A,B,G)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+ z.A = point : new ( 0 , -1 )
+ z.B = point : new ( 4 , 2 )
+ L.AB = line : new ( z.A , z.B )
+ z.G = L.AB : barycenter (1,2)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,G)
+ \tkzLabelPoints(A,B,G)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection barycenter_with_a_line (end)
+
\subsubsection{Example: new line from a defined line} % (fold)
\label{ssub:new_line_from_a_defined_line}
\begin{minipage}{0.5\textwidth}
@@ -520,6 +875,33 @@ z.a,z.b = L.ab.pa,L.ab.pb
\subsection{Apollonius circle MA/MB = k} % (fold)
\label{sub:apollonius_circle_ma_mb_k}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 6 , 0 )
+ L.AB =line: new (z.A,z.B)
+ C.apo = L.AB : apollonius (2)
+ z.O,z.C = get_points ( C.apo )
+ z.D = C.apo : antipode (z.C)
+ z.P = C.apo : point (0.30)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzFillCircle[blue!20,opacity=.2](O,C)
+ \tkzDrawCircle[blue!50!black](O,C)
+ \tkzDrawPoints(A,B,O,C,D,P)
+ \tkzLabelPoints[below right](A,B,O,C,D,P)
+ \tkzDrawSegments[orange](P,A P,B P,D B,D P,C)
+ \tkzDrawSegments[red](A,C)
+ \tkzDrawPoints(A,B)
+ \tkzLabelCircle[draw,fill=green!10,%
+ text width=3cm,text centered,left=24pt](O,D)(60)%
+ {$CA/CB=2$\\$PA/PB=2$\\$DA/DB=2$}
+ \tkzMarkRightAngle[opacity=.3,fill=lightgray](O,P,C)
+ \tkzMarkAngles[mark=||](A,P,D D,P,B)
+\end{tikzpicture}
+\end{verbatim}
+
\begin{tkzelements}
z.A = point : new ( 0 , 0 )
z.B = point : new ( 6 , 0 )
@@ -546,7 +928,7 @@ z.P = C.apo : point (0.30)
\tkzMarkAngles[mark=||](A,P,D D,P,B)
\end{tikzpicture}
-Remark: |\tkzUseLua{point.mod(z.P-z.A)/point.mod(z.P-z.B)}| = \tkzUseLua{point.mod(z.P-z.A)/point.mod(z.P-z.B)}
+Remark: |\tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}| = \tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}
% subsection apollonius_circle_ma_mb_k (end)
% subsection methods_from_class_line (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
index 017e3ae2d4..d0867da269 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
@@ -5,7 +5,7 @@
\bgroup
\catcode`_=12
\small
-\captionof{table}{Math constants and functions.}
+\captionof{table}{Math constants and functions.}\label{misc}
\begin{tabular}{ll}
\toprule
\textbf{contants or functions} & \textbf{Comments}\\
@@ -17,21 +17,31 @@
%tkzround( num, idp ) & \\
% Cramer33(a1,a2,a3,b1,b2,b3,c1,c2,c3) & \\
% Cramer22(a1,a2,b1,b2) & \\
+\Igfct{math}{length (a,b) } & point.abs(a-b) See (\ref{ssub:report_de_distance}) \\
\Igfct{math}{islinear (z1,z2,z3) } & Are the points aligned? (z2-z1) $\parallel$ (z3-z1) ? \\
\Igfct{math}{isortho (z1,z2,z3)} & (z2-z1) $\perp$ (z3-z1) ? boolean\\
+\Igfct{math}{get\_angle (z1,z2,z3)} & the vertex is z1 See (\ref{sub:get_angle}) \\
+\Igfct{math}{bisector (z1,z2,z3)} & L.Aa = bisector (z.A,z.B,z.C) from A (\ref{sub:get_angle})\\
+\Igfct{math}{bisector\_ext (z1,z2,z3)} & L.Aa = bisector_ext (z.A,z.B,z.C) from A \\
+\Igfct{math}{altitude (z1,z2,z3)} & altitude from z1 \\
\Igfct{package}{set\_lua\_to\_tex (list)} & set\_lua\_to\_tex('a','n') defines |\a| and |\n| \\
\Igfct{package}{tkzUseLua (variable)} & |\textbackslash\tkzUseLua{a}| prints the value of a\\
%parabola (a,b,c) & to get \\
\Igfct{math}{value (v) } & apply |scale * value | \\
\Igfct{math}{real (v) } & apply | value /scale | \\
-\Igfct{math}{angle\_normalize (a) } & to get a value between 0 and $2\pi$ \\
-\Igfct{misc}{radical\_center (C1,C2,C3)} & see \ref{sub:radical_center} \\
-\Igfct{misc}{radical\_circle (C1,C2,C3)} & see \ref{sub:radical_circle} \\
+\Igfct{math}{angle\_normalize (an) } & to get a value between 0 and $2\pi$ \\
\Igfct{misc}{barycenter (\{z1,n1\},\{z2,n2\}, ...)} & barycenter of list of points \\
\bottomrule
\end{tabular}
\egroup
+\subsection{Length of a segment} % (fold)
+\label{sub:length_of_a_segment}
+|length(z.A,z.B)| is a shortcut for |point.abs(z.A-z.B)|. This avoids the need to use complexes.
+
+% subsection length_of_a_segment (end)
+
+
\subsection{Harmonic division with tkzphi } % (fold)
\label{sub:harmonic_division_with_tkzphi}
\begin{tkzexample}[latex=0cm,small,code only]
@@ -111,7 +121,7 @@
% subsection function_islinear (end)
-\subsection{Function \tkzfname{value} }% (fold)
+\subsection{Function value }% (fold)
\label{sub:function_value}
value to apply scaling if necessary
@@ -120,7 +130,7 @@ If |scale = 1.2| with a = value(5) the actual value of |a| will be $5\times 1.2
% subsubsection function_value (end)
-\subsubsection{Function \tkzfname{real} }% (fold)
+\subsubsection{Function real }% (fold)
\label{ssub:function_real}
If |scale = 1.2| with a = 6 then real(a) = $6 / 1.2 = 5$ .
@@ -135,44 +145,44 @@ It's possible to transfer variable from Lua to \TEX{} with
\begin{minipage}{.5\textwidth}
- \begin{verbatim}
- \begin{tkzelements}
- z.A = point : new (0 , 0)
- z.B = point : new (4 , 3)
- z.C = point : new (2 , 5)
- L.AB = line : new (z.A,z.B)
- d = L.AB : distance (z.C)
- l = L.AB.length
- z.H = L.AB : projection (z.C)
- \end{tkzelements}
- % possible here \tkzUseLua{L.AB.length}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines(A,B C,H)
- \tkzDrawPoints(A,B,C,H)
- \tkzLabelPoints(A,B,C,H)
- \tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
- \tkzLabelSegment[below left,draw](C,H){$AB = \tkzUseLua{l}$}
- \end{tikzpicture}
- \end{verbatim}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new (0 , 0)
+ z.B = point : new (3 , 2)
+ z.C = point : new (2 , 5)
+ L.AB = line : new (z.A,z.B)
+ d = L.AB : distance (z.C)
+ l = L.AB.length
+ z.H = L.AB : projection (z.C)
+\end{tkzelements}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B C,H)
+\tkzDrawPoints(A,B,C,H)
+\tkzLabelPoints(A,B,C,H)
+\tkzLabelSegment[above right,draw](C,H){$CH = \tkzUseLua{d}$}
+\tkzLabelSegment[below right,draw](A,B){$AB = \tkzUseLua{l}$}
+\end{tikzpicture}
+\end{verbatim}
\end{minipage}
\begin{minipage}{.5\textwidth}
\begin{tkzelements}
z.A = point : new (0 , 0)
- z.B = point : new (4 , 3)
+ z.B = point : new (3 , 2)
z.C = point : new (2 , 5)
L.AB = line : new (z.A,z.B)
d = L.AB : distance (z.C)
l = L.AB.length
z.H = L.AB : projection (z.C)
\end{tkzelements}
+ \hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawLines(A,B C,H)
\tkzDrawPoints(A,B,C,H)
\tkzLabelPoints(A,B,C,H)
-\tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
-\tkzLabelSegment[below left,draw](C,H){$AB = \tkzUseLua{l}$}
+\tkzLabelSegment[above right,draw](C,H){$CH = \tkzUseLua{d}$}
+\tkzLabelSegment[below right,draw](A,B){$AB = \tkzUseLua{l}$}
\end{tikzpicture}
\end{minipage}
% subsection transfer_from_lua_to_tex (end)
@@ -280,7 +290,6 @@ The function |get_angle (a,b,c)| gives the angle normalized of $(\overrightarro
\end{tikzpicture}
\hspace*{\fill}
\end{minipage}
-
% subsection get_angle (end)
\subsection{Dot or scalar product} % (fold)
@@ -343,59 +352,71 @@ With the functions |islinear| and |isortho|. |islinear(z.a,z.b,z.c)| gives |true
|isortho(z.a,z.b,z.c)| gives |true| if the line $(ab)$ is orthogonal to the line $(ac)$.
% subsection alignment_or_orthogonality (end)
+\subsection{Bisector and altitude} % (fold)
+\label{sub:bisector_and_altitude}
+These functions are useful if you don't need to create a useful triangle object for the rest of your code.
+
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+\begin{tkzelements}
+ z.a = point: new (0, 0)
+ z.b = point: new (5, -2)
+ z.c = point: new (2, 3)
+ z.i = bisector (z.a,z.c,z.b).pb
+ z.h = altitude (z.b,z.a,z.c).pb
+ angic = tkzround ( get_angle (z.a,z.i,z.c),2)
+ angci = tkzround ( get_angle (z.a,z.b,z.i),2)
+ z.e = bisector_ext (z.a,z.b,z.c).pb
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(a,b,c)
+ \tkzDrawSegments(a,i b,h a,e)
+ \tkzDrawPoints(a,b,c,i,h)
+ \tkzLabelPoints(a,b)
+ \tkzLabelPoints[above](c,i,h)
+ \tkzMarkAngle[->](i,a,c)
+ \tkzLabelAngle[font=\tiny,pos=.75](i,a,c){\tkzUseLua{angci}}
+ \tkzMarkAngle[<-](b,a,i)
+ \tkzLabelAngle[font=\tiny,pos=.75](b,a,i){\tkzUseLua{angic}}
+\end{tikzpicture}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tkzelements}
+ z.a = point: new (0, 0)
+ z.b = point: new (5, -2)
+ z.c = point: new (2, 3)
+ z.i = bisector (z.a,z.c,z.b).pb
+ z.h = altitude (z.b,z.a,z.c).pb
+ angic = tkzround ( get_angle (z.a,z.i,z.c),2)
+ angci = tkzround ( get_angle (z.a,z.b,z.i),2)
+ z.e = bisector_ext (z.a,z.b,z.c).pb
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(a,b,c)
+ \tkzDrawSegments(a,i b,h a,e)
+ \tkzDrawPoints(a,b,c,i,h)
+ \tkzLabelPoints(a,b)
+ \tkzLabelPoints[above](c,i,h)
+ \tkzMarkAngle[->](i,a,c)
+ \tkzLabelAngle[font=\tiny,pos=.75](i,a,c){\tkzUseLua{angci}}
+ \tkzMarkAngle[<-](b,a,i)
+ \tkzLabelAngle[font=\tiny,pos=.75](b,a,i){\tkzUseLua{angic}}
+\end{tikzpicture}
+\end{minipage}
+% subsection bisector_and_altitude (end)
+
\subsection{Other functions} % (fold)
\label{sub:other_functions}
Not documented because still in beta version: |parabola|, |Cramer22|, |Cramer33|.
% subsection other_functions (end)
-
% section math_functions (end)
-% % section classes_and_objects (end)
-\endinput
-
-
+\endinput
-% \bgroup
-% \catcode`_=12
-% \begin{table}[H]
-% \small
-% \begin{center}
-% \caption{functions\_polygons.lua }
-% \begin{tabular}{lll}
-% \toprule
-% \textbf{Functions} & \textbf{Comments}\\
-% \midrule
-% function square (a,b) \\
-% function parallelogram (a,b,c) \\
-% \bottomrule
-% \end{tabular}
-% \end{center}
-% \end{table}
-% \egroup
-
-
-% \bgroup
-% \catcode`_=12
-% \begin{table}[H]
-% \small
-% \begin{center}
-% \caption{elements\_vectors.lua }
-% \begin{tabular}{lll}
-% \toprule
-% \textbf{Methods} & \textbf{Comments}\\
-% \midrule
-% vector = {} class vector \\
-% \Imeth{vector}{function vector: new (z1,z2)} & st, ed \\
-% \Imeth{vector}{function vector: normalize ()} &\\
-% \bottomrule
-% \end{tabular}
-% \end{center}
-% \end{table}
-% \egroup
-
-
-
-
-\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
index 2b4a165a28..e818cdece0 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
@@ -14,7 +14,7 @@ Creation | P.new = parallelogram : new (z.A,z.B,z.C,z.D)|
\bgroup
\catcode`_=12
\small
-\captionof{table}{Parallelogram attributes.}
+\captionof{table}{Parallelogram attributes.}\label{parallelogram:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} & \\
@@ -93,7 +93,7 @@ z.I = P.new.center
\bgroup
\catcode`_=12
\small
-\captionof{table}{Parallelogram methods.}
+\captionof{table}{Parallelogram methods.}\label{parallelogram:met}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Comments} \\
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
index ef9ddbfc76..45f7991c92 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
@@ -97,15 +97,15 @@ This is the creation of a fixed point with coordinates 1 and 2 and which is name
\bgroup
\small
\catcode`_=12
-\captionof{table}{Point attributes.}
+\captionof{table}{Point attributes.}\label{point:att}
\begin{tabular}{lll}
\toprule
-\textbf{Attributes} & \textbf{Application}\\
-\Iattr{point}{re} & |z.A.re| &\tkzar |z.A = point:new (1,2) x = z.A.re|=1\\
-\Iattr{point}{im} & |z.A.im| &\tkzar |z.A = point:new (1,2) y= z.A.im|=2\\
-\Iattr{point}{type} & |z.A.type| &\tkzar |z.A.type = 'point'|\\
-\Iattr{point}{argument} & |z.A.argument| &\tkzar |z.A.argument $\approx$ 0.78539816339745|\\
-\Iattr{point}{module} & |z.A.module| &\tkzar |z.A.module| $\approx$ |2.2360...| =$\sqrt{5}$\\
+\textbf{Attributes} & \textbf{Application}& \textbf{Example}\\
+\Iattr{point}{re} & |z.A.re = 1| & see (\ref{ssub:methods}) \\
+\Iattr{point}{im} & |z.A.im = 2| &see (\ref{ssub:methods}) \\
+\Iattr{point}{type} & |z.A.type = 'point| & \\
+\Iattr{point}{argument} & |z.A.argument $\approx$ 0.78539816339745| & see (\ref{ssub:example_point_attributes})\\
+\Iattr{point}{module} & |z.A.module| $\approx$ |2.2360...| =$\sqrt{5}$ & see (\ref{ssub:example_point_attributes})\\
\bottomrule
\end{tabular}
\egroup
@@ -126,13 +126,13 @@ This is the creation of a fixed point with coordinates 1 and 2 and which is name
\end{tkzelements}
\end{verbatim}
\pgfkeys{/pgf/number format/.cd,std,precision=2}
-\let\pmpn\pgfmathprintnumber
+\let\pmpn\pgfmathprintnumber
\DeleteShortVerb{\|}
\begin{verbatim}
\begin{tikzpicture}[scale = 1]
\pgfkeys{/pgf/number format/.cd,std,precision=2}
-\let\pmpn\pgfmathprintnumber
+\let\pmpn\pgfmathprintnumber
\tkzDefPoints{2/4/M,2/0/A,0/0/O,0/4/B}
\tkzLabelPoints(O)
\tkzMarkAngle[fill=gray!30,size=1](A,O,M)
@@ -154,7 +154,7 @@ $|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm}
\begin{center}
\begin{tikzpicture}
\pgfkeys{/pgf/number format/.cd,std,precision=2}
- \let\pmpn\pgfmathprintnumber
+ \let\pmpn\pgfmathprintnumber
\tkzDefPoints{2/4/M,2/0/A,0/0/O,0/4/B}
\tkzLabelPoints(O)
\tkzMarkAngle[fill=gray!30,size=1](A,O,M)
@@ -172,7 +172,7 @@ $|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm}
\begin{scope}[every annotation/.style={fill=lightgray!15,anchor = east}]
\node [annotation,font =\small,text width=6cm] at (current bounding box.west) {
Attributes of \texttt{z.M}
- \begin{itemize}
+ \begin{itemize}
\item \texttt{z.M.re} = 1
\item \texttt{z.M.im} = 2
\item \texttt{z.M.type} = 'point'
@@ -184,7 +184,7 @@ Attributes of \texttt{z.M}
\end{tikzpicture}
\end{center}
-\MakeShortVerb{\|}
+ \MakeShortVerb{\|}
\hspace*{\fill}
% \caption{Class Point}
% subsubsection example_point_attributes (end)
@@ -192,13 +192,13 @@ Attributes of \texttt{z.M}
\subsubsection{Argand diagram} % (fold)
\label{ssub:argand_diagram}
-\normalsize
+\normalsize
\begin{minipage}{\textwidth}
\begin{verbatim}
\begin{tkzelements}
z.A = point : new ( 2 , 3 )
- z.O = point : new ( 0 , 0 )
- z.I = point : new ( 1 , 0 )
+ z.O = point : new ( 0 , 0 )
+ z.I = point : new ( 1 , 0 )
\end{tkzelements}
\hspace{\fill}\begin{tikzpicture}
\tkzGetNodes
@@ -218,8 +218,8 @@ Attributes of \texttt{z.M}
\begin{minipage}{\textwidth}
\begin{tkzelements}
z.A = point : new ( 2 , 3 )
- z.O = point : new ( 0 , 0 )
- z.I = point : new ( 1 , 0 )
+ z.O = point : new ( 0 , 0 )
+ z.I = point : new ( 1 , 0 )
\end{tkzelements}
\hspace{\fill}\begin{tikzpicture}
\tkzGetNodes
@@ -242,53 +242,54 @@ Attributes of \texttt{z.M}
\subsection{Methods of the class point} % (fold)
\label{sub:methods_of_the_class_point}
-The methods described in the following table are standard. You'll find them in most of the examples at the end of this documentation. The result of the different methods presented in the following table is a \tkzNameObj{point}.
+The methods described in the following table are standard. You'll find them in most of the examples at the end of this documentation. The result of the different methods presented in the following table is a \tkzNameObj{point}.
\vspace{1em}
\bgroup
\catcode`_=12
\small
-\captionof{table}{Methods of the class point.}
-\begin{tabular}{lll}
-\toprule
-\textbf{Methods} & \textbf{Application}& \\
+\captionof{table}{Methods of the class point.}\label{point:met}
+\begin{tabular}{lll}
+\toprule
+\textbf{Methods} & \textbf{Application}& \\
+\midrule
+\Imeth{point}{new(r, r)} & |z.A = point : new(1,2)| & see (\ref{ssub:method_normalize}) \\
+\Imeth{point}{polar (d, an)} & |z.A = point : polar(1,math.pi/3)| & see (\ref{sub:archimedes} )\\
+\Imeth{point}{polar\_deg an} & an in deg & polar coordinates an deg \\
\midrule
- new (a,b) & |z.a = point : new(1,2)| &\tkzar affix z.a=1+2i \\
- polar (radius, phi) & |z.a = point : polar(1,math.pi/3)| &\tkzar affix $cos(\pi/3)+sin(\pi/3)i$ \\
- polar_deg (radius, phi) & phi in deg &\tkzar polar coordinates phi deg \\
-\midrule
- \textbf{Points} &&\\
-\midrule
- north(d) & see \ref{sub:power_v2} |d| distance to the point & d=1 1 if empty \\
- south(d) & \\
- east(d) & \\
- west(d) & \\
- normalize() & |z.b = z.a: normalize ()| &\tkzar |z.b| = 1 and z.a = k$\times$ z.b \\
- get_points (obj) & retrieves points from the object & \\
- \midrule
+\textbf{Points} &&\\
+\midrule
+\Imeth{point}{north(r)} & |r| distance to the point (1 if empty) & see (\ref{sub:power_v2}) ; \ref{ssub:methods}) \\
+\Imeth{point}{south(r)} & & \\
+\Imeth{point}{east(r)} & & \\
+\Imeth{point}{west(r)} & & \\
+\Imeth{point}{normalize()} & |z.b = z.a: normalize ()| & see (\ref{ssub:method_normalize}) \\
+\Imeth{point}{get\_points (obj)} & retrieves points from the object & \\
+ \midrule
\textbf{Transformations} &&\\
\midrule
- symmetry(obj) & obj : point,line,etc. &\tkzar z.a:symmetry (C.OH) \\
- rotation(angle , obj) & point,line,etc. &\tkzar rotation center a\\
- homothety(k,obj) & |z.c = z.a : homothety (2,z.b)| & \\
-\bottomrule %
+ \Imeth{point}{symmetry(obj)} & obj : point, line, etc. & see (\ref{ssub:object_symmetry}) \\
+ \Imeth{point}{rotation(an , obj)} & point, line, etc. & see (\ref{ssub:object_rotation})\\
+ \Imeth{point}{homothety(r,obj)} & |z.c = z.a : homothety (2,z.b)| & see (\ref{sub:homothety}) \\
+\bottomrule %
\end{tabular}
\egroup
\subsubsection{Example: method \Imeth{point}{north (d)} } % (fold)
\label{ssub:example_method_imeth_point_north_d}
+This function defines a point located on a vertical line passing through the given point. This function is useful if you want to report a certain distance (see the following example).
If |d| is absent then it is considered equal to 1.
\begin{minipage}{.5\textwidth}
\begin{verbatim}
\begin{tkzelements}
- z.O = point : new ( 0, 0 )
- z.A = z.O : east ()
- z.Ap = z.O : east (2) : north (2)
- z.B = z.O : north ()
- z.C = z.O : west ()
- z.D = z.O : south ()
+ z.O = point : new ( 0, 0 )
+ z.A = z.O : east ()
+ z.Ap = z.O : east (2) : north (2)
+ z.B = z.O : north ()
+ z.C = z.O : west ()
+ z.D = z.O : south ()
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
@@ -300,12 +301,12 @@ If |d| is absent then it is considered equal to 1.
\begin{minipage}{.5\textwidth}
\begin{tkzelements}
scale = 1.5
- z.O = point : new ( 0, 0 )
- z.A = z.O : east ()
+ z.O = point : new ( 0, 0 )
+ z.A = z.O : east ()
z.Ap = z.O : east (2) : north (2)
- z.B = z.O : north ()
- z.C = z.O : west ()
- z.D = z.O : south ()
+ z.B = z.O : north ()
+ z.C = z.O : west ()
+ z.D = z.O : south ()
\end{tkzelements}
\hspace{\fill}
\begin{tikzpicture}
@@ -317,8 +318,66 @@ If |d| is absent then it is considered equal to 1.
\end{minipage}
% subsubsection example_method_imeth_point_north_d (end)
+
+\subsubsection{Length transfer} % (fold)
+\label{ssub:report_de_distance}
+
+Use of |north and east| functions linked to points, to transfer lengths, see (\ref{sub:length_of_a_segment})
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 3 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : sublime ()
+ z.C = T.ABC.pc
+ z.D = z.B: north (length(z.B,z.C))
+ z.E = z.B: east (L.AB.length)
+ z.M = L.AB.mid
+ z.F = z.E : north (length(z.C,z.M))
+\end{tkzelements}
+\begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawSegments[gray,dashed](B,D B,E E,F C,M)
+ \tkzDrawPoints(A,...,F)
+ \tkzLabelPoints(A,B,E,M)
+ \tkzLabelPoints[above right](C,D,F)
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 3 , 0 )
+ L.AB = line : new ( z.A , z.B )
+ T.ABC = L.AB : sublime ()
+ z.C = T.ABC.pc
+ z.D = z.B: north (length(z.B,z.C))
+ z.E = z.B: east (L.AB.length)
+ z.M = L.AB.mid
+ z.F = z.E : north (length(z.C,z.M))
+\end{tkzelements}
+\hspace{\fill}
+\begin{tikzpicture}[gridded]
+ \tkzGetNodes
+ \tkzDrawPolygons(A,B,C)
+ \tkzDrawSegments[gray,dashed](B,D B,E E,F C,M)
+ \tkzDrawPoints(A,...,F)
+ \tkzLabelPoints(A,B,E,M)
+ \tkzLabelPoints[above right](C,D,F)
+\end{tikzpicture}
+\end{minipage}
+
+% subsubsection report_de_distance (end)
+
+
\subsubsection{Example: method \Imeth{point}{polar} } % (fold)
\label{ssub:example_polar_method}
+
+This involves defining a point using its modulus and argument.
+
\begin{minipage}{0.6\textwidth}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
@@ -327,7 +386,7 @@ If |d| is absent then it is considered equal to 1.
z.F = point: polar (3, math.pi/3)
\end{tkzelements}
\begin{tikzpicture}
- \tkzGetNodes
+ \tkzGetNodes
\tkzDrawCircle(O,A)
\tkzDrawSegments[new](O,A)
\tkzDrawSegments[purple](O,F)
@@ -345,7 +404,7 @@ If |d| is absent then it is considered equal to 1.
\end{tkzelements}
\hspace*{\fill}
\begin{tikzpicture}
-\tkzGetNodes
+\tkzGetNodes
\tkzDrawCircle(O,A)
\tkzDrawSegments[new](O,A)
\tkzDrawSegments[purple](O,F)
@@ -356,8 +415,57 @@ If |d| is absent then it is considered equal to 1.
\end{minipage}
% subsubsection example_polar_method (end)
-\subsubsection{Example: rotation of points} % (fold)
+\subsubsection{Method \Imeth{point}{normalize ()}} % (fold)
+\label{ssub:method_normalize}
+
+The result is a point located between the origin and the initial point at a distance of $1$ from the origin.
+
+\begin{minipage}{.4\textwidth}
+\begin{verbatim}
+\begin{tkzelements}
+ scale = 1.5
+ z.O = point : new (0,0)
+ z.A = point : new (1,2)
+ z.B = z.A : normalize ()
+ z.I = point : new (1,0)
+\end{tkzelements}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawSegment(O,A)
+ \tkzDrawCircle(O,B)
+ \tkzDrawPoints(O,A,B,I)
+ \tkzLabelPoints(O,A,B)
+ \tkzLabelPoint[below right](I){$1$}
+\end{tikzpicture}
+\end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
+\begin{tkzelements}
+scale = 1.5
+z.O = point : new (0,0)
+z.A = point : new (1,2)
+z.B = z.A : normalize ()
+z.I = point : new (1,0)
+\end{tkzelements}
+ \hspace*{\fill}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawSegment(O,A)
+\tkzDrawCircle(O,B)
+\tkzDrawPoints(O,A,B,I)
+\tkzLabelPoints(O,A,B)
+\tkzLabelPoint[below right](I){$1$}
+\end{tikzpicture}
+ \hspace*{\fill}
+\end{minipage}
+% subsubsection method_normalize (end)
+
+
+\subsubsection{Example: \Imeth{point}{rotation of points}} % (fold)
\label{ssub:example_rotation_of_points}
+
+The arguments are the angle of rotation in radians, and here a list of points.
+
\begin{minipage}{.6\textwidth}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
@@ -398,25 +506,25 @@ If |d| is absent then it is considered equal to 1.
\end{minipage}
% subsubsection example_rotation_of_points (end)
-\subsubsection{Object rotation} % (fold)
+\subsubsection{Object \Imeth{point}{rotation}} % (fold)
\label{ssub:object_rotation}
Rotate a triangle by an angle of $\pi/6$ around $O$.
\begin{minipage}{.5\textwidth}
\begin{verbatim}
\begin{tkzelements}
-z.O = point : new ( -1 , -1 )
-z.A = point : new ( 2 , 0 )
-z.B = point : new ( 5 , 0 )
-L.AB = line : new (z.A,z.B)
-T.ABC = L.AB : equilateral ()
-S.fig = L.AB : square ()
-_,_,z.E,z.F = get_points ( S.fig )
-S.new = z.O : rotation (math.pi/3,S.fig)
-_,_,z.Ep,z.Fp = get_points ( S.new )
-z.C = T.ABC.pc
-T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
-z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
+ z.O = point : new ( -1 , -1 )
+ z.A = point : new ( 2 , 0 )
+ z.B = point : new ( 5 , 0 )
+ L.AB = line : new (z.A,z.B)
+ T.ABC = L.AB : equilateral ()
+ S.fig = L.AB : square ()
+ _,_,z.E,z.F = get_points ( S.fig )
+ S.new = z.O : rotation (math.pi/3,S.fig)
+ _,_,z.Ep,z.Fp = get_points ( S.new )
+ z.C = T.ABC.pc
+ T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
+ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
\end{tkzelements}
\begin{tikzpicture}
@@ -430,18 +538,18 @@ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
\end{minipage}
\begin{minipage}{.5\textwidth}
\begin{tkzelements}
-z.O = point : new ( -1 , -1 )
-z.A = point : new ( 2 , 0 )
-z.B = point : new ( 5 , 0 )
+z.O = point : new ( -1 , -1 )
+z.A = point : new ( 2 , 0 )
+z.B = point : new ( 5 , 0 )
L.AB = line : new (z.A,z.B)
T.ABC = L.AB : equilateral ()
S.fig = L.AB : square ()
-_,_,z.E,z.F = get_points ( S.fig )
+_,_,z.E,z.F = get_points ( S.fig )
S.new = z.O : rotation (math.pi/3,S.fig)
-_,_,z.Ep,z.Fp = get_points ( S.new )
+_,_,z.Ep,z.Fp = get_points ( S.new )
z.C = T.ABC.pc
T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
-z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
+z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
\end{tkzelements}
\hspace{\fill}\begin{tikzpicture}
@@ -453,12 +561,12 @@ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
\tkzDrawArc[delta=0,->,dashed,red](O,A)(A')
\tkzDrawSegments[dashed,red](O,A O,A')
\end{scope}
-
+
\end{tikzpicture}
\end{minipage}
% subsubsection object_rotation (end)
-\subsubsection{Object symmetry} % (fold)
+\subsubsection{Object \Imeth{point}{symmetry}} % (fold)
\label{ssub:object_symmetry}
\begin{minipage}{.5\textwidth}
\begin{verbatim}
@@ -470,7 +578,7 @@ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
z.o = point: new(1,1)
z.ap,z.bp = get_points (z.o: symmetry (C.ab))
\end{tkzelements}
-
+
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(a,b a',b')
@@ -490,7 +598,7 @@ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
z.o = point: new(1, 1)
z.ap,z.bp = get_points (z.o: symmetry (C.ab))
\end{tkzelements}
-
+
\hspace{\fill}\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(a,b a',b')
@@ -502,5 +610,6 @@ z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
\end{minipage}
% subsubsection object_symmetry (end)
% subsection methods_of_the_class_point (end)
+
% section class_point (end)
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
index 2171337792..8b777de57b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
@@ -13,7 +13,7 @@ Creation | Q.new = rectangle : new (z.A,z.B,z.C,z.D)|
\bgroup
\catcode`_=12
\small
-\captionof{table}{rectangle attributes.}
+\captionof{table}{rectangle attributes.}\label{quadrilateral:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} & \\
@@ -88,7 +88,7 @@ z.G = Q.ABCD.g
\bgroup
\catcode`_=12
\small
-\captionof{table}{Quadrilateral methods.}
+\captionof{table}{Quadrilateral methods.}\label{quadrilateral:met}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Comments} \\
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
index 418278a99f..8b591cc61e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-rectangle.tex
@@ -14,7 +14,7 @@ Creation | R.ABCD = rectangle : new (z.A,z.B,z.C,z.D)|
\bgroup
\catcode`_=12
\small
-\captionof{table}{rectangle attributes.}
+\captionof{table}{rectangle attributes.}\label{rectangle:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} & \\
@@ -95,7 +95,7 @@ z.I = R.new.center
\bgroup
\catcode`_=12
\small
-\captionof{table}{Rectangle methods.}
+\captionof{table}{Rectangle methods.}\label{rectangle:met}
\begin{tabular}{lll}
\toprule
\textbf{Methods} & \textbf{Comments} & \\
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
index 4a25afdfe5..6460af030d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
@@ -11,20 +11,20 @@ Creation | RP.IA = regular_polygon : new (z.I,z.A,6)|
\bgroup
\catcode`_=12
\small
-\captionof{table}{Regular\_polygon attributes.}
+\captionof{table}{Regular\_polygon attributes.}\label{regular:att}
\begin{tabular}{ll}
\toprule
-\textbf{Attributes} & \textbf{Application} \\
-\Iattr{square}{center} & |z.I = RP.IA.center| \\
-\Iattr{square}{table} & array containing all vertex affixes \\
-\Iattr{square}{through} & first vertex \\
-\Iattr{square}{circle} & defines the circle with center I passing through A \\
-\Iattr{square}{type} & |RP.IA.type= 'regular\_polygon'| \\
-\Iattr{square}{side} & |s = RP.IA.side| ; s = length of side\\
-\Iattr{square}{exradius}& |S.AB.exradius| ; radius of the circumscribed circle \\
-\Iattr{square}{inradius}& |S.AB.inxradius| ; radius of the inscribed circle \\
-\Iattr{square}{proj} & |RP.IA.proj| ; projection of the center on one side \\
-\Iattr{square}{angle} & |RP.IA.angle| ; angle formed by the center and 2 consecutive vertices \\
+\textbf{Attributes} & \textbf{Application} \\
+\Iattr{regular}{center} & |z.I = RP.IA.center| \\
+\Iattr{regular}{table} & array containing all vertex affixes \\
+\Iattr{regular}{through} & first vertex \\
+\Iattr{regular}{circle} & defines the circle with center I passing through A \\
+\Iattr{regular}{type} & |RP.IA.type= 'regular\_polygon'| \\
+\Iattr{regular}{side} & |s = RP.IA.side| ; s = length of side\\
+\Iattr{regular}{exradius}& |S.AB.exradius| ; radius of the circumscribed circle \\
+\Iattr{regular}{inradius}& |S.AB.inxradius| ; radius of the inscribed circle \\
+\Iattr{regular}{proj} & |RP.IA.proj| ; projection of the center on one side \\
+\Iattr{regular}{angle} & |RP.IA.angle| ; angle formed by the center and 2 consecutive vertices \\
\bottomrule %
\end{tabular}
\egroup
@@ -81,7 +81,7 @@ z.H = RP.five.proj
\bgroup
\catcode`_=12
\small
-\captionof{table}{Circle methods.}
+\captionof{table}{Circle methods.}\label{regular:met}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Comments} \\
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
index 15996c203f..fae6d71b2b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
@@ -13,7 +13,7 @@ Creation | S.AB = square : new (z.A,z.B,z.C,z.D)|
\bgroup
\catcode`_=12
\small
-\captionof{table}{Square attributes.}
+\captionof{table}{Square attributes.}\label{square:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes} & \textbf{Application} & \\
@@ -98,7 +98,7 @@ z.H = S.new.proj
\bgroup
\catcode`_=12
\small
-\captionof{table}{Square methods.}
+\captionof{table}{Square methods.}\label{square:met}
\begin{tabular}{lll}
\toprule
\textbf{Methods} & \textbf{Comments}& \\
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
index 9c6e822704..a65899c0ef 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
@@ -13,7 +13,7 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\bgroup
\catcode`_=12
\small
-\captionof{table}{Triangle attributes.}
+\captionof{table}{Triangle attributes.}\label{triangle:att}
\begin{tabular}{ll}
\toprule
\textbf{Attributes} & \textbf{Application}\\
@@ -114,7 +114,7 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\catcode`_=12
\small
\begin{minipage}{\textwidth}
-\captionof{table}{triangle methods.}
+\captionof{table}{triangle methods.}\label{triangle:met}
\begin{tabular}{ll}
\toprule
\textbf{Methods} & \textbf{Comments} \\
@@ -154,6 +154,10 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\end{minipage}
\egroup
+Remark: If you don't need to use the triangle object several times, you can obtain a bisector or a altitude with the next functions
+
+|bisector (z.A,z.B,z.C)| and |altitude (z.A,z.B,z.C)| See (\ref{misc})
+
\clearpage\newpage
\bgroup
\catcode`_=12
@@ -210,6 +214,7 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
\subsubsection{Euler line} % (fold)
\label{ssub:euler_line}
+\begin{minipage}{.5\textwidth}
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
z.A = point: new (0 , 0)
@@ -229,16 +234,16 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
\tkzDrawCircle[red](N,I)
\tkzDrawCircles[teal](O,A)
\tkzDrawSegments(A,P B,Q C,R)
- \tkzDrawSegments[red](A,I B,J C,K)
+ \tkzDrawSegments[red](A,I B,J C,K)\include{TKZdoc-elements-classes-triangle.tex}
\tkzDrawPolygons(A,B,C)
\tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G)
\tkzLabelPoints(A,B,C,I,J,K,P,Q,R,H)
\tkzLabelPoints[below](N,O,G)
\end{tikzpicture}
\end{tkzexample}
-
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\begin{tkzelements}
- scale =1
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
z.C = point: new (1.5 , 3.5)
@@ -250,7 +255,6 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
z.P,z.Q,z.R = get_points (T.ABC: orthic())
z.K,z.I,z.J = get_points (T.ABC: medial ())
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
@@ -264,54 +268,41 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
\tkzLabelPoints(A,B,C,I,J,K,P,Q,R)
\tkzLabelPoints[below](N,O,G,H)
\end{tikzpicture}
-\hspace*{\fill}
+\end{minipage}
+
%\caption{Euler line}
% subsubsection euler_line (end)
\subsection{Harmonic division and bisector} % (fold)
\label{sub:harmonic_division_and_bisector}
-\begin{tkzexample}[small,code only]
-\begin{tkzelements}
- scale = .75
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.M = point: new (5 , 4)
- T.AMB = triangle : new (z.A,z.M,z.B)
- L.AB = T.AMB.ca
- L.bis = T.AMB : bisector (1)
- z.C = L.bis.pb
- L.bisext = T.AMB : bisector_ext (1)
- z.D = intersection (L.bisext,L.AB)
- L.CD = line: new (z.C,z.D)
- z.O = L.CD.mid
- L.AM = line: new (z.A,z.M)
- L.LL = L.AM : ll_from (z.B)
- L.MC = line: new (z.M,z.C)
- L.MD = line: new (z.M,z.D)
- z.E = intersection (L.LL,L.MC)
- z.F = intersection (L.LL,L.MD)
-\end{tkzelements}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawPolygon(A,B,M)
- \tkzDrawCircle[purple](O,C)
- \tkzDrawSegments[purple](M,E M,D E,F)
- \tkzDrawSegments(D,B)
- \tkzDrawPoints(A,B,M,C,D,E,F)
- \tkzLabelPoints[below right](A,B,C,D,E)
- \tkzLabelPoints[above](M,F)
- \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
- \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
- \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
- \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
- \tkzMarkAngles[mark=|](B,M,F M,F,B)
- \tkzMarkSegments(B,E B,M B,F)
-\end{tikzpicture}
-\end{tkzexample}
-
+\begin{minipage}{.4\textwidth}
+ \begin{verbatim}
+ \begin{tkzelements}
+ scale = .4
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.M = point: new (5 , 4)
+ T.AMB = triangle : new (z.A,z.M,z.B)
+ L.AB = T.AMB.ca
+ L.bis = T.AMB : bisector (1)
+ z.C = L.bis.pb
+ L.bisext = T.AMB : bisector_ext (1)
+ z.D = intersection (L.bisext,L.AB)
+ L.CD = line: new (z.C,z.D)
+ z.O = L.CD.mid
+ L.AM = line: new (z.A,z.M)
+ L.LL = L.AM : ll_from (z.B)
+ L.MC = line: new (z.M,z.C)
+ L.MD = line: new (z.M,z.D)
+ z.E = intersection (L.LL,L.MC)
+ z.F = intersection (L.LL,L.MD)
+ \end{tkzelements}
+ \end{verbatim}
+\end{minipage}
+\begin{minipage}{.6\textwidth}
\begin{tkzelements}
- scale =.75
+ scale =.4
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
z.M = point: new (5 , 4)
@@ -330,9 +321,7 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
z.E = intersection (L.LL,L.MC)
z.F = intersection (L.LL,L.MD)
\end{tkzelements}
-
-
-\hspace*{\fill}
+\hspace{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygon(A,B,M)
@@ -349,7 +338,28 @@ Through the Lemoine point draw lines parallel to the triangle's sides. The point
\tkzMarkAngles[mark=|](B,M,F M,F,B)
\tkzMarkSegments(B,E B,M B,F)
\end{tikzpicture}
-\hspace*{\fill}
+\end{minipage}
+
+\begin{verbatim}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,M)
+ \tkzDrawCircle[purple](O,C)
+ \tkzDrawSegments[purple](M,E M,D E,F)
+ \tkzDrawSegments(D,B)
+ \tkzDrawPoints(A,B,M,C,D,E,F)
+ \tkzLabelPoints[below right](A,B,C,D,E)
+ \tkzLabelPoints[above](M,F)
+ \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M)
+ \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B)
+ \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
+ \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M)
+ \tkzMarkAngles[mark=|](B,M,F M,F,B)
+ \tkzMarkSegments(B,E B,M B,F)
+\end{tikzpicture}
+\end{verbatim}
+
+
% subsection harmonic_division_and_bisector (end)
% subsection methods_of_the_class_triangle (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
index e993ce9abe..5e4376b879 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex
@@ -49,7 +49,6 @@ Example: The point object is used to vertically determine a new point object l
\end{tkzelements}
\end{verbatim}
-
\begin{tkzelements}
z.A = point (1,0)
z.B = z.A : north (2)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
index baaebd5d71..9e79877299 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
@@ -321,10 +321,8 @@ scale=.75
\tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D)
\end{tikzpicture}
\hspace*{\fill}
+% subsection apollonius_and_circle_circumscribed (end)
-
-%subsection apollonius_and_circle_circumscribed (end)
-%
\subsection{Apollonius circles in a triangle} % (fold)
\label{sub:apollonius_circles}
@@ -415,6 +413,26 @@ z.O3 = L.Bpt.mid
\tkzDrawLine(O1,O2)
\end{tikzpicture}
\hspace*{\fill}
+
+Same result using the function |T.ABC.ab : apollonius (k) |
+
+\begin{verbatim}
+ \begin{tkzelements}
+ scale = .75
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.C = point: new (4.5 , 1)
+ T.ABC = triangle : new (z.A,z.B,z.C)
+ z.O = T.ABC.circumcenter
+ C.AB = T.ABC.ab : apollonius (length(z.C,z.A)/length(z.C,z.B))
+ z.w1,z.t1 = get_points ( C.AB )
+ C.AC = T.ABC.ca : apollonius (length(z.B,z.C)/length(z.B,z.A))
+ z.w2,z.t2 = get_points ( C.AC )
+ C.AC = T.ABC.bc : apollonius (length(z.A,z.B)/length(z.A,z.C))
+ z.w3,z.t3 = get_points ( C.AC )
+ \end{tkzelements}
+\end{verbatim}
+
% subsection apollonius_circles (end)
\subsection{Archimedes} % (fold)
@@ -471,8 +489,9 @@ z.O3 = L.Bpt.mid
\tkzLabelPoints(A,O_1,O_2,E,F,C,D)
\end{tikzpicture}
\end{minipage}
-%\subsection{Bankoff circle} % (fold)
+% subsection archimedes (end)
+\subsection{Bankoff circle} % (fold)
\label{sub:bankoff_circle}
\begin{tkzexample}[small,code only]
\begin{tkzelements}
@@ -1722,32 +1741,33 @@ z.H = L.XY : projection (z.M)
\begin{tkzexample}[latex=0cm,small,code only]
\begin{tkzelements}
- z.O = point : new (-1,0)
- z.Op = point : new (4,-1)
- z.B = point : new (0,2)
- z.D = point : new (4,0)
- C.OB = circle : new (z.O,z.B)
- C.OpD = circle : new (z.Op,z.D)
- L.EF = C.OB : radical_axis (C.OpD)
- z.E,z.F = get_points (L.EF)
- z.M = L.EF : point (2)
- L.MT,L.MTp = C.OB : tangent_from (z.M)
- _,z.T = get_points (L.MT)
- _,z.Tp = get_points (L.MTp)
- L.MK,L.MKp = C.OpD : tangent_from (z.M)
- _,z.K = get_points (L.MK)
- _,z.Kp = get_points (L.MKp)
+scale = 1.25
+z.O = point : new (-1,0)
+z.Op = point : new (4,-1)
+z.B = point : new (0,2)
+z.D = point : new (4,0)
+C.OB = circle : new (z.O,z.B)
+C.OpD = circle : new (z.Op,z.D)
+L.EF = C.OB : radical_axis (C.OpD)
+z.E,z.F = get_points (L.EF)
+z.M = L.EF : point (.75)
+L.MT,L.MTp = C.OB : tangent_from (z.M)
+_,z.T = get_points (L.MT)
+_,z.Tp = get_points (L.MTp)
+L.MK,L.MKp = C.OpD : tangent_from (z.M)
+_,z.K = get_points (L.MK)
+_,z.Kp = get_points (L.MKp)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',D)
- \tkzDrawLine[add=1 and 2](E,F)
+ \tkzDrawLine(E,F)
\tkzDrawLine[add=.5 and .5](O,O')
- \tkzDrawSegments(M,T M,T' M,K M,K')
+ \tkzDrawLines[add = 0 and .5](M,T M,T' M,K M,K')
\tkzDrawCircle(M,T)
\tkzDrawPoints(O,O',T,M,T',K,K')
\tkzLabelPoints(O,O',T,T',K,K',M)
- \end{tikzpicture}
+\end{tikzpicture}
\end{tkzexample}
\begin{tkzelements}
@@ -1760,7 +1780,7 @@ C.OB = circle : new (z.O,z.B)
C.OpD = circle : new (z.Op,z.D)
L.EF = C.OB : radical_axis (C.OpD)
z.E,z.F = get_points (L.EF)
-z.M = L.EF : point (2)
+z.M = L.EF : point (.75)
L.MT,L.MTp = C.OB : tangent_from (z.M)
_,z.T = get_points (L.MT)
_,z.Tp = get_points (L.MTp)
@@ -1768,43 +1788,43 @@ L.MK,L.MKp = C.OpD : tangent_from (z.M)
_,z.K = get_points (L.MK)
_,z.Kp = get_points (L.MKp)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',D)
-\tkzDrawLine[add=1 and 2](E,F)
+\tkzDrawLine(E,F)
\tkzDrawLine[add=.5 and .5](O,O')
-\tkzDrawSegments(M,T M,T' M,K M,K')
+\tkzDrawLines[add = 0 and .5](M,T M,T' M,K M,K')
\tkzDrawCircle(M,T)
\tkzDrawPoints(O,O',T,M,T',K,K')
\tkzLabelPoints(O,O',T,T',K,K',M)
-\end{tikzpicture}\hspace*{\fill}
+\end{tikzpicture}
+\hspace*{\fill}
% subsection radical_axis_v2 (end)
\subsection{Radical axis v3} % (fold)
\label{sub:radical_axis_v3}
\begin{tkzexample}[latex=0cm,small,code only]
-\begin{tkzelements}
- z.O = point : new (0,0)
- z.B = point : new (4,0)
- z.Op = point : new (6,0)
- C.OB = circle : new (z.O,z.B)
- C.OpB = circle : new (z.Op,z.B)
- L.EF = C.OB : radical_axis (C.OpB)
- z.E,z.F = get_points(L.EF)
- z.M = L.EF : point (2)
- _,L = C.OB : tangent_from (z.M)
- _,z.T = get_points (L)
- L,_ = C.OpB : tangent_from (z.M)
- _,z.Tp = get_points (L)
+ \begin{tkzelements}
+ z.O = point : new (0,0)
+ z.B = point : new (4,0)
+ z.Op = point : new (6,0)
+ C.OB = circle : new (z.O,z.B)
+ C.OpB = circle : new (z.Op,z.B)
+ L.EF = C.OB : radical_axis (C.OpB)
+ z.E,z.F = get_points(L.EF)
+ z.M = L.EF : point (0.2)
+ L = C.OB : tangent_from (z.M)
+ _,z.T = get_points (L)
+ L = C.OpB : tangent_from (z.M)
+ _,z.Tp = get_points (L)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',B)
\tkzDrawSegments(M,T M,T')
- \tkzDrawLine[add=.5 and 1](E,F)
+ \tkzDrawSegments(E,F)
\tkzDrawLine[add=.5 and .5](O,O')
\tkzDrawPoints(O,B,O',E,F,M,T,T')
\tkzLabelPoints(O,O',B,E,F,T,T')
@@ -1813,27 +1833,25 @@ _,z.Kp = get_points (L.MKp)
\end{tkzexample}
\begin{tkzelements}
-z.O = point : new (0,0)
-z.B = point : new (4,0)
-z.Op = point : new (6,0)
-C.OB = circle : new (z.O,z.B)
-C.OpB = circle : new (z.Op,z.B)
-L.EF = C.OB : radical_axis (C.OpB)
-z.E,z.F = get_points(L.EF)
-z.M = L.EF : point (2)
-_,L = C.OB : tangent_from (z.M)
-_,z.T = get_points (L)
-L,_ = C.OpB : tangent_from (z.M)
-_,z.Tp = get_points (L)
+z.O = point : new (0,0)
+z.B = point : new (4,0)
+z.Op = point : new (6,0)
+C.OB = circle : new (z.O,z.B)
+C.OpB = circle : new (z.Op,z.B)
+L.EF = C.OB : radical_axis (C.OpB)
+z.E,z.F = get_points(L.EF)
+z.M = L.EF : point (0.2)
+L = C.OB : tangent_from (z.M)
+_,z.T = get_points (L)
+L = C.OpB : tangent_from (z.M)
+_,z.Tp = get_points (L)
\end{tkzelements}
-
-
\hspace*{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',B)
\tkzDrawSegments(M,T M,T')
-\tkzDrawLine[add=.5 and 1](E,F)
+\tkzDrawSegments(E,F)
\tkzDrawLine[add=.5 and .5](O,O')
\tkzDrawPoints(O,B,O',E,F,M,T,T')
\tkzLabelPoints(O,O',B,E,F,T,T')
@@ -1853,21 +1871,22 @@ _,z.Tp = get_points (L)
C.OpB = circle : new (z.Op,z.B)
L.EF = C.OB : radical_axis (C.OpB)
z.E,z.F = get_points(L.EF)
- z.M = L.EF : point (1.5)
- L,_ = C.OB : tangent_from (z.M)
+ z.H = L.EF.mid
+ z.M = L.EF : point (.8)
+ _,L = C.OB : tangent_from (z.M)
_,z.T = get_points (L)
- L,_ = C.OpB : tangent_from (z.M)
+ _,L = C.OpB : tangent_from (z.M)
_,z.Tp = get_points (L)
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',B)
\tkzDrawSegments(M,T M,T')
- \tkzDrawLine[add=1 and 1](E,F)
- \tkzDrawLine[add=.3 and .3](O,O')
- \tkzDrawPoints(O,O',B,E,F,T,T',M)
- \tkzLabelPoints[below right](O,O',B,E,F,T,T')
- \tkzDrawArc(M,T)(B)
+ \tkzDrawSegments(E,F)
+ \tkzDrawLine[add=.3 and .3](O,H)
+ \tkzDrawPoints(O,O',B,E,H,M)
+ \tkzLabelPoints[below right](O,O',E,F,M,T,T')
+ \tkzDrawArc(M,B)(T)
\end{tikzpicture}
\end{tkzexample}
@@ -1880,23 +1899,23 @@ _,z.Tp = get_points (L)
C.OpB = circle : new (z.Op,z.B)
L.EF = C.OB : radical_axis (C.OpB)
z.E,z.F = get_points(L.EF)
- z.M = L.EF : point (1.5)
- L,_ = C.OB : tangent_from (z.M)
+ z.H = L.EF.mid
+ z.M = L.EF : point (.8)
+ _,L = C.OB : tangent_from (z.M)
_,z.T = get_points (L)
- L,_ = C.OpB : tangent_from (z.M)
+ _,L = C.OpB : tangent_from (z.M)
_,z.Tp = get_points (L)
\end{tkzelements}
-
\hspace*{\fill}
\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawCircles(O,B O',B)
-\tkzDrawSegments(M,T M,T')
-\tkzDrawLine[add=1 and 1](E,F)
-\tkzDrawLine[add=.3 and .3](O,O')
-\tkzDrawPoints(O,O',B,E,F,T,T',M)
-\tkzLabelPoints[below right](O,O',B,E,F,T,T')
-\tkzDrawArc(M,T)(B)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',B)
+ \tkzDrawSegments(M,T M,T')
+ \tkzDrawSegments(E,F)
+ \tkzDrawLine[add=.3 and .3](O,H)
+ \tkzDrawPoints(O,O',B,E,H,M)
+ \tkzLabelPoints[below right](O,O',E,F,M,T,T')
+ \tkzDrawArc(M,B)(T)
\end{tikzpicture}
\hspace*{\fill}
% subsection radical_axis_v4 (end)
@@ -1980,7 +1999,7 @@ z.H = L.OOp : projection (z.X)
z.I_b,z.Xb = get_points (C.exb)
C.exc = T.ABC : ex_circle (2)
z.I_c,z.Xc = get_points (C.exc)
- C.ortho = radical_circle (C.exa,C.exb,C.exc)
+ C.ortho = C.exa : radical_circle (C.exb,C.exc)
z.w,z.a = get_points (C.ortho)
\end{tkzelements}
\begin{tikzpicture}
@@ -2006,7 +2025,7 @@ z.H = L.OOp : projection (z.X)
z.I_b,z.Xb = get_points (C.exb)
C.exc = T.ABC : ex_circle (2)
z.I_c,z.Xc = get_points (C.exc)
- C.ortho = radical_circle (C.exa,C.exb,C.exc)
+ C.ortho = C.exa : radical_circle (C.exb,C.exc)
z.w,z.a = get_points (C.ortho)
\end{tkzelements}
@@ -2590,7 +2609,7 @@ z.M = L.OOp.mid
C.OpD = circle : new (z.Op,z.D)
z.E,z.F = get_points (C.OB : radical_axis (C.OpD))
L.EF = line : new (z.E,z.F)
- z.M = L.EF : point (2.25)
+ z.M = L.EF : point (.25)
L.T,L.Tp = C.OB : tangent_from (z.M)
L.K,L.Kp = C.OpD : tangent_from (z.M)
z.T = L.T.pb
@@ -2601,7 +2620,7 @@ z.M = L.OOp.mid
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',D)
- \tkzDrawLine[add=1 and 2,cyan](E,F)
+ \tkzDrawLine[cyan](E,F)
\tkzDrawLines[add=.5 and .5,orange](O,O' O,T O,T')
\tkzDrawSegments[cyan](M,T M,T' M,K M,K')
\tkzDrawCircle(M,T)
@@ -2620,7 +2639,7 @@ C.OB = circle : new (z.O,z.B)
C.OpD = circle : new (z.Op,z.D)
z.E,z.F = get_points (C.OB : radical_axis (C.OpD))
L.EF = line : new (z.E,z.F)
-z.M = L.EF : point (2.25)
+z.M = L.EF : point (.25)
L.T,L.Tp = C.OB : tangent_from (z.M)
L.K,L.Kp = C.OpD : tangent_from (z.M)
z.T = L.T.pb
@@ -2633,7 +2652,7 @@ z.Kp = L.Kp.pb
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(O,B O',D)
-\tkzDrawLine[add=1 and 2,cyan](E,F)
+\tkzDrawLine[cyan](E,F)
\tkzDrawLines[add=.5 and .5,orange](O,O' O,T O,T')
\tkzDrawSegments[cyan](M,T M,T' M,K M,K')
\tkzDrawCircle(M,T)
@@ -2877,9 +2896,9 @@ z.O = L.BA.mid
C.C0A = circle : new (z.C_0,z.A)
C.C1B = circle : new (z.C_1,z.B)
L.EF = C.C0A : radical_axis (C.C1B)
- z.M_0 = L.EF : point (2)
- z.M_1 = L.EF : point (-1)
- z.M_2 = L.EF : point (-2)
+ z.M_0 = L.EF : point (.4)
+ z.M_1 = L.EF : point (.1)
+ z.M_2 = L.EF : point (.6)
C.orth0 = C.C0A : orthogonal_from (z.M_0)
C.orth1 = C.C0A : orthogonal_from (z.M_1)
C.orth2 = C.C0A : orthogonal_from (z.M_2)
@@ -2907,9 +2926,9 @@ z.O = L.BA.mid
C.C0A = circle : new (z.C_0,z.A)
C.C1B = circle : new (z.C_1,z.B)
L.EF = C.C0A : radical_axis (C.C1B)
- z.M_0 = L.EF : point (2)
- z.M_1 = L.EF : point (-1)
- z.M_2 = L.EF : point (-2)
+ z.M_0 = L.EF : point (.4)
+ z.M_1 = L.EF : point (.1)
+ z.M_2 = L.EF : point (.6)
C.orth0 = C.C0A : orthogonal_from (z.M_0)
C.orth1 = C.C0A : orthogonal_from (z.M_1)
C.orth2 = C.C0A : orthogonal_from (z.M_2)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
index c8623799ee..935c4fdeea 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
@@ -703,7 +703,8 @@ You obtain a point on the object by entering a real number between 0 and 1.
\label{sub:behind_the_objects}
Before introducing objects, I only used functions whose parameters were points (comlexes).
-For example, |z.m = midpoint_ (z.a,z.b)| defines the midpoint of points $a$ and $b$. Avec les objets, il faut d'abord définir la droite/sgment |L.ab| puis on obtient le milieu avec |z.m = L.ab.mid|.
+
+For example, |z.m = midpoint_ (z.a,z.b)| defines the midpoint of points $a$ and $b$. With objects, first define the line/sgment |L.ab| and then obtain the middle with |z.m = L.ab.mid|.
I've kept the functions (which I'll call "primary") whose only arguments are points. They are distinguished from the others by a terminal underscore. In fact, all (almost) object-related functions depend on a primary function.
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
new file mode 100644
index 0000000000..bb067244d4
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
@@ -0,0 +1,4 @@
+\section{Inversion} % (fold)
+\label{sec:inversion}
+midcircless
+% section inversion (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
index c4db9a8816..862be86799 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
@@ -1,6 +1,6 @@
% !TEX TS-program = lualatex
% encoding : utf8
-% Documentation of tkz-elements v1.40c
+% Documentation of tkz-elements v1.82c
% Copyright 2023 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -21,10 +21,10 @@
headings = small
]{tkz-doc}
\gdef\tkznameofpack{tkz-elements}
-\gdef\tkzversionofpack{1.72c}
+\gdef\tkzversionofpack{1.82c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{tkz-elements.pdf}
-\gdef\tkzversionofdoc{1.72c}
+\gdef\tkzversionofdoc{1.82c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
@@ -97,7 +97,7 @@
\usepackage[english]{babel}
\usepackage[normalem]{ulem}
\usepackage{multirow,multido,booktabs,cellspace}
-\usepackage{shortvrb,bookmark,caption,enumitem}
+\usepackage{shortvrb,bookmark,enumitem}
\usepackage{makeidx}
\usepackage[most]{tcolorbox}
@@ -145,16 +145,15 @@ sharp corners
\newcommand*{\tkzEHand}{\textcolor{red}{\lefthand}}
%<--------------------------------------------------------------------------->
% settings styles
-\tkzSetUpColors[background=white,text=black]
-\tkzSetUpCompass[color=orange, line width=.2pt,delta=10]
-\tkzSetUpArc[color=gray,line width=.2pt]
-\tkzSetUpPoint[size=2,color=teal]
-\tkzSetUpLine[line width=.2pt,color=teal]
-\tkzSetUpStyle[color=orange,line width=.2pt]{new}
-\tikzset{every picture/.style={line width=.2pt}}
-\tikzset{label angle style/.append style={color=teal,font=\footnotesize}}
-\tikzset{label style/.append style={below,color=teal,font=\scriptsize}}
-\tikzset{new/.style={color=orange,line width=.2pt}}
+
+\tkzSetUpColors[background=white,text=darkgray]
+\tkzSetUpPoint[size=2,color=teal,fill=teal!10]
+\tkzSetUpLine[ultra thin,color=teal]
+\tkzSetUpCompass[color=orange,ultra thin,/tkzcompass/delta=10]
+\tikzset{label style/.append style={below right,color=teal,font=\scriptsize}}
+\tikzset{new/.style={color=orange,ultra thin}}
+\tikzset{step 1/.style={color=cyan,ultra thin}}
+\tikzset{step 2/.style={color=purple,ultra thin}}
\def\tkzar{\hspace{1em}-->\hspace{1em}}
\makeatletter\let\percentchar\@percentchar\makeatother
@@ -167,8 +166,11 @@ sharp corners
\let\pmpn\pgfmathprintnumber
\AtBeginDocument{\MakeShortVerb{\|}} % link to shortvrb
+
+
+
\begin{document}
-% \LuaCodeDebugOn
+\LuaCodeDebugOn
\parindent=0pt
\tkzTitleFrame{tkz-elements \tkzversionofpack\\Euclidean Geometry}
@@ -210,6 +212,7 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\input{TKZdoc-elements-why.tex}
\input{TKZdoc-elements-presentation.tex}
\input{TKZdoc-elements-convention.tex}
+\input{TKZdoc-elements-organization.tex}
\input{TKZdoc-elements-transferts.tex}
\input{TKZdoc-elements-classes.tex}
\input{TKZdoc-elements-classes-point.tex}
@@ -229,4 +232,337 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\clearpage\newpage
\small\printindex
+
+\newpage
+\section{Cheat\_sheet} % (fold)
+\label{sec:cheat_sheet}
+
+% section cheat_sheet (end)
+|r| denotes a real number, |d| a positive real number, |n|an integer, |an| an angle, |b| a boolean, |s| a character string, |pt| a point, |v| variable, |L| a straight line, |C| a circle, |T| a triangle, |E| an ellipse, |Q| a quadrilateral, |P| a parallelogram, |R| a rectangle, |S| a square, |RP| a regular polygon, |O| an object (pt, L,C,T), . . a list of points or an object, < > optional argument.
+
+\begin{multicols}{3}
+
+\fbox{\textbf{Point}}\\
+\textbf{Attributes} table(\ref{point:att}) \\
+|re -> r| \\
+|im -> r| \\
+|type -> s| \\
+|argument -> r| \\
+|modulus -> d| \\
+\textbf{Methods} table(\ref{point:met}) \\
+|+ - * / -> pt| \\
+|.. -> r| \\
+|^ -> r| \\
+|conj -> pt| \\
+|abs -> | \\
+|mod -> | \\
+|norm -> | \\
+|arg -> r| \\
+|get -> r,r| \\
+|sqrt -> pt| \\
+|new -> pt| \\
+|polar -> pt| \\
+|polar_deg -> pt| \\
+|north(d) -> pt| \\
+|south(d) -> pt| \\
+|east(d) -> pt| \\
+|west(d) -> pt| \\
+|normalize(pt) -> pt| \\
+|symmetry (...) -> O| \\
+|rotation (an , ...) -> O| \\
+|homothety (r , ...) -> O| \\
+ \\
+\fbox{\textbf{line}} \\
+\textbf{Attributes} table(\ref{line:att}) \\
+|pa,pb -> pt| \\
+|type -> s| \\
+|mid -> pt| \\
+|north_pa -> pt| \\
+|north_pb -> pt| \\
+|south_pa -> pt| \\
+|south_pb -> pt| \\
+|east -> pt| \\
+|west -> pt| \\
+|slope -> r| \\
+|length -> d| \\
+\textbf{Methods} table(\ref{line:met}) \\
+|new (pt,pt) -> d| \\
+|distance (pt) -> d| \\
+|slope () -> r| \\
+|in_out (pt) -> b| \\
+|in_out_segment (pt) -> b| \\
+|barycenter (r,r) -> pt| \\
+|point (t) -> pt| \\
+|midpoint () -> pt| \\
+|harmonic_int (pt) -> pt| \\
+|harmonic_ext (pt) -> pt| \\
+|harmonic_both (d) -> pt| \\
+|gold_ratio() -> pt| \\
+|normalize () -> pt| \\
+|normalize_inv () -> pt| \\
+|_north_pa (d) -> pt| \\
+|_north_pb (d) -> pt| \\
+|_south_pa (d) -> pt| \\
+|_south_pb (d) -> pt| \\
+|_east (d) -> pt| \\
+|_west (d) -> pt| \\
+|translation (...) -> O| \\
+|projection (...) -> O| \\
+|reflection (...) -> O| \\
+|ll_from ( pt ) -> L| \\
+|ortho_from ( pt ) -> L| \\
+|mediator () -> L| \\
+|circle () -> C| \\
+|circle_swap () -> C| \\
+|diameter () -> C| \\
+|apollonius (r) -> C| \\
+|equilateral (<swap>) -> T| \\
+|isosceles (an,<swap>) -> T| \\
+|school () -> T| \\
+|two_angles (an,an) -> T| \\
+|half () -> T| \\
+|sss (r,r,r) -> T| \\
+|sas (r,an) -> T| \\
+|ssa (r,an) -> T| \\
+|gold (<swap>) -> T| \\
+|euclide (<swap>) -> T| \\
+|golden (<swap>) -> T| \\
+|devine () -> T| \\
+|cheops () -> T| \\
+|pythagoras () -> T| \\
+|sublime () -> T| \\
+|egyptian () -> T| \\
+|square (<swap>) -> T| \\
+|report (r,pt) -> T| \\
+ \\
+\fbox{\textbf{triangle}} \\
+\textbf{Attributes} table(\ref{triangle:att}) \\
+|pa,pb,pc -> pt| \\
+|circumcenter -> pt| \\
+|centroid -> pt| \\
+|incenter -> pt| \\
+|eulercenter -> pt| \\
+|orthocenter -> pt| \\
+|spiekercenter -> pt| \\
+|type -> s| \\
+|a -> d| \\
+|b -> d| \\
+|c -> d| \\
+|ab -> L| \\
+|bc -> L| \\
+|ca -> L| \\
+|alpha -> r| \\
+|beta -> r| \\
+|gamma -> r| \\
+\textbf{Methods} table(\ref{triangle:met}) \\
+|new (pt,pt,pt) -> pt| \\
+|trilinear (r,r,r) -> pt| \\
+|barycentric (r,r,r) -> pt| \\
+|bevan_point () -> pt| \\
+|mittenpunkt_point () -> pt| \\
+|gergonne_point () -> pt| \\
+|nagel_point () -> pt| \\
+|feuerbach_point () -> pt| \\
+|lemoine_point() -> pt| \\
+|symmedian_point() -> pt| \\
+|spieker_center() -> pt| \\
+|barycenter (r,r,r) -> pt| \\
+|base (u,v) -> pt| \\
+|euler_points () -> pt| \\
+|nine_points () -> pt| \\
+|point (t) -> pt| \\
+|soddy_center () -> pt| \\
+|euler_line () -> L| \\
+|symmedian_line (n) -> L| \\
+|altitude (n) -> L| \\
+|bisector (n) -> L| \\
+|bisector_ext(n) -> L| \\
+|antiparallel(pt,n) -> L| \\
+|euler_circle () -> C| \\
+|circum_circle() -> C| \\
+|in_circle () -> C| \\
+|ex_circle (n) -> C| \\
+|first_lemoine_circle() -> C| \\
+|second_lemoine_circle() -> C| \\
+|spieker_circle() -> C| \\
+|soddy_circle () -> C| \\
+|orthic() -> T| \\
+|medial() -> T| \\
+|incentral() -> T| \\
+|excentral() -> T| \\
+|intouch() -> T| \\
+|contact() -> T| \\
+|extouch() -> T| \\
+|feuerbach() -> T| \\
+|anti () -> T| \\
+|tangential () -> T| \\
+|cevian (pt) -> T| \\
+|symmedian () -> T| \\
+|euler () -> T| \\
+|projection (pt) -> pt,pt,pt| \\
+|parallelogram () -> pt| \\
+|area () -> d| \\
+|barycentric_coordinates(pt)| \\
+ |-> r,r,r| \\
+|in_out (pt) -> pt| \\
+|check_equilateral () -> b| \\
+\fbox{\textbf{circle}} \\
+\textbf{Attributes} table(\ref{circle:att}) \\
+|center -> pt| \\
+|through -> pt| \\
+|north -> pt| \\
+|south -> pt| \\
+|east -> pt| \\
+|west -> pt| \\
+|opp -> pt| \\
+|type -> s| \\
+|radius -> d| \\
+|ct -> L| \\
+\textbf{Methods} table(\ref{circle:met}) \\
+|new (pt,pt) -> C| \\
+|radius (pt, r) -> C| \\
+|diameter (pt,pt) -> C| \\
+|in_out (pt) -> b| \\
+|in_out_disk (pt) -> b| \\
+|circles_position (C) -> s| \\
+|power (pt) -> r| \\
+|antipode (pt) -> pt| \\
+|midarc (pt,pt) -> pt| \\
+|point (r) -> pt| \\
+|random_pt (lower, upper) -> pt| \\
+|internal_similitude (C) -> pt| \\
+|external_similitude (C) -> pt| \\
+|radical_center(C,<C>) -> pt| \\
+|tangent_at (pt) -> L| \\
+|radical_axis (C) -> L| \\
+|radical_circle(C,<C>) -> C| \\
+|orthogonal_from (pt) -> C| \\
+|orthogonal_through(pt,pt) -> C| \\
+|midcircle(C) -> C| \\
+|external_tangent(C) -> L,L| \\
+|internal_tangent(C) -> L,L| \\
+|common_tangent(C) -> L,L| \\
+|tangent_from (pt) -> L,L| \\
+|inversion (...) -> O | \\
+ \\
+\fbox{\textbf{ellipse}} \\
+\textbf{Attributes} table(\ref{ellipse:met}) \\
+|center -> pt| \\
+|vertex -> pt| \\
+|covertex -> pt| \\
+|Fa -> pt| \\
+|Fb -> pt| \\
+|north -> pt| \\
+|south -> pt| \\
+|east -> pt| \\
+|west -> pt| \\
+|Rx -> d| \\
+|Ry -> d| \\
+|slope -> r| \\
+|type -> s| \\
+\textbf{Methods} table(\ref{ellipse:met}) \\
+|new (pt,pt,pt) -> E| \\
+|foci (pt,pt,pt) -> E| \\
+|radii (pt,r,r,an) -> E| \\
+|in_out (pt) -> b| \\
+|tangent_at (pt) -> L| \\
+|tangent_from (pt) -> L| \\
+|point (r) -> pt| \\
+ \\
+\fbox{\textbf{square}} \\
+ \textbf{Attributes} table(\ref{square:att}) \\
+|pa,pb,pc,pd -> pt| \\
+|type -> s| \\
+|side -> d| \\
+|center -> pt| \\
+|exradius -> d| \\
+|inradius -> d| \\
+|diagonal -> d| \\
+|proj -> pt| \\
+|ab bc cd da -> L| \\
+|ac bd -> L| \\
+ \textbf{Methods} table(\ref{square:met}) \\
+|new (pt,pt,pt,pt) -> S| \\
+|rotation (pt,pt) -> S| \\
+|side (pt,pt,<swap>) -> S| \\
+ \\
+\fbox{\textbf{rectangle}} \\
+\textbf{Attributes} table(\ref{rectangle:att}) \\
+|pa,pb,pc,pd -> pt| \\
+|type -> s| \\
+|center -> pt| \\
+|exradius -> d| \\
+|length -> r| \\
+|width -> r| \\
+|diagonal -> d| \\
+|ab bc cd da -> L| \\
+|ac bd -> L| \\
+ \textbf{Methods} table(\ref{rectangle:met}) \\
+|new (pt,pt,pt,pt) -> R| \\
+|angle (pt,pt,an) -> R| \\
+|gold (pt,pt,<swap>) -> R| \\
+|diagonal (pt,pt,<swap>) -> R| \\
+|side (pt,pt,r,<swap>) -> R| \\
+|get_lengths () ->r,r| \\
+ \\
+\fbox{\textbf{quadrilateral} } \\
+ \textbf{Attributes} table(\ref{quadrilateral:att}) \\
+|pa,pb,pc,pd -> pt| \\
+|ab bc cd da -> L | \\
+|ac bd -> L | \\
+|type -> s | \\
+|i -> pt| \\
+|g -> pt| \\
+|a b c d -> r| \\
+ \textbf{Methods} table(\ref{quadrilateral:met}) \\
+|new (pt,pt,pt,pt) -> Q| \\
+|iscyclic () -> b| \\
+ \\
+\fbox{\textbf{parallelogram}} \\
+ \textbf{Attributes} table(\ref{parallelogram:att}) \\
+|pa,pb,pc,pd -> pt| \\
+|ab bc cd da -> L | \\
+|ac bd -> L | \\
+|type -> s | \\
+|center -> pt| \\
+ \textbf{Methods} table(\ref{parallelogram:met}) \\
+|new (pt,pt,pt,pt) ->| \\
+|fourth (pt,pt,pt) ->| \\
+ \\
+\fbox{\textbf{Regular\_polygon}} \\
+ \textbf{Attributes} table(\ref{regular:att}) \\
+|center -> pt| \\
+|through -> pt | \\
+|circle -> C | \\
+|type -> s | \\
+|side -> d| \\
+|exradius -> d| \\
+|inradius -> d| \\
+|proj -> pt| \\
+|nb -> i| \\
+|angle -> an| \\
+ \textbf{Methods} table(\ref{regular:met})\\
+|new (pt,pt,n) -> PR| \\
+|incircle () -> C| \\
+|name (s) -> ?| \\
+ \\
+\fbox{\textbf{Misc.}} \\
+ \textbf{Attributes} table(\ref{misc}) \\
+|tkzphi -> r| \\
+|tkzinvphi -> r | \\
+|tkzsqrtphi -> r | \\
+|length -> d | \\
+|islinear(pt,pt,pt) -> b | \\
+|isortho(pt,pt,pt) -> b | \\
+|\tkzUseLua{v} -> ?| \\
+|value{r} -> r| \\
+|real -> r| \\
+|angle_normalize (an) -> an| \\
+|barycenter (...) -> pt| \\
+|bisector (pt,pt,pt) -> L| \\
+|bisector_ext (pt,pt,pt) -> L| \\
+|altitude (pt,pt,pt) -> L| \\
+|midpoint (pt,pt) -> pt| \\
+|equilateral (pt,pt) -> T| \\
+\end{multicols}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
new file mode 100644
index 0000000000..f69e0a591d
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
@@ -0,0 +1,100 @@
+\section{Work organization} % (fold)
+\label{sec:work_organization}
+
+Here's a sample organization.
+
+The line |% !TEX TS-program = lualatex| ensures that you don't forget to compile with Lua\LATEX{}. The "standalone" class is useful, as all you need to do here is create a figure.
+
+The "mini" option in \pkg{tkz-euclide} allows you to load and use only plot-related macros.
+
+The package \pkg{ifthen} is useful if you need to use some Boolean.
+
+The macro \tkzcname{LuaCodeDebugOn} allows you to try and find errors in Lua code.
+
+It is of course possible to leave the Lua code in the \tkzNameEnv{tkzelements} environment, but externalizing this code has its advantages.
+
+The first advantage, if you use a good editor, is to have a good presentation of the code. Styles are different between "Lua" and \LATEX{}. This makes the code clearer. This is how I proceeded, then reintegrated the code into the main code.
+
+Another advantage is that you don't have to comment the code incorrectly. For Lua code, you comment lines with |--| (double minus sign), whereas for \LATEX{}, you comment with |%|.
+
+Third advantage: the code can be reused.
+
+
+
+\begin{verbatim}
+% !TEX TS-program = lualatex
+% Created by Alain Matthes on 2024-01-09.
+
+\documentclass[margin = 12pt]{standalone}
+\usepackage[mini]{tkz-euclide}
+\usepackage{tkz-elements,ifthen}
+
+\begin{document}
+\LuaCodeDebugOn
+\begin{tkzelements}
+ scale = 1.25
+ dofile ("sangaku.lua")
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle(I,F)
+ \tkzFillPolygon[color = purple](A,C,D)%
+ \tkzFillPolygon[color = blue!50!black](A,B,C)%
+ \tkzFillCircle[color = orange](I,F)%
+\end{tikzpicture}
+\end{document}
+\end{verbatim}
+
+And here is the code for the "Lua" part: the file |ex_sangaku.lua|
+
+\begin{verbatim}
+z.A = point : new ( 0,0 )
+z.B = point : new ( 8,0 )
+L.AB = line : new ( z.A , z.B )
+S = L.AB : square ()
+_,_,z.C,z.D = get_points (S)
+z.F = S.ac : projection (z.B)
+L.BF = line : new (z.B,z.F)
+T.ABC = triangle : new ( z.A , z.B , z.C )
+L.bi = T.ABC : bisector (2)
+z.c = L.bi.pb
+L.Cc = line : new (z.C,z.c)
+z.I = intersection (L.Cc,L.BF)
+\end{verbatim}
+
+\begin{tkzelements}
+ scale = 1.25
+ dofile ("sangaku.lua")
+\end{tkzelements}
+
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle(I,F)
+ \tkzFillPolygon[color = purple](A,C,D)%
+ \tkzFillPolygon[color = blue!50!black](A,B,C)%
+ \tkzFillCircle[color = orange](I,F)%
+\end{tikzpicture}
+
+\subsection{Scale problem} % (fold)
+\label{sub:scale_problem}
+
+If necessary, it's better to do the scaling in the "Lua" section. The reason is that it will be more accurate. There is, however, a problem to be aware of. I've made it a point of honor to avoid using numerical values in my codes whenever possible. In principle, these values only appear in the definition of fixed points. If the "scale" option is used, scaling is applied when points are created. Let's imagine you want to organize your code as follows:
+
+|scale = 1.5|\\
+|xB = 8|\\
+|z.B = point : new ( xB,0 )|
+
+Scaling would then be ineffective, as the numerical values are not modified, only the point coordinates. To take scaling into account, use the function \Igfct{math}{value (v) }.
+
+|scale = 1.5|\\
+|xB = value (8)|\\
+|z.B = point : new ( xB,0 )|
+
+\subsection{Code presentation} % (fold)
+\label{sub:code_presentation}
+
+The key point is that, unlike \LATEX{} or \TEX{}, you can insert spaces absolutely anywhere.
+% subsection code_presentation (end)
+% subsection scale_problem (end)
+% section work_organization (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-tests.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-tests.tex
new file mode 100644
index 0000000000..d43cce663b
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-tests.tex
@@ -0,0 +1,4 @@
+\section{tests} % (fold)
+\label{sec:tests}
+
+% section tests (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
index c255a1804d..39d5940e72 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transferts.tex
@@ -23,49 +23,58 @@ Currently the drawing program is either \TIKZ\ or \pkg{tkz-euclide}. You have th
n = string.len(K)
if n >1 then
_,_,ft, sd = string.find( K , "(.+)(.)" )
- if sd == "p" then K=ft.."'" end
+ if sd == "p" then K=ft.."'" end
+ _,_,xft, xsd = string.find( ft , "(.+)(.)" )
+ if xsd == "p" then K=xft.."'".."'" end
end
tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
end}
-}\end{verbatim}
+}
+\end{verbatim}
\end{mybox}
See the section In-depth Study \ref{sec:in_depth_study} for an explanation of the previous code.
-The environment \tkzNameEnv{tkzelements} allows to use the underscore |_| and the macro \tkzcname{tkzGetNodes} allows to obtain names of nodes containing \tkzname{prime}. (see the next example)
+The environment \tkzNameEnv{tkzelements} allows to use the underscore |_| and the macro \tkzcname{tkzGetNodes} allows to obtain names of nodes containing \tkzname{prime} or \tkzname{double prime}. (see the next example)
\begin{minipage}{0.5\textwidth}
-\begin{tkzexample}[latex=0cm,small,code only]
+\begin{verbatim}
\begin{tkzelements}
scale = 1.2
z.o = point: new (0,0)
z.a_1 = point: new (2,1)
z.a_2 = point: new (1,2)
z.ap = z.a_1 + z.a_2
+ z.app = z.a_1 - z.a_2
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawSegments(o,a_1 o,a_2 o,a')
+ \tkzDrawSegments(o,a_1 o,a_2 o,a' o,a'')
\tkzDrawSegments[red](a_1,a' a_2,a')
- \tkzDrawPoints(a_1,a_2,a',o)
- \tkzLabelPoints(o,a_1,a_2,a')
+ \tkzDrawSegments[blue](a_1,a'' a_2,a'')
+ \tkzDrawPoints(a_1,a_2,a',o,a'')
+ \tkzLabelPoints(o,a_1,a_2,a',a'')
\end{tikzpicture}
-\end{tkzexample}%
-\end{minipage}%
+\end{verbatim}
+\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{tkzelements}
-scale = 1.2
-z.o = point: new (0,0)
-z.a_1 = point: new (2,1)
-z.a_2 = point: new (1,2)
-z.ap = z.a_1 + z.a_2
+ scale = 1.2
+ z.o = point: new (0,0)
+ z.a_1 = point: new (2,1)
+ z.a_2 = point: new (1,2)
+ z.ap = z.a_1 + z.a_2
+ z.app = z.a_1 - z.a_2
\end{tkzelements}
+\hspace{\fill}
\begin{tikzpicture}
-\tkzGetNodes
- \tkzDrawSegments(o,a_1 o,a_2 o,a')
- \tkzDrawSegments[red](a_1,a' a_2,a')
- \tkzDrawPoints(a_1,a_2,a',o)
- \tkzLabelPoints(o,a_1,a_2,a')
+ \tkzGetNodes
+ \tkzDrawSegments(o,a_1 o,a_2 o,a' o,a'')
+ \tkzDrawSegments[red](a_1,a' a_2,a')
+ \tkzDrawSegments[blue](a_1,a'' a_2,a'')
+ \tkzDrawPoints(a_1,a_2,a',o,a'')
+ \tkzLabelPoints(o,a_1,a_2,a',a'')
\end{tikzpicture}
+\hspace{\fill}
\end{minipage}%
\newpage
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
index afc64f416d..aa3c23d7d8 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-why.tex
@@ -69,7 +69,7 @@ The goal is to determine an inner tangent circle to the three exinscribed circle
See \href{https://mathworld.wolfram.com/ApolloniusCircle.html}{MathWorld} for more details.
-This example was my reference for testing the tkz-euclide package. With my first methods and the tools at my disposition, the results lacked precision. Now, with tkz-elements, I can use tools that are more powerful, more precise and easier to create.
+This example was my reference for testing the \pkg{tkz-euclide} package. With my first methods and the tools at my disposition, the results lacked precision. Now, with tkz-elements, I can use tools that are more powerful, more precise and easier to create.
The essential principles of figure construction with \tkzname{tkz-euclide} are kept: definitions, calculations, tracings, labels as well as the step-by-step programmation, corresponding to a construction with a ruler and a compass.
@@ -136,7 +136,7 @@ Finally, the inversion of the Euler circle with respect to the radical circle is
Now that all the points have been defined, it's time to start drawing the paths. To do this, you need to create the nodes. This is the role of the macro \Imacro{tkzGetNodes}. See \ref{ssub:points_transfer}
-The following section concerns only drawings, and is handled by tkz-euclide.
+The following section concerns only drawings, and is handled by \pkg{tkz-euclide}.
\begin{verbatim}
\begin{tikzpicture}
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/gold_preamble.lua b/macros/latex/contrib/tkz/tkz-elements/doc/latex/gold_preamble.lua
new file mode 100644
index 0000000000..9067371eb0
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/gold_preamble.lua
@@ -0,0 +1,46 @@
+z.A = point: new (0 , 0)
+z.B = point: new (10 , 0)
+L.AB = line: new ( z.A, z.B)
+z.C = L.AB : gold_ratio ()
+L.AC = line: new ( z.A, z.C)
+L.CB = line: new ( z.C, z.B)
+z.O_0 = L.AB.mid
+z.O_1 = L.AC.mid
+z.O_2 = L.CB.mid
+C.O0B = circle: new ( z.O_0, z.B)
+C.O1C = circle: new ( z.O_1, z.C)
+C.O2B = circle: new ( z.O_2, z.B)
+z.M_0 = C.O1C : external_similitude (C.O2B)
+z.M_1 = C.O0B : internal_similitude (C.O1C)
+z.M_2 = C.O0B : internal_similitude (C.O2B)
+z.Q = C.O2B.north
+z.P = C.O1C.north
+z.O = C.O0B.south
+z.W = C.O0B.north
+L.O1Q = line : new (z.O_1,z.Q)
+L.O2P = line : new (z.O_2,z.P)
+z.O_4 = intersection (L.O1Q,L.O2P)
+L.CO4 = line : new (z.C,z.O_4)
+z.D = intersection (L.CO4,C.O0B)
+L.CD = line : new (z.C,z.D)
+L.PQ = line : new (z.P,z.Q)
+L.CQ = line : new (z.C,z.Q)
+z.O_5 = intersection (L.CD,L.PQ)
+C.QC = circle: new ( z.Q, z.C)
+C.PA = circle: new ( z.P, z.A)
+z.P_0 = intersection (C.QC,C.O0B)
+z.P_1 = intersection (C.QC,C.O1C)
+_,z.P_2 = intersection (C.PA,C.O2B)
+T.P = triangle: new ( z.P_0, z.P_1, z.P_2)
+z.O_3 = T.P.circumcenter
+L.AQ = line : new (z.A,z.Q)
+L.BP = line : new (z.B,z.P)
+z.T = intersection(L.BP,L.AQ)
+z.O_6 = L.CD.mid
+C.DC = circle : new (z.D,z.C)
+z.U,z.V = intersection (C.DC,C.O0B)
+L.UV = line : new (z.U,z.V)
+z.R,z.S = L.UV : projection (z.O_1,z.O_2)
+
+
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/sangaku.lua b/macros/latex/contrib/tkz/tkz-elements/doc/latex/sangaku.lua
new file mode 100644
index 0000000000..777528540f
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/sangaku.lua
@@ -0,0 +1,14 @@
+xB = value(8)
+z.A = point : new ( 0,0 )
+z.B = point : new (
+xB,0 )
+L.AB = line : new ( z.A , z.B )
+S = L.AB : square ()
+_,_,z.C,z.D = get_points (S)
+z.F = S.ac : projection (z.B)
+L.BF = line : new (z.B,z.F)
+T.ABC = triangle : new ( z.A , z.B , z.C )
+L.bi = T.ABC : bisector (2)
+z.c = L.bi.pb
+L.Cc = line : new (z.C,z.c)
+z.I = intersection (L.Cc,L.BF) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
index 3dcaf903a2..d5b920c981 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
index 903691bcc3..2b388229e4 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
@@ -1,6 +1,6 @@
% encoding : utf8
-% tkz-elements.sty v1.72c
-% Copyright 2023 Alain Matthes
+% tkz-elements.sty v1.82c
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -11,7 +11,7 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\ProvidesPackage{tkz-elements}[23/12/24 v1.72c Graphic Object Library]
+\ProvidesPackage{tkz-elements}[2024/01/16 v1.82c Graphic Object Library]
\RequirePackage{luacode}
\directlua{require "tkz_elements_main"}
@@ -36,7 +36,9 @@
n = string.len(K)
if n >1 then
_,_,ft, sd = string.find( K , "(.+)(.)" )
- if sd == "p" then K=ft.."'" end
+ if sd == "p" then K=ft.."'" end
+ _,_,xft, xsd = string.find( ft , "(.+)(.)" )
+ if xsd == "p" then K=xft.."'".."'" end
end
tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\")
end}
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
index e81609f6ee..ae257221f4 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
@@ -1,7 +1,7 @@
-- tkz_elements-circles.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -17,9 +17,8 @@
circle = {}
function circle: new (c, t) -- c --> center t --> through
local type = 'circle'
- local ra = line :new (c,t)
- local anti = antipode_ (c,t)
- local di = line : new (anti, t)
+ local ct = line :new (c,t)
+ local opp = antipode_ (c,t)
local radius = point.abs ( c - t )
local south = c - point (0,radius)
local east = c + point (radius,0)
@@ -27,8 +26,8 @@ function circle: new (c, t) -- c --> center t --> through
local west = c - point (radius,0)
local o = { center = c,
through = t,
- ra = ra,
- di = di,
+ ct = ct,
+ opp = opp,
radius = radius,
south = south,
east = east,
@@ -75,18 +74,11 @@ function circle: in_out_disk (pt)
end
end
-function circles_position (C1,C2)
- local d,max,min
- d = point.mod(C1.center-C2.center)
- max = C1.radius + C2.radius
- min = math.abs ( C1.radius - C2.radius)
- if d > max then return "outside"
- elseif d == max then return "outside tangent" -- epsilon
- elseif d == min then return "inside tangent" -- epsilon
- elseif d < min then return "inside"
- else return "intersect"
- end
+-- new version 1.80 added
+function circle : circles_position (C)
+ return circles_position_ (self.center,self.radius,C.center,C.radius)
end
+
-----------------------
-- real --
-----------------------
@@ -122,7 +114,7 @@ function circle: point (t)
return rotation_ (self.center,phi,self.through)
end
-function circle: random_pt(lower, upper)
+function circle: random_pt (lower, upper)
local t
math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) )
phi = lower + math.random() * (upper - lower)
@@ -136,6 +128,21 @@ end
function circle: external_similitude (C)
return external_similitude_ (self.center,self.radius,C.center,C.radius)
end
+
+function circle : common_tangent(C)
+ local o,s1,s2,t1,t2
+ o = external_similitude_ (self.center,self.radius,C.center,C.radius)
+
+ if self.radius < C.radius then
+ t1,t2 = tangent_from_ (C.center,C.through,o)
+ s1,s2 = tangent_from_ (self.center,self.through,o)
+ return s1,t1,t2,s2
+ else
+ s1,s2 = tangent_from_ (C.center,C.through,o)
+ t1,t2 = tangent_from_ (self.center,self.through,o)
+ return s1,t1,t2,s2
+ end
+end
-----------------------
-- lines --
-----------------------
@@ -148,12 +155,41 @@ function circle: tangent_from (pt)
t1,t2 = tangent_from_ (self.center,self.through,pt)
return line :new (pt,t1),line : new (pt,t2)
end
-
+ -- version 1.80
function circle: radical_axis (C)
local t1,t2
+ if self.radius > C.radius then
t1,t2 = radical_axis_ (self.center,self.through,C.center,C.through)
- return line : new (t1,t2)
+ else
+ t1,t2 = radical_axis_ (C.center,C.through,self.center,self.through)
end
+ return line :new (t1,t2)
+ end
+
+ -- version 1.80
+function circle: radical_center (C1,C2)
+if C2 == nil then
+ if self.radius > C1.radius then
+ return radical_center_ (self.center,self.through,C1.center,C1.through)
+ else
+ return radical_center_ (C1.center,C1.through,self.center,self.through)
+ end
+else
+ return radical_center3 (self,C1,C2)
+end
+end
+ -- version 1.80
+function circle : radical_circle (C1,C2)
+ local rc
+ if C2 == nil then
+ rc = self : radical_center (C1)
+ return self : orthogonal_from (rc)
+ else
+ rc = self : radical_center (C1,C2)
+ return C1 : orthogonal_from (rc)
+ end
+end
+
-- version 1.60 new
function circle : external_tangent(C)
local i,t1,t2,k,T1,T2
@@ -230,7 +266,7 @@ function circle: inversion (...)
else
t = {}
for i=1,tp.n do
- table.insert( t , inversion_ (self.center,self.through , tp[i]) )
+ table.insert( t , inversion_ (self.center,self.through , tp[i]) )
end
return table.unpack ( t )
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
index 9f8670a1b7..91b12ce31e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
@@ -1,6 +1,6 @@
-- tkz_elements_class.lua
--- date 23/12/24
--- version 1.72c
+-- date 2024/01/16
+-- version 1.82c
-- from class.lua (Simple Lua Classes from Lua-users wiki)
-- Compatible with Lua 5.1 (not 5.0).
-- http://lua-users.org/wiki/SimpleLuaClasses DavidManura
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
index bb8495336b..f3fa0d173b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
@@ -1,7 +1,7 @@
-- tkz_elements-ellipses.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
index cde3c027ac..33477340d3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_circles.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -51,40 +51,55 @@ function inversion_ (c,p,pt)
local r = (ry*ry)/d
return c+polar_ (r,point.arg(pt-c))
end
-
+
+function circles_position_ (c1,r1,c2,r2)
+ local d,max,min,epsilon
+ epsilon = 10^(-12)
+ d = point.mod(c1-c2)
+ max = r1+r2
+ min = math.abs ( r1 - r2)
+ if d > max then return "outside"
+ elseif math.abs(d - max) < epsilon then return "outside tangent" -- epsilon
+ elseif math.abs(d - min) < epsilon then return "inside tangent" -- epsilon
+ elseif d < min then return "inside"
+ else return "intersect"
+ end
+end
+
function radical_axis_ (c1,p1,c2,p2)
- local d,m,m1,m2,epsilon,ci,cj,ck,cm,cn,r1,r2,t
+ local ci,cj
r1 = point.abs(c1-p1)
r2 = point.abs(c2-p2)
- epsilon = 10^(-12)
- d = point.abs (c2 - c1)
- m = d - (r1+r2)
- m1 = math.abs (d - (r1+r2))
- m2 = math.abs (d - math.abs(r1-(r2)))
- if m2 < epsilon then
- ci = rotation_ (p1,math.pi/2,c2)
- cj = rotation_ (p1,-math.pi/2,c2)
- return ci,cj
- elseif m1 < epsilon then -- circles tangent
- -- z.A = point : new ( x , y ) contact
- t,t = intersection_cc_ (c1,p1,c2,p2)
- ci = rotation_ (t,math.pi/2,c2)
- cj = rotation_ (t,-math.pi/2,c2)
- return ci,cj
- -- circles disjoints
- elseif m > 0 then
- ck = rotation_ (c1,math.pi/3,c2)
- ci,cj = intersection_cc_ (c1,p1,ck,c1)
- cm,cn = intersection_cc_ (c2,p2,ck,c1)
- ci = intersection_ll_ (ci,cj,cm,cn)
- cj = symmetry_axial_ (c1,c2,ci) -- projection_ (c1,c2,ci)
- return ci,cj
- else
- ci,cj = intersection_cc_ (c1,p1,c2,p2)
- return ci,cj
- end
+ d = point.abs(c1-c2)
+ h = (r1*r1-r2*r2+d*d)/(2*d)
+ ck = radical_center_ (c1,p1,c2,p2)
+ cj = rotation_ (ck,-math.pi/2,c1)
+ ci = symmetry_ (ck,cj)
+ return cj,ci
end
+function radical_center_ (c1,p1,c2,p2)
+ local d,r1,r2,h
+ r1 = point.abs(c1-p1)
+ r2 = point.abs(c2-p2)
+ d = point.abs(c1-c2)
+ h = (r1*r1-r2*r2+d*d)/(2*d)
+ return h*(c2-c1)/d+c1
+end
+
+-- version 1.60 center pour deux cercles ?
+function radical_center3 (C1,C2,C3)
+ local t1,t2,t3,t4
+ t1,t2 = radical_axis_ (C1.center,C1.through,C2.center,C2.through)
+ if C3 == nil then
+ return intersection_ll_ (t1,t2,C1.center,C2.center)
+ else
+ t3,t4 = radical_axis_ (C3.center,C3.through,C2.center,C2.through)
+return intersection_ll_ (t1,t2,t3,t4)
+end
+end
+
+
function south_pole_ (c,p)
local r
r = point.abs (c-p)
@@ -117,7 +132,7 @@ end
-- version 1.60 new
function midcircle_(C1,C2)
local state,r,s,t1,t2,T1,T2,p,a,b,c,d,Cx,Cy,i,j
- state = circles_position(C1,C2)
+ state = circles_position_(C1.center,C1.radius,C2.center,C2.radius)
i = barycenter_ ({C2.center,C1.radius},{C1.center,-C2.radius})
j = barycenter_ ({C2.center,C1.radius},{C1.center,C2.radius})
t1,t2 = tangent_from_ (C1.center,C1.through,i)
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
index a3d5bd3a9d..be7eea4461 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
@@ -1,7 +1,7 @@
-- tkz_elements_intersections.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
index 4b27ec821f..642d048809 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_lines.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -50,7 +50,7 @@ function online_ (a,b,t)
return (z1+z2)/2
end
-- triangle specific
-function equilateral_tr (a,b)
+function equilateral_tr_ (a,b)
return rotation_ (a,math.pi/3,b)
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
index a3c2de28aa..0702b0a568 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_maths.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
index 309b7c762c..dfe86444df 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_points.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
index 423e13a937..4c0db75393 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_regular.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -15,7 +15,7 @@
---------------------------------------------------------------------------
--
---------------------------------------------------------------------------
-function regular_(c,th,s)
+function regular_(c,th,s) -- center through side
local r,t,dep
dep = angle_normalize(point.arg (th-c))
t = {}
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
index 3d92bdb819..c574147912 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_triangles.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
index 1143659bfb..1e45a544db 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
@@ -1,7 +1,7 @@
-- tkz_elements_lines.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -51,6 +51,10 @@ function line: distance (pt)
return point.mod(projection(self,pt)-pt)
end
+function length(a,b)
+ return point.abs (a-b)
+end
+
function line: slope ()
return slope_(self.pa,self.pb)
end
@@ -118,6 +122,36 @@ end
function line: normalize_inv ()
return normalize_ (self.pb,self.pa)
end
+
+function line: _east (d)
+ local d = d or 1
+ return self.pb+ d/self.length * (self.pb-self.pa)
+end
+
+function line: _west (d)
+ local d = d or 1
+ return self.pa+ d/self.length * (self.pa-self.pb)
+end
+
+function line: _north_pa (d)
+ local d = d or 1
+ return d/self.length * ( self.north_pa - self.pa ) + self.pa
+end
+
+function line: _south_pa (d)
+ local d = d or 1
+ return d/self.length *( self.south_pa - self.pa ) + self.pa
+end
+
+function line: _south_pb (d)
+ local d = d or 1
+ return d/self.length *( self.south_pb - self.pb ) + self.pb
+end
+
+function line: _north_pb (d)
+ local d = d or 1
+ return d/self.length *( self.north_pb - self.pb ) + self.pb
+end
-------------- transformations -------------
function line: translation_pt ( pt )
return translation_ ( self.pb-self.pa,pt )
@@ -262,7 +296,7 @@ function line: ll_from ( pt )
end
function line: ortho_from ( pt )
- return line : new (pt,pt+(self.pb-self.pa)*point(0,1))
+ return line : new (pt+(self.pb-self.pa)*point(0,-1),pt+(self.pb-self.pa)*point(0,1))
end
function line: mediator ()
@@ -304,12 +338,10 @@ function line: equilateral (swap)
if swap then
return triangle : new (self.pa,self.pb,rotation_ (self.pa,-math.pi/3,self.pb))
else
- return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb))
-
+ return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb))
end
end
-
function line: isosceles (phi,swap)
local pta,ptb
if swap == nil then
@@ -324,9 +356,55 @@ function line: isosceles (phi,swap)
ptb = rotation_ (self.pb,-phi,self.pa)
return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
end
-
end
+function line: two_angles (alpha,beta)
+ local pta,ptb,pt
+ pta = rotation_ (self.pa,alpha,self.pb)
+ ptb = rotation_ (self.pb,-beta,self.pa)
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+function line: school ()
+ local pta,ptb,pt
+ pta = rotation_ (self.pa,math.pi/6,self.pb)
+ ptb = rotation_ (self.pb,-math.pi/3,self.pa)
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+function line: half ()
+ local x,pt
+ x = midpoint_(self.pa,self.pb)
+ pt = rotation_ (self.pb,-math.pi/2,x)
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+function line: sss (a,b)
+ local pta,ptb,i,j
+ pta = self.pa + point ( a, 0 )
+ ptb = self.pb + point ( -b , 0)
+ i,j = intersection_cc_ (self.pa,pta,self.pb,ptb)
+ return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+end
+
+function line: ssa (a,phi)
+ local x,y,pt
+ x = rotation_ (self.pb,-phi,self.pa)
+ y = self.pa + polar_ ( a , self.slope)
+ i,j = intersection_lc_ (self.pb,x,self.pa,y)
+ return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+end
+
+function line: sas (a,phi)
+ local x,pt
+ x = self.pa + polar_ ( a , self.slope)
+ pt = rotation_ (self.pa,phi,x)
+ return triangle : new (self.pa,self.pb,pt)
+end
+---- sacred triangles ----
+
function line: gold (swap)
local pt
if swap == nil then
@@ -341,6 +419,16 @@ else
end
end
+function line: sublime ()
+ local pta,ptb,pt
+ pta = rotation_ (self.pa,2*math.pi/5,self.pb)
+ ptb = rotation_ (self.pb,-2*math.pi/5,self.pa)
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+line.euclid = line.sublime
+
function line: euclide (swap)
if swap == nil then
swap = false
@@ -352,20 +440,39 @@ else
end
end
-function line: golden (swap)
- local pt
- local pta,ptb
- if swap == nil then
- swap = false
- end
-if swap then
- pt = rotation_ (self.pa,-2*math.pi/5,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
-else
- pt = rotation_ (self.pa,2*math.pi/5,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi)
- end
+function line: divine ()
+ local pta,ptb,pt,h
+ pta = rotation_ (self.pa,math.pi/5,self.pb)
+ ptb = rotation_ (self.pb,-math.pi/5,self.pa)
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+function line: cheops ()
+ local m,n,pt
+ m = midpoint_ (self.pa,self.pb)
+ n = rotation_ (m,- math.pi/2,self.pa)
+ pt = m + (n-m)* tkzsqrtphi
+ return triangle : new (self.pa,self.pb,pt)
end
+
+function line: egyptian ()
+ local n,pt
+ n = rotation_ (self.pb,- math.pi/2,self.pa)
+ pt = self.pb + (n-self.pb)/point.mod(n-self.pb)*self.length* 0.75
+ return triangle : new (self.pa,self.pb,pt)
+end
+line.pythagoras = line.egyptian
+line.isis = line.egyptian
+
+function line: golden ()
+ local n,pt
+ n = rotation_ (self.pb,- math.pi/2,self.pa)
+ pt = self.pb + (n-self.pb)/tkzphi
+ return triangle : new (self.pa,self.pb,pt)
+end
+
+
------------------------------
-- Result -> couple of points
------------------------------
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
index 44842d2d9c..132f193667 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
@@ -1,7 +1,7 @@
-- tkz_elements-main.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
index ed4dd949a1..23f088983f 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
@@ -1,7 +1,7 @@
-- tkz_elements_functions_maths.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -33,26 +33,31 @@ function set_lua_to_tex (t)
token.set_macro(v,_ENV[v],'global')
end
end
--- version 1.60 center pour deux cercles ?
-function radical_center (C1,C2,C3)
- local t1,t2,t3,t4
- t1,t2 = radical_axis_ (C1.center,C1.through,C2.center,C2.through)
- if C3 == nil then
- return intersection_ll_ (t1,t2,C1.center,C2.center)
- else
- t3,t4 = radical_axis_ (C3.center,C3.through,C2.center,C2.through)
-return intersection_ll_ (t1,t2,t3,t4)
+
+function bisector (a,b,c)
+ local i
+ i = in_center_ (a,b,c)
+ return line : new (a,intersection_ll_ (a,i,b,c))
end
+
+function altitude (a,b,c)
+ local o,p
+ o = ortho_center_ (a,b,c)
+ p = projection_ (b,c,a)
+ return line : new (a,p)
end
--- version 1.60 modif case 2 circles
-function radical_circle (C1,C2,C3)
- local rc
- if C3 == nil then
- rc = radical_center (C1,C2)
- return C1 : orthogonal_from (rc)
- else
- rc = radical_center (C1,C2,C3)
- return C1 : orthogonal_from (rc)
+
+function bisector_ext(a,b,c) -- n =1 swap n=2 2 swap
+ local i,p
+ i = in_center_ (a,b,c)
+ p = rotation_ (a,math.pi/2,i)
+ return line : new (a,p)
end
+
+function equilateral (a,b)
+ return equilateral_tr_ (a,b)
end
+function midpoint (a,b)
+ return (a+b)/2
+end \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
index 6ed56cc828..386eb023e0 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
@@ -1,7 +1,7 @@
-- tkz_elements_parallelogram.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -16,7 +16,7 @@
---------------------------------------------------------------------------
parallelogram = {}
-function parallelogram: new (za, zb, zc,zd)
+function parallelogram: new (za, zb, zc, zd)
local d,epsilon
epsilon = 10^(-8)
local zi = midpoint_ (za,zc)
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
index 4997b857d8..7530dfc96a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
@@ -1,7 +1,7 @@
-- tkz_elements_point.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -187,7 +187,7 @@ function point: new ( a,b )
end
function point: polar ( radius, phi )
- return scale * polar_ ( radius, phi )
+ return point: new (radius * math.cos(phi), radius * math.sin(phi))
end
function point: polar_deg ( radius, phi )
@@ -196,22 +196,22 @@ end
function point: north(d)
local d = d or 1
- return self+ polar_ ( d * scale, math.pi/2 )
+ return self+ polar_ ( d , math.pi/2 )
end
function point: south(d)
local d = d or 1
- return self + polar_ ( d * scale, 3 * math.pi/2 )
+ return self + polar_ ( d , 3 * math.pi/2 )
end
function point: east(d)
local d = d or 1
- return self+ polar_( d * scale, 0 )
+ return self+ polar_( d , 0 )
end
function point: west(d)
local d = d or 1
- return self + polar_ ( d * scale, math.pi )
+ return self + polar_ ( d , math.pi )
end
-- ----------------------------------------------------------------
-- transformations
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
index 57d8af3aae..e80065540b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
@@ -1,7 +1,7 @@
-- tkz_elements_quadrilateral.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
index 600d31665b..abb9c2f8e9 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
@@ -1,7 +1,7 @@
-- tkz_elements-rectangle.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -36,7 +36,7 @@ function rectangle: new (za, zb,zc,zd)
local bd = line : new (zb,zd)
local length = point.mod (zb-za)
local width = point.mod (zd-za)
- local diagonal = point.abs (zc-za)
+ local diagonal = point.abs (zc-za)
local o = { pa = za,
pb = zb,
pc = zc,
@@ -47,7 +47,7 @@ function rectangle: new (za, zb,zc,zd)
da = da,
cd = cd,
bd = bd,
- diagonal = diagonal,
+ diagonal = diagonal,
exradius = exradius,
center = center,
length = length,
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
index c0749917f5..dbd6273205 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
@@ -1,7 +1,7 @@
-- tkz_elements_regular.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
index 4c3ce73800..e9854efbe3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
@@ -1,7 +1,7 @@
-- tkz_elements-square.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
index 4a0c892f60..d68084d5f8 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
@@ -1,7 +1,7 @@
-- tkz_elements_triangles.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
@@ -56,6 +56,15 @@ end
-----------------------
-- points --
-----------------------
+-- version 1.80
+function triangle: trilinear (a,b,c)
+ return barycenter_ ( {self.pa,a*self.a },{self.pb,b*self.b},{self.pc,c*self.c} )
+end
+
+function triangle: barycentric (a,b,c)
+ return barycenter_ ( {self.pa,a },{self.pb,b},{self.pc,c} )
+end
+
function triangle: bevan_point ()
return circum_center_ ( self : excentral_tr())
end
@@ -128,6 +137,11 @@ function triangle : point (t)
return self.ca : point ((t*p-self.c-self.b)/self.a)
end
end
+
+function triangle : soddy_center ()
+ local s,i,j,k
+ return soddy_center_ (self.pa,self.pb,self.pc)
+end
-------------------
-- Result -> line
-------------------
@@ -152,17 +166,20 @@ function triangle: symmedian_line (n)
end
function triangle: altitude (n)
- local a,b,c,o
+ local a,b,c,o,p
a = self.pa
b = self.pb
c = self.pc
o = ortho_center_ (a,b,c)
if n==1 then
- return line : new (b,intersection_ll_ (b,o,a,c))
+ p = projection_ (a,c,b)
+ return line : new (b,p)
elseif n==2 then
- return line : new (c,intersection_ll_ (c,o,a,b))
+ p = projection_ (a,b,c)
+ return line : new (c,p)
else
- return line : new (a,intersection_ll_ (a,o,b,c))
+ p = projection_ (b,c,a)
+ return line : new (a,p)
end
end
@@ -223,7 +240,7 @@ local a,b,c,i,u,v,w
end
end
-----------------------
--- circles --
+--- Result -> circles --
-----------------------
function triangle: euler_circle ()
return circle : new (euler_center_ ( self.pa , self.pb , self.pc),midpoint_( self.pb , self.pc))
@@ -281,6 +298,12 @@ local ma,mb,mc,sp
return circle : new (sp,projection_ (ma,mb,sp))
end
+
+function triangle : soddy_circle ()
+ local s,i
+ s,i = soddy_center_ (self.pa,self.pb,self.pc)
+ return circle : new ( s , i )
+end
-------------------
-- Result -> triangle
-------------------
@@ -367,19 +390,6 @@ function triangle: parallelogram ()
local x = self.pc + self.pa - self.pb
return x
end
-
-function triangle: check_equilateral ()
- local A,B,C,epsilon
- epsilon = 10 ^(-8)
- A = self.pb - self.pc
- B = self.pa - self.pc
- C = self.pa - self.pb
- if (point.abs(A)-point.abs(B) < epsilon) and (point.abs(B)-point.abs(C) < epsilon)
- then
- tex.print("equilateral !!")
- error("something went wrong!")
- end
-end
function triangle: area ()
return area_(self.pa,self.pb,self.pc)
@@ -396,15 +406,7 @@ end
function triangle: check_equilateral ()
return check_equilateral_ (self.pa,self.pb,self.pc)
end
-function triangle : soddy_center ()
- local s,i,j,k
- return soddy_center_ (self.pa,self.pb,self.pc)
-end
-function triangle : soddy_circle ()
- local s,i
- s,i = soddy_center_ (self.pa,self.pb,self.pc)
- return circle : new ( s , i )
-end
+
return triangle \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
index 17d5684304..c2802cd41f 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
@@ -1,7 +1,7 @@
-- tkz_elements_vectors.lua
--- date 23/12/24
--- version 1.72c
--- Copyright 2023 Alain Matthes
+-- date 2024/01/16
+-- version 1.82c
+-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
-- of this license or (at your option) any later version.
diff --git a/macros/latex/contrib/tkz/tkz-euclide/README.md b/macros/latex/contrib/tkz/tkz-euclide/README.md
index c50db0cb55..bb5e16af3a 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/README.md
+++ b/macros/latex/contrib/tkz/tkz-euclide/README.md
@@ -1,6 +1,5 @@
# tkz-euclide — for euclidean geometry
-
-Release 5.04c 2023/10/26
+Release 5.05c 2024/01/16
## Description
@@ -64,6 +63,7 @@ Other examples, in French, are on my site.
## History
+- 5.05c Correction of the documentation.
- 5.04c Some files have been renamed.
@@ -107,8 +107,7 @@ Complement in the documentation for the macro `\tkzDefCircle[R](....)`. You can
Thus `\tkzDrawSquare(A,B)` becomes `\tkzDefSquare(A,B)` `\tkzGetPoints{C}{D}` then
`\tkzDrawPolygon(A,B,C,D)` ;
-
-
+
If you want to draw a circle, you can't do so \tkzDrawCircle[R](A,1) . First you have to define the point through which the circle passes, so you have to do
`\tkzDefCircle[R](A,1)` `\tkzGetPoint{a}` and finally `\tkzDrawCircle(A,a)` . Another possibilty is to define a point on the circle `\tkzDefShiftPoint[A](1,O){a}` ;
@@ -150,32 +149,24 @@ Complement in the documentation for the macro `\tkzDefCircle[R](....)`. You can
Correct allocation for gold sublime and euclide triangles;
-
I added the option " next to" for the intersections LC and CC;
-
Correction option isoceles right;
-
`\tkzDefMidArc(O,A,B)` gives the middle of the arc center $O$ from $A$ to $B$;
Good news : Some useful tools have been added. They are present on an experimental basis and will undoubtedly need to be improved;
-
The options "orthogonal from and through" depend now of `tkzDefCircleBy`
-
`\tkzDotProduct(A,B,C)` computes the scalar product in an orthogonal reference system of the vectors $\overrightarrow{A,B}$ and $\overrightarrow{A,C}$.
`\tkzDotProduct(A,B,C)=aa'+bb' if vec{AB} =(a,b) and vec{AC} =(a',b')`
-
`\tkzPowerCircle(A)(B,C)` power of point $A$ with respect to the circle of center $B$ passing through $C$;
-
`\tkzDefRadicalAxis(A,B)(C,D)` Radical axis of two circles of center $A$ and $C$;
-
Some tests : `\tkzIsOrtho(A,B,C)` and `\tkzIsLinear(A,B,C)` The first indicates whether the lines AB and AC are orthogonal. The second indicates whether the points $A$, $B$ and $C$ are aligned;
`\tkzIsLinear(A,B,C)` if A, B, C are aligned then \tkzLineartrue
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex
index 6e98386a2d..7bdf444be9 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex
@@ -21,10 +21,10 @@
headings = small
]{tkz-doc}
\gdef\tkznameofpack{tkz-euclide}
-\gdef\tkzversionofpack{5.04c}
+\gdef\tkzversionofpack{5.05c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{doc-tkz-euclide}
-\gdef\tkzversionofdoc{5.04c}
+\gdef\tkzversionofdoc{5.05c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
index eac5c1a797..0d6149ff96 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex
@@ -1,5 +1,9 @@
\section*{News and compatibility}
+\subsection{With 5.05 version} % (fold)
+
+ Correction of the documentation in Complete but minimal example.
+
\subsection{With 5.03 version} % (fold)
\begin{itemize}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
index 6228a9b8a8..bb70c73788 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex
@@ -532,8 +532,8 @@ $IB=a$, $AI=1$
\tkzDrawSegment[style=orange](I,C)
\tkzDrawArc(M,B)(A)
\tkzDrawSegment[dim={$1$,-16pt,}](A,I)
- \tkzDrawSegment[dim={$a/2$,-10pt,}](I,M)
- \tkzDrawSegment[dim={$a/2$,-16pt,}](M,B)
+ \tkzDrawSegment[dim={$(a-1)/2$,-10pt,}](I,M)
+ \tkzDrawSegment[dim={$(a+1)/2$,-16pt,}](M,B)
\tkzMarkRightAngle[ra](A,I,C)
\tkzDrawPoints(I,A,B,C,M)
\tkzLabelPoint[left](A){$A(0,0)$}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
index 76a0b3c7f5..1e7e46b430 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
index 001c8f3226..4a83e27f02 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex
@@ -1,5 +1,5 @@
% tkz-tool-eu-angles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tool-eu-angles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tool-eu-angles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzSetUpArc
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
index aef5271531..30c1d594f1 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-draw-circles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-draw-circles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-draw-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzSetUpCircle
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
index 046bd4b9bd..fc1f5d524a 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-compass.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-compass.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-compass.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Author Alain Matthes
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
index cbacfdd3d4..a7b15ffcc1 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-draw-ellipses.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-draw-ellipses.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-draw-ellipses.tex}
\makeatletter
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
index 0a5c9c1be8..7ee9e0cf0d 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-draw-lines.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-draw-lines.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-draw-lines.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
index 520e3159e8..ac5eee4a3d 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex
@@ -1,5 +1,5 @@
% tkz-draw-points.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-draw-eu-points.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-draw-eu-points.tex}
\makeatletter
%<--------------------------------------------------------------------------->
% tkzSetUpPoint définit la forme d'un point
@@ -24,7 +24,7 @@
shape/.store in = \tkz@pt@shape,
size = \tkz@euc@pointsize,
color = \tkz@euc@pointcolor,
- fill = \tkz@euc@pointcolor,
+ fill = \tkz@euc@pointfillcolor,
shape = \tkz@euc@pointshape,
/tkzsetuppt/.search also = {/tikz},
}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
index df42073c07..b2a94785f5 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-polygons.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-polygons.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-polygons.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Polygon
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
index 1400924439..4b8beae952 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-protractor.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-protractor.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-protractor.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% !!! idea from Y. Combe !!!
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
index 31684e81fe..83d9c371c1 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-sectors.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-sectors.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-sectors.tex}
\makeatletter
%<----------------------- Sectors ------------------------------–>
\gdef\tkz@nums{0}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
index 7dd82c3f3b..fd829793ba 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex
@@ -1,5 +1,5 @@
%tkz-obj-eu-show.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-show.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-show.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% finding specific points in a triangle
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
index 5c25cf710e..acab14a9e9 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex
@@ -1,5 +1,5 @@
% tkz-eu-lib-marks.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-lib-eu-marks.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-lib-eu-marks.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Création des symboles
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
index f21fa29fd9..a353cb2169 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex
@@ -1,5 +1,5 @@
% tkz-lib-eu-shape.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-lib-eu-shape.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-lib-eu-shape.tex}
%<--------------------------------------------------------------------------–>
% Création des symboles
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
index 3dc06c7e29..ebfcfd365f 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-circles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -11,8 +11,8 @@
% The Current Maintainer of this work is Alain Matthes.
\def\fileversion{6.00}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 6.00 tkz-obj-eu-circles.tex}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 6.00 tkz-obj-eu-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzCircle center and one point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
index b6d733b242..2fd7b062a7 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex
@@ -1,5 +1,5 @@
% tkz-obj-lua-circles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-lua-circles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-lua-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzCircle center and one point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
index 3333524d78..ff47818ce5 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex
@@ -1,5 +1,5 @@
% tkz-tools-lua-points-by.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-lua-points-by.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-lua-points-by.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Transformations Géométriques
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
index 6003bb8efe..e37d8d41c1 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex
@@ -1,5 +1,5 @@
% tkz-obj-lua-points.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/01/23}
-\typeout{2023/01/23 5.04c tkz-obj-lua-points-spc.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/23}
+\typeout{2024/01/23 5.05c tkz-obj-lua-points-spc.tex}
\makeatletter
%add ExCenter
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
index fe5ba902c0..b781bac070 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex
@@ -1,5 +1,5 @@
% tkz-obj-lua-points-with.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-lua-points-with.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-lua-points-with.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Vectors
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
index 744639a8a3..ce88d4ef0c 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex
@@ -1,5 +1,5 @@
% tkz-obj-lua-points.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-lua-points.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-lua-points.tex}
\makeatletter
%<--------------------------------------------------------------------------->
% init def point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
index 1684d3b5cd..db87376b84 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-axesmin.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-axesmin}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-axesmin}
\makeatletter
\def\removedot#1.{#1}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
index 05b66f6f10..66454d0663 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-circles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-circles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzCircle center and one point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
index 2f57f39d16..832ecef382 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-circles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-circles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-circles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzCircle center and one point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
index e09d0b5b53..5f86300aae 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-grids.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-grids.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-grids.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Setup Grid
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
index 31bcc0d577..c51814eef6 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-lines.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-lines.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-lines.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% les lignes
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
index b23f431925..684abf37aa 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-points-by.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-points-by.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-points-by.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Transformations Géométriques
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
index 838d573ff2..258fd309d1 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-points-rnd.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-points-rnd.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-points-rnd.tex}
%<--------------------------------------------------------------------------–>
\makeatletter
%<-------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
index ac65123719..52a0cfb613 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-points.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-el-points.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-el-points.tex}
\makeatletter
%add ExCenter
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
index 9d73a8316f..7bb3ed0611 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex
@@ -1,5 +1,5 @@
% tkz-obj-el-points-with.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-points-with.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-points-with.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Vectors
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
index 70e6c0702a..974c593bb4 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-points.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-points.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-points.tex}
\makeatletter
%<--------------------------------------------------------------------------->
% init def point
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
index 6bdf499aa6..e73638800d 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-polygons.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-polygons.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-polygons.tex}
% bug in regular polygon side 2020/03/09
\makeatletter
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
index 0312eaca5d..eebaf5b511 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex
@@ -1,5 +1,5 @@
% tkz-obj-eu-triangles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-triangles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-triangles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% Triangle Equilateral
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
index b62312367e..5647683bbe 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
@@ -1,5 +1,5 @@
% tkz-euclide.cfg
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -16,9 +16,9 @@
% and save the file in a directory part of your TEXINPUTS environment
% variable.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-euclide.cfg}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-euclide.cfg}
%<------ colors ---------------------------------------–>
\def\tkz@backgroundcolor{white}
\def\tkz@textcolor{black}
@@ -29,6 +29,7 @@
%<-------------------------- points -----------------------------------–>
\def\tkz@euc@pointshape{circle}
\def\tkz@euc@pointcolor{\tkz@mainlinecolor}
+\def\tkz@euc@pointfillcolor{\tkz@euc@pointcolor!10}
\def\tkz@euc@labelcolor{\tkz@mainlinecolor}
\def\tkz@euc@pointsize{2}
\def\tkz@euc@pointpos{below right}
@@ -38,7 +39,7 @@
inner sep = 0pt,
shape = \tkz@euc@pointshape,
minimum size = \tkz@euc@pointsize,
- fill = \tkz@euc@pointcolor
+ fill = \tkz@euc@pointfillcolor
}
}
% label for the point
@@ -134,7 +135,7 @@ arc style/.style={%
\def\tkz@mk@fill{\tkz@otherlinecolor}
%<--------------------------------------------------------------------------–>
%<------------------------------ styles ---------------------------------–>
-\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2023
+\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2024
\tikzset{xlabel style/.style = {below = 3 pt,
inner sep = 1pt,
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
index 8c8208f98a..988d84de40 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty
@@ -1,5 +1,5 @@
% tkz-euclide.sty
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,11 +10,11 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
%-------------------------------------------------------------------------------
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-euclide.sty}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-euclide.sty}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tkz-euclide}[ 2023/10/26 5.04c for pure Euclidean Geometry ]
+\ProvidesPackage{tkz-euclide}[ 2024/01/16 5.05c for pure Euclidean Geometry ]
\newif\if@tkzlua
\@tkzluafalse
\DeclareOption{lua}{\@tkzluatrue}
@@ -70,11 +70,11 @@
{\pgfmath@y\dimexpr\pgfmath@y/10000\relax}
{}{\PatchFailed}
-%-------------------------------------------------------------------------------
+%-------------------------------
\newdimen\tkzRadius
\newdimen\tkzLength
\newdimen\tkz@radi
-%-------------------------------------------------------------------------------
+%-------------------------------
% tkz registres
\newdimen\tkz@ax
\newdimen\tkz@ay
@@ -121,9 +121,9 @@
\newif\iftkz@swap
\newif\iftkz@init@NO
\newif\iftkz@integer
-\newif\iftkz@Rep@orig%--------------------- Rep
+\newif\iftkz@Rep@orig%---------------------- Rep
\newif\iftkzLengthIncm%--------------------- Math
-\newif\iftkz@sop@show%--------------------- marks
+\newif\iftkz@sop@show%---------------------- marks
\newif\iftkz@equi@show
\newif\iftkz@gd@sub% sub grid ?%--------------------- about grid
\newif\iftkz@node\tkz@nodefalse
@@ -158,11 +158,11 @@
%<---------------------------------------------------------->
% Initialisation
%<---------------------------------------------------------->
+
\if@tkzlua
\RequirePackage{luacode}
\fi
-
\@ifpackageloaded{tkz-base}{}{%
% from base
\input{tkz-tools-eu-base.tex}
@@ -177,7 +177,7 @@
\input{tkz-obj-eu-points.tex}
\input{tkz-draw-eu-points.tex}
}
-% % next from euclide
+% next from euclide
\makeatletter
\if@tkzlua
\input{tkz-tools-eu-lua-base.tex}
@@ -206,7 +206,6 @@
\input{tkz-obj-eu-lines.tex}
\input{tkz-obj-eu-polygons.tex}
\input{tkz-obj-eu-triangles}
-
% drawings
\input{tkz-draw-eu-lines.tex}
\input{tkz-draw-eu-circles.tex}
@@ -217,5 +216,4 @@
\input{tkz-draw-eu-compass.tex}
\input{tkz-draw-eu-show.tex}
\input{tkz-draw-eu-protractor.tex}
-
\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
index e5c9d373c6..38c516af97 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex
@@ -1,5 +1,5 @@
% tkz-tools-lua-angles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-lua-angles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-lua-angles.tex}
\makeatletter
\def\tkzmathrotatepointaround#1#2#3{%
\pgf@process{%
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
index 45068a64e3..7466e412ca 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex
@@ -1,5 +1,5 @@
% tkz-tools-lua-base.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-lua-base.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-lua-base.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
index 127db80eba..8e675e781b 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex
@@ -1,5 +1,5 @@
% tkz-tools-lua-intersections.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -13,9 +13,9 @@
% The Current Maintainer of this work is Alain Matthes.
% utf8 encoding
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-lua-intersections.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-lua-intersections.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% intersection de deux lignes
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
index dc92fb70ca..3945213364 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex
@@ -1,5 +1,5 @@
% tkz-tools-lua-math.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-lua-math.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-lua-math.tex}
\makeatletter
%<-------------------------------------------------------------------------->
%<-------------------------------------------------------------------------->
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
index 3212c55e44..82b8a602e2 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-BB.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-obj-eu-BB.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-obj-eu-BB.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
\def\tkzShowBB{\pgfutil@ifnextchar[{\tkz@ShowBB}{\tkz@ShowBB[]}}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
index f32c105855..abbadef102 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex
@@ -1,5 +1,5 @@
% tkz-tools-angles.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-angles.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-angles.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
%<--------------------------------------------------------------------------–>
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
index 22a7787ae6..f034d12e9c 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-base.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-base.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-base.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
index b991a2fd22..074b294bdb 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-colors
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-colors}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-colors}
\makeatletter
%<------ Initialisation of the colors with tkzSetUpColors ----------------->
@@ -42,14 +42,14 @@
\def\tkzSetUpAllColors{\pgfutil@ifnextchar[{\tkz@SetUpAllColors}{%
\tkz@SetUpAllColors[]}}
\def\tkz@SetUpAllColors[#1]{%
- \pgfqkeys{/tkzsupallcol}{#1} % now we redine the based colors
+ \pgfqkeys{/tkzsupallcol}{#1} % now we redefines the based colors
\def\tkz@fillcolor{\tkz@suac@bkc}
\def\tkz@mainlinecolor{\tkz@suac@txt}
\def\tkz@textcolor{\tkz@suac@txt}
\def\tkz@otherlinecolor{\tkz@suac@txt!50}
\def\tkz@sua@color{\tkz@suac@txt}
\tkzSetUpAxis[color=\tkz@suac@txt]
- \tkzSetUpGrid[color=\tkz@suac@txt]
+ \tkzSetUpGrid[color=\tkz@suac@txt]
\pagecolor{\tkz@suac@bkc}
\color{\tkz@suac@txt}
}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
index fdab77f658..a380d31ea5 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex
@@ -1,5 +1,5 @@
% tkz-tools-intersections.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -13,9 +13,9 @@
% The Current Maintainer of this work is Alain Matthes.
% utf8 encoding
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-intersections.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-intersections.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% intersection de deux lignes
@@ -462,7 +462,7 @@
\edef\tkz@xx{\fpeval{\tkz@ax+\tkz@aa/\tkz@dd*(\tkz@bx - \tkz@ax)}}
\edef\tkz@yy{\fpeval{\tkz@ay+\tkz@aa/\tkz@dd*(\tkz@by - \tkz@ay)}}
\path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter);
-\edef\tkz@hh{\fpeval{sqrt(abs((\tkz@cx+\tkz@aa)*(\tkz@cx-\tkz@aa)))}}% abs !2023
+\edef\tkz@hh{\fpeval{sqrt(abs((\tkz@cx+\tkz@aa)*(\tkz@cx-\tkz@aa)))}}% abs !2024
\edef\tkz@rx{\fpeval{\tkz@hh / \tkz@dd * (\tkz@ay - \tkz@by)}}
\edef\tkz@ry{\fpeval{\tkz@hh / \tkz@dd * (\tkz@bx - \tkz@ax)}}
\edef\tkz@xs{\fpeval{\tkz@xx + \tkz@rx}}
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
index 9e39d90217..b9bef42168 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-math.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-math.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-math.tex}
\makeatletter
%<-------------------------------------------------------------------------->
% \tkzpointnormalised#
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
index 916b166af9..19b9b54a36 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex
@@ -1,5 +1,5 @@
% tkz-tools-modules
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-utilities.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-utilities.tex}
\makeatletter
%<------------- % chargement des modules ---------------------------------->
\def\tkz@obj@all{angles,arcs,compass,defcircles,deflines,defpoints,defpointsby,defpointsrnd,defpointswith,polygons,protractor,sectors,show,triangles}%
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
index 66dbf64bd7..a40f61c655 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-text.tex
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-text.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-text.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% tkzText
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
index 0bf0b046a9..b5d1b43331 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex
@@ -1,5 +1,5 @@
% tkz-tools-eu-utilities
-% Copyright 2023 Alain Matthes
+% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{5.04c}
-\def\filedate{2023/10/26}
-\typeout{2023/10/26 5.04c tkz-tools-eu-utilities.tex}
+\def\fileversion{5.05c}
+\def\filedate{2024/01/16}
+\typeout{2024/01/16 5.05c tkz-tools-eu-utilities.tex}
\makeatletter
\pgfkeys{/tkzClip/.cd,
space/.store in = {\tkz@CLI@space},
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index 1c3748eab3..8371f083c7 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,16 @@
+2024-01-15 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (tcolorbox.4ht): don't use \RecallEndP in
+ tcolorbox, it can lead to spurious </p> tags.
+ https://github.com/michal-h21/make4ht/issues/142#issuecomment-1891507567
+
+ * tex4ht-4ht.tex (tcolorbox.4ht): fixed support for breakable boxes.
+ https://github.com/michal-h21/make4ht/issues/142
+
+ * tex4ht-4ht.tex (usepackage.4ht, tikz-hooks.4ht, pgf-hooks.4ht):
+ load the Dvisvgm driver for PGF when the PFG package is used.
+ https://github.com/michal-h21/make4ht/issues/142
+
2024-01-13 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (memoir.4ht): don't load booktabs.4ht from
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index 12ae8e003e..9372b02b23 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1438 2024-01-13 16:45:49Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1442 2024-01-15 22:00:31Z karl $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -4891,7 +4891,7 @@ converted to SVG by default.
\<tikz-hooks.4ht\><<<
% tikz-hooks.4ht (|version), generated from |jobname.tex
-% Copyright 2020-2023 TeX Users Group
+% Copyright 2020-2024 TeX Users Group
|<TeX4ht license text|>
\ifdefined\pgfsysdriver\else%
\typeout{*****************************}
@@ -4921,6 +4921,38 @@ converted to SVG by default.
\fi
>>> \AddFile{9}{tikz-hooks}
+%%%%%%%%%%%%%%%%%%%
+\Section{pgf.sty}
+%%%%%%%%%%%%%%%%%%%
+
+\<pgf.4ht\><<<
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% pgf.4ht |version %
+% Copyright (C) |CopyYear.2003. Eitan M. Gurari %
+|<TeX4ht copyright|>
+\Hinput{pgf}
+\endinput
+>>> \AddFile{9}{pgf}
+
+\<add to usepackage\><<<
+\Configure{PackageHooks}{pgf.sty}{pgf-hooks.4ht}
+>>>
+
+The following code loads the dvisvgm driver for TeX4ht. The default
+TeX4ht driver provided by TikZ doesn't work well.
+
+\<pgf-hooks.4ht\><<<
+% pgf-hooks.4ht (|version), generated from |jobname.tex
+% Copyright 2024 TeX Users Group
+|<TeX4ht license text|>
+\ifdefined\pgfsysdriver\else%
+ \typeout{*****************************}
+ \typeout{TeX4ht info: Using dvisvgm4ht TikZ driver. Put \detokenize{\def\pgfsysdriver{driver-name}} to your
+ document before use of TikZ if you want to another driver. Use tikz+ option if your TikZ pictures use patterns.}%
+ \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}%
+\fi%
+>>> \AddFile{9}{pgf-hooks}
+
%%%%%%%%%%%%%%%%%%
\Section{pdfbase.sty}
%%%%%%%%%%%%%%%%%%
@@ -28180,18 +28212,6 @@ be wrapped around \''\mfpic ... \endmfpic',
\Configure{ @V}{}{}
>>>
-%%%%%%%%%%%%%%%%%%%
-\Section{pgf.sty}
-%%%%%%%%%%%%%%%%%%%
-
-\<pgf.4ht\><<<
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% pgf.4ht |version %
-% Copyright (C) |CopyYear.2003. Eitan M. Gurari %
-|<TeX4ht copyright|>
-\Hinput{pgf}
-\endinput
->>> \AddFile{9}{pgf}
%%%%%%%%%%%%%%%%%%%%%%%
\Section{color.sty}
@@ -28595,7 +28615,7 @@ We need to use dvips driver with XeLaTeX
%%%%%%%%%%%%%%%%%%%%%%%
\<tcolorbox.4ht\><<<
% tcolorbox.4ht (|version), generated from |jobname.tex
-% Copyright 2020-2023 TeX Users Group
+% Copyright 2020-2024 TeX Users Group
|<TeX4ht license text|>
% use custom counter that increments for every \tcolorbox
@@ -28627,7 +28647,9 @@ We need to use dvips driver with XeLaTeX
\c:tcolorbox%
\box\tcb@upperbox%
% the paragraph opened in the upper box can be unclosed
- \RecallEndP
+ % but I cannot find an example where it matters. \RecallEndP caused issues in the following sample:
+ % https://github.com/michal-h21/make4ht/issues/142#issuecomment-1891507567
+ % \RecallEndP
% deal with lower box, if it is set
\iftcb@hasLower%
\a:tcolorlowerbox%
@@ -28640,6 +28662,7 @@ We need to use dvips driver with XeLaTeX
\HLet\tcb@drawcolorbox\:tempa
% overwrite other versions of box drawing macros
\HLet\tcb@drawcolorbox@standalone\:tempa
+\HLet\tcb@drawcolorbox@breakable\:tempa
% save the state of paragraph before opening the content box
\pend:def\tcb@set@@upper@and@lower{\SaveEndP}
diff --git a/timestamp b/timestamp
index ae42f21ae6..b4e062df94 100644
--- a/timestamp
+++ b/timestamp
@@ -2,4 +2,4 @@
# The source CTAN of this site's material:
dante.ctan.org
# The year-month-day-hour-minute of this site's material:
-2024-01-16-02-02
+2024-01-17-02-02